shelving 1.322.1 → 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 (312) 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 +112 -84
  35. package/docs/guides/styleguide.md +29 -29
  36. package/docs/index.md +3 -2
  37. package/docs/llms-full.txt +2531 -2291
  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 +33 -24
  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 +39 -27
  88. package/docs/ui/DocumentationButtons.md +2 -2
  89. package/docs/ui/DocumentationCard.md +2 -2
  90. package/docs/ui/DocumentationFrame.md +4 -4
  91. package/docs/ui/DocumentationLive.md +11 -11
  92. package/docs/ui/DocumentationPage.md +3 -3
  93. package/docs/ui/Emphasis.md +4 -4
  94. package/docs/ui/Empty.md +2 -2
  95. package/docs/ui/FadeTransition.md +9 -9
  96. package/docs/ui/Field.md +14 -14
  97. package/docs/ui/FixedLayout.md +27 -25
  98. package/docs/ui/Form.md +41 -39
  99. package/docs/ui/FormStore.md +6 -2
  100. package/docs/ui/Grid.md +21 -9
  101. package/docs/ui/HTML.md +10 -8
  102. package/docs/ui/Head.md +2 -3
  103. package/docs/ui/Heading.md +12 -12
  104. package/docs/ui/HorizontalTransition.md +10 -10
  105. package/docs/ui/Icon.md +4 -4
  106. package/docs/ui/ImageInput.md +12 -12
  107. package/docs/ui/Inserted.md +6 -6
  108. package/docs/ui/Link.md +11 -11
  109. package/docs/ui/List.md +7 -7
  110. package/docs/ui/Loading.md +6 -6
  111. package/docs/ui/Mark.md +11 -9
  112. package/docs/ui/Markup.md +4 -4
  113. package/docs/ui/Menu.md +24 -24
  114. package/docs/ui/MenuItem.md +29 -29
  115. package/docs/ui/Modal.md +57 -45
  116. package/docs/ui/Navigation.md +28 -26
  117. package/docs/ui/NavigationStore.md +18 -18
  118. package/docs/ui/Notice.md +15 -15
  119. package/docs/ui/Notices.md +17 -17
  120. package/docs/ui/Page.md +13 -13
  121. package/docs/ui/Panel.md +8 -8
  122. package/docs/ui/Paragraph.md +5 -5
  123. package/docs/ui/Progress.md +11 -11
  124. package/docs/ui/Prose.md +6 -6
  125. package/docs/ui/QueryRadiosInput.md +2 -2
  126. package/docs/ui/RouteCache.md +27 -27
  127. package/docs/ui/Router.md +70 -61
  128. package/docs/ui/SchemaInput.md +20 -20
  129. package/docs/ui/Scroll.md +16 -16
  130. package/docs/ui/Section.md +13 -10
  131. package/docs/ui/SidebarLayout.md +27 -27
  132. package/docs/ui/Small.md +4 -4
  133. package/docs/ui/Span.md +3 -1
  134. package/docs/ui/StackButton.md +13 -7
  135. package/docs/ui/Strong.md +4 -4
  136. package/docs/ui/Subheading.md +12 -12
  137. package/docs/ui/TINT_CLASS.md +11 -11
  138. package/docs/ui/Table.md +40 -29
  139. package/docs/ui/Tag.md +15 -15
  140. package/docs/ui/Title.md +13 -13
  141. package/docs/ui/Transition.md +22 -22
  142. package/docs/ui/TreeApp.md +8 -8
  143. package/docs/ui/TreeMarkup.md +2 -2
  144. package/docs/ui/TreeMenu.md +3 -3
  145. package/docs/ui/TreeSidebar.md +1 -1
  146. package/docs/ui/VerticalTransition.md +8 -8
  147. package/docs/ui/getClass.md +10 -10
  148. package/docs/ui/getColorClass.md +23 -23
  149. package/docs/ui/getDurationClass.md +5 -5
  150. package/docs/ui/getGridClass.md +2 -2
  151. package/docs/ui/getHeightClass.md +4 -4
  152. package/docs/ui/getRadiusClass.md +9 -9
  153. package/docs/ui/getShadowClass.md +6 -6
  154. package/docs/ui/getSpaceClass.md +13 -13
  155. package/docs/ui/getStrokeClass.md +6 -6
  156. package/docs/ui/getTypographyClass.md +38 -38
  157. package/docs/ui/getWidthClass.md +4 -4
  158. package/docs/ui/notify.md +11 -11
  159. package/docs/ui/requireContext.md +1 -1
  160. package/docs/ui.md +4 -4
  161. package/docs/util/array.md +35 -29
  162. package/docs/util/async.md +2 -2
  163. package/docs/util/base64.md +7 -7
  164. package/docs/util/boolean.md +10 -10
  165. package/docs/util/buffer.md +5 -5
  166. package/docs/util/bytes.md +9 -9
  167. package/docs/util/class.md +10 -6
  168. package/docs/util/color.md +13 -13
  169. package/docs/util/constants.md +2 -2
  170. package/docs/util/crypto.md +1 -1
  171. package/docs/util/currency.md +2 -2
  172. package/docs/util/data.md +18 -18
  173. package/docs/util/date.md +22 -22
  174. package/docs/util/debug/debug.md +12 -12
  175. package/docs/util/dictionary.md +21 -18
  176. package/docs/util/diff.md +6 -6
  177. package/docs/util/dispose/dispose.md +5 -5
  178. package/docs/util/duration.md +9 -9
  179. package/docs/util/element.md +1 -1
  180. package/docs/util/entity.md +6 -6
  181. package/docs/util/entry.md +21 -8
  182. package/docs/util/env.md +2 -2
  183. package/docs/util/equal.md +16 -16
  184. package/docs/util/error.md +4 -4
  185. package/docs/util/file.md +8 -8
  186. package/docs/util/filter.md +9 -5
  187. package/docs/util/format.md +18 -18
  188. package/docs/util/function.md +4 -4
  189. package/docs/util/geo.md +13 -13
  190. package/docs/util/hash.md +3 -3
  191. package/docs/util/http.md +1 -1
  192. package/docs/util/hydrate/hydrate.md +7 -4
  193. package/docs/util/item.md +4 -4
  194. package/docs/util/iterate.md +11 -11
  195. package/docs/util/jwt.md +1 -6
  196. package/docs/util/link.md +5 -5
  197. package/docs/util/map.md +17 -11
  198. package/docs/util/merge.md +2 -5
  199. package/docs/util/null.md +20 -10
  200. package/docs/util/number.md +16 -16
  201. package/docs/util/object.md +25 -22
  202. package/docs/util/path.md +17 -17
  203. package/docs/util/query.md +23 -25
  204. package/docs/util/random.md +7 -7
  205. package/docs/util/regexp.md +16 -16
  206. package/docs/util/sequence.md +16 -10
  207. package/docs/util/serialise/serialise.md +6 -6
  208. package/docs/util/set.md +10 -10
  209. package/docs/util/sort.md +10 -11
  210. package/docs/util/source.md +11 -7
  211. package/docs/util/start.md +8 -8
  212. package/docs/util/string.md +14 -14
  213. package/docs/util/template.md +3 -3
  214. package/docs/util/timeout.md +5 -5
  215. package/docs/util/transform.md +6 -6
  216. package/docs/util/tree.md +13 -13
  217. package/docs/util/undefined.md +3 -3
  218. package/docs/util/units.md +15 -15
  219. package/docs/util/update.md +16 -16
  220. package/docs/util/uri.md +12 -12
  221. package/docs/util/url.md +11 -11
  222. package/docs/util/uuid.md +3 -3
  223. package/docs/util/validate.md +14 -9
  224. package/package.json +3 -3
  225. package/skills/shelving/SKILL.md +1 -0
  226. package/ui/README.md +4 -4
  227. package/ui/app/App.md +99 -69
  228. package/ui/block/Card.md +23 -22
  229. package/ui/block/Details.md +13 -13
  230. package/ui/block/Grid.md +21 -9
  231. package/ui/block/Heading.md +12 -12
  232. package/ui/block/List.md +7 -7
  233. package/ui/block/Panel.md +8 -8
  234. package/ui/block/Paragraph.md +5 -5
  235. package/ui/block/Prose.md +6 -6
  236. package/ui/block/Section.md +13 -10
  237. package/ui/block/Subheading.md +12 -12
  238. package/ui/block/Title.md +13 -13
  239. package/ui/button/Button.md +73 -64
  240. package/ui/dialog/Dialog.md +39 -27
  241. package/ui/dialog/Modal.md +57 -45
  242. package/ui/docs/DocumentationButtons.md +2 -2
  243. package/ui/docs/DocumentationCard.md +2 -2
  244. package/ui/docs/DocumentationFrame.md +4 -4
  245. package/ui/docs/DocumentationLive.md +11 -11
  246. package/ui/docs/DocumentationPage.md +3 -3
  247. package/ui/form/Field.md +14 -14
  248. package/ui/form/Form.md +41 -39
  249. package/ui/form/FormStore.md +6 -2
  250. package/ui/form/Progress.md +11 -11
  251. package/ui/inline/Code.md +11 -11
  252. package/ui/inline/Deleted.md +6 -6
  253. package/ui/inline/Emphasis.md +4 -4
  254. package/ui/inline/Inserted.md +6 -6
  255. package/ui/inline/Link.md +11 -11
  256. package/ui/inline/Mark.md +11 -9
  257. package/ui/inline/Small.md +4 -4
  258. package/ui/inline/Span.md +3 -1
  259. package/ui/inline/Strong.md +4 -4
  260. package/ui/input/ImageInput.md +12 -12
  261. package/ui/input/QueryRadiosInput.md +2 -2
  262. package/ui/input/SchemaInput.md +20 -20
  263. package/ui/layout/AppLayout.md +33 -24
  264. package/ui/layout/AppLayout.module.css +1 -0
  265. package/ui/layout/FixedLayout.md +27 -25
  266. package/ui/layout/SidebarLayout.md +27 -27
  267. package/ui/layout/SidebarLayout.module.css +1 -0
  268. package/ui/menu/Menu.md +24 -24
  269. package/ui/menu/MenuItem.md +29 -29
  270. package/ui/misc/Catcher.md +3 -3
  271. package/ui/misc/Icon.md +4 -4
  272. package/ui/misc/Loading.md +6 -6
  273. package/ui/misc/Markup.md +4 -4
  274. package/ui/misc/Tag.md +15 -15
  275. package/ui/notice/Empty.md +2 -2
  276. package/ui/notice/Notice.md +15 -15
  277. package/ui/notice/Notices.md +17 -17
  278. package/ui/page/HTML.md +10 -8
  279. package/ui/page/Head.md +2 -3
  280. package/ui/page/Page.md +13 -13
  281. package/ui/router/BackButton.md +13 -11
  282. package/ui/router/Navigation.md +28 -26
  283. package/ui/router/NavigationStore.md +18 -18
  284. package/ui/router/RouteCache.md +27 -27
  285. package/ui/router/Router.md +70 -61
  286. package/ui/router/StackButton.md +13 -7
  287. package/ui/style/Scroll.md +16 -16
  288. package/ui/style/TINT_CLASS.md +11 -11
  289. package/ui/style/getColorClass.md +23 -23
  290. package/ui/style/getDurationClass.md +5 -5
  291. package/ui/style/getGridClass.md +2 -2
  292. package/ui/style/getHeightClass.md +4 -4
  293. package/ui/style/getRadiusClass.md +9 -9
  294. package/ui/style/getShadowClass.md +6 -6
  295. package/ui/style/getSpaceClass.md +13 -13
  296. package/ui/style/getStrokeClass.md +6 -6
  297. package/ui/style/getTypographyClass.md +38 -38
  298. package/ui/style/getWidthClass.md +4 -4
  299. package/ui/table/Table.md +40 -30
  300. package/ui/transition/CollapseTransition.md +5 -5
  301. package/ui/transition/FadeTransition.md +9 -9
  302. package/ui/transition/HorizontalTransition.md +10 -10
  303. package/ui/transition/Transition.md +22 -22
  304. package/ui/transition/VerticalTransition.md +8 -8
  305. package/ui/tree/TreeApp.md +8 -8
  306. package/ui/tree/TreeMarkup.md +2 -2
  307. package/ui/tree/TreeMenu.md +3 -3
  308. package/ui/tree/TreeSidebar.md +1 -1
  309. package/ui/util/ClassProps.md +1 -1
  310. package/ui/util/getClass.md +10 -10
  311. package/ui/util/notify.md +11 -11
  312. package/ui/util/requireContext.md +1 -1
