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

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 (53) hide show
  1. package/README.md +89 -46
  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 +7 -2
  7. package/dist/chart.js +703 -84
  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.gradient.d.ts +10 -0
  15. package/dist/components/Chart/Chart.hooks.d.ts +4 -0
  16. package/dist/components/Chart/Chart.options.d.ts +29 -0
  17. package/dist/components/Chart/Chart.palette.d.ts +20 -0
  18. package/dist/components/Chart/Chart.preset.d.ts +7 -0
  19. package/dist/components/Chart/Chart.register.d.ts +1 -0
  20. package/dist/components/Chart/Chart.style.d.ts +21 -0
  21. package/dist/components/Chart/Chart.theme.d.ts +9 -0
  22. package/dist/components/Chart/Chart.type.d.ts +161 -0
  23. package/dist/components/Chart/ChartFrame.d.ts +14 -0
  24. package/dist/components/Chart/ChartRenderer.d.ts +11 -0
  25. package/dist/components/Chart/charts/BarChart.d.ts +3 -0
  26. package/dist/components/Chart/charts/DoughnutChart.d.ts +3 -0
  27. package/dist/components/Chart/charts/LineChart.d.ts +3 -0
  28. package/dist/components/Chart/charts/PieChart.d.ts +3 -0
  29. package/dist/components/Chart/charts/RadarChart.d.ts +3 -0
  30. package/dist/components/Form/Dropdown/Dropdown.d.ts +1 -47
  31. package/dist/components/Form/Dropdown/Dropdown.type.d.ts +48 -0
  32. package/dist/components/Form/TextArea/TextArea.d.ts +1 -18
  33. package/dist/components/Form/TextArea/TextArea.type.d.ts +19 -0
  34. package/dist/components/Form/TextInput/TextInput.d.ts +1 -17
  35. package/dist/components/Form/TextInput/TextInput.type.d.ts +18 -0
  36. package/dist/components/TimeInput/TimeInput.d.ts +1 -27
  37. package/dist/components/TimeInput/TimeInput.type.d.ts +27 -0
  38. package/dist/display.js +23 -22
  39. package/dist/entry/chart.d.ts +7 -2
  40. package/dist/entry/components.d.ts +1 -2
  41. package/dist/feedback.js +2 -2
  42. package/dist/form.js +463 -462
  43. package/dist/icon.js +2 -2
  44. package/dist/index.js +3806 -3862
  45. package/dist/index.umd.cjs +24 -24
  46. package/dist/navigation.js +41 -40
  47. package/dist/styles/color.d.ts +30 -0
  48. package/dist/video-player.js +83 -83
  49. package/docs/subpath-imports.md +80 -0
  50. package/docs/ui-kit-agent-guide.md +574 -0
  51. package/package.json +4 -2
  52. package/dist/components/Chart/Chart.d.ts +0 -19
  53. /package/dist/components/Cascader/{Cacader.data.d.ts → Cascader.data.d.ts} +0 -0
