@divami-artefacts/ai-design-system 1.0.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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +315 -0
  3. package/dist/canvas/CanvasTooltip.d.ts +13 -0
  4. package/dist/canvas/CausalFlowCanvas.d.ts +16 -0
  5. package/dist/canvas/canvasUtils.d.ts +38 -0
  6. package/dist/canvas/easing.d.ts +23 -0
  7. package/dist/canvas/useCanvasInteraction.d.ts +45 -0
  8. package/dist/canvas/useCanvasLoop.d.ts +19 -0
  9. package/dist/components/areaChart/AreaChart.d.ts +2 -0
  10. package/dist/components/barChart/BarChart.d.ts +2 -0
  11. package/dist/components/chartFrame/ChartFrame.d.ts +2 -0
  12. package/dist/components/commitmentRace/CommitmentRace.d.ts +2 -0
  13. package/dist/components/commitmentRace/index.d.ts +2 -0
  14. package/dist/components/commitmentRace/styles.d.ts +1 -0
  15. package/dist/components/commitmentRace/types.d.ts +5 -0
  16. package/dist/components/common/SeriesChart.d.ts +2 -0
  17. package/dist/components/compensationGauge/CompensationGauge.d.ts +2 -0
  18. package/dist/components/compensationGauge/index.d.ts +2 -0
  19. package/dist/components/compensationGauge/styles.d.ts +1 -0
  20. package/dist/components/compensationGauge/types.d.ts +6 -0
  21. package/dist/components/constants.d.ts +6 -0
  22. package/dist/components/contractBars/ContractBars.d.ts +2 -0
  23. package/dist/components/contractBars/index.d.ts +2 -0
  24. package/dist/components/contractBars/styles.d.ts +1 -0
  25. package/dist/components/contractBars/types.d.ts +5 -0
  26. package/dist/components/contractValueOrb/ContractValueOrb.d.ts +2 -0
  27. package/dist/components/contractValueOrb/index.d.ts +2 -0
  28. package/dist/components/contractValueOrb/styles.d.ts +1 -0
  29. package/dist/components/contractValueOrb/types.d.ts +5 -0
  30. package/dist/components/contractorRank/ContractorRank.d.ts +2 -0
  31. package/dist/components/contractorRank/index.d.ts +2 -0
  32. package/dist/components/contractorRank/styles.d.ts +1 -0
  33. package/dist/components/contractorRank/types.d.ts +5 -0
  34. package/dist/components/donutChart/DonutChart.d.ts +2 -0
  35. package/dist/components/ewCategory/EWCategory.d.ts +2 -0
  36. package/dist/components/ewCategory/index.d.ts +2 -0
  37. package/dist/components/ewCategory/styles.d.ts +1 -0
  38. package/dist/components/ewCategory/types.d.ts +5 -0
  39. package/dist/components/hooks/useWorkspace.d.ts +6 -0
  40. package/dist/components/keyHighlights/KeyHighlights.d.ts +4 -0
  41. package/dist/components/lineChart/LineChart.d.ts +2 -0
  42. package/dist/components/miniBars/MiniBars.d.ts +2 -0
  43. package/dist/components/nceTree/NCETree.d.ts +2 -0
  44. package/dist/components/nceTree/index.d.ts +2 -0
  45. package/dist/components/nceTree/styles.d.ts +1 -0
  46. package/dist/components/nceTree/types.d.ts +6 -0
  47. package/dist/components/pieChart/PieChart.d.ts +2 -0
  48. package/dist/components/quotationBalance/QuotationBalance.d.ts +2 -0
  49. package/dist/components/quotationBalance/index.d.ts +2 -0
  50. package/dist/components/quotationBalance/styles.d.ts +1 -0
  51. package/dist/components/quotationBalance/types.d.ts +6 -0
  52. package/dist/components/quotationTrend/QuotationTrend.d.ts +2 -0
  53. package/dist/components/quotationTrend/index.d.ts +2 -0
  54. package/dist/components/quotationTrend/styles.d.ts +1 -0
  55. package/dist/components/quotationTrend/types.d.ts +5 -0
  56. package/dist/components/sankey/ProcessSankey.d.ts +2 -0
  57. package/dist/components/sankey/RankingSankey.d.ts +2 -0
  58. package/dist/components/sankey/SankeySvg.d.ts +2 -0
  59. package/dist/components/sankey/index.d.ts +3 -0
  60. package/dist/components/severityBands/SeverityBands.d.ts +2 -0
  61. package/dist/components/severityBands/index.d.ts +2 -0
  62. package/dist/components/severityBands/styles.d.ts +1 -0
  63. package/dist/components/severityBands/types.d.ts +5 -0
  64. package/dist/components/statusArc/StatusArc.d.ts +2 -0
  65. package/dist/components/statusArc/index.d.ts +2 -0
  66. package/dist/components/statusArc/styles.d.ts +1 -0
  67. package/dist/components/statusArc/types.d.ts +9 -0
  68. package/dist/components/trendChart/TrendChart.d.ts +2 -0
  69. package/dist/components/variationSplit/VariationSplit.d.ts +2 -0
  70. package/dist/components/variationSplit/index.d.ts +2 -0
  71. package/dist/components/variationSplit/styles.d.ts +1 -0
  72. package/dist/components/variationSplit/types.d.ts +5 -0
  73. package/dist/components/visualizationRenderer/VisualizationRenderer.d.ts +2 -0
  74. package/dist/components/weeklyFlow/WeeklyFlow.d.ts +2 -0
  75. package/dist/components/weeklyFlow/index.d.ts +2 -0
  76. package/dist/components/weeklyFlow/styles.d.ts +1 -0
  77. package/dist/components/weeklyFlow/types.d.ts +5 -0
  78. package/dist/components/workspaceShell/WorkspaceShell.d.ts +1 -0
  79. package/dist/hooks/useWorkspace.d.ts +6 -0
  80. package/dist/index.cjs +1 -0
  81. package/dist/index.d.ts +14 -0
  82. package/dist/index.js +3019 -0
  83. package/dist/mocks/workspace.mock.d.ts +378 -0
  84. package/dist/pages/chartGallery/ChartGalleryPage.d.ts +1 -0
  85. package/dist/pages/projectDashboard/ProjectDashboardPage.d.ts +1 -0
  86. package/dist/pages/projectDashboard/index.d.ts +2 -0
  87. package/dist/pages/projectDashboard/styles.d.ts +4 -0
  88. package/dist/pages/projectDashboard/types.d.ts +3 -0
  89. package/dist/pages/workspace/WorkspacePage.d.ts +1 -0
  90. package/dist/types/index.d.ts +344 -0
  91. package/dist/utils/mounts.d.ts +4 -0
  92. package/dist/utils/workspace.utils.d.ts +17 -0
  93. package/package.json +53 -0
