@nadicodeai/ui 12.1.218 → 12.1.220

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/AGENTS.md CHANGED
@@ -38,7 +38,12 @@ draws it for all of them, never in `DESIGN.md`
38
38
  and committed, which the owner and the reviewers see before and after in the
39
39
  diff. The pictures run only with `APPEARANCE_PICTURES=1`, which `test:visual`
40
40
  hashes: the `ui visual` lane, post-merge's `test (website)` job and that
41
- script set it, and a run without it skips them.
41
+ script set it, and a run without it skips them. One browser draws them:
42
+ Playwright's official image at the lockfile's Playwright, which
43
+ `tests/visual/appearance-browser.ts` starts wherever a Docker daemon answers.
44
+ A Vercel Sandbox and the post-merge runner run no Docker and draw as the
45
+ image does with their own Chromium; `APPEARANCE_PINNED=1`, which an orb's
46
+ pre-push and the script set, refuses that fallback.
42
47
  - **Elements.** An app whose pages must reach an element through a shared
43
48
  component sets `jsxImportSource` to `#jsx`, a module of its own that types the
44
49
  intrinsic elements without it, so a raw `<table>` or `<h1>` on a page is a
@@ -9,6 +9,6 @@ import { type ChartCardProps } from "./chart-card.js";
9
9
  * @words Series named for what the person buys: "Included usage", "Extra usage". Axis scale in M; the tooltip prints the exact token count.
10
10
  * @access Named by its title. A delta that is neither good nor bad, like volume, takes the neutral tone.
11
11
  */
12
- declare function ChartAreaStacked({ title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, series, entityColorMap, valueFormatter, axisFormatter, otherLabel, emptyState, size, className, }: ChartCardProps): import("react").JSX.Element;
12
+ declare function ChartAreaStacked({ title, period, controls, link, summary, aside, footer, headingLevel, daily, split, data, xKey, series, entityColorMap, valueFormatter, axisFormatter, otherLabel, emptyState, size, className, }: ChartCardProps): import("react").JSX.Element;
13
13
  export { ChartAreaStacked };
14
14
  //# sourceMappingURL=chart-area-stacked.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-area-stacked.d.ts","sourceRoot":"","sources":["../../src/components/chart-area-stacked.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;GASG;AACH,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,cAAc,EACd,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,UAAU,EACV,IAAgB,EAChB,SAAS,GACV,EAAE,cAAc,+BAiFhB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"chart-area-stacked.d.ts","sourceRoot":"","sources":["../../src/components/chart-area-stacked.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;GASG;AACH,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,KAAa,EACb,KAAa,EACb,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,cAAc,EACd,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,UAAU,EACV,IAAgB,EAChB,SAAS,GACV,EAAE,cAAc,+BAmFhB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -4,8 +4,8 @@
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { Area, AreaChart, CartesianGrid, XAxis, YAxis } from "recharts";
6
6
  import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "./chart.js";
7
- import { CHART_X_AXIS_TICKS, CHART_Y_AXIS_TICK_COUNT, niceAxisTicks, stackedAxisMax, } from "./chart-axis.js";
8
- import { CHART_LEGEND_CLASS, ChartCard, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, } from "./chart-card.js";
7
+ import { CHART_Y_AXIS_TICK_COUNT, niceAxisTicks, periodAxisTicks, stackedAxisMax, } from "./chart-axis.js";
8
+ import { CHART_LEGEND_CLASS, ChartCard, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, legendNamesSeries, } from "./chart-card.js";
9
9
  import { entityColor } from "./chart-entity-colors.js";
10
10
  /**
11
11
  * A continuous volume building up over time, as stacked areas.
@@ -17,18 +17,18 @@ import { entityColor } from "./chart-entity-colors.js";
17
17
  * @words Series named for what the person buys: "Included usage", "Extra usage". Axis scale in M; the tooltip prints the exact token count.
18
18
  * @access Named by its title. A delta that is neither good nor bad, like volume, takes the neutral tone.
19
19
  */
20
- function ChartAreaStacked({ title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, series, entityColorMap, valueFormatter = defaultValueFormatter, axisFormatter, otherLabel, emptyState, size = "default", className, }) {
20
+ function ChartAreaStacked({ title, period, controls, link, summary, aside, footer, headingLevel, daily = false, split = false, data, xKey, series, entityColorMap, valueFormatter = defaultValueFormatter, axisFormatter, otherLabel, emptyState, size = "default", className, }) {
21
21
  const folded = foldOtherSeries(series, data, entityColorMap, otherLabel);
22
22
  const chartConfig = chartSeriesConfig(folded.series, entityColorMap);
23
23
  const domainMax = stackedAxisMax(folded.data, folded.series.map((entry) => entry.id));
24
24
  return (_jsx(ChartCard, { title: title, period: period, controls: controls, ...(link ? { link } : {}), summary: summary, aside: aside, ...(footer ? { footer } : {}), ...(headingLevel ? { headingLevel } : {}), className: className, children: (titleId) => emptyState && data.length === 0 ? (emptyState) : (_jsx(ChartContainer, { config: chartConfig, className: chartPlotClassName(size), children: _jsxs(AreaChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, margin: {
25
25
  left: 12,
26
26
  right: 12,
27
- }, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, axisLine: false, tickMargin: 8, ...CHART_X_AXIS_TICKS }), _jsx(YAxis, { width: "auto", tickLine: false, axisLine: false, tickMargin: 8, tickCount: CHART_Y_AXIS_TICK_COUNT, ...(domainMax === undefined
27
+ }, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, axisLine: false, tickMargin: 8, ...periodAxisTicks(folded.data, xKey, daily) }), _jsx(YAxis, { width: "auto", tickLine: false, axisLine: false, tickMargin: 8, tickCount: CHART_Y_AXIS_TICK_COUNT, ...(domainMax === undefined
28
28
  ? {}
29
29
  : {
30
30
  domain: [0, domainMax],
31
31
  ticks: niceAxisTicks(domainMax),
32
- }), tickFormatter: (value) => (axisFormatter ?? valueFormatter)(Number(value)) }), _jsx(ChartTooltip, { cursor: false, content: _jsx(ChartTooltipContent, { indicator: "line", valueFormatter: valueFormatter }) }), _jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) }), folded.series.map((entry) => (_jsx(Area, { dataKey: entry.id, type: "natural", fill: entityColor(entityColorMap, entry.id), fillOpacity: 0.4, stroke: entityColor(entityColorMap, entry.id), stackId: "a" }, entry.id)))] }) })) }));
32
+ }), tickFormatter: (value) => (axisFormatter ?? valueFormatter)(Number(value)) }), _jsx(ChartTooltip, { cursor: false, content: _jsx(ChartTooltipContent, { indicator: "line", valueFormatter: valueFormatter }) }), legendNamesSeries(folded.series, split) ? (_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) })) : null, folded.series.map((entry) => (_jsx(Area, { dataKey: entry.id, type: "natural", fill: entityColor(entityColorMap, entry.id), fillOpacity: 0.4, stroke: entityColor(entityColorMap, entry.id), stackId: "a" }, entry.id)))] }) })) }));
33
33
  }
