svelte-firekit 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +58 -0
  2. package/dist/auth/reset-password.svelte +20 -0
  3. package/dist/auth/reset-password.svelte.d.ts +18 -0
  4. package/dist/auth/sign-in.svelte +30 -0
  5. package/dist/auth/sign-in.svelte.d.ts +4 -0
  6. package/dist/auth/sign-up.svelte +30 -0
  7. package/dist/auth/sign-up.svelte.d.ts +4 -0
  8. package/dist/auth/uid.d.ts +1 -0
  9. package/dist/auth/uid.js +7 -0
  10. package/dist/auth/user-button.svelte +117 -0
  11. package/dist/auth/user-button.svelte.d.ts +5 -0
  12. package/dist/auth/user.svelte.d.ts +10 -0
  13. package/dist/auth/user.svelte.js +21 -0
  14. package/dist/auth.d.ts +39 -0
  15. package/dist/auth.js +100 -0
  16. package/dist/components/auth/google-sign-in.svelte +46 -0
  17. package/dist/components/auth/google-sign-in.svelte.d.ts +4 -0
  18. package/dist/components/auth/reset-password-form.svelte +58 -0
  19. package/dist/components/auth/reset-password-form.svelte.d.ts +18 -0
  20. package/dist/components/auth/sign-in-form.svelte +77 -0
  21. package/dist/components/auth/sign-in-form.svelte.d.ts +18 -0
  22. package/dist/components/auth/sign-up-form.svelte +112 -0
  23. package/dist/components/auth/sign-up-form.svelte.d.ts +18 -0
  24. package/dist/components/ui/alert-dialog/alert-dialog-action.svelte +13 -0
  25. package/dist/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +3 -0
  26. package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte +17 -0
  27. package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +3 -0
  28. package/dist/components/ui/alert-dialog/alert-dialog-content.svelte +23 -0
  29. package/dist/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +2 -0
  30. package/dist/components/ui/alert-dialog/alert-dialog-description.svelte +16 -0
  31. package/dist/components/ui/alert-dialog/alert-dialog-description.svelte.d.ts +3 -0
  32. package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
  33. package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +4 -0
  34. package/dist/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
  35. package/dist/components/ui/alert-dialog/alert-dialog-header.svelte.d.ts +4 -0
  36. package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte +19 -0
  37. package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +3 -0
  38. package/dist/components/ui/alert-dialog/alert-dialog-title.svelte +18 -0
  39. package/dist/components/ui/alert-dialog/alert-dialog-title.svelte.d.ts +3 -0
  40. package/dist/components/ui/alert-dialog/index.js +15 -0
  41. package/dist/components/ui/avatar/avatar-fallback.svelte +16 -0
  42. package/dist/components/ui/avatar/avatar-fallback.svelte.d.ts +3 -0
  43. package/dist/components/ui/avatar/avatar-image.svelte +20 -0
  44. package/dist/components/ui/avatar/avatar-image.svelte.d.ts +3 -0
  45. package/dist/components/ui/avatar/avatar.svelte +18 -0
  46. package/dist/components/ui/avatar/avatar.svelte.d.ts +3 -0
  47. package/dist/components/ui/avatar/index.d.ts +4 -0
  48. package/dist/components/ui/avatar/index.js +6 -0
  49. package/dist/components/ui/button/button.svelte +75 -0
  50. package/dist/components/ui/button/button.svelte.d.ts +117 -0
  51. package/dist/components/ui/button/index.d.ts +2 -0
  52. package/dist/components/ui/button/index.js +4 -0
  53. package/dist/components/ui/card/card-content.svelte +16 -0
  54. package/dist/components/ui/card/card-content.svelte.d.ts +4 -0
  55. package/dist/components/ui/card/card-description.svelte +16 -0
  56. package/dist/components/ui/card/card-description.svelte.d.ts +4 -0
  57. package/dist/components/ui/card/card-footer.svelte +16 -0
  58. package/dist/components/ui/card/card-footer.svelte.d.ts +4 -0
  59. package/dist/components/ui/card/card-header.svelte +16 -0
  60. package/dist/components/ui/card/card-header.svelte.d.ts +4 -0
  61. package/dist/components/ui/card/card-title.svelte +25 -0
  62. package/dist/components/ui/card/card-title.svelte.d.ts +7 -0
  63. package/dist/components/ui/card/card.svelte +20 -0
  64. package/dist/components/ui/card/card.svelte.d.ts +4 -0
  65. package/dist/components/ui/card/index.d.ts +7 -0
  66. package/dist/components/ui/card/index.js +9 -0
  67. package/dist/components/ui/checkbox/checkbox.svelte +33 -0
  68. package/dist/components/ui/checkbox/checkbox.svelte.d.ts +3 -0
  69. package/dist/components/ui/checkbox/index.d.ts +2 -0
  70. package/dist/components/ui/checkbox/index.js +4 -0
  71. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +37 -0
  72. package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +5 -0
  73. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +22 -0
  74. package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +3 -0
  75. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +19 -0
  76. package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +11 -0
  77. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +23 -0
  78. package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +17 -0
  79. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +23 -0
  80. package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +7 -0
  81. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +30 -0
  82. package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +3 -0
  83. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +16 -0
  84. package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +3 -0
  85. package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  86. package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +4 -0
  87. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +19 -0
  88. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +3 -0
  89. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +28 -0
  90. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +5 -0
  91. package/dist/components/ui/dropdown-menu/index.js +17 -0
  92. package/dist/components/ui/form/form-button.svelte +7 -0
  93. package/dist/components/ui/form/form-button.svelte.d.ts +3 -0
  94. package/dist/components/ui/form/form-description.svelte +17 -0
  95. package/dist/components/ui/form/form-description.svelte.d.ts +3 -0
  96. package/dist/components/ui/form/form-element-field.svelte +30 -0
  97. package/dist/components/ui/form/form-element-field.svelte.d.ts +22 -0
  98. package/dist/components/ui/form/form-field-errors.svelte +30 -0
  99. package/dist/components/ui/form/form-field-errors.svelte.d.ts +5 -0
  100. package/dist/components/ui/form/form-field.svelte +30 -0
  101. package/dist/components/ui/form/form-field.svelte.d.ts +21 -0
  102. package/dist/components/ui/form/form-fieldset.svelte +21 -0
  103. package/dist/components/ui/form/form-fieldset.svelte.d.ts +19 -0
  104. package/dist/components/ui/form/form-label.svelte +21 -0
  105. package/dist/components/ui/form/form-label.svelte.d.ts +3 -0
  106. package/dist/components/ui/form/form-legend.svelte +17 -0
  107. package/dist/components/ui/form/form-legend.svelte.d.ts +3 -0
  108. package/dist/components/ui/form/index.d.ts +11 -0
  109. package/dist/components/ui/form/index.js +13 -0
  110. package/dist/components/ui/input/index.d.ts +2 -0
  111. package/dist/components/ui/input/index.js +4 -0
  112. package/dist/components/ui/input/input.svelte +22 -0
  113. package/dist/components/ui/input/input.svelte.d.ts +4 -0
  114. package/dist/components/ui/label/index.d.ts +2 -0
  115. package/dist/components/ui/label/index.js +4 -0
  116. package/dist/components/ui/label/label.svelte +19 -0
  117. package/dist/components/ui/label/label.svelte.d.ts +3 -0
  118. package/dist/components/ui/sonner/index.d.ts +1 -0
  119. package/dist/components/ui/sonner/index.js +1 -0
  120. package/dist/components/ui/sonner/sonner.svelte +20 -0
  121. package/dist/components/ui/sonner/sonner.svelte.d.ts +3 -0
  122. package/dist/config.d.ts +2 -0
  123. package/dist/config.js +39 -0
  124. package/dist/firebase.d.ts +43 -0
  125. package/dist/firebase.js +110 -0
  126. package/dist/firestore/Collection.svelte +148 -0
  127. package/dist/firestore/Collection.svelte.d.ts +27 -0
  128. package/dist/firestore/collection.svelte.js +207 -0
  129. package/dist/firestore/doc.svelte.d.ts +1 -0
  130. package/dist/firestore/doc.svelte.js +1 -0
  131. package/dist/firestore/firestore.d.ts +31 -0
  132. package/dist/firestore/firestore.js +100 -0
  133. package/dist/firestore/perf.d.ts +3 -0
  134. package/dist/firestore/perf.js +12 -0
  135. package/dist/index.d.ts +2 -0
  136. package/dist/index.js +3 -0
  137. package/dist/schemas/reset-password.d.ts +4 -0
  138. package/dist/schemas/reset-password.js +4 -0
  139. package/dist/schemas/sign-in.d.ts +5 -0
  140. package/dist/schemas/sign-in.js +5 -0
  141. package/dist/schemas/sign-up.d.ts +8 -0
  142. package/dist/schemas/sign-up.js +8 -0
  143. package/dist/types/nav.d.ts +9 -0
  144. package/dist/types/nav.js +1 -0
  145. package/dist/utils.d.ts +3 -0
  146. package/dist/utils.js +16 -0
  147. package/package.json +64 -0