package/docs/ui/Link.md CHANGED
@@ -23,8 +23,8 @@ An inline link or action. Delegates to `<Clickable>`, rendering an `<a>` when `h
23
23
  import { Paragraph, Link } from "shelving/ui";
24
24
 
25
25
  <Paragraph>
26
- Read our <Link href="/privacy">privacy policy</Link> for details.
27
- </Paragraph>
26
+ Read our <Link href="/privacy">privacy policy</Link> for details.
27
+ </Paragraph>;
28
28
  ```
29
29
 
30
30
  ### Action button
@@ -32,7 +32,7 @@ import { Paragraph, Link } from "shelving/ui";
32
32
  ```tsx live
33
33
  import { Link } from "shelving/ui";
34
34
 
35
- <Link onClick={() => save()}>Save now</Link>
35
+ <Link onClick={() => save()}>Save now</Link>;
36
36
  ```
37
37
 
38
38
  ### Plain link around a block
@@ -41,20 +41,20 @@ import { Link } from "shelving/ui";
41
41
  import { Link, Row, Span } from "shelving/ui";
42
42
 
43
43
  <Link plain href="/jane">
44
- <Row left>
45
- <Span weight="strong">Jane Smith</Span>
46
- <Span tint="60">@jane</Span>
47
- </Row>
48
- </Link>
44
+ <Row left>
45
+ <Span weight="strong">Jane Smith</Span>
46
+ <Span tint="60">@jane</Span>
47
+ </Row>
48
+ </Link>;
49
49
  ```
50
50
 
51
51
  ## Styling
52
52
 
53
53
  `Link` colours itself from the global `--color-link` token by default. Inside a tinted scope (`color=` / `status=` on an ancestor) `--color-link` resolves to `inherit`, so links adopt the surrounding tinted text colour. Override `--link-color` to set it directly. A `plain` link ignores both hooks and inherits the colour and weight of its parent.
54
54
 
55
- | Variable | Styles | Default |
56
- |---|---|---|
57
- | `--link-color` | Text colour | `var(--color-link)` |
55
+ | Variable | Styles | Default |
56
+ | --------------- | ----------- | ---------------------- |
57
+ | `--link-color` | Text colour | `var(--color-link)` |
58
58
  | `--link-weight` | Font weight | `var(--weight-strong)` |
59
59
 
60
60
  **Global tokens it reads:** `--color-link`, `--weight-strong`, and `--stroke-normal` (the underline thickness).
package/docs/ui/List.md CHANGED
@@ -32,19 +32,19 @@ import { List } from "shelving/ui";
32
32
  ```tsx
