@godxjp/ui 30.0.2 → 30.1.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.
@@ -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.0.2.** If the project you are editing has a different
6
+ **This catalog describes `@godxjp/ui` 30.1.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.
@@ -56,10 +56,10 @@ Then ask it: `search_components`, `get_component`, `get_tokens`, `get_rule`, `li
56
56
  its `importPath`, and its examples. Fetch only the handful you picked in step 1.
57
57
  3. `rules.json` — 50 cardinal rules. The ones about raw HTML and hardcoded colour are not
58
58
  style advice.
59
- 4. `tokens.json` — 2070 design tokens, each tagged with its `tier`. **If you were handed a
59
+ 4. `tokens.json` — 2071 design tokens, each tagged with its `tier`. **If you were handed a
60
60
  brand, read the 211 `foundation` entries first** — `--primary`, `--background`,
61
61
  `--radius`, `--font-size-base` are the handful everything else derives from. The
62
- 1756 `component` entries are per-part knobs; reach for one only when a role is
62
+ 1757 `component` entries are per-part knobs; reach for one only when a role is
63
63
  right everywhere except one component.
64
64
  5. `anti-ai-tells.json` — 26 shapes that make generated UI look generated, each with the
65
65
  fix. Read before you reach for a gradient hero or a wall of coloured chips.
@@ -145,7 +145,7 @@ has stopped following the brand.
145
145
  |---|---|---|---|
146
146
  | `foundation` | 211 | the seeds — `--primary`, `--background`, `--foreground`, `--radius`, `--font-size-base`, `--shadow-color`. Everything below is derived from these | **yes — this is the main road.** Handed a brand colour, this is where it goes: `:root { --primary: <H> <S>% <L>%; }` (HSL components, no `hsl()` wrapper) |
147
147
  | `semantic` | 103 | 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 |
148
- | `component` | 1756 | 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` |
148
+ | `component` | 1757 | 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` |
149
149
 
150
150
  A token whose `value` is `initial` is not empty and not broken: `initial` is the guaranteed-invalid
151
151
  value, so the real default is computed where the element paints it. Set it and yours wins.
package/agent/index.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "components": 171,
5
5
  "patterns": 20,
6
6
  "rules": 50,
7
- "tokens": 2070,
7
+ "tokens": 2071,
8
8
  "vocabulary": 14
9
9
  },
10
10
  "files": [
@@ -48,19 +48,19 @@
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.0.2/agent/index.json"
51
+ "pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v30.1.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",
55
55
  "tokenTiers": {
56
56
  "component": "per-part knobs, --{component}-{part}-{property}; usually leave these alone",
57
57
  "counts": {
58
- "component": 1756,
58
+ "component": 1757,
59
59
  "foundation": 211,
60
60
  "semantic": 103
61
61
  },
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.0.2"
65
+ "version": "30.1.0"
66
66
  }
package/agent/llms.txt CHANGED
@@ -1,10 +1,10 @@
1
1
  # @godxjp/ui
2
2
 
3
- > A Japanese-enterprise React design system: 171 components, 2070 design tokens,
4
- > 50 cardinal rules. This file is the entry point for AI agents. Catalog version 30.0.2.
3
+ > A Japanese-enterprise React design system: 171 components, 2071 design tokens,
4
+ > 50 cardinal rules. This file is the entry point for AI agents. Catalog version 30.1.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@30.0.2`). It is searchable and version-locked. These files exist for agents
7
+ (`npx @godxjp/ui-mcp@30.1.0`). It is searchable and version-locked. These files exist for agents
8
8
  that can only fetch URLs.
9
9
 
10
10
  ## Start
@@ -18,7 +18,7 @@ that can only fetch URLs.
18
18
  - [components-index.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components-index.json): 45 KB — all 171 components as name, group, tagline, plus `absorbed`: the names that do NOT exist and map to it (`Combobox` → `Select`).
19
19
  - [components/&lt;Name&gt;.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/components/Select.json): one file per component (1 KB–34 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
- - [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), 103 `semantic` roles, 1756 `component` knobs.
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), 103 `semantic` roles, 1757 `component` knobs.
22
22
  - [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.
23
23
  - [rules.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/rules.json): 50 cardinal rules.
24
24
  - [anti-ai-tells.json](https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/anti-ai-tells.json): 26 shapes that make generated UI look generated, each with its fix.
@@ -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.0.2/agent/...`. A catalog that does not match the installed
29
+ the tag: `.../godx-jp/godxjp-ui/v30.1.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.
package/agent/tokens.json CHANGED
@@ -10494,7 +10494,13 @@
10494
10494
  "value": "var(--space-2)"
10495
10495
  },
