@rafal.lemieszewski/tide-ui 0.88.0 → 0.88.2
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.
- package/dist/cjs/components/fundamental/chart.cjs +1 -1
- package/dist/cjs/components/product/app-frame.cjs +1 -1
- package/dist/cjs/components/product/bookmarks.cjs +1 -1
- package/dist/cjs/components/product/filters.cjs +1 -1
- package/dist/es/components/fundamental/chart.js +99 -99
- package/dist/es/components/product/app-frame.js +3 -3
- package/dist/es/components/product/bookmarks.js +28 -29
- package/dist/es/components/product/filters.js +566 -517
- package/dist/types/components/fundamental/chart.d.cts +1 -1
- package/dist/types/components/fundamental/chart.d.ts +1 -1
- package/package.json +2 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as r, Fragment as He } from "react/jsx-runtime";
|
|
2
2
|
import S, { useState as Ye, useMemo as $, useCallback as Se } from "react";
|
|
3
3
|
import { ResponsiveContainer as Ne, ComposedChart as er, CartesianGrid as se, XAxis as oe, YAxis as T, Tooltip as ne, Legend as ie, Bar as Le, Area as Te, Line as Oe, ScatterChart as rr, Scatter as tr, LineChart as ar, ReferenceLine as lr, ReferenceDot as sr, BarChart as Re } from "recharts";
|
|
4
4
|
import { cn as or } from "../../lib/utils.js";
|
|
5
5
|
const ce = (n, f = 0) => {
|
|
6
|
-
const p = n.toFixed(f).split("."),
|
|
7
|
-
return f > 0 && p[1] ? `${
|
|
6
|
+
const p = n.toFixed(f).split("."), c = p[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
7
|
+
return f > 0 && p[1] ? `${c}.${p[1]}` : c;
|
|
8
8
|
}, Ve = (n, f, a, p = 20) => {
|
|
9
9
|
if (!n.length) return p;
|
|
10
|
-
let
|
|
10
|
+
let c = 0;
|
|
11
11
|
n.forEach((N) => {
|
|
12
12
|
f.forEach((o) => {
|
|
13
13
|
const v = N[o];
|
|
14
|
-
typeof v == "number" ?
|
|
15
|
-
typeof i == "number" && (
|
|
14
|
+
typeof v == "number" ? c = Math.max(c, Math.abs(v)) : Array.isArray(v) && v.forEach((i) => {
|
|
15
|
+
typeof i == "number" && (c = Math.max(c, Math.abs(i)));
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
const w = (a ? a(
|
|
19
|
+
const w = (a ? a(c, 0) : c.toString()).length;
|
|
20
20
|
return Math.max(p, w * 6 + 12);
|
|
21
21
|
}, O = {
|
|
22
22
|
bar: [
|
|
@@ -106,7 +106,7 @@ const ce = (n, f = 0) => {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
}, nr = (n = "circle") => (f) => {
|
|
109
|
-
const { cx: a, cy: p, r:
|
|
109
|
+
const { cx: a, cy: p, r: c, fill: g, stroke: w, strokeWidth: N } = f, o = c || 4;
|
|
110
110
|
switch (n) {
|
|
111
111
|
case "triangle":
|
|
112
112
|
const v = o * 1.5, i = o * 1.3, m = `M ${a},${p - v} L ${a + i},${p + v / 2} L ${a - i},${p + v / 2} Z`;
|
|
@@ -147,14 +147,14 @@ const ce = (n, f = 0) => {
|
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
|
-
}, Be = (n) => ({ verticalAlign: "bottom", align: "center" }), de = ({ active: n, payload: f, label: a, config: p, tooltipMaxWidth:
|
|
150
|
+
}, Be = (n) => ({ verticalAlign: "bottom", align: "center" }), de = ({ active: n, payload: f, label: a, config: p, tooltipMaxWidth: c = "max-w-xs", chartType: g, referenceMarkers: w }) => {
|
|
151
151
|
if (!n || !f || !f.length)
|
|
152
152
|
return null;
|
|
153
153
|
const N = w?.filter((o) => o.xValue === a) || [];
|
|
154
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ u(
|
|
155
155
|
"div",
|
|
156
156
|
{
|
|
157
|
-
className: `rounded-[var(--border-radius-s)] border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] p-[var(--space-m)] shadow-[var(--shadow-300)] min-w-[120px] ${
|
|
157
|
+
className: `rounded-[var(--border-radius-s)] border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] p-[var(--space-m)] shadow-[var(--shadow-300)] min-w-[120px] ${c} z-[9999]`,
|
|
158
158
|
role: "tooltip",
|
|
159
159
|
"aria-label": "Chart data tooltip",
|
|
160
160
|
children: [
|
|
@@ -167,11 +167,11 @@ const ce = (n, f = 0) => {
|
|
|
167
167
|
Array.isArray(L) && L.length === 2 ? m = `${ce(L[0])} – ${ce(L[1])}` : m = typeof o.value == "number" ? ce(o.value) : o.value;
|
|
168
168
|
} else
|
|
169
169
|
m = typeof o.value == "number" ? ce(o.value) : o.value;
|
|
170
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center gap-[var(--space-xs)]", children: [
|
|
171
171
|
(() => {
|
|
172
172
|
switch (g) {
|
|
173
173
|
case "line":
|
|
174
|
-
const L = p[o.dataKey]?.strokeStyle,
|
|
174
|
+
const L = p[o.dataKey]?.strokeStyle, V = R(L);
|
|
175
175
|
return /* @__PURE__ */ r(
|
|
176
176
|
"div",
|
|
177
177
|
{
|
|
@@ -182,8 +182,8 @@ const ce = (n, f = 0) => {
|
|
|
182
182
|
{
|
|
183
183
|
className: "w-full h-full",
|
|
184
184
|
style: {
|
|
185
|
-
background:
|
|
186
|
-
backgroundSize:
|
|
185
|
+
background: V ? `linear-gradient(to right, ${o.color} 50%, transparent 50%)` : o.color,
|
|
186
|
+
backgroundSize: V === "5 5" ? "6px 100%" : V === "2 2" ? "2px 100%" : "100% 100%"
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
)
|
|
@@ -201,7 +201,7 @@ const ce = (n, f = 0) => {
|
|
|
201
201
|
case "composed":
|
|
202
202
|
switch (p[o.dataKey]?.type) {
|
|
203
203
|
case "line":
|
|
204
|
-
const A = p[o.dataKey]?.strokeStyle,
|
|
204
|
+
const A = p[o.dataKey]?.strokeStyle, W = R(A);
|
|
205
205
|
return /* @__PURE__ */ r(
|
|
206
206
|
"div",
|
|
207
207
|
{
|
|
@@ -212,8 +212,8 @@ const ce = (n, f = 0) => {
|
|
|
212
212
|
{
|
|
213
213
|
className: "w-full h-full",
|
|
214
214
|
style: {
|
|
215
|
-
background:
|
|
216
|
-
backgroundSize:
|
|
215
|
+
background: W ? `linear-gradient(to right, ${o.color} 50%, transparent 50%)` : o.color,
|
|
216
|
+
backgroundSize: W === "5 5" ? "6px 100%" : W === "2 2" ? "2px 100%" : "100% 100%"
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
)
|
|
@@ -254,19 +254,19 @@ const ce = (n, f = 0) => {
|
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
})(),
|
|
257
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ u("span", { className: "text-body-sm text-[var(--color-text-primary)] min-w-0 break-words", children: [
|
|
258
258
|
i?.label || o.dataKey,
|
|
259
259
|
":"
|
|
260
260
|
] }),
|
|
261
261
|
/* @__PURE__ */ r("span", { className: "text-body-medium-sm text-[var(--color-text-primary)] ml-auto pl-[16px]", children: m })
|
|
262
262
|
] }, v);
|
|
263
263
|
}),
|
|
264
|
-
N.length > 0 && /* @__PURE__ */
|
|
264
|
+
N.length > 0 && /* @__PURE__ */ u(He, { children: [
|
|
265
265
|
/* @__PURE__ */ r("div", { className: "my-[var(--space-m)]" }),
|
|
266
|
-
N.map((o, v) => /* @__PURE__ */
|
|
266
|
+
N.map((o, v) => /* @__PURE__ */ u(S.Fragment, { children: [
|
|
267
267
|
o.tooltipLabel && /* @__PURE__ */ r("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: o.tooltipLabel }),
|
|
268
268
|
!o.tooltipLabel && v === 0 && /* @__PURE__ */ r("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: "Reference Markers:" }),
|
|
269
|
-
o.dataPoints.map((i, m) => /* @__PURE__ */
|
|
269
|
+
o.dataPoints.map((i, m) => /* @__PURE__ */ u("div", { className: "flex items-center gap-[var(--space-xs)]", children: [
|
|
270
270
|
(() => {
|
|
271
271
|
switch (i.shape || "circle") {
|
|
272
272
|
case "triangle":
|
|
@@ -306,7 +306,7 @@ const ce = (n, f = 0) => {
|
|
|
306
306
|
);
|
|
307
307
|
}
|
|
308
308
|
})(),
|
|
309
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ u("span", { className: "text-body-sm text-[var(--color-text-primary)] min-w-0 break-words", children: [
|
|
310
310
|
i.label || `Marker ${m + 1}`,
|
|
311
311
|
":"
|
|
312
312
|
] }),
|
|
@@ -323,9 +323,9 @@ function pr({
|
|
|
323
323
|
data: f,
|
|
324
324
|
config: a,
|
|
325
325
|
className: p,
|
|
326
|
-
height:
|
|
326
|
+
height: c = 300,
|
|
327
327
|
width: g,
|
|
328
|
-
minWidth: w =
|
|
328
|
+
minWidth: w = 240,
|
|
329
329
|
onDataPointClick: N,
|
|
330
330
|
onDataPointHover: o,
|
|
331
331
|
highlightedIndex: v,
|
|
@@ -333,10 +333,10 @@ function pr({
|
|
|
333
333
|
showLegend: m = !0,
|
|
334
334
|
showTooltip: C = !0,
|
|
335
335
|
colorScheme: L,
|
|
336
|
-
responsive:
|
|
336
|
+
responsive: V = !0,
|
|
337
337
|
maintainAspectRatio: je = !1,
|
|
338
338
|
legendHeight: A,
|
|
339
|
-
margin:
|
|
339
|
+
margin: W,
|
|
340
340
|
yAxisWidth: ve,
|
|
341
341
|
yAxisTickCount: Ie,
|
|
342
342
|
xAxisTickFormatter: qe,
|
|
@@ -351,23 +351,23 @@ function pr({
|
|
|
351
351
|
showDataTable: _e = !1,
|
|
352
352
|
tooltipMaxWidth: X = "max-w-xs",
|
|
353
353
|
tooltipAllowEscapeViewBox: U,
|
|
354
|
-
legendOrder:
|
|
354
|
+
legendOrder: B,
|
|
355
355
|
legendPosition: ir = "bottom",
|
|
356
356
|
referenceMarkers: Me,
|
|
357
|
-
todayMarker:
|
|
358
|
-
yAxisDomain:
|
|
357
|
+
todayMarker: K,
|
|
358
|
+
yAxisDomain: j,
|
|
359
359
|
scrollable: E = !1,
|
|
360
360
|
scrollableWidth: $e,
|
|
361
361
|
...Fe
|
|
362
362
|
}) {
|
|
363
|
-
const [ze, Xe] = Ye(0), b = S.useRef(null), ke = S.useRef(!1), Ae = S.useRef(0),
|
|
364
|
-
b.current && (ke.current = !0, Ae.current = t.pageX - b.current.offsetLeft,
|
|
363
|
+
const [ze, Xe] = Ye(0), b = S.useRef(null), ke = S.useRef(!1), Ae = S.useRef(0), We = S.useRef(0), Ue = S.useCallback((t) => {
|
|
364
|
+
b.current && (ke.current = !0, Ae.current = t.pageX - b.current.offsetLeft, We.current = b.current.scrollLeft, b.current.style.cursor = "grabbing");
|
|
365
365
|
}, []), Ze = S.useCallback((t) => {
|
|
366
366
|
if (!ke.current || !b.current) return;
|
|
367
367
|
t.preventDefault();
|
|
368
368
|
const e = t.pageX - b.current.offsetLeft;
|
|
369
|
-
b.current.scrollLeft =
|
|
370
|
-
}, []),
|
|
369
|
+
b.current.scrollLeft = We.current - (e - Ae.current);
|
|
370
|
+
}, []), Ke = S.useCallback(() => {
|
|
371
371
|
ke.current = !1, b.current && (b.current.style.cursor = "grab");
|
|
372
372
|
}, []), k = $(() => {
|
|
373
373
|
if (L)
|
|
@@ -395,12 +395,12 @@ function pr({
|
|
|
395
395
|
}
|
|
396
396
|
}), e;
|
|
397
397
|
}), [f, a, h]), ge = $(() => {
|
|
398
|
-
if (!
|
|
399
|
-
const t = y.find((e) => e.name ===
|
|
398
|
+
if (!K) return null;
|
|
399
|
+
const t = y.find((e) => e.name === K.xValue);
|
|
400
400
|
return {
|
|
401
|
-
xValue:
|
|
401
|
+
xValue: K.xValue,
|
|
402
402
|
showLine: !0,
|
|
403
|
-
lineLabel:
|
|
403
|
+
lineLabel: K.label ?? "Today",
|
|
404
404
|
lineStyle: {
|
|
405
405
|
stroke: "var(--color-border-error-bold)",
|
|
406
406
|
strokeWidth: 2
|
|
@@ -413,7 +413,7 @@ function pr({
|
|
|
413
413
|
pulsing: !0
|
|
414
414
|
}))
|
|
415
415
|
};
|
|
416
|
-
}, [
|
|
416
|
+
}, [K, y, h, a]), we = $(() => [
|
|
417
417
|
...Me ?? [],
|
|
418
418
|
...ge ? [ge] : []
|
|
419
419
|
], [Me, ge]), Z = Se((t) => {
|
|
@@ -427,14 +427,14 @@ function pr({
|
|
|
427
427
|
}, [N]), G = $(() => ze >= Math.floor(y.length / 2), [ze, y.length]), me = () => {
|
|
428
428
|
const t = { top: 8, right: 0, left: 0, bottom: 0 };
|
|
429
429
|
return {
|
|
430
|
-
top:
|
|
431
|
-
right:
|
|
430
|
+
top: W?.top ?? t.top,
|
|
431
|
+
right: W?.right ?? t.right,
|
|
432
432
|
// Don't add rightYAxisWidth - Recharts handles it via YAxis width prop
|
|
433
|
-
left:
|
|
434
|
-
bottom:
|
|
433
|
+
left: W?.left ?? t.left,
|
|
434
|
+
bottom: W?.bottom ?? t.bottom
|
|
435
435
|
};
|
|
436
|
-
}, Pe = $(() => ve || Ve(y, h, F, 20), [ve, y, h, F]),
|
|
437
|
-
if (!E ||
|
|
436
|
+
}, Pe = $(() => ve || Ve(y, h, F, 20), [ve, y, h, F]), q = $(() => {
|
|
437
|
+
if (!E || j) return j;
|
|
438
438
|
const t = y.flatMap(
|
|
439
439
|
(e) => h.map((s) => {
|
|
440
440
|
const l = e[s];
|
|
@@ -442,7 +442,7 @@ function pr({
|
|
|
442
442
|
}).flat()
|
|
443
443
|
);
|
|
444
444
|
return [Math.min(0, ...t), Math.max(...t)];
|
|
445
|
-
}, [E,
|
|
445
|
+
}, [E, j, y, h]), H = $(
|
|
446
446
|
() => E ? $e ?? Math.max(y.length * 60, 600) : void 0,
|
|
447
447
|
[E, $e, y.length]
|
|
448
448
|
), De = $(() => {
|
|
@@ -486,7 +486,7 @@ function pr({
|
|
|
486
486
|
tickFormatter: F,
|
|
487
487
|
...Ie && { tickCount: Ie },
|
|
488
488
|
// Force specific number of ticks when provided
|
|
489
|
-
...
|
|
489
|
+
...j && { domain: j }
|
|
490
490
|
// Custom Y-axis domain when provided
|
|
491
491
|
}, te = {
|
|
492
492
|
stroke: "var(--color-border-primary-subtle)",
|
|
@@ -494,8 +494,8 @@ function pr({
|
|
|
494
494
|
vertical: !1
|
|
495
495
|
}, ae = ({ payload: t }) => {
|
|
496
496
|
if (!t || !t.length) return null;
|
|
497
|
-
const e = t.filter((
|
|
498
|
-
const M =
|
|
497
|
+
const e = t.filter((d) => a[d.dataKey]), s = B ? [...e].sort((d, z) => {
|
|
498
|
+
const M = B.indexOf(d.dataKey), I = B.indexOf(z.dataKey);
|
|
499
499
|
return M === -1 ? 1 : I === -1 ? -1 : M - I;
|
|
500
500
|
}) : e, x = me().left + 5;
|
|
501
501
|
return /* @__PURE__ */ r(
|
|
@@ -505,11 +505,11 @@ function pr({
|
|
|
505
505
|
paddingLeft: `${x}px`,
|
|
506
506
|
paddingRight: "16px"
|
|
507
507
|
},
|
|
508
|
-
children: /* @__PURE__ */ r("div", { className: "flex flex-wrap justify-start items-start gap-x-[var(--space-m)] gap-y-[var(--space-s)]", children: s.map((
|
|
508
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-wrap justify-start items-start gap-x-[var(--space-m)] gap-y-[var(--space-s)]", children: s.map((d, z) => /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-[var(--space-xs)]", children: [
|
|
509
509
|
(() => {
|
|
510
510
|
switch (n) {
|
|
511
511
|
case "line":
|
|
512
|
-
const I = a[
|
|
512
|
+
const I = a[d.dataKey]?.strokeStyle, _ = R(I);
|
|
513
513
|
return /* @__PURE__ */ r(
|
|
514
514
|
"div",
|
|
515
515
|
{
|
|
@@ -520,8 +520,8 @@ function pr({
|
|
|
520
520
|
{
|
|
521
521
|
className: "w-full h-full",
|
|
522
522
|
style: {
|
|
523
|
-
background:
|
|
524
|
-
backgroundSize:
|
|
523
|
+
background: _ ? `linear-gradient(to right, ${d.color} 50%, transparent 50%)` : d.color,
|
|
524
|
+
backgroundSize: _ === "5 5" ? "8px 100%" : _ === "2 2" ? "3px 100%" : "100% 100%"
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
)
|
|
@@ -532,14 +532,14 @@ function pr({
|
|
|
532
532
|
"div",
|
|
533
533
|
{
|
|
534
534
|
className: "w-[6px] h-[6px] rounded-full flex-shrink-0",
|
|
535
|
-
style: { backgroundColor:
|
|
535
|
+
style: { backgroundColor: d.color },
|
|
536
536
|
"aria-hidden": "true"
|
|
537
537
|
}
|
|
538
538
|
);
|
|
539
539
|
case "composed":
|
|
540
|
-
switch (a[
|
|
540
|
+
switch (a[d.dataKey]?.type) {
|
|
541
541
|
case "line":
|
|
542
|
-
const Ge = a[
|
|
542
|
+
const Ge = a[d.dataKey]?.strokeStyle, Ce = R(Ge);
|
|
543
543
|
return /* @__PURE__ */ r(
|
|
544
544
|
"div",
|
|
545
545
|
{
|
|
@@ -550,7 +550,7 @@ function pr({
|
|
|
550
550
|
{
|
|
551
551
|
className: "w-full h-full",
|
|
552
552
|
style: {
|
|
553
|
-
background: Ce ? `linear-gradient(to right, ${
|
|
553
|
+
background: Ce ? `linear-gradient(to right, ${d.color} 50%, transparent 50%)` : d.color,
|
|
554
554
|
backgroundSize: Ce === "5 5" ? "8px 100%" : Ce === "2 2" ? "3px 100%" : "100% 100%"
|
|
555
555
|
}
|
|
556
556
|
}
|
|
@@ -563,7 +563,7 @@ function pr({
|
|
|
563
563
|
"div",
|
|
564
564
|
{
|
|
565
565
|
className: "w-[8px] h-[8px] flex-shrink-0",
|
|
566
|
-
style: { backgroundColor:
|
|
566
|
+
style: { backgroundColor: d.color },
|
|
567
567
|
"aria-hidden": "true"
|
|
568
568
|
}
|
|
569
569
|
);
|
|
@@ -573,7 +573,7 @@ function pr({
|
|
|
573
573
|
"div",
|
|
574
574
|
{
|
|
575
575
|
className: "w-[6px] h-[6px] flex-shrink-0",
|
|
576
|
-
style: { backgroundColor:
|
|
576
|
+
style: { backgroundColor: d.color },
|
|
577
577
|
"aria-hidden": "true"
|
|
578
578
|
}
|
|
579
579
|
);
|
|
@@ -585,22 +585,22 @@ function pr({
|
|
|
585
585
|
"div",
|
|
586
586
|
{
|
|
587
587
|
className: "w-[6px] h-[6px] flex-shrink-0",
|
|
588
|
-
style: { backgroundColor:
|
|
588
|
+
style: { backgroundColor: d.color },
|
|
589
589
|
"aria-hidden": "true"
|
|
590
590
|
}
|
|
591
591
|
);
|
|
592
592
|
}
|
|
593
593
|
})(),
|
|
594
|
-
/* @__PURE__ */ r("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children:
|
|
594
|
+
/* @__PURE__ */ r("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children: d.value })
|
|
595
595
|
] }, z)) })
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
598
|
}, Je = () => {
|
|
599
|
-
const t =
|
|
599
|
+
const t = B ? [...B, ...Object.keys(a).filter((l) => !B.includes(l))] : Object.keys(a), s = me().left + 5;
|
|
600
600
|
return /* @__PURE__ */ r("div", { style: { paddingLeft: `${s}px`, paddingRight: "16px" }, children: /* @__PURE__ */ r("div", { className: "flex flex-wrap justify-start items-start gap-x-[var(--space-m)] gap-y-[var(--space-s)]", children: t.map((l, x) => {
|
|
601
|
-
const
|
|
602
|
-
if (!
|
|
603
|
-
const z =
|
|
601
|
+
const d = a[l];
|
|
602
|
+
if (!d) return null;
|
|
603
|
+
const z = d.color ?? "currentColor", M = R(d.strokeStyle), I = /* @__PURE__ */ r("div", { className: "w-[12px] h-[2px] flex-shrink-0 relative", "aria-hidden": "true", children: /* @__PURE__ */ r(
|
|
604
604
|
"div",
|
|
605
605
|
{
|
|
606
606
|
className: "w-full h-full",
|
|
@@ -610,15 +610,15 @@ function pr({
|
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
) });
|
|
613
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-[var(--space-xs)]", children: [
|
|
614
614
|
I,
|
|
615
|
-
/* @__PURE__ */ r("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children:
|
|
615
|
+
/* @__PURE__ */ r("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children: d.label })
|
|
616
616
|
] }, x);
|
|
617
617
|
}) }) });
|
|
618
618
|
}, ye = (t = "full") => {
|
|
619
619
|
switch (n) {
|
|
620
620
|
case "bar":
|
|
621
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ u(
|
|
622
622
|
Re,
|
|
623
623
|
{
|
|
624
624
|
...ee,
|
|
@@ -634,7 +634,7 @@ function pr({
|
|
|
634
634
|
...P,
|
|
635
635
|
hide: t === "data-only",
|
|
636
636
|
width: t === "data-only" ? 0 : P.width,
|
|
637
|
-
...t !== "full" &&
|
|
637
|
+
...t !== "full" && q ? { domain: q } : {}
|
|
638
638
|
}
|
|
639
639
|
),
|
|
640
640
|
t !== "yaxis-only" && C && /* @__PURE__ */ r(
|
|
@@ -677,7 +677,7 @@ function pr({
|
|
|
677
677
|
}
|
|
678
678
|
);
|
|
679
679
|
case "horizontal-bar":
|
|
680
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ u(
|
|
681
681
|
Re,
|
|
682
682
|
{
|
|
683
683
|
...ee,
|
|
@@ -728,7 +728,7 @@ function pr({
|
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
730
|
case "line":
|
|
731
|
-
return /* @__PURE__ */
|
|
731
|
+
return /* @__PURE__ */ u(
|
|
732
732
|
ar,
|
|
733
733
|
{
|
|
734
734
|
...ee,
|
|
@@ -745,7 +745,7 @@ function pr({
|
|
|
745
745
|
...P,
|
|
746
746
|
hide: t === "data-only",
|
|
747
747
|
width: t === "data-only" ? 0 : P.width,
|
|
748
|
-
...t !== "full" &&
|
|
748
|
+
...t !== "full" && q ? { domain: q } : {}
|
|
749
749
|
}
|
|
750
750
|
),
|
|
751
751
|
t !== "yaxis-only" && ue && /* @__PURE__ */ r(
|
|
@@ -852,14 +852,14 @@ function pr({
|
|
|
852
852
|
fill: l.fill || "var(--color-chart-line-1)",
|
|
853
853
|
stroke: l.stroke || "transparent",
|
|
854
854
|
strokeWidth: l.strokeWidth || 0,
|
|
855
|
-
shape: l.pulsing ? (
|
|
856
|
-
const { cx: z, cy: M } =
|
|
857
|
-
return /* @__PURE__ */
|
|
858
|
-
/* @__PURE__ */
|
|
855
|
+
shape: l.pulsing ? (d) => {
|
|
856
|
+
const { cx: z, cy: M } = d, I = l.size || 4, _ = l.fill || "var(--color-background-error-bold)";
|
|
857
|
+
return /* @__PURE__ */ u("g", { children: [
|
|
858
|
+
/* @__PURE__ */ u("circle", { cx: z, cy: M, r: I + 1, fill: _, opacity: 0.3, children: [
|
|
859
859
|
/* @__PURE__ */ r("animate", { attributeName: "r", from: String(I + 1), to: String(I + 8), dur: "1.5s", repeatCount: "indefinite" }),
|
|
860
860
|
/* @__PURE__ */ r("animate", { attributeName: "opacity", from: "0.35", to: "0", dur: "1.5s", repeatCount: "indefinite" })
|
|
861
861
|
] }),
|
|
862
|
-
/* @__PURE__ */ r("circle", { cx: z, cy: M, r: I, fill:
|
|
862
|
+
/* @__PURE__ */ r("circle", { cx: z, cy: M, r: I, fill: _ })
|
|
863
863
|
] });
|
|
864
864
|
} : nr(l.shape || "circle")
|
|
865
865
|
},
|
|
@@ -869,7 +869,7 @@ function pr({
|
|
|
869
869
|
}
|
|
870
870
|
);
|
|
871
871
|
case "scatter":
|
|
872
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ u(
|
|
873
873
|
rr,
|
|
874
874
|
{
|
|
875
875
|
...ee,
|
|
@@ -917,7 +917,7 @@ function pr({
|
|
|
917
917
|
}
|
|
918
918
|
);
|
|
919
919
|
case "composed":
|
|
920
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ u(
|
|
921
921
|
er,
|
|
922
922
|
{
|
|
923
923
|
...ee,
|
|
@@ -934,7 +934,7 @@ function pr({
|
|
|
934
934
|
...P,
|
|
935
935
|
hide: t === "data-only",
|
|
936
936
|
width: t === "data-only" ? 0 : P.width,
|
|
937
|
-
...t !== "full" &&
|
|
937
|
+
...t !== "full" && q ? { domain: q } : {}
|
|
938
938
|
}
|
|
939
939
|
),
|
|
940
940
|
t !== "yaxis-only" && ue && /* @__PURE__ */ r(
|
|
@@ -1060,16 +1060,16 @@ function pr({
|
|
|
1060
1060
|
default:
|
|
1061
1061
|
return /* @__PURE__ */ r("div", { children: "Unsupported chart type" });
|
|
1062
1062
|
}
|
|
1063
|
-
}, Qe = () => _e ? /* @__PURE__ */ r("div", { className: "sr-only", children: /* @__PURE__ */
|
|
1064
|
-
/* @__PURE__ */
|
|
1063
|
+
}, Qe = () => _e ? /* @__PURE__ */ r("div", { className: "sr-only", children: /* @__PURE__ */ u("table", { role: "table", "aria-label": D ? `Data for ${D}` : "Chart data", children: [
|
|
1064
|
+
/* @__PURE__ */ u("caption", { className: "sr-only", children: [
|
|
1065
1065
|
D && `${D}. `,
|
|
1066
1066
|
xe || `${n} chart showing ${h.length} data series across ${f.length} categories.`
|
|
1067
1067
|
] }),
|
|
1068
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ u("tr", { children: [
|
|
1069
1069
|
/* @__PURE__ */ r("th", { scope: "col", children: "Category" }),
|
|
1070
1070
|
h.map((t) => /* @__PURE__ */ r("th", { scope: "col", children: a[t]?.label || t }, t))
|
|
1071
1071
|
] }) }),
|
|
1072
|
-
/* @__PURE__ */ r("tbody", { children: f.map((t, e) => /* @__PURE__ */
|
|
1072
|
+
/* @__PURE__ */ r("tbody", { children: f.map((t, e) => /* @__PURE__ */ u("tr", { children: [
|
|
1073
1073
|
/* @__PURE__ */ r("th", { scope: "row", children: t.name || `Item ${e + 1}` }),
|
|
1074
1074
|
h.map((s) => /* @__PURE__ */ r("td", { children: F ? F(t[s], e) : t[s] }, s))
|
|
1075
1075
|
] }, e)) })
|
|
@@ -1079,14 +1079,14 @@ function pr({
|
|
|
1079
1079
|
if (!t) return;
|
|
1080
1080
|
const e = setTimeout(() => {
|
|
1081
1081
|
t.querySelectorAll(".recharts-cartesian-axis-tick").forEach((l) => {
|
|
1082
|
-
const x = l.querySelector("text"),
|
|
1083
|
-
x?.textContent?.trim() === "0" &&
|
|
1082
|
+
const x = l.querySelector("text"), d = l.querySelector(".recharts-cartesian-axis-tick-line");
|
|
1083
|
+
x?.textContent?.trim() === "0" && d && d.setAttribute("stroke-width", "2");
|
|
1084
1084
|
});
|
|
1085
1085
|
}, 100);
|
|
1086
1086
|
return () => clearTimeout(e);
|
|
1087
1087
|
}, [f, n]), S.useEffect(() => {
|
|
1088
|
-
if (!E || !
|
|
1089
|
-
const t = y.findIndex((s) => s.name ===
|
|
1088
|
+
if (!E || !K || !b.current || !H) return;
|
|
1089
|
+
const t = y.findIndex((s) => s.name === K.xValue);
|
|
1090
1090
|
if (t < 0) return;
|
|
1091
1091
|
const e = setTimeout(() => {
|
|
1092
1092
|
if (!b.current) return;
|
|
@@ -1094,12 +1094,12 @@ function pr({
|
|
|
1094
1094
|
b.current.scrollLeft = Math.max(0, l - s / 2);
|
|
1095
1095
|
}, 50);
|
|
1096
1096
|
return () => clearTimeout(e);
|
|
1097
|
-
}, [E,
|
|
1097
|
+
}, [E, K, H, y]), /* @__PURE__ */ u(
|
|
1098
1098
|
"div",
|
|
1099
1099
|
{
|
|
1100
1100
|
ref: le,
|
|
1101
1101
|
className: or("w-full", p),
|
|
1102
|
-
style: { minWidth: w },
|
|
1102
|
+
style: { minWidth: V ? 0 : w, ...typeof c == "string" ? { height: c } : {} },
|
|
1103
1103
|
role: "img",
|
|
1104
1104
|
"aria-label": D || `${n} chart`,
|
|
1105
1105
|
"aria-describedby": xe ? `${le.current?.id || "chart"}-desc` : void 0,
|
|
@@ -1108,11 +1108,11 @@ function pr({
|
|
|
1108
1108
|
D && /* @__PURE__ */ r("h3", { className: "sr-only", id: `${le.current?.id || "chart"}-title`, children: D }),
|
|
1109
1109
|
xe && /* @__PURE__ */ r("p", { className: "sr-only", id: `${le.current?.id || "chart"}-desc`, children: xe }),
|
|
1110
1110
|
(() => {
|
|
1111
|
-
const t = A ?
|
|
1111
|
+
const t = typeof c == "string" ? c : A ? c - A : c;
|
|
1112
1112
|
if (E && n !== "horizontal-bar" && n !== "scatter") {
|
|
1113
1113
|
const s = Pe + (me().left ?? 0);
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
/* @__PURE__ */
|
|
1114
|
+
return /* @__PURE__ */ u("div", { style: { height: m && A ? c : t }, children: [
|
|
1115
|
+
/* @__PURE__ */ u("div", { className: "flex w-full", style: { height: t }, children: [
|
|
1116
1116
|
/* @__PURE__ */ r("div", { style: { width: s, flexShrink: 0, overflow: "hidden" }, children: /* @__PURE__ */ r(Ne, { width: s, height: t, children: ye("yaxis-only") || /* @__PURE__ */ r("div", { children: "Chart error" }) }) }),
|
|
1117
1117
|
/* @__PURE__ */ r(
|
|
1118
1118
|
"div",
|
|
@@ -1122,8 +1122,8 @@ function pr({
|
|
|
1122
1122
|
style: { cursor: "grab" },
|
|
1123
1123
|
onMouseDown: Ue,
|
|
1124
1124
|
onMouseMove: Ze,
|
|
1125
|
-
onMouseUp:
|
|
1126
|
-
onMouseLeave:
|
|
1125
|
+
onMouseUp: Ke,
|
|
1126
|
+
onMouseLeave: Ke,
|
|
1127
1127
|
children: /* @__PURE__ */ r("div", { style: { width: H, height: t }, children: /* @__PURE__ */ r(Ne, { width: H, height: t, children: ye("data-only") || /* @__PURE__ */ r("div", { children: "Chart error" }) }) })
|
|
1128
1128
|
}
|
|
1129
1129
|
)
|
|
@@ -1131,7 +1131,7 @@ function pr({
|
|
|
1131
1131
|
m && Je()
|
|
1132
1132
|
] });
|
|
1133
1133
|
}
|
|
1134
|
-
const e =
|
|
1134
|
+
const e = V ? /* @__PURE__ */ r(
|
|
1135
1135
|
Ne,
|
|
1136
1136
|
{
|
|
1137
1137
|
width: g || "100%",
|
|
@@ -1148,11 +1148,11 @@ function pr({
|
|
|
1148
1148
|
}
|
|
1149
1149
|
const xr = (n, f = "bar") => {
|
|
1150
1150
|
const a = O[f];
|
|
1151
|
-
return Array.from({ length: n }, (p,
|
|
1152
|
-
}, mr = (n, f, a) => Array.isArray(n) ? n.reduce((
|
|
1151
|
+
return Array.from({ length: n }, (p, c) => a[c % a.length]);
|
|
1152
|
+
}, mr = (n, f, a) => Array.isArray(n) ? n.reduce((c, g, w) => (c[g] = {
|
|
1153
1153
|
label: f?.[w] || g,
|
|
1154
1154
|
color: a?.[w]
|
|
1155
|
-
},
|
|
1155
|
+
}, c), {}) : n;
|
|
1156
1156
|
export {
|
|
1157
1157
|
pr as Chart,
|
|
1158
1158
|
O as chartColorSchemes,
|
|
@@ -259,7 +259,7 @@ function Ie({ navigationData: a, user: o, teams: u, onNavigate: n, navigationMod
|
|
|
259
259
|
) }),
|
|
260
260
|
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
261
261
|
] }) }, r.title)) }) }) }),
|
|
262
|
-
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, {
|
|
262
|
+
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, { type: "horizontal-line" }) }),
|
|
263
263
|
/* @__PURE__ */ l(F, { className: "mt-1 p-[var(--space-s)]", children: [
|
|
264
264
|
/* @__PURE__ */ e(_, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Operations" }),
|
|
265
265
|
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.operations.map((r) => /* @__PURE__ */ e(P, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(G, { children: [
|
|
@@ -337,7 +337,7 @@ function Ie({ navigationData: a, user: o, teams: u, onNavigate: n, navigationMod
|
|
|
337
337
|
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
338
338
|
] }) }, r.title)) }) })
|
|
339
339
|
] }),
|
|
340
|
-
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, {
|
|
340
|
+
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, { type: "horizontal-line" }) }),
|
|
341
341
|
/* @__PURE__ */ l(F, { className: "mt-1 p-[var(--space-s)]", children: [
|
|
342
342
|
/* @__PURE__ */ e(_, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Intelligence" }),
|
|
343
343
|
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.intelligence.map((r) => /* @__PURE__ */ e(P, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(G, { children: [
|
|
@@ -1042,7 +1042,7 @@ function rr({
|
|
|
1042
1042
|
/* @__PURE__ */ l(se, { children: [
|
|
1043
1043
|
(d || b || f) && /* @__PURE__ */ l("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]", children: [
|
|
1044
1044
|
/* @__PURE__ */ e(Ze, {}),
|
|
1045
|
-
/* @__PURE__ */ e(Q, {
|
|
1045
|
+
/* @__PURE__ */ e(Q, { type: "vertical-line", className: "mr-2 h-4" }),
|
|
1046
1046
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: d }),
|
|
1047
1047
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 ml-auto shrink-0", children: [
|
|
1048
1048
|
f && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: f }),
|