@squadbase/vantage 0.6.2-dev1.5aae04e → 0.6.2-dev1.81c1bbe

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.
Files changed (140) hide show
  1. package/dist/chunk-2IAPIOPS.js +152 -0
  2. package/dist/chunk-2IAPIOPS.js.map +1 -0
  3. package/dist/chunk-57GHR5LN.js +163 -0
  4. package/dist/chunk-57GHR5LN.js.map +1 -0
  5. package/dist/{chunk-XPQSTZUU.js → chunk-7S52M2SL.js} +4 -3
  6. package/dist/chunk-7S52M2SL.js.map +1 -0
  7. package/dist/chunk-JXFCSF3K.js +673 -0
  8. package/dist/chunk-JXFCSF3K.js.map +1 -0
  9. package/dist/{chunk-HKSVYMYJ.js → chunk-RU6WKEOG.js} +56 -927
  10. package/dist/chunk-RU6WKEOG.js.map +1 -0
  11. package/dist/components/index.d.ts +3 -243
  12. package/dist/components/index.js +5 -2
  13. package/dist/doc/index.d.ts +194 -2
  14. package/dist/doc/index.js +334 -3
  15. package/dist/doc/index.js.map +1 -1
  16. package/dist/format-U0cQl069.d.ts +243 -0
  17. package/dist/slide/index.d.ts +177 -1
  18. package/dist/slide/index.js +864 -1
  19. package/dist/slide/index.js.map +1 -1
  20. package/dist/table/index.js +5 -2
  21. package/dist/table/index.js.map +1 -1
  22. package/dist/ui/index.d.ts +4 -1
  23. package/dist/ui/index.js +3 -3
  24. package/dist/ui/index.js.map +1 -1
  25. package/docs/en/components.md +11 -2
  26. package/docs/en/doc/doc-action-items.md +49 -0
  27. package/docs/en/doc/doc-callout.md +38 -0
  28. package/docs/en/doc/doc-data-table.md +60 -0
  29. package/docs/en/doc/doc-executive-summary.md +64 -0
  30. package/docs/en/doc/doc-figure.md +56 -0
  31. package/docs/en/doc/doc-key-findings.md +61 -0
  32. package/docs/en/doc/doc-kpi-scorecard.md +80 -0
  33. package/docs/en/doc/doc-report-header.md +46 -0
  34. package/docs/en/parts/area-chart.md +99 -0
  35. package/docs/en/parts/bar-chart.md +91 -0
  36. package/docs/en/parts/bar-list.md +50 -0
  37. package/docs/en/parts/category-bar.md +37 -0
  38. package/docs/en/parts/chart-frame.md +39 -0
  39. package/docs/en/parts/donut-chart.md +72 -0
  40. package/docs/en/parts/funnel-steps.md +2 -1
  41. package/docs/en/parts/heatmap.md +53 -0
  42. package/docs/en/parts/legend.md +35 -0
  43. package/docs/en/parts/line-chart.md +94 -0
  44. package/docs/en/parts/progress-circle.md +33 -0
  45. package/docs/en/parts/sample-data.md +39 -0
  46. package/docs/en/parts/scatter-chart.md +56 -0
  47. package/docs/en/parts/tracker.md +36 -0
  48. package/docs/en/parts/updated-at.md +30 -0
  49. package/docs/en/parts/waterfall-chart.md +56 -0
  50. package/docs/en/slide/slide-chart-insight.md +52 -0
  51. package/docs/en/slide/slide-cover.md +39 -0
  52. package/docs/en/slide/slide-exec-summary.md +47 -0
  53. package/docs/en/slide/slide-kpi-grid.md +55 -0
  54. package/docs/en/slide/slide-kpi-hero.md +58 -0
  55. package/docs/en/slide/slide-next-actions.md +49 -0
  56. package/docs/en/slide/slide-scorecard-table.md +54 -0
  57. package/docs/en/ui/alert-dialog.md +42 -0
  58. package/docs/en/ui/avatar.md +31 -0
  59. package/docs/en/ui/combobox.md +74 -0
  60. package/docs/en/ui/drawer.md +41 -0
  61. package/docs/en/ui/empty.md +1 -1
  62. package/docs/en/ui/error-state.md +4 -3
  63. package/docs/en/ui/field.md +42 -0
  64. package/docs/en/ui/hover-card.md +21 -0
  65. package/docs/en/ui/kbd.md +17 -0
  66. package/docs/en/ui/loading.md +1 -1
  67. package/docs/en/ui/pagination.md +36 -0
  68. package/docs/en/ui/radio-group.md +21 -0
  69. package/docs/en/ui/toast.md +44 -0
  70. package/docs/en/ui/toggle-group.md +4 -3
  71. package/docs/index.json +697 -77
  72. package/docs/ja/components.md +10 -1
  73. package/docs/ja/doc/doc-action-items.md +49 -0
  74. package/docs/ja/doc/doc-callout.md +38 -0
  75. package/docs/ja/doc/doc-data-table.md +60 -0
  76. package/docs/ja/doc/doc-executive-summary.md +64 -0
  77. package/docs/ja/doc/doc-figure.md +56 -0
  78. package/docs/ja/doc/doc-key-findings.md +61 -0
  79. package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
  80. package/docs/ja/doc/doc-report-header.md +46 -0
  81. package/docs/ja/parts/area-chart.md +49 -25
  82. package/docs/ja/parts/bar-chart.md +50 -24
  83. package/docs/ja/parts/bar-list.md +31 -8
  84. package/docs/ja/parts/chart-frame.md +36 -0
  85. package/docs/ja/parts/donut-chart.md +45 -26
  86. package/docs/ja/parts/funnel-steps.md +27 -8
  87. package/docs/ja/parts/heatmap.md +45 -0
  88. package/docs/ja/parts/legend.md +36 -0
  89. package/docs/ja/parts/line-chart.md +48 -22
  90. package/docs/ja/parts/sample-data.md +61 -0
  91. package/docs/ja/parts/scatter-chart.md +69 -0
  92. package/docs/ja/parts/updated-at.md +27 -0
  93. package/docs/ja/parts/waterfall-chart.md +61 -0
  94. package/docs/ja/slide/slide-chart-insight.md +52 -0
  95. package/docs/ja/slide/slide-cover.md +39 -0
  96. package/docs/ja/slide/slide-exec-summary.md +47 -0
  97. package/docs/ja/slide/slide-kpi-grid.md +55 -0
  98. package/docs/ja/slide/slide-kpi-hero.md +58 -0
  99. package/docs/ja/slide/slide-next-actions.md +49 -0
  100. package/docs/ja/slide/slide-scorecard-table.md +54 -0
  101. package/docs/ja/ui/empty.md +1 -1
  102. package/docs/ja/ui/error-state.md +4 -3
  103. package/docs/ja/ui/loading.md +1 -1
  104. package/docs/ja/ui/toggle-group.md +4 -3
  105. package/package.json +2 -2
  106. package/registry/ui/area-chart.tsx +45 -19
  107. package/registry/ui/bar-chart.tsx +45 -19
  108. package/registry/ui/bar-list.tsx +44 -17
  109. package/registry/ui/box-plot-chart.tsx +45 -19
  110. package/registry/ui/category-bar.tsx +44 -17
  111. package/registry/ui/chart-frame.tsx +44 -17
  112. package/registry/ui/delta.tsx +4 -4
  113. package/registry/ui/donut-chart.tsx +46 -19
  114. package/registry/ui/echart.tsx +171 -54
  115. package/registry/ui/heatmap.tsx +45 -19
  116. package/registry/ui/histogram-chart.tsx +45 -19
  117. package/registry/ui/legend.tsx +44 -17
  118. package/registry/ui/line-chart.tsx +45 -19
  119. package/registry/ui/page-shell.tsx +7 -7
  120. package/registry/ui/paired-chart.tsx +45 -19
  121. package/registry/ui/sample-data.tsx +1 -1
  122. package/registry/ui/scatter-chart.tsx +45 -19
  123. package/registry/ui/slider.tsx +1 -1
  124. package/registry/ui/status-badge.tsx +8 -8
  125. package/registry/ui/tooltip.tsx +6 -2
  126. package/registry/ui/tracker.tsx +9 -3
  127. package/registry/ui/trend-indicator.tsx +2 -2
  128. package/registry/ui/waterfall-chart.tsx +45 -19
  129. package/skills/vantage-design/SKILL.md +27 -25
  130. package/skills/vantage-design/references/extract.md +16 -14
  131. package/skills/vantage-design/references/format.md +6 -5
  132. package/skills/vantage-design/references/presets.md +60 -110
  133. package/skills/vantage-slide/SKILL.md +54 -36
  134. package/templates/AGENTS.md +2 -2
  135. package/templates/agents/doc.md +45 -0
  136. package/templates/agents/page.md +22 -1
  137. package/templates/agents/slide.md +55 -2
  138. package/theme.css +16 -15
  139. package/dist/chunk-HKSVYMYJ.js.map +0 -1
  140. package/dist/chunk-XPQSTZUU.js.map +0 -1
