tekivex-ui 2.5.11 → 2.5.12

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 (46) hide show
  1. package/dist/TkxForm-1KDzoniV.cjs +12 -0
  2. package/dist/TkxForm-9-W3Nl6m.js +314 -0
  3. package/dist/charts.cjs +1 -1
  4. package/dist/charts.js +543 -507
  5. package/dist/chunk-Bmb41Sf3.cjs +1 -0
  6. package/dist/headless.cjs +1 -1
  7. package/dist/headless.js +428 -447
  8. package/dist/hooks-6pRsPOyG.js +58 -0
  9. package/dist/hooks-mivgRljH.cjs +1 -0
  10. package/dist/i18n.cjs +1 -1
  11. package/dist/i18n.js +728 -752
  12. package/dist/index.cjs +26 -26
  13. package/dist/index.js +16102 -16619
  14. package/dist/quantum.cjs +14 -16
  15. package/dist/quantum.js +2473 -2279
  16. package/dist/realtime.cjs +4 -10
  17. package/dist/realtime.js +804 -958
  18. package/dist/src/components/TkxClock.d.ts.map +1 -1
  19. package/dist/src/components/TkxForm.d.ts.map +1 -1
  20. package/dist/src/components/TkxLiveFeed.d.ts +1 -1
  21. package/dist/src/components/TkxLiveLog.d.ts +1 -1
  22. package/dist/src/components/TkxRealTimeChart.d.ts +1 -1
  23. package/dist/src/components/TkxTooltip.d.ts.map +1 -1
  24. package/dist/src/components/TkxTypography.d.ts +5 -5
  25. package/dist/src/components/TkxTypography.d.ts.map +1 -1
  26. package/dist/tekivex-ui.css +2 -0
  27. package/dist/themes-BbJanqiC.js +498 -0
  28. package/dist/themes-CMq2vWXj.cjs +2 -0
  29. package/dist/tkx-0oAwZqgL.cjs +4 -0
  30. package/dist/tkx-DQkvHdE5.js +1172 -0
  31. package/package.json +16 -16
  32. package/src/components/TkxClock.tsx +2 -2
  33. package/src/components/TkxForm.tsx +4 -2
  34. package/src/components/TkxTooltip.tsx +7 -5
  35. package/src/components/TkxTypography.tsx +2 -2
  36. package/dist/TkxForm-2tGLCPH6.js +0 -326
  37. package/dist/TkxForm-C2VqR2wC.cjs +0 -12
  38. package/dist/index-BgHMZe4Z.js +0 -66
  39. package/dist/index-Bt5y50Qa.cjs +0 -1
  40. package/dist/index-DnqXtpwV.cjs +0 -2
  41. package/dist/index-iUUHRxqJ.js +0 -515
  42. package/dist/security-C-ZPGoyG.js +0 -97
  43. package/dist/security-Uf0mjv8o.cjs +0 -1
  44. package/dist/style.css +0 -1
  45. package/dist/tkx-BtHzWKTl.js +0 -1112
  46. package/dist/tkx-C7GvVUE9.cjs +0 -4
