@principal-ai/subsystems-react 0.17.0 → 0.18.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 (98) hide show
  1. package/dist/index.d.ts +7 -44
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6 -32
  4. package/dist/index.js.map +1 -1
  5. package/package.json +2 -2
  6. package/src/index.ts +9 -199
  7. package/src/components/ConfigurationSelector.tsx +0 -133
  8. package/src/components/GraphRenderer.tsx +0 -3195
  9. package/src/components/MultiCanvasRenderer.tsx +0 -295
  10. package/src/components/NodeTooltip.tsx +0 -279
  11. package/src/components/PendingChanges.test.tsx +0 -375
  12. package/src/components/SelectionSidebar.tsx +0 -352
  13. package/src/components/SequenceDiagramRenderer.tsx +0 -1156
  14. package/src/components/WorkflowSequenceDiagram.tsx +0 -270
  15. package/src/components/dashboard/DashboardRenderer.tsx +0 -317
  16. package/src/components/dashboard/MetricPanel.tsx +0 -254
  17. package/src/components/dashboard/MockDataProvider.ts +0 -330
  18. package/src/components/dashboard/components/BarChart.tsx +0 -299
  19. package/src/components/dashboard/components/LineChart.tsx +0 -279
  20. package/src/components/dashboard/components/MetricCard.tsx +0 -270
  21. package/src/components/dashboard/components/SourceLink.tsx +0 -63
  22. package/src/components/dashboard/components/TimeRangeSelector.tsx +0 -280
  23. package/src/components/dashboard/components/index.ts +0 -5
  24. package/src/components/dashboard/index.ts +0 -47
  25. package/src/components/dashboard/types.ts +0 -126
  26. package/src/components/state-view/PipelineView.tsx +0 -347
  27. package/src/components/state-view/index.ts +0 -14
  28. package/src/components/state-view/types.ts +0 -261
  29. package/src/components/state-view/useStateView.ts +0 -205
  30. package/src/contexts/GraphEditContext.tsx +0 -27
  31. package/src/contexts/TooltipPortalContext.ts +0 -8
  32. package/src/edges/CustomEdge.tsx +0 -402
  33. package/src/edges/GenericEdge.tsx +0 -36
  34. package/src/hooks/usePathBasedEvents.ts +0 -192
  35. package/src/hooks/useSequenceLayout.ts +0 -543
  36. package/src/hooks/useUndoRedo.ts +0 -144
  37. package/src/nodes/CustomNode.tsx +0 -1231
  38. package/src/nodes/GenericNode.tsx +0 -55
  39. package/src/nodes/otel/OtelBoundaryNode.tsx +0 -224
  40. package/src/nodes/otel/OtelEventNode.tsx +0 -225
  41. package/src/nodes/otel/OtelResourceNode.tsx +0 -251
  42. package/src/nodes/otel/OtelScopeNode.tsx +0 -221
  43. package/src/nodes/otel/OtelSpanConventionNode.tsx +0 -295
  44. package/src/nodes/otel/index.ts +0 -23
  45. package/src/nodes/otel/shared/NodeBadges.tsx +0 -295
  46. package/src/nodes/otel/shared/NodeContent.tsx +0 -204
  47. package/src/nodes/otel/shared/index.ts +0 -8
  48. package/src/nodes/otel/shared/types.ts +0 -138
  49. package/src/nodes/otel/shared/useNodeBehavior.ts +0 -114
  50. package/src/stories/Audit/BoundaryNodes.stories.tsx +0 -385
  51. package/src/stories/Audit/CanvasEdgeTypes.stories.tsx +0 -1448
  52. package/src/stories/Audit/CanvasNodeTypes.stories.tsx +0 -1049
  53. package/src/stories/Audit/ColorPriority.stories.tsx +0 -895
  54. package/src/stories/Audit/DiamondBadges.stories.tsx +0 -629
  55. package/src/stories/Audit/NodeDimensionsTesting.stories.tsx +0 -724
  56. package/src/stories/Audit/NodeFieldsAudit.stories.tsx +0 -996
  57. package/src/stories/Audit/NodeFontSizeTesting.stories.tsx +0 -715
  58. package/src/stories/Audit/NodeShapes.stories.tsx +0 -1208
  59. package/src/stories/Audit/WideNodesTesting.stories.tsx +0 -1045
  60. package/src/stories/Components/DashboardRenderer.stories.tsx +0 -263
  61. package/src/stories/Components/GraphRenderer.stories.tsx +0 -3236
  62. package/src/stories/Components/MultiCanvasRenderer.stories.tsx +0 -370
  63. package/src/stories/Components/SequenceDiagram.stories.tsx +0 -255
  64. package/src/stories/Components/StateView.stories.tsx +0 -417
  65. package/src/stories/Components/TraceViewer.stories.tsx +0 -442
  66. package/src/stories/Components/WorkflowSequenceDiagram.stories.tsx +0 -802
  67. package/src/stories/Features/AnimationWorkshop.stories.tsx +0 -727
  68. package/src/stories/Features/ChangeTypeVisual.stories.tsx +0 -67
  69. package/src/stories/Features/EventDrivenAnimations.stories.tsx +0 -513
  70. package/src/stories/Features/MultiConfig.stories.tsx +0 -539
  71. package/src/stories/Layout/ElkEdgeRouting.stories.tsx +0 -539
  72. package/src/stories/Layout/GraphOrientation.stories.tsx +0 -500
  73. package/src/stories/Layout/MultiDirectionalConnections.stories.tsx +0 -352
  74. package/src/stories/Nodes/NodeDefinitionComparison.stories.tsx +0 -560
  75. package/src/stories/Nodes/NodeNameFallbacks.stories.tsx +0 -491
  76. package/src/stories/Nodes/NumericColors.stories.tsx +0 -440
  77. package/src/stories/OTEL/EventNameDisplay.stories.tsx +0 -694
  78. package/src/stories/OTEL/EventNameFallback.stories.tsx +0 -578
  79. package/src/stories/OTEL/OtelComponents.stories.tsx +0 -422
  80. package/src/stories/OTEL/OtelNodeTypesPrototype.stories.tsx +0 -806
  81. package/src/stories/OTEL/RawEventCards.stories.tsx +0 -57
  82. package/src/stories/OTEL/SpanBadges.stories.tsx +0 -840
  83. package/src/stories/OTEL/ValidationEventsCanvas.stories.tsx +0 -209
  84. package/src/stories/RealWorld/BacklogMdCanvases.stories.tsx +0 -721
  85. package/src/stories/RealWorld/FileCitySequence.stories.tsx +0 -516
  86. package/src/stories/RealWorld/RealCanvasFiles.stories.tsx +0 -336
  87. package/src/stories/__traces__/test-run.canvas.json +0 -241
  88. package/src/stories/data/activity-feed-analytics.dashboard.json +0 -300
  89. package/src/stories/data/file-city-images-transformed.otel.canvas.json +0 -295
  90. package/src/stories/data/file-city-workflows.json +0 -269
  91. package/src/stories/data/graph-converter-test-execution.json +0 -443
  92. package/src/stories/data/graph-converter-test.workflow.json +0 -105
  93. package/src/stories/data/graph-converter-validated-execution.json +0 -58
  94. package/src/utils/animationMapping.ts +0 -166
  95. package/src/utils/canvasBounds.ts +0 -146
  96. package/src/utils/graphConverter.ts +0 -148
  97. package/src/utils/iconResolver.tsx +0 -53
  98. package/src/utils/orientationUtils.ts +0 -73