10496
10496
  {
10497
- "description": "ONE ACTIVE LOOK FOR BOTH NAV LEVELS (gh#651) — the label knob is `-foreground` at every depth. The defect: the two levels of one nav column signalled the same meaning in two colour languages. `.sb-nav-item[data-active=\"true\"]` painted `hsl(var(--accent))` + `hsl(var(-- foreground))` — neutral grey — while `.sb-nav-item--sub[data-active=\"true\"]` painted `hsl(var(--primary))`. A reader saw the open CHILD in the brand colour and its open PARENT in grey. Both defaults are now the brand, measured (see the ceiling note below and src/tokens/__tests__/sidebar-active-contrast.test.ts) — a DEFAULT change, not a hardcode: all four knobs still override. AND THE LABEL HAD TWO NAMES: `--sidebar-item-active-foreground` at level 1, `--sidebar-item-active-color` at level 2, each used exactly ONCE in shell-layout.css — naming drift, not two roles, so a service that wanted to tint the whole column had to discover both. `-color` is GONE with NO deprecation alias, which was the one judgement call here. Considered and rejected: `var(--sidebar-item-active-foreground, var(--sidebar-item-active-color, …))`. It would have kept the very ambiguity being removed (two names on one declaration, with the winner decided by which one a theme happened to set), and it is not buying compatibility for anyone — grepped before deleting: the old name had ZERO consumers outside its own call site. Not in docs/CUSTOMER-THEMING.md, not in a docs/ showcase, not pinned by a test, not in component-api-manifest.json; only the generated MCP catalog (regenerated from this file) and one historical CHANGELOG line, which stays true as history. `-tint` keeps its own name: it is the level-2 dot marker, a different part from the label. ROLE-MIRROR KNOBS — `initial` here with the role default at the CALL SITE, so a scoped `[data-tenant]` / `.dark` re-tint of `--primary` reaches them (a `:root` binding to a role var freezes at `:root` — docs/TOKENS.md · \"Role-mirror knobs MUST be `initial`\"). Defaults = a `--primary` tint fill · the primary ACTIVE tier as label · `hsl(var(--primary))` dot.",
10497
+ "description": "THE HOVER FILL, the pair to the active one below it (gh#909). `initial`, with `hsl(var(--accent))` resolved at the call site in shell-layout.css, so an unset knob paints exactly what shipped before and a scoped `--accent` re-tint still reaches it. It exists because a dark rail on a light app could theme every other role of the sidebar — surface, item ink, icon states, the active pair — and then hovered to the GLOBAL light `--accent`.",
10498
+ "name": "--sidebar-item-hover-background",
10499
+ "tier": "component",
10500
+ "value": "initial"
10501
+ },
10502
+ {
10503
+ "description": "Shell (sidebar / topbar / kbd) component tokens — small-by-design text knobs (rule #45/#46). A service re-tunes chrome text without moving the global scale.",
10498
10504
  "name": "--sidebar-item-active-background",
10499
10505
  "tier": "component",
10500
10506
  "value": "initial"
@@ -33,7 +33,7 @@ const buttonVariants = cva("ui-button", {
33
33
  // `dashed` is `outline` with a dashed edge, so it shares `--button-outline-background`
34
34
  // rather than growing a knob of its own (gh#880).
35
35
  dashed: "ui-button--dashed hover:bg-accent hover:text-accent-foreground",
36
- secondary: "ui-button--secondary text-secondary-foreground hover:bg-secondary/80",
36
+ secondary: "ui-button--secondary text-secondary-foreground",
37
37
  ghost: "ui-button--ghost hover:bg-accent hover:text-accent-foreground",
38
38
  // `text-primary` gone for the reason `bg-background` went in gh#880 and the checkbox's
39
39
  // `data-[state=checked]:bg-primary` went before it: a utility is layered AFTER components in
@@ -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.0.1",
3
+ "version": "30.0.3",
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.js CHANGED
@@ -118,11 +118,22 @@ function useScrollsOnAxis(ref, enabled, axis) {
118
118
  else setScrolls(next);
119
119
  };
120
120
  update(false);
121
- if (typeof ResizeObserver === "undefined") return void 0;
121
+ const onFonts = () => update(true);
122
+ let live = true;
123
+ document.fonts?.addEventListener?.("loadingdone", onFonts);
124
+ void document.fonts?.ready.then(() => {
125
+ if (live) update(true);
126
+ });
127
+ const stopFontWatch = () => {
128
+ live = false;
129
+ document.fonts?.removeEventListener?.("loadingdone", onFonts);
130
+ };
131
+ if (typeof ResizeObserver === "undefined") return stopFontWatch;
122
132
  const observer = new ResizeObserver(() => update(true));
123
133
  observer.observe(el);
124
134
  if (el.firstElementChild) observer.observe(el.firstElementChild);
125
135
  return () => {
136
+ stopFontWatch();
126
137
  observer.disconnect();
127
138
  };
128
139
  }, [ref, enabled, axis]);
@@ -198,7 +198,7 @@
198
198
  }
199
199
 
200
200
  .ui-button--secondary:hover {
201
- background: hsl(var(--secondary) / 0.8);
201
+ background: hsl(var(--secondary-hover) / var(--secondary-hover-alpha, 100%));
202
202
  }
