@divami-artefacts/ai-design-system 1.0.53 → 1.0.55

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 (49) hide show
  1. package/dist/ai-design-system.css +1 -1
  2. package/dist/canvas/canvasUtils.d.ts +6 -3
  3. package/dist/canvas/useCanvasInteraction.d.ts +5 -2
  4. package/dist/canvas/useContainerWidth.d.ts +1 -0
  5. package/dist/components/areaLineChart/AreaLineChart.d.ts +1 -1
  6. package/dist/components/areaLineChart/types.d.ts +1 -1
  7. package/dist/components/balanceScaleChart/BalanceScaleChart.d.ts +1 -1
  8. package/dist/components/balanceScaleChart/types.d.ts +5 -2
  9. package/dist/components/common/ChartEmptyState.d.ts +2 -2
  10. package/dist/components/common/ToggleButton.d.ts +2 -2
  11. package/dist/components/dotMatrixChart/DotMatrixChart.d.ts +1 -1
  12. package/dist/components/dotMatrixChart/types.d.ts +1 -1
  13. package/dist/components/horizontalBarChart/HorizontalBarChart.d.ts +1 -1
  14. package/dist/components/horizontalBarChart/types.d.ts +4 -1
  15. package/dist/components/hubAndSpokeRadialChart/HubAndSpokeRadialChart.d.ts +1 -1
  16. package/dist/components/hubAndSpokeRadialChart/types.d.ts +1 -1
  17. package/dist/components/multiMetricConstellationChart/MultiMetricConstellationChart.d.ts +1 -1
  18. package/dist/components/multiMetricConstellationChart/types.d.ts +1 -1
  19. package/dist/components/multiSegmentHorizontalBarChart/MultiSegmentHorizontalBarChart.d.ts +1 -1
  20. package/dist/components/multiSegmentHorizontalBarChart/types.d.ts +1 -1
  21. package/dist/components/progressRaceChart/ProgressRaceChart.d.ts +1 -1
  22. package/dist/components/progressRaceChart/types.d.ts +5 -2
  23. package/dist/components/proportionalBandChart/ProportionalBandChart.d.ts +1 -1
  24. package/dist/components/proportionalBandChart/types.d.ts +3 -2
  25. package/dist/components/radialFanTreeChart/RadialFanTreeChart.d.ts +1 -1
  26. package/dist/components/radialFanTreeChart/types.d.ts +10 -2
  27. package/dist/components/rankedCardLeaderboard/RankedCardLeaderboard.d.ts +1 -1
  28. package/dist/components/rankedCardLeaderboard/types.d.ts +3 -2
  29. package/dist/components/segmentedSplitBarChart/SegmentedSplitBarChart.d.ts +1 -1
  30. package/dist/components/segmentedSplitBarChart/types.d.ts +5 -2
  31. package/dist/components/semiCircularGaugeChart/SemiCircularGaugeChart.d.ts +1 -1
  32. package/dist/components/semiCircularGaugeChart/types.d.ts +11 -1
  33. package/dist/components/stackedHorizontalBarChart/StackedHorizontalBarChart.d.ts +1 -1
  34. package/dist/components/stackedHorizontalBarChart/types.d.ts +5 -2
  35. package/dist/components/trend/Trend.d.ts +1 -1
  36. package/dist/components/trend/types.d.ts +3 -1
  37. package/dist/components/visualizationGroup/VisualizationGroup.d.ts +2 -0
  38. package/dist/components/visualizationRenderer/VisualizationRenderer.d.ts +1 -1
  39. package/dist/components/weeklyFlow/WeeklyFlow.d.ts +1 -1
  40. package/dist/components/weeklyFlow/types.d.ts +3 -2
  41. package/dist/constants.d.ts +37 -0
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.d.ts +2 -1
  44. package/dist/index.js +1457 -1018
  45. package/dist/pages/interactiveDemo/InteractiveDemoPage.d.ts +1 -0
  46. package/dist/pages/interactiveDemo/styles.d.ts +2 -0
  47. package/dist/types/index.d.ts +60 -20
  48. package/package.json +21 -21
  49. package/dist/components/constants.d.ts +0 -6
