@tensor_1/react 2.14.2 → 2.16.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.
Files changed (58) hide show
  1. package/README.md +5 -0
  2. package/dist/ChartCore-Do6gRBN3.d.cts +44 -0
  3. package/dist/chart-preset.cjs +41 -9
  4. package/dist/chart-preset.d.cts +2 -2
  5. package/dist/chart-preset.d.ts +1 -1
  6. package/dist/chart-preset.js +4 -1
  7. package/dist/chart.cjs +41 -9
  8. package/dist/chart.d.cts +2 -2
  9. package/dist/chart.d.ts +1 -1
  10. package/dist/chart.js +4 -1
  11. package/dist/combobox-model.d.ts +9 -0
  12. package/dist/combobox-model.js +10 -0
  13. package/dist/components/AsyncOperationStatus.d.ts +16 -0
  14. package/dist/components/AsyncOperationStatus.js +24 -0
  15. package/dist/components/Breadcrumbs.d.ts +18 -0
  16. package/dist/components/Breadcrumbs.js +14 -0
  17. package/dist/components/Card.d.ts +11 -2
  18. package/dist/components/Card.js +16 -1
  19. package/dist/components/Chart.d.ts +1 -1
  20. package/dist/components/Chart.js +4 -1
  21. package/dist/components/ChartCore.d.ts +24 -3
  22. package/dist/components/ChartCore.js +38 -9
  23. package/dist/components/CollapsibleSection.d.ts +11 -0
  24. package/dist/components/CollapsibleSection.js +17 -0
  25. package/dist/components/Combobox.d.ts +19 -0
  26. package/dist/components/Combobox.js +120 -0
  27. package/dist/components/DetailPage.d.ts +33 -0
  28. package/dist/components/DetailPage.js +19 -0
  29. package/dist/components/Dialogs.d.ts +35 -0
  30. package/dist/components/Dialogs.js +55 -0
  31. package/dist/components/Flow.d.ts +26 -0
  32. package/dist/components/Flow.js +48 -0
  33. package/dist/components/Modal.d.ts +3 -1
  34. package/dist/components/Modal.js +6 -4
  35. package/dist/components/Pipeline.d.ts +25 -0
  36. package/dist/components/Pipeline.js +65 -0
  37. package/dist/components/RelatedLinks.d.ts +16 -0
  38. package/dist/components/RelatedLinks.js +14 -0
  39. package/dist/components/RelativeTime.d.ts +23 -0
  40. package/dist/components/RelativeTime.js +40 -0
  41. package/dist/components/Sidebar.d.ts +7 -2
  42. package/dist/components/Sidebar.js +27 -9
  43. package/dist/components/States.d.ts +23 -4
  44. package/dist/components/States.js +28 -6
  45. package/dist/components/TableControls.d.ts +77 -0
  46. package/dist/components/TableControls.js +61 -0
  47. package/dist/components/ToggleRow.d.ts +14 -0
  48. package/dist/components/ToggleRow.js +16 -0
  49. package/dist/index.cjs +1392 -786
  50. package/dist/index.d.cts +323 -8
  51. package/dist/index.d.ts +16 -2
  52. package/dist/index.js +40 -2
  53. package/dist/relative-time-clock.d.ts +4 -0
  54. package/dist/relative-time-clock.js +33 -0
  55. package/dist/relative-time-model.d.ts +9 -0
  56. package/dist/relative-time-model.js +16 -0
  57. package/package.json +1 -1
  58. package/dist/ChartCore-Bt1C84ty.d.cts +0 -22
package/README.md CHANGED
@@ -37,6 +37,11 @@ For common line, bar, and pie charts, the tree-shaken preset avoids shipping the
37
37
  import { Chart } from "@tensor_1/react/chart/preset";
