shelving 1.199.3 → 1.200.1

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 (401) hide show
  1. package/api/cache/APICache.js +2 -1
  2. package/api/cache/EndpointCache.d.ts +2 -0
  3. package/api/cache/EndpointCache.js +4 -1
  4. package/api/provider/CachedAPIProvider.d.ts +6 -1
  5. package/api/provider/CachedAPIProvider.js +9 -5
  6. package/index.js +1 -0
  7. package/package.json +10 -5
  8. package/store/FetchStore.d.ts +9 -0
  9. package/store/FetchStore.js +10 -1
  10. package/store/Store.d.ts +2 -2
  11. package/store/Store.js +2 -2
  12. package/ui/app/App.d.ts +11 -0
  13. package/ui/app/App.js +21 -0
  14. package/ui/app/App.module.css +168 -0
  15. package/ui/app/App.tsx +26 -0
  16. package/ui/app/index.d.ts +1 -0
  17. package/ui/app/index.js +1 -0
  18. package/ui/app/index.ts +1 -0
  19. package/ui/block/Address.d.ts +20 -0
  20. package/ui/block/Address.js +17 -0
  21. package/ui/block/Address.module.css +20 -0
  22. package/ui/block/Address.tsx +47 -0
  23. package/ui/block/Blockquote.d.ts +5 -0
  24. package/ui/block/Blockquote.js +5 -0
  25. package/ui/block/Blockquote.module.css +21 -0
  26. package/ui/block/Blockquote.tsx +10 -0
  27. package/ui/block/Card.d.ts +10 -0
  28. package/ui/block/Card.js +7 -0
  29. package/ui/block/Card.module.css +32 -0
  30. package/ui/block/Card.tsx +18 -0
  31. package/ui/block/Divider.d.ts +6 -0
  32. package/ui/block/Divider.js +5 -0
  33. package/ui/block/Divider.module.css +19 -0
  34. package/ui/block/Divider.tsx +11 -0
  35. package/ui/block/Element.d.ts +9 -0
  36. package/ui/block/Element.js +7 -0
  37. package/ui/block/Element.module.css +12 -0
  38. package/ui/block/Element.tsx +14 -0
  39. package/ui/block/Elements.d.ts +27 -0
  40. package/ui/block/Elements.js +10 -0
  41. package/ui/block/Elements.module.css +70 -0
  42. package/ui/block/Elements.tsx +44 -0
  43. package/ui/block/Figure.d.ts +6 -0
  44. package/ui/block/Figure.js +5 -0
  45. package/ui/block/Figure.module.css +27 -0
  46. package/ui/block/Figure.tsx +16 -0
  47. package/ui/block/Heading.d.ts +6 -0
  48. package/ui/block/Heading.js +7 -0
  49. package/ui/block/Heading.module.css +23 -0
  50. package/ui/block/Heading.tsx +13 -0
  51. package/ui/block/Image.d.ts +6 -0
  52. package/ui/block/Image.js +5 -0
  53. package/ui/block/Image.module.css +20 -0
  54. package/ui/block/Image.tsx +11 -0
  55. package/ui/block/List.d.ts +6 -0
  56. package/ui/block/List.js +6 -0
  57. package/ui/block/List.module.css +30 -0
  58. package/ui/block/List.tsx +12 -0
  59. package/ui/block/Paragraph.d.ts +15 -0
  60. package/ui/block/Paragraph.js +7 -0
  61. package/ui/block/Paragraph.module.css +36 -0
  62. package/ui/block/Paragraph.tsx +21 -0
  63. package/ui/block/Preformatted.d.ts +5 -0
  64. package/ui/block/Preformatted.js +5 -0
  65. package/ui/block/Preformatted.module.css +23 -0
  66. package/ui/block/Preformatted.tsx +10 -0
  67. package/ui/block/Prose.d.ts +6 -0
  68. package/ui/block/Prose.js +28 -0
  69. package/ui/block/Prose.module.css +15 -0
  70. package/ui/block/Prose.tsx +56 -0
  71. package/ui/block/Section.d.ts +28 -0
  72. package/ui/block/Section.js +26 -0
  73. package/ui/block/Section.module.css +28 -0
  74. package/ui/block/Section.tsx +53 -0
  75. package/ui/block/Subheading.d.ts +3 -0
  76. package/ui/block/Subheading.js +7 -0
  77. package/ui/block/Subheading.module.css +23 -0
  78. package/ui/block/Subheading.tsx +10 -0
  79. package/ui/block/Table.d.ts +5 -0
  80. package/ui/block/Table.js +5 -0
  81. package/ui/block/Table.module.css +85 -0
  82. package/ui/block/Table.tsx +14 -0
  83. package/ui/block/Video.d.ts +36 -0
  84. package/ui/block/Video.js +43 -0
  85. package/ui/block/Video.module.css +103 -0
  86. package/ui/block/Video.tsx +91 -0
  87. package/ui/block/index.d.ts +17 -0
  88. package/ui/block/index.js +17 -0
  89. package/ui/block/index.ts +17 -0
  90. package/ui/dialog/Dialog.d.ts +13 -0
  91. package/ui/dialog/Dialog.js +28 -0
  92. package/ui/dialog/Dialog.module.css +29 -0
  93. package/ui/dialog/Dialog.tsx +57 -0
  94. package/ui/dialog/Dialogs.d.ts +23 -0
  95. package/ui/dialog/Dialogs.js +43 -0
  96. package/ui/dialog/Dialogs.tsx +64 -0
  97. package/ui/dialog/Modal.d.ts +5 -0
  98. package/ui/dialog/Modal.js +5 -0
  99. package/ui/dialog/Modal.module.css +11 -0
  100. package/ui/dialog/Modal.tsx +10 -0
  101. package/ui/dialog/index.d.ts +3 -0
  102. package/ui/dialog/index.js +3 -0
  103. package/ui/dialog/index.ts +3 -0
  104. package/ui/form/ArrayInput.d.ts +13 -0
  105. package/ui/form/ArrayInput.js +23 -0
  106. package/ui/form/ArrayInput.tsx +90 -0
  107. package/ui/form/ArrayRadioInputs.d.ts +15 -0
  108. package/ui/form/ArrayRadioInputs.js +16 -0
  109. package/ui/form/ArrayRadioInputs.tsx +53 -0
  110. package/ui/form/Button.d.ts +24 -0
  111. package/ui/form/Button.js +21 -0
  112. package/ui/form/Button.module.css +83 -0
  113. package/ui/form/Button.tsx +48 -0
  114. package/ui/form/ButtonInput.d.ts +7 -0
  115. package/ui/form/ButtonInput.js +19 -0
  116. package/ui/form/ButtonInput.tsx +33 -0
  117. package/ui/form/ButtonInputPopover.d.ts +16 -0
  118. package/ui/form/ButtonInputPopover.js +17 -0
  119. package/ui/form/ButtonInputPopover.tsx +32 -0
  120. package/ui/form/ButtonPopover.d.ts +16 -0
  121. package/ui/form/ButtonPopover.js +17 -0
  122. package/ui/form/ButtonPopover.tsx +31 -0
  123. package/ui/form/CheckboxInput.d.ts +7 -0
  124. package/ui/form/CheckboxInput.js +8 -0
  125. package/ui/form/CheckboxInput.tsx +37 -0
  126. package/ui/form/ChoiceRadioInputs.d.ts +17 -0
  127. package/ui/form/ChoiceRadioInputs.js +13 -0
  128. package/ui/form/ChoiceRadioInputs.tsx +60 -0
  129. package/ui/form/Clickable.d.ts +27 -0
  130. package/ui/form/Clickable.js +29 -0
  131. package/ui/form/Clickable.tsx +87 -0
  132. package/ui/form/DataInput.d.ts +9 -0
  133. package/ui/form/DataInput.js +17 -0
  134. package/ui/form/DataInput.tsx +43 -0
  135. package/ui/form/DateInput.d.ts +12 -0
  136. package/ui/form/DateInput.js +17 -0
  137. package/ui/form/DateInput.tsx +58 -0
  138. package/ui/form/DictionaryInput.d.ts +13 -0
  139. package/ui/form/DictionaryInput.js +32 -0
  140. package/ui/form/DictionaryInput.tsx +106 -0
  141. package/ui/form/Field.d.ts +10 -0
  142. package/ui/form/Field.js +7 -0
  143. package/ui/form/Field.module.css +45 -0
  144. package/ui/form/Field.test.tsx +26 -0
  145. package/ui/form/Field.tsx +32 -0
  146. package/ui/form/FileInput.d.ts +7 -0
  147. package/ui/form/FileInput.js +13 -0
  148. package/ui/form/FileInput.tsx +41 -0
  149. package/ui/form/Form.d.ts +38 -0
  150. package/ui/form/Form.js +61 -0
  151. package/ui/form/Form.module.css +9 -0
  152. package/ui/form/Form.tsx +130 -0
  153. package/ui/form/FormContext.d.ts +13 -0
  154. package/ui/form/FormContext.js +22 -0
  155. package/ui/form/FormContext.tsx +33 -0
  156. package/ui/form/FormFields.d.ts +6 -0
  157. package/ui/form/FormFields.js +16 -0
  158. package/ui/form/FormFields.tsx +30 -0
  159. package/ui/form/FormFooter.d.ts +11 -0
  160. package/ui/form/FormFooter.js +13 -0
  161. package/ui/form/FormFooter.tsx +27 -0
  162. package/ui/form/FormInput.d.ts +8 -0
  163. package/ui/form/FormInput.js +12 -0
  164. package/ui/form/FormInput.tsx +23 -0
  165. package/ui/form/FormMessage.d.ts +4 -0
  166. package/ui/form/FormMessage.js +11 -0
  167. package/ui/form/FormMessage.tsx +16 -0
  168. package/ui/form/FormNotice.d.ts +4 -0
  169. package/ui/form/FormNotice.js +11 -0
  170. package/ui/form/FormNotice.tsx +16 -0
  171. package/ui/form/FormNotify.d.ts +2 -0
  172. package/ui/form/FormNotify.js +11 -0
  173. package/ui/form/FormNotify.tsx +13 -0
  174. package/ui/form/FormStore.d.ts +39 -0
  175. package/ui/form/FormStore.js +95 -0
  176. package/ui/form/FormStore.tsx +107 -0
  177. package/ui/form/Input.d.ts +47 -0
  178. package/ui/form/Input.js +43 -0
  179. package/ui/form/Input.module.css +190 -0
  180. package/ui/form/Input.tsx +81 -0
  181. package/ui/form/NumberInput.d.ts +12 -0
  182. package/ui/form/NumberInput.js +18 -0
  183. package/ui/form/NumberInput.tsx +54 -0
  184. package/ui/form/Popover.d.ts +31 -0
  185. package/ui/form/Popover.js +20 -0
  186. package/ui/form/Popover.module.css +25 -0
  187. package/ui/form/Popover.tsx +61 -0
  188. package/ui/form/Progress.d.ts +9 -0
  189. package/ui/form/Progress.js +8 -0
  190. package/ui/form/Progress.module.css +30 -0
  191. package/ui/form/Progress.tsx +21 -0
  192. package/ui/form/QueryInput.d.ts +32 -0
  193. package/ui/form/QueryInput.js +37 -0
  194. package/ui/form/QueryInput.tsx +94 -0
  195. package/ui/form/RadioInput.d.ts +7 -0
  196. package/ui/form/RadioInput.js +8 -0
  197. package/ui/form/RadioInput.tsx +37 -0
  198. package/ui/form/SchemaInput.d.ts +59 -0
  199. package/ui/form/SchemaInput.js +102 -0
  200. package/ui/form/SchemaInput.tsx +154 -0
  201. package/ui/form/SegmentedProgress.d.ts +10 -0
  202. package/ui/form/SegmentedProgress.js +16 -0
  203. package/ui/form/SegmentedProgress.module.css +31 -0
  204. package/ui/form/SegmentedProgress.tsx +34 -0
  205. package/ui/form/SelectInput.d.ts +8 -0
  206. package/ui/form/SelectInput.js +6 -0
  207. package/ui/form/SelectInput.tsx +45 -0
  208. package/ui/form/SubmitButton.d.ts +7 -0
  209. package/ui/form/SubmitButton.js +15 -0
  210. package/ui/form/SubmitButton.tsx +38 -0
  211. package/ui/form/TextInput.d.ts +16 -0
  212. package/ui/form/TextInput.js +31 -0
  213. package/ui/form/TextInput.tsx +97 -0
  214. package/ui/form/index.d.ts +34 -0
  215. package/ui/form/index.js +34 -0
  216. package/ui/form/index.ts +34 -0
  217. package/ui/index.d.ts +12 -0
  218. package/ui/index.js +12 -0
  219. package/ui/index.ts +12 -0
  220. package/ui/inline/Code.d.ts +17 -0
  221. package/ui/inline/Code.js +14 -0
  222. package/ui/inline/Code.module.css +14 -0
  223. package/ui/inline/Code.tsx +34 -0
  224. package/ui/inline/Deleted.d.ts +5 -0
  225. package/ui/inline/Deleted.js +5 -0
  226. package/ui/inline/Deleted.module.css +9 -0
  227. package/ui/inline/Deleted.tsx +10 -0
  228. package/ui/inline/Emphasis.d.ts +5 -0
  229. package/ui/inline/Emphasis.js +5 -0
  230. package/ui/inline/Emphasis.module.css +5 -0
  231. package/ui/inline/Emphasis.tsx +10 -0
  232. package/ui/inline/Inserted.d.ts +5 -0
  233. package/ui/inline/Inserted.js +5 -0
  234. package/ui/inline/Inserted.module.css +9 -0
  235. package/ui/inline/Inserted.tsx +10 -0
  236. package/ui/inline/Link.d.ts +5 -0
  237. package/ui/inline/Link.js +5 -0
  238. package/ui/inline/Link.module.css +19 -0
  239. package/ui/inline/Link.tsx +9 -0
  240. package/ui/inline/Mark.d.ts +5 -0
  241. package/ui/inline/Mark.js +5 -0
  242. package/ui/inline/Mark.module.css +15 -0
  243. package/ui/inline/Mark.tsx +10 -0
  244. package/ui/inline/Small.d.ts +5 -0
  245. package/ui/inline/Small.js +5 -0
  246. package/ui/inline/Small.module.css +9 -0
  247. package/ui/inline/Small.tsx +10 -0
  248. package/ui/inline/Strong.d.ts +5 -0
  249. package/ui/inline/Strong.js +5 -0
  250. package/ui/inline/Strong.module.css +5 -0
  251. package/ui/inline/Strong.tsx +10 -0
  252. package/ui/inline/Subscript.d.ts +5 -0
  253. package/ui/inline/Subscript.js +5 -0
  254. package/ui/inline/Subscript.module.css +9 -0
  255. package/ui/inline/Subscript.tsx +10 -0
  256. package/ui/inline/Superscript.d.ts +5 -0
  257. package/ui/inline/Superscript.js +5 -0
  258. package/ui/inline/Superscript.module.css +9 -0
  259. package/ui/inline/Superscript.tsx +10 -0
  260. package/ui/inline/When.d.ts +18 -0
  261. package/ui/inline/When.js +24 -0
  262. package/ui/inline/When.tsx +49 -0
  263. package/ui/inline/index.d.ts +11 -0
  264. package/ui/inline/index.js +11 -0
  265. package/ui/inline/index.ts +11 -0
  266. package/ui/layout/CenteredLayout.d.ts +10 -0
  267. package/ui/layout/CenteredLayout.js +11 -0
  268. package/ui/layout/CenteredLayout.module.css +13 -0
  269. package/ui/layout/CenteredLayout.tsx +23 -0
  270. package/ui/layout/Layout.d.ts +9 -0
  271. package/ui/layout/Layout.js +25 -0
  272. package/ui/layout/Layout.module.css +64 -0
  273. package/ui/layout/Layout.ts +26 -0
  274. package/ui/layout/index.d.ts +2 -0
  275. package/ui/layout/index.js +2 -0
  276. package/ui/layout/index.tsx +2 -0
  277. package/ui/misc/Catcher.d.ts +45 -0
  278. package/ui/misc/Catcher.js +57 -0
  279. package/ui/misc/Catcher.tsx +114 -0
  280. package/ui/misc/Loading.d.ts +8 -0
  281. package/ui/misc/Loading.js +6 -0
  282. package/ui/misc/Loading.module.css +19 -0
  283. package/ui/misc/Loading.tsx +31 -0
  284. package/ui/misc/Meta.d.ts +9 -0
  285. package/ui/misc/Meta.js +14 -0
  286. package/ui/misc/Meta.tsx +20 -0
  287. package/ui/misc/index.d.ts +3 -0
  288. package/ui/misc/index.js +3 -0
  289. package/ui/misc/index.tsx +3 -0
  290. package/ui/notice/Message.d.ts +11 -0
  291. package/ui/notice/Message.js +12 -0
  292. package/ui/notice/Message.module.css +8 -0
  293. package/ui/notice/Message.tsx +30 -0
  294. package/ui/notice/Notice.d.ts +15 -0
  295. package/ui/notice/Notice.js +13 -0
  296. package/ui/notice/Notice.module.css +15 -0
  297. package/ui/notice/Notice.tsx +42 -0
  298. package/ui/notice/NoticeStore.d.ts +21 -0
  299. package/ui/notice/NoticeStore.js +44 -0
  300. package/ui/notice/NoticeStore.ts +60 -0
  301. package/ui/notice/Notices.d.ts +7 -0
  302. package/ui/notice/Notices.js +22 -0
  303. package/ui/notice/Notices.module.css +10 -0
  304. package/ui/notice/Notices.tsx +28 -0
  305. package/ui/notice/NoticesStore.d.ts +11 -0
  306. package/ui/notice/NoticesStore.js +16 -0
  307. package/ui/notice/NoticesStore.ts +23 -0
  308. package/ui/notice/README.md +40 -0
  309. package/ui/notice/Status.d.ts +29 -0
  310. package/ui/notice/Status.js +6 -0
  311. package/ui/notice/Status.module.css +79 -0
  312. package/ui/notice/Status.tsx +36 -0
  313. package/ui/notice/StatusIcon.d.ts +12 -0
  314. package/ui/notice/StatusIcon.js +19 -0
  315. package/ui/notice/StatusIcon.module.css +28 -0
  316. package/ui/notice/StatusIcon.tsx +33 -0
  317. package/ui/notice/index.d.ts +7 -0
  318. package/ui/notice/index.js +7 -0
  319. package/ui/notice/index.ts +7 -0
  320. package/ui/page/Head.d.ts +8 -0
  321. package/ui/page/Head.js +32 -0
  322. package/ui/page/Head.tsx +49 -0
  323. package/ui/page/Page.d.ts +10 -0
  324. package/ui/page/Page.js +10 -0
  325. package/ui/page/Page.tsx +21 -0
  326. package/ui/page/index.d.ts +2 -0
  327. package/ui/page/index.js +2 -0
  328. package/ui/page/index.ts +2 -0
  329. package/ui/router/Router.d.ts +31 -0
  330. package/ui/router/Router.js +59 -0
  331. package/ui/router/Router.tsx +88 -0
  332. package/ui/router/RouterContext.d.ts +5 -0
  333. package/ui/router/RouterContext.js +9 -0
  334. package/ui/router/RouterContext.tsx +12 -0
  335. package/ui/router/RouterStore.d.ts +13 -0
  336. package/ui/router/RouterStore.js +23 -0
  337. package/ui/router/RouterStore.test.tsx +43 -0
  338. package/ui/router/RouterStore.tsx +29 -0
  339. package/ui/router/Routes.d.ts +39 -0
  340. package/ui/router/Routes.js +35 -0
  341. package/ui/router/Routes.tsx +62 -0
  342. package/ui/router/index.d.ts +4 -0
  343. package/ui/router/index.js +4 -0
  344. package/ui/router/index.ts +4 -0
  345. package/ui/transition/CollapseTransition.css +3 -0
  346. package/ui/transition/CollapseTransition.d.ts +6 -0
  347. package/ui/transition/CollapseTransition.js +6 -0
  348. package/ui/transition/CollapseTransition.tsx +9 -0
  349. package/ui/transition/FadeTransition.css +25 -0
  350. package/ui/transition/FadeTransition.d.ts +5 -0
  351. package/ui/transition/FadeTransition.js +5 -0
  352. package/ui/transition/FadeTransition.tsx +8 -0
  353. package/ui/transition/HorizontalTransition.css +66 -0
  354. package/ui/transition/HorizontalTransition.d.ts +6 -0
  355. package/ui/transition/HorizontalTransition.js +6 -0
  356. package/ui/transition/HorizontalTransition.tsx +9 -0
  357. package/ui/transition/Transition.css +3 -0
  358. package/ui/transition/Transition.d.ts +18 -0
  359. package/ui/transition/Transition.js +21 -0
  360. package/ui/transition/Transition.tsx +35 -0
  361. package/ui/transition/VerticalTransition.css +66 -0
  362. package/ui/transition/VerticalTransition.d.ts +6 -0
  363. package/ui/transition/VerticalTransition.js +6 -0
  364. package/ui/transition/VerticalTransition.tsx +9 -0
  365. package/ui/transition/index.d.ts +6 -0
  366. package/ui/transition/index.js +6 -0
  367. package/ui/transition/index.tsx +6 -0
  368. package/ui/transition/util.d.ts +17 -0
  369. package/ui/transition/util.js +6 -0
  370. package/ui/transition/util.tsx +24 -0
  371. package/ui/types.d.ts +9 -0
  372. package/ui/util/context.d.ts +6 -0
  373. package/ui/util/context.js +10 -0
  374. package/ui/util/context.ts +15 -0
  375. package/ui/util/css.d.ts +37 -0
  376. package/ui/util/css.js +63 -0
  377. package/ui/util/css.ts +80 -0
  378. package/ui/util/event.d.ts +2 -0
  379. package/ui/util/event.js +4 -0
  380. package/ui/util/event.ts +4 -0
  381. package/ui/util/focus.d.ts +16 -0
  382. package/ui/util/focus.js +21 -0
  383. package/ui/util/focus.ts +23 -0
  384. package/ui/util/index.d.ts +8 -0
  385. package/ui/util/index.js +8 -0
  386. package/ui/util/index.ts +8 -0
  387. package/ui/util/meta.d.ts +67 -0
  388. package/ui/util/meta.js +33 -0
  389. package/ui/util/meta.ts +97 -0
  390. package/ui/util/notice.d.ts +26 -0
  391. package/ui/util/notice.js +82 -0
  392. package/ui/util/notice.ts +103 -0
  393. package/ui/util/refresh.d.ts +2 -0
  394. package/ui/util/refresh.js +9 -0
  395. package/ui/util/refresh.ts +11 -0
  396. package/ui/util/scroll.d.ts +11 -0
  397. package/ui/util/scroll.js +32 -0
  398. package/ui/util/scroll.ts +40 -0
  399. package/ui/util/state.d.ts +11 -0
  400. package/ui/util/state.js +42 -0
  401. package/ui/util/state.ts +44 -0