package/dist/chart.js CHANGED
@@ -1,94 +1,713 @@
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"],
1
+ import { c as _, j } from "./compiler-runtime-BFrE5JtX.js";
2
+ import { c as ut } from "./bind-D3ZJ5k4I.js";
3
+ import { Bar as pt, Line as ht, Pie as mt, Doughnut as gt, Radar as yt } from "react-chartjs-2";
4
+ import ft from "chartjs-plugin-datalabels";
5
+ import { Chart as ot, CategoryScale as bt, LinearScale as Ct, RadialLinearScale as xt, BarController as At, BarElement as vt, LineController as Lt, LineElement as St, PointElement as Et, ArcElement as Gt, PieController as Pt, DoughnutController as Tt, RadarController as Rt, Title as Dt, Tooltip as Bt, Legend as kt, Filler as jt } from "chart.js";
6
+ import U from "react";
7
+ import { B as S } from "./baseColor-DYa5_IOB.js";
8
+ const wt = "_ChartFrame_1t22s_2", Ot = "_ChartState_1t22s_6", _t = {
9
+ ChartFrame: wt,
10
+ ChartState: Ot
11
+ }, Y = ut.bind(_t), I = (e) => {
12
+ const t = _.c(14), {
13
+ height: r,
14
+ loading: o,
15
+ empty: n,
16
+ isEmpty: a,
17
+ className: l,
18
+ children: c
19
+ } = e;
20
+ let s;
21
+ t[0] !== l ? (s = Y("ChartFrame", l), t[0] = l, t[1] = s) : s = t[1];
22
+ const i = r ?? "100%", u = r ? void 0 : 240;
23
+ let h;
24
+ t[2] !== i || t[3] !== u ? (h = {
25
+ height: i,
26
+ minHeight: u
27
+ }, t[2] = i, t[3] = u, t[4] = h) : h = t[4];
28
+ let d;
29
+ t[5] !== c || t[6] !== n || t[7] !== a || t[8] !== o ? (d = a ? /* @__PURE__ */ j.jsx("div", { className: Y("ChartState"), children: n ?? "데이터가 없습니다" }) : o ? /* @__PURE__ */ j.jsx("div", { className: Y("ChartState"), children: "불러오는 중…" }) : c, t[5] = c, t[6] = n, t[7] = a, t[8] = o, t[9] = d) : d = t[9];
30
+ let m;
31
+ return t[10] !== s || t[11] !== h || t[12] !== d ? (m = /* @__PURE__ */ j.jsx("div", { className: s, style: h, children: d }), t[10] = s, t[11] = h, t[12] = d, t[13] = m) : m = t[13], m;
32
+ };
33
+ let lt = !1;
34
+ const $t = () => {
35
+ if (typeof window > "u") return "sans-serif";
36
+ const e = getComputedStyle(document.body).fontFamily;
37
+ return (e == null ? void 0 : e.trim()) || "sans-serif";
38
+ }, Ft = () => {
39
+ lt || (lt = !0, ot.register(
40
+ bt,
41
+ Ct,
42
+ xt,
43
+ // radar 방사축
44
+ At,
45
+ vt,
46
+ Lt,
47
+ St,
48
+ Et,
49
+ Gt,
50
+ Pt,
51
+ Tt,
52
+ Rt,
53
+ // radar (point/line/Filler 는 위에서 공용)
54
+ Dt,
55
+ Bt,
56
+ kt,
57
+ jt
58
+ ), ot.defaults.font.family = $t());
59
+ };
60
+ Ft();
61
+ const Nt = {
62
+ bar: pt,
63
+ line: ht,
64
+ pie: mt,
65
+ doughnut: gt,
66
+ radar: yt
67
+ }, Wt = (e) => {
68
+ var r, o;
69
+ const t = (o = (r = e.plugins) == null ? void 0 : r.datalabels) == null ? void 0 : o.display;
70
+ return t !== void 0 && t !== !1;
71
+ }, M = (e) => {
72
+ const t = _.c(12), {
73
+ kind: r,
74
+ data: o,
75
+ options: n,
76
+ plugins: a
77
+ } = e, l = Nt[r];
78
+ let c;
79
+ t[0] !== a ? (c = a ?? [], t[0] = a, t[1] = c) : c = t[1];
80
+ let s;
81
+ t[2] !== n ? (s = Wt(n) ? [ft] : [], t[2] = n, t[3] = s) : s = t[3];
82
+ let i;
83
+ t[4] !== c || t[5] !== s ? (i = [...c, ...s], t[4] = c, t[5] = s, t[6] = i) : i = t[6];
84
+ const u = i, h = o, d = n, m = u;
85
+ let g;
86
+ return t[7] !== l || t[8] !== h || t[9] !== d || t[10] !== m ? (g = /* @__PURE__ */ j.jsx(l, { data: h, options: d, plugins: m }), t[7] = l, t[8] = h, t[9] = d, t[10] = m, t[11] = g) : g = t[11], g;
87
+ }, It = 8, J = [S.deepGreen.DeepGreen6, S.blue.Blue6, S.gold.Gold6, S.purple.Purple6, S.cyanBlue.CyanBlue6, S.red.Red6, S.lightGreen.LightGreen6, S.grey.Grey6], Mt = {
88
+ red: S.red.Red6,
89
+ lightGreen: S.lightGreen.LightGreen6,
90
+ cyanBlue: S.cyanBlue.CyanBlue6,
91
+ purple: S.purple.Purple6,
92
+ gold: S.gold.Gold6,
93
+ blue: S.blue.Blue6,
94
+ grey: S.grey.Grey6,
95
+ deepGreen: S.deepGreen.DeepGreen6,
96
+ primary: S.deepGreen.DeepGreen6
97
+ }, X = (e) => /^(#|rgb|hsl|var\()/.test(e) ? e : Mt[e] ?? e, F = (e) => typeof window > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(e).trim(), Vt = () => {
98
+ const e = Array.from({
99
+ length: It
100
+ }, (t, r) => F(`--chartCategorical${r}`));
101
+ return e.some(Boolean) ? e.map((t, r) => t || J[r]) : J;
102
+ }, st = (e, t) => {
103
+ const [r, o] = U.useState(t);
104
+ return U.useEffect(() => {
105
+ const n = () => o(e());
106
+ n();
107
+ const a = window.matchMedia("(prefers-color-scheme: dark)");
108
+ return a.addEventListener("change", n), () => a.removeEventListener("change", n);
109
+ }, []), r;
110
+ }, Kt = () => st(Vt, J), N = {
111
+ grid: S.grey.Grey4,
112
+ axis: S.grey.Grey6,
113
+ label: S.grey.Grey7,
114
+ tooltipBg: S.grey.Grey9,
115
+ tooltipText: S.whiteWhite
116
+ }, zt = () => ({
117
+ grid: F("--chartGrid") || N.grid,
118
+ axis: F("--chartAxis") || N.axis,
119
+ label: F("--chartLabel") || N.label,
120
+ tooltipBg: F("--chartTooltipBg") || N.tooltipBg,
121
+ tooltipText: F("--chartTooltipText") || N.tooltipText
122
+ }), V = () => st(zt, N), Ht = (e, t) => {
123
+ if (e)
124
+ return Array.isArray(e) ? e.map(X) : t;
125
+ }, it = U.createContext(void 0), qt = () => U.use(it), Ut = {
126
+ // 예) 모든 도넛 기본 정책을 켤 때:
127
+ // doughnut: { cutout: 0.6, showTotal: true, legend: "right" },
128
+ // bar: { barRadius: 6 },
129
+ }, K = (e, t) => {
130
+ const r = _.c(6), o = Kt(), n = qt(), a = Ut[e];
131
+ let l;
132
+ return r[0] !== t || r[1] !== e || r[2] !== a || r[3] !== n || r[4] !== o ? (l = {
133
+ kind: e,
134
+ instance: t,
135
+ theme: n,
136
+ preset: a,
137
+ tokenPalette: o
138
+ }, r[0] = t, r[1] = e, r[2] = a, r[3] = n, r[4] = o, r[5] = l) : l = r[5], l;
139
+ }, Xt = (e) => {
140
+ var t, r, o;
141
+ return {
142
+ ...(t = e.theme) == null ? void 0 : t.defaults,
143
+ ...(o = (r = e.theme) == null ? void 0 : r.presets) == null ? void 0 : o[e.kind]
144
+ };
145
+ }, Yt = (e) => {
146
+ var t, r, o, n, a, l;
147
+ return ((o = (r = (t = e.theme) == null ? void 0 : t.presets) == null ? void 0 : r[e.kind]) == null ? void 0 : o.palette) ?? ((a = (n = e.theme) == null ? void 0 : n.defaults) == null ? void 0 : a.palette) ?? ((l = e.theme) == null ? void 0 : l.palette);
148
+ }, Z = (e, t, r) => {
149
+ const o = Ht(e, r);
150
+ return o && o.length ? o[t % o.length] : void 0;
151
+ }, W = (e, t) => {
152
+ var r, o;
153
+ return ((r = t.instance) == null ? void 0 : r[e]) ?? Xt(t)[e] ?? ((o = t.preset) == null ? void 0 : o[e]);
154
+ }, Q = (e, t) => {
155
+ var r, o;
156
+ return Z((r = t.instance) == null ? void 0 : r.colors, e, t.tokenPalette) ?? Z(Yt(t), e, t.tokenPalette) ?? Z((o = t.preset) == null ? void 0 : o.palette, e, t.tokenPalette) ?? t.tokenPalette[e % t.tokenPalette.length];
157
+ }, Zt = (e, t) => (r) => {
158
+ const {
159
+ chart: o
160
+ } = r, {
161
+ ctx: n,
162
+ chartArea: a
163
+ } = o;
164
+ if (!a) return e;
165
+ const l = n.createLinearGradient(0, a.top, 0, a.bottom);
166
+ return l.addColorStop(0, e), l.addColorStop(1, t), l;
167
+ }, nt = (e) => !!e && typeof e == "object" && !Array.isArray(e), tt = (e, t) => {
168
+ if (!t) return e;
169
+ const r = Array.isArray(e) ? [...e] : {
170
+ ...e
171
+ };
172
+ for (const o of Object.keys(t)) {
173
+ const n = e == null ? void 0 : e[o], a = t[o];
174
+ r[o] = nt(n) && nt(a) ? tt(n, a) : a;
175
+ }
176
+ return r;
177
+ }, et = (e, t) => /^#[0-9a-fA-F]{6}$/.test(e) ? `${e}${t}` : e, Jt = (e, t) => {
178
+ const r = e === !0 ? void 0 : e.from, o = e === !0 ? void 0 : e.to;
179
+ return Zt(r ?? et(t, "33"), o ?? et(t, "03"));
180
+ }, Qt = (e) => !Array.isArray(e) && "series" in e, rt = (e, t, r = {}) => {
181
+ const o = t.kind === "line" || t.kind === "radar", n = (l) => o && r.area ? et(l, "29") : l;
182
+ if (Qt(e))
183
+ return {
184
+ labels: e.labels,
185
+ datasets: e.series.map((l, c) => {
186
+ const s = l.color ? X(l.color) : Q(c, t), i = t.kind === "line" ? l.gradient : void 0, u = i != null && i !== !1;
187
+ return {
188
+ label: l.name,
189
+ data: l.values,
190
+ backgroundColor: u ? Jt(i, s) : n(s),
191
+ borderColor: s,
192
+ fill: o ? u || !!r.area : void 0,
193
+ tension: r.tension,
194
+ pointStyle: r.pointStyle,
195
+ borderWidth: r.lineWidth,
196
+ // ── 데이터셋 단위 옵션 (① 듀얼축·점선·null 구간) ──
197
+ yAxisID: l.yAxisID,
198
+ borderDash: l.borderDash,
199
+ spanGaps: l.spanGaps
200
+ };
201
+ })
202
+ };
203
+ const a = e.map((l, c) => l.color ? X(l.color) : Q(c, t));
204
+ return {
205
+ labels: e.map((l) => l.label),
206
+ datasets: [{
207
+ label: "",
208
+ data: e.map((l) => l.value),
209
+ // line/radar 는 단일색 면적, bar/pie 는 항목별 색
210
+ backgroundColor: o ? n(a[0]) : a,
211
+ // radar 단일 시리즈는 한 색, 그 외(line 기존동작 포함)는 항목별 배열
212
+ borderColor: t.kind === "radar" ? a[0] : a,
213
+ fill: o ? !!r.area : void 0,
214
+ tension: r.tension,
215
+ pointStyle: r.pointStyle,
216
+ borderWidth: r.lineWidth
217
+ }]
218
+ };
219
+ }, ct = (e, t) => ({
220
+ labels: e.map((r) => r.label),
10
221
  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
222
+ label: "",
223
+ data: e.map((r) => r.value),
224
+ backgroundColor: e.map((r, o) => r.color ? X(r.color) : Q(o, t)),
225
+ borderWidth: 0
16
226
  }]
