@squadbase/vantage 0.6.2-dev1.ac99e02 → 0.6.2-dev1.b28a4df

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 (145) 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-IBGOCWJB.js → chunk-2ICNHUG6.js} +186 -82
  4. package/dist/chunk-2ICNHUG6.js.map +1 -0
  5. package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
  6. package/dist/chunk-2N72FKLB.js.map +1 -0
  7. package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
  8. package/dist/chunk-PDOBHMUQ.js.map +1 -0
  9. package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
  10. package/dist/chunk-U736PVHY.js.map +1 -0
  11. package/dist/chunk-UNCSBSO4.js +7866 -0
  12. package/dist/chunk-UNCSBSO4.js.map +1 -0
  13. package/dist/{chunk-QEWCYW3I.js → chunk-WAMZWZJB.js} +13 -3
  14. package/dist/chunk-WAMZWZJB.js.map +1 -0
  15. package/dist/{chunk-OB6UBJXF.js → chunk-XPQSTZUU.js} +125 -35
  16. package/dist/chunk-XPQSTZUU.js.map +1 -0
  17. package/dist/cli.js +3 -3
  18. package/dist/components/index.d.ts +1831 -99
  19. package/dist/components/index.js +4 -4
  20. package/dist/{dev-DCTOHQ6W.js → dev-4XEDTELV.js} +4 -4
  21. package/dist/{dev-DCTOHQ6W.js.map → dev-4XEDTELV.js.map} +1 -1
  22. package/dist/doc/index.js +2 -2
  23. package/dist/doc/index.js.map +1 -1
  24. package/dist/markdown/index.js +1 -1
  25. package/dist/markdown/index.js.map +1 -1
  26. package/dist/slide/index.js +2 -2
  27. package/dist/slide/index.js.map +1 -1
  28. package/dist/table/index.js +6 -6
  29. package/dist/table/index.js.map +1 -1
  30. package/dist/ui/index.d.ts +4 -1
  31. package/dist/ui/index.js +21 -111
  32. package/dist/ui/index.js.map +1 -1
  33. package/dist/{upgrade-DBBE6GIR.js → upgrade-JHXZBGQS.js} +3 -3
  34. package/dist/{upgrade-DBBE6GIR.js.map → upgrade-JHXZBGQS.js.map} +1 -1
  35. package/dist/vite/index.js +2 -2
  36. package/docs/en/components.md +29 -15
  37. package/docs/en/parts/data-table.md +22 -0
  38. package/docs/en/parts/delta.md +50 -0
  39. package/docs/en/parts/format.md +43 -0
  40. package/docs/en/parts/kpi-card.md +57 -0
  41. package/docs/en/parts/metric-value.md +3 -2
  42. package/docs/en/parts/sparkline.md +1 -1
  43. package/docs/en/parts/trend-indicator.md +17 -1
  44. package/docs/en/ui-and-theming.md +1 -1
  45. package/docs/index.json +92 -32
  46. package/docs/ja/changelog.md +5 -0
  47. package/docs/ja/components.md +27 -15
  48. package/docs/ja/parts/data-table.md +22 -0
  49. package/docs/ja/parts/delta.md +50 -0
  50. package/docs/ja/parts/format.md +44 -0
  51. package/docs/ja/parts/kpi-card.md +55 -0
  52. package/docs/ja/parts/metric-value.md +3 -2
  53. package/docs/ja/parts/sparkline.md +1 -1
  54. package/docs/ja/parts/trend-indicator.md +17 -1
  55. package/docs/ja/ui-and-theming.md +2 -2
  56. package/package.json +26 -24
  57. package/registry/ui/accordion.tsx +4 -2
  58. package/registry/ui/alert-dialog.tsx +3 -3
  59. package/registry/ui/alert.tsx +3 -1
  60. package/registry/ui/app-shell.tsx +7 -1
  61. package/registry/ui/area-chart.tsx +2781 -157
  62. package/registry/ui/avatar.tsx +1 -1
  63. package/registry/ui/badge.tsx +3 -1
  64. package/registry/ui/bar-chart.tsx +2780 -157
  65. package/registry/ui/bar-list.tsx +3471 -93
  66. package/registry/ui/breadcrumb.tsx +3 -1
  67. package/registry/ui/button.tsx +3 -1
  68. package/registry/ui/calendar.tsx +3 -1
  69. package/registry/ui/card.tsx +4 -2
  70. package/registry/ui/category-bar.tsx +990 -16
  71. package/registry/ui/chart-frame.tsx +1358 -0
  72. package/registry/ui/checkbox.tsx +3 -1
  73. package/registry/ui/collapsible.tsx +3 -1
  74. package/registry/ui/combobox.tsx +2 -2
  75. package/registry/ui/command.tsx +3 -1
  76. package/registry/ui/dashboard-card.tsx +69 -26
  77. package/registry/ui/data-table.tsx +678 -56
  78. package/registry/ui/date-range-picker.tsx +245 -64
  79. package/registry/ui/delta.tsx +188 -0
  80. package/registry/ui/dialog.tsx +5 -3
  81. package/registry/ui/donut-chart.tsx +2857 -173
  82. package/registry/ui/drawer.tsx +1 -1
  83. package/registry/ui/dropdown-menu.tsx +5 -3
  84. package/registry/ui/echart.tsx +448 -44
  85. package/registry/ui/field.tsx +1 -1
  86. package/registry/ui/filter-bar.tsx +33 -6
  87. package/registry/ui/funnel-steps.tsx +3316 -49
  88. package/registry/ui/heatmap.tsx +1752 -0
  89. package/registry/ui/hover-card.tsx +2 -2
  90. package/registry/ui/input-group.tsx +3 -1
  91. package/registry/ui/input.tsx +3 -1
  92. package/registry/ui/kbd.tsx +3 -1
  93. package/registry/ui/kpi-card.tsx +677 -0
  94. package/registry/ui/label.tsx +3 -1
  95. package/registry/ui/legend.tsx +3500 -0
  96. package/registry/ui/line-chart.tsx +2781 -151
  97. package/registry/ui/metric-value.tsx +9 -1
  98. package/registry/ui/multi-select.tsx +11 -5
  99. package/registry/ui/page-shell.tsx +105 -50
  100. package/registry/ui/pagination.tsx +3 -1
  101. package/registry/ui/placeholder.tsx +8 -2
  102. package/registry/ui/popover.tsx +4 -2
  103. package/registry/ui/progress-circle.tsx +607 -12
  104. package/registry/ui/progress.tsx +3 -1
  105. package/registry/ui/radio-group.tsx +1 -1
  106. package/registry/ui/sample-data.tsx +86 -0
  107. package/registry/ui/scatter-chart.tsx +4150 -0
  108. package/registry/ui/scroll-area.tsx +3 -2
  109. package/registry/ui/searchable-select.tsx +8 -3
  110. package/registry/ui/section-header.tsx +4 -2
  111. package/registry/ui/segmented-control.tsx +7 -2
  112. package/registry/ui/select.tsx +4 -2
  113. package/registry/ui/separator.tsx +3 -1
  114. package/registry/ui/sheet.tsx +4 -2
  115. package/registry/ui/sidebar.tsx +4 -2
  116. package/registry/ui/skeleton.tsx +4 -2
  117. package/registry/ui/slider.tsx +3 -1
  118. package/registry/ui/sparkline.tsx +84 -9
  119. package/registry/ui/spinner.tsx +3 -1
  120. package/registry/ui/states.tsx +34 -5
  121. package/registry/ui/status-badge.tsx +81 -39
  122. package/registry/ui/switch.tsx +3 -1
  123. package/registry/ui/table.tsx +4 -2
  124. package/registry/ui/tabs.tsx +5 -3
  125. package/registry/ui/textarea.tsx +3 -1
  126. package/registry/ui/toast.tsx +2 -2
  127. package/registry/ui/toggle-group.tsx +3 -1
  128. package/registry/ui/toggle.tsx +3 -1
  129. package/registry/ui/tooltip.tsx +4 -2
  130. package/registry/ui/tracker.tsx +624 -17
  131. package/registry/ui/trend-indicator.tsx +13 -1
  132. package/registry/ui/updated-at.tsx +122 -0
  133. package/registry/ui/waterfall-chart.tsx +4186 -0
  134. package/skills/vantage-design/SKILL.md +10 -2
  135. package/templates/AGENTS.md +13 -1
  136. package/templates/agents/page.md +10 -0
  137. package/theme.css +241 -136
  138. package/dist/chunk-5ZOP4SQR.js.map +0 -1
  139. package/dist/chunk-A2UUGASH.js.map +0 -1
  140. package/dist/chunk-AG6RZ2RR.js +0 -3208
  141. package/dist/chunk-AG6RZ2RR.js.map +0 -1
  142. package/dist/chunk-IBGOCWJB.js.map +0 -1
  143. package/dist/chunk-OB6UBJXF.js.map +0 -1
  144. package/dist/chunk-PXRX5PEC.js.map +0 -1
  145. package/dist/chunk-QEWCYW3I.js.map +0 -1
