@stealthscale/component-charts 0.2.2 → 0.2.3

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 (123) hide show
  1. package/dist/cyclonedx/bom.json +1 -1
  2. package/dist/index.js +1 -14710
  3. package/dist/pages/area-chart/area-chart.js +1151 -0
  4. package/dist/pages/area-chart/area-chart.props.js +3 -0
  5. package/dist/pages/bar-chart/bar-chart.js +990 -0
  6. package/dist/pages/bar-chart/bar-chart.props.js +3 -0
  7. package/dist/pages/box-plot/box-plot.js +1585 -0
  8. package/dist/pages/box-plot/box-plot.props.js +3 -0
  9. package/dist/pages/bubble-chart/bubble-chart.js +938 -0
  10. package/dist/pages/bubble-chart/bubble-chart.props.js +3 -0
  11. package/dist/pages/burndown-chart/burndown-chart.js +805 -0
  12. package/dist/pages/burndown-chart/burndown-chart.props.js +3 -0
  13. package/dist/pages/candlestick-chart/candlestick-chart.js +853 -0
  14. package/dist/pages/candlestick-chart/candlestick-chart.props.js +3 -0
  15. package/dist/pages/chart/chart.js +1190 -0
  16. package/dist/pages/chart/chart.props.js +3 -0
  17. package/dist/pages/chord-diagram/chord-diagram.js +891 -0
  18. package/dist/pages/chord-diagram/chord-diagram.props.js +3 -0
  19. package/dist/pages/combo-chart/combo-chart.js +873 -0
  20. package/dist/pages/combo-chart/combo-chart.props.js +3 -0
  21. package/dist/pages/distribution-chart/distribution-chart.js +1066 -0
  22. package/dist/pages/distribution-chart/distribution-chart.props.js +3 -0
  23. package/dist/pages/donut-chart/donut-chart.js +726 -0
  24. package/dist/pages/donut-chart/donut-chart.props.js +3 -0
  25. package/dist/pages/funnel-chart/funnel-chart.js +1094 -0
  26. package/dist/pages/funnel-chart/funnel-chart.props.js +3 -0
  27. package/dist/pages/gauge-chart/gauge-chart.js +767 -0
  28. package/dist/pages/gauge-chart/gauge-chart.props.js +3 -0
  29. package/dist/pages/heatmap/heatmap.js +1967 -0
  30. package/dist/pages/heatmap/heatmap.props.js +3 -0
  31. package/dist/pages/histogram-chart/histogram-chart.js +768 -0
  32. package/dist/pages/histogram-chart/histogram-chart.props.js +3 -0
  33. package/dist/pages/horizontal-bar-chart/horizontal-bar-chart.js +701 -0
  34. package/dist/pages/horizontal-bar-chart/horizontal-bar-chart.props.js +3 -0
  35. package/dist/pages/line-chart/line-chart.js +1882 -0
  36. package/dist/pages/line-chart/line-chart.props.js +3 -0
  37. package/dist/pages/pages.json +393 -0
  38. package/dist/pages/pareto-chart/pareto-chart.js +669 -0
  39. package/dist/pages/pareto-chart/pareto-chart.props.js +3 -0
  40. package/dist/pages/percent-stacked-bar/percent-stacked-bar.js +662 -0
  41. package/dist/pages/percent-stacked-bar/percent-stacked-bar.props.js +3 -0
  42. package/dist/pages/pie-chart/pie-chart.js +1007 -0
  43. package/dist/pages/pie-chart/pie-chart.props.js +3 -0
  44. package/dist/pages/polar-area-chart/polar-area-chart.js +812 -0
  45. package/dist/pages/polar-area-chart/polar-area-chart.props.js +3 -0
  46. package/dist/pages/radar-chart/radar-chart.js +1101 -0
  47. package/dist/pages/radar-chart/radar-chart.props.js +3 -0
  48. package/dist/pages/radial-bar-chart/radial-bar-chart.js +766 -0
  49. package/dist/pages/radial-bar-chart/radial-bar-chart.props.js +3 -0
  50. package/dist/pages/range-chart/range-chart.js +914 -0
  51. package/dist/pages/range-chart/range-chart.props.js +3 -0
  52. package/dist/pages/regression-overlay/regression-overlay.js +494 -0
  53. package/dist/pages/regression-overlay/regression-overlay.props.js +3 -0
  54. package/dist/pages/sankey-chart/sankey-chart.js +700 -0
  55. package/dist/pages/sankey-chart/sankey-chart.props.js +3 -0
  56. package/dist/pages/scatter-plot/scatter-plot.js +1248 -0
  57. package/dist/pages/scatter-plot/scatter-plot.props.js +3 -0
  58. package/dist/pages/sparkbar/sparkbar.js +629 -0
  59. package/dist/pages/sparkbar/sparkbar.props.js +3 -0
  60. package/dist/pages/sparkline/sparkline.js +960 -0
  61. package/dist/pages/sparkline/sparkline.props.js +3 -0
  62. package/dist/pages/spend-5xQ76WSj.js +185 -0
  63. package/dist/pages/stacked-area-chart/stacked-area-chart.js +912 -0
  64. package/dist/pages/stacked-area-chart/stacked-area-chart.props.js +3 -0
  65. package/dist/pages/stacked-bar-chart/stacked-bar-chart.js +722 -0
  66. package/dist/pages/stacked-bar-chart/stacked-bar-chart.props.js +3 -0
  67. package/dist/pages/step-line-chart/step-line-chart.js +573 -0
  68. package/dist/pages/step-line-chart/step-line-chart.props.js +3 -0
  69. package/dist/pages/stream-graph/stream-graph.js +1662 -0
  70. package/dist/pages/stream-graph/stream-graph.props.js +3 -0
  71. package/dist/pages/sunburst-chart/sunburst-chart.js +1051 -0
  72. package/dist/pages/sunburst-chart/sunburst-chart.props.js +3 -0
  73. package/dist/pages/timeline-chart/timeline-chart.js +1124 -0
  74. package/dist/pages/timeline-chart/timeline-chart.props.js +3 -0
  75. package/dist/pages/treemap-chart/treemap-chart.js +904 -0
  76. package/dist/pages/treemap-chart/treemap-chart.props.js +3 -0
  77. package/dist/pages/violin-plot/violin-plot.js +1303 -0
  78. package/dist/pages/violin-plot/violin-plot.props.js +3 -0
  79. package/dist/pages/visitors-oFFVcbIZ.js +248 -0
  80. package/dist/pages/waterfall-chart/waterfall-chart.js +1195 -0
  81. package/dist/pages/waterfall-chart/waterfall-chart.props.js +3 -0
  82. package/dist/shared-DVZJ2nST.js +14711 -0
  83. package/dist/theme.js +1 -1
  84. package/locales/en/specimen/area-chart.json +56 -0
  85. package/locales/en/specimen/bar-chart.json +56 -0
  86. package/locales/en/specimen/box-plot.json +65 -0
  87. package/locales/en/specimen/bubble-chart.json +47 -0
  88. package/locales/en/specimen/burndown-chart.json +46 -0
  89. package/locales/en/specimen/candlestick-chart.json +42 -0
  90. package/locales/en/specimen/chart.json +53 -0
  91. package/locales/en/specimen/chord-diagram.json +69 -0
  92. package/locales/en/specimen/combo-chart.json +41 -0
  93. package/locales/en/specimen/distribution-chart.json +47 -0
  94. package/locales/en/specimen/donut-chart.json +63 -0
  95. package/locales/en/specimen/funnel-chart.json +84 -0
  96. package/locales/en/specimen/gauge-chart.json +68 -0
  97. package/locales/en/specimen/heatmap.json +187 -0
  98. package/locales/en/specimen/histogram-chart.json +48 -0
  99. package/locales/en/specimen/horizontal-bar-chart.json +54 -0
  100. package/locales/en/specimen/line-chart.json +106 -0
  101. package/locales/en/specimen/pareto-chart.json +43 -0
  102. package/locales/en/specimen/percent-stacked-bar.json +37 -0
  103. package/locales/en/specimen/pie-chart.json +80 -0
  104. package/locales/en/specimen/polar-area-chart.json +90 -0
  105. package/locales/en/specimen/radar-chart.json +82 -0
  106. package/locales/en/specimen/radial-bar-chart.json +62 -0
  107. package/locales/en/specimen/range-chart.json +42 -0
  108. package/locales/en/specimen/regression-overlay.json +36 -0
  109. package/locales/en/specimen/sankey-chart.json +89 -0
  110. package/locales/en/specimen/scatter-plot.json +88 -0
  111. package/locales/en/specimen/sparkbar.json +51 -0
  112. package/locales/en/specimen/sparkline.json +70 -0
  113. package/locales/en/specimen/stacked-area-chart.json +44 -0
  114. package/locales/en/specimen/stacked-bar-chart.json +34 -0
  115. package/locales/en/specimen/step-line-chart.json +33 -0
  116. package/locales/en/specimen/stream-graph.json +54 -0
  117. package/locales/en/specimen/sunburst-chart.json +110 -0
  118. package/locales/en/specimen/timeline-chart.json +77 -0
  119. package/locales/en/specimen/treemap-chart.json +107 -0
  120. package/locales/en/specimen/violin-plot.json +54 -0
  121. package/locales/en/specimen/waterfall-chart.json +71 -0
  122. package/package.json +8 -7
  123. /package/dist/{recipe-BbGw00ut.js → recipes-BbGw00ut.js} +0 -0
