@carto/ps-react-ui 4.8.0 → 4.9.1

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 (129) hide show
  1. package/dist/{change-column-Cidl_M-4.js → change-column-B4IT0rh6.js} +2 -2
  2. package/dist/{change-column-Cidl_M-4.js.map → change-column-B4IT0rh6.js.map} +1 -1
  3. package/dist/components.js +4 -3
  4. package/dist/components.js.map +1 -1
  5. package/dist/{data-zoom-layout-BH0LPwSy.js → data-zoom-layout-0QSptXG_.js} +2 -2
  6. package/dist/{data-zoom-layout-BH0LPwSy.js.map → data-zoom-layout-0QSptXG_.js.map} +1 -1
  7. package/dist/{download-config-DNLkypdN.js → download-config-CzmjOT2T.js} +2 -2
  8. package/dist/{download-config-DNLkypdN.js.map → download-config-CzmjOT2T.js.map} +1 -1
  9. package/dist/{lasso-tool-BYbxrJ-7.js → lasso-tool-CDFj4zKY.js} +2 -1
  10. package/dist/lasso-tool-CDFj4zKY.js.map +1 -0
  11. package/dist/range-l4fNHLEg.js +213 -0
  12. package/dist/range-l4fNHLEg.js.map +1 -0
  13. package/dist/resolve-theme-color-BdojIw0K.js +47 -0
  14. package/dist/resolve-theme-color-BdojIw0K.js.map +1 -0
  15. package/dist/{spread-CTuIXZSM.js → spread-Y9R1f5dm.js} +2 -2
  16. package/dist/{spread-CTuIXZSM.js.map → spread-Y9R1f5dm.js.map} +1 -1
  17. package/dist/table-CQCAnDLb.js +388 -0
  18. package/dist/table-CQCAnDLb.js.map +1 -0
  19. package/dist/types/components/lasso-tool/styles.d.ts +1 -0
  20. package/dist/types/components/measurement-tools/styles.d.ts +1 -0
  21. package/dist/types/widgets/actions/brush-toggle/style.d.ts +1 -1
  22. package/dist/types/widgets/actions/shared/styles.d.ts +1 -1
  23. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +1 -1
  24. package/dist/types/widgets/echart/types.d.ts +1 -1
  25. package/dist/types/widgets/toolbar-actions/styles.d.ts +1 -1
  26. package/dist/types/widgets-v2/actions/brush-toggle/style.d.ts +1 -1
  27. package/dist/types/widgets-v2/actions/change-column/style.d.ts +1 -1
  28. package/dist/types/widgets-v2/actions/fullscreen/style.d.ts +1 -1
  29. package/dist/types/widgets-v2/actions/lock-selection/style.d.ts +1 -1
  30. package/dist/types/widgets-v2/actions/relative-data/style.d.ts +1 -1
  31. package/dist/types/widgets-v2/actions/searcher/style.d.ts +1 -1
  32. package/dist/types/widgets-v2/actions/stack-toggle/style.d.ts +1 -1
  33. package/dist/types/widgets-v2/actions/zoom-toggle/style.d.ts +1 -1
  34. package/dist/types/widgets-v2/bar/types.d.ts +8 -3
  35. package/dist/types/widgets-v2/category/types.d.ts +8 -4
  36. package/dist/types/widgets-v2/formula/types.d.ts +10 -7
  37. package/dist/types/widgets-v2/histogram/types.d.ts +7 -3
  38. package/dist/types/widgets-v2/index.d.ts +1 -0
  39. package/dist/types/widgets-v2/pie/types.d.ts +10 -3
  40. package/dist/types/widgets-v2/range/range-ui.d.ts +12 -4
  41. package/dist/types/widgets-v2/range/range.d.ts +13 -8
  42. package/dist/types/widgets-v2/scatterplot/types.d.ts +7 -3
  43. package/dist/types/widgets-v2/table/style.d.ts +0 -4
  44. package/dist/types/widgets-v2/table/table-ui.d.ts +7 -1
  45. package/dist/types/widgets-v2/table/table.d.ts +1 -1
  46. package/dist/types/widgets-v2/table/types.d.ts +13 -2
  47. package/dist/types/widgets-v2/timeseries/types.d.ts +7 -3
  48. package/dist/types/widgets-v2/types.d.ts +25 -0
  49. package/dist/types/widgets-v2/utils/index.d.ts +1 -0
  50. package/dist/types/widgets-v2/utils/resolve-theme-color.d.ts +18 -0
  51. package/dist/types/widgets-v2/utils/resolve-theme-color.test.d.ts +1 -0
  52. package/dist/types/widgets-v2/wrapper/style.d.ts +1 -2
  53. package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +6 -1
  54. package/dist/widgets/actions.js +1 -1
  55. package/dist/widgets/bar.js +1 -1
  56. package/dist/widgets/category.js +1 -1
  57. package/dist/widgets/formula.js +1 -1
  58. package/dist/widgets/histogram.js +1 -1
  59. package/dist/widgets/markdown.js +1 -1
  60. package/dist/widgets/pie.js +1 -1
  61. package/dist/widgets/scatterplot.js +1 -1
  62. package/dist/widgets/spread.js +1 -1
  63. package/dist/widgets/table.js +1 -1
  64. package/dist/widgets/timeseries.js +1 -1
  65. package/dist/widgets/utils.js +1 -1
  66. package/dist/widgets/wrapper.js +1 -1
  67. package/dist/widgets-v2/actions.js +1 -1
  68. package/dist/widgets-v2/bar.js +59 -56
  69. package/dist/widgets-v2/bar.js.map +1 -1
  70. package/dist/widgets-v2/category.js +1 -1
  71. package/dist/widgets-v2/formula.js +1 -1
  72. package/dist/widgets-v2/histogram.js +66 -63
  73. package/dist/widgets-v2/histogram.js.map +1 -1
  74. package/dist/widgets-v2/markdown.js +1 -1
  75. package/dist/widgets-v2/pie.js +101 -95
  76. package/dist/widgets-v2/pie.js.map +1 -1
  77. package/dist/widgets-v2/range.js +1 -1
  78. package/dist/widgets-v2/scatterplot.js +108 -102
  79. package/dist/widgets-v2/scatterplot.js.map +1 -1
  80. package/dist/widgets-v2/spread.js +2 -2
  81. package/dist/widgets-v2/table.js +3 -3
  82. package/dist/widgets-v2/timeseries.js +86 -80
  83. package/dist/widgets-v2/timeseries.js.map +1 -1
  84. package/dist/widgets-v2/utils.js +4 -3
  85. package/dist/widgets-v2.js +229 -229
  86. package/dist/widgets-v2.js.map +1 -1
  87. package/package.json +5 -3
  88. package/src/components/lasso-tool/styles.ts +1 -0
  89. package/src/components/measurement-tools/styles.ts +1 -0
  90. package/src/widgets/echart/types.ts +1 -1
  91. package/src/widgets-v2/bar/options.test.ts +19 -2
  92. package/src/widgets-v2/bar/options.ts +9 -3
  93. package/src/widgets-v2/bar/types.ts +8 -3
  94. package/src/widgets-v2/category/types.ts +9 -4
  95. package/src/widgets-v2/formula/types.ts +11 -7
  96. package/src/widgets-v2/histogram/options.test.ts +16 -2
  97. package/src/widgets-v2/histogram/options.ts +5 -4
  98. package/src/widgets-v2/histogram/types.ts +7 -3
  99. package/src/widgets-v2/index.ts +3 -0
  100. package/src/widgets-v2/pie/options.test.ts +20 -4
  101. package/src/widgets-v2/pie/options.ts +21 -17
  102. package/src/widgets-v2/pie/types.ts +10 -3
  103. package/src/widgets-v2/range/range-ui.test.tsx +8 -2
  104. package/src/widgets-v2/range/range-ui.tsx +81 -14
  105. package/src/widgets-v2/range/range.tsx +14 -8
  106. package/src/widgets-v2/scatterplot/options.test.ts +15 -3
  107. package/src/widgets-v2/scatterplot/options.ts +15 -11
  108. package/src/widgets-v2/scatterplot/types.ts +7 -3
  109. package/src/widgets-v2/table/style.ts +2 -5
  110. package/src/widgets-v2/table/table-ui.tsx +40 -7
  111. package/src/widgets-v2/table/table.tsx +6 -1
  112. package/src/widgets-v2/table/types.ts +13 -2
  113. package/src/widgets-v2/timeseries/options.test.ts +17 -2
  114. package/src/widgets-v2/timeseries/options.ts +10 -3
  115. package/src/widgets-v2/timeseries/types.ts +7 -3
  116. package/src/widgets-v2/types.ts +25 -0
  117. package/src/widgets-v2/utils/index.ts +1 -0
  118. package/src/widgets-v2/utils/resolve-theme-color.test.ts +43 -0
  119. package/src/widgets-v2/utils/resolve-theme-color.ts +34 -0
  120. package/src/widgets-v2/wrapper/style.ts +1 -2
  121. package/src/widgets-v2/wrapper/widget-wrapper.test.tsx +30 -0
  122. package/src/widgets-v2/wrapper/widget-wrapper.tsx +11 -1
  123. package/dist/lasso-tool-BYbxrJ-7.js.map +0 -1
  124. package/dist/merge-options-DCkkHZIf.js +0 -34
  125. package/dist/merge-options-DCkkHZIf.js.map +0 -1
  126. package/dist/range-DsqTjSpg.js +0 -186
  127. package/dist/range-DsqTjSpg.js.map +0 -1
  128. package/dist/table-HIpXuq4G.js +0 -390
  129. package/dist/table-HIpXuq4G.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { Theme } from '@mui/material';
