tekivex-ui 2.5.2 → 2.5.4

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