@@ -0,0 +1,912 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { _ as StackedAreaChart } from "../../shared-DVZJ2nST.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Room, specimen, useWords } from "@stealthscale/specimen";
7
+ import { RotateCcwIcon } from "lucide-react";
8
+ import { Button } from "@stealthscale/component-actions";
9
+ import { Stack } from "@stealthscale/component-layout";
10
+ //#region src/stacked-area-chart/examples/launch.example.tsx
11
+ var launch_example_exports = /* @__PURE__ */ __exportAll({
12
+ Launch: () => Launch,
13
+ source: () => source$4
14
+ });
15
+ const DAYS$3 = [
16
+ [
17
+ 4200,
18
+ 2600,
19
+ 900
20
+ ],
21
+ [
22
+ 4600,
23
+ 2900,
24
+ 1100
25
+ ],
26
+ [
27
+ 4400,
28
+ 3100,
29
+ 1400
30
+ ],
31
+ [
32
+ 5100,
33
+ 3300,
34
+ 2600
35
+ ],
36
+ [
37
+ 5300,
38
+ 3600,
39
+ 2100
40
+ ],
41
+ [
42
+ 3100,
43
+ 2200,
44
+ 800
45
+ ],
46
+ [
47
+ 2900,
48
+ 2e3,
49
+ 700
50
+ ]
51
+ ].map(([direct, search, referral], index) => ({
52
+ day: `2026-09-${String(21 + index)}`,
53
+ direct,
54
+ referral,
55
+ search
56
+ }));
57
+ function Launch() {
58
+ const $ = c(29);
59
+ const { t } = useWords("stacked-area-chart");
60
+ let t0;
61
+ if ($[0] !== t) {
62
+ t0 = t("launch.caption");
63
+ $[0] = t;
64
+ $[1] = t0;
65
+ } else t0 = $[1];
66
+ let t1;
67
+ if ($[2] !== t) {
68
+ t1 = t("traffic.label");
69
+ $[2] = t;
70
+ $[3] = t1;
71
+ } else t1 = $[3];
72
+ let t2;
73
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
74
+ t2 = {
75
+ timeZone: "UTC",
76
+ weekday: "short"
77
+ };
78
+ $[4] = t2;
79
+ } else t2 = $[4];
80
+ let t3;
81
+ if ($[5] !== t) {
82
+ t3 = t("series");
83
+ $[5] = t;
84
+ $[6] = t3;
85
+ } else t3 = $[6];
86
+ let t4;
87
+ if ($[7] !== t) {
88
+ t4 = t("traffic.direct");
89
+ $[7] = t;
90
+ $[8] = t4;
91
+ } else t4 = $[8];
92
+ let t5;
93
+ if ($[9] !== t4) {
94
+ t5 = {
95
+ key: "direct",
96
+ label: t4
97
+ };
98
+ $[9] = t4;
99
+ $[10] = t5;
100
+ } else t5 = $[10];
101
+ let t6;
102
+ if ($[11] !== t) {
103
+ t6 = t("traffic.search");
104
+ $[11] = t;
105
+ $[12] = t6;
106
+ } else t6 = $[12];
107
+ let t7;
108
+ if ($[13] !== t6) {
109
+ t7 = {
110
+ key: "search",
111
+ label: t6
112
+ };
113
+ $[13] = t6;
114
+ $[14] = t7;
115
+ } else t7 = $[14];
116
+ let t8;
117
+ if ($[15] !== t) {
118
+ t8 = t("traffic.referral");
119
+ $[15] = t;
120
+ $[16] = t8;
121
+ } else t8 = $[16];
122
+ let t9;
123
+ if ($[17] !== t8) {
124
+ t9 = {
125
+ key: "referral",
126
+ label: t8
127
+ };
128
+ $[17] = t8;
129
+ $[18] = t9;
130
+ } else t9 = $[18];
131
+ let t10;
132
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
133
+ t10 = [
134
+ t5,
135
+ t7,
136
+ t9
137
+ ];
138
+ $[19] = t5;
139
+ $[20] = t7;
140
+ $[21] = t9;
141
+ $[22] = t10;
142
+ } else t10 = $[22];
143
+ let t11;
144
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
145
+ t11 = { notation: "compact" };
146
+ $[23] = t11;
147
+ } else t11 = $[23];
148
+ let t12;
149
+ if ($[24] !== t0 || $[25] !== t1 || $[26] !== t10 || $[27] !== t3) {
150
+ t12 = /* @__PURE__ */ jsx(StackedAreaChart, {
151
+ caption: t0,
152
+ categoryKey: "day",
153
+ data: DAYS$3,
154
+ defaultIndex: 3,
155
+ label: t1,
156
+ labelOptions: t2,
157
+ legendLabel: t3,
158
+ series: t10,
159
+ valueOptions: t11
160
+ });
161
+ $[24] = t0;
162
+ $[25] = t1;
163
+ $[26] = t10;
164
+ $[27] = t3;
165
+ $[28] = t12;
166
+ } else t12 = $[28];
167
+ return t12;
168
+ }
169
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedAreaChart } from \"@stealthscale/component-charts\";\n\nconst DAYS = [\n [4200, 2600, 900],\n [4600, 2900, 1100],\n [4400, 3100, 1400],\n [5100, 3300, 2600],\n [5300, 3600, 2100],\n [3100, 2200, 800],\n [2900, 2000, 700],\n].map(([direct, search, referral], index) => ({\n day: `2026-09-${String(21 + index)}`,\n direct,\n referral,\n search,\n}));\n\nexport function Launch(): ReactElement {\n const { t } = useWords(\"stacked-area-chart\");\n\n return (\n <StackedAreaChart\n caption={t(\"launch.caption\")}\n categoryKey=\"day\"\n data={DAYS}\n defaultIndex={3}\n label={t(\"traffic.label\")}\n labelOptions={{ timeZone: \"UTC\", weekday: \"short\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"direct\", label: t(\"traffic.direct\") },\n { key: \"search\", label: t(\"traffic.search\") },\n { key: \"referral\", label: t(\"traffic.referral\") },\n ]}\n valueOptions={{ notation: \"compact\" }}\n />\n );\n}\n";
170
+ //#endregion
171
+ //#region src/stacked-area-chart/examples/replay.example.tsx
172
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
173
+ Replay: () => Replay,
174
+ source: () => source$3
175
+ });
176
+ const DAYS$2 = [
177
+ [
178
+ 4200,
179
+ 2600,
180
+ 900
181
+ ],
182
+ [
183
+ 4600,
184
+ 2900,
185
+ 1100
186
+ ],
187
+ [
188
+ 4400,
189
+ 3100,
190
+ 1400
191
+ ],
192
+ [
193
+ 5100,
194
+ 3300,
195
+ 2600
196
+ ],
197
+ [
198
+ 5300,
199
+ 3600,
200
+ 2100
201
+ ],
202
+ [
203
+ 3100,
204
+ 2200,
205
+ 800
206
+ ],
207
+ [
208
+ 2900,
209
+ 2e3,
210
+ 700
211
+ ]
212
+ ].map(([direct, search, referral], index) => ({
213
+ day: `2026-09-${String(21 + index)}`,
214
+ direct,
215
+ referral,
216
+ search
217
+ }));
218
+ function Replay() {
219
+ const $ = c(41);
220
+ const { t } = useWords("stacked-area-chart");
221
+ const [run, setRun] = useState(0);
222
+ let t0;
223
+ if ($[0] !== t) {
224
+ t0 = t("traffic.caption");
225
+ $[0] = t;
226
+ $[1] = t0;
227
+ } else t0 = $[1];
228
+ let t1;
229
+ if ($[2] !== t) {
230
+ t1 = t("traffic.label");
231
+ $[2] = t;
232
+ $[3] = t1;
233
+ } else t1 = $[3];
234
+ let t2;
235
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
236
+ t2 = {
237
+ timeZone: "UTC",
238
+ weekday: "short"
239
+ };
240
+ $[4] = t2;
241
+ } else t2 = $[4];
242
+ let t3;
243
+ if ($[5] !== t) {
244
+ t3 = t("series");
245
+ $[5] = t;
246
+ $[6] = t3;
247
+ } else t3 = $[6];
248
+ let t4;
249
+ if ($[7] !== t) {
250
+ t4 = t("traffic.direct");
251
+ $[7] = t;
252
+ $[8] = t4;
253
+ } else t4 = $[8];
254
+ let t5;
255
+ if ($[9] !== t4) {
256
+ t5 = {
257
+ key: "direct",
258
+ label: t4
259
+ };
260
+ $[9] = t4;
261
+ $[10] = t5;
262
+ } else t5 = $[10];
263
+ let t6;
264
+ if ($[11] !== t) {
265
+ t6 = t("traffic.search");
266
+ $[11] = t;
267
+ $[12] = t6;
268
+ } else t6 = $[12];
269
+ let t7;
270
+ if ($[13] !== t6) {
271
+ t7 = {
272
+ key: "search",
273
+ label: t6
274
+ };
275
+ $[13] = t6;
276
+ $[14] = t7;
277
+ } else t7 = $[14];
278
+ let t8;
279
+ if ($[15] !== t) {
280
+ t8 = t("traffic.referral");
281
+ $[15] = t;
282
+ $[16] = t8;
283
+ } else t8 = $[16];
284
+ let t9;
285
+ if ($[17] !== t8) {
286
+ t9 = {
287
+ key: "referral",
288
+ label: t8
289
+ };
290
+ $[17] = t8;
291
+ $[18] = t9;
292
+ } else t9 = $[18];
293
+ let t10;
294
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
295
+ t10 = [
296
+ t5,
297
+ t7,
298
+ t9
299
+ ];
300
+ $[19] = t5;
301
+ $[20] = t7;
302
+ $[21] = t9;
303
+ $[22] = t10;
304
+ } else t10 = $[22];
305
+ let t11;
306
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
307
+ t11 = { notation: "compact" };
308
+ $[23] = t11;
309
+ } else t11 = $[23];
310
+ let t12;
311
+ if ($[24] !== run || $[25] !== t0 || $[26] !== t1 || $[27] !== t10 || $[28] !== t3) {
312
+ t12 = /* @__PURE__ */ jsx(StackedAreaChart, {
313
+ animate: true,
314
+ caption: t0,
315
+ categoryKey: "day",
316
+ data: DAYS$2,
317
+ label: t1,
318
+ labelOptions: t2,
319
+ legendLabel: t3,
320
+ series: t10,
321
+ valueOptions: t11
322
+ }, run);
323
+ $[24] = run;
324
+ $[25] = t0;
325
+ $[26] = t1;
326
+ $[27] = t10;
327
+ $[28] = t3;
328
+ $[29] = t12;
329
+ } else t12 = $[29];
330
+ let t13;
331
+ if ($[30] !== run) {
332
+ t13 = () => {
333
+ setRun(run + 1);
334
+ };
335
+ $[30] = run;
336
+ $[31] = t13;
337
+ } else t13 = $[31];
338
+ let t14;
339
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
340
+ t14 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
341
+ $[32] = t14;
342
+ } else t14 = $[32];
343
+ let t15;
344
+ if ($[33] !== t) {
345
+ t15 = t("replay.replay");
346
+ $[33] = t;
347
+ $[34] = t15;
348
+ } else t15 = $[34];
349
+ let t16;
350
+ if ($[35] !== t13 || $[36] !== t15) {
351
+ t16 = /* @__PURE__ */ jsxs(Button, {
352
+ onClick: t13,
353
+ size: "sm",
354
+ variant: "outline",
355
+ children: [t14, t15]
356
+ });
357
+ $[35] = t13;
358
+ $[36] = t15;
359
+ $[37] = t16;
360
+ } else t16 = $[37];
361
+ let t17;
362
+ if ($[38] !== t12 || $[39] !== t16) {
363
+ t17 = /* @__PURE__ */ jsxs(Stack, {
364
+ align: "flex-start",
365
+ children: [t12, t16]
366
+ });
367
+ $[38] = t12;
368
+ $[39] = t16;
369
+ $[40] = t17;
370
+ } else t17 = $[40];
371
+ return t17;
372
+ }
373
+ const source$3 = "import { type ReactElement, useState } from \"react\";\n\nimport { RotateCcwIcon } from \"lucide-react\";\n\nimport { Button } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedAreaChart } from \"@stealthscale/component-charts\";\n\nconst DAYS = [\n [4200, 2600, 900],\n [4600, 2900, 1100],\n [4400, 3100, 1400],\n [5100, 3300, 2600],\n [5300, 3600, 2100],\n [3100, 2200, 800],\n [2900, 2000, 700],\n].map(([direct, search, referral], index) => ({\n day: `2026-09-${String(21 + index)}`,\n direct,\n referral,\n search,\n}));\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"stacked-area-chart\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <StackedAreaChart\n animate\n caption={t(\"traffic.caption\")}\n categoryKey=\"day\"\n data={DAYS}\n key={run}\n label={t(\"traffic.label\")}\n labelOptions={{ timeZone: \"UTC\", weekday: \"short\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"direct\", label: t(\"traffic.direct\") },\n { key: \"search\", label: t(\"traffic.search\") },\n { key: \"referral\", label: t(\"traffic.referral\") },\n ]}\n valueOptions={{ notation: \"compact\" }}\n />\n <Button\n onClick={() => {\n setRun(run + 1);\n }}\n size=\"sm\"\n variant=\"outline\"\n >\n <RotateCcwIcon />\n {t(\"replay.replay\")}\n </Button>\n </Stack>\n );\n}\n";
374
+ //#endregion
375
+ //#region src/stacked-area-chart/examples/share.example.tsx
376
+ var share_example_exports = /* @__PURE__ */ __exportAll({
377
+ Share: () => Share,
378
+ source: () => source$2
379
+ });
380
+ const MONTHS = [
381
+ [
382
+ 5800,
383
+ 2100,
384
+ 900,
385
+ 1200
386
+ ],
387
+ [
388
+ 6100,
389
+ 2300,
390
+ 1e3,
391
+ 1400
392
+ ],
393
+ [
394
+ 6400,
395
+ 2600,
396
+ 1100,
397
+ 1900
398
+ ],
399
+ [
400
+ 6900,
401
+ 2700,
402
+ 1300,
403
+ 2600
404
+ ],
405
+ [
406
+ 7200,
407
+ 2900,
408
+ 1500,
409
+ 3400
410
+ ],
411
+ [
412
+ 7600,
413
+ 3e3,
414
+ 1700,
415
+ 4300
416
+ ]
417
+ ].map(([web, ios, android, api], index) => ({
418
+ android,
419
+ api,
420
+ ios,
421
+ month: `2026-0${String(4 + index)}-01`,
422
+ web
423
+ }));
424
+ function Share() {
425
+ const $ = c(33);
426
+ const { t } = useWords("stacked-area-chart");
427
+ let t0;
428
+ if ($[0] !== t) {
429
+ t0 = t("share.caption");
430
+ $[0] = t;
431
+ $[1] = t0;
432
+ } else t0 = $[1];
433
+ let t1;
434
+ if ($[2] !== t) {
435
+ t1 = t("share.label");
436
+ $[2] = t;
437
+ $[3] = t1;
438
+ } else t1 = $[3];
439
+ let t2;
440
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
441
+ t2 = {
442
+ month: "short",
443
+ timeZone: "UTC"
444
+ };
445
+ $[4] = t2;
446
+ } else t2 = $[4];
447
+ let t3;
448
+ if ($[5] !== t) {
449
+ t3 = t("series");
450
+ $[5] = t;
451
+ $[6] = t3;
452
+ } else t3 = $[6];
453
+ let t4;
454
+ if ($[7] !== t) {
455
+ t4 = t("share.web");
456
+ $[7] = t;
457
+ $[8] = t4;
458
+ } else t4 = $[8];
459
+ let t5;
460
+ if ($[9] !== t4) {
461
+ t5 = {
462
+ key: "web",
463
+ label: t4
464
+ };
465
+ $[9] = t4;
466
+ $[10] = t5;
467
+ } else t5 = $[10];
468
+ let t6;
469
+ if ($[11] !== t) {
470
+ t6 = t("share.ios");
471
+ $[11] = t;
472
+ $[12] = t6;
473
+ } else t6 = $[12];
474
+ let t7;
475
+ if ($[13] !== t6) {
476
+ t7 = {
477
+ key: "ios",
478
+ label: t6
479
+ };
480
+ $[13] = t6;
481
+ $[14] = t7;
482
+ } else t7 = $[14];
483
+ let t8;
484
+ if ($[15] !== t) {
485
+ t8 = t("share.android");
486
+ $[15] = t;
487
+ $[16] = t8;
488
+ } else t8 = $[16];
489
+ let t9;
490
+ if ($[17] !== t8) {
491
+ t9 = {
492
+ key: "android",
493
+ label: t8
494
+ };
495
+ $[17] = t8;
496
+ $[18] = t9;
497
+ } else t9 = $[18];
498
+ let t10;
499
+ if ($[19] !== t) {
500
+ t10 = t("share.api");
501
+ $[19] = t;
502
+ $[20] = t10;
503
+ } else t10 = $[20];
504
+ let t11;
505
+ if ($[21] !== t10) {
506
+ t11 = {
507
+ key: "api",
508
+ label: t10
509
+ };
510
+ $[21] = t10;
511
+ $[22] = t11;
512
+ } else t11 = $[22];
513
+ let t12;
514
+ if ($[23] !== t11 || $[24] !== t5 || $[25] !== t7 || $[26] !== t9) {
515
+ t12 = [
516
+ t5,
517
+ t7,
518
+ t9,
519
+ t11
520
+ ];
521
+ $[23] = t11;
522
+ $[24] = t5;
523
+ $[25] = t7;
524
+ $[26] = t9;
525
+ $[27] = t12;
526
+ } else t12 = $[27];
527
+ let t13;
528
+ if ($[28] !== t0 || $[29] !== t1 || $[30] !== t12 || $[31] !== t3) {
529
+ t13 = /* @__PURE__ */ jsx(StackedAreaChart, {
530
+ caption: t0,
531
+ categoryKey: "month",
532
+ data: MONTHS,
533
+ label: t1,
534
+ labelOptions: t2,
535
+ legendLabel: t3,
536
+ percent: true,
537
+ series: t12
538
+ });
539
+ $[28] = t0;
540
+ $[29] = t1;
541
+ $[30] = t12;
542
+ $[31] = t3;
543
+ $[32] = t13;
544
+ } else t13 = $[32];
545
+ return t13;
546
+ }
547
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedAreaChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n [5800, 2100, 900, 1200],\n [6100, 2300, 1000, 1400],\n [6400, 2600, 1100, 1900],\n [6900, 2700, 1300, 2600],\n [7200, 2900, 1500, 3400],\n [7600, 3000, 1700, 4300],\n].map(([web, ios, android, api], index) => ({\n android,\n api,\n ios,\n month: `2026-0${String(4 + index)}-01`,\n web,\n}));\n\nexport function Share(): ReactElement {\n const { t } = useWords(\"stacked-area-chart\");\n\n return (\n <StackedAreaChart\n caption={t(\"share.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n label={t(\"share.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n percent\n series={[\n { key: \"web\", label: t(\"share.web\") },\n { key: \"ios\", label: t(\"share.ios\") },\n { key: \"android\", label: t(\"share.android\") },\n { key: \"api\", label: t(\"share.api\") },\n ]}\n />\n );\n}\n";
548
+ //#endregion
549
+ //#region src/stacked-area-chart/examples/traffic.example.tsx
550
+ var traffic_example_exports = /* @__PURE__ */ __exportAll({
551
+ Traffic: () => Traffic,
552
+ source: () => source$1
553
+ });
554
+ const DAYS$1 = [
555
+ [
556
+ 4200,
557
+ 2600,
558
+ 900
559
+ ],
560
+ [
561
+ 4600,
562
+ 2900,
563
+ 1100
564
+ ],
565
+ [
566
+ 4400,
567
+ 3100,
568
+ 1400
569
+ ],
570
+ [
571
+ 5100,
572
+ 3300,
573
+ 2600
574
+ ],
575
+ [
576
+ 5300,
577
+ 3600,
578
+ 2100
579
+ ],
580
+ [
581
+ 3100,
582
+ 2200,
583
+ 800
584
+ ],
585
+ [
586
+ 2900,
587
+ 2e3,
588
+ 700
589
+ ]
590
+ ].map(([direct, search, referral], index) => ({
591
+ day: `2026-09-${String(21 + index)}`,
592
+ direct,
593
+ referral,
594
+ search
595
+ }));
596
+ function Traffic() {
597
+ const $ = c(29);
598
+ const { t } = useWords("stacked-area-chart");
599
+ let t0;
600
+ if ($[0] !== t) {
601
+ t0 = t("traffic.caption");
602
+ $[0] = t;
603
+ $[1] = t0;
604
+ } else t0 = $[1];
605
+ let t1;
606
+ if ($[2] !== t) {
607
+ t1 = t("traffic.label");
608
+ $[2] = t;
609
+ $[3] = t1;
610
+ } else t1 = $[3];
611
+ let t2;
612
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
613
+ t2 = {
614
+ timeZone: "UTC",
615
+ weekday: "short"
616
+ };
617
+ $[4] = t2;
618
+ } else t2 = $[4];
619
+ let t3;
620
+ if ($[5] !== t) {
621
+ t3 = t("series");
622
+ $[5] = t;
623
+ $[6] = t3;
624
+ } else t3 = $[6];
625
+ let t4;
626
+ if ($[7] !== t) {
627
+ t4 = t("traffic.direct");
628
+ $[7] = t;
629
+ $[8] = t4;
630
+ } else t4 = $[8];
631
+ let t5;
632
+ if ($[9] !== t4) {
633
+ t5 = {
634
+ key: "direct",
635
+ label: t4
636
+ };
637
+ $[9] = t4;
638
+ $[10] = t5;
639
+ } else t5 = $[10];
640
+ let t6;
641
+ if ($[11] !== t) {
642
+ t6 = t("traffic.search");
643
+ $[11] = t;
644
+ $[12] = t6;
645
+ } else t6 = $[12];
646
+ let t7;
647
+ if ($[13] !== t6) {
648
+ t7 = {
649
+ key: "search",
650
+ label: t6
651
+ };
652
+ $[13] = t6;
653
+ $[14] = t7;
654
+ } else t7 = $[14];
655
+ let t8;
656
+ if ($[15] !== t) {
657
+ t8 = t("traffic.referral");
658
+ $[15] = t;
659
+ $[16] = t8;
660
+ } else t8 = $[16];
661
+ let t9;
662
+ if ($[17] !== t8) {
663
+ t9 = {
664
+ key: "referral",
665
+ label: t8
666
+ };
667
+ $[17] = t8;
668
+ $[18] = t9;
669
+ } else t9 = $[18];
670
+ let t10;
671
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
672
+ t10 = [
673
+ t5,
674
+ t7,
675
+ t9
676
+ ];
677
+ $[19] = t5;
678
+ $[20] = t7;
679
+ $[21] = t9;
680
+ $[22] = t10;
681
+ } else t10 = $[22];
682
+ let t11;
683
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
684
+ t11 = { notation: "compact" };
685
+ $[23] = t11;
686
+ } else t11 = $[23];
687
+ let t12;
688
+ if ($[24] !== t0 || $[25] !== t1 || $[26] !== t10 || $[27] !== t3) {
689
+ t12 = /* @__PURE__ */ jsx(StackedAreaChart, {
690
+ caption: t0,
691
+ categoryKey: "day",
692
+ data: DAYS$1,
693
+ label: t1,
694
+ labelOptions: t2,
695
+ legendLabel: t3,
696
+ series: t10,
697
+ valueOptions: t11
698
+ });
699
+ $[24] = t0;
700
+ $[25] = t1;
701
+ $[26] = t10;
702
+ $[27] = t3;
703
+ $[28] = t12;
704
+ } else t12 = $[28];
705
+ return t12;
706
+ }
707
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedAreaChart } from \"@stealthscale/component-charts\";\n\nconst DAYS = [\n [4200, 2600, 900],\n [4600, 2900, 1100],\n [4400, 3100, 1400],\n [5100, 3300, 2600],\n [5300, 3600, 2100],\n [3100, 2200, 800],\n [2900, 2000, 700],\n].map(([direct, search, referral], index) => ({\n day: `2026-09-${String(21 + index)}`,\n direct,\n referral,\n search,\n}));\n\nexport function Traffic(): ReactElement {\n const { t } = useWords(\"stacked-area-chart\");\n\n return (\n <StackedAreaChart\n caption={t(\"traffic.caption\")}\n categoryKey=\"day\"\n data={DAYS}\n label={t(\"traffic.label\")}\n labelOptions={{ timeZone: \"UTC\", weekday: \"short\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"direct\", label: t(\"traffic.direct\") },\n { key: \"search\", label: t(\"traffic.search\") },\n { key: \"referral\", label: t(\"traffic.referral\") },\n ]}\n valueOptions={{ notation: \"compact\" }}\n />\n );\n}\n";
708
+ //#endregion
709
+ //#region src/stacked-area-chart/examples/untracked.example.tsx
710
+ var untracked_example_exports = /* @__PURE__ */ __exportAll({
711
+ Untracked: () => Untracked,
712
+ source: () => source
713
+ });
714
+ const DAYS = [];
715
+ function Untracked() {
716
+ const $ = c(27);
717
+ const { t } = useWords("stacked-area-chart");
718
+ let t0;
719
+ if ($[0] !== t) {
720
+ t0 = t("untracked.caption");
721
+ $[0] = t;
722
+ $[1] = t0;
723
+ } else t0 = $[1];
724
+ let t1;
725
+ if ($[2] !== t) {
726
+ t1 = t("untracked.empty");
727
+ $[2] = t;
728
+ $[3] = t1;
729
+ } else t1 = $[3];
730
+ let t2;
731
+ if ($[4] !== t) {
732
+ t2 = t("traffic.label");
733
+ $[4] = t;
734
+ $[5] = t2;
735
+ } else t2 = $[5];
736
+ let t3;
737
+ if ($[6] !== t) {
738
+ t3 = t("traffic.direct");
739
+ $[6] = t;
740
+ $[7] = t3;
741
+ } else t3 = $[7];
742
+ let t4;
743
+ if ($[8] !== t3) {
744
+ t4 = {
745
+ key: "direct",
746
+ label: t3
747
+ };
748
+ $[8] = t3;
749
+ $[9] = t4;
750
+ } else t4 = $[9];
751
+ let t5;
752
+ if ($[10] !== t) {
753
+ t5 = t("traffic.search");
754
+ $[10] = t;
755
+ $[11] = t5;
756
+ } else t5 = $[11];
757
+ let t6;
758
+ if ($[12] !== t5) {
759
+ t6 = {
760
+ key: "search",
761
+ label: t5
762
+ };
763
+ $[12] = t5;
764
+ $[13] = t6;
765
+ } else t6 = $[13];
766
+ let t7;
767
+ if ($[14] !== t) {
768
+ t7 = t("traffic.referral");
769
+ $[14] = t;
770
+ $[15] = t7;
771
+ } else t7 = $[15];
772
+ let t8;
773
+ if ($[16] !== t7) {
774
+ t8 = {
775
+ key: "referral",
776
+ label: t7
777
+ };
778
+ $[16] = t7;
779
+ $[17] = t8;
780
+ } else t8 = $[17];
781
+ let t9;
782
+ if ($[18] !== t4 || $[19] !== t6 || $[20] !== t8) {
783
+ t9 = [
784
+ t4,
785
+ t6,
786
+ t8
787
+ ];
788
+ $[18] = t4;
789
+ $[19] = t6;
790
+ $[20] = t8;
791
+ $[21] = t9;
792
+ } else t9 = $[21];
793
+ let t10;
794
+ if ($[22] !== t0 || $[23] !== t1 || $[24] !== t2 || $[25] !== t9) {
795
+ t10 = /* @__PURE__ */ jsx(StackedAreaChart, {
796
+ caption: t0,
797
+ categoryKey: "day",
798
+ data: DAYS,
799
+ empty: t1,
800
+ label: t2,
801
+ series: t9
802
+ });
803
+ $[22] = t0;
804
+ $[23] = t1;
805
+ $[24] = t2;
806
+ $[25] = t9;
807
+ $[26] = t10;
808
+ } else t10 = $[26];
809
+ return t10;
810
+ }
811
+ const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedAreaChart } from \"@stealthscale/component-charts\";\n\nconst DAYS: Array<{ day: string; direct: number; referral: number; search: number }> = [];\n\nexport function Untracked(): ReactElement {\n const { t } = useWords(\"stacked-area-chart\");\n\n return (\n <StackedAreaChart\n caption={t(\"untracked.caption\")}\n categoryKey=\"day\"\n data={DAYS}\n empty={t(\"untracked.empty\")}\n label={t(\"traffic.label\")}\n series={[\n { key: \"direct\", label: t(\"traffic.direct\") },\n { key: \"search\", label: t(\"traffic.search\") },\n { key: \"referral\", label: t(\"traffic.referral\") },\n ]}\n />\n );\n}\n";
812
+ //#endregion
813
+ //#region src/stacked-area-chart/stacked-area-chart.specimen.tsx
814
+ /**
815
+ * Catalogue page for the stacked area chart.
816
+ *
817
+ * @remarks
818
+ * The stacked area chart has no recipe of its own: the chart's recipe styles its figure, so every
819
+ * scene is hand-written. The scenes render sessions per source stacked into each day's total,
820
+ * requests per client as shares of each month, the tooltip open at Thursday, the bands animated
821
+ * in with a replay, the sessions at a phone's width, and a week without sessions. Every scene
822
+ * renders a component from `examples/` and shows that file as its source. The words are keys
823
+ * under `stacked-area-chart` in `locales/en/specimen/stacked-area-chart.json`.
824
+ */
825
+ /**
826
+ * Hand-written scene for series stacked into a total.
827
+ */
828
+ const totals = {
829
+ about: "stacked-area-chart.traffic.about",
830
+ draw: () => /* @__PURE__ */ jsx(Room, {
831
+ size: "lg",
832
+ children: /* @__PURE__ */ jsx(Traffic, {})
833
+ }),
834
+ example: traffic_example_exports,
835
+ title: "stacked-area-chart.traffic.title"
836
+ };
837
+ /**
838
+ * Hand-written scene for series stacked into shares.
839
+ */
840
+ const shares = {
841
+ about: "stacked-area-chart.share.about",
842
+ draw: () => /* @__PURE__ */ jsx(Room, {
843
+ size: "lg",
844
+ children: /* @__PURE__ */ jsx(Share, {})
845
+ }),
846
+ example: share_example_exports,
847
+ title: "stacked-area-chart.share.title"
848
+ };
849
+ /**
850
+ * Hand-written scene for the tooltip open at a row.
851
+ */
852
+ const tooltip = {
853
+ about: "stacked-area-chart.launch.about",
854
+ draw: () => /* @__PURE__ */ jsx(Room, {
855
+ size: "lg",
856
+ children: /* @__PURE__ */ jsx(Launch, {})
857
+ }),
858
+ example: launch_example_exports,
859
+ title: "stacked-area-chart.launch.title"
860
+ };
861
+ /**
862
+ * Hand-written scene for the bands animated in, with a replay.
863
+ */
864
+ const animated = {
865
+ about: "stacked-area-chart.replay.about",
866
+ draw: () => /* @__PURE__ */ jsx(Room, {
867
+ size: "lg",
868
+ children: /* @__PURE__ */ jsx(Replay, {})
869
+ }),
870
+ example: replay_example_exports,
871
+ title: "stacked-area-chart.replay.title"
872
+ };
873
+ /**
874
+ * Hand-written scene for the sessions at a phone's width.
875
+ */
876
+ const narrow = {
877
+ about: "stacked-area-chart.narrow.about",
878
+ draw: () => /* @__PURE__ */ jsx(Room, {
879
+ size: "xs",
880
+ children: /* @__PURE__ */ jsx(Traffic, {})
881
+ }),
882
+ example: traffic_example_exports,
883
+ title: "stacked-area-chart.narrow.title"
884
+ };
885
+ /**
886
+ * Hand-written scene for a week without sessions.
887
+ */
888
+ const empty = {
889
+ about: "stacked-area-chart.untracked.about",
890
+ draw: () => /* @__PURE__ */ jsx(Room, {
891
+ size: "md",
892
+ children: /* @__PURE__ */ jsx(Untracked, {})
893
+ }),
894
+ example: untracked_example_exports,
895
+ title: "stacked-area-chart.untracked.title"
896
+ };
897
+ var stacked_area_chart_specimen_default = specimen({
898
+ about: "stacked-area-chart.about",
899
+ id: "components/charts/stacked-area-chart",
900
+ imports: "import { StackedAreaChart } from \"@stealthscale/component-charts\";",
901
+ scenes: [
902
+ totals,
903
+ shares,
904
+ tooltip,
905
+ animated,
906
+ narrow,
907
+ empty
908
+ ],
909
+ title: "stacked-area-chart.title"
910
+ });
911
+ //#endregion
912
+ export { animated, stacked_area_chart_specimen_default as default, empty, narrow, shares, tooltip, totals };