@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,116 @@
|
|
|
1
|
+
# Notification
|
|
2
|
+
|
|
3
|
+
**Category:** feedback
|
|
4
|
+
**Description:** Inline, actionable notification banner that surfaces a titled message with an optional recovery action
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Surfacing a prominent, often actionable message in the page flow (sync result, failed upload, available update)
|
|
9
|
+
- Pairing a status message with one or more recovery actions via the actions slot
|
|
10
|
+
- Communicating outcomes that should persist until the user reads or acts on them
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Transient, auto-dismissing feedback that floats above the layout — use Toast
|
|
15
|
+
- A terse single-line action status next to a control — use InlineLoading
|
|
16
|
+
- Blocking the user for a required decision — use Modal or AlertDialog
|
|
17
|
+
|
|
18
|
+
## Anti-patterns
|
|
19
|
+
|
|
20
|
+
### Notification is an in-flow banner; faking toast behavior duplicates Toast and breaks layout expectations
|
|
21
|
+
|
|
22
|
+
**Bad:** `Stacking Notifications in a fixed corner viewport on a timer to fake toasts`
|
|
23
|
+
**Good:** `<Toast> for ephemeral, floating, auto-dismissing feedback`
|
|
24
|
+
**Why:** Notification is an in-flow banner; faking toast behavior duplicates Toast and breaks layout expectations
|
|
25
|
+
|
|
26
|
+
## Related components
|
|
27
|
+
|
|
28
|
+
- **Toast** (alternative): Toast floats and auto-dismisses; Notification stays inline in the document flow
|
|
29
|
+
- **Alert** (alternative): Alert is a lighter inline message; Notification leans into a leading variant icon and an actions slot
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
role="alert" for warning and error so assistive tech announces them assertively, role="status" for info and success; the variant icon is decorative (aria-hidden) and color is always paired with the icon and title, and the dismiss control is a labeled button
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ------------- | --------------------------------------------- | -------- | ------- | ---------------------------------------------------------- |
|
|
39
|
+
| `title` | `ReactNode` | Yes | — | Title text for the component. |
|
|
40
|
+
| `description` | `ReactNode` | No | — | Supporting description text. |
|
|
41
|
+
| `variant` | `'info' \| 'success' \| 'warning' \| 'error'` | No | info | Selects the visual style variant. |
|
|
42
|
+
| `dismissible` | `boolean` | No | false | When true, shows a control to dismiss the component. |
|
|
43
|
+
| `onDismiss` | `() => void` | No | — | Called when the component is dismissed. |
|
|
44
|
+
| `actions` | `ReactNode` | No | — | Action elements shown in the notification. |
|
|
45
|
+
| `icon` | `ReactNode` | No | — | Icon element rendered in the component. |
|
|
46
|
+
| `labels` | `{ dismiss?: string }` | No | — | Overrides for the component’s user-visible strings (i18n). |
|
|
47
|
+
|
|
48
|
+
## Tokens
|
|
49
|
+
|
|
50
|
+
- `--cascivo-color-info`
|
|
51
|
+
- `--cascivo-color-success`
|
|
52
|
+
- `--cascivo-color-warning`
|
|
53
|
+
- `--cascivo-color-destructive`
|
|
54
|
+
- `--cascivo-color-border`
|
|
55
|
+
- `--cascivo-color-surface`
|
|
56
|
+
- `--cascivo-radius-surface`
|
|
57
|
+
- `--cascivo-motion-enter`
|
|
58
|
+
- `--cascivo-motion-exit`
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Info
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
<Notification variant="info" title="Sync complete" description="Your files are up to date." />
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Dismissible
|
|
69
|
+
|
|
70
|
+
```jsx
|
|
71
|
+
<Notification variant="success" title="Saved" dismissible onDismiss={handleDismiss} />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Actionable
|
|
75
|
+
|
|
76
|
+
```jsx
|
|
77
|
+
<Notification
|
|
78
|
+
variant="error"
|
|
79
|
+
title="Upload failed"
|
|
80
|
+
description="The connection dropped."
|
|
81
|
+
actions={<Button onClick={retry}>Retry</Button>}
|
|
82
|
+
/>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Boundaries
|
|
86
|
+
|
|
87
|
+
| Area | Level | Note |
|
|
88
|
+
| ------------ | -------- | ------------------------------------------------------------------------------ |
|
|
89
|
+
| icon | flexible | A variant-appropriate icon is supplied by default; override with the icon prop |
|
|
90
|
+
| actions | flexible | Any ReactNode (typically Buttons) can fill the actions slot |
|
|
91
|
+
| role mapping | strict | warning/error must use role="alert"; info/success use role="status" |
|
|
92
|
+
|
|
93
|
+
## AI context prompt
|
|
94
|
+
|
|
95
|
+
Copy this into an LLM context bar before editing this component:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
I am modifying the cascivo Notification component (feedback). Inline, actionable notification banner that surfaces a titled message with an optional recovery action
|
|
99
|
+
|
|
100
|
+
Architecture constraints — follow exactly:
|
|
101
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
102
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
103
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
104
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
105
|
+
- CSS logical properties only (RTL-safe).
|
|
106
|
+
|
|
107
|
+
Notification is strictly bound to these tokens — use only these, do not invent token names:
|
|
108
|
+
--cascivo-color-info, --cascivo-color-success, --cascivo-color-warning, --cascivo-color-destructive, --cascivo-color-border, --cascivo-color-surface, --cascivo-radius-surface, --cascivo-motion-enter, --cascivo-motion-exit
|
|
109
|
+
|
|
110
|
+
Accessibility: role "alert", WCAG 2.2-AA. Keep it AA.
|
|
111
|
+
|
|
112
|
+
Do not change (strict): role mapping — warning/error must use role="alert"; info/success use role="status"
|
|
113
|
+
Flexible: icon, actions.
|
|
114
|
+
|
|
115
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
116
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# NumberInput
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Description:** Numeric input with stepper buttons, clamping, precision, and locale formatting
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Collecting a bounded numeric value where increment/decrement by a known step is natural (quantity, opacity, count)
|
|
9
|
+
- Numeric entry that needs clamping to min/max, fixed precision, or locale-aware display formatting (e.g. currency)
|
|
10
|
+
- Inputs where keyboard ArrowUp/ArrowDown stepping speeds up adjustment
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Free-form or non-numeric text — use Input
|
|
15
|
+
- Choosing along a continuous range where the exact number matters less than the relative position — use Slider
|
|
16
|
+
- Phone numbers, PINs, or codes that are digit strings rather than quantities — use Input or OtpInput
|
|
17
|
+
|
|
18
|
+
## Anti-patterns
|
|
19
|
+
|
|
20
|
+
### NumberInput adds stepper buttons, clamping, precision rounding, and Intl formatting that a raw number input does not, and reports a parsed number | null rather than a string
|
|
21
|
+
|
|
22
|
+
**Bad:** `<Input type="number" onChange={...} />`
|
|
23
|
+
**Good:** `<NumberInput min={0} max={99} step={1} onChange={...} />`
|
|
24
|
+
**Why:** NumberInput adds stepper buttons, clamping, precision rounding, and Intl formatting that a raw number input does not, and reports a parsed number | null rather than a string
|
|
25
|
+
|
|
26
|
+
## Related components
|
|
27
|
+
|
|
28
|
+
- **Input** (alternative): Use for unbounded or non-numeric text entry
|
|
29
|
+
- **Slider** (alternative): Use when approximate position on a range matters more than an exact typed number
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
Exposes role="spinbutton" with aria-valuenow/min/max so assistive tech announces the current value and bounds; stepper buttons are taken out of the tab order (tabIndex=-1) and labeled, keeping keyboard focus on the field while ArrowUp/ArrowDown drive stepping.
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ---------------- | --------------------------------- | -------- | --------- | ----------------------------------------------------------------------- |
|
|
39
|
+
| `value` | `number \| null` | No | — | The controlled value. |
|
|
40
|
+
| `defaultValue` | `number` | No | — | The initial value when uncontrolled. |
|
|
41
|
+
| `onChange` | `(value: number \| null) => void` | No | — | Fired on commit (blur, Enter, stepping); null when empty or unparseable |
|
|
42
|
+
| `min` | `number` | No | — | Minimum allowed value. |
|
|
43
|
+
| `max` | `number` | No | — | Maximum allowed value. |
|
|
44
|
+
| `step` | `number` | No | 1 | Increment between allowed values. |
|
|
45
|
+
| `precision` | `number` | No | — | Decimal places applied on commit |
|
|
46
|
+
| `formatOptions` | `Intl.NumberFormatOptions` | No | — | Display formatting applied on blur; raw editable string while focused |
|
|
47
|
+
| `label` | `string` | No | — | Text label for the control. |
|
|
48
|
+
| `hint` | `string` | No | — | Supplementary hint text shown with the control. |
|
|
49
|
+
| `error` | `string` | No | — | Error message shown when the value is invalid. |
|
|
50
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
51
|
+
| `disabled` | `boolean` | No | false | When true, disables the control and removes it from the tab order. |
|
|
52
|
+
| `incrementLabel` | `string` | No | Increment | Accessible label for the increment button. |
|
|
53
|
+
| `decrementLabel` | `string` | No | Decrement | Accessible label for the decrement button. |
|
|
54
|
+
|
|
55
|
+
## Tokens
|
|
56
|
+
|
|
57
|
+
- `--cascivo-color-surface`
|
|
58
|
+
- `--cascivo-color-border`
|
|
59
|
+
- `--cascivo-color-accent`
|
|
60
|
+
- `--cascivo-color-destructive`
|
|
61
|
+
- `--cascivo-color-bg-subtle`
|
|
62
|
+
- `--cascivo-color-text-subtle`
|
|
63
|
+
- `--cascivo-radius-input`
|
|
64
|
+
- `--cascivo-focus-ring`
|
|
65
|
+
|
|
66
|
+
## Examples
|
|
67
|
+
|
|
68
|
+
### Basic
|
|
69
|
+
|
|
70
|
+
```jsx
|
|
71
|
+
<NumberInput label="Quantity" defaultValue={1} min={0} max={99} />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Currency
|
|
75
|
+
|
|
76
|
+
```jsx
|
|
77
|
+
<NumberInput label="Price" precision={2} formatOptions={{ style: 'currency', currency: 'USD' }} />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Stepped
|
|
81
|
+
|
|
82
|
+
```jsx
|
|
83
|
+
<NumberInput label="Opacity" min={0} max={1} step={0.1} />
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Boundaries
|
|
87
|
+
|
|
88
|
+
| Area | Level | Note |
|
|
89
|
+
| --------------------- | -------- | ------------------------------------------------------------------------------ |
|
|
90
|
+
| token names | strict | Visual props must resolve to the listed --cascivo-\* semantic tokens |
|
|
91
|
+
| formatting and bounds | flexible | min, max, step, precision, and formatOptions are free to suit the value domain |
|
|
92
|
+
| stepper labels | flexible | incrementLabel/decrementLabel override the i18n defaults |
|
|
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 NumberInput component (inputs). Numeric input with stepper buttons, clamping, precision, and locale formatting
|
|
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
|
+
NumberInput is strictly bound to these tokens — use only these, do not invent token names:
|
|
109
|
+
--cascivo-color-surface, --cascivo-color-border, --cascivo-color-accent, --cascivo-color-destructive, --cascivo-color-bg-subtle, --cascivo-color-text-subtle, --cascivo-radius-input, --cascivo-focus-ring
|
|
110
|
+
|
|
111
|
+
Accessibility: role "spinbutton", WCAG 2.2-AA, keyboard: ArrowUp/ArrowDown/Enter/Tab. Keep it AA.
|
|
112
|
+
|
|
113
|
+
Do not change (strict): token names — Visual props must resolve to the listed --cascivo-* semantic tokens
|
|
114
|
+
Flexible: formatting and bounds, stepper labels.
|
|
115
|
+
|
|
116
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
117
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# OtpInput
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Description:** Segmented one-time code input
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Entering a fixed-length one-time code (2FA, SMS verification, email confirmation) split across per-character slots
|
|
9
|
+
- Codes that benefit from auto-advance between slots and pasting the full code at once
|
|
10
|
+
- Numeric or alphanumeric short codes of a known length
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Variable-length or free-form text — use Input
|
|
15
|
+
- Secret credentials that should be masked — use PasswordInput
|
|
16
|
+
- Long codes where per-character boxes add no value over a single field — use Input
|
|
17
|
+
|
|
18
|
+
## Anti-patterns
|
|
19
|
+
|
|
20
|
+
### OtpInput gives per-digit slots with auto-advance, backspace-to-previous, full-code paste handling, and autoComplete="one-time-code" that a single Input does not
|
|
21
|
+
|
|
22
|
+
**Bad:** `<Input maxLength={6} placeholder="Enter code" />`
|
|
23
|
+
**Good:** `<OtpInput length={6} value={code} onValueChange={setCode} />`
|
|
24
|
+
**Why:** OtpInput gives per-digit slots with auto-advance, backspace-to-previous, full-code paste handling, and autoComplete="one-time-code" that a single Input does not
|
|
25
|
+
|
|
26
|
+
## Related components
|
|
27
|
+
|
|
28
|
+
- **Input** (alternative): Use for variable-length or non-code text entry
|
|
29
|
+
- **PasswordInput** (alternative): Use when the entered value is a secret that must be masked
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
Wraps the slots in role="group" with a localized aria-label and labels each slot with its position so screen readers announce which digit is being entered; the first slot carries autoComplete="one-time-code" so platform SMS autofill can populate the code.
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| --------------- | ----------------------------- | -------- | ------- | ------------------------------------------------------------------ |
|
|
39
|
+
| `length` | `number` | No | 6 | Number of input cells. |
|
|
40
|
+
| `value` | `string` | Yes | — | The controlled value. |
|
|
41
|
+
| `onValueChange` | `(v: string) => void` | Yes | — | Called with the new value when it changes. |
|
|
42
|
+
| `disabled` | `boolean` | No | false | When true, disables the control and removes it from the tab order. |
|
|
43
|
+
| `type` | `'numeric' \| 'alphanumeric'` | No | numeric | Accepted characters ('numeric' \| 'alphanumeric'). |
|
|
44
|
+
|
|
45
|
+
## Tokens
|
|
46
|
+
|
|
47
|
+
- `--cascivo-color-surface`
|
|
48
|
+
- `--cascivo-color-border`
|
|
49
|
+
- `--cascivo-color-accent`
|
|
50
|
+
- `--cascivo-color-bg-subtle`
|
|
51
|
+
- `--cascivo-radius-input`
|
|
52
|
+
- `--cascivo-focus-ring`
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
### Basic
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
<OtpInput value="" onValueChange={() => {}} />
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 4-digit
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
<OtpInput length={4} value="" onValueChange={() => {}} />
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Boundaries
|
|
69
|
+
|
|
70
|
+
| Area | Level | Note |
|
|
71
|
+
| --------------- | -------- | ----------------------------------------------------------------------------- |
|
|
72
|
+
| token names | strict | Slot styling must resolve to the listed --cascivo-\* tokens |
|
|
73
|
+
| length and type | flexible | length and numeric/alphanumeric type are free to match the issued code format |
|
|
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 OtpInput component (inputs). Segmented one-time code input
|
|
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
|
+
OtpInput is strictly bound to these tokens — use only these, do not invent token names:
|
|
90
|
+
--cascivo-color-surface, --cascivo-color-border, --cascivo-color-accent, --cascivo-color-bg-subtle, --cascivo-radius-input, --cascivo-focus-ring
|
|
91
|
+
|
|
92
|
+
Accessibility: role "group", WCAG 2.2-AA, keyboard: ArrowLeft/ArrowRight/Backspace. Keep it AA.
|
|
93
|
+
|
|
94
|
+
Do not change (strict): token names — Slot styling must resolve to the listed --cascivo-* tokens
|
|
95
|
+
Flexible: length and type.
|
|
96
|
+
|
|
97
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
98
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# OverflowMenu
|
|
2
|
+
|
|
3
|
+
**Category:** overlay
|
|
4
|
+
**Description:** Kebab icon button revealing a menu of row-level actions
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Collapsing secondary row-level or item-level actions behind a kebab trigger in dense layouts like tables and lists
|
|
9
|
+
- Offering a small set of actions where a destructive option needs visual distinction
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- A primary action that should always be visible — use Button
|
|
14
|
+
- Selecting a single value from a set rather than triggering actions — use Select or Dropdown
|
|
15
|
+
- New code — this component is deprecated in favor of Menu
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### A kebab menu keeps dense rows scannable; surfacing every action inline competes for attention and breaks alignment
|
|
20
|
+
|
|
21
|
+
**Bad:** `Rendering every row action as a visible Button in a crowded table`
|
|
22
|
+
**Good:** `<OverflowMenu items={[{ label: "Edit", value: "edit" }, { label: "Delete", value: "delete", destructive: true }]} onSelect={handle} />`
|
|
23
|
+
**Why:** A kebab menu keeps dense rows scannable; surfacing every action inline competes for attention and breaks alignment
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **Menu** (alternative): Preferred replacement; OverflowMenu is deprecated and delegates to Dropdown internally
|
|
28
|
+
- **Dropdown** (contains): OverflowMenu is a kebab-triggered wrapper around Dropdown
|
|
29
|
+
- **Button** (alternative): Use for a single always-visible action instead of hiding it in a menu
|
|
30
|
+
|
|
31
|
+
## Accessibility rationale
|
|
32
|
+
|
|
33
|
+
The kebab trigger carries a localized aria-label since it has no visible text, and the revealed list uses Dropdown's menu semantics so arrow keys, Home/End, Enter/Space, and Escape work without custom handling.
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
| Name | Type | Required | Default | Description |
|
|
38
|
+
| ----------- | ------------------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------ |
|
|
39
|
+
| `items` | `{ label: string; value: string; icon?: ReactNode; disabled?: boolean; destructive?: boolean }[]` | Yes | — | The items to render. |
|
|
40
|
+
| `onSelect` | `(value: string) => void` | No | — | Called with the selected value. |
|
|
41
|
+
| `placement` | `'bottom-start' \| 'bottom-end'` | No | bottom-end | Placement relative to the trigger. |
|
|
42
|
+
| `ariaLabel` | `string` | No | More actions | Accessible label for the component. |
|
|
43
|
+
| `size` | `'sm' \| 'md'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
44
|
+
| `disabled` | `boolean` | No | false | When true, disables the control and removes it from the tab order. |
|
|
45
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
46
|
+
|
|
47
|
+
## Tokens
|
|
48
|
+
|
|
49
|
+
- `--cascivo-color-text`
|
|
50
|
+
- `--cascivo-color-text-muted`
|
|
51
|
+
- `--cascivo-color-bg-subtle`
|
|
52
|
+
- `--cascivo-color-destructive`
|
|
53
|
+
- `--cascivo-color-destructive-subtle`
|
|
54
|
+
- `--cascivo-radius-button`
|
|
55
|
+
- `--cascivo-focus-ring`
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
### Row actions
|
|
60
|
+
|
|
61
|
+
```jsx
|
|
62
|
+
<OverflowMenu
|
|
63
|
+
items={[
|
|
64
|
+
{ label: 'Edit', value: 'edit' },
|
|
65
|
+
{ label: 'Delete', value: 'delete', destructive: true },
|
|
66
|
+
]}
|
|
67
|
+
onSelect={handle}
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Small, start-aligned
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
<OverflowMenu size="sm" placement="bottom-start" items={items} />
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Boundaries
|
|
78
|
+
|
|
79
|
+
| Area | Level | Note |
|
|
80
|
+
| ------------------- | -------- | ----------------------------------------------------------------------- |
|
|
81
|
+
| token names | strict | Trigger and item styling must resolve to the listed --cascivo-\* tokens |
|
|
82
|
+
| item set and labels | flexible | items, ariaLabel, and placement are free to suit the context |
|
|
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 OverflowMenu component (overlay). Kebab icon button revealing a menu of row-level actions
|
|
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
|
+
OverflowMenu is strictly bound to these tokens — use only these, do not invent token names:
|
|
99
|
+
--cascivo-color-text, --cascivo-color-text-muted, --cascivo-color-bg-subtle, --cascivo-color-destructive, --cascivo-color-destructive-subtle, --cascivo-radius-button, --cascivo-focus-ring
|
|
100
|
+
|
|
101
|
+
Accessibility: role "menu", WCAG 2.2-AA, keyboard: ArrowDown/ArrowUp/Home/End/Enter/Space/Escape. Keep it AA.
|
|
102
|
+
|
|
103
|
+
Do not change (strict): token names — Trigger and item styling must resolve to the listed --cascivo-* tokens
|
|
104
|
+
Flexible: item set and labels.
|
|
105
|
+
|
|
106
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
107
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
**Category:** navigation
|
|
4
|
+
**Description:** Controls for navigating paged data sets, with page size selection
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Navigating between pages of a paged dataset
|
|
9
|
+
- Letting the user change how many items appear per page (onPageSizeChange)
|
|
10
|
+
- Pairing with a table or list that loads data in chunks
|
|
11
|
+
|
|
12
|
+
## When NOT to use
|
|
13
|
+
|
|
14
|
+
- Navigating a content hierarchy — use Breadcrumb
|
|
15
|
+
- Infinite scroll experiences where pages are not exposed
|
|
16
|
+
|
|
17
|
+
## Anti-patterns
|
|
18
|
+
|
|
19
|
+
### Pagination semantics imply sequential pages of one dataset, not arbitrary navigation
|
|
20
|
+
|
|
21
|
+
**Bad:** `Using Pagination to navigate between unrelated app sections`
|
|
22
|
+
**Good:** `<Tabs> or nav links for section switching`
|
|
23
|
+
**Why:** Pagination semantics imply sequential pages of one dataset, not arbitrary navigation
|
|
24
|
+
|
|
25
|
+
## Related components
|
|
26
|
+
|
|
27
|
+
- **DataTable** (pairs-with): DataTable embeds Pagination for its rows
|
|
28
|
+
- **Breadcrumb** (alternative): Breadcrumb is for hierarchy, Pagination for sequential pages
|
|
29
|
+
|
|
30
|
+
## Accessibility rationale
|
|
31
|
+
|
|
32
|
+
Wrapped in <nav> with an accessible label; page controls are real buttons with current-page state exposed, and all visible/assistive strings are overridable via labels for i18n
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
| Name | Type | Required | Default | Description |
|
|
37
|
+
| ------------------ | ------------------------ | -------- | ----------------- | --------------------------------------------------------------- |
|
|
38
|
+
| `page` | `number` | Yes | — | Current page (1-based) |
|
|
39
|
+
| `pageSize` | `number` | Yes | — | Items per page |
|
|
40
|
+
| `totalItems` | `number` | Yes | — | Total number of items |
|
|
41
|
+
| `onPageChange` | `(page: number) => void` | Yes | — | Called with the new page number when it changes. |
|
|
42
|
+
| `onPageSizeChange` | `(size: number) => void` | No | — | Called with the new page size when it changes. |
|
|
43
|
+
| `pageSizeOptions` | `number[]` | No | [10, 25, 50, 100] | Options for the page size select |
|
|
44
|
+
| `labels` | `PaginationLabels` | No | — | Overridable English strings for all visible and accessible text |
|
|
45
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
46
|
+
|
|
47
|
+
## Tokens
|
|
48
|
+
|
|
49
|
+
- `--cascivo-color-text`
|
|
50
|
+
- `--cascivo-color-text-muted`
|
|
51
|
+
- `--cascivo-color-surface`
|
|
52
|
+
- `--cascivo-color-border`
|
|
53
|
+
- `--cascivo-color-border-strong`
|
|
54
|
+
- `--cascivo-color-bg-subtle`
|
|
55
|
+
- `--cascivo-color-accent`
|
|
56
|
+
- `--cascivo-color-accent-subtle`
|
|
57
|
+
- `--cascivo-radius-input`
|
|
58
|
+
- `--cascivo-radius-button`
|
|
59
|
+
- `--cascivo-focus-ring`
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Basic
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
<Pagination page={1} pageSize={25} totalItems={103} onPageChange={setPage} />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With page size select
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
<Pagination
|
|
73
|
+
page={page}
|
|
74
|
+
pageSize={size}
|
|
75
|
+
totalItems={103}
|
|
76
|
+
onPageChange={setPage}
|
|
77
|
+
onPageSizeChange={setSize}
|
|
78
|
+
/>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Custom labels
|
|
82
|
+
|
|
83
|
+
```jsx
|
|
84
|
+
<Pagination
|
|
85
|
+
page={1}
|
|
86
|
+
pageSize={10}
|
|
87
|
+
totalItems={42}
|
|
88
|
+
onPageChange={setPage}
|
|
89
|
+
labels={{ previous: 'Zurück', next: 'Weiter' }}
|
|
90
|
+
/>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Boundaries
|
|
94
|
+
|
|
95
|
+
| Area | Level | Note |
|
|
96
|
+
| ----------------- | -------- | ----------------------------------------------------------------- |
|
|
97
|
+
| page size options | flexible | pageSizeOptions and the size select are optional |
|
|
98
|
+
| token names | strict | Surfaces, borders, and accent must resolve to --cascivo-\* tokens |
|
|
99
|
+
|
|
100
|
+
## AI context prompt
|
|
101
|
+
|
|
102
|
+
Copy this into an LLM context bar before editing this component:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
I am modifying the cascivo Pagination component (navigation). Controls for navigating paged data sets, with page size selection
|
|
106
|
+
|
|
107
|
+
Architecture constraints — follow exactly:
|
|
108
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
109
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
110
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
111
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
112
|
+
- CSS logical properties only (RTL-safe).
|
|
113
|
+
|
|
114
|
+
Pagination is strictly bound to these tokens — use only these, do not invent token names:
|
|
115
|
+
--cascivo-color-text, --cascivo-color-text-muted, --cascivo-color-surface, --cascivo-color-border, --cascivo-color-border-strong, --cascivo-color-bg-subtle, --cascivo-color-accent, --cascivo-color-accent-subtle, --cascivo-radius-input, --cascivo-radius-button, --cascivo-focus-ring
|
|
116
|
+
|
|
117
|
+
Accessibility: role "navigation", WCAG 2.2-AA, keyboard: Tab/Enter/Space/ArrowUp/ArrowDown. Keep it AA.
|
|
118
|
+
|
|
119
|
+
Do not change (strict): token names — Surfaces, borders, and accent must resolve to --cascivo-* tokens
|
|
120
|
+
Flexible: page size options.
|
|
121
|
+
|
|
122
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
123
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# PasswordInput
|
|
2
|
+
|
|
3
|
+
**Category:** inputs
|
|
4
|
+
**Description:** Password input with reveal toggle and optional strength meter
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Collecting a secret credential that should be masked by default with an opt-in reveal toggle
|
|
9
|
+
- Password creation flows that benefit from inline strength feedback
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Non-secret text — use Input
|
|
14
|
+
- A fixed-length one-time verification code — use OtpInput
|
|
15
|
+
|
|
16
|
+
## Anti-patterns
|
|
17
|
+
|
|
18
|
+
### PasswordInput adds an accessible reveal/hide toggle and an optional strength meter on top of the masked field, which a raw password input lacks
|
|
19
|
+
|
|
20
|
+
**Bad:** `<Input type="password" />`
|
|
21
|
+
**Good:** `<PasswordInput showStrengthMeter />`
|
|
22
|
+
**Why:** PasswordInput adds an accessible reveal/hide toggle and an optional strength meter on top of the masked field, which a raw password input lacks
|
|
23
|
+
|
|
24
|
+
## Related components
|
|
25
|
+
|
|
26
|
+
- **Input** (alternative): Use for non-secret text that never needs masking
|
|
27
|
+
- **OtpInput** (alternative): Use for fixed-length one-time codes rather than passwords
|
|
28
|
+
|
|
29
|
+
## Accessibility rationale
|
|
30
|
+
|
|
31
|
+
The reveal control is a real <button> whose aria-label switches between reveal/hide so screen-reader users know the current masking state; toggling swaps the input type between password and text so the platform handles masking natively.
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Name | Type | Required | Default | Description |
|
|
36
|
+
| ------------------- | -------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------ |
|
|
37
|
+
| `showStrengthMeter` | `boolean` | No | false | When true, shows a password-strength meter. |
|
|
38
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | No | md | Visual size of the component (e.g. 'sm', 'md', 'lg'). |
|
|
39
|
+
| `labels` | `PasswordInputLabels` | No | — | Overrides for the component’s user-visible strings (i18n). |
|
|
40
|
+
| `disabled` | `boolean` | No | false | When true, disables the control and removes it from the tab order. |
|
|
41
|
+
| `placeholder` | `string` | No | — | Placeholder text shown when the field is empty. |
|
|
42
|
+
| `value` | `string` | No | — | The controlled value. |
|
|
43
|
+
| `onChange` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | No | — | Called when the value changes. |
|
|
44
|
+
|
|
45
|
+
## Tokens
|
|
46
|
+
|
|
47
|
+
- `--cascivo-color-surface`
|
|
48
|
+
- `--cascivo-color-border`
|
|
49
|
+
- `--cascivo-color-accent`
|
|
50
|
+
- `--cascivo-color-destructive`
|
|
51
|
+
- `--cascivo-color-warning`
|
|
52
|
+
- `--cascivo-color-success`
|
|
53
|
+
- `--cascivo-radius-input`
|
|
54
|
+
- `--cascivo-focus-ring`
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
### Basic
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
<PasswordInput placeholder="Enter password" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### With strength meter
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
<PasswordInput showStrengthMeter placeholder="Create password" />
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Boundaries
|
|
71
|
+
|
|
72
|
+
| Area | Level | Note |
|
|
73
|
+
| ----------- | -------- | ---------------------------------------------------------------------------------------- |
|
|
74
|
+
| token names | strict | Field, toggle, and strength-meter styling must resolve to the listed --cascivo-\* tokens |
|
|
75
|
+
| labels | flexible | reveal, hide, and strengthLabel can be overridden via the labels prop |
|
|
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 PasswordInput component (inputs). Password input with reveal toggle and optional strength meter
|
|
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
|
+
PasswordInput is strictly bound to these tokens — use only these, do not invent token names:
|
|
92
|
+
--cascivo-color-surface, --cascivo-color-border, --cascivo-color-accent, --cascivo-color-destructive, --cascivo-color-warning, --cascivo-color-success, --cascivo-radius-input, --cascivo-focus-ring
|
|
93
|
+
|
|
94
|
+
Accessibility: role "textbox", WCAG 2.2-AA, keyboard: Tab/Shift+Tab. Keep it AA.
|
|
95
|
+
|
|
96
|
+
Do not change (strict): token names — Field, toggle, and strength-meter styling must resolve to the listed --cascivo-* tokens
|
|
97
|
+
Flexible: labels.
|
|
98
|
+
|
|
99
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
100
|
+
```
|