@thomasfosterau/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 (340) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +817 -2
  3. package/dist/canvas/VectorCanvas.svelte +239 -0
  4. package/dist/canvas/VectorCanvas.svelte.d.ts +87 -0
  5. package/dist/canvas/history.d.ts +105 -0
  6. package/dist/canvas/history.js +147 -0
  7. package/dist/canvas/index.d.ts +15 -0
  8. package/dist/canvas/index.js +14 -0
  9. package/dist/canvas/types.d.ts +91 -0
  10. package/dist/canvas/types.js +13 -0
  11. package/dist/canvas/utils.d.ts +66 -0
  12. package/dist/canvas/utils.js +114 -0
  13. package/dist/charts/Chart.svelte +300 -0
  14. package/dist/charts/Chart.svelte.d.ts +50 -0
  15. package/dist/charts/index.d.ts +11 -0
  16. package/dist/charts/index.js +10 -0
  17. package/dist/charts/types.d.ts +28 -0
  18. package/dist/charts/types.js +6 -0
  19. package/dist/citations/BookCitation.svelte +53 -0
  20. package/dist/citations/BookCitation.svelte.d.ts +41 -0
  21. package/dist/citations/ChapterCitation.svelte +38 -0
  22. package/dist/citations/ChapterCitation.svelte.d.ts +50 -0
  23. package/dist/citations/Citation.svelte +47 -0
  24. package/dist/citations/Citation.svelte.d.ts +24 -0
  25. package/dist/citations/CreditList.svelte +69 -0
  26. package/dist/citations/CreditList.svelte.d.ts +47 -0
  27. package/dist/citations/DOILink.svelte +28 -0
  28. package/dist/citations/DOILink.svelte.d.ts +19 -0
  29. package/dist/citations/Footnote.svelte +39 -0
  30. package/dist/citations/Footnote.svelte.d.ts +17 -0
  31. package/dist/citations/FootnoteList.svelte +36 -0
  32. package/dist/citations/FootnoteList.svelte.d.ts +21 -0
  33. package/dist/citations/ISBNLink.svelte +29 -0
  34. package/dist/citations/ISBNLink.svelte.d.ts +19 -0
  35. package/dist/citations/ISSNLink.svelte +29 -0
  36. package/dist/citations/ISSNLink.svelte.d.ts +19 -0
  37. package/dist/citations/Publisher.svelte +34 -0
  38. package/dist/citations/Publisher.svelte.d.ts +14 -0
  39. package/dist/citations/ReferenceList.svelte +53 -0
  40. package/dist/citations/ReferenceList.svelte.d.ts +21 -0
  41. package/dist/citations/ReportCitation.svelte +41 -0
  42. package/dist/citations/ReportCitation.svelte.d.ts +36 -0
  43. package/dist/citations/ScholarlyArticleCitation.svelte +64 -0
  44. package/dist/citations/ScholarlyArticleCitation.svelte.d.ts +41 -0
  45. package/dist/citations/ThesisCitation.svelte +35 -0
  46. package/dist/citations/ThesisCitation.svelte.d.ts +29 -0
  47. package/dist/citations/bibliography.svelte.d.ts +55 -0
  48. package/dist/citations/bibliography.svelte.js +78 -0
  49. package/dist/citations/citation.d.ts +71 -0
  50. package/dist/citations/citation.js +121 -0
  51. package/dist/citations/csl.d.ts +102 -0
  52. package/dist/citations/csl.js +20 -0
  53. package/dist/citations/index.d.ts +31 -0
  54. package/dist/citations/index.js +36 -0
  55. package/dist/citations/list-format.d.ts +34 -0
  56. package/dist/citations/list-format.js +38 -0
  57. package/dist/context.svelte.d.ts +46 -0
  58. package/dist/context.svelte.js +51 -0
  59. package/dist/data/DataGrid.svelte +150 -0
  60. package/dist/data/DataGrid.svelte.d.ts +118 -0
  61. package/dist/data/DescriptionList.svelte +47 -0
  62. package/dist/data/DescriptionList.svelte.d.ts +26 -0
  63. package/dist/data/DescriptionRow.svelte +55 -0
  64. package/dist/data/DescriptionRow.svelte.d.ts +21 -0
  65. package/dist/data/DiffText.svelte +29 -0
  66. package/dist/data/DiffText.svelte.d.ts +19 -0
  67. package/dist/data/ItemList.svelte +80 -0
  68. package/dist/data/ItemList.svelte.d.ts +52 -0
  69. package/dist/data/LinkListItem.svelte +46 -0
  70. package/dist/data/LinkListItem.svelte.d.ts +21 -0
  71. package/dist/data/Pagination.svelte +136 -0
  72. package/dist/data/Pagination.svelte.d.ts +71 -0
  73. package/dist/data/PaginationFooter.svelte +41 -0
  74. package/dist/data/PaginationFooter.svelte.d.ts +59 -0
  75. package/dist/data/ResultCount.svelte +27 -0
  76. package/dist/data/ResultCount.svelte.d.ts +18 -0
  77. package/dist/data/Table.svelte +145 -0
  78. package/dist/data/Table.svelte.d.ts +75 -0
  79. package/dist/data/TreeList.svelte +41 -0
  80. package/dist/data/TreeList.svelte.d.ts +17 -0
  81. package/dist/data/TreeListItem.svelte +29 -0
  82. package/dist/data/TreeListItem.svelte.d.ts +10 -0
  83. package/dist/data/description-context.d.ts +33 -0
  84. package/dist/data/description-context.js +35 -0
  85. package/dist/data/diff.d.ts +14 -0
  86. package/dist/data/diff.js +10 -0
  87. package/dist/data/index.d.ts +35 -0
  88. package/dist/data/index.js +35 -0
  89. package/dist/data/list-item.d.ts +30 -0
  90. package/dist/data/list-item.js +19 -0
  91. package/dist/data/pagination.d.ts +81 -0
  92. package/dist/data/pagination.js +79 -0
  93. package/dist/data/table-types.d.ts +64 -0
  94. package/dist/data/table-types.js +35 -0
  95. package/dist/feedback/ConfirmDialog.svelte +79 -0
  96. package/dist/feedback/ConfirmDialog.svelte.d.ts +82 -0
  97. package/dist/feedback/Dialog.svelte +77 -0
  98. package/dist/feedback/Dialog.svelte.d.ts +37 -0
  99. package/dist/feedback/LoadingBoundary.svelte +61 -0
  100. package/dist/feedback/LoadingBoundary.svelte.d.ts +34 -0
  101. package/dist/feedback/ProgressBar.svelte +46 -0
  102. package/dist/feedback/ProgressBar.svelte.d.ts +28 -0
  103. package/dist/feedback/SegmentBar.svelte +83 -0
  104. package/dist/feedback/SegmentBar.svelte.d.ts +36 -0
  105. package/dist/feedback/StatTile.svelte +77 -0
  106. package/dist/feedback/StatTile.svelte.d.ts +49 -0
  107. package/dist/feedback/Stats.svelte +18 -0
  108. package/dist/feedback/Stats.svelte.d.ts +16 -0
  109. package/dist/feedback/Timeline.svelte +86 -0
  110. package/dist/feedback/Timeline.svelte.d.ts +52 -0
  111. package/dist/feedback/Toaster.svelte +78 -0
  112. package/dist/feedback/Toaster.svelte.d.ts +32 -0
  113. package/dist/feedback/index.d.ts +31 -0
  114. package/dist/feedback/index.js +27 -0
  115. package/dist/feedback/sizes.d.ts +27 -0
  116. package/dist/feedback/sizes.js +41 -0
  117. package/dist/feedback/toaster.d.ts +48 -0
  118. package/dist/feedback/toaster.js +29 -0
  119. package/dist/fields/Checkbox.svelte +33 -0
  120. package/dist/fields/Checkbox.svelte.d.ts +24 -0
  121. package/dist/fields/CheckboxGroup.svelte +41 -0
  122. package/dist/fields/CheckboxGroup.svelte.d.ts +40 -0
  123. package/dist/fields/Combobox.svelte +222 -0
  124. package/dist/fields/Combobox.svelte.d.ts +98 -0
  125. package/dist/fields/DateInput.svelte +31 -0
  126. package/dist/fields/DateInput.svelte.d.ts +29 -0
  127. package/dist/fields/FieldErrors.svelte +30 -0
  128. package/dist/fields/FieldErrors.svelte.d.ts +11 -0
  129. package/dist/fields/Fieldset.svelte +48 -0
  130. package/dist/fields/Fieldset.svelte.d.ts +26 -0
  131. package/dist/fields/FileInput.svelte +67 -0
  132. package/dist/fields/FileInput.svelte.d.ts +33 -0
  133. package/dist/fields/FormField.svelte +54 -0
  134. package/dist/fields/FormField.svelte.d.ts +29 -0
  135. package/dist/fields/ImageInput.svelte +87 -0
  136. package/dist/fields/ImageInput.svelte.d.ts +39 -0
  137. package/dist/fields/PushToggle.svelte +93 -0
  138. package/dist/fields/PushToggle.svelte.d.ts +55 -0
  139. package/dist/fields/RadioGroup.svelte +85 -0
  140. package/dist/fields/RadioGroup.svelte.d.ts +41 -0
  141. package/dist/fields/SearchInput.svelte +57 -0
  142. package/dist/fields/SearchInput.svelte.d.ts +33 -0
  143. package/dist/fields/Select.svelte +36 -0
  144. package/dist/fields/Select.svelte.d.ts +29 -0
  145. package/dist/fields/TextInput.svelte +26 -0
  146. package/dist/fields/TextInput.svelte.d.ts +30 -0
  147. package/dist/fields/Textarea.svelte +22 -0
  148. package/dist/fields/Textarea.svelte.d.ts +25 -0
  149. package/dist/fields/Toggle.svelte +72 -0
  150. package/dist/fields/Toggle.svelte.d.ts +32 -0
  151. package/dist/fields/VideoInput.svelte +35 -0
  152. package/dist/fields/VideoInput.svelte.d.ts +40 -0
  153. package/dist/fields/field-types.d.ts +51 -0
  154. package/dist/fields/field-types.js +60 -0
  155. package/dist/fields/index.d.ts +34 -0
  156. package/dist/fields/index.js +34 -0
  157. package/dist/formatting/DateTime.svelte +35 -0
  158. package/dist/formatting/DateTime.svelte.d.ts +26 -0
  159. package/dist/formatting/FormatList.svelte +31 -0
  160. package/dist/formatting/FormatList.svelte.d.ts +46 -0
  161. package/dist/formatting/Highlight.svelte +47 -0
  162. package/dist/formatting/Highlight.svelte.d.ts +15 -0
  163. package/dist/formatting/Number.svelte +35 -0
  164. package/dist/formatting/Number.svelte.d.ts +43 -0
  165. package/dist/formatting/RelativeTime.svelte +69 -0
  166. package/dist/formatting/RelativeTime.svelte.d.ts +26 -0
  167. package/dist/formatting/Year.svelte +39 -0
  168. package/dist/formatting/Year.svelte.d.ts +21 -0
  169. package/dist/formatting/index.d.ts +12 -0
  170. package/dist/formatting/index.js +14 -0
  171. package/dist/forms/EntityForm.svelte +177 -0
  172. package/dist/forms/EntityForm.svelte.d.ts +57 -0
  173. package/dist/forms/FormActions.svelte +29 -0
  174. package/dist/forms/FormActions.svelte.d.ts +37 -0
  175. package/dist/forms/FormErrors.svelte +21 -0
  176. package/dist/forms/FormErrors.svelte.d.ts +16 -0
  177. package/dist/forms/HiddenField.svelte +22 -0
  178. package/dist/forms/HiddenField.svelte.d.ts +11 -0
  179. package/dist/forms/SearchForm.svelte +43 -0
  180. package/dist/forms/SearchForm.svelte.d.ts +36 -0
  181. package/dist/forms/entity-form.d.ts +12 -0
  182. package/dist/forms/entity-form.js +12 -0
  183. package/dist/forms/index.d.ts +14 -0
  184. package/dist/forms/index.js +14 -0
  185. package/dist/hotkeys/HotkeyBadge.svelte +39 -0
  186. package/dist/hotkeys/HotkeyBadge.svelte.d.ts +25 -0
  187. package/dist/hotkeys/HotkeyHelpDialog.svelte +68 -0
  188. package/dist/hotkeys/HotkeyHelpDialog.svelte.d.ts +35 -0
  189. package/dist/hotkeys/HotkeyProvider.svelte +92 -0
  190. package/dist/hotkeys/HotkeyProvider.svelte.d.ts +4 -0
  191. package/dist/hotkeys/context.svelte.d.ts +47 -0
  192. package/dist/hotkeys/context.svelte.js +72 -0
  193. package/dist/hotkeys/index.d.ts +23 -0
  194. package/dist/hotkeys/index.js +22 -0
  195. package/dist/hotkeys/match.d.ts +65 -0
  196. package/dist/hotkeys/match.js +133 -0
  197. package/dist/hotkeys/registry.svelte.d.ts +55 -0
  198. package/dist/hotkeys/registry.svelte.js +110 -0
  199. package/dist/hotkeys/types.d.ts +72 -0
  200. package/dist/hotkeys/types.js +18 -0
  201. package/dist/index.d.ts +36 -0
  202. package/dist/index.js +36 -0
  203. package/dist/infobox/Infobox.svelte +79 -0
  204. package/dist/infobox/Infobox.svelte.d.ts +26 -0
  205. package/dist/infobox/InfoboxHeader.svelte +27 -0
  206. package/dist/infobox/InfoboxHeader.svelte.d.ts +11 -0
  207. package/dist/infobox/InfoboxImage.svelte +38 -0
  208. package/dist/infobox/InfoboxImage.svelte.d.ts +21 -0
  209. package/dist/infobox/InfoboxRow.svelte +50 -0
  210. package/dist/infobox/InfoboxRow.svelte.d.ts +25 -0
  211. package/dist/infobox/InfoboxSection.svelte +24 -0
  212. package/dist/infobox/InfoboxSection.svelte.d.ts +12 -0
  213. package/dist/infobox/index.d.ts +21 -0
  214. package/dist/infobox/index.js +20 -0
  215. package/dist/infobox/types.d.ts +86 -0
  216. package/dist/infobox/types.js +27 -0
  217. package/dist/layout/Breadcrumbs.svelte +52 -0
  218. package/dist/layout/Breadcrumbs.svelte.d.ts +18 -0
  219. package/dist/layout/DetailLayout.svelte +50 -0
  220. package/dist/layout/DetailLayout.svelte.d.ts +19 -0
  221. package/dist/layout/FilterBar.svelte +40 -0
  222. package/dist/layout/FilterBar.svelte.d.ts +12 -0
  223. package/dist/layout/Footer.svelte +32 -0
  224. package/dist/layout/Footer.svelte.d.ts +12 -0
  225. package/dist/layout/Main.svelte +30 -0
  226. package/dist/layout/Main.svelte.d.ts +15 -0
  227. package/dist/layout/Navbar.svelte +68 -0
  228. package/dist/layout/Navbar.svelte.d.ts +31 -0
  229. package/dist/layout/PageHeader.svelte +77 -0
  230. package/dist/layout/PageHeader.svelte.d.ts +33 -0
  231. package/dist/layout/Section.svelte +72 -0
  232. package/dist/layout/Section.svelte.d.ts +40 -0
  233. package/dist/layout/Sidebar.svelte +54 -0
  234. package/dist/layout/Sidebar.svelte.d.ts +27 -0
  235. package/dist/layout/Tabs.svelte +85 -0
  236. package/dist/layout/Tabs.svelte.d.ts +42 -0
  237. package/dist/layout/index.d.ts +29 -0
  238. package/dist/layout/index.js +29 -0
  239. package/dist/layout/types.d.ts +52 -0
  240. package/dist/layout/types.js +27 -0
  241. package/dist/links/ContextLinks.svelte +28 -0
  242. package/dist/links/ContextLinks.svelte.d.ts +20 -0
  243. package/dist/links/EmailLink.svelte +26 -0
  244. package/dist/links/EmailLink.svelte.d.ts +20 -0
  245. package/dist/links/index.d.ts +7 -0
  246. package/dist/links/index.js +7 -0
  247. package/dist/media/Figure.svelte +26 -0
  248. package/dist/media/Figure.svelte.d.ts +12 -0
  249. package/dist/media/Image.svelte +76 -0
  250. package/dist/media/Image.svelte.d.ts +41 -0
  251. package/dist/media/Video.svelte +65 -0
  252. package/dist/media/Video.svelte.d.ts +29 -0
  253. package/dist/media/image-dimensions.d.ts +28 -0
  254. package/dist/media/image-dimensions.js +34 -0
  255. package/dist/media/index.d.ts +10 -0
  256. package/dist/media/index.js +10 -0
  257. package/dist/search/CommandPalette.svelte +257 -0
  258. package/dist/search/CommandPalette.svelte.d.ts +59 -0
  259. package/dist/search/index.d.ts +13 -0
  260. package/dist/search/index.js +13 -0
  261. package/dist/search/types.d.ts +37 -0
  262. package/dist/search/types.js +20 -0
  263. package/dist/seo/Head.svelte +190 -0
  264. package/dist/seo/Head.svelte.d.ts +86 -0
  265. package/dist/seo/JsonLd.svelte +30 -0
  266. package/dist/seo/JsonLd.svelte.d.ts +20 -0
  267. package/dist/seo/index.d.ts +18 -0
  268. package/dist/seo/index.js +17 -0
  269. package/dist/seo/json-ld.d.ts +33 -0
  270. package/dist/seo/json-ld.js +29 -0
  271. package/dist/seo/og-image.d.ts +71 -0
  272. package/dist/seo/og-image.js +81 -0
  273. package/dist/seo/types.d.ts +43 -0
  274. package/dist/seo/types.js +6 -0
  275. package/dist/theme.css +161 -0
  276. package/dist/tips/PopoverTip.svelte +80 -0
  277. package/dist/tips/PopoverTip.svelte.d.ts +33 -0
  278. package/dist/tips/Tip.svelte +91 -0
  279. package/dist/tips/Tip.svelte.d.ts +25 -0
  280. package/dist/tips/index.d.ts +15 -0
  281. package/dist/tips/index.js +14 -0
  282. package/dist/tips/tip-stack.d.ts +25 -0
  283. package/dist/tips/tip-stack.js +37 -0
  284. package/dist/tips/tip-store.svelte.d.ts +74 -0
  285. package/dist/tips/tip-store.svelte.js +158 -0
  286. package/dist/tips/types.d.ts +46 -0
  287. package/dist/tips/types.js +6 -0
  288. package/dist/ui/Alert.svelte +61 -0
  289. package/dist/ui/Alert.svelte.d.ts +37 -0
  290. package/dist/ui/Badge.svelte +39 -0
  291. package/dist/ui/Badge.svelte.d.ts +32 -0
  292. package/dist/ui/Button.svelte +43 -0
  293. package/dist/ui/Button.svelte.d.ts +29 -0
  294. package/dist/ui/Card.svelte +49 -0
  295. package/dist/ui/Card.svelte.d.ts +44 -0
  296. package/dist/ui/Chip.svelte +58 -0
  297. package/dist/ui/Chip.svelte.d.ts +21 -0
  298. package/dist/ui/ConfirmButton.svelte +75 -0
  299. package/dist/ui/ConfirmButton.svelte.d.ts +48 -0
  300. package/dist/ui/Disclosure.svelte +39 -0
  301. package/dist/ui/Disclosure.svelte.d.ts +22 -0
  302. package/dist/ui/EmptyState.svelte +37 -0
  303. package/dist/ui/EmptyState.svelte.d.ts +22 -0
  304. package/dist/ui/ExternalLink.svelte +38 -0
  305. package/dist/ui/ExternalLink.svelte.d.ts +34 -0
  306. package/dist/ui/Heading.svelte +58 -0
  307. package/dist/ui/Heading.svelte.d.ts +22 -0
  308. package/dist/ui/Link.svelte +34 -0
  309. package/dist/ui/Link.svelte.d.ts +20 -0
  310. package/dist/ui/LinkButton.svelte +51 -0
  311. package/dist/ui/LinkButton.svelte.d.ts +33 -0
  312. package/dist/ui/Menu.svelte +54 -0
  313. package/dist/ui/Menu.svelte.d.ts +34 -0
  314. package/dist/ui/MenuItem.svelte +75 -0
  315. package/dist/ui/MenuItem.svelte.d.ts +21 -0
  316. package/dist/ui/MenuSeparator.svelte +26 -0
  317. package/dist/ui/MenuSeparator.svelte.d.ts +8 -0
  318. package/dist/ui/Popover.svelte +63 -0
  319. package/dist/ui/Popover.svelte.d.ts +40 -0
  320. package/dist/ui/ShareButton.svelte +64 -0
  321. package/dist/ui/ShareButton.svelte.d.ts +39 -0
  322. package/dist/ui/Skeleton.svelte +43 -0
  323. package/dist/ui/Skeleton.svelte.d.ts +22 -0
  324. package/dist/ui/ThemeToggle.svelte +65 -0
  325. package/dist/ui/ThemeToggle.svelte.d.ts +24 -0
  326. package/dist/ui/Tooltip.svelte +54 -0
  327. package/dist/ui/Tooltip.svelte.d.ts +35 -0
  328. package/dist/ui/VisuallyHidden.svelte +23 -0
  329. package/dist/ui/VisuallyHidden.svelte.d.ts +10 -0
  330. package/dist/ui/colour-token.d.ts +41 -0
  331. package/dist/ui/colour-token.js +49 -0
  332. package/dist/ui/index.d.ts +44 -0
  333. package/dist/ui/index.js +44 -0
  334. package/dist/ui/menu-context.d.ts +22 -0
  335. package/dist/ui/menu-context.js +26 -0
  336. package/dist/ui/slug.d.ts +19 -0
  337. package/dist/ui/slug.js +25 -0
  338. package/dist/ui/tones.d.ts +68 -0
  339. package/dist/ui/tones.js +150 -0
  340. package/package.json +101 -3
