@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,90 @@
1
+ # RelativeTime
2
+
3
+ **Category:** display
4
+ **Description:** Displays a date as a localized phrase relative to now, auto-updating
5
+
6
+ ## When to use
7
+
8
+ - Showing how long ago something happened in human terms ("3 minutes ago")
9
+ - Timestamps in feeds, comments, and activity logs where recency matters more than precision
10
+ - Anywhere a self-updating relative time is friendlier than an absolute date
11
+
12
+ ## When NOT to use
13
+
14
+ - Precise timestamps in tables or audit logs — use formatDate for an exact, sortable value
15
+ - Dates far in the past/future where "2 years ago" is less useful than the actual date
16
+
17
+ ## Anti-patterns
18
+
19
+ ### Relative phrases lose precision; the exact date belongs in records (RelativeTime still exposes it via title/datetime)
20
+
21
+ **Bad:** `<RelativeTime date={date} /> as the only representation of a legal/audit timestamp`
22
+ **Good:** `<time>{formatDate(date)}</time> for exact records; RelativeTime for casual recency`
23
+ **Why:** Relative phrases lose precision; the exact date belongs in records (RelativeTime still exposes it via title/datetime)
24
+
25
+ ## Related components
26
+
27
+ - **Stat** (pairs-with): Use alongside Stat to timestamp a metric’s last update
28
+
29
+ ## Accessibility rationale
30
+
31
+ Renders a native <time> element with a machine-readable datetime and the absolute date in the title, so the precise instant is available even though the visible text is relative
32
+
33
+ ## Props
34
+
35
+ | Name | Type | Required | Default | Description |
36
+ | -------- | -------------------------------- | -------- | ------- | ------------------------------------------------------- |
37
+ | `date` | `Date \| number \| string` | Yes | — | The date to render relative to now. |
38
+ | `sync` | `boolean` | No | true | When true, updates the relative time as it elapses. |
39
+ | `now` | `number` | No | — | Override "now" (ms); disables the interval |
40
+ | `format` | `Intl.RelativeTimeFormatOptions` | No | — | Intl.RelativeTimeFormat options controlling the output. |
41
+
42
+ ## Examples
43
+
44
+ ### Basic
45
+
46
+ ```jsx
47
+ <RelativeTime date={post.createdAt} />
48
+ ```
49
+
50
+ ### Natural language
51
+
52
+ ```jsx
53
+ <RelativeTime date={date} format={{ numeric: 'auto' }} />
54
+ ```
55
+
56
+ ### Static (no ticking)
57
+
58
+ ```jsx
59
+ <RelativeTime date={date} sync={false} />
60
+ ```
61
+
62
+ ## Boundaries
63
+
64
+ | Area | Level | Note |
65
+ | ------ | -------- | ------------------------------------------------------------------------------- |
66
+ | format | flexible | Pass Intl.RelativeTimeFormat options (e.g. numeric: "auto") to tune the wording |
67
+ | sync | flexible | Disable ticking for static contexts or long-past dates |
68
+
69
+ ## AI context prompt
70
+
71
+ Copy this into an LLM context bar before editing this component:
72
+
73
+ ```text
74
+ I am modifying the cascivo RelativeTime component (display). Displays a date as a localized phrase relative to now, auto-updating
75
+
76
+ Architecture constraints — follow exactly:
77
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
78
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
79
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
80
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
81
+ - CSS logical properties only (RTL-safe).
82
+
83
+ RelativeTime is strictly bound to these tokens — use only these, do not invent token names:
84
+ none declared
85
+
86
+ Accessibility: role "time", WCAG 2.2-AA. Keep it AA.
87
+ Flexible: format, sync.
88
+
89
+ Do not invent props, tokens, or global viewport media queries.
90
+ ```
@@ -0,0 +1,102 @@
1
+ # Resizable
2
+
3
+ **Category:** layout
4
+ **Description:** Two-pane splitter whose divider can be dragged or keyboard-nudged to reallocate space
5
+
6
+ ## When to use
7
+
8
+ - Letting users reallocate space between two adjacent regions, e.g. an editor and a preview
9
+ - Side panels or inspectors whose width the user should control
10
+ - Master/detail layouts where one pane may need more room than the default
11
+
12
+ ## When NOT to use
13
+
14
+ - Fixed layouts where the split should never change — use plain flex/grid
15
+ - More than two siblings need independent resizing — compose nested splitters instead
16
+
17
+ ## Anti-patterns
18
+
19
+ ### A single separator can only mediate one boundary between two panes
20
+
21
+ **Bad:** `<Resizable> wrapping three panes`
22
+ **Good:** `Nest two Resizable splitters so each divider controls exactly one boundary`
23
+ **Why:** A single separator can only mediate one boundary between two panes
24
+
25
+ ## Related components
26
+
27
+ - **Slider** (alternative): Use a slider when picking a value, not when allocating layout space
28
+
29
+ ## Accessibility rationale
30
+
31
+ The divider is a focusable role="separator" with aria-orientation and aria-valuenow/min/max reflecting the percentage split; arrow keys nudge the ratio and Home/End snap to the configured bounds, matching the APG window-splitter pattern.
32
+
33
+ ## Props
34
+
35
+ | Name | Type | Required | Default | Description |
36
+ | --------------- | ---------------------------- | -------- | ---------- | ------------------------------------------------ |
37
+ | `children` | `ReactNode` | Yes | — | Exactly two panes |
38
+ | `orientation` | `'horizontal' \| 'vertical'` | No | horizontal | Layout orientation of the component. |
39
+ | `defaultRatio` | `number` | No | 0.5 | The initial split ratio when uncontrolled. |
40
+ | `ratio` | `number` | No | — | Controlled ratio (0–1) |
41
+ | `minRatio` | `number` | No | 0.1 | Minimum allowed split ratio. |
42
+ | `maxRatio` | `number` | No | 0.9 | Maximum allowed split ratio. |
43
+ | `onRatioChange` | `(ratio: number) => void` | No | — | Called with the new split ratio when it changes. |
44
+
45
+ ## Tokens
46
+
47
+ - `--cascivo-color-border`
48
+ - `--cascivo-color-border-strong`
49
+ - `--cascivo-radius-full`
50
+ - `--cascivo-focus-ring`
51
+
52
+ ## Examples
53
+
54
+ ### Horizontal split
55
+
56
+ ```jsx
57
+ <Resizable>
58
+ <Editor />
59
+ <Preview />
60
+ </Resizable>
61
+ ```
62
+
63
+ ### Vertical with bounds
64
+
65
+ ```jsx
66
+ <Resizable orientation="vertical" defaultRatio={0.3} minRatio={0.2} maxRatio={0.8}>
67
+ <Toolbar />
68
+ <Canvas />
69
+ </Resizable>
70
+ ```
71
+
72
+ ## Boundaries
73
+
74
+ | Area | Level | Note |
75
+ | ------------- | -------- | ---------------------------------------------------------------------------------- |
76
+ | sizing | strict | Pane sizes derive from a single --cascivo-resizable-ratio custom property via flex |
77
+ | min/max ratio | flexible | Consumer-defined clamp range |
78
+
79
+ ## AI context prompt
80
+
81
+ Copy this into an LLM context bar before editing this component:
82
+
83
+ ```text
84
+ I am modifying the cascivo Resizable component (layout). Two-pane splitter whose divider can be dragged or keyboard-nudged to reallocate space
85
+
86
+ Architecture constraints — follow exactly:
87
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
88
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
89
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
90
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
91
+ - CSS logical properties only (RTL-safe).
92
+
93
+ Resizable is strictly bound to these tokens — use only these, do not invent token names:
94
+ --cascivo-color-border, --cascivo-color-border-strong, --cascivo-radius-full, --cascivo-focus-ring
95
+
96
+ Accessibility: role "separator", WCAG 2.2-AA, keyboard: ArrowLeft/ArrowRight/ArrowUp/ArrowDown/Home/End. Keep it AA.
97
+
98
+ Do not change (strict): sizing — Pane sizes derive from a single --cascivo-resizable-ratio custom property via flex
99
+ Flexible: min/max ratio.
100
+
101
+ Do not invent props, tokens, or global viewport media queries.
102
+ ```
@@ -0,0 +1,101 @@
1
+ # ScrollArea
2
+
3
+ **Category:** layout
4
+ **Description:** A scroll container with styled, slim scrollbars and overflow shadows
5
+
6
+ ## When to use
7
+
8
+ - Constraining a region to a fixed height/width with overflow scrolling
9
+ - Giving long lists, tables, or code blocks consistent slim scrollbars across browsers
10
+ - Signalling more content with subtle top/bottom scroll shadows
11
+
12
+ ## When NOT to use
13
+
14
+ - Whole-page scrolling — let the document scroll naturally
15
+ - Content that should determine its own height — do not cap it
16
+
17
+ ## Anti-patterns
18
+
19
+ ### Nested scroll regions trap focus and confuse pointer and keyboard scrolling
20
+
21
+ **Bad:** `Nesting many ScrollAreas so the user faces competing scrollbars`
22
+ **Good:** `Scroll one region; let the rest size to content`
23
+ **Why:** Nested scroll regions trap focus and confuse pointer and keyboard scrolling
24
+
25
+ ## Related components
26
+
27
+ - **Separator** (pairs-with): Often divides items inside a scrolled list
28
+
29
+ ## Accessibility rationale
30
+
31
+ Native overflow keeps the container keyboard-scrollable and focusable per browser defaults; styling never removes the scroll affordance, only restyles it
32
+
33
+ ## Props
34
+
35
+ | Name | Type | Required | Default | Description |
36
+ | ------------- | -------------------------------------- | -------- | -------- | ------------------------------------------------------- |
37
+ | `height` | `string` | No | — | Max block size of the container (any CSS length) |
38
+ | `width` | `string` | No | — | Max inline size of the container (any CSS length) |
39
+ | `orientation` | `'vertical' \| 'horizontal' \| 'both'` | No | vertical | Which axes may scroll |
40
+ | `edges` | `'shadow' \| 'mask' \| 'none'` | No | shadow | Edge affordance: box-shadow, a mask-image fade, or none |
41
+ | `children` | `ReactNode` | No | — | Scrollable content |
42
+
43
+ ## Tokens
44
+
45
+ - `--cascivo-color-border`
46
+ - `--cascivo-color-surface`
47
+ - `--cascivo-color-text`
48
+ - `--cascivo-color-text-subtle`
49
+ - `--cascivo-radius-control`
50
+ - `--cascivo-scroll-area-height`
51
+ - `--cascivo-scroll-area-width`
52
+
53
+ ## Examples
54
+
55
+ ### Vertical scroll
56
+
57
+ ```jsx
58
+ <ScrollArea height="12rem">
59
+ <p>Long content…</p>
60
+ </ScrollArea>
61
+ ```
62
+
63
+ ### Both axes
64
+
65
+ ```jsx
66
+ <ScrollArea height="12rem" width="20rem" orientation="both">
67
+ <table>…</table>
68
+ </ScrollArea>
69
+ ```
70
+
71
+ ## Boundaries
72
+
73
+ | Area | Level | Note |
74
+ | ---------------- | -------- | --------------------------------------------------------------------- |
75
+ | orientation | flexible | vertical, horizontal, or both depending on content |
76
+ | scroll behaviour | strict | Relies on native overflow scrolling — never replace with JS scrolling |
77
+
78
+ ## AI context prompt
79
+
80
+ Copy this into an LLM context bar before editing this component:
81
+
82
+ ```text
83
+ I am modifying the cascivo ScrollArea component (layout). A scroll container with styled, slim scrollbars and overflow shadows
84
+
85
+ Architecture constraints — follow exactly:
86
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
87
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
88
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
89
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
90
+ - CSS logical properties only (RTL-safe).
91
+
92
+ ScrollArea is strictly bound to these tokens — use only these, do not invent token names:
93
+ --cascivo-color-border, --cascivo-color-surface, --cascivo-color-text, --cascivo-color-text-subtle, --cascivo-radius-control, --cascivo-scroll-area-height, --cascivo-scroll-area-width
94
+
95
+ Accessibility: role "none", WCAG 2.2-AA, keyboard: ArrowUp/ArrowDown/PageUp/PageDown/Home/End. Keep it AA.
96
+
97
+ Do not change (strict): scroll behaviour — Relies on native overflow scrolling — never replace with JS scrolling
98
+ Flexible: orientation.
99
+
100
+ Do not invent props, tokens, or global viewport media queries.
101
+ ```
@@ -0,0 +1,113 @@
1
+ # Search
2
+
3
+ **Category:** inputs
4
+ **Description:** Search input with debounced search callback and clear button
5
+
6
+ ## When to use
7
+
8
+ - A query field that filters or searches content, with a built-in clear button and debounced onSearch
9
+ - Free-text search where results update as the user types (debounced) or on Enter
10
+
11
+ ## When NOT to use
12
+
13
+ - General non-search text entry — use Input
14
+ - Search that presents an inline list of suggestions/results to pick from — use Combobox
15
+ - A bounded numeric value — use NumberInput
16
+
17
+ ## Anti-patterns
18
+
19
+ ### Search provides type="search" semantics, a magnifier affordance, a clear button, and built-in debouncing so you avoid firing a query on every keystroke
20
+
21
+ **Bad:** `<Input placeholder="Search" onChange={(e) => runQuery(e.target.value)} />`
22
+ **Good:** `<Search onSearch={(q) => runQuery(q)} debounceMs={300} />`
23
+ **Why:** Search provides type="search" semantics, a magnifier affordance, a clear button, and built-in debouncing so you avoid firing a query on every keystroke
24
+
25
+ ## Related components
26
+
27
+ - **Input** (alternative): Use for general text entry that is not a search query
28
+ - **Combobox** (alternative): Use when the query should surface a selectable list of suggestions
29
+
30
+ ## Accessibility rationale
31
+
32
+ Renders a native <input type="search"> associated with a <label> (defaulting from the i18n catalog) so the field is announced as a searchbox; the clear control is a labeled <button> and moves focus back to the input after clearing.
33
+
34
+ ## Props
35
+
36
+ | Name | Type | Required | Default | Description |
37
+ | -------------- | ------------------------- | -------- | ------------ | ------------------------------------------------------------------ |
38
+ | `value` | `string` | No | — | The controlled value. |
39
+ | `defaultValue` | `string` | No | '' | The initial value when uncontrolled. |
40
+ | `onChange` | `(value: string) => void` | No | — | Called when the value changes. |
41
+ | `onSearch` | `(value: string) => void` | No | — | Called with the query, debounced, as the user types. |
42
+ | `debounceMs` | `number` | No | 300 | Debounce delay (ms) before onSearch fires. |
43
+ | `placeholder` | `string` | No | Search | Placeholder text shown when the field is empty. |
44
+ | `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
45
+ | `label` | `string` | No | Search | Text label for the control. |
46
+ | `disabled` | `boolean` | No | false | When true, disables the control and removes it from the tab order. |
47
+ | `clearLabel` | `string` | No | Clear search | Accessible label for the clear button. |
48
+ | `id` | `string` | No | — | Id applied to the root element (auto-generated when omitted). |
49
+ | `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
50
+
51
+ ## Tokens
52
+
53
+ - `--cascivo-color-surface`
54
+ - `--cascivo-color-border`
55
+ - `--cascivo-color-border-strong`
56
+ - `--cascivo-color-accent`
57
+ - `--cascivo-color-text`
58
+ - `--cascivo-color-text-muted`
59
+ - `--cascivo-color-bg-subtle`
60
+ - `--cascivo-radius-input`
61
+ - `--cascivo-focus-ring`
62
+
63
+ ## Examples
64
+
65
+ ### Basic
66
+
67
+ ```jsx
68
+ <Search onSearch={(q) => runQuery(q)} />
69
+ ```
70
+
71
+ ### Controlled
72
+
73
+ ```jsx
74
+ <Search value={query} onChange={setQuery} onSearch={runQuery} debounceMs={500} />
75
+ ```
76
+
77
+ ### Large
78
+
79
+ ```jsx
80
+ <Search size="lg" placeholder="Search products…" />
81
+ ```
82
+
83
+ ## Boundaries
84
+
85
+ | Area | Level | Note |
86
+ | ----------------- | -------- | ---------------------------------------------------------------------------- |
87
+ | token names | strict | Field and control styling must resolve to the listed --cascivo-\* tokens |
88
+ | debounce and copy | flexible | debounceMs and the placeholder/label/clear copy are free to suit the context |
89
+
90
+ ## AI context prompt
91
+
92
+ Copy this into an LLM context bar before editing this component:
93
+
94
+ ```text
95
+ I am modifying the cascivo Search component (inputs). Search input with debounced search callback and clear button
96
+
97
+ Architecture constraints — follow exactly:
98
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
99
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
100
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
101
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
102
+ - CSS logical properties only (RTL-safe).
103
+
104
+ Search is strictly bound to these tokens — use only these, do not invent token names:
105
+ --cascivo-color-surface, --cascivo-color-border, --cascivo-color-border-strong, --cascivo-color-accent, --cascivo-color-text, --cascivo-color-text-muted, --cascivo-color-bg-subtle, --cascivo-radius-input, --cascivo-focus-ring
106
+
107
+ Accessibility: role "searchbox", WCAG 2.2-AA, keyboard: Enter. Keep it AA.
108
+
109
+ Do not change (strict): token names — Field and control styling must resolve to the listed --cascivo-* tokens
110
+ Flexible: debounce and copy.
111
+
112
+ Do not invent props, tokens, or global viewport media queries.
113
+ ```
@@ -0,0 +1,83 @@
1
+ # Cta
2
+
3
+ **Category:** layout
4
+ **Description:** Call-to-action band — quiet hairline-bordered section with title, description, and centered actions. Replace demo content before shipping.
5
+
6
+ ## When to use
7
+
8
+ - A call-to-action band with title, description, and centered actions
9
+ - Prompting conversion between or after marketing sections
10
+
11
+ ## When NOT to use
12
+
13
+ - The primary page intro — use Hero
14
+ - General content grouping — use Section
15
+
16
+ ## Related components
17
+
18
+ - **Hero** (pairs-with): Hero opens the page; CTA reinforces conversion later
19
+ - **Section** (alternative): Use the plain section for non-CTA content
20
+
21
+ ## Accessibility rationale
22
+
23
+ Renders a section with a heading and clearly labeled action controls.
24
+
25
+ ## Props
26
+
27
+ | Name | Type | Required | Default | Description |
28
+ | -------------- | ------------- | -------- | ------- | ----------------------------------------------- |
29
+ | `title` | `ReactNode` | Yes | — | Primary heading of the CTA band |
30
+ | `description` | `ReactNode` | No | — | Supporting text below the title |
31
+ | `actions` | `ReactNode` | No | — | Buttons or links centered below the description |
32
+ | `headingLevel` | `1 \| 2 \| 3` | No | 2 | HTML heading level for document outline control |
33
+
34
+ ## Tokens
35
+
36
+ - `--cascivo-color-border`
37
+ - `--cascivo-surface-subtle`
38
+ - `--cascivo-text-2xl`
39
+ - `--cascivo-text-base`
40
+ - `--cascivo-font-bold`
41
+ - `--cascivo-text-secondary`
42
+ - `--cascivo-space-*`
43
+
44
+ ## Examples
45
+
46
+ ### CTA band
47
+
48
+ Quiet bordered band with centered heading, description, and action buttons
49
+
50
+ ```jsx
51
+ <Cta
52
+ title="Ready to ship?"
53
+ description="Add Cascade to your project in minutes."
54
+ actions={
55
+ <>
56
+ <Button>Get started</Button>
57
+ <Button variant="ghost">View on GitHub</Button>
58
+ </>
59
+ }
60
+ />
61
+ ```
62
+
63
+ ## AI context prompt
64
+
65
+ Copy this into an LLM context bar before editing this component:
66
+
67
+ ```text
68
+ I am modifying the cascivo Cta component (layout). Call-to-action band — quiet hairline-bordered section with title, description, and centered actions. Replace demo content before shipping.
69
+
70
+ Architecture constraints — follow exactly:
71
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
72
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
73
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
74
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
75
+ - CSS logical properties only (RTL-safe).
76
+
77
+ Cta is strictly bound to these tokens — use only these, do not invent token names:
78
+ --cascivo-color-border, --cascivo-surface-subtle, --cascivo-text-2xl, --cascivo-text-base, --cascivo-font-bold, --cascivo-text-secondary, --cascivo-space-*
79
+
80
+ Accessibility: role "region", WCAG 2.1-AA. Keep it AA.
81
+
82
+ Do not invent props, tokens, or global viewport media queries.
83
+ ```
@@ -0,0 +1,98 @@
1
+ # FeatureGrid
2
+
3
+ **Category:** layout
4
+ **Description:** Feature section — AutoGrid of items with optional title, description, and icon slots. Icons are optional; the grid works text-only. Replace demo content before shipping.
5
+
6
+ ## When to use
7
+
8
+ - A feature section laying out items in an auto-fitting grid
9
+ - Showcasing product capabilities with optional icons and descriptions
10
+
11
+ ## When NOT to use
12
+
13
+ - A single hero message — use Hero
14
+ - A bare responsive grid without section framing — use AutoGrid
15
+
16
+ ## Related components
17
+
18
+ - **AutoGrid** (contains): Uses an auto-fit grid to lay out feature items
19
+ - **Hero** (pairs-with): Often follows the hero on a landing page
20
+
21
+ ## Accessibility rationale
22
+
23
+ Renders a section with an optional heading grouping the feature items.
24
+
25
+ ## Props
26
+
27
+ | Name | Type | Required | Default | Description |
28
+ | -------------- | --------------- | -------- | ------- | ----------------------------------------------------------------------- |
29
+ | `items` | `FeatureItem[]` | Yes | — | Array of feature items with title, optional description, icon, and href |
30
+ | `title` | `ReactNode` | No | — | Section heading above the grid |
31
+ | `description` | `ReactNode` | No | — | Subheading below the section title |
32
+ | `headingLevel` | `1 \| 2 \| 3` | No | 2 | Heading level for the section title (items use headingLevel + 1) |
33
+ | `min` | `string` | No | "16rem" | Minimum track width forwarded to AutoGrid |
34
+
35
+ ## Tokens
36
+
37
+ - `--cascivo-text-2xl`
38
+ - `--cascivo-text-base`
39
+ - `--cascivo-text-sm`
40
+ - `--cascivo-font-bold`
41
+ - `--cascivo-font-semibold`
42
+ - `--cascivo-text-secondary`
43
+ - `--cascivo-color-border`
44
+ - `--cascivo-surface-subtle`
45
+ - `--cascivo-space-*`
46
+
47
+ ## Examples
48
+
49
+ ### Feature grid (text-only)
50
+
51
+ Four-item text-only feature grid with section heading
52
+
53
+ ```jsx
54
+ <FeatureGrid
55
+ title="Built for production"
56
+ description="Everything you need to ship a polished product."
57
+ items={[
58
+ {
59
+ title: 'Zero config',
60
+ description: 'Copy a component and it works — no providers, no wrappers.',
61
+ },
62
+ {
63
+ title: 'Token-first',
64
+ description: 'Every color, size and radius is a CSS custom property you own.',
65
+ },
66
+ {
67
+ title: 'Signal-driven',
68
+ description: 'Fine-grained reactivity with @preact/signals-react — zero re-renders.',
69
+ },
70
+ {
71
+ title: 'Accessible by default',
72
+ description: 'WCAG 2.1 AA, keyboard navigable, logical CSS properties for RTL.',
73
+ },
74
+ ]}
75
+ />
76
+ ```
77
+
78
+ ## AI context prompt
79
+
80
+ Copy this into an LLM context bar before editing this component:
81
+
82
+ ```text
83
+ I am modifying the cascivo FeatureGrid component (layout). Feature section — AutoGrid of items with optional title, description, and icon slots. Icons are optional; the grid works text-only. Replace demo content before shipping.
84
+
85
+ Architecture constraints — follow exactly:
86
+ - Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
87
+ - Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
88
+ - Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
89
+ - Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
90
+ - CSS logical properties only (RTL-safe).
91
+
92
+ FeatureGrid is strictly bound to these tokens — use only these, do not invent token names:
93
+ --cascivo-text-2xl, --cascivo-text-base, --cascivo-text-sm, --cascivo-font-bold, --cascivo-font-semibold, --cascivo-text-secondary, --cascivo-color-border, --cascivo-surface-subtle, --cascivo-space-*
94
+
95
+ Accessibility: role "region", WCAG 2.1-AA. Keep it AA.
96
+
97
+ Do not invent props, tokens, or global viewport media queries.
98
+ ```