@human-synthesis/norns-ui 0.0.3 → 0.0.6

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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -225
  3. package/package.json +13 -3
  4. package/src/auto-import.js +81 -19
  5. package/src/components/Accordion.n +39 -0
  6. package/src/components/Audio.n +24 -0
  7. package/src/components/Autocomplete.n +134 -0
  8. package/src/components/Avatar.n +27 -0
  9. package/src/components/AvatarGroup.n +25 -0
  10. package/src/components/Badge.n +20 -0
  11. package/src/components/Banner.n +25 -0
  12. package/src/components/Breadcrumbs.n +22 -0
  13. package/src/components/Btn.n +29 -8
  14. package/src/components/ButtonGroup.n +14 -0
  15. package/src/components/Calendar.n +153 -0
  16. package/src/components/Card.n +34 -0
  17. package/src/components/Carousel.n +66 -0
  18. package/src/components/Chip.n +27 -0
  19. package/src/components/Collapsible.n +29 -0
  20. package/src/components/ColorPicker.n +62 -0
  21. package/src/components/ContextMenu.n +67 -0
  22. package/src/components/CopyButton.n +50 -0
  23. package/src/components/DataTable.n +61 -0
  24. package/src/components/DatePicker.n +56 -0
  25. package/src/components/DateRangePicker.n +47 -0
  26. package/src/components/Dialog.n +35 -22
  27. package/src/components/Dropdown.n +54 -23
  28. package/src/components/GradientText.n +21 -0
  29. package/src/components/Header.n +23 -0
  30. package/src/components/HeroBanner.n +37 -0
  31. package/src/components/HierarchicalMenu.n +38 -0
  32. package/src/components/Icon.n +16 -0
  33. package/src/components/Image.n +31 -0
  34. package/src/components/MegaMenu.n +36 -0
  35. package/src/components/MultiSelect.n +158 -0
  36. package/src/components/NumberInput.n +49 -0
  37. package/src/components/OtpField.n +67 -0
  38. package/src/components/Pagination.n +73 -0
  39. package/src/components/Popover.n +30 -15
  40. package/src/components/Progress.n +26 -0
  41. package/src/components/ProgressCircular.n +52 -0
  42. package/src/components/RippleButton.n +56 -0
  43. package/src/components/ScrollArea.n +20 -0
  44. package/src/components/Separator.n +12 -0
  45. package/src/components/Sheet.n +36 -22
  46. package/src/components/ShinyButton.n +36 -0
  47. package/src/components/Skeleton.n +27 -0
  48. package/src/components/Stepper.n +35 -0
  49. package/src/components/Surface.n +10 -0
  50. package/src/components/Tabs.n +39 -13
  51. package/src/components/TagsInput.n +66 -0
  52. package/src/components/ThemeToggler.n +43 -0
  53. package/src/components/TimePicker.n +153 -0
  54. package/src/components/Timeline.n +27 -0
  55. package/src/components/ToggleButton.n +35 -0
  56. package/src/components/ToggleButtonGroup.n +54 -0
  57. package/src/components/Toolbar.n +15 -0
  58. package/src/components/Tooltip.n +52 -19
  59. package/src/components/Tree.n +57 -0
  60. package/src/components/Uploader.n +88 -0
  61. package/src/components/Video.n +26 -0
  62. package/src/index.js +64 -1
  63. package/src/lib/behaviors/clickOutside.svelte.js +54 -0
  64. package/src/lib/behaviors/escape.svelte.js +36 -0
  65. package/src/lib/behaviors/floating.svelte.js +137 -0
  66. package/src/lib/behaviors/focusTrap.svelte.js +80 -0
  67. package/src/lib/behaviors/index.js +14 -0
  68. package/src/lib/behaviors/portal.svelte.js +32 -0
  69. package/src/lib/behaviors/rovingTabindex.svelte.js +76 -0
  70. package/src/lib/behaviors/scrollLock.svelte.js +56 -0
  71. package/src/motion/AnimatedNumber.n +55 -0
  72. package/src/motion/GradientBackground.n +25 -0
  73. package/src/motion/LiquidButton.n +48 -0
  74. package/src/motion/Reveal.n +37 -0
  75. package/src/motion/Sparkles.n +53 -0
  76. package/src/motion/index.js +18 -0
  77. package/src/styles/atoms.css +1481 -223
  78. package/src/styles/tokens.css +204 -40
  79. package/src/types/Accordion.d.ts +17 -0
  80. package/src/types/AnimatedNumber.d.ts +15 -0
  81. package/src/types/Audio.d.ts +18 -0
  82. package/src/types/Autocomplete.d.ts +17 -0
  83. package/src/types/Avatar.d.ts +14 -0
  84. package/src/types/AvatarGroup.d.ts +15 -0
  85. package/src/types/Badge.d.ts +14 -0
  86. package/src/types/Banner.d.ts +15 -0
  87. package/src/types/Breadcrumbs.d.ts +15 -0
  88. package/src/types/Btn.d.ts +10 -0
  89. package/src/types/ButtonGroup.d.ts +10 -0
  90. package/src/types/Calendar.d.ts +20 -0
  91. package/src/types/Card.d.ts +19 -0
  92. package/src/types/Carousel.d.ts +23 -0
  93. package/src/types/Chip.d.ts +12 -0
  94. package/src/types/Collapsible.d.ts +13 -0
  95. package/src/types/ColorPicker.d.ts +15 -0
  96. package/src/types/ContextMenu.d.ts +24 -0
  97. package/src/types/CopyButton.d.ts +16 -0
  98. package/src/types/DataTable.d.ts +27 -0
  99. package/src/types/DatePicker.d.ts +23 -0
  100. package/src/types/DateRangePicker.d.ts +17 -0
  101. package/src/types/Dialog.d.ts +4 -0
  102. package/src/types/Dropdown.d.ts +2 -1
  103. package/src/types/GradientBackground.d.ts +14 -0
  104. package/src/types/GradientText.d.ts +19 -0
  105. package/src/types/Header.d.ts +12 -0
  106. package/src/types/HeroBanner.d.ts +17 -0
  107. package/src/types/HierarchicalMenu.d.ts +20 -0
  108. package/src/types/Icon.d.ts +21 -0
  109. package/src/types/Image.d.ts +15 -0
  110. package/src/types/LiquidButton.d.ts +15 -0
  111. package/src/types/MegaMenu.d.ts +29 -0
  112. package/src/types/MultiSelect.d.ts +16 -0
  113. package/src/types/NumberInput.d.ts +17 -0
  114. package/src/types/OtpField.d.ts +13 -0
  115. package/src/types/Pagination.d.ts +13 -0
  116. package/src/types/Progress.d.ts +14 -0
  117. package/src/types/ProgressCircular.d.ts +14 -0
  118. package/src/types/Reveal.d.ts +20 -0
  119. package/src/types/RippleButton.d.ts +15 -0
  120. package/src/types/ScrollArea.d.ts +11 -0
  121. package/src/types/Separator.d.ts +9 -0
  122. package/src/types/Sheet.d.ts +3 -0
  123. package/src/types/ShinyButton.d.ts +15 -0
  124. package/src/types/Skeleton.d.ts +13 -0
  125. package/src/types/Sparkles.d.ts +13 -0
  126. package/src/types/Stepper.d.ts +19 -0
  127. package/src/types/Surface.d.ts +10 -0
  128. package/src/types/Tabs.d.ts +2 -0
  129. package/src/types/TagsInput.d.ts +17 -0
  130. package/src/types/ThemeToggler.d.ts +17 -0
  131. package/src/types/TimePicker.d.ts +20 -0
  132. package/src/types/Timeline.d.ts +17 -0
  133. package/src/types/ToggleButton.d.ts +16 -0
  134. package/src/types/ToggleButtonGroup.d.ts +21 -0
  135. package/src/types/Toolbar.d.ts +12 -0
  136. package/src/types/Tooltip.d.ts +3 -0
  137. package/src/types/Tree.d.ts +20 -0
  138. package/src/types/Uploader.d.ts +15 -0
  139. package/src/types/Video.d.ts +20 -0
