@svadmin/ui 0.0.6 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/package.json +8 -3
  2. package/src/actions.ts +110 -0
  3. package/src/components/AdminApp.svelte +8 -4
  4. package/src/components/Authenticated.svelte +38 -13
  5. package/src/components/AutoForm.svelte +163 -74
  6. package/src/components/AutoSaveIndicator.svelte +35 -0
  7. package/src/components/AutoTable.svelte +476 -183
  8. package/src/components/Breadcrumbs.svelte +22 -17
  9. package/src/components/CatchAllNavigate.svelte +21 -0
  10. package/src/components/ComboboxField.svelte +122 -0
  11. package/src/components/CommandPalette.svelte +93 -0
  12. package/src/components/ConfigErrorScreen.svelte +53 -151
  13. package/src/components/ConfirmDialog.svelte +25 -17
  14. package/src/components/CreatePage.svelte +43 -0
  15. package/src/components/DevTools.svelte +99 -230
  16. package/src/components/DrawerForm.svelte +19 -10
  17. package/src/components/EditPage.svelte +71 -0
  18. package/src/components/EmptyState.svelte +21 -31
  19. package/src/components/ErrorBoundary.svelte +38 -40
  20. package/src/components/ErrorComponent.svelte +36 -0
  21. package/src/components/FieldRenderer.svelte +240 -75
  22. package/src/components/ForgotPasswordPage.svelte +20 -111
  23. package/src/components/Header.svelte +46 -57
  24. package/src/components/InferencerPanel.svelte +136 -110
  25. package/src/components/InfiniteList.svelte +93 -0
  26. package/src/components/Layout.svelte +85 -22
  27. package/src/components/ListPage.svelte +71 -0
  28. package/src/components/LiveIndicator.svelte +58 -0
  29. package/src/components/LoginPage.svelte +33 -154
  30. package/src/components/ModalForm.svelte +6 -2
  31. package/src/components/NavigateToResource.svelte +20 -0
  32. package/src/components/PageSkeleton.svelte +71 -0
  33. package/src/components/PasswordInput.svelte +95 -0
  34. package/src/components/RegisterPage.svelte +35 -164
  35. package/src/components/ShowPage.svelte +35 -36
  36. package/src/components/Sidebar.svelte +212 -81
  37. package/src/components/StatsCard.svelte +12 -3
  38. package/src/components/StepsForm.svelte +139 -0
  39. package/src/components/ThemedTitle.svelte +32 -0
  40. package/src/components/Toast.svelte +15 -44
  41. package/src/components/TooltipButton.svelte +52 -0
  42. package/src/components/UndoableNotification.svelte +28 -96
  43. package/src/components/UpdatePasswordPage.svelte +32 -160
  44. package/src/components/buttons/CloneButton.svelte +1 -1
  45. package/src/components/buttons/CreateButton.svelte +1 -1
  46. package/src/components/buttons/DeleteButton.svelte +3 -4
  47. package/src/components/buttons/EditButton.svelte +1 -1
  48. package/src/components/buttons/ImportButton.svelte +29 -7
  49. package/src/components/buttons/RefreshButton.svelte +11 -5
  50. package/src/components/fieldComponentMap.ts +79 -0
  51. package/src/components/fields/BooleanField.svelte +13 -0
  52. package/src/components/fields/DateField.svelte +6 -0
  53. package/src/components/fields/EmailField.svelte +9 -0
  54. package/src/components/fields/FileField.svelte +14 -0
  55. package/src/components/fields/ImageField.svelte +9 -0
  56. package/src/components/fields/JsonField.svelte +72 -0
  57. package/src/components/fields/MarkdownField.svelte +9 -0
  58. package/src/components/fields/MultiSelectField.svelte +20 -0
  59. package/src/components/fields/NumberField.svelte +6 -0
  60. package/src/components/fields/RelationField.svelte +24 -0
  61. package/src/components/fields/RichTextField.svelte +35 -0
  62. package/src/components/fields/SelectField.svelte +14 -0
  63. package/src/components/fields/TagField.svelte +12 -0
  64. package/src/components/fields/TextField.svelte +11 -0
  65. package/src/components/fields/UrlField.svelte +14 -0
  66. package/src/components/ui/alert-dialog/alert-dialog-content.svelte +25 -0
  67. package/src/components/ui/alert-dialog/alert-dialog-description.svelte +16 -0
  68. package/src/components/ui/alert-dialog/alert-dialog-footer.svelte +8 -0
  69. package/src/components/ui/alert-dialog/alert-dialog-header.svelte +8 -0
  70. package/src/components/ui/alert-dialog/alert-dialog-overlay.svelte +16 -0
  71. package/src/components/ui/alert-dialog/alert-dialog-portal.svelte +6 -0
  72. package/src/components/ui/alert-dialog/alert-dialog-title.svelte +16 -0
  73. package/src/components/ui/alert-dialog/index.ts +20 -0
  74. package/src/components/ui/avatar/avatar.svelte +2 -1
  75. package/src/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +18 -0
  76. package/src/components/ui/breadcrumb/breadcrumb-item.svelte +15 -0
  77. package/src/components/ui/breadcrumb/breadcrumb-link.svelte +15 -0
  78. package/src/components/ui/breadcrumb/breadcrumb-list.svelte +15 -0
  79. package/src/components/ui/breadcrumb/breadcrumb-page.svelte +18 -0
  80. package/src/components/ui/breadcrumb/breadcrumb-separator.svelte +22 -0
  81. package/src/components/ui/breadcrumb/breadcrumb.svelte +11 -0
  82. package/src/components/ui/breadcrumb/index.ts +7 -0
  83. package/src/components/ui/collapsible/index.ts +7 -0
  84. package/src/components/ui/command/command-dialog.svelte +31 -0
  85. package/src/components/ui/command/index.ts +2 -0
  86. package/src/components/ui/context-menu/index.ts +11 -0
  87. package/src/components/ui/drawer/drawer-content.svelte +21 -0
  88. package/src/components/ui/drawer/drawer-description.svelte +11 -0
  89. package/src/components/ui/drawer/drawer-footer.svelte +11 -0
  90. package/src/components/ui/drawer/drawer-header.svelte +11 -0
  91. package/src/components/ui/drawer/drawer-title.svelte +11 -0
  92. package/src/components/ui/drawer/drawer.svelte +18 -0
  93. package/src/components/ui/drawer/index.ts +6 -0
  94. package/src/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +43 -0
  95. package/src/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +27 -0
  96. package/src/components/ui/dropdown-menu/index.ts +6 -0
  97. package/src/components/ui/label/index.ts +1 -0
  98. package/src/components/ui/label/label.svelte +18 -0
  99. package/src/components/ui/pagination/index.ts +7 -0
  100. package/src/components/ui/pagination/pagination-content.svelte +11 -0
  101. package/src/components/ui/pagination/pagination-ellipsis.svelte +12 -0
  102. package/src/components/ui/pagination/pagination-item.svelte +11 -0
  103. package/src/components/ui/pagination/pagination-link.svelte +26 -0
  104. package/src/components/ui/pagination/pagination-next.svelte +22 -0
  105. package/src/components/ui/pagination/pagination-previous.svelte +22 -0
  106. package/src/components/ui/pagination/pagination.svelte +11 -0
  107. package/src/components/ui/popover/index.ts +12 -0
  108. package/src/components/ui/popover/popover-content.svelte +25 -0
  109. package/src/components/ui/progress/index.ts +1 -0
  110. package/src/components/ui/progress/progress.svelte +22 -0
  111. package/src/components/ui/scroll-area/index.ts +1 -0
  112. package/src/components/ui/scroll-area/scroll-area.svelte +20 -0
  113. package/src/components/ui/sheet/index.ts +15 -1
  114. package/src/components/ui/sheet/sheet-content.svelte +28 -0
  115. package/src/components/ui/sheet/sheet-description.svelte +22 -0
  116. package/src/components/ui/sheet/sheet-footer.svelte +22 -0
  117. package/src/components/ui/sheet/sheet-header.svelte +22 -0
  118. package/src/components/ui/sheet/sheet-title.svelte +22 -0
  119. package/src/index.ts +52 -1
  120. package/src/router-state.svelte.ts +16 -9
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <div data-slot="drawer-footer" class={cn("mt-auto flex flex-col gap-2 p-4", className)} {...restProps}>
10
+ {@render children?.()}
11
+ </div>
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <div data-slot="drawer-header" class={cn("grid gap-1.5 p-4 text-center sm:text-left", className)} {...restProps}>
10
+ {@render children?.()}
11
+ </div>
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { Drawer as DrawerPrimitive } from 'vaul-svelte';
3
+ import { cn } from '../../../utils.js';
4
+ import type { Snippet } from 'svelte';
5
+
6
+ let { class: className, children, ...restProps }: { class?: string; children?: Snippet; [key: string]: unknown } = $props();
7
+ </script>
8
+
9
+ <DrawerPrimitive.Title class={cn("text-lg font-semibold leading-none tracking-tight", className)} {...restProps}>
10
+ {@render children?.()}
11
+ </DrawerPrimitive.Title>
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { Drawer as DrawerPrimitive } from 'vaul-svelte';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ let {
6
+ open = $bindable(false),
7
+ children,
8
+ ...restProps
9
+ }: {
10
+ open?: boolean;
11
+ children?: Snippet;
12
+ [key: string]: unknown;
13
+ } = $props();
14
+ </script>
15
+
16
+ <DrawerPrimitive.Root bind:open {...restProps}>
17
+ {@render children?.()}
18
+ </DrawerPrimitive.Root>
@@ -0,0 +1,6 @@
1
+ export { default as Root } from './drawer.svelte';
2
+ export { default as Content } from './drawer-content.svelte';
3
+ export { default as Header } from './drawer-header.svelte';
4
+ export { default as Footer } from './drawer-footer.svelte';
5
+ export { default as Title } from './drawer-title.svelte';
6
+ export { default as Description } from './drawer-description.svelte';
@@ -0,0 +1,43 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLButtonAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLButtonAttributes> & {
6
+ checked?: boolean;
7
+ onCheckedChange?: (checked: boolean) => void;
8
+ };
9
+
10
+ let {
11
+ ref = $bindable(null),
12
+ class: className,
13
+ checked = false,
14
+ onCheckedChange,
15
+ children,
16
+ ...restProps
17
+ }: Props = $props();
18
+
19
+ function handleClick() {
20
+ const next = !checked;
21
+ onCheckedChange?.(next);
22
+ }
23
+ </script>
24
+
25
+ <button
26
+ bind:this={ref}
27
+ role="menuitemcheckbox"
28
+ aria-checked={checked}
29
+ data-slot="dropdown-menu-checkbox-item"
30
+ class={cn(
31
+ "relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
32
+ className
33
+ )}
34
+ onclick={handleClick}
35
+ {...restProps}
36
+ >
37
+ <span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
38
+ {#if checked}
39
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>
40
+ {/if}
41
+ </span>
42
+ {@render children?.()}
43
+ </button>
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLButtonAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLButtonAttributes>;
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ children,
11
+ child,
12
+ ...restProps
13
+ }: Props & { child?: import("svelte").Snippet<[{ props: Record<string, unknown> }]> } = $props();
14
+ </script>
15
+
16
+ {#if child}
17
+ {@render child({ props: { ...restProps, class: cn(className), "data-slot": "dropdown-menu-trigger" } })}
18
+ {:else}
19
+ <button
20
+ bind:this={ref}
21
+ data-slot="dropdown-menu-trigger"
22
+ class={cn(className)}
23
+ {...restProps}
24
+ >
25
+ {@render children?.()}
26
+ </button>
27
+ {/if}
@@ -2,14 +2,20 @@ import DropdownMenu from "./dropdown-menu.svelte";
2
2
  import DropdownMenuContent from "./dropdown-menu-content.svelte";
3
3
  import DropdownMenuItem from "./dropdown-menu-item.svelte";
4
4
  import DropdownMenuSeparator from "./dropdown-menu-separator.svelte";
5
+ import DropdownMenuTrigger from "./dropdown-menu-trigger.svelte";
6
+ import DropdownMenuCheckboxItem from "./dropdown-menu-checkbox-item.svelte";
5
7
 
6
8
  export {
7
9
  DropdownMenu,
8
10
  DropdownMenuContent,
9
11
  DropdownMenuItem,
10
12
  DropdownMenuSeparator,
13
+ DropdownMenuTrigger,
14
+ DropdownMenuCheckboxItem,
11
15
  DropdownMenu as Root,
12
16
  DropdownMenuContent as Content,
13
17
  DropdownMenuItem as Item,
14
18
  DropdownMenuSeparator as Separator,
19
+ DropdownMenuTrigger as Trigger,
20
+ DropdownMenuCheckboxItem as CheckboxItem,
15
21
  };
@@ -0,0 +1 @@
1
+ export { default as Label } from './label.svelte';
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../../../utils.js';
3
+ import type { HTMLLabelAttributes } from 'svelte/elements';
4
+
5
+ let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLLabelAttributes> = $props();
6
+ </script>
7
+
8
+ <label
9
+ bind:this={ref}
10
+ data-slot="label"
11
+ class={cn(
12
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
13
+ className
14
+ )}
15
+ {...restProps}
16
+ >
17
+ {@render children?.()}
18
+ </label>
@@ -0,0 +1,7 @@
1
+ export { default as Root } from './pagination.svelte';
2
+ export { default as Content } from './pagination-content.svelte';
3
+ export { default as Item } from './pagination-item.svelte';
4
+ export { default as Link } from './pagination-link.svelte';
5
+ export { default as Ellipsis } from './pagination-ellipsis.svelte';
6
+ export { default as Previous } from './pagination-previous.svelte';
7
+ export { default as Next } from './pagination-next.svelte';
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let { class: className, children, ...restProps }: HTMLAttributes<HTMLUListElement> & { children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <ul data-slot="pagination-content" class={cn("flex flex-row items-center gap-1", className)} {...restProps}>
10
+ {@render children?.()}
11
+ </ul>
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import { Ellipsis } from 'lucide-svelte';
5
+
6
+ let { class: className, ...restProps }: HTMLAttributes<HTMLSpanElement> = $props();
7
+ </script>
8
+
9
+ <span aria-hidden data-slot="pagination-ellipsis" class={cn("flex size-9 items-center justify-center", className)} {...restProps}>
10
+ <Ellipsis class="size-4" />
11
+ <span class="sr-only">More pages</span>
12
+ </span>
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLLiAttributes } from 'svelte/elements';
5
+
6
+ let { class: className, children, ...restProps }: HTMLLiAttributes & { children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <li data-slot="pagination-item" class={cn("", className)} {...restProps}>
10
+ {@render children?.()}
11
+ </li>
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLButtonAttributes } from 'svelte/elements';
5
+ import { buttonVariants } from '../button/index.js';
6
+
7
+ let {
8
+ class: className,
9
+ isActive = false,
10
+ children,
11
+ ...restProps
12
+ }: HTMLButtonAttributes & { isActive?: boolean; children?: Snippet } = $props();
13
+ </script>
14
+
15
+ <button
16
+ aria-current={isActive ? 'page' : undefined}
17
+ data-slot="pagination-link"
18
+ data-active={isActive}
19
+ class={cn(
20
+ buttonVariants({ variant: isActive ? 'outline' : 'ghost', size: 'icon-sm' }),
21
+ className
22
+ )}
23
+ {...restProps}
24
+ >
25
+ {@render children?.()}
26
+ </button>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLButtonAttributes } from 'svelte/elements';
5
+ import { buttonVariants } from '../button/index.js';
6
+ import { ChevronRight } from 'lucide-svelte';
7
+
8
+ let { class: className, children, ...restProps }: HTMLButtonAttributes & { children?: Snippet } = $props();
9
+ </script>
10
+
11
+ <button
12
+ aria-label="Go to next page"
13
+ data-slot="pagination-next"
14
+ class={cn(buttonVariants({ variant: 'ghost', size: 'icon-sm' }), "gap-1", className)}
15
+ {...restProps}
16
+ >
17
+ {#if children}
18
+ {@render children()}
19
+ {:else}
20
+ <ChevronRight class="size-4" />
21
+ {/if}
22
+ </button>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLButtonAttributes } from 'svelte/elements';
5
+ import { buttonVariants } from '../button/index.js';
6
+ import { ChevronLeft } from 'lucide-svelte';
7
+
8
+ let { class: className, children, ...restProps }: HTMLButtonAttributes & { children?: Snippet } = $props();
9
+ </script>
10
+
11
+ <button
12
+ aria-label="Go to previous page"
13
+ data-slot="pagination-previous"
14
+ class={cn(buttonVariants({ variant: 'ghost', size: 'icon-sm' }), "gap-1", className)}
15
+ {...restProps}
16
+ >
17
+ {#if children}
18
+ {@render children()}
19
+ {:else}
20
+ <ChevronLeft class="size-4" />
21
+ {/if}
22
+ </button>
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { cn } from '../../../utils.js';
3
+ import type { Snippet } from 'svelte';
4
+ import type { HTMLAttributes } from 'svelte/elements';
5
+
6
+ let { class: className, children, ...restProps }: HTMLAttributes<HTMLElement> & { children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <nav aria-label="pagination" data-slot="pagination" class={cn("mx-auto flex w-full justify-center", className)} {...restProps}>
10
+ {@render children?.()}
11
+ </nav>
@@ -0,0 +1,12 @@
1
+ import { Popover as PopoverPrimitive } from "bits-ui";
2
+
3
+ const Root = PopoverPrimitive.Root;
4
+ const Trigger = PopoverPrimitive.Trigger;
5
+ const Close = PopoverPrimitive.Close;
6
+
7
+ export {
8
+ Root,
9
+ Trigger,
10
+ Close,
11
+ };
12
+ export { default as Content } from "./popover-content.svelte";
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import { Popover as PopoverPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ align = "center",
9
+ sideOffset = 4,
10
+ ...restProps
11
+ }: PopoverPrimitive.ContentProps & { class?: string } = $props();
12
+ </script>
13
+
14
+ <PopoverPrimitive.Portal>
15
+ <PopoverPrimitive.Content
16
+ bind:ref
17
+ {align}
18
+ {sideOffset}
19
+ class={cn(
20
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
21
+ className,
22
+ )}
23
+ {...restProps}
24
+ />
25
+ </PopoverPrimitive.Portal>
@@ -0,0 +1 @@
1
+ export { default as Progress } from "./progress.svelte";
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn } from "../../../utils.js";
3
+
4
+ let { value = 0, max = 100, class: className, ...restProps }:
5
+ { value?: number; max?: number; class?: string } & Record<string, unknown> = $props();
6
+
7
+ const percentage = $derived(Math.min(100, Math.max(0, (value / max) * 100)));
8
+ </script>
9
+
10
+ <div
11
+ class={cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className)}
12
+ role="progressbar"
13
+ aria-valuenow={value}
14
+ aria-valuemin={0}
15
+ aria-valuemax={max}
16
+ {...restProps}
17
+ >
18
+ <div
19
+ class="h-full w-full flex-1 bg-primary transition-all duration-200"
20
+ style="transform: translateX(-{100 - percentage}%)"
21
+ ></div>
22
+ </div>
@@ -0,0 +1 @@
1
+ export { default as ScrollArea } from "./scroll-area.svelte";
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let { class: className, children, orientation = 'vertical', ...restProps }:
6
+ { class?: string; children: Snippet; orientation?: 'vertical' | 'horizontal' } & Record<string, unknown> = $props();
7
+ </script>
8
+
9
+ <div
10
+ class={cn("relative overflow-hidden", className)}
11
+ {...restProps}
12
+ >
13
+ <div class={cn(
14
+ "h-full w-full overflow-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-border hover:scrollbar-thumb-muted-foreground/50",
15
+ orientation === 'horizontal' ? 'overflow-x-auto overflow-y-hidden' : 'overflow-y-auto overflow-x-hidden'
16
+ )}>
17
+ {@render children()}
18
+ </div>
19
+ </div>
20
+
@@ -1,2 +1,16 @@
1
1
  import Root from "./sheet.svelte";
