@thomasfosterau/components 0.0.0 → 0.2.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 (484) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +241 -56
  3. package/dist/canvas/VectorCanvas.svelte +320 -0
  4. package/dist/canvas/VectorCanvas.svelte.d.ts +105 -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 +40 -0
  57. package/dist/context.svelte.d.ts +46 -0
  58. package/dist/context.svelte.js +51 -0
  59. package/dist/data/ChatBubble.svelte +48 -0
  60. package/dist/data/ChatBubble.svelte.d.ts +33 -0
  61. package/dist/data/DataGrid.svelte +150 -0
  62. package/dist/data/DataGrid.svelte.d.ts +118 -0
  63. package/dist/data/DescriptionList.svelte +53 -0
  64. package/dist/data/DescriptionList.svelte.d.ts +26 -0
  65. package/dist/data/DescriptionRow.svelte +56 -0
  66. package/dist/data/DescriptionRow.svelte.d.ts +21 -0
  67. package/dist/data/DiffText.svelte +29 -0
  68. package/dist/data/DiffText.svelte.d.ts +19 -0
  69. package/dist/data/ItemList.svelte +80 -0
  70. package/dist/data/ItemList.svelte.d.ts +52 -0
  71. package/dist/data/LinkListItem.svelte +46 -0
  72. package/dist/data/LinkListItem.svelte.d.ts +21 -0
  73. package/dist/data/MessageThread.svelte +29 -0
  74. package/dist/data/MessageThread.svelte.d.ts +17 -0
  75. package/dist/data/Pagination.svelte +136 -0
  76. package/dist/data/Pagination.svelte.d.ts +79 -0
  77. package/dist/data/PaginationFooter.svelte +42 -0
  78. package/dist/data/PaginationFooter.svelte.d.ts +61 -0
  79. package/dist/data/ResultCount.svelte +27 -0
  80. package/dist/data/ResultCount.svelte.d.ts +18 -0
  81. package/dist/data/Table.svelte +151 -0
  82. package/dist/data/Table.svelte.d.ts +75 -0
  83. package/dist/data/TreeList.svelte +41 -0
  84. package/dist/data/TreeList.svelte.d.ts +17 -0
  85. package/dist/data/TreeListItem.svelte +29 -0
  86. package/dist/data/TreeListItem.svelte.d.ts +10 -0
  87. package/dist/data/description-context.d.ts +39 -0
  88. package/dist/data/description-context.js +36 -0
  89. package/dist/data/diff.d.ts +14 -0
  90. package/dist/data/diff.js +10 -0
  91. package/dist/data/index.d.ts +37 -0
  92. package/dist/data/index.js +37 -0
  93. package/dist/data/list-item.d.ts +30 -0
  94. package/dist/data/list-item.js +19 -0
  95. package/dist/data/pagination.d.ts +81 -0
  96. package/dist/data/pagination.js +79 -0
  97. package/dist/data/table-types.d.ts +71 -0
  98. package/dist/data/table-types.js +35 -0
  99. package/dist/feedback/ConfirmDialog.svelte +79 -0
  100. package/dist/feedback/ConfirmDialog.svelte.d.ts +82 -0
  101. package/dist/feedback/Dialog.svelte +47 -0
  102. package/dist/feedback/Dialog.svelte.d.ts +36 -0
  103. package/dist/feedback/DialogFrame.svelte +64 -0
  104. package/dist/feedback/DialogFrame.svelte.d.ts +23 -0
  105. package/dist/feedback/Drawer.svelte +43 -0
  106. package/dist/feedback/Drawer.svelte.d.ts +43 -0
  107. package/dist/feedback/LoadingBoundary.svelte +61 -0
  108. package/dist/feedback/LoadingBoundary.svelte.d.ts +34 -0
  109. package/dist/feedback/ProgressBar.svelte +46 -0
  110. package/dist/feedback/ProgressBar.svelte.d.ts +28 -0
  111. package/dist/feedback/SegmentBar.svelte +83 -0
  112. package/dist/feedback/SegmentBar.svelte.d.ts +37 -0
  113. package/dist/feedback/StatTile.svelte +77 -0
  114. package/dist/feedback/StatTile.svelte.d.ts +50 -0
  115. package/dist/feedback/Stats.svelte +18 -0
  116. package/dist/feedback/Stats.svelte.d.ts +16 -0
  117. package/dist/feedback/Steps.svelte +72 -0
  118. package/dist/feedback/Steps.svelte.d.ts +61 -0
  119. package/dist/feedback/Timeline.svelte +86 -0
  120. package/dist/feedback/Timeline.svelte.d.ts +55 -0
  121. package/dist/feedback/Toaster.svelte +78 -0
  122. package/dist/feedback/Toaster.svelte.d.ts +32 -0
  123. package/dist/feedback/index.d.ts +34 -0
  124. package/dist/feedback/index.js +29 -0
  125. package/dist/feedback/sizes.d.ts +41 -0
  126. package/dist/feedback/sizes.js +69 -0
  127. package/dist/feedback/toaster.d.ts +48 -0
  128. package/dist/feedback/toaster.js +29 -0
  129. package/dist/fields/Calendar.svelte +60 -0
  130. package/dist/fields/Calendar.svelte.d.ts +11 -0
  131. package/dist/fields/CalendarMonths.svelte +86 -0
  132. package/dist/fields/CalendarMonths.svelte.d.ts +30 -0
  133. package/dist/fields/Checkbox.svelte +33 -0
  134. package/dist/fields/Checkbox.svelte.d.ts +30 -0
  135. package/dist/fields/CheckboxGroup.svelte +41 -0
  136. package/dist/fields/CheckboxGroup.svelte.d.ts +40 -0
  137. package/dist/fields/Combobox.svelte +229 -0
  138. package/dist/fields/Combobox.svelte.d.ts +133 -0
  139. package/dist/fields/DateField.svelte +37 -0
  140. package/dist/fields/DateField.svelte.d.ts +20 -0
  141. package/dist/fields/DateInput.svelte +31 -0
  142. package/dist/fields/DateInput.svelte.d.ts +35 -0
  143. package/dist/fields/DatePicker.svelte +47 -0
  144. package/dist/fields/DatePicker.svelte.d.ts +25 -0
  145. package/dist/fields/DateRangePicker.svelte +70 -0
  146. package/dist/fields/DateRangePicker.svelte.d.ts +43 -0
  147. package/dist/fields/Dropzone.svelte +232 -0
  148. package/dist/fields/Dropzone.svelte.d.ts +103 -0
  149. package/dist/fields/FieldErrors.svelte +30 -0
  150. package/dist/fields/FieldErrors.svelte.d.ts +11 -0
  151. package/dist/fields/Fieldset.svelte +53 -0
  152. package/dist/fields/Fieldset.svelte.d.ts +27 -0
  153. package/dist/fields/FileInput.svelte +68 -0
  154. package/dist/fields/FileInput.svelte.d.ts +39 -0
  155. package/dist/fields/FormField.svelte +78 -0
  156. package/dist/fields/FormField.svelte.d.ts +29 -0
  157. package/dist/fields/ImageInput.svelte +87 -0
  158. package/dist/fields/ImageInput.svelte.d.ts +45 -0
  159. package/dist/fields/MultiSelect.svelte +112 -0
  160. package/dist/fields/MultiSelect.svelte.d.ts +75 -0
  161. package/dist/fields/NumberField.svelte +190 -0
  162. package/dist/fields/NumberField.svelte.d.ts +76 -0
  163. package/dist/fields/PasswordInput.svelte +95 -0
  164. package/dist/fields/PasswordInput.svelte.d.ts +58 -0
  165. package/dist/fields/PickerPopover.svelte +47 -0
  166. package/dist/fields/PickerPopover.svelte.d.ts +16 -0
  167. package/dist/fields/PinInput.svelte +83 -0
  168. package/dist/fields/PinInput.svelte.d.ts +66 -0
  169. package/dist/fields/PushToggle.svelte +93 -0
  170. package/dist/fields/PushToggle.svelte.d.ts +55 -0
  171. package/dist/fields/RadioGroup.svelte +88 -0
  172. package/dist/fields/RadioGroup.svelte.d.ts +41 -0
  173. package/dist/fields/RangeCalendar.svelte +51 -0
  174. package/dist/fields/RangeCalendar.svelte.d.ts +23 -0
  175. package/dist/fields/Rating.svelte +127 -0
  176. package/dist/fields/Rating.svelte.d.ts +86 -0
  177. package/dist/fields/SearchInput.svelte +58 -0
  178. package/dist/fields/SearchInput.svelte.d.ts +33 -0
  179. package/dist/fields/SegmentGroup.svelte +91 -0
  180. package/dist/fields/SegmentGroup.svelte.d.ts +20 -0
  181. package/dist/fields/Select.svelte +36 -0
  182. package/dist/fields/Select.svelte.d.ts +35 -0
  183. package/dist/fields/Slider.svelte +194 -0
  184. package/dist/fields/Slider.svelte.d.ts +100 -0
  185. package/dist/fields/TagsInput.svelte +256 -0
  186. package/dist/fields/TagsInput.svelte.d.ts +102 -0
  187. package/dist/fields/TextInput.svelte +26 -0
  188. package/dist/fields/TextInput.svelte.d.ts +36 -0
  189. package/dist/fields/Textarea.svelte +22 -0
  190. package/dist/fields/Textarea.svelte.d.ts +31 -0
  191. package/dist/fields/TimeField.svelte +30 -0
  192. package/dist/fields/TimeField.svelte.d.ts +19 -0
  193. package/dist/fields/Toggle.svelte +72 -0
  194. package/dist/fields/Toggle.svelte.d.ts +38 -0
  195. package/dist/fields/VideoInput.svelte +35 -0
  196. package/dist/fields/VideoInput.svelte.d.ts +46 -0
  197. package/dist/fields/calendar-props.d.ts +119 -0
  198. package/dist/fields/calendar-props.js +51 -0
  199. package/dist/fields/dates.d.ts +28 -0
  200. package/dist/fields/dates.js +26 -0
  201. package/dist/fields/field-types.d.ts +80 -0
  202. package/dist/fields/field-types.js +92 -0
  203. package/dist/fields/file-validation.d.ts +30 -0
  204. package/dist/fields/file-validation.js +51 -0
  205. package/dist/fields/index.d.ts +43 -0
  206. package/dist/fields/index.js +42 -0
  207. package/dist/fields/latest-search.svelte.d.ts +38 -0
  208. package/dist/fields/latest-search.svelte.js +85 -0
  209. package/dist/fields/number-format.d.ts +52 -0
  210. package/dist/fields/number-format.js +89 -0
  211. package/dist/fields/segmented-field.d.ts +128 -0
  212. package/dist/fields/segmented-field.js +52 -0
  213. package/dist/fields/slider-keys.d.ts +21 -0
  214. package/dist/fields/slider-keys.js +37 -0
  215. package/dist/formatting/Countdown.svelte +110 -0
  216. package/dist/formatting/Countdown.svelte.d.ts +35 -0
  217. package/dist/formatting/DateTime.svelte +35 -0
  218. package/dist/formatting/DateTime.svelte.d.ts +26 -0
  219. package/dist/formatting/Duration.svelte +18 -0
  220. package/dist/formatting/Duration.svelte.d.ts +20 -0
  221. package/dist/formatting/FormatList.svelte +31 -0
  222. package/dist/formatting/FormatList.svelte.d.ts +46 -0
  223. package/dist/formatting/Highlight.svelte +51 -0
  224. package/dist/formatting/Highlight.svelte.d.ts +19 -0
  225. package/dist/formatting/Number.svelte +35 -0
  226. package/dist/formatting/Number.svelte.d.ts +43 -0
  227. package/dist/formatting/RelativeTime.svelte +69 -0
  228. package/dist/formatting/RelativeTime.svelte.d.ts +26 -0
  229. package/dist/formatting/Year.svelte +39 -0
  230. package/dist/formatting/Year.svelte.d.ts +21 -0
  231. package/dist/formatting/duration.d.ts +44 -0
  232. package/dist/formatting/duration.js +125 -0
  233. package/dist/formatting/index.d.ts +15 -0
  234. package/dist/formatting/index.js +17 -0
  235. package/dist/forms/EntityForm.svelte +185 -0
  236. package/dist/forms/EntityForm.svelte.d.ts +66 -0
  237. package/dist/forms/FormActions.svelte +29 -0
  238. package/dist/forms/FormActions.svelte.d.ts +37 -0
  239. package/dist/forms/FormErrors.svelte +21 -0
  240. package/dist/forms/FormErrors.svelte.d.ts +16 -0
  241. package/dist/forms/HiddenField.svelte +22 -0
  242. package/dist/forms/HiddenField.svelte.d.ts +11 -0
  243. package/dist/forms/SearchForm.svelte +43 -0
  244. package/dist/forms/SearchForm.svelte.d.ts +36 -0
  245. package/dist/forms/entity-form.d.ts +12 -0
  246. package/dist/forms/entity-form.js +12 -0
  247. package/dist/forms/index.d.ts +14 -0
  248. package/dist/forms/index.js +14 -0
  249. package/dist/hotkeys/HotkeyBadge.svelte +39 -0
  250. package/dist/hotkeys/HotkeyBadge.svelte.d.ts +25 -0
  251. package/dist/hotkeys/HotkeyHelpDialog.svelte +68 -0
  252. package/dist/hotkeys/HotkeyHelpDialog.svelte.d.ts +35 -0
  253. package/dist/hotkeys/HotkeyProvider.svelte +92 -0
  254. package/dist/hotkeys/HotkeyProvider.svelte.d.ts +4 -0
  255. package/dist/hotkeys/context.svelte.d.ts +47 -0
  256. package/dist/hotkeys/context.svelte.js +72 -0
  257. package/dist/hotkeys/index.d.ts +28 -0
  258. package/dist/hotkeys/index.js +27 -0
  259. package/dist/hotkeys/match.d.ts +65 -0
  260. package/dist/hotkeys/match.js +135 -0
  261. package/dist/hotkeys/registry.svelte.d.ts +55 -0
  262. package/dist/hotkeys/registry.svelte.js +110 -0
  263. package/dist/hotkeys/types.d.ts +74 -0
  264. package/dist/hotkeys/types.js +18 -0
  265. package/dist/index.d.ts +37 -0
  266. package/dist/index.js +37 -0
  267. package/dist/infobox/Infobox.svelte +79 -0
  268. package/dist/infobox/Infobox.svelte.d.ts +33 -0
  269. package/dist/infobox/InfoboxHeader.svelte +35 -0
  270. package/dist/infobox/InfoboxHeader.svelte.d.ts +18 -0
  271. package/dist/infobox/InfoboxImage.svelte +38 -0
  272. package/dist/infobox/InfoboxImage.svelte.d.ts +21 -0
  273. package/dist/infobox/InfoboxRow.svelte +50 -0
  274. package/dist/infobox/InfoboxRow.svelte.d.ts +25 -0
  275. package/dist/infobox/InfoboxSection.svelte +24 -0
  276. package/dist/infobox/InfoboxSection.svelte.d.ts +12 -0
  277. package/dist/infobox/index.d.ts +21 -0
  278. package/dist/infobox/index.js +20 -0
  279. package/dist/infobox/types.d.ts +86 -0
  280. package/dist/infobox/types.js +27 -0
  281. package/dist/layout/AppShell.svelte +50 -0
  282. package/dist/layout/AppShell.svelte.d.ts +28 -0
  283. package/dist/layout/Breadcrumbs.svelte +52 -0
  284. package/dist/layout/Breadcrumbs.svelte.d.ts +18 -0
  285. package/dist/layout/Cluster.svelte +28 -0
  286. package/dist/layout/Cluster.svelte.d.ts +27 -0
  287. package/dist/layout/DetailLayout.svelte +50 -0
  288. package/dist/layout/DetailLayout.svelte.d.ts +19 -0
  289. package/dist/layout/FilterBar.svelte +40 -0
  290. package/dist/layout/FilterBar.svelte.d.ts +12 -0
  291. package/dist/layout/Fits.svelte +27 -0
  292. package/dist/layout/Fits.svelte.d.ts +13 -0
  293. package/dist/layout/Flow.svelte +46 -0
  294. package/dist/layout/Flow.svelte.d.ts +16 -0
  295. package/dist/layout/Footer.svelte +32 -0
  296. package/dist/layout/Footer.svelte.d.ts +12 -0
  297. package/dist/layout/Grid.svelte +23 -0
  298. package/dist/layout/Grid.svelte.d.ts +26 -0
  299. package/dist/layout/HStack.svelte +12 -0
  300. package/dist/layout/HStack.svelte.d.ts +34 -0
  301. package/dist/layout/Hero.svelte +76 -0
  302. package/dist/layout/Hero.svelte.d.ts +36 -0
  303. package/dist/layout/Main.svelte +30 -0
  304. package/dist/layout/Main.svelte.d.ts +15 -0
  305. package/dist/layout/Navbar.svelte +68 -0
  306. package/dist/layout/Navbar.svelte.d.ts +31 -0
  307. package/dist/layout/PageHeader.svelte +77 -0
  308. package/dist/layout/PageHeader.svelte.d.ts +33 -0
  309. package/dist/layout/Section.svelte +72 -0
  310. package/dist/layout/Section.svelte.d.ts +40 -0
  311. package/dist/layout/Sidebar.svelte +54 -0
  312. package/dist/layout/Sidebar.svelte.d.ts +27 -0
  313. package/dist/layout/Spacer.svelte +12 -0
  314. package/dist/layout/Spacer.svelte.d.ts +6 -0
  315. package/dist/layout/Tabs.svelte +85 -0
  316. package/dist/layout/Tabs.svelte.d.ts +42 -0
  317. package/dist/layout/VStack.svelte +12 -0
  318. package/dist/layout/VStack.svelte.d.ts +29 -0
  319. package/dist/layout/index.d.ts +38 -0
  320. package/dist/layout/index.js +38 -0
  321. package/dist/layout/space.d.ts +44 -0
  322. package/dist/layout/space.js +76 -0
  323. package/dist/layout/types.d.ts +52 -0
  324. package/dist/layout/types.js +27 -0
  325. package/dist/links/ContextLinks.svelte +28 -0
  326. package/dist/links/ContextLinks.svelte.d.ts +20 -0
  327. package/dist/links/EmailLink.svelte +26 -0
  328. package/dist/links/EmailLink.svelte.d.ts +20 -0
  329. package/dist/links/index.d.ts +7 -0
  330. package/dist/links/index.js +7 -0
  331. package/dist/media/Figure.svelte +26 -0
  332. package/dist/media/Figure.svelte.d.ts +12 -0
  333. package/dist/media/Image.svelte +76 -0
  334. package/dist/media/Image.svelte.d.ts +41 -0
  335. package/dist/media/Video.svelte +65 -0
  336. package/dist/media/Video.svelte.d.ts +29 -0
  337. package/dist/media/image-dimensions.d.ts +28 -0
  338. package/dist/media/image-dimensions.js +34 -0
  339. package/dist/media/index.d.ts +10 -0
  340. package/dist/media/index.js +10 -0
  341. package/dist/search/CommandPalette.svelte +257 -0
  342. package/dist/search/CommandPalette.svelte.d.ts +59 -0
  343. package/dist/search/index.d.ts +13 -0
  344. package/dist/search/index.js +13 -0
  345. package/dist/search/types.d.ts +40 -0
  346. package/dist/search/types.js +20 -0
  347. package/dist/seo/Head.svelte +190 -0
  348. package/dist/seo/Head.svelte.d.ts +86 -0
  349. package/dist/seo/JsonLd.svelte +30 -0
  350. package/dist/seo/JsonLd.svelte.d.ts +20 -0
  351. package/dist/seo/index.d.ts +18 -0
  352. package/dist/seo/index.js +17 -0
  353. package/dist/seo/json-ld.d.ts +33 -0
  354. package/dist/seo/json-ld.js +29 -0
  355. package/dist/seo/og-image.d.ts +72 -0
  356. package/dist/seo/og-image.js +82 -0
  357. package/dist/seo/types.d.ts +43 -0
  358. package/dist/seo/types.js +6 -0
  359. package/dist/theme.css +161 -0
  360. package/dist/tips/PopoverTip.svelte +80 -0
  361. package/dist/tips/PopoverTip.svelte.d.ts +33 -0
  362. package/dist/tips/Tip.svelte +91 -0
  363. package/dist/tips/Tip.svelte.d.ts +25 -0
  364. package/dist/tips/index.d.ts +15 -0
  365. package/dist/tips/index.js +14 -0
  366. package/dist/tips/tip-stack.d.ts +26 -0
  367. package/dist/tips/tip-stack.js +37 -0
  368. package/dist/tips/tip-store.svelte.d.ts +75 -0
  369. package/dist/tips/tip-store.svelte.js +158 -0
  370. package/dist/tips/types.d.ts +46 -0
  371. package/dist/tips/types.js +6 -0
  372. package/dist/ui/Accordion.svelte +75 -0
  373. package/dist/ui/Accordion.svelte.d.ts +50 -0
  374. package/dist/ui/AccordionItem.svelte +73 -0
  375. package/dist/ui/AccordionItem.svelte.d.ts +18 -0
  376. package/dist/ui/Alert.svelte +61 -0
  377. package/dist/ui/Alert.svelte.d.ts +37 -0
  378. package/dist/ui/Badge.svelte +39 -0
  379. package/dist/ui/Badge.svelte.d.ts +32 -0
  380. package/dist/ui/Button.svelte +44 -0
  381. package/dist/ui/Button.svelte.d.ts +29 -0
  382. package/dist/ui/ButtonGroup.svelte +24 -0
  383. package/dist/ui/ButtonGroup.svelte.d.ts +17 -0
  384. package/dist/ui/Card.svelte +49 -0
  385. package/dist/ui/Card.svelte.d.ts +44 -0
  386. package/dist/ui/Chip.svelte +58 -0
  387. package/dist/ui/Chip.svelte.d.ts +21 -0
  388. package/dist/ui/ConfirmButton.svelte +75 -0
  389. package/dist/ui/ConfirmButton.svelte.d.ts +48 -0
  390. package/dist/ui/ContextMenu.svelte +75 -0
  391. package/dist/ui/ContextMenu.svelte.d.ts +25 -0
  392. package/dist/ui/Disclosure.svelte +46 -0
  393. package/dist/ui/Disclosure.svelte.d.ts +22 -0
  394. package/dist/ui/Divider.svelte +47 -0
  395. package/dist/ui/Divider.svelte.d.ts +28 -0
  396. package/dist/ui/DropdownMenu.svelte +44 -0
  397. package/dist/ui/DropdownMenu.svelte.d.ts +30 -0
  398. package/dist/ui/EmptyState.svelte +37 -0
  399. package/dist/ui/EmptyState.svelte.d.ts +22 -0
  400. package/dist/ui/ExternalLink.svelte +38 -0
  401. package/dist/ui/ExternalLink.svelte.d.ts +34 -0
  402. package/dist/ui/Heading.svelte +58 -0
  403. package/dist/ui/Heading.svelte.d.ts +22 -0
  404. package/dist/ui/Link.svelte +34 -0
  405. package/dist/ui/Link.svelte.d.ts +20 -0
  406. package/dist/ui/LinkButton.svelte +51 -0
  407. package/dist/ui/LinkButton.svelte.d.ts +33 -0
  408. package/dist/ui/Menu.svelte +24 -0
  409. package/dist/ui/Menu.svelte.d.ts +13 -0
  410. package/dist/ui/MenuCheckboxItem.svelte +33 -0
  411. package/dist/ui/MenuCheckboxItem.svelte.d.ts +20 -0
  412. package/dist/ui/MenuItem.svelte +73 -0
  413. package/dist/ui/MenuItem.svelte.d.ts +21 -0
  414. package/dist/ui/MenuRadioGroup.svelte +25 -0
  415. package/dist/ui/MenuRadioGroup.svelte.d.ts +20 -0
  416. package/dist/ui/MenuRadioItem.svelte +20 -0
  417. package/dist/ui/MenuRadioItem.svelte.d.ts +15 -0
  418. package/dist/ui/MenuSeparator.svelte +27 -0
  419. package/dist/ui/MenuSeparator.svelte.d.ts +8 -0
  420. package/dist/ui/MenuSub.svelte +24 -0
  421. package/dist/ui/MenuSub.svelte.d.ts +15 -0
  422. package/dist/ui/Popover.svelte +63 -0
  423. package/dist/ui/Popover.svelte.d.ts +40 -0
  424. package/dist/ui/ShareButton.svelte +64 -0
  425. package/dist/ui/ShareButton.svelte.d.ts +39 -0
  426. package/dist/ui/Skeleton.svelte +43 -0
  427. package/dist/ui/Skeleton.svelte.d.ts +22 -0
  428. package/dist/ui/Spinner.svelte +41 -0
  429. package/dist/ui/Spinner.svelte.d.ts +35 -0
  430. package/dist/ui/Stack.svelte +36 -0
  431. package/dist/ui/Stack.svelte.d.ts +48 -0
  432. package/dist/ui/ThemeToggle.svelte +65 -0
  433. package/dist/ui/ThemeToggle.svelte.d.ts +24 -0
  434. package/dist/ui/ToggleButton.svelte +58 -0
  435. package/dist/ui/ToggleButton.svelte.d.ts +45 -0
  436. package/dist/ui/ToggleGroup.svelte +142 -0
  437. package/dist/ui/ToggleGroup.svelte.d.ts +86 -0
  438. package/dist/ui/Toolbar.svelte +40 -0
  439. package/dist/ui/Toolbar.svelte.d.ts +20 -0
  440. package/dist/ui/ToolbarButton.svelte +29 -0
  441. package/dist/ui/ToolbarButton.svelte.d.ts +21 -0
  442. package/dist/ui/ToolbarLink.svelte +21 -0
  443. package/dist/ui/ToolbarLink.svelte.d.ts +12 -0
  444. package/dist/ui/ToolbarSeparator.svelte +22 -0
  445. package/dist/ui/ToolbarSeparator.svelte.d.ts +12 -0
  446. package/dist/ui/ToolbarToggleGroup.svelte +66 -0
  447. package/dist/ui/ToolbarToggleGroup.svelte.d.ts +52 -0
  448. package/dist/ui/Tooltip.svelte +54 -0
  449. package/dist/ui/Tooltip.svelte.d.ts +35 -0
  450. package/dist/ui/VisuallyHidden.svelte +23 -0
  451. package/dist/ui/VisuallyHidden.svelte.d.ts +10 -0
  452. package/dist/ui/accordion-context.d.ts +26 -0
  453. package/dist/ui/accordion-context.js +23 -0
  454. package/dist/ui/colour-token.d.ts +41 -0
  455. package/dist/ui/colour-token.js +49 -0
  456. package/dist/ui/context-menu.d.ts +13 -0
  457. package/dist/ui/context-menu.js +13 -0
  458. package/dist/ui/index.d.ts +63 -0
  459. package/dist/ui/index.js +62 -0
  460. package/dist/ui/menu-context.d.ts +20 -0
  461. package/dist/ui/menu-context.js +22 -0
  462. package/dist/ui/menu-parts/CheckboxItemPart.svelte +26 -0
  463. package/dist/ui/menu-parts/CheckboxItemPart.svelte.d.ts +5 -0
  464. package/dist/ui/menu-parts/ItemPart.svelte +29 -0
  465. package/dist/ui/menu-parts/ItemPart.svelte.d.ts +5 -0
  466. package/dist/ui/menu-parts/RadioGroupPart.svelte +24 -0
  467. package/dist/ui/menu-parts/RadioGroupPart.svelte.d.ts +5 -0
  468. package/dist/ui/menu-parts/RadioItemPart.svelte +22 -0
  469. package/dist/ui/menu-parts/RadioItemPart.svelte.d.ts +5 -0
  470. package/dist/ui/menu-parts/SeparatorPart.svelte +16 -0
  471. package/dist/ui/menu-parts/SeparatorPart.svelte.d.ts +5 -0
  472. package/dist/ui/menu-parts/SubPart.svelte +28 -0
  473. package/dist/ui/menu-parts/SubPart.svelte.d.ts +5 -0
  474. package/dist/ui/menu-parts/menu-parts.d.ts +104 -0
  475. package/dist/ui/menu-parts/menu-parts.js +31 -0
  476. package/dist/ui/menu-parts/parts.d.ts +12 -0
  477. package/dist/ui/menu-parts/parts.js +27 -0
  478. package/dist/ui/slug.d.ts +19 -0
  479. package/dist/ui/slug.js +25 -0
  480. package/dist/ui/toggle-classes.d.ts +39 -0
  481. package/dist/ui/toggle-classes.js +36 -0
  482. package/dist/ui/tones.d.ts +103 -0
  483. package/dist/ui/tones.js +240 -0
  484. package/package.json +41 -25