package/dist/charts.js CHANGED
@@ -1,516 +1,552 @@
1
- import { jsx as t, jsxs as g, Fragment as R } from "react/jsx-runtime";
2
- import { ResponsiveContainer as v, AreaChart as E, CartesianGrid as D, XAxis as F, YAxis as K, Tooltip as L, Legend as w, Area as G, BarChart as q, Bar as H, LineChart as N, ReferenceLine as U, Line as V, PieChart as P, Pie as B, Cell as I, ScatterChart as X, ZAxis as Y, Scatter as Z, RadarChart as _, PolarGrid as J, PolarAngleAxis as Q, PolarRadiusAxis as tt, Radar as et } from "recharts";
3
- import { u as z } from "./index-iUUHRxqJ.js";
4
- import { useState as O, useEffect as $ } from "react";
5
- import { u as j } from "./index-BgHMZe4Z.js";
6
- function M(e) {
7
- return [
8
- e.primary,
9
- e.secondary,
10
- e.info,
11
- e.success,
12
- e.warning,
13
- e.danger,
14
- e.primary + "aa",
15
- // primary at 67% opacity
16
- e.secondary + "aa",
17
- // secondary at 67% opacity
18
- e.info + "aa",
19
- // info at 67% opacity
20
- e.success + "aa"
21
- // success at 67% opacity
22
- ];
1
+ import { f as e } from "./themes-BbJanqiC.js";
2
+ import { o as t } from "./hooks-6pRsPOyG.js";
3
+ import { useEffect as n, useState as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ import { Area as s, AreaChart as c, Bar as l, BarChart as u, CartesianGrid as d, Cell as f, Legend as p, Line as m, LineChart as h, Pie as g, PieChart as _, PolarAngleAxis as v, PolarGrid as y, PolarRadiusAxis as b, Radar as x, RadarChart as S, ReferenceLine as C, ResponsiveContainer as w, Scatter as T, ScatterChart as E, Tooltip as D, XAxis as O, YAxis as k, ZAxis as A } from "recharts";
6
+ //#region src/charts/shared.ts
7
+ function j(e) {
8
+ return [
9
+ e.primary,
10
+ e.secondary,
11
+ e.info,
12
+ e.success,
13
+ e.warning,
14
+ e.danger,
15
+ e.primary + "aa",
16
+ e.secondary + "aa",
17
+ e.info + "aa",
18
+ e.success + "aa"
19
+ ];
23
20
  }
24
- const T = { top: 10, right: 30, bottom: 10, left: 0 };
25
- function C(e) {
26
- return {
27
- contentStyle: {
28
- backgroundColor: e.surface,
29
- border: `1px solid ${e.border}`,
30
- borderRadius: 8,
31
- boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
32
- color: e.text,
33
- fontSize: 13
34
- },
35
- labelStyle: { color: e.textMuted, fontWeight: 600, marginBottom: 4 },
36
- itemStyle: { color: e.text },
37
- cursor: { fill: `${e.primary}15` }
38
- };
21
+ var M = {
22
+ top: 10,
23
+ right: 30,
24
+ bottom: 10,
25
+ left: 0
26
+ };
27
+ function N(e) {
28
+ return {
29
+ contentStyle: {
30
+ backgroundColor: e.surface,
31
+ border: `1px solid ${e.border}`,
32
+ borderRadius: 8,
33
+ boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
34
+ color: e.text,
35
+ fontSize: 13
36
+ },
37
+ labelStyle: {
38
+ color: e.textMuted,
39
+ fontWeight: 600,
40
+ marginBottom: 4
41
+ },
42
+ itemStyle: { color: e.text },
43
+ cursor: { fill: `${e.primary}15` }
44
+ };
39
45
  }
40
- function nt({
41
- data: e,
42
- series: S,
43
- xKey: f,
44
- height: p = 300,
45
- margin: d = T,
46
- showGrid: y = !0,
47
- showLegend: m = !0,
48
- showTooltip: x = !0,
49
- smooth: a = !0,
50
- xTickFormatter: u,
51
- yTickFormatter: o,
52
- yDomain: l,
53
- ariaLabel: h = "Area chart"
54
- }) {
55
- const r = z(), n = M(r), i = C(r), k = { fill: r.textMuted, fontSize: 12 };
56
- return /* @__PURE__ */ t("div", { role: "img", "aria-label": h, style: { width: "100%", height: p }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(E, { data: e, margin: d, children: [
57
- y && /* @__PURE__ */ t(D, { strokeDasharray: "3 3", stroke: r.border, vertical: !1 }),
58
- /* @__PURE__ */ t(
59
- F,
60
- {
61
- dataKey: f,
62
- tick: k,
63
- axisLine: { stroke: r.border },
64
- tickLine: !1,
65
- tickFormatter: u
66
- }
67
- ),
68
- /* @__PURE__ */ t(
69
- K,
70
- {
71
- tick: k,
72
- axisLine: !1,
73
- tickLine: !1,
74
- tickFormatter: o,
75
- domain: l
76
- }
77
- ),
78
- x && /* @__PURE__ */ t(
79
- L,
80
- {
81
- contentStyle: i.contentStyle,
82
- labelStyle: i.labelStyle,
83
- itemStyle: i.itemStyle,
84
- cursor: i.cursor
85
- }
86
- ),
87
- m && /* @__PURE__ */ t(
88
- w,
89
- {
90
- wrapperStyle: { fontSize: 13, color: r.textMuted, paddingTop: 8 }
91
- }
92
- ),
93
- S.map((s, b) => {
94
- const c = s.color ?? n[b % n.length];
95
- return /* @__PURE__ */ t(
96
- G,
97
- {
98
- type: a ? "monotone" : "linear",
99
- dataKey: s.key,
100
- name: s.label ?? s.key,
101
- stroke: c,
102
- strokeWidth: 2,
103
- fill: c,
104
- fillOpacity: s.fillOpacity ?? 0.2,
105
- stackId: s.stacked ? "stack" : void 0,
106
- dot: !1,
107
- activeDot: { r: 5, strokeWidth: 0 }
108
- },
109
- s.key
110
- );
111
- })
112
- ] }) }) });
46
+ //#endregion
47
+ //#region src/charts/TkxAreaChart.tsx
48
+ function P({ data: t, series: n, xKey: r, height: i = 300, margin: l = M, showGrid: u = !0, showLegend: f = !0, showTooltip: m = !0, smooth: h = !0, xTickFormatter: g, yTickFormatter: _, yDomain: v, ariaLabel: y = "Area chart" }) {
49
+ let b = e(), x = j(b), S = N(b), C = {
50
+ fill: b.textMuted,
51
+ fontSize: 12
52
+ };
53
+ return /* @__PURE__ */ a("div", {
54
+ role: "img",
55
+ "aria-label": y,
56
+ style: {
57
+ width: "100%",
58
+ height: i
59
+ },
60
+ children: /* @__PURE__ */ a(w, {
61
+ width: "100%",
62
+ height: "100%",
63
+ children: /* @__PURE__ */ o(c, {
64
+ data: t,
65
+ margin: l,
66
+ children: [
67
+ u && /* @__PURE__ */ a(d, {
68
+ strokeDasharray: "3 3",
69
+ stroke: b.border,
70
+ vertical: !1
71
+ }),
72
+ /* @__PURE__ */ a(O, {
73
+ dataKey: r,
74
+ tick: C,
75
+ axisLine: { stroke: b.border },
76
+ tickLine: !1,
77
+ tickFormatter: g
78
+ }),
79
+ /* @__PURE__ */ a(k, {
80
+ tick: C,
81
+ axisLine: !1,
82
+ tickLine: !1,
83
+ tickFormatter: _,
84
+ domain: v
85
+ }),
86
+ m && /* @__PURE__ */ a(D, {
87
+ contentStyle: S.contentStyle,
88
+ labelStyle: S.labelStyle,
89
+ itemStyle: S.itemStyle,
90
+ cursor: S.cursor
91
+ }),
92
+ f && /* @__PURE__ */ a(p, { wrapperStyle: {
93
+ fontSize: 13,
94
+ color: b.textMuted,
95
+ paddingTop: 8
96
+ } }),
97
+ n.map((e, t) => {
98
+ let n = e.color ?? x[t % x.length];
99
+ return /* @__PURE__ */ a(s, {
100
+ type: h ? "monotone" : "linear",
101
+ dataKey: e.key,
102
+ name: e.label ?? e.key,
103
+ stroke: n,
104
+ strokeWidth: 2,
105
+ fill: n,
106
+ fillOpacity: e.fillOpacity ?? .2,
107
+ stackId: e.stacked ? "stack" : void 0,
108
+ dot: !1,
109
+ activeDot: {
110
+ r: 5,
111
+ strokeWidth: 0
112
+ }
113
+ }, e.key);
114
+ })
115
+ ]
116
+ })
117
+ })
118
+ });
113
119
  }
114
- function ct({
115
- data: e,
116
- series: S,
117
- xKey: f,
118
- height: p = 300,
119
- margin: d = T,
120
- showGrid: y = !0,
121
- showLegend: m = !0,
122
- showTooltip: x = !0,
123
- layout: a = "horizontal",
124
- barSize: u,
125
- xTickFormatter: o,
126
- yTickFormatter: l,
127
- ariaLabel: h = "Bar chart"
128
- }) {
129
- const r = z(), n = M(r), i = C(r), k = { fill: r.textMuted, fontSize: 12 }, s = a === "vertical";
130
- return /* @__PURE__ */ t("div", { role: "img", "aria-label": h, style: { width: "100%", height: p }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(q, { data: e, margin: d, layout: a, children: [
131
- y && /* @__PURE__ */ t(
132
- D,
133
- {
134
- strokeDasharray: "3 3",
135
- stroke: r.border,
136
- vertical: s,
137
- horizontal: !s
138
- }
139
- ),
140
- s ? /* @__PURE__ */ g(R, { children: [
141
- /* @__PURE__ */ t(K, { dataKey: f, type: "category", tick: k, axisLine: !1, tickLine: !1, tickFormatter: o, width: 100 }),
142
- /* @__PURE__ */ t(F, { type: "number", tick: k, axisLine: { stroke: r.border }, tickLine: !1, tickFormatter: l })
143
- ] }) : /* @__PURE__ */ g(R, { children: [
144
- /* @__PURE__ */ t(F, { dataKey: f, tick: k, axisLine: { stroke: r.border }, tickLine: !1, tickFormatter: o }),
145
- /* @__PURE__ */ t(K, { tick: k, axisLine: !1, tickLine: !1, tickFormatter: l })
146
- ] }),
147
- x && /* @__PURE__ */ t(
148
- L,
149
- {
150
- contentStyle: i.contentStyle,
151
- labelStyle: i.labelStyle,
152
- itemStyle: i.itemStyle,
153
- cursor: { fill: `${r.surfaceAlt}` }
154
- }
155
- ),
156
- m && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: r.textMuted, paddingTop: 8 } }),
157
- S.map((b, c) => {
158
- const A = b.color ?? n[c % n.length];
159
- return /* @__PURE__ */ t(
160
- H,
161
- {
162
- dataKey: b.key,
163
- name: b.label ?? b.key,
164
- fill: A,
165
- stackId: b.stackId,
166
- maxBarSize: u ?? 40,
167
- radius: b.radius ?? [4, 4, 0, 0]
168
- },
169
- b.key
170
- );
171
- })
172
- ] }) }) });
120
+ //#endregion
121
+ //#region src/charts/TkxBarChart.tsx
122
+ function F({ data: t, series: n, xKey: r, height: s = 300, margin: c = M, showGrid: f = !0, showLegend: m = !0, showTooltip: h = !0, layout: g = "horizontal", barSize: _, xTickFormatter: v, yTickFormatter: y, ariaLabel: b = "Bar chart" }) {
123
+ let x = e(), S = j(x), C = N(x), T = {
124
+ fill: x.textMuted,
125
+ fontSize: 12
126
+ }, E = g === "vertical";
127
+ return /* @__PURE__ */ a("div", {
128
+ role: "img",
129
+ "aria-label": b,
130
+ style: {
131
+ width: "100%",
132
+ height: s
133
+ },
134
+ children: /* @__PURE__ */ a(w, {
135
+ width: "100%",
136
+ height: "100%",
137
+ children: /* @__PURE__ */ o(u, {
138
+ data: t,
139
+ margin: c,
140
+ layout: g,
141
+ children: [
142
+ f && /* @__PURE__ */ a(d, {
143
+ strokeDasharray: "3 3",
144
+ stroke: x.border,
145
+ vertical: E,
146
+ horizontal: !E
147
+ }),
148
+ E ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(k, {
149
+ dataKey: r,
150
+ type: "category",
151
+ tick: T,
152
+ axisLine: !1,
153
+ tickLine: !1,
154
+ tickFormatter: v,
155
+ width: 100
156
+ }), /* @__PURE__ */ a(O, {
157
+ type: "number",
158
+ tick: T,
159
+ axisLine: { stroke: x.border },
160
+ tickLine: !1,
161
+ tickFormatter: y
162
+ })] }) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(O, {
163
+ dataKey: r,
164
+ tick: T,
165
+ axisLine: { stroke: x.border },
166
+ tickLine: !1,
167
+ tickFormatter: v
168
+ }), /* @__PURE__ */ a(k, {
169
+ tick: T,
170
+ axisLine: !1,
171
+ tickLine: !1,
172
+ tickFormatter: y
173
+ })] }),
174
+ h && /* @__PURE__ */ a(D, {
175
+ contentStyle: C.contentStyle,
176
+ labelStyle: C.labelStyle,
177
+ itemStyle: C.itemStyle,
178
+ cursor: { fill: `${x.surfaceAlt}` }
179
+ }),
180
+ m && /* @__PURE__ */ a(p, { wrapperStyle: {
181
+ fontSize: 13,
182
+ color: x.textMuted,
183
+ paddingTop: 8
184
+ } }),
185
+ n.map((e, t) => {
186
+ let n = e.color ?? S[t % S.length];
187
+ return /* @__PURE__ */ a(l, {
188
+ dataKey: e.key,
189
+ name: e.label ?? e.key,
190
+ fill: n,
191
+ stackId: e.stackId,
192
+ maxBarSize: _ ?? 40,
193
+ radius: e.radius ?? [
194
+ 4,
195
+ 4,
196
+ 0,
197
+ 0
198
+ ]
199
+ }, e.key);
200
+ })
201
+ ]
202
+ })
203
+ })
204
+ });
173
205
  }
