@squadbase/vantage-template 0.1.0-dev.0faf4cb → 0.1.0-dev.3f759a0

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/README.md CHANGED
@@ -14,7 +14,7 @@ npx @squadbase/vantage-template <command> [options]
14
14
 
15
15
  #### `init`
16
16
 
17
- Initialize a new Vantage project in the current directory. Copies the base template — `src/index.tsx`, `src/_layout.tsx`, `src/_404.tsx`, `src/_error.tsx`, `src/styles.css`, `server/api/`, `tsconfig.json`, `squadbase.yml`, a neutral `DESIGN.md` (the design intent, by token name — user-owned; the `vantage-design` skill keeps it in step with `src/styles.css`), plus the agent guidance in `AGENTS.md` (and `agents/`, when the framework ships per-type knowledge files) and `.squadbase/skills/` — and installs dependencies.
17
+ Initialize a new Vantage project in the current directory. Copies the base template — `src/index.tsx`, `src/_layout.tsx`, `src/_404.tsx`, `src/_error.tsx`, `src/styles.css`, `server/api/`, `tsconfig.json`, `squadbase.yml`, a starter `DESIGN.md` (the design intent, by token name — user-owned; the `vantage-design` skill keeps it in step with `src/styles.css`), plus the agent guidance in `AGENTS.md` (and `agents/`, when the framework ships per-type knowledge files) and `.squadbase/skills/` — and installs dependencies.
18
18
 