33
33
  import { List } from "shelving/ui";
34
34
 
35
- <List gap="small">{items.map(item => item.label)}</List>
35
+ <List gap="small">{items.map(item => item.label)}</List>;
36
36
  ```
37
37
 
38
38
  ## Styling
39
39
 
40
40
  `List` paints from the [tint ladder](/ui/TINT_CLASS) for its markers only; apply `color=` (on the list or an ancestor scope) to recolour the markers, or reach for a per-property hook for a single change.
41
41
 
42
- | Variable | Styles | Default |
43
- |---|---|---|
44
- | `--list-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
45
- | `--list-gap` | Space between items | `var(--space-xsmall)` |
46
- | `--list-indent` | Inline start padding (marker gutter) | `1.125em` unordered / `1.8em` ordered |
47
- | `--list-marker-color` | Bullet / number colour | `var(--tint-80)` |
42
+ | Variable | Styles | Default |
43
+ | --------------------- | ------------------------------------ | ------------------------------------- |
44
+ | `--list-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
45
+ | `--list-gap` | Space between items | `var(--space-xsmall)` |
46
+ | `--list-indent` | Inline start padding (marker gutter) | `1.125em` unordered / `1.8em` ordered |
47
+ | `--list-marker-color` | Bullet / number colour | `var(--tint-80)` |
48
48
 
49
49
  **Global tokens it reads:** `--space-paragraph`, `--space-xsmall`, and the tint-ladder step `--tint-80`. The `gap` variant comes from the shared `shelving/ui` styling system.
50
50
 
@@ -41,12 +41,12 @@ import { Icon, LOADING, Loading } from "shelving/ui";
41
41
 
42
42
  Size, centring, and overall colour come from wrapping it in `<Icon>` — its `--icon-color` / `--icon-size` hooks and `color` / `status` / `size` / `tint` variants drive the spinner (see the `Icon` Styling section). On top of that, the two arcs expose their own hooks:
43
43
 
44
- | Variable | Styles | Default |
45
- |---|---|---|
46
- | `--loading-track` | Track (background arc) stroke | `var(--tint-70)` |
47
- | `--loading-indicator` | Indicator (moving arc) stroke | `var(--tint-80)` |
48
- | `--loading-stroke-width` | Stroke width of both arcs | `2.5` |
49
- | `--loading-length` | `stroke-dasharray` of the indicator arc | `28 100` |
44
+ | Variable | Styles | Default |
45
+ | ------------------------ | --------------------------------------- | ---------------- |
46
+ | `--loading-track` | Track (background arc) stroke | `var(--tint-70)` |
47
+ | `--loading-indicator` | Indicator (moving arc) stroke | `var(--tint-80)` |
48
+ | `--loading-stroke-width` | Stroke width of both arcs | `2.5` |
49
+ | `--loading-length` | `stroke-dasharray` of the indicator arc | `28 100` |
50
50
 
51
51
  **Global tokens it reads** — the tint-ladder steps `--tint-70` / `--tint-80` for the arc strokes (rebound by the `color` / `status` / `tint` variants on the wrapping `<Icon>`).
52
52
 
package/docs/ui/Mark.md CHANGED
@@ -20,21 +20,23 @@ Highlighted text — renders a `<mark>` element to call attention to a run of te
20
20
  ```tsx live
