@squadbase/vantage 0.6.2-dev1.d7c0911 → 0.6.2-dev1.e85faec

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