19
19
  ```bash
20
20
  npx @squadbase/vantage-template init
@@ -106,10 +106,12 @@ node <このスキルの場所>/scripts/contrast.mjs '<文字色>' '<背景色>'
106
106
  見出しだけに使う色は 3:1 以上。`var(--color-*)` で書いた値は Tailwind の `oklch()` 値に直してから渡す。
107
107
  落ちたら明度を調整して、提案に戻らずに直してよい(直したことは報告する)。
108
108
 
109
- ### 5. プレビューを見せる
109
+ ### 5. プレビューを見せる(省略しない)
110
110
 
111
- - 使い捨てページ `src/design-preview.tsx`(`src/` が無ければルート直下)を作る: KPI カード 3〜4 枚、
112
- `EChart` の棒または折れ線 1 つ(5 系列)、主要ボタン・破壊的ボタン、補足の文字。すべてトークンで書く。
111
+ - **必ず**使い捨てページ `src/design-preview.tsx`(`src/` が無ければルート直下)を作る: KPI カード
112
+ 3〜4 枚、`EChart` の棒または折れ線 1 つ(5 系列)、主要ボタン・破壊的ボタン、補足の文字。すべて
113
+ トークンで書く。既存ページやホームで代用しない ― ホームなどの画面はチャートやボタンを持たないことが
114
+ 多く、変更後の色が見えない。
113
115
  - スライドがあるなら既存のデッキの URL を案内する(プレビュー用のデッキは作らない)。
114
116
  - **ユーザーが承認したら `src/design-preview.tsx` を削除する。** 残すとナビに出る。
115
117
 
@@ -121,6 +123,14 @@ npx vantage check
121
123
 
122
124
  `HARDCODED_COLOR`(ページ内の色コード)や `DESIGN_MD_TOO_LONG` が出たらその場で直す。
123
125
 
126
+ ### 7. 完了を報告する
127
+
128
+ 報告には、更新したファイル(`DESIGN.md` / `styles.css`)に加えて次を**必ず**入れる。
129
+
130
+ - プレビューページのパスと URL(`src/design-preview.tsx` → `/design-preview`)。
131
+ - 「ホームなど既存の画面は一部の色しか使っていないので、変更が見えないことがある。配色はプレビュー
132
+ ページで確認してほしい」という一言。
133
+
124
134
  ## 会話中の指示との関係
125
135
 
126
136
  - 会話中の個別の指示(「このグラフだけ赤で」)は `DESIGN.md` より優先する。そのページだけ直せばよい。
@@ -1,38 +1,53 @@
1
1
  # 初期デザインのプリセット
2
2
 
3
3
  プロジェクト作成時に選ぶ 4 つの出発点。**id(`default` / `calm` / `vivid` / `mono`)はプロジェクト
4
- 作成のワークフローが参照するので変えないこと。** どれも「チャートのプリセット 1 つ + 必要なら
5
- `--primary` の上書き + `DESIGN.md` の差分」でできている。
4
+ 作成のワークフローが参照するので変えないこと。** どれも「チャートのプリセット 1 つ + `--primary` +
5
+ `DESIGN.md` の差分」でできている。**`--primary` はどのプリセットでも必ず書く**(無彩色のプリセットも
6
+ 値を明示する)。チャートだけ変えるとホームのような色の少ない画面では見た目が変わらず、別のプリセットから
7
+ 切り替えたときに前の `--primary` が残るため。
6
8
 
7
9
  適用の手順は共通:
8
10
 
9
11
  1. `npx @squadbase/vantage-template chart <チャートのプリセット>` で `styles.css` のマーカーブロックを
10
12
  差し替える。**マーカーブロックの中(`--chart-1..5`)は手で編集しない** ― コマンドの生成物で、
11
13
  次の適用で消える。
12
- 2. `--primary` の上書きがあるプリセットは、`styles.css` のマーカーの**外**(先頭の `:root` ブロック)に
13
- `:root` と `.dark, [data-theme="dark"]` の両方を書く。
14
+ 2. 各プリセットの `--primary` / `--primary-foreground` を、`styles.css` のマーカーの**外**(先頭の
15
+ `:root` ブロック)に `:root` と `.dark, [data-theme="dark"]` の両方で書く。既にある `--primary` は置き換える。
14
16
  3. `DESIGN.md` を `format.md` の雛形から作り、下の「DESIGN.md の差分」の行だけを書き換える。
15
17
  4. `scripts/contrast.mjs` で `--primary-foreground` / `--primary` をライトとダークで確かめる。
16
18
 
17
19
  | id | トーン | チャートのプリセット | `--primary` |
18
20
  | --- | --- | --- | --- |
19
- | `default` | 中立・無彩色のベース。データだけが色を持つ | `blue` | 上書きしない(既定の無彩色) |
20
- | `calm` | 落ち着いた寒色。報告書・経営向け | `ocean` | 任意で深い青 |
21
- | `vivid` | 明るい暖色。営業・マーケティング向け | `sunset` | 濃いオレンジ |
22
- | `mono` | モノクロ。印刷・資料への貼り付け向け | `mono` | 上書きしない |
21
+ | `default` | 無彩色のベース。色を持つのはデータ(`blue` チャート)だけ | `blue` | 無彩色(`theme.css` の既定値を明示) |
22
+ | `calm` | 落ち着いた寒色。報告書・経営向け | `ocean` | 深い青(スカイ 700 / 300) |
23
+ | `vivid` | 明るい暖色。営業・マーケティング向け | `sunset` | 濃いオレンジ(オレンジ 700 / 400) |
24
+ | `mono` | モノクロ。印刷・資料への貼り付け向け | `mono` | ジンク 900 / 200 |
23
25
 
24
26
  ## `default`
25
27
 
26
28
  - トーン: 落ち着いた無彩色のベースに、データだけが色を持つ業務ダッシュボード。装飾より読みやすさ。
27
29
  - チャート: `blue`(青 → ティール → フクシア → バイオレット → グレー)。
28
- - `styles.css`: チャートのブロックだけ。`--primary` は触らない。
30
+ - `--primary`(フレームワークの既定と同じ無彩色。他のプリセットから戻すときのために明示する):
31
+
32
+ ```css
33
+ :root {
34
+ --primary: oklch(0.205 0 0);
35
+ --primary-foreground: oklch(0.985 0 0);
36
+ }
37
+ .dark,
38
+ [data-theme="dark"] {
39
+ --primary: oklch(0.922 0 0);
40
+ --primary-foreground: oklch(0.205 0 0);
41
+ }
42
+ ```
43
+
29
44
  - `DESIGN.md`: 雛形そのまま(`format.md` の雛形は `default` を説明している)。
30
45
 
31
46
  ## `calm`
32
47
 
33
48
  - トーン: 寒色でまとめた静かな画面。強調は控えめにし、数字と罫線で読ませる。
34
49
  - チャート: `ocean`(スカイ → シアン → インディゴ → ティール → スレート)。
35
- - `--primary`(任意。ボタンにも色を持たせたいときだけ):
50
+ - `--primary`(チャートのスカイに揃えた深い青):
36
51
 
37
52
  ```css
