@squadbase/vantage 0.6.2-dev1.5aae04e → 0.6.2-dev1.72360fb

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 (164) 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-6OTTGAPO.js +44 -0
  6. package/dist/chunk-6OTTGAPO.js.map +1 -0
  7. package/dist/{chunk-XPQSTZUU.js → chunk-7S52M2SL.js} +4 -3
  8. package/dist/chunk-7S52M2SL.js.map +1 -0
  9. package/dist/chunk-JXFCSF3K.js +673 -0
  10. package/dist/chunk-JXFCSF3K.js.map +1 -0
  11. package/dist/{chunk-HKSVYMYJ.js → chunk-QOXXOFGL.js} +61 -929
  12. package/dist/chunk-QOXXOFGL.js.map +1 -0
  13. package/dist/components/index.d.ts +11 -247
  14. package/dist/components/index.js +5 -2
  15. package/dist/delta-text-CvwBGJ95.d.ts +15 -0
  16. package/dist/doc/index.d.ts +215 -2
  17. package/dist/doc/index.js +300 -3
  18. package/dist/doc/index.js.map +1 -1
  19. package/dist/format-U0cQl069.d.ts +243 -0
  20. package/dist/slide/index.d.ts +272 -1
  21. package/dist/slide/index.js +966 -1
  22. package/dist/slide/index.js.map +1 -1
  23. package/dist/table/index.js +5 -2
  24. package/dist/table/index.js.map +1 -1
  25. package/dist/ui/index.d.ts +4 -1
  26. package/dist/ui/index.js +3 -3
  27. package/dist/ui/index.js.map +1 -1
  28. package/docs/en/components.md +13 -2
  29. package/docs/en/doc/delta-text.md +40 -0
  30. package/docs/en/doc/doc-action-items.md +49 -0
  31. package/docs/en/doc/doc-callout.md +38 -0
  32. package/docs/en/doc/doc-data-table.md +60 -0
  33. package/docs/en/doc/doc-executive-summary.md +64 -0
  34. package/docs/en/doc/doc-figure.md +56 -0
  35. package/docs/en/doc/doc-key-findings.md +61 -0
  36. package/docs/en/doc/doc-kpi-scorecard.md +80 -0
  37. package/docs/en/doc/doc-notes-and-sources.md +43 -0
  38. package/docs/en/doc/doc-report-header.md +46 -0
  39. package/docs/en/parts/area-chart.md +99 -0
  40. package/docs/en/parts/bar-chart.md +91 -0
  41. package/docs/en/parts/bar-list.md +50 -0
  42. package/docs/en/parts/category-bar.md +37 -0
  43. package/docs/en/parts/chart-frame.md +39 -0
  44. package/docs/en/parts/delta.md +4 -3
  45. package/docs/en/parts/donut-chart.md +72 -0
  46. package/docs/en/parts/funnel-steps.md +2 -1
  47. package/docs/en/parts/heatmap.md +53 -0
  48. package/docs/en/parts/kpi-card.md +2 -1
  49. package/docs/en/parts/legend.md +35 -0
  50. package/docs/en/parts/line-chart.md +94 -0
  51. package/docs/en/parts/progress-circle.md +33 -0
  52. package/docs/en/parts/sample-data.md +39 -0
  53. package/docs/en/parts/scatter-chart.md +56 -0
  54. package/docs/en/parts/tracker.md +36 -0
  55. package/docs/en/parts/updated-at.md +30 -0
  56. package/docs/en/parts/waterfall-chart.md +56 -0
  57. package/docs/en/slide/slide-chart-full.md +48 -0
  58. package/docs/en/slide/slide-chart-insight.md +52 -0
  59. package/docs/en/slide/slide-columns.md +46 -0
  60. package/docs/en/slide/slide-comparison.md +68 -0
  61. package/docs/en/slide/slide-cover.md +39 -0
  62. package/docs/en/slide/slide-exec-summary.md +47 -0
  63. package/docs/en/slide/slide-heading.md +38 -0
  64. package/docs/en/slide/slide-kpi-grid.md +55 -0
  65. package/docs/en/slide/slide-kpi-hero.md +58 -0
  66. package/docs/en/slide/slide-next-actions.md +49 -0
  67. package/docs/en/slide/slide-scorecard-table.md +54 -0
  68. package/docs/en/slide/slide-section.md +44 -0
  69. package/docs/en/slide/slide-source-line.md +34 -0
  70. package/docs/en/ui/alert-dialog.md +42 -0
  71. package/docs/en/ui/avatar.md +31 -0
  72. package/docs/en/ui/combobox.md +74 -0
  73. package/docs/en/ui/drawer.md +41 -0
  74. package/docs/en/ui/empty.md +1 -1
  75. package/docs/en/ui/error-state.md +4 -3
  76. package/docs/en/ui/field.md +42 -0
  77. package/docs/en/ui/hover-card.md +21 -0
  78. package/docs/en/ui/kbd.md +17 -0
  79. package/docs/en/ui/loading.md +1 -1
  80. package/docs/en/ui/pagination.md +36 -0
  81. package/docs/en/ui/radio-group.md +21 -0
  82. package/docs/en/ui/toast.md +44 -0
  83. package/docs/en/ui/toggle-group.md +4 -3
  84. package/docs/index.json +857 -77
  85. package/docs/ja/components.md +12 -1
  86. package/docs/ja/doc/delta-text.md +40 -0
  87. package/docs/ja/doc/doc-action-items.md +49 -0
  88. package/docs/ja/doc/doc-callout.md +38 -0
  89. package/docs/ja/doc/doc-data-table.md +60 -0
  90. package/docs/ja/doc/doc-executive-summary.md +64 -0
  91. package/docs/ja/doc/doc-figure.md +56 -0
  92. package/docs/ja/doc/doc-key-findings.md +61 -0
  93. package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
  94. package/docs/ja/doc/doc-notes-and-sources.md +43 -0
  95. package/docs/ja/doc/doc-report-header.md +46 -0
  96. package/docs/ja/parts/area-chart.md +49 -25
  97. package/docs/ja/parts/bar-chart.md +50 -24
  98. package/docs/ja/parts/bar-list.md +31 -8
  99. package/docs/ja/parts/chart-frame.md +36 -0
  100. package/docs/ja/parts/delta.md +5 -4
  101. package/docs/ja/parts/donut-chart.md +45 -26
  102. package/docs/ja/parts/funnel-steps.md +27 -8
  103. package/docs/ja/parts/heatmap.md +45 -0
  104. package/docs/ja/parts/kpi-card.md +2 -1
  105. package/docs/ja/parts/legend.md +36 -0
  106. package/docs/ja/parts/line-chart.md +48 -22
  107. package/docs/ja/parts/sample-data.md +61 -0
  108. package/docs/ja/parts/scatter-chart.md +69 -0
  109. package/docs/ja/parts/updated-at.md +27 -0
  110. package/docs/ja/parts/waterfall-chart.md +61 -0
  111. package/docs/ja/slide/slide-chart-full.md +48 -0
  112. package/docs/ja/slide/slide-chart-insight.md +52 -0
  113. package/docs/ja/slide/slide-columns.md +46 -0
  114. package/docs/ja/slide/slide-comparison.md +68 -0
  115. package/docs/ja/slide/slide-cover.md +39 -0
  116. package/docs/ja/slide/slide-exec-summary.md +47 -0
  117. package/docs/ja/slide/slide-heading.md +38 -0
  118. package/docs/ja/slide/slide-kpi-grid.md +55 -0
  119. package/docs/ja/slide/slide-kpi-hero.md +58 -0
  120. package/docs/ja/slide/slide-next-actions.md +49 -0
  121. package/docs/ja/slide/slide-scorecard-table.md +54 -0
  122. package/docs/ja/slide/slide-section.md +44 -0
  123. package/docs/ja/slide/slide-source-line.md +34 -0
  124. package/docs/ja/ui/empty.md +1 -1
  125. package/docs/ja/ui/error-state.md +4 -3
  126. package/docs/ja/ui/loading.md +1 -1
  127. package/docs/ja/ui/toggle-group.md +4 -3
  128. package/package.json +2 -2
  129. package/registry/ui/area-chart.tsx +45 -19
  130. package/registry/ui/bar-chart.tsx +45 -19
  131. package/registry/ui/bar-list.tsx +44 -17
  132. package/registry/ui/box-plot-chart.tsx +45 -19
  133. package/registry/ui/category-bar.tsx +44 -17
  134. package/registry/ui/chart-frame.tsx +44 -17
  135. package/registry/ui/delta.tsx +11 -8
  136. package/registry/ui/donut-chart.tsx +46 -19
  137. package/registry/ui/echart.tsx +171 -54
  138. package/registry/ui/heatmap.tsx +45 -19
  139. package/registry/ui/histogram-chart.tsx +45 -19
  140. package/registry/ui/kpi-card.tsx +9 -4
  141. package/registry/ui/legend.tsx +44 -17
  142. package/registry/ui/line-chart.tsx +45 -19
  143. package/registry/ui/page-shell.tsx +7 -7
  144. package/registry/ui/paired-chart.tsx +45 -19
  145. package/registry/ui/sample-data.tsx +1 -1
  146. package/registry/ui/scatter-chart.tsx +45 -19
  147. package/registry/ui/slider.tsx +1 -1
  148. package/registry/ui/status-badge.tsx +8 -8
  149. package/registry/ui/tooltip.tsx +6 -2
  150. package/registry/ui/tracker.tsx +9 -3
  151. package/registry/ui/trend-indicator.tsx +2 -2
  152. package/registry/ui/waterfall-chart.tsx +45 -19
  153. package/skills/vantage-design/SKILL.md +27 -25
  154. package/skills/vantage-design/references/extract.md +16 -14
  155. package/skills/vantage-design/references/format.md +6 -5
  156. package/skills/vantage-design/references/presets.md +60 -110
  157. package/skills/vantage-slide/SKILL.md +54 -36
  158. package/templates/AGENTS.md +2 -2
  159. package/templates/agents/doc.md +48 -0
  160. package/templates/agents/page.md +22 -1
  161. package/templates/agents/slide.md +70 -2
  162. package/theme.css +16 -15
  163. package/dist/chunk-HKSVYMYJ.js.map +0 -1
  164. package/dist/chunk-XPQSTZUU.js.map +0 -1