34
34
  export { ChartAreaStacked };
@@ -8,18 +8,26 @@
8
8
  * y axis of five ticks whose maximum is rounded up to a step a reader counts
9
9
  * in: 1, 2, 2.5, 5 or 10 per order of magnitude.
10
10
  */
11
+ type AxisDatum = Record<string, number | string>;
11
12
  /**
12
- * The category axis labels every Nth period from the first, the same N across
13
- * the plot: every second day where the labels fit, as OpenRouter's daily charts
14
- * do, and every third or fourth in a half-width card. Recharts' default fits
15
- * labels by their own widths, so a short "Oct 1" squeezed in beside "Oct 2"
16
- * while "Sep 30" was dropped. Anchoring the step on the latest period instead
17
- * left a half-width chart with that one label, cut by the card's edge, because
13
+ * The period axis labels every Nth period from the first, the same N across
14
+ * the plot, the smallest N whose labels fit. Recharts' default fits labels by
15
+ * their own widths, so a short "Oct 1" squeezed in beside "Oct 2" while
16
+ * "Sep 30" was dropped. Anchoring the step on the latest period instead left a
17
+ * half-width chart with that one label, cut by the card's edge, because
18
18
  * Recharts always draws the anchor and the latest label overflows the plot.
19
+ *
20
+ * A daily axis offers only every second day from the first, as OpenRouter's
21
+ * daily charts label theirs, so a week whose seven labels fit still reads
22
+ * every second day, and a half-width card thins those to every fourth or sixth.
19
23
  */
