@squadbase/vantage 0.6.2-dev1.05a930b → 0.6.2-dev1.0ad29b0
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/dist/{build-X5NVCQKT.js → build-A23M4GCH.js} +7 -7
- package/dist/{build-X5NVCQKT.js.map → build-A23M4GCH.js.map} +1 -1
- package/dist/{check-ZBIH422T.js → check-FBHT6W6J.js} +5 -5
- package/dist/{check-ZBIH422T.js.map → check-FBHT6W6J.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/chunk-57GHR5LN.js +163 -0
- package/dist/chunk-57GHR5LN.js.map +1 -0
- package/dist/{chunk-7DZGJQ3P.js → chunk-5C2SEDPH.js} +21 -4
- package/dist/chunk-5C2SEDPH.js.map +1 -0
- package/dist/chunk-6OTTGAPO.js +44 -0
- package/dist/chunk-6OTTGAPO.js.map +1 -0
- package/dist/{chunk-V3LF7BE7.js → chunk-ANZLVSEP.js} +4 -5
- package/dist/chunk-ANZLVSEP.js.map +1 -0
- package/dist/{chunk-XQUSGIDG.js → chunk-CKWPK4RO.js} +10 -3
- package/dist/chunk-CKWPK4RO.js.map +1 -0
- package/dist/chunk-JXFCSF3K.js +673 -0
- package/dist/chunk-JXFCSF3K.js.map +1 -0
- package/dist/{chunk-IUPSBD6W.js → chunk-QOXXOFGL.js} +23 -886
- package/dist/chunk-QOXXOFGL.js.map +1 -0
- package/dist/{chunk-CEXAQQ5W.js → chunk-S5MDTHH7.js} +180 -18
- package/dist/chunk-S5MDTHH7.js.map +1 -0
- package/dist/{chunk-2ICNHUG6.js → chunk-SDJTTMLK.js} +64 -7
- package/dist/chunk-SDJTTMLK.js.map +1 -0
- package/dist/{chunk-WAMZWZJB.js → chunk-SHZM3EXB.js} +19 -8
- package/dist/chunk-SHZM3EXB.js.map +1 -0
- package/dist/{chunk-JKLLFVEU.js → chunk-UWSQUHX6.js} +4 -99
- package/dist/chunk-UWSQUHX6.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +8 -2
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +11 -247
- package/dist/components/index.js +4 -1
- package/dist/delta-text-CvwBGJ95.d.ts +15 -0
- package/dist/{dev-4XEDTELV.js → dev-H4I2JL63.js} +7 -7
- package/dist/{dev-4XEDTELV.js.map → dev-H4I2JL63.js.map} +1 -1
- package/dist/doc/index.d.ts +215 -2
- package/dist/doc/index.js +307 -3
- package/dist/doc/index.js.map +1 -1
- package/dist/{doctor-5E2VEZPK.js → doctor-B2O3GJDU.js} +5 -5
- package/dist/{doctor-5E2VEZPK.js.map → doctor-B2O3GJDU.js.map} +1 -1
- package/dist/format-U0cQl069.d.ts +243 -0
- package/dist/query/index.js +2 -2
- package/dist/{routes-3SGAFDMC.js → routes-PVKNT777.js} +4 -4
- package/dist/{routes-3SGAFDMC.js.map → routes-PVKNT777.js.map} +1 -1
- package/dist/slide/index.d.ts +272 -1
- package/dist/slide/index.js +972 -2
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +6 -3
- package/dist/table/index.js.map +1 -1
- package/dist/{upgrade-JHXZBGQS.js → upgrade-6DT7ADRP.js} +4 -4
- package/dist/{upgrade-JHXZBGQS.js.map → upgrade-6DT7ADRP.js.map} +1 -1
- package/dist/vite/index.js +3 -3
- package/docs/en/changelog.md +2 -0
- package/docs/en/components.md +13 -2
- package/docs/en/doc/delta-text.md +40 -0
- package/docs/en/doc/doc-action-items.md +49 -0
- package/docs/en/doc/doc-callout.md +38 -0
- package/docs/en/doc/doc-data-table.md +60 -0
- package/docs/en/doc/doc-executive-summary.md +64 -0
- package/docs/en/doc/doc-figure.md +56 -0
- package/docs/en/doc/doc-key-findings.md +61 -0
- package/docs/en/doc/doc-kpi-scorecard.md +80 -0
- package/docs/en/doc/doc-notes-and-sources.md +43 -0
- package/docs/en/doc/doc-report-header.md +46 -0
- package/docs/en/pages-and-metadata.md +15 -0
- package/docs/en/parts/area-chart.md +99 -0
- package/docs/en/parts/bar-chart.md +91 -0
- package/docs/en/parts/bar-list.md +50 -0
- package/docs/en/parts/category-bar.md +37 -0
- package/docs/en/parts/chart-frame.md +39 -0
- package/docs/en/parts/delta.md +4 -3
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/funnel-steps.md +2 -1
- package/docs/en/parts/heatmap.md +53 -0
- package/docs/en/parts/kpi-card.md +2 -1
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/progress-circle.md +33 -0
- package/docs/en/parts/sample-data.md +39 -0
- package/docs/en/parts/scatter-chart.md +56 -0
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-full.md +48 -0
- package/docs/en/slide/slide-chart-insight.md +52 -0
- package/docs/en/slide/slide-columns.md +46 -0
- package/docs/en/slide/slide-comparison.md +68 -0
- package/docs/en/slide/slide-cover.md +39 -0
- package/docs/en/slide/slide-exec-summary.md +47 -0
- package/docs/en/slide/slide-heading.md +38 -0
- package/docs/en/slide/slide-kpi-grid.md +55 -0
- package/docs/en/slide/slide-kpi-hero.md +58 -0
- package/docs/en/slide/slide-next-actions.md +49 -0
- package/docs/en/slide/slide-scorecard-table.md +54 -0
- package/docs/en/slide/slide-section.md +44 -0
- package/docs/en/slide/slide-source-line.md +34 -0
- package/docs/en/ui/alert-dialog.md +42 -0
- package/docs/en/ui/avatar.md +31 -0
- package/docs/en/ui/combobox.md +74 -0
- package/docs/en/ui/drawer.md +41 -0
- package/docs/en/ui/empty.md +1 -1
- package/docs/en/ui/error-state.md +4 -3
- package/docs/en/ui/field.md +42 -0
- package/docs/en/ui/hover-card.md +21 -0
- package/docs/en/ui/kbd.md +17 -0
- package/docs/en/ui/loading.md +1 -1
- package/docs/en/ui/pagination.md +36 -0
- package/docs/en/ui/radio-group.md +21 -0
- package/docs/en/ui/toast.md +44 -0
- package/docs/en/ui/toggle-group.md +4 -3
- package/docs/index.json +857 -77
- package/docs/ja/changelog.md +2 -0
- package/docs/ja/components.md +12 -1
- package/docs/ja/doc/delta-text.md +40 -0
- package/docs/ja/doc/doc-action-items.md +49 -0
- package/docs/ja/doc/doc-callout.md +38 -0
- package/docs/ja/doc/doc-data-table.md +60 -0
- package/docs/ja/doc/doc-executive-summary.md +64 -0
- package/docs/ja/doc/doc-figure.md +56 -0
- package/docs/ja/doc/doc-key-findings.md +61 -0
- package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
- package/docs/ja/doc/doc-notes-and-sources.md +43 -0
- package/docs/ja/doc/doc-report-header.md +46 -0
- package/docs/ja/page-types/slide.md +1 -0
- package/docs/ja/pages-and-metadata.md +15 -0
- package/docs/ja/parts/area-chart.md +49 -25
- package/docs/ja/parts/bar-chart.md +50 -24
- package/docs/ja/parts/bar-list.md +31 -8
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/delta.md +5 -4
- package/docs/ja/parts/donut-chart.md +45 -26
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +2 -1
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +48 -22
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/slide/slide-chart-full.md +48 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -0
- package/docs/ja/slide/slide-columns.md +46 -0
- package/docs/ja/slide/slide-comparison.md +68 -0
- package/docs/ja/slide/slide-cover.md +39 -0
- package/docs/ja/slide/slide-exec-summary.md +47 -0
- package/docs/ja/slide/slide-heading.md +38 -0
- package/docs/ja/slide/slide-kpi-grid.md +55 -0
- package/docs/ja/slide/slide-kpi-hero.md +58 -0
- package/docs/ja/slide/slide-next-actions.md +49 -0
- package/docs/ja/slide/slide-scorecard-table.md +54 -0
- package/docs/ja/slide/slide-section.md +44 -0
- package/docs/ja/slide/slide-source-line.md +34 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/toggle-group.md +4 -3
- package/package.json +2 -2
- package/registry/ui/delta.tsx +7 -4
- package/registry/ui/echart.tsx +123 -1
- package/registry/ui/kpi-card.tsx +9 -4
- package/skills/vantage-design/SKILL.md +27 -25
- package/skills/vantage-design/references/extract.md +16 -14
- package/skills/vantage-design/references/format.md +6 -5
- package/skills/vantage-design/references/presets.md +60 -110
- package/skills/vantage-pitfalls/SKILL.md +5 -0
- package/skills/vantage-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +4 -2
- package/templates/agents/doc.md +48 -0
- package/templates/agents/page.md +22 -1
- package/templates/agents/slide.md +70 -2
- package/theme.css +10 -7
- package/dist/chunk-2ICNHUG6.js.map +0 -1
- package/dist/chunk-7DZGJQ3P.js.map +0 -1
- package/dist/chunk-CEXAQQ5W.js.map +0 -1
- package/dist/chunk-IUPSBD6W.js.map +0 -1
- package/dist/chunk-JKLLFVEU.js.map +0 -1
- package/dist/chunk-V3LF7BE7.js.map +0 -1
- package/dist/chunk-WAMZWZJB.js.map +0 -1
- package/dist/chunk-XQUSGIDG.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# SlideScorecardTable
|
|
2
|
+
|
|
3
|
+
> A scorecard table — target vs actual per metric, with a status.
|
|
4
|
+
|
|
5
|
+
A table of target, actual and attainment per metric with a status (on track / at risk / off track). The status is a coloured dot and a word, so colour is never the only cue.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SlideScorecardTable } from "@squadbase/vantage/slide";
|
|
9
|
+
import type { SlideScorecardTableProps, SlideScorecardRow, SlideScorecardStatus } from "@squadbase/vantage/slide";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> [!NOTE]
|
|
13
|
+
> This is **the content of one `<Slide>`**. It does not include `<Slide>` itself, so put it directly inside one. The root fills the canvas (1920×1080) at 100% and takes no `className`. Margins, text sizes and the grid are fixed inside the block (a 12-column grid on 1920×1080), so don't add your own dimensions. For how to build a deck, see [Slide](page-types/slide). The labels the block adds are fixed in Japanese: the status words (順調 / 要注意 / 遅延) and the `asOf` / `source` line (「… 時点」, 「出典: …」) cannot be overridden. The header words can be replaced with `columns` (default 指標 / 目標 / 実績 / 達成率 / 状態); `title`, `rows[].metric` and `rows[].display` are your own text.
|
|
14
|
+
|
|
15
|
+
## Props
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Default | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `title` | `string` | | The conclusion as one sentence (an action title). **Required.** |
|
|
20
|
+
| `rows` | `SlideScorecardRow[]` | | Rows, up to 8. **Required.** Each row is described in the `rows[].…` rows below. |
|
|
21
|
+
| `rows[].metric` | `string` | | The metric name (about 20 characters at most). **Required.** |
|
|
22
|
+
| `rows[].value` | `number \| null` | | The actual. `null` shows 「—」. **Required.** |
|
|
23
|
+
| `rows[].format` | `ValueFormat` | | How to format `value` and `target` (`"currency"`, `"percent"`, …). |
|
|
24
|
+
| `rows[].display` | `string` | | Replaces the shown actual only (the number behind it stays `value`). |
|
|
25
|
+
| `rows[].target` | `number` | | The target, in the same `format` as `value`. When any row has a target, the attainment column appears (value ÷ target). |
|
|
26
|
+
| `rows[].betterWhen` | `"up" \| "down"` | `"up"` | Which direction is good. With `"down"` the rate is target ÷ value, so beating a cost target reads above 100%. |
|
|
27
|
+
| `rows[].status` | `SlideScorecardStatus` | | `"on"` (順調) / `"risk"` (要注意) / `"off"` (遅延). Given, not derived from the values. **Required.** |
|
|
28
|
+
| `columns` | `Partial<Record<"metric" \| "target" \| "actual" \| "attainment" \| "status", string>>` | | Override header words; omitted columns keep the default (指標 / 目標 / 実績 / 達成率 / 状態). The status words (順調 / 要注意 / 遅延) cannot be overridden. |
|
|
29
|
+
| `asOf` | `string` | | The date the numbers were taken, date only (e.g. `"2026-10-01"`). The block adds 「時点」 once, so don't write it. The label is fixed in Japanese. |
|
|
30
|
+
| `source` | `string` | | Where the numbers come from (e.g. `"社内 BI"`). Shown as 「出典: 社内 BI」; the "出典:" label is fixed in Japanese. |
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { Slide, SlideScorecardTable } from "@squadbase/vantage/slide";
|
|
36
|
+
|
|
37
|
+
<Slide>
|
|
38
|
+
<SlideScorecardTable
|
|
39
|
+
title="4 指標のうち 2 つが目標どおり、解約と新規が遅れている"
|
|
40
|
+
rows={[
|
|
41
|
+
{ metric: "月次売上", value: 540_000_000, target: 520_000_000, format: "currency", status: "on" },
|
|
42
|
+
{ metric: "継続率", value: 0.982, target: 0.98, format: { type: "percent", digits: 1 }, status: "on" },
|
|
43
|
+
{ metric: "解約率", value: 0.018, target: 0.015, format: { type: "percent", digits: 1 }, betterWhen: "down", status: "risk" },
|
|
44
|
+
{ metric: "新規獲得", value: 38, target: 50, format: { type: "number", unit: "社" }, status: "off" },
|
|
45
|
+
]}
|
|
46
|
+
asOf="2026-10-01"
|
|
47
|
+
source="社内 BI"
|
|
48
|
+
/>
|
|
49
|
+
</Slide>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- From 7 rows the text drops from body to caption size. More than 8 are drawn with a `console.warn`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# SlideSection
|
|
2
|
+
|
|
3
|
+
> A chapter divider — the chapter title, optionally with an agenda.
|
|
4
|
+
|
|
5
|
+
A slide that divides the deck into chapters. The chapter title sits on the left; with `items` the right side shows a numbered agenda with the `current` chapter emphasised.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SlideSection } from "@squadbase/vantage/slide";
|
|
9
|
+
import type { SlideSectionProps } from "@squadbase/vantage/slide";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> [!NOTE]
|
|
13
|
+
> This is **the content of one `<Slide>`**. It does not include `<Slide>` itself, so put it directly inside one. The root fills the canvas (1920×1080) at 100% and takes no `className`. Margins, text sizes and the grid are fixed inside the block (a 12-column grid on 1920×1080), so don't add your own dimensions. For how to build a deck, see [Slide](page-types/slide). The labels the block adds (「… 時点」, 「出典: …」) are fixed in Japanese; `title`, `lead`, `points` and the like are your own text.
|
|
14
|
+
|
|
15
|
+
## Props
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `title` | `string` | The chapter title. **Required.** |
|
|
20
|
+
| `index` | `number` | The chapter number, shown above the title as two digits ("02"). |
|
|
21
|
+
| `lead` | `string` | One line saying what the chapter answers. |
|
|
22
|
+
| `items` | `string[]` | The chapters of the deck, shown at the right as a numbered agenda. One line each, so about 6 at most. Without it the title takes the full width. |
|
|
23
|
+
| `current` | `number` | The chapter in `items` to emphasise (1-based). |
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { Slide, SlideSection } from "@squadbase/vantage/slide";
|
|
29
|
+
|
|
30
|
+
<Slide>
|
|
31
|
+
<SlideSection
|
|
32
|
+
index={2}
|
|
33
|
+
title="Churn trends"
|
|
34
|
+
lead="Which segments leave, and when"
|
|
35
|
+
items={["Overview", "Churn trends", "Drivers", "Next actions"]}
|
|
36
|
+
current={2}
|
|
37
|
+
/>
|
|
38
|
+
</Slide>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- It has no reveal steps. If you want one, wrap it yourself (for example in `Steps`).
|
|
44
|
+
- The agenda numbers are assigned from the order of `items`; `index` only controls the chapter number above the title.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# SlideSourceLine
|
|
2
|
+
|
|
3
|
+
> [Part] The footer line of one slide — as-of date, source and page number.
|
|
4
|
+
|
|
5
|
+
The footer line of one slide: the data's as-of date and source, and optionally the page number at the right. It is a **part** for the bottom row of a slide's 12-column grid, not a whole-slide block. It renders nothing when it has nothing to show.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { SlideSourceLine } from "@squadbase/vantage/slide";
|
|
9
|
+
import type { SlideSourceLineProps } from "@squadbase/vantage/slide";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
> [!NOTE]
|
|
13
|
+
> This is **a slide part**, not a whole-slide block. Place it as a row in the 12-column grid inside a `<Slide>`; its root does not fill the canvas (100%×100%). All dimensions are fixed inside the part, so do not add your own. For how to build a deck, see [Slide](page-types/slide).
|
|
14
|
+
|
|
15
|
+
## Props
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `asOf` | `string` | The date the numbers were taken, date only (e.g. `"2026-10-20"`). Shown as 「2026-10-20 時点」; don't write 「時点」 yourself. |
|
|
20
|
+
| `source` | `string` | Where the numbers come from (e.g. `"BI"`). Shown as 「出典: BI」. |
|
|
21
|
+
| `page` | `{ current: number; total: number }` | The page number, shown at the right as "3 / 12". Passed in by the caller. |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { SlideSourceLine } from "@squadbase/vantage/slide";
|
|
27
|
+
|
|
28
|
+
<SlideSourceLine asOf="2026-10-20" source="BI" page={{ current: 3, total: 12 }} />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Notes
|
|
32
|
+
|
|
33
|
+
- The page number is passed through `page` because SquadKit cannot read the slide's position from the framework.
|
|
34
|
+
- 「… 時点」 and 「出典: …」 are fixed in Japanese.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Alert Dialog
|
|
2
|
+
|
|
3
|
+
> A modal that asks for confirmation before an irreversible action.
|
|
4
|
+
|
|
5
|
+
A modal that asks for an explicit answer before an action that can't be undone, such as a delete.
|
|
6
|
+
Unlike [`Dialog`](ui/dialog), it does not close when the backdrop is clicked.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
AlertDialog,
|
|
11
|
+
AlertDialogTrigger,
|
|
12
|
+
AlertDialogContent,
|
|
13
|
+
AlertDialogHeader,
|
|
14
|
+
AlertDialogMedia,
|
|
15
|
+
AlertDialogTitle,
|
|
16
|
+
AlertDialogDescription,
|
|
17
|
+
AlertDialogFooter,
|
|
18
|
+
AlertDialogCancel,
|
|
19
|
+
AlertDialogAction,
|
|
20
|
+
} from "@squadbase/vantage/ui";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Parts
|
|
24
|
+
|
|
25
|
+
| Part | Role |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `AlertDialog` | The state: `open` / `defaultOpen` / `onOpenChange` |
|
|
28
|
+
| `AlertDialogTrigger` | What opens it; `render` turns it into a button |
|
|
29
|
+
| `AlertDialogContent` | The panel. `size` picks the width |
|
|
30
|
+
| `AlertDialogMedia` | The icon tile beside the heading |
|
|
31
|
+
| `AlertDialogHeader` / `AlertDialogTitle` / `AlertDialogDescription` | The heading block |
|
|
32
|
+
| `AlertDialogFooter` | The button row |
|
|
33
|
+
| `AlertDialogCancel` | The dismiss button (`variant="outline"` by default; also takes `size`) |
|
|
34
|
+
| `AlertDialogAction` | The confirm button. Takes the `Button` props as they are |
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
| --- | --- | --- | --- |
|
|
38
|
+
| `size` | `"default" \| "sm"` | `"default"` | Passed to `AlertDialogContent`. `sm` lays the buttons out in two columns. |
|
|
39
|
+
|
|
40
|
+
`AlertDialogAction` **does not close the dialog on its own**. Set `open` to `false` when your work
|
|
41
|
+
finishes. If it is fine to close immediately, use `AlertDialogCancel` instead and give it the
|
|
42
|
+
`variant` you want, since it closes the dialog.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
> A user's photo or initials.
|
|
4
|
+
|
|
5
|
+
Shows a user or owner as a small circle. When the image fails to load, or there is no `src`, it
|
|
6
|
+
shows the content of `AvatarFallback` (initials, for example).
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
Avatar,
|
|
11
|
+
AvatarImage,
|
|
12
|
+
AvatarFallback,
|
|
13
|
+
AvatarBadge,
|
|
14
|
+
AvatarGroup,
|
|
15
|
+
AvatarGroupCount,
|
|
16
|
+
} from "@squadbase/vantage/ui";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Parts
|
|
20
|
+
|
|
21
|
+
| Part | Role |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `Avatar` | The frame. `size` picks the dimensions |
|
|
24
|
+
| `AvatarImage` | The image. Not rendered if loading fails |
|
|
25
|
+
| `AvatarFallback` | What shows when there is no image |
|
|
26
|
+
| `AvatarBadge` | A small dot at the bottom right (an online indicator, say) |
|
|
27
|
+
| `AvatarGroup` / `AvatarGroupCount` | Overlapping row. `AvatarGroupCount` is the remainder, such as "+4" |
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default | Description |
|
|
30
|
+
| --- | --- | --- | --- |
|
|
31
|
+
| `size` | `"default" \| "sm" \| "lg"` | `"default"` | Passed to `Avatar`. `sm` is 24px, `default` is 32px, `lg` is 40px. |
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Combobox
|
|
2
|
+
|
|
3
|
+
> A select you filter by typing.
|
|
4
|
+
|
|
5
|
+
An input where you type to narrow the options and pick one (or several). For just a few options,
|
|
6
|
+
[`Select`](ui/select) takes fewer steps. It is built on Base UI's `Combobox`.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
Combobox,
|
|
11
|
+
ComboboxInput,
|
|
12
|
+
ComboboxContent,
|
|
13
|
+
ComboboxEmpty,
|
|
14
|
+
ComboboxList,
|
|
15
|
+
ComboboxItem,
|
|
16
|
+
ComboboxGroup,
|
|
17
|
+
ComboboxLabel,
|
|
18
|
+
ComboboxCollection,
|
|
19
|
+
ComboboxSeparator,
|
|
20
|
+
ComboboxChips,
|
|
21
|
+
ComboboxChip,
|
|
22
|
+
ComboboxChipsInput,
|
|
23
|
+
ComboboxTrigger,
|
|
24
|
+
ComboboxValue,
|
|
25
|
+
useComboboxAnchor,
|
|
26
|
+
} from "@squadbase/vantage/ui";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Parts
|
|
30
|
+
|
|
31
|
+
| Part | Role |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `Combobox` | The state: `items` / `value` / `defaultValue` / `onValueChange` / `multiple` |
|
|
34
|
+
| `ComboboxInput` | The input. `showTrigger` (default `true`) and `showClear` (default `false`) toggle the buttons on the right |
|
|
35
|
+
| `ComboboxContent` | The popup. `side` / `align` / `anchor` |
|
|
36
|
+
| `ComboboxList` | The options. Pass a function as the child and it receives the filtered `items` one by one |
|
|
37
|
+
| `ComboboxItem` | One option. `value` is required |
|
|
38
|
+
| `ComboboxEmpty` | Shown when nothing matches |
|
|
39
|
+
| `ComboboxGroup` / `ComboboxLabel` / `ComboboxCollection` / `ComboboxSeparator` | Grouping |
|
|
40
|
+
| `ComboboxChips` / `ComboboxChip` / `ComboboxChipsInput` | Show a multiple selection as chips. `ComboboxChip` has a remove button; `showRemove={false}` hides it |
|
|
41
|
+
| `ComboboxTrigger` / `ComboboxValue` | The button-opened form, without the input |
|
|
42
|
+
| `useComboboxAnchor` | A ref that makes the chip frame the popup's reference |
|
|
43
|
+
|
|
44
|
+
| Prop | Type | Default | Description |
|
|
45
|
+
| --- | --- | --- | --- |
|
|
46
|
+
| `items` | `readonly unknown[]` | | The options passed to `Combobox`. They are filtered as the user types and handed to the function in `ComboboxList`. |
|
|
47
|
+
| `multiple` | `boolean` | `false` | Allow selecting several. |
|
|
48
|
+
| `onValueChange` | `(value) => void` | | Called when the selection changes. In single-select mode it can also receive `null` for no selection. |
|
|
49
|
+
|
|
50
|
+
## Multiple selection
|
|
51
|
+
|
|
52
|
+
Add `multiple`, and place the chips and a `ComboboxChipsInput` inside `ComboboxChips`. To match the
|
|
53
|
+
popup's width to the chip frame, give the ref from `useComboboxAnchor()` to both
|
|
54
|
+
`ComboboxChips` and `ComboboxContent`.
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
const anchor = useComboboxAnchor();
|
|
58
|
+
|
|
59
|
+
<Combobox items={metrics} multiple>
|
|
60
|
+
<ComboboxChips ref={anchor}>
|
|
61
|
+
<ComboboxValue>
|
|
62
|
+
{(values: string[]) =>
|
|
63
|
+
values.map((v) => <ComboboxChip key={v}>{v}</ComboboxChip>)
|
|
64
|
+
}
|
|
65
|
+
</ComboboxValue>
|
|
66
|
+
<ComboboxChipsInput placeholder="Add a metric" />
|
|
67
|
+
</ComboboxChips>
|
|
68
|
+
<ComboboxContent anchor={anchor}>
|
|
69
|
+
<ComboboxList>
|
|
70
|
+
{(item: string) => <ComboboxItem key={item} value={item}>{item}</ComboboxItem>}
|
|
71
|
+
</ComboboxList>
|
|
72
|
+
</ComboboxContent>
|
|
73
|
+
</Combobox>;
|
|
74
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
> A panel you swipe in and out from the edge of the screen.
|
|
4
|
+
|
|
5
|
+
A panel that comes in from the bottom of the screen (or any edge). You can dismiss it by
|
|
6
|
+
swiping, so it suits detail views and action lists on mobile. For a large form on desktop,
|
|
7
|
+
[`Sheet`](ui/sheet) is the more natural choice. It is built on Base UI's `Drawer`.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {
|
|
11
|
+
Drawer,
|
|
12
|
+
DrawerTrigger,
|
|
13
|
+
DrawerContent,
|
|
14
|
+
DrawerHeader,
|
|
15
|
+
DrawerTitle,
|
|
16
|
+
DrawerDescription,
|
|
17
|
+
DrawerFooter,
|
|
18
|
+
DrawerClose,
|
|
19
|
+
} from "@squadbase/vantage/ui";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Parts
|
|
23
|
+
|
|
24
|
+
| Part | Role |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `Drawer` | The state: `open` / `defaultOpen` / `onOpenChange`, direction, snap points |
|
|
27
|
+
| `DrawerTrigger` | What opens it; `render` turns it into a button |
|
|
28
|
+
| `DrawerContent` | The panel. It includes the overlay and the portal |
|
|
29
|
+
| `DrawerHeader` / `DrawerTitle` / `DrawerDescription` | The heading block |
|
|
30
|
+
| `DrawerFooter` | The button row |
|
|
31
|
+
| `DrawerClose` | Anything that closes it |
|
|
32
|
+
|
|
33
|
+
| Prop | Type | Default | Description |
|
|
34
|
+
| --- | --- | --- | --- |
|
|
35
|
+
| `swipeDirection` | `"down" \| "up" \| "left" \| "right"` | `"down"` | Passed to `Drawer`. The direction you swipe to dismiss it (which is also the edge it comes from). |
|
|
36
|
+
| `showSwipeHandle` | `boolean` | `false` | Passed to `Drawer`. Shows a grab handle. |
|
|
37
|
+
| `snapPoints` | `(number \| string)[]` | | Passed to `Drawer`. Heights where it can rest part-way (`0.5` or `"20rem"`). |
|
|
38
|
+
| `modal` | `boolean` | `true` | Passed to `Drawer`. With `false` the page behind stays interactive and no overlay is shown. |
|
|
39
|
+
|
|
40
|
+
`DrawerTitle` is required for assistive technology. If you don't want it visible, keep it and add
|
|
41
|
+
`className="sr-only"`.
|
package/docs/en/ui/empty.md
CHANGED
|
@@ -10,7 +10,7 @@ import { Empty } from "@squadbase/vantage/ui";
|
|
|
10
10
|
|
|
11
11
|
| Prop | Type | Default | Description |
|
|
12
12
|
| --- | --- | --- | --- |
|
|
13
|
-
| `title` | `string` | `"
|
|
13
|
+
| `title` | `string` | `"表示できるデータがありません"` | The heading. |
|
|
14
14
|
| `description` | `string` | | Supporting text under the heading. |
|
|
15
15
|
| `icon` | `ReactNode` | | Artwork above the heading. |
|
|
16
16
|
| `action` | `ReactNode` | | The next step — a button or link — at the bottom. |
|
|
@@ -11,8 +11,9 @@ import { ErrorState } from "@squadbase/vantage/ui";
|
|
|
11
11
|
|
|
12
12
|
| Prop | Type | Default | Description |
|
|
13
13
|
| --- | --- | --- | --- |
|
|
14
|
-
| `title` | `string` | `"
|
|
15
|
-
| `message` | `ReactNode` |
|
|
14
|
+
| `title` | `string` | `"データを読み込めませんでした"` | The heading. |
|
|
15
|
+
| `message` | `ReactNode` | `"時間をおいて再試行してください。解決しない場合は管理者にお問い合わせください。"` | What happened and what to do next, in plain words. |
|
|
16
|
+
| `details` | `ReactNode` | | Technical detail (error message, status code). Folded behind a "詳細を表示" disclosure. |
|
|
16
17
|
| `action` | `ReactNode` | | A retry button, typically. |
|
|
17
18
|
| `className` | `string` | | Classes to add. |
|
|
18
19
|
|
|
@@ -35,7 +36,7 @@ export default function Customers() {
|
|
|
35
36
|
if (error)
|
|
36
37
|
return (
|
|
37
38
|
<ErrorState
|
|
38
|
-
|
|
39
|
+
details={error.message}
|
|
39
40
|
action={<Button variant="outline" onClick={() => refetch()}>Retry</Button>}
|
|
40
41
|
/>
|
|
41
42
|
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Field
|
|
2
|
+
|
|
3
|
+
> A form layout part that binds a label, description and error to an input.
|
|
4
|
+
|
|
5
|
+
Lays out one input's label, helper text and error message with fixed spacing and direction. Put the
|
|
6
|
+
input itself, such as [`Input`](ui/input) or [`Switch`](ui/switch),
|
|
7
|
+
inside it.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import {
|
|
11
|
+
Field,
|
|
12
|
+
FieldLabel,
|
|
13
|
+
FieldDescription,
|
|
14
|
+
FieldError,
|
|
15
|
+
FieldContent,
|
|
16
|
+
FieldTitle,
|
|
17
|
+
FieldGroup,
|
|
18
|
+
FieldSet,
|
|
19
|
+
FieldLegend,
|
|
20
|
+
FieldSeparator,
|
|
21
|
+
} from "@squadbase/vantage/ui";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Parts
|
|
25
|
+
|
|
26
|
+
| Part | Role |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `Field` | The frame for one input. `orientation` picks the layout |
|
|
29
|
+
| `FieldLabel` | The label (uses `Label`). Tie it to the input with `htmlFor` |
|
|
30
|
+
| `FieldDescription` | Helper text |
|
|
31
|
+
| `FieldError` | The error. Pass `children` or `errors` (`{ message }[]`). Renders nothing when empty |
|
|
32
|
+
| `FieldContent` | A column that groups the label and description in a horizontal layout |
|
|
33
|
+
| `FieldTitle` | A heading that is not a `<label>` |
|
|
34
|
+
| `FieldGroup` | Stacks several `Field`s vertically |
|
|
35
|
+
| `FieldSet` / `FieldLegend` | `<fieldset>` / `<legend>`. `FieldLegend` takes `variant` (`"legend"` by default, or `"label"` for smaller text) |
|
|
36
|
+
| `FieldSeparator` | A divider line. You can put text in the middle |
|
|
37
|
+
|
|
38
|
+
| Prop | Type | Default | Description |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `orientation` | `"vertical" \| "horizontal" \| "responsive"` | `"vertical"` | Passed to `Field`. `responsive` goes horizontal only when the container is wide. |
|
|
41
|
+
| `data-invalid` | `boolean` | | Set on `Field` to turn the label and description the error colour. Also put `aria-invalid` on the input. |
|
|
42
|
+
| `errors` | `Array<{ message?: string } \| undefined>` | | Passed to `FieldError`. Several are shown as a bulleted list, and duplicates are merged into one. |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Hover Card
|
|
2
|
+
|
|
3
|
+
> A preview card that appears when you hover a link.
|
|
4
|
+
|
|
5
|
+
Shows supplementary content in a card when the pointer rests on a link or term (or when it receives
|
|
6
|
+
keyboard focus). Meant for **read-only** information such as a metric definition or a user profile.
|
|
7
|
+
For anything interactive use [`Popover`](ui/popover); for a short phrase use
|
|
8
|
+
[`Tooltip`](ui/tooltip). Built on Base UI's `PreviewCard`.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { HoverCard, HoverCardTrigger, HoverCardContent } from "@squadbase/vantage/ui";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`HoverCardTrigger` renders an `<a>` by default. Pass `render` to use another element.
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Default | Description |
|
|
17
|
+
| --- | --- | --- | --- |
|
|
18
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | Passed to `HoverCardContent`. Which side of the trigger it appears on. |
|
|
19
|
+
| `align` | `"start" \| "center" \| "end"` | `"center"` | Passed to `HoverCardContent`. |
|
|
20
|
+
| `sideOffset` | `number` | `4` | Distance in px between `HoverCardContent` and the trigger. |
|
|
21
|
+
| `delay` | `number` | `600` | Passed to `HoverCardTrigger`. Milliseconds before it opens. |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Kbd
|
|
2
|
+
|
|
3
|
+
> A keyboard key.
|
|
4
|
+
|
|
5
|
+
A small part for showing shortcut keys. Line several keys up with `KbdGroup`.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Kbd, KbdGroup } from "@squadbase/vantage/ui";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Description |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `Kbd` | `ComponentProps<"kbd">` | A single key. |
|
|
14
|
+
| `KbdGroup` | `ComponentProps<"div">` | Lays the keys out side by side. |
|
|
15
|
+
|
|
16
|
+
Placed inside a button or a [`Tooltip`](ui/tooltip), it blends in with the
|
|
17
|
+
surrounding text colour.
|
package/docs/en/ui/loading.md
CHANGED
|
@@ -12,7 +12,7 @@ import { Loading } from "@squadbase/vantage/ui";
|
|
|
12
12
|
|
|
13
13
|
| Prop | Type | Default | Description |
|
|
14
14
|
| --- | --- | --- | --- |
|
|
15
|
-
| `label` | `string` | `"
|
|
15
|
+
| `label` | `string` | `"読み込んでいます…"` | Text shown next to the spinner. |
|
|
16
16
|
| `className` | `string` | | Classes to add. By default it centres within a 30vh minimum height. |
|
|
17
17
|
|
|
18
18
|
To hold the layout while waiting use [`Skeleton`](ui/skeleton); in tight spots such
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Pagination
|
|
2
|
+
|
|
3
|
+
> A row of page links.
|
|
4
|
+
|
|
5
|
+
Page navigation for a list split into pages. It is purely visual and holds neither the current page
|
|
6
|
+
nor the total — the caller owns that state (URL search params or `useState`).
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
Pagination,
|
|
11
|
+
PaginationContent,
|
|
12
|
+
PaginationItem,
|
|
13
|
+
PaginationLink,
|
|
14
|
+
PaginationPrevious,
|
|
15
|
+
PaginationNext,
|
|
16
|
+
PaginationEllipsis,
|
|
17
|
+
} from "@squadbase/vantage/ui";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parts
|
|
21
|
+
|
|
22
|
+
| Part | Role |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `Pagination` | The `<nav>`, with `aria-label="pagination"` |
|
|
25
|
+
| `PaginationContent` / `PaginationItem` | The `<ul>` / `<li>` |
|
|
26
|
+
| `PaginationLink` | One page's `<a>`. `isActive` marks the current page |
|
|
27
|
+
| `PaginationPrevious` / `PaginationNext` | The `<a>` to the previous / next page. `text` changes the wording |
|
|
28
|
+
| `PaginationEllipsis` | The ellipsis |
|
|
29
|
+
|
|
30
|
+
| Prop | Type | Default | Description |
|
|
31
|
+
| --- | --- | --- | --- |
|
|
32
|
+
| `isActive` | `boolean` | | Passed to `PaginationLink`. Sets `aria-current="page"` and an outlined look. |
|
|
33
|
+
| `text` | `string` | `"Previous" / "Next"` | Label of `PaginationPrevious` / `PaginationNext` (hidden below 640px). |
|
|
34
|
+
|
|
35
|
+
The links are plain `<a>` elements, so passing `href` navigates as usual. To change only in-page
|
|
36
|
+
state, call `preventDefault()` in `onClick`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Radio Group
|
|
2
|
+
|
|
3
|
+
> Radio buttons for choosing one of a few options.
|
|
4
|
+
|
|
5
|
+
An input that keeps every option visible and lets the user pick one. With many options consider
|
|
6
|
+
[`Select`](ui/select); to switch with side-by-side buttons consider
|
|
7
|
+
[`SegmentedControl`](parts/segmented-control).
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { RadioGroup, RadioGroupItem } from "@squadbase/vantage/ui";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`RadioGroupItem` has no label of its own. Give it an `id` and tie it to a
|
|
14
|
+
[`Label`](ui/label) through `htmlFor`.
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Description |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| `value` | `unknown` | The selected value of `RadioGroup` (controlled). |
|
|
19
|
+
| `defaultValue` | `unknown` | The initial value of `RadioGroup` (uncontrolled). |
|
|
20
|
+
| `onValueChange` | `(value: unknown) => void` | Passed to `RadioGroup`. Receives the `value` of the chosen `RadioGroupItem`. |
|
|
21
|
+
| `disabled` | `boolean` | Disables the whole group, or a single item. |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
> A transient notification in the corner of the screen.
|
|
4
|
+
|
|
5
|
+
A short notice about the result of an action, such as a save succeeding or failing. Built on Base
|
|
6
|
+
UI's `Toast`; it does not depend on `sonner`.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { Toaster, toast } from "@squadbase/vantage/ui";
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
**Wrap the app root in `Toaster` once**, then call `toast.add()` from anywhere. `Toaster` renders
|
|
15
|
+
its children and adds a stack for notifications at the bottom right (bottom centre on mobile).
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<Toaster>
|
|
19
|
+
<App />
|
|
20
|
+
</Toaster>;
|
|
21
|
+
|
|
22
|
+
toast.add({ title: "レポートを保存しました", type: "success" });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`toast` is a manager created once per module, with `add` / `close` / `update` / `promise`.
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `title` | `ReactNode` | | The heading. |
|
|
30
|
+
| `description` | `ReactNode` | | The body. |
|
|
31
|
+
| `type` | `"success" \| "info" \| "warning" \| "error" \| "loading" \| string` | | Picks the icon shown on the left. No icon if omitted. |
|
|
32
|
+
| `timeout` | `number` | `5000` | Milliseconds until it closes itself. `0` keeps it open. |
|
|
33
|
+
| `actionProps` | `ButtonProps` | | Shows an action button when given (`children` is the label, `onClick` the handler). |
|
|
34
|
+
|
|
35
|
+
`toast.add()` returns an ID. Replace the contents with `toast.update(id, {...})` and close it with
|
|
36
|
+
`toast.close(id)`. For async work use `toast.promise(promise, { loading, success, error })`.
|
|
37
|
+
|
|
38
|
+
> [!NOTE]
|
|
39
|
+
> The call style differs from shadcn/ui's `sonner` version (`toast("…")` / `toast.success("…")`).
|
|
40
|
+
> This has the same API as shadcn/ui's Base UI `toast`. When you need a separate manager outside
|
|
41
|
+
> `Toaster`, create one with `createToastManager()` and pass it as `<Toaster toastManager={manager}>`.
|
|
42
|
+
> You can also recompose the parts (`Toast` / `ToastTitle` / `ToastDescription` / `ToastAction` /
|
|
43
|
+
> `ToastClose` / `ToastViewport` / `ToastPortal` / `ToastProvider`, `useToastManager`) into your own
|
|
44
|
+
> layout.
|
|
@@ -14,13 +14,14 @@ import { ToggleGroup, ToggleGroupItem } from "@squadbase/vantage/ui";
|
|
|
14
14
|
| --- | --- | --- | --- |
|
|
15
15
|
| `value` | `string[]` | | The selected values — **an array even for single choice**. |
|
|
16
16
|
| `onValueChange` | `(value: string[]) => void` | | Fired on change, with an array. |
|
|
17
|
-
| `
|
|
17
|
+
| `multiple` | `boolean` | `false` | `true` allows more than one selection. |
|
|
18
18
|
| `variant` | `"default" \| "outline"` | `"default"` | |
|
|
19
19
|
| `size` | `"default" \| "sm" \| "lg"` | `"default"` | |
|
|
20
20
|
| `spacing` | `number` | `2` | Gap between items; `0` welds them into one band. |
|
|
21
21
|
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | |
|
|
22
22
|
|
|
23
23
|
> [!WARNING]
|
|
24
|
-
> There is no Radix-style `type="single"` / `type="multiple"`.
|
|
25
|
-
>
|
|
24
|
+
> There is no Radix-style `type="single"` / `type="multiple"`. Instead there is a boolean `multiple`;
|
|
25
|
+
> by default (`false`) only one item can be pressed at a time. Even then `value` is an array of at
|
|
26
|
+
> most one element. [`SegmentedControl`](parts/segmented-control) already handles
|
|
26
27
|
> that, so prefer it when you want single choice.
|