@@ -0,0 +1 @@
1
+ export declare function InteractiveDemoPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { CSSProperties } from 'react';
2
+ export declare const styles: Record<string, CSSProperties>;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import { CHART_TYPE } from '../constants';
2
3
  export type VisualizationFrameProps = {
3
4
  className?: string;
4
5
  };
@@ -100,89 +101,121 @@ export type ChartFrameProps = {
100
101
  className?: string;
101
102
  };
102
103
  export type BaseVisualizationConfig = {
103
- type: 'line' | 'area' | 'bar' | 'pie' | 'donut' | 'sankey';
104
+ type: typeof CHART_TYPE.LINE | typeof CHART_TYPE.AREA | typeof CHART_TYPE.BAR | typeof CHART_TYPE.PIE | typeof CHART_TYPE.DONUT | typeof CHART_TYPE.SANKEY;
104
105
  rows: VizRow[];
105
106
  } | {
106
- type: 'flow';
107
+ type: typeof CHART_TYPE.FLOW;
107
108
  selectedEntity?: string | null;
108
109
  } | {
109
- type: 'trend';
110
+ type: typeof CHART_TYPE.TREND;
110
111
  points: PointPair[];
111
112
  } | {
112
- type: 'mini-bars';
113
+ type: typeof CHART_TYPE.MINI_BARS;
113
114
  rows: MiniBarRow[];
114
115
  } | {
115
- type: 'stacked-horizontal-bar-chart';
116
+ type: typeof CHART_TYPE.STACKED_HORIZONTAL_BAR;
116
117
  data: ContractData;
117
118
  items?: never;
119
+ dataByEntity?: Record<string, ContractData>;
118
120
  } | {
119
- type: 'stacked-horizontal-bar-chart';
121
+ type: typeof CHART_TYPE.STACKED_HORIZONTAL_BAR;
120
122
  items: ContractorRow[];
121
123
  data?: never;
124
+ dataByEntity?: Record<string, ContractData>;
122
125
  } | {
123
- type: 'multi-metric-constellation-chart';
126
+ type: typeof CHART_TYPE.MULTI_METRIC_CONSTELLATION;
124
127
  items: ContractorRow[];
125
128
  } | {
126
- type: 'progress-race-chart';
129
+ type: typeof CHART_TYPE.PROGRESS_RACE;
127
130
  items: ContractorRow[];
131
+ itemsByEntity?: Record<string, ContractorRow[]>;
128
132
  } | {
129
- type: 'hub-and-spoke-radial-chart';
133
+ type: typeof CHART_TYPE.HUB_AND_SPOKE_RADIAL;
130
134
  segments: EWStatusRow[];
131
135
  title?: string;
132
136
  unitLabel?: string;
133
137
  } | {
134
- type: 'dot-matrix-chart';
138
+ type: typeof CHART_TYPE.DOT_MATRIX;
135
139
  items: EWCategoryRow[];
136
140
  title?: string;
137
141
  } | {
138
- type: 'ranked-card-leaderboard';
142
+ type: typeof CHART_TYPE.RANKED_CARD_LEADERBOARD;
139
143
  items: EWOpenContractorRow[];
140
144
  title?: string;
141
145
  } | {
142
- type: 'proportional-band-chart';
146
+ type: typeof CHART_TYPE.PROPORTIONAL_BAND;
143
147
  severities: EWSeverityRow[];
144
148
  title?: string;
145
149
  } | {
146
- type: 'radial-fan-tree-chart';
150
+ type: typeof CHART_TYPE.RADIAL_FAN_TREE;
147
151
  total: number;
148
152
  totalLabel?: string;
149
153
  items: NCEContractorRow[];
154
+ dataByEntity?: Record<string, {
155
+ total: number;
156
+ totalLabel?: string;
157
+ items: NCEContractorRow[];
158
+ }>;
150
159
  } | {
151
- type: 'semi-circular-gauge-chart';
160
+ type: typeof CHART_TYPE.SEMI_CIRCULAR_GAUGE;
152
161
  confirmed: number;
153
162
  total: number;
154
163
  label?: string;
164
+ gaugeByEntity?: Record<string, {
165
+ confirmed: number;
166
+ total: number;
167
+ }>;
168
+ subentity?: SubentityItem[];
155
169
  } | {
156
- type: 'segmented-split-bar-chart';
170
+ type: typeof CHART_TYPE.SEGMENTED_SPLIT_BAR;
157
171
  items: VariationRow[];
158
172
  labelA?: string;
159
173
  labelB?: string;
160
174
  unit?: string;
175
+ itemsByEntity?: Record<string, VariationRow[]>;
161
176
  } | {
162
- type: 'balance-scale-chart';
177
+ type: typeof CHART_TYPE.BALANCE_SCALE;
163
178
  left: QuotationSide;
164
179
  right: QuotationSide;
165
180
  leftTitle?: string;
166
181
  rightTitle?: string;
167
182
  unit?: string;
183
+ dataByEntity?: Record<string, QuotationSummary>;
168
184
  } | {
169
- type: 'area-line-chart';
185
+ type: typeof CHART_TYPE.AREA_LINE;
170
186
  points: QuotationTrendPoint[];
171
187
  } | {
172
- type: 'trend-view';
188
+ type: typeof CHART_TYPE.TREND_VIEW;
173
189
  points: QuotationTrendPoint[];
190
+ pointsByEntity?: Record<string, QuotationTrendPoint[]>;
174
191
  } | {
175
- type: 'weekly-flow';
192
+ type: typeof CHART_TYPE.WEEKLY_FLOW;
176
193
  items: ContractorRow[];
177
194
  } | {
178
- type: 'horizontal-bar-chart';
195
+ type: typeof CHART_TYPE.HORIZONTAL_BAR;
179
196
  rows: HorizontalBarRow[];
180
197
  valuePrefix?: string;
181
198
  };
