@shellicar/ui-shadcn 1.0.2

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 (128) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/dist/app.css +70 -0
  4. package/dist/components/page/HomeButton.svelte +8 -0
  5. package/dist/components/page/HomeButton.svelte.d.ts +18 -0
  6. package/dist/components/page/PageHeader.svelte +15 -0
  7. package/dist/components/page/PageHeader.svelte.d.ts +7 -0
  8. package/dist/components/page/PageSection.svelte +32 -0
  9. package/dist/components/page/PageSection.svelte.d.ts +13 -0
  10. package/dist/components/page/index.d.ts +4 -0
  11. package/dist/components/page/index.js +4 -0
  12. package/dist/components/ui/button/button.svelte +80 -0
  13. package/dist/components/ui/button/button.svelte.d.ts +64 -0
  14. package/dist/components/ui/button/index.d.ts +2 -0
  15. package/dist/components/ui/button/index.js +4 -0
  16. package/dist/components/ui/card/card-action.svelte +15 -0
  17. package/dist/components/ui/card/card-action.svelte.d.ts +5 -0
  18. package/dist/components/ui/card/card-content.svelte +10 -0
  19. package/dist/components/ui/card/card-content.svelte.d.ts +5 -0
  20. package/dist/components/ui/card/card-description.svelte +15 -0
  21. package/dist/components/ui/card/card-description.svelte.d.ts +5 -0
  22. package/dist/components/ui/card/card-footer.svelte +15 -0
  23. package/dist/components/ui/card/card-footer.svelte.d.ts +5 -0
  24. package/dist/components/ui/card/card-header.svelte +18 -0
  25. package/dist/components/ui/card/card-header.svelte.d.ts +5 -0
  26. package/dist/components/ui/card/card-title.svelte +15 -0
  27. package/dist/components/ui/card/card-title.svelte.d.ts +5 -0
  28. package/dist/components/ui/card/card.svelte +18 -0
  29. package/dist/components/ui/card/card.svelte.d.ts +5 -0
  30. package/dist/components/ui/card/index.d.ts +8 -0
  31. package/dist/components/ui/card/index.js +10 -0
  32. package/dist/components/ui/form/form-button.svelte +7 -0
  33. package/dist/components/ui/form/form-button.svelte.d.ts +4 -0
  34. package/dist/components/ui/form/form-description.svelte +13 -0
  35. package/dist/components/ui/form/form-description.svelte.d.ts +4 -0
  36. package/dist/components/ui/form/form-element-field.svelte +27 -0
  37. package/dist/components/ui/form/form-element-field.svelte.d.ts +28 -0
  38. package/dist/components/ui/form/form-field-errors.svelte +30 -0
  39. package/dist/components/ui/form/form-field-errors.svelte.d.ts +8 -0
  40. package/dist/components/ui/form/form-field.svelte +33 -0
  41. package/dist/components/ui/form/form-field.svelte.d.ts +28 -0
  42. package/dist/components/ui/form/form-fieldset.svelte +18 -0
  43. package/dist/components/ui/form/form-fieldset.svelte.d.ts +27 -0
  44. package/dist/components/ui/form/form-label.svelte +19 -0
  45. package/dist/components/ui/form/form-label.svelte.d.ts +4 -0
  46. package/dist/components/ui/form/form-legend.svelte +12 -0
  47. package/dist/components/ui/form/form-legend.svelte.d.ts +4 -0
  48. package/dist/components/ui/form/index.d.ts +11 -0
  49. package/dist/components/ui/form/index.js +13 -0
  50. package/dist/components/ui/input/index.d.ts +2 -0
  51. package/dist/components/ui/input/index.js +4 -0
  52. package/dist/components/ui/input/input.svelte +41 -0
  53. package/dist/components/ui/input/input.svelte.d.ts +13 -0
  54. package/dist/components/ui/label/index.d.ts +2 -0
  55. package/dist/components/ui/label/index.js +4 -0
  56. package/dist/components/ui/label/label.svelte +16 -0
  57. package/dist/components/ui/label/label.svelte.d.ts +4 -0
  58. package/dist/components/ui/popover/index.d.ts +6 -0
  59. package/dist/components/ui/popover/index.js +8 -0
  60. package/dist/components/ui/popover/popover-close.svelte +7 -0
  61. package/dist/components/ui/popover/popover-close.svelte.d.ts +4 -0
  62. package/dist/components/ui/popover/popover-content.svelte +31 -0
  63. package/dist/components/ui/popover/popover-content.svelte.d.ts +10 -0
  64. package/dist/components/ui/popover/popover-portal.svelte +7 -0
  65. package/dist/components/ui/popover/popover-portal.svelte.d.ts +3 -0
  66. package/dist/components/ui/popover/popover-trigger.svelte +13 -0
  67. package/dist/components/ui/popover/popover-trigger.svelte.d.ts +4 -0
  68. package/dist/components/ui/popover/popover.svelte +7 -0
  69. package/dist/components/ui/popover/popover.svelte.d.ts +3 -0
  70. package/dist/components/ui/select/index.d.ts +12 -0
  71. package/dist/components/ui/select/index.js +14 -0
  72. package/dist/components/ui/select/select-content.svelte +45 -0
  73. package/dist/components/ui/select/select-content.svelte.d.ts +11 -0
  74. package/dist/components/ui/select/select-group-heading.svelte +16 -0
  75. package/dist/components/ui/select/select-group-heading.svelte.d.ts +10 -0
  76. package/dist/components/ui/select/select-group.svelte +7 -0
  77. package/dist/components/ui/select/select-group.svelte.d.ts +4 -0
  78. package/dist/components/ui/select/select-item.svelte +31 -0
  79. package/dist/components/ui/select/select-item.svelte.d.ts +4 -0
  80. package/dist/components/ui/select/select-label.svelte +15 -0
  81. package/dist/components/ui/select/select-label.svelte.d.ts +6 -0
  82. package/dist/components/ui/select/select-portal.svelte +7 -0
  83. package/dist/components/ui/select/select-portal.svelte.d.ts +3 -0
  84. package/dist/components/ui/select/select-scroll-down-button.svelte +16 -0
  85. package/dist/components/ui/select/select-scroll-down-button.svelte.d.ts +4 -0
  86. package/dist/components/ui/select/select-scroll-up-button.svelte +16 -0
  87. package/dist/components/ui/select/select-scroll-up-button.svelte.d.ts +4 -0
  88. package/dist/components/ui/select/select-separator.svelte +14 -0
  89. package/dist/components/ui/select/select-separator.svelte.d.ts +4 -0
  90. package/dist/components/ui/select/select-trigger.svelte +29 -0
  91. package/dist/components/ui/select/select-trigger.svelte.d.ts +8 -0
  92. package/dist/components/ui/select/select.svelte +7 -0
  93. package/dist/components/ui/select/select.svelte.d.ts +3 -0
  94. package/dist/components/ui/separator/index.d.ts +2 -0
  95. package/dist/components/ui/separator/index.js +4 -0
  96. package/dist/components/ui/separator/separator.svelte +16 -0
  97. package/dist/components/ui/separator/separator.svelte.d.ts +4 -0
  98. package/dist/components/ui/sheet/index.d.ts +11 -0
  99. package/dist/components/ui/sheet/index.js +13 -0
  100. package/dist/components/ui/sheet/sheet-close.svelte +7 -0
  101. package/dist/components/ui/sheet/sheet-close.svelte.d.ts +4 -0
  102. package/dist/components/ui/sheet/sheet-content.svelte +60 -0
  103. package/dist/components/ui/sheet/sheet-content.svelte.d.ts +37 -0
  104. package/dist/components/ui/sheet/sheet-description.svelte +13 -0
  105. package/dist/components/ui/sheet/sheet-description.svelte.d.ts +4 -0
  106. package/dist/components/ui/sheet/sheet-footer.svelte +15 -0
  107. package/dist/components/ui/sheet/sheet-footer.svelte.d.ts +5 -0
  108. package/dist/components/ui/sheet/sheet-header.svelte +15 -0
  109. package/dist/components/ui/sheet/sheet-header.svelte.d.ts +5 -0
  110. package/dist/components/ui/sheet/sheet-overlay.svelte +16 -0
  111. package/dist/components/ui/sheet/sheet-overlay.svelte.d.ts +4 -0
  112. package/dist/components/ui/sheet/sheet-portal.svelte +7 -0
  113. package/dist/components/ui/sheet/sheet-portal.svelte.d.ts +3 -0
  114. package/dist/components/ui/sheet/sheet-title.svelte +13 -0
  115. package/dist/components/ui/sheet/sheet-title.svelte.d.ts +4 -0
  116. package/dist/components/ui/sheet/sheet-trigger.svelte +7 -0
  117. package/dist/components/ui/sheet/sheet-trigger.svelte.d.ts +4 -0
  118. package/dist/components/ui/sheet/sheet.svelte +7 -0
  119. package/dist/components/ui/sheet/sheet.svelte.d.ts +3 -0
  120. package/dist/components/ui/textarea/index.d.ts +2 -0
  121. package/dist/components/ui/textarea/index.js +4 -0
  122. package/dist/components/ui/textarea/textarea.svelte +17 -0
  123. package/dist/components/ui/textarea/textarea.svelte.d.ts +5 -0
  124. package/dist/index.d.ts +11 -0
  125. package/dist/index.js +11 -0
  126. package/dist/utils.d.ts +12 -0
  127. package/dist/utils.js +5 -0
  128. package/package.json +81 -0
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import CheckIcon from '@lucide/svelte/icons/check';
3
+ import type { Select as SelectPrimitive } from 'bits-ui';
4
+ import { cn, type WithoutChild } from '../../../utils.js';
5
+
6
+ const { ref = $bindable(null), class: className, value, label, children: childrenProp, ...restProps }: WithoutChild<SelectPrimitive.ItemProps> = $props();
7
+ </script>
8
+
9
+ <SelectPrimitive.Item
10
+ bind:ref
11
+ {value}
12
+ data-slot="select-item"
13
+ class={cn(
14
+ "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
15
+ className
16
+ )}
17
+ {...restProps}
18
+ >
19
+ {#snippet children({ selected, highlighted })}
20
+ <span class="absolute end-2 flex size-3.5 items-center justify-center">
21
+ {#if selected}
22
+ <CheckIcon class="size-4" />
23
+ {/if}
24
+ </span>
25
+ {#if childrenProp}
26
+ {@render childrenProp({ selected, highlighted })}
27
+ {:else}
28
+ {label || value}
29
+ {/if}
30
+ {/snippet}
31
+ </SelectPrimitive.Item>
@@ -0,0 +1,4 @@
1
+ import type { Select as SelectPrimitive } from 'bits-ui';
2
+ declare const SelectItem: import("svelte").Component<Omit<SelectPrimitive.ItemProps, "child">, {}, "ref">;
3
+ type SelectItem = ReturnType<typeof SelectItem>;
4
+ export default SelectItem;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {} = $props();
6
+ </script>
7
+
8
+ <div
9
+ bind:this={ref}
10
+ data-slot="select-label"
11
+ class={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
12
+ {...restProps}
13
+ >
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,6 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ import { type WithElementRef } from '../../../utils.js';
3
+ type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {};
4
+ declare const SelectLabel: import("svelte").Component<$$ComponentProps, {}, "ref">;
5
+ type SelectLabel = ReturnType<typeof SelectLabel>;
6
+ export default SelectLabel;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { Select as SelectPrimitive } from 'bits-ui';
3
+
4
+ const { ...restProps }: SelectPrimitive.PortalProps = $props();
5
+ </script>
6
+
7
+ <SelectPrimitive.Portal {...restProps} />
@@ -0,0 +1,3 @@
1
+ declare const SelectPortal: import("svelte").Component<import("bits-ui").PortalProps, {}, "">;
2
+ type SelectPortal = ReturnType<typeof SelectPortal>;
3
+ export default SelectPortal;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
3
+ import type { Select as SelectPrimitive } from 'bits-ui';
4
+ import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
5
+
6
+ const { ref = $bindable(null), class: className, ...restProps }: WithoutChildrenOrChild<SelectPrimitive.ScrollDownButtonProps> = $props();
7
+ </script>
8
+
9
+ <SelectPrimitive.ScrollDownButton
10
+ bind:ref
11
+ data-slot="select-scroll-down-button"
12
+ class={cn("flex cursor-default items-center justify-center py-1", className)}
13
+ {...restProps}
14
+ >
15
+ <ChevronDownIcon class="size-4" />
16
+ </SelectPrimitive.ScrollDownButton>
@@ -0,0 +1,4 @@
1
+ import type { Select as SelectPrimitive } from 'bits-ui';
2
+ declare const SelectScrollDownButton: import("svelte").Component<Omit<Omit<SelectPrimitive.ScrollDownButtonProps, "child">, "children">, {}, "ref">;
3
+ type SelectScrollDownButton = ReturnType<typeof SelectScrollDownButton>;
4
+ export default SelectScrollDownButton;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import ChevronUpIcon from '@lucide/svelte/icons/chevron-up';
3
+ import type { Select as SelectPrimitive } from 'bits-ui';
4
+ import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
5
+
6
+ const { ref = $bindable(null), class: className, ...restProps }: WithoutChildrenOrChild<SelectPrimitive.ScrollUpButtonProps> = $props();
7
+ </script>
8
+
9
+ <SelectPrimitive.ScrollUpButton
10
+ bind:ref
11
+ data-slot="select-scroll-up-button"
12
+ class={cn("flex cursor-default items-center justify-center py-1", className)}
13
+ {...restProps}
14
+ >
15
+ <ChevronUpIcon class="size-4" />
16
+ </SelectPrimitive.ScrollUpButton>
@@ -0,0 +1,4 @@
1
+ import type { Select as SelectPrimitive } from 'bits-ui';
2
+ declare const SelectScrollUpButton: import("svelte").Component<Omit<Omit<SelectPrimitive.ScrollUpButtonProps, "child">, "children">, {}, "ref">;
3
+ type SelectScrollUpButton = ReturnType<typeof SelectScrollUpButton>;
4
+ export default SelectScrollUpButton;
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import type { Separator as SeparatorPrimitive } from 'bits-ui';
3
+ import { Separator } from '../separator/index.js';
4
+ import { cn } from '../../../utils.js';
5
+
6
+ const { ref = $bindable(null), class: className, ...restProps }: SeparatorPrimitive.RootProps = $props();
7
+ </script>
8
+
9
+ <Separator
10
+ bind:ref
11
+ data-slot="select-separator"
12
+ class={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
13
+ {...restProps}
14
+ />
@@ -0,0 +1,4 @@
1
+ import type { Separator as SeparatorPrimitive } from 'bits-ui';
2
+ declare const SelectSeparator: import("svelte").Component<SeparatorPrimitive.RootProps, {}, "ref">;
3
+ type SelectSeparator = ReturnType<typeof SelectSeparator>;
4
+ export default SelectSeparator;
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ import ChevronDownIcon from '@lucide/svelte/icons/chevron-down';
3
+ import type { Select as SelectPrimitive } from 'bits-ui';
4
+ import { cn, type WithoutChild } from '../../../utils.js';
5
+
6
+ const {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ size = 'default',
11
+ ...restProps
12
+ }: WithoutChild<SelectPrimitive.TriggerProps> & {
13
+ size?: 'sm' | 'default';
14
+ } = $props();
15
+ </script>
16
+
17
+ <SelectPrimitive.Trigger
18
+ bind:ref
19
+ data-slot="select-trigger"
20
+ data-size={size}
21
+ class={cn(
22
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none select-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
23
+ className
24
+ )}
25
+ {...restProps}
26
+ >
27
+ {@render children?.()}
28
+ <ChevronDownIcon class="size-4 opacity-50" />
29
+ </SelectPrimitive.Trigger>
@@ -0,0 +1,8 @@
1
+ import type { Select as SelectPrimitive } from 'bits-ui';
2
+ import { type WithoutChild } from '../../../utils.js';
3
+ type $$ComponentProps = WithoutChild<SelectPrimitive.TriggerProps> & {
4
+ size?: 'sm' | 'default';
5
+ };
6
+ declare const SelectTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
7
+ type SelectTrigger = ReturnType<typeof SelectTrigger>;
8
+ export default SelectTrigger;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { Select as SelectPrimitive } from 'bits-ui';
3
+
4
+ const { open = $bindable(false), value = $bindable(), ...restProps }: SelectPrimitive.RootProps = $props();
5
+ </script>
6
+
7
+ <SelectPrimitive.Root bind:open bind:value={value as never} {...restProps} />
@@ -0,0 +1,3 @@
1
+ declare const Select: import("svelte").Component<import("bits-ui").SelectRootPropsWithoutHTML, {}, "value" | "open">;
2
+ type Select = ReturnType<typeof Select>;
3
+ export default Select;
@@ -0,0 +1,2 @@
1
+ import Root from './separator.svelte';
2
+ export { Root, Root as Separator, };
@@ -0,0 +1,4 @@
1
+ import Root from './separator.svelte';
2
+ export { Root,
3
+ //
4
+ Root as Separator, };
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { Separator as SeparatorPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, 'data-slot': dataSlot = 'separator', ...restProps }: SeparatorPrimitive.RootProps = $props();
6
+ </script>
7
+
8
+ <SeparatorPrimitive.Root
9
+ bind:ref
10
+ data-slot={dataSlot}
11
+ class={cn(
12
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
13
+ className
14
+ )}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,4 @@
1
+ import type { Separator as SeparatorPrimitive } from 'bits-ui';
2
+ declare const Separator: import("svelte").Component<SeparatorPrimitive.RootProps, {}, "ref">;
3
+ type Separator = ReturnType<typeof Separator>;
4
+ export default Separator;
@@ -0,0 +1,11 @@
1
+ import Root from './sheet.svelte';
2
+ import Close from './sheet-close.svelte';
3
+ import Content from './sheet-content.svelte';
4
+ import Description from './sheet-description.svelte';
5
+ import Footer from './sheet-footer.svelte';
6
+ import Header from './sheet-header.svelte';
7
+ import Overlay from './sheet-overlay.svelte';
8
+ import Portal from './sheet-portal.svelte';
9
+ import Title from './sheet-title.svelte';
10
+ import Trigger from './sheet-trigger.svelte';
11
+ export { Root, Close, Trigger, Portal, Overlay, Content, Header, Footer, Title, Description, Root as Sheet, Close as SheetClose, Trigger as SheetTrigger, Portal as SheetPortal, Overlay as SheetOverlay, Content as SheetContent, Header as SheetHeader, Footer as SheetFooter, Title as SheetTitle, Description as SheetDescription, };
@@ -0,0 +1,13 @@
1
+ import Root from './sheet.svelte';
2
+ import Close from './sheet-close.svelte';
3
+ import Content from './sheet-content.svelte';
4
+ import Description from './sheet-description.svelte';
5
+ import Footer from './sheet-footer.svelte';
6
+ import Header from './sheet-header.svelte';
7
+ import Overlay from './sheet-overlay.svelte';
8
+ import Portal from './sheet-portal.svelte';
9
+ import Title from './sheet-title.svelte';
10
+ import Trigger from './sheet-trigger.svelte';
11
+ export { Root, Close, Trigger, Portal, Overlay, Content, Header, Footer, Title, Description,
12
+ //
13
+ Root as Sheet, Close as SheetClose, Trigger as SheetTrigger, Portal as SheetPortal, Overlay as SheetOverlay, Content as SheetContent, Header as SheetHeader, Footer as SheetFooter, Title as SheetTitle, Description as SheetDescription, };
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+
4
+ const { ref = $bindable(null), ...restProps }: SheetPrimitive.CloseProps = $props();
5
+ </script>
6
+
7
+ <SheetPrimitive.Close bind:ref data-slot="sheet-close" {...restProps} />
@@ -0,0 +1,4 @@
1
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
2
+ declare const SheetClose: import("svelte").Component<SheetPrimitive.TriggerProps, {}, "ref">;
3
+ type SheetClose = ReturnType<typeof SheetClose>;
4
+ export default SheetClose;
@@ -0,0 +1,60 @@
1
+ <script lang="ts" module>
2
+ import { tv, type VariantProps } from 'tailwind-variants';
3
+ export const sheetVariants = tv({
4
+ base: 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
5
+ variants: {
6
+ side: {
7
+ top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
8
+ bottom: 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
9
+ left: 'data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start inset-y-0 start-0 h-full w-3/4 border-e sm:max-w-sm',
10
+ right: 'data-[state=closed]:slide-out-to-end data-[state=open]:slide-in-from-end inset-y-0 end-0 h-full w-3/4 border-s sm:max-w-sm',
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ side: 'right',
15
+ },
16
+ });
17
+
18
+ export type Side = VariantProps<typeof sheetVariants>['side'];
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import { Dialog as SheetPrimitive } from "bits-ui";
23
+ import XIcon from "@lucide/svelte/icons/x";
24
+ import type { Snippet } from "svelte";
25
+ import SheetPortal from "./sheet-portal.svelte";
26
+ import SheetOverlay from "./sheet-overlay.svelte";
27
+ import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
28
+ import type { ComponentProps } from "svelte";
29
+
30
+ let {
31
+ ref = $bindable(null),
32
+ class: className,
33
+ side = "right",
34
+ portalProps,
35
+ children,
36
+ ...restProps
37
+ }: WithoutChildrenOrChild<SheetPrimitive.ContentProps> & {
38
+ portalProps?: WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>;
39
+ side?: Side;
40
+ children: Snippet;
41
+ } = $props();
42
+ </script>
43
+
44
+ <SheetPortal {...portalProps}>
45
+ <SheetOverlay />
46
+ <SheetPrimitive.Content
47
+ bind:ref
48
+ data-slot="sheet-content"
49
+ class={cn(sheetVariants({ side }), className)}
50
+ {...restProps}
51
+ >
52
+ {@render children?.()}
53
+ <SheetPrimitive.Close
54
+ class="ring-offset-background focus-visible:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none"
55
+ >
56
+ <XIcon class="size-4" />
57
+ <span class="sr-only">Close</span>
58
+ </SheetPrimitive.Close>
59
+ </SheetPrimitive.Content>
60
+ </SheetPortal>
@@ -0,0 +1,37 @@
1
+ import { type VariantProps } from 'tailwind-variants';
2
+ export declare const sheetVariants: import("tailwind-variants").TVReturnType<{
3
+ side: {
4
+ top: string;
5
+ bottom: string;
6
+ left: string;
7
+ right: string;
8
+ };
9
+ }, undefined, "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", {
10
+ side: {
11
+ top: string;
12
+ bottom: string;
13
+ left: string;
14
+ right: string;
15
+ };
16
+ }, undefined, import("tailwind-variants").TVReturnType<{
17
+ side: {
18
+ top: string;
19
+ bottom: string;
20
+ left: string;
21
+ right: string;
22
+ };
23
+ }, undefined, "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500", unknown, unknown, undefined>>;
24
+ export type Side = VariantProps<typeof sheetVariants>['side'];
25
+ import { Dialog as SheetPrimitive } from "bits-ui";
26
+ import type { Snippet } from "svelte";
27
+ import SheetPortal from "./sheet-portal.svelte";
28
+ import { type WithoutChildrenOrChild } from "../../../utils.js";
29
+ import type { ComponentProps } from "svelte";
30
+ type $$ComponentProps = WithoutChildrenOrChild<SheetPrimitive.ContentProps> & {
31
+ portalProps?: WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>;
32
+ side?: Side;
33
+ children: Snippet;
34
+ };
35
+ declare const SheetContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
36
+ type SheetContent = ReturnType<typeof SheetContent>;
37
+ export default SheetContent;
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, ...restProps }: SheetPrimitive.DescriptionProps = $props();
6
+ </script>
7
+
8
+ <SheetPrimitive.Description
9
+ bind:ref
10
+ data-slot="sheet-description"
11
+ class={cn("text-muted-foreground text-sm", className)}
12
+ {...restProps}
13
+ />
@@ -0,0 +1,4 @@
1
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
2
+ declare const SheetDescription: import("svelte").Component<SheetPrimitive.DescriptionProps, {}, "ref">;
3
+ type SheetDescription = ReturnType<typeof SheetDescription>;
4
+ export default SheetDescription;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
6
+ </script>
7
+
8
+ <div
9
+ bind:this={ref}
10
+ data-slot="sheet-footer"
11
+ class={cn("mt-auto flex flex-col gap-2 p-4", className)}
12
+ {...restProps}
13
+ >
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ import { type WithElementRef } from '../../../utils.js';
3
+ declare const SheetFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type SheetFooter = ReturnType<typeof SheetFooter>;
5
+ export default SheetFooter;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
6
+ </script>
7
+
8
+ <div
9
+ bind:this={ref}
10
+ data-slot="sheet-header"
11
+ class={cn("flex flex-col gap-1.5 p-4", className)}
12
+ {...restProps}
13
+ >
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ import { type WithElementRef } from '../../../utils.js';
3
+ declare const SheetHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type SheetHeader = ReturnType<typeof SheetHeader>;
5
+ export default SheetHeader;
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, ...restProps }: SheetPrimitive.OverlayProps = $props();
6
+ </script>
7
+
8
+ <SheetPrimitive.Overlay
9
+ bind:ref
10
+ data-slot="sheet-overlay"
11
+ class={cn(
12
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
13
+ className
14
+ )}
15
+ {...restProps}
16
+ />
@@ -0,0 +1,4 @@
1
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
2
+ declare const SheetOverlay: import("svelte").Component<SheetPrimitive.OverlayProps, {}, "ref">;
3
+ type SheetOverlay = ReturnType<typeof SheetOverlay>;
4
+ export default SheetOverlay;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+
4
+ const { ...restProps }: SheetPrimitive.PortalProps = $props();
5
+ </script>
6
+
7
+ <SheetPrimitive.Portal {...restProps} />
@@ -0,0 +1,3 @@
1
+ declare const SheetPortal: import("svelte").Component<import("bits-ui").PortalProps, {}, "">;
2
+ type SheetPortal = ReturnType<typeof SheetPortal>;
3
+ export default SheetPortal;
@@ -0,0 +1,13 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), class: className, ...restProps }: SheetPrimitive.TitleProps = $props();
6
+ </script>
7
+
8
+ <SheetPrimitive.Title
9
+ bind:ref
10
+ data-slot="sheet-title"
11
+ class={cn("text-foreground font-semibold", className)}
12
+ {...restProps}
13
+ />
@@ -0,0 +1,4 @@
1
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
2
+ declare const SheetTitle: import("svelte").Component<SheetPrimitive.TitleProps, {}, "ref">;
3
+ type SheetTitle = ReturnType<typeof SheetTitle>;
4
+ export default SheetTitle;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+
4
+ const { ref = $bindable(null), ...restProps }: SheetPrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <SheetPrimitive.Trigger bind:ref data-slot="sheet-trigger" {...restProps} />
@@ -0,0 +1,4 @@
1
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
2
+ declare const SheetTrigger: import("svelte").Component<SheetPrimitive.TriggerProps, {}, "ref">;
3
+ type SheetTrigger = ReturnType<typeof SheetTrigger>;
4
+ export default SheetTrigger;
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import type { Dialog as SheetPrimitive } from 'bits-ui';
3
+
4
+ const { open = $bindable(false), ...restProps }: SheetPrimitive.RootProps = $props();
5
+ </script>
6
+
7
+ <SheetPrimitive.Root bind:open {...restProps} />
@@ -0,0 +1,3 @@
1
+ declare const Sheet: import("svelte").Component<import("bits-ui").AlertDialogRootPropsWithoutHTML, {}, "open">;
2
+ type Sheet = ReturnType<typeof Sheet>;
3
+ export default Sheet;
@@ -0,0 +1,2 @@
1
+ import Root from './textarea.svelte';
2
+ export { Root, Root as Textarea, };
@@ -0,0 +1,4 @@
1
+ import Root from './textarea.svelte';
2
+ export { Root,
3
+ //
4
+ Root as Textarea, };
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import type { HTMLTextareaAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef, type WithoutChildren } from '../../../utils.js';
4
+
5
+ const { ref = $bindable(null), value = $bindable(), class: className, 'data-slot': dataSlot = 'textarea', ...restProps }: WithoutChildren<WithElementRef<HTMLTextareaAttributes>> = $props();
6
+ </script>
7
+
8
+ <textarea
9
+ bind:this={ref}
10
+ data-slot={dataSlot}
11
+ class={cn(
12
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
13
+ className
14
+ )}
15
+ bind:value
16
+ {...restProps}
17
+ ></textarea>
@@ -0,0 +1,5 @@
1
+ import type { HTMLTextareaAttributes } from 'svelte/elements';
2
+ import { type WithElementRef } from '../../../utils.js';
3
+ declare const Textarea: import("svelte").Component<Omit<WithElementRef<HTMLTextareaAttributes>, "children">, {}, "ref" | "value">;
4
+ type Textarea = ReturnType<typeof Textarea>;
5
+ export default Textarea;
@@ -0,0 +1,11 @@
1
+ import * as Form from './components/ui/form/index.js';
2
+ import { Input } from './components/ui/input/index.js';
3
+ import * as Select from './components/ui/select/index.js';
4
+ import { Textarea } from './components/ui/textarea/index.js';
5
+ import { PageSection } from './components/page/index.js';
6
+ import { default as Button, buttonVariants } from './components/ui/button/button.svelte';
7
+ import * as Card from './components/ui/card/index.ts';
8
+ import * as Popover from './components/ui/popover/index.js';
9
+ import { Separator } from './components/ui/separator/index.ts';
10
+ import * as Sheet from './components/ui/sheet/index.js';
11
+ export { Sheet, Separator, Card, Popover, Button, buttonVariants, Form, Input, Select, Textarea, PageSection };
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import * as Form from './components/ui/form/index.js';
2
+ import { Input } from './components/ui/input/index.js';
3
+ import * as Select from './components/ui/select/index.js';
4
+ import { Textarea } from './components/ui/textarea/index.js';
5
+ import { PageSection } from './components/page/index.js';
6
+ import { default as Button, buttonVariants } from './components/ui/button/button.svelte';
7
+ import * as Card from "./components/ui/card/index.js";
8
+ import * as Popover from './components/ui/popover/index.js';
9
+ import { Separator } from "./components/ui/separator/index.js";
10
+ import * as Sheet from './components/ui/sheet/index.js';
11
+ export { Sheet, Separator, Card, Popover, Button, buttonVariants, Form, Input, Select, Textarea, PageSection };
@@ -0,0 +1,12 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export type WithoutChild<T> = T extends {
4
+ child?: any;
5
+ } ? Omit<T, 'child'> : T;
6
+ export type WithoutChildren<T> = T extends {
7
+ children?: any;
8
+ } ? Omit<T, 'children'> : T;
9
+ export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
10
+ export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
11
+ ref?: U | null;
12
+ };
package/dist/utils.js ADDED
@@ -0,0 +1,5 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }