@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,89 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
**Category:** feedback
|
|
4
|
+
**Description:** Indeterminate loading indicator
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Indicating indeterminate work where duration and progress are unknown
|
|
9
|
+
- Loading a small region or inline control where a shape preview is unnecessary
|
|
10
|
+
- Showing busy state in buttons or compact UI
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Progress with a known percentage — use ProgressBar or ProgressCircle
|
|
15
|
+
- Loading content with a known structure — use Skeleton
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Skeletons preview structure and feel faster; spinners are best for short, shapeless waits
|
|
20
|
+
|
|
21
|
+
**Bad:** `A full-page spinner for content whose layout is known`
|
|
22
|
+
**Good:** `<Skeleton> mirroring the content shape to reduce perceived wait and layout shift`
|
|
23
|
+
**Why:** Skeletons preview structure and feel faster; spinners are best for short, shapeless waits
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Skeleton** (alternative): Skeleton suits content with a known shape
|
|
28
|
+
- **ProgressBar** (alternative): ProgressBar suits determinate progress
|
|
29
|
+
|
|
30
|
+
## Accessibility rationale
|
|
31
|
+
|
|
32
|
+
role="status" with an accessible label (default "Loading", i18n-driven) so assistive tech announces the busy state rather than leaving the spin silent
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
| Name | Type | Required | Default | Description |
|
|
37
|
+
| ------- | ---------------------- | -------- | ------- | ----------------------------------------------------- |
|
|
38
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
39
|
+
| `label` | `string` | No | Loading | Accessible label announced by screen readers |
|
|
40
|
+
|
|
41
|
+
## Tokens
|
|
42
|
+
|
|
43
|
+
- `--cascivo-radius-full`
|
|
44
|
+
|
|
45
|
+
## Examples
|
|
46
|
+
|
|
47
|
+
### Default
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
<Spinner />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Large
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
<Spinner size="lg" />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Boundaries
|
|
60
|
+
|
|
61
|
+
| Area | Level | Note |
|
|
62
|
+
| ----------- | -------- | -------------------------------------------- |
|
|
63
|
+
| size | flexible | sm/md/lg to fit inline vs standalone use |
|
|
64
|
+
| token names | strict | Radius must resolve to --cascivo-radius-full |
|
|
65
|
+
|
|
66
|
+
## AI context prompt
|
|
67
|
+
|
|
68
|
+
Copy this into an LLM context bar before editing this component:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
I am modifying the cascivo Spinner component (feedback). Indeterminate loading indicator
|
|
72
|
+
|
|
73
|
+
Architecture constraints — follow exactly:
|
|
74
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
75
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
76
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
77
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
78
|
+
- CSS logical properties only (RTL-safe).
|
|
79
|
+
|
|
80
|
+
Spinner is strictly bound to these tokens — use only these, do not invent token names:
|
|
81
|
+
--cascivo-radius-full
|
|
82
|
+
|
|
83
|
+
Accessibility: role "status", WCAG 2.2-AA. Keep it AA.
|
|
84
|
+
|
|
85
|
+
Do not change (strict): token names — Radius must resolve to --cascivo-radius-full
|
|
86
|
+
Flexible: size.
|
|
87
|
+
|
|
88
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
89
|
+
```
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Stack
|
|
2
|
+
|
|
3
|
+
**Category:** layout
|
|
4
|
+
**Description:** Overlaps children in a CSS grid stack with a configurable offset to create a card-pile effect
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Card pile UI where depth and layering should be visible
|
|
9
|
+
- Overlapping avatar groups
|
|
10
|
+
- Notification stack visualisations
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Gap-based vertical/horizontal layout — that is a DIFFERENT component, the flex `layout/stack` (also exported as `Stack`). This `Stack` only overlaps children with an offset.
|
|
15
|
+
- Independent positioned elements — use CSS position directly
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### The npm `Stack` overlaps its children by an offset — it does not do gap-based layout. The two components share a name; pick by behaviour, not by the name.
|
|
20
|
+
|
|
21
|
+
**Bad:** `import { Stack } from '@cascivo/react' to space items vertically`
|
|
22
|
+
**Good:** `For flex layout use layout/stack (npx cascivo add stack); use this Stack only for a visual card-pile`
|
|
23
|
+
**Why:** The npm `Stack` overlaps its children by an offset — it does not do gap-based layout. The two components share a name; pick by behaviour, not by the name.
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **layout/stack** (alternative): The flex layout primitive for gap-based vertical/horizontal stacking. It shares the `Stack` export name but is copy-paste-only (`npx cascivo add stack`) — not this card-pile component.
|
|
28
|
+
- **Avatar** (pairs-with): Overlapping avatar groups are a primary use case for Stack
|
|
29
|
+
- **Card** (pairs-with): Card pile visualisations are a common Stack pattern
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
Stack is a layout-only container (role="none"). Each child must carry its own accessible semantics. Stacked cards that are interactive should each have a focusable element and a descriptive label.
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ----------- | ----------------- | -------- | ------- | -------------------------------------------------------- |
|
|
39
|
+
| `children` | `React.ReactNode` | Yes | — | Content rendered inside the component. |
|
|
40
|
+
| `offset` | `number` | No | 4 | Pixel offset applied per layer in both axes |
|
|
41
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
### Card pile
|
|
46
|
+
|
|
47
|
+
Three cards stacked with a 6px offset to show depth
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
<Stack offset={6}>
|
|
51
|
+
<Card>First</Card>
|
|
52
|
+
<Card>Second</Card>
|
|
53
|
+
<Card>Third</Card>
|
|
54
|
+
</Stack>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Tight stack
|
|
58
|
+
|
|
59
|
+
Overlapping avatar group with minimal offset
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<Stack offset={2}>
|
|
63
|
+
<Avatar src="/a.jpg" />
|
|
64
|
+
<Avatar src="/b.jpg" />
|
|
65
|
+
<Avatar src="/c.jpg" />
|
|
66
|
+
</Stack>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Boundaries
|
|
70
|
+
|
|
71
|
+
| Area | Level | Note |
|
|
72
|
+
| ------ | -------- | --------------------------------------------------------------------------------- |
|
|
73
|
+
| offset | flexible | The pixel offset is fully configurable; set to 0 for a pure overlap with no shift |
|
|
74
|
+
|
|
75
|
+
## AI context prompt
|
|
76
|
+
|
|
77
|
+
Copy this into an LLM context bar before editing this component:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
I am modifying the cascivo Stack component (layout). Overlaps children in a CSS grid stack with a configurable offset to create a card-pile effect
|
|
81
|
+
|
|
82
|
+
Architecture constraints — follow exactly:
|
|
83
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
84
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
85
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
86
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
87
|
+
- CSS logical properties only (RTL-safe).
|
|
88
|
+
|
|
89
|
+
Stack is strictly bound to these tokens — use only these, do not invent token names:
|
|
90
|
+
none declared
|
|
91
|
+
|
|
92
|
+
Accessibility: role "none", WCAG 2.2-AA. Keep it AA.
|
|
93
|
+
Flexible: offset.
|
|
94
|
+
|
|
95
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
96
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Stat
|
|
2
|
+
|
|
3
|
+
**Category:** display
|
|
4
|
+
**Description:** Displays a key metric with optional delta, trend direction and help text
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Highlighting a single key metric with a clear label
|
|
9
|
+
- Showing change over time with a delta and trend direction
|
|
10
|
+
- Annotating a metric with methodology or time-range help text
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Multiple comparable rows of data — use DataTable
|
|
15
|
+
- A non-numeric status label — use Badge or Status
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Stat optimizes for one headline number, not tabular comparison
|
|
20
|
+
|
|
21
|
+
**Bad:** `A grid of Stats used to fake a data table`
|
|
22
|
+
**Good:** `DataTable when the values are rows to compare and sort`
|
|
23
|
+
**Why:** Stat optimizes for one headline number, not tabular comparison
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Card** (contained-by): Stats commonly sit inside a Card tile on dashboards
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Presentational by role; the label-value pairing is real text so the metric and its meaning are read in order, and trend direction is conveyed by text/glyph, not color alone
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| ---------- | -------------------------- | -------- | ------- | ------------------------------------------------------------ |
|
|
37
|
+
| `label` | `string` | Yes | — | What the metric measures |
|
|
38
|
+
| `value` | `string \| number` | Yes | — | The metric value |
|
|
39
|
+
| `delta` | `string` | No | — | Change indicator rendered next to the trend arrow |
|
|
40
|
+
| `trend` | `'up' \| 'down' \| 'flat'` | No | flat | Direction of the trend indicator ('up' \| 'down' \| 'flat'). |
|
|
41
|
+
| `helpText` | `string` | No | — | Fine print below the value (methodology, time range) |
|
|
42
|
+
|
|
43
|
+
## Tokens
|
|
44
|
+
|
|
45
|
+
- `--cascivo-color-text`
|
|
46
|
+
- `--cascivo-color-text-subtle`
|
|
47
|
+
- `--cascivo-color-text-muted`
|
|
48
|
+
- `--cascivo-color-success`
|
|
49
|
+
- `--cascivo-color-destructive`
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Default
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
<Stat label="Components" value={106} />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With trend
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<Stat label="Bundle size" value="12.4 kB" delta="-1.2 kB" trend="up" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### With help text
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<Stat label="Axe violations" value={0} helpText="WCAG 2.1 AA, 4 app states" />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Boundaries
|
|
72
|
+
|
|
73
|
+
| Area | Level | Note |
|
|
74
|
+
| --------------- | -------- | ---------------------------------------------------------------- |
|
|
75
|
+
| delta and trend | flexible | Optional — include only when change is meaningful |
|
|
76
|
+
| token names | strict | Trend colors must resolve to --cascivo-color-success/destructive |
|
|
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 Stat component (display). Displays a key metric with optional delta, trend direction and help text
|
|
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
|
+
Stat is strictly bound to these tokens — use only these, do not invent token names:
|
|
93
|
+
--cascivo-color-text, --cascivo-color-text-subtle, --cascivo-color-text-muted, --cascivo-color-success, --cascivo-color-destructive
|
|
94
|
+
|
|
95
|
+
Accessibility: role "none", WCAG 2.2-AA. Keep it AA.
|
|
96
|
+
|
|
97
|
+
Do not change (strict): token names — Trend colors must resolve to --cascivo-color-success/destructive
|
|
98
|
+
Flexible: delta and trend.
|
|
99
|
+
|
|
100
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
101
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Status
|
|
2
|
+
|
|
3
|
+
**Category:** display
|
|
4
|
+
**Description:** Colored dot with a label communicating the state of a system or entity
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Communicating the live state of a system or entity (operational, deploying, down)
|
|
9
|
+
- Pairing a colored dot with a text label for an at-a-glance state
|
|
10
|
+
- Drawing attention to an active/changing state with an optional pulse
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- A static category or count label — use Badge
|
|
15
|
+
- An identity thumbnail with presence — use Avatar with its status prop
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### A bare colored dot conveys nothing to color-blind or screen-reader users; always pair with text
|
|
20
|
+
|
|
21
|
+
**Bad:** `<Status status="success" /> with no label`
|
|
22
|
+
**Good:** `<Status status="success">Operational</Status>`
|
|
23
|
+
**Why:** A bare colored dot conveys nothing to color-blind or screen-reader users; always pair with text
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Badge** (alternative): Badge labels categories; Status reflects live state with a dot
|
|
28
|
+
- **Avatar** (alternative): Avatar embeds presence status on an identity
|
|
29
|
+
|
|
30
|
+
## Accessibility rationale
|
|
31
|
+
|
|
32
|
+
Meaning is carried by the text label, never by the dot color alone; the pulse animation is gated behind prefers-reduced-motion: no-preference so it never animates for users who opt out
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
| Name | Type | Required | Default | Description |
|
|
37
|
+
| -------- | ---------------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------- |
|
|
38
|
+
| `status` | `'success' \| 'warning' \| 'error' \| 'info' \| 'neutral'` | No | neutral | Status state. |
|
|
39
|
+
| `pulse` | `boolean` | No | false | Pulses the dot — gated behind prefers-reduced-motion: no-preference |
|
|
40
|
+
|
|
41
|
+
## Tokens
|
|
42
|
+
|
|
43
|
+
- `--cascivo-color-success`
|
|
44
|
+
- `--cascivo-color-warning`
|
|
45
|
+
- `--cascivo-color-error`
|
|
46
|
+
- `--cascivo-color-info`
|
|
47
|
+
- `--cascivo-color-text-muted`
|
|
48
|
+
- `--cascivo-color-text`
|
|
49
|
+
- `--cascivo-radius-full`
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Default
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
<Status>Unknown</Status>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Success
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<Status status="success">Operational</Status>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Pulsing
|
|
66
|
+
|
|
67
|
+
The pulse animation respects prefers-reduced-motion
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<Status status="info" pulse>
|
|
71
|
+
Deploying
|
|
72
|
+
</Status>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Boundaries
|
|
76
|
+
|
|
77
|
+
| Area | Level | Note |
|
|
78
|
+
| ----------- | -------- | ----------------------------------------------------------------------- |
|
|
79
|
+
| pulse | flexible | Enable pulse only for actively-changing states |
|
|
80
|
+
| token names | strict | State colors must resolve to --cascivo-color-success/warning/error/info |
|
|
81
|
+
|
|
82
|
+
## AI context prompt
|
|
83
|
+
|
|
84
|
+
Copy this into an LLM context bar before editing this component:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
I am modifying the cascivo Status component (display). Colored dot with a label communicating the state of a system or entity
|
|
88
|
+
|
|
89
|
+
Architecture constraints — follow exactly:
|
|
90
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
91
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
92
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
93
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
94
|
+
- CSS logical properties only (RTL-safe).
|
|
95
|
+
|
|
96
|
+
Status is strictly bound to these tokens — use only these, do not invent token names:
|
|
97
|
+
--cascivo-color-success, --cascivo-color-warning, --cascivo-color-error, --cascivo-color-info, --cascivo-color-text-muted, --cascivo-color-text, --cascivo-radius-full
|
|
98
|
+
|
|
99
|
+
Accessibility: role "none", WCAG 2.2-AA. Keep it AA.
|
|
100
|
+
|
|
101
|
+
Do not change (strict): token names — State colors must resolve to --cascivo-color-success/warning/error/info
|
|
102
|
+
Flexible: pulse.
|
|
103
|
+
|
|
104
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
105
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Steps
|
|
2
|
+
|
|
3
|
+
**Category:** navigation
|
|
4
|
+
**Description:** Visual progress indicator for multi-step flows with horizontal and vertical orientations
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Checkout flows where the user moves through a fixed sequence of screens
|
|
9
|
+
- Onboarding wizards with a known number of steps
|
|
10
|
+
- Multi-step forms where showing overall progress reduces abandonment
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- General section navigation — use Tabs instead
|
|
15
|
+
- Simple back/next controls without step labels — use Pagination instead
|
|
16
|
+
- More than 7 steps where the connector lines become unreadable on mobile
|
|
17
|
+
|
|
18
|
+
## Anti-patterns
|
|
19
|
+
|
|
20
|
+
### Steps imply a linear sequence and derive complete/pending state from position
|
|
21
|
+
|
|
22
|
+
**Bad:** `Using Steps as a replacement for Tabs for non-sequential navigation`
|
|
23
|
+
**Good:** `<Tabs> for switching between independent views`
|
|
24
|
+
**Why:** Steps imply a linear sequence and derive complete/pending state from position
|
|
25
|
+
|
|
26
|
+
## Related components
|
|
27
|
+
|
|
28
|
+
- **Pagination** (alternative): Pagination is for paged data sets, Steps is for guided task sequences
|
|
29
|
+
- **Tabs** (alternative): Tabs are for non-sequential section switching, not ordered task flows
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
Rendered as an ordered list (<ol>) with aria-label; the active item carries aria-current="step" to communicate progress to screen readers
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ------------- | ---------------------------- | -------- | ------------ | ------------------------------------------------------------ |
|
|
39
|
+
| `steps` | `Step[]` | Yes | — | Array of step objects with label and optional explicit state |
|
|
40
|
+
| `activeStep` | `number` | No | 0 | Index of the currently active step (0-based) |
|
|
41
|
+
| `orientation` | `'horizontal' \| 'vertical'` | No | 'horizontal' | Layout direction of the steps |
|
|
42
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
43
|
+
|
|
44
|
+
## Tokens
|
|
45
|
+
|
|
46
|
+
- `--cascivo-color-accent`
|
|
47
|
+
- `--cascivo-color-accent-content`
|
|
48
|
+
- `--cascivo-color-success`
|
|
49
|
+
- `--cascivo-color-success-content`
|
|
50
|
+
- `--cascivo-color-error`
|
|
51
|
+
- `--cascivo-color-error-content`
|
|
52
|
+
- `--cascivo-color-surface`
|
|
53
|
+
- `--cascivo-color-text`
|
|
54
|
+
- `--cascivo-color-text-subtle`
|
|
55
|
+
- `--cascivo-color-text-muted`
|
|
56
|
+
- `--cascivo-border-default`
|
|
57
|
+
- `--cascivo-radius-full`
|
|
58
|
+
- `--cascivo-ease-out`
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Horizontal (default)
|
|
63
|
+
|
|
64
|
+
Standard checkout or onboarding progress tracker
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
<Steps
|
|
68
|
+
steps={[{ label: 'Cart' }, { label: 'Shipping' }, { label: 'Payment' }, { label: 'Confirm' }]}
|
|
69
|
+
activeStep={1}
|
|
70
|
+
/>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Vertical
|
|
74
|
+
|
|
75
|
+
Sidebar-style progress for tall forms
|
|
76
|
+
|
|
77
|
+
```jsx
|
|
78
|
+
<Steps
|
|
79
|
+
orientation="vertical"
|
|
80
|
+
steps={[{ label: 'Account info' }, { label: 'Profile details' }, { label: 'Preferences' }]}
|
|
81
|
+
activeStep={0}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### With explicit error state
|
|
86
|
+
|
|
87
|
+
Override derived state on a specific step
|
|
88
|
+
|
|
89
|
+
```jsx
|
|
90
|
+
<Steps
|
|
91
|
+
steps={[{ label: 'Upload' }, { label: 'Validate', state: 'error' }, { label: 'Process' }]}
|
|
92
|
+
activeStep={1}
|
|
93
|
+
/>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Boundaries
|
|
97
|
+
|
|
98
|
+
| Area | Level | Note |
|
|
99
|
+
| ----------- | -------- | --------------------------------------------------------------------------- |
|
|
100
|
+
| step state | flexible | Each step can override derived pending/active/complete state via step.state |
|
|
101
|
+
| orientation | flexible | Horizontal for top progress bars, vertical for sidebar wizards |
|
|
102
|
+
|
|
103
|
+
## AI context prompt
|
|
104
|
+
|
|
105
|
+
Copy this into an LLM context bar before editing this component:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
I am modifying the cascivo Steps component (navigation). Visual progress indicator for multi-step flows with horizontal and vertical orientations
|
|
109
|
+
|
|
110
|
+
Architecture constraints — follow exactly:
|
|
111
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
112
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
113
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
114
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
115
|
+
- CSS logical properties only (RTL-safe).
|
|
116
|
+
|
|
117
|
+
Steps is strictly bound to these tokens — use only these, do not invent token names:
|
|
118
|
+
--cascivo-color-accent, --cascivo-color-accent-content, --cascivo-color-success, --cascivo-color-success-content, --cascivo-color-error, --cascivo-color-error-content, --cascivo-color-surface, --cascivo-color-text, --cascivo-color-text-subtle, --cascivo-color-text-muted, --cascivo-border-default, --cascivo-radius-full, --cascivo-ease-out
|
|
119
|
+
|
|
120
|
+
Accessibility: role "list", WCAG 2.2-AA. Keep it AA.
|
|
121
|
+
Flexible: step state, orientation.
|
|
122
|
+
|
|
123
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
124
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# StructuredList
|
|
2
|
+
|
|
3
|
+
**Category:** display
|
|
4
|
+
**Description:** Tabular row list for scannable data, optionally single-selectable
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Presenting a set of related records in aligned columns the user scans top to bottom
|
|
9
|
+
- Letting the user pick exactly one row from a short, readable list (selectable)
|
|
10
|
+
- Carbon-style structured content where a full data table is heavier than needed
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Sorting, filtering, pagination, or multi-select over many rows — use DataTable
|
|
15
|
+
- Free-form vertical content without column alignment — use List
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### The selectable variant is a radiogroup; multiple selected rows break the radio semantics
|
|
20
|
+
|
|
21
|
+
**Bad:** `selectable with multiple rows marked selected`
|
|
22
|
+
**Good:** `A single selected id (value/defaultValue) — selection is single-choice`
|
|
23
|
+
**Why:** The selectable variant is a radiogroup; multiple selected rows break the radio semantics
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **DataTable** (alternative): DataTable adds sorting, filtering, and pagination; StructuredList stays static and lightweight
|
|
28
|
+
- **List** (alternative): List is single-column vertical content; StructuredList aligns multiple cells per row
|
|
29
|
+
|
|
30
|
+
## Accessibility rationale
|
|
31
|
+
|
|
32
|
+
Static lists use table/row/cell roles so columns are announced; selectable lists become a radiogroup of role=radio rows with roving tabindex, so arrow keys move focus and Enter/Space check a row exactly like native radios
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
| Name | Type | Required | Default | Description |
|
|
37
|
+
| -------------- | ---------------------------------------------------------- | -------- | ------- | ------------------------------------ |
|
|
38
|
+
| `items` | `{ id: string; cells: ReactNode[]; selected?: boolean }[]` | Yes | — | The items to render. |
|
|
39
|
+
| `headers` | `ReactNode[]` | No | — | The column header cells. |
|
|
40
|
+
| `selectable` | `boolean` | No | false | When true, rows can be selected. |
|
|
41
|
+
| `value` | `string` | No | — | The controlled value. |
|
|
42
|
+
| `defaultValue` | `string` | No | — | The initial value when uncontrolled. |
|
|
43
|
+
| `onSelect` | `(id: string) => void` | No | — | Called with the selected value. |
|
|
44
|
+
|
|
45
|
+
## Tokens
|
|
46
|
+
|
|
47
|
+
- `--cascivo-color-border`
|
|
48
|
+
- `--cascivo-color-bg-subtle`
|
|
49
|
+
- `--cascivo-color-text`
|
|
50
|
+
- `--cascivo-color-text-subtle`
|
|
51
|
+
- `--cascivo-color-primary`
|
|
52
|
+
- `--cascivo-color-surface`
|
|
53
|
+
- `--cascivo-focus-ring`
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
### Static
|
|
58
|
+
|
|
59
|
+
```jsx
|
|
60
|
+
<StructuredList headers={['Name', 'Role']} items={[{ id: 'a', cells: ['Ada', 'Engineer'] }]} />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Selectable
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
<StructuredList
|
|
67
|
+
selectable
|
|
68
|
+
defaultValue="a"
|
|
69
|
+
items={[
|
|
70
|
+
{ id: 'a', cells: ['Ada'] },
|
|
71
|
+
{ id: 'b', cells: ['Grace'] },
|
|
72
|
+
]}
|
|
73
|
+
onSelect={(id) => set(id)}
|
|
74
|
+
/>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Boundaries
|
|
78
|
+
|
|
79
|
+
| Area | Level | Note |
|
|
80
|
+
| ---------- | -------- | ----------------------------------------------------------------------------------- |
|
|
81
|
+
| selectable | flexible | Toggle selectable based on whether the list is interactive or purely presentational |
|
|
82
|
+
| roles | strict | Static uses table semantics; selectable uses radiogroup — do not mix |
|
|
83
|
+
|
|
84
|
+
## AI context prompt
|
|
85
|
+
|
|
86
|
+
Copy this into an LLM context bar before editing this component:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
I am modifying the cascivo StructuredList component (display). Tabular row list for scannable data, optionally single-selectable
|
|
90
|
+
|
|
91
|
+
Architecture constraints — follow exactly:
|
|
92
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
93
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
94
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
95
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
96
|
+
- CSS logical properties only (RTL-safe).
|
|
97
|
+
|
|
98
|
+
StructuredList is strictly bound to these tokens — use only these, do not invent token names:
|
|
99
|
+
--cascivo-color-border, --cascivo-color-bg-subtle, --cascivo-color-text, --cascivo-color-text-subtle, --cascivo-color-primary, --cascivo-color-surface, --cascivo-focus-ring
|
|
100
|
+
|
|
101
|
+
Accessibility: role "table", WCAG 2.2-AA, keyboard: ArrowDown/ArrowUp/Home/End/Enter/Space. Keep it AA.
|
|
102
|
+
|
|
103
|
+
Do not change (strict): roles — Static uses table semantics; selectable uses radiogroup — do not mix
|
|
104
|
+
Flexible: selectable.
|
|
105
|
+
|
|
106
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
107
|
+
```
|