@cueplusplus/ui 0.1.0 → 0.3.0
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/CHANGELOG.md +705 -0
- package/dist/brand/_chassis.d.ts +54 -0
- package/dist/brand/_chassis.js +81 -0
- package/dist/brand/_geometry.js +41 -0
- package/dist/brand/cue-logotype.d.ts +29 -0
- package/dist/brand/cue-logotype.js +60 -0
- package/dist/brand/cue-mark.d.ts +30 -0
- package/dist/brand/cue-mark.js +61 -0
- package/dist/brand/index.d.ts +5 -0
- package/dist/brand/plussie.d.ts +67 -0
- package/dist/brand/plussie.js +125 -0
- package/dist/chat/agent-pile.js +1 -1
- package/dist/chat/ask-box.js +2 -2
- package/dist/chat/delegation-card.js +1 -1
- package/dist/chat/message.js +2 -2
- package/dist/chrome/_edge-scroller.d.ts +45 -0
- package/dist/chrome/_edge-scroller.js +149 -0
- package/dist/chrome/_glyphs.js +19 -1
- package/dist/chrome/_tabs-scroll.d.ts +13 -8
- package/dist/chrome/_tabs-scroll.js +13 -8
- package/dist/chrome/app-bar.d.ts +103 -0
- package/dist/chrome/app-bar.js +175 -0
- package/dist/chrome/app-shell.d.ts +125 -0
- package/dist/chrome/app-shell.js +167 -0
- package/dist/chrome/footer.d.ts +75 -0
- package/dist/chrome/footer.js +68 -0
- package/dist/chrome/index.d.ts +5 -1
- package/dist/chrome/index.js +4 -1
- package/dist/chrome/navigation-menu.js +1 -1
- package/dist/chrome/page-shell.d.ts +1 -1
- package/dist/chrome/page-shell.js +15 -5
- package/dist/chrome/segmented-control.d.ts +19 -0
- package/dist/chrome/segmented-control.js +40 -21
- package/dist/chrome/tabs.js +21 -65
- package/dist/chrome/toolbar.d.ts +22 -0
- package/dist/chrome/toolbar.js +26 -5
- package/dist/configurator/_overrides.js +22 -8
- package/dist/configurator/configurator.js +1 -1
- package/dist/configurator/panel-sections.js +10 -4
- package/dist/dmx/channel-matrix.js +1 -1
- package/dist/forms/otp-field.js +1 -1
- package/dist/index.d.ts +18 -9
- package/dist/index.js +16 -10
- package/dist/instruments/data-table.js +1 -1
- package/dist/instruments/index.d.ts +2 -2
- package/dist/instruments/index.js +2 -2
- package/dist/instruments/table.d.ts +14 -1
- package/dist/instruments/table.js +20 -1
- package/dist/layout/carousel.js +1 -1
- package/dist/layout/container.d.ts +1 -1
- package/dist/layout/container.js +6 -3
- package/dist/layout/index.d.ts +3 -3
- package/dist/layout/index.js +3 -3
- package/dist/layout/pagination.js +1 -1
- package/dist/layout/sidebar.d.ts +23 -3
- package/dist/layout/sidebar.js +18 -7
- package/dist/midi/spectrum-visualizer.js +1 -1
- package/dist/midi/timeline-ruler.js +1 -1
- package/dist/overlays/command-palette.js +1 -1
- package/dist/overlays/dialog.js +1 -1
- package/dist/overlays/dropdown-menu.js +2 -2
- package/dist/overlays/hover-card.js +1 -1
- package/dist/overlays/index.js +1 -1
- package/dist/overlays/popover.js +1 -1
- package/dist/overlays/sheet.js +1 -1
- package/dist/overlays/toast.js +1 -1
- package/dist/primitives/chip.d.ts +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.js +1 -1
- package/dist/primitives/status-dot.d.ts +7 -0
- package/dist/primitives/status-dot.js +8 -1
- package/dist/styles.css +58 -2
- package/dist/system/density.d.ts +4 -1
- package/dist/system/density.js +12 -4
- package/dist/system/index.d.ts +4 -4
- package/dist/system/portal.d.ts +5 -5
- package/dist/system/portal.js +30 -11
- package/dist/system/prepaint.d.ts +34 -9
- package/dist/system/prepaint.js +48 -25
- package/dist/system/theme-provider.d.ts +48 -11
- package/dist/system/theme-provider.js +109 -35
- package/dist/system/use-density.d.ts +3 -3
- package/dist/system/use-density.js +16 -6
- package/dist/system/use-theme.d.ts +4 -2
- package/dist/system/use-theme.js +4 -2
- package/dist/theming/_presets.js +133 -5
- package/dist/theming/create-theme.d.ts +2 -2
- package/dist/theming/create-theme.js +37 -19
- package/dist/theming/serialize.d.ts +1 -1
- package/dist/theming/serialize.js +25 -1
- package/manifest/components/accordion.json +154 -0
- package/manifest/components/agent-pile.json +116 -0
- package/manifest/components/alert-dialog.json +190 -0
- package/manifest/components/app-bar.json +244 -0
- package/manifest/components/app-shell.json +291 -0
- package/manifest/components/app-window-frame.json +102 -0
- package/manifest/components/ask-box.json +209 -0
- package/manifest/components/autocomplete.json +197 -0
- package/manifest/components/avatar-group.json +72 -0
- package/manifest/components/avatar.json +95 -0
- package/manifest/components/breadcrumb.json +74 -0
- package/manifest/components/button-group.json +74 -0
- package/manifest/components/button.json +125 -0
- package/manifest/components/calendar.json +65 -0
- package/manifest/components/card.json +140 -0
- package/manifest/components/carousel.json +200 -0
- package/manifest/components/channel-matrix.json +173 -0
- package/manifest/components/chart-container.json +111 -0
- package/manifest/components/chart-ramp.json +72 -0
- package/manifest/components/chart-swatch.json +65 -0
- package/manifest/components/chart-tooltip-content.json +114 -0
- package/manifest/components/checkbox-group.json +68 -0
- package/manifest/components/checkbox.json +93 -0
- package/manifest/components/chip.json +132 -0
- package/manifest/components/collapsible.json +120 -0
- package/manifest/components/color-area.json +59 -0
- package/manifest/components/color-field.json +79 -0
- package/manifest/components/color-picker.json +175 -0
- package/manifest/components/color-slider.json +75 -0
- package/manifest/components/color-swatch.json +68 -0
- package/manifest/components/colors-section.json +66 -0
- package/manifest/components/combobox.json +198 -0
- package/manifest/components/command-palette.json +177 -0
- package/manifest/components/composer.json +176 -0
- package/manifest/components/container.json +60 -0
- package/manifest/components/context-menu.json +121 -0
- package/manifest/components/copy-button.json +93 -0
- package/manifest/components/cue-logotype.json +96 -0
- package/manifest/components/cue-mark.json +97 -0
- package/manifest/components/cue-portal-frame.json +55 -0
- package/manifest/components/data-table-pagination.json +83 -0
- package/manifest/components/data-table-toolbar.json +104 -0
- package/manifest/components/date-field.json +80 -0
- package/manifest/components/date-picker.json +191 -0
- package/manifest/components/date-range-picker.json +191 -0
- package/manifest/components/delegation-card.json +144 -0
- package/manifest/components/density.json +58 -0
- package/manifest/components/description-list.json +84 -0
- package/manifest/components/dialog.json +198 -0
- package/manifest/components/disclosure.json +109 -0
- package/manifest/components/dmx-bar.json +94 -0
- package/manifest/components/dmx-strip.json +101 -0
- package/manifest/components/drawer.json +179 -0
- package/manifest/components/dropdown-menu.json +229 -0
- package/manifest/components/empty-state.json +90 -0
- package/manifest/components/env-var-input.json +150 -0
- package/manifest/components/export-dialog.json +84 -0
- package/manifest/components/eyebrow.json +56 -0
- package/manifest/components/field-description.json +63 -0
- package/manifest/components/field-error.json +77 -0
- package/manifest/components/field-label.json +63 -0
- package/manifest/components/field.json +79 -0
- package/manifest/components/file-upload.json +159 -0
- package/manifest/components/flow-background.json +50 -0
- package/manifest/components/flow-controls.json +50 -0
- package/manifest/components/footer.json +112 -0
- package/manifest/components/grid.json +81 -0
- package/manifest/components/group-bar.json +102 -0
- package/manifest/components/hover-card.json +151 -0
- package/manifest/components/icon-button.json +88 -0
- package/manifest/components/info-tip.json +98 -0
- package/manifest/components/input-group.json +91 -0
- package/manifest/components/input.json +89 -0
- package/manifest/components/item.json +129 -0
- package/manifest/components/kbd.json +52 -0
- package/manifest/components/link.json +81 -0
- package/manifest/components/log-viewer.json +139 -0
- package/manifest/components/menubar.json +157 -0
- package/manifest/components/message-list.json +100 -0
- package/manifest/components/message.json +116 -0
- package/manifest/components/meter.json +114 -0
- package/manifest/components/multi-select.json +190 -0
- package/manifest/components/musical-time-input.json +113 -0
- package/manifest/components/navigation-menu.json +226 -0
- package/manifest/components/node-card.json +109 -0
- package/manifest/components/node-handle.json +69 -0
- package/manifest/components/number-field.json +107 -0
- package/manifest/components/otp-field.json +128 -0
- package/manifest/components/page-shell.json +96 -0
- package/manifest/components/pagination.json +92 -0
- package/manifest/components/panel-header.json +77 -0
- package/manifest/components/panel.json +71 -0
- package/manifest/components/password-input.json +119 -0
- package/manifest/components/piano-keyboard.json +120 -0
- package/manifest/components/plussie.json +111 -0
- package/manifest/components/popover.json +193 -0
- package/manifest/components/preset-section.json +73 -0
- package/manifest/components/progress.json +95 -0
- package/manifest/components/radio-group.json +73 -0
- package/manifest/components/radio.json +80 -0
- package/manifest/components/rating.json +141 -0
- package/manifest/components/resizable.json +88 -0
- package/manifest/components/row.json +109 -0
- package/manifest/components/scroll-area.json +91 -0
- package/manifest/components/scrollable-tabs-list.json +83 -0
- package/manifest/components/scrub-input.json +200 -0
- package/manifest/components/seam-cell.json +75 -0
- package/manifest/components/seam-grid.json +75 -0
- package/manifest/components/seam-list.json +56 -0
- package/manifest/components/search-input.json +134 -0
- package/manifest/components/section-header.json +112 -0
- package/manifest/components/segmented-control.json +138 -0
- package/manifest/components/select.json +194 -0
- package/manifest/components/separator.json +53 -0
- package/manifest/components/shape-section.json +66 -0
- package/manifest/components/sheet.json +186 -0
- package/manifest/components/sidebar.json +198 -0
- package/manifest/components/signal-edge.json +56 -0
- package/manifest/components/skeleton.json +46 -0
- package/manifest/components/slider.json +89 -0
- package/manifest/components/sparkline.json +76 -0
- package/manifest/components/spectrum-visualizer.json +115 -0
- package/manifest/components/spinner.json +61 -0
- package/manifest/components/stack.json +96 -0
- package/manifest/components/stat.json +87 -0
- package/manifest/components/status-bar.json +58 -0
- package/manifest/components/status-dot.json +78 -0
- package/manifest/components/stepper.json +89 -0
- package/manifest/components/switch.json +87 -0
- package/manifest/components/table-scroll-region.json +69 -0
- package/manifest/components/table.json +155 -0
- package/manifest/components/tabs.json +145 -0
- package/manifest/components/tags-input.json +190 -0
- package/manifest/components/terminal-frame.json +119 -0
- package/manifest/components/textarea.json +76 -0
- package/manifest/components/theme-configurator.json +124 -0
- package/manifest/components/theme-provider.json +134 -0
- package/manifest/components/threshold-rail.json +160 -0
- package/manifest/components/time-field.json +80 -0
- package/manifest/components/timeline-ruler.json +139 -0
- package/manifest/components/timeline.json +115 -0
- package/manifest/components/title-bar.json +82 -0
- package/manifest/components/toast.json +130 -0
- package/manifest/components/toggle-group.json +106 -0
- package/manifest/components/toggle.json +109 -0
- package/manifest/components/token-editor.json +90 -0
- package/manifest/components/toolbar.json +163 -0
- package/manifest/components/tooltip.json +164 -0
- package/manifest/components/tree-visibility-toggle.json +84 -0
- package/manifest/components/tree.json +140 -0
- package/manifest/components/two-step-button.json +113 -0
- package/manifest/components/universe-grid.json +127 -0
- package/manifest/components/usage-chart.json +124 -0
- package/manifest/manifest.json +2142 -0
- package/manifest/tokens.json +138 -0
- package/package.json +13 -5
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ChartContainer",
|
|
3
|
+
"slug": "chart-container",
|
|
4
|
+
"group": "charts",
|
|
5
|
+
"importPath": "@cueplusplus/ui/charts",
|
|
6
|
+
"peerDependencies": [
|
|
7
|
+
"recharts"
|
|
8
|
+
],
|
|
9
|
+
"clientOnly": true,
|
|
10
|
+
"description": "The box every chart in this system sits in.\n\nIt does three things, and deliberately not a fourth:\n\n1. **It publishes the palette as custom properties.** `--chart-1`…`--chart-N`\n carry `var(--cue-accent)`, `var(--cue-info)` and the rest *by reference*,\n so a series written `<Line stroke={chartToneVar(0)} />` re-hues on a theme\n switch with no re-render, no context and no effect. Resolving the palette in\n JavaScript would have made the chart a subscriber to the theme; this way it\n is simply painted in it.\n2. **It re-inks recharts' chrome.** {@link chartChromeClasses} restyles the\n grid, axes and ticks from tokens through the SVG's own class names, so\n every axis is themed whether or not somebody remembered to configure it.\n3. **It measures.** `ResponsiveContainer` is the only reliable way to give a\n recharts chart a pixel size, and it needs a box with a real height — which\n is what `height` (or `aspect`) sets, in `rem` so the plot scales with the\n root font size like everything else.\n\nWhat it does not do is wrap or re-export recharts' chart components. A chart is\na composition, and hiding `LineChart`/`XAxis`/`Tooltip` behind a props object\nwould mean re-implementing a charting library's API surface one prop at a time.",
|
|
11
|
+
"props": [
|
|
12
|
+
{
|
|
13
|
+
"name": "children",
|
|
14
|
+
"type": "ReactElement<unknown, string | JSXElementConstructor<any>>",
|
|
15
|
+
"required": true,
|
|
16
|
+
"defaultValue": null,
|
|
17
|
+
"description": "The chart. Exactly one element — recharts' container takes a single child."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "height",
|
|
21
|
+
"type": "number",
|
|
22
|
+
"required": false,
|
|
23
|
+
"defaultValue": "200",
|
|
24
|
+
"description": "Plot height in px at the 16px root. Defaults to `200`. Ignored when `aspect` is set."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "aspect",
|
|
28
|
+
"type": "number",
|
|
29
|
+
"required": false,
|
|
30
|
+
"defaultValue": null,
|
|
31
|
+
"description": "Width-to-height ratio, letting the plot size itself from its column instead."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "label",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"required": false,
|
|
37
|
+
"defaultValue": null,
|
|
38
|
+
"description": "What the chart shows. Given, the box becomes a named `figure`; a shape is\nnot self-describing, so name the series."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "tones",
|
|
42
|
+
"type": "readonly string[]",
|
|
43
|
+
"required": false,
|
|
44
|
+
"defaultValue": "[\n ...CHART_TONE_TOKENS.map(tokenRef),\n ...CHART_EXTENDED_TONES,\n]",
|
|
45
|
+
"description": "The series palette, published as `--chart-1`…`--chart-N`. Defaults to\n{@link CHART_TONES}."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "debounce",
|
|
49
|
+
"type": "number",
|
|
50
|
+
"required": false,
|
|
51
|
+
"defaultValue": null,
|
|
52
|
+
"description": "Throttle for the resize observer, in ms. Defaults to none."
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"typeReferences": [
|
|
56
|
+
"Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\">"
|
|
57
|
+
],
|
|
58
|
+
"subcomponents": [],
|
|
59
|
+
"parts": [],
|
|
60
|
+
"variants": {},
|
|
61
|
+
"defaultVariants": {},
|
|
62
|
+
"tokensUsed": [
|
|
63
|
+
"--cue-accent",
|
|
64
|
+
"--cue-info"
|
|
65
|
+
],
|
|
66
|
+
"summary": "The box every chart in this system sits in.",
|
|
67
|
+
"examples": [
|
|
68
|
+
{
|
|
69
|
+
"title": "Usage",
|
|
70
|
+
"code": "<ChartContainer label=\"Requests per minute\" height={220}>\n <LineChart data={series}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey=\"t\" />\n <Tooltip cursor={chartTooltipCursor} content={<ChartTooltipContent />} />\n <Line dataKey=\"requests\" stroke={chartToneVar(0)} dot={false} />\n </LineChart>\n</ChartContainer>",
|
|
71
|
+
"language": "tsx"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"status": "todo-docs",
|
|
75
|
+
"url": "/docs/components/chart-container",
|
|
76
|
+
"mdUrl": "/docs/components/chart-container.md",
|
|
77
|
+
"jsonUrl": "/r/components/chart-container.json",
|
|
78
|
+
"specimens": [
|
|
79
|
+
{
|
|
80
|
+
"title": "ChartContainer — line",
|
|
81
|
+
"group": "charts",
|
|
82
|
+
"components": [
|
|
83
|
+
"ChartContainer"
|
|
84
|
+
],
|
|
85
|
+
"code": "<Panel className=\"w-full p-(--cue-space-4)\">\n <PanelHeader title=\"Output level\" />\n <ChartContainer height={220} label=\"Output level over the last six hours\">\n <LineChart data={SERIES}>\n <CartesianGrid />\n <XAxis dataKey=\"hour\" />\n <YAxis domain={[0, 100]} />\n <Tooltip content={<ChartTooltipContent />} />\n <Legend />\n <Line dataKey=\"output\" stroke={chartToneVar(0)} dot={false} strokeWidth={2} />\n <Line dataKey=\"dropped\" stroke={chartToneVar(4)} dot={false} strokeWidth={2} />\n </LineChart>\n </ChartContainer>\n</Panel>",
|
|
86
|
+
"note": "The measured box. It publishes the palette as `--chart-N` custom properties and re-inks recharts' own SVG chrome from tokens: grid at 45% of the border colour, axis text in mono at the label size.",
|
|
87
|
+
"interaction": "the tooltip follows the cursor and uses the overlay surface conventions, so a chart tooltip and a popover agree on what floats."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"title": "ChartContainer — bar",
|
|
91
|
+
"group": "charts",
|
|
92
|
+
"components": [
|
|
93
|
+
"ChartContainer"
|
|
94
|
+
],
|
|
95
|
+
"code": "<Panel className=\"w-full p-(--cue-space-4)\">\n <PanelHeader title=\"Channels per universe\" />\n <ChartContainer height={200} label=\"Channels used per universe\">\n <BarChart data={UNIVERSES}>\n <CartesianGrid />\n <XAxis dataKey=\"universe\" />\n <YAxis />\n <Tooltip content={<ChartTooltipContent />} />\n <Bar dataKey=\"channels\" fill={chartToneVar(1)} />\n </BarChart>\n </ChartContainer>\n</Panel>",
|
|
96
|
+
"note": "The same container with a different mark. Nothing about the theme layer is chart-type specific.",
|
|
97
|
+
"interaction": "same tooltip and cursor treatment."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"title": "ChartContainer — area",
|
|
101
|
+
"group": "charts",
|
|
102
|
+
"components": [
|
|
103
|
+
"ChartContainer"
|
|
104
|
+
],
|
|
105
|
+
"code": "<Panel className=\"w-full p-(--cue-space-4)\">\n <PanelHeader title=\"Dropped frames\" />\n <ChartContainer\n height={180}\n label=\"Dropped frames over the last six hours\"\n tones={[\"var(--cue-warn)\", \"var(--cue-danger)\"]}\n >\n <AreaChart data={SERIES}>\n <CartesianGrid />\n <XAxis dataKey=\"hour\" />\n <YAxis />\n <Tooltip content={<ChartTooltipContent hideIndicator />} />\n <Area dataKey=\"dropped\" stroke={chartToneVar(0)} fill={chartToneVar(0)} fillOpacity={0.2} />\n </AreaChart>\n </ChartContainer>\n</Panel>",
|
|
106
|
+
"note": "An area with an explicit tone list, which overrides the default palette for this chart only.",
|
|
107
|
+
"interaction": "none beyond the tooltip."
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"todo": true
|
|
111
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ChartRamp",
|
|
3
|
+
"slug": "chart-ramp",
|
|
4
|
+
"group": "charts",
|
|
5
|
+
"importPath": "@cueplusplus/ui/charts",
|
|
6
|
+
"peerDependencies": [],
|
|
7
|
+
"clientOnly": false,
|
|
8
|
+
"description": "A ramp drawn as a strip: equal cells, no gaps, in order.\n\nEqual cells rather than a CSS gradient, because a ramp *is* discrete — a\ngradient would show steps the data cannot address, and would quietly disagree\nwith the same ramp used to fill bars. No seams either, for the same reason the\ncells are equal: a seam reads as a category boundary, and a sequential scale\nhas none.\n\nStatic markup — no `\"use client\"`.",
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "colors",
|
|
12
|
+
"type": "readonly string[]",
|
|
13
|
+
"required": true,
|
|
14
|
+
"defaultValue": null,
|
|
15
|
+
"description": "The ramp, in order. Any CSS colours."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "label",
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": true,
|
|
21
|
+
"defaultValue": null,
|
|
22
|
+
"description": "What the ramp encodes. Required: it is the strip's accessible name."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "height",
|
|
26
|
+
"type": "number",
|
|
27
|
+
"required": false,
|
|
28
|
+
"defaultValue": "8",
|
|
29
|
+
"description": "Strip height in px at the 16px root, emitted as `rem`. Defaults to `8`."
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"typeReferences": [
|
|
33
|
+
"Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\">"
|
|
34
|
+
],
|
|
35
|
+
"subcomponents": [],
|
|
36
|
+
"parts": [],
|
|
37
|
+
"variants": {},
|
|
38
|
+
"defaultVariants": {},
|
|
39
|
+
"tokensUsed": [
|
|
40
|
+
"--cue-accent",
|
|
41
|
+
"--cue-fg-muted",
|
|
42
|
+
"--cue-font-mono",
|
|
43
|
+
"--cue-radius-control",
|
|
44
|
+
"--cue-space-2",
|
|
45
|
+
"--cue-text-label"
|
|
46
|
+
],
|
|
47
|
+
"summary": "A ramp drawn as a strip: equal cells, no gaps, in order.",
|
|
48
|
+
"examples": [
|
|
49
|
+
{
|
|
50
|
+
"title": "Usage",
|
|
51
|
+
"code": "<ChartRamp label=\"Density\" colors={accentRamp()} />",
|
|
52
|
+
"language": "tsx"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"status": "todo-docs",
|
|
56
|
+
"url": "/docs/components/chart-ramp",
|
|
57
|
+
"mdUrl": "/docs/components/chart-ramp.md",
|
|
58
|
+
"jsonUrl": "/r/components/chart-ramp.json",
|
|
59
|
+
"specimens": [
|
|
60
|
+
{
|
|
61
|
+
"title": "RAMPS / accentRamp()",
|
|
62
|
+
"group": "charts",
|
|
63
|
+
"components": [
|
|
64
|
+
"ChartRamp"
|
|
65
|
+
],
|
|
66
|
+
"code": "<div className=\"flex w-full flex-col gap-(--cue-space-4)\">\n {RAMP_NAMES.map((name) => (\n <ChartRamp\n key={name}\n label={name}\n colors={RAMPS[name].map((band) => band.color)}\n />\n ))}\n {ramp.length === 0 ? null : <ChartRamp label=\"accent, 9 steps\" colors={ramp} />}\n</div>",
|
|
67
|
+
"note": "Ordered scales rather than categorical ones: four ported frequency ramps that never re-hue (a listener who has learnt `bass is red` must not relearn it), and one sequential ramp derived from the live accent.",
|
|
68
|
+
"interaction": "none."
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"todo": true
|
|
72
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ChartSwatch",
|
|
3
|
+
"slug": "chart-swatch",
|
|
4
|
+
"group": "charts",
|
|
5
|
+
"importPath": "@cueplusplus/ui/charts",
|
|
6
|
+
"peerDependencies": [],
|
|
7
|
+
"clientOnly": false,
|
|
8
|
+
"description": "One colour and what it means: the atom a chart legend is built from.\n\nThe chip is `aria-hidden` and the label is plain text, so the meaning survives\nwithout colour vision (WCAG 1.4.1). A swatch with no label is decoration and\nannounces nothing at all, which is the honest reading of a colour with no\ncaption.\n\nStatic markup — no `\"use client\"`.",
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "color",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": true,
|
|
14
|
+
"defaultValue": null,
|
|
15
|
+
"description": "The colour to show. Any CSS colour, including a `var()` reference."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "label",
|
|
19
|
+
"type": "ReactNode",
|
|
20
|
+
"required": false,
|
|
21
|
+
"defaultValue": null,
|
|
22
|
+
"description": "What the colour stands for. Omit for a bare chip."
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"typeReferences": [
|
|
26
|
+
"Omit<React.ComponentPropsWithoutRef<\"span\">, \"children\" | \"color\">"
|
|
27
|
+
],
|
|
28
|
+
"subcomponents": [],
|
|
29
|
+
"parts": [],
|
|
30
|
+
"variants": {},
|
|
31
|
+
"defaultVariants": {},
|
|
32
|
+
"tokensUsed": [
|
|
33
|
+
"--cue-accent",
|
|
34
|
+
"--cue-fg-muted",
|
|
35
|
+
"--cue-font-mono",
|
|
36
|
+
"--cue-radius-control",
|
|
37
|
+
"--cue-space-2",
|
|
38
|
+
"--cue-text-label"
|
|
39
|
+
],
|
|
40
|
+
"summary": "One colour and what it means: the atom a chart legend is built from.",
|
|
41
|
+
"examples": [
|
|
42
|
+
{
|
|
43
|
+
"title": "Usage",
|
|
44
|
+
"code": "{BANDS_7.map((band) => <ChartSwatch key={band.id} color={band.color} label={band.label} />)}",
|
|
45
|
+
"language": "tsx"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"status": "todo-docs",
|
|
49
|
+
"url": "/docs/components/chart-swatch",
|
|
50
|
+
"mdUrl": "/docs/components/chart-swatch.md",
|
|
51
|
+
"jsonUrl": "/r/components/chart-swatch.json",
|
|
52
|
+
"specimens": [
|
|
53
|
+
{
|
|
54
|
+
"title": "chartTones() / ChartSwatch",
|
|
55
|
+
"group": "charts",
|
|
56
|
+
"components": [
|
|
57
|
+
"ChartSwatch"
|
|
58
|
+
],
|
|
59
|
+
"code": "<Panel className=\"flex w-full flex-wrap gap-(--cue-space-4) p-(--cue-space-4)\">\n {CHART_TONE_TOKENS.map((token, index) => (\n <ChartSwatch key={token} color={chartToneVar(index)} label={token} />\n ))}\n {Array.from({ length: 9 }, (_, index) => (\n <ChartSwatch\n key={`extended-${index}`}\n color={chartToneVar(CHART_TONE_TOKENS.length + index)}\n label={`hue ${index + 1}`}\n />\n ))}\n</Panel>",
|
|
60
|
+
"note": "The categorical palette: the theme's six status colours first, then nine generated oklch hues at fixed lightness and chroma for when six run out. Resolved at render, so switching theme reharmonises every chart on the page without a subscription.",
|
|
61
|
+
"interaction": "none. A swatch is a readout."
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"todo": true
|
|
65
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ChartTooltipContent",
|
|
3
|
+
"slug": "chart-tooltip-content",
|
|
4
|
+
"group": "charts",
|
|
5
|
+
"importPath": "@cueplusplus/ui/charts",
|
|
6
|
+
"peerDependencies": [],
|
|
7
|
+
"clientOnly": false,
|
|
8
|
+
"description": "The tooltip surface: an overlay, styled like every other overlay.\n\nA chart tooltip *is* a floating surface, so it gets exactly what a Popover\ngets — `surface-2` fill, the overlay rim, one soft shadow — from\n`_surface.ts` rather than from a second, chart-only recipe that would drift.\nWhat it adds is the reading discipline the rest of the system uses for\nnumbers: mono, tabular figures, values right-aligned so a column of them lines\nup under the pointer.\n\nReturns `null` when the pointer is off the plot or the payload is empty,\nbecause recharts keeps the content mounted between hovers.\n\n`formatter` and `labelFormatter` may equally be set on the `<Tooltip>` itself:\nrecharts forwards its own configuration into cloned content, so both spellings\nland here. Everything else in that configuration is dropped rather than\nrendered — see {@link domProps} — which also means a handler passed to this\ncomponent does not reach the surface. Nothing would fire on it anyway: the\ntooltip is drawn under the pointer, not in its path.",
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "active",
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"required": false,
|
|
14
|
+
"defaultValue": null,
|
|
15
|
+
"description": "Whether the pointer is on the plot. Recharts supplies this."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "payload",
|
|
19
|
+
"type": "readonly ChartTooltipEntry[]",
|
|
20
|
+
"required": false,
|
|
21
|
+
"defaultValue": null,
|
|
22
|
+
"description": "One entry per series at the hovered index. Recharts supplies this."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "label",
|
|
26
|
+
"type": "ReactNode",
|
|
27
|
+
"required": false,
|
|
28
|
+
"defaultValue": null,
|
|
29
|
+
"description": "The hovered category — the x value. Recharts supplies this."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "hideLabel",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"required": false,
|
|
35
|
+
"defaultValue": "false",
|
|
36
|
+
"description": "Drop the label line, for a chart whose x axis needs no restating."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "hideIndicator",
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"required": false,
|
|
42
|
+
"defaultValue": "false",
|
|
43
|
+
"description": "Drop the per-row colour chips, for a single-series chart."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "labelFormatter",
|
|
47
|
+
"type": "((label: ReactNode, payload: readonly ChartTooltipEntry[]) => ReactNode)",
|
|
48
|
+
"required": false,
|
|
49
|
+
"defaultValue": null,
|
|
50
|
+
"description": "Format the label line."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "formatter",
|
|
54
|
+
"type": "((value: string | number | readonly (string | number)[], name: ReactNode, entry: ChartTooltipEntry, index: number) => ReactNode)",
|
|
55
|
+
"required": false,
|
|
56
|
+
"defaultValue": null,
|
|
57
|
+
"description": "Format one row's value. Return the unit too if you want to own it."
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"typeReferences": [
|
|
61
|
+
"Omit<React.ComponentPropsWithoutRef<\"div\">, \"children\" | \"content\">"
|
|
62
|
+
],
|
|
63
|
+
"subcomponents": [],
|
|
64
|
+
"parts": [],
|
|
65
|
+
"variants": {},
|
|
66
|
+
"defaultVariants": {},
|
|
67
|
+
"tokensUsed": [
|
|
68
|
+
"--cue-accent-soft",
|
|
69
|
+
"--cue-bg",
|
|
70
|
+
"--cue-border",
|
|
71
|
+
"--cue-border-overlay",
|
|
72
|
+
"--cue-control-sm",
|
|
73
|
+
"--cue-danger",
|
|
74
|
+
"--cue-fg",
|
|
75
|
+
"--cue-fg-muted",
|
|
76
|
+
"--cue-fg-subtle",
|
|
77
|
+
"--cue-font-mono",
|
|
78
|
+
"--cue-radius-control",
|
|
79
|
+
"--cue-radius-overlay",
|
|
80
|
+
"--cue-scrim",
|
|
81
|
+
"--cue-space-1",
|
|
82
|
+
"--cue-space-2",
|
|
83
|
+
"--cue-space-3",
|
|
84
|
+
"--cue-surface-2",
|
|
85
|
+
"--cue-text-emphasis",
|
|
86
|
+
"--cue-text-label",
|
|
87
|
+
"--cue-text-ui"
|
|
88
|
+
],
|
|
89
|
+
"summary": "The tooltip surface: an overlay, styled like every other overlay.",
|
|
90
|
+
"examples": [
|
|
91
|
+
{
|
|
92
|
+
"title": "Usage",
|
|
93
|
+
"code": "<Tooltip cursor={chartTooltipCursor} content={<ChartTooltipContent />} />",
|
|
94
|
+
"language": "tsx"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"status": "todo-docs",
|
|
98
|
+
"url": "/docs/components/chart-tooltip-content",
|
|
99
|
+
"mdUrl": "/docs/components/chart-tooltip-content.md",
|
|
100
|
+
"jsonUrl": "/r/components/chart-tooltip-content.json",
|
|
101
|
+
"specimens": [
|
|
102
|
+
{
|
|
103
|
+
"title": "ChartTooltipContent",
|
|
104
|
+
"group": "charts",
|
|
105
|
+
"components": [
|
|
106
|
+
"ChartTooltipContent"
|
|
107
|
+
],
|
|
108
|
+
"code": "<div className=\"w-fit\">\n <ChartTooltipContent\n active\n label=\"19:30\"\n payload={[\n { name: \"output\", value: 68, color: \"var(--cue-accent)\", unit: \"%\" },\n { name: \"dropped\", value: 3, color: \"var(--cue-danger)\", unit: \"%\" },\n ]}\n />\n</div>",
|
|
109
|
+
"note": "The tooltip surface on its own, so a chart drawn from raw recharts parts can still wear it. Shown here mounted rather than hovered.",
|
|
110
|
+
"interaction": "in a chart it is positioned by recharts; the styling is the same either way."
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"todo": true
|
|
114
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "CheckboxGroup",
|
|
3
|
+
"slug": "checkbox-group",
|
|
4
|
+
"group": "forms",
|
|
5
|
+
"importPath": "@cueplusplus/ui",
|
|
6
|
+
"peerDependencies": [],
|
|
7
|
+
"clientOnly": true,
|
|
8
|
+
"description": "Shared state for a set of {@link Checkbox}es: one `value` array in, one out.\n\nGive it an accessible name (`aria-label`, or a {@link FieldLabel } inside a\n{@link Field }) — a group of checkboxes with no name is a list of unrelated\ntoggles as far as a screen reader is concerned.",
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "className",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": false,
|
|
14
|
+
"defaultValue": null,
|
|
15
|
+
"description": "Extra classes, merged over the vertical stack defaults."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"typeReferences": [
|
|
19
|
+
"Omit<BaseCheckboxGroup.Props, \"className\">"
|
|
20
|
+
],
|
|
21
|
+
"subcomponents": [],
|
|
22
|
+
"parts": [],
|
|
23
|
+
"variants": {},
|
|
24
|
+
"defaultVariants": {},
|
|
25
|
+
"tokensUsed": [
|
|
26
|
+
"--cue-accent",
|
|
27
|
+
"--cue-accent-fg",
|
|
28
|
+
"--cue-border",
|
|
29
|
+
"--cue-border-strong",
|
|
30
|
+
"--cue-danger",
|
|
31
|
+
"--cue-fg",
|
|
32
|
+
"--cue-fg-muted",
|
|
33
|
+
"--cue-font-mono",
|
|
34
|
+
"--cue-icon-md",
|
|
35
|
+
"--cue-icon-sm",
|
|
36
|
+
"--cue-radius-control",
|
|
37
|
+
"--cue-space-2",
|
|
38
|
+
"--cue-space-3",
|
|
39
|
+
"--cue-sunken",
|
|
40
|
+
"--cue-text-ui"
|
|
41
|
+
],
|
|
42
|
+
"summary": "Shared state for a set of {@link Checkbox}es: one `value` array in, one out.",
|
|
43
|
+
"examples": [
|
|
44
|
+
{
|
|
45
|
+
"title": "Usage",
|
|
46
|
+
"code": "<CheckboxGroup aria-label=\"Attributes\" value={attrs} onValueChange={setAttrs}>\n <Checkbox value=\"pan\" label=\"Pan\" />\n <Checkbox value=\"tilt\" label=\"Tilt\" />\n</CheckboxGroup>",
|
|
47
|
+
"language": "tsx"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"status": "todo-docs",
|
|
51
|
+
"url": "/docs/components/checkbox-group",
|
|
52
|
+
"mdUrl": "/docs/components/checkbox-group.md",
|
|
53
|
+
"jsonUrl": "/r/components/checkbox-group.json",
|
|
54
|
+
"specimens": [
|
|
55
|
+
{
|
|
56
|
+
"title": "Checkbox / CheckboxGroup",
|
|
57
|
+
"group": "forms",
|
|
58
|
+
"components": [
|
|
59
|
+
"Checkbox",
|
|
60
|
+
"CheckboxGroup"
|
|
61
|
+
],
|
|
62
|
+
"code": "<div className=\"grid w-full gap-(--cue-space-5) lg:grid-cols-2\">\n <Specimens>\n <Specimen label=\"checked\">\n <Checkbox label=\"Art-Net\" defaultChecked />\n </Specimen>\n <Specimen label=\"unchecked\">\n <Checkbox label=\"sACN\" />\n </Specimen>\n <Specimen label=\"indeterminate\">\n <Checkbox label=\"All protocols\" indeterminate />\n </Specimen>\n <Specimen label=\"disabled\">\n <Checkbox label=\"Timecode\" disabled />\n </Specimen>\n <Specimen label=\"sm\">\n <Checkbox label=\"Small\" size=\"sm\" defaultChecked />\n </Specimen>\n </Specimens>\n <CheckboxGroup\n aria-label=\"Output protocols\"\n defaultValue={[\"artnet\"]}\n className=\"flex flex-col gap-(--cue-space-3)\"\n >\n <Checkbox name=\"artnet\" label=\"Art-Net\" />\n <Checkbox name=\"sacn\" label=\"sACN\" />\n <Checkbox name=\"osc\" label=\"OSC\" />\n </CheckboxGroup>\n</div>",
|
|
63
|
+
"note": "Two sizes and a real indeterminate state, wired as a parent of its group.",
|
|
64
|
+
"interaction": "Space toggles; the group's parent box drives and reflects its children."
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"todo": true
|
|
68
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Checkbox",
|
|
3
|
+
"slug": "checkbox",
|
|
4
|
+
"group": "forms",
|
|
5
|
+
"importPath": "@cueplusplus/ui",
|
|
6
|
+
"peerDependencies": [],
|
|
7
|
+
"clientOnly": true,
|
|
8
|
+
"description": "A square, two- or three-state checkbox.\n\nSized from the density *icon* tokens rather than the control ladder: a\ncheckbox is a glyph, not a control chassis, and at ultra-compact density a\ncontrol-height box would dwarf the row it sits in. Checked fills with the\naccent and inks the tick in `accent-fg`, so it reads on every theme without\nper-theme branching.",
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "label",
|
|
12
|
+
"type": "ReactNode",
|
|
13
|
+
"required": false,
|
|
14
|
+
"defaultValue": null,
|
|
15
|
+
"description": "Inline label rendered beside the box and wrapped with it in a `<label>`, so\nthe text is both the accessible name and part of the hit target. Omit it and\npass `aria-label`, or let a {@link Field } name the control instead."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "className",
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": false,
|
|
21
|
+
"defaultValue": null,
|
|
22
|
+
"description": "Extra classes, merged over the box defaults."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "size",
|
|
26
|
+
"type": "\"sm\" | \"md\"",
|
|
27
|
+
"required": false,
|
|
28
|
+
"defaultValue": "md",
|
|
29
|
+
"description": "Rung of the density icon ladder for the box. Defaults to `\"md\"`."
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"typeReferences": [
|
|
33
|
+
"Omit<BaseCheckbox.Root.Props, \"className\">"
|
|
34
|
+
],
|
|
35
|
+
"subcomponents": [],
|
|
36
|
+
"parts": [],
|
|
37
|
+
"variants": {},
|
|
38
|
+
"defaultVariants": {},
|
|
39
|
+
"tokensUsed": [
|
|
40
|
+
"--cue-accent",
|
|
41
|
+
"--cue-accent-fg",
|
|
42
|
+
"--cue-border",
|
|
43
|
+
"--cue-border-strong",
|
|
44
|
+
"--cue-danger",
|
|
45
|
+
"--cue-fg",
|
|
46
|
+
"--cue-fg-muted",
|
|
47
|
+
"--cue-font-mono",
|
|
48
|
+
"--cue-icon-md",
|
|
49
|
+
"--cue-icon-sm",
|
|
50
|
+
"--cue-radius-control",
|
|
51
|
+
"--cue-space-2",
|
|
52
|
+
"--cue-space-3",
|
|
53
|
+
"--cue-sunken",
|
|
54
|
+
"--cue-text-ui"
|
|
55
|
+
],
|
|
56
|
+
"summary": "A square, two- or three-state box, sized from the density icon tokens.",
|
|
57
|
+
"examples": [
|
|
58
|
+
{
|
|
59
|
+
"title": "Usage",
|
|
60
|
+
"code": "<Checkbox label=\"Enable notifications\" defaultChecked />\n<Checkbox aria-label=\"Select row\" size=\"sm\" checked={selected} onCheckedChange={setSelected} />",
|
|
61
|
+
"language": "tsx"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"status": "stable",
|
|
65
|
+
"url": "/docs/components/checkbox",
|
|
66
|
+
"mdUrl": "/docs/components/checkbox.md",
|
|
67
|
+
"jsonUrl": "/r/components/checkbox.json",
|
|
68
|
+
"whenToUse": [
|
|
69
|
+
"Boolean values in a form, and row selection in a table.",
|
|
70
|
+
"Several related values at once. Wrap them in `CheckboxGroup`, which owns one array."
|
|
71
|
+
],
|
|
72
|
+
"whenNotToUse": [
|
|
73
|
+
"State that applies immediately. Use `Switch`.",
|
|
74
|
+
"One value out of several. Use `RadioGroup`."
|
|
75
|
+
],
|
|
76
|
+
"commonMistakes": [
|
|
77
|
+
"Leaving a `CheckboxGroup` without an accessible name, which turns it into a pile of unrelated toggles for a screen reader.",
|
|
78
|
+
"Using the indeterminate state as a third value. It means \"some of the children are checked\", nothing else."
|
|
79
|
+
],
|
|
80
|
+
"specimens": [
|
|
81
|
+
{
|
|
82
|
+
"title": "Checkbox / CheckboxGroup",
|
|
83
|
+
"group": "forms",
|
|
84
|
+
"components": [
|
|
85
|
+
"Checkbox",
|
|
86
|
+
"CheckboxGroup"
|
|
87
|
+
],
|
|
88
|
+
"code": "<div className=\"grid w-full gap-(--cue-space-5) lg:grid-cols-2\">\n <Specimens>\n <Specimen label=\"checked\">\n <Checkbox label=\"Art-Net\" defaultChecked />\n </Specimen>\n <Specimen label=\"unchecked\">\n <Checkbox label=\"sACN\" />\n </Specimen>\n <Specimen label=\"indeterminate\">\n <Checkbox label=\"All protocols\" indeterminate />\n </Specimen>\n <Specimen label=\"disabled\">\n <Checkbox label=\"Timecode\" disabled />\n </Specimen>\n <Specimen label=\"sm\">\n <Checkbox label=\"Small\" size=\"sm\" defaultChecked />\n </Specimen>\n </Specimens>\n <CheckboxGroup\n aria-label=\"Output protocols\"\n defaultValue={[\"artnet\"]}\n className=\"flex flex-col gap-(--cue-space-3)\"\n >\n <Checkbox name=\"artnet\" label=\"Art-Net\" />\n <Checkbox name=\"sacn\" label=\"sACN\" />\n <Checkbox name=\"osc\" label=\"OSC\" />\n </CheckboxGroup>\n</div>",
|
|
89
|
+
"note": "Two sizes and a real indeterminate state, wired as a parent of its group.",
|
|
90
|
+
"interaction": "Space toggles; the group's parent box drives and reflects its children."
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Chip",
|
|
3
|
+
"slug": "chip",
|
|
4
|
+
"group": "primitives",
|
|
5
|
+
"importPath": "@cueplusplus/ui",
|
|
6
|
+
"peerDependencies": [],
|
|
7
|
+
"clientOnly": true,
|
|
8
|
+
"description": "A compact status/label pill: mono, uppercase, wide-tracked, one line tall.\n\n`tone` uses the shared status vocabulary (`ok | busy | warn | danger | info`)\nplus `neutral` and `accent`, so a chip, a `StatusDot` and a `Meter` always\nagree on what \"warn\" looks like.",
|
|
9
|
+
"props": [
|
|
10
|
+
{
|
|
11
|
+
"name": "interactive",
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"required": false,
|
|
14
|
+
"defaultValue": "false",
|
|
15
|
+
"description": "Render as a `<button>` with hover feedback instead of a static `<span>`.\nUse for filter pills and other clickable tags; leave off for pure labels."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "disabled",
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"required": false,
|
|
21
|
+
"defaultValue": null,
|
|
22
|
+
"description": "Disable the interactive form. Ignored when `interactive` is not set."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "children",
|
|
26
|
+
"type": "ReactNode",
|
|
27
|
+
"required": false,
|
|
28
|
+
"defaultValue": null,
|
|
29
|
+
"description": "Chip content — normally one or two words, or a short count."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "tone",
|
|
33
|
+
"type": "\"accent\" | \"danger\" | \"busy\" | \"neutral\" | \"ok\" | \"warn\" | \"info\"",
|
|
34
|
+
"required": false,
|
|
35
|
+
"defaultValue": "neutral",
|
|
36
|
+
"description": ""
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "variant",
|
|
40
|
+
"type": "\"outline\" | \"tinted\"",
|
|
41
|
+
"required": false,
|
|
42
|
+
"defaultValue": "tinted",
|
|
43
|
+
"description": ""
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"typeReferences": [
|
|
47
|
+
"React.HTMLAttributes<HTMLElement>",
|
|
48
|
+
"VariantProps<typeof chipVariants>"
|
|
49
|
+
],
|
|
50
|
+
"subcomponents": [],
|
|
51
|
+
"parts": [],
|
|
52
|
+
"variants": {
|
|
53
|
+
"tone": [
|
|
54
|
+
"neutral",
|
|
55
|
+
"accent",
|
|
56
|
+
"ok",
|
|
57
|
+
"busy",
|
|
58
|
+
"warn",
|
|
59
|
+
"danger",
|
|
60
|
+
"info"
|
|
61
|
+
],
|
|
62
|
+
"variant": [
|
|
63
|
+
"tinted",
|
|
64
|
+
"outline"
|
|
65
|
+
],
|
|
66
|
+
"interactive": [
|
|
67
|
+
"true",
|
|
68
|
+
"false"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"defaultVariants": {
|
|
72
|
+
"tone": "neutral",
|
|
73
|
+
"variant": "tinted",
|
|
74
|
+
"interactive": "false"
|
|
75
|
+
},
|
|
76
|
+
"tokensUsed": [
|
|
77
|
+
"--cue-accent",
|
|
78
|
+
"--cue-border",
|
|
79
|
+
"--cue-border-strong",
|
|
80
|
+
"--cue-busy",
|
|
81
|
+
"--cue-chip-h",
|
|
82
|
+
"--cue-danger",
|
|
83
|
+
"--cue-fg",
|
|
84
|
+
"--cue-fg-muted",
|
|
85
|
+
"--cue-font-mono",
|
|
86
|
+
"--cue-info",
|
|
87
|
+
"--cue-ok",
|
|
88
|
+
"--cue-radius-control",
|
|
89
|
+
"--cue-space-2",
|
|
90
|
+
"--cue-space-3",
|
|
91
|
+
"--cue-surface-2",
|
|
92
|
+
"--cue-text-label",
|
|
93
|
+
"--cue-warn"
|
|
94
|
+
],
|
|
95
|
+
"summary": "The status pill: tinted fill, hairline rim, full-strength text.",
|
|
96
|
+
"examples": [
|
|
97
|
+
{
|
|
98
|
+
"title": "Usage",
|
|
99
|
+
"code": "<Chip tone=\"ok\">online</Chip>\n<Chip tone=\"accent\" variant=\"outline\" interactive onClick={toggle}>dimmer</Chip>",
|
|
100
|
+
"language": "tsx"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"status": "stable",
|
|
104
|
+
"url": "/docs/components/chip",
|
|
105
|
+
"mdUrl": "/docs/components/chip.md",
|
|
106
|
+
"jsonUrl": "/r/components/chip.json",
|
|
107
|
+
"whenToUse": [
|
|
108
|
+
"A state, a tag or a short count sitting beside the thing it describes.",
|
|
109
|
+
"Filter pills, with `interactive` for the button semantics."
|
|
110
|
+
],
|
|
111
|
+
"whenNotToUse": [
|
|
112
|
+
"A single live state where a dot carries it. Use `StatusDot`.",
|
|
113
|
+
"A message the user has to read and act on. Use `Toast` or `FieldError`.",
|
|
114
|
+
"Anything that runs something. Use `Button`."
|
|
115
|
+
],
|
|
116
|
+
"commonMistakes": [
|
|
117
|
+
"Writing a sentence in a chip. One or two words, or a count.",
|
|
118
|
+
"Picking a tone for decoration. Tones are the status vocabulary shared with `StatusDot`, `Meter` and `Toast`."
|
|
119
|
+
],
|
|
120
|
+
"specimens": [
|
|
121
|
+
{
|
|
122
|
+
"title": "Chip",
|
|
123
|
+
"group": "primitives",
|
|
124
|
+
"components": [
|
|
125
|
+
"Chip"
|
|
126
|
+
],
|
|
127
|
+
"code": "<Specimens>\n {CHIP_TONES.map((tone) => (\n <Specimen key={tone} label={tone}>\n <Chip tone={tone}>{tone}</Chip>\n </Specimen>\n ))}\n</Specimens>\n<Specimens>\n {CHIP_TONES.map((tone) => (\n <Specimen key={tone} label={`${tone} outline`}>\n <Chip tone={tone} variant=\"outline\">\n {tone}\n </Chip>\n </Specimen>\n ))}\n</Specimens>\n<Specimens>\n <Specimen label=\"interactive\">\n <Chip tone=\"accent\" interactive>\n Universe 1\n </Chip>\n </Specimen>\n <Specimen label=\"disabled\">\n <Chip tone=\"accent\" interactive disabled>\n Universe 9\n </Chip>\n </Specimen>\n</Specimens>",
|
|
128
|
+
"note": "The tinted-chip recipe: a tone tint at low alpha, tone ink, tone border. Seven tones, two variants.",
|
|
129
|
+
"interaction": "static by default; pass `interactive` and it takes a hover ground and a focus ring."
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
}
|