174
- function dt({
175
- data: e,
176
- series: S,
177
- xKey: f,
178
- height: p = 300,
179
- margin: d = T,
180
- showGrid: y = !0,
181
- showLegend: m = !0,
182
- showTooltip: x = !0,
183
- smooth: a = !0,
184
- referenceLines: u = [],
185
- xTickFormatter: o,
186
- yTickFormatter: l,
187
- yDomain: h,
188
- connectNulls: r = !1,
189
- ariaLabel: n = "Line chart"
190
- }) {
191
- const i = z(), k = M(i), s = C(i), b = { fill: i.textMuted, fontSize: 12 };
192
- return /* @__PURE__ */ t("div", { role: "img", "aria-label": n, style: { width: "100%", height: p }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(N, { data: e, margin: d, children: [
193
- y && /* @__PURE__ */ t(D, { strokeDasharray: "3 3", stroke: i.border, vertical: !1 }),
194
- /* @__PURE__ */ t(
195
- F,
196
- {
197
- dataKey: f,
198
- tick: b,
199
- axisLine: { stroke: i.border },
200
- tickLine: !1,
201
- tickFormatter: o
202
- }
203
- ),
204
- /* @__PURE__ */ t(
205
- K,
206
- {
207
- tick: b,
208
- axisLine: !1,
209
- tickLine: !1,
210
- tickFormatter: l,
211
- domain: h
212
- }
213
- ),
214
- x && /* @__PURE__ */ t(
215
- L,
216
- {
217
- contentStyle: s.contentStyle,
218
- labelStyle: s.labelStyle,
219
- itemStyle: s.itemStyle,
220
- cursor: { stroke: i.border, strokeWidth: 1 }
221
- }
222
- ),
223
- m && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: i.textMuted, paddingTop: 8 } }),
224
- u.map((c, A) => /* @__PURE__ */ t(
225
- U,
226
- {
227
- y: c.y,
228
- x: c.x,
229
- label: c.label ? { value: c.label, fill: i.textMuted, fontSize: 11 } : void 0,
230
- stroke: c.color ?? i.border,
231
- strokeDasharray: c.dashed ? "4 4" : void 0
232
- },
233
- A
234
- )),
235
- S.map((c, A) => {
236
- const W = c.color ?? k[A % k.length];
237
- return /* @__PURE__ */ t(
238
- V,
239
- {
240
- type: a ? "monotone" : "linear",
241
- dataKey: c.key,
242
- name: c.label ?? c.key,
243
- stroke: W,
244
- strokeWidth: c.strokeWidth ?? 2,
245
- strokeDasharray: c.dashed ? "6 3" : void 0,
246
- dot: c.dot ?? !1,
247
- activeDot: { r: 5, strokeWidth: 0, fill: W },
248
- connectNulls: r
249
- },
250
- c.key
251
- );
252
- })
253
- ] }) }) });
206
+ //#endregion
207
+ //#region src/charts/TkxLineChart.tsx
208
+ function I({ data: t, series: n, xKey: r, height: i = 300, margin: s = M, showGrid: c = !0, showLegend: l = !0, showTooltip: u = !0, smooth: f = !0, referenceLines: g = [], xTickFormatter: _, yTickFormatter: v, yDomain: y, connectNulls: b = !1, ariaLabel: x = "Line chart" }) {
209
+ let S = e(), T = j(S), E = N(S), A = {
210
+ fill: S.textMuted,
211
+ fontSize: 12
212
+ };
213
+ return /* @__PURE__ */ a("div", {
214
+ role: "img",
215
+ "aria-label": x,
216
+ style: {
217
+ width: "100%",
218
+ height: i
219
+ },
220
+ children: /* @__PURE__ */ a(w, {
221
+ width: "100%",
222
+ height: "100%",
223
+ children: /* @__PURE__ */ o(h, {
224
+ data: t,
225
+ margin: s,
226
+ children: [
227
+ c && /* @__PURE__ */ a(d, {
228
+ strokeDasharray: "3 3",
229
+ stroke: S.border,
230
+ vertical: !1
231
+ }),
232
+ /* @__PURE__ */ a(O, {
233
+ dataKey: r,
234
+ tick: A,
235
+ axisLine: { stroke: S.border },
236
+ tickLine: !1,
237
+ tickFormatter: _
238
+ }),
239
+ /* @__PURE__ */ a(k, {
240
+ tick: A,
241
+ axisLine: !1,
242
+ tickLine: !1,
243
+ tickFormatter: v,
244
+ domain: y
245
+ }),
246
+ u && /* @__PURE__ */ a(D, {
247
+ contentStyle: E.contentStyle,
248
+ labelStyle: E.labelStyle,
249
+ itemStyle: E.itemStyle,
250
+ cursor: {
251
+ stroke: S.border,
252
+ strokeWidth: 1
253
+ }
254
+ }),
255
+ l && /* @__PURE__ */ a(p, { wrapperStyle: {
256
+ fontSize: 13,
257
+ color: S.textMuted,
258
+ paddingTop: 8
259
+ } }),
260
+ g.map((e, t) => /* @__PURE__ */ a(C, {
261
+ y: e.y,
262
+ x: e.x,
263
+ label: e.label ? {
264
+ value: e.label,
265
+ fill: S.textMuted,
266
+ fontSize: 11
267
+ } : void 0,
268
+ stroke: e.color ?? S.border,
269
+ strokeDasharray: e.dashed ? "4 4" : void 0
270
+ }, t)),
271
+ n.map((e, t) => {
272
+ let n = e.color ?? T[t % T.length];
273
+ return /* @__PURE__ */ a(m, {
274
+ type: f ? "monotone" : "linear",
275
+ dataKey: e.key,
276
+ name: e.label ?? e.key,
277
+ stroke: n,
278
+ strokeWidth: e.strokeWidth ?? 2,
279
+ strokeDasharray: e.dashed ? "6 3" : void 0,
280
+ dot: e.dot ?? !1,
281
+ activeDot: {
282
+ r: 5,
283
+ strokeWidth: 0,
284
+ fill: n
285
+ },
286
+ connectNulls: b
287
+ }, e.key);
288
+ })
289
+ ]
290
+ })
291
+ })
292
+ });
254
293
  }
