@squadbase/vantage-template 0.2.1-dev1.6b08f17 → 0.2.1-dev1.84db6d5

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.
@@ -468,7 +468,7 @@ Squadbase のチャットは、回答の根拠になったグラフ・表・KPI
468
468
 
469
469
  ```tsx
470
470
  <DashboardCardPreset data-sq-ref="revenue-trend" title="売上の推移">
471
- <EChart option={trendOption(data)} height="320px" />
471
+ <LineChart data={trend} index="month" categories={["revenue"]} format="currency" height={320} />
472
472
  </DashboardCardPreset>
473
473
 
474
474
  {kpis.map((kpi) => (
@@ -6,8 +6,8 @@
6
6
  "name": "vibe-app",
7
7
  "dependencies": {
8
8
  "@squadbase/react": "^0.1.0",
9
- "@squadbase/vantage": "0.7.1-dev1.e38d696",
10
- "@squadbase/vantage-sdk": "0.1.2-dev1.46b0293",
9
+ "@squadbase/vantage": "0.7.1-dev1.9d23147",
10
+ "@squadbase/vantage-sdk": "0.1.2-dev1.5721c18",
11
11
  "date-fns": "^4.1.0",
12
12
  "lucide-react": "^0.468.0",
13
13
  "react": "^19.3.1",
@@ -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.1-dev1.e38d696", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hono/node-server": "^2.1.5", "@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.13", "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-9lDSKA0U5hBUoz1VgSkwdX6fOTO4ecNp4007IC04dNmo9yZPx/flpYTzA4Ds06DTHG59IhPCmrUbT6bxMz3D7g=="],
199
+ "@squadbase/vantage": ["@squadbase/vantage@0.7.1-dev1.9d23147", "", { "dependencies": { "@base-ui/react": "^1.6.0", "@hono/node-server": "^2.1.5", "@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.13", "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-su7WvRoYNobuDo1glTC6Ib1QuRD+yOICZf5iMMMk0Vq5A5f7Sppg89M6np+2lXuR/zYdVYIGq5rLcUZtlig/yw=="],
200
200
 
201
- "@squadbase/vantage-sdk": ["@squadbase/vantage-sdk@0.1.2-dev1.46b0293", "", {}, "sha512-V0NgcP4Yo3bAjsv3UXoQiNddmqRzdEi+X+1cXlkzkGUSnCKN240RqL6T9FLJKl8E2iAJYTsI/uqkR4wyf30+bQ=="],
201
+ "@squadbase/vantage-sdk": ["@squadbase/vantage-sdk@0.1.2-dev1.5721c18", "", {}, "sha512-aNiJa+k25VwShTvy+B4wd6mh872nvH/P8Q5XT+J0w3qaDyjbI060AQUydTfhpUJqjoHpoPhIovFKpk23HtTgOw=="],
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
 
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@squadbase/react": "^0.1.0",
15
- "@squadbase/vantage": "0.7.1-dev1.e38d696",
16
- "@squadbase/vantage-sdk": "0.1.2-dev1.46b0293",
15
+ "@squadbase/vantage": "0.7.1-dev1.9d23147",
16
+ "@squadbase/vantage-sdk": "0.1.2-dev1.5721c18",
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
- EChart,
5
+ DonutChart,
6
+ KpiCard,
5
7
  PageShell,
6
8
  PageShellContent,
7
9
  PageShellDescription,
8
10
  PageShellHeader,
9
11
  PageShellHeading,
10
12
  PageShellTitle,
11
- Placeholder,
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: "1,234", trend: [3, 4, 3, 5, 6, 5, 7] },
25
- { label: "Metric 2", value: "5,678", trend: [6, 5, 6, 4, 5, 6, 6] },
26
- { label: "Metric 3", value: "90.1%", trend: [2, 3, 5, 4, 6, 7, 8] },
27
- { label: "Metric 4", value: "$12.3k", trend: [5, 6, 4, 6, 5, 7, 6] },
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
- const PIE_OPTION: EChartsOption = {
45
- legend: { bottom: 0 },
46
- series: [
47
- {
48
- type: "pie",
49
- radius: ["45%", "70%"],
50
- center: ["50%", "45%"],
51
- label: { show: false },
52
- data: [
53
- { name: "Category A", value: 35 },
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 CHARTS = [
64
- { title: "Chart 1", option: BAR_OPTION },
65
- { title: "Chart 2", option: PIE_OPTION },
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
- <section className="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4">
86
- {METRICS.map((metric) => (
87
- <DashboardCardPreset key={metric.label} title={metric.label}>
88
- <Placeholder className="text-2xl font-bold">{metric.value}</Placeholder>
89
- <Sparkline
90
- className="mt-2"
91
- data={metric.trend.map((value) => ({ value }))}
92
- color="text-primary"
93
- area
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
- </DashboardCardPreset>
96
- ))}
97
- </section>
79
+ ))}
80
+ </section>
98
81
 
99
- <section className="grid grid-cols-1 gap-4 lg:grid-cols-2">
100
- {CHARTS.map((chart) => (
101
- <DashboardCardPreset key={chart.title} title={chart.title}>
102
- <EChart option={chart.option} height={256} ariaLabel={chart.title} />
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
- </section>
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.1-dev1.6b08f17",
3
+ "version": "0.2.1-dev1.84db6d5",
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": "6b08f17d0eae8c638246e2b12bb14298c16f0f9b",
53
+ "gitHead": "84db6d5b1584184bac55d9cdbd012a75f7f6b3d5",
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",