17
- }, ue = {
18
- responsive: !0,
19
- maintainAspectRatio: !1,
20
- plugins: {
21
- legend: {
22
- position: "top"
227
+ }), te = (e) => e === !1 ? {
228
+ display: !1
229
+ } : e === !0 || e === void 0 ? {
230
+ display: !0,
231
+ position: "top"
232
+ } : {
233
+ display: !0,
234
+ position: e
235
+ }, ee = {
236
+ top: 24,
237
+ right: 28,
238
+ left: 8
239
+ }, re = (e, t, r) => e ? {
240
+ display: "auto",
241
+ color: t ? r.label : "#fff",
242
+ anchor: t ? "end" : "center",
243
+ align: t ? "top" : "center",
244
+ // 차트 영역 밖으로 라벨이 잘리지 않도록 안쪽으로 강제 (라인 양 끝 점 등)
245
+ clamp: !0,
246
+ font: {
247
+ weight: 600
248
+ },
249
+ formatter: typeof e == "function" ? e : (o) => typeof o == "number" ? o.toLocaleString() : o
250
+ } : {
251
+ display: !1
252
+ }, at = (e, t, r) => {
253
+ const o = t == null ? void 0 : t.tickFormat;
254
+ return {
255
+ grid: {
256
+ color: e.grid,
257
+ // 보조축 격자는 주축과 겹쳐 지저분해지므로 차트 영역엔 안 그림
258
+ ...r === "right" ? {
259
+ drawOnChartArea: !1
260
+ } : {}
261
+ },
262
+ ticks: {
263
+ color: e.label,
264
+ ...o ? {
265
+ callback: (n) => o(Number(n))
266
+ } : {}
267
+ },
268
+ border: {
269
+ color: e.axis
270
+ },
271
+ ...(t == null ? void 0 : t.max) != null ? {
272
+ max: t.max
273
+ } : {},
274
+ ...(t == null ? void 0 : t.min) != null ? {
275
+ min: t.min
276
+ } : {},
277
+ ...r ? {
278
+ position: r
279
+ } : {},
280
+ ...t != null && t.title ? {
281
+ title: {
282
+ display: !0,
283
+ text: t.title,
284
+ color: e.label
285
+ }
286
+ } : {}
287
+ };
288
+ }, oe = (e, t, r) => {
289
+ if (e === "bar" || e === "line")
290
+ return {
291
+ x: {
292
+ grid: {
293
+ color: t.grid
294
+ },
295
+ ticks: {
296
+ color: t.label
297
+ },
298
+ border: {
299
+ color: t.axis
300
+ }
301
+ },
302
+ y: at(t, r == null ? void 0 : r.y, "left"),
303
+ ...r != null && r.y1 ? {
304
+ y1: at(t, r.y1, "right")
305
+ } : {}
306
+ };
307
+ if (e === "radar")
308
+ return {
309
+ r: {
310
+ grid: {
311
+ color: t.grid
312
+ },
313
+ angleLines: {
314
+ color: t.grid
315
+ },
316
+ pointLabels: {
317
+ color: t.label
318
+ },
319
+ ticks: {
320
+ color: t.label,
321
+ backdropColor: "transparent"
322
+ },
323
+ beginAtZero: !0
324
+ }
325
+ };
326
+ }, z = ({
327
+ kind: e,
328
+ base: t,
329
+ tokens: r,
330
+ extra: o,
331
+ axes: n
332
+ }) => {
333
+ const a = e === "bar" || e === "line", l = oe(e, r, n), c = {
334
+ responsive: !0,
335
+ maintainAspectRatio: t.height == null,
336
+ aspectRatio: t.aspectRatio,
337
+ // 영역 여백: padding prop 이 최우선, 없으면 valueLabel·직교좌표 시 기본 여백(라벨 잘림 방지)
338
+ layout: (() => {
339
+ const i = t.padding ?? (t.valueLabel && a ? ee : void 0);
340
+ return i ? {
341
+ padding: i
342
+ } : void 0;
343
+ })(),
344
+ plugins: {
345
+ legend: te(t.legend),
346
+ title: t.title ? {
347
+ display: !0,
348
+ text: t.title,
349
+ color: r.label
350
+ } : {
351
+ display: !1
352
+ },
353
+ tooltip: {
354
+ backgroundColor: r.tooltipBg,
355
+ titleColor: r.tooltipText,
356
+ bodyColor: r.tooltipText
357
+ },
358
+ datalabels: re(t.valueLabel, a, r)
359
+ },
360
+ ...l ? {
361
+ scales: l
362
+ } : {}
363
+ }, s = tt(tt(c, o), t.options);
364
+ return t.rawOptions ?? s;
365
+ }, le = (e) => Array.isArray(e) ? e.length === 0 : e.series.length === 0, ye = (e) => {
366
+ const t = _.c(35), {
367
+ data: r,
368
+ orientation: o,
369
+ stacked: n,
370
+ barRadius: a,
371
+ barThickness: l,
372
+ yAxis: c,
373
+ y1Axis: s,
374
+ colors: i,
375
+ title: u,
376
+ legend: h,
377
+ height: d,
378
+ aspectRatio: m,
379
+ padding: g,
380
+ loading: E,
381
+ empty: v,
382
+ className: G,
383
+ valueLabel: R,
384
+ options: p,
385
+ rawOptions: L,
386
+ plugins: P
387
+ } = e, T = o === void 0 ? "vertical" : o;
388
+ let f;
389
+ t[0] !== a || t[1] !== i ? (f = {
390
+ colors: i,
391
+ barRadius: a
392
+ }, t[0] = a, t[1] = i, t[2] = f) : f = t[2];
393
+ const b = K("bar", f), y = V();
394
+ let C;
395
+ if (t[3] !== l || t[4] !== r || t[5] !== b) {
396
+ const O = W("barRadius", b);
397
+ C = rt(r, b), C.datasets = C.datasets.map(($) => ({
398
+ ...$,
399
+ borderRadius: O,
400
+ barThickness: l
401
+ })), t[3] = l, t[4] = r, t[5] = b, t[6] = C;
402
+ } else
403
+ C = t[6];
404
+ const x = T === "horizontal" ? "y" : "x";
405
+ let A;
406
+ if (t[7] !== m || t[8] !== r || t[9] !== d || t[10] !== h || t[11] !== p || t[12] !== g || t[13] !== L || t[14] !== n || t[15] !== x || t[16] !== u || t[17] !== y || t[18] !== R || t[19] !== s || t[20] !== c) {
407
+ const O = {
408
+ indexAxis: x,
409
+ ...n ? {
410
+ scales: {
411
+ x: {
412
+ stacked: !0
413
+ },
414
+ y: {
415
+ stacked: !0
416
+ }
417
+ }
418
+ } : {}
419
+ }, $ = h ?? (Array.isArray(r) ? !1 : void 0);
420
+ A = z({
421
+ kind: "bar",
422
+ base: {
423
+ title: u,
424
+ legend: $,
425
+ height: d,
426
+ aspectRatio: m,
427
+ padding: g,
428
+ valueLabel: R,
429
+ options: p,
430
+ rawOptions: L
431
+ },
432
+ tokens: y,
433
+ extra: O,
434
+ axes: {
435
+ y: c,
436
+ y1: s
437
+ }
438
+ }), t[7] = m, t[8] = r, t[9] = d, t[10] = h, t[11] = p, t[12] = g, t[13] = L, t[14] = n, t[15] = x, t[16] = u, t[17] = y, t[18] = R, t[19] = s, t[20] = c, t[21] = A;
439
+ } else
440
+ A = t[21];
441
+ const B = A;
442
+ let D;
443
+ t[22] !== r ? (D = le(r), t[22] = r, t[23] = D) : D = t[23];
444
+ let k;
445
+ t[24] !== C || t[25] !== B || t[26] !== P ? (k = /* @__PURE__ */ j.jsx(M, { kind: "bar", data: C, options: B, plugins: P }), t[24] = C, t[25] = B, t[26] = P, t[27] = k) : k = t[27];
446
+ let w;
447
+ return t[28] !== G || t[29] !== v || t[30] !== d || t[31] !== E || t[32] !== D || t[33] !== k ? (w = /* @__PURE__ */ j.jsx(I, { height: d, loading: E, empty: v, isEmpty: D, className: G, children: k }), t[28] = G, t[29] = v, t[30] = d, t[31] = E, t[32] = D, t[33] = k, t[34] = w) : w = t[34], w;
448
+ }, ne = (e) => Array.isArray(e) ? e.length === 0 : e.series.length === 0, fe = (e) => {
449
+ const t = _.c(34), {
450
+ data: r,
451
+ area: o,
452
+ tension: n,
453
+ pointStyle: a,
454
+ lineWidth: l,
455
+ yAxis: c,
456
+ y1Axis: s,
457
+ colors: i,
458
+ title: u,
459
+ legend: h,
460
+ height: d,
461
+ aspectRatio: m,
462
+ padding: g,
463
+ loading: E,
464
+ empty: v,
465
+ className: G,
466
+ valueLabel: R,
467
+ options: p,
468
+ rawOptions: L,
469
+ plugins: P
470
+ } = e;
471
+ let T;
472
+ t[0] !== i || t[1] !== a || t[2] !== n ? (T = {
473
+ colors: i,
474
+ tension: n,
475
+ pointStyle: a
476
+ }, t[0] = i, t[1] = a, t[2] = n, t[3] = T) : T = t[3];
477
+ const f = K("line", T), b = V();
478
+ let y;
479
+ t[4] !== o || t[5] !== r || t[6] !== l || t[7] !== f ? (y = rt(r, f, {
480
+ area: o,
481
+ tension: W("tension", f) ?? 0.4,
482
+ pointStyle: W("pointStyle", f),
483
+ lineWidth: l
484
+ }), t[4] = o, t[5] = r, t[6] = l, t[7] = f, t[8] = y) : y = t[8];
485
+ const C = y, x = h ?? (Array.isArray(r) ? !1 : void 0);
486
+ let A;
487
+ t[9] !== m || t[10] !== d || t[11] !== x || t[12] !== p || t[13] !== g || t[14] !== L || t[15] !== u || t[16] !== b || t[17] !== R || t[18] !== s || t[19] !== c ? (A = z({
488
+ kind: "line",
489
+ base: {
490
+ title: u,
491
+ legend: x,
492
+ height: d,
493
+ aspectRatio: m,
494
+ padding: g,
495
+ valueLabel: R,
496
+ options: p,
497
+ rawOptions: L
23
498
  },
24
- title: {
25
- display: !0,
26
- text: "Chart.js Chart"
499
+ tokens: b,
500
+ axes: {
501
+ y: c,
502
+ y1: s
27
503
  }
504
+ }), t[9] = m, t[10] = d, t[11] = x, t[12] = p, t[13] = g, t[14] = L, t[15] = u, t[16] = b, t[17] = R, t[18] = s, t[19] = c, t[20] = A) : A = t[20];
505
+ const B = A;
506
+ let D;
507
+ t[21] !== r ? (D = ne(r), t[21] = r, t[22] = D) : D = t[22];
508
+ let k;
509
+ t[23] !== C || t[24] !== B || t[25] !== P ? (k = /* @__PURE__ */ j.jsx(M, { kind: "line", data: C, options: B, plugins: P }), t[23] = C, t[24] = B, t[25] = P, t[26] = k) : k = t[26];
510
+ let w;
511
+ return t[27] !== G || t[28] !== v || t[29] !== d || t[30] !== E || t[31] !== D || t[32] !== k ? (w = /* @__PURE__ */ j.jsx(I, { height: d, loading: E, empty: v, isEmpty: D, className: G, children: k }), t[27] = G, t[28] = v, t[29] = d, t[30] = E, t[31] = D, t[32] = k, t[33] = w) : w = t[33], w;
512
+ }, be = (e) => {
513
+ const t = _.c(26), {
514
+ data: r,
515
+ colors: o,
516
+ title: n,
517
+ legend: a,
518
+ height: l,
519
+ aspectRatio: c,
520
+ padding: s,
521
+ loading: i,
522
+ empty: u,
523
+ className: h,
524
+ valueLabel: d,
525
+ options: m,
526
+ rawOptions: g,
527
+ plugins: E
528
+ } = e;
529
+ let v;
530
+ t[0] !== o ? (v = {
531
+ colors: o
532
+ }, t[0] = o, t[1] = v) : v = t[1];
533
+ const G = K("pie", v), R = V();
534
+ let p;
535
+ t[2] !== r || t[3] !== G ? (p = ct(r, G), t[2] = r, t[3] = G, t[4] = p) : p = t[4];
536
+ const L = p;
537
+ let P;
538
+ t[5] !== c || t[6] !== l || t[7] !== a || t[8] !== m || t[9] !== s || t[10] !== g || t[11] !== n || t[12] !== R || t[13] !== d ? (P = z({
539
+ kind: "pie",
540
+ base: {
541
+ title: n,
542
+ legend: a,
543
+ height: l,
544
+ aspectRatio: c,
545
+ padding: s,
546
+ valueLabel: d,
547
+ options: m,
548
+ rawOptions: g
549
+ },
550
+ tokens: R
551
+ }), t[5] = c, t[6] = l, t[7] = a, t[8] = m, t[9] = s, t[10] = g, t[11] = n, t[12] = R, t[13] = d, t[14] = P) : P = t[14];
552
+ const T = P, f = r.length === 0;
553
+ let b;
554
+ t[15] !== L || t[16] !== T || t[17] !== E ? (b = /* @__PURE__ */ j.jsx(M, { kind: "pie", data: L, options: T, plugins: E }), t[15] = L, t[16] = T, t[17] = E, t[18] = b) : b = t[18];
555
+ let y;
556
+ return t[19] !== h || t[20] !== u || t[21] !== l || t[22] !== i || t[23] !== f || t[24] !== b ? (y = /* @__PURE__ */ j.jsx(I, { height: l, loading: i, empty: u, isEmpty: f, className: h, children: b }), t[19] = h, t[20] = u, t[21] = l, t[22] = i, t[23] = f, t[24] = b, t[25] = y) : y = t[25], y;
557
+ }, ae = (e, t) => ({
558
+ id: "centerTotal",
559
+ afterDraw(r) {
560
+ const {
561
+ ctx: o,
562
+ chartArea: n
563
+ } = r;
564
+ if (!n) return;
565
+ const a = (n.left + n.right) / 2, l = (n.top + n.bottom) / 2;
566
+ o.save(), o.textAlign = "center", o.textBaseline = "middle", o.fillStyle = t, o.font = "600 18px sans-serif", o.fillText(e, a, l), o.restore();
28
567
  }
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];
63
- 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];
568
+ }), Ce = (e) => {
569
+ const t = _.c(56), {
570
+ data: r,
571
+ showTotal: o,
572
+ cutout: n,
573
+ colors: a,
574
+ title: l,
575
+ legend: c,
576
+ height: s,
577
+ aspectRatio: i,
578
+ padding: u,
579
+ loading: h,
580
+ empty: d,
581
+ className: m,
582
+ valueLabel: g,
583
+ options: E,
584
+ rawOptions: v,
585
+ plugins: G
586
+ } = e;
587
+ let R;
588
+ t[0] !== a || t[1] !== n || t[2] !== o ? (R = {
589
+ colors: a,
590
+ cutout: n,
591
+ showTotal: o
592
+ }, t[0] = a, t[1] = n, t[2] = o, t[3] = R) : R = t[3];
593
+ const p = K("doughnut", R), L = V();
594
+ let P;
595
+ t[4] !== p ? (P = W("cutout", p) ?? 0.6, t[4] = p, t[5] = P) : P = t[5];
596
+ const T = P;
67
597
  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];
