shelving 1.237.0 → 1.238.0
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/package.json +1 -1
- package/ui/README.md +27 -4
- package/ui/app/App.d.ts +13 -2
- package/ui/app/App.js +15 -2
- package/ui/app/App.tsx +15 -2
- package/ui/block/Address.module.css +2 -1
- package/ui/block/Block.module.css +1 -1
- package/ui/block/Blockquote.module.css +5 -1
- package/ui/block/Caption.module.css +4 -1
- package/ui/block/Card.md +1 -1
- package/ui/block/Card.module.css +7 -1
- package/ui/block/Definitions.module.css +6 -1
- package/ui/block/Divider.module.css +4 -1
- package/ui/block/Heading.md +1 -1
- package/ui/block/Heading.module.css +5 -1
- package/ui/block/Image.module.css +2 -1
- package/ui/block/Label.module.css +6 -1
- package/ui/block/List.md +1 -1
- package/ui/block/List.module.css +2 -1
- package/ui/block/Panel.md +1 -1
- package/ui/block/Panel.module.css +3 -1
- package/ui/block/Paragraph.md +1 -1
- package/ui/block/Paragraph.module.css +2 -1
- package/ui/block/Preformatted.module.css +10 -1
- package/ui/block/Prose.md +1 -1
- package/ui/block/Prose.module.css +2 -1
- package/ui/block/Section.md +1 -1
- package/ui/block/Section.module.css +2 -1
- package/ui/block/Subheading.md +1 -1
- package/ui/block/Subheading.module.css +5 -1
- package/ui/block/Table.md +1 -1
- package/ui/block/Table.module.css +7 -1
- package/ui/block/Title.md +1 -1
- package/ui/block/Title.module.css +5 -1
- package/ui/block/Video.module.css +7 -1
- package/ui/dialog/Dialog.md +1 -1
- package/ui/dialog/Dialog.module.css +4 -1
- package/ui/dialog/Modal.md +2 -2
- package/ui/dialog/Modal.module.css +8 -1
- package/ui/form/Button.md +1 -1
- package/ui/form/Button.module.css +10 -1
- package/ui/form/Field.md +1 -1
- package/ui/form/Field.module.css +6 -1
- package/ui/form/Form.md +1 -1
- package/ui/form/Form.module.css +2 -1
- package/ui/form/Input.module.css +10 -2
- package/ui/form/Popover.module.css +6 -1
- package/ui/form/Progress.module.css +4 -1
- package/ui/inline/Code.md +2 -2
- package/ui/inline/Code.module.css +7 -1
- package/ui/inline/Deleted.module.css +4 -1
- package/ui/inline/Emphasis.module.css +1 -1
- package/ui/inline/Inserted.module.css +4 -1
- package/ui/inline/Link.md +2 -2
- package/ui/inline/Link.module.css +4 -2
- package/ui/inline/Mark.md +1 -1
- package/ui/inline/Mark.module.css +3 -1
- package/ui/inline/Small.module.css +2 -1
- package/ui/inline/Strong.md +1 -1
- package/ui/inline/Strong.module.css +2 -1
- package/ui/inline/Subscript.module.css +1 -1
- package/ui/inline/Superscript.module.css +1 -1
- package/ui/layout/CenteredLayout.md +2 -2
- package/ui/layout/CenteredLayout.module.css +2 -1
- package/ui/layout/Layout.module.css +4 -2
- package/ui/layout/SidebarLayout.md +1 -1
- package/ui/layout/SidebarLayout.module.css +5 -1
- package/ui/menu/Menu.md +1 -1
- package/ui/menu/Menu.module.css +9 -1
- package/ui/menu/MenuItem.md +1 -1
- package/ui/misc/Loading.module.css +3 -1
- package/ui/misc/StatusIcon.module.css +2 -1
- package/ui/misc/Tag.md +1 -1
- package/ui/misc/Tag.module.css +9 -1
- package/ui/notice/Message.module.css +3 -1
- package/ui/notice/Notice.md +1 -1
- package/ui/notice/Notice.module.css +7 -1
- package/ui/notice/Notices.module.css +3 -1
- package/ui/style/Color.module.css +28 -1
- package/ui/style/Duration.d.ts +24 -0
- package/ui/style/Duration.js +13 -0
- package/ui/style/Duration.module.css +23 -0
- package/ui/style/Duration.tsx +31 -0
- package/ui/style/Flex.module.css +3 -1
- package/ui/style/Font.d.ts +24 -0
- package/ui/style/Font.js +13 -0
- package/ui/style/Font.module.css +50 -0
- package/ui/style/Font.tsx +31 -0
- package/ui/style/Gap.module.css +2 -1
- package/ui/style/Padding.module.css +2 -1
- package/ui/style/Radius.d.ts +24 -0
- package/ui/style/Radius.js +13 -0
- package/ui/style/Radius.module.css +43 -0
- package/ui/style/Radius.tsx +31 -0
- package/ui/style/Scroll.module.css +4 -0
- package/ui/style/Shadow.d.ts +24 -0
- package/ui/style/Shadow.js +13 -0
- package/ui/style/Shadow.module.css +42 -0
- package/ui/style/Shadow.tsx +31 -0
- package/ui/style/Size.d.ts +24 -0
- package/ui/style/Size.js +13 -0
- package/ui/style/Size.module.css +69 -0
- package/ui/style/Size.tsx +31 -0
- package/ui/style/Space.module.css +19 -1
- package/ui/style/Status.module.css +2 -1
- package/ui/style/Stroke.d.ts +24 -0
- package/ui/style/Stroke.js +13 -0
- package/ui/style/Stroke.module.css +26 -0
- package/ui/style/Stroke.tsx +31 -0
- package/ui/style/Tint.module.css +4 -1
- package/ui/style/Typography.d.ts +10 -26
- package/ui/style/Typography.js +8 -3
- package/ui/style/Typography.module.css +2 -66
- package/ui/style/Typography.tsx +17 -31
- package/ui/style/Weight.d.ts +24 -0
- package/ui/style/Weight.js +13 -0
- package/ui/style/Weight.module.css +42 -0
- package/ui/style/Weight.tsx +31 -0
- package/ui/style/Width.module.css +7 -1
- package/ui/style/getColorClass.md +47 -0
- package/ui/style/getDurationClass.md +18 -0
- package/ui/style/getFontClass.md +39 -0
- package/ui/style/getRadiusClass.md +24 -0
- package/ui/style/getShadowClass.md +23 -0
- package/ui/style/getSizeClass.md +42 -0
- package/ui/style/getSpaceClass.md +35 -0
- package/ui/style/getStrokeClass.md +20 -0
- package/ui/style/getWeightClass.md +25 -0
- package/ui/style/getWidthClass.md +18 -0
- package/ui/style/index.d.ts +7 -0
- package/ui/style/index.js +7 -0
- package/ui/style/index.tsx +7 -0
- package/ui/style/layers.css +26 -0
- package/ui/transition/FadeTransition.md +1 -1
- package/ui/transition/HorizontalTransition.md +1 -1
- package/ui/transition/Transition.md +1 -1
- package/ui/transition/VerticalTransition.md +1 -1
- package/ui/style/base.css +0 -161
package/package.json
CHANGED
package/ui/README.md
CHANGED
|
@@ -10,25 +10,48 @@ The `ui` module exists so an app never hand-rolls the same form field, card, or
|
|
|
10
10
|
|
|
11
11
|
A few conventions run through every component:
|
|
12
12
|
|
|
13
|
-
- **Styling props
|
|
13
|
+
- **Styling props are for one-off overrides.** Visual options are props on the component — enumerated props for the scales (`color="red"`, `size="large"`, `space="none"`) and boolean props for on/off variants (`<Button strong>`, `<Section narrow>`, `<Flex wrap>`). Each maps to a class in a CSS Module. Reach for them when a component needs to look different in *one place* — the way the docs site tints its accents purple — not as the way to dress a whole app. You never pass `style` or raw `className`.
|
|
14
14
|
- **Composition.** Higher-level components — a `*Page`, a `*Card` — take their identity from library components like [`Card`](/ui/Card), [`Section`](/ui/Section), [`Button`](/ui/Button), and [`Tag`](/ui/Tag) rather than shipping their own styling.
|
|
15
15
|
- **Sentence case.** Titles, headings, and button labels capitalise only the first word.
|
|
16
|
-
- **
|
|
16
|
+
- **Theme with CSS.** An app-wide custom look is a CSS file, not a wall of props. Write a `theme.css` that overrides the base design-token variables (and, where needed, per-component hooks) at `:root`, and import it after the library styles. The recommended workflow is to spend time tuning those variables to match your design — see [Theming](#theming) below.
|
|
17
17
|
|
|
18
18
|
## The styling system
|
|
19
19
|
|
|
20
20
|
The styling system lives in `style/` and has four moving parts: design tokens, the tint scale, cascade layers, and the styling props. Components compose them in a predictable shape; consumers theme by overriding CSS custom properties at `:root`.
|
|
21
21
|
|
|
22
|
-
**Design tokens.** `style/
|
|
22
|
+
**Design tokens.** Every design-token constant is defined at `:root`, split across the themed token modules in `style/` — each module owns one domain, documents the variables it defines, and is the page a theme author overrides. `style/layers.css` is the cascade-layer anchor; every `*.module.css` `@import`s it plus the specific token modules it references, so the tokens and the layer order reach every component regardless of bundle order. The domains are: colours ([`getColorClass`](/ui/getColorClass)), font sizes ([`getSizeClass`](/ui/getSizeClass)), font weights ([`getWeightClass`](/ui/getWeightClass)), font faces ([`getFontClass`](/ui/getFontClass)), spacing ([`getSpaceClass`](/ui/getSpaceClass)), widths ([`getWidthClass`](/ui/getWidthClass)), radii ([`getRadiusClass`](/ui/getRadiusClass)), strokes ([`getStrokeClass`](/ui/getStrokeClass)), shadows ([`getShadowClass`](/ui/getShadowClass)), and durations ([`getDurationClass`](/ui/getDurationClass)). Each also defines the semantic aliases a theme usually targets (`--color-primary`, `--color-link`, `--space-paragraph`, …). Components read tokens via `var(--token)`.
|
|
23
23
|
|
|
24
24
|
**The tint scale.** All colour flows from one anchor variable, `--tint-50`, from which a 21-step ladder is computed and *recomputed* under [`TINT_CLASS`](/ui/TINT_CLASS) — the heart of how `color=` and `status=` retint a whole subtree. The ladder, the recompute trick, the painting conventions, and the theming guide all live on the [`TINT_CLASS`](/ui/TINT_CLASS) page.
|
|
25
25
|
|
|
26
26
|
**Cascade layers.** Styles are ordered by `@layer`, lowest to highest priority: `defaults` (`:root` tokens, the tint ladder, body baseline) → `components` (the bulk of the CSS: `.card`, `.button`, …) → `variants` (cross-cutting opt-in modifiers, which always beat components) → `overrides` (top-priority structural fixes like `:first-child` / `:last-child` margin collapses). Unlayered rules beat all layered rules, so a theme should set tokens at `:root` or wrap its rules in `@layer`.
|
|
27
27
|
|
|
28
|
-
**Styling props.** The cross-cutting visual options are props, each backed by a helper in `style/` that maps the prop to a class. Colour and status move the tint anchor — [`getColorClass`](/ui/getColorClass) and [`getStatusClass`](/ui/getStatusClass); size,
|
|
28
|
+
**Styling props.** The cross-cutting visual options are props, each backed by a helper in `style/` that maps the prop to a class. Colour and status move the tint anchor — [`getColorClass`](/ui/getColorClass) and [`getStatusClass`](/ui/getStatusClass); font size, weight, and family come from [`getSizeClass`](/ui/getSizeClass), [`getWeightClass`](/ui/getWeightClass), and [`getFontClass`](/ui/getFontClass), which [`getTypographyClass`](/ui/getTypographyClass) combines with text alignment and tint; spacing, padding, and gap from [`getSpaceClass`](/ui/getSpaceClass), [`getPaddingClass`](/ui/getPaddingClass), and [`getGapClass`](/ui/getGapClass); width constraints from [`getWidthClass`](/ui/getWidthClass); flex layout from [`getFlexClass`](/ui/getFlexClass); and opt-in scrolling from [`getScrollClass`](/ui/getScrollClass). Each helper's page lists its exact prop values and what they set. A component opts into the props it wants by extending the matching `*Props` interfaces and composing the `getXxxClass(props)` calls.
|
|
29
29
|
|
|
30
30
|
Each painting component also exposes its own theme hooks — a single tint hook (`--card-tint`) to recolour the whole component, plus per-property hooks (`--card-background`, `--card-radius`, …) for surgical overrides. Those are documented in each component's own **Styling** section (see [`Card`](/ui/Card) for the precedent).
|
|
31
31
|
|
|
32
|
+
## Theming
|
|
33
|
+
|
|
34
|
+
The recommended way to give an app its own look is a **theme stylesheet**, not styling props. Create a `theme.css`, override the base design-token variables at `:root`, and import it after the library styles:
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
/* theme.css — imported after shelving/ui styles */
|
|
38
|
+
:root {
|
|
39
|
+
--color-primary: oklch(58% 0.25 300); /* purple brand */
|
|
40
|
+
--font-body: "Inter", system-ui;
|
|
41
|
+
--radius: 0.5rem; /* tighter corners everywhere */
|
|
42
|
+
--space: 1.125rem; /* roomier spacing scale */
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Each base token lives in a themed module that documents the variables it defines and which ones a theme usually overrides. Work from broadest (a palette colour or scale root) to narrowest (a single semantic alias):
|
|
47
|
+
|
|
48
|
+
- [weight](/ui/getWeightClass) · [size](/ui/getSizeClass) · [font](/ui/getFontClass) — typography (`--weight-*`, `--size-*`, `--font-*`, `--case-label`).
|
|
49
|
+
- [color](/ui/getColorClass) — palette, semantic, and brand colours (`--color-*`).
|
|
50
|
+
- [space](/ui/getSpaceClass) · [width](/ui/getWidthClass) — layout spacing and widths (`--space-*`, `--width-*`).
|
|
51
|
+
- [radius](/ui/getRadiusClass) · [stroke](/ui/getStrokeClass) · [shadow](/ui/getShadowClass) · [duration](/ui/getDurationClass) — surface tokens (`--radius-*`, `--stroke-*`, `--shadow-*`, `--duration-*`).
|
|
52
|
+
|
|
53
|
+
The **tint ladder** is the one exception that doesn't follow the override-a-variable pattern: its 21 steps are *recomputed* from a single anchor inside every tinted scope, so you move the anchor rather than overriding individual steps. See [`TINT_CLASS`](/ui/TINT_CLASS) for the full theming guide, and each component's **Styling** section for its per-component hooks.
|
|
54
|
+
|
|
32
55
|
## Finding your way around
|
|
33
56
|
|
|
34
57
|
The components below are listed in the index following this page; this is the short version of where to start reading.
|
package/ui/app/App.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
|
-
import "../style/
|
|
2
|
+
import "../style/layers.css";
|
|
3
|
+
import "../style/Color.module.css";
|
|
4
|
+
import "../style/Duration.module.css";
|
|
5
|
+
import "../style/Font.module.css";
|
|
6
|
+
import "../style/Radius.module.css";
|
|
7
|
+
import "../style/Shadow.module.css";
|
|
8
|
+
import "../style/Size.module.css";
|
|
9
|
+
import "../style/Space.module.css";
|
|
10
|
+
import "../style/Stroke.module.css";
|
|
11
|
+
import "../style/Tint.module.css";
|
|
12
|
+
import "../style/Weight.module.css";
|
|
13
|
+
import "../style/Width.module.css";
|
|
3
14
|
import type { PossibleMeta } from "../util/index.js";
|
|
4
15
|
import type { ChildProps } from "../util/props.js";
|
|
5
16
|
/**
|
|
@@ -12,7 +23,7 @@ export interface AppProps extends PossibleMeta, ChildProps {
|
|
|
12
23
|
/**
|
|
13
24
|
* Root component for an application, providing the top-level `Meta` context and global styles.
|
|
14
25
|
* - Descendants can read or update metadata via the provided `<Meta>` context.
|
|
15
|
-
* - Design tokens and body baseline typography are set globally via `style
|
|
26
|
+
* - Design tokens and body baseline typography are set globally via the `style/` token modules (`Color`, `Size`, `Font`, …).
|
|
16
27
|
*
|
|
17
28
|
* @param children The application content.
|
|
18
29
|
* @param meta The root meta (app name, root URL, language, etc.).
|
package/ui/app/App.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { MetaContext, requireMeta } from "../misc/MetaContext.js";
|
|
3
|
-
|
|
3
|
+
// Load the global design tokens, cascade-layer order, and body baseline. Each module owns its own
|
|
4
|
+
// `:root` tokens (and body rules where relevant); see `modules/ui/README.md` for the styling system.
|
|
5
|
+
import "../style/layers.css";
|
|
6
|
+
import "../style/Color.module.css";
|
|
7
|
+
import "../style/Duration.module.css";
|
|
8
|
+
import "../style/Font.module.css";
|
|
9
|
+
import "../style/Radius.module.css";
|
|
10
|
+
import "../style/Shadow.module.css";
|
|
11
|
+
import "../style/Size.module.css";
|
|
12
|
+
import "../style/Space.module.css";
|
|
13
|
+
import "../style/Stroke.module.css";
|
|
14
|
+
import "../style/Tint.module.css";
|
|
15
|
+
import "../style/Weight.module.css";
|
|
16
|
+
import "../style/Width.module.css";
|
|
4
17
|
/**
|
|
5
18
|
* Root component for an application, providing the top-level `Meta` context and global styles.
|
|
6
19
|
* - Descendants can read or update metadata via the provided `<Meta>` context.
|
|
7
|
-
* - Design tokens and body baseline typography are set globally via `style
|
|
20
|
+
* - Design tokens and body baseline typography are set globally via the `style/` token modules (`Color`, `Size`, `Font`, …).
|
|
8
21
|
*
|
|
9
22
|
* @param children The application content.
|
|
10
23
|
* @param meta The root meta (app name, root URL, language, etc.).
|
package/ui/app/App.tsx
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import { MetaContext, requireMeta } from "../misc/MetaContext.js";
|
|
3
|
-
|
|
3
|
+
// Load the global design tokens, cascade-layer order, and body baseline. Each module owns its own
|
|
4
|
+
// `:root` tokens (and body rules where relevant); see `modules/ui/README.md` for the styling system.
|
|
5
|
+
import "../style/layers.css";
|
|
6
|
+
import "../style/Color.module.css";
|
|
7
|
+
import "../style/Duration.module.css";
|
|
8
|
+
import "../style/Font.module.css";
|
|
9
|
+
import "../style/Radius.module.css";
|
|
10
|
+
import "../style/Shadow.module.css";
|
|
11
|
+
import "../style/Size.module.css";
|
|
12
|
+
import "../style/Space.module.css";
|
|
13
|
+
import "../style/Stroke.module.css";
|
|
14
|
+
import "../style/Tint.module.css";
|
|
15
|
+
import "../style/Weight.module.css";
|
|
16
|
+
import "../style/Width.module.css";
|
|
4
17
|
import type { PossibleMeta } from "../util/index.js";
|
|
5
18
|
import type { ChildProps } from "../util/props.js";
|
|
6
19
|
|
|
@@ -14,7 +27,7 @@ export interface AppProps extends PossibleMeta, ChildProps {}
|
|
|
14
27
|
/**
|
|
15
28
|
* Root component for an application, providing the top-level `Meta` context and global styles.
|
|
16
29
|
* - Descendants can read or update metadata via the provided `<Meta>` context.
|
|
17
|
-
* - Design tokens and body baseline typography are set globally via `style
|
|
30
|
+
* - Design tokens and body baseline typography are set globally via the `style/` token modules (`Color`, `Size`, `Font`, …).
|
|
18
31
|
*
|
|
19
32
|
* @param children The application content.
|
|
20
33
|
* @param meta The root meta (app name, root URL, language, etc.).
|
package/ui/block/Card.md
CHANGED
|
@@ -62,7 +62,7 @@ import { Card, Subheading } from "shelving/ui";
|
|
|
62
62
|
| `--card-transition` | Transition | `all var(--duration-fast)` (150ms) |
|
|
63
63
|
| `--card-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
|
|
64
64
|
|
|
65
|
-
**Global tokens it reads** — move these to retheme broadly rather than overriding ladder steps directly: the tint ladder `--tint-00` / `--tint-80` / `--tint-90` / `--tint-95
|
|
65
|
+
**Global tokens it reads** — move these to retheme broadly rather than overriding ladder steps directly: the tint ladder [`--tint-00`](/ui/TINT_CLASS) / [`--tint-80`](/ui/TINT_CLASS) / [`--tint-90`](/ui/TINT_CLASS) / [`--tint-95`](/ui/TINT_CLASS), plus [`--space-normal`](/ui/getSpaceClass), [`--space-paragraph`](/ui/getSpaceClass), [`--radius-normal`](/ui/getRadiusClass), [`--stroke-normal`](/ui/getStrokeClass), [`--stroke-focus`](/ui/getStrokeClass), [`--color-focus`](/ui/getColorClass), and [`--duration-fast`](/ui/getDurationClass).
|
|
66
66
|
|
|
67
67
|
```css
|
|
68
68
|
/* Theme: borderless cards with a soft shadow and tighter corners. */
|
package/ui/block/Card.module.css
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Radius.module.css";
|
|
5
|
+
@import "../style/Space.module.css";
|
|
6
|
+
@import "../style/Stroke.module.css";
|
|
7
|
+
@import "../style/Tint.module.css";
|
|
2
8
|
|
|
3
9
|
@layer defaults {
|
|
4
10
|
.card {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Font.module.css";
|
|
3
|
+
@import "../style/Size.module.css";
|
|
4
|
+
@import "../style/Space.module.css";
|
|
5
|
+
@import "../style/Tint.module.css";
|
|
6
|
+
@import "../style/Weight.module.css";
|
|
2
7
|
|
|
3
8
|
@layer components {
|
|
4
9
|
.definitions,
|
package/ui/block/Heading.md
CHANGED
|
@@ -53,7 +53,7 @@ import { Heading } from "shelving/ui";
|
|
|
53
53
|
| `--heading-size` | Font size | `var(--size-xxlarge)` |
|
|
54
54
|
| `--heading-leading` | Line height | `var(--leading)` |
|
|
55
55
|
|
|
56
|
-
**Global tokens it reads:** `--space-section
|
|
56
|
+
**Global tokens it reads:** [`--space-section`](/ui/getSpaceClass), [`--space-paragraph`](/ui/getSpaceClass), [`--font-title`](/ui/getFontClass), [`--weight-strong`](/ui/getWeightClass), [`--size-xxlarge`](/ui/getSizeClass), and [`--leading`](/ui/getSizeClass). (`Title` and `Subheading` share this component and expose the parallel `--title-*` / `--subheading-*` hooks.)
|
|
57
57
|
|
|
58
58
|
```css
|
|
59
59
|
/* Theme: serif headings, a touch larger. */
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Font.module.css";
|
|
3
|
+
@import "../style/Size.module.css";
|
|
4
|
+
@import "../style/Space.module.css";
|
|
5
|
+
@import "../style/Tint.module.css";
|
|
6
|
+
@import "../style/Weight.module.css";
|
|
2
7
|
|
|
3
8
|
@layer components {
|
|
4
9
|
.label {
|
package/ui/block/List.md
CHANGED
|
@@ -41,7 +41,7 @@ import { List } from "shelving/ui";
|
|
|
41
41
|
| `--list-indent` | Inline start padding (marker gutter) | `1.125em` unordered / `1.8em` ordered |
|
|
42
42
|
| `--list-marker-color` | Bullet / number colour | `var(--tint-80)` |
|
|
43
43
|
|
|
44
|
-
**Global tokens it reads:** `--space-paragraph
|
|
44
|
+
**Global tokens it reads:** [`--space-paragraph`](/ui/getSpaceClass), [`--space-xsmall`](/ui/getSpaceClass), and the tint-ladder step [`--tint-80`](/ui/TINT_CLASS). The `gap` variant comes from the shared [`ui`](/ui) styling system.
|
|
45
45
|
|
|
46
46
|
## See also
|
|
47
47
|
|
package/ui/block/List.module.css
CHANGED
package/ui/block/Panel.md
CHANGED
|
@@ -40,7 +40,7 @@ import { Panel, Block, Title, Paragraph } from "shelving/ui";
|
|
|
40
40
|
| `--panel-border` | Top/bottom border shorthand | `var(--panel-stroke) solid var(--tint-80)` |
|
|
41
41
|
| `--panel-stroke` | Border thickness | `var(--stroke-normal)` (2px) |
|
|
42
42
|
|
|
43
|
-
**Global tokens it reads:** the tint-ladder steps `--tint-00` / `--tint-80` / `--tint-90
|
|
43
|
+
**Global tokens it reads:** the tint-ladder steps [`--tint-00`](/ui/TINT_CLASS) / [`--tint-80`](/ui/TINT_CLASS) / [`--tint-90`](/ui/TINT_CLASS), plus [`--stroke-normal`](/ui/getStrokeClass). Vertical padding comes from the shared `padding` variant.
|
|
44
44
|
|
|
45
45
|
## See also
|
|
46
46
|
|
package/ui/block/Paragraph.md
CHANGED
|
@@ -38,7 +38,7 @@ import { Paragraph, Strong, Link } from "shelving/ui";
|
|
|
38
38
|
| `--paragraph-tint` | Tint anchor for the paragraph scope | `inherit` (flows from `color=` / parent) |
|
|
39
39
|
| `--paragraph-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
|
|
40
40
|
|
|
41
|
-
**Global tokens it reads:** `--space-paragraph
|
|
41
|
+
**Global tokens it reads:** [`--space-paragraph`](/ui/getSpaceClass).
|
|
42
42
|
|
|
43
43
|
## See also
|
|
44
44
|
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Font.module.css";
|
|
5
|
+
@import "../style/Radius.module.css";
|
|
6
|
+
@import "../style/Size.module.css";
|
|
7
|
+
@import "../style/Space.module.css";
|
|
8
|
+
@import "../style/Stroke.module.css";
|
|
9
|
+
@import "../style/Tint.module.css";
|
|
10
|
+
@import "../style/Weight.module.css";
|
|
2
11
|
|
|
3
12
|
@layer components {
|
|
4
13
|
.preformatted,
|
package/ui/block/Prose.md
CHANGED
|
@@ -39,7 +39,7 @@ import { Prose, Paragraph } from "shelving/ui";
|
|
|
39
39
|
|---|---|---|
|
|
40
40
|
| `--prose-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
|
|
41
41
|
|
|
42
|
-
**Global tokens it reads:** `--space-paragraph
|
|
42
|
+
**Global tokens it reads:** [`--space-paragraph`](/ui/getSpaceClass).
|
|
43
43
|
|
|
44
44
|
## See also
|
|
45
45
|
|
package/ui/block/Section.md
CHANGED
|
@@ -46,7 +46,7 @@ import { Header, Nav, Footer } from "shelving/ui";
|
|
|
46
46
|
| `--section-indent` | Inline gutter kept on each side so text doesn't touch the edges | `var(--space-normal)` (16px) |
|
|
47
47
|
| `--section-space` | Outer block margin (top + bottom) | `var(--space-section)` (2rem) |
|
|
48
48
|
|
|
49
|
-
**Global tokens it reads:** `--space-normal` and `--space-section
|
|
49
|
+
**Global tokens it reads:** [`--space-normal`](/ui/getSpaceClass) and [`--space-section`](/ui/getSpaceClass). The `narrow` / `wide` / `full` width variants come from the shared [`ui`](/ui) styling system.
|
|
50
50
|
|
|
51
51
|
## See also
|
|
52
52
|
|
package/ui/block/Subheading.md
CHANGED
|
@@ -48,7 +48,7 @@ import { Title, Heading, Subheading } from "shelving/ui";
|
|
|
48
48
|
| `--subheading-size` | Font size | `var(--size-large)` |
|
|
49
49
|
| `--subheading-leading` | Line height | `var(--leading)` |
|
|
50
50
|
|
|
51
|
-
**Global tokens it reads:** `--space-section
|
|
51
|
+
**Global tokens it reads:** [`--space-section`](/ui/getSpaceClass), [`--space-paragraph`](/ui/getSpaceClass), [`--font-title`](/ui/getFontClass), [`--weight-strong`](/ui/getWeightClass), [`--size-large`](/ui/getSizeClass), and [`--leading`](/ui/getSizeClass).
|
|
52
52
|
|
|
53
53
|
## See also
|
|
54
54
|
|
package/ui/block/Table.md
CHANGED
|
@@ -45,7 +45,7 @@ import { Table } from "shelving/ui";
|
|
|
45
45
|
| `--table-label-case` | Label letter case | `var(--case-label)` |
|
|
46
46
|
| `--table-label-color` | Label colour | `var(--tint-70)` |
|
|
47
47
|
|
|
48
|
-
**Global tokens it reads:** `--space-paragraph
|
|
48
|
+
**Global tokens it reads:** [`--space-paragraph`](/ui/getSpaceClass), [`--space-xsmall`](/ui/getSpaceClass), [`--stroke-normal`](/ui/getStrokeClass), the tint-ladder steps [`--tint-70`](/ui/TINT_CLASS) / [`--tint-80`](/ui/TINT_CLASS), and the label tokens [`--font-label`](/ui/getFontClass) / [`--weight-label`](/ui/getWeightClass) / [`--size-label`](/ui/getSizeClass) / [`--case-label`](/ui/getFontClass) / [`--weight-strong`](/ui/getWeightClass).
|
|
49
49
|
|
|
50
50
|
## See also
|
|
51
51
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Font.module.css";
|
|
3
|
+
@import "../style/Size.module.css";
|
|
4
|
+
@import "../style/Space.module.css";
|
|
5
|
+
@import "../style/Stroke.module.css";
|
|
6
|
+
@import "../style/Tint.module.css";
|
|
7
|
+
@import "../style/Weight.module.css";
|
|
2
8
|
|
|
3
9
|
@layer components {
|
|
4
10
|
.table,
|
package/ui/block/Title.md
CHANGED
|
@@ -47,7 +47,7 @@ import { Panel, Block, Title } from "shelving/ui";
|
|
|
47
47
|
| `--title-size` | Font size | `var(--size-xxxlarge)` |
|
|
48
48
|
| `--title-leading` | Line height | `var(--leading)` |
|
|
49
49
|
|
|
50
|
-
**Global tokens it reads:** `--space-section
|
|
50
|
+
**Global tokens it reads:** [`--space-section`](/ui/getSpaceClass), [`--space-paragraph`](/ui/getSpaceClass), [`--font-title`](/ui/getFontClass), [`--weight-strong`](/ui/getWeightClass), [`--size-xxxlarge`](/ui/getSizeClass), and [`--leading`](/ui/getSizeClass).
|
|
51
51
|
|
|
52
52
|
## See also
|
|
53
53
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Radius.module.css";
|
|
5
|
+
@import "../style/Shadow.module.css";
|
|
6
|
+
@import "../style/Space.module.css";
|
|
7
|
+
@import "../style/Stroke.module.css";
|
|
2
8
|
|
|
3
9
|
@layer components {
|
|
4
10
|
.video {
|
package/ui/dialog/Dialog.md
CHANGED
|
@@ -61,7 +61,7 @@ function DeleteButton({ id }: { id: string }) {
|
|
|
61
61
|
| `--dialog-transition` | Open / close transition | `all var(--duration-fast)` (150ms) |
|
|
62
62
|
| `--dialog-close-offset` | Inset of the close button from the top-right corner | `var(--space-small)` (8px) |
|
|
63
63
|
|
|
64
|
-
**Global tokens it reads** — move these to retheme broadly: `--space-normal
|
|
64
|
+
**Global tokens it reads** — move these to retheme broadly: [`--space-normal`](/ui/getSpaceClass), [`--space-small`](/ui/getSpaceClass), [`--color-shadow`](/ui/getColorClass), and [`--duration-fast`](/ui/getDurationClass).
|
|
65
65
|
|
|
66
66
|
## See also
|
|
67
67
|
|
package/ui/dialog/Modal.md
CHANGED
|
@@ -24,7 +24,7 @@ import { Modal } from "shelving/ui";
|
|
|
24
24
|
| Variable | Styles | Default |
|
|
25
25
|
|---|---|---|
|
|
26
26
|
| `--modal-width` | Box width | `var(--width-narrow)` |
|
|
27
|
-
| `--modal-border` | Border shorthand | `var(--stroke-normal)` solid, 50% of `--tint-50` |
|
|
27
|
+
| `--modal-border` | Border shorthand | `var(--stroke-normal)` solid, 50% of [`--tint-50`](/ui/TINT_CLASS) |
|
|
28
28
|
| `--modal-radius` | Corner radius | `var(--radius-normal)` (16px) |
|
|
29
29
|
| `--modal-color-bg` | Surface fill | `var(--tint-100)` |
|
|
30
30
|
| `--modal-padding` | Inner padding | `var(--space-normal)` (16px) |
|
|
@@ -32,7 +32,7 @@ import { Modal } from "shelving/ui";
|
|
|
32
32
|
| `--modal-transition` | Transition | `all var(--duration-fast)` (150ms) |
|
|
33
33
|
| `--modal-shadow` | Drop shadow | `var(--shadow-normal)` |
|
|
34
34
|
|
|
35
|
-
**Global tokens it reads** — move these to retheme broadly: the tint ladder `--tint-00` / `--tint-50` / `--tint-100
|
|
35
|
+
**Global tokens it reads** — move these to retheme broadly: the tint ladder [`--tint-00`](/ui/TINT_CLASS) / [`--tint-50`](/ui/TINT_CLASS) / [`--tint-100`](/ui/TINT_CLASS), plus [`--width-narrow`](/ui/getWidthClass), [`--space-normal`](/ui/getSpaceClass), [`--radius-normal`](/ui/getRadiusClass), [`--stroke-normal`](/ui/getStrokeClass), [`--shadow-normal`](/ui/getShadowClass), and [`--duration-fast`](/ui/getDurationClass).
|
|
36
36
|
|
|
37
37
|
## See also
|
|
38
38
|
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Duration.module.css";
|
|
3
|
+
@import "../style/Radius.module.css";
|
|
4
|
+
@import "../style/Shadow.module.css";
|
|
5
|
+
@import "../style/Space.module.css";
|
|
6
|
+
@import "../style/Stroke.module.css";
|
|
7
|
+
@import "../style/Tint.module.css";
|
|
8
|
+
@import "../style/Width.module.css";
|
|
2
9
|
|
|
3
10
|
@layer components {
|
|
4
11
|
.modal {
|
package/ui/form/Button.md
CHANGED
|
@@ -72,7 +72,7 @@ import { getButtonClass } from "shelving/ui";
|
|
|
72
72
|
| `--button-strong-border` | Border when `strong` | `var(--button-stroke) solid transparent` |
|
|
73
73
|
| `--button-strong-hover-background` | Hover fill when `strong` | `var(--tint-55)` |
|
|
74
74
|
|
|
75
|
-
**Global tokens it reads:** the tint ladder `--tint-50` / `--tint-80` / `--tint-90` / `--tint-95` / `--tint-100` / `--tint-55
|
|
75
|
+
**Global tokens it reads:** the tint ladder [`--tint-50`](/ui/TINT_CLASS) / [`--tint-80`](/ui/TINT_CLASS) / [`--tint-90`](/ui/TINT_CLASS) / [`--tint-95`](/ui/TINT_CLASS) / [`--tint-100`](/ui/TINT_CLASS) / [`--tint-55`](/ui/TINT_CLASS), plus [`--space-small`](/ui/getSpaceClass), [`--space-xxsmall`](/ui/getSpaceClass), [`--radius-xsmall`](/ui/getRadiusClass), [`--stroke-normal`](/ui/getStrokeClass), [`--stroke-focus`](/ui/getStrokeClass), [`--color-focus`](/ui/getColorClass), [`--font-body`](/ui/getFontClass), [`--weight-strong`](/ui/getWeightClass), [`--size-normal`](/ui/getSizeClass), [`--leading`](/ui/getSizeClass), and [`--duration-fast`](/ui/getDurationClass).
|
|
76
76
|
|
|
77
77
|
```css
|
|
78
78
|
/* Theme: pill-shaped buttons. */
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Font.module.css";
|
|
5
|
+
@import "../style/Radius.module.css";
|
|
6
|
+
@import "../style/Size.module.css";
|
|
7
|
+
@import "../style/Space.module.css";
|
|
8
|
+
@import "../style/Stroke.module.css";
|
|
9
|
+
@import "../style/Tint.module.css";
|
|
10
|
+
@import "../style/Weight.module.css";
|
|
2
11
|
|
|
3
12
|
@layer components {
|
|
4
13
|
.button {
|
package/ui/form/Field.md
CHANGED
|
@@ -50,7 +50,7 @@ import { Field, TextInput } from "shelving/ui";
|
|
|
50
50
|
| `--field-message-weight` | Message font weight | `var(--weight-strong)` |
|
|
51
51
|
| `--field-color-message` | Message colour | `var(--color-red)` |
|
|
52
52
|
|
|
53
|
-
**Global tokens it reads:** the tint ladder `--tint-00
|
|
53
|
+
**Global tokens it reads:** the tint ladder [`--tint-00`](/ui/TINT_CLASS), plus [`--space-paragraph`](/ui/getSpaceClass), [`--space-xsmall`](/ui/getSpaceClass), [`--size-normal`](/ui/getSizeClass), [`--weight-strong`](/ui/getWeightClass), [`--weight-normal`](/ui/getWeightClass), `--shade-dark`, and [`--color-red`](/ui/getColorClass).
|
|
54
54
|
|
|
55
55
|
## See also
|
|
56
56
|
|
package/ui/form/Field.module.css
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Size.module.css";
|
|
4
|
+
@import "../style/Space.module.css";
|
|
5
|
+
@import "../style/Tint.module.css";
|
|
6
|
+
@import "../style/Weight.module.css";
|
|
2
7
|
|
|
3
8
|
@layer components {
|
|
4
9
|
.field {
|
package/ui/form/Form.md
CHANGED
|
@@ -105,7 +105,7 @@ When an `onSubmit` callback returns a non-empty `ReactNode`, `Form` dispatches i
|
|
|
105
105
|
|---|---|---|
|
|
106
106
|
| `--form-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
|
|
107
107
|
|
|
108
|
-
**Global tokens it reads:** `--space-paragraph
|
|
108
|
+
**Global tokens it reads:** [`--space-paragraph`](/ui/getSpaceClass).
|
|
109
109
|
|
|
110
110
|
## See also
|
|
111
111
|
|
package/ui/form/Form.module.css
CHANGED
package/ui/form/Input.module.css
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
@import "../style/
|
|
2
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Font.module.css";
|
|
5
|
+
@import "../style/Radius.module.css";
|
|
6
|
+
@import "../style/Size.module.css";
|
|
7
|
+
@import "../style/Space.module.css";
|
|
8
|
+
@import "../style/Stroke.module.css";
|
|
9
|
+
@import "../style/Tint.module.css";
|
|
10
|
+
@import "../style/Weight.module.css";
|
|
3
11
|
|
|
4
12
|
@layer components {
|
|
5
13
|
.input {
|