255
- function st({
256
- data: e,
257
- height: S = 300,
258
- showLegend: f = !0,
259
- showTooltip: p = !0,
260
- showLabels: d = !1,
261
- outerRadius: y = "70%",
262
- startAngle: m = 90,
263
- ariaLabel: x = "Pie chart"
264
- }) {
265
- const a = z(), u = j(), o = M(a), l = C(a), [h, r] = O(u);
266
- return $(() => {
267
- if (u) {
268
- r(!0);
269
- return;
270
- }
271
- const n = requestAnimationFrame(() => r(!0));
272
- return () => cancelAnimationFrame(n);
273
- }, [u]), /* @__PURE__ */ t(
274
- "div",
275
- {
276
- role: "img",
277
- "aria-label": x,
278
- style: { width: "100%", minWidth: 240, height: S, position: "relative" },
279
- children: h && /* @__PURE__ */ t(v, { width: "100%", height: "100%", debounce: 50, children: /* @__PURE__ */ g(P, { children: [
280
- p && /* @__PURE__ */ t(
281
- L,
282
- {
283
- contentStyle: l.contentStyle,
284
- labelStyle: l.labelStyle,
285
- itemStyle: l.itemStyle
286
- }
287
- ),
288
- f && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: a.textMuted } }),
289
- /* @__PURE__ */ t(
290
- B,
291
- {
292
- data: e,
293
- dataKey: "value",
294
- nameKey: "name",
295
- outerRadius: y,
296
- startAngle: m,
297
- endAngle: m - 360,
298
- label: d ? ({ name: n, percent: i }) => `${n} (${(i * 100).toFixed(0)}%)` : void 0,
299
- labelLine: d,
300
- strokeWidth: 2,
301
- stroke: a.bg,
302
- children: e.map((n, i) => /* @__PURE__ */ t(
303
- I,
304
- {
305
- fill: n.color ?? o[i % o.length]
306
- },
307
- n.name
308
- ))
309
- }
310
- )
311
- ] }) })
312
- }
313
- );
294
+ //#endregion
295
+ //#region src/charts/TkxPieChart.tsx
296
+ function L({ data: i, height: s = 300, showLegend: c = !0, showTooltip: l = !0, showLabels: u = !1, outerRadius: d = "70%", startAngle: m = 90, ariaLabel: h = "Pie chart" }) {
297
+ let v = e(), y = t(), b = j(v), x = N(v), [S, C] = r(y);
298
+ return n(() => {
299
+ if (y) {
300
+ C(!0);
301
+ return;
302
+ }
303
+ let e = requestAnimationFrame(() => C(!0));
304
+ return () => cancelAnimationFrame(e);
305
+ }, [y]), /* @__PURE__ */ a("div", {
306
+ role: "img",
307
+ "aria-label": h,
308
+ style: {
309
+ width: "100%",
310
+ minWidth: 240,
311
+ height: s,
312
+ position: "relative"
313
+ },
314
+ children: S && /* @__PURE__ */ a(w, {
315
+ width: "100%",
316
+ height: "100%",
317
+ debounce: 50,
318
+ children: /* @__PURE__ */ o(_, { children: [
319
+ l && /* @__PURE__ */ a(D, {
320
+ contentStyle: x.contentStyle,
321
+ labelStyle: x.labelStyle,
322
+ itemStyle: x.itemStyle
323
+ }),
324
+ c && /* @__PURE__ */ a(p, { wrapperStyle: {
325
+ fontSize: 13,
326
+ color: v.textMuted
327
+ } }),
328
+ /* @__PURE__ */ a(g, {
329
+ data: i,
330
+ dataKey: "value",
331
+ nameKey: "name",
332
+ outerRadius: d,
333
+ startAngle: m,
334
+ endAngle: m - 360,
335
+ label: u ? ({ name: e, percent: t }) => `${e} (${(t * 100).toFixed(0)}%)` : void 0,
336
+ labelLine: u,
337
+ strokeWidth: 2,
338
+ stroke: v.bg,
339
+ children: i.map((e, t) => /* @__PURE__ */ a(f, { fill: e.color ?? b[t % b.length] }, e.name))
340
+ })
341
+ ] })
342
+ })
343
+ });
314
344
  }
