@autumnsgrove/groveengine 0.1.0
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 +163 -0
- package/dist/auth/jwt.d.ts +14 -0
- package/dist/auth/jwt.js +109 -0
- package/dist/auth/session.d.ts +42 -0
- package/dist/auth/session.js +105 -0
- package/dist/components/admin/GutterManager.svelte +910 -0
- package/dist/components/admin/GutterManager.svelte.d.ts +15 -0
- package/dist/components/admin/MarkdownEditor.svelte +3114 -0
- package/dist/components/admin/MarkdownEditor.svelte.d.ts +43 -0
- package/dist/components/custom/CollapsibleSection.svelte +74 -0
- package/dist/components/custom/CollapsibleSection.svelte.d.ts +15 -0
- package/dist/components/custom/ContentWithGutter.svelte +646 -0
- package/dist/components/custom/ContentWithGutter.svelte.d.ts +19 -0
- package/dist/components/custom/GutterItem.svelte +201 -0
- package/dist/components/custom/GutterItem.svelte.d.ts +11 -0
- package/dist/components/custom/LeftGutter.svelte +271 -0
- package/dist/components/custom/LeftGutter.svelte.d.ts +17 -0
- package/dist/components/custom/MobileTOC.svelte +273 -0
- package/dist/components/custom/MobileTOC.svelte.d.ts +11 -0
- package/dist/components/custom/TableOfContents.svelte +163 -0
- package/dist/components/custom/TableOfContents.svelte.d.ts +11 -0
- package/dist/components/gallery/ImageGallery.svelte +681 -0
- package/dist/components/gallery/ImageGallery.svelte.d.ts +11 -0
- package/dist/components/gallery/Lightbox.svelte +107 -0
- package/dist/components/gallery/Lightbox.svelte.d.ts +19 -0
- package/dist/components/gallery/LightboxCaption.svelte +25 -0
- package/dist/components/gallery/LightboxCaption.svelte.d.ts +11 -0
- package/dist/components/gallery/ZoomableImage.svelte +163 -0
- package/dist/components/gallery/ZoomableImage.svelte.d.ts +17 -0
- package/dist/components/ui/Accordion.svelte +74 -0
- package/dist/components/ui/Accordion.svelte.d.ts +42 -0
- package/dist/components/ui/Badge.svelte +48 -0
- package/dist/components/ui/Badge.svelte.d.ts +26 -0
- package/dist/components/ui/Button.svelte +74 -0
- package/dist/components/ui/Button.svelte.d.ts +34 -0
- package/dist/components/ui/Card.svelte +102 -0
- package/dist/components/ui/Card.svelte.d.ts +46 -0
- package/dist/components/ui/Dialog.svelte +91 -0
- package/dist/components/ui/Dialog.svelte.d.ts +43 -0
- package/dist/components/ui/Input.svelte +81 -0
- package/dist/components/ui/Input.svelte.d.ts +35 -0
- package/dist/components/ui/Select.svelte +69 -0
- package/dist/components/ui/Select.svelte.d.ts +36 -0
- package/dist/components/ui/Sheet.svelte +98 -0
- package/dist/components/ui/Sheet.svelte.d.ts +45 -0
- package/dist/components/ui/Skeleton.svelte +31 -0
- package/dist/components/ui/Skeleton.svelte.d.ts +26 -0
- package/dist/components/ui/Table.svelte +59 -0
- package/dist/components/ui/Table.svelte.d.ts +44 -0
- package/dist/components/ui/Tabs.svelte +76 -0
- package/dist/components/ui/Tabs.svelte.d.ts +41 -0
- package/dist/components/ui/Textarea.svelte +81 -0
- package/dist/components/ui/Textarea.svelte.d.ts +35 -0
- package/dist/components/ui/Toast.svelte +18 -0
- package/dist/components/ui/Toast.svelte.d.ts +7 -0
- package/dist/components/ui/accordion/accordion-content.svelte +24 -0
- package/dist/components/ui/accordion/accordion-content.svelte.d.ts +4 -0
- package/dist/components/ui/accordion/accordion-item.svelte +12 -0
- package/dist/components/ui/accordion/accordion-item.svelte.d.ts +4 -0
- package/dist/components/ui/accordion/accordion-trigger.svelte +29 -0
- package/dist/components/ui/accordion/accordion-trigger.svelte.d.ts +7 -0
- package/dist/components/ui/accordion/index.d.ts +6 -0
- package/dist/components/ui/accordion/index.js +8 -0
- package/dist/components/ui/badge/badge.svelte +50 -0
- package/dist/components/ui/badge/badge.svelte.d.ts +60 -0
- package/dist/components/ui/badge/index.d.ts +2 -0
- package/dist/components/ui/badge/index.js +2 -0
- package/dist/components/ui/button/button.svelte +82 -0
- package/dist/components/ui/button/button.svelte.d.ts +132 -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 +5 -0
- package/dist/components/ui/card/card-description.svelte +16 -0
- package/dist/components/ui/card/card-description.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-footer.svelte +16 -0
- package/dist/components/ui/card/card-footer.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-header.svelte +16 -0
- package/dist/components/ui/card/card-header.svelte.d.ts +5 -0
- package/dist/components/ui/card/card-title.svelte +25 -0
- package/dist/components/ui/card/card-title.svelte.d.ts +8 -0
- package/dist/components/ui/card/card.svelte +20 -0
- package/dist/components/ui/card/card.svelte.d.ts +5 -0
- package/dist/components/ui/card/index.d.ts +7 -0
- package/dist/components/ui/card/index.js +9 -0
- package/dist/components/ui/dialog/dialog-content.svelte +38 -0
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +9 -0
- package/dist/components/ui/dialog/dialog-description.svelte +16 -0
- package/dist/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-footer.svelte +20 -0
- package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-header.svelte +20 -0
- package/dist/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte +19 -0
- package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/dialog-title.svelte +16 -0
- package/dist/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
- package/dist/components/ui/dialog/index.d.ts +12 -0
- package/dist/components/ui/dialog/index.js +14 -0
- package/dist/components/ui/index.d.ts +26 -0
- package/dist/components/ui/index.js +29 -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 +46 -0
- package/dist/components/ui/input/input.svelte.d.ts +13 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/select/index.js +13 -0
- package/dist/components/ui/select/select-content.svelte +39 -0
- package/dist/components/ui/select/select-content.svelte.d.ts +7 -0
- package/dist/components/ui/select/select-group-heading.svelte +16 -0
- package/dist/components/ui/select/select-group-heading.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-item.svelte +37 -0
- package/dist/components/ui/select/select-item.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-scroll-down-button.svelte +19 -0
- package/dist/components/ui/select/select-scroll-down-button.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-scroll-up-button.svelte +19 -0
- package/dist/components/ui/select/select-scroll-up-button.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-separator.svelte +13 -0
- package/dist/components/ui/select/select-separator.svelte.d.ts +4 -0
- package/dist/components/ui/select/select-trigger.svelte +24 -0
- package/dist/components/ui/select/select-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/index.js +4 -0
- package/dist/components/ui/separator/separator.svelte +22 -0
- package/dist/components/ui/separator/separator.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/index.d.ts +12 -0
- package/dist/components/ui/sheet/index.js +14 -0
- package/dist/components/ui/sheet/sheet-content.svelte +53 -0
- package/dist/components/ui/sheet/sheet-content.svelte.d.ts +62 -0
- package/dist/components/ui/sheet/sheet-description.svelte +16 -0
- package/dist/components/ui/sheet/sheet-description.svelte.d.ts +4 -0
- package/dist/components/ui/sheet/sheet-footer.svelte +20 -0
- package/dist/components/ui/sheet/sheet-footer.svelte.d.ts +5 -0
- package/dist/components/ui/sheet/sheet-header.svelte +20 -0
- package/dist/components/ui/sheet/sheet-header.svelte.d.ts +5 -0
- package/dist/components/ui/sheet/sheet-overlay.svelte +21 -0
- package/dist/components/ui/sheet/sheet-overlay.svelte.d.ts +6 -0
- package/dist/components/ui/sheet/sheet-title.svelte +16 -0
- package/dist/components/ui/sheet/sheet-title.svelte.d.ts +4 -0
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/skeleton/index.js +4 -0
- package/dist/components/ui/skeleton/skeleton.svelte +17 -0
- package/dist/components/ui/skeleton/skeleton.svelte.d.ts +5 -0
- package/dist/components/ui/table/index.d.ts +9 -0
- package/dist/components/ui/table/index.js +11 -0
- package/dist/components/ui/table/table-body.svelte +16 -0
- package/dist/components/ui/table/table-body.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-caption.svelte +16 -0
- package/dist/components/ui/table/table-caption.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-cell.svelte +20 -0
- package/dist/components/ui/table/table-cell.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-footer.svelte +16 -0
- package/dist/components/ui/table/table-footer.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-head.svelte +23 -0
- package/dist/components/ui/table/table-head.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-header.svelte +16 -0
- package/dist/components/ui/table/table-header.svelte.d.ts +5 -0
- package/dist/components/ui/table/table-row.svelte +23 -0
- package/dist/components/ui/table/table-row.svelte.d.ts +5 -0
- package/dist/components/ui/table/table.svelte +18 -0
- package/dist/components/ui/table/table.svelte.d.ts +5 -0
- package/dist/components/ui/tabs/index.d.ts +6 -0
- package/dist/components/ui/tabs/index.js +8 -0
- package/dist/components/ui/tabs/tabs-content.svelte +19 -0
- package/dist/components/ui/tabs/tabs-content.svelte.d.ts +4 -0
- package/dist/components/ui/tabs/tabs-list.svelte +19 -0
- package/dist/components/ui/tabs/tabs-list.svelte.d.ts +4 -0
- package/dist/components/ui/tabs/tabs-trigger.svelte +19 -0
- package/dist/components/ui/tabs/tabs-trigger.svelte.d.ts +4 -0
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/index.js +4 -0
- package/dist/components/ui/textarea/textarea.svelte +24 -0
- package/dist/components/ui/textarea/textarea.svelte.d.ts +6 -0
- package/dist/components/ui/toast.d.ts +86 -0
- package/dist/components/ui/toast.js +99 -0
- package/dist/db/schema.sql +238 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +20 -0
- package/dist/payments/index.d.ts +33 -0
- package/dist/payments/index.js +47 -0
- package/dist/payments/shop.d.ts +165 -0
- package/dist/payments/shop.js +588 -0
- package/dist/payments/stripe/client.d.ts +231 -0
- package/dist/payments/stripe/client.js +198 -0
- package/dist/payments/stripe/index.d.ts +18 -0
- package/dist/payments/stripe/index.js +17 -0
- package/dist/payments/stripe/provider.d.ts +50 -0
- package/dist/payments/stripe/provider.js +530 -0
- package/dist/payments/types.d.ts +355 -0
- package/dist/payments/types.js +7 -0
- package/dist/server/logger.d.ts +53 -0
- package/dist/server/logger.js +252 -0
- package/dist/styles/content.css +514 -0
- package/dist/styles/tokens.css +175 -0
- package/dist/utils/api.d.ts +20 -0
- package/dist/utils/api.js +109 -0
- package/dist/utils/cn.d.ts +15 -0
- package/dist/utils/cn.js +18 -0
- package/dist/utils/csrf.d.ts +22 -0
- package/dist/utils/csrf.js +72 -0
- package/dist/utils/debounce.d.ts +7 -0
- package/dist/utils/debounce.js +14 -0
- package/dist/utils/gallery.d.ts +66 -0
- package/dist/utils/gallery.js +181 -0
- package/dist/utils/gutter.d.ts +54 -0
- package/dist/utils/gutter.js +169 -0
- package/dist/utils/imageProcessor.d.ts +58 -0
- package/dist/utils/imageProcessor.js +205 -0
- package/dist/utils/json.d.ts +17 -0
- package/dist/utils/json.js +26 -0
- package/dist/utils/markdown.d.ts +101 -0
- package/dist/utils/markdown.js +947 -0
- package/dist/utils/sanitize.d.ts +25 -0
- package/dist/utils/sanitize.js +127 -0
- package/dist/utils/validation.d.ts +46 -0
- package/dist/utils/validation.js +169 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +5 -0
- package/package.json +129 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Card as ShadcnCard,
|
|
4
|
+
CardHeader,
|
|
5
|
+
CardTitle,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardContent,
|
|
8
|
+
CardFooter
|
|
9
|
+
} from "./card";
|
|
10
|
+
import type { Snippet } from "svelte";
|
|
11
|
+
import { cn } from "../../utils";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Card component wrapper providing structured layout with header, content, and footer
|
|
15
|
+
*
|
|
16
|
+
* @prop {string} [title] - Card title (renders in CardHeader with CardTitle)
|
|
17
|
+
* @prop {string} [description] - Card description (renders in CardHeader with CardDescription)
|
|
18
|
+
* @prop {boolean} [hoverable=false] - Enable hover shadow effect for interactive cards
|
|
19
|
+
* @prop {Snippet} [header] - Custom header content (overrides title/description)
|
|
20
|
+
* @prop {Snippet} [footer] - Footer content (rendered in CardFooter)
|
|
21
|
+
* @prop {Snippet} [children] - Main card content (rendered in CardContent)
|
|
22
|
+
* @prop {string} [class] - Additional CSS classes for Card root
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Card title="Profile" description="Update your profile settings">
|
|
26
|
+
* <p>Card content here</p>
|
|
27
|
+
* </Card>
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <Card hoverable>
|
|
31
|
+
* {#snippet header()}
|
|
32
|
+
* <CustomHeader />
|
|
33
|
+
* {/snippet}
|
|
34
|
+
* Content here
|
|
35
|
+
* </Card>
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <Card title="Actions">
|
|
39
|
+
* {#snippet footer()}
|
|
40
|
+
* <Button>Save</Button>
|
|
41
|
+
* {/snippet}
|
|
42
|
+
* Form content
|
|
43
|
+
* </Card>
|
|
44
|
+
*/
|
|
45
|
+
interface Props {
|
|
46
|
+
title?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
hoverable?: boolean;
|
|
49
|
+
class?: string;
|
|
50
|
+
header?: Snippet;
|
|
51
|
+
footer?: Snippet;
|
|
52
|
+
children?: Snippet;
|
|
53
|
+
[key: string]: any; // Allow any additional props to be forwarded
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let {
|
|
57
|
+
title,
|
|
58
|
+
description,
|
|
59
|
+
hoverable = false,
|
|
60
|
+
class: className,
|
|
61
|
+
header,
|
|
62
|
+
footer,
|
|
63
|
+
children,
|
|
64
|
+
...restProps
|
|
65
|
+
}: Props = $props();
|
|
66
|
+
|
|
67
|
+
const cardClass = $derived(
|
|
68
|
+
cn(
|
|
69
|
+
hoverable && "hover:shadow-lg transition-shadow cursor-pointer",
|
|
70
|
+
className
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<ShadcnCard class={cardClass} {...restProps}>
|
|
76
|
+
{#if header || title || description}
|
|
77
|
+
<CardHeader>
|
|
78
|
+
{#if header}
|
|
79
|
+
{@render header()}
|
|
80
|
+
{:else}
|
|
81
|
+
{#if title}
|
|
82
|
+
<CardTitle>{title}</CardTitle>
|
|
83
|
+
{/if}
|
|
84
|
+
{#if description}
|
|
85
|
+
<CardDescription>{description}</CardDescription>
|
|
86
|
+
{/if}
|
|
87
|
+
{/if}
|
|
88
|
+
</CardHeader>
|
|
89
|
+
{/if}
|
|
90
|
+
|
|
91
|
+
{#if children}
|
|
92
|
+
<CardContent>
|
|
93
|
+
{@render children()}
|
|
94
|
+
</CardContent>
|
|
95
|
+
{/if}
|
|
96
|
+
|
|
97
|
+
{#if footer}
|
|
98
|
+
<CardFooter>
|
|
99
|
+
{@render footer()}
|
|
100
|
+
</CardFooter>
|
|
101
|
+
{/if}
|
|
102
|
+
</ShadcnCard>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
/**
|
|
3
|
+
* Card component wrapper providing structured layout with header, content, and footer
|
|
4
|
+
*
|
|
5
|
+
* @prop {string} [title] - Card title (renders in CardHeader with CardTitle)
|
|
6
|
+
* @prop {string} [description] - Card description (renders in CardHeader with CardDescription)
|
|
7
|
+
* @prop {boolean} [hoverable=false] - Enable hover shadow effect for interactive cards
|
|
8
|
+
* @prop {Snippet} [header] - Custom header content (overrides title/description)
|
|
9
|
+
* @prop {Snippet} [footer] - Footer content (rendered in CardFooter)
|
|
10
|
+
* @prop {Snippet} [children] - Main card content (rendered in CardContent)
|
|
11
|
+
* @prop {string} [class] - Additional CSS classes for Card root
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Card title="Profile" description="Update your profile settings">
|
|
15
|
+
* <p>Card content here</p>
|
|
16
|
+
* </Card>
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <Card hoverable>
|
|
20
|
+
* {#snippet header()}
|
|
21
|
+
* <CustomHeader />
|
|
22
|
+
* {/snippet}
|
|
23
|
+
* Content here
|
|
24
|
+
* </Card>
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <Card title="Actions">
|
|
28
|
+
* {#snippet footer()}
|
|
29
|
+
* <Button>Save</Button>
|
|
30
|
+
* {/snippet}
|
|
31
|
+
* Form content
|
|
32
|
+
* </Card>
|
|
33
|
+
*/
|
|
34
|
+
interface Props {
|
|
35
|
+
title?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
hoverable?: boolean;
|
|
38
|
+
class?: string;
|
|
39
|
+
header?: Snippet;
|
|
40
|
+
footer?: Snippet;
|
|
41
|
+
children?: Snippet;
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
declare const Card: import("svelte").Component<Props, {}, "">;
|
|
45
|
+
type Card = ReturnType<typeof Card>;
|
|
46
|
+
export default Card;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Dialog as ShadcnDialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter
|
|
9
|
+
} from "./dialog";
|
|
10
|
+
import type { Snippet } from "svelte";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Dialog (modal) component wrapper for displaying overlay content
|
|
14
|
+
*
|
|
15
|
+
* @prop {boolean} [open=false] - Dialog open state (bindable for two-way binding)
|
|
16
|
+
* @prop {string} [title] - Dialog title (renders in DialogHeader)
|
|
17
|
+
* @prop {string} [description] - Dialog description (renders in DialogHeader)
|
|
18
|
+
* @prop {Snippet} [header] - Custom header content (overrides title/description)
|
|
19
|
+
* @prop {Snippet} [footer] - Footer content (rendered in DialogFooter)
|
|
20
|
+
* @prop {Snippet} [children] - Main dialog content
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Dialog bind:open={isOpen} title="Confirm Delete" description="This action cannot be undone">
|
|
24
|
+
* <p>Are you sure?</p>
|
|
25
|
+
* {#snippet footer()}
|
|
26
|
+
* <Button onclick={() => isOpen = false}>Cancel</Button>
|
|
27
|
+
* {/snippet}
|
|
28
|
+
* </Dialog>
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <Dialog bind:open={showProfile}>
|
|
32
|
+
* {#snippet header()}
|
|
33
|
+
* <CustomHeader />
|
|
34
|
+
* {/snippet}
|
|
35
|
+
* <ProfileForm />
|
|
36
|
+
* </Dialog>
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <Dialog bind:open={modalOpen} title="Settings">
|
|
40
|
+
* <SettingsPanel />
|
|
41
|
+
* </Dialog>
|
|
42
|
+
*/
|
|
43
|
+
interface Props {
|
|
44
|
+
open?: boolean;
|
|
45
|
+
title?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
header?: Snippet;
|
|
48
|
+
footer?: Snippet;
|
|
49
|
+
children?: Snippet;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let {
|
|
53
|
+
open = $bindable(false),
|
|
54
|
+
title,
|
|
55
|
+
description,
|
|
56
|
+
header,
|
|
57
|
+
footer,
|
|
58
|
+
children
|
|
59
|
+
}: Props = $props();
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<ShadcnDialog bind:open>
|
|
63
|
+
<DialogContent>
|
|
64
|
+
{#if header || title || description}
|
|
65
|
+
<DialogHeader>
|
|
66
|
+
{#if header}
|
|
67
|
+
{@render header()}
|
|
68
|
+
{:else}
|
|
69
|
+
{#if title}
|
|
70
|
+
<DialogTitle>{title}</DialogTitle>
|
|
71
|
+
{/if}
|
|
72
|
+
{#if description}
|
|
73
|
+
<DialogDescription>{description}</DialogDescription>
|
|
74
|
+
{/if}
|
|
75
|
+
{/if}
|
|
76
|
+
</DialogHeader>
|
|
77
|
+
{/if}
|
|
78
|
+
|
|
79
|
+
{#if children}
|
|
80
|
+
<div class="py-4">
|
|
81
|
+
{@render children()}
|
|
82
|
+
</div>
|
|
83
|
+
{/if}
|
|
84
|
+
|
|
85
|
+
{#if footer}
|
|
86
|
+
<DialogFooter>
|
|
87
|
+
{@render footer()}
|
|
88
|
+
</DialogFooter>
|
|
89
|
+
{/if}
|
|
90
|
+
</DialogContent>
|
|
91
|
+
</ShadcnDialog>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
/**
|
|
3
|
+
* Dialog (modal) component wrapper for displaying overlay content
|
|
4
|
+
*
|
|
5
|
+
* @prop {boolean} [open=false] - Dialog open state (bindable for two-way binding)
|
|
6
|
+
* @prop {string} [title] - Dialog title (renders in DialogHeader)
|
|
7
|
+
* @prop {string} [description] - Dialog description (renders in DialogHeader)
|
|
8
|
+
* @prop {Snippet} [header] - Custom header content (overrides title/description)
|
|
9
|
+
* @prop {Snippet} [footer] - Footer content (rendered in DialogFooter)
|
|
10
|
+
* @prop {Snippet} [children] - Main dialog content
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Dialog bind:open={isOpen} title="Confirm Delete" description="This action cannot be undone">
|
|
14
|
+
* <p>Are you sure?</p>
|
|
15
|
+
* {#snippet footer()}
|
|
16
|
+
* <Button onclick={() => isOpen = false}>Cancel</Button>
|
|
17
|
+
* {/snippet}
|
|
18
|
+
* </Dialog>
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <Dialog bind:open={showProfile}>
|
|
22
|
+
* {#snippet header()}
|
|
23
|
+
* <CustomHeader />
|
|
24
|
+
* {/snippet}
|
|
25
|
+
* <ProfileForm />
|
|
26
|
+
* </Dialog>
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <Dialog bind:open={modalOpen} title="Settings">
|
|
30
|
+
* <SettingsPanel />
|
|
31
|
+
* </Dialog>
|
|
32
|
+
*/
|
|
33
|
+
interface Props {
|
|
34
|
+
open?: boolean;
|
|
35
|
+
title?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
header?: Snippet;
|
|
38
|
+
footer?: Snippet;
|
|
39
|
+
children?: Snippet;
|
|
40
|
+
}
|
|
41
|
+
declare const Dialog: import("svelte").Component<Props, {}, "open">;
|
|
42
|
+
type Dialog = ReturnType<typeof Dialog>;
|
|
43
|
+
export default Dialog;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Input as ShadcnInput } from "./input";
|
|
3
|
+
import type { HTMLInputAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Input component wrapper with label, error handling, and validation
|
|
8
|
+
*
|
|
9
|
+
* @prop {string} [label] - Input label text (renders above input)
|
|
10
|
+
* @prop {string} [error] - Error message to display (turns border red)
|
|
11
|
+
* @prop {string|number} [value] - Input value (bindable for two-way binding)
|
|
12
|
+
* @prop {string} [placeholder] - Placeholder text
|
|
13
|
+
* @prop {string} [type="text"] - Input type (text|email|password|number)
|
|
14
|
+
* @prop {boolean} [required=false] - Whether input is required (shows asterisk)
|
|
15
|
+
* @prop {boolean} [disabled=false] - Whether input is disabled
|
|
16
|
+
* @prop {string} [class] - Additional CSS classes to apply
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <Input label="Email" type="email" bind:value={email} required />
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Input label="Password" type="password" bind:value={password} error={passwordError} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Input placeholder="Search..." bind:value={searchQuery} />
|
|
26
|
+
*/
|
|
27
|
+
interface Props extends Omit<HTMLInputAttributes, "class"> {
|
|
28
|
+
label?: string;
|
|
29
|
+
error?: string;
|
|
30
|
+
value?: string | number;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
type?: "text" | "email" | "password" | "number";
|
|
33
|
+
required?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
class?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let {
|
|
39
|
+
label,
|
|
40
|
+
error,
|
|
41
|
+
value = $bindable(""),
|
|
42
|
+
placeholder,
|
|
43
|
+
type = "text",
|
|
44
|
+
required = false,
|
|
45
|
+
disabled = false,
|
|
46
|
+
class: className,
|
|
47
|
+
...restProps
|
|
48
|
+
}: Props = $props();
|
|
49
|
+
|
|
50
|
+
const inputClass = $derived(
|
|
51
|
+
cn(
|
|
52
|
+
error && "border-destructive focus-visible:ring-destructive/20",
|
|
53
|
+
className
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<div class="flex flex-col gap-1.5">
|
|
59
|
+
{#if label}
|
|
60
|
+
<label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">
|
|
61
|
+
{label}
|
|
62
|
+
{#if required}
|
|
63
|
+
<span class="text-destructive">*</span>
|
|
64
|
+
{/if}
|
|
65
|
+
</label>
|
|
66
|
+
{/if}
|
|
67
|
+
|
|
68
|
+
<ShadcnInput
|
|
69
|
+
bind:value
|
|
70
|
+
{type}
|
|
71
|
+
{placeholder}
|
|
72
|
+
{required}
|
|
73
|
+
{disabled}
|
|
74
|
+
class={inputClass}
|
|
75
|
+
{...restProps}
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
{#if error}
|
|
79
|
+
<p class="text-sm text-destructive">{error}</p>
|
|
80
|
+
{/if}
|
|
81
|
+
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HTMLInputAttributes } from "svelte/elements";
|
|
2
|
+
/**
|
|
3
|
+
* Input component wrapper with label, error handling, and validation
|
|
4
|
+
*
|
|
5
|
+
* @prop {string} [label] - Input label text (renders above input)
|
|
6
|
+
* @prop {string} [error] - Error message to display (turns border red)
|
|
7
|
+
* @prop {string|number} [value] - Input value (bindable for two-way binding)
|
|
8
|
+
* @prop {string} [placeholder] - Placeholder text
|
|
9
|
+
* @prop {string} [type="text"] - Input type (text|email|password|number)
|
|
10
|
+
* @prop {boolean} [required=false] - Whether input is required (shows asterisk)
|
|
11
|
+
* @prop {boolean} [disabled=false] - Whether input is disabled
|
|
12
|
+
* @prop {string} [class] - Additional CSS classes to apply
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Input label="Email" type="email" bind:value={email} required />
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Input label="Password" type="password" bind:value={password} error={passwordError} />
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <Input placeholder="Search..." bind:value={searchQuery} />
|
|
22
|
+
*/
|
|
23
|
+
interface Props extends Omit<HTMLInputAttributes, "class"> {
|
|
24
|
+
label?: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
value?: string | number;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
type?: "text" | "email" | "password" | "number";
|
|
29
|
+
required?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
declare const Input: import("svelte").Component<Props, {}, "value">;
|
|
34
|
+
type Input = ReturnType<typeof Input>;
|
|
35
|
+
export default Input;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Select as ShadcnSelect,
|
|
4
|
+
SelectContent,
|
|
5
|
+
SelectItem,
|
|
6
|
+
SelectTrigger
|
|
7
|
+
} from "./select";
|
|
8
|
+
import type { Snippet } from "svelte";
|
|
9
|
+
|
|
10
|
+
interface Option {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Select component wrapper providing dropdown selection with options
|
|
18
|
+
*
|
|
19
|
+
* @prop {string} [value] - Selected value (bindable for two-way binding)
|
|
20
|
+
* @prop {Option[]} options - Array of options with value, label, and optional disabled flag
|
|
21
|
+
* @prop {string} [placeholder="Select an option"] - Placeholder text when no value selected
|
|
22
|
+
* @prop {boolean} [disabled=false] - Whether select is disabled
|
|
23
|
+
* @prop {string} [class] - Additional CSS classes for trigger element
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <Select bind:value={selectedValue} options={[
|
|
27
|
+
* { value: "opt1", label: "Option 1" },
|
|
28
|
+
* { value: "opt2", label: "Option 2", disabled: true }
|
|
29
|
+
* ]} />
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <Select bind:value={theme} placeholder="Choose theme" options={themeOptions} />
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <Select bind:value={country} options={countries} disabled={loading} />
|
|
36
|
+
*/
|
|
37
|
+
interface Props {
|
|
38
|
+
value?: string | undefined;
|
|
39
|
+
options: Option[];
|
|
40
|
+
placeholder?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
class?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let {
|
|
46
|
+
value = $bindable(undefined),
|
|
47
|
+
options,
|
|
48
|
+
placeholder = "Select an option",
|
|
49
|
+
disabled = false,
|
|
50
|
+
class: className
|
|
51
|
+
}: Props = $props();
|
|
52
|
+
|
|
53
|
+
const selectedLabel = $derived(
|
|
54
|
+
value ? options.find(opt => opt.value === value)?.label ?? placeholder : placeholder
|
|
55
|
+
);
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<ShadcnSelect bind:value {disabled}>
|
|
59
|
+
<SelectTrigger class={className}>
|
|
60
|
+
{selectedLabel}
|
|
61
|
+
</SelectTrigger>
|
|
62
|
+
<SelectContent>
|
|
63
|
+
{#each options as option (option.value)}
|
|
64
|
+
<SelectItem value={option.value} disabled={option.disabled ?? false}>
|
|
65
|
+
{option.label}
|
|
66
|
+
</SelectItem>
|
|
67
|
+
{/each}
|
|
68
|
+
</SelectContent>
|
|
69
|
+
</ShadcnSelect>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface Option {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Select component wrapper providing dropdown selection with options
|
|
8
|
+
*
|
|
9
|
+
* @prop {string} [value] - Selected value (bindable for two-way binding)
|
|
10
|
+
* @prop {Option[]} options - Array of options with value, label, and optional disabled flag
|
|
11
|
+
* @prop {string} [placeholder="Select an option"] - Placeholder text when no value selected
|
|
12
|
+
* @prop {boolean} [disabled=false] - Whether select is disabled
|
|
13
|
+
* @prop {string} [class] - Additional CSS classes for trigger element
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <Select bind:value={selectedValue} options={[
|
|
17
|
+
* { value: "opt1", label: "Option 1" },
|
|
18
|
+
* { value: "opt2", label: "Option 2", disabled: true }
|
|
19
|
+
* ]} />
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Select bind:value={theme} placeholder="Choose theme" options={themeOptions} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Select bind:value={country} options={countries} disabled={loading} />
|
|
26
|
+
*/
|
|
27
|
+
interface Props {
|
|
28
|
+
value?: string | undefined;
|
|
29
|
+
options: Option[];
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
class?: string;
|
|
33
|
+
}
|
|
34
|
+
declare const Select: import("svelte").Component<Props, {}, "value">;
|
|
35
|
+
type Select = ReturnType<typeof Select>;
|
|
36
|
+
export default Select;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Sheet as ShadcnSheet,
|
|
4
|
+
SheetTrigger,
|
|
5
|
+
SheetClose,
|
|
6
|
+
SheetContent,
|
|
7
|
+
SheetHeader,
|
|
8
|
+
SheetTitle,
|
|
9
|
+
SheetDescription,
|
|
10
|
+
SheetFooter
|
|
11
|
+
} from "./sheet";
|
|
12
|
+
import type { Snippet } from "svelte";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Sheet component wrapper for slide-out panels (drawers) from screen edges
|
|
16
|
+
*
|
|
17
|
+
* @prop {boolean} [open=false] - Sheet open state (bindable for two-way binding)
|
|
18
|
+
* @prop {string} [side="right"] - Which edge sheet slides from (left|right|top|bottom)
|
|
19
|
+
* @prop {string} [title] - Sheet title (renders in SheetHeader)
|
|
20
|
+
* @prop {string} [description] - Sheet description (renders in SheetHeader)
|
|
21
|
+
* @prop {Snippet} [trigger] - Trigger element to open sheet (renders in SheetTrigger)
|
|
22
|
+
* @prop {Snippet} [footer] - Footer content (rendered in SheetFooter)
|
|
23
|
+
* @prop {Snippet} [children] - Main sheet content
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <Sheet bind:open={isOpen} side="right" title="Settings">
|
|
27
|
+
* <SettingsForm />
|
|
28
|
+
* {#snippet footer()}
|
|
29
|
+
* <Button onclick={() => isOpen = false}>Close</Button>
|
|
30
|
+
* {/snippet}
|
|
31
|
+
* </Sheet>
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* <Sheet side="left">
|
|
35
|
+
* {#snippet trigger()}
|
|
36
|
+
* <Button>Open Menu</Button>
|
|
37
|
+
* {/snippet}
|
|
38
|
+
* <Navigation />
|
|
39
|
+
* </Sheet>
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* <Sheet bind:open={showCart} side="right" title="Shopping Cart" description="Review your items">
|
|
43
|
+
* <CartItems />
|
|
44
|
+
* </Sheet>
|
|
45
|
+
*/
|
|
46
|
+
interface Props {
|
|
47
|
+
open?: boolean;
|
|
48
|
+
side?: "left" | "right" | "top" | "bottom";
|
|
49
|
+
title?: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
trigger?: Snippet;
|
|
52
|
+
footer?: Snippet;
|
|
53
|
+
children?: Snippet;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let {
|
|
57
|
+
open = $bindable(false),
|
|
58
|
+
side = "right",
|
|
59
|
+
title,
|
|
60
|
+
description,
|
|
61
|
+
trigger,
|
|
62
|
+
footer,
|
|
63
|
+
children
|
|
64
|
+
}: Props = $props();
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<ShadcnSheet bind:open>
|
|
68
|
+
{#if trigger}
|
|
69
|
+
<SheetTrigger>
|
|
70
|
+
{@render trigger()}
|
|
71
|
+
</SheetTrigger>
|
|
72
|
+
{/if}
|
|
73
|
+
|
|
74
|
+
<SheetContent {side}>
|
|
75
|
+
{#if title || description}
|
|
76
|
+
<SheetHeader>
|
|
77
|
+
{#if title}
|
|
78
|
+
<SheetTitle>{title}</SheetTitle>
|
|
79
|
+
{/if}
|
|
80
|
+
{#if description}
|
|
81
|
+
<SheetDescription>{description}</SheetDescription>
|
|
82
|
+
{/if}
|
|
83
|
+
</SheetHeader>
|
|
84
|
+
{/if}
|
|
85
|
+
|
|
86
|
+
{#if children}
|
|
87
|
+
<div class="py-4">
|
|
88
|
+
{@render children()}
|
|
89
|
+
</div>
|
|
90
|
+
{/if}
|
|
91
|
+
|
|
92
|
+
{#if footer}
|
|
93
|
+
<SheetFooter>
|
|
94
|
+
{@render footer()}
|
|
95
|
+
</SheetFooter>
|
|
96
|
+
{/if}
|
|
97
|
+
</SheetContent>
|
|
98
|
+
</ShadcnSheet>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
/**
|
|
3
|
+
* Sheet component wrapper for slide-out panels (drawers) from screen edges
|
|
4
|
+
*
|
|
5
|
+
* @prop {boolean} [open=false] - Sheet open state (bindable for two-way binding)
|
|
6
|
+
* @prop {string} [side="right"] - Which edge sheet slides from (left|right|top|bottom)
|
|
7
|
+
* @prop {string} [title] - Sheet title (renders in SheetHeader)
|
|
8
|
+
* @prop {string} [description] - Sheet description (renders in SheetHeader)
|
|
9
|
+
* @prop {Snippet} [trigger] - Trigger element to open sheet (renders in SheetTrigger)
|
|
10
|
+
* @prop {Snippet} [footer] - Footer content (rendered in SheetFooter)
|
|
11
|
+
* @prop {Snippet} [children] - Main sheet content
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Sheet bind:open={isOpen} side="right" title="Settings">
|
|
15
|
+
* <SettingsForm />
|
|
16
|
+
* {#snippet footer()}
|
|
17
|
+
* <Button onclick={() => isOpen = false}>Close</Button>
|
|
18
|
+
* {/snippet}
|
|
19
|
+
* </Sheet>
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Sheet side="left">
|
|
23
|
+
* {#snippet trigger()}
|
|
24
|
+
* <Button>Open Menu</Button>
|
|
25
|
+
* {/snippet}
|
|
26
|
+
* <Navigation />
|
|
27
|
+
* </Sheet>
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <Sheet bind:open={showCart} side="right" title="Shopping Cart" description="Review your items">
|
|
31
|
+
* <CartItems />
|
|
32
|
+
* </Sheet>
|
|
33
|
+
*/
|
|
34
|
+
interface Props {
|
|
35
|
+
open?: boolean;
|
|
36
|
+
side?: "left" | "right" | "top" | "bottom";
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
trigger?: Snippet;
|
|
40
|
+
footer?: Snippet;
|
|
41
|
+
children?: Snippet;
|
|
42
|
+
}
|
|
43
|
+
declare const Sheet: import("svelte").Component<Props, {}, "open">;
|
|
44
|
+
type Sheet = ReturnType<typeof Sheet>;
|
|
45
|
+
export default Sheet;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Skeleton as ShadcnSkeleton } from "./skeleton";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Skeleton component wrapper for loading placeholders
|
|
7
|
+
* Creates animated gray rectangles that indicate loading content
|
|
8
|
+
*
|
|
9
|
+
* @prop {string} [class] - CSS classes to customize size/shape (e.g., "h-12 w-12 rounded-full")
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Skeleton class="h-4 w-full" />
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Skeleton class="h-12 w-12 rounded-full" />
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <div class="flex flex-col gap-2">
|
|
19
|
+
* <Skeleton class="h-6 w-3/4" />
|
|
20
|
+
* <Skeleton class="h-4 w-full" />
|
|
21
|
+
* <Skeleton class="h-4 w-5/6" />
|
|
22
|
+
* </div>
|
|
23
|
+
*/
|
|
24
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
class?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let { class: className, ...restProps }: Props = $props();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<ShadcnSkeleton class={className} {...restProps} />
|