@squadbase/vantage 0.6.2-dev1.42c4e48 → 0.6.2-dev1.81c1bbe

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 (240) hide show
  1. package/dist/{build-MFWRPYKW.js → build-X5NVCQKT.js} +4 -4
  2. package/dist/{build-MFWRPYKW.js.map → build-X5NVCQKT.js.map} +1 -1
  3. package/dist/chunk-2IAPIOPS.js +152 -0
  4. package/dist/chunk-2IAPIOPS.js.map +1 -0
  5. package/dist/{chunk-IBGOCWJB.js → chunk-2ICNHUG6.js} +186 -82
  6. package/dist/chunk-2ICNHUG6.js.map +1 -0
  7. package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
  8. package/dist/chunk-2N72FKLB.js.map +1 -0
  9. package/dist/chunk-57GHR5LN.js +163 -0
  10. package/dist/chunk-57GHR5LN.js.map +1 -0
  11. package/dist/{chunk-OB6UBJXF.js → chunk-7S52M2SL.js} +127 -36
  12. package/dist/chunk-7S52M2SL.js.map +1 -0
  13. package/dist/chunk-JXFCSF3K.js +673 -0
  14. package/dist/chunk-JXFCSF3K.js.map +1 -0
  15. package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
  16. package/dist/chunk-PDOBHMUQ.js.map +1 -0
  17. package/dist/chunk-RU6WKEOG.js +7048 -0
  18. package/dist/chunk-RU6WKEOG.js.map +1 -0
  19. package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
  20. package/dist/chunk-U736PVHY.js.map +1 -0
  21. package/dist/{chunk-QEWCYW3I.js → chunk-WAMZWZJB.js} +13 -3
  22. package/dist/chunk-WAMZWZJB.js.map +1 -0
  23. package/dist/cli.js +3 -3
  24. package/dist/components/index.d.ts +1592 -100
  25. package/dist/components/index.js +7 -4
  26. package/dist/{dev-DCTOHQ6W.js → dev-4XEDTELV.js} +4 -4
  27. package/dist/{dev-DCTOHQ6W.js.map → dev-4XEDTELV.js.map} +1 -1
  28. package/dist/doc/index.d.ts +194 -2
  29. package/dist/doc/index.js +336 -5
  30. package/dist/doc/index.js.map +1 -1
  31. package/dist/format-U0cQl069.d.ts +243 -0
  32. package/dist/markdown/index.js +1 -1
  33. package/dist/markdown/index.js.map +1 -1
  34. package/dist/slide/index.d.ts +177 -1
  35. package/dist/slide/index.js +866 -3
  36. package/dist/slide/index.js.map +1 -1
  37. package/dist/table/index.js +9 -6
  38. package/dist/table/index.js.map +1 -1
  39. package/dist/ui/index.d.ts +8 -2
  40. package/dist/ui/index.js +22 -112
  41. package/dist/ui/index.js.map +1 -1
  42. package/dist/{upgrade-DBBE6GIR.js → upgrade-JHXZBGQS.js} +3 -3
  43. package/dist/{upgrade-DBBE6GIR.js.map → upgrade-JHXZBGQS.js.map} +1 -1
  44. package/dist/vite/index.js +2 -2
  45. package/docs/en/components.md +40 -17
  46. package/docs/en/doc/doc-action-items.md +49 -0
  47. package/docs/en/doc/doc-callout.md +38 -0
  48. package/docs/en/doc/doc-data-table.md +60 -0
  49. package/docs/en/doc/doc-executive-summary.md +64 -0
  50. package/docs/en/doc/doc-figure.md +56 -0
  51. package/docs/en/doc/doc-key-findings.md +61 -0
  52. package/docs/en/doc/doc-kpi-scorecard.md +80 -0
  53. package/docs/en/doc/doc-report-header.md +46 -0
  54. package/docs/en/parts/area-chart.md +99 -0
  55. package/docs/en/parts/bar-chart.md +91 -0
  56. package/docs/en/parts/bar-list.md +50 -0
  57. package/docs/en/parts/category-bar.md +37 -0
  58. package/docs/en/parts/chart-frame.md +39 -0
  59. package/docs/en/parts/data-table.md +22 -0
  60. package/docs/en/parts/delta.md +50 -0
  61. package/docs/en/parts/donut-chart.md +72 -0
  62. package/docs/en/parts/format.md +43 -0
  63. package/docs/en/parts/funnel-steps.md +2 -1
  64. package/docs/en/parts/heatmap.md +53 -0
  65. package/docs/en/parts/kpi-card.md +57 -0
  66. package/docs/en/parts/legend.md +35 -0
  67. package/docs/en/parts/line-chart.md +94 -0
  68. package/docs/en/parts/metric-value.md +3 -2
  69. package/docs/en/parts/progress-circle.md +33 -0
  70. package/docs/en/parts/sample-data.md +39 -0
  71. package/docs/en/parts/scatter-chart.md +56 -0
  72. package/docs/en/parts/sparkline.md +1 -1
  73. package/docs/en/parts/tracker.md +36 -0
  74. package/docs/en/parts/trend-indicator.md +17 -1
  75. package/docs/en/parts/updated-at.md +30 -0
  76. package/docs/en/parts/waterfall-chart.md +56 -0
  77. package/docs/en/slide/slide-chart-insight.md +52 -0
  78. package/docs/en/slide/slide-cover.md +39 -0
  79. package/docs/en/slide/slide-exec-summary.md +47 -0
  80. package/docs/en/slide/slide-kpi-grid.md +55 -0
  81. package/docs/en/slide/slide-kpi-hero.md +58 -0
  82. package/docs/en/slide/slide-next-actions.md +49 -0
  83. package/docs/en/slide/slide-scorecard-table.md +54 -0
  84. package/docs/en/ui/alert-dialog.md +42 -0
  85. package/docs/en/ui/avatar.md +31 -0
  86. package/docs/en/ui/combobox.md +74 -0
  87. package/docs/en/ui/drawer.md +41 -0
  88. package/docs/en/ui/empty.md +1 -1
  89. package/docs/en/ui/error-state.md +4 -3
  90. package/docs/en/ui/field.md +42 -0
  91. package/docs/en/ui/hover-card.md +21 -0
  92. package/docs/en/ui/kbd.md +17 -0
  93. package/docs/en/ui/loading.md +1 -1
  94. package/docs/en/ui/pagination.md +36 -0
  95. package/docs/en/ui/radio-group.md +21 -0
  96. package/docs/en/ui/toast.md +44 -0
  97. package/docs/en/ui/toggle-group.md +4 -3
  98. package/docs/en/ui-and-theming.md +1 -1
  99. package/docs/index.json +753 -73
  100. package/docs/ja/components.md +37 -16
  101. package/docs/ja/doc/doc-action-items.md +49 -0
  102. package/docs/ja/doc/doc-callout.md +38 -0
  103. package/docs/ja/doc/doc-data-table.md +60 -0
  104. package/docs/ja/doc/doc-executive-summary.md +64 -0
  105. package/docs/ja/doc/doc-figure.md +56 -0
  106. package/docs/ja/doc/doc-key-findings.md +61 -0
  107. package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
  108. package/docs/ja/doc/doc-report-header.md +46 -0
  109. package/docs/ja/parts/area-chart.md +49 -25
  110. package/docs/ja/parts/bar-chart.md +50 -24
  111. package/docs/ja/parts/bar-list.md +31 -8
  112. package/docs/ja/parts/chart-frame.md +36 -0
  113. package/docs/ja/parts/data-table.md +22 -0
  114. package/docs/ja/parts/delta.md +50 -0
  115. package/docs/ja/parts/donut-chart.md +45 -26
  116. package/docs/ja/parts/format.md +44 -0
  117. package/docs/ja/parts/funnel-steps.md +27 -8
  118. package/docs/ja/parts/heatmap.md +45 -0
  119. package/docs/ja/parts/kpi-card.md +55 -0
  120. package/docs/ja/parts/legend.md +36 -0
  121. package/docs/ja/parts/line-chart.md +48 -22
  122. package/docs/ja/parts/metric-value.md +3 -2
  123. package/docs/ja/parts/sample-data.md +61 -0
  124. package/docs/ja/parts/scatter-chart.md +69 -0
  125. package/docs/ja/parts/sparkline.md +1 -1
  126. package/docs/ja/parts/trend-indicator.md +17 -1
  127. package/docs/ja/parts/updated-at.md +27 -0
  128. package/docs/ja/parts/waterfall-chart.md +61 -0
  129. package/docs/ja/slide/slide-chart-insight.md +52 -0
  130. package/docs/ja/slide/slide-cover.md +39 -0
  131. package/docs/ja/slide/slide-exec-summary.md +47 -0
  132. package/docs/ja/slide/slide-kpi-grid.md +55 -0
  133. package/docs/ja/slide/slide-kpi-hero.md +58 -0
  134. package/docs/ja/slide/slide-next-actions.md +49 -0
  135. package/docs/ja/slide/slide-scorecard-table.md +54 -0
  136. package/docs/ja/ui/empty.md +1 -1
  137. package/docs/ja/ui/error-state.md +4 -3
  138. package/docs/ja/ui/loading.md +1 -1
  139. package/docs/ja/ui/toggle-group.md +4 -3
  140. package/docs/ja/ui-and-theming.md +2 -2
  141. package/package.json +26 -24
  142. package/registry/ui/accordion.tsx +4 -2
  143. package/registry/ui/alert-dialog.tsx +3 -3
  144. package/registry/ui/alert.tsx +3 -1
  145. package/registry/ui/app-shell.tsx +7 -1
  146. package/registry/ui/area-chart.tsx +2852 -166
  147. package/registry/ui/attention-list.tsx +303 -0
  148. package/registry/ui/avatar.tsx +1 -1
  149. package/registry/ui/badge.tsx +3 -1
  150. package/registry/ui/bar-chart.tsx +2851 -166
  151. package/registry/ui/bar-list.tsx +3531 -90
  152. package/registry/ui/box-plot-chart.tsx +3906 -0
  153. package/registry/ui/breadcrumb.tsx +3 -1
  154. package/registry/ui/button.tsx +3 -1
  155. package/registry/ui/calendar.tsx +3 -1
  156. package/registry/ui/card.tsx +4 -2
  157. package/registry/ui/category-bar.tsx +1025 -16
  158. package/registry/ui/chart-frame.tsx +1393 -0
  159. package/registry/ui/checkbox.tsx +3 -1
  160. package/registry/ui/collapsible.tsx +3 -1
  161. package/registry/ui/combobox.tsx +2 -2
  162. package/registry/ui/command.tsx +3 -1
  163. package/registry/ui/dashboard-card.tsx +71 -28
  164. package/registry/ui/data-table.tsx +678 -56
  165. package/registry/ui/date-range-picker.tsx +245 -64
  166. package/registry/ui/delta.tsx +188 -0
  167. package/registry/ui/dialog.tsx +5 -3
  168. package/registry/ui/donut-chart.tsx +2929 -182
  169. package/registry/ui/drawer.tsx +1 -1
  170. package/registry/ui/dropdown-menu.tsx +5 -3
  171. package/registry/ui/echart.tsx +621 -67
  172. package/registry/ui/field.tsx +1 -1
  173. package/registry/ui/filter-bar.tsx +33 -6
  174. package/registry/ui/funnel-steps.tsx +3344 -49
  175. package/registry/ui/heatmap.tsx +1786 -0
  176. package/registry/ui/histogram-chart.tsx +3986 -0
  177. package/registry/ui/hover-card.tsx +2 -2
  178. package/registry/ui/input-group.tsx +3 -1
  179. package/registry/ui/input.tsx +3 -1
  180. package/registry/ui/kbd.tsx +3 -1
  181. package/registry/ui/kpi-card.tsx +699 -0
  182. package/registry/ui/label.tsx +3 -1
  183. package/registry/ui/legend.tsx +3563 -0
  184. package/registry/ui/line-chart.tsx +2852 -160
  185. package/registry/ui/metric-value.tsx +9 -1
  186. package/registry/ui/multi-select.tsx +11 -5
  187. package/registry/ui/page-shell.tsx +106 -51
  188. package/registry/ui/pagination.tsx +3 -1
  189. package/registry/ui/paired-chart.tsx +3827 -0
  190. package/registry/ui/placeholder.tsx +8 -2
  191. package/registry/ui/popover.tsx +4 -2
  192. package/registry/ui/progress-circle.tsx +607 -12
  193. package/registry/ui/progress.tsx +3 -1
  194. package/registry/ui/radio-group.tsx +1 -1
  195. package/registry/ui/sample-data.tsx +86 -0
  196. package/registry/ui/scatter-chart.tsx +4212 -0
  197. package/registry/ui/scroll-area.tsx +3 -2
  198. package/registry/ui/searchable-select.tsx +8 -3
  199. package/registry/ui/section-header.tsx +5 -3
  200. package/registry/ui/segmented-control.tsx +7 -2
  201. package/registry/ui/select.tsx +4 -2
  202. package/registry/ui/separator.tsx +3 -1
  203. package/registry/ui/sheet.tsx +4 -2
  204. package/registry/ui/sidebar.tsx +4 -2
  205. package/registry/ui/skeleton.tsx +4 -2
  206. package/registry/ui/slider.tsx +4 -2
  207. package/registry/ui/sparkline.tsx +84 -9
  208. package/registry/ui/spinner.tsx +3 -1
  209. package/registry/ui/states.tsx +34 -5
  210. package/registry/ui/status-badge.tsx +83 -41
  211. package/registry/ui/switch.tsx +3 -1
  212. package/registry/ui/table.tsx +4 -2
  213. package/registry/ui/tabs.tsx +5 -3
  214. package/registry/ui/textarea.tsx +3 -1
  215. package/registry/ui/toast.tsx +2 -2
  216. package/registry/ui/toggle-group.tsx +3 -1
  217. package/registry/ui/toggle.tsx +3 -1
  218. package/registry/ui/tooltip.tsx +10 -4
  219. package/registry/ui/tracker.tsx +632 -19
  220. package/registry/ui/trend-indicator.tsx +15 -3
  221. package/registry/ui/updated-at.tsx +122 -0
  222. package/registry/ui/waterfall-chart.tsx +4248 -0
  223. package/skills/vantage-design/SKILL.md +34 -24
  224. package/skills/vantage-design/references/extract.md +16 -14
  225. package/skills/vantage-design/references/format.md +6 -5
  226. package/skills/vantage-design/references/presets.md +60 -110
  227. package/skills/vantage-slide/SKILL.md +54 -36
  228. package/templates/AGENTS.md +15 -3
  229. package/templates/agents/doc.md +45 -0
  230. package/templates/agents/page.md +32 -1
  231. package/templates/agents/slide.md +55 -2
  232. package/theme.css +244 -149
  233. package/dist/chunk-5ZOP4SQR.js.map +0 -1
  234. package/dist/chunk-A2UUGASH.js.map +0 -1
  235. package/dist/chunk-AG6RZ2RR.js +0 -3208
  236. package/dist/chunk-AG6RZ2RR.js.map +0 -1
  237. package/dist/chunk-IBGOCWJB.js.map +0 -1
  238. package/dist/chunk-OB6UBJXF.js.map +0 -1
  239. package/dist/chunk-PXRX5PEC.js.map +0 -1
  240. package/dist/chunk-QEWCYW3I.js.map +0 -1
