@squadbase/vantage 0.6.2-stg.3a2ba98 → 0.7.0-dev1.1197de7

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 (357) hide show
  1. package/dist/add-4GHF2TX2.js +6 -0
  2. package/dist/add-4GHF2TX2.js.map +1 -0
  3. package/dist/{build-O5TVNH4E.js → build-U7GO26HR.js} +9 -9
  4. package/dist/{build-O5TVNH4E.js.map → build-U7GO26HR.js.map} +1 -1
  5. package/dist/{check-WFBEDHDR.js → check-MRVAIHG5.js} +7 -7
  6. package/dist/{check-WFBEDHDR.js.map → check-MRVAIHG5.js.map} +1 -1
  7. package/dist/{chunk-QDZA5JSL.js → chunk-AABMKHEU.js} +4 -4
  8. package/dist/{chunk-QDZA5JSL.js.map → chunk-AABMKHEU.js.map} +1 -1
  9. package/dist/{chunk-PVTHHV7X.js → chunk-ANZLVSEP.js} +28 -7
  10. package/dist/chunk-ANZLVSEP.js.map +1 -0
  11. package/dist/chunk-CKWPK4RO.js +50 -0
  12. package/dist/chunk-CKWPK4RO.js.map +1 -0
  13. package/dist/chunk-EG4PX726.js +678 -0
  14. package/dist/chunk-EG4PX726.js.map +1 -0
  15. package/dist/{chunk-3G43C6OL.js → chunk-GNXCX4WE.js} +46 -3
  16. package/dist/chunk-GNXCX4WE.js.map +1 -0
  17. package/dist/chunk-LYUGDHSF.js +61 -0
  18. package/dist/chunk-LYUGDHSF.js.map +1 -0
  19. package/dist/{chunk-RPZAALCX.js → chunk-MQUIAP66.js} +321 -165
  20. package/dist/chunk-MQUIAP66.js.map +1 -0
  21. package/dist/chunk-P2KIHF65.js +152 -0
  22. package/dist/chunk-P2KIHF65.js.map +1 -0
  23. package/dist/{chunk-BCE22JSM.js → chunk-PJ4SPXHS.js} +52 -16
  24. package/dist/chunk-PJ4SPXHS.js.map +1 -0
  25. package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
  26. package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
  27. package/dist/{chunk-PXRX5PEC.js → chunk-ROHNXP7J.js} +73 -4
  28. package/dist/chunk-ROHNXP7J.js.map +1 -0
  29. package/dist/chunk-S5MDTHH7.js +466 -0
  30. package/dist/chunk-S5MDTHH7.js.map +1 -0
  31. package/dist/chunk-SDJTTMLK.js +1877 -0
  32. package/dist/chunk-SDJTTMLK.js.map +1 -0
  33. package/dist/{chunk-EP6JHXSR.js → chunk-SHZM3EXB.js} +68 -12
  34. package/dist/chunk-SHZM3EXB.js.map +1 -0
  35. package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
  36. package/dist/chunk-U736PVHY.js.map +1 -0
  37. package/dist/{chunk-JGRMRXXZ.js → chunk-UWSQUHX6.js} +4 -99
  38. package/dist/chunk-UWSQUHX6.js.map +1 -0
  39. package/dist/chunk-XRKSIC5Z.js +176 -0
  40. package/dist/chunk-XRKSIC5Z.js.map +1 -0
  41. package/dist/chunk-YJQCB3UP.js +10764 -0
  42. package/dist/chunk-YJQCB3UP.js.map +1 -0
  43. package/dist/cli.js +15 -11
  44. package/dist/cli.js.map +1 -1
  45. package/dist/client/index.d.ts +34 -3
  46. package/dist/client/index.js +211 -12
  47. package/dist/client/index.js.map +1 -1
  48. package/dist/components/index.d.ts +2389 -31
  49. package/dist/components/index.js +7 -4
  50. package/dist/delta-text-tav2Lh5d.d.ts +17 -0
  51. package/dist/{dev-NZRLOQCL.js → dev-O42JFQ64.js} +24 -13
  52. package/dist/dev-O42JFQ64.js.map +1 -0
  53. package/dist/doc/index.d.ts +215 -2
  54. package/dist/doc/index.js +423 -5
  55. package/dist/doc/index.js.map +1 -1
  56. package/dist/{docs-ZGDJUHJI.js → docs-JVP4RPKT.js} +3 -3
  57. package/dist/{docs-ZGDJUHJI.js.map → docs-JVP4RPKT.js.map} +1 -1
  58. package/dist/{doctor-VFKEMR54.js → doctor-YD3XAAOT.js} +8 -8
  59. package/dist/doctor-YD3XAAOT.js.map +1 -0
  60. package/dist/format-D34piCei.d.ts +250 -0
  61. package/dist/geo-japan-7BMSOJRX.js +8 -0
  62. package/dist/geo-japan-7BMSOJRX.js.map +1 -0
  63. package/dist/geo-us-GVOG7VXH.js +8 -0
  64. package/dist/geo-us-GVOG7VXH.js.map +1 -0
  65. package/dist/geo-world-35HL56UU.js +8 -0
  66. package/dist/geo-world-35HL56UU.js.map +1 -0
  67. package/dist/markdown/index.js +1 -1
  68. package/dist/markdown/index.js.map +1 -1
  69. package/dist/{preview-QDCIVVSR.js → preview-T6CLSQVX.js} +12 -4
  70. package/dist/preview-T6CLSQVX.js.map +1 -0
  71. package/dist/query/index.d.ts +0 -11
  72. package/dist/query/index.js +2 -2
  73. package/dist/{routes-RHP5FVGD.js → routes-PVKNT777.js} +6 -6
  74. package/dist/{routes-RHP5FVGD.js.map → routes-PVKNT777.js.map} +1 -1
  75. package/dist/{search-RFBELGY7.js → search-5LC4XPB5.js} +3 -3
  76. package/dist/{search-RFBELGY7.js.map → search-5LC4XPB5.js.map} +1 -1
  77. package/dist/slide/index.d.ts +272 -1
  78. package/dist/slide/index.js +1086 -19
  79. package/dist/slide/index.js.map +1 -1
  80. package/dist/table/index.js +13 -10
  81. package/dist/table/index.js.map +1 -1
  82. package/dist/ui/index.d.ts +148 -12
  83. package/dist/ui/index.js +1339 -88
  84. package/dist/ui/index.js.map +1 -1
  85. package/dist/{upgrade-GF2P67M6.js → upgrade-6DT7ADRP.js} +7 -7
  86. package/dist/{upgrade-GF2P67M6.js.map → upgrade-6DT7ADRP.js.map} +1 -1
  87. package/dist/vite/index.d.ts +10 -0
  88. package/dist/vite/index.js +4 -4
  89. package/docs/en/agent-skills.md +1 -1
  90. package/docs/en/changelog.md +82 -0
  91. package/docs/en/cli-reference.md +30 -0
  92. package/docs/en/components.md +42 -17
  93. package/docs/en/doc/delta-text.md +40 -0
  94. package/docs/en/doc/doc-action-items.md +49 -0
  95. package/docs/en/doc/doc-callout.md +38 -0
  96. package/docs/en/doc/doc-data-table.md +60 -0
  97. package/docs/en/doc/doc-executive-summary.md +64 -0
  98. package/docs/en/doc/doc-figure.md +56 -0
  99. package/docs/en/doc/doc-key-findings.md +61 -0
  100. package/docs/en/doc/doc-kpi-scorecard.md +80 -0
  101. package/docs/en/doc/doc-notes-and-sources.md +43 -0
  102. package/docs/en/doc/doc-report-header.md +46 -0
  103. package/docs/en/pages-and-metadata.md +15 -0
  104. package/docs/en/parts/area-chart.md +99 -0
  105. package/docs/en/parts/bar-chart.md +91 -0
  106. package/docs/en/parts/bar-list.md +50 -0
  107. package/docs/en/parts/category-bar.md +37 -0
  108. package/docs/en/parts/chart-frame.md +39 -0
  109. package/docs/en/parts/data-table.md +22 -0
  110. package/docs/en/parts/delta.md +51 -0
  111. package/docs/en/parts/donut-chart.md +72 -0
  112. package/docs/en/parts/draft-chart.md +42 -0
  113. package/docs/en/parts/format.md +43 -0
  114. package/docs/en/parts/funnel-steps.md +2 -1
  115. package/docs/en/parts/heatmap.md +53 -0
  116. package/docs/en/parts/kpi-card.md +58 -0
  117. package/docs/en/parts/legend.md +35 -0
  118. package/docs/en/parts/line-chart.md +94 -0
  119. package/docs/en/parts/metric-value.md +3 -2
  120. package/docs/en/parts/page-shell.md +2 -2
  121. package/docs/en/parts/progress-circle.md +33 -0
  122. package/docs/en/parts/sample-data.md +39 -0
  123. package/docs/en/parts/scatter-chart.md +56 -0
  124. package/docs/en/parts/sparkline.md +1 -1
  125. package/docs/en/parts/tracker.md +36 -0
  126. package/docs/en/parts/trend-indicator.md +17 -1
  127. package/docs/en/parts/updated-at.md +30 -0
  128. package/docs/en/parts/waterfall-chart.md +56 -0
  129. package/docs/en/slide/slide-chart-full.md +48 -0
  130. package/docs/en/slide/slide-chart-insight.md +52 -0
  131. package/docs/en/slide/slide-columns.md +46 -0
  132. package/docs/en/slide/slide-comparison.md +68 -0
  133. package/docs/en/slide/slide-cover.md +39 -0
  134. package/docs/en/slide/slide-exec-summary.md +47 -0
  135. package/docs/en/slide/slide-heading.md +38 -0
  136. package/docs/en/slide/slide-kpi-grid.md +55 -0
  137. package/docs/en/slide/slide-kpi-hero.md +58 -0
  138. package/docs/en/slide/slide-next-actions.md +49 -0
  139. package/docs/en/slide/slide-scorecard-table.md +54 -0
  140. package/docs/en/slide/slide-section.md +44 -0
  141. package/docs/en/slide/slide-source-line.md +34 -0
  142. package/docs/en/ui/alert-dialog.md +42 -0
  143. package/docs/en/ui/avatar.md +31 -0
  144. package/docs/en/ui/combobox.md +74 -0
  145. package/docs/en/ui/drawer.md +41 -0
  146. package/docs/en/ui/empty.md +1 -1
  147. package/docs/en/ui/error-state.md +4 -3
  148. package/docs/en/ui/field.md +42 -0
  149. package/docs/en/ui/hover-card.md +21 -0
  150. package/docs/en/ui/kbd.md +17 -0
  151. package/docs/en/ui/loading.md +1 -1
  152. package/docs/en/ui/pagination.md +36 -0
  153. package/docs/en/ui/radio-group.md +21 -0
  154. package/docs/en/ui/toast.md +44 -0
  155. package/docs/en/ui/toggle-group.md +4 -3
  156. package/docs/en/ui-and-theming.md +1 -1
  157. package/docs/index.json +1222 -132
  158. package/docs/ja/agent-skills.md +1 -1
  159. package/docs/ja/changelog.md +84 -0
  160. package/docs/ja/cli-reference.md +29 -0
  161. package/docs/ja/components.md +68 -101
  162. package/docs/ja/doc/delta-text.md +40 -0
  163. package/docs/ja/doc/doc-action-items.md +49 -0
  164. package/docs/ja/doc/doc-callout.md +38 -0
  165. package/docs/ja/doc/doc-data-table.md +60 -0
  166. package/docs/ja/doc/doc-executive-summary.md +64 -0
  167. package/docs/ja/doc/doc-figure.md +56 -0
  168. package/docs/ja/doc/doc-key-findings.md +61 -0
  169. package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
  170. package/docs/ja/doc/doc-notes-and-sources.md +43 -0
  171. package/docs/ja/doc/doc-report-header.md +46 -0
  172. package/docs/ja/page-types/csv.md +83 -0
  173. package/docs/ja/page-types/doc.md +83 -0
  174. package/docs/ja/page-types/excel.md +82 -0
  175. package/docs/ja/page-types/slide.md +133 -0
  176. package/docs/ja/page-types.md +47 -0
  177. package/docs/ja/pages-and-metadata.md +15 -0
  178. package/docs/ja/parts/area-chart.md +85 -0
  179. package/docs/ja/parts/bar-chart.md +95 -0
  180. package/docs/ja/parts/bar-list.md +58 -0
  181. package/docs/ja/parts/category-bar.md +36 -0
  182. package/docs/ja/parts/chart-frame.md +36 -0
  183. package/docs/ja/parts/data-table.md +22 -0
  184. package/docs/ja/parts/delta.md +51 -0
  185. package/docs/ja/parts/donut-chart.md +66 -0
  186. package/docs/ja/parts/draft-chart.md +40 -0
  187. package/docs/ja/parts/echart.md +3 -0
  188. package/docs/ja/parts/format.md +44 -0
  189. package/docs/ja/parts/funnel-steps.md +27 -8
  190. package/docs/ja/parts/heatmap.md +45 -0
  191. package/docs/ja/parts/kpi-card.md +56 -0
  192. package/docs/ja/parts/legend.md +36 -0
  193. package/docs/ja/parts/line-chart.md +84 -0
  194. package/docs/ja/parts/metric-value.md +3 -2
  195. package/docs/ja/parts/page-shell.md +2 -2
  196. package/docs/ja/parts/progress-circle.md +34 -0
  197. package/docs/ja/parts/sample-data.md +61 -0
  198. package/docs/ja/parts/scatter-chart.md +69 -0
  199. package/docs/ja/parts/sparkline.md +2 -2
  200. package/docs/ja/parts/tracker.md +32 -0
  201. package/docs/ja/parts/trend-indicator.md +17 -1
  202. package/docs/ja/parts/updated-at.md +27 -0
  203. package/docs/ja/parts/waterfall-chart.md +61 -0
  204. package/docs/ja/routing.md +8 -86
  205. package/docs/ja/slide/slide-chart-full.md +48 -0
  206. package/docs/ja/slide/slide-chart-insight.md +52 -0
  207. package/docs/ja/slide/slide-columns.md +46 -0
  208. package/docs/ja/slide/slide-comparison.md +68 -0
  209. package/docs/ja/slide/slide-cover.md +39 -0
  210. package/docs/ja/slide/slide-exec-summary.md +47 -0
  211. package/docs/ja/slide/slide-heading.md +38 -0
  212. package/docs/ja/slide/slide-kpi-grid.md +55 -0
  213. package/docs/ja/slide/slide-kpi-hero.md +58 -0
  214. package/docs/ja/slide/slide-next-actions.md +49 -0
  215. package/docs/ja/slide/slide-scorecard-table.md +54 -0
  216. package/docs/ja/slide/slide-section.md +44 -0
  217. package/docs/ja/slide/slide-source-line.md +34 -0
  218. package/docs/ja/ui/alert-dialog.md +41 -0
  219. package/docs/ja/ui/avatar.md +31 -0
  220. package/docs/ja/ui/combobox.md +74 -0
  221. package/docs/ja/ui/drawer.md +41 -0
  222. package/docs/ja/ui/empty.md +1 -1
  223. package/docs/ja/ui/error-state.md +4 -3
  224. package/docs/ja/ui/field.md +42 -0
  225. package/docs/ja/ui/hover-card.md +21 -0
  226. package/docs/ja/ui/kbd.md +16 -0
  227. package/docs/ja/ui/loading.md +1 -1
  228. package/docs/ja/ui/pagination.md +36 -0
  229. package/docs/ja/ui/radio-group.md +21 -0
  230. package/docs/ja/ui/toast.md +46 -0
  231. package/docs/ja/ui/toggle-group.md +4 -3
  232. package/docs/ja/ui-and-theming.md +14 -7
  233. package/package.json +43 -29
  234. package/registry/parts.json +5221 -0
  235. package/registry/ui/accordion.tsx +76 -0
  236. package/registry/ui/alert-dialog.tsx +189 -0
  237. package/registry/ui/alert.tsx +80 -0
  238. package/registry/ui/app-shell.tsx +424 -0
  239. package/registry/ui/area-chart.tsx +3960 -0
  240. package/registry/ui/attention-list.tsx +465 -0
  241. package/registry/ui/avatar.tsx +110 -0
  242. package/registry/ui/badge.tsx +56 -0
  243. package/registry/ui/bar-chart.tsx +3954 -0
  244. package/registry/ui/bar-list.tsx +3998 -0
  245. package/registry/ui/box-plot-chart.tsx +4214 -0
  246. package/registry/ui/breadcrumb.tsx +128 -0
  247. package/registry/ui/button.tsx +62 -0
  248. package/registry/ui/calendar.tsx +223 -0
  249. package/registry/ui/card.tsx +107 -0
  250. package/registry/ui/category-bar.tsx +1498 -0
  251. package/registry/ui/chart-frame.tsx +1612 -0
  252. package/registry/ui/checkbox.tsx +30 -0
  253. package/registry/ui/collapsible.tsx +23 -0
  254. package/registry/ui/combo-chart.tsx +1852 -0
  255. package/registry/ui/combobox.tsx +310 -0
  256. package/registry/ui/command.tsx +198 -0
  257. package/registry/ui/dashboard-card.tsx +219 -0
  258. package/registry/ui/data-table.tsx +899 -158
  259. package/registry/ui/date-range-picker.tsx +544 -0
  260. package/registry/ui/delta.tsx +352 -0
  261. package/registry/ui/dialog.tsx +161 -0
  262. package/registry/ui/donut-chart.tsx +4006 -0
  263. package/registry/ui/drawer.tsx +229 -0
  264. package/registry/ui/dropdown-menu.tsx +274 -0
  265. package/registry/ui/echart.tsx +1178 -0
  266. package/registry/ui/field.tsx +240 -0
  267. package/registry/ui/filter-bar.tsx +553 -0
  268. package/registry/ui/forecast-chart.tsx +4734 -0
  269. package/registry/ui/funnel-steps.tsx +3843 -0
  270. package/registry/ui/heatmap.tsx +2027 -0
  271. package/registry/ui/histogram-chart.tsx +4284 -0
  272. package/registry/ui/hover-card.tsx +52 -0
  273. package/registry/ui/input-group.tsx +160 -0
  274. package/registry/ui/input.tsx +24 -0
  275. package/registry/ui/kbd.tsx +30 -0
  276. package/registry/ui/kpi-card.tsx +907 -0
  277. package/registry/ui/label.tsx +22 -0
  278. package/registry/ui/legend.tsx +3817 -0
  279. package/registry/ui/line-chart.tsx +3958 -0
  280. package/registry/ui/metric-value.tsx +62 -0
  281. package/registry/ui/multi-select.tsx +382 -0
  282. package/registry/ui/page-shell.tsx +441 -0
  283. package/registry/ui/pagination.tsx +140 -0
  284. package/registry/ui/paired-chart.tsx +4086 -0
  285. package/registry/ui/pivot-table.tsx +1260 -0
  286. package/registry/ui/placeholder.tsx +36 -0
  287. package/registry/ui/popover.tsx +92 -0
  288. package/registry/ui/progress-circle.tsx +1033 -0
  289. package/registry/ui/progress.tsx +85 -0
  290. package/registry/ui/radio-group.tsx +39 -0
  291. package/registry/ui/sample-data.tsx +230 -0
  292. package/registry/ui/scatter-chart.tsx +4503 -0
  293. package/registry/ui/scroll-area.tsx +56 -0
  294. package/registry/ui/searchable-select.tsx +352 -0
  295. package/registry/ui/section-header.tsx +43 -0
  296. package/registry/ui/segmented-control.tsx +76 -0
  297. package/registry/ui/select.tsx +255 -0
  298. package/registry/ui/separator.tsx +27 -0
  299. package/registry/ui/sheet.tsx +139 -0
  300. package/registry/ui/sidebar.tsx +725 -0
  301. package/registry/ui/skeleton.tsx +17 -0
  302. package/registry/ui/slider.tsx +56 -0
  303. package/registry/ui/sparkline.tsx +230 -0
  304. package/registry/ui/spinner.tsx +14 -0
  305. package/registry/ui/states.tsx +247 -0
  306. package/registry/ui/status-badge.tsx +286 -0
  307. package/registry/ui/switch.tsx +34 -0
  308. package/registry/ui/table.tsx +118 -0
  309. package/registry/ui/tabs.tsx +84 -0
  310. package/registry/ui/textarea.tsx +22 -0
  311. package/registry/ui/toast.tsx +250 -0
  312. package/registry/ui/toggle-group.tsx +91 -0
  313. package/registry/ui/toggle.tsx +47 -0
  314. package/registry/ui/tooltip.tsx +72 -0
  315. package/registry/ui/tracker.tsx +1015 -0
  316. package/registry/ui/treemap.tsx +1917 -0
  317. package/registry/ui/trend-indicator.tsx +217 -0
  318. package/registry/ui/updated-at.tsx +276 -0
  319. package/registry/ui/waterfall-chart.tsx +4561 -0
  320. package/skills/vantage-add-feature/SKILL.md +14 -7
  321. package/skills/vantage-design/SKILL.md +62 -52
  322. package/skills/vantage-design/references/extract.md +26 -27
  323. package/skills/vantage-design/references/format.md +12 -172
  324. package/skills/vantage-design/references/presets.md +50 -110
  325. package/skills/vantage-pitfalls/SKILL.md +10 -1
  326. package/skills/vantage-slide/SKILL.md +71 -36
  327. package/templates/AGENTS.md +54 -16
  328. package/templates/agents/api.md +36 -0
  329. package/templates/agents/csv.md +2 -1
  330. package/templates/agents/doc.md +52 -3
  331. package/templates/agents/page.md +91 -10
  332. package/templates/agents/slide.md +90 -4
  333. package/templates/agents/xlsx.md +2 -1
  334. package/theme.css +247 -132
  335. package/dist/add-EISGSZAH.js +0 -6
  336. package/dist/add-EISGSZAH.js.map +0 -1
  337. package/dist/chunk-3G43C6OL.js.map +0 -1
  338. package/dist/chunk-5ZOP4SQR.js +0 -47
  339. package/dist/chunk-5ZOP4SQR.js.map +0 -1
  340. package/dist/chunk-A2UUGASH.js.map +0 -1
  341. package/dist/chunk-BCE22JSM.js.map +0 -1
  342. package/dist/chunk-DTDVSFRY.js +0 -29
  343. package/dist/chunk-DTDVSFRY.js.map +0 -1
  344. package/dist/chunk-EP6JHXSR.js.map +0 -1
  345. package/dist/chunk-JGRMRXXZ.js.map +0 -1
  346. package/dist/chunk-KLEIVDUV.js +0 -165
  347. package/dist/chunk-KLEIVDUV.js.map +0 -1
  348. package/dist/chunk-LSRMRIXA.js +0 -2227
  349. package/dist/chunk-LSRMRIXA.js.map +0 -1
  350. package/dist/chunk-PVTHHV7X.js.map +0 -1
  351. package/dist/chunk-PXRX5PEC.js.map +0 -1
  352. package/dist/chunk-RPZAALCX.js.map +0 -1
  353. package/dist/chunk-T3FLAGI6.js +0 -316
  354. package/dist/chunk-T3FLAGI6.js.map +0 -1
  355. package/dist/dev-NZRLOQCL.js.map +0 -1
  356. package/dist/doctor-VFKEMR54.js.map +0 -1
  357. package/dist/preview-QDCIVVSR.js.map +0 -1
@@ -1,18 +1,66 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
- import { HTMLAttributes, ComponentType, ReactNode, ElementType, ComponentProps, SVGAttributes } from 'react';
3
+ import { HTMLAttributes, ReactNode, ComponentType, ElementType, Ref, ReactElement, ComponentProps, SVGAttributes } from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import { EChartsOption } from 'echarts';
6
6
  export { EChartsOption } from 'echarts';
7
- import { ColumnDef, SortingState, OnChangeFn, ColumnFiltersState, PaginationState, RowSelectionState, VisibilityState, TableMeta, Table } from '@tanstack/react-table';
7
+ import { V as ValueFormat, a as DateStyle } from '../format-D34piCei.js';
8
+ export { D as DEFAULT_LOCALE, E as EMPTY_VALUE, F as FormatDateOptions, b as FormatKind, c as FormatValueOptions, M as MINUS_SIGN, f as formatDate, d as formatDateRange, e as formatDatesInText, g as formatDelta, h as formatKind, i as formatPoints, j as formatValue, t as toValueFormatter } from '../format-D34piCei.js';
9
+ import { RowData, ColumnDef, SortingState, OnChangeFn, ColumnFiltersState, PaginationState, RowSelectionState, VisibilityState, TableMeta, Table } from '@tanstack/react-table';
8
10
  export { ColumnDef, ColumnFiltersState, PaginationState, RowSelectionState, SortingState, VisibilityState } from '@tanstack/react-table';
9
11
  export { DateRange as RdpDateRange } from 'react-day-picker';
10
12
 
11
- interface PageShellProps extends HTMLAttributes<HTMLDivElement> {
13
+ interface UpdatedAtProps {
14
+ /** When the data was last updated. */
15
+ at: Date | string | number;
16
+ /** `"relative"` (default): "23 分前に更新". `"absolute-first"`: "16:41 更新(23 分前)" — for pages where "now" matters. */
17
+ variant?: "relative" | "absolute-first";
18
+ /** IANA time zone (e.g. `"Asia/Tokyo"`) for the absolute time. Defaults to the runtime's zone. */
19
+ timeZone?: string;
20
+ /** Text placed before the label, e.g. `"売上データ: "`. */
21
+ prefix?: string;
22
+ /** Fixed "current time" for tests and fixtures. Disables the 60 s refresh. */
23
+ now?: Date | number;
24
+ className?: string;
25
+ }
26
+ declare const UpdatedAt: React.ForwardRefExoticComponent<UpdatedAtProps & React.RefAttributes<HTMLTimeElement>>;
27
+
28
+ interface PageShellProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
29
+ /** The page heading. When given, the header (title and `description`) and the content area are drawn for you; `children` go in the content area. */
30
+ title?: string;
31
+ /** One line under the title. Used only with `title`. */
32
+ description?: string;
12
33
  }
