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