315
- function yt({
316
- data: e,
317
- height: S = 300,
318
- showLegend: f = !0,
319
- showTooltip: p = !0,
320
- centerLabel: d,
321
- centerSublabel: y,
322
- innerRadius: m = "55%",
323
- outerRadius: x = "75%",
324
- startAngle: a = 90,
325
- ariaLabel: u = "Donut chart"
326
- }) {
327
- const o = z(), l = j(), h = M(o), r = C(o), [n, i] = O(l);
328
- return $(() => {
329
- if (l) {
330
- i(!0);
331
- return;
332
- }
333
- const k = requestAnimationFrame(() => i(!0));
334
- return () => cancelAnimationFrame(k);
335
- }, [l]), /* @__PURE__ */ g(
336
- "div",
337
- {
338
- role: "img",
339
- "aria-label": u,
340
- style: { width: "100%", minWidth: 240, height: S, position: "relative" },
341
- children: [
342
- n && /* @__PURE__ */ t(v, { width: "100%", height: "100%", debounce: 50, children: /* @__PURE__ */ g(P, { children: [
343
- p && /* @__PURE__ */ t(
344
- L,
345
- {
346
- contentStyle: r.contentStyle,
347
- labelStyle: r.labelStyle,
348
- itemStyle: r.itemStyle
349
- }
350
- ),
351
- f && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: o.textMuted } }),
352
- /* @__PURE__ */ t(
353
- B,
354
- {
355
- data: e,
356
- dataKey: "value",
357
- nameKey: "name",
358
- innerRadius: m,
359
- outerRadius: x,
360
- startAngle: a,
361
- endAngle: a - 360,
362
- strokeWidth: 3,
363
- stroke: o.bg,
364
- label: !1,
365
- labelLine: !1,
366
- children: e.map((k, s) => /* @__PURE__ */ t(I, { fill: k.color ?? h[s % h.length] }, k.name))
367
- }
368
- ),
369
- (d || y) && /* @__PURE__ */ t("text", {})
370
- ] }) }),
371
- (d || y) && /* @__PURE__ */ g(
372
- "div",
373
- {
374
- style: {
375
- position: "absolute",
376
- inset: 0,
377
- display: "flex",
378
- flexDirection: "column",
379
- alignItems: "center",
380
- justifyContent: "center",
381
- pointerEvents: "none",
382
- marginTop: f ? -24 : 0
383
- },
384
- children: [
385
- d && /* @__PURE__ */ t("span", { style: { fontSize: 22, fontWeight: 700, color: o.text, lineHeight: 1 }, children: d }),
386
- y && /* @__PURE__ */ t("span", { style: { fontSize: 13, color: o.textMuted, marginTop: 4 }, children: y })
387
- ]
388
- }
389
- )
390
- ]
391
- }
392
- );
345
+ //#endregion
346
+ //#region src/charts/TkxDonutChart.tsx
347
+ function R({ data: i, height: s = 300, showLegend: c = !0, showTooltip: l = !0, centerLabel: u, centerSublabel: d, innerRadius: m = "55%", outerRadius: h = "75%", startAngle: v = 90, ariaLabel: y = "Donut chart" }) {
348
+ let b = e(), x = t(), S = j(b), C = N(b), [T, E] = r(x);
349
+ return n(() => {
350
+ if (x) {
351
+ E(!0);
352
+ return;
353
+ }
354
+ let e = requestAnimationFrame(() => E(!0));
355
+ return () => cancelAnimationFrame(e);
356
+ }, [x]), /* @__PURE__ */ o("div", {
357
+ role: "img",
358
+ "aria-label": y,
359
+ style: {
360
+ width: "100%",
361
+ minWidth: 240,
362
+ height: s,
363
+ position: "relative"
364
+ },
365
+ children: [T && /* @__PURE__ */ a(w, {
366
+ width: "100%",
367
+ height: "100%",
368
+ debounce: 50,
369
+ children: /* @__PURE__ */ o(_, { children: [
370
+ l && /* @__PURE__ */ a(D, {
371
+ contentStyle: C.contentStyle,
372
+ labelStyle: C.labelStyle,
373
+ itemStyle: C.itemStyle
374
+ }),
375
+ c && /* @__PURE__ */ a(p, { wrapperStyle: {
376
+ fontSize: 13,
377
+ color: b.textMuted
378
+ } }),
379
+ /* @__PURE__ */ a(g, {
380
+ data: i,
381
+ dataKey: "value",
382
+ nameKey: "name",
383
+ innerRadius: m,
384
+ outerRadius: h,
385
+ startAngle: v,
386
+ endAngle: v - 360,
387
+ strokeWidth: 3,
388
+ stroke: b.bg,
389
+ label: !1,
390
+ labelLine: !1,
391
+ children: i.map((e, t) => /* @__PURE__ */ a(f, { fill: e.color ?? S[t % S.length] }, e.name))
392
+ }),
393
+ (u || d) && /* @__PURE__ */ a("text", {})
394
+ ] })
395
+ }), (u || d) && /* @__PURE__ */ o("div", {
396
+ style: {
397
+ position: "absolute",
398
+ inset: 0,
399
+ display: "flex",
400
+ flexDirection: "column",
401
+ alignItems: "center",
402
+ justifyContent: "center",
403
+ pointerEvents: "none",
404
+ marginTop: c ? -24 : 0
405
+ },
406
+ children: [u && /* @__PURE__ */ a("span", {
407
+ style: {
408
+ fontSize: 22,
409
+ fontWeight: 700,
410
+ color: b.text,
411
+ lineHeight: 1
412
+ },
413
+ children: u
414
+ }), d && /* @__PURE__ */ a("span", {
415
+ style: {
416
+ fontSize: 13,
417
+ color: b.textMuted,
418
+ marginTop: 4
419
+ },
420
+ children: d
421
+ })]
422
+ })]
423
+ });
393
424
  }
