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