203
203
 
204
204
  .ui-button--link {
@@ -1667,7 +1667,7 @@
1667
1667
  }
1668
1668
 
1669
1669
  .sb-nav-item:hover {
1670
- background: hsl(var(--accent));
1670
+ background: var(--sidebar-item-hover-background, hsl(var(--accent)));
1671
1671
  color: var(--sidebar-nav-item-hover-foreground, hsl(var(--foreground)));
1672
1672
  }
1673
1673
 
@@ -282,6 +282,7 @@
282
282
  --app-launcher-launchpad-title-letter-spacing: 0.08em;
283
283
  --app-launcher-launchpad-close-space-padding: var(--space-2);
284
284
 
285
+ --sidebar-item-hover-background: initial;
285
286
  --sidebar-item-active-background: initial;
286
287
 
287
288
  --sidebar-item-active-foreground: initial;
@@ -14,12 +14,12 @@ does the job. Ant Design states the same rule for the same reason — _"In most
14
14
  Tokens is sufficient for custom themes"_ — and the cost of skipping down a level is real, not
15
15
  stylistic.
16
16
 
17
- | level | what it is | when | what you give up by going lower |
18
- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------- |
19
- | **1 · seed** | `--primary`, `--radius`, `--font-size-base`, `--shadow-color` — the handful everything derives from. `pnpm gen:brand '#RRGGBB'` writes them for you | **almost always** | nothing — this is the main road |
20
- | **2 · role** | a named semantic token: `--text-link`, `--accent`, `--card-radius` | when the seed is right but ONE role must differ | that role stops following the seed; a later brand change will not move it |
21
- | **3 · scope** | the same token under `[data-tenant]` / `.dark` / any subtree | multi-tenant, or one region that differs | nothing extra, provided you set the token and not a literal |
22
- | **4 · instance** | a documented prop, or `style={{ "--x": … }}` on one element | this one element, this one time | it is invisible to every audit and every future theme |
17
+ | level | what it is | when | what you give up by going lower |
18
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- | ------------------------------------------------------------------------- |
19
+ | **1 · seed** | `--primary`, `--radius`, `--font-size-base`, `--shadow-color` — the handful everything derives from. `tenantTheme('#RRGGBB')` from `@godxjp/ui/app` returns them; `pnpm gen:brand` writes the same thing to a file **from a checkout of this repo** (it is not in the package) | **almost always** | nothing — this is the main road |
20
+ | **2 · role** | a named semantic token: `--text-link`, `--accent`, `--card-radius` | when the seed is right but ONE role must differ | that role stops following the seed; a later brand change will not move it |
21
+ | **3 · scope** | the same token under `[data-tenant]` / `.dark` / any subtree | multi-tenant, or one region that differs | nothing extra, provided you set the token and not a literal |
22
+ | **4 · instance** | a documented prop, or `style={{ "--x": … }}` on one element | this one element, this one time | it is invisible to every audit and every future theme |
23
23
 
24
24
  **Why the order matters more than the count of knobs.** Every level below the first is a value that
25
25
  has stopped being derived. A literal at level 4 is not "more control" — it is a pixel that has left
@@ -34,6 +34,20 @@ the knob is how the system absorbs the change; repeating the literal is how it d
34
34
 
35
35
  ## Start from one hex — `pnpm gen:brand`
36
36
 
37
+ > **This command runs from a checkout of `godxjp-ui`, not from the installed package** —
38
+ > `scripts/gen-brand.mjs` is not in the package `files` list, because it compiles the derivation out
39
+ > of `src/` at runtime. If you have only the dependency, use **`tenantTheme()`** (below) instead: it
40
+ > is the same arithmetic, it ships, and it returns the tokens at runtime rather than writing a file.
41
+ > Naming that here because this table used to call `gen:brand` "the main road" without saying which
42
+ > road you have to be standing on (gh#908).
43
+ >
44
+ > **And whichever you use, look at the LABEL it chose.** Both pick black or white from the fill's
45
+ > luminance, and every "label on fill" ratio is measured against that choice. A brand whose
46
+ > guidelines mandate a white label must say so — `--foreground '#ffffff'` for the generator, the
47
+ > `foreground` option for `tenantTheme()` — or it will read a passing report about a page it is not
48
+ > shipping. Measured: `#E8340D` reports **4.92:1** on the black label it picks and **4.27:1** on the
49
+ > white label a consumer actually shipped.
50
+
37
51
  Everything below this section is the manual route, and it is worth reading because it says what each
38
52
  role means. But the colour half of a brand file is mechanical, and two of its decisions are ones CSS
39
53
  cannot make at all, so there is a generator:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@godxjp/ui",
3
- "version": "30.0.2",
4
- "godxUiMcp": "30.0.2",
3
+ "version": "30.1.0",
4
+ "godxUiMcp": "30.1.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",