shelving 1.322.0 → 1.322.2

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 (316) hide show
  1. package/docs/api/APIProvider.md +2 -2
  2. package/docs/api/CachedAPIProvider.md +6 -8
  3. package/docs/api/ClientAPIProvider.md +5 -5
  4. package/docs/api/DebugAPIProvider.md +3 -5
  5. package/docs/api/HydratingAPIProvider.md +2 -2
  6. package/docs/api/JSONAPIProvider.md +3 -5
  7. package/docs/api/LoggingAPIProvider.md +7 -9
  8. package/docs/api/MockAPIProvider.md +4 -4
  9. package/docs/api/MockEndpointAPIProvider.md +5 -7
  10. package/docs/api/ThroughAPIProvider.md +15 -10
  11. package/docs/api/ValidationAPIProvider.md +3 -5
  12. package/docs/api/XMLAPIProvider.md +3 -3
  13. package/docs/api.md +48 -44
  14. package/docs/bun.md +9 -9
  15. package/docs/db/DBProvider.md +6 -6
  16. package/docs/db/MemoryDBProvider.md +3 -3
  17. package/docs/db/PostgresProvider.md +6 -4
  18. package/docs/db/SQLProvider.md +6 -3
  19. package/docs/db/SQLiteProvider.md +9 -4
  20. package/docs/db/StorageDBProvider.md +2 -2
  21. package/docs/db/ThroughDBProvider.md +6 -6
  22. package/docs/db/UndoDBProvider.md +2 -2
  23. package/docs/db.md +32 -32
  24. package/docs/error/NetworkError.md +5 -5
  25. package/docs/error/RequestError.md +4 -4
  26. package/docs/error/RequiredError.md +2 -2
  27. package/docs/error/ResponseError.md +1 -1
  28. package/docs/error/UnexpectedError.md +1 -1
  29. package/docs/error/UnsupportedError.md +3 -3
  30. package/docs/error/ValueError.md +2 -2
  31. package/docs/error.md +20 -19
  32. package/docs/extract.md +14 -14
  33. package/docs/firebase.md +6 -6
  34. package/docs/guides/building-with-shelving.md +113 -85
  35. package/docs/guides/styleguide.md +29 -29
  36. package/docs/index.md +3 -2
  37. package/docs/llms-full.txt +2541 -2295
  38. package/docs/markup.md +15 -17
  39. package/docs/react/createAPIContext.md +12 -12
  40. package/docs/react/createDBContext.md +21 -15
  41. package/docs/react/useInstance.md +2 -2
  42. package/docs/react/useLazy.md +1 -1
  43. package/docs/react/useMap.md +10 -6
  44. package/docs/react/useReduce.md +2 -2
  45. package/docs/react/useSequence.md +2 -2
  46. package/docs/react/useStore.md +10 -10
  47. package/docs/react.md +22 -16
  48. package/docs/schema/ArraySchema.md +6 -6
  49. package/docs/schema/BooleanSchema.md +5 -5
  50. package/docs/schema/ChoiceSchema.md +1 -1
  51. package/docs/schema/CurrencyAmountSchema.md +2 -2
  52. package/docs/schema/DataSchema.md +5 -5
  53. package/docs/schema/NullableSchema.md +4 -4
  54. package/docs/schema/NumberSchema.md +4 -4
  55. package/docs/schema/OptionalSchema.md +1 -1
  56. package/docs/schema/StringSchema.md +7 -7
  57. package/docs/schema.md +21 -21
  58. package/docs/sequence/DeferredSequence.md +1 -1
  59. package/docs/sequence/InspectSequence.md +8 -6
  60. package/docs/sequence/LazySequence.md +3 -3
  61. package/docs/sequence/Sequence.md +6 -6
  62. package/docs/sequence/ThroughSequence.md +4 -2
  63. package/docs/sequence.md +3 -3
  64. package/docs/store/ArrayStore.md +6 -6
  65. package/docs/store/BooleanStore.md +2 -2
  66. package/docs/store/BusyStore.md +1 -1
  67. package/docs/store/DataStore.md +5 -5
  68. package/docs/store/DictionaryStore.md +4 -4
  69. package/docs/store/FetchStore.md +6 -6
  70. package/docs/store/PathStore.md +4 -4
  71. package/docs/store/PayloadFetchStore.md +1 -5
  72. package/docs/store/Store.md +8 -6
  73. package/docs/store/URLStore.md +5 -5
  74. package/docs/store.md +15 -15
  75. package/docs/test.md +6 -6
  76. package/docs/ui/App.md +99 -69
  77. package/docs/ui/AppLayout.md +35 -26
  78. package/docs/ui/BackButton.md +13 -11
  79. package/docs/ui/Button.md +73 -64
  80. package/docs/ui/Card.md +23 -22
  81. package/docs/ui/Catcher.md +3 -3
  82. package/docs/ui/ClassProps.md +1 -1
  83. package/docs/ui/Code.md +11 -11
  84. package/docs/ui/CollapseTransition.md +5 -5
  85. package/docs/ui/Deleted.md +6 -6
  86. package/docs/ui/Details.md +13 -13
  87. package/docs/ui/Dialog.md +42 -28
  88. package/docs/ui/Dialogs.md +4 -0
  89. package/docs/ui/DocumentationButtons.md +2 -2
  90. package/docs/ui/DocumentationCard.md +2 -2
  91. package/docs/ui/DocumentationFrame.md +4 -4
  92. package/docs/ui/DocumentationLive.md +11 -11
  93. package/docs/ui/DocumentationPage.md +3 -3
  94. package/docs/ui/Emphasis.md +4 -4
  95. package/docs/ui/Empty.md +2 -2
  96. package/docs/ui/FadeTransition.md +9 -9
  97. package/docs/ui/Field.md +14 -14
  98. package/docs/ui/FixedLayout.md +27 -25
  99. package/docs/ui/Form.md +41 -39
  100. package/docs/ui/FormStore.md +6 -2
  101. package/docs/ui/Grid.md +21 -9
  102. package/docs/ui/HTML.md +10 -8
  103. package/docs/ui/Head.md +2 -3
  104. package/docs/ui/Heading.md +12 -12
  105. package/docs/ui/HorizontalTransition.md +10 -10
  106. package/docs/ui/Icon.md +4 -4
  107. package/docs/ui/ImageInput.md +12 -12
  108. package/docs/ui/Inserted.md +6 -6
  109. package/docs/ui/Link.md +11 -11
  110. package/docs/ui/List.md +7 -7
  111. package/docs/ui/Loading.md +6 -6
  112. package/docs/ui/Mark.md +11 -9
  113. package/docs/ui/Markup.md +4 -4
  114. package/docs/ui/Menu.md +24 -24
  115. package/docs/ui/MenuItem.md +29 -29
  116. package/docs/ui/Modal.md +57 -45
  117. package/docs/ui/Navigation.md +28 -26
  118. package/docs/ui/NavigationStore.md +18 -18
  119. package/docs/ui/Notice.md +15 -15
  120. package/docs/ui/Notices.md +17 -17
  121. package/docs/ui/Page.md +13 -13
  122. package/docs/ui/Panel.md +8 -8
  123. package/docs/ui/Paragraph.md +5 -5
  124. package/docs/ui/Progress.md +11 -11
  125. package/docs/ui/Prose.md +6 -6
  126. package/docs/ui/QueryRadiosInput.md +2 -2
  127. package/docs/ui/RouteCache.md +27 -27
  128. package/docs/ui/Router.md +70 -61
  129. package/docs/ui/SchemaInput.md +20 -20
  130. package/docs/ui/Scroll.md +16 -16
  131. package/docs/ui/Section.md +13 -10
  132. package/docs/ui/SidebarLayout.md +27 -27
  133. package/docs/ui/Small.md +4 -4
  134. package/docs/ui/Span.md +3 -1
  135. package/docs/ui/StackButton.md +13 -7
  136. package/docs/ui/Strong.md +4 -4
  137. package/docs/ui/Subheading.md +12 -12
  138. package/docs/ui/TINT_CLASS.md +11 -11
  139. package/docs/ui/Table.md +40 -29
  140. package/docs/ui/Tag.md +15 -15
  141. package/docs/ui/Title.md +13 -13
  142. package/docs/ui/Transition.md +22 -22
  143. package/docs/ui/TreeApp.md +8 -8
  144. package/docs/ui/TreeMarkup.md +2 -2
  145. package/docs/ui/TreeMenu.md +3 -3
  146. package/docs/ui/TreeSidebar.md +1 -1
  147. package/docs/ui/VerticalTransition.md +8 -8
  148. package/docs/ui/getClass.md +10 -10
  149. package/docs/ui/getColorClass.md +23 -23
  150. package/docs/ui/getDurationClass.md +5 -5
  151. package/docs/ui/getGridClass.md +2 -2
  152. package/docs/ui/getHeightClass.md +4 -4
  153. package/docs/ui/getRadiusClass.md +9 -9
  154. package/docs/ui/getShadowClass.md +6 -6
  155. package/docs/ui/getSpaceClass.md +13 -13
  156. package/docs/ui/getStrokeClass.md +6 -6
  157. package/docs/ui/getTypographyClass.md +38 -38
  158. package/docs/ui/getWidthClass.md +4 -4
  159. package/docs/ui/notify.md +11 -11
  160. package/docs/ui/requireContext.md +1 -1
  161. package/docs/ui.md +4 -4
  162. package/docs/util/array.md +35 -29
  163. package/docs/util/async.md +2 -2
  164. package/docs/util/base64.md +7 -7
  165. package/docs/util/boolean.md +10 -10
  166. package/docs/util/buffer.md +5 -5
  167. package/docs/util/bytes.md +9 -9
  168. package/docs/util/class.md +10 -6
  169. package/docs/util/color.md +13 -13
  170. package/docs/util/constants.md +2 -2
  171. package/docs/util/crypto.md +1 -1
  172. package/docs/util/currency.md +2 -2
  173. package/docs/util/data.md +18 -18
  174. package/docs/util/date.md +22 -22
  175. package/docs/util/debug/debug.md +12 -12
  176. package/docs/util/dictionary.md +21 -18
  177. package/docs/util/diff.md +6 -6
  178. package/docs/util/dispose/dispose.md +5 -5
  179. package/docs/util/duration.md +9 -9
  180. package/docs/util/element.md +1 -1
  181. package/docs/util/entity.md +6 -6
  182. package/docs/util/entry.md +21 -8
  183. package/docs/util/env.md +2 -2
  184. package/docs/util/equal.md +16 -16
  185. package/docs/util/error.md +4 -4
  186. package/docs/util/file.md +8 -8
  187. package/docs/util/filter.md +9 -5
  188. package/docs/util/format.md +18 -18
  189. package/docs/util/function.md +4 -4
  190. package/docs/util/geo.md +13 -13
  191. package/docs/util/hash.md +3 -3
  192. package/docs/util/http.md +1 -1
  193. package/docs/util/hydrate/hydrate.md +7 -4
  194. package/docs/util/item.md +4 -4
  195. package/docs/util/iterate.md +11 -11
  196. package/docs/util/jwt.md +1 -6
  197. package/docs/util/link.md +5 -5
  198. package/docs/util/map.md +17 -11
  199. package/docs/util/merge.md +2 -5
  200. package/docs/util/null.md +20 -10
  201. package/docs/util/number.md +16 -16
  202. package/docs/util/object.md +25 -22
  203. package/docs/util/path.md +17 -17
  204. package/docs/util/query.md +23 -25
  205. package/docs/util/random.md +7 -7
  206. package/docs/util/regexp.md +16 -16
  207. package/docs/util/sequence.md +16 -10
  208. package/docs/util/serialise/serialise.md +6 -6
  209. package/docs/util/set.md +10 -10
  210. package/docs/util/sort.md +10 -11
  211. package/docs/util/source.md +11 -7
  212. package/docs/util/start.md +8 -8
  213. package/docs/util/string.md +14 -14
  214. package/docs/util/template.md +3 -3
  215. package/docs/util/timeout.md +5 -5
  216. package/docs/util/transform.md +6 -6
  217. package/docs/util/tree.md +13 -13
  218. package/docs/util/undefined.md +3 -3
  219. package/docs/util/units.md +15 -15
  220. package/docs/util/update.md +16 -16
  221. package/docs/util/uri.md +12 -12
  222. package/docs/util/url.md +11 -11
  223. package/docs/util/uuid.md +3 -3
  224. package/docs/util/validate.md +14 -9
  225. package/package.json +3 -3
  226. package/skills/shelving/SKILL.md +1 -0
  227. package/ui/README.md +4 -4
  228. package/ui/app/App.md +99 -69
  229. package/ui/block/Card.md +23 -22
  230. package/ui/block/Details.md +13 -13
  231. package/ui/block/Grid.md +21 -9
  232. package/ui/block/Heading.md +12 -12
  233. package/ui/block/List.md +7 -7
  234. package/ui/block/Panel.md +8 -8
  235. package/ui/block/Paragraph.md +5 -5
  236. package/ui/block/Prose.md +6 -6
  237. package/ui/block/Section.md +13 -10
  238. package/ui/block/Subheading.md +12 -12
  239. package/ui/block/Title.md +13 -13
  240. package/ui/button/Button.md +73 -64
  241. package/ui/dialog/Dialog.md +42 -28
  242. package/ui/dialog/Dialogs.d.ts +4 -0
  243. package/ui/dialog/Dialogs.js +4 -0
  244. package/ui/dialog/Dialogs.tsx +4 -0
  245. package/ui/dialog/Modal.md +57 -45
  246. package/ui/docs/DocumentationButtons.md +2 -2
  247. package/ui/docs/DocumentationCard.md +2 -2
  248. package/ui/docs/DocumentationFrame.md +4 -4
  249. package/ui/docs/DocumentationLive.md +11 -11
  250. package/ui/docs/DocumentationPage.md +3 -3
  251. package/ui/form/Field.md +14 -14
  252. package/ui/form/Form.md +41 -39
  253. package/ui/form/FormStore.md +6 -2
  254. package/ui/form/Progress.md +11 -11
  255. package/ui/inline/Code.md +11 -11
  256. package/ui/inline/Deleted.md +6 -6
  257. package/ui/inline/Emphasis.md +4 -4
  258. package/ui/inline/Inserted.md +6 -6
  259. package/ui/inline/Link.md +11 -11
  260. package/ui/inline/Mark.md +11 -9
  261. package/ui/inline/Small.md +4 -4
  262. package/ui/inline/Span.md +3 -1
  263. package/ui/inline/Strong.md +4 -4
  264. package/ui/input/ImageInput.md +12 -12
  265. package/ui/input/QueryRadiosInput.md +2 -2
  266. package/ui/input/SchemaInput.md +20 -20
  267. package/ui/layout/AppLayout.md +35 -26
  268. package/ui/layout/AppLayout.module.css +3 -16
  269. package/ui/layout/FixedLayout.md +27 -25
  270. package/ui/layout/SidebarLayout.md +27 -27
  271. package/ui/layout/SidebarLayout.module.css +1 -0
  272. package/ui/menu/Menu.md +24 -24
  273. package/ui/menu/MenuItem.md +29 -29
  274. package/ui/misc/Catcher.md +3 -3
  275. package/ui/misc/Icon.md +4 -4
  276. package/ui/misc/Loading.md +6 -6
  277. package/ui/misc/Markup.md +4 -4
  278. package/ui/misc/Tag.md +15 -15
  279. package/ui/notice/Empty.md +2 -2
  280. package/ui/notice/Notice.md +15 -15
  281. package/ui/notice/Notices.md +17 -17
  282. package/ui/page/HTML.md +10 -8
  283. package/ui/page/Head.md +2 -3
  284. package/ui/page/Page.md +13 -13
  285. package/ui/router/BackButton.md +13 -11
  286. package/ui/router/Navigation.md +28 -26
  287. package/ui/router/NavigationStore.md +18 -18
  288. package/ui/router/RouteCache.md +27 -27
  289. package/ui/router/Router.md +70 -61
  290. package/ui/router/StackButton.md +13 -7
  291. package/ui/style/Scroll.md +16 -16
  292. package/ui/style/TINT_CLASS.md +11 -11
  293. package/ui/style/getColorClass.md +23 -23
  294. package/ui/style/getDurationClass.md +5 -5
  295. package/ui/style/getGridClass.md +2 -2
  296. package/ui/style/getHeightClass.md +4 -4
  297. package/ui/style/getRadiusClass.md +9 -9
  298. package/ui/style/getShadowClass.md +6 -6
  299. package/ui/style/getSpaceClass.md +13 -13
  300. package/ui/style/getStrokeClass.md +6 -6
  301. package/ui/style/getTypographyClass.md +38 -38
  302. package/ui/style/getWidthClass.md +4 -4
  303. package/ui/table/Table.md +40 -30
  304. package/ui/transition/CollapseTransition.md +5 -5
  305. package/ui/transition/FadeTransition.md +9 -9
  306. package/ui/transition/HorizontalTransition.md +10 -10
  307. package/ui/transition/Transition.md +22 -22
  308. package/ui/transition/VerticalTransition.md +8 -8
  309. package/ui/tree/TreeApp.md +8 -8
  310. package/ui/tree/TreeMarkup.md +2 -2
  311. package/ui/tree/TreeMenu.md +3 -3
  312. package/ui/tree/TreeSidebar.md +1 -1
  313. package/ui/util/ClassProps.md +1 -1
  314. package/ui/util/getClass.md +10 -10
  315. package/ui/util/notify.md +11 -11
  316. package/ui/util/requireContext.md +1 -1
