@mlw-packages/react-components 1.8.13 → 1.9.0

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.mjs CHANGED
@@ -42,7 +42,7 @@ import ptBR3 from 'date-fns/locale/pt-BR';
42
42
  import { useSensors, useSensor, MouseSensor, TouchSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
43
43
  import { CSS } from '@dnd-kit/utilities';
44
44
  import { RadioGroup, RadioGroupItem } from '@radix-ui/react-radio-group';
45
- import { ResponsiveContainer, ComposedChart, XAxis, YAxis, Bar, Line, Area, CartesianGrid, ReferenceLine, Tooltip, Legend, LabelList, Rectangle, BarChart as BarChart$1, LineChart, PieChart, Pie, Cell } from 'recharts';
45
+ import { ResponsiveContainer, ComposedChart, XAxis, YAxis, Bar, Line, Area, CartesianGrid, ReferenceLine, Tooltip, Legend, LabelList, Rectangle, PieChart, Pie, Cell } from 'recharts';
46
46
 
47
47
  var __create = Object.create;
48
48
  var __defProp = Object.defineProperty;
@@ -541,7 +541,7 @@ var AlertDialogContentBase = React33.forwardRef(({ className, testid = "alertdia
541
541
  {
542
542
  ref,
543
543
  className: cn(
544
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
544
+ "fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-3 sm:gap-4 border bg-background p-4 sm:p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto border-border",
545
545
  className
546
546
  ),
547
547
  "data-testid": testid,
@@ -557,7 +557,7 @@ var AlertDialogHeaderBase = ({
557
557
  "div",
558
558
  {
559
559
  className: cn(
560
- "flex flex-col space-y-2 text-center sm:text-left",
560
+ "flex flex-col space-y-1 sm:space-y-2 text-center sm:text-left",
561
561
  className
562
562
  ),
563
563
  ...props
@@ -571,7 +571,7 @@ var AlertDialogFooterBase = ({
571
571
  "div",
572
572
  {
573
573
  className: cn(
574
- "flex flex-col-reverse sm:flex-row sm:justify-end",
574
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 sm:gap-0",
575
575
  className
576
576
  ),
577
577
  ...props
@@ -627,7 +627,7 @@ var DialogOverlayBase = React33.forwardRef(({ className, testid: dataTestId = "d
627
627
  {
628
628
  ref,
629
629
  className: cn(
630
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
630
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 border-border",
631
631
  className
632
632
  ),
633
633
  "data-testid": dataTestId,
@@ -645,7 +645,7 @@ var DialogContentBase = React33.forwardRef(
645
645
  {
646
646
  ref,
647
647
  className: cn(
648
- "fixed left-[50%] top-[50%] z-50 w-lg grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg max-h-[100dvh] overflow-auto rounded-md border-border",
648
+ "fixed left-[50%] top-[50%] z-50 w-[calc(100%-2rem)] max-w-lg grid translate-x-[-50%] translate-y-[-50%] gap-3 sm:gap-4 border bg-background p-4 sm:p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto border-border",
649
649
  className
650
650
  ),
651
651
  "data-testid": dataTestId,
@@ -653,8 +653,8 @@ var DialogContentBase = React33.forwardRef(
653
653
  onWheel: userOnWheel,
654
654
  children: [
655
655
  children,
656
- /* @__PURE__ */ 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: [
657
- /* @__PURE__ */ jsx(XIcon, { className: "h-6 w-6 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
656
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-2 top-2 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 p-1", children: [
657
+ /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 hover:text-red-500 font-extrabold" }),
658
658
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
659
659
  ] })
660
660
  ]
@@ -669,7 +669,7 @@ var DialogHeaderBase = React33.forwardRef(({ className, testid: dataTestId = "di
669
669
  {
670
670
  ref,
671
671
  className: cn(
672
- "flex flex-col space-y-1.5 text-center sm:text-left",
672
+ "flex flex-col space-y-1 sm:space-y-1.5 text-center sm:text-left pr-8 sm:pr-0",
673
673
  className
674
674
  ),
675
675
  "data-testid": dataTestId,
@@ -682,7 +682,7 @@ var DialogFooterBase = React33.forwardRef(({ className, testid: dataTestId = "di
682
682
  {
683
683
  ref,
684
684
  className: cn(
685
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
685
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 sm:gap-0",
686
686
  className
687
687
  ),
688
688
  "data-testid": dataTestId,
@@ -1284,19 +1284,21 @@ function useIsMobile() {
1284
1284
  }, []);
1285
1285
  return !!isMobile;
1286
1286
  }
1287
+ var isTouchDevice = () => {
1288
+ return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints !== void 0;
1289
+ };
1287
1290
  var useDrag = (options = {}) => {
1288
1291
  const [isDragging, setIsDragging] = useState(null);
1289
1292
  const [positions, setPositions] = useState({});
1290
1293
  const dragStartPos = useRef(null);
1291
1294
  const dragId = useRef(null);
1295
+ const isTouch = useRef(isTouchDevice());
1292
1296
  const handleDragStart = useCallback(
1293
1297
  (id, e) => {
1294
1298
  const isTouchEvent = "touches" in e;
1295
1299
  const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
1296
1300
  const clientY = isTouchEvent ? e.touches[0].clientY : e.clientY;
1297
- if (!isTouchEvent) {
1298
- e.preventDefault();
1299
- }
1301
+ e.preventDefault();
1300
1302
  const currentPosition = positions[id] || { top: 0, left: 0 };
1301
1303
  dragStartPos.current = {
1302
1304
  x: clientX,
@@ -1314,6 +1316,9 @@ var useDrag = (options = {}) => {
1314
1316
  (e) => {
1315
1317
  if (!isDragging || !dragStartPos.current || !dragId.current) return;
1316
1318
  const isTouchEvent = "touches" in e;
1319
+ if (isTouchEvent) {
1320
+ e.preventDefault();
1321
+ }
1317
1322
  const clientX = isTouchEvent ? e.touches[0].clientX : e.clientX;
1318
1323
  const clientY = isTouchEvent ? e.touches[0].clientY : e.clientY;
1319
1324
  const deltaX = clientX - dragStartPos.current.x;
@@ -1348,18 +1353,25 @@ var useDrag = (options = {}) => {
1348
1353
  }, [options]);
1349
1354
  useEffect(() => {
1350
1355
  if (isDragging) {
1351
- document.addEventListener("mousemove", handleMouseMove);
1352
- document.addEventListener("mouseup", handleMouseUp);
1353
- document.addEventListener("touchmove", handleMouseMove, {
1354
- passive: false
1355
- });
1356
- document.addEventListener("touchend", handleMouseUp);
1356
+ const isTouchDev = isTouch.current;
1357
+ if (isTouchDev) {
1358
+ document.addEventListener("touchmove", handleMouseMove, {
1359
+ passive: false
1360
+ });
1361
+ document.addEventListener("touchend", handleMouseUp);
1362
+ } else {
1363
+ document.addEventListener("mousemove", handleMouseMove);
1364
+ document.addEventListener("mouseup", handleMouseUp);
1365
+ }
1357
1366
  document.body.style.userSelect = "none";
1358
1367
  return () => {
1359
- document.removeEventListener("mousemove", handleMouseMove);
1360
- document.removeEventListener("mouseup", handleMouseUp);
1361
- document.removeEventListener("touchmove", handleMouseMove);
1362
- document.removeEventListener("touchend", handleMouseUp);
1368
+ if (isTouchDev) {
1369
+ document.removeEventListener("touchmove", handleMouseMove);
1370
+ document.removeEventListener("touchend", handleMouseUp);
1371
+ } else {
1372
+ document.removeEventListener("mousemove", handleMouseMove);
1373
+ document.removeEventListener("mouseup", handleMouseUp);
1374
+ }
1363
1375
  document.body.style.userSelect = "";
1364
1376
  };
1365
1377
  }
@@ -1619,7 +1631,7 @@ var ModalContentBase = React33.forwardRef(
1619
1631
  {
1620
1632
  ref,
1621
1633
  className: cn(
1622
- "fixed z-50 grid w-full gap-4 border bg-background p-6 shadow-lg sm:rounded-lg max-h-[90dvh] overflow-auto",
1634
+ "fixed z-50 grid w-[calc(100%-2rem)] gap-3 sm:gap-4 border bg-background p-4 sm:p-6 shadow-lg rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto",
1623
1635
  "data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out border-border",
1624
1636
  positionClass,
1625
1637
  sizeClass,
@@ -1629,7 +1641,7 @@ var ModalContentBase = React33.forwardRef(
1629
1641
  ...props,
1630
1642
  children: [
1631
1643
  children,
1632
- /* @__PURE__ */ jsxs(DialogPrimitive.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: [
1644
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-2 top-2 sm:right-4 sm:top-4 rounded-md bg-muted/10 p-1.5 sm: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: [
1633
1645
  /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 text-foreground" }),
1634
1646
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1635
1647
  ] })
@@ -1645,7 +1657,7 @@ var ModalHeaderBase = React33.forwardRef(({ className, testid: dataTestId = "mod
1645
1657
  {
1646
1658
  ref,
1647
1659
  className: cn(
1648
- "flex flex-col space-y-1.5 text-center sm:text-left",
1660
+ "flex flex-col space-y-1 sm:space-y-1.5 text-center sm:text-left pr-8 sm:pr-0",
1649
1661
  className
1650
1662
  ),
1651
1663
  "data-testid": dataTestId,
@@ -1658,7 +1670,7 @@ var ModalFooterBase = React33.forwardRef(({ className, testid: dataTestId = "mod
1658
1670
  {
1659
1671
  ref,
1660
1672
  className: cn(
1661
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1673
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 sm:gap-0",
1662
1674
  className
1663
1675
  ),
1664
1676
  "data-testid": dataTestId,
@@ -1859,7 +1871,7 @@ var CommandBase = React33.forwardRef(({ className, testid: dataTestId = "command
1859
1871
  {
1860
1872
  ref,
1861
1873
  className: cn(
1862
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-background text-popover-foreground",
1874
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-background text-popover-foreground border-border",
1863
1875
  className
1864
1876
  ),
1865
1877
  "data-testid": dataTestId,
@@ -1881,13 +1893,13 @@ var CommandDialogBase = ({ children, open, ...props }) => {
1881
1893
  exit: "exit",
1882
1894
  variants: dialogVariants,
1883
1895
  transition: { duration: 0.2, ease: "easeOut" },
1884
- className: "overflow-hidden p-0",
1896
+ className: "overflow-hidden p-0 ",
1885
1897
  children: /* @__PURE__ */ jsx(CommandBase, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
1886
1898
  },
1887
1899
  "command-dialog"
1888
1900
  ) }) }) });
1889
1901
  };
1890
- var CommandInputBase = React33.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
1902
+ var CommandInputBase = React33.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3 border-border", "cmdk-input-wrapper": "", children: [
1891
1903
  /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
1892
1904
  /* @__PURE__ */ jsx(
1893
1905
  Command.Input,
@@ -2084,6 +2096,7 @@ function ComboboxBase({
2084
2096
  hideClear = false
2085
2097
  }) {
2086
2098
  const [open, setOpen] = useState(false);
2099
+ const isMobile = useIsMobile();
2087
2100
  return /* @__PURE__ */ jsxs(
2088
2101
  "div",
2089
2102
  {
@@ -2095,7 +2108,7 @@ function ComboboxBase({
2095
2108
  {
2096
2109
  open,
2097
2110
  onOpenChange: (v) => !disabled && setOpen(v),
2098
- modal: false,
2111
+ modal: isMobile,
2099
2112
  children: [
2100
2113
  /* @__PURE__ */ jsx(
2101
2114
  PopoverTriggerBase,
@@ -2545,7 +2558,7 @@ function MultiSelectValueBase({
2545
2558
  {
2546
2559
  "data-selected-item": true,
2547
2560
  size: "sm",
2548
- className: "group flex items-center gap-1",
2561
+ className: "group flex items-center gap-1 border-border",
2549
2562
  onClick: clickToRemove ? (e) => {
2550
2563
  e.stopPropagation();
2551
2564
  toggleValue(value);
@@ -2585,7 +2598,7 @@ function MultiSelectContentBase({
2585
2598
  PopoverContentBase,
2586
2599
  {
2587
2600
  forceMount: true,
2588
- className: "w-[--radix-popover-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md p-0",
2601
+ className: "w-[--radix-popover-trigger-width] relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md p-0 border-border",
2589
2602
  children: /* @__PURE__ */ jsx(
2590
2603
  motion.div,
2591
2604
  {
@@ -2610,8 +2623,8 @@ function MultiSelectContentBase({
2610
2623
  {
2611
2624
  placeholder: typeof search === "object" ? search.placeholder : void 0
2612
2625
  }
2613
- ) : /* @__PURE__ */ jsx("button", { autoFocus: true, className: "sr-only" }),
2614
- /* @__PURE__ */ jsxs(CommandListBase, { children: [
2626
+ ) : /* @__PURE__ */ jsx("button", { autoFocus: true, className: "sr-only " }),
2627
+ /* @__PURE__ */ jsxs(CommandListBase, { className: "border-border", children: [
2615
2628
  canSearch && /* @__PURE__ */ jsx(CommandEmptyBase, { children: typeof search === "object" ? search.emptyMessage ?? emptyMessage : emptyMessage }),
2616
2629
  children
2617
2630
  ] })
@@ -2668,7 +2681,7 @@ function useMultiSelectContext() {
2668
2681
  const context = useContext(MultiSelectContext);
2669
2682
  if (context == null) {
2670
2683
  throw new Error(
2671
- "useMultiSelectContext must be used within a MultiSelectContext"
2684
+ "useMultiSelectContext must be used within a MultiSelectContext "
2672
2685
  );
2673
2686
  }
2674
2687
  return context;
@@ -2853,7 +2866,7 @@ var SelectContentBase = React33.forwardRef(
2853
2866
  {
2854
2867
  className: cn(
2855
2868
  "p-1",
2856
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
2869
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-trigger-width)]"
2857
2870
  ),
2858
2871
  children
2859
2872
  }
@@ -2917,6 +2930,20 @@ var SelectSeparatorBase = React33.forwardRef(({ className, ...props }, ref) => /
2917
2930
  }
2918
2931
  ));
2919
2932
  SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
2933
+ var SelectEmpty = React33.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
2934
+ "div",
2935
+ {
2936
+ ref,
2937
+ className: cn(
2938
+ "w-full min-h-[3rem] flex items-center justify-center px-4 py-3 text-sm text-center",
2939
+ className
2940
+ ),
2941
+ ...props,
2942
+ children: /* @__PURE__ */ jsx("span", { className: "block w-full break-words hyphens-auto", children })
2943
+ }
2944
+ ));
2945
+ SelectEmpty.displayName = "SelectEmpty";
2946
+ SelectItemBase.displayName = SelectPrimitive.Item.displayName;
2920
2947
  var DropDownMenuBase = DropdownMenuPrimitive.Root;
2921
2948
  var DropDownMenuTriggerBase = DropdownMenuPrimitive.Trigger;
2922
2949
  var DropDownMenuGroupBase = DropdownMenuPrimitive.Group;
@@ -3177,36 +3204,45 @@ function ModeToggleBase({
3177
3204
  }, []);
3178
3205
  const isDark = mounted && (currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches);
3179
3206
  const toggleTheme = async (newTheme) => {
3180
- if (!buttonRef.current || !document.startViewTransition) {
3207
+ if (!buttonRef.current) {
3181
3208
  setTheme(newTheme);
3182
3209
  return;
3183
3210
  }
3184
- const rect = buttonRef.current.getBoundingClientRect();
3185
- const x = rect.left + rect.width / 2;
3186
- const y = rect.top + rect.height / 2;
3187
- const endRadius = Math.hypot(
3188
- Math.max(x, window.innerWidth - x),
3189
- Math.max(y, window.innerHeight - y)
3190
- );
3191
- const transition = document.startViewTransition(async () => {
3211
+ const supportsViewTransition = typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function";
3212
+ if (!supportsViewTransition) {
3192
3213
  setTheme(newTheme);
3193
- });
3194
- await transition.ready;
3195
- document.documentElement.animate(
3196
- [
3197
- {
3198
- clipPath: `circle(0px at ${x}px ${y}px)`
3199
- },
3214
+ return;
3215
+ }
3216
+ try {
3217
+ const rect = buttonRef.current.getBoundingClientRect();
3218
+ const x = rect.left + rect.width / 2;
3219
+ const y = rect.top + rect.height / 2;
3220
+ const endRadius = Math.hypot(
3221
+ Math.max(x, window.innerWidth - x),
3222
+ Math.max(y, window.innerHeight - y)
3223
+ );
3224
+ const transition = document.startViewTransition(async () => {
3225
+ setTheme(newTheme);
3226
+ });
3227
+ await transition.ready;
3228
+ document.documentElement.animate(
3229
+ [
3230
+ {
3231
+ clipPath: `circle(0px at ${x}px ${y}px)`
3232
+ },
3233
+ {
3234
+ clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)`
3235
+ }
3236
+ ],
3200
3237
  {
3201
- clipPath: `circle(${Math.ceil(endRadius)}px at ${x}px ${y}px)`
3238
+ duration: 400,
3239
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)",
3240
+ pseudoElement: "::view-transition-new(root)"
3202
3241
  }
3203
- ],
3204
- {
3205
- duration: 400,
3206
- easing: "cubic-bezier(0.4, 0, 0.2, 1)",
3207
- pseudoElement: "::view-transition-new(root)"
3208
- }
3209
- );
3242
+ );
3243
+ } catch {
3244
+ setTheme(newTheme);
3245
+ }
3210
3246
  };
3211
3247
  return /* @__PURE__ */ jsxs(DropDownMenuBase, { children: [
3212
3248
  /* @__PURE__ */ jsx(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs(
@@ -3215,10 +3251,7 @@ function ModeToggleBase({
3215
3251
  ref: buttonRef,
3216
3252
  variant,
3217
3253
  size: "icon",
3218
- className: cn(
3219
- "relative overflow-hidden group",
3220
- className
3221
- ),
3254
+ className: cn("relative overflow-hidden group", className),
3222
3255
  children: [
3223
3256
  /* @__PURE__ */ jsxs(Fragment, { children: [
3224
3257
  /* @__PURE__ */ jsx(
@@ -7608,6 +7641,10 @@ function useScrollColumn({
7608
7641
  const [scrollTop, setScrollTop] = useState(0);
7609
7642
  const scrollTimeoutRef = useRef(null);
7610
7643
  const isTouchRef = useRef(false);
7644
+ const velocityRef = useRef(0);
7645
+ const lastTouchY = useRef(0);
7646
+ const lastTouchTime = useRef(0);
7647
+ const momentumAnimationRef = useRef(null);
7611
7648
  const itemHeight = ITEM_HEIGHT;
7612
7649
  const centerIndex = CENTER_INDEX;
7613
7650
  const visibleItems = VISIBLE_ITEMS;
@@ -7625,8 +7662,12 @@ function useScrollColumn({
7625
7662
  }
7626
7663
  }, [value, isDragging, itemHeight, step, items.length]);
7627
7664
  useEffect(() => {
7665
+ const animationRef = momentumAnimationRef.current;
7628
7666
  return () => {
7629
7667
  if (scrollTimeoutRef.current) clearTimeout(scrollTimeoutRef.current);
7668
+ if (animationRef) {
7669
+ cancelAnimationFrame(animationRef);
7670
+ }
7630
7671
  };
7631
7672
  }, []);
7632
7673
  const handleScroll = (e) => {
@@ -7646,27 +7687,77 @@ function useScrollColumn({
7646
7687
  };
7647
7688
  const handleStart = (pageY) => {
7648
7689
  if (!containerRef.current) return;
7690
+ if (momentumAnimationRef.current) {
7691
+ cancelAnimationFrame(momentumAnimationRef.current);
7692
+ momentumAnimationRef.current = null;
7693
+ }
7649
7694
  setIsDragging(true);
7650
7695
  setStartY(pageY);
7651
7696
  setScrollTop(containerRef.current.scrollTop);
7697
+ velocityRef.current = 0;
7698
+ lastTouchY.current = pageY;
7699
+ lastTouchTime.current = Date.now();
7652
7700
  };
7653
7701
  const handleMove = (pageY) => {
7654
7702
  if (!isDragging || !containerRef.current) return;
7655
- const multiplier = isTouchRef.current ? 0.6 : 1;
7703
+ const now = Date.now();
7704
+ const timeDelta = now - lastTouchTime.current;
7705
+ if (timeDelta > 0) {
7706
+ const delta = pageY - lastTouchY.current;
7707
+ velocityRef.current = delta / timeDelta;
7708
+ }
7709
+ lastTouchY.current = pageY;
7710
+ lastTouchTime.current = now;
7711
+ const multiplier = isTouchRef.current ? 1 : 1;
7656
7712
  containerRef.current.scrollTop = scrollTop + (startY - pageY) * multiplier;
7657
7713
  };
7658
7714
  const handleEnd = () => {
7659
7715
  if (!containerRef.current) return;
7660
7716
  setIsDragging(false);
7661
- requestAnimationFrame(() => {
7662
- if (!containerRef.current) return;
7663
- const newIndex = Math.round(containerRef.current.scrollTop / itemHeight);
7664
- const newValue = items[newIndex];
7665
- if (newValue !== void 0) {
7666
- containerRef.current.scrollTop = newIndex * itemHeight;
7667
- onChange(newValue);
7668
- }
7669
- });
7717
+ if (isTouchRef.current && Math.abs(velocityRef.current) > 0.1) {
7718
+ let velocity = velocityRef.current * -30;
7719
+ const friction = 0.92;
7720
+ const minVelocity = 0.5;
7721
+ const animate = () => {
7722
+ if (!containerRef.current) return;
7723
+ velocity *= friction;
7724
+ if (Math.abs(velocity) < minVelocity) {
7725
+ const newIndex = Math.round(
7726
+ containerRef.current.scrollTop / itemHeight
7727
+ );
7728
+ const newValue = items[newIndex];
7729
+ if (newValue !== void 0) {
7730
+ const targetScroll = newIndex * itemHeight;
7731
+ const currentScroll = containerRef.current.scrollTop;
7732
+ const diff = targetScroll - currentScroll;
7733
+ if (Math.abs(diff) > 0.5) {
7734
+ containerRef.current.scrollTop += diff * 0.3;
7735
+ momentumAnimationRef.current = requestAnimationFrame(animate);
7736
+ } else {
7737
+ containerRef.current.scrollTop = targetScroll;
7738
+ onChange(newValue);
7739
+ momentumAnimationRef.current = null;
7740
+ }
7741
+ }
7742
+ return;
7743
+ }
7744
+ containerRef.current.scrollTop += velocity;
7745
+ momentumAnimationRef.current = requestAnimationFrame(animate);
7746
+ };
7747
+ momentumAnimationRef.current = requestAnimationFrame(animate);
7748
+ } else {
7749
+ requestAnimationFrame(() => {
7750
+ if (!containerRef.current) return;
7751
+ const newIndex = Math.round(
7752
+ containerRef.current.scrollTop / itemHeight
7753
+ );
7754
+ const newValue = items[newIndex];
7755
+ if (newValue !== void 0) {
7756
+ containerRef.current.scrollTop = newIndex * itemHeight;
7757
+ onChange(newValue);
7758
+ }
7759
+ });
7760
+ }
7670
7761
  };
7671
7762
  const handlers = {
7672
7763
  onScroll: handleScroll,
@@ -8129,7 +8220,7 @@ function DateTimePicker({
8129
8220
  }
8130
8221
  ),
8131
8222
  /* @__PURE__ */ jsx(ErrorMessage_default, { error }),
8132
- /* @__PURE__ */ jsx(DialogContentBase, { className: "p-0 max-h-[65vh] w-[calc(100vw-24px)] sm:w-[calc(100vw-32px)] overflow-hidden flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto flex-1", children: renderPickerContent() }) })
8223
+ /* @__PURE__ */ jsx(DialogContentBase, { className: "p-0 max-h-[65vh] w-[calc(100vw-24px)] sm:w-[calc(100vw-32px)] overflow-hidden flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "overflow-y-auto flex-1 ", children: renderPickerContent() }) })
8133
8224
  ] }) : /* @__PURE__ */ jsxs(PopoverBase, { open, onOpenChange: setOpen, children: [
8134
8225
  /* @__PURE__ */ jsx(
8135
8226
  PopoverTriggerBase,
@@ -9854,7 +9945,7 @@ function Select({
9854
9945
  ]
9855
9946
  }
9856
9947
  ),
9857
- /* @__PURE__ */ jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: empty ? /* @__PURE__ */ jsx("div", { children: empty }) : /* @__PURE__ */ jsx(Fragment, { children: pagination && pagination > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
9948
+ /* @__PURE__ */ jsx(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: pagination && pagination > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
9858
9949
  /* @__PURE__ */ jsx(
9859
9950
  "div",
9860
9951
  {
@@ -9929,7 +10020,7 @@ function Select({
9929
10020
  }
9930
10021
  )
9931
10022
  ] })
9932
- ] }) : /* @__PURE__ */ jsx(Fragment, { children: groupItems ? /* @__PURE__ */ jsx(Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs(
10023
+ ] }) : /* @__PURE__ */ jsx(Fragment, { children: groupItems ? Object.keys(groupItems).length > 0 ? /* @__PURE__ */ jsx(Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs(
9933
10024
  SelectGroupBase,
9934
10025
  {
9935
10026
  "data-testid": testIds.group ?? "select-group",
@@ -9953,7 +10044,7 @@ function Select({
9953
10044
  ]
9954
10045
  },
9955
10046
  key
9956
- )) }) : /* @__PURE__ */ jsx(
10047
+ )) }) : /* @__PURE__ */ jsx(SelectEmpty, { "data-testid": testIds.empty ?? "select-empty", children: empty ?? "Nenhum item dispon\xEDvel" }) : items && items.length > 0 ? /* @__PURE__ */ jsx(
9957
10048
  SelectGroupBase,
9958
10049
  {
9959
10050
  "data-testid": testIds.group ?? "select-group",
@@ -9967,7 +10058,7 @@ function Select({
9967
10058
  item.value
9968
10059
  ))
9969
10060
  }
9970
- ) }) }) }) })
10061
+ ) : /* @__PURE__ */ jsx(SelectEmpty, { "data-testid": testIds.empty ?? "select-empty", children: empty ?? "Nenhum item dispon\xEDvel" }) }) }) })
9971
10062
  ]
9972
10063
  }
9973
10064
  ),
@@ -13779,7 +13870,7 @@ function MultiSelect({
13779
13870
  MultiSelectTriggerBase,
13780
13871
  {
13781
13872
  className: cn(
13782
- "flex items-center gap-2 justify-between",
13873
+ "flex items-center gap-2 justify-between hover:bg-muted transition-all duration-150",
13783
13874
  error && "border-red-500",
13784
13875
  className
13785
13876
  ),
@@ -14805,6 +14896,24 @@ var DraggableTooltipComponent = ({
14805
14896
  if (onPositionChange) onPositionChange(id, snapped);
14806
14897
  });
14807
14898
  };
14899
+ const handleTouchMove = (e) => {
14900
+ if (!dragging || !e.touches[0]) return;
14901
+ e.preventDefault();
14902
+ lastMouse.current = { x: e.touches[0].clientX, y: e.touches[0].clientY };
14903
+ if (rafId) cancelAnimationFrame(rafId);
14904
+ rafId = requestAnimationFrame(() => {
14905
+ const newLeft = lastMouse.current.x - offsetRef.current.x;
14906
+ const newTop = lastMouse.current.y - offsetRef.current.y;
14907
+ const rawPosition = {
14908
+ top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
14909
+ left: Math.max(0, Math.min(newLeft, window.innerWidth - 250))
14910
+ };
14911
+ updateAlignmentGuides(rawPosition);
14912
+ const snapped = snapToGuides(rawPosition);
14913
+ setLocalPos(snapped);
14914
+ if (onPositionChange) onPositionChange(id, snapped);
14915
+ });
14916
+ };
14808
14917
  const handleMouseUp = () => {
14809
14918
  if (dragging) {
14810
14919
  setDragging(false);
@@ -14812,11 +14921,23 @@ var DraggableTooltipComponent = ({
14812
14921
  if (rafId) cancelAnimationFrame(rafId);
14813
14922
  }
14814
14923
  };
14924
+ const handleTouchEnd = () => {
14925
+ if (dragging) {
14926
+ setDragging(false);
14927
+ setAlignmentGuides([]);
14928
+ if (rafId) cancelAnimationFrame(rafId);
14929
+ }
14930
+ };
14815
14931
  if (dragging) {
14816
14932
  document.addEventListener("mousemove", handleMouseMove, {
14817
14933
  passive: true
14818
14934
  });
14819
14935
  document.addEventListener("mouseup", handleMouseUp);
14936
+ document.addEventListener("touchmove", handleTouchMove, {
14937
+ passive: false
14938
+ // Permite preventDefault para evitar scroll
14939
+ });
14940
+ document.addEventListener("touchend", handleTouchEnd);
14820
14941
  document.body.style.cursor = "grabbing";
14821
14942
  document.body.style.userSelect = "none";
14822
14943
  }
@@ -14824,6 +14945,8 @@ var DraggableTooltipComponent = ({
14824
14945
  if (rafId) cancelAnimationFrame(rafId);
14825
14946
  document.removeEventListener("mousemove", handleMouseMove);
14826
14947
  document.removeEventListener("mouseup", handleMouseUp);
14948
+ document.removeEventListener("touchmove", handleTouchMove);
14949
+ document.removeEventListener("touchend", handleTouchEnd);
14827
14950
  document.body.style.cursor = "";
14828
14951
  document.body.style.userSelect = "";
14829
14952
  };
@@ -14908,6 +15031,7 @@ var DraggableTooltipComponent = ({
14908
15031
  );
14909
15032
  const handleTouchStartLocal = useCallback(
14910
15033
  (e) => {
15034
+ e.preventDefault();
14911
15035
  e.stopPropagation();
14912
15036
  const touch = e.touches[0];
14913
15037
  if (!touch) return;
@@ -16980,13 +17104,13 @@ var Chart = ({
16980
17104
  "div",
16981
17105
  {
16982
17106
  ref: wrapperRef,
16983
- className: cn("w-full overflow-hidden min-w-0 rounded-lg", className),
16984
- children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0", children: [
17107
+ className: cn("w-full overflow-hidden min-w-0 rounded-lg border-border", className),
17108
+ children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-card relative w-full max-w-full min-w-0 py-1", children: [
16985
17109
  title && /* @__PURE__ */ jsx(
16986
17110
  "div",
16987
17111
  {
16988
17112
  className: cn(
16989
- "w-full flex items-center mt-5 mb-2",
17113
+ "w-full flex items-center mt-3 mb-2",
16990
17114
  HORIZONTAL_PADDING_CLASS,
16991
17115
  titlePosition === "center" && "justify-center",
16992
17116
  titlePosition === "right" && "justify-end",
@@ -17436,1284 +17560,59 @@ var Chart = ({
17436
17560
  );
17437
17561
  };
17438
17562
  var Chart_default = Chart;
17439
- var DEFAULT_COLORS3 = ["#55af7d", "#8e68ff", "#2273e1"];
17440
- var BarChart = ({
17441
- data,
17442
- className,
17443
- height = 350,
17444
- width = 900,
17445
- colors: colors2 = DEFAULT_COLORS3,
17446
- gridColor,
17447
- showGrid = true,
17448
- showTooltip = true,
17449
- showLegend = true,
17450
- title,
17451
- titlePosition = "left",
17452
- showLabels = false,
17453
- xAxis,
17454
- mapper,
17455
- yAxis,
17456
- labelMap,
17457
- autoDetect = false,
17458
- padding,
17459
- margins,
17460
- containerPaddingLeft,
17461
- chartMargins
17563
+ var defaultData = [
17564
+ { name: "Vendas", value: 4e3 },
17565
+ { name: "Marketing", value: 3e3 },
17566
+ { name: "Desenvolvimento", value: 2e3 },
17567
+ { name: "Suporte", value: 1e3 },
17568
+ { name: "Outros", value: 800 }
17569
+ ];
17570
+ var DEFAULT_COLORS3 = [
17571
+ "#55af7d",
17572
+ // verde do projeto
17573
+ "#8e68ff",
17574
+ // roxo do projeto
17575
+ "#2273e1",
17576
+ // azul do projeto
17577
+ "#f59e0b",
17578
+ // amarelo complementar
17579
+ "#ef4444",
17580
+ // vermelho complementar
17581
+ "#8b5cf6",
17582
+ // roxo claro
17583
+ "#06b6d4",
17584
+ // ciano
17585
+ "#84cc16"
17586
+ // verde lima
17587
+ ];
17588
+ var RADIAN = Math.PI / 180;
17589
+ var renderCustomizedLabel = ({
17590
+ cx = 0,
17591
+ cy = 0,
17592
+ midAngle = 0,
17593
+ innerRadius = 0,
17594
+ outerRadius = 0,
17595
+ percent = 0
17462
17596
  }) => {
17463
- const resolvedContainerPaddingLeft = resolveContainerPaddingLeft(
17464
- padding,
17465
- containerPaddingLeft,
17466
- 16
17467
- );
17468
- const smartConfig = useMemo(() => {
17469
- const providedMapper = yAxis ?? mapper;
17470
- if (autoDetect === true || xAxis == null || providedMapper == null) {
17471
- const detectedXAxis = detectXAxis(data);
17472
- const detectedFields = detectDataFields(data, detectedXAxis);
17473
- return {
17474
- xAxisConfig: {
17475
- dataKey: detectedXAxis,
17476
- label: labelMap?.[detectedXAxis] ?? formatFieldName(detectedXAxis),
17477
- autoLabel: true
17478
- },
17479
- mapperConfig: detectedFields.reduce((acc, field) => {
17480
- acc[field] = {
17481
- label: labelMap?.[field] ?? formatFieldName(field),
17482
- type: "number",
17483
- visible: true
17484
- };
17485
- return acc;
17486
- }, {})
17487
- };
17488
- }
17489
- const xAxisConfig2 = typeof xAxis === "string" ? { dataKey: xAxis, label: formatFieldName(xAxis), autoLabel: true } : xAxis;
17490
- let mapperConfig2;
17491
- if (Array.isArray(providedMapper)) {
17492
- mapperConfig2 = providedMapper.reduce((acc, field) => {
17493
- acc[field] = {
17494
- label: labelMap?.[field] ?? formatFieldName(field),
17495
- type: "auto",
17496
- visible: true
17497
- };
17498
- return acc;
17499
- }, {});
17500
- } else {
17501
- mapperConfig2 = Object.keys(providedMapper).reduce(
17502
- (acc, key) => {
17503
- acc[key] = {
17504
- label: providedMapper[key]?.label ?? labelMap?.[key] ?? formatFieldName(key),
17505
- type: "auto",
17506
- visible: true,
17507
- ...providedMapper[key]
17508
- // Sobrescreve com configurações do usuário
17509
- };
17510
- return acc;
17511
- },
17512
- {}
17513
- );
17514
- }
17515
- return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
17516
- }, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
17517
- const { xAxisConfig, mapperConfig } = smartConfig;
17518
- const [activeTooltips, setActiveTooltips] = useState([]);
17519
- const [isDragging, setIsDragging] = useState(null);
17520
- const [dragOffset, setDragOffset] = useState({
17521
- x: 0,
17522
- y: 0
17523
- });
17524
- const [globalTooltipCount, setGlobalTooltipCount] = useState(0);
17525
- const [alignmentGuides, setAlignmentGuides] = useState([]);
17526
- const processedData = data.map((item) => ({
17527
- ...item,
17528
- name: String(item[xAxisConfig.dataKey] || "N/A")
17529
- // Garantir propriedade 'name' para tooltip
17530
- }));
17531
- const generateColors = (dataKeys2) => {
17532
- const colorMap = {};
17533
- const allColors = generateAdditionalColors(colors2, dataKeys2.length);
17534
- dataKeys2.forEach((key, index) => {
17535
- colorMap[key] = allColors[index] || colors2[index % colors2.length];
17536
- });
17537
- return colorMap;
17538
- };
17539
- const dataKeys = Object.keys(mapperConfig);
17540
- const finalColors = generateColors(dataKeys);
17541
- const adaptDataForTooltip2 = (universalData) => {
17542
- return {
17543
- ...universalData,
17544
- name: String(universalData[xAxisConfig.dataKey] || "N/A")
17545
- // Garantir que tem a propriedade 'name'
17546
- };
17547
- };
17548
- const maxDataValue = useMemo(() => {
17549
- let max = 0;
17550
- const keys = Object.keys(mapperConfig);
17551
- for (const row of processedData) {
17552
- const r = row;
17553
- for (const key of keys) {
17554
- const v = r[key];
17555
- if (typeof v === "number" && Number.isFinite(v) && v > max)
17556
- max = v;
17557
- }
17558
- }
17559
- return max;
17560
- }, [processedData, mapperConfig]);
17561
- const niceMax = useMemo(() => {
17562
- let padding2 = 0.08;
17563
- if (maxDataValue > 1e6) padding2 = 0.05;
17564
- if (maxDataValue > 1e7) padding2 = 0.03;
17565
- if (maxDataValue === 0) padding2 = 0.12;
17566
- const padded = maxDataValue * (1 + padding2);
17567
- return niceCeil(padded);
17568
- }, [maxDataValue]);
17569
- const handleBarClick = (data2, index, event) => {
17570
- event.stopPropagation();
17571
- const xAxisValue = data2[xAxisConfig.dataKey] || "N/A";
17572
- const tooltipId = `${xAxisValue}`;
17573
- const rect = event.target.getBoundingClientRect();
17574
- const existingIndex = activeTooltips.findIndex(
17575
- (tooltip) => tooltip.id === tooltipId
17576
- );
17577
- if (existingIndex !== -1) {
17578
- setActiveTooltips(
17579
- (prev) => prev.filter((tooltip) => tooltip.id !== tooltipId)
17580
- );
17581
- } else {
17582
- const newTooltip = {
17583
- id: tooltipId,
17584
- data: data2,
17585
- position: {
17586
- top: rect.top - 10,
17587
- // Posição fixa da viewport
17588
- left: rect.right + 10
17589
- // À direita da barra clicada
17590
- }
17591
- };
17592
- setActiveTooltips((prev) => [...prev, newTooltip]);
17593
- }
17594
- };
17595
- const handleChartClick = () => {
17596
- setActiveTooltips([]);
17597
- };
17598
- const ALIGNMENT_THRESHOLD2 = 25;
17599
- const GUIDE_THRESHOLD2 = 60;
17600
- const STRONG_SNAP_THRESHOLD2 = 35;
17601
- const PRECISION_SNAP_THRESHOLD2 = 8;
17602
- const updateAlignmentGuides = useCallback(
17603
- (draggedTooltipId, currentPosition) => {
17604
- if (!isDragging) return;
17605
- const getAllTooltips = () => {
17606
- const allTooltips2 = [];
17607
- allTooltips2.push(...activeTooltips);
17608
- const globalEvent = new CustomEvent("requestGlobalTooltips", {
17609
- detail: { requesterId: draggedTooltipId, response: allTooltips2 }
17610
- });
17611
- window.dispatchEvent(globalEvent);
17612
- return allTooltips2;
17613
- };
17614
- const allTooltips = getAllTooltips();
17615
- const otherTooltips = allTooltips.filter(
17616
- (t) => t.id !== draggedTooltipId
17617
- );
17618
- const guides = [];
17619
- const tooltipDimensions = { width: 224, height: 120 };
17620
- otherTooltips.forEach((tooltip) => {
17621
- const topDiff = Math.abs(currentPosition.top - tooltip.position.top);
17622
- if (topDiff <= GUIDE_THRESHOLD2) {
17623
- guides.push({
17624
- type: "horizontal",
17625
- position: tooltip.position.top,
17626
- visible: true,
17627
- sourceTooltip: {
17628
- top: currentPosition.top,
17629
- left: currentPosition.left,
17630
- width: tooltipDimensions.width,
17631
- height: tooltipDimensions.height
17632
- },
17633
- targetTooltip: {
17634
- top: tooltip.position.top,
17635
- left: tooltip.position.left,
17636
- width: tooltipDimensions.width,
17637
- height: tooltipDimensions.height
17638
- }
17639
- });
17640
- }
17641
- const leftDiff = Math.abs(currentPosition.left - tooltip.position.left);
17642
- if (leftDiff <= GUIDE_THRESHOLD2) {
17643
- guides.push({
17644
- type: "vertical",
17645
- position: tooltip.position.left,
17646
- visible: true,
17647
- sourceTooltip: {
17648
- top: currentPosition.top,
17649
- left: currentPosition.left,
17650
- width: tooltipDimensions.width,
17651
- height: tooltipDimensions.height
17652
- },
17653
- targetTooltip: {
17654
- top: tooltip.position.top,
17655
- left: tooltip.position.left,
17656
- width: tooltipDimensions.width,
17657
- height: tooltipDimensions.height
17658
- }
17659
- });
17660
- }
17661
- });
17662
- setAlignmentGuides(guides);
17663
- },
17664
- [isDragging, activeTooltips]
17665
- );
17666
- const snapToGuides = useCallback(
17667
- (position) => {
17668
- const snappedPosition = { ...position };
17669
- let hasSnapped = false;
17670
- alignmentGuides.forEach((guide) => {
17671
- if (guide.type === "horizontal") {
17672
- const diff = Math.abs(position.top - guide.position);
17673
- if (diff <= PRECISION_SNAP_THRESHOLD2) {
17674
- snappedPosition.top = guide.position;
17675
- hasSnapped = true;
17676
- }
17677
- } else if (guide.type === "vertical") {
17678
- const diff = Math.abs(position.left - guide.position);
17679
- if (diff <= PRECISION_SNAP_THRESHOLD2) {
17680
- snappedPosition.left = guide.position;
17681
- hasSnapped = true;
17682
- }
17683
- }
17684
- });
17685
- if (!hasSnapped) {
17686
- alignmentGuides.forEach((guide) => {
17687
- if (guide.type === "horizontal") {
17688
- const diff = Math.abs(position.top - guide.position);
17689
- if (diff <= STRONG_SNAP_THRESHOLD2) {
17690
- snappedPosition.top = guide.position;
17691
- }
17692
- } else if (guide.type === "vertical") {
17693
- const diff = Math.abs(position.left - guide.position);
17694
- if (diff <= STRONG_SNAP_THRESHOLD2) {
17695
- snappedPosition.left = guide.position;
17696
- }
17697
- }
17698
- });
17699
- }
17700
- alignmentGuides.forEach((guide) => {
17701
- if (guide.type === "horizontal") {
17702
- const diff = Math.abs(position.top - guide.position);
17703
- if (diff <= ALIGNMENT_THRESHOLD2 && snappedPosition.top === position.top) {
17704
- snappedPosition.top = guide.position;
17705
- }
17706
- } else if (guide.type === "vertical") {
17707
- const diff = Math.abs(position.left - guide.position);
17708
- if (diff <= ALIGNMENT_THRESHOLD2 && snappedPosition.left === position.left) {
17709
- snappedPosition.left = guide.position;
17710
- }
17711
- }
17712
- });
17713
- return snappedPosition;
17714
- },
17715
- [alignmentGuides]
17716
- );
17717
- const handleMouseDown = (e, tooltipId) => {
17718
- e.preventDefault();
17719
- e.stopPropagation();
17720
- const tooltip = activeTooltips.find((t) => t.id === tooltipId);
17721
- if (!tooltip) return;
17722
- const rect = e.currentTarget.getBoundingClientRect();
17723
- const offsetX = e.clientX - rect.left;
17724
- const offsetY = e.clientY - rect.top;
17725
- setIsDragging(tooltipId);
17726
- setDragOffset({ x: offsetX, y: offsetY });
17727
- };
17728
- useEffect(() => {
17729
- let rafId;
17730
- let lastMousePosition = { x: 0, y: 0 };
17731
- const handleGlobalMouseMove = (e) => {
17732
- if (!isDragging) return;
17733
- lastMousePosition = { x: e.clientX, y: e.clientY };
17734
- if (rafId) cancelAnimationFrame(rafId);
17735
- rafId = requestAnimationFrame(() => {
17736
- const newLeft = lastMousePosition.x - dragOffset.x;
17737
- const newTop = lastMousePosition.y - dragOffset.y;
17738
- const rawPosition = {
17739
- top: Math.max(0, Math.min(newTop, window.innerHeight - 200)),
17740
- left: Math.max(0, Math.min(newLeft, window.innerWidth - 250))
17741
- };
17742
- updateAlignmentGuides(isDragging, rawPosition);
17743
- const snappedPosition = snapToGuides(rawPosition);
17744
- setActiveTooltips(
17745
- (prev) => prev.map((tooltip) => {
17746
- if (tooltip.id === isDragging) {
17747
- return {
17748
- ...tooltip,
17749
- position: snappedPosition
17750
- };
17751
- }
17752
- return tooltip;
17753
- })
17754
- );
17755
- });
17756
- };
17757
- const handleGlobalMouseUp = () => {
17758
- if (isDragging) {
17759
- setIsDragging(null);
17760
- setAlignmentGuides([]);
17761
- if (rafId) cancelAnimationFrame(rafId);
17762
- }
17763
- };
17764
- if (isDragging) {
17765
- document.addEventListener("mousemove", handleGlobalMouseMove, {
17766
- passive: true
17767
- });
17768
- document.addEventListener("mouseup", handleGlobalMouseUp);
17769
- document.body.style.cursor = "grabbing";
17770
- document.body.style.userSelect = "none";
17771
- }
17772
- return () => {
17773
- if (rafId) cancelAnimationFrame(rafId);
17774
- document.removeEventListener("mousemove", handleGlobalMouseMove);
17775
- document.removeEventListener("mouseup", handleGlobalMouseUp);
17776
- document.body.style.cursor = "";
17777
- document.body.style.userSelect = "";
17778
- };
17779
- }, [
17780
- isDragging,
17781
- dragOffset,
17782
- alignmentGuides,
17783
- updateAlignmentGuides,
17784
- snapToGuides
17785
- ]);
17786
- useEffect(() => {
17787
- const handleCloseAllTooltips = () => {
17788
- setActiveTooltips([]);
17789
- setGlobalTooltipCount(0);
17790
- };
17791
- window.addEventListener("closeAllTooltips", handleCloseAllTooltips);
17792
- return () => {
17793
- window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
17794
- };
17795
- }, []);
17796
- useEffect(() => {
17797
- const handleTooltipCountRequest = () => {
17798
- window.dispatchEvent(
17799
- new CustomEvent("tooltipCountResponse", {
17800
- detail: { count: activeTooltips.length }
17801
- })
17802
- );
17803
- };
17804
- const handleGlobalTooltipsRequest = (event) => {
17805
- const { detail } = event;
17806
- if (detail && detail.response && detail.requesterId) {
17807
- activeTooltips.forEach((tooltip) => {
17808
- if (!detail.response.find(
17809
- (t) => t.id === tooltip.id
17810
- )) {
17811
- detail.response.push({
17812
- id: tooltip.id,
17813
- position: tooltip.position
17814
- });
17815
- }
17816
- });
17817
- }
17818
- };
17819
- window.addEventListener("requestTooltipCount", handleTooltipCountRequest);
17820
- window.addEventListener(
17821
- "requestGlobalTooltips",
17822
- handleGlobalTooltipsRequest
17823
- );
17824
- return () => {
17825
- window.removeEventListener(
17826
- "requestTooltipCount",
17827
- handleTooltipCountRequest
17828
- );
17829
- window.removeEventListener(
17830
- "requestGlobalTooltips",
17831
- handleGlobalTooltipsRequest
17832
- );
17833
- };
17834
- }, [activeTooltips]);
17835
- useEffect(() => {
17836
- if (isDragging) return;
17837
- let totalCount = 0;
17838
- const handleCountResponse = (event) => {
17839
- const customEvent = event;
17840
- totalCount += customEvent.detail.count;
17841
- };
17842
- window.addEventListener("tooltipCountResponse", handleCountResponse);
17843
- window.dispatchEvent(new CustomEvent("requestTooltipCount"));
17844
- const timeoutId = setTimeout(() => {
17845
- window.removeEventListener("tooltipCountResponse", handleCountResponse);
17846
- setGlobalTooltipCount(totalCount);
17847
- }, 5);
17848
- return () => {
17849
- clearTimeout(timeoutId);
17850
- window.removeEventListener("tooltipCountResponse", handleCountResponse);
17851
- };
17852
- }, [activeTooltips.length, isDragging]);
17853
- const CustomTooltip = ({
17854
- active,
17855
- payload,
17856
- label
17857
- }) => {
17858
- if (!active || !payload) return null;
17859
- return /* @__PURE__ */ jsxs("div", { className: "bg-card border border-border rounded-lg p-3 shadow-lg", children: [
17860
- /* @__PURE__ */ jsx("p", { className: "font-medium text-foreground mb-2", children: label }),
17861
- payload.map(
17862
- (entry, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
17863
- /* @__PURE__ */ jsx(
17864
- "div",
17865
- {
17866
- className: "w-3 h-3 rounded-sm",
17867
- style: { backgroundColor: entry.color }
17868
- }
17869
- ),
17870
- /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
17871
- entry.name,
17872
- ":"
17873
- ] }),
17874
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: entry.value?.toLocaleString("pt-BR") })
17875
- ] }, index)
17876
- ),
17877
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "Clique para fixar este tooltip" })
17878
- ] });
17879
- };
17880
- const getTitleClassName = (position) => {
17881
- const baseClasses = "text-xl font-semibold text-foreground mb-3";
17882
- switch (position) {
17883
- case "center":
17884
- return `${baseClasses} text-center`;
17885
- case "right":
17886
- return `${baseClasses} text-right`;
17887
- default:
17888
- return `${baseClasses} text-left`;
17889
- }
17890
- };
17891
- return /* @__PURE__ */ jsxs(
17892
- "div",
17893
- {
17894
- className: cn("rounded-lg bg-card p-4 relative", className),
17895
- style: {
17896
- width: typeof width === "number" ? `${width + 32}px` : "fit-content",
17897
- maxWidth: "100%"
17898
- },
17899
- children: [
17900
- title && /* @__PURE__ */ jsx("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx("h3", { className: getTitleClassName(titlePosition), children: title }) }),
17901
- /* @__PURE__ */ jsxs(
17902
- BarChart$1,
17903
- {
17904
- data: processedData,
17905
- width: typeof width === "number" ? width : 900,
17906
- height,
17907
- margin: resolveChartMargins(margins, chartMargins, showLabels),
17908
- onClick: handleChartClick,
17909
- children: [
17910
- showGrid && /* @__PURE__ */ jsx(
17911
- CartesianGrid,
17912
- {
17913
- strokeDasharray: "3 3",
17914
- stroke: gridColor || "hsl(var(--muted-foreground))",
17915
- opacity: 0.5
17916
- }
17917
- ),
17918
- /* @__PURE__ */ jsx(
17919
- XAxis,
17920
- {
17921
- dataKey: xAxisConfig.dataKey,
17922
- stroke: "hsl(var(--muted-foreground))",
17923
- fontSize: 12,
17924
- tickLine: false,
17925
- axisLine: false,
17926
- tickFormatter: xAxisConfig.valueFormatter
17927
- }
17928
- ),
17929
- /* @__PURE__ */ jsx(
17930
- YAxis,
17931
- {
17932
- stroke: "hsl(var(--muted-foreground))",
17933
- fontSize: 12,
17934
- tickLine: false,
17935
- axisLine: false,
17936
- tickFormatter: (value) => value.toLocaleString("pt-BR"),
17937
- domain: [0, niceMax],
17938
- tickCount: 6
17939
- }
17940
- ),
17941
- showTooltip && /* @__PURE__ */ jsx(
17942
- Tooltip,
17943
- {
17944
- content: /* @__PURE__ */ jsx(CustomTooltip, {}),
17945
- cursor: { fill: "hsl(var(--muted))", opacity: 0.1 }
17946
- }
17947
- ),
17948
- showLegend && /* @__PURE__ */ jsx(
17949
- Legend,
17950
- {
17951
- wrapperStyle: {
17952
- color: "hsl(var(--foreground))",
17953
- fontSize: "14px"
17954
- }
17955
- }
17956
- ),
17957
- dataKeys.map((key) => {
17958
- const fieldConfig = mapperConfig[key];
17959
- return /* @__PURE__ */ jsx(
17960
- Bar,
17961
- {
17962
- dataKey: key,
17963
- name: fieldConfig?.label || key,
17964
- fill: fieldConfig?.color || finalColors[key],
17965
- radius: [4, 4, 0, 0],
17966
- onClick: handleBarClick,
17967
- style: { cursor: "pointer" },
17968
- activeBar: /* @__PURE__ */ jsx(
17969
- Rectangle,
17970
- {
17971
- fill: finalColors[key],
17972
- stroke: finalColors[key],
17973
- strokeWidth: 2,
17974
- opacity: 0.8
17975
- }
17976
- ),
17977
- children: showLabels && /* @__PURE__ */ jsx(
17978
- LabelList,
17979
- {
17980
- dataKey: key,
17981
- position: "top",
17982
- content: pillLabelRenderer_default(
17983
- finalColors[key] || "#000",
17984
- "filled"
17985
- )
17986
- }
17987
- )
17988
- },
17989
- key
17990
- );
17991
- })
17992
- ]
17993
- }
17994
- ),
17995
- alignmentGuides.map((guide, index) => {
17996
- const isHorizontal = guide.type === "horizontal";
17997
- const color = isHorizontal ? "#3b82f6" : "#ef4444";
17998
- const startX = isHorizontal ? Math.min(
17999
- guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
18000
- guide.targetTooltip.left + guide.targetTooltip.width / 2
18001
- ) : guide.sourceTooltip.left + (isHorizontal ? 0 : guide.sourceTooltip.width / 2);
18002
- const endX = isHorizontal ? Math.max(
18003
- guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
18004
- guide.targetTooltip.left + guide.targetTooltip.width / 2
18005
- ) : guide.targetTooltip.left + (isHorizontal ? 0 : guide.targetTooltip.width / 2);
18006
- const startY = isHorizontal ? guide.sourceTooltip.top + (isHorizontal ? guide.sourceTooltip.height / 2 : 0) : Math.min(
18007
- guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
18008
- guide.targetTooltip.top + guide.targetTooltip.height / 2
18009
- );
18010
- const endY = isHorizontal ? guide.targetTooltip.top + (isHorizontal ? guide.targetTooltip.height / 2 : 0) : Math.max(
18011
- guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
18012
- guide.targetTooltip.top + guide.targetTooltip.height / 2
18013
- );
18014
- return /* @__PURE__ */ jsxs("div", { children: [
18015
- /* @__PURE__ */ jsx(
18016
- "div",
18017
- {
18018
- className: "fixed pointer-events-none z-30",
18019
- style: {
18020
- left: startX,
18021
- top: startY,
18022
- width: isHorizontal ? endX - startX : "2px",
18023
- height: isHorizontal ? "2px" : endY - startY,
18024
- backgroundColor: color,
18025
- boxShadow: `0 0 8px ${color}60`,
18026
- opacity: 0.9,
18027
- borderStyle: "dashed",
18028
- borderWidth: "1px",
18029
- borderColor: color,
18030
- transform: "translateZ(0)"
18031
- }
18032
- }
18033
- ),
18034
- /* @__PURE__ */ jsx(
18035
- "div",
18036
- {
18037
- className: "fixed pointer-events-none z-31",
18038
- style: {
18039
- left: guide.sourceTooltip.left + guide.sourceTooltip.width / 2 - 4,
18040
- top: guide.sourceTooltip.top + guide.sourceTooltip.height / 2 - 4,
18041
- width: "8px",
18042
- height: "8px",
18043
- backgroundColor: color,
18044
- borderRadius: "50%",
18045
- boxShadow: `0 0 4px ${color}80`,
18046
- opacity: 0.8
18047
- }
18048
- }
18049
- ),
18050
- /* @__PURE__ */ jsx(
18051
- "div",
18052
- {
18053
- className: "fixed pointer-events-none z-31",
18054
- style: {
18055
- left: guide.targetTooltip.left + guide.targetTooltip.width / 2 - 4,
18056
- top: guide.targetTooltip.top + guide.targetTooltip.height / 2 - 4,
18057
- width: "8px",
18058
- height: "8px",
18059
- backgroundColor: color,
18060
- borderRadius: "50%",
18061
- boxShadow: `0 0 4px ${color}80`,
18062
- opacity: 0.8
18063
- }
18064
- }
18065
- )
18066
- ] }, index);
18067
- }),
18068
- activeTooltips.map((tooltip, index) => /* @__PURE__ */ jsx(
18069
- DraggableTooltip_default,
18070
- {
18071
- id: tooltip.id,
18072
- data: adaptDataForTooltip2(tooltip.data),
18073
- position: tooltip.position,
18074
- isDragging: isDragging === tooltip.id,
18075
- title,
18076
- dataKeys,
18077
- finalColors,
18078
- onMouseDown: (id, e) => handleMouseDown(e, id),
18079
- onClose: (id) => {
18080
- setActiveTooltips((prev) => prev.filter((t) => t.id !== id));
18081
- },
18082
- periodLabel: "Per\xEDodo Selecionado",
18083
- dataLabel: "Dados do Per\xEDodo",
18084
- showCloseAllButton: index === 0,
18085
- globalTooltipCount,
18086
- onCloseAll: () => {
18087
- window.dispatchEvent(new Event("closeAllTooltips"));
18088
- },
18089
- closeAllButtonPosition: "top-center",
18090
- closeAllButtonVariant: "floating"
18091
- },
18092
- tooltip.id
18093
- ))
18094
- ]
18095
- }
18096
- );
18097
- };
18098
- var BarChart_default = BarChart;
18099
- var defaultData = [
18100
- { name: "A", value: 100 },
18101
- { name: "B", value: 200 },
18102
- { name: "C", value: 150 }
18103
- ];
18104
- var DEFAULT_COLORS4 = ["#55af7d", "#8e68ff", "#2273e1"];
18105
- var CustomLineChart = ({
18106
- data = defaultData,
18107
- className,
18108
- height = 300,
18109
- width = "100%",
18110
- colors: colors2 = DEFAULT_COLORS4,
18111
- gridColor,
18112
- showGrid = true,
18113
- showTooltip = true,
18114
- showLegend = true,
18115
- title,
18116
- titlePosition = "left",
18117
- strokeWidth = 2,
18118
- showDots = true,
18119
- showLabels = false,
18120
- padding,
18121
- margins,
18122
- containerPaddingLeft,
18123
- chartMargins
18124
- }) => {
18125
- const resolvedContainerPaddingLeft = resolveContainerPaddingLeft(
18126
- padding,
18127
- containerPaddingLeft,
18128
- 16
18129
- );
18130
- const [activeTooltips, setActiveTooltips] = useState([]);
18131
- const [isDragging, setIsDragging] = useState(null);
18132
- const [dragOffset, setDragOffset] = useState({
18133
- x: 0,
18134
- y: 0
18135
- });
18136
- const [globalTooltipCount, setGlobalTooltipCount] = useState(0);
18137
- const [alignmentGuides, setAlignmentGuides] = useState([]);
18138
- const generateColors = (dataKeys2) => {
18139
- const colorMap = {};
18140
- const allColors = generateAdditionalColors(colors2, dataKeys2.length);
18141
- dataKeys2.forEach((key, index) => {
18142
- colorMap[key] = allColors[index] || colors2[index % colors2.length];
18143
- });
18144
- return colorMap;
18145
- };
18146
- const dataKeys = useMemo(
18147
- () => data.length > 0 ? Object.keys(data[0]).filter((key) => key !== "name") : [],
18148
- [data]
18149
- );
18150
- const finalColors = generateColors(dataKeys);
18151
- const maxDataValue = useMemo(() => {
18152
- let max = 0;
18153
- for (const row of data) {
18154
- const r = row;
18155
- for (const key of dataKeys) {
18156
- const v = r[key];
18157
- if (typeof v === "number" && Number.isFinite(v) && v > max)
18158
- max = v;
18159
- }
18160
- }
18161
- return max;
18162
- }, [data, dataKeys]);
18163
- const niceMax = useMemo(() => {
18164
- let padding2 = 0.08;
18165
- if (maxDataValue > 1e6) padding2 = 0.05;
18166
- if (maxDataValue > 1e7) padding2 = 0.03;
18167
- if (maxDataValue === 0) padding2 = 0.12;
18168
- const padded = maxDataValue * (1 + padding2);
18169
- return niceCeil(padded);
18170
- }, [maxDataValue]);
18171
- const ClickableDot = (props) => {
18172
- const { cx, cy, payload, dataKey } = props;
18173
- const handleDotClick = (e) => {
18174
- e.stopPropagation();
18175
- if (!payload || !cx || !cy) return;
18176
- const tooltipId = `${payload.name}`;
18177
- const existingIndex = activeTooltips.findIndex(
18178
- (tooltip) => tooltip.id === tooltipId
18179
- );
18180
- if (existingIndex !== -1) {
18181
- setActiveTooltips(
18182
- (prev) => prev.filter((tooltip) => tooltip.id !== tooltipId)
18183
- );
18184
- } else {
18185
- const newTooltip = {
18186
- id: tooltipId,
18187
- data: payload,
18188
- position: {
18189
- top: cy - 50,
18190
- // Posição relativa ao SVG
18191
- left: cx - 100
18192
- }
18193
- };
18194
- setActiveTooltips((prev) => [...prev, newTooltip]);
18195
- }
18196
- };
18197
- return /* @__PURE__ */ jsx(
18198
- "circle",
18199
- {
18200
- cx,
18201
- cy,
18202
- r: 6,
18203
- fill: finalColors[dataKey || ""] || colors2[0],
18204
- stroke: finalColors[dataKey || ""] || colors2[0],
18205
- strokeWidth: 2,
18206
- style: { cursor: "pointer" },
18207
- onClick: handleDotClick
18208
- }
18209
- );
18210
- };
18211
- const handleChartClick = (e) => {
18212
- if (e && e.activePayload && e.activePayload.length > 0) {
18213
- const clickedData = e.activePayload[0].payload;
18214
- const tooltipId = `${clickedData.name}`;
18215
- const existingIndex = activeTooltips.findIndex(
18216
- (tooltip) => tooltip.id === tooltipId
18217
- );
18218
- if (existingIndex !== -1) {
18219
- setActiveTooltips(
18220
- (prev) => prev.filter((tooltip) => tooltip.id !== tooltipId)
18221
- );
18222
- } else {
18223
- const newTooltip = {
18224
- id: tooltipId,
18225
- data: clickedData,
18226
- position: {
18227
- top: (e.chartY || 100) - 10,
18228
- left: (e.chartX || 100) - 100
18229
- }
18230
- };
18231
- setActiveTooltips((prev) => [...prev, newTooltip]);
18232
- }
18233
- }
18234
- };
18235
- const handleChartBackgroundClick = () => {
18236
- setActiveTooltips([]);
18237
- };
18238
- const handleCloseAllTooltips = useCallback(() => {
18239
- window.dispatchEvent(new CustomEvent("closeAllTooltips"));
18240
- }, []);
18241
- const updateAlignmentGuides = useCallback(
18242
- (draggedTooltipId, draggedPosition) => {
18243
- const SNAP_THRESHOLD = 15;
18244
- const draggedTooltip = activeTooltips.find(
18245
- (t) => t.id === draggedTooltipId
18246
- );
18247
- if (!draggedTooltip) return;
18248
- const tooltipWidth = 200;
18249
- const tooltipHeight = 80;
18250
- const globalTooltips = [];
18251
- window.dispatchEvent(
18252
- new CustomEvent("requestGlobalTooltips", {
18253
- detail: { requesterId: draggedTooltipId }
18254
- })
18255
- );
18256
- activeTooltips.forEach((tooltip) => {
18257
- if (tooltip.id !== draggedTooltipId) {
18258
- globalTooltips.push({
18259
- top: tooltip.position.top,
18260
- left: tooltip.position.left,
18261
- width: tooltipWidth,
18262
- height: tooltipHeight,
18263
- id: tooltip.id
18264
- });
18265
- }
18266
- });
18267
- const newGuides = [];
18268
- globalTooltips.forEach((otherTooltip) => {
18269
- const draggedCenter = {
18270
- x: draggedPosition.left + tooltipWidth / 2,
18271
- y: draggedPosition.top + tooltipHeight / 2
18272
- };
18273
- const otherCenter = {
18274
- x: otherTooltip.left + otherTooltip.width / 2,
18275
- y: otherTooltip.top + otherTooltip.height / 2
18276
- };
18277
- const horizontalDistance = Math.abs(draggedCenter.y - otherCenter.y);
18278
- if (horizontalDistance <= SNAP_THRESHOLD) {
18279
- newGuides.push({
18280
- type: "horizontal",
18281
- position: otherCenter.y,
18282
- visible: true,
18283
- sourceTooltip: {
18284
- top: draggedPosition.top,
18285
- left: draggedPosition.left,
18286
- width: tooltipWidth,
18287
- height: tooltipHeight
18288
- },
18289
- targetTooltip: {
18290
- top: otherTooltip.top,
18291
- left: otherTooltip.left,
18292
- width: otherTooltip.width,
18293
- height: otherTooltip.height
18294
- }
18295
- });
18296
- }
18297
- const verticalDistance = Math.abs(draggedCenter.x - otherCenter.x);
18298
- if (verticalDistance <= SNAP_THRESHOLD) {
18299
- newGuides.push({
18300
- type: "vertical",
18301
- position: otherCenter.x,
18302
- visible: true,
18303
- sourceTooltip: {
18304
- top: draggedPosition.top,
18305
- left: draggedPosition.left,
18306
- width: tooltipWidth,
18307
- height: tooltipHeight
18308
- },
18309
- targetTooltip: {
18310
- top: otherTooltip.top,
18311
- left: otherTooltip.left,
18312
- width: otherTooltip.width,
18313
- height: otherTooltip.height
18314
- }
18315
- });
18316
- }
18317
- });
18318
- setAlignmentGuides(newGuides);
18319
- },
18320
- [activeTooltips]
18321
- );
18322
- const snapToGuides = useCallback(
18323
- (position) => {
18324
- const SNAP_DISTANCE = 10;
18325
- const snappedPosition = { ...position };
18326
- alignmentGuides.forEach((guide) => {
18327
- if (guide.type === "horizontal") {
18328
- const tooltipCenter = position.top + 40;
18329
- if (Math.abs(tooltipCenter - guide.position) <= SNAP_DISTANCE) {
18330
- snappedPosition.top = guide.position - 40;
18331
- }
18332
- } else if (guide.type === "vertical") {
18333
- const tooltipCenter = position.left + 100;
18334
- if (Math.abs(tooltipCenter - guide.position) <= SNAP_DISTANCE) {
18335
- snappedPosition.left = guide.position - 100;
18336
- }
18337
- }
18338
- });
18339
- return snappedPosition;
18340
- },
18341
- [alignmentGuides]
18342
- );
18343
- const handleMouseDown = (tooltipId, e) => {
18344
- const rect = e.target.getBoundingClientRect();
18345
- const offsetX = e.clientX - rect.left;
18346
- const offsetY = e.clientY - rect.top;
18347
- setIsDragging(tooltipId);
18348
- setDragOffset({ x: offsetX, y: offsetY });
18349
- };
18350
- useEffect(() => {
18351
- let rafId;
18352
- let lastMousePosition = { x: 0, y: 0 };
18353
- const handleGlobalMouseMove = (e) => {
18354
- if (!isDragging) return;
18355
- lastMousePosition = { x: e.clientX, y: e.clientY };
18356
- if (rafId) cancelAnimationFrame(rafId);
18357
- rafId = requestAnimationFrame(() => {
18358
- const newLeft = lastMousePosition.x - dragOffset.x;
18359
- const newTop = lastMousePosition.y - dragOffset.y;
18360
- let finalPosition = { top: newTop, left: newLeft };
18361
- finalPosition = snapToGuides(finalPosition);
18362
- setActiveTooltips(
18363
- (prev) => prev.map(
18364
- (tooltip) => tooltip.id === isDragging ? { ...tooltip, position: finalPosition } : tooltip
18365
- )
18366
- );
18367
- updateAlignmentGuides(isDragging, finalPosition);
18368
- });
18369
- };
18370
- const handleGlobalMouseUp = () => {
18371
- if (rafId) cancelAnimationFrame(rafId);
18372
- setIsDragging(null);
18373
- setAlignmentGuides([]);
18374
- document.body.style.cursor = "";
18375
- document.body.style.userSelect = "";
18376
- };
18377
- if (isDragging) {
18378
- document.body.style.cursor = "grabbing";
18379
- document.body.style.userSelect = "none";
18380
- window.addEventListener("mousemove", handleGlobalMouseMove);
18381
- window.addEventListener("mouseup", handleGlobalMouseUp);
18382
- }
18383
- return () => {
18384
- if (rafId) cancelAnimationFrame(rafId);
18385
- window.removeEventListener("mousemove", handleGlobalMouseMove);
18386
- window.removeEventListener("mouseup", handleGlobalMouseUp);
18387
- document.body.style.cursor = "";
18388
- document.body.style.userSelect = "";
18389
- };
18390
- }, [
18391
- isDragging,
18392
- dragOffset,
18393
- alignmentGuides,
18394
- updateAlignmentGuides,
18395
- snapToGuides
18396
- ]);
18397
- useEffect(() => {
18398
- const handleCloseAllTooltips2 = () => {
18399
- setActiveTooltips([]);
18400
- setGlobalTooltipCount(0);
18401
- };
18402
- window.addEventListener("closeAllTooltips", handleCloseAllTooltips2);
18403
- return () => {
18404
- window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
18405
- };
18406
- }, []);
18407
- useEffect(() => {
18408
- const handleTooltipCountRequest = () => {
18409
- window.dispatchEvent(
18410
- new CustomEvent("tooltipCountResponse", {
18411
- detail: { count: activeTooltips.length }
18412
- })
18413
- );
18414
- };
18415
- const handleGlobalTooltipsRequest = (event) => {
18416
- const requesterId = event.detail?.requesterId;
18417
- activeTooltips.forEach((tooltip) => {
18418
- if (tooltip.id !== requesterId) {
18419
- window.dispatchEvent(
18420
- new CustomEvent("globalTooltipResponse", {
18421
- detail: {
18422
- tooltip: {
18423
- top: tooltip.position.top,
18424
- left: tooltip.position.left,
18425
- width: 200,
18426
- height: 80,
18427
- id: tooltip.id
18428
- }
18429
- }
18430
- })
18431
- );
18432
- }
18433
- });
18434
- };
18435
- window.addEventListener("requestTooltipCount", handleTooltipCountRequest);
18436
- window.addEventListener(
18437
- "requestGlobalTooltips",
18438
- handleGlobalTooltipsRequest
18439
- );
18440
- return () => {
18441
- window.removeEventListener(
18442
- "requestTooltipCount",
18443
- handleTooltipCountRequest
18444
- );
18445
- window.removeEventListener(
18446
- "requestGlobalTooltips",
18447
- handleGlobalTooltipsRequest
18448
- );
18449
- };
18450
- }, [activeTooltips]);
18451
- useEffect(() => {
18452
- if (isDragging) return;
18453
- let totalCount = 0;
18454
- const handleCountResponse = (event) => {
18455
- const customEvent = event;
18456
- totalCount += customEvent.detail.count;
18457
- };
18458
- window.addEventListener("tooltipCountResponse", handleCountResponse);
18459
- window.dispatchEvent(new CustomEvent("requestTooltipCount"));
18460
- const timeoutId = setTimeout(() => {
18461
- window.removeEventListener("tooltipCountResponse", handleCountResponse);
18462
- setGlobalTooltipCount(totalCount);
18463
- }, 5);
18464
- return () => {
18465
- clearTimeout(timeoutId);
18466
- window.removeEventListener("tooltipCountResponse", handleCountResponse);
18467
- };
18468
- }, [activeTooltips.length, isDragging]);
18469
- const getTitleClass = () => {
18470
- switch (titlePosition) {
18471
- case "center":
18472
- return "text-center";
18473
- case "right":
18474
- return "text-right";
18475
- default:
18476
- return "text-left";
18477
- }
18478
- };
18479
- return /* @__PURE__ */ jsx("div", { className: cn("relative", className), children: /* @__PURE__ */ jsxs(
18480
- "div",
18481
- {
18482
- className: "rounded-lg bg-card p-4 relative border border-border",
18483
- style: {
18484
- width: typeof width === "number" ? `${width + 32}px` : "fit-content",
18485
- maxWidth: "100%"
18486
- },
18487
- onClick: handleChartBackgroundClick,
18488
- children: [
18489
- title && /* @__PURE__ */ jsx("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx("div", { className: cn("mb-4", getTitleClass()), children: /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: title }) }) }),
18490
- /* @__PURE__ */ jsxs(
18491
- LineChart,
18492
- {
18493
- data,
18494
- width: typeof width === "number" ? width : 900,
18495
- height,
18496
- margin: resolveChartMargins(margins, chartMargins, showLabels),
18497
- onClick: handleChartClick,
18498
- children: [
18499
- showGrid && /* @__PURE__ */ jsx(
18500
- CartesianGrid,
18501
- {
18502
- strokeDasharray: "3 3",
18503
- stroke: gridColor || "hsl(var(--muted-foreground))",
18504
- opacity: 0.3
18505
- }
18506
- ),
18507
- /* @__PURE__ */ jsx(
18508
- XAxis,
18509
- {
18510
- dataKey: "name",
18511
- className: "fill-muted-foreground text-xs",
18512
- fontSize: 12
18513
- }
18514
- ),
18515
- /* @__PURE__ */ jsx(
18516
- YAxis,
18517
- {
18518
- className: "fill-muted-foreground text-xs",
18519
- fontSize: 12,
18520
- tickFormatter: (value) => compactTick(Number(value)),
18521
- domain: [0, niceMax],
18522
- tickCount: 6
18523
- }
18524
- ),
18525
- showTooltip && /* @__PURE__ */ jsx(Tooltip, { content: () => null }),
18526
- showLegend && /* @__PURE__ */ jsx(
18527
- Legend,
18528
- {
18529
- wrapperStyle: {
18530
- fontSize: "12px",
18531
- color: "hsl(var(--muted-foreground))"
18532
- }
18533
- }
18534
- ),
18535
- dataKeys.map((key) => /* @__PURE__ */ jsx(
18536
- Line,
18537
- {
18538
- type: "monotone",
18539
- dataKey: key,
18540
- stroke: finalColors[key],
18541
- strokeWidth,
18542
- dot: showDots ? { r: 4, cursor: "pointer" } : false,
18543
- activeDot: (props) => /* @__PURE__ */ jsx(ClickableDot, { ...props, dataKey: key }),
18544
- children: showLabels && /* @__PURE__ */ jsx(
18545
- LabelList,
18546
- {
18547
- dataKey: key,
18548
- position: "top",
18549
- content: pillLabelRenderer_default(
18550
- finalColors[key] || "#000",
18551
- "filled"
18552
- ),
18553
- offset: 14
18554
- }
18555
- )
18556
- },
18557
- key
18558
- ))
18559
- ]
18560
- }
18561
- ),
18562
- alignmentGuides.map((guide, index) => {
18563
- const isHorizontal = guide.type === "horizontal";
18564
- const color = isHorizontal ? "#3b82f6" : "#ef4444";
18565
- const startX = isHorizontal ? Math.min(
18566
- guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
18567
- guide.targetTooltip.left + guide.targetTooltip.width / 2
18568
- ) : guide.sourceTooltip.left + (isHorizontal ? 0 : guide.sourceTooltip.width / 2);
18569
- const endX = isHorizontal ? Math.max(
18570
- guide.sourceTooltip.left + guide.sourceTooltip.width / 2,
18571
- guide.targetTooltip.left + guide.targetTooltip.width / 2
18572
- ) : guide.targetTooltip.left + (isHorizontal ? 0 : guide.targetTooltip.width / 2);
18573
- const startY = isHorizontal ? guide.sourceTooltip.top + (isHorizontal ? guide.sourceTooltip.height / 2 : 0) : Math.min(
18574
- guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
18575
- guide.targetTooltip.top + guide.targetTooltip.height / 2
18576
- );
18577
- const endY = isHorizontal ? guide.targetTooltip.top + (isHorizontal ? guide.targetTooltip.height / 2 : 0) : Math.max(
18578
- guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
18579
- guide.targetTooltip.top + guide.targetTooltip.height / 2
18580
- );
18581
- return /* @__PURE__ */ jsxs("div", { children: [
18582
- /* @__PURE__ */ jsx(
18583
- "div",
18584
- {
18585
- className: "fixed pointer-events-none z-30",
18586
- style: {
18587
- left: startX,
18588
- top: startY,
18589
- width: isHorizontal ? endX - startX : "2px",
18590
- height: isHorizontal ? "2px" : endY - startY,
18591
- backgroundColor: color,
18592
- boxShadow: `0 0 8px ${color}60`,
18593
- opacity: 0.9,
18594
- borderStyle: "dashed",
18595
- borderWidth: "1px",
18596
- borderColor: color,
18597
- transform: "translateZ(0)"
18598
- }
18599
- }
18600
- ),
18601
- /* @__PURE__ */ jsx(
18602
- "div",
18603
- {
18604
- className: "fixed pointer-events-none z-31",
18605
- style: {
18606
- left: guide.sourceTooltip.left + guide.sourceTooltip.width / 2 - 4,
18607
- top: guide.sourceTooltip.top + guide.sourceTooltip.height / 2 - 4,
18608
- width: "8px",
18609
- height: "8px",
18610
- backgroundColor: color,
18611
- borderRadius: "50%",
18612
- boxShadow: `0 0 4px ${color}80`,
18613
- opacity: 0.8
18614
- }
18615
- }
18616
- ),
18617
- /* @__PURE__ */ jsx(
18618
- "div",
18619
- {
18620
- className: "fixed pointer-events-none z-31",
18621
- style: {
18622
- left: guide.targetTooltip.left + guide.targetTooltip.width / 2 - 4,
18623
- top: guide.targetTooltip.top + guide.targetTooltip.height / 2 - 4,
18624
- width: "8px",
18625
- height: "8px",
18626
- backgroundColor: color,
18627
- borderRadius: "50%",
18628
- boxShadow: `0 0 4px ${color}80`,
18629
- opacity: 0.8
18630
- }
18631
- }
18632
- )
18633
- ] }, index);
18634
- }),
18635
- activeTooltips.map((tooltip, index) => /* @__PURE__ */ jsx(
18636
- DraggableTooltip_default,
18637
- {
18638
- id: tooltip.id,
18639
- data: tooltip.data,
18640
- position: tooltip.position,
18641
- isDragging: isDragging === tooltip.id,
18642
- title,
18643
- dataKeys,
18644
- finalColors,
18645
- onMouseDown: (id, e) => handleMouseDown(id, e),
18646
- onClose: (id) => {
18647
- setActiveTooltips((prev) => prev.filter((t) => t.id !== id));
18648
- },
18649
- periodLabel: "Ponto Selecionado",
18650
- dataLabel: "Dados do Ponto",
18651
- showCloseAllButton: index === 0,
18652
- globalTooltipCount,
18653
- onCloseAll: handleCloseAllTooltips,
18654
- closeAllButtonPosition: "top-center",
18655
- closeAllButtonVariant: "floating"
18656
- },
18657
- tooltip.id
18658
- ))
18659
- ]
18660
- }
18661
- ) });
18662
- };
18663
- var LineChart_default = CustomLineChart;
18664
- var defaultData2 = [
18665
- { name: "Vendas", value: 4e3 },
18666
- { name: "Marketing", value: 3e3 },
18667
- { name: "Desenvolvimento", value: 2e3 },
18668
- { name: "Suporte", value: 1e3 },
18669
- { name: "Outros", value: 800 }
18670
- ];
18671
- var DEFAULT_COLORS5 = [
18672
- "#55af7d",
18673
- // verde do projeto
18674
- "#8e68ff",
18675
- // roxo do projeto
18676
- "#2273e1",
18677
- // azul do projeto
18678
- "#f59e0b",
18679
- // amarelo complementar
18680
- "#ef4444",
18681
- // vermelho complementar
18682
- "#8b5cf6",
18683
- // roxo claro
18684
- "#06b6d4",
18685
- // ciano
18686
- "#84cc16"
18687
- // verde lima
18688
- ];
18689
- var RADIAN = Math.PI / 180;
18690
- var renderCustomizedLabel = ({
18691
- cx = 0,
18692
- cy = 0,
18693
- midAngle = 0,
18694
- innerRadius = 0,
18695
- outerRadius = 0,
18696
- percent = 0
18697
- }) => {
18698
- const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
18699
- const x = cx + radius * Math.cos(-midAngle * RADIAN);
18700
- const y = cy + radius * Math.sin(-midAngle * RADIAN);
18701
- return /* @__PURE__ */ jsx(
18702
- "text",
18703
- {
18704
- x,
18705
- y,
18706
- fill: "white",
18707
- textAnchor: x > cx ? "start" : "end",
18708
- dominantBaseline: "central",
18709
- fontSize: 12,
18710
- fontWeight: "600",
18711
- children: `${(percent * 100).toFixed(0)}%`
17597
+ const radius = innerRadius + (outerRadius - innerRadius) * 0.5;
17598
+ const x = cx + radius * Math.cos(-midAngle * RADIAN);
17599
+ const y = cy + radius * Math.sin(-midAngle * RADIAN);
17600
+ return /* @__PURE__ */ jsx(
17601
+ "text",
17602
+ {
17603
+ x,
17604
+ y,
17605
+ fill: "white",
17606
+ textAnchor: x > cx ? "start" : "end",
17607
+ dominantBaseline: "central",
17608
+ fontSize: 12,
17609
+ fontWeight: "600",
17610
+ children: `${(percent * 100).toFixed(0)}%`
18712
17611
  }
18713
17612
  );
18714
17613
  };
18715
17614
  var CustomPieChart = ({
18716
- data = defaultData2,
17615
+ data = defaultData,
18717
17616
  className,
18718
17617
  height = 400,
18719
17618
  width = "100%",
@@ -18726,7 +17625,7 @@ var CustomPieChart = ({
18726
17625
  centerX = "50%",
18727
17626
  centerY = "50%"
18728
17627
  }) => {
18729
- const finalColors = colors2 || DEFAULT_COLORS5;
17628
+ const finalColors = colors2 || DEFAULT_COLORS3;
18730
17629
  return /* @__PURE__ */ jsx("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(PieChart, { children: [
18731
17630
  /* @__PURE__ */ jsx(
18732
17631
  Pie,
@@ -19023,4 +17922,4 @@ function Leaderboard({
19023
17922
  );
19024
17923
  }
19025
17924
 
19026
- export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, BarChart_default as BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart_default as Chart, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LineChart_default as LineChart, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PieChart_default as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useTheme, useTimeSeriesRange, visualForItem };
17925
+ export { AddButton, Agenda, AgendaDaysToShow, AgendaDaysToShowAgenda, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarCombobox, AvatarFallbackBase, AvatarImageBase, BackButton, Badge, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, Brush_default as Brush, ButtonBase, ButtonGroupBase, CENTER_INDEX, CalendarBase, CalendarDndProvider, CalendarDndProviderAgenda, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart_default as Chart, ChartTotalLegend_default as ChartTotalLegend, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton_default as CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DayViewAgenda, DebouncedInput, DefaultEndHour, DefaultEndHourAgenda, DefaultStartHour, DefaultStartHourAgenda, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent2 as DraggableEvent, DraggableTooltip_default as DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, DroppableCellAgenda, EditButton, EndHour, EndHourAgenda, ErrorMessage_default as ErrorMessage, EventAgenda, EventCalendar, EventDialog, EventGap, EventGapAgenda, EventHeight, EventHeightAgenda, EventItem, EventItemAgenda, EventsPopup, FavoriteButton, FileUploader, FilterButton, HideButton, Highlights_default as Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, ITEM_HEIGHT, InputBase, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase_default as LabelBase, Leaderboard, LikeButton, LoadingBase, LockButton, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MonthViewAgenda, MoreButton, MultiCombobox, MultiSelect, MultiSelectBase, MultiSelectContentBase, MultiSelectGroupBase, MultiSelectItemBase, MultiSelectSeparatorBase, MultiSelectTriggerBase, MultiSelectValueBase, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NoData_default as NoData, NotificationButton, NumericInput, PeriodsDropdown_default as PeriodsDropdown, PieChart_default as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, ProgressCirclesBase, ProgressPanelsBase, ProgressSegmentsBase, RangePicker, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectEmpty, SelectGroupBase, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly_default as ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, StartHour, StartHourAgenda, StatusIndicator, SwitchBase, SystemTooltip_default as SystemTooltip, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, ThemeProviderBase, TimePicker, TimePickerInput, TimeSeries_default as TimeSeries, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple_default as TooltipSimple, TooltipTriggerBase, TooltipWithTotal_default as TooltipWithTotal, UndatedEvents, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, VISIBLE_ITEMS, ViewButton, VisibilityButton, WeekCellsHeight, WeekCellsHeightAgenda, WeekView, WeekViewAgenda, adaptDataForTooltip, addHoursToDate, addHoursToDateAgenda, addMinutesToDateAgenda, badgeVariants, buttonVariantsBase, compactTick, computeChartWidth, computeNiceMax, computeYAxisTickWidth, convert12HourTo24Hour, createValueFormatter, createYTickFormatter, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, generateColorMap, getAgendaEventsForDay, getAgendaEventsForDayAgenda, getAllEventsForDay, getAllEventsForDayAgenda, getArrowByType, getBorderRadiusClasses, getBorderRadiusClassesAgenda, getDateByType, getEventColorClasses, getEventColorClassesAgenda, getEventEndDate, getEventStartDate, getEventsForDay, getEventsForDayAgenda, getItems, getMaxDataValue, getMinDataValue, getSpanningEventsForDay, getSpanningEventsForDayAgenda, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isMultiDayEventAgenda, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, normalizeAttendDate, renderInsideBarLabel, pillLabelRenderer_default as renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, sortEventsAgenda, toast, useCalendarDnd, useCalendarDndAgenda, useChartClick, useChartDimensions, useChartHighlights, useChartTooltips, useCurrentTimeIndicator, useCurrentTimeIndicatorAgenda, useDrag, useEventVisibility, useEventVisibilityAgenda, useIsMobile, useTheme, useTimeSeriesRange, visualForItem };