394
- function ut({
395
- series: e,
396
- height: S = 300,
397
- margin: f = T,
398
- showGrid: p = !0,
399
- showLegend: d = !0,
400
- showTooltip: y = !0,
401
- xTickFormatter: m,
402
- yTickFormatter: x,
403
- zRange: a = [20, 400],
404
- ariaLabel: u = "Scatter chart"
405
- }) {
406
- const o = z(), l = M(o), h = C(o), r = { fill: o.textMuted, fontSize: 12 };
407
- return /* @__PURE__ */ t("div", { role: "img", "aria-label": u, style: { width: "100%", height: S }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(X, { margin: f, children: [
408
- p && /* @__PURE__ */ t(D, { strokeDasharray: "3 3", stroke: o.border }),
409
- /* @__PURE__ */ t(
410
- F,
411
- {
412
- type: "number",
413
- dataKey: "x",
414
- tick: r,
415
- axisLine: { stroke: o.border },
416
- tickLine: !1,
417
- tickFormatter: m
418
- }
419
- ),
420
- /* @__PURE__ */ t(
421
- K,
422
- {
423
- type: "number",
424
- dataKey: "y",
425
- tick: r,
426
- axisLine: !1,
427
- tickLine: !1,
428
- tickFormatter: x
429
- }
430
- ),
431
- /* @__PURE__ */ t(Y, { type: "number", dataKey: "z", range: a }),
432
- y && /* @__PURE__ */ t(
433
- L,
434
- {
435
- contentStyle: h.contentStyle,
436
- labelStyle: h.labelStyle,
437
- itemStyle: h.itemStyle,
438
- cursor: { strokeDasharray: "3 3" }
439
- }
440
- ),
441
- d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: o.textMuted, paddingTop: 8 } }),
442
- e.map((n, i) => /* @__PURE__ */ t(
443
- Z,
444
- {
445
- name: n.name,
446
- data: n.data,
447
- fill: n.color ?? l[i % l.length],
448
- fillOpacity: 0.8
449
- },
450
- n.name ?? i
451
- ))
452
- ] }) }) });
425
+ //#endregion
426
+ //#region src/charts/TkxScatterChart.tsx
427
+ function z({ series: t, height: n = 300, margin: r = M, showGrid: i = !0, showLegend: s = !0, showTooltip: c = !0, xTickFormatter: l, yTickFormatter: u, zRange: f = [20, 400], ariaLabel: m = "Scatter chart" }) {
428
+ let h = e(), g = j(h), _ = N(h), v = {
429
+ fill: h.textMuted,
430
+ fontSize: 12
431
+ };
432
+ return /* @__PURE__ */ a("div", {
433
+ role: "img",
434
+ "aria-label": m,
435
+ style: {
436
+ width: "100%",
437
+ height: n
438
+ },
439
+ children: /* @__PURE__ */ a(w, {
440
+ width: "100%",
441
+ height: "100%",
442
+ children: /* @__PURE__ */ o(E, {
443
+ margin: r,
444
+ children: [
445
+ i && /* @__PURE__ */ a(d, {
446
+ strokeDasharray: "3 3",
447
+ stroke: h.border
448
+ }),
449
+ /* @__PURE__ */ a(O, {
450
+ type: "number",
451
+ dataKey: "x",
452
+ tick: v,
453
+ axisLine: { stroke: h.border },
454
+ tickLine: !1,
455
+ tickFormatter: l
456
+ }),
457
+ /* @__PURE__ */ a(k, {
458
+ type: "number",
459
+ dataKey: "y",
460
+ tick: v,
461
+ axisLine: !1,
462
+ tickLine: !1,
463
+ tickFormatter: u
464
+ }),
465
+ /* @__PURE__ */ a(A, {
466
+ type: "number",
467
+ dataKey: "z",
468
+ range: f
469
+ }),
470
+ c && /* @__PURE__ */ a(D, {
471
+ contentStyle: _.contentStyle,
472
+ labelStyle: _.labelStyle,
473
+ itemStyle: _.itemStyle,
474
+ cursor: { strokeDasharray: "3 3" }
475
+ }),
476
+ s && /* @__PURE__ */ a(p, { wrapperStyle: {
477
+ fontSize: 13,
478
+ color: h.textMuted,
479
+ paddingTop: 8
480
+ } }),
481
+ t.map((e, t) => /* @__PURE__ */ a(T, {
482
+ name: e.name,
483
+ data: e.data,
484
+ fill: e.color ?? g[t % g.length],
485
+ fillOpacity: .8
486
+ }, e.name ?? t))
487
+ ]
488
+ })
489
+ })
490
+ });
453
491
  }
