@squadbase/vantage-template 0.2.0 → 0.2.1-dev1.18b684b
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/base-template/AGENTS.md +8 -4
- package/base-template/agents/page.md +5 -4
- package/base-template/bun.lock +10 -12
- package/base-template/package.json +2 -2
- package/base-template/src/index.tsx +53 -62
- package/package.json +2 -2
- package/ui-templates/CLAUDE.md +13 -12
- package/ui-templates/chart-grid/lib/mock-data.ts +0 -3
- package/ui-templates/chart-grid/lib/types.ts +6 -6
- package/ui-templates/chart-grid/pages/index.tsx +11 -161
- package/ui-templates/chart-grid-ja/lib/mock-data.ts +0 -3
- package/ui-templates/chart-grid-ja/lib/types.ts +6 -6
- package/ui-templates/chart-grid-ja/pages/index.tsx +11 -161
- package/ui-templates/funnel/lib/types.ts +2 -2
- package/ui-templates/funnel/pages/index.tsx +10 -88
- package/ui-templates/funnel-ja/lib/types.ts +2 -2
- package/ui-templates/funnel-ja/pages/index.tsx +10 -87
- package/ui-templates/kpi-chart-advanced/lib/mock-data.ts +6 -6
- package/ui-templates/kpi-chart-advanced/lib/types.ts +6 -7
- package/ui-templates/kpi-chart-advanced/pages/index.tsx +6 -117
- package/ui-templates/kpi-chart-advanced-ja/lib/mock-data.ts +6 -6
- package/ui-templates/kpi-chart-advanced-ja/lib/types.ts +6 -7
- package/ui-templates/kpi-chart-advanced-ja/pages/index.tsx +6 -117
- package/ui-templates/kpi-chart-simple/lib/types.ts +4 -4
- package/ui-templates/kpi-chart-simple/pages/index.tsx +4 -42
- package/ui-templates/kpi-chart-simple-ja/lib/types.ts +4 -4
- package/ui-templates/kpi-chart-simple-ja/pages/index.tsx +4 -40
- package/ui-templates/table-focus/lib/types.ts +3 -3
- package/ui-templates/table-focus/pages/index.tsx +3 -45
- package/ui-templates/table-focus-ja/lib/types.ts +3 -3
- package/ui-templates/table-focus-ja/pages/index.tsx +3 -45
package/base-template/AGENTS.md
CHANGED
|
@@ -96,7 +96,7 @@ root/
|
|
|
96
96
|
| `@squadbase/vantage/router` | `Link`・`Outlet`・`useParams`・`useSearch`・`useNavigate`・`redirect`・`notFound`・`useRoutes`・`useCurrentRoute`・`useSearchParam`・`useSearchState` |
|
|
97
97
|
| `@squadbase/vantage/query` | `useApiQuery`・`useApiMutation`・`apiJson`・`apiFetch`・`apiUrl`・`ApiError`、ほか `useQuery`/`useMutation` など TanStack Query の再エクスポート |
|
|
98
98
|
| `@squadbase/vantage/ui` | shadcn/ui(Base UI バリアント)プリミティブ(`Button`・`Loading`・`ErrorState`・`Empty` ほか) |
|
|
99
|
-
| `@squadbase/vantage/components` | 複合パーツ(`PageShell`・`DashboardCardPreset`・`DataTablePreset`、KPI の `KpiCard`・`Delta`、型付きチャート `LineChart`・`BarChart`・`AreaChart`・`DonutChart`・`BarList`
|
|
99
|
+
| `@squadbase/vantage/components` | 複合パーツ(`PageShell`・`DashboardCardPreset`・`DataTablePreset`、KPI の `KpiCard`・`Delta`、型付きチャート `LineChart`・`BarChart`・`AreaChart`・`ScatterChart`・`Heatmap`・`DonutChart`・`FunnelSteps`・`BarList` ほか、表せないときだけ `EChart`、書式の `formatValue`) |
|
|
100
100
|
| `@squadbase/vantage/table` | `FilePageView`・`TableViewer`(データファイルページの表ビューア) |
|
|
101
101
|
| `@squadbase/vantage/slide` | `SlideDeck`・`Slide`・`Steps`・`Step`・`MorphElement`・`useSlideNumber`・`useIsActiveSlide`、1 枚分の block `SlideCover`・`SlideExecSummary`・`SlideKpiHero`・`SlideKpiGrid`・`SlideChartInsight`・`SlideScorecardTable`・`SlideNextActions`・`SlideSection`・`SlideComparison`・`SlideChartFull`、手書きの 1 枚に使う部品 `SlideHeading`・`SlideSourceLine`・`SlideColumns`・`SlideColumn`・`DeltaText`(スライド専用。1920×1080 の固定キャンバス) |
|
|
102
102
|
| `@squadbase/vantage/doc` | `Document`、ドキュメント用の block `DocReportHeader`・`DocExecutiveSummary`・`DocKpiScorecard`・`DocFigure`・`DocDataTable`・`DocCallout`・`DocKeyFindings`・`DocActionItems`・`DocNotesAndSources`、部品 `DeltaText`(ドキュメント専用。中の素の HTML 要素に見出し・表などのスタイルが当たる) |
|
|
@@ -137,7 +137,7 @@ import { KpiCard, Delta } from "@squadbase/vantage/components";
|
|
|
137
137
|
まとめる)。増減の良否は指標の性質(コスト減・解約率減は良い)で決めて
|
|
138
138
|
positive / negative に分け(`KpiCard` / `Delta` の `betterWhen`。下がって良い指標は `betterWhen="down"`)、向きは ▲▼ や符号で表す。
|
|
139
139
|
- **レイアウト:** 内容はカードで包む(ページのチャートはタイトル付きの `DashboardCardPreset` に入れる。
|
|
140
|
-
|
|
140
|
+
チャートは親の幅に追従する)。順序は KPI → チャート → 表。値が 1 つなら KPI にする
|
|
141
141
|
(1 本の棒グラフにしない)。強調は 1 画面(スライドは 1 枚)に 1 か所。数値には単位と比較対象を添える。
|
|
142
142
|
- **Do:** トークンで色を指定する / 色の意味をアプリ全体でそろえる / チャートのタイトルに結論を書く。
|
|
143
143
|
- **Don't:** 色コードや素のパレットクラスを書く / `dark:` を並べる / 3D・装飾目的のグラデーション・
|
|
@@ -242,7 +242,7 @@ vantage add skill # 同梱 skill の一覧と、それぞれの配置
|
|
|
242
242
|
|
|
243
243
|
```bash
|
|
244
244
|
vantage add skill --all # 配置済みはスキップ(場所を報告するだけ)
|
|
245
|
-
vantage add skill --all --dir .
|
|
245
|
+
vantage add skill --all --dir .squadbase/skills # 置き場所を指定(既定は `.squadbase/` があれば `.squadbase/skills`、無ければ配置済みの Skill と同じ場所、それも無ければルート直下)
|
|
246
246
|
```
|
|
247
247
|
|
|
248
248
|
`add skill` はプロジェクト内を走査してから動くので、**再実行しても二重に配置されない**。
|
|
@@ -468,7 +468,7 @@ Squadbase のチャットは、回答の根拠になったグラフ・表・KPI
|
|
|
468
468
|
|
|
469
469
|
```tsx
|
|
470
470
|
<DashboardCardPreset data-sq-ref="revenue-trend" title="売上の推移">
|
|
471
|
-
<
|
|
471
|
+
<LineChart data={trend} index="month" categories={["revenue"]} format="currency" height={320} />
|
|
472
472
|
</DashboardCardPreset>
|
|
473
473
|
|
|
474
474
|
{kpis.map((kpi) => (
|
|
@@ -538,3 +538,7 @@ function KpiRow({ items }: { items: Kpi[] }) { /* … */ } // 子の部品は
|
|
|
538
538
|
- 日本語アプリで `"en"` のままだと、スライドの文節改行(`word-break: auto-phrase`)が効かず、見出しが単語の途中で折れる。
|
|
539
539
|
スライドのツールバー文言も `lang` で切り替わる(`"ja"` なら日本語、`en*` なら英語)。
|
|
540
540
|
- 値は消さない。指定が無いと `"en"` 扱いになる。
|
|
541
|
+
|
|
542
|
+
## 前の世代の語
|
|
543
|
+
|
|
544
|
+
`server-logic`(サーバーロジック)はこのプロジェクトに無い前の世代の語で、サーバー側は `server/api` の手書きエンドポイントと保存済み Query で成り立っており、作るときは `callSubagent` に `upsertQuery` を渡して委譲する。
|
|
@@ -224,7 +224,7 @@ refetchOnWindowFocus false・networkMode "always")。挙動を変えたいとき
|
|
|
224
224
|
`ErrorState`・`Empty`・`Select`・`Checkbox`・`RadioGroup`・`Field`・`Combobox`・`Pagination`・
|
|
225
225
|
`Avatar`・`Kbd`・`HoverCard`・`AlertDialog`・`Drawer`・`Toaster` + `toast.add()` ほか)。
|
|
226
226
|
- **複合パーツ**は `@squadbase/vantage/components` から(`PageShell`・`DashboardCardPreset`・
|
|
227
|
-
`DataTablePreset`・型付きチャート(下の「グラフ」)
|
|
227
|
+
`DataTablePreset`・型付きチャート(下の「グラフ」)ほか)。
|
|
228
228
|
- **どの名前が import 可能か / props の詳細は `vantage docs` で引く。** ガイドとコンポーネント
|
|
229
229
|
リファレンスはパッケージに同梱されていて、オフラインでも読める(→ `AGENTS.md` の
|
|
230
230
|
「ドキュメントを引く」)。**名前が分からないとき**はやりたいことで `vantage search` する
|
|
@@ -246,13 +246,14 @@ refetchOnWindowFocus false・networkMode "always")。挙動を変えたいとき
|
|
|
246
246
|
|
|
247
247
|
### グラフはまず型付きチャートで描く
|
|
248
248
|
|
|
249
|
-
- 推移は `LineChart` / `AreaChart`、比較は `BarChart
|
|
249
|
+
- 推移は `LineChart` / `AreaChart`、比較は `BarChart`、相関は `ScatterChart`、2 軸の濃淡は `Heatmap`、
|
|
250
|
+
構成比は `DonutChart`、段階ごとの減少は `FunnelSteps`。`data`(行の配列)・
|
|
250
251
|
`index`(x 軸の列)・`categories`(系列の列)を渡すだけで、option は書かない
|
|
251
252
|
(`DonutChart` は `category` / `value`)。
|
|
252
253
|
- 上位 N 件は `BarList`、判定帯や予算消化は `CategoryBar`、達成率は `ProgressCircle`、
|
|
253
254
|
日ごとの状態は `Tracker`。
|
|
254
|
-
- `EChart` + `
|
|
255
|
-
|
|
255
|
+
- `EChart` + option 関数は、レーダーなど型付きチャートで表せないときだけ使う。`EChart` で組んだ
|
|
256
|
+
グラフは、あとから種類もデータも編集で変えられない。
|
|
256
257
|
- 色は省略してテーマトークンに任せる。指定するなら `"chart-1"`〜`"chart-5"` か
|
|
257
258
|
`"var(--destructive)"` などの CSS 色。hex の直書きや Tailwind クラスは使わない。
|
|
258
259
|
- 数値の書式(`¥`・`%`・桁区切り)は `valueFormatter` に渡す。
|
package/base-template/bun.lock
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"name": "vibe-app",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@squadbase/react": "^0.1.0",
|
|
9
|
-
"@squadbase/vantage": "0.7.
|
|
10
|
-
"@squadbase/vantage-sdk": "0.1.2",
|
|
9
|
+
"@squadbase/vantage": "0.7.1-dev1.a7273eb",
|
|
10
|
+
"@squadbase/vantage-sdk": "0.1.2-dev1.d60f06d",
|
|
11
11
|
"date-fns": "^4.1.0",
|
|
12
12
|
"lucide-react": "^0.468.0",
|
|
13
13
|
"react": "^19.3.1",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
|
|
97
97
|
"@floating-ui/utils": ["@floating-ui/utils@0.2.12", "", {}, "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww=="],
|
|
98
98
|
|
|
99
|
-
"@hono/node-server": ["@hono/node-server@2.1.
|
|
99
|
+
"@hono/node-server": ["@hono/node-server@2.1.8", "", { "peerDependencies": { "hono": "^4 || ^5.0.0-0" } }, "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA=="],
|
|
100
100
|
|
|
101
101
|
"@iconify/types": ["@iconify/types@2.0.0", "", {}, "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="],
|
|
102
102
|
|
|
@@ -196,9 +196,9 @@
|
|
|
196
196
|
|
|
197
197
|
"@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=="],
|
|
198
198
|
|
|
199
|
-
"@squadbase/vantage": ["@squadbase/vantage@0.7.
|
|
199
|
+
"@squadbase/vantage": ["@squadbase/vantage@0.7.1-dev1.a7273eb", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hono/node-server": "^2.1.8", "@streamdown/code": "^1.1.1", "@tailwindcss/vite": "^4.3.3", "@tanstack/react-query": "^5.101.2", "@tanstack/react-router": "^1.170.17", "@tanstack/react-table": "^8.21.3", "@vitejs/plugin-react": "^6.1.2", "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.18", "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", "shiki": "3.23.0", "streamdown": "^2.5.0", "tailwind-merge": "3.6.0", "tailwindcss": "^4.3.3", "tw-animate-css": "^1.0.0", "vite": "^8.3.4" }, "peerDependencies": { "react": ">=18.2.0", "react-dom": ">=18.2.0", "typescript": ">=5.0.0" }, "optionalPeers": ["typescript"], "bin": { "vantage": "dist/cli.js" } }, "sha512-JiFunUVITA9/c2I1UyVfsPv6mVGnBSBS9UHaJmTSxo/YA/m4yx921L5zXAkvEEPu7ZAZeQ0fVoK1teE7T6oVLg=="],
|
|
200
200
|
|
|
201
|
-
"@squadbase/vantage-sdk": ["@squadbase/vantage-sdk@0.1.2", "", {}, "sha512-
|
|
201
|
+
"@squadbase/vantage-sdk": ["@squadbase/vantage-sdk@0.1.2-dev1.d60f06d", "", {}, "sha512-hgbelBLvPoqxCvxQuG/17u/i8BbAz9oNwoEhBMe1yE+uAxDpch6W6svmxOtqH2rm0zUOJZuKTFryOTdjhZDgUw=="],
|
|
202
202
|
|
|
203
203
|
"@streamdown/code": ["@streamdown/code@1.1.1", "", { "dependencies": { "shiki": "^3.19.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0" } }, "sha512-i7HTNuDgZWb+VdrNVOam9gQhIc5MSSDXKWXgbUrn/4vSRaSMM+Rtl10MQj4wLWPNpF7p80waJsAqFP8HZfb0Jg=="],
|
|
204
204
|
|
|
@@ -340,7 +340,7 @@
|
|
|
340
340
|
|
|
341
341
|
"@upsetjs/venn.js": ["@upsetjs/venn.js@2.0.0", "", { "optionalDependencies": { "d3-selection": "^3.0.0", "d3-transition": "^3.0.1" } }, "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw=="],
|
|
342
342
|
|
|
343
|
-
"@vitejs/plugin-react": ["@vitejs/plugin-react@6.1
|
|
343
|
+
"@vitejs/plugin-react": ["@vitejs/plugin-react@6.2.1", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1" }, "peerDependencies": { "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0 || ^0.3.0", "babel-plugin-react-compiler": "^1.0.0", "oxc-transform-react": ">=0.152.0 <0.157.0", "vite": "^8.0.0" }, "optionalPeers": ["@rolldown/plugin-babel", "babel-plugin-react-compiler", "oxc-transform-react"] }, "sha512-9KyWCij3r0+qLG3Q62vBmv0VyevmYibAtxaCIVK9o0k6CXgaajZRIe8tpfchQcdZArJ5b/7OrIz4W3b2uxVRDA=="],
|
|
344
344
|
|
|
345
345
|
"aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],
|
|
346
346
|
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
|
|
463
463
|
"devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="],
|
|
464
464
|
|
|
465
|
-
"dompurify": ["dompurify@3.4.
|
|
465
|
+
"dompurify": ["dompurify@3.4.17", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w=="],
|
|
466
466
|
|
|
467
467
|
"echarts": ["echarts@6.1.0", "", { "dependencies": { "tslib": "2.3.0", "zrender": "6.1.0" } }, "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA=="],
|
|
468
468
|
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
|
|
513
513
|
"hastscript": ["hastscript@9.0.1", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w=="],
|
|
514
514
|
|
|
515
|
-
"hono": ["hono@4.13.
|
|
515
|
+
"hono": ["hono@4.13.18", "", {}, "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA=="],
|
|
516
516
|
|
|
517
517
|
"html-to-image": ["html-to-image@1.11.13", "", {}, "sha512-cuOPoI7WApyhBElTTb9oqsawRvZ0rHhaHwghRLlTuffoD1B2aDemlCruLeZrUIIdvG7gs9xeELEPm6PhuASqrg=="],
|
|
518
518
|
|
|
@@ -756,13 +756,13 @@
|
|
|
756
756
|
|
|
757
757
|
"scheduler": ["scheduler@0.28.0", "", {}, "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw=="],
|
|
758
758
|
|
|
759
|
-
"seroval": ["seroval@1.
|
|
759
|
+
"seroval": ["seroval@1.6.11", "", {}, "sha512-hpb6XnMCGN/A+79Uf8V7/iTGkyyyazNn5X0CoCAp7Uy9vT3RT8jZ9GLcnxGoVjg3P8AArbe4ZVHq6C8oT2a0kA=="],
|
|
760
760
|
|
|
761
761
|
"seroval-plugins": ["seroval-plugins@1.5.6", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-HXuLAX2pu/UByPpaeo/TaMfvMIi+1QqIoPJYCcAtU8QkVNwgR6MPlGuCQTErV1JwraaMbYaWVIBX7mppzGLATQ=="],
|
|
762
762
|
|
|
763
763
|
"shiki": ["shiki@3.23.0", "", { "dependencies": { "@shikijs/core": "3.23.0", "@shikijs/engine-javascript": "3.23.0", "@shikijs/engine-oniguruma": "3.23.0", "@shikijs/langs": "3.23.0", "@shikijs/themes": "3.23.0", "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA=="],
|
|
764
764
|
|
|
765
|
-
"source-map-js": ["source-map-js@1.2.
|
|
765
|
+
"source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="],
|
|
766
766
|
|
|
767
767
|
"space-separated-tokens": ["space-separated-tokens@2.0.2", "", {}, "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q=="],
|
|
768
768
|
|
|
@@ -870,8 +870,6 @@
|
|
|
870
870
|
|
|
871
871
|
"parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="],
|
|
872
872
|
|
|
873
|
-
"postcss/source-map-js": ["source-map-js@1.2.2", "", {}, "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw=="],
|
|
874
|
-
|
|
875
873
|
"react-remove-scroll/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
|
876
874
|
|
|
877
875
|
"react-remove-scroll-bar/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@squadbase/react": "^0.1.0",
|
|
15
|
-
"@squadbase/vantage": "0.7.
|
|
16
|
-
"@squadbase/vantage-sdk": "0.1.2",
|
|
15
|
+
"@squadbase/vantage": "0.7.1-dev1.a7273eb",
|
|
16
|
+
"@squadbase/vantage-sdk": "0.1.2-dev1.d60f06d",
|
|
17
17
|
"date-fns": "^4.1.0",
|
|
18
18
|
"lucide-react": "^0.468.0",
|
|
19
19
|
"react": "^19.3.1",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { definePage } from "@squadbase/vantage"
|
|
2
2
|
import {
|
|
3
|
+
BarChart,
|
|
3
4
|
DashboardCardPreset,
|
|
4
|
-
|
|
5
|
+
DonutChart,
|
|
6
|
+
KpiCard,
|
|
5
7
|
PageShell,
|
|
6
8
|
PageShellContent,
|
|
7
9
|
PageShellDescription,
|
|
8
10
|
PageShellHeader,
|
|
9
11
|
PageShellHeading,
|
|
10
12
|
PageShellTitle,
|
|
11
|
-
|
|
12
|
-
Sparkline,
|
|
13
|
-
type EChartsOption,
|
|
13
|
+
SampleData,
|
|
14
14
|
} from "@squadbase/vantage/components"
|
|
15
15
|
|
|
16
16
|
export const page = definePage({
|
|
@@ -20,49 +20,32 @@ export const page = definePage({
|
|
|
20
20
|
placeholder: true,
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
+
// Sample KPIs. `KpiCard` derives the change (direction, rate, colour) from `value` and
|
|
24
|
+
// `comparison.previous`, and draws the sparkline from `history` (oldest first).
|
|
23
25
|
const METRICS = [
|
|
24
|
-
{ label: "Metric 1", value:
|
|
25
|
-
{ label: "Metric 2", value:
|
|
26
|
-
{ label: "Metric 3", value:
|
|
27
|
-
{ label: "Metric 4", value:
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
// Sample charts. `EChart` paints series with `--chart-1..5` and the sparklines
|
|
31
|
-
// use `--primary` (both from `styles.css`), so a theme change shows up here.
|
|
32
|
-
const BAR_OPTION: EChartsOption = {
|
|
33
|
-
legend: { top: 0 },
|
|
34
|
-
grid: { top: 36, right: 8, bottom: 24, left: 36 },
|
|
35
|
-
xAxis: { type: "category", data: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"] },
|
|
36
|
-
yAxis: { type: "value" },
|
|
37
|
-
series: [
|
|
38
|
-
{ name: "Series A", type: "bar", data: [12, 18, 15, 22, 26, 24] },
|
|
39
|
-
{ name: "Series B", type: "bar", data: [8, 11, 13, 12, 16, 19] },
|
|
40
|
-
{ name: "Series C", type: "bar", data: [5, 7, 6, 9, 8, 11] },
|
|
41
|
-
],
|
|
42
|
-
}
|
|
26
|
+
{ label: "Metric 1", value: 1234, previous: 1120, history: [3, 4, 3, 5, 6, 5, 7], format: "number" },
|
|
27
|
+
{ label: "Metric 2", value: 5678, previous: 5810, history: [6, 5, 6, 4, 5, 6, 6], format: "number" },
|
|
28
|
+
{ label: "Metric 3", value: 0.901, previous: 0.874, history: [2, 3, 5, 4, 6, 7, 8], format: "percent" },
|
|
29
|
+
{ label: "Metric 4", value: 12300, previous: 11200, history: [5, 6, 4, 6, 5, 7, 6], format: "currency" },
|
|
30
|
+
] as const
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{ name: "Category B", value: 25 },
|
|
55
|
-
{ name: "Category C", value: 18 },
|
|
56
|
-
{ name: "Category D", value: 12 },
|
|
57
|
-
{ name: "Category E", value: 10 },
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
}
|
|
32
|
+
// Sample charts. The typed charts paint series with `--chart-1..5` (from `styles.css`),
|
|
33
|
+
// so a theme change shows up here.
|
|
34
|
+
const MONTHLY = [
|
|
35
|
+
{ month: "Jan", "Series A": 12, "Series B": 8, "Series C": 5 },
|
|
36
|
+
{ month: "Feb", "Series A": 18, "Series B": 11, "Series C": 7 },
|
|
37
|
+
{ month: "Mar", "Series A": 15, "Series B": 13, "Series C": 6 },
|
|
38
|
+
{ month: "Apr", "Series A": 22, "Series B": 12, "Series C": 9 },
|
|
39
|
+
{ month: "May", "Series A": 26, "Series B": 16, "Series C": 8 },
|
|
40
|
+
{ month: "Jun", "Series A": 24, "Series B": 19, "Series C": 11 },
|
|
41
|
+
]
|
|
62
42
|
|
|
63
|
-
const
|
|
64
|
-
{
|
|
65
|
-
{
|
|
43
|
+
const CATEGORIES = [
|
|
44
|
+
{ category: "Category A", value: 35 },
|
|
45
|
+
{ category: "Category B", value: 25 },
|
|
46
|
+
{ category: "Category C", value: 18 },
|
|
47
|
+
{ category: "Category D", value: 12 },
|
|
48
|
+
{ category: "Category E", value: 10 },
|
|
66
49
|
]
|
|
67
50
|
|
|
68
51
|
export default function HomePage() {
|
|
@@ -82,27 +65,35 @@ export default function HomePage() {
|
|
|
82
65
|
</PageShellHeader>
|
|
83
66
|
|
|
84
67
|
<PageShellContent>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
<SampleData>
|
|
69
|
+
<section className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4">
|
|
70
|
+
{METRICS.map((metric) => (
|
|
71
|
+
<KpiCard
|
|
72
|
+
key={metric.label}
|
|
73
|
+
label={metric.label}
|
|
74
|
+
value={metric.value}
|
|
75
|
+
format={metric.format}
|
|
76
|
+
comparison={{ previous: metric.previous, vs: "prior-period" }}
|
|
77
|
+
history={metric.history}
|
|
94
78
|
/>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</section>
|
|
79
|
+
))}
|
|
80
|
+
</section>
|
|
98
81
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
<section className="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
|
83
|
+
<DashboardCardPreset title="Chart 1">
|
|
84
|
+
<BarChart
|
|
85
|
+
data={MONTHLY}
|
|
86
|
+
index="month"
|
|
87
|
+
categories={["Series A", "Series B", "Series C"]}
|
|
88
|
+
height={256}
|
|
89
|
+
ariaLabel="Chart 1"
|
|
90
|
+
/>
|
|
91
|
+
</DashboardCardPreset>
|
|
92
|
+
<DashboardCardPreset title="Chart 2">
|
|
93
|
+
<DonutChart data={CATEGORIES} index="category" categories={["value"]} height={256} ariaLabel="Chart 2" />
|
|
103
94
|
</DashboardCardPreset>
|
|
104
|
-
|
|
105
|
-
</
|
|
95
|
+
</section>
|
|
96
|
+
</SampleData>
|
|
106
97
|
</PageShellContent>
|
|
107
98
|
</PageShell>
|
|
108
99
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squadbase/vantage-template",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1-dev1.18b684b",
|
|
4
4
|
"description": "CLI tool for initializing and customizing Squadbase Vantage projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"squadbase",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@ai-sdk/openai": "2.0.122",
|
|
51
51
|
"ai": "^5.0.52"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "18b684bb60171f4b8f61c3a0aa6cf3e7a3553f23",
|
|
54
54
|
"scripts": {
|
|
55
55
|
"sync-base": "rsync -a --delete --exclude='node_modules' --exclude='dist' --exclude='.vantage' --exclude='*.tsbuildinfo' --exclude='*.log' template/ base-template/ && mv base-template/.gitignore base-template/_gitignore",
|
|
56
56
|
"build": "pnpm run sync-base && tsup",
|
package/ui-templates/CLAUDE.md
CHANGED
|
@@ -40,22 +40,23 @@ src/components/<slug>/
|
|
|
40
40
|
|
|
41
41
|
**`components/` を使う理由(重要)**: Vantage は**ファイルベースルーティング**で、`.tsx` ファイルは原則すべてページ扱いになる。`components/` / `hooks/` / `lib/` / `server/` / `public/` だけがルート走査から除外される(`NON_ROUTE_DIRS`)ため、`src/templates/<slug>/` のようなディレクトリに `.tsx` を置くと **`/templates/<slug>/...` という意図しないルートが生え、`vantage check` が `MISSING_DEFAULT_EXPORT` で落ちる**(`SUSPICIOUS_ROUTE_DIR` 警告も出る)。データファイル(`.ts`)も同じディレクトリに置いてコロケーションを保つ。
|
|
42
42
|
|
|
43
|
-
### 2.
|
|
43
|
+
### 2. チャートは型付き部品で書く — EChart + option 関数は作らない
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
**折れ線 / 面 / 棒 / 散布図 / ヒートマップ / ドーナツ / ファネルは、カタログ部品(`LineChart` / `AreaChart` / `BarChart` / `ScatterChart` / `Heatmap` / `DonutChart` / `FunnelSteps`)に行配列とキー名を渡して書く。** 行配列は識別子(`mock-data.ts` の配列、または `index.tsx` 内で一度だけ作る `const xxxRows`)で渡す。JSX の prop に `.map(...)` や option 関数の呼び出しを書かない(Bluetree がチャートを部品として読めなくなる)。
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
<AreaChart
|
|
49
|
+
data={timeSeries}
|
|
50
|
+
index="date"
|
|
51
|
+
categories={["series1", "series2"]}
|
|
52
|
+
labels={{ series1: "Series A", series2: "Series B" }}
|
|
53
|
+
height="280px"
|
|
54
|
+
/>
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
- データ型は `interface` ではなく `type` で宣言する(部品の `data` は `Record<string, unknown>[]` を要求し、`interface` は代入できない)。
|
|
58
|
+
- 部品が表せない表現(第2軸の折れ線の重ね描き、`visualMap` など)のために `EChart` + option 関数へ戻さない。**カタログに部品が無いチャート(現状はレーダーだけ)に限り**、`index.tsx` 内のオプションビルダ関数 + `<EChart option={...} />` で書く。
|
|
59
|
+
- 色は書かない。部品も `EChart` も `--chart-1..5` に追従するので、`option.color` / `itemStyle.color` / ラベルの `color` / `theme` プロップは使わない。意味色(成功=緑・失敗=赤)が要る series だけ例外。
|
|
59
60
|
|
|
60
61
|
### 3. データ層(mock-data / types)は分離する
|
|
61
62
|
|
|
@@ -97,7 +98,7 @@ server/api/<endpoint>.ts # ★ サンプルデータ + GET ハ
|
|
|
97
98
|
| `PageShell*` / `DashboardCard*` / `EChart` / `EChartsOption` / `DataTable*` / `ColumnDef` / `DateRangePicker` / `FilterBar*` / `FunnelSteps` / `MetricValue` / `TrendIndicator` / `StatusBadge` / `SegmentedControl` / `MultiSelect` / `SearchableSelect` / `SectionHeader` / `AppShell` / `Placeholder` / `Sparkline` | `@squadbase/vantage/components` |
|
|
98
99
|
| `Button` / `Input` / `Badge` / `Tabs*` / `ToggleGroup*` / `Table*` / `Select*` / `Dialog*` / `cn` ほか shadcn プリミティブ | `@squadbase/vantage/ui` |
|
|
99
100
|
|
|
100
|
-
型付きチャート(`LineChart` / `AreaChart` / `BarChart` / `DonutChart` / `BarList` / `CategoryBar` / `ProgressCircle` / `Tracker`、`@squadbase/vantage/components`)
|
|
101
|
+
型付きチャート(`LineChart` / `AreaChart` / `BarChart` / `ScatterChart` / `Heatmap` / `DonutChart` / `FunnelSteps` / `BarList` / `CategoryBar` / `ProgressCircle` / `Tracker`、`@squadbase/vantage/components`)は 0.6.3 以降の部品。雛形の依存は `^0.7.0` なので使ってよい。`Avatar` / `Pagination` / `RadioGroup` / `AlertDialog` / `Drawer` / `Toaster` / `Field` / `Combobox` / `HoverCard` / `Kbd`(`@squadbase/vantage/ui`)も同じ。
|
|
101
102
|
| `definePage` | `@squadbase/vantage` |
|
|
102
103
|
| `Link` / `Outlet` / `useParams` / `useSearch` / `useNavigate` / `useRoutes` / `useCurrentRoute` / `useSearchParam` / `useSearchState` | `@squadbase/vantage/router` |
|
|
103
104
|
| `useApiQuery` / `useApiMutation` / `useQuery` / `useMutation` / `apiFetch` | `@squadbase/vantage/query` |
|
|
@@ -90,9 +90,6 @@ export const radarAxes: RadarPoint[] = [
|
|
|
90
90
|
{ current: 79, benchmark: 70 },
|
|
91
91
|
]
|
|
92
92
|
|
|
93
|
-
export const HEATMAP_X_AXIS = ["0", "1", "2", "3", "4", "5"]
|
|
94
|
-
export const HEATMAP_Y_AXIS = ["Row 1", "Row 2", "Row 3", "Row 4", "Row 5", "Row 6", "Row 7"]
|
|
95
|
-
|
|
96
93
|
export const heatmapCells: HeatmapCell[] = [
|
|
97
94
|
{ x: "0", y: "Row 1", value: 57 },
|
|
98
95
|
{ x: "1", y: "Row 1", value: 25 },
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type TimePoint = {
|
|
2
2
|
date: string
|
|
3
3
|
series1: number
|
|
4
4
|
series2: number
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export type BarPoint = {
|
|
8
8
|
value: number
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export
|
|
11
|
+
export type ScatterPoint = {
|
|
12
12
|
x: number
|
|
13
13
|
y: number
|
|
14
14
|
size: number
|
|
15
15
|
label: string
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export
|
|
18
|
+
export type RadarPoint = {
|
|
19
19
|
current: number
|
|
20
20
|
benchmark: number
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export
|
|
23
|
+
export type HeatmapCell = {
|
|
24
24
|
x: string
|
|
25
25
|
y: string
|
|
26
26
|
value: number
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export
|
|
29
|
+
export type DashboardFilters = {
|
|
30
30
|
dateRange: { from: Date | undefined; to: Date | undefined }
|
|
31
31
|
}
|