@@ -1,3 +1,4 @@
1
+ import { AVOID_REFRESH } from "../../store/FetchStore.js";
1
2
  import { awaitDispose } from "../../util/dispose.js";
2
3
  import { setMapItem } from "../../util/map.js";
3
4
  import { EndpointCache } from "./EndpointCache.js";
@@ -23,7 +24,7 @@ export class APICache {
23
24
  * - Waits for the in-flight fetch if the store is loading.
24
25
  * - Throws if the fetch fails, matching `APIProvider.call` behaviour.
25
26
  */
26
- async call(endpoint, payload, maxAge, caller = this.call) {
27
+ async call(endpoint, payload, maxAge = AVOID_REFRESH, caller = this.call) {
27
28
  return this.get(endpoint).call(payload, maxAge, caller);
28
29
  }
29
30
  /** Invalidate a specific store for an endpoint. */
@@ -18,6 +18,8 @@ export declare class EndpointCache<P = unknown, R = unknown> implements AsyncDis
18
18
  * - Returns the cached value immediately if one exists.
19
19
  * - Waits for the in-flight fetch if the store is loading.
20
20
  * - Throws if the fetch fails, matching `APIProvider.call` behaviour.
21
+ *
22
+ * @param maxAge The maximum age (defaults to only refreshing if the value is still in a loading state).
21
23
  */
22
24
  call(payload: P, maxAge?: number, caller?: AnyCaller): Promise<R>;
23
25
  /** Invalidate a specific store. */
@@ -1,3 +1,4 @@
1
+ import { AVOID_REFRESH } from "../../store/FetchStore.js";
1
2
  import { awaitValues } from "../../util/async.js";
2
3
  import { awaitDispose } from "../../util/dispose.js";
3
4
  import { setMapItem } from "../../util/map.js";
@@ -24,8 +25,10 @@ export class EndpointCache {
24
25
  * - Returns the cached value immediately if one exists.
25
26
  * - Waits for the in-flight fetch if the store is loading.
26
27
  * - Throws if the fetch fails, matching `APIProvider.call` behaviour.
28
+ *
29
+ * @param maxAge The maximum age (defaults to only refreshing if the value is still in a loading state).
27
30
  */
28
- async call(payload, maxAge, caller = this.call) {
31
+ async call(payload, maxAge = AVOID_REFRESH, caller = this.call) {
29
32
  const store = this.get(payload, caller);
30
33
  await store.refresh(maxAge);
31
34
  return store.value;
@@ -1,4 +1,5 @@
1
1
  import type { AnyCaller } from "../../util/function.js";
2
+ import type { RequestOptions } from "../../util/http.js";
2
3
  import type { Endpoint } from "../endpoint/Endpoint.js";
3
4
  import type { APIProvider } from "./APIProvider.js";
4
5
  import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
@@ -7,12 +8,16 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
7
8
  * - Constructor accepts a `source` provider and an optional default `maxAge`.
8
9
  * - On `call(...)`, triggers `cache.refresh(maxAge)` for the endpoint+payload before awaiting `cache.call(...)`.
9
10
  * - `invalidate`, `invalidateAll`, `refresh`, and `refreshAll` pass through to the underlying cache and use `this.maxAge` as the default refresh timing.
11
+ *
12
+ * @param `maxAge` The maximum age used when calling `call()` (defaults to `AVOID_REFRESH`, i.e. only refresh if the value is invalidated or still loading).
13
+ * - Note: This is not used for `refresh()` calls — when you call `refresh()` you likely mean "do it now".
14
+ * - When we are using `call()` on a cache, the entire point of the cache is to "cache", so the default isn't `0` like it is for `refresh()`
10
15
  */
11
16
  export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
12
17
  readonly maxAge: number | undefined;
13
18
  private readonly _cache;
14
19
  constructor(source: APIProvider<P, R>, maxAge?: number);
15
- call<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, maxAge?: number | undefined, caller?: AnyCaller): Promise<RR>;
20
+ call<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, _options?: RequestOptions, caller?: AnyCaller): Promise<RR>;
16
21
  invalidate<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP): void;
17
22
  invalidateAll<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>): void;
18
23
  refresh<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP): void;
