@cascivo/mcp 0.2.0 → 0.3.4
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,108 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
**Category:** overlay
|
|
4
|
+
**Description:** Anchored floating panel built on CSS Anchor Positioning + Popover API
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing rich, interactive content anchored to a trigger that the user must explicitly open by clicking
|
|
9
|
+
- Lightweight transient panels (forms, pickers, detail cards) that do not need to block the rest of the page
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- A short, non-interactive text hint on hover/focus — use Tooltip
|
|
14
|
+
- A task that must capture focus and block interaction with the page — use Modal
|
|
15
|
+
- Preview content revealed on hover without a click — use HoverCard
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Tooltips are non-interactive and hover-driven; interactive content needs a click-opened dialog popover that users can move focus into
|
|
20
|
+
|
|
21
|
+
**Bad:** `<Tooltip content={<form>...</form>}>`
|
|
22
|
+
**Good:** `<Popover><PopoverTrigger>…</PopoverTrigger><PopoverContent><form>…</form></PopoverContent></Popover>`
|
|
23
|
+
**Why:** Tooltips are non-interactive and hover-driven; interactive content needs a click-opened dialog popover that users can move focus into
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Tooltip** (alternative): Use for brief non-interactive hints, not interactive content
|
|
28
|
+
- **HoverCard** (alternative): Use when the panel should open on hover rather than click
|
|
29
|
+
- **Modal** (alternative): Use when the overlay must be blocking and focus-trapping
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
The trigger is a real <button> with aria-haspopup="dialog" and aria-expanded reflecting open state, and the panel uses role="dialog" via the native Popover API so Escape-to-close and light-dismiss come from the platform rather than custom handlers.
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| -------------- | ---------------------------------------- | -------- | ------- | ------------------------------------------------ |
|
|
39
|
+
| `children` | `React.ReactNode` | Yes | — | A PopoverTrigger and PopoverContent pair. |
|
|
40
|
+
| `open` | `boolean` | No | — | Whether the component is open (controlled). |
|
|
41
|
+
| `onOpenChange` | `(open: boolean) => void` | No | — | Called with the next open state when it changes. |
|
|
42
|
+
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | No | bottom | Placement relative to the trigger. |
|
|
43
|
+
| `offset` | `number` | No | 4 | Distance (px) between the trigger and the panel. |
|
|
44
|
+
|
|
45
|
+
## Tokens
|
|
46
|
+
|
|
47
|
+
- `--cascivo-color-surface`
|
|
48
|
+
- `--cascivo-color-border`
|
|
49
|
+
- `--cascivo-radius-md`
|
|
50
|
+
- `--cascivo-shadow-md`
|
|
51
|
+
- `--cascivo-motion-enter`
|
|
52
|
+
- `--cascivo-motion-exit`
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
### Basic
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
<Popover>
|
|
60
|
+
<PopoverTrigger>Open settings</PopoverTrigger>
|
|
61
|
+
<PopoverContent>
|
|
62
|
+
<form>…</form>
|
|
63
|
+
</PopoverContent>
|
|
64
|
+
</Popover>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Controlled with placement
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<Popover open={isOpen} onOpenChange={setIsOpen} placement="top">
|
|
71
|
+
<PopoverTrigger>Filters</PopoverTrigger>
|
|
72
|
+
<PopoverContent>
|
|
73
|
+
<FilterForm />
|
|
74
|
+
</PopoverContent>
|
|
75
|
+
</Popover>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Boundaries
|
|
79
|
+
|
|
80
|
+
| Area | Level | Note |
|
|
81
|
+
| ----------- | -------- | ------------------------------------------------------------------------- |
|
|
82
|
+
| token names | strict | Panel styling must resolve to the listed --cascivo-\* tokens |
|
|
83
|
+
| content | flexible | Trigger and panel content are arbitrary children supplied by the consumer |
|
|
84
|
+
|
|
85
|
+
## AI context prompt
|
|
86
|
+
|
|
87
|
+
Copy this into an LLM context bar before editing this component:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
I am modifying the cascivo Popover component (overlay). Anchored floating panel built on CSS Anchor Positioning + Popover API
|
|
91
|
+
|
|
92
|
+
Architecture constraints — follow exactly:
|
|
93
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
94
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
95
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
96
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
97
|
+
- CSS logical properties only (RTL-safe).
|
|
98
|
+
|
|
99
|
+
Popover is strictly bound to these tokens — use only these, do not invent token names:
|
|
100
|
+
--cascivo-color-surface, --cascivo-color-border, --cascivo-radius-md, --cascivo-shadow-md, --cascivo-motion-enter, --cascivo-motion-exit
|
|
101
|
+
|
|
102
|
+
Accessibility: role "dialog", WCAG 2.2-AA, keyboard: Escape. Keep it AA.
|
|
103
|
+
|
|
104
|
+
Do not change (strict): token names — Panel styling must resolve to the listed --cascivo-* tokens
|
|
105
|
+
Flexible: content.
|
|
106
|
+
|
|
107
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
108
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# ProgressBar
|
|
2
|
+
|
|
3
|
+
**Category:** feedback
|
|
4
|
+
**Description:** Shows determinate or indeterminate progress of a task
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing linear determinate progress of a task with a known percentage (value)
|
|
9
|
+
- Indicating ongoing work of unknown duration (omit value for indeterminate)
|
|
10
|
+
- Reflecting success/error outcome of a tracked operation (status)
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- A compact circular indicator is preferred — use ProgressCircle
|
|
15
|
+
- Pure indeterminate spinning with no track — use Spinner
|
|
16
|
+
- Stepping through a multi-step flow — use ProgressIndicator
|
|
17
|
+
|
|
18
|
+
## Anti-patterns
|
|
19
|
+
|
|
20
|
+
### A determinate bar implies a meaningful percentage; faking it misleads the user
|
|
21
|
+
|
|
22
|
+
**Bad:** `A determinate ProgressBar with a faked, jumping value`
|
|
23
|
+
**Good:** `Omit value for an indeterminate bar when real progress is unknown`
|
|
24
|
+
**Why:** A determinate bar implies a meaningful percentage; faking it misleads the user
|
|
25
|
+
|
|
26
|
+
## Related components
|
|
27
|
+
|
|
28
|
+
- **ProgressCircle** (alternative): Circular form for compact determinate progress
|
|
29
|
+
- **Spinner** (alternative): Spinner for indeterminate work with no track
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
role="progressbar" with value/max exposes completion to assistive tech; the label is wired via aria-labelledby and success/error states add a glyph so outcome is not color-only
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ------------ | ---------------------------------- | -------- | ------- | -------------------------------------------------------------- |
|
|
39
|
+
| `value` | `number` | No | — | Current value from 0 to max; omit for an indeterminate bar |
|
|
40
|
+
| `max` | `number` | No | 100 | Maximum allowed value. |
|
|
41
|
+
| `label` | `string` | No | — | Visible label above the track, wired via aria-labelledby |
|
|
42
|
+
| `helperText` | `string` | No | — | Supplementary text shown with the progress bar. |
|
|
43
|
+
| `size` | `'sm' \| 'md'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
44
|
+
| `status` | `'active' \| 'success' \| 'error'` | No | active | success/error tint the fill and show a glyph next to the label |
|
|
45
|
+
|
|
46
|
+
## Tokens
|
|
47
|
+
|
|
48
|
+
- `--cascivo-color-accent`
|
|
49
|
+
- `--cascivo-color-success`
|
|
50
|
+
- `--cascivo-color-destructive`
|
|
51
|
+
- `--cascivo-color-border`
|
|
52
|
+
- `--cascivo-color-text`
|
|
53
|
+
- `--cascivo-color-text-subtle`
|
|
54
|
+
- `--cascivo-radius-full`
|
|
55
|
+
- `--cascivo-motion-enter`
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
### Determinate
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<ProgressBar value={60} label="Uploading" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Indeterminate
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<ProgressBar label="Processing" />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Success
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
<ProgressBar value={100} status="success" label="Upload complete" />
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Boundaries
|
|
78
|
+
|
|
79
|
+
| Area | Level | Note |
|
|
80
|
+
| ---------------------------- | -------- | ---------------------------------------------------------- |
|
|
81
|
+
| determinate vs indeterminate | flexible | Presence of value selects the mode |
|
|
82
|
+
| token names | strict | Fill and status colors must resolve to --cascivo-\* tokens |
|
|
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 ProgressBar component (feedback). Shows determinate or indeterminate progress of a task
|
|
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
|
+
ProgressBar is strictly bound to these tokens — use only these, do not invent token names:
|
|
99
|
+
--cascivo-color-accent, --cascivo-color-success, --cascivo-color-destructive, --cascivo-color-border, --cascivo-color-text, --cascivo-color-text-subtle, --cascivo-radius-full, --cascivo-motion-enter
|
|
100
|
+
|
|
101
|
+
Accessibility: role "progressbar", WCAG 2.2-AA. Keep it AA.
|
|
102
|
+
|
|
103
|
+
Do not change (strict): token names — Fill and status colors must resolve to --cascivo-* tokens
|
|
104
|
+
Flexible: determinate vs indeterminate.
|
|
105
|
+
|
|
106
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
107
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# ProgressCircle
|
|
2
|
+
|
|
3
|
+
**Category:** feedback
|
|
4
|
+
**Description:** Circular determinate progress indicator rendered as an SVG arc
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing determinate progress compactly as a circular arc
|
|
9
|
+
- Displaying a percentage in a small footprint (showValue)
|
|
10
|
+
- Tracking completion against a custom maximum (max)
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Indeterminate work with no known value — use Spinner
|
|
15
|
+
- Full-width linear progress with a label and helper text — use ProgressBar
|
|
16
|
+
- Multi-step flows — use ProgressIndicator
|
|
17
|
+
|
|
18
|
+
## Anti-patterns
|
|
19
|
+
|
|
20
|
+
### ProgressCircle requires a determinate value; it cannot express unknown progress
|
|
21
|
+
|
|
22
|
+
**Bad:** `Using ProgressCircle for indeterminate loading`
|
|
23
|
+
**Good:** `<Spinner> for indeterminate states`
|
|
24
|
+
**Why:** ProgressCircle requires a determinate value; it cannot express unknown progress
|
|
25
|
+
|
|
26
|
+
## Related components
|
|
27
|
+
|
|
28
|
+
- **ProgressBar** (alternative): Linear form with labels and indeterminate support
|
|
29
|
+
- **Spinner** (alternative): Indeterminate alternative when value is unknown
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
role="progressbar" with value/max conveys completion to assistive tech; the label prop supplies an accessible name since the SVG arc alone carries no text
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ----------- | ---------------------- | -------- | ------- | ------------------------------------------------------------------------ |
|
|
39
|
+
| `value` | `number` | Yes | — | Current value from 0 to max — clamped |
|
|
40
|
+
| `max` | `number` | No | 100 | Maximum allowed value. |
|
|
41
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
42
|
+
| `showValue` | `boolean` | No | false | Renders the rounded percentage in the center — pairs best with md and lg |
|
|
43
|
+
| `label` | `string` | No | — | Accessible name announced by screen readers |
|
|
44
|
+
|
|
45
|
+
## Tokens
|
|
46
|
+
|
|
47
|
+
- `--cascivo-color-border`
|
|
48
|
+
- `--cascivo-color-accent`
|
|
49
|
+
- `--cascivo-color-text`
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Default
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
<ProgressCircle value={40} label="Loading" />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With value
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<ProgressCircle value={72} showValue size="lg" label="Upload progress" />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Custom max
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<ProgressCircle value={3} max={8} label="Steps completed" />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Boundaries
|
|
72
|
+
|
|
73
|
+
| Area | Level | Note |
|
|
74
|
+
| ------------------ | -------- | -------------------------------------------------------- |
|
|
75
|
+
| size and showValue | flexible | showValue pairs best with md/lg sizes |
|
|
76
|
+
| token names | strict | Arc and track colors must resolve to --cascivo-\* tokens |
|
|
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 ProgressCircle component (feedback). Circular determinate progress indicator rendered as an SVG arc
|
|
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
|
+
ProgressCircle is strictly bound to these tokens — use only these, do not invent token names:
|
|
93
|
+
--cascivo-color-border, --cascivo-color-accent, --cascivo-color-text
|
|
94
|
+
|
|
95
|
+
Accessibility: role "progressbar", WCAG 2.2-AA. Keep it AA.
|
|
96
|
+
|
|
97
|
+
Do not change (strict): token names — Arc and track colors must resolve to --cascivo-* tokens
|
|
98
|
+
Flexible: size and showValue.
|
|
99
|
+
|
|
100
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
101
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ProgressIndicator
|
|
2
|
+
|
|
3
|
+
**Category:** navigation
|
|
4
|
+
**Description:** Shows progress through the steps of a multi-step flow
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing progress through the discrete steps of a multi-step flow (wizard, checkout)
|
|
9
|
+
- Communicating which step is complete, current, and upcoming
|
|
10
|
+
- Laying out steps horizontally or vertically with optional descriptions
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Continuous task progress with a percentage — use ProgressBar or ProgressCircle
|
|
15
|
+
- Indeterminate loading — use Spinner
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### ProgressIndicator models discrete steps, not a continuous quantity
|
|
20
|
+
|
|
21
|
+
**Bad:** `Using ProgressIndicator to show a download percentage`
|
|
22
|
+
**Good:** `<ProgressBar value={pct}> for continuous progress`
|
|
23
|
+
**Why:** ProgressIndicator models discrete steps, not a continuous quantity
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **ProgressBar** (alternative): ProgressBar shows continuous progress; this shows discrete steps
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
role="list" structures the steps in order; the current step is conveyed as text/state rather than color alone, so screen-reader users know where they are in the flow
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| -------------- | ------------------------------------------- | -------- | ------- | -------------------------------------------------------- |
|
|
37
|
+
| `steps` | `{ label: string; description?: string }[]` | Yes | — | Ordered list of steps |
|
|
38
|
+
| `currentIndex` | `number` | Yes | — | Index of the current step (0-based) |
|
|
39
|
+
| `vertical` | `boolean` | No | false | When true, lays the steps out vertically. |
|
|
40
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
41
|
+
|
|
42
|
+
## Tokens
|
|
43
|
+
|
|
44
|
+
- `--cascivo-color-accent`
|
|
45
|
+
- `--cascivo-color-accent-subtle`
|
|
46
|
+
- `--cascivo-color-text`
|
|
47
|
+
- `--cascivo-color-text-muted`
|
|
48
|
+
- `--cascivo-color-text-subtle`
|
|
49
|
+
- `--cascivo-color-text-on-accent`
|
|
50
|
+
- `--cascivo-color-border`
|
|
51
|
+
- `--cascivo-color-surface`
|
|
52
|
+
- `--cascivo-radius-full`
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
### Horizontal
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
<ProgressIndicator
|
|
60
|
+
steps={[{ label: 'Cart' }, { label: 'Shipping' }, { label: 'Payment' }]}
|
|
61
|
+
currentIndex={1}
|
|
62
|
+
/>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Vertical with descriptions
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
<ProgressIndicator
|
|
69
|
+
vertical
|
|
70
|
+
steps={[{ label: 'Account', description: 'Your details' }, { label: 'Confirm' }]}
|
|
71
|
+
currentIndex={0}
|
|
72
|
+
/>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Boundaries
|
|
76
|
+
|
|
77
|
+
| Area | Level | Note |
|
|
78
|
+
| ----------- | -------- | ------------------------------------------------------------- |
|
|
79
|
+
| orientation | flexible | horizontal or vertical to fit the layout |
|
|
80
|
+
| token names | strict | Step and connector colors must resolve to --cascivo-\* tokens |
|
|
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 ProgressIndicator component (navigation). Shows progress through the steps of a multi-step flow
|
|
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
|
+
ProgressIndicator is strictly bound to these tokens — use only these, do not invent token names:
|
|
97
|
+
--cascivo-color-accent, --cascivo-color-accent-subtle, --cascivo-color-text, --cascivo-color-text-muted, --cascivo-color-text-subtle, --cascivo-color-text-on-accent, --cascivo-color-border, --cascivo-color-surface, --cascivo-radius-full
|
|
98
|
+
|
|
99
|
+
Accessibility: role "list", WCAG 2.2-AA. Keep it AA.
|
|
100
|
+
|
|
101
|
+
Do not change (strict): token names — Step and connector colors must resolve to --cascivo-* tokens
|
|
102
|
+
Flexible: orientation.
|
|
103
|
+
|
|
104
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
105
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
**Category:** feedback
|
|
4
|
+
**Description:** Horizontal bar showing the completion progress of a tracked operation
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Tracked operations with a known total (file uploads, multi-step imports)
|
|
9
|
+
- Showing completion percentage of a long-running task
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Unbounded waits of unknown duration — use Spinner
|
|
14
|
+
- Single-action button loading state — use the button's own loading prop
|
|
15
|
+
|
|
16
|
+
## Anti-patterns
|
|
17
|
+
|
|
18
|
+
### Indeterminate progress bars must have an aria-label so screen readers can announce what is loading
|
|
19
|
+
|
|
20
|
+
**Bad:** `<Progress />`
|
|
21
|
+
**Good:** `<Progress aria-label="Uploading file…" />`
|
|
22
|
+
**Why:** Indeterminate progress bars must have an aria-label so screen readers can announce what is loading
|
|
23
|
+
|
|
24
|
+
## Related components
|
|
25
|
+
|
|
26
|
+
- **Spinner** (alternative): Spinner is for unbounded waits; Progress is for operations with a known end point
|
|
27
|
+
- **ProgressBar** (alternative): ProgressBar is the richer compound variant with label and percentage display
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Uses the native <progress> element which maps to role="progressbar" automatically; aria-label or aria-labelledby is required for indeterminate state
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| --------- | ---------------------------------------------------------- | -------- | ------- | ----------------------------------------------------- |
|
|
37
|
+
| `value` | `number` | No | — | 0–100. Omit for indeterminate state. |
|
|
38
|
+
| `variant` | `'primary' \| 'info' \| 'success' \| 'warning' \| 'error'` | No | primary | Selects the visual style variant. |
|
|
39
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
40
|
+
|
|
41
|
+
## Tokens
|
|
42
|
+
|
|
43
|
+
- `--cascivo-color-surface-2`
|
|
44
|
+
- `--cascivo-color-primary`
|
|
45
|
+
- `--cascivo-color-info`
|
|
46
|
+
- `--cascivo-color-success`
|
|
47
|
+
- `--cascivo-color-warning`
|
|
48
|
+
- `--cascivo-color-error`
|
|
49
|
+
- `--cascivo-color-accent`
|
|
50
|
+
- `--cascivo-radius-full`
|
|
51
|
+
- `--cascivo-ease-out`
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
### Determinate
|
|
56
|
+
|
|
57
|
+
```jsx
|
|
58
|
+
<Progress value={65} />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Indeterminate
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
<Progress aria-label="Loading…" />
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Success variant
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
<Progress value={100} variant="success" />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Small
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
<Progress value={40} size="sm" />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Boundaries
|
|
80
|
+
|
|
81
|
+
| Area | Level | Note |
|
|
82
|
+
| ----------- | -------- | --------------------------------------------------------------------- |
|
|
83
|
+
| variant | flexible | Choose the variant that matches the semantic meaning of the operation |
|
|
84
|
+
| token names | strict | Colors must resolve to --cascivo-\* tokens |
|
|
85
|
+
|
|
86
|
+
## AI context prompt
|
|
87
|
+
|
|
88
|
+
Copy this into an LLM context bar before editing this component:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
I am modifying the cascivo Progress component (feedback). Horizontal bar showing the completion progress of a tracked operation
|
|
92
|
+
|
|
93
|
+
Architecture constraints — follow exactly:
|
|
94
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
95
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
96
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
97
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
98
|
+
- CSS logical properties only (RTL-safe).
|
|
99
|
+
|
|
100
|
+
Progress is strictly bound to these tokens — use only these, do not invent token names:
|
|
101
|
+
--cascivo-color-surface-2, --cascivo-color-primary, --cascivo-color-info, --cascivo-color-success, --cascivo-color-warning, --cascivo-color-error, --cascivo-color-accent, --cascivo-radius-full, --cascivo-ease-out
|
|
102
|
+
|
|
103
|
+
Accessibility: role "progressbar", WCAG 2.2-AA. Keep it AA.
|
|
104
|
+
|
|
105
|
+
Do not change (strict): token names — Colors must resolve to --cascivo-* tokens
|
|
106
|
+
Flexible: variant.
|
|
107
|
+
|
|
108
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
109
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Prose
|
|
2
|
+
|
|
3
|
+
**Category:** display
|
|
4
|
+
**Description:** Wrapper that styles raw descendant HTML — headings, lists, code, quotes, tables
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Styling long-form authored content (articles, docs, CMS output)
|
|
9
|
+
- Applying readable typography to raw HTML you do not control (markdown pipelines)
|
|
10
|
+
- Getting consistent spacing for headings, lists, code, and quotes in one wrapper
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Single typographic elements in app UI — use Heading, Text, or List directly
|
|
15
|
+
- Interactive component layouts — Prose only styles flow content
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Prose restyles all descendant HTML, which clobbers component styling and intent
|
|
20
|
+
|
|
21
|
+
**Bad:** `Wrapping app UI (buttons, forms) in <Prose> for spacing`
|
|
22
|
+
**Good:** `Use layout primitives; reserve Prose for authored document content`
|
|
23
|
+
**Why:** Prose restyles all descendant HTML, which clobbers component styling and intent
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Heading** (alternative): Use Heading/Text directly in app UI; Prose handles authored content
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
Adds no roles of its own — it styles descendant native elements, so the document semantics of the underlying HTML (headings, lists, code) are preserved for assistive tech
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| ------------------------- | -------------------- | -------- | ------- | --------------------------------------------------------------------------- |
|
|
37
|
+
| `children` | `React.ReactNode` | No | — | Authored flow content (headings, paragraphs, lists, code, tables) to style. |
|
|
38
|
+
| `dangerouslySetInnerHTML` | `{ __html: string }` | No | — | Rendered HTML you do not control (CMS, markdown pipelines). Sanitize first. |
|
|
39
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
40
|
+
|
|
41
|
+
## Tokens
|
|
42
|
+
|
|
43
|
+
- `--cascivo-font-sans`
|
|
44
|
+
- `--cascivo-font-mono`
|
|
45
|
+
- `--cascivo-font-semibold`
|
|
46
|
+
- `--cascivo-leading-tight`
|
|
47
|
+
- `--cascivo-leading-relaxed`
|
|
48
|
+
- `--cascivo-tracking-tight`
|
|
49
|
+
- `--cascivo-color-text`
|
|
50
|
+
- `--cascivo-color-text-subtle`
|
|
51
|
+
- `--cascivo-color-accent`
|
|
52
|
+
- `--cascivo-color-accent-hover`
|
|
53
|
+
- `--cascivo-color-surface`
|
|
54
|
+
- `--cascivo-color-border`
|
|
55
|
+
- `--cascivo-color-border-strong`
|
|
56
|
+
- `--cascivo-radius-indicator`
|
|
57
|
+
- `--cascivo-radius-surface`
|
|
58
|
+
|
|
59
|
+
## Examples
|
|
60
|
+
|
|
61
|
+
### Authored content
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
<Prose>
|
|
65
|
+
<h2>Install</h2>
|
|
66
|
+
<p>
|
|
67
|
+
Run <code>npx cascivo init</code>.
|
|
68
|
+
</p>
|
|
69
|
+
</Prose>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Rendered markdown
|
|
73
|
+
|
|
74
|
+
The use case: HTML you do not control (CMS, markdown pipelines)
|
|
75
|
+
|
|
76
|
+
```jsx
|
|
77
|
+
<Prose dangerouslySetInnerHTML={{ __html: html }} />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Boundaries
|
|
81
|
+
|
|
82
|
+
| Area | Level | Note |
|
|
83
|
+
| ----------- | -------- | ------------------------------------------------------------------ |
|
|
84
|
+
| source HTML | flexible | Accepts authored children or rendered markup |
|
|
85
|
+
| token names | strict | All typography and surface styling resolves to --cascivo-\* tokens |
|
|
86
|
+
|
|
87
|
+
## AI context prompt
|
|
88
|
+
|
|
89
|
+
Copy this into an LLM context bar before editing this component:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
I am modifying the cascivo Prose component (display). Wrapper that styles raw descendant HTML — headings, lists, code, quotes, tables
|
|
93
|
+
|
|
94
|
+
Architecture constraints — follow exactly:
|
|
95
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
96
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
97
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
98
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
99
|
+
- CSS logical properties only (RTL-safe).
|
|
100
|
+
|
|
101
|
+
Prose is strictly bound to these tokens — use only these, do not invent token names:
|
|
102
|
+
--cascivo-font-sans, --cascivo-font-mono, --cascivo-font-semibold, --cascivo-leading-tight, --cascivo-leading-relaxed, --cascivo-tracking-tight, --cascivo-color-text, --cascivo-color-text-subtle, --cascivo-color-accent, --cascivo-color-accent-hover, --cascivo-color-surface, --cascivo-color-border, --cascivo-color-border-strong, --cascivo-radius-indicator, --cascivo-radius-surface
|
|
103
|
+
|
|
104
|
+
Accessibility: role "generic", WCAG 2.2-AA. Keep it AA.
|
|
105
|
+
|
|
106
|
+
Do not change (strict): token names — All typography and surface styling resolves to --cascivo-* tokens
|
|
107
|
+
Flexible: source HTML.
|
|
108
|
+
|
|
109
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
110
|
+
```
|