@squadbase/vantage 0.6.2-dev1.5aae04e → 0.6.2-dev1.5c79ef5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/{build-X5NVCQKT.js → build-U7GO26HR.js} +7 -7
  2. package/dist/{build-X5NVCQKT.js.map → build-U7GO26HR.js.map} +1 -1
  3. package/dist/{check-ZBIH422T.js → check-MRVAIHG5.js} +5 -5
  4. package/dist/{check-ZBIH422T.js.map → check-MRVAIHG5.js.map} +1 -1
  5. package/dist/chunk-2IAPIOPS.js +152 -0
  6. package/dist/chunk-2IAPIOPS.js.map +1 -0
  7. package/dist/chunk-3RJEOP3J.js +174 -0
  8. package/dist/chunk-3RJEOP3J.js.map +1 -0
  9. package/dist/{chunk-HKSVYMYJ.js → chunk-77CISBMG.js} +1049 -1387
  10. package/dist/chunk-77CISBMG.js.map +1 -0
  11. package/dist/{chunk-V3LF7BE7.js → chunk-ANZLVSEP.js} +4 -5
  12. package/dist/chunk-ANZLVSEP.js.map +1 -0
  13. package/dist/{chunk-XQUSGIDG.js → chunk-CKWPK4RO.js} +10 -3
  14. package/dist/chunk-CKWPK4RO.js.map +1 -0
  15. package/dist/chunk-EG4PX726.js +678 -0
  16. package/dist/chunk-EG4PX726.js.map +1 -0
  17. package/dist/{chunk-2N72FKLB.js → chunk-NZ5QIIG4.js} +33 -11
  18. package/dist/chunk-NZ5QIIG4.js.map +1 -0
  19. package/dist/{chunk-7DZGJQ3P.js → chunk-PJ4SPXHS.js} +23 -6
  20. package/dist/chunk-PJ4SPXHS.js.map +1 -0
  21. package/dist/{chunk-XPQSTZUU.js → chunk-QNOX7WLZ.js} +5 -4
  22. package/dist/chunk-QNOX7WLZ.js.map +1 -0
  23. package/dist/{chunk-PDOBHMUQ.js → chunk-ROHNXP7J.js} +72 -3
  24. package/dist/chunk-ROHNXP7J.js.map +1 -0
  25. package/dist/{chunk-CEXAQQ5W.js → chunk-S5MDTHH7.js} +180 -18
  26. package/dist/chunk-S5MDTHH7.js.map +1 -0
  27. package/dist/{chunk-2ICNHUG6.js → chunk-SDJTTMLK.js} +64 -7
  28. package/dist/chunk-SDJTTMLK.js.map +1 -0
  29. package/dist/{chunk-WAMZWZJB.js → chunk-SHZM3EXB.js} +19 -8
  30. package/dist/chunk-SHZM3EXB.js.map +1 -0
  31. package/dist/chunk-TRMHNMMZ.js +61 -0
  32. package/dist/chunk-TRMHNMMZ.js.map +1 -0
  33. package/dist/{chunk-JKLLFVEU.js → chunk-UWSQUHX6.js} +4 -99
  34. package/dist/chunk-UWSQUHX6.js.map +1 -0
  35. package/dist/cli.js +6 -6
  36. package/dist/client/index.d.ts +2 -0
  37. package/dist/client/index.js +8 -2
  38. package/dist/client/index.js.map +1 -1
  39. package/dist/components/index.d.ts +57 -273
  40. package/dist/components/index.js +6 -3
  41. package/dist/delta-text-CbrOaW83.d.ts +17 -0
  42. package/dist/{dev-4XEDTELV.js → dev-O42JFQ64.js} +7 -7
  43. package/dist/{dev-4XEDTELV.js.map → dev-O42JFQ64.js.map} +1 -1
  44. package/dist/doc/index.d.ts +215 -2
  45. package/dist/doc/index.js +422 -4
  46. package/dist/doc/index.js.map +1 -1
  47. package/dist/{doctor-5E2VEZPK.js → doctor-YD3XAAOT.js} +5 -5
  48. package/dist/{doctor-5E2VEZPK.js.map → doctor-YD3XAAOT.js.map} +1 -1
  49. package/dist/format-DihQkL1N.d.ts +249 -0
  50. package/dist/query/index.js +2 -2
  51. package/dist/{routes-3SGAFDMC.js → routes-PVKNT777.js} +4 -4
  52. package/dist/{routes-3SGAFDMC.js.map → routes-PVKNT777.js.map} +1 -1
  53. package/dist/slide/index.d.ts +272 -1
  54. package/dist/slide/index.js +1023 -2
  55. package/dist/slide/index.js.map +1 -1
  56. package/dist/table/index.js +9 -6
  57. package/dist/table/index.js.map +1 -1
  58. package/dist/ui/index.d.ts +5 -2
  59. package/dist/ui/index.js +6 -6
  60. package/dist/ui/index.js.map +1 -1
  61. package/dist/{upgrade-JHXZBGQS.js → upgrade-6DT7ADRP.js} +4 -4
  62. package/dist/{upgrade-JHXZBGQS.js.map → upgrade-6DT7ADRP.js.map} +1 -1
  63. package/dist/vite/index.js +3 -3
  64. package/docs/en/agent-skills.md +1 -1
  65. package/docs/en/changelog.md +2 -0
  66. package/docs/en/components.md +13 -2
  67. package/docs/en/doc/delta-text.md +40 -0
  68. package/docs/en/doc/doc-action-items.md +49 -0
  69. package/docs/en/doc/doc-callout.md +38 -0
  70. package/docs/en/doc/doc-data-table.md +60 -0
  71. package/docs/en/doc/doc-executive-summary.md +64 -0
  72. package/docs/en/doc/doc-figure.md +56 -0
  73. package/docs/en/doc/doc-key-findings.md +61 -0
  74. package/docs/en/doc/doc-kpi-scorecard.md +80 -0
  75. package/docs/en/doc/doc-notes-and-sources.md +43 -0
  76. package/docs/en/doc/doc-report-header.md +46 -0
  77. package/docs/en/pages-and-metadata.md +15 -0
  78. package/docs/en/parts/area-chart.md +99 -0
  79. package/docs/en/parts/bar-chart.md +91 -0
  80. package/docs/en/parts/bar-list.md +50 -0
  81. package/docs/en/parts/category-bar.md +37 -0
  82. package/docs/en/parts/chart-frame.md +39 -0
  83. package/docs/en/parts/delta.md +4 -3
  84. package/docs/en/parts/donut-chart.md +72 -0
  85. package/docs/en/parts/funnel-steps.md +2 -1
  86. package/docs/en/parts/heatmap.md +53 -0
  87. package/docs/en/parts/kpi-card.md +2 -1
  88. package/docs/en/parts/legend.md +35 -0
  89. package/docs/en/parts/line-chart.md +94 -0
  90. package/docs/en/parts/progress-circle.md +33 -0
  91. package/docs/en/parts/sample-data.md +39 -0
  92. package/docs/en/parts/scatter-chart.md +56 -0
  93. package/docs/en/parts/tracker.md +36 -0
  94. package/docs/en/parts/updated-at.md +30 -0
  95. package/docs/en/parts/waterfall-chart.md +56 -0
  96. package/docs/en/slide/slide-chart-full.md +48 -0
  97. package/docs/en/slide/slide-chart-insight.md +52 -0
  98. package/docs/en/slide/slide-columns.md +46 -0
  99. package/docs/en/slide/slide-comparison.md +68 -0
  100. package/docs/en/slide/slide-cover.md +39 -0
  101. package/docs/en/slide/slide-exec-summary.md +47 -0
  102. package/docs/en/slide/slide-heading.md +38 -0
  103. package/docs/en/slide/slide-kpi-grid.md +55 -0
  104. package/docs/en/slide/slide-kpi-hero.md +58 -0
  105. package/docs/en/slide/slide-next-actions.md +49 -0
  106. package/docs/en/slide/slide-scorecard-table.md +54 -0
  107. package/docs/en/slide/slide-section.md +44 -0
  108. package/docs/en/slide/slide-source-line.md +34 -0
  109. package/docs/en/ui/alert-dialog.md +42 -0
  110. package/docs/en/ui/avatar.md +31 -0
  111. package/docs/en/ui/combobox.md +74 -0
  112. package/docs/en/ui/drawer.md +41 -0
  113. package/docs/en/ui/empty.md +1 -1
  114. package/docs/en/ui/error-state.md +4 -3
  115. package/docs/en/ui/field.md +42 -0
  116. package/docs/en/ui/hover-card.md +21 -0
  117. package/docs/en/ui/kbd.md +17 -0
  118. package/docs/en/ui/loading.md +1 -1
  119. package/docs/en/ui/pagination.md +36 -0
  120. package/docs/en/ui/radio-group.md +21 -0
  121. package/docs/en/ui/toast.md +44 -0
  122. package/docs/en/ui/toggle-group.md +4 -3
  123. package/docs/index.json +857 -77
  124. package/docs/ja/agent-skills.md +1 -1
  125. package/docs/ja/changelog.md +2 -0
  126. package/docs/ja/components.md +12 -1
  127. package/docs/ja/doc/delta-text.md +40 -0
  128. package/docs/ja/doc/doc-action-items.md +49 -0
  129. package/docs/ja/doc/doc-callout.md +38 -0
  130. package/docs/ja/doc/doc-data-table.md +60 -0
  131. package/docs/ja/doc/doc-executive-summary.md +64 -0
  132. package/docs/ja/doc/doc-figure.md +56 -0
  133. package/docs/ja/doc/doc-key-findings.md +61 -0
  134. package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
  135. package/docs/ja/doc/doc-notes-and-sources.md +43 -0
  136. package/docs/ja/doc/doc-report-header.md +46 -0
  137. package/docs/ja/page-types/slide.md +1 -0
  138. package/docs/ja/pages-and-metadata.md +15 -0
  139. package/docs/ja/parts/area-chart.md +49 -25
  140. package/docs/ja/parts/bar-chart.md +50 -24
  141. package/docs/ja/parts/bar-list.md +31 -8
  142. package/docs/ja/parts/chart-frame.md +36 -0
  143. package/docs/ja/parts/delta.md +5 -4
  144. package/docs/ja/parts/donut-chart.md +45 -26
  145. package/docs/ja/parts/funnel-steps.md +27 -8
  146. package/docs/ja/parts/heatmap.md +45 -0
  147. package/docs/ja/parts/kpi-card.md +2 -1
  148. package/docs/ja/parts/legend.md +36 -0
  149. package/docs/ja/parts/line-chart.md +48 -22
  150. package/docs/ja/parts/sample-data.md +61 -0
  151. package/docs/ja/parts/scatter-chart.md +69 -0
  152. package/docs/ja/parts/updated-at.md +27 -0
  153. package/docs/ja/parts/waterfall-chart.md +61 -0
  154. package/docs/ja/slide/slide-chart-full.md +48 -0
  155. package/docs/ja/slide/slide-chart-insight.md +52 -0
  156. package/docs/ja/slide/slide-columns.md +46 -0
  157. package/docs/ja/slide/slide-comparison.md +68 -0
  158. package/docs/ja/slide/slide-cover.md +39 -0
  159. package/docs/ja/slide/slide-exec-summary.md +47 -0
  160. package/docs/ja/slide/slide-heading.md +38 -0
  161. package/docs/ja/slide/slide-kpi-grid.md +55 -0
  162. package/docs/ja/slide/slide-kpi-hero.md +58 -0
  163. package/docs/ja/slide/slide-next-actions.md +49 -0
  164. package/docs/ja/slide/slide-scorecard-table.md +54 -0
  165. package/docs/ja/slide/slide-section.md +44 -0
  166. package/docs/ja/slide/slide-source-line.md +34 -0
  167. package/docs/ja/ui/empty.md +1 -1
  168. package/docs/ja/ui/error-state.md +4 -3
  169. package/docs/ja/ui/loading.md +1 -1
  170. package/docs/ja/ui/toggle-group.md +4 -3
  171. package/package.json +2 -2
  172. package/registry/ui/app-shell.tsx +138 -1
  173. package/registry/ui/area-chart.tsx +389 -104
  174. package/registry/ui/attention-list.tsx +177 -15
  175. package/registry/ui/bar-chart.tsx +386 -104
  176. package/registry/ui/bar-list.tsx +376 -94
  177. package/registry/ui/box-plot-chart.tsx +450 -116
  178. package/registry/ui/category-bar.tsx +292 -57
  179. package/registry/ui/chart-frame.tsx +301 -63
  180. package/registry/ui/data-table.tsx +229 -37
  181. package/registry/ui/date-range-picker.tsx +190 -36
  182. package/registry/ui/delta.tsx +181 -19
  183. package/registry/ui/donut-chart.tsx +385 -103
  184. package/registry/ui/echart.tsx +313 -58
  185. package/registry/ui/filter-bar.tsx +179 -20
  186. package/registry/ui/funnel-steps.tsx +354 -80
  187. package/registry/ui/heatmap.tsx +338 -71
  188. package/registry/ui/histogram-chart.tsx +440 -116
  189. package/registry/ui/kpi-card.tsx +254 -48
  190. package/registry/ui/legend.tsx +374 -93
  191. package/registry/ui/line-chart.tsx +389 -104
  192. package/registry/ui/multi-select.tsx +159 -9
  193. package/registry/ui/page-shell.tsx +148 -10
  194. package/registry/ui/paired-chart.tsx +394 -109
  195. package/registry/ui/progress-circle.tsx +205 -39
  196. package/registry/ui/sample-data.tsx +154 -10
  197. package/registry/ui/scatter-chart.tsx +436 -119
  198. package/registry/ui/searchable-select.tsx +145 -7
  199. package/registry/ui/slider.tsx +1 -1
  200. package/registry/ui/states.tsx +170 -13
  201. package/registry/ui/status-badge.tsx +201 -36
  202. package/registry/ui/tooltip.tsx +6 -2
  203. package/registry/ui/tracker.tsx +214 -42
  204. package/registry/ui/trend-indicator.tsx +151 -8
  205. package/registry/ui/updated-at.tsx +170 -16
  206. package/registry/ui/waterfall-chart.tsx +460 -121
  207. package/skills/vantage-design/SKILL.md +54 -54
  208. package/skills/vantage-design/references/extract.md +26 -27
  209. package/skills/vantage-design/references/format.md +12 -172
  210. package/skills/vantage-design/references/presets.md +50 -110
  211. package/skills/vantage-pitfalls/SKILL.md +5 -0
  212. package/skills/vantage-slide/SKILL.md +54 -36
  213. package/templates/AGENTS.md +32 -16
  214. package/templates/agents/doc.md +48 -0
  215. package/templates/agents/page.md +23 -2
  216. package/templates/agents/slide.md +77 -3
  217. package/theme.css +23 -19
  218. package/dist/chunk-2ICNHUG6.js.map +0 -1
  219. package/dist/chunk-2N72FKLB.js.map +0 -1
  220. package/dist/chunk-7DZGJQ3P.js.map +0 -1
  221. package/dist/chunk-CEXAQQ5W.js.map +0 -1
  222. package/dist/chunk-HKSVYMYJ.js.map +0 -1
  223. package/dist/chunk-JKLLFVEU.js.map +0 -1
  224. package/dist/chunk-PDOBHMUQ.js.map +0 -1
  225. package/dist/chunk-V3LF7BE7.js.map +0 -1
  226. package/dist/chunk-WAMZWZJB.js.map +0 -1
  227. package/dist/chunk-XPQSTZUU.js.map +0 -1
  228. package/dist/chunk-XQUSGIDG.js.map +0 -1
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
- import { HTMLAttributes } from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { V as ValueFormat } from '../format-DihQkL1N.js';
4
+ export { D as DeltaText, a as DeltaTextProps } from '../delta-text-CbrOaW83.js';
3
5
 
