@principal-ai/subsystems-react 0.56.33 → 0.56.35
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.
- package/dist/subsystem/SubsystemComponentGraph.d.ts +65 -1
- package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
- package/dist/subsystem/SubsystemComponentGraph.js +190 -33
- package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
- package/dist/subsystem/TrailStepsNav.d.ts +3 -1
- package/dist/subsystem/TrailStepsNav.d.ts.map +1 -1
- package/dist/subsystem/TrailStepsNav.js +13 -4
- package/dist/subsystem/TrailStepsNav.js.map +1 -1
- package/dist/subsystem/TrailsPanel.d.ts +18 -2
- package/dist/subsystem/TrailsPanel.d.ts.map +1 -1
- package/dist/subsystem/TrailsPanel.js +57 -15
- package/dist/subsystem/TrailsPanel.js.map +1 -1
- package/dist/subsystem/model.d.ts +6 -0
- package/dist/subsystem/model.d.ts.map +1 -1
- package/dist/subsystem/model.js.map +1 -1
- package/dist/subsystem/nodes.d.ts.map +1 -1
- package/dist/subsystem/nodes.js +101 -19
- package/dist/subsystem/nodes.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/Canvases/Subsystem/AgentDrivenWalkthrough.stories.tsx +2007 -0
- package/src/stories/Canvases/Subsystem/NodeIconography.stories.tsx +190 -0
- package/src/subsystem/SubsystemComponentGraph.tsx +292 -33
- package/src/subsystem/TrailStepsNav.tsx +15 -3
- package/src/subsystem/TrailsPanel.tsx +137 -9
- package/src/subsystem/model.ts +6 -0
- package/src/subsystem/nodes.tsx +143 -18
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@xyflow/react/dist/style.css';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
Database,
|
|
7
|
+
FileCode2,
|
|
8
|
+
Globe,
|
|
9
|
+
List,
|
|
10
|
+
PanelsTopLeft,
|
|
11
|
+
SquareFunction,
|
|
12
|
+
Type,
|
|
13
|
+
UserRound,
|
|
14
|
+
type LucideIcon,
|
|
15
|
+
createLucideIcon,
|
|
16
|
+
} from 'lucide-react';
|
|
17
|
+
import { ThemeProvider, defaultEditorTheme, useTheme } from '@principal-ade/industry-theme';
|
|
18
|
+
import { componentColor } from '../../../pierre/constructColors';
|
|
19
|
+
import type { SubsystemComponent, SubsystemComponentConstruct } from '../../../subsystem/model';
|
|
20
|
+
|
|
21
|
+
const meta = {
|
|
22
|
+
title: 'Canvases/Subsystem/UI Isolation/NodeIconography',
|
|
23
|
+
parameters: { layout: 'fullscreen' },
|
|
24
|
+
tags: ['autodocs'],
|
|
25
|
+
decorators: [
|
|
26
|
+
(Story) => (
|
|
27
|
+
<ThemeProvider theme={defaultEditorTheme}>
|
|
28
|
+
<Story />
|
|
29
|
+
</ThemeProvider>
|
|
30
|
+
),
|
|
31
|
+
],
|
|
32
|
+
} satisfies Meta;
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
36
|
+
|
|
37
|
+
type IconChoice = {
|
|
38
|
+
construct: SubsystemComponentConstruct;
|
|
39
|
+
label: string;
|
|
40
|
+
name: string;
|
|
41
|
+
Icon: LucideIcon;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const FunctionLetter = createLucideIcon('FunctionLetter', [
|
|
45
|
+
['path', { d: 'M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3' }],
|
|
46
|
+
['path', { d: 'M9 11.2h5.7' }],
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
const ICON_CHOICES: IconChoice[] = [
|
|
50
|
+
{ construct: 'function', label: 'function', name: 'submitOrder', Icon: FunctionLetter },
|
|
51
|
+
{ construct: 'class', label: 'class', name: 'OrderService', Icon: Box },
|
|
52
|
+
{ construct: 'method', label: 'method', name: 'OrderService.submit', Icon: SquareFunction },
|
|
53
|
+
{ construct: 'external', label: 'external', name: 'PaymentProvider', Icon: Globe },
|
|
54
|
+
{ construct: 'store', label: 'store', name: 'orderStore', Icon: Database },
|
|
55
|
+
{ construct: 'custom_entity', label: 'custom entity', name: 'Customer', Icon: UserRound },
|
|
56
|
+
{ construct: 'interface', label: 'interface', name: 'OrderRepository', Icon: PanelsTopLeft },
|
|
57
|
+
{ construct: 'type_alias', label: 'type alias', name: 'OrderId', Icon: Type },
|
|
58
|
+
{ construct: 'enum', label: 'enum', name: 'OrderStatus', Icon: List },
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
function NodeSpecimen({ choice }: { choice: IconChoice }) {
|
|
62
|
+
const { theme } = useTheme();
|
|
63
|
+
const color = componentColor(
|
|
64
|
+
{ construct: choice.construct } as Pick<SubsystemComponent, 'construct'>,
|
|
65
|
+
'pierre-dark',
|
|
66
|
+
);
|
|
67
|
+
const { Icon } = choice;
|
|
68
|
+
const nodeBg = theme.colors.backgroundSecondary ?? theme.colors.background;
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
style={{
|
|
73
|
+
position: 'relative',
|
|
74
|
+
display: 'flex',
|
|
75
|
+
flexDirection: 'column',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
justifyContent: 'flex-start',
|
|
78
|
+
width: 250,
|
|
79
|
+
height: 96,
|
|
80
|
+
boxSizing: 'border-box',
|
|
81
|
+
gap: 8,
|
|
82
|
+
padding: '14px 16px 0',
|
|
83
|
+
border: `2px solid ${color}`,
|
|
84
|
+
borderRadius: choice.construct === 'external' ? 0 : 8,
|
|
85
|
+
background: nodeBg,
|
|
86
|
+
color: theme.colors.text,
|
|
87
|
+
fontFamily: theme.fonts.body,
|
|
88
|
+
fontSize: theme.fontSizes[2],
|
|
89
|
+
fontWeight: 600,
|
|
90
|
+
textAlign: 'center',
|
|
91
|
+
overflow: 'visible',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<span
|
|
95
|
+
title={choice.label}
|
|
96
|
+
aria-label={choice.label}
|
|
97
|
+
style={{
|
|
98
|
+
display: 'inline-flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
width: 24,
|
|
102
|
+
height: 24,
|
|
103
|
+
flex: '0 0 24px',
|
|
104
|
+
overflow: 'visible',
|
|
105
|
+
color,
|
|
106
|
+
lineHeight: 0,
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
<Icon
|
|
110
|
+
size={choice.construct === 'function' ? 34 : 24}
|
|
111
|
+
strokeWidth={2}
|
|
112
|
+
aria-hidden="true"
|
|
113
|
+
/>
|
|
114
|
+
</span>
|
|
115
|
+
<span style={{ overflowWrap: 'anywhere' }}>{choice.name}</span>
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function IconographyGallery() {
|
|
121
|
+
const { theme } = useTheme();
|
|
122
|
+
const muted = theme.colors.textMuted ?? theme.colors.textSecondary;
|
|
123
|
+
const border = theme.colors.border;
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<main
|
|
127
|
+
style={{
|
|
128
|
+
minHeight: '100vh',
|
|
129
|
+
boxSizing: 'border-box',
|
|
130
|
+
padding: 32,
|
|
131
|
+
background: theme.colors.background,
|
|
132
|
+
color: theme.colors.text,
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<header style={{ maxWidth: 880, marginBottom: 28 }}>
|
|
136
|
+
<h1 style={{ margin: '0 0 8px', fontSize: 22 }}>Node construct iconography</h1>
|
|
137
|
+
<p style={{ margin: 0, color: muted, lineHeight: 1.55 }}>
|
|
138
|
+
A visual-only study of replacing construct-kind text with bare glyphs
|
|
139
|
+
above the node name. The production node is unchanged.
|
|
140
|
+
</p>
|
|
141
|
+
</header>
|
|
142
|
+
|
|
143
|
+
<div
|
|
144
|
+
style={{
|
|
145
|
+
display: 'grid',
|
|
146
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))',
|
|
147
|
+
gap: '24px 18px',
|
|
148
|
+
alignItems: 'start',
|
|
149
|
+
overflowX: 'auto',
|
|
150
|
+
padding: '4px 8px 18px',
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
{ICON_CHOICES.map((choice) => (
|
|
154
|
+
<div key={choice.construct}>
|
|
155
|
+
<div
|
|
156
|
+
style={{
|
|
157
|
+
marginBottom: 10,
|
|
158
|
+
color: muted,
|
|
159
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
|
|
160
|
+
fontSize: 10,
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
{choice.label}
|
|
164
|
+
</div>
|
|
165
|
+
<NodeSpecimen choice={choice} />
|
|
166
|
+
</div>
|
|
167
|
+
))}
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<footer
|
|
171
|
+
style={{
|
|
172
|
+
marginTop: 12,
|
|
173
|
+
paddingTop: 14,
|
|
174
|
+
borderTop: `1px solid ${border}`,
|
|
175
|
+
color: muted,
|
|
176
|
+
fontSize: 11,
|
|
177
|
+
lineHeight: 1.5,
|
|
178
|
+
}}
|
|
179
|
+
>
|
|
180
|
+
Icon mapping is intentionally provisional. Each node name stays visible
|
|
181
|
+
so the glyphs can be judged for recognition, not just visual polish.
|
|
182
|
+
</footer>
|
|
183
|
+
</main>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Compare a bare-glyph treatment across every subsystem construct. */
|
|
188
|
+
export const CompareTreatments: Story = {
|
|
189
|
+
render: () => <IconographyGallery />,
|
|
190
|
+
};
|