@mlw-packages/react-components 1.7.4 → 1.7.5
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 +117 -77
- package/dist/index.d.mts +34 -2
- package/dist/index.d.ts +34 -2
- package/dist/index.js +671 -331
- package/dist/index.mjs +632 -281
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -530,6 +530,7 @@ __export(index_exports, {
|
|
|
530
530
|
CheckboxBase: () => CheckboxBase,
|
|
531
531
|
CloseAllButton: () => CloseAllButton_default,
|
|
532
532
|
CloseButton: () => CloseButton,
|
|
533
|
+
CodeBlock: () => CodeBlock,
|
|
533
534
|
CollapsibleBase: () => CollapsibleBase,
|
|
534
535
|
CollapsibleContentBase: () => CollapsibleContentBase,
|
|
535
536
|
CollapsibleTriggerBase: () => CollapsibleTriggerBase,
|
|
@@ -775,7 +776,7 @@ __export(index_exports, {
|
|
|
775
776
|
module.exports = __toCommonJS(index_exports);
|
|
776
777
|
|
|
777
778
|
// src/components/ui/FilterBase.tsx
|
|
778
|
-
var
|
|
779
|
+
var import_react9 = require("react");
|
|
779
780
|
|
|
780
781
|
// src/components/ui/form/ButtonBase.tsx
|
|
781
782
|
var React = __toESM(require("react"));
|
|
@@ -790,6 +791,7 @@ function cn(...inputs) {
|
|
|
790
791
|
}
|
|
791
792
|
|
|
792
793
|
// src/components/ui/form/ButtonBase.tsx
|
|
794
|
+
var import_react = require("@phosphor-icons/react");
|
|
793
795
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
794
796
|
var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
795
797
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive active:scale-95",
|
|
@@ -825,16 +827,38 @@ var ButtonBase = React.forwardRef(
|
|
|
825
827
|
size,
|
|
826
828
|
asChild = false,
|
|
827
829
|
testid = `button-${variant ?? "default"}`,
|
|
830
|
+
isLoading = false,
|
|
831
|
+
children,
|
|
828
832
|
...props
|
|
829
833
|
}, ref) => {
|
|
830
834
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
831
|
-
|
|
835
|
+
const mergedDisabled = Boolean(props.disabled) || isLoading;
|
|
836
|
+
const isActivelyLoading = isLoading && !props.disabled;
|
|
837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
832
838
|
Comp,
|
|
833
839
|
{
|
|
834
|
-
className: cn(
|
|
840
|
+
className: cn(
|
|
841
|
+
buttonVariantsBase({ variant, size, className }),
|
|
842
|
+
"relative"
|
|
843
|
+
),
|
|
835
844
|
ref,
|
|
836
845
|
"data-testid": testid ?? `button-${variant ?? "default"}`,
|
|
837
|
-
|
|
846
|
+
"aria-busy": isActivelyLoading || void 0,
|
|
847
|
+
disabled: mergedDisabled,
|
|
848
|
+
...props,
|
|
849
|
+
children: [
|
|
850
|
+
children,
|
|
851
|
+
isActivelyLoading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "absolute inset-0 flex items-center justify-center pointer-events-none rounded-md", children: [
|
|
852
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute inset-0 rounded-md backdrop-blur overflow-hidden" }),
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
854
|
+
import_react.CircleNotchIcon,
|
|
855
|
+
{
|
|
856
|
+
weight: "bold",
|
|
857
|
+
className: "relative animate-spin h-4 w-4 text-current"
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
] })
|
|
861
|
+
]
|
|
838
862
|
}
|
|
839
863
|
);
|
|
840
864
|
}
|
|
@@ -876,7 +900,7 @@ ButtonGroupBase.displayName = "ButtonGroup";
|
|
|
876
900
|
// src/components/ui/feedback/DialogBase.tsx
|
|
877
901
|
var React2 = __toESM(require("react"));
|
|
878
902
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
879
|
-
var
|
|
903
|
+
var import_react2 = require("@phosphor-icons/react");
|
|
880
904
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
881
905
|
var DialogBase = DialogPrimitive.Root;
|
|
882
906
|
var DialogTriggerBase = DialogPrimitive.Trigger;
|
|
@@ -911,7 +935,7 @@ var DialogContentBase = React2.forwardRef(
|
|
|
911
935
|
children: [
|
|
912
936
|
children,
|
|
913
937
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(DialogPrimitive.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground z-10 touch-manipulation", children: [
|
|
914
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
938
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4" }),
|
|
915
939
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Close" })
|
|
916
940
|
] })
|
|
917
941
|
]
|
|
@@ -1059,12 +1083,12 @@ var InputBase = React4.forwardRef(
|
|
|
1059
1083
|
InputBase.displayName = "Input";
|
|
1060
1084
|
|
|
1061
1085
|
// src/components/selects/Combobox.tsx
|
|
1062
|
-
var
|
|
1086
|
+
var import_react6 = require("react");
|
|
1063
1087
|
|
|
1064
1088
|
// src/components/ui/navigation/CommandBase.tsx
|
|
1065
1089
|
var React5 = __toESM(require("react"));
|
|
1066
1090
|
var import_cmdk = require("cmdk");
|
|
1067
|
-
var
|
|
1091
|
+
var import_react3 = require("@phosphor-icons/react");
|
|
1068
1092
|
var import_framer_motion = require("framer-motion");
|
|
1069
1093
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1070
1094
|
var CommandBase = React5.forwardRef(({ className, testid: dataTestId = "command-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -1101,7 +1125,7 @@ var CommandDialogBase = ({ children, open, ...props }) => {
|
|
|
1101
1125
|
) }) }) });
|
|
1102
1126
|
};
|
|
1103
1127
|
var CommandInputBase = React5.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
1104
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1128
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react3.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
1105
1129
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1106
1130
|
import_cmdk.Command.Input,
|
|
1107
1131
|
{
|
|
@@ -1222,8 +1246,8 @@ PopoverContentBase.displayName = PopoverPrimitive.Content.displayName;
|
|
|
1222
1246
|
|
|
1223
1247
|
// src/components/selects/ComboboxBase.tsx
|
|
1224
1248
|
var import_framer_motion2 = require("framer-motion");
|
|
1225
|
-
var
|
|
1226
|
-
var
|
|
1249
|
+
var import_react4 = require("react");
|
|
1250
|
+
var import_react5 = require("@phosphor-icons/react");
|
|
1227
1251
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1228
1252
|
function ComboboxBase({
|
|
1229
1253
|
items,
|
|
@@ -1236,7 +1260,7 @@ function ComboboxBase({
|
|
|
1236
1260
|
error,
|
|
1237
1261
|
testIds = {}
|
|
1238
1262
|
}) {
|
|
1239
|
-
const [open, setOpen] = (0,
|
|
1263
|
+
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
1240
1264
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1241
1265
|
"div",
|
|
1242
1266
|
{
|
|
@@ -1270,7 +1294,7 @@ function ComboboxBase({
|
|
|
1270
1294
|
animate: { rotate: open ? 180 : 0 },
|
|
1271
1295
|
transition: { duration: 0.3 },
|
|
1272
1296
|
className: "flex",
|
|
1273
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react5.CaretDownIcon, { className: " flex-shrink-0" })
|
|
1274
1298
|
}
|
|
1275
1299
|
)
|
|
1276
1300
|
]
|
|
@@ -1325,7 +1349,7 @@ function ComboboxBase({
|
|
|
1325
1349
|
},
|
|
1326
1350
|
className: "ml-auto ",
|
|
1327
1351
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1328
|
-
|
|
1352
|
+
import_react5.CheckIcon,
|
|
1329
1353
|
{
|
|
1330
1354
|
className: cn(
|
|
1331
1355
|
"ml-auto",
|
|
@@ -1369,7 +1393,7 @@ function Combobox({
|
|
|
1369
1393
|
error
|
|
1370
1394
|
}) {
|
|
1371
1395
|
const selectedItem = items.find((item) => item.value === selected);
|
|
1372
|
-
const renderSelected = (0,
|
|
1396
|
+
const renderSelected = (0, import_react6.useMemo)(() => {
|
|
1373
1397
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1374
1398
|
"span",
|
|
1375
1399
|
{
|
|
@@ -1379,11 +1403,11 @@ function Combobox({
|
|
|
1379
1403
|
}
|
|
1380
1404
|
);
|
|
1381
1405
|
}, [placeholder, selectedItem, testIds?.selected]);
|
|
1382
|
-
const checkIsSelected = (0,
|
|
1406
|
+
const checkIsSelected = (0, import_react6.useCallback)(
|
|
1383
1407
|
(value) => selected == null ? false : selected == value,
|
|
1384
1408
|
[selected]
|
|
1385
1409
|
);
|
|
1386
|
-
const handleSelection = (0,
|
|
1410
|
+
const handleSelection = (0, import_react6.useCallback)(
|
|
1387
1411
|
(value) => {
|
|
1388
1412
|
onChange(value === selected ? null : value);
|
|
1389
1413
|
},
|
|
@@ -1407,8 +1431,8 @@ function Combobox({
|
|
|
1407
1431
|
}
|
|
1408
1432
|
|
|
1409
1433
|
// src/components/selects/MultiCombobox.tsx
|
|
1410
|
-
var
|
|
1411
|
-
var
|
|
1434
|
+
var import_react7 = require("react");
|
|
1435
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
1412
1436
|
var import_framer_motion3 = require("framer-motion");
|
|
1413
1437
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1414
1438
|
function MultiCombobox({
|
|
@@ -1426,11 +1450,11 @@ function MultiCombobox({
|
|
|
1426
1450
|
showClearAll = false
|
|
1427
1451
|
}) {
|
|
1428
1452
|
const selectedItems = items.filter((item) => selected.includes(item.value));
|
|
1429
|
-
const checkIsSelected = (0,
|
|
1453
|
+
const checkIsSelected = (0, import_react7.useCallback)(
|
|
1430
1454
|
(value) => selected.includes(value),
|
|
1431
1455
|
[selected]
|
|
1432
1456
|
);
|
|
1433
|
-
const handleSelection = (0,
|
|
1457
|
+
const handleSelection = (0, import_react7.useCallback)(
|
|
1434
1458
|
(value) => {
|
|
1435
1459
|
const isSelected = selected.includes(value);
|
|
1436
1460
|
if (isSelected) {
|
|
@@ -1452,10 +1476,10 @@ function MultiCombobox({
|
|
|
1452
1476
|
onChange([]);
|
|
1453
1477
|
},
|
|
1454
1478
|
className: "text-xs hover:bg-red-50 hover:text-red-500 transition-colors rounded-md mr-2",
|
|
1455
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react8.XIcon, {})
|
|
1456
1480
|
}
|
|
1457
1481
|
) }) : null;
|
|
1458
|
-
const renderSelected = (0,
|
|
1482
|
+
const renderSelected = (0, import_react7.useMemo)(() => {
|
|
1459
1483
|
if (selectedItems.length === 0) {
|
|
1460
1484
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1461
1485
|
"span",
|
|
@@ -1499,7 +1523,7 @@ function MultiCombobox({
|
|
|
1499
1523
|
whileHover: { scale: 1.1 },
|
|
1500
1524
|
whileTap: { scale: 0.95 },
|
|
1501
1525
|
className: "cursor-pointer text-xs flex items-center justify-center hover:text-red-500 transition-colors flex-shrink-0 rounded hover:bg-red-50 ",
|
|
1502
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react8.XIcon, { size: 14 })
|
|
1503
1527
|
}
|
|
1504
1528
|
)
|
|
1505
1529
|
]
|
|
@@ -1563,14 +1587,14 @@ var TooltipContentBase = React7.forwardRef(({ className, sideOffset = 4, ...prop
|
|
|
1563
1587
|
TooltipContentBase.displayName = TooltipPrimitive.Content.displayName;
|
|
1564
1588
|
|
|
1565
1589
|
// src/components/ui/FilterBase.tsx
|
|
1566
|
-
var
|
|
1590
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
1567
1591
|
var import_colors = __toESM(require_colors2());
|
|
1568
1592
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1569
1593
|
|
|
1570
1594
|
// src/components/ui/SelectBase.tsx
|
|
1571
1595
|
var React8 = __toESM(require("react"));
|
|
1572
1596
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
1573
|
-
var
|
|
1597
|
+
var import_react11 = require("@phosphor-icons/react");
|
|
1574
1598
|
var import_framer_motion4 = require("framer-motion");
|
|
1575
1599
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1576
1600
|
var SelectBase = SelectPrimitive.Root;
|
|
@@ -1595,7 +1619,7 @@ var SelectTriggerBase = React8.forwardRef(({ className, children, open, error, .
|
|
|
1595
1619
|
animate: { rotate: open ? 180 : 0 },
|
|
1596
1620
|
transition: { duration: 0.3 },
|
|
1597
1621
|
className: "flex items-center",
|
|
1598
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react11.CaretDownIcon, { className: "h-4 w-4 opacity-50" })
|
|
1599
1623
|
}
|
|
1600
1624
|
)
|
|
1601
1625
|
]
|
|
@@ -1613,7 +1637,7 @@ var SelectScrollUpButtonBase = React8.forwardRef(({ className, ...props }, ref)
|
|
|
1613
1637
|
className
|
|
1614
1638
|
),
|
|
1615
1639
|
...props,
|
|
1616
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react11.CaretUpIcon, { className: "h-4 w-4" })
|
|
1617
1641
|
}
|
|
1618
1642
|
));
|
|
1619
1643
|
SelectScrollUpButtonBase.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -1626,7 +1650,7 @@ var SelectScrollDownButtonBase = React8.forwardRef(({ className, ...props }, ref
|
|
|
1626
1650
|
className
|
|
1627
1651
|
),
|
|
1628
1652
|
...props,
|
|
1629
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react11.CaretDownIcon, { className: "h-4 w-4" })
|
|
1630
1654
|
}
|
|
1631
1655
|
));
|
|
1632
1656
|
SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -1708,7 +1732,7 @@ var SelectItemBase = React8.forwardRef(({ className, children, ...props }, ref)
|
|
|
1708
1732
|
initial: { scale: 0 },
|
|
1709
1733
|
animate: { scale: 1 },
|
|
1710
1734
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
1711
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react11.CheckIcon, { className: "h-4 w-4" })
|
|
1712
1736
|
}
|
|
1713
1737
|
) }) }),
|
|
1714
1738
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SelectPrimitive.ItemText, { children })
|
|
@@ -1729,12 +1753,12 @@ var SelectSeparatorBase = React8.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1729
1753
|
SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
|
|
1730
1754
|
|
|
1731
1755
|
// src/components/mode-toggle.tsx
|
|
1732
|
-
var
|
|
1756
|
+
var import_react14 = require("@phosphor-icons/react");
|
|
1733
1757
|
|
|
1734
1758
|
// src/components/ui/navigation/DropDownMenuBase.tsx
|
|
1735
1759
|
var React9 = __toESM(require("react"));
|
|
1736
1760
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
1737
|
-
var
|
|
1761
|
+
var import_react12 = require("@phosphor-icons/react");
|
|
1738
1762
|
var import_framer_motion5 = require("framer-motion");
|
|
1739
1763
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1740
1764
|
var DropDownMenuBase = DropdownMenuPrimitive.Root;
|
|
@@ -1755,7 +1779,7 @@ var DropDownMenuSubTriggerBase = React9.forwardRef(({ className, inset, children
|
|
|
1755
1779
|
...props,
|
|
1756
1780
|
children: [
|
|
1757
1781
|
children,
|
|
1758
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1782
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.CaretRightIcon, { className: "ml-auto" })
|
|
1759
1783
|
]
|
|
1760
1784
|
}
|
|
1761
1785
|
));
|
|
@@ -1835,7 +1859,7 @@ var DropDownMenuCheckboxItemBase = React9.forwardRef(({ className, children, che
|
|
|
1835
1859
|
checked,
|
|
1836
1860
|
...props,
|
|
1837
1861
|
children: [
|
|
1838
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1862
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
1839
1863
|
children
|
|
1840
1864
|
]
|
|
1841
1865
|
}
|
|
@@ -1851,7 +1875,7 @@ var DropDownMenuRadioItemBase = React9.forwardRef(({ className, children, ...pro
|
|
|
1851
1875
|
),
|
|
1852
1876
|
...props,
|
|
1853
1877
|
children: [
|
|
1854
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react12.CircleIcon, { className: "h-2 w-2 fill-current" }) }) }),
|
|
1855
1879
|
children
|
|
1856
1880
|
]
|
|
1857
1881
|
}
|
|
@@ -1894,21 +1918,21 @@ var DropDownMenuShortcutBase = ({
|
|
|
1894
1918
|
DropDownMenuShortcutBase.displayName = "DropDownMenuShortcutBase";
|
|
1895
1919
|
|
|
1896
1920
|
// src/components/theme-provider.tsx
|
|
1897
|
-
var
|
|
1921
|
+
var import_react13 = require("react");
|
|
1898
1922
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1899
1923
|
var initialState = {
|
|
1900
1924
|
theme: "system",
|
|
1901
1925
|
setTheme: () => null
|
|
1902
1926
|
};
|
|
1903
|
-
var ThemeProviderContext = (0,
|
|
1927
|
+
var ThemeProviderContext = (0, import_react13.createContext)(initialState);
|
|
1904
1928
|
function ThemeProviderBase({
|
|
1905
1929
|
children,
|
|
1906
1930
|
defaultTheme = "system",
|
|
1907
1931
|
storageKey = "app-ui-theme",
|
|
1908
1932
|
...props
|
|
1909
1933
|
}) {
|
|
1910
|
-
const [theme, setThemeState] = (0,
|
|
1911
|
-
(0,
|
|
1934
|
+
const [theme, setThemeState] = (0, import_react13.useState)(defaultTheme);
|
|
1935
|
+
(0, import_react13.useEffect)(() => {
|
|
1912
1936
|
const root = window.document.documentElement;
|
|
1913
1937
|
root.classList.remove(
|
|
1914
1938
|
"light",
|
|
@@ -1934,7 +1958,7 @@ function ThemeProviderBase({
|
|
|
1934
1958
|
document.body.style.color = "";
|
|
1935
1959
|
}
|
|
1936
1960
|
}, [theme]);
|
|
1937
|
-
(0,
|
|
1961
|
+
(0, import_react13.useEffect)(() => {
|
|
1938
1962
|
const stored = localStorage.getItem(storageKey);
|
|
1939
1963
|
if (stored) setThemeState(stored);
|
|
1940
1964
|
}, [storageKey]);
|
|
@@ -1948,7 +1972,7 @@ function ThemeProviderBase({
|
|
|
1948
1972
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ThemeProviderContext.Provider, { ...props, value, children });
|
|
1949
1973
|
}
|
|
1950
1974
|
var useTheme = () => {
|
|
1951
|
-
const context = (0,
|
|
1975
|
+
const context = (0, import_react13.useContext)(ThemeProviderContext);
|
|
1952
1976
|
if (context === void 0)
|
|
1953
1977
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
1954
1978
|
return context;
|
|
@@ -1982,13 +2006,13 @@ function ModeToggleBase({
|
|
|
1982
2006
|
children: [
|
|
1983
2007
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1984
2008
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1985
|
-
|
|
2009
|
+
import_react14.SunIcon,
|
|
1986
2010
|
{
|
|
1987
2011
|
className: `h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-90 scale-0" : "rotate-0 scale-100"}`
|
|
1988
2012
|
}
|
|
1989
2013
|
),
|
|
1990
2014
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1991
|
-
|
|
2015
|
+
import_react14.MoonIcon,
|
|
1992
2016
|
{
|
|
1993
2017
|
className: `absolute h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-0 scale-100" : "rotate-90 scale-0"}`
|
|
1994
2018
|
}
|
|
@@ -2010,7 +2034,7 @@ function ModeToggleBase({
|
|
|
2010
2034
|
className: "flex items-center justify-between hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
2011
2035
|
children: [
|
|
2012
2036
|
themeLabels[theme],
|
|
2013
|
-
currentTheme === theme && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2037
|
+
currentTheme === theme && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react14.CheckIcon, { className: "h-4 w-4 opacity-100" })
|
|
2014
2038
|
]
|
|
2015
2039
|
},
|
|
2016
2040
|
theme
|
|
@@ -2063,7 +2087,8 @@ function Select({
|
|
|
2063
2087
|
placeholder,
|
|
2064
2088
|
onChange,
|
|
2065
2089
|
error,
|
|
2066
|
-
testIds = {}
|
|
2090
|
+
testIds = {},
|
|
2091
|
+
disabled
|
|
2067
2092
|
}) {
|
|
2068
2093
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { "data-testid": testIds.root ?? "select-root", children: [
|
|
2069
2094
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
@@ -2080,6 +2105,7 @@ function Select({
|
|
|
2080
2105
|
error && "border-red-500"
|
|
2081
2106
|
),
|
|
2082
2107
|
"data-testid": testIds.trigger ?? "select-trigger",
|
|
2108
|
+
disabled,
|
|
2083
2109
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2084
2110
|
SelectValueBase,
|
|
2085
2111
|
{
|
|
@@ -2130,7 +2156,7 @@ function Select({
|
|
|
2130
2156
|
}
|
|
2131
2157
|
|
|
2132
2158
|
// src/components/charts/Chart.tsx
|
|
2133
|
-
var
|
|
2159
|
+
var import_react19 = require("react");
|
|
2134
2160
|
var import_recharts = require("recharts");
|
|
2135
2161
|
|
|
2136
2162
|
// src/components/charts/utils/helpers.ts
|
|
@@ -2277,7 +2303,7 @@ var resolveChartMargins = (margins, chartMargins, showLabels) => {
|
|
|
2277
2303
|
var import_sonner = require("sonner");
|
|
2278
2304
|
|
|
2279
2305
|
// src/components/charts/components/controls/PeriodsDropdown.tsx
|
|
2280
|
-
var
|
|
2306
|
+
var import_react15 = require("react");
|
|
2281
2307
|
var import_framer_motion6 = require("framer-motion");
|
|
2282
2308
|
var import_ssr = require("@phosphor-icons/react/dist/ssr");
|
|
2283
2309
|
var import_ssr2 = require("@phosphor-icons/react/dist/ssr");
|
|
@@ -2300,11 +2326,11 @@ function PeriodsDropdown({
|
|
|
2300
2326
|
activePeriods
|
|
2301
2327
|
}) {
|
|
2302
2328
|
const periods = processedData.map((d) => String(d.name));
|
|
2303
|
-
const [open, setOpen] = (0,
|
|
2304
|
-
const wrapperRef = (0,
|
|
2305
|
-
const firstItemRef = (0,
|
|
2306
|
-
const listRef = (0,
|
|
2307
|
-
(0,
|
|
2329
|
+
const [open, setOpen] = (0, import_react15.useState)(false);
|
|
2330
|
+
const wrapperRef = (0, import_react15.useRef)(null);
|
|
2331
|
+
const firstItemRef = (0, import_react15.useRef)(null);
|
|
2332
|
+
const listRef = (0, import_react15.useRef)(null);
|
|
2333
|
+
(0, import_react15.useEffect)(() => {
|
|
2308
2334
|
const handleClickOutside = (e) => {
|
|
2309
2335
|
if (!wrapperRef.current) return;
|
|
2310
2336
|
if (!wrapperRef.current.contains(e.target)) setOpen(false);
|
|
@@ -2319,7 +2345,7 @@ function PeriodsDropdown({
|
|
|
2319
2345
|
document.removeEventListener("keydown", handleEscape);
|
|
2320
2346
|
};
|
|
2321
2347
|
}, []);
|
|
2322
|
-
(0,
|
|
2348
|
+
(0, import_react15.useEffect)(() => {
|
|
2323
2349
|
if (open && firstItemRef.current) {
|
|
2324
2350
|
firstItemRef.current.focus();
|
|
2325
2351
|
}
|
|
@@ -2412,7 +2438,7 @@ var PeriodsDropdown_default = PeriodsDropdown;
|
|
|
2412
2438
|
|
|
2413
2439
|
// src/components/charts/components/controls/ShowOnly.tsx
|
|
2414
2440
|
var import_framer_motion7 = require("framer-motion");
|
|
2415
|
-
var
|
|
2441
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
2416
2442
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2417
2443
|
var ShowOnly = ({
|
|
2418
2444
|
showOnlyHighlighted,
|
|
@@ -2441,10 +2467,10 @@ var ShowOnly = ({
|
|
|
2441
2467
|
!hasHighlights ? "opacity-60 cursor-not-allowed pointer-events-none" : showOnlyHighlighted ? "bg-primary/10 text-primary shadow-sm border border-primary/20" : "bg-transparent text-muted-foreground border border-transparent hover:bg-muted/10 hover:text-foreground"
|
|
2442
2468
|
),
|
|
2443
2469
|
children: showOnlyHighlighted ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2444
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react16.EyeSlash, { size: 16, weight: "regular" }),
|
|
2445
2471
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: "Exibir todos" })
|
|
2446
2472
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2447
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react16.Eye, { size: 16, weight: "bold" }),
|
|
2448
2474
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: "Mostrar somente destacados" })
|
|
2449
2475
|
] })
|
|
2450
2476
|
}
|
|
@@ -2649,9 +2675,9 @@ var CloseAllButton = ({
|
|
|
2649
2675
|
var CloseAllButton_default = CloseAllButton;
|
|
2650
2676
|
|
|
2651
2677
|
// src/components/charts/components/tooltips/DraggableTooltip.tsx
|
|
2652
|
-
var
|
|
2678
|
+
var import_react17 = __toESM(require("react"));
|
|
2653
2679
|
var import_framer_motion9 = require("framer-motion");
|
|
2654
|
-
var
|
|
2680
|
+
var import_react18 = require("@phosphor-icons/react");
|
|
2655
2681
|
var import_ssr5 = require("@phosphor-icons/react/dist/ssr");
|
|
2656
2682
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2657
2683
|
var ALIGNMENT_THRESHOLD = 25;
|
|
@@ -2730,12 +2756,12 @@ var DraggableTooltipComponent = ({
|
|
|
2730
2756
|
valueFormatter: valueFormatter2,
|
|
2731
2757
|
categoryFormatter
|
|
2732
2758
|
}) => {
|
|
2733
|
-
const visibleKeys = (0,
|
|
2759
|
+
const visibleKeys = (0, import_react17.useMemo)(
|
|
2734
2760
|
() => showOnlyHighlighted && highlightedSeries && highlightedSeries.size > 0 ? dataKeys.filter((k) => highlightedSeries.has(k)) : dataKeys,
|
|
2735
2761
|
[showOnlyHighlighted, highlightedSeries, dataKeys]
|
|
2736
2762
|
);
|
|
2737
|
-
const TotalDisplay =
|
|
2738
|
-
const total = (0,
|
|
2763
|
+
const TotalDisplay = import_react17.default.memo(({ data: data2, visibleKeys: visibleKeys2, valueFormatter: localformatter }) => {
|
|
2764
|
+
const total = (0, import_react17.useMemo)(() => {
|
|
2739
2765
|
const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
|
|
2740
2766
|
return numeric.reduce((s, v) => s + (v || 0), 0);
|
|
2741
2767
|
}, [data2, visibleKeys2]);
|
|
@@ -2757,14 +2783,14 @@ var DraggableTooltipComponent = ({
|
|
|
2757
2783
|
)
|
|
2758
2784
|
] });
|
|
2759
2785
|
});
|
|
2760
|
-
const [localPos, setLocalPos] = (0,
|
|
2761
|
-
const [dragging, setDragging] = (0,
|
|
2762
|
-
const offsetRef = (0,
|
|
2763
|
-
const lastMouse = (0,
|
|
2764
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
2765
|
-
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0,
|
|
2766
|
-
(0,
|
|
2767
|
-
const getAllTooltips = (0,
|
|
2786
|
+
const [localPos, setLocalPos] = (0, import_react17.useState)(position);
|
|
2787
|
+
const [dragging, setDragging] = (0, import_react17.useState)(false);
|
|
2788
|
+
const offsetRef = (0, import_react17.useRef)({ x: 0, y: 0 });
|
|
2789
|
+
const lastMouse = (0, import_react17.useRef)({ x: 0, y: 0 });
|
|
2790
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react17.useState)([]);
|
|
2791
|
+
const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = (0, import_react17.useState)(0);
|
|
2792
|
+
(0, import_react17.useEffect)(() => setLocalPos(position), [position]);
|
|
2793
|
+
const getAllTooltips = (0, import_react17.useCallback)(() => {
|
|
2768
2794
|
const response = [];
|
|
2769
2795
|
const ev = new CustomEvent("requestGlobalTooltips", {
|
|
2770
2796
|
detail: { requesterId: id, response }
|
|
@@ -2772,7 +2798,7 @@ var DraggableTooltipComponent = ({
|
|
|
2772
2798
|
window.dispatchEvent(ev);
|
|
2773
2799
|
return response;
|
|
2774
2800
|
}, [id]);
|
|
2775
|
-
const updateAlignmentGuides = (0,
|
|
2801
|
+
const updateAlignmentGuides = (0, import_react17.useCallback)(
|
|
2776
2802
|
(currentPosition) => {
|
|
2777
2803
|
const allTooltips = getAllTooltips();
|
|
2778
2804
|
const otherTooltips = allTooltips.filter((t) => t.id !== id);
|
|
@@ -2821,7 +2847,7 @@ var DraggableTooltipComponent = ({
|
|
|
2821
2847
|
},
|
|
2822
2848
|
[getAllTooltips, id]
|
|
2823
2849
|
);
|
|
2824
|
-
const snapToGuides = (0,
|
|
2850
|
+
const snapToGuides = (0, import_react17.useCallback)(
|
|
2825
2851
|
(position2) => {
|
|
2826
2852
|
const snappedPosition = { ...position2 };
|
|
2827
2853
|
let hasSnapped = false;
|
|
@@ -2868,7 +2894,7 @@ var DraggableTooltipComponent = ({
|
|
|
2868
2894
|
},
|
|
2869
2895
|
[alignmentGuides]
|
|
2870
2896
|
);
|
|
2871
|
-
(0,
|
|
2897
|
+
(0, import_react17.useEffect)(() => {
|
|
2872
2898
|
let rafId = null;
|
|
2873
2899
|
const handleMouseMove = (e) => {
|
|
2874
2900
|
if (!dragging) return;
|
|
@@ -2910,7 +2936,7 @@ var DraggableTooltipComponent = ({
|
|
|
2910
2936
|
document.body.style.userSelect = "";
|
|
2911
2937
|
};
|
|
2912
2938
|
}, [dragging, snapToGuides, updateAlignmentGuides, id, onPositionChange]);
|
|
2913
|
-
(0,
|
|
2939
|
+
(0, import_react17.useEffect)(() => {
|
|
2914
2940
|
const handleCloseAll = () => onClose(id);
|
|
2915
2941
|
const handleRequestTooltipCount = () => {
|
|
2916
2942
|
window.dispatchEvent(
|
|
@@ -2941,7 +2967,7 @@ var DraggableTooltipComponent = ({
|
|
|
2941
2967
|
});
|
|
2942
2968
|
};
|
|
2943
2969
|
}, [id, localPos, onClose]);
|
|
2944
|
-
(0,
|
|
2970
|
+
(0, import_react17.useEffect)(() => {
|
|
2945
2971
|
if (dragging) return;
|
|
2946
2972
|
let total = 0;
|
|
2947
2973
|
const timeoutId = setTimeout(() => {
|
|
@@ -2959,7 +2985,7 @@ var DraggableTooltipComponent = ({
|
|
|
2959
2985
|
}, 0);
|
|
2960
2986
|
return () => clearTimeout(timeoutId);
|
|
2961
2987
|
}, [localPos, dragging]);
|
|
2962
|
-
(0,
|
|
2988
|
+
(0, import_react17.useEffect)(() => {
|
|
2963
2989
|
const recount = () => {
|
|
2964
2990
|
if (dragging) return;
|
|
2965
2991
|
let total = 0;
|
|
@@ -2977,7 +3003,7 @@ var DraggableTooltipComponent = ({
|
|
|
2977
3003
|
window.addEventListener("recountTooltips", recount);
|
|
2978
3004
|
return () => window.removeEventListener("recountTooltips", recount);
|
|
2979
3005
|
}, [dragging]);
|
|
2980
|
-
const handleMouseDownLocal = (0,
|
|
3006
|
+
const handleMouseDownLocal = (0, import_react17.useCallback)(
|
|
2981
3007
|
(e) => {
|
|
2982
3008
|
e.preventDefault();
|
|
2983
3009
|
e.stopPropagation();
|
|
@@ -2988,7 +3014,7 @@ var DraggableTooltipComponent = ({
|
|
|
2988
3014
|
},
|
|
2989
3015
|
[id, onMouseDown]
|
|
2990
3016
|
);
|
|
2991
|
-
const handleTouchStartLocal = (0,
|
|
3017
|
+
const handleTouchStartLocal = (0, import_react17.useCallback)(
|
|
2992
3018
|
(e) => {
|
|
2993
3019
|
e.stopPropagation();
|
|
2994
3020
|
const touch = e.touches[0];
|
|
@@ -3003,7 +3029,7 @@ var DraggableTooltipComponent = ({
|
|
|
3003
3029
|
},
|
|
3004
3030
|
[id, onMouseDown]
|
|
3005
3031
|
);
|
|
3006
|
-
const handleCloseClick = (0,
|
|
3032
|
+
const handleCloseClick = (0, import_react17.useCallback)(
|
|
3007
3033
|
(e) => {
|
|
3008
3034
|
e.stopPropagation();
|
|
3009
3035
|
onClose(id);
|
|
@@ -3119,7 +3145,7 @@ var DraggableTooltipComponent = ({
|
|
|
3119
3145
|
onTouchStart: handleTouchStartLocal,
|
|
3120
3146
|
style: { touchAction: "none" },
|
|
3121
3147
|
children: [
|
|
3122
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react18.DotsSixVerticalIcon, { size: 16 }),
|
|
3123
3149
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col gap-1", children: title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex items-center gap-2 pb-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "font-bold text-foreground text-base", children: title }) }) }),
|
|
3124
3150
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3125
3151
|
"button",
|
|
@@ -3149,7 +3175,7 @@ var DraggableTooltipComponent = ({
|
|
|
3149
3175
|
] }) }),
|
|
3150
3176
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "p-3 pt-2 space-y-2", children: [
|
|
3151
3177
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
|
|
3152
|
-
(0,
|
|
3178
|
+
(0, import_react17.useMemo)(
|
|
3153
3179
|
() => visibleKeys.map((key) => {
|
|
3154
3180
|
const value = data[key];
|
|
3155
3181
|
if (value === void 0) return null;
|
|
@@ -3267,7 +3293,7 @@ var DraggableTooltipComponent = ({
|
|
|
3267
3293
|
)
|
|
3268
3294
|
] });
|
|
3269
3295
|
};
|
|
3270
|
-
var DraggableTooltip =
|
|
3296
|
+
var DraggableTooltip = import_react17.default.memo(DraggableTooltipComponent);
|
|
3271
3297
|
DraggableTooltip.displayName = "DraggableTooltip";
|
|
3272
3298
|
var DraggableTooltip_default = DraggableTooltip;
|
|
3273
3299
|
|
|
@@ -3641,7 +3667,7 @@ var Chart = ({
|
|
|
3641
3667
|
formatBR = false,
|
|
3642
3668
|
chartMargin
|
|
3643
3669
|
}) => {
|
|
3644
|
-
const smartConfig = (0,
|
|
3670
|
+
const smartConfig = (0, import_react19.useMemo)(() => {
|
|
3645
3671
|
const resolvedXAxisKey = typeof xAxis === "string" ? xAxis : xAxis && xAxis.dataKey || detectXAxis(data);
|
|
3646
3672
|
const xAxisConfig2 = typeof xAxis === "string" ? {
|
|
3647
3673
|
dataKey: resolvedXAxisKey,
|
|
@@ -3665,12 +3691,12 @@ var Chart = ({
|
|
|
3665
3691
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
3666
3692
|
}, [data, xAxis, labelMap]);
|
|
3667
3693
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
3668
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
3669
|
-
const [highlightedSeries, setHighlightedSeries] = (0,
|
|
3694
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react19.useState)([]);
|
|
3695
|
+
const [highlightedSeries, setHighlightedSeries] = (0, import_react19.useState)(
|
|
3670
3696
|
/* @__PURE__ */ new Set()
|
|
3671
3697
|
);
|
|
3672
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0,
|
|
3673
|
-
(0,
|
|
3698
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0, import_react19.useState)(false);
|
|
3699
|
+
(0, import_react19.useEffect)(() => {
|
|
3674
3700
|
if (highlightedSeries.size === 0 && showOnlyHighlighted) {
|
|
3675
3701
|
setShowOnlyHighlighted(false);
|
|
3676
3702
|
}
|
|
@@ -3679,9 +3705,9 @@ var Chart = ({
|
|
|
3679
3705
|
...item,
|
|
3680
3706
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
3681
3707
|
}));
|
|
3682
|
-
const wrapperRef = (0,
|
|
3683
|
-
const [measuredWidth, setMeasuredWidth] = (0,
|
|
3684
|
-
(0,
|
|
3708
|
+
const wrapperRef = (0, import_react19.useRef)(null);
|
|
3709
|
+
const [measuredWidth, setMeasuredWidth] = (0, import_react19.useState)(null);
|
|
3710
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
3685
3711
|
const el = wrapperRef.current;
|
|
3686
3712
|
if (!el) return;
|
|
3687
3713
|
const ro = new ResizeObserver((entries) => {
|
|
@@ -3708,7 +3734,7 @@ var Chart = ({
|
|
|
3708
3734
|
);
|
|
3709
3735
|
}
|
|
3710
3736
|
const allKeys = seriesOrder.map((s) => s.key).filter(Boolean);
|
|
3711
|
-
const generateColors = (0,
|
|
3737
|
+
const generateColors = (0, import_react19.useCallback)(
|
|
3712
3738
|
(dataKeys) => {
|
|
3713
3739
|
const colorMap = {};
|
|
3714
3740
|
const allColors = generateAdditionalColors(colors2, dataKeys.length);
|
|
@@ -3719,25 +3745,25 @@ var Chart = ({
|
|
|
3719
3745
|
},
|
|
3720
3746
|
[colors2, mapperConfig]
|
|
3721
3747
|
);
|
|
3722
|
-
const finalColors = (0,
|
|
3748
|
+
const finalColors = (0, import_react19.useMemo)(
|
|
3723
3749
|
() => generateColors(allKeys),
|
|
3724
3750
|
[generateColors, allKeys]
|
|
3725
3751
|
);
|
|
3726
|
-
const adaptDataForTooltip = (0,
|
|
3752
|
+
const adaptDataForTooltip = (0, import_react19.useCallback)(
|
|
3727
3753
|
(universalData) => ({
|
|
3728
3754
|
...universalData,
|
|
3729
3755
|
name: String(universalData[xAxisConfig.dataKey] || "N/A")
|
|
3730
3756
|
}),
|
|
3731
3757
|
[xAxisConfig.dataKey]
|
|
3732
3758
|
);
|
|
3733
|
-
const activePeriods = (0,
|
|
3759
|
+
const activePeriods = (0, import_react19.useMemo)(
|
|
3734
3760
|
() => activeTooltips.map((t) => adaptDataForTooltip(t.data).name),
|
|
3735
3761
|
[activeTooltips, adaptDataForTooltip]
|
|
3736
3762
|
);
|
|
3737
|
-
(0,
|
|
3763
|
+
(0, import_react19.useEffect)(() => {
|
|
3738
3764
|
window.dispatchEvent(new Event("recountTooltips"));
|
|
3739
3765
|
}, [activeTooltips.length]);
|
|
3740
|
-
const toggleHighlight = (0,
|
|
3766
|
+
const toggleHighlight = (0, import_react19.useCallback)((key) => {
|
|
3741
3767
|
setHighlightedSeries((prev) => {
|
|
3742
3768
|
const next = new Set(prev);
|
|
3743
3769
|
if (next.has(key)) next.delete(key);
|
|
@@ -3745,7 +3771,7 @@ var Chart = ({
|
|
|
3745
3771
|
return next;
|
|
3746
3772
|
});
|
|
3747
3773
|
}, []);
|
|
3748
|
-
const maxDataValue = (0,
|
|
3774
|
+
const maxDataValue = (0, import_react19.useMemo)(() => {
|
|
3749
3775
|
let max = 0;
|
|
3750
3776
|
const numericKeys = allKeys;
|
|
3751
3777
|
for (const row of processedData) {
|
|
@@ -3757,7 +3783,7 @@ var Chart = ({
|
|
|
3757
3783
|
}
|
|
3758
3784
|
return max;
|
|
3759
3785
|
}, [processedData, allKeys]);
|
|
3760
|
-
const minDataValue = (0,
|
|
3786
|
+
const minDataValue = (0, import_react19.useMemo)(() => {
|
|
3761
3787
|
let min = 0;
|
|
3762
3788
|
const numericKeys = allKeys;
|
|
3763
3789
|
for (const row of processedData) {
|
|
@@ -3770,7 +3796,7 @@ var Chart = ({
|
|
|
3770
3796
|
}
|
|
3771
3797
|
return min;
|
|
3772
3798
|
}, [processedData, allKeys]);
|
|
3773
|
-
const niceMax = (0,
|
|
3799
|
+
const niceMax = (0, import_react19.useMemo)(() => {
|
|
3774
3800
|
let padding = 0.08;
|
|
3775
3801
|
if (maxDataValue > 1e6) padding = 0.05;
|
|
3776
3802
|
if (maxDataValue > 1e7) padding = 0.03;
|
|
@@ -3778,7 +3804,7 @@ var Chart = ({
|
|
|
3778
3804
|
const padded = maxDataValue * (1 + padding);
|
|
3779
3805
|
return niceCeil(padded);
|
|
3780
3806
|
}, [maxDataValue]);
|
|
3781
|
-
const computedWidth = (0,
|
|
3807
|
+
const computedWidth = (0, import_react19.useMemo)(() => {
|
|
3782
3808
|
if (typeof width === "number") return width;
|
|
3783
3809
|
const points = Math.max(1, processedData.length);
|
|
3784
3810
|
const barCount = series?.bar?.length ?? 0;
|
|
@@ -3807,7 +3833,7 @@ var Chart = ({
|
|
|
3807
3833
|
series?.area?.length,
|
|
3808
3834
|
niceMax
|
|
3809
3835
|
]);
|
|
3810
|
-
const toggleTooltip = (0,
|
|
3836
|
+
const toggleTooltip = (0, import_react19.useCallback)(
|
|
3811
3837
|
(tooltipId, data2, basePosition) => {
|
|
3812
3838
|
const existingIndex = activeTooltips.findIndex((t) => t.id === tooltipId);
|
|
3813
3839
|
if (existingIndex !== -1) {
|
|
@@ -3836,7 +3862,7 @@ var Chart = ({
|
|
|
3836
3862
|
},
|
|
3837
3863
|
[activeTooltips, maxTooltips]
|
|
3838
3864
|
);
|
|
3839
|
-
const handleChartClick = (0,
|
|
3865
|
+
const handleChartClick = (0, import_react19.useCallback)(
|
|
3840
3866
|
(e) => {
|
|
3841
3867
|
if (!enableDraggableTooltips) return;
|
|
3842
3868
|
const ev = e;
|
|
@@ -3854,7 +3880,7 @@ var Chart = ({
|
|
|
3854
3880
|
},
|
|
3855
3881
|
[enableDraggableTooltips, xAxisConfig.dataKey, toggleTooltip]
|
|
3856
3882
|
);
|
|
3857
|
-
const handleBarClick = (0,
|
|
3883
|
+
const handleBarClick = (0, import_react19.useCallback)(
|
|
3858
3884
|
(data2, index, event) => {
|
|
3859
3885
|
if (!enableDraggableTooltips) return;
|
|
3860
3886
|
event.stopPropagation();
|
|
@@ -3868,7 +3894,7 @@ var Chart = ({
|
|
|
3868
3894
|
},
|
|
3869
3895
|
[enableDraggableTooltips, xAxisConfig.dataKey, toggleTooltip]
|
|
3870
3896
|
);
|
|
3871
|
-
const handleSeriesClick = (0,
|
|
3897
|
+
const handleSeriesClick = (0, import_react19.useCallback)(
|
|
3872
3898
|
(...args) => {
|
|
3873
3899
|
if (args.length >= 3) {
|
|
3874
3900
|
const [data2, index, event] = args;
|
|
@@ -3879,7 +3905,7 @@ var Chart = ({
|
|
|
3879
3905
|
},
|
|
3880
3906
|
[handleBarClick, handleChartClick]
|
|
3881
3907
|
);
|
|
3882
|
-
const onTooltipPositionChange = (0,
|
|
3908
|
+
const onTooltipPositionChange = (0, import_react19.useCallback)(
|
|
3883
3909
|
(id, position) => {
|
|
3884
3910
|
setActiveTooltips(
|
|
3885
3911
|
(prev) => prev.map((t) => t.id === id ? { ...t, position } : t)
|
|
@@ -3887,11 +3913,11 @@ var Chart = ({
|
|
|
3887
3913
|
},
|
|
3888
3914
|
[]
|
|
3889
3915
|
);
|
|
3890
|
-
const titleClassName = (0,
|
|
3916
|
+
const titleClassName = (0, import_react19.useMemo)(
|
|
3891
3917
|
() => "text-xl font-semibold text-foreground mb-3",
|
|
3892
3918
|
[]
|
|
3893
3919
|
);
|
|
3894
|
-
const finalValueFormatter = (0,
|
|
3920
|
+
const finalValueFormatter = (0, import_react19.useMemo)(() => {
|
|
3895
3921
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
3896
3922
|
minimumFractionDigits: 2,
|
|
3897
3923
|
maximumFractionDigits: 2
|
|
@@ -3931,7 +3957,7 @@ var Chart = ({
|
|
|
3931
3957
|
};
|
|
3932
3958
|
return builtIn;
|
|
3933
3959
|
}, [valueFormatter2, formatBR]);
|
|
3934
|
-
const yTickFormatter = (0,
|
|
3960
|
+
const yTickFormatter = (0, import_react19.useMemo)(() => {
|
|
3935
3961
|
const nf = new Intl.NumberFormat("pt-BR", {
|
|
3936
3962
|
minimumFractionDigits: 2,
|
|
3937
3963
|
maximumFractionDigits: 2
|
|
@@ -3969,7 +3995,7 @@ var Chart = ({
|
|
|
3969
3995
|
const measuredInner = measuredWidth ? Math.max(0, measuredWidth - 32) : void 0;
|
|
3970
3996
|
const effectiveChartWidth = typeof width === "number" ? width : measuredInner ?? computedWidth;
|
|
3971
3997
|
const chartInnerWidth = effectiveChartWidth - finalChartLeftMargin - finalChartRightMargin;
|
|
3972
|
-
const openTooltipForPeriod = (0,
|
|
3998
|
+
const openTooltipForPeriod = (0, import_react19.useCallback)(
|
|
3973
3999
|
(periodName) => {
|
|
3974
4000
|
if (!enableDraggableTooltips) return;
|
|
3975
4001
|
const row = processedData.find((r) => String(r.name) === periodName);
|
|
@@ -4199,9 +4225,7 @@ var Chart = ({
|
|
|
4199
4225
|
label: yAxisLabel ? {
|
|
4200
4226
|
value: yAxisLabel,
|
|
4201
4227
|
angle: -90,
|
|
4202
|
-
|
|
4203
|
-
// to avoid overlapping the Y values / bars.
|
|
4204
|
-
position: "left",
|
|
4228
|
+
position: "leftTop",
|
|
4205
4229
|
style: {
|
|
4206
4230
|
fontSize: 12,
|
|
4207
4231
|
fill: "hsl(var(--muted-foreground))",
|
|
@@ -4410,7 +4434,7 @@ var Chart = ({
|
|
|
4410
4434
|
var Chart_default = Chart;
|
|
4411
4435
|
|
|
4412
4436
|
// src/components/charts/BarChart.tsx
|
|
4413
|
-
var
|
|
4437
|
+
var import_react20 = require("react");
|
|
4414
4438
|
var import_recharts2 = require("recharts");
|
|
4415
4439
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4416
4440
|
var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
|
|
@@ -4442,7 +4466,7 @@ var BarChart = ({
|
|
|
4442
4466
|
containerPaddingLeft,
|
|
4443
4467
|
16
|
|
4444
4468
|
);
|
|
4445
|
-
const smartConfig = (0,
|
|
4469
|
+
const smartConfig = (0, import_react20.useMemo)(() => {
|
|
4446
4470
|
const providedMapper = yAxis ?? mapper;
|
|
4447
4471
|
if (autoDetect === true || xAxis == null || providedMapper == null) {
|
|
4448
4472
|
const detectedXAxis = detectXAxis(data);
|
|
@@ -4492,14 +4516,14 @@ var BarChart = ({
|
|
|
4492
4516
|
return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
|
|
4493
4517
|
}, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
|
|
4494
4518
|
const { xAxisConfig, mapperConfig } = smartConfig;
|
|
4495
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
4496
|
-
const [isDragging, setIsDragging] = (0,
|
|
4497
|
-
const [dragOffset, setDragOffset] = (0,
|
|
4519
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react20.useState)([]);
|
|
4520
|
+
const [isDragging, setIsDragging] = (0, import_react20.useState)(null);
|
|
4521
|
+
const [dragOffset, setDragOffset] = (0, import_react20.useState)({
|
|
4498
4522
|
x: 0,
|
|
4499
4523
|
y: 0
|
|
4500
4524
|
});
|
|
4501
|
-
const [globalTooltipCount, setGlobalTooltipCount] = (0,
|
|
4502
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
4525
|
+
const [globalTooltipCount, setGlobalTooltipCount] = (0, import_react20.useState)(0);
|
|
4526
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react20.useState)([]);
|
|
4503
4527
|
const processedData = data.map((item) => ({
|
|
4504
4528
|
...item,
|
|
4505
4529
|
name: String(item[xAxisConfig.dataKey] || "N/A")
|
|
@@ -4522,7 +4546,7 @@ var BarChart = ({
|
|
|
4522
4546
|
// Garantir que tem a propriedade 'name'
|
|
4523
4547
|
};
|
|
4524
4548
|
};
|
|
4525
|
-
const maxDataValue = (0,
|
|
4549
|
+
const maxDataValue = (0, import_react20.useMemo)(() => {
|
|
4526
4550
|
let max = 0;
|
|
4527
4551
|
const keys = Object.keys(mapperConfig);
|
|
4528
4552
|
for (const row of processedData) {
|
|
@@ -4535,7 +4559,7 @@ var BarChart = ({
|
|
|
4535
4559
|
}
|
|
4536
4560
|
return max;
|
|
4537
4561
|
}, [processedData, mapperConfig]);
|
|
4538
|
-
const niceMax = (0,
|
|
4562
|
+
const niceMax = (0, import_react20.useMemo)(() => {
|
|
4539
4563
|
let padding2 = 0.08;
|
|
4540
4564
|
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
4541
4565
|
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
@@ -4576,7 +4600,7 @@ var BarChart = ({
|
|
|
4576
4600
|
const GUIDE_THRESHOLD2 = 60;
|
|
4577
4601
|
const STRONG_SNAP_THRESHOLD2 = 35;
|
|
4578
4602
|
const PRECISION_SNAP_THRESHOLD2 = 8;
|
|
4579
|
-
const updateAlignmentGuides = (0,
|
|
4603
|
+
const updateAlignmentGuides = (0, import_react20.useCallback)(
|
|
4580
4604
|
(draggedTooltipId, currentPosition) => {
|
|
4581
4605
|
if (!isDragging) return;
|
|
4582
4606
|
const getAllTooltips = () => {
|
|
@@ -4640,7 +4664,7 @@ var BarChart = ({
|
|
|
4640
4664
|
},
|
|
4641
4665
|
[isDragging, activeTooltips]
|
|
4642
4666
|
);
|
|
4643
|
-
const snapToGuides = (0,
|
|
4667
|
+
const snapToGuides = (0, import_react20.useCallback)(
|
|
4644
4668
|
(position) => {
|
|
4645
4669
|
const snappedPosition = { ...position };
|
|
4646
4670
|
let hasSnapped = false;
|
|
@@ -4702,7 +4726,7 @@ var BarChart = ({
|
|
|
4702
4726
|
setIsDragging(tooltipId);
|
|
4703
4727
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
4704
4728
|
};
|
|
4705
|
-
(0,
|
|
4729
|
+
(0, import_react20.useEffect)(() => {
|
|
4706
4730
|
let rafId;
|
|
4707
4731
|
let lastMousePosition = { x: 0, y: 0 };
|
|
4708
4732
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -4760,7 +4784,7 @@ var BarChart = ({
|
|
|
4760
4784
|
updateAlignmentGuides,
|
|
4761
4785
|
snapToGuides
|
|
4762
4786
|
]);
|
|
4763
|
-
(0,
|
|
4787
|
+
(0, import_react20.useEffect)(() => {
|
|
4764
4788
|
const handleCloseAllTooltips = () => {
|
|
4765
4789
|
setActiveTooltips([]);
|
|
4766
4790
|
setGlobalTooltipCount(0);
|
|
@@ -4770,7 +4794,7 @@ var BarChart = ({
|
|
|
4770
4794
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
|
|
4771
4795
|
};
|
|
4772
4796
|
}, []);
|
|
4773
|
-
(0,
|
|
4797
|
+
(0, import_react20.useEffect)(() => {
|
|
4774
4798
|
const handleTooltipCountRequest = () => {
|
|
4775
4799
|
window.dispatchEvent(
|
|
4776
4800
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -4809,7 +4833,7 @@ var BarChart = ({
|
|
|
4809
4833
|
);
|
|
4810
4834
|
};
|
|
4811
4835
|
}, [activeTooltips]);
|
|
4812
|
-
(0,
|
|
4836
|
+
(0, import_react20.useEffect)(() => {
|
|
4813
4837
|
if (isDragging) return;
|
|
4814
4838
|
let totalCount = 0;
|
|
4815
4839
|
const handleCountResponse = (event) => {
|
|
@@ -5075,7 +5099,7 @@ var BarChart = ({
|
|
|
5075
5099
|
var BarChart_default = BarChart;
|
|
5076
5100
|
|
|
5077
5101
|
// src/components/charts/LineChart.tsx
|
|
5078
|
-
var
|
|
5102
|
+
var import_react21 = require("react");
|
|
5079
5103
|
var import_recharts3 = require("recharts");
|
|
5080
5104
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5081
5105
|
var defaultData = [
|
|
@@ -5109,14 +5133,14 @@ var CustomLineChart = ({
|
|
|
5109
5133
|
containerPaddingLeft,
|
|
5110
5134
|
16
|
|
5111
5135
|
);
|
|
5112
|
-
const [activeTooltips, setActiveTooltips] = (0,
|
|
5113
|
-
const [isDragging, setIsDragging] = (0,
|
|
5114
|
-
const [dragOffset, setDragOffset] = (0,
|
|
5136
|
+
const [activeTooltips, setActiveTooltips] = (0, import_react21.useState)([]);
|
|
5137
|
+
const [isDragging, setIsDragging] = (0, import_react21.useState)(null);
|
|
5138
|
+
const [dragOffset, setDragOffset] = (0, import_react21.useState)({
|
|
5115
5139
|
x: 0,
|
|
5116
5140
|
y: 0
|
|
5117
5141
|
});
|
|
5118
|
-
const [globalTooltipCount, setGlobalTooltipCount] = (0,
|
|
5119
|
-
const [alignmentGuides, setAlignmentGuides] = (0,
|
|
5142
|
+
const [globalTooltipCount, setGlobalTooltipCount] = (0, import_react21.useState)(0);
|
|
5143
|
+
const [alignmentGuides, setAlignmentGuides] = (0, import_react21.useState)([]);
|
|
5120
5144
|
const generateColors = (dataKeys2) => {
|
|
5121
5145
|
const colorMap = {};
|
|
5122
5146
|
const allColors = generateAdditionalColors(colors2, dataKeys2.length);
|
|
@@ -5125,12 +5149,12 @@ var CustomLineChart = ({
|
|
|
5125
5149
|
});
|
|
5126
5150
|
return colorMap;
|
|
5127
5151
|
};
|
|
5128
|
-
const dataKeys = (0,
|
|
5152
|
+
const dataKeys = (0, import_react21.useMemo)(
|
|
5129
5153
|
() => data.length > 0 ? Object.keys(data[0]).filter((key) => key !== "name") : [],
|
|
5130
5154
|
[data]
|
|
5131
5155
|
);
|
|
5132
5156
|
const finalColors = generateColors(dataKeys);
|
|
5133
|
-
const maxDataValue = (0,
|
|
5157
|
+
const maxDataValue = (0, import_react21.useMemo)(() => {
|
|
5134
5158
|
let max = 0;
|
|
5135
5159
|
for (const row of data) {
|
|
5136
5160
|
const r = row;
|
|
@@ -5142,7 +5166,7 @@ var CustomLineChart = ({
|
|
|
5142
5166
|
}
|
|
5143
5167
|
return max;
|
|
5144
5168
|
}, [data, dataKeys]);
|
|
5145
|
-
const niceMax = (0,
|
|
5169
|
+
const niceMax = (0, import_react21.useMemo)(() => {
|
|
5146
5170
|
let padding2 = 0.08;
|
|
5147
5171
|
if (maxDataValue > 1e6) padding2 = 0.05;
|
|
5148
5172
|
if (maxDataValue > 1e7) padding2 = 0.03;
|
|
@@ -5218,10 +5242,10 @@ var CustomLineChart = ({
|
|
|
5218
5242
|
const handleChartBackgroundClick = () => {
|
|
5219
5243
|
setActiveTooltips([]);
|
|
5220
5244
|
};
|
|
5221
|
-
const handleCloseAllTooltips = (0,
|
|
5245
|
+
const handleCloseAllTooltips = (0, import_react21.useCallback)(() => {
|
|
5222
5246
|
window.dispatchEvent(new CustomEvent("closeAllTooltips"));
|
|
5223
5247
|
}, []);
|
|
5224
|
-
const updateAlignmentGuides = (0,
|
|
5248
|
+
const updateAlignmentGuides = (0, import_react21.useCallback)(
|
|
5225
5249
|
(draggedTooltipId, draggedPosition) => {
|
|
5226
5250
|
const SNAP_THRESHOLD = 15;
|
|
5227
5251
|
const draggedTooltip = activeTooltips.find(
|
|
@@ -5302,7 +5326,7 @@ var CustomLineChart = ({
|
|
|
5302
5326
|
},
|
|
5303
5327
|
[activeTooltips]
|
|
5304
5328
|
);
|
|
5305
|
-
const snapToGuides = (0,
|
|
5329
|
+
const snapToGuides = (0, import_react21.useCallback)(
|
|
5306
5330
|
(position) => {
|
|
5307
5331
|
const SNAP_DISTANCE = 10;
|
|
5308
5332
|
const snappedPosition = { ...position };
|
|
@@ -5330,7 +5354,7 @@ var CustomLineChart = ({
|
|
|
5330
5354
|
setIsDragging(tooltipId);
|
|
5331
5355
|
setDragOffset({ x: offsetX, y: offsetY });
|
|
5332
5356
|
};
|
|
5333
|
-
(0,
|
|
5357
|
+
(0, import_react21.useEffect)(() => {
|
|
5334
5358
|
let rafId;
|
|
5335
5359
|
let lastMousePosition = { x: 0, y: 0 };
|
|
5336
5360
|
const handleGlobalMouseMove = (e) => {
|
|
@@ -5377,7 +5401,7 @@ var CustomLineChart = ({
|
|
|
5377
5401
|
updateAlignmentGuides,
|
|
5378
5402
|
snapToGuides
|
|
5379
5403
|
]);
|
|
5380
|
-
(0,
|
|
5404
|
+
(0, import_react21.useEffect)(() => {
|
|
5381
5405
|
const handleCloseAllTooltips2 = () => {
|
|
5382
5406
|
setActiveTooltips([]);
|
|
5383
5407
|
setGlobalTooltipCount(0);
|
|
@@ -5387,7 +5411,7 @@ var CustomLineChart = ({
|
|
|
5387
5411
|
window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
|
|
5388
5412
|
};
|
|
5389
5413
|
}, []);
|
|
5390
|
-
(0,
|
|
5414
|
+
(0, import_react21.useEffect)(() => {
|
|
5391
5415
|
const handleTooltipCountRequest = () => {
|
|
5392
5416
|
window.dispatchEvent(
|
|
5393
5417
|
new CustomEvent("tooltipCountResponse", {
|
|
@@ -5431,7 +5455,7 @@ var CustomLineChart = ({
|
|
|
5431
5455
|
);
|
|
5432
5456
|
};
|
|
5433
5457
|
}, [activeTooltips]);
|
|
5434
|
-
(0,
|
|
5458
|
+
(0, import_react21.useEffect)(() => {
|
|
5435
5459
|
if (isDragging) return;
|
|
5436
5460
|
let totalCount = 0;
|
|
5437
5461
|
const handleCountResponse = (event) => {
|
|
@@ -5753,13 +5777,13 @@ var CustomPieChart = ({
|
|
|
5753
5777
|
var PieChart_default = CustomPieChart;
|
|
5754
5778
|
|
|
5755
5779
|
// src/components/charts/hooks/useChartHighlights.tsx
|
|
5756
|
-
var
|
|
5780
|
+
var import_react22 = require("react");
|
|
5757
5781
|
var useChartHighlights = () => {
|
|
5758
|
-
const [highlightedSeries, setHighlightedSeries] = (0,
|
|
5782
|
+
const [highlightedSeries, setHighlightedSeries] = (0, import_react22.useState)(
|
|
5759
5783
|
/* @__PURE__ */ new Set()
|
|
5760
5784
|
);
|
|
5761
|
-
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0,
|
|
5762
|
-
const toggleHighlight = (0,
|
|
5785
|
+
const [showOnlyHighlighted, setShowOnlyHighlighted] = (0, import_react22.useState)(false);
|
|
5786
|
+
const toggleHighlight = (0, import_react22.useCallback)((key) => {
|
|
5763
5787
|
setHighlightedSeries((prev) => {
|
|
5764
5788
|
const next = new Set(prev);
|
|
5765
5789
|
if (next.has(key)) {
|
|
@@ -5770,17 +5794,17 @@ var useChartHighlights = () => {
|
|
|
5770
5794
|
return next;
|
|
5771
5795
|
});
|
|
5772
5796
|
}, []);
|
|
5773
|
-
const clearHighlights = (0,
|
|
5797
|
+
const clearHighlights = (0, import_react22.useCallback)(() => {
|
|
5774
5798
|
setHighlightedSeries(/* @__PURE__ */ new Set());
|
|
5775
5799
|
setShowOnlyHighlighted(false);
|
|
5776
5800
|
}, []);
|
|
5777
|
-
const isHighlighted = (0,
|
|
5801
|
+
const isHighlighted = (0, import_react22.useCallback)(
|
|
5778
5802
|
(key) => {
|
|
5779
5803
|
return highlightedSeries.has(key);
|
|
5780
5804
|
},
|
|
5781
5805
|
[highlightedSeries]
|
|
5782
5806
|
);
|
|
5783
|
-
const getSeriesStyle = (0,
|
|
5807
|
+
const getSeriesStyle = (0, import_react22.useCallback)(
|
|
5784
5808
|
(key) => {
|
|
5785
5809
|
const hasHighlights = highlightedSeries.size > 0;
|
|
5786
5810
|
const isSeriesHighlighted = highlightedSeries.has(key);
|
|
@@ -6070,7 +6094,7 @@ function BadgeBase({
|
|
|
6070
6094
|
}
|
|
6071
6095
|
|
|
6072
6096
|
// src/components/ui/data/CalendarBase.tsx
|
|
6073
|
-
var
|
|
6097
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
6074
6098
|
var import_react_day_picker = require("react-day-picker");
|
|
6075
6099
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6076
6100
|
function CalendarBase({
|
|
@@ -6115,8 +6139,8 @@ function CalendarBase({
|
|
|
6115
6139
|
...classNames
|
|
6116
6140
|
},
|
|
6117
6141
|
components: {
|
|
6118
|
-
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6119
|
-
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6142
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react23.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
6143
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react23.CaretRightIcon, { className: "h-4 w-4" })
|
|
6120
6144
|
},
|
|
6121
6145
|
...props
|
|
6122
6146
|
}
|
|
@@ -6194,7 +6218,7 @@ CardFooterBase.displayName = "CardFooter";
|
|
|
6194
6218
|
// src/components/ui/data/FileUploader.tsx
|
|
6195
6219
|
var React18 = __toESM(require("react"));
|
|
6196
6220
|
var import_framer_motion10 = require("framer-motion");
|
|
6197
|
-
var
|
|
6221
|
+
var import_react24 = require("@phosphor-icons/react");
|
|
6198
6222
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6199
6223
|
var formatFileSize = (bytes) => {
|
|
6200
6224
|
if (bytes === 0) return "0 Bytes";
|
|
@@ -6210,38 +6234,38 @@ var getFileTypeIcon = (file) => {
|
|
|
6210
6234
|
const extension = getFileExtension(file.name).toLowerCase();
|
|
6211
6235
|
const mimeType = file.type.toLowerCase();
|
|
6212
6236
|
if (extension === "pdf" || mimeType === "application/pdf") {
|
|
6213
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
6214
6238
|
}
|
|
6215
6239
|
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
6216
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
6217
6241
|
}
|
|
6218
6242
|
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
6219
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
6220
6244
|
}
|
|
6221
6245
|
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
6222
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
6223
6247
|
}
|
|
6224
6248
|
if (extension === "csv" || mimeType === "text/csv") {
|
|
6225
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
6226
6250
|
}
|
|
6227
6251
|
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
6228
6252
|
extension
|
|
6229
6253
|
) || mimeType.includes("text")) {
|
|
6230
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
6231
6255
|
}
|
|
6232
6256
|
if (mimeType.startsWith("image/")) {
|
|
6233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
6234
6258
|
}
|
|
6235
6259
|
if (mimeType.startsWith("video/")) {
|
|
6236
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
6237
6261
|
}
|
|
6238
6262
|
if (mimeType.startsWith("audio/")) {
|
|
6239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
6240
6264
|
}
|
|
6241
6265
|
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
6242
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
6243
6267
|
}
|
|
6244
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
6245
6269
|
};
|
|
6246
6270
|
var createImagePreview = (file) => {
|
|
6247
6271
|
return new Promise((resolve) => {
|
|
@@ -6471,7 +6495,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6471
6495
|
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
6472
6496
|
},
|
|
6473
6497
|
transition: { duration: 0.3 },
|
|
6474
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.CloudArrowUpIcon, { size: 64 })
|
|
6475
6499
|
}
|
|
6476
6500
|
)
|
|
6477
6501
|
}
|
|
@@ -6513,7 +6537,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6513
6537
|
),
|
|
6514
6538
|
transition: { duration: 0.3 },
|
|
6515
6539
|
children: [
|
|
6516
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6540
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.CheckIcon, { size: 16, className: "text-emerald-500" }) }),
|
|
6517
6541
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
6518
6542
|
import_framer_motion10.motion.span,
|
|
6519
6543
|
{
|
|
@@ -6615,7 +6639,7 @@ var FileUploader = React18.forwardRef(
|
|
|
6615
6639
|
handleRemoveFile(file.id);
|
|
6616
6640
|
},
|
|
6617
6641
|
className: "",
|
|
6618
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6642
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react24.XIcon, { size: 12 })
|
|
6619
6643
|
}
|
|
6620
6644
|
)
|
|
6621
6645
|
]
|
|
@@ -6739,7 +6763,7 @@ AlertDialogCancelBase.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
|
6739
6763
|
|
|
6740
6764
|
// src/components/ui/feedback/DestructiveDialog.tsx
|
|
6741
6765
|
var React20 = __toESM(require("react"));
|
|
6742
|
-
var
|
|
6766
|
+
var import_react25 = require("@phosphor-icons/react");
|
|
6743
6767
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6744
6768
|
var DestructiveDialog = ({
|
|
6745
6769
|
title,
|
|
@@ -6758,7 +6782,7 @@ var DestructiveDialog = ({
|
|
|
6758
6782
|
className: cn("border border-destructive bg-background"),
|
|
6759
6783
|
children: [
|
|
6760
6784
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex items-start gap-4", children: [
|
|
6761
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6785
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react25.XCircleIcon, { className: "w-6 h-6 text-destructive" }) }),
|
|
6762
6786
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex-1", children: [
|
|
6763
6787
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogTitleBase, { className: "text-lg sm:text-xl font-semibold text-destructive", children: title }),
|
|
6764
6788
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AlertDialogDescriptionBase, { className: "mt-2 text-sm text-muted-foreground", children: description })
|
|
@@ -6967,7 +6991,7 @@ LoadingBase.displayName = "LoadingBase";
|
|
|
6967
6991
|
// src/components/ui/feedback/ModalBase.tsx
|
|
6968
6992
|
var React22 = __toESM(require("react"));
|
|
6969
6993
|
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
6970
|
-
var
|
|
6994
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
6971
6995
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6972
6996
|
var ModalBase = DialogPrimitive2.Root;
|
|
6973
6997
|
var ModalTriggerBase = DialogPrimitive2.Trigger;
|
|
@@ -7040,7 +7064,7 @@ var ModalContentBase = React22.forwardRef(
|
|
|
7040
7064
|
children: [
|
|
7041
7065
|
children,
|
|
7042
7066
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(DialogPrimitive2.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-md bg-muted/10 p-1.5 opacity-80 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none z-10 hover:bg-muted/20 transition-colors", children: [
|
|
7043
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7067
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react26.XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 text-foreground" }),
|
|
7044
7068
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "sr-only", children: "Close" })
|
|
7045
7069
|
] })
|
|
7046
7070
|
]
|
|
@@ -7177,7 +7201,6 @@ var ProgressBase = React23.forwardRef(
|
|
|
7177
7201
|
{
|
|
7178
7202
|
className: cn(
|
|
7179
7203
|
"h-full transition-all duration-500 ease-in-out rounded-lg",
|
|
7180
|
-
// quando não usa autocolor, Indicator deve mostrar a cor primária
|
|
7181
7204
|
autocolor && autocolor.length >= 2 ? "bg-transparent" : "bg-primary"
|
|
7182
7205
|
),
|
|
7183
7206
|
style: { width: `${indicatorWidth}%` }
|
|
@@ -7214,8 +7237,8 @@ var ProgressBase = React23.forwardRef(
|
|
|
7214
7237
|
{
|
|
7215
7238
|
"aria-hidden": "true",
|
|
7216
7239
|
className: "absolute top-0 bottom-0 w-0.5 bg-black/70 transition-all duration-500 ease-in-out pointer-events-none",
|
|
7217
|
-
style: { left:
|
|
7218
|
-
children: value >
|
|
7240
|
+
style: { left: `${100 / value * 100}%` },
|
|
7241
|
+
children: value > 120 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "absolute left-full ml-2 top-1/2 -translate-y-1/2 text-xs whitespace-nowrap font-extrabold", children: `+${Math.round(
|
|
7219
7242
|
value - 100
|
|
7220
7243
|
)}%` })
|
|
7221
7244
|
}
|
|
@@ -7365,7 +7388,7 @@ function SkeletonBase({
|
|
|
7365
7388
|
}
|
|
7366
7389
|
|
|
7367
7390
|
// src/components/ui/feedback/SonnerBase.tsx
|
|
7368
|
-
var
|
|
7391
|
+
var import_react27 = require("@phosphor-icons/react");
|
|
7369
7392
|
var import_sonner2 = require("sonner");
|
|
7370
7393
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7371
7394
|
var iconBaseClass = "w-5 h-auto";
|
|
@@ -7417,23 +7440,23 @@ var Toaster = ({ testId, ...props }) => {
|
|
|
7417
7440
|
};
|
|
7418
7441
|
var toast2 = {
|
|
7419
7442
|
success: (message) => import_sonner2.toast.success(message, {
|
|
7420
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7443
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react27.CheckCircleIcon, { className: `${iconBaseClass} text-green-600`, weight: "fill" }),
|
|
7421
7444
|
className: "sonner-success"
|
|
7422
7445
|
}),
|
|
7423
7446
|
error: (message) => import_sonner2.toast.error(message, {
|
|
7424
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7447
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react27.XCircleIcon, { className: `${iconBaseClass} text-red-600`, weight: "fill" }),
|
|
7425
7448
|
className: "sonner-error"
|
|
7426
7449
|
}),
|
|
7427
7450
|
warning: (message) => import_sonner2.toast.warning(message, {
|
|
7428
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7451
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react27.WarningIcon, { className: `${iconBaseClass} text-yellow-600`, weight: "fill" }),
|
|
7429
7452
|
className: "sonner-WarningIcon"
|
|
7430
7453
|
}),
|
|
7431
7454
|
info: (message) => import_sonner2.toast.info(message, {
|
|
7432
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7455
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react27.InfoIcon, { className: `${iconBaseClass} text-blue-600`, weight: "fill" }),
|
|
7433
7456
|
className: "sonner-InfoIcon"
|
|
7434
7457
|
}),
|
|
7435
7458
|
loading: (message) => (0, import_sonner2.toast)(message, {
|
|
7436
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7459
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react27.SpinnerIcon, { className: `${iconBaseClass} animate-spin text-neutral-500`, weight: "fill" }),
|
|
7437
7460
|
className: "sonner-loading"
|
|
7438
7461
|
})
|
|
7439
7462
|
};
|
|
@@ -7441,7 +7464,7 @@ var toast2 = {
|
|
|
7441
7464
|
// src/components/ui/form/CheckBoxBase.tsx
|
|
7442
7465
|
var React24 = __toESM(require("react"));
|
|
7443
7466
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
7444
|
-
var
|
|
7467
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
7445
7468
|
var import_framer_motion11 = require("framer-motion");
|
|
7446
7469
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7447
7470
|
var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
@@ -7462,7 +7485,7 @@ var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkb
|
|
|
7462
7485
|
exit: { scale: 0, opacity: 0, rotate: 90 },
|
|
7463
7486
|
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
7464
7487
|
className: "flex items-center justify-center text-current",
|
|
7465
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react28.CheckIcon, { className: "h-4 w-4", weight: "bold" })
|
|
7466
7489
|
}
|
|
7467
7490
|
) })
|
|
7468
7491
|
}
|
|
@@ -7472,7 +7495,7 @@ CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
|
|
|
7472
7495
|
// src/components/ui/form/CollapsibleBase.tsx
|
|
7473
7496
|
var React25 = __toESM(require("react"));
|
|
7474
7497
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
7475
|
-
var
|
|
7498
|
+
var import_react29 = require("@phosphor-icons/react");
|
|
7476
7499
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7477
7500
|
var CollapsibleBase = React25.forwardRef(({ ...props }, ref) => {
|
|
7478
7501
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CollapsiblePrimitive.Root, { ref, "data-slot": "collapsible", ...props });
|
|
@@ -7494,7 +7517,7 @@ var CollapsibleTriggerBase = React25.forwardRef(({ className, children, leftIcon
|
|
|
7494
7517
|
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex-shrink-0 [&>svg]:size-4", children: leftIcon }),
|
|
7495
7518
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children })
|
|
7496
7519
|
] }),
|
|
7497
|
-
showCaret && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7520
|
+
showCaret && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react29.CaretUpDownIcon, { className: "h-4 w-4" }) })
|
|
7498
7521
|
]
|
|
7499
7522
|
}
|
|
7500
7523
|
);
|
|
@@ -7518,8 +7541,8 @@ var CollapsibleContentBase = React25.forwardRef(({ className, children, ...props
|
|
|
7518
7541
|
CollapsibleContentBase.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
7519
7542
|
|
|
7520
7543
|
// src/components/ui/form/DebounceInput.tsx
|
|
7521
|
-
var
|
|
7522
|
-
var
|
|
7544
|
+
var import_react30 = require("react");
|
|
7545
|
+
var import_react31 = require("@phosphor-icons/react");
|
|
7523
7546
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7524
7547
|
|
|
7525
7548
|
// src/components/ui/form/HoverCardBase.tsx
|
|
@@ -7561,7 +7584,7 @@ function HoverCardContentBase({
|
|
|
7561
7584
|
// src/components/ui/form/Input-OTP-Base.tsx
|
|
7562
7585
|
var React26 = __toESM(require("react"));
|
|
7563
7586
|
var import_input_otp = require("input-otp");
|
|
7564
|
-
var
|
|
7587
|
+
var import_react32 = require("@phosphor-icons/react");
|
|
7565
7588
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7566
7589
|
function InputOTPBase({
|
|
7567
7590
|
className,
|
|
@@ -7616,7 +7639,7 @@ function InputOTPSlotBase({
|
|
|
7616
7639
|
);
|
|
7617
7640
|
}
|
|
7618
7641
|
function InputOTPSeparatorBase({ ...props }) {
|
|
7619
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react32.MinusIcon, {}) });
|
|
7620
7643
|
}
|
|
7621
7644
|
|
|
7622
7645
|
// src/components/ui/form/SliderBase.tsx
|
|
@@ -7704,7 +7727,7 @@ SlideBase.displayName = "SlideBase";
|
|
|
7704
7727
|
|
|
7705
7728
|
// src/components/ui/form/SmallButtons.tsx
|
|
7706
7729
|
var React28 = __toESM(require("react"));
|
|
7707
|
-
var
|
|
7730
|
+
var import_react33 = require("@phosphor-icons/react");
|
|
7708
7731
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7709
7732
|
var EditButton = React28.forwardRef(
|
|
7710
7733
|
({
|
|
@@ -7735,7 +7758,7 @@ var EditButton = React28.forwardRef(
|
|
|
7735
7758
|
),
|
|
7736
7759
|
...props,
|
|
7737
7760
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7738
|
-
|
|
7761
|
+
import_react33.PencilSimpleIcon,
|
|
7739
7762
|
{
|
|
7740
7763
|
size: iconSize,
|
|
7741
7764
|
color: iconColor,
|
|
@@ -7775,7 +7798,7 @@ var ChangeButton = React28.forwardRef(
|
|
|
7775
7798
|
),
|
|
7776
7799
|
...props,
|
|
7777
7800
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7778
|
-
|
|
7801
|
+
import_react33.ArrowsLeftRightIcon,
|
|
7779
7802
|
{
|
|
7780
7803
|
size: iconSize,
|
|
7781
7804
|
color: iconColor,
|
|
@@ -7815,7 +7838,7 @@ var SaveButton = React28.forwardRef(
|
|
|
7815
7838
|
),
|
|
7816
7839
|
...props,
|
|
7817
7840
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7818
|
-
|
|
7841
|
+
import_react33.FloppyDiskIcon,
|
|
7819
7842
|
{
|
|
7820
7843
|
size: iconSize,
|
|
7821
7844
|
color: iconColor,
|
|
@@ -7855,7 +7878,7 @@ var AddButton = React28.forwardRef(
|
|
|
7855
7878
|
),
|
|
7856
7879
|
...props,
|
|
7857
7880
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7858
|
-
|
|
7881
|
+
import_react33.PlusIcon,
|
|
7859
7882
|
{
|
|
7860
7883
|
size: iconSize,
|
|
7861
7884
|
color: iconColor,
|
|
@@ -7895,7 +7918,7 @@ var CloseButton = React28.forwardRef(
|
|
|
7895
7918
|
),
|
|
7896
7919
|
...props,
|
|
7897
7920
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7898
|
-
|
|
7921
|
+
import_react33.XIcon,
|
|
7899
7922
|
{
|
|
7900
7923
|
size: iconSize,
|
|
7901
7924
|
color: iconColor,
|
|
@@ -7927,7 +7950,7 @@ var DownloadButton = ({
|
|
|
7927
7950
|
),
|
|
7928
7951
|
...props,
|
|
7929
7952
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7930
|
-
|
|
7953
|
+
import_react33.DownloadSimpleIcon,
|
|
7931
7954
|
{
|
|
7932
7955
|
size: 18,
|
|
7933
7956
|
className: "transition-transform duration-300 group-hover:translate-y-0.5"
|
|
@@ -7956,7 +7979,7 @@ var UploadButton = ({
|
|
|
7956
7979
|
),
|
|
7957
7980
|
...props,
|
|
7958
7981
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7959
|
-
|
|
7982
|
+
import_react33.UploadSimpleIcon,
|
|
7960
7983
|
{
|
|
7961
7984
|
size: 18,
|
|
7962
7985
|
className: "transition-transform duration-300 group-hover:-translate-y-0.5"
|
|
@@ -7985,7 +8008,7 @@ var CopyButton = ({
|
|
|
7985
8008
|
),
|
|
7986
8009
|
...props,
|
|
7987
8010
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7988
|
-
|
|
8011
|
+
import_react33.CopyIcon,
|
|
7989
8012
|
{
|
|
7990
8013
|
size: 18,
|
|
7991
8014
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8014,7 +8037,7 @@ var RefreshButton = ({
|
|
|
8014
8037
|
),
|
|
8015
8038
|
...props,
|
|
8016
8039
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8017
|
-
|
|
8040
|
+
import_react33.ArrowClockwiseIcon,
|
|
8018
8041
|
{
|
|
8019
8042
|
size: 18,
|
|
8020
8043
|
className: "transition-transform duration-500 group-hover:rotate-180"
|
|
@@ -8043,7 +8066,7 @@ var SearchButton = ({
|
|
|
8043
8066
|
),
|
|
8044
8067
|
...props,
|
|
8045
8068
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8046
|
-
|
|
8069
|
+
import_react33.MagnifyingGlassIcon,
|
|
8047
8070
|
{
|
|
8048
8071
|
size: 18,
|
|
8049
8072
|
className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
|
|
@@ -8072,7 +8095,7 @@ var BackButton = ({
|
|
|
8072
8095
|
),
|
|
8073
8096
|
...props,
|
|
8074
8097
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8075
|
-
|
|
8098
|
+
import_react33.ArrowLeftIcon,
|
|
8076
8099
|
{
|
|
8077
8100
|
size: 18,
|
|
8078
8101
|
className: "transition-transform duration-300 group-hover:-translate-x-1"
|
|
@@ -8101,7 +8124,7 @@ var SettingsButton = ({
|
|
|
8101
8124
|
),
|
|
8102
8125
|
...props,
|
|
8103
8126
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8104
|
-
|
|
8127
|
+
import_react33.GearIcon,
|
|
8105
8128
|
{
|
|
8106
8129
|
size: 18,
|
|
8107
8130
|
className: "transition-transform duration-500 group-hover:rotate-90"
|
|
@@ -8130,7 +8153,7 @@ var NotificationButton = ({
|
|
|
8130
8153
|
),
|
|
8131
8154
|
...props,
|
|
8132
8155
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8133
|
-
|
|
8156
|
+
import_react33.BellIcon,
|
|
8134
8157
|
{
|
|
8135
8158
|
size: 18,
|
|
8136
8159
|
className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
|
|
@@ -8159,7 +8182,7 @@ var MoreButton = ({
|
|
|
8159
8182
|
),
|
|
8160
8183
|
...props,
|
|
8161
8184
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8162
|
-
|
|
8185
|
+
import_react33.DotsThreeIcon,
|
|
8163
8186
|
{
|
|
8164
8187
|
size: 18,
|
|
8165
8188
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8188,7 +8211,7 @@ var CheckButton = ({
|
|
|
8188
8211
|
),
|
|
8189
8212
|
...props,
|
|
8190
8213
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8191
|
-
|
|
8214
|
+
import_react33.CheckIcon,
|
|
8192
8215
|
{
|
|
8193
8216
|
size: 18,
|
|
8194
8217
|
className: "transition-transform duration-200 group-hover:scale-110"
|
|
@@ -8224,7 +8247,7 @@ var FilterButton = ({
|
|
|
8224
8247
|
),
|
|
8225
8248
|
...props,
|
|
8226
8249
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8227
|
-
|
|
8250
|
+
import_react33.FunnelIcon,
|
|
8228
8251
|
{
|
|
8229
8252
|
size: iconSize,
|
|
8230
8253
|
color: iconColor,
|
|
@@ -8263,7 +8286,7 @@ var LikeButton = ({
|
|
|
8263
8286
|
),
|
|
8264
8287
|
...props,
|
|
8265
8288
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8266
|
-
|
|
8289
|
+
import_react33.HeartIcon,
|
|
8267
8290
|
{
|
|
8268
8291
|
size: iconSize,
|
|
8269
8292
|
color: iconColor,
|
|
@@ -8302,7 +8325,7 @@ var FavoriteButton = ({
|
|
|
8302
8325
|
),
|
|
8303
8326
|
...props,
|
|
8304
8327
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8305
|
-
|
|
8328
|
+
import_react33.StarIcon,
|
|
8306
8329
|
{
|
|
8307
8330
|
size: iconSize,
|
|
8308
8331
|
color: iconColor,
|
|
@@ -8340,14 +8363,14 @@ var VisibilityButton = ({
|
|
|
8340
8363
|
),
|
|
8341
8364
|
...props,
|
|
8342
8365
|
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8343
|
-
|
|
8366
|
+
import_react33.EyeIcon,
|
|
8344
8367
|
{
|
|
8345
8368
|
size: iconSize,
|
|
8346
8369
|
color: iconColor,
|
|
8347
8370
|
className: "transition-opacity duration-200"
|
|
8348
8371
|
}
|
|
8349
8372
|
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8350
|
-
|
|
8373
|
+
import_react33.EyeSlashIcon,
|
|
8351
8374
|
{
|
|
8352
8375
|
size: iconSize,
|
|
8353
8376
|
color: iconColor,
|
|
@@ -8387,14 +8410,14 @@ var LockButton = ({
|
|
|
8387
8410
|
),
|
|
8388
8411
|
...props,
|
|
8389
8412
|
children: isLocked ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8390
|
-
|
|
8413
|
+
import_react33.LockIcon,
|
|
8391
8414
|
{
|
|
8392
8415
|
size: iconSize,
|
|
8393
8416
|
color: iconColor,
|
|
8394
8417
|
className: "transition-all duration-200 group-hover:scale-110"
|
|
8395
8418
|
}
|
|
8396
8419
|
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8397
|
-
|
|
8420
|
+
import_react33.LockOpenIcon,
|
|
8398
8421
|
{
|
|
8399
8422
|
size: iconSize,
|
|
8400
8423
|
color: iconColor,
|
|
@@ -8440,7 +8463,7 @@ SwitchBase.displayName = SwitchPrimitives.Root.displayName;
|
|
|
8440
8463
|
// src/components/ui/form/TextAreaBase.tsx
|
|
8441
8464
|
var React30 = __toESM(require("react"));
|
|
8442
8465
|
var import_framer_motion12 = require("framer-motion");
|
|
8443
|
-
var
|
|
8466
|
+
var import_react34 = require("@phosphor-icons/react");
|
|
8444
8467
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
8445
8468
|
var TextAreaBase = React30.forwardRef(
|
|
8446
8469
|
({ className, clearable = false, onClear, ...props }, ref) => {
|
|
@@ -8537,7 +8560,7 @@ var TextAreaBase = React30.forwardRef(
|
|
|
8537
8560
|
),
|
|
8538
8561
|
disabled: props.disabled,
|
|
8539
8562
|
"aria-label": "Limpar texto",
|
|
8540
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8563
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react34.TrashIcon, { size: 16, weight: "regular" })
|
|
8541
8564
|
}
|
|
8542
8565
|
) }),
|
|
8543
8566
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
@@ -8615,7 +8638,7 @@ TextAreaBase.displayName = "TextAreaBase";
|
|
|
8615
8638
|
// src/components/ui/layout/CarouselBase.tsx
|
|
8616
8639
|
var React31 = __toESM(require("react"));
|
|
8617
8640
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
8618
|
-
var
|
|
8641
|
+
var import_react35 = require("@phosphor-icons/react");
|
|
8619
8642
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8620
8643
|
var CarouselContext = React31.createContext(null);
|
|
8621
8644
|
function useCarousel() {
|
|
@@ -8774,7 +8797,7 @@ function CarouselPrevious({
|
|
|
8774
8797
|
onClick: scrollPrev,
|
|
8775
8798
|
...props,
|
|
8776
8799
|
children: [
|
|
8777
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.ArrowLeftIcon, {}),
|
|
8778
8801
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "Previous slide" })
|
|
8779
8802
|
]
|
|
8780
8803
|
}
|
|
@@ -8802,7 +8825,7 @@ function CarouselNextBase({
|
|
|
8802
8825
|
onClick: scrollNext,
|
|
8803
8826
|
...props,
|
|
8804
8827
|
children: [
|
|
8805
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8828
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react35.ArrowRightIcon, {}),
|
|
8806
8829
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "Next slide" })
|
|
8807
8830
|
]
|
|
8808
8831
|
}
|
|
@@ -8982,7 +9005,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
|
|
|
8982
9005
|
|
|
8983
9006
|
// src/components/ui/navigation/BreadcrumbBase.tsx
|
|
8984
9007
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
8985
|
-
var
|
|
9008
|
+
var import_react36 = require("@phosphor-icons/react");
|
|
8986
9009
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8987
9010
|
function BreadcrumbBase({ ...props }) {
|
|
8988
9011
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
@@ -9051,7 +9074,7 @@ function BreadcrumbSeparatorBase({
|
|
|
9051
9074
|
"aria-hidden": "true",
|
|
9052
9075
|
className: cn("[&>svg]:size-3.5", className),
|
|
9053
9076
|
...props,
|
|
9054
|
-
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9077
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react36.CaretRightIcon, {})
|
|
9055
9078
|
}
|
|
9056
9079
|
);
|
|
9057
9080
|
}
|
|
@@ -9068,7 +9091,7 @@ function BreadcrumbEllipsisBase({
|
|
|
9068
9091
|
className: cn("flex size-9 items-center justify-center", className),
|
|
9069
9092
|
...props,
|
|
9070
9093
|
children: [
|
|
9071
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9094
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react36.DotsThreeIcon, { className: "size-4" }),
|
|
9072
9095
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "sr-only", children: "More" })
|
|
9073
9096
|
]
|
|
9074
9097
|
}
|
|
@@ -9077,7 +9100,7 @@ function BreadcrumbEllipsisBase({
|
|
|
9077
9100
|
|
|
9078
9101
|
// src/components/ui/navigation/NavigationMenuBase.tsx
|
|
9079
9102
|
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
|
|
9080
|
-
var
|
|
9103
|
+
var import_react37 = require("@phosphor-icons/react");
|
|
9081
9104
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
9082
9105
|
function NavigationMenuBase({
|
|
9083
9106
|
className,
|
|
@@ -9145,7 +9168,7 @@ function NavigationMenuTriggerBase({
|
|
|
9145
9168
|
children: [
|
|
9146
9169
|
children,
|
|
9147
9170
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9148
|
-
|
|
9171
|
+
import_react37.CaretDownIcon,
|
|
9149
9172
|
{
|
|
9150
9173
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
9151
9174
|
"aria-hidden": "true"
|
|
@@ -9248,7 +9271,7 @@ function useIsMobile() {
|
|
|
9248
9271
|
var React36 = __toESM(require("react"));
|
|
9249
9272
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
9250
9273
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
9251
|
-
var
|
|
9274
|
+
var import_react38 = require("@phosphor-icons/react");
|
|
9252
9275
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
9253
9276
|
var SheetBase = SheetPrimitive.Root;
|
|
9254
9277
|
var SheetTriggerBase = SheetPrimitive.Trigger;
|
|
@@ -9292,7 +9315,7 @@ var SheetContentBase = React36.forwardRef(({ side = "right", className, children
|
|
|
9292
9315
|
...props,
|
|
9293
9316
|
children: [
|
|
9294
9317
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
9295
|
-
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9318
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react38.XIcon, { className: "h-4 w-4" }),
|
|
9296
9319
|
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "sr-only", children: "Close" })
|
|
9297
9320
|
] }),
|
|
9298
9321
|
children
|
|
@@ -9349,7 +9372,7 @@ var SheetDescriptionBase = React36.forwardRef(({ className, ...props }, ref) =>
|
|
|
9349
9372
|
SheetDescriptionBase.displayName = SheetPrimitive.Description.displayName;
|
|
9350
9373
|
|
|
9351
9374
|
// src/components/ui/navigation/SidebarBase.tsx
|
|
9352
|
-
var
|
|
9375
|
+
var import_react39 = require("@phosphor-icons/react");
|
|
9353
9376
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
9354
9377
|
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
9355
9378
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -9543,7 +9566,7 @@ var SidebarTriggerBase = React37.forwardRef(({ className, onClick, ...props }, r
|
|
|
9543
9566
|
...props,
|
|
9544
9567
|
children: [
|
|
9545
9568
|
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "sr-only", children: "Toggle SidebarBase" }),
|
|
9546
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9569
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react39.SidebarSimpleIcon, {})
|
|
9547
9570
|
]
|
|
9548
9571
|
}
|
|
9549
9572
|
) });
|
|
@@ -10037,11 +10060,11 @@ function DrawerDescriptionBase({
|
|
|
10037
10060
|
}
|
|
10038
10061
|
|
|
10039
10062
|
// src/hooks/use-universal-tooltip.tsx
|
|
10040
|
-
var
|
|
10063
|
+
var import_react40 = require("react");
|
|
10041
10064
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
10042
|
-
var UniversalTooltipContext = (0,
|
|
10065
|
+
var UniversalTooltipContext = (0, import_react40.createContext)(null);
|
|
10043
10066
|
var useUniversalTooltip = () => {
|
|
10044
|
-
const context = (0,
|
|
10067
|
+
const context = (0, import_react40.useContext)(UniversalTooltipContext);
|
|
10045
10068
|
if (!context) {
|
|
10046
10069
|
throw new Error("useUniversalTooltip deve ser usado dentro de UniversalTooltipProvider");
|
|
10047
10070
|
}
|
|
@@ -10049,7 +10072,7 @@ var useUniversalTooltip = () => {
|
|
|
10049
10072
|
};
|
|
10050
10073
|
var useTooltip = () => {
|
|
10051
10074
|
const { addTooltip, removeTooltip, startDrag } = useUniversalTooltip();
|
|
10052
|
-
const createTooltip = (0,
|
|
10075
|
+
const createTooltip = (0, import_react40.useCallback)((element, content, options) => {
|
|
10053
10076
|
const rect = element.getBoundingClientRect();
|
|
10054
10077
|
let position;
|
|
10055
10078
|
switch (options?.position || "auto") {
|
|
@@ -10079,7 +10102,7 @@ var useTooltip = () => {
|
|
|
10079
10102
|
metadata: options?.metadata
|
|
10080
10103
|
});
|
|
10081
10104
|
}, [addTooltip]);
|
|
10082
|
-
const handleElementMouseDown = (0,
|
|
10105
|
+
const handleElementMouseDown = (0, import_react40.useCallback)((tooltipId, event) => {
|
|
10083
10106
|
const rect = event.target.getBoundingClientRect();
|
|
10084
10107
|
const offset = {
|
|
10085
10108
|
x: event.clientX - rect.left,
|
|
@@ -10238,7 +10261,7 @@ var import_date_fns = require("date-fns");
|
|
|
10238
10261
|
// src/components/picker/calendar.tsx
|
|
10239
10262
|
var React39 = __toESM(require("react"));
|
|
10240
10263
|
var import_react_day_picker2 = require("react-day-picker");
|
|
10241
|
-
var
|
|
10264
|
+
var import_react41 = require("@phosphor-icons/react");
|
|
10242
10265
|
var import_framer_motion14 = require("framer-motion");
|
|
10243
10266
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10244
10267
|
function CalendarBase2({
|
|
@@ -10261,7 +10284,7 @@ function CalendarBase2({
|
|
|
10261
10284
|
"div",
|
|
10262
10285
|
{
|
|
10263
10286
|
className: cn(
|
|
10264
|
-
"rounded-md border bg-background p-2 overflow-hidden flex flex-col",
|
|
10287
|
+
"rounded-md border bg-background p-2 sm:p-3 md:p-4 overflow-hidden flex flex-col",
|
|
10265
10288
|
className
|
|
10266
10289
|
),
|
|
10267
10290
|
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion14.AnimatePresence, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
@@ -10274,51 +10297,46 @@ function CalendarBase2({
|
|
|
10274
10297
|
showOutsideDays,
|
|
10275
10298
|
month,
|
|
10276
10299
|
onMonthChange: handleMonthChange,
|
|
10277
|
-
className: "w-full h-full
|
|
10300
|
+
className: "w-full h-full flex flex-col",
|
|
10278
10301
|
classNames: {
|
|
10279
|
-
months: "flex
|
|
10280
|
-
month: "
|
|
10281
|
-
caption: "flex
|
|
10282
|
-
caption_label: "text-[clamp(0.
|
|
10283
|
-
nav: "
|
|
10302
|
+
months: "flex flex-col sm:flex-row gap-3 sm:gap-4 w-full",
|
|
10303
|
+
month: "flex-1 min-w-0",
|
|
10304
|
+
caption: "flex items-center justify-between gap-2 pr-1 min-h-[2.25rem] mb-2",
|
|
10305
|
+
caption_label: "text-[clamp(0.85rem,1.4vw,1.125rem)] sm:text-[clamp(0.9rem,1.6vw,1.125rem)] font-semibold capitalize text-left",
|
|
10306
|
+
nav: "flex items-center gap-2",
|
|
10284
10307
|
nav_button: cn(
|
|
10285
10308
|
buttonVariantsBase({ variant: "outline" }),
|
|
10286
|
-
"h-8 w-8
|
|
10287
|
-
"[@media(min-width:400px)]:h-9 [@media(min-width:400px)]:w-9"
|
|
10309
|
+
"h-8 w-8 sm:h-9 sm:w-9 md:h-10 md:w-10 flex items-center justify-center p-0 rounded-md transition-transform duration-150 ease-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/40 active:scale-95"
|
|
10288
10310
|
),
|
|
10289
|
-
nav_button_previous: "
|
|
10290
|
-
nav_button_next: "
|
|
10291
|
-
table: "w-full
|
|
10292
|
-
head_row: "
|
|
10293
|
-
head_cell: "text-muted-foreground rounded-md
|
|
10294
|
-
row: "
|
|
10311
|
+
nav_button_previous: "",
|
|
10312
|
+
nav_button_next: "",
|
|
10313
|
+
table: "w-full min-w-0 flex-1 grid grid-rows-[auto_1fr] gap-2",
|
|
10314
|
+
head_row: "grid grid-cols-7 gap-1 mb-1",
|
|
10315
|
+
head_cell: "text-muted-foreground rounded-md font-semibold text-[clamp(0.575rem,1.2vw,0.75rem)] sm:text-[clamp(0.65rem,1.1vw,0.825rem)] text-center pb-1 uppercase tracking-wider",
|
|
10316
|
+
row: "grid grid-cols-7 gap-1",
|
|
10295
10317
|
cell: cn(
|
|
10296
|
-
"
|
|
10318
|
+
"min-w-0 h-9 sm:h-10 md:h-11 p-0 relative flex items-center justify-center",
|
|
10297
10319
|
"[&:has([aria-selected].day-range-end)]:rounded-r-lg",
|
|
10298
10320
|
"[&:has([aria-selected].day-range-start)]:rounded-l-lg",
|
|
10299
10321
|
"[&:has([aria-selected].day-outside)]:bg-muted/50",
|
|
10300
|
-
"[&:has([aria-selected])]:bg-muted"
|
|
10301
|
-
"first:[&:has([aria-selected])]:rounded-l-lg",
|
|
10302
|
-
"last:[&:has([aria-selected])]:rounded-r-lg",
|
|
10303
|
-
"focus-within:relative focus-within:z-20"
|
|
10322
|
+
"[&:has([aria-selected])]:bg-muted"
|
|
10304
10323
|
),
|
|
10305
10324
|
day: cn(
|
|
10306
10325
|
buttonVariantsBase({ variant: "ghost" }),
|
|
10307
|
-
"w-full h-full p-0",
|
|
10308
|
-
"aria-selected:opacity-100 hover:bg-muted
|
|
10309
|
-
" transition-all duration-200 ease-out hover:scale-105 active:scale-95"
|
|
10326
|
+
"w-full h-full p-0 m-0 flex items-center justify-center text-[clamp(0.775rem,1.2vw,0.95rem)] sm:text-sm",
|
|
10327
|
+
"aria-selected:opacity-100 hover:bg-muted transition-all duration-150 ease-out active:scale-95"
|
|
10310
10328
|
),
|
|
10311
10329
|
day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold hover:text-white",
|
|
10312
10330
|
day_today: "bg-muted text-foreground font-bold ring-2 ring-primary/30 ring-inset",
|
|
10313
|
-
day_outside: "
|
|
10331
|
+
day_outside: "text-muted-foreground/40 opacity-60 aria-selected:bg-muted/50 aria-selected:text-foreground",
|
|
10314
10332
|
day_disabled: "text-muted-foreground/30 opacity-40 cursor-not-allowed",
|
|
10315
10333
|
day_range_middle: "aria-selected:bg-muted aria-selected:text-foreground",
|
|
10316
10334
|
day_hidden: "invisible",
|
|
10317
10335
|
...classNames
|
|
10318
10336
|
},
|
|
10319
10337
|
components: {
|
|
10320
|
-
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10321
|
-
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10338
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react41.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
10339
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react41.CaretRightIcon, { className: "h-4 w-4" })
|
|
10322
10340
|
},
|
|
10323
10341
|
...props
|
|
10324
10342
|
}
|
|
@@ -10333,15 +10351,15 @@ CalendarBase2.displayName = "CalendarBase";
|
|
|
10333
10351
|
|
|
10334
10352
|
// src/components/picker/DateTimePicker.tsx
|
|
10335
10353
|
var import_locale = require("date-fns/locale");
|
|
10336
|
-
var
|
|
10354
|
+
var import_react44 = require("react");
|
|
10337
10355
|
|
|
10338
10356
|
// src/components/picker/TimePicker.tsx
|
|
10339
10357
|
var import_framer_motion15 = require("framer-motion");
|
|
10340
10358
|
var React41 = __toESM(require("react"));
|
|
10341
10359
|
|
|
10342
10360
|
// src/components/picker/TimePickerInput.tsx
|
|
10343
|
-
var
|
|
10344
|
-
var
|
|
10361
|
+
var import_react42 = require("@phosphor-icons/react");
|
|
10362
|
+
var import_react43 = __toESM(require("react"));
|
|
10345
10363
|
|
|
10346
10364
|
// src/components/picker/utils/time-picker-utils.ts
|
|
10347
10365
|
function isValidHour(value) {
|
|
@@ -10484,7 +10502,7 @@ function display12HourValue(hours) {
|
|
|
10484
10502
|
|
|
10485
10503
|
// src/components/picker/TimePickerInput.tsx
|
|
10486
10504
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
10487
|
-
var TimePickerInput =
|
|
10505
|
+
var TimePickerInput = import_react43.default.forwardRef(
|
|
10488
10506
|
({
|
|
10489
10507
|
className,
|
|
10490
10508
|
type = "tel",
|
|
@@ -10503,10 +10521,10 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10503
10521
|
label,
|
|
10504
10522
|
...props
|
|
10505
10523
|
}, ref) => {
|
|
10506
|
-
const [flag, setFlag] =
|
|
10507
|
-
const [prevIntKey, setPrevIntKey] =
|
|
10508
|
-
const [isFocused, setIsFocused] =
|
|
10509
|
-
|
|
10524
|
+
const [flag, setFlag] = import_react43.default.useState(false);
|
|
10525
|
+
const [prevIntKey, setPrevIntKey] = import_react43.default.useState("0");
|
|
10526
|
+
const [isFocused, setIsFocused] = import_react43.default.useState(false);
|
|
10527
|
+
import_react43.default.useEffect(() => {
|
|
10510
10528
|
if (flag) {
|
|
10511
10529
|
const timer = setTimeout(() => {
|
|
10512
10530
|
setFlag(false);
|
|
@@ -10514,7 +10532,7 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10514
10532
|
return () => clearTimeout(timer);
|
|
10515
10533
|
}
|
|
10516
10534
|
}, [flag]);
|
|
10517
|
-
const calculatedValue =
|
|
10535
|
+
const calculatedValue = import_react43.default.useMemo(() => {
|
|
10518
10536
|
return getDateByType(date, picker);
|
|
10519
10537
|
}, [date, picker]);
|
|
10520
10538
|
const calculateNewValue = (key) => {
|
|
@@ -10603,7 +10621,7 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10603
10621
|
),
|
|
10604
10622
|
tabIndex: -1,
|
|
10605
10623
|
"aria-label": `Incrementar ${getPickerLabel().toLowerCase()}`,
|
|
10606
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10624
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react42.CaretUpIcon, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
10607
10625
|
}
|
|
10608
10626
|
),
|
|
10609
10627
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "relative", children: [
|
|
@@ -10670,7 +10688,7 @@ var TimePickerInput = import_react42.default.forwardRef(
|
|
|
10670
10688
|
),
|
|
10671
10689
|
tabIndex: -1,
|
|
10672
10690
|
"aria-label": `Decrementar ${getPickerLabel().toLowerCase()}`,
|
|
10673
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react42.CaretDownIcon, { size: 14, className: "sm:w-4 sm:h-4" })
|
|
10674
10692
|
}
|
|
10675
10693
|
)
|
|
10676
10694
|
]
|
|
@@ -10779,7 +10797,7 @@ function TimePicker({
|
|
|
10779
10797
|
}
|
|
10780
10798
|
|
|
10781
10799
|
// src/components/picker/DateTimePicker.tsx
|
|
10782
|
-
var
|
|
10800
|
+
var import_react45 = require("@phosphor-icons/react");
|
|
10783
10801
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
10784
10802
|
function DateTimePicker({
|
|
10785
10803
|
label,
|
|
@@ -10796,9 +10814,9 @@ function DateTimePicker({
|
|
|
10796
10814
|
className,
|
|
10797
10815
|
error
|
|
10798
10816
|
}) {
|
|
10799
|
-
const [internalDate, setInternalDate] = (0,
|
|
10800
|
-
const [open, setOpen] = (0,
|
|
10801
|
-
const [timePickerOpen, setTimePickerOpen] = (0,
|
|
10817
|
+
const [internalDate, setInternalDate] = (0, import_react44.useState)(date);
|
|
10818
|
+
const [open, setOpen] = (0, import_react44.useState)(false);
|
|
10819
|
+
const [timePickerOpen, setTimePickerOpen] = (0, import_react44.useState)(false);
|
|
10802
10820
|
const handleSelect = (newDay) => {
|
|
10803
10821
|
if (!newDay) return;
|
|
10804
10822
|
if (!internalDate) {
|
|
@@ -10831,7 +10849,7 @@ function DateTimePicker({
|
|
|
10831
10849
|
if (!timeFormat) return "PPP";
|
|
10832
10850
|
return `PPP - ${timeFormat}`;
|
|
10833
10851
|
};
|
|
10834
|
-
(0,
|
|
10852
|
+
(0, import_react44.useEffect)(() => {
|
|
10835
10853
|
if (date) {
|
|
10836
10854
|
setInternalDate(date);
|
|
10837
10855
|
}
|
|
@@ -10839,20 +10857,37 @@ function DateTimePicker({
|
|
|
10839
10857
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: cn("space-y-2 w-full sm:w-auto", className), children: [
|
|
10840
10858
|
label && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(LabelBase_default, { children: label }),
|
|
10841
10859
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(PopoverBase, { open, onOpenChange: setOpen, children: [
|
|
10842
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10843
|
-
|
|
10860
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10861
|
+
PopoverTriggerBase,
|
|
10844
10862
|
{
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10863
|
+
disabled,
|
|
10864
|
+
asChild: true,
|
|
10865
|
+
className: cn(error && "border-red-500"),
|
|
10866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
10867
|
+
ButtonBase,
|
|
10868
|
+
{
|
|
10869
|
+
variant: "outline",
|
|
10870
|
+
className: cn(
|
|
10871
|
+
"w-full justify-start text-left min-w-0 overflow-hidden ",
|
|
10872
|
+
!date && "text-muted-foreground"
|
|
10873
|
+
),
|
|
10874
|
+
children: [
|
|
10875
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10876
|
+
"span",
|
|
10877
|
+
{
|
|
10878
|
+
className: cn(
|
|
10879
|
+
"truncate flex-1",
|
|
10880
|
+
!date && "text-muted-foreground"
|
|
10881
|
+
),
|
|
10882
|
+
children: date ? (0, import_date_fns.format)(date, getDisplayFormat(), { locale: import_locale.ptBR }) : "Selecione uma data"
|
|
10883
|
+
}
|
|
10884
|
+
),
|
|
10885
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react45.CalendarBlankIcon, { className: "flex-shrink-0 w-5 h-5 sm:w-6 sm:h-6" })
|
|
10886
|
+
]
|
|
10887
|
+
}
|
|
10888
|
+
)
|
|
10854
10889
|
}
|
|
10855
|
-
)
|
|
10890
|
+
),
|
|
10856
10891
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ErrorMessage_default, { error }),
|
|
10857
10892
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10858
10893
|
PopoverContentBase,
|
|
@@ -10872,6 +10907,7 @@ function DateTimePicker({
|
|
|
10872
10907
|
selected: internalDate,
|
|
10873
10908
|
onSelect: (d) => handleSelect(d),
|
|
10874
10909
|
initialFocus: true,
|
|
10910
|
+
defaultMonth: fromDate ?? toDate ?? internalDate,
|
|
10875
10911
|
fromDate,
|
|
10876
10912
|
toDate,
|
|
10877
10913
|
className: cn(
|
|
@@ -10902,7 +10938,7 @@ function DateTimePicker({
|
|
|
10902
10938
|
"min-h-[36px] sm:min-h-[40px]"
|
|
10903
10939
|
),
|
|
10904
10940
|
children: [
|
|
10905
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
10941
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react45.ClockIcon, { className: "text-primary flex-shrink-0 w-4 h-4 sm:w-5 sm:h-5" }),
|
|
10906
10942
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-black truncate", children: internalDate ? (0, import_date_fns.format)(internalDate, getTimeFormat() || "HH:mm", {
|
|
10907
10943
|
locale: import_locale.ptBR
|
|
10908
10944
|
}) : "00:00" })
|
|
@@ -10954,10 +10990,13 @@ function DateTimePicker({
|
|
|
10954
10990
|
// src/components/picker/RangePicker.tsx
|
|
10955
10991
|
var React42 = __toESM(require("react"));
|
|
10956
10992
|
var import_react_day_picker3 = require("react-day-picker");
|
|
10957
|
-
var
|
|
10993
|
+
var import_pt_BR = __toESM(require("date-fns/locale/pt-BR"));
|
|
10994
|
+
var import_date_fns2 = require("date-fns");
|
|
10995
|
+
var import_react46 = require("@phosphor-icons/react");
|
|
10958
10996
|
var import_framer_motion16 = require("framer-motion");
|
|
10959
10997
|
var import_ssr7 = require("@phosphor-icons/react/dist/ssr");
|
|
10960
10998
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
10999
|
+
var dateFnsLocale = import_pt_BR.default?.default ?? import_pt_BR.default;
|
|
10961
11000
|
function RangePicker({
|
|
10962
11001
|
value,
|
|
10963
11002
|
onChange,
|
|
@@ -10999,7 +11038,9 @@ function RangePicker({
|
|
|
10999
11038
|
className: "text-sm font-medium",
|
|
11000
11039
|
transition: { duration: 0.2 },
|
|
11001
11040
|
animate: controls,
|
|
11002
|
-
children: range?.from && range?.to ? `${range.from
|
|
11041
|
+
children: range?.from && range?.to ? `${(0, import_date_fns2.format)(range.from, "P", {
|
|
11042
|
+
locale: dateFnsLocale
|
|
11043
|
+
})} - ${(0, import_date_fns2.format)(range.to, "P", { locale: dateFnsLocale })}` : label
|
|
11003
11044
|
}
|
|
11004
11045
|
),
|
|
11005
11046
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
@@ -11007,7 +11048,7 @@ function RangePicker({
|
|
|
11007
11048
|
{
|
|
11008
11049
|
animate: open ? { rotate: 8, scale: 1.15 } : { rotate: 0, scale: 1 },
|
|
11009
11050
|
transition: { type: "spring", stiffness: 300, damping: 18 },
|
|
11010
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11051
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react46.CalendarBlankIcon, { className: "w-4 h-4 transition-transform group-hover:scale-110" })
|
|
11011
11052
|
}
|
|
11012
11053
|
)
|
|
11013
11054
|
]
|
|
@@ -11043,53 +11084,49 @@ function RangePicker({
|
|
|
11043
11084
|
mode: "range",
|
|
11044
11085
|
selected: range,
|
|
11045
11086
|
onSelect: handleSelect,
|
|
11087
|
+
locale: dateFnsLocale,
|
|
11046
11088
|
showOutsideDays: true,
|
|
11047
11089
|
fromDate: minDate,
|
|
11048
11090
|
toDate: maxDate,
|
|
11049
11091
|
className: "min-w-0 flex flex-col",
|
|
11050
11092
|
classNames: {
|
|
11051
|
-
months: "flex
|
|
11052
|
-
month: "
|
|
11053
|
-
caption: "flex
|
|
11054
|
-
caption_label: "text-[clamp(0.
|
|
11055
|
-
nav: "
|
|
11093
|
+
months: "flex flex-col sm:flex-row gap-3 sm:gap-4 w-full",
|
|
11094
|
+
month: "flex-1 min-w-0",
|
|
11095
|
+
caption: "flex items-center justify-between gap-2 pr-1 min-h-[2.25rem] mb-2",
|
|
11096
|
+
caption_label: "text-[clamp(0.85rem,1.4vw,1.125rem)] sm:text-[clamp(0.9rem,1.6vw,1.125rem)] font-semibold capitalize text-left",
|
|
11097
|
+
nav: "flex items-center gap-2",
|
|
11056
11098
|
nav_button: cn(
|
|
11057
11099
|
buttonVariantsBase({ variant: "outline" }),
|
|
11058
|
-
"h-8 w-8
|
|
11059
|
-
"[@media(min-width:400px)]:h-9 [@media(min-width:400px)]:w-9"
|
|
11100
|
+
"h-8 w-8 sm:h-9 sm:w-9 md:h-10 md:w-10 flex items-center justify-center p-0 rounded-md transition-transform duration-150 ease-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/40 active:scale-95"
|
|
11060
11101
|
),
|
|
11061
|
-
nav_button_previous: "
|
|
11062
|
-
nav_button_next: "
|
|
11063
|
-
table: "w-full
|
|
11064
|
-
head_row: "
|
|
11065
|
-
head_cell: "text-muted-foreground rounded-md
|
|
11066
|
-
row: "
|
|
11102
|
+
nav_button_previous: "",
|
|
11103
|
+
nav_button_next: "",
|
|
11104
|
+
table: "w-full min-w-0 flex-1 grid grid-rows-[auto_1fr] gap-2",
|
|
11105
|
+
head_row: "grid grid-cols-7 gap-1 mb-1",
|
|
11106
|
+
head_cell: "text-muted-foreground rounded-md font-semibold text-[clamp(0.575rem,1.2vw,0.75rem)] sm:text-[clamp(0.65rem,1.1vw,0.825rem)] text-center pb-1 uppercase tracking-wider",
|
|
11107
|
+
row: "grid grid-cols-7 gap-1",
|
|
11067
11108
|
cell: cn(
|
|
11068
|
-
"
|
|
11109
|
+
"min-w-0 h-9 p-0 relative flex items-center justify-center",
|
|
11069
11110
|
"[&:has([aria-selected].day-range-end)]:rounded-r-lg",
|
|
11070
11111
|
"[&:has([aria-selected].day-range-start)]:rounded-l-lg",
|
|
11071
11112
|
"[&:has([aria-selected].day-outside)]:bg-muted/50",
|
|
11072
|
-
"[&:has([aria-selected])]:bg-muted"
|
|
11073
|
-
"first:[&:has([aria-selected])]:rounded-l-lg",
|
|
11074
|
-
"last:[&:has([aria-selected])]:rounded-r-lg",
|
|
11075
|
-
"focus-within:relative focus-within:z-20"
|
|
11113
|
+
"[&:has([aria-selected])]:bg-muted"
|
|
11076
11114
|
),
|
|
11077
11115
|
day: cn(
|
|
11078
11116
|
buttonVariantsBase({ variant: "ghost" }),
|
|
11079
|
-
"w-full h-full
|
|
11080
|
-
"aria-selected:opacity-100 hover:bg-muted
|
|
11081
|
-
"transition-all duration-200 ease-out !scale-100 aria-selected:!scale-100 hover:!scale-100 active:!scale-100"
|
|
11117
|
+
"w-full h-full p-0 m-0 flex items-center justify-center text-[clamp(0.775rem,1.2vw,0.95rem)] sm:text-sm",
|
|
11118
|
+
"aria-selected:opacity-100 hover:bg-muted transition-all duration-150 ease-out active:scale-95"
|
|
11082
11119
|
),
|
|
11083
|
-
day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold hover:text-white
|
|
11084
|
-
day_today: "bg-muted text-foreground font-bold ring-2 ring-primary/
|
|
11085
|
-
day_outside: "
|
|
11120
|
+
day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold hover:text-white",
|
|
11121
|
+
day_today: "bg-muted text-foreground font-bold ring-2 ring-primary/30 ring-inset",
|
|
11122
|
+
day_outside: "text-muted-foreground/40 opacity-60 aria-selected:bg-muted/50 aria-selected:text-foreground",
|
|
11086
11123
|
day_disabled: "text-muted-foreground/30 opacity-40 cursor-not-allowed",
|
|
11087
11124
|
day_range_middle: "aria-selected:bg-muted aria-selected:text-foreground",
|
|
11088
11125
|
day_hidden: "invisible"
|
|
11089
11126
|
},
|
|
11090
11127
|
components: {
|
|
11091
|
-
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11092
|
-
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
11128
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react46.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
11129
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react46.CaretRightIcon, { className: "h-4 w-4" })
|
|
11093
11130
|
}
|
|
11094
11131
|
}
|
|
11095
11132
|
)
|
|
@@ -11161,7 +11198,7 @@ RangePicker.displayName = "RangePicker";
|
|
|
11161
11198
|
|
|
11162
11199
|
// src/components/ui/navigation/ContextMenuBase.tsx
|
|
11163
11200
|
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"));
|
|
11164
|
-
var
|
|
11201
|
+
var import_react47 = require("@phosphor-icons/react");
|
|
11165
11202
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
11166
11203
|
function ContextMenuBase(props) {
|
|
11167
11204
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
|
|
@@ -11203,7 +11240,7 @@ function ContextMenuSubTriggerBase({
|
|
|
11203
11240
|
...props,
|
|
11204
11241
|
children: [
|
|
11205
11242
|
children,
|
|
11206
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11243
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react47.CaretRightIcon, { className: "ml-auto" })
|
|
11207
11244
|
]
|
|
11208
11245
|
}
|
|
11209
11246
|
);
|
|
@@ -11298,7 +11335,7 @@ function ContextMenuCheckboxItemBase({
|
|
|
11298
11335
|
checked,
|
|
11299
11336
|
...props,
|
|
11300
11337
|
children: [
|
|
11301
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11338
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react47.CheckIcon, { className: "size-4" }) }) }),
|
|
11302
11339
|
children
|
|
11303
11340
|
]
|
|
11304
11341
|
}
|
|
@@ -11323,7 +11360,7 @@ function ContextMenuRadioItemBase({
|
|
|
11323
11360
|
),
|
|
11324
11361
|
...props,
|
|
11325
11362
|
children: [
|
|
11326
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11363
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react47.CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
11327
11364
|
children
|
|
11328
11365
|
]
|
|
11329
11366
|
}
|
|
@@ -11371,14 +11408,317 @@ function ContextMenuShortcutBase({
|
|
|
11371
11408
|
);
|
|
11372
11409
|
}
|
|
11373
11410
|
|
|
11411
|
+
// src/components/ui/CodeBlock.tsx
|
|
11412
|
+
var import_react48 = require("@phosphor-icons/react");
|
|
11413
|
+
var import_react49 = __toESM(require("react"));
|
|
11414
|
+
var import_react_syntax_highlighter = require("react-syntax-highlighter");
|
|
11415
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
11416
|
+
var CodeBlock = ({
|
|
11417
|
+
language,
|
|
11418
|
+
filename,
|
|
11419
|
+
code,
|
|
11420
|
+
highlightLines = [],
|
|
11421
|
+
tabs = [],
|
|
11422
|
+
breadcrumb = [],
|
|
11423
|
+
showStats = true
|
|
11424
|
+
}) => {
|
|
11425
|
+
const [copied, setCopied] = import_react49.default.useState(false);
|
|
11426
|
+
const [activeTab, setActiveTab] = import_react49.default.useState(0);
|
|
11427
|
+
const [isExpanded, setIsExpanded] = import_react49.default.useState(false);
|
|
11428
|
+
const tabsExist = tabs.length > 0;
|
|
11429
|
+
const cssVars = import_react49.default.useMemo(
|
|
11430
|
+
() => ({
|
|
11431
|
+
container: {
|
|
11432
|
+
backgroundColor: "hsl(var(--card))",
|
|
11433
|
+
borderColor: "hsl(var(--border))"
|
|
11434
|
+
},
|
|
11435
|
+
header: {
|
|
11436
|
+
backgroundColor: "hsl(var(--popover))",
|
|
11437
|
+
borderBottomColor: "hsl(var(--border))"
|
|
11438
|
+
},
|
|
11439
|
+
filename: { color: "hsl(var(--card-foreground))" },
|
|
11440
|
+
mutedText: { color: "hsl(var(--muted-foreground))" },
|
|
11441
|
+
icon: { color: "hsl(var(--muted-foreground))" },
|
|
11442
|
+
lineNumbers: {
|
|
11443
|
+
color: "hsl(var(--muted-foreground))",
|
|
11444
|
+
borderRight: `1px solid hsl(var(--border))`
|
|
11445
|
+
},
|
|
11446
|
+
highlightBorder: `3px solid hsl(var(--primary))`
|
|
11447
|
+
}),
|
|
11448
|
+
[]
|
|
11449
|
+
);
|
|
11450
|
+
const sanitizeCode = (input) => {
|
|
11451
|
+
if (!input) return "";
|
|
11452
|
+
let out = input.replace(
|
|
11453
|
+
/(^['"]use client['"];?\s*|\b'use client';|\b"use client";)/g,
|
|
11454
|
+
""
|
|
11455
|
+
);
|
|
11456
|
+
out = out.replace(/style=\{[\s\S]*?\}/g, "");
|
|
11457
|
+
out = out.replace(/style=(["'`])(?:\\.|(?!\1)[\s\S])*?\1/g, "");
|
|
11458
|
+
return out;
|
|
11459
|
+
};
|
|
11460
|
+
const getActiveRawCode = () => (tabsExist ? tabs[activeTab].code : code) || "";
|
|
11461
|
+
const activeRawCode = getActiveRawCode();
|
|
11462
|
+
const activeCodeSanitized = sanitizeCode(activeRawCode);
|
|
11463
|
+
const copyToClipboard = async () => {
|
|
11464
|
+
const textToCopy = activeCodeSanitized;
|
|
11465
|
+
if (textToCopy) {
|
|
11466
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
11467
|
+
setCopied(true);
|
|
11468
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
11469
|
+
}
|
|
11470
|
+
};
|
|
11471
|
+
const downloadCode = () => {
|
|
11472
|
+
const textToDownload = activeCodeSanitized;
|
|
11473
|
+
const activeFilename = tabsExist ? tabs[activeTab].name : filename;
|
|
11474
|
+
if (textToDownload) {
|
|
11475
|
+
const blob = new Blob([textToDownload], { type: "text/plain" });
|
|
11476
|
+
const url = URL.createObjectURL(blob);
|
|
11477
|
+
const a = document.createElement("a");
|
|
11478
|
+
a.href = url;
|
|
11479
|
+
a.download = activeFilename;
|
|
11480
|
+
document.body.appendChild(a);
|
|
11481
|
+
a.click();
|
|
11482
|
+
document.body.removeChild(a);
|
|
11483
|
+
URL.revokeObjectURL(url);
|
|
11484
|
+
}
|
|
11485
|
+
};
|
|
11486
|
+
const activeLanguage = tabsExist ? tabs[activeTab].language || language : language;
|
|
11487
|
+
const activeHighlightLines = tabsExist ? tabs[activeTab].highlightLines || [] : highlightLines;
|
|
11488
|
+
const getLanguageIcon = (lang) => {
|
|
11489
|
+
switch (lang.toLowerCase()) {
|
|
11490
|
+
case "javascript":
|
|
11491
|
+
case "jsx":
|
|
11492
|
+
case "typescript":
|
|
11493
|
+
case "tsx":
|
|
11494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.CodeIcon, { size: "1em", className: "text-yellow-400" });
|
|
11495
|
+
case "bash":
|
|
11496
|
+
case "shell":
|
|
11497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.TerminalIcon, { size: "1em", className: "text-green-400" });
|
|
11498
|
+
default:
|
|
11499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.FileArchiveIcon, { size: "1em", className: "text-blue-400" });
|
|
11500
|
+
}
|
|
11501
|
+
};
|
|
11502
|
+
const getCodeStats = (source) => {
|
|
11503
|
+
const lines = source.split("\n").length;
|
|
11504
|
+
const chars = source.length;
|
|
11505
|
+
const words = source.split(/\s+/).filter((word) => word.length > 0).length;
|
|
11506
|
+
return { lines, chars, words };
|
|
11507
|
+
};
|
|
11508
|
+
const stats = showStats ? getCodeStats(activeCodeSanitized) : null;
|
|
11509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
11510
|
+
"div",
|
|
11511
|
+
{
|
|
11512
|
+
className: `relative w-full rounded-xl overflow-hidden shadow-sm border no-underline-code`,
|
|
11513
|
+
style: cssVars.container,
|
|
11514
|
+
children: [
|
|
11515
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("style", { children: `.no-underline-code a { text-decoration: none !important; text-shadow: none !important; box-shadow: none !important; } .no-underline-code code a { text-decoration: none !important; }` }),
|
|
11516
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `flex items-stretch min-h-[3rem]`, style: cssVars.header, children: [
|
|
11517
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex-1 flex items-center min-w-0 px-3", children: [
|
|
11518
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex gap-2 mr-3 shrink-0", children: [
|
|
11519
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-3 h-3 rounded-full bg-red-500" }),
|
|
11520
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-3 h-3 rounded-full bg-yellow-500" }),
|
|
11521
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-3 h-3 rounded-full bg-green-500" })
|
|
11522
|
+
] }),
|
|
11523
|
+
breadcrumb.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center min-w-0", children: [
|
|
11524
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.FolderIcon, { size: "1em", style: cssVars.icon }),
|
|
11525
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex items-center min-w-0 ml-2", children: breadcrumb.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_react49.default.Fragment, { children: [
|
|
11526
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11527
|
+
"span",
|
|
11528
|
+
{
|
|
11529
|
+
className: "text-xs truncate",
|
|
11530
|
+
style: cssVars.mutedText,
|
|
11531
|
+
children: crumb
|
|
11532
|
+
}
|
|
11533
|
+
),
|
|
11534
|
+
index < breadcrumb.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11535
|
+
import_react48.ArrowRightIcon,
|
|
11536
|
+
{
|
|
11537
|
+
size: "0.75em",
|
|
11538
|
+
style: cssVars.icon,
|
|
11539
|
+
className: "shrink-0 mx-1"
|
|
11540
|
+
}
|
|
11541
|
+
)
|
|
11542
|
+
] }, index)) })
|
|
11543
|
+
] })
|
|
11544
|
+
] }),
|
|
11545
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center justify-end shrink-0 px-2", children: [
|
|
11546
|
+
stats && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
11547
|
+
"div",
|
|
11548
|
+
{
|
|
11549
|
+
className: `text-xs mx-2 truncate hidden md:block`,
|
|
11550
|
+
style: cssVars.mutedText,
|
|
11551
|
+
children: [
|
|
11552
|
+
stats.lines,
|
|
11553
|
+
"L \u2022 ",
|
|
11554
|
+
stats.words,
|
|
11555
|
+
"W"
|
|
11556
|
+
]
|
|
11557
|
+
}
|
|
11558
|
+
),
|
|
11559
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex", children: [
|
|
11560
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11561
|
+
"button",
|
|
11562
|
+
{
|
|
11563
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
11564
|
+
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11565
|
+
title: "Toggle fullscreen",
|
|
11566
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.ArrowsOutIcon, { size: "1em", style: cssVars.icon })
|
|
11567
|
+
}
|
|
11568
|
+
),
|
|
11569
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11570
|
+
"button",
|
|
11571
|
+
{
|
|
11572
|
+
onClick: downloadCode,
|
|
11573
|
+
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11574
|
+
title: "Download code",
|
|
11575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.DownloadIcon, { size: "1em", style: cssVars.icon })
|
|
11576
|
+
}
|
|
11577
|
+
),
|
|
11578
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11579
|
+
"button",
|
|
11580
|
+
{
|
|
11581
|
+
onClick: copyToClipboard,
|
|
11582
|
+
className: `p-2 transition-colors hover:bg-gray-200 dark:hover:bg-slate-700`,
|
|
11583
|
+
title: "Copy code",
|
|
11584
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11585
|
+
import_react48.CheckIcon,
|
|
11586
|
+
{
|
|
11587
|
+
size: "1em",
|
|
11588
|
+
style: { color: "hsl(var(--primary))" }
|
|
11589
|
+
}
|
|
11590
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.CopyIcon, { size: "1em", style: cssVars.icon })
|
|
11591
|
+
}
|
|
11592
|
+
)
|
|
11593
|
+
] })
|
|
11594
|
+
] })
|
|
11595
|
+
] }),
|
|
11596
|
+
tabsExist && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11597
|
+
"div",
|
|
11598
|
+
{
|
|
11599
|
+
className: `flex border-b overflow-x-auto`,
|
|
11600
|
+
style: {
|
|
11601
|
+
borderColor: "hsl(var(--border))",
|
|
11602
|
+
backgroundColor: "hsl(var(--popover))"
|
|
11603
|
+
},
|
|
11604
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
11605
|
+
"button",
|
|
11606
|
+
{
|
|
11607
|
+
onClick: () => setActiveTab(index),
|
|
11608
|
+
className: `flex items-center gap-2 px-4 py-2 text-sm transition-all duration-200 border-b-2 shrink-0 ${activeTab === index ? "border-blue-500" : "border-transparent"}`,
|
|
11609
|
+
style: activeTab === index ? {
|
|
11610
|
+
backgroundColor: "hsl(var(--card))",
|
|
11611
|
+
color: "hsl(var(--card-foreground))"
|
|
11612
|
+
} : void 0,
|
|
11613
|
+
children: [
|
|
11614
|
+
getLanguageIcon(tab.language || language),
|
|
11615
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "truncate max-w-[10rem]", children: tab.name })
|
|
11616
|
+
]
|
|
11617
|
+
},
|
|
11618
|
+
index
|
|
11619
|
+
))
|
|
11620
|
+
}
|
|
11621
|
+
),
|
|
11622
|
+
!tabsExist && filename && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11623
|
+
"div",
|
|
11624
|
+
{
|
|
11625
|
+
className: "flex items-center px-3 py-2 border-b",
|
|
11626
|
+
style: {
|
|
11627
|
+
borderColor: "hsl(var(--border))",
|
|
11628
|
+
backgroundColor: "hsl(var(--popover))"
|
|
11629
|
+
},
|
|
11630
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
11631
|
+
getLanguageIcon(language),
|
|
11632
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11633
|
+
"span",
|
|
11634
|
+
{
|
|
11635
|
+
className: "text-sm font-medium truncate",
|
|
11636
|
+
style: cssVars.filename,
|
|
11637
|
+
children: filename
|
|
11638
|
+
}
|
|
11639
|
+
)
|
|
11640
|
+
] })
|
|
11641
|
+
}
|
|
11642
|
+
),
|
|
11643
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11644
|
+
"div",
|
|
11645
|
+
{
|
|
11646
|
+
className: `relative ${isExpanded ? "max-h-screen overflow-auto" : "max-h-96 overflow-auto"}`,
|
|
11647
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
11648
|
+
import_react_syntax_highlighter.Prism,
|
|
11649
|
+
{
|
|
11650
|
+
language: activeLanguage,
|
|
11651
|
+
customStyle: {
|
|
11652
|
+
margin: 0,
|
|
11653
|
+
padding: "1rem",
|
|
11654
|
+
fontSize: "0.875rem",
|
|
11655
|
+
lineHeight: "1.5",
|
|
11656
|
+
backgroundColor: "hsl(var(--card))"
|
|
11657
|
+
},
|
|
11658
|
+
wrapLines: true,
|
|
11659
|
+
showLineNumbers: true,
|
|
11660
|
+
lineNumberStyle: {
|
|
11661
|
+
...cssVars.lineNumbers,
|
|
11662
|
+
minWidth: "3em",
|
|
11663
|
+
paddingRight: "1em",
|
|
11664
|
+
marginRight: "1em"
|
|
11665
|
+
},
|
|
11666
|
+
lineProps: (lineNumber) => ({
|
|
11667
|
+
style: {
|
|
11668
|
+
backgroundColor: activeHighlightLines.includes(lineNumber) ? "hsl(var(--highlight))" : "transparent",
|
|
11669
|
+
display: "block",
|
|
11670
|
+
width: "100%",
|
|
11671
|
+
borderLeft: activeHighlightLines.includes(lineNumber) ? cssVars.highlightBorder : "none",
|
|
11672
|
+
paddingLeft: "0.5rem"
|
|
11673
|
+
}
|
|
11674
|
+
}),
|
|
11675
|
+
PreTag: "div",
|
|
11676
|
+
children: String(activeCodeSanitized)
|
|
11677
|
+
}
|
|
11678
|
+
)
|
|
11679
|
+
}
|
|
11680
|
+
),
|
|
11681
|
+
showStats && stats && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
11682
|
+
"div",
|
|
11683
|
+
{
|
|
11684
|
+
className: "px-3 py-2 border-t text-xs flex items-center justify-between min-h-[2.5rem]",
|
|
11685
|
+
style: {
|
|
11686
|
+
borderTopColor: "hsl(var(--border))",
|
|
11687
|
+
backgroundColor: "hsl(var(--popover))",
|
|
11688
|
+
color: "hsl(var(--muted-foreground))"
|
|
11689
|
+
},
|
|
11690
|
+
children: [
|
|
11691
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
11692
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "truncate", children: activeLanguage.toUpperCase() }),
|
|
11693
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: "truncate hidden sm:inline", children: [
|
|
11694
|
+
stats.lines,
|
|
11695
|
+
" lines"
|
|
11696
|
+
] }),
|
|
11697
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: "truncate hidden md:inline", children: [
|
|
11698
|
+
stats.chars,
|
|
11699
|
+
" chars"
|
|
11700
|
+
] })
|
|
11701
|
+
] }),
|
|
11702
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
11703
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_react48.GearIcon, { size: "0.75em", style: cssVars.icon }),
|
|
11704
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { children: "UTF-8" })
|
|
11705
|
+
] })
|
|
11706
|
+
]
|
|
11707
|
+
}
|
|
11708
|
+
)
|
|
11709
|
+
]
|
|
11710
|
+
}
|
|
11711
|
+
);
|
|
11712
|
+
};
|
|
11713
|
+
|
|
11374
11714
|
// src/hooks/use-drag.tsx
|
|
11375
|
-
var
|
|
11715
|
+
var import_react50 = require("react");
|
|
11376
11716
|
var useDrag = (options = {}) => {
|
|
11377
|
-
const [isDragging, setIsDragging] = (0,
|
|
11378
|
-
const [positions, setPositions] = (0,
|
|
11379
|
-
const dragStartPos = (0,
|
|
11380
|
-
const dragId = (0,
|
|
11381
|
-
const handleMouseDown = (0,
|
|
11717
|
+
const [isDragging, setIsDragging] = (0, import_react50.useState)(null);
|
|
11718
|
+
const [positions, setPositions] = (0, import_react50.useState)({});
|
|
11719
|
+
const dragStartPos = (0, import_react50.useRef)(null);
|
|
11720
|
+
const dragId = (0, import_react50.useRef)(null);
|
|
11721
|
+
const handleMouseDown = (0, import_react50.useCallback)((id, e) => {
|
|
11382
11722
|
e.preventDefault();
|
|
11383
11723
|
const currentPosition = positions[id] || { top: 0, left: 0 };
|
|
11384
11724
|
dragStartPos.current = {
|
|
@@ -11391,7 +11731,7 @@ var useDrag = (options = {}) => {
|
|
|
11391
11731
|
setIsDragging(id);
|
|
11392
11732
|
options.onDragStart?.(id);
|
|
11393
11733
|
}, [positions, options]);
|
|
11394
|
-
const handleMouseMove = (0,
|
|
11734
|
+
const handleMouseMove = (0, import_react50.useCallback)((e) => {
|
|
11395
11735
|
if (!isDragging || !dragStartPos.current || !dragId.current) return;
|
|
11396
11736
|
const deltaX = e.clientX - dragStartPos.current.x;
|
|
11397
11737
|
const deltaY = e.clientY - dragStartPos.current.y;
|
|
@@ -11407,7 +11747,7 @@ var useDrag = (options = {}) => {
|
|
|
11407
11747
|
}));
|
|
11408
11748
|
options.onDrag?.(dragId.current, newPosition);
|
|
11409
11749
|
}, [isDragging, options]);
|
|
11410
|
-
const handleMouseUp = (0,
|
|
11750
|
+
const handleMouseUp = (0, import_react50.useCallback)(() => {
|
|
11411
11751
|
if (dragId.current) {
|
|
11412
11752
|
options.onDragEnd?.(dragId.current);
|
|
11413
11753
|
}
|
|
@@ -11415,7 +11755,7 @@ var useDrag = (options = {}) => {
|
|
|
11415
11755
|
dragStartPos.current = null;
|
|
11416
11756
|
dragId.current = null;
|
|
11417
11757
|
}, [options]);
|
|
11418
|
-
(0,
|
|
11758
|
+
(0, import_react50.useEffect)(() => {
|
|
11419
11759
|
if (isDragging) {
|
|
11420
11760
|
document.addEventListener("mousemove", handleMouseMove);
|
|
11421
11761
|
document.addEventListener("mouseup", handleMouseUp);
|
|
@@ -11427,16 +11767,16 @@ var useDrag = (options = {}) => {
|
|
|
11427
11767
|
};
|
|
11428
11768
|
}
|
|
11429
11769
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
11430
|
-
const setPosition = (0,
|
|
11770
|
+
const setPosition = (0, import_react50.useCallback)((id, position) => {
|
|
11431
11771
|
setPositions((prev) => ({
|
|
11432
11772
|
...prev,
|
|
11433
11773
|
[id]: position
|
|
11434
11774
|
}));
|
|
11435
11775
|
}, []);
|
|
11436
|
-
const getPosition = (0,
|
|
11776
|
+
const getPosition = (0, import_react50.useCallback)((id) => {
|
|
11437
11777
|
return positions[id] || { top: 0, left: 0 };
|
|
11438
11778
|
}, [positions]);
|
|
11439
|
-
const isElementDragging = (0,
|
|
11779
|
+
const isElementDragging = (0, import_react50.useCallback)((id) => {
|
|
11440
11780
|
return isDragging === id;
|
|
11441
11781
|
}, [isDragging]);
|
|
11442
11782
|
return {
|