@@ -1,58 +1,222 @@
1
1
  /*
2
2
  * Norns UI — design tokens.
3
3
  *
4
- * Tailwind v4 `@theme` block. Users override by re-declaring `@theme { ... }`
5
- * after `@import '@human-synthesis/norns-ui/styles'` in their own app.css —
6
- * Tailwind merges layered theme blocks. Same goes for dark mode via the
7
- * `[data-theme="dark"]` selector at the bottom.
4
+ * Tailwind v4 `@theme` block. Two layers:
5
+ *
6
+ * 1. Color *scales* (50–950) for primary + success + warning + danger + info.
7
+ * These generate utilities like `bg-success-500`, `text-danger-700`. Stay
8
+ * identical in light + dark — oklch is perceptually uniform.
9
+ *
10
+ * 2. *Role tokens* (`--color-fg`, `--color-bg`, `--color-border`, …). Atoms
11
+ * reference these so dark-mode swap is a single point of change. The
12
+ * `[data-theme='dark']` block at the bottom remaps every role token from
13
+ * a light-friendly scale step to a dark-friendly one — utilities like
14
+ * `bg-bg`, `text-fg`, `border-border` follow automatically.
15
+ *
16
+ * Typography: `--font-sans` / `--font-mono` set the default `font-sans` /
17
+ * `font-mono` utilities. Heading sizes come from Tailwind's defaults; the
18
+ * `@layer base` block in atoms.css applies them.
8
19
  */