@@ -77,19 +77,27 @@ Vantage アプリの見た目は 2 つのファイルで決まる。
77
77
 
78
78
  ```css
79
79
  body {
80
- font-family: "<Font>", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
80
+ font-family: "<Font>", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, ui-sans-serif, system-ui, sans-serif;
81
81
  }
82
82
  :root {
83
- --slide-font-display: "<Font>", system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
83
+ --slide-font-display: "<Font>", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
84
84
  --slide-font-body: var(--slide-font-display);
85
85
  }
86
86
  ```
87
87
 
88
88
  欧文の Web フォントだけを先頭に足すときも、日本語の system face(`"Hiragino Sans"` 〜 `Meiryo`)は
89
89
  必ず残す。消すとカナ・漢字がブラウザ任せのフォールバックになり、細く表示される。
90
+ `ui-sans-serif` / `system-ui` は日本語の face より**後ろ**に置く。日本語の Windows ではどちらも
91
+ Yu Gothic UI(UI のリサイズを避けるために字幅を詰めた書体)に解決され、カナがここで決まって
92
+ 半角風に見える。macOS の Chrome は `-apple-system` を解釈しないので `BlinkMacSystemFont` も並べる。
93
+ 既存アプリの `styles.css` に `ui-sans-serif, system-ui, …` が先頭にある、または `"Yu Gothic UI"` が
94
+ 残っているときは、`body` の `font-family` を上の並びに直す(ほかの行は書き換えない)。
90
95
  日本語の Web フォントは face が 100 を超えるので原則使わない(pptx 書き出しも壊れる。
91
96
  `vantage-slide` の `references/tokens.md` 参照)。
