@squadbase/vantage 0.7.0 → 0.7.1-dev1.0d13f9a

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 (101) hide show
  1. package/README.md +1 -1
  2. package/dist/add-AU3EDPNW.js +6 -0
  3. package/dist/add-AU3EDPNW.js.map +1 -0
  4. package/dist/{chunk-AABMKHEU.js → chunk-35B3YIBF.js} +16 -7
  5. package/dist/chunk-35B3YIBF.js.map +1 -0
  6. package/dist/{chunk-QNOX7WLZ.js → chunk-5HBUBVQ3.js} +94 -8
  7. package/dist/chunk-5HBUBVQ3.js.map +1 -0
  8. package/dist/{chunk-EG4PX726.js → chunk-GWXKENNH.js} +122 -5
  9. package/dist/chunk-GWXKENNH.js.map +1 -0
  10. package/dist/{chunk-77CISBMG.js → chunk-I2GWIPTD.js} +3685 -350
  11. package/dist/chunk-I2GWIPTD.js.map +1 -0
  12. package/dist/{chunk-TRMHNMMZ.js → chunk-LYUGDHSF.js} +3 -3
  13. package/dist/{chunk-TRMHNMMZ.js.map → chunk-LYUGDHSF.js.map} +1 -1
  14. package/dist/{chunk-2IAPIOPS.js → chunk-U6MWBCM6.js} +28 -7
  15. package/dist/chunk-U6MWBCM6.js.map +1 -0
  16. package/dist/{chunk-3RJEOP3J.js → chunk-XRKSIC5Z.js} +5 -3
  17. package/dist/chunk-XRKSIC5Z.js.map +1 -0
  18. package/dist/cli.js +2 -2
  19. package/dist/components/index.d.ts +849 -12
  20. package/dist/components/index.js +5 -5
  21. package/dist/{delta-text-CbrOaW83.d.ts → delta-text-tav2Lh5d.d.ts} +1 -1
  22. package/dist/doc/index.d.ts +2 -2
  23. package/dist/doc/index.js +4 -4
  24. package/dist/{format-DihQkL1N.d.ts → format-D34piCei.d.ts} +2 -1
  25. package/dist/geo-japan-7BMSOJRX.js +8 -0
  26. package/dist/geo-japan-7BMSOJRX.js.map +1 -0
  27. package/dist/geo-us-GVOG7VXH.js +8 -0
  28. package/dist/geo-us-GVOG7VXH.js.map +1 -0
  29. package/dist/geo-world-35HL56UU.js +8 -0
  30. package/dist/geo-world-35HL56UU.js.map +1 -0
  31. package/dist/slide/index.d.ts +2 -2
  32. package/dist/slide/index.js +4 -4
  33. package/dist/table/index.js +5 -6
  34. package/dist/table/index.js.map +1 -1
  35. package/dist/ui/index.d.ts +35 -4
  36. package/dist/ui/index.js +174 -11
  37. package/dist/ui/index.js.map +1 -1
  38. package/dist/{upgrade-6DT7ADRP.js → upgrade-MCHMELWC.js} +3 -3
  39. package/dist/{upgrade-6DT7ADRP.js.map → upgrade-MCHMELWC.js.map} +1 -1
  40. package/docs/en/agent-skills.md +13 -14
  41. package/docs/en/changelog.md +8 -0
  42. package/docs/en/parts/draft-chart.md +42 -0
  43. package/docs/en/parts/page-shell.md +1 -1
  44. package/docs/index.json +70 -50
  45. package/docs/ja/agent-skills.md +14 -14
  46. package/docs/ja/changelog.md +8 -0
  47. package/docs/ja/parts/draft-chart.md +40 -0
  48. package/docs/ja/parts/page-shell.md +1 -1
  49. package/package.json +2 -2
  50. package/registry/parts.json +5319 -0
  51. package/registry/ui/area-chart.tsx +43 -8
  52. package/registry/ui/bar-chart.tsx +43 -8
  53. package/registry/ui/bar-list.tsx +43 -8
  54. package/registry/ui/box-plot-chart.tsx +42 -7
  55. package/registry/ui/category-bar.tsx +25 -5
  56. package/registry/ui/chart-frame.tsx +55 -14
  57. package/registry/ui/checkbox.tsx +4 -3
  58. package/registry/ui/code-block.tsx +44 -0
  59. package/registry/ui/combo-chart.tsx +1869 -0
  60. package/registry/ui/combobox.tsx +7 -0
  61. package/registry/ui/context-menu.tsx +71 -0
  62. package/registry/ui/dashboard-card.tsx +23 -10
  63. package/registry/ui/data-table.tsx +10 -2
  64. package/registry/ui/date-range-picker.tsx +51 -4
  65. package/registry/ui/delta.tsx +39 -12
  66. package/registry/ui/donut-chart.tsx +43 -8
  67. package/registry/ui/echart.tsx +167 -7
  68. package/registry/ui/file-dropzone.tsx +143 -0
  69. package/registry/ui/filter-bar.tsx +77 -2
  70. package/registry/ui/forecast-chart.tsx +4769 -0
  71. package/registry/ui/funnel-steps.tsx +23 -5
  72. package/registry/ui/heatmap.tsx +20 -3
  73. package/registry/ui/histogram-chart.tsx +42 -7
  74. package/registry/ui/kpi-card.tsx +15 -9
  75. package/registry/ui/legend.tsx +73 -15
  76. package/registry/ui/line-chart.tsx +43 -8
  77. package/registry/ui/metric-value.tsx +2 -2
  78. package/registry/ui/page-shell.tsx +27 -4
  79. package/registry/ui/paired-chart.tsx +44 -9
  80. package/registry/ui/pivot-table.tsx +1260 -0
  81. package/registry/ui/progress-circle.tsx +2 -2
  82. package/registry/ui/progress.tsx +1 -1
  83. package/registry/ui/scatter-chart.tsx +50 -12
  84. package/registry/ui/sparkline.tsx +44 -9
  85. package/registry/ui/states.tsx +34 -1
  86. package/registry/ui/status-badge.tsx +7 -7
  87. package/registry/ui/tabs.tsx +1 -0
  88. package/registry/ui/treemap.tsx +1934 -0
  89. package/registry/ui/waterfall-chart.tsx +64 -11
  90. package/templates/AGENTS.md +3 -3
  91. package/templates/agents/page.md +5 -4
  92. package/dist/add-4GHF2TX2.js +0 -6
  93. package/dist/add-4GHF2TX2.js.map +0 -1
  94. package/dist/chunk-2IAPIOPS.js.map +0 -1
  95. package/dist/chunk-3RJEOP3J.js.map +0 -1
  96. package/dist/chunk-77CISBMG.js.map +0 -1
  97. package/dist/chunk-AABMKHEU.js.map +0 -1
  98. package/dist/chunk-EG4PX726.js.map +0 -1
  99. package/dist/chunk-NZ5QIIG4.js +0 -74
  100. package/dist/chunk-NZ5QIIG4.js.map +0 -1
  101. package/dist/chunk-QNOX7WLZ.js.map +0 -1