@@ -0,0 +1,36 @@
1
+ # Tracker
2
+
3
+ > A row of small blocks, one per period, coloured by status. For uptime and batch results.
4
+
5
+ One period is one block, coloured by status. It suits **consecutive states**: daily uptime, batch
6
+ success or failure, a daily target hit or missed. Hover a block to see its `tooltip`. It is plain
7
+ HTML, not ECharts, and the colours follow the theme.
8
+
9
+ ```tsx
10
+ import { Tracker } from "@squadbase/vantage/components";
11
+ import type { TrackerBlock } from "@squadbase/vantage/components";
12
+ ```
13
+
14
+ | Prop | Type | Default | Description |
15
+ | --- | --- | --- | --- |
16
+ | `data` | `TrackerBlock[]` | | An array of `{ color?: ChartColor; tooltip?: string; key?: string \| number }`. **Required.** Oldest on the left. |
17
+ | `defaultColor` | `ChartColor` | | Colour of blocks with no `color`. Defaults to a lightened muted-foreground grey (for no data / not run). |
18
+ | `hoverEffect` | `boolean` | `true` | Fade the block under the pointer. |
19
+ | `className` | `string` | | Classes to add. The height defaults to `h-6`. |
20
+
21
+ Remaining props go to the outer `<div>`.
22
+
23
+ ## Assigning colours to states
24
+
25
+ `color` is `"positive"` / `"negative"` / `"warning"` / `"info"` (the area tokens, `--<tone>-fill`),
26
+ `"chart-1"` … `"chart-5"`, or a CSS colour.
27
+
28
+ ```tsx
29
+ const COLOR = { ok: "positive", warn: "warning", error: "negative" } as const;
30
+
31
+ <Tracker data={days.map((d) => ({ color: COLOR[d.status], tooltip: `${d.date} ${d.label}` }))} />
32
+ ```
33
+
34
+ > [!NOTE]
35
+ > Colour should not carry the meaning alone. Put the date and the state in `tooltip`; it is also the
36
+ > block's accessible name (`role="img"`), and blocks with a tooltip are keyboard focusable.
@@ -0,0 +1,30 @@
1
+ # UpdatedAt
2
+
3
+ > A freshness label such as "23 minutes ago". Shows the absolute time and zone on hover.
4
+
5
+ Renders a `<time>` whose `dateTime` is the ISO instant. The absolute time and zone
6
+ (`2026/10/20 16:41 JST`) appear in both a tooltip and the `title` attribute. The label text is
7
+ Japanese, in the form "23 分前に更新".
8
+
9
+ ```tsx
10
+ import { UpdatedAt } from "@squadbase/vantage/components";
11
+ import type { UpdatedAtProps } from "@squadbase/vantage/components";
12
+ ```
13
+
14
+ | Prop | Type | Default | Description |
15
+ | --- | --- | --- | --- |
16
+ | `at` | `Date \| string \| number` | | When the data was last updated. **Required.** |
17
+ | `variant` | `"relative" \| "absolute-first"` | `"relative"` | `"relative"` reads "23 分前に更新". `"absolute-first"` reads "16:41 更新(23 分前)", with the date added when it is not today. Use it on pages where "now" matters. |
18
+ | `timeZone` | `string` | | IANA time zone for the absolute time (e.g. `"Asia/Tokyo"`). Defaults to the runtime's zone. |
19
+ | `prefix` | `string` | | Text placed before the label, e.g. `"売上データ: "`. |
20
+ | `now` | `Date \| number` | | A fixed "current time" for tests and fixtures. It also disables the 60-second refresh. |
21
+ | `className` | `string` | | Classes to add. |
22
+
23
+ ## Hydration
24
+
25
+ The text depends on the clock and time zone of whoever renders, so the first render (server and
26
+ client) is an empty `<time>` carrying only the ISO `dateTime`. After mount it fills in the label and
27
+ refreshes every 60 seconds; the interval is cleared on unmount. The `<time>` sets
28
+ `suppressHydrationWarning`, so sample data built from `Date.now()` at module load does not warn.
29
+
30
+ Within a minute of `now`, the label reads "たった今" ("just now").
@@ -0,0 +1,56 @@
1
+ # WaterfallChart
2
+
3
+ > A typed waterfall chart. Shows how steps move a running total, such as revenue to gross profit.
4
+
5
+ Pass the steps as rows, the name column (`index`) and the amount column (`categories`), and it draws
6
+ a waterfall instead of you writing an ECharts option. Each row moves the running total by its value;
7
+ rows named in `totals` are bars from 0 to the total. Every step also prints its signed amount, so
8
+ colour is never the only carrier of direction. It renders inside
9
+ [`ChartFrame`](parts/chart-frame).
10
+
11
+ ```tsx
12
+ import { WaterfallChart } from "@squadbase/vantage/components";
13
+ import type { WaterfallChartProps, WaterfallMode } from "@squadbase/vantage/components";
14
+ ```
15
+
16
+ | Prop | Type | Default | Description |
17
+ | --- | --- | --- | --- |
18
+ | `data` | `T[]` | | The steps, left to right in row order. **Required.** |
19
+ | `index` | `keyof T` | | The column holding each step's name. **Required.** |
20
+ | `categories` | `NumericKeys<T>[]` | | The amount column as a one-element array. **Required.** Only the first is used. Values are numbers or numeric strings. |
21
+ | `totals` | `string[]` | | The `index` values of rows that are totals (e.g. `["Revenue", "Gross profit"]`). A total with a `null` value takes the running total so far; with a value, that value becomes the total and later steps continue from it. |
22
+ | `polarity` | `"higher-is-better" \| "lower-is-better" \| "neutral"` | `"higher-is-better"` | Whether an increase is good. Increases and decreases use `--positive-fill` / `--negative-fill`; `lower-is-better` swaps them (for churn, say), `neutral` uses one neutral colour. |
23
+ | `mode` | `"total" \| "delta"` | `"total"` | `"total"` draws totals as bars from 0. `"delta"` draws only the moves on a cumulative-change axis from 0, prints the opening and closing values in a note above the plot, and appends a net-change bar. Use it when the moves are small against the total (roughly under 5%). |
24
+ | `labels` | `Record<string, string>` | | Step name → display name, used on the axis, in the tooltip and the data table. Pass the `index` key to rename the table's first column. |
25
+ | `minValue` | `number` | | Lower limit of the value axis. The axis always includes 0, so only values ≤ 0 matter. It widens rather than clips. Pass the same `minValue` / `maxValue` to charts you compare side by side. |
26
+ | `maxValue` | `number` | | Upper limit of the value axis. It widens rather than clips. |
27
+ | `yAxisWidth` | `number` | | Width of the y-axis labels in px. Fix it to align the plot areas of stacked charts. |
28
+ | `showValues` | `boolean` | `true` | Print the signed amount on each bar (totals show the running total). |
29
+ | `showTooltip` | `boolean` | `true` | Show the tooltip (change and running total) on hover. |
30
+ | `format` | `ValueFormat` | `"compact"` | Number format: `"compact"`, `"number"`, `"currency"`, `"percent"`, `{ type, unit, … }`. |
31
+ | `valueFormatter` | `(value: number) => string` | | Escape hatch: a function that wins over `format`. |
32
+ | `title` | `string` | | Heading of the chart. |
33
+ | `summary` | `string \| "auto"` | | A one-sentence summary. `"auto"` builds one from the steps (first and last value, biggest increase and decrease). Omitted means no summary. |
34
+ | `isLoading` | `boolean` | `false` | Show a skeleton with the same height. |
35
+ | `emptyState` | `ChartEmptyState` | | Shown when `data` is empty: `{ title?, description?, action? }`. |
36
+ | `height` | `number` | `288` | Height of the plot area in px. |
37
+ | `chartOptions` | `EChartsOption` | | Escape hatch: deep-merged last into the generated ECharts option. |
38
+ | `actions` | `boolean \| ChartActionsOptions` | `false` | Show PNG save / copy buttons on hover. Title and summary are included in the image; turn that off with `{ includeTitle: false }`. |
39
+ | `fileName` | `string` | `"chart.png"` | File name for the saved PNG. |
40
+ | `ariaLabel` | `string` | | Label read aloud when there is no `title`. |
41
+ | `className` | `string` | | Classes to add (on the outer figure). |
42
+
43
+ ## Total or delta
44
+
45
+ When the moves are tiny next to the total, a `total` waterfall flattens them into hairlines on a tall
46
+ axis. Switch to `mode="delta"` so the axis is the change itself.
47
+
48
+ ```tsx
49
+ <WaterfallChart
50
+ data={rows}
51
+ index="step"
52
+ categories={["amount"]}
53
+ totals={["Revenue", "Gross profit"]}
54
+ summary="auto"
55
+ />
56
+ ```
@@ -0,0 +1,52 @@
1
+ # SlideChartInsight
2
+
3
+ > One chart and its reading — the most common slide in a report.
4
+
5
+ One chart (8 of 12 columns) and its reading (the other 4, up to 3 points). The chart is `line`, `bar` or `area`, built with canvas-size text, no tooltip and no animation, so it exports to pptx as it looks.
6
+
7
+ ```tsx
8
+ import { SlideChartInsight } from "@squadbase/vantage/slide";
9
+ import type { SlideChartInsightProps, SlideChartInsightChart } 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 `asOf` / `source` line (「… 時点」/「出典: …」) cannot be overridden, while `title`, `insights`, `chart.categories` and `chart.series[].name` 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
+ | `chart` | `SlideChartInsightChart` | | `{ type: "line" \| "bar" \| "area"; categories: string[]; series: { name: string; data: number[] }[] }`. **Required.** Two or more series show a legend. |
21
+ | `insights` | `string[]` | | Points that read the chart, 2–3. **Required.** |
22
+ | `chartSide` | `"left" \| "right"` | `"left"` | Which side the chart takes. |
23
+ | `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. |
24
+ | `source` | `string` | | Where the numbers come from (e.g. `"社内 BI"`). Shown as 「出典: 社内 BI」; the "出典:" label is fixed in Japanese. |
25
+
26
+ ## Usage
27
+
28
+ ```tsx
29
+ import { Slide, SlideChartInsight } from "@squadbase/vantage/slide";
30
+
31
+ <Slide>
32
+ <SlideChartInsight
33
+ title="解約率は 6 月以降、毎月下がり続けている"
34
+ chart={{
35
+ type: "line",
36
+ categories: ["6 月", "7 月", "8 月", "9 月"],
37
+ series: [{ name: "解約率(%)", data: [2.7, 2.4, 2.1, 1.8] }],
38
+ }}
39
+ insights={[
40
+ "オンボーディング刷新後の 3 か月で 0.9pt 低下",
41
+ "低下は中小企業プランが中心",
42
+ ]}
43
+ asOf="2026-10-01"
44
+ source="社内 BI"
45
+ />
46
+ </Slide>
47
+ ```
48
+
49
+ ## Notes
50
+
51
+ - More than 3 insights are still drawn but log a `console.warn` — split the slide.
52
+ - Typed charts such as `LineChart` are not used; the block builds the chart with `EChart` directly.
@@ -0,0 +1,39 @@
1
+ # SlideCover
2
+
3
+ > The cover of a deck — title, subtitle, period, author and as-of line on one slide.
4
+
5
+ The cover of a deck. The title sits in the left 8 columns; period, author and as-of go on one line at the foot.
6
+
7
+ ```tsx
8
+ import { SlideCover } from "@squadbase/vantage/slide";
9
+ import type { SlideCoverProps } 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 and cannot be overridden; `title`, `subtitle`, `period` and `author` are your own text.
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Description |
18
+ | --- | --- | --- |
19
+ | `title` | `string` | The name of the deck. **Required.** |
20
+ | `subtitle` | `string` | One line under the title. |
21
+ | `period` | `string` | The period covered, e.g. "Jul–Sep 2026". |
22
+ | `author` | `string` | Author or team. |
23
+ | `asOf` | `string` | The date the numbers were taken, date only (e.g. `"2026-10-20"`). The block adds 「時点」 once, so don't write it. The label is fixed in Japanese. |
24
+ | `source` | `string` | Where the numbers come from (e.g. `"社内 BI"`). Shown as 「出典: 社内 BI」; the "出典:" label is fixed in Japanese. |
25
+
26
+ ## Usage
27
+
28
+ ```tsx
29
+ import { Slide, SlideCover } from "@squadbase/vantage/slide";
30
+
31
+ <Slide>
32
+ <SlideCover title="2026 年度 第 2 四半期 事業レビュー" subtitle="売上・解約・新規獲得の振り返りと次の打ち手" period="2026 年 7 月〜9 月" author="事業企画チーム" asOf="2026-10-20" source="社内 BI" />
33
+ </Slide>
34
+ ```
35
+
36
+ ## Notes
37
+
38
+ - Use one cover per deck. Later slides carry their headline in the action title of the other blocks.
39
+ - Keep the subtitle to one line of purpose or audience; move longer explanations to later slides.
@@ -0,0 +1,47 @@
1
+ # SlideExecSummary
2
+
3
+ > The conclusion-first slide — an action title and 3–5 points.
4
+
5
+ The conclusion-first slide. Under the action title it lists 3–5 points, each a one-line headline with an optional supporting line.
6
+
7
+ ```tsx
8
+ import { SlideExecSummary } from "@squadbase/vantage/slide";
9
+ import type { SlideExecSummaryProps, SlideExecSummaryPoint } 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 and cannot be overridden; `title`, `points[].headline` and `points[].detail` 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
+ | `points` | `SlideExecSummaryPoint[]` | | Points (`{ headline: string; detail?: string }`), 3–5 of them. **Required.** |
21
+ | `layout` | `"rows" \| "columns"` | `"rows"` | `rows` stacks them numbered; `columns` puts them side by side (best with 3–4). |
22
+ | `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. |
23
+ | `source` | `string` | | Where the numbers come from (e.g. `"社内 BI"`). Shown as 「出典: 社内 BI」; the "出典:" label is fixed in Japanese. |
24
+
25
+ ## Usage
26
+
27
+ ```tsx
28
+ import { Slide, SlideExecSummary } from "@squadbase/vantage/slide";
29
+
30
+ <Slide>
31
+ <SlideExecSummary
32
+ title="Q2 は売上が計画を 4% 上回り、解約の改善が次の課題"
33
+ points={[
34
+ { headline: "売上は 5.4 億円で計画比 +4%", detail: "新規 38 社が牽引" },
35
+ { headline: "解約率は 1.8% まで低下", detail: "オンボーディング刷新の効果" },
36
+ { headline: "新規獲得は目標に 12 社届かず", detail: "紹介経由が想定の半分" },
37
+ ]}
38
+ asOf="2026-10-20"
39
+ source="社内 BI"
40
+ />
41
+ </Slide>
42
+ ```
43
+
44
+ ## Notes
45
+
46
+ - More than 5 points are still drawn but log a `console.warn` — split the slide.
47
+ - Write `title` as a conclusion sentence, not a topic ("Sales status").
@@ -0,0 +1,55 @@
1
+ # SlideKpiGrid
2
+
3
+ > A scoreboard of 2–4 KPIs — value, change and target.
4
+
5
+ A scoreboard of 2–4 KPI cards side by side, each with label, value, change and target. They share the width equally.
6
+
7
+ ```tsx
8
+ import { SlideKpiGrid } from "@squadbase/vantage/slide";
9
+ import type { SlideKpiGridProps, SlideKpiGridItem, SlideKpiGridDelta } 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 and cannot be overridden; `title`, `items[].label`, `items[].display` and `items[].comparisonLabel` 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
+ | `items` | `SlideKpiGridItem[]` | | The KPIs, 2–4 of them. **Required.** Each item is described in the `items[].…` rows below. |
21
+ | `items[].label` | `string` | | The metric name. **Required.** |
22
+ | `items[].value` | `number \| null` | | The number. `null` shows 「—」. **Required.** Formatted with `format`. |
23
+ | `items[].format` | `ValueFormat` | | How to format the value (`"currency"`, `"percent"`, `{ type: "number", unit: "社" }`, …). Also the default format of `delta` and `target`. |
24
+ | `items[].display` | `string` | | Replaces the shown text only (the number behind it stays `value`, kept as `data-raw`). |
25
+ | `items[].delta` | `SlideKpiGridDelta` | | `{ value: number; format?: ValueFormat }`. The size of the change, signed (e.g. `0.074` with `format: "percent"` shows 「+7.4%」). The direction comes from the sign, and ▲ ▼ with 「増」「減」 always show. `format` defaults to the item's `format`. |
26
+ | `items[].betterWhen` | `"up" \| "down"` | `"up"` | Which direction of `delta` is good. Drives the colour. |
27
+ | `items[].comparisonLabel` | `string` | | What `delta` is against (e.g. 「前月比」). |
28
+ | `items[].target` | `number` | | The target, in the same `format` as `value`. Shown as 「目標 …(達成率 …)」. The rate is value ÷ target (target ÷ value when `betterWhen` is `"down"`). |
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, SlideKpiGrid } from "@squadbase/vantage/slide";
36
+
37
+ <Slide>
38
+ <SlideKpiGrid
39
+ title="売上と継続率は計画どおり、新規獲得だけが未達"
40
+ items={[
41
+ { label: "月次売上", value: 540_000_000, format: "currency", delta: { value: 0.074, format: "percent" }, comparisonLabel: "前月比", target: 520_000_000 },
42
+ { label: "継続率", value: 0.982, format: { type: "percent", digits: 1 }, delta: { value: 0.004 }, comparisonLabel: "前月比", target: 0.98 },
43
+ { label: "新規獲得", value: 38, format: { type: "number", unit: "社" }, delta: { value: -4 }, comparisonLabel: "前月比", target: 50 },
44
+ ]}
45
+ asOf="2026-10-01"
46
+ source="社内 BI"
47
+ />
48
+ </Slide>
49
+ ```
50
+
51
+ ## Notes
52
+
53
+ - More than 4 are still drawn but log a `console.warn` — split the slide.
54
+ - Pass value, change and target as numbers. `format` formats them; use `display` only to change the shown text.
55
+ - Wording such as 「目標 …(達成率 …)」 and 「増」/「減」 comes from the block and is fixed in Japanese.
@@ -0,0 +1,58 @@
1
+ # SlideKpiHero
2
+
3
+ > One number as the hero — value, change and a trend line.
4
+
5
+ One number, large. The label, value and change take the left 6 columns and the trend line the right 6. Without `trend` the number takes the full width.
6
+
7
+ ```tsx
8
+ import { SlideKpiHero } from "@squadbase/vantage/slide";
9
+ import type { SlideKpiHeroProps, SlideKpiHeroDelta } 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 and cannot be overridden; `title`, `label`, `comparisonLabel` and `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
+ | `label` | `string` | | What the number is ("Monthly revenue"). **Required.** |
21
+ | `value` | `number \| null` | | The number. `null` shows 「—」. **Required.** Formatted with `format` (the number is kept as `data-raw` for export and tests). |
22
+ | `format` | `ValueFormat` | | How to format the value (`"currency"`, `"percent"`, …). Also the default format of `delta`. |
23
+ | `display` | `string` | | Replaces the shown text only (the number behind it stays `value`). |
24
+ | `delta` | `SlideKpiHeroDelta` | | `{ value: number; format?: ValueFormat }`. The size of the change, signed (e.g. `0.074` with `format: "percent"` shows 「+7.4%」). The direction comes from the sign, and ▲ ▼ with 「増」「減」 always show. `format` defaults to the metric's `format`. Omit for no change. |
25
+ | `betterWhen` | `"up" \| "down"` | `"up"` | Which direction of `delta` is good. Drives the colour. |
26
+ | `comparisonLabel` | `string` | | What `delta` is against (e.g. 「前月比」). |
27
+ | `trend` | `{ x: string; y: number }[]` | | Points of the line on the right; leave out for a number alone. |
28
+ | `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. |
29
+ | `source` | `string` | | Where the numbers come from (e.g. `"社内 BI"`). Shown as 「出典: 社内 BI」; the "出典:" label is fixed in Japanese. |
30
+
31
+ ## Usage
32
+
33
+ ```tsx
34
+ import { Slide, SlideKpiHero } from "@squadbase/vantage/slide";
35
+
36
+ <Slide>
37
+ <SlideKpiHero
38
+ title="9 月の売上は過去最高の 5.4 億円"
39
+ label="月次売上"
40
+ value={540_000_000}
41
+ format="currency"
42
+ delta={{ value: 0.074, format: "percent" }}
43
+ comparisonLabel="前月比"
44
+ trend={[
45
+ { x: "4 月", y: 460_000_000 }, { x: "5 月", y: 480_000_000 }, { x: "6 月", y: 490_000_000 },
46
+ { x: "7 月", y: 500_000_000 }, { x: "8 月", y: 503_000_000 }, { x: "9 月", y: 540_000_000 },
47
+ ]}
48
+ asOf="2026-10-01"
49
+ source="社内 BI"
50
+ />
51
+ </Slide>
52
+ ```
53
+
54
+ ## Notes
55
+
56
+ - For a metric where a fall is good (cost), write `betterWhen="down"`. The colour follows `betterWhen`; the direction (▲ ▼ and 「増」/「減」) comes from the sign of `delta.value`.
57
+ - 「増」, 「減」, 「… 時点」 and 「出典: …」 are wording the block adds, fixed in Japanese.
58
+ - The chart is an `EChart` with animation off; the pptx export waits for it.
@@ -0,0 +1,49 @@
1
+ # SlideNextActions
2
+
3
+ > What happens next — 3–5 actions with owner, due date and the metric to check.
4
+
5
+ The closing slide of most reports: what happens next. Each action can carry an owner, a due date and the metric that shows it worked.
6
+
7
+ ```tsx
8
+ import { SlideNextActions } from "@squadbase/vantage/slide";
9
+ import type { SlideNextActionsProps, SlideNextActionsItem } 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 (the column headers 担当 / 期限 / 確認する指標, 「… 時点」, 「出典: …」) are fixed in Japanese and cannot be overridden; `title` and the `items[]` fields are your own text.
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Description |
18
+ | --- | --- | --- |
19
+ | `title` | `string` | The decision or plan as one sentence. **Required.** |
20
+ | `items` | `SlideNextActionsItem[]` | Actions, 3–5. **Required.** Each item is described in the `items[].…` rows below. |
21
+ | `items[].action` | `string` | What to do, as one sentence starting from the object (about 40 characters at most). **Required.** |
22
+ | `items[].owner` | `string` | The owner. |
23
+ | `items[].due` | `string` | The due date, shown as written on one line ("10/31"; about 10 characters at most). |
24
+ | `items[].metric` | `string` | What to look at to know it worked. |
25
+ | `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. |
26
+ | `source` | `string` | Where the numbers come from (e.g. `"社内 BI"`). Shown as 「出典: 社内 BI」; the "出典:" label is fixed in Japanese. |
27
+
28
+ ## Usage
29
+
30
+ ```tsx
31
+ import { Slide, SlideNextActions } from "@squadbase/vantage/slide";
32
+
33
+ <Slide>
34
+ <SlideNextActions
35
+ title="解約と新規獲得の施策を 3 つ、11 月末までに始める"
36
+ items={[
37
+ { action: "解約予兆スコアの上位 50 社に CS が連絡する", owner: "CS 部 山田", due: "10/31", metric: "解約率 1.5% 以下" },
38
+ { action: "紹介プログラムの特典を見直す", owner: "マーケ 佐藤", due: "11/15", metric: "紹介経由の新規 20 社" },
39
+ { action: "料金ページの導線を改善する", owner: "プロダクト 鈴木", due: "11/30", metric: "申込率 +1pt" },
40
+ ]}
41
+ />
42
+ </Slide>
43
+ ```
44
+
45
+ ## Notes
46
+
47
+ - The owner, due and metric columns appear only when at least one item has a value.
48
+ - The column headers (担当 / 期限 / 確認する指標) are fixed in Japanese and cannot be overridden.
49
+ - `due` is shown as written ("10/31", "by next week"). More than 5 items log a `console.warn`.
@@ -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,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
+ ```