199
+ export type SubentityItem = Record<string, unknown>;
200
+ export type RadialFanSubentity = {
201
+ total: number;
202
+ totalLabel: string;
203
+ items: SubentityItem[];
204
+ };
205
+ export type SubentityPayload = SubentityItem[] | RadialFanSubentity;
182
206
  export type VisualizationRendererProps = {
183
207
  config: BaseVisualizationConfig;
184
208
  className?: string;
185
209
  colorOffset?: number;
210
+ onItemClick?: (id: string, label: string, subentity?: SubentityPayload) => void;
211
+ selectedId?: string;
212
+ listenerItems?: SubentityPayload;
213
+ };
214
+ export type VisualizationGroupProps = {
215
+ items: BaseVisualizationConfig[];
216
+ colorOffset?: number;
217
+ title?: string;
218
+ 'data-testid'?: string;
186
219
  };
187
220
  export type ContractorRow = {
188
221
  id: string;
@@ -195,6 +228,7 @@ export type ContractorRow = {
195
228
  baseLabel?: string;
196
229
  variationLabel?: string;
197
230
  totalLabel?: string;
231
+ subentity?: SubentityPayload;
198
232
  };
199
233
  export type ContractData = {
200
234
  items: (ContractorRow | number | null)[];
@@ -216,6 +250,7 @@ export type EWCategoryRow = {
216
250
  export type EWSeverityRow = {
217
251
  severity: string;
218
252
  count: number;
253
+ subentity?: SubentityItem[];
219
254
  };
220
255
  export type EWOpenContractorRow = {
221
256
  id: string;
@@ -223,6 +258,7 @@ export type EWOpenContractorRow = {
223
258
  abbreviation?: string;
224
259
  count?: number;
225
260
  label?: string;
261
+ subentity?: SubentityItem[];
226
262
  };
227
263
  export type NCEContractorRow = {
228
264
  id: string;
@@ -230,6 +266,7 @@ export type NCEContractorRow = {
230
266
  abbreviation?: string;
231
267
  count?: number;
232
268
  label?: string;
269
+ subentity?: SubentityItem[];
233
270
  };
234
271
  export type NCECompensationData = {
235
272
  total: number;
@@ -242,11 +279,13 @@ export type VariationRow = {
242
279
  abbreviation?: string;
243
280
  implemented?: number;
244
281
  unimplemented?: number;
282
+ subentity?: SubentityItem[];
245
283
  };
246
284
  export type QuotationSide = {
247
285
  value: number;
248
286
  count: number;
249
287
  label: string;
288
+ subentity?: SubentityItem[];
250
289
  };
251
290
  export type QuotationSummary = {
252
291
  left: QuotationSide;
@@ -364,6 +403,7 @@ export type HorizontalBarRow = {
364
403
  name: string;
365
404
  value: number;
366
405
  valueLabel?: string;
406
+ subentity?: SubentityItem[];
367
407
  };
368
408
  export type DualSegmentBarRow = {
369
409
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divami-artefacts/ai-design-system",
3
- "version": "1.0.53",
3
+ "version": "1.0.55",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "module": "./dist/index.js",
@@ -33,25 +33,25 @@
33
33
  "react-dom": ">=18.0.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@eslint/js": "^9.39.4",
37
- "@testing-library/jest-dom": "^6.9.1",
38
- "@testing-library/react": "^16.3.2",
39
- "@types/jest": "^30.0.0",
40
- "@types/node": "^24.12.0",
41
- "@types/react": "^19.2.14",
42
- "@types/react-dom": "^19.2.3",
43
- "@vitejs/plugin-react": "^6.0.1",
44
- "eslint": "^9.39.4",
45
- "eslint-plugin-react-hooks": "^7.0.1",
46
- "eslint-plugin-react-refresh": "^0.5.2",
47
- "globals": "^17.4.0",
48
- "jest": "^30.3.0",
49
- "react": "^19.2.4",
50
- "react-dom": "^19.2.4",
51
- "ts-jest": "^29.4.9",
52
- "typescript": "~5.9.3",
53
- "typescript-eslint": "^8.57.0",
54
- "vite": "^8.0.1",
55
- "vite-plugin-dts": "^4.5.4"
36
+ "@eslint/js": "9.39.4",
37
+ "@testing-library/jest-dom": "6.9.1",
38
+ "@testing-library/react": "16.3.2",
39
+ "@types/jest": "30.0.0",
40
+ "@types/node": "24.12.0",
41
+ "@types/react": "19.2.14",
42
+ "@types/react-dom": "19.2.3",
43
+ "@vitejs/plugin-react": "6.0.1",
44
+ "eslint": "9.39.4",
45
+ "eslint-plugin-react-hooks": "7.0.1",
46
+ "eslint-plugin-react-refresh": "0.5.2",
47
+ "globals": "17.4.0",
48
+ "jest": "30.3.0",
49
+ "react": "19.2.4",
50
+ "react-dom": "19.2.4",
51
+ "ts-jest": "29.4.9",
52
+ "typescript": "5.9.3",
53
+ "typescript-eslint": "8.57.0",
54
+ "vite": "8.0.1",
55
+ "vite-plugin-dts": "4.5.4"
56
56
  }
57
57
  }
@@ -1,6 +0,0 @@
1
- import { SankeyLinkData, SankeyNodeData } from '../types';
2
- export declare const palette: string[];
3
- export declare const flowGraph: {
4
- nodes: SankeyNodeData[];
5
- links: SankeyLinkData[];
6
- };