20
- declare const CHART_X_AXIS_TICKS: {
24
+ declare function periodAxisTicks(data: readonly AxisDatum[], xKey: string, daily: boolean): {
21
25
  readonly interval: "equidistantPreserveStart";
22
26
  readonly minTickGap: 12;
27
+ } | {
28
+ ticks: (string | number)[];
29
+ interval: "equidistantPreserveStart";
30
+ minTickGap: 12;
23
31
  };
24
32
  /** Ticks the y axis draws, ends included. */
25
33
  declare const CHART_Y_AXIS_TICK_COUNT = 5;
@@ -37,7 +45,6 @@ declare function niceAxisMax(max: number): number | undefined;
37
45
  * unrounded position (a tick at 6.67 reading "$6").
38
46
  */
39
47
  declare function niceAxisTicks(max: number | undefined): number[] | undefined;
40
- type AxisDatum = Record<string, number | string>;
41
48
  /** The tallest stacked column across the data, as a nice axis maximum. */
42
49
  declare function stackedAxisMax(data: readonly AxisDatum[], keys: readonly string[]): number | undefined;
43
50
  /**
@@ -47,5 +54,5 @@ declare function stackedAxisMax(data: readonly AxisDatum[], keys: readonly strin
47
54
  * a zero-based one.
48
55
  */
49
56
  declare function seriesAxisMax(data: readonly AxisDatum[], keys: readonly string[]): number | undefined;
50
- export { CHART_X_AXIS_TICKS, CHART_Y_AXIS_TICK_COUNT, niceAxisMax, niceAxisTicks, niceStep, seriesAxisMax, stackedAxisMax, };
57
+ export { CHART_Y_AXIS_TICK_COUNT, niceAxisMax, niceAxisTicks, niceStep, periodAxisTicks, seriesAxisMax, stackedAxisMax, };
51
58
  //# sourceMappingURL=chart-axis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-axis.d.ts","sourceRoot":"","sources":["../../src/components/chart-axis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,QAAA,MAAM,kBAAkB;;;CAAoE,CAAC;AAE7F,6CAA6C;AAC7C,QAAA,MAAM,uBAAuB,IAAI,CAAC;AAKlC,iBAAS,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMzC;AAED;;;;GAIG;AACH,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIpD;AAED;;;;;GAKG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAOpE;AAED,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEjD,0EAA0E;AAC1E,iBAAS,cAAc,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAW/F;AAED;;;;;GAKG;AACH,iBAAS,aAAa,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAW9F;AAED,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,aAAa,EACb,cAAc,GACf,CAAC"}
1
+ {"version":3,"file":"chart-axis.d.ts","sourceRoot":"","sources":["../../src/components/chart-axis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,iBAAS,eAAe,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;;;;;;;EAQhF;AAED,6CAA6C;AAC7C,QAAA,MAAM,uBAAuB,IAAI,CAAC;AAKlC,iBAAS,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMzC;AAED;;;;GAIG;AACH,iBAAS,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIpD;AAED;;;;;GAKG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAOpE;AAED,0EAA0E;AAC1E,iBAAS,cAAc,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAW/F;AAED;;;;;GAKG;AACH,iBAAS,aAAa,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAW9F;AAED,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,GACf,CAAC"}
@@ -9,15 +9,27 @@
9
9
  * in: 1, 2, 2.5, 5 or 10 per order of magnitude.
10
10
  */
11
11
  /**
12
- * The category axis labels every Nth period from the first, the same N across
13
- * the plot: every second day where the labels fit, as OpenRouter's daily charts
14
- * do, and every third or fourth in a half-width card. Recharts' default fits
15
- * labels by their own widths, so a short "Oct 1" squeezed in beside "Oct 2"
16
- * while "Sep 30" was dropped. Anchoring the step on the latest period instead
17
- * left a half-width chart with that one label, cut by the card's edge, because
12
+ * The period axis labels every Nth period from the first, the same N across
13
+ * the plot, the smallest N whose labels fit. Recharts' default fits labels by
14
+ * their own widths, so a short "Oct 1" squeezed in beside "Oct 2" while
15
+ * "Sep 30" was dropped. Anchoring the step on the latest period instead left a
16
+ * half-width chart with that one label, cut by the card's edge, because
18
17
  * Recharts always draws the anchor and the latest label overflows the plot.
18
+ *
19
+ * A daily axis offers only every second day from the first, as OpenRouter's
20
+ * daily charts label theirs, so a week whose seven labels fit still reads
21
+ * every second day, and a half-width card thins those to every fourth or sixth.
19
22
  */
20
- const CHART_X_AXIS_TICKS = { interval: "equidistantPreserveStart", minTickGap: 12 };
23
+ function periodAxisTicks(data, xKey, daily) {
24
+ const fitted = { interval: "equidistantPreserveStart", minTickGap: 12 };
25
+ if (!daily)
26
+ return fitted;
27
+ const everySecondDay = data.flatMap((datum, index) => {
28
+ const day = datum[xKey];
29
+ return index % 2 === 0 && day !== undefined ? [day] : [];
30
+ });
31
+ return { ...fitted, ticks: everySecondDay };
32
+ }
21
33
  /** Ticks the y axis draws, ends included. */
22
34
  const CHART_Y_AXIS_TICK_COUNT = 5;
23
35
  /** The steps a reader counts in, per order of magnitude. */
@@ -90,4 +102,4 @@ function seriesAxisMax(data, keys) {
90
102
  }
91
103
  return niceAxisMax(max);
92
104
  }
93
- export { CHART_X_AXIS_TICKS, CHART_Y_AXIS_TICK_COUNT, niceAxisMax, niceAxisTicks, niceStep, seriesAxisMax, stackedAxisMax, };
105
+ export { CHART_Y_AXIS_TICK_COUNT, niceAxisMax, niceAxisTicks, niceStep, periodAxisTicks, seriesAxisMax, stackedAxisMax, };
@@ -13,7 +13,7 @@ declare function signedAxis(data: readonly Record<string, number | string>[], va
13
13
  * @words The money unit in the period or the axis. Losses stay negative, written with a true minus: −€360.
14
14
  * @access Each bar's sign is in its position and its tooltip, never only its colour. Category labels are text, readable without hue: the axis is as wide as the longest label up to 128 px, a longer one wraps to a second line where its row holds two lines and is cut with an ellipsis past what its lines hold, whole in the tooltip, so no label runs into its neighbour.
15
15
  */
16
- declare function ChartBarHorizontal({ title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, valueKey, displayKey, categoryDisplayKey, positiveLabel, negativeLabel, valueFormatter, axisFormatter, emptyState, size, className, }: Omit<ChartCardProps, "series" | "entityColorMap" | "otherLabel"> & {
16
+ declare function ChartBarHorizontal({ title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, valueKey, displayKey, categoryDisplayKey, positiveLabel, negativeLabel, valueFormatter, axisFormatter, emptyState, size, className, }: Omit<ChartCardProps, "series" | "split" | "entityColorMap" | "otherLabel" | "daily"> & {
17
17
  valueKey: string;
18
18
  displayKey?: string;
19
19
  categoryDisplayKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"chart-bar-horizontal.d.ts","sourceRoot":"","sources":["../../src/components/chart-bar-horizontal.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AA8CjC,iBAAS,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM;;;EAoCrF;AAyCD;;;;;;;;;GASG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,IAAgB,EAChB,SAAS,GACV,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,gBAAgB,GAAG,YAAY,CAAC,GAAG;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,+BA+FA;AAED,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"chart-bar-horizontal.d.ts","sourceRoot":"","sources":["../../src/components/chart-bar-horizontal.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AA8CjC,iBAAS,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM;;;EAoCrF;AAyCD;;;;;;;;;GASG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,IAAgB,EAChB,SAAS,GACV,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,OAAO,GAAG,gBAAgB,GAAG,YAAY,GAAG,OAAO,CAAC,GAAG;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,+BA+FA;AAED,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC"}
@@ -9,6 +9,6 @@ import { type ChartCardProps } from "./chart-card.js";
9
9
  * @words Series named in full: "Monthly recurring revenue", "Model cost". Months as short names on the axis, the full month in the tooltip.
10
10
  * @access The plot is named by its title; each bar's figure is in the tooltip and, where the page needs it, a table.
11
11
  */
12
- declare function ChartBarMultiple({ title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, series, entityColorMap, valueFormatter, axisFormatter, otherLabel, emptyState, size, className, }: ChartCardProps): import("react").JSX.Element;
12
+ declare function ChartBarMultiple({ title, period, controls, link, summary, aside, footer, headingLevel, daily, split, data, xKey, series, entityColorMap, valueFormatter, axisFormatter, otherLabel, emptyState, size, className, }: ChartCardProps): import("react").JSX.Element;
13
13
  export { ChartBarMultiple };
14
14
  //# sourceMappingURL=chart-bar-multiple.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-bar-multiple.d.ts","sourceRoot":"","sources":["../../src/components/chart-bar-multiple.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;GASG;AACH,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,cAAc,EACd,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,UAAU,EACV,IAAgB,EAChB,SAAS,GACV,EAAE,cAAc,+BAuEhB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"chart-bar-multiple.d.ts","sourceRoot":"","sources":["../../src/components/chart-bar-multiple.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;;;GASG;AACH,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,KAAa,EACb,KAAa,EACb,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,cAAc,EACd,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,UAAU,EACV,IAAgB,EAChB,SAAS,GACV,EAAE,cAAc,+BAyEhB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -4,8 +4,8 @@
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { Bar, BarChart, CartesianGrid, XAxis, YAxis } from "recharts";
6
6
  import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "./chart.js";
7
- import { CHART_X_AXIS_TICKS, CHART_Y_AXIS_TICK_COUNT, niceAxisTicks, seriesAxisMax, } from "./chart-axis.js";
8
- import { CHART_LEGEND_CLASS, ChartCard, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, } from "./chart-card.js";
7
+ import { CHART_Y_AXIS_TICK_COUNT, niceAxisTicks, periodAxisTicks, seriesAxisMax, } from "./chart-axis.js";
8
+ import { CHART_LEGEND_CLASS, ChartCard, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, legendNamesSeries, } from "./chart-card.js";
9
9
  import { entityColor } from "./chart-entity-colors.js";
10
10
  /**
11
11
  * Grouped bars: two or more measures side by side per period, on one axis in one unit.
@@ -17,15 +17,15 @@ import { entityColor } from "./chart-entity-colors.js";
17
17
  * @words Series named in full: "Monthly recurring revenue", "Model cost". Months as short names on the axis, the full month in the tooltip.
18
18
  * @access The plot is named by its title; each bar's figure is in the tooltip and, where the page needs it, a table.
19
19
  */
20
- function ChartBarMultiple({ title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, series, entityColorMap, valueFormatter = defaultValueFormatter, axisFormatter, otherLabel, emptyState, size = "default", className, }) {
20
+ function ChartBarMultiple({ title, period, controls, link, summary, aside, footer, headingLevel, daily = false, split = false, data, xKey, series, entityColorMap, valueFormatter = defaultValueFormatter, axisFormatter, otherLabel, emptyState, size = "default", className, }) {
21
21
  const folded = foldOtherSeries(series, data, entityColorMap, otherLabel);
22
22
  const chartConfig = chartSeriesConfig(folded.series, entityColorMap);
23
23
  const domainMax = seriesAxisMax(folded.data, folded.series.map((entry) => entry.id));
24
- return (_jsx(ChartCard, { title: title, period: period, controls: controls, ...(link ? { link } : {}), summary: summary, aside: aside, ...(footer ? { footer } : {}), ...(headingLevel ? { headingLevel } : {}), className: className, children: (titleId) => emptyState && data.length === 0 ? (emptyState) : (_jsx(ChartContainer, { config: chartConfig, className: chartPlotClassName(size), children: _jsxs(BarChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, tickMargin: 10, axisLine: false, ...CHART_X_AXIS_TICKS }), _jsx(YAxis, { width: "auto", tickLine: false, axisLine: false, tickMargin: 8, tickCount: CHART_Y_AXIS_TICK_COUNT, ...(domainMax === undefined
24
+ return (_jsx(ChartCard, { title: title, period: period, controls: controls, ...(link ? { link } : {}), summary: summary, aside: aside, ...(footer ? { footer } : {}), ...(headingLevel ? { headingLevel } : {}), className: className, children: (titleId) => emptyState && data.length === 0 ? (emptyState) : (_jsx(ChartContainer, { config: chartConfig, className: chartPlotClassName(size), children: _jsxs(BarChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, tickMargin: 10, axisLine: false, ...periodAxisTicks(folded.data, xKey, daily) }), _jsx(YAxis, { width: "auto", tickLine: false, axisLine: false, tickMargin: 8, tickCount: CHART_Y_AXIS_TICK_COUNT, ...(domainMax === undefined
25
25
  ? {}
26
26
  : {
27
27
  domain: [0, domainMax],
28
28
  ticks: niceAxisTicks(domainMax),
29
- }), tickFormatter: (value) => (axisFormatter ?? valueFormatter)(Number(value)) }), _jsx(ChartTooltip, { cursor: false, content: _jsx(ChartTooltipContent, { indicator: "line", valueFormatter: valueFormatter }) }), _jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) }), folded.series.map((entry) => (_jsx(Bar, { dataKey: entry.id, fill: entityColor(entityColorMap, entry.id), radius: 4, maxBarSize: 48 }, entry.id)))] }) })) }));
29
+ }), tickFormatter: (value) => (axisFormatter ?? valueFormatter)(Number(value)) }), _jsx(ChartTooltip, { cursor: false, content: _jsx(ChartTooltipContent, { indicator: "line", valueFormatter: valueFormatter }) }), legendNamesSeries(folded.series, split) ? (_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) })) : null, folded.series.map((entry) => (_jsx(Bar, { dataKey: entry.id, fill: entityColor(entityColorMap, entry.id), radius: 4, maxBarSize: 48 }, entry.id)))] }) })) }));
30
30
  }