@@ -1,3 +1,4 @@
1
+ import { AVOID_REFRESH } from "../../store/FetchStore.js";
1
2
  import { APICache } from "../cache/APICache.js";
2
3
  import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
3
4
  /**
@@ -5,19 +6,22 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
5
6
  * - Constructor accepts a `source` provider and an optional default `maxAge`.
6
7
  * - On `call(...)`, triggers `cache.refresh(maxAge)` for the endpoint+payload before awaiting `cache.call(...)`.
7
8
  * - `invalidate`, `invalidateAll`, `refresh`, and `refreshAll` pass through to the underlying cache and use `this.maxAge` as the default refresh timing.
9
+ *
10
+ * @param `maxAge` The maximum age used when calling `call()` (defaults to `AVOID_REFRESH`, i.e. only refresh if the value is invalidated or still loading).
11
+ * - Note: This is not used for `refresh()` calls — when you call `refresh()` you likely mean "do it now".
12
+ * - When we are using `call()` on a cache, the entire point of the cache is to "cache", so the default isn't `0` like it is for `refresh()`
8
13
  */
9
14
  export class CachedAPIProvider extends ThroughAPIProvider {
10
15
  maxAge;
11
16
  _cache;
12
- constructor(source, maxAge) {
17
+ constructor(source, maxAge = AVOID_REFRESH) {
13
18
  super(source);
14
19
  this.maxAge = maxAge;
15
20
  this._cache = new APICache(source);
16
21
  }
17
- // @ts-expect-error TS2416: intentionally diverges from `APIProvider.call` `RequestOptions` are not used by the cache, so the third arg is repurposed as `maxAge`.
18
- call(endpoint, payload, maxAge = this.maxAge, caller = this.call) {
19
- this._cache.refresh(endpoint, payload, maxAge);
20
- return this._cache.call(endpoint, payload, maxAge, caller);
22
+ // Override call to use the cache racther than calling fresh each time.
23
+ call(endpoint, payload, _options, caller = this.call) {
24
+ return this._cache.call(endpoint, payload, this.maxAge, caller);
21
25
  }
22
26
  invalidate(endpoint, payload) {
23
27
  this._cache.invalidate(endpoint, payload);
package/index.js CHANGED
@@ -12,6 +12,7 @@ export * from "./error/index.js";
12
12
  export * from "./markup/index.js";
13
13
  // export * from "./react/index.js"; // Not exported.
14
14
  export * from "./schema/index.js";
15
+ // export * from "./ui/index.js"; // Not exported — shelving/ui requires a bundler (CSS Modules, JSX) and is consumed as source.
15
16
  export * from "./sequence/index.js";
16
17
  export * from "./store/index.js";
17
18
  // export * from "./test/index.js"; // Not exported.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.199.3",
3
+ "version": "1.200.1",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,16 +11,18 @@
11
11
  "devDependencies": {
12
12
  "@biomejs/biome": "^2.4.14",
13
13
  "@google-cloud/firestore": "^8.5.0",
14
+ "@heroicons/react": "^2.2.0",
14
15
  "@types/bun": "^1.3.13",
15
16
  "@types/react": "^19.2.14",
16
17
  "@types/react-dom": "^19.2.3",
17
18
  "@typescript/native-preview": "^7.0.0-dev.20260502.1",
18
19
  "firebase": "^12.12.1",
19
- "react": "^19.2.5",
20
- "react-dom": "^19.2.5"
20
+ "react": "canary",
21
+ "react-dom": "canary"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "@google-cloud/firestore": ">=7.0.0",
25
+ "@heroicons/react": ">=2.0.0",
24
26
  "firebase": ">=11.0.0",
25
27
  "react": ">=19.0.0"
26
28
  },
@@ -41,6 +43,7 @@
41
43
  "./sequence": "./sequence/index.js",
42
44
  "./store": "./store/index.js",
43
45
  "./test": "./test/index.js",
46
+ "./ui": "./ui/index.js",
44
47
  "./util": "./util/index.js"
45
48
  },
46
49
  "description": "Toolkit for using data in JavaScript.",
@@ -68,12 +71,14 @@
68
71
  "fix:0:lint": "biome check --write .",
69
72
  "build": "bun run --sequential build:*",
70
73
  "build:0:setup": "rm -rf ./dist && mkdir -p ./dist",
71
- "build:1:copy": "cp package.json dist/package.json && cp LICENSE.md dist/LICENSE.md && cp README.md dist/README.md && cp .npmignore dist/.npmignore",
74
+ "build:1:copy": "cp package.json dist/package.json && cp LICENSE.md dist/LICENSE.md && cp README.md dist/README.md && cp .npmignore dist/.npmignore && cp -r modules/ui dist/ui",
72
75
  "build:2:emit": "tsgo",
73
76
  "build:3:syntax": "bun run ./dist/index.js",
74
77
  "build:4:unit": "bun test ./dist/**/*.test.js --concurrent --only-failures --bail"
75
78
  },
76
- "sideEffects": false,
79
+ "sideEffects": [
80
+ "*.css"
81
+ ],
77
82
  "type": "module",
78
83
  "types": "./index.d.ts"
79
84
  }
@@ -1,6 +1,10 @@
1
1
  import { type NONE } from "../util/constants.js";
2
2
  import { BusyStore } from "./BusyStore.js";
3
3
  import type { AsyncStoreInput, StoreInput } from "./Store.js";
4
+ /** Zero passed to `refresh()` means "always refresh this value" (this is the default). */
5
+ export declare const ALWAYS_REFRESH = 0;
6
+ /** Infinity passed to `refresh()` means "only refresh if this value is not loaded or invalid". */
7
+ export declare const AVOID_REFRESH: number;
4
8
  /** Callback for a callback fetch store. */
5
9
  export type FetchCallback<T> = (signal: AbortSignal) => StoreInput<T> | PromiseLike<StoreInput<T>>;
6
10
  /**
@@ -21,6 +25,11 @@ export declare class FetchStore<T, TT = T> extends BusyStore<T, TT> {
21
25
  * - Triggered automatically when someone reads `value` or `loading`.
22
26
  * - Refreshes are de-duplicated. Concurrent calls while a fetch is in-flight return the same promise.
23
27
  * - Never throws — errors are stored as `reason`.
28
+ *
29
+ * @param maxAge The maximum age for whether we refresh or not.
30
+ * - `0` zero means "always refresh" (this is the default).
31
+ * - `Infinity` means "refresh only if store is still in a loading state.
32
+ * - Any other value may or may not be stale based on `this.age`
24
33
  */
25
34
  refresh(maxAge?: number): Promise<boolean> | boolean;
26
35
  private _pendingRefresh;
@@ -2,6 +2,10 @@ import { RequiredError } from "../error/RequiredError.js";
2
2
  import { isAsync } from "../util/async.js";
3
3
  import { ABORT, SKIP } from "../util/constants.js";
4
4
  import { BusyStore } from "./BusyStore.js";
5
+ /** Zero passed to `refresh()` means "always refresh this value" (this is the default). */
6
+ export const ALWAYS_REFRESH = 0;
7
+ /** Infinity passed to `refresh()` means "only refresh if this value is not loaded or invalid". */
8
+ export const AVOID_REFRESH = Infinity;
5
9
  /**
6
10
  * Store that fetches its values from a remote source.
7
11
  *
@@ -47,8 +51,13 @@ export class FetchStore extends BusyStore {
47
51
  * - Triggered automatically when someone reads `value` or `loading`.
48
52
  * - Refreshes are de-duplicated. Concurrent calls while a fetch is in-flight return the same promise.
49
53
  * - Never throws — errors are stored as `reason`.
54
+ *
55
+ * @param maxAge The maximum age for whether we refresh or not.
56
+ * - `0` zero means "always refresh" (this is the default).
57
+ * - `Infinity` means "refresh only if store is still in a loading state.
58
+ * - Any other value may or may not be stale based on `this.age`
50
59
  */
51
- refresh(maxAge) {
60
+ refresh(maxAge = ALWAYS_REFRESH) {
52
61
  if (this._pendingRefresh)
53
62
  return this._pendingRefresh;
54
63
  if (!this.stale(maxAge))
package/store/Store.d.ts CHANGED
@@ -99,10 +99,10 @@ export declare class Store<T, TT = T> implements AsyncIterable<T, void, void>, A
99
99
  *
100
100
  * @param maxAge The maximum age for the stale check.
101
101
  * - `0` zero means "always refresh" (this is the default).
102
- * - `Infinity` means "refresh only if store is still in a loading state.
102
+ * - `Infinity` means "refresh only if store is still in a loading state"
103
103
  * - Any other value may or may not be stale based on `this.age`
104
104
  */
105
- stale(maxAge?: number): boolean;
105
+ stale(maxAge: number): boolean;
106
106
  /** Current error of this store, or `undefined` if there is no error. */
107
107
  get reason(): unknown;
108
108
  set reason(reason: unknown);
package/store/Store.js CHANGED
@@ -137,10 +137,10 @@ export class Store {
137
137
  *
138
138
  * @param maxAge The maximum age for the stale check.
139
139
  * - `0` zero means "always refresh" (this is the default).
140
- * - `Infinity` means "refresh only if store is still in a loading state.
140
+ * - `Infinity` means "refresh only if store is still in a loading state"
141
141
  * - Any other value may or may not be stale based on `this.age`
142
142
  */
143
- stale(maxAge = 0) {
143
+ stale(maxAge) {
144
144
  return this.age >= maxAge;
145
145
  }
146
146
  /** Current error of this store, or `undefined` if there is no error. */
@@ -0,0 +1,11 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import type { PossibleMetaData } from "../util/meta.js";
3
+ export interface AppProps extends PossibleMetaData {
4
+ children: ReactNode;
5
+ }
6
+ /**
7
+ * Root component for an application.
8
+ * - Adds the theme CSS class (which sets CSS token variables on `:root`) to `document.body` on mount and removes it on unmount.
9
+ * - Provides a `Meta` context to its children so descendants can read or update metadata.
10
+ */
11
+ export declare function App({ children, ...metadata }: AppProps): ReactElement;
package/ui/app/App.js ADDED
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { Meta } from "../misc/Meta.js";
4
+ import APP_CSS from "./App.module.css";
5
+ const _appClass = APP_CSS.app;
6
+ /**
7
+ * Root component for an application.
8
+ * - Adds the theme CSS class (which sets CSS token variables on `:root`) to `document.body` on mount and removes it on unmount.
9
+ * - Provides a `Meta` context to its children so descendants can read or update metadata.
10
+ */
11
+ export function App({ children, ...metadata }) {
12
+ useEffect(() => {
13
+ if (!_appClass)
14
+ return;
15
+ document.body.classList.add(_appClass);
16
+ return () => {
17
+ document.body.classList.remove(_appClass);
18
+ };
19
+ }, []);
20
+ return _jsx(Meta, { ...metadata, children: children });
21
+ }
@@ -0,0 +1,168 @@
1
+ :root {
2
+ color-scheme: light;
3
+
4
+ /* Widths */
5
+ --width-narrow: min(100%, 22.5rem);
6
+ --width-wide: min(100%, 33.75rem);
7
+
8
+ /* Font weights */
9
+ --weight-normal: 400;
10
+ --weight-strong: 700;
11
+ --weight-label: var(--weight-strong);
12
+
13
+ /* Font faces */
14
+ --font-sans: system-ui;
15
+ --font-mono: "Courier New", "Courier", monospace;
16
+ --font-serif: "Palatino", "Garamond", serif;
17
+
18
+ /* Semantic font faces */
19
+ --font-body: var(--font-sans);
20
+ --font-code: var(--font-mono);
21
+
22
+ /* Font sizes */
23
+ --size-small: 0.875rem;
24
+ --size-normal: 1rem;
25
+ --size-large: 1.5rem;
26
+ --size-xlarge: 2.5rem;
27
+ --size-xxlarge: 5rem;
28
+ --size-icon: 1.5rem;
29
+
30
+ /* Line heights */
31
+ --leading-none: 0;
32
+ --leading-tight: 1.25;
33
+ --leading-normal: 1.5;
34
+
35
+ /* Spacings */
36
+ --spacing-small: 0.25rem;
37
+ --spacing-inline: 0.5rem;
38
+ --spacing-paragraph: 1rem;
39
+ --spacing-element: 0.75rem;
40
+ --spacing-block: 1rem;
41
+ --spacing-spacious: 3rem;
42
+
43
+ /* Border widths */
44
+ --border-element: 2px;
45
+ --border-block: 2px;
46
+ --border-focus: 3px;
47
+
48
+ /* Radii */
49
+ --radius-inline: 0.25rem;
50
+ --radius-element: 0.5rem;
51
+ --radius-block: 1rem;
52
+
53
+ /* Durations */
54
+ --duration-fast: 150ms;
55
+ --duration-normal: 300ms;
56
+ --duration-slow: 600ms;
57
+
58
+ /* Grows */
59
+ --grow-greedy: 1000000; /* Take up as much space as possible, unless other elements are greedy too. */
60
+ --grow-normal: 1000; /* Take up a normal amount of space. */
61
+ --grow-timid: 1; /* Take up minimal space, unless the only other elements are timid too. */
62
+ --grow-none: 0;
63
+
64
+ /* Colors */
65
+ --color-blue: #156ef4;
66
+ --color-cyan: #15edf4;
67
+ --color-green: #8ce814;
68
+ --color-orange: #ffb21a;
69
+ --color-pink: #e718a2;
70
+ --color-purple: #ad15f4;
71
+ --color-red: #e5352f;
72
+ --color-yellow: #ffe01a;
73
+ --color-black: black;
74
+ --color-gray: color-mix(var(--color-blue) 30%, rgb(128 128 128)); /* Used as the "tone" color for scale of grays. */
75
+ --color-white: white;
76
+
77
+ /* Grays */
78
+ --gray-05: color-mix(var(--color-gray) 10%, var(--color-white));
79
+ --gray-10: color-mix(var(--color-gray) 20%, var(--color-white));
80
+ --gray-20: color-mix(var(--color-gray) 40%, var(--color-white));
81
+ --gray-30: color-mix(var(--color-gray) 60%, var(--color-white));
82
+ --gray-40: color-mix(var(--color-gray) 80%, var(--color-white));
83
+ --gray-50: var(--color-gray);
84
+ --gray-60: color-mix(var(--color-gray) 80%, var(--color-black));
85
+ --gray-70: color-mix(var(--color-gray) 60%, var(--color-black));
86
+ --gray-80: color-mix(var(--color-gray) 40%, var(--color-black));
87
+ --gray-90: color-mix(var(--color-gray) 20%, var(--color-black));
88
+ --gray-95: color-mix(var(--color-gray) 10%, var(--color-black));
89
+
90
+ /* Named colors */
91
+ --color-text: var(--color-black);
92
+ --color-contrast: var(--color-white); /* Contrast color — must be readable on `--color-text` */
93
+ --color-quiet: var(--gray-40); /* Quiet color is grey, used for secondary text etc. */
94
+ --color-bg: var(--color-white); /* Background color is usually the opposite of text colour. */
95
+ --color-border: var(--gray-10);
96
+ --color-overlay: color-mix(in srgb, var(--color-text) 40%, transparent);
97
+ --color-link: var(--color-blue); /* Links are usually blue. */
98
+ --color-focus: var(--color-blue); /* Focus is usually blue. */
99
+ --color-surface: var(--gray-10); /* Surface color is used for notices and buttons — must be readable on `--color-text` */
100
+
101
+ /* Shadows */
102
+ --shadow-element: 0 3px 16px -8px var(--color-overlay);
103
+ --shadow-block: 0 4px 24px -12px var(--color-overlay);
104
+
105
+ /* Primary colors */
106
+ --primary-text: var(--color-blue);
107
+ --primary-contrast: var(--color-white);
108
+ --primary-surface: color-mix(in srgb, var(--primary-text) 12%, white);
109
+
110
+ /* Secondary colors */
111
+ --secondary-text: var(--color-purple);
112
+ --secondary-contrast: var(--color-white);
113
+ --secondary-surface: color-mix(in srgb, var(--secondary-text) 12%, white);
114
+
115
+ /* Tertiary colors */
116
+ --tertiary-text: var(--color-cyan);
117
+ --tertiary-contrast: var(--color-white);
118
+ --tertiary-surface: color-mix(in srgb, var(--tertiary-text) 12%, white);
119
+
120
+ /* Quiet colors */
121
+ --quiet-text: var(--color-quiet);
122
+ --quiet-contrast: var(--color-contrast);
123
+ --quiet-surface: var(--color-surface);
124
+
125
+ /* Focus colors */
126
+ --focus-text: var(--color-focus);
127
+ --focus-contrast: var(--color-white);
128
+ --focus-surface: color-mix(in srgb, var(--focus-text) 12%, white);
129
+
130
+ /* Loading colors */
131
+ --loading-text: var(--color-loading);
132
+ --loading-contrast: var(--color-contrast);
133
+ --loading-surface: var(--color-surface);
134
+
135
+ /* Info colors */
136
+ --info-text: var(--color-blue);
137
+ --info-contrast: var(--color-white);
138
+ --info-surface: color-mix(in srgb, var(--info-text) 12%, white);
139
+
140
+ /* Success colors */
141
+ --success-text: var(--color-green);
142
+ --success-contrast: var(--color-white);
143
+ --success-surface: color-mix(in srgb, var(--success-text) 12%, white);
144
+
145
+ /* Warning colors */
146
+ --warning-text: var(--color-orange);
147
+ --warning-contrast: var(--color-white);
148
+ --warning-surface: color-mix(in srgb, var(--warning-text) 12%, white);
149
+
150
+ /* Error colors */
151
+ --error-text: var(--color-red);
152
+ --error-contrast: var(--color-white);
153
+ --error-surface: color-mix(in srgb, var(--error-text) 12%, white);
154
+
155
+ /* Danger colors */
156
+ --danger-text: var(--color-red);
157
+ --danger-contrast: var(--color-white);
158
+ --danger-surface: color-mix(in srgb, var(--danger-text) 12%, white);
159
+
160
+ /* Highlight colors */
161
+ --highlight-text: var(--color-yellow);
162
+ --highlight-contrast: var(--color-black);
163
+ --highlight-surface: color-mix(in srgb, var(--highlight-text) 12%, white);
164
+ }
165
+
166
+ .app {
167
+ /* Empty */
168
+ }
package/ui/app/App.tsx ADDED
@@ -0,0 +1,26 @@
1
+ import { type ReactElement, type ReactNode, useEffect } from "react";
2
+ import { Meta } from "../misc/Meta.js";
3
+ import type { PossibleMetaData } from "../util/meta.js";
4
+ import APP_CSS from "./App.module.css";
5
+
6
+ export interface AppProps extends PossibleMetaData {
7
+ children: ReactNode;
8
+ }
9
+
10
+ const _appClass = APP_CSS.app;
11
+
12
+ /**
13
+ * Root component for an application.
14
+ * - Adds the theme CSS class (which sets CSS token variables on `:root`) to `document.body` on mount and removes it on unmount.
15
+ * - Provides a `Meta` context to its children so descendants can read or update metadata.
16
+ */
17
+ export function App({ children, ...metadata }: AppProps): ReactElement {
18
+ useEffect(() => {
19
+ if (!_appClass) return;
20
+ document.body.classList.add(_appClass);
21
+ return () => {
22
+ document.body.classList.remove(_appClass);
23
+ };
24
+ }, []);
25
+ return <Meta {...metadata}>{children}</Meta>;
26
+ }
@@ -0,0 +1 @@
1
+ export * from "./App.js";
@@ -0,0 +1 @@
1
+ export * from "./App.js";
@@ -0,0 +1 @@
1
+ export * from "./App.js";
@@ -0,0 +1,20 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type AddressData } from "../../schema/AddressSchema.js";
3
+ import type { Nullish } from "../../util/null.js";
4
+ export interface AddressProps {
5
+ children: ReactNode;
6
+ }
7
+ export interface PhysicalAddressProps {
8
+ name?: Nullish<string>;
9
+ address: Nullish<AddressData>;
10
+ }
11
+ export interface EmailAddressProps {
12
+ name?: Nullish<string>;
13
+ email: Nullish<string>;
14
+ }
15
+ /** Show any kind of contact data. */
16
+ export declare function Address({ children }: AddressProps): import("react/jsx-runtime").JSX.Element;
17
+ /** Show an optional `AddressData` object correctly on screen. */
18
+ export declare function PhysicalAddress({ name, address }: PhysicalAddressProps): ReactElement;
19
+ /** Show an optional email address string correctly on screen. */
20
+ export declare function EmailAddress({ name, email }: EmailAddressProps): ReactElement;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { formatAddress } from "../../schema/AddressSchema.js";
3
+ import { Small } from "../inline/Small.js";
4
+ import { Strong } from "../inline/Strong.js";
5
+ import styles from "./Address.module.css";
6
+ /** Show any kind of contact data. */
7
+ export function Address({ children }) {
8
+ return _jsx("address", { className: styles.address, children: children });
9
+ }
10
+ /** Show an optional `AddressData` object correctly on screen. */
11
+ export function PhysicalAddress({ name, address }) {
12
+ return (_jsxs(Address, { children: [name && _jsx(Strong, { children: name }), name && "\n", address ? formatAddress(address) : _jsx(Small, { children: "No address" })] }));
13
+ }
14
+ /** Show an optional email address string correctly on screen. */
15
+ export function EmailAddress({ name, email }) {
16
+ return (_jsxs(Address, { children: [name && _jsx(Strong, { children: name }), name && "\n", email ? _jsx("a", { href: `mailto:${email}`, children: email }) : _jsx(Small, { children: "No email" })] }));
17
+ }
@@ -0,0 +1,20 @@
1
+ .address,
2
+ .prose address {
3
+ /* Box */
4
+ display: block;
5
+ margin-inline: 0;
6
+ margin-block: var(--address-spacing, var(--spacing-block));
7
+
8
+ /* Contents */
9
+ white-space: pre-line;
10
+ font-style: normal;
11
+ text-align: left;
12
+
13
+ /* Styles */
14
+ &:first-child {
15
+ margin-block-start: 0;
16
+ }
17
+ &:last-child {
18
+ margin-block-end: 0;
19
+ }
20
+ }
@@ -0,0 +1,47 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type AddressData, formatAddress } from "../../schema/AddressSchema.js";
3
+ import type { Nullish } from "../../util/null.js";
4
+ import { Small } from "../inline/Small.js";
5
+ import { Strong } from "../inline/Strong.js";
6
+ import styles from "./Address.module.css";
7
+
8
+ export interface AddressProps {
9
+ children: ReactNode;
10
+ }
11
+
12
+ export interface PhysicalAddressProps {
13
+ name?: Nullish<string>;
14
+ address: Nullish<AddressData>;
15
+ }
16
+
17
+ export interface EmailAddressProps {
18
+ name?: Nullish<string>;
19
+ email: Nullish<string>;
20
+ }
21
+
22
+ /** Show any kind of contact data. */
23
+ export function Address({ children }: AddressProps) {
24
+ return <address className={styles.address}>{children}</address>;
25
+ }
26
+
27
+ /** Show an optional `AddressData` object correctly on screen. */
28
+ export function PhysicalAddress({ name, address }: PhysicalAddressProps): ReactElement {
29
+ return (
30
+ <Address>
31
+ {name && <Strong>{name}</Strong>}
32
+ {name && "\n"}
33
+ {address ? formatAddress(address) : <Small>No address</Small>}
34
+ </Address>
35
+ );
36
+ }
37
+
38
+ /** Show an optional email address string correctly on screen. */
39
+ export function EmailAddress({ name, email }: EmailAddressProps): ReactElement {
40
+ return (
41
+ <Address>
42
+ {name && <Strong>{name}</Strong>}
43
+ {name && "\n"}
44
+ {email ? <a href={`mailto:${email}`}>{email}</a> : <Small>No email</Small>}
45
+ </Address>
46
+ );
47
+ }
@@ -0,0 +1,5 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ export interface BlockquoteProps {
3
+ children?: ReactNode;
4
+ }
5
+ export declare function Blockquote({ children }: BlockquoteProps): ReactElement;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from "./Blockquote.module.css";
3
+ export function Blockquote({ children }) {
4
+ return _jsx("blockquote", { className: styles.blockquote, children: children });
5
+ }
@@ -0,0 +1,21 @@
1
+ .blockquote,
2
+ .prose blockquote {
3
+ /* Box */
4
+ display: block;
5
+ margin-inline: 0;
6
+ margin-block: var(--blockquote-spacing, var(--spacing-block));
7
+ border-inline-start: var(--blockquote-border, var(--border-focus)) solid var(--blockquote-color-border, var(--color-border));
8
+ padding-inline-start: var(--blockquote-padding, var(--spacing-paragraph));
9
+ padding-block: var(--spacing-inline);
10
+
11
+ /* Style */
12
+ color: var(--blockquote-color-text, inherit);
13
+
14
+ /* Styles */
15
+ &:first-child {
16
+ margin-block-start: 0;
17
+ }
18
+ &:last-child {
19
+ margin-block-end: 0;
20
+ }
21
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import styles from "./Blockquote.module.css";
3
+
4
+ export interface BlockquoteProps {
5
+ children?: ReactNode;
6
+ }
7
+
8
+ export function Blockquote({ children }: BlockquoteProps): ReactElement {
9
+ return <blockquote className={styles.blockquote}>{children}</blockquote>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ export interface CardProps {
3
+ children: ReactNode;
4
+ /** Constrain the section to narrow width (defaults to full-width). */
5
+ narrow?: boolean;
6
+ /** Constrain the section to wide width (defaults to full-width). */
7
+ wide?: boolean;
8
+ }
9
+ /** Cards are boxed areas for content to sit within. */
10
+ export declare function Card({ children, ...variants }: CardProps): ReactElement;