13
34
  declare const PageShell: React.ForwardRefExoticComponent<PageShellProps & React.RefAttributes<HTMLDivElement>>;
14
35
  interface PageShellHeaderProps extends HTMLAttributes<HTMLDivElement> {
36
+ /** When the data was last updated. Drawn by `UpdatedAt` at the right end of the title row. */
37
+ updatedAt?: UpdatedAtProps["at"];
38
+ /** `"relative"` (default) or `"absolute-first"` ("16:41 更新(23 分前)") for pages where "now" matters. */
39
+ updatedAtVariant?: UpdatedAtProps["variant"];
40
+ /** IANA time zone for the absolute time of `updatedAt`. Defaults to the runtime's zone. */
41
+ timeZone?: string;
42
+ /** Where the data comes from. Shown as a chip "Source: ○○" (ja: "出典:○○") on the second row. */
43
+ source?: string;
44
+ /** The period the data covers. Shown as a chip "2026/9/23〜10/20" on the second row. */
45
+ period?: {
46
+ start: Date | string | number;
47
+ end: Date | string | number;
48
+ };
49
+ /** The page's overall state (an alert, a status badge). Shown on the third row; no row when absent. */
50
+ status?: ReactNode;
15
51
  }
52
+ /**
53
+ * A wrapping flex row, not a two-column grid: when the heading cannot keep its
54
+ * 20rem basis next to `PageShellHeaderEnd`, the end block drops below it. A
55
+ * `1fr auto` grid would instead hand the heading whatever the end block leaves,
56
+ * and a CJK title — breakable between any two characters — collapses into a
57
+ * one-character column.
58
+ *
59
+ * The meta props (`updatedAt`, `source`, `period`, `status`) fix the order every
60
+ * page head shares: title and update time (right end) → source / period chips →
61
+ * overall status → summary cards. Empty rows are not drawn. Rows are placed with
62
+ * flex `order`, so they land before `PageShellSummary` whatever the child order.
63
+ */
16
64
  declare const PageShellHeader: React.ForwardRefExoticComponent<PageShellHeaderProps & React.RefAttributes<HTMLDivElement>>;
17
65
  interface PageShellHeadingProps extends HTMLAttributes<HTMLDivElement> {
18
66
  }
@@ -35,13 +83,8 @@ declare const PageShellActions: React.ForwardRefExoticComponent<PageShellActions
35
83
  interface PageShellSummaryProps extends HTMLAttributes<HTMLDivElement> {
36
84
  }
37
85
  declare const PageShellSummary: React.ForwardRefExoticComponent<PageShellSummaryProps & React.RefAttributes<HTMLDivElement>>;
38
- /**
39
- * Accent colours are spelled out one utility set per colour rather than built
40
- * from a template string — Tailwind only emits classes it can see literally in
41
- * the source.
42
- */
43
86
  declare const pageShellSummaryCardVariants: (props?: ({
44
- accent?: "accent" | "default" | "amber" | "blue" | "emerald" | "red" | "violet" | "orange" | "cyan" | "slate" | "green" | "teal" | "sky" | "indigo" | "purple" | "pink" | "rose" | "yellow" | "lime" | "gray" | "zinc" | "neutral" | "stone" | "fuchsia" | null | undefined;
87
+ accent?: "default" | "accent" | "amber" | "blue" | "emerald" | "red" | "violet" | "orange" | "cyan" | "slate" | "green" | "teal" | "sky" | "indigo" | "purple" | "pink" | "rose" | "yellow" | "lime" | "gray" | "zinc" | "neutral" | "stone" | "fuchsia" | null | undefined;
45
88
  } & class_variance_authority_types.ClassProp) | undefined) => string;
46
89
  interface PageShellSummaryCardProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof pageShellSummaryCardVariants> {
47
90
  }
@@ -73,6 +116,8 @@ interface FilterConfig {
73
116
  options?: FilterOption[];
74
117
  /** Placeholder text */
75
118
  placeholder?: string;
119
+ /** `select` のみ。渡すと先頭に「絞り込まない」項目をこの文言で足す(例: `"すべて"`)。 */
120
+ allLabel?: string;
76
121
  /** Default value */
77
122
  defaultValue?: string | string[];
78
123
  }
@@ -155,6 +200,187 @@ interface SelectOptionGroup {
155
200
  type SelectOptions = SelectOption[] | SelectOptionGroup[];
156
201
  declare function isGroupedOptions(options: SelectOptions): options is SelectOptionGroup[];
157
202
  declare function flattenOptions(options: SelectOptions): SelectOption[];
203
+ /**
204
+ * A chart colour: one of the theme's series tokens (`"chart-1"`〜`"chart-5"`,
205
+ * which follow light/dark) or any CSS colour (`"#16a34a"`, `"var(--destructive)"`).
206
+ * Not a Tailwind class — the ECharts-based charts paint on a canvas.
207
+ */
208
+ type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | (string & {});
209
+ /** Formats a value for tooltips, axes and labels (e.g. `(v) => \`¥${v.toLocaleString()}\``). */
210
+ type ValueFormatter = (value: number) => string;
211
+ /** What a typed chart reports through `onValueChange`; `null` when the selection is cleared. */
212
+ type ChartEventPayload = {
213
+ /** What was clicked: a bar, a line/area point, or a donut slice. */
214
+ eventType: "bar" | "dot" | "slice";
215
+ /** The series (`categories` entry) or slice name that was clicked. */
216
+ categoryClicked: string;
217
+ /** The clicked row of `data`, spread in. */
218
+ [key: string]: unknown;
219
+ } | null;
220
+ /** The theme's series tokens — the only colours a typed chart's `colors` accepts. Fixed order. */
221
+ type ChartColorToken = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5";
222
+ /**
223
+ * 意味色。`"positive"`(良い)・`"warning"`(注意)・`"negative"`(悪い)・`"neutral"`(中立)。
224
+ * テーマの `--positive` / `--warning` / `--negative` / `--neutral` に解決され、light/dark に追従する。
225
+ */
226
+ type ChartTone = "positive" | "warning" | "negative" | "neutral";
227
+ /** A typed chart's series colour: a series token or a meaning colour (`ChartTone`). */
228
+ type ChartSeriesColor = ChartColorToken | ChartTone;
229
+ /**
230
+ * Series colours for a typed chart: tokens / meaning colours by series position
231
+ * (cycled), or a record from category to colour (unlisted categories keep their
232
+ * positional token).
233
+ */
234
+ type ChartColors<T extends Record<string, unknown> = Record<string, unknown>> = ChartSeriesColor[] | Partial<Record<keyof T & string, ChartSeriesColor>>;
235
+ /**
236
+ * 値の範囲で棒・セルの色(意味色)を決める 1 つの規則。`lt`(未満)・`lte`(以下)・`gt`(より大きい)・`gte`(以上)を
237
+ * 1 つ以上書く。複数書いたら全部を満たす値だけが当たる(`gte: 40, lt: 70` なら `40 <= 値 < 70`)。
238
+ * 規則は配列の上から順に見て、**最初に当たった規則**の意味色になる(どれにも当たらない値は通常色)。
239
+ * そのため厳しい規則(`gt: 10`)を先に、ゆるい規則(`gt: 7`)を後に書く。条件が 1 つも無い規則は当たらない。
240
+ * 例 `[{ gt: 10, tone: "negative" }, { gt: 7, tone: "warning" }]`(10 超は赤、7 超は黄)
241
+ */
242
+ interface ChartThreshold {
243
+ /** この値未満に当たる。 */
244
+ lt?: number;
245
+ /** この値以下に当たる。 */
246
+ lte?: number;
247
+ /** この値より大きいときに当たる(「10% 超で赤」)。 */
248
+ gt?: number;
249
+ /** この値以上に当たる。 */
250
+ gte?: number;
251
+ tone: ChartTone;
252
+ }
253
+ /** What an empty chart says instead of a blank plot. The frame keeps its height. */
254
+ interface ChartEmptyState {
255
+ /** 既定「表示できるデータがありません」。 */
256
+ title?: string;
257
+ description?: string;
258
+ /** 1 つだけ置ける操作(「期間を広げる」ボタンなど)。 */
259
+ action?: ReactNode;
260
+ }
261
+ /** `"auto"`: label the max and latest point of the first series (≤ 2 series only). */
262
+ type ChartHighlight = "auto" | "none";
263
+ /** A forecast row: the same `index` key as `data`, plus the predicted value and an optional range. */
264
+ type ChartForecastRow = Record<string, unknown> & {
265
+ value: number | null;
266
+ lower?: number;
267
+ upper?: number;
268
+ };
269
+ /**
270
+ * Forecast continuing one series (Line / Area). Always drawn as a 2px dashed, lighter
271
+ * line starting at the last actual point, with a boundary line labelled 「予測 →」
272
+ * (the same word as the legend) — there is no way to draw it solid.
273
+ */
274
+ interface ChartForecast<T extends Record<string, unknown> = Record<string, unknown>> {
275
+ /** 予測の行。`index` の列は実績と同じキーで持つ。 */
276
+ data: ChartForecastRow[];
277
+ /** 予測が続ける系列。既定 `categories[0]`(比較系列は除く)。 */
278
+ category?: keyof T & string;
279
+ /** 凡例・ツールチップ・境目の縦線の上端に出す名前。既定「予測」(境目では「予測 →」と矢印が付く)。 */
280
+ label?: string;
281
+ }
282
+ /**
283
+ * The series a Line / Area chart compares the others against (last year, the plan…): `category`
284
+ * is one of `categories`, `vs` says what it is (the same enum as `KpiCard`'s `comparison.vs`).
285
+ * It is drawn as a thin muted line with no markers and no `--chart-*` colour, and the tooltip adds
286
+ * the main series' difference from it ("↑ +12.4% 前年同月比"). Colour, width and wording are not props.
287
+ * With `vs: "custom"` the `label` names the baseline ("昨日比"); for the other `vs` it is optional.
288
+ */
289
+ type ChartComparison<K extends string = string> = {
290
+ category: K;
291
+ } & ({
292
+ vs: "prior-period" | "prior-year" | "target";
293
+ label?: string;
294
+ } | {
295
+ vs: "custom";
296
+ label: string;
297
+ });
298
+ /**
299
+ * 任意の位置への注記(折れ線・面・縦の棒)。`at` は `index` の値(例 `"2026-04"`)。`to` を足すと
300
+ * `at`〜`to` の区間(薄い帯)、無ければ `at` の位置の縦線。色は中立(意味色は使わない)で、
301
+ * `index` に無い値の注記は描かない。例 `{ at: "2026-04", label: "料金改定" }`、
302
+ * `{ at: "2026-08", to: "2026-09", label: "キャンペーン" }`
303
+ */
304
+ interface ChartAnnotation {
305
+ /** 注記の位置(区間なら始点)。`index` 列の値と同じ形で渡す。 */
306
+ at: string | number;
307
+ /** 注記の文言(短く。事実の記述だけ)。 */
308
+ label: string;
309
+ /** 区間の終点(`index` の値)。省略すると `at` の縦線。 */
310
+ to?: string | number;
311
+ }
312
+ /**
313
+ * `actions` に渡せる PNG 操作の設定。`actions={true}` は `{}` と同じ。
314
+ */
315
+ interface ChartActionsOptions {
316
+ /**
317
+ * 保存・コピーする PNG に、グラフの見出し(`title`)と要約(`summary`)を画像の上に含める。
318
+ * 見出しが無いグラフでは何も変わらない。既定 `true`(画像だけ切り出されても何のグラフか分かるように)。
319
+ * 図だけが欲しいときは `false`。
320
+ */
321
+ includeTitle?: boolean;
322
+ }
323
+ /**
324
+ * 型付きグラフのルート要素(`<figure>`)へ渡る属性。`data-*` と `aria-*` も渡る(型は不要)。
325
+ * 最小限だけ型に出す。`className` / `ariaLabel` は別に持つ。
326
+ */
327
+ type ChartRootAttributes = Pick<HTMLAttributes<HTMLElement>, "id" | "style" | "role" | "tabIndex" | "lang" | "hidden">;
328
+ /**
329
+ * Columns of `T` whose values are numbers (null / undefined allowed for gaps).
330
+ * `categories` only accepts these, so a text column like `"month"` is a type error.
331
+ * Untyped rows (`unknown` / `any` values, e.g. `Record<string, unknown>`) keep every key.
332
+ */
333
+ type NumericKeys<T> = {
334
+ [K in keyof T]-?: unknown extends T[K] ? K : T[K] extends number | bigint | null | undefined ? K : never;
335
+ }[keyof T] & string;
336
+ /** Props every typed chart shares. Per-type differences live in `areaOptions` / `lineOptions` / `barOptions`. */
337
+ interface ChartCommonProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
338
+ /** 行の配列。1 行 = x 軸の 1 点。数値の列は number か数値文字列(SQL の DECIMAL など)。 */
339
+ data: T[];
340
+ /** x 軸(カテゴリ軸)に使う列名。 */
341
+ index: keyof T & string;
342
+ /** 系列として描く列名。並び順が凡例と配色の順になる。6 つ以上は合計の大きい 5 つ +「その他」にまとめる。 */
343
+ categories: NumericKeys<T>[];
344
+ /** 系列色(`"chart-1"`〜`"chart-5"` か意味色 `"positive"` / `"warning"` / `"negative"` / `"neutral"`)。配列は系列の順、record は系列名ごと。省略時はトークン順。 */
345
+ colors?: ChartColors<T>;
346
+ /**
347
+ * index の値・系列名 → 表示名(軸・凡例・ツールチップ・データ表に反映)。例 `{ jan: "1月", sales: "売上" }`。無いキーはそのまま。
348
+ */
349
+ labels?: Record<string, string>;
350
+ /**
351
+ * 数値の書式(`"compact"` / `"number"` / `"currency"` / `"percent"` / `"multiple"` / `"duration"`、
352
+ * または `{ type, digits, currency, notation, unit, divisor, durationUnit }`)。例 `format={{ type: "number", unit: "件" }}`。
353
+ * 軸は短縮、ツールチップも同じ書式。KPI 系の `format` と同じ値を渡せる。既定 `"compact"`。
354
+ */
355
+ format?: ValueFormat;
356
+ /** 書式を関数で直接渡す逃げ道。`format` より優先する(互換のために残す)。 */
357
+ valueFormatter?: ValueFormatter;
358
+ /** グラフの見出し。 */
359
+ title?: string;
360
+ /** グラフが言っていることの 1 文要約。見出しの下に出し、グラフの `aria-describedby` になる。 */
361
+ summary?: string;
362
+ /** 読み込み中。最終形と同じ形・高さのスケルトンを出す。 */
363
+ isLoading?: boolean;
364
+ /** `data` が空のときの表示。 */
365
+ emptyState?: ChartEmptyState;
366
+ /**
367
+ * プロット領域の高さ(px)。既定 288。
368
+ * 文字列(CSS の長さ)は互換のために受けるだけで非推奨 — 数値(px)で渡す。
369
+ */
370
+ height?: number | string;
371
+ /** 生成した EChartsOption に最後に深くマージする逃げ道。 */
372
+ chartOptions?: EChartsOption;
373
+ /**
374
+ * グラフ右上に PNG 保存/コピーのボタンを出す(ホバー時。凡例とは重ならない)。既定 `false`。
375
+ * 見出し(`title` / `summary`)があれば PNG の上に含める。含めないなら `actions={{ includeTitle: false }}`。
376
+ * 例: `actions`
377
+ */
378
+ actions?: boolean | ChartActionsOptions;
379
+ /** PNG 保存時のファイル名(拡張子つき)。`actions` と使う。既定 `"chart.png"`。例: `fileName="monthly-sales.png"` */
380
+ fileName?: string;
381
+ className?: string;
382
+ ariaLabel?: string;
383
+ }
158
384
 
