@nucel/ui 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.
Files changed (147) hide show
  1. package/README.md +235 -0
  2. package/package.json +88 -0
  3. package/src/lib/components/ui/Backdrop.svelte +19 -0
  4. package/src/lib/components/ui/CountBadge.svelte +40 -0
  5. package/src/lib/components/ui/EmptyState.svelte +68 -0
  6. package/src/lib/components/ui/KbdShortcut.svelte +20 -0
  7. package/src/lib/components/ui/MarkdownRenderer.svelte +85 -0
  8. package/src/lib/components/ui/ProgressRing.svelte +61 -0
  9. package/src/lib/components/ui/ProviderIcon.svelte +57 -0
  10. package/src/lib/components/ui/ReviewBadge.svelte +54 -0
  11. package/src/lib/components/ui/Sparkline.svelte +61 -0
  12. package/src/lib/components/ui/StatusBadge.svelte +32 -0
  13. package/src/lib/components/ui/StatusDot.svelte +65 -0
  14. package/src/lib/components/ui/TabBar.svelte +127 -0
  15. package/src/lib/components/ui/VerticalSeparator.svelte +9 -0
  16. package/src/lib/components/ui/accordion/accordion-content.svelte +22 -0
  17. package/src/lib/components/ui/accordion/accordion-item.svelte +17 -0
  18. package/src/lib/components/ui/accordion/accordion-trigger.svelte +32 -0
  19. package/src/lib/components/ui/accordion/accordion.svelte +16 -0
  20. package/src/lib/components/ui/accordion/index.ts +16 -0
  21. package/src/lib/components/ui/avatar/avatar-fallback.svelte +17 -0
  22. package/src/lib/components/ui/avatar/avatar-image.svelte +17 -0
  23. package/src/lib/components/ui/avatar/avatar.svelte +19 -0
  24. package/src/lib/components/ui/avatar/index.ts +13 -0
  25. package/src/lib/components/ui/badge/badge.svelte +49 -0
  26. package/src/lib/components/ui/badge/index.ts +2 -0
  27. package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
  28. package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +20 -0
  29. package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
  30. package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
  31. package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
  32. package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
  33. package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +21 -0
  34. package/src/lib/components/ui/breadcrumb/index.ts +25 -0
  35. package/src/lib/components/ui/button/button.svelte +82 -0
  36. package/src/lib/components/ui/button/index.ts +17 -0
  37. package/src/lib/components/ui/card/card-action.svelte +20 -0
  38. package/src/lib/components/ui/card/card-content.svelte +15 -0
  39. package/src/lib/components/ui/card/card-description.svelte +20 -0
  40. package/src/lib/components/ui/card/card-footer.svelte +20 -0
  41. package/src/lib/components/ui/card/card-header.svelte +23 -0
  42. package/src/lib/components/ui/card/card-title.svelte +20 -0
  43. package/src/lib/components/ui/card/card.svelte +23 -0
  44. package/src/lib/components/ui/card/index.ts +25 -0
  45. package/src/lib/components/ui/collapsible/collapsible-content.svelte +7 -0
  46. package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +7 -0
  47. package/src/lib/components/ui/collapsible/collapsible.svelte +11 -0
  48. package/src/lib/components/ui/collapsible/index.ts +13 -0
  49. package/src/lib/components/ui/dialog/dialog-close.svelte +7 -0
  50. package/src/lib/components/ui/dialog/dialog-content.svelte +45 -0
  51. package/src/lib/components/ui/dialog/dialog-description.svelte +17 -0
  52. package/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
  53. package/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
  54. package/src/lib/components/ui/dialog/dialog-overlay.svelte +20 -0
  55. package/src/lib/components/ui/dialog/dialog-portal.svelte +7 -0
  56. package/src/lib/components/ui/dialog/dialog-title.svelte +17 -0
  57. package/src/lib/components/ui/dialog/dialog-trigger.svelte +7 -0
  58. package/src/lib/components/ui/dialog/dialog.svelte +7 -0
  59. package/src/lib/components/ui/dialog/index.ts +34 -0
  60. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
  61. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +41 -0
  62. package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +29 -0
  63. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
  64. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
  65. package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
  66. package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
  67. package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
  68. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
  69. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +31 -0
  70. package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
  71. package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
  72. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
  73. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
  74. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
  75. package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
  76. package/src/lib/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
  77. package/src/lib/components/ui/dropdown-menu/index.ts +54 -0
  78. package/src/lib/components/ui/input/index.ts +7 -0
  79. package/src/lib/components/ui/input/input.svelte +52 -0
  80. package/src/lib/components/ui/label/index.ts +7 -0
  81. package/src/lib/components/ui/label/label.svelte +20 -0
  82. package/src/lib/components/ui/navigation-menu/index.ts +28 -0
  83. package/src/lib/components/ui/navigation-menu/navigation-menu-content.svelte +21 -0
  84. package/src/lib/components/ui/navigation-menu/navigation-menu-indicator.svelte +22 -0
  85. package/src/lib/components/ui/navigation-menu/navigation-menu-item.svelte +17 -0
  86. package/src/lib/components/ui/navigation-menu/navigation-menu-link.svelte +20 -0
  87. package/src/lib/components/ui/navigation-menu/navigation-menu-list.svelte +17 -0
  88. package/src/lib/components/ui/navigation-menu/navigation-menu-trigger.svelte +34 -0
  89. package/src/lib/components/ui/navigation-menu/navigation-menu-viewport.svelte +22 -0
  90. package/src/lib/components/ui/navigation-menu/navigation-menu.svelte +32 -0
  91. package/src/lib/components/ui/progress/index.ts +1 -0
  92. package/src/lib/components/ui/progress/progress.svelte +33 -0
  93. package/src/lib/components/ui/scroll-area/index.ts +10 -0
  94. package/src/lib/components/ui/scroll-area/scroll-area-scrollbar.svelte +31 -0
  95. package/src/lib/components/ui/scroll-area/scroll-area.svelte +43 -0
  96. package/src/lib/components/ui/select/index.ts +37 -0
  97. package/src/lib/components/ui/select/select-content.svelte +45 -0
  98. package/src/lib/components/ui/select/select-group-heading.svelte +21 -0
  99. package/src/lib/components/ui/select/select-group.svelte +7 -0
  100. package/src/lib/components/ui/select/select-item.svelte +38 -0
  101. package/src/lib/components/ui/select/select-label.svelte +20 -0
  102. package/src/lib/components/ui/select/select-portal.svelte +7 -0
  103. package/src/lib/components/ui/select/select-scroll-down-button.svelte +20 -0
  104. package/src/lib/components/ui/select/select-scroll-up-button.svelte +20 -0
  105. package/src/lib/components/ui/select/select-separator.svelte +18 -0
  106. package/src/lib/components/ui/select/select-trigger.svelte +29 -0
  107. package/src/lib/components/ui/select/select.svelte +11 -0
  108. package/src/lib/components/ui/separator/index.ts +7 -0
  109. package/src/lib/components/ui/separator/separator.svelte +21 -0
  110. package/src/lib/components/ui/sheet/index.ts +34 -0
  111. package/src/lib/components/ui/sheet/sheet-close.svelte +7 -0
  112. package/src/lib/components/ui/sheet/sheet-content.svelte +62 -0
  113. package/src/lib/components/ui/sheet/sheet-description.svelte +17 -0
  114. package/src/lib/components/ui/sheet/sheet-footer.svelte +20 -0
  115. package/src/lib/components/ui/sheet/sheet-header.svelte +20 -0
  116. package/src/lib/components/ui/sheet/sheet-overlay.svelte +20 -0
  117. package/src/lib/components/ui/sheet/sheet-portal.svelte +7 -0
  118. package/src/lib/components/ui/sheet/sheet-title.svelte +17 -0
  119. package/src/lib/components/ui/sheet/sheet-trigger.svelte +7 -0
  120. package/src/lib/components/ui/sheet/sheet.svelte +7 -0
  121. package/src/lib/components/ui/skeleton/index.ts +1 -0
  122. package/src/lib/components/ui/skeleton/skeleton.svelte +17 -0
  123. package/src/lib/components/ui/sonner/index.ts +1 -0
  124. package/src/lib/components/ui/sonner/sonner.svelte +10 -0
  125. package/src/lib/components/ui/tabs/index.ts +16 -0
  126. package/src/lib/components/ui/tabs/tabs-content.svelte +17 -0
  127. package/src/lib/components/ui/tabs/tabs-list.svelte +16 -0
  128. package/src/lib/components/ui/tabs/tabs-trigger.svelte +20 -0
  129. package/src/lib/components/ui/tabs/tabs.svelte +19 -0
  130. package/src/lib/components/ui/textarea/index.ts +7 -0
  131. package/src/lib/components/ui/textarea/textarea.svelte +23 -0
  132. package/src/lib/components/ui/toggle/index.ts +13 -0
  133. package/src/lib/components/ui/toggle/toggle.svelte +52 -0
  134. package/src/lib/components/ui/toggle-group/index.ts +10 -0
  135. package/src/lib/components/ui/toggle-group/toggle-group-item.svelte +35 -0
  136. package/src/lib/components/ui/toggle-group/toggle-group.svelte +65 -0
  137. package/src/lib/components/ui/tooltip/index.ts +19 -0
  138. package/src/lib/components/ui/tooltip/tooltip-content.svelte +52 -0
  139. package/src/lib/components/ui/tooltip/tooltip-portal.svelte +7 -0
  140. package/src/lib/components/ui/tooltip/tooltip-provider.svelte +7 -0
  141. package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +7 -0
  142. package/src/lib/components/ui/tooltip/tooltip.svelte +7 -0
  143. package/src/lib/index.ts +244 -0
  144. package/src/lib/utils/cn.test.ts +993 -0
  145. package/src/lib/utils/cn.ts +6 -0
  146. package/src/lib/utils.ts +12 -0
  147. package/src/styles.css +127 -0
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLOlAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLOlAttributes> = $props();
11
+ </script>
12
+
13
+ <ol
14
+ bind:this={ref}
15
+ data-slot="breadcrumb-list"
16
+ class={cn(
17
+ 'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
18
+ className,
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </ol>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLSpanElement>> = $props();
11
+ </script>
12
+
13
+ <span
14
+ bind:this={ref}
15
+ data-slot="breadcrumb-page"
16
+ role="link"
17
+ aria-disabled="true"
18
+ aria-current="page"
19
+ class={cn('text-foreground font-normal', className)}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </span>
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+ import type { HTMLLiAttributes } from 'svelte/elements';
5
+
6
+ let {
7
+ ref = $bindable(null),
8
+ class: className,
9
+ children,
10
+ ...restProps
11
+ }: WithElementRef<HTMLLiAttributes> = $props();
12
+ </script>
13
+
14
+ <li
15
+ bind:this={ref}
16
+ data-slot="breadcrumb-separator"
17
+ role="presentation"
18
+ aria-hidden="true"
19
+ class={cn('[&>svg]:size-3.5', className)}
20
+ {...restProps}
21
+ >
22
+ {#if children}
23
+ {@render children?.()}
24
+ {:else}
25
+ <ChevronRightIcon />
26
+ {/if}
27
+ </li>
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import type { WithElementRef } from '../../../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLElement>> = $props();
11
+ </script>
12
+
13
+ <nav
14
+ bind:this={ref}
15
+ data-slot="breadcrumb"
16
+ class={className}
17
+ aria-label="breadcrumb"
18
+ {...restProps}
19
+ >
20
+ {@render children?.()}
21
+ </nav>
@@ -0,0 +1,25 @@
1
+ import Root from './breadcrumb.svelte';
2
+ import Ellipsis from './breadcrumb-ellipsis.svelte';
3
+ import Item from './breadcrumb-item.svelte';
4
+ import Separator from './breadcrumb-separator.svelte';
5
+ import Link from './breadcrumb-link.svelte';
6
+ import List from './breadcrumb-list.svelte';
7
+ import Page from './breadcrumb-page.svelte';
8
+
9
+ export {
10
+ Root,
11
+ Ellipsis,
12
+ Item,
13
+ Separator,
14
+ Link,
15
+ List,
16
+ Page,
17
+ //
18
+ Root as Breadcrumb,
19
+ Ellipsis as BreadcrumbEllipsis,
20
+ Item as BreadcrumbItem,
21
+ Separator as BreadcrumbSeparator,
22
+ Link as BreadcrumbLink,
23
+ List as BreadcrumbList,
24
+ Page as BreadcrumbPage,
25
+ };
@@ -0,0 +1,82 @@
1
+ <script lang="ts" module>
2
+ import { cn, type WithElementRef } from '../../../utils.js';
3
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
4
+ import { type VariantProps, tv } from 'tailwind-variants';
5
+
6
+ export const buttonVariants = tv({
7
+ base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
+ variants: {
9
+ variant: {
10
+ default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs',
11
+ destructive:
12
+ 'bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs',
13
+ outline:
14
+ 'bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs',
15
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs',
16
+ ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
17
+ link: 'text-primary underline-offset-4 hover:underline',
18
+ },
19
+ size: {
20
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
21
+ sm: 'h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5',
22
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
23
+ icon: 'size-9',
24
+ 'icon-sm': 'size-8',
25
+ 'icon-lg': 'size-10',
26
+ },
27
+ },
28
+ defaultVariants: {
29
+ variant: 'default',
30
+ size: 'default',
31
+ },
32
+ });
33
+
34
+ export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
35
+ export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
36
+
37
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
38
+ WithElementRef<HTMLAnchorAttributes> & {
39
+ variant?: ButtonVariant;
40
+ size?: ButtonSize;
41
+ };
42
+ </script>
43
+
44
+ <script lang="ts">
45
+ let {
46
+ class: className,
47
+ variant = 'default',
48
+ size = 'default',
49
+ ref = $bindable(null),
50
+ href = undefined,
51
+ type = 'button',
52
+ disabled,
53
+ children,
54
+ ...restProps
55
+ }: ButtonProps = $props();
56
+ </script>
57
+
58
+ {#if href}
59
+ <a
60
+ bind:this={ref}
61
+ data-slot="button"
62
+ class={cn(buttonVariants({ variant, size }), className)}
63
+ href={disabled ? undefined : href}
64
+ aria-disabled={disabled}
65
+ role={disabled ? 'link' : undefined}
66
+ tabindex={disabled ? -1 : undefined}
67
+ {...restProps}
68
+ >
69
+ {@render children?.()}
70
+ </a>
71
+ {:else}
72
+ <button
73
+ bind:this={ref}
74
+ data-slot="button"
75
+ class={cn(buttonVariants({ variant, size }), className)}
76
+ {type}
77
+ {disabled}
78
+ {...restProps}
79
+ >
80
+ {@render children?.()}
81
+ </button>
82
+ {/if}
@@ -0,0 +1,17 @@
1
+ import Root, {
2
+ type ButtonProps,
3
+ type ButtonSize,
4
+ type ButtonVariant,
5
+ buttonVariants,
6
+ } from './button.svelte';
7
+
8
+ export {
9
+ Root,
10
+ type ButtonProps as Props,
11
+ //
12
+ Root as Button,
13
+ buttonVariants,
14
+ type ButtonProps,
15
+ type ButtonSize,
16
+ type ButtonVariant,
17
+ };
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../../../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-action"
16
+ class={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -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
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div bind:this={ref} data-slot="card-content" class={cn('px-6', className)} {...restProps}>
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLParagraphElement>> = $props();
11
+ </script>
12
+
13
+ <p
14
+ bind:this={ref}
15
+ data-slot="card-description"
16
+ class={cn('text-muted-foreground text-sm', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </p>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../../../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-footer"
16
+ class={cn('flex items-center px-6 [.border-t]:pt-6', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../../../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-header"
16
+ class={cn(
17
+ '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
18
+ className,
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-title"
16
+ class={cn('leading-none font-semibold', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card"
16
+ class={cn(
17
+ 'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
18
+ className,
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,25 @@
1
+ import Root from './card.svelte';
2
+ import Content from './card-content.svelte';
3
+ import Description from './card-description.svelte';
4
+ import Footer from './card-footer.svelte';
5
+ import Header from './card-header.svelte';
6
+ import Title from './card-title.svelte';
7
+ import Action from './card-action.svelte';
8
+
9
+ export {
10
+ Root,
11
+ Content,
12
+ Description,
13
+ Footer,
14
+ Header,
15
+ Title,
16
+ Action,
17
+ //
18
+ Root as Card,
19
+ Content as CardContent,
20
+ Description as CardDescription,
21
+ Footer as CardFooter,
22
+ Header as CardHeader,
23
+ Title as CardTitle,
24
+ Action as CardAction,
25
+ };
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.ContentProps = $props();
5
+ </script>
6
+
7
+ <CollapsiblePrimitive.Content bind:ref data-slot="collapsible-content" {...restProps} />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <CollapsiblePrimitive.Trigger bind:ref data-slot="collapsible-trigger" {...restProps} />
@@ -0,0 +1,11 @@
1
+ <script lang="ts">
2
+ import { Collapsible as CollapsiblePrimitive } from 'bits-ui';
3
+
4
+ let {
5
+ ref = $bindable(null),
6
+ open = $bindable(false),
7
+ ...restProps
8
+ }: CollapsiblePrimitive.RootProps = $props();
9
+ </script>
10
+
11
+ <CollapsiblePrimitive.Root bind:ref bind:open data-slot="collapsible" {...restProps} />
@@ -0,0 +1,13 @@
1
+ import Root from './collapsible.svelte';
2
+ import Trigger from './collapsible-trigger.svelte';
3
+ import Content from './collapsible-content.svelte';
4
+
5
+ export {
6
+ Root,
7
+ Content,
8
+ Trigger,
9
+ //
10
+ Root as Collapsible,
11
+ Content as CollapsibleContent,
12
+ Trigger as CollapsibleTrigger,
13
+ };
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: DialogPrimitive.CloseProps = $props();
5
+ </script>
6
+
7
+ <DialogPrimitive.Close bind:ref data-slot="dialog-close" {...restProps} />
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import DialogPortal from './dialog-portal.svelte';
4
+ import XIcon from '@lucide/svelte/icons/x';
5
+ import type { Snippet } from 'svelte';
6
+ import * as Dialog from './index.js';
7
+ import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
8
+ import type { ComponentProps } from 'svelte';
9
+
10
+ let {
11
+ ref = $bindable(null),
12
+ class: className,
13
+ portalProps,
14
+ children,
15
+ showCloseButton = true,
16
+ ...restProps
17
+ }: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
18
+ portalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;
19
+ children: Snippet;
20
+ showCloseButton?: boolean;
21
+ } = $props();
22
+ </script>
23
+
24
+ <DialogPortal {...portalProps}>
25
+ <Dialog.Overlay />
26
+ <DialogPrimitive.Content
27
+ bind:ref
28
+ data-slot="dialog-content"
29
+ class={cn(
30
+ 'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
31
+ className,
32
+ )}
33
+ {...restProps}
34
+ >
35
+ {@render children?.()}
36
+ {#if showCloseButton}
37
+ <DialogPrimitive.Close
38
+ class="ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
39
+ >
40
+ <XIcon />
41
+ <span class="sr-only">Close</span>
42
+ </DialogPrimitive.Close>
43
+ {/if}
44
+ </DialogPrimitive.Content>
45
+ </DialogPortal>
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.DescriptionProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Description
13
+ bind:ref
14
+ data-slot="dialog-description"
15
+ class={cn('text-muted-foreground text-sm', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from '../../../utils.js';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="dialog-footer"
16
+ class={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { cn, type WithElementRef } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="dialog-header"
16
+ class={cn('flex flex-col gap-2 text-center sm:text-start', className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.OverlayProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Overlay
13
+ bind:ref
14
+ data-slot="dialog-overlay"
15
+ class={cn(
16
+ '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/60 backdrop-blur-sm',
17
+ className,
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+
4
+ let { ...restProps }: DialogPrimitive.PortalProps = $props();
5
+ </script>
6
+
7
+ <DialogPrimitive.Portal {...restProps} />
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+ import { cn } from '../../../utils.js';
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: DialogPrimitive.TitleProps = $props();
10
+ </script>
11
+
12
+ <DialogPrimitive.Title
13
+ bind:ref
14
+ data-slot="dialog-title"
15
+ class={cn('text-lg leading-none font-semibold', className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+
4
+ let { ref = $bindable(null), ...restProps }: DialogPrimitive.TriggerProps = $props();
5
+ </script>
6
+
7
+ <DialogPrimitive.Trigger bind:ref data-slot="dialog-trigger" {...restProps} />
@@ -0,0 +1,7 @@
1
+ <script lang="ts">
2
+ import { Dialog as DialogPrimitive } from 'bits-ui';
3
+
4
+ let { open = $bindable(false), ...restProps }: DialogPrimitive.RootProps = $props();
5
+ </script>
6
+
7
+ <DialogPrimitive.Root bind:open {...restProps} />
@@ -0,0 +1,34 @@
1
+ import Root from './dialog.svelte';
2
+ import Portal from './dialog-portal.svelte';
3
+ import Title from './dialog-title.svelte';
4
+ import Footer from './dialog-footer.svelte';
5
+ import Header from './dialog-header.svelte';
6
+ import Overlay from './dialog-overlay.svelte';
7
+ import Content from './dialog-content.svelte';
8
+ import Description from './dialog-description.svelte';
9
+ import Trigger from './dialog-trigger.svelte';
10
+ import Close from './dialog-close.svelte';
11
+
12
+ export {
13
+ Root,
14
+ Title,
15
+ Portal,
16
+ Footer,
17
+ Header,
18
+ Trigger,
19
+ Overlay,
20
+ Content,
21
+ Description,
22
+ Close,
23
+ //
24
+ Root as Dialog,
25
+ Title as DialogTitle,
26
+ Portal as DialogPortal,
27
+ Footer as DialogFooter,
28
+ Header as DialogHeader,
29
+ Trigger as DialogTrigger,
30
+ Overlay as DialogOverlay,
31
+ Content as DialogContent,
32
+ Description as DialogDescription,
33
+ Close as DialogClose,
34
+ };