@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.
- package/LICENSE +1 -1
- package/README.md +53 -23
- package/dist/context/accordion.md +93 -0
- package/dist/context/action-sheet.md +117 -0
- package/dist/context/alert-dialog.md +122 -0
- package/dist/context/alert.md +110 -0
- package/dist/context/app-shell.md +98 -0
- package/dist/context/aspect-ratio.md +92 -0
- package/dist/context/avatar-group.md +111 -0
- package/dist/context/avatar.md +100 -0
- package/dist/context/badge.md +119 -0
- package/dist/context/block/console-app.md +66 -0
- package/dist/context/block/dashboard-charts.md +61 -0
- package/dist/context/block/empty-dashboard.md +60 -0
- package/dist/context/block/login-page.md +60 -0
- package/dist/context/block/notification-center.md +61 -0
- package/dist/context/block/page-with-breadcrumb.md +54 -0
- package/dist/context/block/settings-form-page.md +60 -0
- package/dist/context/block/sidebar-app.md +55 -0
- package/dist/context/block/stats-cards.md +61 -0
- package/dist/context/block/users-table-page.md +61 -0
- package/dist/context/blockquote.md +95 -0
- package/dist/context/bottom-sheet.md +112 -0
- package/dist/context/breadcrumb.md +106 -0
- package/dist/context/button-group.md +100 -0
- package/dist/context/button.md +117 -0
- package/dist/context/calendar.md +118 -0
- package/dist/context/card.md +90 -0
- package/dist/context/carousel.md +101 -0
- package/dist/context/chart/area-chart.md +99 -0
- package/dist/context/chart/bar-chart.md +114 -0
- package/dist/context/chart/boxplot.md +82 -0
- package/dist/context/chart/bubble-chart.md +80 -0
- package/dist/context/chart/bullet.md +75 -0
- package/dist/context/chart/calendar.md +79 -0
- package/dist/context/chart/candlestick.md +104 -0
- package/dist/context/chart/combo-chart.md +78 -0
- package/dist/context/chart/funnel.md +87 -0
- package/dist/context/chart/gauge.md +87 -0
- package/dist/context/chart/heatmap.md +77 -0
- package/dist/context/chart/histogram.md +74 -0
- package/dist/context/chart/kpi.md +70 -0
- package/dist/context/chart/line-chart.md +113 -0
- package/dist/context/chart/meter.md +71 -0
- package/dist/context/chart/pie-chart.md +126 -0
- package/dist/context/chart/polar.md +92 -0
- package/dist/context/chart/radar.md +81 -0
- package/dist/context/chart/radial-bar.md +96 -0
- package/dist/context/chart/sankey.md +89 -0
- package/dist/context/chart/scatter-chart.md +90 -0
- package/dist/context/chart/sparkline.md +69 -0
- package/dist/context/chart/stream.md +88 -0
- package/dist/context/chart/sunburst.md +93 -0
- package/dist/context/chart/treemap.md +84 -0
- package/dist/context/chat-bubble.md +116 -0
- package/dist/context/checkbox-card.md +104 -0
- package/dist/context/checkbox.md +104 -0
- package/dist/context/code-snippet.md +118 -0
- package/dist/context/code.md +103 -0
- package/dist/context/collapsible.md +104 -0
- package/dist/context/color-picker.md +101 -0
- package/dist/context/combobox.md +125 -0
- package/dist/context/command-menu.md +121 -0
- package/dist/context/comparison.md +117 -0
- package/dist/context/contained-list.md +103 -0
- package/dist/context/context-menu.md +103 -0
- package/dist/context/copy-button.md +106 -0
- package/dist/context/data-list.md +99 -0
- package/dist/context/data-table.md +149 -0
- package/dist/context/date-picker.md +116 -0
- package/dist/context/date-range-picker.md +113 -0
- package/dist/context/dock.md +117 -0
- package/dist/context/drawer.md +111 -0
- package/dist/context/dropdown.md +96 -0
- package/dist/context/editable.md +101 -0
- package/dist/context/editor/code-editor.md +146 -0
- package/dist/context/editor/highlight.md +74 -0
- package/dist/context/empty-state.md +101 -0
- package/dist/context/fab.md +128 -0
- package/dist/context/field.md +118 -0
- package/dist/context/file-uploader.md +121 -0
- package/dist/context/filter.md +129 -0
- package/dist/context/flow/flow-background.md +103 -0
- package/dist/context/flow/flow-canvas.md +82 -0
- package/dist/context/flow/flow-controls.md +84 -0
- package/dist/context/flow/flow-edge.md +128 -0
- package/dist/context/flow/flow-handle.md +83 -0
- package/dist/context/flow/flow-minimap.md +89 -0
- package/dist/context/flow/flow-node.md +97 -0
- package/dist/context/flow/flow-panel.md +75 -0
- package/dist/context/flow/flow-story.md +145 -0
- package/dist/context/flow/flow.md +139 -0
- package/dist/context/form.md +104 -0
- package/dist/context/header-panel.md +96 -0
- package/dist/context/header.md +104 -0
- package/dist/context/heading.md +107 -0
- package/dist/context/hover-card.md +108 -0
- package/dist/context/icon-button.md +115 -0
- package/dist/context/image.md +115 -0
- package/dist/context/indicator.md +95 -0
- package/dist/context/inline-loading.md +101 -0
- package/dist/context/input-group.md +122 -0
- package/dist/context/input.md +101 -0
- package/dist/context/item.md +109 -0
- package/dist/context/join.md +97 -0
- package/dist/context/kbd.md +100 -0
- package/dist/context/label.md +117 -0
- package/dist/context/layout/app-shell.md +85 -0
- package/dist/context/layout/auth-layout.md +74 -0
- package/dist/context/layout/auto-grid.md +69 -0
- package/dist/context/layout/center.md +67 -0
- package/dist/context/layout/columns.md +70 -0
- package/dist/context/layout/dashboard-layout.md +68 -0
- package/dist/context/layout/grid.md +70 -0
- package/dist/context/layout/masonry.md +70 -0
- package/dist/context/layout/page-header.md +75 -0
- package/dist/context/layout/section.md +69 -0
- package/dist/context/layout/settings-layout.md +68 -0
- package/dist/context/layout/spacer.md +64 -0
- package/dist/context/layout/split-view.md +71 -0
- package/dist/context/layout/stack.md +93 -0
- package/dist/context/link.md +112 -0
- package/dist/context/list.md +109 -0
- package/dist/context/log-viewer.md +124 -0
- package/dist/context/menu-button.md +137 -0
- package/dist/context/menu.md +108 -0
- package/dist/context/menubar.md +92 -0
- package/dist/context/modal.md +96 -0
- package/dist/context/multi-select.md +104 -0
- package/dist/context/native-select.md +118 -0
- package/dist/context/navigation-menu.md +95 -0
- package/dist/context/notification.md +116 -0
- package/dist/context/number-input.md +117 -0
- package/dist/context/otp-input.md +98 -0
- package/dist/context/overflow-menu.md +107 -0
- package/dist/context/pagination.md +123 -0
- package/dist/context/password-input.md +100 -0
- package/dist/context/popover.md +108 -0
- package/dist/context/progress-bar.md +107 -0
- package/dist/context/progress-circle.md +101 -0
- package/dist/context/progress-indicator.md +105 -0
- package/dist/context/progress.md +109 -0
- package/dist/context/prose.md +110 -0
- package/dist/context/pull-to-refresh.md +101 -0
- package/dist/context/qr-code.md +101 -0
- package/dist/context/radial-progress.md +117 -0
- package/dist/context/radio-card.md +95 -0
- package/dist/context/radio.md +94 -0
- package/dist/context/rating-group.md +97 -0
- package/dist/context/relative-time.md +90 -0
- package/dist/context/resizable.md +102 -0
- package/dist/context/scroll-area.md +101 -0
- package/dist/context/search.md +113 -0
- package/dist/context/section/cta.md +83 -0
- package/dist/context/section/feature-grid.md +98 -0
- package/dist/context/section/hero.md +101 -0
- package/dist/context/section/media-masonry.md +77 -0
- package/dist/context/section/page-footer.md +101 -0
- package/dist/context/section/stats-band.md +81 -0
- package/dist/context/segmented-control.md +101 -0
- package/dist/context/select.md +101 -0
- package/dist/context/separator.md +88 -0
- package/dist/context/sheet.md +100 -0
- package/dist/context/shell-header.md +105 -0
- package/dist/context/side-nav.md +134 -0
- package/dist/context/skeleton.md +101 -0
- package/dist/context/skip-nav.md +103 -0
- package/dist/context/slider.md +98 -0
- package/dist/context/spinner.md +89 -0
- package/dist/context/stack.md +96 -0
- package/dist/context/stat.md +101 -0
- package/dist/context/status.md +105 -0
- package/dist/context/steps.md +124 -0
- package/dist/context/structured-list.md +107 -0
- package/dist/context/swap.md +100 -0
- package/dist/context/swipe-item.md +110 -0
- package/dist/context/switcher.md +97 -0
- package/dist/context/tabs.md +93 -0
- package/dist/context/tag.md +110 -0
- package/dist/context/tags-input.md +94 -0
- package/dist/context/text.md +111 -0
- package/dist/context/textarea.md +98 -0
- package/dist/context/tile.md +116 -0
- package/dist/context/time-picker.md +102 -0
- package/dist/context/timeline.md +93 -0
- package/dist/context/toast.md +91 -0
- package/dist/context/toc.md +110 -0
- package/dist/context/toggle-group.md +118 -0
- package/dist/context/toggle.md +103 -0
- package/dist/context/toggletip.md +119 -0
- package/dist/context/tooltip.md +92 -0
- package/dist/context/tree-view.md +107 -0
- package/dist/context/user.md +100 -0
- package/dist/context/visually-hidden.md +90 -0
- package/dist/context.json +22456 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +73 -32
- package/dist/index.mjs.map +1 -1
- package/dist/marketplace.json +70 -0
- package/dist/registry.json +2832 -358
- package/dist/tokens.catalog.json +2375 -0
- package/dist/tokens.variants.json +3291 -0
- package/package.json +4 -3
- package/readme.body.md +53 -23
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
|
|
3
|
+
**Category:** navigation
|
|
4
|
+
**Description:** Shows the current page location within a navigation hierarchy
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing the user where the current page sits in a navigation hierarchy
|
|
9
|
+
- Providing one-click navigation back to ancestor pages
|
|
10
|
+
- Collapsing deep trails to keep the trail compact (maxVisible)
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Paging through data records — use Pagination
|
|
15
|
+
- Switching between sibling views — use Tabs
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Breadcrumb models hierarchy depth, not sequential position in a list
|
|
20
|
+
|
|
21
|
+
**Bad:** `Using Breadcrumb to step through pages 1, 2, 3 of a dataset`
|
|
22
|
+
**Good:** `<Pagination> for paged data`
|
|
23
|
+
**Why:** Breadcrumb models hierarchy depth, not sequential position in a list
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Pagination** (alternative): Pagination moves through data pages; Breadcrumb moves up a hierarchy
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Wrapped in <nav> with an aria-label and the current page marked aria-current="page"; ancestor entries are real links so keyboard users can jump up the hierarchy
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| ------------ | ------------------------------------ | -------- | ---------- | --------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `items` | `{ label: string; href?: string }[]` | Yes | — | The items to render. |
|
|
38
|
+
| `maxVisible` | `number` | No | — | When items exceed this count, collapse to the first item, an ellipsis, and the trailing items |
|
|
39
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
40
|
+
| `ariaLabel` | `string` | No | Breadcrumb | Accessible label for the component. |
|
|
41
|
+
|
|
42
|
+
## Tokens
|
|
43
|
+
|
|
44
|
+
- `--cascivo-color-text`
|
|
45
|
+
- `--cascivo-color-text-muted`
|
|
46
|
+
- `--cascivo-color-text-subtle`
|
|
47
|
+
- `--cascivo-radius-sm`
|
|
48
|
+
- `--cascivo-focus-ring`
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
### Basic
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
<Breadcrumb
|
|
56
|
+
items={[{ label: 'Home', href: '/' }, { label: 'Docs', href: '/docs' }, { label: 'Breadcrumb' }]}
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Collapsed
|
|
61
|
+
|
|
62
|
+
Long trails collapse to the first item, an ellipsis, and the trailing items.
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
<Breadcrumb
|
|
66
|
+
maxVisible={3}
|
|
67
|
+
items={[
|
|
68
|
+
{ label: 'Home', href: '/' },
|
|
69
|
+
{ label: 'Docs', href: '/docs' },
|
|
70
|
+
{ label: 'Components', href: '/docs/components' },
|
|
71
|
+
{ label: 'Breadcrumb' },
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Boundaries
|
|
77
|
+
|
|
78
|
+
| Area | Level | Note |
|
|
79
|
+
| ----------- | -------- | -------------------------------------------------------------- |
|
|
80
|
+
| maxVisible | flexible | Collapse long trails to fit available width |
|
|
81
|
+
| token names | strict | Text colors and focus ring must resolve to --cascivo-\* tokens |
|
|
82
|
+
|
|
83
|
+
## AI context prompt
|
|
84
|
+
|
|
85
|
+
Copy this into an LLM context bar before editing this component:
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
I am modifying the cascivo Breadcrumb component (navigation). Shows the current page location within a navigation hierarchy
|
|
89
|
+
|
|
90
|
+
Architecture constraints — follow exactly:
|
|
91
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
92
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
93
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
94
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
95
|
+
- CSS logical properties only (RTL-safe).
|
|
96
|
+
|
|
97
|
+
Breadcrumb is strictly bound to these tokens — use only these, do not invent token names:
|
|
98
|
+
--cascivo-color-text, --cascivo-color-text-muted, --cascivo-color-text-subtle, --cascivo-radius-sm, --cascivo-focus-ring
|
|
99
|
+
|
|
100
|
+
Accessibility: role "navigation", WCAG 2.2-AA, keyboard: Tab/Enter. Keep it AA.
|
|
101
|
+
|
|
102
|
+
Do not change (strict): token names — Text colors and focus ring must resolve to --cascivo-* tokens
|
|
103
|
+
Flexible: maxVisible.
|
|
104
|
+
|
|
105
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
106
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# ButtonGroup
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Description:** Visually joins a set of related buttons into a single segmented control
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Presenting several related, independent actions that read as one control (e.g. an editor toolbar)
|
|
9
|
+
- Visually grouping buttons that share context without implying mutual exclusivity
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- The buttons represent a single selected value among options — use ToggleGroup
|
|
14
|
+
- The actions are unrelated and should read as separate buttons — lay them out with spacing instead
|
|
15
|
+
|
|
16
|
+
## Anti-patterns
|
|
17
|
+
|
|
18
|
+
### A group with no accessible name is announced as an unlabeled region; supply aria-label or aria-labelledby
|
|
19
|
+
|
|
20
|
+
**Bad:** `<ButtonGroup><Button>Bold</Button><Button>Italic</Button></ButtonGroup>`
|
|
21
|
+
**Good:** `<ButtonGroup aria-label="Formatting"><Button>Bold</Button><Button>Italic</Button></ButtonGroup>`
|
|
22
|
+
**Why:** A group with no accessible name is announced as an unlabeled region; supply aria-label or aria-labelledby
|
|
23
|
+
|
|
24
|
+
## Related components
|
|
25
|
+
|
|
26
|
+
- **ToggleGroup** (alternative): Use when the buttons select a value rather than fire independent actions
|
|
27
|
+
- **Button** (contains): A button group is a layout container for buttons
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Exposes role="group" so assistive tech treats the buttons as one labeled set; optional roving focus lets arrow keys traverse the buttons as a single tab stop, matching toolbar expectations
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| ----------------- | ---------------------------- | -------- | ---------- | ------------------------------------------------------------------------- |
|
|
37
|
+
| `orientation` | `'horizontal' \| 'vertical'` | No | horizontal | Layout orientation of the component. |
|
|
38
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
39
|
+
| `roving` | `boolean` | No | false | When true, uses roving tabindex so arrow keys move focus between buttons. |
|
|
40
|
+
| `loop` | `boolean` | No | false | When true, navigation wraps around from end to start. |
|
|
41
|
+
| `aria-label` | `string` | No | — | Accessible label used when no visible label is present. |
|
|
42
|
+
| `aria-labelledby` | `string` | No | — | Id of the element that labels this component. |
|
|
43
|
+
|
|
44
|
+
## Tokens
|
|
45
|
+
|
|
46
|
+
- `--cascivo-button-radius`
|
|
47
|
+
- `--cascivo-radius-control`
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### Joined actions
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
<ButtonGroup aria-label="Text alignment">
|
|
55
|
+
<Button>Left</Button>
|
|
56
|
+
<Button>Center</Button>
|
|
57
|
+
<Button>Right</Button>
|
|
58
|
+
</ButtonGroup>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Vertical with roving focus
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
<ButtonGroup orientation="vertical" roving aria-label="View">
|
|
65
|
+
<Button>List</Button>
|
|
66
|
+
<Button>Grid</Button>
|
|
67
|
+
</ButtonGroup>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Boundaries
|
|
71
|
+
|
|
72
|
+
| Area | Level | Note |
|
|
73
|
+
| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
74
|
+
| token names | strict | Outer corner radius must resolve to --cascivo-button-radius / --cascivo-radius-control to match standalone buttons |
|
|
75
|
+
| children | flexible | Any focusable controls (Button, IconButton, links) may be grouped |
|
|
76
|
+
|
|
77
|
+
## AI context prompt
|
|
78
|
+
|
|
79
|
+
Copy this into an LLM context bar before editing this component:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
I am modifying the cascivo ButtonGroup component (inputs). Visually joins a set of related buttons into a single segmented control
|
|
83
|
+
|
|
84
|
+
Architecture constraints — follow exactly:
|
|
85
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
86
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
87
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
88
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
89
|
+
- CSS logical properties only (RTL-safe).
|
|
90
|
+
|
|
91
|
+
ButtonGroup is strictly bound to these tokens — use only these, do not invent token names:
|
|
92
|
+
--cascivo-button-radius, --cascivo-radius-control
|
|
93
|
+
|
|
94
|
+
Accessibility: role "group", WCAG 2.2-AA, keyboard: ArrowRight/ArrowLeft/ArrowUp/ArrowDown/Home/End. Keep it AA.
|
|
95
|
+
|
|
96
|
+
Do not change (strict): token names — Outer corner radius must resolve to --cascivo-button-radius / --cascivo-radius-control to match standalone buttons
|
|
97
|
+
Flexible: children.
|
|
98
|
+
|
|
99
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
100
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Description:** Triggers an action or event
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Triggering an action or navigation the user initiates by click/press
|
|
9
|
+
- Submitting a form or confirming a decision
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Navigation between pages where a real link is semantically correct — use an anchor
|
|
14
|
+
- Toggling a binary setting — use Toggle; persistent selection — use Checkbox/Radio
|
|
15
|
+
|
|
16
|
+
## Anti-patterns
|
|
17
|
+
|
|
18
|
+
### Buttons are for actions, links for navigation — assistive tech and the browser treat them differently
|
|
19
|
+
|
|
20
|
+
**Bad:** `<Button onClick={() => navigate("/x")}>Home</Button>`
|
|
21
|
+
**Good:** `<a href="/x">Home</a>`
|
|
22
|
+
**Why:** Buttons are for actions, links for navigation — assistive tech and the browser treat them differently
|
|
23
|
+
|
|
24
|
+
## Related components
|
|
25
|
+
|
|
26
|
+
- **Toggle** (alternative): Use for binary on/off state, not one-shot actions
|
|
27
|
+
- **Dropdown** (pairs-with): A button often triggers a menu
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Renders a native <button> so Enter/Space activation, focus, and role come from the platform; loading state uses aria-busy rather than removing the element so focus is preserved
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| ---------- | ------------------------------------------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'destructive'` | No | primary | Selects the visual style variant. |
|
|
38
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
39
|
+
| `loading` | `boolean` | No | false | When true, shows a loading state. |
|
|
40
|
+
| `disabled` | `boolean` | No | false | When true, disables the control and removes it from the tab order. |
|
|
41
|
+
| `asChild` | `boolean` | No | false | When true, renders the child element as the root via Slot, merging props (polymorphic rendering). |
|
|
42
|
+
| `onClick` | `React.MouseEventHandler<HTMLButtonElement>` | No | — | Called when the element is clicked. |
|
|
43
|
+
|
|
44
|
+
## Tokens
|
|
45
|
+
|
|
46
|
+
- `--cascivo-color-accent`
|
|
47
|
+
- `--cascivo-color-accent-hover`
|
|
48
|
+
- `--cascivo-color-accent-active`
|
|
49
|
+
- `--cascivo-color-text-on-accent`
|
|
50
|
+
- `--cascivo-color-destructive`
|
|
51
|
+
- `--cascivo-radius-button`
|
|
52
|
+
- `--cascivo-focus-ring`
|
|
53
|
+
- `--cascivo-disabled-opacity`
|
|
54
|
+
- `--cascivo-text-ui`
|
|
55
|
+
- `--cascivo-text-body`
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
### Primary
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<Button>Click me</Button>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Loading
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<Button loading>Saving…</Button>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Destructive
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
<Button variant="destructive">Delete</Button>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### As link
|
|
78
|
+
|
|
79
|
+
Render button styling on a real anchor (keeps middle-click / open-in-new-tab).
|
|
80
|
+
|
|
81
|
+
```jsx
|
|
82
|
+
<Button asChild>
|
|
83
|
+
<a href="/pricing">View pricing</a>
|
|
84
|
+
</Button>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Boundaries
|
|
88
|
+
|
|
89
|
+
| Area | Level | Note |
|
|
90
|
+
| ----------- | -------- | ------------------------------------------------------------------ |
|
|
91
|
+
| token names | strict | Visual props must resolve to --cascivo-button-\* / semantic tokens |
|
|
92
|
+
| label copy | flexible | Free, within tone guidance |
|
|
93
|
+
|
|
94
|
+
## AI context prompt
|
|
95
|
+
|
|
96
|
+
Copy this into an LLM context bar before editing this component:
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
I am modifying the cascivo Button component (inputs). Triggers an action or event
|
|
100
|
+
|
|
101
|
+
Architecture constraints — follow exactly:
|
|
102
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
103
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
104
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
105
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
106
|
+
- CSS logical properties only (RTL-safe).
|
|
107
|
+
|
|
108
|
+
Button is strictly bound to these tokens — use only these, do not invent token names:
|
|
109
|
+
--cascivo-color-accent, --cascivo-color-accent-hover, --cascivo-color-accent-active, --cascivo-color-text-on-accent, --cascivo-color-destructive, --cascivo-radius-button, --cascivo-focus-ring, --cascivo-disabled-opacity, --cascivo-text-ui, --cascivo-text-body
|
|
110
|
+
|
|
111
|
+
Accessibility: role "button", WCAG 2.2-AA, keyboard: Enter/Space. Keep it AA.
|
|
112
|
+
|
|
113
|
+
Do not change (strict): token names — Visual props must resolve to --cascivo-button-* / semantic tokens
|
|
114
|
+
Flexible: label copy.
|
|
115
|
+
|
|
116
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
117
|
+
```
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Calendar
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Description:** An accessible standalone month-grid date picker.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing an always-visible month grid for picking a single date (inline, not a popover)
|
|
9
|
+
- As the building block inside a date-picker or date-range-picker popover
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- A compact form field where an inline grid wastes space — use DatePicker (trigger + popover)
|
|
14
|
+
- Selecting a contiguous date range — use DateRangePicker, which composes two calendars
|
|
15
|
+
|
|
16
|
+
## Anti-patterns
|
|
17
|
+
|
|
18
|
+
### Local-time construction can land a midnight date on the previous day in negative-offset zones, breaking selection and range math
|
|
19
|
+
|
|
20
|
+
**Bad:** `Comparing dates with local-time getters (getHours/getDate) after constructing them with new Date(y, m, d)`
|
|
21
|
+
**Good:** `All arithmetic and comparisons use UTC getters/Date.UTC so DST and timezone offsets never shift a day`
|
|
22
|
+
**Why:** Local-time construction can land a midnight date on the previous day in negative-offset zones, breaking selection and range math
|
|
23
|
+
|
|
24
|
+
## Related components
|
|
25
|
+
|
|
26
|
+
- **DatePicker** (alternative): Use the popover-based picker when an inline grid is too heavy for the layout
|
|
27
|
+
- **DateRangePicker** (contained-by): The range picker renders two Calendar instances side-by-side
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Renders an APG-compliant role="grid" table with role="row"/role="gridcell"; a roving tabindex keeps exactly one day focusable (the focused date) so arrow keys move focus per APG, Home/End jump to the week edges, PageUp/PageDown change month (with Shift for year), today exposes aria-current="date", selection sets data-selected with aria-selected on the cell, and out-of-range or predicate-disabled days get aria-disabled and are skipped by selection
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| --------------- | ------------------------------------------------- | -------- | ------- | -------------------------------------------------------- |
|
|
37
|
+
| `value` | `Date \| null` | No | — | Controlled selected date |
|
|
38
|
+
| `defaultValue` | `Date` | No | — | Uncontrolled initial selected date |
|
|
39
|
+
| `onValueChange` | `(date: Date) => void` | No | — | Called when a day is selected |
|
|
40
|
+
| `min` | `Date` | No | — | Earliest selectable date |
|
|
41
|
+
| `max` | `Date` | No | — | Latest selectable date |
|
|
42
|
+
| `disabled` | `(date: Date) => boolean` | No | — | Predicate to disable individual days |
|
|
43
|
+
| `locale` | `string` | No | — | BCP-47 locale; defaults to the current i18n locale |
|
|
44
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | — | Grid cell size |
|
|
45
|
+
| `labels` | `CalendarLabels` | No | — | i18n label overrides for the nav buttons |
|
|
46
|
+
| `month` | `number` | No | — | Controlled view month (0-11) |
|
|
47
|
+
| `year` | `number` | No | — | Controlled view year |
|
|
48
|
+
| `onViewChange` | `(view: { month: number; year: number }) => void` | No | — | Called when the visible month changes |
|
|
49
|
+
| `hideNav` | `boolean` | No | — | Hides the prev/next nav so a parent can drive navigation |
|
|
50
|
+
|
|
51
|
+
## Tokens
|
|
52
|
+
|
|
53
|
+
- `--cascivo-calendar-bg`
|
|
54
|
+
- `--cascivo-calendar-radius`
|
|
55
|
+
- `--cascivo-calendar-cell-size`
|
|
56
|
+
- `--cascivo-calendar-day-selected-bg`
|
|
57
|
+
- `--cascivo-calendar-day-selected-fg`
|
|
58
|
+
- `--cascivo-calendar-day-today-color`
|
|
59
|
+
- `--cascivo-calendar-range-bg`
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Basic
|
|
64
|
+
|
|
65
|
+
Uncontrolled calendar
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<Calendar defaultValue={new Date(Date.UTC(2024, 5, 15))} />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Constrained
|
|
72
|
+
|
|
73
|
+
Limits the selectable range
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
<Calendar min={new Date(Date.UTC(2024, 5, 1))} max={new Date(Date.UTC(2024, 5, 30))} />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Disabled weekends
|
|
80
|
+
|
|
81
|
+
Predicate disables individual days
|
|
82
|
+
|
|
83
|
+
```jsx
|
|
84
|
+
<Calendar disabled={(d) => [0, 6].includes(d.getUTCDay())} />
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Boundaries
|
|
88
|
+
|
|
89
|
+
| Area | Level | Note |
|
|
90
|
+
| ------------ | -------- | --------------------------------------------------------------------------------------------------------- |
|
|
91
|
+
| date type | strict | All date props are native Date objects compared in UTC |
|
|
92
|
+
| locale | flexible | Weekday labels, month label, and first-day-of-week derive from the locale via Intl (with Monday fallback) |
|
|
93
|
+
| view control | flexible | month/year/onViewChange/hideNav let a parent drive navigation (used by DateRangePicker) |
|
|
94
|
+
|
|
95
|
+
## AI context prompt
|
|
96
|
+
|
|
97
|
+
Copy this into an LLM context bar before editing this component:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
I am modifying the cascivo Calendar component (inputs). An accessible standalone month-grid date picker.
|
|
101
|
+
|
|
102
|
+
Architecture constraints — follow exactly:
|
|
103
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
104
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
105
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
106
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
107
|
+
- CSS logical properties only (RTL-safe).
|
|
108
|
+
|
|
109
|
+
Calendar is strictly bound to these tokens — use only these, do not invent token names:
|
|
110
|
+
--cascivo-calendar-bg, --cascivo-calendar-radius, --cascivo-calendar-cell-size, --cascivo-calendar-day-selected-bg, --cascivo-calendar-day-selected-fg, --cascivo-calendar-day-today-color, --cascivo-calendar-range-bg
|
|
111
|
+
|
|
112
|
+
Accessibility: role "grid", WCAG 2.2-AA, keyboard: ArrowLeft/ArrowRight/ArrowUp/ArrowDown/Home/End/PageUp/PageDown/Enter/Space. Keep it AA.
|
|
113
|
+
|
|
114
|
+
Do not change (strict): date type — All date props are native Date objects compared in UTC
|
|
115
|
+
Flexible: locale, view control.
|
|
116
|
+
|
|
117
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
118
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
**Category:** display
|
|
4
|
+
**Description:** Container for grouping related content
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Grouping related content into a visually distinct surface with border/shadow
|
|
9
|
+
- Creating scannable units in a grid or list (dashboard tiles, item summaries)
|
|
10
|
+
- Giving a content cluster elevation to separate it from the page background
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Pure semantic/structural grouping with no surface — use a <section>
|
|
15
|
+
- Wrapping every element in a card — nesting surfaces flattens visual hierarchy
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Stacked surfaces and shadows compete for attention and muddy the hierarchy
|
|
20
|
+
|
|
21
|
+
**Bad:** `Nesting Cards several levels deep for layout`
|
|
22
|
+
**Good:** `A single Card with internal spacing, or a plain <section>`
|
|
23
|
+
**Why:** Stacked surfaces and shadows compete for attention and muddy the hierarchy
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Separator** (pairs-with): Use a Separator to divide regions inside a card
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
role="region" is appropriate only when the card is a meaningful landmark; otherwise treat it as presentational — the visual surface adds no semantics on its own
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| --------- | --------------------------------------- | -------- | ------- | --------------------------------- |
|
|
37
|
+
| `variant` | `'default' \| 'outlined' \| 'elevated'` | No | default | Selects the visual style variant. |
|
|
38
|
+
| `padding` | `'none' \| 'sm' \| 'md' \| 'lg'` | No | md | Inner padding of the component. |
|
|
39
|
+
|
|
40
|
+
## Tokens
|
|
41
|
+
|
|
42
|
+
- `--cascivo-color-surface`
|
|
43
|
+
- `--cascivo-color-border`
|
|
44
|
+
- `--cascivo-radius-card`
|
|
45
|
+
- `--cascivo-shadow-md`
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
### Basic card
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
<Card>
|
|
53
|
+
<CardHeader>
|
|
54
|
+
<CardTitle>Title</CardTitle>
|
|
55
|
+
</CardHeader>
|
|
56
|
+
<CardContent>Content here</CardContent>
|
|
57
|
+
</Card>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Boundaries
|
|
61
|
+
|
|
62
|
+
| Area | Level | Note |
|
|
63
|
+
| ------------------- | -------- | ----------------------------------------------------------------------- |
|
|
64
|
+
| variant and padding | flexible | Choose elevation and density to fit the surrounding layout |
|
|
65
|
+
| token names | strict | Surface, border, radius, and shadow must resolve to --cascivo-\* tokens |
|
|
66
|
+
|
|
67
|
+
## AI context prompt
|
|
68
|
+
|
|
69
|
+
Copy this into an LLM context bar before editing this component:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
I am modifying the cascivo Card component (display). Container for grouping related content
|
|
73
|
+
|
|
74
|
+
Architecture constraints — follow exactly:
|
|
75
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
76
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
77
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
78
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
79
|
+
- CSS logical properties only (RTL-safe).
|
|
80
|
+
|
|
81
|
+
Card is strictly bound to these tokens — use only these, do not invent token names:
|
|
82
|
+
--cascivo-color-surface, --cascivo-color-border, --cascivo-radius-card, --cascivo-shadow-md
|
|
83
|
+
|
|
84
|
+
Accessibility: role "region", WCAG 2.2-AA. Keep it AA.
|
|
85
|
+
|
|
86
|
+
Do not change (strict): token names — Surface, border, radius, and shadow must resolve to --cascivo-* tokens
|
|
87
|
+
Flexible: variant and padding.
|
|
88
|
+
|
|
89
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
90
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Carousel
|
|
2
|
+
|
|
3
|
+
**Category:** display
|
|
4
|
+
**Description:** Scroll-snap slide deck with previous/next controls and dot indicators
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Presenting a sequence of media or cards the user pages through one at a time
|
|
9
|
+
- Image galleries, onboarding decks, or featured-content rotators
|
|
10
|
+
- When horizontal swiping/scrolling is a natural interaction on touch devices
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Content users must compare side-by-side — show a grid instead
|
|
15
|
+
- Critical information that must always be visible — carousels hide most of their content
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Auto-rotation and hidden slides reduce discoverability and accessibility of important content
|
|
20
|
+
|
|
21
|
+
**Bad:** `Auto-rotating carousel for primary navigation or key calls-to-action`
|
|
22
|
+
**Good:** `A static list or grid where every item is visible`
|
|
23
|
+
**Why:** Auto-rotation and hidden slides reduce discoverability and accessibility of important content
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Tabs** (alternative): Use tabs when sections are distinct and should be directly addressable
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
The container is a labelled region with aria-roledescription="carousel"; each slide is a labelled group ("n of total"); prev/next are real buttons and the dot indicators use roving tabindex with arrow-key navigation. Scrolling honours prefers-reduced-motion.
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| --------------- | ------------------------- | -------- | ------- | ----------------------------------------------------- |
|
|
37
|
+
| `children` | `ReactNode` | No | — | Slides as children |
|
|
38
|
+
| `slides` | `ReactNode[]` | No | — | Slides as an array |
|
|
39
|
+
| `index` | `number` | No | — | Controlled active index |
|
|
40
|
+
| `defaultIndex` | `number` | No | 0 | The initial slide index when uncontrolled. |
|
|
41
|
+
| `onIndexChange` | `(index: number) => void` | No | — | Called with the new slide index when it changes. |
|
|
42
|
+
| `loop` | `boolean` | No | false | When true, navigation wraps around from end to start. |
|
|
43
|
+
|
|
44
|
+
## Tokens
|
|
45
|
+
|
|
46
|
+
- `--cascivo-color-accent`
|
|
47
|
+
- `--cascivo-color-surface`
|
|
48
|
+
- `--cascivo-color-border`
|
|
49
|
+
- `--cascivo-color-border-strong`
|
|
50
|
+
- `--cascivo-radius-md`
|
|
51
|
+
- `--cascivo-radius-full`
|
|
52
|
+
- `--cascivo-focus-ring`
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
### Basic
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
<Carousel>
|
|
60
|
+
<img src="/1.jpg" alt="" />
|
|
61
|
+
<img src="/2.jpg" alt="" />
|
|
62
|
+
</Carousel>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Looping with array
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<Carousel loop slides={[<Slide1 />, <Slide2 />, <Slide3 />]} />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Boundaries
|
|
72
|
+
|
|
73
|
+
| Area | Level | Note |
|
|
74
|
+
| ------------- | -------- | -------------------------------------------------------------------------------- |
|
|
75
|
+
| transition | strict | Paging uses native CSS scroll-snap, not transform math — no custom easing config |
|
|
76
|
+
| slide content | flexible | Any ReactNode may be a slide; pass via children or the slides array |
|
|
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 Carousel component (display). Scroll-snap slide deck with previous/next controls and dot indicators
|
|
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
|
+
Carousel is strictly bound to these tokens — use only these, do not invent token names:
|
|
93
|
+
--cascivo-color-accent, --cascivo-color-surface, --cascivo-color-border, --cascivo-color-border-strong, --cascivo-radius-md, --cascivo-radius-full, --cascivo-focus-ring
|
|
94
|
+
|
|
95
|
+
Accessibility: role "group", WCAG 2.2-AA, keyboard: ArrowLeft/ArrowRight/Home/End. Keep it AA.
|
|
96
|
+
|
|
97
|
+
Do not change (strict): transition — Paging uses native CSS scroll-snap, not transform math — no custom easing config
|
|
98
|
+
Flexible: slide content.
|
|
99
|
+
|
|
100
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
101
|
+
```
|