@tensor_1/react 2.65.1 → 2.67.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/README.md +5 -0
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/component-inventory.json +1124 -0
- package/dist/{ChartCore-CY5a4teJ.d.cts → ChartCore-BX0frnUz.d.cts} +1 -8
- package/dist/ChartMetric-bCAW4yvf.d.cts +16 -0
- package/dist/{GlanceCharts-Cb39RqDC.d.cts → GlanceCharts-PVaEwyp2.d.cts} +1 -1
- package/dist/chart-analytic.cjs +41 -38
- package/dist/chart-analytic.d.cts +3 -2
- package/dist/chart-analytic.d.ts +2 -1
- package/dist/chart-preset.cjs +37 -34
- package/dist/chart-preset.d.cts +5 -4
- package/dist/chart-preset.d.ts +2 -1
- package/dist/chart.cjs +37 -34
- package/dist/chart.d.cts +5 -4
- package/dist/chart.d.ts +2 -1
- package/dist/components/Avatar.d.ts +6 -3
- package/dist/components/Avatar.js +9 -3
- package/dist/components/Chart.d.ts +2 -1
- package/dist/components/ChartCore.d.ts +3 -8
- package/dist/components/ChartCore.js +1 -7
- package/dist/components/ChartMetric.d.ts +16 -0
- package/dist/components/ChartMetric.js +12 -0
- package/dist/components/ChartPanels.d.ts +1 -0
- package/dist/components/FocusOnMount.d.ts +15 -15
- package/dist/components/GlanceCharts.d.ts +1 -0
- package/dist/components/MotionList.d.ts +16 -16
- package/dist/components/RuleBuilder.d.ts +8 -1
- package/dist/components/RuleBuilder.js +34 -12
- package/dist/glyphs-BAAgp2Xv.d.cts +256 -0
- package/dist/icons/Icon.d.ts +23 -24
- package/dist/icons/Icon.js +13 -8
- package/dist/icons/components.d.ts +13 -1
- package/dist/icons/components.js +24 -0
- package/dist/icons/glyphs.d.ts +21 -1
- package/dist/icons/glyphs.js +33 -3
- package/dist/icons/intrinsic-components.d.ts +273 -0
- package/dist/icons/intrinsic-components.js +540 -0
- package/dist/icons/types.d.ts +9 -2
- package/dist/icons-intrinsic.cjs +1383 -0
- package/dist/icons-intrinsic.d.cts +275 -0
- package/dist/icons-intrinsic.d.ts +4 -0
- package/dist/icons-intrinsic.js +5 -0
- package/dist/icons.cjs +72 -11
- package/dist/icons.d.cts +18 -247
- package/dist/icons.d.ts +1 -1
- package/dist/index.cjs +355 -304
- package/dist/index.d.cts +17 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/rule-builder-model.d.ts +4 -2
- package/dist/rule-builder-model.js +7 -1
- package/dist/{types-B7OIndwg.d.cts → types-cpbqVqOW.d.cts} +9 -2
- package/package.json +7 -2
|
@@ -134,13 +134,6 @@ interface ChartProps {
|
|
|
134
134
|
/** Further hidden data tables (after `tableData`), each named in the chart's description. */
|
|
135
135
|
tables?: ChartTable[];
|
|
136
136
|
}
|
|
137
|
-
interface ChartMetricProps extends HTMLAttributes<HTMLDivElement> {
|
|
138
|
-
value: ReactNode;
|
|
139
|
-
label?: ReactNode;
|
|
140
|
-
delta?: ReactNode;
|
|
141
|
-
deltaTone?: 'neutral' | 'positive' | 'negative' | 'warning';
|
|
142
|
-
}
|
|
143
|
-
declare function ChartMetric({ value, label, delta, deltaTone, className, ...props }: ChartMetricProps): react.JSX.Element;
|
|
144
137
|
interface ChartLegendProps extends HTMLAttributes<HTMLUListElement> {
|
|
145
138
|
children?: ReactNode;
|
|
146
139
|
}
|
|
@@ -152,4 +145,4 @@ interface ChartLegendItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
|
152
145
|
}
|
|
153
146
|
declare function ChartLegendItem({ label, color, swatch, className, style, ...props }: ChartLegendItemProps): react.JSX.Element;
|
|
154
147
|
|
|
155
|
-
export { type ChartLabels as C, DEFAULT_CHART_LABELS as D, type UixChartTokens as U, type ChartProps as a, type ChartEngine as b, type ChartEventHandler as c, ChartLegend as d, ChartLegendItem as e, type ChartLegendItemProps as f, type ChartLegendProps as g,
|
|
148
|
+
export { type ChartLabels as C, DEFAULT_CHART_LABELS as D, type UixChartTokens as U, type ChartProps as a, type ChartEngine as b, type ChartEventHandler as c, ChartLegend as d, ChartLegendItem as e, type ChartLegendItemProps as f, type ChartLegendProps as g, type ChartOption as h, type ChartTable as i, type ChartTableRow as j, type ChartTokenSource as k, uixChartPalette as l, mergeChartTheme as m, uixChartTheme as n, uixChartTokens as o, uixChartAreaGradient as u };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/** A body-only metric; importing it from the root loads no chart engine. */
|
|
5
|
+
interface ChartMetricProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
delta?: ReactNode;
|
|
9
|
+
/** Sentiment is independent of whether the numerical delta rises or falls. */
|
|
10
|
+
deltaTone?: 'neutral' | 'positive' | 'negative' | 'warning';
|
|
11
|
+
/** Omit to retain the responsive chart-header default. */
|
|
12
|
+
align?: 'start' | 'end';
|
|
13
|
+
}
|
|
14
|
+
declare function ChartMetric({ value, label, delta, deltaTone, align, className, ...props }: ChartMetricProps): react.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ChartMetric as C, type ChartMetricProps as a };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { U as UixChartTokens, C as ChartLabels, c as ChartEventHandler } from './ChartCore-
|
|
2
|
+
import { U as UixChartTokens, C as ChartLabels, c as ChartEventHandler } from './ChartCore-BX0frnUz.cjs';
|
|
3
3
|
import { EChartsOption } from 'echarts';
|
|
4
4
|
|
|
5
5
|
/** How a glance chart draws in. `play: false` (the default) draws it at rest, with no animation. */
|
package/dist/chart-analytic.cjs
CHANGED
|
@@ -190,8 +190,18 @@ function prefersReducedMotion() {
|
|
|
190
190
|
return typeof matchMedia !== "undefined" && matchMedia(QUERY).matches;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
// src/components/
|
|
193
|
+
// src/components/ChartMetric.tsx
|
|
194
194
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
195
|
+
function ChartMetric({ value, label, delta, deltaTone = "neutral", align, className, ...props }) {
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), "data-align": align, ...props, children: [
|
|
197
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
|
|
198
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
|
|
199
|
+
delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
|
|
200
|
+
] });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// src/components/ChartCore.tsx
|
|
204
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
195
205
|
function readToken(name) {
|
|
196
206
|
if (typeof getComputedStyle === "undefined") return "";
|
|
197
207
|
return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
@@ -334,18 +344,18 @@ function ChartCore({
|
|
|
334
344
|
const hasTable = Boolean(tableData?.length && tableHeaders?.length);
|
|
335
345
|
const extraTables = (tables ?? []).filter((table) => table.headers.length && table.rows.length);
|
|
336
346
|
const describedBy = [hasTable ? tableId : null, ...extraTables.map((_, index) => `${tableId}-${index}`)].filter(Boolean).join(" ") || void 0;
|
|
337
|
-
return /* @__PURE__ */ (0,
|
|
338
|
-
title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0,
|
|
339
|
-
/* @__PURE__ */ (0,
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cx("uix-chart", className), style, children: [
|
|
348
|
+
title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__header", children: [
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__heading", children: [
|
|
340
350
|
header,
|
|
341
|
-
title ? /* @__PURE__ */ (0,
|
|
342
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
351
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__title", children: title }) : null,
|
|
352
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
|
|
343
353
|
] }),
|
|
344
354
|
headerAction
|
|
345
355
|
] }) : null,
|
|
346
|
-
hasEmpty ? /* @__PURE__ */ (0,
|
|
347
|
-
loading ? /* @__PURE__ */ (0,
|
|
348
|
-
/* @__PURE__ */ (0,
|
|
356
|
+
hasEmpty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__plot", "data-empty": true, children: empty }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__plot", "data-loading": loading || void 0, "aria-busy": loading || void 0, children: [
|
|
357
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "uix-chart__loading", children: labels.loading }) : null,
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
349
359
|
"div",
|
|
350
360
|
{
|
|
351
361
|
ref: containerRef,
|
|
@@ -356,31 +366,24 @@ function ChartCore({
|
|
|
356
366
|
}
|
|
357
367
|
)
|
|
358
368
|
] }),
|
|
359
|
-
hasTable ? /* @__PURE__ */ (0,
|
|
360
|
-
/* @__PURE__ */ (0,
|
|
361
|
-
/* @__PURE__ */ (0,
|
|
369
|
+
hasTable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { id: tableId, className: "uix-visually-hidden", "aria-label": `${effectiveAriaLabel} \u2014 ${labels.dataTableSuffix}`, children: [
|
|
370
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { scope: "col", children: label }, label)) }) }),
|
|
371
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: tableData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: row[label] }, label)) }, index)) })
|
|
362
372
|
] }) : null,
|
|
363
|
-
extraTables.map((table, index) => /* @__PURE__ */ (0,
|
|
364
|
-
/* @__PURE__ */ (0,
|
|
365
|
-
/* @__PURE__ */ (0,
|
|
373
|
+
extraTables.map((table, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { id: `${tableId}-${index}`, className: "uix-visually-hidden", "aria-label": table.caption, children: [
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: table.headers.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { scope: "col", children: label }, label)) }) }),
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: table.headers.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: row[label] }, label)) }, rowIndex)) })
|
|
366
376
|
] }, index)),
|
|
367
|
-
footer != null && /* @__PURE__ */ (0,
|
|
368
|
-
] });
|
|
369
|
-
}
|
|
370
|
-
function ChartMetric({ value, label, delta, deltaTone = "neutral", className, ...props }) {
|
|
371
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), ...props, children: [
|
|
372
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
|
|
373
|
-
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
|
|
374
|
-
delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
|
|
377
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__footer", children: footer })
|
|
375
378
|
] });
|
|
376
379
|
}
|
|
377
380
|
function ChartLegend({ children, className, ...props }) {
|
|
378
|
-
return /* @__PURE__ */ (0,
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: cx("uix-legend", className), ...props, children });
|
|
379
382
|
}
|
|
380
383
|
function ChartLegendItem({ label, color, swatch = "block", className, style, ...props }) {
|
|
381
384
|
const mergedStyle = color ? { "--legend-color": color, ...style } : style;
|
|
382
|
-
return /* @__PURE__ */ (0,
|
|
383
|
-
/* @__PURE__ */ (0,
|
|
385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: cx("uix-legend__item", className), style: mergedStyle, ...props, children: [
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cx("uix-legend__swatch", swatch !== "block" && `uix-legend__swatch--${swatch}`), "aria-hidden": "true" }),
|
|
384
387
|
label
|
|
385
388
|
] });
|
|
386
389
|
}
|
|
@@ -1164,7 +1167,7 @@ function correlationScatterModel(spec, tokens, labelOverrides) {
|
|
|
1164
1167
|
}
|
|
1165
1168
|
|
|
1166
1169
|
// src/components/ChartPanels.tsx
|
|
1167
|
-
var
|
|
1170
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1168
1171
|
var CSS_VAR_TOKENS = {
|
|
1169
1172
|
palette: [1, 2, 3, 4, 5, 6, 7, 8].map((i) => `var(--uix-chart-${i})`),
|
|
1170
1173
|
series: "var(--uix-chart-series)",
|
|
@@ -1232,12 +1235,12 @@ function ChartPanelsCore({
|
|
|
1232
1235
|
}
|
|
1233
1236
|
}), [layout, spec.events, onEventClick, onPointClick]);
|
|
1234
1237
|
const showLegend = legend ?? layout.legend.length > 0;
|
|
1235
|
-
const legendNode = showLegend && layout.legend.length ? /* @__PURE__ */ (0,
|
|
1236
|
-
const footerNode = legendNode || footer != null ? /* @__PURE__ */ (0,
|
|
1238
|
+
const legendNode = showLegend && layout.legend.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartLegend, { children: layout.legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartLegendItem, { label: item.label, color: item.color, swatch: item.swatch }, `${item.swatch}:${item.label}`)) }) : null;
|
|
1239
|
+
const footerNode = legendNode || footer != null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1237
1240
|
legendNode,
|
|
1238
1241
|
footer
|
|
1239
1242
|
] }) : void 0;
|
|
1240
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1241
1244
|
ChartCore,
|
|
1242
1245
|
{
|
|
1243
1246
|
engine,
|
|
@@ -1301,13 +1304,13 @@ function CorrelationScatterCore({
|
|
|
1301
1304
|
else if (point.href && typeof window !== "undefined") window.location.assign(point.href);
|
|
1302
1305
|
}
|
|
1303
1306
|
}), [layout.hitSeriesId, usable, onPointClick]);
|
|
1304
|
-
const notEnough = !layout.enough ? /* @__PURE__ */ (0,
|
|
1305
|
-
const stats = showStats && layout.enough ? /* @__PURE__ */ (0,
|
|
1306
|
-
const footerNode = stats || footer != null ? /* @__PURE__ */ (0,
|
|
1307
|
+
const notEnough = !layout.enough ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "uix-chart__insufficient", children: (labels?.notEnough ?? DEFAULT_CORRELATION_SCATTER_LABELS.notEnough)(layout.n, layout.minPoints) }) : null;
|
|
1308
|
+
const stats = showStats && layout.enough ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "uix-chart__stats", children: layout.statsText }) : null;
|
|
1309
|
+
const footerNode = stats || footer != null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
1307
1310
|
stats,
|
|
1308
1311
|
footer
|
|
1309
1312
|
] }) : void 0;
|
|
1310
|
-
return /* @__PURE__ */ (0,
|
|
1313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1311
1314
|
ChartCore,
|
|
1312
1315
|
{
|
|
1313
1316
|
engine,
|
|
@@ -1332,7 +1335,7 @@ function CorrelationScatterCore({
|
|
|
1332
1335
|
}
|
|
1333
1336
|
|
|
1334
1337
|
// src/chart-analytic.tsx
|
|
1335
|
-
var
|
|
1338
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1336
1339
|
echarts.use([
|
|
1337
1340
|
import_charts.BarChart,
|
|
1338
1341
|
import_charts.LineChart,
|
|
@@ -1350,13 +1353,13 @@ echarts.use([
|
|
|
1350
1353
|
]);
|
|
1351
1354
|
var analyticEngine = echarts;
|
|
1352
1355
|
function Chart(props) {
|
|
1353
|
-
return /* @__PURE__ */ (0,
|
|
1356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChartCore, { ...props, engine: analyticEngine });
|
|
1354
1357
|
}
|
|
1355
1358
|
function ChartPanels(props) {
|
|
1356
|
-
return /* @__PURE__ */ (0,
|
|
1359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChartPanelsCore, { ...props, engine: analyticEngine });
|
|
1357
1360
|
}
|
|
1358
1361
|
function CorrelationScatter(props) {
|
|
1359
|
-
return /* @__PURE__ */ (0,
|
|
1362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CorrelationScatterCore, { ...props, engine: analyticEngine });
|
|
1360
1363
|
}
|
|
1361
1364
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1362
1365
|
0 && (module.exports = {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { U as UixChartTokens, C as ChartLabels, a as ChartProps } from './ChartCore-
|
|
4
|
-
export { b as ChartEngine, c as ChartEventHandler, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as
|
|
3
|
+
import { U as UixChartTokens, C as ChartLabels, a as ChartProps } from './ChartCore-BX0frnUz.cjs';
|
|
4
|
+
export { b as ChartEngine, c as ChartEventHandler, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as ChartOption, i as ChartTable, j as ChartTableRow, k as ChartTokenSource, D as DEFAULT_CHART_LABELS, m as mergeChartTheme, u as uixChartAreaGradient, l as uixChartPalette, n as uixChartTheme, o as uixChartTokens } from './ChartCore-BX0frnUz.cjs';
|
|
5
5
|
import { ScatterSeriesOption, MarkLineComponentOption, MarkAreaComponentOption, MarkPointComponentOption, LineSeriesOption, EChartsOption } from 'echarts';
|
|
6
6
|
import { L as LinearFit } from './chart-stats-o4zDhpVm.cjs';
|
|
7
7
|
export { C as ChartStatPoint, P as PredictionBandPoint, l as linearFit, n as normalQuantile, p as predictionBand, q as quantiles, s as studentTQuantile } from './chart-stats-o4zDhpVm.cjs';
|
|
8
|
+
export { C as ChartMetric, a as ChartMetricProps } from './ChartMetric-bCAW4yvf.cjs';
|
|
8
9
|
|
|
9
10
|
/** A position on the x axis: a category name, or a time value (ms or ISO string) on a time axis. */
|
|
10
11
|
type ChartX = string | number;
|
package/dist/chart-analytic.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ChartProps } from './components/ChartCore.js';
|
|
3
|
-
export { ChartEngine, ChartEventHandler, ChartLabels, ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps,
|
|
3
|
+
export { ChartEngine, ChartEventHandler, ChartLabels, ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps, ChartOption, ChartTable, ChartTableRow, DEFAULT_CHART_LABELS, uixChartPalette } from './components/ChartCore.js';
|
|
4
4
|
import { ChartPanelsProps, CorrelationScatterProps } from './components/ChartPanels.js';
|
|
5
5
|
export { ChartTokenSource, UixChartTokens, mergeChartTheme, uixChartAreaGradient, uixChartTheme, uixChartTokens } from './chart-theme.js';
|
|
6
6
|
export { ChartAnalyticLabels, ChartComparison, ChartEvent, ChartEventLane, ChartEventPin, ChartForecast, ChartMarks, ChartThreshold, ChartX, DEFAULT_ANALYTIC_LABELS, combineMarks, comparisonSeries, crossingPoints, eventMarks, findCrossings, forecastSeries, partialPeriod, thresholdMarks } from './chart-analytic-model.js';
|
|
7
7
|
export { CHART_PANELS_LAYOUT, ChartPanel, ChartPanelSeries, ChartPanelsLabels, ChartPanelsLegendItem, ChartPanelsModel, ChartPanelsSpec, ChartPanelsTable, ChartPanelsX, DEFAULT_CHART_PANELS_LABELS, chartPanelsModel, niceCeil } from './chart-panels-model.js';
|
|
8
8
|
export { CorrelationPoint, CorrelationScatterLabels, CorrelationScatterModel, CorrelationScatterSpec, DEFAULT_CORRELATION_SCATTER_LABELS, SCATTER_HIT_SIZE, correlationScatterModel, formatCorrelation } from './correlation-scatter-model.js';
|
|
9
9
|
export { ChartStatPoint, LinearFit, PredictionBandPoint, linearFit, normalQuantile, predictionBand, quantiles, studentTQuantile } from './chart-stats.js';
|
|
10
|
+
export { ChartMetric, ChartMetricProps } from './components/ChartMetric.js';
|
|
10
11
|
import 'echarts';
|
|
11
12
|
|
|
12
13
|
/** Chart on the analytic build: everything the lean preset has for line and bar, plus the overlays. */
|
package/dist/chart-preset.cjs
CHANGED
|
@@ -173,8 +173,18 @@ function prefersReducedMotion() {
|
|
|
173
173
|
return typeof matchMedia !== "undefined" && matchMedia(QUERY).matches;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
// src/components/
|
|
176
|
+
// src/components/ChartMetric.tsx
|
|
177
177
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
178
|
+
function ChartMetric({ value, label, delta, deltaTone = "neutral", align, className, ...props }) {
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), "data-align": align, ...props, children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
|
|
181
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
|
|
182
|
+
delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// src/components/ChartCore.tsx
|
|
187
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
178
188
|
function readToken(name) {
|
|
179
189
|
if (typeof getComputedStyle === "undefined") return "";
|
|
180
190
|
return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
@@ -317,18 +327,18 @@ function ChartCore({
|
|
|
317
327
|
const hasTable = Boolean(tableData?.length && tableHeaders?.length);
|
|
318
328
|
const extraTables = (tables ?? []).filter((table) => table.headers.length && table.rows.length);
|
|
319
329
|
const describedBy = [hasTable ? tableId : null, ...extraTables.map((_, index) => `${tableId}-${index}`)].filter(Boolean).join(" ") || void 0;
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
321
|
-
title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0,
|
|
322
|
-
/* @__PURE__ */ (0,
|
|
330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cx("uix-chart", className), style, children: [
|
|
331
|
+
title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__header", children: [
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__heading", children: [
|
|
323
333
|
header,
|
|
324
|
-
title ? /* @__PURE__ */ (0,
|
|
325
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
334
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__title", children: title }) : null,
|
|
335
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
|
|
326
336
|
] }),
|
|
327
337
|
headerAction
|
|
328
338
|
] }) : null,
|
|
329
|
-
hasEmpty ? /* @__PURE__ */ (0,
|
|
330
|
-
loading ? /* @__PURE__ */ (0,
|
|
331
|
-
/* @__PURE__ */ (0,
|
|
339
|
+
hasEmpty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__plot", "data-empty": true, children: empty }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__plot", "data-loading": loading || void 0, "aria-busy": loading || void 0, children: [
|
|
340
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "uix-chart__loading", children: labels.loading }) : null,
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
332
342
|
"div",
|
|
333
343
|
{
|
|
334
344
|
ref: containerRef,
|
|
@@ -339,31 +349,24 @@ function ChartCore({
|
|
|
339
349
|
}
|
|
340
350
|
)
|
|
341
351
|
] }),
|
|
342
|
-
hasTable ? /* @__PURE__ */ (0,
|
|
343
|
-
/* @__PURE__ */ (0,
|
|
344
|
-
/* @__PURE__ */ (0,
|
|
352
|
+
hasTable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { id: tableId, className: "uix-visually-hidden", "aria-label": `${effectiveAriaLabel} \u2014 ${labels.dataTableSuffix}`, children: [
|
|
353
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { scope: "col", children: label }, label)) }) }),
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: tableData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: row[label] }, label)) }, index)) })
|
|
345
355
|
] }) : null,
|
|
346
|
-
extraTables.map((table, index) => /* @__PURE__ */ (0,
|
|
347
|
-
/* @__PURE__ */ (0,
|
|
348
|
-
/* @__PURE__ */ (0,
|
|
356
|
+
extraTables.map((table, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { id: `${tableId}-${index}`, className: "uix-visually-hidden", "aria-label": table.caption, children: [
|
|
357
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: table.headers.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { scope: "col", children: label }, label)) }) }),
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: table.headers.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: row[label] }, label)) }, rowIndex)) })
|
|
349
359
|
] }, index)),
|
|
350
|
-
footer != null && /* @__PURE__ */ (0,
|
|
351
|
-
] });
|
|
352
|
-
}
|
|
353
|
-
function ChartMetric({ value, label, delta, deltaTone = "neutral", className, ...props }) {
|
|
354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), ...props, children: [
|
|
355
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
|
|
356
|
-
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
|
|
357
|
-
delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
|
|
360
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__footer", children: footer })
|
|
358
361
|
] });
|
|
359
362
|
}
|
|
360
363
|
function ChartLegend({ children, className, ...props }) {
|
|
361
|
-
return /* @__PURE__ */ (0,
|
|
364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: cx("uix-legend", className), ...props, children });
|
|
362
365
|
}
|
|
363
366
|
function ChartLegendItem({ label, color, swatch = "block", className, style, ...props }) {
|
|
364
367
|
const mergedStyle = color ? { "--legend-color": color, ...style } : style;
|
|
365
|
-
return /* @__PURE__ */ (0,
|
|
366
|
-
/* @__PURE__ */ (0,
|
|
368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: cx("uix-legend__item", className), style: mergedStyle, ...props, children: [
|
|
369
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cx("uix-legend__swatch", swatch !== "block" && `uix-legend__swatch--${swatch}`), "aria-hidden": "true" }),
|
|
367
370
|
label
|
|
368
371
|
] });
|
|
369
372
|
}
|
|
@@ -384,7 +387,7 @@ function tokenMs(name, fallback, el) {
|
|
|
384
387
|
}
|
|
385
388
|
|
|
386
389
|
// src/components/Arrive.tsx
|
|
387
|
-
var
|
|
390
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
388
391
|
var REGISTRY = /* @__PURE__ */ Symbol.for("@tensor_1/react/arrive-contexts");
|
|
389
392
|
var registry = globalThis;
|
|
390
393
|
var contexts = registry[REGISTRY] ?? (registry[REGISTRY] = {
|
|
@@ -558,7 +561,7 @@ function pairedBarsOption(k, input, motion = GLANCE_AT_REST) {
|
|
|
558
561
|
}
|
|
559
562
|
|
|
560
563
|
// src/components/GlanceCharts.tsx
|
|
561
|
-
var
|
|
564
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
562
565
|
function useGlanceMotion() {
|
|
563
566
|
const { playing } = useArrive();
|
|
564
567
|
const index = useArriveIndex();
|
|
@@ -620,7 +623,7 @@ function GlanceLineChartCore({ engine, ariaLabel, categoryLabel = "Period", heig
|
|
|
620
623
|
...categories.map((c, i) => ({ [categoryLabel]: c, [name]: values[i] ?? "" })),
|
|
621
624
|
...forecast ? forecast.categories.map((c, i) => ({ [categoryLabel]: c, [name]: "", [forecast.name]: forecast.values[i] ?? "" })) : []
|
|
622
625
|
];
|
|
623
|
-
return /* @__PURE__ */ (0,
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
624
627
|
ChartCore,
|
|
625
628
|
{
|
|
626
629
|
engine,
|
|
@@ -654,7 +657,7 @@ function PairedBarChartCore({ engine, ariaLabel, categoryLabel = "Period", heigh
|
|
|
654
657
|
[JSON.stringify(categories), JSON.stringify(series), JSON.stringify(comparison), format, tooltipTitle, motion]
|
|
655
658
|
);
|
|
656
659
|
const rows = categories.map((c, i) => ({ [categoryLabel]: c, [series.name]: series.values[i] ?? "", [comparison.name]: comparison.values[i] ?? "" }));
|
|
657
|
-
return /* @__PURE__ */ (0,
|
|
660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
658
661
|
ChartCore,
|
|
659
662
|
{
|
|
660
663
|
engine,
|
|
@@ -676,7 +679,7 @@ function PairedBarChartCore({ engine, ariaLabel, categoryLabel = "Period", heigh
|
|
|
676
679
|
}
|
|
677
680
|
|
|
678
681
|
// src/chart-preset.tsx
|
|
679
|
-
var
|
|
682
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
680
683
|
echarts.use([
|
|
681
684
|
import_charts.BarChart,
|
|
682
685
|
import_charts.LineChart,
|
|
@@ -691,13 +694,13 @@ echarts.use([
|
|
|
691
694
|
]);
|
|
692
695
|
var presetEngine = echarts;
|
|
693
696
|
function Chart(props) {
|
|
694
|
-
return /* @__PURE__ */ (0,
|
|
697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChartCore, { ...props, engine: presetEngine });
|
|
695
698
|
}
|
|
696
699
|
function GlanceLineChart(props) {
|
|
697
|
-
return /* @__PURE__ */ (0,
|
|
700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GlanceLineChartCore, { ...props, engine: presetEngine });
|
|
698
701
|
}
|
|
699
702
|
function PairedBarChart(props) {
|
|
700
|
-
return /* @__PURE__ */ (0,
|
|
703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PairedBarChartCore, { ...props, engine: presetEngine });
|
|
701
704
|
}
|
|
702
705
|
// Annotate the CommonJS export names for ESM import in node:
|
|
703
706
|
0 && (module.exports = {
|
package/dist/chart-preset.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { a as ChartProps } from './ChartCore-
|
|
3
|
-
export { c as ChartEventHandler, C as ChartLabels, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as
|
|
4
|
-
import { G as GlanceLineChartProps, P as PairedBarChartProps } from './GlanceCharts-
|
|
5
|
-
export { a as GLANCE_AT_REST, b as GlanceChartBaseProps, c as GlanceFormat, d as GlanceLineInput, e as GlanceMotion, f as PAIRED_BARS_MAX_BUCKETS, g as PairedBarsInput, h as glanceLineOption, p as pairedBarsOption, u as uixGlanceBase } from './GlanceCharts-
|
|
2
|
+
import { a as ChartProps } from './ChartCore-BX0frnUz.cjs';
|
|
3
|
+
export { c as ChartEventHandler, C as ChartLabels, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as ChartOption, i as ChartTable, j as ChartTableRow, k as ChartTokenSource, D as DEFAULT_CHART_LABELS, U as UixChartTokens, m as mergeChartTheme, u as uixChartAreaGradient, l as uixChartPalette, n as uixChartTheme, o as uixChartTokens } from './ChartCore-BX0frnUz.cjs';
|
|
4
|
+
import { G as GlanceLineChartProps, P as PairedBarChartProps } from './GlanceCharts-PVaEwyp2.cjs';
|
|
5
|
+
export { a as GLANCE_AT_REST, b as GlanceChartBaseProps, c as GlanceFormat, d as GlanceLineInput, e as GlanceMotion, f as PAIRED_BARS_MAX_BUCKETS, g as PairedBarsInput, h as glanceLineOption, p as pairedBarsOption, u as uixGlanceBase } from './GlanceCharts-PVaEwyp2.cjs';
|
|
6
|
+
export { C as ChartMetric, a as ChartMetricProps } from './ChartMetric-bCAW4yvf.cjs';
|
|
6
7
|
import 'echarts';
|
|
7
8
|
|
|
8
9
|
/** Lean SVG adapter: line, bar, pie, dataset, grid, legend, title, and tooltip. */
|
package/dist/chart-preset.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ChartProps } from './components/ChartCore.js';
|
|
3
|
-
export { ChartEventHandler, ChartLabels, ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps,
|
|
3
|
+
export { ChartEventHandler, ChartLabels, ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps, ChartOption, ChartTable, ChartTableRow, DEFAULT_CHART_LABELS, uixChartPalette } from './components/ChartCore.js';
|
|
4
4
|
import { GlanceLineChartProps, PairedBarChartProps } from './components/GlanceCharts.js';
|
|
5
5
|
export { GlanceChartBaseProps } from './components/GlanceCharts.js';
|
|
6
6
|
export { ChartTokenSource, UixChartTokens, mergeChartTheme, uixChartAreaGradient, uixChartTheme, uixChartTokens } from './chart-theme.js';
|
|
7
7
|
export { GLANCE_AT_REST, GlanceFormat, GlanceLineInput, GlanceMotion, PAIRED_BARS_MAX_BUCKETS, PairedBarsInput, glanceLineOption, pairedBarsOption, uixGlanceBase } from './chart-glance.js';
|
|
8
|
+
export { ChartMetric, ChartMetricProps } from './components/ChartMetric.js';
|
|
8
9
|
import 'echarts';
|
|
9
10
|
|
|
10
11
|
/** Lean SVG adapter: line, bar, pie, dataset, grid, legend, title, and tooltip. */
|
package/dist/chart.cjs
CHANGED
|
@@ -171,8 +171,18 @@ function prefersReducedMotion() {
|
|
|
171
171
|
return typeof matchMedia !== "undefined" && matchMedia(QUERY).matches;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// src/components/
|
|
174
|
+
// src/components/ChartMetric.tsx
|
|
175
175
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
176
|
+
function ChartMetric({ value, label, delta, deltaTone = "neutral", align, className, ...props }) {
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), "data-align": align, ...props, children: [
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
|
|
179
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
|
|
180
|
+
delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
|
|
181
|
+
] });
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/components/ChartCore.tsx
|
|
185
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
176
186
|
function readToken(name) {
|
|
177
187
|
if (typeof getComputedStyle === "undefined") return "";
|
|
178
188
|
return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
@@ -315,18 +325,18 @@ function ChartCore({
|
|
|
315
325
|
const hasTable = Boolean(tableData?.length && tableHeaders?.length);
|
|
316
326
|
const extraTables = (tables ?? []).filter((table) => table.headers.length && table.rows.length);
|
|
317
327
|
const describedBy = [hasTable ? tableId : null, ...extraTables.map((_, index) => `${tableId}-${index}`)].filter(Boolean).join(" ") || void 0;
|
|
318
|
-
return /* @__PURE__ */ (0,
|
|
319
|
-
title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0,
|
|
320
|
-
/* @__PURE__ */ (0,
|
|
328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cx("uix-chart", className), style, children: [
|
|
329
|
+
title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__header", children: [
|
|
330
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__heading", children: [
|
|
321
331
|
header,
|
|
322
|
-
title ? /* @__PURE__ */ (0,
|
|
323
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
332
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__title", children: title }) : null,
|
|
333
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
|
|
324
334
|
] }),
|
|
325
335
|
headerAction
|
|
326
336
|
] }) : null,
|
|
327
|
-
hasEmpty ? /* @__PURE__ */ (0,
|
|
328
|
-
loading ? /* @__PURE__ */ (0,
|
|
329
|
-
/* @__PURE__ */ (0,
|
|
337
|
+
hasEmpty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__plot", "data-empty": true, children: empty }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "uix-chart__plot", "data-loading": loading || void 0, "aria-busy": loading || void 0, children: [
|
|
338
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "uix-chart__loading", children: labels.loading }) : null,
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
330
340
|
"div",
|
|
331
341
|
{
|
|
332
342
|
ref: containerRef,
|
|
@@ -337,31 +347,24 @@ function ChartCore({
|
|
|
337
347
|
}
|
|
338
348
|
)
|
|
339
349
|
] }),
|
|
340
|
-
hasTable ? /* @__PURE__ */ (0,
|
|
341
|
-
/* @__PURE__ */ (0,
|
|
342
|
-
/* @__PURE__ */ (0,
|
|
350
|
+
hasTable ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { id: tableId, className: "uix-visually-hidden", "aria-label": `${effectiveAriaLabel} \u2014 ${labels.dataTableSuffix}`, children: [
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { scope: "col", children: label }, label)) }) }),
|
|
352
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: tableData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: row[label] }, label)) }, index)) })
|
|
343
353
|
] }) : null,
|
|
344
|
-
extraTables.map((table, index) => /* @__PURE__ */ (0,
|
|
345
|
-
/* @__PURE__ */ (0,
|
|
346
|
-
/* @__PURE__ */ (0,
|
|
354
|
+
extraTables.map((table, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { id: `${tableId}-${index}`, className: "uix-visually-hidden", "aria-label": table.caption, children: [
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: table.headers.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { scope: "col", children: label }, label)) }) }),
|
|
356
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: table.rows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tr", { children: table.headers.map((label) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: row[label] }, label)) }, rowIndex)) })
|
|
347
357
|
] }, index)),
|
|
348
|
-
footer != null && /* @__PURE__ */ (0,
|
|
349
|
-
] });
|
|
350
|
-
}
|
|
351
|
-
function ChartMetric({ value, label, delta, deltaTone = "neutral", className, ...props }) {
|
|
352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), ...props, children: [
|
|
353
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
|
|
354
|
-
label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
|
|
355
|
-
delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
|
|
358
|
+
footer != null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "uix-chart__footer", children: footer })
|
|
356
359
|
] });
|
|
357
360
|
}
|
|
358
361
|
function ChartLegend({ children, className, ...props }) {
|
|
359
|
-
return /* @__PURE__ */ (0,
|
|
362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: cx("uix-legend", className), ...props, children });
|
|
360
363
|
}
|
|
361
364
|
function ChartLegendItem({ label, color, swatch = "block", className, style, ...props }) {
|
|
362
365
|
const mergedStyle = color ? { "--legend-color": color, ...style } : style;
|
|
363
|
-
return /* @__PURE__ */ (0,
|
|
364
|
-
/* @__PURE__ */ (0,
|
|
366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { className: cx("uix-legend__item", className), style: mergedStyle, ...props, children: [
|
|
367
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cx("uix-legend__swatch", swatch !== "block" && `uix-legend__swatch--${swatch}`), "aria-hidden": "true" }),
|
|
365
368
|
label
|
|
366
369
|
] });
|
|
367
370
|
}
|
|
@@ -382,7 +385,7 @@ function tokenMs(name, fallback, el) {
|
|
|
382
385
|
}
|
|
383
386
|
|
|
384
387
|
// src/components/Arrive.tsx
|
|
385
|
-
var
|
|
388
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
386
389
|
var REGISTRY = /* @__PURE__ */ Symbol.for("@tensor_1/react/arrive-contexts");
|
|
387
390
|
var registry = globalThis;
|
|
388
391
|
var contexts = registry[REGISTRY] ?? (registry[REGISTRY] = {
|
|
@@ -556,7 +559,7 @@ function pairedBarsOption(k, input, motion = GLANCE_AT_REST) {
|
|
|
556
559
|
}
|
|
557
560
|
|
|
558
561
|
// src/components/GlanceCharts.tsx
|
|
559
|
-
var
|
|
562
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
560
563
|
function useGlanceMotion() {
|
|
561
564
|
const { playing } = useArrive();
|
|
562
565
|
const index = useArriveIndex();
|
|
@@ -618,7 +621,7 @@ function GlanceLineChartCore({ engine, ariaLabel, categoryLabel = "Period", heig
|
|
|
618
621
|
...categories.map((c, i) => ({ [categoryLabel]: c, [name]: values[i] ?? "" })),
|
|
619
622
|
...forecast ? forecast.categories.map((c, i) => ({ [categoryLabel]: c, [name]: "", [forecast.name]: forecast.values[i] ?? "" })) : []
|
|
620
623
|
];
|
|
621
|
-
return /* @__PURE__ */ (0,
|
|
624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
622
625
|
ChartCore,
|
|
623
626
|
{
|
|
624
627
|
engine,
|
|
@@ -652,7 +655,7 @@ function PairedBarChartCore({ engine, ariaLabel, categoryLabel = "Period", heigh
|
|
|
652
655
|
[JSON.stringify(categories), JSON.stringify(series), JSON.stringify(comparison), format, tooltipTitle, motion]
|
|
653
656
|
);
|
|
654
657
|
const rows = categories.map((c, i) => ({ [categoryLabel]: c, [series.name]: series.values[i] ?? "", [comparison.name]: comparison.values[i] ?? "" }));
|
|
655
|
-
return /* @__PURE__ */ (0,
|
|
658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
656
659
|
ChartCore,
|
|
657
660
|
{
|
|
658
661
|
engine,
|
|
@@ -674,15 +677,15 @@ function PairedBarChartCore({ engine, ariaLabel, categoryLabel = "Period", heigh
|
|
|
674
677
|
}
|
|
675
678
|
|
|
676
679
|
// src/components/Chart.tsx
|
|
677
|
-
var
|
|
680
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
678
681
|
function Chart(props) {
|
|
679
|
-
return /* @__PURE__ */ (0,
|
|
682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChartCore, { ...props, engine: echarts });
|
|
680
683
|
}
|
|
681
684
|
function GlanceLineChart(props) {
|
|
682
|
-
return /* @__PURE__ */ (0,
|
|
685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(GlanceLineChartCore, { ...props, engine: echarts });
|
|
683
686
|
}
|
|
684
687
|
function PairedBarChart(props) {
|
|
685
|
-
return /* @__PURE__ */ (0,
|
|
688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PairedBarChartCore, { ...props, engine: echarts });
|
|
686
689
|
}
|
|
687
690
|
// Annotate the CommonJS export names for ESM import in node:
|
|
688
691
|
0 && (module.exports = {
|
package/dist/chart.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { a as ChartProps } from './ChartCore-
|
|
3
|
-
export { c as ChartEventHandler, C as ChartLabels, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as
|
|
4
|
-
import { G as GlanceLineChartProps, P as PairedBarChartProps } from './GlanceCharts-
|
|
5
|
-
export { a as GLANCE_AT_REST, b as GlanceChartBaseProps, c as GlanceFormat, d as GlanceLineInput, e as GlanceMotion, f as PAIRED_BARS_MAX_BUCKETS, g as PairedBarsInput, h as glanceLineOption, p as pairedBarsOption, u as uixGlanceBase } from './GlanceCharts-
|
|
2
|
+
import { a as ChartProps } from './ChartCore-BX0frnUz.cjs';
|
|
3
|
+
export { c as ChartEventHandler, C as ChartLabels, d as ChartLegend, e as ChartLegendItem, f as ChartLegendItemProps, g as ChartLegendProps, h as ChartOption, i as ChartTable, j as ChartTableRow, k as ChartTokenSource, D as DEFAULT_CHART_LABELS, U as UixChartTokens, m as mergeChartTheme, u as uixChartAreaGradient, l as uixChartPalette, n as uixChartTheme, o as uixChartTokens } from './ChartCore-BX0frnUz.cjs';
|
|
4
|
+
import { G as GlanceLineChartProps, P as PairedBarChartProps } from './GlanceCharts-PVaEwyp2.cjs';
|
|
5
|
+
export { a as GLANCE_AT_REST, b as GlanceChartBaseProps, c as GlanceFormat, d as GlanceLineInput, e as GlanceMotion, f as PAIRED_BARS_MAX_BUCKETS, g as PairedBarsInput, h as glanceLineOption, p as pairedBarsOption, u as uixGlanceBase } from './GlanceCharts-PVaEwyp2.cjs';
|
|
6
|
+
export { C as ChartMetric, a as ChartMetricProps } from './ChartMetric-bCAW4yvf.cjs';
|
|
6
7
|
import 'echarts';
|
|
7
8
|
|
|
8
9
|
/** Full-compatibility adapter. Use `@tensor_1/react/chart/preset` for the lean preset. */
|