@@ -50,17 +50,17 @@ function Counter() {
50
50
 
51
51
  ## Styling
52
52
 
53
- | Variable | Styles | Default |
54
- |---|---|---|
55
- | `--documentation-live-bezel` | Space above and below the speaker slot, which sets the thickness of the top and the chin (one length) | `2.25rem` |
56
- | `--documentation-live-body` | Fill of the phone | `oklch(92% 0 0deg)` (light grey) |
57
- | `--documentation-live-detail` | Colour of the speaker slot and home button | `oklch(80% 0 0deg)` |
58
- | `--documentation-live-edge` | Width of the phone edge left and right of the screen (one length) | `0.75rem` |
59
- | `--documentation-live-gap` | Space between the code and the phone (one length) | `var(--space-normal)` (16px) |
60
- | `--documentation-live-height` | Height of the screen (one length) | `26rem` |
61
- | `--documentation-live-radius` | Corner radius of the phone | `2.5rem` |
62
- | `--documentation-live-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
63
- | `--documentation-live-width` | Width of the phone (one length) | `22rem` |
53
+ | Variable | Styles | Default |
54
+ | ----------------------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------- |
55
+ | `--documentation-live-bezel` | Space above and below the speaker slot, which sets the thickness of the top and the chin (one length) | `2.25rem` |
56
+ | `--documentation-live-body` | Fill of the phone | `oklch(92% 0 0deg)` (light grey) |
57
+ | `--documentation-live-detail` | Colour of the speaker slot and home button | `oklch(80% 0 0deg)` |
58
+ | `--documentation-live-edge` | Width of the phone edge left and right of the screen (one length) | `0.75rem` |
59
+ | `--documentation-live-gap` | Space between the code and the phone (one length) | `var(--space-normal)` (16px) |
60
+ | `--documentation-live-height` | Height of the screen (one length) | `26rem` |
61
+ | `--documentation-live-radius` | Corner radius of the phone | `2.5rem` |
62
+ | `--documentation-live-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
63
+ | `--documentation-live-width` | Width of the phone (one length) | `22rem` |
64
64
 
65
65
  Global tokens: `--space-normal`, `--space-xsmall`, `--space-paragraph`, `--font-label`, `--size-small`. The code block is a raw `<pre>` with `--preformatted-space` set to `0`, so it takes the other `.prose pre` styles of `<Preformatted>`. The code and phone are side by side when the screen is 75rem or wider.
66
66
 
@@ -28,7 +28,7 @@ Used automatically by `<TreeApp>`. To render a single page manually, spread the
28
28
  import { DocumentationPage } from "shelving/ui";
29
29
 
30
30
  // `element` is a `tree-documentation` element from DirectoryExtractor (see /extract).
31
- <DocumentationPage {...element.props} />
31
+ <DocumentationPage {...element.props} />;
32
32
  ```
33
33
 
34
34
  To replace this renderer across the whole site, wrap the app in `TreePageMapping`.
@@ -37,8 +37,8 @@ To replace this renderer across the whole site, wrap the app in `TreePageMapping
37
37
  import { TreeApp, TreePageMapping } from "shelving/ui";
38
38
 
39
39
  <TreePageMapping mapping={{ "tree-documentation": MyDocumentationPage }}>
40
- <TreeApp tree={tree} />
41
- </TreePageMapping>
40
+ <TreeApp tree={tree} />
41
+ </TreePageMapping>;
42
42
  ```
43
43
 
44
44
  ## Styling
@@ -21,16 +21,16 @@ Emphasised text — renders an `<em>` element for stress emphasis, the kind that
21
21
  import { Paragraph, Emphasis } from "shelving/ui";
22
22
 
23
23
  <Paragraph>
24
- You were meant to turn <Emphasis>left</Emphasis>.
25
- </Paragraph>
24
+ You were meant to turn <Emphasis>left</Emphasis>.
25
+ </Paragraph>;
26
26
  ```
27
27
 
28
28
  ## Styling
29
29
 
30
30
  `Emphasis` only sets its font style and inherits everything else from its surroundings.
31
31
 
32
- | Variable | Styles | Default |
33
- |---|---|---|
32
+ | Variable | Styles | Default |
33
+ | ------------------ | ---------- | -------- |
34
34
  | `--emphasis-style` | Font style | `italic` |
35
35
 
36
36
 
package/docs/ui/Empty.md CHANGED
@@ -24,7 +24,7 @@ import { Empty, Paragraph } from "shelving/ui";
24
24
 
25
25
  <Empty>
26
26
  <Paragraph>No challenges yet.</Paragraph>
27
- </Empty>
27
+ </Empty>;
28
28
  ```
29
29
 
30
30
  ### Loading list
@@ -34,7 +34,7 @@ import { EMPTY_LOADING, Loader } from "shelving/ui";
34
34
 
35
35
  <Loader fallback={EMPTY_LOADING}>
36
36
  <LoadChallenges />
37
- </Loader>
37
+ </Loader>;
38
38
  ```
39
39
 
40
40
  ## Styling
@@ -19,11 +19,11 @@ A `<Transition>` preset that fades its children in and out by animating opacity.
19
19
  import { FadeTransition } from "shelving/ui";
20
20
 
21
21
  function Panel({ visible }: { visible: boolean }) {
22
- return visible ? (
23
- <FadeTransition>
24
- <div className="panel">…</div>
25
- </FadeTransition>
26
- ) : null;
22
+ return visible ? (
23
+ <FadeTransition>
24
+ <div className="panel">…</div>
25
+ </FadeTransition>
26
+ ) : null;
27
27
  }
28
28
  ```
29
29
 
@@ -36,14 +36,14 @@ import { ViewTransition } from "react";
36
36
  import { FADE_TRANSITION_CLASS } from "shelving/ui";
37
37
 
38
38
  <ViewTransition enter={FADE_TRANSITION_CLASS} exit={FADE_TRANSITION_CLASS}>
39
- <div className="panel">…</div>
40
- </ViewTransition>
39
+ <div className="panel">…</div>
40
+ </ViewTransition>;
41
41
  ```
42
42
 
43
43
  ## Styling
44
44
 
45
- | Variable | Styles | Default |
46
- |---|---|---|
45
+ | Variable | Styles | Default |
46
+ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
47
47
  | `--fade-transition-duration` | Duration of the fade in, the fade out, and the crossfade when content changes in place (also the group's size and position morph) | `var(--duration-fast)` |
48
48
 
49
49
  **Global tokens it reads** — `--duration-fast`.
package/docs/ui/Field.md CHANGED
@@ -21,8 +21,8 @@ The visual wrapper for a single form control. `Field` renders a `<label>` with a
21
21
  import { Field, TextInput } from "shelving/ui";
22
22
 
23
23
  <Field title="Email address" message={emailError}>
24
- <TextInput name="email" value={email} onValue={setEmail} required />
25
- </Field>
24
+ <TextInput name="email" value={email} onValue={setEmail} required />
25
+ </Field>;
26
26
  ```
27
27
 
28
28
  ### Two-up layout
@@ -42,18 +42,18 @@ import { Field, TextInput } from "shelving/ui";
42
42
 
43
43
  `Field` paints its label, description, and message text. Override these hooks at `:root` or any ancestor scope.
44
44
 
45
- | Variable | Styles | Default |
46
- |---|---|---|
47
- | `--field-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
48
- | `--field-gap` | Gap between label, control, and message | `var(--space-xsmall)` |
49
- | `--field-title-size` | Title font size | `var(--size-normal)` |
50
- | `--field-title-leading` | Title line height | `var(--leading)` |
51
- | `--field-title-weight` | Title font weight | `var(--weight-strong)` |
52
- | `--field-title-color` | Title colour | `var(--tint-00)` |
53
- | `--field-description-size` | Description font size | `var(--size-normal)` |
54
- | `--field-description-leading` | Description line height | `var(--leading)` |
55
- | `--field-description-weight` | Description font weight | `var(--weight-normal)` |
56
- | `--field-description-color` | Description colour | `var(--tint-70)` |
45
+ | Variable | Styles | Default |
46
+ | ----------------------------- | --------------------------------------- | ------------------------------- |
47
+ | `--field-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
48
+ | `--field-gap` | Gap between label, control, and message | `var(--space-xsmall)` |
49
+ | `--field-title-size` | Title font size | `var(--size-normal)` |
50
+ | `--field-title-leading` | Title line height | `var(--leading)` |
51
+ | `--field-title-weight` | Title font weight | `var(--weight-strong)` |
52
+ | `--field-title-color` | Title colour | `var(--tint-00)` |
53
+ | `--field-description-size` | Description font size | `var(--size-normal)` |
54
+ | `--field-description-leading` | Description line height | `var(--leading)` |
55
+ | `--field-description-weight` | Description font weight | `var(--weight-normal)` |
56
+ | `--field-description-color` | Description colour | `var(--tint-70)` |
57
57
 
58
58
  **Global tokens it reads:** the tint ladder `--tint-00` and `--tint-70`, plus `--space-paragraph`, `--space-xsmall`, `--size-normal`, `--weight-strong`, `--weight-normal`, and `--leading`.
59
59
 
@@ -24,23 +24,25 @@ import { Block, FixedLayout, Router, Scroll } from "shelving/ui";
24
24
 
25
25
  // The signed-out screens: one layout around their own router.
26
26
  <FixedLayout>
27
- <Scroll vertical cover>
28
- <Router routes={{
29
- "/login": LoginPage,
30
- "/register": RegisterPage,
31
- }} />
32
- </Scroll>
33
- </FixedLayout>
27
+ <Scroll vertical cover>
28
+ <Router
29
+ routes={{
30
+ "/login": LoginPage,
31
+ "/register": RegisterPage,
32
+ }}
33
+ />
34
+ </Scroll>
35
+ </FixedLayout>;
34
36
 
35
37
  // Each page centres its own content.
36
38
  function LoginPage() {
37
- return (
38
- <Page title="Log in">
39
- <Block height="full" middle width="narrow" padding="xxlarge" indent="normal">
40
- <LoginForm />
41
- </Block>
42
- </Page>
43
- );
39
+ return (
40
+ <Page title="Log in">
41
+ <Block height="full" middle width="narrow" padding="xxlarge" indent="normal">
42
+ <LoginForm />
43
+ </Block>
44
+ </Page>
45
+ );
44
46
  }
45
47
  ```
46
48
 
@@ -50,24 +52,24 @@ An app-level error, outside every other layout:
50
52
  import { Catcher, ErrorPage, type ErrorProps, FixedLayout, Scroll } from "shelving/ui";
51
53
 
52
54
  function AppError({ reason }: ErrorProps) {
53
- return (
54
- <FixedLayout>
55
- <Scroll vertical cover>
56
- <ErrorPage reason={reason} />
57
- </Scroll>
58
- </FixedLayout>
59
- );
55
+ return (
56
+ <FixedLayout>
57
+ <Scroll vertical cover>
58
+ <ErrorPage reason={reason} />
59
+ </Scroll>
60
+ </FixedLayout>
61
+ );
60
62
  }
61
63
 
62
- <Catcher as={AppError}>…</Catcher>
64
+ <Catcher as={AppError}>…</Catcher>;
63
65
  ```
64
66
 
65
67
  ## Styling
66
68
 
67
- | Variable | Styles | Default |
68
- |---|---|---|
69
+ | Variable | Styles | Default |
70
+ | --------------------------- | ------------------------------------------- | ------------------------- |
69
71
  | `--fixed-layout-background` | Page background while the layout is mounted | `var(--tint-100)` (white) |
70
- | `--fixed-layout-color` | Text colour for the layout | `var(--tint-00)` (black) |
72
+ | `--fixed-layout-color` | Text colour for the layout | `var(--tint-00)` (black) |
71
73
 
72
74
  **Global tokens it reads** — `--tint-00` and `--tint-100`.
73
75
 
package/docs/ui/Form.md CHANGED
@@ -28,21 +28,21 @@ import { Form } from "shelving/ui";
28
28
  import { DATA, StringSchema, NumberSchema } from "shelving/schema";
29
29
 
30
30
  const PRODUCT_SCHEMA = DATA({
31
- name: new StringSchema({ title: "Name", min: 1, max: 100 }),
32
- price: new NumberSchema({ title: "Price", min: 0 }),
31
+ name: new StringSchema({ title: "Name", min: 1, max: 100 }),
32
+ price: new NumberSchema({ title: "Price", min: 0 }),
33
33
  });
34
34
 
35
35
  export function NewProductForm() {
36
- return (
37
- <Form
38
- schema={PRODUCT_SCHEMA}
39
- submit="Create product"
40
- onSubmit={async data => {
41
- await createProduct(data);
42
- return "Product created"; // dispatched as a success notice
43
- }}
44
- />
45
- );
36
+ return (
37
+ <Form
38
+ schema={PRODUCT_SCHEMA}
39
+ submit="Create product"
40
+ onSubmit={async data => {
41
+ await createProduct(data);
42
+ return "Product created"; // dispatched as a success notice
43
+ }}
44
+ />
45
+ );
46
46
  }
47
47
  ```
48
48
 
@@ -53,23 +53,23 @@ import { Form } from "shelving/ui";
53
53
  import { DATA, StringSchema, NumberSchema, BOOLEAN } from "shelving/schema";
54
54
 
55
55
  const LISTING_SCHEMA = DATA({
56
- title: new StringSchema({ title: "Title", min: 1, max: 80 }),
57
- price: new NumberSchema({ title: "Price", min: 0 }),
58
- published: BOOLEAN,
56
+ title: new StringSchema({ title: "Title", min: 1, max: 80 }),
57
+ price: new NumberSchema({ title: "Price", min: 0 }),
58
+ published: BOOLEAN,
59
59
  });
60
60
 
61
61
  export function ListingForm({ listing }: { listing?: typeof LISTING_SCHEMA.type }) {
62
- return (
63
- <Form
64
- schema={LISTING_SCHEMA}
65
- data={listing}
66
- submit={listing ? "Save changes" : "Publish listing"}
67
- onSubmit={async data => {
68
- await saveListing(data);
69
- return listing ? "Listing updated" : "Listing published";
70
- }}
71
- />
72
- );
62
+ return (
63
+ <Form
64
+ schema={LISTING_SCHEMA}
65
+ data={listing}
66
+ submit={listing ? "Save changes" : "Publish listing"}
67
+ onSubmit={async data => {
68
+ await saveListing(data);
69
+ return listing ? "Listing updated" : "Listing published";
70
+ }}
71
+ />
72
+ );
73
73
  }
74
74
  ```
75
75
 
@@ -81,19 +81,21 @@ Provide explicit `children` when you need control over field order, groupings, o
81
81
  import { Form, Field, FormInput, SubmitButton, Button, FormMessage } from "shelving/ui";
82
82
 
83
83
  <Form schema={LISTING_SCHEMA} data={listing} onSubmit={handleSubmit}>
84
- <Field title="Title" required>
85
- <FormInput name="title" />
86
- </Field>
87
- <Field title="Price">
88
- <FormInput name="price" />
89
- </Field>
90
- <FormInput name="published" />
91
- <footer>
92
- <SubmitButton>Save changes</SubmitButton>
93
- <Button plain onClick={onCancel}>Cancel</Button>
94
- <FormMessage />
95
- </footer>
96
- </Form>
84
+ <Field title="Title" required>
85
+ <FormInput name="title" />
86
+ </Field>
87
+ <Field title="Price">
88
+ <FormInput name="price" />
89
+ </Field>
90
+ <FormInput name="published" />
91
+ <footer>
92
+ <SubmitButton>Save changes</SubmitButton>
93
+ <Button plain onClick={onCancel}>
94
+ Cancel
95
+ </Button>
96
+ <FormMessage />
97
+ </footer>
98
+ </Form>;
97
99
  ```
98
100
 
99
101
  ## Notices and error surfacing
@@ -42,8 +42,12 @@ const data = store.validated; // Fully-typed data, or throws a string message.
42
42
  import { requireForm } from "shelving/ui";
43
43
 
44
44
  function ResetButton() {
45
- const store = requireForm();
46
- return <Button plain onClick={() => store.set("name", "")}>Clear name</Button>;
45
+ const store = requireForm();
46
+ return (
47
+ <Button plain onClick={() => store.set("name", "")}>
48
+ Clear name
49
+ </Button>
50
+ );
47
51
  }
48
52
  ```
49
53
 
package/docs/ui/Grid.md CHANGED
@@ -22,11 +22,19 @@ A grid container that arranges its children in equal-width columns. Renders a `<
22
22
  import { Card, Grid, Paragraph } from "shelving/ui";
23
23
 
24
24
  <Grid gap="small">
25
- <Card><Paragraph>Running</Paragraph></Card>
26
- <Card><Paragraph>Cycling</Paragraph></Card>
27
- <Card><Paragraph>Swimming</Paragraph></Card>
28
- <Card><Paragraph>Rowing</Paragraph></Card>
29
- </Grid>
25
+ <Card>
26
+ <Paragraph>Running</Paragraph>
27
+ </Card>
28
+ <Card>
29
+ <Paragraph>Cycling</Paragraph>
30
+ </Card>
31
+ <Card>
32
+ <Paragraph>Swimming</Paragraph>
33
+ </Card>
34
+ <Card>
35
+ <Paragraph>Rowing</Paragraph>
36
+ </Card>
37
+ </Grid>;
30
38
  ```
31
39
 
32
40
  ### A list of tiles
@@ -35,8 +43,10 @@ import { Card, Grid, Paragraph } from "shelving/ui";
35
43
  import { Grid } from "shelving/ui";
36
44
 
37
45
  <Grid as="ul" columns={3} gap="normal">
38
- {badges.map(badge => <li key={badge.id}>{badge.name}</li>)}
39
- </Grid>
46
+ {badges.map(badge => (
47
+ <li key={badge.id}>{badge.name}</li>
48
+ ))}
49
+ </Grid>;
40
50
  ```
41
51
 
42
52
  ### Days of the week
@@ -45,8 +55,10 @@ import { Grid } from "shelving/ui";
45
55
  import { Grid } from "shelving/ui";
46
56
 
47
57
  <Grid as="ol" columns={7} gap="xsmall">
48
- {days.map(day => <li key={day.date}>{day.label}</li>)}
49
- </Grid>
58
+ {days.map(day => (
59
+ <li key={day.date}>{day.label}</li>
60
+ ))}
61
+ </Grid>;
50
62
  ```
51
63
 
52
64
  ## Styling
package/docs/ui/HTML.md CHANGED
@@ -22,14 +22,16 @@ import { Navigation, Router } from "shelving/ui";
22
22
 
23
23
  // Server-side render — pass the request URL to <HTML>.
24
24
  renderToString(
25
- <HTML app="My App" root="https://example.com/" url={requestUrl} language="en">
26
- <Navigation>
27
- <Router routes={{
28
- "/": HomePage,
29
- "/about": AboutPage,
30
- }}/>
31
- </Navigation>
32
- </HTML>
25
+ <HTML app="My App" root="https://example.com/" url={requestUrl} language="en">
26
+ <Navigation>
27
+ <Router
28
+ routes={{
29
+ "/": HomePage,
30
+ "/about": AboutPage,
31
+ }}
32
+ />
33
+ </Navigation>
34
+ </HTML>,
33
35
  );
34
36
  ```
35
37
 
package/docs/ui/Head.md CHANGED
@@ -23,9 +23,8 @@ import { Page, Head } from "shelving/ui";
23
23
 
24
24
  // <Page> already renders <Head> for you; render it directly only for custom shells.
25
25
  <Page title="Settings">
26
- <Head/>
27
- …
28
- </Page>
26
+ <Head />…
27
+ </Page>;
29
28
  ```
30
29
 
31
30
 
@@ -41,30 +41,30 @@ import { Title, Heading, Subheading } from "shelving/ui";
41
41
  ```tsx live
42
42
  import { Heading } from "shelving/ui";
43
43
 
44
- <Heading color="red">Danger zone</Heading>
44
+ <Heading color="red">Danger zone</Heading>;
45
45
  ```
46
46
 
47
47
  ## Styling
48
48
 
49
49
  `Heading` exposes hooks for its rhythm and type. It inherits text colour by default (so it picks up the surrounding tint); set `--heading-color` only to override that.
50
50
 
51
- | Variable | Styles | Default |
52
- |---|---|---|
53
- | `--heading-color` | Text colour | `inherit` |
54
- | `--heading-space-before` | Top margin | `var(--space-section)` (2rem) |
55
- | `--heading-space` | Bottom margin | `var(--space-paragraph)` (16px) |
56
- | `--heading-font` | Font family | `var(--font-title)` |
57
- | `--heading-weight` | Font weight | `var(--weight-strong)` (700) |
58
- | `--heading-size` | Font size | `var(--size-xxlarge)` |
59
- | `--heading-leading` | Line height | `var(--leading)` |
51
+ | Variable | Styles | Default |
52
+ | ------------------------ | ------------- | ------------------------------- |
53
+ | `--heading-color` | Text colour | `inherit` |
54
+ | `--heading-space-before` | Top margin | `var(--space-section)` (2rem) |
55
+ | `--heading-space` | Bottom margin | `var(--space-paragraph)` (16px) |
56
+ | `--heading-font` | Font family | `var(--font-title)` |
57
+ | `--heading-weight` | Font weight | `var(--weight-strong)` (700) |
58
+ | `--heading-size` | Font size | `var(--size-xxlarge)` |
59
+ | `--heading-leading` | Line height | `var(--leading)` |
60
60
 
61
61
  **Global tokens it reads:** `--space-section`, `--space-paragraph`, `--font-title`, `--weight-strong`, `--size-xxlarge`, and `--leading`. (`<Title>` and `<Subheading>` share this component and expose the parallel `--title-*` / `--subheading-*` hooks.)
62
62
 
63
63
  ```css
64
64
  /* Theme: serif headings, a touch larger. */
65
65
  :root {
66
- --heading-font: var(--font-serif);
67
- --heading-size: 3rem;
66
+ --heading-font: var(--font-serif);
67
+ --heading-size: 3rem;
68
68
  }
69
69
  ```
70
70
 
@@ -35,10 +35,10 @@ import { HorizontalTransition, Navigation, Router } from "shelving/ui";
35
35
 
36
36
  // Links slide right, the browser back button slides left.
37
37
  <Navigation>
38
- <HorizontalTransition>
39
- <Router routes={ROUTES}/>
40
- </HorizontalTransition>
41
- </Navigation>
38
+ <HorizontalTransition>
39
+ <Router routes={ROUTES} />
40
+ </HorizontalTransition>
41
+ </Navigation>;
42
42
  ```
43
43
 
44
44
  ## Use the class without the component
@@ -50,16 +50,16 @@ import { ViewTransition } from "react";
50
50
  import { SLIDE_RIGHT_TRANSITION_CLASS } from "shelving/ui";
51
51
 
52
52
  <ViewTransition enter={SLIDE_RIGHT_TRANSITION_CLASS} exit={SLIDE_RIGHT_TRANSITION_CLASS}>
53
- <div className="panel">…</div>
54
- </ViewTransition>
53
+ <div className="panel">…</div>
54
+ </ViewTransition>;
55
55
  ```
56
56
 
57
57
  ## Styling
58
58
 
59
- | Variable | Styles | Default |
60
- |---|---|---|
61
- | `--horizontal-transition-size` | Slide distance for the enter/leave keyframes. A percentage is of the element's own width. | `100%` |
62
- | `--horizontal-transition-duration` | Duration of the slide keyframes | `var(--duration-normal)` |
59
+ | Variable | Styles | Default |
60
+ | ---------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------ |
61
+ | `--horizontal-transition-size` | Slide distance for the enter/leave keyframes. A percentage is of the element's own width. | `100%` |
62
+ | `--horizontal-transition-duration` | Duration of the slide keyframes | `var(--duration-normal)` |
63
63
 
64
64
  **Global tokens it reads** — `--duration-normal`.
65
65
 
package/docs/ui/Icon.md CHANGED
@@ -27,10 +27,10 @@ import { Icon } from "shelving/ui";
27
27
 
28
28
  ## Styling
29
29
 
30
- | Variable | Styles | Default |
31
- |---|---|---|
32
- | `--icon-color` | Icon colour | `var(--tint-50)` (the status tint, e.g. `--color-failure` for `status="error"`) |
33
- | `--icon-size` | Icon width / height | `var(--size-icon)` (1.5rem) |
30
+ | Variable | Styles | Default |
31
+ | -------------- | ------------------- | ------------------------------------------------------------------------------- |
32
+ | `--icon-color` | Icon colour | `var(--tint-50)` (the status tint, e.g. `--color-failure` for `status="error"`) |
33
+ | `--icon-size` | Icon width / height | `var(--size-icon)` (1.5rem) |
34
34
 
35
35
  **Global tokens it reads** — the status tint anchor `--tint-50`, `--size-icon` (the unset-`size` default), plus the size tokens `--size-small` / `--size-normal` / `--size-large` / `--size-xlarge` / `--size-xxlarge` used by the `size` prop.
36
36
 
@@ -27,8 +27,8 @@ A large square image picker. With no image, it shows a "Choose…" button in the
27
27
  import { ImageInput } from "shelving/ui";
28
28
 
29
29
  function PhotoPicker() {
30
- const [photo, setPhoto] = useState<File>();
31
- return <ImageInput name="photo" title="Photo" value={photo} onValue={setPhoto} />;
30
+ const [photo, setPhoto] = useState<File>();
31
+ return <ImageInput name="photo" title="Photo" value={photo} onValue={setPhoto} />;
32
32
  }
33
33
  ```
34
34
 
@@ -38,22 +38,22 @@ function PhotoPicker() {
38
38
  import { ImageInput } from "shelving/ui";
39
39
 
40
40
  // Shows the saved photo. A new pick calls `onValue` with the new `File`.
41
- <ImageInput name="photo" value={user.photoURL} onValue={upload} />
41
+ <ImageInput name="photo" value={user.photoURL} onValue={upload} />;
42
42
  ```
43
43
 
44
44
  ## Styling
45
45
 
46
46
  `ImageInput` paints from the [tint ladder](/ui/TINT_CLASS). The "Choose…" and X buttons are `<Button>` styles, so `--button-*` hooks also move them.
47
47
 
48
- | Variable | Styles | Default |
49
- |---|---|---|
50
- | `--image-input-space` | Space above and below the square | `var(--space-small)` (12px) |
51
- | `--image-input-radius` | Corner radius of the square | `var(--radius-small)` (12px) |
52
- | `--image-input-background` | Square background when empty | `var(--tint-90)` |
53
- | `--image-input-preview-background` | Background behind the picked image, seen through a transparent image | `#000` |
54
- | `--image-input-focus-border` | Outline when the input has focus | `var(--stroke-focus) solid var(--color-focus)` |
55
- | `--image-input-invalid-border` | Outline when `message` is set | `var(--stroke-focus) solid var(--color-failure)` |
56
- | `--image-input-clear-inset` | Distance of the X button from the top and end edges | `var(--space-small)` (12px) |
48
+ | Variable | Styles | Default |
49
+ | ---------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------ |
50
+ | `--image-input-space` | Space above and below the square | `var(--space-small)` (12px) |
51
+ | `--image-input-radius` | Corner radius of the square | `var(--radius-small)` (12px) |
52
+ | `--image-input-background` | Square background when empty | `var(--tint-90)` |
53
+ | `--image-input-preview-background` | Background behind the picked image, seen through a transparent image | `#000` |
54
+ | `--image-input-focus-border` | Outline when the input has focus | `var(--stroke-focus) solid var(--color-focus)` |
55
+ | `--image-input-invalid-border` | Outline when `message` is set | `var(--stroke-focus) solid var(--color-failure)` |
56
+ | `--image-input-clear-inset` | Distance of the X button from the top and end edges | `var(--space-small)` (12px) |
57
57
 
58
58
  Global tokens it reads: `--tint-90`, `--space-small`, `--radius-small`, `--stroke-focus`, `--color-focus`, `--color-failure`.
59
59
 
@@ -21,19 +21,19 @@ Inserted text — renders an `<ins>` element to mark content that has been added
21
21
  import { Paragraph, Deleted, Inserted } from "shelving/ui";
22
22
 
23
23
  <Paragraph>
24
- Was <Deleted>$50</Deleted> <Inserted>$35</Inserted>.
25
- </Paragraph>
24
+ Was <Deleted>$50</Deleted> <Inserted>$35</Inserted>.
25
+ </Paragraph>;
26
26
  ```
27
27
 
28
28
  ## Styling
29
29
 
30
30
  `Inserted` colours its text directly from `--color-green` (not the tint ladder), so insertions stay a consistent green regardless of the surrounding tint. Override `--inserted-color` to recolour.
31
31
 
32
- | Variable | Styles | Default |
33
- |---|---|---|
34
- | `--inserted-color` | Text colour | `var(--color-green)` |
32
+ | Variable | Styles | Default |
33
+ | ----------------------- | --------------- | -------------------------------- |
34
+ | `--inserted-color` | Text colour | `var(--color-green)` |
35
35
  | `--inserted-decoration` | Text decoration | `underline var(--stroke-normal)` |
36
- | `--inserted-weight` | Font weight | `var(--weight-strong)` |
36
+ | `--inserted-weight` | Font weight | `var(--weight-strong)` |
37
37
 
38
38
  **Global tokens it reads:** `--color-green`, `--stroke-normal`, and `--weight-strong`.
39
39