92
97
 
98
+ 長い表(ダッシュボード): カードに `max-h-*` + `overflow-y-auto` の縦スクロール領域を作らず、
99
+ ページング付きの `DataTablePreset`(`enablePagination`)にする(ホイールや End キーがページに届かなくなるため)。
100
+
93
101
  `DESIGN.md`: `references/format.md` の書式で書く。**色コードを書かない**(トークン名だけ)。
94
102
  150 行を超えない(超えると `vantage check` が `DESIGN_MD_TOO_LONG` を出す)。ロゴなどの素材は
95
103
  `public/brand/logo.svg` のように `public/` 配下のパスで「ブランド素材」行に書く。
@@ -93,13 +93,25 @@ root/
93
93
  | `@squadbase/vantage/router` | `Link`・`Outlet`・`useParams`・`useSearch`・`useNavigate`・`redirect`・`notFound`・`useRoutes`・`useCurrentRoute`・`useSearchParam`・`useSearchState` |
94
94
  | `@squadbase/vantage/query` | `useApiQuery`・`useApiMutation`・`apiJson`・`apiFetch`・`apiUrl`・`ApiError`、ほか `useQuery`/`useMutation` など TanStack Query の再エクスポート |
95
95
  | `@squadbase/vantage/ui` | shadcn/ui(Base UI バリアント)プリミティブ(`Button`・`Loading`・`ErrorState`・`Empty` ほか) |