@@ -1,5 +1,9 @@
1
1
  import { useSearchState } from '../chunk-ZO62C6T4.js';
2
2
  import '../chunk-6S4BAIGV.js';
3
+ import { EChart } from '../chunk-JXFCSF3K.js';
4
+ import { formatValue, EMPTY_VALUE } from '../chunk-57GHR5LN.js';
5
+ import '../chunk-PDOBHMUQ.js';
6
+ import '../chunk-U736PVHY.js';
3
7
  import { createContext, useRef, useState, useLayoutEffect, useContext, createElement, Children, isValidElement, useCallback, cloneElement, useMemo, useEffect } from 'react';
4
8
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
9
  import { createRoot } from 'react-dom/client';
@@ -454,7 +458,7 @@ function SlideRail({ slides, index, onSelect, themeVars }) {
454
458
  background: "color-mix(in oklab, var(--slide-fg) 6%, var(--slide-bg))",
455
459
  color: "var(--slide-fg)",
456
460
  borderRight: "1px solid color-mix(in oklab, var(--slide-fg) 14%, transparent)",
457
- fontFamily: 'system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif',
461
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif',
458
462
  userSelect: "none",
459
463
  // An embedded deck does not put the theme on its root, so the rail
460
464
  // carries it too rather than reading whatever cascaded in.
@@ -590,7 +594,7 @@ function SlideToolbar({
590
594
  backdropFilter: "blur(8px)",
591
595
  opacity: hovered || busy ? 1 : 0.25,
592
596
  transition: "opacity 150ms ease",
593
- fontFamily: 'system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif',
597
+ fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif',
594
598
  userSelect: "none"
595
599
  },
596
600
  children: [
@@ -1611,7 +1615,866 @@ function MorphElement({ id, children, className, style }) {
1611
1615
  }
1612
1616
  return /* @__PURE__ */ jsx("div", { className, style, "data-slide-morph": id, children });
1613
1617
  }
1618
+ var SAFE_X = 160;
1619
+ var SAFE_Y = 120;
1620
+ var COLUMNS = 12;
1621
+ var GUTTER2 = 32;
1622
+ var COLUMN_WIDTH = 104;
1623
+ var SLIDE_SPEC = {
1624
+ /** Keep content inside this margin; backgrounds may bleed past it. */
1625
+ safeArea: { x: SAFE_X, y: SAFE_Y },
1626
+ /** Spans the content width: 12 columns + 11 gutters = 1600. */
1627
+ grid: { columns: COLUMNS, gutter: GUTTER2, columnWidth: COLUMN_WIDTH },
1628
+ /** Font sizes in canvas px, strictly increasing. */
1629
+ fontSize: { caption: 24, page: 64, section: 88},
1630
+ lineHeight: { heading: 1.2, body: 1.6 },
1631
+ /** Gaps between elements, in canvas px. */
1632
+ space: { sm: 32, md: 48, lg: 64 }
1633
+ };
1634
+ var MAX_INSIGHTS = 3;
1635
+ var MAX_INSIGHT_CHARS = 40;
1636
+ var WRAP = { wordBreak: "keep-all", overflowWrap: "anywhere" };
1637
+ var LINE_TYPES = ["solid", "dashed", "dotted"];
1638
+ var SYMBOLS = ["circle", "rect", "triangle", "diamond"];
1639
+ function SlideHeading({ title }) {
1640
+ return /* @__PURE__ */ jsx(
1641
+ "h2",
1642
+ {
1643
+ style: {
1644
+ gridColumn: "1 / -1",
1645
+ margin: 0,
1646
+ fontFamily: "var(--slide-font-display)",
1647
+ fontSize: SLIDE_SPEC.fontSize.page,
1648
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
1649
+ fontWeight: 700,
1650
+ display: "-webkit-box",
1651
+ WebkitBoxOrient: "vertical",
1652
+ WebkitLineClamp: 2,
1653
+ overflow: "hidden",
1654
+ ...WRAP
1655
+ },
1656
+ children: title
1657
+ }
1658
+ );
1659
+ }
1660
+ function SlideSourceLine({ asOf, source }) {
1661
+ return /* @__PURE__ */ jsx(
1662
+ "p",
1663
+ {
1664
+ style: {
1665
+ gridColumn: "1 / -1",
1666
+ margin: 0,
1667
+ fontSize: SLIDE_SPEC.fontSize.caption,
1668
+ lineHeight: SLIDE_SPEC.lineHeight.body,
1669
+ color: "var(--slide-muted)"
1670
+ },
1671
+ children: [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ")
1672
+ }
1673
+ );
1674
+ }
1675
+ function SlideChartInsight({ title, chart, insights, chartSide = "left", asOf, source }) {
1676
+ const hasSource = Boolean(asOf || source);
1677
+ if (insights.some((t) => t.length > MAX_INSIGHT_CHARS)) console.warn(`SlideChartInsight: an insight is over ${MAX_INSIGHT_CHARS} characters; the column is narrow. Shorten it.`);
1678
+ if (insights.length > MAX_INSIGHTS) console.warn(`SlideChartInsight: ${insights.length} insights; ${MAX_INSIGHTS} fit beside the chart. Split the slide.`);
1679
+ const option = useMemo(
1680
+ () => ({
1681
+ animation: false,
1682
+ textStyle: { fontSize: SLIDE_SPEC.fontSize.caption },
1683
+ grid: { left: 0, right: SLIDE_SPEC.space.sm, top: chart.series.length > 1 ? SLIDE_SPEC.space.lg : SLIDE_SPEC.space.sm, bottom: 0, containLabel: true },
1684
+ legend: chart.series.length > 1 ? { top: 0, left: 0, textStyle: { fontSize: SLIDE_SPEC.fontSize.caption } } : { show: false },
1685
+ // The first x label and the lowest y label meet at the corner: the margin keeps the x labels clear of the axis, and
1686
+ // `hideOverlap` drops whichever still collides.
1687
+ xAxis: {
1688
+ type: "category",
1689
+ data: chart.categories,
1690
+ boundaryGap: chart.type === "bar",
1691
+ axisLabel: { fontSize: SLIDE_SPEC.fontSize.caption, margin: SLIDE_SPEC.space.sm, hideOverlap: true }
1692
+ },
1693
+ yAxis: {
1694
+ type: "value",
1695
+ // A line from 0 hugs the top when the values sit in a narrow band; bars must keep their zero baseline.
1696
+ scale: chart.type !== "bar",
1697
+ axisLabel: { fontSize: SLIDE_SPEC.fontSize.caption, hideOverlap: true, formatter: (v) => formatValue(v, "compact") }
1698
+ },
1699
+ ...chart.type === "bar" && chart.series.length > 1 ? { aria: { enabled: true, decal: { show: true } } } : {},
1700
+ series: chart.series.map((s, i) => ({
1701
+ name: s.name,
1702
+ type: chart.type === "bar" ? "bar" : "line",
1703
+ data: s.data,
1704
+ ...chart.type === "bar" ? {} : { symbol: SYMBOLS[i % SYMBOLS.length], symbolSize: SLIDE_SPEC.space.sm / 2, lineStyle: { width: 6, type: LINE_TYPES[i % LINE_TYPES.length] } },
1705
+ ...chart.type === "area" ? { areaStyle: { opacity: 0.16 } } : {}
1706
+ }))
1707
+ }),
1708
+ [chart]
1709
+ );
1710
+ const chartFirst = chartSide === "left";
1711
+ return /* @__PURE__ */ jsxs(
1712
+ "section",
1713
+ {
1714
+ "data-slot": "slide-chart-insight",
1715
+ style: {
1716
+ width: "100%",
1717
+ height: "100%",
1718
+ boxSizing: "border-box",
1719
+ display: "grid",
1720
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
1721
+ gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
1722
+ columnGap: SLIDE_SPEC.grid.gutter,
1723
+ rowGap: SLIDE_SPEC.space.lg,
1724
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
1725
+ color: "var(--slide-fg)",
1726
+ fontFamily: "var(--slide-font-body)"
1727
+ },
1728
+ children: [
1729
+ /* @__PURE__ */ jsx(SlideHeading, { title }),
1730
+ /* @__PURE__ */ jsx("div", { "data-waitfor": "canvas", style: { gridColumn: chartFirst ? "1 / span 8" : "5 / span 8", gridRow: 2, minHeight: 0, height: "100%" }, children: /* @__PURE__ */ jsx(EChart, { option, height: "100%", ariaLabel: title }) }),
1731
+ /* @__PURE__ */ jsx(
1732
+ "ul",
1733
+ {
1734
+ style: {
1735
+ gridColumn: chartFirst ? "9 / span 4" : "1 / span 4",
1736
+ gridRow: 2,
1737
+ margin: 0,
1738
+ padding: 0,
1739
+ listStyle: "none",
1740
+ minHeight: 0,
1741
+ display: "flex",
1742
+ flexDirection: "column",
1743
+ justifyContent: "center",
1744
+ gap: SLIDE_SPEC.space.md
1745
+ },
1746
+ children: insights.map((text, i) => /* @__PURE__ */ jsx(
1747
+ "li",
1748
+ {
1749
+ style: {
1750
+ paddingLeft: SLIDE_SPEC.space.sm,
1751
+ borderLeft: "4px solid var(--slide-accent)",
1752
+ fontSize: "var(--slide-size-body)",
1753
+ lineHeight: SLIDE_SPEC.lineHeight.body,
1754
+ ...WRAP
1755
+ },
1756
+ children: text
1757
+ },
1758
+ i
1759
+ ))
1760
+ }
1761
+ ),
1762
+ hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
1763
+ ]
1764
+ }
1765
+ );
1766
+ }
1767
+ var WRAP2 = { wordBreak: "keep-all", overflowWrap: "anywhere" };
1768
+ function SlideCover({ title, subtitle, period, author, asOf, source }) {
1769
+ const meta = [
1770
+ period,
1771
+ author,
1772
+ [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ") || void 0
1773
+ ].filter(Boolean);
1774
+ return /* @__PURE__ */ jsxs(
1775
+ "section",
1776
+ {
1777
+ "data-slot": "slide-cover",
1778
+ style: {
1779
+ width: "100%",
1780
+ height: "100%",
1781
+ boxSizing: "border-box",
1782
+ display: "grid",
1783
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
1784
+ gridTemplateRows: "1fr auto",
1785
+ columnGap: SLIDE_SPEC.grid.gutter,
1786
+ rowGap: SLIDE_SPEC.space.lg,
1787
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
1788
+ color: "var(--slide-fg)",
1789
+ fontFamily: "var(--slide-font-body)"
1790
+ },
1791
+ children: [
1792
+ /* @__PURE__ */ jsxs(
1793
+ "div",
1794
+ {
1795
+ style: {
1796
+ gridColumn: "1 / span 8",
1797
+ display: "flex",
1798
+ flexDirection: "column",
1799
+ justifyContent: "center",
1800
+ gap: SLIDE_SPEC.space.md,
1801
+ minHeight: 0
1802
+ },
1803
+ children: [
1804
+ /* @__PURE__ */ jsx("div", { style: { width: SLIDE_SPEC.grid.columnWidth, height: 8, background: "var(--slide-accent)" } }),
1805
+ /* @__PURE__ */ jsx(
1806
+ "h1",
1807
+ {
1808
+ style: {
1809
+ margin: 0,
1810
+ fontFamily: "var(--slide-font-display)",
1811
+ fontSize: SLIDE_SPEC.fontSize.section,
1812
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
1813
+ fontWeight: 700,
1814
+ ...WRAP2
1815
+ },
1816
+ children: title
1817
+ }
1818
+ ),
1819
+ subtitle && /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)", ...WRAP2 }, children: subtitle })
1820
+ ]
1821
+ }
1822
+ ),
1823
+ meta.length > 0 && /* @__PURE__ */ jsx(
1824
+ "p",
1825
+ {
1826
+ style: {
1827
+ gridColumn: "1 / -1",
1828
+ margin: 0,
1829
+ fontSize: SLIDE_SPEC.fontSize.caption,
1830
+ lineHeight: SLIDE_SPEC.lineHeight.body,
1831
+ color: "var(--slide-muted)"
1832
+ },
1833
+ children: meta.join("\u3000|\u3000")
1834
+ }
1835
+ )
1836
+ ]
1837
+ }
1838
+ );
1839
+ }
1840
+ var WRAP3 = { wordBreak: "keep-all", overflowWrap: "anywhere" };
1841
+ var MAX_POINTS = 5;
1842
+ function SlideHeading2({ title }) {
1843
+ return /* @__PURE__ */ jsx(
1844
+ "h2",
1845
+ {
1846
+ style: {
1847
+ gridColumn: "1 / -1",
1848
+ margin: 0,
1849
+ fontFamily: "var(--slide-font-display)",
1850
+ fontSize: SLIDE_SPEC.fontSize.page,
1851
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
1852
+ fontWeight: 700,
1853
+ display: "-webkit-box",
1854
+ WebkitBoxOrient: "vertical",
1855
+ WebkitLineClamp: 2,
1856
+ overflow: "hidden",
1857
+ ...WRAP3
1858
+ },
1859
+ children: title
1860
+ }
1861
+ );
1862
+ }
1863
+ function SlideSourceLine2({ asOf, source }) {
1864
+ return /* @__PURE__ */ jsx(
1865
+ "p",
1866
+ {
1867
+ style: {
1868
+ gridColumn: "1 / -1",
1869
+ margin: 0,
1870
+ fontSize: SLIDE_SPEC.fontSize.caption,
1871
+ lineHeight: SLIDE_SPEC.lineHeight.body,
1872
+ color: "var(--slide-muted)"
1873
+ },
1874
+ children: [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ")
1875
+ }
1876
+ );
1877
+ }
1878
+ function SlideExecSummary({ title, points, layout = "rows", asOf, source }) {
1879
+ const hasSource = Boolean(asOf || source);
1880
+ if (points.length > MAX_POINTS) console.warn(`SlideExecSummary: ${points.length} points; ${MAX_POINTS} fit the canvas. Split the slide.`);
1881
+ const number = (i) => String(i + 1).padStart(2, "0");
1882
+ return /* @__PURE__ */ jsxs(
1883
+ "section",
1884
+ {
1885
+ "data-slot": "slide-exec-summary",
1886
+ style: {
1887
+ width: "100%",
1888
+ height: "100%",
1889
+ boxSizing: "border-box",
1890
+ display: "grid",
1891
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
1892
+ gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
1893
+ columnGap: SLIDE_SPEC.grid.gutter,
1894
+ rowGap: SLIDE_SPEC.space.lg,
1895
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
1896
+ color: "var(--slide-fg)",
1897
+ fontFamily: "var(--slide-font-body)"
1898
+ },
1899
+ children: [
1900
+ /* @__PURE__ */ jsx(SlideHeading2, { title }),
1901
+ layout === "columns" ? /* @__PURE__ */ jsx(
1902
+ "ol",
1903
+ {
1904
+ style: {
1905
+ gridColumn: "1 / -1",
1906
+ margin: 0,
1907
+ padding: 0,
1908
+ listStyle: "none",
1909
+ minHeight: 0,
1910
+ display: "grid",
1911
+ gridTemplateColumns: `repeat(${Math.max(points.length, 1)}, 1fr)`,
1912
+ columnGap: SLIDE_SPEC.grid.gutter
1913
+ },
1914
+ children: points.map((p, i) => /* @__PURE__ */ jsxs(
1915
+ "li",
1916
+ {
1917
+ style: {
1918
+ display: "flex",
1919
+ flexDirection: "column",
1920
+ gap: SLIDE_SPEC.space.sm,
1921
+ paddingTop: SLIDE_SPEC.space.md,
1922
+ borderTop: "4px solid var(--slide-accent)"
1923
+ },
1924
+ children: [
1925
+ /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.page, lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: "var(--slide-accent)" }, children: number(i) }),
1926
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, ...WRAP3 }, children: p.headline }),
1927
+ p.detail && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)", ...WRAP3 }, children: p.detail })
1928
+ ]
1929
+ },
1930
+ i
1931
+ ))
1932
+ }
1933
+ ) : /* @__PURE__ */ jsx(
1934
+ "ol",
1935
+ {
1936
+ style: {
1937
+ gridColumn: "1 / -1",
1938
+ margin: 0,
1939
+ padding: 0,
1940
+ listStyle: "none",
1941
+ minHeight: 0,
1942
+ display: "flex",
1943
+ flexDirection: "column",
1944
+ justifyContent: "center",
1945
+ gap: SLIDE_SPEC.space.sm
1946
+ },
1947
+ children: points.map((p, i) => /* @__PURE__ */ jsxs(
1948
+ "li",
1949
+ {
1950
+ style: {
1951
+ display: "grid",
1952
+ gridTemplateColumns: `${SLIDE_SPEC.grid.columnWidth}px 1fr`,
1953
+ columnGap: SLIDE_SPEC.space.md,
1954
+ alignItems: "baseline"
1955
+ },
1956
+ children: [
1957
+ /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.page, lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: "var(--slide-accent)" }, children: number(i) }),
1958
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
1959
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, ...WRAP3 }, children: p.headline }),
1960
+ p.detail && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)", ...WRAP3 }, children: p.detail })
1961
+ ] })
1962
+ ]
1963
+ },
1964
+ i
1965
+ ))
1966
+ }
1967
+ ),
1968
+ hasSource && /* @__PURE__ */ jsx(SlideSourceLine2, { asOf, source })
1969
+ ]
1970
+ }
1971
+ );
1972
+ }
1973
+ var MAX_ITEMS = 4;
1974
+ var WRAP4 = { wordBreak: "keep-all", overflowWrap: "anywhere" };
1975
+ function SlideHeading3({ title }) {
1976
+ return /* @__PURE__ */ jsx(
1977
+ "h2",
1978
+ {
1979
+ style: {
1980
+ gridColumn: "1 / -1",
1981
+ margin: 0,
1982
+ fontFamily: "var(--slide-font-display)",
1983
+ fontSize: SLIDE_SPEC.fontSize.page,
1984
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
1985
+ fontWeight: 700,
1986
+ display: "-webkit-box",
1987
+ WebkitBoxOrient: "vertical",
1988
+ WebkitLineClamp: 2,
1989
+ overflow: "hidden",
1990
+ ...WRAP4
1991
+ },
1992
+ children: title
1993
+ }
1994
+ );
1995
+ }
1996
+ function SlideSourceLine3({ asOf, source }) {
1997
+ return /* @__PURE__ */ jsx(
1998
+ "p",
1999
+ {
2000
+ style: {
2001
+ gridColumn: "1 / -1",
2002
+ margin: 0,
2003
+ fontSize: SLIDE_SPEC.fontSize.caption,
2004
+ lineHeight: SLIDE_SPEC.lineHeight.body,
2005
+ color: "var(--slide-muted)"
2006
+ },
2007
+ children: [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ")
2008
+ }
2009
+ );
2010
+ }
2011
+ var ARROW = { up: "\u25B2", down: "\u25BC", flat: "\u25AC" };
2012
+ var WORD = { up: "\u5897", down: "\u6E1B", flat: "\u6A2A\u3070\u3044" };
2013
+ function deltaView(delta, betterWhen) {
2014
+ const direction = delta.value > 0 ? "up" : delta.value < 0 ? "down" : "flat";
2015
+ const color = direction === "flat" ? "var(--slide-muted)" : direction === betterWhen ? "var(--positive)" : "var(--negative)";
2016
+ const amount = formatValue(delta.value, delta.format, void 0, { signDisplay: "exceptZero" });
2017
+ return { color, text: `${ARROW[direction]} ${WORD[direction]} ${amount}` };
2018
+ }
2019
+ function targetText(item) {
2020
+ if (item.target === void 0) return void 0;
2021
+ const { value, target, betterWhen = "up" } = item;
2022
+ const rate = value === null ? void 0 : betterWhen === "down" ? target / value : value / target;
2023
+ const shown = `\u76EE\u6A19 ${formatValue(target, item.format)}`;
2024
+ return rate === void 0 || !Number.isFinite(rate) ? shown : `${shown}(\u9054\u6210\u7387 ${formatValue(rate, { type: "percent", digits: 0 })})`;
2025
+ }
2026
+ function SlideKpiGrid({ title, items, asOf, source }) {
2027
+ const hasSource = Boolean(asOf || source);
2028
+ if (items.length > MAX_ITEMS) console.warn(`SlideKpiGrid: ${items.length} items; ${MAX_ITEMS} fit the canvas. Split the slide.`);
2029
+ return /* @__PURE__ */ jsxs(
2030
+ "section",
2031
+ {
2032
+ "data-slot": "slide-kpi-grid",
2033
+ style: {
2034
+ width: "100%",
2035
+ height: "100%",
2036
+ boxSizing: "border-box",
2037
+ display: "grid",
2038
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
2039
+ gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
2040
+ columnGap: SLIDE_SPEC.grid.gutter,
2041
+ rowGap: SLIDE_SPEC.space.lg,
2042
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
2043
+ color: "var(--slide-fg)",
2044
+ fontFamily: "var(--slide-font-body)"
2045
+ },
2046
+ children: [
2047
+ /* @__PURE__ */ jsx(SlideHeading3, { title }),
2048
+ /* @__PURE__ */ jsx(
2049
+ "div",
2050
+ {
2051
+ style: {
2052
+ gridColumn: "1 / -1",
2053
+ minHeight: 0,
2054
+ display: "grid",
2055
+ gridTemplateColumns: `repeat(${Math.max(items.length, 1)}, 1fr)`,
2056
+ columnGap: SLIDE_SPEC.grid.gutter,
2057
+ alignItems: "center"
2058
+ },
2059
+ children: items.map((item, i) => {
2060
+ const delta = item.delta ? deltaView({ value: item.delta.value, format: item.delta.format ?? item.format }, item.betterWhen ?? "up") : void 0;
2061
+ const target = targetText(item);
2062
+ return /* @__PURE__ */ jsxs(
2063
+ "div",
2064
+ {
2065
+ style: {
2066
+ display: "flex",
2067
+ flexDirection: "column",
2068
+ gap: SLIDE_SPEC.space.sm,
2069
+ padding: SLIDE_SPEC.space.md,
2070
+ border: "2px solid var(--border)",
2071
+ borderRadius: "var(--slide-radius)",
2072
+ minWidth: 0
2073
+ },
2074
+ children: [
2075
+ /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, fontWeight: 700, color: "var(--slide-muted)" }, children: item.label }),
2076
+ /* @__PURE__ */ jsx(
2077
+ "span",
2078
+ {
2079
+ "data-raw": item.value ?? void 0,
2080
+ style: {
2081
+ fontFamily: "var(--slide-font-display)",
2082
+ fontSize: SLIDE_SPEC.fontSize.page,
2083
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
2084
+ fontWeight: 700,
2085
+ fontVariantNumeric: "tabular-nums",
2086
+ ...WRAP4
2087
+ },
2088
+ children: item.display ?? formatValue(item.value, item.format)
2089
+ }
2090
+ ),
2091
+ delta && /* @__PURE__ */ jsxs("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: delta.color, ...WRAP4 }, children: [
2092
+ delta.text,
2093
+ item.comparisonLabel && /* @__PURE__ */ jsxs("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, fontWeight: 400, color: "var(--slide-muted)" }, children: [
2094
+ " ",
2095
+ item.comparisonLabel
2096
+ ] })
2097
+ ] }),
2098
+ target && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)", ...WRAP4 }, children: target })
2099
+ ]
2100
+ },
2101
+ i
2102
+ );
2103
+ })
2104
+ }
2105
+ ),
2106
+ hasSource && /* @__PURE__ */ jsx(SlideSourceLine3, { asOf, source })
2107
+ ]
2108
+ }
2109
+ );
2110
+ }
2111
+ var WRAP5 = { wordBreak: "keep-all", overflowWrap: "anywhere" };
2112
+ function SlideHeading4({ title }) {
2113
+ return /* @__PURE__ */ jsx(
2114
+ "h2",
2115
+ {
2116
+ style: {
2117
+ gridColumn: "1 / -1",
2118
+ margin: 0,
2119
+ fontFamily: "var(--slide-font-display)",
2120
+ fontSize: SLIDE_SPEC.fontSize.page,
2121
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
2122
+ fontWeight: 700,
2123
+ display: "-webkit-box",
2124
+ WebkitBoxOrient: "vertical",
2125
+ WebkitLineClamp: 2,
2126
+ overflow: "hidden",
2127
+ ...WRAP5
2128
+ },
2129
+ children: title
2130
+ }
2131
+ );
2132
+ }
2133
+ function SlideSourceLine4({ asOf, source }) {
2134
+ return /* @__PURE__ */ jsx(
2135
+ "p",
2136
+ {
2137
+ style: {
2138
+ gridColumn: "1 / -1",
2139
+ margin: 0,
2140
+ fontSize: SLIDE_SPEC.fontSize.caption,
2141
+ lineHeight: SLIDE_SPEC.lineHeight.body,
2142
+ color: "var(--slide-muted)"
2143
+ },
2144
+ children: [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ")
2145
+ }
2146
+ );
2147
+ }
2148
+ var ARROW2 = { up: "\u25B2", down: "\u25BC", flat: "\u25AC" };
2149
+ var WORD2 = { up: "\u5897", down: "\u6E1B", flat: "\u6A2A\u3070\u3044" };
2150
+ function deltaView2(delta, betterWhen) {
2151
+ const direction = delta.value > 0 ? "up" : delta.value < 0 ? "down" : "flat";
2152
+ const color = direction === "flat" ? "var(--slide-muted)" : direction === betterWhen ? "var(--positive)" : "var(--negative)";
2153
+ const amount = formatValue(delta.value, delta.format, void 0, { signDisplay: "exceptZero" });
2154
+ return { color, text: `${ARROW2[direction]} ${WORD2[direction]} ${amount}` };
2155
+ }
2156
+ function SlideKpiHero({ title, label, value, format, display, delta, betterWhen = "up", comparisonLabel, trend, asOf, source }) {
2157
+ const hasSource = Boolean(asOf || source);
2158
+ const deltaShown = delta ? deltaView2({ value: delta.value, format: delta.format ?? format }, betterWhen) : void 0;
2159
+ const option = useMemo(() => {
2160
+ if (!trend || trend.length === 0) return void 0;
2161
+ return {
2162
+ animation: false,
2163
+ textStyle: { fontSize: SLIDE_SPEC.fontSize.caption },
2164
+ grid: { left: 0, right: SLIDE_SPEC.space.sm, top: SLIDE_SPEC.space.sm, bottom: 0, containLabel: true },
2165
+ // The first x label and the lowest y label meet at the corner: the margin keeps the x labels clear of the axis, and
2166
+ // `hideOverlap` drops whichever still collides.
2167
+ xAxis: {
2168
+ type: "category",
2169
+ data: trend.map((p) => p.x),
2170
+ boundaryGap: false,
2171
+ axisLabel: { fontSize: SLIDE_SPEC.fontSize.caption, margin: SLIDE_SPEC.space.sm, hideOverlap: true }
2172
+ },
2173
+ yAxis: {
2174
+ type: "value",
2175
+ scale: true,
2176
+ axisLabel: { fontSize: SLIDE_SPEC.fontSize.caption, hideOverlap: true, formatter: (v) => formatValue(v, "compact") }
2177
+ },
2178
+ series: [
2179
+ {
2180
+ type: "line",
2181
+ data: trend.map((p) => p.y),
2182
+ symbol: "circle",
2183
+ symbolSize: SLIDE_SPEC.space.sm / 2,
2184
+ lineStyle: { width: 6 },
2185
+ areaStyle: { opacity: 0.12 }
2186
+ }
2187
+ ]
2188
+ };
2189
+ }, [trend]);
2190
+ return /* @__PURE__ */ jsxs(
2191
+ "section",
2192
+ {
2193
+ "data-slot": "slide-kpi-hero",
2194
+ style: {
2195
+ width: "100%",
2196
+ height: "100%",
2197
+ boxSizing: "border-box",
2198
+ display: "grid",
2199
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
2200
+ gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
2201
+ columnGap: SLIDE_SPEC.grid.gutter,
2202
+ rowGap: SLIDE_SPEC.space.lg,
2203
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
2204
+ color: "var(--slide-fg)",
2205
+ fontFamily: "var(--slide-font-body)"
2206
+ },
2207
+ children: [
2208
+ /* @__PURE__ */ jsx(SlideHeading4, { title }),
2209
+ /* @__PURE__ */ jsxs(
2210
+ "div",
2211
+ {
2212
+ style: {
2213
+ gridColumn: option ? "1 / span 6" : "1 / -1",
2214
+ minHeight: 0,
2215
+ display: "flex",
2216
+ flexDirection: "column",
2217
+ justifyContent: "center",
2218
+ gap: SLIDE_SPEC.space.sm
2219
+ },
2220
+ children: [
2221
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, color: "var(--slide-muted)", ...WRAP5 }, children: label }),
2222
+ /* @__PURE__ */ jsx(
2223
+ "span",
2224
+ {
2225
+ "data-raw": value ?? void 0,
2226
+ style: {
2227
+ fontFamily: "var(--slide-font-display)",
2228
+ fontSize: "var(--slide-size-hero)",
2229
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
2230
+ fontWeight: 700,
2231
+ fontVariantNumeric: "tabular-nums",
2232
+ ...WRAP5
2233
+ },
2234
+ children: display ?? formatValue(value, format)
2235
+ }
2236
+ ),
2237
+ (deltaShown || comparisonLabel) && /* @__PURE__ */ jsxs("span", { style: { display: "flex", flexWrap: "wrap", alignItems: "baseline", gap: SLIDE_SPEC.space.sm, fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading }, children: [
2238
+ deltaShown && /* @__PURE__ */ jsx("span", { style: { color: deltaShown.color, fontWeight: 700 }, children: deltaShown.text }),
2239
+ comparisonLabel && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, color: "var(--slide-muted)" }, children: comparisonLabel })
2240
+ ] })
2241
+ ]
2242
+ }
2243
+ ),
2244
+ option && /* @__PURE__ */ jsx("div", { "data-waitfor": "canvas", style: { gridColumn: "7 / span 6", minHeight: 0, height: "100%" }, children: /* @__PURE__ */ jsx(EChart, { option, height: "100%", ariaLabel: `${label}\u306E\u63A8\u79FB` }) }),
2245
+ hasSource && /* @__PURE__ */ jsx(SlideSourceLine4, { asOf, source })
2246
+ ]
2247
+ }
2248
+ );
2249
+ }
2250
+ var WRAP6 = { wordBreak: "keep-all", overflowWrap: "anywhere" };
2251
+ var MAX_ITEMS2 = 5;
2252
+ var MAX_DUE_CHARS = 10;
2253
+ function SlideHeading5({ title }) {
2254
+ return /* @__PURE__ */ jsx(
2255
+ "h2",
2256
+ {
2257
+ style: {
2258
+ gridColumn: "1 / -1",
2259
+ margin: 0,
2260
+ fontFamily: "var(--slide-font-display)",
2261
+ fontSize: SLIDE_SPEC.fontSize.page,
2262
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
2263
+ fontWeight: 700,
2264
+ display: "-webkit-box",
2265
+ WebkitBoxOrient: "vertical",
2266
+ WebkitLineClamp: 2,
2267
+ overflow: "hidden",
2268
+ ...WRAP6
2269
+ },
2270
+ children: title
2271
+ }
2272
+ );
2273
+ }
2274
+ function SlideSourceLine5({ asOf, source }) {
2275
+ return /* @__PURE__ */ jsx(
2276
+ "p",
2277
+ {
2278
+ style: {
2279
+ gridColumn: "1 / -1",
2280
+ margin: 0,
2281
+ fontSize: SLIDE_SPEC.fontSize.caption,
2282
+ lineHeight: SLIDE_SPEC.lineHeight.body,
2283
+ color: "var(--slide-muted)"
2284
+ },
2285
+ children: [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ")
2286
+ }
2287
+ );
2288
+ }
2289
+ function SlideNextActions({ title, items, asOf, source }) {
2290
+ const hasSource = Boolean(asOf || source);
2291
+ if (items.length > MAX_ITEMS2) console.warn(`SlideNextActions: ${items.length} items; ${MAX_ITEMS2} fit the canvas. Split the slide.`);
2292
+ if (items.some((it) => (it.due?.length ?? 0) > MAX_DUE_CHARS)) console.warn(`SlideNextActions: a due date is over ${MAX_DUE_CHARS} characters; the column is one line wide. Shorten it.`);
2293
+ const cols = [
2294
+ { key: "owner", head: "\u62C5\u5F53", fr: 2 },
2295
+ { key: "due", head: "\u671F\u9650", fr: 2 },
2296
+ { key: "metric", head: "\u78BA\u8A8D\u3059\u308B\u6307\u6A19", fr: 3 }
2297
+ ];
2298
+ const shown = cols.filter((c) => items.some((it) => it[c.key]));
2299
+ const template = [`${SLIDE_SPEC.grid.columnWidth}px`, "minmax(0, 6fr)", ...shown.map((c) => `minmax(0, ${c.fr}fr)`)].join(" ");
2300
+ const row = { display: "grid", gridTemplateColumns: template, columnGap: SLIDE_SPEC.space.md, alignItems: "baseline" };
2301
+ return /* @__PURE__ */ jsxs(
2302
+ "section",
2303
+ {
2304
+ "data-slot": "slide-next-actions",
2305
+ style: {
2306
+ width: "100%",
2307
+ height: "100%",
2308
+ boxSizing: "border-box",
2309
+ display: "grid",
2310
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
2311
+ gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
2312
+ columnGap: SLIDE_SPEC.grid.gutter,
2313
+ rowGap: SLIDE_SPEC.space.lg,
2314
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
2315
+ color: "var(--slide-fg)",
2316
+ fontFamily: "var(--slide-font-body)"
2317
+ },
2318
+ children: [
2319
+ /* @__PURE__ */ jsx(SlideHeading5, { title }),
2320
+ /* @__PURE__ */ jsxs("div", { style: { gridColumn: "1 / -1", minHeight: 0, display: "flex", flexDirection: "column", justifyContent: "center" }, children: [
2321
+ shown.length > 0 && /* @__PURE__ */ jsxs(
2322
+ "div",
2323
+ {
2324
+ "aria-hidden": true,
2325
+ style: {
2326
+ ...row,
2327
+ paddingBottom: SLIDE_SPEC.space.sm,
2328
+ fontSize: SLIDE_SPEC.fontSize.caption,
2329
+ lineHeight: SLIDE_SPEC.lineHeight.body,
2330
+ fontWeight: 700,
2331
+ color: "var(--slide-muted)"
2332
+ },
2333
+ children: [
2334
+ /* @__PURE__ */ jsx("span", {}),
2335
+ /* @__PURE__ */ jsx("span", {}),
2336
+ shown.map((c) => /* @__PURE__ */ jsx("span", { children: c.head }, c.key))
2337
+ ]
2338
+ }
2339
+ ),
2340
+ /* @__PURE__ */ jsx("ol", { style: { margin: 0, padding: 0, listStyle: "none" }, children: items.map((it, i) => /* @__PURE__ */ jsxs(
2341
+ "li",
2342
+ {
2343
+ style: {
2344
+ ...row,
2345
+ paddingTop: SLIDE_SPEC.space.sm,
2346
+ paddingBottom: SLIDE_SPEC.space.sm,
2347
+ borderTop: "2px solid var(--border)"
2348
+ },
2349
+ children: [
2350
+ /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.page, lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: "var(--slide-accent)" }, children: String(i + 1).padStart(2, "0") }),
2351
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, ...WRAP6 }, children: it.action }),
2352
+ shown.map((c) => /* @__PURE__ */ jsx(
2353
+ "span",
2354
+ {
2355
+ style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, ...WRAP6, ...c.key === "due" ? { whiteSpace: "nowrap" } : {} },
2356
+ children: it[c.key]
2357
+ },
2358
+ c.key
2359
+ ))
2360
+ ]
2361
+ },
2362
+ i
2363
+ )) })
2364
+ ] }),
2365
+ hasSource && /* @__PURE__ */ jsx(SlideSourceLine5, { asOf, source })
2366
+ ]
2367
+ }
2368
+ );
2369
+ }
2370
+ var MAX_ROWS = 8;
2371
+ var DENSE_ROWS = 6;
2372
+ var WRAP7 = { wordBreak: "keep-all", overflowWrap: "anywhere" };
2373
+ function SlideHeading6({ title }) {
2374
+ return /* @__PURE__ */ jsx(
2375
+ "h2",
2376
+ {
2377
+ style: {
2378
+ gridColumn: "1 / -1",
2379
+ margin: 0,
2380
+ fontFamily: "var(--slide-font-display)",
2381
+ fontSize: SLIDE_SPEC.fontSize.page,
2382
+ lineHeight: SLIDE_SPEC.lineHeight.heading,
2383
+ fontWeight: 700,
2384
+ display: "-webkit-box",
2385
+ WebkitBoxOrient: "vertical",
2386
+ WebkitLineClamp: 2,
2387
+ overflow: "hidden",
2388
+ ...WRAP7
2389
+ },
2390
+ children: title
2391
+ }
2392
+ );
2393
+ }
2394
+ function SlideSourceLine6({ asOf, source }) {
2395
+ return /* @__PURE__ */ jsx(
2396
+ "p",
2397
+ {
2398
+ style: {
2399
+ gridColumn: "1 / -1",
2400
+ margin: 0,
2401
+ fontSize: SLIDE_SPEC.fontSize.caption,
2402
+ lineHeight: SLIDE_SPEC.lineHeight.body,
2403
+ color: "var(--slide-muted)"
2404
+ },
2405
+ children: [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ")
2406
+ }
2407
+ );
2408
+ }
2409
+ var STATUS = {
2410
+ on: { label: "\u9806\u8ABF", color: "var(--positive)" },
2411
+ risk: { label: "\u8981\u6CE8\u610F", color: "var(--warning)" },
2412
+ off: { label: "\u9045\u5EF6", color: "var(--negative)" }
2413
+ };
2414
+ function attainment(row) {
2415
+ if (row.value === null || row.target === void 0) return void 0;
2416
+ const rate = row.betterWhen === "down" ? row.target / row.value : row.value / row.target;
2417
+ return Number.isFinite(rate) ? rate : void 0;
2418
+ }
2419
+ function SlideScorecardTable({ title, rows, columns, asOf, source }) {
2420
+ const hasSource = Boolean(asOf || source);
2421
+ if (rows.length > MAX_ROWS) console.warn(`SlideScorecardTable: ${rows.length} rows; ${MAX_ROWS} fit the canvas. Split the slide.`);
2422
+ const head = { metric: "\u6307\u6A19", target: "\u76EE\u6A19", actual: "\u5B9F\u7E3E", attainment: "\u9054\u6210\u7387", status: "\u72B6\u614B", ...columns };
2423
+ const showAttainment = rows.some((r) => attainment(r) !== void 0);
2424
+ const cellSize = rows.length > DENSE_ROWS ? SLIDE_SPEC.fontSize.caption : "var(--slide-size-body)";
2425
+ const cell = {
2426
+ paddingLeft: SLIDE_SPEC.space.sm,
2427
+ paddingRight: SLIDE_SPEC.space.sm,
2428
+ borderBottom: "2px solid var(--border)",
2429
+ textAlign: "left",
2430
+ verticalAlign: "middle"
2431
+ };
2432
+ const num = { ...cell, textAlign: "right", fontVariantNumeric: "tabular-nums" };
2433
+ return /* @__PURE__ */ jsxs(
2434
+ "section",
2435
+ {
2436
+ "data-slot": "slide-scorecard-table",
2437
+ style: {
2438
+ width: "100%",
2439
+ height: "100%",
2440
+ boxSizing: "border-box",
2441
+ display: "grid",
2442
+ gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
2443
+ gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
2444
+ columnGap: SLIDE_SPEC.grid.gutter,
2445
+ rowGap: SLIDE_SPEC.space.lg,
2446
+ padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
2447
+ color: "var(--slide-fg)",
2448
+ fontFamily: "var(--slide-font-body)"
2449
+ },
2450
+ children: [
2451
+ /* @__PURE__ */ jsx(SlideHeading6, { title }),
2452
+ /* @__PURE__ */ jsx("div", { style: { gridColumn: "1 / -1", minHeight: 0 }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", fontSize: cellSize, lineHeight: SLIDE_SPEC.lineHeight.body }, children: [
2453
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { style: { color: "var(--slide-muted)", fontSize: SLIDE_SPEC.fontSize.caption }, children: [
2454
+ /* @__PURE__ */ jsx("th", { style: { ...cell, fontWeight: 700 }, children: head.metric }),
2455
+ /* @__PURE__ */ jsx("th", { style: { ...num, fontWeight: 700 }, children: head.target }),
2456
+ /* @__PURE__ */ jsx("th", { style: { ...num, fontWeight: 700 }, children: head.actual }),
2457
+ showAttainment && /* @__PURE__ */ jsx("th", { style: { ...num, fontWeight: 700 }, children: head.attainment }),
2458
+ /* @__PURE__ */ jsx("th", { style: { ...cell, fontWeight: 700 }, children: head.status })
2459
+ ] }) }),
2460
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((r, i) => /* @__PURE__ */ jsxs("tr", { children: [
2461
+ /* @__PURE__ */ jsx("th", { scope: "row", style: { ...cell, fontWeight: 700, ...WRAP7 }, children: r.metric }),
2462
+ /* @__PURE__ */ jsx("td", { style: num, children: r.target === void 0 ? EMPTY_VALUE : formatValue(r.target, r.format) }),
2463
+ /* @__PURE__ */ jsx("td", { style: { ...num, fontWeight: 700 }, children: r.display ?? formatValue(r.value, r.format) }),
2464
+ showAttainment && /* @__PURE__ */ jsx("td", { style: num, children: attainment(r) === void 0 ? EMPTY_VALUE : formatValue(attainment(r), { type: "percent", digits: 0 }) }),
2465
+ /* @__PURE__ */ jsxs("td", { style: cell, children: [
2466
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, style: { color: STATUS[r.status].color }, children: "\u25CF" }),
2467
+ " ",
2468
+ STATUS[r.status].label
2469
+ ] })
2470
+ ] }, i)) })
2471
+ ] }) }),
2472
+ hasSource && /* @__PURE__ */ jsx(SlideSourceLine6, { asOf, source })
2473
+ ]
2474
+ }
2475
+ );
2476
+ }
1614
2477
 
1615
- export { CANVAS_HEIGHT, CANVAS_WIDTH, MorphElement, Slide, SlideCanvas, SlideDeck, Step, Steps, exportDeckAsPptx, useIsActiveSlide, useSlideNumber };
2478
+ export { CANVAS_HEIGHT, CANVAS_WIDTH, MorphElement, Slide, SlideCanvas, SlideChartInsight, SlideCover, SlideDeck, SlideExecSummary, SlideKpiGrid, SlideKpiHero, SlideNextActions, SlideScorecardTable, Step, Steps, exportDeckAsPptx, useIsActiveSlide, useSlideNumber };
1616
2479
  //# sourceMappingURL=index.js.map
1617
2480
  //# sourceMappingURL=index.js.map