@principal-ai/subsystems-react 0.56.25 → 0.56.27

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 (45) hide show
  1. package/dist/subsystem/C4ProjectionView.d.ts +12 -2
  2. package/dist/subsystem/C4ProjectionView.d.ts.map +1 -1
  3. package/dist/subsystem/C4ProjectionView.js +22 -9
  4. package/dist/subsystem/C4ProjectionView.js.map +1 -1
  5. package/dist/subsystem/ConstructsCatalog.d.ts +18 -11
  6. package/dist/subsystem/ConstructsCatalog.d.ts.map +1 -1
  7. package/dist/subsystem/ConstructsCatalog.js +25 -27
  8. package/dist/subsystem/ConstructsCatalog.js.map +1 -1
  9. package/dist/subsystem/SubsystemComponentGraph.d.ts +13 -3
  10. package/dist/subsystem/SubsystemComponentGraph.d.ts.map +1 -1
  11. package/dist/subsystem/SubsystemComponentGraph.js +81 -27
  12. package/dist/subsystem/SubsystemComponentGraph.js.map +1 -1
  13. package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts +2 -0
  14. package/dist/subsystem/__fixtures__/c4SketchGallery.d.ts.map +1 -1
  15. package/dist/subsystem/__fixtures__/c4SketchGallery.js +8 -0
  16. package/dist/subsystem/__fixtures__/c4SketchGallery.js.map +1 -1
  17. package/dist/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +2 -1
  18. package/dist/subsystem/__fixtures__/c4Sketches/openbot.json +2 -1
  19. package/dist/subsystem/model.d.ts +7 -0
  20. package/dist/subsystem/model.d.ts.map +1 -1
  21. package/dist/subsystem/model.js +27 -0
  22. package/dist/subsystem/model.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/stories/Canvases/C4/C4Sketch.stories.tsx +6 -0
  25. package/src/stories/Canvases/Subsystem/ContainerFrames.stories.tsx +6 -3
  26. package/src/stories/Canvases/Subsystem/CustomEntities.stories.tsx +2 -1
  27. package/src/stories/Canvases/Subsystem/EdgeViews.stories.tsx +2 -1
  28. package/src/stories/Canvases/Subsystem/Issues.stories.tsx +2 -1
  29. package/src/stories/Canvases/Subsystem/ModuleBadges.stories.tsx +3 -2
  30. package/src/stories/Canvases/Subsystem/Processes.stories.tsx +2 -1
  31. package/src/stories/Canvases/Subsystem/Reorder.stories.tsx +2 -1
  32. package/src/stories/Canvases/Subsystem/Scenarios.stories.tsx +6 -3
  33. package/src/stories/Canvases/Subsystem/TrailAutoplay.stories.tsx +2 -1
  34. package/src/stories/Canvases/Subsystem/Trails.stories.tsx +4 -2
  35. package/src/stories/Components/ConstructsCatalog.stories.tsx +2 -1
  36. package/src/subsystem/C4ProjectionView.tsx +44 -16
  37. package/src/subsystem/ConstructsCatalog.tsx +59 -58
  38. package/src/subsystem/DescriptionOverlay.test.tsx +16 -8
  39. package/src/subsystem/SubsystemComponentGraph.sidebar.test.tsx +27 -7
  40. package/src/subsystem/SubsystemComponentGraph.tsx +140 -54
  41. package/src/subsystem/__fixtures__/c4SketchGallery.ts +10 -0
  42. package/src/subsystem/__fixtures__/c4Sketches/maintenance-bridge.json +2 -1
  43. package/src/subsystem/__fixtures__/c4Sketches/openbot.json +2 -1
  44. package/src/subsystem/model.collapse.test.ts +35 -1
  45. package/src/subsystem/model.ts +28 -0
@@ -18,8 +18,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
18
18
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
19
19
  import { ReactFlow, ReactFlowProvider, useReactFlow, useViewport, applyNodeChanges, } from '@xyflow/react';
20
20
  import { useTheme } from '@principal-ade/industry-theme';