96
- | `@squadbase/vantage/components` | 複合パーツ(`PageShell`・`DashboardCardPreset`・`DataTablePreset`、型付きチャート `LineChart`・`BarChart`・`AreaChart`・`DonutChart`・`BarList` ほか、`EChart`) |
96
+ | `@squadbase/vantage/components` | 複合パーツ(`PageShell`・`DashboardCardPreset`・`DataTablePreset`、KPI の `KpiCard`・`Delta`、型付きチャート `LineChart`・`BarChart`・`AreaChart`・`DonutChart`・`BarList` ほか、`EChart`、書式の `formatValue`) |
97
97
  | `@squadbase/vantage/table` | `FilePageView`・`TableViewer`(データファイルページの表ビューア) |
98
98
  | `@squadbase/vantage/slide` | `SlideDeck`・`Slide`・`Steps`・`Step`・`MorphElement`・`useSlideNumber`・`useIsActiveSlide`(スライド専用。1920×1080 の固定キャンバス) |
99
99
  | `@squadbase/vantage/doc` | `Document`(ドキュメント専用。中の素の HTML 要素に見出し・表などのスタイルが当たる) |
100
100
  | `@squadbase/vantage/markdown` | `MarkdownRenderer`(Shiki を隔離するための専用サブパス) |
101
101
  | `@squadbase/vantage/server` | `ApiContext`・`ApiHandler`・`HttpError`・`isHttpError`・`json`(server/ 側でのみ使う) |
102
102
 
103
+ **KPI は `KpiCard`、増減は `Delta`(`comparison` と `polarity` を渡す)。** 向き・率・色は値から計算
104
+ されるので手で渡さない。`TrendIndicator` は非推奨(`direction` を手で渡すので値と食い違いうる)。props は
105
+ `vantage docs kpi-card` / `vantage docs delta` を引く。
106
+
107
+ ```tsx
108
+ import { KpiCard, Delta } from "@squadbase/vantage/components";
109
+
110
+ <KpiCard label="売上" value={48_200_000} format="currency"
111
+ comparison={{ previous: 42_900_000, vs: "prior-period" }} />
112
+ <Delta value={0.021} comparison={{ previous: 0.026, vs: "prior-period" }} polarity="lower-is-better" />
113
+ ```
114
+
103
115
  ## モードは 2 つ、切り替えるのは `server/` の有無だけ
104
116
 
105
117
  `server/` ディレクトリがあれば **fullstack**、無ければ **SPA**。`vantage-manifest.json` の
@@ -177,6 +177,16 @@ refetchOnWindowFocus false・networkMode "always")。挙動を変えたいとき
177
177
  `/components` の複合パーツも全部取り出せる(名前は kebab-case: `add ui bar-chart`。
178
178
  ブロックは `add block sales-overview`。未知名で実行すると候補が一覧表示される)。
179
179
 
180
+ ### 長い表はページングする(縦スクロール箱を作らない)
181
+
182
+ - 行が多い表は `DataTablePreset`(または `DataTable`)に `enablePagination` を付けて**ページング**する
183
+ (既定は 10 行 / ページ。ページングは既定で無効なので、付け忘れると全行が並ぶ)。素の `<table>` を
184
+ 手書きして全行を流し込まない。
185
+ - カードの中に `max-h-*` + `overflow-y-auto` の**縦スクロール領域を作らない**。ホイールやキー
186
+ (End / Space)がその箱に吸われ、ページ全体がスクロールしなくなる。高さは内容に任せる。
187
+ - 横に広い表の `overflow-x-auto` は構わない。`SheetGrid`(`.csv` / `.xlsx` のビューア)は
188
+ グリッドとして意図した入れ子スクロールなので対象外。
189
+
180
190
  ### グラフはまず型付きチャートで描く
181
191
 
