@sepale/components 0.0.0-stage → 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 (261) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -3
  3. package/dist/components/Accordion.svelte +48 -0
  4. package/dist/components/Accordion.svelte.d.ts +24 -0
  5. package/dist/components/Alert.svelte +107 -0
  6. package/dist/components/Alert.svelte.d.ts +40 -0
  7. package/dist/components/Avatar.svelte +75 -0
  8. package/dist/components/Avatar.svelte.d.ts +37 -0
  9. package/dist/components/Badge.svelte +46 -0
  10. package/dist/components/Badge.svelte.d.ts +22 -0
  11. package/dist/components/Breadcrumbs.svelte +36 -0
  12. package/dist/components/Breadcrumbs.svelte.d.ts +18 -0
  13. package/dist/components/Bubble.svelte +43 -0
  14. package/dist/components/Bubble.svelte.d.ts +23 -0
  15. package/dist/components/Button.svelte +132 -0
  16. package/dist/components/Button.svelte.d.ts +40 -0
  17. package/dist/components/Calendar.svelte +193 -0
  18. package/dist/components/Calendar.svelte.d.ts +60 -0
  19. package/dist/components/Card.svelte +69 -0
  20. package/dist/components/Card.svelte.d.ts +37 -0
  21. package/dist/components/Carousel.svelte +550 -0
  22. package/dist/components/Carousel.svelte.d.ts +124 -0
  23. package/dist/components/Checkbox.svelte +48 -0
  24. package/dist/components/Checkbox.svelte.d.ts +26 -0
  25. package/dist/components/Chip.svelte +60 -0
  26. package/dist/components/Chip.svelte.d.ts +26 -0
  27. package/dist/components/ChipsInput.svelte +158 -0
  28. package/dist/components/ChipsInput.svelte.d.ts +64 -0
  29. package/dist/components/Collapse.svelte +101 -0
  30. package/dist/components/Collapse.svelte.d.ts +46 -0
  31. package/dist/components/ColorPicker.svelte +135 -0
  32. package/dist/components/ColorPicker.svelte.d.ts +44 -0
  33. package/dist/components/Combobox.svelte +496 -0
  34. package/dist/components/Combobox.svelte.d.ts +96 -0
  35. package/dist/components/DataControl.svelte +754 -0
  36. package/dist/components/DataControl.svelte.d.ts +143 -0
  37. package/dist/components/DataHandler.svelte +67 -0
  38. package/dist/components/DataHandler.svelte.d.ts +44 -0
  39. package/dist/components/DatePicker.svelte +185 -0
  40. package/dist/components/DatePicker.svelte.d.ts +56 -0
  41. package/dist/components/Dialog.svelte +194 -0
  42. package/dist/components/Dialog.svelte.d.ts +51 -0
  43. package/dist/components/Divider.svelte +54 -0
  44. package/dist/components/Divider.svelte.d.ts +27 -0
  45. package/dist/components/Dock.svelte +34 -0
  46. package/dist/components/Dock.svelte.d.ts +18 -0
  47. package/dist/components/Drawer.svelte +174 -0
  48. package/dist/components/Drawer.svelte.d.ts +51 -0
  49. package/dist/components/Dropdown.svelte +183 -0
  50. package/dist/components/Dropdown.svelte.d.ts +52 -0
  51. package/dist/components/Editable.svelte +292 -0
  52. package/dist/components/Editable.svelte.d.ts +113 -0
  53. package/dist/components/EmptyState.svelte +64 -0
  54. package/dist/components/EmptyState.svelte.d.ts +29 -0
  55. package/dist/components/Fieldset.svelte +42 -0
  56. package/dist/components/Fieldset.svelte.d.ts +20 -0
  57. package/dist/components/FileDropzone.svelte +154 -0
  58. package/dist/components/FileDropzone.svelte.d.ts +45 -0
  59. package/dist/components/FileExplorer.svelte +643 -0
  60. package/dist/components/FileExplorer.svelte.d.ts +114 -0
  61. package/dist/components/FileInput.svelte +125 -0
  62. package/dist/components/FileInput.svelte.d.ts +51 -0
  63. package/dist/components/FloatingLabel.svelte +38 -0
  64. package/dist/components/FloatingLabel.svelte.d.ts +24 -0
  65. package/dist/components/Footer.svelte +68 -0
  66. package/dist/components/Footer.svelte.d.ts +37 -0
  67. package/dist/components/Grid.svelte +122 -0
  68. package/dist/components/Grid.svelte.d.ts +72 -0
  69. package/dist/components/Hero.svelte +62 -0
  70. package/dist/components/Hero.svelte.d.ts +33 -0
  71. package/dist/components/Input.svelte +184 -0
  72. package/dist/components/Input.svelte.d.ts +65 -0
  73. package/dist/components/Join.svelte +38 -0
  74. package/dist/components/Join.svelte.d.ts +21 -0
  75. package/dist/components/Kanban.svelte +284 -0
  76. package/dist/components/Kanban.svelte.d.ts +93 -0
  77. package/dist/components/Label.svelte +32 -0
  78. package/dist/components/Label.svelte.d.ts +21 -0
  79. package/dist/components/LaptopFrame.svelte +44 -0
  80. package/dist/components/LaptopFrame.svelte.d.ts +21 -0
  81. package/dist/components/List.svelte +95 -0
  82. package/dist/components/List.svelte.d.ts +69 -0
  83. package/dist/components/Loading.svelte +37 -0
  84. package/dist/components/Loading.svelte.d.ts +17 -0
  85. package/dist/components/Menu.svelte +144 -0
  86. package/dist/components/Menu.svelte.d.ts +53 -0
  87. package/dist/components/MobileFrame.svelte +41 -0
  88. package/dist/components/MobileFrame.svelte.d.ts +21 -0
  89. package/dist/components/Navbar.svelte +49 -0
  90. package/dist/components/Navbar.svelte.d.ts +25 -0
  91. package/dist/components/NumberInput.svelte +255 -0
  92. package/dist/components/NumberInput.svelte.d.ts +68 -0
  93. package/dist/components/Pagination.svelte +169 -0
  94. package/dist/components/Pagination.svelte.d.ts +50 -0
  95. package/dist/components/Progress.svelte +65 -0
  96. package/dist/components/Progress.svelte.d.ts +28 -0
  97. package/dist/components/RadialProgress.svelte +48 -0
  98. package/dist/components/RadialProgress.svelte.d.ts +20 -0
  99. package/dist/components/Radio.svelte +50 -0
  100. package/dist/components/Radio.svelte.d.ts +28 -0
  101. package/dist/components/Range.svelte +53 -0
  102. package/dist/components/Range.svelte.d.ts +26 -0
  103. package/dist/components/Rating.svelte +90 -0
  104. package/dist/components/Rating.svelte.d.ts +41 -0
  105. package/dist/components/Select.svelte +338 -0
  106. package/dist/components/Select.svelte.d.ts +74 -0
  107. package/dist/components/Sidebar.svelte +100 -0
  108. package/dist/components/Sidebar.svelte.d.ts +54 -0
  109. package/dist/components/Skeleton.svelte +40 -0
  110. package/dist/components/Skeleton.svelte.d.ts +18 -0
  111. package/dist/components/Stat.svelte +71 -0
  112. package/dist/components/Stat.svelte.d.ts +35 -0
  113. package/dist/components/Stats.svelte +38 -0
  114. package/dist/components/Stats.svelte.d.ts +22 -0
  115. package/dist/components/Steps.svelte +204 -0
  116. package/dist/components/Steps.svelte.d.ts +66 -0
  117. package/dist/components/Subtitle.svelte +44 -0
  118. package/dist/components/Subtitle.svelte.d.ts +26 -0
  119. package/dist/components/Swatch.svelte +61 -0
  120. package/dist/components/Swatch.svelte.d.ts +27 -0
  121. package/dist/components/Switch.svelte +105 -0
  122. package/dist/components/Switch.svelte.d.ts +44 -0
  123. package/dist/components/Table.svelte +243 -0
  124. package/dist/components/Table.svelte.d.ts +121 -0
  125. package/dist/components/Tabs.svelte +142 -0
  126. package/dist/components/Tabs.svelte.d.ts +80 -0
  127. package/dist/components/Text.svelte +43 -0
  128. package/dist/components/Text.svelte.d.ts +25 -0
  129. package/dist/components/Textarea.svelte +76 -0
  130. package/dist/components/Textarea.svelte.d.ts +39 -0
  131. package/dist/components/Title.svelte +46 -0
  132. package/dist/components/Title.svelte.d.ts +29 -0
  133. package/dist/components/Toast.svelte +154 -0
  134. package/dist/components/Toast.svelte.d.ts +49 -0
  135. package/dist/components/Toggle.svelte +48 -0
  136. package/dist/components/Toggle.svelte.d.ts +25 -0
  137. package/dist/components/Tooltip.svelte +70 -0
  138. package/dist/components/Tooltip.svelte.d.ts +34 -0
  139. package/dist/components/WindowFrame.svelte +53 -0
  140. package/dist/components/WindowFrame.svelte.d.ts +24 -0
  141. package/dist/components/accordion-context.d.ts +8 -0
  142. package/dist/components/accordion-context.js +25 -0
  143. package/dist/components/color.d.ts +39 -0
  144. package/dist/components/color.js +92 -0
  145. package/dist/components/data-handler.svelte.d.ts +362 -0
  146. package/dist/components/data-handler.svelte.js +690 -0
  147. package/dist/components/file-icons.d.ts +25 -0
  148. package/dist/components/file-icons.js +46 -0
  149. package/dist/family-types.d.ts +45 -0
  150. package/dist/family-types.js +73 -0
  151. package/dist/generated/classes.d.ts +17 -0
  152. package/dist/generated/classes.js +2511 -0
  153. package/dist/generated/components.d.ts +39 -0
  154. package/dist/generated/components.js +28666 -0
  155. package/dist/generated/registry.d.ts +35 -0
  156. package/dist/generated/registry.js +2658 -0
  157. package/dist/index.d.ts +73 -0
  158. package/dist/index.js +99 -0
  159. package/dist/sepale-types.d.ts +8 -0
  160. package/dist/sepale-types.js +200 -0
  161. package/dist/theme.d.ts +123 -0
  162. package/dist/theme.js +226 -0
  163. package/dist/variants.d.ts +124 -0
  164. package/dist/variants.js +70 -0
  165. package/dist/vendor/air-datepicker/LICENSE.md +21 -0
  166. package/dist/vendor/air-datepicker/README.md +19 -0
  167. package/dist/vendor/air-datepicker/buttonPresets.d.ts +13 -0
  168. package/dist/vendor/air-datepicker/buttonPresets.js +12 -0
  169. package/dist/vendor/air-datepicker/consts.d.ts +18 -0
  170. package/dist/vendor/air-datepicker/consts.js +35 -0
  171. package/dist/vendor/air-datepicker/datepicker.d.ts +289 -0
  172. package/dist/vendor/air-datepicker/datepicker.js +1435 -0
  173. package/dist/vendor/air-datepicker/datepickerBody.d.ts +46 -0
  174. package/dist/vendor/air-datepicker/datepickerBody.js +386 -0
  175. package/dist/vendor/air-datepicker/datepickerButtons.d.ts +25 -0
  176. package/dist/vendor/air-datepicker/datepickerButtons.js +85 -0
  177. package/dist/vendor/air-datepicker/datepickerCell.d.ts +35 -0
  178. package/dist/vendor/air-datepicker/datepickerCell.js +297 -0
  179. package/dist/vendor/air-datepicker/datepickerKeyboard.d.ts +26 -0
  180. package/dist/vendor/air-datepicker/datepickerKeyboard.js +207 -0
  181. package/dist/vendor/air-datepicker/datepickerNav.d.ts +31 -0
  182. package/dist/vendor/air-datepicker/datepickerNav.js +200 -0
  183. package/dist/vendor/air-datepicker/datepickerTime.d.ts +60 -0
  184. package/dist/vendor/air-datepicker/datepickerTime.js +276 -0
  185. package/dist/vendor/air-datepicker/defaults.d.ts +65 -0
  186. package/dist/vendor/air-datepicker/defaults.js +79 -0
  187. package/dist/vendor/air-datepicker/index.d.ts +168 -0
  188. package/dist/vendor/air-datepicker/index.js +3 -0
  189. package/dist/vendor/air-datepicker/locale/ar.d.ts +4 -0
  190. package/dist/vendor/air-datepicker/locale/ar.js +14 -0
  191. package/dist/vendor/air-datepicker/locale/bg.d.ts +4 -0
  192. package/dist/vendor/air-datepicker/locale/bg.js +14 -0
  193. package/dist/vendor/air-datepicker/locale/ca.d.ts +4 -0
  194. package/dist/vendor/air-datepicker/locale/ca.js +14 -0
  195. package/dist/vendor/air-datepicker/locale/cs.d.ts +4 -0
  196. package/dist/vendor/air-datepicker/locale/cs.js +14 -0
  197. package/dist/vendor/air-datepicker/locale/da.d.ts +4 -0
  198. package/dist/vendor/air-datepicker/locale/da.js +14 -0
  199. package/dist/vendor/air-datepicker/locale/de.d.ts +4 -0
  200. package/dist/vendor/air-datepicker/locale/de.js +14 -0
  201. package/dist/vendor/air-datepicker/locale/el.d.ts +4 -0
  202. package/dist/vendor/air-datepicker/locale/el.js +14 -0
  203. package/dist/vendor/air-datepicker/locale/en.d.ts +4 -0
  204. package/dist/vendor/air-datepicker/locale/en.js +14 -0
  205. package/dist/vendor/air-datepicker/locale/es.d.ts +4 -0
  206. package/dist/vendor/air-datepicker/locale/es.js +14 -0
  207. package/dist/vendor/air-datepicker/locale/eu.d.ts +4 -0
  208. package/dist/vendor/air-datepicker/locale/eu.js +14 -0
  209. package/dist/vendor/air-datepicker/locale/fi.d.ts +4 -0
  210. package/dist/vendor/air-datepicker/locale/fi.js +14 -0
  211. package/dist/vendor/air-datepicker/locale/fr.d.ts +4 -0
  212. package/dist/vendor/air-datepicker/locale/fr.js +14 -0
  213. package/dist/vendor/air-datepicker/locale/hr.d.ts +4 -0
  214. package/dist/vendor/air-datepicker/locale/hr.js +14 -0
  215. package/dist/vendor/air-datepicker/locale/hu.d.ts +4 -0
  216. package/dist/vendor/air-datepicker/locale/hu.js +14 -0
  217. package/dist/vendor/air-datepicker/locale/id.d.ts +4 -0
  218. package/dist/vendor/air-datepicker/locale/id.js +14 -0
  219. package/dist/vendor/air-datepicker/locale/it.d.ts +4 -0
  220. package/dist/vendor/air-datepicker/locale/it.js +14 -0
  221. package/dist/vendor/air-datepicker/locale/ja.d.ts +4 -0
  222. package/dist/vendor/air-datepicker/locale/ja.js +14 -0
  223. package/dist/vendor/air-datepicker/locale/ko.d.ts +4 -0
  224. package/dist/vendor/air-datepicker/locale/ko.js +14 -0
  225. package/dist/vendor/air-datepicker/locale/nb.d.ts +4 -0
  226. package/dist/vendor/air-datepicker/locale/nb.js +14 -0
  227. package/dist/vendor/air-datepicker/locale/nl.d.ts +4 -0
  228. package/dist/vendor/air-datepicker/locale/nl.js +14 -0
  229. package/dist/vendor/air-datepicker/locale/pl.d.ts +4 -0
  230. package/dist/vendor/air-datepicker/locale/pl.js +14 -0
  231. package/dist/vendor/air-datepicker/locale/pt-BR.d.ts +4 -0
  232. package/dist/vendor/air-datepicker/locale/pt-BR.js +14 -0
  233. package/dist/vendor/air-datepicker/locale/pt.d.ts +4 -0
  234. package/dist/vendor/air-datepicker/locale/pt.js +14 -0
  235. package/dist/vendor/air-datepicker/locale/ro.d.ts +4 -0
  236. package/dist/vendor/air-datepicker/locale/ro.js +14 -0
  237. package/dist/vendor/air-datepicker/locale/ru.d.ts +4 -0
  238. package/dist/vendor/air-datepicker/locale/ru.js +14 -0
  239. package/dist/vendor/air-datepicker/locale/si.d.ts +4 -0
  240. package/dist/vendor/air-datepicker/locale/si.js +14 -0
  241. package/dist/vendor/air-datepicker/locale/sk.d.ts +4 -0
  242. package/dist/vendor/air-datepicker/locale/sk.js +14 -0
  243. package/dist/vendor/air-datepicker/locale/sl.d.ts +4 -0
  244. package/dist/vendor/air-datepicker/locale/sl.js +14 -0
  245. package/dist/vendor/air-datepicker/locale/sv.d.ts +4 -0
  246. package/dist/vendor/air-datepicker/locale/sv.js +14 -0
  247. package/dist/vendor/air-datepicker/locale/th.d.ts +4 -0
  248. package/dist/vendor/air-datepicker/locale/th.js +14 -0
  249. package/dist/vendor/air-datepicker/locale/tr.d.ts +4 -0
  250. package/dist/vendor/air-datepicker/locale/tr.js +16 -0
  251. package/dist/vendor/air-datepicker/locale/uk.d.ts +4 -0
  252. package/dist/vendor/air-datepicker/locale/uk.js +14 -0
  253. package/dist/vendor/air-datepicker/locale/zh.d.ts +4 -0
  254. package/dist/vendor/air-datepicker/locale/zh.js +14 -0
  255. package/dist/vendor/air-datepicker/typedefs.d.ts +3 -0
  256. package/dist/vendor/air-datepicker/typedefs.js +15 -0
  257. package/dist/vendor/air-datepicker/utils.d.ts +155 -0
  258. package/dist/vendor/air-datepicker/utils.js +395 -0
  259. package/dist/vendor/air-datepicker/withEvents.d.ts +1 -0
  260. package/dist/vendor/air-datepicker/withEvents.js +39 -0
  261. package/package.json +44 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tyren
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,65 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # @sepale/components
2
+
3
+ Sepale's Svelte 5 components, typed by the family stylesheet you import.
4
+
5
+ ```sh
6
+ npm install @sepale/components @sepale/style
7
+ ```
8
+
9
+ ```svelte
10
+ <script>
11
+ import { Button } from '@sepale/components';
12
+ import '@sepale/style/daisy.css'; // explicit, never automatic: and it types the props
13
+ import '@sepale/style/daisy/themes/light.css';
14
+ </script>
15
+
16
+ <Button color="primary">Save</Button>
17
+ ```
18
+
19
+ ## Types that follow the family
20
+
21
+ Each family's stylesheet carries its types: `daisy.css` comes with
22
+ `daisy.css.d.ts`, which registers what daisy draws. Import the stylesheet from
23
+ any file of your project — a layout, typically — and every component's props
24
+ narrow to it, in every file: a variant daisy lacks is a compile error.
25
+
26
+ - **Switching family** is changing that one import; `svelte-check` lists what
27
+ the new family lacks. The runtime never changes.
28
+ - **No family imported**: the props are generic, every variant of every family,
29
+ with no guarantee that one renders.
30
+ - **Several families imported** (scoped by `data-theme`): a prop accepts what
31
+ any of them draws.
32
+ - **Staying portable** across families: register them all — for its types
33
+ only, `import type {} from '@sepale/style/cosmos.css'` — and declare
34
+
35
+ ```ts
36
+ declare global {
37
+ namespace Sepale {
38
+ interface Config { portable: true }
39
+ }
40
+ }
41
+ ```
42
+
43
+ Props then accept only what every registered family draws, so switching
44
+ between them never breaks the build.
45
+
46
+ A family that is not in `@sepale/style` — written by hand or by an assistant,
47
+ loaded into the site's "Create a family" page, kept private — works the same:
48
+ keep its `<family>.css.d.ts` beside its `<family>.css` and import the
49
+ stylesheet. Never write that file by hand; derive it from the stylesheet:
50
+
51
+ ```sh
52
+ npx sepale-types my-family.css # -> my-family.css.d.ts
53
+ npx sepale-types --components src/lib/components my.css # components you changed
54
+ ```
55
+
56
+ The site gives the same file ("Download types" on the "Create a family" page,
57
+ or in a bundle). Regenerate it whenever the stylesheet changes. A family works
58
+ without it: the props are then generic. Under `"moduleResolution": "nodenext"`, TypeScript does not look for a
59
+ loose `.d.ts` beside a stylesheet: register it with
60
+ `/// <reference path="./<family>.css.d.ts" />` in a `.d.ts` of yours. (The
61
+ package's own stylesheets map their types explicitly and need nothing.)
62
+
63
+ The components load no CSS. `@sepale/style` is an optional peer, because the
64
+ stylesheet may come from elsewhere: a family and a `theme.css` downloaded from
65
+ the site's theme generator work the same.
@@ -0,0 +1,48 @@
1
+ <script module lang="ts">
2
+ /** What .accordion is made of, classified. The props follow the
3
+ families the project registers (variants.ts, ADR 0015). */
4
+ export const PREFIX = 'accordion';
5
+
6
+ export const AXES = {} as const;
7
+
8
+ export const FLAGS = {
9
+ separate: 'Keep the collapses apart instead of joining their edges.'
10
+ } as const;
11
+ export const PARTS = [] as const;
12
+ </script>
13
+
14
+ <script lang="ts">
15
+ /**
16
+ * A stack of Collapses. Put them in as children; with `exclusive`, opening
17
+ * one closes the others.
18
+ */
19
+ import type { Snippet } from 'svelte';
20
+ import type { HTMLAttributes } from 'svelte/elements';
21
+ import { setAccordion } from './accordion-context.js';
22
+ import { applyAxes, cx, type AxisProps } from '../variants.js';
23
+
24
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, HTMLAttributes<HTMLDivElement> {
25
+ /** At most one collapse open at a time. */
26
+ exclusive?: boolean;
27
+ class?: string;
28
+ children?: Snippet;
29
+ }
30
+
31
+ // The axes are deliberately NOT destructured: they travel in `axes` and are
32
+ // resolved by name, so an axis a family drops changes nothing down here.
33
+ let {
34
+ exclusive = false,
35
+ class: klass = '',
36
+ children,
37
+ ...axes
38
+ }: Props = $props();
39
+
40
+ let applied = $derived(applyAxes(PREFIX, AXES, FLAGS, axes));
41
+ let classes = $derived(cx(PREFIX, applied.classes, klass));
42
+
43
+ setAccordion(() => exclusive);
44
+ </script>
45
+
46
+ <div {...applied.rest} class={classes}>
47
+ {@render children?.()}
48
+ </div>
@@ -0,0 +1,24 @@
1
+ /** What .accordion is made of, classified. The props follow the
2
+ families the project registers (variants.ts, ADR 0015). */
3
+ export declare const PREFIX = "accordion";
4
+ export declare const AXES: {};
5
+ export declare const FLAGS: {
6
+ readonly separate: "Keep the collapses apart instead of joining their edges.";
7
+ };
8
+ export declare const PARTS: readonly [];
9
+ /**
10
+ * A stack of Collapses. Put them in as children; with `exclusive`, opening
11
+ * one closes the others.
12
+ */
13
+ import type { Snippet } from 'svelte';
14
+ import type { HTMLAttributes } from 'svelte/elements';
15
+ import { type AxisProps } from '../variants.js';
16
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, HTMLAttributes<HTMLDivElement> {
17
+ /** At most one collapse open at a time. */
18
+ exclusive?: boolean;
19
+ class?: string;
20
+ children?: Snippet;
21
+ }
22
+ declare const Accordion: import("svelte").Component<Props, {}, "">;
23
+ type Accordion = ReturnType<typeof Accordion>;
24
+ export default Accordion;
@@ -0,0 +1,107 @@
1
+ <script module lang="ts">
2
+ /** What .alert is made of, classified. The props follow the
3
+ families the project registers (variants.ts, ADR 0015). */
4
+ export const PREFIX = 'alert';
5
+
6
+ export const AXES = {
7
+ color: ['primary', 'secondary', 'accent', 'neutral', 'info', 'success', 'warning', 'error'],
8
+ size: ['xs', 'sm', 'md', 'lg', 'xl'],
9
+ /* Default is a soft tint; these two are the alternatives. */
10
+ variant: ['outline', 'solid']
11
+ } as const;
12
+
13
+ export const FLAGS = {} as const;
14
+ export const PARTS = ['icon', 'body', 'title', 'actions', 'close'] as const;
15
+ </script>
16
+
17
+ <script lang="ts">
18
+ /**
19
+ * An inline message: something the user should know, in place.
20
+ *
21
+ * `info`, `success`, `warning` and `error` come with an icon of their own;
22
+ * the `icon` snippet replaces it. A dismissible alert hides itself when its
23
+ * close button is pressed, then calls `onDismiss` — the parent need not
24
+ * track it.
25
+ */
26
+ import type { Snippet } from 'svelte';
27
+ import type { HTMLAttributes } from 'svelte/elements';
28
+ import { slide } from 'svelte/transition';
29
+ import { applyAxes, cx, type AxisProps } from '../variants.js';
30
+
31
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'title'> {
32
+ /** A bold first line. */
33
+ title?: string;
34
+ /** Replaces the colour's own icon. */
35
+ icon?: Snippet;
36
+ /** Buttons or links on the trailing side. */
37
+ actions?: Snippet;
38
+ /** Draw a close button that hides the alert. */
39
+ dismissible?: boolean;
40
+ /** After the alert hid itself. */
41
+ onDismiss?: () => void;
42
+ /** The close button's accessible name. */
43
+ dismissLabel?: string;
44
+ class?: string;
45
+ children?: Snippet;
46
+ }
47
+
48
+ // The axes are deliberately NOT destructured: they travel in `axes` and are
49
+ // resolved by name, so an axis a family drops changes nothing down here.
50
+ let {
51
+ title,
52
+ icon,
53
+ actions,
54
+ dismissible = false,
55
+ onDismiss,
56
+ dismissLabel = 'Dismiss',
57
+ class: klass = '',
58
+ children,
59
+ ...axes
60
+ }: Props = $props();
61
+
62
+ let applied = $derived(applyAxes(PREFIX, AXES, FLAGS, axes));
63
+ let classes = $derived(cx(PREFIX, applied.classes, klass));
64
+
65
+ /* Read back from the classes, the one place the axes are resolved. */
66
+ let kind = $derived((['info', 'success', 'warning', 'error'] as const).find((k) => classes.includes(`${PREFIX}-${k}`)));
67
+ let urgent = $derived(kind === 'error' || kind === 'warning');
68
+
69
+ let gone = $state(false);
70
+
71
+ function dismiss() {
72
+ gone = true;
73
+ onDismiss?.();
74
+ }
75
+ </script>
76
+
77
+ {#if !gone}
78
+ <div {...applied.rest} class={classes} role={urgent ? 'alert' : 'status'} out:slide={{ duration: 160 }}>
79
+ {#if icon}
80
+ <span class="alert-icon">{@render icon()}</span>
81
+ {:else if kind}
82
+ <span class="alert-icon" aria-hidden="true">
83
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
84
+ {#if kind === 'success'}
85
+ <path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0" /><path d="m8 12 3 3 5-6" />
86
+ {:else if kind === 'warning'}
87
+ <path d="M12 3 2 20h20L12 3Z" /><path d="M12 10v4M12 17h.01" />
88
+ {:else if kind === 'error'}
89
+ <path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0" /><path d="m9 9 6 6M15 9l-6 6" />
90
+ {:else}
91
+ <path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0" /><path d="M12 11v5M12 8h.01" />
92
+ {/if}
93
+ </svg>
94
+ </span>
95
+ {/if}
96
+ <div class="alert-body">
97
+ {#if title}<p class="alert-title">{title}</p>{/if}
98
+ {@render children?.()}
99
+ </div>
100
+ {#if actions}<div class="alert-actions">{@render actions()}</div>{/if}
101
+ {#if dismissible}
102
+ <button type="button" class="alert-close" aria-label={dismissLabel} onclick={dismiss}>
103
+ <svg viewBox="0 0 24 24" width="1em" height="1em" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="m6 6 12 12M18 6 6 18" /></svg>
104
+ </button>
105
+ {/if}
106
+ </div>
107
+ {/if}
@@ -0,0 +1,40 @@
1
+ /** What .alert is made of, classified. The props follow the
2
+ families the project registers (variants.ts, ADR 0015). */
3
+ export declare const PREFIX = "alert";
4
+ export declare const AXES: {
5
+ readonly color: readonly ["primary", "secondary", "accent", "neutral", "info", "success", "warning", "error"];
6
+ readonly size: readonly ["xs", "sm", "md", "lg", "xl"];
7
+ readonly variant: readonly ["outline", "solid"];
8
+ };
9
+ export declare const FLAGS: {};
10
+ export declare const PARTS: readonly ["icon", "body", "title", "actions", "close"];
11
+ /**
12
+ * An inline message: something the user should know, in place.
13
+ *
14
+ * `info`, `success`, `warning` and `error` come with an icon of their own;
15
+ * the `icon` snippet replaces it. A dismissible alert hides itself when its
16
+ * close button is pressed, then calls `onDismiss` — the parent need not
17
+ * track it.
18
+ */
19
+ import type { Snippet } from 'svelte';
20
+ import type { HTMLAttributes } from 'svelte/elements';
21
+ import { type AxisProps } from '../variants.js';
22
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'title'> {
23
+ /** A bold first line. */
24
+ title?: string;
25
+ /** Replaces the colour's own icon. */
26
+ icon?: Snippet;
27
+ /** Buttons or links on the trailing side. */
28
+ actions?: Snippet;
29
+ /** Draw a close button that hides the alert. */
30
+ dismissible?: boolean;
31
+ /** After the alert hid itself. */
32
+ onDismiss?: () => void;
33
+ /** The close button's accessible name. */
34
+ dismissLabel?: string;
35
+ class?: string;
36
+ children?: Snippet;
37
+ }
38
+ declare const Alert: import("svelte").Component<Props, {}, "">;
39
+ type Alert = ReturnType<typeof Alert>;
40
+ export default Alert;
@@ -0,0 +1,75 @@
1
+ <script module lang="ts">
2
+ /** What .avatar is made of, classified. The props follow the
3
+ families the project registers (variants.ts, ADR 0015). */
4
+ export const PREFIX = 'avatar';
5
+
6
+ export const AXES = {
7
+ /* The contour: a ring in that colour. No colour, no ring. */
8
+ color: ['primary', 'secondary', 'accent', 'neutral', 'info', 'success', 'warning', 'error'],
9
+ size: ['xs', 'sm', 'md', 'lg', 'xl'],
10
+ /* Round by default everywhere; which other shapes exist is the
11
+ family's call — daisy has daisyUI's masks, the others a box. */
12
+ shape: ['square', 'squircle', 'hexagon']
13
+ } as const;
14
+
15
+ export const FLAGS = {} as const;
16
+ export const PARTS = [] as const;
17
+ </script>
18
+
19
+ <script lang="ts">
20
+ /**
21
+ * A picture, or a few letters, standing for someone.
22
+ *
23
+ * `src` draws a picture; without it the children are the initials. A
24
+ * `badge` wraps the avatar in a `.badge` and pins a `.chip` to its edge —
25
+ * the badge component's own markup, written here so the copy a family
26
+ * ships imports nothing.
27
+ */
28
+ import type { Snippet } from 'svelte';
29
+ import type { HTMLAttributes } from 'svelte/elements';
30
+ import { applyAxes, cx, type AxisProps } from '../variants.js';
31
+
32
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
33
+ /** The picture. Without it, the children are drawn instead. */
34
+ src?: string;
35
+ /** The picture's alternative text. */
36
+ alt?: string;
37
+ /** A count or a status, pinned to the avatar's edge as a .chip. */
38
+ badge?: Snippet;
39
+ /** Which edge the badge sits on, at the end side. */
40
+ badgeSide?: 'top' | 'bottom';
41
+ class?: string;
42
+ /** The initials, when there is no picture. */
43
+ children?: Snippet;
44
+ }
45
+
46
+ // The axes are deliberately NOT destructured: they travel in `axes` and are
47
+ // resolved by name, so an axis a family drops changes nothing down here.
48
+ let {
49
+ src,
50
+ alt = '',
51
+ badge,
52
+ badgeSide = 'top',
53
+ class: klass = '',
54
+ children,
55
+ ...axes
56
+ }: Props = $props();
57
+
58
+ let applied = $derived(applyAxes(PREFIX, AXES, FLAGS, axes));
59
+ let classes = $derived(cx(PREFIX, applied.classes, klass));
60
+ </script>
61
+
62
+ {#snippet frame()}
63
+ <div {...applied.rest} class={classes}>
64
+ {#if src}<img {src} {alt} />{:else}<span>{@render children?.()}</span>{/if}
65
+ </div>
66
+ {/snippet}
67
+
68
+ {#if badge}
69
+ <div class={['badge', badgeSide === 'bottom' ? 'badge-bottom' : 'badge-top', 'badge-end']}>
70
+ {@render frame()}
71
+ <span class="chip">{@render badge()}</span>
72
+ </div>
73
+ {:else}
74
+ {@render frame()}
75
+ {/if}
@@ -0,0 +1,37 @@
1
+ /** What .avatar is made of, classified. The props follow the
2
+ families the project registers (variants.ts, ADR 0015). */
3
+ export declare const PREFIX = "avatar";
4
+ export declare const AXES: {
5
+ readonly color: readonly ["primary", "secondary", "accent", "neutral", "info", "success", "warning", "error"];
6
+ readonly size: readonly ["xs", "sm", "md", "lg", "xl"];
7
+ readonly shape: readonly ["square", "squircle", "hexagon"];
8
+ };
9
+ export declare const FLAGS: {};
10
+ export declare const PARTS: readonly [];
11
+ /**
12
+ * A picture, or a few letters, standing for someone.
13
+ *
14
+ * `src` draws a picture; without it the children are the initials. A
15
+ * `badge` wraps the avatar in a `.badge` and pins a `.chip` to its edge —
16
+ * the badge component's own markup, written here so the copy a family
17
+ * ships imports nothing.
18
+ */
19
+ import type { Snippet } from 'svelte';
20
+ import type { HTMLAttributes } from 'svelte/elements';
21
+ import { type AxisProps } from '../variants.js';
22
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
23
+ /** The picture. Without it, the children are drawn instead. */
24
+ src?: string;
25
+ /** The picture's alternative text. */
26
+ alt?: string;
27
+ /** A count or a status, pinned to the avatar's edge as a .chip. */
28
+ badge?: Snippet;
29
+ /** Which edge the badge sits on, at the end side. */
30
+ badgeSide?: 'top' | 'bottom';
31
+ class?: string;
32
+ /** The initials, when there is no picture. */
33
+ children?: Snippet;
34
+ }
35
+ declare const Avatar: import("svelte").Component<Props, {}, "">;
36
+ type Avatar = ReturnType<typeof Avatar>;
37
+ export default Avatar;
@@ -0,0 +1,46 @@
1
+ <script module lang="ts">
2
+ /** What .badge is made of, classified. The props follow the
3
+ families the project registers (variants.ts, ADR 0015). */
4
+ export const PREFIX = 'badge';
5
+
6
+ export const AXES = {
7
+ /* Where the floating chip sits. Two axes, because a corner is two
8
+ independent choices — nothing else about a badge is styled. */
9
+ align: ['start', 'center', 'end'],
10
+ side: ['top', 'middle', 'bottom']
11
+ } as const;
12
+
13
+ export const FLAGS = {} as const;
14
+ export const PARTS = [] as const;
15
+ </script>
16
+
17
+ <script lang="ts">
18
+ import type { Snippet } from 'svelte';
19
+ import type { HTMLAttributes } from 'svelte/elements';
20
+ import { applyAxes, cx, type AxisProps } from '../variants.js';
21
+
22
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, HTMLAttributes<HTMLDivElement> {
23
+ /** What the badge floats over. */
24
+ children?: Snippet;
25
+ /** The badge itself; rendered as a .chip pinned to the chosen corner. */
26
+ badge?: Snippet;
27
+ class?: string;
28
+ }
29
+
30
+ // The axes are deliberately NOT destructured: they travel in `axes` and are
31
+ // resolved by name, so an axis a family drops changes nothing down here.
32
+ let {
33
+ class: klass = '',
34
+ children,
35
+ badge,
36
+ ...axes
37
+ }: Props = $props();
38
+
39
+ let applied = $derived(applyAxes(PREFIX, AXES, FLAGS, axes));
40
+ let classes = $derived(cx(PREFIX, applied.classes, klass));
41
+ </script>
42
+
43
+ <div {...applied.rest} class={classes}>
44
+ {@render children?.()}
45
+ {#if badge}<span class="chip">{@render badge()}</span>{/if}
46
+ </div>
@@ -0,0 +1,22 @@
1
+ /** What .badge is made of, classified. The props follow the
2
+ families the project registers (variants.ts, ADR 0015). */
3
+ export declare const PREFIX = "badge";
4
+ export declare const AXES: {
5
+ readonly align: readonly ["start", "center", "end"];
6
+ readonly side: readonly ["top", "middle", "bottom"];
7
+ };
8
+ export declare const FLAGS: {};
9
+ export declare const PARTS: readonly [];
10
+ import type { Snippet } from 'svelte';
11
+ import type { HTMLAttributes } from 'svelte/elements';
12
+ import { type AxisProps } from '../variants.js';
13
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, HTMLAttributes<HTMLDivElement> {
14
+ /** What the badge floats over. */
15
+ children?: Snippet;
16
+ /** The badge itself; rendered as a .chip pinned to the chosen corner. */
17
+ badge?: Snippet;
18
+ class?: string;
19
+ }
20
+ declare const Badge: import("svelte").Component<Props, {}, "">;
21
+ type Badge = ReturnType<typeof Badge>;
22
+ export default Badge;
@@ -0,0 +1,36 @@
1
+ <script module lang="ts">
2
+ /** What .breadcrumbs is made of, classified. The props follow the
3
+ families the project registers (variants.ts, ADR 0015). */
4
+ export const PREFIX = 'breadcrumbs';
5
+
6
+ export const AXES = {
7
+ size: ['xs', 'sm', 'md', 'lg', 'xl']
8
+ } as const;
9
+
10
+ export const FLAGS = {} as const;
11
+ export const PARTS = [] as const;
12
+ </script>
13
+
14
+ <script lang="ts">
15
+ import type { Snippet } from 'svelte';
16
+ import type { HTMLAttributes } from 'svelte/elements';
17
+ import { applyAxes, cx, type AxisProps } from '../variants.js';
18
+
19
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, HTMLAttributes<HTMLElement> {
20
+ class?: string;
21
+ children?: Snippet;
22
+ }
23
+
24
+ let {
25
+ class: klass = '',
26
+ children,
27
+ ...axes
28
+ }: Props = $props();
29
+
30
+ let applied = $derived(applyAxes(PREFIX, AXES, FLAGS, axes));
31
+ let classes = $derived(cx(PREFIX, applied.classes, klass));
32
+ </script>
33
+
34
+ <nav {...applied.rest} class={classes}>
35
+ <ul>{@render children?.()}</ul>
36
+ </nav>
@@ -0,0 +1,18 @@
1
+ /** What .breadcrumbs is made of, classified. The props follow the
2
+ families the project registers (variants.ts, ADR 0015). */
3
+ export declare const PREFIX = "breadcrumbs";
4
+ export declare const AXES: {
5
+ readonly size: readonly ["xs", "sm", "md", "lg", "xl"];
6
+ };
7
+ export declare const FLAGS: {};
8
+ export declare const PARTS: readonly [];
9
+ import type { Snippet } from 'svelte';
10
+ import type { HTMLAttributes } from 'svelte/elements';
11
+ import { type AxisProps } from '../variants.js';
12
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, HTMLAttributes<HTMLElement> {
13
+ class?: string;
14
+ children?: Snippet;
15
+ }
16
+ declare const Breadcrumbs: import("svelte").Component<Props, {}, "">;
17
+ type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
18
+ export default Breadcrumbs;
@@ -0,0 +1,43 @@
1
+ <script module lang="ts">
2
+ /** What .bubble is made of, classified. The props follow the
3
+ families the project registers (variants.ts, ADR 0015). */
4
+ export const PREFIX = 'bubble';
5
+
6
+ export const AXES = {
7
+ color: ['primary', 'secondary', 'accent', 'neutral', 'info', 'success', 'warning', 'error'],
8
+ size: ['xs', 'sm', 'md', 'lg', 'xl']
9
+ } as const;
10
+
11
+ /* `end` is a flag, not a side axis: the start side is simply the bubble
12
+ with no class, and `no-tail` combines with either. */
13
+ export const FLAGS = {
14
+ end: 'Put the tail on the end side, and the bubble at the end of the line.',
15
+ 'no-tail': 'Drop the tail but keep its room: a follow-up message.'
16
+ } as const;
17
+ export const PARTS = [] as const;
18
+ </script>
19
+
20
+ <script lang="ts">
21
+ /** A chat message: a fill, an ink, and a tail on one side. */
22
+ import type { Snippet } from 'svelte';
23
+ import type { HTMLAttributes } from 'svelte/elements';
24
+ import { applyAxes, cx, type AxisProps } from '../variants.js';
25
+
26
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
27
+ class?: string;
28
+ children?: Snippet;
29
+ }
30
+
31
+ // The axes are deliberately NOT destructured: they travel in `axes` and are
32
+ // resolved by name, so an axis a family drops changes nothing down here.
33
+ let {
34
+ class: klass = '',
35
+ children,
36
+ ...axes
37
+ }: Props = $props();
38
+
39
+ let applied = $derived(applyAxes(PREFIX, AXES, FLAGS, axes));
40
+ let classes = $derived(cx(PREFIX, applied.classes, klass));
41
+ </script>
42
+
43
+ <div {...applied.rest} class={classes}>{@render children?.()}</div>
@@ -0,0 +1,23 @@
1
+ /** What .bubble is made of, classified. The props follow the
2
+ families the project registers (variants.ts, ADR 0015). */
3
+ export declare const PREFIX = "bubble";
4
+ export declare const AXES: {
5
+ readonly color: readonly ["primary", "secondary", "accent", "neutral", "info", "success", "warning", "error"];
6
+ readonly size: readonly ["xs", "sm", "md", "lg", "xl"];
7
+ };
8
+ export declare const FLAGS: {
9
+ readonly end: "Put the tail on the end side, and the bubble at the end of the line.";
10
+ readonly 'no-tail': "Drop the tail but keep its room: a follow-up message.";
11
+ };
12
+ export declare const PARTS: readonly [];
13
+ /** A chat message: a fill, an ink, and a tail on one side. */
14
+ import type { Snippet } from 'svelte';
15
+ import type { HTMLAttributes } from 'svelte/elements';
16
+ import { type AxisProps } from '../variants.js';
17
+ interface Props extends AxisProps<typeof AXES, typeof FLAGS, typeof PREFIX>, Omit<HTMLAttributes<HTMLDivElement>, 'color'> {
18
+ class?: string;
19
+ children?: Snippet;
20
+ }
21
+ declare const Bubble: import("svelte").Component<Props, {}, "">;
22
+ type Bubble = ReturnType<typeof Bubble>;
23
+ export default Bubble;