9
20
 
10
21
  @theme {
11
- /* Brand color (violet) keeps Norns's existing violet-500 accent. */
12
- --color-primary-50: oklch(97.7% 0.014 308.299);
13
- --color-primary-100: oklch(94.6% 0.033 307.174);
14
- --color-primary-200: oklch(90.2% 0.063 306.703);
15
- --color-primary-300: oklch(81.1% 0.111 293.571);
16
- --color-primary-400: oklch(70.2% 0.183 293.541);
17
- --color-primary-500: oklch(60.6% 0.25 292.717);
18
- --color-primary-600: oklch(54.1% 0.281 293.009);
19
- --color-primary-700: oklch(49.1% 0.27 292.581);
20
- --color-primary-800: oklch(43.2% 0.232 292.759);
21
- --color-primary-900: oklch(38% 0.189 293.745);
22
- --color-primary-950: oklch(28.3% 0.141 291.089);
23
-
24
- /* Semantic surface colors derived from neutral + primary. Components
25
- * reference `--color-fg`, `--color-muted`, etc. so consumer themes can
26
- * remap surfaces without overriding every utility. */
27
- --color-fg: var(--color-neutral-900);
28
- --color-fg-muted: var(--color-neutral-600);
29
- --color-fg-subtle: var(--color-neutral-400);
22
+ /* === Brand: Primary (violet) === */
23
+ --color-primary-50: oklch(97.7% 0.014 308.3);
24
+ --color-primary-100: oklch(94.6% 0.033 307.2);
25
+ --color-primary-200: oklch(90.2% 0.063 306.7);
26
+ --color-primary-300: oklch(81.1% 0.111 293.6);
27
+ --color-primary-400: oklch(70.2% 0.183 293.5);
28
+ --color-primary-500: oklch(60.6% 0.25 292.7);
29
+ --color-primary-600: oklch(54.1% 0.281 293);
30
+ --color-primary-700: oklch(49.1% 0.27 292.6);
31
+ --color-primary-800: oklch(43.2% 0.232 292.8);
32
+ --color-primary-900: oklch(38% 0.189 293.7);
33
+ --color-primary-950: oklch(28.3% 0.141 291.1);
34
+
35
+ /* === Success (green) === */
36
+ --color-success-50: oklch(98.2% 0.018 155.8);
37
+ --color-success-100: oklch(96.2% 0.044 156.7);
38
+ --color-success-200: oklch(92.5% 0.084 155.9);
39
+ --color-success-300: oklch(87.1% 0.15 154.4);
40
+ --color-success-400: oklch(79.2% 0.209 151.7);
41
+ --color-success-500: oklch(72.3% 0.219 149.6);
42
+ --color-success-600: oklch(62.7% 0.194 149.2);
43
+ --color-success-700: oklch(52.7% 0.155 150.1);
44
+ --color-success-800: oklch(44.8% 0.119 151.3);
45
+ --color-success-900: oklch(39.3% 0.095 152.5);
46
+ --color-success-950: oklch(26.6% 0.065 152.9);
47
+
48
+ /* === Warning (amber) === */
49
+ --color-warning-50: oklch(98.7% 0.022 95.3);
50
+ --color-warning-100: oklch(96.2% 0.06 95.6);
51
+ --color-warning-200: oklch(92.4% 0.12 95.7);
52
+ --color-warning-300: oklch(87.9% 0.169 91.6);
53
+ --color-warning-400: oklch(82.8% 0.189 84.4);
54
+ --color-warning-500: oklch(76.9% 0.188 70.1);
55
+ --color-warning-600: oklch(66.6% 0.179 58.3);
56
+ --color-warning-700: oklch(55.5% 0.163 48.9);
57
+ --color-warning-800: oklch(47.3% 0.137 46.2);
58
+ --color-warning-900: oklch(41.4% 0.112 45.9);
59
+ --color-warning-950: oklch(27.9% 0.077 45.6);
60
+
61
+ /* === Danger (red) === */
62
+ --color-danger-50: oklch(97.1% 0.013 17.4);
63
+ --color-danger-100: oklch(93.6% 0.032 17.7);
64
+ --color-danger-200: oklch(88.5% 0.062 18.3);
65
+ --color-danger-300: oklch(80.8% 0.114 19.6);
66
+ --color-danger-400: oklch(70.4% 0.191 22.2);
67
+ --color-danger-500: oklch(63.7% 0.237 25.3);
68
+ --color-danger-600: oklch(57.7% 0.245 27.3);
69
+ --color-danger-700: oklch(50.5% 0.213 27.5);
70
+ --color-danger-800: oklch(44.4% 0.177 26.9);
71
+ --color-danger-900: oklch(39.6% 0.141 25.7);
72
+ --color-danger-950: oklch(25.8% 0.092 26);
73
+
74
+ /* === Info (sky blue) === */
75
+ --color-info-50: oklch(97.7% 0.013 236.6);
76
+ --color-info-100: oklch(95.1% 0.026 236.8);
77
+ --color-info-200: oklch(90.1% 0.058 230.9);
78
+ --color-info-300: oklch(82.8% 0.111 230.3);
79
+ --color-info-400: oklch(74.6% 0.16 232.7);
80
+ --color-info-500: oklch(68.5% 0.169 237.3);
81
+ --color-info-600: oklch(58.8% 0.158 241.5);
82
+ --color-info-700: oklch(50% 0.134 242.7);
83
+ --color-info-800: oklch(44.3% 0.11 240.8);
84
+ --color-info-900: oklch(39.1% 0.09 240.9);
85
+ --color-info-950: oklch(29.3% 0.066 243.2);
86
+
87
+ /* === Role tokens (light-mode defaults) ===
88
+ * Atoms reference these, never raw scales. Dark mode swaps the right-hand
89
+ * sides at the bottom of this file.
90
+ */
91
+
92
+ /* Foreground (text) */
93
+ --color-fg: oklch(20.4% 0 0); /* neutral-950ish */
94
+ --color-fg-muted: oklch(43.9% 0 0); /* neutral-600 */
95
+ --color-fg-subtle: oklch(56.6% 0 0); /* neutral-500 */
96
+ --color-fg-on-primary: white;
97
+
98
+ /* Background (surfaces) */
30
99
  --color-bg: white;
31
- --color-bg-muted: var(--color-neutral-100);
32
- --color-bg-subtle: var(--color-neutral-50);
33
- --color-border: var(--color-neutral-200);
34
- --color-border-strong: var(--color-neutral-300);
100
+ --color-bg-muted: oklch(96.7% 0 0); /* neutral-100 */
101
+ --color-bg-subtle: oklch(98.5% 0 0); /* neutral-50 */
102
+ --color-bg-elevated: white;
103
+ --color-bg-inverse: oklch(20.4% 0 0); /* used for tooltips, dark surfaces on light */
104
+
105
+ /* Borders */
106
+ --color-border: oklch(92.2% 0 0); /* neutral-200 */
107
+ --color-border-strong: oklch(86.9% 0 0); /* neutral-300 */
108
+
109
+ /* Focus ring — semi-transparent so it composes on any bg */
110
+ --color-ring: var(--color-primary-500);
111
+
112
+ /* Feedback role tokens — referenced by Banner / toast / Field error */
113
+ --color-success-bg: var(--color-success-50);
114
+ --color-success-fg: var(--color-success-900);
115
+ --color-success-border: var(--color-success-200);
116
+ --color-warning-bg: var(--color-warning-50);
117
+ --color-warning-fg: var(--color-warning-900);
118
+ --color-warning-border: var(--color-warning-200);
119
+ --color-danger-bg: var(--color-danger-50);
120
+ --color-danger-fg: var(--color-danger-900);
121
+ --color-danger-border: var(--color-danger-200);
122
+ --color-info-bg: var(--color-info-50);
123
+ --color-info-fg: var(--color-info-900);
124
+ --color-info-border: var(--color-info-200);
35
125
 
36
- /* Component sizing — kept minimal; most sizing is via Tailwind utilities. */
126
+ /* === Typography ===
127
+ * Default sans is Outfit — geometric humanist with a distinct framework feel.
128
+ * Consumers self-host via `import '@fontsource-variable/outfit'` (already a
129
+ * dependency of this package). Falls back to system if the variable file
130
+ * isn't loaded. Override `--font-sans` in your own @theme block to swap.
131
+ */
132
+ --font-sans:
133
+ 'Outfit Variable', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
134
+ 'Helvetica Neue', Arial, sans-serif;
135
+ --font-mono:
136
+ ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono',
137
+ 'Courier New', monospace;
138
+
139
+ /* === Component sizing === */
37
140
  --ui-radius-sm: 0.25rem;
38
- --ui-radius: 0.375rem;
39
- --ui-radius-lg: 0.5rem;
141
+ --ui-radius: 0.5rem;
142
+ --ui-radius-lg: 0.75rem;
40
143
  --ui-radius-full: 9999px;
41
144
 
42
145
  --ui-h-sm: 1.75rem; /* 28px */
43
146
  --ui-h-md: 2.25rem; /* 36px */
44
147
  --ui-h-lg: 2.75rem; /* 44px */
148
+
149
+ /* Square icon-button sizes (close buttons, nav arrows, chevron triggers).
150
+ * Distinct from full button heights above. */
151
+ --ui-icon-btn-sm: 1.5rem; /* 24px */
152
+ --ui-icon-btn-md: 1.75rem; /* 28px */
153
+ --ui-icon-btn-lg: 2.25rem; /* 36px */
154
+
155
+ /* Motion timings — shared so animations feel coordinated. */
156
+ --ui-motion-fast: 150ms;
157
+ --ui-motion-med: 200ms;
158
+ --ui-motion-slow: 300ms;
159
+ --ui-motion-ease: cubic-bezier(0.2, 0, 0, 1);
160
+
161
+ /* Elevation — the only shadow vocabulary in the library.
162
+ * elev-1: subtle (cards, hover-lifts)
163
+ * elev-2: floating menus, popovers, tooltips
164
+ * elev-3: dialogs, sheets
165
+ */
166
+ --ui-elev-1: 0 1px 2px oklch(0% 0 0 / 0.06), 0 1px 3px oklch(0% 0 0 / 0.04);
167
+ --ui-elev-2: 0 4px 12px -2px oklch(0% 0 0 / 0.08), 0 2px 4px -1px oklch(0% 0 0 / 0.04);
168
+ --ui-elev-3: 0 16px 32px -8px oklch(0% 0 0 / 0.18), 0 4px 8px -4px oklch(0% 0 0 / 0.06);
169
+
170
+ /* Single canonical focus indicator. 2px halo on the surface color + 2px
171
+ * ring color outside it, so the ring stays visible on any background. */
172
+ --ui-focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-ring);
45
173
  }
