@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.
Files changed (240) hide show
  1. package/dist/{build-MFWRPYKW.js → build-X5NVCQKT.js} +4 -4
  2. package/dist/{build-MFWRPYKW.js.map → build-X5NVCQKT.js.map} +1 -1
  3. package/dist/chunk-2IAPIOPS.js +152 -0
  4. package/dist/chunk-2IAPIOPS.js.map +1 -0
  5. package/dist/{chunk-IBGOCWJB.js → chunk-2ICNHUG6.js} +186 -82
  6. package/dist/chunk-2ICNHUG6.js.map +1 -0
  7. package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
  8. package/dist/chunk-2N72FKLB.js.map +1 -0
  9. package/dist/chunk-57GHR5LN.js +163 -0
  10. package/dist/chunk-57GHR5LN.js.map +1 -0
  11. package/dist/{chunk-OB6UBJXF.js → chunk-7S52M2SL.js} +127 -36
  12. package/dist/chunk-7S52M2SL.js.map +1 -0
  13. package/dist/chunk-JXFCSF3K.js +673 -0
  14. package/dist/chunk-JXFCSF3K.js.map +1 -0
  15. package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
  16. package/dist/chunk-PDOBHMUQ.js.map +1 -0
  17. package/dist/chunk-RU6WKEOG.js +7048 -0
  18. package/dist/chunk-RU6WKEOG.js.map +1 -0
  19. package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
  20. package/dist/chunk-U736PVHY.js.map +1 -0
  21. package/dist/{chunk-QEWCYW3I.js → chunk-WAMZWZJB.js} +13 -3
  22. package/dist/chunk-WAMZWZJB.js.map +1 -0
  23. package/dist/cli.js +3 -3
  24. package/dist/components/index.d.ts +1592 -100
  25. package/dist/components/index.js +7 -4
  26. package/dist/{dev-DCTOHQ6W.js → dev-4XEDTELV.js} +4 -4
  27. package/dist/{dev-DCTOHQ6W.js.map → dev-4XEDTELV.js.map} +1 -1
  28. package/dist/doc/index.d.ts +194 -2
  29. package/dist/doc/index.js +336 -5
  30. package/dist/doc/index.js.map +1 -1
  31. package/dist/format-U0cQl069.d.ts +243 -0
  32. package/dist/markdown/index.js +1 -1
  33. package/dist/markdown/index.js.map +1 -1
  34. package/dist/slide/index.d.ts +177 -1
  35. package/dist/slide/index.js +866 -3
  36. package/dist/slide/index.js.map +1 -1
  37. package/dist/table/index.js +9 -6
  38. package/dist/table/index.js.map +1 -1
  39. package/dist/ui/index.d.ts +8 -2
  40. package/dist/ui/index.js +22 -112
  41. package/dist/ui/index.js.map +1 -1
  42. package/dist/{upgrade-DBBE6GIR.js → upgrade-JHXZBGQS.js} +3 -3
  43. package/dist/{upgrade-DBBE6GIR.js.map → upgrade-JHXZBGQS.js.map} +1 -1
  44. package/dist/vite/index.js +2 -2
  45. package/docs/en/components.md +40 -17
  46. package/docs/en/doc/doc-action-items.md +49 -0
  47. package/docs/en/doc/doc-callout.md +38 -0
  48. package/docs/en/doc/doc-data-table.md +60 -0
  49. package/docs/en/doc/doc-executive-summary.md +64 -0
  50. package/docs/en/doc/doc-figure.md +56 -0
  51. package/docs/en/doc/doc-key-findings.md +61 -0
  52. package/docs/en/doc/doc-kpi-scorecard.md +80 -0
  53. package/docs/en/doc/doc-report-header.md +46 -0
  54. package/docs/en/parts/area-chart.md +99 -0
  55. package/docs/en/parts/bar-chart.md +91 -0
  56. package/docs/en/parts/bar-list.md +50 -0
  57. package/docs/en/parts/category-bar.md +37 -0
  58. package/docs/en/parts/chart-frame.md +39 -0
  59. package/docs/en/parts/data-table.md +22 -0
  60. package/docs/en/parts/delta.md +50 -0
  61. package/docs/en/parts/donut-chart.md +72 -0
  62. package/docs/en/parts/format.md +43 -0
  63. package/docs/en/parts/funnel-steps.md +2 -1
  64. package/docs/en/parts/heatmap.md +53 -0
  65. package/docs/en/parts/kpi-card.md +57 -0
  66. package/docs/en/parts/legend.md +35 -0
  67. package/docs/en/parts/line-chart.md +94 -0
  68. package/docs/en/parts/metric-value.md +3 -2
  69. package/docs/en/parts/progress-circle.md +33 -0
  70. package/docs/en/parts/sample-data.md +39 -0
  71. package/docs/en/parts/scatter-chart.md +56 -0
  72. package/docs/en/parts/sparkline.md +1 -1
  73. package/docs/en/parts/tracker.md +36 -0
  74. package/docs/en/parts/trend-indicator.md +17 -1
  75. package/docs/en/parts/updated-at.md +30 -0
  76. package/docs/en/parts/waterfall-chart.md +56 -0
  77. package/docs/en/slide/slide-chart-insight.md +52 -0
  78. package/docs/en/slide/slide-cover.md +39 -0
  79. package/docs/en/slide/slide-exec-summary.md +47 -0
  80. package/docs/en/slide/slide-kpi-grid.md +55 -0
  81. package/docs/en/slide/slide-kpi-hero.md +58 -0
  82. package/docs/en/slide/slide-next-actions.md +49 -0
  83. package/docs/en/slide/slide-scorecard-table.md +54 -0
  84. package/docs/en/ui/alert-dialog.md +42 -0
  85. package/docs/en/ui/avatar.md +31 -0
  86. package/docs/en/ui/combobox.md +74 -0
  87. package/docs/en/ui/drawer.md +41 -0
  88. package/docs/en/ui/empty.md +1 -1
  89. package/docs/en/ui/error-state.md +4 -3
  90. package/docs/en/ui/field.md +42 -0
  91. package/docs/en/ui/hover-card.md +21 -0
  92. package/docs/en/ui/kbd.md +17 -0
  93. package/docs/en/ui/loading.md +1 -1
  94. package/docs/en/ui/pagination.md +36 -0
  95. package/docs/en/ui/radio-group.md +21 -0
  96. package/docs/en/ui/toast.md +44 -0
  97. package/docs/en/ui/toggle-group.md +4 -3
  98. package/docs/en/ui-and-theming.md +1 -1
  99. package/docs/index.json +753 -73
  100. package/docs/ja/components.md +37 -16
  101. package/docs/ja/doc/doc-action-items.md +49 -0
  102. package/docs/ja/doc/doc-callout.md +38 -0
  103. package/docs/ja/doc/doc-data-table.md +60 -0
  104. package/docs/ja/doc/doc-executive-summary.md +64 -0
  105. package/docs/ja/doc/doc-figure.md +56 -0
  106. package/docs/ja/doc/doc-key-findings.md +61 -0
  107. package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
  108. package/docs/ja/doc/doc-report-header.md +46 -0
  109. package/docs/ja/parts/area-chart.md +49 -25
  110. package/docs/ja/parts/bar-chart.md +50 -24
  111. package/docs/ja/parts/bar-list.md +31 -8
  112. package/docs/ja/parts/chart-frame.md +36 -0
  113. package/docs/ja/parts/data-table.md +22 -0
  114. package/docs/ja/parts/delta.md +50 -0
  115. package/docs/ja/parts/donut-chart.md +45 -26
  116. package/docs/ja/parts/format.md +44 -0
  117. package/docs/ja/parts/funnel-steps.md +27 -8
  118. package/docs/ja/parts/heatmap.md +45 -0
  119. package/docs/ja/parts/kpi-card.md +55 -0
  120. package/docs/ja/parts/legend.md +36 -0
  121. package/docs/ja/parts/line-chart.md +48 -22
  122. package/docs/ja/parts/metric-value.md +3 -2
  123. package/docs/ja/parts/sample-data.md +61 -0
  124. package/docs/ja/parts/scatter-chart.md +69 -0
  125. package/docs/ja/parts/sparkline.md +1 -1
  126. package/docs/ja/parts/trend-indicator.md +17 -1
  127. package/docs/ja/parts/updated-at.md +27 -0
  128. package/docs/ja/parts/waterfall-chart.md +61 -0
  129. package/docs/ja/slide/slide-chart-insight.md +52 -0
  130. package/docs/ja/slide/slide-cover.md +39 -0
  131. package/docs/ja/slide/slide-exec-summary.md +47 -0
  132. package/docs/ja/slide/slide-kpi-grid.md +55 -0
  133. package/docs/ja/slide/slide-kpi-hero.md +58 -0
  134. package/docs/ja/slide/slide-next-actions.md +49 -0
  135. package/docs/ja/slide/slide-scorecard-table.md +54 -0
  136. package/docs/ja/ui/empty.md +1 -1
  137. package/docs/ja/ui/error-state.md +4 -3
  138. package/docs/ja/ui/loading.md +1 -1
  139. package/docs/ja/ui/toggle-group.md +4 -3
  140. package/docs/ja/ui-and-theming.md +2 -2
  141. package/package.json +26 -24
  142. package/registry/ui/accordion.tsx +4 -2
  143. package/registry/ui/alert-dialog.tsx +3 -3
  144. package/registry/ui/alert.tsx +3 -1
  145. package/registry/ui/app-shell.tsx +7 -1
  146. package/registry/ui/area-chart.tsx +2852 -166
  147. package/registry/ui/attention-list.tsx +303 -0
  148. package/registry/ui/avatar.tsx +1 -1
  149. package/registry/ui/badge.tsx +3 -1
  150. package/registry/ui/bar-chart.tsx +2851 -166
  151. package/registry/ui/bar-list.tsx +3531 -90
  152. package/registry/ui/box-plot-chart.tsx +3906 -0
  153. package/registry/ui/breadcrumb.tsx +3 -1
  154. package/registry/ui/button.tsx +3 -1
  155. package/registry/ui/calendar.tsx +3 -1
  156. package/registry/ui/card.tsx +4 -2
  157. package/registry/ui/category-bar.tsx +1025 -16
  158. package/registry/ui/chart-frame.tsx +1393 -0
  159. package/registry/ui/checkbox.tsx +3 -1
  160. package/registry/ui/collapsible.tsx +3 -1
  161. package/registry/ui/combobox.tsx +2 -2
  162. package/registry/ui/command.tsx +3 -1
  163. package/registry/ui/dashboard-card.tsx +71 -28
  164. package/registry/ui/data-table.tsx +678 -56
  165. package/registry/ui/date-range-picker.tsx +245 -64
  166. package/registry/ui/delta.tsx +188 -0
  167. package/registry/ui/dialog.tsx +5 -3
  168. package/registry/ui/donut-chart.tsx +2929 -182
  169. package/registry/ui/drawer.tsx +1 -1
  170. package/registry/ui/dropdown-menu.tsx +5 -3
  171. package/registry/ui/echart.tsx +621 -67
  172. package/registry/ui/field.tsx +1 -1
  173. package/registry/ui/filter-bar.tsx +33 -6
  174. package/registry/ui/funnel-steps.tsx +3344 -49
  175. package/registry/ui/heatmap.tsx +1786 -0
  176. package/registry/ui/histogram-chart.tsx +3986 -0
  177. package/registry/ui/hover-card.tsx +2 -2
  178. package/registry/ui/input-group.tsx +3 -1
  179. package/registry/ui/input.tsx +3 -1
  180. package/registry/ui/kbd.tsx +3 -1
  181. package/registry/ui/kpi-card.tsx +699 -0
  182. package/registry/ui/label.tsx +3 -1
  183. package/registry/ui/legend.tsx +3563 -0
  184. package/registry/ui/line-chart.tsx +2852 -160
  185. package/registry/ui/metric-value.tsx +9 -1
  186. package/registry/ui/multi-select.tsx +11 -5
  187. package/registry/ui/page-shell.tsx +106 -51
  188. package/registry/ui/pagination.tsx +3 -1
  189. package/registry/ui/paired-chart.tsx +3827 -0
  190. package/registry/ui/placeholder.tsx +8 -2
  191. package/registry/ui/popover.tsx +4 -2
  192. package/registry/ui/progress-circle.tsx +607 -12
  193. package/registry/ui/progress.tsx +3 -1
  194. package/registry/ui/radio-group.tsx +1 -1
  195. package/registry/ui/sample-data.tsx +86 -0
  196. package/registry/ui/scatter-chart.tsx +4212 -0
  197. package/registry/ui/scroll-area.tsx +3 -2
  198. package/registry/ui/searchable-select.tsx +8 -3
  199. package/registry/ui/section-header.tsx +5 -3
  200. package/registry/ui/segmented-control.tsx +7 -2
  201. package/registry/ui/select.tsx +4 -2
  202. package/registry/ui/separator.tsx +3 -1
  203. package/registry/ui/sheet.tsx +4 -2
  204. package/registry/ui/sidebar.tsx +4 -2
  205. package/registry/ui/skeleton.tsx +4 -2
  206. package/registry/ui/slider.tsx +4 -2
  207. package/registry/ui/sparkline.tsx +84 -9
  208. package/registry/ui/spinner.tsx +3 -1
  209. package/registry/ui/states.tsx +34 -5
  210. package/registry/ui/status-badge.tsx +83 -41
  211. package/registry/ui/switch.tsx +3 -1
  212. package/registry/ui/table.tsx +4 -2
  213. package/registry/ui/tabs.tsx +5 -3
  214. package/registry/ui/textarea.tsx +3 -1
  215. package/registry/ui/toast.tsx +2 -2
  216. package/registry/ui/toggle-group.tsx +3 -1
  217. package/registry/ui/toggle.tsx +3 -1
  218. package/registry/ui/tooltip.tsx +10 -4
  219. package/registry/ui/tracker.tsx +632 -19
  220. package/registry/ui/trend-indicator.tsx +15 -3
  221. package/registry/ui/updated-at.tsx +122 -0
  222. package/registry/ui/waterfall-chart.tsx +4248 -0
  223. package/skills/vantage-design/SKILL.md +34 -24
  224. package/skills/vantage-design/references/extract.md +16 -14
  225. package/skills/vantage-design/references/format.md +6 -5
  226. package/skills/vantage-design/references/presets.md +60 -110
  227. package/skills/vantage-slide/SKILL.md +54 -36
  228. package/templates/AGENTS.md +15 -3
  229. package/templates/agents/doc.md +45 -0
  230. package/templates/agents/page.md +32 -1
  231. package/templates/agents/slide.md +55 -2
  232. package/theme.css +244 -149
  233. package/dist/chunk-5ZOP4SQR.js.map +0 -1
  234. package/dist/chunk-A2UUGASH.js.map +0 -1
  235. package/dist/chunk-AG6RZ2RR.js +0 -3208
  236. package/dist/chunk-AG6RZ2RR.js.map +0 -1
  237. package/dist/chunk-IBGOCWJB.js.map +0 -1
  238. package/dist/chunk-OB6UBJXF.js.map +0 -1
  239. package/dist/chunk-PXRX5PEC.js.map +0 -1
  240. package/dist/chunk-QEWCYW3I.js.map +0 -1