@@ -0,0 +1,52 @@
1
+ <!-- @component
2
+ The ancestor trail above a page title, as daisyUI `breadcrumbs` inside a labelled navigation landmark.
3
+ -->
4
+ <!--
5
+ Breadcrumbs — the ancestor trail above a page title, as daisyUI's
6
+ `breadcrumbs` inside a labelled navigation landmark.
7
+
8
+ ARIA contract: a `<nav aria-label>` wrapping an `<ol>`, because a trail is
9
+ ordered and the order is the meaning — "Home, then Elections, then this".
10
+ Ancestors are links; the TRAILING crumb is rendered as text and carries
11
+ `aria-current="page"`, even when the caller gave it an `href`. A link to the
12
+ page you are already on is a link that does nothing, and `aria-current` is
13
+ what says "this is where you are" to someone who cannot see the trail.
14
+
15
+ `item` lets a caller render a crumb's contents themselves — an icon beside
16
+ the label, a `<Badge>`, a truncated middle. The `<li>` and the
17
+ `aria-current` stay this component's either way: when `item` is supplied the
18
+ attribute moves to the `<li>`, so the contract holds whatever the snippet
19
+ renders inside it.
20
+
21
+ Hrefs resolve through the components context, so a base path or a locale
22
+ prefix is applied once by the app rather than at every call site.
23
+ -->
24
+ <script lang="ts">import { getComponentsContext } from "../context.svelte.js";
25
+ let { items, label = "Breadcrumb", item, class: className, ...rest } = $props();
26
+ const context = getComponentsContext();
27
+ </script>
28
+
29
+ <nav
30
+ {...rest}
31
+ aria-label={label}
32
+ class={['breadcrumbs text-base-content/70 text-sm', className]}
33
+ >
34
+ <ol>
35
+ {#each items as crumb, index (index)}
36
+ {@const current = index === items.length - 1}
37
+ {#if item}
38
+ <li aria-current={current ? 'page' : undefined}>{@render item(crumb, index)}</li>
39
+ {:else}
40
+ <li>
41
+ {#if crumb.href !== undefined && !current}
42
+ <a href={context.href(crumb.href)} class="link link-hover">{crumb.label}</a>
43
+ {:else}
44
+ <span class="text-base-content" aria-current={current ? 'page' : undefined}>
45
+ {crumb.label}
46
+ </span>
47
+ {/if}
48
+ </li>
49
+ {/if}
50
+ {/each}
51
+ </ol>
52
+ </nav>
@@ -0,0 +1,18 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { Crumb } from './types.ts';
4
+ interface Props extends HTMLAttributes<HTMLElement> {
5
+ /** Ordered ancestors, ending with the current page. */
6
+ items: readonly Crumb[];
7
+ /**
8
+ * Accessible name of the navigation landmark.
9
+ * @defaultValue `'Breadcrumb'`
10
+ */
11
+ label?: string | undefined;
12
+ /** Render one crumb's contents. The `<li>` wrapper is still this component's. */
13
+ item?: Snippet<[Crumb, number]> | undefined;
14
+ }
15
+ /** The ancestor trail above a page title, as daisyUI `breadcrumbs` inside a labelled navigation landmark. */
16
+ declare const Breadcrumbs: import("svelte").Component<Props, {}, "">;
17
+ type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
18
+ export default Breadcrumbs;
@@ -0,0 +1,28 @@
1
+ <!-- @component
2
+ Inline items that wrap onto new lines with a token gap: a row of tags or buttons.
3
+ -->
4
+ <!--
5
+ Cluster — "every-layout"'s Cluster, Compose's `FlowRow`: items in a row
6
+ that wraps, with the same gap between rows as between items. With
7
+ `as="ul"` / `"ol"` it is a list (`role="list"` restored; children `<li>`).
8
+ -->
9
+ <script lang="ts">import { alignClass, gapClass, justifyClass } from "./space.js";
10
+ let { gap = "sm", align = "center", justify, as = "div", children, class: className, ...rest } = $props();
11
+ const list = $derived(as === "ul" || as === "ol");
12
+ </script>
13
+
14
+ <svelte:element
15
+ this={as}
16
+ {...rest}
17
+ role={list ? 'list' : rest.role}
18
+ class={[
19
+ 'flex flex-wrap',
20
+ gapClass[gap],
21
+ alignClass[align],
22
+ justify !== undefined && justifyClass[justify],
23
+ list && 'list-none',
24
+ className,
25
+ ]}
26
+ >
27
+ {@render children()}
28
+ </svelte:element>
@@ -0,0 +1,27 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { type FlowAlign, type FlowElement, type FlowJustify, type Gap } from './space.ts';
4
+ interface Props extends HTMLAttributes<HTMLElement> {
5
+ /**
6
+ * Space between items and between rows.
7
+ * @defaultValue `'sm'`
8
+ */
9
+ gap?: Gap | undefined;
10
+ /**
11
+ * Cross-axis alignment.
12
+ * @defaultValue `'center'`
13
+ */
14
+ align?: FlowAlign | undefined;
15
+ /** Main-axis distribution. */
16
+ justify?: FlowJustify | undefined;
17
+ /**
18
+ * The element. With `'ul'` / `'ol'`, children must be `<li>`s.
19
+ * @defaultValue `'div'`
20
+ */
21
+ as?: FlowElement | undefined;
22
+ children: Snippet<[]>;
23
+ }
24
+ /** Inline items that wrap onto new lines with a token gap: a row of tags or buttons. */
25
+ declare const Cluster: import("svelte").Component<Props, {}, "">;
26
+ type Cluster = ReturnType<typeof Cluster>;
27
+ export default Cluster;
@@ -0,0 +1,50 @@
1
+ <!-- @component
2
+ The two-column detail-page shell: a header across the top, a body column and a summary aside.
3
+ -->
4
+ <!--
5
+ DetailLayout — the two-column detail-page shell: a header across the top, a
6
+ body column, and a summary aside beside it.
7
+
8
+ The reflow is the whole point. On a wide viewport the aside sits to the
9
+ RIGHT of the body (a third of the width, the Wikipedia infobox position); on
10
+ a phone there is no beside, and the useful order is title → aside → body,
11
+ because the aside is the facts-at-a-glance block and a reader who has to
12
+ scroll past the whole article to reach it will never reach it. That is done
13
+ by putting the aside BEFORE the body in the column flow (`order-first`) and
14
+ overriding to explicit grid placement from `lg` — not by rendering it twice,
15
+ which would duplicate every id and every heading in the accessibility tree.
16
+
17
+ ARIA contract: the aside is an `<aside aria-label>` — a `complementary`
18
+ landmark, which is exactly what it is: content related to the page's main
19
+ content and meaningful on its own. It is named because a landmark a reader
20
+ cannot tell apart from another landmark is a landmark they will not use.
21
+ `header` is a snippet rather than a set of title/subtitle props: it takes a
22
+ `PageHeader`, which already owns the heading contract.
23
+
24
+ This renders no `<main>`. It is placed INSIDE `Main` by the page, because a
25
+ page that is two columns of a wider shell must not open a second landmark.
26
+ `data-testid="detail-body"` / `"detail-infobox"` are carried over.
27
+ -->
28
+ <script lang="ts">let { header, body, aside, asideLabel = "Summary", class: className, ...rest } = $props();
29
+ export {};
30
+ </script>
31
+
32
+ <div {...rest} class={['space-y-8', className]}>
33
+ {@render header()}
34
+
35
+ <div class="flex flex-col gap-8 lg:grid lg:grid-cols-3 lg:items-start">
36
+ <div data-testid="detail-body" class="min-w-0 space-y-8 lg:col-span-2 lg:col-start-1 lg:row-start-1">
37
+ {@render body()}
38
+ </div>
39
+
40
+ {#if aside}
41
+ <aside
42
+ data-testid="detail-infobox"
43
+ aria-label={asideLabel}
44
+ class="order-first min-w-0 lg:order-none lg:col-start-3 lg:row-start-1"
45
+ >
46
+ {@render aside()}
47
+ </aside>
48
+ {/if}
49
+ </div>
50
+ </div>
@@ -0,0 +1,19 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ interface Props extends HTMLAttributes<HTMLDivElement> {
4
+ /** The page header block — normally a `PageHeader`. */
5
+ header: Snippet<[]>;
6
+ /** The main body column. */
7
+ body: Snippet<[]>;
8
+ /** The summary column — an infobox, a fact list, a map. */
9
+ aside?: Snippet<[]> | undefined;
10
+ /**
11
+ * Accessible name of the `<aside>` landmark.
12
+ * @defaultValue `'Summary'`
13
+ */
14
+ asideLabel?: string | undefined;
15
+ }
16
+ /** The two-column detail-page shell: a header across the top, a body column and a summary aside. */
17
+ declare const DetailLayout: import("svelte").Component<Props, {}, "">;
18
+ type DetailLayout = ReturnType<typeof DetailLayout>;
19
+ export default DetailLayout;
@@ -0,0 +1,40 @@
1
+ <!-- @component
2
+ The row of filter options above a list, as links rather than a form.
3
+ -->
4
+ <!--
5
+ FilterBar — the row of filter options above a list, as links rather than a
6
+ form.
7
+
8
+ Links, deliberately: a filtered view is then a URL an operator can bookmark,
9
+ paste into a message, or reload — which a `<select>` that mutates client
10
+ state is not. `href` is supplied per option by the page, because a cursor,
11
+ a sort order and a search term all have to travel with the filter and only
12
+ the page knows what the rest of its query string is.
13
+
14
+ `active` is the caller's to decide for the same reason: only the page knows
15
+ which axis this row filters on.
16
+
17
+ ARIA contract: a `<nav aria-label>` — each surface filters on a different
18
+ axis ("Filter by status", "Filter by licence") and an unnamed second
19
+ navigation landmark on a page is one a reader cannot tell from the first.
20
+ The active option carries `aria-current="page"` as well as daisyUI's
21
+ `btn-active`, because the highlight is a colour and the attribute is what
22
+ says so out loud. The options are anchors, not buttons, so the `btn` class
23
+ here is a costume, not a role.
24
+ -->
25
+ <script lang="ts">import { getComponentsContext } from "../context.svelte.js";
26
+ let { options, label, class: className, ...rest } = $props();
27
+ const context = getComponentsContext();
28
+ </script>
29
+
30
+ <nav {...rest} aria-label={label} class={['flex flex-wrap items-center gap-2', className]}>
31
+ {#each options as option (option.key)}
32
+ <a
33
+ href={context.href(option.href)}
34
+ class={['btn btn-sm', option.active && 'btn-active']}
35
+ aria-current={option.active ? 'page' : undefined}
36
+ >
37
+ {option.label}
38
+ </a>
39
+ {/each}
40
+ </nav>
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ import type { FilterOption } from './types.ts';
3
+ interface Props extends HTMLAttributes<HTMLElement> {
4
+ /** The filters; the current one gets `aria-current`. */
5
+ options: readonly FilterOption[];
6
+ /** Accessible name for the row — say which axis it filters on. */
7
+ label: string;
8
+ }
9
+ /** The row of filter options above a list, as links rather than a form. */
10
+ declare const FilterBar: import("svelte").Component<Props, {}, "">;
11
+ type FilterBar = ReturnType<typeof FilterBar>;
12
+ export default FilterBar;
@@ -0,0 +1,27 @@
1
+ <!-- @component
2
+ Shows the first of several layouts that fits its container, switching at declared container widths (CSS container queries, no JavaScript).
3
+ -->
4
+ <!--
5
+ Fits — the model is SwiftUI's `ViewThatFits`: "the horizontal button row
6
+ if it fits, else the stacked one, else a menu". CSS cannot measure
7
+ content's intrinsic width, so, unlike SwiftUI, it switches at declared
8
+ container widths: `breakpoints[i]` is the width below which `layouts[i]`
9
+ stops fitting. It is an `@container`, so the switch follows the space the
10
+ component actually has, not the viewport.
11
+
12
+ A JavaScript-measuring mode (render all, measure, hide) was considered and
13
+ left out: it shifts layout after first paint and cannot agree with
14
+ server-rendered HTML.
15
+
16
+ Every layout is rendered; all but the active one are `display: none`, so
17
+ assistive technology meets exactly one copy of each control at any width.
18
+ -->
19
+ <script lang="ts">import { fitsLayoutClass } from "./space.js";
20
+ let { layouts, breakpoints, class: className, ...rest } = $props();
21
+ </script>
22
+
23
+ <div {...rest} class={['@container', className]}>
24
+ {#each layouts as layout, index (index)}
25
+ <div class={fitsLayoutClass(index, layouts.length, breakpoints)}>{@render layout()}</div>
26
+ {/each}
27
+ </div>
@@ -0,0 +1,13 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { type FitsBreakpoint } from './space.ts';
4
+ interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
5
+ /** Layouts in order of preference, widest first. */
6
+ layouts: readonly Snippet<[]>[];
7
+ /** Container width below which each layout stops fitting; one fewer than `layouts`, descending. */
8
+ breakpoints: readonly FitsBreakpoint[];
9
+ }
10
+ /** Shows the first of several layouts that fits its container, switching at declared container widths (CSS container queries, no JavaScript). */
11
+ declare const Fits: import("svelte").Component<Props, {}, "">;
12
+ type Fits = ReturnType<typeof Fits>;
13
+ export default Fits;
@@ -0,0 +1,46 @@
1
+ <!-- @component
2
+ The flex flow `VStack` and `HStack` share; internal, not exported.
3
+ -->
4
+ <!--
5
+ Flow — one template for both stacks, so their tokens, list semantics and
6
+ dividers cannot drift. No `reverse` option, deliberately: a visual order
7
+ that contradicts the DOM order breaks WCAG 1.3.2 (meaningful sequence).
8
+
9
+ `as="ul"` / `"ol"` adds `role="list"`: Safari drops list semantics from a
10
+ list styled `list-style: none`. Its children must be `<li>`s. `divider`
11
+ draws a rule between children (Tailwind's `divide-*`, on the borders
12
+ between siblings, never around them); it is decorative, like a
13
+ `Divider` with `decorative`, and adds nothing to the accessibility tree.
14
+ -->
15
+ <script lang="ts">import { alignClass, gapClass, justifyClass } from "./space.js";
16
+ let { direction, gap = "md", align, justify, divider = false, as = "div", children, class: className, ...rest } = $props();
17
+ const directionClass = {
18
+ vertical: "flex-col",
19
+ horizontal: "flex-row",
20
+ responsive: "flex-col sm:flex-row"
21
+ };
22
+ const dividerClass = {
23
+ vertical: "divide-base-300 divide-y",
24
+ horizontal: "divide-base-300 divide-x",
25
+ responsive: "divide-base-300 divide-y sm:divide-x sm:divide-y-0"
26
+ };
27
+ const list = $derived(as === "ul" || as === "ol");
28
+ </script>
29
+
30
+ <svelte:element
31
+ this={as}
32
+ {...rest}
33
+ role={list ? 'list' : rest.role}
34
+ class={[
35
+ 'flex',
36
+ directionClass[direction],
37
+ gapClass[gap],
38
+ align !== undefined && alignClass[align],
39
+ justify !== undefined && justifyClass[justify],
40
+ divider && dividerClass[direction],
41
+ list && 'list-none',
42
+ className,
43
+ ]}
44
+ >
45
+ {@render children()}
46
+ </svelte:element>
@@ -0,0 +1,16 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { type FlowAlign, type FlowElement, type FlowJustify, type Gap } from './space.ts';
4
+ interface Props extends HTMLAttributes<HTMLElement> {
5
+ direction: 'vertical' | 'horizontal' | 'responsive';
6
+ gap?: Gap | undefined;
7
+ align?: FlowAlign | undefined;
8
+ justify?: FlowJustify | undefined;
9
+ divider?: boolean | undefined;
10
+ as?: FlowElement | undefined;
11
+ children: Snippet<[]>;
12
+ }
13
+ /** The flex flow `VStack` and `HStack` share; internal, not exported. */
14
+ declare const Flow: import("svelte").Component<Props, {}, "">;
15
+ type Flow = ReturnType<typeof Flow>;
16
+ export default Flow;
@@ -0,0 +1,32 @@
1
+ <!-- @component
2
+ The site footer: a `contentinfo` landmark with columns of links and an optional aside for the brand and attribution notices.
3
+ -->
4
+ <!--
5
+ Footer — the site footer: a `contentinfo` landmark holding the columns of
6
+ links an app puts at the bottom of every page, and an optional `aside` for
7
+ the brand block and the attribution notices (a data licence, a copyright
8
+ line) that belong beside them rather than in them.
9
+
10
+ ARIA contract: `<footer>` at the top of the document is the `contentinfo`
11
+ landmark — the one a screen-reader user jumps to for "the small print".
12
+ There is one per page, so a footer INSIDE an `<article>` or a `<section>` is
13
+ not this component. `aside` renders first, which is where the attribution
14
+ block reads: the columns are navigation, and navigation should not be
15
+ preceded by nothing.
16
+
17
+ Structure only. The columns are the app's — typically `<nav>` blocks with a
18
+ `footer-title` heading each, which is what makes daisyUI's grid line up.
19
+ -->
20
+ <script lang="ts">let { children, aside, class: className, ...rest } = $props();
21
+ export {};
22
+ </script>
23
+
24
+ <footer
25
+ {...rest}
26
+ class={['footer sm:footer-horizontal bg-base-200 text-base-content mt-auto p-10', className]}
27
+ >
28
+ {#if aside}
29
+ <aside>{@render aside()}</aside>
30
+ {/if}
31
+ {@render children()}
32
+ </footer>
@@ -0,0 +1,12 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ interface Props extends HTMLAttributes<HTMLElement> {
4
+ /** The columns — `<nav>` blocks with `footer-title` headings. */
5
+ children: Snippet<[]>;
6
+ /** Brand and attribution block, rendered before the columns. */
7
+ aside?: Snippet<[]> | undefined;
8
+ }
9
+ /** The site footer: a `contentinfo` landmark with columns of links and an optional aside for the brand and attribution notices. */
10
+ declare const Footer: import("svelte").Component<Props, {}, "">;
11
+ type Footer = ReturnType<typeof Footer>;
12
+ export default Footer;
@@ -0,0 +1,23 @@
1
+ <!-- @component
2
+ A responsive grid sized by the narrowest an item may get, not by breakpoints.
3
+ -->
4
+ <!--
5
+ Grid — `repeat(auto-fill, minmax(<minItem>, 1fr))` (SwiftUI
6
+ `LazyVGrid(.adaptive(minimum:))`, Chakra `minChildWidth`): as many columns
7
+ as fit items at least `minItem` wide, so a card grid reflows by the space
8
+ it actually has, inside a sidebar or out. With `as="ul"` / `"ol"` it is a
9
+ list (`role="list"` restored; children `<li>`).
10
+ -->
11
+ <script lang="ts">import { gapClass, minItemClass } from "./space.js";
12
+ let { minItem = "md", gap = "md", as = "div", children, class: className, ...rest } = $props();
13
+ const list = $derived(as === "ul" || as === "ol");
14
+ </script>
15
+
16
+ <svelte:element
17
+ this={as}
18
+ {...rest}
19
+ role={list ? 'list' : rest.role}
20
+ class={['grid', minItemClass[minItem], gapClass[gap], list && 'list-none', className]}
21
+ >
22
+ {@render children()}
23
+ </svelte:element>
@@ -0,0 +1,26 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import { type FlowElement, type Gap, type MinItem } from './space.ts';
4
+ interface Props extends HTMLAttributes<HTMLElement> {
5
+ /**
6
+ * The narrowest an item gets before the grid drops a column: `xs` 10rem,
7
+ * `sm` 12rem, `md` 16rem, `lg` 20rem.
8
+ * @defaultValue `'md'`
9
+ */
10
+ minItem?: MinItem | undefined;
11
+ /**
12
+ * Space between items.
13
+ * @defaultValue `'md'`
14
+ */
15
+ gap?: Gap | undefined;
16
+ /**
17
+ * The element. With `'ul'` / `'ol'`, children must be `<li>`s.
18
+ * @defaultValue `'div'`
19
+ */
20
+ as?: FlowElement | undefined;
21
+ children: Snippet<[]>;
22
+ }
23
+ /** A responsive grid sized by the narrowest an item may get, not by breakpoints. */
24
+ declare const Grid: import("svelte").Component<Props, {}, "">;
25
+ type Grid = ReturnType<typeof Grid>;
26
+ export default Grid;
@@ -0,0 +1,12 @@
1
+ <!-- @component
2
+ A horizontal stack: children side by side, on the spacing scale; optionally a column below `sm`.
3
+ -->
4
+ <!--
5
+ HStack — children in a row with a token gap (SwiftUI `HStack`, Compose `Row`). With `responsive`, a column on a narrow screen and a row from `sm` up. Tokens for gap and alignment come from `space.ts`, the
6
+ library's spacing scale. See `Flow` for the list and divider rules.
7
+ -->
8
+ <script lang="ts">import Flow from "./Flow.svelte";
9
+ let { responsive = false, ...props } = $props();
10
+ </script>
11
+
12
+ <Flow direction={responsive ? 'responsive' : 'horizontal'} {...props} />
@@ -0,0 +1,34 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { FlowAlign, FlowElement, FlowJustify, Gap } from './space.ts';
4
+ interface Props extends HTMLAttributes<HTMLElement> {
5
+ /**
6
+ * Stack vertically below the `sm` breakpoint.
7
+ * @defaultValue `false`
8
+ */
9
+ responsive?: boolean | undefined;
10
+ /**
11
+ * Space between children.
12
+ * @defaultValue `'md'`
13
+ */
14
+ gap?: Gap | undefined;
15
+ /** Cross-axis alignment. */
16
+ align?: FlowAlign | undefined;
17
+ /** Main-axis distribution. */
18
+ justify?: FlowJustify | undefined;
19
+ /**
20
+ * A decorative rule between children (never around them).
21
+ * @defaultValue `false`
22
+ */
23
+ divider?: boolean | undefined;
24
+ /**
25
+ * The element. With `'ul'` / `'ol'`, children must be `<li>`s.
26
+ * @defaultValue `'div'`
27
+ */
28
+ as?: FlowElement | undefined;
29
+ children: Snippet<[]>;
30
+ }
31
+ /** A horizontal stack: children side by side, on the spacing scale; optionally a column below `sm`. */
32
+ declare const HStack: import("svelte").Component<Props, {}, "">;
33
+ type HStack = ReturnType<typeof HStack>;
34
+ export default HStack;
@@ -0,0 +1,76 @@
1
+ <!-- @component
2
+ The large introductory block at the top of a landing or "about" page: a headline, supporting copy, calls to action, and an optional figure or background image, in daisyUI's `hero` styles.
3
+ -->
4
+ <!--
5
+ Hero — daisyUI's `hero` as a component: the top of a landing, marketing or
6
+ "about" page, where `PageHeader` is the top of an app page. It takes
7
+ arbitrary `children` rather than facts, which is why it is not a
8
+ `PageHeader` variant.
9
+
10
+ ARIA contract: the root is a `<section>` `aria-labelledby` its heading, so
11
+ it is a named region in the landmark list. The headline is a real heading
12
+ at `headingLevel`, `1` by default because a hero is normally the page's
13
+ title — a page with a `Hero` should not also render a `PageHeader` `<h1>`.
14
+ `actions` is a `role="group"` named by `actionsLabel`.
15
+
16
+ `backgroundImage` is decorative by definition, so it is a CSS
17
+ `background-image`, not an `<img>`: nothing enters the accessibility tree.
18
+ The copy over it sits on `hero-overlay` in `text-neutral-content`, so the
19
+ text keeps its contrast whatever the photo (WCAG 1.4.3). An image that
20
+ carries meaning belongs in `figure`, with alt text.
21
+ -->
22
+ <script lang="ts">let { title, headingLevel = 1, description, actions, actionsLabel = "Actions", figure, align, backgroundImage, children, class: className, style, ...rest } = $props();
23
+ const uid = $props.id();
24
+ const headingId = `${uid}-heading`;
25
+ const centred = $derived((align ?? (figure === undefined ? "center" : "start")) === "center");
26
+ const overlaid = $derived(backgroundImage !== undefined);
27
+ // `JSON.stringify` quotes the URL, so a value with parentheses or spaces
28
+ // cannot break out of `url(...)`.
29
+ const background = $derived(backgroundImage === undefined ? undefined : `background-image: url(${JSON.stringify(backgroundImage)});`);
30
+ export {};
31
+ </script>
32
+
33
+ {#snippet text(value: string | Snippet<[]>)}
34
+ {#if typeof value === 'string'}{value}{:else}{@render value()}{/if}
35
+ {/snippet}
36
+
37
+ <section
38
+ {...rest}
39
+ aria-labelledby={headingId}
40
+ style={[background, style].filter(Boolean).join(' ') || undefined}
41
+ class={['hero min-h-[50vh]', overlaid ? 'bg-cover bg-center' : 'bg-base-200', className]}
42
+ >
43
+ {#if overlaid}
44
+ <div class="hero-overlay bg-neutral/60"></div>
45
+ {/if}
46
+ <div
47
+ class={[
48
+ 'hero-content gap-8',
49
+ figure !== undefined && 'flex-col lg:flex-row',
50
+ centred && 'text-center',
51
+ overlaid && 'text-neutral-content',
52
+ ]}
53
+ >
54
+ <div class={['max-w-2xl space-y-5', centred && 'mx-auto']}>
55
+ <svelte:element
56
+ this={`h${headingLevel}`}
57
+ id={headingId}
58
+ class="text-4xl font-bold tracking-tight text-balance sm:text-5xl"
59
+ >
60
+ {@render text(title)}
61
+ </svelte:element>
62
+ {#if description !== undefined}
63
+ <p class={['text-lg leading-8', !overlaid && 'text-base-content/80']}>{@render text(description)}</p>
64
+ {/if}
65
+ {#if actions}
66
+ <div role="group" aria-label={actionsLabel} class={['flex flex-wrap gap-3', centred && 'justify-center']}>
67
+ {@render actions()}
68
+ </div>
69
+ {/if}
70
+ {#if children}<div>{@render children()}</div>{/if}
71
+ </div>
72
+ {#if figure}
73
+ <div class="w-full max-w-md shrink-0">{@render figure()}</div>
74
+ {/if}
75
+ </div>
76
+ </section>
@@ -0,0 +1,36 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { HeadingLevel } from '../ui/tones.ts';
4
+ interface Props extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'children'> {
5
+ /** The headline: text, or a snippet for richer markup. */
6
+ title: string | Snippet<[]>;
7
+ /**
8
+ * The headline's level.
9
+ * @defaultValue `1`
10
+ */
11
+ headingLevel?: HeadingLevel | undefined;
12
+ /** Supporting copy under the headline. */
13
+ description?: string | Snippet<[]> | undefined;
14
+ /** The call-to-action row (`LinkButton`s), a group named by `actionsLabel`. */
15
+ actions?: Snippet<[]> | undefined;
16
+ /**
17
+ * Accessible name of the `actions` group.
18
+ * @defaultValue `'Actions'`
19
+ */
20
+ actionsLabel?: string | undefined;
21
+ /** A figure beside the copy; stacks under it on a phone. */
22
+ figure?: Snippet<[]> | undefined;
23
+ /**
24
+ * Where the copy aligns.
25
+ * @defaultValue `'start'` with a `figure`, `'center'` without
26
+ */
27
+ align?: 'start' | 'center' | undefined;
28
+ /** A decorative background image URL; the copy then sits on `hero-overlay` for contrast. */
29
+ backgroundImage?: string | undefined;
30
+ /** Extra content under the actions. */
31
+ children?: Snippet<[]> | undefined;
32
+ }
33
+ /** The large introductory block at the top of a landing or "about" page: a headline, supporting copy, calls to action, and an optional figure or background image, in daisyUI's `hero` styles. */
34
+ declare const Hero: import("svelte").Component<Props, {}, "">;
35
+ type Hero = ReturnType<typeof Hero>;
36
+ export default Hero;
@@ -0,0 +1,30 @@
1
+ <!-- @component
2
+ The page’s content column and the `<main>` landmark.
3
+ -->
4
+ <!--
5
+ Main — the page's content column, and the `<main>` landmark that names it.
6
+
7
+ Every app in the survey had a component called `Main` and none of them
8
+ rendered a `<main>`: each one was a `<section>`, because each was mounted
9
+ inside a shell that had already opened the real `<main>`. That is a correct
10
+ thing to want and a bad thing to leave implicit, so the element is a prop.
11
+ `as="main"` is the default because a page that needs a landmark and does not
12
+ get one is the failure that matters; `as="section"` is for the nested case.
13
+
14
+ ARIA contract: exactly one `<main>` per rendered page — the landmark a
15
+ screen-reader user jumps to with a single keystroke, and the target of a
16
+ skip link. There must never be two, which is what `as="section"` exists to
17
+ prevent. A `<section>` is a `region` landmark only when it has an accessible
18
+ name, so pass `aria-label`/`aria-labelledby` (spread through `rest`) when
19
+ the nested block is one worth jumping to, and nothing when it is not.
20
+ -->
21
+ <script lang="ts">let { as = "main", children, class: className, ...rest } = $props();
22
+ export {};
23
+ </script>
24
+
25
+ <!-- `min-w-0` is the one class worth imposing: a content column is nearly
26
+ always a flex or grid child, and without it a wide table or a long
27
+ unbroken URL inside pushes the whole layout sideways. -->
28
+ <svelte:element this={as} {...rest} class={['min-w-0', className]}>
29
+ {@render children()}
30
+ </svelte:element>