@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,722 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { g as StackedBarChart } 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-bar-chart/examples/replay.example.tsx
11
+ var replay_example_exports = /* @__PURE__ */ __exportAll({
12
+ Replay: () => Replay,
13
+ source: () => source$3
14
+ });
15
+ const MONTHS$3 = [
16
+ [
17
+ 2400,
18
+ 6400,
19
+ 9600
20
+ ],
21
+ [
22
+ 2600,
23
+ 7100,
24
+ 12e3
25
+ ],
26
+ [
27
+ 2400,
28
+ 8800,
29
+ 11200
30
+ ],
31
+ [
32
+ 2800,
33
+ 9500,
34
+ 16800
35
+ ],
36
+ [
37
+ 3e3,
38
+ 13400,
39
+ 20800
40
+ ],
41
+ [
42
+ 3e3,
43
+ 15800,
44
+ 24800
45
+ ]
46
+ ].map(([starter, growth, scale], index) => ({
47
+ growth,
48
+ month: `2026-0${String(4 + index)}-01`,
49
+ scale,
50
+ starter
51
+ }));
52
+ function Replay() {
53
+ const $ = c(41);
54
+ const { t } = useWords("stacked-bar-chart");
55
+ const [run, setRun] = useState(0);
56
+ let t0;
57
+ if ($[0] !== t) {
58
+ t0 = t("revenue.caption");
59
+ $[0] = t;
60
+ $[1] = t0;
61
+ } else t0 = $[1];
62
+ let t1;
63
+ if ($[2] !== t) {
64
+ t1 = t("revenue.label");
65
+ $[2] = t;
66
+ $[3] = t1;
67
+ } else t1 = $[3];
68
+ let t2;
69
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
70
+ t2 = {
71
+ month: "short",
72
+ timeZone: "UTC"
73
+ };
74
+ $[4] = t2;
75
+ } else t2 = $[4];
76
+ let t3;
77
+ if ($[5] !== t) {
78
+ t3 = t("series");
79
+ $[5] = t;
80
+ $[6] = t3;
81
+ } else t3 = $[6];
82
+ let t4;
83
+ if ($[7] !== t) {
84
+ t4 = t("revenue.scale");
85
+ $[7] = t;
86
+ $[8] = t4;
87
+ } else t4 = $[8];
88
+ let t5;
89
+ if ($[9] !== t4) {
90
+ t5 = {
91
+ key: "scale",
92
+ label: t4
93
+ };
94
+ $[9] = t4;
95
+ $[10] = t5;
96
+ } else t5 = $[10];
97
+ let t6;
98
+ if ($[11] !== t) {
99
+ t6 = t("revenue.growth");
100
+ $[11] = t;
101
+ $[12] = t6;
102
+ } else t6 = $[12];
103
+ let t7;
104
+ if ($[13] !== t6) {
105
+ t7 = {
106
+ key: "growth",
107
+ label: t6
108
+ };
109
+ $[13] = t6;
110
+ $[14] = t7;
111
+ } else t7 = $[14];
112
+ let t8;
113
+ if ($[15] !== t) {
114
+ t8 = t("revenue.starter");
115
+ $[15] = t;
116
+ $[16] = t8;
117
+ } else t8 = $[16];
118
+ let t9;
119
+ if ($[17] !== t8) {
120
+ t9 = {
121
+ key: "starter",
122
+ label: t8
123
+ };
124
+ $[17] = t8;
125
+ $[18] = t9;
126
+ } else t9 = $[18];
127
+ let t10;
128
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
129
+ t10 = [
130
+ t5,
131
+ t7,
132
+ t9
133
+ ];
134
+ $[19] = t5;
135
+ $[20] = t7;
136
+ $[21] = t9;
137
+ $[22] = t10;
138
+ } else t10 = $[22];
139
+ let t11;
140
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
141
+ t11 = {
142
+ currency: "EUR",
143
+ maximumFractionDigits: 0,
144
+ style: "currency"
145
+ };
146
+ $[23] = t11;
147
+ } else t11 = $[23];
148
+ let t12;
149
+ if ($[24] !== run || $[25] !== t0 || $[26] !== t1 || $[27] !== t10 || $[28] !== t3) {
150
+ t12 = /* @__PURE__ */ jsx(StackedBarChart, {
151
+ animate: true,
152
+ caption: t0,
153
+ categoryKey: "month",
154
+ data: MONTHS$3,
155
+ label: t1,
156
+ labelOptions: t2,
157
+ legendLabel: t3,
158
+ series: t10,
159
+ valueOptions: t11
160
+ }, run);
161
+ $[24] = run;
162
+ $[25] = t0;
163
+ $[26] = t1;
164
+ $[27] = t10;
165
+ $[28] = t3;
166
+ $[29] = t12;
167
+ } else t12 = $[29];
168
+ let t13;
169
+ if ($[30] !== run) {
170
+ t13 = () => {
171
+ setRun(run + 1);
172
+ };
173
+ $[30] = run;
174
+ $[31] = t13;
175
+ } else t13 = $[31];
176
+ let t14;
177
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
178
+ t14 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
179
+ $[32] = t14;
180
+ } else t14 = $[32];
181
+ let t15;
182
+ if ($[33] !== t) {
183
+ t15 = t("replay.replay");
184
+ $[33] = t;
185
+ $[34] = t15;
186
+ } else t15 = $[34];
187
+ let t16;
188
+ if ($[35] !== t13 || $[36] !== t15) {
189
+ t16 = /* @__PURE__ */ jsxs(Button, {
190
+ onClick: t13,
191
+ size: "sm",
192
+ variant: "outline",
193
+ children: [t14, t15]
194
+ });
195
+ $[35] = t13;
196
+ $[36] = t15;
197
+ $[37] = t16;
198
+ } else t16 = $[37];
199
+ let t17;
200
+ if ($[38] !== t12 || $[39] !== t16) {
201
+ t17 = /* @__PURE__ */ jsxs(Stack, {
202
+ align: "flex-start",
203
+ children: [t12, t16]
204
+ });
205
+ $[38] = t12;
206
+ $[39] = t16;
207
+ $[40] = t17;
208
+ } else t17 = $[40];
209
+ return t17;
210
+ }
211
+ 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 { StackedBarChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n [2400, 6400, 9600],\n [2600, 7100, 12_000],\n [2400, 8800, 11_200],\n [2800, 9500, 16_800],\n [3000, 13_400, 20_800],\n [3000, 15_800, 24_800],\n].map(([starter, growth, scale], index) => ({\n growth,\n month: `2026-0${String(4 + index)}-01`,\n scale,\n starter,\n}));\n\nexport function Replay(): ReactElement {\n const { t } = useWords(\"stacked-bar-chart\");\n const [run, setRun] = useState(0);\n\n return (\n <Stack align=\"flex-start\">\n <StackedBarChart\n animate\n caption={t(\"revenue.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n key={run}\n label={t(\"revenue.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"scale\", label: t(\"revenue.scale\") },\n { key: \"growth\", label: t(\"revenue.growth\") },\n { key: \"starter\", label: t(\"revenue.starter\") },\n ]}\n valueOptions={{ currency: \"EUR\", maximumFractionDigits: 0, style: \"currency\" }}\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";
212
+ //#endregion
213
+ //#region src/stacked-bar-chart/examples/revenue.example.tsx
214
+ var revenue_example_exports = /* @__PURE__ */ __exportAll({
215
+ Revenue: () => Revenue,
216
+ source: () => source$2
217
+ });
218
+ const MONTHS$2 = [
219
+ [
220
+ 2400,
221
+ 6400,
222
+ 9600
223
+ ],
224
+ [
225
+ 2600,
226
+ 7100,
227
+ 12e3
228
+ ],
229
+ [
230
+ 2400,
231
+ 8800,
232
+ 11200
233
+ ],
234
+ [
235
+ 2800,
236
+ 9500,
237
+ 16800
238
+ ],
239
+ [
240
+ 3e3,
241
+ 13400,
242
+ 20800
243
+ ],
244
+ [
245
+ 3e3,
246
+ 15800,
247
+ 24800
248
+ ]
249
+ ].map(([starter, growth, scale], index) => ({
250
+ growth,
251
+ month: `2026-0${String(4 + index)}-01`,
252
+ scale,
253
+ starter
254
+ }));
255
+ function Revenue() {
256
+ const $ = c(29);
257
+ const { t } = useWords("stacked-bar-chart");
258
+ let t0;
259
+ if ($[0] !== t) {
260
+ t0 = t("revenue.caption");
261
+ $[0] = t;
262
+ $[1] = t0;
263
+ } else t0 = $[1];
264
+ let t1;
265
+ if ($[2] !== t) {
266
+ t1 = t("revenue.label");
267
+ $[2] = t;
268
+ $[3] = t1;
269
+ } else t1 = $[3];
270
+ let t2;
271
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
272
+ t2 = {
273
+ month: "short",
274
+ timeZone: "UTC"
275
+ };
276
+ $[4] = t2;
277
+ } else t2 = $[4];
278
+ let t3;
279
+ if ($[5] !== t) {
280
+ t3 = t("series");
281
+ $[5] = t;
282
+ $[6] = t3;
283
+ } else t3 = $[6];
284
+ let t4;
285
+ if ($[7] !== t) {
286
+ t4 = t("revenue.scale");
287
+ $[7] = t;
288
+ $[8] = t4;
289
+ } else t4 = $[8];
290
+ let t5;
291
+ if ($[9] !== t4) {
292
+ t5 = {
293
+ key: "scale",
294
+ label: t4
295
+ };
296
+ $[9] = t4;
297
+ $[10] = t5;
298
+ } else t5 = $[10];
299
+ let t6;
300
+ if ($[11] !== t) {
301
+ t6 = t("revenue.growth");
302
+ $[11] = t;
303
+ $[12] = t6;
304
+ } else t6 = $[12];
305
+ let t7;
306
+ if ($[13] !== t6) {
307
+ t7 = {
308
+ key: "growth",
309
+ label: t6
310
+ };
311
+ $[13] = t6;
312
+ $[14] = t7;
313
+ } else t7 = $[14];
314
+ let t8;
315
+ if ($[15] !== t) {
316
+ t8 = t("revenue.starter");
317
+ $[15] = t;
318
+ $[16] = t8;
319
+ } else t8 = $[16];
320
+ let t9;
321
+ if ($[17] !== t8) {
322
+ t9 = {
323
+ key: "starter",
324
+ label: t8
325
+ };
326
+ $[17] = t8;
327
+ $[18] = t9;
328
+ } else t9 = $[18];
329
+ let t10;
330
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
331
+ t10 = [
332
+ t5,
333
+ t7,
334
+ t9
335
+ ];
336
+ $[19] = t5;
337
+ $[20] = t7;
338
+ $[21] = t9;
339
+ $[22] = t10;
340
+ } else t10 = $[22];
341
+ let t11;
342
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
343
+ t11 = {
344
+ currency: "EUR",
345
+ maximumFractionDigits: 0,
346
+ style: "currency"
347
+ };
348
+ $[23] = t11;
349
+ } else t11 = $[23];
350
+ let t12;
351
+ if ($[24] !== t0 || $[25] !== t1 || $[26] !== t10 || $[27] !== t3) {
352
+ t12 = /* @__PURE__ */ jsx(StackedBarChart, {
353
+ caption: t0,
354
+ categoryKey: "month",
355
+ data: MONTHS$2,
356
+ label: t1,
357
+ labelOptions: t2,
358
+ legendLabel: t3,
359
+ series: t10,
360
+ valueOptions: t11
361
+ });
362
+ $[24] = t0;
363
+ $[25] = t1;
364
+ $[26] = t10;
365
+ $[27] = t3;
366
+ $[28] = t12;
367
+ } else t12 = $[28];
368
+ return t12;
369
+ }
370
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedBarChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n [2400, 6400, 9600],\n [2600, 7100, 12_000],\n [2400, 8800, 11_200],\n [2800, 9500, 16_800],\n [3000, 13_400, 20_800],\n [3000, 15_800, 24_800],\n].map(([starter, growth, scale], index) => ({\n growth,\n month: `2026-0${String(4 + index)}-01`,\n scale,\n starter,\n}));\n\nexport function Revenue(): ReactElement {\n const { t } = useWords(\"stacked-bar-chart\");\n\n return (\n <StackedBarChart\n caption={t(\"revenue.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n label={t(\"revenue.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"scale\", label: t(\"revenue.scale\") },\n { key: \"growth\", label: t(\"revenue.growth\") },\n { key: \"starter\", label: t(\"revenue.starter\") },\n ]}\n valueOptions={{ currency: \"EUR\", maximumFractionDigits: 0, style: \"currency\" }}\n />\n );\n}\n";
371
+ //#endregion
372
+ //#region src/stacked-bar-chart/examples/split.example.tsx
373
+ var split_example_exports = /* @__PURE__ */ __exportAll({
374
+ Split: () => Split,
375
+ source: () => source$1
376
+ });
377
+ const MONTHS$1 = [
378
+ [
379
+ 2400,
380
+ 6400,
381
+ 9600
382
+ ],
383
+ [
384
+ 2600,
385
+ 7100,
386
+ 12e3
387
+ ],
388
+ [
389
+ 2400,
390
+ 8800,
391
+ 11200
392
+ ],
393
+ [
394
+ 2800,
395
+ 9500,
396
+ 16800
397
+ ],
398
+ [
399
+ 3e3,
400
+ 13400,
401
+ 20800
402
+ ],
403
+ [
404
+ 3e3,
405
+ 15800,
406
+ 24800
407
+ ]
408
+ ].map(([starter, growth, scale], index) => ({
409
+ growth,
410
+ month: `2026-0${String(4 + index)}-01`,
411
+ scale,
412
+ starter
413
+ }));
414
+ function Split() {
415
+ const $ = c(29);
416
+ const { t } = useWords("stacked-bar-chart");
417
+ let t0;
418
+ if ($[0] !== t) {
419
+ t0 = t("split.caption");
420
+ $[0] = t;
421
+ $[1] = t0;
422
+ } else t0 = $[1];
423
+ let t1;
424
+ if ($[2] !== t) {
425
+ t1 = t("revenue.label");
426
+ $[2] = t;
427
+ $[3] = t1;
428
+ } else t1 = $[3];
429
+ let t2;
430
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
431
+ t2 = {
432
+ month: "short",
433
+ timeZone: "UTC"
434
+ };
435
+ $[4] = t2;
436
+ } else t2 = $[4];
437
+ let t3;
438
+ if ($[5] !== t) {
439
+ t3 = t("series");
440
+ $[5] = t;
441
+ $[6] = t3;
442
+ } else t3 = $[6];
443
+ let t4;
444
+ if ($[7] !== t) {
445
+ t4 = t("revenue.scale");
446
+ $[7] = t;
447
+ $[8] = t4;
448
+ } else t4 = $[8];
449
+ let t5;
450
+ if ($[9] !== t4) {
451
+ t5 = {
452
+ key: "scale",
453
+ label: t4
454
+ };
455
+ $[9] = t4;
456
+ $[10] = t5;
457
+ } else t5 = $[10];
458
+ let t6;
459
+ if ($[11] !== t) {
460
+ t6 = t("revenue.growth");
461
+ $[11] = t;
462
+ $[12] = t6;
463
+ } else t6 = $[12];
464
+ let t7;
465
+ if ($[13] !== t6) {
466
+ t7 = {
467
+ key: "growth",
468
+ label: t6
469
+ };
470
+ $[13] = t6;
471
+ $[14] = t7;
472
+ } else t7 = $[14];
473
+ let t8;
474
+ if ($[15] !== t) {
475
+ t8 = t("revenue.starter");
476
+ $[15] = t;
477
+ $[16] = t8;
478
+ } else t8 = $[16];
479
+ let t9;
480
+ if ($[17] !== t8) {
481
+ t9 = {
482
+ key: "starter",
483
+ label: t8
484
+ };
485
+ $[17] = t8;
486
+ $[18] = t9;
487
+ } else t9 = $[18];
488
+ let t10;
489
+ if ($[19] !== t5 || $[20] !== t7 || $[21] !== t9) {
490
+ t10 = [
491
+ t5,
492
+ t7,
493
+ t9
494
+ ];
495
+ $[19] = t5;
496
+ $[20] = t7;
497
+ $[21] = t9;
498
+ $[22] = t10;
499
+ } else t10 = $[22];
500
+ let t11;
501
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
502
+ t11 = {
503
+ currency: "EUR",
504
+ maximumFractionDigits: 0,
505
+ style: "currency"
506
+ };
507
+ $[23] = t11;
508
+ } else t11 = $[23];
509
+ let t12;
510
+ if ($[24] !== t0 || $[25] !== t1 || $[26] !== t10 || $[27] !== t3) {
511
+ t12 = /* @__PURE__ */ jsx(StackedBarChart, {
512
+ caption: t0,
513
+ categoryKey: "month",
514
+ data: MONTHS$1,
515
+ defaultIndex: 5,
516
+ label: t1,
517
+ labelOptions: t2,
518
+ legendLabel: t3,
519
+ series: t10,
520
+ valueOptions: t11
521
+ });
522
+ $[24] = t0;
523
+ $[25] = t1;
524
+ $[26] = t10;
525
+ $[27] = t3;
526
+ $[28] = t12;
527
+ } else t12 = $[28];
528
+ return t12;
529
+ }
530
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedBarChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS = [\n [2400, 6400, 9600],\n [2600, 7100, 12_000],\n [2400, 8800, 11_200],\n [2800, 9500, 16_800],\n [3000, 13_400, 20_800],\n [3000, 15_800, 24_800],\n].map(([starter, growth, scale], index) => ({\n growth,\n month: `2026-0${String(4 + index)}-01`,\n scale,\n starter,\n}));\n\nexport function Split(): ReactElement {\n const { t } = useWords(\"stacked-bar-chart\");\n\n return (\n <StackedBarChart\n caption={t(\"split.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n defaultIndex={5}\n label={t(\"revenue.label\")}\n labelOptions={{ month: \"short\", timeZone: \"UTC\" }}\n legendLabel={t(\"series\")}\n series={[\n { key: \"scale\", label: t(\"revenue.scale\") },\n { key: \"growth\", label: t(\"revenue.growth\") },\n { key: \"starter\", label: t(\"revenue.starter\") },\n ]}\n valueOptions={{ currency: \"EUR\", maximumFractionDigits: 0, style: \"currency\" }}\n />\n );\n}\n";
531
+ //#endregion
532
+ //#region src/stacked-bar-chart/examples/unbooked.example.tsx
533
+ var unbooked_example_exports = /* @__PURE__ */ __exportAll({
534
+ Unbooked: () => Unbooked,
535
+ source: () => source
536
+ });
537
+ const MONTHS = [];
538
+ function Unbooked() {
539
+ const $ = c(27);
540
+ const { t } = useWords("stacked-bar-chart");
541
+ let t0;
542
+ if ($[0] !== t) {
543
+ t0 = t("unbooked.caption");
544
+ $[0] = t;
545
+ $[1] = t0;
546
+ } else t0 = $[1];
547
+ let t1;
548
+ if ($[2] !== t) {
549
+ t1 = t("unbooked.empty");
550
+ $[2] = t;
551
+ $[3] = t1;
552
+ } else t1 = $[3];
553
+ let t2;
554
+ if ($[4] !== t) {
555
+ t2 = t("revenue.label");
556
+ $[4] = t;
557
+ $[5] = t2;
558
+ } else t2 = $[5];
559
+ let t3;
560
+ if ($[6] !== t) {
561
+ t3 = t("revenue.scale");
562
+ $[6] = t;
563
+ $[7] = t3;
564
+ } else t3 = $[7];
565
+ let t4;
566
+ if ($[8] !== t3) {
567
+ t4 = {
568
+ key: "scale",
569
+ label: t3
570
+ };
571
+ $[8] = t3;
572
+ $[9] = t4;
573
+ } else t4 = $[9];
574
+ let t5;
575
+ if ($[10] !== t) {
576
+ t5 = t("revenue.growth");
577
+ $[10] = t;
578
+ $[11] = t5;
579
+ } else t5 = $[11];
580
+ let t6;
581
+ if ($[12] !== t5) {
582
+ t6 = {
583
+ key: "growth",
584
+ label: t5
585
+ };
586
+ $[12] = t5;
587
+ $[13] = t6;
588
+ } else t6 = $[13];
589
+ let t7;
590
+ if ($[14] !== t) {
591
+ t7 = t("revenue.starter");
592
+ $[14] = t;
593
+ $[15] = t7;
594
+ } else t7 = $[15];
595
+ let t8;
596
+ if ($[16] !== t7) {
597
+ t8 = {
598
+ key: "starter",
599
+ label: t7
600
+ };
601
+ $[16] = t7;
602
+ $[17] = t8;
603
+ } else t8 = $[17];
604
+ let t9;
605
+ if ($[18] !== t4 || $[19] !== t6 || $[20] !== t8) {
606
+ t9 = [
607
+ t4,
608
+ t6,
609
+ t8
610
+ ];
611
+ $[18] = t4;
612
+ $[19] = t6;
613
+ $[20] = t8;
614
+ $[21] = t9;
615
+ } else t9 = $[21];
616
+ let t10;
617
+ if ($[22] !== t0 || $[23] !== t1 || $[24] !== t2 || $[25] !== t9) {
618
+ t10 = /* @__PURE__ */ jsx(StackedBarChart, {
619
+ caption: t0,
620
+ categoryKey: "month",
621
+ data: MONTHS,
622
+ empty: t1,
623
+ label: t2,
624
+ series: t9
625
+ });
626
+ $[22] = t0;
627
+ $[23] = t1;
628
+ $[24] = t2;
629
+ $[25] = t9;
630
+ $[26] = t10;
631
+ } else t10 = $[26];
632
+ return t10;
633
+ }
634
+ const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { StackedBarChart } from \"@stealthscale/component-charts\";\n\nconst MONTHS: Array<{ growth: number; month: string; scale: number; starter: number }> = [];\n\nexport function Unbooked(): ReactElement {\n const { t } = useWords(\"stacked-bar-chart\");\n\n return (\n <StackedBarChart\n caption={t(\"unbooked.caption\")}\n categoryKey=\"month\"\n data={MONTHS}\n empty={t(\"unbooked.empty\")}\n label={t(\"revenue.label\")}\n series={[\n { key: \"scale\", label: t(\"revenue.scale\") },\n { key: \"growth\", label: t(\"revenue.growth\") },\n { key: \"starter\", label: t(\"revenue.starter\") },\n ]}\n />\n );\n}\n";
635
+ //#endregion
636
+ //#region src/stacked-bar-chart/stacked-bar-chart.specimen.tsx
637
+ /**
638
+ * Catalogue page for the stacked bar chart.
639
+ *
640
+ * @remarks
641
+ * The stacked bar chart has no recipe of its own: the chart's recipe styles its figure, so every
642
+ * scene is hand-written. The scenes render revenue per plan per month in euros, the tooltip open
643
+ * at September, the segments animated in with a replay, the revenue at a phone's width, and a
644
+ * range without rows. Every scene renders a component from `examples/` and shows that file as its
645
+ * source. The words are keys under `stacked-bar-chart` in
646
+ * `locales/en/specimen/stacked-bar-chart.json`.
647
+ */
648
+ /**
649
+ * Hand-written scene for totals split by plan.
650
+ */
651
+ const totals = {
652
+ about: "stacked-bar-chart.revenue.about",
653
+ draw: () => /* @__PURE__ */ jsx(Room, {
654
+ size: "lg",
655
+ children: /* @__PURE__ */ jsx(Revenue, {})
656
+ }),
657
+ example: revenue_example_exports,
658
+ title: "stacked-bar-chart.revenue.title"
659
+ };
660
+ /**
661
+ * Hand-written scene for the tooltip open at a row.
662
+ */
663
+ const tooltip = {
664
+ about: "stacked-bar-chart.split.about",
665
+ draw: () => /* @__PURE__ */ jsx(Room, {
666
+ size: "lg",
667
+ children: /* @__PURE__ */ jsx(Split, {})
668
+ }),
669
+ example: split_example_exports,
670
+ title: "stacked-bar-chart.split.title"
671
+ };
672
+ /**
673
+ * Hand-written scene for the segments animated in, with a replay.
674
+ */
675
+ const animated = {
676
+ about: "stacked-bar-chart.replay.about",
677
+ draw: () => /* @__PURE__ */ jsx(Room, {
678
+ size: "lg",
679
+ children: /* @__PURE__ */ jsx(Replay, {})
680
+ }),
681
+ example: replay_example_exports,
682
+ title: "stacked-bar-chart.replay.title"
683
+ };
684
+ /**
685
+ * Hand-written scene for the revenue at a phone's width.
686
+ */
687
+ const narrow = {
688
+ about: "stacked-bar-chart.narrow.about",
689
+ draw: () => /* @__PURE__ */ jsx(Room, {
690
+ size: "xs",
691
+ children: /* @__PURE__ */ jsx(Revenue, {})
692
+ }),
693
+ example: revenue_example_exports,
694
+ title: "stacked-bar-chart.narrow.title"
695
+ };
696
+ /**
697
+ * Hand-written scene for a range without rows.
698
+ */
699
+ const empty = {
700
+ about: "stacked-bar-chart.unbooked.about",
701
+ draw: () => /* @__PURE__ */ jsx(Room, {
702
+ size: "md",
703
+ children: /* @__PURE__ */ jsx(Unbooked, {})
704
+ }),
705
+ example: unbooked_example_exports,
706
+ title: "stacked-bar-chart.unbooked.title"
707
+ };
708
+ var stacked_bar_chart_specimen_default = specimen({
709
+ about: "stacked-bar-chart.about",
710
+ id: "components/charts/stacked-bar-chart",
711
+ imports: "import { StackedBarChart } from \"@stealthscale/component-charts\";",
712
+ scenes: [
713
+ totals,
714
+ tooltip,
715
+ animated,
716
+ narrow,
717
+ empty
718
+ ],
719
+ title: "stacked-bar-chart.title"
720
+ });
721
+ //#endregion
722
+ export { animated, stacked_bar_chart_specimen_default as default, empty, narrow, tooltip, totals };