Skip to content

Commit 3302fb8

Browse files
committed
feat: implement account deletion button
1 parent 90faeca commit 3302fb8

14 files changed

+321
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@tailwindcss/typography": "^0.5.14",
2222
"@types/eslint": "^9.6.0",
2323
"autoprefixer": "^10.4.20",
24+
"bits-ui": "^0.21.13",
2425
"eslint": "^9.0.0",
2526
"eslint-config-prettier": "^9.1.0",
2627
"eslint-plugin-svelte": "^2.36.0",
@@ -40,7 +41,6 @@
4041
"dependencies": {
4142
"@fontsource/hind-vadodara": "^5.1.0",
4243
"@sveltejs/adapter-node": "^5.2.2",
43-
"bits-ui": "^0.21.13",
4444
"clsx": "^2.1.1",
4545
"lucide-svelte": "^0.439.0",
4646
"mode-watcher": "^0.4.1",

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script lang="ts">
2+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3+
import { buttonVariants } from "$lib/components/ui/button/index.js";
4+
import { cn } from "$lib/utils.js";
5+
6+
type $$Props = AlertDialogPrimitive.ActionProps;
7+
type $$Events = AlertDialogPrimitive.ActionEvents;
8+
9+
let className: $$Props["class"] = undefined;
10+
export { className as class };
11+
</script>
12+
13+
<AlertDialogPrimitive.Action
14+
class={cn(buttonVariants(), className)}
15+
{...$$restProps}
16+
on:click
17+
on:keydown
18+
let:builder
19+
>
20+
<slot {builder} />
21+
</AlertDialogPrimitive.Action>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script lang="ts">
2+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3+
import { buttonVariants } from "$lib/components/ui/button/index.js";
4+
import { cn } from "$lib/utils.js";
5+
6+
type $$Props = AlertDialogPrimitive.CancelProps;
7+
type $$Events = AlertDialogPrimitive.CancelEvents;
8+
9+
let className: $$Props["class"] = undefined;
10+
export { className as class };
11+
</script>
12+
13+
<AlertDialogPrimitive.Cancel
14+
class={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
15+
{...$$restProps}
16+
on:click
17+
on:keydown
18+
let:builder
19+
>
20+
<slot {builder} />
21+
</AlertDialogPrimitive.Cancel>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<script lang="ts">
2+
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3+
import * as AlertDialog from './index.js';
4+
import { cn, flyAndScale } from '$lib/utils.js';
5+
6+
type $$Props = AlertDialogPrimitive.ContentProps;
7+
8+
export let transition: $$Props['transition'] = flyAndScale;
9+
export let transitionConfig: $$Props['transitionConfig'] = undefined;
10+
11+
let className: $$Props['class'] = undefined;
12+
export { className as class };
13+
</script>
14+
15+
<AlertDialog.Portal>
16+
<AlertDialog.Overlay />
17+
<AlertDialogPrimitive.Content
18+
{transition}
19+
{transitionConfig}
20+
class={cn(
21+
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg max-sm:max-w-[calc(100vw-2rem)] sm:rounded-lg md:w-full',
22+
className
23+
)}
24+
{...$$restProps}
25+
>
26+
<slot />
27+
</AlertDialogPrimitive.Content>
28+
</AlertDialog.Portal>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script lang="ts">
2+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3+
import { cn } from "$lib/utils.js";
4+
5+
type $$Props = AlertDialogPrimitive.DescriptionProps;
6+
7+
let className: $$Props["class"] = undefined;
8+
export { className as class };
9+
</script>
10+
11+
<AlertDialogPrimitive.Description
12+
class={cn("text-muted-foreground text-sm", className)}
13+
{...$$restProps}
14+
>
15+
<slot />
16+
</AlertDialogPrimitive.Description>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script lang="ts">
2+
import type { HTMLAttributes } from "svelte/elements";
3+
import { cn } from "$lib/utils.js";
4+
5+
type $$Props = HTMLAttributes<HTMLDivElement>;
6+
7+
let className: $$Props["class"] = undefined;
8+
export { className as class };
9+
</script>
10+
11+
<div
12+
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
13+
{...$$restProps}
14+
>
15+
<slot />
16+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<script lang="ts">
2+
import type { HTMLAttributes } from "svelte/elements";
3+
import { cn } from "$lib/utils.js";
4+
5+
type $$Props = HTMLAttributes<HTMLDivElement>;
6+
7+
let className: $$Props["class"] = undefined;
8+
export { className as class };
9+
</script>
10+
11+
<div class={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...$$restProps}>
12+
<slot />
13+
</div>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script lang="ts">
2+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3+
import { fade } from "svelte/transition";
4+
import { cn } from "$lib/utils.js";
5+
6+
type $$Props = AlertDialogPrimitive.OverlayProps;
7+
8+
let className: $$Props["class"] = undefined;
9+
export let transition: $$Props["transition"] = fade;
10+
export let transitionConfig: $$Props["transitionConfig"] = {
11+
duration: 150,
12+
};
13+
export { className as class };
14+
</script>
15+
16+
<AlertDialogPrimitive.Overlay
17+
{transition}
18+
{transitionConfig}
19+
class={cn("bg-background/80 fixed inset-0 z-50 backdrop-blur-sm ", className)}
20+
{...$$restProps}
21+
/>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script lang="ts">
2+
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3+
4+
type $$Props = AlertDialogPrimitive.PortalProps;
5+
</script>
6+
7+
<AlertDialogPrimitive.Portal {...$$restProps}>
8+
<slot />
9+
</AlertDialogPrimitive.Portal>

0 commit comments

Comments
 (0)