@cascivo/mcp 0.2.0 → 0.3.3

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 (205) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +53 -23
  3. package/dist/context/accordion.md +93 -0
  4. package/dist/context/action-sheet.md +117 -0
  5. package/dist/context/alert-dialog.md +122 -0
  6. package/dist/context/alert.md +110 -0
  7. package/dist/context/app-shell.md +98 -0
  8. package/dist/context/aspect-ratio.md +92 -0
  9. package/dist/context/avatar-group.md +111 -0
  10. package/dist/context/avatar.md +100 -0
  11. package/dist/context/badge.md +119 -0
  12. package/dist/context/block/console-app.md +66 -0
  13. package/dist/context/block/dashboard-charts.md +61 -0
  14. package/dist/context/block/empty-dashboard.md +60 -0
  15. package/dist/context/block/login-page.md +60 -0
  16. package/dist/context/block/notification-center.md +61 -0
  17. package/dist/context/block/page-with-breadcrumb.md +54 -0
  18. package/dist/context/block/settings-form-page.md +60 -0
  19. package/dist/context/block/sidebar-app.md +55 -0
  20. package/dist/context/block/stats-cards.md +61 -0
  21. package/dist/context/block/users-table-page.md +61 -0
  22. package/dist/context/blockquote.md +95 -0
  23. package/dist/context/bottom-sheet.md +112 -0
  24. package/dist/context/breadcrumb.md +106 -0
  25. package/dist/context/button-group.md +100 -0
  26. package/dist/context/button.md +117 -0
  27. package/dist/context/calendar.md +118 -0
  28. package/dist/context/card.md +90 -0
  29. package/dist/context/carousel.md +101 -0
  30. package/dist/context/chart/area-chart.md +99 -0
  31. package/dist/context/chart/bar-chart.md +114 -0
  32. package/dist/context/chart/boxplot.md +82 -0
  33. package/dist/context/chart/bubble-chart.md +80 -0
  34. package/dist/context/chart/bullet.md +75 -0
  35. package/dist/context/chart/calendar.md +79 -0
  36. package/dist/context/chart/candlestick.md +104 -0
  37. package/dist/context/chart/combo-chart.md +78 -0
  38. package/dist/context/chart/funnel.md +87 -0
  39. package/dist/context/chart/gauge.md +87 -0
  40. package/dist/context/chart/heatmap.md +77 -0
  41. package/dist/context/chart/histogram.md +74 -0
  42. package/dist/context/chart/kpi.md +70 -0
  43. package/dist/context/chart/line-chart.md +113 -0
  44. package/dist/context/chart/meter.md +71 -0
  45. package/dist/context/chart/pie-chart.md +126 -0
  46. package/dist/context/chart/polar.md +92 -0
  47. package/dist/context/chart/radar.md +81 -0
  48. package/dist/context/chart/radial-bar.md +96 -0
  49. package/dist/context/chart/sankey.md +89 -0
  50. package/dist/context/chart/scatter-chart.md +90 -0
  51. package/dist/context/chart/sparkline.md +69 -0
  52. package/dist/context/chart/stream.md +88 -0
  53. package/dist/context/chart/sunburst.md +93 -0
  54. package/dist/context/chart/treemap.md +84 -0
  55. package/dist/context/chat-bubble.md +116 -0
  56. package/dist/context/checkbox-card.md +104 -0
  57. package/dist/context/checkbox.md +104 -0
  58. package/dist/context/code-snippet.md +118 -0
  59. package/dist/context/code.md +103 -0
  60. package/dist/context/collapsible.md +104 -0
  61. package/dist/context/color-picker.md +101 -0
  62. package/dist/context/combobox.md +125 -0
  63. package/dist/context/command-menu.md +121 -0
  64. package/dist/context/comparison.md +117 -0
  65. package/dist/context/contained-list.md +103 -0
  66. package/dist/context/context-menu.md +103 -0
  67. package/dist/context/copy-button.md +106 -0
  68. package/dist/context/data-list.md +99 -0
  69. package/dist/context/data-table.md +149 -0
  70. package/dist/context/date-picker.md +116 -0
  71. package/dist/context/date-range-picker.md +113 -0
  72. package/dist/context/dock.md +117 -0
  73. package/dist/context/drawer.md +111 -0
  74. package/dist/context/dropdown.md +96 -0
  75. package/dist/context/editable.md +101 -0
  76. package/dist/context/editor/code-editor.md +146 -0
  77. package/dist/context/editor/highlight.md +74 -0
  78. package/dist/context/empty-state.md +101 -0
  79. package/dist/context/fab.md +128 -0
  80. package/dist/context/field.md +118 -0
  81. package/dist/context/file-uploader.md +121 -0
  82. package/dist/context/filter.md +129 -0
  83. package/dist/context/flow/flow-background.md +103 -0
  84. package/dist/context/flow/flow-canvas.md +82 -0
  85. package/dist/context/flow/flow-controls.md +84 -0
  86. package/dist/context/flow/flow-edge.md +128 -0
  87. package/dist/context/flow/flow-handle.md +83 -0
  88. package/dist/context/flow/flow-minimap.md +89 -0
  89. package/dist/context/flow/flow-node.md +97 -0
  90. package/dist/context/flow/flow-panel.md +75 -0
  91. package/dist/context/flow/flow-story.md +145 -0
  92. package/dist/context/flow/flow.md +139 -0
  93. package/dist/context/form.md +104 -0
  94. package/dist/context/header-panel.md +96 -0
  95. package/dist/context/header.md +104 -0
  96. package/dist/context/heading.md +107 -0
  97. package/dist/context/hover-card.md +108 -0
  98. package/dist/context/icon-button.md +115 -0
  99. package/dist/context/image.md +115 -0
  100. package/dist/context/indicator.md +95 -0
  101. package/dist/context/inline-loading.md +101 -0
  102. package/dist/context/input-group.md +122 -0
  103. package/dist/context/input.md +101 -0
  104. package/dist/context/item.md +109 -0
  105. package/dist/context/join.md +97 -0
  106. package/dist/context/kbd.md +100 -0
  107. package/dist/context/label.md +117 -0
  108. package/dist/context/layout/app-shell.md +85 -0
  109. package/dist/context/layout/auth-layout.md +74 -0
  110. package/dist/context/layout/auto-grid.md +69 -0
  111. package/dist/context/layout/center.md +67 -0
  112. package/dist/context/layout/columns.md +70 -0
  113. package/dist/context/layout/dashboard-layout.md +68 -0
  114. package/dist/context/layout/grid.md +70 -0
  115. package/dist/context/layout/masonry.md +70 -0
  116. package/dist/context/layout/page-header.md +75 -0
  117. package/dist/context/layout/section.md +69 -0
  118. package/dist/context/layout/settings-layout.md +68 -0
  119. package/dist/context/layout/spacer.md +64 -0
  120. package/dist/context/layout/split-view.md +71 -0
  121. package/dist/context/layout/stack.md +93 -0
  122. package/dist/context/link.md +112 -0
  123. package/dist/context/list.md +109 -0
  124. package/dist/context/log-viewer.md +124 -0
  125. package/dist/context/menu-button.md +137 -0
  126. package/dist/context/menu.md +108 -0
  127. package/dist/context/menubar.md +92 -0
  128. package/dist/context/modal.md +96 -0
  129. package/dist/context/multi-select.md +104 -0
  130. package/dist/context/native-select.md +118 -0
  131. package/dist/context/navigation-menu.md +95 -0
  132. package/dist/context/notification.md +116 -0
  133. package/dist/context/number-input.md +117 -0
  134. package/dist/context/otp-input.md +98 -0
  135. package/dist/context/overflow-menu.md +107 -0
  136. package/dist/context/pagination.md +123 -0
  137. package/dist/context/password-input.md +100 -0
  138. package/dist/context/popover.md +108 -0
  139. package/dist/context/progress-bar.md +107 -0
  140. package/dist/context/progress-circle.md +101 -0
  141. package/dist/context/progress-indicator.md +105 -0
  142. package/dist/context/progress.md +109 -0
  143. package/dist/context/prose.md +110 -0
  144. package/dist/context/pull-to-refresh.md +101 -0
  145. package/dist/context/qr-code.md +101 -0
  146. package/dist/context/radial-progress.md +117 -0
  147. package/dist/context/radio-card.md +95 -0
  148. package/dist/context/radio.md +94 -0
  149. package/dist/context/rating-group.md +97 -0
  150. package/dist/context/relative-time.md +90 -0
  151. package/dist/context/resizable.md +102 -0
  152. package/dist/context/scroll-area.md +101 -0
  153. package/dist/context/search.md +113 -0
  154. package/dist/context/section/cta.md +83 -0
  155. package/dist/context/section/feature-grid.md +98 -0
  156. package/dist/context/section/hero.md +101 -0
  157. package/dist/context/section/media-masonry.md +77 -0
  158. package/dist/context/section/page-footer.md +101 -0
  159. package/dist/context/section/stats-band.md +81 -0
  160. package/dist/context/segmented-control.md +101 -0
  161. package/dist/context/select.md +101 -0
  162. package/dist/context/separator.md +88 -0
  163. package/dist/context/sheet.md +100 -0
  164. package/dist/context/shell-header.md +105 -0
  165. package/dist/context/side-nav.md +134 -0
  166. package/dist/context/skeleton.md +101 -0
  167. package/dist/context/skip-nav.md +103 -0
  168. package/dist/context/slider.md +98 -0
  169. package/dist/context/spinner.md +89 -0
  170. package/dist/context/stack.md +96 -0
  171. package/dist/context/stat.md +101 -0
  172. package/dist/context/status.md +105 -0
  173. package/dist/context/steps.md +124 -0
  174. package/dist/context/structured-list.md +107 -0
  175. package/dist/context/swap.md +100 -0
  176. package/dist/context/swipe-item.md +110 -0
  177. package/dist/context/switcher.md +97 -0
  178. package/dist/context/tabs.md +93 -0
  179. package/dist/context/tag.md +110 -0
  180. package/dist/context/tags-input.md +94 -0
  181. package/dist/context/text.md +111 -0
  182. package/dist/context/textarea.md +98 -0
  183. package/dist/context/tile.md +116 -0
  184. package/dist/context/time-picker.md +102 -0
  185. package/dist/context/timeline.md +93 -0
  186. package/dist/context/toast.md +91 -0
  187. package/dist/context/toc.md +110 -0
  188. package/dist/context/toggle-group.md +118 -0
  189. package/dist/context/toggle.md +103 -0
  190. package/dist/context/toggletip.md +119 -0
  191. package/dist/context/tooltip.md +92 -0
  192. package/dist/context/tree-view.md +107 -0
  193. package/dist/context/user.md +100 -0
  194. package/dist/context/visually-hidden.md +90 -0
  195. package/dist/context.json +22456 -0
  196. package/dist/index.d.mts +3 -1
  197. package/dist/index.d.mts.map +1 -1
  198. package/dist/index.mjs +73 -32
  199. package/dist/index.mjs.map +1 -1
  200. package/dist/marketplace.json +70 -0
  201. package/dist/registry.json +2832 -358
  202. package/dist/tokens.catalog.json +2375 -0
  203. package/dist/tokens.variants.json +3291 -0
  204. package/package.json +4 -3
  205. package/readme.body.md +53 -23