2
2
  import { EChartsOption } from 'echarts';
3
+ import { WidgetSeries } from '../types';
3
4
  /** A single category entry in a bar series. */
4
5
  export interface BarDatum {
5
6
  name: string | number;
@@ -17,14 +18,18 @@ export interface BarOptionsInput {
17
18
  * Combined inputs for the option factory creator. Carries everything the
18
19
  * widget needs across BOTH phases — the structural-build (`theme`,
19
20
  * `formatter`, `labelFormatter`, `optionsOverride`) AND the data merge
20
- * (`seriesNames`, `selection`).
21
+ * (`series`, `selection`).
21
22
  */
22
23
  export interface BarOptionFactoryInput {
23
24
  theme: Theme;
24
25
  formatter?: (value: number) => string;
25
26
  labelFormatter?: (value: string | number) => string | number;
26
- /** Series names — drives the legend and `series[i].name`. */
27
- seriesNames?: readonly string[];
27
+ /**
28
+ * Per-series metadata — drives the legend, `series[i].name`, and
29
+ * (when `color` is set) per-series `itemStyle.color`. Paired with the
30
+ * data series by index.
31
+ */
32
+ series?: readonly WidgetSeries[];
28
33
  /**
29
34
  * When set, every datum whose `name` is **not** in this list renders dimmed
30
35
  * (`itemStyle.opacity: 0.15`, matching `outOfBrush` styling). `null`/empty
@@ -1,3 +1,4 @@
1
+ import { WidgetSeries } from '../types';
1
2
  /** A single row in a Category widget. `name` is the category key. */
2
3
  export interface CategoryDataItem {
3
4
  name: string | number;
@@ -26,10 +27,13 @@ export type CategoryKey = string | number;
26
27
  * gracefully (extra entries ignored; missing entries get palette
27
28
  * defaults and are absent from the legend).
28
29
  */
29
- export interface CategorySeriesConfig {
30
- name: string;
31
- color?: string;
32
- }
30
+ /**
31
+ * Per-series metadata. Type alias of the cross-widget
32
+ * {@link WidgetSeries} shape (`{ name, color? }`) so Category, Formula,
33
+ * Spread, and the echart-based widgets all consume the same input
34
+ * shape. Kept as a named export for backwards compatibility.
35
+ */
36
+ export type CategorySeriesConfig = WidgetSeries;
33
37
  /**
34
38
  * Labels for the "Other" overflow row (rendered when `data.length`
35
39
  * exceeds `maxItems`). `{count}` in `otherCount` is replaced with the
@@ -1,10 +1,13 @@
1
- /** Series metadata rendered as a coloured avatar at the start of a row. */
2
- export interface FormulaSeries {
3
- /** Used for the avatar's first-letter glyph and as accessible label. */
4
- name: string;
5
- /** Avatar background colour (any MUI palette path or CSS colour). */
6
- color?: string;
7
- }
1
+ import { WidgetSeries } from '../types';
2
+ /**
3
+ * Series metadata rendered as a coloured avatar at the start of a row.
4
+ *
5
+ * Type alias of the cross-widget {@link WidgetSeries} shape so the same
6
+ * `{ name, color? }` object can drive Formula avatars, Spread avatars,
7
+ * Category legends, and echart-widget legends with no per-widget shape
8
+ * gymnastics. Kept as a named export for backwards compatibility.
9
+ */
10
+ export type FormulaSeries = WidgetSeries;
8
11
  export type DeltaSeverity = 'positive' | 'negative' | 'neutral';
9
12
  /** Comparative delta rendered as a coloured chip on the right of a row. */
10
13
  export interface FormulaDelta {
@@ -1,5 +1,6 @@
1
1
  import { Theme } from '@mui/material';
2
2
  import { EChartsOption } from 'echarts';
3
+ import { WidgetSeries } from '../types';
3
4
  /**
4
5
  * Histogram widget data — array of series, each a flat array of bin counts.
5
6
  * The option factory's merge phase (see {@link createHistogramOptionFactory})
@@ -16,15 +17,18 @@ export interface HistogramOptionsInput {
16
17
  * Combined inputs for the histogram option factory creator. Carries
17
18
  * everything the widget needs across BOTH phases — the structural-build
18
19
  * (`theme`, `formatter`, `optionsOverride`) AND the data merge (`ticks`,
19
- * `seriesNames`, `labelFormatter`, `selection`).
20
+ * `series`, `labelFormatter`, `selection`).
20
21
  */
21
22
  export interface HistogramOptionFactoryInput {
22
23
  theme: Theme;
23
24
  formatter?: (value: number) => string;
24
25
  /** Bin boundaries — length = bins + 1. */
25
26
  ticks: readonly number[];
26
- /** Optional series names — drives the legend. */
27
- seriesNames?: readonly string[];
27
+ /**
28
+ * Per-series metadata — drives the legend, `series[i].name`, and
29
+ * (when `color` is set) a per-series colour override on the bars.
30
+ */
31
+ series?: readonly WidgetSeries[];
28
32
  /**
29
33
  * Bin-range label transform (e.g. `"0–10"` → `"[0–10)"`). Distinct from
30
34
  * the standard `OptionFactoryContext.labelFormatter` (which operates on
@@ -105,3 +105,4 @@ export type { SpreadUIProps, SpreadDataItem, SpreadWidgetData } from './spread';
105
105
  export type { RangeProps, RangeUIProps, RangeDataItem, RangeWidgetData, RangeItemValue, } from './range';
106
106
  export type { CategoryProps, CategoryUIProps, CategoryDataItem, CategoryWidgetData, CategoryKey, CategorySeriesConfig, CategoryLabels, } from './category';
107
107
  export type { TableProps, TableUIProps, TableColumn, TableRow, TableWidgetData, TableWidgetState, TableSortDirection, TableSortState, } from './table';
108
+ export type { WidgetSeries } from './types';
@@ -1,5 +1,6 @@
1
1
  import { Theme } from '@mui/material';
2
2
  import { EChartsOption } from 'echarts';
3
+ import { WidgetSeries } from '../types';
3
4
  /** A single slice of a pie series. */
4
5
  export interface PieDatum {
5
6
  name: string | number;
@@ -19,7 +20,7 @@ export interface PieOptionsInput {
19
20
  * Combined inputs for the pie option factory creator. Carries everything
20
21
  * the widget needs across BOTH phases — the structural-build (`theme`,
21
22
  * `formatter`, `labelFormatter`, `optionsOverride`) AND the data merge
22
- * (`seriesNames`, `radius`, `selection`). The merger emits different
23
+ * (`series`, `radius`, `selection`). The merger emits different
23
24
  * chart shapes by series count: single → donut, multi → horizontal-bar
24
25
  * fallback (mirrors v1 pie); both branches read `theme` for styling.
25
26
  */
@@ -27,8 +28,14 @@ export interface PieOptionFactoryInput {
27
28
  theme: Theme;
28
29
  formatter?: (value: number) => string;
29
30
  labelFormatter?: (value: string | number) => string | number;
30
- /** Series names — drives the legend and series.name. */
31
- seriesNames?: readonly string[];
31
+ /**
32
+ * Per-series metadata — drives the legend, `series[i].name`, and (in
33
+ * the multi-series bar fallback) per-series colour overrides.
34
+ * Single-series donuts always use the per-slice palette regardless of
35
+ * any `series[0].color`, since the donut palette is keyed by data
36
+ * index, not series index.
37
+ */
38
+ series?: readonly WidgetSeries[];
32
39
  /**
33
40
  * Inner/outer radius (percent). Default `['58%', '74%']` produces a
34
41
  * donut sized to leave room for the wrappable bottom legend. Set
@@ -2,11 +2,19 @@ import { RangeDataItem, RangeItemValue } from './types';
2
2
  export interface RangeUIProps {
3
3
  items: readonly RangeDataItem[];
4
4
  /**
5
- * Fires when the user drags a thumb or commits a new value via the text
6
- * inputs. Per the destination-owned principle, the consumer owns the
7
- * value this widget surfaces changes but does not store them.
5
+ * Fires on every pointer tick while a thumb is being dragged (mirrors
6
+ * MUI `<Slider>`'s `onChange`). Use this to update local UI state
7
+ * not to persist expensive operations like remote queries.
8
8
  */
9
9
  onChange?: (index: number, value: RangeItemValue) => void;
10
+ /**
11
+ * Fires once when the user *releases* a slider thumb after dragging,
12
+ * after an arrow-key adjustment commits, or when the text inputs
13
+ * blur / Enter. Mirrors MUI `<Slider>`'s `onChangeCommitted`. Use
14
+ * this for side-effects you want to throttle to "drag end" — e.g.
15
+ * writing the value to a source filter that triggers refetches.
16
+ */
17
+ onChangeCommitted?: (index: number, value: RangeItemValue) => void;
10
18
  /** Number formatter for the slider tooltip and the text input display. */
11
19
  formatter?: (value: number) => string;
12
20
  }
@@ -16,4 +24,4 @@ export interface RangeUIProps {
16
24
  * UX. Each item is always a two-thumb range; supply `value` to seed the
17
25
  * starting selection, otherwise it defaults to `[min, max]`.
18
26
  */
19
- export declare function RangeUI({ items, onChange, formatter }: RangeUIProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare function RangeUI({ items, onChange, onChangeCommitted, formatter, }: RangeUIProps): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +1,24 @@
1
1
  import { RangeItemValue } from './types';
2
2
  export interface RangeProps {
3
3
  /**
4
- * Fires when the user moves a slider thumb or commits a new value via the
5
- * text inputs. Receives the item index in `state.data` and the new
6
- * `[low, high]` tuple. The consumer owns the data state — the widget
7
- * surfaces changes but does not persist them.
4
+ * Fires on every pointer tick while a thumb is being dragged. Use this
5
+ * for cheap UI updates (local state, optimistic display).
8
6
  */
9
7
  onChange?: (index: number, value: RangeItemValue) => void;
8
+ /**
9
+ * Fires once when the user *releases* a slider thumb (or when the text
10
+ * inputs blur / Enter, or when an arrow-key adjustment settles). Use
11
+ * this for expensive side-effects you want throttled to drag end —
12
+ * e.g. writing the value to a source filter that refetches widgets.
13
+ */
14
+ onChangeCommitted?: (index: number, value: RangeItemValue) => void;
10
15
  }
11
16
  /**
12
17
  * Stateful Range bridge — reads `data` (post-pipeline) and `formatter` from
13
18
  * the per-widget store and forwards them to the pure {@link RangeUI}. Per
14
19
  * the destination-owned principle, value changes flow back through
15
- * `onChange` the consumer is expected to update the data prop on
16
- * `<Provider>`. Use `disabled` on individual `RangeDataItem`s to disable
17
- * specific rows.
20
+ * `onChange` (per-tick) and `onChangeCommitted` (drag end) the consumer
21
+ * is expected to update the data prop on `<Provider>`. Use `disabled` on
22
+ * individual `RangeDataItem`s to disable specific rows.
18
23
  */
19
- export declare function Range({ onChange }: RangeProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function Range({ onChange, onChangeCommitted }: RangeProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { Theme } from '@mui/material';
2
2
  import { EChartsOption } from 'echarts';
3
+ import { WidgetSeries } from '../types';
3
4
  /** A single point — `[x, y]` tuple. */
4
5
  export type ScatterplotDatum = readonly [number, number];
5
6
  /** Scatterplot widget data — array of series, each a list of `[x, y]` tuples. */
@@ -16,7 +17,7 @@ export interface ScatterplotOptionsInput {
16
17
  * Combined inputs for the scatterplot option factory creator. Carries
17
18
  * everything the widget needs across BOTH phases — the structural-build
18
19
  * (`theme`, `xFormatter`, `yFormatter`, `optionsOverride`) AND the data
19
- * merge (`seriesNames`, `symbolSize`, `selection`).
20
+ * merge (`series`, `symbolSize`, `selection`).
20
21
  */
21
22
  export interface ScatterplotOptionFactoryInput {
22
23
  theme: Theme;
@@ -30,8 +31,11 @@ export interface ScatterplotOptionFactoryInput {
30
31
  xFormatter?: (value: number) => string;
31
32
  /** Optional formatter for y-axis values (structural baseline). */
32
33
  yFormatter?: (value: number) => string;
33
- /** Series names — drives the legend and `series[i].name`. */
34
- seriesNames?: readonly string[];
34
+ /**
35
+ * Per-series metadata — drives the legend, `series[i].name`, and
36
+ * (when `color` is set) a per-series colour override on the points.
37
+ */
38
+ series?: readonly WidgetSeries[];
35
39
  /** Symbol size in px (default `8`). */
36
40
  symbolSize?: number;
37
41
  /**
@@ -3,10 +3,6 @@ export declare const styles: {
3
3
  width: string;
4
4
  overflowX: "auto";
5
5
  };
6
- /**
7
- * Minimum table width so columns don't collapse to unreadable widths on
8
- * narrow widget shells. Mirrors v1.
9
- */
10
6
  table: {
11
7
  minWidth: number;
12
8
  };
@@ -11,6 +11,12 @@ export interface TableUIProps<T extends TableRow = TableRow> {
11
11
  pageSize: number;
12
12
  pageSizeOptions?: readonly number[];
13
13
  sort?: TableSortState;
14
+ /**
15
+ * Column name to use as the row identity. Drives selection lookup,
16
+ * React keys, and aria labels. Defaults to `'id'` — point it at
17
+ * another column when your rows don't carry an `id` field.
18
+ */
19
+ keyColumn?: string;
14
20
  /** Selected row ids. Destination-owned. */
15
21
  selection?: readonly (string | number)[];
16
22
  selectable?: boolean;
@@ -35,4 +41,4 @@ export interface TableUIProps<T extends TableRow = TableRow> {
35
41
  * Has no widget-store coupling — `<Table>` (the bridge) reads from the store
36
42
  * and feeds this UI with already-projected data.
37
43
  */
38
- export declare function TableUI<T extends TableRow = TableRow>({ columns, rows, total, page, pageSize, pageSizeOptions, sort, selection, selectable, onSortChange, onPageChange, onPageSizeChange, onSelectionChange, onRowClick, onRowHover, labels, emptyContent, size, }: TableUIProps<T>): import("react/jsx-runtime").JSX.Element;
44
+ export declare function TableUI<T extends TableRow = TableRow>({ columns, rows, total, page, pageSize, pageSizeOptions, sort, keyColumn, selection, selectable, onSortChange, onPageChange, onPageSizeChange, onSelectionChange, onRowClick, onRowHover, labels, emptyContent, size, }: TableUIProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { TableUIProps } from './table-ui';
2
2
  import { TableColumn, TableRow, TableSortState } from './types';
3
- export interface TableProps<T extends TableRow = TableRow> extends Pick<TableUIProps<T>, 'pageSizeOptions' | 'selectable' | 'labels' | 'emptyContent' | 'size'> {
3
+ export interface TableProps<T extends TableRow = TableRow> extends Pick<TableUIProps<T>, 'pageSizeOptions' | 'selectable' | 'labels' | 'emptyContent' | 'size' | 'keyColumn'> {
4
4
  /**
5
5
  * Column definitions. Order can be overridden by ChangeColumn via the
6
6
  * `columnOrder` field on the extended widget state.
@@ -1,8 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { WidgetState } from '../stores';
3
- /** Single row of tabular data. Must have an `id` for selection / keying. */
3
+ /**
4
+ * Single row of tabular data.
5
+ *
6
+ * The default row-identity column is `id`. Consumers that don't have a
7
+ * literal `id` field can point `<Table>` / `<TableUI>` at a different
8
+ * column via the `keyColumn` prop; the library reads `row[keyColumn]`
9
+ * for selection lookup, React keys, and aria labels.
10
+ */
4
11
  export interface TableRow extends Record<string, unknown> {
5
- id: string | number;
12
+ /**
13
+ * Default row identity. Required when no `keyColumn` is configured.
14
+ * Omit when wiring `keyColumn` to a different column.
15
+ */
16
+ id?: string | number;
6
17
  }
7
18
  export type TableWidgetData = readonly TableRow[];
8
19
  export type TableSortDirection = 'asc' | 'desc';
@@ -1,5 +1,6 @@
1
1
  import { Theme } from '@mui/material';
2
2
  import { EChartsOption } from 'echarts';
3
+ import { WidgetSeries } from '../types';
3
4
  /**
4
5
  * A single point on a time series. `name` is the time coordinate — accepts a
5
6
  * Date object, a number (ms-since-epoch), or an ISO-8601 string. ECharts'
@@ -22,7 +23,7 @@ export interface TimeseriesOptionsInput {
22
23
  * Combined inputs for the timeseries option factory creator. Carries
23
24
  * everything the widget needs across BOTH phases — the structural-build
24
25
  * (`theme`, `formatter`, `labelFormatter`, `optionsOverride`) AND the
25
- * data merge (`seriesNames`, `smooth`, `area`, `selection`).
26
+ * data merge (`series`, `smooth`, `area`, `selection`).
26
27
  */
27
28
  export interface TimeseriesOptionFactoryInput {
28
29
  theme: Theme;
@@ -34,8 +35,11 @@ export interface TimeseriesOptionFactoryInput {
34
35
  * RelativeData's reactive formatter swaps.
35
36
  */
36
37
  labelFormatter?: (value: Date) => string;
37
- /** Series names — drives the legend and `series[i].name`. */
38
- seriesNames?: readonly string[];
38
+ /**
39
+ * Per-series metadata — drives the legend, `series[i].name`, and
40
+ * (when `color` is set) per-series line + marker colour overrides.
41
+ */
42
+ series?: readonly WidgetSeries[];
39
43
  /** Smooth lines (default `true`). */
40
44
  smooth?: boolean;
41
45
  /** Filled area below each line (default `false`). */
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Canonical cross-widget series metadata.
3
+ *
4
+ * Every widget that can carry multiple series (Bar, Pie, Histogram,
5
+ * Scatterplot, Timeseries, Category, Formula, Spread) accepts a
6
+ * `series: readonly WidgetSeries[]` prop. The `name` drives legends,
7
+ * tooltips, and category-row avatars; the optional `color` overrides
8
+ * the default palette assignment.
9
+ *
10
+ * For backward compatibility, the widget-specific names
11
+ * (`FormulaSeries`, `CategorySeriesConfig`) are kept as type aliases of
12
+ * `WidgetSeries` — see `formula/types.ts` and `category/types.ts`.
13
+ *
14
+ * Colours accept MUI theme paths (e.g. `'primary.main'`) as well as raw
15
+ * CSS strings (`'#ff0000'`, `'rgb(…)'`). The echart-based widgets
16
+ * resolve them through `resolveThemeColor` (see
17
+ * `widgets-v2/utils/resolve-theme-color.ts`); Category and Formula/Spread
18
+ * resolve them implicitly via MUI's `sx` prop.
19
+ */
20
+ export interface WidgetSeries {
21
+ /** Display name — drives legend, tooltip, and avatar glyphs. */
22
+ name: string;
23
+ /** Optional colour override. MUI theme path or raw CSS string. */
24
+ color?: string;
25
+ }
@@ -1,2 +1,3 @@
1
1
  export { mergeOptions } from './merge-options';
2
2
  export { positionDataZoomForLegend } from './data-zoom-layout';
3
+ export { resolveThemeColor } from './resolve-theme-color';
@@ -0,0 +1,18 @@
1
+ import { Theme } from '@mui/material';
2
+ /**
3
+ * Resolve a colour string against the MUI theme palette.
4
+ *
5
+ * - `'primary.main'`, `'secondary.dark'`, `'success.contrastText'`, … →
6
+ * walks `theme.palette` along the dot-separated path and returns the
7
+ * resolved string when traversal succeeds.
8
+ * - `'#ff0000'`, `'rgb(255, 0, 0)'`, `'red'` → returned as-is (assumed
9
+ * raw CSS; ECharts consumes them directly).
10
+ * - `undefined` → `undefined` (callers fall back to ECharts' palette).
11
+ *
12
+ * Used by the echart option factories (Bar, Pie, Histogram, Scatterplot,
13
+ * Timeseries) so per-series colours specified as theme paths in the
14
+ * unified `WidgetSeries` shape paint correctly. Category, Formula, and
15
+ * Spread render colours through MUI's `sx` resolver, which already
16
+ * handles theme paths — they don't need this helper.
17
+ */
18
+ export declare function resolveThemeColor(theme: Theme, raw: string | undefined): string | undefined;
@@ -5,10 +5,9 @@ export declare const styles: {
5
5
  width: string;
6
6
  minWidth: number;
7
7
  bgcolor: "background.paper";
8
- border: "1px solid";
9
- borderColor: "divider";
10
8
  borderRadius: number;
11
9
  overflow: "hidden";
10
+ boxShadow: "none";
12
11
  '&::before': {
13
12
  display: "none";
14
13
  };
@@ -23,6 +23,11 @@ export interface WrapperProps {
23
23
  */
24
24
  defaultCollapsed?: boolean;
25
25
  disabled?: boolean;
26
+ /**
27
+ * Visual variant. `'elevation'` (default) renders a borderless shell;
28
+ * `'outlined'` adds a 1px divider border around the card.
29
+ */
30
+ variant?: 'outlined' | 'elevation';
26
31
  labels?: Partial<WrapperLabels>;
27
32
  /**
28
33
  * Icon shown at the right edge of the summary row. Accordion rotates it
@@ -48,4 +53,4 @@ export interface WrapperProps {
48
53
  * render inside the summary row; everything else (`<Content>`, `<Footer>`,
49
54
  * loose nodes) renders inside the details panel.
50
55
  */
51
- export declare function Wrapper({ title, collapsed, onCollapseChange, defaultCollapsed, disabled, labels, expandIcon: ExpandIcon, iconProps, sx, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
56
+ export declare function Wrapper({ title, collapsed, onCollapseChange, defaultCollapsed, disabled, variant, labels, expandIcon: ExpandIcon, iconProps, sx, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { u as ne } from "../use-widget-selector-DFl2hW0R.js";
6
6
  import { FullscreenOutlined as je, Close as Ue, FileDownloadOutlined as Xe, PercentOutlined as Ye, SubdirectoryArrowLeftOutlined as Ke, ZoomInOutlined as qe, CheckBoxOutlined as Je, SearchOutlined as ze, ClearOutlined as Qe, HighlightAltOutlined as et } from "@mui/icons-material";
7
7
  import { useState as ie, useRef as le, useEffect as H, useSyncExternalStore as ve } from "react";
8
8
  import { a as Pn, d as Rn } from "../exports-Cr43OCul.js";
9
- import "../lasso-tool-BYbxrJ-7.js";
9
+ import "../lasso-tool-CDFj4zKY.js";
10
10
  import "../cjs-D4KH3azB.js";
11
11
  import { T as re } from "../tooltip-BDnrRKrp.js";
12
12
  import { b as tt, a as nt, D as ot } from "../utils-BOhInag6.js";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as w } from "../options-CthfUJDz.js";
8
8
  import { m as v } from "../utils-BOhInag6.js";
9
- import { c as L, f as S } from "../download-config-DNLkypdN.js";
9
+ import { c as L, f as S } from "../download-config-CzmjOT2T.js";
10
10
  import { h as _, f as C, g as M, n as u, a as A, c as I, d as N } from "../option-builders-F-c9ELi1.js";
11
11
  import { Box as l, Skeleton as o } from "@mui/material";
12
12
  import { b as T } from "../styles-cohnxh9F.js";
@@ -9,7 +9,7 @@ import "../widget-store-Bw5zRUGg.js";
9
9
  import "zustand/shallow";
10
10
  import "@mui/icons-material";
11
11
  import { d as U, a as N } from "../exports-Cr43OCul.js";
12
- import "../lasso-tool-BYbxrJ-7.js";
12
+ import "../lasso-tool-CDFj4zKY.js";
13
13
  import "../cjs-D4KH3azB.js";
14
14
  import "@dnd-kit/core";
15
15
  import "@dnd-kit/sortable";
@@ -10,7 +10,7 @@ import "zustand/shallow";
10
10
  import "@mui/icons-material";
11
11
  import "react";
12
12
  import { d as h, a as S } from "../exports-Cr43OCul.js";
13
- import "../lasso-tool-BYbxrJ-7.js";
13
+ import "../lasso-tool-CDFj4zKY.js";
14
14
  import "../cjs-D4KH3azB.js";
15
15
  import "@dnd-kit/core";
16
16
  import "@dnd-kit/sortable";
@@ -10,7 +10,7 @@ import { i as v, f as $, g as A, n as u, c as M, d as T } from "../option-builde
10
10
  import { Box as f, Skeleton as y } from "@mui/material";
11
11
  import "@mui/icons-material";
12
12
  import { d as h, a as d } from "../exports-Cr43OCul.js";
13
- import "../lasso-tool-BYbxrJ-7.js";
13
+ import "../lasso-tool-CDFj4zKY.js";
14
14
  import "../cjs-D4KH3azB.js";
15
15
  import "@dnd-kit/core";
16
16
  import "@dnd-kit/sortable";
@@ -7,7 +7,7 @@ import "../widget-store-Bw5zRUGg.js";
7
7
  import "@mui/icons-material";
8
8
  import "react";
9
9
  import "html2canvas";
10
- import "../lasso-tool-BYbxrJ-7.js";
10
+ import "../lasso-tool-CDFj4zKY.js";
11
11
  import "../cjs-D4KH3azB.js";
12
12
  import "@dnd-kit/core";
13
13
  import "@dnd-kit/sortable";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as L } from "../options-CthfUJDz.js";
8
8
  import { m as N } from "../utils-BOhInag6.js";
9
- import { c as j, f as A } from "../download-config-DNLkypdN.js";
9
+ import { c as j, f as A } from "../download-config-CzmjOT2T.js";
10
10
  import { h as O, f as b, g as T, n as v, c as S, d as _ } from "../option-builders-F-c9ELi1.js";
11
11
  import { Box as h, Skeleton as f } from "@mui/material";
12
12
  import { b as z } from "../styles-cohnxh9F.js";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as b } from "../options-CthfUJDz.js";
8
8
  import { m as S } from "../utils-BOhInag6.js";
9
- import { c as v, s as k } from "../download-config-DNLkypdN.js";
9
+ import { c as v, s as k } from "../download-config-CzmjOT2T.js";
10
10
  import { h as w, f as L, b as I, a as _, d as C } from "../option-builders-F-c9ELi1.js";
11
11
  import { Box as p, Skeleton as c } from "@mui/material";
12
12
  import { b as A } from "../styles-cohnxh9F.js";
@@ -10,7 +10,7 @@ import { R as b } from "../row-DZSP99LW.js";
10
10
  import "@mui/icons-material";
11
11
  import "react";
12
12
  import "html2canvas";
13
- import "../lasso-tool-BYbxrJ-7.js";
13
+ import "../lasso-tool-CDFj4zKY.js";
14
14
  import "../cjs-D4KH3azB.js";
15
15
  import "@dnd-kit/core";
16
16
  import "@dnd-kit/sortable";
@@ -13,7 +13,7 @@ import { u as B } from "../use-widget-selector-DFl2hW0R.js";
13
13
  import "zustand/shallow";
14
14
  import "@mui/icons-material";
15
15
  import { d as J, a as F } from "../exports-Cr43OCul.js";
16
- import "../lasso-tool-BYbxrJ-7.js";
16
+ import "../lasso-tool-CDFj4zKY.js";
17
17
  import "../cjs-D4KH3azB.js";
18
18
  import "@dnd-kit/core";
19
19
  import "@dnd-kit/sortable";
@@ -6,7 +6,7 @@ import "../widget-store-Bw5zRUGg.js";
6
6
  import "zustand/shallow";
7
7
  import { g as b } from "../options-CthfUJDz.js";
8
8
  import { m as k } from "../utils-BOhInag6.js";
9
- import { c as v, f as w } from "../download-config-DNLkypdN.js";
9
+ import { c as v, f as w } from "../download-config-CzmjOT2T.js";
10
10
  import { h as L, f as C, b as I, a as S, c as _, d as A } from "../option-builders-F-c9ELi1.js";
11
11
  import { Box as l, Skeleton as r } from "@mui/material";
12
12
  import { b as j } from "../styles-cohnxh9F.js";
@@ -1,5 +1,5 @@
1
1
  import { d as i, a as n } from "../formatter-B9Bxn1k7.js";
2
- import { c as f, f as p, s as c } from "../download-config-DNLkypdN.js";
2
+ import { c as f, f as p, s as c } from "../download-config-CzmjOT2T.js";
3
3
  import { a as d, b as u, c as b, d as x, e as C, f as g, g as F, n as y } from "../option-builders-F-c9ELi1.js";
4
4
  import { b as S } from "../styles-cohnxh9F.js";
5
5
  function r({
@@ -3,7 +3,7 @@ import { c as w } from "react/compiler-runtime";
3
3
  import { Box as E, IconButton as _, MenuItem as W, ListItemIcon as $, ListItemText as B, Menu as L, Typography as N, LinearProgress as j, AccordionSummary as z, AccordionDetails as F, Accordion as Y } from "@mui/material";
4
4
  import { MoreVert as D } from "@mui/icons-material";
5
5
  import { useState as H, useLayoutEffect as G } from "react";
6
- import "../lasso-tool-BYbxrJ-7.js";
6
+ import "../lasso-tool-CDFj4zKY.js";
7
7
  import "../cjs-D4KH3azB.js";
8
8
  import { S as U } from "../smart-tooltip-D4vwQpFf.js";
9
9
  import { u as V } from "../use-widget-selector-DFl2hW0R.js";
@@ -1,4 +1,4 @@
1
- import { B as L, C as e, D as o, a as E, b as t, c as r, d as A, e as S, f as T, g as _, h as d, i as l, F as D, L as c, R as n, S as B, j as g, k as C, Z as O, l as F, m as U, n as m, o as i, p as G, s as h, t as R } from "../change-column-Cidl_M-4.js";
1
+ import { B as L, C as e, D as o, a as E, b as t, c as r, d as A, e as S, f as T, g as _, h as d, i as l, F as D, L as c, R as n, S as B, j as g, k as C, Z as O, l as F, m as U, n as m, o as i, p as G, s as h, t as R } from "../change-column-B4IT0rh6.js";
2
2
  import { Z as N, a as Z, c as k } from "../transforms-Cdx4fkU5.js";
3
3
  import { d as I, a as p, t as u, b as w } from "../exports-Cx-f6m6U.js";
4
4
  import { C as b, P as M, b as v } from "../png-item-CS4z1iSH.js";