@@ -1,263 +0,0 @@
1
- /**
2
- * DashboardRenderer Stories
3
- *
4
- * Storybook stories for testing and iterating on dashboard rendering.
5
- */
6
-
7
- import type { Meta, StoryObj } from '@storybook/react';
8
- import { ThemeProvider, defaultEditorTheme } from '@principal-ade/industry-theme';
9
- import { DashboardRenderer } from '../../components/dashboard';
10
- import activityFeedDashboard from '../data/activity-feed-analytics.dashboard.json';
11
- import type { DashboardDefinition } from '../../components/dashboard';
12
-
13
- const meta: Meta<typeof DashboardRenderer> = {
14
- title: 'Components/DashboardRenderer',
15
- component: DashboardRenderer,
16
- parameters: {
17
- layout: 'fullscreen',
18
- },
19
- decorators: [
20
- (Story) => (
21
- <ThemeProvider theme={defaultEditorTheme}>
22
- <div style={{ minHeight: '100vh' }}>
23
- <Story />
24
- </div>
25
- </ThemeProvider>
26
- ),
27
- ],
28
- };
29
-
30
- export default meta;
31
- type Story = StoryObj<typeof DashboardRenderer>;
32
-
33
- /**
34
- * Activity Feed Analytics Dashboard
35
- *
36
- * Full dashboard example based on the web-ade activity feed use case.
37
- * Shows mobile vs desktop view percentages, traffic trends, and engagement metrics.
38
- */
39
- export const ActivityFeedAnalytics: Story = {
40
- args: {
41
- dashboard: activityFeedDashboard as DashboardDefinition,
42
- },
43
- };
44
-
45
- /**
46
- * With Metric Click Handler
47
- *
48
- * Demonstrates handling metric clicks - useful for drill-down navigation.
49
- */
50
- export const WithClickHandlers: Story = {
51
- args: {
52
- dashboard: activityFeedDashboard as DashboardDefinition,
53
- onMetricClick: (metricId) => {
54
- alert(`Clicked metric: ${metricId}`);
55
- },
56
- onSourceClick: (source) => {
57
- alert(`Navigate to: ${source.storyboard}/${source.workflow}`);
58
- },
59
- },
60
- };
61
-
62
- /**
63
- * Minimal Dashboard
64
- *
65
- * A simple dashboard with just a few metrics.
66
- */
67
- export const MinimalDashboard: Story = {
68
- args: {
69
- dashboard: {
70
- id: 'minimal',
71
- name: 'Minimal Dashboard',
72
- description: 'A simple dashboard with basic metrics',
73
- metrics: [
74
- {
75
- id: 'total-requests',
76
- name: 'Total Requests',
77
- type: 'counter',
78
- unit: 'requests',
79
- sources: [{ storyboard: 'api', workflow: 'request-handler' }],
80
- query: { derivation: 'count', window: '1h' },
81
- _mockData: { current: 145892, previous: 132456, trend: 'up' },
82
- },
83
- {
84
- id: 'error-rate',
85
- name: 'Error Rate',
86
- type: 'gauge',
87
- unit: '%',
88
- sources: [{ storyboard: 'api', workflow: 'request-handler' }],
89
- query: { derivation: 'error_rate', window: '1h' },
90
- thresholds: { warning: 1.0, critical: 5.0 },
91
- _mockData: { current: 0.3, previous: 0.5, trend: 'down' },
92
- },
93
- {
94
- id: 'p99-latency',
95
- name: 'P99 Latency',
96
- type: 'histogram',
97
- unit: 'ms',
98
- sources: [{ storyboard: 'api', workflow: 'request-handler' }],
99
- query: { derivation: 'p99' },
100
- _mockData: { current: 245, previous: 312, trend: 'down' },
101
- },
102
- ],
103
- layout: {
104
- rows: [
105
- {
106
- title: 'Key Metrics',
107
- panels: [
108
- { id: 'total-requests', span: 4 },
109
- { id: 'error-rate', span: 4 },
110
- { id: 'p99-latency', span: 4 },
111
- ],
112
- },
113
- ],
114
- },
115
- } as DashboardDefinition,
116
- },
117
- };
118
-
119
- /**
120
- * Time Series Focus
121
- *
122
- * Dashboard focused on time series visualizations.
123
- */
124
- export const TimeSeriesFocus: Story = {
125
- args: {
126
- dashboard: {
127
- id: 'time-series',
128
- name: 'Time Series Dashboard',
129
- description: 'Focus on time-based trends',
130
- metrics: [
131
- {
132
- id: 'hourly-requests',
133
- name: 'Hourly Requests',
134
- type: 'counter',
135
- unit: 'requests',
136
- sources: [{ storyboard: 'api', workflow: 'handler' }],
137
- query: { derivation: 'count', timeGroup: 'hour' },
138
- display: { component: 'LineChart', size: 'large' },
139
- _mockData: {
140
- series: [
141
- { date: '00:00', value: 1200 },
142
- { date: '04:00', value: 800 },
143
- { date: '08:00', value: 2400 },
144
- { date: '12:00', value: 3200 },
145
- { date: '16:00', value: 2800 },
146
- { date: '20:00', value: 1800 },
147
- ],
148
- },
149
- },
150
- {
151
- id: 'requests-by-status',
152
- name: 'Requests by Status',
153
- type: 'counter',
154
- unit: 'requests',
155
- sources: [{ storyboard: 'api', workflow: 'handler' }],
156
- query: { derivation: 'count', groupBy: ['status'], timeGroup: 'hour' },
157
- display: { component: 'StackedBarChart', size: 'large' },
158
- _mockData: {
159
- series: [
160
- { date: '00:00', success: 1150, error: 50 },
161
- { date: '04:00', success: 780, error: 20 },
162
- { date: '08:00', success: 2300, error: 100 },
163
- { date: '12:00', success: 3050, error: 150 },
164
- { date: '16:00', success: 2650, error: 150 },
165
- { date: '20:00', success: 1720, error: 80 },
166
- ],
167
- },
168
- },
169
- ],
170
- layout: {
171
- rows: [
172
- {
173
- title: 'Traffic Over Time',
174
- panels: [{ id: 'hourly-requests', span: 12 }],
175
- },
176
- {
177
- title: 'Status Breakdown',
178
- panels: [{ id: 'requests-by-status', span: 12 }],
179
- },
180
- ],
181
- },
182
- } as DashboardDefinition,
183
- },
184
- };
185
-
186
- /**
187
- * With Thresholds
188
- *
189
- * Shows metrics with warning and critical thresholds.
190
- */
191
- export const WithThresholds: Story = {
192
- args: {
193
- dashboard: {
194
- id: 'thresholds',
195
- name: 'SLO Dashboard',
196
- description: 'Service level objectives with thresholds',
197
- metrics: [
198
- {
199
- id: 'availability',
200
- name: 'Availability',
201
- type: 'gauge',
202
- unit: '%',
203
- sources: [{ storyboard: 'infra', workflow: 'health-check' }],
204
- query: { derivation: 'success_rate' },
205
- thresholds: { warning: 99.9, critical: 99.0 },
206
- _mockData: { current: 99.95, trend: 'flat' },
207
- },
208
- {
209
- id: 'error-budget',
210
- name: 'Error Budget Remaining',
211
- type: 'gauge',
212
- unit: '%',
213
- sources: [{ storyboard: 'infra', workflow: 'slo-tracker' }],
214
- query: { derivation: 'percentage' },
215
- thresholds: { warning: 25, critical: 10 },
216
- _mockData: { current: 67.3, previous: 72.1, trend: 'down' },
217
- },
218
- {
219
- id: 'latency-slo',
220
- name: 'Latency SLO',
221
- type: 'gauge',
222
- unit: '%',
223
- description: 'Percentage of requests under 200ms',
224
- sources: [{ storyboard: 'api', workflow: 'handler' }],
225
- query: { derivation: 'percentage', filter: 'duration < 200' },
226
- thresholds: { warning: 95, critical: 90 },
227
- _mockData: { current: 97.2, previous: 96.8, trend: 'up' },
228
- },
229
- ],
230
- layout: {
231
- rows: [
232
- {
233
- title: 'Service Level Objectives',
234
- panels: [
235
- { id: 'availability', span: 4 },
236
- { id: 'error-budget', span: 4 },
237
- { id: 'latency-slo', span: 4 },
238
- ],
239
- },
240
- ],
241
- },
242
- } as DashboardDefinition,
243
- },
244
- };
245
-
246
- /**
247
- * Empty Dashboard
248
- *
249
- * Edge case: dashboard with no metrics.
250
- */
251
- export const EmptyDashboard: Story = {
252
- args: {
253
- dashboard: {
254
- id: 'empty',
255
- name: 'Empty Dashboard',
256
- description: 'This dashboard has no metrics configured yet',
257
- metrics: [],
258
- layout: {
259
- rows: [],
260
- },
261
- } as DashboardDefinition,
262
- },
263
- };