38
53
  :root {
@@ -76,7 +91,20 @@
76
91
 
77
92
  - トーン: 白黒と灰色だけ。色で意味を運ばず、太さ・順番・ラベルで読ませる。
78
93
  - チャート: `mono`(ジンク 900 → 200。ダークでは反転)。
79
- - `styles.css`: チャートのブロックだけ。`--primary` は触らない(既定が無彩色)。
94
+ - `--primary`(チャートの両端と同じジンク):
95
+
96
+ ```css
97
+ :root {
98
+ --primary: var(--color-zinc-900);
99
+ --primary-foreground: oklch(0.985 0 0);
100
+ }
101
+ .dark,
102
+ [data-theme="dark"] {
103
+ --primary: var(--color-zinc-200);
104
+ --primary-foreground: oklch(0.205 0 0);
105
+ }
106
+ ```
107
+
80
108
  - `DESIGN.md` の差分: トーンを上の文に。強調 = `--chart-1`(最も濃い灰)。良い = 専用色なし(▲ と
81
109
  符号)、悪い = `--destructive`(**画面で唯一の有彩色**として使う)。チャートは系列を 3 つまでにし、
82
110
  それ以上は直接ラベルを付ける。禁止: 隣り合う `--chart-4` と `--chart-5`(明度差が小さい)。
@@ -6,7 +6,7 @@
6
6
  "name": "vibe-app",
7
7
  "dependencies": {
8
8
  "@squadbase/react": "^0.1.0",
9
- "@squadbase/vantage": "0.6.1-dev.90c1a41",
9
+ "@squadbase/vantage": "0.6.1-dev.2d25e94",
10
10
  "@squadbase/vantage-sdk": "^0.1.0",
11
11
  "date-fns": "^4.1.0",
12
12
  "lucide-react": "^0.468.0",
@@ -204,7 +204,7 @@
204
204
 
205
205
  "@squadbase/react": ["@squadbase/react@0.1.0", "", { "dependencies": { "zod": "^4.3.6" }, "peerDependencies": { "@types/react": "17.x || 18.x || 19.x", "react": "17.x || 18.x || 19.x" }, "optionalPeers": ["@types/react"] }, "sha512-k+Dpyj7eH+Yjydw54iEluCjYDae086d12hWgBjNMpw4wLbQGz3CrJ6Yipodg8n1cKUt7zvwddlcTHd79bgKsXg=="],
206
206
 
207
- "@squadbase/vantage": ["@squadbase/vantage@0.6.1-dev.90c1a41", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hono/node-server": "^2.0.8", "@streamdown/code": "^1.1.1", "@tailwindcss/vite": "^4.3.2", "@tanstack/react-query": "^5.101.2", "@tanstack/react-router": "^1.170.17", "@tanstack/react-table": "^8.21.3", "@vitejs/plugin-react": "^6.0.3", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", "date-fns": "^4.1.0", "echarts": "^6.0.0", "esbuild": "^0.28.1", "fflate": "^0.8.3", "hono": "^4.13.5", "html-to-image": "^1.11.13", "lucide-react": "^0.468.0", "papaparse": "^5.7.0", "picocolors": "^1.1.1", "react-day-picker": "^10.0.1", "read-excel-file": "^9.3.10", "streamdown": "^2.5.0", "tailwind-merge": "^3.0.0", "tailwindcss": "^4.3.2", "tw-animate-css": "^1.0.0", "vite": "^8.1.4" }, "peerDependencies": { "react": ">=18.2.0", "react-dom": ">=18.2.0" }, "bin": { "vantage": "dist/cli.js" } }, "sha512-+LhC/YVfImlaC/zEUMt3cbLrljjtu5exRkPhgev9SHarnHeYzHdUmLAYaPJR4k0qMq4vWtrmXFRCya66aWrkpQ=="],
207
+ "@squadbase/vantage": ["@squadbase/vantage@0.6.1-dev.2d25e94", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hono/node-server": "^2.0.8", "@streamdown/code": "^1.1.1", "@tailwindcss/vite": "^4.3.2", "@tanstack/react-query": "^5.101.2", "@tanstack/react-router": "^1.170.17", "@tanstack/react-table": "^8.21.3", "@vitejs/plugin-react": "^6.0.3", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", "date-fns": "^4.1.0", "echarts": "^6.0.0", "esbuild": "^0.28.1", "fflate": "^0.8.3", "hono": "^4.13.5", "html-to-image": "^1.11.13", "lucide-react": "^0.468.0", "papaparse": "^5.7.0", "picocolors": "^1.1.1", "react-day-picker": "^10.0.1", "read-excel-file": "^9.3.10", "streamdown": "^2.5.0", "tailwind-merge": "^3.0.0", "tailwindcss": "^4.3.2", "tw-animate-css": "^1.0.0", "vite": "^8.1.4" }, "peerDependencies": { "react": ">=18.2.0", "react-dom": ">=18.2.0" }, "bin": { "vantage": "dist/cli.js" } }, "sha512-ZiccfVywXZ8G3Rbbfzm5tDrzWlc5T4Yahd4uYKBDCFMP1ygT1Pspew01k+6L5kzsYCQKGPOBx2IFFhqvA7aBXQ=="],
208
208
 
209
209
  "@squadbase/vantage-sdk": ["@squadbase/vantage-sdk@0.1.0", "", {}, "sha512-5dknrb6wkFIHeHWf6SsOL0gtcTxr5+WZWgBxGSj3UlEBt2l4JKNZJ7T7DsXE1vUq9WxfLryrfBkEf3sEHGO9yQ=="],
210
210
 
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@squadbase/react": "^0.1.0",
15
- "@squadbase/vantage": "0.6.1-dev.90c1a41",
15
+ "@squadbase/vantage": "0.6.1-dev.2d25e94",
16
16
  "@squadbase/vantage-sdk": "^0.1.0",
