@weing-dev/ui-kit-primitive 0.4.6 → 0.5.0

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 (50) hide show
  1. package/README.md +6 -0
  2. package/dist/{Icon-DExqF865.js → Icon-DEdvzMs-.js} +1 -1
  3. package/dist/{color-B71xRiyK.js → baseColor-DYa5_IOB.js} +3 -120
  4. package/dist/calendar.js +12 -12
  5. package/dist/chart.css +1 -0
  6. package/dist/chart.d.ts +6 -2
  7. package/dist/chart.js +532 -85
  8. package/dist/color-qJrSCDan.js +155 -0
  9. package/dist/components/Calendar/Calendar.d.ts +1 -55
  10. package/dist/components/Calendar/Calendar.type.d.ts +61 -0
  11. package/dist/components/Cascader/Cascader.d.ts +2 -36
  12. package/dist/components/Cascader/Cascader.type.d.ts +37 -0
  13. package/dist/components/Chart/Chart.context.d.ts +9 -0
  14. package/dist/components/Chart/Chart.hooks.d.ts +4 -0
  15. package/dist/components/Chart/Chart.options.d.ts +24 -0
  16. package/dist/components/Chart/Chart.palette.d.ts +20 -0
  17. package/dist/components/Chart/Chart.preset.d.ts +7 -0
  18. package/dist/components/Chart/Chart.register.d.ts +1 -0
  19. package/dist/components/Chart/Chart.style.d.ts +21 -0
  20. package/dist/components/Chart/Chart.theme.d.ts +9 -0
  21. package/dist/components/Chart/Chart.type.d.ts +114 -0
  22. package/dist/components/Chart/ChartFrame.d.ts +14 -0
  23. package/dist/components/Chart/ChartRenderer.d.ts +11 -0
  24. package/dist/components/Chart/charts/BarChart.d.ts +3 -0
  25. package/dist/components/Chart/charts/DoughnutChart.d.ts +3 -0
  26. package/dist/components/Chart/charts/LineChart.d.ts +3 -0
  27. package/dist/components/Chart/charts/PieChart.d.ts +3 -0
  28. package/dist/components/Form/Dropdown/Dropdown.d.ts +1 -47
  29. package/dist/components/Form/Dropdown/Dropdown.type.d.ts +48 -0
  30. package/dist/components/Form/TextArea/TextArea.d.ts +1 -18
  31. package/dist/components/Form/TextArea/TextArea.type.d.ts +19 -0
  32. package/dist/components/Form/TextInput/TextInput.d.ts +1 -17
  33. package/dist/components/Form/TextInput/TextInput.type.d.ts +18 -0
  34. package/dist/components/TimeInput/TimeInput.d.ts +1 -27
  35. package/dist/components/TimeInput/TimeInput.type.d.ts +27 -0
  36. package/dist/display.js +23 -22
  37. package/dist/entry/chart.d.ts +6 -2
  38. package/dist/entry/components.d.ts +1 -2
  39. package/dist/feedback.js +2 -2
  40. package/dist/form.js +463 -462
  41. package/dist/icon.js +2 -2
  42. package/dist/index.js +3806 -3862
  43. package/dist/index.umd.cjs +24 -24
  44. package/dist/navigation.js +41 -40
  45. package/dist/styles/color.d.ts +30 -0
  46. package/dist/video-player.js +83 -83
  47. package/docs/subpath-imports.md +80 -0
  48. package/package.json +3 -2
  49. package/dist/components/Chart/Chart.d.ts +0 -19
  50. /package/dist/components/Cascader/{Cacader.data.d.ts → Cascader.data.d.ts} +0 -0