21
+ import { SUBSYSTEM_MODEL_DESCRIPTION_MAX } from '@principal-ai/subsystems-core';
21
22
  import { ArrowDown, ArrowRight, Boxes, Files, Route, Unlink, X } from 'lucide-react';
22
- import { buildSubsystemGraph, deriveGraphEdges, buildBoundaryLayoutGroups, isCardFrame, isConstructsOnlyModel, packageColor, moduleGroupNodeId, processGroupNodeId, isTrailMechanism, edgeColor, MECHANISM_DESCRIPTIONS, subsystemGraphLayoutKey, trailStepGraphEdgeId, unroutedEdgeIds, } from './model';
23
+ import { buildSubsystemGraph, deriveGraphEdges, buildBoundaryLayoutGroups, cardFramesForAliases, isCardFrame, isConstructsOnlyModel, packageColor, moduleGroupNodeId, processGroupNodeId, isTrailMechanism, edgeColor, MECHANISM_DESCRIPTIONS, subsystemGraphLayoutKey, trailStepGraphEdgeId, unroutedEdgeIds, } from './model';
23
24
  import { ConstructsCatalog } from './ConstructsCatalog';
24
25
  import { ContainersPanel } from './ContainersPanel';
25
26
  import { technologyBrand } from './techIcons';
@@ -140,10 +141,20 @@ const TrailDrawerContent = memo(function TrailDrawerContent({ render, trail, ste
140
141
  onVisibleStepChange,
141
142
  }) }));
142
143
  });
