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.
- package/docs/api/APIProvider.md +2 -2
- package/docs/api/CachedAPIProvider.md +6 -8
- package/docs/api/ClientAPIProvider.md +5 -5
- package/docs/api/DebugAPIProvider.md +3 -5
- package/docs/api/HydratingAPIProvider.md +2 -2
- package/docs/api/JSONAPIProvider.md +3 -5
- package/docs/api/LoggingAPIProvider.md +7 -9
- package/docs/api/MockAPIProvider.md +4 -4
- package/docs/api/MockEndpointAPIProvider.md +5 -7
- package/docs/api/ThroughAPIProvider.md +15 -10
- package/docs/api/ValidationAPIProvider.md +3 -5
- package/docs/api/XMLAPIProvider.md +3 -3
- package/docs/api.md +48 -44
- package/docs/bun.md +9 -9
- package/docs/db/DBProvider.md +6 -6
- package/docs/db/MemoryDBProvider.md +3 -3
- package/docs/db/PostgresProvider.md +6 -4
- package/docs/db/SQLProvider.md +6 -3
- package/docs/db/SQLiteProvider.md +9 -4
- package/docs/db/StorageDBProvider.md +2 -2
- package/docs/db/ThroughDBProvider.md +6 -6
- package/docs/db/UndoDBProvider.md +2 -2
- package/docs/db.md +32 -32
- package/docs/error/NetworkError.md +5 -5
- package/docs/error/RequestError.md +4 -4
- package/docs/error/RequiredError.md +2 -2
- package/docs/error/ResponseError.md +1 -1
- package/docs/error/UnexpectedError.md +1 -1
- package/docs/error/UnsupportedError.md +3 -3
- package/docs/error/ValueError.md +2 -2
- package/docs/error.md +20 -19
- package/docs/extract.md +14 -14
- package/docs/firebase.md +6 -6
- package/docs/guides/building-with-shelving.md +113 -85
- package/docs/guides/styleguide.md +29 -29
- package/docs/index.md +3 -2
- package/docs/llms-full.txt +2541 -2295
- package/docs/markup.md +15 -17
- package/docs/react/createAPIContext.md +12 -12
- package/docs/react/createDBContext.md +21 -15
- package/docs/react/useInstance.md +2 -2
- package/docs/react/useLazy.md +1 -1
- package/docs/react/useMap.md +10 -6
- package/docs/react/useReduce.md +2 -2
- package/docs/react/useSequence.md +2 -2
- package/docs/react/useStore.md +10 -10
- package/docs/react.md +22 -16
- package/docs/schema/ArraySchema.md +6 -6
- package/docs/schema/BooleanSchema.md +5 -5
- package/docs/schema/ChoiceSchema.md +1 -1
- package/docs/schema/CurrencyAmountSchema.md +2 -2
- package/docs/schema/DataSchema.md +5 -5
- package/docs/schema/NullableSchema.md +4 -4
- package/docs/schema/NumberSchema.md +4 -4
- package/docs/schema/OptionalSchema.md +1 -1
- package/docs/schema/StringSchema.md +7 -7
- package/docs/schema.md +21 -21
- package/docs/sequence/DeferredSequence.md +1 -1
- package/docs/sequence/InspectSequence.md +8 -6
- package/docs/sequence/LazySequence.md +3 -3
- package/docs/sequence/Sequence.md +6 -6
- package/docs/sequence/ThroughSequence.md +4 -2
- package/docs/sequence.md +3 -3
- package/docs/store/ArrayStore.md +6 -6
- package/docs/store/BooleanStore.md +2 -2
- package/docs/store/BusyStore.md +1 -1
- package/docs/store/DataStore.md +5 -5
- package/docs/store/DictionaryStore.md +4 -4
- package/docs/store/FetchStore.md +6 -6
- package/docs/store/PathStore.md +4 -4
- package/docs/store/PayloadFetchStore.md +1 -5
- package/docs/store/Store.md +8 -6
- package/docs/store/URLStore.md +5 -5
- package/docs/store.md +15 -15
- package/docs/test.md +6 -6
- package/docs/ui/App.md +99 -69
- package/docs/ui/AppLayout.md +35 -26
- package/docs/ui/BackButton.md +13 -11
- package/docs/ui/Button.md +73 -64
- package/docs/ui/Card.md +23 -22
- package/docs/ui/Catcher.md +3 -3
- package/docs/ui/ClassProps.md +1 -1
- package/docs/ui/Code.md +11 -11
- package/docs/ui/CollapseTransition.md +5 -5
- package/docs/ui/Deleted.md +6 -6
- package/docs/ui/Details.md +13 -13
- package/docs/ui/Dialog.md +42 -28
- package/docs/ui/Dialogs.md +4 -0
- package/docs/ui/DocumentationButtons.md +2 -2
- package/docs/ui/DocumentationCard.md +2 -2
- package/docs/ui/DocumentationFrame.md +4 -4
- package/docs/ui/DocumentationLive.md +11 -11
- package/docs/ui/DocumentationPage.md +3 -3
- package/docs/ui/Emphasis.md +4 -4
- package/docs/ui/Empty.md +2 -2
- package/docs/ui/FadeTransition.md +9 -9
- package/docs/ui/Field.md +14 -14
- package/docs/ui/FixedLayout.md +27 -25
- package/docs/ui/Form.md +41 -39
- package/docs/ui/FormStore.md +6 -2
- package/docs/ui/Grid.md +21 -9
- package/docs/ui/HTML.md +10 -8
- package/docs/ui/Head.md +2 -3
- package/docs/ui/Heading.md +12 -12
- package/docs/ui/HorizontalTransition.md +10 -10
- package/docs/ui/Icon.md +4 -4
- package/docs/ui/ImageInput.md +12 -12
- package/docs/ui/Inserted.md +6 -6
- package/docs/ui/Link.md +11 -11
- package/docs/ui/List.md +7 -7
- package/docs/ui/Loading.md +6 -6
- package/docs/ui/Mark.md +11 -9
- package/docs/ui/Markup.md +4 -4
- package/docs/ui/Menu.md +24 -24
- package/docs/ui/MenuItem.md +29 -29
- package/docs/ui/Modal.md +57 -45
- package/docs/ui/Navigation.md +28 -26
- package/docs/ui/NavigationStore.md +18 -18
- package/docs/ui/Notice.md +15 -15
- package/docs/ui/Notices.md +17 -17
- package/docs/ui/Page.md +13 -13
- package/docs/ui/Panel.md +8 -8
- package/docs/ui/Paragraph.md +5 -5
- package/docs/ui/Progress.md +11 -11
- package/docs/ui/Prose.md +6 -6
- package/docs/ui/QueryRadiosInput.md +2 -2
- package/docs/ui/RouteCache.md +27 -27
- package/docs/ui/Router.md +70 -61
- package/docs/ui/SchemaInput.md +20 -20
- package/docs/ui/Scroll.md +16 -16
- package/docs/ui/Section.md +13 -10
- package/docs/ui/SidebarLayout.md +27 -27
- package/docs/ui/Small.md +4 -4
- package/docs/ui/Span.md +3 -1
- package/docs/ui/StackButton.md +13 -7
- package/docs/ui/Strong.md +4 -4
- package/docs/ui/Subheading.md +12 -12
- package/docs/ui/TINT_CLASS.md +11 -11
- package/docs/ui/Table.md +40 -29
- package/docs/ui/Tag.md +15 -15
- package/docs/ui/Title.md +13 -13
- package/docs/ui/Transition.md +22 -22
- package/docs/ui/TreeApp.md +8 -8
- package/docs/ui/TreeMarkup.md +2 -2
- package/docs/ui/TreeMenu.md +3 -3
- package/docs/ui/TreeSidebar.md +1 -1
- package/docs/ui/VerticalTransition.md +8 -8
- package/docs/ui/getClass.md +10 -10
- package/docs/ui/getColorClass.md +23 -23
- package/docs/ui/getDurationClass.md +5 -5
- package/docs/ui/getGridClass.md +2 -2
- package/docs/ui/getHeightClass.md +4 -4
- package/docs/ui/getRadiusClass.md +9 -9
- package/docs/ui/getShadowClass.md +6 -6
- package/docs/ui/getSpaceClass.md +13 -13
- package/docs/ui/getStrokeClass.md +6 -6
- package/docs/ui/getTypographyClass.md +38 -38
- package/docs/ui/getWidthClass.md +4 -4
- package/docs/ui/notify.md +11 -11
- package/docs/ui/requireContext.md +1 -1
- package/docs/ui.md +4 -4
- package/docs/util/array.md +35 -29
- package/docs/util/async.md +2 -2
- package/docs/util/base64.md +7 -7
- package/docs/util/boolean.md +10 -10
- package/docs/util/buffer.md +5 -5
- package/docs/util/bytes.md +9 -9
- package/docs/util/class.md +10 -6
- package/docs/util/color.md +13 -13
- package/docs/util/constants.md +2 -2
- package/docs/util/crypto.md +1 -1
- package/docs/util/currency.md +2 -2
- package/docs/util/data.md +18 -18
- package/docs/util/date.md +22 -22
- package/docs/util/debug/debug.md +12 -12
- package/docs/util/dictionary.md +21 -18
- package/docs/util/diff.md +6 -6
- package/docs/util/dispose/dispose.md +5 -5
- package/docs/util/duration.md +9 -9
- package/docs/util/element.md +1 -1
- package/docs/util/entity.md +6 -6
- package/docs/util/entry.md +21 -8
- package/docs/util/env.md +2 -2
- package/docs/util/equal.md +16 -16
- package/docs/util/error.md +4 -4
- package/docs/util/file.md +8 -8
- package/docs/util/filter.md +9 -5
- package/docs/util/format.md +18 -18
- package/docs/util/function.md +4 -4
- package/docs/util/geo.md +13 -13
- package/docs/util/hash.md +3 -3
- package/docs/util/http.md +1 -1
- package/docs/util/hydrate/hydrate.md +7 -4
- package/docs/util/item.md +4 -4
- package/docs/util/iterate.md +11 -11
- package/docs/util/jwt.md +1 -6
- package/docs/util/link.md +5 -5
- package/docs/util/map.md +17 -11
- package/docs/util/merge.md +2 -5
- package/docs/util/null.md +20 -10
- package/docs/util/number.md +16 -16
- package/docs/util/object.md +25 -22
- package/docs/util/path.md +17 -17
- package/docs/util/query.md +23 -25
- package/docs/util/random.md +7 -7
- package/docs/util/regexp.md +16 -16
- package/docs/util/sequence.md +16 -10
- package/docs/util/serialise/serialise.md +6 -6
- package/docs/util/set.md +10 -10
- package/docs/util/sort.md +10 -11
- package/docs/util/source.md +11 -7
- package/docs/util/start.md +8 -8
- package/docs/util/string.md +14 -14
- package/docs/util/template.md +3 -3
- package/docs/util/timeout.md +5 -5
- package/docs/util/transform.md +6 -6
- package/docs/util/tree.md +13 -13
- package/docs/util/undefined.md +3 -3
- package/docs/util/units.md +15 -15
- package/docs/util/update.md +16 -16
- package/docs/util/uri.md +12 -12
- package/docs/util/url.md +11 -11
- package/docs/util/uuid.md +3 -3
- package/docs/util/validate.md +14 -9
- package/package.json +3 -3
- package/skills/shelving/SKILL.md +1 -0
- package/ui/README.md +4 -4
- package/ui/app/App.md +99 -69
- package/ui/block/Card.md +23 -22
- package/ui/block/Details.md +13 -13
- package/ui/block/Grid.md +21 -9
- package/ui/block/Heading.md +12 -12
- package/ui/block/List.md +7 -7
- package/ui/block/Panel.md +8 -8
- package/ui/block/Paragraph.md +5 -5
- package/ui/block/Prose.md +6 -6
- package/ui/block/Section.md +13 -10
- package/ui/block/Subheading.md +12 -12
- package/ui/block/Title.md +13 -13
- package/ui/button/Button.md +73 -64
- package/ui/dialog/Dialog.md +42 -28
- package/ui/dialog/Dialogs.d.ts +4 -0
- package/ui/dialog/Dialogs.js +4 -0
- package/ui/dialog/Dialogs.tsx +4 -0
- package/ui/dialog/Modal.md +57 -45
- package/ui/docs/DocumentationButtons.md +2 -2
- package/ui/docs/DocumentationCard.md +2 -2
- package/ui/docs/DocumentationFrame.md +4 -4
- package/ui/docs/DocumentationLive.md +11 -11
- package/ui/docs/DocumentationPage.md +3 -3
- package/ui/form/Field.md +14 -14
- package/ui/form/Form.md +41 -39
- package/ui/form/FormStore.md +6 -2
- package/ui/form/Progress.md +11 -11
- package/ui/inline/Code.md +11 -11
- package/ui/inline/Deleted.md +6 -6
- package/ui/inline/Emphasis.md +4 -4
- package/ui/inline/Inserted.md +6 -6
- package/ui/inline/Link.md +11 -11
- package/ui/inline/Mark.md +11 -9
- package/ui/inline/Small.md +4 -4
- package/ui/inline/Span.md +3 -1
- package/ui/inline/Strong.md +4 -4
- package/ui/input/ImageInput.md +12 -12
- package/ui/input/QueryRadiosInput.md +2 -2
- package/ui/input/SchemaInput.md +20 -20
- package/ui/layout/AppLayout.md +35 -26
- package/ui/layout/AppLayout.module.css +3 -16
- package/ui/layout/FixedLayout.md +27 -25
- package/ui/layout/SidebarLayout.md +27 -27
- package/ui/layout/SidebarLayout.module.css +1 -0
- package/ui/menu/Menu.md +24 -24
- package/ui/menu/MenuItem.md +29 -29
- package/ui/misc/Catcher.md +3 -3
- package/ui/misc/Icon.md +4 -4
- package/ui/misc/Loading.md +6 -6
- package/ui/misc/Markup.md +4 -4
- package/ui/misc/Tag.md +15 -15
- package/ui/notice/Empty.md +2 -2
- package/ui/notice/Notice.md +15 -15
- package/ui/notice/Notices.md +17 -17
- package/ui/page/HTML.md +10 -8
- package/ui/page/Head.md +2 -3
- package/ui/page/Page.md +13 -13
- package/ui/router/BackButton.md +13 -11
- package/ui/router/Navigation.md +28 -26
- package/ui/router/NavigationStore.md +18 -18
- package/ui/router/RouteCache.md +27 -27
- package/ui/router/Router.md +70 -61
- package/ui/router/StackButton.md +13 -7
- package/ui/style/Scroll.md +16 -16
- package/ui/style/TINT_CLASS.md +11 -11
- package/ui/style/getColorClass.md +23 -23
- package/ui/style/getDurationClass.md +5 -5
- package/ui/style/getGridClass.md +2 -2
- package/ui/style/getHeightClass.md +4 -4
- package/ui/style/getRadiusClass.md +9 -9
- package/ui/style/getShadowClass.md +6 -6
- package/ui/style/getSpaceClass.md +13 -13
- package/ui/style/getStrokeClass.md +6 -6
- package/ui/style/getTypographyClass.md +38 -38
- package/ui/style/getWidthClass.md +4 -4
- package/ui/table/Table.md +40 -30
- package/ui/transition/CollapseTransition.md +5 -5
- package/ui/transition/FadeTransition.md +9 -9
- package/ui/transition/HorizontalTransition.md +10 -10
- package/ui/transition/Transition.md +22 -22
- package/ui/transition/VerticalTransition.md +8 -8
- package/ui/tree/TreeApp.md +8 -8
- package/ui/tree/TreeMarkup.md +2 -2
- package/ui/tree/TreeMenu.md +3 -3
- package/ui/tree/TreeSidebar.md +1 -1
- package/ui/util/ClassProps.md +1 -1
- package/ui/util/getClass.md +10 -10
- package/ui/util/notify.md +11 -11
- 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
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
56
|
-
|
|
57
|
-
| `--link-color`
|
|
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
|
|
43
|
-
|
|
44
|
-
| `--list-space`
|
|
45
|
-
| `--list-gap`
|
|
46
|
-
| `--list-indent`
|
|
47
|
-
| `--list-marker-color` | Bullet / number colour
|
|
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
|
|
package/docs/ui/Loading.md
CHANGED
|
@@ -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
|
|
45
|
-
|
|
46
|
-
| `--loading-track`
|
|
47
|
-
| `--loading-indicator`
|
|
48
|
-
| `--loading-stroke-width` | Stroke width of both arcs
|
|
49
|
-
| `--loading-length`
|
|
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>
|
|
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
|
|
31
|
-
|
|
32
|
-
| `--mark-tint`
|
|
33
|
-
| `--mark-background` | Background fill
|
|
34
|
-
| `--mark-color`
|
|
35
|
-
| `--mark-indent`
|
|
36
|
-
| `--mark-radius`
|
|
37
|
-
| `--mark-weight`
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
40
|
-
|
|
41
|
-
| `--menu-gap`
|
|
42
|
-
| `--menu-font`
|
|
43
|
-
| `--menu-size`
|
|
44
|
-
| `--menu-leading`
|
|
45
|
-
| `--menu-color`
|
|
46
|
-
| `--menu-nested-space`
|
|
47
|
-
| `--menu-padding`
|
|
48
|
-
| `--menu-indent`
|
|
49
|
-
| `--menu-small-indent`
|
|
50
|
-
| `--menu-nested-border`
|
|
51
|
-
| `--menu-nested-color-border` | Nested submenu left-border colour
|
|
52
|
-
| `--menu-nested-indent`
|
|
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
|
|
package/docs/ui/MenuItem.md
CHANGED
|
@@ -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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
59
|
-
|
|
60
|
-
| `--menu-padding`
|
|
61
|
-
| `--menu-indent`
|
|
62
|
-
| `--menu-stroke`
|
|
63
|
-
| `--menu-icon-size`
|
|
64
|
-
| `--menu-height`
|
|
65
|
-
| `--menu-small-padding`
|
|
66
|
-
| `--menu-small-indent`
|
|
67
|
-
| `--menu-small-height`
|
|
68
|
-
| `--menu-radius`
|
|
69
|
-
| `--menu-focus-border`
|
|
70
|
-
| `--menu-hover-background`
|
|
71
|
-
| `--menu-hover-color`
|
|
72
|
-
| `--menu-proud-background`
|
|
73
|
-
| `--menu-proud`
|
|
74
|
-
| `--menu-proud-weight`
|
|
75
|
-
| `--menu-active-background` | Fill when active (current page), also while hovered or focused | `var(--tint-100)`
|
|
76
|
-
| `--menu-active-color`
|
|
77
|
-
| `--menu-active-weight`
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
112
|
-
|
|
113
|
-
| `--modal-width`
|
|
114
|
-
| `--modal-stroke`
|
|
115
|
-
| `--modal-border`
|
|
116
|
-
| `--modal-radius`
|
|
117
|
-
| `--modal-background`
|
|
118
|
-
| `--modal-padding`
|
|
119
|
-
| `--modal-indent`
|
|
120
|
-
| `--modal-color`
|
|
121
|
-
| `--modal-max-height`
|
|
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`
|
|
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
|
|
package/docs/ui/Navigation.md
CHANGED
|
@@ -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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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");
|
|
130
|
-
nav.back("/home");
|
|
131
|
-
nav.replace("/login");
|
|
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
|
|
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.
|
|
32
|
-
| `back(href, stack?)`
|
|
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.
|
|
34
|
-
| `history(stack?)`
|
|
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
|
|
64
|
-
|
|
65
|
-
| Start at `/home`
|
|
66
|
-
| Open a post
|
|
67
|
-
| Tap the Profile tab | `/profile` (depth 0)
|
|
68
|
-
| Tap the Home tab
|
|
69
|
-
| Tap the back button | `/home` (depth 0)
|
|
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
|
-
|
|
82
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
|