@squadbase/vantage 0.6.2-dev1.d594c56 → 0.6.2-dev1.e30f2cc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-X5NVCQKT.js → build-A23M4GCH.js} +7 -7
- package/dist/{build-X5NVCQKT.js.map → build-A23M4GCH.js.map} +1 -1
- package/dist/{check-ZBIH422T.js → check-FBHT6W6J.js} +5 -5
- package/dist/{check-ZBIH422T.js.map → check-FBHT6W6J.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/chunk-57GHR5LN.js +163 -0
- package/dist/chunk-57GHR5LN.js.map +1 -0
- package/dist/{chunk-7DZGJQ3P.js → chunk-5C2SEDPH.js} +21 -4
- package/dist/chunk-5C2SEDPH.js.map +1 -0
- package/dist/chunk-6OTTGAPO.js +44 -0
- package/dist/chunk-6OTTGAPO.js.map +1 -0
- package/dist/{chunk-XPQSTZUU.js → chunk-7S52M2SL.js} +4 -3
- package/dist/chunk-7S52M2SL.js.map +1 -0
- package/dist/{chunk-V3LF7BE7.js → chunk-ANZLVSEP.js} +4 -5
- package/dist/chunk-ANZLVSEP.js.map +1 -0
- package/dist/{chunk-XQUSGIDG.js → chunk-CKWPK4RO.js} +10 -3
- package/dist/chunk-CKWPK4RO.js.map +1 -0
- package/dist/chunk-JXFCSF3K.js +673 -0
- package/dist/chunk-JXFCSF3K.js.map +1 -0
- package/dist/{chunk-HKSVYMYJ.js → chunk-QOXXOFGL.js} +61 -929
- package/dist/chunk-QOXXOFGL.js.map +1 -0
- package/dist/{chunk-CEXAQQ5W.js → chunk-S5MDTHH7.js} +180 -18
- package/dist/chunk-S5MDTHH7.js.map +1 -0
- package/dist/{chunk-2ICNHUG6.js → chunk-SDJTTMLK.js} +64 -7
- package/dist/chunk-SDJTTMLK.js.map +1 -0
- package/dist/{chunk-WAMZWZJB.js → chunk-SHZM3EXB.js} +19 -8
- package/dist/chunk-SHZM3EXB.js.map +1 -0
- package/dist/{chunk-JKLLFVEU.js → chunk-UWSQUHX6.js} +4 -99
- package/dist/chunk-UWSQUHX6.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +8 -2
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +11 -247
- package/dist/components/index.js +5 -2
- package/dist/delta-text-CvwBGJ95.d.ts +15 -0
- package/dist/{dev-4XEDTELV.js → dev-H4I2JL63.js} +7 -7
- package/dist/{dev-4XEDTELV.js.map → dev-H4I2JL63.js.map} +1 -1
- package/dist/doc/index.d.ts +215 -2
- package/dist/doc/index.js +307 -3
- package/dist/doc/index.js.map +1 -1
- package/dist/{doctor-5E2VEZPK.js → doctor-B2O3GJDU.js} +5 -5
- package/dist/{doctor-5E2VEZPK.js.map → doctor-B2O3GJDU.js.map} +1 -1
- package/dist/format-U0cQl069.d.ts +243 -0
- package/dist/query/index.js +2 -2
- package/dist/{routes-3SGAFDMC.js → routes-PVKNT777.js} +4 -4
- package/dist/{routes-3SGAFDMC.js.map → routes-PVKNT777.js.map} +1 -1
- package/dist/slide/index.d.ts +272 -1
- package/dist/slide/index.js +972 -2
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +7 -4
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +4 -1
- package/dist/ui/index.js +3 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-JHXZBGQS.js → upgrade-6DT7ADRP.js} +4 -4
- package/dist/{upgrade-JHXZBGQS.js.map → upgrade-6DT7ADRP.js.map} +1 -1
- package/dist/vite/index.js +3 -3
- package/docs/en/changelog.md +2 -0
- package/docs/en/components.md +13 -2
- package/docs/en/doc/delta-text.md +40 -0
- package/docs/en/doc/doc-action-items.md +49 -0
- package/docs/en/doc/doc-callout.md +38 -0
- package/docs/en/doc/doc-data-table.md +60 -0
- package/docs/en/doc/doc-executive-summary.md +64 -0
- package/docs/en/doc/doc-figure.md +56 -0
- package/docs/en/doc/doc-key-findings.md +61 -0
- package/docs/en/doc/doc-kpi-scorecard.md +80 -0
- package/docs/en/doc/doc-notes-and-sources.md +43 -0
- package/docs/en/doc/doc-report-header.md +46 -0
- package/docs/en/pages-and-metadata.md +15 -0
- package/docs/en/parts/area-chart.md +99 -0
- package/docs/en/parts/bar-chart.md +91 -0
- package/docs/en/parts/bar-list.md +50 -0
- package/docs/en/parts/category-bar.md +37 -0
- package/docs/en/parts/chart-frame.md +39 -0
- package/docs/en/parts/delta.md +4 -3
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/funnel-steps.md +2 -1
- package/docs/en/parts/heatmap.md +53 -0
- package/docs/en/parts/kpi-card.md +2 -1
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/progress-circle.md +33 -0
- package/docs/en/parts/sample-data.md +39 -0
- package/docs/en/parts/scatter-chart.md +56 -0
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-full.md +48 -0
- package/docs/en/slide/slide-chart-insight.md +52 -0
- package/docs/en/slide/slide-columns.md +46 -0
- package/docs/en/slide/slide-comparison.md +68 -0
- package/docs/en/slide/slide-cover.md +39 -0
- package/docs/en/slide/slide-exec-summary.md +47 -0
- package/docs/en/slide/slide-heading.md +38 -0
- package/docs/en/slide/slide-kpi-grid.md +55 -0
- package/docs/en/slide/slide-kpi-hero.md +58 -0
- package/docs/en/slide/slide-next-actions.md +49 -0
- package/docs/en/slide/slide-scorecard-table.md +54 -0
- package/docs/en/slide/slide-section.md +44 -0
- package/docs/en/slide/slide-source-line.md +34 -0
- package/docs/en/ui/alert-dialog.md +42 -0
- package/docs/en/ui/avatar.md +31 -0
- package/docs/en/ui/combobox.md +74 -0
- package/docs/en/ui/drawer.md +41 -0
- package/docs/en/ui/empty.md +1 -1
- package/docs/en/ui/error-state.md +4 -3
- package/docs/en/ui/field.md +42 -0
- package/docs/en/ui/hover-card.md +21 -0
- package/docs/en/ui/kbd.md +17 -0
- package/docs/en/ui/loading.md +1 -1
- package/docs/en/ui/pagination.md +36 -0
- package/docs/en/ui/radio-group.md +21 -0
- package/docs/en/ui/toast.md +44 -0
- package/docs/en/ui/toggle-group.md +4 -3
- package/docs/index.json +857 -77
- package/docs/ja/changelog.md +2 -0
- package/docs/ja/components.md +12 -1
- package/docs/ja/doc/delta-text.md +40 -0
- package/docs/ja/doc/doc-action-items.md +49 -0
- package/docs/ja/doc/doc-callout.md +38 -0
- package/docs/ja/doc/doc-data-table.md +60 -0
- package/docs/ja/doc/doc-executive-summary.md +64 -0
- package/docs/ja/doc/doc-figure.md +56 -0
- package/docs/ja/doc/doc-key-findings.md +61 -0
- package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
- package/docs/ja/doc/doc-notes-and-sources.md +43 -0
- package/docs/ja/doc/doc-report-header.md +46 -0
- package/docs/ja/page-types/slide.md +1 -0
- package/docs/ja/pages-and-metadata.md +15 -0
- package/docs/ja/parts/area-chart.md +49 -25
- package/docs/ja/parts/bar-chart.md +50 -24
- package/docs/ja/parts/bar-list.md +31 -8
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/delta.md +5 -4
- package/docs/ja/parts/donut-chart.md +45 -26
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +2 -1
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +48 -22
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/slide/slide-chart-full.md +48 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -0
- package/docs/ja/slide/slide-columns.md +46 -0
- package/docs/ja/slide/slide-comparison.md +68 -0
- package/docs/ja/slide/slide-cover.md +39 -0
- package/docs/ja/slide/slide-exec-summary.md +47 -0
- package/docs/ja/slide/slide-heading.md +38 -0
- package/docs/ja/slide/slide-kpi-grid.md +55 -0
- package/docs/ja/slide/slide-kpi-hero.md +58 -0
- package/docs/ja/slide/slide-next-actions.md +49 -0
- package/docs/ja/slide/slide-scorecard-table.md +54 -0
- package/docs/ja/slide/slide-section.md +44 -0
- package/docs/ja/slide/slide-source-line.md +34 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/toggle-group.md +4 -3
- package/package.json +2 -2
- package/registry/ui/area-chart.tsx +88 -26
- package/registry/ui/attention-list.tsx +303 -0
- package/registry/ui/bar-chart.tsx +88 -26
- package/registry/ui/bar-list.tsx +87 -24
- package/registry/ui/box-plot-chart.tsx +3906 -0
- package/registry/ui/category-bar.tsx +54 -19
- package/registry/ui/chart-frame.tsx +56 -21
- package/registry/ui/dashboard-card.tsx +2 -2
- package/registry/ui/delta.tsx +11 -8
- package/registry/ui/donut-chart.tsx +89 -26
- package/registry/ui/echart.tsx +194 -44
- package/registry/ui/funnel-steps.tsx +33 -5
- package/registry/ui/heatmap.tsx +55 -21
- package/registry/ui/histogram-chart.tsx +3986 -0
- package/registry/ui/kpi-card.tsx +41 -14
- package/registry/ui/legend.tsx +87 -24
- package/registry/ui/line-chart.tsx +88 -26
- package/registry/ui/page-shell.tsx +9 -9
- package/registry/ui/paired-chart.tsx +3827 -0
- package/registry/ui/sample-data.tsx +1 -1
- package/registry/ui/scatter-chart.tsx +88 -26
- package/registry/ui/section-header.tsx +2 -2
- package/registry/ui/slider.tsx +1 -1
- package/registry/ui/status-badge.tsx +8 -8
- package/registry/ui/tooltip.tsx +6 -2
- package/registry/ui/tracker.tsx +9 -3
- package/registry/ui/trend-indicator.tsx +2 -2
- package/registry/ui/waterfall-chart.tsx +88 -26
- package/skills/vantage-design/SKILL.md +27 -25
- package/skills/vantage-design/references/extract.md +16 -14
- package/skills/vantage-design/references/format.md +6 -5
- package/skills/vantage-design/references/presets.md +60 -110
- package/skills/vantage-pitfalls/SKILL.md +5 -0
- package/skills/vantage-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +4 -2
- package/templates/agents/doc.md +48 -0
- package/templates/agents/page.md +22 -1
- package/templates/agents/slide.md +70 -2
- package/theme.css +23 -19
- package/dist/chunk-2ICNHUG6.js.map +0 -1
- package/dist/chunk-7DZGJQ3P.js.map +0 -1
- package/dist/chunk-CEXAQQ5W.js.map +0 -1
- package/dist/chunk-HKSVYMYJ.js.map +0 -1
- package/dist/chunk-JKLLFVEU.js.map +0 -1
- package/dist/chunk-V3LF7BE7.js.map +0 -1
- package/dist/chunk-WAMZWZJB.js.map +0 -1
- package/dist/chunk-XPQSTZUU.js.map +0 -1
- package/dist/chunk-XQUSGIDG.js.map +0 -1
package/dist/slide/index.js
CHANGED
|
@@ -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
|
|
@@ -217,8 +228,13 @@ async function exportDeckAsPptx({
|
|
|
217
228
|
background: "var(--slide-bg)",
|
|
218
229
|
color: "var(--slide-fg)",
|
|
219
230
|
fontFamily: "var(--slide-font-body)",
|
|
220
|
-
fontSize: "var(--slide-size-body)"
|
|
231
|
+
fontSize: "var(--slide-size-body)",
|
|
232
|
+
// Same phrase-aware line breaking as the on-screen canvas (see canvas.tsx).
|
|
233
|
+
wordBreak: "auto-phrase",
|
|
234
|
+
lineBreak: "strict",
|
|
235
|
+
overflowWrap: "break-word"
|
|
221
236
|
});
|
|
237
|
+
if (document.documentElement.lang) host.lang = document.documentElement.lang;
|
|
222
238
|
if (themeVars) {
|
|
223
239
|
for (const [key, value] of Object.entries(themeVars)) {
|
|
224
240
|
host.style.setProperty(key, String(value));
|
|
@@ -1611,7 +1627,961 @@ function MorphElement({ id, children, className, style }) {
|
|
|
1611
1627
|
}
|
|
1612
1628
|
return /* @__PURE__ */ jsx("div", { className, style, "data-slide-morph": id, children });
|
|
1613
1629
|
}
|
|
1630
|
+
var SAFE_X = 160;
|
|
1631
|
+
var SAFE_Y = 120;
|
|
1632
|
+
var COLUMNS = 12;
|
|
1633
|
+
var GUTTER2 = 32;
|
|
1634
|
+
var COLUMN_WIDTH = 104;
|
|
1635
|
+
var SLIDE_SPEC = {
|
|
1636
|
+
/** Keep content inside this margin; backgrounds may bleed past it. */
|
|
1637
|
+
safeArea: { x: SAFE_X, y: SAFE_Y },
|
|
1638
|
+
/** Spans the content width: 12 columns + 11 gutters = 1600. */
|
|
1639
|
+
grid: { columns: COLUMNS, gutter: GUTTER2, columnWidth: COLUMN_WIDTH },
|
|
1640
|
+
/** Font sizes in canvas px, strictly increasing. */
|
|
1641
|
+
fontSize: { caption: 24, page: 64, section: 88},
|
|
1642
|
+
lineHeight: { heading: 1.2, body: 1.6 },
|
|
1643
|
+
/** Gaps between elements, in canvas px. */
|
|
1644
|
+
space: { sm: 32, md: 48, lg: 64 }
|
|
1645
|
+
};
|
|
1646
|
+
function SlideColumns({ children, align = "stretch" }) {
|
|
1647
|
+
return /* @__PURE__ */ jsx(
|
|
1648
|
+
"div",
|
|
1649
|
+
{
|
|
1650
|
+
style: {
|
|
1651
|
+
gridColumn: "1 / -1",
|
|
1652
|
+
minHeight: 0,
|
|
1653
|
+
display: "grid",
|
|
1654
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
1655
|
+
gridTemplateRows: "minmax(0, 1fr)",
|
|
1656
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
1657
|
+
alignItems: align
|
|
1658
|
+
},
|
|
1659
|
+
children
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1663
|
+
function SlideColumn({ span, children }) {
|
|
1664
|
+
return /* @__PURE__ */ jsx("div", { style: { gridColumn: `span ${span}`, minWidth: 0, minHeight: 0 }, children });
|
|
1665
|
+
}
|
|
1666
|
+
function SlideHeading({ title, eyebrow }) {
|
|
1667
|
+
const heading = /* @__PURE__ */ jsx(
|
|
1668
|
+
"h2",
|
|
1669
|
+
{
|
|
1670
|
+
style: {
|
|
1671
|
+
...eyebrow ? {} : { gridColumn: "1 / -1" },
|
|
1672
|
+
margin: 0,
|
|
1673
|
+
fontFamily: "var(--slide-font-display)",
|
|
1674
|
+
fontSize: SLIDE_SPEC.fontSize.page,
|
|
1675
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
1676
|
+
fontWeight: 700,
|
|
1677
|
+
display: "-webkit-box",
|
|
1678
|
+
WebkitBoxOrient: "vertical",
|
|
1679
|
+
WebkitLineClamp: 2,
|
|
1680
|
+
overflow: "hidden"
|
|
1681
|
+
},
|
|
1682
|
+
children: title
|
|
1683
|
+
}
|
|
1684
|
+
);
|
|
1685
|
+
if (!eyebrow) return heading;
|
|
1686
|
+
return /* @__PURE__ */ jsxs("div", { style: { gridColumn: "1 / -1", display: "flex", flexDirection: "column", gap: SLIDE_SPEC.space.sm }, children: [
|
|
1687
|
+
/* @__PURE__ */ jsx(
|
|
1688
|
+
"p",
|
|
1689
|
+
{
|
|
1690
|
+
style: {
|
|
1691
|
+
margin: 0,
|
|
1692
|
+
fontSize: SLIDE_SPEC.fontSize.caption,
|
|
1693
|
+
lineHeight: SLIDE_SPEC.lineHeight.body,
|
|
1694
|
+
fontWeight: 700,
|
|
1695
|
+
color: "var(--slide-accent)"
|
|
1696
|
+
},
|
|
1697
|
+
children: eyebrow
|
|
1698
|
+
}
|
|
1699
|
+
),
|
|
1700
|
+
heading
|
|
1701
|
+
] });
|
|
1702
|
+
}
|
|
1703
|
+
function SlideSourceLine({ asOf, source, page }) {
|
|
1704
|
+
const text = [asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ");
|
|
1705
|
+
if (!text && !page) return null;
|
|
1706
|
+
return /* @__PURE__ */ jsx(
|
|
1707
|
+
"p",
|
|
1708
|
+
{
|
|
1709
|
+
style: {
|
|
1710
|
+
gridColumn: "1 / -1",
|
|
1711
|
+
margin: 0,
|
|
1712
|
+
fontSize: SLIDE_SPEC.fontSize.caption,
|
|
1713
|
+
lineHeight: SLIDE_SPEC.lineHeight.body,
|
|
1714
|
+
color: "var(--slide-muted)",
|
|
1715
|
+
...page ? { display: "flex", justifyContent: "space-between", gap: SLIDE_SPEC.space.md } : {}
|
|
1716
|
+
},
|
|
1717
|
+
children: page ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1718
|
+
/* @__PURE__ */ jsx("span", { children: text }),
|
|
1719
|
+
/* @__PURE__ */ jsx("span", { style: { fontVariantNumeric: "tabular-nums" }, children: `${page.current} / ${page.total}` })
|
|
1720
|
+
] }) : text
|
|
1721
|
+
}
|
|
1722
|
+
);
|
|
1723
|
+
}
|
|
1724
|
+
var MAX_INSIGHTS = 3;
|
|
1725
|
+
var MAX_INSIGHT_CHARS = 40;
|
|
1726
|
+
var LINE_TYPES = ["solid", "dashed", "dotted"];
|
|
1727
|
+
var SYMBOLS = ["circle", "rect", "triangle", "diamond"];
|
|
1728
|
+
function buildSlideChartOption(chart) {
|
|
1729
|
+
return {
|
|
1730
|
+
animation: false,
|
|
1731
|
+
textStyle: { fontSize: SLIDE_SPEC.fontSize.caption },
|
|
1732
|
+
grid: {
|
|
1733
|
+
left: 0,
|
|
1734
|
+
right: SLIDE_SPEC.space.sm,
|
|
1735
|
+
top: chart.series.length > 1 ? SLIDE_SPEC.space.lg : SLIDE_SPEC.space.sm,
|
|
1736
|
+
bottom: 0,
|
|
1737
|
+
containLabel: true
|
|
1738
|
+
},
|
|
1739
|
+
legend: chart.series.length > 1 ? {
|
|
1740
|
+
top: 0,
|
|
1741
|
+
left: 0,
|
|
1742
|
+
textStyle: { fontSize: SLIDE_SPEC.fontSize.caption }
|
|
1743
|
+
} : { show: false },
|
|
1744
|
+
// The first x label and the lowest y label meet at the corner: the margin keeps the x labels clear of the axis, and
|
|
1745
|
+
// `hideOverlap` drops whichever still collides.
|
|
1746
|
+
xAxis: {
|
|
1747
|
+
type: "category",
|
|
1748
|
+
data: chart.categories,
|
|
1749
|
+
// Half a category of room on both sides keeps the first point off the y-axis labels (a line from the axis touches them).
|
|
1750
|
+
boundaryGap: true,
|
|
1751
|
+
axisLabel: {
|
|
1752
|
+
fontSize: SLIDE_SPEC.fontSize.caption,
|
|
1753
|
+
margin: SLIDE_SPEC.space.sm,
|
|
1754
|
+
hideOverlap: true
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
yAxis: {
|
|
1758
|
+
type: "value",
|
|
1759
|
+
// A line from 0 hugs the top when the values sit in a narrow band; bars must keep their zero baseline.
|
|
1760
|
+
scale: chart.type !== "bar",
|
|
1761
|
+
axisLabel: {
|
|
1762
|
+
fontSize: SLIDE_SPEC.fontSize.caption,
|
|
1763
|
+
hideOverlap: true,
|
|
1764
|
+
formatter: (v) => formatValue(v, "compact")
|
|
1765
|
+
}
|
|
1766
|
+
},
|
|
1767
|
+
...chart.type === "bar" && chart.series.length > 1 ? { aria: { enabled: true, decal: { show: true } } } : {},
|
|
1768
|
+
series: chart.series.map((s, i) => ({
|
|
1769
|
+
name: s.name,
|
|
1770
|
+
type: chart.type === "bar" ? "bar" : "line",
|
|
1771
|
+
data: s.data,
|
|
1772
|
+
...chart.type === "bar" ? {} : {
|
|
1773
|
+
symbol: SYMBOLS[i % SYMBOLS.length],
|
|
1774
|
+
symbolSize: SLIDE_SPEC.space.sm / 2,
|
|
1775
|
+
lineStyle: { width: 6, type: LINE_TYPES[i % LINE_TYPES.length] }
|
|
1776
|
+
},
|
|
1777
|
+
...chart.type === "area" ? { areaStyle: { opacity: 0.16 } } : {}
|
|
1778
|
+
}))
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1781
|
+
function SlideChartInsight({ title, chart, insights, chartSide = "left", asOf, source }) {
|
|
1782
|
+
const hasSource = Boolean(asOf || source);
|
|
1783
|
+
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.`);
|
|
1784
|
+
if (insights.length > MAX_INSIGHTS) console.warn(`SlideChartInsight: ${insights.length} insights; ${MAX_INSIGHTS} fit beside the chart. Split the slide.`);
|
|
1785
|
+
const option = useMemo(() => buildSlideChartOption(chart), [chart]);
|
|
1786
|
+
const chartFirst = chartSide === "left";
|
|
1787
|
+
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 }) }) });
|
|
1788
|
+
const insightsColumn = /* @__PURE__ */ jsx(SlideColumn, { span: 5, children: /* @__PURE__ */ jsx(
|
|
1789
|
+
"ul",
|
|
1790
|
+
{
|
|
1791
|
+
style: {
|
|
1792
|
+
height: "100%",
|
|
1793
|
+
boxSizing: "border-box",
|
|
1794
|
+
margin: 0,
|
|
1795
|
+
padding: 0,
|
|
1796
|
+
listStyle: "none",
|
|
1797
|
+
minHeight: 0,
|
|
1798
|
+
display: "flex",
|
|
1799
|
+
flexDirection: "column",
|
|
1800
|
+
justifyContent: "center",
|
|
1801
|
+
gap: SLIDE_SPEC.space.md
|
|
1802
|
+
},
|
|
1803
|
+
children: insights.map((text, i) => /* @__PURE__ */ jsx(
|
|
1804
|
+
"li",
|
|
1805
|
+
{
|
|
1806
|
+
style: {
|
|
1807
|
+
paddingLeft: SLIDE_SPEC.space.sm,
|
|
1808
|
+
borderLeft: "4px solid var(--slide-accent)",
|
|
1809
|
+
fontSize: "var(--slide-size-body)",
|
|
1810
|
+
lineHeight: SLIDE_SPEC.lineHeight.body
|
|
1811
|
+
},
|
|
1812
|
+
children: text
|
|
1813
|
+
},
|
|
1814
|
+
i
|
|
1815
|
+
))
|
|
1816
|
+
}
|
|
1817
|
+
) });
|
|
1818
|
+
return /* @__PURE__ */ jsxs(
|
|
1819
|
+
"section",
|
|
1820
|
+
{
|
|
1821
|
+
"data-slot": "slide-chart-insight",
|
|
1822
|
+
style: {
|
|
1823
|
+
width: "100%",
|
|
1824
|
+
height: "100%",
|
|
1825
|
+
boxSizing: "border-box",
|
|
1826
|
+
display: "grid",
|
|
1827
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
1828
|
+
gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
|
|
1829
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
1830
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
1831
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
1832
|
+
color: "var(--slide-fg)",
|
|
1833
|
+
fontFamily: "var(--slide-font-body)"
|
|
1834
|
+
},
|
|
1835
|
+
children: [
|
|
1836
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
1837
|
+
/* @__PURE__ */ jsxs(SlideColumns, { children: [
|
|
1838
|
+
chartFirst ? chartColumn : insightsColumn,
|
|
1839
|
+
chartFirst ? insightsColumn : chartColumn
|
|
1840
|
+
] }),
|
|
1841
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
1842
|
+
]
|
|
1843
|
+
}
|
|
1844
|
+
);
|
|
1845
|
+
}
|
|
1846
|
+
function SlideCover({ title, subtitle, period, author, asOf, source }) {
|
|
1847
|
+
const meta = [
|
|
1848
|
+
period,
|
|
1849
|
+
author,
|
|
1850
|
+
[asOf ? `${asOf} \u6642\u70B9` : null, source ? `\u51FA\u5178: ${source}` : null].filter(Boolean).join(" / ") || void 0
|
|
1851
|
+
].filter(Boolean);
|
|
1852
|
+
return /* @__PURE__ */ jsxs(
|
|
1853
|
+
"section",
|
|
1854
|
+
{
|
|
1855
|
+
"data-slot": "slide-cover",
|
|
1856
|
+
style: {
|
|
1857
|
+
width: "100%",
|
|
1858
|
+
height: "100%",
|
|
1859
|
+
boxSizing: "border-box",
|
|
1860
|
+
display: "grid",
|
|
1861
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
1862
|
+
gridTemplateRows: "1fr auto",
|
|
1863
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
1864
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
1865
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
1866
|
+
color: "var(--slide-fg)",
|
|
1867
|
+
fontFamily: "var(--slide-font-body)"
|
|
1868
|
+
},
|
|
1869
|
+
children: [
|
|
1870
|
+
/* @__PURE__ */ jsx(SlideColumns, { children: /* @__PURE__ */ jsx(SlideColumn, { span: 8, children: /* @__PURE__ */ jsxs(
|
|
1871
|
+
"div",
|
|
1872
|
+
{
|
|
1873
|
+
style: {
|
|
1874
|
+
height: "100%",
|
|
1875
|
+
boxSizing: "border-box",
|
|
1876
|
+
display: "flex",
|
|
1877
|
+
flexDirection: "column",
|
|
1878
|
+
justifyContent: "center",
|
|
1879
|
+
gap: SLIDE_SPEC.space.md,
|
|
1880
|
+
minHeight: 0
|
|
1881
|
+
},
|
|
1882
|
+
children: [
|
|
1883
|
+
/* @__PURE__ */ jsx("div", { style: { width: SLIDE_SPEC.grid.columnWidth, height: 8, background: "var(--slide-accent)" } }),
|
|
1884
|
+
/* @__PURE__ */ jsx(
|
|
1885
|
+
"h1",
|
|
1886
|
+
{
|
|
1887
|
+
style: {
|
|
1888
|
+
margin: 0,
|
|
1889
|
+
fontFamily: "var(--slide-font-display)",
|
|
1890
|
+
fontSize: SLIDE_SPEC.fontSize.section,
|
|
1891
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
1892
|
+
fontWeight: 700,
|
|
1893
|
+
textWrap: "balance"
|
|
1894
|
+
},
|
|
1895
|
+
children: title
|
|
1896
|
+
}
|
|
1897
|
+
),
|
|
1898
|
+
subtitle && /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)" }, children: subtitle })
|
|
1899
|
+
]
|
|
1900
|
+
}
|
|
1901
|
+
) }) }),
|
|
1902
|
+
meta.length > 0 && /* @__PURE__ */ jsx(
|
|
1903
|
+
"p",
|
|
1904
|
+
{
|
|
1905
|
+
style: {
|
|
1906
|
+
gridColumn: "1 / -1",
|
|
1907
|
+
margin: 0,
|
|
1908
|
+
fontSize: SLIDE_SPEC.fontSize.caption,
|
|
1909
|
+
lineHeight: SLIDE_SPEC.lineHeight.body,
|
|
1910
|
+
color: "var(--slide-muted)"
|
|
1911
|
+
},
|
|
1912
|
+
children: meta.join("\u3000|\u3000")
|
|
1913
|
+
}
|
|
1914
|
+
)
|
|
1915
|
+
]
|
|
1916
|
+
}
|
|
1917
|
+
);
|
|
1918
|
+
}
|
|
1919
|
+
var MAX_POINTS = 5;
|
|
1920
|
+
function SlideExecSummary({ title, points, layout = "rows", asOf, source }) {
|
|
1921
|
+
const hasSource = Boolean(asOf || source);
|
|
1922
|
+
if (points.length > MAX_POINTS) console.warn(`SlideExecSummary: ${points.length} points; ${MAX_POINTS} fit the canvas. Split the slide.`);
|
|
1923
|
+
const number = (i) => String(i + 1).padStart(2, "0");
|
|
1924
|
+
return /* @__PURE__ */ jsxs(
|
|
1925
|
+
"section",
|
|
1926
|
+
{
|
|
1927
|
+
"data-slot": "slide-exec-summary",
|
|
1928
|
+
style: {
|
|
1929
|
+
width: "100%",
|
|
1930
|
+
height: "100%",
|
|
1931
|
+
boxSizing: "border-box",
|
|
1932
|
+
display: "grid",
|
|
1933
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
1934
|
+
gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
|
|
1935
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
1936
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
1937
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
1938
|
+
color: "var(--slide-fg)",
|
|
1939
|
+
fontFamily: "var(--slide-font-body)"
|
|
1940
|
+
},
|
|
1941
|
+
children: [
|
|
1942
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
1943
|
+
layout === "columns" ? /* @__PURE__ */ jsx(
|
|
1944
|
+
"ol",
|
|
1945
|
+
{
|
|
1946
|
+
style: {
|
|
1947
|
+
gridColumn: "1 / -1",
|
|
1948
|
+
margin: 0,
|
|
1949
|
+
padding: 0,
|
|
1950
|
+
listStyle: "none",
|
|
1951
|
+
minHeight: 0,
|
|
1952
|
+
display: "grid",
|
|
1953
|
+
gridTemplateColumns: `repeat(${Math.max(points.length, 1)}, 1fr)`,
|
|
1954
|
+
columnGap: SLIDE_SPEC.grid.gutter
|
|
1955
|
+
},
|
|
1956
|
+
children: points.map((p, i) => /* @__PURE__ */ jsxs(
|
|
1957
|
+
"li",
|
|
1958
|
+
{
|
|
1959
|
+
style: {
|
|
1960
|
+
display: "flex",
|
|
1961
|
+
flexDirection: "column",
|
|
1962
|
+
gap: SLIDE_SPEC.space.sm,
|
|
1963
|
+
paddingTop: SLIDE_SPEC.space.md,
|
|
1964
|
+
borderTop: "4px solid var(--slide-accent)"
|
|
1965
|
+
},
|
|
1966
|
+
children: [
|
|
1967
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.page, lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: "var(--slide-accent)" }, children: number(i) }),
|
|
1968
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700 }, children: p.headline }),
|
|
1969
|
+
p.detail && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)" }, children: p.detail })
|
|
1970
|
+
]
|
|
1971
|
+
},
|
|
1972
|
+
i
|
|
1973
|
+
))
|
|
1974
|
+
}
|
|
1975
|
+
) : /* @__PURE__ */ jsx(
|
|
1976
|
+
"ol",
|
|
1977
|
+
{
|
|
1978
|
+
style: {
|
|
1979
|
+
gridColumn: "1 / -1",
|
|
1980
|
+
margin: 0,
|
|
1981
|
+
padding: 0,
|
|
1982
|
+
listStyle: "none",
|
|
1983
|
+
minHeight: 0,
|
|
1984
|
+
display: "flex",
|
|
1985
|
+
flexDirection: "column",
|
|
1986
|
+
justifyContent: "center",
|
|
1987
|
+
gap: SLIDE_SPEC.space.sm
|
|
1988
|
+
},
|
|
1989
|
+
children: points.map((p, i) => /* @__PURE__ */ jsxs(
|
|
1990
|
+
"li",
|
|
1991
|
+
{
|
|
1992
|
+
style: {
|
|
1993
|
+
display: "grid",
|
|
1994
|
+
gridTemplateColumns: `${SLIDE_SPEC.grid.columnWidth}px 1fr`,
|
|
1995
|
+
columnGap: SLIDE_SPEC.space.md,
|
|
1996
|
+
alignItems: "baseline"
|
|
1997
|
+
},
|
|
1998
|
+
children: [
|
|
1999
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.page, lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: "var(--slide-accent)" }, children: number(i) }),
|
|
2000
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
2001
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700 }, children: p.headline }),
|
|
2002
|
+
p.detail && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)" }, children: p.detail })
|
|
2003
|
+
] })
|
|
2004
|
+
]
|
|
2005
|
+
},
|
|
2006
|
+
i
|
|
2007
|
+
))
|
|
2008
|
+
}
|
|
2009
|
+
),
|
|
2010
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2011
|
+
]
|
|
2012
|
+
}
|
|
2013
|
+
);
|
|
2014
|
+
}
|
|
2015
|
+
var MAX_ITEMS = 4;
|
|
2016
|
+
var ARROW = { up: "\u25B2", down: "\u25BC", flat: "\u25AC" };
|
|
2017
|
+
var WORD = { up: "\u5897", down: "\u6E1B", flat: "\u6A2A\u3070\u3044" };
|
|
2018
|
+
function deltaView(delta, betterWhen) {
|
|
2019
|
+
const direction = delta.value > 0 ? "up" : delta.value < 0 ? "down" : "flat";
|
|
2020
|
+
const color = direction === "flat" ? "var(--slide-muted)" : direction === betterWhen ? "var(--positive)" : "var(--negative)";
|
|
2021
|
+
const amount = formatValue(delta.value, delta.format, void 0, { signDisplay: "exceptZero" });
|
|
2022
|
+
return { color, text: `${ARROW[direction]} ${WORD[direction]} ${amount}` };
|
|
2023
|
+
}
|
|
2024
|
+
function targetText(item) {
|
|
2025
|
+
if (item.target === void 0) return void 0;
|
|
2026
|
+
const { value, target, betterWhen = "up" } = item;
|
|
2027
|
+
const rate = value === null ? void 0 : betterWhen === "down" ? target / value : value / target;
|
|
2028
|
+
const shown = `\u76EE\u6A19 ${formatValue(target, item.format)}`;
|
|
2029
|
+
return rate === void 0 || !Number.isFinite(rate) ? shown : `${shown}(\u9054\u6210\u7387 ${formatValue(rate, { type: "percent", digits: 0 })})`;
|
|
2030
|
+
}
|
|
2031
|
+
function SlideKpiGrid({ title, items, asOf, source }) {
|
|
2032
|
+
const hasSource = Boolean(asOf || source);
|
|
2033
|
+
if (items.length > MAX_ITEMS) console.warn(`SlideKpiGrid: ${items.length} items; ${MAX_ITEMS} fit the canvas. Split the slide.`);
|
|
2034
|
+
return /* @__PURE__ */ jsxs(
|
|
2035
|
+
"section",
|
|
2036
|
+
{
|
|
2037
|
+
"data-slot": "slide-kpi-grid",
|
|
2038
|
+
style: {
|
|
2039
|
+
width: "100%",
|
|
2040
|
+
height: "100%",
|
|
2041
|
+
boxSizing: "border-box",
|
|
2042
|
+
display: "grid",
|
|
2043
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2044
|
+
gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
|
|
2045
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2046
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
2047
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2048
|
+
color: "var(--slide-fg)",
|
|
2049
|
+
fontFamily: "var(--slide-font-body)"
|
|
2050
|
+
},
|
|
2051
|
+
children: [
|
|
2052
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
2053
|
+
/* @__PURE__ */ jsx(
|
|
2054
|
+
"div",
|
|
2055
|
+
{
|
|
2056
|
+
style: {
|
|
2057
|
+
gridColumn: "1 / -1",
|
|
2058
|
+
minHeight: 0,
|
|
2059
|
+
display: "grid",
|
|
2060
|
+
gridTemplateColumns: `repeat(${Math.max(items.length, 1)}, 1fr)`,
|
|
2061
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2062
|
+
alignItems: "center"
|
|
2063
|
+
},
|
|
2064
|
+
children: items.map((item, i) => {
|
|
2065
|
+
const delta = item.delta ? deltaView({ value: item.delta.value, format: item.delta.format ?? item.format }, item.betterWhen ?? "up") : void 0;
|
|
2066
|
+
const target = targetText(item);
|
|
2067
|
+
return /* @__PURE__ */ jsxs(
|
|
2068
|
+
"div",
|
|
2069
|
+
{
|
|
2070
|
+
style: {
|
|
2071
|
+
display: "flex",
|
|
2072
|
+
flexDirection: "column",
|
|
2073
|
+
gap: SLIDE_SPEC.space.sm,
|
|
2074
|
+
padding: SLIDE_SPEC.space.md,
|
|
2075
|
+
border: "2px solid var(--border)",
|
|
2076
|
+
borderRadius: "var(--slide-radius)",
|
|
2077
|
+
minWidth: 0
|
|
2078
|
+
},
|
|
2079
|
+
children: [
|
|
2080
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, fontWeight: 700, color: "var(--slide-muted)" }, children: item.label }),
|
|
2081
|
+
/* @__PURE__ */ jsx(
|
|
2082
|
+
"span",
|
|
2083
|
+
{
|
|
2084
|
+
"data-raw": item.value ?? void 0,
|
|
2085
|
+
style: {
|
|
2086
|
+
fontFamily: "var(--slide-font-display)",
|
|
2087
|
+
fontSize: SLIDE_SPEC.fontSize.page,
|
|
2088
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
2089
|
+
fontWeight: 700,
|
|
2090
|
+
fontVariantNumeric: "tabular-nums"
|
|
2091
|
+
},
|
|
2092
|
+
children: item.display ?? formatValue(item.value, item.format)
|
|
2093
|
+
}
|
|
2094
|
+
),
|
|
2095
|
+
delta && /* @__PURE__ */ jsxs("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700, color: delta.color }, children: [
|
|
2096
|
+
delta.text,
|
|
2097
|
+
item.comparisonLabel && /* @__PURE__ */ jsxs("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, fontWeight: 400, color: "var(--slide-muted)" }, children: [
|
|
2098
|
+
" ",
|
|
2099
|
+
item.comparisonLabel
|
|
2100
|
+
] })
|
|
2101
|
+
] }),
|
|
2102
|
+
target && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)" }, children: target })
|
|
2103
|
+
]
|
|
2104
|
+
},
|
|
2105
|
+
i
|
|
2106
|
+
);
|
|
2107
|
+
})
|
|
2108
|
+
}
|
|
2109
|
+
),
|
|
2110
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2111
|
+
]
|
|
2112
|
+
}
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
var ARROW2 = { up: "\u25B2", down: "\u25BC", flat: "\u25AC" };
|
|
2116
|
+
var WORD2 = { up: "\u5897", down: "\u6E1B", flat: "\u6A2A\u3070\u3044" };
|
|
2117
|
+
function deltaView2(delta, betterWhen) {
|
|
2118
|
+
const direction = delta.value > 0 ? "up" : delta.value < 0 ? "down" : "flat";
|
|
2119
|
+
const color = direction === "flat" ? "var(--slide-muted)" : direction === betterWhen ? "var(--positive)" : "var(--negative)";
|
|
2120
|
+
const amount = formatValue(delta.value, delta.format, void 0, { signDisplay: "exceptZero" });
|
|
2121
|
+
return { color, text: `${ARROW2[direction]} ${WORD2[direction]} ${amount}` };
|
|
2122
|
+
}
|
|
2123
|
+
function SlideKpiHero({ title, label, value, format, display, delta, betterWhen = "up", comparisonLabel, trend, asOf, source }) {
|
|
2124
|
+
const hasSource = Boolean(asOf || source);
|
|
2125
|
+
const deltaShown = delta ? deltaView2({ value: delta.value, format: delta.format ?? format }, betterWhen) : void 0;
|
|
2126
|
+
const option = useMemo(() => {
|
|
2127
|
+
if (!trend || trend.length === 0) return void 0;
|
|
2128
|
+
return {
|
|
2129
|
+
animation: false,
|
|
2130
|
+
textStyle: { fontSize: SLIDE_SPEC.fontSize.caption },
|
|
2131
|
+
grid: { left: 0, right: SLIDE_SPEC.space.sm, top: SLIDE_SPEC.space.sm, bottom: 0, containLabel: true },
|
|
2132
|
+
// The first x label and the lowest y label meet at the corner: the margin keeps the x labels clear of the axis, and
|
|
2133
|
+
// `hideOverlap` drops whichever still collides.
|
|
2134
|
+
xAxis: {
|
|
2135
|
+
type: "category",
|
|
2136
|
+
data: trend.map((p) => p.x),
|
|
2137
|
+
boundaryGap: false,
|
|
2138
|
+
axisLabel: { fontSize: SLIDE_SPEC.fontSize.caption, margin: SLIDE_SPEC.space.sm, hideOverlap: true }
|
|
2139
|
+
},
|
|
2140
|
+
yAxis: {
|
|
2141
|
+
type: "value",
|
|
2142
|
+
scale: true,
|
|
2143
|
+
axisLabel: { fontSize: SLIDE_SPEC.fontSize.caption, hideOverlap: true, formatter: (v) => formatValue(v, "compact") }
|
|
2144
|
+
},
|
|
2145
|
+
series: [
|
|
2146
|
+
{
|
|
2147
|
+
type: "line",
|
|
2148
|
+
data: trend.map((p) => p.y),
|
|
2149
|
+
symbol: "circle",
|
|
2150
|
+
symbolSize: SLIDE_SPEC.space.sm / 2,
|
|
2151
|
+
lineStyle: { width: 6 },
|
|
2152
|
+
areaStyle: { opacity: 0.12 }
|
|
2153
|
+
}
|
|
2154
|
+
]
|
|
2155
|
+
};
|
|
2156
|
+
}, [trend]);
|
|
2157
|
+
return /* @__PURE__ */ jsxs(
|
|
2158
|
+
"section",
|
|
2159
|
+
{
|
|
2160
|
+
"data-slot": "slide-kpi-hero",
|
|
2161
|
+
style: {
|
|
2162
|
+
width: "100%",
|
|
2163
|
+
height: "100%",
|
|
2164
|
+
boxSizing: "border-box",
|
|
2165
|
+
display: "grid",
|
|
2166
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2167
|
+
gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
|
|
2168
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2169
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
2170
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2171
|
+
color: "var(--slide-fg)",
|
|
2172
|
+
fontFamily: "var(--slide-font-body)"
|
|
2173
|
+
},
|
|
2174
|
+
children: [
|
|
2175
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
2176
|
+
/* @__PURE__ */ jsxs(SlideColumns, { children: [
|
|
2177
|
+
/* @__PURE__ */ jsx(SlideColumn, { span: option ? 6 : 12, children: /* @__PURE__ */ jsxs(
|
|
2178
|
+
"div",
|
|
2179
|
+
{
|
|
2180
|
+
style: {
|
|
2181
|
+
height: "100%",
|
|
2182
|
+
boxSizing: "border-box",
|
|
2183
|
+
display: "flex",
|
|
2184
|
+
flexDirection: "column",
|
|
2185
|
+
justifyContent: "center",
|
|
2186
|
+
gap: SLIDE_SPEC.space.sm
|
|
2187
|
+
},
|
|
2188
|
+
children: [
|
|
2189
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, color: "var(--slide-muted)" }, children: label }),
|
|
2190
|
+
/* @__PURE__ */ jsx(
|
|
2191
|
+
"span",
|
|
2192
|
+
{
|
|
2193
|
+
"data-raw": value ?? void 0,
|
|
2194
|
+
style: {
|
|
2195
|
+
fontFamily: "var(--slide-font-display)",
|
|
2196
|
+
fontSize: "var(--slide-size-hero)",
|
|
2197
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
2198
|
+
fontWeight: 700,
|
|
2199
|
+
fontVariantNumeric: "tabular-nums"
|
|
2200
|
+
},
|
|
2201
|
+
children: display ?? formatValue(value, format)
|
|
2202
|
+
}
|
|
2203
|
+
),
|
|
2204
|
+
(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: [
|
|
2205
|
+
deltaShown && /* @__PURE__ */ jsx("span", { style: { color: deltaShown.color, fontWeight: 700 }, children: deltaShown.text }),
|
|
2206
|
+
comparisonLabel && /* @__PURE__ */ jsx("span", { style: { fontSize: SLIDE_SPEC.fontSize.caption, color: "var(--slide-muted)" }, children: comparisonLabel })
|
|
2207
|
+
] })
|
|
2208
|
+
]
|
|
2209
|
+
}
|
|
2210
|
+
) }),
|
|
2211
|
+
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` }) }) })
|
|
2212
|
+
] }),
|
|
2213
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2214
|
+
]
|
|
2215
|
+
}
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
var MAX_ITEMS2 = 5;
|
|
2219
|
+
var MAX_DUE_CHARS = 10;
|
|
2220
|
+
function SlideNextActions({ title, items, asOf, source }) {
|
|
2221
|
+
const hasSource = Boolean(asOf || source);
|
|
2222
|
+
if (items.length > MAX_ITEMS2) console.warn(`SlideNextActions: ${items.length} items; ${MAX_ITEMS2} fit the canvas. Split the slide.`);
|
|
2223
|
+
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.`);
|
|
2224
|
+
const cols = [
|
|
2225
|
+
{ key: "owner", head: "\u62C5\u5F53", fr: 2 },
|
|
2226
|
+
{ key: "due", head: "\u671F\u9650", fr: 2 },
|
|
2227
|
+
{ key: "metric", head: "\u78BA\u8A8D\u3059\u308B\u6307\u6A19", fr: 3 }
|
|
2228
|
+
];
|
|
2229
|
+
const shown = cols.filter((c) => items.some((it) => it[c.key]));
|
|
2230
|
+
const template = [`${SLIDE_SPEC.grid.columnWidth}px`, "minmax(0, 6fr)", ...shown.map((c) => `minmax(0, ${c.fr}fr)`)].join(" ");
|
|
2231
|
+
const row = { display: "grid", gridTemplateColumns: template, columnGap: SLIDE_SPEC.space.md, alignItems: "baseline" };
|
|
2232
|
+
return /* @__PURE__ */ jsxs(
|
|
2233
|
+
"section",
|
|
2234
|
+
{
|
|
2235
|
+
"data-slot": "slide-next-actions",
|
|
2236
|
+
style: {
|
|
2237
|
+
width: "100%",
|
|
2238
|
+
height: "100%",
|
|
2239
|
+
boxSizing: "border-box",
|
|
2240
|
+
display: "grid",
|
|
2241
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2242
|
+
gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
|
|
2243
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2244
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
2245
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2246
|
+
color: "var(--slide-fg)",
|
|
2247
|
+
fontFamily: "var(--slide-font-body)"
|
|
2248
|
+
},
|
|
2249
|
+
children: [
|
|
2250
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
2251
|
+
/* @__PURE__ */ jsxs("div", { style: { gridColumn: "1 / -1", minHeight: 0, display: "flex", flexDirection: "column", justifyContent: "center" }, children: [
|
|
2252
|
+
shown.length > 0 && /* @__PURE__ */ jsxs(
|
|
2253
|
+
"div",
|
|
2254
|
+
{
|
|
2255
|
+
"aria-hidden": true,
|
|
2256
|
+
style: {
|
|
2257
|
+
...row,
|
|
2258
|
+
paddingBottom: SLIDE_SPEC.space.sm,
|
|
2259
|
+
fontSize: SLIDE_SPEC.fontSize.caption,
|
|
2260
|
+
lineHeight: SLIDE_SPEC.lineHeight.body,
|
|
2261
|
+
fontWeight: 700,
|
|
2262
|
+
color: "var(--slide-muted)"
|
|
2263
|
+
},
|
|
2264
|
+
children: [
|
|
2265
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
2266
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
2267
|
+
shown.map((c) => /* @__PURE__ */ jsx("span", { children: c.head }, c.key))
|
|
2268
|
+
]
|
|
2269
|
+
}
|
|
2270
|
+
),
|
|
2271
|
+
/* @__PURE__ */ jsx("ol", { style: { margin: 0, padding: 0, listStyle: "none" }, children: items.map((it, i) => /* @__PURE__ */ jsxs(
|
|
2272
|
+
"li",
|
|
2273
|
+
{
|
|
2274
|
+
style: {
|
|
2275
|
+
...row,
|
|
2276
|
+
paddingTop: SLIDE_SPEC.space.sm,
|
|
2277
|
+
paddingBottom: SLIDE_SPEC.space.sm,
|
|
2278
|
+
borderTop: "2px solid var(--border)"
|
|
2279
|
+
},
|
|
2280
|
+
children: [
|
|
2281
|
+
/* @__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") }),
|
|
2282
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.heading, fontWeight: 700 }, children: it.action }),
|
|
2283
|
+
shown.map((c) => /* @__PURE__ */ jsx(
|
|
2284
|
+
"span",
|
|
2285
|
+
{
|
|
2286
|
+
style: { fontSize: SLIDE_SPEC.fontSize.caption, lineHeight: SLIDE_SPEC.lineHeight.body, ...c.key === "due" ? { whiteSpace: "nowrap" } : {} },
|
|
2287
|
+
children: it[c.key]
|
|
2288
|
+
},
|
|
2289
|
+
c.key
|
|
2290
|
+
))
|
|
2291
|
+
]
|
|
2292
|
+
},
|
|
2293
|
+
i
|
|
2294
|
+
)) })
|
|
2295
|
+
] }),
|
|
2296
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2297
|
+
]
|
|
2298
|
+
}
|
|
2299
|
+
);
|
|
2300
|
+
}
|
|
2301
|
+
var MAX_ROWS = 8;
|
|
2302
|
+
var DENSE_ROWS = 6;
|
|
2303
|
+
var STATUS = {
|
|
2304
|
+
on: { label: "\u9806\u8ABF", color: "var(--positive)" },
|
|
2305
|
+
risk: { label: "\u8981\u6CE8\u610F", color: "var(--warning)" },
|
|
2306
|
+
off: { label: "\u9045\u5EF6", color: "var(--negative)" }
|
|
2307
|
+
};
|
|
2308
|
+
function attainment(row) {
|
|
2309
|
+
if (row.value === null || row.target === void 0) return void 0;
|
|
2310
|
+
const rate = row.betterWhen === "down" ? row.target / row.value : row.value / row.target;
|
|
2311
|
+
return Number.isFinite(rate) ? rate : void 0;
|
|
2312
|
+
}
|
|
2313
|
+
function SlideScorecardTable({ title, rows, columns, asOf, source }) {
|
|
2314
|
+
const hasSource = Boolean(asOf || source);
|
|
2315
|
+
if (rows.length > MAX_ROWS) console.warn(`SlideScorecardTable: ${rows.length} rows; ${MAX_ROWS} fit the canvas. Split the slide.`);
|
|
2316
|
+
const head = { metric: "\u6307\u6A19", target: "\u76EE\u6A19", actual: "\u5B9F\u7E3E", attainment: "\u9054\u6210\u7387", status: "\u72B6\u614B", ...columns };
|
|
2317
|
+
const showAttainment = rows.some((r) => attainment(r) !== void 0);
|
|
2318
|
+
const cellSize = rows.length > DENSE_ROWS ? SLIDE_SPEC.fontSize.caption : "var(--slide-size-body)";
|
|
2319
|
+
const cell = {
|
|
2320
|
+
paddingLeft: SLIDE_SPEC.space.sm,
|
|
2321
|
+
paddingRight: SLIDE_SPEC.space.sm,
|
|
2322
|
+
borderBottom: "2px solid var(--border)",
|
|
2323
|
+
textAlign: "left",
|
|
2324
|
+
verticalAlign: "middle"
|
|
2325
|
+
};
|
|
2326
|
+
const num = { ...cell, textAlign: "right", fontVariantNumeric: "tabular-nums" };
|
|
2327
|
+
return /* @__PURE__ */ jsxs(
|
|
2328
|
+
"section",
|
|
2329
|
+
{
|
|
2330
|
+
"data-slot": "slide-scorecard-table",
|
|
2331
|
+
style: {
|
|
2332
|
+
width: "100%",
|
|
2333
|
+
height: "100%",
|
|
2334
|
+
boxSizing: "border-box",
|
|
2335
|
+
display: "grid",
|
|
2336
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2337
|
+
gridTemplateRows: hasSource ? "auto 1fr auto" : "auto 1fr",
|
|
2338
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2339
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
2340
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2341
|
+
color: "var(--slide-fg)",
|
|
2342
|
+
fontFamily: "var(--slide-font-body)"
|
|
2343
|
+
},
|
|
2344
|
+
children: [
|
|
2345
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
2346
|
+
/* @__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: [
|
|
2347
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { style: { color: "var(--slide-muted)", fontSize: SLIDE_SPEC.fontSize.caption }, children: [
|
|
2348
|
+
/* @__PURE__ */ jsx("th", { style: { ...cell, fontWeight: 700 }, children: head.metric }),
|
|
2349
|
+
/* @__PURE__ */ jsx("th", { style: { ...num, fontWeight: 700 }, children: head.target }),
|
|
2350
|
+
/* @__PURE__ */ jsx("th", { style: { ...num, fontWeight: 700 }, children: head.actual }),
|
|
2351
|
+
showAttainment && /* @__PURE__ */ jsx("th", { style: { ...num, fontWeight: 700 }, children: head.attainment }),
|
|
2352
|
+
/* @__PURE__ */ jsx("th", { style: { ...cell, fontWeight: 700 }, children: head.status })
|
|
2353
|
+
] }) }),
|
|
2354
|
+
/* @__PURE__ */ jsx("tbody", { children: rows.map((r, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
2355
|
+
/* @__PURE__ */ jsx("th", { scope: "row", style: { ...cell, fontWeight: 700 }, children: r.metric }),
|
|
2356
|
+
/* @__PURE__ */ jsx("td", { style: num, children: r.target === void 0 ? EMPTY_VALUE : formatValue(r.target, r.format) }),
|
|
2357
|
+
/* @__PURE__ */ jsx("td", { style: { ...num, fontWeight: 700 }, children: r.display ?? formatValue(r.value, r.format) }),
|
|
2358
|
+
showAttainment && /* @__PURE__ */ jsx("td", { style: num, children: attainment(r) === void 0 ? EMPTY_VALUE : formatValue(attainment(r), { type: "percent", digits: 0 }) }),
|
|
2359
|
+
/* @__PURE__ */ jsxs("td", { style: cell, children: [
|
|
2360
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, style: { color: STATUS[r.status].color }, children: "\u25CF" }),
|
|
2361
|
+
" ",
|
|
2362
|
+
STATUS[r.status].label
|
|
2363
|
+
] })
|
|
2364
|
+
] }, i)) })
|
|
2365
|
+
] }) }),
|
|
2366
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2367
|
+
]
|
|
2368
|
+
}
|
|
2369
|
+
);
|
|
2370
|
+
}
|
|
2371
|
+
function SlideChartFull({ title, chart, note, asOf, source }) {
|
|
2372
|
+
const hasSource = Boolean(asOf || source);
|
|
2373
|
+
const option = useMemo(() => buildSlideChartOption(chart), [chart]);
|
|
2374
|
+
return /* @__PURE__ */ jsxs(
|
|
2375
|
+
"section",
|
|
2376
|
+
{
|
|
2377
|
+
"data-slot": "slide-chart-full",
|
|
2378
|
+
style: {
|
|
2379
|
+
width: "100%",
|
|
2380
|
+
height: "100%",
|
|
2381
|
+
boxSizing: "border-box",
|
|
2382
|
+
display: "grid",
|
|
2383
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2384
|
+
gridTemplateRows: ["auto", "1fr", note ? "auto" : null, hasSource ? "auto" : null].filter(Boolean).join(" "),
|
|
2385
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2386
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
2387
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2388
|
+
color: "var(--slide-fg)",
|
|
2389
|
+
fontFamily: "var(--slide-font-body)"
|
|
2390
|
+
},
|
|
2391
|
+
children: [
|
|
2392
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
2393
|
+
/* @__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 }) }) }) }),
|
|
2394
|
+
note && /* @__PURE__ */ jsx("p", { style: { gridColumn: "1 / -1", margin: 0, fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.body }, children: note }),
|
|
2395
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2396
|
+
]
|
|
2397
|
+
}
|
|
2398
|
+
);
|
|
2399
|
+
}
|
|
2400
|
+
var MAX_POINTS2 = 3;
|
|
2401
|
+
var MAX_POINT_CHARS = 24;
|
|
2402
|
+
function SlideComparison({ title, columns, verdict, asOf, source }) {
|
|
2403
|
+
const hasSource = Boolean(asOf || source);
|
|
2404
|
+
if (columns.length < 2 || columns.length > 3) console.warn(`SlideComparison: ${columns.length} columns; 2\u20133 fit. Split the slide.`);
|
|
2405
|
+
if (columns.some((c) => c.points.length > MAX_POINTS2 || c.points.some((t) => t.length > MAX_POINT_CHARS)))
|
|
2406
|
+
console.warn(`SlideComparison: a column has over ${MAX_POINTS2} points or a point over ${MAX_POINT_CHARS} characters. Shorten it.`);
|
|
2407
|
+
const span = Math.floor(SLIDE_SPEC.grid.columns / Math.max(columns.length, 1));
|
|
2408
|
+
return /* @__PURE__ */ jsxs(
|
|
2409
|
+
"section",
|
|
2410
|
+
{
|
|
2411
|
+
"data-slot": "slide-comparison",
|
|
2412
|
+
style: {
|
|
2413
|
+
width: "100%",
|
|
2414
|
+
height: "100%",
|
|
2415
|
+
boxSizing: "border-box",
|
|
2416
|
+
display: "grid",
|
|
2417
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2418
|
+
gridTemplateRows: ["auto", "1fr", verdict ? "auto" : null, hasSource ? "auto" : null].filter(Boolean).join(" "),
|
|
2419
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2420
|
+
rowGap: SLIDE_SPEC.space.lg,
|
|
2421
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2422
|
+
color: "var(--slide-fg)",
|
|
2423
|
+
fontFamily: "var(--slide-font-body)"
|
|
2424
|
+
},
|
|
2425
|
+
children: [
|
|
2426
|
+
/* @__PURE__ */ jsx(SlideHeading, { title }),
|
|
2427
|
+
/* @__PURE__ */ jsx(SlideColumns, { children: columns.map((col, i) => {
|
|
2428
|
+
const main = col.display ?? (col.value === void 0 ? void 0 : col.value === null ? "\u2014" : formatValue(col.value, col.format));
|
|
2429
|
+
return /* @__PURE__ */ jsx(SlideColumn, { span, children: /* @__PURE__ */ jsxs(
|
|
2430
|
+
"div",
|
|
2431
|
+
{
|
|
2432
|
+
style: {
|
|
2433
|
+
height: "100%",
|
|
2434
|
+
boxSizing: "border-box",
|
|
2435
|
+
display: "flex",
|
|
2436
|
+
flexDirection: "column",
|
|
2437
|
+
gap: SLIDE_SPEC.space.md,
|
|
2438
|
+
paddingTop: SLIDE_SPEC.space.sm,
|
|
2439
|
+
borderTop: "4px solid var(--slide-accent)"
|
|
2440
|
+
},
|
|
2441
|
+
children: [
|
|
2442
|
+
/* @__PURE__ */ jsx(
|
|
2443
|
+
"h3",
|
|
2444
|
+
{
|
|
2445
|
+
style: {
|
|
2446
|
+
margin: 0,
|
|
2447
|
+
fontSize: "var(--slide-size-body)",
|
|
2448
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
2449
|
+
fontWeight: 700
|
|
2450
|
+
},
|
|
2451
|
+
children: col.heading
|
|
2452
|
+
}
|
|
2453
|
+
),
|
|
2454
|
+
main !== void 0 && /* @__PURE__ */ jsxs("p", { style: { margin: 0, display: "flex", flexDirection: "column", gap: SLIDE_SPEC.space.sm }, children: [
|
|
2455
|
+
/* @__PURE__ */ jsx(
|
|
2456
|
+
"span",
|
|
2457
|
+
{
|
|
2458
|
+
style: {
|
|
2459
|
+
fontFamily: "var(--slide-font-display)",
|
|
2460
|
+
fontSize: SLIDE_SPEC.fontSize.section,
|
|
2461
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
2462
|
+
fontWeight: 700,
|
|
2463
|
+
fontVariantNumeric: "tabular-nums"
|
|
2464
|
+
},
|
|
2465
|
+
children: main
|
|
2466
|
+
}
|
|
2467
|
+
),
|
|
2468
|
+
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 }) })
|
|
2469
|
+
] }),
|
|
2470
|
+
col.points.length > 0 && /* @__PURE__ */ jsx(
|
|
2471
|
+
"ul",
|
|
2472
|
+
{
|
|
2473
|
+
style: {
|
|
2474
|
+
margin: 0,
|
|
2475
|
+
padding: 0,
|
|
2476
|
+
listStyle: "none",
|
|
2477
|
+
display: "flex",
|
|
2478
|
+
flexDirection: "column",
|
|
2479
|
+
gap: SLIDE_SPEC.space.sm
|
|
2480
|
+
},
|
|
2481
|
+
children: col.points.map((text, j) => /* @__PURE__ */ jsx("li", { style: { fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.body }, children: text }, j))
|
|
2482
|
+
}
|
|
2483
|
+
)
|
|
2484
|
+
]
|
|
2485
|
+
}
|
|
2486
|
+
) }, i);
|
|
2487
|
+
}) }),
|
|
2488
|
+
verdict && /* @__PURE__ */ jsx(
|
|
2489
|
+
"p",
|
|
2490
|
+
{
|
|
2491
|
+
style: {
|
|
2492
|
+
gridColumn: "1 / -1",
|
|
2493
|
+
margin: 0,
|
|
2494
|
+
paddingLeft: SLIDE_SPEC.space.sm,
|
|
2495
|
+
borderLeft: "4px solid var(--slide-accent)",
|
|
2496
|
+
fontSize: "var(--slide-size-body)",
|
|
2497
|
+
lineHeight: SLIDE_SPEC.lineHeight.body,
|
|
2498
|
+
fontWeight: 700
|
|
2499
|
+
},
|
|
2500
|
+
children: verdict
|
|
2501
|
+
}
|
|
2502
|
+
),
|
|
2503
|
+
hasSource && /* @__PURE__ */ jsx(SlideSourceLine, { asOf, source })
|
|
2504
|
+
]
|
|
2505
|
+
}
|
|
2506
|
+
);
|
|
2507
|
+
}
|
|
2508
|
+
function SlideSection({ index, title, lead, items, current }) {
|
|
2509
|
+
const hasItems = Boolean(items && items.length > 0);
|
|
2510
|
+
return /* @__PURE__ */ jsx(
|
|
2511
|
+
"section",
|
|
2512
|
+
{
|
|
2513
|
+
"data-slot": "slide-section",
|
|
2514
|
+
style: {
|
|
2515
|
+
width: "100%",
|
|
2516
|
+
height: "100%",
|
|
2517
|
+
boxSizing: "border-box",
|
|
2518
|
+
display: "grid",
|
|
2519
|
+
gridTemplateColumns: `repeat(${SLIDE_SPEC.grid.columns}, 1fr)`,
|
|
2520
|
+
gridTemplateRows: "minmax(0, 1fr)",
|
|
2521
|
+
columnGap: SLIDE_SPEC.grid.gutter,
|
|
2522
|
+
padding: `${SLIDE_SPEC.safeArea.y}px ${SLIDE_SPEC.safeArea.x}px`,
|
|
2523
|
+
color: "var(--slide-fg)",
|
|
2524
|
+
fontFamily: "var(--slide-font-body)"
|
|
2525
|
+
},
|
|
2526
|
+
children: /* @__PURE__ */ jsxs(SlideColumns, { align: "center", children: [
|
|
2527
|
+
/* @__PURE__ */ jsx(SlideColumn, { span: hasItems ? 7 : 12, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: SLIDE_SPEC.space.md }, children: [
|
|
2528
|
+
/* @__PURE__ */ jsx("div", { style: { width: SLIDE_SPEC.grid.columnWidth, height: 8, background: "var(--slide-accent)" } }),
|
|
2529
|
+
index !== void 0 && /* @__PURE__ */ jsx(
|
|
2530
|
+
"p",
|
|
2531
|
+
{
|
|
2532
|
+
style: {
|
|
2533
|
+
margin: 0,
|
|
2534
|
+
fontSize: SLIDE_SPEC.fontSize.page,
|
|
2535
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
2536
|
+
fontWeight: 700,
|
|
2537
|
+
color: "var(--slide-accent)",
|
|
2538
|
+
fontVariantNumeric: "tabular-nums"
|
|
2539
|
+
},
|
|
2540
|
+
children: String(index).padStart(2, "0")
|
|
2541
|
+
}
|
|
2542
|
+
),
|
|
2543
|
+
/* @__PURE__ */ jsx(
|
|
2544
|
+
"h1",
|
|
2545
|
+
{
|
|
2546
|
+
style: {
|
|
2547
|
+
margin: 0,
|
|
2548
|
+
fontFamily: "var(--slide-font-display)",
|
|
2549
|
+
fontSize: SLIDE_SPEC.fontSize.section,
|
|
2550
|
+
lineHeight: SLIDE_SPEC.lineHeight.heading,
|
|
2551
|
+
fontWeight: 700
|
|
2552
|
+
},
|
|
2553
|
+
children: title
|
|
2554
|
+
}
|
|
2555
|
+
),
|
|
2556
|
+
lead && /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: "var(--slide-size-body)", lineHeight: SLIDE_SPEC.lineHeight.body, color: "var(--slide-muted)" }, children: lead })
|
|
2557
|
+
] }) }),
|
|
2558
|
+
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) => {
|
|
2559
|
+
const active = current === i + 1;
|
|
2560
|
+
return /* @__PURE__ */ jsxs(
|
|
2561
|
+
"li",
|
|
2562
|
+
{
|
|
2563
|
+
"aria-current": active ? "step" : void 0,
|
|
2564
|
+
style: {
|
|
2565
|
+
display: "flex",
|
|
2566
|
+
gap: SLIDE_SPEC.space.sm,
|
|
2567
|
+
fontSize: "var(--slide-size-body)",
|
|
2568
|
+
lineHeight: SLIDE_SPEC.lineHeight.body,
|
|
2569
|
+
fontWeight: active ? 700 : 400,
|
|
2570
|
+
color: active ? "var(--slide-accent)" : "var(--slide-muted)"
|
|
2571
|
+
},
|
|
2572
|
+
children: [
|
|
2573
|
+
/* @__PURE__ */ jsx("span", { style: { fontVariantNumeric: "tabular-nums" }, children: String(i + 1).padStart(2, "0") }),
|
|
2574
|
+
/* @__PURE__ */ jsx("span", { children: text })
|
|
2575
|
+
]
|
|
2576
|
+
},
|
|
2577
|
+
i
|
|
2578
|
+
);
|
|
2579
|
+
}) }) })
|
|
2580
|
+
] })
|
|
2581
|
+
}
|
|
2582
|
+
);
|
|
2583
|
+
}
|
|
1614
2584
|
|
|
1615
|
-
export { CANVAS_HEIGHT, CANVAS_WIDTH, MorphElement, Slide, SlideCanvas, SlideDeck, Step, Steps, exportDeckAsPptx, useIsActiveSlide, useSlideNumber };
|
|
2585
|
+
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
2586
|
//# sourceMappingURL=index.js.map
|
|
1617
2587
|
//# sourceMappingURL=index.js.map
|