@cascivo/mcp 0.1.8 → 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 -22
- 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 +5 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +374 -64
- package/dist/index.mjs.map +1 -1
- package/dist/marketplace.json +70 -0
- package/dist/registry.json +5622 -786
- package/dist/tokens.catalog.json +2375 -0
- package/dist/tokens.variants.json +3291 -0
- package/package.json +4 -3
- package/readme.body.md +53 -22
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Funnel
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** Vertical conversion funnel — each stage is a trapezoid narrowing toward the next, with optional conversion labels.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing drop-off across the ordered stages of a process (signup, checkout)
|
|
9
|
+
- Communicating stage-to-stage conversion at a glance
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Stages are not strictly decreasing — use BarChart
|
|
14
|
+
- Showing a trend over time — use LineChart
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **BarChart** (alternative): Use when stages aren’t monotonically decreasing
|
|
19
|
+
|
|
20
|
+
## Accessibility rationale
|
|
21
|
+
|
|
22
|
+
Renders with role="img" and requires a title prop for screen reader labeling.
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Name | Type | Required | Default | Description |
|
|
27
|
+
| ---------------- | --------------- | -------- | ------- | ---------------------------------------------------------- |
|
|
28
|
+
| `data` | `FunnelStage[]` | Yes | — | Ordered stages (descending): { id, label, value, color? }. |
|
|
29
|
+
| `title` | `string` | Yes | — | Chart title (also used as aria-label). |
|
|
30
|
+
| `description` | `string` | No | — | Subtitle below the title. |
|
|
31
|
+
| `width` | `number` | No | — | Width of the component. |
|
|
32
|
+
| `height` | `number` | No | 320 | Height of the component. |
|
|
33
|
+
| `showConversion` | `boolean` | No | false | Append each stage’s % of the first stage to its label. |
|
|
34
|
+
| `tooltip` | `boolean` | No | — | Enable hover tooltip. |
|
|
35
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
36
|
+
| `plain` | `boolean` | No | false | Marks only — no labels. For micro/inline charts. |
|
|
37
|
+
|
|
38
|
+
## Tokens
|
|
39
|
+
|
|
40
|
+
- `--cascivo-chart-1`
|
|
41
|
+
- `--cascivo-chart-2`
|
|
42
|
+
- `--cascivo-chart-3`
|
|
43
|
+
- `--cascivo-chart-4`
|
|
44
|
+
- `--cascivo-chart-5`
|
|
45
|
+
- `--cascivo-chart-6`
|
|
46
|
+
- `--cascivo-chart-7`
|
|
47
|
+
- `--cascivo-chart-8`
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### Signup conversion funnel
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
import { Funnel } from '@cascivo/charts'
|
|
55
|
+
;<Funnel
|
|
56
|
+
title="Signup funnel"
|
|
57
|
+
showConversion
|
|
58
|
+
data={[
|
|
59
|
+
{ id: 'visit', label: 'Visited', value: 8200 },
|
|
60
|
+
{ id: 'signup', label: 'Signed up', value: 3100 },
|
|
61
|
+
{ id: 'active', label: 'Activated', value: 1400 },
|
|
62
|
+
{ id: 'paid', label: 'Paid', value: 520 },
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## AI context prompt
|
|
68
|
+
|
|
69
|
+
Copy this into an LLM context bar before editing this component:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
I am modifying the cascivo Funnel component (chart). Vertical conversion funnel — each stage is a trapezoid narrowing toward the next, with optional conversion labels.
|
|
73
|
+
|
|
74
|
+
Architecture constraints — follow exactly:
|
|
75
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
76
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
77
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
78
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
79
|
+
- CSS logical properties only (RTL-safe).
|
|
80
|
+
|
|
81
|
+
Funnel is strictly bound to these tokens — use only these, do not invent token names:
|
|
82
|
+
--cascivo-chart-1, --cascivo-chart-2, --cascivo-chart-3, --cascivo-chart-4, --cascivo-chart-5, --cascivo-chart-6, --cascivo-chart-7, --cascivo-chart-8
|
|
83
|
+
|
|
84
|
+
Accessibility: role "img", WCAG 2.1-AA, keyboard: Tab (focus chart)/ArrowLeft/ArrowRight (navigate stages)/Escape (clear focus). Keep it AA.
|
|
85
|
+
|
|
86
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
87
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Gauge
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** A speedometer gauge — a value arc over a min–max sweep with threshold zones, ticks, and a needle.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- A single value against a range with a needle and threshold zones
|
|
9
|
+
- Dashboard KPIs where a speedometer metaphor aids quick reading
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Several progress values — use RadialBar
|
|
14
|
+
- A simple bar against thresholds — use Meter
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **Meter** (alternative): Use a linear bar for a single value against thresholds
|
|
19
|
+
- **RadialBar** (alternative): Use concentric rings for multiple progress values
|
|
20
|
+
|
|
21
|
+
## Accessibility rationale
|
|
22
|
+
|
|
23
|
+
Renders with role="img"; the value and range are in the fallback table.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Name | Type | Required | Default | Description |
|
|
28
|
+
| ------------- | ----------------------------------- | -------- | ------- | ---------------------------------------------------------- |
|
|
29
|
+
| `value` | `number` | Yes | — | The value the needle points to. |
|
|
30
|
+
| `min` | `number` | No | 0 | Minimum allowed value. |
|
|
31
|
+
| `max` | `number` | No | 100 | Maximum allowed value. |
|
|
32
|
+
| `thresholds` | `{ upTo: number; color: string }[]` | No | — | Coloured zones from min upward; the last should reach max. |
|
|
33
|
+
| `unit` | `string` | No | — | Suffix after the centre value. |
|
|
34
|
+
| `sweep` | `number` | No | 270 | Total sweep angle in degrees (270 = a speedometer arc). |
|
|
35
|
+
| `ticks` | `number` | No | 5 | Major tick count. |
|
|
36
|
+
| `title` | `string` | Yes | — | Chart title (also aria-label). |
|
|
37
|
+
| `description` | `string` | No | — | Supporting description text. |
|
|
38
|
+
| `width` | `number` | No | — | Width of the component. |
|
|
39
|
+
| `height` | `number` | No | 240 | Height of the component. |
|
|
40
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
41
|
+
| `plain` | `boolean` | No | false | Marks only — no ticks/labels. For micro/inline charts. |
|
|
42
|
+
|
|
43
|
+
## Tokens
|
|
44
|
+
|
|
45
|
+
- `--cascivo-color-accent`
|
|
46
|
+
- `--cascivo-color-foreground`
|
|
47
|
+
- `--cascivo-chart-grid`
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### Speedometer with zones
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
import { Gauge } from '@cascivo/charts'
|
|
55
|
+
;<Gauge
|
|
56
|
+
title="CPU load"
|
|
57
|
+
value={72}
|
|
58
|
+
unit="%"
|
|
59
|
+
thresholds={[
|
|
60
|
+
{ upTo: 50, color: 'var(--cascivo-chart-2)' },
|
|
61
|
+
{ upTo: 80, color: 'var(--cascivo-chart-3)' },
|
|
62
|
+
{ upTo: 100, color: 'var(--cascivo-chart-4)' },
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## AI context prompt
|
|
68
|
+
|
|
69
|
+
Copy this into an LLM context bar before editing this component:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
I am modifying the cascivo Gauge component (chart). A speedometer gauge — a value arc over a min–max sweep with threshold zones, ticks, and a needle.
|
|
73
|
+
|
|
74
|
+
Architecture constraints — follow exactly:
|
|
75
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
76
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
77
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
78
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
79
|
+
- CSS logical properties only (RTL-safe).
|
|
80
|
+
|
|
81
|
+
Gauge is strictly bound to these tokens — use only these, do not invent token names:
|
|
82
|
+
--cascivo-color-accent, --cascivo-color-foreground, --cascivo-chart-grid
|
|
83
|
+
|
|
84
|
+
Accessibility: role "img", WCAG 2.1-AA, keyboard: Tab (focus chart). Keep it AA.
|
|
85
|
+
|
|
86
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
87
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Heatmap
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** Two-dimensional heatmap with band scales and color-mix cell interpolation.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing magnitude across two categorical dimensions as a color-coded matrix
|
|
9
|
+
- Spotting patterns, clusters, or hotspots in dense grid data
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Reading precise values — color encoding is approximate
|
|
14
|
+
- A single-dimension comparison — use BarChart
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **Treemap** (alternative): Use for part-to-whole hierarchical magnitude rather than a grid
|
|
19
|
+
|
|
20
|
+
## Accessibility rationale
|
|
21
|
+
|
|
22
|
+
Renders with role="img" and requires a title prop for screen reader labeling.
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Name | Type | Required | Default | Description |
|
|
27
|
+
| ------------- | ------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
28
|
+
| `data` | `{ x: string; y: string; value: number }[]` | Yes | — | Array of x/y/value triples |
|
|
29
|
+
| `title` | `string` | Yes | — | Title text for the component. |
|
|
30
|
+
| `description` | `string` | No | — | Supporting description text. |
|
|
31
|
+
| `width` | `number` | No | — | Width of the component. |
|
|
32
|
+
| `height` | `number` | No | 320 | Height of the component. |
|
|
33
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
34
|
+
| `plain` | `boolean` | No | false | Marks only — no axes, grid lines, or legend. For micro/inline charts. |
|
|
35
|
+
| `visualMap` | `VisualMapOptions` | No | — | Map cell value → CVD-safe colour (continuous or piecewise) via a keyboard-operable legend that filters the visible range. |
|
|
36
|
+
| `toolbox` | `boolean \| ToolboxOptions` | No | — | Render a keyboard-reachable toolbox — PNG/SVG export, a data-view table toggle, and restore (reset the visualMap filter). |
|
|
37
|
+
|
|
38
|
+
## Tokens
|
|
39
|
+
|
|
40
|
+
- `--cascivo-chart-1`
|
|
41
|
+
- `--cascivo-color-neutral-100`
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
### Basic heatmap
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
import { Heatmap } from '@cascivo/charts'
|
|
49
|
+
|
|
50
|
+
const data = [
|
|
51
|
+
{x:'Mon',y:'AM',value:10},{x:'Mon',y:'PM',value:20},
|
|
52
|
+
{x:'Tue',y:'AM',value:15},{x:'Tue',y:'PM',value:5},
|
|
53
|
+
]
|
|
54
|
+
<Heatmap data={data} title="Activity" />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## AI context prompt
|
|
58
|
+
|
|
59
|
+
Copy this into an LLM context bar before editing this component:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
I am modifying the cascivo Heatmap component (chart). Two-dimensional heatmap with band scales and color-mix cell interpolation.
|
|
63
|
+
|
|
64
|
+
Architecture constraints — follow exactly:
|
|
65
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
66
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
67
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
68
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
69
|
+
- CSS logical properties only (RTL-safe).
|
|
70
|
+
|
|
71
|
+
Heatmap is strictly bound to these tokens — use only these, do not invent token names:
|
|
72
|
+
--cascivo-chart-1, --cascivo-color-neutral-100
|
|
73
|
+
|
|
74
|
+
Accessibility: role "img", WCAG 2.1-AA. Keep it AA.
|
|
75
|
+
|
|
76
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
77
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Histogram
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** Frequency histogram using Freedman–Diaconis binning with hover tooltips.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing the frequency distribution of a single continuous variable
|
|
9
|
+
- Revealing the shape, spread, and skew of binned numeric data
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Comparing discrete labelled categories — use BarChart
|
|
14
|
+
- Comparing distribution summaries across groups — use Boxplot
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **BarChart** (alternative): Use for discrete categorical values, not binned ranges
|
|
19
|
+
- **Boxplot** (alternative): Use to compare distribution summaries across multiple groups
|
|
20
|
+
|
|
21
|
+
## Accessibility rationale
|
|
22
|
+
|
|
23
|
+
Renders with role="img" and requires a title prop for screen reader labeling.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Name | Type | Required | Default | Description |
|
|
28
|
+
| ------------- | ---------- | -------- | ------- | --------------------------------------------------------------------- |
|
|
29
|
+
| `data` | `number[]` | Yes | — | Array of numeric values to bin |
|
|
30
|
+
| `bins` | `number` | No | — | Explicit bin count (defaults to Freedman–Diaconis) |
|
|
31
|
+
| `title` | `string` | Yes | — | Title text for the component. |
|
|
32
|
+
| `label` | `string` | Yes | — | X-axis label |
|
|
33
|
+
| `description` | `string` | No | — | Supporting description text. |
|
|
34
|
+
| `width` | `number` | No | — | Width of the component. |
|
|
35
|
+
| `height` | `number` | No | 300 | Height of the component. |
|
|
36
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
37
|
+
| `plain` | `boolean` | No | false | Marks only — no axes, grid lines, or legend. For micro/inline charts. |
|
|
38
|
+
|
|
39
|
+
## Tokens
|
|
40
|
+
|
|
41
|
+
- `--cascivo-chart-1`
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
### Basic histogram
|
|
46
|
+
|
|
47
|
+
```jsx
|
|
48
|
+
import { Histogram } from '@cascivo/charts'
|
|
49
|
+
|
|
50
|
+
const data = Array.from({length:100}, () => Math.random() * 100)
|
|
51
|
+
<Histogram data={data} title="Distribution" label="Value" />
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## AI context prompt
|
|
55
|
+
|
|
56
|
+
Copy this into an LLM context bar before editing this component:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
I am modifying the cascivo Histogram component (chart). Frequency histogram using Freedman–Diaconis binning with hover tooltips.
|
|
60
|
+
|
|
61
|
+
Architecture constraints — follow exactly:
|
|
62
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
63
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
64
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
65
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
66
|
+
- CSS logical properties only (RTL-safe).
|
|
67
|
+
|
|
68
|
+
Histogram is strictly bound to these tokens — use only these, do not invent token names:
|
|
69
|
+
--cascivo-chart-1
|
|
70
|
+
|
|
71
|
+
Accessibility: role "img", WCAG 2.1-AA. Keep it AA.
|
|
72
|
+
|
|
73
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
74
|
+
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Kpi
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** KPI card showing a primary metric with optional delta indicator, icon, and sparkline.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Highlighting a single headline metric with an optional change delta
|
|
9
|
+
- Building dashboard summary tiles with an embedded sparkline trend
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Showing a value against a target or range — use Bullet or Meter
|
|
14
|
+
- Comparing multiple values — use a chart
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **Sparkline** (contains): Embeds a micro-trend alongside the metric value
|
|
19
|
+
- **Bullet** (alternative): Use when the metric must be shown against a target
|
|
20
|
+
|
|
21
|
+
## Accessibility rationale
|
|
22
|
+
|
|
23
|
+
Renders with role="figure" and a labeled metric for screen reader context.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Name | Type | Required | Default | Description |
|
|
28
|
+
| ------------ | ------------------ | -------- | ------- | -------------------------------------------------------- |
|
|
29
|
+
| `value` | `string \| number` | Yes | — | Primary metric value |
|
|
30
|
+
| `label` | `string` | Yes | — | Metric label |
|
|
31
|
+
| `delta` | `number` | No | — | Change value (positive = up, negative = down) |
|
|
32
|
+
| `deltaLabel` | `string` | No | — | Delta context label (e.g. "vs last week") |
|
|
33
|
+
| `icon` | `ReactNode` | No | — | Icon element rendered in the component. |
|
|
34
|
+
| `sparkline` | `number[]` | No | — | Trend data for embedded sparkline |
|
|
35
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
36
|
+
|
|
37
|
+
## Tokens
|
|
38
|
+
|
|
39
|
+
- `--cascivo-chart-1`
|
|
40
|
+
|
|
41
|
+
## Examples
|
|
42
|
+
|
|
43
|
+
### Basic KPI card
|
|
44
|
+
|
|
45
|
+
```jsx
|
|
46
|
+
import { Kpi } from '@cascivo/charts'
|
|
47
|
+
;<Kpi value="$12,400" label="Monthly revenue" delta={8.2} deltaLabel="vs last month" />
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## AI context prompt
|
|
51
|
+
|
|
52
|
+
Copy this into an LLM context bar before editing this component:
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
I am modifying the cascivo Kpi component (chart). KPI card showing a primary metric with optional delta indicator, icon, and sparkline.
|
|
56
|
+
|
|
57
|
+
Architecture constraints — follow exactly:
|
|
58
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
59
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
60
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
61
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
62
|
+
- CSS logical properties only (RTL-safe).
|
|
63
|
+
|
|
64
|
+
Kpi is strictly bound to these tokens — use only these, do not invent token names:
|
|
65
|
+
--cascivo-chart-1
|
|
66
|
+
|
|
67
|
+
Accessibility: role "figure", WCAG 2.1-AA. Keep it AA.
|
|
68
|
+
|
|
69
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
70
|
+
```
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# LineChart
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** Time-series or numeric line chart with multi-series support, hover tooltip, and legend.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing trends and precise values over continuous time or a numeric range
|
|
9
|
+
- Comparing the trajectory of multiple series on a shared scale
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Comparing discrete categories — use BarChart
|
|
14
|
+
- Emphasising cumulative volume — use AreaChart
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **AreaChart** (alternative): Use when filled cumulative volume matters more than precise values
|
|
19
|
+
- **BarChart** (alternative): Use for discrete categorical comparison
|
|
20
|
+
|
|
21
|
+
## Accessibility rationale
|
|
22
|
+
|
|
23
|
+
Renders with role="img" and requires a title prop for screen reader labeling.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Name | Type | Required | Default | Description |
|
|
28
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `series` | `LineChartSeries<Datum>[]` | Yes | — | Array of data series |
|
|
30
|
+
| `x` | `(d: Datum) => number \| Date` | Yes | — | X-value accessor |
|
|
31
|
+
| `y` | `(d: Datum) => number` | Yes | — | Y-value accessor |
|
|
32
|
+
| `title` | `string` | Yes | — | Chart title (also used as aria-label) |
|
|
33
|
+
| `description` | `string` | No | — | Subtitle shown below title |
|
|
34
|
+
| `curve` | `'linear' \| 'monotone' \| 'step' \| 'stepBefore' \| 'stepAfter' \| 'natural' \| 'basis' \| 'cardinal' \| 'catmullRom'` | No | monotone | Line interpolation curve |
|
|
35
|
+
| `width` | `number` | No | — | Fixed SVG width (defaults to container width) |
|
|
36
|
+
| `height` | `number` | No | 300 | SVG height in px |
|
|
37
|
+
| `xTicks` | `number` | No | 5 | Approximate number of X-axis ticks |
|
|
38
|
+
| `yTicks` | `number` | No | 5 | Approximate number of Y-axis ticks |
|
|
39
|
+
| `legend` | `boolean` | No | — | Show series legend |
|
|
40
|
+
| `tooltip` | `boolean` | No | — | Enable hover tooltip |
|
|
41
|
+
| `formatTooltip` | `(datum: Datum, series: LineChartSeries<Datum>) => string` | No | — | Custom tooltip formatter |
|
|
42
|
+
| `className` | `string` | No | — | Additional CSS class names merged onto the root element. |
|
|
43
|
+
| `plain` | `boolean` | No | false | Marks only — no axes, grid lines, or legend. For micro/inline charts. |
|
|
44
|
+
| `annotations` | `Annotation[]` | No | — | Reference lines, shaded bands, and markers drawn over the plot (e.g. a target/threshold line). |
|
|
45
|
+
| `labels` | `boolean \| { format?: (v: number) => string; position?: string }` | No | — | Print each value as a label on the mark (collision-aware, decorative/aria-hidden). |
|
|
46
|
+
| `connectNulls` | `boolean` | No | false | Bridge non-finite y gaps instead of breaking the line at them. |
|
|
47
|
+
| `onSelect` | `(point: ChartPoint) => void` | No | — | Fired when a point is clicked or activated (Enter/Space) — for drill-down. |
|
|
48
|
+
| `brush` | `boolean` | No | false | Show a keyboard-operable Brush below the plot to subset (zoom) the series to a window. |
|
|
49
|
+
| `dataZoom` | `boolean` | No | false | Show a DataZoom slider below the plot — a Brush whose body also pans the window. |
|
|
50
|
+
| `zoom` | `boolean` | No | false | Enable in-plot wheel/drag/keyboard zoom-pan (+/-/0) over the series index window, with a reset control and re-ticked axes. |
|
|
51
|
+
| `syncId` | `string` | No | — | Connect this chart to others sharing the same id — they mirror the zoom window and hovered x. |
|
|
52
|
+
| `tooltipMode` | `'item' \| 'axis'` | No | item | Tooltip trigger — item (nearest point) or axis (a crosshair + a shared tooltip listing every series at the hovered x). |
|
|
53
|
+
| `decimate` | `boolean \| { method?: 'lttb' \| 'minmax'; threshold?: number }` | No | — | Downsample dense series before drawing (LTTB or min-max). Visual only — the fallback table keeps the full data. |
|
|
54
|
+
| `toolbox` | `boolean \| ToolboxOptions` | No | — | Render a keyboard-reachable toolbox — PNG/SVG export, a data-view table toggle, and restore (reset zoom). |
|
|
55
|
+
| `transition` | `boolean \| { duration?: number; easing?: string; properties?: string[] }` | No | — | Tune the reduced-motion-gated enter/update transitions (false disables). Always suppressed under prefers-reduced-motion. |
|
|
56
|
+
| `onBeforeDraw` | `(ctx: { width: number; height: number }) => ReactNode` | No | — | Render custom SVG behind the marks (watermark/region) — a lightweight extension seam. |
|
|
57
|
+
| `onAfterDraw` | `(ctx: { width: number; height: number }) => ReactNode` | No | — | Render custom SVG over the marks (overlay/extra series) — a lightweight extension seam. |
|
|
58
|
+
|
|
59
|
+
## Tokens
|
|
60
|
+
|
|
61
|
+
- `--cascivo-chart-1`
|
|
62
|
+
- `--cascivo-chart-2`
|
|
63
|
+
- `--cascivo-chart-3`
|
|
64
|
+
- `--cascivo-chart-4`
|
|
65
|
+
- `--cascivo-chart-5`
|
|
66
|
+
- `--cascivo-chart-6`
|
|
67
|
+
- `--cascivo-chart-7`
|
|
68
|
+
- `--cascivo-chart-8`
|
|
69
|
+
|
|
70
|
+
## Examples
|
|
71
|
+
|
|
72
|
+
### Basic line chart
|
|
73
|
+
|
|
74
|
+
```jsx
|
|
75
|
+
import { LineChart } from '@cascivo/charts'
|
|
76
|
+
|
|
77
|
+
const series = [{ id: 'a', label: 'Revenue', data: [{x:1,y:10},{x:2,y:20},{x:3,y:15}] }]
|
|
78
|
+
<LineChart series={series} x={d => d.x} y={d => d.y} title="Revenue" />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### With an SLO target line
|
|
82
|
+
|
|
83
|
+
```jsx
|
|
84
|
+
<LineChart
|
|
85
|
+
series={series}
|
|
86
|
+
x={(d) => d.x}
|
|
87
|
+
y={(d) => d.y}
|
|
88
|
+
title="Latency"
|
|
89
|
+
annotations={[{ kind: 'line', axis: 'y', value: 200, label: 'SLO' }]}
|
|
90
|
+
/>
|
|
91
|
+
```
|
|
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 LineChart component (chart). Time-series or numeric line chart with multi-series support, hover tooltip, and legend.
|
|
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
|
+
LineChart is strictly bound to these tokens — use only these, do not invent token names:
|
|
108
|
+
--cascivo-chart-1, --cascivo-chart-2, --cascivo-chart-3, --cascivo-chart-4, --cascivo-chart-5, --cascivo-chart-6, --cascivo-chart-7, --cascivo-chart-8
|
|
109
|
+
|
|
110
|
+
Accessibility: role "img", WCAG 2.1-AA, keyboard: Tab (focus chart)/ArrowLeft/ArrowRight (navigate points)/Home/End (first/last point)/Escape (clear focus). Keep it AA.
|
|
111
|
+
|
|
112
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
113
|
+
```
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Meter
|
|
2
|
+
|
|
3
|
+
**Category:** chart
|
|
4
|
+
**Description:** Progress meter in bar or gauge variant with threshold coloring.
|
|
5
|
+
|
|
6
|
+
## When to use
|
|
7
|
+
|
|
8
|
+
- Showing a rated or gauged value within a known min/max range
|
|
9
|
+
- Surfacing threshold-based status (e.g. CPU, disk, score) as a bar or gauge
|
|
10
|
+
|
|
11
|
+
## When NOT to use
|
|
12
|
+
|
|
13
|
+
- Showing task completion progress — use a ProgressBar
|
|
14
|
+
- Comparing a value against a target with range bands — use Bullet
|
|
15
|
+
|
|
16
|
+
## Related components
|
|
17
|
+
|
|
18
|
+
- **Bullet** (alternative): Use when a target marker and qualitative bands are needed
|
|
19
|
+
- **Kpi** (alternative): Use for a headline metric without a bounded range
|
|
20
|
+
|
|
21
|
+
## Accessibility rationale
|
|
22
|
+
|
|
23
|
+
Renders with role="meter" exposing min, max, and current value to assistive tech.
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Name | Type | Required | Default | Description |
|
|
28
|
+
| ------------ | ------------------ | -------- | ------- | --------------------------------- |
|
|
29
|
+
| `value` | `number` | Yes | — | Current value |
|
|
30
|
+
| `label` | `string` | Yes | — | Text label for the control. |
|
|
31
|
+
| `min` | `number` | No | 0 | Minimum allowed value. |
|
|
32
|
+
| `max` | `number` | No | 100 | Maximum allowed value. |
|
|
33
|
+
| `variant` | `'bar' \| 'gauge'` | No | bar | Selects the visual style variant. |
|
|
34
|
+
| `thresholds` | `MeterThresholds` | No | — | Color breakpoints |
|
|
35
|
+
| `width` | `number` | No | — | Width of the component. |
|
|
36
|
+
| `height` | `number` | No | — | Height of the component. |
|
|
37
|
+
|
|
38
|
+
## Tokens
|
|
39
|
+
|
|
40
|
+
- `--cascivo-chart-1`
|
|
41
|
+
|
|
42
|
+
## Examples
|
|
43
|
+
|
|
44
|
+
### Basic meter
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
import { Meter } from '@cascivo/charts'
|
|
48
|
+
;<Meter value={72} label="CPU usage" />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## AI context prompt
|
|
52
|
+
|
|
53
|
+
Copy this into an LLM context bar before editing this component:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
I am modifying the cascivo Meter component (chart). Progress meter in bar or gauge variant with threshold coloring.
|
|
57
|
+
|
|
58
|
+
Architecture constraints — follow exactly:
|
|
59
|
+
- Signals only (useSignal/useComputed/useSignalEffect from @cascivo/core). Never useState/useEffect/useContext/useReducer.
|
|
60
|
+
- Style only through --cascivo-* custom properties. No Tailwind, no inline styles, no CSS-in-JS.
|
|
61
|
+
- Responsive via @container queries on the canonical scale (30rem/40rem/64rem/80rem). Do not use global viewport @media breakpoints.
|
|
62
|
+
- Visual states (hover/focus/active/disabled) via CSS pseudo-classes, not JS.
|
|
63
|
+
- CSS logical properties only (RTL-safe).
|
|
64
|
+
|
|
65
|
+
Meter is strictly bound to these tokens — use only these, do not invent token names:
|
|
66
|
+
--cascivo-chart-1
|
|
67
|
+
|
|
68
|
+
Accessibility: role "meter", WCAG 2.1-AA. Keep it AA.
|
|
69
|
+
|
|
70
|
+
Do not invent props, tokens, or global viewport media queries.
|
|
71
|
+
```
|