21
21
  import { Mark } from "shelving/ui";
22
22
 
23
- <p>Files are stored in <Mark>UTF-8</Mark> encoding.</p>
23
+ <p>
24
+ Files are stored in <Mark>UTF-8</Mark> encoding.
25
+ </p>;
24
26
  ```
25
27
 
26
28
  ## Styling
27
29
 
28
30
  `Mark` highlights with a translucent wash of `--color-yellow` — `color-mix(…, transparent)`, so the text underneath stays legible — with the text painted from `--tint-00`. Override `--mark-tint` to change the highlight hue, `--mark-background` to replace the fill outright, or `--mark-color` for the text.
29
31
 
30
- | Variable | Styles | Default |
31
- |---|---|---|
32
- | `--mark-tint` | Highlight hue, mixed 50% with `transparent` for the background | `var(--color-yellow)` |
33
- | `--mark-background` | Background fill | `color-mix(in oklch, var(--mark-tint, var(--color-yellow)), transparent)` |
34
- | `--mark-color` | Text colour | `var(--tint-00)` |
35
- | `--mark-indent` | Left and right padding (one length) | `var(--space-xxsmall)` |
36
- | `--mark-radius` | Corner radius | `var(--radius-xxsmall)` |
37
- | `--mark-weight` | Font weight | `var(--weight-strong)` |
32
+ | Variable | Styles | Default |
33
+ | ------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------- |
34
+ | `--mark-tint` | Highlight hue, mixed 50% with `transparent` for the background | `var(--color-yellow)` |
35
+ | `--mark-background` | Background fill | `color-mix(in oklch, var(--mark-tint, var(--color-yellow)), transparent)` |
36
+ | `--mark-color` | Text colour | `var(--tint-00)` |
37
+ | `--mark-indent` | Left and right padding (one length) | `var(--space-xxsmall)` |
38
+ | `--mark-radius` | Corner radius | `var(--radius-xxsmall)` |
39
+ | `--mark-weight` | Font weight | `var(--weight-strong)` |
38
40
 
39
41
  **Global tokens it reads:** `--color-yellow`, `--space-xxsmall`, `--radius-xxsmall`, `--weight-strong`, and the tint-ladder step `--tint-00`.
40
42
 
package/docs/ui/Markup.md CHANGED
@@ -24,8 +24,8 @@ Parses a markup string and renders the resulting React nodes inline. Defaults to
24
24
  import { Prose, Markup } from "shelving/ui";
25
25
 
26
26
  <Prose>
27
- <Markup>{article.body}</Markup>
28
- </Prose>
27
+ <Markup>{article.body}</Markup>
28
+ </Prose>;
29
29
  ```
30
30
 
31
31
  ```tsx
@@ -33,8 +33,8 @@ import { Markup } from "shelving/ui";
33
33
 
34
34
  // Custom rule set or base URL via MarkupOptions props.
35
35
  <Markup rules={INLINE_ONLY} root="https://example.com">
36
- {comment.body}
37
- </Markup>
36
+ {comment.body}
37
+ </Markup>;
38
38
  ```
39
39
 
40
40
 
package/docs/ui/Menu.md CHANGED
@@ -22,34 +22,34 @@ A `<menu>` list of `<MenuItem>` children — the container for URL-aware navigat
22
22
  import { Menu, MenuItem } from "shelving/ui";
23
23
 
24
24
  <Menu>