182
192
  - 推移は `LineChart` / `AreaChart`、比較は `BarChart`、構成比は `DonutChart`。`data`(行の配列)・
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/vantage/src/theme/framework.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,153 @@
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.915 0.008 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.7 0.14 215);
66
+ --chart-3: oklch(0.6 0.23 295);
67
+ --chart-4: oklch(0.63 0.24 330);
68
+ --chart-5: oklch(0.78 0.19 125);
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
118
  --destructive-foreground: oklch(0.985 0 0);
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);
121
+ --ring: oklch(0.6 0.15 262);
122
+
123
+ --chart-1: oklch(0.55 0.2 262);
124
+ --chart-2: oklch(0.76 0.14 215);
125
+ --chart-3: oklch(0.68 0.2 295);
126
+ --chart-4: oklch(0.7 0.22 330);
127
+ --chart-5: oklch(0.82 0.18 125);
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);
131
148
  --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);
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 do not override it.
166
+ --warning-fill is the exception: amber (light 0.79 / dark 0.73, ~#f5b324 / ~#d99a1e) is
167
+ a light colour by nature, so it is ~2:1 on the light page (still >= 0.18 L away)
168
+ and ~7-8:1 on the dark one; dark text (--foreground in light, --background in dark) sits on it at >= 4.5:1.
169
+ Tones: positive (green), negative (red), warning (amber), info (blue),
170
+ neutral (grey). Colour never carries the meaning alone — pair it with an
171
+ arrow or sign. `npm run contrast` prints the measured ratios. */
138
172
  @theme inline {
139
173
  --color-background: var(--background);
140
174
  --color-foreground: var(--foreground);
@@ -155,6 +189,21 @@
155
189
  --color-border: var(--border);
156
190
  --color-input: var(--input);
157
191
  --color-ring: var(--ring);
192
+ --color-positive: var(--positive);
193
+ --color-positive-subtle: var(--positive-subtle);
194
+ --color-negative: var(--negative);
195
+ --color-negative-subtle: var(--negative-subtle);
196
+ --color-warning: var(--warning);
197
+ --color-warning-subtle: var(--warning-subtle);
198
+ --color-info: var(--info);
199
+ --color-info-subtle: var(--info-subtle);
200
+ --color-positive-fill: var(--positive-fill);
201
+ --color-negative-fill: var(--negative-fill);
202
+ --color-warning-fill: var(--warning-fill);
203
+ --color-info-fill: var(--info-fill);
204
+ --color-neutral-fill: var(--neutral-fill);
205
+ --color-neutral: var(--neutral);
206
+ --color-neutral-subtle: var(--neutral-subtle);
158
207
  --color-chart-1: var(--chart-1);
159
208
  --color-chart-2: var(--chart-2);
160
209
  --color-chart-3: var(--chart-3);
@@ -168,10 +217,7 @@
168
217
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
169
218
  --color-sidebar-border: var(--sidebar-border);
170
219
  --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);
220
+ --font-sans: var(--font-sans);
175
221
  --radius-sm: calc(var(--radius) - 4px);
176
222
  --radius-md: calc(var(--radius) - 2px);
177
223
  --radius-lg: var(--radius);
@@ -272,6 +318,100 @@
272
318
  }
273
319
  }
274
320
 