46
174
 
47
- /* Dark theme — user toggles via <html data-theme="dark">. Override surfaces;
48
- * primary scale stays the same (Tailwind primaries already work on dark). */
175
+ /* === Dark theme ===
176
+ * User toggles via <html data-theme="dark">. Only role tokens change; scales
177
+ * are perceptually uniform across both modes. Tuned for WCAG AA contrast at
178
+ * the body-text level.
179
+ */
49
180
  [data-theme='dark'] {
50
- --color-fg: var(--color-neutral-100);
51
- --color-fg-muted: var(--color-neutral-400);
52
- --color-fg-subtle: var(--color-neutral-500);
53
- --color-bg: var(--color-neutral-900);
54
- --color-bg-muted: var(--color-neutral-800);
55
- --color-bg-subtle: var(--color-neutral-850, oklch(25% 0 0));
56
- --color-border: var(--color-neutral-800);
57
- --color-border-strong: var(--color-neutral-700);
181
+ /* Foreground */
182
+ --color-fg: oklch(98.5% 0 0); /* near-white */
183
+ --color-fg-muted: oklch(70.8% 0 0); /* neutral-400 */
184
+ --color-fg-subtle: oklch(56.6% 0 0); /* neutral-500 */
185
+ --color-fg-on-primary: white;
186
+
187
+ /* Background */
188
+ --color-bg: oklch(14.5% 0 0); /* deep neutral, slightly above true black */
189
+ --color-bg-muted: oklch(20.4% 0 0); /* neutral-900ish */
190
+ --color-bg-subtle: oklch(17.5% 0 0); /* between bg and bg-muted */
191
+ --color-bg-elevated: oklch(23.5% 0 0); /* one step up — Cards/Dialogs */
192
+ --color-bg-inverse: oklch(98.5% 0 0);
193
+
194
+ /* Borders */
195
+ --color-border: oklch(27.5% 0 0); /* neutral-800 */
196
+ --color-border-strong: oklch(37.1% 0 0); /* neutral-700 */
197
+
198
+ /* Ring brightens slightly so it stays visible on dark surfaces */
199
+ --color-ring: var(--color-primary-400);
200
+
201
+ /* Dark-mode elevation — true-black shadow on dark bg disappears, so we
202
+ * lean on darker shadow + the existing border to convey depth. */
203
+ --ui-elev-1: 0 1px 2px oklch(0% 0 0 / 0.4);
204
+ --ui-elev-2: 0 4px 12px -2px oklch(0% 0 0 / 0.5), 0 2px 4px -1px oklch(0% 0 0 / 0.3);
205
+ --ui-elev-3: 0 16px 32px -8px oklch(0% 0 0 / 0.6), 0 4px 8px -4px oklch(0% 0 0 / 0.4);
206
+
207
+ --ui-focus-ring: 0 0 0 2px var(--color-bg-elevated), 0 0 0 4px var(--color-ring);
208
+
209
+ /* Feedback — flip to deep tinted bg + light fg */
210
+ --color-success-bg: oklch(28% 0.05 152);
211
+ --color-success-fg: var(--color-success-200);
212
+ --color-success-border: oklch(38% 0.08 151);
213
+ --color-warning-bg: oklch(28% 0.05 65);
214
+ --color-warning-fg: var(--color-warning-200);
215
+ --color-warning-border: oklch(38% 0.08 60);
216
+ --color-danger-bg: oklch(28% 0.07 27);
217
+ --color-danger-fg: var(--color-danger-200);
218
+ --color-danger-border: oklch(38% 0.11 27);
219
+ --color-info-bg: oklch(28% 0.05 240);
220
+ --color-info-fg: var(--color-info-200);
221
+ --color-info-border: oklch(38% 0.08 240);
58
222
  }
