@godxjp/ui 31.31.0 → 31.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/START-HERE.md +1 -1
- package/agent/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/dist/components/data-entry/record-picker.js +6 -0
- package/dist/components/ui/segmented.js +4 -0
- package/dist/contracts/measurement.json +1 -1
- package/dist/styles/layers.json +1 -1
- package/package.json +2 -2
- package/scripts/visual-audit.mjs +31 -3
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.31.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 31.31.2.** 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.
|
package/agent/index.json
CHANGED
|
@@ -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.31.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.31.2/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.31.
|
|
65
|
+
"version": "31.31.2"
|
|
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: 185 components, 2187 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.31.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.31.2.
|
|
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.31.
|
|
7
|
+
(`npx @godxjp/ui-mcp@31.31.2`). It is searchable and version-locked. These files exist for agents
|
|
8
8
|
that can only fetch URLs.
|
|
9
9
|
|
|
10
10
|
## Start
|
|
@@ -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.31.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v31.31.2/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.
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
} from "../feedback/dialog.js";
|
|
21
21
|
import { Command, CommandGroup } from "./command.js";
|
|
22
22
|
import { Input } from "./input.js";
|
|
23
|
+
import { isImeComposing } from "../../lib/ime.js";
|
|
23
24
|
import { Select } from "./select.js";
|
|
24
25
|
function selectLoadOptionsFor(loadOptions) {
|
|
25
26
|
if (!loadOptions) return void 0;
|
|
@@ -223,6 +224,11 @@ const InlinePicker = React.forwardRef(function InlinePicker2({
|
|
|
223
224
|
setOpenSuggest(true);
|
|
224
225
|
},
|
|
225
226
|
onFocus: () => setOpenSuggest(true),
|
|
227
|
+
onKeyDown: (event) => {
|
|
228
|
+
if (event.key !== "Enter" || isImeComposing(event)) return;
|
|
229
|
+
event.preventDefault();
|
|
230
|
+
if (!disabled) setDialogQuery(query);
|
|
231
|
+
},
|
|
226
232
|
className: "ui-record-picker-inline-input",
|
|
227
233
|
id,
|
|
228
234
|
"data-field": fieldName,
|
|
@@ -39,6 +39,8 @@ const Segmented = React.forwardRef(function Segmented2({
|
|
|
39
39
|
name,
|
|
40
40
|
id,
|
|
41
41
|
className,
|
|
42
|
+
"aria-label": ariaLabel,
|
|
43
|
+
"aria-labelledby": ariaLabelledBy,
|
|
42
44
|
...props
|
|
43
45
|
}, ref) {
|
|
44
46
|
return /* @__PURE__ */ jsx(
|
|
@@ -56,6 +58,8 @@ const Segmented = React.forwardRef(function Segmented2({
|
|
|
56
58
|
onChange: onValueChange,
|
|
57
59
|
isDisabled: disabled,
|
|
58
60
|
name,
|
|
61
|
+
"aria-labelledby": ariaLabelledBy,
|
|
62
|
+
"aria-label": ariaLabelledBy ? void 0 : ariaLabel,
|
|
59
63
|
...props,
|
|
60
64
|
children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
61
65
|
AriaRadio,
|
|
@@ -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.31.
|
|
3
|
+
"version": "31.31.2",
|
|
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/styles/layers.json
CHANGED
package/package.json
CHANGED
package/scripts/visual-audit.mjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* godxjp-ui VISUAL audit — the runtime counterpart to the static ui-audit.mjs. Static audit
|
|
4
4
|
* (ui-audit.mjs) reads SOURCE with regexes — zero deps, fast, runs on every save.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { realpathSync } from "node:fs";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
7
8
|
import {
|
|
8
9
|
VISUAL_RULES,
|
|
9
10
|
isOversaturated,
|
|
@@ -84,7 +85,7 @@ export function exitCodeFor(result, { strict = false } = {}) {
|
|
|
84
85
|
|
|
85
86
|
/** Collect raw measurements from the rendered page; the PURE rules run back in node. */
|
|
86
87
|
/* c8 ignore start — runs inside the browser, exercised in the consumer/CI env. */
|
|
87
|
-
function collectInPage() {
|
|
88
|
+
export function collectInPage() {
|
|
88
89
|
const rgb = (s) => {
|
|
89
90
|
const m = s && s.match(/rgba?\(([^)]+)\)/);
|
|
90
91
|
if (!m) return null;
|
|
@@ -178,6 +179,9 @@ function collectInPage() {
|
|
|
178
179
|
"[role=alert], [role=status], [data-slot=alert], [class*=banner], [class*=notification]",
|
|
179
180
|
)) {
|
|
180
181
|
if (!visible(el)) continue;
|
|
182
|
+
// The kit's EmptyState is a polite status region, not a banner: it has no Alert anatomy to get
|
|
183
|
+
// wrong, so the banner checks do not apply to it (gh#1198).
|
|
184
|
+
if (el.closest("[data-slot=empty-state]")) continue;
|
|
181
185
|
const box = el.getBoundingClientRect();
|
|
182
186
|
const icons = el.querySelectorAll("svg, img").length;
|
|
183
187
|
const btns = [...el.querySelectorAll("button, [role=button], a[href]")];
|
|
@@ -310,6 +314,15 @@ function collectInPage() {
|
|
|
310
314
|
if (!visible(t) || t.children.length) continue;
|
|
311
315
|
const cs = getComputedStyle(t);
|
|
312
316
|
if (cs.overflow !== "hidden" && cs.textOverflow !== "ellipsis") continue;
|
|
317
|
+
// Screen-reader-only text is clipped to 1px ON PURPOSE (a Button countLabel, a VisuallyHidden
|
|
318
|
+
// field label); it is not starved content (gh#1200). Skip it by class and by geometry, so any
|
|
319
|
+
// sr-only variant (absolute, at most 1×1) is covered.
|
|
320
|
+
const box = t.getBoundingClientRect();
|
|
321
|
+
if (
|
|
322
|
+
t.closest(".sr-only, [data-slot=visually-hidden]") ||
|
|
323
|
+
(cs.position === "absolute" && box.width <= 1 && box.height <= 1)
|
|
324
|
+
)
|
|
325
|
+
continue;
|
|
313
326
|
rowTexts.push({
|
|
314
327
|
text: (t.textContent || "").trim().slice(0, 30),
|
|
315
328
|
visible: Math.round(t.clientWidth),
|
|
@@ -558,9 +571,24 @@ async function main() {
|
|
|
558
571
|
}
|
|
559
572
|
/* c8 ignore stop */
|
|
560
573
|
|
|
574
|
+
/** True when `argvPath` (the script node was asked to run) is this module, symlinks resolved. */
|
|
575
|
+
export function isMainModule(argvPath, moduleUrl) {
|
|
576
|
+
const real = (p) => {
|
|
577
|
+
try {
|
|
578
|
+
return realpathSync(p);
|
|
579
|
+
} catch {
|
|
580
|
+
return p;
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
return real(argvPath) === real(fileURLToPath(moduleUrl));
|
|
584
|
+
}
|
|
585
|
+
|
|
561
586
|
// Run only as a CLI — importing this module (for unit tests) must NOT execute.
|
|
562
587
|
/* c8 ignore start */
|
|
563
|
-
|
|
588
|
+
// Compare REAL paths on both sides (gh#1198): through a symlinked node_modules, argv[1] is the
|
|
589
|
+
// link and import.meta.url the target, and a plain comparison skipped the audit and exited 0 — a
|
|
590
|
+
// silent no-op that reads exactly like a clean run.
|
|
591
|
+
if (process.argv[1] && isMainModule(process.argv[1], import.meta.url)) {
|
|
564
592
|
main().catch((e) => {
|
|
565
593
|
const asJson =
|
|
566
594
|
process.argv.indexOf("--format") !== -1 &&
|