38
38
  ```
39
39
 
40
+ Both chart entries also export `ChartMetric`, `ChartLegend`, and `ChartLegendItem` for consistent analytical card
41
+ chrome. `Chart` supports `headerAction`, `footer`, `loading`, `empty`, and an accessible table equivalent. For
42
+ workflow surfaces, the main entry exports `Pipeline`/`PipelineStage` (compact or detailed operational rail) and
43
+ `Flow`/`FlowNode` (consumer-owned graph geometry with explicit text states).
44
+
40
45
  Large fixed-height tables can use `useVirtualRows(rows, { rowHeight })`; attach its `containerRef` to
41
46
  `TableWrap` and render the returned row window between spacer rows.
42
47
 
@@ -0,0 +1,44 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode, HTMLAttributes } from 'react';
3
+ import { EChartsOption, ECharts } from 'echarts';
4
+
5
+ declare function uixChartPalette(): string[];
6
+ interface ChartTableRow {
7
+ [key: string]: string | number;
8
+ }
9
+ interface ChartProps {
10
+ option: EChartsOption;
11
+ title?: string;
12
+ subtitle?: string;
13
+ height?: string | number;
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ ariaLabel?: string;
17
+ tableData?: ChartTableRow[];
18
+ tableHeaders?: string[];
19
+ onReady?: (chart: ECharts) => void;
20
+ header?: ReactNode;
21
+ headerAction?: ReactNode;
22
+ footer?: ReactNode;
23
+ loading?: boolean;
24
+ empty?: ReactNode;
25
+ }
26
+ interface ChartMetricProps extends HTMLAttributes<HTMLDivElement> {
27
+ value: ReactNode;
28
+ label?: ReactNode;
29
+ delta?: ReactNode;
30
+ deltaTone?: 'neutral' | 'positive' | 'negative' | 'warning';
31
+ }
32
+ declare function ChartMetric({ value, label, delta, deltaTone, className, ...props }: ChartMetricProps): react.JSX.Element;
33
+ interface ChartLegendProps extends HTMLAttributes<HTMLUListElement> {
34
+ children?: ReactNode;
35
+ }
36
+ declare function ChartLegend({ children, className, ...props }: ChartLegendProps): react.JSX.Element;
37
+ interface ChartLegendItemProps extends HTMLAttributes<HTMLLIElement> {
38
+ label: ReactNode;
39
+ color?: string;
40
+ swatch?: 'block' | 'line' | 'dash';
41
+ }
42
+ declare function ChartLegendItem({ label, color, swatch, className, style, ...props }: ChartLegendItemProps): react.JSX.Element;
43
+
44
+ export { type ChartProps as C, ChartLegend as a, ChartLegendItem as b, type ChartLegendItemProps as c, type ChartLegendProps as d, ChartMetric as e, type ChartMetricProps as f, type ChartTableRow as g, uixChartPalette as u };
@@ -32,6 +32,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
32
32
  var chart_preset_exports = {};
33
33
  __export(chart_preset_exports, {
34
34
  Chart: () => Chart,
35
+ ChartLegend: () => ChartLegend,
36
+ ChartLegendItem: () => ChartLegendItem,
37
+ ChartMetric: () => ChartMetric,
35
38
  uixChartPalette: () => uixChartPalette
36
39
  });
37
40
  module.exports = __toCommonJS(chart_preset_exports);
@@ -69,7 +72,11 @@ function ChartCore({
69
72
  tableData,
70
73
  tableHeaders,
71
74
  onReady,
72
- header
75
+ header,
76
+ headerAction,
77
+ footer,
78
+ loading = false,
79
+ empty
73
80
  }) {
74
81
  const containerRef = (0, import_react.useRef)(null);
75
82
  const chartRef = (0, import_react.useRef)(null);
@@ -77,6 +84,7 @@ function ChartCore({
77
84
  const latestOptionRef = (0, import_react.useRef)(option);
78
85
  const onReadyRef = (0, import_react.useRef)(onReady);
79
86
  const tableId = (0, import_react.useId)();
87
+ const hasEmpty = empty != null;
80
88
  latestOptionRef.current = option;
81
89
  onReadyRef.current = onReady;
82
90
  (0, import_react.useEffect)(() => {
@@ -110,7 +118,7 @@ function ChartCore({
110
118
  chartRef.current = null;
111
119
  appliedOptionRef.current = null;
112
120
  };
113
- }, [engine]);
121
+ }, [engine, hasEmpty]);
114
122
  (0, import_react.useEffect)(() => {
115
123
  const chart = chartRef.current;
116
124
  if (!chart || appliedOptionRef.current === option) return;
@@ -121,12 +129,15 @@ function ChartCore({
121
129
  const effectiveAriaLabel = ariaLabel ?? title ?? "Chart";
122
130
  const hasTable = Boolean(tableData?.length && tableHeaders?.length);
123
131
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart", className), style, children: [
124
- title != null || subtitle != null || header != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
125
- header,
126
- title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__title", children: title }) : null,
127
- subtitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
132
+ title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "uix-chart__header", children: [
133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "uix-chart__heading", children: [
134
+ header,
135
+ title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__title", children: title }) : null,
136
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
137
+ ] }),
138
+ headerAction
128
139
  ] }) : null,
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
140
+ hasEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__plot", "data-empty": true, children: empty }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__plot", "data-loading": loading || void 0, "aria-busy": loading || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
141
  "div",
131
142
  {
132
143
  ref: containerRef,
@@ -135,11 +146,29 @@ function ChartCore({
135
146
  "aria-label": effectiveAriaLabel,
136
147
  "aria-describedby": hasTable ? tableId : void 0
137
148
  }
138
- ),
149
+ ) }),
139
150
  hasTable ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { id: tableId, className: "sr-only", "aria-label": `${effectiveAriaLabel} \u2014 data table`, children: [
140
151
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { scope: "col", children: label }, label)) }) }),
141
152
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: tableData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: row[label] }, label)) }, index)) })
142
- ] }) : null
153
+ ] }) : null,
154
+ footer != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__footer", children: footer })
155
+ ] });
156
+ }
157
+ function ChartMetric({ value, label, delta, deltaTone = "neutral", className, ...props }) {
158
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), ...props, children: [
159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
160
+ label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
161
+ delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
162
+ ] });
163
+ }
164
+ function ChartLegend({ children, className, ...props }) {
165
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: cx("uix-legend", className), ...props, children });
166
+ }
167
+ function ChartLegendItem({ label, color, swatch = "block", className, style, ...props }) {
168
+ const mergedStyle = color ? { "--legend-color": color, ...style } : style;
169
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: cx("uix-legend__item", className), style: mergedStyle, ...props, children: [
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cx("uix-legend__swatch", swatch !== "block" && `uix-legend__swatch--${swatch}`), "aria-hidden": "true" }),
171
+ label
143
172
  ] });
144
173
  }
145
174
 
@@ -164,5 +193,8 @@ function Chart(props) {
164
193
  // Annotate the CommonJS export names for ESM import in node:
165
194
  0 && (module.exports = {
166
195
  Chart,
196
+ ChartLegend,
197
+ ChartLegendItem,
198
+ ChartMetric,
167
199
  uixChartPalette
168
200
  });
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { C as ChartProps } from './ChartCore-Bt1C84ty.cjs';
3
- export { a as ChartTableRow, u as uixChartPalette } from './ChartCore-Bt1C84ty.cjs';
2
+ import { C as ChartProps } from './ChartCore-Do6gRBN3.cjs';
3
+ export { a as ChartLegend, b as ChartLegendItem, c as ChartLegendItemProps, d as ChartLegendProps, e as ChartMetric, f as ChartMetricProps, g as ChartTableRow, u as uixChartPalette } from './ChartCore-Do6gRBN3.cjs';
4
4
  import 'echarts';
5
5
 
6
6
  /** Lean SVG adapter: line, bar, pie, dataset, grid, legend, title, and tooltip. */
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ChartProps } from './components/ChartCore.js';
3
- export { ChartTableRow, uixChartPalette } from './components/ChartCore.js';
3
+ export { ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps, ChartMetric, ChartMetricProps, ChartTableRow, uixChartPalette } from './components/ChartCore.js';
4
4
  import 'echarts';
5
5
 
6
6
  /** Lean SVG adapter: line, bar, pie, dataset, grid, legend, title, and tooltip. */
@@ -28,8 +28,11 @@ const presetEngine = echarts;
28
28
  function Chart(props) {
29
29
  return /* @__PURE__ */ jsx(ChartCore, { ...props, engine: presetEngine });
30
30
  }
31
- import { uixChartPalette } from "./components/ChartCore.js";
31
+ import { ChartLegend, ChartLegendItem, ChartMetric, uixChartPalette } from "./components/ChartCore.js";
32
32
  export {
33
33
  Chart,
34
+ ChartLegend,
35
+ ChartLegendItem,
36
+ ChartMetric,
34
37
  uixChartPalette
35
38
  };
package/dist/chart.cjs CHANGED
@@ -31,6 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var chart_exports = {};
32
32
  __export(chart_exports, {
33
33
  Chart: () => Chart,
34
+ ChartLegend: () => ChartLegend,
35
+ ChartLegendItem: () => ChartLegendItem,
36
+ ChartMetric: () => ChartMetric,
34
37
  uixChartPalette: () => uixChartPalette
35
38
  });
36
39
  module.exports = __toCommonJS(chart_exports);
@@ -67,7 +70,11 @@ function ChartCore({
67
70
  tableData,
68
71
  tableHeaders,
69
72
  onReady,
70
- header
73
+ header,
74
+ headerAction,
75
+ footer,
76
+ loading = false,
77
+ empty
71
78
  }) {
72
79
  const containerRef = (0, import_react.useRef)(null);
73
80
  const chartRef = (0, import_react.useRef)(null);
@@ -75,6 +82,7 @@ function ChartCore({
75
82
  const latestOptionRef = (0, import_react.useRef)(option);
76
83
  const onReadyRef = (0, import_react.useRef)(onReady);
77
84
  const tableId = (0, import_react.useId)();
85
+ const hasEmpty = empty != null;
78
86
  latestOptionRef.current = option;
79
87
  onReadyRef.current = onReady;
80
88
  (0, import_react.useEffect)(() => {
@@ -108,7 +116,7 @@ function ChartCore({
108
116
  chartRef.current = null;
109
117
  appliedOptionRef.current = null;
110
118
  };
111
- }, [engine]);
119
+ }, [engine, hasEmpty]);
112
120
  (0, import_react.useEffect)(() => {
113
121
  const chart = chartRef.current;
114
122
  if (!chart || appliedOptionRef.current === option) return;
@@ -119,12 +127,15 @@ function ChartCore({
119
127
  const effectiveAriaLabel = ariaLabel ?? title ?? "Chart";
120
128
  const hasTable = Boolean(tableData?.length && tableHeaders?.length);
121
129
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart", className), style, children: [
122
- title != null || subtitle != null || header != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
123
- header,
124
- title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__title", children: title }) : null,
125
- subtitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
130
+ title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "uix-chart__header", children: [
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "uix-chart__heading", children: [
132
+ header,
133
+ title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__title", children: title }) : null,
134
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__subtitle", children: subtitle }) : null
135
+ ] }),
136
+ headerAction
126
137
  ] }) : null,
127
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
138
+ hasEmpty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__plot", "data-empty": true, children: empty }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__plot", "data-loading": loading || void 0, "aria-busy": loading || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
128
139
  "div",
129
140
  {
130
141
  ref: containerRef,
@@ -133,11 +144,29 @@ function ChartCore({
133
144
  "aria-label": effectiveAriaLabel,
134
145
  "aria-describedby": hasTable ? tableId : void 0
135
146
  }
136
- ),
147
+ ) }),
137
148
  hasTable ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { id: tableId, className: "sr-only", "aria-label": `${effectiveAriaLabel} \u2014 data table`, children: [
138
149
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { scope: "col", children: label }, label)) }) }),
139
150
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: tableData.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: row[label] }, label)) }, index)) })
140
- ] }) : null
151
+ ] }) : null,
152
+ footer != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__footer", children: footer })
153
+ ] });
154
+ }
155
+ function ChartMetric({ value, label, delta, deltaTone = "neutral", className, ...props }) {
156
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cx("uix-chart__metric", className), ...props, children: [
157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-value", children: value }),
158
+ label != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__metric-label", children: label }),
159
+ delta != null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
160
+ ] });
161
+ }
162
+ function ChartLegend({ children, className, ...props }) {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: cx("uix-legend", className), ...props, children });
164
+ }
165
+ function ChartLegendItem({ label, color, swatch = "block", className, style, ...props }) {
166
+ const mergedStyle = color ? { "--legend-color": color, ...style } : style;
167
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: cx("uix-legend__item", className), style: mergedStyle, ...props, children: [
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: cx("uix-legend__swatch", swatch !== "block" && `uix-legend__swatch--${swatch}`), "aria-hidden": "true" }),
169
+ label
141
170
  ] });
142
171
  }
143
172
 
@@ -149,5 +178,8 @@ function Chart(props) {
149
178
  // Annotate the CommonJS export names for ESM import in node:
150
179
  0 && (module.exports = {
151
180
  Chart,
181
+ ChartLegend,
182
+ ChartLegendItem,
183
+ ChartMetric,
152
184
  uixChartPalette
153
185
  });
package/dist/chart.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
- import { C as ChartProps } from './ChartCore-Bt1C84ty.cjs';
3
- export { a as ChartTableRow, u as uixChartPalette } from './ChartCore-Bt1C84ty.cjs';
2
+ import { C as ChartProps } from './ChartCore-Do6gRBN3.cjs';
3
+ export { a as ChartLegend, b as ChartLegendItem, c as ChartLegendItemProps, d as ChartLegendProps, e as ChartMetric, f as ChartMetricProps, g as ChartTableRow, u as uixChartPalette } from './ChartCore-Do6gRBN3.cjs';
4
4
  import 'echarts';
5
5
 
6
6
  /** Full-compatibility adapter. Use `@tensor_1/react/chart/preset` for the lean preset. */
package/dist/chart.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Chart } from './components/Chart.js';
2
- export { ChartProps, ChartTableRow, uixChartPalette } from './components/ChartCore.js';
2
+ export { ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps, ChartMetric, ChartMetricProps, ChartProps, ChartTableRow, uixChartPalette } from './components/ChartCore.js';
3
3
  import 'react';
4
4
  import 'echarts';
package/dist/chart.js CHANGED
@@ -1,5 +1,8 @@
1
- import { Chart, uixChartPalette } from "./components/Chart.js";
1
+ import { Chart, ChartLegend, ChartLegendItem, ChartMetric, uixChartPalette } from "./components/Chart.js";
2
2
  export {
3
3
  Chart,
4
+ ChartLegend,
5
+ ChartLegendItem,
6
+ ChartMetric,
4
7
  uixChartPalette
5
8
  };
@@ -0,0 +1,9 @@
1
+ interface ComboboxOption {
2
+ value: string;
3
+ label: string;
4
+ keywords?: readonly string[];
5
+ disabled?: boolean;
6
+ }
7
+ declare function filterComboboxOptions(options: readonly ComboboxOption[], query: string): ComboboxOption[];
8
+
9
+ export { type ComboboxOption, filterComboboxOptions };
@@ -0,0 +1,10 @@
1
+ function filterComboboxOptions(options, query) {
2
+ const needle = query.trim().toLocaleLowerCase();
3
+ if (!needle) return [...options];
4
+ return options.filter(
5
+ (option) => [option.label, option.value, ...option.keywords ?? []].some((part) => part.toLocaleLowerCase().includes(needle))
6
+ );
7
+ }
8
+ export {
9
+ filterComboboxOptions
10
+ };
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ type AsyncOperationState = 'queued' | 'running' | 'complete' | 'failed';
5
+ interface AsyncOperationStatusProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
6
+ state: AsyncOperationState;
7
+ title: ReactNode;
8
+ statusLabel: ReactNode;
9
+ description?: ReactNode;
10
+ progress?: number;
11
+ progressLabel?: string;
12
+ action?: ReactNode;
13
+ }
14
+ declare function AsyncOperationStatus({ state, title, statusLabel, description, progress, progressLabel, action, className, ...props }: AsyncOperationStatusProps): react.JSX.Element;
15
+
16
+ export { type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps };
@@ -0,0 +1,24 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cx } from "../cx.js";
3
+ import { Progress } from "./Progress.js";
4
+ import { StatusPill } from "./StatusPill.js";
5
+ const tones = {
6
+ queued: "neutral",
7
+ running: "info",
8
+ complete: "success",
9
+ failed: "danger"
10
+ };
11
+ function AsyncOperationStatus({ state, title, statusLabel, description, progress, progressLabel, action, className, ...props }) {
12
+ return /* @__PURE__ */ jsxs("div", { className: cx("uix-operation", className), role: state === "failed" ? "alert" : "status", "aria-live": "polite", ...props, children: [
13
+ /* @__PURE__ */ jsxs("div", { className: "uix-operation__head", children: [
14
+ /* @__PURE__ */ jsx("strong", { children: title }),
15
+ /* @__PURE__ */ jsx(StatusPill, { tone: tones[state], children: statusLabel })
16
+ ] }),
17
+ description != null && /* @__PURE__ */ jsx("div", { className: "uix-operation__description", children: description }),
18
+ progress != null && /* @__PURE__ */ jsx(Progress, { value: progress, "aria-label": progressLabel }),
19
+ action != null && /* @__PURE__ */ jsx("div", { className: "uix-operation__action", children: action })
20
+ ] });
21
+ }
22
+ export {
23
+ AsyncOperationStatus
24
+ };
@@ -0,0 +1,18 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, HTMLAttributes } from 'react';
3
+
4
+ interface BreadcrumbItem {
5
+ id?: string;
6
+ label: ReactNode;
7
+ href?: string;
8
+ current?: boolean;
9
+ }
10
+ interface BreadcrumbsProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
11
+ items: readonly BreadcrumbItem[];
12
+ label: string;
13
+ separator?: ReactNode;
14
+ }
15
+ /** Framework-neutral breadcrumb navigation. Route adapters can replace anchors at the application seam. */
16
+ declare function Breadcrumbs({ items, label, separator, className, ...props }: BreadcrumbsProps): react.JSX.Element;
17
+
18
+ export { type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps };
@@ -0,0 +1,14 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ function Breadcrumbs({ items, label, separator = "/", className, ...props }) {
4
+ return /* @__PURE__ */ jsx("nav", { "aria-label": label, className, ...props, children: /* @__PURE__ */ jsx("ol", { className: "uix-breadcrumbs", children: items.map((item, index) => {
5
+ const current = item.current ?? index === items.length - 1;
6
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
7
+ index > 0 && /* @__PURE__ */ jsx("li", { className: "uix-breadcrumbs__sep", "aria-hidden": "true", children: separator }),
8
+ /* @__PURE__ */ jsx("li", { children: item.href && !current ? /* @__PURE__ */ jsx("a", { href: item.href, children: item.label }) : /* @__PURE__ */ jsx("span", { "aria-current": current ? "page" : void 0, children: item.label }) })
9
+ ] }, item.id ?? `${item.href ?? "current"}-${index}`);
10
+ }) }) });
11
+ }
12
+ export {
13
+ Breadcrumbs
14
+ };
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ReactNode } from 'react';
2
+ import { HTMLAttributes, ReactNode, AnchorHTMLAttributes } from 'react';
3
3
 
4
4
  interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
5
5
  title?: ReactNode;
@@ -9,5 +9,14 @@ interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
9
9
  children?: ReactNode;
10
10
  }
11
11
  declare function Card({ title, subtitle, headerAction, footer, children, className, ...props }: CardProps): react.JSX.Element;
12
+ interface CardLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'title'> {
13
+ title?: ReactNode;
14
+ subtitle?: ReactNode;
15
+ headerAction?: ReactNode;
16
+ footer?: ReactNode;
17
+ children?: ReactNode;
18
+ }
19
+ /** A whole-card anchor with visible hover and keyboard focus affordances. */
20
+ declare function CardLink({ title, subtitle, headerAction, footer, children, className, ...props }: CardLinkProps): react.JSX.Element;
12
21
 
13
- export { Card, type CardProps };
22
+ export { Card, CardLink, type CardLinkProps, type CardProps };
@@ -14,6 +14,21 @@ function Card({ title, subtitle, headerAction, footer, children, className, ...p
14
14
  footer != null && /* @__PURE__ */ jsx("div", { className: "uix-card__footer", children: footer })
15
15
  ] });
16
16
  }
17
+ function CardLink({ title, subtitle, headerAction, footer, children, className, ...props }) {
18
+ const hasHeader = title != null || subtitle != null || headerAction != null;
19
+ return /* @__PURE__ */ jsxs("a", { className: cx("uix-card", "uix-card--interactive", className), ...props, children: [
20
+ hasHeader && /* @__PURE__ */ jsxs("div", { className: "uix-card__header", children: [
21
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
22
+ title != null && /* @__PURE__ */ jsx("div", { className: "uix-card__title", children: title }),
23
+ subtitle != null && /* @__PURE__ */ jsx("div", { className: "uix-card__subtitle", children: subtitle })
24
+ ] }),
25
+ headerAction
26
+ ] }),
27
+ children != null && /* @__PURE__ */ jsx("div", { className: "uix-card__body", children }),
28
+ footer != null && /* @__PURE__ */ jsx("div", { className: "uix-card__footer", children: footer })
29
+ ] });
30
+ }
17
31
  export {
18
- Card
32
+ Card,
33
+ CardLink
19
34
  };
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ChartProps } from './ChartCore.js';
3
- export { ChartTableRow, uixChartPalette } from './ChartCore.js';
3
+ export { ChartLegend, ChartLegendItem, ChartLegendItemProps, ChartLegendProps, ChartMetric, ChartMetricProps, ChartTableRow, uixChartPalette } from './ChartCore.js';
4
4
  import 'echarts';
5
5
 
6
6
  /** Full-compatibility adapter. Use `@tensor_1/react/chart/preset` for the lean preset. */
@@ -2,11 +2,14 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import * as echarts from "echarts";
4
4
  import { ChartCore } from "./ChartCore.js";
5
- import { uixChartPalette } from "./ChartCore.js";
5
+ import { ChartLegend, ChartLegendItem, ChartMetric, uixChartPalette } from "./ChartCore.js";
6
6
  function Chart(props) {
7
7
  return /* @__PURE__ */ jsx(ChartCore, { ...props, engine: echarts });
8
8
  }
9
9
  export {
10
10
  Chart,
11
+ ChartLegend,
12
+ ChartLegendItem,
13
+ ChartMetric,
11
14
  uixChartPalette
12
15
  };
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { CSSProperties, ReactNode } from 'react';
2
+ import { CSSProperties, ReactNode, HTMLAttributes } from 'react';
3
3
  import { EChartsOption, ECharts } from 'echarts';
4
4
 
5
5
  interface ChartEngine {
@@ -23,11 +23,32 @@ interface ChartProps {
23
23
  tableHeaders?: string[];
24
24
  onReady?: (chart: ECharts) => void;
25
25
  header?: ReactNode;
26
+ headerAction?: ReactNode;
27
+ footer?: ReactNode;
28
+ loading?: boolean;
29
+ empty?: ReactNode;
26
30
  }
27
31
  interface ChartCoreProps extends ChartProps {
28
32
  engine: ChartEngine;
29
33
  }
30
34
  /** Shared chart lifecycle. Runtime adapters only choose the ECharts build. */
31
- declare function ChartCore({ engine, option, title, subtitle, height, className, style, ariaLabel, tableData, tableHeaders, onReady, header, }: ChartCoreProps): react.JSX.Element;
35
+ declare function ChartCore({ engine, option, title, subtitle, height, className, style, ariaLabel, tableData, tableHeaders, onReady, header, headerAction, footer, loading, empty, }: ChartCoreProps): react.JSX.Element;
36
+ interface ChartMetricProps extends HTMLAttributes<HTMLDivElement> {
37
+ value: ReactNode;
38
+ label?: ReactNode;
39
+ delta?: ReactNode;
40
+ deltaTone?: 'neutral' | 'positive' | 'negative' | 'warning';
41
+ }
42
+ declare function ChartMetric({ value, label, delta, deltaTone, className, ...props }: ChartMetricProps): react.JSX.Element;
43
+ interface ChartLegendProps extends HTMLAttributes<HTMLUListElement> {
44
+ children?: ReactNode;
45
+ }
46
+ declare function ChartLegend({ children, className, ...props }: ChartLegendProps): react.JSX.Element;
47
+ interface ChartLegendItemProps extends HTMLAttributes<HTMLLIElement> {
48
+ label: ReactNode;
49
+ color?: string;
50
+ swatch?: 'block' | 'line' | 'dash';
51
+ }
52
+ declare function ChartLegendItem({ label, color, swatch, className, style, ...props }: ChartLegendItemProps): react.JSX.Element;
32
53
 
33
- export { ChartCore, type ChartEngine, type ChartProps, type ChartTableRow, uixChartPalette };
54
+ export { ChartCore, type ChartEngine, ChartLegend, ChartLegendItem, type ChartLegendItemProps, type ChartLegendProps, ChartMetric, type ChartMetricProps, type ChartProps, type ChartTableRow, uixChartPalette };
@@ -21,7 +21,11 @@ function ChartCore({
21
21
  tableData,
22
22
  tableHeaders,
23
23
  onReady,
24
- header
24
+ header,
25
+ headerAction,
26
+ footer,
27
+ loading = false,
28
+ empty
25
29
  }) {
26
30
  const containerRef = useRef(null);
27
31
  const chartRef = useRef(null);
@@ -29,6 +33,7 @@ function ChartCore({
29
33
  const latestOptionRef = useRef(option);
30
34
  const onReadyRef = useRef(onReady);
31
35
  const tableId = useId();
36
+ const hasEmpty = empty != null;
32
37
  latestOptionRef.current = option;
33
38
  onReadyRef.current = onReady;
34
39
  useEffect(() => {
@@ -62,7 +67,7 @@ function ChartCore({
62
67
  chartRef.current = null;
63
68
  appliedOptionRef.current = null;
64
69
  };
65
- }, [engine]);
70
+ }, [engine, hasEmpty]);
66
71
  useEffect(() => {
67
72
  const chart = chartRef.current;
68
73
  if (!chart || appliedOptionRef.current === option) return;
@@ -73,12 +78,15 @@ function ChartCore({
73
78
  const effectiveAriaLabel = ariaLabel ?? title ?? "Chart";
74
79
  const hasTable = Boolean(tableData?.length && tableHeaders?.length);
75
80
  return /* @__PURE__ */ jsxs("div", { className: cx("uix-chart", className), style, children: [
76
- title != null || subtitle != null || header != null ? /* @__PURE__ */ jsxs("div", { children: [
77
- header,
78
- title ? /* @__PURE__ */ jsx("div", { className: "uix-chart__title", children: title }) : null,
79
- subtitle ? /* @__PURE__ */ jsx("div", { className: "uix-chart__subtitle", children: subtitle }) : null
81
+ title != null || subtitle != null || header != null || headerAction != null ? /* @__PURE__ */ jsxs("div", { className: "uix-chart__header", children: [
82
+ /* @__PURE__ */ jsxs("div", { className: "uix-chart__heading", children: [
83
+ header,
84
+ title ? /* @__PURE__ */ jsx("div", { className: "uix-chart__title", children: title }) : null,
85
+ subtitle ? /* @__PURE__ */ jsx("div", { className: "uix-chart__subtitle", children: subtitle }) : null
86
+ ] }),
87
+ headerAction
80
88
  ] }) : null,
81
- /* @__PURE__ */ jsx(
89
+ hasEmpty ? /* @__PURE__ */ jsx("div", { className: "uix-chart__plot", "data-empty": true, children: empty }) : /* @__PURE__ */ jsx("div", { className: "uix-chart__plot", "data-loading": loading || void 0, "aria-busy": loading || void 0, children: /* @__PURE__ */ jsx(
82
90
  "div",
83
91
  {
84
92
  ref: containerRef,
@@ -87,14 +95,35 @@ function ChartCore({
87
95
  "aria-label": effectiveAriaLabel,
88
96
  "aria-describedby": hasTable ? tableId : void 0
89
97
  }
90
- ),
98
+ ) }),
91
99
  hasTable ? /* @__PURE__ */ jsxs("table", { id: tableId, className: "sr-only", "aria-label": `${effectiveAriaLabel} \u2014 data table`, children: [
92
100
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ jsx("th", { scope: "col", children: label }, label)) }) }),
93
101
  /* @__PURE__ */ jsx("tbody", { children: tableData.map((row, index) => /* @__PURE__ */ jsx("tr", { children: tableHeaders.map((label) => /* @__PURE__ */ jsx("td", { children: row[label] }, label)) }, index)) })
94
- ] }) : null
102
+ ] }) : null,
103
+ footer != null && /* @__PURE__ */ jsx("div", { className: "uix-chart__footer", children: footer })
104
+ ] });
105
+ }
106
+ function ChartMetric({ value, label, delta, deltaTone = "neutral", className, ...props }) {
107
+ return /* @__PURE__ */ jsxs("div", { className: cx("uix-chart__metric", className), ...props, children: [
108
+ /* @__PURE__ */ jsx("div", { className: "uix-chart__metric-value", children: value }),
109
+ label != null && /* @__PURE__ */ jsx("div", { className: "uix-chart__metric-label", children: label }),
110
+ delta != null && /* @__PURE__ */ jsx("div", { className: "uix-chart__delta", "data-tone": deltaTone, children: delta })
111
+ ] });
112
+ }
113
+ function ChartLegend({ children, className, ...props }) {
114
+ return /* @__PURE__ */ jsx("ul", { className: cx("uix-legend", className), ...props, children });
115
+ }
116
+ function ChartLegendItem({ label, color, swatch = "block", className, style, ...props }) {
117
+ const mergedStyle = color ? { "--legend-color": color, ...style } : style;
118
+ return /* @__PURE__ */ jsxs("li", { className: cx("uix-legend__item", className), style: mergedStyle, ...props, children: [
119
+ /* @__PURE__ */ jsx("span", { className: cx("uix-legend__swatch", swatch !== "block" && `uix-legend__swatch--${swatch}`), "aria-hidden": "true" }),
120
+ label
95
121
  ] });
96
122
  }
97
123
  export {
98
124
  ChartCore,
125
+ ChartLegend,
126
+ ChartLegendItem,
127
+ ChartMetric,
99
128
  uixChartPalette
100
129
  };
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import { DetailsHTMLAttributes, ReactNode } from 'react';
3
+
4
+ interface CollapsibleSectionProps extends Omit<DetailsHTMLAttributes<HTMLDetailsElement>, 'title'> {
5
+ title: ReactNode;
6
+ summary?: ReactNode;
7
+ children?: ReactNode;
8
+ }
9
+ declare function CollapsibleSection({ title, summary, children, className, ...props }: CollapsibleSectionProps): react.JSX.Element;
10
+
11
+ export { CollapsibleSection, type CollapsibleSectionProps };