shelving 1.237.0 → 1.239.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.d.ts +6 -5
- package/ui/block/Panel.js +6 -5
- package/ui/block/Panel.md +1 -1
- package/ui/block/Panel.module.css +7 -5
- package/ui/block/Panel.tsx +7 -5
- 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/docs/DocumentationHomePage.d.ts +15 -0
- package/ui/docs/DocumentationHomePage.js +24 -0
- package/ui/docs/DocumentationHomePage.md +42 -0
- package/ui/docs/DocumentationHomePage.test.tsx +35 -0
- package/ui/docs/DocumentationHomePage.tsx +46 -0
- package/ui/docs/index.d.ts +1 -0
- package/ui/docs/index.js +1 -0
- package/ui/docs/index.ts +1 -0
- 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/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 {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { TreeElementProps } from "../../util/tree.js";
|
|
3
|
+
/**
|
|
4
|
+
* Page renderer for the documentation site's home page — a bold coloured hero panel over the module listing.
|
|
5
|
+
* - The whole page sits in a single `color="red"` `<Block>`, so the hero panel, prose, and child cards all pick up the red tint.
|
|
6
|
+
* - The hero is a full-padding `<Panel>` with the package name centred as a large `<Title>`.
|
|
7
|
+
* - Below the hero it renders any absorbed prose content, then the root's children (the modules) as a stack of cards.
|
|
8
|
+
*
|
|
9
|
+
* @kind component
|
|
10
|
+
* @param props The root tree element props (`title`, `name`, `description`, `content`, `children`).
|
|
11
|
+
* @returns A `<Page>` with a coloured hero panel followed by the module listing.
|
|
12
|
+
* @example <DocumentationHomePage {...root.props} />
|
|
13
|
+
* @see https://dhoulb.github.io/shelving/ui/docs/DocumentationHomePage/DocumentationHomePage
|
|
14
|
+
*/
|
|
15
|
+
export declare function DocumentationHomePage({ title, name, description, content, children }: TreeElementProps): ReactNode;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Block } from "../block/Block.js";
|
|
3
|
+
import { Panel } from "../block/Panel.js";
|
|
4
|
+
import { Prose } from "../block/Prose.js";
|
|
5
|
+
import { Section } from "../block/Section.js";
|
|
6
|
+
import { Title } from "../block/Title.js";
|
|
7
|
+
import { Markup } from "../misc/Markup.js";
|
|
8
|
+
import { Page } from "../page/Page.js";
|
|
9
|
+
import { TreeCards } from "../tree/TreeCards.js";
|
|
10
|
+
/**
|
|
11
|
+
* Page renderer for the documentation site's home page — a bold coloured hero panel over the module listing.
|
|
12
|
+
* - The whole page sits in a single `color="red"` `<Block>`, so the hero panel, prose, and child cards all pick up the red tint.
|
|
13
|
+
* - The hero is a full-padding `<Panel>` with the package name centred as a large `<Title>`.
|
|
14
|
+
* - Below the hero it renders any absorbed prose content, then the root's children (the modules) as a stack of cards.
|
|
15
|
+
*
|
|
16
|
+
* @kind component
|
|
17
|
+
* @param props The root tree element props (`title`, `name`, `description`, `content`, `children`).
|
|
18
|
+
* @returns A `<Page>` with a coloured hero panel followed by the module listing.
|
|
19
|
+
* @example <DocumentationHomePage {...root.props} />
|
|
20
|
+
* @see https://dhoulb.github.io/shelving/ui/docs/DocumentationHomePage/DocumentationHomePage
|
|
21
|
+
*/
|
|
22
|
+
export function DocumentationHomePage({ title, name, description, content, children }) {
|
|
23
|
+
return (_jsx(Page, { title: title ?? name, description: description, children: _jsxs(Block, { color: "red", children: [_jsx(Panel, { padding: "xxlarge", children: _jsx(Title, { center: true, size: "xxlarge", children: title ?? name }) }), content && (_jsx(Section, { wide: true, children: _jsx(Prose, { children: _jsx(Markup, { children: content }) }) })), _jsx(Section, { wide: true, children: _jsx(TreeCards, { children: children }) })] }) }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# DocumentationHomePage
|
|
2
|
+
|
|
3
|
+
The landing page for a documentation site — a bold coloured hero panel with the package name, sitting above the listing of every module. Swap it in for the root element via [`TreeRouterMapping`](/ui/TreeRouter) so the home route (`/`) renders this instead of the generic [`TreePage`](/ui/TreePage).
|
|
4
|
+
|
|
5
|
+
**Things to know:**
|
|
6
|
+
|
|
7
|
+
- The whole page sits inside one `color="red"` [`Block`](/ui/Block), so the hero [`Panel`](/ui/Panel), prose, and child [`DocumentationCard`](/ui/DocumentationCard)s all inherit the red tint and re-derive together.
|
|
8
|
+
- The hero is a `padding="xxlarge"` [`Panel`](/ui/Panel) with the package name centred as a large [`Title`](/ui/Title) (`center`, `size="xxlarge"`).
|
|
9
|
+
- Below the hero it renders any absorbed README prose, then the root's children (the modules) as a stack of cards via [`TreeCards`](/ui/TreeCards).
|
|
10
|
+
- It consumes the same [`TreeElementProps`](/util/tree) as [`TreePage`](/ui/TreePage), so it's a drop-in replacement for the `tree-element` renderer.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
Wire it in as the renderer for the root `tree-element` so the home route uses it:
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { DocumentationHomePage, TreeApp, TreeRouterMapping } from "shelving/ui";
|
|
18
|
+
|
|
19
|
+
<TreeRouterMapping mapping={{ "tree-element": DocumentationHomePage }}>
|
|
20
|
+
<TreeApp tree={tree} />
|
|
21
|
+
</TreeRouterMapping>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or render a single page manually by spreading the root element's props:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { DocumentationHomePage } from "shelving/ui";
|
|
28
|
+
|
|
29
|
+
<DocumentationHomePage {...root.props} />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Styling
|
|
33
|
+
|
|
34
|
+
`DocumentationHomePage` has no own CSS hooks — it composes [`Page`](/ui/Page), [`Block`](/ui/Block), [`Panel`](/ui/Panel), [`Title`](/ui/Title), [`Section`](/ui/Section), and [`TreeCards`](/ui/TreeCards), which carry their own themeable surfaces. Retheme through those, or change the hero colour via the `color=` on the wrapping `Block`.
|
|
35
|
+
|
|
36
|
+
## See also
|
|
37
|
+
|
|
38
|
+
- [`TreePage`](/ui/TreePage) — the generic `tree-element` renderer this replaces for the home route.
|
|
39
|
+
- [`DocumentationPage`](/ui/DocumentationPage) — the per-symbol detail page that uses the same coloured-panel hero pattern.
|
|
40
|
+
- [`Panel`](/ui/Panel) — the full-width hero band, here with `padding="xxlarge"`.
|
|
41
|
+
- [`TreeCards`](/ui/TreeCards) — the module card listing rendered below the hero.
|
|
42
|
+
- [`TreeApp`](/ui/TreeApp) — wires renderers into a complete site.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
4
|
+
import type { DocumentationElement } from "../../util/tree.js";
|
|
5
|
+
import { MetaContext } from "../misc/MetaContext.js";
|
|
6
|
+
import { createMeta } from "../util/meta.js";
|
|
7
|
+
import { DocumentationHomePage } from "./DocumentationHomePage.js";
|
|
8
|
+
|
|
9
|
+
/** Make a minimal `kind: "module"` child element. */
|
|
10
|
+
function mod(name: string): DocumentationElement {
|
|
11
|
+
return { type: "tree-documentation", key: name, props: { name, kind: "module" } };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Render inside a `MetaContext` — the child cards read the current URL from it. */
|
|
15
|
+
function render(node: ReactNode, url = "./"): string {
|
|
16
|
+
return renderToStaticMarkup(<MetaContext value={createMeta({ root: "http://x.com/", url })}>{node}</MetaContext>);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe("DocumentationHomePage", () => {
|
|
20
|
+
test("renders the title as a hero and lists the modules", () => {
|
|
21
|
+
const html = render(
|
|
22
|
+
<DocumentationHomePage name="shelving" title="shelving">
|
|
23
|
+
{[mod("util"), mod("schema")]}
|
|
24
|
+
</DocumentationHomePage>,
|
|
25
|
+
);
|
|
26
|
+
expect(html).toContain("shelving");
|
|
27
|
+
expect(html).toContain("util");
|
|
28
|
+
expect(html).toContain("schema");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("falls back to `name` when no `title` is set", () => {
|
|
32
|
+
const html = render(<DocumentationHomePage name="shelving">{[mod("util")]}</DocumentationHomePage>);
|
|
33
|
+
expect(html).toContain("shelving");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { TreeElementProps } from "../../util/tree.js";
|
|
3
|
+
import { Block } from "../block/Block.js";
|
|
4
|
+
import { Panel } from "../block/Panel.js";
|
|
5
|
+
import { Prose } from "../block/Prose.js";
|
|
6
|
+
import { Section } from "../block/Section.js";
|
|
7
|
+
import { Title } from "../block/Title.js";
|
|
8
|
+
import { Markup } from "../misc/Markup.js";
|
|
9
|
+
import { Page } from "../page/Page.js";
|
|
10
|
+
import { TreeCards } from "../tree/TreeCards.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Page renderer for the documentation site's home page — a bold coloured hero panel over the module listing.
|
|
14
|
+
* - The whole page sits in a single `color="red"` `<Block>`, so the hero panel, prose, and child cards all pick up the red tint.
|
|
15
|
+
* - The hero is a full-padding `<Panel>` with the package name centred as a large `<Title>`.
|
|
16
|
+
* - Below the hero it renders any absorbed prose content, then the root's children (the modules) as a stack of cards.
|
|
17
|
+
*
|
|
18
|
+
* @kind component
|
|
19
|
+
* @param props The root tree element props (`title`, `name`, `description`, `content`, `children`).
|
|
20
|
+
* @returns A `<Page>` with a coloured hero panel followed by the module listing.
|
|
21
|
+
* @example <DocumentationHomePage {...root.props} />
|
|
22
|
+
* @see https://dhoulb.github.io/shelving/ui/docs/DocumentationHomePage/DocumentationHomePage
|
|
23
|
+
*/
|
|
24
|
+
export function DocumentationHomePage({ title, name, description, content, children }: TreeElementProps): ReactNode {
|
|
25
|
+
return (
|
|
26
|
+
<Page title={title ?? name} description={description}>
|
|
27
|
+
<Block color="red">
|
|
28
|
+
<Panel padding="xxlarge">
|
|
29
|
+
<Title center size="xxlarge">
|
|
30
|
+
{title ?? name}
|
|
31
|
+
</Title>
|
|
32
|
+
</Panel>
|
|
33
|
+
{content && (
|
|
34
|
+
<Section wide>
|
|
35
|
+
<Prose>
|
|
36
|
+
<Markup>{content}</Markup>
|
|
37
|
+
</Prose>
|
|
38
|
+
</Section>
|
|
39
|
+
)}
|
|
40
|
+
<Section wide>
|
|
41
|
+
<TreeCards>{children}</TreeCards>
|
|
42
|
+
</Section>
|
|
43
|
+
</Block>
|
|
44
|
+
</Page>
|
|
45
|
+
);
|
|
46
|
+
}
|
package/ui/docs/index.d.ts
CHANGED
package/ui/docs/index.js
CHANGED
package/ui/docs/index.ts
CHANGED
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 {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Radius.module.css";
|
|
3
|
+
@import "../style/Shadow.module.css";
|
|
4
|
+
@import "../style/Space.module.css";
|
|
5
|
+
@import "../style/Stroke.module.css";
|
|
6
|
+
@import "../style/Tint.module.css";
|
|
2
7
|
|
|
3
8
|
@layer components {
|
|
4
9
|
.wrap {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Tint.module.css";
|
|
2
5
|
|
|
3
6
|
@layer components {
|
|
4
7
|
/* Continuous progress bar — a single track that fills horizontally. */
|
package/ui/inline/Code.md
CHANGED
|
@@ -13,7 +13,7 @@ An inline code span — renders a `<code>` element with monospace type and a sub
|
|
|
13
13
|
|
|
14
14
|
- Pick the sibling whose semantics match — they all look the same but mean different things to assistive tech and search.
|
|
15
15
|
- Pass `plain` to drop the default background and inline padding (useful when the code already sits inside a tinted container).
|
|
16
|
-
- Painted from the [tint ladder](/ui/TINT_CLASS): the background is `--tint-90` and the text `--tint-00
|
|
16
|
+
- Painted from the [tint ladder](/ui/TINT_CLASS): the background is [`--tint-90`](/ui/TINT_CLASS) and the text [`--tint-00`](/ui/TINT_CLASS), so it re-tints with its surrounding scope.
|
|
17
17
|
- Inside [`Prose`](/ui/Prose) raw `<code>` / `<kbd>` / `<samp>` / `<var>` pick up the same styling, and code inside a `<pre>` drops the inline box automatically.
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
@@ -48,7 +48,7 @@ import { Code } from "shelving/ui";
|
|
|
48
48
|
| `--code-padding` | Inline padding (non-`plain`) | `var(--space-xxsmall)` |
|
|
49
49
|
| `--code-radius` | Corner radius (non-`plain`) | `var(--radius-xxsmall)` |
|
|
50
50
|
|
|
51
|
-
**Global tokens it reads:** `--font-code
|
|
51
|
+
**Global tokens it reads:** [`--font-code`](/ui/getFontClass), [`--weight-code`](/ui/getWeightClass), [`--size-smaller`](/ui/getSizeClass), [`--leading`](/ui/getSizeClass), [`--space-xxsmall`](/ui/getSpaceClass), [`--radius-xxsmall`](/ui/getRadiusClass), and the tint-ladder steps [`--tint-00`](/ui/TINT_CLASS) / [`--tint-90`](/ui/TINT_CLASS) for the box fill and text.
|
|
52
52
|
|
|
53
53
|
## See also
|
|
54
54
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Font.module.css";
|
|
3
|
+
@import "../style/Radius.module.css";
|
|
4
|
+
@import "../style/Size.module.css";
|
|
5
|
+
@import "../style/Space.module.css";
|
|
6
|
+
@import "../style/Tint.module.css";
|
|
7
|
+
@import "../style/Weight.module.css";
|
|
2
8
|
|
|
3
9
|
@layer components {
|
|
4
10
|
.code,
|
package/ui/inline/Link.md
CHANGED
|
@@ -31,13 +31,13 @@ import { Link } from "shelving/ui";
|
|
|
31
31
|
|
|
32
32
|
## Styling
|
|
33
33
|
|
|
34
|
-
`Link` exposes a couple of inline hooks; the link colour comes from the global `--color-link` token.
|
|
34
|
+
`Link` exposes a couple of inline hooks; the link colour comes from the global [`--color-link`](/ui/getColorClass) token.
|
|
35
35
|
|
|
36
36
|
| Variable | Styles | Default |
|
|
37
37
|
|---|---|---|
|
|
38
38
|
| `--link-weight` | Text colour and font weight | `var(--color-link)` colour / `var(--weight-strong)` weight |
|
|
39
39
|
|
|
40
|
-
**Global tokens it reads:** `--color-link
|
|
40
|
+
**Global tokens it reads:** [`--color-link`](/ui/getColorClass), [`--weight-strong`](/ui/getWeightClass), and [`--stroke-normal`](/ui/getStrokeClass) (the underline thickness).
|
|
41
41
|
|
|
42
42
|
## See also
|
|
43
43
|
|
package/ui/inline/Mark.md
CHANGED
|
@@ -30,7 +30,7 @@ import { Mark } from "shelving/ui";
|
|
|
30
30
|
| `--mark-radius` | Corner radius | `var(--radius-xxsmall)` |
|
|
31
31
|
| `--mark-weight` | Font weight | `var(--weight-strong)` |
|
|
32
32
|
|
|
33
|
-
**Global tokens it reads:** `--light-yellow`, `--dark-yellow`, `--radius-xxsmall
|
|
33
|
+
**Global tokens it reads:** `--light-yellow`, `--dark-yellow`, [`--radius-xxsmall`](/ui/getRadiusClass), and [`--weight-strong`](/ui/getWeightClass).
|
|
34
34
|
|
|
35
35
|
## See also
|
|
36
36
|
|
package/ui/inline/Strong.md
CHANGED
|
@@ -24,7 +24,7 @@ import { Paragraph, Strong } from "shelving/ui";
|
|
|
24
24
|
|
|
25
25
|
`Strong` has no own theming hooks — it sets `font-weight: var(--weight-strong)` and inherits everything else from its surroundings.
|
|
26
26
|
|
|
27
|
-
**Global tokens it reads:** `--weight-strong
|
|
27
|
+
**Global tokens it reads:** [`--weight-strong`](/ui/getWeightClass).
|
|
28
28
|
|
|
29
29
|
## See also
|
|
30
30
|
|
|
@@ -27,9 +27,9 @@ Layouts compose naturally as [`Router`](/ui/Router) route values — wrap a grou
|
|
|
27
27
|
|
|
28
28
|
## Styling
|
|
29
29
|
|
|
30
|
-
This layout exposes no own `--centered-layout-*` hooks. The inner column is capped at the global `--width-wide` token (dropped when `fullWidth` is set), and the outer element composes the shared `.layout` behaviour, so it reads the layout hooks `--layout-space`, `--layout-padding`, and `--layout-inset-top` / `-bottom` / `-left` / `-right`.
|
|
30
|
+
This layout exposes no own `--centered-layout-*` hooks. The inner column is capped at the global [`--width-wide`](/ui/getWidthClass) token (dropped when `fullWidth` is set), and the outer element composes the shared `.layout` behaviour, so it reads the layout hooks `--layout-space`, `--layout-padding`, and `--layout-inset-top` / `-bottom` / `-left` / `-right`.
|
|
31
31
|
|
|
32
|
-
**Global tokens it reads** — `--width-wide
|
|
32
|
+
**Global tokens it reads** — [`--width-wide`](/ui/getWidthClass).
|
|
33
33
|
|
|
34
34
|
## See also
|
|
35
35
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Space.module.css";
|
|
3
|
+
@import "../style/Tint.module.css";
|
|
2
4
|
|
|
3
5
|
/* Low-priority padding/flex defaults live in `@layer defaults` so consumers can override them */
|
|
4
6
|
/* with normal-specificity selectors without needing `:where()` tricks. */
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
position: fixed;
|
|
54
56
|
inset: 0;
|
|
55
57
|
|
|
56
|
-
/* Layout-specific bg hook. Typography and page bg come from the body baseline in style/
|
|
58
|
+
/* Layout-specific bg hook. Typography and page bg come from the body baseline in the style/ token modules. */
|
|
57
59
|
background: var(--layout-body-bg, var(--tint-100));
|
|
58
60
|
}
|
|
59
61
|
|
|
@@ -55,7 +55,7 @@ useEffect(useSafeKeyboardArea, []);
|
|
|
55
55
|
|
|
56
56
|
The content column composes the shared `.layout` behaviour, so it also reads the layout hooks `--layout-space`, `--layout-padding`, `--layout-inset-top` / `-bottom` / `-left` / `-right`, and `--layout-body-bg`.
|
|
57
57
|
|
|
58
|
-
**Global tokens it reads** — the tint ladder `--tint-80` / `--tint-90` / `--tint-100
|
|
58
|
+
**Global tokens it reads** — the tint ladder [`--tint-80`](/ui/TINT_CLASS) / [`--tint-90`](/ui/TINT_CLASS) / [`--tint-100`](/ui/TINT_CLASS), plus [`--space-normal`](/ui/getSpaceClass), [`--stroke-normal`](/ui/getStrokeClass), [`--duration-normal`](/ui/getDurationClass), and [`--color-shadow`](/ui/getColorClass).
|
|
59
59
|
|
|
60
60
|
## See also
|
|
61
61
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Duration.module.css";
|
|
4
|
+
@import "../style/Space.module.css";
|
|
5
|
+
@import "../style/Stroke.module.css";
|
|
2
6
|
@import "../style/Tint.module.css";
|
|
3
7
|
|
|
4
8
|
/*
|
package/ui/menu/Menu.md
CHANGED
|
@@ -42,7 +42,7 @@ import { Menu, MenuItem } from "shelving/ui";
|
|
|
42
42
|
|
|
43
43
|
Item-state hooks (`--menu-hover-*`, `--menu-proud-*`, `--menu-active-*`, `--menu-radius`, `--menu-focus-border`) are documented on [`MenuItem`](/ui/MenuItem).
|
|
44
44
|
|
|
45
|
-
**Global tokens it reads** — the tint ladder `--tint-00` / `--tint-50
|
|
45
|
+
**Global tokens it reads** — the tint ladder [`--tint-00`](/ui/TINT_CLASS) / [`--tint-50`](/ui/TINT_CLASS), plus [`--space-xxsmall`](/ui/getSpaceClass) / [`--space-xsmall`](/ui/getSpaceClass), [`--font-body`](/ui/getFontClass), [`--size-normal`](/ui/getSizeClass), [`--leading`](/ui/getSizeClass), and [`--stroke-focus`](/ui/getStrokeClass).
|
|
46
46
|
|
|
47
47
|
## See also
|
|
48
48
|
|
package/ui/menu/Menu.module.css
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
@import "../style/
|
|
1
|
+
@import "../style/layers.css";
|
|
2
|
+
@import "../style/Color.module.css";
|
|
3
|
+
@import "../style/Font.module.css";
|
|
4
|
+
@import "../style/Radius.module.css";
|
|
5
|
+
@import "../style/Size.module.css";
|
|
6
|
+
@import "../style/Space.module.css";
|
|
7
|
+
@import "../style/Stroke.module.css";
|
|
8
|
+
@import "../style/Tint.module.css";
|
|
9
|
+
@import "../style/Weight.module.css";
|
|
2
10
|
|
|
3
11
|
@layer components {
|
|
4
12
|
.menu {
|
package/ui/menu/MenuItem.md
CHANGED
|
@@ -45,7 +45,7 @@ The item link's hooks (defined in `Menu.module.css`):
|
|
|
45
45
|
|
|
46
46
|
List-level hooks (`--menu-gap`, `--menu-color`, the nested-submenu hooks, etc.) are documented on [`Menu`](/ui/Menu).
|
|
47
47
|
|
|
48
|
-
**Global tokens it reads** — the tint ladder `--tint-00` / `--tint-90` / `--tint-100
|
|
48
|
+
**Global tokens it reads** — the tint ladder [`--tint-00`](/ui/TINT_CLASS) / [`--tint-90`](/ui/TINT_CLASS) / [`--tint-100`](/ui/TINT_CLASS), plus [`--space-xxsmall`](/ui/getSpaceClass), [`--radius-xxsmall`](/ui/getRadiusClass), [`--stroke-focus`](/ui/getStrokeClass), [`--stroke-normal`](/ui/getStrokeClass), [`--color-focus`](/ui/getColorClass), and [`--weight-strong`](/ui/getWeightClass).
|
|
49
49
|
|
|
50
50
|
## See also
|
|
51
51
|
|
package/ui/misc/Tag.md
CHANGED
|
@@ -38,7 +38,7 @@ import { Tag } from "shelving/ui";
|
|
|
38
38
|
| `--tag-case` | Text transform | `var(--case-label)` |
|
|
39
39
|
| `--tag-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
|
|
40
40
|
|
|
41
|
-
**Global tokens it reads** — the tint ladder `--tint-50` / `--tint-55` / `--tint-100
|
|
41
|
+
**Global tokens it reads** — the tint ladder [`--tint-50`](/ui/TINT_CLASS) / [`--tint-55`](/ui/TINT_CLASS) / [`--tint-100`](/ui/TINT_CLASS), plus [`--space-xxsmall`](/ui/getSpaceClass), [`--radius-xxsmall`](/ui/getRadiusClass), [`--font-body`](/ui/getFontClass), [`--size-small`](/ui/getSizeClass), [`--weight-strong`](/ui/getWeightClass), [`--leading`](/ui/getSizeClass), [`--case-label`](/ui/getFontClass), [`--stroke-normal`](/ui/getStrokeClass), [`--stroke-focus`](/ui/getStrokeClass), and [`--color-focus`](/ui/getColorClass).
|
|
42
42
|
|
|
43
43
|
## See also
|
|
44
44
|
|