69
- 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];
598
+ t[6] !== p ? (f = W("showTotal", p) ?? !1, t[6] = p, t[7] = f) : f = t[7];
599
+ const b = f;
600
+ let y, C, x, A;
601
+ if (t[8] !== i || t[9] !== T || t[10] !== r || t[11] !== s || t[12] !== c || t[13] !== E || t[14] !== u || t[15] !== G || t[16] !== v || t[17] !== b || t[18] !== p || t[19] !== l || t[20] !== L || t[21] !== g) {
602
+ const dt = r.reduce(se, 0);
603
+ let H;
604
+ t[26] !== r || t[27] !== p ? (H = ct(r, p), t[26] = r, t[27] = p, t[28] = H) : H = t[28], y = H;
605
+ let q;
606
+ t[29] !== i || t[30] !== T || t[31] !== s || t[32] !== c || t[33] !== E || t[34] !== u || t[35] !== v || t[36] !== l || t[37] !== L || t[38] !== g ? (q = z({
607
+ kind: "doughnut",
608
+ base: {
609
+ title: l,
610
+ legend: c,
611
+ height: s,
612
+ aspectRatio: i,
613
+ padding: u,
614
+ valueLabel: g,
615
+ options: E,
616
+ rawOptions: v
617
+ },
618
+ tokens: L,
619
+ extra: {
620
+ cutout: `${T * 100}%`
621
+ }
622
+ }), t[29] = i, t[30] = T, t[31] = s, t[32] = c, t[33] = E, t[34] = u, t[35] = v, t[36] = l, t[37] = L, t[38] = g, t[39] = q) : q = t[39], C = q, t[40] !== G ? (x = G ?? [], t[40] = G, t[41] = x) : x = t[41], A = b ? [ae(dt.toLocaleString(), L.label)] : [], t[8] = i, t[9] = T, t[10] = r, t[11] = s, t[12] = c, t[13] = E, t[14] = u, t[15] = G, t[16] = v, t[17] = b, t[18] = p, t[19] = l, t[20] = L, t[21] = g, t[22] = y, t[23] = C, t[24] = x, t[25] = A;
623
+ } else
624
+ y = t[22], C = t[23], x = t[24], A = t[25];
625
+ let B;
626
+ t[42] !== x || t[43] !== A ? (B = [...x, ...A], t[42] = x, t[43] = A, t[44] = B) : B = t[44];
627
+ const D = B, k = r.length === 0, w = D.length ? D : void 0;
628
+ let O;
629
+ t[45] !== y || t[46] !== C || t[47] !== w ? (O = /* @__PURE__ */ j.jsx(M, { kind: "doughnut", data: y, options: C, plugins: w }), t[45] = y, t[46] = C, t[47] = w, t[48] = O) : O = t[48];
630
+ let $;
631
+ return t[49] !== m || t[50] !== d || t[51] !== s || t[52] !== h || t[53] !== k || t[54] !== O ? ($ = /* @__PURE__ */ j.jsx(I, { height: s, loading: h, empty: d, isEmpty: k, className: m, children: O }), t[49] = m, t[50] = d, t[51] = s, t[52] = h, t[53] = k, t[54] = O, t[55] = $) : $ = t[55], $;
632
+ };
633
+ function se(e, t) {
634
+ return e + t.value;
635
+ }
636
+ const ie = (e) => Array.isArray(e) ? e.length === 0 : e.series.length === 0, xe = (e) => {
637
+ const t = _.c(30), {
638
+ data: r,
639
+ max: o,
640
+ fill: n,
641
+ colors: a,
642
+ title: l,
643
+ legend: c,
644
+ height: s,
645
+ aspectRatio: i,
646
+ padding: u,
647
+ loading: h,
648
+ empty: d,
649
+ className: m,
650
+ valueLabel: g,
651
+ options: E,
652
+ rawOptions: v,
653
+ plugins: G
654
+ } = e, R = n === void 0 ? !0 : n;
73
655
  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];