143
- function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirection: layoutDirectionProp, defaultLayoutDirection = 'horizontal', onLayoutDirectionChange, hideLayoutToggle = false, refocusOnLayoutFlip = true, initialTrailId, onTrailSelect, onTrailStepHover, onReorderTrails, stepEmphasis, onRemoveStepEmphasis, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, onAutoPlayStep, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, canvasOverlay, interactive = true, canvasBackground = 'theme', onLayoutReady, onNodeRects, sidebarExtra, sidebarAfterDescription, issues, showIssues, filesActive, sidebarScope, onSidebarTrailChange, focusIssueCategory, laneStatus, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileViewer, renderTrailViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, codeProcessKeys, regionDetails, defaultFramesCollapsed = true, containersActive, hideDrawer = false, persistKey, liveEvents, agentsPanel }) {
144
+ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirection: layoutDirectionProp, defaultLayoutDirection = 'horizontal', onLayoutDirectionChange, hideLayoutToggle = false, refocusOnLayoutFlip = true, initialTrailId, onTrailSelect, onTrailStepHover, onReorderTrails, stepEmphasis, onRemoveStepEmphasis, onSelect, onEdgeSelect, measured: _measured, maxNodeWidth, showEdgeLabels, showSingletonFrames = true, moduleNesting, edgeView, hideSidebar, trailStepMode = 'focus', autoPlayTrails = false, trailAutoPlayIntervalMs = TRAIL_PLAY_PAUSE_MS, onAutoPlayStep, zoomOnTrailFocus = true, trailFocusDurationMs = 300, graphTitle, showTrailTitle = false, description, notes, canvasOverlay, interactive = true, canvasBackground = 'theme', onLayoutReady, onNodeRects, sidebarExtra, sidebarAfterDescription, issues, showIssues, filesActive, sidebarScope, onSidebarTrailChange, focusIssueCategory, laneStatus, onSelectIssue, onApplyIssueFix, onHoverIssue, renderFileViewer, renderTrailViewer, onFileSelect, componentVerification, onInspectSymbol, boundaryColors, codeProcessKeys, regionDetails, defaultFramesCollapsed = true, containersActive, hideDrawer = false, persistKey, liveEvents, agentsPanel }) {
144
145
  const { theme } = useTheme();
145
146
  const { fitView, fitBounds } = useReactFlow();
146
147
  const [descriptionOpen, setDescriptionOpen] = useState(false);
148
+ const rawDescription = description?.trim();
149
+ // The host caps the authored description; trim defensively for other hosts.
150
+ const shortDescription = rawDescription && rawDescription.length > SUBSYSTEM_MODEL_DESCRIPTION_MAX
151
+ ? `${rawDescription.slice(0, SUBSYSTEM_MODEL_DESCRIPTION_MAX - 1)}…`
152
+ : rawDescription;
153
+ const extendedNotes = notes?.trim();
154
+ // The short description owns the top-left slot; a legacy model with only
155
+ // notes falls back to a clamped preview of them.
156
+ const descriptionPreview = shortDescription || extendedNotes;
157
+ const hasNotes = Boolean(extendedNotes);
147
158
  const viewport = useViewport();
148
159
  // Restored once per mount from `localStorage` (see `readViewState`). Each
149
160
  // graph is its own tab/mount, so `persistKey` is stable for a mount.
@@ -216,7 +227,39 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
216
227
  // every card frame takes, `toggledGroupIds` the frames flipped away from it.
217
228
  const [framesCollapsed, setFramesCollapsed] = useState(() => persisted.framesCollapsed ?? defaultFramesCollapsed);
218
229
  const [toggledGroupIds, setToggledGroupIds] = useState(() => new Set(persisted.toggledFrames ?? []));
219
- const [committedCollapsed, setCommittedCollapsed] = useState({ framesCollapsed, toggled: toggledGroupIds });
230
+ // Picking a trail opens the container cards that hold its cast, so the flow
231
+ // reads as its components instead of a row of folded boxes. Derived rather
232
+ // than written into the user's frame state: clearing the trail — or moving to
233
+ // another — restores exactly the frames they had open before.
234
+ const trailFrameIds = useMemo(() => {
235
+ if (!layoutTrailId)
236
+ return new Set();
237
+ const trail = (trails ?? []).find((t) => t.id === layoutTrailId);
238
+ if (!trail)
239
+ return new Set();
240
+ const aliases = new Set();
241
+ for (const step of trail.steps) {
242
+ aliases.add(step.from);
243
+ aliases.add(step.to);
244
+ }
245
+ return cardFramesForAliases({ components }, aliases, { showSingletonFrames, moduleNesting, codeProcessKeys });
246
+ }, [layoutTrailId, trails, components, showSingletonFrames, moduleNesting, codeProcessKeys]);
247
+ // `framesCollapsed` is the default every card takes; a toggled id is the
248
+ // exception. Opening a trail's frames therefore means adding them to the
249
+ // default-collapsed set (or removing them from the default-open one).
250
+ const effectiveToggledGroupIds = useMemo(() => {
251
+ if (trailFrameIds.size === 0)
252
+ return toggledGroupIds;
253
+ const next = new Set(toggledGroupIds);
254
+ for (const id of trailFrameIds) {
255
+ if (framesCollapsed)
256
+ next.add(id);
257
+ else
258
+ next.delete(id);
259
+ }
260
+ return next;
261
+ }, [toggledGroupIds, trailFrameIds, framesCollapsed]);
262
+ const [committedCollapsed, setCommittedCollapsed] = useState({ framesCollapsed, toggled: effectiveToggledGroupIds });
220
263
  const toggleCollapsed = useCallback((groupId) => {
221
264
  setToggledGroupIds((prev) => {
222
265
  const next = new Set(prev);
@@ -231,7 +274,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
231
274
  setFramesCollapsed(collapsed);
232
275
  setToggledGroupIds(new Set());
233
276
  }, []);
234
- const collapsedKey = `${framesCollapsed ? 'closed' : 'open'}:${Array.from(toggledGroupIds).sort().join(',')}`;
277
+ const collapsedKey = `${framesCollapsed ? 'closed' : 'open'}:${Array.from(effectiveToggledGroupIds).sort().join(',')}`;
235
278
  const committedCollapsedKey = `${committedCollapsed.framesCollapsed ? 'closed' : 'open'}:${Array.from(committedCollapsed.toggled).sort().join(',')}`;
236
279
  const changeLayoutDirection = useCallback((next) => {
237
280
  if (next === requestedDirection)
@@ -273,7 +316,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
273
316
  if (reduceMotion) {
274
317
  setCommittedDirection(requestedDirection);
275
318
  setCommittedTrailId(layoutTrailId);
276
- setCommittedCollapsed({ framesCollapsed, toggled: toggledGroupIds });
319
+ setCommittedCollapsed({ framesCollapsed, toggled: effectiveToggledGroupIds });
277
320
  return;
278
321
  }
279
322
  flipSawPendingLayoutRef.current = false;
@@ -282,7 +325,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
282
325
  flipFadeTimerRef.current = null;
283
326
  setCommittedDirection(requestedDirection);
284
327
  setCommittedTrailId(layoutTrailId);
285
- setCommittedCollapsed({ framesCollapsed, toggled: toggledGroupIds });
328
+ setCommittedCollapsed({ framesCollapsed, toggled: effectiveToggledGroupIds });
286
329
  }, LAYOUT_FLIP_EDGE_MS);
287
330
  return () => {
288
331
  if (flipFadeTimerRef.current != null) {
@@ -297,7 +340,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
297
340
  requestedDirection,
298
341
  layoutTrailId,
299
342
  framesCollapsed,
300
- toggledGroupIds,
343
+ effectiveToggledGroupIds,
301
344
  ]);
302
345
  // Beat 3: the committed layout has settled → the node slide is over, fade
303
346
  // the edges back in. The ref keeps the OLD `layoutReady` (still true until
@@ -2219,7 +2262,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2219
2262
  // trail, diagnostics tab) because the canvas dims from
2220
2263
  // the same facts the sidebar renders.
2221
2264
  const sidebarVisible = !hideSidebar &&
2222
- (description || filesActive || containersActive || issuesActive || sidebarExtra || sidebarAfterDescription ||
2265
+ (descriptionPreview || filesActive || containersActive || issuesActive || sidebarExtra || sidebarAfterDescription ||
2223
2266
  hasTrails);
2224
2267
  const sidebarBodyVisible = hasTrails || filesActive || containersActive || issuesActive;
2225
2268
  const sidebarTabs = issuesActive && !sidebarTrail
@@ -2230,8 +2273,8 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2230
2273
  ]
2231
2274
  : undefined
2232
2275
  : undefined;
2233
- // Header block: extras, then the description.
2234
- const sidebarHeader = (_jsxs(_Fragment, { children: [sidebarExtra, description && (_jsx(DescriptionPreview, { content: description, open: descriptionOpen, onOpen: () => setDescriptionOpen(true), onClose: () => setDescriptionOpen(false), slideIdPrefix: "subsystem-desc" })), sidebarAfterDescription] }));
2276
+ // Header block: extras, then the short description.
2277
+ const sidebarHeader = (_jsxs(_Fragment, { children: [sidebarExtra, descriptionPreview && (_jsx(DescriptionPreview, { content: descriptionPreview, clamp: !shortDescription, open: hasNotes && descriptionOpen, onOpen: hasNotes ? () => setDescriptionOpen(true) : undefined, onClose: hasNotes ? () => setDescriptionOpen(false) : undefined, slideIdPrefix: "subsystem-desc" })), sidebarAfterDescription] }));
2235
2278
  // Lower panel: diagnostics, the file tree, or the trail flow list.
2236
2279
  const sidebarPanel = issuesActive ? (diagnosticsTab === 'agents' && agentsPanel && !sidebarTrail ? (_jsx(SubsystemAgentsPanel, { ...agentsPanel })) : (_jsx(SubsystemIssueList, { issues: sidebarScope.issues, focusCategory: focusIssueCategory, laneStatus: sidebarTrail ? undefined : laneStatus, onSelectIssue: focusIssueTarget, onDeselectIssue: unfocusIssueTarget, onApplyFix: onApplyIssueFix, onHoverIssue: onHoverIssue, onExpandedCategoriesChange: handleExpandedCategoriesChange }))) : containersActive ? (_jsx(ContainersPanel, { containers: containerItems, activeId: containerItems.find((c) => c.region.key === focusedBoundaryKey)?.id ?? null, onFocus: focusContainer, onToggle: toggleCollapsed, onOpenAll: () => setAllFramesCollapsed(false), onCloseAll: () => setAllFramesCollapsed(true) })) : filesActive ? treePaths.entries.length === 0 ? (_jsx("div", { style: { padding: 16, color: theme.colors.textSecondary }, children: "No files for this trail." })) : (_jsx(SubsystemFileTree, { headerless: true, files: treeFilePaths, selectedFile: openFile ? treePaths.toDisplay.get(openFile) : null, onSelectFile: (path) => {
2237
2280
  const file = treePaths.toFile.get(path);
@@ -2278,7 +2321,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2278
2321
  fontSize: theme.fontSizes[0],
2279
2322
  color: theme.colors.textMuted ?? theme.colors.textSecondary,
2280
2323
  }, children: fileOverlay.file }), _jsx(FileOverlayCloseButton, { onClose: closeFileOverlay })] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: _jsx(FileDrawerContent, { render: renderDrawerContent, file: fileOverlay.file, startLine: fileOverlay.startLine, endLine: fileOverlay.endLine, fullFile: true }) })] }));