@@ -0,0 +1,77 @@
1
+ <script lang="ts">
2
+ import { signInWithEmail } from "../../auth.js";
3
+ import { signInSchema } from "../../schemas/sign-in.js";
4
+ import {
5
+ superForm, defaults
6
+ } from "sveltekit-superforms";
7
+ import { Input } from "../ui/input/index.js";
8
+ import Button from "../ui/button/button.svelte";
9
+ import { valibot } from 'sveltekit-superforms/adapters';
10
+
11
+ const data = defaults(valibot(signInSchema));
12
+
13
+ import * as Form from "../ui/form/index.js";
14
+ import { toast } from "svelte-sonner";
15
+
16
+ const form = superForm(data, {
17
+ validators: valibot(signInSchema),
18
+ dataType: "json",
19
+ SPA: true,
20
+ resetForm: false,
21
+ clearOnSubmit: "errors-and-message",
22
+ async onUpdate({ form }) {
23
+ if (!form.valid) return;
24
+ try {
25
+ const { data } = form;
26
+ const { email, password } = data;
27
+ await signInWithEmail(email, password);
28
+ toast.success("Signed in successfully");
29
+ } catch (error) {
30
+ if (error instanceof Error) {
31
+ toast.error(error.message);
32
+ } else {
33
+ toast.error("An error occurred");
34
+ }
35
+ }
36
+ },
37
+ });
38
+
39
+ const { form: formData, enhance } = form;
40
+ </script>
41
+
42
+ <form method="POST" use:enhance class="space-y-2">
43
+ <Form.Field {form} name="email">
44
+ <Form.Control >
45
+ {#snippet children({ props })}
46
+ <Form.Label>Email</Form.Label>
47
+ <Input {...props} bind:value={$formData.email} placeholder="you@email.com"/>
48
+ {/snippet}
49
+
50
+ </Form.Control>
51
+ <Form.FieldErrors />
52
+ </Form.Field>
53
+ <Form.Field {form} name="password">
54
+ <Form.Control >
55
+ {#snippet children({ props })}
56
+
57
+ <div class="flex w-full items-center justify-between">
58
+ <Form.Label>Password</Form.Label>
59
+ <Button variant="link" class="text-sm" href="/reset-password "
60
+ >
61
+ I forgot my password
62
+ </Button
63
+ >
64
+ </div>
65
+ <Input
66
+ {...props}
67
+ bind:value={$formData.password}
68
+ placeholder="*********"
69
+ type="password"
70
+ />
71
+ {/snippet}
72
+
73
+ </Form.Control>
74
+ <Form.FieldErrors />
75
+ </Form.Field>
76
+ <Form.Button class="w-full">Sign In</Form.Button>
77
+ </form>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const SignInForm: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type SignInForm = InstanceType<typeof SignInForm>;
18
+ export default SignInForm;
@@ -0,0 +1,112 @@
1
+ <script lang="ts">
2
+ import { registerWithEmail } from "../../auth.js";
3
+ import * as Form from "../ui/form/index.js";
4
+ import { Input } from "../ui/input/index.js";
5
+ import { signUpSchema } from "../../schemas/sign-up.js";
6
+ import { toast } from "svelte-sonner";
7
+ import {
8
+ superForm,defaults
9
+ } from "sveltekit-superforms";
10
+ import { valibot } from 'sveltekit-superforms/adapters';
11
+ import Button from "../ui/button/button.svelte";
12
+ import Checkbox from "../ui/checkbox/checkbox.svelte";
13
+ const data = defaults(valibot(signUpSchema));
14
+
15
+ const form = superForm(data, {
16
+ validators: valibot(signUpSchema),
17
+ dataType: "json",
18
+ SPA: true,
19
+ resetForm: false,
20
+ clearOnSubmit: "errors-and-message",
21
+ async onUpdate({ form }) {
22
+ if (!form.valid) return;
23
+ try {
24
+ const { data } = form;
25
+ const { email, password, firstName, lastName } = data;
26
+ const displayName = `${firstName} ${lastName}`;
27
+ await registerWithEmail(email, password, displayName);
28
+ toast.success("Account created successfully");
29
+ } catch (error) {
30
+ if (error instanceof Error) {
31
+ toast.error(error.message);
32
+ } else {
33
+ toast.error("An error occurred");
34
+ }
35
+ }
36
+ },
37
+ });
38
+
39
+ const { form: formData, enhance } = form;
40
+ </script>
41
+
42
+ <form method="POST" use:enhance class="space-y-2">
43
+ <div class="grid grid-cols-2 gap-4">
44
+ <Form.Field {form} name="firstName">
45
+ <Form.Control >
46
+ {#snippet children({ props })}
47
+ <Form.Label>First Name</Form.Label>
48
+ <Input
49
+ {...props}
50
+ bind:value={$formData.firstName}
51
+ placeholder="John"
52
+ />
53
+ {/snippet}
54
+
55
+ </Form.Control>
56
+ <Form.FieldErrors />
57
+ </Form.Field>
58
+ <Form.Field {form} name="lastName">
59
+ <Form.Control >
60
+ {#snippet children({ props })}
61
+
62
+ <Form.Label>First Name</Form.Label>
63
+ <Input
64
+ {...props}
65
+ bind:value={$formData.lastName}
66
+ placeholder="Smith"
67
+ />
68
+ {/snippet}
69
+ </Form.Control>
70
+ <Form.FieldErrors />
71
+ </Form.Field>
72
+ </div>
73
+ <Form.Field {form} name="email">
74
+ <Form.Control >
75
+ {#snippet children({ props })}
76
+ <Form.Label>Email</Form.Label>
77
+ <Input {...props} bind:value={$formData.email} placeholder="you@email.com"/>
78
+ {/snippet}
79
+ </Form.Control>
80
+ <Form.FieldErrors />
81
+ </Form.Field>
82
+ <Form.Field {form} name="password">
83
+ <Form.Control >
84
+ {#snippet children({ props })}
85
+
86
+ <Form.Label>Password</Form.Label>
87
+ <Input
88
+ {...props}
89
+ bind:value={$formData.password}
90
+ placeholder="*********"
91
+ type="password"
92
+ />
93
+ {/snippet}
94
+ </Form.Control>
95
+ <Form.FieldErrors />
96
+ </Form.Field>
97
+ <Form.Field {form} name="agreeToTerms">
98
+ <Form.Control >
99
+ {#snippet children({ props })}
100
+ <Checkbox {...props} bind:checked={$formData.agreeToTerms} />
101
+
102
+ <Form.Label>
103
+ I accept the
104
+ <Button variant="link" href="/terms-and-conditions" class="p-0">Terms and Conditions</Button>
105
+ </Form.Label>
106
+
107
+ {/snippet}
108
+ </Form.Control>
109
+ <Form.FieldErrors />
110
+ </Form.Field>
111
+ <Form.Button class="w-full">Sign Up</Form.Button>
112
+ </form>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const SignUpForm: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type SignUpForm = InstanceType<typeof SignUpForm>;
18
+ export default SignUpForm;
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3
+ import { buttonVariants } from "../button/index.js";
4
+ import { cn } from "../../../utils.js";
5
+
6
+ let {
7
+ class: className,
8
+ ref = $bindable(null),
9
+ ...restProps
10
+ }: AlertDialogPrimitive.ActionProps = $props();
11
+ </script>
12
+
13
+ <AlertDialogPrimitive.Action bind:ref class={cn(buttonVariants(), className)} {...restProps} />
@@ -0,0 +1,3 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
2
+ declare const AlertDialogAction: import("svelte").Component<AlertDialogPrimitive.TriggerProps, {}, "ref">;
3
+ export default AlertDialogAction;
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3
+ import { buttonVariants } from "../button/index.js";
4
+ import { cn } from "../../../utils.js";
5
+
6
+ let {
7
+ class: className,
8
+ ref = $bindable(null),
9
+ ...restProps
10
+ }: AlertDialogPrimitive.CancelProps = $props();
11
+ </script>
12
+
13
+ <AlertDialogPrimitive.Cancel
14
+ bind:ref
15
+ class={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,3 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
2
+ declare const AlertDialogCancel: import("svelte").Component<AlertDialogPrimitive.TriggerProps, {}, "ref">;
3
+ export default AlertDialogCancel;
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive, type WithoutChild } from "bits-ui";
3
+ import AlertDialogOverlay from "./alert-dialog-overlay.svelte";
4
+ import { cn } from "../../../utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ ...restProps
10
+ }: WithoutChild<AlertDialogPrimitive.ContentProps> = $props();
11
+ </script>
12
+
13
+ <AlertDialogPrimitive.Portal>
14
+ <AlertDialogOverlay />
15
+ <AlertDialogPrimitive.Content
16
+ bind:ref
17
+ class={cn(
18
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",
19
+ className
20
+ )}
21
+ {...restProps}
22
+ />
23
+ </AlertDialogPrimitive.Portal>
@@ -0,0 +1,2 @@
1
+ declare const AlertDialogContent: import("svelte").Component<Omit<import("bits-ui").DialogContentProps, "child">, {}, "ref">;
2
+ export default AlertDialogContent;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ class: className,
7
+ ref = $bindable(null),
8
+ ...restProps
9
+ }: AlertDialogPrimitive.DescriptionProps = $props();
10
+ </script>
11
+
12
+ <AlertDialogPrimitive.Description
13
+ bind:ref
14
+ class={cn("text-muted-foreground text-sm", className)}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,3 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
2
+ declare const AlertDialogDescription: import("svelte").Component<AlertDialogPrimitive.DescriptionProps, {}, "ref">;
3
+ export default AlertDialogDescription;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { WithElementRef } from "bits-ui";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import { cn } from "../../../utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
12
+ </script>
13
+
14
+ <div
15
+ bind:this={ref}
16
+ class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { WithElementRef } from "bits-ui";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const AlertDialogFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ export default AlertDialogFooter;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { WithElementRef } from "bits-ui";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import { cn } from "../../../utils.js";
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
12
+ </script>
13
+
14
+ <div
15
+ bind:this={ref}
16
+ class={cn("flex flex-col space-y-2 text-center sm:text-left", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { WithElementRef } from "bits-ui";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const AlertDialogHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ export default AlertDialogHeader;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ class: className,
7
+ ref = $bindable(null),
8
+ ...restProps
9
+ }: AlertDialogPrimitive.OverlayProps = $props();
10
+ </script>
11
+
12
+ <AlertDialogPrimitive.Overlay
13
+ bind:ref
14
+ class={cn(
15
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",
16
+ className
17
+ )}
18
+ {...restProps}
19
+ />
@@ -0,0 +1,3 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
2
+ declare const AlertDialogOverlay: import("svelte").Component<AlertDialogPrimitive.OverlayProps, {}, "ref">;
3
+ export default AlertDialogOverlay;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ class: className,
7
+ level = 3,
8
+ ref = $bindable(null),
9
+ ...restProps
10
+ }: AlertDialogPrimitive.TitleProps = $props();
11
+ </script>
12
+
13
+ <AlertDialogPrimitive.Title
14
+ bind:ref
15
+ class={cn("text-lg font-semibold", className)}
16
+ {level}
17
+ {...restProps}
18
+ />
@@ -0,0 +1,3 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
2
+ declare const AlertDialogTitle: import("svelte").Component<AlertDialogPrimitive.TitleProps, {}, "ref">;
3
+ export default AlertDialogTitle;
@@ -0,0 +1,15 @@
1
+ import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
2
+ import Title from "./alert-dialog-title.svelte";
3
+ import Action from "./alert-dialog-action.svelte";
4
+ import Cancel from "./alert-dialog-cancel.svelte";
5
+ import Footer from "./alert-dialog-footer.svelte";
6
+ import Header from "./alert-dialog-header.svelte";
7
+ import Overlay from "./alert-dialog-overlay.svelte";
8
+ import Content from "./alert-dialog-content.svelte";
9
+ import Description from "./alert-dialog-description.svelte";
10
+ const Root = AlertDialogPrimitive.Root;
11
+ const Trigger = AlertDialogPrimitive.Trigger;
12
+ const Portal = AlertDialogPrimitive.Portal;
13
+ export { Root, Title, Action, Cancel, Portal, Footer, Header, Trigger, Overlay, Content, Description,
14
+ //
15
+ Root as AlertDialog, Title as AlertDialogTitle, Action as AlertDialogAction, Cancel as AlertDialogCancel, Portal as AlertDialogPortal, Footer as AlertDialogFooter, Header as AlertDialogHeader, Trigger as AlertDialogTrigger, Overlay as AlertDialogOverlay, Content as AlertDialogContent, Description as AlertDialogDescription, };
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ class: className,
7
+ ref = $bindable(null),
8
+ ...restProps
9
+ }: AvatarPrimitive.FallbackProps = $props();
10
+ </script>
11
+
12
+ <AvatarPrimitive.Fallback
13
+ bind:ref
14
+ class={cn("bg-muted flex h-full w-full items-center justify-center rounded-full", className)}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,3 @@
1
+ import { Avatar as AvatarPrimitive } from "bits-ui";
2
+ declare const AvatarFallback: import("svelte").Component<AvatarPrimitive.FallbackProps, {}, "ref">;
3
+ export default AvatarFallback;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ class: className,
7
+ src,
8
+ alt,
9
+ ref = $bindable(null),
10
+ ...restProps
11
+ }: AvatarPrimitive.ImageProps = $props();
12
+ </script>
13
+
14
+ <AvatarPrimitive.Image
15
+ bind:ref
16
+ {src}
17
+ {alt}
18
+ class={cn("aspect-square h-full w-full", className)}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,3 @@
1
+ import { Avatar as AvatarPrimitive } from "bits-ui";
2
+ declare const AvatarImage: import("svelte").Component<AvatarPrimitive.ImageProps, {}, "ref">;
3
+ export default AvatarImage;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ class: className,
7
+ ref = $bindable(null),
8
+ loadingStatus = $bindable("loading"),
9
+ ...restProps
10
+ }: AvatarPrimitive.RootProps = $props();
11
+ </script>
12
+
13
+ <AvatarPrimitive.Root
14
+ bind:loadingStatus
15
+ bind:ref
16
+ class={cn("relative flex size-10 shrink-0 overflow-hidden rounded-full", className)}
17
+ {...restProps}
18
+ />
@@ -0,0 +1,3 @@
1
+ import { Avatar as AvatarPrimitive } from "bits-ui";
2
+ declare const Avatar: import("svelte").Component<AvatarPrimitive.RootProps, {}, "ref" | "loadingStatus">;
3
+ export default Avatar;
@@ -0,0 +1,4 @@
1
+ import Root from "./avatar.svelte";
2
+ import Image from "./avatar-image.svelte";
3
+ import Fallback from "./avatar-fallback.svelte";
4
+ export { Root, Image, Fallback, Root as Avatar, Image as AvatarImage, Fallback as AvatarFallback, };
@@ -0,0 +1,6 @@
1
+ import Root from "./avatar.svelte";
2
+ import Image from "./avatar-image.svelte";
3
+ import Fallback from "./avatar-fallback.svelte";
4
+ export { Root, Image, Fallback,
5
+ //
6
+ Root as Avatar, Image as AvatarImage, Fallback as AvatarFallback, };
@@ -0,0 +1,75 @@
1
+ <script lang="ts" module>
2
+ import type { WithElementRef } from "bits-ui";
3
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
4
+ import { type VariantProps, tv } from "tailwind-variants";
5
+
6
+ export const buttonVariants = tv({
7
+ base: "focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
8
+ variants: {
9
+ variant: {
10
+ default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow",
11
+ destructive:
12
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",
13
+ outline:
14
+ "border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm",
15
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm",
16
+ ghost: "hover:bg-accent hover:text-accent-foreground",
17
+ link: "text-primary underline-offset-4 hover:underline",
18
+ },
19
+ size: {
20
+ default: "h-9 px-4 py-2",
21
+ sm: "h-8 rounded-md px-3 text-xs",
22
+ lg: "h-10 rounded-md px-8",
23
+ icon: "h-9 w-9",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ size: "default",
29
+ },
30
+ });
31
+
32
+ export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
33
+ export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
34
+
35
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
36
+ WithElementRef<HTMLAnchorAttributes> & {
37
+ variant?: ButtonVariant;
38
+ size?: ButtonSize;
39
+ };
40
+ </script>
41
+
42
+ <script lang="ts">
43
+ import { cn } from "../../../utils.js";
44
+
45
+ let {
46
+ class: className,
47
+ variant = "default",
48
+ size = "default",
49
+ ref = $bindable(null),
50
+ href = undefined,
51
+ type = "button",
52
+ children,
53
+ ...restProps
54
+ }: ButtonProps = $props();
55
+ </script>
56
+
57
+ {#if href}
58
+ <a
59
+ bind:this={ref}
60
+ class={cn(buttonVariants({ variant, size, className }))}
61
+ {href}
62
+ {...restProps}
63
+ >
64
+ {@render children?.()}
65
+ </a>
66
+ {:else}
67
+ <button
68
+ bind:this={ref}
69
+ class={cn(buttonVariants({ variant, size, className }))}
70
+ {type}
71
+ {...restProps}
72
+ >
73
+ {@render children?.()}
74
+ </button>
75
+ {/if}