@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,10 @@
1
+ /**
2
+ * `@thomasfosterau/components/charts` — one component, over a declarative
3
+ * series spec, drawn as plain SVG.
4
+ *
5
+ * A separate entry point so it never sits on the always-loaded path of a
6
+ * consumer that does not use it.
7
+ *
8
+ * @module
9
+ */
10
+ export { default as Chart } from './Chart.svelte';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The shapes `Chart` renders.
3
+ *
4
+ * @module @thomasfosterau/components/charts/types
5
+ */
6
+ /** One observation: a category (or ordered period) and its magnitude. */
7
+ export interface ChartPoint {
8
+ /** The x-axis tick, already localised by the caller. */
9
+ readonly label: string;
10
+ readonly value: number;
11
+ }
12
+ /**
13
+ * One series. `key` is stable identity, and identity is what picks the colour —
14
+ * so a filter that removes a series never repaints the survivors.
15
+ */
16
+ export interface ChartSeries {
17
+ readonly key: string;
18
+ /** The legend entry and the direct label, already localised. */
19
+ readonly label: string;
20
+ /**
21
+ * The points, in x order, one per category. Every series shares the first
22
+ * series' categories: a chart whose series disagree about the x axis is two
23
+ * charts.
24
+ */
25
+ readonly points: readonly ChartPoint[];
26
+ }
27
+ /** How a `Chart` draws its values: as a line, a filled area, or bars. */
28
+ export type ChartKind = 'line' | 'area' | 'bar';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The shapes `Chart` renders.
3
+ *
4
+ * @module @thomasfosterau/components/charts/types
5
+ */
6
+ export {};
@@ -0,0 +1,53 @@
1
+ <!-- @component
2
+ One book as a compact author–date reference with Schema.org `Book` microdata.
3
+ -->
4
+ <!--
5
+ BookCitation — one book as a compact author–date reference with Schema.org
6
+ microdata: "Le Guin, <cite>The Left Hand of Darkness</cite> (3rd edition:
7
+ 1969) Hainish Cycle New York: Ace Books pp 304".
8
+
9
+ Every arm is optional and independently absent: a record that carries only
10
+ a title renders only a title (and "no date"). Contributors are RESOLVED
11
+ credits in credit order (`CreditList`), never re-sorted. The record type is
12
+ local — see `./csl.ts` for why and what it will align with.
13
+
14
+ Every string is a prop with an English default.
15
+ -->
16
+ <script lang="ts">import Year from "../formatting/Year.svelte";
17
+ import CreditList from "./CreditList.svelte";
18
+ import ISBNLink from "./ISBNLink.svelte";
19
+ import Publisher from "./Publisher.svelte";
20
+ let { book, itemprop, untitledLabel = "Untitled book", noDateLabel = "no date", editionLabel = (edition) => `${edition} edition`, pageCountLabel = "pp", availableOnlineLabel = "available online at", locales } = $props();
21
+ const authors = $derived(book.authors ?? []);
22
+ </script>
23
+
24
+ <span {itemprop} itemscope itemtype="https://schema.org/Book">
25
+ {#if authors.length > 0}
26
+ <CreditList credits={authors} role="author" {locales} />,
27
+ {/if}
28
+ <cite itemprop="name">{book.title ?? untitledLabel}</cite>
29
+ <CreditList credits={book.editors ?? []} role="editor" {locales} />
30
+ <CreditList credits={book.translators ?? []} role="translator" {locales} />
31
+ ({#if book.edition !== undefined}{editionLabel(book.edition)}:{' '}{/if}{#if book.datePublished !== undefined}<Year
32
+ value={book.datePublished}
33
+ itemprop="datePublished"
34
+ {locales}
35
+ />{:else}{noDateLabel}{/if})
36
+ {#if book.series !== undefined}
37
+ <span itemprop="isPartOf" itemscope itemtype="https://schema.org/BookSeries">
38
+ <cite class="italic" itemprop="name">{book.series.name}</cite>
39
+ </span>
40
+ {/if}
41
+ {#if book.publisher !== undefined}
42
+ <Publisher publisher={book.publisher} />
43
+ {/if}
44
+ {#if book.numberOfPages !== undefined}
45
+ {pageCountLabel} <span itemprop="numberOfPages">{book.numberOfPages}</span>
46
+ {/if}
47
+ {#if book.url !== undefined}
48
+ {availableOnlineLabel} <a itemprop="url" href={book.url}>{book.url}</a>
49
+ {/if}
50
+ {#if book.isbn !== undefined}
51
+ <ISBNLink isbn={book.isbn} itemprop="isbn" />
52
+ {/if}
53
+ </span>
@@ -0,0 +1,41 @@
1
+ import type { BookRecord } from './csl.ts';
2
+ interface Props {
3
+ /** The book record; absent fields are left out of the rendering. */
4
+ book: BookRecord;
5
+ /** Microdata `itemprop` on the root, when this book is itself a property (a chapter's `isPartOf`). */
6
+ itemprop?: string | undefined;
7
+ /**
8
+ * Rendered in place of a missing title.
9
+ * @defaultValue `'Untitled book'`
10
+ */
11
+ untitledLabel?: string | undefined;
12
+ /**
13
+ * Rendered in place of a missing date.
14
+ * @defaultValue `'no date'`
15
+ */
16
+ noDateLabel?: string | undefined;
17
+ /**
18
+ * How an edition is named.
19
+ * @defaultValue `"<edition> edition"`
20
+ */
21
+ editionLabel?: ((edition: string) => string) | undefined;
22
+ /**
23
+ * Abbreviation after a page count.
24
+ * @defaultValue `'pp'`
25
+ */
26
+ pageCountLabel?: string | undefined;
27
+ /**
28
+ * Lead-in before the record’s URL.
29
+ * @defaultValue `'available online at'`
30
+ */
31
+ availableOnlineLabel?: string | undefined;
32
+ /**
33
+ * Locale(s) for the joined name lists.
34
+ * @defaultValue the components context's `locale()`
35
+ */
36
+ locales?: string | readonly string[] | undefined;
37
+ }
38
+ /** One book as a compact author–date reference with Schema.org `Book` microdata. */
39
+ declare const BookCitation: import("svelte").Component<Props, {}, "">;
40
+ type BookCitation = ReturnType<typeof BookCitation>;
41
+ export default BookCitation;
@@ -0,0 +1,38 @@
1
+ <!-- @component
2
+ A chapter as "Author, ‘Chapter title’, in <book> ch 4 (pp 101–130)", with Schema.org `Chapter` microdata.
3
+ -->
4
+ <!--
5
+ ChapterCitation — a chapter as "Author, 'Chapter title', in <BookCitation>
6
+ ch 4 (pp 101–130)", with Schema.org Chapter microdata. When the record
7
+ carries its containing `book`, that book is cited in full, nested under
8
+ `isPartOf`; a chapter cited on its own renders without it.
9
+
10
+ The record type is local — see `./csl.ts`. Every string is a prop with an
11
+ English default; the book's own labels are forwarded to the nested citation.
12
+ -->
13
+ <script lang="ts">import BookCitation from "./BookCitation.svelte";
14
+ import CreditList from "./CreditList.svelte";
15
+ let { chapter, untitledLabel = "Untitled chapter", inLabel = "in", chapterLabel = "ch", pageLabel = "p", pagesLabel = "pp", locales, bookLabels = {} } = $props();
16
+ const authors = $derived(chapter.authors ?? []);
17
+ </script>
18
+
19
+ <span itemscope itemtype="https://schema.org/Chapter">
20
+ {#if authors.length > 0}
21
+ <CreditList credits={authors} role="author" {locales} />,
22
+ {/if}
23
+ '<cite class="not-italic" itemprop="name">{chapter.title ?? untitledLabel}</cite>',
24
+ {#if chapter.book !== undefined}
25
+ {inLabel}
26
+ <BookCitation book={chapter.book} itemprop="isPartOf" {locales} {...bookLabels} />
27
+ {/if}
28
+ {#if chapter.chapterNumber !== undefined}
29
+ {chapterLabel} {chapter.chapterNumber}
30
+ {/if}
31
+ {#if chapter.pageStart !== undefined && chapter.pageEnd !== undefined}
32
+ ({pagesLabel} <span itemprop="pageStart">{chapter.pageStart}</span>–<span itemprop="pageEnd"
33
+ >{chapter.pageEnd}</span
34
+ >)
35
+ {:else if chapter.pageStart !== undefined}
36
+ ({pageLabel} <span itemprop="pageStart">{chapter.pageStart}</span>)
37
+ {/if}
38
+ </span>
@@ -0,0 +1,50 @@
1
+ import type { ChapterRecord } from './csl.ts';
2
+ interface Props {
3
+ /** The chapter to cite; its `book`, when present, is cited in full. */
4
+ chapter: ChapterRecord;
5
+ /**
6
+ * Rendered in place of a missing title.
7
+ * @defaultValue `'Untitled chapter'`
8
+ */
9
+ untitledLabel?: string | undefined;
10
+ /**
11
+ * The word before the containing book.
12
+ * @defaultValue `'in'`
13
+ */
14
+ inLabel?: string | undefined;
15
+ /**
16
+ * Abbreviation before a chapter number.
17
+ * @defaultValue `'ch'`
18
+ */
19
+ chapterLabel?: string | undefined;
20
+ /**
21
+ * Abbreviation before a single page.
22
+ * @defaultValue `'p'`
23
+ */
24
+ pageLabel?: string | undefined;
25
+ /**
26
+ * Abbreviation before a page range.
27
+ * @defaultValue `'pp'`
28
+ */
29
+ pagesLabel?: string | undefined;
30
+ /**
31
+ * Locale(s) for the joined name lists.
32
+ * @defaultValue the components context's `locale()`
33
+ */
34
+ locales?: string | readonly string[] | undefined;
35
+ /**
36
+ * Forwarded to the nested `BookCitation`.
37
+ * @defaultValue `{}`
38
+ */
39
+ bookLabels?: {
40
+ untitledLabel?: string | undefined;
41
+ noDateLabel?: string | undefined;
42
+ editionLabel?: ((edition: string) => string) | undefined;
43
+ pageCountLabel?: string | undefined;
44
+ availableOnlineLabel?: string | undefined;
45
+ } | undefined;
46
+ }
47
+ /** A chapter as "Author, ‘Chapter title’, in <book> ch 4 (pp 101–130)", with Schema.org `Chapter` microdata. */
48
+ declare const ChapterCitation: import("svelte").Component<Props, {}, "">;
49
+ type ChapterCitation = ReturnType<typeof ChapterCitation>;
50
+ export default ChapterCitation;
@@ -0,0 +1,47 @@
1
+ <!-- @component
2
+ An inline reference marker that registers its source with the surrounding bibliography and renders the number it was given.
3
+ -->
4
+ <!--
5
+ Citation — an inline reference marker that registers its source with the
6
+ surrounding bibliography and renders the number it was given.
7
+
8
+ Registration happens at component INITIALISATION and again in an `$effect`,
9
+ never in a `$derived`: Svelte 5 refuses a reactive write from a derived
10
+ expression (`state_unsafe_mutation`), and rendering the number IS what
11
+ registers the source, so the write cannot simply move there. The init call
12
+ is what makes the FIRST paint carry the right number; the effect is what
13
+ keeps it right if the `citation` prop is swapped in place.
14
+
15
+ `link link-hover` rather than a fixed colour: a hard-coded blue is invisible
16
+ in a dark theme and ignores whatever palette the consumer's `theme.css`
17
+ declares.
18
+ -->
19
+ <script lang="ts">import { untrack } from "svelte";
20
+ import { getBibliographyContext } from "./bibliography.svelte.js";
21
+ let { citation, format = "superscript", linkToReference = true, referenceLabel = (n, title) => `Reference ${n}: ${title}` } = $props();
22
+ const manager = getBibliographyContext();
23
+ // `untrack` says what the init call means: read the prop ONCE, for the first
24
+ // paint, and leave staying-in-sync to the effect below. Without it Svelte
25
+ // warns that the reference captures only the initial value — which is
26
+ // exactly the intent, but worth stating rather than suppressing.
27
+ let number = $state(untrack(() => manager.addCitation(citation)));
28
+ $effect(() => {
29
+ number = manager.addCitation(citation);
30
+ });
31
+ const href = $derived(`#ref-${citation.id}`);
32
+ const label = $derived(referenceLabel(number, citation.title));
33
+ </script>
34
+
35
+ {#if format === 'superscript'}
36
+ <sup>
37
+ {#if linkToReference}
38
+ <a {href} class="link link-hover no-underline" aria-label={label}>[{number}]</a>
39
+ {:else}
40
+ <span class="text-base-content/70" aria-label={label}>[{number}]</span>
41
+ {/if}
42
+ </sup>
43
+ {:else if linkToReference}
44
+ <a {href} class="link link-hover" aria-label={label}>({number})</a>
45
+ {:else}
46
+ <span class="text-base-content/70" aria-label={label}>({number})</span>
47
+ {/if}
@@ -0,0 +1,24 @@
1
+ import type { Citation } from './citation.ts';
2
+ interface Props {
3
+ /** The source being cited. */
4
+ citation: Citation;
5
+ /**
6
+ * `superscript` renders `[1]` raised; `inline` renders `(1)` on the line.
7
+ * @defaultValue `'superscript'`
8
+ */
9
+ format?: 'inline' | 'superscript' | undefined;
10
+ /**
11
+ * Link to the `<ReferenceList>` entry. Off when there is no list on the page.
12
+ * @defaultValue `true`
13
+ */
14
+ linkToReference?: boolean | undefined;
15
+ /**
16
+ * The marker's accessible name — a bare "1" announces nothing on its own.
17
+ * @defaultValue `"Reference <n>: <title>"`
18
+ */
19
+ referenceLabel?: ((n: number, title: string) => string) | undefined;
20
+ }
21
+ /** An inline reference marker that registers its source with the surrounding bibliography and renders the number it was given. */
22
+ declare const Citation: import("svelte").Component<Props, {}, "">;
23
+ type Citation = ReturnType<typeof Citation>;
24
+ export default Citation;
@@ -0,0 +1,69 @@
1
+ <!-- @component
2
+ A locale-joined byline for one credited role (authors, editors, translators), each name in Schema.org microdata.
3
+ -->
4
+ <!--
5
+ CreditList — a locale-joined byline for one role: the authors, the editors,
6
+ the translators, or any other credited role a citation carries. Generalises `Authors` / `Editors` / `Translators`, which were the same
7
+ component three times over (a `FormatList` of names, each wrapped in
8
+ Schema.org microdata, plus one role's own punctuation) into one.
9
+
10
+ Each credit renders as a `Person` or `Organization` microdata item when it
11
+ carries an `itemtype` — a name with a known Agent behind it — and as plain
12
+ (`itemprop`-only) text otherwise.
13
+
14
+ `roleLabel` / `roleLabelPosition` generalise the label each of the three
15
+ source components hard-coded: `Editors` printed "(ed)"/"(eds)" AFTER the
16
+ names, `Translators` printed "trans." BEFORE them. The defaults below
17
+ reproduce both; a caller naming a role of its own supplies its own label.
18
+
19
+ List punctuation comes from `./list-format.ts`, not the `formatting/`
20
+ family's `FormatList` — see that module's header for why.
21
+ -->
22
+ <script lang="ts">import { getComponentsContext } from "../context.svelte.js";
23
+ import { formatListParts } from "./list-format.js";
24
+ let { credits, role = "author", roleLabel, roleLabelPosition, itemprop, locales, style = "long", type = "conjunction", class: className } = $props();
25
+ const ctx = getComponentsContext();
26
+ /** Reproduces `Editors.svelte` (after) and `Translators.svelte` (before). */
27
+ const defaultRoleLabel = (count) => {
28
+ if (role === "editor") return count > 1 ? "(eds)" : "(ed)";
29
+ if (role === "translator") return "trans.";
30
+ return "";
31
+ };
32
+ const resolvedRoleLabel = $derived(roleLabel ?? defaultRoleLabel);
33
+ const resolvedPosition = $derived(roleLabelPosition ?? (role === "translator" ? "before" : "after"));
34
+ const labelText = $derived(credits.length > 0 ? resolvedRoleLabel(credits.length) : "");
35
+ const creditItemprop = $derived(itemprop ?? role);
36
+ const parts = $derived(formatListParts(credits, {
37
+ locales: locales ?? ctx.locale(),
38
+ style,
39
+ type
40
+ }));
41
+ </script>
42
+
43
+ {#if credits.length > 0}
44
+ <span class={['inline', className]}>
45
+ {#if labelText !== '' && resolvedPosition === 'before'}
46
+ {labelText}
47
+ {/if}
48
+ {#each parts as part, index (index)}
49
+ {#if part.kind === 'item'}
50
+ {@const credit = part.value}
51
+ {#if credit.itemtype !== undefined}
52
+ <span itemprop={creditItemprop} itemscope itemtype={`https://schema.org/${credit.itemtype}`}>
53
+ {#if credit.href !== undefined}
54
+ <a itemprop="name" href={ctx.href(credit.href)}>{credit.name}</a>
55
+ {:else}
56
+ <span itemprop="name">{credit.name}</span>
57
+ {/if}
58
+ </span>
59
+ {:else if credit.href !== undefined}
60
+ <a itemprop={creditItemprop} href={ctx.href(credit.href)}>{credit.name}</a>
61
+ {:else}
62
+ <span itemprop={creditItemprop}>{credit.name}</span>
63
+ {/if}
64
+ {:else}
65
+ {part.value}
66
+ {/if}
67
+ {/each}{#if labelText !== '' && resolvedPosition === 'after'}{' '}{labelText}{/if}</span
68
+ >
69
+ {/if}
@@ -0,0 +1,47 @@
1
+ /** One credited name. */
2
+ export interface Credit {
3
+ readonly name: string;
4
+ /** Link to the credited party's own page, if it has one. */
5
+ readonly href?: string | undefined;
6
+ /** Present exactly when the credit resolved to a real Agent. */
7
+ readonly itemtype?: 'Person' | 'Organization' | undefined;
8
+ }
9
+ interface Props {
10
+ /** The people or organisations credited, in order. */
11
+ credits: readonly Credit[];
12
+ /**
13
+ * The role this list credits — also the default Schema.org `itemprop`.
14
+ * @defaultValue `'author'`
15
+ */
16
+ role?: string | undefined;
17
+ /** Count → the role's punctuation, e.g. `(n) => (n > 1 ? '(eds)' : '(ed)')`. */
18
+ roleLabel?: ((count: number) => string) | undefined;
19
+ /**
20
+ * Whether `roleLabel` goes before or after the names.
21
+ * @defaultValue `'before'` for `role="translator"`, otherwise `'after'`
22
+ */
23
+ roleLabelPosition?: 'before' | 'after' | undefined;
24
+ /** Overrides `role` as the Schema.org property each credit carries. */
25
+ itemprop?: string | undefined;
26
+ /**
27
+ * Locale(s) for `Intl` formatting.
28
+ * @defaultValue the components context's `locale()`
29
+ */
30
+ locales?: string | readonly string[] | undefined;
31
+ /**
32
+ * `Intl.ListFormat` style.
33
+ * @defaultValue `'long'`
34
+ */
35
+ style?: Intl.ListFormatOptions['style'] | undefined;
36
+ /**
37
+ * `Intl.ListFormat` type.
38
+ * @defaultValue `'conjunction'`
39
+ */
40
+ type?: Intl.ListFormatOptions['type'] | undefined;
41
+ /** Extra classes, merged last. */
42
+ class?: string | undefined;
43
+ }
44
+ /** A locale-joined byline for one credited role (authors, editors, translators), each name in Schema.org microdata. */
45
+ declare const CreditList: import("svelte").Component<Props, {}, "">;
46
+ type CreditList = ReturnType<typeof CreditList>;
47
+ export default CreditList;
@@ -0,0 +1,28 @@
1
+ <!-- @component
2
+ A DOI rendered as a `https://doi.org/<doi>` link that opens in a new tab.
3
+ -->
4
+ <!--
5
+ DOILink — a DOI rendered as a resolvable `https://doi.org/<doi>` link.
6
+
7
+ Consistent with `ISBNLink` / `ISSNLink`: `https://` (not the old copy's
8
+ `http://` WorldCat links the other two carried), `target="_blank" rel=
9
+ "noreferrer"`, an optional Schema.org `itemprop`, native attribute spread on
10
+ the `<a>` itself, and a `children` snippet for a caller that wants to
11
+ render the identifier differently (defaults to the bare DOI).
12
+ -->
13
+ <script lang="ts">let { doi, itemprop, children, class: className, ...rest } = $props();
14
+ const href = $derived(`https://doi.org/${doi}`);
15
+ export {};
16
+ </script>
17
+
18
+ <span class="whitespace-nowrap">
19
+ doi:<a
20
+ {...rest}
21
+ {href}
22
+ {itemprop}
23
+ target="_blank"
24
+ rel="noreferrer"
25
+ class={['link link-primary link-hover', className]}
26
+ >{#if children}{@render children()}{:else}{doi}{/if}</a
27
+ >
28
+ </span>
@@ -0,0 +1,19 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
3
+ interface Props extends Omit<HTMLAnchorAttributes, 'children'> {
4
+ /** The DOI, without a prefix. */
5
+ doi: string;
6
+ /**
7
+ * Schema.org `itemprop` on the link, when the identifier is a property of an enclosing item.
8
+ */
9
+ itemprop?: string | undefined;
10
+ /**
11
+ * Replaces the link text.
12
+ * @defaultValue the bare DOI
13
+ */
14
+ children?: Snippet<[]> | undefined;
15
+ }
16
+ /** A DOI rendered as a `https://doi.org/<doi>` link that opens in a new tab. */
17
+ declare const DOILink: import("svelte").Component<Props, {}, "">;
18
+ type DOILink = ReturnType<typeof DOILink>;
19
+ export default DOILink;
@@ -0,0 +1,39 @@
1
+ <!-- @component
2
+ An inline note marker that registers its note with the surrounding footnote list, tracked separately from citations.
3
+ -->
4
+ <!--
5
+ Footnote — an inline note marker, tracked separately from citations.
6
+
7
+ The number is assigned AT REGISTRATION, not derived from the map's size
8
+ after the fact — a page's first note reads `1` because registration handed
9
+ it that ordinal, not by the accident of an effect having already run by the
10
+ time something reads `manager.footnotes().length`. Registration happens at
11
+ component initialisation (the first paint is already correct); an `$effect`
12
+ re-registers afterwards, so a note whose text is edited in place stays
13
+ current. It cannot move into a `$derived` either — Svelte 5 refuses a
14
+ reactive write from one.
15
+ -->
16
+ <script lang="ts">import { getBibliographyContext } from "./bibliography.svelte.js";
17
+ let { id, content, symbol, footnoteLabel = (marker, text) => `Footnote ${marker}: ${text}` } = $props();
18
+ const manager = getBibliographyContext();
19
+ /** Register, then read back the position registration gave this note. */
20
+ const register = () => {
21
+ manager.addFootnote(id, symbol === undefined ? { content } : {
22
+ content,
23
+ symbol
24
+ });
25
+ if (symbol !== undefined) return symbol;
26
+ return String(manager.footnotes().findIndex(([key]) => key === id) + 1);
27
+ };
28
+ let marker = $state(register());
29
+ $effect(() => {
30
+ marker = register();
31
+ });
32
+ const label = $derived(footnoteLabel(marker, content));
33
+ </script>
34
+
35
+ <sup>
36
+ <a href="#footnote-{id}" class="link link-hover no-underline" aria-label={label}>
37
+ {marker}
38
+ </a>
39
+ </sup>
@@ -0,0 +1,17 @@
1
+ interface Props {
2
+ /** Stable key for this note — also the `#footnote-<id>` anchor. */
3
+ id: string;
4
+ /** The note's text. */
5
+ content: string;
6
+ /** A custom marker (`*`, `†`) instead of the auto-assigned number. */
7
+ symbol?: string | undefined;
8
+ /**
9
+ * The marker's accessible name — a bare number or symbol announces nothing on its own.
10
+ * @defaultValue `"Footnote <marker>: <content>"`
11
+ */
12
+ footnoteLabel?: ((marker: string, content: string) => string) | undefined;
13
+ }
14
+ /** An inline note marker that registers its note with the surrounding footnote list, tracked separately from citations. */
15
+ declare const Footnote: import("svelte").Component<Props, {}, "">;
16
+ type Footnote = ReturnType<typeof Footnote>;
17
+ export default Footnote;
@@ -0,0 +1,36 @@
1
+ <!-- @component
2
+ The notes a page’s `<Footnote>` markers registered, in registration order.
3
+ -->
4
+ <!--
5
+ FootnoteList — the notes a page's `<Footnote>` markers registered, in
6
+ registration order.
7
+
8
+ Keyed by the note's own id, so a re-render does not re-create every `<li>`.
9
+ -->
10
+ <script lang="ts">import { getBibliographyContext } from "./bibliography.svelte.js";
11
+ let { title = "Notes", showTitle = true, headingLevel = 2 } = $props();
12
+ const manager = getBibliographyContext();
13
+ const notes = $derived(manager.footnotes().map(([id, note], index) => ({
14
+ id,
15
+ marker: note.symbol ?? String(index + 1),
16
+ content: note.content
17
+ })));
18
+ const Heading = $derived(`h${headingLevel}`);
19
+ </script>
20
+
21
+ {#if notes.length > 0}
22
+ <section class="border-base-300 mt-8 space-y-3 border-t pt-4">
23
+ {#if showTitle}
24
+ <svelte:element this={Heading} class="text-lg font-semibold">{title}</svelte:element>
25
+ {/if}
26
+
27
+ <ol class="space-y-1 text-sm">
28
+ {#each notes as note (note.id)}
29
+ <li id="footnote-{note.id}" class="text-base-content/80 flex gap-2">
30
+ <span class="text-base-content/60 shrink-0 font-medium">{note.marker}.</span>
31
+ <span>{note.content}</span>
32
+ </li>
33
+ {/each}
34
+ </ol>
35
+ </section>
36
+ {/if}
@@ -0,0 +1,21 @@
1
+ interface Props {
2
+ /**
3
+ * Heading text.
4
+ * @defaultValue `'Notes'`
5
+ */
6
+ title?: string | undefined;
7
+ /**
8
+ * Render the heading. Off when the page supplies its own.
9
+ * @defaultValue `true`
10
+ */
11
+ showTitle?: boolean | undefined;
12
+ /**
13
+ * Heading level, for a page whose outline this list sits deeper in.
14
+ * @defaultValue `2`
15
+ */
16
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6 | undefined;
17
+ }
18
+ /** The notes a page’s `<Footnote>` markers registered, in registration order. */
19
+ declare const FootnoteList: import("svelte").Component<Props, {}, "">;
20
+ type FootnoteList = ReturnType<typeof FootnoteList>;
21
+ export default FootnoteList;
@@ -0,0 +1,29 @@
1
+ <!-- @component
2
+ An ISBN rendered as a WorldCat lookup link that opens in a new tab.
3
+ -->
4
+ <!--
5
+ ISBNLink — an ISBN rendered as a resolvable WorldCat lookup link.
6
+
7
+ Consistent with `DOILink` / `ISSNLink`: `https://` (the old copy's
8
+ `http://` WorldCat URL), `target="_blank" rel="noreferrer"`, an optional
9
+ Schema.org `itemprop`, native attribute spread on the `<a>` itself, and a
10
+ `children` snippet for a caller that wants to render the identifier
11
+ differently (defaults to the bare ISBN).
12
+ -->
13
+ <script lang="ts">let { isbn, itemprop, children, class: className, ...rest } = $props();
14
+ const href = $derived(`https://www.worldcat.org/isbn/${isbn}`);
15
+ export {};
16
+ </script>
17
+
18
+ <span class="whitespace-nowrap">
19
+ ISBN
20
+ <a
21
+ {...rest}
22
+ {href}
23
+ {itemprop}
24
+ target="_blank"
25
+ rel="noreferrer"
26
+ class={['link link-primary link-hover', className]}
27
+ >{#if children}{@render children()}{:else}{isbn}{/if}</a
28
+ >
29
+ </span>
@@ -0,0 +1,19 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAnchorAttributes } from 'svelte/elements';
3
+ interface Props extends Omit<HTMLAnchorAttributes, 'children'> {
4
+ /** The ISBN, without a prefix. */
5
+ isbn: string;
6
+ /**
7
+ * Schema.org `itemprop` on the link, when the identifier is a property of an enclosing item.
8
+ */
9
+ itemprop?: string | undefined;
10
+ /**
11
+ * Replaces the link text.
12
+ * @defaultValue the bare ISBN
13
+ */
14
+ children?: Snippet<[]> | undefined;
15
+ }
16
+ /** An ISBN rendered as a WorldCat lookup link that opens in a new tab. */
17
+ declare const ISBNLink: import("svelte").Component<Props, {}, "">;
18
+ type ISBNLink = ReturnType<typeof ISBNLink>;
19
+ export default ISBNLink;