4
6
  /**
5
7
  * Per-document token overrides. Anything left out falls through to `--doc-*`
@@ -40,4 +42,215 @@ interface DocumentProps extends HTMLAttributes<HTMLElement> {
40
42
  */
41
43
  declare const Document: React.ForwardRefExoticComponent<DocumentProps & React.RefAttributes<HTMLElement>>;
42
44
 
43
- export { Document, type DocumentProps, type DocumentTheme };
45
+ type DocActionPriority = "high" | "medium" | "low";
46
+ interface DocActionItem {
47
+ action: ReactNode;
48
+ owner?: string;
49
+ /** Due date as written, e.g. "2026-11-15" or "11 月末". */
50
+ due?: string;
51
+ /** What we expect to change, e.g. "解約率 −0.5pt". */
52
+ impact?: string;
53
+ priority?: DocActionPriority;
54
+ }
55
+ interface DocActionItemsProps {
56
+ /** Heading text. Default "Recommended actions" (ja: "推奨する対応"). */
57
+ title?: string;
58
+ /** `2` directly under the document, `3` inside another section. Default 2. */
59
+ headingLevel?: 2 | 3;
60
+ items: DocActionItem[];
61
+ variant?: "table" | "asks";
62
+ }
63
+ declare function DocActionItems({ title, headingLevel, items, variant }: DocActionItemsProps): React.JSX.Element;
64
+
65
+ type DocCalloutKind = "note" | "insight" | "warning" | "decision";
66
+ interface DocCalloutProps {
67
+ kind?: DocCalloutKind;
68
+ /** Heading of the box, one short line. Default: the kind's word. */
69
+ title?: string;
70
+ children: ReactNode;
71
+ }
72
+ declare function DocCallout({ kind, title, children }: DocCalloutProps): React.JSX.Element;
73
+
74
+ type DocTableCell = string | number | null | undefined;
75
+ type DocTableRow = Record<string, DocTableCell>;
76
+ interface DocTableColumn {
77
+ key: string;
78
+ label: string;
79
+ /** Format of a numeric column. Without it, numbers use a plain thousands format. */
80
+ format?: ValueFormat;
81
+ /** Default: right for a column of numbers, left otherwise. */
82
+ align?: "left" | "right" | "center";
83
+ }
84
+ interface DocDataTableProps {
85
+ /** Table title, as a caption above the table. */
86
+ title?: string;
87
+ /** Unit or scale, e.g. "単位: 百万円". */
88
+ unit?: string;
89
+ columns: DocTableColumn[];
90
+ rows: DocTableRow[];
91
+ /** The total row, keyed like `rows`. */
92
+ total?: DocTableRow;
93
+ /** Row indexes to set in semibold. */
94
+ highlightRows?: number[];
95
+ footnotes?: {
96
+ mark: string;
97
+ text: string;
98
+ }[];
99
+ source?: string;
100
+ /** When the data was taken: a date only, e.g. "2026-10-03". "Data as of" (ja: "データ時点") is added here. */
101
+ asOf?: string;
102
+ }
103
+ declare function DocDataTable({ title, unit, columns, rows, total, highlightRows, footnotes, source, asOf }: DocDataTableProps): React.JSX.Element;
104
+
105
+ interface DocSummaryMetric {
106
+ label: string;
107
+ value: number | null;
108
+ format?: ValueFormat;
109
+ /** Overrides the shown value (e.g. "約 5,400 万円"). */
110
+ display?: string;
111
+ /** The change from the comparison; direction comes from its sign. Omit for no comparison. */
112
+ delta?: {
113
+ value: number;
114
+ format?: ValueFormat;
115
+ };
116
+ /** Name of the comparison, e.g. "前月比". Default "vs. prior period" (ja: "前期比"). */
117
+ comparisonLabel?: string;
118
+ /** Which way is good. Default `"up"`. */
119
+ betterWhen?: "up" | "down";
120
+ }
121
+ interface DocExecutiveSummaryProps {
122
+ /** Heading text. Default "Executive summary" (ja: "要旨"). */
123
+ title?: string;
124
+ /** `2` directly under the document, `3` inside another section. Default 2. */
125
+ headingLevel?: 2 | 3;
126
+ /** The verdict in one sentence. */
127
+ conclusion: ReactNode;
128
+ /** 3–5 supporting points, most important first. */
129
+ points: ReactNode[];
130
+ /** Up to 3 headline numbers; any beyond are ignored. */
131
+ metrics?: DocSummaryMetric[];
132
+ }
133
+ declare function DocExecutiveSummary({ title, headingLevel, conclusion, points, metrics, }: DocExecutiveSummaryProps): React.JSX.Element;
134
+
135
+ interface DocFigureProps {
136
+ /** The finding, as a sentence. */
137
+ title: string;
138
+ /** Unit or scale, e.g. "単位: 百万円". */
139
+ unit?: string;
140
+ /** Figure number; shown as "Figure N" (ja: "図 N") in the caption. */
141
+ number?: number;
142
+ /** Where the data comes from. */
143
+ source?: string;
144
+ /** When the data was taken: a date only, e.g. "2026-10-03". */
145
+ asOf?: string;
146
+ /** Footnotes, one per line. */
147
+ notes?: string[];
148
+ /** The chart. */
149
+ children: ReactNode;
150
+ }
151
+ declare function DocFigure({ title, unit, number, source, asOf, notes, children }: DocFigureProps): React.JSX.Element;
152
+
153
+ interface DocFindingMetric {
154
+ label: string;
155
+ value: number | null;
156
+ format?: ValueFormat;
157
+ /** Overrides the shown value. */
158
+ display?: string;
159
+ /** The change from the comparison; direction comes from its sign. */
160
+ delta?: {
161
+ value: number;
162
+ format?: ValueFormat;
163
+ };
164
+ /** Name of the comparison, e.g. "前月比". Default "vs. prior period" (ja: "前期比"). */
165
+ comparisonLabel?: string;
166
+ /** Which way is good. Default `"up"`. */
167
+ betterWhen?: "up" | "down";
168
+ }
169
+ interface DocFinding {
170
+ /** The conclusion, as a sentence. */
171
+ headline: string;
172
+ evidence: ReactNode;
173
+ metric?: DocFindingMetric;
174
+ }
175
+ interface DocKeyFindingsProps {
176
+ /** Heading text. Default "Key findings" (ja: "主要な発見"). */
177
+ title?: string;
178
+ /** `2` directly under the document, `3` inside another section. Default 2. */
179
+ headingLevel?: 2 | 3;
180
+ /** 3–5 findings, most important first. */
181
+ findings: DocFinding[];
182
+ }
183
+ declare function DocKeyFindings({ title, headingLevel, findings }: DocKeyFindingsProps): React.JSX.Element;
184
+
185
+ interface DocScorecardMetric {
186
+ label: string;
187
+ value: number | null;
188
+ format?: ValueFormat;
189
+ /** Overrides the shown value. */
190
+ display?: string;
191
+ /** The change from the comparison; direction comes from its sign. */
192
+ delta?: {
193
+ value: number;
194
+ format?: ValueFormat;
195
+ };
196
+ /** Name of the comparison, e.g. "前年同期比". Default "vs. prior period" (ja: "前期比"). */
197
+ comparisonLabel?: string;
198
+ /** Which way is good. Default `"up"`. */
199
+ betterWhen?: "up" | "down";
200
+ /** The target for the period, in the same `format` as `value`. */
201
+ target?: number;
202
+ /** One series over time, oldest first; the last one is the current value. */
203
+ trend?: {
204
+ x: string;
205
+ y: number;
206
+ }[];
207
+ }
208
+ interface DocKpiScorecardProps {
209
+ /** Heading text. Default "Key metrics" (ja: "主要指標"). */
210
+ title?: string;
211
+ /** `2` directly under the document, `3` inside another section. Default 2. */
212
+ headingLevel?: 2 | 3;
213
+ metrics: DocScorecardMetric[];
214
+ variant?: "table" | "grid";
215
+ /** When the numbers were taken: a date only, e.g. "2026-10-03". "Data as of" (ja: "データ時点") is added here. */
216
+ asOf?: string;
217
+ source?: string;
218
+ }
219
+ declare function DocKpiScorecard({ title, headingLevel, metrics, variant, asOf, source, }: DocKpiScorecardProps): React.JSX.Element;
220
+
221
+ interface DocReportHeaderProps {
222
+ /** The document title (h1). State the subject and the period, not a slogan. */
223
+ title: string;
224
+ /** One line under the title, e.g. who the report is for. */
225
+ subtitle?: ReactNode;
226
+ /** The period the numbers cover, e.g. "2026 年 9 月" or "2026-07-01 〜 2026-09-30". */
227
+ period?: string;
228
+ /** When the data was taken: a date only, e.g. "2026-10-03". Shown under "Data as of" (ja: "データ時点"). */
229
+ asOf?: string;
230
+ author?: string;
231
+ /** Where the numbers come from, e.g. "受注管理システム、会計システム". */
232
+ source?: string;
233
+ }
234
+ declare function DocReportHeader({ title, subtitle, period, asOf, author, source }: DocReportHeaderProps): React.JSX.Element;
235
+
236
+ interface DocDefinition {
237
+ term: string;
238
+ description: ReactNode;
239
+ }
240
+ interface DocSource {
241
+ name: string;
242
+ /** Data as-of date, e.g. "2026-10-03". */
243
+ asOf?: string;
244
+ }
245
+ interface DocNotesAndSourcesProps {
246
+ /** Heading text. Default "Notes and sources" (ja: "注記・出典"). */
247
+ title?: string;
248
+ /** `2` directly under the document, `3` inside another section. Default 2. */
249
+ headingLevel?: 2 | 3;
250
+ notes?: ReactNode[];
251
+ definitions?: DocDefinition[];
252
+ sources?: DocSource[];
253
+ }
254
+ declare function DocNotesAndSources({ title, headingLevel, notes, definitions, sources }: DocNotesAndSourcesProps): React.JSX.Element | null;
255
+
256
+ export { type DocActionItem, DocActionItems, type DocActionItemsProps, type DocActionPriority, DocCallout, type DocCalloutKind, type DocCalloutProps, DocDataTable, type DocDataTableProps, type DocDefinition, DocExecutiveSummary, type DocExecutiveSummaryProps, DocFigure, type DocFigureProps, type DocFinding, type DocFindingMetric, DocKeyFindings, type DocKeyFindingsProps, DocKpiScorecard, type DocKpiScorecardProps, DocNotesAndSources, type DocNotesAndSourcesProps, DocReportHeader, type DocReportHeaderProps, type DocScorecardMetric, type DocSource, type DocSummaryMetric, type DocTableCell, type DocTableColumn, type DocTableRow, Document, type DocumentProps, type DocumentTheme };
package/dist/doc/index.js CHANGED
@@ -1,6 +1,10 @@
1
- import { Button } from '../chunk-PDOBHMUQ.js';
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';
2
6
  import '../chunk-U736PVHY.js';
3
- import { forwardRef, useEffect } from 'react';
7
+ import { forwardRef, useEffect, useId } from 'react';
4
8
  import { PrinterIcon } from 'lucide-react';
5
9
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
10
 
@@ -105,7 +109,14 @@ var Document = forwardRef(function Document2({ theme, style, ...props }, ref) {
105
109
  {
106
110
  ref,
107
111
  "data-slot": "document",
108
- style: themeVars || style ? { ...themeVars, ...style } : void 0,
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
+ },
109
120
  ...props
110
121
  }
111
122
  ),
@@ -128,7 +139,414 @@ var Document = forwardRef(function Document2({ theme, style, ...props }, ref) {
128
139
  ] });
129
140
  });
130
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",
206
+ {
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
+ ]
216
+ }
217
+ );
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
+ }
131
549
 
132
- export { Document };
550
+ export { DocActionItems, DocCallout, DocDataTable, DocExecutiveSummary, DocFigure, DocKeyFindings, DocKpiScorecard, DocNotesAndSources, DocReportHeader, Document };
133
551
  //# sourceMappingURL=index.js.map
134
552
  //# sourceMappingURL=index.js.map