@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,38 @@
1
+ /**
2
+ * layout — page chrome: the landmarks a page is assembled from, and the
3
+ * blocks that sit inside them.
4
+ *
5
+ * The family is structure, never copy. Every one of these takes the app's
6
+ * content as snippets and owns only the element that carries the semantics —
7
+ * the `<main>` a reader jumps to, the named `<nav>`s, the `banner` and
8
+ * `contentinfo` at the two ends of the page, the `<section aria-labelledby>`
9
+ * a long page is cut into. Import from the package barrel rather than from
10
+ * here.
11
+ *
12
+ * Optional props are declared `T | undefined` for the reason `ui/`'s are: the
13
+ * workspace compiles with `exactOptionalPropertyTypes`, under which `prop?: T`
14
+ * rejects an explicitly passed `undefined` and a caller cannot forward its own
15
+ * optional prop straight through.
16
+ *
17
+ * @module
18
+ */
19
+ export { default as AppShell } from './AppShell.svelte';
20
+ export { default as Breadcrumbs } from './Breadcrumbs.svelte';
21
+ export { default as Cluster } from './Cluster.svelte';
22
+ export { default as DetailLayout } from './DetailLayout.svelte';
23
+ export { default as FilterBar } from './FilterBar.svelte';
24
+ export { default as Fits } from './Fits.svelte';
25
+ export { default as Footer } from './Footer.svelte';
26
+ export { default as Grid } from './Grid.svelte';
27
+ export { default as HStack } from './HStack.svelte';
28
+ export { default as Hero } from './Hero.svelte';
29
+ export { default as Main } from './Main.svelte';
30
+ export { default as Navbar } from './Navbar.svelte';
31
+ export { default as PageHeader } from './PageHeader.svelte';
32
+ export { default as Section } from './Section.svelte';
33
+ export { default as Sidebar } from './Sidebar.svelte';
34
+ export { default as Spacer } from './Spacer.svelte';
35
+ export { default as Tabs } from './Tabs.svelte';
36
+ export { default as VStack } from './VStack.svelte';
37
+ export * from "./space.js";
38
+ export * from "./types.js";
@@ -0,0 +1,44 @@
1
+ /**
2
+ * The library's spacing rhythm and the layout primitives' vocabulary, as
3
+ * literal class tables.
4
+ *
5
+ * `VStack`, `HStack`, `Cluster`, `Grid` and `Fits` take tokens, not class
6
+ * names, so every app spaces things on the same scale. Tailwind only
7
+ * generates classes it can see verbatim in source, so each step is spelled
8
+ * out once here and looked up (the `ui/tones.ts` discipline).
9
+ *
10
+ * @module
11
+ */
12
+ /** A step on the spacing scale. */
13
+ export type Gap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
14
+ /** Literal `gap-*` class per `Gap`; a lookup table so Tailwind's scanner sees every class. */
15
+ export declare const gapClass: Record<Gap, string>;
16
+ /** Cross-axis alignment of a stack's or cluster's items. */
17
+ export type FlowAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
18
+ /** Literal `items-*` class per `FlowAlign`; a lookup table so Tailwind's scanner sees every class. */
19
+ export declare const alignClass: Record<FlowAlign, string>;
20
+ /** Main-axis distribution of a stack's or cluster's items. */
21
+ export type FlowJustify = 'start' | 'center' | 'end' | 'between';
22
+ /** Literal `justify-*` class per `FlowJustify`; a lookup table so Tailwind's scanner sees every class. */
23
+ export declare const justifyClass: Record<FlowJustify, string>;
24
+ /** The narrowest an item of a `Grid` gets before the grid drops a column. */
25
+ export type MinItem = 'xs' | 'sm' | 'md' | 'lg';
26
+ /** Literal auto-fill column template per `MinItem`; a lookup table so Tailwind's scanner sees every class. */
27
+ export declare const minItemClass: Record<MinItem, string>;
28
+ /** The element a primitive renders. A list (`ul` / `ol`) takes `<li>` children. */
29
+ export type FlowElement = 'div' | 'ul' | 'ol' | 'section' | 'nav';
30
+ /** A container width at which a `Fits` layout stops fitting. */
31
+ export type FitsBreakpoint = '20rem' | '28rem' | '36rem' | '48rem' | '64rem';
32
+ /** Literal container-query class showing a `Fits` layout from this width up. */
33
+ export declare const fitsShowFrom: Record<FitsBreakpoint, string>;
34
+ /** Literal container-query class hiding a `Fits` layout from this width up. */
35
+ export declare const fitsHideFrom: Record<FitsBreakpoint, string>;
36
+ /**
37
+ * The classes of `Fits` layout `index` of `count`, given the widths at which
38
+ * each stops fitting (`breakpoints[i]` for layout `i`, one fewer than the
39
+ * layouts). The first shows from `breakpoints[0]` up, each next one between
40
+ * its own breakpoint and the previous one, and the last below the final
41
+ * breakpoint. Outside its band a layout is `display: none`, so it is out of
42
+ * the accessibility tree.
43
+ */
44
+ export declare function fitsLayoutClass(index: number, count: number, breakpoints: readonly FitsBreakpoint[]): string[];
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The library's spacing rhythm and the layout primitives' vocabulary, as
3
+ * literal class tables.
4
+ *
5
+ * `VStack`, `HStack`, `Cluster`, `Grid` and `Fits` take tokens, not class
6
+ * names, so every app spaces things on the same scale. Tailwind only
7
+ * generates classes it can see verbatim in source, so each step is spelled
8
+ * out once here and looked up (the `ui/tones.ts` discipline).
9
+ *
10
+ * @module
11
+ */
12
+ /** Literal `gap-*` class per `Gap`; a lookup table so Tailwind's scanner sees every class. */
13
+ export const gapClass = {
14
+ none: 'gap-0',
15
+ xs: 'gap-1',
16
+ sm: 'gap-2',
17
+ md: 'gap-4',
18
+ lg: 'gap-8',
19
+ xl: 'gap-12',
20
+ };
21
+ /** Literal `items-*` class per `FlowAlign`; a lookup table so Tailwind's scanner sees every class. */
22
+ export const alignClass = {
23
+ start: 'items-start',
24
+ center: 'items-center',
25
+ end: 'items-end',
26
+ stretch: 'items-stretch',
27
+ baseline: 'items-baseline',
28
+ };
29
+ /** Literal `justify-*` class per `FlowJustify`; a lookup table so Tailwind's scanner sees every class. */
30
+ export const justifyClass = {
31
+ start: 'justify-start',
32
+ center: 'justify-center',
33
+ end: 'justify-end',
34
+ between: 'justify-between',
35
+ };
36
+ /** Literal auto-fill column template per `MinItem`; a lookup table so Tailwind's scanner sees every class. */
37
+ export const minItemClass = {
38
+ xs: 'grid-cols-[repeat(auto-fill,minmax(min(10rem,100%),1fr))]',
39
+ sm: 'grid-cols-[repeat(auto-fill,minmax(min(12rem,100%),1fr))]',
40
+ md: 'grid-cols-[repeat(auto-fill,minmax(min(16rem,100%),1fr))]',
41
+ lg: 'grid-cols-[repeat(auto-fill,minmax(min(20rem,100%),1fr))]',
42
+ };
43
+ /** Literal container-query class showing a `Fits` layout from this width up. */
44
+ export const fitsShowFrom = {
45
+ '20rem': '@min-[20rem]:block',
46
+ '28rem': '@min-[28rem]:block',
47
+ '36rem': '@min-[36rem]:block',
48
+ '48rem': '@min-[48rem]:block',
49
+ '64rem': '@min-[64rem]:block',
50
+ };
51
+ /** Literal container-query class hiding a `Fits` layout from this width up. */
52
+ export const fitsHideFrom = {
53
+ '20rem': '@min-[20rem]:hidden',
54
+ '28rem': '@min-[28rem]:hidden',
55
+ '36rem': '@min-[36rem]:hidden',
56
+ '48rem': '@min-[48rem]:hidden',
57
+ '64rem': '@min-[64rem]:hidden',
58
+ };
59
+ /**
60
+ * The classes of `Fits` layout `index` of `count`, given the widths at which
61
+ * each stops fitting (`breakpoints[i]` for layout `i`, one fewer than the
62
+ * layouts). The first shows from `breakpoints[0]` up, each next one between
63
+ * its own breakpoint and the previous one, and the last below the final
64
+ * breakpoint. Outside its band a layout is `display: none`, so it is out of
65
+ * the accessibility tree.
66
+ */
67
+ export function fitsLayoutClass(index, count, breakpoints) {
68
+ const own = breakpoints[index];
69
+ const previous = index === 0 ? undefined : breakpoints[index - 1];
70
+ const isLast = index === count - 1;
71
+ return [
72
+ isLast ? 'block' : 'hidden',
73
+ !isLast && own !== undefined ? fitsShowFrom[own] : '',
74
+ previous === undefined ? '' : fitsHideFrom[previous],
75
+ ].filter((name) => name !== '');
76
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The vocabulary the `layout/` family's list-shaped props are written in, and
3
+ * the literal daisyUI class tables its variants look up.
4
+ *
5
+ * The tables are local to this family rather than added to `ui/tones.ts`
6
+ * because `tabs-*` is a layout word: no `ui/` component renders a tab strip,
7
+ * and a table nobody outside one family reads is a table that belongs beside
8
+ * that family. The reason they are tables at all is the repo-wide one —
9
+ * Tailwind generates only the classes it can see verbatim in source, so a
10
+ * `tabs-${variant}` template string emits no CSS whatsoever.
11
+ *
12
+ * @module
13
+ */
14
+ import type { Size } from '../ui/tones.ts';
15
+ /** One step of a {@link Breadcrumbs} trail. */
16
+ export interface Crumb {
17
+ readonly label: string;
18
+ /**
19
+ * Where the crumb points. The TRAILING crumb is rendered as text whether or
20
+ * not it carries one — it is the page you are already on.
21
+ */
22
+ readonly href?: string | undefined;
23
+ }
24
+ /** One entry of a {@link Tabs} strip, in either mode. */
25
+ export interface TabItem {
26
+ /** Stable key, and the value `Tabs` selects on in `panels` mode. */
27
+ readonly value: string;
28
+ readonly label: string;
29
+ /** The route, in `links` mode. Ignored by `panels`. */
30
+ readonly href?: string | undefined;
31
+ readonly disabled?: boolean | undefined;
32
+ }
33
+ /** One option of a {@link FilterBar}. */
34
+ export interface FilterOption {
35
+ /** Stable key for the keyed `{#each}`. */
36
+ readonly key: string;
37
+ readonly label: string;
38
+ readonly href: string;
39
+ /**
40
+ * Whether this option is the view currently shown. The caller's to decide:
41
+ * only the page knows which axis the row is filtering on.
42
+ */
43
+ readonly active: boolean;
44
+ }
45
+ /** `panels` is a tab widget; `links` is navigation between sibling routes. */
46
+ export type TabsMode = 'panels' | 'links';
47
+ /** The three daisyUI tab treatments. */
48
+ export type TabsVariant = 'border' | 'box' | 'lift';
49
+ /** Literal daisyUI class per `TabsVariant` for `Tabs`; a lookup table so Tailwind's scanner sees every class. */
50
+ export declare const tabsVariant: Record<TabsVariant, string>;
51
+ /** Literal daisyUI class per `Size` for `Tabs`; a lookup table so Tailwind's scanner sees every class. */
52
+ export declare const tabsSize: Record<Size, string>;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The vocabulary the `layout/` family's list-shaped props are written in, and
3
+ * the literal daisyUI class tables its variants look up.
4
+ *
5
+ * The tables are local to this family rather than added to `ui/tones.ts`
6
+ * because `tabs-*` is a layout word: no `ui/` component renders a tab strip,
7
+ * and a table nobody outside one family reads is a table that belongs beside
8
+ * that family. The reason they are tables at all is the repo-wide one —
9
+ * Tailwind generates only the classes it can see verbatim in source, so a
10
+ * `tabs-${variant}` template string emits no CSS whatsoever.
11
+ *
12
+ * @module
13
+ */
14
+ /** Literal daisyUI class per `TabsVariant` for `Tabs`; a lookup table so Tailwind's scanner sees every class. */
15
+ export const tabsVariant = {
16
+ border: 'tabs-border',
17
+ box: 'tabs-box',
18
+ lift: 'tabs-lift',
19
+ };
20
+ /** Literal daisyUI class per `Size` for `Tabs`; a lookup table so Tailwind's scanner sees every class. */
21
+ export const tabsSize = {
22
+ xs: 'tabs-xs',
23
+ sm: 'tabs-sm',
24
+ md: 'tabs-md',
25
+ lg: 'tabs-lg',
26
+ xl: 'tabs-xl',
27
+ };
@@ -0,0 +1,28 @@
1
+ <!-- @component
2
+ The "About: Rosa canina, Bed 4" row under a piece of content: a leading label, then a link per subject.
3
+ -->
4
+ <!--
5
+ ContextLinks — the "About: Rosa canina, Bed 4" row under a piece of content:
6
+ a leading label, then the things the content is about, each a link.
7
+
8
+ Renders NOTHING when there are no links — the common case, since most
9
+ content names no context, and an empty "About:" would be noise. Each href is
10
+ resolved through the components context, like every app-relative link here.
11
+
12
+ ARIA contract: a plain paragraph of links. The label is visible text read
13
+ before the links, so no `aria-label` is needed; each link's own text is its
14
+ accessible name.
15
+ -->
16
+ <script lang="ts">import { getComponentsContext } from "../context.svelte.js";
17
+ let { links, label = "About", class: className, ...rest } = $props();
18
+ const context = getComponentsContext();
19
+ </script>
20
+
21
+ {#if links.length > 0}
22
+ <p {...rest} class={['text-base-content/70 flex flex-wrap gap-x-3 gap-y-1 text-sm', className]}>
23
+ <span>{label}:</span>
24
+ {#each links as entry, index (index)}
25
+ <a class="link link-hover" href={context.href(entry.href)}>{entry.label}</a>
26
+ {/each}
27
+ </p>
28
+ {/if}
@@ -0,0 +1,20 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ /** One thing the content is about. */
3
+ export interface ContextLinkItem {
4
+ /** App-relative path, resolved through the components context. */
5
+ readonly href: string;
6
+ readonly label: string;
7
+ }
8
+ interface Props extends HTMLAttributes<HTMLParagraphElement> {
9
+ /** The subjects, each rendered as a link. */
10
+ links: readonly ContextLinkItem[];
11
+ /**
12
+ * The leading word, rendered as `"<label>:"`.
13
+ * @defaultValue `'About'`
14
+ */
15
+ label?: string | undefined;
16
+ }
17
+ /** The "About: Rosa canina, Bed 4" row under a piece of content: a leading label, then a link per subject. */
18
+ declare const ContextLinks: import("svelte").Component<Props, {}, "">;
19
+ type ContextLinks = ReturnType<typeof ContextLinks>;
20
+ export default ContextLinks;
@@ -0,0 +1,26 @@
1
+ <!-- @component
2
+ A `mailto:` link whose subject, body, cc and bcc are correctly encoded.
3
+ -->
4
+ <!--
5
+ EmailLink — a `mailto:` anchor, its query string (`subject`/`body`/`cc`/
6
+ `bcc`) built with `URLSearchParams` so every value is correctly encoded.
7
+
8
+ ARIA contract: none beyond the native `<a>` — the visible text (the address
9
+ by default, or `children` when given) is the accessible name.
10
+ -->
11
+ <script lang="ts">let { email, subject, body, cc, bcc, children, class: className, ...rest } = $props();
12
+ const href = $derived.by(() => {
13
+ const params = new URLSearchParams();
14
+ if (subject) params.set("subject", subject);
15
+ if (body) params.set("body", body);
16
+ if (cc) params.set("cc", cc);
17
+ if (bcc) params.set("bcc", bcc);
18
+ const query = params.toString();
19
+ return `mailto:${email}${query ? `?${query}` : ""}`;
20
+ });
21
+ export {};
22
+ </script>
23
+
24
+ <a {...rest} {href} class={['link link-primary link-hover', className]}>
25
+ {#if children}{@render children()}{:else}{email}{/if}
26
+ </a>
@@ -0,0 +1,20 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
3
+ interface Props extends Omit<HTMLAnchorAttributes, 'children'> {
4
+ /** The address; also the link text unless `children` replaces it. */
5
+ email: string;
6
+ /** Pre-filled subject line. */
7
+ subject?: string | undefined;
8
+ /** Pre-filled message body. */
9
+ body?: string | undefined;
10
+ /** Address to copy. */
11
+ cc?: string | undefined;
12
+ /** Address to blind-copy. */
13
+ bcc?: string | undefined;
14
+ /** Replaces the link text; defaults to the address itself. */
15
+ children?: Snippet<[]> | undefined;
16
+ }
17
+ /** A `mailto:` link whose subject, body, cc and bcc are correctly encoded. */
18
+ declare const EmailLink: import("svelte").Component<Props, {}, "">;
19
+ type EmailLink = ReturnType<typeof EmailLink>;
20
+ export default EmailLink;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * links — see the package README for the family reference.
3
+ *
4
+ * @module
5
+ */
6
+ export { default as EmailLink } from './EmailLink.svelte';
7
+ export { default as ContextLinks, type ContextLinkItem } from './ContextLinks.svelte';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * links — see the package README for the family reference.
3
+ *
4
+ * @module
5
+ */
6
+ export { default as EmailLink } from './EmailLink.svelte';
7
+ export { default as ContextLinks } from './ContextLinks.svelte';
@@ -0,0 +1,26 @@
1
+ <!-- @component
2
+ A `<figure>` with an optional `<figcaption>`, for media that needs a caption.
3
+ -->
4
+ <!--
5
+ Figure — a `<figure>` with an optional `<figcaption>`, for media that needs
6
+ a caption associated with it (an image, a video, a diagram).
7
+
8
+ ARIA contract: none beyond the native grouping — `<figure>`/`<figcaption>`
9
+ already associate the caption with its content for assistive technology.
10
+ -->
11
+ <script lang="ts">let { caption, children, class: className, ...rest } = $props();
12
+ export {};
13
+ </script>
14
+
15
+ <figure {...rest} class={className}>
16
+ {@render children()}
17
+ {#if caption}
18
+ <figcaption>
19
+ {#if typeof caption === 'string'}
20
+ {caption}
21
+ {:else}
22
+ {@render caption()}
23
+ {/if}
24
+ </figcaption>
25
+ {/if}
26
+ </figure>
@@ -0,0 +1,12 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ interface Props extends HTMLAttributes<HTMLElement> {
4
+ /** Rendered as `<figcaption>`; a plain string or a snippet for richer markup. */
5
+ caption?: string | Snippet<[]> | undefined;
6
+ /** The image, video or diagram the caption describes. */
7
+ children: Snippet<[]>;
8
+ }
9
+ /** A `<figure>` with an optional `<figcaption>`, for media that needs a caption. */
10
+ declare const Figure: import("svelte").Component<Props, {}, "">;
11
+ type Figure = ReturnType<typeof Figure>;
12
+ export default Figure;
@@ -0,0 +1,76 @@
1
+ <!-- @component
2
+ A responsive `<img>` from a URL or an uploaded image id, optionally wrapped in `<picture>`. `decoding` defaults to `'async'`.
3
+ -->
4
+ <!--
5
+ Image — a responsive `<img>`, optionally wrapped in `<picture>`.
6
+
7
+ Two ways to get a `srcset`: pass `src` directly for a plain image, or pass
8
+ `id` (+ optionally `base`/`widths`) for a width-bucketed rendition served
9
+ by an image-transform route (`${base}/${id}?w=${w}`). Requesting an arbitrary width
10
+ would defeat that bucketing (every distinct width is a distinct transform
11
+ and a distinct cache entry), so `widths` is a fixed list, not a free number.
12
+
13
+ `sources` adds art-direction / format-negotiation `<source>` elements ahead
14
+ of the `<img>` fallback, wrapping everything in `<picture>` — each source's
15
+ own `srcset` is the caller's (e.g. an AVIF/WebP rendition list), unrelated
16
+ to the `id`-bucketing above.
17
+
18
+ `width`/`height` reserve the box before the bytes arrive — the single most
19
+ visible layout-shift regression a media-heavy page can ship — so pass them
20
+ whenever they are known.
21
+
22
+ ARIA contract: `alt` is required and not defaulted — a caller with no
23
+ meaningful text must pass `""` (decorative) explicitly, which is a
24
+ different, deliberate claim from having forgotten it.
25
+ -->
26
+ <script lang="ts">const DEFAULT_WIDTHS = [
27
+ 320,
28
+ 640,
29
+ 960,
30
+ 1280,
31
+ 1920
32
+ ];
33
+ let { alt, src, id, base = "/images", widths = DEFAULT_WIDTHS, sources, width, height, sizes = "100vw", eager = false, decoding = "async", ...rest } = $props();
34
+ const bucketedHref = $derived(id === undefined ? undefined : `${base}/${id}`);
35
+ const bucketedSrcset = $derived(bucketedHref === undefined ? undefined : widths.map((w) => `${bucketedHref}?w=${w} ${w}w`).join(", "));
36
+ // The largest bucket as the plain `src`: the fallback a browser without
37
+ // `srcset` support (and every crawler) fetches.
38
+ const fallbackWidth = $derived(widths[widths.length - 1]);
39
+ const resolvedSrc = $derived(src ?? (bucketedHref === undefined ? undefined : `${bucketedHref}?w=${fallbackWidth}`));
40
+ const loading = $derived(eager ? "eager" : "lazy");
41
+ const fetchpriority = $derived(eager ? "high" : undefined);
42
+ export {};
43
+ </script>
44
+
45
+ {#if sources && sources.length > 0}
46
+ <picture>
47
+ {#each sources as source (source.srcset)}
48
+ <source srcset={source.srcset} type={source.type} media={source.media} />
49
+ {/each}
50
+ <img
51
+ {...rest}
52
+ src={resolvedSrc}
53
+ srcset={bucketedSrcset}
54
+ {sizes}
55
+ {alt}
56
+ {width}
57
+ {height}
58
+ {loading}
59
+ {fetchpriority}
60
+ {decoding}
61
+ />
62
+ </picture>
63
+ {:else}
64
+ <img
65
+ {...rest}
66
+ src={resolvedSrc}
67
+ srcset={bucketedSrcset}
68
+ {sizes}
69
+ {alt}
70
+ {width}
71
+ {height}
72
+ {loading}
73
+ {fetchpriority}
74
+ {decoding}
75
+ />
76
+ {/if}
@@ -0,0 +1,41 @@
1
+ import type { HTMLImgAttributes } from 'svelte/elements';
2
+ interface ImageSource {
3
+ srcset: string;
4
+ type?: string | undefined;
5
+ media?: string | undefined;
6
+ }
7
+ interface Props extends HTMLImgAttributes {
8
+ /** Alternative text; `''` only where the image is decoration. */
9
+ alt: string;
10
+ /** A plain image URL. Mutually exclusive with `id`; `src` wins if both are given. */
11
+ src?: string | undefined;
12
+ /** An uploaded image's id — combined with `base`/`widths` into a bucketed `srcset`. */
13
+ id?: string | undefined;
14
+ /**
15
+ * Route prefix the bucketed rendition lives under.
16
+ * @defaultValue `'/images'`
17
+ */
18
+ base?: string | undefined;
19
+ /**
20
+ * The width buckets the transform route serves. Must match its own list.
21
+ * @defaultValue `[320, 640, 960, 1280, 1920]`
22
+ */
23
+ widths?: readonly number[] | undefined;
24
+ /** Extra `<source>` elements (art direction / format negotiation) ahead of the `<img>` fallback. Wraps everything in `<picture>`. */
25
+ sources?: readonly ImageSource[] | undefined;
26
+ /** Intrinsic width; reserves the box against layout shift. */
27
+ width?: number | string | undefined;
28
+ /** Intrinsic height; reserves the box against layout shift. */
29
+ height?: number | string | undefined;
30
+ /**
31
+ * The `sizes` hint.
32
+ * @defaultValue `'100vw'`
33
+ */
34
+ sizes?: string | undefined;
35
+ /** Eager-load this image. Use for the one image above the fold; everything else stays lazy. */
36
+ eager?: boolean | undefined;
37
+ }
38
+ /** A responsive `<img>` from a URL or an uploaded image id, optionally wrapped in `<picture>`. `decoding` defaults to `'async'`. */
39
+ declare const Image: import("svelte").Component<Props, {}, "">;
40
+ type Image = ReturnType<typeof Image>;
41
+ export default Image;
@@ -0,0 +1,65 @@
1
+ <!-- @component
2
+ An HLS video player (Cloudflare Stream shape) with a placeholder while the upload is still pending or processing.
3
+ -->
4
+ <!--
5
+ Video — the player for an HLS-served video (Cloudflare Stream shape:
6
+ manifest URL + poster + an upload lifecycle).
7
+
8
+ Deliberately a plain `<video>` with the HLS manifest as its source and the
9
+ generated thumbnail as its poster. That plays natively in Safari and on
10
+ iOS; everywhere else it needs an MSE shim (e.g. hls.js), which is an
11
+ app-side concern and stays out of this package — it is a real dependency
12
+ weight that must never land in the always-loaded closure of a package every
13
+ page imports. A caller that wants universal playback attaches the shim to
14
+ the element handed to `onReady`.
15
+
16
+ While the upload is still pending/processing there is no manifest at all,
17
+ so the component renders the poster (or a neutral placeholder) with the
18
+ state spelled out via `statusLabel` rather than an empty player that
19
+ silently fails.
20
+
21
+ ARIA contract: `title` is the player's accessible name (`aria-label`); the
22
+ non-playable placeholder's `statusLabel` is a `badge-neutral`, visible text,
23
+ not conveyed through colour alone.
24
+ -->
25
+ <script lang="ts">let { hlsUrl, posterUrl, title, width, height, uploadState = "ready", statusLabel, onReady, captionsSrc, class: className } = $props();
26
+ let element = $state();
27
+ const playable = $derived(uploadState === "ready" && hlsUrl !== undefined);
28
+ $effect(() => {
29
+ if (element && playable) onReady?.(element);
30
+ });
31
+ </script>
32
+
33
+ <div class={['bg-base-200 rounded-box overflow-hidden', className]}>
34
+ {#if playable}
35
+ <video
36
+ bind:this={element}
37
+ controls
38
+ preload="none"
39
+ poster={posterUrl}
40
+ {width}
41
+ {height}
42
+ aria-label={title}
43
+ class="aspect-video h-auto w-full max-w-full"
44
+ >
45
+ <source src={hlsUrl} type="application/x-mpegURL" />
46
+ {#if captionsSrc}
47
+ <track kind="captions" src={captionsSrc} />
48
+ {:else}
49
+ <!-- A `<track>` is required for a caption-less video to be valid; an
50
+ empty default track is the honest statement that none exists yet,
51
+ rather than silently shipping a video with no captions option. -->
52
+ <track kind="captions" />
53
+ {/if}
54
+ </video>
55
+ {:else}
56
+ <div class="aspect-video relative flex w-full items-center justify-center">
57
+ {#if posterUrl}
58
+ <img src={posterUrl} alt="" class="h-full w-full object-cover opacity-60" />
59
+ {/if}
60
+ {#if statusLabel}
61
+ <span class="badge badge-neutral absolute">{statusLabel}</span>
62
+ {/if}
63
+ </div>
64
+ {/if}
65
+ </div>
@@ -0,0 +1,29 @@
1
+ interface Props {
2
+ /** The HLS manifest URL; absent until the encode finishes. */
3
+ hlsUrl?: string | undefined;
4
+ /** The poster frame. */
5
+ posterUrl?: string | undefined;
6
+ /** Accessible name for the player. */
7
+ title: string;
8
+ /** Intrinsic dimensions, when known — reserves the box against layout shift. */
9
+ width?: number | undefined;
10
+ /** Intrinsic height, when known. */
11
+ height?: number | undefined;
12
+ /**
13
+ * Where the upload is in its lifecycle.
14
+ * @defaultValue `'ready'`
15
+ */
16
+ uploadState?: 'pending' | 'processing' | 'ready' | 'failed' | undefined;
17
+ /** Copy for the non-playable placeholder state, supplied by the app (this package holds no messages). */
18
+ statusLabel?: string | undefined;
19
+ /** Called with the mounted `<video>` element once it is playable, for a caller attaching an MSE shim. */
20
+ onReady?: ((element: HTMLVideoElement) => void) | undefined;
21
+ /** A captions track URL (WebVTT). When absent, an empty track is still rendered — see below. */
22
+ captionsSrc?: string | undefined;
23
+ /** Extra classes, merged last. */
24
+ class?: string | undefined;
25
+ }
26
+ /** An HLS video player (Cloudflare Stream shape) with a placeholder while the upload is still pending or processing. */
27
+ declare const Video: import("svelte").Component<Props, {}, "">;
28
+ type Video = ReturnType<typeof Video>;
29
+ export default Video;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Reading an image file's intrinsic pixel dimensions in the browser.
3
+ *
4
+ * A form that uploads an image wants its `width` / `height` alongside the
5
+ * binary, so the page that later renders it can reserve the box on first
6
+ * paint instead of reflowing when it loads — and the browser can decode the
7
+ * file for free the moment it is chosen, where a server would have to.
8
+ * `fields/ImageInput` measures with this; a caller with its own file control
9
+ * uses it directly.
10
+ *
11
+ * @module
12
+ */
13
+ /** An image's intrinsic size, in pixels. */
14
+ export interface ImageDimensions {
15
+ readonly width: number;
16
+ readonly height: number;
17
+ }
18
+ /** Thrown by {@link imageDimensions} where there is no `createImageBitmap` (on a server). */
19
+ export declare class ImageDimensionsUnavailable extends Error {
20
+ readonly name = "ImageDimensionsUnavailable";
21
+ }
22
+ /**
23
+ * Decode `file` with `createImageBitmap` and return its pixel size.
24
+ *
25
+ * Rejects with {@link ImageDimensionsUnavailable} outside a browser, and with
26
+ * the browser's own error when the file does not decode as an image.
27
+ */
28
+ export declare function imageDimensions(file: Blob): Promise<ImageDimensions>;