159
385
  interface AppShellSidebarProps {
160
386
  variant?: "sidebar";
@@ -182,8 +408,8 @@ declare const AppShell: React.ForwardRefExoticComponent<AppShellProps & React.Re
182
408
 
183
409
  declare const headingStyles: {
184
410
  readonly h1: "text-3xl font-bold tracking-tight";
185
- readonly h2: "text-2xl font-semibold tracking-tight";
186
- readonly h3: "text-xl font-semibold";
411
+ readonly h2: "text-base font-semibold tracking-tight";
412
+ readonly h3: "text-base font-semibold";
187
413
  readonly h4: "text-lg font-semibold";
188
414
  };
189
415
  interface SectionHeaderProps {
@@ -196,6 +422,10 @@ interface SectionHeaderProps {
196
422
  declare const SectionHeader: React.ForwardRefExoticComponent<SectionHeaderProps & React.RefAttributes<HTMLDivElement>>;
197
423
 
198
424
  interface DashboardCardProps extends HTMLAttributes<HTMLDivElement> {
425
+ /** 親の grid の何行にまたがって subgrid で揃えるか(ヘッダー・本文・フッターなら 3、ヘッダー・本文なら 2)。未指定なら通常のブロック。 */
426
+ subgrid?: 2 | 3;
427
+ /** `"sm"` は一段小さい余白。Sheet の中などで 2 枚を横に並べるとき。既定 `"default"`。 */
428
+ size?: "default" | "sm";
199
429
  }
200
430
  declare const DashboardCard: React.ForwardRefExoticComponent<DashboardCardProps & React.RefAttributes<HTMLDivElement>>;
201
431
  interface DashboardCardHeaderProps extends HTMLAttributes<HTMLDivElement> {
@@ -220,7 +450,7 @@ interface DashboardCardSkeletonProps {
220
450
  className?: string;
221
451
  }
222
452
  declare function DashboardCardSkeleton({ className }: DashboardCardSkeletonProps): React.JSX.Element;
223
- interface DashboardCardPresetProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
453
+ interface DashboardCardPresetProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">, Pick<DashboardCardProps, "subgrid" | "size"> {
224
454
  title?: ReactNode;
225
455
  description?: ReactNode;
226
456
  actions?: ReactNode;
@@ -229,7 +459,7 @@ interface DashboardCardPresetProps extends Omit<HTMLAttributes<HTMLDivElement>,
229
459
  contentClassName?: string;
230
460
  footerClassName?: string;
231
461
  }
232
- declare function DashboardCardPreset({ title, description, actions, footer, children, headerClassName, contentClassName, footerClassName, className, ...props }: DashboardCardPresetProps): React.JSX.Element;
462
+ declare function DashboardCardPreset({ title, description, actions, footer, children, headerClassName, contentClassName, footerClassName, className, subgrid, ...props }: DashboardCardPresetProps): React.JSX.Element;
233
463
 
234
464
  interface EChartProps {
235
465
  /**
@@ -240,7 +470,7 @@ interface EChartProps {
240
470
  * literal が `string` に拡張され、ビルドが失敗する。
241
471
  *
242
472
  * @example
243
- * import type { EChartsOption } from "@squadbase/vantage/components"
473
+ * import type { EChartsOption } from "@/components/echart"
244
474
  *
245
475
  * const option: EChartsOption = {
246
476
  * xAxis: { type: "category", data: ["A", "B"] },
@@ -271,19 +501,899 @@ interface EChartProps {
271
501
  onEvents?: Record<string, (params: unknown) => void>;
272
502
  ariaLabel?: string;
273
503
  className?: string;
274
- /** true にするとチャート右上に PNG コピー / ダウンロードボタンを表示する */
275
- actions?: boolean;
504
+ /**
505
+ * true にするとチャート右上に PNG コピー / ダウンロードボタンを表示する。
506
+ * `exportHeader` があれば PNG の上にその見出しを含める(`{ includeTitle: false }` で含めない)。
507
+ */
508
+ actions?: boolean | ChartActionsOptions;
276
509
  /** ダウンロード時のファイル名(拡張子含む)。省略時は "chart.png" */
277
510
  fileName?: string;
511
+ /**
512
+ * PNG の上に含める見出しと要約。型付きグラフは自分の `title` / `summary` を渡す。
513
+ * 自分で `ChartFrame` を組むときも同じものを渡すと、保存した画像だけで何のグラフか分かる。
514
+ */
515
+ exportHeader?: ChartExportHeader;
516
+ }
517
+ /** The heading a saved PNG carries above the plot. */
518
+ interface ChartExportHeader {
519
+ title?: string;
520
+ summary?: string;
278
521
  }
522
+ /**
523
+ * Canvas-safe versions of theme colours, kept current across light/dark.
524
+ * Takes `"chart-1"`〜`"chart-5"`, `"var(--token)"` or any CSS colour; one that
525
+ * can't be resolved comes back as `""` (ECharts then uses the palette).
526
+ * Use it whenever a colour goes into a raw `EChart` option by hand.
527
+ *
528
+ * @example
529
+ * const [line, band] = useResolvedChartColors(["chart-1", "var(--muted-foreground)"])
530
+ */
531
+ declare function useResolvedChartColors(colors: readonly string[]): string[];
279
532
  declare const EChart: React.ForwardRefExoticComponent<EChartProps & React.RefAttributes<HTMLDivElement>>;
280
533
 
534
+ /**
535
+ * Period-over-period / target comparison for KPIs. A rate is only produced when
536
+ * the baseline is a non-zero number; small moves inside the neutral band read
537
+ * as flat, and polarity decides whether up is good or bad.
538
+ *
539
+ * Labels come from the grain of the period, in the locale's language (`<html lang>` unless a
540
+ * `locale` is passed): a monthly KPI compares "vs. prior month" / "vs. same month last year"
541
+ * (ja: "前月比" / "前年同月比"), a quarterly one "前四半期比" / "前年同期比" in ja. Without a
542
+ * grain the label is the generic "vs. prior period" (ja: "前期比").
543
+ *
544
+ * A running total of a period still in progress (年初来・月初来 = YTD / MTD) sets
545
+ * `toDate: true`: a `prior-year` baseline is then the same stretch of the prior year,
546
+ * and the label is always "前年同期比" (never "前年比", which would mean a whole year
547
+ * against a whole year), whatever the grain.
548
+ *
549
+ * Any other baseline is `vs: "custom"` with a `label` ("昨日比"). The baseline of
550
+ * the previous-actual line is derived from that label ("昨日"), so the badge and
551
+ * the line never name different things.
552
+ */
553
+
554
+ type ComparisonKind = "prior-period" | "prior-year" | "target" | "custom";
555
+ /**
556
+ * 増減の良し悪しの向き。`"neutral"` は増減どちらでも sentiment を neutral にする(例: 在庫数)。
557
+ * @example polarity="neutral"
558
+ */
559
+ type Polarity = "higher-is-better" | "lower-is-better" | "neutral";
560
+ /** Length of the period a value covers. */
561
+ type PeriodGrain = "day" | "week" | "month" | "quarter" | "year";
562
+ interface ComparisonBase {
563
+ previous: number | null | undefined;
564
+ /** Grain of the period, which picks the label: `"month"` → "前月比" / "前年同月比". */
565
+ grain?: PeriodGrain;
566
+ /**
567
+ * The value is a running total of the period so far (年初来・月初来), not a closed period.
568
+ * With `vs: "prior-year"` the label is "前年同期比" (the same stretch of last year) whatever the `grain`.
569
+ * Leave it off for a closed period: a full year against the prior year is "前年比".
570
+ */
571
+ toDate?: boolean;
572
+ }
573
+ type Comparison = (ComparisonBase & {
574
+ vs: Exclude<ComparisonKind, "custom">;
575
+ /** The badge's full name ("先週比"). Overrides the derived label; the previous-actual line takes its name from it too. */
576
+ label?: string;
577
+ }) | (ComparisonBase & {
578
+ /** Any other baseline ("昨日", "先週の同じ曜日"): the `label` names it. */
579
+ vs: "custom";
580
+ /** The badge's full name: `"昨日比"` / `"先週の同じ曜日比"`. The previous-actual line drops one trailing "比" ("昨日 617"). */
581
+ label: string;
582
+ });
583
+ /**
584
+ * Labels used when the grain is unknown, in English (the fallback language). A `custom` comparison always brings
585
+ * its own `label`. The parts pick the language from `<html lang>` (`comparisonLabel`): ja reads "前期比" / "前年同期比" / "目標比".
586
+ */
587
+ declare const COMPARISON_LABELS: Record<Exclude<ComparisonKind, "custom">, string>;
588
+ /**
589
+ * What the previous value is called: "prior month" / "same month last year" / "target" (ja: "前月" / "前年同月" / "目標");
590
+ * with a `label`, that label minus its comparison word ("昨日比" → "昨日", "vs. yesterday" → "yesterday").
591
+ * `toDate` (a running total such as YTD) turns a `prior-year` baseline into "same period last year" (ja: "前年同期") whatever the grain.
592
+ * `locale` picks the language; default the page's (`<html lang>`).
593
+ */
594
+ declare function comparisonBaseline(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean, locale?: string): string;
595
+ /**
596
+ * The comparison label: "vs. prior month" (ja: "前月比") for `("prior-period", "month")`, "vs. prior period" (ja: "前期比")
597
+ * without a grain; a given `label` as is. A running total (`toDate`) against the prior year is "vs. same period last year"
598
+ * (ja: "前年同期比"), not "vs. prior year" (ja: "前年比"). `locale` picks the language; default the page's (`<html lang>`).
599
+ */
600
+ declare function comparisonLabel(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean, locale?: string): string;
601
+ type DeltaDirection = "up" | "down" | "flat" | "none";
602
+ type DeltaSentiment = "positive" | "negative" | "neutral";
603
+ interface ComparisonResult {
604
+ current: number | null;
605
+ previous: number | null;
606
+ /** `current − previous` in the metric's own unit (a ratio difference for a rate). `null` when either is missing. */
607
+ difference: number | null;
608
+ /** `difference / |previous|`. `null` when it cannot be computed (missing values or a zero baseline). */
609
+ ratio: number | null;
610
+ direction: DeltaDirection;
611
+ sentiment: DeltaSentiment;
612
+ label: string;
613
+ vs: ComparisonKind;
614
+ }
615
+ interface ComparisonOptions {
616
+ polarity?: Polarity;
617
+ /** Absolute ratio below which the change reads as flat (0.01 = 1%). Default 0.01. */
618
+ neutralBand?: number;
619
+ /** Locale of the derived `label`. Default the page's (`<html lang>`). */
620
+ locale?: string;
621
+ }
622
+ declare function computeComparison(current: number | null | undefined, comparison: Comparison, options?: ComparisonOptions): ComparisonResult;
623
+ /**
624
+ * How a change is expressed: `"relative"` = change rate ("+12.4%"), `"points"` =
625
+ * difference of two rates in percentage points ("−0.5pt"), `"difference"` =
626
+ * absolute difference in the metric's own format ("+¥530万"; pass `format` to `formatChange`).
627
+ */
628
+ type ChangeDisplay = "relative" | "points" | "difference";
629
+ /** `"points"` for a `percent` metric (a rate), else `"relative"`. */
630
+ declare function defaultChangeDisplay(format: ValueFormat | undefined): ChangeDisplay;
631
+ /**
632
+ * The change as shown next to a KPI: "+12.4%" (relative) or "−0.5pt" (points).
633
+ * Returns `null` when the values cannot be compared.
634
+ *
635
+ * @param digits - Fixed fraction digits of the change, for `"relative"` and `"points"`
636
+ * (not `"difference"`, which follows `format`). Default `PERCENT_DIGITS` (1), so
637
+ * "+14.0%" and "+11.9%" line up. Pass the same count to every card in a group.
638
+ */
639
+ declare function formatChange(result: ComparisonResult, display?: ChangeDisplay, locale?: string,
640
+ /** `"difference"` 表示で使う値の format。例: `"currency"`。 */
641
+ format?: ValueFormat,
642
+ /** `"relative"` / `"points"` 表示の小数桁数(固定)。例: `2` → "+0.14pt"。未指定は 1 桁。 */
643
+ digits?: number): string | null;
644
+ /**
645
+ * The size of the change with **no sign**, for a sentence or a screen-reader text that
646
+ * already says the direction with a verb ("0.5pt 下がりました", "前月比 12.4% 減少"): a signed
647
+ * "−0.5pt 下がりました" negates twice. Same arguments as `formatChange`; `null` when the
648
+ * values cannot be compared.
649
+ */
650
+ declare function formatChangeAmount(result: ComparisonResult, display?: ChangeDisplay, locale?: string, format?: ValueFormat, digits?: number): string | null;
651
+ /**
652
+ * The tone of the first threshold rule `value` falls in, or `undefined` (a value
653
+ * no rule matches keeps the normal colour). A rule matches when every bound it
654
+ * carries holds: `value < lt`, `value <= lte`, `value > gt`, `value >= gte`
655
+ * (`gt` / `lte` are the strict-inclusive counterparts, so「10% 超」is `gt: 10`).
656
+ * Rules are tried in array order and the first match wins — put the strict rule
657
+ * first (`gt: 10` before `gt: 7`). A rule with no bound never matches. Gaps (`null`) match nothing.
658
+ */
659
+ declare function toneForValue(value: number | null | undefined, thresholds: readonly ChartThreshold[] | undefined): ChartTone | undefined;
660
+
661
+ /**
662
+ * ECharts option builders behind the typed charts (AreaChart, BarChart,
663
+ * LineChart, DonutChart). They turn the Tremor-style props — `data` rows, an
664
+ * `index` key and `categories` — into an `EChartsOption` for `EChart`, which
665
+ * keeps owning the canvas and the token theme.
666
+ *
667
+ * Pure functions of their input: colours arrive already resolved to
668
+ * canvas-safe strings (`resolveChartColors` in `chart-theme.ts`), so everything
669
+ * here is unit-testable without a DOM. Internal; inlined into each copy.
670
+ */
671
+
672
+ type CartesianStackType = "default" | "stacked" | "percent";
673
+ type CartesianCurveType = "linear" | "smooth" | "step";
674
+ type AreaFill = "gradient" | "solid" | "none";
675
+ type BarLayout = "horizontal" | "vertical";
676
+ /** AreaChart-only settings. */
677
+ interface AreaChartOptions {
678
+ /** `"stacked"` は積み上げ、`"percent"` は各点の合計を 100% にした積み上げ。既定 `"default"`。 */
679
+ type?: CartesianStackType;
680
+ /** 線の形。既定 `"linear"`。 */
681
+ curveType?: CartesianCurveType;
682
+ /** 面の塗り。既定 `"gradient"`。 */
683
+ fill?: AreaFill;
684
+ /** 値の欠けた点(`null` など)をまたいで線をつなぐ。既定 `false`。 */
685
+ connectNulls?: boolean;
686
+ }
687
+ /** LineChart-only settings. */
688
+ interface LineChartOptions {
689
+ /** 線の形。既定 `"linear"`。 */
690
+ curveType?: CartesianCurveType;
691
+ /** 値の欠けた点(`null` など)をまたいで線をつなぐ。既定 `false`。 */
692
+ connectNulls?: boolean;
693
+ /** 値軸を 0 からではなくデータの範囲に合わせる。既定 `false`(0 起点)。最小の目盛ラベルは先頭の x ラベルと重なるので出さない(グリッド線は残る)。 */
694
+ fitToData?: boolean;
695
+ /**
696
+ * 目標線(`target`)のラベルの置き場所。`"start"`(既定)は線の左端の上(最大・最新の強調と近いときは下)。
697
+ * `"end"` は線の右端の上。`"legend"` は凡例だけに出し、線の上には出さない(線の周りが混み合うとき)。
698
+ * 目標の呼び名は、どれを選んでも凡例に出る。
699
+ */
700
+ targetLabelPosition?: LineTargetLabelPosition;
701
+ }
702
+ /** Where a line chart prints its target label: at the line's left end, its right end, or in the legend only. */
703
+ type LineTargetLabelPosition = "start" | "end" | "legend";
704
+ /** BarChart-only settings. */
705
+ interface BarChartOptions<T extends Record<string, unknown> = Record<string, unknown>> {
706
+ /** `"stacked"` は積み上げ、`"percent"` は各カテゴリの合計を 100% にした積み上げ。既定 `"default"`(横並び)。 */
707
+ type?: CartesianStackType;
708
+ /**
709
+ * 棒の向き。既定 `"horizontal"`(カテゴリが横に並ぶ縦棒)。`"vertical"` はカテゴリを
710
+ * 縦に並べた横棒で、ラベルの長いランキングに向く(先頭の行が一番上)。
711
+ */
712
+ layout?: BarLayout;
713
+ /** カテゴリ間の隙間(`"20%"` や px)。省略時は ECharts の既定。 */
714
+ barCategoryGap?: string | number;
715
+ /**
716
+ * 値が 0 の棒に「0」の値ラベルを付ける。棒が描かれない 0 が「データなし」に見えるのを防ぐ
717
+ * (在庫 0・件数 0 など)。積み上げでは付けない。0 以外の棒の見た目は変わらない。既定 `true`。
718
+ */
719
+ showZeroValues?: boolean;
720
+ /**
721
+ * 棒ごとの目標値が入った `data` の列名(行ごとの目標。店舗別の月次目標など)。各棒に短い目標マーカーを
722
+ * 引き、ツールチップに「目標 … (達成率 …%)」を足す。凡例に目標の呼び名(`targetLabel`、既定「目標」)が出る。
723
+ * 1 系列の棒と積み上げ(達成率は合計に対して)で使える。横並びの複数系列と 100% 積み上げでは描かない。
724
+ * 値が欠けた(null・0 以下の)行はマーカーを引かない。
725
+ *
726
+ * 優先順位: `targetKey` を渡すと 1 本の目標線 `target` は描かない(`targetLabel` はマーカーの呼び名として使う)。
727
+ * 値による色分け `thresholds` とは併用できる(色は棒、マーカーは目標)。値軸は最大の目標を含む。
728
+ * 例: `barOptions={{ targetKey: "月次目標" }}`
729
+ */
730
+ targetKey?: NumericKeys<T>;
731
+ /**
732
+ * 横棒(`layout: "vertical"`)の 1 系列で伝えたい 1 本。`index` の値で渡す(例 `"東京店"`)。
733
+ * 横棒は淡い色(`--chart-1` の薄い塗り)が既定で、この 1 本だけ濃い色(系列色そのまま)になる。省略すると全部が淡い色。
734
+ * 縦棒・複数系列・積み上げでは効かない(色は変わらない)。意味色の `thresholds` に当たった棒はそちらの色が優先。
735
+ * 例: `barOptions={{ layout: "vertical", highlight: "東京店" }}`
736
+ */
737
+ highlight?: string | number;
738
+ }
739
+ /** Props every cartesian typed chart (Area / Bar / Line) shares. */
740
+ interface CartesianChartBaseProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartCommonProps<T> {
741
+ /**
742
+ * 最大値と最新値に値ラベルを付ける(最初の系列だけ・系列が 2 つ以下のときだけ・最大 2 つ)。
743
+ * 100% 積み上げの面グラフでは、最初の系列(一番下の帯)の最初と最新の比率(「24%」「31%」)を帯の中に付ける。
744
+ * 既定は Line / Area が `"auto"`、Bar は `index` が日付・年月・年のときだけ `"auto"`。
745
+ */
746
+ highlight?: ChartHighlight;
747
+ /**
748
+ * ここから先は確定前(速報)の点。index の値で渡す(例 `"2026-09"`)。薄い色・点線(棒は薄い塗りと破線の縁)で
749
+ * 描き、凡例・ツールチップに `provisionalLabel` を出す。線・面は確定の最終点とつなぐ。`forecast`(予測)とは別物。
750
+ * 例: `provisionalFrom="2026-09"`
751
+ */
752
+ provisionalFrom?: string | number;
753
+ /** 速報の呼び名(凡例・ツールチップ)。既定「速報」。例: `provisionalLabel="暫定"` */
754
+ provisionalLabel?: string;
755
+ /**
756
+ * グラフが言っていることの 1 文要約(自由文)。`"auto"` なら data から機械的に組む
757
+ * (「<見出し>: 最新 <index値> は <値>、前の点より増加/減少」。向きは最新 2 点の値で決まる)。
758
+ * 増減の向きを文に書くなら `"auto"` を使うか data から作る — 手書きの向きは data とずれて誤る。
759
+ * 省略時は要約なし(既存どおり)。例: `summary="auto"`
760
+ */
761
+ summary?: string | "auto";
762
+ /** 目標値。点線の水平線で示し、値軸は必ずこの値を含む。棒ごとの目標(`barOptions.targetKey`)を渡したときは描かない。 */
763
+ target?: number;
764
+ /** 目標線のラベル。既定「目標 <書式化した値>」。`barOptions.targetKey` のときはマーカーの呼び名(既定「目標」)。 */
765
+ targetLabel?: string;
766
+ /**
767
+ * 任意の位置への注記(縦の線、または `to` で区間の帯)。折れ線・面・縦の棒(`barOptions.layout` が既定のとき)で使え、
768
+ * 横棒では描かない。`at` / `to` は `index` の値。色は中立で、ツールチップにも文言が出る。例:
769
+ * `annotations={[{ at: "2026-04", label: "料金改定" }, { at: "2026-08", to: "2026-09", label: "キャンペーン" }]}`
770
+ */
771
+ annotations?: ChartAnnotation[];
772
+ /** 凡例を出す。既定 `true`。 */
773
+ showLegend?: boolean;
774
+ /** ホバー時のツールチップを出す。既定 `true`。 */
775
+ showTooltip?: boolean;
776
+ /** 値軸の目盛り線を出す。既定 `true`。 */
777
+ showGridLines?: boolean;
778
+ showXAxis?: boolean;
779
+ showYAxis?: boolean;
780
+ /** x 軸のラベルを最初と最後だけにする。 */
781
+ startEndOnly?: boolean;
782
+ /** y 軸ラベルの幅(px)。並べた複数グラフのプロット領域を揃えたいときに固定する。 */
783
+ yAxisWidth?: number;
784
+ /**
785
+ * 値軸の下限。Bar / Area は常に 0 起点なので、0 以下の値だけ有効(負の値の下に余白を取る。正の値は無視)。
786
+ * Line は指定した値から始める。データが下限を下回るときは軸を広げる(切り詰めない)。
787
+ * 並べて比べる複数のグラフには同じ値を渡して軸をそろえる。
788
+ */
789
+ minValue?: number;
790
+ /**
791
+ * 値軸の上限(横棒は横軸)。データが上限を超えるときは軸を広げる(切り詰めない)。
792
+ * 並べて比べる複数のグラフには同じ値を渡して軸をそろえる。
793
+ */
794
+ maxValue?: number;
795
+ /** @deprecated `lineOptions.fitToData` を使う。Bar / Area では無視される(常に 0 起点)。 */
796
+ autoMinValue?: boolean;
797
+ /** `false` で値軸の目盛りを整数に限る。 */
798
+ allowDecimals?: boolean;
799
+ xAxisLabel?: string;
800
+ yAxisLabel?: string;
801
+ /**
802
+ * 点(棒)のクリックで呼ばれる。クリックした行に `eventType` / `categoryClicked` を
803
+ * 足して渡し、同じ点をもう一度クリックすると `null`。渡すと選択以外が薄くなる。
804
+ */
805
+ onValueChange?: (value: ChartEventPayload) => void;
806
+ /** @deprecated `isLoading` を使う。 */
807
+ loading?: boolean;
808
+ }
809
+ type DonutVariant = "donut" | "pie";
810
+ /** What the donut prints in its hole (`donutOptions.centerLabel`). */
811
+ type DonutCenterLabel = "none" | "total" | "top";
812
+ /** DonutChart-only settings. */
813
+ interface DonutChartOptions {
814
+ /** `"donut"`(中央に穴とラベル)か `"pie"`。既定 `"donut"`。 */
815
+ variant?: DonutVariant;
816
+ /** @deprecated `centerLabel` を使う。`false` は `centerLabel: "none"` と同じ。`true` を明示すると `"total"` 扱い(以前の既定)。 */
817
+ showLabel?: boolean;
818
+ /**
819
+ * 穴の中央に出すもの。`"none"`(既定。何も出さない。合計は KPI と重複しがち)/ `"total"`(「合計」と
820
+ * 合計を書式化した値。`totalLabel` / `unit` を添える)/ `"top"`(最大の切片の名前と構成比)。
821
+ * それ以外のノードを渡すとそのまま中央に置く。donut のみ。
822
+ */
823
+ centerLabel?: DonutCenterLabel | ReactNode;
824
+ /** 中央ラベルの見出し(何の合計か)。既定「合計」。 */
825
+ totalLabel?: string;
826
+ /** 中央ラベルの合計に添える単位(`"セッション"` → 「9.2万 セッション」)。 */
827
+ unit?: string;
828
+ /** 凡例(名前と構成比、大きい順)を出す。広いときは右、狭いときは下。既定 `true`。構成比は凡例だけが持つ(凡例を消すと、広いときだけ大きい 2 切片に外ラベルで名前と構成比が出る)。 */
829
+ showLegend?: boolean;
830
+ /** 個別に描く切片の数。超えた分は大きさ順の残りを「その他」1 切片にまとめる。既定 5。 */
831
+ maxSlices?: number;
832
+ }
833
+
834
+ /**
835
+ * AreaChart — a typed area chart over `EChart`: pass rows, the x-axis key
836
+ * (`index`) and the series keys (`categories`) instead of an ECharts option.
837
+ * Colours are the `--chart-1..5` tokens in fixed order (more than 5 series fold
838
+ * into「その他」) and follow light/dark. The value axis always starts at 0.
839
+ * Renders inside `ChartFrame` (title, summary, loading skeleton, empty state).
840
+ * Reach for `chartOptions` — or `EChart` itself — only when this API lacks something.
841
+ */
842
+
843
+ interface AreaChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends CartesianChartBaseProps<T> {
844
+ /** 面グラフ固有の設定(積み上げ・線の形・塗り・欠損の扱い)。同名のフラットな props より優先。 */
845
+ areaOptions?: AreaChartOptions;
846
+ /** 予測。最初の系列(または `forecast.category`)の続きを点線と薄い帯で描く。 */
847
+ forecast?: ChartForecast<T>;
848
+ /**
849
+ * 比較系列。`categories` のうち 1 つを「前年」「計画」などの比較の線にする(`vs` は KpiCard と同じ語彙)。
850
+ * 比較系列は `--chart-*` を使わず、細い(1.5px)灰色の実線でマーカーなし・塗りなし。主系列の色は比較の有無で変わらない。
851
+ * ツールチップは最初の主系列の行に「↑ +12.4% 前年同月比」を添え、比較系列の行は値のみ。
852
+ * 例: `comparison={{ category: "前年", vs: "prior-year" }}`
853
+ */
854
+ comparison?: ChartComparison<NumericKeys<T>>;
855
+ /** @deprecated `areaOptions.type` を使う。 */
856
+ type?: CartesianStackType;
857
+ /** @deprecated `areaOptions.curveType` を使う。 */
858
+ curveType?: CartesianCurveType;
859
+ /** @deprecated `areaOptions.fill` を使う。 */
860
+ fill?: AreaFill;
861
+ /** @deprecated `areaOptions.connectNulls` を使う。 */
862
+ connectNulls?: boolean;
863
+ }
864
+ /** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
865
+ declare const AreaChart: (<T extends Record<string, unknown>>(props: AreaChartProps<T> & {
866
+ ref?: Ref<HTMLDivElement>;
867
+ }) => ReactElement) & {
868
+ displayName?: string;
869
+ };
870
+
871
+ /**
872
+ * BarChart — a typed bar chart over `EChart`: pass rows, the category key
873
+ * (`index`) and the series keys (`categories`) instead of an ECharts option.
874
+ * Grouped, stacked or 100%-stacked; vertical or horizontal bars. Colours are the
875
+ * `--chart-1..5` tokens in fixed order (more than 5 series fold into「その他」)
876
+ * and follow light/dark. The value axis always starts at 0. A horizontal bar chart of one
877
+ * series (`barOptions.layout: "vertical"`) is a light tint by default, like BarList; `barOptions.highlight`
878
+ * names the one bar the page is about, drawn in the full colour.
879
+ * Renders inside `ChartFrame` (title, summary, loading skeleton, empty state).
880
+ * Reach for `chartOptions` — or `EChart` itself — only when this API lacks something.
881
+ */
882
+
883
+ interface BarChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends CartesianChartBaseProps<T> {
884
+ /** 棒グラフ固有の設定(積み上げ・向き・カテゴリ間の隙間)。同名のフラットな props より優先。予測は持たない。 */
885
+ barOptions?: BarChartOptions<T>;
886
+ /**
887
+ * 棒を値で色分けする(上から順に最初に当たった規則の意味色。棒の面なので文字用の `--<tone>` ではなく面用の `--<tone>-fill` で塗る。どれにも当たらない棒は通常色)。
888
+ * 規則は `lt`(未満)・`lte`(以下)・`gt`(より大きい)・`gte`(以上)。複数系列(横並び)では系列ごとの棒に効き、当たった棒は意味色で塗って縁に系列色を残す(凡例と結べる)。
889
+ * 積み上げでは無視(一部分の値は良し悪しを判定する量ではないため。系列色のまま)。
890
+ * 例 `[{ gt: 2, tone: "negative" }, { gt: 1.5, tone: "warning" }]`(2 超は赤、1.5 超は黄)
891
+ */
892
+ thresholds?: ChartThreshold[];
893
+ /** @deprecated `barOptions.type` を使う。 */
894
+ type?: CartesianStackType;
895
+ /** @deprecated `barOptions.layout` を使う。 */
896
+ layout?: BarLayout;
897
+ /** @deprecated `barOptions.barCategoryGap` を使う。 */
898
+ barCategoryGap?: string | number;
899
+ }
900
+ /** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
901
+ declare const BarChart: (<T extends Record<string, unknown>>(props: BarChartProps<T> & {
902
+ ref?: Ref<HTMLDivElement>;
903
+ }) => ReactElement) & {
904
+ displayName?: string;
905
+ };
906
+
907
+ /**
908
+ * LineChart — a typed line chart over `EChart`: pass rows, the x-axis key
909
+ * (`index`) and the series keys (`categories`) instead of an ECharts option.
910
+ * Colours are the `--chart-1..5` tokens in fixed order (more than 5 series fold
911
+ * into「その他」) and follow light/dark. The value axis starts at 0 unless
912
+ * `lineOptions.fitToData`.
913
+ * Renders inside `ChartFrame` (title, summary, loading skeleton, empty state).
914
+ * Reach for `chartOptions` — or `EChart` itself — only when this API lacks something.
915
+ */
916
+
917
+ interface LineChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends CartesianChartBaseProps<T> {
918
+ /** 折れ線固有の設定(線の形・欠損の扱い・値軸をデータに合わせるか・目標ラベルの位置 `targetLabelPosition`)。同名のフラットな props より優先。 */
919
+ lineOptions?: LineChartOptions;
920
+ /** 予測。最初の系列(または `forecast.category`)の続きを点線と薄い帯で描く。 */
921
+ forecast?: ChartForecast<T>;
922
+ /**
923
+ * 比較系列。`categories` のうち 1 つを「前年」「計画」などの比較の線にする(`vs` は KpiCard と同じ語彙)。
924
+ * 比較系列は `--chart-*` を使わず、細い(1.5px)灰色の実線でマーカーなし。主系列の色は比較の有無で変わらない。
925
+ * ツールチップは最初の主系列の行に「↑ +12.4% 前年同月比」を添え、比較系列の行は値のみ。
926
+ * 例: `comparison={{ category: "前年", vs: "prior-year" }}`
927
+ */
928
+ comparison?: ChartComparison<NumericKeys<T>>;
929
+ /** @deprecated `lineOptions.curveType` を使う。 */
930
+ curveType?: CartesianCurveType;
931
+ /** @deprecated `lineOptions.connectNulls` を使う。 */
932
+ connectNulls?: boolean;
933
+ }
934
+ /** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
935
+ declare const LineChart: (<T extends Record<string, unknown>>(props: LineChartProps<T> & {
936
+ ref?: Ref<HTMLDivElement>;
937
+ }) => ReactElement) & {
938
+ displayName?: string;
939
+ };
940
+
941
+ /**
942
+ * DonutChart — a typed donut / pie chart over `EChart`: pass rows, the label
943
+ * key (`index`) and the value key (`categories: [valueKey]`). Slices are sorted
944
+ * largest first and coloured with the `--chart-1..5` tokens in fixed order;
945
+ * more than 5 fold into one「その他」slice. The hole is empty by default (the
946
+ * total usually repeats a KPI); `donutOptions.centerLabel` picks `"total"`
947
+ * (「合計」+ the formatted total, plus `unit`), `"top"` (the largest slice and its
948
+ * share) or a custom node — plain HTML over the canvas, so it takes the page's
949
+ * type and colours. A share is printed once: the HTML legend lists every slice
950
+ * with its share, right of the ring when there is room, below it otherwise, and
951
+ * with the legend there are no outside labels (without it, a plot at least
952
+ * `DONUT_OUTSIDE_LABEL_MIN_WIDTH` wide labels its 2 largest slices).
953
+ * Renders inside `ChartFrame` (title, summary, loading skeleton, empty state,
954
+ * and a visually-hidden table of the slices).
955
+ */
956
+
957
+ interface DonutChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors"> {
958
+ /** 切片の名前に使う列名。 */
959
+ index?: keyof T & string;
960
+ /** 切片の大きさに使う列名を 1 つだけ入れた配列(`["売上"]`)。2 つ以上渡しても最初の 1 つだけを使う。 */
961
+ categories?: (keyof T & string)[];
962
+ /** 切片の色(大きい順)。`"chart-1"`〜`"chart-5"` か意味色(`"positive"` など。面用の `--<tone>-fill` で塗る)。省略時はトークン順。「その他」は常に灰色。 */
963
+ colors?: ChartSeriesColor[];
964
+ /** 切片の名前(`index` の値)→ 表示名。凡例・ツールチップ・外ラベル・データ表に反映。例 `{ organic: "自然検索" }`。無いキーはそのまま。データ表の列名を直すには、`index` と値のキーも渡す(`{ source: "流入元", sessions: "セッション" }`。既定は「項目」「値」)。 */
965
+ labels?: Record<string, string>;
966
+ /** ドーナツ固有の設定(形・中央に出すもの `centerLabel`・凡例・切片の上限)。同名のフラットな props より優先。 */
967
+ donutOptions?: DonutChartOptions;
968
+ /**
969
+ * グラフが言っていることの 1 文要約(自由文)。`"auto"` なら slices から「<見出し>: 最大は <名前>(<構成比>)」を組む。
970
+ * 順位や構成比を文に書くなら `"auto"` を使うか data から作る。省略時は要約なし。例: `summary="auto"`
971
+ */
972
+ summary?: string | "auto";
973
+ showTooltip?: boolean;
974
+ /** 切片のクリックで呼ばれる。同じ切片をもう一度クリックすると `null`。渡すと選択以外が薄くなる。 */
975
+ onValueChange?: (value: ChartEventPayload) => void;
976
+ /** @deprecated `index` を使う。 */
977
+ category?: keyof T & string;
978
+ /** @deprecated `categories={[value]}` を使う。 */
979
+ value?: keyof T & string;
980
+ /** @deprecated `donutOptions.variant` を使う。 */
981
+ variant?: DonutVariant;
982
+ /** @deprecated `donutOptions.centerLabel` を使う。 */
983
+ label?: ReactNode;
984
+ /** @deprecated `donutOptions.centerLabel`(`"none"` で消す)を使う。 */
985
+ showLabel?: boolean;
986
+ /** @deprecated `isLoading` を使う。 */
987
+ loading?: boolean;
988
+ }
989
+ /** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
990
+ declare const DonutChart: (<T extends Record<string, unknown>>(props: DonutChartProps<T> & {
991
+ ref?: Ref<HTMLDivElement>;
992
+ }) => ReactElement) & {
993
+ displayName?: string;
994
+ };
995
+
996
+ /**
997
+ * Chart helpers shared by the typed charts — colour tokens, number handling and
998
+ * the layout maths of the Tailwind/SVG charts (BarList, CategoryBar,
999
+ * ProgressCircle, Tracker). Pure and DOM-free, so it can be unit-tested; kept
1000
+ * internal and inlined into each `vantage add ui` copy.
1001
+ */
1002
+
1003
+ type BarListSortOrder = "ascending" | "descending" | "none";
1004
+ /** BarList-only settings. */
1005
+ interface BarListOptions {
1006
+ /** 並べ順。既定 `"descending"`(大きい順)。`"none"` は渡した順。「その他」は常に最後。 */
1007
+ sortOrder?: BarListSortOrder;
1008
+ /** 個別に出す行の数。超えた分は合計して「その他」の 1 行にまとめる。既定 5。 */
1009
+ maxItems?: number;
1010
+ /** まとめた行のラベル。既定「その他」。 */
1011
+ otherLabel?: string;
1012
+ /** 順位に入れず、常に「その他」へ足す行の名前。例 `["(not set)", "Unassigned"]`。 */
1013
+ exclude?: readonly string[];
1014
+ /** 値の横に構成比(「その他」も含めた全行の合計に対する割合。整数 %)を添える。例「¥8,240万 · 43%」。既定 `false`。 */
1015
+ showShare?: boolean;
1016
+ }
1017
+ /** The visually-hidden table `ChartFrame` renders next to the plot (`dataTable`). */
1018
+ interface ChartDataTable {
1019
+ /** 表の見出し(`<caption>`)。 */
1020
+ caption?: string;
1021
+ /** 列見出し。先頭がラベル列。 */
1022
+ columns: string[];
1023
+ /** 行。セルは書式済みの文字列。 */
1024
+ rows: string[][];
1025
+ }
1026
+
1027
+ /**
1028
+ * BarList — a ranked list of horizontal bars with the value at the end of each
1029
+ * row: top pages, sales by store, error counts by type. Plain HTML/CSS (no
1030
+ * ECharts), so it stays cheap inside cards and follows the theme natively.
1031
+ *
1032
+ * Pass rows plus the name key (`index`) and the value key (`categories: [valueKey]`),
1033
+ * or the legacy `{ name, value, href?, color? }` items. More than
1034
+ * `barListOptions.maxItems` (5) rows fold into one「その他」row; rows named in
1035
+ * `barListOptions.exclude` always do (outside the ranking). Every row is
1036
+ * painted the same light tint of the colour (rank is the bar's length; `highlight` names the one
1037
+ * row drawn in the full colour),「その他」
1038
+ * in the subdued other colour; `barListOptions.showShare` adds each row's share
1039
+ * of the total after its value (「¥8,240万 · 43%」). Always renders in `ChartFrame` (title, summary,
1040
+ * loading / empty states, a visually-hidden table); the list is as tall as its rows.
1041
+ */
1042
+
1043
+ interface BarListItem {
1044
+ /** React の key。省略時は `name`。 */
1045
+ key?: string;
1046
+ /** 行のラベル(バーの上に出る)。 */
1047
+ name: string;
1048
+ value: number;
1049
+ /** 渡すとラベルがリンクになる。 */
1050
+ href?: string;
1051
+ /** @deprecated この行だけ色を変える。`colors` を使う(行ごとの色は持たない)。 */
1052
+ color?: ChartColor;
1053
+ }
1054
+ interface BarListProps<T extends object = BarListItem> extends Omit<ComponentProps<"div">, "children" | "title" | "color">, Pick<ChartCommonProps, "format" | "valueFormatter" | "title" | "summary" | "isLoading" | "emptyState"> {
1055
+ /** 行の配列。`index` / `categories` を省くと `{ name, value, href? }` の形として読む。 */
1056
+ data: T[];
1057
+ /** 行の名前に使う列名。既定 `"name"`。 */
1058
+ index?: keyof T & string;
1059
+ /** 値に使う列名を 1 つだけ入れた配列(`["売上"]`)。最初の 1 つだけを使う。既定 `["value"]`。 */
1060
+ categories?: (keyof T & string)[];
1061
+ /** バーの色(`"chart-1"`〜`"chart-5"` か意味色、最初の 1 つだけを使う)。既定 `"chart-1"`。全行を同じ淡い色で塗る(順位はバーの長さで読む)。 */
1062
+ colors?: ChartSeriesColor | ChartSeriesColor[];
1063
+ /** 行の名前(`index` の値)→ 表示名。行のラベル・データ表に反映。例 `{ tokyo: "東京店" }`。無いキーはそのまま。データ表の列名を直すには、列のキーも渡す(`{ store: "店舗", sales: "売上" }`。既定は「項目」「値」)。 */
1064
+ labels?: Record<string, string>;
1065
+ /** 行の値で意味色に塗り分ける(最初に当たった規則。どれにも当たらない行は通常色)。例 `[{ lt: 40, tone: "negative" }, { lt: 70, tone: "warning" }]` */
1066
+ thresholds?: ChartThreshold[];
1067
+ /** 伝えたい 1 行。`index` の値(行の名前。例 `"東京店"`)で渡す。行は淡い色が既定で、この 1 行だけ濃い色(`colors` の色そのまま)になる。省略すると全部が淡い色。「その他」は選べない。 */
1068
+ highlight?: string;
1069
+ /** BarList 固有の設定(並べ順・行数の上限・「その他」のラベル・順位から外す行 `exclude`・値の横の構成比 `showShare`)。同名のフラットな props より優先。 */
1070
+ barListOptions?: BarListOptions;
1071
+ /** 渡すと行がボタンになり、クリックした行を受け取る(「その他」の行は押せない)。 */
1072
+ onValueChange?: (item: T) => void;
1073
+ /**
1074
+ * 行の並べ順(`"descending"` / `"ascending"` / `"none"`)。既定 `"descending"`。
1075
+ * @deprecated `barListOptions.sortOrder` を使う(両方あれば `barListOptions` が優先)。
1076
+ */
1077
+ sortOrder?: BarListSortOrder;
1078
+ /** @deprecated `colors` を使う。 */
1079
+ color?: ChartColor;
1080
+ /** @deprecated マウント時にバーを伸ばす。入場アニメーションは既定で持たない。 */
1081
+ showAnimation?: boolean;
1082
+ /** @deprecated `valueFormatter` か `format` を使う。 */
1083
+ formatValue?: (value: number) => string;
1084
+ ariaLabel?: string;
1085
+ }
1086
+ /** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
1087
+ declare const BarList: (<T extends object = BarListItem>(props: BarListProps<T> & {
1088
+ ref?: Ref<HTMLDivElement>;
1089
+ }) => ReactElement) & {
1090
+ displayName?: string;
1091
+ };
1092
+
1093
+ interface CategoryBarMarker {
1094
+ /** マーカーの位置(`values` の合計と同じ尺度)。 */
1095
+ value: number;
1096
+ /** ホバーで出す説明。 */
1097
+ tooltip?: string;
1098
+ /** 位置の変化をアニメーションする。既定 `false`(`prefers-reduced-motion` では常に無効)。 */
1099
+ showAnimation?: boolean;
1100
+ }
1101
+ interface CategoryBarProps extends Omit<ComponentProps<"div">, "children"> {
1102
+ /** 各区間の幅(相対値)。合計が 100 である必要はない。負の値は 0 扱い。 */
1103
+ values: number[];
1104
+ /** 区間の色(順に対応)。`"chart-1"`〜`"chart-5"`・意味色(`"positive"` など。面用の `--<tone>-fill` で塗る)・CSS カラー。省略時はトークン順。 */
1105
+ colors?: ChartColor[];
1106
+ marker?: CategoryBarMarker;
1107
+ /** バーの上に区切りの累計値を出す。既定 `true`。 */
1108
+ showLabels?: boolean;
1109
+ /**
1110
+ * 区切りの数値の書式(`"compact"` / `"currency"` / `{ type, currency }`)。他のグラフの
1111
+ * 軸と同じ短縮形で出す(`"currency"` → `¥780万`)。既定 `"compact"`。
1112
+ */
1113
+ format?: ValueFormat;
1114
+ /** 書式を関数で直接渡す逃げ道。`format` より優先する。 */
1115
+ valueFormatter?: ValueFormatter;
1116
+ }
1117
+ declare const CategoryBar: React.ForwardRefExoticComponent<Omit<CategoryBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
1118
+
1119
+ interface ProgressCircleProps extends ComponentProps<"div"> {
1120
+ /** 現在値。`0`〜`max` に丸める。 */
1121
+ value?: number;
1122
+ /** 満タンの値。既定 `100`。 */
1123
+ max?: number;
1124
+ /** 外側の半径(px)。既定 `32`(64px 四方)。 */
1125
+ radius?: number;
1126
+ /** 線の太さ(px)。既定 `6`。 */
1127
+ strokeWidth?: number;
1128
+ /** 色。`"chart-1"`〜`"chart-5"`・意味色(`"positive"` など。面用の `--<tone>-fill` で塗る)・CSS カラー。既定 `"chart-1"`。地のリングは同じ色を淡くしたもの。 */
1129
+ color?: ChartColor;
1130
+ /** マウント時と値の変化をアニメーションする。既定 `false`(`prefers-reduced-motion` では常に無効)。 */
1131
+ showAnimation?: boolean;
1132
+ }
1133
+ declare const ProgressCircle: React.ForwardRefExoticComponent<Omit<ProgressCircleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
1134
+
1135
+ interface TrackerBlock {
1136
+ /** React の key。省略時は位置。 */
1137
+ key?: string | number;
1138
+ /** ブロックの色。`"positive"` / `"negative"` / `"warning"` / `"info"`(面用の `--<tone>-fill`)、`"chart-1"`〜`"chart-5"`、CSS カラー。省略時は `defaultColor`。 */
1139
+ color?: ChartColor;
1140
+ /** ホバーで出す説明。日付と状態・件数を入れる(例: `"10/12 失敗 3 件"`)。ブロックの accessible name にもなる。 */
1141
+ tooltip?: string;
1142
+ }
1143
+ interface TrackerProps extends Omit<ComponentProps<"div">, "children"> {
1144
+ data: TrackerBlock[];
1145
+ /** `color` の無いブロックの色。既定は muted-foreground を淡くした灰色。 */
1146
+ defaultColor?: ChartColor;
1147
+ /** ホバー中のブロックを薄くする。既定 `true`。 */
1148
+ hoverEffect?: boolean;
1149
+ }
1150
+ declare const Tracker: React.ForwardRefExoticComponent<Omit<TrackerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
1151
+
1152
+ /**
1153
+ * WaterfallChart — a typed waterfall chart over `EChart`: pass the steps as rows,
1154
+ * the name key (`index`) and the amount key (`categories: [valueKey]`) instead of
1155
+ * an ECharts option. 売上 → 原価 → 粗利 の内訳、前期からの増減要因。
1156
+ *
1157
+ * Each row is a step that moves the running total by its value; rows named in
1158
+ * `totals` are totals — a bar from 0 to the running total (or to their own value
1159
+ * when they carry one). The bars are a stacked bar chart over a transparent base,
1160
+ * so the value axis always starts at 0. Increase / decrease bars use the
1161
+ * area tokens (`--positive-fill` / `--negative-fill`, swapped by `polarity`), totals are
1162
+ * `--chart-1`; every step also prints its signed amount (+ / -), so the colour is
1163
+ * never the only carrier of the direction. Missing values (null) draw no bar and read「—」.
1164
+ * `mode="delta"` draws only the moves: the axis is the cumulative change from 0 (the start),
1165
+ * totals are not bars (their numbers go in a note above the plot), so a small change against
1166
+ * a large total is not a hairline on a tall axis; the axis still starts at 0 and can go negative.
1167
+ * A closing「純増」bar (the net change, `--chart-1`, signed) is appended in `delta`. Value-axis ticks carry no "+" in
1168
+ * both modes; the sign is on the bar labels only.
1169
+ * Renders inside `ChartFrame` (title, summary, loading skeleton, empty state, and
1170
+ * a visually-hidden table of the steps).
1171
+ */
1172
+
1173
+ /**
1174
+ * `"total"`: 合計の段を 0 からの棒として描く(既定)。`"delta"`: 増減の段だけを描く(開始を 0 とした累計増減の軸)。
1175
+ */
1176
+ type WaterfallMode = "total" | "delta";
1177
+ interface WaterfallChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors" | "summary"> {
1178
+ /** 段の名前に使う列名。行の並びがそのままグラフの左から右の順。 */
1179
+ index: keyof T & string;
1180
+ /** 増減額(合計の行は合計値)の列名を 1 つだけ入れた配列(`["金額"]`)。2 つ以上渡しても最初の 1 つだけを使う。値は number か数値文字列。 */
1181
+ categories: NumericKeys<T>[];
1182
+ /**
1183
+ * 合計の段にする行の `index` の値(例 `["売上", "粗利"]`)。合計の段は 0 から累計まで届く棒で、色は `--chart-1`。
1184
+ * 合計の行の値が null なら直前までの累計になる(計算に任せるのが確実)。値があればその値が合計になり、以降の累計はそこから続く。
1185
+ * 最初の段が増減の行なら 0 から始まる。`mode="delta"` では棒にならず、先頭の行が「開始」、末尾の行が「終了」の注記になる。
1186
+ */
1187
+ totals?: string[];
1188
+ /**
1189
+ * 増えるのが良いか。`"higher-is-better"`(既定)は増加が `--positive-fill`・減少が `--negative-fill`(棒用の面のトークン)。
1190
+ * 解約数のように増えて悪い指標は `"lower-is-better"` で色が入れ替わる。`"neutral"` は増減とも `--neutral-fill`(符号は付く)。
1191
+ */
1192
+ polarity?: Polarity;
1193
+ /**
1194
+ * 描き方。`"total"`(既定)は合計の段を 0 からの棒で描く。
1195
+ * `"delta"` は開始を 0 とした累計増減の軸で増減の段だけを描き、`totals` の行は棒にせず、
1196
+ * 開始・終了の値は図の上の注記(と要約・データ表)に出し、末尾に「純増」棒(増減の合計。`--chart-1`、符号つき)を足す。値軸の目盛に `+` は付かない。合計に対して増減が小さい(目安: 総額の 5% 未満)ときに使う。
1197
+ * 軸は 0 起点のまま(累計が負になる段も 0 の下に描く)。例 `mode="delta"`
1198
+ */
1199
+ mode?: WaterfallMode;
1200
+ /** 段の名前(`index` の値)→ 表示名。軸・ツールチップ・データ表に反映。例 `{ cogs: "売上原価" }`。無いキーはそのまま。データ表の先頭列名を直すには `index` のキーも渡す(既定は「項目」)。 */
1201
+ labels?: Record<string, string>;
1202
+ /**
1203
+ * 縦軸の下限。軸は常に 0 を含むので、0 以下の値だけ有効(累計が負になる段の下に余白を取る。正の値は無視)。
1204
+ * データが下限を下回るときは軸を広げる(切り詰めない)。`mode="total"` / `"delta"` の両方で効く。
1205
+ * 部署別などを並べて比べるときは、全部のグラフに同じ `minValue` / `maxValue` を渡して縦軸をそろえる。
1206
+ */
1207
+ minValue?: number;
1208
+ /**
1209
+ * 縦軸の上限。データが上限を超えるときは軸を広げる(切り詰めない)。`mode="total"` / `"delta"` の両方で効く。
1210
+ * 並べて比べるときは、全部のグラフに同じ `minValue` / `maxValue` を渡して縦軸をそろえる。
1211
+ */
1212
+ maxValue?: number;
1213
+ /** y 軸ラベルの幅(px)。並べた複数グラフのプロット領域を揃えたいときに固定する。 */
1214
+ yAxisWidth?: number;
1215
+ /** 各棒に符号つきの増減額(合計は累計)を書く。既定 `true`。 */
1216
+ showValues?: boolean;
1217
+ /** ホバー時のツールチップ(増減と累計)を出す。既定 `true`。 */
1218
+ showTooltip?: boolean;
1219
+ /**
1220
+ * グラフが言っていることの 1 文要約(自由文)。`"auto"` なら steps から「<見出し>: <最初> <値> → <最後> <値>。最大の増加は …、最大の減少は …」を組む(`mode="delta"` は「<開始> <値> → <終了> <値>(<増減>)」)。
1221
+ * 省略時は要約なし。例: `summary="auto"`
1222
+ */
1223
+ summary?: string | "auto";
1224
+ /** 見出しが無いときのプロット領域の読み上げ名。省略時は「<金額の列>のウォーターフォールチャート」。 */
1225
+ ariaLabel?: string;
1226
+ }
1227
+ /** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
1228
+ declare const WaterfallChart: (<T extends Record<string, unknown>>(props: WaterfallChartProps<T> & {
1229
+ ref?: Ref<HTMLDivElement>;
1230
+ }) => ReactElement) & {
1231
+ displayName?: string;
1232
+ };
1233
+
1234
+ /**
1235
+ * ScatterChart — a typed scatter / bubble chart over `EChart`: pass rows and the
1236
+ * two numeric column keys for the axes (`x` / `y`) instead of an ECharts option.
1237
+ * 広告費 × 売上、客単価 × 購入頻度 のように 2 つの数値の関係と外れ値を見る。
1238
+ *
1239
+ * `size` turns the dots into bubbles (area proportional to the value, from 0),
1240
+ * `series` splits the dots into series coloured with the `--chart-1..5` tokens in
1241
+ * fixed order (more than 5 fold into one grey「その他」series), `index` names each
1242
+ * dot in the tooltip. Both axes fit the data by default — a scatter is read by
1243
+ * position, not by length, so it does not start at 0 (`fitToData={false}` does).
1244
+ * Rows whose x or y is missing are left out. `labelKey` prints each dot's name beside it (dots whose
1245
+ * labels would collide are thinned, never overprinted; on a narrow plot (under 480px) only the 2 highest dots are
1246
+ * named, each label turned inward so it stays inside the plot, the legend moves under the plot and the y axis carries
1247
+ * 3 intervals), `referenceLines` draws neutral guide lines at
1248
+ * fixed x / y values, `highlight` brings some series forward and fades the rest. Renders inside `ChartFrame` (title,
1249
+ * summary, loading skeleton, empty state, and a visually-hidden table of the dots).
1250
+ */
1251
+
1252
+ /** 散布図に引く基準線 1 本(`x` なら縦線、`y` なら横線)。中立色の破線で、点の色とは混ざらない。 */
1253
+ interface ScatterReferenceLine {
1254
+ /** `"x"` は横軸の値に縦線、`"y"` は縦軸の値に横線を引く。 */
1255
+ axis: "x" | "y";
1256
+ /** 線を引く位置(軸の値そのまま。`format` が percent の列でも、列と同じ単位の数値を渡す)。軸の範囲に収まらないときは軸が線まで広がる。 */
1257
+ value: number;
1258
+ /** 線の脇に書く短い名前(「目標 25%」)。省略すると線だけ。 */
1259
+ label?: string;
1260
+ }
1261
+ interface ScatterChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors" | "summary" | "labels" | "format" | "valueFormatter"> {
1262
+ /** 行の配列。1 行 = 1 つの点。数値の列は number か数値文字列。x か y が数値でない行は描かない。 */
1263
+ data: T[];
1264
+ /** 横軸に使う数値の列名。例 `"adSpend"`。 */
1265
+ x: NumericKeys<T>;
1266
+ /** 縦軸に使う数値の列名。例 `"revenue"`。 */
1267
+ y: NumericKeys<T>;
1268
+ /** 点の大きさ(面積)に使う数値の列名。渡すとバブルチャートになる。0 を基準に面積が比例し、null・0 以下は最小の大きさ。ツールチップに値が出る。 */
1269
+ size?: NumericKeys<T>;
1270
+ /** 点の名前に使う列名(店舗名・キャンペーン名など)。ツールチップの見出しとデータ表の先頭列になる。 */
1271
+ index?: keyof T & string;
1272
+ /**
1273
+ * 点の脇に書く文字の列名(店舗名など)。重なる点のラベルは自動で間引く(ホバーのツールチップには常に出る)。
1274
+ * `index` が無いときはツールチップの見出しとデータ表の名前にもなる。`highlight` を使うと、強調しない系列のラベルは出さない。
1275
+ */
1276
+ labelKey?: keyof T & string;
1277
+ /** 系列分けに使う列名(`"channel"` など)。値ごとに色を分け、凡例を出す。6 つ以上は点の多い 5 つ +「その他」(灰色)にまとまる。 */
1278
+ series?: keyof T & string;
1279
+ /** 凡例の見出し(「店の規模」)。`series` があって凡例が出るときだけ、凡例の左に小さく書く。 */
1280
+ seriesLabel?: string;
1281
+ /**
1282
+ * 前面に出す系列(`series` 列の値。`"退職"` か `["退職", "休職"]`)。指定した系列は不透明で手前に、指定外は薄く背面に描く。
1283
+ * 数が多い点の中に埋もれる少数の系列を見せたいときに使う。値が系列に一つも当たらないときは強調しない。
1284
+ */
1285
+ highlight?: string | string[];
1286
+ /**
1287
+ * 基準線(目標・平均・しきい値)。`axis: "x" | "y"` と軸の値で縦線・横線を引く。例 `[{ axis: "y", value: 25, label: "粗利率 25%" }]`
1288
+ * 色は中立色(点の系列色とは別)。線は点の下に敷かず、軸の範囲を線まで広げる。
1289
+ */
1290
+ referenceLines?: ScatterReferenceLine[];
1291
+ /** 系列色(`"chart-1"`〜`"chart-5"` か意味色)。配列は系列の出現順、record は系列名ごと。省略時はトークン順。「その他」は常に灰色。 */
1292
+ colors?: ChartSeriesColor[] | Partial<Record<string, ChartSeriesColor>>;
1293
+ /** 列名・系列の値 → 表示名(軸のタイトル・凡例・ツールチップ・データ表に反映)。例 `{ adSpend: "広告費", revenue: "売上" }`。無いキーはそのまま。データ表の列名の既定は「名前」「系列」「横軸」「縦軸」「大きさ」で、直すには各キーを渡す。 */
1294
+ labels?: Record<string, string>;
1295
+ /** 数値の書式。x・y・size の既定の書式(`"compact"` など。`{ type: "number", unit: "件" }` も可)。軸ごとに変えるなら `xFormat` / `yFormat` / `sizeFormat`。既定 `"compact"`。 */
1296
+ format?: ValueFormat;
1297
+ /** 横軸と x の値の書式。`format` より優先。 */
1298
+ xFormat?: ValueFormat;
1299
+ /** 縦軸と y の値の書式。`format` より優先。 */
1300
+ yFormat?: ValueFormat;
1301
+ /** `size` の値の書式(ツールチップ・データ表)。`format` より優先。 */
1302
+ sizeFormat?: ValueFormat;
1303
+ /** 書式を関数で直接渡す逃げ道。x・y・size すべてに使われ、`format` 系より優先する。 */
1304
+ valueFormatter?: ValueFormatter;
1305
+ /**
1306
+ * 縦軸(y)の下限。散布図は 0 起点にしないので、指定した値から始める。データが下限を下回るときは軸を広げる(切り詰めない)。
1307
+ * 並べて比べる複数の散布図には同じ `minValue` / `maxValue` と `xMinValue` / `xMaxValue` を渡して軸をそろえる。
1308
+ */
1309
+ minValue?: number;
1310
+ /** 縦軸(y)の上限。データが上限を超えるときは軸を広げる(切り詰めない)。並べて比べるときは同じ値を渡す。 */
1311
+ maxValue?: number;
1312
+ /** 横軸(x)の下限。データが下限を下回るときは軸を広げる。並べて比べるときは同じ値を渡す。 */
1313
+ xMinValue?: number;
1314
+ /** 横軸(x)の上限。データが上限を超えるときは軸を広げる。並べて比べるときは同じ値を渡す。 */
1315
+ xMaxValue?: number;
1316
+ /** 両軸をデータの範囲に合わせる。既定 `true`(散布図は位置で読むので 0 起点にしない)。`false` で両軸を 0 から始める。 */
1317
+ fitToData?: boolean;
1318
+ /** 凡例(系列が 2 つ以上のときだけ)を出す。既定 `true`。 */
1319
+ showLegend?: boolean;
1320
+ /** ホバー時のツールチップを出す。既定 `true`。 */
1321
+ showTooltip?: boolean;
1322
+ /**
1323
+ * グラフが言っていることの 1 文要約(自由文)。`"auto"` なら「<見出し>: <点の数>点。<y の列> が最大なのは <名前>(<値>)」を組む(`index` が無いときは最大値だけ)。
1324
+ * 省略時は要約なし。例: `summary="auto"`
1325
+ */
1326
+ summary?: string | "auto";
1327
+ /** `data` が空(または描ける点が無い)ときの表示。 */
1328
+ emptyState?: ChartEmptyState;
1329
+ /** 見出しが無いときのプロット領域の読み上げ名。省略時は「<y の列>×<x の列>の散布図」。 */
1330
+ ariaLabel?: string;
1331
+ }
1332
+ /** Generic over the row type, so `x` / `y` / `size` / `index` / `series` keys are checked against `data`. */
1333
+ declare const ScatterChart: (<T extends Record<string, unknown>>(props: ScatterChartProps<T> & {
1334
+ ref?: Ref<HTMLDivElement>;
1335
+ }) => ReactElement) & {
1336
+ displayName?: string;
1337
+ };
1338
+
1339
+ interface LegendProps {
1340
+ /** 凡例に並べる系列名。並び順が配色の順(グラフの `categories` と同じものを渡す)。6 つ以上はグラフ側で「その他」にまとまるので、凡例も 5 つ +「その他」で渡す。 */
1341
+ categories: string[];
1342
+ /** 系列色(`"chart-1"`〜`"chart-5"` か意味色)。配列は系列の順、record は系列名ごと。グラフに渡した `colors` と同じものを渡す。省略時はトークン順。「その他」は常に灰色。 */
1343
+ colors?: ChartSeriesColor[] | Partial<Record<string, ChartSeriesColor>>;
1344
+ /** 系列名 → 表示名。グラフの `labels` と同じものを渡す。例 `{ sales: "売上" }`。無いキーはそのまま。 */
1345
+ labels?: Record<string, string>;
1346
+ /** 並べ方。`"horizontal"`(既定。折り返す横並び)か `"vertical"`(縦並び)。 */
1347
+ layout?: "horizontal" | "vertical";
1348
+ /** 凡例の読み上げ名。省略時は「凡例」。 */
1349
+ ariaLabel?: string;
1350
+ className?: string;
1351
+ }
1352
+ /** Plain-HTML legend. Renders nothing for an empty `categories`. */
1353
+ declare const Legend: React.ForwardRefExoticComponent<LegendProps & React.RefAttributes<HTMLUListElement>>;
1354
+
1355
+ /** The shape the loading skeleton takes, matching the chart it stands in for. */
1356
+ type ChartSkeletonVariant = "line" | "area" | "bar" | "donut" | "list";
1357
+ interface ChartFrameProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "children"> {
1358
+ /** グラフの見出し。プロット領域の `aria-labelledby` になる。 */
1359
+ title?: string;
1360
+ /** 1 文の要約。見出しの下に出し、プロット領域の `aria-describedby` になる。 */
1361
+ summary?: string;
1362
+ /** 読み込み中。`variant` の形のスケルトンを同じ高さで出す。 */
1363
+ isLoading?: boolean;
1364
+ /** データが無い。高さを保ったまま `emptyState` を出す。 */
1365
+ isEmpty?: boolean;
1366
+ emptyState?: ChartEmptyState;
1367
+ /** プロット領域の高さ。数値は px。既定 288。 */
1368
+ height?: number | string;
1369
+ /** スケルトンの形。既定 `"line"`。 */
1370
+ variant?: ChartSkeletonVariant;
1371
+ /** 見出しが無いときのプロット領域のラベル。 */
1372
+ ariaLabel?: string;
1373
+ /**
1374
+ * プロット領域の役割。既定 `"img"`(canvas のグラフ)。行がボタンやリンクになる
1375
+ * HTML のグラフ(BarList・FunnelSteps)は `"group"` にして、中身を読ませる。
1376
+ */
1377
+ plotRole?: "img" | "group";
1378
+ /** 値の表。画面には出さず(`sr-only`)、スクリーンリーダー向けに図の中に置く。`chartDataTable` で作る。 */
1379
+ dataTable?: ChartDataTable;
1380
+ /** プロットの下に常に出す小さな注記(近似値である旨など)。読み込み中・空のときも出す。 */
1381
+ footnote?: string;
1382
+ /** プロット(チャート本体)。読み込み中・空のときは描かない。 */
1383
+ children?: ReactNode;
1384
+ }
1385
+ /**
1386
+ * The frame. `ref` points at the plot area (the element with the fixed height),
1387
+ * `className` / other attributes go to the outer `<figure>`.
1388
+ */
1389
+ declare const ChartFrame: React.ForwardRefExoticComponent<ChartFrameProps & React.RefAttributes<HTMLDivElement>>;
1390
+
281
1391
  interface FunnelStep {
282
1392
  /** ステップのラベル(例: "ページビュー") */
283
1393
  label: string;
284
1394
  /** このステップの数値 */
285
1395
  value: number;
286
- /** Tailwind bg カラークラス(例: "bg-chart-1")。未指定時は自動割り当て */
1396
+ /** @deprecated Tailwind bg カラークラス(例: "bg-chart-1")。`colors` を使う。未指定時は `bg-chart-1` */
287
1397
  color?: string;
288
1398
  /** クリック時のハンドラ */
289
1399
  onClick?: () => void;
@@ -292,17 +1402,704 @@ declare const funnelStepsVariants: (props?: ({
292
1402
  size?: "sm" | "lg" | "md" | null | undefined;
293
1403
  direction?: "horizontal" | "vertical" | null | undefined;
294
1404
  } & class_variance_authority_types.ClassProp) | undefined) => string;
295
- interface FunnelStepsProps extends ComponentProps<"div">, VariantProps<typeof funnelStepsVariants> {
296
- /** ファネルステップの配列(先頭が最大幅) */
297
- data: FunnelStep[];
1405
+ interface FunnelStepsProps<T extends object = FunnelStep> extends Omit<ComponentProps<"div">, "title" | "color">, Pick<ChartCommonProps, "format" | "valueFormatter" | "title" | "summary" | "isLoading" | "emptyState">, VariantProps<typeof funnelStepsVariants> {
1406
+ /** ファネルステップの配列(先頭が最大幅)。`index` / `categories` を省くと `{ label, value }` の形として読む。 */
1407
+ data: T[];
1408
+ /** ステップのラベルに使う列名。既定 `"label"`。 */
1409
+ index?: keyof T & string;
1410
+ /** 値に使う列名を 1 つだけ入れた配列(`["件数"]`)。最初の 1 つだけを使う。既定 `["value"]`。 */
1411
+ categories?: (keyof T & string)[];
1412
+ /** 段の色(`"chart-1"`〜`"chart-5"`、段の順に繰り返す)。省略時はすべて `"chart-1"`(段は同じ量の絞り込みなので 1 色)。 */
1413
+ colors?: ChartColorToken[];
1414
+ /** ステップの名前(`index` の値)→ 表示名。ラベル・データ表に反映。例 `{ visit: "訪問" }`。無いキーはそのまま。データ表の列名を直すには、列のキーも渡す(`{ label: "工程", value: "人数" }`。既定は「ステップ」「値」)。 */
1415
+ labels?: Record<string, string>;
1416
+ /** 伝えたい 1 段。`index` の値(ステップ名。例 `"購入"`)で渡す。段は淡い色が既定で、この 1 段だけ濃い色(`colors` の色そのまま)になる。省略すると全部が淡い色。 */
1417
+ highlight?: string;
298
1418
  /** ステップ間のコンバージョン率を表示する */
299
1419
  showConversion?: boolean;
300
- /** 値の表示フォーマット関数 */
1420
+ /** 前期の各段の値(`data` と同じ順)。渡すと転換率の横に前期比(pt)を出し、最も下がった率を強調する。`label` は列見出し・注記の名前(既定「前期」)。KpiCard の `comparison` と同じ形。例 `comparison={{ values: [231_400, 1_210, 402] }}` */
1421
+ comparison?: {
1422
+ values: readonly (number | null)[];
1423
+ label?: string;
1424
+ };
1425
+ /** @deprecated `valueFormatter` か `format` を使う。 */
301
1426
  formatValue?: (value: number) => string;
302
- /** マウント時のエントリアニメーションを有効にする */
1427
+ /** マウント時のエントリアニメーションを有効にする。既定 `false`。 */
303
1428
  animate?: boolean;
1429
+ ariaLabel?: string;
1430
+ }
1431
+ /** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
1432
+ declare const FunnelSteps: (<T extends object = FunnelStep>(props: FunnelStepsProps<T> & {
1433
+ ref?: Ref<HTMLDivElement>;
1434
+ }) => ReactElement) & {
1435
+ displayName?: string;
1436
+ };
1437
+
1438
+ /**
1439
+ * Heatmap — a typed heatmap over `EChart`: pass rows, the column keys for the
1440
+ * x axis / y axis (`x` / `y`) and the number to shade by (`value`) instead of an
1441
+ * ECharts option. Cohort retention (週 × コホート), weekday × hour counts, …
1442
+ *
1443
+ * Shading is a single-colour ramp (light → dark) of one theme colour
1444
+ * (`--chart-1` by default; `tone` moves it to another series token or a meaning
1445
+ * colour) and follows light/dark. A cell with no value (null / missing row) is left
1446
+ * unpainted (transparent, no text), never shaded like 0; the tooltip and the table say「—」.
1447
+ * The shading range is the data's min–max unless `scale` fixes it. The ramp's lowest end is the tone mixed 20% into
1448
+ * the surface (`color-mix(in oklch, var(--chart-1) 20%, var(--card))`), so the lowest cell never melts into the
1449
+ * background in dark mode; the legend's gradient starts at the same colour.
1450
+ * Renders inside `ChartFrame` (title, summary, loading skeleton, empty state)
1451
+ * with the numbers as a screen-reader table.
1452
+ */
1453
+
1454
+ /** Columns of `T` that hold numbers (null / undefined allowed for gaps); untyped rows keep every key. */
1455
+ type NumericColumn$2<T> = {
1456
+ [K in keyof T]-?: unknown extends T[K] ? K : T[K] extends number | bigint | null | undefined ? K : never;
1457
+ }[keyof T] & string;
1458
+ interface HeatmapProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
1459
+ /** 行の配列。1 行 = 1 マス(x と y の組)。同じ組が複数あれば後の行が勝つ。値は number か数値文字列。 */
1460
+ data: T[];
1461
+ /** 横軸(列)に使う列名。例 `"hour"`・`"week"`。 */
1462
+ x: keyof T & string;
1463
+ /** 縦軸(行)に使う列名。例 `"weekday"`・`"cohort"`。先頭の行が一番上。 */
1464
+ y: keyof T & string;
1465
+ /** マスの濃さを決める数値の列名。null・欠損・数値でない値のマスは塗らない(0 とは別。ツールチップとデータ表は「—」)。 */
1466
+ value: NumericColumn$2<T>;
1467
+ /** 横軸の並び順(と表示するマス)。省略時は `data` の出現順。ここに無い x の行は描かない。 */
1468
+ xLabels?: string[];
1469
+ /** 縦軸の並び順(と表示するマス)。省略時は `data` の出現順。ここに無い y の行は描かない。 */
1470
+ yLabels?: string[];
1471
+ /**
1472
+ * 列名・軸の値 → 表示名(軸・ツールチップ・データ表に反映)。
1473
+ * 例 `{ mon: "月曜", value: "件数", breached: "SLA 未達" }`。無いキーはそのまま。データ表の先頭列名は `y` のキーを渡すと直る(既定は「項目」)。
1474
+ */
1475
+ labels?: Record<string, string>;
1476
+ /** 数値の書式(`"number"` / `"percent"` / `{ type: "number", unit: "件" }` など)。マス内・ツールチップ・データ表で同じ書式。既定 `"number"`。 */
1477
+ format?: ValueFormat;
1478
+ /** 書式を関数で直接渡す逃げ道。`format` より優先する。 */
1479
+ valueFormatter?: ValueFormatter;
1480
+ /**
1481
+ * 濃淡の色。`"chart-1"`〜`"chart-5"` か意味色(`"positive"` / `"warning"` / `"negative"` / `"neutral"`)。
1482
+ * 薄い → 濃いの単色グラデーション(レインボーにしない)。既定 `"chart-1"`。
1483
+ */
1484
+ tone?: ChartSeriesColor;
1485
+ /**
1486
+ * 濃さの固定スケール。省略時はデータの最小〜最大(自動)。比べたい上限・下限が決まっているときだけ渡す。`min` 以下が最も薄く、`max` 以上が最も濃い(範囲外の値は端に丸める)。凡例の両端もこの値になる。
1487
+ * 継続率(0〜100)なら `{ min: 0, max: 100 }`。片方だけでもよく、省略した側はデータの最小・最大。
1488
+ * `minValue` / `maxValue` より優先する。
1489
+ */
1490
+ scale?: {
1491
+ min?: number;
1492
+ max?: number;
1493
+ };
1494
+ /** @deprecated `scale={{ min }}` を使う。濃さの下限(この値以下が最も薄い)。 */
1495
+ minValue?: number;
1496
+ /** @deprecated `scale={{ max }}` を使う。濃さの上限(この値以上が最も濃い)。 */
1497
+ maxValue?: number;
1498
+ /** マスの中に値を書く(`format` どおり)。既定 `false`。 */
1499
+ showValues?: boolean;
1500
+ /** 凡例(薄い → 濃いの帯と両端の値)を出す。既定 `true`。 */
1501
+ showLegend?: boolean;
1502
+ /** ホバーでツールチップを出す。既定 `true`。 */
1503
+ showTooltip?: boolean;
1504
+ /**
1505
+ * ツールチップとデータ表に添える列(同じ行の別の数値)。例 `["breached"]` →「月曜 9時台 電話 12件・SLA 未達 2件」の「SLA 未達 2件」。
1506
+ * 列名の表示は `labels`、値は `format`(単位つきの書式なら同じ単位)で出る。
1507
+ */
1508
+ details?: NumericColumn$2<T>[];
1509
+ /**
1510
+ * この列が真(`true` / 0 でない数)の行のマスに、注意色(`--negative`)の枠を付ける。
1511
+ * 例 SLA 未達が集中したマス。色だけでなく枠の太さでも区別でき、ツールチップに「要注意」と出る。
1512
+ */
1513
+ flag?: keyof T & string;
1514
+ /** グラフの見出し。 */
1515
+ title?: string;
1516
+ /** グラフが言っていることの 1 文要約。`"auto"` で最大のマスから自動生成。 */
1517
+ summary?: string | "auto";
1518
+ /** 読み込み中。最終形と同じ高さのスケルトンを出す。 */
1519
+ isLoading?: boolean;
1520
+ /** `data` が空のときの表示。 */
1521
+ emptyState?: ChartEmptyState;
1522
+ /** プロット領域の高さ(px)。既定 288。 */
1523
+ height?: number;
1524
+ /** 生成した EChartsOption に最後に深くマージする逃げ道。 */
1525
+ chartOptions?: EChartsOption;
1526
+ /** グラフ右上に PNG 保存/コピーのボタンを出す。見出しがあれば PNG の上に含める(`{ includeTitle: false }` で含めない)。 */
1527
+ actions?: boolean | ChartActionsOptions;
1528
+ /** PNG 保存時のファイル名(拡張子つき)。 */
1529
+ fileName?: string;
1530
+ className?: string;
1531
+ /** スクリーンリーダー向けのラベル。省略時は `<yの列>×<xの列>のヒートマップ`。 */
1532
+ ariaLabel?: string;
1533
+ }
1534
+ /** Generic over the row type, so `x` / `y` / `value` keys are checked against `data`. */
1535
+ declare const Heatmap: (<T extends Record<string, unknown>>(props: HeatmapProps<T> & {
1536
+ ref?: Ref<HTMLDivElement>;
1537
+ }) => ReactElement) & {
1538
+ displayName?: string;
1539
+ };
1540
+
1541
+ /**
1542
+ * PairedChart — 量(棒)と率・単価(線)を、同じ期間軸の上下 2 段で見せる型付きグラフ(`DashboardCardPreset` の中に置く)。
1543
+ * 二重 Y 軸は持たない: 上段が棒の値軸、下段が線の値軸で、横軸(期間)とツールチップの位置は
1544
+ * 1 つの ECharts の中で揃っている(ホバーすると同じ期間の棒と線の値が 1 枚のツールチップに出る)。
1545
+ * 段ごとに `format`(件数・金額・%)を持ち、率を分子・分母から計算することはしない(呼び元が値を渡す)。
1546
+ * 棒は 0 起点。色は `--chart-1..5` を固定順(棒 → 線の順に続く)で使い、ライト/ダークに追従する。
1547
+ * `ChartFrame` の中に描く(見出し・要約・読み込み中・空表示)。
1548
+ */
1549
+
1550
+ /** 1 段ぶんの設定。 */
1551
+ interface PairedPanel<T extends Record<string, unknown> = Record<string, unknown>> {
1552
+ /** この段に描く系列の列。 */
1553
+ categories: NumericKeys<T>[];
1554
+ /** 系列の色。省略時は `--chart-1..5` を固定順(上段の続きから下段)。 */
1555
+ colors?: ChartColors<T>;
1556
+ /** 値の書式(件数 `number`・金額 `currency`・率 `percent` など)。`percent` は比率(0.124 → 12.4%)を渡す。 */
1557
+ format?: ValueFormat;
1558
+ /** `format` で足りないときの自前の書式。 */
1559
+ valueFormatter?: ValueFormatter;
1560
+ /** 値軸の見出し(「売上」「客単価」など)。 */
1561
+ yAxisLabel?: string;
1562
+ /** 値軸の上限。データが超えるときは軸を広げる。 */
1563
+ maxValue?: number;
1564
+ }
1565
+ interface PairedChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Pick<ChartCommonProps<T>, "data" | "index" | "labels" | "title" | "summary" | "isLoading" | "emptyState" | "chartOptions" | "actions" | "fileName" | "className" | "ariaLabel"> {
1566
+ /** 上段。量を棒で。`type` は BarChart と同じ(`stacked` で積み上げ)。 */
1567
+ bars: PairedPanel<T> & {
1568
+ type?: CartesianStackType;
1569
+ };
1570
+ /** 下段。率・単価を線で。`fitToData` で値軸をデータに合わせる(率が狭い幅で動くとき)。 */
1571
+ line: PairedPanel<T> & {
1572
+ fitToData?: boolean;
1573
+ minValue?: number;
1574
+ };
1575
+ /** 全体の高さ(px)。既定 400。 */
1576
+ height?: number;
1577
+ /** 上段:下段の高さの比。既定 `[3, 2]`。 */
1578
+ heightRatio?: [number, number];
1579
+ /** 値軸ラベルの幅(px)。2 段の左端を揃える。既定 64。 */
1580
+ yAxisWidth?: number;
1581
+ showLegend?: boolean;
1582
+ showTooltip?: boolean;
1583
+ }
1584
+ /** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
1585
+ declare const PairedChart: (<T extends Record<string, unknown>>(props: PairedChartProps<T> & {
1586
+ ref?: Ref<HTMLDivElement>;
1587
+ }) => ReactElement) & {
1588
+ displayName?: string;
1589
+ };
1590
+
1591
+ interface HistogramThreshold {
1592
+ /** 線を引く値(例 SLA の 3 日)。 */
1593
+ value: number;
1594
+ /** 線の名前(例「SLA」)。ツールチップ・要約・データ表の注記に出る。 */
1595
+ label?: string;
1596
+ }
1597
+ interface HistogramChartProps extends Omit<ChartCommonProps, "data" | "index" | "categories" | "colors" | "labels" | "summary"> {
1598
+ /** 生の値の配列。number か数値文字列。null・数にならない値は数えない。 */
1599
+ values: unknown[];
1600
+ /** 階級の幅。省略すると値の範囲から区切りのよい幅(1・2・2.5・5 × 10^n)を選ぶ。 */
1601
+ binWidth?: number;
1602
+ /** 階級の始まり。省略は幅の倍数に切り下げた最小値。 */
1603
+ start?: number;
1604
+ /** 上限。この値以上は 1 つの「<上限>以上」階級にまとめる。省略するとまとめない。 */
1605
+ max?: number;
1606
+ /** しきい値の線(任意)。階級の途中にも引ける。 */
1607
+ threshold?: HistogramThreshold;
1608
+ /** 件数の単位。既定は日本語のページで「件」、それ以外は単位なし。 */
1609
+ countUnit?: string;
1610
+ /** 横軸の値の名前(データ表の先頭列)。既定「値」。例「解決日数」 */
1611
+ valueLabel?: string;
1612
+ /** 1 文要約(自由文)。`"auto"` なら件数・最頻の階級・しきい値超えの割合を組む。省略時は要約なし。 */
1613
+ summary?: string | "auto";
1614
+ /** ホバー時のツールチップを出す。既定 `true`。 */
1615
+ showTooltip?: boolean;
1616
+ }
1617
+ declare const HistogramChart: React.ForwardRefExoticComponent<HistogramChartProps & React.RefAttributes<HTMLDivElement>>;
1618
+
1619
+ interface BoxPlotGroup {
1620
+ /** 箱の名前(横軸)。 */
1621
+ name: string;
1622
+ /** 生の値の配列。number か数値文字列。null・数にならない値は数えない。 */
1623
+ values: unknown[];
1624
+ }
1625
+ interface BoxPlotChartProps extends Omit<ChartCommonProps, "data" | "index" | "categories" | "colors" | "labels" | "summary"> {
1626
+ /** 群ごとの値。並びがそのまま左から右の順。 */
1627
+ groups: BoxPlotGroup[];
1628
+ /** ひげの長さ(四分位範囲の何倍までを外れ値にしないか)。既定 1.5。 */
1629
+ whisker?: number;
1630
+ /** 値(縦軸)の名前。ツールチップとデータ表に出る。既定「値」。例「残業時間」 */
1631
+ valueLabel?: string;
1632
+ /** 1 文要約(自由文)。`"auto"` なら中央値が最大・最小の群と外れ値の数を組む。省略時は要約なし。 */
1633
+ summary?: string | "auto";
1634
+ /** ホバー時のツールチップを出す。既定 `true`。 */
1635
+ showTooltip?: boolean;
1636
+ }
1637
+ declare const BoxPlotChart: React.ForwardRefExoticComponent<BoxPlotChartProps & React.RefAttributes<HTMLDivElement>>;
1638
+
1639
+ type AttentionKind = "overdue" | "risk" | "dueSoon" | "stale";
1640
+ type DateInput = Date | string | null | undefined;
1641
+ interface AttentionJudgement {
1642
+ kind: AttentionKind;
1643
+ /**
1644
+ * overdue: 期日を過ぎた日数(1 以上)/ dueSoon: 期日までの日数(0 = 当日)/
1645
+ * stale: 最終の動きからの日数/ risk: 0。
1646
+ */
1647
+ days: number;
1648
+ }
1649
+ interface AttentionListProps<T> {
1650
+ rows: T[];
1651
+ /** 基準日(`"2026-10-23"` か Date)。 */
1652
+ asOf: Date | string;
1653
+ /** 期日の何日前から「期限間近」にするか。既定 7。 */
1654
+ dueSoonDays?: number;
1655
+ /** この日数動きがなければ「滞留」。未指定なら滞留は判定しない。 */
1656
+ staleDays?: number;
1657
+ /** 区分名の差し替え(例: `{ overdue: "入金遅れ" }`)。 */
1658
+ labels?: Partial<Record<AttentionKind, string>>;
1659
+ /** 行の ID。省略時は `idKey` の列、それも無ければ行の順番。 */
1660
+ getRowId?: (row: T) => string;
1661
+ /** 行の見出し(顧客名・案件名など)。省略時は `titleKey` の列、それも無ければ空。 */
1662
+ getTitle?: (row: T) => ReactNode;
1663
+ getDueDate?: (row: T) => DateInput;
1664
+ getLastActivityAt?: (row: T) => DateInput;
1665
+ /** リスクと判定する行。期日・滞留より先に出す。 */
1666
+ isRisk?: (row: T) => boolean;
1667
+ /** 行の ID の列名(JSON で書ける `getRowId`)。 */
1668
+ idKey?: string;
1669
+ /** 見出しの列名(JSON で書ける `getTitle`)。 */
1670
+ titleKey?: string;
1671
+ /** 期日の列名(JSON で書ける `getDueDate`)。値は `"2026-10-23"` 形式の日付か Date。 */
1672
+ dueDateKey?: string;
1673
+ /** 最後に動きがあった日の列名(JSON で書ける `getLastActivityAt`)。 */
1674
+ lastActivityAtKey?: string;
1675
+ /** リスクの列名(JSON で書ける `isRisk`)。値が真の行をリストにする。 */
1676
+ riskKey?: string;
1677
+ /** 次の一手の列名(JSON で書ける `getNextAction`)。値が空の行には添えない。 */
1678
+ nextActionKey?: string;
1679
+ /** 理由の文。省略すると区分と日数から作る。 */
1680
+ getReason?: (row: T, judgement: AttentionJudgement) => ReactNode;
1681
+ /** 次の一手。判定に当たる行に添える。 */
1682
+ getNextAction?: (row: T, judgement: AttentionJudgement) => ReactNode;
1683
+ /** 見出しの右に出す補足(金額・担当者など)。 */
1684
+ getMeta?: (row: T) => ReactNode;
1685
+ /** 行を押したとき。渡すと行が button になる。 */
1686
+ onRowClick?: (row: T) => void;
1687
+ /** 判定に当たらない行も末尾に出す。既定 false。 */
1688
+ includeUnflagged?: boolean;
1689
+ /** 該当なしのときの見出し・説明。 */
1690
+ emptyTitle?: string;
1691
+ emptyDescription?: string;
1692
+ className?: string;
1693
+ }
1694
+ declare function AttentionList<T>({ rows, asOf, dueSoonDays, staleDays, labels, getRowId, getTitle, getDueDate, getLastActivityAt, isRisk, idKey, titleKey, dueDateKey, lastActivityAtKey, riskKey, nextActionKey, getReason, getNextAction, getMeta, onRowClick, includeUnflagged, emptyTitle, emptyDescription, className, ...rest }: AttentionListProps<T> & Omit<HTMLAttributes<HTMLUListElement>, keyof AttentionListProps<T>>): React.JSX.Element;
1695
+ declare namespace AttentionList {
1696
+ var displayName: string;
1697
+ }
1698
+
1699
+ /**
1700
+ * ComboChart — bars, lines and areas on one category / time axis, with up to two value axes (left and right); use it only to migrate a Tableau dual-axis sheet, and use `PairedChart` for a new dashboard.
1701
+ *
1702
+ * It exists to reproduce a Tableau dual-axis sheet faithfully (a Pareto: sales as bars, the cumulative share as a
1703
+ * line on the right). For a new dashboard prefer PairedChart, which stacks the two measures in panels over a
1704
+ * shared axis instead of reading two scales off one plot.
1705
+ *
1706
+ * Each value axis starts at 0 (bars always do; a negative value extends the axis below it), carries its own format
1707
+ * (`format` left, `rightFormat` right), and never repeats a tick label: the tick step widens until every label on
1708
+ * the axis reads differently. Only the left axis draws grid lines. `referenceLines` draw dashed lines on either axis.
1709
+ * Clicking a bar or a point calls `onSelect` with its row.
1710
+ */
1711
+
1712
+ type ComboSeriesType = "bar" | "line" | "area";
1713
+ type ComboAxis = "left" | "right";
1714
+ /** One measure of a ComboChart. */
1715
+ interface ComboSeries<K extends string = string> {
1716
+ /** 値の列名。 */
1717
+ key: K;
1718
+ /** 描き方。`"bar"`(棒)・`"line"`(線)・`"area"`(面)。 */
1719
+ type: ComboSeriesType;
1720
+ /** どちらの値の軸で読むか。既定 `"left"`。`"right"` の系列が 1 つでもあると右軸を出す。 */
1721
+ axis?: ComboAxis;
1722
+ /** 凡例・ツールチップの表示名。省略時は `labels[key]`、無ければ列名。 */
1723
+ label?: string;
1724
+ /** 色。`"chart-1"`〜`"chart-5"` か意味色。省略時は系列の順にトークン色。 */
1725
+ color?: ChartSeriesColor;
1726
+ }
1727
+ /** A dashed horizontal (vertical with `layout="vertical"`) line at a value of one axis. */
1728
+ interface ComboReferenceLine {
1729
+ /** 線を引く値。 */
1730
+ value: number;
1731
+ /** どちらの軸の値か。既定 `"left"`。 */
1732
+ axis?: ComboAxis;
1733
+ /** 線のラベル。省略時は軸の書式で値を書く。 */
1734
+ label?: string;
1735
+ }
1736
+ interface ComboChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
1737
+ /** 行の配列。1 行 = カテゴリ軸の 1 つの値(集計済み)。 */
1738
+ data: T[];
1739
+ /** カテゴリ軸(横軸)の列名。例 `"month"`・`"product"`。行の順に並ぶ。 */
1740
+ index: keyof T & string;
1741
+ /** 描く系列。`{ key, type: "bar" | "line" | "area", axis?: "left" | "right", label? }` の配列。描く順(後ろほど手前)。 */
1742
+ series: ComboSeries<keyof T & string>[];
1743
+ /** 左軸(と左軸の系列のツールチップ・データ表)の書式。既定 `"compact"` 相当の短い表記。 */
1744
+ format?: ValueFormat;
1745
+ /** 右軸の書式。例 パレート図の累積比なら `"percent"`。省略時は `format`。 */
1746
+ rightFormat?: ValueFormat;
1747
+ /** 列名・カテゴリの値 → 表示名。 */
1748
+ labels?: Record<string, string>;
1749
+ /** 参照線(目標・平均など)。`{ value, axis?, label? }` の配列。 */
1750
+ referenceLines?: ComboReferenceLine[];
1751
+ /** 同じ軸の棒どうし・面どうしを積み上げる。既定 `false`(棒は横に並べる)。 */
1752
+ stacked?: boolean;
1753
+ /** `"vertical"` でカテゴリを縦軸に並べる(横棒)。左軸は下、右軸は上になる。既定 `"horizontal"`。 */
1754
+ layout?: "horizontal" | "vertical";
1755
+ /** 凡例を出す。既定 `true`(系列が 2 つ以上のとき)。 */
1756
+ showLegend?: boolean;
1757
+ /** ホバーでツールチップを出す。既定 `true`。 */
1758
+ showTooltip?: boolean;
1759
+ /** 棒・点のクリック。その行を受け取る(フィルターの操作に使う)。 */
1760
+ onSelect?: (row: T) => void;
1761
+ /** グラフの見出し。 */
1762
+ title?: string;
1763
+ /** グラフが言っていることの 1 文要約。 */
1764
+ summary?: string;
1765
+ /** 読み込み中。最終形と同じ高さのスケルトンを出す。 */
1766
+ isLoading?: boolean;
1767
+ /** `data` が空のときの表示。 */
1768
+ emptyState?: ChartEmptyState;
1769
+ /** プロット領域の高さ(px)。既定 288。 */
1770
+ height?: number;
1771
+ /** 生成した EChartsOption に最後に深くマージする逃げ道。 */
1772
+ chartOptions?: EChartsOption;
1773
+ /** グラフ右上に PNG 保存/コピーのボタンを出す。 */
1774
+ actions?: boolean | ChartActionsOptions;
1775
+ /** PNG 保存時のファイル名(拡張子つき)。 */
1776
+ fileName?: string;
1777
+ className?: string;
1778
+ /** スクリーンリーダー向けのラベル。 */
1779
+ ariaLabel?: string;
304
1780
  }
