@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,71 @@
1
+ # SplitView
2
+
3
+ **Category:** layout
4
+ **Description:** Resizable two-pane split layout with keyboard and pointer drag support.
5
+
6
+ ## When to use
7
+
8
+ - Two side-by-side panes the user can resize via pointer or keyboard
9
+ - Master/detail, editor/preview, or list/content layouts
10
+
11
+ ## When NOT to use
12
+
13
+ - Static two-column content — use Columns
14
+ - A full app frame with persistent navigation — use AppShell or SidebarApp
15
+
16
+ ## Related components
17
+
18
+ - **Columns** (alternative): Use for static, non-resizable two-column content
19
+
20
+ ## Accessibility rationale
21
+
22
+ Exposes a keyboard-operable separator with role="separator" and aria-valuenow for the split ratio.
23
+
24
+ ## Props
25
+
26
+ | Name | Type | Required | Default | Description |
27
+ | -------------- | ----------- | -------- | ------- | ---------------------------- |
28
+ | `start` | `ReactNode` | Yes | — | Left pane content |
29
+ | `end` | `ReactNode` | Yes | — | Right pane content |
30
+ | `defaultRatio` | `number` | No | — | Initial split ratio (0–1) |
31
+ | `min` | `number` | No | — | Minimum ratio for start pane |
32
+ | `max` | `number` | No | — | Maximum ratio for start pane |
33
+ | `aria-label` | `string` | No | — | Label for the separator |
34
+
35
+ ## Tokens
36
+
37
+ - `--cascivo-color-border`
38
+ - `--cascivo-color-accent`
39
+ - `--cascivo-duration-150`
40
+
41
+ ## Examples
42
+
43
+ ### Basic
44
+
45
+ Two-pane split with draggable divider
46
+
47
+ ```jsx
48
+ <SplitView start={<FileTree />} end={<Editor />} />
49
+ ```
50
+
51
+ ## AI context prompt
52
+
53
+ Copy this into an LLM context bar before editing this component:
54
+
55
+ ```text
56
+ I am modifying the cascivo SplitView component (layout). Resizable two-pane split layout with keyboard and pointer drag support.
57
+
58
+ Architecture constraints — follow exactly:
59
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
60
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
61
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
62
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
63
+ - CSS logical properties only (RTL-safe).
64
+
65
+ SplitView is strictly bound to these tokens — use only these, do not invent token names:
66
+ --cascivo-color-border, --cascivo-color-accent, --cascivo-duration-150
67
+
68
+ Accessibility: role "separator", WCAG 2.1-AA, keyboard: ArrowLeft/ArrowRight. Keep it AA.
69
+
70
+ Do not invent props, tokens, or global viewport media queries.
71
+ ```
@@ -0,0 +1,93 @@
1
+ # Stack
2
+
3
+ **Category:** layout
4
+ **Description:** Flex layout primitive for vertical or horizontal stacking with gap control.
5
+
6
+ ## When to use
7
+
8
+ - Arranging children vertically or horizontally with a consistent gap
9
+ - The default primitive for spacing a small set of elements in one direction
10
+
11
+ ## When NOT to use
12
+
13
+ - Two-dimensional layouts — use Grid
14
+ - Responsive auto-wrapping card collections — use AutoGrid
15
+ - A visual card-pile / overlapping avatars — that is the DIFFERENT `Stack` in @cascivo/react (an `offset` prop), not this flex layout primitive.
16
+
17
+ ## Anti-patterns
18
+
19
+ ### The published `Stack` export is a card-pile that overlaps children; this gap-based flex Stack is copy-paste-only despite sharing the name.
20
+
21
+ **Bad:** `Expecting import { Stack } from '@cascivo/react' to gap items`
22
+ **Good:** `Copy this layout Stack in with `npx cascivo add stack`, then import it from your local layouts`
23
+ **Why:** The published `Stack` export is a card-pile that overlaps children; this gap-based flex Stack is copy-paste-only despite sharing the name.
24
+
25
+ ## Related components
26
+
27
+ - **Stack (card-pile)** (alternative): The `@cascivo/react` `Stack` overlaps children with an offset (card-pile) — a different component that shares this name. Pick by behaviour: gap layout here, visual overlap there.
28
+ - **Grid** (alternative): Use for two-dimensional row-and-column layouts
29
+ - **Columns** (alternative): Use for equal-width multi-column content
30
+
31
+ ## Accessibility rationale
32
+
33
+ Pure layout primitive with no semantic role; does not affect the accessibility tree.
34
+
35
+ ## Props
36
+
37
+ | Name | Type | Required | Default | Description |
38
+ | ----------- | ------------------------------------- | -------- | ------- | ------------------ |
39
+ | `direction` | `'vertical' \| 'horizontal'` | No | — | Flex direction |
40
+ | `gap` | `1\|2\|3\|4\|5\|6\|8\|10\|12` | No | — | Spacing token step |
41
+ | `align` | `'start'\|'center'\|'end'\|'stretch'` | No | — | align-items |
42
+ | `justify` | `'start'\|'center'\|'end'\|'between'` | No | — | justify-content |
43
+ | `wrap` | `boolean` | No | — | Allow wrapping |
44
+
45
+ ## Tokens
46
+
47
+ - `--cascivo-space-*`
48
+
49
+ ## Examples
50
+
51
+ ### Vertical
52
+
53
+ Default vertical stack
54
+
55
+ ```jsx
56
+ <Stack gap={4}>
57
+ <div>A</div>
58
+ <div>B</div>
59
+ </Stack>
60
+ ```
61
+
62
+ ### Horizontal
63
+
64
+ Row layout
65
+
66
+ ```jsx
67
+ <Stack direction="horizontal" gap={2}>
68
+ <div>A</div>
69
+ <div>B</div>
70
+ </Stack>
71
+ ```
72
+
73
+ ## AI context prompt
74
+
75
+ Copy this into an LLM context bar before editing this component:
76
+
77
+ ```text
78
+ I am modifying the cascivo Stack component (layout). Flex layout primitive for vertical or horizontal stacking with gap control.
79
+
80
+ Architecture constraints — follow exactly:
81
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
82
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
83
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
84
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
85
+ - CSS logical properties only (RTL-safe).
86
+
87
+ Stack is strictly bound to these tokens — use only these, do not invent token names:
88
+ --cascivo-space-*
89
+
90
+ Accessibility: role "generic", WCAG 2.1-AA. Keep it AA.
91
+
92
+ Do not invent props, tokens, or global viewport media queries.
93
+ ```
@@ -0,0 +1,112 @@
1
+ # Link
2
+
3
+ **Category:** navigation
4
+ **Description:** Styled anchor for navigation, standalone or inline within prose
5
+
6
+ ## When to use
7
+
8
+ - Navigating to another page, view, or resource via a real href
9
+ - Inline cross-references within prose (variant="inline")
10
+ - Linking to an external destination with a clear new-tab indicator (external)
11
+
12
+ ## When NOT to use
13
+
14
+ - Triggering an action or mutation with no destination — use Button
15
+ - Submitting a form — use a submit Button
16
+
17
+ ## Anti-patterns
18
+
19
+ ### Links are for navigation; actions belong to buttons so keyboard and assistive tech behave correctly
20
+
21
+ **Bad:** `<Link onClick={doThing}> with no href`
22
+ **Good:** `<Button onClick={doThing}>`
23
+ **Why:** Links are for navigation; actions belong to buttons so keyboard and assistive tech behave correctly
24
+
25
+ ## Related components
26
+
27
+ - **Button** (alternative): Button is for actions; Link is for navigation
28
+
29
+ ## Accessibility rationale
30
+
31
+ Renders a native <a> so role, Enter activation, and focus come from the platform; external links add rel="noreferrer" and a visual indicator so users know a new tab will open
32
+
33
+ ## Props
34
+
35
+ | Name | Type | Required | Default | Description |
36
+ | ---------- | -------------------------- | -------- | ---------- | ---------------------------------------------------------------------------- |
37
+ | `variant` | `'standalone' \| 'inline'` | No | standalone | Selects the visual style variant. |
38
+ | `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
39
+ | `external` | `boolean` | No | false | When true, treats the link as external (opens in a new tab with rel safety). |
40
+ | `href` | `string` | No | — | The destination URL. |
41
+
42
+ ## Tokens
43
+
44
+ - `--cascivo-color-accent`
45
+ - `--cascivo-color-accent-hover`
46
+ - `--cascivo-color-accent-active`
47
+ - `--cascivo-radius-sm`
48
+ - `--cascivo-focus-ring`
49
+
50
+ ## Examples
51
+
52
+ ### Standalone
53
+
54
+ ```jsx
55
+ <Link href="/docs">View documentation</Link>
56
+ ```
57
+
58
+ ### Inline
59
+
60
+ Inline links inherit the surrounding font size and stay underlined.
61
+
62
+ ```jsx
63
+ <p>
64
+ Read the{' '}
65
+ <Link variant="inline" href="/guide">
66
+ guide
67
+ </Link>{' '}
68
+ first.
69
+ </p>
70
+ ```
71
+
72
+ ### External
73
+
74
+ Opens in a new tab with rel="noreferrer" and a visual indicator.
75
+
76
+ ```jsx
77
+ <Link external href="https://example.com">
78
+ Example
79
+ </Link>
80
+ ```
81
+
82
+ ## Boundaries
83
+
84
+ | Area | Level | Note |
85
+ | ----------- | -------- | ---------------------------------------------------------------- |
86
+ | variant | flexible | standalone vs inline depending on whether the link sits in prose |
87
+ | token names | strict | Accent colors and focus ring must resolve to --cascivo-\* tokens |
88
+
89
+ ## AI context prompt
90
+
91
+ Copy this into an LLM context bar before editing this component:
92
+
93
+ ```text
94
+ I am modifying the cascivo Link component (navigation). Styled anchor for navigation, standalone or inline within prose
95
+
96
+ Architecture constraints — follow exactly:
97
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
98
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
99
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
100
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
101
+ - CSS logical properties only (RTL-safe).
102
+
103
+ Link is strictly bound to these tokens — use only these, do not invent token names:
104
+ --cascivo-color-accent, --cascivo-color-accent-hover, --cascivo-color-accent-active, --cascivo-radius-sm, --cascivo-focus-ring
105
+
106
+ Accessibility: role "link", WCAG 2.2-AA, keyboard: Enter. Keep it AA.
107
+
108
+ Do not change (strict): token names — Accent colors and focus ring must resolve to --cascivo-* tokens
109
+ Flexible: variant.
110
+
111
+ Do not invent props, tokens, or global viewport media queries.
112
+ ```
@@ -0,0 +1,109 @@
1
+ # List
2
+
3
+ **Category:** display
4
+ **Description:** Styled unordered or ordered list with ListItem
5
+
6
+ ## When to use
7
+
8
+ - Presenting a set of related items as a bulleted or numbered list
9
+ - Conveying sequence with an ordered list (as="ol")
10
+ - Keeping list semantics while hiding visual markers (marker="none")
11
+
12
+ ## When NOT to use
13
+
14
+ - Tabular data with multiple columns — use DataTable
15
+ - Interactive navigation items — use SideNav or a menu
16
+
17
+ ## Anti-patterns
18
+
19
+ ### Real list markup lets screen readers announce item count and position
20
+
21
+ **Bad:** `A stack of <Text> rows used as a visual list`
22
+ **Good:** `<List><ListItem>…</ListItem></List>`
23
+ **Why:** Real list markup lets screen readers announce item count and position
24
+
25
+ ## Related components
26
+
27
+ - **Text** (contains): ListItem content is typically body Text
28
+
29
+ ## Accessibility rationale
30
+
31
+ Renders native <ul>/<ol> with <li> children so assistive tech announces the list and its length; marker="none" hides bullets visually without removing list semantics
32
+
33
+ ## Props
34
+
35
+ | Name | Type | Required | Default | Description |
36
+ | -------- | ------------------------------- | -------- | ------------------------------------- | -------------------------------------------------- |
37
+ | `as` | `'ul' \| 'ol'` | No | ul | The HTML element to render as. |
38
+ | `marker` | `'disc' \| 'decimal' \| 'none'` | No | derived from as (ul→disc, ol→decimal) | List marker style ('disc' \| 'decimal' \| 'none'). |
39
+
40
+ ## Tokens
41
+
42
+ - `--cascivo-font-sans`
43
+ - `--cascivo-leading-normal`
44
+ - `--cascivo-color-text`
45
+ - `--cascivo-text-base`
46
+ - `--cascivo-space-1`
47
+ - `--cascivo-space-6`
48
+
49
+ ## Examples
50
+
51
+ ### Unordered
52
+
53
+ ```jsx
54
+ <List>
55
+ <ListItem>Tokens</ListItem>
56
+ <ListItem>Themes</ListItem>
57
+ </List>
58
+ ```
59
+
60
+ ### Ordered
61
+
62
+ ```jsx
63
+ <List as="ol">
64
+ <ListItem>Init</ListItem>
65
+ <ListItem>Add</ListItem>
66
+ </List>
67
+ ```
68
+
69
+ ### Unmarked
70
+
71
+ Keeps list semantics without visual markers
72
+
73
+ ```jsx
74
+ <List marker="none">
75
+ <ListItem>Clean row</ListItem>
76
+ </List>
77
+ ```
78
+
79
+ ## Boundaries
80
+
81
+ | Area | Level | Note |
82
+ | ----------- | -------- | ---------------------------------------------------------- |
83
+ | marker | flexible | disc/decimal/none chosen to match content and visual needs |
84
+ | token names | strict | Spacing and text color must resolve to --cascivo-\* tokens |
85
+
86
+ ## AI context prompt
87
+
88
+ Copy this into an LLM context bar before editing this component:
89
+
90
+ ```text
91
+ I am modifying the cascivo List component (display). Styled unordered or ordered list with ListItem
92
+
93
+ Architecture constraints — follow exactly:
94
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
95
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
96
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
97
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
98
+ - CSS logical properties only (RTL-safe).
99
+
100
+ List is strictly bound to these tokens — use only these, do not invent token names:
101
+ --cascivo-font-sans, --cascivo-leading-normal, --cascivo-color-text, --cascivo-text-base, --cascivo-space-1, --cascivo-space-6
102
+
103
+ Accessibility: role "list", WCAG 2.2-AA. Keep it AA.
104
+
105
+ Do not change (strict): token names — Spacing and text color must resolve to --cascivo-* tokens
106
+ Flexible: marker.
107
+
108
+ Do not invent props, tokens, or global viewport media queries.
109
+ ```
@@ -0,0 +1,124 @@
1
+ # LogViewer
2
+
3
+ **Category:** display
4
+ **Description:** Virtualized monospace console for high-frequency log and stream output
5
+
6
+ ## When to use
7
+
8
+ - Rendering continuous, high-volume log or stream output (build/deploy logs, server output)
9
+ - Showing thousands of lines without mounting a DOM node per line
10
+ - Auto-following live output while letting the user scroll back to inspect history
11
+
12
+ ## When NOT to use
13
+
14
+ - A short, static block of code or output — use a <pre> or Code block
15
+ - Tabular data with columns — use DataTable
16
+ - A rich interactive terminal with cursor addressing — out of scope (line-oriented only)
17
+
18
+ ## Anti-patterns
19
+
20
+ ### The slice pattern reallocates the whole array per line (O(n)) and renders per line; the stream buffer is O(1) and renders once per frame
21
+
22
+ **Bad:** `logsSignal.value = [...logsSignal.value.slice(1), line]`
23
+ **Good:** `const logs = useStreamBuffer({ capacity: 1000 }); logs.append(line)`
24
+ **Why:** The slice pattern reallocates the whole array per line (O(n)) and renders per line; the stream buffer is O(1) and renders once per frame
25
+
26
+ ## Related components
27
+
28
+ - **createStreamBuffer** (pairs-with): Provides the bounded, O(1) signal LogViewer renders
29
+ - **DataTable** (alternative): DataTable virtualizes tabular rows; LogViewer virtualizes monospace lines
30
+
31
+ ## Accessibility rationale
32
+
33
+ The scroll region is role="log" with aria-live="polite" so assistive tech announces new output without stealing focus; the container is keyboard-scrollable and a visually-hidden live status reports the line count; color is paired with level semantics, never the sole encoding
34
+
35
+ ## Props
36
+
37
+ | Name | Type | Required | Default | Description |
38
+ | ---------------- | ---------------------------------------------------------- | -------- | ------- | --------------------------------------------------------------- |
39
+ | `lines` | `ReadonlySignal<readonly LogLine[]> \| readonly LogLine[]` | Yes | — | The log lines to display (a signal or array). |
40
+ | `rowHeight` | `number` | No | 20 | Height of each row in pixels, used for virtualization. |
41
+ | `overscan` | `number` | No | 8 | Number of extra rows rendered above and below the viewport. |
42
+ | `follow` | `boolean` | No | — | Whether the view auto-scrolls to follow new lines (controlled). |
43
+ | `onFollowChange` | `(follow: boolean) => void` | No | — | Called with the new follow state when it changes. |
44
+ | `ansi` | `boolean` | No | false | When true, parses ANSI color escape codes into colored spans. |
45
+ | `search` | `string` | No | — | Query used to filter and highlight matching lines. |
46
+ | `maxHeight` | `string` | No | '24rem' | Maximum height of the scroll viewport (CSS length). |
47
+ | `labels` | `LogViewerLabels` | No | — | Overrides for the component’s user-visible strings (i18n). |
48
+
49
+ ## Tokens
50
+
51
+ - `--cascivo-font-mono`
52
+ - `--cascivo-color-text`
53
+ - `--cascivo-color-text-muted`
54
+ - `--cascivo-color-surface`
55
+ - `--cascivo-color-surface-raised`
56
+ - `--cascivo-color-border`
57
+ - `--cascivo-color-error`
58
+ - `--cascivo-color-warning`
59
+ - `--cascivo-color-success`
60
+ - `--cascivo-color-info`
61
+ - `--cascivo-color-accent`
62
+ - `--cascivo-target-min-coarse`
63
+
64
+ ## Examples
65
+
66
+ ### Streaming build log
67
+
68
+ Backed by createStreamBuffer; auto-follows the tail
69
+
70
+ ```jsx
71
+ const logs = useStreamBuffer<LogLine>({ capacity: 1000 })
72
+ // socket.onmessage = (e) => logs.append({ id: seq++, text: e.data })
73
+ <LogViewer lines={logs.signal} />
74
+ ```
75
+
76
+ ### Static log with levels
77
+
78
+ ```jsx
79
+ <LogViewer
80
+ lines={[
81
+ { id: 1, text: 'Build started', level: 'info' },
82
+ { id: 2, text: 'Type error', level: 'error' },
83
+ ]}
84
+ />
85
+ ```
86
+
87
+ ### ANSI colored output
88
+
89
+ ```jsx
90
+ <LogViewer ansi lines={ansiLines} maxHeight="32rem" />
91
+ ```
92
+
93
+ ## Boundaries
94
+
95
+ | Area | Level | Note |
96
+ | ----------- | -------- | ---------------------------------------------------------------------------------- |
97
+ | data source | flexible | Accepts a live signal or a plain array |
98
+ | rowHeight | strict | Virtualization assumes a fixed row height; variable-height lines are not supported |
99
+ | coloring | flexible | Per-line level or ANSI SGR-16 escapes |
100
+
101
+ ## AI context prompt
102
+
103
+ Copy this into an LLM context bar before editing this component:
104
+
105
+ ```text
106
+ I am modifying the cascivo LogViewer component (display). Virtualized monospace console for high-frequency log and stream output
107
+
108
+ Architecture constraints — follow exactly:
109
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
110
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
111
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
112
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
113
+ - CSS logical properties only (RTL-safe).
114
+
115
+ LogViewer is strictly bound to these tokens — use only these, do not invent token names:
116
+ --cascivo-font-mono, --cascivo-color-text, --cascivo-color-text-muted, --cascivo-color-surface, --cascivo-color-surface-raised, --cascivo-color-border, --cascivo-color-error, --cascivo-color-warning, --cascivo-color-success, --cascivo-color-info, --cascivo-color-accent, --cascivo-target-min-coarse
117
+
118
+ Accessibility: role "log", WCAG 2.2-AA, keyboard: Tab/ArrowUp/ArrowDown/PageUp/PageDown. Keep it AA.
119
+
120
+ Do not change (strict): rowHeight — Virtualization assumes a fixed row height; variable-height lines are not supported
121
+ Flexible: data source, coloring.
122
+
123
+ Do not invent props, tokens, or global viewport media queries.
124
+ ```
@@ -0,0 +1,137 @@
1
+ # MenuButton
2
+
3
+ **Category:** navigation
4
+ **Description:** A button that opens an anchored action menu of one-shot commands
5
+
6
+ ## When to use
7
+
8
+ - Exposing a small set of one-shot actions behind a single labeled button
9
+ - Toolbar or header overflow actions where each item runs a command on activation
10
+ - Action lists that need ArrowUp/ArrowDown roving focus and Enter/Space activation
11
+
12
+ ## When NOT to use
13
+
14
+ - Choosing and persisting a value from options — use Select
15
+ - Right-click contextual actions on a target element — use ContextMenu
16
+ - A single action with no list — use a plain Button
17
+ - Rich interactive content (forms, pickers) rather than a list of commands — use Popover
18
+
19
+ ## Anti-patterns
20
+
21
+ ### role="menuitem" items do not model a selected value and dismiss the menu when activated, so they cannot represent persistent choices
22
+
23
+ **Bad:** `Rendering checkbox or radio state inside MenuButton items and treating selection as a chosen value`
24
+ **Good:** `Use Select or MultiSelect for value selection; MenuButton items are one-shot actions that close the menu on activation`
25
+ **Why:** role="menuitem" items do not model a selected value and dismiss the menu when activated, so they cannot represent persistent choices
26
+
27
+ ### A trigger with no accessible name is unusable for screen-reader and voice-control users
28
+
29
+ **Bad:** `Leaving the trigger label empty with no visible text and no labels.open override`
30
+ **Good:** `Provide visible label text, or pass labels.open / rely on the built-in i18n accessible name`
31
+ **Why:** A trigger with no accessible name is unusable for screen-reader and voice-control users
32
+
33
+ ## Related components
34
+
35
+ - **Menu** (alternative): Use Menu for fully composable trigger + item children; MenuButton is the prop-driven convenience form
36
+ - **ContextMenu** (alternative): Use ContextMenu when actions are triggered by right-click on a target rather than a button
37
+ - **Select** (alternative): Use Select when the user is picking a value instead of firing an action
38
+ - **Button** (contains): The trigger is a styled button that opens the menu
39
+
40
+ ## Accessibility rationale
41
+
42
+ The trigger is a real <button> exposing aria-haspopup="menu", aria-expanded reflecting open state, and aria-controls pointing at the role="menu" panel. ArrowDown/Enter/Space open the menu and move focus to the first enabled item, ArrowUp opens and focuses the last item, ArrowUp/ArrowDown rove focus between items with wrap-around, disabled items are aria-disabled and skipped by roving focus, Escape closes and restores focus to the trigger, and Tab closes without trapping focus. DismissableLayer provides outside-pointer and Escape dismissal, and high-contrast plus reduced-motion preferences are honored in CSS.
43
+
44
+ ## Props
45
+
46
+ | Name | Type | Required | Default | Description |
47
+ | ---------- | ------------------------------------- | -------- | ----------- | ------------------------------------------------------- |
48
+ | `label` | `ReactNode` | Yes | — | Trigger button content |
49
+ | `items` | `MenuButtonItem[]` | Yes | — | Action items: { id, label, onSelect?, disabled? } |
50
+ | `variant` | `'primary' \| 'secondary' \| 'ghost'` | No | 'secondary' | Trigger visual variant |
51
+ | `size` | `'sm' \| 'md' \| 'lg'` | No | 'md' | Trigger size |
52
+ | `disabled` | `boolean` | No | false | Disables the trigger |
53
+ | `align` | `'start' \| 'end'` | No | 'start' | Aligns the menu to the start or end edge of the trigger |
54
+ | `labels` | `{ open?: string }` | No | — | Override the trigger accessible name |
55
+
56
+ ## Tokens
57
+
58
+ - `--cascivo-color-primary`
59
+ - `--cascivo-color-primary-fg`
60
+ - `--cascivo-color-primary-hover`
61
+ - `--cascivo-color-surface`
62
+ - `--cascivo-color-border`
63
+ - `--cascivo-color-text`
64
+ - `--cascivo-color-bg-subtle`
65
+ - `--cascivo-radius-control`
66
+ - `--cascivo-radius-overlay`
67
+ - `--cascivo-radius-item`
68
+ - `--cascivo-shadow-md`
69
+ - `--cascivo-focus-ring`
70
+ - `--cascivo-motion-enter`
71
+ - `--cascivo-z-dropdown`
72
+
73
+ ## Examples
74
+
75
+ ### Basic action menu
76
+
77
+ A secondary button that opens a list of actions
78
+
79
+ ```jsx
80
+ <MenuButton
81
+ label="Actions"
82
+ items={[
83
+ { id: 'edit', label: 'Edit', onSelect: () => edit() },
84
+ { id: 'duplicate', label: 'Duplicate', onSelect: () => duplicate() },
85
+ { id: 'delete', label: 'Delete', onSelect: () => remove(), disabled: !canDelete },
86
+ ]}
87
+ />
88
+ ```
89
+
90
+ ### End-aligned, primary
91
+
92
+ Aligns the menu to the trigger end edge
93
+
94
+ ```jsx
95
+ <MenuButton
96
+ label="Create"
97
+ variant="primary"
98
+ align="end"
99
+ items={[
100
+ { id: 'doc', label: 'New document', onSelect: createDoc },
101
+ { id: 'folder', label: 'New folder', onSelect: createFolder },
102
+ ]}
103
+ />
104
+ ```
105
+
106
+ ## Boundaries
107
+
108
+ | Area | Level | Note |
109
+ | ------------------ | -------- | ------------------------------------------------------------------------ |
110
+ | token names | strict | Trigger and menu styling must resolve to the listed --cascivo-\* tokens |
111
+ | item content | flexible | Each item label accepts arbitrary ReactNode; onSelect defines the action |
112
+ | trigger appearance | flexible | variant and size choose among the standard button looks and dimensions |
113
+
114
+ ## AI context prompt
115
+
116
+ Copy this into an LLM context bar before editing this component:
117
+
118
+ ```text
119
+ I am modifying the cascivo MenuButton component (navigation). A button that opens an anchored action menu of one-shot commands
120
+
121
+ Architecture constraints — follow exactly:
122
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
123
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
124
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
125
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
126
+ - CSS logical properties only (RTL-safe).
127
+
128
+ MenuButton is strictly bound to these tokens — use only these, do not invent token names:
129
+ --cascivo-color-primary, --cascivo-color-primary-fg, --cascivo-color-primary-hover, --cascivo-color-surface, --cascivo-color-border, --cascivo-color-text, --cascivo-color-bg-subtle, --cascivo-radius-control, --cascivo-radius-overlay, --cascivo-radius-item, --cascivo-shadow-md, --cascivo-focus-ring, --cascivo-motion-enter, --cascivo-z-dropdown
130
+
131
+ Accessibility: role "menu", WCAG 2.2-AA, keyboard: ArrowDown/ArrowUp/Enter/Space/Escape/Tab. Keep it AA.
132
+
133
+ Do not change (strict): token names — Trigger and menu styling must resolve to the listed --cascivo-* tokens
134
+ Flexible: item content, trigger appearance.
135
+
136
+ Do not invent props, tokens, or global viewport media queries.
137
+ ```