25
- <MenuItem href="/dashboard">Dashboard</MenuItem>
26
- <MenuItem href="/users">
27
- Users
28
- <Menu>
29
- <MenuItem href="/users/active">Active</MenuItem>
30
- <MenuItem href="/users/archived">Archived</MenuItem>
31
- </Menu>
32
- </MenuItem>
33
- <MenuItem href="/settings">Settings</MenuItem>
34
- </Menu>
25
+ <MenuItem href="/dashboard">Dashboard</MenuItem>
26
+ <MenuItem href="/users">
27
+ Users
28
+ <Menu>
29
+ <MenuItem href="/users/active">Active</MenuItem>
30
+ <MenuItem href="/users/archived">Archived</MenuItem>
31
+ </Menu>
32
+ </MenuItem>
33
+ <MenuItem href="/settings">Settings</MenuItem>
34
+ </Menu>;
35
35
  ```
36
36
 
37
37
  ## Styling
38
38
 
39
- | Variable | Styles | Default |
40
- |---|---|---|
41
- | `--menu-gap` | Vertical gap between items | `0` |
42
- | `--menu-font` | Font family | `var(--font-body)` |
43
- | `--menu-size` | Font size | `var(--size-normal)` |
44
- | `--menu-leading` | Line height | `var(--leading)` |
45
- | `--menu-color` | Text colour | `var(--tint-00)` |
46
- | `--menu-nested-space` | Block margin around a nested submenu | `var(--space-xxsmall)` |
47
- | `--menu-padding` | Item link top and bottom padding (one length) | `var(--space-small)` |
48
- | `--menu-indent` | Item link left and right padding (one length; with `--menu-stroke`, also insets the nested border) | `var(--space-small)` |
49
- | `--menu-small-indent` | Small item link left and right padding (one length; also insets the nested border of a small item) | `var(--space-xsmall)` |
50
- | `--menu-nested-border` | Nested submenu left-border width | `var(--stroke-focus)` |
51
- | `--menu-nested-color-border` | Nested submenu left-border colour | `var(--tint-50)` |
52
- | `--menu-nested-indent` | Nested submenu left padding | `var(--space-xsmall)` |
39
+ | Variable | Styles | Default |
40
+ | ---------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------- |
41
+ | `--menu-gap` | Vertical gap between items | `0` |
42
+ | `--menu-font` | Font family | `var(--font-body)` |
43
+ | `--menu-size` | Font size | `var(--size-normal)` |
44
+ | `--menu-leading` | Line height | `var(--leading)` |
45
+ | `--menu-color` | Text colour | `var(--tint-00)` |
46
+ | `--menu-nested-space` | Block margin around a nested submenu | `var(--space-xxsmall)` |
47
+ | `--menu-padding` | Item link top and bottom padding (one length) | `var(--space-small)` |
48
+ | `--menu-indent` | Item link left and right padding (one length; with `--menu-stroke`, also insets the nested border) | `var(--space-small)` |
49
+ | `--menu-small-indent` | Small item link left and right padding (one length; also insets the nested border of a small item) | `var(--space-xsmall)` |
50
+ | `--menu-nested-border` | Nested submenu left-border width | `var(--stroke-focus)` |
51
+ | `--menu-nested-color-border` | Nested submenu left-border colour | `var(--tint-50)` |
52
+ | `--menu-nested-indent` | Nested submenu left padding | `var(--space-xsmall)` |
53
53
 
54
54
  Item-size and item-state hooks (`--menu-stroke`, `--menu-height`, `--menu-small-*`, `--menu-hover-*`, `--menu-proud-*`, `--menu-active-*`, `--menu-radius`, `--menu-focus-border`) are documented on `<MenuItem>`.
55
55
 
@@ -23,15 +23,15 @@ A single `<li>` link entry inside a `<Menu>`. It reads the current page URL from
23
23
  import { Menu, MenuItem } from "shelving/ui";
24
24
 
25
25
  <Menu>
26
- <MenuItem href="/users">
27
- Users
28
- <Menu>
29
- <MenuItem href="/users/active">Active</MenuItem>
30
- <MenuItem href="/users/archived">Archived</MenuItem>
31
- </Menu>
32
- </MenuItem>
33
- <MenuItem href="/settings">Settings</MenuItem>
34
- </Menu>
26
+ <MenuItem href="/users">
27
+ Users
28
+ <Menu>
29
+ <MenuItem href="/users/active">Active</MenuItem>
30
+ <MenuItem href="/users/archived">Archived</MenuItem>
31
+ </Menu>
32
+ </MenuItem>
33
+ <MenuItem href="/settings">Settings</MenuItem>
34
+ </Menu>;
35
35
  ```
36
36
 
37
37
  ### Small items
@@ -55,26 +55,26 @@ import { Menu, MenuItem } from "shelving/ui";
55
55
 
56
56
  The item link's hooks (defined in `Menu.module.css`):
57
57
 
58
- | Variable | Styles | Default |
59
- |---|---|---|
60
- | `--menu-padding` | Link top and bottom padding (one length) | `var(--space-small)` |
61
- | `--menu-indent` | Link left and right padding (one length) | `var(--space-small)` |
62
- | `--menu-stroke` | Link transparent border width (one length) | `var(--stroke-normal)` |
63
- | `--menu-icon-size` | Content height used for the minimum height (one length) | `var(--size-icon)` |
64
- | `--menu-height` | Link minimum height | `--menu-icon-size` + 2 × `--menu-padding` + 2 × `--menu-stroke`, the same as `--button-height` |
65
- | `--menu-small-padding` | Small link top and bottom padding (one length) | `var(--space-xsmall)` |
66
- | `--menu-small-indent` | Small link left and right padding (one length) | `var(--space-xsmall)` |
67
- | `--menu-small-height` | Small link minimum height | `0` |
68
- | `--menu-radius` | Link corner radius | `var(--radius-xsmall)` |
69
- | `--menu-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
70
- | `--menu-hover-background` | Link fill on hover/focus | `var(--tint-90)` |
71
- | `--menu-hover-color` | Link text colour on hover/focus | `var(--tint-00)` |
72
- | `--menu-proud-background` | Fill when proud (ancestor of current page) | `transparent` |
73
- | `--menu-proud` | Text colour when proud | `var(--tint-00)` |
74
- | `--menu-proud-weight` | Font weight when proud | `var(--weight-strong)` |
75
- | `--menu-active-background` | Fill when active (current page), also while hovered or focused | `var(--tint-100)` |
76
- | `--menu-active-color` | Text colour when active | `var(--tint-00)` |
77
- | `--menu-active-weight` | Font weight when active | `var(--weight-strong)` |
58
+ | Variable | Styles | Default |
59
+ | -------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
60
+ | `--menu-padding` | Link top and bottom padding (one length) | `var(--space-small)` |
61
+ | `--menu-indent` | Link left and right padding (one length) | `var(--space-small)` |
62
+ | `--menu-stroke` | Link transparent border width (one length) | `var(--stroke-normal)` |
63
+ | `--menu-icon-size` | Content height used for the minimum height (one length) | `var(--size-icon)` |
64
+ | `--menu-height` | Link minimum height | `--menu-icon-size` + 2 × `--menu-padding` + 2 × `--menu-stroke`, the same as `--button-height` |
65
+ | `--menu-small-padding` | Small link top and bottom padding (one length) | `var(--space-xsmall)` |
66
+ | `--menu-small-indent` | Small link left and right padding (one length) | `var(--space-xsmall)` |
67
+ | `--menu-small-height` | Small link minimum height | `0` |
68
+ | `--menu-radius` | Link corner radius | `var(--radius-xsmall)` |
69
+ | `--menu-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
70
+ | `--menu-hover-background` | Link fill on hover/focus | `var(--tint-90)` |
71
+ | `--menu-hover-color` | Link text colour on hover/focus | `var(--tint-00)` |
72
+ | `--menu-proud-background` | Fill when proud (ancestor of current page) | `transparent` |
73
+ | `--menu-proud` | Text colour when proud | `var(--tint-00)` |
74
+ | `--menu-proud-weight` | Font weight when proud | `var(--weight-strong)` |
75
+ | `--menu-active-background` | Fill when active (current page), also while hovered or focused | `var(--tint-100)` |
76
+ | `--menu-active-color` | Text colour when active | `var(--tint-00)` |
77
+ | `--menu-active-weight` | Font weight when active | `var(--weight-strong)` |
78
78
 