package/dist/chart.js CHANGED
@@ -1,94 +1,541 @@
1
- import { c as J, j as o } from "./compiler-runtime-BFrE5JtX.js";
2
- import { Chart as D, CategoryScale as M, LinearScale as T, PointElement as $, LineController as z, BubbleController as O, DoughnutController as k, PieController as q, LineElement as G, BarController as H, PolarAreaController as I, BarElement as K, RadarController as N, RadialLinearScale as Q, ScatterController as U, Title as V, Tooltip as W, Filler as X, Legend as Y, ArcElement as Z } from "chart.js";
3
- import F from "chartjs-plugin-datalabels";
4
- import { FunnelController as ee, TrapezoidElement as te, FunnelChart as le } from "chartjs-chart-funnel";
5
- import { Line as re, Bar as oe, Bubble as ae, Doughnut as ne, Pie as se, PolarArea as ie, Radar as ce, Scatter as fe } from "react-chartjs-2";
6
- import B from "react";
7
- D.register(M, T, $, z, O, k, q, G, H, I, K, N, Q, U, V, W, X, Y, Z, F, ee, te);
8
- const de = {
9
- labels: ["January", "February", "March", "April", "May", "June", "July"],
10
- datasets: [{
11
- label: "My First Dataset",
12
- data: [65, 59, 80, 81, 56, 55, 40],
13
- fill: !1,
14
- borderColor: "rgb(75, 192, 192)",
15
- tension: 0.1
16
- }]
17
- }, ue = {
18
- responsive: !0,
19
- maintainAspectRatio: !1,
20
- plugins: {
21
- legend: {
22
- position: "top"
23
- },
24
- title: {
25
- display: !0,
26
- text: "Chart.js Chart"
27
- }
28
- }
29
- }, be = (P) => {
30
- const e = J.c(54), {
31
- type: v,
32
- data: E,
33
- options: R,
34
- width: L,
35
- height: w
36
- } = P, t = v === void 0 ? "line" : v, l = E === void 0 ? de : E, r = R === void 0 ? ue : R, a = L === void 0 ? 800 : L, n = w === void 0 ? 400 : w, A = B.useRef(null);
37
- let C, g;
38
- e[0] !== l || e[1] !== r || e[2] !== t ? (C = () => {
39
- const S = A.current;
40
- if (S && t === "funnel") {
41
- const y = S.getContext("2d");
42
- if (!y)
43
- return;
44
- console.log("type", t), console.log("data", l);
45
- const j = D.getChart(y), _ = async () => {
46
- new le(y, {
47
- data: l,
48
- options: r,
49
- plugins: [F]
50
- });
51
- };
52
- j == null || j.destroy(), _();
53
- }
54
- }, g = [l, r, t], e[0] = l, e[1] = r, e[2] = t, e[3] = C, e[4] = g) : (C = e[3], g = e[4]), B.useEffect(C, g);
55
- let x;
56
- e[5] === Symbol.for("react.memo_cache_sentinel") ? (x = {
57
- position: "relative",
58
- height: "40vh",
59
- width: "80vw"
60
- }, e[5] = x) : x = e[5];
61
- let s;
62
- e[6] !== l || e[7] !== n || e[8] !== r || e[9] !== t || e[10] !== a ? (s = t === "line" && /* @__PURE__ */ o.jsx(re, { data: l, options: r, width: a, height: n }), e[6] = l, e[7] = n, e[8] = r, e[9] = t, e[10] = a, e[11] = s) : s = e[11];
1
+ import { c as j, j as G } from "./compiler-runtime-BFrE5JtX.js";
2
+ import { c as ne } from "./bind-D3ZJ5k4I.js";
3
+ import { Bar as se, Line as ae, Pie as ie, Doughnut as ce } from "react-chartjs-2";
4
+ import de from "chartjs-plugin-datalabels";
5
+ import { Chart as Q, CategoryScale as pe, LinearScale as ue, BarController as he, BarElement as ge, LineController as fe, LineElement as me, PointElement as ye, ArcElement as Ce, PieController as be, DoughnutController as xe, Title as Ae, Tooltip as ve, Legend as Le, Filler as Te } from "chart.js";
6
+ import W from "react";
7
+ import { B as y } from "./baseColor-DYa5_IOB.js";
8
+ const Pe = "_ChartFrame_1t22s_2", Ee = "_ChartState_1t22s_6", Se = {
9
+ ChartFrame: Pe,
10
+ ChartState: Ee
11
+ }, q = ne.bind(Se), M = (t) => {
12
+ const e = j.c(14), {
13
+ height: o,
14
+ loading: r,
15
+ empty: l,
16
+ isEmpty: n,
17
+ className: s,
18
+ children: a
19
+ } = t;
63
20
  let i;
64
- e[12] !== l || e[13] !== r || e[14] !== t ? (i = t === "bar" && /* @__PURE__ */ o.jsx(oe, { data: l, options: r }), e[12] = l, e[13] = r, e[14] = t, e[15] = i) : i = e[15];
65
- let c;
66
- e[16] !== l || e[17] !== r || e[18] !== t ? (c = t === "bubble" && /* @__PURE__ */ o.jsx(ae, { data: l, options: r }), e[16] = l, e[17] = r, e[18] = t, e[19] = c) : c = e[19];
67
- let f;
68
- e[20] !== l || e[21] !== r || e[22] !== t ? (f = t === "doughnut" && /* @__PURE__ */ o.jsx(ne, { data: l, options: r }), e[20] = l, e[21] = r, e[22] = t, e[23] = f) : f = e[23];
21
+ e[0] !== s ? (i = q("ChartFrame", s), e[0] = s, e[1] = i) : i = e[1];
22
+ const u = o ?? "100%", c = o ? void 0 : 240;
69
23
  let d;
70
- e[24] !== l || e[25] !== r || e[26] !== t ? (d = t === "pie" && /* @__PURE__ */ o.jsx(se, { data: l, options: r }), e[24] = l, e[25] = r, e[26] = t, e[27] = d) : d = e[27];
71
- let u;
72
- e[28] !== l || e[29] !== r || e[30] !== t ? (u = t === "polarArea" && /* @__PURE__ */ o.jsx(ie, { data: l, options: r }), e[28] = l, e[29] = r, e[30] = t, e[31] = u) : u = e[31];
24
+ e[2] !== u || e[3] !== c ? (d = {
25
+ height: u,
26
+ minHeight: c
27
+ }, e[2] = u, e[3] = c, e[4] = d) : d = e[4];
73
28
  let p;
74
- e[32] !== l || e[33] !== r || e[34] !== t ? (p = t === "radar" && /* @__PURE__ */ o.jsx(ce, { data: l, options: r }), e[32] = l, e[33] = r, e[34] = t, e[35] = p) : p = e[35];
29
+ e[5] !== a || e[6] !== l || e[7] !== n || e[8] !== r ? (p = n ? /* @__PURE__ */ G.jsx("div", { className: q("ChartState"), children: l ?? "데이터가 없습니다" }) : r ? /* @__PURE__ */ G.jsx("div", { className: q("ChartState"), children: "불러오는 중…" }) : a, e[5] = a, e[6] = l, e[7] = n, e[8] = r, e[9] = p) : p = e[9];
75
30
  let h;
76
- e[36] !== l || e[37] !== r || e[38] !== t ? (h = t === "scatter" && /* @__PURE__ */ o.jsx(fe, { data: l, options: r }), e[36] = l, e[37] = r, e[38] = t, e[39] = h) : h = e[39];
31
+ return e[10] !== i || e[11] !== d || e[12] !== p ? (h = /* @__PURE__ */ G.jsx("div", { className: i, style: d, children: p }), e[10] = i, e[11] = d, e[12] = p, e[13] = h) : h = e[13], h;
32
+ };
33
+ let Z = !1;
34
+ const Be = () => {
35
+ if (typeof window > "u") return "sans-serif";
36
+ const t = getComputedStyle(document.body).fontFamily;
37
+ return (t == null ? void 0 : t.trim()) || "sans-serif";
38
+ }, ke = () => {
39
+ Z || (Z = !0, Q.register(pe, ue, he, ge, fe, me, ye, Ce, be, xe, Ae, ve, Le, Te), Q.defaults.font.family = Be());
40
+ };
41
+ ke();
42
+ const Ge = {
43
+ bar: se,
44
+ line: ae,
45
+ pie: ie,
46
+ doughnut: ce
47
+ }, Re = (t) => {
48
+ var o, r;
49
+ const e = (r = (o = t.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : r.display;
50
+ return e !== void 0 && e !== !1;
51
+ }, I = (t) => {
52
+ const e = j.c(12), {
53
+ kind: o,
54
+ data: r,
55
+ options: l,
56
+ plugins: n
57
+ } = t, s = Ge[o];
58
+ let a;
59
+ e[0] !== n ? (a = n ?? [], e[0] = n, e[1] = a) : a = e[1];
60
+ let i;
61
+ e[2] !== l ? (i = Re(l) ? [de] : [], e[2] = l, e[3] = i) : i = e[3];
62
+ let u;
63
+ e[4] !== a || e[5] !== i ? (u = [...a, ...i], e[4] = a, e[5] = i, e[6] = u) : u = e[6];
64
+ const c = u, d = r, p = l, h = c;
77
65
  let m;
78
- e[40] !== n || e[41] !== t || e[42] !== a ? (m = t === "funnel" && /* @__PURE__ */ o.jsx("canvas", { id: "Chart", ref: A, width: a, height: n }), e[40] = n, e[41] = t, e[42] = a, e[43] = m) : m = e[43];
66
+ return e[7] !== s || e[8] !== d || e[9] !== p || e[10] !== h ? (m = /* @__PURE__ */ G.jsx(s, { data: d, options: p, plugins: h }), e[7] = s, e[8] = d, e[9] = p, e[10] = h, e[11] = m) : m = e[11], m;
67
+ }, De = 8, X = [y.deepGreen.DeepGreen6, y.blue.Blue6, y.gold.Gold6, y.purple.Purple6, y.cyanBlue.CyanBlue6, y.red.Red6, y.lightGreen.LightGreen6, y.grey.Grey6], je = {
68
+ red: y.red.Red6,
69
+ lightGreen: y.lightGreen.LightGreen6,
70
+ cyanBlue: y.cyanBlue.CyanBlue6,
71
+ purple: y.purple.Purple6,
72
+ gold: y.gold.Gold6,
73
+ blue: y.blue.Blue6,
74
+ grey: y.grey.Grey6,
75
+ deepGreen: y.deepGreen.DeepGreen6,
76
+ primary: y.deepGreen.DeepGreen6
77
+ }, V = (t) => /^(#|rgb|hsl|var\()/.test(t) ? t : je[t] ?? t, w = (t) => typeof window > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(t).trim(), we = () => {
78
+ const t = Array.from({
79
+ length: De
80
+ }, (e, o) => w(`--chartCategorical${o}`));
81
+ return t.some(Boolean) ? t.map((e, o) => e || X[o]) : X;
82
+ }, te = (t, e) => {
83
+ const [o, r] = W.useState(e);
84
+ return W.useEffect(() => {
85
+ const l = () => r(t());
86
+ l();
87
+ const n = window.matchMedia("(prefers-color-scheme: dark)");
88
+ return n.addEventListener("change", l), () => n.removeEventListener("change", l);
89
+ }, []), o;
90
+ }, _e = () => te(we, X), _ = {
91
+ grid: y.grey.Grey4,
92
+ axis: y.grey.Grey6,
93
+ label: y.grey.Grey7,
94
+ tooltipBg: y.grey.Grey9,
95
+ tooltipText: y.whiteWhite
96
+ }, Oe = () => ({
97
+ grid: w("--chartGrid") || _.grid,
98
+ axis: w("--chartAxis") || _.axis,
99
+ label: w("--chartLabel") || _.label,
100
+ tooltipBg: w("--chartTooltipBg") || _.tooltipBg,
101
+ tooltipText: w("--chartTooltipText") || _.tooltipText
102
+ }), K = () => te(Oe, _), $e = (t, e) => {
103
+ if (t)
104
+ return Array.isArray(t) ? t.map(V) : e;
105
+ }, oe = W.createContext(void 0), Fe = () => W.use(oe), Ne = {
106
+ // 예) 모든 도넛 기본 정책을 켤 때:
107
+ // doughnut: { cutout: 0.6, showTotal: true, legend: "right" },
108
+ // bar: { barRadius: 6 },
109
+ }, z = (t, e) => {
110
+ const o = j.c(6), r = _e(), l = Fe(), n = Ne[t];
111
+ let s;
112
+ return o[0] !== e || o[1] !== t || o[2] !== n || o[3] !== l || o[4] !== r ? (s = {
113
+ kind: t,
114
+ instance: e,
115
+ theme: l,
116
+ preset: n,
117
+ tokenPalette: r
118
+ }, o[0] = e, o[1] = t, o[2] = n, o[3] = l, o[4] = r, o[5] = s) : s = o[5], s;
119
+ }, We = (t) => {
120
+ var e, o, r;
121
+ return {
122
+ ...(e = t.theme) == null ? void 0 : e.defaults,
123
+ ...(r = (o = t.theme) == null ? void 0 : o.presets) == null ? void 0 : r[t.kind]
124
+ };
125
+ }, Ve = (t) => {
126
+ var e, o, r, l, n, s;
127
+ return ((r = (o = (e = t.theme) == null ? void 0 : e.presets) == null ? void 0 : o[t.kind]) == null ? void 0 : r.palette) ?? ((n = (l = t.theme) == null ? void 0 : l.defaults) == null ? void 0 : n.palette) ?? ((s = t.theme) == null ? void 0 : s.palette);
128
+ }, U = (t, e, o) => {
129
+ const r = $e(t, o);
130
+ return r && r.length ? r[e % r.length] : void 0;
131
+ }, $ = (t, e) => {
132
+ var o, r;
133
+ return ((o = e.instance) == null ? void 0 : o[t]) ?? We(e)[t] ?? ((r = e.preset) == null ? void 0 : r[t]);
134
+ }, Y = (t, e) => {
135
+ var o, r;
136
+ return U((o = e.instance) == null ? void 0 : o.colors, t, e.tokenPalette) ?? U(Ve(e), t, e.tokenPalette) ?? U((r = e.preset) == null ? void 0 : r.palette, t, e.tokenPalette) ?? e.tokenPalette[t % e.tokenPalette.length];
137
+ }, ee = (t) => !!t && typeof t == "object" && !Array.isArray(t), J = (t, e) => {
138
+ if (!e) return t;
139
+ const o = Array.isArray(t) ? [...t] : {
140
+ ...t
141
+ };
142
+ for (const r of Object.keys(e)) {
143
+ const l = t == null ? void 0 : t[r], n = e[r];
144
+ o[r] = ee(l) && ee(n) ? J(l, n) : n;
145
+ }
146
+ return o;
147
+ }, Me = (t, e) => /^#[0-9a-fA-F]{6}$/.test(t) ? `${t}${e}` : t, Ie = (t) => !Array.isArray(t) && "series" in t, re = (t, e, o = {}) => {
148
+ const r = (n) => e.kind === "line" && o.area ? Me(n, "29") : n;
149
+ if (Ie(t))
150
+ return {
151
+ labels: t.labels,
152
+ datasets: t.series.map((n, s) => {
153
+ const a = n.color ? V(n.color) : Y(s, e);
154
+ return {
155
+ label: n.name,
156
+ data: n.values,
157
+ backgroundColor: r(a),
158
+ borderColor: a,
159
+ fill: e.kind === "line" ? !!o.area : void 0,
160
+ tension: o.tension,
161
+ pointStyle: o.pointStyle,
162
+ borderWidth: o.lineWidth
163
+ };
164
+ })
165
+ };
166
+ const l = t.map((n, s) => n.color ? V(n.color) : Y(s, e));
167
+ return {
168
+ labels: t.map((n) => n.label),
169
+ datasets: [{
170
+ label: "",
171
+ data: t.map((n) => n.value),
172
+ backgroundColor: e.kind === "line" ? r(l[0]) : l,
173
+ borderColor: l,
174
+ fill: e.kind === "line" ? !!o.area : void 0,
175
+ tension: o.tension,
176
+ pointStyle: o.pointStyle,
177
+ borderWidth: o.lineWidth
178
+ }]
179
+ };
180
+ }, le = (t, e) => ({
181
+ labels: t.map((o) => o.label),
182
+ datasets: [{
183
+ label: "",
184
+ data: t.map((o) => o.value),
185
+ backgroundColor: t.map((o, r) => o.color ? V(o.color) : Y(r, e)),
186
+ borderWidth: 0
187
+ }]
188
+ }), Ke = (t) => t === !1 ? {
189
+ display: !1
190
+ } : t === !0 || t === void 0 ? {
191
+ display: !0,
192
+ position: "top"
193
+ } : {
194
+ display: !0,
195
+ position: t
196
+ }, ze = {
197
+ top: 24,
198
+ right: 28,
199
+ left: 8
200
+ }, He = (t, e, o) => t ? {
201
+ display: "auto",
202
+ color: e ? o.label : "#fff",
203
+ anchor: e ? "end" : "center",
204
+ align: e ? "top" : "center",
205
+ // 차트 영역 밖으로 라벨이 잘리지 않도록 안쪽으로 강제 (라인 양 끝 점 등)
206
+ clamp: !0,
207
+ font: {
208
+ weight: 600
209
+ },
210
+ formatter: typeof t == "function" ? t : (r) => typeof r == "number" ? r.toLocaleString() : r
211
+ } : {
212
+ display: !1
213
+ }, H = ({
214
+ kind: t,
215
+ base: e,
216
+ tokens: o,
217
+ extra: r
218
+ }) => {
219
+ const l = t === "bar" || t === "line", n = {
220
+ responsive: !0,
221
+ maintainAspectRatio: e.height == null,
222
+ aspectRatio: e.aspectRatio,
223
+ // 영역 여백: padding prop 이 최우선, 없으면 valueLabel·직교좌표 시 기본 여백(라벨 잘림 방지)
224
+ layout: (() => {
225
+ const a = e.padding ?? (e.valueLabel && l ? ze : void 0);
226
+ return a ? {
227
+ padding: a
228
+ } : void 0;
229
+ })(),
230
+ plugins: {
231
+ legend: Ke(e.legend),
232
+ title: e.title ? {
233
+ display: !0,
234
+ text: e.title,
235
+ color: o.label
236
+ } : {
237
+ display: !1
238
+ },
239
+ tooltip: {
240
+ backgroundColor: o.tooltipBg,
241
+ titleColor: o.tooltipText,
242
+ bodyColor: o.tooltipText
243
+ },
244
+ datalabels: He(e.valueLabel, l, o)
245
+ },
246
+ ...l ? {
247
+ scales: {
248
+ x: {
249
+ grid: {
250
+ color: o.grid
251
+ },
252
+ ticks: {
253
+ color: o.label
254
+ },
255
+ border: {
256
+ color: o.axis
257
+ }
258
+ },
259
+ y: {
260
+ grid: {
261
+ color: o.grid
262
+ },
263
+ ticks: {
264
+ color: o.label
265
+ },
266
+ border: {
267
+ color: o.axis
268
+ }
269
+ }
270
+ }
271
+ } : {}
272
+ }, s = J(J(n, r), e.options);
273
+ return e.rawOptions ?? s;
274
+ }, qe = (t) => Array.isArray(t) ? t.length === 0 : t.series.length === 0, lt = (t) => {
275
+ const e = j.c(32), {
276
+ data: o,
277
+ orientation: r,
278
+ stacked: l,
279
+ barRadius: n,
280
+ barThickness: s,
281
+ colors: a,
282
+ title: i,
283
+ legend: u,
284
+ height: c,
285
+ aspectRatio: d,
286
+ padding: p,
287
+ loading: h,
288
+ empty: m,
289
+ className: x,
290
+ valueLabel: v,
291
+ options: S,
292
+ rawOptions: g
293
+ } = t, L = r === void 0 ? "vertical" : r;
294
+ let C;
295
+ e[0] !== n || e[1] !== a ? (C = {
296
+ colors: a,
297
+ barRadius: n
298
+ }, e[0] = n, e[1] = a, e[2] = C) : C = e[2];
299
+ const A = z("bar", C), T = K();
300
+ let f;
301
+ if (e[3] !== s || e[4] !== o || e[5] !== A) {
302
+ const D = $("barRadius", A);
303
+ f = re(o, A), f.datasets = f.datasets.map((O) => ({
304
+ ...O,
305
+ borderRadius: D,
306
+ barThickness: s
307
+ })), e[3] = s, e[4] = o, e[5] = A, e[6] = f;
308
+ } else
309
+ f = e[6];
310
+ const b = L === "horizontal" ? "y" : "x";
311
+ let B;
312
+ if (e[7] !== d || e[8] !== o || e[9] !== c || e[10] !== u || e[11] !== S || e[12] !== p || e[13] !== g || e[14] !== l || e[15] !== b || e[16] !== i || e[17] !== T || e[18] !== v) {
313
+ const D = {
314
+ indexAxis: b,
315
+ ...l ? {
316
+ scales: {
317
+ x: {
318
+ stacked: !0
319
+ },
320
+ y: {
321
+ stacked: !0
322
+ }
323
+ }
324
+ } : {}
325
+ }, O = u ?? (Array.isArray(o) ? !1 : void 0);
326
+ B = H({
327
+ kind: "bar",
328
+ base: {
329
+ title: i,
330
+ legend: O,
331
+ height: c,
332
+ aspectRatio: d,
333
+ padding: p,
334
+ valueLabel: v,
335
+ options: S,
336
+ rawOptions: g
337
+ },
338
+ tokens: T,
339
+ extra: D
340
+ }), e[7] = d, e[8] = o, e[9] = c, e[10] = u, e[11] = S, e[12] = p, e[13] = g, e[14] = l, e[15] = b, e[16] = i, e[17] = T, e[18] = v, e[19] = B;
341
+ } else
342
+ B = e[19];
343
+ const R = B;
344
+ let P;
345
+ e[20] !== o ? (P = qe(o), e[20] = o, e[21] = P) : P = e[21];
346
+ let E;
347
+ e[22] !== f || e[23] !== R ? (E = /* @__PURE__ */ G.jsx(I, { kind: "bar", data: f, options: R }), e[22] = f, e[23] = R, e[24] = E) : E = e[24];
348
+ let k;
349
+ return e[25] !== x || e[26] !== m || e[27] !== c || e[28] !== h || e[29] !== P || e[30] !== E ? (k = /* @__PURE__ */ G.jsx(M, { height: c, loading: h, empty: m, isEmpty: P, className: x, children: E }), e[25] = x, e[26] = m, e[27] = c, e[28] = h, e[29] = P, e[30] = E, e[31] = k) : k = e[31], k;
350
+ }, Ue = (t) => Array.isArray(t) ? t.length === 0 : t.series.length === 0, nt = (t) => {
351
+ const e = j.c(31), {
352
+ data: o,
353
+ area: r,
354
+ tension: l,
355
+ pointStyle: n,
356
+ lineWidth: s,
357
+ colors: a,
358
+ title: i,
359
+ legend: u,
360
+ height: c,
361
+ aspectRatio: d,
362
+ padding: p,
363
+ loading: h,
364
+ empty: m,
365
+ className: x,
366
+ valueLabel: v,
367
+ options: S,
368
+ rawOptions: g
369
+ } = t;
370
+ let L;
371
+ e[0] !== a || e[1] !== n || e[2] !== l ? (L = {
372
+ colors: a,
373
+ tension: l,
374
+ pointStyle: n
375
+ }, e[0] = a, e[1] = n, e[2] = l, e[3] = L) : L = e[3];
376
+ const C = z("line", L), A = K();
377
+ let T;
378
+ e[4] !== r || e[5] !== o || e[6] !== s || e[7] !== C ? (T = re(o, C, {
379
+ area: r,
380
+ tension: $("tension", C) ?? 0.4,
381
+ pointStyle: $("pointStyle", C),
382
+ lineWidth: s
383
+ }), e[4] = r, e[5] = o, e[6] = s, e[7] = C, e[8] = T) : T = e[8];
384
+ const f = T, b = u ?? (Array.isArray(o) ? !1 : void 0);
385
+ let B;
386
+ e[9] !== d || e[10] !== c || e[11] !== b || e[12] !== S || e[13] !== p || e[14] !== g || e[15] !== i || e[16] !== A || e[17] !== v ? (B = H({
387
+ kind: "line",
388
+ base: {
389
+ title: i,
390
+ legend: b,
391
+ height: c,
392
+ aspectRatio: d,
393
+ padding: p,
394
+ valueLabel: v,
395
+ options: S,
396
+ rawOptions: g
397
+ },
398
+ tokens: A
399
+ }), e[9] = d, e[10] = c, e[11] = b, e[12] = S, e[13] = p, e[14] = g, e[15] = i, e[16] = A, e[17] = v, e[18] = B) : B = e[18];
400
+ const R = B;
401
+ let P;
402
+ e[19] !== o ? (P = Ue(o), e[19] = o, e[20] = P) : P = e[20];
403
+ let E;
404
+ e[21] !== f || e[22] !== R ? (E = /* @__PURE__ */ G.jsx(I, { kind: "line", data: f, options: R }), e[21] = f, e[22] = R, e[23] = E) : E = e[23];
405
+ let k;
406
+ return e[24] !== x || e[25] !== m || e[26] !== c || e[27] !== h || e[28] !== P || e[29] !== E ? (k = /* @__PURE__ */ G.jsx(M, { height: c, loading: h, empty: m, isEmpty: P, className: x, children: E }), e[24] = x, e[25] = m, e[26] = c, e[27] = h, e[28] = P, e[29] = E, e[30] = k) : k = e[30], k;
407
+ }, st = (t) => {
408
+ const e = j.c(25), {
409
+ data: o,
410
+ colors: r,
411
+ title: l,
412
+ legend: n,
413
+ height: s,
414
+ aspectRatio: a,
415
+ padding: i,
416
+ loading: u,
417
+ empty: c,
418
+ className: d,
419
+ valueLabel: p,
420
+ options: h,
421
+ rawOptions: m
422
+ } = t;
423
+ let x;
424
+ e[0] !== r ? (x = {
425
+ colors: r
426
+ }, e[0] = r, e[1] = x) : x = e[1];
427
+ const v = z("pie", x), S = K();
428
+ let g;
429
+ e[2] !== o || e[3] !== v ? (g = le(o, v), e[2] = o, e[3] = v, e[4] = g) : g = e[4];
430
+ const L = g;
431
+ let C;
432
+ e[5] !== a || e[6] !== s || e[7] !== n || e[8] !== h || e[9] !== i || e[10] !== m || e[11] !== l || e[12] !== S || e[13] !== p ? (C = H({
433
+ kind: "pie",
434
+ base: {
435
+ title: l,
436
+ legend: n,
437
+ height: s,
438
+ aspectRatio: a,
439
+ padding: i,
440
+ valueLabel: p,
441
+ options: h,
442
+ rawOptions: m
443
+ },
444
+ tokens: S
445
+ }), e[5] = a, e[6] = s, e[7] = n, e[8] = h, e[9] = i, e[10] = m, e[11] = l, e[12] = S, e[13] = p, e[14] = C) : C = e[14];
446
+ const A = C, T = o.length === 0;
447
+ let f;
448
+ e[15] !== L || e[16] !== A ? (f = /* @__PURE__ */ G.jsx(I, { kind: "pie", data: L, options: A }), e[15] = L, e[16] = A, e[17] = f) : f = e[17];
79
449
  let b;
80
- return e[44] !== c || e[45] !== f || e[46] !== d || e[47] !== u || e[48] !== p || e[49] !== h || e[50] !== m || e[51] !== s || e[52] !== i ? (b = /* @__PURE__ */ o.jsxs("div", { style: x, children: [
81
- s,
82
- i,
83
- c,
84
- f,
85
- d,
86
- u,
87
- p,
88
- h,
89
- m
90
- ] }), e[44] = c, e[45] = f, e[46] = d, e[47] = u, e[48] = p, e[49] = h, e[50] = m, e[51] = s, e[52] = i, e[53] = b) : b = e[53], b;
450
+ return e[18] !== d || e[19] !== c || e[20] !== s || e[21] !== u || e[22] !== T || e[23] !== f ? (b = /* @__PURE__ */ G.jsx(M, { height: s, loading: u, empty: c, isEmpty: T, className: d, children: f }), e[18] = d, e[19] = c, e[20] = s, e[21] = u, e[22] = T, e[23] = f, e[24] = b) : b = e[24], b;
451
+ }, Xe = (t, e) => ({
452
+ id: "centerTotal",
453
+ afterDraw(o) {
454
+ const {
455
+ ctx: r,
456
+ chartArea: l
457
+ } = o;
458
+ if (!l) return;
459
+ const n = (l.left + l.right) / 2, s = (l.top + l.bottom) / 2;
460
+ r.save(), r.textAlign = "center", r.textBaseline = "middle", r.fillStyle = e, r.font = "600 18px sans-serif", r.fillText(t, n, s), r.restore();
461
+ }
462
+ }), at = (t) => {
463
+ const e = j.c(49), {
464
+ data: o,
465
+ showTotal: r,
466
+ cutout: l,
467
+ colors: n,
468
+ title: s,
469
+ legend: a,
470
+ height: i,
471
+ aspectRatio: u,
472
+ padding: c,
473
+ loading: d,
474
+ empty: p,
475
+ className: h,
476
+ valueLabel: m,
477
+ options: x,
478
+ rawOptions: v
479
+ } = t;
480
+ let S;
481
+ e[0] !== n || e[1] !== l || e[2] !== r ? (S = {
482
+ colors: n,
483
+ cutout: l,
484
+ showTotal: r
485
+ }, e[0] = n, e[1] = l, e[2] = r, e[3] = S) : S = e[3];
486
+ const g = z("doughnut", S), L = K();
487
+ let C;
488
+ e[4] !== g ? (C = $("cutout", g) ?? 0.6, e[4] = g, e[5] = C) : C = e[5];
489
+ const A = C;
490
+ let T;
491
+ e[6] !== g ? (T = $("showTotal", g) ?? !1, e[6] = g, e[7] = T) : T = e[7];
492
+ const f = T;
493
+ let b, B, R;
494
+ if (e[8] !== u || e[9] !== A || e[10] !== o || e[11] !== i || e[12] !== a || e[13] !== x || e[14] !== c || e[15] !== v || e[16] !== f || e[17] !== g || e[18] !== s || e[19] !== L || e[20] !== m) {
495
+ const O = o.reduce(Ye, 0);
496
+ let F;
497
+ e[24] !== o || e[25] !== g ? (F = le(o, g), e[24] = o, e[25] = g, e[26] = F) : F = e[26], b = F;
498
+ let N;
499
+ e[27] !== u || e[28] !== A || e[29] !== i || e[30] !== a || e[31] !== x || e[32] !== c || e[33] !== v || e[34] !== s || e[35] !== L || e[36] !== m ? (N = H({
500
+ kind: "doughnut",
501
+ base: {
502
+ title: s,
503
+ legend: a,
504
+ height: i,
505
+ aspectRatio: u,
506
+ padding: c,
507
+ valueLabel: m,
508
+ options: x,
509
+ rawOptions: v
510
+ },
511
+ tokens: L,
512
+ extra: {
513
+ cutout: `${A * 100}%`
514
+ }
515
+ }), e[27] = u, e[28] = A, e[29] = i, e[30] = a, e[31] = x, e[32] = c, e[33] = v, e[34] = s, e[35] = L, e[36] = m, e[37] = N) : N = e[37], B = N, R = f ? [Xe(O.toLocaleString(), L.label)] : void 0, e[8] = u, e[9] = A, e[10] = o, e[11] = i, e[12] = a, e[13] = x, e[14] = c, e[15] = v, e[16] = f, e[17] = g, e[18] = s, e[19] = L, e[20] = m, e[21] = b, e[22] = B, e[23] = R;
516
+ } else
517
+ b = e[21], B = e[22], R = e[23];
518
+ const P = R, E = o.length === 0;
519
+ let k;
520
+ e[38] !== b || e[39] !== B || e[40] !== P ? (k = /* @__PURE__ */ G.jsx(I, { kind: "doughnut", data: b, options: B, plugins: P }), e[38] = b, e[39] = B, e[40] = P, e[41] = k) : k = e[41];
521
+ let D;
522
+ return e[42] !== h || e[43] !== p || e[44] !== i || e[45] !== d || e[46] !== E || e[47] !== k ? (D = /* @__PURE__ */ G.jsx(M, { height: i, loading: d, empty: p, isEmpty: E, className: h, children: k }), e[42] = h, e[43] = p, e[44] = i, e[45] = d, e[46] = E, e[47] = k, e[48] = D) : D = e[48], D;
523
+ };
524
+ function Ye(t, e) {
525
+ return t + e.value;
526
+ }
527
+ const it = (t) => {
528
+ const e = j.c(3), {
529
+ value: o,
530
+ children: r
531
+ } = t;
532
+ let l;
533
+ return e[0] !== r || e[1] !== o ? (l = /* @__PURE__ */ G.jsx(oe, { value: o, children: r }), e[0] = r, e[1] = o, e[2] = l) : l = e[2], l;
91
534
  };
92
535
  export {
93
- be as Chart
536
+ lt as BarChart,
537
+ it as ChartThemeProvider,
538
+ at as DoughnutChart,
539
+ nt as LineChart,
540
+ st as PieChart
94
541
  };