@@ -0,0 +1,344 @@
1
+ import { ReactNode } from 'react';
2
+ export type VisualizationFrameProps = {
3
+ className?: string;
4
+ };
5
+ export type VizRow = {
6
+ id?: string;
7
+ vendor: string;
8
+ pricing?: number;
9
+ };
10
+ export type PointPair = [string, string | number];
11
+ export type MiniBarRow = [string, number, string];
12
+ export type SankeyNodeData = {
13
+ id: string;
14
+ name: string;
15
+ valueLabel?: string;
16
+ };
17
+ export type SankeyLinkData = {
18
+ source: string;
19
+ target: string;
20
+ value: number;
21
+ };
22
+ export type SeriesChartColors = {
23
+ axisLine?: string;
24
+ line?: string;
25
+ areaFill?: string;
26
+ point?: string;
27
+ };
28
+ export type BarChartColors = {
29
+ axisLine?: string;
30
+ bars?: string[];
31
+ valueLabel?: string;
32
+ };
33
+ export type PieChartColors = {
34
+ slices?: string[];
35
+ };
36
+ export type TrendChartColors = {
37
+ axisLine?: string;
38
+ line?: string;
39
+ point?: string;
40
+ };
41
+ export type SankeyChartColors = {
42
+ links?: string;
43
+ activeLinks?: string;
44
+ nodes?: string[];
45
+ activeNodes?: string;
46
+ };
47
+ export type BarChartProps = {
48
+ rows?: VizRow[];
49
+ colors?: BarChartColors;
50
+ } & VisualizationFrameProps;
51
+ export type LineChartProps = {
52
+ rows?: VizRow[];
53
+ colors?: SeriesChartColors;
54
+ } & VisualizationFrameProps;
55
+ export type AreaChartProps = {
56
+ rows?: VizRow[];
57
+ colors?: SeriesChartColors;
58
+ } & VisualizationFrameProps;
59
+ export type PieChartProps = {
60
+ rows?: VizRow[];
61
+ variant: 'pie' | 'donut';
62
+ colors?: PieChartColors;
63
+ } & VisualizationFrameProps;
64
+ export type DonutChartProps = {
65
+ rows?: VizRow[];
66
+ colors?: PieChartColors;
67
+ } & VisualizationFrameProps;
68
+ export type MiniBarsProps = {
69
+ rows?: MiniBarRow[];
70
+ colors?: PieChartColors;
71
+ } & VisualizationFrameProps;
72
+ export type ProcessSankeyProps = {
73
+ selectedEntity?: string | null;
74
+ colors?: SankeyChartColors;
75
+ } & VisualizationFrameProps;
76
+ export type RankingSankeyProps = {
77
+ rows?: VizRow[];
78
+ colors?: SankeyChartColors;
79
+ } & VisualizationFrameProps;
80
+ export type SankeySvgProps = {
81
+ nodes: SankeyNodeData[];
82
+ links: SankeyLinkData[];
83
+ width?: number;
84
+ height?: number;
85
+ ariaLabel: string;
86
+ selectedEntity?: string | null;
87
+ colors?: SankeyChartColors;
88
+ } & VisualizationFrameProps;
89
+ export type SeriesChartProps = {
90
+ rows?: VizRow[];
91
+ variant: 'line' | 'area';
92
+ colors?: SeriesChartColors;
93
+ } & VisualizationFrameProps;
94
+ export type TrendChartProps = {
95
+ points?: PointPair[];
96
+ colors?: TrendChartColors;
97
+ } & VisualizationFrameProps;
98
+ export type ChartFrameProps = {
99
+ children: ReactNode;
100
+ className?: string;
101
+ };
102
+ export type BaseVisualizationConfig = {
103
+ type: 'line' | 'area' | 'bar' | 'pie' | 'donut' | 'sankey';
104
+ rows: VizRow[];
105
+ } | {
106
+ type: 'flow';
107
+ selectedEntity?: string | null;
108
+ } | {
109
+ type: 'trend';
110
+ points: PointPair[];
111
+ } | {
112
+ type: 'mini-bars';
113
+ rows: MiniBarRow[];
114
+ } | {
115
+ type: 'contract-value-orb';
116
+ data: ContractData;
117
+ } | {
118
+ type: 'contract-bars';
119
+ contractors: ContractorRow[];
120
+ } | {
121
+ type: 'commitment-race';
122
+ contractors: ContractorRow[];
123
+ } | {
124
+ type: 'status-arc';
125
+ segments: EWStatusRow[];
126
+ title?: string;
127
+ } | {
128
+ type: 'ew-category';
129
+ categories: EWCategoryRow[];
130
+ title?: string;
131
+ } | {
132
+ type: 'contractor-rank';
133
+ contractors: EWOpenContractorRow[];
134
+ title?: string;
135
+ } | {
136
+ type: 'severity-bands';
137
+ severities: EWSeverityRow[];
138
+ title?: string;
139
+ } | {
140
+ type: 'nce-tree';
141
+ total: number;
142
+ byContractor: NCEContractorRow[];
143
+ } | {
144
+ type: 'compensation-gauge';
145
+ pct: number;
146
+ confirmed: number;
147
+ total: number;
148
+ } | {
149
+ type: 'variation-split';
150
+ contractors: VariationRow[];
151
+ } | {
152
+ type: 'quotation-balance';
153
+ accepted: QuotationSide;
154
+ submitted: QuotationSide;
155
+ } | {
156
+ type: 'quotation-trend';
157
+ trend: QuotationTrendPoint[];
158
+ } | {
159
+ type: 'weekly-flow';
160
+ contractors: ContractorRow[];
161
+ };
162
+ export type VisualizationRendererProps = {
163
+ config: BaseVisualizationConfig;
164
+ className?: string;
165
+ };
166
+ export type ContractorRow = {
167
+ id: string;
168
+ name: string;
169
+ shortName: string;
170
+ base: number;
171
+ variations: number;
172
+ totalCommitment: number;
173
+ commitmentPct: number;
174
+ };
175
+ export type ContractData = {
176
+ contractors: ContractorRow[];
177
+ totals: {
178
+ base: number;
179
+ variations: number;
180
+ totalCommitment: number;
181
+ };
182
+ };
183
+ export type EWStatusRow = {
184
+ status: string;
185
+ count: number;
186
+ };
187
+ export type EWCategoryRow = {
188
+ category: string;
189
+ fullName: string;
190
+ count: number;
191
+ };
192
+ export type EWSeverityRow = {
193
+ severity: string;
194
+ count: number;
195
+ };
196
+ export type EWOpenContractorRow = {
197
+ id: string;
198
+ name: string;
199
+ shortName: string;
200
+ openCount: number;
201
+ };
202
+ export type NCEContractorRow = {
203
+ id: string;
204
+ name: string;
205
+ shortName: string;
206
+ count: number;
207
+ };
208
+ export type NCECompensationData = {
209
+ total: number;
210
+ confirmed: number;
211
+ pctConfirmed: number;
212
+ };
213
+ export type VariationRow = {
214
+ id: string;
215
+ name: string;
216
+ shortName: string;
217
+ implemented: number;
218
+ unimplemented: number;
219
+ };
220
+ export type QuotationSide = {
221
+ value: number;
222
+ count: number;
223
+ label: string;
224
+ };
225
+ export type QuotationSummary = {
226
+ accepted: QuotationSide;
227
+ submitted: QuotationSide;
228
+ };
229
+ export type QuotationTrendPoint = {
230
+ week: string;
231
+ count: number;
232
+ value: number;
233
+ };
234
+ export type KeyHighlightChip = {
235
+ value: string;
236
+ label: string;
237
+ color?: string;
238
+ };
239
+ export type KeyHighlightBadge = {
240
+ text: string;
241
+ severity: 'red' | 'amber' | 'green';
242
+ };
243
+ export type KeyHighlightDot = {
244
+ val: number;
245
+ color: string;
246
+ name: string;
247
+ };
248
+ export type FlagsListRow = {
249
+ text: string;
250
+ tag: string;
251
+ date: string;
252
+ severity: 'red' | 'amber' | 'green';
253
+ };
254
+ export type ComparisonRow = {
255
+ label: string;
256
+ cells: string[];
257
+ color?: string;
258
+ };
259
+ export type ScorecardRow = {
260
+ name: string;
261
+ value: string;
262
+ pct: number;
263
+ color: string;
264
+ badge?: string;
265
+ badgeSeverity?: 'green' | 'amber' | 'red';
266
+ sublabel?: string;
267
+ };
268
+ export type KeyHighlightBlock = {
269
+ type: 'stats';
270
+ items: Array<{
271
+ value: string;
272
+ label: string;
273
+ color?: string;
274
+ }>;
275
+ takeaway?: string;
276
+ } | {
277
+ type: 'chips';
278
+ items: KeyHighlightChip[];
279
+ takeaway?: string;
280
+ } | {
281
+ type: 'ranked';
282
+ items: Array<{
283
+ name: string;
284
+ value: string;
285
+ color: string;
286
+ kpiLabel?: string;
287
+ }>;
288
+ takeaway?: string;
289
+ } | {
290
+ type: 'proportion';
291
+ leftPct: number;
292
+ leftLabel: string;
293
+ leftValue: string;
294
+ leftColor: string;
295
+ rightPct: number;
296
+ rightLabel: string;
297
+ rightValue: string;
298
+ rightColor: string;
299
+ chips?: KeyHighlightChip[];
300
+ takeaway?: string;
301
+ } | {
302
+ type: 'ring';
303
+ pct: number;
304
+ label: string;
305
+ color: string;
306
+ chips?: KeyHighlightChip[];
307
+ takeaway?: string;
308
+ } | {
309
+ type: 'badges';
310
+ items: KeyHighlightBadge[];
311
+ textSize?: number;
312
+ takeaway?: string;
313
+ } | {
314
+ type: 'dot-strip';
315
+ min: number;
316
+ max: number;
317
+ unit: string;
318
+ dots: KeyHighlightDot[];
319
+ chips?: KeyHighlightChip[];
320
+ takeaway?: string;
321
+ } | {
322
+ type: 'scorecard-rows';
323
+ items: ScorecardRow[];
324
+ takeaway?: string;
325
+ } | {
326
+ type: 'flags-list';
327
+ items: FlagsListRow[];
328
+ takeaway?: string;
329
+ } | {
330
+ type: 'comparison-rows';
331
+ columns: string[];
332
+ rows: ComparisonRow[];
333
+ takeaway?: string;
334
+ };
335
+ export type NarrativeStep = {
336
+ id: string;
337
+ questionText: string;
338
+ title: string;
339
+ insight: string;
340
+ vizConfigs: BaseVisualizationConfig[];
341
+ followupIds: string[];
342
+ keyInsights: string[];
343
+ keyHighlights?: KeyHighlightBlock;
344
+ };
@@ -0,0 +1,4 @@
1
+ import { BaseVisualizationConfig } from '../types';
2
+ export declare function cleanupVisualizationMounts(): void;
3
+ export declare function hydrateVisualizationMounts(): void;
4
+ export declare function serializeVisualizationConfig(config: BaseVisualizationConfig): string;
@@ -0,0 +1,17 @@
1
+ export declare function formatThreadTime(value: number): string;
2
+ export declare function formatResponseTime(response: {
3
+ createdAt?: number;
4
+ timestamp?: string;
5
+ }): string;
6
+ export declare function formatLabelFor(format: string): string;
7
+ export declare function supportsTimeRange(format: string): boolean;
8
+ export declare function rangeFactor(range: string): number;
9
+ export declare function summarizeText(value: string, max?: number): string;
10
+ export declare function escapeHtml(value: unknown): string;
11
+ export declare function storyToneClass(tone: string): string;
12
+ export declare function storyTrendMeta(trend: string): {
13
+ label: string;
14
+ icon: string;
15
+ className: string;
16
+ };
17
+ export declare function monthToPercent(month: string): number;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@divami-artefacts/ai-design-system",
3
+ "version": "1.0.1",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./styles": "./dist/ai-design-system.css"
14
+ },
15
+ "sideEffects": [
16
+ "*.css"
17
+ ],
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "scripts": {
24
+ "dev": "vite",
25
+ "build": "tsc -b && vite build",
26
+ "build:lib": "vite build --config vite.lib.config.ts",
27
+ "prepublishOnly": "npm run build:lib",
28
+ "lint": "eslint .",
29
+ "preview": "vite preview"
30
+ },
31
+ "peerDependencies": {
32
+ "react": ">=18.0.0",
33
+ "react-dom": ">=18.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "react": "^19.2.4",
37
+ "react-dom": "^19.2.4",
38
+ "@eslint/js": "^9.39.4",
39
+ "@types/node": "^24.12.0",
40
+ "@types/react": "^19.2.14",
41
+ "@types/react-dom": "^19.2.3",
42
+ "@vitejs/plugin-react": "^6.0.1",
43
+ "eslint": "^9.39.4",
44
+ "eslint-plugin-react-hooks": "^7.0.1",
45
+ "eslint-plugin-react-refresh": "^0.5.2",
46
+ "globals": "^17.4.0",
47
+ "typescript": "~5.9.3",
48
+ "typescript-eslint": "^8.57.0",
49
+ "vite": "^8.0.1",
50
+ "vite-plugin-dts": "^4.5.4"
51
+ }
52
+ }
53
+