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.
- 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 +112 -84
- package/docs/guides/styleguide.md +29 -29
- package/docs/index.md +3 -2
- package/docs/llms-full.txt +2531 -2291
- 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 +33 -24
- 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 +39 -27
- 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 +39 -27
- 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 +33 -24
- package/ui/layout/AppLayout.module.css +1 -0
- 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/router/Router.md
CHANGED
|
@@ -19,37 +19,39 @@ A pure URL matcher: it reads the current URL from the surrounding `<Meta>` conte
|
|
|
19
19
|
import { HTML, Navigation, Router } from "shelving/ui";
|
|
20
20
|
|
|
21
21
|
<HTML url={initialUrl} root="https://example.com/">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
<Navigation>
|
|
23
|
+
<Router
|
|
24
|
+
routes={{
|
|
25
|
+
"/": HomePage,
|
|
26
|
+
"/users/{id}": UserPage,
|
|
27
|
+
"/about": AboutPage,
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
</Navigation>
|
|
31
|
+
</HTML>;
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
### Route value types
|
|
33
35
|
|
|
34
|
-
| Value
|
|
35
|
-
|
|
36
|
-
| Component
|
|
37
|
-
| `AbsolutePath` string | Redirects to that path (placeholders resolved against the source).
|
|
38
|
-
| `ReactElement`
|
|
39
|
-
| `null` / `false`
|
|
36
|
+
| Value | Behaviour |
|
|
37
|
+
| --------------------- | ------------------------------------------------------------------------------ |
|
|
38
|
+
| Component | Rendered as `<Component {...params}/>` with merged placeholder + query props. |
|
|
39
|
+
| `AbsolutePath` string | Redirects to that path (placeholders resolved against the source). |
|
|
40
|
+
| `ReactElement` | Rendered as-is — use for layout wrapping or composing inner routers. |
|
|
41
|
+
| `null` / `false` | Skipped, as if the route were absent — lets a route be conditionally disabled. |
|
|
40
42
|
|
|
41
43
|
### Placeholder syntax
|
|
42
44
|
|
|
43
45
|
All forms produce the same matched value — pick whichever reads best:
|
|
44
46
|
|
|
45
|
-
| Form
|
|
46
|
-
|
|
47
|
-
| Anonymous
|
|
48
|
-
| Colon
|
|
49
|
-
| Single brace
|
|
50
|
-
| Square bracket | `[name]`
|
|
51
|
-
| Dollar brace
|
|
52
|
-
| Double brace
|
|
47
|
+
| Form | Single segment | Catchall (one+ segments, also matches empty) |
|
|
48
|
+
| -------------- | ----------------- | -------------------------------------------- |
|
|
49
|
+
| Anonymous | `*` (named `"0"`) | `**` / `***` (named `"0"`) |
|
|
50
|
+
| Colon | `:name` | `:name*` / `:name**` |
|
|
51
|
+
| Single brace | `{name}` | `{...name}` / `{name*}` |
|
|
52
|
+
| Square bracket | `[name]` | `[...name]` / `[name*]` |
|
|
53
|
+
| Dollar brace | `${name}` | `${...name}` / `${name*}` |
|
|
54
|
+
| Double brace | `{{name}}` | `{{...name}}` / `{{name*}}` |
|
|
53
55
|
|
|
54
56
|
Modifier chars are tolerant: one-or-more stars and three-or-more dots are all equivalent, so `{path*}`, `{path**}`, `{...path}`, and `{....path}` behave the same. Catchall placeholders allow empty values, so a trailing catchall matches the trailing-slash-absent variant — `/files/{...path}` matches `/files`, `/files/`, and `/files/a/b/c`.
|
|
55
57
|
|
|
@@ -59,21 +61,23 @@ Put layout JSX as the route value with another `<Router>` inside. Since `<Router
|
|
|
59
61
|
|
|
60
62
|
```tsx
|
|
61
63
|
const SIDEBARRED_ROUTES = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
"/users": <UsersPage />,
|
|
65
|
+
"/users/{id}": <UserPage />,
|
|
66
|
+
"/settings": <SettingsPage />,
|
|
65
67
|
};
|
|
66
68
|
|
|
67
|
-
<Router
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
<Router
|
|
70
|
+
routes={{
|
|
71
|
+
"/": <HomePage />,
|
|
72
|
+
"/{...path}": (
|
|
73
|
+
<SidebarLayout sidebar={<Nav />}>
|
|
74
|
+
<Scroll vertical cover>
|
|
75
|
+
<Router routes={SIDEBARRED_ROUTES} />
|
|
76
|
+
</Scroll>
|
|
77
|
+
</SidebarLayout>
|
|
78
|
+
),
|
|
79
|
+
}}
|
|
80
|
+
/>;
|
|
77
81
|
```
|
|
78
82
|
|
|
79
83
|
### Section / microsite pattern
|
|
@@ -82,21 +86,23 @@ A self-contained "section" — its own URL prefix and routes — composes via a
|
|
|
82
86
|
|
|
83
87
|
```tsx
|
|
84
88
|
const USER_ROUTES = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
"/": UsersPage,
|
|
90
|
+
"/{id}": UserPage,
|
|
91
|
+
"/{id}/edit": UserEditPage,
|
|
88
92
|
};
|
|
89
93
|
|
|
90
94
|
export function UserRouter({ path = "/" }: { path?: AbsolutePath }) {
|
|
91
|
-
|
|
95
|
+
return <Router routes={USER_ROUTES} url={path} />;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
// At the call site — the top-level router stays a flat list of section prefixes:
|
|
95
|
-
<Router
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}}
|
|
99
|
+
<Router
|
|
100
|
+
routes={{
|
|
101
|
+
"/": <HomePage />,
|
|
102
|
+
"/users/{...path}": ({ path }) => <UserRouter path={path} />,
|
|
103
|
+
"/blog/{...path}": ({ path }) => <BlogRouter path={path} />,
|
|
104
|
+
}}
|
|
105
|
+
/>;
|
|
100
106
|
```
|
|
101
107
|
|
|
102
108
|
The outer router captures everything under `/users` into `path`; the inner router treats it as its starting URL, so its `"/"` matches the bare `/users` and `/{id}` matches `/users/123`.
|
|
@@ -107,22 +113,25 @@ The two patterns compose — wrap a group of routes in a layout, then route furt
|
|
|
107
113
|
|
|
108
114
|
```tsx
|
|
109
115
|
const SIDEBARRED_ROUTES = {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
"/": <Dashboard />,
|
|
117
|
+
"/users/{...path}": ({ path }) => <UserRouter path={path} />,
|
|
118
|
+
"/blog/{...path}": ({ path }) => <BlogRouter path={path} />,
|
|
119
|
+
"/settings": <SettingsPage />,
|
|
114
120
|
};
|
|
115
121
|
|
|
116
|
-
<Router
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
<Router
|
|
123
|
+
routes={{
|
|
124
|
+
"/login": <LoginPage />, // no sidebar
|
|
125
|
+
"/{...path}": // everything else wrapped
|
|
126
|
+
(
|
|
127
|
+
<SidebarLayout sidebar={<Nav />}>
|
|
128
|
+
<Scroll vertical cover>
|
|
129
|
+
<Router routes={SIDEBARRED_ROUTES} />
|
|
130
|
+
</Scroll>
|
|
131
|
+
</SidebarLayout>
|
|
132
|
+
),
|
|
133
|
+
}}
|
|
134
|
+
/>;
|
|
126
135
|
```
|
|
127
136
|
|
|
128
137
|
### Keeping page state
|
|
@@ -135,9 +144,9 @@ By default a page is unmounted when you navigate away and mounted fresh when you
|
|
|
135
144
|
|
|
136
145
|
```tsx
|
|
137
146
|
renderToString(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
<HTML url={path} root="https://example.com/">
|
|
148
|
+
<Router routes={ROUTES} />
|
|
149
|
+
</HTML>,
|
|
141
150
|
);
|
|
142
151
|
```
|
|
143
152
|
|
package/ui/router/StackButton.md
CHANGED
|
@@ -20,13 +20,19 @@ import { Navigation, StackButton } from "shelving/ui";
|
|
|
20
20
|
import { HomeIcon, SearchIcon, UserIcon } from "./icons.js";
|
|
21
21
|
|
|
22
22
|
<Navigation stacks={["/home", "/discover", "/profile"]}>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
{/* … */}
|
|
24
|
+
<nav className="tab-bar">
|
|
25
|
+
<StackButton stack="/home" title="Home">
|
|
26
|
+
<HomeIcon />
|
|
27
|
+
</StackButton>
|
|
28
|
+
<StackButton stack="/discover" title="Discover">
|
|
29
|
+
<SearchIcon />
|
|
30
|
+
</StackButton>
|
|
31
|
+
<StackButton stack="/profile" title="Profile">
|
|
32
|
+
<UserIcon />
|
|
33
|
+
</StackButton>
|
|
34
|
+
</nav>
|
|
35
|
+
</Navigation>;
|
|
30
36
|
```
|
|
31
37
|
|
|
32
38
|
## Styling
|
package/ui/style/Scroll.md
CHANGED
|
@@ -18,8 +18,8 @@ A box that scrolls its content on one or both axes. Use it for a wide table on a
|
|
|
18
18
|
import { Scroll, Table } from "shelving/ui";
|
|
19
19
|
|
|
20
20
|
<Scroll horizontal>
|
|
21
|
-
|
|
22
|
-
</Scroll
|
|
21
|
+
<Table>…</Table>
|
|
22
|
+
</Scroll>;
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### A scroll box for each page
|
|
@@ -30,30 +30,30 @@ Put `<Scroll vertical cover>` inside `<RouteCache>`, so each kept page has its o
|
|
|
30
30
|
import { AppLayout, HorizontalTransition, PageLoader, RouteCache, Router, Scroll } from "shelving/ui";
|
|
31
31
|
|
|
32
32
|
<AppLayout nav={<StackBar />}>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</AppLayout
|
|
33
|
+
<HorizontalTransition>
|
|
34
|
+
<RouteCache>
|
|
35
|
+
<Scroll vertical cover>
|
|
36
|
+
<PageLoader>
|
|
37
|
+
<Router routes={ROUTES} />
|
|
38
|
+
</PageLoader>
|
|
39
|
+
</Scroll>
|
|
40
|
+
</RouteCache>
|
|
41
|
+
</HorizontalTransition>
|
|
42
|
+
</AppLayout>;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### A chat
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
48
|
<Scroll vertical cover reverse>
|
|
49
|
-
|
|
50
|
-
</Scroll
|
|
49
|
+
<div>{messages}</div>
|
|
50
|
+
</Scroll>;
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
## Styling
|
|
54
54
|
|
|
55
|
-
| Variable
|
|
56
|
-
|
|
55
|
+
| Variable | Styles | Default |
|
|
56
|
+
| ----------------------- | --------------------------------------- | ---------------------------------------------- |
|
|
57
57
|
| `--scroll-focus-border` | Outline when the box has keyboard focus | `var(--stroke-focus) solid var(--color-focus)` |
|
|
58
58
|
|
|
59
59
|
**Global tokens it reads** — `--stroke-focus`, `--stroke-normal`, and `--color-focus`.
|
package/ui/style/TINT_CLASS.md
CHANGED
|
@@ -8,7 +8,7 @@ The anchor defaults to `--color-gray`, so the default ladder is a neutral grey r
|
|
|
8
8
|
|
|
9
9
|
## The recompute trick
|
|
10
10
|
|
|
11
|
-
The ladder is computed at `:root` and
|
|
11
|
+
The ladder is computed at `:root` and _recomputed_ under `TINT_CLASS` (the `.tint` class). That recomputation is the whole trick: move the anchor at any scope, apply `TINT_CLASS`, and all 21 shades (and `--tint-contrast`) rebuild from the new hue at that scope. Colour and status classes are exactly that — they only move the anchor:
|
|
12
12
|
|
|
13
13
|
```css
|
|
14
14
|
/* Color.module.css — a colour variant just moves the anchor. */
|
|
@@ -28,15 +28,15 @@ The ladder is computed at `:root` and *recomputed* under `TINT_CLASS` (the `.tin
|
|
|
28
28
|
|
|
29
29
|
Components paint from the ladder by convention:
|
|
30
30
|
|
|
31
|
-
| Step
|
|
32
|
-
|
|
33
|
-
| `--tint-00`
|
|
34
|
-
| `--tint-50`
|
|
35
|
-
| `--tint-80`
|
|
36
|
-
| `--tint-90`
|
|
37
|
-
| `--tint-95`
|
|
38
|
-
| `--tint-100`
|
|
39
|
-
| `--tint-contrast` | Text on `--tint-50` backgrounds when the anchor can be light or dark
|
|
31
|
+
| Step | Used for |
|
|
32
|
+
| ----------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `--tint-00` | Body text, headings — maximum contrast |
|
|
34
|
+
| `--tint-50` | The hue itself — accents, labels, `Tag` backgrounds, `<Button>` backgrounds |
|
|
35
|
+
| `--tint-80` | Borders of boxes and controls — `<Card>`, `<Input>`, `<Notice>` |
|
|
36
|
+
| `--tint-90` | Surfaces — `<Card>`, `Preformatted` backgrounds; light rules — `<Divider>`, `<Table>` rows, `<Blockquote>` |
|
|
37
|
+
| `--tint-95` | Hover state of those surfaces |
|
|
38
|
+
| `--tint-100` | The page background; text on `--tint-50` backgrounds |
|
|
39
|
+
| `--tint-contrast` | Text on `--tint-50` backgrounds when the anchor can be light or dark |
|
|
40
40
|
|
|
41
41
|
Pairings follow contrast: long text reads at `00`-on-`90` or `00`-on-`100`; short labels read at `100`-on-`50`, or at `contrast`-on-`50` when the anchor can be light.
|
|
42
42
|
|
|
@@ -65,4 +65,4 @@ A theme is a CSS file of custom-property overrides at `:root`, imported after th
|
|
|
65
65
|
|
|
66
66
|
`TINT_CLASS` adds a plain global `tint` class (as well as its hashed module class) for this purpose, so `tint` is a reserved class name. Do not use `* { … }` for this: it declares the variable on every element, which adds style-recalc cost on large pages.
|
|
67
67
|
|
|
68
|
-
**Don't override individual ladder steps (`--tint-90`, etc.) at `:root`.** The ladder is
|
|
68
|
+
**Don't override individual ladder steps (`--tint-90`, etc.) at `:root`.** The ladder is _recomputed_ from the anchor inside every `TINT_CLASS` scope — which includes every component that accepts `color=` or `status=` — so a step override at `:root` only reaches untinted regions and produces inconsistent surfaces. Move the anchor (option 1 or 2) instead, and the steps follow.
|
|
@@ -10,33 +10,33 @@ The following `:root` variables are defined by this module and can be overridden
|
|
|
10
10
|
|
|
11
11
|
### Palette
|
|
12
12
|
|
|
13
|
-
| Variable
|
|
14
|
-
|
|
15
|
-
| `--color-gray`
|
|
16
|
-
| `--color-red`
|
|
17
|
-
| `--color-orange` | `oklch(74% 0.157 60)`
|
|
18
|
-
| `--color-yellow` | `oklch(86% 0.16 92)`
|
|
19
|
-
| `--color-green`
|
|
20
|
-
| `--color-aqua`
|
|
21
|
-
| `--color-blue`
|
|
22
|
-
| `--color-purple` | `oklch(58% 0.25 300)`
|
|
23
|
-
| `--color-pink`
|
|
13
|
+
| Variable | Default | Notes |
|
|
14
|
+
| ---------------- | ---------------------- | ------------------------------------------------------------- |
|
|
15
|
+
| `--color-gray` | `oklch(60% 0.01 240)` | Neutral anchor — also the default tint when nothing moves it. |
|
|
16
|
+
| `--color-red` | `oklch(62% 0.2 30)` | |
|
|
17
|
+
| `--color-orange` | `oklch(74% 0.157 60)` | |
|
|
18
|
+
| `--color-yellow` | `oklch(86% 0.16 92)` | |
|
|
19
|
+
| `--color-green` | `oklch(72% 0.185 130)` | |
|
|
20
|
+
| `--color-aqua` | `oklch(72% 0.121 185)` | |
|
|
21
|
+
| `--color-blue` | `oklch(57% 0.216 260)` | |
|
|
22
|
+
| `--color-purple` | `oklch(58% 0.25 300)` | |
|
|
23
|
+
| `--color-pink` | `oklch(68% 0.239 350)` | |
|
|
24
24
|
|
|
25
25
|
### Semantic
|
|
26
26
|
|
|
27
|
-
| Variable
|
|
28
|
-
|
|
29
|
-
| `--color-link`
|
|
30
|
-
| `--color-focus`
|
|
31
|
-
| `--color-success`
|
|
32
|
-
| `--color-warning`
|
|
33
|
-
| `--color-failure`
|
|
34
|
-
| `--color-backdrop` | `#0006`
|
|
27
|
+
| Variable | Default | Used for |
|
|
28
|
+
| ------------------ | --------------------- | --------------------------------------------------------------------------------------- |
|
|
29
|
+
| `--color-link` | `var(--color-blue)` | Link colour. |
|
|
30
|
+
| `--color-focus` | `var(--color-blue)` | Focus outlines. |
|
|
31
|
+
| `--color-success` | `var(--color-green)` | `status="success"`. |
|
|
32
|
+
| `--color-warning` | `var(--color-orange)` | `status="warning"`. |
|
|
33
|
+
| `--color-failure` | `var(--color-red)` | `status="error"` / `status="danger"`. |
|
|
34
|
+
| `--color-backdrop` | `#0006` | The backdrop that dims the page behind `<Dialog>` and an open `<SidebarLayout>` drawer. |
|
|
35
35
|
|
|
36
36
|
### Brand
|
|
37
37
|
|
|
38
|
-
| Variable
|
|
39
|
-
|
|
40
|
-
| `--color-primary`
|
|
38
|
+
| Variable | Default | Used for |
|
|
39
|
+
| ------------------- | --------------------- | -------------------- |
|
|
40
|
+
| `--color-primary` | `var(--color-blue)` | `color="primary"`. |
|
|
41
41
|
| `--color-secondary` | `var(--color-purple)` | `color="secondary"`. |
|
|
42
|
-
| `--color-tertiary`
|
|
42
|
+
| `--color-tertiary` | `var(--color-pink)` | `color="tertiary"`. |
|
|
@@ -6,8 +6,8 @@ This module's main job is to **define and document the transition/animation timi
|
|
|
6
6
|
|
|
7
7
|
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app.
|
|
8
8
|
|
|
9
|
-
| Variable
|
|
10
|
-
|
|
11
|
-
| `--duration-fast`
|
|
12
|
-
| `--duration-normal` | `300ms` | Default transitions.
|
|
13
|
-
| `--duration-slow`
|
|
9
|
+
| Variable | Default | Used for |
|
|
10
|
+
| ------------------- | ------- | ------------------------------------------- |
|
|
11
|
+
| `--duration-fast` | `150ms` | Snappy UI feedback — hovers, small toggles. |
|
|
12
|
+
| `--duration-normal` | `300ms` | Default transitions. |
|
|
13
|
+
| `--duration-slow` | `600ms` | Deliberate, large movements. |
|
package/ui/style/getGridClass.md
CHANGED
|
@@ -17,8 +17,8 @@ The grid variant props lay out a component's children in equal-width columns —
|
|
|
17
17
|
|
|
18
18
|
## Styling
|
|
19
19
|
|
|
20
|
-
| Variable
|
|
21
|
-
|
|
20
|
+
| Variable | Styles | Default |
|
|
21
|
+
| ------------ | ---------------------------------------- | --------------------------- |
|
|
22
22
|
| `--grid-gap` | Space between cells when no `gap` is set | `var(--space-small)` (12px) |
|
|
23
23
|
|
|
24
24
|
**Global tokens it reads:** `--space-small`, plus the `--space-*` token of the `gap` variant.
|
|
@@ -23,8 +23,8 @@ A log-in screen, in the middle of a layout's scroll box:
|
|
|
23
23
|
|
|
24
24
|
```tsx
|
|
25
25
|
<Page title="Log in">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</Page
|
|
26
|
+
<Block height="full" middle width="narrow" padding="xxlarge" indent="normal">
|
|
27
|
+
<LoginForm />
|
|
28
|
+
</Block>
|
|
29
|
+
</Page>;
|
|
30
30
|
```
|
|
@@ -6,12 +6,12 @@ This module's main job is to **define and document the corner-radius design toke
|
|
|
6
6
|
|
|
7
7
|
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app. Every step derives from `--radius-normal`, so changing that one value reflows the whole ramp.
|
|
8
8
|
|
|
9
|
-
| Variable
|
|
10
|
-
|
|
11
|
-
| `--radius-xxsmall` | `calc(var(--radius-normal) * 0.25)` | 4px
|
|
12
|
-
| `--radius-xsmall`
|
|
13
|
-
| `--radius-small`
|
|
14
|
-
| `--radius-normal`
|
|
15
|
-
| `--radius-large`
|
|
16
|
-
| `--radius-xlarge`
|
|
17
|
-
| `--radius-xxlarge` | `calc(var(--radius-normal) * 3)`
|
|
9
|
+
| Variable | Default | Notes |
|
|
10
|
+
| ------------------ | ----------------------------------- | ------------------------------------------ |
|
|
11
|
+
| `--radius-xxsmall` | `calc(var(--radius-normal) * 0.25)` | 4px |
|
|
12
|
+
| `--radius-xsmall` | `calc(var(--radius-normal) * 0.5)` | 8px |
|
|
13
|
+
| `--radius-small` | `calc(var(--radius-normal) * 0.75)` | 12px |
|
|
14
|
+
| `--radius-normal` | `1rem` | 16px — Base radius (the root of the scale) |
|
|
15
|
+
| `--radius-large` | `calc(var(--radius-normal) * 1.5)` | 24px |
|
|
16
|
+
| `--radius-xlarge` | `calc(var(--radius-normal) * 2)` | 32px |
|
|
17
|
+
| `--radius-xxlarge` | `calc(var(--radius-normal) * 3)` | 48px |
|
|
@@ -6,12 +6,12 @@ This module's main job is to **define and document the elevation drop-shadow des
|
|
|
6
6
|
|
|
7
7
|
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app. The scale is [Tailwind's](https://tailwindcss.com/docs/box-shadow) `shadow-md`, `shadow-lg` and `shadow-xl` with half the Y offset, so a sliver of shadow always shows at the top. Each shadow has two layers of `--shadow-color`. Both layers have a negative spread, so no dark line shows under the bottom edge.
|
|
8
8
|
|
|
9
|
-
| Variable
|
|
10
|
-
|
|
11
|
-
| `--shadow-color`
|
|
12
|
-
| `--shadow-small`
|
|
13
|
-
| `--shadow-normal` | `0 5px 15px -3px`, `0 2px 6px -4px`
|
|
14
|
-
| `--shadow-large`
|
|
9
|
+
| Variable | Default | Used by |
|
|
10
|
+
| ----------------- | ------------------------------------- | -------------------------------------------- |
|
|
11
|
+
| `--shadow-color` | `#0003` (20% black) | Every layer of every shadow below. |
|
|
12
|
+
| `--shadow-small` | `0 2px 6px -1px`, `0 1px 4px -2px` | `<Popover>` |
|
|
13
|
+
| `--shadow-normal` | `0 5px 15px -3px`, `0 2px 6px -4px` | Floating `<Notices>` |
|
|
14
|
+
| `--shadow-large` | `0 10px 25px -5px`, `0 4px 10px -6px` | `<Modal>`, the open `<SidebarLayout>` drawer |
|
|
15
15
|
|
|
16
16
|
The table shows the values in pixels. The source uses `rem`.
|
|
17
17
|
|
|
@@ -14,19 +14,19 @@ The following `:root` variables are defined by this module and can be overridden
|
|
|
14
14
|
|
|
15
15
|
### Scale
|
|
16
16
|
|
|
17
|
-
| Variable
|
|
18
|
-
|
|
19
|
-
| `--space-xxsmall` | `var(--space-normal) * 0.25` | 4px
|
|
20
|
-
| `--space-xsmall`
|
|
21
|
-
| `--space-small`
|
|
22
|
-
| `--space-normal`
|
|
23
|
-
| `--space-large`
|
|
24
|
-
| `--space-xlarge`
|
|
25
|
-
| `--space-xxlarge` | `var(--space-normal) * 3`
|
|
17
|
+
| Variable | Default | Notes |
|
|
18
|
+
| ----------------- | ---------------------------- | ------------------------------------------------- |
|
|
19
|
+
| `--space-xxsmall` | `var(--space-normal) * 0.25` | 4px |
|
|
20
|
+
| `--space-xsmall` | `var(--space-normal) * 0.5` | 8px |
|
|
21
|
+
| `--space-small` | `var(--space-normal) * 0.75` | 12px |
|
|
22
|
+
| `--space-normal` | 1rem | 16px - base spacing unit (the root of the scale). |
|
|
23
|
+
| `--space-large` | `var(--space-normal) * 1.5` | 24px |
|
|
24
|
+
| `--space-xlarge` | `var(--space-normal) * 2` | 32px |
|
|
25
|
+
| `--space-xxlarge` | `var(--space-normal) * 3` | 48px |
|
|
26
26
|
|
|
27
27
|
### Semantic
|
|
28
28
|
|
|
29
|
-
| Variable
|
|
30
|
-
|
|
31
|
-
| `--space-section`
|
|
32
|
-
| `--space-paragraph` | `var(--space-normal)` | Default block-space for most prose elements.
|
|
29
|
+
| Variable | Default | Used for |
|
|
30
|
+
| ------------------- | --------------------- | -------------------------------------------------- |
|
|
31
|
+
| `--space-section` | `2rem` | Top margin for titles / headings / section blocks. |
|
|
32
|
+
| `--space-paragraph` | `var(--space-normal)` | Default block-space for most prose elements. |
|
|
@@ -6,9 +6,9 @@ This module's main job is to **define and document the border-thickness design t
|
|
|
6
6
|
|
|
7
7
|
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app.
|
|
8
8
|
|
|
9
|
-
| Variable
|
|
10
|
-
|
|
11
|
-
| `--stroke`
|
|
12
|
-
| `--stroke-normal` | `calc(var(--stroke) * 1)`
|
|
13
|
-
| `--stroke-thick`
|
|
14
|
-
| `--stroke-focus`
|
|
9
|
+
| Variable | Default | Used for |
|
|
10
|
+
| ----------------- | --------------------------- | ---------------------------------------------- |
|
|
11
|
+
| `--stroke` | `2px` | Base border thickness — the root of the scale. |
|
|
12
|
+
| `--stroke-normal` | `calc(var(--stroke) * 1)` | Default borders. |
|
|
13
|
+
| `--stroke-thick` | `calc(var(--stroke) * 1.5)` | Heavier borders. |
|
|
14
|
+
| `--stroke-focus` | `var(--stroke-thick)` | Focus-outline thickness. |
|
|
@@ -14,54 +14,54 @@ The following `:root` variables are defined by this module and can be overridden
|
|
|
14
14
|
|
|
15
15
|
### Faces
|
|
16
16
|
|
|
17
|
-
| Variable
|
|
18
|
-
|
|
19
|
-
| `--font-sans`
|
|
20
|
-
| `--font-monospace` | `ui-monospace, "SF Mono", "Consolas", "Menlo", monospace` | Code face.
|
|
21
|
-
| `--font-serif`
|
|
22
|
-
| `--font-title`
|
|
23
|
-
| `--font-body`
|
|
24
|
-
| `--font-label`
|
|
25
|
-
| `--font-code`
|
|
17
|
+
| Variable | Default | Notes |
|
|
18
|
+
| ------------------ | --------------------------------------------------------- | --------------------------- |
|
|
19
|
+
| `--font-sans` | `system-ui` | Default UI face. |
|
|
20
|
+
| `--font-monospace` | `ui-monospace, "SF Mono", "Consolas", "Menlo", monospace` | Code face. |
|
|
21
|
+
| `--font-serif` | `"Palatino", "Garamond", serif` | Serif face. |
|
|
22
|
+
| `--font-title` | `var(--font-sans)` | Headings and titles. |
|
|
23
|
+
| `--font-body` | `var(--font-sans)` | Body baseline. |
|
|
24
|
+
| `--font-label` | `var(--font-sans)` | Labels. |
|
|
25
|
+
| `--font-code` | `var(--font-monospace)` | Code and preformatted text. |
|
|
26
26
|
|
|
27
27
|
### Weights
|
|
28
28
|
|
|
29
|
-
| Variable
|
|
30
|
-
|
|
31
|
-
| `--weight-normal` | `400`
|
|
32
|
-
| `--weight-strong` | `700`
|
|
33
|
-
| `--weight-title`
|
|
34
|
-
| `--weight-body`
|
|
35
|
-
| `--weight-label`
|
|
36
|
-
| `--weight-code`
|
|
29
|
+
| Variable | Default | Used for |
|
|
30
|
+
| ----------------- | ---------------------- | --------------------------------------------- |
|
|
31
|
+
| `--weight-normal` | `400` | Body text. |
|
|
32
|
+
| `--weight-strong` | `700` | Bold / emphasis. |
|
|
33
|
+
| `--weight-title` | `var(--weight-strong)` | Headings and titles. |
|
|
34
|
+
| `--weight-body` | `var(--weight-normal)` | Body baseline. |
|
|
35
|
+
| `--weight-label` | `var(--weight-strong)` | Labels (`<Label>`, table/definition headers). |
|
|
36
|
+
| `--weight-code` | `500` | Monospace / code. |
|
|
37
37
|
|
|
38
38
|
### Sizes
|
|
39
39
|
|
|
40
|
-
| Variable
|
|
41
|
-
|
|
42
|
-
| `--size-scale`
|
|
43
|
-
| `--size-normal`
|
|
40
|
+
| Variable | Default | Notes |
|
|
41
|
+
| ------------------------------------ | ------------------------------------------------------ | ----------------------------------------------------- |
|
|
42
|
+
| `--size-scale` | `1.25` | Ratio between steps. |
|
|
43
|
+
| `--size-normal` | `1rem` | Base size — the root of the modular scale. |
|
|
44
44
|
| `--size-xxsmall` … `--size-xxxlarge` | `calc(var(--size-normal) * pow(var(--size-scale), n))` | Each step is the base scaled by a power of the ratio. |
|
|
45
|
-
| `--size-1x` … `--size-10x`
|
|
46
|
-
| `--size-icon`
|
|
47
|
-
| `--size-label`
|
|
48
|
-
| `--size-smaller`
|
|
49
|
-
| `--size-larger`
|
|
50
|
-
| `--size-xlarger`
|
|
51
|
-
| `--size-xxlarger`
|
|
45
|
+
| `--size-1x` … `--size-10x` | `calc(var(--size-normal) * n)` | Direct multiples of normal size. |
|
|
46
|
+
| `--size-icon` | `1.5rem` | Icon box size. |
|
|
47
|
+
| `--size-label` | `var(--size-small)` | Label text size. |
|
|
48
|
+
| `--size-smaller` | `0.875em` | Relative (em) shrink — e.g. inline `<Small>`. |
|
|
49
|
+
| `--size-larger` | `1.5em` | Relative grow. |
|
|
50
|
+
| `--size-xlarger` | `2.5em` | Relative grow. |
|
|
51
|
+
| `--size-xxlarger` | `5em` | Relative grow. |
|
|
52
52
|
|
|
53
53
|
### Line height
|
|
54
54
|
|
|
55
|
-
| Variable
|
|
56
|
-
|
|
57
|
-
| `--leading`
|
|
58
|
-
| `--leading-normal` | `1.5`
|
|
55
|
+
| Variable | Default | Used for |
|
|
56
|
+
| ------------------ | ------------------------------------------ | ------------------------------------------------------------------------------- |
|
|
57
|
+
| `--leading` | `clamp(1.05em, calc(1em + 0.5rem), 1.5em)` | Default line height; paired with every font-size variant and the body baseline. |
|
|
58
|
+
| `--leading-normal` | `1.5` | Plain unitless line height for dense blocks. |
|
|
59
59
|
|
|
60
60
|
### Case
|
|
61
61
|
|
|
62
|
-
| Variable
|
|
63
|
-
|
|
64
|
-
| `--case-title` | `none`
|
|
65
|
-
| `--case-body`
|
|
66
|
-
| `--case-label` | `uppercase` | `text-transform` for labels and tags.
|
|
67
|
-
| `--case-code`
|
|
62
|
+
| Variable | Default | Used for |
|
|
63
|
+
| -------------- | ----------- | ----------------------------------------------------- |
|
|
64
|
+
| `--case-title` | `none` | `text-transform` for titles and headings. |
|
|
65
|
+
| `--case-body` | `none` | `text-transform` for body text and the body baseline. |
|
|
66
|
+
| `--case-label` | `uppercase` | `text-transform` for labels and tags. |
|
|
67
|
+
| `--case-code` | `none` | `text-transform` for code and preformatted text. |
|
|
@@ -21,8 +21,8 @@ The `width` variant prop sets a component's inline-size — `<Card width="narrow
|
|
|
21
21
|
|
|
22
22
|
The following `:root` variables are defined by this module and can be overridden in a theme file to adjust default styling across the whole app.
|
|
23
23
|
|
|
24
|
-
| Variable
|
|
25
|
-
|
|
24
|
+
| Variable | Default | Used for |
|
|
25
|
+
| ---------------- | ------- | ---------------------------------------------------------- |
|
|
26
26
|
| `--width-narrow` | `36rem` | Focused single-purpose column, e.g. forms and login pages. |
|
|
27
|
-
| `--width-normal` | `48rem` | Standard content column.
|
|
28
|
-
| `--width-wide`
|
|
27
|
+
| `--width-normal` | `48rem` | Standard content column. |
|
|
28
|
+
| `--width-wide` | `80rem` | Full dashboard-style content. |
|