@mlw-packages/react-components 1.8.5 → 1.8.7
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/index.css +92 -49
- package/dist/index.d.mts +85 -10
- package/dist/index.d.ts +85 -10
- package/dist/index.js +829 -315
- package/dist/index.mjs +808 -286
- package/dist/pwa-512x512-4NJPUGCI.png +0 -0
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -491,7 +491,7 @@ function cn(...inputs) {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
// src/components/ui/form/ButtonBase.tsx
|
|
494
|
-
import { CircleNotchIcon } from "@phosphor-icons/react";
|
|
494
|
+
import { CircleNotchIcon as CircleNotchIcon2 } from "@phosphor-icons/react";
|
|
495
495
|
|
|
496
496
|
// src/components/ui/feedback/AlertDialogBase.tsx
|
|
497
497
|
import * as React from "react";
|
|
@@ -1166,49 +1166,59 @@ import {
|
|
|
1166
1166
|
XCircleIcon,
|
|
1167
1167
|
InfoIcon,
|
|
1168
1168
|
WarningIcon,
|
|
1169
|
-
|
|
1169
|
+
CircleNotchIcon
|
|
1170
1170
|
} from "@phosphor-icons/react";
|
|
1171
1171
|
import { Toaster as Sonner, toast as sonnertoast } from "sonner";
|
|
1172
1172
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1173
|
-
var iconBaseClass = "w-5 h-
|
|
1173
|
+
var iconBaseClass = "w-5 h-5";
|
|
1174
1174
|
var Toaster = ({ testId, ...props }) => {
|
|
1175
1175
|
return /* @__PURE__ */ jsx7(
|
|
1176
1176
|
Sonner,
|
|
1177
1177
|
{
|
|
1178
1178
|
className: "toaster group",
|
|
1179
1179
|
position: "top-center",
|
|
1180
|
+
duration: 4e3,
|
|
1180
1181
|
toastOptions: {
|
|
1182
|
+
style: {
|
|
1183
|
+
backdropFilter: "blur(8px)",
|
|
1184
|
+
WebkitBackdropFilter: "blur(8px)"
|
|
1185
|
+
},
|
|
1181
1186
|
classNames: {
|
|
1182
1187
|
toast: `
|
|
1183
1188
|
group toast
|
|
1184
|
-
bg-background
|
|
1189
|
+
bg-background/95
|
|
1185
1190
|
text-foreground
|
|
1186
|
-
shadow-
|
|
1191
|
+
shadow-xl rounded-lg
|
|
1187
1192
|
border-l-4
|
|
1188
|
-
|
|
1193
|
+
|
|
1189
1194
|
flex items-center gap-3
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
data-[type=
|
|
1193
|
-
data-[type=
|
|
1195
|
+
transition-all duration-300
|
|
1196
|
+
hover:scale-[1.02] hover:shadow-2xl
|
|
1197
|
+
data-[type=success]:border-l-green-500 data-[type=success]:bg-green-50/95 data-[type=success]:text-green-800 data-[type=success]:border-green-500 data-
|
|
1198
|
+
data-[type=error]:border-l-red-500 data-[type=error]:bg-red-50/95 data-[type=error]:text-red-800 data-[type=error]:border-red-500
|
|
1199
|
+
data-[type=warning]:border-l-yellow-500 data-[type=warning]:bg-yellow-50/95 data-[type=warning]:text-yellow-800 data-[type=warning]:border-yellow-500
|
|
1200
|
+
data-[type=info]:border-l-blue-500 data-[type=info]:bg-blue-50/95 data-[type=info]:text-blue-800 data-[type=info]:border-blue-500
|
|
1194
1201
|
`,
|
|
1195
1202
|
description: `
|
|
1196
|
-
text-
|
|
1203
|
+
text-xs
|
|
1204
|
+
font-semibold
|
|
1197
1205
|
group-[.toast]:text-neutral-600
|
|
1198
1206
|
`,
|
|
1199
1207
|
actionButton: `
|
|
1200
1208
|
ml-auto
|
|
1201
1209
|
rounded-md px-3 py-1 text-sm font-semibold
|
|
1202
1210
|
bg-neutral-800 text-white
|
|
1203
|
-
hover:bg-neutral-700
|
|
1204
|
-
transition-
|
|
1211
|
+
hover:bg-neutral-700 hover:scale-105
|
|
1212
|
+
transition-all duration-200
|
|
1213
|
+
active:scale-95
|
|
1205
1214
|
`,
|
|
1206
1215
|
cancelButton: `
|
|
1207
1216
|
ml-2
|
|
1208
1217
|
rounded-md px-3 py-1 text-sm font-semibold
|
|
1209
1218
|
bg-neutral-100 text-neutral-700
|
|
1210
|
-
hover:bg-neutral-200
|
|
1211
|
-
transition-
|
|
1219
|
+
hover:bg-neutral-200 hover:scale-105
|
|
1220
|
+
transition-all duration-200
|
|
1221
|
+
active:scale-95
|
|
1212
1222
|
`
|
|
1213
1223
|
}
|
|
1214
1224
|
},
|
|
@@ -1218,24 +1228,52 @@ var Toaster = ({ testId, ...props }) => {
|
|
|
1218
1228
|
);
|
|
1219
1229
|
};
|
|
1220
1230
|
var toast = {
|
|
1221
|
-
success: (message) => sonnertoast.success(message, {
|
|
1222
|
-
|
|
1231
|
+
success: (message, description) => sonnertoast.success(message, {
|
|
1232
|
+
description,
|
|
1233
|
+
icon: /* @__PURE__ */ jsx7(
|
|
1234
|
+
CheckCircleIcon,
|
|
1235
|
+
{
|
|
1236
|
+
className: `${iconBaseClass} text-green-600`,
|
|
1237
|
+
weight: "fill"
|
|
1238
|
+
}
|
|
1239
|
+
),
|
|
1223
1240
|
className: "sonner-success"
|
|
1224
1241
|
}),
|
|
1225
|
-
error: (message) => sonnertoast.error(message, {
|
|
1226
|
-
|
|
1242
|
+
error: (message, description) => sonnertoast.error(message, {
|
|
1243
|
+
description,
|
|
1244
|
+
icon: /* @__PURE__ */ jsx7(
|
|
1245
|
+
XCircleIcon,
|
|
1246
|
+
{
|
|
1247
|
+
className: `${iconBaseClass} text-red-600`,
|
|
1248
|
+
weight: "fill"
|
|
1249
|
+
}
|
|
1250
|
+
),
|
|
1227
1251
|
className: "sonner-error"
|
|
1228
1252
|
}),
|
|
1229
|
-
warning: (message) => sonnertoast.warning(message, {
|
|
1230
|
-
|
|
1231
|
-
|
|
1253
|
+
warning: (message, description) => sonnertoast.warning(message, {
|
|
1254
|
+
description,
|
|
1255
|
+
icon: /* @__PURE__ */ jsx7(
|
|
1256
|
+
WarningIcon,
|
|
1257
|
+
{
|
|
1258
|
+
className: `${iconBaseClass} text-yellow-600`,
|
|
1259
|
+
weight: "fill"
|
|
1260
|
+
}
|
|
1261
|
+
),
|
|
1262
|
+
className: "sonner-warning"
|
|
1232
1263
|
}),
|
|
1233
|
-
info: (message) => sonnertoast.info(message, {
|
|
1264
|
+
info: (message, description) => sonnertoast.info(message, {
|
|
1265
|
+
description,
|
|
1234
1266
|
icon: /* @__PURE__ */ jsx7(InfoIcon, { className: `${iconBaseClass} text-blue-600`, weight: "fill" }),
|
|
1235
|
-
className: "sonner-
|
|
1267
|
+
className: "sonner-info"
|
|
1236
1268
|
}),
|
|
1237
|
-
loading: (message) => sonnertoast(message, {
|
|
1238
|
-
|
|
1269
|
+
loading: (message, description) => sonnertoast(message, {
|
|
1270
|
+
description,
|
|
1271
|
+
icon: /* @__PURE__ */ jsx7(
|
|
1272
|
+
CircleNotchIcon,
|
|
1273
|
+
{
|
|
1274
|
+
className: `${iconBaseClass} animate-spin text-gray-600`
|
|
1275
|
+
}
|
|
1276
|
+
),
|
|
1239
1277
|
className: "sonner-loading"
|
|
1240
1278
|
})
|
|
1241
1279
|
};
|
|
@@ -1383,12 +1421,21 @@ var TooltipTriggerBase = React7.forwardRef(({ children, onPointerDown, ...props
|
|
|
1383
1421
|
},
|
|
1384
1422
|
[onPointerDown]
|
|
1385
1423
|
);
|
|
1424
|
+
const onClick = React7.useCallback(
|
|
1425
|
+
(e) => {
|
|
1426
|
+
if (onPointerDown) {
|
|
1427
|
+
onPointerDown(e);
|
|
1428
|
+
}
|
|
1429
|
+
},
|
|
1430
|
+
[onPointerDown]
|
|
1431
|
+
);
|
|
1386
1432
|
return /* @__PURE__ */ jsx8(
|
|
1387
1433
|
TooltipPrimitive.Trigger,
|
|
1388
1434
|
{
|
|
1389
1435
|
ref,
|
|
1390
1436
|
tabIndex: -1,
|
|
1391
1437
|
onPointerDown: onPointerDown ? handlePointerDown : void 0,
|
|
1438
|
+
onClick,
|
|
1392
1439
|
"data-tooltip-trigger": true,
|
|
1393
1440
|
"aria-describedby": "tooltip-content",
|
|
1394
1441
|
...props,
|
|
@@ -1685,7 +1732,7 @@ var ButtonBase = React10.forwardRef(
|
|
|
1685
1732
|
isActivelyLoading && /* @__PURE__ */ jsxs8("span", { className: "absolute inset-0 flex items-center justify-center pointer-events-none rounded-md", children: [
|
|
1686
1733
|
/* @__PURE__ */ jsx11("span", { className: "absolute inset-0 rounded-md backdrop-blur overflow-hidden" }),
|
|
1687
1734
|
/* @__PURE__ */ jsx11(
|
|
1688
|
-
|
|
1735
|
+
CircleNotchIcon2,
|
|
1689
1736
|
{
|
|
1690
1737
|
weight: "bold",
|
|
1691
1738
|
className: "relative animate-spin h-4 w-4 text-current"
|
|
@@ -2761,8 +2808,7 @@ function MultiCombobox({
|
|
|
2761
2808
|
)
|
|
2762
2809
|
]
|
|
2763
2810
|
}
|
|
2764
|
-
)
|
|
2765
|
-
/* @__PURE__ */ jsx21(ErrorMessage_default, { error })
|
|
2811
|
+
)
|
|
2766
2812
|
]
|
|
2767
2813
|
}
|
|
2768
2814
|
);
|
|
@@ -7347,7 +7393,7 @@ function StatusIndicator({
|
|
|
7347
7393
|
|
|
7348
7394
|
// src/components/ui/form/DebouncedInput.tsx
|
|
7349
7395
|
import { useEffect as useEffect15, useState as useState14 } from "react";
|
|
7350
|
-
import { CircleNotchIcon as
|
|
7396
|
+
import { CircleNotchIcon as CircleNotchIcon3 } from "@phosphor-icons/react";
|
|
7351
7397
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
7352
7398
|
function DebouncedInput({
|
|
7353
7399
|
value: initialValue,
|
|
@@ -7382,7 +7428,7 @@ function DebouncedInput({
|
|
|
7382
7428
|
}, [debounce2, initialValue, onChange, value]);
|
|
7383
7429
|
const renderRightIcon = () => {
|
|
7384
7430
|
if (showLoadingIndicator && isDebouncing) {
|
|
7385
|
-
return /* @__PURE__ */ jsx54(
|
|
7431
|
+
return /* @__PURE__ */ jsx54(CircleNotchIcon3, { className: "h-4 w-4 animate-spin text-muted-foreground" });
|
|
7386
7432
|
}
|
|
7387
7433
|
return rightIcon;
|
|
7388
7434
|
};
|
|
@@ -7629,7 +7675,7 @@ function CalendarBase2({
|
|
|
7629
7675
|
selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold hover:text-white rounded-md",
|
|
7630
7676
|
today: "bg-muted text-foreground font-bold ring-2 ring-primary/30 ring-inset rounded-md",
|
|
7631
7677
|
outside: "text-muted-foreground opacity-60 aria-selected:bg-muted/50 aria-selected:text-foreground",
|
|
7632
|
-
disabled: "text-muted-foreground cursor-not-allowed
|
|
7678
|
+
disabled: "text-muted-foreground cursor-not-allowed",
|
|
7633
7679
|
range_middle: "aria-selected:bg-muted aria-selected:text-foreground",
|
|
7634
7680
|
hidden: "invisible",
|
|
7635
7681
|
...classNames
|
|
@@ -14013,6 +14059,11 @@ function WeekView({
|
|
|
14013
14059
|
// src/components/ui/selects/AvatarCombobox.tsx
|
|
14014
14060
|
import { useId as useId3, useState as useState36 } from "react";
|
|
14015
14061
|
import { CaretDownIcon as CaretDownIcon6, CheckIcon as CheckIcon11 } from "@phosphor-icons/react";
|
|
14062
|
+
|
|
14063
|
+
// public/pwa-512x512.png
|
|
14064
|
+
var pwa_512x512_default = "./pwa-512x512-4NJPUGCI.png";
|
|
14065
|
+
|
|
14066
|
+
// src/components/ui/selects/AvatarCombobox.tsx
|
|
14016
14067
|
import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
14017
14068
|
var DEFAULT_COLORS = [
|
|
14018
14069
|
"bg-purple-100 text-purple-700",
|
|
@@ -14061,10 +14112,14 @@ function AvatarCombobox({
|
|
|
14061
14112
|
const allItems = items || (groupItems ? Object.values(groupItems).flat() : []);
|
|
14062
14113
|
const selectedItem = allItems.find((item) => item.value === selected);
|
|
14063
14114
|
const renderItem = (item) => {
|
|
14064
|
-
|
|
14065
|
-
|
|
14115
|
+
let avatarContent;
|
|
14116
|
+
let colorClass;
|
|
14117
|
+
if (!item.img) {
|
|
14118
|
+
avatarContent = item.avatar ?? item.label.charAt(0).toUpperCase();
|
|
14119
|
+
colorClass = item.avatarClassName ?? getColor(item.value, colors2);
|
|
14120
|
+
}
|
|
14066
14121
|
return /* @__PURE__ */ jsxs63(Fragment13, { children: [
|
|
14067
|
-
/* @__PURE__ */ jsx85(Square, { className: colorClass, children: avatarContent }),
|
|
14122
|
+
/* @__PURE__ */ jsx85(Square, { className: colorClass, children: !avatarContent ? /* @__PURE__ */ jsx85("img", { src: pwa_512x512_default }) : avatarContent }),
|
|
14068
14123
|
/* @__PURE__ */ jsx85("span", { className: "truncate", children: item.label })
|
|
14069
14124
|
] });
|
|
14070
14125
|
};
|
|
@@ -14400,27 +14455,27 @@ function MultiSelect({
|
|
|
14400
14455
|
}
|
|
14401
14456
|
|
|
14402
14457
|
// src/components/ui/charts/Chart.tsx
|
|
14403
|
-
import { useEffect as
|
|
14458
|
+
import { useEffect as useEffect34, useCallback as useCallback18, useMemo as useMemo26 } from "react";
|
|
14404
14459
|
import {
|
|
14405
|
-
ComposedChart,
|
|
14406
|
-
Bar,
|
|
14407
|
-
Line,
|
|
14408
|
-
Area,
|
|
14460
|
+
ComposedChart as ComposedChart2,
|
|
14461
|
+
Bar as Bar2,
|
|
14462
|
+
Line as Line2,
|
|
14463
|
+
Area as Area2,
|
|
14409
14464
|
Rectangle,
|
|
14410
14465
|
ReferenceLine,
|
|
14411
|
-
XAxis,
|
|
14412
|
-
YAxis,
|
|
14466
|
+
XAxis as XAxis2,
|
|
14467
|
+
YAxis as YAxis2,
|
|
14413
14468
|
CartesianGrid,
|
|
14414
14469
|
Tooltip,
|
|
14415
14470
|
Legend,
|
|
14416
14471
|
LabelList,
|
|
14417
|
-
ResponsiveContainer
|
|
14472
|
+
ResponsiveContainer as ResponsiveContainer2
|
|
14418
14473
|
} from "recharts";
|
|
14419
14474
|
|
|
14420
14475
|
// src/components/ui/charts/utils/helpers.ts
|
|
14421
14476
|
var formatFieldName = (fieldName) => {
|
|
14422
14477
|
return fieldName.split(/[/_-]/).filter(Boolean).map((word) => {
|
|
14423
|
-
return word.charAt(0).toUpperCase() + word.slice(1)
|
|
14478
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
14424
14479
|
}).join(" ").trim();
|
|
14425
14480
|
};
|
|
14426
14481
|
var detectDataFields = (data, xAxisKey) => {
|
|
@@ -15981,8 +16036,213 @@ var TooltipSimple = ({
|
|
|
15981
16036
|
};
|
|
15982
16037
|
var TooltipSimple_default = TooltipSimple;
|
|
15983
16038
|
|
|
15984
|
-
// src/components/ui/charts/
|
|
16039
|
+
// src/components/ui/charts/components/Brush.tsx
|
|
16040
|
+
import {
|
|
16041
|
+
ComposedChart,
|
|
16042
|
+
Bar,
|
|
16043
|
+
Line,
|
|
16044
|
+
Area,
|
|
16045
|
+
XAxis,
|
|
16046
|
+
YAxis,
|
|
16047
|
+
ResponsiveContainer
|
|
16048
|
+
} from "recharts";
|
|
15985
16049
|
import { jsx as jsx94, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
16050
|
+
var Brush = ({
|
|
16051
|
+
data,
|
|
16052
|
+
startIndex,
|
|
16053
|
+
endIndex,
|
|
16054
|
+
onMouseDown,
|
|
16055
|
+
brushRef,
|
|
16056
|
+
xAxisKey,
|
|
16057
|
+
seriesOrder,
|
|
16058
|
+
finalColors,
|
|
16059
|
+
brushHeight = 80,
|
|
16060
|
+
brushColor,
|
|
16061
|
+
miniChartOpacity = 0.3,
|
|
16062
|
+
margin = { left: 0, right: 0 }
|
|
16063
|
+
}) => {
|
|
16064
|
+
const dataLength = data.length;
|
|
16065
|
+
return /* @__PURE__ */ jsxs72("div", { className: "w-full px-8 pb-4", children: [
|
|
16066
|
+
/* @__PURE__ */ jsxs72(
|
|
16067
|
+
"div",
|
|
16068
|
+
{
|
|
16069
|
+
className: "relative rounded-md border bg-muted/5 shadow-inner",
|
|
16070
|
+
style: { height: brushHeight },
|
|
16071
|
+
children: [
|
|
16072
|
+
/* @__PURE__ */ jsx94(
|
|
16073
|
+
"div",
|
|
16074
|
+
{
|
|
16075
|
+
className: "absolute inset-0 pointer-events-none rounded-md",
|
|
16076
|
+
style: { opacity: miniChartOpacity },
|
|
16077
|
+
children: /* @__PURE__ */ jsx94(ResponsiveContainer, { width: "100%", height: brushHeight, children: /* @__PURE__ */ jsxs72(
|
|
16078
|
+
ComposedChart,
|
|
16079
|
+
{
|
|
16080
|
+
data: data.map((item) => ({
|
|
16081
|
+
...item,
|
|
16082
|
+
name: String(item[xAxisKey] || "N/A")
|
|
16083
|
+
})),
|
|
16084
|
+
height: brushHeight,
|
|
16085
|
+
margin: {
|
|
16086
|
+
top: 5,
|
|
16087
|
+
right: margin.right ?? 30,
|
|
16088
|
+
left: margin.left ?? 0,
|
|
16089
|
+
bottom: 5
|
|
16090
|
+
},
|
|
16091
|
+
children: [
|
|
16092
|
+
/* @__PURE__ */ jsx94(XAxis, { dataKey: xAxisKey, hide: true }),
|
|
16093
|
+
/* @__PURE__ */ jsx94(YAxis, { yAxisId: "left", hide: true }),
|
|
16094
|
+
seriesOrder.map((s) => {
|
|
16095
|
+
const key = s.key;
|
|
16096
|
+
const color = finalColors[key];
|
|
16097
|
+
if (s.type === "bar") {
|
|
16098
|
+
return /* @__PURE__ */ jsx94(
|
|
16099
|
+
Bar,
|
|
16100
|
+
{
|
|
16101
|
+
dataKey: key,
|
|
16102
|
+
yAxisId: "left",
|
|
16103
|
+
fill: color,
|
|
16104
|
+
radius: [2, 2, 0, 0]
|
|
16105
|
+
},
|
|
16106
|
+
`brush-bar-${key}`
|
|
16107
|
+
);
|
|
16108
|
+
}
|
|
16109
|
+
if (s.type === "line") {
|
|
16110
|
+
return /* @__PURE__ */ jsx94(
|
|
16111
|
+
Line,
|
|
16112
|
+
{
|
|
16113
|
+
type: "monotone",
|
|
16114
|
+
dataKey: key,
|
|
16115
|
+
yAxisId: "left",
|
|
16116
|
+
stroke: color,
|
|
16117
|
+
strokeWidth: 1.5,
|
|
16118
|
+
dot: false
|
|
16119
|
+
},
|
|
16120
|
+
`brush-line-${key}`
|
|
16121
|
+
);
|
|
16122
|
+
}
|
|
16123
|
+
if (s.type === "area") {
|
|
16124
|
+
return /* @__PURE__ */ jsx94(
|
|
16125
|
+
Area,
|
|
16126
|
+
{
|
|
16127
|
+
type: "monotone",
|
|
16128
|
+
dataKey: key,
|
|
16129
|
+
yAxisId: "left",
|
|
16130
|
+
stroke: color,
|
|
16131
|
+
fill: `url(#gradient-${key})`,
|
|
16132
|
+
strokeWidth: 1.5
|
|
16133
|
+
},
|
|
16134
|
+
`brush-area-${key}`
|
|
16135
|
+
);
|
|
16136
|
+
}
|
|
16137
|
+
return null;
|
|
16138
|
+
})
|
|
16139
|
+
]
|
|
16140
|
+
}
|
|
16141
|
+
) })
|
|
16142
|
+
}
|
|
16143
|
+
),
|
|
16144
|
+
/* @__PURE__ */ jsxs72(
|
|
16145
|
+
"div",
|
|
16146
|
+
{
|
|
16147
|
+
ref: brushRef,
|
|
16148
|
+
className: "absolute inset-0 cursor-move rounded-md",
|
|
16149
|
+
style: { userSelect: "none" },
|
|
16150
|
+
children: [
|
|
16151
|
+
/* @__PURE__ */ jsx94(
|
|
16152
|
+
"div",
|
|
16153
|
+
{
|
|
16154
|
+
className: "absolute top-0 bottom-0 left-0 bg-background/80 backdrop-blur-[1px] pointer-events-none rounded-l-md border-r border-border/50",
|
|
16155
|
+
style: {
|
|
16156
|
+
width: `${startIndex / (dataLength - 1) * 100}%`
|
|
16157
|
+
}
|
|
16158
|
+
}
|
|
16159
|
+
),
|
|
16160
|
+
/* @__PURE__ */ jsx94(
|
|
16161
|
+
"div",
|
|
16162
|
+
{
|
|
16163
|
+
className: "absolute top-0 bottom-0 right-0 bg-background/80 backdrop-blur-[1px] pointer-events-none rounded-r-md border-l border-border/50",
|
|
16164
|
+
style: {
|
|
16165
|
+
width: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`
|
|
16166
|
+
}
|
|
16167
|
+
}
|
|
16168
|
+
),
|
|
16169
|
+
/* @__PURE__ */ jsxs72(
|
|
16170
|
+
"div",
|
|
16171
|
+
{
|
|
16172
|
+
className: "absolute top-0 bottom-0 border-x-2 border-y border-primary/50 cursor-move group hover:bg-primary/5 rounded-md",
|
|
16173
|
+
style: {
|
|
16174
|
+
left: `${startIndex / (dataLength - 1) * 100}%`,
|
|
16175
|
+
right: `${(dataLength - 1 - endIndex) / (dataLength - 1) * 100}%`,
|
|
16176
|
+
backgroundColor: "transparent"
|
|
16177
|
+
},
|
|
16178
|
+
onMouseDown: (e) => onMouseDown(e, "middle"),
|
|
16179
|
+
children: [
|
|
16180
|
+
/* @__PURE__ */ jsx94(
|
|
16181
|
+
"div",
|
|
16182
|
+
{
|
|
16183
|
+
className: "absolute top-1/2 -translate-y-1/2 -left-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
|
|
16184
|
+
onMouseDown: (e) => {
|
|
16185
|
+
e.stopPropagation();
|
|
16186
|
+
onMouseDown(e, "start");
|
|
16187
|
+
},
|
|
16188
|
+
children: /* @__PURE__ */ jsx94(
|
|
16189
|
+
"div",
|
|
16190
|
+
{
|
|
16191
|
+
className: "w-1.5 h-6 rounded-sm flex flex-col items-center justify-center gap-1 border border-primary/20",
|
|
16192
|
+
style: {
|
|
16193
|
+
backgroundColor: brushColor ?? "hsl(var(--primary))"
|
|
16194
|
+
}
|
|
16195
|
+
}
|
|
16196
|
+
)
|
|
16197
|
+
}
|
|
16198
|
+
),
|
|
16199
|
+
/* @__PURE__ */ jsx94(
|
|
16200
|
+
"div",
|
|
16201
|
+
{
|
|
16202
|
+
className: "absolute top-1/2 -translate-y-1/2 -right-3.5 w-7 h-12 flex items-center justify-center cursor-ew-resize group/handle",
|
|
16203
|
+
onMouseDown: (e) => {
|
|
16204
|
+
e.stopPropagation();
|
|
16205
|
+
onMouseDown(e, "end");
|
|
16206
|
+
},
|
|
16207
|
+
children: /* @__PURE__ */ jsx94(
|
|
16208
|
+
"div",
|
|
16209
|
+
{
|
|
16210
|
+
className: "w-1.5 h-6 rounded-sm flex flex-col items-center justify-center gap-1 border border-primary/20",
|
|
16211
|
+
style: {
|
|
16212
|
+
backgroundColor: brushColor ?? "hsl(var(--primary))"
|
|
16213
|
+
}
|
|
16214
|
+
}
|
|
16215
|
+
)
|
|
16216
|
+
}
|
|
16217
|
+
)
|
|
16218
|
+
]
|
|
16219
|
+
}
|
|
16220
|
+
)
|
|
16221
|
+
]
|
|
16222
|
+
}
|
|
16223
|
+
)
|
|
16224
|
+
]
|
|
16225
|
+
}
|
|
16226
|
+
),
|
|
16227
|
+
/* @__PURE__ */ jsxs72("div", { className: "flex justify-between items-center mt-2 text-xs text-muted-foreground", children: [
|
|
16228
|
+
/* @__PURE__ */ jsxs72("span", { children: [
|
|
16229
|
+
data[startIndex]?.[xAxisKey],
|
|
16230
|
+
" - ",
|
|
16231
|
+
data[endIndex]?.[xAxisKey]
|
|
16232
|
+
] }),
|
|
16233
|
+
/* @__PURE__ */ jsxs72("span", { children: [
|
|
16234
|
+
endIndex - startIndex + 1,
|
|
16235
|
+
" de ",
|
|
16236
|
+
dataLength,
|
|
16237
|
+
" per\xEDodos"
|
|
16238
|
+
] })
|
|
16239
|
+
] })
|
|
16240
|
+
] });
|
|
16241
|
+
};
|
|
16242
|
+
var Brush_default = Brush;
|
|
16243
|
+
|
|
16244
|
+
// src/components/ui/charts/utils/pillLabelRenderer.tsx
|
|
16245
|
+
import { jsx as jsx95, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
15986
16246
|
var formatCompactNumber = (value) => {
|
|
15987
16247
|
const isNegative = value < 0;
|
|
15988
16248
|
const absValue = Math.abs(value);
|
|
@@ -16073,8 +16333,8 @@ var renderPillLabel = (color, variant, valueFormatter2) => {
|
|
|
16073
16333
|
} else {
|
|
16074
16334
|
textColor = "#374151";
|
|
16075
16335
|
}
|
|
16076
|
-
return /* @__PURE__ */
|
|
16077
|
-
/* @__PURE__ */
|
|
16336
|
+
return /* @__PURE__ */ jsxs73("g", { children: [
|
|
16337
|
+
/* @__PURE__ */ jsx95(
|
|
16078
16338
|
"rect",
|
|
16079
16339
|
{
|
|
16080
16340
|
x: rectX,
|
|
@@ -16087,7 +16347,7 @@ var renderPillLabel = (color, variant, valueFormatter2) => {
|
|
|
16087
16347
|
strokeWidth: rectStroke ? 1 : 0
|
|
16088
16348
|
}
|
|
16089
16349
|
),
|
|
16090
|
-
/* @__PURE__ */
|
|
16350
|
+
/* @__PURE__ */ jsx95(
|
|
16091
16351
|
"text",
|
|
16092
16352
|
{
|
|
16093
16353
|
x: textX,
|
|
@@ -16158,7 +16418,7 @@ var renderInsideBarLabel = (color, valueFormatter2) => {
|
|
|
16158
16418
|
const heightFactor = Math.max(0.8, Math.min(1.6, pHeight / heightRef));
|
|
16159
16419
|
fontSize = Math.min(18, Math.max(8, Math.round(fontSize * heightFactor)));
|
|
16160
16420
|
}
|
|
16161
|
-
return /* @__PURE__ */
|
|
16421
|
+
return /* @__PURE__ */ jsx95(
|
|
16162
16422
|
"text",
|
|
16163
16423
|
{
|
|
16164
16424
|
x: centerX,
|
|
@@ -16177,7 +16437,7 @@ var renderInsideBarLabel = (color, valueFormatter2) => {
|
|
|
16177
16437
|
|
|
16178
16438
|
// src/components/ui/charts/NoData.tsx
|
|
16179
16439
|
import { motion as motion21 } from "framer-motion";
|
|
16180
|
-
import { Fragment as Fragment17, jsx as
|
|
16440
|
+
import { Fragment as Fragment17, jsx as jsx96, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
16181
16441
|
var ChartBar = ({ x, y, w, h, i, loading }) => {
|
|
16182
16442
|
const baseY = y - h;
|
|
16183
16443
|
const d = i * 0.08;
|
|
@@ -16188,8 +16448,8 @@ var ChartBar = ({ x, y, w, h, i, loading }) => {
|
|
|
16188
16448
|
ease: "easeInOut",
|
|
16189
16449
|
delay: d
|
|
16190
16450
|
};
|
|
16191
|
-
return /* @__PURE__ */
|
|
16192
|
-
/* @__PURE__ */
|
|
16451
|
+
return /* @__PURE__ */ jsxs74("g", { children: [
|
|
16452
|
+
/* @__PURE__ */ jsx96(
|
|
16193
16453
|
motion21.rect,
|
|
16194
16454
|
{
|
|
16195
16455
|
x,
|
|
@@ -16204,7 +16464,7 @@ var ChartBar = ({ x, y, w, h, i, loading }) => {
|
|
|
16204
16464
|
style: { transformBox: "fill-box", originY: 1 }
|
|
16205
16465
|
}
|
|
16206
16466
|
),
|
|
16207
|
-
/* @__PURE__ */
|
|
16467
|
+
/* @__PURE__ */ jsx96(
|
|
16208
16468
|
motion21.rect,
|
|
16209
16469
|
{
|
|
16210
16470
|
x,
|
|
@@ -16220,7 +16480,7 @@ var ChartBar = ({ x, y, w, h, i, loading }) => {
|
|
|
16220
16480
|
style: { transformBox: "fill-box", originY: 1 }
|
|
16221
16481
|
}
|
|
16222
16482
|
),
|
|
16223
|
-
/* @__PURE__ */
|
|
16483
|
+
/* @__PURE__ */ jsx96(
|
|
16224
16484
|
motion21.line,
|
|
16225
16485
|
{
|
|
16226
16486
|
x1: x + w / 2,
|
|
@@ -16254,7 +16514,7 @@ var NoData = ({
|
|
|
16254
16514
|
{ x: 580, w: 100, h: h * 0.35 },
|
|
16255
16515
|
{ x: 700, w: 100, h: h * 0.3 }
|
|
16256
16516
|
];
|
|
16257
|
-
return /* @__PURE__ */
|
|
16517
|
+
return /* @__PURE__ */ jsx96(
|
|
16258
16518
|
"div",
|
|
16259
16519
|
{
|
|
16260
16520
|
className: cn(
|
|
@@ -16267,17 +16527,17 @@ var NoData = ({
|
|
|
16267
16527
|
},
|
|
16268
16528
|
role: "img",
|
|
16269
16529
|
"aria-label": message,
|
|
16270
|
-
children: /* @__PURE__ */
|
|
16271
|
-
/* @__PURE__ */
|
|
16530
|
+
children: /* @__PURE__ */ jsx96("div", { className: "w-full flex items-center justify-center pl-[var(--pl)] p-6 h-[var(--svg-h)]", children: /* @__PURE__ */ jsxs74("div", { className: "w-full max-w-[900px] relative", children: [
|
|
16531
|
+
/* @__PURE__ */ jsxs74(
|
|
16272
16532
|
"svg",
|
|
16273
16533
|
{
|
|
16274
16534
|
className: "w-full h-[var(--svg-h)] opacity-40",
|
|
16275
16535
|
viewBox: `0 0 900 ${h}`,
|
|
16276
16536
|
preserveAspectRatio: "none",
|
|
16277
16537
|
children: [
|
|
16278
|
-
/* @__PURE__ */
|
|
16279
|
-
/* @__PURE__ */
|
|
16280
|
-
/* @__PURE__ */
|
|
16538
|
+
/* @__PURE__ */ jsxs74("defs", { children: [
|
|
16539
|
+
/* @__PURE__ */ jsxs74("linearGradient", { id: "bg", x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
16540
|
+
/* @__PURE__ */ jsx96(
|
|
16281
16541
|
"stop",
|
|
16282
16542
|
{
|
|
16283
16543
|
offset: "0%",
|
|
@@ -16285,7 +16545,7 @@ var NoData = ({
|
|
|
16285
16545
|
stopOpacity: "0.15"
|
|
16286
16546
|
}
|
|
16287
16547
|
),
|
|
16288
|
-
/* @__PURE__ */
|
|
16548
|
+
/* @__PURE__ */ jsx96(
|
|
16289
16549
|
"stop",
|
|
16290
16550
|
{
|
|
16291
16551
|
offset: "100%",
|
|
@@ -16294,8 +16554,8 @@ var NoData = ({
|
|
|
16294
16554
|
}
|
|
16295
16555
|
)
|
|
16296
16556
|
] }),
|
|
16297
|
-
/* @__PURE__ */
|
|
16298
|
-
/* @__PURE__ */
|
|
16557
|
+
/* @__PURE__ */ jsxs74("linearGradient", { id: "gg", x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
16558
|
+
/* @__PURE__ */ jsx96(
|
|
16299
16559
|
"stop",
|
|
16300
16560
|
{
|
|
16301
16561
|
offset: "0%",
|
|
@@ -16303,7 +16563,7 @@ var NoData = ({
|
|
|
16303
16563
|
stopOpacity: "0.4"
|
|
16304
16564
|
}
|
|
16305
16565
|
),
|
|
16306
|
-
/* @__PURE__ */
|
|
16566
|
+
/* @__PURE__ */ jsx96(
|
|
16307
16567
|
"stop",
|
|
16308
16568
|
{
|
|
16309
16569
|
offset: "100%",
|
|
@@ -16312,17 +16572,17 @@ var NoData = ({
|
|
|
16312
16572
|
}
|
|
16313
16573
|
)
|
|
16314
16574
|
] }),
|
|
16315
|
-
/* @__PURE__ */
|
|
16316
|
-
/* @__PURE__ */
|
|
16317
|
-
/* @__PURE__ */
|
|
16318
|
-
/* @__PURE__ */
|
|
16319
|
-
/* @__PURE__ */
|
|
16320
|
-
/* @__PURE__ */
|
|
16321
|
-
/* @__PURE__ */
|
|
16575
|
+
/* @__PURE__ */ jsxs74("filter", { id: "s", x: "-20%", y: "-20%", width: "140%", height: "140%", children: [
|
|
16576
|
+
/* @__PURE__ */ jsx96("feGaussianBlur", { in: "SourceAlpha", stdDeviation: "3" }),
|
|
16577
|
+
/* @__PURE__ */ jsx96("feOffset", { dx: "0", dy: "2" }),
|
|
16578
|
+
/* @__PURE__ */ jsx96("feComponentTransfer", { children: /* @__PURE__ */ jsx96("feFuncA", { type: "linear", slope: "0.2" }) }),
|
|
16579
|
+
/* @__PURE__ */ jsxs74("feMerge", { children: [
|
|
16580
|
+
/* @__PURE__ */ jsx96("feMergeNode", {}),
|
|
16581
|
+
/* @__PURE__ */ jsx96("feMergeNode", { in: "SourceGraphic" })
|
|
16322
16582
|
] })
|
|
16323
16583
|
] })
|
|
16324
16584
|
] }),
|
|
16325
|
-
/* @__PURE__ */
|
|
16585
|
+
/* @__PURE__ */ jsx96(
|
|
16326
16586
|
"rect",
|
|
16327
16587
|
{
|
|
16328
16588
|
x: 0,
|
|
@@ -16333,7 +16593,7 @@ var NoData = ({
|
|
|
16333
16593
|
rx: 8
|
|
16334
16594
|
}
|
|
16335
16595
|
),
|
|
16336
|
-
[...Array(6)].map((_, i) => /* @__PURE__ */
|
|
16596
|
+
[...Array(6)].map((_, i) => /* @__PURE__ */ jsx96(
|
|
16337
16597
|
"line",
|
|
16338
16598
|
{
|
|
16339
16599
|
x1: 50,
|
|
@@ -16346,7 +16606,7 @@ var NoData = ({
|
|
|
16346
16606
|
},
|
|
16347
16607
|
i
|
|
16348
16608
|
)),
|
|
16349
|
-
/* @__PURE__ */
|
|
16609
|
+
/* @__PURE__ */ jsx96(
|
|
16350
16610
|
"line",
|
|
16351
16611
|
{
|
|
16352
16612
|
x1: 50,
|
|
@@ -16358,7 +16618,7 @@ var NoData = ({
|
|
|
16358
16618
|
opacity: 0.5
|
|
16359
16619
|
}
|
|
16360
16620
|
),
|
|
16361
|
-
/* @__PURE__ */
|
|
16621
|
+
/* @__PURE__ */ jsx96(
|
|
16362
16622
|
"line",
|
|
16363
16623
|
{
|
|
16364
16624
|
x1: 50,
|
|
@@ -16370,7 +16630,7 @@ var NoData = ({
|
|
|
16370
16630
|
opacity: 0.5
|
|
16371
16631
|
}
|
|
16372
16632
|
),
|
|
16373
|
-
bars.map((b, i) => /* @__PURE__ */
|
|
16633
|
+
bars.map((b, i) => /* @__PURE__ */ jsx96(
|
|
16374
16634
|
ChartBar,
|
|
16375
16635
|
{
|
|
16376
16636
|
x: b.x,
|
|
@@ -16385,15 +16645,15 @@ var NoData = ({
|
|
|
16385
16645
|
]
|
|
16386
16646
|
}
|
|
16387
16647
|
),
|
|
16388
|
-
/* @__PURE__ */
|
|
16648
|
+
/* @__PURE__ */ jsx96("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none h-[var(--svg-h)]", children: /* @__PURE__ */ jsx96("div", { className: "pointer-events-auto bg-card/95 backdrop-blur-sm px-8 py-6 rounded-xl border border-border/50 shadow-lg text-center max-w-md", children: isLoading ? /* @__PURE__ */ jsx96("div", { className: "flex flex-col items-center gap-4", children: /* @__PURE__ */ jsx96(
|
|
16389
16649
|
LoadingBase,
|
|
16390
16650
|
{
|
|
16391
16651
|
size: "xl",
|
|
16392
16652
|
message: loadingMessage ?? "Carregando"
|
|
16393
16653
|
}
|
|
16394
|
-
) }) : /* @__PURE__ */
|
|
16395
|
-
title && /* @__PURE__ */
|
|
16396
|
-
/* @__PURE__ */
|
|
16654
|
+
) }) : /* @__PURE__ */ jsxs74(Fragment17, { children: [
|
|
16655
|
+
title && /* @__PURE__ */ jsx96("h3", { className: "text-xl font-semibold text-foreground mb-2", children: title }),
|
|
16656
|
+
/* @__PURE__ */ jsx96("p", { className: "text-lg font-medium text-foreground/90 mb-2", children: message })
|
|
16397
16657
|
] }) }) })
|
|
16398
16658
|
] }) })
|
|
16399
16659
|
}
|
|
@@ -16614,8 +16874,126 @@ var useChartClick = ({
|
|
|
16614
16874
|
};
|
|
16615
16875
|
};
|
|
16616
16876
|
|
|
16877
|
+
// src/components/ui/charts/hooks/useTimeSeriesRange.ts
|
|
16878
|
+
import { useState as useState43, useCallback as useCallback17, useEffect as useEffect33, useRef as useRef23 } from "react";
|
|
16879
|
+
function useTimeSeriesRange({
|
|
16880
|
+
dataLength,
|
|
16881
|
+
defaultStartIndex = 0,
|
|
16882
|
+
defaultEndIndex,
|
|
16883
|
+
onRangeChange
|
|
16884
|
+
}) {
|
|
16885
|
+
const [startIndex, setStartIndex] = useState43(defaultStartIndex);
|
|
16886
|
+
const [endIndex, setEndIndex] = useState43(
|
|
16887
|
+
defaultEndIndex ?? Math.max(0, dataLength - 1)
|
|
16888
|
+
);
|
|
16889
|
+
const [isDragging, setIsDragging] = useState43(null);
|
|
16890
|
+
const [dragStartX, setDragStartX] = useState43(0);
|
|
16891
|
+
const [initialStartIndex, setInitialStartIndex] = useState43(0);
|
|
16892
|
+
const [initialEndIndex, setInitialEndIndex] = useState43(0);
|
|
16893
|
+
const brushRef = useRef23(null);
|
|
16894
|
+
useEffect33(() => {
|
|
16895
|
+
if (dataLength > 0) {
|
|
16896
|
+
setStartIndex((prev) => Math.min(prev, dataLength - 1));
|
|
16897
|
+
setEndIndex((prev) => {
|
|
16898
|
+
if (prev >= dataLength - 2 || defaultEndIndex === void 0) {
|
|
16899
|
+
return dataLength - 1;
|
|
16900
|
+
}
|
|
16901
|
+
return Math.min(prev, dataLength - 1);
|
|
16902
|
+
});
|
|
16903
|
+
}
|
|
16904
|
+
}, [dataLength, defaultEndIndex]);
|
|
16905
|
+
const handleRangeChange = useCallback17(
|
|
16906
|
+
(newStart, newEnd) => {
|
|
16907
|
+
const clampedStart = Math.max(0, Math.min(newStart, dataLength - 1));
|
|
16908
|
+
const clampedEnd = Math.max(
|
|
16909
|
+
clampedStart,
|
|
16910
|
+
Math.min(newEnd, dataLength - 1)
|
|
16911
|
+
);
|
|
16912
|
+
setStartIndex(clampedStart);
|
|
16913
|
+
setEndIndex(clampedEnd);
|
|
16914
|
+
if (onRangeChange) {
|
|
16915
|
+
onRangeChange(clampedStart, clampedEnd);
|
|
16916
|
+
}
|
|
16917
|
+
},
|
|
16918
|
+
[dataLength, onRangeChange]
|
|
16919
|
+
);
|
|
16920
|
+
const handleMouseDown = useCallback17(
|
|
16921
|
+
(e, type) => {
|
|
16922
|
+
e.preventDefault();
|
|
16923
|
+
setIsDragging(type);
|
|
16924
|
+
setDragStartX(e.clientX);
|
|
16925
|
+
setInitialStartIndex(startIndex);
|
|
16926
|
+
setInitialEndIndex(endIndex);
|
|
16927
|
+
},
|
|
16928
|
+
[startIndex, endIndex]
|
|
16929
|
+
);
|
|
16930
|
+
const handleMouseMove = useCallback17(
|
|
16931
|
+
(e) => {
|
|
16932
|
+
if (!isDragging || !brushRef.current) return;
|
|
16933
|
+
const brushWidth = brushRef.current.offsetWidth;
|
|
16934
|
+
const deltaX = e.clientX - dragStartX;
|
|
16935
|
+
const indexDelta = Math.round(deltaX / brushWidth * dataLength);
|
|
16936
|
+
if (isDragging === "start") {
|
|
16937
|
+
const newStart = Math.max(
|
|
16938
|
+
0,
|
|
16939
|
+
Math.min(initialStartIndex + indexDelta, endIndex - 1)
|
|
16940
|
+
);
|
|
16941
|
+
handleRangeChange(newStart, endIndex);
|
|
16942
|
+
} else if (isDragging === "end") {
|
|
16943
|
+
const newEnd = Math.max(
|
|
16944
|
+
startIndex + 1,
|
|
16945
|
+
Math.min(initialEndIndex + indexDelta, dataLength - 1)
|
|
16946
|
+
);
|
|
16947
|
+
handleRangeChange(startIndex, newEnd);
|
|
16948
|
+
} else if (isDragging === "middle") {
|
|
16949
|
+
const rangeSize = initialEndIndex - initialStartIndex;
|
|
16950
|
+
let newStart = initialStartIndex + indexDelta;
|
|
16951
|
+
let newEnd = initialEndIndex + indexDelta;
|
|
16952
|
+
if (newStart < 0) {
|
|
16953
|
+
newStart = 0;
|
|
16954
|
+
newEnd = rangeSize;
|
|
16955
|
+
} else if (newEnd >= dataLength) {
|
|
16956
|
+
newEnd = dataLength - 1;
|
|
16957
|
+
newStart = newEnd - rangeSize;
|
|
16958
|
+
}
|
|
16959
|
+
handleRangeChange(newStart, newEnd);
|
|
16960
|
+
}
|
|
16961
|
+
},
|
|
16962
|
+
[
|
|
16963
|
+
isDragging,
|
|
16964
|
+
dragStartX,
|
|
16965
|
+
dataLength,
|
|
16966
|
+
startIndex,
|
|
16967
|
+
endIndex,
|
|
16968
|
+
initialStartIndex,
|
|
16969
|
+
initialEndIndex,
|
|
16970
|
+
handleRangeChange
|
|
16971
|
+
]
|
|
16972
|
+
);
|
|
16973
|
+
const handleMouseUp = useCallback17(() => {
|
|
16974
|
+
setIsDragging(null);
|
|
16975
|
+
}, []);
|
|
16976
|
+
useEffect33(() => {
|
|
16977
|
+
if (isDragging) {
|
|
16978
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
16979
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
16980
|
+
return () => {
|
|
16981
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
16982
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
16983
|
+
};
|
|
16984
|
+
}
|
|
16985
|
+
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
16986
|
+
return {
|
|
16987
|
+
startIndex,
|
|
16988
|
+
endIndex,
|
|
16989
|
+
isDragging,
|
|
16990
|
+
brushRef,
|
|
16991
|
+
handleMouseDown
|
|
16992
|
+
};
|
|
16993
|
+
}
|
|
16994
|
+
|
|
16617
16995
|
// src/components/ui/charts/Chart.tsx
|
|
16618
|
-
import { jsx as
|
|
16996
|
+
import { jsx as jsx97, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
16619
16997
|
var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
16620
16998
|
var Chart = ({
|
|
16621
16999
|
data,
|
|
@@ -16648,7 +17026,8 @@ var Chart = ({
|
|
|
16648
17026
|
formatBR = false,
|
|
16649
17027
|
legendUppercase = false,
|
|
16650
17028
|
chartMargin,
|
|
16651
|
-
isLoading = false
|
|
17029
|
+
isLoading = false,
|
|
17030
|
+
timeSeries
|
|
16652
17031
|
}) => {
|
|
16653
17032
|
const smartConfig = useMemo26(() => {
|
|
16654
17033
|
const resolvedXAxisKey = typeof xAxis === "string" ? xAxis : xAxis && xAxis.dataKey || detectXAxis(data);
|
|
@@ -16688,15 +17067,33 @@ var Chart = ({
|
|
|
16688
17067
|
onTooltipPositionChange,
|
|
16689
17068
|
setActiveTooltips
|
|
16690
17069
|
} = useChartTooltips(maxTooltips);
|
|
16691
|
-
|
|
17070
|
+
useEffect34(() => {
|
|
16692
17071
|
if (highlightedSeries.size === 0 && showOnlyHighlighted) {
|
|
16693
17072
|
setShowOnlyHighlighted(false);
|
|
16694
17073
|
}
|
|
16695
17074
|
}, [highlightedSeries, showOnlyHighlighted, setShowOnlyHighlighted]);
|
|
16696
|
-
const
|
|
16697
|
-
|
|
16698
|
-
|
|
16699
|
-
|
|
17075
|
+
const timeSeriesConfig = useMemo26(() => {
|
|
17076
|
+
if (typeof timeSeries === "boolean") {
|
|
17077
|
+
return timeSeries ? {} : void 0;
|
|
17078
|
+
}
|
|
17079
|
+
return timeSeries;
|
|
17080
|
+
}, [timeSeries]);
|
|
17081
|
+
const { startIndex, endIndex, brushRef, handleMouseDown } = useTimeSeriesRange({
|
|
17082
|
+
dataLength: data.length,
|
|
17083
|
+
defaultStartIndex: timeSeriesConfig?.start,
|
|
17084
|
+
defaultEndIndex: timeSeriesConfig?.end,
|
|
17085
|
+
onRangeChange: timeSeriesConfig?.onRangeChange
|
|
17086
|
+
});
|
|
17087
|
+
const processedData = useMemo26(() => {
|
|
17088
|
+
const mapped = data.map((item) => ({
|
|
17089
|
+
...item,
|
|
17090
|
+
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
17091
|
+
}));
|
|
17092
|
+
if (timeSeriesConfig) {
|
|
17093
|
+
return mapped.slice(startIndex, endIndex + 1);
|
|
17094
|
+
}
|
|
17095
|
+
return mapped;
|
|
17096
|
+
}, [data, xAxisConfig.dataKey, timeSeriesConfig, startIndex, endIndex]);
|
|
16700
17097
|
const seriesOrder = [];
|
|
16701
17098
|
if (series) {
|
|
16702
17099
|
if (series.bar)
|
|
@@ -16785,7 +17182,7 @@ var Chart = ({
|
|
|
16785
17182
|
setActiveTooltips
|
|
16786
17183
|
}
|
|
16787
17184
|
);
|
|
16788
|
-
const getSeriesOpacity =
|
|
17185
|
+
const getSeriesOpacity = useCallback18(
|
|
16789
17186
|
(key) => {
|
|
16790
17187
|
return highlightedSeries.size > 0 ? highlightedSeries.has(key) ? 1 : 0.25 : 1;
|
|
16791
17188
|
},
|
|
@@ -16822,11 +17219,12 @@ var Chart = ({
|
|
|
16822
17219
|
);
|
|
16823
17220
|
const finalChartTopMargin = chartMargin?.top ?? (showLabels ? 48 : 20);
|
|
16824
17221
|
const finalChartBottomMargin = (chartMargin?.bottom ?? 5) + (xAxisLabel ? 22 : 0) + (showLegend ? 36 : 0);
|
|
17222
|
+
const HORIZONTAL_PADDING_CLASS = "px-20";
|
|
16825
17223
|
const effectiveChartWidth = typeof width === "number" ? width : measuredWidth ? Math.max(0, measuredWidth - 32) : computedWidth;
|
|
16826
17224
|
const chartInnerWidth = effectiveChartWidth - finalChartLeftMargin - finalChartRightMargin;
|
|
16827
17225
|
const leftYAxisLabelDx = -Math.max(12, Math.round(yAxisTickWidth / 2));
|
|
16828
17226
|
const rightYAxisLabelDx = Math.max(12, Math.round(finalChartRightMargin / 2));
|
|
16829
|
-
const openTooltipForPeriod =
|
|
17227
|
+
const openTooltipForPeriod = useCallback18(
|
|
16830
17228
|
(periodName) => {
|
|
16831
17229
|
if (!enableDraggableTooltips) return;
|
|
16832
17230
|
const row = processedData.find((r) => String(r.name) === periodName);
|
|
@@ -16870,7 +17268,7 @@ var Chart = ({
|
|
|
16870
17268
|
);
|
|
16871
17269
|
if (!data && !isLoading) return null;
|
|
16872
17270
|
if (isLoading) {
|
|
16873
|
-
return /* @__PURE__ */
|
|
17271
|
+
return /* @__PURE__ */ jsx97(
|
|
16874
17272
|
NoData_default,
|
|
16875
17273
|
{
|
|
16876
17274
|
title,
|
|
@@ -16882,7 +17280,7 @@ var Chart = ({
|
|
|
16882
17280
|
);
|
|
16883
17281
|
}
|
|
16884
17282
|
if (Array.isArray(data) && data.length === 0) {
|
|
16885
|
-
return /* @__PURE__ */
|
|
17283
|
+
return /* @__PURE__ */ jsx97(
|
|
16886
17284
|
NoData_default,
|
|
16887
17285
|
{
|
|
16888
17286
|
title,
|
|
@@ -16891,67 +17289,87 @@ var Chart = ({
|
|
|
16891
17289
|
}
|
|
16892
17290
|
);
|
|
16893
17291
|
}
|
|
16894
|
-
return /* @__PURE__ */
|
|
17292
|
+
return /* @__PURE__ */ jsx97(
|
|
16895
17293
|
"div",
|
|
16896
17294
|
{
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
children: [
|
|
16902
|
-
title && /* @__PURE__ */ jsx96(
|
|
17295
|
+
ref: wrapperRef,
|
|
17296
|
+
className: cn("w-full overflow-hidden min-w-0 rounded-lg", className),
|
|
17297
|
+
children: /* @__PURE__ */ jsxs75("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0", children: [
|
|
17298
|
+
title && /* @__PURE__ */ jsx97(
|
|
16903
17299
|
"div",
|
|
16904
17300
|
{
|
|
16905
17301
|
className: cn(
|
|
16906
|
-
"w-full flex items-center mt-
|
|
17302
|
+
"w-full flex items-center mt-5",
|
|
17303
|
+
HORIZONTAL_PADDING_CLASS,
|
|
16907
17304
|
titlePosition === "center" && "justify-center",
|
|
16908
17305
|
titlePosition === "right" && "justify-end",
|
|
16909
17306
|
titlePosition === "left" && "justify-start"
|
|
16910
17307
|
),
|
|
16911
|
-
children: /* @__PURE__ */
|
|
17308
|
+
children: /* @__PURE__ */ jsxs75("div", { className: "text-[1.4rem] font-semibold text-foreground mb-3", children: [
|
|
17309
|
+
title,
|
|
17310
|
+
/* @__PURE__ */ jsx97(
|
|
17311
|
+
"div",
|
|
17312
|
+
{
|
|
17313
|
+
className: "absolute inset-0 flex items-center justify-center pointer-events-none z-50 select-text overflow-hidden",
|
|
17314
|
+
"aria-hidden": "true",
|
|
17315
|
+
children: /* @__PURE__ */ jsx97("div", { className: "text-[1.6rem] font-bold text-transparent selection:bg-primary selection:text-primary-foreground whitespace-nowrap", children: "Eduardo Ronchi de Araujo Desenvolvidor de Sistemas Junio" })
|
|
17316
|
+
}
|
|
17317
|
+
)
|
|
17318
|
+
] })
|
|
16912
17319
|
}
|
|
16913
17320
|
),
|
|
16914
|
-
allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */
|
|
16915
|
-
enableHighlights && /* @__PURE__ */ jsx96(
|
|
16916
|
-
Highlights_default,
|
|
16917
|
-
{
|
|
16918
|
-
allKeys,
|
|
16919
|
-
mapperConfig,
|
|
16920
|
-
finalColors,
|
|
16921
|
-
highlightedSeries,
|
|
16922
|
-
toggleHighlight,
|
|
16923
|
-
containerWidth: chartInnerWidth
|
|
16924
|
-
}
|
|
16925
|
-
),
|
|
16926
|
-
enableShowOnly && /* @__PURE__ */ jsx96(
|
|
16927
|
-
ShowOnly_default,
|
|
16928
|
-
{
|
|
16929
|
-
showOnlyHighlighted,
|
|
16930
|
-
setShowOnlyHighlighted,
|
|
16931
|
-
highlightedSeriesSize: highlightedSeries.size,
|
|
16932
|
-
clearHighlights
|
|
16933
|
-
}
|
|
16934
|
-
),
|
|
16935
|
-
enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx96("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx96(
|
|
16936
|
-
PeriodsDropdown_default,
|
|
16937
|
-
{
|
|
16938
|
-
processedData,
|
|
16939
|
-
onOpenPeriod: openTooltipForPeriod,
|
|
16940
|
-
rightOffset: finalChartRightMargin,
|
|
16941
|
-
activePeriods
|
|
16942
|
-
}
|
|
16943
|
-
) })
|
|
16944
|
-
] }),
|
|
16945
|
-
!(allKeys.length > 0 && (enableHighlights || enableShowOnly)) && enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx96(
|
|
17321
|
+
allKeys.length > 0 && (enableHighlights || enableShowOnly) && /* @__PURE__ */ jsxs75(
|
|
16946
17322
|
"div",
|
|
16947
17323
|
{
|
|
16948
|
-
className:
|
|
17324
|
+
className: cn(
|
|
17325
|
+
"flex items-center gap-2 mb-2",
|
|
17326
|
+
HORIZONTAL_PADDING_CLASS
|
|
17327
|
+
),
|
|
17328
|
+
children: [
|
|
17329
|
+
enableHighlights && /* @__PURE__ */ jsx97(
|
|
17330
|
+
Highlights_default,
|
|
17331
|
+
{
|
|
17332
|
+
allKeys,
|
|
17333
|
+
mapperConfig,
|
|
17334
|
+
finalColors,
|
|
17335
|
+
highlightedSeries,
|
|
17336
|
+
toggleHighlight,
|
|
17337
|
+
containerWidth: chartInnerWidth
|
|
17338
|
+
}
|
|
17339
|
+
),
|
|
17340
|
+
enableShowOnly && /* @__PURE__ */ jsx97(
|
|
17341
|
+
ShowOnly_default,
|
|
17342
|
+
{
|
|
17343
|
+
showOnlyHighlighted,
|
|
17344
|
+
setShowOnlyHighlighted,
|
|
17345
|
+
highlightedSeriesSize: highlightedSeries.size,
|
|
17346
|
+
clearHighlights
|
|
17347
|
+
}
|
|
17348
|
+
),
|
|
17349
|
+
enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx97("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx97(
|
|
17350
|
+
PeriodsDropdown_default,
|
|
17351
|
+
{
|
|
17352
|
+
processedData,
|
|
17353
|
+
onOpenPeriod: openTooltipForPeriod,
|
|
17354
|
+
rightOffset: finalChartRightMargin,
|
|
17355
|
+
activePeriods
|
|
17356
|
+
}
|
|
17357
|
+
) })
|
|
17358
|
+
]
|
|
17359
|
+
}
|
|
17360
|
+
),
|
|
17361
|
+
!(allKeys.length > 0 && (enableHighlights || enableShowOnly)) && enablePeriodsDropdown && enableDraggableTooltips && /* @__PURE__ */ jsx97(
|
|
17362
|
+
"div",
|
|
17363
|
+
{
|
|
17364
|
+
className: cn(
|
|
17365
|
+
"w-full flex justify-end mb-2",
|
|
17366
|
+
HORIZONTAL_PADDING_CLASS
|
|
17367
|
+
),
|
|
16949
17368
|
style: {
|
|
16950
|
-
paddingLeft: `${CONTAINER_PADDING_LEFT + finalChartLeftMargin}px`,
|
|
16951
17369
|
paddingRight: `${finalChartRightMargin}px`,
|
|
16952
17370
|
maxWidth: `${chartInnerWidth}px`
|
|
16953
17371
|
},
|
|
16954
|
-
children: /* @__PURE__ */
|
|
17372
|
+
children: /* @__PURE__ */ jsx97(
|
|
16955
17373
|
PeriodsDropdown_default,
|
|
16956
17374
|
{
|
|
16957
17375
|
processedData,
|
|
@@ -16961,8 +17379,8 @@ var Chart = ({
|
|
|
16961
17379
|
)
|
|
16962
17380
|
}
|
|
16963
17381
|
),
|
|
16964
|
-
/* @__PURE__ */
|
|
16965
|
-
|
|
17382
|
+
/* @__PURE__ */ jsx97(ResponsiveContainer2, { width: "100%", height, children: /* @__PURE__ */ jsxs75(
|
|
17383
|
+
ComposedChart2,
|
|
16966
17384
|
{
|
|
16967
17385
|
data: processedData,
|
|
16968
17386
|
height,
|
|
@@ -16974,10 +17392,10 @@ var Chart = ({
|
|
|
16974
17392
|
},
|
|
16975
17393
|
onClick: handleChartClick,
|
|
16976
17394
|
children: [
|
|
16977
|
-
/* @__PURE__ */
|
|
17395
|
+
/* @__PURE__ */ jsx97("defs", { children: seriesOrder.filter((s) => s.type === "area").map((s) => {
|
|
16978
17396
|
const key = s.key;
|
|
16979
17397
|
const color = finalColors[key];
|
|
16980
|
-
return /* @__PURE__ */
|
|
17398
|
+
return /* @__PURE__ */ jsxs75(
|
|
16981
17399
|
"linearGradient",
|
|
16982
17400
|
{
|
|
16983
17401
|
id: `gradient-${key}`,
|
|
@@ -16986,14 +17404,14 @@ var Chart = ({
|
|
|
16986
17404
|
x2: "0",
|
|
16987
17405
|
y2: "0.8",
|
|
16988
17406
|
children: [
|
|
16989
|
-
/* @__PURE__ */
|
|
16990
|
-
/* @__PURE__ */
|
|
17407
|
+
/* @__PURE__ */ jsx97("stop", { offset: "0%", stopColor: color, stopOpacity: 0.8 }),
|
|
17408
|
+
/* @__PURE__ */ jsx97("stop", { offset: "90%", stopColor: color, stopOpacity: 0.1 })
|
|
16991
17409
|
]
|
|
16992
17410
|
},
|
|
16993
17411
|
`gradient-${key}`
|
|
16994
17412
|
);
|
|
16995
17413
|
}) }),
|
|
16996
|
-
showGrid && /* @__PURE__ */
|
|
17414
|
+
showGrid && /* @__PURE__ */ jsx97(
|
|
16997
17415
|
CartesianGrid,
|
|
16998
17416
|
{
|
|
16999
17417
|
strokeDasharray: "3 3",
|
|
@@ -17001,8 +17419,8 @@ var Chart = ({
|
|
|
17001
17419
|
opacity: 0.5
|
|
17002
17420
|
}
|
|
17003
17421
|
),
|
|
17004
|
-
/* @__PURE__ */
|
|
17005
|
-
|
|
17422
|
+
/* @__PURE__ */ jsx97(
|
|
17423
|
+
XAxis2,
|
|
17006
17424
|
{
|
|
17007
17425
|
dataKey: xAxisConfig.dataKey,
|
|
17008
17426
|
stroke: "hsl(var(--muted-foreground))",
|
|
@@ -17028,8 +17446,8 @@ var Chart = ({
|
|
|
17028
17446
|
} : void 0
|
|
17029
17447
|
}
|
|
17030
17448
|
),
|
|
17031
|
-
/* @__PURE__ */
|
|
17032
|
-
|
|
17449
|
+
/* @__PURE__ */ jsx97(
|
|
17450
|
+
YAxis2,
|
|
17033
17451
|
{
|
|
17034
17452
|
yAxisId: "left",
|
|
17035
17453
|
width: yAxisTickWidth,
|
|
@@ -17054,7 +17472,7 @@ var Chart = ({
|
|
|
17054
17472
|
} : void 0
|
|
17055
17473
|
}
|
|
17056
17474
|
),
|
|
17057
|
-
minLeftDataValue < 0 && /* @__PURE__ */
|
|
17475
|
+
minLeftDataValue < 0 && /* @__PURE__ */ jsx97(
|
|
17058
17476
|
ReferenceLine,
|
|
17059
17477
|
{
|
|
17060
17478
|
y: 0,
|
|
@@ -17088,8 +17506,8 @@ var Chart = ({
|
|
|
17088
17506
|
return biaxialConfigNormalized.stroke[firstRightKey] || defaultRightColor;
|
|
17089
17507
|
return defaultRightColor;
|
|
17090
17508
|
})();
|
|
17091
|
-
return /* @__PURE__ */
|
|
17092
|
-
|
|
17509
|
+
return /* @__PURE__ */ jsx97(
|
|
17510
|
+
YAxis2,
|
|
17093
17511
|
{
|
|
17094
17512
|
yAxisId: "right",
|
|
17095
17513
|
width: finalChartRightMargin,
|
|
@@ -17117,10 +17535,10 @@ var Chart = ({
|
|
|
17117
17535
|
}
|
|
17118
17536
|
);
|
|
17119
17537
|
})(),
|
|
17120
|
-
showTooltip && /* @__PURE__ */
|
|
17538
|
+
showTooltip && /* @__PURE__ */ jsx97(
|
|
17121
17539
|
Tooltip,
|
|
17122
17540
|
{
|
|
17123
|
-
content: showTooltipTotal ? /* @__PURE__ */
|
|
17541
|
+
content: showTooltipTotal ? /* @__PURE__ */ jsx97(
|
|
17124
17542
|
TooltipWithTotal_default,
|
|
17125
17543
|
{
|
|
17126
17544
|
finalColors,
|
|
@@ -17128,7 +17546,7 @@ var Chart = ({
|
|
|
17128
17546
|
categoryFormatter,
|
|
17129
17547
|
periodLabel
|
|
17130
17548
|
}
|
|
17131
|
-
) : /* @__PURE__ */
|
|
17549
|
+
) : /* @__PURE__ */ jsx97(
|
|
17132
17550
|
TooltipSimple_default,
|
|
17133
17551
|
{
|
|
17134
17552
|
finalColors,
|
|
@@ -17140,7 +17558,7 @@ var Chart = ({
|
|
|
17140
17558
|
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
17141
17559
|
}
|
|
17142
17560
|
),
|
|
17143
|
-
showLegend && /* @__PURE__ */
|
|
17561
|
+
showLegend && /* @__PURE__ */ jsx97(
|
|
17144
17562
|
Legend,
|
|
17145
17563
|
{
|
|
17146
17564
|
wrapperStyle: {
|
|
@@ -17153,7 +17571,7 @@ var Chart = ({
|
|
|
17153
17571
|
const key = String(value);
|
|
17154
17572
|
const label = mapperConfig[key]?.label ?? labelMap?.[key] ?? formatFieldName(key);
|
|
17155
17573
|
const displayLabel = legendUppercase ? label.toUpperCase() : label;
|
|
17156
|
-
return /* @__PURE__ */
|
|
17574
|
+
return /* @__PURE__ */ jsx97("span", { className: "tracking-[0]", children: displayLabel });
|
|
17157
17575
|
}
|
|
17158
17576
|
}
|
|
17159
17577
|
),
|
|
@@ -17171,8 +17589,8 @@ var Chart = ({
|
|
|
17171
17589
|
}
|
|
17172
17590
|
}
|
|
17173
17591
|
if (s.type === "bar") {
|
|
17174
|
-
return /* @__PURE__ */
|
|
17175
|
-
|
|
17592
|
+
return /* @__PURE__ */ jsx97(
|
|
17593
|
+
Bar2,
|
|
17176
17594
|
{
|
|
17177
17595
|
dataKey: key,
|
|
17178
17596
|
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
@@ -17182,7 +17600,7 @@ var Chart = ({
|
|
|
17182
17600
|
onClick: handleBarClick,
|
|
17183
17601
|
className: "cursor-pointer",
|
|
17184
17602
|
style: { opacity: getSeriesOpacity(key) },
|
|
17185
|
-
activeBar: /* @__PURE__ */
|
|
17603
|
+
activeBar: /* @__PURE__ */ jsx97(
|
|
17186
17604
|
Rectangle,
|
|
17187
17605
|
{
|
|
17188
17606
|
fill: color,
|
|
@@ -17191,7 +17609,7 @@ var Chart = ({
|
|
|
17191
17609
|
opacity: 0.8
|
|
17192
17610
|
}
|
|
17193
17611
|
),
|
|
17194
|
-
children: showLabels && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */
|
|
17612
|
+
children: showLabels && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx97(
|
|
17195
17613
|
LabelList,
|
|
17196
17614
|
{
|
|
17197
17615
|
dataKey: key,
|
|
@@ -17218,8 +17636,8 @@ var Chart = ({
|
|
|
17218
17636
|
);
|
|
17219
17637
|
}
|
|
17220
17638
|
if (s.type === "line") {
|
|
17221
|
-
return /* @__PURE__ */
|
|
17222
|
-
|
|
17639
|
+
return /* @__PURE__ */ jsx97(
|
|
17640
|
+
Line2,
|
|
17223
17641
|
{
|
|
17224
17642
|
dataKey: key,
|
|
17225
17643
|
yAxisId: rightKeys.includes(key) ? "right" : "left",
|
|
@@ -17231,7 +17649,7 @@ var Chart = ({
|
|
|
17231
17649
|
onClick: handleSeriesClick,
|
|
17232
17650
|
className: "cursor-pointer pointer-events-auto",
|
|
17233
17651
|
style: { opacity: getSeriesOpacity(key) },
|
|
17234
|
-
children: showLabels && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */
|
|
17652
|
+
children: showLabels && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx97(
|
|
17235
17653
|
LabelList,
|
|
17236
17654
|
{
|
|
17237
17655
|
dataKey: key,
|
|
@@ -17249,8 +17667,8 @@ var Chart = ({
|
|
|
17249
17667
|
);
|
|
17250
17668
|
}
|
|
17251
17669
|
if (s.type === "area") {
|
|
17252
|
-
return /* @__PURE__ */
|
|
17253
|
-
|
|
17670
|
+
return /* @__PURE__ */ jsx97(
|
|
17671
|
+
Area2,
|
|
17254
17672
|
{
|
|
17255
17673
|
type: "monotone",
|
|
17256
17674
|
dataKey: key,
|
|
@@ -17269,7 +17687,7 @@ var Chart = ({
|
|
|
17269
17687
|
stroke: "hsl(var(--background))",
|
|
17270
17688
|
strokeWidth: 2
|
|
17271
17689
|
},
|
|
17272
|
-
children: showLabels && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */
|
|
17690
|
+
children: showLabels && highlightedSeries.size === 0 || highlightedSeries.has(key) ? /* @__PURE__ */ jsx97(
|
|
17273
17691
|
LabelList,
|
|
17274
17692
|
{
|
|
17275
17693
|
dataKey: key,
|
|
@@ -17291,7 +17709,7 @@ var Chart = ({
|
|
|
17291
17709
|
]
|
|
17292
17710
|
}
|
|
17293
17711
|
) }),
|
|
17294
|
-
enableDraggableTooltips && activeTooltips.map((tooltip) => /* @__PURE__ */
|
|
17712
|
+
enableDraggableTooltips && activeTooltips.map((tooltip) => /* @__PURE__ */ jsx97(
|
|
17295
17713
|
DraggableTooltip_default,
|
|
17296
17714
|
{
|
|
17297
17715
|
id: tooltip.id,
|
|
@@ -17316,7 +17734,7 @@ var Chart = ({
|
|
|
17316
17734
|
},
|
|
17317
17735
|
tooltip.id
|
|
17318
17736
|
)),
|
|
17319
|
-
enableDraggableTooltips && activeTooltips.length > 1 && /* @__PURE__ */
|
|
17737
|
+
enableDraggableTooltips && activeTooltips.length > 1 && /* @__PURE__ */ jsx97(
|
|
17320
17738
|
CloseAllButton_default,
|
|
17321
17739
|
{
|
|
17322
17740
|
count: activeTooltips.length,
|
|
@@ -17324,27 +17742,49 @@ var Chart = ({
|
|
|
17324
17742
|
position: "top-center",
|
|
17325
17743
|
variant: "floating"
|
|
17326
17744
|
}
|
|
17745
|
+
),
|
|
17746
|
+
timeSeriesConfig && /* @__PURE__ */ jsx97(
|
|
17747
|
+
Brush_default,
|
|
17748
|
+
{
|
|
17749
|
+
data,
|
|
17750
|
+
startIndex,
|
|
17751
|
+
endIndex,
|
|
17752
|
+
onMouseDown: handleMouseDown,
|
|
17753
|
+
brushRef,
|
|
17754
|
+
xAxisKey: xAxisConfig.dataKey,
|
|
17755
|
+
seriesOrder,
|
|
17756
|
+
finalColors,
|
|
17757
|
+
brushHeight: timeSeriesConfig.height,
|
|
17758
|
+
brushColor: timeSeriesConfig.brushColor,
|
|
17759
|
+
miniChartOpacity: timeSeriesConfig.miniChartOpacity,
|
|
17760
|
+
showGrid,
|
|
17761
|
+
gridColor,
|
|
17762
|
+
margin: {
|
|
17763
|
+
left: finalChartLeftMargin,
|
|
17764
|
+
right: finalChartRightMargin
|
|
17765
|
+
}
|
|
17766
|
+
}
|
|
17327
17767
|
)
|
|
17328
|
-
]
|
|
17768
|
+
] })
|
|
17329
17769
|
}
|
|
17330
|
-
)
|
|
17770
|
+
);
|
|
17331
17771
|
};
|
|
17332
17772
|
var Chart_default = Chart;
|
|
17333
17773
|
|
|
17334
17774
|
// src/components/ui/charts/BarChart.tsx
|
|
17335
|
-
import { useState as
|
|
17775
|
+
import { useState as useState44, useEffect as useEffect35, useCallback as useCallback19, useMemo as useMemo27 } from "react";
|
|
17336
17776
|
import {
|
|
17337
17777
|
BarChart as RechartsBarChart,
|
|
17338
|
-
Bar as
|
|
17778
|
+
Bar as Bar3,
|
|
17339
17779
|
Rectangle as Rectangle2,
|
|
17340
|
-
XAxis as
|
|
17341
|
-
YAxis as
|
|
17780
|
+
XAxis as XAxis3,
|
|
17781
|
+
YAxis as YAxis3,
|
|
17342
17782
|
CartesianGrid as CartesianGrid2,
|
|
17343
17783
|
Tooltip as Tooltip2,
|
|
17344
17784
|
Legend as Legend2,
|
|
17345
17785
|
LabelList as LabelList2
|
|
17346
17786
|
} from "recharts";
|
|
17347
|
-
import { jsx as
|
|
17787
|
+
import { jsx as jsx98, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
17348
17788
|
var DEFAULT_COLORS3 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
17349
17789
|
var BarChart = ({
|
|
17350
17790
|
data,
|
|
@@ -17424,14 +17864,14 @@ var BarChart = ({
|
|
|
17424
17864
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
17425
17865
|
}, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
|
|
17426
17866
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
17427
|
-
const [activeTooltips, setActiveTooltips] =
|
|
17428
|
-
const [isDragging, setIsDragging] =
|
|
17429
|
-
const [dragOffset, setDragOffset] =
|
|
17867
|
+
const [activeTooltips, setActiveTooltips] = useState44([]);
|
|
17868
|
+
const [isDragging, setIsDragging] = useState44(null);
|
|
17869
|
+
const [dragOffset, setDragOffset] = useState44({
|
|
17430
17870
|
x: 0,
|
|
17431
17871
|
y: 0
|
|
17432
17872
|
});
|
|
17433
|
-
const [globalTooltipCount, setGlobalTooltipCount] =
|
|
17434
|
-
const [alignmentGuides, setAlignmentGuides] =
|
|
17873
|
+
const [globalTooltipCount, setGlobalTooltipCount] = useState44(0);
|
|
17874
|
+
const [alignmentGuides, setAlignmentGuides] = useState44([]);
|
|
17435
17875
|
const processedData = data.map((item) => ({
|
|
17436
17876
|
...item,
|
|
17437
17877
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
@@ -17508,7 +17948,7 @@ var BarChart = ({
|
|
|
17508
17948
|
const GUIDE_THRESHOLD2 = 60;
|
|
17509
17949
|
const STRONG_SNAP_THRESHOLD2 = 35;
|
|
17510
17950
|
const PRECISION_SNAP_THRESHOLD2 = 8;
|
|
17511
|
-
const updateAlignmentGuides =
|
|
17951
|
+
const updateAlignmentGuides = useCallback19(
|
|
17512
17952
|
(draggedTooltipId, currentPosition) => {
|
|
17513
17953
|
if (!isDragging) return;
|
|
17514
17954
|
const getAllTooltips = () => {
|
|
@@ -17572,7 +18012,7 @@ var BarChart = ({
|
|
|
17572
18012
|
},
|
|
17573
18013
|
[isDragging, activeTooltips]
|
|
17574
18014
|
);
|
|
17575
|
-
const snapToGuides =
|
|
18015
|
+
const snapToGuides = useCallback19(
|
|
17576
18016
|
(position) => {
|
|
17577
18017
|
const snappedPosition = { ...position };
|
|
17578
18018
|
let hasSnapped = false;
|
|
@@ -17634,7 +18074,7 @@ var BarChart = ({
|
|
|
17634
18074
|
setIsDragging(tooltipId);
|
|
17635
18075
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
17636
18076
|
};
|
|
17637
|
-
|
|
18077
|
+
useEffect35(() => {
|
|
17638
18078
|
let rafId;
|
|
17639
18079
|
let lastMousePosition = { x: 0, y: 0 };
|
|
17640
18080
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -17692,7 +18132,7 @@ var BarChart = ({
|
|
|
17692
18132
|
updateAlignmentGuides,
|
|
17693
18133
|
snapToGuides
|
|
17694
18134
|
]);
|
|
17695
|
-
|
|
18135
|
+
useEffect35(() => {
|
|
17696
18136
|
const handleCloseAllTooltips = () => {
|
|
17697
18137
|
setActiveTooltips([]);
|
|
17698
18138
|
setGlobalTooltipCount(0);
|
|
@@ -17702,7 +18142,7 @@ var BarChart = ({
|
|
|
17702
18142
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
|
|
17703
18143
|
};
|
|
17704
18144
|
}, []);
|
|
17705
|
-
|
|
18145
|
+
useEffect35(() => {
|
|
17706
18146
|
const handleTooltipCountRequest = () => {
|
|
17707
18147
|
window.dispatchEvent(
|
|
17708
18148
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -17741,7 +18181,7 @@ var BarChart = ({
|
|
|
17741
18181
|
);
|
|
17742
18182
|
};
|
|
17743
18183
|
}, [activeTooltips]);
|
|
17744
|
-
|
|
18184
|
+
useEffect35(() => {
|
|
17745
18185
|
if (isDragging) return;
|
|
17746
18186
|
let totalCount = 0;
|
|
17747
18187
|
const handleCountResponse = (event) => {
|
|
@@ -17765,25 +18205,25 @@ var BarChart = ({
|
|
|
17765
18205
|
label
|
|
17766
18206
|
}) => {
|
|
17767
18207
|
if (!active || !payload) return null;
|
|
17768
|
-
return /* @__PURE__ */
|
|
17769
|
-
/* @__PURE__ */
|
|
18208
|
+
return /* @__PURE__ */ jsxs76("div", { className: "bg-card border border-border rounded-lg p-3 shadow-lg", children: [
|
|
18209
|
+
/* @__PURE__ */ jsx98("p", { className: "font-medium text-foreground mb-2", children: label }),
|
|
17770
18210
|
payload.map(
|
|
17771
|
-
(entry, index) => /* @__PURE__ */
|
|
17772
|
-
/* @__PURE__ */
|
|
18211
|
+
(entry, index) => /* @__PURE__ */ jsxs76("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
18212
|
+
/* @__PURE__ */ jsx98(
|
|
17773
18213
|
"div",
|
|
17774
18214
|
{
|
|
17775
18215
|
className: "w-3 h-3 rounded-sm",
|
|
17776
18216
|
style: { backgroundColor: entry.color }
|
|
17777
18217
|
}
|
|
17778
18218
|
),
|
|
17779
|
-
/* @__PURE__ */
|
|
18219
|
+
/* @__PURE__ */ jsxs76("span", { className: "text-muted-foreground", children: [
|
|
17780
18220
|
entry.name,
|
|
17781
18221
|
":"
|
|
17782
18222
|
] }),
|
|
17783
|
-
/* @__PURE__ */
|
|
18223
|
+
/* @__PURE__ */ jsx98("span", { className: "text-foreground font-medium", children: entry.value?.toLocaleString("pt-BR") })
|
|
17784
18224
|
] }, index)
|
|
17785
18225
|
),
|
|
17786
|
-
/* @__PURE__ */
|
|
18226
|
+
/* @__PURE__ */ jsx98("p", { className: "text-xs text-muted-foreground mt-1", children: "Clique para fixar este tooltip" })
|
|
17787
18227
|
] });
|
|
17788
18228
|
};
|
|
17789
18229
|
const getTitleClassName = (position) => {
|
|
@@ -17797,7 +18237,7 @@ var BarChart = ({
|
|
|
17797
18237
|
return `${baseClasses} text-left`;
|
|
17798
18238
|
}
|
|
17799
18239
|
};
|
|
17800
|
-
return /* @__PURE__ */
|
|
18240
|
+
return /* @__PURE__ */ jsxs76(
|
|
17801
18241
|
"div",
|
|
17802
18242
|
{
|
|
17803
18243
|
className: cn("rounded-lg bg-card p-4 relative", className),
|
|
@@ -17806,8 +18246,8 @@ var BarChart = ({
|
|
|
17806
18246
|
maxWidth: "100%"
|
|
17807
18247
|
},
|
|
17808
18248
|
children: [
|
|
17809
|
-
title && /* @__PURE__ */
|
|
17810
|
-
/* @__PURE__ */
|
|
18249
|
+
title && /* @__PURE__ */ jsx98("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx98("h3", { className: getTitleClassName(titlePosition), children: title }) }),
|
|
18250
|
+
/* @__PURE__ */ jsxs76(
|
|
17811
18251
|
RechartsBarChart,
|
|
17812
18252
|
{
|
|
17813
18253
|
data: processedData,
|
|
@@ -17816,7 +18256,7 @@ var BarChart = ({
|
|
|
17816
18256
|
margin: resolveChartMargins(margins, chartMargins, showLabels),
|
|
17817
18257
|
onClick: handleChartClick,
|
|
17818
18258
|
children: [
|
|
17819
|
-
showGrid && /* @__PURE__ */
|
|
18259
|
+
showGrid && /* @__PURE__ */ jsx98(
|
|
17820
18260
|
CartesianGrid2,
|
|
17821
18261
|
{
|
|
17822
18262
|
strokeDasharray: "3 3",
|
|
@@ -17824,8 +18264,8 @@ var BarChart = ({
|
|
|
17824
18264
|
opacity: 0.5
|
|
17825
18265
|
}
|
|
17826
18266
|
),
|
|
17827
|
-
/* @__PURE__ */
|
|
17828
|
-
|
|
18267
|
+
/* @__PURE__ */ jsx98(
|
|
18268
|
+
XAxis3,
|
|
17829
18269
|
{
|
|
17830
18270
|
dataKey: xAxisConfig.dataKey,
|
|
17831
18271
|
stroke: "hsl(var(--muted-foreground))",
|
|
@@ -17835,8 +18275,8 @@ var BarChart = ({
|
|
|
17835
18275
|
tickFormatter: xAxisConfig.valueFormatter
|
|
17836
18276
|
}
|
|
17837
18277
|
),
|
|
17838
|
-
/* @__PURE__ */
|
|
17839
|
-
|
|
18278
|
+
/* @__PURE__ */ jsx98(
|
|
18279
|
+
YAxis3,
|
|
17840
18280
|
{
|
|
17841
18281
|
stroke: "hsl(var(--muted-foreground))",
|
|
17842
18282
|
fontSize: 12,
|
|
@@ -17847,14 +18287,14 @@ var BarChart = ({
|
|
|
17847
18287
|
tickCount: 6
|
|
17848
18288
|
}
|
|
17849
18289
|
),
|
|
17850
|
-
showTooltip && /* @__PURE__ */
|
|
18290
|
+
showTooltip && /* @__PURE__ */ jsx98(
|
|
17851
18291
|
Tooltip2,
|
|
17852
18292
|
{
|
|
17853
|
-
content: /* @__PURE__ */
|
|
18293
|
+
content: /* @__PURE__ */ jsx98(CustomTooltip, {}),
|
|
17854
18294
|
cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
|
|
17855
18295
|
}
|
|
17856
18296
|
),
|
|
17857
|
-
showLegend && /* @__PURE__ */
|
|
18297
|
+
showLegend && /* @__PURE__ */ jsx98(
|
|
17858
18298
|
Legend2,
|
|
17859
18299
|
{
|
|
17860
18300
|
wrapperStyle: {
|
|
@@ -17865,8 +18305,8 @@ var BarChart = ({
|
|
|
17865
18305
|
),
|
|
17866
18306
|
dataKeys.map((key) => {
|
|
17867
18307
|
const fieldConfig = mapperConfig[key];
|
|
17868
|
-
return /* @__PURE__ */
|
|
17869
|
-
|
|
18308
|
+
return /* @__PURE__ */ jsx98(
|
|
18309
|
+
Bar3,
|
|
17870
18310
|
{
|
|
17871
18311
|
dataKey: key,
|
|
17872
18312
|
name: fieldConfig?.label || key,
|
|
@@ -17874,7 +18314,7 @@ var BarChart = ({
|
|
|
17874
18314
|
radius: [4, 4, 0, 0],
|
|
17875
18315
|
onClick: handleBarClick,
|
|
17876
18316
|
style: { cursor: "pointer" },
|
|
17877
|
-
activeBar: /* @__PURE__ */
|
|
18317
|
+
activeBar: /* @__PURE__ */ jsx98(
|
|
17878
18318
|
Rectangle2,
|
|
17879
18319
|
{
|
|
17880
18320
|
fill: finalColors[key],
|
|
@@ -17883,7 +18323,7 @@ var BarChart = ({
|
|
|
17883
18323
|
opacity: 0.8
|
|
17884
18324
|
}
|
|
17885
18325
|
),
|
|
17886
|
-
children: showLabels && /* @__PURE__ */
|
|
18326
|
+
children: showLabels && /* @__PURE__ */ jsx98(
|
|
17887
18327
|
LabelList2,
|
|
17888
18328
|
{
|
|
17889
18329
|
dataKey: key,
|
|
@@ -17920,8 +18360,8 @@ var BarChart = ({
|
|
|
17920
18360
|
guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
|
|
17921
18361
|
guide.targetTooltip.top + guide.targetTooltip.height / 2
|
|
17922
18362
|
);
|
|
17923
|
-
return /* @__PURE__ */
|
|
17924
|
-
/* @__PURE__ */
|
|
18363
|
+
return /* @__PURE__ */ jsxs76("div", { children: [
|
|
18364
|
+
/* @__PURE__ */ jsx98(
|
|
17925
18365
|
"div",
|
|
17926
18366
|
{
|
|
17927
18367
|
className: "fixed pointer-events-none z-30",
|
|
@@ -17940,7 +18380,7 @@ var BarChart = ({
|
|
|
17940
18380
|
}
|
|
17941
18381
|
}
|
|
17942
18382
|
),
|
|
17943
|
-
/* @__PURE__ */
|
|
18383
|
+
/* @__PURE__ */ jsx98(
|
|
17944
18384
|
"div",
|
|
17945
18385
|
{
|
|
17946
18386
|
className: "fixed pointer-events-none z-31",
|
|
@@ -17956,7 +18396,7 @@ var BarChart = ({
|
|
|
17956
18396
|
}
|
|
17957
18397
|
}
|
|
17958
18398
|
),
|
|
17959
|
-
/* @__PURE__ */
|
|
18399
|
+
/* @__PURE__ */ jsx98(
|
|
17960
18400
|
"div",
|
|
17961
18401
|
{
|
|
17962
18402
|
className: "fixed pointer-events-none z-31",
|
|
@@ -17974,7 +18414,7 @@ var BarChart = ({
|
|
|
17974
18414
|
)
|
|
17975
18415
|
] }, index);
|
|
17976
18416
|
}),
|
|
17977
|
-
activeTooltips.map((tooltip, index) => /* @__PURE__ */
|
|
18417
|
+
activeTooltips.map((tooltip, index) => /* @__PURE__ */ jsx98(
|
|
17978
18418
|
DraggableTooltip_default,
|
|
17979
18419
|
{
|
|
17980
18420
|
id: tooltip.id,
|
|
@@ -18007,18 +18447,18 @@ var BarChart = ({
|
|
|
18007
18447
|
var BarChart_default = BarChart;
|
|
18008
18448
|
|
|
18009
18449
|
// src/components/ui/charts/LineChart.tsx
|
|
18010
|
-
import { useState as
|
|
18450
|
+
import { useState as useState45, useEffect as useEffect36, useCallback as useCallback20, useMemo as useMemo28 } from "react";
|
|
18011
18451
|
import {
|
|
18012
18452
|
LineChart as RechartsLineChart,
|
|
18013
|
-
Line as
|
|
18014
|
-
XAxis as
|
|
18015
|
-
YAxis as
|
|
18453
|
+
Line as Line3,
|
|
18454
|
+
XAxis as XAxis4,
|
|
18455
|
+
YAxis as YAxis4,
|
|
18016
18456
|
CartesianGrid as CartesianGrid3,
|
|
18017
18457
|
Tooltip as Tooltip3,
|
|
18018
18458
|
Legend as Legend3,
|
|
18019
18459
|
LabelList as LabelList3
|
|
18020
18460
|
} from "recharts";
|
|
18021
|
-
import { jsx as
|
|
18461
|
+
import { jsx as jsx99, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
18022
18462
|
var defaultData = [
|
|
18023
18463
|
{ name: "A", value: 100 },
|
|
18024
18464
|
{ name: "B", value: 200 },
|
|
@@ -18050,14 +18490,14 @@ var CustomLineChart = ({
|
|
|
18050
18490
|
containerPaddingLeft,
|
|
18051
18491
|
16
|
|
18052
18492
|
);
|
|
18053
|
-
const [activeTooltips, setActiveTooltips] =
|
|
18054
|
-
const [isDragging, setIsDragging] =
|
|
18055
|
-
const [dragOffset, setDragOffset] =
|
|
18493
|
+
const [activeTooltips, setActiveTooltips] = useState45([]);
|
|
18494
|
+
const [isDragging, setIsDragging] = useState45(null);
|
|
18495
|
+
const [dragOffset, setDragOffset] = useState45({
|
|
18056
18496
|
x: 0,
|
|
18057
18497
|
y: 0
|
|
18058
18498
|
});
|
|
18059
|
-
const [globalTooltipCount, setGlobalTooltipCount] =
|
|
18060
|
-
const [alignmentGuides, setAlignmentGuides] =
|
|
18499
|
+
const [globalTooltipCount, setGlobalTooltipCount] = useState45(0);
|
|
18500
|
+
const [alignmentGuides, setAlignmentGuides] = useState45([]);
|
|
18061
18501
|
const generateColors = (dataKeys2) => {
|
|
18062
18502
|
const colorMap = {};
|
|
18063
18503
|
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
@@ -18117,7 +18557,7 @@ var CustomLineChart = ({
|
|
|
18117
18557
|
setActiveTooltips((prev) => [...prev, newTooltip]);
|
|
18118
18558
|
}
|
|
18119
18559
|
};
|
|
18120
|
-
return /* @__PURE__ */
|
|
18560
|
+
return /* @__PURE__ */ jsx99(
|
|
18121
18561
|
"circle",
|
|
18122
18562
|
{
|
|
18123
18563
|
cx,
|
|
@@ -18159,10 +18599,10 @@ var CustomLineChart = ({
|
|
|
18159
18599
|
const handleChartBackgroundClick = () => {
|
|
18160
18600
|
setActiveTooltips([]);
|
|
18161
18601
|
};
|
|
18162
|
-
const handleCloseAllTooltips =
|
|
18602
|
+
const handleCloseAllTooltips = useCallback20(() => {
|
|
18163
18603
|
window.dispatchEvent(new CustomEvent("closeAllTooltips"));
|
|
18164
18604
|
}, []);
|
|
18165
|
-
const updateAlignmentGuides =
|
|
18605
|
+
const updateAlignmentGuides = useCallback20(
|
|
18166
18606
|
(draggedTooltipId, draggedPosition) => {
|
|
18167
18607
|
const SNAP_THRESHOLD = 15;
|
|
18168
18608
|
const draggedTooltip = activeTooltips.find(
|
|
@@ -18243,7 +18683,7 @@ var CustomLineChart = ({
|
|
|
18243
18683
|
},
|
|
18244
18684
|
[activeTooltips]
|
|
18245
18685
|
);
|
|
18246
|
-
const snapToGuides =
|
|
18686
|
+
const snapToGuides = useCallback20(
|
|
18247
18687
|
(position) => {
|
|
18248
18688
|
const SNAP_DISTANCE = 10;
|
|
18249
18689
|
const snappedPosition = { ...position };
|
|
@@ -18271,7 +18711,7 @@ var CustomLineChart = ({
|
|
|
18271
18711
|
setIsDragging(tooltipId);
|
|
18272
18712
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
18273
18713
|
};
|
|
18274
|
-
|
|
18714
|
+
useEffect36(() => {
|
|
18275
18715
|
let rafId;
|
|
18276
18716
|
let lastMousePosition = { x: 0, y: 0 };
|
|
18277
18717
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -18318,7 +18758,7 @@ var CustomLineChart = ({
|
|
|
18318
18758
|
updateAlignmentGuides,
|
|
18319
18759
|
snapToGuides
|
|
18320
18760
|
]);
|
|
18321
|
-
|
|
18761
|
+
useEffect36(() => {
|
|
18322
18762
|
const handleCloseAllTooltips2 = () => {
|
|
18323
18763
|
setActiveTooltips([]);
|
|
18324
18764
|
setGlobalTooltipCount(0);
|
|
@@ -18328,7 +18768,7 @@ var CustomLineChart = ({
|
|
|
18328
18768
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
|
|
18329
18769
|
};
|
|
18330
18770
|
}, []);
|
|
18331
|
-
|
|
18771
|
+
useEffect36(() => {
|
|
18332
18772
|
const handleTooltipCountRequest = () => {
|
|
18333
18773
|
window.dispatchEvent(
|
|
18334
18774
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -18372,7 +18812,7 @@ var CustomLineChart = ({
|
|
|
18372
18812
|
);
|
|
18373
18813
|
};
|
|
18374
18814
|
}, [activeTooltips]);
|
|
18375
|
-
|
|
18815
|
+
useEffect36(() => {
|
|
18376
18816
|
if (isDragging) return;
|
|
18377
18817
|
let totalCount = 0;
|
|
18378
18818
|
const handleCountResponse = (event) => {
|
|
@@ -18400,7 +18840,7 @@ var CustomLineChart = ({
|
|
|
18400
18840
|
return "text-left";
|
|
18401
18841
|
}
|
|
18402
18842
|
};
|
|
18403
|
-
return /* @__PURE__ */
|
|
18843
|
+
return /* @__PURE__ */ jsx99("div", { className: cn("relative", className), children: /* @__PURE__ */ jsxs77(
|
|
18404
18844
|
"div",
|
|
18405
18845
|
{
|
|
18406
18846
|
className: "rounded-lg bg-card p-4 relative border border-border",
|
|
@@ -18410,8 +18850,8 @@ var CustomLineChart = ({
|
|
|
18410
18850
|
},
|
|
18411
18851
|
onClick: handleChartBackgroundClick,
|
|
18412
18852
|
children: [
|
|
18413
|
-
title && /* @__PURE__ */
|
|
18414
|
-
/* @__PURE__ */
|
|
18853
|
+
title && /* @__PURE__ */ jsx99("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx99("div", { className: cn("mb-4", getTitleClass()), children: /* @__PURE__ */ jsx99("h3", { className: "text-lg font-semibold text-foreground", children: title }) }) }),
|
|
18854
|
+
/* @__PURE__ */ jsxs77(
|
|
18415
18855
|
RechartsLineChart,
|
|
18416
18856
|
{
|
|
18417
18857
|
data,
|
|
@@ -18420,7 +18860,7 @@ var CustomLineChart = ({
|
|
|
18420
18860
|
margin: resolveChartMargins(margins, chartMargins, showLabels),
|
|
18421
18861
|
onClick: handleChartClick,
|
|
18422
18862
|
children: [
|
|
18423
|
-
showGrid && /* @__PURE__ */
|
|
18863
|
+
showGrid && /* @__PURE__ */ jsx99(
|
|
18424
18864
|
CartesianGrid3,
|
|
18425
18865
|
{
|
|
18426
18866
|
strokeDasharray: "3 3",
|
|
@@ -18428,16 +18868,16 @@ var CustomLineChart = ({
|
|
|
18428
18868
|
opacity: 0.3
|
|
18429
18869
|
}
|
|
18430
18870
|
),
|
|
18431
|
-
/* @__PURE__ */
|
|
18432
|
-
|
|
18871
|
+
/* @__PURE__ */ jsx99(
|
|
18872
|
+
XAxis4,
|
|
18433
18873
|
{
|
|
18434
18874
|
dataKey: "name",
|
|
18435
18875
|
className: "fill-muted-foreground text-xs",
|
|
18436
18876
|
fontSize: 12
|
|
18437
18877
|
}
|
|
18438
18878
|
),
|
|
18439
|
-
/* @__PURE__ */
|
|
18440
|
-
|
|
18879
|
+
/* @__PURE__ */ jsx99(
|
|
18880
|
+
YAxis4,
|
|
18441
18881
|
{
|
|
18442
18882
|
className: "fill-muted-foreground text-xs",
|
|
18443
18883
|
fontSize: 12,
|
|
@@ -18446,8 +18886,8 @@ var CustomLineChart = ({
|
|
|
18446
18886
|
tickCount: 6
|
|
18447
18887
|
}
|
|
18448
18888
|
),
|
|
18449
|
-
showTooltip && /* @__PURE__ */
|
|
18450
|
-
showLegend && /* @__PURE__ */
|
|
18889
|
+
showTooltip && /* @__PURE__ */ jsx99(Tooltip3, { content: () => null }),
|
|
18890
|
+
showLegend && /* @__PURE__ */ jsx99(
|
|
18451
18891
|
Legend3,
|
|
18452
18892
|
{
|
|
18453
18893
|
wrapperStyle: {
|
|
@@ -18456,16 +18896,16 @@ var CustomLineChart = ({
|
|
|
18456
18896
|
}
|
|
18457
18897
|
}
|
|
18458
18898
|
),
|
|
18459
|
-
dataKeys.map((key) => /* @__PURE__ */
|
|
18460
|
-
|
|
18899
|
+
dataKeys.map((key) => /* @__PURE__ */ jsx99(
|
|
18900
|
+
Line3,
|
|
18461
18901
|
{
|
|
18462
18902
|
type: "monotone",
|
|
18463
18903
|
dataKey: key,
|
|
18464
18904
|
stroke: finalColors[key],
|
|
18465
18905
|
strokeWidth,
|
|
18466
18906
|
dot: showDots ? { r: 4, cursor: "pointer" } : false,
|
|
18467
|
-
activeDot: (props) => /* @__PURE__ */
|
|
18468
|
-
children: showLabels && /* @__PURE__ */
|
|
18907
|
+
activeDot: (props) => /* @__PURE__ */ jsx99(ClickableDot, { ...props, dataKey: key }),
|
|
18908
|
+
children: showLabels && /* @__PURE__ */ jsx99(
|
|
18469
18909
|
LabelList3,
|
|
18470
18910
|
{
|
|
18471
18911
|
dataKey: key,
|
|
@@ -18502,8 +18942,8 @@ var CustomLineChart = ({
|
|
|
18502
18942
|
guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
|
|
18503
18943
|
guide.targetTooltip.top + guide.targetTooltip.height / 2
|
|
18504
18944
|
);
|
|
18505
|
-
return /* @__PURE__ */
|
|
18506
|
-
/* @__PURE__ */
|
|
18945
|
+
return /* @__PURE__ */ jsxs77("div", { children: [
|
|
18946
|
+
/* @__PURE__ */ jsx99(
|
|
18507
18947
|
"div",
|
|
18508
18948
|
{
|
|
18509
18949
|
className: "fixed pointer-events-none z-30",
|
|
@@ -18522,7 +18962,7 @@ var CustomLineChart = ({
|
|
|
18522
18962
|
}
|
|
18523
18963
|
}
|
|
18524
18964
|
),
|
|
18525
|
-
/* @__PURE__ */
|
|
18965
|
+
/* @__PURE__ */ jsx99(
|
|
18526
18966
|
"div",
|
|
18527
18967
|
{
|
|
18528
18968
|
className: "fixed pointer-events-none z-31",
|
|
@@ -18538,7 +18978,7 @@ var CustomLineChart = ({
|
|
|
18538
18978
|
}
|
|
18539
18979
|
}
|
|
18540
18980
|
),
|
|
18541
|
-
/* @__PURE__ */
|
|
18981
|
+
/* @__PURE__ */ jsx99(
|
|
18542
18982
|
"div",
|
|
18543
18983
|
{
|
|
18544
18984
|
className: "fixed pointer-events-none z-31",
|
|
@@ -18556,7 +18996,7 @@ var CustomLineChart = ({
|
|
|
18556
18996
|
)
|
|
18557
18997
|
] }, index);
|
|
18558
18998
|
}),
|
|
18559
|
-
activeTooltips.map((tooltip, index) => /* @__PURE__ */
|
|
18999
|
+
activeTooltips.map((tooltip, index) => /* @__PURE__ */ jsx99(
|
|
18560
19000
|
DraggableTooltip_default,
|
|
18561
19001
|
{
|
|
18562
19002
|
id: tooltip.id,
|
|
@@ -18591,11 +19031,11 @@ import {
|
|
|
18591
19031
|
PieChart as RechartsPieChart,
|
|
18592
19032
|
Pie,
|
|
18593
19033
|
Cell,
|
|
18594
|
-
ResponsiveContainer as
|
|
19034
|
+
ResponsiveContainer as ResponsiveContainer3,
|
|
18595
19035
|
Tooltip as Tooltip4,
|
|
18596
19036
|
Legend as Legend4
|
|
18597
19037
|
} from "recharts";
|
|
18598
|
-
import { jsx as
|
|
19038
|
+
import { jsx as jsx100, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
18599
19039
|
var defaultData2 = [
|
|
18600
19040
|
{ name: "Vendas", value: 4e3 },
|
|
18601
19041
|
{ name: "Marketing", value: 3e3 },
|
|
@@ -18633,7 +19073,7 @@ var renderCustomizedLabel = ({
|
|
|
18633
19073
|
const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
|
|
18634
19074
|
const x = cx + radius * Math.cos(-midAngle * RADIAN);
|
|
18635
19075
|
const y = cy + radius * Math.sin(-midAngle * RADIAN);
|
|
18636
|
-
return /* @__PURE__ */
|
|
19076
|
+
return /* @__PURE__ */ jsx100(
|
|
18637
19077
|
"text",
|
|
18638
19078
|
{
|
|
18639
19079
|
x,
|
|
@@ -18662,8 +19102,8 @@ var CustomPieChart = ({
|
|
|
18662
19102
|
centerY = "50%"
|
|
18663
19103
|
}) => {
|
|
18664
19104
|
const finalColors = colors2 || DEFAULT_COLORS5;
|
|
18665
|
-
return /* @__PURE__ */
|
|
18666
|
-
/* @__PURE__ */
|
|
19105
|
+
return /* @__PURE__ */ jsx100("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ jsx100(ResponsiveContainer3, { width, height, children: /* @__PURE__ */ jsxs78(RechartsPieChart, { children: [
|
|
19106
|
+
/* @__PURE__ */ jsx100(
|
|
18667
19107
|
Pie,
|
|
18668
19108
|
{
|
|
18669
19109
|
data,
|
|
@@ -18675,7 +19115,7 @@ var CustomPieChart = ({
|
|
|
18675
19115
|
innerRadius,
|
|
18676
19116
|
fill: "#8884d8",
|
|
18677
19117
|
dataKey: "value",
|
|
18678
|
-
children: data.map((entry, index) => /* @__PURE__ */
|
|
19118
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx100(
|
|
18679
19119
|
Cell,
|
|
18680
19120
|
{
|
|
18681
19121
|
fill: finalColors[index % finalColors.length]
|
|
@@ -18684,7 +19124,7 @@ var CustomPieChart = ({
|
|
|
18684
19124
|
))
|
|
18685
19125
|
}
|
|
18686
19126
|
),
|
|
18687
|
-
showTooltip && /* @__PURE__ */
|
|
19127
|
+
showTooltip && /* @__PURE__ */ jsx100(
|
|
18688
19128
|
Tooltip4,
|
|
18689
19129
|
{
|
|
18690
19130
|
contentStyle: {
|
|
@@ -18695,25 +19135,71 @@ var CustomPieChart = ({
|
|
|
18695
19135
|
}
|
|
18696
19136
|
}
|
|
18697
19137
|
),
|
|
18698
|
-
showLegend && /* @__PURE__ */
|
|
19138
|
+
showLegend && /* @__PURE__ */ jsx100(Legend4, {})
|
|
18699
19139
|
] }) }) });
|
|
18700
19140
|
};
|
|
18701
19141
|
var PieChart_default = CustomPieChart;
|
|
18702
19142
|
|
|
19143
|
+
// src/components/ui/charts/TimeSeries.tsx
|
|
19144
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
19145
|
+
var TimeSeries = ({
|
|
19146
|
+
data,
|
|
19147
|
+
xAxis,
|
|
19148
|
+
chartHeight = 350,
|
|
19149
|
+
height,
|
|
19150
|
+
brushHeight,
|
|
19151
|
+
className,
|
|
19152
|
+
start,
|
|
19153
|
+
end,
|
|
19154
|
+
defaultStartIndex,
|
|
19155
|
+
defaultEndIndex,
|
|
19156
|
+
onRangeChange,
|
|
19157
|
+
brushColor,
|
|
19158
|
+
brushStroke,
|
|
19159
|
+
miniChartOpacity = 0.2,
|
|
19160
|
+
...rest
|
|
19161
|
+
}) => {
|
|
19162
|
+
const brushHeightValue = brushHeight ?? height ?? 60;
|
|
19163
|
+
const startIndex = defaultStartIndex ?? start ?? 0;
|
|
19164
|
+
const endIndex = defaultEndIndex ?? end;
|
|
19165
|
+
return /* @__PURE__ */ jsx101("div", { className: cn("w-full flex flex-col", className), children: /* @__PURE__ */ jsx101(
|
|
19166
|
+
Chart_default,
|
|
19167
|
+
{
|
|
19168
|
+
...rest,
|
|
19169
|
+
data,
|
|
19170
|
+
xAxis,
|
|
19171
|
+
height: chartHeight + brushHeightValue + 40,
|
|
19172
|
+
timeSeries: {
|
|
19173
|
+
start: startIndex,
|
|
19174
|
+
end: endIndex,
|
|
19175
|
+
onRangeChange,
|
|
19176
|
+
height: brushHeightValue,
|
|
19177
|
+
brushColor,
|
|
19178
|
+
brushStroke,
|
|
19179
|
+
miniChartOpacity
|
|
19180
|
+
}
|
|
19181
|
+
}
|
|
19182
|
+
) });
|
|
19183
|
+
};
|
|
19184
|
+
var TimeSeries_default = TimeSeries;
|
|
19185
|
+
|
|
18703
19186
|
// src/components/ui/LeaderBoard.tsx
|
|
18704
|
-
import { CaretUpDownIcon as CaretUpDownIcon3 } from "@phosphor-icons/react";
|
|
18705
|
-
import { useState as
|
|
19187
|
+
import { CaretUpDownIcon as CaretUpDownIcon3, MagnifyingGlassIcon as MagnifyingGlassIcon3 } from "@phosphor-icons/react";
|
|
19188
|
+
import { useState as useState46 } from "react";
|
|
18706
19189
|
import { motion as motion22 } from "framer-motion";
|
|
18707
|
-
import { jsx as
|
|
19190
|
+
import { jsx as jsx102, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
18708
19191
|
function Leaderboard({
|
|
18709
19192
|
items,
|
|
18710
19193
|
order: initialOrder = "desc",
|
|
18711
19194
|
title = "LeaderBoard",
|
|
18712
19195
|
className,
|
|
18713
19196
|
isLoading = false,
|
|
18714
|
-
legend
|
|
19197
|
+
legend,
|
|
19198
|
+
best = false,
|
|
19199
|
+
worst = false
|
|
18715
19200
|
}) {
|
|
18716
|
-
const [order, setOrder] =
|
|
19201
|
+
const [order, setOrder] = useState46(initialOrder);
|
|
19202
|
+
const [searchTerm, setSearchTerm] = useState46("");
|
|
18717
19203
|
const mockData = [
|
|
18718
19204
|
{ name: "Ana", value: 92 },
|
|
18719
19205
|
{ name: "Bruno", value: 81 },
|
|
@@ -18727,7 +19213,10 @@ function Leaderboard({
|
|
|
18727
19213
|
{ name: "Jo\xE3o", value: 18 }
|
|
18728
19214
|
];
|
|
18729
19215
|
const data = items ?? mockData;
|
|
18730
|
-
const
|
|
19216
|
+
const filteredData = data.filter(
|
|
19217
|
+
(item) => item.name.toLowerCase().includes(searchTerm.toLowerCase())
|
|
19218
|
+
);
|
|
19219
|
+
const sortedData = [...filteredData].sort((a, b) => {
|
|
18731
19220
|
const aValue = typeof a.value === "string" ? parseFloat(a.value) || a.value : a.value;
|
|
18732
19221
|
const bValue = typeof b.value === "string" ? parseFloat(b.value) || b.value : b.value;
|
|
18733
19222
|
if (typeof aValue === "number" && typeof bValue === "number") {
|
|
@@ -18739,57 +19228,87 @@ function Leaderboard({
|
|
|
18739
19228
|
if (typeof aValue === "number") return order === "desc" ? -1 : 1;
|
|
18740
19229
|
return order === "desc" ? 1 : -1;
|
|
18741
19230
|
});
|
|
18742
|
-
const getBadgeColor = (value) => {
|
|
19231
|
+
const getBadgeColor = (value, index, total) => {
|
|
19232
|
+
if (best || worst) {
|
|
19233
|
+
const third = total / 3;
|
|
19234
|
+
if (best) {
|
|
19235
|
+
if (index < third) return "green";
|
|
19236
|
+
if (index < 2 * third) return "yellow";
|
|
19237
|
+
return "red";
|
|
19238
|
+
}
|
|
19239
|
+
if (worst) {
|
|
19240
|
+
if (index < third) return "red";
|
|
19241
|
+
if (index < 2 * third) return "yellow";
|
|
19242
|
+
return "green";
|
|
19243
|
+
}
|
|
19244
|
+
}
|
|
18743
19245
|
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
18744
19246
|
if (isNaN(numValue)) return "green";
|
|
18745
19247
|
if (numValue >= 75) return "red";
|
|
18746
19248
|
if (numValue >= 25) return "yellow";
|
|
18747
19249
|
return "green";
|
|
18748
19250
|
};
|
|
18749
|
-
return /* @__PURE__ */
|
|
19251
|
+
return /* @__PURE__ */ jsxs79(
|
|
18750
19252
|
"div",
|
|
18751
19253
|
{
|
|
18752
|
-
className: `border rounded-xl flex flex-col max-h-80 w-96
|
|
19254
|
+
className: `border rounded-xl flex flex-col max-h-80 w-96 ${className}`,
|
|
18753
19255
|
children: [
|
|
18754
|
-
/* @__PURE__ */
|
|
18755
|
-
/* @__PURE__ */
|
|
18756
|
-
/* @__PURE__ */
|
|
19256
|
+
/* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between py-2 px-4 border-b flex-shrink-0 gap-3 ", children: [
|
|
19257
|
+
/* @__PURE__ */ jsx102("h2", { className: "text-lg font-semibold px-1 whitespace-nowrap", children: title }),
|
|
19258
|
+
/* @__PURE__ */ jsx102("div", { className: "flex-1 max-w-[200px]", children: /* @__PURE__ */ jsx102(
|
|
19259
|
+
InputBase,
|
|
19260
|
+
{
|
|
19261
|
+
value: searchTerm,
|
|
19262
|
+
onChange: (e) => setSearchTerm(e.target.value),
|
|
19263
|
+
placeholder: "Pesquisar...",
|
|
19264
|
+
leftIcon: /* @__PURE__ */ jsx102(MagnifyingGlassIcon3, { size: 16 }),
|
|
19265
|
+
className: "h-8 py-1"
|
|
19266
|
+
}
|
|
19267
|
+
) }),
|
|
19268
|
+
/* @__PURE__ */ jsx102(
|
|
18757
19269
|
ButtonBase,
|
|
18758
19270
|
{
|
|
18759
19271
|
size: "icon",
|
|
18760
|
-
variant: "
|
|
19272
|
+
variant: "outline",
|
|
18761
19273
|
onClick: () => setOrder(order === "desc" ? "asc" : "desc"),
|
|
18762
19274
|
disabled: isLoading || sortedData.length === 0,
|
|
18763
|
-
children: /* @__PURE__ */
|
|
19275
|
+
children: /* @__PURE__ */ jsx102(
|
|
19276
|
+
motion22.div,
|
|
19277
|
+
{
|
|
19278
|
+
animate: { rotate: order === "asc" ? 180 : 0 },
|
|
19279
|
+
transition: { type: "spring", stiffness: 300, damping: 20 },
|
|
19280
|
+
children: /* @__PURE__ */ jsx102(CaretUpDownIcon3, {})
|
|
19281
|
+
}
|
|
19282
|
+
)
|
|
18764
19283
|
}
|
|
18765
19284
|
)
|
|
18766
19285
|
] }),
|
|
18767
|
-
/* @__PURE__ */
|
|
18768
|
-
/* @__PURE__ */
|
|
18769
|
-
/* @__PURE__ */
|
|
18770
|
-
/* @__PURE__ */
|
|
19286
|
+
/* @__PURE__ */ jsx102("div", { className: "overflow-y-auto flex-1 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40 transition-colors", children: isLoading ? /* @__PURE__ */ jsx102("div", { className: "p-4 space-y-3", children: Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between p-1", children: [
|
|
19287
|
+
/* @__PURE__ */ jsxs79("div", { className: "flex items-center gap-3 flex-1", children: [
|
|
19288
|
+
/* @__PURE__ */ jsx102(SkeletonBase, { className: "w-8 h-8 rounded-full" }),
|
|
19289
|
+
/* @__PURE__ */ jsx102(SkeletonBase, { className: "h-4 w-36 rounded-full" })
|
|
18771
19290
|
] }),
|
|
18772
|
-
/* @__PURE__ */
|
|
18773
|
-
] }, idx)) }) : sortedData.length === 0 ? /* @__PURE__ */
|
|
18774
|
-
/* @__PURE__ */
|
|
18775
|
-
/* @__PURE__ */
|
|
18776
|
-
/* @__PURE__ */
|
|
19291
|
+
/* @__PURE__ */ jsx102(SkeletonBase, { className: "h-6 w-12 rounded-full" })
|
|
19292
|
+
] }, idx)) }) : sortedData.length === 0 ? /* @__PURE__ */ jsx102("div", { className: "flex items-center justify-center h-full py-12", children: /* @__PURE__ */ jsx102("p", { className: "text-muted-foreground text-sm", children: "Sem dados dispon\xEDveis" }) }) : /* @__PURE__ */ jsxs79("div", { children: [
|
|
19293
|
+
/* @__PURE__ */ jsxs79("div", { className: "flex items-center justify-between py-2.5 px-4 border-b flex-shrink-0 gap-3 sticky top-0 bg-background", children: [
|
|
19294
|
+
/* @__PURE__ */ jsx102("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider pl-1", children: legend?.[0] }),
|
|
19295
|
+
/* @__PURE__ */ jsx102("div", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: legend?.[1] })
|
|
18777
19296
|
] }),
|
|
18778
|
-
/* @__PURE__ */
|
|
19297
|
+
/* @__PURE__ */ jsx102("ul", { children: sortedData.map((item, idx) => /* @__PURE__ */ jsx102(
|
|
18779
19298
|
motion22.span,
|
|
18780
19299
|
{
|
|
18781
19300
|
initial: { opacity: 0, y: 10 },
|
|
18782
19301
|
animate: { opacity: 1, y: 0 },
|
|
18783
19302
|
transition: { delay: idx * 5e-3 },
|
|
18784
|
-
children: /* @__PURE__ */
|
|
18785
|
-
/* @__PURE__ */
|
|
18786
|
-
/* @__PURE__ */
|
|
18787
|
-
/* @__PURE__ */
|
|
19303
|
+
children: /* @__PURE__ */ jsxs79("li", { className: "flex items-center justify-between py-3 border-b last:border-b-0 hover:bg-muted transition-colors px-4", children: [
|
|
19304
|
+
/* @__PURE__ */ jsxs79("div", { className: "flex items-center gap-3", children: [
|
|
19305
|
+
/* @__PURE__ */ jsx102("span", { className: "text-sm text-gray-400 w-6 h-6 border rounded-full text-center bg-muted/50", children: order === "desc" ? idx + 1 : sortedData.length - idx }),
|
|
19306
|
+
/* @__PURE__ */ jsx102("span", { className: "font-medium", children: item.name })
|
|
18788
19307
|
] }),
|
|
18789
|
-
/* @__PURE__ */
|
|
19308
|
+
/* @__PURE__ */ jsx102(
|
|
18790
19309
|
Badge,
|
|
18791
19310
|
{
|
|
18792
|
-
color: getBadgeColor(item.value),
|
|
19311
|
+
color: getBadgeColor(item.value, idx, sortedData.length),
|
|
18793
19312
|
size: "md",
|
|
18794
19313
|
className: "font-bold",
|
|
18795
19314
|
children: item.value
|
|
@@ -18835,6 +19354,7 @@ export {
|
|
|
18835
19354
|
BreadcrumbListBase,
|
|
18836
19355
|
BreadcrumbPageBase,
|
|
18837
19356
|
BreadcrumbSeparatorBase,
|
|
19357
|
+
Brush_default as Brush,
|
|
18838
19358
|
ButtonBase,
|
|
18839
19359
|
ButtonGroupBase,
|
|
18840
19360
|
CalendarBase,
|
|
@@ -19088,6 +19608,7 @@ export {
|
|
|
19088
19608
|
ThemeProviderBase,
|
|
19089
19609
|
TimePicker,
|
|
19090
19610
|
TimePickerInput,
|
|
19611
|
+
TimeSeries_default as TimeSeries,
|
|
19091
19612
|
Toaster,
|
|
19092
19613
|
TooltipBase,
|
|
19093
19614
|
TooltipContentBase,
|
|
@@ -19183,5 +19704,6 @@ export {
|
|
|
19183
19704
|
useEventVisibilityAgenda,
|
|
19184
19705
|
useIsMobile,
|
|
19185
19706
|
useTheme,
|
|
19707
|
+
useTimeSeriesRange,
|
|
19186
19708
|
visualForItem
|
|
19187
19709
|
};
|