31
31
  export { ChartBarMultiple };
@@ -9,7 +9,7 @@ import { type ChartCardProps } from "./chart-card.js";
9
9
  * @words Entity names as the reader knows them, never ids. The neutral remainder is "Everything else". Values through the page's shared money formatter.
10
10
  * @access The plot is an image named by the card title; the tooltip and legend are read with it. The share bar sits above the full-width table that carries each figure.
11
11
  */
12
- declare function ChartBarStacked({ variant, title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, series, entityColorMap, valueFormatter, axisFormatter, otherLabel, emptyState, size, share, className, }: ChartCardProps & {
12
+ declare function ChartBarStacked({ variant, title, period, controls, link, summary, aside, footer, headingLevel, daily, split, data, xKey, series, entityColorMap, valueFormatter, axisFormatter, otherLabel, emptyState, size, share, className, }: ChartCardProps & {
13
13
  /**
14
14
  * One bar across the card, each entity a segment of 100%: the share of a
15
15
  * total with no time axis. `data` is then a single row keyed by series id.
@@ -1 +1 @@
1
- {"version":3,"file":"chart-bar-stacked.d.ts","sourceRoot":"","sources":["../../src/components/chart-bar-stacked.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAiBjC;;;;;;;;;GASG;AACH,iBAAS,eAAe,CAAC,EACvB,OAAmB,EACnB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,cAAc,EACd,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,UAAU,EACV,IAAgB,EAChB,KAAa,EACb,SAAS,GACV,EAAE,cAAc,GAAG;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,+BA4GA;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"chart-bar-stacked.d.ts","sourceRoot":"","sources":["../../src/components/chart-bar-stacked.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAiBjC;;;;;;;;;GASG;AACH,iBAAS,eAAe,CAAC,EACvB,OAAmB,EACnB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,EACZ,KAAa,EACb,KAAa,EACb,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,cAAc,EACd,cAAsC,EACtC,aAAa,EACb,UAAU,EACV,UAAU,EACV,IAAgB,EAChB,KAAa,EACb,SAAS,GACV,EAAE,cAAc,GAAG;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,+BA4GA;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -4,8 +4,8 @@
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { Bar, BarChart, CartesianGrid, XAxis, YAxis } from "recharts";
6
6
  import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "./chart.js";
7
- import { CHART_X_AXIS_TICKS, CHART_Y_AXIS_TICK_COUNT, niceAxisTicks, stackedAxisMax, } from "./chart-axis.js";
8
- import { CHART_LEGEND_CLASS, ChartCard, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, } from "./chart-card.js";
7
+ import { CHART_Y_AXIS_TICK_COUNT, niceAxisTicks, periodAxisTicks, stackedAxisMax, } from "./chart-axis.js";
8
+ import { CHART_LEGEND_CLASS, ChartCard, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, legendNamesSeries, } from "./chart-card.js";
9
9
  import { entityColor } from "./chart-entity-colors.js";
10
10
  function stackRadius(index, count) {
11
11
  if (count === 1)
@@ -35,15 +35,15 @@ function shareRadius(index, count) {
35
35
  * @words Entity names as the reader knows them, never ids. The neutral remainder is "Everything else". Values through the page's shared money formatter.
36
36
  * @access The plot is an image named by the card title; the tooltip and legend are read with it. The share bar sits above the full-width table that carries each figure.
37
37
  */
38
- function ChartBarStacked({ variant = "default", title, period, controls, link, summary, aside, footer, headingLevel, data, xKey, series, entityColorMap, valueFormatter = defaultValueFormatter, axisFormatter, otherLabel, emptyState, size = "default", share = false, className, }) {
38
+ function ChartBarStacked({ variant = "default", title, period, controls, link, summary, aside, footer, headingLevel, daily = false, split = false, data, xKey, series, entityColorMap, valueFormatter = defaultValueFormatter, axisFormatter, otherLabel, emptyState, size = "default", share = false, className, }) {
39
39
  const folded = foldOtherSeries(series, data, entityColorMap, otherLabel);
40
40
  const chartConfig = chartSeriesConfig(folded.series, entityColorMap);
41
41
  const domainMax = stackedAxisMax(folded.data, folded.series.map((entry) => entry.id));
42
- return (_jsx(ChartCard, { variant: variant, title: title, period: period, controls: controls, ...(link ? { link } : {}), summary: summary, aside: aside, ...(footer ? { footer } : {}), ...(headingLevel ? { headingLevel } : {}), className: className, children: (titleId) => emptyState && data.length === 0 ? (emptyState) : share ? (_jsx(ChartContainer, { config: chartConfig, className: "aspect-auto h-16 w-full", children: _jsxs(BarChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, layout: "vertical", stackOffset: "expand", children: [_jsx(XAxis, { type: "number", hide: true }), _jsx(YAxis, { type: "category", dataKey: xKey, hide: true }), _jsx(ChartTooltip, { cursor: false, content: _jsx(ChartTooltipContent, { hideLabel: true, indicator: "line", valueFormatter: valueFormatter }) }), variant === "summary" ? null : (_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) })), folded.series.map((entry, index) => (_jsx(Bar, { dataKey: entry.id, stackId: "a", fill: entityColor(entityColorMap, entry.id), radius: shareRadius(index, folded.series.length) }, entry.id)))] }) })) : (_jsx(ChartContainer, { config: chartConfig, className: chartPlotClassName(size), children: _jsxs(BarChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, tickMargin: 10, axisLine: false, ...CHART_X_AXIS_TICKS }), _jsx(YAxis, { width: "auto", tickLine: false, axisLine: false, tickMargin: 8, tickCount: CHART_Y_AXIS_TICK_COUNT, ...(domainMax === undefined
42
+ return (_jsx(ChartCard, { variant: variant, title: title, period: period, controls: controls, ...(link ? { link } : {}), summary: summary, aside: aside, ...(footer ? { footer } : {}), ...(headingLevel ? { headingLevel } : {}), className: className, children: (titleId) => emptyState && data.length === 0 ? (emptyState) : share ? (_jsx(ChartContainer, { config: chartConfig, className: "aspect-auto h-16 w-full", children: _jsxs(BarChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, layout: "vertical", stackOffset: "expand", children: [_jsx(XAxis, { type: "number", hide: true }), _jsx(YAxis, { type: "category", dataKey: xKey, hide: true }), _jsx(ChartTooltip, { cursor: false, content: _jsx(ChartTooltipContent, { hideLabel: true, indicator: "line", valueFormatter: valueFormatter }) }), variant === "summary" || !legendNamesSeries(folded.series, split) ? null : (_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) })), folded.series.map((entry, index) => (_jsx(Bar, { dataKey: entry.id, stackId: "a", fill: entityColor(entityColorMap, entry.id), radius: shareRadius(index, folded.series.length) }, entry.id)))] }) })) : (_jsx(ChartContainer, { config: chartConfig, className: chartPlotClassName(size), children: _jsxs(BarChart, { accessibilityLayer: true, "aria-labelledby": titleId, data: folded.data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: xKey, tickLine: false, tickMargin: 10, axisLine: false, ...periodAxisTicks(folded.data, xKey, daily) }), _jsx(YAxis, { width: "auto", tickLine: false, axisLine: false, tickMargin: 8, tickCount: CHART_Y_AXIS_TICK_COUNT, ...(domainMax === undefined
43
43
  ? {}
44
44
  : {
45
45
  domain: [0, domainMax],
46
46
  ticks: niceAxisTicks(domainMax),
47
- }), tickFormatter: (value) => (axisFormatter ?? valueFormatter)(Number(value)) }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, { indicator: "line", valueFormatter: valueFormatter }) }), variant === "summary" ? null : (_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) })), folded.series.map((entry, index) => (_jsx(Bar, { dataKey: entry.id, stackId: "a", fill: entityColor(entityColorMap, entry.id), radius: variant === "summary" ? 0 : stackRadius(index, folded.series.length), maxBarSize: 48 }, entry.id)))] }) })) }));
47
+ }), tickFormatter: (value) => (axisFormatter ?? valueFormatter)(Number(value)) }), _jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, { indicator: "line", valueFormatter: valueFormatter }) }), variant === "summary" || !legendNamesSeries(folded.series, split) ? null : (_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { className: CHART_LEGEND_CLASS }) })), folded.series.map((entry, index) => (_jsx(Bar, { dataKey: entry.id, stackId: "a", fill: entityColor(entityColorMap, entry.id), radius: variant === "summary" ? 0 : stackRadius(index, folded.series.length), maxBarSize: 48 }, entry.id)))] }) })) }));
48
48
  }
