@squadbase/vantage-template 0.2.0-dev1.15ee4f2 → 0.2.0-dev1.29fa6c1
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 +3 -3
- package/base-template/agents/page.md +5 -4
- package/base-template/bun.lock +6 -6
- package/base-template/package.json +2 -2
- 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
|
@@ -4,7 +4,7 @@ import { Download, Search } from "lucide-react"
|
|
|
4
4
|
import { definePage } from "@squadbase/vantage"
|
|
5
5
|
import {
|
|
6
6
|
DashboardCardPreset,
|
|
7
|
-
|
|
7
|
+
AreaChart,
|
|
8
8
|
PageShell,
|
|
9
9
|
PageShellContent,
|
|
10
10
|
PageShellDescription,
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
PageShellHeading,
|
|
14
14
|
PageShellTitle,
|
|
15
15
|
Placeholder,
|
|
16
|
-
type EChartsOption,
|
|
17
16
|
} from "@squadbase/vantage/components"
|
|
18
17
|
import { Button, Input, ToggleGroup, ToggleGroupItem } from "@squadbase/vantage/ui"
|
|
19
18
|
|
|
@@ -23,7 +22,7 @@ import {
|
|
|
23
22
|
summaryRows,
|
|
24
23
|
trendSeries,
|
|
25
24
|
} from "./components/table-focus/mock-data"
|
|
26
|
-
import type { DetailRow
|
|
25
|
+
import type { DetailRow } from "./components/table-focus/types"
|
|
27
26
|
|
|
28
27
|
export const page = definePage({
|
|
29
28
|
title: "Records",
|
|
@@ -31,47 +30,6 @@ export const page = definePage({
|
|
|
31
30
|
"Workbench layout: header search + Export, status filter chips, a sortable detail table as the main element, with a trend chart and segment breakdown in a right sidebar.",
|
|
32
31
|
})
|
|
33
32
|
|
|
34
|
-
// ── chart helpers ───────────────────────────────────────────────────────────
|
|
35
|
-
|
|
36
|
-
function getBaseGrid() {
|
|
37
|
-
return { left: "3%", right: "4%", bottom: "10%", containLabel: true }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function formatNumber(n: number): string {
|
|
41
|
-
const sign = n < 0 ? "-" : ""
|
|
42
|
-
const abs = Math.abs(n)
|
|
43
|
-
if (abs >= 1_000_000) return `${sign}${(abs / 1_000_000).toFixed(1)}M`
|
|
44
|
-
if (abs >= 1_000) return `${sign}${(abs / 1_000).toFixed(1)}K`
|
|
45
|
-
return n.toLocaleString("en-US")
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ── chart options ────────────────────────────────────────────────────────────
|
|
49
|
-
|
|
50
|
-
function trendOption(data: TrendPoint[]): EChartsOption {
|
|
51
|
-
return {
|
|
52
|
-
tooltip: { trigger: "axis" },
|
|
53
|
-
legend: { bottom: 0 },
|
|
54
|
-
grid: getBaseGrid(),
|
|
55
|
-
xAxis: {
|
|
56
|
-
type: "category",
|
|
57
|
-
data: data.map((d) => d.date),
|
|
58
|
-
boundaryGap: false,
|
|
59
|
-
axisLabel: { formatter: (v: string) => v.slice(5) },
|
|
60
|
-
},
|
|
61
|
-
yAxis: { type: "value", axisLabel: { formatter: (v: number) => formatNumber(v) } },
|
|
62
|
-
series: [
|
|
63
|
-
{
|
|
64
|
-
name: "Series A",
|
|
65
|
-
type: "line",
|
|
66
|
-
smooth: true,
|
|
67
|
-
showSymbol: false,
|
|
68
|
-
data: data.map((d) => d.value),
|
|
69
|
-
areaStyle: { opacity: 0.18 },
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
33
|
// ── page ─────────────────────────────────────────────────────────────────────
|
|
76
34
|
|
|
77
35
|
type StatusFilter = "all" | DetailRow["status"]
|
|
@@ -150,7 +108,7 @@ export default function HomePage() {
|
|
|
150
108
|
title="Trend"
|
|
151
109
|
description="Values over the selected period"
|
|
152
110
|
>
|
|
153
|
-
<
|
|
111
|
+
<AreaChart data={trendSeries} index="date" categories={["value"]} labels={{ value: "Series A" }} height="220px" />
|
|
154
112
|
</DashboardCardPreset>
|
|
155
113
|
<DashboardCardPreset title="By segment" description="Share of total">
|
|
156
114
|
<div className="space-y-3">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type DetailRow = {
|
|
2
2
|
id: string
|
|
3
3
|
name: string
|
|
4
4
|
owner: string
|
|
@@ -10,7 +10,7 @@ export interface DetailRow {
|
|
|
10
10
|
updated: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type SummaryRow = {
|
|
14
14
|
segment: string
|
|
15
15
|
count: number
|
|
16
16
|
revenue: number
|
|
@@ -18,7 +18,7 @@ export interface SummaryRow {
|
|
|
18
18
|
share: number
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export
|
|
21
|
+
export type TrendPoint = {
|
|
22
22
|
date: string
|
|
23
23
|
value: number
|
|
24
24
|
}
|
|
@@ -4,7 +4,7 @@ import { Download, Search } from "lucide-react"
|
|
|
4
4
|
import { definePage } from "@squadbase/vantage"
|
|
5
5
|
import {
|
|
6
6
|
DashboardCardPreset,
|
|
7
|
-
|
|
7
|
+
AreaChart,
|
|
8
8
|
PageShell,
|
|
9
9
|
PageShellContent,
|
|
10
10
|
PageShellDescription,
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
PageShellHeading,
|
|
14
14
|
PageShellTitle,
|
|
15
15
|
Placeholder,
|
|
16
|
-
type EChartsOption,
|
|
17
16
|
} from "@squadbase/vantage/components"
|
|
18
17
|
import { Button, Input, ToggleGroup, ToggleGroupItem } from "@squadbase/vantage/ui"
|
|
19
18
|
|
|
@@ -23,7 +22,7 @@ import {
|
|
|
23
22
|
summaryRows,
|
|
24
23
|
trendSeries,
|
|
25
24
|
} from "./components/table-focus/mock-data"
|
|
26
|
-
import type { DetailRow
|
|
25
|
+
import type { DetailRow } from "./components/table-focus/types"
|
|
27
26
|
|
|
28
27
|
export const page = definePage({
|
|
29
28
|
title: "レコード",
|
|
@@ -31,47 +30,6 @@ export const page = definePage({
|
|
|
31
30
|
"ヘッダーに検索+エクスポート、ステータスフィルタチップ、ソート可能な詳細テーブルを主役とし、右サイドにトレンドチャートとセグメント内訳を配置する作業画面構成。",
|
|
32
31
|
})
|
|
33
32
|
|
|
34
|
-
// ── chart helpers ───────────────────────────────────────────────────────────
|
|
35
|
-
|
|
36
|
-
function getBaseGrid() {
|
|
37
|
-
return { left: "3%", right: "4%", bottom: "10%", containLabel: true }
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function formatNumber(n: number): string {
|
|
41
|
-
const sign = n < 0 ? "-" : ""
|
|
42
|
-
const abs = Math.abs(n)
|
|
43
|
-
if (abs >= 100_000_000) return `${sign}${(abs / 100_000_000).toFixed(1)}億`
|
|
44
|
-
if (abs >= 10_000) return `${sign}${(abs / 10_000).toFixed(0)}万`
|
|
45
|
-
return n.toLocaleString("ja-JP")
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// ── chart options ────────────────────────────────────────────────────────────
|
|
49
|
-
|
|
50
|
-
function trendOption(data: TrendPoint[]): EChartsOption {
|
|
51
|
-
return {
|
|
52
|
-
tooltip: { trigger: "axis" },
|
|
53
|
-
legend: { bottom: 0 },
|
|
54
|
-
grid: getBaseGrid(),
|
|
55
|
-
xAxis: {
|
|
56
|
-
type: "category",
|
|
57
|
-
data: data.map((d) => d.date),
|
|
58
|
-
boundaryGap: false,
|
|
59
|
-
axisLabel: { formatter: (v: string) => v.slice(5) },
|
|
60
|
-
},
|
|
61
|
-
yAxis: { type: "value", axisLabel: { formatter: (v: number) => formatNumber(v) } },
|
|
62
|
-
series: [
|
|
63
|
-
{
|
|
64
|
-
name: "系列A",
|
|
65
|
-
type: "line",
|
|
66
|
-
smooth: true,
|
|
67
|
-
showSymbol: false,
|
|
68
|
-
data: data.map((d) => d.value),
|
|
69
|
-
areaStyle: { opacity: 0.18 },
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
33
|
// ── page ─────────────────────────────────────────────────────────────────────
|
|
76
34
|
|
|
77
35
|
type StatusFilter = "all" | DetailRow["status"]
|
|
@@ -150,7 +108,7 @@ export default function HomePage() {
|
|
|
150
108
|
title="トレンド"
|
|
151
109
|
description="選択期間の値"
|
|
152
110
|
>
|
|
153
|
-
<
|
|
111
|
+
<AreaChart data={trendSeries} index="date" categories={["value"]} labels={{ value: "系列A" }} height="220px" />
|
|
154
112
|
</DashboardCardPreset>
|
|
155
113
|
<DashboardCardPreset title="セグメント別" description="全体に占める割合">
|
|
156
114
|
<div className="space-y-3">
|