@@ -0,0 +1,35 @@
1
+ import { Tooltip } from 'bits-ui';
2
+ import type { Snippet } from 'svelte';
3
+ interface Props {
4
+ /** The tooltip's text. Ignored when `content` is given. */
5
+ text?: string | undefined;
6
+ /** Richer tooltip content, in place of `text`. */
7
+ content?: Snippet<[]> | undefined;
8
+ /**
9
+ * Preferred side of the trigger; flipped on collision.
10
+ * @defaultValue `'top'`
11
+ */
12
+ side?: 'top' | 'right' | 'bottom' | 'left' | undefined;
13
+ /**
14
+ * Distance in pixels from the trigger.
15
+ * @defaultValue `6`
16
+ */
17
+ sideOffset?: number | undefined;
18
+ /**
19
+ * Milliseconds of hover before it opens.
20
+ * @defaultValue `400`
21
+ */
22
+ openDelay?: number | undefined;
23
+ /** Whether the tooltip is open. Bindable. */
24
+ open?: boolean | undefined;
25
+ /** Extra classes on the content bubble. */
26
+ class?: string | undefined;
27
+ /** The trigger — the caller's own element, spreading `props` onto it. */
28
+ children: Snippet<[{
29
+ props: Record<string, unknown>;
30
+ }]>;
31
+ }
32
+ /** Supplementary text on hover and on keyboard focus, on bits-ui’s `Tooltip`. */
33
+ declare const Tooltip: import("svelte").Component<Props, {}, "open">;
34
+ type Tooltip = ReturnType<typeof Tooltip>;
35
+ export default Tooltip;
@@ -0,0 +1,23 @@
1
+ <!-- @component
2
+ Content for assistive technology only: in the DOM and the accessibility tree, clipped out of the visual rendering.
3
+ -->
4
+ <!--
5
+ VisuallyHidden — content for assistive technology only: present in the
6
+ accessibility tree and in the DOM, clipped out of the visual rendering.
7
+
8
+ The canonical use is a name for something conveyed graphically — an icon-only
9
+ button, a star rating, a status dot — so that what a screen reader announces
10
+ matches what a sighted reader sees, rather than `aria-label` guessing at it.
11
+ Use it for content that must be READ. Content that must merely be reachable
12
+ (a skip link) wants `sr-only focus:not-sr-only` instead, which this component
13
+ supports because the caller's `class` is merged last by Svelte's class array.
14
+
15
+ The clipping itself is Tailwind's `sr-only` utility, which this package does
16
+ NOT ship — it comes from the consumer's Tailwind build, the same as every
17
+ other class here. See the README's `@source` note.
18
+ -->
19
+ <script lang="ts">let { children, class: className, ...rest } = $props();
20
+ export {};
21
+ </script>
22
+
23
+ <span {...rest} class={['sr-only', className]}>{@render children()}</span>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ interface Props extends HTMLAttributes<HTMLSpanElement> {
4
+ /** What assistive technology reads; any inline markup. */
5
+ children: Snippet<[]>;
6
+ }
7
+ /** Content for assistive technology only: in the DOM and the accessibility tree, clipped out of the visual rendering. */
8
+ declare const VisuallyHidden: import("svelte").Component<Props, {}, "">;
9
+ type VisuallyHidden = ReturnType<typeof VisuallyHidden>;
10
+ export default VisuallyHidden;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The colour-token indirection: how a component takes a colour it does not
3
+ * own.
4
+ *
5
+ * Some things are coloured by their subject rather than by a semantic tone —
6
+ * a political party, a taxon rank, a project label. The colour belongs to the
7
+ * consuming application, not to this library, and it is never an inline hex
8
+ * here: the app's theme declares one custom property per subject
9
+ * (`--party-alp`, `--rank-genus`, …) in **both** its light and dark themes,
10
+ * and hands a component the property's NAME.
11
+ *
12
+ * The helpers below turn that name into the single custom property the
13
+ * component's Tailwind classes read (`bg-(--badge-colour)`,
14
+ * `border-(--chip-colour)`), with the theme's `neutral` colour as the
15
+ * fallback for a token the theme has no entry for. The only inline style
16
+ * any component in this package emits is that one variable indirection —
17
+ * the colour value itself stays in the stylesheet.
18
+ *
19
+ * @module
20
+ */
21
+ /** The custom property {@link Badge} binds a `colourToken` to. */
22
+ export declare const BADGE_COLOUR_PROPERTY = "--badge-colour";
23
+ /** The custom property {@link Chip} binds a `colourToken` to. */
24
+ export declare const CHIP_COLOUR_PROPERTY = "--chip-colour";
25
+ /**
26
+ * The inline `style` binding `property` to the theme token `token`, falling
27
+ * back to `--color-neutral` when the theme declares no such token.
28
+ *
29
+ * `token` is validated rather than trusted: a value that is not a custom
30
+ * property name is dropped entirely, so nothing a caller passes can break out
31
+ * of the `var()` it is interpolated into and inject further declarations.
32
+ *
33
+ * Returns `undefined` when there is no token, so a component can hand the
34
+ * result straight to `style` and emit no attribute at all.
35
+ *
36
+ * ```svelte
37
+ * <span style={colourTokenStyle(BADGE_COLOUR_PROPERTY, '--party-alp')}
38
+ * class="bg-(--badge-colour)/15 border-(--badge-colour)">…</span>
39
+ * ```
40
+ */
41
+ export declare function colourTokenStyle(property: string, token: string | undefined): string | undefined;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The colour-token indirection: how a component takes a colour it does not
3
+ * own.
4
+ *
5
+ * Some things are coloured by their subject rather than by a semantic tone —
6
+ * a political party, a taxon rank, a project label. The colour belongs to the
7
+ * consuming application, not to this library, and it is never an inline hex
8
+ * here: the app's theme declares one custom property per subject
9
+ * (`--party-alp`, `--rank-genus`, …) in **both** its light and dark themes,
10
+ * and hands a component the property's NAME.
11
+ *
12
+ * The helpers below turn that name into the single custom property the
13
+ * component's Tailwind classes read (`bg-(--badge-colour)`,
14
+ * `border-(--chip-colour)`), with the theme's `neutral` colour as the
15
+ * fallback for a token the theme has no entry for. The only inline style
16
+ * any component in this package emits is that one variable indirection —
17
+ * the colour value itself stays in the stylesheet.
18
+ *
19
+ * @module
20
+ */
21
+ /** The custom property {@link Badge} binds a `colourToken` to. */
22
+ export const BADGE_COLOUR_PROPERTY = '--badge-colour';
23
+ /** The custom property {@link Chip} binds a `colourToken` to. */
24
+ export const CHIP_COLOUR_PROPERTY = '--chip-colour';
25
+ /** A valid CSS custom-property name: `--` then idents, and nothing else. */
26
+ const CUSTOM_PROPERTY = /^--[a-z0-9_-]+$/i;
27
+ /**
28
+ * The inline `style` binding `property` to the theme token `token`, falling
29
+ * back to `--color-neutral` when the theme declares no such token.
30
+ *
31
+ * `token` is validated rather than trusted: a value that is not a custom
32
+ * property name is dropped entirely, so nothing a caller passes can break out
33
+ * of the `var()` it is interpolated into and inject further declarations.
34
+ *
35
+ * Returns `undefined` when there is no token, so a component can hand the
36
+ * result straight to `style` and emit no attribute at all.
37
+ *
38
+ * ```svelte
39
+ * <span style={colourTokenStyle(BADGE_COLOUR_PROPERTY, '--party-alp')}
40
+ * class="bg-(--badge-colour)/15 border-(--badge-colour)">…</span>
41
+ * ```
42
+ */
43
+ export function colourTokenStyle(property, token) {
44
+ if (token === undefined)
45
+ return undefined;
46
+ const name = token.trim();
47
+ const safe = CUSTOM_PROPERTY.test(name) ? name : '--color-neutral';
48
+ return `${property}: var(${safe}, var(--color-neutral))`;
49
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * ui — buttons, badges, surfaces and small interactive affordances.
3
+ *
4
+ * The family every other family builds on: `Alert` is what a form's errors
5
+ * surface in, `Card` is the surface a section is drawn on, `Button` is what
6
+ * a dialog's actions are. Import from the package barrel rather than from
7
+ * here — this file is the family's own index, and the public surface is
8
+ * `src/lib/index.ts`.
9
+ *
10
+ * One convention worth stating once: every optional prop in this family is
11
+ * declared `T | undefined`, not bare `T`. The workspace compiles with
12
+ * `exactOptionalPropertyTypes`, under which `prop?: T` rejects an explicitly
13
+ * passed `undefined` — so a caller forwarding its own optional prop
14
+ * (`<Button {tone}>` where `tone?: Tone`) would not compile. Widening the
15
+ * declaration is what makes these primitives composable by the other
16
+ * families.
17
+ *
18
+ * @module
19
+ */
20
+ export { default as Alert } from './Alert.svelte';
21
+ export { default as Badge } from './Badge.svelte';
22
+ export { default as Button } from './Button.svelte';
23
+ export { default as Card } from './Card.svelte';
24
+ export { default as Chip } from './Chip.svelte';
25
+ export { default as ConfirmButton } from './ConfirmButton.svelte';
26
+ export { default as Disclosure } from './Disclosure.svelte';
27
+ export { default as EmptyState } from './EmptyState.svelte';
28
+ export { default as ExternalLink } from './ExternalLink.svelte';
29
+ export { default as Heading } from './Heading.svelte';
30
+ export { default as Link } from './Link.svelte';
31
+ export { default as LinkButton } from './LinkButton.svelte';
32
+ export { default as Menu } from './Menu.svelte';
33
+ export { default as MenuItem } from './MenuItem.svelte';
34
+ export { default as MenuSeparator } from './MenuSeparator.svelte';
35
+ export { default as Popover } from './Popover.svelte';
36
+ export { default as ShareButton } from './ShareButton.svelte';
37
+ export { default as Skeleton } from './Skeleton.svelte';
38
+ export { default as ThemeToggle } from './ThemeToggle.svelte';
39
+ export { default as Tooltip } from './Tooltip.svelte';
40
+ export { default as VisuallyHidden } from './VisuallyHidden.svelte';
41
+ export * from './colour-token.ts';
42
+ export * from './menu-context.ts';
43
+ export * from './slug.ts';
44
+ export * from './tones.ts';
@@ -0,0 +1,44 @@
1
+ /**
2
+ * ui — buttons, badges, surfaces and small interactive affordances.
3
+ *
4
+ * The family every other family builds on: `Alert` is what a form's errors
5
+ * surface in, `Card` is the surface a section is drawn on, `Button` is what
6
+ * a dialog's actions are. Import from the package barrel rather than from
7
+ * here — this file is the family's own index, and the public surface is
8
+ * `src/lib/index.ts`.
9
+ *
10
+ * One convention worth stating once: every optional prop in this family is
11
+ * declared `T | undefined`, not bare `T`. The workspace compiles with
12
+ * `exactOptionalPropertyTypes`, under which `prop?: T` rejects an explicitly
13
+ * passed `undefined` — so a caller forwarding its own optional prop
14
+ * (`<Button {tone}>` where `tone?: Tone`) would not compile. Widening the
15
+ * declaration is what makes these primitives composable by the other
16
+ * families.
17
+ *
18
+ * @module
19
+ */
20
+ export { default as Alert } from './Alert.svelte';
21
+ export { default as Badge } from './Badge.svelte';
22
+ export { default as Button } from './Button.svelte';
23
+ export { default as Card } from './Card.svelte';
24
+ export { default as Chip } from './Chip.svelte';
25
+ export { default as ConfirmButton } from './ConfirmButton.svelte';
26
+ export { default as Disclosure } from './Disclosure.svelte';
27
+ export { default as EmptyState } from './EmptyState.svelte';
28
+ export { default as ExternalLink } from './ExternalLink.svelte';
29
+ export { default as Heading } from './Heading.svelte';
30
+ export { default as Link } from './Link.svelte';
31
+ export { default as LinkButton } from './LinkButton.svelte';
32
+ export { default as Menu } from './Menu.svelte';
33
+ export { default as MenuItem } from './MenuItem.svelte';
34
+ export { default as MenuSeparator } from './MenuSeparator.svelte';
35
+ export { default as Popover } from './Popover.svelte';
36
+ export { default as ShareButton } from './ShareButton.svelte';
37
+ export { default as Skeleton } from './Skeleton.svelte';
38
+ export { default as ThemeToggle } from './ThemeToggle.svelte';
39
+ export { default as Tooltip } from './Tooltip.svelte';
40
+ export { default as VisuallyHidden } from './VisuallyHidden.svelte';
41
+ export * from "./colour-token.js";
42
+ export * from "./menu-context.js";
43
+ export * from "./slug.js";
44
+ export * from "./tones.js";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * How a {@link MenuItem} learns which {@link Menu} it is inside.
3
+ *
4
+ * The two menu modes render entirely different markup — a bits-ui
5
+ * `DropdownMenu.Item` with roving focus and typeahead, or a plain anchor in a
6
+ * `<ul class="menu">` navigation list — but a call site writes the same
7
+ * `<MenuItem>` either way. The mode travels down as context rather than as a
8
+ * prop so a caller can never get the two out of step, and so `Menu` stays the
9
+ * single place the choice is made.
10
+ *
11
+ * A `MenuItem` mounted with no `Menu` above it (a list of links assembled by
12
+ * hand) falls back to `nav`, which is the mode that needs nothing from its
13
+ * parent.
14
+ *
15
+ * @module
16
+ */
17
+ /** Which of the two things daisyUI calls a `menu` a `Menu` renders: a dropdown or a navigation list. */
18
+ export type MenuMode = 'dropdown' | 'nav';
19
+ /** Declare the mode every descendant `MenuItem` renders in. Called by `Menu`. */
20
+ export declare function setMenuMode(mode: () => MenuMode): void;
21
+ /** The enclosing `Menu`'s mode, or `nav` when there is no enclosing `Menu`. */
22
+ export declare function getMenuMode(): () => MenuMode;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * How a {@link MenuItem} learns which {@link Menu} it is inside.
3
+ *
4
+ * The two menu modes render entirely different markup — a bits-ui
5
+ * `DropdownMenu.Item` with roving focus and typeahead, or a plain anchor in a
6
+ * `<ul class="menu">` navigation list — but a call site writes the same
7
+ * `<MenuItem>` either way. The mode travels down as context rather than as a
8
+ * prop so a caller can never get the two out of step, and so `Menu` stays the
9
+ * single place the choice is made.
10
+ *
11
+ * A `MenuItem` mounted with no `Menu` above it (a list of links assembled by
12
+ * hand) falls back to `nav`, which is the mode that needs nothing from its
13
+ * parent.
14
+ *
15
+ * @module
16
+ */
17
+ import { getContext, setContext } from 'svelte';
18
+ const MENU_MODE_KEY = Symbol('@thomasfosterau/components:menu-mode');
19
+ /** Declare the mode every descendant `MenuItem` renders in. Called by `Menu`. */
20
+ export function setMenuMode(mode) {
21
+ setContext(MENU_MODE_KEY, mode);
22
+ }
23
+ /** The enclosing `Menu`'s mode, or `nav` when there is no enclosing `Menu`. */
24
+ export function getMenuMode() {
25
+ return getContext(MENU_MODE_KEY) ?? (() => 'nav');
26
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Text → anchor id.
3
+ *
4
+ * Shared by {@link Heading} and anything else that has to address a section it
5
+ * only knows the words of. Deliberately tiny and deterministic: the same text
6
+ * must slug identically on the server and in the browser, or an in-page link
7
+ * rendered during SSR points at an id hydration then changes.
8
+ *
9
+ * @module
10
+ */
11
+ /**
12
+ * Lower-case, strip anything that is not a word character, collapse runs of
13
+ * whitespace to single hyphens.
14
+ *
15
+ * ```ts
16
+ * slugify('Growing conditions & care') // 'growing-conditions-care'
17
+ * ```
18
+ */
19
+ export declare function slugify(text: string): string;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Text → anchor id.
3
+ *
4
+ * Shared by {@link Heading} and anything else that has to address a section it
5
+ * only knows the words of. Deliberately tiny and deterministic: the same text
6
+ * must slug identically on the server and in the browser, or an in-page link
7
+ * rendered during SSR points at an id hydration then changes.
8
+ *
9
+ * @module
10
+ */
11
+ /**
12
+ * Lower-case, strip anything that is not a word character, collapse runs of
13
+ * whitespace to single hyphens.
14
+ *
15
+ * ```ts
16
+ * slugify('Growing conditions & care') // 'growing-conditions-care'
17
+ * ```
18
+ */
19
+ export function slugify(text) {
20
+ return text
21
+ .toLowerCase()
22
+ .replace(/[^\w\s-]/g, '')
23
+ .trim()
24
+ .replace(/\s+/g, '-');
25
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The daisyUI semantic vocabulary and the literal class tables that map it
3
+ * onto each component.
4
+ *
5
+ * The tables exist because Tailwind only generates classes it can see
6
+ * verbatim in source: a template-string `btn-${tone}` produces nothing at
7
+ * build time. So every tone / variant / size class is spelled out once here
8
+ * as a `Record<K, string>` and looked up, never interpolated. Add a table
9
+ * here rather than a second copy in a component.
10
+ *
11
+ * @module
12
+ */
13
+ /** daisyUI semantic colours. */
14
+ export type Tone = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';
15
+ /** The status subset daisyUI's `alert` supports. */
16
+ export type StatusTone = 'info' | 'success' | 'warning' | 'error';
17
+ /** daisyUI size steps. */
18
+ export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
19
+ /** The daisyUI `btn` styles. */
20
+ export type ButtonVariant = 'solid' | 'outline' | 'soft' | 'dash' | 'ghost' | 'link';
21
+ /** The daisyUI `badge` styles. */
22
+ export type BadgeVariant = 'solid' | 'outline' | 'soft' | 'dash' | 'ghost';
23
+ /** The daisyUI `alert` styles. */
24
+ export type AlertVariant = 'solid' | 'soft' | 'outline' | 'dash';
25
+ /** Literal daisyUI class per `Tone` for `Button`; a lookup table so Tailwind's scanner sees every class. */
26
+ export declare const buttonTone: Record<Tone, string>;
27
+ /** Literal daisyUI class per `ButtonVariant` for `Button`; a lookup table so Tailwind's scanner sees every class. */
28
+ export declare const buttonVariant: Record<ButtonVariant, string>;
29
+ /** Literal daisyUI class per `Size` for `Button`; a lookup table so Tailwind's scanner sees every class. */
30
+ export declare const buttonSize: Record<Size, string>;
31
+ /** Literal daisyUI class per `Tone` for `Badge`; a lookup table so Tailwind's scanner sees every class. */
32
+ export declare const badgeTone: Record<Tone, string>;
33
+ /** Literal daisyUI class per `BadgeVariant` for `Badge`; a lookup table so Tailwind's scanner sees every class. */
34
+ export declare const badgeVariant: Record<BadgeVariant, string>;
35
+ /** Literal daisyUI class per `Size` for `Badge`; a lookup table so Tailwind's scanner sees every class. */
36
+ export declare const badgeSize: Record<Size, string>;
37
+ /** Literal daisyUI class per `StatusTone` for `Alert`; a lookup table so Tailwind's scanner sees every class. */
38
+ export declare const alertTone: Record<StatusTone, string>;
39
+ /** Literal daisyUI class per `AlertVariant` for `Alert`; a lookup table so Tailwind's scanner sees every class. */
40
+ export declare const alertVariant: Record<AlertVariant, string>;
41
+ /** Literal daisyUI class per `Tone` for `ProgressBar`; a lookup table so Tailwind's scanner sees every class. */
42
+ export declare const progressTone: Record<Tone, string>;
43
+ /** Plain background classes, for a segment or swatch without a component prefix. */
44
+ export declare const backgroundTone: Record<Tone, string>;
45
+ /** Text colour classes, the foreground half of {@link backgroundTone}. */
46
+ export declare const textTone: Record<Tone, string>;
47
+ /** Heading levels, for any component that renders a caller-chosen heading. */
48
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
49
+ /** The three link weights: `primary` (coloured), `muted` and `plain` (dimmed text). */
50
+ export type LinkVariant = 'primary' | 'muted' | 'plain';
51
+ /** Literal daisyUI class per `LinkVariant` for `Link`; a lookup table so Tailwind's scanner sees every class. */
52
+ export declare const linkVariant: Record<LinkVariant, string>;
53
+ /** The daisyUI `card` border styles. */
54
+ export type CardVariant = 'border' | 'dash' | 'plain';
55
+ /** Literal daisyUI class per `CardVariant` for `Card`; a lookup table so Tailwind's scanner sees every class. */
56
+ export declare const cardVariant: Record<CardVariant, string>;
57
+ /** Literal daisyUI class per `Size` for `Card`; a lookup table so Tailwind's scanner sees every class. */
58
+ export declare const cardSize: Record<Size, string>;
59
+ /** The `Disclosure` expand marker: an arrow, a plus, or none. */
60
+ export type DisclosureVariant = 'arrow' | 'plus' | 'plain';
61
+ /** daisyUI `collapse` markers — the affordance on a native `<details>`. */
62
+ export declare const collapseVariant: Record<DisclosureVariant, string>;
63
+ /** The two chip steps. A chip is a dense inline unit, so it stops at `md`. */
64
+ export type ChipSize = 'sm' | 'md';
65
+ /** Literal gap and text-size classes per `ChipSize`; a lookup table so Tailwind's scanner sees every class. */
66
+ export declare const chipSize: Record<ChipSize, string>;
67
+ /** The swatch square beside a chip's label, sized to match {@link chipSize}. */
68
+ export declare const chipSwatchSize: Record<ChipSize, string>;
@@ -0,0 +1,150 @@
1
+ /**
2
+ * The daisyUI semantic vocabulary and the literal class tables that map it
3
+ * onto each component.
4
+ *
5
+ * The tables exist because Tailwind only generates classes it can see
6
+ * verbatim in source: a template-string `btn-${tone}` produces nothing at
7
+ * build time. So every tone / variant / size class is spelled out once here
8
+ * as a `Record<K, string>` and looked up, never interpolated. Add a table
9
+ * here rather than a second copy in a component.
10
+ *
11
+ * @module
12
+ */
13
+ /** Literal daisyUI class per `Tone` for `Button`; a lookup table so Tailwind's scanner sees every class. */
14
+ export const buttonTone = {
15
+ neutral: 'btn-neutral',
16
+ primary: 'btn-primary',
17
+ secondary: 'btn-secondary',
18
+ accent: 'btn-accent',
19
+ info: 'btn-info',
20
+ success: 'btn-success',
21
+ warning: 'btn-warning',
22
+ error: 'btn-error',
23
+ };
24
+ /** Literal daisyUI class per `ButtonVariant` for `Button`; a lookup table so Tailwind's scanner sees every class. */
25
+ export const buttonVariant = {
26
+ solid: '',
27
+ outline: 'btn-outline',
28
+ soft: 'btn-soft',
29
+ dash: 'btn-dash',
30
+ ghost: 'btn-ghost',
31
+ link: 'btn-link',
32
+ };
33
+ /** Literal daisyUI class per `Size` for `Button`; a lookup table so Tailwind's scanner sees every class. */
34
+ export const buttonSize = {
35
+ xs: 'btn-xs',
36
+ sm: 'btn-sm',
37
+ md: 'btn-md',
38
+ lg: 'btn-lg',
39
+ xl: 'btn-xl',
40
+ };
41
+ /** Literal daisyUI class per `Tone` for `Badge`; a lookup table so Tailwind's scanner sees every class. */
42
+ export const badgeTone = {
43
+ neutral: 'badge-neutral',
44
+ primary: 'badge-primary',
45
+ secondary: 'badge-secondary',
46
+ accent: 'badge-accent',
47
+ info: 'badge-info',
48
+ success: 'badge-success',
49
+ warning: 'badge-warning',
50
+ error: 'badge-error',
51
+ };
52
+ /** Literal daisyUI class per `BadgeVariant` for `Badge`; a lookup table so Tailwind's scanner sees every class. */
53
+ export const badgeVariant = {
54
+ solid: '',
55
+ outline: 'badge-outline',
56
+ soft: 'badge-soft',
57
+ dash: 'badge-dash',
58
+ ghost: 'badge-ghost',
59
+ };
60
+ /** Literal daisyUI class per `Size` for `Badge`; a lookup table so Tailwind's scanner sees every class. */
61
+ export const badgeSize = {
62
+ xs: 'badge-xs',
63
+ sm: 'badge-sm',
64
+ md: 'badge-md',
65
+ lg: 'badge-lg',
66
+ xl: 'badge-xl',
67
+ };
68
+ /** Literal daisyUI class per `StatusTone` for `Alert`; a lookup table so Tailwind's scanner sees every class. */
69
+ export const alertTone = {
70
+ info: 'alert-info',
71
+ success: 'alert-success',
72
+ warning: 'alert-warning',
73
+ error: 'alert-error',
74
+ };
75
+ /** Literal daisyUI class per `AlertVariant` for `Alert`; a lookup table so Tailwind's scanner sees every class. */
76
+ export const alertVariant = {
77
+ solid: '',
78
+ soft: 'alert-soft',
79
+ outline: 'alert-outline',
80
+ dash: 'alert-dash',
81
+ };
82
+ /** Literal daisyUI class per `Tone` for `ProgressBar`; a lookup table so Tailwind's scanner sees every class. */
83
+ export const progressTone = {
84
+ neutral: 'progress-neutral',
85
+ primary: 'progress-primary',
86
+ secondary: 'progress-secondary',
87
+ accent: 'progress-accent',
88
+ info: 'progress-info',
89
+ success: 'progress-success',
90
+ warning: 'progress-warning',
91
+ error: 'progress-error',
92
+ };
93
+ /** Plain background classes, for a segment or swatch without a component prefix. */
94
+ export const backgroundTone = {
95
+ neutral: 'bg-neutral',
96
+ primary: 'bg-primary',
97
+ secondary: 'bg-secondary',
98
+ accent: 'bg-accent',
99
+ info: 'bg-info',
100
+ success: 'bg-success',
101
+ warning: 'bg-warning',
102
+ error: 'bg-error',
103
+ };
104
+ /** Text colour classes, the foreground half of {@link backgroundTone}. */
105
+ export const textTone = {
106
+ neutral: 'text-neutral',
107
+ primary: 'text-primary',
108
+ secondary: 'text-secondary',
109
+ accent: 'text-accent',
110
+ info: 'text-info',
111
+ success: 'text-success',
112
+ warning: 'text-warning',
113
+ error: 'text-error',
114
+ };
115
+ /** Literal daisyUI class per `LinkVariant` for `Link`; a lookup table so Tailwind's scanner sees every class. */
116
+ export const linkVariant = {
117
+ primary: 'link link-primary link-hover',
118
+ muted: 'link link-hover',
119
+ plain: 'link link-hover text-base-content/70',
120
+ };
121
+ /** Literal daisyUI class per `CardVariant` for `Card`; a lookup table so Tailwind's scanner sees every class. */
122
+ export const cardVariant = {
123
+ border: 'card-border',
124
+ dash: 'card-dash',
125
+ plain: '',
126
+ };
127
+ /** Literal daisyUI class per `Size` for `Card`; a lookup table so Tailwind's scanner sees every class. */
128
+ export const cardSize = {
129
+ xs: 'card-xs',
130
+ sm: 'card-sm',
131
+ md: 'card-md',
132
+ lg: 'card-lg',
133
+ xl: 'card-xl',
134
+ };
135
+ /** daisyUI `collapse` markers — the affordance on a native `<details>`. */
136
+ export const collapseVariant = {
137
+ arrow: 'collapse-arrow',
138
+ plus: 'collapse-plus',
139
+ plain: '',
140
+ };
141
+ /** Literal gap and text-size classes per `ChipSize`; a lookup table so Tailwind's scanner sees every class. */
142
+ export const chipSize = {
143
+ sm: 'gap-1 text-xs',
144
+ md: 'gap-1.5 text-sm',
145
+ };
146
+ /** The swatch square beside a chip's label, sized to match {@link chipSize}. */
147
+ export const chipSwatchSize = {
148
+ sm: 'size-2',
149
+ md: 'size-2.5',
150
+ };