2281
- return (_jsxs(GraphWithSidebar, { hidden: !sidebarVisible, bodyHidden: !sidebarBodyVisible, header: sidebarHeader, tabs: sidebarTabs, activeTab: diagnosticsTab, onTabChange: (id) => setDiagnosticsTab(id), sidebarBody: sidebarBody, tabListLabel: issuesActive ? 'Diagnostics view' : 'Sidebar view', defaultWidth: persisted.sidebarWidth ?? 450, minWidth: 240, maxWidth: sidebarMaxWidth, persistKey: persistKey, onResizeEnd: () => requestAnimationFrame(() => fitView()), children: [!hideSidebar && description && descriptionOpen && (_jsx(DescriptionOverlay, { description: description, ariaLabel: "Subsystem description", slideIdPrefix: "subsystem-desc-overlay", onClose: () => setDescriptionOpen(false) })), _jsxs("div", { style: { flex: 1, position: 'relative', display: 'flex', flexDirection: committedDirection === 'vertical' ? 'row' : 'column', minHeight: 0, minWidth: 0 }, children: [_jsxs("div", { className: layoutFlipping ? LAYOUT_FLIP_CLASS : undefined, style: {
2324
+ return (_jsxs(GraphWithSidebar, { hidden: !sidebarVisible, bodyHidden: !sidebarBodyVisible, header: sidebarHeader, tabs: sidebarTabs, activeTab: diagnosticsTab, onTabChange: (id) => setDiagnosticsTab(id), sidebarBody: sidebarBody, tabListLabel: issuesActive ? 'Diagnostics view' : 'Sidebar view', defaultWidth: persisted.sidebarWidth ?? 450, minWidth: 240, maxWidth: sidebarMaxWidth, persistKey: persistKey, onResizeEnd: () => requestAnimationFrame(() => fitView()), children: [!hideSidebar && hasNotes && descriptionOpen && (_jsx(DescriptionOverlay, { description: extendedNotes ?? '', ariaLabel: "Subsystem notes", slideIdPrefix: "subsystem-desc-overlay", onClose: () => setDescriptionOpen(false) })), _jsxs("div", { style: { flex: 1, position: 'relative', display: 'flex', flexDirection: committedDirection === 'vertical' ? 'row' : 'column', minHeight: 0, minWidth: 0 }, children: [_jsxs("div", { className: layoutFlipping ? LAYOUT_FLIP_CLASS : undefined, style: {
2282
2325
  position: 'relative',
2283
2326
  flex: collapseCanvas ? 0 : 1,
2284
2327
  minHeight: 0,
@@ -2557,6 +2600,32 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
2557
2600
  focusedTrail &&
2558
2601
  renderTrailViewer ? (_jsx(TrailDrawerContent, { render: renderTrailDrawerContent, trail: focusedTrail, stepIndex: drawerTarget.stepIndex, onOpenFile: onOpenFileFromTrail, resolveSymbol: resolveTrailSymbol, onSymbolClick: openConstructDeclaration, onVisibleStepChange: setVisibleStepIndex })) : drawerTarget?.kind === 'file' ? (_jsx(FileDrawerContent, { render: renderDrawerContent, file: drawerTarget.file, startLine: drawerTarget.startLine, endLine: drawerTarget.endLine })) : null }), committedDirection !== 'vertical' && fileOverlayView, !transparentCanvas && _jsx(GraphLayoutCover, { revealed: layoutReady || layoutFlipping }), canvasOverlay, liveEvents ? _jsx(MaintainLivePanel, { ...liveEvents }) : null] })] }));
2559
2602
  }
2603
+ /**
2604
+ * One option in the header's segmented sidebar-view switch. Owns the hover
2605
+ * state so every segment reacts the same way — the Issues segment is a
2606
+ * `SubsystemDiagnosticToggle` and already hovers; keeping the plain options
2607
+ * here means the switch has one hover affordance, not two.
2608
+ */
2609
+ function SidebarViewOption({ active, ariaLabel, title, onClick, children, }) {
2610
+ const { theme } = useTheme();
2611
+ const [hover, setHover] = useState(false);
2612
+ return (_jsx("button", { type: "button", "aria-label": ariaLabel, title: title, "aria-pressed": active, onClick: onClick, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), style: {
2613
+ display: 'inline-flex',
2614
+ alignItems: 'center',
2615
+ justifyContent: 'center',
2616
+ gap: 4,
2617
+ height: 28,
2618
+ padding: '4px 16px',
2619
+ fontFamily: theme.fonts.monospace,
2620
+ fontSize: theme.fontSizes[0],
2621
+ border: 'none',
2622
+ borderRadius: 4,
2623
+ background: active || hover ? theme.colors.border : 'transparent',
2624
+ color: active ? theme.colors.text : (theme.colors.textMuted ?? theme.colors.textSecondary),
2625
+ cursor: 'pointer',
2626
+ transition: 'background 120ms ease',
2627
+ }, children: children }));
2628
+ }
2560
2629
  export function SubsystemComponentGraph(props) {
2561
2630
  const { theme } = useTheme();
2562
2631
  const wrapRef = useRef(null);
@@ -2606,21 +2675,6 @@ export function SubsystemComponentGraph(props) {
2606
2675
  props.diagnostic?.onToggle?.();
2607
2676
  }
2608
2677
  };
2609
- const viewButtonStyle = (active) => ({
2610
- display: 'inline-flex',
2611
- alignItems: 'center',
2612
- justifyContent: 'center',
2613
- gap: 4,
2614
- height: 28,
2615
- padding: '4px 16px',
2616
- fontFamily: theme.fonts.monospace,
2617
- fontSize: theme.fontSizes[0],
2618
- border: 'none',
2619
- borderRadius: 4,
2620
- background: active ? theme.colors.border : 'transparent',
2621
- color: active ? theme.colors.text : (theme.colors.textMuted ?? theme.colors.textSecondary),
2622
- cursor: 'pointer',
2623
- });
2624
2678
  useEffect(() => {
2625
2679
  if (props.initialTrailId)
2626
2680
  setFilesOpen(false);
@@ -2680,6 +2734,6 @@ export function SubsystemComponentGraph(props) {
2680
2734
  padding: 2,
2681
2735
  border: `1px solid ${theme.colors.border}`,
2682
2736
  borderRadius: 6,
2683
- }, children: [containerCount > 0 && (_jsxs("button", { type: "button", "aria-label": `Containers (${containerCount} ${containerCount === 1 ? 'container' : 'containers'})`, title: "Show containers", "aria-pressed": containersActive, onClick: () => selectSidebarView('containers'), style: viewButtonStyle(containersActive), children: [_jsx(Boxes, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Containers" }), _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: containerCount })] })), _jsxs("button", { type: "button", "aria-label": sidebarScope.trail ? 'Trail' : `Trails (${trailCount} ${trailCount === 1 ? 'trail' : 'trails'})`, "aria-pressed": !filesActive && !containersActive && !issuesActive, onClick: () => selectSidebarView('trails'), style: viewButtonStyle(!filesActive && !containersActive && !issuesActive), children: [_jsx(Route, { size: 14, "aria-hidden": true }), _jsx("span", { children: trailViewLabel }), !sidebarScope.trail && _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: trailCount })] }), hasFiles && (_jsxs("button", { type: "button", "aria-label": `Files (${fileCount} files)`, title: "Show files", "aria-pressed": filesActive, onClick: () => selectSidebarView('files'), style: viewButtonStyle(filesActive), children: [_jsx(Files, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Files" }), _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: fileCount })] })), hasIssues && (_jsx(SubsystemDiagnosticToggle, { ...sidebarDiagnostic, labelText: "Issues", segmented: true, active: issuesActive, onToggle: () => selectSidebarView('issues') }))] }), props.headerActions] })), _jsx("div", { ref: wrapRef, style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: constructsOnly ? (_jsx(ConstructsCatalog, { components: props.components, onSelect: props.onSelect, title: props.title, hideSidebar: props.hideSidebar, description: props.description, descriptionOpen: props.descriptionOpen, onDescriptionOpenChange: props.onDescriptionOpenChange, diagnostic: props.diagnostic, sidebarExtra: props.headerActions ? _jsxs(_Fragment, { children: [props.headerActions, props.sidebarExtra] }) : props.sidebarExtra, sidebarAfterDescription: props.sidebarAfterDescription, renderFileViewer: props.renderFileViewer, onFileSelect: props.onFileSelect, componentVerification: props.componentVerification, onInspectSymbol: props.onInspectSymbol })) : (_jsx(ReactFlowProvider, { children: _jsx(Inner, { ...props, showIssues: issuesActive, filesActive: filesActive, containersActive: containersActive, measured: size, sidebarScope: sidebarScope, onSidebarTrailChange: setSidebarTrailId }) })) })] }));
2737
+ }, children: [containerCount > 0 && (_jsxs(SidebarViewOption, { ariaLabel: `Containers (${containerCount} ${containerCount === 1 ? 'container' : 'containers'})`, title: "Show containers", active: containersActive, onClick: () => selectSidebarView('containers'), children: [_jsx(Boxes, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Containers" }), _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: containerCount })] })), _jsxs(SidebarViewOption, { ariaLabel: sidebarScope.trail ? 'Trail' : `Trails (${trailCount} ${trailCount === 1 ? 'trail' : 'trails'})`, active: !filesActive && !containersActive && !issuesActive, onClick: () => selectSidebarView('trails'), children: [_jsx(Route, { size: 14, "aria-hidden": true }), _jsx("span", { children: trailViewLabel }), !sidebarScope.trail && _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: trailCount })] }), hasFiles && (_jsxs(SidebarViewOption, { ariaLabel: `Files (${fileCount} files)`, title: "Show files", active: filesActive, onClick: () => selectSidebarView('files'), children: [_jsx(Files, { size: 14, "aria-hidden": true }), _jsx("span", { children: "Files" }), _jsx("span", { style: { fontWeight: 600, marginLeft: 4 }, children: fileCount })] })), hasIssues && (_jsx(SubsystemDiagnosticToggle, { ...sidebarDiagnostic, labelText: "Issues", segmented: true, active: issuesActive, onToggle: () => selectSidebarView('issues') }))] }), props.headerActions] })), _jsx("div", { ref: wrapRef, style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: constructsOnly ? (_jsx(ConstructsCatalog, { components: props.components, onSelect: props.onSelect, title: props.title, hideSidebar: props.hideSidebar, description: props.description, notes: props.notes, descriptionOpen: props.descriptionOpen, onDescriptionOpenChange: props.onDescriptionOpenChange, diagnostic: props.diagnostic, sidebarExtra: props.headerActions ? _jsxs(_Fragment, { children: [props.headerActions, props.sidebarExtra] }) : props.sidebarExtra, sidebarAfterDescription: props.sidebarAfterDescription, renderFileViewer: props.renderFileViewer, onFileSelect: props.onFileSelect, componentVerification: props.componentVerification, onInspectSymbol: props.onInspectSymbol })) : (_jsx(ReactFlowProvider, { children: _jsx(Inner, { ...props, showIssues: issuesActive, filesActive: filesActive, containersActive: containersActive, measured: size, sidebarScope: sidebarScope, onSidebarTrailChange: setSidebarTrailId }) })) })] }));
2684
2738
  }
2685
2739
  //# sourceMappingURL=SubsystemComponentGraph.js.map