75
- 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];
77
- 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];
79
- 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;
656
+ t[0] !== a ? (p = {
657
+ colors: a
658
+ }, t[0] = a, t[1] = p) : p = t[1];
659
+ const L = K("radar", p), P = V();
660
+ let T;
661
+ t[2] !== r || t[3] !== R || t[4] !== L ? (T = rt(r, L, {
662
+ area: R
663
+ }), t[2] = r, t[3] = R, t[4] = L, t[5] = T) : T = t[5];
664
+ const f = T, b = c ?? (Array.isArray(r) ? !1 : void 0);
665
+ let y;
666
+ if (t[6] !== i || t[7] !== s || t[8] !== b || t[9] !== o || t[10] !== E || t[11] !== u || t[12] !== v || t[13] !== l || t[14] !== P || t[15] !== g) {
667
+ const D = o != null ? {
668
+ scales: {
669
+ r: {
670
+ suggestedMax: o
671
+ }
672
+ }
673
+ } : {};
674
+ y = z({
675
+ kind: "radar",
676
+ base: {
677
+ title: l,
678
+ legend: b,
679
+ height: s,
680
+ aspectRatio: i,
681
+ padding: u,
682
+ valueLabel: g,
683
+ options: E,
684
+ rawOptions: v
685
+ },
686
+ tokens: P,
687
+ extra: D
688
+ }), t[6] = i, t[7] = s, t[8] = b, t[9] = o, t[10] = E, t[11] = u, t[12] = v, t[13] = l, t[14] = P, t[15] = g, t[16] = y;
689
+ } else
690
+ y = t[16];
691
+ const C = y;
692
+ let x;
693
+ t[17] !== r ? (x = ie(r), t[17] = r, t[18] = x) : x = t[18];
694
+ let A;
695
+ t[19] !== f || t[20] !== C || t[21] !== G ? (A = /* @__PURE__ */ j.jsx(M, { kind: "radar", data: f, options: C, plugins: G }), t[19] = f, t[20] = C, t[21] = G, t[22] = A) : A = t[22];
696
+ let B;
697
+ return t[23] !== m || t[24] !== d || t[25] !== s || t[26] !== h || t[27] !== x || t[28] !== A ? (B = /* @__PURE__ */ j.jsx(I, { height: s, loading: h, empty: d, isEmpty: x, className: m, children: A }), t[23] = m, t[24] = d, t[25] = s, t[26] = h, t[27] = x, t[28] = A, t[29] = B) : B = t[29], B;
698
+ }, Ae = (e) => {
699
+ const t = _.c(3), {
700
+ value: r,
701
+ children: o
702
+ } = e;
703
+ let n;
704
+ return t[0] !== o || t[1] !== r ? (n = /* @__PURE__ */ j.jsx(it, { value: r, children: o }), t[0] = o, t[1] = r, t[2] = n) : n = t[2], n;
91
705
  };
92
706
  export {
93
- be as Chart
707
+ ye as BarChart,
708
+ Ae as ChartThemeProvider,
709
+ Ce as DoughnutChart,
710
+ fe as LineChart,
711
+ be as PieChart,
712
+ xe as RadarChart
94
713
  };