305
- declare const FunnelSteps: React.ForwardRefExoticComponent<Omit<FunnelStepsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
1781
+ /** Generic over the row type, so `index` and the series keys are checked against `data`. */
1782
+ declare const ComboChart: (<T extends Record<string, unknown>>(props: ComboChartProps<T> & {
1783
+ ref?: Ref<HTMLDivElement>;
1784
+ }) => ReactElement) & {
1785
+ displayName?: string;
1786
+ };
1787
+
1788
+ /**
1789
+ * 等間隔の 1 系列に対する指数平滑法(ETS、誤差は加法)の予測。依存なしの純関数で、同じ入力には同じ出力を返す(乱数を使わない)。
1790
+ *
1791
+ * - モデルは トレンド(なし / 加法)× 季節(なし / 加法 / 乗法)。乗法トレンドは扱わず、加法トレンドとして当てはめる
1792
+ * (`model.trend` には実際に当てはめた `"additive"` が入る)。乗法トレンドの予測区間は閉じた式が無く、決定的に出せないため。
1793
+ * - 平滑化係数(α・β・γ)と初期の水準・傾きは、1 期先予測の残差平方和の最小化(誤差が加法なので最尤と同じ)を
1794
+ * Nelder–Mead で解く。範囲は 0 < α < 1、0 < β < α、0 < γ < 1 − α。初期の季節成分は古典的分解(最初の数季節の移動平均)で決める。
1795
+ * - `"auto"` は当てはめられる組み合わせをすべて当て、AICc が最小のものを選ぶ(Tableau も最大 8 モデルから AIC で選ぶ)。
1796
+ * - 予測区間は ETS(A,·,·) の分散の式(Hyndman ほか 2008 / fpp の表)で、点予測 ± z·σ·√(分散の倍率)。σ は残差から。
1797
+ * 乗法の季節は閉じた式が無いので、2 期先以降の項に季節指数の 2 乗を掛ける近似にしている。
1798
+ * - Tableau はパラメータの推定方法を公開していないため、同じモデルを選んでも値は一致しない(近似値として扱う)。
1799
+ */
1800
+ /** トレンド・季節の指定。`"auto"` は当てはめられる候補から AICc で選ぶ。 */
1801
+ type ForecastComponent = "none" | "additive" | "multiplicative" | "auto";
1802
+ interface ForecastOptions {
1803
+ /** トレンド。既定 `"auto"`。`"multiplicative"` は加法トレンドとして当てはめる。 */
1804
+ trend?: ForecastComponent;
1805
+ /** 季節。既定 `"auto"`。`seasonLength` が 1 以下か、点が 2 季節分に満たないときは季節なしに落とす。 */
1806
+ season?: ForecastComponent;
1807
+ /** 1 季節の期数(月次 12・四半期 4・曜日 7)。省略か 1 で季節なし。 */
1808
+ seasonLength?: number;
1809
+ /**
1810
+ * 予測する期数。既定は季節ありなら 1 季節分(`seasonLength`)、なければ当てはめた点の 4 分の 1(1〜12 期)。
1811
+ * 末尾の除外期(`ignoreLast` と末尾の欠損)はこれとは別に予測する。
1812
+ */
1813
+ horizon?: number;
1814
+ /** 予測区間の信頼水準(0〜1)。既定 0.95。 */
1815
+ confidence?: number;
1816
+ /** 末尾から除外する期数(締まっていない期)。当てはめに使わず、予測する側に回す。既定 0。 */
1817
+ ignoreLast?: number;
1818
+ }
1819
+
1820
+ /**
1821
+ * ForecastChart — a time-series line chart that continues each series with an exponential-smoothing forecast (dashed line and shaded prediction interval) computed from `data` at render time; place it inside `DashboardCardPreset`, and use it to migrate a Tableau forecast sheet.
1822
+ *
1823
+ * Pass the rows, the date column (`x`), the value column (`y`) and optionally a column that splits the rows into
1824
+ * series (`series`, e.g. a segment). Rows that fall in the same period and series are summed. The forecast is
1825
+ * recomputed on every change of the inputs (never stored or fetched) with the model family in `forecast`
1826
+ * (trend / season, `"auto"` picks the lowest AICc), so it is an approximation: a fixed note under the plot always
1827
+ * says so (name the source tool with `forecastSource`; `forecastNote` only adds to it). A series with too few points draws its actuals only.
1828
+ */
1829
+
1830
+ /** 予測の 1 期の長さ。未来の日付を進める単位。 */
1831
+ type ForecastPeriod = "day" | "week" | "month" | "quarter" | "year";
1832
+ interface ForecastChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors"> {
1833
+ /** 日付の列名。ISO の日付・年月(`"2026-01"`)・年・`Date` を受ける。 */
1834
+ x: keyof T & string;
1835
+ /** 値の列名。number か数値文字列。 */
1836
+ y: keyof T & string;
1837
+ /** 系列に分ける列名(セグメントなど)。省略時は 1 系列。6 つ以上は合計の大きい 5 つ +「その他」にまとめる。 */
1838
+ series?: keyof T & string;
1839
+ /** 1 期の長さ。省略時は日付の間隔から推定する。同じ期に入る行は合計する。 */
1840
+ period?: ForecastPeriod;
1841
+ /**
1842
+ * 予測の設定(トレンド・季節・季節の長さ・期数・信頼水準・末尾の除外期)。`seasonLength` を省略すると `period` から
1843
+ * 決める(月 12・四半期 4・週 52・日 7・年は季節なし)。例: `forecast={{ trend: "additive", season: "additive", horizon: 12 }}`
1844
+ */
1845
+ forecast?: ForecastOptions;
1846
+ /** 凡例・ツールチップ・境目の縦線に出す予測の呼び名。既定は表示言語の「予測」/ "Forecast"。 */
1847
+ forecastLabel?: string;
1848
+ /**
1849
+ * 予測の元になったツール(`"Tableau"` など)。プロットの下の注記に「〈ツール〉の予測値とは一致しない」と名前で出す。
1850
+ * 注記そのもの(近似であること)は部品が必ず出し、置き換えられない。
1851
+ */
1852
+ forecastSource?: string;
1853
+ /** 注記のあとに足す補足(集計の範囲など)。近似の注記を置き換えるものではない。 */
1854
+ forecastNote?: string;
1855
+ /** 系列色。配列は系列の順、record は系列名ごと。省略時はトークン順。 */
1856
+ colors?: ChartColors;
1857
+ /** 凡例・ツールチップを出す。既定 `true`。 */
1858
+ showLegend?: boolean;
1859
+ showTooltip?: boolean;
1860
+ /** 値軸の目盛り線を出す。既定 `true`。 */
1861
+ showGridLines?: boolean;
1862
+ showXAxis?: boolean;
1863
+ showYAxis?: boolean;
1864
+ /** y 軸ラベルの幅(px)。 */
1865
+ yAxisWidth?: number;
1866
+ /** 値軸の下限・上限(データ・予測区間がはみ出すときは軸を広げる)。 */
1867
+ minValue?: number;
1868
+ maxValue?: number;
1869
+ /** 値軸を 0 からではなくデータに合わせる。既定 `false`。 */
1870
+ fitToData?: boolean;
1871
+ xAxisLabel?: string;
1872
+ yAxisLabel?: string;
1873
+ }
1874
+ /** Generic over the row type, so `x` / `y` / `series` are checked against `data`. */
1875
+ declare const ForecastChart: (<T extends Record<string, unknown>>(props: ForecastChartProps<T> & {
1876
+ ref?: Ref<HTMLDivElement>;
1877
+ }) => ReactElement) & {
1878
+ displayName?: string;
1879
+ };
1880
+
1881
+ /** The maps the parts draw. */
1882
+ type GeoMapName = "japan" | "us" | "world";
1883
+
1884
+ /**
1885
+ * FilledMap — a choropleth: each region (Japanese prefecture, US state or country) shaded by a number. Pass rows,
1886
+ * the column naming the region and the number to shade by instead of an ECharts option.
1887
+ *
1888
+ * Regions are matched by name or code, in Japanese or English: 「東京都」「東京」「Tokyo」「JP-13」「13」,
1889
+ * 「California」「CA」「US-CA」, 「Japan」「JPN」「JP」 (case, width and accents don't matter: "Ōita" = "Oita").
1890
+ * `map="auto"` (default) picks the map whose regions the most rows name. A row that names no region is not drawn;
1891
+ * it is listed in the screen-reader table instead.
1892
+ *
1893
+ * Shading is a single-colour ramp of one theme colour (`tone`, `--chart-1` by default) like Heatmap: the lowest
1894
+ * value is the tone mixed 20% into the surface, the highest the tone itself, never a rainbow. A region with no row
1895
+ * (or a null value) is grey. `selected` dims the other regions; clicking a region calls `onSelect` (a filter action).
1896
+ * The boundaries (Natural Earth, public domain) load on demand, so the part shows its skeleton for a moment the first time.
1897
+ */
1898
+
1899
+ /** Columns of `T` that hold numbers (null / undefined allowed for gaps); untyped rows keep every key. */
1900
+ type NumericColumn$1<T> = {
1901
+ [K in keyof T]-?: unknown extends T[K] ? K : T[K] extends number | bigint | null | undefined ? K : never;
1902
+ }[keyof T] & string;
1903
+ type FilledMapName = GeoMapName | "auto";
1904
+ interface FilledMapProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
1905
+ /** 行の配列。1 行 = 1 地域。同じ地域が複数あれば後の行が勝つ。値は number か数値文字列。 */
1906
+ data: T[];
1907
+ /** 地域を表す列名。都道府県名(「東京都」「東京」「Tokyo」)・州名・国名か、コード(`JP-13`・`13`・`CA`・`US-CA`・`JPN`・`JP`)。 */
1908
+ region: keyof T & string;
1909
+ /** 塗りの濃さを決める数値の列名。null・欠損の地域は灰色(0 とは別)。 */
1910
+ value: NumericColumn$1<T>;
1911
+ /** 描く地図。`"japan"`(都道府県)・`"us"`(州)・`"world"`(国)。既定 `"auto"`(地域の列の値が最も多く当たる地図)。 */
1912
+ map?: FilledMapName;
1913
+ /** 列名・地域の値 → 表示名(ツールチップ・データ表)。例 `{ sales: "売上" }`。 */
1914
+ labels?: Record<string, string>;
1915
+ /** 数値の書式(`"number"` / `"currency"` / `"percent"` / `{ type: "number", unit: "件" }` など)。既定 `"number"`。 */
1916
+ format?: ValueFormat;
1917
+ /** 書式を関数で直接渡す逃げ道。`format` より優先する。 */
1918
+ valueFormatter?: ValueFormatter;
1919
+ /** 濃淡の色。`"chart-1"`〜`"chart-5"` か意味色。薄い → 濃いの単色(レインボーにしない)。既定 `"chart-1"`。 */
1920
+ tone?: ChartSeriesColor;
1921
+ /** 濃さの固定スケール。省略時はデータの最小〜最大。範囲外の値は端に丸める。 */
1922
+ scale?: {
1923
+ min?: number;
1924
+ max?: number;
1925
+ };
1926
+ /** 凡例(薄い → 濃いの帯と両端の値)を出す。既定 `true`。 */
1927
+ showLegend?: boolean;
1928
+ /** ホバーでツールチップを出す。既定 `true`。 */
1929
+ showTooltip?: boolean;
1930
+ /** ツールチップとデータ表に添える列(同じ行の別の値)。数値は `format`、それ以外は文字のまま。 */
1931
+ details?: (keyof T & string)[];
1932
+ /** 選択中の地域(`region` 列の値。名前・コードのどの書き方でもよい)。渡すと、それ以外の地域を薄くする。 */
1933
+ selected?: string[];
1934
+ /** 地域のクリック。`region` 列の値と、その行を受け取る(フィルターの操作に使う)。データの無い地域では呼ばない。 */
1935
+ onSelect?: (region: string, row: T) => void;
1936
+ /** グラフの見出し。 */
1937
+ title?: string;
1938
+ /** グラフが言っていることの 1 文要約。`"auto"` で最大の地域から自動生成。 */
1939
+ summary?: string | "auto";
1940
+ /** 読み込み中。最終形と同じ高さのスケルトンを出す。 */
1941
+ isLoading?: boolean;
1942
+ /** `data` が空のときの表示。 */
1943
+ emptyState?: ChartEmptyState;
1944
+ /** プロット領域の高さ(px)。既定 288。 */
1945
+ height?: number;
1946
+ /** 生成した EChartsOption に最後に深くマージする逃げ道。 */
1947
+ chartOptions?: EChartsOption;
1948
+ /** グラフ右上に PNG 保存/コピーのボタンを出す。 */
1949
+ actions?: boolean | ChartActionsOptions;
1950
+ /** PNG 保存時のファイル名(拡張子つき)。 */
1951
+ fileName?: string;
1952
+ className?: string;
1953
+ /** スクリーンリーダー向けのラベル。省略時は `<valueの列>の地図`。 */
1954
+ ariaLabel?: string;
1955
+ }
1956
+ /** Generic over the row type, so `region` / `value` keys are checked against `data`. */
1957
+ declare const FilledMap: (<T extends Record<string, unknown>>(props: FilledMapProps<T> & {
1958
+ ref?: Ref<HTMLDivElement>;
1959
+ }) => ReactElement) & {
1960
+ displayName?: string;
1961
+ };
1962
+
1963
+ /**
1964
+ * SymbolMap — points at latitude / longitude over a faint boundary basemap (Japan's prefectures, US states or the
1965
+ * countries of the world). Pass rows and the two coordinate columns instead of an ECharts option.
1966
+ *
1967
+ * `size` scales each symbol's area by a number; `color` colours it by a number (a single-hue ramp of `tone`, like
1968
+ * Heatmap) or by a category (`--chart-1..5` in order of appearance, the 6th category on as「その他」/ "Other").
1969
+ * `basemap="auto"` (default) picks the smallest map holding every point. A row without usable coordinates is not
1970
+ * drawn; it is listed in the screen-reader table instead. `selected` dims the other points; clicking a point calls
1971
+ * `onSelect` (a filter action). The boundaries (Natural Earth, public domain) load on demand.
1972
+ */
1973
+
1974
+ type SymbolMapBasemap = GeoMapName | "auto";
1975
+ interface SymbolMapProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
1976
+ /** 行の配列。1 行 = 1 点。 */
1977
+ data: T[];
1978
+ /** 緯度の列名(-90〜90。数値か数値文字列)。 */
1979
+ latitude: keyof T & string;
1980
+ /** 経度の列名(-180〜180。数値か数値文字列)。 */
1981
+ longitude: keyof T & string;
1982
+ /** 点の名前の列名(ツールチップ・データ表・`selected` の照合に使う)。 */
1983
+ name?: keyof T & string;
1984
+ /** 点の大きさ(面積)を決める数値の列名。省略時は同じ大きさ。 */
1985
+ size?: keyof T & string;
1986
+ /** 点の色を決める列名。数値なら `tone` の単色の濃淡、文字ならカテゴリ色(`--chart-1..5` の出現順、6 つ目以降は「その他」)。 */
1987
+ color?: keyof T & string;
1988
+ /** 背景の地図。`"japan"`・`"us"`・`"world"`。既定 `"auto"`(全部の点が入る最も狭い地図)。 */
1989
+ basemap?: SymbolMapBasemap;
1990
+ /** 列名 → 表示名(ツールチップ・凡例・データ表)。 */
1991
+ labels?: Record<string, string>;
1992
+ /** 数値の書式(`color` の数値と、`sizeFormat` が無いときの `size`)。既定 `"number"`。 */
1993
+ format?: ValueFormat;
1994
+ /** `size` の値の書式。省略時は `format`。 */
1995
+ sizeFormat?: ValueFormat;
1996
+ /** 数値の `color` の濃淡の色。`"chart-1"`〜`"chart-5"` か意味色。既定 `"chart-1"`。 */
1997
+ tone?: ChartSeriesColor;
1998
+ /** 凡例(数値の色なら濃淡の帯、カテゴリなら色の一覧)を出す。既定 `true`。 */
1999
+ showLegend?: boolean;
2000
+ /** ホバーでツールチップを出す。既定 `true`。 */
2001
+ showTooltip?: boolean;
2002
+ /** ツールチップとデータ表に添える列。 */
2003
+ details?: (keyof T & string)[];
2004
+ /** 選択中の点(`name` 列の値)。渡すと、それ以外の点を薄くする。 */
2005
+ selected?: string[];
2006
+ /** 点のクリック。その行を受け取る(フィルターの操作に使う)。 */
2007
+ onSelect?: (row: T) => void;
2008
+ /** グラフの見出し。 */
2009
+ title?: string;
2010
+ /** グラフが言っていることの 1 文要約。 */
2011
+ summary?: string;
2012
+ /** 読み込み中。最終形と同じ高さのスケルトンを出す。 */
2013
+ isLoading?: boolean;
2014
+ /** `data` が空のときの表示。 */
2015
+ emptyState?: ChartEmptyState;
2016
+ /** プロット領域の高さ(px)。既定 288。 */
2017
+ height?: number;
2018
+ /** 生成した EChartsOption に最後に深くマージする逃げ道。 */
2019
+ chartOptions?: EChartsOption;
2020
+ /** グラフ右上に PNG 保存/コピーのボタンを出す。 */
2021
+ actions?: boolean | ChartActionsOptions;
2022
+ /** PNG 保存時のファイル名(拡張子つき)。 */
2023
+ fileName?: string;
2024
+ className?: string;
2025
+ /** スクリーンリーダー向けのラベル。 */
2026
+ ariaLabel?: string;
2027
+ }
2028
+ /** Generic over the row type, so the column keys are checked against `data`. */
2029
+ declare const SymbolMap: (<T extends Record<string, unknown>>(props: SymbolMapProps<T> & {
2030
+ ref?: Ref<HTMLDivElement>;
2031
+ }) => ReactElement) & {
2032
+ displayName?: string;
2033
+ };
2034
+
2035
+ /**
2036
+ * Treemap — parts of a whole as nested rectangles whose areas are the values.
2037
+ * Pass rows, the leaf column (`index`),
2038
+ * optionally a parent column (`group`, for two levels) and the number (`value`) instead of an ECharts option.
2039
+ *
2040
+ * Colour is categorical by `group` (or by `index` without one): `--chart-1..5` for the largest five, the rest the
2041
+ * 「その他」grey. A numeric `color` column shades each tile on a single-hue ramp of `tone` instead (like Heatmap).
2042
+ * Each tile carries its name and value when it fits. Values that are zero, negative or missing take no area; they
2043
+ * stay in the screen-reader table. Clicking a tile calls `onSelect` with its row.
2044
+ */
2045
+
2046
+ /** Columns of `T` that hold numbers (null / undefined allowed for gaps); untyped rows keep every key. */
2047
+ type NumericColumn<T> = {
2048
+ [K in keyof T]-?: unknown extends T[K] ? K : T[K] extends number | bigint | null | undefined ? K : never;
2049
+ }[keyof T] & string;
2050
+ interface TreemapProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
2051
+ /** 行の配列。1 行 = 1 タイル(集計済みの値)。 */
2052
+ data: T[];
2053
+ /** タイル(葉)の名前の列名。例 `"product"`。 */
2054
+ index: keyof T & string;
2055
+ /** 親の列名(2 階層にする)。例 `"category"`。省略時は 1 階層。 */
2056
+ group?: keyof T & string;
2057
+ /** タイルの面積を決める数値の列名。0 以下・欠損の行は面積を持たない(データ表には残る)。 */
2058
+ value: NumericColumn<T>;
2059
+ /** タイルの色を決める数値の列名(`tone` の単色の濃淡)。省略時は `group`(無ければ `index`)ごとのカテゴリ色。 */
2060
+ color?: NumericColumn<T>;
2061
+ /** 列名・値 → 表示名(タイル・ツールチップ・凡例・データ表)。 */
2062
+ labels?: Record<string, string>;
2063
+ /** `value` の書式。既定 `"number"`。 */
2064
+ format?: ValueFormat;
2065
+ /** `color` の値の書式。省略時は `format`。 */
2066
+ colorFormat?: ValueFormat;
2067
+ /** 書式を関数で直接渡す逃げ道(`value`)。`format` より優先する。 */
2068
+ valueFormatter?: ValueFormatter;
2069
+ /** 数値の `color` の濃淡の色。既定 `"chart-1"`。 */
2070
+ tone?: ChartSeriesColor;
2071
+ /** 凡例(カテゴリ色なら色の一覧、数値の色なら濃淡の帯)を出す。既定 `true`(カテゴリ色は `group` があるときだけ)。 */
2072
+ showLegend?: boolean;
2073
+ /** ホバーでツールチップを出す。既定 `true`。 */
2074
+ showTooltip?: boolean;
2075
+ /** タイルのクリック。その行を受け取る(フィルターの操作に使う)。 */
2076
+ onSelect?: (row: T) => void;
2077
+ /** グラフの見出し。 */
2078
+ title?: string;
2079
+ /** グラフが言っていることの 1 文要約。`"auto"` で最大のタイルとその構成比。 */
2080
+ summary?: string | "auto";
2081
+ /** 読み込み中。最終形と同じ高さのスケルトンを出す。 */
2082
+ isLoading?: boolean;
2083
+ /** `data` が空のときの表示。 */
2084
+ emptyState?: ChartEmptyState;
2085
+ /** プロット領域の高さ(px)。既定 288。 */
2086
+ height?: number;
2087
+ /** 生成した EChartsOption に最後に深くマージする逃げ道。 */
2088
+ chartOptions?: EChartsOption;
2089
+ /** グラフ右上に PNG 保存/コピーのボタンを出す。 */
2090
+ actions?: boolean | ChartActionsOptions;
2091
+ /** PNG 保存時のファイル名(拡張子つき)。 */
2092
+ fileName?: string;
2093
+ className?: string;
2094
+ /** スクリーンリーダー向けのラベル。 */
2095
+ ariaLabel?: string;
2096
+ }
2097
+ /** Generic over the row type, so the column keys are checked against `data`. */
2098
+ declare const Treemap: (<T extends Record<string, unknown>>(props: TreemapProps<T> & {
2099
+ ref?: Ref<HTMLDivElement>;
2100
+ }) => ReactElement) & {
2101
+ displayName?: string;
2102
+ };
306
2103
 