321
+ /* ------------------------------------------------------------ utilities */
322
+
323
+ @utility no-scrollbar {
324
+ -ms-overflow-style: none;
325
+ scrollbar-width: none;
326
+
327
+ &::-webkit-scrollbar {
328
+ display: none;
329
+ }
330
+ }
331
+
332
+ /* Icons that must point the other way when the document is right-to-left. */
333
+ .cn-rtl-flip {
334
+ &:where([dir="rtl"], [dir="rtl"] *) {
335
+ transform: scaleX(-1);
336
+ }
337
+ }
338
+
339
+ /* Page defaults live in `@layer base`, like shadcn's own init, so a project's
340
+ `html { @apply font-sans }`, its `next/font` setup and its own border rules
341
+ (all unlayered or later in the layer) win over them instead of losing to an
342
+ unlayered rule here. */
343
+ @layer base {
344
+ html {
345
+ font-family: var(--font-sans);
346
+ }
347
+
348
+ body {
349
+ background-color: var(--background);
350
+ color: var(--foreground);
351
+ -webkit-font-smoothing: antialiased;
352
+ }
353
+
354
+ * {
355
+ border-color: var(--border);
356
+ }
357
+ }
358
+
359
+ /**
360
+ * Vantage framework styles: the slide / document tokens and the document
361
+ * typesetting. The UI parts' tokens live in SquadKit
362
+ * (packages/squadkit/registry/theme/theme.css); scripts/gen-theme.mjs appends
363
+ * this file to them to produce packages/vantage/theme.css.
364
+ */
365
+
366
+ :root {
367
+ /* Slides (@squadbase/vantage/slide).
368
+ These are aliases, not values. Custom properties resolve lazily, so
369
+ pointing them at the tokens above is enough for a deck to follow `.dark`
370
+ and `[data-theme="dark"]` on its own — restating them in the dark block
371
+ below would create two places to keep in step for no gain. A deck
372
+ overrides any of them inline through `<SlideDeck theme>`. */
373
+ --slide-bg: var(--background);
374
+ --slide-fg: var(--foreground);
375
+ --slide-accent: var(--primary);
376
+ --slide-muted: var(--muted-foreground);
377
+ --slide-radius: var(--radius);
378
+ /* A system stack that includes Japanese. The pptx export rasterises through
379
+ an SVG `foreignObject`, where locally installed families resolve by name
380
+ but webfonts must be inlined — so a system default is what makes the
381
+ common path export correctly with nothing embedded. */
382
+ --slide-font-display:
383
+ -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo,
384
+ system-ui, sans-serif;
385
+ --slide-font-body: var(--slide-font-display);
386
+ /* Canvas pixels, on the 1920x1080 canvas — not rem: a slide is scaled as a
387
+ whole, so its type must not also follow the browser's root font size. */
388
+ --slide-size-hero: 168px;
389
+ --slide-size-body: 36px;
390
+
391
+ /* Documents (@squadbase/vantage/doc). Aliases, like --slide-*: they follow
392
+ `.dark` through the tokens they point at, so they are not restated in the
393
+ dark block. A document overrides any of them inline through
394
+ `<Document theme>`, an app through its styles.css. */
395
+ --doc-fg: var(--foreground);
396
+ --doc-muted: var(--muted-foreground);
397
+ --doc-accent: var(--primary);
398
+ --doc-border: var(--border);
399
+ --doc-subtle: var(--muted);
400
+ --doc-font-body: inherit;
401
+ --doc-font-heading: var(--doc-font-body);
402
+ --doc-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
403
+ --doc-size-body: 1rem;
404
+ --doc-line-height: 1.8;
405
+ --doc-max-width: 48rem;
406
+ }
407
+
408
+ @theme inline {
409
+ --color-slide-bg: var(--slide-bg);
410
+ --color-slide-fg: var(--slide-fg);
411
+ --color-slide-accent: var(--slide-accent);
412
+ --color-slide-muted: var(--slide-muted);
413
+ }
414
+
275
415
  /* ------------------------------------------------------------ documents */
276
416
 
