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.
- package/README.md +58 -0
- package/dist/auth/reset-password.svelte +20 -0
- package/dist/auth/reset-password.svelte.d.ts +18 -0
- package/dist/auth/sign-in.svelte +30 -0
- package/dist/auth/sign-in.svelte.d.ts +4 -0
- package/dist/auth/sign-up.svelte +30 -0
- package/dist/auth/sign-up.svelte.d.ts +4 -0
- package/dist/auth/uid.d.ts +1 -0
- package/dist/auth/uid.js +7 -0
- package/dist/auth/user-button.svelte +117 -0
- package/dist/auth/user-button.svelte.d.ts +5 -0
- package/dist/auth/user.svelte.d.ts +10 -0
- package/dist/auth/user.svelte.js +21 -0
- package/dist/auth.d.ts +39 -0
- package/dist/auth.js +100 -0
- package/dist/components/auth/google-sign-in.svelte +46 -0
- package/dist/components/auth/google-sign-in.svelte.d.ts +4 -0
- package/dist/components/auth/reset-password-form.svelte +58 -0
- package/dist/components/auth/reset-password-form.svelte.d.ts +18 -0
- package/dist/components/auth/sign-in-form.svelte +77 -0
- package/dist/components/auth/sign-in-form.svelte.d.ts +18 -0
- package/dist/components/auth/sign-up-form.svelte +112 -0
- package/dist/components/auth/sign-up-form.svelte.d.ts +18 -0
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte +13 -0
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +3 -0
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte +17 -0
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +3 -0
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte +23 -0
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +2 -0
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte +16 -0
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte.d.ts +3 -0
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +4 -0
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte.d.ts +4 -0
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte +19 -0
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +3 -0
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte +18 -0
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte.d.ts +3 -0
- package/dist/components/ui/alert-dialog/index.js +15 -0
- package/dist/components/ui/avatar/avatar-fallback.svelte +16 -0
- package/dist/components/ui/avatar/avatar-fallback.svelte.d.ts +3 -0
- package/dist/components/ui/avatar/avatar-image.svelte +20 -0
- package/dist/components/ui/avatar/avatar-image.svelte.d.ts +3 -0
- package/dist/components/ui/avatar/avatar.svelte +18 -0
- package/dist/components/ui/avatar/avatar.svelte.d.ts +3 -0
- package/dist/components/ui/avatar/index.d.ts +4 -0
- package/dist/components/ui/avatar/index.js +6 -0
- package/dist/components/ui/button/button.svelte +75 -0
- package/dist/components/ui/button/button.svelte.d.ts +117 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/index.js +4 -0
- package/dist/components/ui/card/card-content.svelte +16 -0
- package/dist/components/ui/card/card-content.svelte.d.ts +4 -0
- package/dist/components/ui/card/card-description.svelte +16 -0
- package/dist/components/ui/card/card-description.svelte.d.ts +4 -0
- package/dist/components/ui/card/card-footer.svelte +16 -0
- package/dist/components/ui/card/card-footer.svelte.d.ts +4 -0
- package/dist/components/ui/card/card-header.svelte +16 -0
- package/dist/components/ui/card/card-header.svelte.d.ts +4 -0
- package/dist/components/ui/card/card-title.svelte +25 -0
- package/dist/components/ui/card/card-title.svelte.d.ts +7 -0
- package/dist/components/ui/card/card.svelte +20 -0
- package/dist/components/ui/card/card.svelte.d.ts +4 -0
- package/dist/components/ui/card/index.d.ts +7 -0
- package/dist/components/ui/card/index.js +9 -0
- package/dist/components/ui/checkbox/checkbox.svelte +33 -0
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +3 -0
- package/dist/components/ui/checkbox/index.d.ts +2 -0
- package/dist/components/ui/checkbox/index.js +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +37 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +5 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +22 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +3 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +11 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +17 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +23 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +30 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +3 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +16 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +3 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +4 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +19 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +3 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +28 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +5 -0
- package/dist/components/ui/dropdown-menu/index.js +17 -0
- package/dist/components/ui/form/form-button.svelte +7 -0
- package/dist/components/ui/form/form-button.svelte.d.ts +3 -0
- package/dist/components/ui/form/form-description.svelte +17 -0
- package/dist/components/ui/form/form-description.svelte.d.ts +3 -0
- package/dist/components/ui/form/form-element-field.svelte +30 -0
- package/dist/components/ui/form/form-element-field.svelte.d.ts +22 -0
- package/dist/components/ui/form/form-field-errors.svelte +30 -0
- package/dist/components/ui/form/form-field-errors.svelte.d.ts +5 -0
- package/dist/components/ui/form/form-field.svelte +30 -0
- package/dist/components/ui/form/form-field.svelte.d.ts +21 -0
- package/dist/components/ui/form/form-fieldset.svelte +21 -0
- package/dist/components/ui/form/form-fieldset.svelte.d.ts +19 -0
- package/dist/components/ui/form/form-label.svelte +21 -0
- package/dist/components/ui/form/form-label.svelte.d.ts +3 -0
- package/dist/components/ui/form/form-legend.svelte +17 -0
- package/dist/components/ui/form/form-legend.svelte.d.ts +3 -0
- package/dist/components/ui/form/index.d.ts +11 -0
- package/dist/components/ui/form/index.js +13 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/index.js +4 -0
- package/dist/components/ui/input/input.svelte +22 -0
- package/dist/components/ui/input/input.svelte.d.ts +4 -0
- package/dist/components/ui/label/index.d.ts +2 -0
- package/dist/components/ui/label/index.js +4 -0
- package/dist/components/ui/label/label.svelte +19 -0
- package/dist/components/ui/label/label.svelte.d.ts +3 -0
- package/dist/components/ui/sonner/index.d.ts +1 -0
- package/dist/components/ui/sonner/index.js +1 -0
- package/dist/components/ui/sonner/sonner.svelte +20 -0
- package/dist/components/ui/sonner/sonner.svelte.d.ts +3 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +39 -0
- package/dist/firebase.d.ts +43 -0
- package/dist/firebase.js +110 -0
- package/dist/firestore/Collection.svelte +148 -0
- package/dist/firestore/Collection.svelte.d.ts +27 -0
- package/dist/firestore/collection.svelte.js +207 -0
- package/dist/firestore/doc.svelte.d.ts +1 -0
- package/dist/firestore/doc.svelte.js +1 -0
- package/dist/firestore/firestore.d.ts +31 -0
- package/dist/firestore/firestore.js +100 -0
- package/dist/firestore/perf.d.ts +3 -0
- package/dist/firestore/perf.js +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/schemas/reset-password.d.ts +4 -0
- package/dist/schemas/reset-password.js +4 -0
- package/dist/schemas/sign-in.d.ts +5 -0
- package/dist/schemas/sign-in.js +5 -0
- package/dist/schemas/sign-up.d.ts +8 -0
- package/dist/schemas/sign-up.js +8 -0
- package/dist/types/nav.d.ts +9 -0
- package/dist/types/nav.js +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +16 -0
- package/package.json +64 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import ChevronRight from "svelte-radix/ChevronRight.svelte";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
inset,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<DropdownMenuPrimitive.SubTriggerProps> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
18
|
+
bind:ref
|
|
19
|
+
class={cn(
|
|
20
|
+
"data-[highlighted]:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
21
|
+
inset && "pl-8",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
<ChevronRight class="ml-auto" />
|
|
28
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
2
|
+
import CheckboxItem from "./dropdown-menu-checkbox-item.svelte";
|
|
3
|
+
import Content from "./dropdown-menu-content.svelte";
|
|
4
|
+
import GroupHeading from "./dropdown-menu-group-heading.svelte";
|
|
5
|
+
import Item from "./dropdown-menu-item.svelte";
|
|
6
|
+
import Label from "./dropdown-menu-label.svelte";
|
|
7
|
+
import RadioItem from "./dropdown-menu-radio-item.svelte";
|
|
8
|
+
import Separator from "./dropdown-menu-separator.svelte";
|
|
9
|
+
import Shortcut from "./dropdown-menu-shortcut.svelte";
|
|
10
|
+
import SubContent from "./dropdown-menu-sub-content.svelte";
|
|
11
|
+
import SubTrigger from "./dropdown-menu-sub-trigger.svelte";
|
|
12
|
+
const Sub = DropdownMenuPrimitive.Sub;
|
|
13
|
+
const Root = DropdownMenuPrimitive.Root;
|
|
14
|
+
const Trigger = DropdownMenuPrimitive.Trigger;
|
|
15
|
+
const Group = DropdownMenuPrimitive.Group;
|
|
16
|
+
const RadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
17
|
+
export { CheckboxItem, Content, Root as DropdownMenu, CheckboxItem as DropdownMenuCheckboxItem, Content as DropdownMenuContent, Group as DropdownMenuGroup, GroupHeading as DropdownMenuGroupHeading, Item as DropdownMenuItem, Label as DropdownMenuLabel, RadioGroup as DropdownMenuRadioGroup, RadioItem as DropdownMenuRadioItem, Separator as DropdownMenuSeparator, Shortcut as DropdownMenuShortcut, Sub as DropdownMenuSub, SubContent as DropdownMenuSubContent, SubTrigger as DropdownMenuSubTrigger, Trigger as DropdownMenuTrigger, Group, GroupHeading, Item, Label, RadioGroup, RadioItem, Root, Separator, Shortcut, Sub, SubContent, SubTrigger, Trigger, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
import type { WithoutChild } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChild<FormPrimitive.DescriptionProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<FormPrimitive.Description
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn("text-muted-foreground text-[0.8rem]", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { FormPathLeaves as _FormPathLeaves } from "sveltekit-superforms";
|
|
3
|
+
type T = Record<string, unknown>;
|
|
4
|
+
type U = _FormPathLeaves<T>;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" generics="T extends Record<string, unknown>, U extends _FormPathLeaves<T>">
|
|
8
|
+
import * as FormPrimitive from "formsnap";
|
|
9
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
10
|
+
import type { WithElementRef } from "bits-ui";
|
|
11
|
+
import { cn } from "../../../utils.js";
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
ref = $bindable(null),
|
|
15
|
+
class: className,
|
|
16
|
+
form,
|
|
17
|
+
name,
|
|
18
|
+
children: childrenProp,
|
|
19
|
+
...restProps
|
|
20
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> &
|
|
21
|
+
FormPrimitive.ElementFieldProps<T, U> = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<FormPrimitive.ElementField {form} {name}>
|
|
25
|
+
{#snippet children({ constraints, errors, tainted, value })}
|
|
26
|
+
<div bind:this={ref} class={cn("space-y-2", className)} {...restProps}>
|
|
27
|
+
{@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}
|
|
28
|
+
</div>
|
|
29
|
+
{/snippet}
|
|
30
|
+
</FormPrimitive.ElementField>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FormPathLeaves as _FormPathLeaves } from "sveltekit-superforms";
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends _FormPathLeaves<T>> {
|
|
5
|
+
props(): HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
ref?: HTMLElement | null | undefined;
|
|
7
|
+
} & FormPrimitive.ElementFieldProps<T, U, any>;
|
|
8
|
+
events(): {};
|
|
9
|
+
slots(): {};
|
|
10
|
+
bindings(): "ref";
|
|
11
|
+
exports(): {};
|
|
12
|
+
}
|
|
13
|
+
interface $$IsomorphicComponent {
|
|
14
|
+
new <T extends Record<string, unknown>, U extends _FormPathLeaves<T>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, U>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, U>['props']>, ReturnType<__sveltets_Render<T, U>['events']>, ReturnType<__sveltets_Render<T, U>['slots']>> & {
|
|
15
|
+
$$bindings?: ReturnType<__sveltets_Render<T, U>['bindings']>;
|
|
16
|
+
} & ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
17
|
+
<T extends Record<string, unknown>, U extends _FormPathLeaves<T>>(internal: unknown, props: ReturnType<__sveltets_Render<T, U>['props']> & {}): ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
18
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
19
|
+
}
|
|
20
|
+
declare const FormElementField: $$IsomorphicComponent;
|
|
21
|
+
type FormElementField<T extends Record<string, unknown>, U extends _FormPathLeaves<T>> = InstanceType<typeof FormElementField<T, U>>;
|
|
22
|
+
export default FormElementField;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
import type { WithoutChild } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
errorClasses,
|
|
10
|
+
children: childrenProp,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<FormPrimitive.FieldErrorsProps> & {
|
|
13
|
+
errorClasses?: string | undefined | null;
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<FormPrimitive.FieldErrors
|
|
18
|
+
class={cn("text-destructive text-[0.8rem] font-medium", className)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
{#snippet children({ errors, errorProps })}
|
|
22
|
+
{#if childrenProp}
|
|
23
|
+
{@render childrenProp({ errors, errorProps })}
|
|
24
|
+
{:else}
|
|
25
|
+
{#each errors as error}
|
|
26
|
+
<div {...errorProps} class={cn(errorClasses)}>{error}</div>
|
|
27
|
+
{/each}
|
|
28
|
+
{/if}
|
|
29
|
+
{/snippet}
|
|
30
|
+
</FormPrimitive.FieldErrors>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { FormPath as _FormPath } from "sveltekit-superforms";
|
|
3
|
+
type T = Record<string, unknown>;
|
|
4
|
+
type U = _FormPath<T>;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" generics="T extends Record<string, unknown>, U extends _FormPath<T>">
|
|
8
|
+
import * as FormPrimitive from "formsnap";
|
|
9
|
+
import { cn } from "../../../utils.js";
|
|
10
|
+
import type { WithElementRef, WithoutChildren } from "bits-ui";
|
|
11
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
12
|
+
|
|
13
|
+
let {
|
|
14
|
+
ref = $bindable(null),
|
|
15
|
+
class: className,
|
|
16
|
+
form,
|
|
17
|
+
name,
|
|
18
|
+
children: childrenProp,
|
|
19
|
+
...restProps
|
|
20
|
+
}: FormPrimitive.FieldProps<T, U> &
|
|
21
|
+
WithoutChildren<WithElementRef<HTMLAttributes<HTMLDivElement>>> = $props();
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<FormPrimitive.Field {form} {name}>
|
|
25
|
+
{#snippet children({ constraints, errors, tainted, value })}
|
|
26
|
+
<div bind:this={ref} class={cn("space-y-2", className)} {...restProps}>
|
|
27
|
+
{@render childrenProp?.({ constraints, errors, tainted, value: value as T[U] })}
|
|
28
|
+
</div>
|
|
29
|
+
{/snippet}
|
|
30
|
+
</FormPrimitive.Field>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormPath as _FormPath } from "sveltekit-superforms";
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
import type { WithElementRef } from "bits-ui";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends _FormPath<T>> {
|
|
6
|
+
props(): FormPrimitive.FieldProps<T, U, any> & Omit<WithElementRef<HTMLAttributes<HTMLDivElement>>, "children">;
|
|
7
|
+
events(): {};
|
|
8
|
+
slots(): {};
|
|
9
|
+
bindings(): "ref";
|
|
10
|
+
exports(): {};
|
|
11
|
+
}
|
|
12
|
+
interface $$IsomorphicComponent {
|
|
13
|
+
new <T extends Record<string, unknown>, U extends _FormPath<T>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, U>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, U>['props']>, ReturnType<__sveltets_Render<T, U>['events']>, ReturnType<__sveltets_Render<T, U>['slots']>> & {
|
|
14
|
+
$$bindings?: ReturnType<__sveltets_Render<T, U>['bindings']>;
|
|
15
|
+
} & ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
16
|
+
<T extends Record<string, unknown>, U extends _FormPath<T>>(internal: unknown, props: ReturnType<__sveltets_Render<T, U>['props']> & {}): ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
17
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
18
|
+
}
|
|
19
|
+
declare const FormField: $$IsomorphicComponent;
|
|
20
|
+
type FormField<T extends Record<string, unknown>, U extends _FormPath<T>> = InstanceType<typeof FormField<T, U>>;
|
|
21
|
+
export default FormField;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { FormPath as _FormPath } from "sveltekit-superforms";
|
|
3
|
+
type T = Record<string, unknown>;
|
|
4
|
+
type U = _FormPath<T>;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" generics="T extends Record<string, unknown>, U extends _FormPath<T>">
|
|
8
|
+
import * as FormPrimitive from "formsnap";
|
|
9
|
+
import type { WithoutChild } from "bits-ui";
|
|
10
|
+
import { cn } from "../../../utils.js";
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
ref = $bindable(null),
|
|
14
|
+
class: className,
|
|
15
|
+
form,
|
|
16
|
+
name,
|
|
17
|
+
...restProps
|
|
18
|
+
}: WithoutChild<FormPrimitive.FieldsetProps<T, U>> = $props();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<FormPrimitive.Fieldset bind:ref {form} {name} class={cn("space-y-2", className)} {...restProps} />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FormPath as _FormPath } from "sveltekit-superforms";
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends _FormPath<T>> {
|
|
4
|
+
props(): Omit<FormPrimitive.FieldsetProps<T, U, any>, "child">;
|
|
5
|
+
events(): {};
|
|
6
|
+
slots(): {};
|
|
7
|
+
bindings(): "ref";
|
|
8
|
+
exports(): {};
|
|
9
|
+
}
|
|
10
|
+
interface $$IsomorphicComponent {
|
|
11
|
+
new <T extends Record<string, unknown>, U extends _FormPath<T>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, U>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, U>['props']>, ReturnType<__sveltets_Render<T, U>['events']>, ReturnType<__sveltets_Render<T, U>['slots']>> & {
|
|
12
|
+
$$bindings?: ReturnType<__sveltets_Render<T, U>['bindings']>;
|
|
13
|
+
} & ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
14
|
+
<T extends Record<string, unknown>, U extends _FormPath<T>>(internal: unknown, props: ReturnType<__sveltets_Render<T, U>['props']> & {}): ReturnType<__sveltets_Render<T, U>['exports']>;
|
|
15
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any>['bindings']>;
|
|
16
|
+
}
|
|
17
|
+
declare const FormFieldset: $$IsomorphicComponent;
|
|
18
|
+
type FormFieldset<T extends Record<string, unknown>, U extends _FormPath<T>> = InstanceType<typeof FormFieldset<T, U>>;
|
|
19
|
+
export default FormFieldset;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithoutChild } from "bits-ui";
|
|
3
|
+
import * as FormPrimitive from "formsnap";
|
|
4
|
+
import { Label } from "../label/index.js";
|
|
5
|
+
import { cn } from "../../../utils.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
children,
|
|
10
|
+
class: className,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<FormPrimitive.LabelProps> = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<FormPrimitive.Label {...restProps} bind:ref>
|
|
16
|
+
{#snippet child({ props })}
|
|
17
|
+
<Label {...props} class={cn("data-[fs-error]:text-destructive", className)}>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</Label>
|
|
20
|
+
{/snippet}
|
|
21
|
+
</FormPrimitive.Label>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
import type { WithoutChild } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChild<FormPrimitive.LegendProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<FormPrimitive.Legend
|
|
14
|
+
bind:ref
|
|
15
|
+
{...restProps}
|
|
16
|
+
class={cn("data-[fs-error]:text-destructive text-sm font-medium leading-none", className)}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as FormPrimitive from "formsnap";
|
|
2
|
+
import Description from "./form-description.svelte";
|
|
3
|
+
import Label from "./form-label.svelte";
|
|
4
|
+
import FieldErrors from "./form-field-errors.svelte";
|
|
5
|
+
import Field from "./form-field.svelte";
|
|
6
|
+
import Button from "./form-button.svelte";
|
|
7
|
+
import Fieldset from "./form-fieldset.svelte";
|
|
8
|
+
import Legend from "./form-legend.svelte";
|
|
9
|
+
import ElementField from "./form-element-field.svelte";
|
|
10
|
+
declare const Control: typeof FormPrimitive.Control;
|
|
11
|
+
export { Field, Control, Label, FieldErrors, Description, Fieldset, Legend, ElementField, Button, Field as FormField, Control as FormControl, Description as FormDescription, Label as FormLabel, FieldErrors as FormFieldErrors, Fieldset as FormFieldset, Legend as FormLegend, ElementField as FormElementField, Button as FormButton, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as FormPrimitive from "formsnap";
|
|
2
|
+
import Description from "./form-description.svelte";
|
|
3
|
+
import Label from "./form-label.svelte";
|
|
4
|
+
import FieldErrors from "./form-field-errors.svelte";
|
|
5
|
+
import Field from "./form-field.svelte";
|
|
6
|
+
import Button from "./form-button.svelte";
|
|
7
|
+
import Fieldset from "./form-fieldset.svelte";
|
|
8
|
+
import Legend from "./form-legend.svelte";
|
|
9
|
+
import ElementField from "./form-element-field.svelte";
|
|
10
|
+
const Control = FormPrimitive.Control;
|
|
11
|
+
export { Field, Control, Label, FieldErrors, Description, Fieldset, Legend, ElementField, Button,
|
|
12
|
+
//
|
|
13
|
+
Field as FormField, Control as FormControl, Description as FormDescription, Label as FormLabel, FieldErrors as FormFieldErrors, Fieldset as FormFieldset, Legend as FormLegend, ElementField as FormElementField, Button as FormButton, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLInputAttributes } from "svelte/elements";
|
|
3
|
+
import type { WithElementRef } from "bits-ui";
|
|
4
|
+
import { cn } from "../../../utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
value = $bindable(),
|
|
9
|
+
class: className,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithElementRef<HTMLInputAttributes> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<input
|
|
15
|
+
bind:this={ref}
|
|
16
|
+
class={cn(
|
|
17
|
+
"border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
bind:value
|
|
21
|
+
{...restProps}
|
|
22
|
+
/>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Label as LabelPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: LabelPrimitive.RootProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<LabelPrimitive.Root
|
|
13
|
+
bind:ref
|
|
14
|
+
class={cn(
|
|
15
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toaster } from "./sonner.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Toaster } from "./sonner.svelte";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Toaster as Sonner, type ToasterProps as SonnerProps } from "svelte-sonner";
|
|
3
|
+
import { mode } from "mode-watcher";
|
|
4
|
+
|
|
5
|
+
let restProps: SonnerProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<Sonner
|
|
9
|
+
theme={$mode}
|
|
10
|
+
class="toaster group"
|
|
11
|
+
toastOptions={{
|
|
12
|
+
classes: {
|
|
13
|
+
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
14
|
+
description: "group-[.toast]:text-muted-foreground",
|
|
15
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
16
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
17
|
+
},
|
|
18
|
+
}}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
package/dist/config.d.ts
ADDED
package/dist/config.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PUBLIC_FIREBASE_API_KEY, PUBLIC_FIREBASE_AUTH_DOMAIN, PUBLIC_FIREBASE_PROJECT_ID, PUBLIC_FIREBASE_STORAGE_BUCKET, PUBLIC_FIREBASE_MESSAGING_SENDER_ID, PUBLIC_FIREBASE_APP_ID, PUBLIC_FIREBASE_MEASUREMENT_ID } from '$env/static/public';
|
|
2
|
+
/**
|
|
3
|
+
* Checks for any missing Firebase environment variables and returns an array of missing variables.
|
|
4
|
+
* @returns {string[]} An array of missing variable names. Empty if none are missing.
|
|
5
|
+
*/
|
|
6
|
+
function getMissingFirebaseConfigVars() {
|
|
7
|
+
const missingVars = [];
|
|
8
|
+
// Check each Firebase config variable and add to missingVars array if undefined
|
|
9
|
+
if (!PUBLIC_FIREBASE_API_KEY)
|
|
10
|
+
missingVars.push('PUBLIC_FIREBASE_API_KEY');
|
|
11
|
+
if (!PUBLIC_FIREBASE_AUTH_DOMAIN)
|
|
12
|
+
missingVars.push('PUBLIC_FIREBASE_AUTH_DOMAIN');
|
|
13
|
+
if (!PUBLIC_FIREBASE_PROJECT_ID)
|
|
14
|
+
missingVars.push('PUBLIC_FIREBASE_PROJECT_ID');
|
|
15
|
+
if (!PUBLIC_FIREBASE_STORAGE_BUCKET)
|
|
16
|
+
missingVars.push('PUBLIC_FIREBASE_STORAGE_BUCKET');
|
|
17
|
+
if (!PUBLIC_FIREBASE_MESSAGING_SENDER_ID)
|
|
18
|
+
missingVars.push('PUBLIC_FIREBASE_MESSAGING_SENDER_ID');
|
|
19
|
+
if (!PUBLIC_FIREBASE_APP_ID)
|
|
20
|
+
missingVars.push('PUBLIC_FIREBASE_APP_ID');
|
|
21
|
+
if (!PUBLIC_FIREBASE_MEASUREMENT_ID)
|
|
22
|
+
missingVars.push('PUBLIC_FIREBASE_MEASUREMENT_ID'); // Optional but included for clarity
|
|
23
|
+
return missingVars;
|
|
24
|
+
}
|
|
25
|
+
// Use the function to check for missing variables and throw an error if any are missing
|
|
26
|
+
const missingVars = getMissingFirebaseConfigVars();
|
|
27
|
+
if (missingVars.length > 0) {
|
|
28
|
+
throw Error(`The following Firebase configuration variables are missing: ${missingVars.join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
// Define Firebase configuration
|
|
31
|
+
export const firebaseConfig = {
|
|
32
|
+
apiKey: PUBLIC_FIREBASE_API_KEY,
|
|
33
|
+
authDomain: PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
34
|
+
projectId: PUBLIC_FIREBASE_PROJECT_ID,
|
|
35
|
+
storageBucket: PUBLIC_FIREBASE_STORAGE_BUCKET,
|
|
36
|
+
messagingSenderId: PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
37
|
+
appId: PUBLIC_FIREBASE_APP_ID,
|
|
38
|
+
measurementId: PUBLIC_FIREBASE_MEASUREMENT_ID
|
|
39
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type FirebaseApp } from 'firebase/app';
|
|
2
|
+
import { type Firestore } from 'firebase/firestore';
|
|
3
|
+
import { type Auth } from 'firebase/auth';
|
|
4
|
+
import { type Functions } from 'firebase/functions';
|
|
5
|
+
import { type Database } from 'firebase/database';
|
|
6
|
+
import { type FirebaseStorage } from 'firebase/storage';
|
|
7
|
+
/**
|
|
8
|
+
* Initializes and returns the Firebase app instance.
|
|
9
|
+
* Ensures only one app instance is created and reused across invocations.
|
|
10
|
+
* @returns {FirebaseApp} The initialized Firebase application.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFirebaseApp(): FirebaseApp;
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves the Firestore database instance.
|
|
15
|
+
* Calls `getFirebaseApp` to ensure the app and Firestore are initialized.
|
|
16
|
+
* @returns {Firestore} The Firestore instance.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDb(): Firestore;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the Auth instance, initializing it if needed.
|
|
21
|
+
* @returns {Auth} The Auth instance.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getAuthInstance(): Auth;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves the Functions instance, initializing it if needed.
|
|
26
|
+
* @returns {Functions} The Functions instance.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFunctionsInstance(): Functions;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the Database instance, initializing it if needed.
|
|
31
|
+
* @returns {Database} The Database instance.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getDatabaseInstance(): Database;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves the Storage instance, initializing it if needed.
|
|
36
|
+
* @returns {FirebaseStorage} The Storage instance.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getStorageInstance(): FirebaseStorage;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new Firestore batch instance for performing atomic writes.
|
|
41
|
+
* @returns {WriteBatch} A new write batch instance.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getBatch(): import("@firebase/firestore").WriteBatch;
|