@squadbase/vantage 0.6.2-dev1.42c4e48 → 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.
- package/dist/{build-MFWRPYKW.js → build-X5NVCQKT.js} +4 -4
- package/dist/{build-MFWRPYKW.js.map → build-X5NVCQKT.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/{chunk-IBGOCWJB.js → chunk-2ICNHUG6.js} +186 -82
- package/dist/chunk-2ICNHUG6.js.map +1 -0
- package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
- package/dist/chunk-2N72FKLB.js.map +1 -0
- package/dist/chunk-57GHR5LN.js +163 -0
- package/dist/chunk-57GHR5LN.js.map +1 -0
- package/dist/{chunk-OB6UBJXF.js → chunk-7S52M2SL.js} +127 -36
- package/dist/chunk-7S52M2SL.js.map +1 -0
- package/dist/chunk-JXFCSF3K.js +673 -0
- package/dist/chunk-JXFCSF3K.js.map +1 -0
- package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
- package/dist/chunk-PDOBHMUQ.js.map +1 -0
- package/dist/chunk-RU6WKEOG.js +7048 -0
- package/dist/chunk-RU6WKEOG.js.map +1 -0
- package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-QEWCYW3I.js → chunk-WAMZWZJB.js} +13 -3
- package/dist/chunk-WAMZWZJB.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/components/index.d.ts +1592 -100
- package/dist/components/index.js +7 -4
- package/dist/{dev-DCTOHQ6W.js → dev-4XEDTELV.js} +4 -4
- package/dist/{dev-DCTOHQ6W.js.map → dev-4XEDTELV.js.map} +1 -1
- package/dist/doc/index.d.ts +194 -2
- package/dist/doc/index.js +336 -5
- package/dist/doc/index.js.map +1 -1
- package/dist/format-U0cQl069.d.ts +243 -0
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.js.map +1 -1
- package/dist/slide/index.d.ts +177 -1
- package/dist/slide/index.js +866 -3
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +9 -6
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +8 -2
- package/dist/ui/index.js +22 -112
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-DBBE6GIR.js → upgrade-JHXZBGQS.js} +3 -3
- package/dist/{upgrade-DBBE6GIR.js.map → upgrade-JHXZBGQS.js.map} +1 -1
- package/dist/vite/index.js +2 -2
- package/docs/en/components.md +40 -17
- 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-report-header.md +46 -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/data-table.md +22 -0
- package/docs/en/parts/delta.md +50 -0
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/format.md +43 -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 +57 -0
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/metric-value.md +3 -2
- 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/sparkline.md +1 -1
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-insight.md +52 -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-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/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/en/ui-and-theming.md +1 -1
- package/docs/index.json +753 -73
- package/docs/ja/components.md +37 -16
- 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-report-header.md +46 -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/data-table.md +22 -0
- package/docs/ja/parts/delta.md +50 -0
- package/docs/ja/parts/donut-chart.md +45 -26
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +55 -0
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +48 -22
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/sparkline.md +1 -1
- package/docs/ja/parts/trend-indicator.md +17 -1
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -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-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/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/docs/ja/ui-and-theming.md +2 -2
- package/package.json +26 -24
- package/registry/ui/accordion.tsx +4 -2
- package/registry/ui/alert-dialog.tsx +3 -3
- package/registry/ui/alert.tsx +3 -1
- package/registry/ui/app-shell.tsx +7 -1
- package/registry/ui/area-chart.tsx +2852 -166
- package/registry/ui/attention-list.tsx +303 -0
- package/registry/ui/avatar.tsx +1 -1
- package/registry/ui/badge.tsx +3 -1
- package/registry/ui/bar-chart.tsx +2851 -166
- package/registry/ui/bar-list.tsx +3531 -90
- package/registry/ui/box-plot-chart.tsx +3906 -0
- package/registry/ui/breadcrumb.tsx +3 -1
- package/registry/ui/button.tsx +3 -1
- package/registry/ui/calendar.tsx +3 -1
- package/registry/ui/card.tsx +4 -2
- package/registry/ui/category-bar.tsx +1025 -16
- package/registry/ui/chart-frame.tsx +1393 -0
- package/registry/ui/checkbox.tsx +3 -1
- package/registry/ui/collapsible.tsx +3 -1
- package/registry/ui/combobox.tsx +2 -2
- package/registry/ui/command.tsx +3 -1
- package/registry/ui/dashboard-card.tsx +71 -28
- package/registry/ui/data-table.tsx +678 -56
- package/registry/ui/date-range-picker.tsx +245 -64
- package/registry/ui/delta.tsx +188 -0
- package/registry/ui/dialog.tsx +5 -3
- package/registry/ui/donut-chart.tsx +2929 -182
- package/registry/ui/drawer.tsx +1 -1
- package/registry/ui/dropdown-menu.tsx +5 -3
- package/registry/ui/echart.tsx +621 -67
- package/registry/ui/field.tsx +1 -1
- package/registry/ui/filter-bar.tsx +33 -6
- package/registry/ui/funnel-steps.tsx +3344 -49
- package/registry/ui/heatmap.tsx +1786 -0
- package/registry/ui/histogram-chart.tsx +3986 -0
- package/registry/ui/hover-card.tsx +2 -2
- package/registry/ui/input-group.tsx +3 -1
- package/registry/ui/input.tsx +3 -1
- package/registry/ui/kbd.tsx +3 -1
- package/registry/ui/kpi-card.tsx +699 -0
- package/registry/ui/label.tsx +3 -1
- package/registry/ui/legend.tsx +3563 -0
- package/registry/ui/line-chart.tsx +2852 -160
- package/registry/ui/metric-value.tsx +9 -1
- package/registry/ui/multi-select.tsx +11 -5
- package/registry/ui/page-shell.tsx +106 -51
- package/registry/ui/pagination.tsx +3 -1
- package/registry/ui/paired-chart.tsx +3827 -0
- package/registry/ui/placeholder.tsx +8 -2
- package/registry/ui/popover.tsx +4 -2
- package/registry/ui/progress-circle.tsx +607 -12
- package/registry/ui/progress.tsx +3 -1
- package/registry/ui/radio-group.tsx +1 -1
- package/registry/ui/sample-data.tsx +86 -0
- package/registry/ui/scatter-chart.tsx +4212 -0
- package/registry/ui/scroll-area.tsx +3 -2
- package/registry/ui/searchable-select.tsx +8 -3
- package/registry/ui/section-header.tsx +5 -3
- package/registry/ui/segmented-control.tsx +7 -2
- package/registry/ui/select.tsx +4 -2
- package/registry/ui/separator.tsx +3 -1
- package/registry/ui/sheet.tsx +4 -2
- package/registry/ui/sidebar.tsx +4 -2
- package/registry/ui/skeleton.tsx +4 -2
- package/registry/ui/slider.tsx +4 -2
- package/registry/ui/sparkline.tsx +84 -9
- package/registry/ui/spinner.tsx +3 -1
- package/registry/ui/states.tsx +34 -5
- package/registry/ui/status-badge.tsx +83 -41
- package/registry/ui/switch.tsx +3 -1
- package/registry/ui/table.tsx +4 -2
- package/registry/ui/tabs.tsx +5 -3
- package/registry/ui/textarea.tsx +3 -1
- package/registry/ui/toast.tsx +2 -2
- package/registry/ui/toggle-group.tsx +3 -1
- package/registry/ui/toggle.tsx +3 -1
- package/registry/ui/tooltip.tsx +10 -4
- package/registry/ui/tracker.tsx +632 -19
- package/registry/ui/trend-indicator.tsx +15 -3
- package/registry/ui/updated-at.tsx +122 -0
- package/registry/ui/waterfall-chart.tsx +4248 -0
- package/skills/vantage-design/SKILL.md +34 -24
- 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-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +15 -3
- package/templates/agents/doc.md +45 -0
- package/templates/agents/page.md +32 -1
- package/templates/agents/slide.md +55 -2
- package/theme.css +244 -149
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-AG6RZ2RR.js +0 -3208
- package/dist/chunk-AG6RZ2RR.js.map +0 -1
- package/dist/chunk-IBGOCWJB.js.map +0 -1
- package/dist/chunk-OB6UBJXF.js.map +0 -1
- package/dist/chunk-PXRX5PEC.js.map +0 -1
- package/dist/chunk-QEWCYW3I.js.map +0 -1
package/dist/vite/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { vantagePlugin } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { vantagePlugin } from '../chunk-2ICNHUG6.js';
|
|
2
|
+
import '../chunk-WAMZWZJB.js';
|
|
3
3
|
import '../chunk-CEXAQQ5W.js';
|
|
4
4
|
import '../chunk-RNTDBX6S.js';
|
|
5
5
|
import '../chunk-46QI6GFC.js';
|
package/docs/en/components.md
CHANGED
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
> Reference for the bundled shadcn/ui (Base UI) kit and the composite dashboard components.
|
|
4
4
|
|
|
5
|
-
Vantage ships **shadcn/ui** as-is. Nothing to install, nothing to copy — just import. There are
|
|
6
|
-
public entry points, and **the sidebar is sectioned by those
|
|
5
|
+
Vantage ships **shadcn/ui** as-is. Nothing to install, nothing to copy — just import. There are five
|
|
6
|
+
public entry points, and **the sidebar is sectioned by those five** (`/slide` and `/doc` hold the blocks for slide and document pages).
|
|
7
7
|
|
|
8
8
|
| Subpath | What's in it | Count |
|
|
9
9
|
| --- | --- | --- |
|
|
10
10
|
| [`@squadbase/vantage/ui`](ui/button) | The shadcn/ui primitives (Base UI build) plus utilities like `cn()` | 37 |
|
|
11
11
|
| [`@squadbase/vantage/components`](parts/page-shell) | Dashboard parts composed from them | 15 |
|
|
12
12
|
| [`@squadbase/vantage/markdown`](markdown/markdown-renderer) | Markdown rendering alone (kept apart — it's heavy) | 1 |
|
|
13
|
+
| [`@squadbase/vantage/slide`](slide/slide-cover) | Blocks for the content of one slide in a `.slide.tsx` (7: cover, summary, KPI, chart, scorecard, next actions) | 7 |
|
|
14
|
+
| [`@squadbase/vantage/doc`](doc/doc-report-header) | Section and part blocks placed inside `<Document>` in a `.doc.tsx` | 8 |
|
|
13
15
|
|
|
14
16
|
```tsx
|
|
15
17
|
import { Button, Card, Badge } from "@squadbase/vantage/ui";
|
|
@@ -113,7 +115,12 @@ here they're grouped by what they're for.
|
|
|
113
115
|
|
|
114
116
|
## `@squadbase/vantage/components`
|
|
115
117
|
|
|
116
|
-
Dashboard parts composed from `ui/`.
|
|
118
|
+
Dashboard parts composed from `ui/`. Their source of truth is SquadKit; Vantage re-exports them.
|
|
119
|
+
|
|
120
|
+
Show a KPI with [`KpiCard`](parts/kpi-card) and a change with
|
|
121
|
+
[`Delta`](parts/delta) (pass `comparison` and `polarity`).
|
|
122
|
+
[`TrendIndicator`](parts/trend-indicator) is deprecated. Number formatting and the
|
|
123
|
+
change calculation live in [format / comparison](parts/format).
|
|
117
124
|
|
|
118
125
|
| Component | What it is |
|
|
119
126
|
| --- | --- |
|
|
@@ -130,8 +137,10 @@ Dashboard parts composed from `ui/`.
|
|
|
130
137
|
| [`SegmentedControl`](parts/segmented-control) | Single-choice segments |
|
|
131
138
|
| [`SearchableSelect`](parts/searchable-select) | Single choice with search |
|
|
132
139
|
| [`MultiSelect`](parts/multi-select) | Multiple choice with search |
|
|
140
|
+
| [`KpiCard`](parts/kpi-card) | One KPI as a card: value, change, previous actual, conclusion |
|
|
141
|
+
| [`Delta`](parts/delta) | The change against a comparison, derived from the values |
|
|
133
142
|
| [`MetricValue`](parts/metric-value) | A KPI's number and unit |
|
|
134
|
-
| [`TrendIndicator`](parts/trend-indicator) |
|
|
143
|
+
| [`TrendIndicator`](parts/trend-indicator) | Deprecated — use `Delta` |
|
|
135
144
|
| [`StatusBadge`](parts/status-badge) | A dot-and-label status badge |
|
|
136
145
|
| [`Placeholder`](parts/placeholder) | An inline marker for sample data |
|
|
137
146
|
|
|
@@ -141,6 +150,13 @@ A subpath holding only [`MarkdownRenderer`](markdown/markdown-renderer). Markdow
|
|
|
141
150
|
rendering carries Shiki with every language grammar; mixed into the `components` barrel it would add
|
|
142
151
|
over 10 MB to every build, so it is deliberately kept apart.
|
|
143
152
|
|
|
153
|
+
## `@squadbase/vantage/slide` and `@squadbase/vantage/doc`
|
|
154
|
+
|
|
155
|
+
Blocks for [slide](page-types/slide) and [document](page-types/doc) pages. They live on their own subpaths, apart from `/components`, and `vantage add` does not copy them — import and use them.
|
|
156
|
+
|
|
157
|
+
- **slide**: the content of one `<Slide>` (not `<Slide>` itself). [`SlideCover`](slide/slide-cover) / [`SlideExecSummary`](slide/slide-exec-summary) / [`SlideKpiHero`](slide/slide-kpi-hero) / [`SlideKpiGrid`](slide/slide-kpi-grid) / [`SlideChartInsight`](slide/slide-chart-insight) / [`SlideScorecardTable`](slide/slide-scorecard-table) / [`SlideNextActions`](slide/slide-next-actions)
|
|
158
|
+
- **doc**: sections and parts placed inside `<Document>` (`DocFigure` / `DocDataTable` / `DocCallout` go inside a section). [`DocReportHeader`](doc/doc-report-header) / [`DocExecutiveSummary`](doc/doc-executive-summary) / [`DocKpiScorecard`](doc/doc-kpi-scorecard) / [`DocFigure`](doc/doc-figure) / [`DocDataTable`](doc/doc-data-table) / [`DocCallout`](doc/doc-callout) / [`DocKeyFindings`](doc/doc-key-findings) / [`DocActionItems`](doc/doc-action-items)
|
|
159
|
+
|
|
144
160
|
## Putting it together
|
|
145
161
|
|
|
146
162
|
```tsx
|
|
@@ -154,9 +170,8 @@ import {
|
|
|
154
170
|
PageShellHeaderEnd,
|
|
155
171
|
PageShellActions,
|
|
156
172
|
PageShellContent,
|
|
173
|
+
KpiCard,
|
|
157
174
|
DashboardCardPreset,
|
|
158
|
-
MetricValue,
|
|
159
|
-
TrendIndicator,
|
|
160
175
|
EChart,
|
|
161
176
|
type EChartsOption,
|
|
162
177
|
} from "@squadbase/vantage/components";
|
|
@@ -184,17 +199,25 @@ export default function Overview() {
|
|
|
184
199
|
|
|
185
200
|
<PageShellContent>
|
|
186
201
|
<div className="grid gap-4 md:grid-cols-3">
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
202
|
+
<KpiCard
|
|
203
|
+
label="Revenue"
|
|
204
|
+
value={1_240_000}
|
|
205
|
+
format="currency"
|
|
206
|
+
comparison={{ previous: 1_103_000, vs: "prior-period" }}
|
|
207
|
+
/>
|
|
208
|
+
<KpiCard
|
|
209
|
+
label="New customers"
|
|
210
|
+
value={128}
|
|
211
|
+
format="number"
|
|
212
|
+
comparison={{ previous: 132, vs: "prior-period" }}
|
|
213
|
+
/>
|
|
214
|
+
<KpiCard
|
|
215
|
+
label="Churn"
|
|
216
|
+
value={0.021}
|
|
217
|
+
format={{ type: "percent", digits: 1 }}
|
|
218
|
+
comparison={{ previous: 0.026, vs: "prior-period" }}
|
|
219
|
+
polarity="lower-is-better"
|
|
220
|
+
/>
|
|
198
221
|
</div>
|
|
199
222
|
|
|
200
223
|
<DashboardCardPreset title="Monthly revenue" className="mt-4">
|
|
@@ -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,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.
|