49
49
  export { ChartBarStacked };
@@ -64,7 +64,11 @@ type ChartCardProps = {
64
64
  data: readonly ChartDatum[];
65
65
  /** The datum key carrying the category or period. */
66
66
  xKey: string;
67
+ /** One datum per day: the axis labels every second day from the first, fewer where those do not fit. */
68
+ daily?: boolean;
67
69
  series: readonly ChartSeries[];
70
+ /** The series are a split's entities, such as Customers or models: the legend names them even when the split returns one. Without it, one series is the measure the title names, with no legend. */
71
+ split?: boolean;
68
72
  /** The shared page-context entity-color assignment map. */
69
73
  entityColorMap: EntityColorMap;
70
74
  /** Formats the y-axis ticks and the tooltip values. */
@@ -83,6 +87,7 @@ type ChartCardProps = {
83
87
  declare function defaultValueFormatter(value: number): string;
84
88
  /** The chart config the legend and tooltip read: each series' label and color. */
85
89
  declare function chartSeriesConfig(series: readonly ChartSeries[], entityColorMap: EntityColorMap): ChartConfig;
90
+ declare function legendNamesSeries(series: readonly ChartSeries[], split: boolean): boolean;
86
91
  type FoldedSeries = {
87
92
  series: ChartSeries[];
88
93
  data: ChartDatum[];
@@ -103,7 +108,7 @@ declare function foldOtherSeries(series: readonly ChartSeries[], data: readonly
103
108
  * @family Charts
104
109
  * @when Every chart and every reading built around one: the frame a page never builds by hand. A chart is a named section of its page.
105
110
  * @instead A single figure is a `KpiCard`, never nested inside a chart. A ranking beside the plot goes in the card's `aside`, not a second card.
106
- * @behaviour `summaryPlacement="beside"` stands the summary at the plot's leading edge from `sm` up and above it on a phone, as Usage's Activity card puts the period's total beside its calendar (nadicode decision). The plot may be given as a node, for a plot that names itself, such as an `ActivityCalendar`, or a page rendered on the server. `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a reading that stands beside fuller cards (nadicode decision). The default header puts controls at the trailing edge on wide cards, below the title on narrow cards. The way to the reading's owner is a › icon link after the controls, as Vercel's Observability preview cards open their page. The summary variant keeps controls immediately after the title, the owner link at the trailing edge, and the total and period above the plot. The ranking sits beside the plot only when the card itself reaches 48 rem; narrower cards keep a full-width plot and put the ranking below it. Controls wrap on narrow cards. An empty dataset shows its `emptyState` in the plot's place. The footer carries the reading time and at most one command on that reading. While its page reads the series, `ChartCardSkeleton` stands in its place: the same card, a bar for the title, the summary's figure when the card has one (`summary`), the plot's area at its `size`'s height, and the footer's line when the card has one (`footer`), with no words (nadicode decision).
111
+ * @behaviour The plot's legend names two series or more, and a split's one entity (`split`); a chart of one measure has none, its title naming it. `summaryPlacement="beside"` stands the summary at the plot's leading edge from `sm` up and above it on a phone, as Usage's Activity card puts the period's total beside its calendar (nadicode decision). The plot may be given as a node, for a plot that names itself, such as an `ActivityCalendar`, or a page rendered on the server. `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a reading that stands beside fuller cards (nadicode decision). The default header puts controls at the trailing edge on wide cards, below the title on narrow cards. The way to the reading's owner is a › icon link after the controls, as Vercel's Observability preview cards open their page. The summary variant keeps controls immediately after the title, the owner link at the trailing edge, and the total and period above the plot. The ranking sits beside the plot only when the card itself reaches 48 rem; narrower cards keep a full-width plot and put the ranking below it. Controls wrap on narrow cards. An empty dataset shows its `emptyState` in the plot's place. The footer carries the reading time and at most one command on that reading. While its page reads the series, `ChartCardSkeleton` stands in its place: the same card, a bar for the title, the summary's figure when the card has one (`summary`), the plot's area at its `size`'s height, and the footer's line when the card has one (`footer`), with no words (nadicode decision).
107
112
  * @words Title names the measure and its split: "Model spend by Customer". Period as dates. The link's name says where it goes: "Explore Usage by model", "Open revenue in Analytics". Footer: the reading's time, "Updated 4 minutes ago" or "Read at 12:42". Sentence case throughout.
108
113
  * @access The title is a heading at the page's level (default 2) and labels the plot. The owner link is a native link named by its `label`. The plot is focusable and shows the 2 px focus outline only on keyboard focus. `ChartCardSkeleton` is busy and its bars are hidden from assistive technology.
109
114
  */
@@ -133,6 +138,6 @@ declare function chartPlotClassName(size: ChartCardSize): string;
133
138
  declare const CHART_FOCUS_CLASS = "[&_.recharts-surface:focus-visible]:nc-focus-outline [&_.recharts-surface:focus-visible]:outline-ring";
134
139
  /** Legend below the plot, left-aligned, wrapping to a second line. */
135
140
  declare const CHART_LEGEND_CLASS = "flex-wrap justify-start";
136
- export { CHART_FOCUS_CLASS, CHART_LEGEND_CLASS, ChartCard, ChartCardSkeleton, ChartSummary, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, };
141
+ export { CHART_FOCUS_CLASS, CHART_LEGEND_CLASS, ChartCard, ChartCardSkeleton, ChartSummary, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, legendNamesSeries, };
137
142
  export type { ChartCardFooter, ChartCardLink, ChartCardProps, ChartCardSize, ChartDatum, ChartSeries, ChartSummaryProps, ChartSummaryTrend, };
138
143
  //# sourceMappingURL=chart-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chart-card.d.ts","sourceRoot":"","sources":["../../src/components/chart-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG3F,KAAK,WAAW,GAAG;IACjB,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAElD,KAAK,aAAa,GAAG,SAAS,GAAG,IAAI,CAAC;AACtC,KAAK,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9C,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE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ACV,MAAM,GACN,SAAS,GACT,kBAAkB,GAClB,OAAO,GACP,QAAQ,GACR,cAAc,GACd,WAAW,GACX,UAAU,CACb,GAAG;IACF,uGAAuG;IACvG,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACpE,qBAwFA;AAED;;;GAGG;AACH,iBAAS,iBAAiB,CAAC,EACzB,OAAe,EACf,IAAgB,EAChB,MAAc,GACf,EAAE;IACD,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,qBA0BA;AAED,iBAAS,YAAY,CAAC,EACpB,OAAmB,EACnB,KAAK,EACL,KAAK,EACL,UAAU,EACV,SAAqB,EACrB,KAAK,EACL,MAAM,GACP,EAAE,iBAAiB,qBAiDnB;AAED,uEAAuE;AACvE,iBAAS,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAEvD;AAED;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,0GACkF,CAAC;AAE1G,sEAAsE;AACtE,QAAA,MAAM,kBAAkB,4BAA4B,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,GAChB,CAAC;AACF,YAAY,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
1
+ {"version":3,"file":"chart-card.d.ts","sourceRoot":"","sources":["../../src/components/chart-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB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AK,CAAC,SAAS,CAAC,CAAC;CACpE,qBAwFA;AAED;;;GAGG;AACH,iBAAS,iBAAiB,CAAC,EACzB,OAAe,EACf,IAAgB,EAChB,MAAc,GACf,EAAE;IACD,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,qBA0BA;AAED,iBAAS,YAAY,CAAC,EACpB,OAAmB,EACnB,KAAK,EACL,KAAK,EACL,UAAU,EACV,SAAqB,EACrB,KAAK,EACL,MAAM,GACP,EAAE,iBAAiB,qBAiDnB;AAED,uEAAuE;AACvE,iBAAS,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAEvD;AAED;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,0GACkF,CAAC;AAE1G,sEAAsE;AACtE,QAAA,MAAM,kBAAkB,4BAA4B,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,GAClB,CAAC;AACF,YAAY,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
@@ -26,6 +26,9 @@ function chartSeriesConfig(series, entityColorMap) {
26
26
  { label: entry.label, color: entityColor(entityColorMap, entry.id) },
27
27
  ]));
28
28
  }
29
+ function legendNamesSeries(series, split) {
30
+ return split || series.length > 1;
31
+ }
29
32
  /**
30
33
  * Folds every series whose entity color resolves to the neutral register into
31
34
  * ONE aggregated series (values summed per bucket). Past the tenth entity the
@@ -63,7 +66,7 @@ function foldOtherSeries(series, data, entityColorMap, otherLabel) {
63
66
  * @family Charts
64
67
  * @when Every chart and every reading built around one: the frame a page never builds by hand. A chart is a named section of its page.
65
68
  * @instead A single figure is a `KpiCard`, never nested inside a chart. A ranking beside the plot goes in the card's `aside`, not a second card.
66
- * @behaviour `summaryPlacement="beside"` stands the summary at the plot's leading edge from `sm` up and above it on a phone, as Usage's Activity card puts the period's total beside its calendar (nadicode decision). The plot may be given as a node, for a plot that names itself, such as an `ActivityCalendar`, or a page rendered on the server. `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a reading that stands beside fuller cards (nadicode decision). The default header puts controls at the trailing edge on wide cards, below the title on narrow cards. The way to the reading's owner is a › icon link after the controls, as Vercel's Observability preview cards open their page. The summary variant keeps controls immediately after the title, the owner link at the trailing edge, and the total and period above the plot. The ranking sits beside the plot only when the card itself reaches 48 rem; narrower cards keep a full-width plot and put the ranking below it. Controls wrap on narrow cards. An empty dataset shows its `emptyState` in the plot's place. The footer carries the reading time and at most one command on that reading. While its page reads the series, `ChartCardSkeleton` stands in its place: the same card, a bar for the title, the summary's figure when the card has one (`summary`), the plot's area at its `size`'s height, and the footer's line when the card has one (`footer`), with no words (nadicode decision).
69
+ * @behaviour The plot's legend names two series or more, and a split's one entity (`split`); a chart of one measure has none, its title naming it. `summaryPlacement="beside"` stands the summary at the plot's leading edge from `sm` up and above it on a phone, as Usage's Activity card puts the period's total beside its calendar (nadicode decision). The plot may be given as a node, for a plot that names itself, such as an `ActivityCalendar`, or a page rendered on the server. `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a reading that stands beside fuller cards (nadicode decision). The default header puts controls at the trailing edge on wide cards, below the title on narrow cards. The way to the reading's owner is a › icon link after the controls, as Vercel's Observability preview cards open their page. The summary variant keeps controls immediately after the title, the owner link at the trailing edge, and the total and period above the plot. The ranking sits beside the plot only when the card itself reaches 48 rem; narrower cards keep a full-width plot and put the ranking below it. Controls wrap on narrow cards. An empty dataset shows its `emptyState` in the plot's place. The footer carries the reading time and at most one command on that reading. While its page reads the series, `ChartCardSkeleton` stands in its place: the same card, a bar for the title, the summary's figure when the card has one (`summary`), the plot's area at its `size`'s height, and the footer's line when the card has one (`footer`), with no words (nadicode decision).
67
70
  * @words Title names the measure and its split: "Model spend by Customer". Period as dates. The link's name says where it goes: "Explore Usage by model", "Open revenue in Analytics". Footer: the reading's time, "Updated 4 minutes ago" or "Read at 12:42". Sentence case throughout.
68
71
  * @access The title is a heading at the page's level (default 2) and labels the plot. The owner link is a native link named by its `label`. The plot is focusable and shows the 2 px focus outline only on keyboard focus. `ChartCardSkeleton` is busy and its bars are hidden from assistive technology.
69
72
  */
@@ -102,4 +105,4 @@ function chartPlotClassName(size) {
102
105
  const CHART_FOCUS_CLASS = "[&_.recharts-surface:focus-visible]:nc-focus-outline [&_.recharts-surface:focus-visible]:outline-ring";
103
106
  /** Legend below the plot, left-aligned, wrapping to a second line. */
104
107
  const CHART_LEGEND_CLASS = "flex-wrap justify-start";
105
- export { CHART_FOCUS_CLASS, CHART_LEGEND_CLASS, ChartCard, ChartCardSkeleton, ChartSummary, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, };
108
+ export { CHART_FOCUS_CLASS, CHART_LEGEND_CLASS, ChartCard, ChartCardSkeleton, ChartSummary, chartPlotClassName, chartSeriesConfig, defaultValueFormatter, foldOtherSeries, legendNamesSeries, };
@@ -1935,7 +1935,7 @@ export const USAGE = [
1935
1935
  summary: "The card every chart in the kit renders: one header, the summary, the plot, its legend and the reading's time. The plots (`ChartBarStacked`, `ChartAreaStacked`, `ChartBarMultiple`, `ChartBarHorizontal`) hold only their own plot; a page never builds a chart card frame by hand.",
1936
1936
  when: "Every chart and every reading built around one: the frame a page never builds by hand. A chart is a named section of its page.",
1937
1937
  instead: "A single figure is a `KpiCard`, never nested inside a chart. A ranking beside the plot goes in the card's `aside`, not a second card.",
1938
- behaviour: "`summaryPlacement=\"beside\"` stands the summary at the plot's leading edge from `sm` up and above it on a phone, as Usage's Activity card puts the period's total beside its calendar (nadicode decision). The plot may be given as a node, for a plot that names itself, such as an `ActivityCalendar`, or a page rendered on the server. `cardSize=\"sm\"` draws the compact card, as `Card`'s `size`, for a reading that stands beside fuller cards (nadicode decision). The default header puts controls at the trailing edge on wide cards, below the title on narrow cards. The way to the reading's owner is a › icon link after the controls, as Vercel's Observability preview cards open their page. The summary variant keeps controls immediately after the title, the owner link at the trailing edge, and the total and period above the plot. The ranking sits beside the plot only when the card itself reaches 48 rem; narrower cards keep a full-width plot and put the ranking below it. Controls wrap on narrow cards. An empty dataset shows its `emptyState` in the plot's place. The footer carries the reading time and at most one command on that reading. While its page reads the series, `ChartCardSkeleton` stands in its place: the same card, a bar for the title, the summary's figure when the card has one (`summary`), the plot's area at its `size`'s height, and the footer's line when the card has one (`footer`), with no words (nadicode decision).",
1938
+ behaviour: "The plot's legend names two series or more, and a split's one entity (`split`); a chart of one measure has none, its title naming it. `summaryPlacement=\"beside\"` stands the summary at the plot's leading edge from `sm` up and above it on a phone, as Usage's Activity card puts the period's total beside its calendar (nadicode decision). The plot may be given as a node, for a plot that names itself, such as an `ActivityCalendar`, or a page rendered on the server. `cardSize=\"sm\"` draws the compact card, as `Card`'s `size`, for a reading that stands beside fuller cards (nadicode decision). The default header puts controls at the trailing edge on wide cards, below the title on narrow cards. The way to the reading's owner is a › icon link after the controls, as Vercel's Observability preview cards open their page. The summary variant keeps controls immediately after the title, the owner link at the trailing edge, and the total and period above the plot. The ranking sits beside the plot only when the card itself reaches 48 rem; narrower cards keep a full-width plot and put the ranking below it. Controls wrap on narrow cards. An empty dataset shows its `emptyState` in the plot's place. The footer carries the reading time and at most one command on that reading. While its page reads the series, `ChartCardSkeleton` stands in its place: the same card, a bar for the title, the summary's figure when the card has one (`summary`), the plot's area at its `size`'s height, and the footer's line when the card has one (`footer`), with no words (nadicode decision).",
1939
1939
  words: 'Title names the measure and its split: "Model spend by Customer". Period as dates. The link\'s name says where it goes: "Explore Usage by model", "Open revenue in Analytics". Footer: the reading\'s time, "Updated 4 minutes ago" or "Read at 12:42". Sentence case throughout.',
1940
1940
  access: "The title is a heading at the page's level (default 2) and labels the plot. The owner link is a native link named by its `label`. The plot is focusable and shows the 2 px focus outline only on keyboard focus. `ChartCardSkeleton` is busy and its bars are hidden from assistive technology.",
1941
1941
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadicodeai/ui",
3
- "version": "12.1.218",
3
+ "version": "12.1.220",
4
4
  "type": "module",
5
5
  "imports": {
6
6
  "#jsx": "./src/jsx/index.ts",
@@ -82,7 +82,7 @@
82
82
  "@headless-tree/react": "1.8.0",
83
83
  "@iconify-icons/logos": "^2.0.3",
84
84
  "@iconify/react": "^6.0.2",
85
- "@nadicodeai/design-system": "12.1.218",
85
+ "@nadicodeai/design-system": "12.1.220",
86
86
  "@tanstack/react-table": "^9.3.1",
87
87
  "@vgpu/wgsl": "0.6.0",
88
88
  "class-variance-authority": "^0.7.1",