17
17
  "date-fns": "^4.1.0",
18
18
  "lucide-react": "^0.468.0",
@@ -1,6 +1,7 @@
1
1
  import { definePage } from "@squadbase/vantage"
2
2
  import {
3
3
  DashboardCardPreset,
4
+ EChart,
4
5
  PageShell,
5
6
  PageShellContent,
6
7
  PageShellDescription,
@@ -8,6 +9,8 @@ import {
8
9
  PageShellHeading,
9
10
  PageShellTitle,
10
11
  Placeholder,
12
+ Sparkline,
13
+ type EChartsOption,
11
14
  } from "@squadbase/vantage/components"
12
15
 
13
16
  export const page = definePage({
@@ -17,13 +20,49 @@ export const page = definePage({
17
20
  })
18
21
 
19
22
  const METRICS = [
20
- { label: "Metric 1", value: "1,234" },
21
- { label: "Metric 2", value: "5,678" },
22
- { label: "Metric 3", value: "90.1%" },
23
- { label: "Metric 4", value: "$12.3k" },
23
+ { label: "Metric 1", value: "1,234", trend: [3, 4, 3, 5, 6, 5, 7] },
24
+ { label: "Metric 2", value: "5,678", trend: [6, 5, 6, 4, 5, 6, 6] },
25
+ { label: "Metric 3", value: "90.1%", trend: [2, 3, 5, 4, 6, 7, 8] },
26
+ { label: "Metric 4", value: "$12.3k", trend: [5, 6, 4, 6, 5, 7, 6] },
24
27
  ]
25
28
 
26
- const CHARTS = ["Chart 1", "Chart 2"]
29
+ // Sample charts. `EChart` paints series with `--chart-1..5` and the sparklines
30
+ // use `--primary` (both from `styles.css`), so a theme change shows up here.
31
+ const BAR_OPTION: EChartsOption = {
32
+ legend: { top: 0 },
33
+ grid: { top: 36, right: 8, bottom: 24, left: 36 },
34
+ xAxis: { type: "category", data: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] },
35
+ yAxis: { type: "value" },
36
+ series: [
37
+ { name: "Series A", type: "bar", data: [12, 18, 15, 22, 26, 24] },
38
+ { name: "Series B", type: "bar", data: [8, 11, 13, 12, 16, 19] },
39
+ { name: "Series C", type: "bar", data: [5, 7, 6, 9, 8, 11] },
40
+ ],
41
+ }
42
+
43
+ const PIE_OPTION: EChartsOption = {
44
+ legend: { bottom: 0 },
45
+ series: [
46
+ {
47
+ type: "pie",
48
+ radius: ["45%", "70%"],
49
+ center: ["50%", "45%"],
50
+ label: { show: false },
51
+ data: [
52
+ { name: "Category A", value: 35 },
53
+ { name: "Category B", value: 25 },
54
+ { name: "Category C", value: 18 },
55
+ { name: "Category D", value: 12 },
56
+ { name: "Category E", value: 10 },
57
+ ],
58
+ },
59
+ ],
60
+ }
61
+
62
+ const CHARTS = [
63
+ { title: "Chart 1", option: BAR_OPTION },
64
+ { title: "Chart 2", option: PIE_OPTION },
65
+ ]
27
66
 
28
67
  export default function HomePage() {
29
68
  return (
@@ -42,14 +81,20 @@ export default function HomePage() {
42
81
  {METRICS.map((metric) => (
43
82
  <DashboardCardPreset key={metric.label} title={metric.label}>
44
83
  <Placeholder className="text-2xl font-bold">{metric.value}</Placeholder>
84
+ <Sparkline
85
+ className="mt-2"
86
+ data={metric.trend.map((value) => ({ value }))}
87
+ color="text-primary"
88
+ area
89
+ />
45
90
  </DashboardCardPreset>
46
91
  ))}
47
92
  </section>
48
93
 
49
94
  <section className="grid grid-cols-1 gap-4 lg:grid-cols-2">
50
- {CHARTS.map((title) => (
51
- <DashboardCardPreset key={title} title={title}>
52
- <Placeholder className="h-64 w-full" />
95
+ {CHARTS.map((chart) => (
96
+ <DashboardCardPreset key={chart.title} title={chart.title}>
97
+ <EChart option={chart.option} height={256} ariaLabel={chart.title} />
53
98
  </DashboardCardPreset>
54
99
  ))}
55
100
  </section>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squadbase/vantage-template",
3
- "version": "0.1.0-dev.0faf4cb",
3
+ "version": "0.1.0-dev.3f759a0",
4
4
  "description": "CLI tool for initializing and customizing Squadbase Vantage projects.",
5
5
  "keywords": [
6
6
  "squadbase",