@godxjp/ui 31.22.0 → 31.23.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/agent/START-HERE.md +2 -2
- package/agent/components/ChatSuggestion.json +1 -1
- package/agent/components/CommandPalette.json +1 -1
- package/agent/components/Prose.json +1 -1
- package/agent/components-index.json +1 -1
- package/agent/components.json +3 -3
- package/agent/index.json +3 -3
- package/agent/llms.txt +4 -4
- package/dist/components/data-entry/chat-suggestion.js +16 -3
- package/dist/components/data-entry/command-palette.d.ts +2 -1
- package/dist/components/data-entry/command-palette.js +4 -3
- package/dist/contracts/measurement.json +1 -1
- package/dist/styles/data-display-layout.css +7 -0
- package/dist/styles/layers.json +1 -1
- package/package.json +2 -2
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` 31.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 31.23.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.
|
|
@@ -47,7 +47,7 @@ Then ask it: `search_components`, `get_component`, `get_tokens`, `get_rule`, `li
|
|
|
47
47
|
task is a task** — "build a settings page", "confirm a destructive delete", "a list page with
|
|
48
48
|
filters" — start HERE, not at the components. Then fetch `patterns/<name>.json` for complete,
|
|
49
49
|
copy-paste-ready code. A component index answers "does X exist"; it cannot answer "build Y".
|
|
50
|
-
1. `components-index.json` —
|
|
50
|
+
1. `components-index.json` — 50 KB, all 181 components as name + group +
|
|
51
51
|
tagline. Read this when you already know the SHAPE you need. Each entry may carry `absorbed`:
|
|
52
52
|
names that **do not exist** and map to it — `Combobox`, `Autocomplete`, `CountrySelect` and
|
|
53
53
|
`SearchSelect` are all `Select`. If you are about to hand-roll something, search this field
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"defaultValue": "\"/\"",
|
|
21
|
-
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so
|
|
21
|
+
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so `/` opens right after Japanese text (gh#1127); an ASCII letter still blocks a ONE-character trigger, so `https://x` opens nothing. A multi-character trigger (`[[`) opens anywhere, `abc[[` included (gh#1129). After Escape the list stays shut until a new trigger is typed. Use \"@\" for mentions, \"[[\" for a link picker.",
|
|
22
22
|
"name": "triggerCharacter",
|
|
23
23
|
"type": "string"
|
|
24
24
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"defaultValue": "true",
|
|
27
|
-
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘
|
|
27
|
+
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘ on Apple platforms and Ctrl elsewhere — never both, so Ctrl+O / Ctrl+P keep their editing meaning on a Mac (gh#1129); Shift / Alt must match exactly. Never fires during IME composition; the default trigger shows the combo (gh#1126).",
|
|
28
28
|
"name": "shortcut",
|
|
29
29
|
"type": "boolean | string"
|
|
30
30
|
},
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"rules": [],
|
|
42
42
|
"storyPath": "data-display/Prose.stories.tsx",
|
|
43
|
-
"tagline": "Typography for rendered content (Markdown, CMS bodies, issue descriptions): styles the semantic HTML inside it from the tokens, with no opinion about where the HTML comes from. To RENDER Markdown, use the sibling package `@godxjp/markdown` inside it — `<Prose><Markdown>{body}</Markdown></Prose>` — the one GFM renderer + sanitiser + Mermaid gate shared by every GoDX app; do not assemble react-markdown + rehype-sanitize per app (gh#1108).",
|
|
43
|
+
"tagline": "Typography for rendered content (Markdown, CMS bodies, issue descriptions): styles the semantic HTML inside it from the tokens, with no opinion about where the HTML comes from. To RENDER Markdown, use the sibling package `@godxjp/markdown` inside it — `<Prose><Markdown>{body}</Markdown></Prose>` — the one GFM renderer + sanitiser + Mermaid gate shared by every GoDX app; do not assemble react-markdown + rehype-sanitize per app (gh#1108). Tables: `@godxjp/markdown` wraps each in `.ui-prose-table-scroll`, which Prose scrolls horizontally (focusable only while it overflows), and table cells keep their words whole — a short code like `F02` never breaks (gh#1131).",
|
|
44
44
|
"usage": [
|
|
45
45
|
"DO import from `@godxjp/ui/data-display`: `import { Prose } from \"@godxjp/ui/data-display\";`",
|
|
46
46
|
"DO wrap the OUTPUT of your Markdown pipeline (react-markdown + remark-gfm + rehype-sanitize), a sanitised CMS string via `dangerouslySetInnerHTML`, or plain JSX. Prose styles descendants: h1..h4, p, ul/ol/li, blockquote, code, pre, table/th/td, a, img, hr.",
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
{
|
|
315
315
|
"group": "data-display",
|
|
316
316
|
"name": "Prose",
|
|
317
|
-
"tagline": "Typography for rendered content (Markdown, CMS bodies, issue descriptions): styles the semantic HTML inside it from the tokens, with no opinion about where the HTML comes from. To RENDER Markdown, use the sibling package `@godxjp/markdown` inside it — `<Prose><Markdown>{body}</Markdown></Prose>` — the one GFM renderer + sanitiser + Mermaid gate shared by every GoDX app; do not assemble react-markdown + rehype-sanitize per app (gh#1108)."
|
|
317
|
+
"tagline": "Typography for rendered content (Markdown, CMS bodies, issue descriptions): styles the semantic HTML inside it from the tokens, with no opinion about where the HTML comes from. To RENDER Markdown, use the sibling package `@godxjp/markdown` inside it — `<Prose><Markdown>{body}</Markdown></Prose>` — the one GFM renderer + sanitiser + Mermaid gate shared by every GoDX app; do not assemble react-markdown + rehype-sanitize per app (gh#1108). Tables: `@godxjp/markdown` wraps each in `.ui-prose-table-scroll`, which Prose scrolls horizontally (focusable only while it overflows), and table cells keep their words whole — a short code like `F02` never breaks (gh#1131)."
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
"group": "data-display",
|
package/agent/components.json
CHANGED
|
@@ -5164,7 +5164,7 @@
|
|
|
5164
5164
|
],
|
|
5165
5165
|
"rules": [],
|
|
5166
5166
|
"storyPath": "data-display/Prose.stories.tsx",
|
|
5167
|
-
"tagline": "Typography for rendered content (Markdown, CMS bodies, issue descriptions): styles the semantic HTML inside it from the tokens, with no opinion about where the HTML comes from. To RENDER Markdown, use the sibling package `@godxjp/markdown` inside it — `<Prose><Markdown>{body}</Markdown></Prose>` — the one GFM renderer + sanitiser + Mermaid gate shared by every GoDX app; do not assemble react-markdown + rehype-sanitize per app (gh#1108).",
|
|
5167
|
+
"tagline": "Typography for rendered content (Markdown, CMS bodies, issue descriptions): styles the semantic HTML inside it from the tokens, with no opinion about where the HTML comes from. To RENDER Markdown, use the sibling package `@godxjp/markdown` inside it — `<Prose><Markdown>{body}</Markdown></Prose>` — the one GFM renderer + sanitiser + Mermaid gate shared by every GoDX app; do not assemble react-markdown + rehype-sanitize per app (gh#1108). Tables: `@godxjp/markdown` wraps each in `.ui-prose-table-scroll`, which Prose scrolls horizontally (focusable only while it overflows), and table cells keep their words whole — a short code like `F02` never breaks (gh#1131).",
|
|
5168
5168
|
"usage": [
|
|
5169
5169
|
"DO import from `@godxjp/ui/data-display`: `import { Prose } from \"@godxjp/ui/data-display\";`",
|
|
5170
5170
|
"DO wrap the OUTPUT of your Markdown pipeline (react-markdown + remark-gfm + rehype-sanitize), a sanitised CMS string via `dangerouslySetInnerHTML`, or plain JSX. Prose styles descendants: h1..h4, p, ul/ol/li, blockquote, code, pre, table/th/td, a, img, hr.",
|
|
@@ -14154,7 +14154,7 @@
|
|
|
14154
14154
|
},
|
|
14155
14155
|
{
|
|
14156
14156
|
"defaultValue": "true",
|
|
14157
|
-
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘
|
|
14157
|
+
"description": "The global toggle shortcut. `true` = ⌘K / Ctrl+K, `false` = none, or a combo string — `\"mod+o\"`, `\"mod+p\"`, `\"mod+shift+p\"` — so a quick switcher and a command palette can live side by side. `mod` is ⌘ on Apple platforms and Ctrl elsewhere — never both, so Ctrl+O / Ctrl+P keep their editing meaning on a Mac (gh#1129); Shift / Alt must match exactly. Never fires during IME composition; the default trigger shows the combo (gh#1126).",
|
|
14158
14158
|
"name": "shortcut",
|
|
14159
14159
|
"type": "boolean | string"
|
|
14160
14160
|
},
|
|
@@ -15483,7 +15483,7 @@
|
|
|
15483
15483
|
},
|
|
15484
15484
|
{
|
|
15485
15485
|
"defaultValue": "\"/\"",
|
|
15486
|
-
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so
|
|
15486
|
+
"description": "The character(s) that open the list when typed at a boundary — the start, whitespace, or any non-ASCII character, so `/` opens right after Japanese text (gh#1127); an ASCII letter still blocks a ONE-character trigger, so `https://x` opens nothing. A multi-character trigger (`[[`) opens anywhere, `abc[[` included (gh#1129). After Escape the list stays shut until a new trigger is typed. Use \"@\" for mentions, \"[[\" for a link picker.",
|
|
15487
15487
|
"name": "triggerCharacter",
|
|
15488
15488
|
"type": "string"
|
|
15489
15489
|
},
|
package/agent/index.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
12
|
"file": "components-index.json",
|
|
13
|
-
"note": "
|
|
13
|
+
"note": "50 KB — name + group + tagline for all 181. FETCH THIS FIRST, then fetch only the components you chose.",
|
|
14
14
|
"url": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components-index.json"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"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.",
|
|
49
49
|
"read": {
|
|
50
50
|
"live": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/index.json",
|
|
51
|
-
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.23.0/agent/index.json"
|
|
52
52
|
},
|
|
53
53
|
"source": "mcp/src/data — the same data @godxjp/ui-mcp serves — plus the foundation and semantic token tiers, read from src/tokens/*.css",
|
|
54
54
|
"start": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/START-HERE.md",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"foundation": "the seeds a consumer is invited to set — --primary, --background, --radius",
|
|
63
63
|
"semantic": "named roles that follow the seeds — --ring, --text-link, --overlay-background"
|
|
64
64
|
},
|
|
65
|
-
"version": "31.
|
|
65
|
+
"version": "31.23.0"
|
|
66
66
|
}
|
package/agent/llms.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @godxjp/ui
|
|
2
2
|
|
|
3
3
|
> A Japanese-enterprise React design system: 181 components, 2129 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.23.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@31.
|
|
7
|
+
(`npx @godxjp/ui-mcp@31.23.0`). It is searchable and version-locked. These files exist for agents
|
|
8
8
|
that can only fetch URLs.
|
|
9
9
|
|
|
10
10
|
## Start
|
|
@@ -15,7 +15,7 @@ that can only fetch URLs.
|
|
|
15
15
|
## Catalog
|
|
16
16
|
|
|
17
17
|
- [patterns-index.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/patterns-index.json): 21 whole-task patterns (name, tagline, tags). Start here when the task is a TASK — "build a settings page" — then fetch `patterns/<name>.json` for complete code.
|
|
18
|
-
- [components-index.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components-index.json):
|
|
18
|
+
- [components-index.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components-index.json): 50 KB — all 181 components as name, group, tagline, plus `absorbed`: the names that do NOT exist and map to it (`Combobox` → `Select`).
|
|
19
19
|
- [components/<Name>.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components/Select.json): one file per component (1 KB–36 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.
|
|
20
20
|
- [components.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components.json): 1.2 MB — every entry in one file. Most URL fetchers truncate a response this size without saying so; prefer the per-component files.
|
|
21
21
|
- [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` — 211 `foundation` seeds (`--primary`, `--background`, `--radius`: set these when you are handed a brand), 104 `semantic` roles, 1814 `component` knobs.
|
|
@@ -26,7 +26,7 @@ that can only fetch URLs.
|
|
|
26
26
|
## Pinning
|
|
27
27
|
|
|
28
28
|
Every URL above tracks `main`. To pin to the release a project actually installed, swap `main` for
|
|
29
|
-
the tag: `.../godx-jp/godxjp-ui/v31.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v31.23.0/agent/...`. A catalog that does not match the installed
|
|
30
30
|
package describes props that are absent, or hides props that are present, and says nothing either way.
|
|
31
31
|
|
|
32
32
|
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.
|
|
@@ -16,8 +16,10 @@ function matchTrigger(text, caret, trigger, { allowSpaces = false, terminator }
|
|
|
16
16
|
if (allowSpaces ? /\n/.test(query) : /\s/.test(query)) return null;
|
|
17
17
|
if (terminator && query.includes(terminator)) return null;
|
|
18
18
|
const preceding = start === 0 ? "" : before[start - 1];
|
|
19
|
-
if (preceding !== "" && !/\s/.test(preceding) && preceding.charCodeAt(0) < 128)
|
|
20
|
-
|
|
19
|
+
if (trigger.length === 1 && preceding !== "" && !/\s/.test(preceding) && preceding.charCodeAt(0) < 128) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return { query, start };
|
|
21
23
|
}
|
|
22
24
|
function levelItems(items, path) {
|
|
23
25
|
let current = items;
|
|
@@ -106,19 +108,30 @@ function ChatSuggestion({
|
|
|
106
108
|
setListId(content?.querySelector("[cmdk-list]")?.id || void 0);
|
|
107
109
|
setActiveId(content?.querySelector('[cmdk-item][aria-selected="true"]')?.id || void 0);
|
|
108
110
|
});
|
|
111
|
+
const dismissedStartRef = React.useRef(null);
|
|
109
112
|
const close = React.useCallback(() => {
|
|
113
|
+
const node = field();
|
|
114
|
+
const caret = node ? node.selectionStart ?? node.value.length : 0;
|
|
115
|
+
const hit = node ? matchTrigger(node.value, caret, triggerCharacter, { allowSpaces, terminator }) : null;
|
|
116
|
+
dismissedStartRef.current = hit ? hit.start : null;
|
|
110
117
|
setOpen(false);
|
|
111
118
|
field()?.focus();
|
|
112
|
-
}, [field, setOpen]);
|
|
119
|
+
}, [field, setOpen, triggerCharacter, allowSpaces, terminator]);
|
|
113
120
|
const evaluate = React.useCallback(() => {
|
|
114
121
|
const node = field();
|
|
115
122
|
if (!node) return;
|
|
116
123
|
const caret = node.selectionStart ?? node.value.length;
|
|
117
124
|
const hit = matchTrigger(node.value, caret, triggerCharacter, { allowSpaces, terminator });
|
|
118
125
|
if (!hit) {
|
|
126
|
+
dismissedStartRef.current = null;
|
|
127
|
+
setOpen(false);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (hit.start === dismissedStartRef.current) {
|
|
119
131
|
setOpen(false);
|
|
120
132
|
return;
|
|
121
133
|
}
|
|
134
|
+
dismissedStartRef.current = null;
|
|
122
135
|
setQuery(hit.query);
|
|
123
136
|
setOpen(true);
|
|
124
137
|
}, [field, setOpen, triggerCharacter, allowSpaces, terminator]);
|
|
@@ -80,7 +80,8 @@ export type CommandPaletteProps = {
|
|
|
80
80
|
* The global shortcut that toggles the palette (gh#1126). `true` (default) is ⌘K / Ctrl+K;
|
|
81
81
|
* `false` binds none; a combo string — `"mod+o"`, `"mod+p"`, `"mod+shift+p"` — binds that, so two
|
|
82
82
|
* palettes (a quick switcher and a command palette) can live side by side. `mod` is ⌘ on Apple
|
|
83
|
-
* and Ctrl elsewhere
|
|
83
|
+
* and Ctrl elsewhere — never both, so Ctrl+O keeps its editing meaning on a Mac; `shift` and
|
|
84
|
+
* `alt` must match exactly, so `mod+p` and
|
|
84
85
|
* `mod+shift+p` are different shortcuts. Never fires during IME composition.
|
|
85
86
|
*/
|
|
86
87
|
shortcut?: boolean | string;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
CommandItem,
|
|
13
13
|
CommandList
|
|
14
14
|
} from "./command.js";
|
|
15
|
+
import { isApplePlatform } from "../../lib/platform.js";
|
|
15
16
|
import { isImeComposing } from "../../lib/ime.js";
|
|
16
17
|
function parseShortcut(shortcut) {
|
|
17
18
|
if (shortcut === false) return null;
|
|
@@ -30,15 +31,15 @@ function parseShortcut(shortcut) {
|
|
|
30
31
|
function shortcutMatches(spec, event) {
|
|
31
32
|
const keyMatches = event.key.toLowerCase() === spec.key || /^[a-z]$/.test(spec.key) && event.code === `Key${spec.key.toUpperCase()}`;
|
|
32
33
|
if (!keyMatches) return false;
|
|
33
|
-
if (spec.mod && !(event.metaKey
|
|
34
|
+
if (spec.mod && !(isApplePlatform() ? event.metaKey : event.ctrlKey)) return false;
|
|
34
35
|
if (spec.meta && !event.metaKey) return false;
|
|
35
36
|
if (spec.ctrl && !event.ctrlKey) return false;
|
|
36
37
|
return event.shiftKey === spec.shift && event.altKey === spec.alt;
|
|
37
38
|
}
|
|
38
39
|
function shortcutHint(spec) {
|
|
39
40
|
return [
|
|
40
|
-
spec.
|
|
41
|
-
spec.ctrl ? "Ctrl+" : "",
|
|
41
|
+
spec.meta || spec.mod && isApplePlatform() ? "\u2318" : "",
|
|
42
|
+
spec.ctrl || spec.mod && !isApplePlatform() ? "Ctrl+" : "",
|
|
42
43
|
spec.alt ? "\u2325" : "",
|
|
43
44
|
spec.shift ? "\u21E7" : "",
|
|
44
45
|
spec.key.length === 1 ? spec.key.toUpperCase() : spec.key
|
|
@@ -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": "31.
|
|
3
|
+
"version": "31.23.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,
|
|
@@ -1398,11 +1398,18 @@
|
|
|
1398
1398
|
border-collapse: collapse;
|
|
1399
1399
|
}
|
|
1400
1400
|
|
|
1401
|
+
.ui-prose .ui-prose-table-scroll {
|
|
1402
|
+
max-inline-size: 100%;
|
|
1403
|
+
overflow-x: auto;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1401
1406
|
.ui-prose :is(th, td) {
|
|
1402
1407
|
border: var(--stroke-hairline) solid hsl(var(--border));
|
|
1403
1408
|
padding: var(--table-cell-padding-y) var(--table-cell-space-x, var(--space-section-active));
|
|
1404
1409
|
text-align: start;
|
|
1405
1410
|
vertical-align: top;
|
|
1411
|
+
|
|
1412
|
+
overflow-wrap: normal;
|
|
1406
1413
|
}
|
|
1407
1414
|
|
|
1408
1415
|
.ui-prose th {
|
package/dist/styles/layers.json
CHANGED