79
79
  List-level hooks (`--menu-gap`, `--menu-color`, the nested-submenu hooks, etc.) are documented on `<Menu>`.
80
80
 
package/docs/ui/Modal.md CHANGED
@@ -35,14 +35,16 @@ Put the `Modal` inside a `<Dialog>` that you mount from React state.
35
35
  import { Dialog, Modal } from "shelving/ui";
36
36
 
37
37
  function ConfirmDelete({ onConfirm, onClose }: { onConfirm: () => void; onClose: () => void }) {
38
- return (
39
- <Dialog onClose={onClose}>
40
- <Modal>
41
- <p>Delete this item?</p>
42
- <button type="button" onClick={onConfirm}>Delete</button>
43
- </Modal>
44
- </Dialog>
45
- );
38
+ return (
39
+ <Dialog onClose={onClose}>
40
+ <Modal>
41
+ <p>Delete this item?</p>
42
+ <button type="button" onClick={onConfirm}>
43
+ Delete
44
+ </button>
45
+ </Modal>
46
+ </Dialog>
47
+ );
46
48
  }
47
49
  ```
48
50
 
@@ -54,15 +56,21 @@ Pass the `Modal` to `DialogsStore.show()`. The store adds the `<Dialog>` for you
54
56
  import { Modal, requireDialogs } from "shelving/ui";
55
57
 
56
58
  function DeleteButton({ onConfirm }: { onConfirm: () => void }) {
57
- const dialogs = requireDialogs();
58
- const open = () =>
59
- dialogs.show(
60
- <Modal>
61
- <p>Delete this item?</p>
62
- <button type="button" onClick={onConfirm}>Delete</button>
63
- </Modal>,
64
- );
65
- return <button type="button" onClick={open}>Delete</button>;
59
+ const dialogs = requireDialogs();
60
+ const open = () =>
61
+ dialogs.show(
62
+ <Modal>
63
+ <p>Delete this item?</p>
64
+ <button type="button" onClick={onConfirm}>
65
+ Delete
66
+ </button>
67
+ </Modal>,
68
+ );
69
+ return (
70
+ <button type="button" onClick={open}>
71
+ Delete
72
+ </button>
73
+ );
66
74
  }
67
75
  ```
68
76
 