@@ -0,0 +1,17 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type AccordionItem = {
4
+ value: string;
5
+ title: string;
6
+ content?: Snippet;
7
+ };
8
+
9
+ export type AccordionProps = {
10
+ items?: AccordionItem[];
11
+ multiple?: boolean;
12
+ value?: string | string[];
13
+ class?: string;
14
+ };
15
+
16
+ declare const Accordion: Component<AccordionProps>;
17
+ export default Accordion;
@@ -0,0 +1,15 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type AnimatedNumberProps = {
4
+ value: number;
5
+ from?: number;
6
+ /** Duration in seconds. */
7
+ duration?: number;
8
+ decimals?: number;
9
+ /** Custom number-to-string formatter. */
10
+ format?: (n: number) => string;
11
+ class?: string;
12
+ };
13
+
14
+ declare const AnimatedNumber: Component<AnimatedNumberProps>;
15
+ export default AnimatedNumber;
@@ -0,0 +1,18 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type AudioSource = { src: string; type?: string };
4
+
5
+ export type AudioProps = {
6
+ src?: string;
7
+ sources?: AudioSource[];
8
+ controls?: boolean;
9
+ autoplay?: boolean;
10
+ loop?: boolean;
11
+ muted?: boolean;
12
+ preload?: 'none' | 'metadata' | 'auto';
13
+ fallback?: string;
14
+ class?: string;
15
+ };
16
+
17
+ declare const Audio: Component<AudioProps>;
18
+ export default Audio;
@@ -0,0 +1,17 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type ComboboxItem = { value: string; label: string };
4
+
5
+ export type AutocompleteProps = {
6
+ items?: ComboboxItem[];
7
+ value?: string;
8
+ open?: boolean;
9
+ placeholder?: string;
10
+ disabled?: boolean;
11
+ name?: string;
12
+ id?: string;
13
+ error?: boolean;
14
+ };
15
+
16
+ declare const Autocomplete: Component<AutocompleteProps>;
17
+ export default Autocomplete;
@@ -0,0 +1,14 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
4
+
5
+ export type AvatarProps = {
6
+ src?: string;
7
+ /** Display name; first + last initial used as fallback when `src` is missing. */
8
+ name?: string;
9
+ size?: AvatarSize;
10
+ class?: string;
11
+ };
12
+
13
+ declare const Avatar: Component<AvatarProps>;
14
+ export default Avatar;
@@ -0,0 +1,15 @@
1
+ import type { Component } from 'svelte';
2
+ import type { AvatarSize } from './Avatar';
3
+
4
+ export type AvatarGroupItem = { src?: string; name?: string };
5
+
6
+ export type AvatarGroupProps = {
7
+ items?: AvatarGroupItem[];
8
+ max?: number;
9
+ size?: AvatarSize;
10
+ label?: string;
11
+ class?: string;
12
+ };
13
+
14
+ declare const AvatarGroup: Component<AvatarGroupProps>;
15
+ export default AvatarGroup;
@@ -0,0 +1,14 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type BadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
4
+ export type BadgeSize = 'sm' | 'md';
5
+
6
+ export type BadgeProps = {
7
+ variant?: BadgeVariant;
8
+ size?: BadgeSize;
9
+ children?: Snippet;
10
+ class?: string;
11
+ };
12
+
13
+ declare const Badge: Component<BadgeProps>;
14
+ export default Badge;
@@ -0,0 +1,15 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type BannerVariant = 'info' | 'success' | 'warning' | 'danger';
4
+
5
+ export type BannerProps = {
6
+ variant?: BannerVariant;
7
+ /** Iconify icon name (e.g. `"lucide:alert-triangle"`). */
8
+ icon?: string;
9
+ actions?: Snippet;
10
+ children?: Snippet;
11
+ class?: string;
12
+ };
13
+
14
+ declare const Banner: Component<BannerProps>;
15
+ export default Banner;
@@ -0,0 +1,15 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type BreadcrumbItem = {
4
+ label: string;
5
+ href?: string;
6
+ };
7
+
8
+ export type BreadcrumbsProps = {
9
+ items?: BreadcrumbItem[];
10
+ separator?: string;
11
+ class?: string;
12
+ };
13
+
14
+ declare const Breadcrumbs: Component<BreadcrumbsProps>;
15
+ export default Breadcrumbs;
@@ -15,6 +15,16 @@ export type BtnProps = Omit<HTMLButtonAttributes, 'class' | 'children'> & {
15
15
  loading?: boolean;
16
16
  disabled?: boolean;
17
17
  type?: 'button' | 'submit' | 'reset';
18
+ /**
19
+ * Convenience: Iconify icon name (e.g. `"lucide:save"`). Renders an
20
+ * `<Icon>` in the leading slot. If you also pass a `leading` snippet,
21
+ * the snippet wins.
22
+ */
23
+ icon?: string;
24
+ /** When set, renders as an `<a>` styled like the button. */
25
+ href?: string;
26
+ target?: string;
27
+ rel?: string;
18
28
  class?: string;
19
29
  children?: Snippet;
20
30
  leading?: Snippet;
@@ -0,0 +1,10 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type ButtonGroupProps = {
4
+ orientation?: 'horizontal' | 'vertical';
5
+ children?: Snippet;
6
+ class?: string;
7
+ };
8
+
9
+ declare const ButtonGroup: Component<ButtonGroupProps>;
10
+ export default ButtonGroup;
@@ -0,0 +1,20 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type CalendarDateRange = { start: string; end: string };
4
+
5
+ export type CalendarProps = {
6
+ /** ISO YYYY-MM-DD. Bindable. */
7
+ value?: string;
8
+ /** Range mode. Bindable. Use instead of `value` when `range` is true. */
9
+ rangeValue?: CalendarDateRange;
10
+ range?: boolean;
11
+ /** ISO YYYY-MM-DD inclusive. */
12
+ min?: string;
13
+ max?: string;
14
+ label?: string;
15
+ onchange?: (next: string | CalendarDateRange) => void;
16
+ class?: string;
17
+ };
18
+
19
+ declare const Calendar: Component<CalendarProps>;
20
+ export default Calendar;
@@ -0,0 +1,19 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type CardProps = {
4
+ /** Wrap body in `.card-body` (default true). Set false for full-bleed content. */
5
+ padded?: boolean;
6
+ /** Apply `.card-interactive` hover/focus treatment. Implicit if `href` is set. */
7
+ interactive?: boolean;
8
+ /** Renders as `<a>` instead of `<div>` when set. */
9
+ href?: string;
10
+ target?: string;
11
+ rel?: string;
12
+ header?: Snippet;
13
+ footer?: Snippet;
14
+ children?: Snippet;
15
+ class?: string;
16
+ };
17
+
18
+ declare const Card: Component<CardProps>;
19
+ export default Card;
@@ -0,0 +1,23 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type CarouselSlide = {
4
+ src?: string;
5
+ alt?: string;
6
+ [key: string]: unknown;
7
+ };
8
+
9
+ export type CarouselProps = {
10
+ slides?: CarouselSlide[];
11
+ index?: number;
12
+ autoplay?: boolean;
13
+ /** Autoplay interval in milliseconds. Default 5000. */
14
+ interval?: number;
15
+ /** Default aspect ratio applied if no explicit `class="aspect-..."` is passed. */
16
+ aspect?: 'video' | 'square' | 'wide' | 'none';
17
+ /** Custom slide renderer; receives `(slide, i)` and runs only for slides without `src`. */
18
+ children?: Snippet<[CarouselSlide, number]>;
19
+ class?: string;
20
+ };
21
+
22
+ declare const Carousel: Component<CarouselProps>;
23
+ export default Carousel;
@@ -0,0 +1,12 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type ChipProps = {
4
+ icon?: string;
5
+ removable?: boolean;
6
+ onremove?: (event: MouseEvent) => void;
7
+ children?: Snippet;
8
+ class?: string;
9
+ };
10
+
11
+ declare const Chip: Component<ChipProps>;
12
+ export default Chip;
@@ -0,0 +1,13 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type CollapsibleProps = {
4
+ open?: boolean;
5
+ title?: string;
6
+ trigger?: Snippet;
7
+ children?: Snippet;
8
+ onopenchange?: (open: boolean) => void;
9
+ class?: string;
10
+ };
11
+
12
+ declare const Collapsible: Component<CollapsibleProps>;
13
+ export default Collapsible;
@@ -0,0 +1,15 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type ColorPickerProps = {
4
+ /** Hex value with leading `#`. Bindable. */
5
+ value?: string;
6
+ disabled?: boolean;
7
+ /** Hide the clipboard-copy button. */
8
+ hideCopy?: boolean;
9
+ name?: string;
10
+ id?: string;
11
+ class?: string;
12
+ };
13
+
14
+ declare const ColorPicker: Component<ColorPickerProps>;
15
+ export default ColorPicker;
@@ -0,0 +1,24 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type ContextMenuItem = {
4
+ label?: string;
5
+ icon?: string;
6
+ separator?: boolean;
7
+ disabled?: boolean;
8
+ onSelect?: () => void;
9
+ /**
10
+ * NOTE: nested submenus are not supported in 0.0.6+ (the property is
11
+ * accepted but children are ignored). Re-introduce when the upstream
12
+ * design needs them.
13
+ */
14
+ children?: ContextMenuItem[];
15
+ };
16
+
17
+ export type ContextMenuProps = {
18
+ items?: ContextMenuItem[];
19
+ trigger?: Snippet;
20
+ triggerClass?: string;
21
+ };
22
+
23
+ declare const ContextMenu: Component<ContextMenuProps>;
24
+ export default ContextMenu;
@@ -0,0 +1,16 @@
1
+ import type { Component, Snippet } from 'svelte';
2
+
3
+ export type CopyButtonProps = {
4
+ value?: string | number;
5
+ variant?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'link';
6
+ size?: 'sm' | 'md' | 'lg';
7
+ icon?: string;
8
+ disabled?: boolean;
9
+ label?: string;
10
+ oncopy?: (value: string | number) => void;
11
+ children?: Snippet;
12
+ class?: string;
13
+ };
14
+
15
+ declare const CopyButton: Component<CopyButtonProps>;
16
+ export default CopyButton;
@@ -0,0 +1,27 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type DataTableColumn = {
4
+ key: string;
5
+ label?: string;
6
+ width?: string;
7
+ class?: string;
8
+ cellClass?: string;
9
+ sortable?: boolean;
10
+ };
11
+
12
+ export type DataTableProps = {
13
+ columns?: DataTableColumn[];
14
+ rows?: Record<string, unknown>[];
15
+ striped?: boolean;
16
+ dense?: boolean;
17
+ stickyHeader?: boolean;
18
+ emptyMessage?: string;
19
+ /** Currently-sorted column key. Bindable. */
20
+ sortKey?: string;
21
+ sortDir?: 'asc' | 'desc';
22
+ onrowclick?: (row: Record<string, unknown>, index: number) => void;
23
+ class?: string;
24
+ };
25
+
26
+ declare const DataTable: Component<DataTableProps>;
27
+ export default DataTable;
@@ -0,0 +1,23 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type DatePickerProps = {
4
+ /** ISO date string (YYYY-MM-DD). Bindable. */
5
+ value?: string;
6
+ /** Whether the popover is open. Bindable. */
7
+ open?: boolean;
8
+ min?: string;
9
+ max?: string;
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ /** Close the popover automatically once a date is picked (default true). */
13
+ closeOnSelect?: boolean;
14
+ /** aria-label override; defaults to "Pick a date". */
15
+ label?: string;
16
+ name?: string;
17
+ id?: string;
18
+ error?: boolean;
19
+ class?: string;
20
+ };
21
+
22
+ declare const DatePicker: Component<DatePickerProps>;
23
+ export default DatePicker;
@@ -0,0 +1,17 @@
1
+ import type { Component } from 'svelte';
2
+
3
+ export type DateRange = { start: string; end: string };
4
+
5
+ export type DateRangePickerProps = {
6
+ value?: DateRange;
7
+ /** Whether the popover is open. Bindable. */
8
+ open?: boolean;
9
+ min?: string;
10
+ max?: string;
11
+ placeholder?: string;
12
+ disabled?: boolean;
13
+ class?: string;
14
+ };
15
+
16
+ declare const DateRangePicker: Component<DateRangePickerProps>;
17
+ export default DateRangePicker;