277
417
  /* Typesetting for `<Document>`. Plain elements inside it need no classes.
@@ -440,38 +580,3 @@
440
580
  overflow: visible;
441
581
  }
442
582
  }
443
-
444
- /* ------------------------------------------------------------ utilities */
445
-
446
- @utility no-scrollbar {
447
- -ms-overflow-style: none;
448
- scrollbar-width: none;
449
-
450
- &::-webkit-scrollbar {
451
- display: none;
452
- }
453
- }
454
-
455
- /* Icons that must point the other way when the document is right-to-left. */
456
- .cn-rtl-flip {
457
- &:where([dir="rtl"], [dir="rtl"] *) {
458
- transform: scaleX(-1);
459
- }
460
- }
461
-
462
- body {
463
- background-color: var(--background);
464
- color: var(--foreground);
465
- /* Latin system faces carry no kana/kanji, so without Japanese families here the
466
- browser picks a per-locale fallback (lang="en" → e.g. thin "Yu Gothic" Regular
467
- on Windows, or a face without a 500 weight on macOS) and kana render thin.
468
- List the Japanese system faces explicitly, after the Latin ones. */
469
- font-family:
470
- ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo,
471
- sans-serif;
472
- -webkit-font-smoothing: antialiased;
473
- }
474
-
475
- * {
476
- border-color: var(--border);
477
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/states.tsx"],"names":[],"mappings":";;;;AAGO,SAAS,OAAA,CAAQ,EAAE,KAAA,GAAQ,eAAA,EAAY,WAAU,EAA2C;AACjG,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,iDAAiD,SAAS,CAAA,EAAG,IAAA,EAAK,QAAA,EAAS,WAAA,EAAU,QAAA,EACtG,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,uDAAA,EACb,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,WAAU,gFAAA,EAAiF,CAAA;AAAA,IAChG;AAAA,GAAA,EACH,CAAA,EACF,CAAA;AAEJ;AAEO,SAAS,KAAA,CAAM;AAAA,EACpB,KAAA,GAAQ,kBAAA;AAAA,EACR,WAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAMG;AACD,EAAA,4BACG,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,kEAAA,EAAoE,SAAS,CAAA,EAC7F,QAAA,EAAA;AAAA,IAAA,IAAA,mBAAO,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gCAAA,EAAkC,gBAAK,CAAA,GAAS,IAAA;AAAA,oBACvE,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,aAAA,EAAe,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,IACjC,8BAAc,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,wCAAA,EAA0C,uBAAY,CAAA,GAAO,IAAA;AAAA,IACxF,yBAAS,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,MAAA,EAAQ,kBAAO,CAAA,GAAS;AAAA,GAAA,EACnD,CAAA;AAEJ;AAEO,SAAS,UAAA,CAAW;AAAA,EACzB,KAAA,GAAQ,sBAAA;AAAA,EACR,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAKG;AACD,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,8DAAA,EAAgE,SAAS,CAAA;AAAA,MACvF,IAAA,EAAK,OAAA;AAAA,MAEL,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,gCAAA,EAAkC,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,QACpD,0BAAU,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oCAAA,EAAsC,mBAAQ,CAAA,GAAO,IAAA;AAAA,QAC5E,yBAAS,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,MAAA,EAAQ,kBAAO,CAAA,GAAS;AAAA;AAAA;AAAA,GACnD;AAEJ","file":"chunk-5ZOP4SQR.js","sourcesContent":["import type { ReactNode } from \"react\"\nimport { cn } from \"./cn\"\n\nexport function Loading({ label = \"Loading…\", className }: { label?: string; className?: string }) {\n return (\n <div className={cn(\"flex min-h-[30vh] items-center justify-center\", className)} role=\"status\" aria-live=\"polite\">\n <div className=\"flex items-center gap-3 text-sm text-muted-foreground\">\n <span className=\"h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent\" />\n {label}\n </div>\n </div>\n )\n}\n\nexport function Empty({\n title = \"Nothing here yet\",\n description,\n icon,\n action,\n className,\n}: {\n title?: string\n description?: string\n icon?: ReactNode\n action?: ReactNode\n className?: string\n}) {\n return (\n <div className={cn(\"flex flex-col items-center justify-center gap-2 p-10 text-center\", className)}>\n {icon ? <div className=\"text-3xl text-muted-foreground\">{icon}</div> : null}\n <p className=\"font-medium\">{title}</p>\n {description ? <p className=\"max-w-sm text-sm text-muted-foreground\">{description}</p> : null}\n {action ? <div className=\"mt-2\">{action}</div> : null}\n </div>\n )\n}\n\nexport function ErrorState({\n title = \"Something went wrong\",\n message,\n action,\n className,\n}: {\n title?: string\n message?: ReactNode\n action?: ReactNode\n className?: string\n}) {\n return (\n <div\n className={cn(\"rounded-xl border border-destructive/30 bg-destructive/5 p-6\", className)}\n role=\"alert\"\n >\n <p className=\"font-semibold text-destructive\">{title}</p>\n {message ? <p className=\"mt-1 text-sm text-muted-foreground\">{message}</p> : null}\n {action ? <div className=\"mt-3\">{action}</div> : null}\n </div>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ui/cn.ts"],"names":[],"mappings":";;;;;AAUO,SAAS,MAAM,MAAA,EAA8B;AAClD,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"chunk-A2UUGASH.js","sourcesContent":["/**\n * Class merger used by every component in the kit. `clsx` resolves conditional\n * class values, `tailwind-merge` drops the earlier of two conflicting Tailwind\n * utilities so a caller's `className` always wins over a component default.\n */\nimport { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport type { ClassValue }\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n"]}