307
2104
  type SparklineVariant = "line" | "bar";
308
2105
  interface SparklineDataPoint {
@@ -316,11 +2113,103 @@ interface SparklineProps extends SVGAttributes<SVGSVGElement> {
316
2113
  /** Tailwind text-colour class; drives both stroke and fill via `currentColor`. */
317
2114
  color?: string;
318
2115
  area?: boolean;
2116
+ /** マウント時に線を引く / 棒を伸ばす。既定 `false`(`prefers-reduced-motion` では常に無効)。 */
319
2117
  animate?: boolean;
2118
+ /**
2119
+ * 点の強調(Tufte 流)。`"auto"` は最新・最大・最小の 3 点だけに小さな点を打つ
2120
+ * (最新は系列の色、最大・最小は muted)。`"latest"` は最新の 1 点だけ、`"none"` は線だけ。`variant="line"` のときだけ効く。既定 `"auto"`。
2121
+ */
2122
+ highlight?: ChartHighlight | "latest";
2123
+ /** 指定すると `role="img"` で読み上げ対象にする。省略時は装飾として `aria-hidden`。 */
2124
+ "aria-label"?: string;
320
2125
  className?: string;
321
2126
  }
322
2127
  declare const Sparkline: React.ForwardRefExoticComponent<SparklineProps & React.RefAttributes<SVGSVGElement>>;
323
2128
 
2129
+ declare module "@tanstack/react-table" {
2130
+ interface ColumnMeta<TData extends RowData, TValue> {
2131
+ /**
2132
+ * Classes put on the column's header and body cells — e.g.
2133
+ * `"hidden md:table-cell"` to drop a column on narrow screens.
2134
+ */
2135
+ className?: string;
2136
+ /**
2137
+ * 列の数値書式。`cell` を持たない列だけに効き、右寄せ・tabular-nums で描く。
2138
+ * 行ごとに通貨が変わるときは関数で行を受ける。CSV の「表示」値にも使われる。
2139
+ *
2140
+ * @example
2141
+ * meta: { format: "currency" }
2142
+ * meta: { format: (row) => ({ type: "currency", currency: row.currency, notation: "standard" }) }
2143
+ */
2144
+ format?: ValueFormat | ((row: TData) => ValueFormat);
2145
+ /**
2146
+ * 日付の列の書式(`formatDate` の `style`)。`cell` を持たない列だけに効く。左寄せ・tabular-nums で描き、
2147
+ * 値は `Date`・エポックミリ秒・日付文字列(`"2026-10-20"`、ISO 8601)。CSV の「表示」値にも使われる。
2148
+ * `format`(数値)とは併用しない。
2149
+ *
2150
+ * @example
2151
+ * meta: { dateFormat: "date" }
2152
+ * meta: { dateFormat: "datetime", nullLabel: "未更新" }
2153
+ */
2154
+ dateFormat?: DateStyle;
2155
+ /**
2156
+ * `dateFormat` の列の日時を出すタイムゾーン(IANA 名。例 `"Asia/Tokyo"`)。既定は実行環境(ブラウザ)のタイムゾーン。
2157
+ * サーバーとブラウザで表示が食い違う(SSR)なら固定する。`dateFormat` の列だけに効き、CSV の「表示」値にも同じ値を使う。
2158
+ * `"2026-10-20"` のような日付だけの文字列は、どのタイムゾーンでもその暦日のまま。
2159
+ *
2160
+ * @example
2161
+ * meta: { dateFormat: "datetime", timeZone: "Asia/Tokyo" }
2162
+ */
2163
+ timeZone?: string;
2164
+ /**
2165
+ * 値が無いときの表示。既定 `"—"`。null / undefined(数値は NaN も)に効き、文字列の列では空文字 `""` も値なしとして扱う。
2166
+ * `format` / `dateFormat` を持つ列と、書式なしの文字列の列に効く。`cell` を自前で書いた列には効かない(`cell` の中で扱う)。
2167
+ * CSV の「表示」値は、書式付き・日付の列だけ `nullLabel` で書き、書式なしの文字列の列は空欄のまま。
2168
+ *
2169
+ * @example
2170
+ * meta: { format: "number", nullLabel: "未集計" }
2171
+ * meta: { nullLabel: "未設定" } // 書式なしの文字列の列
2172
+ */
2173
+ nullLabel?: string;
2174
+ /**
2175
+ * 値の範囲でセルを意味色に塗り分ける規則(最初に当たった規則。どれにも当たらない値は通常色)。
2176
+ * `cell` を持たない列だけに効き、BarChart / BarList の `thresholds` と同じ型・同じ判定。
2177
+ * 色だけに頼らず、色に応じた記号(○ / △ / × / −)を値の前に添える。CSV は生の値のまま。
2178
+ *
2179
+ * @example
2180
+ * meta: { format: { type: "percent", divisor: 100 }, thresholds: [{ lt: 40, tone: "negative" }, { lt: 70, tone: "warning" }] }
2181
+ */
2182
+ thresholds?: ChartThreshold[];
2183
+ /**
2184
+ * 狭い幅で列を隠す順。数が小さい列から隠れる(表の置き場の幅が 1 は 640px 未満、2 は 520px 未満、3 は 400px 未満)。
2185
+ * 書かない列と 4 以上の列は、どの幅でも出す(部署名・離職率のような肝心の列に使う)。
2186
+ * 画面の幅ではなく、表を置いた場所の幅(コンテナ幅)で決まる。隠した列は DOM にも読み上げにも出ず、CSV の出力には含まれる。
2187
+ *
2188
+ * @example
2189
+ * meta: { format: "number", priority: 1 } // 幅が足りないときに最初に隠す
2190
+ */
2191
+ priority?: number;
2192
+ /**
2193
+ * true にすると、増減(`Delta`)など「直前の列の値との比較」を表示する列になる。表の置き場が 320px 未満に狭まると、
2194
+ * この列は隠れる代わりに、直前の列(値の列)のセルの下に同じ内容を小さく(text-xs)積んで出す。比較は消えない。
2195
+ * `priority` で隠す順は最後(どの列よりも後)になり、この列の `priority` は無視される。直前の列も `priority` に関わらず残る。
2196
+ * 列の `cell` に `<Delta variant="inline" … />` を書く。直前に列が無いときは積まず、通常の列として出す。CSV には通常の列として含まれる。
2197
+ *
2198
+ * @example
2199
+ * { accessorKey: "revenue", header: "売上", meta: { format: "currency" } },
2200
+ * { id: "revenueDelta", header: "前月比", meta: { comparison: true }, cell: ({ row }) => <Delta variant="inline" value={row.original.revenue} comparison={{ previous: row.original.prev, vs: "prior-period", grain: "month" }} /> }
2201
+ */
2202
+ comparison?: boolean;
2203
+ /**
2204
+ * 列の寄せ。見出し(ソートボタンを含む)とセルの両方に効く。既定は、`format` / `thresholds` の列と
2205
+ * `comparison` の列(増減 `Delta`)が `"right"`、それ以外は `"left"`。右寄せの列は tabular-nums で描く。
2206
+ *
2207
+ * @example
2208
+ * meta: { align: "right" }
2209
+ */
2210
+ align?: "left" | "right";
2211
+ }
2212
+ }
324
2213
  interface DataTableContextValue<TData> {
325
2214
  table: Table<TData>;
326
2215
  selectedRows: TData[];
@@ -331,6 +2220,7 @@ interface DataTableContextValue<TData> {
331
2220
  enablePagination: boolean;
332
2221
  enableRowSelection: boolean;
333
2222
  visibleColumnCount: number;
2223
+ isLoading: boolean;
334
2224
  }
335
2225
  /**
336
2226
  * @template TData 行データ型
@@ -345,7 +2235,8 @@ interface DataTableProps<TData, TValue> {
345
2235
  * literal が `string` に拡張され型エラーになる。
346
2236
  *
347
2237
  * @example
348
- * import type { ColumnDef } from "@squadbase/vantage/components"
2238
+ * import { DataTable, type ColumnDef } from "@/components/data-table"
2239
+ * // Vantage: import { DataTable, type ColumnDef } from "@squadbase/vantage/components"
349
2240
  *
350
2241
  * const columns: ColumnDef<User>[] = [
351
2242
  * { accessorKey: "id", header: "ID" },
@@ -366,12 +2257,54 @@ interface DataTableProps<TData, TValue> {
366
2257
  enablePagination?: boolean;
367
2258
  pagination?: PaginationState;
368
2259
  onPaginationChange?: OnChangeFn<PaginationState>;
2260
+ /**
2261
+ * サーバー側ページング時の総ページ数。指定すると manualPagination になる。
2262
+ *
2263
+ * @example
2264
+ * <DataTable pageCount={data.pageCount} … />
2265
+ */
369
2266
  pageCount?: number;
2267
+ /**
2268
+ * サーバー側ページング時の総件数。指定すると manualPagination になり、ページ数は
2269
+ * `rowCount / pageSize` から導かれ、「N件中」もこの値を使う(`pageCount` を同時に渡せばそちらが優先)。
2270
+ *
2271
+ * @example
2272
+ * <DataTable rowCount={1240} pagination={pagination} onPaginationChange={setPagination} … />
2273
+ */
2274
+ rowCount?: number;
2275
+ /**
2276
+ * true にすると絞り込みを表では行わず、`data` をそのまま使う(サーバー側で絞り込む)。
2277
+ *
2278
+ * @example
2279
+ * <DataTable manualFiltering globalFilter={q} onGlobalFilterChange={setQ} … />
2280
+ */
2281
+ manualFiltering?: boolean;
2282
+ /**
2283
+ * true にすると並べ替えを表では行わず、`data` の順をそのまま使う(サーバー側で並べ替える)。
2284
+ *
2285
+ * @example
2286
+ * <DataTable manualSorting sorting={sorting} onSortingChange={setSorting} … />
2287
+ */
2288
+ manualSorting?: boolean;
2289
+ /**
2290
+ * 読み込み中。Content はスケルトン行、Pagination のボタンは無効、表は aria-busy になる。
2291
+ *
2292
+ * @example
2293
+ * <DataTable isLoading={query.isFetching} … />
2294
+ */
2295
+ isLoading?: boolean;
370
2296
  enableRowSelection?: boolean;
371
2297
  rowSelection?: RowSelectionState;
372
2298
  onRowSelectionChange?: OnChangeFn<RowSelectionState>;
373
2299
  columnVisibility?: VisibilityState;
374
2300
  onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
2301
+ /**
2302
+ * TanStack Table の `meta`。表全体で共有する値(行を更新する関数など)を渡し、列定義の `cell` から
2303
+ * `table.options.meta` で読む。列ごとの書式は列定義の `meta.format` に書く(こちらではない)。
2304
+ *
2305
+ * @example
2306
+ * <DataTable meta={{ updateRow: (id, patch) => mutate({ id, patch }) }} … />
2307
+ */
375
2308
  meta?: TableMeta<TData>;
376
2309
  className?: string;
377
2310
  /** Required — the parts to render (toolbar, content, pagination). */
@@ -384,6 +2317,32 @@ interface DataTableToolbarProps extends HTMLAttributes<HTMLDivElement> {
384
2317
  }
385
2318
  interface DataTableContentProps extends HTMLAttributes<HTMLDivElement> {
386
2319
  }
2320
+ interface DataTableExportProps {
2321
+ /**
2322
+ * 保存するファイル名。既定 `"export.csv"`。
2323
+ *
2324
+ * @example
2325
+ * <DataTableExport fileName="sales-2025.csv" />
2326
+ */
2327
+ fileName?: string;
2328
+ /**
2329
+ * `"display"`(既定)は `meta.format` どおりの表示文字列、`"raw"` は生の値を書き出す。
2330
+ *
2331
+ * @example
2332
+ * <DataTableExport values="raw" />
2333
+ */
2334
+ values?: CsvValues;
2335
+ /**
2336
+ * `"filtered"`(既定)は並べ替え・絞り込み後の全ページ、`"page"` は表示中のページだけ。
2337
+ *
2338
+ * @example
2339
+ * <DataTableExport scope="page" />
2340
+ */
2341
+ scope?: CsvScope;
2342
+ /** ボタンの文言。既定はページの言語で `"CSV を書き出す"`(英語は `"Export CSV"`)。 */
2343
+ children?: ReactNode;
2344
+ className?: string;
2345
+ }
387
2346
  interface DataTablePaginationProps extends HTMLAttributes<HTMLDivElement> {
388
2347
  pageSizeOptions?: number[];
389
2348
  }
@@ -396,12 +2355,26 @@ interface DataTableColumnVisibilityProps {
396
2355
  type DataTablePresetProps<TData, TValue> = Omit<DataTableProps<TData, TValue>, "children"> & {
397
2356
  enableColumnVisibility?: boolean;
398
2357
  columnLabels?: Record<string, string>;
2358
+ /**
2359
+ * true にすると toolbar に CSV 書き出しボタン(`DataTableExport`)を置く。既定 false。
2360
+ *
2361
+ * @example
2362
+ * <DataTablePreset exportable … />
2363
+ */
2364
+ exportable?: boolean;
2365
+ /**
2366
+ * `exportable` のときの保存ファイル名。既定 `"export.csv"`。
2367
+ *
2368
+ * @example
2369
+ * <DataTablePreset exportable exportFileName="sales.csv" … />
2370
+ */
2371
+ exportFileName?: string;
399
2372
  /** Extension slots */
400
2373
  toolbar?: ReactNode;
401
2374
  bulkActions?: (selectedRows: TData[]) => ReactNode;
402
2375
  };
403
2376
  declare function useDataTable<TData>(): DataTableContextValue<TData>;
404
- declare function DataTable<TData, TValue>({ columns, data, enableSorting, sorting: sortingProp, onSortingChange, enableFiltering, columnFilters: columnFiltersProp, onColumnFiltersChange, globalFilter: globalFilterProp, onGlobalFilterChange, enablePagination, pagination: paginationProp, onPaginationChange, pageCount, enableRowSelection, rowSelection: rowSelectionProp, onRowSelectionChange, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, meta, className, children, }: DataTableProps<TData, TValue>): React.JSX.Element;
2377
+ declare function DataTable<TData, TValue>({ columns, data, enableSorting, sorting: sortingProp, onSortingChange, enableFiltering, columnFilters: columnFiltersProp, onColumnFiltersChange, globalFilter: globalFilterProp, onGlobalFilterChange, enablePagination, pagination: paginationProp, onPaginationChange, pageCount, rowCount, manualFiltering, manualSorting, isLoading, enableRowSelection, rowSelection: rowSelectionProp, onRowSelectionChange, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, meta, className, children, }: DataTableProps<TData, TValue>): React.JSX.Element;
405
2378
  declare namespace DataTable {
406
2379
  var displayName: string;
407
2380
  }
@@ -409,12 +2382,80 @@ declare const DataTableToolbar: React.ForwardRefExoticComponent<DataTableToolbar
409
2382
  declare const DataTableContent: React.ForwardRefExoticComponent<DataTableContentProps & React.RefAttributes<HTMLDivElement>>;
410
2383
  declare const DataTablePagination: React.ForwardRefExoticComponent<DataTablePaginationProps & React.RefAttributes<HTMLDivElement>>;
411
2384
  declare const DataTableColumnVisibility: React.ForwardRefExoticComponent<DataTableColumnVisibilityProps & React.RefAttributes<HTMLButtonElement>>;
2385
+ type CsvCell = string | number | null | undefined;
2386
+ type CsvValues = "display" | "raw";
2387
+ type CsvScope = "filtered" | "page";
2388
+ /**
2389
+ * CSV 文字列を作る純関数(RFC 4180: CRLF、`,` `"` 改行を含む欄は `"` で囲み `"` は二重化)。
2390
+ * 既定で BOM 付き UTF-8(Excel で文字化けしない)。`guardFormulas` が true の間、先頭が
2391
+ * `= + - @` の文字列欄には `'` を付けて数式として実行されないようにする(数値と符号付きの数値表記は除く)。
2392
+ *
2393
+ * @example
2394
+ * toCsv(["月", "売上"], [["2025-01", 1200], ["2025-02", null]])
2395
+ * // "\uFEFF月,売上\r\n2025-01,1200\r\n2025-02,"
2396
+ */
2397
+ declare function toCsv(header: string[], rows: CsvCell[][], options?: {
2398
+ bom?: boolean;
2399
+ guardFormulas?: boolean;
2400
+ }): string;
2401
+ /**
2402
+ * 表の現在の状態から CSV を作る。行は画面と同じ並べ替え・絞り込み後の順、列は表示中の列のみ。
2403
+ * `"display"` の書式のロケールは `locale`(既定はページのロケール、`<html lang>`)。
2404
+ *
2405
+ * @example
2406
+ * const csv = tableToCsv(table, { values: "raw", scope: "page" })
2407
+ */
2408
+ declare function tableToCsv<TData>(table: Table<TData>, { values, scope, locale: localeArg }?: {
2409
+ values?: CsvValues;
2410
+ scope?: CsvScope;
2411
+ locale?: string;
2412
+ }): string;
2413
+ /** toolbar に置く CSV 書き出しボタン。`useDataTable()` の table から画面と同じ順・同じ集合を書き出す。 */
2414
+ declare function DataTableExport({ fileName, values, scope, children, className, }: DataTableExportProps): React.JSX.Element;
2415
+ declare namespace DataTableExport {
2416
+ var displayName: string;
2417
+ }
412
2418
  /** The usual arrangement — toolbar, body and pagination — in one component. */
413
- declare function DataTablePreset<TData, TValue>({ enableColumnVisibility, columnLabels, toolbar, bulkActions, ...tableProps }: DataTablePresetProps<TData, TValue>): React.JSX.Element;
2419
+ declare function DataTablePreset<TData, TValue>({ enableColumnVisibility, columnLabels, exportable, exportFileName, toolbar, bulkActions, ...tableProps }: DataTablePresetProps<TData, TValue>): React.JSX.Element;
414
2420
  declare namespace DataTablePreset {
415
2421
  var displayName: string;
416
2422
  }
417
2423
 
2424
+ interface PivotTableProps<T extends Record<string, unknown> = Record<string, unknown>> {
2425
+ /** 集計済みの行の配列。1 行 = 1 マス(行の次元 × 列の次元の組)。同じ組が複数あれば後の行が勝つ(合計はしない)。 */
2426
+ data: T[];
2427
+ /** 行の次元の列名(左から入れ子)。例 `["region", "category"]`。空なら 1 行。 */
2428
+ rows: (keyof T & string)[];
2429
+ /** 列の次元の列名(上から入れ子)。例 `["year"]`。空なら列の見出しは値の名前だけ。 */
2430
+ columns: (keyof T & string)[];
2431
+ /** マスに出す数値の列名。2 つ以上なら列の次元ごとに小列に分かれる。 */
2432
+ values: (keyof T & string)[];
2433
+ /** 値ごとの書式。例 `{ sales: "currency", margin: "percent" }`。無い値は `"number"`。 */
2434
+ formats?: Partial<Record<string, ValueFormat>>;
2435
+ /** 列名・次元の値 → 表示名(見出しに反映)。 */
2436
+ labels?: Record<string, string>;
2437
+ /** 値でマスを塗る(ハイライト表)。`true` で全部の値(値ごとに最小〜最大)、値の列名でその値だけ。既定 `false`。 */
2438
+ highlight?: boolean | string;
2439
+ /** 塗りの色。`"chart-1"`〜`"chart-5"` か意味色。薄い → 濃いの単色。既定 `"chart-1"`。 */
2440
+ tone?: ChartSeriesColor;
2441
+ /** マスのクリック。そのマスの行を受け取る(フィルターの操作に使う)。値の無いマスでは呼ばない。 */
2442
+ onSelect?: (row: T) => void;
2443
+ /** 表の見出し。 */
2444
+ title?: string;
2445
+ /** 表が言っていることの 1 文要約。 */
2446
+ summary?: string;
2447
+ /** 読み込み中。スケルトンを出す。 */
2448
+ isLoading?: boolean;
2449
+ /** `data` が空のときの表示。 */
2450
+ emptyState?: ChartEmptyState;
2451
+ /** 表の箱の最大の高さ(px)。超えると箱の中で縦にスクロールし、見出しは上に残る。既定 480。 */
2452
+ maxHeight?: number;
2453
+ className?: string;
2454
+ /** スクリーンリーダー向けのラベル。省略時は見出し。 */
2455
+ ariaLabel?: string;
2456
+ }
2457
+ declare function PivotTable<T extends Record<string, unknown>>({ data, rows: rowDims, columns: colDims, values: valueKeys, formats, labels, highlight, tone, onSelect, title, summary, isLoading, emptyState, maxHeight, className, ariaLabel, }: PivotTableProps<T>): React.JSX.Element;
2458
+
418
2459
  interface FilterBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
419
2460
  value: FilterValues;
420
2461
  onChange: (values: FilterValues) => void;
@@ -428,9 +2469,15 @@ interface FilterBarSelectProps {
428
2469
  label: string;
429
2470
  options: FilterOption[];
430
2471
  placeholder?: string;
2472
+ /**
2473
+ * 渡すと、選択肢の先頭に「絞り込まない」項目をこの文言で足す(例: `"すべて"`)。選ぶとこのキーを値から外す(`undefined`)ので、
2474
+ * アクティブチップにも出ない。絞り込んでいないときのトリガーは `placeholder`(既定は `label`)のまま。既定は足さない。
2475
+ * @example allLabel="すべて"
2476
+ */
2477
+ allLabel?: string;
431
2478
  className?: string;
432
2479
  }
433
- declare function FilterBarSelect({ filterKey, label, options, placeholder, className, }: FilterBarSelectProps): React.JSX.Element;
2480
+ declare function FilterBarSelect({ filterKey, label, options, placeholder, allLabel, className, }: FilterBarSelectProps): React.JSX.Element;
434
2481
  declare namespace FilterBarSelect {
435
2482
  var displayName: string;
436
2483
  }
@@ -455,7 +2502,7 @@ declare namespace FilterBarActiveChips {
455
2502
  var displayName: string;
456
2503
  }
457
2504
  interface FilterBarClearButtonProps {
458
- /** Override the button label. Defaults to "クリア". */
2505
+ /** Override the button label. Defaults to "Clear" (ja: "クリア"). */
459
2506
  label?: string;
460
2507
  className?: string;
461
2508
  }
@@ -476,23 +2523,51 @@ declare namespace FilterBarPreset {
476
2523
  var displayName: string;
477
2524
  }
478
2525
 
2526
+ /**
2527
+ * フォールバック(`en-US`:英語・1 月始まり・日曜始まり)のプリセット。DateRangePicker は `presets` を渡さなければ
2528
+ * ページのロケールからプリセットを作るので、これを渡す必要はない。`locale` / `fiscalYearStartMonth` を変えるなら
2529
+ * `createDatePresets` か DateRangePicker の同名 props。
2530
+ */
479
2531
  declare const defaultPresets: PresetItem[];
480
2532
  interface DateRangePickerProps {
481
2533
  /**
482
- * 選択中の日付範囲。型は Vantage 独自の `DateRange`。
2534
+ * 選択中の日付範囲。型はこの部品独自の `DateRange`。
483
2535
  * react-day-picker の `DateRange` とは別物なので注意 — そちらが必要なら
484
2536
  * このファイルの末尾で re-export している `RdpDateRange` を使う。
485
2537
  *
486
2538
  * @example
487
- * import type { DateRange } from "@squadbase/vantage/components"
2539
+ * import { DateRangePicker, type DateRange } from "@/components/date-range-picker"
2540
+ * // Vantage: import { DateRangePicker, type DateRange } from "@squadbase/vantage/components"
488
2541
  *
489
2542
  * const [range, setRange] = useState<DateRange | undefined>()
490
2543
  * <DateRangePicker value={range} onChange={setRange} />
491
2544
  */
492
2545
  value?: DateRange;
493
2546
  onChange?: (range: DateRange) => void;
2547
+ /**
2548
+ * ショートカットの一覧。指定すると `locale` / `fiscalYearStartMonth` による既定の一覧の代わりに使う。
2549
+ *
2550
+ * @example
2551
+ * presets={[{ label: "直近 10 日", getValue: () => ({ from: subDays(new Date(), 9), to: new Date() }) }]}
2552
+ */
494
2553
  presets?: PresetItem[];
495
2554
  showPresets?: boolean;
2555
+ /**
2556
+ * プリセットのラベル・日付の書式・カレンダーの月名と曜日・週の始まりのロケール。`ja*` なら日本語、それ以外は英語。
2557
+ * 既定はページのロケール(`<html lang>`、無ければ `"en-US"`)。
2558
+ *
2559
+ * @example
2560
+ * <DateRangePicker locale="ja-JP" />
2561
+ */
2562
+ locale?: string;
2563
+ /**
2564
+ * 年度の開始月(1-12)。「今年度」「前年度」と、年度基準の「今四半期」「前四半期」の区切りになる。
2565
+ * 既定はロケールで決まる(ja は `4`、それ以外は `1`)。範囲外・整数でない値はその既定として扱う。
2566
+ *
2567
+ * @example
2568
+ * <DateRangePicker fiscalYearStartMonth={1} />
2569
+ */
2570
+ fiscalYearStartMonth?: number;
496
2571
  maxDate?: Date;
497
2572
  minDate?: Date;
498
2573
  placeholder?: string;
@@ -553,29 +2628,312 @@ declare const metricValueVariants: (props?: ({
553
2628
  } & class_variance_authority_types.ClassProp) | undefined) => string;
554
2629
  interface MetricValueProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof metricValueVariants> {
555
2630
  }
2631
+ /** @deprecated KPI の数字は KpiCard を使う。 */
556
2632
  declare const MetricValue: React.ForwardRefExoticComponent<MetricValueProps & React.RefAttributes<HTMLDivElement>>;
557
2633
  interface MetricUnitProps extends HTMLAttributes<HTMLSpanElement> {
558
2634
  }
2635
+ /** @deprecated KPI の単位は KpiCard の `format`(`{ type: "number", unit: "社" }`)で付ける。 */
559
2636
  declare const MetricUnit: React.ForwardRefExoticComponent<MetricUnitProps & React.RefAttributes<HTMLSpanElement>>;
560
2637
 
2638
+ /**
2639
+ * Lightweight KPI insights: progress toward a target (with a simple linear pace
2640
+ * projection) and "highest / lowest in N periods" record detection. No statistics.
2641
+ *
2642
+ * Both follow `polarity`: for a lower-is-better metric (churn, cost) the target
2643
+ * is met at or below it, and the record is the lowest value, never the highest.
2644
+ */
2645
+
2646
+ interface KpiPeriod {
2647
+ start: Date | string | number;
2648
+ end: Date | string | number;
2649
+ }
2650
+ interface TargetProgress {
2651
+ target: number;
2652
+ /**
2653
+ * Distance left to the target, never negative: `target − current` when higher
2654
+ * is better, `current − target` when lower is better. 0 once achieved.
2655
+ */
2656
+ remaining: number;
2657
+ /** Whether the current value meets the target (≥ for higher-is-better, ≤ for lower-is-better). */
2658
+ achieved: boolean;
2659
+ /**
2660
+ * How far the target is met, as a ratio: `current / target` when higher is
2661
+ * better, `target / current` when lower is better (1 = exactly on target).
2662
+ */
2663
+ achievement: number;
2664
+ /** achievement / elapsed when the period is in progress, else null. Higher-is-better only. */
2665
+ projected: number | null;
2666
+ /** Fraction of the period elapsed at `now`, or null without a valid period. */
2667
+ elapsed: number | null;
2668
+ }
2669
+ declare function computeTargetProgress(current: number | null | undefined, target: number | null | undefined, options?: {
2670
+ period?: KpiPeriod;
2671
+ now?: Date | number;
2672
+ polarity?: Polarity;
2673
+ }): TargetProgress | null;
2674
+ /** @deprecated Use `PeriodGrain` (same values). */
2675
+ type HistoryGrain = PeriodGrain;
2676
+ /**
2677
+ * The grain of a period from its length: ~1 day, 7 days, 28–31 days, 89–92 days
2678
+ * or 365–366 days. Anything else (a custom range) returns undefined.
2679
+ */
2680
+ declare function inferPeriodGrain(period: KpiPeriod | null | undefined): PeriodGrain | undefined;
2681
+ interface RecordInsight {
2682
+ span: number;
2683
+ grain: PeriodGrain;
2684
+ /** "highest" for higher-is-better, "lowest" for lower-is-better. */
2685
+ kind: "highest" | "lowest";
2686
+ label: string;
2687
+ }
2688
+ /** Fewer finite points than this never yields a record. */
2689
+ declare const RECORD_MIN_POINTS = 6;
2690
+ /**
2691
+ * The latest point is a record when it beats every earlier finite point:
2692
+ * strictly highest for higher-is-better, strictly lowest for lower-is-better.
2693
+ * `locale` picks the language of `label` ("Highest in 12 months" / "過去 12 か月で最高"); default the page's (`<html lang>`).
2694
+ */
2695
+ declare function detectRecord(history: ReadonlyArray<number | null | undefined> | null | undefined, grain?: PeriodGrain, polarity?: Polarity, locale?: string): RecordInsight | null;
2696
+
2697
+ interface KpiCardSource {
2698
+ /** Period the data covers (e.g. "2023-04 以降"). ISO year-months / dates in it are written by the card ("2023年4月 以降"). */
2699
+ period?: string;
2700
+ /** Number of rows aggregated; formatted by the card ("48,210件から集計"). */
2701
+ count?: number;
2702
+ /**
2703
+ * 集計から除いた行数。出典の脚注に「12件を除外」と添える(ja 以外は「12 excluded」)。0 や負の値は出さない。
2704
+ * 除外の理由(テスト用アカウント、欠損など)は `note` に書く。
2705
+ * @example source={{ count: 48_210, excluded: 12, note: "テスト用アカウントを除外" }}
2706
+ */
2707
+ excluded?: number;
2708
+ /** Data source name (e.g. "Snowflake"). */
2709
+ name?: string;
2710
+ /** 換算・税抜などの脚注。フッターに出す。例: `note: "税抜、1 ドル=150 円で換算"`。数字を使う説明は summary ではなくここへ。 */
2711
+ note?: string;
2712
+ }
2713
+ interface KpiCardProps extends Omit<ComponentProps<"div">, "children"> {
2714
+ /** Metric name (tier 1). */
2715
+ label: string;
2716
+ /** Current value (tier 2). null / undefined renders "—". */
2717
+ value: number | null | undefined;
2718
+ /**
2719
+ * Value format, also used for previous / target / remaining. Default `"compact"`.
2720
+ * `"currency"` is JPY in 万・億 on a ja page (USD in K・M・B otherwise); `"percent"` takes a ratio (0.021 → 2.1%) and
2721
+ * switches the delta to points. See `formatValue` for the full table.
2722
+ */
2723
+ format?: ValueFormat;
2724
+ /** Locale of the numbers and the built-in wording. Default: the page's (`<html lang>`, else `"en-US"`). */
2725
+ locale?: string;
2726
+ /**
2727
+ * What the value is compared against; drives the delta (tier 3) and previous line (tier 4).
2728
+ * 前期・前年・目標以外は `vs: "custom"` + `label`(バッジの呼び名。末尾の「比」を外した語が前期実績行の呼び名になる)。
2729
+ * @example comparison={{ previous: 617, vs: "custom", label: "昨日比" }}
2730
+ */
2731
+ comparison?: Comparison;
2732
+ /**
2733
+ * 前年比と前月比など、複数の比較を併記する。先頭だけが前期実績行と summary に使われ、2 つ目以降は Delta 行のみ。`comparison` も渡したらそれが先頭。バッジは値の下に並ぶ。
2734
+ * @example comparisons={[{ previous: 4_290, vs: "prior-period", grain: "month" }, { previous: 3_900, vs: "prior-year", grain: "month" }]} / comparisons={[{ previous: 617, vs: "custom", label: "昨日比" }, { previous: 590, vs: "custom", label: "先週の同じ曜日比" }]}
2735
+ */
2736
+ comparisons?: Comparison[];
2737
+ /**
2738
+ * 確定前の値。値の隣に「速報」バッジを出し、目標の「達成」を言い切らず、最高記録の判定も出さない。
2739
+ * @example provisional / provisional={{ label: "暫定" }}
2740
+ */
2741
+ provisional?: boolean | {
2742
+ label?: string;
2743
+ };
2744
+ /** Which direction is good: `"up"` (default) or `"down"` (churn, error rate). Wins over `polarity`. */
2745
+ betterWhen?: "up" | "down";
2746
+ /** @deprecated Older name of `betterWhen` (`"higher-is-better"` / `"lower-is-better"`). `"neutral"` (never colours the change, skips the target and record logic) is only reachable here. `betterWhen` wins if both are given. */
2747
+ polarity?: Polarity;
2748
+ /** `"relative"` ("+12.4%"), `"points"` ("-0.5pt") or `"difference"` ("+¥530万", in `format`). Default: points for a `percent` format, else relative. */
2749
+ change?: ChangeDisplay;
2750
+ /** Absolute ratio below which the change reads as flat. Default 0.01. */
2751
+ neutralBand?: number;
2752
+ /** Show the previous actual ("前月 400"). Default true; needs `comparison`. */
2753
+ showPrevious?: boolean;
2754
+ /** Conclusion sentence template (tier 5); see the placeholders above. */
2755
+ summary?: string;
2756
+ /**
2757
+ * Target for the current period. Under the value it adds a 6px bar (actual, the pace
2758
+ * projection, a tick at the target) and one line "目標の 49%・このペースなら 98%"
2759
+ * (the projection only while `period` is in progress). With `betterWhen="down"`
2760
+ * or a rate target (points) there is no bar: "目標 … まであと …" in the footer.
2761
+ */
2762
+ target?: number;
2763
+ /**
2764
+ * 目標行・見込み行での目標の呼び名。既定「目標」。予算・計画・ノルマなど業務の言葉に合わせる。
2765
+ * @example targetLabel="予算" // 予算まであと ¥2,934万(98.1% 達成)
2766
+ */
2767
+ targetLabel?: string;
2768
+ /**
2769
+ * 目標に対する進み具合の出し方。`"achievement"` は達成率(現在値 ÷ 目標。「98.1% 達成」)、`"points"` は目標との差(「あと 2.8pt」)。
2770
+ * 既定は `format` から決まる: `percent`(率)は `"points"`(率を率で割った達成度は読めない)、それ以外は `"achievement"`。
2771
+ * `"points"` のとき `{achievement}` は目標との符号付きの差("-2.8pt")になり、見込み行は出ない。
2772
+ */
2773
+ targetDisplay?: "achievement" | "points";
2774
+ /** Current period; with `target`, adds a pace projection while the period is in progress. */
2775
+ period?: KpiPeriod;
2776
+ /** Series ending at the current period (last point = `value`); adds a record badge. */
2777
+ history?: ReadonlyArray<number | null | undefined>;
2778
+ /** Grain of `history` (and of the comparison labels). Default: inferred from `period`, else `"month"` for the record. */
2779
+ historyGrain?: PeriodGrain;
2780
+ /**
2781
+ * `history` が 6 点以上あるとき、フッター末尾に軸なしのスパークライン(高さ 32px・`--chart-1`・最新点だけドット)を出す。既定 true。
2782
+ * 推移を出したくないカードは `showHistory={false}`(記録バッジは `history` があれば出る)。
2783
+ * @example showHistory={false}
2784
+ */
2785
+ showHistory?: boolean;
2786
+ /** Data source footnote. */
2787
+ source?: KpiCardSource;
2788
+ /** When the data was last refreshed: "3 分前に更新". 出し方は `updatedAtDisplay`。 */
2789
+ updatedAt?: Date | string | number;
2790
+ /**
2791
+ * `updatedAt` の出し方。`"relative"`(既定)は「3 分前に更新」、`"absolute"` は「2026/10/20 14:30 に更新」、
2792
+ * `"both"` は「2026/10/20 14:30 に更新(3 分前)」。絶対時刻は実行環境のタイムゾーンで出す(`timeZone` で固定できる)。
2793
+ * 画面を印刷・スクリーンショットで残すなら、時間が経っても読める `"absolute"` か `"both"`。
2794
+ * @example updatedAtDisplay="absolute"
2795
+ */
2796
+ updatedAtDisplay?: "relative" | "absolute" | "both";
2797
+ /**
2798
+ * `updatedAt` の絶対時刻(`updatedAtDisplay` が `"absolute"` / `"both"`)を出すタイムゾーン(IANA 名。例 `"Asia/Tokyo"`)。
2799
+ * 既定は実行環境(ブラウザ)のタイムゾーン。サーバーとブラウザで表示が食い違う(SSR)なら固定する。「3 分前」には影響しない。
2800
+ * @example updatedAtDisplay="absolute" timeZone="Asia/Tokyo"
2801
+ */
2802
+ timeZone?: string;
2803
+ /** Reference time for the projection and relative time (for deterministic rendering). */
2804
+ now?: Date | number;
2805
+ /** Render a skeleton with the final shape instead of the values. */
2806
+ isLoading?: boolean;
2807
+ /**
2808
+ * `"sm"` は Sheet の中など狭い場所で 2 枚を横に並べるときの小さいサイズ。値の文字と余白が一段小さくなり、スパークラインは出さない。既定 `"default"`。
2809
+ * @example size="sm"
2810
+ */
2811
+ size?: "default" | "sm";
2812
+ }
2813
+ /**
2814
+ * Fill `{name}` placeholders from `values`. Unknown names stay as written.
2815
+ *
2816
+ * Without `fallback`, a known name whose value is null / undefined / empty
2817
+ * becomes "—". With `fallback`, any such missing value replaces the whole
2818
+ * sentence with `fallback` (which may be null to drop it).
2819
+ */
2820
+ declare function fillKpiTemplate(template: string, values: Readonly<Record<string, string | null | undefined>>): string;
2821
+ declare function fillKpiTemplate(template: string, values: Readonly<Record<string, string | null | undefined>>, fallback: string | null): string | null;
2822
+ declare function KpiCard({ label, value, format, locale: localeProp, comparison: comparisonProp, comparisons, provisional, betterWhen, polarity: polarityProp, change, neutralBand, showPrevious, summary, target, targetLabel, targetDisplay, period, history, historyGrain, showHistory, source, updatedAt, updatedAtDisplay, timeZone, now, isLoading, size, className, ...props }: KpiCardProps): React.JSX.Element;
2823
+
2824
+ declare const deltaVariants: (props?: ({
2825
+ variant?: "inline" | "badge" | null | undefined;
2826
+ sentiment?: "negative" | "neutral" | "positive" | null | undefined;
2827
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
2828
+ interface DeltaProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children">, Pick<VariantProps<typeof deltaVariants>, "variant"> {
2829
+ /** The current value. The previous one comes from `comparison`. */
2830
+ value: number | null | undefined;
2831
+ /** What the value is compared against. Required so the delta always carries its label. */
2832
+ comparison: Comparison;
2833
+ /** Which direction is good: `"up"` (default) or `"down"` (churn, error rate). Wins over `polarity`. */
2834
+ betterWhen?: "up" | "down";
2835
+ /** @deprecated Older name of `betterWhen` (`"higher-is-better"` / `"lower-is-better"`); `"neutral"` is only reachable here. `betterWhen` wins if both are given. */
2836
+ polarity?: Polarity;
2837
+ /** Absolute ratio below which the change reads as flat (0.01 = 1%). Default 0.01. */
2838
+ neutralBand?: number;
2839
+ /** Format of the metric itself; a `percent` metric shows its change in points. */
2840
+ format?: ValueFormat;
2841
+ /**
2842
+ * `"relative"` ("+12.4%"), `"points"` ("-0.5pt") or `"difference"` (the absolute difference in the
2843
+ * metric's own `format`, "+¥530万"). Default: points for a `percent` format, else relative.
2844
+ */
2845
+ change?: ChangeDisplay;
2846
+ /**
2847
+ * 変化(`"relative"` の率・`"points"` の pt)の小数桁数。固定で、末尾の 0 も出す。例: `digits={2}` → "+0.14pt"。
2848
+ * 同じカード群で桁がばらつかないよう、全部に同じ値を渡す。未指定は 1 桁("+14.0%")。`"points"` は未指定のとき `format.digits` に従う。
2849
+ */
2850
+ digits?: number;
2851
+ /** Locale for the change and its label. Default: the page's (`<html lang>`, else `"en-US"`). */
2852
+ locale?: string;
2853
+ /** Show the comparison label ("前月比") after the change. Default true. */
2854
+ showLabel?: boolean;
2855
+ }
2856
+ /** Text shown when the values cannot be compared (no previous value, or a zero baseline): the same "—" as every missing value. */
2857
+ declare const DELTA_NOT_COMPARABLE = "\u2014";
2858
+ declare const Delta: React.ForwardRefExoticComponent<DeltaProps & React.RefAttributes<HTMLSpanElement>>;
2859
+
2860
+ /**
2861
+ * @deprecated 新規は Delta を使う。value/direction を別々に受けるため食い違える(C4)。
2862
+ */
561
2863
  interface TrendIndicatorProps {
562
2864
  value: number;
563
2865
  direction: TrendDirection;
564
2866
  positiveIsGood?: boolean;
565
2867
  className?: string;
566
2868
  }
2869
+ /**
2870
+ * Arrow plus percentage change.
2871
+ *
2872
+ * @deprecated 新規は Delta を使う。value/direction を別々に受けるため食い違える(C4)。
2873
+ */
567
2874
  declare const TrendIndicator: React.ForwardRefExoticComponent<TrendIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
568
2875
 
569
2876
  interface StatusBadgeProps {
570
2877
  status: string;
571
2878
  label?: string;
2879
+ /** status → tone (`positive` | `negative` | `warning` | `info` | `neutral`) or legacy colour name. */
572
2880
  colorMap?: Partial<Record<string, string>>;
573
2881
  className?: string;
574
2882
  }
575
2883
  declare const StatusBadge: React.ForwardRefExoticComponent<StatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
576
2884
 
2885
+ declare function formatRelativeTime(date: Date | string | number, options?: {
2886
+ now?: Date | number;
2887
+ locale?: string;
2888
+ }): string;
2889
+
577
2890
  interface PlaceholderProps extends HTMLAttributes<HTMLSpanElement> {
578
2891
  }
579
2892
  declare const Placeholder: React.ForwardRefExoticComponent<PlaceholderProps & React.RefAttributes<HTMLSpanElement>>;
580
2893
 
581
- export { AppShell, type AppShellHeaderProps, type AppShellProps, type AppShellSidebarProps, DashboardCard, DashboardCardAction, type DashboardCardActionProps, DashboardCardContent, type DashboardCardContentProps, DashboardCardDescription, type DashboardCardDescriptionProps, DashboardCardFooter, type DashboardCardFooterProps, DashboardCardHeader, type DashboardCardHeaderProps, DashboardCardPreset, type DashboardCardPresetProps, type DashboardCardProps, DashboardCardSkeleton, type DashboardCardSkeletonProps, DashboardCardTitle, type DashboardCardTitleProps, DataTable, DataTableColumnVisibility, type DataTableColumnVisibilityProps, DataTableContent, type DataTableContentProps, DataTablePagination, type DataTablePaginationProps, DataTablePreset, type DataTablePresetProps, type DataTableProps, DataTableToolbar, type DataTableToolbarProps, type DateRange, DateRangePicker, type DateRangePickerProps, EChart, type EChartProps, FilterBar, FilterBarActiveChips, type FilterBarActiveChipsProps, FilterBarClearButton, type FilterBarClearButtonProps, FilterBarMultiSelect, type FilterBarMultiSelectProps, FilterBarPreset, type FilterBarPresetProps, type FilterBarProps, FilterBarSelect, type FilterBarSelectProps, type FilterConfig, type FilterOption, type FilterType, type FilterValues, type FunnelStep, FunnelSteps, type FunnelStepsProps, type MetricItem, MetricUnit, type MetricUnitProps, MetricValue, type MetricValueProps, type MetricVariant, MultiSelect, type MultiSelectProps, type NavGroup, type NavItem, PageShell, PageShellActions, type PageShellActionsProps, PageShellContent, type PageShellContentProps, PageShellDescription, type PageShellDescriptionProps, PageShellHeader, PageShellHeaderEnd, type PageShellHeaderEndProps, type PageShellHeaderProps, PageShellHeading, type PageShellHeadingProps, PageShellMeta, type PageShellMetaProps, type PageShellProps, PageShellSummary, PageShellSummaryCard, type PageShellSummaryCardProps, type PageShellSummaryProps, PageShellTitle, type PageShellTitleProps, Placeholder, type PlaceholderProps, type PresetItem, SearchableSelect, type SearchableSelectProps, SectionHeader, type SectionHeaderProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SelectOption, type SelectOptionGroup, type SelectOptions, Sparkline, type SparklineDataPoint, type SparklineProps, type SparklineVariant, StatusBadge, type StatusBadgeProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, defaultPresets, flattenOptions, funnelStepsVariants, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, useDataTable };
2894
+ /**
2895
+ * The mark's wording in English (the fallback language). Without a `label`, the mark follows the page's
2896
+ * language (`<html lang>`): ja reads「見本の値」.
2897
+ */
2898
+ declare const DEFAULT_SAMPLE_LABEL: string;
2899
+ interface SampleState {
2900
+ label: string;
2901
+ }
2902
+ /**
2903
+ * The mark a card inside `SampleData` should show, or null. A card that shows it wraps its
2904
+ * content in `<SampleClaim>` so the parts inside do not show it again.
2905
+ */
2906
+ declare function useSampleMark(): SampleState | null;
2907
+ /** Ends the `SampleData` scope for the parts inside a card that already shows the mark. */
2908
+ declare function SampleClaim({ children }: {
2909
+ children?: ReactNode;
2910
+ }): React.JSX.Element;
2911
+ interface SampleBadgeProps extends HTMLAttributes<HTMLSpanElement> {
2912
+ /** 印の文言。既定はページの言語で「見本の値」(英語は "Sample data")。 */
2913
+ label?: string;
2914
+ }
2915
+ declare function SampleBadge({ label, className, ...props }: SampleBadgeProps): React.JSX.Element;
2916
+ interface SampleDataProps {
2917
+ /** 印の文言。既定はページの言語で「見本の値」(英語は "Sample data")。 */
2918
+ label?: string;
2919
+ children?: ReactNode;
2920
+ }
2921
+ declare function SampleData({ label, children }: SampleDataProps): React.JSX.Element;
2922
+
2923
+ interface DraftChartProps {
2924
+ /** The proposed chart: one card (e.g. `DashboardCardPreset`), as it would sit in the page. */
2925
+ children: ReactElement;
2926
+ }
2927
+ /**
2928
+ * A chart proposed to the page that nobody has accepted yet. Accepting it removes the
2929
+ * `<DraftChart>` tags and keeps the child; removing it deletes the whole element. Both are
2930
+ * source edits made outside the framework — this component only decides what each build shows.
2931
+ *
2932
+ * - `vantage build` (published dashboards): renders nothing, so viewers never see a proposal.
2933
+ * - `vantage dev` (the editor preview): renders the child faded under the page background, and
2934
+ * marks the child's root element with `data-sq-draft` so the editor can find it and draw its
2935
+ * own controls over it. The component itself draws no buttons or text.
2936
+ */
2937
+ declare function DraftChart({ children }: DraftChartProps): React.JSX.Element | null;
2938
+
2939
+ export { AppShell, type AppShellHeaderProps, type AppShellProps, type AppShellSidebarProps, AreaChart, type AreaChartProps, type AttentionKind, AttentionList, type AttentionListProps, BarChart, type BarChartProps, BarList, type BarListItem, type BarListOptions, type BarListProps, type BarListSortOrder, BoxPlotChart, type BoxPlotChartProps, type BoxPlotGroup, COMPARISON_LABELS, CategoryBar, type CategoryBarMarker, type CategoryBarProps, type ChangeDisplay, type ChartActionsOptions, type ChartAnnotation, type ChartColor, type ChartColorToken, type ChartColors, type ChartCommonProps, type ChartComparison, type ChartEmptyState, type ChartEventPayload, type ChartForecast, type ChartForecastRow, ChartFrame, type ChartFrameProps, type ChartHighlight, type ChartRootAttributes, type ChartSeriesColor, type ChartSkeletonVariant, type ChartThreshold, type ChartTone, type ComboAxis, ComboChart, type ComboChartProps, type ComboReferenceLine, type ComboSeries, type ComboSeriesType, type Comparison, type ComparisonKind, type ComparisonOptions, type ComparisonResult, DEFAULT_SAMPLE_LABEL, DELTA_NOT_COMPARABLE, DashboardCard, DashboardCardAction, type DashboardCardActionProps, DashboardCardContent, type DashboardCardContentProps, DashboardCardDescription, type DashboardCardDescriptionProps, DashboardCardFooter, type DashboardCardFooterProps, DashboardCardHeader, type DashboardCardHeaderProps, DashboardCardPreset, type DashboardCardPresetProps, type DashboardCardProps, DashboardCardSkeleton, type DashboardCardSkeletonProps, DashboardCardTitle, type DashboardCardTitleProps, DataTable, DataTableColumnVisibility, type DataTableColumnVisibilityProps, DataTableContent, type DataTableContentProps, DataTableExport, type DataTableExportProps, DataTablePagination, type DataTablePaginationProps, DataTablePreset, type DataTablePresetProps, type DataTableProps, DataTableToolbar, type DataTableToolbarProps, type DateRange, DateRangePicker, type DateRangePickerProps, DateStyle, Delta, type DeltaDirection, type DeltaProps, type DeltaSentiment, DonutChart, type DonutChartOptions, type DonutChartProps, type DonutVariant, DraftChart, type DraftChartProps, EChart, type EChartProps, FilledMap, type FilledMapName, type FilledMapProps, FilterBar, FilterBarActiveChips, type FilterBarActiveChipsProps, FilterBarClearButton, type FilterBarClearButtonProps, FilterBarMultiSelect, type FilterBarMultiSelectProps, FilterBarPreset, type FilterBarPresetProps, type FilterBarProps, FilterBarSelect, type FilterBarSelectProps, type FilterConfig, type FilterOption, type FilterType, type FilterValues, ForecastChart, type ForecastChartProps, type ForecastComponent, type ForecastOptions, type ForecastPeriod, type FunnelStep, FunnelSteps, type FunnelStepsProps, Heatmap, type HeatmapProps, HistogramChart, type HistogramChartProps, type HistogramThreshold, type HistoryGrain, KpiCard, type KpiCardProps, type KpiCardSource, type KpiPeriod, Legend, type LegendProps, LineChart, type LineChartProps, type MetricItem, MetricUnit, type MetricUnitProps, MetricValue, type MetricValueProps, type MetricVariant, MultiSelect, type MultiSelectProps, type NavGroup, type NavItem, type NumericKeys, PageShell, PageShellActions, type PageShellActionsProps, PageShellContent, type PageShellContentProps, PageShellDescription, type PageShellDescriptionProps, PageShellHeader, PageShellHeaderEnd, type PageShellHeaderEndProps, type PageShellHeaderProps, PageShellHeading, type PageShellHeadingProps, PageShellMeta, type PageShellMetaProps, type PageShellProps, PageShellSummary, PageShellSummaryCard, type PageShellSummaryCardProps, type PageShellSummaryProps, PageShellTitle, type PageShellTitleProps, PairedChart, type PairedChartProps, type PairedPanel, type PeriodGrain, PivotTable, type PivotTableProps, Placeholder, type PlaceholderProps, type Polarity, type PresetItem, ProgressCircle, type ProgressCircleProps, RECORD_MIN_POINTS, type RecordInsight, SampleBadge, type SampleBadgeProps, SampleClaim, SampleData, type SampleDataProps, ScatterChart, type ScatterChartProps, type ScatterReferenceLine, SearchableSelect, type SearchableSelectProps, SectionHeader, type SectionHeaderProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SelectOption, type SelectOptionGroup, type SelectOptions, Sparkline, type SparklineDataPoint, type SparklineProps, type SparklineVariant, StatusBadge, type StatusBadgeProps, SymbolMap, type SymbolMapBasemap, type SymbolMapProps, type TargetProgress, Tracker, type TrackerBlock, type TrackerProps, Treemap, type TreemapProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, UpdatedAt, type UpdatedAtProps, ValueFormat, type ValueFormatter, WaterfallChart, type WaterfallChartProps, type WaterfallMode, comparisonBaseline, comparisonLabel, computeComparison, computeTargetProgress, defaultChangeDisplay, defaultPresets, deltaVariants, detectRecord, fillKpiTemplate, flattenOptions, formatChange, formatChangeAmount, formatRelativeTime, funnelStepsVariants, inferPeriodGrain, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, tableToCsv, toCsv, toneForValue, useDataTable, useResolvedChartColors, useSampleMark };