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/ui/inline/Mark.md
CHANGED
|
@@ -15,20 +15,22 @@ Highlighted text — renders a `<mark>` element to call attention to a run of te
|
|
|
15
15
|
```tsx live
|
|
16
16
|
import { Mark } from "shelving/ui";
|
|
17
17
|
|
|
18
|
-
<p>
|
|
18
|
+
<p>
|
|
19
|
+
Files are stored in <Mark>UTF-8</Mark> encoding.
|
|
20
|
+
</p>;
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
## Styling
|
|
22
24
|
|
|
23
25
|
`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.
|
|
24
26
|
|
|
25
|
-
| Variable
|
|
26
|
-
|
|
27
|
-
| `--mark-tint`
|
|
28
|
-
| `--mark-background` | Background fill
|
|
29
|
-
| `--mark-color`
|
|
30
|
-
| `--mark-indent`
|
|
31
|
-
| `--mark-radius`
|
|
32
|
-
| `--mark-weight`
|
|
27
|
+
| Variable | Styles | Default |
|
|
28
|
+
| ------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
29
|
+
| `--mark-tint` | Highlight hue, mixed 50% with `transparent` for the background | `var(--color-yellow)` |
|
|
30
|
+
| `--mark-background` | Background fill | `color-mix(in oklch, var(--mark-tint, var(--color-yellow)), transparent)` |
|
|
31
|
+
| `--mark-color` | Text colour | `var(--tint-00)` |
|
|
32
|
+
| `--mark-indent` | Left and right padding (one length) | `var(--space-xxsmall)` |
|
|
33
|
+
| `--mark-radius` | Corner radius | `var(--radius-xxsmall)` |
|
|
34
|
+
| `--mark-weight` | Font weight | `var(--weight-strong)` |
|
|
33
35
|
|
|
34
36
|
**Global tokens it reads:** `--color-yellow`, `--space-xxsmall`, `--radius-xxsmall`, `--weight-strong`, and the tint-ladder step `--tint-00`.
|
package/ui/inline/Small.md
CHANGED
|
@@ -15,16 +15,16 @@ Small print — renders a `<small>` element for side comments and fine print suc
|
|
|
15
15
|
import { Paragraph, Small } from "shelving/ui";
|
|
16
16
|
|
|
17
17
|
<Paragraph>
|
|
18
|
-
|
|
19
|
-
</Paragraph
|
|
18
|
+
Upgrade any time. <Small>Terms apply.</Small>
|
|
19
|
+
</Paragraph>;
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Styling
|
|
23
23
|
|
|
24
24
|
`Small` mutes its text colour to a lighter tint step and inherits size and weight from its surroundings.
|
|
25
25
|
|
|
26
|
-
| Variable
|
|
27
|
-
|
|
26
|
+
| Variable | Styles | Default |
|
|
27
|
+
| --------------- | ----------- | ---------------- |
|
|
28
28
|
| `--small-color` | Text colour | `var(--tint-70)` |
|
|
29
29
|
|
|
30
30
|
**Global tokens it reads:** the tint-ladder step `--tint-70`.
|
package/ui/inline/Span.md
CHANGED
package/ui/inline/Strong.md
CHANGED
|
@@ -16,16 +16,16 @@ Strong importance — renders a `<strong>` element for text that carries strong
|
|
|
16
16
|
import { Paragraph, Strong } from "shelving/ui";
|
|
17
17
|
|
|
18
18
|
<Paragraph>
|
|
19
|
-
|
|
20
|
-
</Paragraph
|
|
19
|
+
Press save before leaving. <Strong>Unsaved changes will be lost.</Strong>
|
|
20
|
+
</Paragraph>;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Styling
|
|
24
24
|
|
|
25
25
|
`Strong` only sets its font weight and inherits colour and size from its surroundings.
|
|
26
26
|
|
|
27
|
-
| Variable
|
|
28
|
-
|
|
27
|
+
| Variable | Styles | Default |
|
|
28
|
+
| ----------------- | ----------- | ---------------------- |
|
|
29
29
|
| `--strong-weight` | Font weight | `var(--weight-strong)` |
|
|
30
30
|
|
|
31
31
|
**Global tokens it reads:** `--weight-strong`.
|
package/ui/input/ImageInput.md
CHANGED
|
@@ -18,8 +18,8 @@ A large square image picker. With no image, it shows a "Choose…" button in the
|
|
|
18
18
|
import { ImageInput } from "shelving/ui";
|
|
19
19
|
|
|
20
20
|
function PhotoPicker() {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const [photo, setPhoto] = useState<File>();
|
|
22
|
+
return <ImageInput name="photo" title="Photo" value={photo} onValue={setPhoto} />;
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -29,21 +29,21 @@ function PhotoPicker() {
|
|
|
29
29
|
import { ImageInput } from "shelving/ui";
|
|
30
30
|
|
|
31
31
|
// Shows the saved photo. A new pick calls `onValue` with the new `File`.
|
|
32
|
-
<ImageInput name="photo" value={user.photoURL} onValue={upload}
|
|
32
|
+
<ImageInput name="photo" value={user.photoURL} onValue={upload} />;
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## Styling
|
|
36
36
|
|
|
37
37
|
`ImageInput` paints from the [tint ladder](/ui/TINT_CLASS). The "Choose…" and X buttons are `<Button>` styles, so `--button-*` hooks also move them.
|
|
38
38
|
|
|
39
|
-
| Variable
|
|
40
|
-
|
|
41
|
-
| `--image-input-space`
|
|
42
|
-
| `--image-input-radius`
|
|
43
|
-
| `--image-input-background`
|
|
44
|
-
| `--image-input-preview-background` | Background behind the picked image, seen through a transparent image | `#000`
|
|
45
|
-
| `--image-input-focus-border`
|
|
46
|
-
| `--image-input-invalid-border`
|
|
47
|
-
| `--image-input-clear-inset`
|
|
39
|
+
| Variable | Styles | Default |
|
|
40
|
+
| ---------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------ |
|
|
41
|
+
| `--image-input-space` | Space above and below the square | `var(--space-small)` (12px) |
|
|
42
|
+
| `--image-input-radius` | Corner radius of the square | `var(--radius-small)` (12px) |
|
|
43
|
+
| `--image-input-background` | Square background when empty | `var(--tint-90)` |
|
|
44
|
+
| `--image-input-preview-background` | Background behind the picked image, seen through a transparent image | `#000` |
|
|
45
|
+
| `--image-input-focus-border` | Outline when the input has focus | `var(--stroke-focus) solid var(--color-focus)` |
|
|
46
|
+
| `--image-input-invalid-border` | Outline when `message` is set | `var(--stroke-focus) solid var(--color-failure)` |
|
|
47
|
+
| `--image-input-clear-inset` | Distance of the X button from the top and end edges | `var(--space-small)` (12px) |
|
|
48
48
|
|
|
49
49
|
Global tokens it reads: `--tint-90`, `--space-small`, `--radius-small`, `--stroke-focus`, `--color-focus`, `--color-failure`.
|
|
@@ -21,7 +21,7 @@ import { StringSchema } from "shelving/schema";
|
|
|
21
21
|
|
|
22
22
|
const SEARCH = new StringSchema({ title: "Search", one: "user" });
|
|
23
23
|
|
|
24
|
-
<QueryRadiosInput name="user" schema={SEARCH} onQuery={search} value={user} onValue={setUser}
|
|
24
|
+
<QueryRadiosInput name="user" schema={SEARCH} onQuery={search} value={user} onValue={setUser} />;
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Inline list with avatars
|
|
@@ -34,7 +34,7 @@ const SEARCH = new StringSchema({ title: "Search", one: "user" });
|
|
|
34
34
|
onQuery={search}
|
|
35
35
|
formatter={user => <Avatar user={user} />}
|
|
36
36
|
onValue={setUser}
|
|
37
|
-
|
|
37
|
+
/>;
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Styling
|
package/ui/input/SchemaInput.md
CHANGED
|
@@ -11,28 +11,28 @@ Schema-driven input dispatch. `SchemaInput` inspects a `Schema` instance and ren
|
|
|
11
11
|
|
|
12
12
|
The schema-to-input mapping:
|
|
13
13
|
|
|
14
|
-
| Schema type
|
|
15
|
-
|
|
16
|
-
| `StringSchema`
|
|
17
|
-
| `NumberSchema`
|
|
18
|
-
| `DateSchema`
|
|
19
|
-
| `BooleanSchema`
|
|
20
|
-
| `ChoiceSchema` (`input: "radio"`, the default for ≤ 8 options)
|
|
21
|
-
| `ChoiceSchema` (`input: "select"`, the default for > 8 options) | `<SelectInput>`
|
|
22
|
-
| `ArraySchema`
|
|
23
|
-
| `DictionarySchema`
|
|
24
|
-
| `DataSchema`
|
|
14
|
+
| Schema type | Rendered as |
|
|
15
|
+
| --------------------------------------------------------------- | ----------------------------------- |
|
|
16
|
+
| `StringSchema` | `<TextInput>` |
|
|
17
|
+
| `NumberSchema` | `<NumberInput>` (formatted on blur) |
|
|
18
|
+
| `DateSchema` | `<DateInput>` |
|
|
19
|
+
| `BooleanSchema` | `<CheckboxInput>` |
|
|
20
|
+
| `ChoiceSchema` (`input: "radio"`, the default for ≤ 8 options) | `<ChoiceRadioInputs>` |
|
|
21
|
+
| `ChoiceSchema` (`input: "select"`, the default for > 8 options) | `<SelectInput>` |
|
|
22
|
+
| `ArraySchema` | `<ArrayInput>` |
|
|
23
|
+
| `DictionarySchema` | `<DictionaryInput>` |
|
|
24
|
+
| `DataSchema` | `<DataInput>` |
|
|
25
25
|
|
|
26
26
|
The shared value-input prop contract (`ValueInputProps<O>`):
|
|
27
27
|
|
|
28
|
-
| Prop
|
|
29
|
-
|
|
30
|
-
| `name`
|
|
31
|
-
| `value`
|
|
32
|
-
| `onValue(v)` | Called on every change
|
|
33
|
-
| `required`
|
|
34
|
-
| `disabled`
|
|
35
|
-
| `message`
|
|
28
|
+
| Prop | Contract |
|
|
29
|
+
| ------------ | --------------------------- |
|
|
30
|
+
| `name` | HTML field name |
|
|
31
|
+
| `value` | Current value |
|
|
32
|
+
| `onValue(v)` | Called on every change |
|
|
33
|
+
| `required` | Marks the field as required |
|
|
34
|
+
| `disabled` | Disables the control |
|
|
35
|
+
| `message` | Inline error string |
|
|
36
36
|
|
|
37
37
|
`<DataInput>` renders a row of `SchemaInput` elements for each property of a nested data object, and propagates sub-field errors from a `"key: message\n…"` formatted `message` string. `ArrayInput` and `DictionaryInput` both accept an `items` schema to render a repeatable list of sub-inputs with add/remove buttons.
|
|
38
38
|
|
|
@@ -53,5 +53,5 @@ import { StringSchema, NumberSchema } from "shelving/schema";
|
|
|
53
53
|
```tsx
|
|
54
54
|
import { SchemaField } from "shelving/ui";
|
|
55
55
|
|
|
56
|
-
<SchemaField name="email" schema={EMAIL_SCHEMA}
|
|
56
|
+
<SchemaField name="email" schema={EMAIL_SCHEMA} />; // <Field> wrapping a <TextInput>
|
|
57
57
|
```
|
package/ui/layout/AppLayout.md
CHANGED
|
@@ -7,10 +7,11 @@ A full-viewport layout with a content slot above a bar of the app's main section
|
|
|
7
7
|
- The content slot does not scroll. Fill it with `<Scroll vertical cover>` inside `<RouteCache>`, so each page scrolls in its own box and keeps its own scroll position.
|
|
8
8
|
- The bar sits below the content slot, not over it. So pages need no extra space at the bottom for the bar.
|
|
9
9
|
- The bar shows at every screen size.
|
|
10
|
+
- The bar paints above the content slot, so its shadow (`--app-layout-nav-shadow`) shows over the pages, even a page with its own background.
|
|
10
11
|
- The content slot stays clear of the notch and the rounded screen corners, and the bar stays clear of the home bar (safe-area insets).
|
|
11
12
|
- Each item in the bar takes an equal share of its width, up to `--app-layout-nav-item-width` each.
|
|
12
|
-
- The bar is outside the page cache, so it has one copy
|
|
13
|
-
- The bar has
|
|
13
|
+
- The bar is outside the page cache, so it has one copy and keeps its state.
|
|
14
|
+
- The bar has no view-transition name of its own. Pages slide sideways in the content slot above it, so the bar stays still. A named bar would draw above a dialog or notice that covers it during every view transition.
|
|
14
15
|
- Leave out `nav`, or set it to `false`, to show no bar. The content slot then fills the screen. To hide the bar for some pages, change the prop from the URL, so the layout and its page cache stay mounted: `nav={path.startsWith("/squad/") ? false : <StackBar />}`.
|
|
15
16
|
- Pages, error pages and loading states never render it themselves. Pick it above the router. See "Composing an app" on `<App>`.
|
|
16
17
|
|
|
@@ -20,37 +21,45 @@ A full-viewport layout with a content slot above a bar of the app's main section
|
|
|
20
21
|
import { AppLayout, HorizontalTransition, PageLoader, RouteCache, Router, Scroll, StackButton } from "shelving/ui";
|
|
21
22
|
|
|
22
23
|
function StackBar() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<StackButton stack="/home" title="Home">
|
|
27
|
+
<HomeIcon />
|
|
28
|
+
</StackButton>
|
|
29
|
+
<StackButton stack="/discover" title="Discover">
|
|
30
|
+
<SearchIcon />
|
|
31
|
+
</StackButton>
|
|
32
|
+
<StackButton stack="/profile" title="Profile">
|
|
33
|
+
<ProfileIcon />
|
|
34
|
+
</StackButton>
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
<AppLayout nav={<StackBar />}>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</AppLayout
|
|
40
|
+
<HorizontalTransition>
|
|
41
|
+
<RouteCache>
|
|
42
|
+
<Scroll vertical cover>
|
|
43
|
+
<PageLoader>
|
|
44
|
+
<Router routes={ROUTES} />
|
|
45
|
+
</PageLoader>
|
|
46
|
+
</Scroll>
|
|
47
|
+
</RouteCache>
|
|
48
|
+
</HorizontalTransition>
|
|
49
|
+
</AppLayout>;
|
|
41
50
|
```
|
|
42
51
|
|
|
43
52
|
## Styling
|
|
44
53
|
|
|
45
|
-
| Variable
|
|
46
|
-
|
|
47
|
-
| `--app-layout-background`
|
|
48
|
-
| `--app-layout-color`
|
|
49
|
-
| `--app-layout-nav-background` | Bar fill (also fills the home-bar area below it)
|
|
50
|
-
| `--app-layout-nav-color`
|
|
51
|
-
| `--app-layout-nav-border`
|
|
52
|
-
| `--app-layout-nav-shadow`
|
|
53
|
-
| `--app-layout-nav-item-width` | Largest width of one bar item
|
|
54
|
+
| Variable | Styles | Default |
|
|
55
|
+
| ----------------------------- | ----------------------------------------------------- | ------------------------------------------- |
|
|
56
|
+
| `--app-layout-background` | Page background while the layout is mounted | `var(--tint-100)` (white) |
|
|
57
|
+
| `--app-layout-color` | Text colour for the layout | `var(--tint-00)` (black) |
|
|
58
|
+
| `--app-layout-nav-background` | Bar fill (also fills the home-bar area below it) | `var(--tint-100)` (white) |
|
|
59
|
+
| `--app-layout-nav-color` | Bar text and icon colour | `var(--tint-00)` (black) |
|
|
60
|
+
| `--app-layout-nav-border` | Line above the bar | `var(--stroke-normal) solid var(--tint-90)` |
|
|
61
|
+
| `--app-layout-nav-shadow` | Shadow of the bar, for example a soft shadow above it | `none` |
|
|
62
|
+
| `--app-layout-nav-item-width` | Largest width of one bar item | `6rem` |
|
|
54
63
|
|
|
55
64
|
The bar keeps its items clear of the home bar and the rounded screen corners with safe-area insets.
|
|
56
65
|
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
/* The bar. Its transparent bottom border keeps the items clear of the home bar, and its background fills that area. */
|
|
70
70
|
.nav {
|
|
71
71
|
/* Box */
|
|
72
|
+
position: relative; /* Positioned like the content slot, and after it, so the bar and its shadow paint above the pages (for example a page with its own background during a swipe). */
|
|
72
73
|
display: flex;
|
|
73
74
|
justify-content: center;
|
|
74
75
|
border-block-start: var(--app-layout-nav-border, var(--stroke-normal) solid var(--tint-90));
|
|
@@ -80,8 +81,8 @@
|
|
|
80
81
|
color: var(--app-layout-nav-color, var(--tint-00));
|
|
81
82
|
box-shadow: var(--app-layout-nav-shadow, none);
|
|
82
83
|
|
|
83
|
-
/*
|
|
84
|
-
|
|
84
|
+
/* No view-transition name of its own. Pages slide sideways in the content slot above it, so they never pass over it.
|
|
85
|
+
* A named bar would draw above everything else during any view transition, and jump over a dialog or notice that covers it. */
|
|
85
86
|
|
|
86
87
|
/* Each item takes an equal share of the bar. */
|
|
87
88
|
> * {
|
|
@@ -90,17 +91,3 @@
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
-
/* The bar stays still, so it never makes a view transition last longer. */
|
|
95
|
-
::view-transition-group(app-layout-nav) {
|
|
96
|
-
animation-duration: 0s;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Show only the live bar during a view transition, so the CSS transitions of its items (an active tab) play with no cross-fade. */
|
|
100
|
-
::view-transition-old(app-layout-nav) {
|
|
101
|
-
display: none;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
::view-transition-new(app-layout-nav) {
|
|
105
|
-
animation: none;
|
|
106
|
-
}
|
package/ui/layout/FixedLayout.md
CHANGED
|
@@ -17,23 +17,25 @@ import { Block, FixedLayout, Router, Scroll } from "shelving/ui";
|
|
|
17
17
|
|
|
18
18
|
// The signed-out screens: one layout around their own router.
|
|
19
19
|
<FixedLayout>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
<Scroll vertical cover>
|
|
21
|
+
<Router
|
|
22
|
+
routes={{
|
|
23
|
+
"/login": LoginPage,
|
|
24
|
+
"/register": RegisterPage,
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
</Scroll>
|
|
28
|
+
</FixedLayout>;
|
|
27
29
|
|
|
28
30
|
// Each page centres its own content.
|
|
29
31
|
function LoginPage() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
return (
|
|
33
|
+
<Page title="Log in">
|
|
34
|
+
<Block height="full" middle width="narrow" padding="xxlarge" indent="normal">
|
|
35
|
+
<LoginForm />
|
|
36
|
+
</Block>
|
|
37
|
+
</Page>
|
|
38
|
+
);
|
|
37
39
|
}
|
|
38
40
|
```
|
|
39
41
|
|
|
@@ -43,23 +45,23 @@ An app-level error, outside every other layout:
|
|
|
43
45
|
import { Catcher, ErrorPage, type ErrorProps, FixedLayout, Scroll } from "shelving/ui";
|
|
44
46
|
|
|
45
47
|
function AppError({ reason }: ErrorProps) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
return (
|
|
49
|
+
<FixedLayout>
|
|
50
|
+
<Scroll vertical cover>
|
|
51
|
+
<ErrorPage reason={reason} />
|
|
52
|
+
</Scroll>
|
|
53
|
+
</FixedLayout>
|
|
54
|
+
);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
<Catcher as={AppError}>…</Catcher
|
|
57
|
+
<Catcher as={AppError}>…</Catcher>;
|
|
56
58
|
```
|
|
57
59
|
|
|
58
60
|
## Styling
|
|
59
61
|
|
|
60
|
-
| Variable
|
|
61
|
-
|
|
62
|
+
| Variable | Styles | Default |
|
|
63
|
+
| --------------------------- | ------------------------------------------- | ------------------------- |
|
|
62
64
|
| `--fixed-layout-background` | Page background while the layout is mounted | `var(--tint-100)` (white) |
|
|
63
|
-
| `--fixed-layout-color`
|
|
65
|
+
| `--fixed-layout-color` | Text colour for the layout | `var(--tint-00)` (black) |
|
|
64
66
|
|
|
65
67
|
**Global tokens it reads** — `--tint-00` and `--tint-100`.
|
|
@@ -20,24 +20,24 @@ A full-viewport layout with a fixed-width side column next to a content slot. Th
|
|
|
20
20
|
import { Menu, MenuItem, PageLoader, RouteCache, Router, Scroll, SidebarLayout } from "shelving/ui";
|
|
21
21
|
|
|
22
22
|
function AppShell() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
const nav = (
|
|
24
|
+
<Menu>
|
|
25
|
+
<MenuItem href="/dashboard">Dashboard</MenuItem>
|
|
26
|
+
<MenuItem href="/users">Users</MenuItem>
|
|
27
|
+
<MenuItem href="/settings">Settings</MenuItem>
|
|
28
|
+
</Menu>
|
|
29
|
+
);
|
|
30
|
+
return (
|
|
31
|
+
<SidebarLayout sidebar={nav}>
|
|
32
|
+
<RouteCache>
|
|
33
|
+
<Scroll vertical cover>
|
|
34
|
+
<PageLoader>
|
|
35
|
+
<Router routes={ROUTES} />
|
|
36
|
+
</PageLoader>
|
|
37
|
+
</Scroll>
|
|
38
|
+
</RouteCache>
|
|
39
|
+
</SidebarLayout>
|
|
40
|
+
);
|
|
41
41
|
}
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -45,15 +45,15 @@ To slide pages, put a transition around the `<RouteCache>`, inside the layout. T
|
|
|
45
45
|
|
|
46
46
|
## Styling
|
|
47
47
|
|
|
48
|
-
| Variable
|
|
49
|
-
|
|
50
|
-
| `--sidebar-layout-width`
|
|
51
|
-
| `--sidebar-layout-background`
|
|
52
|
-
| `--sidebar-layout-color`
|
|
53
|
-
| `--sidebar-layout-sidebar-background` | Sidebar column fill
|
|
54
|
-
| `--sidebar-layout-sidebar-color`
|
|
55
|
-
| `--sidebar-layout-border`
|
|
56
|
-
| `--sidebar-layout-shadow`
|
|
48
|
+
| Variable | Styles | Default |
|
|
49
|
+
| ------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
50
|
+
| `--sidebar-layout-width` | Width of the side column (and drawer) | `17.5rem` |
|
|
51
|
+
| `--sidebar-layout-background` | Page background while the layout is mounted (also fills the content column) | `var(--tint-100)` (white) |
|
|
52
|
+
| `--sidebar-layout-color` | Text colour for the layout (set on `body`, inherited by the content column) | `var(--tint-00)` (black) |
|
|
53
|
+
| `--sidebar-layout-sidebar-background` | Sidebar column fill | `var(--tint-90)` (one shade darker than the page) |
|
|
54
|
+
| `--sidebar-layout-sidebar-color` | Sidebar column text colour | `var(--tint-00)` (black) |
|
|
55
|
+
| `--sidebar-layout-border` | Divider between sidebar and content, e.g. `1px solid var(--tint-90)` | `none` |
|
|
56
|
+
| `--sidebar-layout-shadow` | Drop shadow of the open drawer on a narrow screen | `var(--shadow-large)` |
|
|
57
57
|
|
|
58
58
|
The sidebar scrolls on its own. The content slot does not scroll: its `<Scroll vertical cover>` box does.
|
|
59
59
|
|
package/ui/menu/Menu.md
CHANGED
|
@@ -14,34 +14,34 @@ A `<menu>` list of `<MenuItem>` children — the container for URL-aware navigat
|
|
|
14
14
|
import { Menu, MenuItem } from "shelving/ui";
|
|
15
15
|
|
|
16
16
|
<Menu>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</Menu
|
|
17
|
+
<MenuItem href="/dashboard">Dashboard</MenuItem>
|
|
18
|
+
<MenuItem href="/users">
|
|
19
|
+
Users
|
|
20
|
+
<Menu>
|
|
21
|
+
<MenuItem href="/users/active">Active</MenuItem>
|
|
22
|
+
<MenuItem href="/users/archived">Archived</MenuItem>
|
|
23
|
+
</Menu>
|
|
24
|
+
</MenuItem>
|
|
25
|
+
<MenuItem href="/settings">Settings</MenuItem>
|
|
26
|
+
</Menu>;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Styling
|
|
30
30
|
|
|
31
|
-
| Variable
|
|
32
|
-
|
|
33
|
-
| `--menu-gap`
|
|
34
|
-
| `--menu-font`
|
|
35
|
-
| `--menu-size`
|
|
36
|
-
| `--menu-leading`
|
|
37
|
-
| `--menu-color`
|
|
38
|
-
| `--menu-nested-space`
|
|
39
|
-
| `--menu-padding`
|
|
40
|
-
| `--menu-indent`
|
|
41
|
-
| `--menu-small-indent`
|
|
42
|
-
| `--menu-nested-border`
|
|
43
|
-
| `--menu-nested-color-border` | Nested submenu left-border colour
|
|
44
|
-
| `--menu-nested-indent`
|
|
31
|
+
| Variable | Styles | Default |
|
|
32
|
+
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------- |
|
|
33
|
+
| `--menu-gap` | Vertical gap between items | `0` |
|
|
34
|
+
| `--menu-font` | Font family | `var(--font-body)` |
|
|
35
|
+
| `--menu-size` | Font size | `var(--size-normal)` |
|
|
36
|
+
| `--menu-leading` | Line height | `var(--leading)` |
|
|
37
|
+
| `--menu-color` | Text colour | `var(--tint-00)` |
|
|
38
|
+
| `--menu-nested-space` | Block margin around a nested submenu | `var(--space-xxsmall)` |
|
|
39
|
+
| `--menu-padding` | Item link top and bottom padding (one length) | `var(--space-small)` |
|
|
40
|
+
| `--menu-indent` | Item link left and right padding (one length; with `--menu-stroke`, also insets the nested border) | `var(--space-small)` |
|
|
41
|
+
| `--menu-small-indent` | Small item link left and right padding (one length; also insets the nested border of a small item) | `var(--space-xsmall)` |
|
|
42
|
+
| `--menu-nested-border` | Nested submenu left-border width | `var(--stroke-focus)` |
|
|
43
|
+
| `--menu-nested-color-border` | Nested submenu left-border colour | `var(--tint-50)` |
|
|
44
|
+
| `--menu-nested-indent` | Nested submenu left padding | `var(--space-xsmall)` |
|
|
45
45
|
|
|
46
46
|
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>`.
|
|
47
47
|
|
package/ui/menu/MenuItem.md
CHANGED
|
@@ -15,15 +15,15 @@ A single `<li>` link entry inside a `<Menu>`. It reads the current page URL from
|
|
|
15
15
|
import { Menu, MenuItem } from "shelving/ui";
|
|
16
16
|
|
|
17
17
|
<Menu>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</Menu
|
|
18
|
+
<MenuItem href="/users">
|
|
19
|
+
Users
|
|
20
|
+
<Menu>
|
|
21
|
+
<MenuItem href="/users/active">Active</MenuItem>
|
|
22
|
+
<MenuItem href="/users/archived">Archived</MenuItem>
|
|
23
|
+
</Menu>
|
|
24
|
+
</MenuItem>
|
|
25
|
+
<MenuItem href="/settings">Settings</MenuItem>
|
|
26
|
+
</Menu>;
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
### Small items
|
|
@@ -47,26 +47,26 @@ import { Menu, MenuItem } from "shelving/ui";
|
|
|
47
47
|
|
|
48
48
|
The item link's hooks (defined in `Menu.module.css`):
|
|
49
49
|
|
|
50
|
-
| Variable
|
|
51
|
-
|
|
52
|
-
| `--menu-padding`
|
|
53
|
-
| `--menu-indent`
|
|
54
|
-
| `--menu-stroke`
|
|
55
|
-
| `--menu-icon-size`
|
|
56
|
-
| `--menu-height`
|
|
57
|
-
| `--menu-small-padding`
|
|
58
|
-
| `--menu-small-indent`
|
|
59
|
-
| `--menu-small-height`
|
|
60
|
-
| `--menu-radius`
|
|
61
|
-
| `--menu-focus-border`
|
|
62
|
-
| `--menu-hover-background`
|
|
63
|
-
| `--menu-hover-color`
|
|
64
|
-
| `--menu-proud-background`
|
|
65
|
-
| `--menu-proud`
|
|
66
|
-
| `--menu-proud-weight`
|
|
67
|
-
| `--menu-active-background` | Fill when active (current page), also while hovered or focused | `var(--tint-100)`
|
|
68
|
-
| `--menu-active-color`
|
|
69
|
-
| `--menu-active-weight`
|
|
50
|
+
| Variable | Styles | Default |
|
|
51
|
+
| -------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `--menu-padding` | Link top and bottom padding (one length) | `var(--space-small)` |
|
|
53
|
+
| `--menu-indent` | Link left and right padding (one length) | `var(--space-small)` |
|
|
54
|
+
| `--menu-stroke` | Link transparent border width (one length) | `var(--stroke-normal)` |
|
|
55
|
+
| `--menu-icon-size` | Content height used for the minimum height (one length) | `var(--size-icon)` |
|
|
56
|
+
| `--menu-height` | Link minimum height | `--menu-icon-size` + 2 × `--menu-padding` + 2 × `--menu-stroke`, the same as `--button-height` |
|
|
57
|
+
| `--menu-small-padding` | Small link top and bottom padding (one length) | `var(--space-xsmall)` |
|
|
58
|
+
| `--menu-small-indent` | Small link left and right padding (one length) | `var(--space-xsmall)` |
|
|
59
|
+
| `--menu-small-height` | Small link minimum height | `0` |
|
|
60
|
+
| `--menu-radius` | Link corner radius | `var(--radius-xsmall)` |
|
|
61
|
+
| `--menu-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
|
|
62
|
+
| `--menu-hover-background` | Link fill on hover/focus | `var(--tint-90)` |
|
|
63
|
+
| `--menu-hover-color` | Link text colour on hover/focus | `var(--tint-00)` |
|
|
64
|
+
| `--menu-proud-background` | Fill when proud (ancestor of current page) | `transparent` |
|
|
65
|
+
| `--menu-proud` | Text colour when proud | `var(--tint-00)` |
|
|
66
|
+
| `--menu-proud-weight` | Font weight when proud | `var(--weight-strong)` |
|
|
67
|
+
| `--menu-active-background` | Fill when active (current page), also while hovered or focused | `var(--tint-100)` |
|
|
68
|
+
| `--menu-active-color` | Text colour when active | `var(--tint-00)` |
|
|
69
|
+
| `--menu-active-weight` | Font weight when active | `var(--weight-strong)` |
|
|
70
70
|
|
|
71
71
|
List-level hooks (`--menu-gap`, `--menu-color`, the nested-submenu hooks, etc.) are documented on `<Menu>`.
|
|
72
72
|
|