@@ -3,7 +3,9 @@
3
3
  "use client"
4
4
 
5
5
  /**
6
- * PageShell — the standard page frame: a bordered header band (title,
6
+ * PageShell — the outermost frame of a page; every other part goes inside it.
7
+ *
8
+ * It is the standard page frame: a bordered header band (title,
7
9
  * description, meta, actions), an optional summary card row, and the content
8
10
  * area. Composed from parts so a page can use only what it needs.
9
11
  */
@@ -149,11 +151,30 @@ function useLocale(locale?: string | null): string {
149
151
 
150
152
  /* ---------- end of inlined code ---------- */
151
153
 
152
- export interface PageShellProps extends HTMLAttributes<HTMLDivElement> {}
154
+ export interface PageShellProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
155
+ /** The page heading. When given, the header (title and `description`) and the content area are drawn for you; `children` go in the content area. */
156
+ title?: string
157
+ /** One line under the title. Used only with `title`. */
158
+ description?: string
159
+ }
153
160
 
154
161
  export const PageShell = forwardRef<HTMLDivElement, PageShellProps>(
155
- ({ className, ...props }, ref) => (
156
- <div ref={ref} data-slot="page-shell" className={cn("flex flex-col", className)} {...props} />
162
+ ({ className, title, description, children, ...props }, ref) => (
163
+ <div ref={ref} data-slot="page-shell" className={cn("flex flex-col", className)} {...props}>
164
+ {title === undefined ? (
165
+ children
166
+ ) : (
167
+ <>
168
+ <PageShellHeader>
169
+ <PageShellHeading>
170
+ <PageShellTitle>{title}</PageShellTitle>
171
+ {description ? <PageShellDescription>{description}</PageShellDescription> : null}
172
+ </PageShellHeading>
173
+ </PageShellHeader>
174
+ <PageShellContent>{children}</PageShellContent>
175
+ </>
176
+ )}
177
+ </div>
157
178
  ),
158
179
  )
159
180
  PageShell.displayName = "PageShell"
@@ -176,6 +197,8 @@ export interface PageShellHeaderProps extends HTMLAttributes<HTMLDivElement> {
176
197
  }
177
198
 
178
199
  /**
200
+ * PageShellHeader — the page header band (title and update time, source / period, overall status); inside `PageShell` without `title`, with the title in `PageShellHeading`.
201
+ *
179
202
  * A wrapping flex row, not a two-column grid: when the heading cannot keep its
180
203
  * 20rem basis next to `PageShellHeaderEnd`, the end block drops below it. A
181
204
  * `1fr auto` grid would instead hand the heading whatever the end block leaves,
@@ -3,7 +3,7 @@
3
3
  "use client"
4
4
 
5
5
  /**
6
- * PairedChart — 量(棒)と率・単価(線)を、同じ期間軸の上下 2 段で見せる型付きグラフ。
6
+ * PairedChart — 量(棒)と率・単価(線)を、同じ期間軸の上下 2 段で見せる型付きグラフ(`DashboardCardPreset` の中に置く)。
7
7
  * 二重 Y 軸は持たない: 上段が棒の値軸、下段が線の値軸で、横軸(期間)とツールチップの位置は
8
8
  * 1 つの ECharts の中で揃っている(ホバーすると同じ期間の棒と線の値が 1 枚のツールチップに出る)。
9
9
  * 段ごとに `format`(件数・金額・%)を持ち、率を分子・分母から計算することはしない(呼び元が値を渡す)。
@@ -171,10 +171,25 @@ function useLocale(locale?: string | null): string {
171
171
  const CHART_OTHER_COLOR = "color-mix(in oklab, var(--neutral) 50%, var(--background))"
172
172
 
173
173
  /**
174
- * True inside `ChartFrame`. The frame's plot area carries the chart's single
175
- * `role="img"` and label, so `EChart` drops its own when it sees this.
174
+ * What a `ChartFrame` tells the plot inside it. A frame whose plot is an image
175
+ * (`image`) puts `role="img"` on its plot area, unless an `EChart` inside it
176
+ * `claim`s the image: then the canvas alone carries `role="img"` with this name
177
+ * and description (`claimed`), so the action buttons beside the canvas are not
178
+ * inside the image (an interactive control inside `role="img"` is a
179
+ * nested-interactive violation and is not exposed). A `group` frame never
180
+ * hands the role to the canvas. `false` outside a frame.
176
181
  */
177
- const ChartFrameContext = createContext(false)
182
+ interface ChartFramePlot {
183
+ image: boolean
184
+ /** An `EChart` inside has taken over the `role="img"`. */
185
+ claimed: boolean
186
+ /** Take over the image role; returns the release. */
187
+ claim: () => () => void
188
+ ariaLabel?: string
189
+ ariaLabelledBy?: string
190
+ ariaDescribedBy?: string
191
+ }
192
+ const ChartFrameContext = createContext<ChartFramePlot | false>(false)
178
193
 
179
194
  /** Series palette, in order. Missing tokens are skipped, not defaulted. */
180
195
  const SERIES_TOKENS = ["--chart-1", "--chart-2", "--chart-3", "--chart-4", "--chart-5"] as const
@@ -398,6 +413,8 @@ function buildChartTheme(tokens: ChartTokens): Record<string, unknown> {
398
413
  tooltip: {
399
414
  // ECharts' default 0.4s transform lags the tooltip ~300ms behind the cursor.
400
415
  transitionDuration: 0,
416
+ // Stay inside the chart: cards are often narrow and overflow-hidden.
417
+ confine: true,
401
418
  backgroundColor: tokens.popover ?? undefined,
402
419
  borderColor: line,
403
420
  borderWidth: 1,
@@ -2273,6 +2290,10 @@ function legendLines(items: readonly string[], plotWidth?: number, reserve = 0):
2273
2290
 
2274
2291
  /** Width (px) kept free at the legend's right for the PNG action buttons (two 32px buttons + gaps). */
2275
2292
  const ACTIONS_RESERVE = 80
2293
+ /** Bars stay slim on wide cards (px); stacked segments round all corners and are parted by a hairline of the surface colour (px). */
2294
+ const BAR_MAX_WIDTH = 40
2295
+ const BAR_RADIUS = 3
2296
+ const STACK_GAP = 1.5
2276
2297
 
2277
2298
  /** Room (px) one time label (`2026年1月`) needs, gap included. */
2278
2299
  const TIME_LABEL_WIDTH = 80
@@ -2486,6 +2507,8 @@ function buildCartesianOption(cfg: CartesianChartConfig): EChartsOption {
2486
2507
  const compared = cartesianSeriesValues(data, [categories[compIdx]!], "default")[0]!
2487
2508
  return categories.map((_, i) => (i === compIdx ? compared : main[mainIdx.indexOf(i)]!))
2488
2509
  })()
2510
+ // Any negative bar: the part lays out the diverging view itself (a solid zero line, category labels kept at the axis end).
2511
+ const diverging = kind === "bar" && values.some((s) => s.some((v) => typeof v === "number" && v < 0))
2489
2512
  const comparisonColor = guideColor ? withAlpha(guideColor, COMPARISON_OPACITY) : undefined
2490
2513
 
2491
2514
  /* -- x labels: the actual rows, then the forecast rows that extend them */
@@ -2695,15 +2718,17 @@ function buildCartesianOption(cfg: CartesianChartConfig): EChartsOption {
2695
2718
  const seriesData = pad(values[c]!)
2696
2719
  if (kind === "bar") {
2697
2720
  const rounded = horizontalBars ? [0, 4, 4, 0] : [4, 4, 0, 0]
2698
- // Stacked: only the topmost segment is rounded.
2699
- const radius = stacked && c !== categories.length - 1 ? 0 : rounded
2721
+ // Stacked: every segment is rounded, with a hairline of the surface colour between segments (the gap).
2722
+ const radius = stacked ? BAR_RADIUS : rounded
2723
+ const gapStyle = stacked && labelBackground ? { borderColor: labelBackground, borderWidth: STACK_GAP } : {}
2700
2724
  return {
2701
2725
  id: SERIES_ID_PREFIX + category,
2702
2726
  type: "bar" as const,
2703
2727
  name: category,
2704
2728
  stack: stacked ? "total" : undefined,
2705
2729
  barCategoryGap,
2706
- itemStyle: { color, borderRadius: radius },
2730
+ barMaxWidth: BAR_MAX_WIDTH,
2731
+ itemStyle: { color, borderRadius: radius, ...gapStyle },
2707
2732
  markPoint: markPointFor(c, solid),
2708
2733
  markLine: undefined,
2709
2734
  data: seriesData.map((value, i) => {
@@ -2999,6 +3024,14 @@ function buildCartesianOption(cfg: CartesianChartConfig): EChartsOption {
2999
3024
  },
3000
3025
  })
3001
3026
  }
3027
+ if (diverging) {
3028
+ markLines.push({
3029
+ name: "zero",
3030
+ [horizontalBars ? "xAxis" : "yAxis"]: 0,
3031
+ lineStyle: { type: "solid", width: 1, color: guideColor },
3032
+ label: { show: false },
3033
+ })
3034
+ }
3002
3035
  if (forecast) {
3003
3036
  const forecastSpan =
3004
3037
  plotWidth && labels.length > 1
@@ -3144,6 +3177,8 @@ function buildCartesianOption(cfg: CartesianChartConfig): EChartsOption {
3144
3177
  show: horizontalBars ? showYAxis : showXAxis,
3145
3178
  boundaryGap: kind === "bar",
3146
3179
  inverse: horizontalBars,
3180
+ // Diverging: the axis stays at the plot's edge (not at 0, where labels would hit the negative bars); the zero line is a mark line.
3181
+ axisLine: diverging ? { show: false, onZero: false } : undefined,
3147
3182
  axisTick: { show: false },
3148
3183
  axisLabel: {
3149
3184
  hideOverlap: true,
@@ -3246,7 +3281,7 @@ function buildCartesianOption(cfg: CartesianChartConfig): EChartsOption {
3246
3281
  // Narrow: left-aligned and wrapping above the plot, so nothing is cut off at the right edge.
3247
3282
  ...(plotWidth !== undefined && plotWidth < NARROW_PLOT_WIDTH
3248
3283
  ? { left: 0, right: 0 }
3249
- : { right: reserveActions ? ACTIONS_RESERVE : 0 }),
3284
+ : { left: 0, right: reserveActions ? ACTIONS_RESERVE : 0 }),
3250
3285
  // Plain wraps onto a second line at narrow widths instead of hiding items behind arrows.
3251
3286
  type: "plain",
3252
3287
  icon: "circle",
@@ -3939,7 +3974,7 @@ export function buildPairedOption(cfg: PairedOptionConfig): EChartsOption {
3939
3974
 
3940
3975
  const option: AnyRecord = {
3941
3976
  ...barOpt,
3942
- legend: { ...barOpt.legend, show: showLegend, data: legendNames, right: cfg.reserveActions ? 80 : 0 },
3977
+ legend: { ...barOpt.legend, show: showLegend, data: legendNames, left: 0, right: cfg.reserveActions ? 80 : 0 },
3943
3978
  grid: [
3944
3979
  { top, height: upper, left: gridLeft, right, containLabel: true },
3945
3980
  { top: top + upper + PANEL_GAP, bottom: 4, left: gridLeft, right, containLabel: true },