@@ -0,0 +1,128 @@
1
+ # FlowEdge
2
+
3
+ **Category:** display
4
+ **Description:** An SVG edge with bezier/straight/smoothstep paths, an arrowhead, an optional label, and animation.
5
+
6
+ ## When to use
7
+
8
+ - Connecting two nodes with a directed path and arrowhead
9
+ - Animating flow direction along a connection ("marching ants")
10
+
11
+ ## When NOT to use
12
+
13
+ - For undirected relationships where an arrowhead would mislead — set markerEnd={false}
14
+
15
+ ## Anti-patterns
16
+
17
+ ### The compositor animates CSS for free; a JS loop re-renders every frame.
18
+
19
+ **Bad:** `A requestAnimationFrame loop to animate the dash`
20
+ **Good:** `A CSS stroke-dashoffset keyframe`
21
+ **Why:** The compositor animates CSS for free; a JS loop re-renders every frame.
22
+
23
+ ## Related components
24
+
25
+ - **FlowNode** (pairs-with): Edges connect nodes.
26
+ - **FlowStory** (pairs-with): Storylines animate edges in sequence.
27
+
28
+ ## Accessibility rationale
29
+
30
+ Decorative SVG (aria-hidden); animation is disabled under prefers-reduced-motion.
31
+
32
+ ## Props
33
+
34
+ | Name | Type | Required | Default | Description |
35
+ | ------------- | ---------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------- |
36
+ | `sourceX` | `number` | Yes | — | Source anchor x (flow coords). |
37
+ | `sourceY` | `number` | Yes | — | Y coordinate of the edge’s source point. |
38
+ | `targetX` | `number` | Yes | — | X coordinate of the edge’s target point. |
39
+ | `targetY` | `number` | Yes | — | Y coordinate of the edge’s target point. |
40
+ | `type` | `'bezier' \| 'straight' \| 'smoothstep'` | No | bezier | Edge path style ('bezier' \| 'straight' \| 'smoothstep'). |
41
+ | `animated` | `boolean` | No | false | When true, animates the edge path (dashed flow). |
42
+ | `label` | `ReactNode` | No | — | Text label for the control. |
43
+ | `selected` | `boolean` | No | false | Whether the edge is rendered as selected. |
44
+ | `markerStart` | `boolean` | No | false | Arrowhead at the source (points back toward the source) — set both for bidirectional. |
45
+ | `markerEnd` | `boolean` | No | true | Arrowhead at the target. Set false for an undirected line. |
46
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
47
+
48
+ ## Tokens
49
+
50
+ - `--cascivo-color-border-strong`
51
+ - `--cascivo-color-accent`
52
+ - `--cascivo-color-surface`
53
+
54
+ ## Examples
55
+
56
+ ### Edge path types
57
+
58
+ Bezier, straight, smoothstep, and an animated edge.
59
+
60
+ ```jsx
61
+ ;() => (
62
+ <div style={{ position: 'relative', height: 220 }}>
63
+ <FlowEdge sourceX={20} sourceY={30} targetX={260} targetY={30} type="bezier" label="bezier" />
64
+ <FlowEdge sourceX={20} sourceY={90} targetX={260} targetY={90} type="smoothstep" label="step" />
65
+ <FlowEdge sourceX={20} sourceY={150} targetX={260} targetY={150} animated label="animated" />
66
+ </div>
67
+ )
68
+ ```
69
+
70
+ ### Arrow direction
71
+
72
+ Forward (default), backward, bidirectional, or undirected — via markerStart/markerEnd.
73
+
74
+ ```jsx
75
+ ;() => (
76
+ <div style={{ position: 'relative', height: 260 }}>
77
+ <FlowEdge sourceX={20} sourceY={30} targetX={260} targetY={30} label="forward" />
78
+ <FlowEdge
79
+ sourceX={20}
80
+ sourceY={90}
81
+ targetX={260}
82
+ targetY={90}
83
+ markerEnd={false}
84
+ markerStart
85
+ label="backward"
86
+ />
87
+ <FlowEdge sourceX={20} sourceY={150} targetX={260} targetY={150} markerStart label="both" />
88
+ <FlowEdge
89
+ sourceX={20}
90
+ sourceY={210}
91
+ targetX={260}
92
+ targetY={210}
93
+ markerEnd={false}
94
+ label="undirected"
95
+ />
96
+ </div>
97
+ )
98
+ ```
99
+
100
+ ## Boundaries
101
+
102
+ | Area | Level | Note |
103
+ | --------- | -------- | --------------------------------- |
104
+ | path | flexible | bezier \| straight \| smoothstep. |
105
+ | animation | flexible | Optional, reduced-motion-safe. |
106
+
107
+ ## AI context prompt
108
+
109
+ Copy this into an LLM context bar before editing this component:
110
+
111
+ ```text
112
+ I am modifying the cascivo FlowEdge component (display). An SVG edge with bezier/straight/smoothstep paths, an arrowhead, an optional label, and animation.
113
+
114
+ Architecture constraints — follow exactly:
115
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
116
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
117
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
118
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
119
+ - CSS logical properties only (RTL-safe).
120
+
121
+ FlowEdge is strictly bound to these tokens — use only these, do not invent token names:
122
+ --cascivo-color-border-strong, --cascivo-color-accent, --cascivo-color-surface
123
+
124
+ Accessibility: role "presentation", WCAG 2.1-AA. Keep it AA.
125
+ Flexible: path, animation.
126
+
127
+ Do not invent props, tokens, or global viewport media queries.
128
+ ```
@@ -0,0 +1,83 @@
1
+ # FlowHandle
2
+
3
+ **Category:** display
4
+ **Description:** A connection port on a node edge — where edges attach and interactive connect starts.
5
+
6
+ ## When to use
7
+
8
+ - Marking where edges connect to a node
9
+ - Enabling interactive connect (drag from a source to a target)
10
+
11
+ ## When NOT to use
12
+
13
+ - On nodes that are never connected
14
+
15
+ ## Related components
16
+
17
+ - **FlowNode** (contained-by): Ports live inside a node.
18
+ - **FlowEdge** (pairs-with): Edges anchor to handles.
19
+
20
+ ## Accessibility rationale
21
+
22
+ Focusable with a ≥44px coarse-pointer hit area around the visible dot.
23
+
24
+ ## Props
25
+
26
+ | Name | Type | Required | Default | Description |
27
+ | --------------- | ---------------------------------------- | -------- | ------- | --------------------------------------------------------------------------- |
28
+ | `type` | `'source' \| 'target'` | Yes | — | Whether the handle is a connection source or target ('source' \| 'target'). |
29
+ | `position` | `'top' \| 'right' \| 'bottom' \| 'left'` | No | — | Edge of the node (defaults: source→right, target→left). |
30
+ | `id` | `string` | No | — | Handle id for multi-handle nodes. |
31
+ | `isConnectable` | `boolean` | No | true | Whether new connections can start or end at this handle. |
32
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
33
+
34
+ ## Tokens
35
+
36
+ - `--cascivo-color-accent`
37
+ - `--cascivo-color-surface`
38
+ - `--cascivo-target-min-coarse`
39
+
40
+ ## Examples
41
+
42
+ ### Source and target ports
43
+
44
+ ```jsx
45
+ ;() => (
46
+ <div style={{ position: 'relative', height: 160 }}>
47
+ <FlowNode id="api" defaultPosition={{ x: 70, y: 55 }}>
48
+ API
49
+ <FlowHandle type="target" position="left" />
50
+ <FlowHandle type="source" position="right" />
51
+ </FlowNode>
52
+ </div>
53
+ )
54
+ ```
55
+
56
+ ## Boundaries
57
+
58
+ | Area | Level | Note |
59
+ | -------- | -------- | ------------------------------- |
60
+ | position | flexible | top \| right \| bottom \| left. |
61
+
62
+ ## AI context prompt
63
+
64
+ Copy this into an LLM context bar before editing this component:
65
+
66
+ ```text
67
+ I am modifying the cascivo FlowHandle component (display). A connection port on a node edge — where edges attach and interactive connect starts.
68
+
69
+ Architecture constraints — follow exactly:
70
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
71
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
72
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
73
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
74
+ - CSS logical properties only (RTL-safe).
75
+
76
+ FlowHandle is strictly bound to these tokens — use only these, do not invent token names:
77
+ --cascivo-color-accent, --cascivo-color-surface, --cascivo-target-min-coarse
78
+
79
+ Accessibility: role "button", WCAG 2.1-AA, keyboard: Tab (focus the port). Keep it AA.
80
+ Flexible: position.
81
+
82
+ Do not invent props, tokens, or global viewport media queries.
83
+ ```
@@ -0,0 +1,89 @@
1
+ # FlowMiniMap
2
+
3
+ **Category:** display
4
+ **Description:** A scaled SVG overview of the graph with a draggable viewport rectangle.
5
+
6
+ ## When to use
7
+
8
+ - Orienting users in a large graph
9
+ - Letting users jump around by dragging the view rect
10
+
11
+ ## When NOT to use
12
+
13
+ - Tiny graphs that fit on screen
14
+
15
+ ## Related components
16
+
17
+ - **FlowControls** (pairs-with): Complementary navigation chrome.
18
+
19
+ ## Accessibility rationale
20
+
21
+ role="img" with an i18n-defaulted label describing the overview.
22
+
23
+ ## Props
24
+
25
+ | Name | Type | Required | Default | Description |
26
+ | ------------------ | -------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------- |
27
+ | `nodes` | `FlowNode[]` | Yes | — | The nodes to render. |
28
+ | `viewport` | `Viewport` | Yes | — | The current pan/zoom viewport to reflect in the minimap. |
29
+ | `containerWidth` | `number` | No | — | Width of the flow container, used to scale the minimap. |
30
+ | `containerHeight` | `number` | No | — | Height of the flow container, used to scale the minimap. |
31
+ | `width` | `number` | No | 200 | Width of the component. |
32
+ | `height` | `number` | No | 150 | Height of the component. |
33
+ | `position` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | No | bottom-right | Position of the component. |
34
+ | `onViewportChange` | `(viewport: Viewport) => void` | No | — | Called with the new viewport when the minimap is dragged. |
35
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
36
+
37
+ ## Tokens
38
+
39
+ - `--cascivo-color-surface`
40
+ - `--cascivo-color-border-strong`
41
+ - `--cascivo-color-accent`
42
+
43
+ ## Examples
44
+
45
+ ### Graph overview
46
+
47
+ ```jsx
48
+ ;() => (
49
+ <FlowMiniMap
50
+ nodes={[
51
+ { id: 'a', position: { x: 0, y: 0 } },
52
+ { id: 'b', position: { x: 220, y: 120 } },
53
+ { id: 'c', position: { x: 440, y: 0 } },
54
+ ]}
55
+ viewport={{ x: 0, y: 0, zoom: 1 }}
56
+ containerWidth={400}
57
+ containerHeight={300}
58
+ />
59
+ )
60
+ ```
61
+
62
+ ## Boundaries
63
+
64
+ | Area | Level | Note |
65
+ | ---- | -------- | -------------------------- |
66
+ | size | flexible | Configurable width/height. |
67
+
68
+ ## AI context prompt
69
+
70
+ Copy this into an LLM context bar before editing this component:
71
+
72
+ ```text
73
+ I am modifying the cascivo FlowMiniMap component (display). A scaled SVG overview of the graph with a draggable viewport rectangle.
74
+
75
+ Architecture constraints — follow exactly:
76
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
77
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
78
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
79
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
80
+ - CSS logical properties only (RTL-safe).
81
+
82
+ FlowMiniMap is strictly bound to these tokens — use only these, do not invent token names:
83
+ --cascivo-color-surface, --cascivo-color-border-strong, --cascivo-color-accent
84
+
85
+ Accessibility: role "img", WCAG 2.1-AA. Keep it AA.
86
+ Flexible: size.
87
+
88
+ Do not invent props, tokens, or global viewport media queries.
89
+ ```
@@ -0,0 +1,97 @@
1
+ # FlowNode
2
+
3
+ **Category:** display
4
+ **Description:** An HTML node box positioned in the viewport pane — draggable, selectable, with arbitrary children.
5
+
6
+ ## When to use
7
+
8
+ - Representing a unit in a graph that holds arbitrary themed content
9
+ - When you hand-compose a flow and need draggable, selectable boxes
10
+
11
+ ## When NOT to use
12
+
13
+ - For the common case — the declarative <Flow> renders nodes for you
14
+
15
+ ## Anti-patterns
16
+
17
+ ### HTML nodes inherit the data-theme scope and can contain any cascivo component.
18
+
19
+ **Bad:** `Rendering node content into an SVG`
20
+ **Good:** `HTML node boxes`
21
+ **Why:** HTML nodes inherit the data-theme scope and can contain any cascivo component.
22
+
23
+ ## Related components
24
+
25
+ - **FlowHandle** (contains): Connection ports live inside a node.
26
+ - **FlowEdge** (pairs-with): Edges route between nodes.
27
+
28
+ ## Accessibility rationale
29
+
30
+ Focusable group; Enter/Space select. Visual states (hover/focus/selected) are CSS.
31
+
32
+ ## Props
33
+
34
+ | Name | Type | Required | Default | Description |
35
+ | ------------------ | -------------------------------- | -------- | ------- | --------------------------------------------------------------------------- |
36
+ | `id` | `string` | Yes | — | Stable node id. |
37
+ | `position` | `{ x: number; y: number }` | No | — | Position in flow coords (controllable). |
38
+ | `onPositionChange` | `(position: XYPosition) => void` | No | — | Fired while dragging. |
39
+ | `zoom` | `number` | No | 1 | Current zoom (drag deltas are divided by it). |
40
+ | `selected` | `boolean` | No | false | Whether the node is rendered as selected. |
41
+ | `draggable` | `boolean` | No | true | Whether the node can be dragged. |
42
+ | `interactive` | `boolean` | No | true | When false, the node is view-only: not draggable, selectable, or focusable. |
43
+ | `onSelect` | `(id: string) => void` | No | — | Called with the selected value. |
44
+ | `children` | `ReactNode` | No | — | Any cascivo content. |
45
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
46
+
47
+ ## Tokens
48
+
49
+ - `--cascivo-color-surface`
50
+ - `--cascivo-color-border`
51
+ - `--cascivo-color-accent`
52
+ - `--cascivo-radius-md`
53
+ - `--cascivo-shadow-sm`
54
+
55
+ ## Examples
56
+
57
+ ### A draggable node
58
+
59
+ ```jsx
60
+ ;() => (
61
+ <div style={{ position: 'relative', height: 160 }}>
62
+ <FlowNode id="a" defaultPosition={{ x: 40, y: 50 }}>
63
+ Service A
64
+ </FlowNode>
65
+ </div>
66
+ )
67
+ ```
68
+
69
+ ## Boundaries
70
+
71
+ | Area | Level | Note |
72
+ | -------- | -------- | ----------------------------------- |
73
+ | content | flexible | Renders any children. |
74
+ | position | flexible | Controllable; draggable toggleable. |
75
+
76
+ ## AI context prompt
77
+
78
+ Copy this into an LLM context bar before editing this component:
79
+
80
+ ```text
81
+ I am modifying the cascivo FlowNode component (display). An HTML node box positioned in the viewport pane — draggable, selectable, with arbitrary children.
82
+
83
+ Architecture constraints — follow exactly:
84
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
85
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
86
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
87
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
88
+ - CSS logical properties only (RTL-safe).
89
+
90
+ FlowNode is strictly bound to these tokens — use only these, do not invent token names:
91
+ --cascivo-color-surface, --cascivo-color-border, --cascivo-color-accent, --cascivo-radius-md, --cascivo-shadow-sm
92
+
93
+ Accessibility: role "group", WCAG 2.1-AA, keyboard: Tab (focus)/Enter/Space (select). Keep it AA.
94
+ Flexible: content, position.
95
+
96
+ Do not invent props, tokens, or global viewport media queries.
97
+ ```
@@ -0,0 +1,75 @@
1
+ # FlowPanel
2
+
3
+ **Category:** display
4
+ **Description:** An absolutely-positioned slot for custom flow-canvas UI (legend, toolbar).
5
+
6
+ ## When to use
7
+
8
+ - Overlaying custom UI (a legend, a toolbar) on a flow canvas
9
+
10
+ ## When NOT to use
11
+
12
+ - For zoom/fit controls — use FlowControls
13
+
14
+ ## Related components
15
+
16
+ - **FlowControls** (alternative): Purpose-built zoom/fit chrome.
17
+
18
+ ## Accessibility rationale
19
+
20
+ A plain positioned container; semantics come from its children.
21
+
22
+ ## Props
23
+
24
+ | Name | Type | Required | Default | Description |
25
+ | ----------- | ------------------------------------------------------------------------------------------------- | -------- | --------- | -------------------------------------------------------- |
26
+ | `position` | `'top-left' \| 'top-center' \| 'top-right' \| 'bottom-left' \| 'bottom-center' \| 'bottom-right'` | No | top-right | Position of the component. |
27
+ | `children` | `ReactNode` | No | — | Content rendered inside the component. |
28
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
29
+
30
+ ## Tokens
31
+
32
+ - `--cascivo-space-3`
33
+
34
+ ## Examples
35
+
36
+ ### A legend panel
37
+
38
+ ```jsx
39
+ ;() => (
40
+ <div
41
+ style={{ position: 'relative', height: 160, border: '1px solid var(--cascivo-color-border)' }}
42
+ >
43
+ <FlowPanel position="top-right">Legend</FlowPanel>
44
+ </div>
45
+ )
46
+ ```
47
+
48
+ ## Boundaries
49
+
50
+ | Area | Level | Note |
51
+ | -------- | -------- | --------------------- |
52
+ | position | flexible | Six anchor positions. |
53
+
54
+ ## AI context prompt
55
+
56
+ Copy this into an LLM context bar before editing this component:
57
+
58
+ ```text
59
+ I am modifying the cascivo FlowPanel component (display). An absolutely-positioned slot for custom flow-canvas UI (legend, toolbar).
60
+
61
+ Architecture constraints — follow exactly:
62
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
63
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
64
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
65
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
66
+ - CSS logical properties only (RTL-safe).
67
+
68
+ FlowPanel is strictly bound to these tokens — use only these, do not invent token names:
69
+ --cascivo-space-3
70
+
71
+ Accessibility: role "group", WCAG 2.1-AA. Keep it AA.
72
+ Flexible: position.
73
+
74
+ Do not invent props, tokens, or global viewport media queries.
75
+ ```
@@ -0,0 +1,145 @@
1
+ # FlowStory
2
+
3
+ **Category:** display
4
+ **Description:** A scripted, sequenced, looping flow animation — walks a graph step by step with fade-in captions.
5
+
6
+ ## When to use
7
+
8
+ - Explaining how a flow works step by step, not just showing a static diagram
9
+ - Onboarding, architecture walkthroughs, and request/response narratives
10
+
11
+ ## When NOT to use
12
+
13
+ - A static or freely-explorable graph — use <Flow>
14
+ - A single always-on animated edge — set animated on a FlowEdge
15
+
16
+ ## Anti-patterns
17
+
18
+ ### CLAUDE.md bans the useEffect-style loop; the signal+timer idiom is deterministic + testable.
19
+
20
+ **Bad:** `A requestAnimationFrame loop to sequence steps`
21
+ **Good:** `A currentStep signal advanced by a timer in useSignalEffect`
22
+ **Why:** CLAUDE.md bans the useEffect-style loop; the signal+timer idiom is deterministic + testable.
23
+
24
+ ## Related components
25
+
26
+ - **Flow** (contains): Renders the graph the storyline animates.
27
+ - **FlowEdge** (pairs-with): Reuses the animated-edge keyframe per step.
28
+
29
+ ## Accessibility rationale
30
+
31
+ The caption is an aria-live region announced each step; play/pause/prev/next make it keyboard-operable; travel motion is disabled under prefers-reduced-motion while captions are preserved.
32
+
33
+ ## Props
34
+
35
+ | Name | Type | Required | Default | Description |
36
+ | -------------- | ------------------------ | -------- | ------- | ------------------------------------------------------------------------------------- |
37
+ | `nodes` | `FlowNode[]` | Yes | — | The nodes to render. |
38
+ | `edges` | `FlowEdge[]` | Yes | — | The edges to render at each step. |
39
+ | `script` | `StoryStep[]` | Yes | — | Ordered steps: { from, to, label? } or { edge, reverse? }. |
40
+ | `loop` | `boolean` | No | true | When true, navigation wraps around from end to start. |
41
+ | `stepDuration` | `number` | No | 1500 | How long (ms) each step is shown during playback. |
42
+ | `stepGap` | `number` | No | 0 | Extra pause after each step before advancing (ms) — makes the story easier to follow. |
43
+ | `playing` | `boolean` | No | — | Whether the story is currently playing (controlled). |
44
+ | `currentStep` | `number` | No | — | The controlled current step index. |
45
+ | `onStepChange` | `(step: number) => void` | No | — | Called with the new step index when it changes. |
46
+ | `controls` | `boolean` | No | true | Whether to show the controls. |
47
+ | `autoPlay` | `boolean` | No | true | When true, starts playback automatically on mount. |
48
+ | `interactive` | `boolean` | No | false | A storyline is a view by default — set true to allow selecting/dragging/connecting. |
49
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
50
+
51
+ ## Tokens
52
+
53
+ - `--cascivo-color-surface`
54
+ - `--cascivo-color-accent`
55
+ - `--cascivo-color-text-muted`
56
+
57
+ ## Examples
58
+
59
+ ### A request/response storyboard
60
+
61
+ A<->B-->C: animate A→B, B→A, A→B, B→C, looping — each step fades in its caption.
62
+
63
+ ```jsx
64
+ ;() => (
65
+ <FlowStory
66
+ style={{ height: 340 }}
67
+ nodes={[
68
+ { id: 'A', position: { x: 0, y: 100 }, data: { label: 'Client' } },
69
+ { id: 'B', position: { x: 240, y: 100 }, data: { label: 'Gateway' } },
70
+ { id: 'C', position: { x: 480, y: 100 }, data: { label: 'Service' } },
71
+ ]}
72
+ edges={[
73
+ { id: 'ab', source: 'A', target: 'B' },
74
+ { id: 'bc', source: 'B', target: 'C' },
75
+ ]}
76
+ script={[
77
+ { from: 'A', to: 'B', label: 'Request sent' },
78
+ { from: 'B', to: 'A', label: 'Acknowledged' },
79
+ { from: 'A', to: 'B', label: 'Payload streamed' },
80
+ { from: 'B', to: 'C', label: 'Forwarded to Service' },
81
+ ]}
82
+ loop
83
+ />
84
+ )
85
+ ```
86
+
87
+ ### A linear pipeline
88
+
89
+ Each stage animates and is captioned in turn.
90
+
91
+ ```jsx
92
+ ;() => (
93
+ <FlowStory
94
+ style={{ height: 320 }}
95
+ nodes={[
96
+ { id: 'ingest', position: { x: 0, y: 100 }, data: { label: 'Ingest' } },
97
+ { id: 'transform', position: { x: 240, y: 100 }, data: { label: 'Transform' } },
98
+ { id: 'load', position: { x: 480, y: 100 }, data: { label: 'Load' } },
99
+ ]}
100
+ edges={[
101
+ { id: 'it', source: 'ingest', target: 'transform' },
102
+ { id: 'tl', source: 'transform', target: 'load' },
103
+ ]}
104
+ script={[
105
+ {
106
+ from: 'ingest',
107
+ to: 'transform',
108
+ label: 'Records ingested',
109
+ description: 'Raw events read from the source',
110
+ },
111
+ { from: 'transform', to: 'load', label: 'Transformed', description: 'Cleaned and enriched' },
112
+ ]}
113
+ />
114
+ )
115
+ ```
116
+
117
+ ## Boundaries
118
+
119
+ | Area | Level | Note |
120
+ | -------- | -------- | ----------------------------------------------------------- |
121
+ | script | flexible | Serializable steps — { from, to } or { edge, reverse }. |
122
+ | playback | flexible | Controllable playing/currentStep; loop + per-step duration. |
123
+
124
+ ## AI context prompt
125
+
126
+ Copy this into an LLM context bar before editing this component:
127
+
128
+ ```text
129
+ I am modifying the cascivo FlowStory component (display). A scripted, sequenced, looping flow animation — walks a graph step by step with fade-in captions.
130
+
131
+ Architecture constraints — follow exactly:
132
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
133
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
134
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
135
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
136
+ - CSS logical properties only (RTL-safe).
137
+
138
+ FlowStory is strictly bound to these tokens — use only these, do not invent token names:
139
+ --cascivo-color-surface, --cascivo-color-accent, --cascivo-color-text-muted
140
+
141
+ Accessibility: role "group", WCAG 2.1-AA, keyboard: Tab (focus controls)/Enter/Space (play/pause, prev, next). Keep it AA.
142
+ Flexible: script, playback.
143
+
144
+ Do not invent props, tokens, or global viewport media queries.
145
+ ```