@godxjp/ui 31.0.4 → 31.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.
- package/agent/START-HERE.md +1 -1
- package/agent/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/dist/components/charts/chart-cartesian.d.ts +2 -1
- package/dist/components/charts/chart-cartesian.js +14 -4
- package/dist/contracts/measurement.json +1 -1
- package/dist/props/components/charts.prop.d.ts +8 -0
- package/dist/styles/chart-layout.css +4 -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.0
|
|
6
|
+
**This catalog describes `@godxjp/ui` 31.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.
|
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.0
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v31.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",
|
|
@@ -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.0
|
|
65
|
+
"version": "31.1.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: 175 components, 2074 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.0.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 31.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@31.0
|
|
7
|
+
(`npx @godxjp/ui-mcp@31.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
|
|
@@ -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.0
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v31.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.
|
|
@@ -21,6 +21,7 @@ type CartesianChartProps = {
|
|
|
21
21
|
valueTicks?: number[];
|
|
22
22
|
numberFormat?: Intl.NumberFormatOptions;
|
|
23
23
|
emptyMessage?: string;
|
|
24
|
+
onCategoryClick?: (datum: ChartDatum, index: number) => void;
|
|
24
25
|
className?: string;
|
|
25
26
|
id?: string;
|
|
26
27
|
/** line/area */
|
|
@@ -32,5 +33,5 @@ type CartesianChartProps = {
|
|
|
32
33
|
/** bar */
|
|
33
34
|
horizontal?: boolean;
|
|
34
35
|
};
|
|
35
|
-
export declare function CartesianChart({ kind, data, series, categoryKey, label, showCaption, description, size, height, showLegend, showGrid, valueDomain, valueTicks, numberFormat, emptyMessage, className, id, curved, showDots, stacked, horizontal, }: CartesianChartProps): React.JSX.Element;
|
|
36
|
+
export declare function CartesianChart({ kind, data, series, categoryKey, label, showCaption, description, size, height, showLegend, showGrid, valueDomain, valueTicks, numberFormat, emptyMessage, onCategoryClick, className, id, curved, showDots, stacked, horizontal, }: CartesianChartProps): React.JSX.Element;
|
|
36
37
|
export {};
|
|
@@ -39,6 +39,7 @@ function CartesianChart({
|
|
|
39
39
|
valueTicks,
|
|
40
40
|
numberFormat,
|
|
41
41
|
emptyMessage,
|
|
42
|
+
onCategoryClick,
|
|
42
43
|
className,
|
|
43
44
|
id,
|
|
44
45
|
curved = false,
|
|
@@ -151,9 +152,16 @@ function CartesianChart({
|
|
|
151
152
|
/* @__PURE__ */ jsx(Tooltip, { formatter: (value) => fmt.format(Number(value)) }),
|
|
152
153
|
showLegend ? /* @__PURE__ */ jsx(Legend, {}) : null
|
|
153
154
|
] });
|
|
155
|
+
const pickCategory = (raw) => {
|
|
156
|
+
const index = raw === null || raw === void 0 || raw === "" ? NaN : Number(raw);
|
|
157
|
+
if (onCategoryClick && Number.isInteger(index) && data[index])
|
|
158
|
+
onCategoryClick(data[index], index);
|
|
159
|
+
};
|
|
160
|
+
const onChartClick = onCategoryClick ? (state) => pickCategory(state?.activeTooltipIndex) : void 0;
|
|
161
|
+
const onBarClick = onCategoryClick ? (_entry, index) => pickCategory(index) : void 0;
|
|
154
162
|
const chart = () => {
|
|
155
163
|
if (kind === "line") {
|
|
156
|
-
return /* @__PURE__ */ jsxs(RLineChart, { data, children: [
|
|
164
|
+
return /* @__PURE__ */ jsxs(RLineChart, { data, onClick: onChartClick, children: [
|
|
157
165
|
axes(true),
|
|
158
166
|
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
159
167
|
Line,
|
|
@@ -169,7 +177,7 @@ function CartesianChart({
|
|
|
169
177
|
] });
|
|
170
178
|
}
|
|
171
179
|
if (kind === "area") {
|
|
172
|
-
return /* @__PURE__ */ jsxs(RAreaChart, { data, children: [
|
|
180
|
+
return /* @__PURE__ */ jsxs(RAreaChart, { data, onClick: onChartClick, children: [
|
|
173
181
|
axes(true),
|
|
174
182
|
series.map((s, i) => /* @__PURE__ */ jsx(
|
|
175
183
|
Area,
|
|
@@ -195,7 +203,9 @@ function CartesianChart({
|
|
|
195
203
|
name: s.label ?? s.dataKey,
|
|
196
204
|
stackId: stacked ? "stack" : void 0,
|
|
197
205
|
fill: chartColor(i, s.color),
|
|
198
|
-
radius: 2
|
|
206
|
+
radius: 2,
|
|
207
|
+
onClick: onBarClick,
|
|
208
|
+
background: onCategoryClick ? { fill: "transparent" } : void 0
|
|
199
209
|
},
|
|
200
210
|
s.dataKey
|
|
201
211
|
))
|
|
@@ -211,7 +221,7 @@ function CartesianChart({
|
|
|
211
221
|
imgSummary: summary.img,
|
|
212
222
|
hasData,
|
|
213
223
|
height: resolvedHeight,
|
|
214
|
-
className,
|
|
224
|
+
className: cn(onCategoryClick && "ui-chart-clickable", className),
|
|
215
225
|
id,
|
|
216
226
|
canvasRef,
|
|
217
227
|
canvasExtra: measuresCategoryAxis ? (
|
|
@@ -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.0
|
|
3
|
+
"version": "31.1.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,
|
|
@@ -69,6 +69,14 @@ type ChartCartesianBase = {
|
|
|
69
69
|
numberFormat?: Intl.NumberFormatOptions;
|
|
70
70
|
/** Message shown when `data` is empty. Defaults to a localized "no data". */
|
|
71
71
|
emptyMessage?: EmptyMessageProp;
|
|
72
|
+
/**
|
|
73
|
+
* Called with the clicked category's datum and its index — drill-down, zoom-to-bucket. The whole
|
|
74
|
+
* category column is the target, not only the mark, so a zero-height bar is still clickable.
|
|
75
|
+
*
|
|
76
|
+
* A POINTER SHORTCUT, not the only way in: the plot is `role="img"`, which has no keyboard
|
|
77
|
+
* interaction, so the screen must offer the same action through a real control as well.
|
|
78
|
+
*/
|
|
79
|
+
onCategoryClick?: (datum: ChartDatum, index: number) => void;
|
|
72
80
|
className?: ClassNameProp;
|
|
73
81
|
id?: IdProp;
|
|
74
82
|
};
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
min-inline-size: 0;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.ui-chart-clickable .recharts-surface {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
23
27
|
.ui-chart .recharts-text,
|
|
24
28
|
.ui-chart .recharts-legend-item-text {
|
|
25
29
|
font-size: var(--font-size-xs, calc(var(--font-size-base) / var(--font-size-ratio)));
|
package/dist/styles/layers.json
CHANGED