454
- function ht({
455
- data: e,
456
- series: S,
457
- angleKey: f,
458
- height: p = 300,
459
- showLegend: d = !0,
460
- showTooltip: y = !0,
461
- outerRadius: m = "70%",
462
- ariaLabel: x = "Radar chart"
463
- }) {
464
- const a = z(), u = M(a), o = C(a);
465
- return /* @__PURE__ */ t("div", { role: "img", "aria-label": x, style: { width: "100%", height: p }, children: /* @__PURE__ */ t(v, { width: "100%", height: "100%", children: /* @__PURE__ */ g(_, { data: e, outerRadius: m, children: [
466
- /* @__PURE__ */ t(J, { stroke: a.border }),
467
- /* @__PURE__ */ t(
468
- Q,
469
- {
470
- dataKey: f,
471
- tick: { fill: a.textMuted, fontSize: 12 }
472
- }
473
- ),
474
- /* @__PURE__ */ t(
475
- tt,
476
- {
477
- tick: { fill: a.textMuted, fontSize: 10 },
478
- axisLine: !1,
479
- tickLine: !1
480
- }
481
- ),
482
- y && /* @__PURE__ */ t(
483
- L,
484
- {
485
- contentStyle: o.contentStyle,
486
- labelStyle: o.labelStyle,
487
- itemStyle: o.itemStyle
488
- }
489
- ),
490
- d && /* @__PURE__ */ t(w, { wrapperStyle: { fontSize: 13, color: a.textMuted } }),
491
- S.map((l, h) => {
492
- const r = l.color ?? u[h % u.length];
493
- return /* @__PURE__ */ t(
494
- et,
495
- {
496
- name: l.label ?? l.key,
497
- dataKey: l.key,
498
- stroke: r,
499
- fill: r,
500
- fillOpacity: l.fillOpacity ?? 0.2,
501
- strokeWidth: 2
502
- },
503
- l.key
504
- );
505
- })
506
- ] }) }) });
492
+ //#endregion
493
+ //#region src/charts/TkxRadarChart.tsx
494
+ function B({ data: t, series: n, angleKey: r, height: i = 300, showLegend: s = !0, showTooltip: c = !0, outerRadius: l = "70%", ariaLabel: u = "Radar chart" }) {
495
+ let d = e(), f = j(d), m = N(d);
496
+ return /* @__PURE__ */ a("div", {
497
+ role: "img",
498
+ "aria-label": u,
499
+ style: {
500
+ width: "100%",
501
+ height: i
502
+ },
503
+ children: /* @__PURE__ */ a(w, {
504
+ width: "100%",
505
+ height: "100%",
506
+ children: /* @__PURE__ */ o(S, {
507
+ data: t,
508
+ outerRadius: l,
509
+ children: [
510
+ /* @__PURE__ */ a(y, { stroke: d.border }),
511
+ /* @__PURE__ */ a(v, {
512
+ dataKey: r,
513
+ tick: {
514
+ fill: d.textMuted,
515
+ fontSize: 12
516
+ }
517
+ }),
518
+ /* @__PURE__ */ a(b, {
519
+ tick: {
520
+ fill: d.textMuted,
521
+ fontSize: 10
522
+ },
523
+ axisLine: !1,
524
+ tickLine: !1
525
+ }),
526
+ c && /* @__PURE__ */ a(D, {
527
+ contentStyle: m.contentStyle,
528
+ labelStyle: m.labelStyle,
529
+ itemStyle: m.itemStyle
530
+ }),
531
+ s && /* @__PURE__ */ a(p, { wrapperStyle: {
532
+ fontSize: 13,
533
+ color: d.textMuted
534
+ } }),
535
+ n.map((e, t) => {
536
+ let n = e.color ?? f[t % f.length];
537
+ return /* @__PURE__ */ a(x, {
538
+ name: e.label ?? e.key,
539
+ dataKey: e.key,
540
+ stroke: n,
541
+ fill: n,
542
+ fillOpacity: e.fillOpacity ?? .2,
543
+ strokeWidth: 2
544
+ }, e.key);
545
+ })
546
+ ]
547
+ })
548
+ })
549
+ });
507
550
  }
508
- export {
509
- nt as TkxAreaChart,
510
- ct as TkxBarChart,
511
- yt as TkxDonutChart,
512
- dt as TkxLineChart,
513
- st as TkxPieChart,
514
- ht as TkxRadarChart,
515
- ut as TkxScatterChart
516
- };
551
+ //#endregion
552
+ export { P as TkxAreaChart, F as TkxBarChart, R as TkxDonutChart, I as TkxLineChart, L as TkxPieChart, B as TkxRadarChart, z as TkxScatterChart };