@@ -70,16 +78,16 @@ function DeleteButton({ onConfirm }: { onConfirm: () => void }) {
70
78
 
71
79
  ```tsx
72
80
  <Modal padding="large" indent="large" radius="large">
73
- <p>More space on all sides, and rounder corners.</p>
74
- </Modal>
81
+ <p>More space on all sides, and rounder corners.</p>
82
+ </Modal>;
75
83
  ```
76
84
 
77
85
  ### Shadow
78
86
 
79
87
  ```tsx
80
88
  <Modal shadow="small">
81
- <p>Sits closer to the page.</p>
82
- </Modal>
89
+ <p>Sits closer to the page.</p>
90
+ </Modal>;
83
91
  ```
84
92
 
85
93
  ### Pinned to an edge
@@ -88,17 +96,21 @@ function DeleteButton({ onConfirm }: { onConfirm: () => void }) {
88
96
  import { Menu, MenuItem, Modal, requireDialogs } from "shelving/ui";
89
97
 
90
98
  function MenuButton() {
91
- const dialogs = requireDialogs();
92
- const open = () =>
93
- dialogs.show(
94
- <Modal left>
95
- <Menu>
96
- <MenuItem href="/">Home</MenuItem>
97
- <MenuItem href="/settings">Settings</MenuItem>
98
- </Menu>
99
- </Modal>,
100
- );
101
- return <button type="button" onClick={open}>Menu</button>;
99
+ const dialogs = requireDialogs();
100
+ const open = () =>
101
+ dialogs.show(
102
+ <Modal left>
103
+ <Menu>
104
+ <MenuItem href="/">Home</MenuItem>
105
+ <MenuItem href="/settings">Settings</MenuItem>
106
+ </Menu>
107
+ </Modal>,
108
+ );
109
+ return (
110
+ <button type="button" onClick={open}>
111
+ Menu
112
+ </button>
113
+ );
102
114
  }
103
115
  ```
104
116
 
@@ -108,19 +120,19 @@ A link click inside a `<Dialog>` closes it, so the menu slides out as the page c
108
120
 
109
121
  `Modal` paints a shadowed surface with no border. Set `--modal-stroke` (for example `var(--stroke-normal)`) to show the themed border, or `--modal-border` to replace it. A pinned panel then has no visible border on the side that touches the screen edge. That side has a transparent border as wide as the screen's safe area (notch, rounded corners, home bar), so the content stays clear of it and the background fills it. On a pinned panel, only the corners that do not touch a screen edge are round. Override these hooks at `:root` (or any ancestor scope) to retheme.
110
122
 
111
- | Variable | Styles | Default |
112
- |---|---|---|
113
- | `--modal-width` | Width of a `left` or `right` panel, and maximum width of a `top` or `bottom` panel (a centred panel takes `--dialog-width`) | `var(--width-narrow)` |
114
- | `--modal-stroke` | Border width | `0` (no border) |
115
- | `--modal-border` | Border shorthand | `var(--modal-stroke)` solid `--tint-80` |
116
- | `--modal-radius` | Corner radius (the `radius` variant wins over it) | `var(--radius-normal)` (16px) |
117
- | `--modal-background` | Surface fill | `var(--tint-100)` |
118
- | `--modal-padding` | Inner top and bottom padding (one length; the `padding` variant overrides it) | `var(--space-normal)` (16px) |
119
- | `--modal-indent` | Inner left and right padding (one length; the `indent` variant overrides it) | `var(--space-normal)` (16px) |
120
- | `--modal-color` | Text colour | `var(--tint-00)` |
121
- | `--modal-max-height` | Maximum height of a `top` or `bottom` panel (it scrolls past this) | `100%` |
122
- | `--modal-transition-duration` | Length of the slide for a pinned panel. Keep it the same as `--fade-transition-duration`, so the panel and the `<Dialog>` overlay finish together | `var(--duration-fast)` (150ms) |
123
- | `--modal-shadow` | Drop shadow (the `shadow` variant wins over it) | `var(--shadow-large)` |
123
+ | Variable | Styles | Default |
124
+ | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
125
+ | `--modal-width` | Width of a `left` or `right` panel, and maximum width of a `top` or `bottom` panel (a centred panel takes `--dialog-width`) | `var(--width-narrow)` |
126
+ | `--modal-stroke` | Border width | `0` (no border) |
127
+ | `--modal-border` | Border shorthand | `var(--modal-stroke)` solid `--tint-80` |
128
+ | `--modal-radius` | Corner radius (the `radius` variant wins over it) | `var(--radius-normal)` (16px) |
129
+ | `--modal-background` | Surface fill | `var(--tint-100)` |
130
+ | `--modal-padding` | Inner top and bottom padding (one length; the `padding` variant overrides it) | `var(--space-normal)` (16px) |
131
+ | `--modal-indent` | Inner left and right padding (one length; the `indent` variant overrides it) | `var(--space-normal)` (16px) |
132
+ | `--modal-color` | Text colour | `var(--tint-00)` |
133
+ | `--modal-max-height` | Maximum height of a `top` or `bottom` panel (it scrolls past this) | `100%` |
134
+ | `--modal-transition-duration` | Length of the slide for a pinned panel. Keep it the same as `--fade-transition-duration`, so the panel and the `<Dialog>` overlay finish together | `var(--duration-fast)` (150ms) |
135
+ | `--modal-shadow` | Drop shadow (the `shadow` variant wins over it) | `var(--shadow-large)` |
124
136
 
125
137
  **Global tokens it reads** — move these to retheme broadly: the tint ladder `--tint-00` / `--tint-80` / `--tint-100`, plus `--width-narrow`, `--space-normal`, `--radius-normal`, `--shadow-large`, and `--duration-fast`.
126
138
 
@@ -45,10 +45,10 @@ Stacks and slides use the browser [Navigation API](https://developer.mozilla.org
45
45
  import { App, Navigation, Router } from "shelving/ui";
46
46
 
47
47
  <App root="https://example.com/">
48
- <Navigation>
49
- <Router routes={ROUTES}/>
50
- </Navigation>
51
- </App>
48
+ <Navigation>
49
+ <Router routes={ROUTES} />
50
+ </Navigation>
51
+ </App>;
52
52
  ```
53
53
 
54
54
  ### App with a tab bar
@@ -60,27 +60,29 @@ import { App, AppLayout, HorizontalTransition, Navigation, PageLoader, RouteCach
60
60
 
61
61
  const STACKS = ["/home", "/discover", "/profile"] as const;
62
62
 
63
- const TABS = <>
64
- <StackButton stack="/home">Home</StackButton>
65
- <StackButton stack="/discover">Discover</StackButton>
66
- <StackButton stack="/profile">Profile</StackButton>
67
- </>;
63
+ const TABS = (
64
+ <>
65
+ <StackButton stack="/home">Home</StackButton>
66
+ <StackButton stack="/discover">Discover</StackButton>
67
+ <StackButton stack="/profile">Profile</StackButton>
68
+ </>
69
+ );
68
70
 
69
71
  <App root="https://example.com/">
70
- <Navigation stacks={STACKS}>
71
- <AppLayout nav={TABS}>
72
- <HorizontalTransition>
73
- <RouteCache>
74
- <Scroll vertical cover>
75
- <PageLoader>
76
- <Router routes={ROUTES}/>
77
- </PageLoader>
78
- </Scroll>
79
- </RouteCache>
80
- </HorizontalTransition>
81
- </AppLayout>
82
- </Navigation>
83
- </App>
72
+ <Navigation stacks={STACKS}>
73
+ <AppLayout nav={TABS}>
74
+ <HorizontalTransition>
75
+ <RouteCache>
76
+ <Scroll vertical cover>
77
+ <PageLoader>
78
+ <Router routes={ROUTES} />
79
+ </PageLoader>
80
+ </Scroll>
81
+ </RouteCache>
82
+ </HorizontalTransition>
83
+ </AppLayout>
84
+ </Navigation>
85
+ </App>;
84
86
  ```
85
87
 
86
88
  The tab bar is in the layout, outside the cache, so it stays still while pages slide. See "Composing an app" on `<App>` for the full nesting rules.
@@ -126,9 +128,9 @@ Read the store from anywhere in the tree with `requireNavigation()`:
126
128
  import { requireNavigation } from "shelving/ui";
127
129
 
128
130
  const nav = requireNavigation();
129
- nav.forward("/home/post/1"); // Open a page in the current stack.
130
- nav.back("/home"); // Go back to a page.
131
- nav.replace("/login"); // Change the URL of the current page.
131
+ nav.forward("/home/post/1"); // Open a page in the current stack.
132
+ nav.back("/home"); // Go back to a page.
133
+ nav.replace("/login"); // Change the URL of the current page.
132
134
  ```
133
135
 
134
136
  See `NavigationStore` for what each method does.
@@ -26,12 +26,12 @@ The store that holds the current URL, drives browser history, and keeps one stac
26
26
 
27
27
  ## Methods
28
28
 
29
- | Method | What it does | Slide |
30
- |---|---|---|
31
- | `forward(href, stack?)` | Opens `href` as a new page on top of the stack. If `href` is the top page of another stack, it switches to that stack (a tab switch). If `href` is the current URL, it is a replace. | Forward. Across stacks, by tab order. |
32
- | `back(href, stack?)` | Goes back to `href`. If `href` is in the stack, the stack goes back to it, and the pages above it leave the stack. If `href` is the root of the stack, the stack goes to its root. Otherwise `href` takes the place of the top page of the stack. | Back |
33
- | `replace(href, stack?)` | Changes the URL of the current page. The stack, the depth and the mounted page stay the same. No new history entry. With another `stack`, the page moves into that stack: at its root if `href` is the root, else on top of its pages. | None |
34
- | `history(stack?)` | Returns the pages in `stack`, root first. | — |
29
+ | Method | What it does | Slide |
30
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
31
+ | `forward(href, stack?)` | Opens `href` as a new page on top of the stack. If `href` is the top page of another stack, it switches to that stack (a tab switch). If `href` is the current URL, it is a replace. | Forward. Across stacks, by tab order. |
32
+ | `back(href, stack?)` | Goes back to `href`. If `href` is in the stack, the stack goes back to it, and the pages above it leave the stack. If `href` is the root of the stack, the stack goes to its root. Otherwise `href` takes the place of the top page of the stack. | Back |
33
+ | `replace(href, stack?)` | Changes the URL of the current page. The stack, the depth and the mounted page stay the same. No new history entry. With another `stack`, the page moves into that stack: at its root if `href` is the root, else on top of its pages. | None |
34
+ | `history(stack?)` | Returns the pages in `stack`, root first. | — |
35
35
 
36
36
  `stack` defaults to the current stack.
37
37
 
@@ -60,13 +60,13 @@ Why depth? A browser history entry cannot be changed or removed. So when you go
60
60
 
61
61
  For example, with tabs `/home` and `/profile`:
62
62
 
63
- | Step | New history entry | Home stack | Profile stack |
64
- |---|---|---|---|
65
- | Start at `/home` | `/home` (depth 0) | `/home` | — |
66
- | Open a post | `/home/post/1` (depth 1) | `/home`, `/home/post/1` | — |
67
- | Tap the Profile tab | `/profile` (depth 0) | `/home`, `/home/post/1` | `/profile` |
68
- | Tap the Home tab | `/home/post/1` (depth 1) | `/home`, `/home/post/1` | `/profile` |
69
- | Tap the back button | `/home` (depth 0) | `/home` | `/profile` |
63
+ | Step | New history entry | Home stack | Profile stack |
64
+ | ------------------- | ------------------------ | ----------------------- | ------------- |
65
+ | Start at `/home` | `/home` (depth 0) | `/home` | — |
66
+ | Open a post | `/home/post/1` (depth 1) | `/home`, `/home/post/1` | — |
67
+ | Tap the Profile tab | `/profile` (depth 0) | `/home`, `/home/post/1` | `/profile` |
68
+ | Tap the Home tab | `/home/post/1` (depth 1) | `/home`, `/home/post/1` | `/profile` |
69
+ | Tap the back button | `/home` (depth 0) | `/home` | `/profile` |
70
70
 
71
71
  When the page you go back to is the entry just before the current one, `back()` goes back in the browser history and pushes nothing.
72
72
 
@@ -78,8 +78,8 @@ The browser back and forward buttons walk the history entries one at a time, as
78
78
  import { Button, requireNavigation } from "shelving/ui";
79
79
 
80
80
  function LogoutButton() {
81
- const nav = requireNavigation();
82
- return <Button onClick={() => nav.replace("/login")}>Log out</Button>;
81
+ const nav = requireNavigation();
82
+ return <Button onClick={() => nav.replace("/login")}>Log out</Button>;
83
83
  }
84
84
  ```
85
85
 
@@ -90,9 +90,9 @@ import { useStore } from "shelving/react";
90
90
  import { requireNavigation } from "shelving/ui";
91
91
 
92
92
  function TabTitle() {
93
- const nav = requireNavigation();
94
- const stack = useStore(nav.stack).value;
95
- return <h1>{stack === "/profile" ? "Profile" : "Home"}</h1>;
93
+ const nav = requireNavigation();
94
+ const stack = useStore(nav.stack).value;
95
+ return <h1>{stack === "/profile" ? "Profile" : "Home"}</h1>;
96
96
  }
97
97
  ```
98
98