2
- export { Root, Root as Sheet };
2
+ import Content from "./sheet-content.svelte";
3
+ import Header from "./sheet-header.svelte";
4
+ import Title from "./sheet-title.svelte";
5
+ import Description from "./sheet-description.svelte";
6
+ import Footer from "./sheet-footer.svelte";
7
+
8
+ export {
9
+ Root,
10
+ Content,
11
+ Header,
12
+ Title,
13
+ Description,
14
+ Footer,
15
+ Root as Sheet,
16
+ };
@@ -0,0 +1,28 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
6
+ side?: "left" | "right";
7
+ };
8
+
9
+ let {
10
+ ref = $bindable(null),
11
+ side = "right",
12
+ class: className,
13
+ children,
14
+ ...restProps
15
+ }: Props = $props();
16
+ </script>
17
+
18
+ <div
19
+ bind:this={ref}
20
+ data-slot="sheet-content"
21
+ class={cn(
22
+ "flex flex-col gap-4 h-full",
23
+ className
24
+ )}
25
+ {...restProps}
26
+ >
27
+ {@render children?.()}
28
+ </div>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLAttributes<HTMLParagraphElement>>;
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ children,
11
+ ...restProps
12
+ }: Props = $props();
13
+ </script>
14
+
15
+ <p
16
+ bind:this={ref}
17
+ data-slot="sheet-description"
18
+ class={cn("text-sm text-muted-foreground", className)}
19
+ {...restProps}
20
+ >
21
+ {@render children?.()}
22
+ </p>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLAttributes<HTMLDivElement>>;
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ children,
11
+ ...restProps
12
+ }: Props = $props();
13
+ </script>
14
+
15
+ <div
16
+ bind:this={ref}
17
+ data-slot="sheet-footer"
18
+ class={cn("mt-auto flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
19
+ {...restProps}
20
+ >
21
+ {@render children?.()}
22
+ </div>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLAttributes<HTMLDivElement>>;
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ children,
11
+ ...restProps
12
+ }: Props = $props();
13
+ </script>
14
+
15
+ <div
16
+ bind:this={ref}
17
+ data-slot="sheet-header"
18
+ class={cn("flex flex-col gap-1.5 pb-4", className)}
19
+ {...restProps}
20
+ >
21
+ {@render children?.()}
22
+ </div>
@@ -0,0 +1,22 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ type Props = WithElementRef<HTMLAttributes<HTMLHeadingElement>>;
6
+
7
+ let {
8
+ ref = $bindable(null),
9
+ class: className,
10
+ children,
11
+ ...restProps
12
+ }: Props = $props();
13
+ </script>
14
+
15
+ <h3
16
+ bind:this={ref}
17
+ data-slot="sheet-title"
18
+ class={cn("text-lg font-semibold text-foreground", className)}
19
+ {...restProps}
20
+ >
21
+ {@render children?.()}
22
+ </h3>
package/src/index.ts CHANGED
@@ -30,6 +30,38 @@ export { default as Authenticated } from './components/Authenticated.svelte';
30
30
  export { default as UpdatePasswordPage } from './components/UpdatePasswordPage.svelte';
31
31
  export { default as ConfigErrorScreen } from './components/ConfigErrorScreen.svelte';
32
32
  export { default as InferencerPanel } from './components/InferencerPanel.svelte';
33
+ export { default as LiveIndicator } from './components/LiveIndicator.svelte';
34
+ export { default as ListPage } from './components/ListPage.svelte';
35
+ export { default as CreatePage } from './components/CreatePage.svelte';
36
+ export { default as EditPage } from './components/EditPage.svelte';
37
+ export { default as AutoSaveIndicator } from './components/AutoSaveIndicator.svelte';
38
+ export { default as ErrorComponent } from './components/ErrorComponent.svelte';
39
+ export { default as PageSkeleton } from './components/PageSkeleton.svelte';
40
+ export { default as NavigateToResource } from './components/NavigateToResource.svelte';
41
+ export { default as CatchAllNavigate } from './components/CatchAllNavigate.svelte';
42
+ export { default as ThemedTitle } from './components/ThemedTitle.svelte';
43
+ export { default as CommandPalette } from './components/CommandPalette.svelte';
44
+ export { default as StepsForm } from './components/StepsForm.svelte';
45
+ export { default as InfiniteList } from './components/InfiniteList.svelte';
46
+ export { default as ComboboxField } from './components/ComboboxField.svelte';
47
+ export { default as PasswordInput } from './components/PasswordInput.svelte';
48
+
49
+ // Field display components
50
+ export { default as NumberField } from './components/fields/NumberField.svelte';
51
+ export { default as DateField } from './components/fields/DateField.svelte';
52
+ export { default as EmailField } from './components/fields/EmailField.svelte';
53
+ export { default as UrlField } from './components/fields/UrlField.svelte';
54
+ export { default as BooleanField } from './components/fields/BooleanField.svelte';
55
+ export { default as TagField } from './components/fields/TagField.svelte';
56
+ export { default as FileField } from './components/fields/FileField.svelte';
57
+ export { default as MarkdownField } from './components/fields/MarkdownField.svelte';
58
+ export { default as TextField } from './components/fields/TextField.svelte';
59
+ export { default as ImageField } from './components/fields/ImageField.svelte';
60
+ export { default as SelectField } from './components/fields/SelectField.svelte';
61
+ export { default as MultiSelectField } from './components/fields/MultiSelectField.svelte';
62
+ export { default as RelationField } from './components/fields/RelationField.svelte';
63
+ export { default as JsonField } from './components/fields/JsonField.svelte';
64
+ export { default as RichTextField } from './components/fields/RichTextField.svelte';
33
65
 
34
66
  // CRUD Buttons
35
67
  export {
@@ -48,7 +80,7 @@ export { Badge } from './components/ui/badge/index.js';
48
80
  export { Separator } from './components/ui/separator/index.js';
49
81
  export { Avatar } from './components/ui/avatar/index.js';
50
82
  export { Skeleton } from './components/ui/skeleton/index.js';
51
- export { Sheet } from './components/ui/sheet/index.js';
83
+ export * as Sheet from './components/ui/sheet/index.js';
52
84
  export * as Alert from './components/ui/alert/index.js';
53
85
  export * as Card from './components/ui/card/index.js';
54
86
  export * as Dialog from './components/ui/dialog/index.js';
@@ -57,5 +89,24 @@ export * as Tabs from './components/ui/tabs/index.js';
57
89
  export * as Tooltip from './components/ui/tooltip/index.js';
58
90
  export * as DropdownMenu from './components/ui/dropdown-menu/index.js';
59
91
 
92
+ // Additional shadcn components
93
+ export * as Breadcrumb from './components/ui/breadcrumb/index.js';
94
+ export * as Pagination from './components/ui/pagination/index.js';
95
+ export * as ContextMenu from './components/ui/context-menu/index.js';
96
+ export * as Drawer from './components/ui/drawer/index.js';
97
+ export * as Collapsible from './components/ui/collapsible/index.js';
98
+ export { Label } from './components/ui/label/index.js';
99
+ export { Command } from './components/ui/command/index.js';
100
+
60
101
  // Utils
61
102
  export { cn } from './utils';
103
+
104
+ // Field component registry
105
+ export {
106
+ builtinDisplayComponents, registerDisplayComponent,
107
+ getDisplayComponent, hasDisplayComponent,
108
+ } from './components/fieldComponentMap';
109
+ export type { FieldComponentMap } from './components/fieldComponentMap';
110
+
111
+ // Svelte Actions
112
+ export { clickOutside, shortcut, intersect, copyOnClick } from './actions';