@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,26 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
/**
|
|
3
|
+
* Skeleton component wrapper for loading placeholders
|
|
4
|
+
* Creates animated gray rectangles that indicate loading content
|
|
5
|
+
*
|
|
6
|
+
* @prop {string} [class] - CSS classes to customize size/shape (e.g., "h-12 w-12 rounded-full")
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <Skeleton class="h-4 w-full" />
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Skeleton class="h-12 w-12 rounded-full" />
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <div class="flex flex-col gap-2">
|
|
16
|
+
* <Skeleton class="h-6 w-3/4" />
|
|
17
|
+
* <Skeleton class="h-4 w-full" />
|
|
18
|
+
* <Skeleton class="h-4 w-5/6" />
|
|
19
|
+
* </div>
|
|
20
|
+
*/
|
|
21
|
+
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Skeleton: import("svelte").Component<Props, {}, "">;
|
|
25
|
+
type Skeleton = ReturnType<typeof Skeleton>;
|
|
26
|
+
export default Skeleton;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Table as ShadcnTable,
|
|
4
|
+
TableHeader,
|
|
5
|
+
TableBody,
|
|
6
|
+
TableRow,
|
|
7
|
+
TableCell
|
|
8
|
+
} from "./table";
|
|
9
|
+
import type { Snippet } from "svelte";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Table component wrapper providing simple table layout
|
|
13
|
+
* Note: This is a basic wrapper - use TableHeader, TableBody, TableRow, TableCell from shadcn directly
|
|
14
|
+
*
|
|
15
|
+
* @prop {string} [class] - Additional CSS classes for table
|
|
16
|
+
* @prop {Snippet} [children] - Table content (typically TableHeader and TableBody)
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <Table>
|
|
20
|
+
* <TableHeader>
|
|
21
|
+
* <TableRow>
|
|
22
|
+
* <TableCell>Name</TableCell>
|
|
23
|
+
* <TableCell>Email</TableCell>
|
|
24
|
+
* </TableRow>
|
|
25
|
+
* </TableHeader>
|
|
26
|
+
* <TableBody>
|
|
27
|
+
* <TableRow>
|
|
28
|
+
* <TableCell>John</TableCell>
|
|
29
|
+
* <TableCell>john@example.com</TableCell>
|
|
30
|
+
* </TableRow>
|
|
31
|
+
* </TableBody>
|
|
32
|
+
* </Table>
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <Table class="w-full">
|
|
36
|
+
* {#each users as user}
|
|
37
|
+
* <TableRow>
|
|
38
|
+
* <TableCell>{user.name}</TableCell>
|
|
39
|
+
* <TableCell>{user.email}</TableCell>
|
|
40
|
+
* </TableRow>
|
|
41
|
+
* {/each}
|
|
42
|
+
* </Table>
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* import { Table, TableHeader, TableBody, TableRow, TableCell } from "./";
|
|
46
|
+
*/
|
|
47
|
+
interface Props {
|
|
48
|
+
class?: string;
|
|
49
|
+
children?: Snippet;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let { class: className, children }: Props = $props();
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<ShadcnTable class={className}>
|
|
56
|
+
{#if children}
|
|
57
|
+
{@render children()}
|
|
58
|
+
{/if}
|
|
59
|
+
</ShadcnTable>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
/**
|
|
3
|
+
* Table component wrapper providing simple table layout
|
|
4
|
+
* Note: This is a basic wrapper - use TableHeader, TableBody, TableRow, TableCell from shadcn directly
|
|
5
|
+
*
|
|
6
|
+
* @prop {string} [class] - Additional CSS classes for table
|
|
7
|
+
* @prop {Snippet} [children] - Table content (typically TableHeader and TableBody)
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Table>
|
|
11
|
+
* <TableHeader>
|
|
12
|
+
* <TableRow>
|
|
13
|
+
* <TableCell>Name</TableCell>
|
|
14
|
+
* <TableCell>Email</TableCell>
|
|
15
|
+
* </TableRow>
|
|
16
|
+
* </TableHeader>
|
|
17
|
+
* <TableBody>
|
|
18
|
+
* <TableRow>
|
|
19
|
+
* <TableCell>John</TableCell>
|
|
20
|
+
* <TableCell>john@example.com</TableCell>
|
|
21
|
+
* </TableRow>
|
|
22
|
+
* </TableBody>
|
|
23
|
+
* </Table>
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <Table class="w-full">
|
|
27
|
+
* {#each users as user}
|
|
28
|
+
* <TableRow>
|
|
29
|
+
* <TableCell>{user.name}</TableCell>
|
|
30
|
+
* <TableCell>{user.email}</TableCell>
|
|
31
|
+
* </TableRow>
|
|
32
|
+
* {/each}
|
|
33
|
+
* </Table>
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* import { Table, TableHeader, TableBody, TableRow, TableCell } from "./";
|
|
37
|
+
*/
|
|
38
|
+
interface Props {
|
|
39
|
+
class?: string;
|
|
40
|
+
children?: Snippet;
|
|
41
|
+
}
|
|
42
|
+
declare const Table: import("svelte").Component<Props, {}, "">;
|
|
43
|
+
type Table = ReturnType<typeof Table>;
|
|
44
|
+
export default Table;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Tabs as ShadcnTabs,
|
|
4
|
+
TabsContent,
|
|
5
|
+
TabsList,
|
|
6
|
+
TabsTrigger
|
|
7
|
+
} from "./tabs";
|
|
8
|
+
import type { Snippet } from "svelte";
|
|
9
|
+
|
|
10
|
+
interface Tab {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Tabs component wrapper for organizing content into switchable panels
|
|
18
|
+
*
|
|
19
|
+
* @prop {string} [value] - Active tab value (bindable for two-way binding, defaults to first tab)
|
|
20
|
+
* @prop {Tab[]} tabs - Array of tabs with value, label, and optional disabled flag
|
|
21
|
+
* @prop {Snippet<[Tab]>} [content] - Snippet to render content for each tab (receives tab data)
|
|
22
|
+
* @prop {Snippet} [children] - Alternative content rendering (same for all tabs)
|
|
23
|
+
* @prop {string} [class] - Additional CSS classes for Tabs root
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <Tabs bind:value={activeTab} tabs={[
|
|
27
|
+
* { value: "overview", label: "Overview" },
|
|
28
|
+
* { value: "settings", label: "Settings" }
|
|
29
|
+
* ]} content={(tab) => <p>Content for {tab.label}</p>} />
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <Tabs tabs={profileTabs}>
|
|
33
|
+
* {#snippet content(tab)}
|
|
34
|
+
* <ProfileSection section={tab.value} />
|
|
35
|
+
* {/snippet}
|
|
36
|
+
* </Tabs>
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* <Tabs bind:value={view} tabs={dashboardTabs} class="w-full" />
|
|
40
|
+
*/
|
|
41
|
+
interface Props {
|
|
42
|
+
value?: string | undefined;
|
|
43
|
+
tabs: Tab[];
|
|
44
|
+
content?: Snippet<[tab: Tab]>;
|
|
45
|
+
class?: string;
|
|
46
|
+
children?: Snippet;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let {
|
|
50
|
+
value = $bindable(tabs[0]?.value ?? ""),
|
|
51
|
+
tabs,
|
|
52
|
+
content,
|
|
53
|
+
class: className,
|
|
54
|
+
children
|
|
55
|
+
}: Props = $props();
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<ShadcnTabs bind:value class={className}>
|
|
59
|
+
<TabsList>
|
|
60
|
+
{#each tabs as tab (tab.value)}
|
|
61
|
+
<TabsTrigger value={tab.value} disabled={tab.disabled ?? false}>
|
|
62
|
+
{tab.label}
|
|
63
|
+
</TabsTrigger>
|
|
64
|
+
{/each}
|
|
65
|
+
</TabsList>
|
|
66
|
+
|
|
67
|
+
{#each tabs as tab (tab.value)}
|
|
68
|
+
<TabsContent value={tab.value}>
|
|
69
|
+
{#if content}
|
|
70
|
+
{@render content(tab)}
|
|
71
|
+
{:else if children}
|
|
72
|
+
{@render children()}
|
|
73
|
+
{/if}
|
|
74
|
+
</TabsContent>
|
|
75
|
+
{/each}
|
|
76
|
+
</ShadcnTabs>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
interface Tab {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Tabs component wrapper for organizing content into switchable panels
|
|
9
|
+
*
|
|
10
|
+
* @prop {string} [value] - Active tab value (bindable for two-way binding, defaults to first tab)
|
|
11
|
+
* @prop {Tab[]} tabs - Array of tabs with value, label, and optional disabled flag
|
|
12
|
+
* @prop {Snippet<[Tab]>} [content] - Snippet to render content for each tab (receives tab data)
|
|
13
|
+
* @prop {Snippet} [children] - Alternative content rendering (same for all tabs)
|
|
14
|
+
* @prop {string} [class] - Additional CSS classes for Tabs root
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Tabs bind:value={activeTab} tabs={[
|
|
18
|
+
* { value: "overview", label: "Overview" },
|
|
19
|
+
* { value: "settings", label: "Settings" }
|
|
20
|
+
* ]} content={(tab) => <p>Content for {tab.label}</p>} />
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Tabs tabs={profileTabs}>
|
|
24
|
+
* {#snippet content(tab)}
|
|
25
|
+
* <ProfileSection section={tab.value} />
|
|
26
|
+
* {/snippet}
|
|
27
|
+
* </Tabs>
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <Tabs bind:value={view} tabs={dashboardTabs} class="w-full" />
|
|
31
|
+
*/
|
|
32
|
+
interface Props {
|
|
33
|
+
value?: string | undefined;
|
|
34
|
+
tabs: Tab[];
|
|
35
|
+
content?: Snippet<[tab: Tab]>;
|
|
36
|
+
class?: string;
|
|
37
|
+
children?: Snippet;
|
|
38
|
+
}
|
|
39
|
+
declare const Tabs: import("svelte").Component<Props, {}, "value">;
|
|
40
|
+
type Tabs = ReturnType<typeof Tabs>;
|
|
41
|
+
export default Tabs;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Textarea as ShadcnTextarea } from "./textarea";
|
|
3
|
+
import type { HTMLTextareaAttributes } from "svelte/elements";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Textarea component wrapper with label, error handling, and validation
|
|
8
|
+
*
|
|
9
|
+
* @prop {string} [label] - Textarea label text (renders above textarea)
|
|
10
|
+
* @prop {string} [error] - Error message to display (turns border red)
|
|
11
|
+
* @prop {string} [value] - Textarea value (bindable for two-way binding)
|
|
12
|
+
* @prop {string} [placeholder] - Placeholder text
|
|
13
|
+
* @prop {number} [rows] - Number of visible text rows
|
|
14
|
+
* @prop {boolean} [required=false] - Whether textarea is required (shows asterisk)
|
|
15
|
+
* @prop {boolean} [disabled=false] - Whether textarea is disabled
|
|
16
|
+
* @prop {string} [class] - Additional CSS classes to apply
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <Textarea label="Description" bind:value={description} required />
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Textarea label="Notes" bind:value={notes} rows={5} error={notesError} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Textarea placeholder="Enter your message..." bind:value={message} />
|
|
26
|
+
*/
|
|
27
|
+
interface Props extends Omit<HTMLTextareaAttributes, "class"> {
|
|
28
|
+
label?: string;
|
|
29
|
+
error?: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
rows?: number;
|
|
33
|
+
required?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
class?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let {
|
|
39
|
+
label,
|
|
40
|
+
error,
|
|
41
|
+
value = $bindable(""),
|
|
42
|
+
placeholder,
|
|
43
|
+
rows,
|
|
44
|
+
required = false,
|
|
45
|
+
disabled = false,
|
|
46
|
+
class: className,
|
|
47
|
+
...restProps
|
|
48
|
+
}: Props = $props();
|
|
49
|
+
|
|
50
|
+
const textareaClass = $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
|
+
<ShadcnTextarea
|
|
69
|
+
bind:value
|
|
70
|
+
{placeholder}
|
|
71
|
+
{rows}
|
|
72
|
+
{required}
|
|
73
|
+
{disabled}
|
|
74
|
+
class={textareaClass}
|
|
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 { HTMLTextareaAttributes } from "svelte/elements";
|
|
2
|
+
/**
|
|
3
|
+
* Textarea component wrapper with label, error handling, and validation
|
|
4
|
+
*
|
|
5
|
+
* @prop {string} [label] - Textarea label text (renders above textarea)
|
|
6
|
+
* @prop {string} [error] - Error message to display (turns border red)
|
|
7
|
+
* @prop {string} [value] - Textarea value (bindable for two-way binding)
|
|
8
|
+
* @prop {string} [placeholder] - Placeholder text
|
|
9
|
+
* @prop {number} [rows] - Number of visible text rows
|
|
10
|
+
* @prop {boolean} [required=false] - Whether textarea is required (shows asterisk)
|
|
11
|
+
* @prop {boolean} [disabled=false] - Whether textarea is disabled
|
|
12
|
+
* @prop {string} [class] - Additional CSS classes to apply
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <Textarea label="Description" bind:value={description} required />
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Textarea label="Notes" bind:value={notes} rows={5} error={notesError} />
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <Textarea placeholder="Enter your message..." bind:value={message} />
|
|
22
|
+
*/
|
|
23
|
+
interface Props extends Omit<HTMLTextareaAttributes, "class"> {
|
|
24
|
+
label?: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
value?: string;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
rows?: number;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
declare const Textarea: import("svelte").Component<Props, {}, "value">;
|
|
34
|
+
type Textarea = ReturnType<typeof Textarea>;
|
|
35
|
+
export default Textarea;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Toaster } from "sonner";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
position?:
|
|
6
|
+
| "top-left"
|
|
7
|
+
| "top-center"
|
|
8
|
+
| "top-right"
|
|
9
|
+
| "bottom-left"
|
|
10
|
+
| "bottom-center"
|
|
11
|
+
| "bottom-right";
|
|
12
|
+
theme?: "light" | "dark" | "system";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let { position = "bottom-right", theme = "system" }: Props = $props();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<Toaster {position} {theme} />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
3
|
+
theme?: "light" | "dark" | "system";
|
|
4
|
+
}
|
|
5
|
+
declare const Toast: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type Toast = ReturnType<typeof Toast>;
|
|
7
|
+
export default Toast;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Accordion as AccordionPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChild<AccordionPrimitive.ContentProps> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<AccordionPrimitive.Content
|
|
14
|
+
bind:ref
|
|
15
|
+
class={cn(
|
|
16
|
+
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
<div class="pb-4 pt-0">
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
24
|
+
</AccordionPrimitive.Content>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
|
+
declare const AccordionContent: import("svelte").Component<Omit<AccordionPrimitive.ContentProps, "child">, {}, "ref">;
|
|
3
|
+
type AccordionContent = ReturnType<typeof AccordionContent>;
|
|
4
|
+
export default AccordionContent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: AccordionPrimitive.ItemProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<AccordionPrimitive.Item bind:ref class={cn("border-b", className)} {...restProps} />
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Accordion as AccordionPrimitive, type WithoutChild } from "bits-ui";
|
|
3
|
+
import ChevronDown from "@lucide/svelte/icons/chevron-down";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
level = 3,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: WithoutChild<AccordionPrimitive.TriggerProps> & {
|
|
13
|
+
level?: AccordionPrimitive.HeaderProps["level"];
|
|
14
|
+
} = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<AccordionPrimitive.Header {level} class="flex">
|
|
18
|
+
<AccordionPrimitive.Trigger
|
|
19
|
+
bind:ref
|
|
20
|
+
class={cn(
|
|
21
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
<ChevronDown class="size-4 shrink-0 transition-transform duration-200" />
|
|
28
|
+
</AccordionPrimitive.Trigger>
|
|
29
|
+
</AccordionPrimitive.Header>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive, type WithoutChild } from "bits-ui";
|
|
2
|
+
type $$ComponentProps = WithoutChild<AccordionPrimitive.TriggerProps> & {
|
|
3
|
+
level?: AccordionPrimitive.HeaderProps["level"];
|
|
4
|
+
};
|
|
5
|
+
declare const AccordionTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
6
|
+
type AccordionTrigger = ReturnType<typeof AccordionTrigger>;
|
|
7
|
+
export default AccordionTrigger;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
|
+
import Content from "./accordion-content.svelte";
|
|
3
|
+
import Item from "./accordion-item.svelte";
|
|
4
|
+
import Trigger from "./accordion-trigger.svelte";
|
|
5
|
+
declare const Root: import("svelte").Component<AccordionPrimitive.RootProps, {}, "value" | "ref">;
|
|
6
|
+
export { Root, Content, Item, Trigger, Root as Accordion, Content as AccordionContent, Item as AccordionItem, Trigger as AccordionTrigger, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
|
+
import Content from "./accordion-content.svelte";
|
|
3
|
+
import Item from "./accordion-item.svelte";
|
|
4
|
+
import Trigger from "./accordion-trigger.svelte";
|
|
5
|
+
const Root = AccordionPrimitive.Root;
|
|
6
|
+
export { Root, Content, Item, Trigger,
|
|
7
|
+
//
|
|
8
|
+
Root as Accordion, Content as AccordionContent, Item as AccordionItem, Trigger as AccordionTrigger, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { type VariantProps, tv } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
export const badgeVariants = tv({
|
|
5
|
+
base: "focus:ring-ring inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default:
|
|
9
|
+
"bg-primary text-primary-foreground hover:bg-primary/80 border-transparent",
|
|
10
|
+
secondary:
|
|
11
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
|
|
12
|
+
destructive:
|
|
13
|
+
"bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent",
|
|
14
|
+
outline: "text-foreground",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import type { WithElementRef } from "bits-ui";
|
|
27
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
28
|
+
import { cn } from "../../../utils";
|
|
29
|
+
|
|
30
|
+
let {
|
|
31
|
+
ref = $bindable(null),
|
|
32
|
+
href,
|
|
33
|
+
class: className,
|
|
34
|
+
variant = "default",
|
|
35
|
+
children,
|
|
36
|
+
...restProps
|
|
37
|
+
}: WithElementRef<HTMLAnchorAttributes> & {
|
|
38
|
+
variant?: BadgeVariant;
|
|
39
|
+
} = $props();
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<svelte:element
|
|
43
|
+
this={href ? "a" : "span"}
|
|
44
|
+
bind:this={ref}
|
|
45
|
+
{href}
|
|
46
|
+
class={cn(badgeVariants({ variant }), className)}
|
|
47
|
+
{...restProps}
|
|
48
|
+
>
|
|
49
|
+
{@render children?.()}
|
|
50
|
+
</svelte:element>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
variant: {
|
|
4
|
+
default: string;
|
|
5
|
+
secondary: string;
|
|
6
|
+
destructive: string;
|
|
7
|
+
outline: string;
|
|
8
|
+
};
|
|
9
|
+
}, undefined, "focus:ring-ring inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
10
|
+
variant: {
|
|
11
|
+
default: string;
|
|
12
|
+
secondary: string;
|
|
13
|
+
destructive: string;
|
|
14
|
+
outline: string;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
variant: {
|
|
18
|
+
default: string;
|
|
19
|
+
secondary: string;
|
|
20
|
+
destructive: string;
|
|
21
|
+
outline: string;
|
|
22
|
+
};
|
|
23
|
+
}>, {
|
|
24
|
+
variant: {
|
|
25
|
+
default: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
destructive: string;
|
|
28
|
+
outline: string;
|
|
29
|
+
};
|
|
30
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
31
|
+
variant: {
|
|
32
|
+
default: string;
|
|
33
|
+
secondary: string;
|
|
34
|
+
destructive: string;
|
|
35
|
+
outline: string;
|
|
36
|
+
};
|
|
37
|
+
}, undefined, "focus:ring-ring inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
38
|
+
variant: {
|
|
39
|
+
default: string;
|
|
40
|
+
secondary: string;
|
|
41
|
+
destructive: string;
|
|
42
|
+
outline: string;
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
variant: {
|
|
46
|
+
default: string;
|
|
47
|
+
secondary: string;
|
|
48
|
+
destructive: string;
|
|
49
|
+
outline: string;
|
|
50
|
+
};
|
|
51
|
+
}>, unknown, unknown, undefined>>;
|
|
52
|
+
export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
|
|
53
|
+
import type { WithElementRef } from "bits-ui";
|
|
54
|
+
import type { HTMLAnchorAttributes } from "svelte/elements";
|
|
55
|
+
type $$ComponentProps = WithElementRef<HTMLAnchorAttributes> & {
|
|
56
|
+
variant?: BadgeVariant;
|
|
57
|
+
};
|
|
58
|
+
declare const Badge: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
59
|
+
type Badge = ReturnType<typeof Badge>;
|
|
60
|
+
export default Badge;
|