@@ -0,0 +1,40 @@
1
+ # DeltaText
2
+
3
+ > [Part] An inline change — ▲ ▼ and a signed value — for documents and slides.
4
+
5
+ A change as a bare inline `span`: a mark plus a signed value ("▲ +3.2%"), so print and colour-blind readers get the direction; colour only adds good or bad. It sets no text size and takes the size of the line it sits in. It is a **part** usable in both documents and slides, not a section or a slide block.
6
+
7
+ ```tsx
8
+ import { DeltaText } from "@squadbase/vantage/doc";
9
+ import type { DeltaTextProps } from "@squadbase/vantage/doc";
10
+ // The same part is available from the slide subpath
11
+ // import { DeltaText } from "@squadbase/vantage/slide";
12
+ ```
13
+
14
+ > [!NOTE]
15
+ > This is **a part to place inside a sentence**. It has no dimensions or text size of its own and follows the line it sits in. It is separate from the dashboard `Delta`.
16
+
17
+ ## Props
18
+
19
+ | Prop | Type | Default | Description |
20
+ | --- | --- | --- | --- |
21
+ | `value` | `number \| null` | | The change itself; its direction comes from the sign. `null` shows 「—」. **Required.** |
22
+ | `format` | `ValueFormat` | | How to format the value (`"percent"`, `"currency"`, …). Printed with an explicit sign. |
23
+ | `betterWhen` | `"up" \| "down"` | `"up"` | Which direction is good; decides the colour. Use `"down"` for churn and cost. |
24
+ | `comparisonLabel` | `string` | | Name of the comparison ("vs last month"). Printed before the change, muted. |
25
+
26
+ ## Usage
27
+
28
+ ```tsx
29
+ import { DeltaText } from "@squadbase/vantage/doc";
30
+
31
+ <p>
32
+ Revenue in September was ¥540M (<DeltaText value={0.074} format="percent" comparisonLabel="vs last month" />).
33
+ Churn is 1.8% (<DeltaText value={-0.006} format="percent" betterWhen="down" comparisonLabel="vs last month" />).
34
+ </p>
35
+ ```
36
+
37
+ ## Notes
38
+
39
+ - Zero is shown as 「→」 in the muted colour.
40
+ - The spoken words (「増」, 「減」, 「横ばい」, 「改善」, 「悪化」) in the accessible label are fixed in Japanese.
@@ -0,0 +1,49 @@
1
+ # DocActionItems
2
+
3
+ > What to do next — action, owner, due date, expected effect and priority.
4
+
5
+ The recommendations section: action, owner, due date, expected effect and priority. The default `table` is a table; `asks` is a short bulleted list of requests to the reader (introductions, a decision, a hire). Priority is only the word 高 / 中 / 低, with no badge and no colour.
6
+
7
+ ```tsx
8
+ import { DocActionItems } from "@squadbase/vantage/doc";
9
+ import type { DocActionItemsProps, DocActionItem, DocActionPriority } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **one section to place directly under `<Document>`**. The document sets heading and body sizes and the width, so no dimensions are set here. `action` is a `ReactNode`; Markdown strings are not parsed. The table headings ("対応", "担当", "期限", "期待する効果", "優先度"), the priority words (高 / 中 / 低) and the "まで" after a due date in `asks` are fixed in Japanese and cannot be overridden. Write `action`, `owner`, `due` and `impact` in English yourself; the default heading "推奨する対応" is Japanese, so pass `title`. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ | --- | --- | --- | --- |
19
+ | `title` | `string` | `"推奨する対応"` | Heading text. |
20
+ | `headingLevel` | `2 \| 3` | `2` | Heading level: 2 directly under `<Document>`, 3 inside another section. |
21
+ | `items` | `DocActionItem[]` | | Actions, most important first. **Required.** |
22
+ | `items[].action` | `ReactNode` | | What to do. **Required.** |
23
+ | `items[].owner` | `string` | | Owner. |
24
+ | `items[].due` | `string` | | Due date, shown as written ("2026-11-15", "11 月末"). |
25
+ | `items[].impact` | `string` | | Expected effect ("解約率 −0.5pt"). Shown in the `table` only. |
26
+ | `items[].priority` | `"high" \| "medium" \| "low"` | | Priority, printed as the word 高 / 中 / 低 (高 in semibold). Shown in the `table` only. |
27
+ | `variant` | `"table" \| "asks"` | `"table"` | A table, or a bulleted list of requests to the reader. |
28
+
29
+ ## Usage
30
+
31
+ ```tsx
32
+ import { Document, DocActionItems } from "@squadbase/vantage/doc";
33
+
34
+ <Document>
35
+ <DocActionItems
36
+ items={[
37
+ { action: "法人プランの導入支援を増員する", owner: "CS 部", due: "2026-11-15", impact: "解約率 −0.5pt", priority: "high" },
38
+ { action: "紹介プログラムの特典を見直す", owner: "マーケティング部", due: "11 月末", impact: "紹介経由の新規 +10 社", priority: "medium" },
39
+ { action: "料金ページの文言を改善する", owner: "プロダクト部", priority: "low" },
40
+ ]}
41
+ />
42
+ </Document>
43
+ ```
44
+
45
+ ## Notes
46
+
47
+ - `due` is shown as written ("2026-11-15", "11 月末"). A missing owner, due or impact shows "—".
48
+ - `variant="asks"` adds only the owner and "`due` まで" (e.g. "(CS 部・11 月末 まで)"); the effect and priority are not shown.
49
+ - When printed, each item of `asks` stays on one page and does not break across pages.
@@ -0,0 +1,38 @@
1
+ # DocCallout
2
+
3
+ > A boxed remark inside the text — a note, insight, warning or decision.
4
+
5
+ A box for the one thing a reader must not miss — a `div` with `role="note"` and a left rule in the kind's semantic colour (a decision is neutral). The kind also prints as a word ("注意", "示唆"), so colour is never the only signal. Don't use it for decoration.
6
+
7
+ ```tsx
8
+ import { DocCallout } from "@squadbase/vantage/doc";
9
+ import type { DocCalloutProps, DocCalloutKind } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **a part to place inside body text or a section**, not a section of its own directly under `<Document>`. The document sets heading and body sizes and the width, so no dimensions are set here. `children` is a `string` or a `ReactNode`; Markdown strings are not parsed. The kind words ("補足", "示唆", "注意", "決定事項") are fixed in Japanese and cannot be overridden, so an English callout reads "注意: your title". Write `title` in English. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ | --- | --- | --- | --- |
19
+ | `kind` | `"note" \| "insight" \| "warning" \| "decision"` | `"note"` | Kind: note (補足) / insight (示唆) / warning (注意) / decision (決定事項). |
20
+ | `title` | `string` | | Heading of the box, one short line. When given, it prints as "<kind word>: <title>". Omit it and only the kind word shows. A title equal to the kind word is shown once. |
21
+ | `children` | `ReactNode` | | The body. A `string` becomes a paragraph. Markdown strings are not parsed. **Required.** |
22
+
23
+ ## Usage
24
+
25
+ ```tsx
26
+ import { Document, DocCallout } from "@squadbase/vantage/doc";
27
+
28
+ <Document>
29
+ <DocCallout kind="warning" title="9 月の数値は速報値">
30
+ 10 月 10 日の確定で変わることがあります。
31
+ </DocCallout>
32
+ </Document>
33
+ ```
34
+
35
+ ## Notes
36
+
37
+ - The kind word is added by the block; do not repeat it in `title`, which should hold only the heading itself.
38
+ - When printed, it stays on one page and does not break across pages.
@@ -0,0 +1,60 @@
1
+ # DocDataTable
2
+
3
+ > A table with the notes a printed table needs — title, unit, total row, footnotes and source.
4
+
5
+ A table with what a printed table needs: title, unit, right-aligned numbers, a total row, highlighted rows, footnotes and a source line. It is a plain `table` styled by `<Document>`, which also keeps rows together when printed. For screens that need sorting or scrolling, use `DataTable`.
6
+
7
+ ```tsx
8
+ import { DocDataTable } from "@squadbase/vantage/doc";
9
+ import type { DocDataTableProps, DocTableColumn, DocTableRow, DocTableCell } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **a part to place inside body text or a section**, not a section of its own directly under `<Document>`. The document sets heading and body sizes and the width, so no dimensions are set here. A cell is a string or a number; a `ReactNode` is not accepted. The caption labels "出典" and "データ時点" are fixed in Japanese and cannot be overridden; column labels, `title`, `unit` and footnotes are yours, so write them in English. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Description |
18
+ | --- | --- | --- |
19
+ | `title` | `string` | Table title, as a caption above the table. |
20
+ | `unit` | `string` | Unit or scale ("単位: 百万円"). With a title it follows in parentheses. |
21
+ | `columns` | `DocTableColumn[]` | Columns (`{ key; label; format?: ValueFormat; align?: "left" \| "right" \| "center" }`). Without `format`, numbers use a plain thousands format. Without `align`, a column of numbers is right-aligned and others left-aligned. **Required.** |
22
+ | `rows` | `DocTableRow[]` | Rows: objects keyed by the `key` of `columns`. A cell is a string or a number (`null`, `undefined` and an empty string show "—"). **Required.** |
23
+ | `total` | `DocTableRow` | The total row (`tfoot`), keyed like `rows`. |
24
+ | `highlightRows` | `number[]` | Indexes of the rows to set in semibold (zero-based, indexes into `rows`). |
25
+ | `footnotes` | `{ mark: string; text: string }[]` | Footnotes. Write the same `mark` ("※1") in a cell string to point at one. |
26
+ | `source` | `string` | Source. Shown as "出典: …" in the caption. |
27
+ | `asOf` | `string` | The date the data was taken, as a date only ("2026-10-03"). The block adds the label "データ時点". |
28
+
29
+ ## Usage
30
+
31
+ ```tsx
32
+ import { Document, DocDataTable } from "@squadbase/vantage/doc";
33
+
34
+ <Document>
35
+ <DocDataTable
36
+ title="部門別の売上"
37
+ unit="単位: 百万円"
38
+ columns={[
39
+ { key: "dept", label: "部門" },
40
+ { key: "sales", label: "売上", format: "number" },
41
+ { key: "share", label: "構成比", format: { type: "percent", digits: 1 } },
42
+ ]}
43
+ rows={[
44
+ { dept: "法人営業", sales: 312, share: 0.58 },
45
+ { dept: "パートナー", sales: 148, share: 0.27 },
46
+ { dept: "オンライン ※1", sales: 80, share: 0.15 },
47
+ ]}
48
+ total={{ dept: "合計", sales: 540, share: 1 }}
49
+ highlightRows={[0]}
50
+ footnotes={[{ mark: "※1", text: "9 月から集計対象に追加" }]}
51
+ source="会計システム"
52
+ asOf="2026-10-03"
53
+ />
54
+ </Document>
55
+ ```
56
+
57
+ ## Notes
58
+
59
+ - Numbers line up with `tabular-nums`, and a missing cell shows "—".
60
+ - When printed, a row does not break across pages. A long table may break between rows, and the caption (footnotes and source) stays on one page.
@@ -0,0 +1,64 @@
1
+ # DocExecutiveSummary
2
+
3
+ > The answer first — one conclusion, 3–5 points and optional headline numbers.
4
+
5
+ The answer-first section (BLUF): one conclusion sentence, 3–5 numbered points and up to 3 headline numbers. The direction of each change comes from the sign of the `delta` you pass, and the ▲▼ mark and the sign are always printed, so the direction is clear without colour.
6
+
7
+ ```tsx
8
+ import { DocExecutiveSummary } from "@squadbase/vantage/doc";
9
+ import type { DocExecutiveSummaryProps, DocSummaryMetric } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **one section to place directly under `<Document>`**. The document sets heading and body sizes and the width, so no dimensions are set here. `conclusion` and `points` are a `string` or a `ReactNode`; Markdown strings are not parsed. The default heading "要旨" and the default comparison name "前期比" are Japanese; on an English page pass `title` and `comparisonLabel` in English. Nothing else is printed by the block here. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ | --- | --- | --- | --- |
19
+ | `title` | `string` | `"要旨"` | Heading text. |
20
+ | `headingLevel` | `2 \| 3` | `2` | Heading level: 2 directly under `<Document>`, 3 inside another section. |
21
+ | `conclusion` | `ReactNode` | | The verdict in one sentence, set in semibold. **Required.** |
22
+ | `points` | `ReactNode[]` | | Supporting points, 3–5, most important first. Shown as a numbered list. **Required.** |
23
+ | `metrics` | `DocSummaryMetric[]` | | Headline numbers (at most 3; any beyond are ignored). |
24
+ | `metrics[].label` | `string` | | Name of the metric. |
25
+ | `metrics[].value` | `number \| null` | | The value. `null` shows "—". |
26
+ | `metrics[].format` | `ValueFormat` | | Format of `value` (`"currency"`, `{ type: "percent", digits: 1 }`, …). |
27
+ | `metrics[].display` | `string` | | When given, shown instead of the formatted value ("about ¥54M"). |
28
+ | `metrics[].delta` | `{ value: number; format?: ValueFormat }` | | The change itself (current − comparison). Direction comes from the sign; the ▲▼ mark and the sign are always printed. Omit for no comparison. Without `format`, the metric's `format` is used. |
29
+ | `metrics[].comparisonLabel` | `string` | `"前期比"` | Name of the comparison (e.g. "前月比"). |
30
+ | `metrics[].betterWhen` | `"up" \| "down"` | `"up"` | Which way is good. Use `"down"` for churn or cost. Colour only adds good / bad. |
31
+
32
+ ## Usage
33
+
34
+ ```tsx
35
+ import { Document, DocExecutiveSummary } from "@squadbase/vantage/doc";
36
+
37
+ <Document>
38
+ <DocExecutiveSummary
39
+ conclusion="9 月の売上は計画を上回ったが、新規獲得は目標に届いていない。"
40
+ points={[
41
+ "売上は 5,390 万円で、計画比 +3.7%。",
42
+ "解約率は 1.8% まで下がり、3 か月連続で改善。",
43
+ "新規獲得は 38 社で、目標の 50 社に未達。",
44
+ ]}
45
+ metrics={[
46
+ { label: "売上", value: 53_900_000, format: "currency", delta: { value: 3_700_000 }, comparisonLabel: "前月比" },
47
+ {
48
+ label: "解約率",
49
+ value: 0.018,
50
+ format: { type: "percent", digits: 1 },
51
+ delta: { value: -0.003, format: { type: "number", digits: 1, unit: "pt", divisor: 0.01 } },
52
+ comparisonLabel: "前月比",
53
+ betterWhen: "down",
54
+ },
55
+ ]}
56
+ />
57
+ </Document>
58
+ ```
59
+
60
+ ## Notes
61
+
62
+ - For a metric where a fall is good, set `betterWhen: "down"` (this flips the good / bad colour; the ▲▼ mark and sign still show the real direction).
63
+ - `delta` is the change itself, not the comparison value. For a rate (churn and the like), give it a `pt` format as in the example so it is not read as a relative change.
64
+ - When printed, each point and each metric tile stays on one page; the section as a whole may break across pages.
@@ -0,0 +1,56 @@
1
+ # DocFigure
2
+
3
+ > The figure convention in one place — a finding title, unit, the chart and a caption with source.
4
+
5
+ The figure convention: a title that states the finding, the unit, the chart (as `children`) and a caption with source and notes, as a real `figure` / `figcaption`. The chart is yours — a typed chart, an `EChart` or an image. A number without a source and a date is unfinished, so `source` and `asOf` are first-class.
6
+
7
+ ```tsx
8
+ import { DocFigure } from "@squadbase/vantage/doc";
9
+ import type { DocFigureProps } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **a part to place inside body text or a section**, not a section of its own directly under `<Document>`. The document sets heading and body sizes and the width, so no dimensions are set here. `children` is the chart (a `ReactNode`). The caption labels "図 N", "出典" and "データ時点" are fixed in Japanese and cannot be overridden; write `title`, `unit` and `notes` in English yourself. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Description |
18
+ | --- | --- | --- |
19
+ | `title` | `string` | The finding as a sentence ("Churn fell two months running"), not the subject. **Required.** |
20
+ | `unit` | `string` | Unit or scale ("単位: %"), shown right under the title. Put definitions and caveats in `notes`. |
21
+ | `number` | `number` | Figure number, shown as "図 N" in the caption. |
22
+ | `source` | `string` | Where the data comes from. Shown as "出典: …" in the caption. |
23
+ | `asOf` | `string` | The date the data was taken, as a date only ("2026-10-03"). The block adds the label "データ時点". |
24
+ | `notes` | `string[]` | Footnotes and definitions, one per line. |
25
+ | `children` | `ReactNode` | The chart; it takes the full column. **Required.** |
26
+
27
+ ## Usage
28
+
29
+ ```tsx
30
+ import { Document, DocFigure } from "@squadbase/vantage/doc";
31
+ import { EChart, type EChartsOption } from "@squadbase/vantage/components";
32
+
33
+ const option: EChartsOption = {
34
+ xAxis: { type: "category", data: ["7 月", "8 月", "9 月"] },
35
+ yAxis: { type: "value" },
36
+ series: [{ type: "line", data: [2.4, 2.1, 1.8] }],
37
+ };
38
+
39
+ <Document>
40
+ <DocFigure
41
+ number={1}
42
+ title="解約率は 2 か月連続で低下"
43
+ unit="単位: %"
44
+ source="課金システム"
45
+ asOf="2026-10-03"
46
+ notes={["解約率は、月初の契約数に対するその月の解約数の割合。"]}
47
+ >
48
+ <EChart option={option} height={240} ariaLabel="解約率の推移(7〜9 月)" />
49
+ </DocFigure>
50
+ </Document>
51
+ ```
52
+
53
+ ## Notes
54
+
55
+ - Do not give the chart in `children` its own `title`; the title goes in the `title` of `DocFigure`. If the chart needs an accessible name, use `ariaLabel`.
56
+ - A figure does not break across pages when printed.
@@ -0,0 +1,61 @@
1
+ # DocKeyFindings
2
+
3
+ > 3–5 findings — a concluding headline, evidence and an optional number.
4
+
5
+ The "what we learned" section: 3–5 findings, each a numbered `h3` headline that states the conclusion, the evidence under it and optionally one number. The direction of the change comes from the sign of the `delta` you pass, and the ▲▼ mark and sign are always printed.
6
+
7
+ ```tsx
8
+ import { DocKeyFindings } from "@squadbase/vantage/doc";
9
+ import type { DocKeyFindingsProps, DocFinding, DocFindingMetric } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **one section to place directly under `<Document>`**. The document sets heading and body sizes and the width, so no dimensions are set here. `evidence` is a `string` or a `ReactNode`; Markdown strings are not parsed. The default heading "主要な発見" and the default comparison name "前期比" are Japanese; on an English page pass `title` and `comparisonLabel` in English. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ | --- | --- | --- | --- |
19
+ | `title` | `string` | `"主要な発見"` | Section heading. |
20
+ | `headingLevel` | `2 \| 3` | `2` | Heading level: 2 directly under `<Document>`, 3 inside another section. |
21
+ | `findings` | `DocFinding[]` | | Findings (`{ headline: string; evidence: ReactNode; metric?: DocFindingMetric }`), 3–5, most important first. **Required.** |
22
+ | `findings[].metric` | `DocFindingMetric` | | One number to go with the finding, with the fields below. |
23
+ | `findings[].metric[].label` | `string` | | Name of the metric. |
24
+ | `findings[].metric[].value` | `number \| null` | | The value. `null` shows "—". |
25
+ | `findings[].metric[].format` | `ValueFormat` | | Format of `value` (`"currency"`, `{ type: "percent", digits: 1 }`, …). |
26
+ | `findings[].metric[].display` | `string` | | When given, shown instead of the formatted value ("about ¥54M"). |
27
+ | `findings[].metric[].delta` | `{ value: number; format?: ValueFormat }` | | The change itself (current − comparison). Direction comes from the sign; the ▲▼ mark and the sign are always printed. Omit for no comparison. Without `format`, the metric's `format` is used. |
28
+ | `findings[].metric[].comparisonLabel` | `string` | `"前期比"` | Name of the comparison (e.g. "前月比"). |
29
+ | `findings[].metric[].betterWhen` | `"up" \| "down"` | `"up"` | Which way is good. Use `"down"` for churn or cost. Colour only adds good / bad. |
30
+
31
+ ## Usage
32
+
33
+ ```tsx
34
+ import { Document, DocKeyFindings } from "@squadbase/vantage/doc";
35
+
36
+ <Document>
37
+ <DocKeyFindings
38
+ findings={[
39
+ {
40
+ headline: "新規契約は法人プランが牽引した",
41
+ evidence: "法人プランの新規が前月比 +20%(20 社 → 24 社)。個人プランは横ばいだった。",
42
+ metric: { label: "法人プランの新規", value: 24, format: { type: "number", unit: "社" }, delta: { value: 4 }, comparisonLabel: "前月比" },
43
+ },
44
+ {
45
+ headline: "解約は導入 3 か月以内に集中している",
46
+ evidence: "解約の 62% が導入から 3 か月以内で、オンボーディングが分かれ目になっている。",
47
+ },
48
+ {
49
+ headline: "紹介経由の契約は定着率が高い",
50
+ evidence: "紹介経由で入った契約の 6 か月継続率は 91% で、広告経由の 74% を上回った。",
51
+ },
52
+ ]}
53
+ />
54
+ </Document>
55
+ ```
56
+
57
+ ## Notes
58
+
59
+ - Write `headline` as a sentence with a verdict, not a topic ("Churn is concentrated in business plans"). With `headingLevel={3}` the findings become `h4`.
60
+ - Keep the numbers in `evidence` consistent with the `metric` (`delta` is the change itself; no rate is computed for you).
61
+ - When printed, each finding stays on one page and does not break across pages.
@@ -0,0 +1,80 @@
1
+ # DocKpiScorecard
2
+
3
+ > Key metrics in one place — actual, change, gap to target and trend.
4
+
5
+ The key metrics in one section: actual, change from the previous period, achievement against target and a small trend. The default `table` prints well; `grid` shows 3–6 metrics as `dl` tiles. The block computes the direction from the sign of `delta` and the achievement rate from `value ÷ target`.
6
+
7
+ ```tsx
8
+ import { DocKpiScorecard } from "@squadbase/vantage/doc";
9
+ import type { DocKpiScorecardProps, DocScorecardMetric } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **one section to place directly under `<Document>`**. The document sets heading and body sizes and the width, so no dimensions are set here. `asOf` and `source` appear in one line under the block. The labels the block prints (the column headings "指標" / "実績" / "目標" / "達成率" / "推移", "達成率" and "目標" in tiles, "データ時点", "出典") are fixed in Japanese and cannot be overridden. Only `title` and `comparisonLabel` can be set, so pass them in English; their defaults ("主要指標", "前期比") are Japanese. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ | --- | --- | --- | --- |
19
+ | `title` | `string` | `"主要指標"` | Heading text. |
20
+ | `headingLevel` | `2 \| 3` | `2` | Heading level: 2 directly under `<Document>`, 3 inside another section. |
21
+ | `metrics` | `DocScorecardMetric[]` | | Metrics. **Required.** |
22
+ | `metrics[].label` | `string` | | Name of the metric. |
23
+ | `metrics[].value` | `number \| null` | | The value. `null` shows "—". |
24
+ | `metrics[].format` | `ValueFormat` | | Format of `value` (`"currency"`, `{ type: "percent", digits: 1 }`, …). |
25
+ | `metrics[].display` | `string` | | When given, shown instead of the formatted value ("about ¥54M"). |
26
+ | `metrics[].delta` | `{ value: number; format?: ValueFormat }` | | The change itself (current − comparison). Direction comes from the sign; the ▲▼ mark and the sign are always printed. Omit for no comparison. Without `format`, the metric's `format` is used. |
27
+ | `metrics[].comparisonLabel` | `string` | `"前期比"` | Name of the comparison (e.g. "前月比"). |
28
+ | `metrics[].betterWhen` | `"up" \| "down"` | `"up"` | Which way is good. Use `"down"` for churn or cost. Colour only adds good / bad. |
29
+ | `metrics[].target` | `number` | | The target for the period, shown in the metric's `format`; the achievement rate (value ÷ target) is computed here. |
30
+ | `metrics[].trend` | `{ x: string; y: number }[]` | | One series over time, oldest first; the last point is the current value. Use the same unit as `value`. Omit and the cell shows "—"; with two or more points a `Sparkline` is drawn. |
31
+ | `variant` | `"table" \| "grid"` | `"table"` | Table or tiles. |
32
+ | `asOf` | `string` | | The date the numbers were taken, as a date only ("2026-10-03"). Shown as "データ時点 …" in a line under the block. |
33
+ | `source` | `string` | | Source. Shown as "出典: …" in a line under the block. |
34
+
35
+ ## Usage
36
+
37
+ ```tsx
38
+ import { Document, DocKpiScorecard } from "@squadbase/vantage/doc";
39
+
40
+ <Document>
41
+ <DocKpiScorecard
42
+ asOf="2026-10-03"
43
+ source="会計システム"
44
+ metrics={[
45
+ {
46
+ label: "売上",
47
+ value: 53_900_000,
48
+ format: "currency",
49
+ delta: { value: 3_700_000 },
50
+ comparisonLabel: "前月比",
51
+ target: 52_000_000,
52
+ trend: [
53
+ { x: "5 月", y: 48_000_000 },
54
+ { x: "6 月", y: 49_000_000 },
55
+ { x: "7 月", y: 50_000_000 },
56
+ { x: "8 月", y: 50_200_000 },
57
+ { x: "9 月", y: 53_900_000 },
58
+ ],
59
+ },
60
+ {
61
+ label: "解約率",
62
+ value: 0.018,
63
+ format: { type: "percent", digits: 1 },
64
+ delta: { value: -0.003, format: { type: "number", digits: 1, unit: "pt", divisor: 0.01 } },
65
+ comparisonLabel: "前月比",
66
+ betterWhen: "down",
67
+ target: 0.02,
68
+ },
69
+ { label: "新規獲得", value: 38, format: { type: "number", unit: "社" }, delta: { value: -4 }, comparisonLabel: "前月比", target: 50 },
70
+ ]}
71
+ />
72
+ </Document>
73
+ ```
74
+
75
+ ## Notes
76
+
77
+ - For churn or cost, where a fall is good, set `betterWhen: "down"`. A missing value shows "—".
78
+ - Give `target` and the `y` of `trend` in the same unit as `value` (yen if `value` is yen). `target` is shown in the metric's `format`.
79
+ - The heading of the comparison column in the table is the `comparisonLabel` of the first metric that has one, or "前期比" if none does. There is only one column, so use `variant="grid"` to give each metric its own comparison name.
80
+ - When printed, the `table` keeps each row on one page and the `grid` keeps each tile on one page.
@@ -0,0 +1,43 @@
1
+ # DocNotesAndSources
2
+
3
+ > The end matter of a document — notes, definitions of terms and data sources.
4
+
5
+ The section to put last in a document. It prints numbered notes, definitions of terms and the data sources (with their as-of dates). A part with nothing in it is not drawn; with all three empty nothing renders.
6
+
7
+ ```tsx
8
+ import { DocNotesAndSources } from "@squadbase/vantage/doc";
9
+ import type { DocNotesAndSourcesProps, DocDefinition, DocSource } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **one section placed directly under `<Document>`**. The document sets heading and body sizes and the width, so no dimensions are set here. Markdown strings are not parsed. For the whole page, see [Document](page-types/doc). The sub-headings ("注記", "用語の定義", "出典") and 「(データ時点 …)」 are fixed in Japanese.
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Default | Description |
18
+ | --- | --- | --- | --- |
19
+ | `title` | `string` | `"注記・出典"` | The section heading. |
20
+ | `headingLevel` | `2 \| 3` | `2` | Heading level: `2` directly under `<Document>`, `3` inside another section. The sub-headings go one level lower. |
21
+ | `notes` | `ReactNode[]` | | Notes, printed as a numbered list (provisional figures, exclusions). |
22
+ | `definitions` | `DocDefinition[]` | | Definitions of terms: `{ term: string; description: ReactNode }`. |
23
+ | `sources` | `DocSource[]` | | Data sources: `{ name: string; asOf?: string }`. `asOf` is a date only (e.g. `"2026-10-03"`), printed as 「(データ時点 2026-10-03)」. |
24
+
25
+ ## Usage
26
+
27
+ ```tsx
28
+ import { Document, DocNotesAndSources } from "@squadbase/vantage/doc";
29
+
30
+ <Document>
31
+ {/* …body sections… */}
32
+ <DocNotesAndSources
33
+ notes={["September figures are provisional; final values are posted on October 10.", "Refunds are excluded from revenue."]}
34
+ definitions={[{ term: "Churn rate", description: "Contracts cancelled in the month divided by contracts at the start of the month." }]}
35
+ sources={[{ name: "Contract DB", asOf: "2026-10-03" }, { name: "Accounting system" }]}
36
+ />
37
+ </Document>
38
+ ```
39
+
40
+ ## Notes
41
+
42
+ - Each part is kept together so it does not break across pages when printed.
43
+ - `asOf` is date only; the 「データ時点」 wording is added for you.
@@ -0,0 +1,46 @@
1
+ # DocReportHeader
2
+
3
+ > The opening of a document — title, subtitle, period, as-of, author and source.
4
+
5
+ The section that opens a document: an `h1` title and a short fact sheet (`dl`) of period, data as-of, author and source. It is the only block that owns the `h1`; the rest start at `h2`.
6
+
7
+ ```tsx
8
+ import { DocReportHeader } from "@squadbase/vantage/doc";
9
+ import type { DocReportHeaderProps } from "@squadbase/vantage/doc";
10
+ ```
11
+
12
+ > [!NOTE]
13
+ > This is **one section to place directly under `<Document>`**. The document sets heading and body sizes and the width, so no dimensions are set here. `subtitle` is a `string` or a `ReactNode`; Markdown strings are not parsed. The fact labels this block prints ("対象期間", "データ時点", "作成者", "出典") are fixed in Japanese and cannot be overridden, so an English page shows them in Japanese. For the whole page, see [Document](page-types/doc).
14
+
15
+ ## Props
16
+
17
+ | Prop | Type | Description |
18
+ | --- | --- | --- |
19
+ | `title` | `string` | The document title (`h1`). State the subject and period, not a slogan. **Required.** |
20
+ | `subtitle` | `ReactNode` | One line under the title (who it is for, …). A `string` or a `ReactNode`. |
21
+ | `period` | `string` | The period the numbers cover ("2026 年 9 月", "2026-07-01 〜 2026-09-30"). |
22
+ | `asOf` | `string` | The date the data was taken, as a date only ("2026-10-03"). The block adds the label "データ時点". |
23
+ | `author` | `string` | Author. |
24
+ | `source` | `string` | Where the numbers come from ("受注管理システム、会計システム"), as one string. |
25
+
26
+ ## Usage
27
+
28
+ ```tsx
29
+ import { Document, DocReportHeader } from "@squadbase/vantage/doc";
30
+
31
+ <Document>
32
+ <DocReportHeader
33
+ title="2026 年 9 月 月次事業報告"
34
+ subtitle="経営会議向け"
35
+ period="2026-09-01 〜 2026-09-30"
36
+ asOf="2026-10-03"
37
+ author="事業企画チーム"
38
+ source="受注管理システム、会計システム"
39
+ />
40
+ </Document>
41
+ ```
42
+
43
+ ## Notes
44
+
45
+ - An empty fact is left out, row and all, instead of showing "—".
46
+ - When printed, the whole header stays on one page; it does not break across pages.