@@ -15,6 +15,13 @@ import { definePage } from "@squadbase/vantage"
15
15
  import { BarChart } from "@squadbase/vantage/components"
16
16
  import { Document } from "@squadbase/vantage/doc"
17
17
 
18
+ const weekly = [
19
+ { week: "第1週", 売上: 1180 },
20
+ { week: "第2週", 売上: 1240 },
21
+ { week: "第3週", 売上: 1210 },
22
+ { week: "第4週", 売上: 1620 },
23
+ ]
24
+
18
25
  export const page = definePage({ title: "6月度サマリー", navLabel: "6月度サマリー" })
19
26
  export default function JuneSummary() {
20
27
  return (
@@ -50,6 +57,27 @@ export default function JuneSummary() {
50
57
  - **ページ全体を包むのは `<Document>` だけ。** `PageShell` などのダッシュボード用の枠で包まない
51
58
  (本文の幅と余白は `<Document>` が決めます)。
52
59
 
60
+ ## まず block を探す
61
+
62
+ 1 節分の中身は、手で組む前に `@squadbase/vantage/doc` の block から探します(`<Document>` の直下に
63
+ 並べる。多くは 1 block = 1 節。`DocCallout`・`DocFigure`・`DocDataTable` は節ではなく、節の中(本文の間)に置く部品)。props は `vantage docs <name>`(例: `vantage docs doc-kpi-scorecard`)で引く。
64
+
65
+ | block | 用途 |
66
+ | --- | --- |
67
+ | `DocReportHeader` | レポートの冒頭(タイトル・サブタイトル・対象期間・データ時点・作成者・出典) |
68
+ | `DocExecutiveSummary` | 結論を先に述べる要約の節 |
69
+ | `DocKpiScorecard` | 主要指標をまとめたスコアカード |
70
+ | `DocFigure` | 図表 1 つとキャプション(チャートは children で渡す) |
71
+ | `DocDataTable` | 素の `table` による表 |
72
+ | `DocCallout` | 補足・示唆・注意・決定の囲み(`kind`: `note` / `insight` / `warning` / `decision`) |
73
+ | `DocKeyFindings` | 主要な発見の箇条 |
74
+ | `DocActionItems` | 次のアクション(担当・期限つき) |
75
+
76
+ **props の渡し方は block 間で共通。** 数値は `value: number | null` と `format`(整形は block がする。表示を上書きするときだけ `display`。`null` は「—」)。前期比などは `delta: { value, format? }` と `comparisonLabel`(例 `"前年同期比"`)、良し悪しは指標ごとの `betterWhen`(`"up"` が既定、コストなど下がるほど良いものは `"down"`。向きは block が符号から出す)。目標は `target: number`。出典は `source`、時点は `asOf` に**日付だけ**(例 `"2026-09-30"`。「データ時点」は block が付けるので「時点」を書かない)。時系列は、単一系列なら `{ x, y }[]`(`trend`)。
77
+
78
+ block が合わない**1 節だけ**を素の HTML 要素で手で書く。import 元は `@squadbase/vantage/doc` のままで、
79
+ block のための新しい import 元はありません。本文は文字列か ReactNode で渡し、Markdown 文字列は渡さない。
80
+
53
81
  ## 見た目を変える
54
82
 
55
83
  配色・書体・本文の幅は `--doc-*` の CSS 変数です。既定値はアプリのトークンへの別名なので、
@@ -74,3 +102,20 @@ export default function JuneSummary() {
74
102
  `.doc` を付けられるのはルートになるページモジュールだけで、`_layout.doc.tsx` などは
75
103
  `INVALID_PAGE_VARIANT` エラーになります。`june.doc.tsx` と `june.tsx` は同じ URL に解決するので
76
104
  `ROUTE_CONFLICT` です。
105
+
106
+ ## ファイル形式の規約
107
+
108
+ 置き場所・URL・default export・`definePage` の書き方は全ページ共通(`agents/page.md` の
109
+ 「ページファイルの規約」)。ここではドキュメント固有のものだけを挙げます。
110
+
111
+ **MUST**
112
+
113
+ - ファイル名は `<name>.doc.tsx`(`.jsx` も可)。サフィックスは小文字で 1 つだけ。`.doc.mdx` は
114
+ `INVALID_PAGE_VARIANT`、`.DOC.tsx`・二重サフィックスは黙って通常ページになる
115
+ - default export は `<Document>` をルートに返す。フレームワークは包まない
116
+ - ドキュメントの部品は `@squadbase/vantage/doc` から import する
117
+
118
+ **SHOULD**
119
+
120
+ - `PageShell` で包まない・PDF の保存ボタンを自作しない(上の「書き方」)
121
+ - 数値はコードに直接書き、いつ時点の値かを本文に書く
@@ -71,6 +71,7 @@ URL になる。各ページは**デフォルトエクスポートの React コ
71
71
  | `_404.tsx` | Not Found ページ |
72
72
  | `_error.tsx` | ルートが throw したときのエラーページ |
73
73
  | `monthly-report.slide.tsx` | `/monthly-report`(スライドデッキ。詳しくは `agents/slide.md`) |
74
+ | `june-summary.doc.tsx` | `/june-summary`(ドキュメント。詳しくは `agents/doc.md`) |
74
75
  | `sales-export.csv` | `/sales-export`(詳しくは `agents/csv.md`) |
75
76
  | `data/june.xlsx` | `/data/june`(詳しくは `agents/xlsx.md`) |
76
77
 
@@ -89,6 +90,26 @@ export default function MonthlyAnalysis() {
89
90
  }
90
91
  ```
91
92
 
93
+ ### ページファイルの規約(`.tsx` / `.slide.tsx` / `.doc.tsx` 共通)
94
+
95
+ **MUST**
96
+
97
+ - ページルートの配下に置く。`components/` などの走査対象外のディレクトリに置いたファイルはページに
98
+ ならず、エラーも出ない。`_` 始まりの名前は予約名(`_layout` / `_404` / `_error`)にだけ使う
99
+ (それ以外の `_` 始まりはページにならない。予約名にサフィックスを付けると `INVALID_PAGE_VARIANT`)
100
+ - URL はサフィックスと拡張子を除いたパスで決まる。同じ URL になる別ファイル(`june.tsx` /
101
+ `june.slide.tsx` / `june.doc.tsx` / `june.csv`)を並べない(`ROUTE_CONFLICT`)。テンプレートの
102
+ 未編集の `index.tsx` だけは例外で、`index.slide.tsx` / `index.doc.tsx` が `/` を取れる
103
+ - default export は React の関数コンポーネント(無いと `MISSING_DEFAULT_EXPORT`。関数かどうかは
104
+ 検査されない)
105
+ - `definePage({ ... })` にはオブジェクトリテラルを直接渡し、`title` / `description` / `navLabel` は
106
+ 文字列リテラルで書く。ビルド時に静的抽出されるので、変数・関数呼び出し・spread・shorthand・
107
+ `${}` を含むテンプレート文字列は**エラーにならず黙ってメタなし**になる
108
+
109
+ **SHOULD**
110
+
111
+ - `definePage` に `title` と `navLabel` を書く(ナビの表示名とブラウザのタブ名になる)
112
+
92
113
  ### ナビはルート一覧から組む
93
114
 
94
115
  `useRoutes()` がページルート一覧(スキャン順)を返すので、リンク配列を手で持たない。
@@ -109,7 +130,7 @@ routes.map((r) => (
109
130
  ```
110
131
 
111
132
  `RouteInfo`: `path`(`/sales/:id`)・`to`(`/sales/$id`)・`params`・`dynamic`・`index`・`label`・
112
- `title`・`description`・`navLabel`・`kind`(`"module"` | `"file"`)・`variant`(`"slide"`)。
133
+ `title`・`description`・`navLabel`・`kind`(`"module"` | `"file"`)・`variant`(`"slide"` | `"doc"`)。
113
134
  後ろの 2 つで、ナビをダッシュボード / スライド / データに分けたりアイコンを変えたりできます。
114
135
 
115
136
  ### フィルタ状態は URL に置く
@@ -177,6 +198,16 @@ refetchOnWindowFocus false・networkMode "always")。挙動を変えたいとき
177
198
  `/components` の複合パーツも全部取り出せる(名前は kebab-case: `add ui bar-chart`。
178
199
  ブロックは `add block sales-overview`。未知名で実行すると候補が一覧表示される)。
179
200
 
201
+ ### 長い表はページングする(縦スクロール箱を作らない)
202
+
203
+ - 行が多い表は `DataTablePreset`(または `DataTable`)に `enablePagination` を付けて**ページング**する
204
+ (既定は 10 行 / ページ。ページングは既定で無効なので、付け忘れると全行が並ぶ)。素の `<table>` を
205
+ 手書きして全行を流し込まない。
206
+ - カードの中に `max-h-*` + `overflow-y-auto` の**縦スクロール領域を作らない**。ホイールやキー
207
+ (End / Space)がその箱に吸われ、ページ全体がスクロールしなくなる。高さは内容に任せる。
208
+ - 横に広い表の `overflow-x-auto` は構わない。`SheetGrid`(`.csv` / `.xlsx` のビューア)は
209
+ グリッドとして意図した入れ子スクロールなので対象外。
210
+
180
211
  ### グラフはまず型付きチャートで描く
181
212
 
182
213
  - 推移は `LineChart` / `AreaChart`、比較は `BarChart`、構成比は `DonutChart`。`data`(行の配列)・
@@ -19,6 +19,7 @@
19
19
  - 新規プロジェクトでまだ `/` が空いている場合のみ、`index.slide.tsx` を使ってよい。
20
20
 
21
21
  ```tsx
22
+ import { definePage } from "@squadbase/vantage"
22
23
  import { Slide, SlideDeck } from "@squadbase/vantage/slide"
23
24
 
24
25
  export const page = definePage({ title: "6月度レビュー", navLabel: "6月度" })
@@ -34,8 +35,10 @@ export default function Deck() {
34
35
 
35
36
  **`<Slide>` は `<SlideDeck>` の直接の子に書く。** `SlideDeck` は直下の `<Slide>` 要素だけを数えるので、
36
37
  `<Slide>` を自作コンポーネント(`<Slide1 />` など)や Fragment で包むと 1 枚も数えられず「1 / 0」に
37
- なります(`{items.map((x) => <Slide key={x.id}>…</Slide>)}` のような配列は可)。共通の部品は
38
- `<Slide>` の**中**に置くコンポーネントとして切り出します(`<Slide><CoverPage /></Slide>`)。
38
+ なります(`{items.map((x) => <Slide key={x.id}>…</Slide>)}` のような配列はファイル形式としては可。
39
+ 1 枚の中で視覚要素を `map` で量産しない方針は `vantage-slide` skill の「繰り返す要素は `map` ではなく
40
+ コンポーネント」)。共通の部品は `<Slide>` の**中**に置くコンポーネントとして切り出します
41
+ (`<Slide><CoverPage /></Slide>`)。
39
42
 
40
43
  1920×1080 の固定キャンバスに絶対 px で書き、画面サイズに合わせて縮小されます。キー / クリックで
41
44
  送れ、左のスライド一覧(サムネイル列)は `L` で開閉、`F` で全画面、ツールバーから pptx を
@@ -51,3 +54,53 @@ pptx が壊れる条件、説明と図表のデータ時点の揃え方)。
51
54
  `.slide` を付けられるのはルートになるページモジュールだけで、`_layout.slide.tsx` などは
52
55
  `INVALID_PAGE_VARIANT` エラーになります。`june.slide.tsx` と `june.tsx` は同じ URL に解決するので
53
56
  `ROUTE_CONFLICT` です。
57
+
58
+ ## まず block を探す
59
+
60
+ 1 枚分の中身は、手で組む前に `@squadbase/vantage/slide` の block から探します(`<Slide>` の**中**に
61
+ 置く。ルートは 100% で、`<Slide>` 自体は持たない)。props は `vantage docs <name>`(例:
62
+ `vantage docs slide-kpi-hero`)で引く。
63
+
64
+ | block | 用途 |
65
+ | --- | --- |
66
+ | `SlideCover` | 表紙(タイトル・サブタイトル・期間) |
67
+ | `SlideExecSummary` | 結論を先に述べるエグゼクティブサマリー |
68
+ | `SlideKpiHero` | 主要な KPI 1 つを大きく見せる |
69
+ | `SlideKpiGrid` | 複数の KPI を並べる |
70
+ | `SlideChartInsight` | チャート 1 つと、そこから読み取れること |
71
+ | `SlideScorecardTable` | 指標と目標・達成度を表にしたスコアカード |
72
+ | `SlideNextActions` | 次のアクション(担当・期限つき) |
73
+
74
+ ```tsx
75
+ import { Slide, SlideDeck, SlideCover, SlideExecSummary } from "@squadbase/vantage/slide"
76
+ // <SlideDeck><Slide><SlideCover … /></Slide><Slide><SlideExecSummary … /></Slide></SlideDeck>
77
+ ```
78
+
79
+ **props の渡し方は block 間で共通。** 数値は `value: number | null` と `format`(整形は block がする。表示を上書きするときだけ `display`。`null` は「—」)。前期比などは `delta: { value, format? }` と `comparisonLabel`(例 `"前年同期比"`)、良し悪しは指標ごとの `betterWhen`(`"up"` が既定、コストなど下がるほど良いものは `"down"`。向きは block が符号から出す)。目標は `target: number`。出典は `source`(文字列)、時点は `asOf` に**日付だけ**(例 `"2026-09-30"`。「時点」は block が付けるので書かない)。時系列は、単一系列なら `{ x, y }[]`(kpi-hero・scorecard の `trend`)、複数系列なら `{ categories, series }`(chart-insight の `chart`)。
80
+
81
+ block が合わない**1 枚だけ**を手で書く(デッキ全体を手書きに切り替えない)。import 元は
82
+ `@squadbase/vantage/slide` のままで、block のための新しい import 元はありません。
83
+
84
+ ## ファイル形式の規約
85
+
86
+ 置き場所・URL・default export・`definePage` の書き方は全ページ共通(`agents/page.md` の
87
+ 「ページファイルの規約」)。ここではスライド固有のものだけを挙げます。**中身の値(キャンバス・
88
+ セーフエリア・グリッド・文字サイズ・余白)は `vantage-slide` skill を参照。**
89
+
90
+ **MUST**(破ると黙って壊れるものが多い。`vantage check` が拾うのは名前の誤りだけ)
91
+
92
+ - ファイル名は `<name>.slide.tsx`(`.jsx` も可)。サフィックスは小文字で 1 つだけ。`.slide.ts` は
93
+ `INVALID_PAGE_VARIANT`、`.SLIDE.tsx`・二重サフィックス・`.slide.test.tsx` は黙って通常ページになる
94
+ - default export は `<SlideDeck>` をルートに返す。フレームワークは包まない
95
+ - `<Slide>` は `<SlideDeck>` の直接の子(配列は可。Fragment・自作コンポーネントで包まない)
96
+ - `<Step>` は `<Steps>` の直接の子(包むと常に表示される)
97
+ - スライドの部品は `@squadbase/vantage/slide` から import する
98
+
99
+ **SHOULD**
100
+
101
+ - 1 ファイル = 1 デッキ。ヘルパーコンポーネント・定数も同じ `.slide.tsx` に書く
102
+ - 各 `<Slide>` のルート要素は `width: "100%"; height: "100%"` でキャンバスを埋める
103
+ - canvas に描くチャート(`EChart`)は `data-waitfor="canvas"` で包む(無いと pptx でそのスライドが白紙になりうる)
104
+ - pptx に出る中身をアプリの Context(router / query / テーマ)に依存させない
105
+ - `MorphElement` の `id` はページ内で一意にし、入れ子にしない。遷移先の `<Slide>` で `transition.morph` を有効にする
106
+ - pptx 用などの依存を追加しない(html-to-image / fflate は自動で入る)
package/theme.css CHANGED
@@ -1,3 +1,7 @@
1
+ /* GENERATED by scripts/gen-theme.mjs — do not edit. Sources:
2
+ * packages/squadkit/registry/theme/theme.css (UI part tokens)
3
+ * packages/squadkit/theme/slide-doc.css (slide / document styles) */
4
+
1
5
  /**
2
6
  * Vantage design tokens. Imported after `@import "tailwindcss"` by the
3
7
  * generated runtime.css. Defines CSS variables (light + dark), maps them to
@@ -18,123 +22,154 @@
18
22
  `<select>` popup. */
19
23
  color-scheme: light;
20
24
 
21
- --background: oklch(1 0 0);
22
- --foreground: oklch(0.145 0 0);
25
+ --background: oklch(0.975 0.004 255);
26
+ --foreground: oklch(0.21 0.02 260);
23
27
  --card: oklch(1 0 0);
24
- --card-foreground: oklch(0.145 0 0);
28
+ --card-foreground: oklch(0.21 0.02 260);
25
29
  --popover: oklch(1 0 0);
26
- --popover-foreground: oklch(0.145 0 0);
27
- --primary: oklch(0.205 0 0);
30
+ --popover-foreground: oklch(0.21 0.02 260);
31
+ --primary: oklch(0.55 0.2 262);
28
32
  --primary-foreground: oklch(0.985 0 0);
29
- --secondary: oklch(0.97 0 0);
30
- --secondary-foreground: oklch(0.205 0 0);
31
- --muted: oklch(0.97 0 0);
32
- --muted-foreground: oklch(0.556 0 0);
33
- --accent: oklch(0.97 0 0);
34
- --accent-foreground: oklch(0.205 0 0);
35
- --destructive: oklch(0.577 0.245 27.325);
33
+ --secondary: oklch(0.965 0.005 255);
34
+ --secondary-foreground: oklch(0.25 0.02 260);
35
+ --muted: oklch(0.965 0.005 255);
36
+ --muted-foreground: oklch(0.5 0.02 258);
37
+ --accent: oklch(0.955 0.01 255);
38
+ --accent-foreground: oklch(0.25 0.02 260);
39
+ --destructive: oklch(0.53 0.21 27.325);
36
40
  --destructive-foreground: oklch(0.985 0 0);
37
- --border: oklch(0.922 0 0);
38
- --input: oklch(0.922 0 0);
39
- --ring: oklch(0.708 0 0);
40
- --radius: 0.625rem;
41
-
42
- --chart-1: hsl(221 83% 53%);
43
- --chart-2: hsl(160 60% 45%);
44
- --chart-3: hsl(31 90% 55%);
45
- --chart-4: hsl(280 65% 60%);
46
- --chart-5: hsl(340 75% 55%);
47
-
48
- --sidebar: oklch(0.985 0 0);
49
- --sidebar-foreground: oklch(0.145 0 0);
50
- --sidebar-primary: oklch(0.205 0 0);
51
- --sidebar-primary-foreground: oklch(0.985 0 0);
52
- --sidebar-accent: oklch(0.97 0 0);
53
- --sidebar-accent-foreground: oklch(0.205 0 0);
54
- --sidebar-border: oklch(0.922 0 0);
55
- --sidebar-ring: oklch(0.708 0 0);
56
-
57
- /* Slides (@squadbase/vantage/slide).
58
- These are aliases, not values. Custom properties resolve lazily, so
59
- pointing them at the tokens above is enough for a deck to follow `.dark`
60
- and `[data-theme="dark"]` on its own — restating them in the dark block
61
- below would create two places to keep in step for no gain. A deck
62
- overrides any of them inline through `<SlideDeck theme>`. */
63
- --slide-bg: var(--background);
64
- --slide-fg: var(--foreground);
65
- --slide-accent: var(--primary);
66
- --slide-muted: var(--muted-foreground);
67
- --slide-radius: var(--radius);
68
- /* A system stack that includes Japanese. The pptx export rasterises through
69
- an SVG `foreignObject`, where locally installed families resolve by name
70
- but webfonts must be inlined — so a system default is what makes the
71
- common path export correctly with nothing embedded. */
72
- --slide-font-display:
73
- system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo,
41
+ --border: oklch(0.93 0.006 255);
42
+ --input: oklch(0.9 0.01 255);
43
+ --ring: oklch(0.7 0.12 262);
44
+ --radius: 0.5rem;
45
+
46
+ /* Card elevation: a hairline-soft shadow in light, none in dark (the border does the work there). */
47
+ --shadow-card: 0 1px 2px 0 oklch(0.2 0.02 260 / 0.06);
48
+
49
+ /* Body typeface: a system stack only (no web font is shipped). Presets may swap
50
+ it; `@theme inline` below points `font-sans` at this variable, so overriding
51
+ the variable also moves the utility (and the `html` rule in `@layer base`).
52
+ Latin system faces carry no kana/kanji, so without Japanese families here the
53
+ browser picks a per-locale fallback (lang="en" -> e.g. thin "Yu Gothic" Regular
54
+ on Windows, or a face without a 500 weight on macOS) and kana render thin.
55
+ List the Japanese system faces explicitly, after the Latin ones, and keep
56
+ `ui-sans-serif` / `system-ui` behind them: on Japanese Windows both resolve to
57
+ the menu font, Yu Gothic UI, which is condensed (made to avoid UI resizing)
58
+ and has kana, so it would take the kana before Meiryo is ever reached.
59
+ `-apple-system` is Safari/Firefox; Chrome on macOS needs `BlinkMacSystemFont`. */
60
+ --font-sans:
61
+ -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, ui-sans-serif, system-ui,
74
62
  sans-serif;
75
- --slide-font-body: var(--slide-font-display);
76
- /* Canvas pixels, on the 1920x1080 canvas — not rem: a slide is scaled as a
77
- whole, so its type must not also follow the browser's root font size. */
78
- --slide-size-hero: 168px;
79
- --slide-size-body: 36px;
80
63
 
81
- /* Documents (@squadbase/vantage/doc). Aliases, like --slide-*: they follow
82
- `.dark` through the tokens they point at, so they are not restated in the
83
- dark block. A document overrides any of them inline through
84
- `<Document theme>`, an app through its styles.css. */
85
- --doc-fg: var(--foreground);
86
- --doc-muted: var(--muted-foreground);
87
- --doc-accent: var(--primary);
88
- --doc-border: var(--border);
89
- --doc-subtle: var(--muted);
90
- --doc-font-body: inherit;
91
- --doc-font-heading: var(--doc-font-body);
92
- --doc-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
93
- --doc-size-body: 1rem;
94
- --doc-line-height: 1.8;
95
- --doc-max-width: 48rem;
64
+ --chart-1: oklch(0.55 0.2 262);
65
+ --chart-2: oklch(0.62 0.17 118);
66
+ --chart-3: oklch(0.5 0.19 352);
67
+ --chart-4: oklch(0.62 0.1 195);
68
+ --chart-5: oklch(0.44 0.18 300);
69
+
70
+ /* Semantic status tokens — see the contract above the `@theme inline` block. */
71
+ --positive: oklch(0.52 0.14 150);
72
+ --positive-subtle: oklch(0.96 0.04 150);
73
+ --negative: oklch(0.53 0.19 25);
74
+ --negative-subtle: oklch(0.96 0.03 25);
75
+ --warning: oklch(0.53 0.12 70);
76
+ --warning-subtle: oklch(0.96 0.05 85);
77
+ --info: oklch(0.52 0.16 255);
78
+ --info-subtle: oklch(0.96 0.03 250);
79
+ --positive-fill: oklch(0.62 0.15 150);
80
+ --negative-fill: oklch(0.62 0.17 25);
81
+ --warning-fill: oklch(0.79 0.16 82);
82
+ --info-fill: oklch(0.62 0.15 250);
83
+ --neutral-fill: oklch(0.62 0 0);
84
+ --neutral: oklch(0.52 0 0);
85
+ --neutral-subtle: oklch(0.96 0 0);
86
+
87
+ --sidebar: oklch(0.985 0.003 255);
88
+ --sidebar-foreground: oklch(0.21 0.02 260);
89
+ --sidebar-primary: oklch(0.55 0.2 262);
90
+ --sidebar-primary-foreground: oklch(0.985 0 0);
91
+ --sidebar-accent: oklch(0.955 0.01 255);
92
+ --sidebar-accent-foreground: oklch(0.25 0.02 260);
93
+ --sidebar-border: oklch(0.915 0.008 255);
94
+ --sidebar-ring: oklch(0.7 0.12 262);
96
95
  }
97
96
 
98
97
  .dark,
99
98
  [data-theme="dark"] {
100
99
  color-scheme: dark;
101
100
 
102
- --background: oklch(0.145 0 0);
103
- --foreground: oklch(0.985 0 0);
104
- --card: oklch(0.205 0 0);
105
- --card-foreground: oklch(0.985 0 0);
106
- --popover: oklch(0.205 0 0);
107
- --popover-foreground: oklch(0.985 0 0);
108
- --primary: oklch(0.922 0 0);
109
- --primary-foreground: oklch(0.205 0 0);
110
- --secondary: oklch(0.269 0 0);
111
- --secondary-foreground: oklch(0.985 0 0);
112
- --muted: oklch(0.269 0 0);
113
- --muted-foreground: oklch(0.708 0 0);
114
- --accent: oklch(0.269 0 0);
115
- --accent-foreground: oklch(0.985 0 0);
101
+ --shadow-card: none;
102
+
103
+ --background: oklch(0.16 0.012 262);
104
+ --foreground: oklch(0.96 0.005 255);
105
+ --card: oklch(0.215 0.015 262);
106
+ --card-foreground: oklch(0.96 0.005 255);
107
+ --popover: oklch(0.235 0.016 262);
108
+ --popover-foreground: oklch(0.96 0.005 255);
109
+ --primary: oklch(0.68 0.19 262);
110
+ --primary-foreground: oklch(0.145 0.02 262);
111
+ --secondary: oklch(0.27 0.016 262);
112
+ --secondary-foreground: oklch(0.96 0.005 255);
113
+ --muted: oklch(0.27 0.016 262);
114
+ --muted-foreground: oklch(0.72 0.02 258);
115
+ --accent: oklch(0.3 0.02 262);
116
+ --accent-foreground: oklch(0.96 0.005 255);
116
117
  --destructive: oklch(0.704 0.191 22.216);
117
- --destructive-foreground: oklch(0.985 0 0);
118
+ --destructive-foreground: oklch(0.145 0.02 262);
118
119
  --border: oklch(1 0 0 / 10%);
119
120
  --input: oklch(1 0 0 / 15%);
120
- --ring: oklch(0.556 0 0);
121
-
122
- --chart-1: hsl(217 91% 60%);
123
- --chart-2: hsl(160 60% 45%);
124
- --chart-3: hsl(31 90% 55%);
125
- --chart-4: hsl(280 65% 65%);
126
- --chart-5: hsl(340 75% 60%);
127
-
128
- --sidebar: oklch(0.205 0 0);
129
- --sidebar-foreground: oklch(0.985 0 0);
130
- --sidebar-primary: oklch(0.488 0.243 264.376);
131
- --sidebar-primary-foreground: oklch(0.985 0 0);
132
- --sidebar-accent: oklch(0.269 0 0);
133
- --sidebar-accent-foreground: oklch(0.985 0 0);
121
+ --ring: oklch(0.6 0.15 262);
122
+
123
+ --chart-1: oklch(0.56 0.19 262);
124
+ --chart-2: oklch(0.75 0.17 118);
125
+ --chart-3: oklch(0.64 0.19 352);
126
+ --chart-4: oklch(0.78 0.105 195);
127
+ --chart-5: oklch(0.71 0.17 300);
128
+
129
+ --positive: oklch(0.76 0.15 150);
130
+ --positive-subtle: oklch(0.27 0.05 150);
131
+ --negative: oklch(0.74 0.15 22);
132
+ --negative-subtle: oklch(0.27 0.06 25);
133
+ --warning: oklch(0.8 0.14 80);
134
+ --warning-subtle: oklch(0.27 0.05 75);
135
+ --info: oklch(0.75 0.12 250);
136
+ --info-subtle: oklch(0.27 0.06 255);
137
+ --positive-fill: oklch(0.56 0.13 150);
138
+ --negative-fill: oklch(0.56 0.15 22);
139
+ --warning-fill: oklch(0.73 0.145 78);
140
+ --info-fill: oklch(0.56 0.13 250);
141
+ --neutral-fill: oklch(0.56 0 0);
142
+ --neutral: oklch(0.85 0 0);
143
+ --neutral-subtle: oklch(0.27 0 0);
144
+
145
+ --sidebar: oklch(0.2 0.014 262);
146
+ --sidebar-foreground: oklch(0.96 0.005 255);
147
+ --sidebar-primary: oklch(0.68 0.19 262);
148
+ --sidebar-primary-foreground: oklch(0.145 0.02 262);
149
+ --sidebar-accent: oklch(0.3 0.02 262);
150
+ --sidebar-accent-foreground: oklch(0.96 0.005 255);
134
151
  --sidebar-border: oklch(1 0 0 / 10%);
135
- --sidebar-ring: oklch(0.556 0 0);
152
+ --sidebar-ring: oklch(0.6 0.15 262);
136
153
  }
137
154
 
155
+ /* Semantic status tokens (increase/decrease/status). Every increase, decrease
156
+ and status colour in registry/ comes from these — never a Tailwind palette
157
+ colour like `green-500` (tests/raw-colors.test.ts enforces it).
158
+ --<tone> text colour on --background, --card and --<tone>-subtle
159
+ (>= 4.5:1), and dot / line / icon colour (>= 3:1).
160
+ --<tone>-subtle tinted background behind --<tone> text (badges, callouts).
161
+ --<tone>-fill (incl. --neutral-fill, the grey area) FILL colour for areas (bars, heatmap cells, tracker blocks). Not for
162
+ text or icons — use --<tone>. Same lightness step from the page in both
163
+ modes (light 0.62 / dark 0.56: ~0.36-0.40 OKLCH L away from --background,
164
+ >= 3:1 against --background and --card), so a fill is never strong in one
165
+ mode and faint in the other. Presets may tune hue and chroma within the
166
+ status bands while preserving contrast and fill strength (tests/theme-presets.test.ts).
167
+ --warning-fill is the exception: amber (light 0.79 / dark 0.73, ~#f5b324 / ~#d99a1e) is
168
+ a light colour by nature, so it is ~2:1 on the light page (still >= 0.18 L away)
169
+ and ~7-8:1 on the dark one; dark text (--foreground in light, --background in dark) sits on it at >= 4.5:1.
170
+ Tones: positive (green), negative (red), warning (amber), info (blue),
171
+ neutral (grey). Colour never carries the meaning alone — pair it with an
172
+ arrow or sign. `npm run contrast` prints the measured ratios. */
138
173
  @theme inline {
139
174
  --color-background: var(--background);
140
175
  --color-foreground: var(--foreground);
@@ -155,6 +190,21 @@
155
190
  --color-border: var(--border);
156
191
  --color-input: var(--input);
157
192
  --color-ring: var(--ring);
193
+ --color-positive: var(--positive);
194
+ --color-positive-subtle: var(--positive-subtle);
195
+ --color-negative: var(--negative);
196
+ --color-negative-subtle: var(--negative-subtle);
197
+ --color-warning: var(--warning);
198
+ --color-warning-subtle: var(--warning-subtle);
199
+ --color-info: var(--info);
200
+ --color-info-subtle: var(--info-subtle);
201
+ --color-positive-fill: var(--positive-fill);
202
+ --color-negative-fill: var(--negative-fill);
203
+ --color-warning-fill: var(--warning-fill);
204
+ --color-info-fill: var(--info-fill);
205
+ --color-neutral-fill: var(--neutral-fill);
206
+ --color-neutral: var(--neutral);
207
+ --color-neutral-subtle: var(--neutral-subtle);
158
208
  --color-chart-1: var(--chart-1);
159
209
  --color-chart-2: var(--chart-2);
160
210
  --color-chart-3: var(--chart-3);
@@ -168,10 +218,7 @@
168
218
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
169
219
  --color-sidebar-border: var(--sidebar-border);
170
220
  --color-sidebar-ring: var(--sidebar-ring);
171
- --color-slide-bg: var(--slide-bg);
172
- --color-slide-fg: var(--slide-fg);
173
- --color-slide-accent: var(--slide-accent);
174
- --color-slide-muted: var(--slide-muted);
221
+ --font-sans: var(--font-sans);
175
222
  --radius-sm: calc(var(--radius) - 4px);
176
223
  --radius-md: calc(var(--radius) - 2px);
177
224
  --radius-lg: var(--radius);
@@ -272,6 +319,100 @@
272
319
  }
273
320
  }
274
321
 
322
+ /* ------------------------------------------------------------ utilities */
323
+
324
+ @utility no-scrollbar {
325
+ -ms-overflow-style: none;
326
+ scrollbar-width: none;
327
+
328
+ &::-webkit-scrollbar {
329
+ display: none;
330
+ }
331
+ }
332
+
333
+ /* Icons that must point the other way when the document is right-to-left. */
334
+ .cn-rtl-flip {
335
+ &:where([dir="rtl"], [dir="rtl"] *) {
336
+ transform: scaleX(-1);
337
+ }
338
+ }
339
+
340
+ /* Page defaults live in `@layer base`, like shadcn's own init, so a project's
341
+ `html { @apply font-sans }`, its `next/font` setup and its own border rules
342
+ (all unlayered or later in the layer) win over them instead of losing to an
343
+ unlayered rule here. */
344
+ @layer base {
345
+ html {
346
+ font-family: var(--font-sans);
347
+ }
348
+
349
+ body {
350
+ background-color: var(--background);
351
+ color: var(--foreground);
352
+ -webkit-font-smoothing: antialiased;
353
+ }
354
+
355
+ * {
356
+ border-color: var(--border);
357
+ }
358
+ }
359
+
360
+ /**
361
+ * Vantage framework styles: the slide / document tokens and the document
362
+ * typesetting. The UI parts' tokens live in SquadKit
363
+ * (packages/squadkit/registry/theme/theme.css); packages/vantage/scripts/gen-theme.mjs
364
+ * appends this file to them to produce packages/vantage/theme.css.
365
+ */
366
+
367
+ :root {
368
+ /* Slides (@squadbase/vantage/slide).
369
+ These are aliases, not values. Custom properties resolve lazily, so
370
+ pointing them at the tokens above is enough for a deck to follow `.dark`
371
+ and `[data-theme="dark"]` on its own — restating them in the dark block
372
+ below would create two places to keep in step for no gain. A deck
373
+ overrides any of them inline through `<SlideDeck theme>`. */
374
+ --slide-bg: var(--background);
375
+ --slide-fg: var(--foreground);
376
+ --slide-accent: var(--primary);
377
+ --slide-muted: var(--muted-foreground);
378
+ --slide-radius: var(--radius);
379
+ /* A system stack that includes Japanese. The pptx export rasterises through
380
+ an SVG `foreignObject`, where locally installed families resolve by name
381
+ but webfonts must be inlined — so a system default is what makes the
382
+ common path export correctly with nothing embedded. */
383
+ --slide-font-display:
384
+ -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo,
385
+ system-ui, sans-serif;
386
+ --slide-font-body: var(--slide-font-display);
387
+ /* Canvas pixels, on the 1920x1080 canvas — not rem: a slide is scaled as a
388
+ whole, so its type must not also follow the browser's root font size. */
389
+ --slide-size-hero: 168px;
390
+ --slide-size-body: 36px;
391
+
392
+ /* Documents (@squadbase/vantage/doc). Aliases, like --slide-*: they follow
393
+ `.dark` through the tokens they point at, so they are not restated in the
394
+ dark block. A document overrides any of them inline through
395
+ `<Document theme>`, an app through its styles.css. */
396
+ --doc-fg: var(--foreground);
397
+ --doc-muted: var(--muted-foreground);
398
+ --doc-accent: var(--primary);
399
+ --doc-border: var(--border);
400
+ --doc-subtle: var(--muted);
401
+ --doc-font-body: inherit;
402
+ --doc-font-heading: var(--doc-font-body);
403
+ --doc-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
404
+ --doc-size-body: 1rem;
405
+ --doc-line-height: 1.8;
406
+ --doc-max-width: 48rem;
407
+ }
408
+
409
+ @theme inline {
410
+ --color-slide-bg: var(--slide-bg);
411
+ --color-slide-fg: var(--slide-fg);
412
+ --color-slide-accent: var(--slide-accent);
413
+ --color-slide-muted: var(--slide-muted);
414
+ }
415
+
275
416
  /* ------------------------------------------------------------ documents */
276
417
 
277
418
  /* Typesetting for `<Document>`. Plain elements inside it need no classes.
@@ -287,17 +428,6 @@
287
428
  line-height: var(--doc-line-height);
288
429
  overflow-wrap: break-word;
289
430
  }
290
- /* On screen the document sits in the app frame's unpadded `<main>`, so it
291
- brings its own gutter. `content-box` keeps `--doc-max-width` the width of
292
- the text: the side gutter shows only once the frame is narrower than that.
293
- The bottom leaves room for the fixed "Save as PDF" button. Paper takes its
294
- margin from the print rules below instead. */
295
- @media screen {
296
- :where([data-slot="document"]) {
297
- box-sizing: content-box;
298
- padding: 3rem 1.5rem 5rem;
299
- }
300
- }
301
431
  :where([data-slot="document"]) :where(h1, h2, h3, h4) {
302
432
  font-family: var(--doc-font-heading);
303
433
  font-weight: 700;
@@ -451,38 +581,3 @@
451
581
  overflow: visible;
452
582
  }
453
583
  }
454
-
455
- /* ------------------------------------------------------------ utilities */
456
-
457
- @utility no-scrollbar {
458
- -ms-overflow-style: none;
459
- scrollbar-width: none;
460
-
461
- &::-webkit-scrollbar {
462
- display: none;
463
- }
464
- }
465
-
466
- /* Icons that must point the other way when the document is right-to-left. */
467
- .cn-rtl-flip {
468
- &:where([dir="rtl"], [dir="rtl"] *) {
469
- transform: scaleX(-1);
470
- }
471
- }
472
-
473
- body {
474
- background-color: var(--background);
475
- color: var(--foreground);
476
- /* Latin system faces carry no kana/kanji, so without Japanese families here the
477
- browser picks a per-locale fallback (lang="en" → e.g. thin "Yu Gothic" Regular
478
- on Windows, or a face without a 500 weight on macOS) and kana render thin.
479
- List the Japanese system faces explicitly, after the Latin ones. */
480
- font-family:
481
- ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo,
482
- sans-serif;
483
- -webkit-font-smoothing: antialiased;
484
- }
485
-
486
- * {
487
- border-color: var(--border);
488
- }