@squadbase/vantage 0.6.1 → 0.6.2-dev1.0010f67
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/add-4GHF2TX2.js +6 -0
- package/dist/add-4GHF2TX2.js.map +1 -0
- package/dist/{build-O5TVNH4E.js → build-U7GO26HR.js} +9 -9
- package/dist/{build-O5TVNH4E.js.map → build-U7GO26HR.js.map} +1 -1
- package/dist/{check-WFBEDHDR.js → check-MRVAIHG5.js} +7 -7
- package/dist/{check-WFBEDHDR.js.map → check-MRVAIHG5.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/chunk-3RJEOP3J.js +174 -0
- package/dist/chunk-3RJEOP3J.js.map +1 -0
- package/dist/chunk-77CISBMG.js +7581 -0
- package/dist/chunk-77CISBMG.js.map +1 -0
- package/dist/{chunk-QDZA5JSL.js → chunk-AABMKHEU.js} +4 -4
- package/dist/{chunk-QDZA5JSL.js.map → chunk-AABMKHEU.js.map} +1 -1
- package/dist/{chunk-PVTHHV7X.js → chunk-ANZLVSEP.js} +28 -7
- package/dist/chunk-ANZLVSEP.js.map +1 -0
- package/dist/chunk-CKWPK4RO.js +50 -0
- package/dist/chunk-CKWPK4RO.js.map +1 -0
- package/dist/chunk-EG4PX726.js +678 -0
- package/dist/chunk-EG4PX726.js.map +1 -0
- package/dist/{chunk-3G43C6OL.js → chunk-GNXCX4WE.js} +46 -3
- package/dist/chunk-GNXCX4WE.js.map +1 -0
- package/dist/chunk-NZ5QIIG4.js +74 -0
- package/dist/chunk-NZ5QIIG4.js.map +1 -0
- package/dist/{chunk-BCE22JSM.js → chunk-PJ4SPXHS.js} +52 -16
- package/dist/chunk-PJ4SPXHS.js.map +1 -0
- package/dist/{chunk-MXI3PZFT.js → chunk-QNOX7WLZ.js} +257 -210
- package/dist/chunk-QNOX7WLZ.js.map +1 -0
- package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
- package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
- package/dist/chunk-ROHNXP7J.js +123 -0
- package/dist/chunk-ROHNXP7J.js.map +1 -0
- package/dist/chunk-S5MDTHH7.js +466 -0
- package/dist/chunk-S5MDTHH7.js.map +1 -0
- package/dist/chunk-SDJTTMLK.js +1877 -0
- package/dist/chunk-SDJTTMLK.js.map +1 -0
- package/dist/{chunk-EP6JHXSR.js → chunk-SHZM3EXB.js} +68 -12
- package/dist/chunk-SHZM3EXB.js.map +1 -0
- package/dist/chunk-TRMHNMMZ.js +61 -0
- package/dist/chunk-TRMHNMMZ.js.map +1 -0
- package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-JGRMRXXZ.js → chunk-UWSQUHX6.js} +4 -99
- package/dist/chunk-UWSQUHX6.js.map +1 -0
- package/dist/cli.js +15 -11
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +34 -3
- package/dist/client/index.js +211 -12
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +1768 -30
- package/dist/components/index.js +7 -3
- package/dist/delta-text-CbrOaW83.d.ts +17 -0
- package/dist/{dev-NZRLOQCL.js → dev-O42JFQ64.js} +24 -13
- package/dist/dev-O42JFQ64.js.map +1 -0
- package/dist/doc/index.d.ts +219 -2
- package/dist/doc/index.js +525 -11
- package/dist/doc/index.js.map +1 -1
- package/dist/{docs-ZGDJUHJI.js → docs-JVP4RPKT.js} +3 -3
- package/dist/{docs-ZGDJUHJI.js.map → docs-JVP4RPKT.js.map} +1 -1
- package/dist/{doctor-VFKEMR54.js → doctor-YD3XAAOT.js} +8 -8
- package/dist/doctor-YD3XAAOT.js.map +1 -0
- package/dist/format-DihQkL1N.d.ts +249 -0
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.js.map +1 -1
- package/dist/{preview-QDCIVVSR.js → preview-T6CLSQVX.js} +12 -4
- package/dist/preview-T6CLSQVX.js.map +1 -0
- package/dist/query/index.d.ts +0 -11
- package/dist/query/index.js +2 -2
- package/dist/{routes-RHP5FVGD.js → routes-PVKNT777.js} +6 -6
- package/dist/{routes-RHP5FVGD.js.map → routes-PVKNT777.js.map} +1 -1
- package/dist/{search-RFBELGY7.js → search-5LC4XPB5.js} +3 -3
- package/dist/{search-RFBELGY7.js.map → search-5LC4XPB5.js.map} +1 -1
- package/dist/slide/index.d.ts +272 -1
- package/dist/slide/index.js +1086 -19
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +14 -9
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +148 -12
- package/dist/ui/index.js +1340 -87
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-GF2P67M6.js → upgrade-6DT7ADRP.js} +7 -7
- package/dist/{upgrade-GF2P67M6.js.map → upgrade-6DT7ADRP.js.map} +1 -1
- package/dist/vite/index.d.ts +10 -0
- package/dist/vite/index.js +4 -4
- package/docs/en/agent-skills.md +1 -1
- package/docs/en/changelog.md +26 -0
- package/docs/en/cli-reference.md +30 -0
- package/docs/en/components.md +42 -17
- 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/data-table.md +22 -0
- package/docs/en/parts/delta.md +51 -0
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/format.md +43 -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 +58 -0
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/metric-value.md +3 -2
- package/docs/en/parts/page-shell.md +1 -1
- 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/sparkline.md +1 -1
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/routing.md +4 -2
- 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/en/ui-and-theming.md +1 -1
- package/docs/index.json +1184 -114
- package/docs/ja/agent-skills.md +1 -1
- package/docs/ja/changelog.md +57 -0
- package/docs/ja/cli-reference.md +29 -0
- package/docs/ja/components.md +68 -101
- 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/csv.md +83 -0
- package/docs/ja/page-types/doc.md +83 -0
- package/docs/ja/page-types/excel.md +82 -0
- package/docs/ja/page-types/slide.md +133 -0
- package/docs/ja/page-types.md +47 -0
- package/docs/ja/pages-and-metadata.md +15 -0
- package/docs/ja/parts/area-chart.md +85 -0
- package/docs/ja/parts/bar-chart.md +95 -0
- package/docs/ja/parts/bar-list.md +58 -0
- package/docs/ja/parts/category-bar.md +36 -0
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/data-table.md +22 -0
- package/docs/ja/parts/delta.md +51 -0
- package/docs/ja/parts/donut-chart.md +66 -0
- package/docs/ja/parts/echart.md +3 -0
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +56 -0
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +84 -0
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/page-shell.md +1 -1
- package/docs/ja/parts/progress-circle.md +34 -0
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/sparkline.md +2 -2
- package/docs/ja/parts/tracker.md +32 -0
- package/docs/ja/parts/trend-indicator.md +17 -1
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/routing.md +8 -84
- 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/alert-dialog.md +41 -0
- package/docs/ja/ui/avatar.md +31 -0
- package/docs/ja/ui/combobox.md +74 -0
- package/docs/ja/ui/drawer.md +41 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/field.md +42 -0
- package/docs/ja/ui/hover-card.md +21 -0
- package/docs/ja/ui/kbd.md +16 -0
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/pagination.md +36 -0
- package/docs/ja/ui/radio-group.md +21 -0
- package/docs/ja/ui/toast.md +46 -0
- package/docs/ja/ui/toggle-group.md +4 -3
- package/docs/ja/ui-and-theming.md +14 -7
- package/package.json +43 -29
- package/registry/ui/accordion.tsx +76 -0
- package/registry/ui/alert-dialog.tsx +189 -0
- package/registry/ui/alert.tsx +80 -0
- package/registry/ui/app-shell.tsx +424 -0
- package/registry/ui/area-chart.tsx +3960 -0
- package/registry/ui/attention-list.tsx +465 -0
- package/registry/ui/avatar.tsx +110 -0
- package/registry/ui/badge.tsx +56 -0
- package/registry/ui/bar-chart.tsx +3954 -0
- package/registry/ui/bar-list.tsx +3998 -0
- package/registry/ui/box-plot-chart.tsx +4214 -0
- package/registry/ui/breadcrumb.tsx +128 -0
- package/registry/ui/button.tsx +62 -0
- package/registry/ui/calendar.tsx +223 -0
- package/registry/ui/card.tsx +107 -0
- package/registry/ui/category-bar.tsx +1498 -0
- package/registry/ui/chart-frame.tsx +1604 -0
- package/registry/ui/checkbox.tsx +30 -0
- package/registry/ui/collapsible.tsx +23 -0
- package/registry/ui/combobox.tsx +310 -0
- package/registry/ui/command.tsx +198 -0
- package/registry/ui/dashboard-card.tsx +217 -0
- package/registry/ui/data-table.tsx +896 -157
- package/registry/ui/date-range-picker.tsx +544 -0
- package/registry/ui/delta.tsx +350 -0
- package/registry/ui/dialog.tsx +161 -0
- package/registry/ui/donut-chart.tsx +4006 -0
- package/registry/ui/drawer.tsx +229 -0
- package/registry/ui/dropdown-menu.tsx +274 -0
- package/registry/ui/echart.tsx +1178 -0
- package/registry/ui/field.tsx +240 -0
- package/registry/ui/filter-bar.tsx +551 -0
- package/registry/ui/funnel-steps.tsx +3843 -0
- package/registry/ui/heatmap.tsx +2027 -0
- package/registry/ui/histogram-chart.tsx +4284 -0
- package/registry/ui/hover-card.tsx +52 -0
- package/registry/ui/input-group.tsx +160 -0
- package/registry/ui/input.tsx +24 -0
- package/registry/ui/kbd.tsx +30 -0
- package/registry/ui/kpi-card.tsx +905 -0
- package/registry/ui/label.tsx +22 -0
- package/registry/ui/legend.tsx +3817 -0
- package/registry/ui/line-chart.tsx +3958 -0
- package/registry/ui/metric-value.tsx +62 -0
- package/registry/ui/multi-select.tsx +382 -0
- package/registry/ui/page-shell.tsx +420 -0
- package/registry/ui/pagination.tsx +140 -0
- package/registry/ui/paired-chart.tsx +4086 -0
- package/registry/ui/placeholder.tsx +36 -0
- package/registry/ui/popover.tsx +92 -0
- package/registry/ui/progress-circle.tsx +1033 -0
- package/registry/ui/progress.tsx +85 -0
- package/registry/ui/radio-group.tsx +39 -0
- package/registry/ui/sample-data.tsx +230 -0
- package/registry/ui/scatter-chart.tsx +4503 -0
- package/registry/ui/scroll-area.tsx +56 -0
- package/registry/ui/searchable-select.tsx +352 -0
- package/registry/ui/section-header.tsx +43 -0
- package/registry/ui/segmented-control.tsx +76 -0
- package/registry/ui/select.tsx +255 -0
- package/registry/ui/separator.tsx +27 -0
- package/registry/ui/sheet.tsx +139 -0
- package/registry/ui/sidebar.tsx +725 -0
- package/registry/ui/skeleton.tsx +17 -0
- package/registry/ui/slider.tsx +56 -0
- package/registry/ui/sparkline.tsx +230 -0
- package/registry/ui/spinner.tsx +14 -0
- package/registry/ui/states.tsx +247 -0
- package/registry/ui/status-badge.tsx +286 -0
- package/registry/ui/switch.tsx +34 -0
- package/registry/ui/table.tsx +118 -0
- package/registry/ui/tabs.tsx +84 -0
- package/registry/ui/textarea.tsx +22 -0
- package/registry/ui/toast.tsx +250 -0
- package/registry/ui/toggle-group.tsx +91 -0
- package/registry/ui/toggle.tsx +47 -0
- package/registry/ui/tooltip.tsx +72 -0
- package/registry/ui/tracker.tsx +1015 -0
- package/registry/ui/trend-indicator.tsx +217 -0
- package/registry/ui/updated-at.tsx +276 -0
- package/registry/ui/waterfall-chart.tsx +4561 -0
- package/skills/vantage-add-feature/SKILL.md +9 -7
- package/skills/vantage-design/SKILL.md +62 -52
- package/skills/vantage-design/references/extract.md +26 -27
- package/skills/vantage-design/references/format.md +12 -172
- package/skills/vantage-design/references/presets.md +50 -110
- package/skills/vantage-pitfalls/SKILL.md +10 -1
- package/skills/vantage-slide/SKILL.md +71 -36
- package/templates/AGENTS.md +53 -16
- package/templates/agents/api.md +29 -0
- package/templates/agents/csv.md +2 -1
- package/templates/agents/doc.md +54 -3
- package/templates/agents/page.md +55 -10
- package/templates/agents/slide.md +90 -4
- package/templates/agents/xlsx.md +2 -1
- package/theme.css +287 -128
- package/dist/add-EISGSZAH.js +0 -6
- package/dist/add-EISGSZAH.js.map +0 -1
- package/dist/chunk-3G43C6OL.js.map +0 -1
- package/dist/chunk-5ZOP4SQR.js +0 -47
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-BCE22JSM.js.map +0 -1
- package/dist/chunk-DTDVSFRY.js +0 -29
- package/dist/chunk-DTDVSFRY.js.map +0 -1
- package/dist/chunk-EP6JHXSR.js.map +0 -1
- package/dist/chunk-JGRMRXXZ.js.map +0 -1
- package/dist/chunk-KLEIVDUV.js +0 -165
- package/dist/chunk-KLEIVDUV.js.map +0 -1
- package/dist/chunk-MXI3PZFT.js.map +0 -1
- package/dist/chunk-PLST5Q7T.js +0 -2221
- package/dist/chunk-PLST5Q7T.js.map +0 -1
- package/dist/chunk-PVTHHV7X.js.map +0 -1
- package/dist/chunk-T3FLAGI6.js +0 -316
- package/dist/chunk-T3FLAGI6.js.map +0 -1
- package/dist/dev-NZRLOQCL.js.map +0 -1
- package/dist/doctor-VFKEMR54.js.map +0 -1
- package/dist/preview-QDCIVVSR.js.map +0 -1
package/dist/doc/index.js
CHANGED
|
@@ -1,8 +1,84 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DeltaText } from '../chunk-TRMHNMMZ.js';
|
|
2
|
+
export { DeltaText } from '../chunk-TRMHNMMZ.js';
|
|
3
|
+
import { Sparkline } from '../chunk-2IAPIOPS.js';
|
|
4
|
+
import { formatValue } from '../chunk-3RJEOP3J.js';
|
|
5
|
+
import { Button, uiLanguage, useLocale } from '../chunk-ROHNXP7J.js';
|
|
6
|
+
import '../chunk-U736PVHY.js';
|
|
7
|
+
import { forwardRef, useEffect, useId } from 'react';
|
|
8
|
+
import { PrinterIcon } from 'lucide-react';
|
|
9
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
10
|
|
|
4
11
|
// @squadbase/vantage — generated build. Do not edit.
|
|
5
12
|
|
|
13
|
+
// src/doc/print.ts
|
|
14
|
+
var DARK_CLASS = "dark";
|
|
15
|
+
var THEME_ATTR = "data-theme";
|
|
16
|
+
var restore = null;
|
|
17
|
+
function forceLight() {
|
|
18
|
+
if (restore) return;
|
|
19
|
+
const undo = [];
|
|
20
|
+
for (const el of [document.documentElement, document.body]) {
|
|
21
|
+
if (!el) continue;
|
|
22
|
+
if (el.classList.contains(DARK_CLASS)) {
|
|
23
|
+
el.classList.remove(DARK_CLASS);
|
|
24
|
+
undo.push(() => el.classList.add(DARK_CLASS));
|
|
25
|
+
}
|
|
26
|
+
if (el.getAttribute(THEME_ATTR) === "dark") {
|
|
27
|
+
el.setAttribute(THEME_ATTR, "light");
|
|
28
|
+
undo.push(() => el.setAttribute(THEME_ATTR, "dark"));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
restore = () => {
|
|
32
|
+
for (const fn of undo) fn();
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function restoreTheme() {
|
|
36
|
+
restore?.();
|
|
37
|
+
restore = null;
|
|
38
|
+
}
|
|
39
|
+
function nextFrame() {
|
|
40
|
+
return new Promise((resolve) => {
|
|
41
|
+
let settled = false;
|
|
42
|
+
const settle = () => {
|
|
43
|
+
if (settled) return;
|
|
44
|
+
settled = true;
|
|
45
|
+
resolve();
|
|
46
|
+
};
|
|
47
|
+
requestAnimationFrame(settle);
|
|
48
|
+
setTimeout(settle, 50);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
var REPAINT_FRAMES = 4;
|
|
52
|
+
var CHART_TIMEOUT_MS = 3e3;
|
|
53
|
+
async function waitForCharts() {
|
|
54
|
+
const deadline = performance.now() + CHART_TIMEOUT_MS;
|
|
55
|
+
while (performance.now() < deadline) {
|
|
56
|
+
if (!document.querySelector('[data-slot="echart-canvas"][data-rendering]')) return;
|
|
57
|
+
await nextFrame();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
async function printDocument() {
|
|
61
|
+
const wasForced = restore !== null;
|
|
62
|
+
forceLight();
|
|
63
|
+
try {
|
|
64
|
+
if (!wasForced && restore) {
|
|
65
|
+
for (let i = 0; i < REPAINT_FRAMES; i++) await nextFrame();
|
|
66
|
+
}
|
|
67
|
+
await waitForCharts();
|
|
68
|
+
window.print();
|
|
69
|
+
} catch (error) {
|
|
70
|
+
restoreTheme();
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function watchPrintEvents() {
|
|
75
|
+
window.addEventListener("beforeprint", forceLight);
|
|
76
|
+
window.addEventListener("afterprint", restoreTheme);
|
|
77
|
+
return () => {
|
|
78
|
+
window.removeEventListener("beforeprint", forceLight);
|
|
79
|
+
window.removeEventListener("afterprint", restoreTheme);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
6
82
|
function themeToCssVars(theme) {
|
|
7
83
|
if (!theme) return void 0;
|
|
8
84
|
const vars = {};
|
|
@@ -19,20 +95,458 @@ function themeToCssVars(theme) {
|
|
|
19
95
|
if (theme.maxWidth) vars["--doc-max-width"] = theme.maxWidth;
|
|
20
96
|
return Object.keys(vars).length > 0 ? vars : void 0;
|
|
21
97
|
}
|
|
98
|
+
var PRINT_PAGE_CSS = "@media print { @page { margin: 0 } }";
|
|
99
|
+
function printLabel() {
|
|
100
|
+
return navigator.language.toLowerCase().startsWith("ja") ? "PDF \u3068\u3057\u3066\u4FDD\u5B58" : "Save as PDF";
|
|
101
|
+
}
|
|
22
102
|
var Document = forwardRef(function Document2({ theme, style, ...props }, ref) {
|
|
23
103
|
const themeVars = themeToCssVars(theme);
|
|
24
|
-
|
|
25
|
-
|
|
104
|
+
const label = printLabel();
|
|
105
|
+
useEffect(() => watchPrintEvents(), []);
|
|
106
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
"article",
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
"data-slot": "document",
|
|
112
|
+
style: {
|
|
113
|
+
width: "100%",
|
|
114
|
+
// Phrase-aware Japanese line breaks (no-op unless <html lang> is CJK / unsupported browsers drop it).
|
|
115
|
+
wordBreak: "auto-phrase",
|
|
116
|
+
lineBreak: "strict",
|
|
117
|
+
...themeVars,
|
|
118
|
+
...style
|
|
119
|
+
},
|
|
120
|
+
...props
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsx("style", { children: PRINT_PAGE_CSS }),
|
|
124
|
+
/* @__PURE__ */ jsxs(
|
|
125
|
+
Button,
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "document-print",
|
|
128
|
+
variant: "outline",
|
|
129
|
+
size: "sm",
|
|
130
|
+
className: "fixed right-4 bottom-4 z-10 shadow-sm",
|
|
131
|
+
onClick: () => void printDocument(),
|
|
132
|
+
title: label,
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx(PrinterIcon, { "aria-hidden": "true" }),
|
|
135
|
+
label
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] });
|
|
140
|
+
});
|
|
141
|
+
Document.displayName = "Document";
|
|
142
|
+
var TEXT = {
|
|
143
|
+
ja: {
|
|
144
|
+
title: "\u63A8\u5968\u3059\u308B\u5BFE\u5FDC",
|
|
145
|
+
priority: { high: "\u9AD8", medium: "\u4E2D", low: "\u4F4E" },
|
|
146
|
+
due: (due) => `${due} \u307E\u3067`,
|
|
147
|
+
asks: (parts) => `\uFF08${parts.join("\u30FB")}\uFF09`,
|
|
148
|
+
head: { action: "\u5BFE\u5FDC", owner: "\u62C5\u5F53", due: "\u671F\u9650", impact: "\u671F\u5F85\u3059\u308B\u52B9\u679C", priority: "\u512A\u5148\u5EA6" }
|
|
149
|
+
},
|
|
150
|
+
en: {
|
|
151
|
+
title: "Recommended actions",
|
|
152
|
+
priority: { high: "High", medium: "Medium", low: "Low" },
|
|
153
|
+
due: (due) => `by ${due}`,
|
|
154
|
+
asks: (parts) => ` (${parts.join(", ")})`,
|
|
155
|
+
head: { action: "Action", owner: "Owner", due: "Due", impact: "Expected impact", priority: "Priority" }
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
var MUTED = { color: "var(--doc-muted)" };
|
|
159
|
+
function Priority({ value, words }) {
|
|
160
|
+
if (!value) return /* @__PURE__ */ jsx(Fragment, { children: "\u2014" });
|
|
161
|
+
return /* @__PURE__ */ jsx("span", { className: value === "high" ? "font-semibold" : void 0, children: words[value] });
|
|
162
|
+
}
|
|
163
|
+
function DocActionItems({ title, headingLevel = 2, items, variant = "table" }) {
|
|
164
|
+
const t = TEXT[uiLanguage(useLocale())];
|
|
165
|
+
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
166
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "doc-action-items", children: [
|
|
167
|
+
/* @__PURE__ */ jsx(Heading, { children: title ?? t.title }),
|
|
168
|
+
variant === "asks" ? /* @__PURE__ */ jsx("ul", { children: items.map((item, i) => /* @__PURE__ */ jsxs("li", { className: "break-inside-avoid", children: [
|
|
169
|
+
item.action,
|
|
170
|
+
item.owner || item.due ? /* @__PURE__ */ jsx("span", { style: MUTED, children: t.asks([item.owner, item.due ? t.due(item.due) : void 0].filter((p) => Boolean(p))) }) : null
|
|
171
|
+
] }, i)) }) : /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "table w-full", children: [
|
|
172
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
173
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.head.action }),
|
|
174
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.head.owner }),
|
|
175
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.head.due }),
|
|
176
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.head.impact }),
|
|
177
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.head.priority })
|
|
178
|
+
] }) }),
|
|
179
|
+
/* @__PURE__ */ jsx("tbody", { children: items.map((item, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
180
|
+
/* @__PURE__ */ jsx("td", { children: item.action }),
|
|
181
|
+
/* @__PURE__ */ jsx("td", { children: item.owner ?? "\u2014" }),
|
|
182
|
+
/* @__PURE__ */ jsx("td", { className: "whitespace-nowrap tabular-nums", children: item.due ?? "\u2014" }),
|
|
183
|
+
/* @__PURE__ */ jsx("td", { children: item.impact ?? "\u2014" }),
|
|
184
|
+
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Priority, { value: item.priority, words: t.priority }) })
|
|
185
|
+
] }, i)) })
|
|
186
|
+
] }) })
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
var KINDS = {
|
|
190
|
+
note: { rule: "border-info", tint: "bg-info-subtle", text: "text-info" },
|
|
191
|
+
insight: { rule: "border-positive", tint: "bg-positive-subtle", text: "text-positive" },
|
|
192
|
+
warning: { rule: "border-warning", tint: "bg-warning-subtle", text: "text-warning" },
|
|
193
|
+
decision: { rule: "border-foreground", tint: "bg-muted", text: "text-foreground" }
|
|
194
|
+
};
|
|
195
|
+
var WORDS = {
|
|
196
|
+
ja: { note: "\u88DC\u8DB3", insight: "\u793A\u5506", warning: "\u6CE8\u610F", decision: "\u6C7A\u5B9A\u4E8B\u9805" },
|
|
197
|
+
en: { note: "Note", insight: "Insight", warning: "Caution", decision: "Decision" }
|
|
198
|
+
};
|
|
199
|
+
function DocCallout({ kind = "note", title, children }) {
|
|
200
|
+
const k = KINDS[kind];
|
|
201
|
+
const word = WORDS[uiLanguage(useLocale())][kind];
|
|
202
|
+
const titleId = useId();
|
|
203
|
+
const heading = title && title !== word ? `${word}: ${title}` : word;
|
|
204
|
+
return /* @__PURE__ */ jsxs(
|
|
205
|
+
"div",
|
|
26
206
|
{
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
207
|
+
role: "note",
|
|
208
|
+
"aria-labelledby": titleId,
|
|
209
|
+
"data-slot": "doc-callout",
|
|
210
|
+
"data-kind": kind,
|
|
211
|
+
className: `break-inside-avoid border-l-4 px-4 py-2 ${k.rule} ${k.tint}`,
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ jsx("p", { id: titleId, className: `m-0 font-semibold ${k.text}`, children: heading }),
|
|
214
|
+
/* @__PURE__ */ jsx("div", { children: typeof children === "string" ? /* @__PURE__ */ jsx("p", { className: "m-0", children }) : children })
|
|
215
|
+
]
|
|
31
216
|
}
|
|
32
217
|
);
|
|
33
|
-
}
|
|
34
|
-
|
|
218
|
+
}
|
|
219
|
+
var ALIGN = { left: "text-left", right: "text-right", center: "text-center" };
|
|
220
|
+
var TEXT2 = {
|
|
221
|
+
ja: {
|
|
222
|
+
source: (source) => `\u51FA\u5178: ${source}`,
|
|
223
|
+
asOf: (asOf) => `\u30C7\u30FC\u30BF\u6642\u70B9 ${asOf}`,
|
|
224
|
+
separator: " \uFF0F ",
|
|
225
|
+
unit: (unit) => `\uFF08${unit}\uFF09`
|
|
226
|
+
},
|
|
227
|
+
en: {
|
|
228
|
+
source: (source) => `Source: ${source}`,
|
|
229
|
+
asOf: (asOf) => `Data as of ${asOf}`,
|
|
230
|
+
separator: " / ",
|
|
231
|
+
unit: (unit) => ` (${unit})`
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
function DocDataTable({ title, unit, columns, rows, total, highlightRows, footnotes, source, asOf }) {
|
|
235
|
+
const locale = useLocale();
|
|
236
|
+
const t = TEXT2[uiLanguage(locale)];
|
|
237
|
+
const isNumeric = (col) => rows.some((r) => typeof r[col.key] === "number");
|
|
238
|
+
const cls = (col) => {
|
|
239
|
+
const numeric = isNumeric(col);
|
|
240
|
+
return `${ALIGN[col.align ?? (numeric ? "right" : "left")]}${numeric ? " tabular-nums" : ""}`;
|
|
241
|
+
};
|
|
242
|
+
const text = (col, v) => typeof v === "number" ? formatValue(v, col.format ?? "number", locale) : v === null || v === void 0 || v === "" ? "\u2014" : v;
|
|
243
|
+
const origin = [source ? t.source(source) : void 0, asOf ? t.asOf(asOf) : void 0].filter(Boolean).join(t.separator);
|
|
244
|
+
const highlighted = new Set(highlightRows);
|
|
245
|
+
return /* @__PURE__ */ jsxs("figure", { "data-slot": "doc-data-table", className: "m-0 w-full break-inside-auto", children: [
|
|
246
|
+
/* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "table w-full", children: [
|
|
247
|
+
title || unit ? /* @__PURE__ */ jsxs("caption", { className: "text-left", children: [
|
|
248
|
+
title ? /* @__PURE__ */ jsx("span", { className: "font-semibold", children: title }) : null,
|
|
249
|
+
unit ? /* @__PURE__ */ jsx("span", { style: { color: "var(--doc-muted)" }, children: title ? t.unit(unit) : unit }) : null
|
|
250
|
+
] }) : null,
|
|
251
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsx("th", { scope: "col", className: cls(col), children: col.label }, col.key)) }) }),
|
|
252
|
+
/* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => /* @__PURE__ */ jsx("tr", { className: highlighted.has(i) ? "font-semibold" : void 0, children: columns.map((col) => /* @__PURE__ */ jsx("td", { className: cls(col), children: text(col, row[col.key]) }, col.key)) }, i)) }),
|
|
253
|
+
total ? /* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsx("tr", { className: "font-semibold", children: columns.map((col) => /* @__PURE__ */ jsx("td", { className: cls(col), children: text(col, total[col.key]) }, col.key)) }) }) : null
|
|
254
|
+
] }) }),
|
|
255
|
+
footnotes?.length || origin ? /* @__PURE__ */ jsxs("figcaption", { className: "flex flex-col gap-0.5 break-inside-avoid text-left", children: [
|
|
256
|
+
footnotes?.map((f) => /* @__PURE__ */ jsxs("span", { children: [
|
|
257
|
+
f.mark,
|
|
258
|
+
" ",
|
|
259
|
+
f.text
|
|
260
|
+
] }, f.mark)),
|
|
261
|
+
origin ? /* @__PURE__ */ jsx("span", { children: origin }) : null
|
|
262
|
+
] }) : null
|
|
263
|
+
] });
|
|
264
|
+
}
|
|
265
|
+
var TEXT3 = {
|
|
266
|
+
ja: { title: "\u8981\u65E8", comparison: "\u524D\u671F\u6BD4" },
|
|
267
|
+
en: { title: "Executive summary", comparison: "vs. prior period" }
|
|
268
|
+
};
|
|
269
|
+
function DocExecutiveSummary({
|
|
270
|
+
title,
|
|
271
|
+
headingLevel = 2,
|
|
272
|
+
conclusion,
|
|
273
|
+
points,
|
|
274
|
+
metrics
|
|
275
|
+
}) {
|
|
276
|
+
const locale = useLocale();
|
|
277
|
+
const t = TEXT3[uiLanguage(locale)];
|
|
278
|
+
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
279
|
+
const shown2 = (metrics ?? []).slice(0, 3);
|
|
280
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "doc-executive-summary", children: [
|
|
281
|
+
/* @__PURE__ */ jsx(Heading, { children: title ?? t.title }),
|
|
282
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold", children: conclusion }),
|
|
283
|
+
/* @__PURE__ */ jsx("ol", { children: points.map((point, i) => /* @__PURE__ */ jsx("li", { className: "break-inside-avoid", children: point }, i)) }),
|
|
284
|
+
shown2.length > 0 ? /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-1 gap-4 sm:grid-cols-3 print:grid-cols-3", children: shown2.map((m) => /* @__PURE__ */ jsxs(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
className: "break-inside-avoid border-l-2 pl-3",
|
|
288
|
+
style: { borderColor: "var(--doc-border)" },
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ jsx("dt", { style: { color: "var(--doc-muted)" }, children: m.label }),
|
|
291
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 font-semibold tabular-nums", children: m.display ?? formatValue(m.value, m.format, locale) }),
|
|
292
|
+
m.delta ? /* @__PURE__ */ jsxs("dd", { className: "m-0", children: [
|
|
293
|
+
/* @__PURE__ */ jsxs("span", { style: { color: "var(--doc-muted)" }, children: [
|
|
294
|
+
m.comparisonLabel ?? t.comparison,
|
|
295
|
+
" "
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ jsx(DeltaText, { value: m.delta.value, format: m.delta.format ?? m.format, betterWhen: m.betterWhen, locale })
|
|
298
|
+
] }) : null
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
m.label
|
|
302
|
+
)) }) : null
|
|
303
|
+
] });
|
|
304
|
+
}
|
|
305
|
+
var TEXT4 = {
|
|
306
|
+
ja: {
|
|
307
|
+
source: (source) => `\u51FA\u5178: ${source}`,
|
|
308
|
+
asOf: (asOf) => `\u30C7\u30FC\u30BF\u6642\u70B9 ${asOf}`,
|
|
309
|
+
separator: " \uFF0F ",
|
|
310
|
+
figure: (n) => `\u56F3 ${n}`
|
|
311
|
+
},
|
|
312
|
+
en: {
|
|
313
|
+
source: (source) => `Source: ${source}`,
|
|
314
|
+
asOf: (asOf) => `Data as of ${asOf}`,
|
|
315
|
+
separator: " / ",
|
|
316
|
+
figure: (n) => `Figure ${n}`
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
function DocFigure({ title, unit, number, source, asOf, notes, children }) {
|
|
320
|
+
const t = TEXT4[uiLanguage(useLocale())];
|
|
321
|
+
const titleId = useId();
|
|
322
|
+
const origin = [source ? t.source(source) : void 0, asOf ? t.asOf(asOf) : void 0].filter(Boolean).join(t.separator);
|
|
323
|
+
const hasCaption = number !== void 0 || origin || notes && notes.length > 0;
|
|
324
|
+
return /* @__PURE__ */ jsxs("figure", { "data-slot": "doc-figure", "aria-labelledby": titleId, className: "w-full break-inside-avoid", children: [
|
|
325
|
+
/* @__PURE__ */ jsx("p", { id: titleId, className: "m-0 font-semibold", children: title }),
|
|
326
|
+
unit ? /* @__PURE__ */ jsx("p", { className: "m-0", style: { color: "var(--doc-muted)" }, children: unit }) : null,
|
|
327
|
+
/* @__PURE__ */ jsx("div", { className: "w-full", children }),
|
|
328
|
+
hasCaption ? /* @__PURE__ */ jsxs("figcaption", { className: "flex flex-col gap-0.5 text-left", children: [
|
|
329
|
+
number !== void 0 ? /* @__PURE__ */ jsx("span", { className: "font-medium", children: t.figure(number) }) : null,
|
|
330
|
+
origin ? /* @__PURE__ */ jsx("span", { children: origin }) : null,
|
|
331
|
+
notes?.map((note, i) => /* @__PURE__ */ jsx("span", { children: note }, i))
|
|
332
|
+
] }) : null
|
|
333
|
+
] });
|
|
334
|
+
}
|
|
335
|
+
var TEXT5 = {
|
|
336
|
+
ja: { title: "\u4E3B\u8981\u306A\u767A\u898B", comparison: "\u524D\u671F\u6BD4" },
|
|
337
|
+
en: { title: "Key findings", comparison: "vs. prior period" }
|
|
338
|
+
};
|
|
339
|
+
function DocKeyFindings({ title, headingLevel = 2, findings }) {
|
|
340
|
+
const locale = useLocale();
|
|
341
|
+
const t = TEXT5[uiLanguage(locale)];
|
|
342
|
+
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
343
|
+
const Item = headingLevel === 3 ? "h4" : "h3";
|
|
344
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "doc-key-findings", children: [
|
|
345
|
+
/* @__PURE__ */ jsx(Heading, { children: title ?? t.title }),
|
|
346
|
+
findings.map((f, i) => /* @__PURE__ */ jsxs("article", { className: "break-inside-avoid", children: [
|
|
347
|
+
/* @__PURE__ */ jsxs(Item, { children: [
|
|
348
|
+
i + 1,
|
|
349
|
+
". ",
|
|
350
|
+
f.headline
|
|
351
|
+
] }),
|
|
352
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between print:flex-row print:justify-between", children: [
|
|
353
|
+
/* @__PURE__ */ jsx("div", { children: typeof f.evidence === "string" ? /* @__PURE__ */ jsx("p", { className: "m-0", children: f.evidence }) : f.evidence }),
|
|
354
|
+
f.metric ? /* @__PURE__ */ jsxs("dl", { className: "m-0 shrink-0 sm:text-right print:text-right", children: [
|
|
355
|
+
/* @__PURE__ */ jsx("dt", { style: { color: "var(--doc-muted)" }, children: f.metric.label }),
|
|
356
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 font-semibold tabular-nums", children: f.metric.display ?? formatValue(f.metric.value, f.metric.format, locale) }),
|
|
357
|
+
f.metric.delta ? /* @__PURE__ */ jsxs("dd", { className: "m-0", children: [
|
|
358
|
+
/* @__PURE__ */ jsxs("span", { style: { color: "var(--doc-muted)" }, children: [
|
|
359
|
+
f.metric.comparisonLabel ?? t.comparison,
|
|
360
|
+
" "
|
|
361
|
+
] }),
|
|
362
|
+
/* @__PURE__ */ jsx(
|
|
363
|
+
DeltaText,
|
|
364
|
+
{
|
|
365
|
+
value: f.metric.delta.value,
|
|
366
|
+
format: f.metric.delta.format ?? f.metric.format,
|
|
367
|
+
betterWhen: f.metric.betterWhen,
|
|
368
|
+
locale
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
] }) : null
|
|
372
|
+
] }) : null
|
|
373
|
+
] })
|
|
374
|
+
] }, i))
|
|
375
|
+
] });
|
|
376
|
+
}
|
|
377
|
+
var MUTED2 = { color: "var(--doc-muted)" };
|
|
378
|
+
var ACHIEVEMENT = { type: "percent", digits: 1 };
|
|
379
|
+
var TEXT6 = {
|
|
380
|
+
ja: {
|
|
381
|
+
title: "\u4E3B\u8981\u6307\u6A19",
|
|
382
|
+
comparison: "\u524D\u671F\u6BD4",
|
|
383
|
+
source: (source) => `\u51FA\u5178: ${source}`,
|
|
384
|
+
asOf: (asOf) => `\u30C7\u30FC\u30BF\u6642\u70B9 ${asOf}`,
|
|
385
|
+
separator: " \uFF0F ",
|
|
386
|
+
attainment: "\u9054\u6210\u7387",
|
|
387
|
+
target: (target) => `\uFF08\u76EE\u6A19 ${target}\uFF09`,
|
|
388
|
+
trendLabel: (label) => `${label}\u306E\u63A8\u79FB`,
|
|
389
|
+
metric: "\u6307\u6A19",
|
|
390
|
+
actual: "\u5B9F\u7E3E",
|
|
391
|
+
targetHead: "\u76EE\u6A19",
|
|
392
|
+
trend: "\u63A8\u79FB"
|
|
393
|
+
},
|
|
394
|
+
en: {
|
|
395
|
+
title: "Key metrics",
|
|
396
|
+
comparison: "vs. prior period",
|
|
397
|
+
source: (source) => `Source: ${source}`,
|
|
398
|
+
asOf: (asOf) => `Data as of ${asOf}`,
|
|
399
|
+
separator: " / ",
|
|
400
|
+
attainment: "Attainment",
|
|
401
|
+
target: (target) => ` (target ${target})`,
|
|
402
|
+
trendLabel: (label) => `${label} trend`,
|
|
403
|
+
metric: "Metric",
|
|
404
|
+
actual: "Actual",
|
|
405
|
+
targetHead: "Target",
|
|
406
|
+
trend: "Trend"
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
var shown = (m, locale) => m.display ?? formatValue(m.value, m.format, locale);
|
|
410
|
+
var achievement = (m, locale) => m.target === void 0 || m.target === 0 || m.value === null ? "\u2014" : formatValue(m.value / m.target, ACHIEVEMENT, locale);
|
|
411
|
+
var change = (m, locale) => m.delta ? /* @__PURE__ */ jsx(DeltaText, { value: m.delta.value, format: m.delta.format ?? m.format, betterWhen: m.betterWhen, locale }) : "\u2014";
|
|
412
|
+
var trendOf = (m) => (m.trend ?? []).map(({ y }) => ({ value: y }));
|
|
413
|
+
function DocKpiScorecard({
|
|
414
|
+
title,
|
|
415
|
+
headingLevel = 2,
|
|
416
|
+
metrics,
|
|
417
|
+
variant = "table",
|
|
418
|
+
asOf,
|
|
419
|
+
source
|
|
420
|
+
}) {
|
|
421
|
+
const locale = useLocale();
|
|
422
|
+
const t = TEXT6[uiLanguage(locale)];
|
|
423
|
+
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
424
|
+
const caption = [source ? t.source(source) : void 0, asOf ? t.asOf(asOf) : void 0].filter(Boolean).join(t.separator);
|
|
425
|
+
const columnLabel = metrics.find((m) => m.comparisonLabel)?.comparisonLabel ?? t.comparison;
|
|
426
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "doc-kpi-scorecard", children: [
|
|
427
|
+
/* @__PURE__ */ jsx(Heading, { children: title ?? t.title }),
|
|
428
|
+
variant === "grid" ? /* @__PURE__ */ jsx("dl", { className: "m-0 grid grid-cols-1 gap-4 sm:grid-cols-3 print:grid-cols-3", children: metrics.map((m) => /* @__PURE__ */ jsxs(
|
|
429
|
+
"div",
|
|
430
|
+
{
|
|
431
|
+
className: "break-inside-avoid rounded-md border p-3",
|
|
432
|
+
style: { borderColor: "var(--doc-border)", background: "var(--doc-subtle)" },
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ jsx("dt", { style: MUTED2, children: m.label }),
|
|
435
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 font-semibold tabular-nums", children: shown(m, locale) }),
|
|
436
|
+
/* @__PURE__ */ jsxs("dd", { className: "m-0 flex flex-col gap-0.5", children: [
|
|
437
|
+
m.delta ? /* @__PURE__ */ jsxs("span", { children: [
|
|
438
|
+
/* @__PURE__ */ jsxs("span", { style: MUTED2, children: [
|
|
439
|
+
m.comparisonLabel ?? t.comparison,
|
|
440
|
+
" "
|
|
441
|
+
] }),
|
|
442
|
+
change(m, locale)
|
|
443
|
+
] }) : null,
|
|
444
|
+
m.target !== void 0 ? /* @__PURE__ */ jsxs("span", { children: [
|
|
445
|
+
/* @__PURE__ */ jsxs("span", { style: MUTED2, children: [
|
|
446
|
+
t.attainment,
|
|
447
|
+
" "
|
|
448
|
+
] }),
|
|
449
|
+
achievement(m, locale),
|
|
450
|
+
/* @__PURE__ */ jsx("span", { style: MUTED2, children: t.target(formatValue(m.target, m.format, locale)) })
|
|
451
|
+
] }) : null
|
|
452
|
+
] }),
|
|
453
|
+
m.trend && m.trend.length > 1 ? /* @__PURE__ */ jsx("dd", { className: "m-0", children: /* @__PURE__ */ jsx(Sparkline, { data: trendOf(m), height: 28, "aria-label": t.trendLabel(m.label) }) }) : null
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
m.label
|
|
457
|
+
)) }) : /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "table w-full", children: [
|
|
458
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
459
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.metric }),
|
|
460
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "text-right", children: t.actual }),
|
|
461
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "text-right", children: columnLabel }),
|
|
462
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "text-right", children: t.targetHead }),
|
|
463
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "text-right", children: t.attainment }),
|
|
464
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: t.trend })
|
|
465
|
+
] }) }),
|
|
466
|
+
/* @__PURE__ */ jsx("tbody", { children: metrics.map((m) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
467
|
+
/* @__PURE__ */ jsx("th", { scope: "row", className: "font-medium", children: m.label }),
|
|
468
|
+
/* @__PURE__ */ jsx("td", { className: "text-right font-semibold tabular-nums", children: shown(m, locale) }),
|
|
469
|
+
/* @__PURE__ */ jsx("td", { className: "text-right whitespace-nowrap", children: change(m, locale) }),
|
|
470
|
+
/* @__PURE__ */ jsx("td", { className: "text-right tabular-nums", children: m.target === void 0 ? "\u2014" : formatValue(m.target, m.format, locale) }),
|
|
471
|
+
/* @__PURE__ */ jsx("td", { className: "text-right tabular-nums", children: achievement(m, locale) }),
|
|
472
|
+
/* @__PURE__ */ jsx("td", { children: m.trend && m.trend.length > 1 ? /* @__PURE__ */ jsx(Sparkline, { data: trendOf(m), height: 24, "aria-label": t.trendLabel(m.label) }) : "\u2014" })
|
|
473
|
+
] }, m.label)) })
|
|
474
|
+
] }) }),
|
|
475
|
+
caption ? /* @__PURE__ */ jsx("p", { style: MUTED2, children: caption }) : null
|
|
476
|
+
] });
|
|
477
|
+
}
|
|
478
|
+
var TEXT7 = {
|
|
479
|
+
ja: { period: "\u5BFE\u8C61\u671F\u9593", asOf: "\u30C7\u30FC\u30BF\u6642\u70B9", author: "\u4F5C\u6210\u8005", source: "\u51FA\u5178" },
|
|
480
|
+
en: { period: "Period", asOf: "Data as of", author: "Author", source: "Source" }
|
|
481
|
+
};
|
|
482
|
+
function DocReportHeader({ title, subtitle, period, asOf, author, source }) {
|
|
483
|
+
const t = TEXT7[uiLanguage(useLocale())];
|
|
484
|
+
const facts = [
|
|
485
|
+
...period ? [{ label: t.period, value: period }] : [],
|
|
486
|
+
...asOf ? [{ label: t.asOf, value: asOf }] : [],
|
|
487
|
+
...author ? [{ label: t.author, value: author }] : [],
|
|
488
|
+
...source ? [{ label: t.source, value: source }] : []
|
|
489
|
+
];
|
|
490
|
+
return /* @__PURE__ */ jsxs("header", { "data-slot": "doc-report-header", className: "break-inside-avoid", children: [
|
|
491
|
+
/* @__PURE__ */ jsx("h1", { children: title }),
|
|
492
|
+
subtitle ? typeof subtitle === "string" ? /* @__PURE__ */ jsx("p", { style: { color: "var(--doc-muted)" }, children: subtitle }) : /* @__PURE__ */ jsx("div", { style: { color: "var(--doc-muted)" }, children: subtitle }) : null,
|
|
493
|
+
facts.length > 0 ? /* @__PURE__ */ jsx(
|
|
494
|
+
"dl",
|
|
495
|
+
{
|
|
496
|
+
className: "grid grid-cols-1 gap-x-8 gap-y-2 border-y py-3 sm:grid-cols-2 print:grid-cols-2",
|
|
497
|
+
style: { borderColor: "var(--doc-border)" },
|
|
498
|
+
children: facts.map((fact) => /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
|
|
499
|
+
/* @__PURE__ */ jsx("dt", { className: "shrink-0", style: { color: "var(--doc-muted)" }, children: fact.label }),
|
|
500
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0 font-medium", children: fact.value })
|
|
501
|
+
] }, fact.label))
|
|
502
|
+
}
|
|
503
|
+
) : null
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
var TEXT8 = {
|
|
507
|
+
ja: {
|
|
508
|
+
title: "\u6CE8\u8A18\u30FB\u51FA\u5178",
|
|
509
|
+
notes: "\u6CE8\u8A18",
|
|
510
|
+
definitions: "\u7528\u8A9E\u306E\u5B9A\u7FA9",
|
|
511
|
+
sources: "\u51FA\u5178",
|
|
512
|
+
asOf: (asOf) => `\uFF08\u30C7\u30FC\u30BF\u6642\u70B9 ${asOf}\uFF09`
|
|
513
|
+
},
|
|
514
|
+
en: {
|
|
515
|
+
title: "Notes and sources",
|
|
516
|
+
notes: "Notes",
|
|
517
|
+
definitions: "Definitions",
|
|
518
|
+
sources: "Sources",
|
|
519
|
+
asOf: (asOf) => ` (data as of ${asOf})`
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
function DocNotesAndSources({ title, headingLevel = 2, notes = [], definitions = [], sources = [] }) {
|
|
523
|
+
const t = TEXT8[uiLanguage(useLocale())];
|
|
524
|
+
if (notes.length === 0 && definitions.length === 0 && sources.length === 0) return null;
|
|
525
|
+
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
526
|
+
const Sub = headingLevel === 3 ? "h4" : "h3";
|
|
527
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "doc-notes-and-sources", children: [
|
|
528
|
+
/* @__PURE__ */ jsx(Heading, { children: title ?? t.title }),
|
|
529
|
+
notes.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "break-inside-avoid", children: [
|
|
530
|
+
/* @__PURE__ */ jsx(Sub, { children: t.notes }),
|
|
531
|
+
/* @__PURE__ */ jsx("ol", { children: notes.map((n, i) => /* @__PURE__ */ jsx("li", { children: n }, i)) })
|
|
532
|
+
] }) : null,
|
|
533
|
+
definitions.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "break-inside-avoid", children: [
|
|
534
|
+
/* @__PURE__ */ jsx(Sub, { children: t.definitions }),
|
|
535
|
+
/* @__PURE__ */ jsx("dl", { className: "m-0", children: definitions.map((d, i) => /* @__PURE__ */ jsxs("div", { className: "break-inside-avoid", children: [
|
|
536
|
+
/* @__PURE__ */ jsx("dt", { className: "font-semibold", children: d.term }),
|
|
537
|
+
/* @__PURE__ */ jsx("dd", { className: "m-0", children: d.description })
|
|
538
|
+
] }, i)) })
|
|
539
|
+
] }) : null,
|
|
540
|
+
sources.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "break-inside-avoid", children: [
|
|
541
|
+
/* @__PURE__ */ jsx(Sub, { children: t.sources }),
|
|
542
|
+
/* @__PURE__ */ jsx("ul", { children: sources.map((s, i) => /* @__PURE__ */ jsxs("li", { children: [
|
|
543
|
+
s.name,
|
|
544
|
+
s.asOf ? /* @__PURE__ */ jsx("span", { style: { color: "var(--doc-muted)" }, children: t.asOf(s.asOf) }) : null
|
|
545
|
+
] }, i)) })
|
|
546
|
+
] }) : null
|
|
547
|
+
] });
|
|
548
|
+
}
|
|
35
549
|
|
|
36
|
-
export { Document };
|
|
550
|
+
export { DocActionItems, DocCallout, DocDataTable, DocExecutiveSummary, DocFigure, DocKeyFindings, DocKpiScorecard, DocNotesAndSources, DocReportHeader, Document };
|
|
37
551
|
//# sourceMappingURL=index.js.map
|
|
38
552
|
//# sourceMappingURL=index.js.map
|