@godxjp/ui 30.4.0 → 30.4.1
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/components/SpaceCompact.json +1 -0
- package/agent/components.json +1 -0
- package/agent/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/dist/components/layout/space-compact.d.ts +23 -1
- package/dist/components/layout/space-compact.js +9 -1
- package/dist/contracts/measurement.json +1 -1
- package/dist/styles/layout.css +12 -9
- 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` 30.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 30.4.1.** 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.
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"DON'T reach for `className=\"rounded-none\"` / `[&>*:not(:first-child)]` utilities to join controls yourself — `ui-audit`'s `no-utility-layout` rule blocks exactly that, and it is precisely the corner-radius seam this component owns.",
|
|
51
51
|
"DO set `size` on each CHILD individually, not on SpaceCompact — the row has no size prop of its own by design (see `density`); every control already owns its own `size` axis (`xs|sm|md|lg`).",
|
|
52
52
|
"DO use `fullWidth` inside a narrow form card so the joined row spans the field column, exactly like a lone Input would.",
|
|
53
|
+
"`fullWidth` sets NO per-child flex ratio — same as antd, whose Space.Compact block style only stretches the ROW (`display: flex; width: 100%`), never the children. Two fields (NumberInput+Select, Input+Select) split the row evenly because both already default to their own full width; a Button beside a field keeps its own content width and the field absorbs the rest (Select+Button, Input+Button) — the same split you get outside SpaceCompact.",
|
|
53
54
|
"DON'T expect corner-radius welding on `orientation=\"vertical\"` yet — the shared border still collapses, but each child keeps all four of its own corners rounded until a block-axis radius knob exists on the Input/trigger families (documented gap, not a silent one)."
|
|
54
55
|
],
|
|
55
56
|
"useCases": [
|
package/agent/components.json
CHANGED
|
@@ -990,6 +990,7 @@
|
|
|
990
990
|
"DON'T reach for `className=\"rounded-none\"` / `[&>*:not(:first-child)]` utilities to join controls yourself — `ui-audit`'s `no-utility-layout` rule blocks exactly that, and it is precisely the corner-radius seam this component owns.",
|
|
991
991
|
"DO set `size` on each CHILD individually, not on SpaceCompact — the row has no size prop of its own by design (see `density`); every control already owns its own `size` axis (`xs|sm|md|lg`).",
|
|
992
992
|
"DO use `fullWidth` inside a narrow form card so the joined row spans the field column, exactly like a lone Input would.",
|
|
993
|
+
"`fullWidth` sets NO per-child flex ratio — same as antd, whose Space.Compact block style only stretches the ROW (`display: flex; width: 100%`), never the children. Two fields (NumberInput+Select, Input+Select) split the row evenly because both already default to their own full width; a Button beside a field keeps its own content width and the field absorbs the rest (Select+Button, Input+Button) — the same split you get outside SpaceCompact.",
|
|
993
994
|
"DON'T expect corner-radius welding on `orientation=\"vertical\"` yet — the shared border still collapses, but each child keeps all four of its own corners rounded until a block-axis radius knob exists on the Input/trigger families (documented gap, not a silent one)."
|
|
994
995
|
],
|
|
995
996
|
"useCases": [
|
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/v30.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v30.4.1/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": "30.
|
|
65
|
+
"version": "30.4.1"
|
|
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: 172 components, 2071 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 30.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 30.4.1.
|
|
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@30.
|
|
7
|
+
(`npx @godxjp/ui-mcp@30.4.1`). 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/v30.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v30.4.1/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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type JSX } from "react";
|
|
2
2
|
import type { SpaceCompactProp } from "../../props/components/layout.prop.js";
|
|
3
3
|
export type { SpaceCompactProp, SpaceCompactProp as SpaceCompactProps, } from "../../props/components/layout.prop.js";
|
|
4
4
|
/**
|
|
@@ -27,6 +27,28 @@ export type { SpaceCompactProp, SpaceCompactProp as SpaceCompactProps, } from ".
|
|
|
27
27
|
* to lose, so the promotion is unconditional here and the two agree on every case `Flex` still
|
|
28
28
|
* promotes.
|
|
29
29
|
*
|
|
30
|
+
* ## ONE WRAPPER PER CHILD, and why removing it re-breaks the headline case (gh#919)
|
|
31
|
+
*
|
|
32
|
+
* Every rule in `src/styles/layout.css` — the `flex` basis, the negative seam margin, the
|
|
33
|
+
* `position: relative` + `z-index` raise, and the `:not(:first-child)`/`:not(:last-child)` corner
|
|
34
|
+
* zeroing — used to key on `> *`, the DIRECT ELEMENT children. That silently assumed one child
|
|
35
|
+
* element == one flex item, and `Select` breaks the assumption on purpose: `.ui-select-root` is
|
|
36
|
+
* `display: contents` (`src/styles/control.css`) precisely so the TRIGGER is the box a flex row
|
|
37
|
+
* sees, and react-aria renders a `<template>` beside it. So `> *` matched a root that generates no
|
|
38
|
+
* box at all — flex, margin, position and z-index all landed on nothing, the trigger inherited
|
|
39
|
+
* none of them and kept its own `w-full`, and the `<template>` shifted first/last-child by one.
|
|
40
|
+
* Measured by the guinea-pig consumer on `NumberInput` + `Select`, the pattern in this component's
|
|
41
|
+
* own catalog entry: trigger 562px (the whole row), spinbutton 54px with its step buttons pushed
|
|
42
|
+
* outside the box.
|
|
43
|
+
*
|
|
44
|
+
* Wrapping each child in a box this component owns makes "one child, one flex item" true no matter
|
|
45
|
+
* what the child renders, which is the property every one of those rules needed in the first place.
|
|
46
|
+
* The radius knobs still reach the control because custom properties inherit — through the wrapper
|
|
47
|
+
* and through `display: contents` alike. antd solves the same problem the other way, by passing
|
|
48
|
+
* position down `SpaceCompactItemContext` for each child to apply to its own root; that needs every
|
|
49
|
+
* control to participate, which is the port `docs/roadmap/parity-audit-layout-navigation-general.md`
|
|
50
|
+
* §4.2 records as not done.
|
|
51
|
+
*
|
|
30
52
|
* ## `orientation="vertical"` — a written-down partial port
|
|
31
53
|
*
|
|
32
54
|
* Layout (column stacking, border collapse) works on both axes. Corner-zeroing currently only
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Children } from "react";
|
|
3
4
|
import { mergeAriaIds } from "../../lib/field-a11y.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
function SpaceCompact({
|
|
@@ -34,7 +35,14 @@ function SpaceCompact({
|
|
|
34
35
|
"data-full-width": fullWidth ? "true" : void 0,
|
|
35
36
|
className: cn("ui-space-compact", density && `ui-density-${density}`, className),
|
|
36
37
|
...domProps,
|
|
37
|
-
children
|
|
38
|
+
children: Children.toArray(children).map((child, index) => /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "space-compact-item",
|
|
42
|
+
children: child
|
|
43
|
+
},
|
|
44
|
+
index
|
|
45
|
+
))
|
|
38
46
|
}
|
|
39
47
|
);
|
|
40
48
|
}
|
|
@@ -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": "30.
|
|
3
|
+
"version": "30.4.1",
|
|
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/layout.css
CHANGED
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
inline-size: 100%;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.ui-space-compact[data-full-width="true"] >
|
|
136
|
+
.ui-space-compact[data-full-width="true"] > [data-slot="space-compact-item"] {
|
|
137
137
|
flex: 1 1 0%;
|
|
138
138
|
min-inline-size: 0;
|
|
139
139
|
}
|
|
@@ -142,34 +142,37 @@
|
|
|
142
142
|
flex-direction: column;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
.ui-space-compact[data-orientation="vertical"][data-full-width="true"] >
|
|
145
|
+
.ui-space-compact[data-orientation="vertical"][data-full-width="true"] > [data-slot="space-compact-item"] {
|
|
146
146
|
min-inline-size: auto;
|
|
147
147
|
min-block-size: 0;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
.ui-space-compact[data-orientation="horizontal"] >
|
|
150
|
+
.ui-space-compact[data-orientation="horizontal"] > [data-slot="space-compact-item"] + [data-slot="space-compact-item"] {
|
|
151
151
|
margin-inline-start: calc(var(--control-border-width, var(--stroke-hairline)) * -1);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.ui-space-compact[data-orientation="vertical"] >
|
|
154
|
+
.ui-space-compact[data-orientation="vertical"] > [data-slot="space-compact-item"] + [data-slot="space-compact-item"] {
|
|
155
155
|
margin-block-start: calc(var(--control-border-width, var(--stroke-hairline)) * -1);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
.ui-space-compact >
|
|
158
|
+
.ui-space-compact > [data-slot="space-compact-item"] {
|
|
159
|
+
|
|
160
|
+
display: flex;
|
|
159
161
|
position: relative;
|
|
162
|
+
min-inline-size: 0;
|
|
160
163
|
}
|
|
161
164
|
|
|
162
|
-
.ui-space-compact >
|
|
163
|
-
.ui-space-compact >
|
|
165
|
+
.ui-space-compact > [data-slot="space-compact-item"]:hover,
|
|
166
|
+
.ui-space-compact > [data-slot="space-compact-item"]:focus-within {
|
|
164
167
|
z-index: 1;
|
|
165
168
|
}
|
|
166
169
|
|
|
167
|
-
.ui-space-compact[data-orientation="horizontal"] >
|
|
170
|
+
.ui-space-compact[data-orientation="horizontal"] > [data-slot="space-compact-item"]:not(:first-child) {
|
|
168
171
|
--input-radius-start: 0;
|
|
169
172
|
--control-trigger-radius-start: 0;
|
|
170
173
|
}
|
|
171
174
|
|
|
172
|
-
.ui-space-compact[data-orientation="horizontal"] >
|
|
175
|
+
.ui-space-compact[data-orientation="horizontal"] > [data-slot="space-compact-item"]:not(:last-child) {
|
|
173
176
|
--input-radius-end: 0;
|
|
174
177
|
--control-trigger-radius-end: 0;
|
|
175
178
|
}
|