@godxjp/ui 33.16.0 → 33.18.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/README.md +2 -2
- package/agent/START-HERE.md +6 -6
- package/agent/components/AppShell.json +1 -1
- package/agent/components/BlockEditor.json +1 -1
- package/agent/components/Card.json +1 -1
- package/agent/components/Heading.json +6 -0
- package/agent/components/Markdown.json +8 -1
- package/agent/components/Table.json +1 -0
- package/agent/components-index.json +2 -2
- package/agent/components.json +18 -4
- package/agent/index.json +6 -6
- package/agent/llms.txt +5 -5
- package/agent/rules.json +1 -1
- package/agent/tokens.json +36 -0
- package/agent/vocabulary.json +12 -0
- package/dist/components/data-display/index.d.ts +1 -1
- package/dist/components/data-display/index.js +10 -1
- package/dist/components/data-display/table.d.ts +9 -0
- package/dist/components/data-display/table.js +3 -0
- package/dist/components/general/typography.d.ts +1 -0
- package/dist/components/general/typography.js +3 -0
- package/dist/contracts/measurement.json +1 -1
- package/dist/lib/hooks.d.ts +8 -0
- package/dist/lib/hooks.js +20 -21
- package/dist/props/components/general.prop.d.ts +8 -1
- package/dist/props/registry.d.ts +6 -1
- package/dist/props/registry.js +6 -0
- package/dist/props/vocabulary/index.d.ts +1 -1
- package/dist/props/vocabulary/interaction.prop.d.ts +6 -0
- package/dist/styles/badge-layout.css +1 -0
- package/dist/styles/base.css +8 -0
- package/dist/styles/card-layout.css +8 -0
- package/dist/styles/dialog-layout.css +7 -3
- package/dist/styles/layers.json +1 -1
- package/dist/styles/layout.css +2 -0
- package/dist/styles/logo-layout.css +18 -12
- package/dist/styles/shell-layout.css +40 -1
- package/dist/styles/table-layout.css +30 -0
- package/dist/styles/text-layout.css +5 -0
- package/dist/styles.css +1 -1
- package/dist/theme/famgia.service.css +10 -8
- package/dist/themes/godx-tokens.css +20 -16
- package/dist/tokens/components/feedback.css +2 -0
- package/dist/tokens/components/logo.css +6 -4
- package/dist/tokens/components/table.css +4 -0
- package/dist/tokens/derived.css +28 -24
- package/dist/tokens/foundation.css +62 -56
- package/dist/tokens/semantic/layout.css +5 -3
- package/docs/TOKENS.md +33 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npm i @godxjp/ui
|
|
|
18
18
|
|
|
19
19
|
<!-- agent-catalog-counts:start -->
|
|
20
20
|
|
|
21
|
-
The catalog — 171 components,
|
|
21
|
+
The catalog — 171 components, 2263 tokens, 44 cardinal rules — is published in two forms from one
|
|
22
22
|
source. **Entry point for either: [`AGENTS.md`](AGENTS.md).**
|
|
23
23
|
<!-- agent-catalog-counts:end -->
|
|
24
24
|
|
|
@@ -56,7 +56,7 @@ static files straight from this public repo — no hosting, no deploy step:
|
|
|
56
56
|
| [`agent/components-index.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components-index.json) | 54 KB | all 171 as name + group + tagline — **fetch this first** |
|
|
57
57
|
| [`agent/components/<Name>.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components/Select.json) | 1 KB–38 KB | one file per component, each with its `importPath` — **this is the route to take** |
|
|
58
58
|
| [`agent/components.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components.json) | 1.3 MB | all 171 entries in one file — most URL fetchers truncate this silently; prefer the per-component files |
|
|
59
|
-
| [`agent/tokens.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/tokens.json) |
|
|
59
|
+
| [`agent/tokens.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/tokens.json) | 862 KB | all 2263 design tokens, their values and why they exist |
|
|
60
60
|
| [`agent/vocabulary.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/vocabulary.json) | 7 KB | the controlled prop vocabulary |
|
|
61
61
|
| [`agent/rules.json`](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/rules.json) | 23 KB | the 44 cardinal rules |
|
|
62
62
|
<!-- prettier-ignore-end -->
|
package/agent/START-HERE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
You are about to write code against a design system you did not author. This file is the whole
|
|
4
4
|
contract. Read it before you write JSX.
|
|
5
5
|
|
|
6
|
-
**This catalog describes `@godxjp/ui` 33.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 33.18.0.** If the project you are editing has a different
|
|
7
7
|
version in its `package.json`, read the pinned catalog for THAT version instead
|
|
8
8
|
(`…/v<their-version>/agent/…`). A catalog newer than the installed package describes props that do
|
|
9
9
|
not exist yet; older, and it hides props that do. Neither failure announces itself.
|
|
@@ -61,10 +61,10 @@ screen anatomy, the visual target the rules below do not give you. Then fetch in
|
|
|
61
61
|
its `importPath`, and its examples. Fetch only the handful you picked in step 1.
|
|
62
62
|
3. `rules.json` — 44 cardinal rules. The ones about raw HTML and hardcoded colour are not
|
|
63
63
|
style advice.
|
|
64
|
-
4. `tokens.json` —
|
|
65
|
-
brand, read the
|
|
64
|
+
4. `tokens.json` — 2263 design tokens, each tagged with its `tier`. **If you were handed a
|
|
65
|
+
brand, read the 220 `foundation` entries first** — `--primary`, `--background`,
|
|
66
66
|
`--radius`, `--font-size-base` are the handful everything else derives from. The
|
|
67
|
-
|
|
67
|
+
1930 `component` entries are per-part knobs; reach for one only when a role is
|
|
68
68
|
right everywhere except one component.
|
|
69
69
|
5. `anti-ai-tells.json` — 35 shapes that make generated UI look generated, each with the
|
|
70
70
|
fix. Read before you reach for a gradient hero or a wall of coloured chips.
|
|
@@ -148,9 +148,9 @@ has stopped following the brand.
|
|
|
148
148
|
|
|
149
149
|
| `tier` | count | what it is | set it? |
|
|
150
150
|
|---|---|---|---|
|
|
151
|
-
| `foundation` |
|
|
151
|
+
| `foundation` | 220 | the seeds — `--primary`, `--background`, `--foreground`, `--radius`, `--font-size-base`, `--shadow-color`. Everything below is derived from these | **yes — this is the main road.** The default `--primary` is a neutral placeholder: set it (`:root { --primary: <H> <S>% <L>%; }`, HSL components, no `hsl()` wrapper) or import a theme preset such as `@godxjp/ui/themes/godx.css` |
|
|
152
152
|
| `semantic` | 113 | named roles that follow the seeds — `--ring`, `--text-link`, `--primary-hover`, `--overlay-background` | only when the seed is right and ONE role must differ. That role then stops following a later brand change |
|
|
153
|
-
| `component` |
|
|
153
|
+
| `component` | 1930 | per-part knobs, `--{component}-{part}-{property}` | rarely. Most are declared `initial` with the real default at the call site — deliberate, so a scoped override re-resolves instead of freezing at `:root` |
|
|
154
154
|
|
|
155
155
|
A token whose `value` is `initial` is not empty and not broken: `initial` is the guaranteed-invalid
|
|
156
156
|
value, so the real default is computed where the element paints it. Set it and yours wins.
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
23
|
|
136
136
|
],
|
|
137
137
|
"storyPath": "layout/app-shell.tsx",
|
|
138
|
-
"tagline": "Root application shell — composes sidebar, topbar rail, main content area, and optional footer. Keyboard focus in clipped chrome stays inset; the main scroll region shows an inset brand ring by default (--region-focus-ring-width).",
|
|
138
|
+
"tagline": "Root application shell — composes sidebar, topbar rail, main content area, and optional footer. In print, navigation, topbar, breadcrumb and footer are hidden; main content flows across the paper width on the light --background. Put every consumer-authored dark theme override inside @media not print, with light declarations outside it, matching the package themes. Keyboard focus in clipped chrome stays inset; the main scroll region shows an inset brand ring by default (--region-focus-ring-width).",
|
|
139
139
|
"usage": [
|
|
140
140
|
"DO put a sidebar collapse toggle IN the rail, not floating in the bar (ADR C10): the shell does not render one, so pass it through `Sidebar action={(collapsed) => <Button variant=\"ghost\" size=\"icon\" aria-label={t(\"toggleSidebar\")} aria-expanded={!collapsed} …/>}` (or the `footer` render-prop), which keeps it attached to the rail in both states. A toggle in `Topbar start` under `topbarSpan=\"full\"` lands beside the brand, detached from the rail it controls. The shell has no edge-mounted toggle (a control straddling the rail border); `Sidebar action` keeps it inside the rail head, which is the supported placement. Below the navigation boundary the drawer has its own trigger; render no collapse toggle there.",
|
|
141
141
|
"useAppShellNavigationMode() returns drawer/docked at the same 56.25rem boundary as AppShell. The root also publishes data-navigation. Use this instead of a consumer media query.",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"type": "string"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"description": "Canonical Markdown after each edit — `serialize(editor.getJSON())`, identical to `normalize(body)` from `@godxjp/markdown/codec` (CODEC_ID kit-md@
|
|
19
|
+
"description": "Canonical Markdown after each edit — `serialize(editor.getJSON())`, identical to `normalize(body)` from `@godxjp/markdown/codec` (CODEC_ID kit-md@2).",
|
|
20
20
|
"name": "onValueChange",
|
|
21
21
|
"type": "(markdown: string) => void"
|
|
22
22
|
},
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"CardHeader",
|
|
85
85
|
"CardTitle"
|
|
86
86
|
],
|
|
87
|
-
"tagline": "Surface container with optional accent stripe, variant fill (including the Ant Design borderless edge), hoverable lift, and density. ⚠️ The bare <Card> has NO inner padding — body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className=\"p-4\"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter. For Ant Design's card-head TAB STRIP (tabs under the title, inside the card border) use the `tabList`/`activeTabKey`/`defaultActiveTabKey`/`onTabChange`/`extra`/`tabProps` props — the Card renders the strip and the children become the selected tab's body. For a non-tab TOOL strip inside the card (composer or editor tools) use <CardBar extra={…}> — a positionable bar that auto-draws its separator from its position (top→bottom border, bottom→top border, middle→both) and pins `extra` content to the inline-end edge; place it as first/last child of the Card. List FILTERS (search, filter selects, filter chips) are NOT a CardBar: CardBar's main slot scrolls sideways, and a filter strip never does — they go in a FilterBar ABOVE the card, which wraps (cardinal rule #51, pattern `list-filters`).",
|
|
87
|
+
"tagline": "Surface container that requests break-inside: avoid in print, with optional accent stripe, variant fill (including the Ant Design borderless edge), hoverable lift, and density. ⚠️ The bare <Card> has NO inner padding — body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className=\"p-4\"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter. For Ant Design's card-head TAB STRIP (tabs under the title, inside the card border) use the `tabList`/`activeTabKey`/`defaultActiveTabKey`/`onTabChange`/`extra`/`tabProps` props — the Card renders the strip and the children become the selected tab's body. For a non-tab TOOL strip inside the card (composer or editor tools) use <CardBar extra={…}> — a positionable bar that auto-draws its separator from its position (top→bottom border, bottom→top border, middle→both) and pins `extra` content to the inline-end edge; place it as first/last child of the Card. List FILTERS (search, filter selects, filter chips) are NOT a CardBar: CardBar's main slot scrolls sideways, and a filter strip never does — they go in a FilterBar ABOVE the card, which wraps (cardinal rule #51, pattern `list-filters`).",
|
|
88
88
|
"usage": [
|
|
89
89
|
"DO always wrap body content in <CardContent> — the bare <Card> div has zero inner padding; content renders flush against card edges without it. Never add className=\"p-4\" directly on <Card> as a substitute.",
|
|
90
90
|
"DO put titles/descriptions in <CardHeader>/<CardTitle>/<CardDescription>. Use <CardHeader banded> for a visually separated muted-background header band (mirrors <CardFooter separated>). Pair with <CardAction> inside a flex-row CardHeader for header-level action buttons.",
|
|
@@ -44,6 +44,12 @@
|
|
|
44
44
|
"description": "Single-line ellipsis.",
|
|
45
45
|
"name": "truncate",
|
|
46
46
|
"type": "boolean"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"defaultValue": "\"display\"",
|
|
50
|
+
"description": "Heading face. `editorial` sets this heading in --font-family-editorial — the opt-in serif a public/editorial page uses for its hero and section headings while every UI heading stays in the display face. Until a theme names --font-family-editorial it falls back to --font-family-display, so the prop is inert by default. Prefer it over moving --font-family-display, which re-faces EVERY heading (card titles, empty states, form sections).",
|
|
51
|
+
"name": "family",
|
|
52
|
+
"type": "\"display\" | \"editorial\""
|
|
47
53
|
}
|
|
48
54
|
],
|
|
49
55
|
"rules": [
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"type": "string"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
"description": "Visible titles for GitHub-alert callouts (`> [!WARNING]`) that carry none of their own. English by default (the package has no i18n); pass localized strings. Grammar v1 (gh#1156): callouts, `:::toggle[summary]`, `::::columns`/`:::column{width=N}`, CJK-friendly emphasis — the same syntax the pure codec at `@godxjp/markdown/codec` (CODEC_ID kit-md@
|
|
66
|
+
"description": "Visible titles for GitHub-alert callouts (`> [!WARNING]`) that carry none of their own. English by default (the package has no i18n); pass localized strings. Grammar v1 (gh#1156): callouts, `:::toggle[summary]`, `::::columns`/`:::column{width=N}`, CJK-friendly emphasis — the same syntax the pure codec at `@godxjp/markdown/codec` (CODEC_ID kit-md@2, parse/serialize/normalize, DOM-free) and @godxjp/block-editor use.",
|
|
67
67
|
"name": "calloutTitles",
|
|
68
68
|
"type": "Partial<Record<'note' | 'tip' | 'important' | 'warning' | 'caution', string>>"
|
|
69
69
|
},
|
|
@@ -72,6 +72,12 @@
|
|
|
72
72
|
"description": "`false` keeps ```mermaid fences as code. Diagrams need the optional peer `mermaid`.",
|
|
73
73
|
"name": "mermaid",
|
|
74
74
|
"type": "boolean"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"defaultValue": "true",
|
|
78
|
+
"description": "Fenced code in a known language is tokenised at parse time as `<span data-code-token>` with the kit's twelve names, which Prose colours (renderer v6). `false` leaves plain text for a host `pre` with its own highlighter.",
|
|
79
|
+
"name": "highlight",
|
|
80
|
+
"type": "boolean"
|
|
75
81
|
}
|
|
76
82
|
],
|
|
77
83
|
"related": [
|
|
@@ -87,6 +93,7 @@
|
|
|
87
93
|
"Table of contents: outline(markdown) from @godxjp/markdown/codec returns { depth, text, id }[] with exactly the ids <Markdown> writes — feed it to the kit Anchor. YAML front matter is kept verbatim and never rendered; frontmatterOf(markdown) returns it (gh#1163).",
|
|
88
94
|
"DO `<Prose><Markdown>{body}</Markdown></Prose>` for every rendered body (wiki page, issue, mail).",
|
|
89
95
|
"DO record `MARKDOWN_FORMAT` and `RENDERER_VERSION` on stored versions.",
|
|
96
|
+
"DO `import \"@godxjp/markdown/katex.css\"` once in the app: `$…$`, `$$…$$` and ```math are drawn by KaTeX at parse time (trust: false, renderer v6) and need its stylesheet and fonts. A single `$` follows Pandoc's rule, so `$5 and $10` stays text.",
|
|
90
97
|
"DON'T assemble react-markdown + rehype-sanitize per app, add rehype-raw, or render Mermaid yourself — `checkMermaidSvg` is the gate."
|
|
91
98
|
]
|
|
92
99
|
}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
{
|
|
73
73
|
"group": "layout",
|
|
74
74
|
"name": "AppShell",
|
|
75
|
-
"tagline": "Root application shell — composes sidebar, topbar rail, main content area, and optional footer. Keyboard focus in clipped chrome stays inset; the main scroll region shows an inset brand ring by default (--region-focus-ring-width)."
|
|
75
|
+
"tagline": "Root application shell — composes sidebar, topbar rail, main content area, and optional footer. In print, navigation, topbar, breadcrumb and footer are hidden; main content flows across the paper width on the light --background. Put every consumer-authored dark theme override inside @media not print, with light declarations outside it, matching the package themes. Keyboard focus in clipped chrome stays inset; the main scroll region shows an inset brand ring by default (--region-focus-ring-width)."
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
"absorbed": [
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
{
|
|
216
216
|
"group": "data-display",
|
|
217
217
|
"name": "Card",
|
|
218
|
-
"tagline": "Surface container with optional accent stripe, variant fill (including the Ant Design borderless edge), hoverable lift, and density. ⚠️ The bare <Card> has NO inner padding — body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className=\"p-4\"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter. For Ant Design's card-head TAB STRIP (tabs under the title, inside the card border) use the `tabList`/`activeTabKey`/`defaultActiveTabKey`/`onTabChange`/`extra`/`tabProps` props — the Card renders the strip and the children become the selected tab's body. For a non-tab TOOL strip inside the card (composer or editor tools) use <CardBar extra={…}> — a positionable bar that auto-draws its separator from its position (top→bottom border, bottom→top border, middle→both) and pins `extra` content to the inline-end edge; place it as first/last child of the Card. List FILTERS (search, filter selects, filter chips) are NOT a CardBar: CardBar's main slot scrolls sideways, and a filter strip never does — they go in a FilterBar ABOVE the card, which wraps (cardinal rule #51, pattern `list-filters`)."
|
|
218
|
+
"tagline": "Surface container that requests break-inside: avoid in print, with optional accent stripe, variant fill (including the Ant Design borderless edge), hoverable lift, and density. ⚠️ The bare <Card> has NO inner padding — body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className=\"p-4\"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter. For Ant Design's card-head TAB STRIP (tabs under the title, inside the card border) use the `tabList`/`activeTabKey`/`defaultActiveTabKey`/`onTabChange`/`extra`/`tabProps` props — the Card renders the strip and the children become the selected tab's body. For a non-tab TOOL strip inside the card (composer or editor tools) use <CardBar extra={…}> — a positionable bar that auto-draws its separator from its position (top→bottom border, bottom→top border, middle→both) and pins `extra` content to the inline-end edge; place it as first/last child of the Card. List FILTERS (search, filter selects, filter chips) are NOT a CardBar: CardBar's main slot scrolls sideways, and a filter strip never does — they go in a FilterBar ABOVE the card, which wraps (cardinal rule #51, pattern `list-filters`)."
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
"group": "data-display",
|
package/agent/components.json
CHANGED
|
@@ -1329,7 +1329,7 @@
|
|
|
1329
1329
|
23
|
|
1330
1330
|
],
|
|
1331
1331
|
"storyPath": "layout/app-shell.tsx",
|
|
1332
|
-
"tagline": "Root application shell — composes sidebar, topbar rail, main content area, and optional footer. Keyboard focus in clipped chrome stays inset; the main scroll region shows an inset brand ring by default (--region-focus-ring-width).",
|
|
1332
|
+
"tagline": "Root application shell — composes sidebar, topbar rail, main content area, and optional footer. In print, navigation, topbar, breadcrumb and footer are hidden; main content flows across the paper width on the light --background. Put every consumer-authored dark theme override inside @media not print, with light declarations outside it, matching the package themes. Keyboard focus in clipped chrome stays inset; the main scroll region shows an inset brand ring by default (--region-focus-ring-width).",
|
|
1333
1333
|
"usage": [
|
|
1334
1334
|
"DO put a sidebar collapse toggle IN the rail, not floating in the bar (ADR C10): the shell does not render one, so pass it through `Sidebar action={(collapsed) => <Button variant=\"ghost\" size=\"icon\" aria-label={t(\"toggleSidebar\")} aria-expanded={!collapsed} …/>}` (or the `footer` render-prop), which keeps it attached to the rail in both states. A toggle in `Topbar start` under `topbarSpan=\"full\"` lands beside the brand, detached from the rail it controls. The shell has no edge-mounted toggle (a control straddling the rail border); `Sidebar action` keeps it inside the rail head, which is the supported placement. Below the navigation boundary the drawer has its own trigger; render no collapse toggle there.",
|
|
1335
1335
|
"useAppShellNavigationMode() returns drawer/docked at the same 56.25rem boundary as AppShell. The root also publishes data-navigation. Use this instead of a consumer media query.",
|
|
@@ -3042,6 +3042,12 @@
|
|
|
3042
3042
|
"description": "Single-line ellipsis.",
|
|
3043
3043
|
"name": "truncate",
|
|
3044
3044
|
"type": "boolean"
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
"defaultValue": "\"display\"",
|
|
3048
|
+
"description": "Heading face. `editorial` sets this heading in --font-family-editorial — the opt-in serif a public/editorial page uses for its hero and section headings while every UI heading stays in the display face. Until a theme names --font-family-editorial it falls back to --font-family-display, so the prop is inert by default. Prefer it over moving --font-family-display, which re-faces EVERY heading (card titles, empty states, form sections).",
|
|
3049
|
+
"name": "family",
|
|
3050
|
+
"type": "\"display\" | \"editorial\""
|
|
3045
3051
|
}
|
|
3046
3052
|
],
|
|
3047
3053
|
"rules": [
|
|
@@ -3756,7 +3762,7 @@
|
|
|
3756
3762
|
"CardHeader",
|
|
3757
3763
|
"CardTitle"
|
|
3758
3764
|
],
|
|
3759
|
-
"tagline": "Surface container with optional accent stripe, variant fill (including the Ant Design borderless edge), hoverable lift, and density. ⚠️ The bare <Card> has NO inner padding — body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className=\"p-4\"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter. For Ant Design's card-head TAB STRIP (tabs under the title, inside the card border) use the `tabList`/`activeTabKey`/`defaultActiveTabKey`/`onTabChange`/`extra`/`tabProps` props — the Card renders the strip and the children become the selected tab's body. For a non-tab TOOL strip inside the card (composer or editor tools) use <CardBar extra={…}> — a positionable bar that auto-draws its separator from its position (top→bottom border, bottom→top border, middle→both) and pins `extra` content to the inline-end edge; place it as first/last child of the Card. List FILTERS (search, filter selects, filter chips) are NOT a CardBar: CardBar's main slot scrolls sideways, and a filter strip never does — they go in a FilterBar ABOVE the card, which wraps (cardinal rule #51, pattern `list-filters`).",
|
|
3765
|
+
"tagline": "Surface container that requests break-inside: avoid in print, with optional accent stripe, variant fill (including the Ant Design borderless edge), hoverable lift, and density. ⚠️ The bare <Card> has NO inner padding — body content MUST be wrapped in <CardContent> (titles in <CardHeader>), or it sits FLUSH against the card edges. Never hand-roll padding with className=\"p-4\"; use <CardContent>. Compose with CardHeader/CardTitle/CardContent/CardFooter. For Ant Design's card-head TAB STRIP (tabs under the title, inside the card border) use the `tabList`/`activeTabKey`/`defaultActiveTabKey`/`onTabChange`/`extra`/`tabProps` props — the Card renders the strip and the children become the selected tab's body. For a non-tab TOOL strip inside the card (composer or editor tools) use <CardBar extra={…}> — a positionable bar that auto-draws its separator from its position (top→bottom border, bottom→top border, middle→both) and pins `extra` content to the inline-end edge; place it as first/last child of the Card. List FILTERS (search, filter selects, filter chips) are NOT a CardBar: CardBar's main slot scrolls sideways, and a filter strip never does — they go in a FilterBar ABOVE the card, which wraps (cardinal rule #51, pattern `list-filters`).",
|
|
3760
3766
|
"usage": [
|
|
3761
3767
|
"DO always wrap body content in <CardContent> — the bare <Card> div has zero inner padding; content renders flush against card edges without it. Never add className=\"p-4\" directly on <Card> as a substitute.",
|
|
3762
3768
|
"DO put titles/descriptions in <CardHeader>/<CardTitle>/<CardDescription>. Use <CardHeader banded> for a visually separated muted-background header band (mirrors <CardFooter separated>). Pair with <CardAction> inside a flex-row CardHeader for header-level action buttons.",
|
|
@@ -5081,7 +5087,7 @@
|
|
|
5081
5087
|
"type": "string"
|
|
5082
5088
|
},
|
|
5083
5089
|
{
|
|
5084
|
-
"description": "Visible titles for GitHub-alert callouts (`> [!WARNING]`) that carry none of their own. English by default (the package has no i18n); pass localized strings. Grammar v1 (gh#1156): callouts, `:::toggle[summary]`, `::::columns`/`:::column{width=N}`, CJK-friendly emphasis — the same syntax the pure codec at `@godxjp/markdown/codec` (CODEC_ID kit-md@
|
|
5090
|
+
"description": "Visible titles for GitHub-alert callouts (`> [!WARNING]`) that carry none of their own. English by default (the package has no i18n); pass localized strings. Grammar v1 (gh#1156): callouts, `:::toggle[summary]`, `::::columns`/`:::column{width=N}`, CJK-friendly emphasis — the same syntax the pure codec at `@godxjp/markdown/codec` (CODEC_ID kit-md@2, parse/serialize/normalize, DOM-free) and @godxjp/block-editor use.",
|
|
5085
5091
|
"name": "calloutTitles",
|
|
5086
5092
|
"type": "Partial<Record<'note' | 'tip' | 'important' | 'warning' | 'caution', string>>"
|
|
5087
5093
|
},
|
|
@@ -5090,6 +5096,12 @@
|
|
|
5090
5096
|
"description": "`false` keeps ```mermaid fences as code. Diagrams need the optional peer `mermaid`.",
|
|
5091
5097
|
"name": "mermaid",
|
|
5092
5098
|
"type": "boolean"
|
|
5099
|
+
},
|
|
5100
|
+
{
|
|
5101
|
+
"defaultValue": "true",
|
|
5102
|
+
"description": "Fenced code in a known language is tokenised at parse time as `<span data-code-token>` with the kit's twelve names, which Prose colours (renderer v6). `false` leaves plain text for a host `pre` with its own highlighter.",
|
|
5103
|
+
"name": "highlight",
|
|
5104
|
+
"type": "boolean"
|
|
5093
5105
|
}
|
|
5094
5106
|
],
|
|
5095
5107
|
"related": [
|
|
@@ -5105,6 +5117,7 @@
|
|
|
5105
5117
|
"Table of contents: outline(markdown) from @godxjp/markdown/codec returns { depth, text, id }[] with exactly the ids <Markdown> writes — feed it to the kit Anchor. YAML front matter is kept verbatim and never rendered; frontmatterOf(markdown) returns it (gh#1163).",
|
|
5106
5118
|
"DO `<Prose><Markdown>{body}</Markdown></Prose>` for every rendered body (wiki page, issue, mail).",
|
|
5107
5119
|
"DO record `MARKDOWN_FORMAT` and `RENDERER_VERSION` on stored versions.",
|
|
5120
|
+
"DO `import \"@godxjp/markdown/katex.css\"` once in the app: `$…$`, `$$…$$` and ```math are drawn by KaTeX at parse time (trust: false, renderer v6) and need its stylesheet and fonts. A single `$` follows Pandoc's rule, so `$5 and $10` stays text.",
|
|
5108
5121
|
"DON'T assemble react-markdown + rehype-sanitize per app, add rehype-raw, or render Mermaid yourself — `checkMermaidSvg` is the gate."
|
|
5109
5122
|
]
|
|
5110
5123
|
},
|
|
@@ -5192,7 +5205,7 @@
|
|
|
5192
5205
|
"type": "string"
|
|
5193
5206
|
},
|
|
5194
5207
|
{
|
|
5195
|
-
"description": "Canonical Markdown after each edit — `serialize(editor.getJSON())`, identical to `normalize(body)` from `@godxjp/markdown/codec` (CODEC_ID kit-md@
|
|
5208
|
+
"description": "Canonical Markdown after each edit — `serialize(editor.getJSON())`, identical to `normalize(body)` from `@godxjp/markdown/codec` (CODEC_ID kit-md@2).",
|
|
5196
5209
|
"name": "onValueChange",
|
|
5197
5210
|
"type": "(markdown: string) => void"
|
|
5198
5211
|
},
|
|
@@ -5722,6 +5735,7 @@
|
|
|
5722
5735
|
"storyPath": "data-display/table.tsx",
|
|
5723
5736
|
"subParts": [
|
|
5724
5737
|
"TableBody",
|
|
5738
|
+
"TableCaption",
|
|
5725
5739
|
"TableCell",
|
|
5726
5740
|
"TableHead",
|
|
5727
5741
|
"TableHeader",
|
package/agent/index.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"components": 171,
|
|
5
5
|
"patterns": 28,
|
|
6
6
|
"rules": 44,
|
|
7
|
-
"tokens":
|
|
8
|
-
"vocabulary":
|
|
7
|
+
"tokens": 2263,
|
|
8
|
+
"vocabulary": 16
|
|
9
9
|
},
|
|
10
10
|
"design": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/DESIGN.md",
|
|
11
11
|
"files": [
|
|
@@ -54,19 +54,19 @@
|
|
|
54
54
|
"note": "Pin to the tag that matches the @godxjp/ui version you installed. A catalog newer than your package describes props you do not have; older, and it hides props you do.",
|
|
55
55
|
"read": {
|
|
56
56
|
"live": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/index.json",
|
|
57
|
-
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v33.
|
|
57
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v33.18.0/agent/index.json"
|
|
58
58
|
},
|
|
59
59
|
"source": "mcp/src/data — the same data @godxjp/ui-mcp serves — plus the foundation and semantic token tiers, read from src/tokens/*.css",
|
|
60
60
|
"start": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/START-HERE.md",
|
|
61
61
|
"tokenTiers": {
|
|
62
62
|
"component": "per-part knobs, --{component}-{part}-{property}; usually leave these alone",
|
|
63
63
|
"counts": {
|
|
64
|
-
"component":
|
|
65
|
-
"foundation":
|
|
64
|
+
"component": 1930,
|
|
65
|
+
"foundation": 220,
|
|
66
66
|
"semantic": 113
|
|
67
67
|
},
|
|
68
68
|
"foundation": "the seeds a consumer is invited to set — --primary, --background, --radius",
|
|
69
69
|
"semantic": "named roles that follow the seeds — --ring, --text-link, --overlay-background"
|
|
70
70
|
},
|
|
71
|
-
"version": "33.
|
|
71
|
+
"version": "33.18.0"
|
|
72
72
|
}
|
package/agent/llms.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @godxjp/ui
|
|
2
2
|
|
|
3
|
-
> A Japanese-enterprise React design system: 171 components,
|
|
4
|
-
> 44 cardinal rules. This file is the entry point for AI agents. Catalog version 33.
|
|
3
|
+
> A Japanese-enterprise React design system: 171 components, 2263 design tokens,
|
|
4
|
+
> 44 cardinal rules. This file is the entry point for AI agents. Catalog version 33.18.0.
|
|
5
5
|
|
|
6
6
|
If your client can run a process, do not read these files — run the MCP server instead
|
|
7
|
-
(`npx @godxjp/ui-mcp@33.
|
|
7
|
+
(`npx @godxjp/ui-mcp@33.18.0`). It is searchable and version-locked. These files exist for agents
|
|
8
8
|
that can only fetch URLs.
|
|
9
9
|
|
|
10
10
|
## Start
|
|
@@ -19,7 +19,7 @@ that can only fetch URLs.
|
|
|
19
19
|
- [components-index.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components-index.json): 54 KB — all 171 components as name, group, tagline, plus `absorbed`: the names that do NOT exist and map to it (`Combobox` → `Select`).
|
|
20
20
|
- [components/<Name>.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components/Select.json): one file per component (1 KB–38 KB, median 6 KB). Read the index, then fetch only the ones you chose — this is the selective route, and the reason you do not need the blob.
|
|
21
21
|
- [components.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components.json): 1.3 MB — every entry in one file. Most URL fetchers truncate a response this size without saying so; prefer the per-component files.
|
|
22
|
-
- [tokens.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/tokens.json): every design token with its value, the reason it exists, and its `tier` —
|
|
22
|
+
- [tokens.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/tokens.json): every design token with its value, the reason it exists, and its `tier` — 220 `foundation` seeds (`--primary`, `--background`, `--radius`: set these when you are handed a brand), 113 `semantic` roles, 1930 `component` knobs.
|
|
23
23
|
- [vocabulary.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/vocabulary.json): the controlled prop vocabulary — which prop name means what, across every component.
|
|
24
24
|
- [rules.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/rules.json): 44 cardinal rules.
|
|
25
25
|
- [anti-ai-tells.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/anti-ai-tells.json): 35 shapes that make generated UI look generated, each with its fix.
|
|
@@ -27,7 +27,7 @@ that can only fetch URLs.
|
|
|
27
27
|
## Pinning
|
|
28
28
|
|
|
29
29
|
Every URL above tracks `main`. To pin to the release a project actually installed, swap `main` for
|
|
30
|
-
the tag: `.../godx-jp/godxjp-ui/v33.
|
|
30
|
+
the tag: `.../godx-jp/godxjp-ui/v33.18.0/agent/...`. A catalog that does not match the installed
|
|
31
31
|
package describes props that are absent, or hides props that are present, and says nothing either way.
|
|
32
32
|
|
|
33
33
|
Pinned catalogs only exist for releases whose tag actually contains `agent/`. If `…/v<version>/agent/index.json` returns 404, that release predates this catalog: read `…/main/…` instead and compare `index.json` → `version` against the package you have, so you at least know which way it drifted.
|
package/agent/rules.json
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"title": "No \"platform-only\" exports"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
|
-
"body": "`.dark` / light theme, `data-density` (compact / default / comfortable) and `data-font-size` (sm / base / lg) are axes the component must follow. Read from tokens, never hardcode values.",
|
|
83
|
+
"body": "`.dark` / light theme, `data-density` (compact / default / comfortable) and `data-font-size` (sm / base / lg) are axes the component must follow. Read from tokens, never hardcode values. Enclose every consumer-authored dark override in @media not print and leave light declarations outside it, matching the shipped themes so paper uses the light palette.",
|
|
84
84
|
"number": 21,
|
|
85
85
|
"title": "Every component honours every theme axis"
|
|
86
86
|
},
|
package/agent/tokens.json
CHANGED
|
@@ -773,6 +773,18 @@
|
|
|
773
773
|
"tier": "foundation",
|
|
774
774
|
"value": "var(--font-family-sans)"
|
|
775
775
|
},
|
|
776
|
+
{
|
|
777
|
+
"description": "EDITORIAL face (opt-in) — a magazine-style serif for a hero, an article or a public page's section heading, beside a sans UI. Read by `Heading family=\"editorial\"` and by the PageContainer `headerScale=\"display\"` title. `initial`, default = --font-family-display at the call site, so nothing changes until a theme names a face.",
|
|
778
|
+
"name": "--font-family-editorial",
|
|
779
|
+
"tier": "foundation",
|
|
780
|
+
"value": "initial"
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"description": "FIGURES face (opt-in) — the family tabular numbers are set in (`Text tabular`, `Badge tabular`, numeric TableHead/TableCell): a brand that sets prices in a figure face beside a CJK UI face. `initial` = inherit, so tabular figures keep the surrounding family until a theme names one.",
|
|
784
|
+
"name": "--font-family-tabular",
|
|
785
|
+
"tier": "foundation",
|
|
786
|
+
"value": "initial"
|
|
787
|
+
},
|
|
776
788
|
{
|
|
777
789
|
"description": "── Type scale — GOLDEN-RATIO modular scale (Ant/Tailwind model). ONE base + ONE ratio; every step is base × ratioⁿ, so the whole scale stays in golden proportion. `--font-size-ratio` is φ^¼ (the golden ratio's quarter-step ≈ 1.1227) — a TRUE golden ratio yet dense enough that headings stay small (h1≈20, h2≈18; pure φ=1.618 would be marketing-size). Internal apps get the 14px DEFAULT with ZERO config; a customer overrides `--font-size-base` (and optionally `--font-size-ratio`) and the entire scale rescales in golden proportion. 14px — THE base (= <body>). The single knob; override to retheme.",
|
|
778
790
|
"name": "--font-size-base",
|
|
@@ -7187,6 +7199,12 @@
|
|
|
7187
7199
|
"tier": "component",
|
|
7188
7200
|
"value": "32rem"
|
|
7189
7201
|
},
|
|
7202
|
+
{
|
|
7203
|
+
"description": "Corner of the dialog panel. `initial`: square mobile, --radius-lg → --radius desktop at the call site; a brand whose dialogs are rounder than its cards (cards 8px, dialogs 16px) sets it once here.",
|
|
7204
|
+
"name": "--dialog-radius",
|
|
7205
|
+
"tier": "component",
|
|
7206
|
+
"value": "initial"
|
|
7207
|
+
},
|
|
7190
7208
|
{
|
|
7191
7209
|
"description": "Per-instance width, set by DialogContent `width` (gh#1174) — `initial`, so the default above resolves at the call site; the viewport cap (minus --dialog-viewport-inset) always wins.",
|
|
7192
7210
|
"name": "--dialog-width",
|
|
@@ -12749,6 +12767,24 @@
|
|
|
12749
12767
|
"tier": "component",
|
|
12750
12768
|
"value": "0.06"
|
|
12751
12769
|
},
|
|
12770
|
+
{
|
|
12771
|
+
"description": "TableCaption — `initial`, defaults resolved at the call site (table-layout.css): ink --muted-foreground, size --font-size-sm, block inset --space-2. It sits above the rows (HTML's own side).",
|
|
12772
|
+
"name": "--table-caption-color",
|
|
12773
|
+
"tier": "component",
|
|
12774
|
+
"value": "initial"
|
|
12775
|
+
},
|
|
12776
|
+
{
|
|
12777
|
+
"description": "Table component tokens: row height, cell padding.",
|
|
12778
|
+
"name": "--table-caption-font-size",
|
|
12779
|
+
"tier": "component",
|
|
12780
|
+
"value": "initial"
|
|
12781
|
+
},
|
|
12782
|
+
{
|
|
12783
|
+
"description": "Table component tokens: row height, cell padding.",
|
|
12784
|
+
"name": "--table-caption-space-y",
|
|
12785
|
+
"tier": "component",
|
|
12786
|
+
"value": "initial"
|
|
12787
|
+
},
|
|
12752
12788
|
{
|
|
12753
12789
|
"description": "Distance from the text baseline to the underline. In `em` on purpose: the rule has to stay proportional across the seven type steps, and a px value that reads right at `lg` crowds the descenders at `2xs`. GoDX v2.3 guideline: `.gx a { text-underline-offset: .18em }`",
|
|
12754
12790
|
"name": "--text-link-underline-offset",
|
package/agent/vocabulary.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"concept": "Opt-in heading face, independent of UI headings.",
|
|
4
|
+
"name": "HeadingFamilyProp",
|
|
5
|
+
"notes": "display preserves the default markup; editorial reads --font-family-editorial with --font-family-display as its fallback.",
|
|
6
|
+
"usedBy": [
|
|
7
|
+
"Heading"
|
|
8
|
+
],
|
|
9
|
+
"values": [
|
|
10
|
+
"display",
|
|
11
|
+
"editorial"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"concept": "Which breadcrumb item represents the current page.",
|
|
4
16
|
"name": "BreadcrumbCurrentItemProp",
|
|
@@ -20,7 +20,7 @@ export { Card, CardBar, CardContent, CardCover, CardDescription, CardFooter, Car
|
|
|
20
20
|
export type { StatCardProps, CardBarProps, CardTabItemProp, CardTabItemProps } from "./card.js";
|
|
21
21
|
export { ServiceCatalogCta, ServiceLauncherCard, ServiceLauncherCardSkeleton, } from "./service-launcher-card.js";
|
|
22
22
|
export type { ServiceCatalogCtaProps, ServiceLauncherCardProps, ServiceLauncherCardSkeletonProps, ServiceLauncherStatusTone, } from "./service-launcher-card.js";
|
|
23
|
-
export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "./table.js";
|
|
23
|
+
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "./table.js";
|
|
24
24
|
export { Descriptions } from "./descriptions.js";
|
|
25
25
|
export { DataTable, flexRender } from "./data-table.js";
|
|
26
26
|
export type { ColumnDef, Density as TableDensity } from "./data-table.js";
|
|
@@ -24,7 +24,15 @@ import {
|
|
|
24
24
|
ServiceLauncherCard,
|
|
25
25
|
ServiceLauncherCardSkeleton
|
|
26
26
|
} from "./service-launcher-card.js";
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
Table,
|
|
29
|
+
TableBody,
|
|
30
|
+
TableCaption,
|
|
31
|
+
TableCell,
|
|
32
|
+
TableHead,
|
|
33
|
+
TableHeader,
|
|
34
|
+
TableRow
|
|
35
|
+
} from "./table.js";
|
|
28
36
|
import { Descriptions } from "./descriptions.js";
|
|
29
37
|
import { DataTable, flexRender } from "./data-table.js";
|
|
30
38
|
import { EmptyState } from "./empty-state.js";
|
|
@@ -100,6 +108,7 @@ export {
|
|
|
100
108
|
Swatch,
|
|
101
109
|
Table,
|
|
102
110
|
TableBody,
|
|
111
|
+
TableCaption,
|
|
103
112
|
TableCell,
|
|
104
113
|
TableHead,
|
|
105
114
|
TableHeader,
|
|
@@ -157,6 +157,15 @@ export declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes
|
|
|
157
157
|
} & React.RefAttributes<HTMLTableElement>>;
|
|
158
158
|
export declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
159
159
|
export declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
160
|
+
/**
|
|
161
|
+
* The table's `<caption>` — its accessible name AND the visible sentence that says what the rows
|
|
162
|
+
* are and under which conditions they were collected ("Prices for the Holo variant · shipping not
|
|
163
|
+
* included"). Place it as the FIRST child of `<Table>` (HTML requires it). Without this part a
|
|
164
|
+
* consumer had to hand-roll a raw `<caption>` or put the sentence outside the table, where it no
|
|
165
|
+
* longer names it. It sits above the rows (HTML's own side); colour, size and inset are knobs:
|
|
166
|
+
* `--table-caption-color`, `--table-caption-font-size`, `--table-caption-space-y`.
|
|
167
|
+
*/
|
|
168
|
+
export declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
160
169
|
/**
|
|
161
170
|
* The row's STATE — same wash/rail/`--surface-*` grounding `DataTable`'s own `rowTone` already
|
|
162
171
|
* writes onto `data-tone` (gh#866). Typed here so a hand-composed row can discover it instead of
|
|
@@ -196,6 +196,8 @@ const TableBody = React.forwardRef(({ className, ...props }, ref) => (
|
|
|
196
196
|
/* @__PURE__ */ jsx("tbody", { ref, "data-slot": "table-body", className: cn(className), ...props })
|
|
197
197
|
));
|
|
198
198
|
TableBody.displayName = "TableBody";
|
|
199
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, "data-slot": "table-caption", className: cn(className), ...props }));
|
|
200
|
+
TableCaption.displayName = "TableCaption";
|
|
199
201
|
const TableRow = React.forwardRef(({ className, tone, interactive, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
200
202
|
"tr",
|
|
201
203
|
{
|
|
@@ -293,6 +295,7 @@ TableCell.displayName = "TableCell";
|
|
|
293
295
|
export {
|
|
294
296
|
Table,
|
|
295
297
|
TableBody,
|
|
298
|
+
TableCaption,
|
|
296
299
|
TableCell,
|
|
297
300
|
TableHead,
|
|
298
301
|
TableHeader,
|
|
@@ -93,4 +93,5 @@ export declare const Heading: React.ForwardRefExoticComponent<Omit<React.HTMLAtt
|
|
|
93
93
|
align?: import("../../props/index.js").TextAlignProp;
|
|
94
94
|
truncate?: boolean;
|
|
95
95
|
weight?: import("../../props/index.js").FontWeightProp;
|
|
96
|
+
family?: import("../../props/index.js").HeadingFamilyProp;
|
|
96
97
|
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -530,6 +530,7 @@ const Heading = React.forwardRef(
|
|
|
530
530
|
align,
|
|
531
531
|
truncate,
|
|
532
532
|
weight = "medium",
|
|
533
|
+
family,
|
|
533
534
|
className,
|
|
534
535
|
...props
|
|
535
536
|
}, ref) => React.createElement(as ?? `h${level}`, {
|
|
@@ -543,6 +544,8 @@ const Heading = React.forwardRef(
|
|
|
543
544
|
"data-align": align,
|
|
544
545
|
"data-weight": weight,
|
|
545
546
|
"data-truncate": truncate ? "" : void 0,
|
|
547
|
+
// Only the opt-in face is stamped; a default heading keeps its markup byte-for-byte.
|
|
548
|
+
"data-family": family === "editorial" ? "editorial" : void 0,
|
|
546
549
|
className: cn("ui-heading", className),
|
|
547
550
|
...props
|
|
548
551
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "AUTO-GENERATED by scripts/gen-measurement-contract.mjs — do not edit. Read this instead of guessing: docs/MEASUREMENT-CONTRACT.md.",
|
|
3
|
-
"version": "33.
|
|
3
|
+
"version": "33.18.0",
|
|
4
4
|
"targetSize": {
|
|
5
5
|
"standard": "WCAG 2.2 SC 2.5.8 Target Size (Minimum), level AA — 24×24 CSS px",
|
|
6
6
|
"min": 24,
|
package/dist/lib/hooks.d.ts
CHANGED
|
@@ -21,6 +21,14 @@ export declare function useTimeoutFlag(signal: unknown, ms?: number): boolean;
|
|
|
21
21
|
* first defined value arrives, then PROMOTES to controlled for good.
|
|
22
22
|
*/
|
|
23
23
|
export declare function useControlledLatch(valueIsDefined: boolean): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Live `matchMedia(query).matches`, hydration-safe. Built on `useSyncExternalStore` so that during
|
|
26
|
+
* hydration React renders with the SERVER snapshot (`false`, what SSR sent) and switches to the live
|
|
27
|
+
* match immediately after — the first client render never differs from the server HTML. Reading
|
|
28
|
+
* `matchMedia` in the initial `useState` made a phone hydrate a different tree than the server sent
|
|
29
|
+
* (AppShell `data-navigation` "docked" → "drawer", an attribute mismatch React does not patch up).
|
|
30
|
+
* A client-only mount still gets the live value on its first render.
|
|
31
|
+
*/
|
|
24
32
|
export declare function useMediaQuery(query: string): boolean;
|
|
25
33
|
export declare function useIsMobile(): boolean;
|
|
26
34
|
/**
|
package/dist/lib/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useLayoutEffect } from "@react-aria/utils";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
3
|
+
import { useCallback, useEffect, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { flushSync } from "react-dom";
|
|
5
5
|
function useDebouncedValue(value, delay = 250) {
|
|
6
6
|
const [debounced, setDebounced] = useState(value);
|
|
@@ -43,29 +43,28 @@ function useControlledLatch(valueIsDefined) {
|
|
|
43
43
|
if (valueIsDefined && !latched) setLatched(true);
|
|
44
44
|
return valueIsDefined || latched;
|
|
45
45
|
}
|
|
46
|
+
const getServerMatch = () => false;
|
|
46
47
|
function useMediaQuery(query) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
mediaQuery.
|
|
48
|
+
const subscribe = useCallback(
|
|
49
|
+
(onChange) => {
|
|
50
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return () => {
|
|
51
|
+
};
|
|
52
|
+
const mediaQuery = window.matchMedia(query);
|
|
53
|
+
if (typeof mediaQuery.addEventListener === "function") {
|
|
54
|
+
mediaQuery.addEventListener("change", onChange);
|
|
55
|
+
return () => {
|
|
56
|
+
mediaQuery.removeEventListener("change", onChange);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
mediaQuery.addListener(onChange);
|
|
59
60
|
return () => {
|
|
60
|
-
mediaQuery.
|
|
61
|
+
mediaQuery.removeListener(onChange);
|
|
61
62
|
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, [isBrowser, query]);
|
|
68
|
-
return matches;
|
|
63
|
+
},
|
|
64
|
+
[query]
|
|
65
|
+
);
|
|
66
|
+
const getMatch = () => typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(query).matches : false;
|
|
67
|
+
return useSyncExternalStore(subscribe, getMatch, getServerMatch);
|
|
69
68
|
}
|
|
70
69
|
function useIsMobile() {
|
|
71
70
|
return useMediaQuery("(max-width: 767px)");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Foundation component prop types — @see docs/COMPONENTS.md#foundation */
|
|
2
2
|
import type * as React from "react";
|
|
3
|
-
import type { ActivityAnnounceProp, ActivityVariantProp, AsChildProp, ButtonSizeProp, ButtonVariantProp, ChildrenProp, ClassNameProp, DescriptionProp, DisabledProp, FontWeightProp, HeadingLevelProp, IconSizeProp, IdProp, InViewAmountProp, LabelProp, OnClickProp, OnOpenChangeProp, OpenProp, PendingProp, RevealDelayProp, RevealTriggerProp, ShapeProp, SizeProp, TextAlignProp, TextSizeProp, TextToneProp, TextWhitespaceProp, TextBreakProp, TypographyActionsConfigProp, TypographyCopyConfigProp, TypographyEditConfigProp, TypographyEllipsisConfigProp, TypographyTypeProp } from "../vocabulary/index.js";
|
|
3
|
+
import type { ActivityAnnounceProp, ActivityVariantProp, AsChildProp, ButtonSizeProp, ButtonVariantProp, ChildrenProp, ClassNameProp, DescriptionProp, DisabledProp, FontWeightProp, HeadingFamilyProp, HeadingLevelProp, IconSizeProp, IdProp, InViewAmountProp, LabelProp, OnClickProp, OnOpenChangeProp, OpenProp, PendingProp, RevealDelayProp, RevealTriggerProp, ShapeProp, SizeProp, TextAlignProp, TextSizeProp, TextToneProp, TextWhitespaceProp, TextBreakProp, TypographyActionsConfigProp, TypographyCopyConfigProp, TypographyEditConfigProp, TypographyEllipsisConfigProp, TypographyTypeProp } from "../vocabulary/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* @see Text — typographic primitive; replaces hand-rolled `<span className="text-[13px] …">`.
|
|
6
6
|
*
|
|
@@ -131,6 +131,13 @@ export type HeadingProp = Omit<React.HTMLAttributes<HTMLHeadingElement>, "color"
|
|
|
131
131
|
truncate?: boolean;
|
|
132
132
|
/** Weight (system canon: 400 · 500 · 700). Default `medium` — set `bold` for an emphasised title. */
|
|
133
133
|
weight?: FontWeightProp;
|
|
134
|
+
/**
|
|
135
|
+
* Heading face. `editorial` sets this heading in --font-family-editorial — the opt-in serif a
|
|
136
|
+
* public or editorial page uses for its hero and section headings while the UI stays sans. Until a
|
|
137
|
+
* theme names that face it falls back to --font-family-display, so the prop is inert by default.
|
|
138
|
+
* Omit it (or `display`) for every UI heading.
|
|
139
|
+
*/
|
|
140
|
+
family?: HeadingFamilyProp;
|
|
134
141
|
};
|
|
135
142
|
/**
|
|
136
143
|
* The antd `BlockProps` behaviour shared by `Text` / `Link`.
|