@mlw-packages/react-components 1.5.9 → 1.6.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.js CHANGED
@@ -485,6 +485,7 @@ var require_colors2 = __commonJS({
485
485
  // src/index.ts
486
486
  var index_exports = {};
487
487
  __export(index_exports, {
488
+ AddButton: () => AddButton,
488
489
  AlertDialogActionBase: () => AlertDialogActionBase,
489
490
  AlertDialogBase: () => AlertDialogBase,
490
491
  AlertDialogCancelBase: () => AlertDialogCancelBase,
@@ -499,6 +500,7 @@ __export(index_exports, {
499
500
  AvatarBase: () => AvatarBase,
500
501
  AvatarFallbackBase: () => AvatarFallbackBase,
501
502
  AvatarImageBase: () => AvatarImageBase,
503
+ BackButton: () => BackButton,
502
504
  BadgeBase: () => BadgeBase,
503
505
  BarChart: () => BarChart_default,
504
506
  BreadcrumbBase: () => BreadcrumbBase,
@@ -523,8 +525,10 @@ __export(index_exports, {
523
525
  CarouselNextBase: () => CarouselNextBase,
524
526
  CarouselPrevious: () => CarouselPrevious,
525
527
  Chart: () => Chart_default,
528
+ CheckButton: () => CheckButton,
526
529
  CheckboxBase: () => CheckboxBase,
527
530
  CloseAllButton: () => CloseAllButton_default,
531
+ CloseButton: () => CloseButton,
528
532
  CollapsibleBase: () => CollapsibleBase,
529
533
  CollapsibleContentBase: () => CollapsibleContentBase,
530
534
  CollapsibleTriggerBase: () => CollapsibleTriggerBase,
@@ -553,7 +557,9 @@ __export(index_exports, {
553
557
  ContextMenuSubContentBase: () => ContextMenuSubContentBase,
554
558
  ContextMenuSubTriggerBase: () => ContextMenuSubTriggerBase,
555
559
  ContextMenuTriggerBase: () => ContextMenuTriggerBase,
560
+ CopyButton: () => CopyButton,
556
561
  DateTimePicker: () => DateTimePicker,
562
+ DeleteButton: () => DeleteButton,
557
563
  DestructiveDialog: () => DestructiveDialog,
558
564
  DialogBase: () => DialogBase,
559
565
  DialogCloseBase: () => DialogCloseBase,
@@ -565,6 +571,7 @@ __export(index_exports, {
565
571
  DialogPortalBase: () => DialogPortalBase,
566
572
  DialogTitleBase: () => DialogTitleBase,
567
573
  DialogTriggerBase: () => DialogTriggerBase,
574
+ DownloadButton: () => DownloadButton,
568
575
  DraggableTooltip: () => DraggableTooltip_default,
569
576
  DrawerBase: () => DrawerBase,
570
577
  DrawerCloseBase: () => DrawerCloseBase,
@@ -591,6 +598,11 @@ __export(index_exports, {
591
598
  DropDownMenuSubContentBase: () => DropDownMenuSubContentBase,
592
599
  DropDownMenuSubTriggerBase: () => DropDownMenuSubTriggerBase,
593
600
  DropDownMenuTriggerBase: () => DropDownMenuTriggerBase,
601
+ EditButton: () => EditButton,
602
+ FavoriteButton: () => FavoriteButton,
603
+ FileUploader: () => FileUploader,
604
+ FilterButton: () => FilterButton,
605
+ HideButton: () => HideButton,
594
606
  Highlights: () => Highlights_default,
595
607
  HoverCardBase: () => HoverCardBase,
596
608
  HoverCardContentBase: () => HoverCardContentBase,
@@ -601,9 +613,12 @@ __export(index_exports, {
601
613
  InputOTPSeparatorBase: () => InputOTPSeparatorBase,
602
614
  InputOTPSlotBase: () => InputOTPSlotBase,
603
615
  LabelBase: () => LabelBase_default,
616
+ LikeButton: () => LikeButton,
604
617
  LineChart: () => LineChart_default,
605
618
  LoadingBase: () => LoadingBase,
619
+ LockButton: () => LockButton,
606
620
  ModeToggleBase: () => ModeToggleBase,
621
+ MoreButton: () => MoreButton,
607
622
  MultiCombobox: () => MultiCombobox,
608
623
  NavigationMenuBase: () => NavigationMenuBase,
609
624
  NavigationMenuContentBase: () => NavigationMenuContentBase,
@@ -613,6 +628,7 @@ __export(index_exports, {
613
628
  NavigationMenuListBase: () => NavigationMenuListBase,
614
629
  NavigationMenuTriggerBase: () => NavigationMenuTriggerBase,
615
630
  NavigationMenuViewportBase: () => NavigationMenuViewportBase,
631
+ NotificationButton: () => NotificationButton,
616
632
  PeriodsDropdown: () => PeriodsDropdown_default,
617
633
  PieChart: () => PieChart_default,
618
634
  PopoverAnchorBase: () => PopoverAnchorBase,
@@ -623,8 +639,11 @@ __export(index_exports, {
623
639
  ProgressCirclesBase: () => ProgressCirclesBase,
624
640
  ProgressPanelsBase: () => ProgressPanelsBase,
625
641
  ProgressSegmentsBase: () => ProgressSegmentsBase,
642
+ RefreshButton: () => RefreshButton,
643
+ SaveButton: () => SaveButton,
626
644
  ScrollAreaBase: () => ScrollAreaBase,
627
645
  ScrollBarBase: () => ScrollBarBase,
646
+ SearchButton: () => SearchButton,
628
647
  Select: () => Select,
629
648
  SelectBase: () => SelectBase,
630
649
  SelectContentBase: () => SelectContentBase,
@@ -637,6 +656,7 @@ __export(index_exports, {
637
656
  SelectTriggerBase: () => SelectTriggerBase,
638
657
  SelectValueBase: () => SelectValueBase,
639
658
  SeparatorBase: () => SeparatorBase,
659
+ SettingsButton: () => SettingsButton,
640
660
  SheetBase: () => SheetBase,
641
661
  SheetCloseBase: () => SheetCloseBase,
642
662
  SheetContentBase: () => SheetContentBase,
@@ -697,7 +717,11 @@ __export(index_exports, {
697
717
  TooltipSimple: () => TooltipSimple_default,
698
718
  TooltipTriggerBase: () => TooltipTriggerBase,
699
719
  TooltipWithTotal: () => TooltipWithTotal_default,
720
+ UnlockButton: () => UnlockButton,
721
+ UploadButton: () => UploadButton,
700
722
  UseSideBarBase: () => UseSideBarBase,
723
+ ViewButton: () => ViewButton,
724
+ VisibilityButton: () => VisibilityButton,
701
725
  badgeVariants: () => badgeVariants,
702
726
  buttonVariantsBase: () => buttonVariantsBase,
703
727
  compactTick: () => compactTick,
@@ -741,6 +765,7 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
741
765
  default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
742
766
  destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
743
767
  outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-background dark:border-input dark:hover:bg-background/95",
768
+ select: "box-border border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-background dark:hover:bg-background/95",
744
769
  secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
745
770
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
746
771
  link: "text-primary underline-offset-4 hover:underline"
@@ -749,7 +774,8 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
749
774
  default: "h-9 py-2 px-4 has-[>svg]:px-3",
750
775
  sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
751
776
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
752
- icon: "size-9"
777
+ icon: "size-9",
778
+ select: "h-[34px] py-[7px] px-4 has-[>svg]:px-3"
753
779
  }
754
780
  },
755
781
  defaultVariants: {
@@ -759,7 +785,14 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
759
785
  }
760
786
  );
761
787
  var ButtonBase = React.forwardRef(
762
- ({ className, variant, size, asChild = false, testid = `button-${variant ?? "default"}`, ...props }, ref) => {
788
+ ({
789
+ className,
790
+ variant,
791
+ size,
792
+ asChild = false,
793
+ testid = `button-${variant ?? "default"}`,
794
+ ...props
795
+ }, ref) => {
763
796
  const Comp = asChild ? import_react_slot.Slot : "button";
764
797
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
765
798
  Comp,
@@ -2428,6 +2461,7 @@ PopoverContentBase.displayName = PopoverPrimitive.Content.displayName;
2428
2461
  // src/components/selects/ComboboxBase.tsx
2429
2462
  var import_react10 = require("@phosphor-icons/react");
2430
2463
  var import_react11 = require("react");
2464
+ var import_framer_motion4 = require("framer-motion");
2431
2465
  var import_jsx_runtime19 = require("react/jsx-runtime");
2432
2466
  function ComboboxBase({
2433
2467
  items,
@@ -2453,17 +2487,25 @@ function ComboboxBase({
2453
2487
  children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2454
2488
  ButtonBase,
2455
2489
  {
2456
- variant: "outline",
2490
+ variant: "select",
2491
+ size: "select",
2457
2492
  role: "combobox",
2458
2493
  "aria-expanded": open,
2459
2494
  className: cn(
2460
- "flex items-start gap-2 justify-between",
2495
+ "flex items-center gap-2 justify-between h-auto [&>div]:line-clamp-1 [&>span]:line-clamp-1",
2461
2496
  errorMessage && "border-red-500"
2462
2497
  ),
2463
2498
  "data-testid": testIds.trigger ?? "combobox-trigger",
2464
2499
  children: [
2465
2500
  renderSelected,
2466
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.CaretDownIcon, { size: 16, className: "mt-0.5" })
2501
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2502
+ import_framer_motion4.motion.div,
2503
+ {
2504
+ animate: { rotate: open ? 180 : 0 },
2505
+ transition: { duration: 0.3 },
2506
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react10.CaretDownIcon, { size: 16, className: "mt-0.5 flex-shrink-0" })
2507
+ }
2508
+ )
2467
2509
  ]
2468
2510
  }
2469
2511
  )
@@ -2505,13 +2547,25 @@ function ComboboxBase({
2505
2547
  children: [
2506
2548
  item.label,
2507
2549
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2508
- import_react10.CheckIcon,
2550
+ import_framer_motion4.motion.div,
2509
2551
  {
2510
- className: cn(
2511
- "ml-auto",
2512
- isSelected ? "opacity-100" : "opacity-0"
2513
- ),
2514
- "data-testid": isSelected ? testIds.check ?? "combobox-option-check" : void 0
2552
+ initial: { scale: 0 },
2553
+ animate: { scale: isSelected ? 1 : 0 },
2554
+ transition: {
2555
+ type: "spring",
2556
+ stiffness: 500,
2557
+ damping: 30
2558
+ },
2559
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2560
+ import_react10.CheckIcon,
2561
+ {
2562
+ className: cn(
2563
+ "ml-auto",
2564
+ isSelected ? "opacity-100" : "opacity-0"
2565
+ ),
2566
+ "data-testid": isSelected ? testIds.check ?? "combobox-option-check" : void 0
2567
+ }
2568
+ )
2515
2569
  }
2516
2570
  )
2517
2571
  ]
@@ -2583,6 +2637,7 @@ function Combobox({
2583
2637
  // src/components/selects/MultiCombobox.tsx
2584
2638
  var import_react13 = require("react");
2585
2639
  var import_react14 = require("@phosphor-icons/react");
2640
+ var import_framer_motion5 = require("framer-motion");
2586
2641
  var import_jsx_runtime21 = require("react/jsx-runtime");
2587
2642
  function MultiCombobox({
2588
2643
  items,
@@ -2617,7 +2672,7 @@ function MultiCombobox({
2617
2672
  "span",
2618
2673
  {
2619
2674
  "data-testid": testIds.emptyPlaceholder ?? "combobox-selected-empty",
2620
- className: "text-gray-500",
2675
+ className: "text-gray-500 truncate",
2621
2676
  children: placeholder ?? "Selecione uma op\xE7\xE3o..."
2622
2677
  }
2623
2678
  );
@@ -2626,16 +2681,25 @@ function MultiCombobox({
2626
2681
  "div",
2627
2682
  {
2628
2683
  "data-testid": testIds.selectedWrapper ?? "combobox-selected-wrapper",
2629
- className: "flex w-full flex-wrap gap-2",
2630
- children: selectedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2631
- "div",
2684
+ className: "flex w-full flex-wrap gap-2 overflow-hidden pr-1.5",
2685
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_framer_motion5.AnimatePresence, { mode: "popLayout", children: selectedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2686
+ import_framer_motion5.motion.div,
2632
2687
  {
2633
- className: "flex items-center gap-1 rounded-md border p-1",
2688
+ layout: true,
2689
+ initial: { scale: 0, opacity: 0 },
2690
+ animate: { scale: 1, opacity: 1 },
2691
+ exit: { scale: 0, opacity: 0 },
2692
+ transition: {
2693
+ type: "spring",
2694
+ stiffness: 500,
2695
+ damping: 30
2696
+ },
2697
+ className: "flex items-center justify-between gap-2 my-1 rounded-md border p-1 max-w-full",
2634
2698
  "data-testid": testIds.selectedItem?.(item.value) ?? `combobox-selected-${item.value}`,
2635
2699
  children: [
2636
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "whitespace-break-spaces text-xs", children: item.label }),
2700
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs truncate", children: item.label }),
2637
2701
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2638
- "span",
2702
+ import_framer_motion5.motion.span,
2639
2703
  {
2640
2704
  role: "button",
2641
2705
  tabIndex: 0,
@@ -2643,14 +2707,16 @@ function MultiCombobox({
2643
2707
  e.stopPropagation();
2644
2708
  handleSelection(item.value);
2645
2709
  },
2646
- className: "cursor-pointer p-0 m-0 text-xs flex items-center justify-center hover:text-red-500 hover:scale-110 transition-all",
2710
+ whileHover: { scale: 1.1 },
2711
+ whileTap: { scale: 0.95 },
2712
+ className: "cursor-pointer p-0.5 text-xs flex items-center justify-center hover:text-red-500 transition-colors flex-shrink-0 rounded hover:bg-red-50 ",
2647
2713
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react14.XIcon, { size: 14 })
2648
2714
  }
2649
2715
  )
2650
2716
  ]
2651
2717
  },
2652
2718
  item.value
2653
- ))
2719
+ )) })
2654
2720
  }
2655
2721
  );
2656
2722
  }, [handleSelection, placeholder, selectedItems, testIds]);
@@ -3350,7 +3416,7 @@ ScrollBarBase.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
3350
3416
  var React19 = __toESM(require("react"));
3351
3417
  var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
3352
3418
  var import_react19 = require("@phosphor-icons/react");
3353
- var import_framer_motion4 = require("framer-motion");
3419
+ var import_framer_motion6 = require("framer-motion");
3354
3420
  var import_jsx_runtime30 = require("react/jsx-runtime");
3355
3421
  var SelectBase = SelectPrimitive.Root;
3356
3422
  var SelectGroupBase = SelectPrimitive.Group;
@@ -3367,7 +3433,7 @@ var SelectTriggerBase = React19.forwardRef(({ className, children, open, ...prop
3367
3433
  children: [
3368
3434
  children,
3369
3435
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3370
- import_framer_motion4.motion.span,
3436
+ import_framer_motion6.motion.span,
3371
3437
  {
3372
3438
  animate: { rotate: open ? 180 : 0 },
3373
3439
  transition: { duration: 0.3 },
@@ -3405,43 +3471,51 @@ var SelectScrollDownButtonBase = React19.forwardRef(({ className, ...props }, re
3405
3471
  }
3406
3472
  ));
3407
3473
  SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
3408
- var SelectContentBase = React19.forwardRef(({ className, children, position = "popper", testid: dataTestId = "select-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_framer_motion4.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3409
- SelectPrimitive.Content,
3410
- {
3411
- ref,
3412
- className: cn(
3413
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
3414
- className
3415
- ),
3416
- position,
3417
- "data-testid": dataTestId,
3418
- ...props,
3419
- asChild: true,
3420
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3421
- import_framer_motion4.motion.div,
3422
- {
3423
- initial: { opacity: 0, scale: 0.95 },
3424
- animate: { opacity: 1, scale: 1 },
3425
- exit: { opacity: 0, scale: 0.95 },
3426
- transition: { duration: 0.2 },
3427
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3428
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollUpButtonBase, {}),
3429
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3430
- SelectPrimitive.Viewport,
3431
- {
3432
- className: cn(
3433
- "p-1",
3434
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
3435
- ),
3436
- children
3437
- }
3438
- ),
3439
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollDownButtonBase, {})
3440
- ] })
3441
- }
3442
- )
3443
- }
3444
- ) }) }));
3474
+ var SelectContentBase = React19.forwardRef(
3475
+ ({
3476
+ className,
3477
+ children,
3478
+ position = "popper",
3479
+ testid: dataTestId = "select-content",
3480
+ ...props
3481
+ }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_framer_motion6.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3482
+ SelectPrimitive.Content,
3483
+ {
3484
+ ref,
3485
+ className: cn(
3486
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
3487
+ className
3488
+ ),
3489
+ position,
3490
+ "data-testid": dataTestId,
3491
+ ...props,
3492
+ asChild: true,
3493
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3494
+ import_framer_motion6.motion.div,
3495
+ {
3496
+ initial: { opacity: 0, scale: 0.95 },
3497
+ animate: { opacity: 1, scale: 1 },
3498
+ exit: { opacity: 0, scale: 0.95 },
3499
+ transition: { duration: 0.2 },
3500
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3501
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollUpButtonBase, {}),
3502
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3503
+ SelectPrimitive.Viewport,
3504
+ {
3505
+ className: cn(
3506
+ "p-1",
3507
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
3508
+ ),
3509
+ children
3510
+ }
3511
+ ),
3512
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollDownButtonBase, {})
3513
+ ] })
3514
+ }
3515
+ )
3516
+ }
3517
+ ) }) })
3518
+ );
3445
3519
  SelectContentBase.displayName = SelectPrimitive.Content.displayName;
3446
3520
  var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3447
3521
  SelectPrimitive.Label,
@@ -3452,19 +3526,36 @@ var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @_
3452
3526
  }
3453
3527
  ));
3454
3528
  SelectLabelBase.displayName = SelectPrimitive.Label.displayName;
3455
- var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3529
+ var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3456
3530
  SelectPrimitive.Item,
3457
3531
  {
3458
3532
  ref,
3459
3533
  className: cn(
3460
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3534
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-colors",
3461
3535
  className
3462
3536
  ),
3463
3537
  ...props,
3464
- children: [
3465
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CheckIcon, { className: "h-4 w-4" }) }) }),
3466
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemText, { children })
3467
- ]
3538
+ asChild: true,
3539
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
3540
+ import_framer_motion6.motion.div,
3541
+ {
3542
+ whileHover: { x: 4 },
3543
+ whileTap: { scale: 0.98 },
3544
+ transition: { duration: 0.2 },
3545
+ children: [
3546
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3547
+ import_framer_motion6.motion.div,
3548
+ {
3549
+ initial: { scale: 0 },
3550
+ animate: { scale: 1 },
3551
+ transition: { type: "spring", stiffness: 500, damping: 30 },
3552
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CheckIcon, { className: "h-4 w-4" })
3553
+ }
3554
+ ) }) }),
3555
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemText, { children })
3556
+ ]
3557
+ }
3558
+ )
3468
3559
  }
3469
3560
  ));
3470
3561
  SelectItemBase.displayName = SelectPrimitive.Item.displayName;
@@ -3481,7 +3572,7 @@ SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
3481
3572
  // src/components/ui/SeparatorBase.tsx
3482
3573
  var React20 = __toESM(require("react"));
3483
3574
  var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
3484
- var import_framer_motion5 = require("framer-motion");
3575
+ var import_framer_motion7 = require("framer-motion");
3485
3576
  var import_jsx_runtime31 = require("react/jsx-runtime");
3486
3577
  var SeparatorBase = React20.forwardRef(
3487
3578
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
@@ -3495,7 +3586,7 @@ var SeparatorBase = React20.forwardRef(
3495
3586
  asChild: true,
3496
3587
  ...props,
3497
3588
  children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3498
- import_framer_motion5.motion.div,
3589
+ import_framer_motion7.motion.div,
3499
3590
  {
3500
3591
  className: cn(
3501
3592
  "shrink-0 bg-border",
@@ -4546,7 +4637,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
4546
4637
 
4547
4638
  // src/components/ui/TextAreaBase.tsx
4548
4639
  var React28 = __toESM(require("react"));
4549
- var import_framer_motion6 = require("framer-motion");
4640
+ var import_framer_motion8 = require("framer-motion");
4550
4641
  var import_react23 = require("@phosphor-icons/react");
4551
4642
  var import_jsx_runtime40 = require("react/jsx-runtime");
4552
4643
  var TextAreaBase = React28.forwardRef(
@@ -4627,7 +4718,7 @@ var TextAreaBase = React28.forwardRef(
4627
4718
  onOpenChange: setShowConfirmTooltip,
4628
4719
  children: [
4629
4720
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4630
- import_framer_motion6.motion.button,
4721
+ import_framer_motion8.motion.button,
4631
4722
  {
4632
4723
  type: "button",
4633
4724
  initial: { opacity: 0, scale: 0.8 },
@@ -4691,7 +4782,7 @@ var TextAreaBase = React28.forwardRef(
4691
4782
  }
4692
4783
  ) }),
4693
4784
  /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
4694
- import_framer_motion6.motion.div,
4785
+ import_framer_motion8.motion.div,
4695
4786
  {
4696
4787
  className: "pointer-events-none absolute inset-0 rounded-lg",
4697
4788
  initial: { opacity: 0 },
@@ -4701,7 +4792,7 @@ var TextAreaBase = React28.forwardRef(
4701
4792
  }
4702
4793
  ),
4703
4794
  isFocused && hasContent && props.maxLength && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
4704
- import_framer_motion6.motion.div,
4795
+ import_framer_motion8.motion.div,
4705
4796
  {
4706
4797
  initial: { opacity: 0, y: -10 },
4707
4798
  animate: { opacity: 1, y: 0 },
@@ -4915,7 +5006,7 @@ var import_date_fns = require("date-fns");
4915
5006
  var React30 = __toESM(require("react"));
4916
5007
  var import_react_day_picker2 = require("react-day-picker");
4917
5008
  var import_react27 = require("@phosphor-icons/react");
4918
- var import_framer_motion7 = require("framer-motion");
5009
+ var import_framer_motion9 = require("framer-motion");
4919
5010
  var import_jsx_runtime44 = require("react/jsx-runtime");
4920
5011
  function CalendarBase2({
4921
5012
  className,
@@ -4940,7 +5031,7 @@ function CalendarBase2({
4940
5031
  "rounded-md border bg-background p-4 shadow-lg overflow-hidden w-full h-full flex flex-col",
4941
5032
  className
4942
5033
  ),
4943
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_framer_motion7.AnimatePresence, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5034
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_framer_motion9.AnimatePresence, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4944
5035
  "div",
4945
5036
  {
4946
5037
  className: "w-full h-full flex flex-col",
@@ -5012,7 +5103,7 @@ var import_locale = require("date-fns/locale");
5012
5103
  var import_react30 = require("react");
5013
5104
 
5014
5105
  // src/components/date-time-picker/TimePicker.tsx
5015
- var import_framer_motion8 = require("framer-motion");
5106
+ var import_framer_motion10 = require("framer-motion");
5016
5107
  var React32 = __toESM(require("react"));
5017
5108
 
5018
5109
  // src/components/date-time-picker/TimePickerInput.tsx
@@ -5384,7 +5475,7 @@ function TimePicker({
5384
5475
  visible: { opacity: 1, y: 0 }
5385
5476
  };
5386
5477
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
5387
- import_framer_motion8.motion.div,
5478
+ import_framer_motion10.motion.div,
5388
5479
  {
5389
5480
  variants: containerVariants,
5390
5481
  initial: "hidden",
@@ -5392,7 +5483,7 @@ function TimePicker({
5392
5483
  className: "flex items-end justify-center gap-2 sm:gap-3 p-2 sm:p-3 md:p-4 rounded-lg bg-muted/20 border border-border/50 w-full max-w-full overflow-hidden",
5393
5484
  children: [
5394
5485
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5395
- import_framer_motion8.motion.div,
5486
+ import_framer_motion10.motion.div,
5396
5487
  {
5397
5488
  variants: itemVariants2,
5398
5489
  className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
@@ -5410,7 +5501,7 @@ function TimePicker({
5410
5501
  }
5411
5502
  ),
5412
5503
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5413
- import_framer_motion8.motion.div,
5504
+ import_framer_motion10.motion.div,
5414
5505
  {
5415
5506
  variants: itemVariants2,
5416
5507
  className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
@@ -5428,8 +5519,8 @@ function TimePicker({
5428
5519
  )
5429
5520
  }
5430
5521
  ),
5431
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_framer_motion8.AnimatePresence, { children: !hideSeconds && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5432
- import_framer_motion8.motion.div,
5522
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_framer_motion10.AnimatePresence, { children: !hideSeconds && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_jsx_runtime46.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
5523
+ import_framer_motion10.motion.div,
5433
5524
  {
5434
5525
  variants: itemVariants2,
5435
5526
  initial: "hidden",
@@ -5514,9 +5605,9 @@ function DateTimePicker({
5514
5605
  variant: "outline",
5515
5606
  className: cn(
5516
5607
  "w-full justify-start text-left min-w-0 overflow-hidden",
5517
- "",
5608
+ "text-muted-foreground/90",
5518
5609
  "text-sm sm:text-base",
5519
- !date && "text-muted-foreground"
5610
+ !date && "text-muted-foreground/"
5520
5611
  ),
5521
5612
  children: [
5522
5613
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "truncate flex-1", children: date ? (0, import_date_fns.format)(date, getDisplayFormat(), { locale: import_locale.ptBR }) : "Pick a date" }),
@@ -5619,6 +5710,7 @@ function DateTimePicker({
5619
5710
  }
5620
5711
 
5621
5712
  // src/components/selects/Select.tsx
5713
+ var import_framer_motion11 = require("framer-motion");
5622
5714
  var import_jsx_runtime48 = require("react/jsx-runtime");
5623
5715
  function Select({
5624
5716
  items,
@@ -5629,53 +5721,77 @@ function Select({
5629
5721
  testIds = {}
5630
5722
  }) {
5631
5723
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { "data-testid": testIds.root ?? "select-root", children: [
5632
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(SelectBase, { onValueChange: onChange, "data-testid": testIds.base ?? "select-base", children: [
5633
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5634
- SelectTriggerBase,
5635
- {
5636
- className: cn(
5637
- "flex h-12 w-full content-start text-lg shadow-md",
5638
- errorMessage && "border-red-500"
5639
- ),
5640
- "data-testid": testIds.trigger ?? "select-trigger",
5641
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5642
- SelectValueBase,
5724
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
5725
+ SelectBase,
5726
+ {
5727
+ onValueChange: onChange,
5728
+ "data-testid": testIds.base ?? "select-base",
5729
+ children: [
5730
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5731
+ SelectTriggerBase,
5643
5732
  {
5644
- placeholder,
5645
- "data-testid": testIds.value ?? "select-value"
5733
+ className: cn(
5734
+ "flex h-9 w-full content-start text-lg shadow-md",
5735
+ errorMessage && "border-red-500"
5736
+ ),
5737
+ "data-testid": testIds.trigger ?? "select-trigger",
5738
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5739
+ SelectValueBase,
5740
+ {
5741
+ placeholder,
5742
+ "data-testid": testIds.value ?? "select-value"
5743
+ }
5744
+ )
5646
5745
  }
5647
- )
5648
- }
5649
- ),
5650
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: [
5651
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectLabelBase, { "data-testid": testIds.label ?? "select-label", children: key }),
5652
- groupItems[key].map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5653
- SelectItemBase,
5654
- {
5655
- value: item.value,
5656
- "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5657
- children: item.label
5658
- },
5659
- item.value
5660
- ))
5661
- ] }, key)) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5662
- SelectItemBase,
5663
- {
5664
- value: item.value,
5665
- "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5666
- children: item.label
5667
- },
5668
- item.value
5669
- )) }) }) })
5670
- ] }),
5671
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5672
- "p",
5746
+ ),
5747
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
5748
+ SelectGroupBase,
5749
+ {
5750
+ "data-testid": testIds.group ?? "select-group",
5751
+ children: [
5752
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5753
+ SelectLabelBase,
5754
+ {
5755
+ "data-testid": testIds.label ?? "select-label",
5756
+ children: key
5757
+ }
5758
+ ),
5759
+ groupItems[key].map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5760
+ SelectItemBase,
5761
+ {
5762
+ value: item.value,
5763
+ "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5764
+ children: item.label
5765
+ },
5766
+ item.value
5767
+ ))
5768
+ ]
5769
+ },
5770
+ key
5771
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5772
+ SelectItemBase,
5773
+ {
5774
+ value: item.value,
5775
+ "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5776
+ children: item.label
5777
+ },
5778
+ item.value
5779
+ )) }) }) })
5780
+ ]
5781
+ }
5782
+ ),
5783
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_framer_motion11.AnimatePresence, { children: errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5784
+ import_framer_motion11.motion.p,
5673
5785
  {
5786
+ initial: { opacity: 0, y: -10 },
5787
+ animate: { opacity: 1, y: 0 },
5788
+ exit: { opacity: 0, y: -10 },
5789
+ transition: { duration: 0.2 },
5674
5790
  className: "text-sm text-red-500",
5675
5791
  "data-testid": testIds.error ?? "select-error",
5676
5792
  children: errorMessage
5677
5793
  }
5678
- )
5794
+ ) })
5679
5795
  ] });
5680
5796
  }
5681
5797
 
@@ -5828,7 +5944,7 @@ var import_sonner2 = require("sonner");
5828
5944
 
5829
5945
  // src/components/charts/components/controls/PeriodsDropdown.tsx
5830
5946
  var import_react32 = require("react");
5831
- var import_framer_motion9 = require("framer-motion");
5947
+ var import_framer_motion12 = require("framer-motion");
5832
5948
  var import_ssr = require("@phosphor-icons/react/dist/ssr");
5833
5949
  var import_ssr2 = require("@phosphor-icons/react/dist/ssr");
5834
5950
  var import_jsx_runtime49 = require("react/jsx-runtime");
@@ -5903,8 +6019,8 @@ function PeriodsDropdown({
5903
6019
  ]
5904
6020
  }
5905
6021
  ),
5906
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_framer_motion9.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5907
- import_framer_motion9.motion.div,
6022
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_framer_motion12.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
6023
+ import_framer_motion12.motion.div,
5908
6024
  {
5909
6025
  initial: "hidden",
5910
6026
  animate: "visible",
@@ -5933,7 +6049,7 @@ function PeriodsDropdown({
5933
6049
  className: "flex flex-col p-2 gap-1",
5934
6050
  style: { maxHeight: 200, overflowY: "auto" },
5935
6051
  children: periods.map((p, idx) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5936
- import_framer_motion9.motion.button,
6052
+ import_framer_motion12.motion.button,
5937
6053
  {
5938
6054
  className: "flex items-center justify-between w-full text-left px-3 py-2.5 rounded focus:outline-none transition-colors " + (activePeriods && activePeriods.includes(p) || p === activePeriod ? "bg-accent/10 font-medium" : "hover:bg-accent/15 focus-visible:ring-2 focus-visible:ring-accent/30"),
5939
6055
  variants: itemVariants,
@@ -5961,7 +6077,7 @@ function PeriodsDropdown({
5961
6077
  var PeriodsDropdown_default = PeriodsDropdown;
5962
6078
 
5963
6079
  // src/components/charts/components/controls/ShowOnly.tsx
5964
- var import_framer_motion10 = require("framer-motion");
6080
+ var import_framer_motion13 = require("framer-motion");
5965
6081
  var import_react33 = require("@phosphor-icons/react");
5966
6082
  var import_jsx_runtime50 = require("react/jsx-runtime");
5967
6083
  var ShowOnly = ({
@@ -5972,7 +6088,7 @@ var ShowOnly = ({
5972
6088
  const hasHighlights = highlightedSeriesSize > 0;
5973
6089
  if (!hasHighlights) return null;
5974
6090
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "ml-auto flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5975
- import_framer_motion10.motion.div,
6091
+ import_framer_motion13.motion.div,
5976
6092
  {
5977
6093
  whileTap: { scale: hasHighlights ? 0.985 : 1 },
5978
6094
  whileHover: { y: hasHighlights ? -2 : 0 },
@@ -6005,7 +6121,7 @@ var ShowOnly = ({
6005
6121
  var ShowOnly_default = ShowOnly;
6006
6122
 
6007
6123
  // src/components/charts/components/controls/Highlights.tsx
6008
- var import_framer_motion11 = require("framer-motion");
6124
+ var import_framer_motion14 = require("framer-motion");
6009
6125
  var import_ssr3 = require("@phosphor-icons/react/dist/ssr");
6010
6126
  var import_jsx_runtime51 = require("react/jsx-runtime");
6011
6127
  var Highlights = ({
@@ -6026,13 +6142,13 @@ var Highlights = ({
6026
6142
  visible: { opacity: 1, transition: { staggerChildren: 0.03 } }
6027
6143
  };
6028
6144
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6029
- import_framer_motion11.motion.div,
6145
+ import_framer_motion14.motion.div,
6030
6146
  {
6031
6147
  className: "flex-1 flex items-center gap-2 flex-wrap",
6032
6148
  initial: "hidden",
6033
6149
  animate: "visible",
6034
6150
  variants: containerVariants,
6035
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion11.AnimatePresence, { initial: false, mode: "popLayout", children: allKeys.map((k) => {
6151
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion14.AnimatePresence, { initial: false, mode: "popLayout", children: allKeys.map((k) => {
6036
6152
  const isHighlighted = highlightedSeries.has(k);
6037
6153
  const label = mapperConfig[k]?.label ?? k;
6038
6154
  const color = finalColors[k];
@@ -6042,7 +6158,7 @@ var Highlights = ({
6042
6158
  isHighlighted ? "bg-card/95 border-2 text-foreground shadow-[0_6px_18px_rgba(0,0,0,0.12)]" : "bg-muted/10 border-border text-muted-foreground hover:bg-muted/5"
6043
6159
  );
6044
6160
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6045
- import_framer_motion11.motion.div,
6161
+ import_framer_motion14.motion.div,
6046
6162
  {
6047
6163
  layout: true,
6048
6164
  initial: "hidden",
@@ -6059,7 +6175,7 @@ var Highlights = ({
6059
6175
  style: { minWidth: showFullLabel ? void 0 : 36 },
6060
6176
  "aria-pressed": isHighlighted,
6061
6177
  children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
6062
- import_framer_motion11.motion.button,
6178
+ import_framer_motion14.motion.button,
6063
6179
  {
6064
6180
  whileHover: { scale: isHighlighted ? 1.04 : 1.03 },
6065
6181
  whileTap: { scale: 0.96 },
@@ -6067,7 +6183,7 @@ var Highlights = ({
6067
6183
  className: "flex items-center gap-2 min-w-0 pr-2",
6068
6184
  children: [
6069
6185
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6070
- import_framer_motion11.motion.span,
6186
+ import_framer_motion14.motion.span,
6071
6187
  {
6072
6188
  className: cn("w-3 h-3 rounded-sm flex-shrink-0 border"),
6073
6189
  style: {
@@ -6081,8 +6197,8 @@ var Highlights = ({
6081
6197
  transition: { type: "spring", stiffness: 400, damping: 30 }
6082
6198
  }
6083
6199
  ),
6084
- showFullLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion11.motion.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6085
- import_framer_motion11.motion.span,
6200
+ showFullLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion14.motion.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6201
+ import_framer_motion14.motion.span,
6086
6202
  {
6087
6203
  className: "truncate max-w-[6rem] text-xs pr-2",
6088
6204
  layout: true,
@@ -6090,7 +6206,7 @@ var Highlights = ({
6090
6206
  }
6091
6207
  ) : null,
6092
6208
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
6093
- import_framer_motion11.motion.span,
6209
+ import_framer_motion14.motion.span,
6094
6210
  {
6095
6211
  "aria-hidden": true,
6096
6212
  initial: { opacity: 0, scale: 0.6 },
@@ -6200,7 +6316,7 @@ var CloseAllButton_default = CloseAllButton;
6200
6316
 
6201
6317
  // src/components/charts/components/tooltips/DraggableTooltip.tsx
6202
6318
  var import_react34 = __toESM(require("react"));
6203
- var import_framer_motion12 = require("framer-motion");
6319
+ var import_framer_motion15 = require("framer-motion");
6204
6320
  var import_react35 = require("@phosphor-icons/react");
6205
6321
  var import_ssr5 = require("@phosphor-icons/react/dist/ssr");
6206
6322
  var import_jsx_runtime53 = require("react/jsx-runtime");
@@ -6575,7 +6691,7 @@ var DraggableTooltipComponent = ({
6575
6691
  );
6576
6692
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
6577
6693
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6578
- import_framer_motion12.motion.div,
6694
+ import_framer_motion15.motion.div,
6579
6695
  {
6580
6696
  className: "fixed pointer-events-none z-30",
6581
6697
  variants: guideVariants,
@@ -6597,7 +6713,7 @@ var DraggableTooltipComponent = ({
6597
6713
  }
6598
6714
  ),
6599
6715
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6600
- import_framer_motion12.motion.div,
6716
+ import_framer_motion15.motion.div,
6601
6717
  {
6602
6718
  className: "fixed pointer-events-none z-31",
6603
6719
  variants: guideDotVariants,
@@ -6616,7 +6732,7 @@ var DraggableTooltipComponent = ({
6616
6732
  }
6617
6733
  ),
6618
6734
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6619
- import_framer_motion12.motion.div,
6735
+ import_framer_motion15.motion.div,
6620
6736
  {
6621
6737
  className: "fixed pointer-events-none z-31",
6622
6738
  variants: guideDotVariants,
@@ -6636,8 +6752,8 @@ var DraggableTooltipComponent = ({
6636
6752
  )
6637
6753
  ] }, index);
6638
6754
  }),
6639
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_framer_motion12.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6640
- import_framer_motion12.motion.div,
6755
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_framer_motion15.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
6756
+ import_framer_motion15.motion.div,
6641
6757
  {
6642
6758
  className: "fixed bg-card border border-border rounded-lg shadow-lg z-50 min-w-80 select-none",
6643
6759
  variants: tooltipVariants,
@@ -9152,14 +9268,1143 @@ var useChartHighlights = () => {
9152
9268
  };
9153
9269
  };
9154
9270
 
9271
+ // src/components/ui/SmallButtons.tsx
9272
+ var import_react40 = require("@phosphor-icons/react");
9273
+ var import_jsx_runtime61 = require("react/jsx-runtime");
9274
+ var EditButton = ({
9275
+ disabled,
9276
+ onClick,
9277
+ testid = "button-edit",
9278
+ className,
9279
+ iconSize = 18,
9280
+ iconColor,
9281
+ variant = "default",
9282
+ size = "icon",
9283
+ ...props
9284
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9285
+ ButtonBase,
9286
+ {
9287
+ variant,
9288
+ size,
9289
+ onClick,
9290
+ disabled,
9291
+ testid,
9292
+ className: cn(
9293
+ "transition-all duration-200 ease-in-out group",
9294
+ "hover:scale-105 hover:bg-primary",
9295
+ "active:scale-95",
9296
+ "disabled:hover:scale-100",
9297
+ className
9298
+ ),
9299
+ ...props,
9300
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9301
+ import_react40.PencilSimpleIcon,
9302
+ {
9303
+ size: iconSize,
9304
+ color: iconColor,
9305
+ className: "transition-transform duration-200 group-hover:-rotate-12"
9306
+ }
9307
+ )
9308
+ }
9309
+ );
9310
+ var SaveButton = ({
9311
+ disabled,
9312
+ onClick,
9313
+ testid = "button-save",
9314
+ className,
9315
+ iconSize = 18,
9316
+ iconColor,
9317
+ variant = "default",
9318
+ size = "icon",
9319
+ ...props
9320
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9321
+ ButtonBase,
9322
+ {
9323
+ variant,
9324
+ size,
9325
+ onClick,
9326
+ disabled,
9327
+ testid,
9328
+ className: cn(
9329
+ "transition-all duration-200 ease-in-out group",
9330
+ "hover:scale-105",
9331
+ "active:scale-95",
9332
+ "disabled:hover:scale-100",
9333
+ className
9334
+ ),
9335
+ ...props,
9336
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9337
+ import_react40.FloppyDiskIcon,
9338
+ {
9339
+ size: iconSize,
9340
+ color: iconColor,
9341
+ className: "transition-transform duration-200 group-hover:scale-110"
9342
+ }
9343
+ )
9344
+ }
9345
+ );
9346
+ var AddButton = ({
9347
+ disabled,
9348
+ onClick,
9349
+ testid = "button-add",
9350
+ className,
9351
+ iconSize = 18,
9352
+ iconColor,
9353
+ variant = "default",
9354
+ size = "icon",
9355
+ ...props
9356
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9357
+ ButtonBase,
9358
+ {
9359
+ variant,
9360
+ size,
9361
+ onClick,
9362
+ disabled,
9363
+ testid,
9364
+ className: cn(
9365
+ "transition-all duration-200 ease-in-out",
9366
+ "hover:scale-105",
9367
+ "active:scale-95",
9368
+ "disabled:hover:scale-100",
9369
+ className
9370
+ ),
9371
+ ...props,
9372
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9373
+ import_react40.PlusIcon,
9374
+ {
9375
+ size: iconSize,
9376
+ color: iconColor,
9377
+ className: "transition-transform duration-300"
9378
+ }
9379
+ )
9380
+ }
9381
+ );
9382
+ var CloseButton = ({
9383
+ disabled,
9384
+ onClick,
9385
+ testid = "button-close",
9386
+ className,
9387
+ iconSize = 18,
9388
+ iconColor,
9389
+ variant = "ghost",
9390
+ size = "icon",
9391
+ ...props
9392
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9393
+ ButtonBase,
9394
+ {
9395
+ variant,
9396
+ size,
9397
+ onClick,
9398
+ disabled,
9399
+ testid,
9400
+ className: cn(
9401
+ "transition-all duration-200 ease-in-out",
9402
+ "hover:scale-110 hover:rotate-90 hover:bg-destructive/10",
9403
+ "active:scale-95 active:rotate-0",
9404
+ "disabled:hover:scale-100 disabled:hover:rotate-0",
9405
+ className
9406
+ ),
9407
+ ...props,
9408
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9409
+ import_react40.XIcon,
9410
+ {
9411
+ size: iconSize,
9412
+ color: iconColor,
9413
+ className: "transition-transform duration-300"
9414
+ }
9415
+ )
9416
+ }
9417
+ );
9418
+ var DeleteButton = ({
9419
+ disabled,
9420
+ onClick,
9421
+ testid = "button-delete",
9422
+ className,
9423
+ iconSize = 18,
9424
+ iconColor,
9425
+ variant = "destructive",
9426
+ size = "icon",
9427
+ ...props
9428
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9429
+ ButtonBase,
9430
+ {
9431
+ variant,
9432
+ size,
9433
+ onClick,
9434
+ disabled,
9435
+ testid,
9436
+ className: cn(
9437
+ "transition-all duration-200 ease-in-out group",
9438
+ "hover:scale-105",
9439
+ "active:scale-95",
9440
+ "disabled:hover:scale-100",
9441
+ className
9442
+ ),
9443
+ ...props,
9444
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9445
+ import_react40.TrashIcon,
9446
+ {
9447
+ size: iconSize,
9448
+ color: iconColor,
9449
+ className: "transition-transform duration-200 group-hover:scale-110"
9450
+ }
9451
+ )
9452
+ }
9453
+ );
9454
+ var DownloadButton = ({
9455
+ disabled,
9456
+ onClick,
9457
+ testid = "button-download",
9458
+ ...props
9459
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9460
+ ButtonBase,
9461
+ {
9462
+ variant: "outline",
9463
+ size: "icon",
9464
+ onClick,
9465
+ disabled,
9466
+ testid,
9467
+ className: cn(
9468
+ "transition-all duration-200 ease-in-out group",
9469
+ "hover:scale-105",
9470
+ "active:scale-95",
9471
+ "disabled:hover:scale-100"
9472
+ ),
9473
+ ...props,
9474
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9475
+ import_react40.DownloadSimpleIcon,
9476
+ {
9477
+ size: 18,
9478
+ className: "transition-transform duration-300 group-hover:translate-y-0.5"
9479
+ }
9480
+ )
9481
+ }
9482
+ );
9483
+ var UploadButton = ({
9484
+ disabled,
9485
+ onClick,
9486
+ testid = "button-upload",
9487
+ ...props
9488
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9489
+ ButtonBase,
9490
+ {
9491
+ variant: "outline",
9492
+ size: "icon",
9493
+ onClick,
9494
+ disabled,
9495
+ testid,
9496
+ className: cn(
9497
+ "transition-all duration-200 ease-in-out group",
9498
+ "hover:scale-105",
9499
+ "active:scale-95",
9500
+ "disabled:hover:scale-100"
9501
+ ),
9502
+ ...props,
9503
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9504
+ import_react40.UploadSimpleIcon,
9505
+ {
9506
+ size: 18,
9507
+ className: "transition-transform duration-300 group-hover:-translate-y-0.5"
9508
+ }
9509
+ )
9510
+ }
9511
+ );
9512
+ var CopyButton = ({
9513
+ disabled,
9514
+ onClick,
9515
+ testid = "button-copy",
9516
+ ...props
9517
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9518
+ ButtonBase,
9519
+ {
9520
+ variant: "ghost",
9521
+ size: "icon",
9522
+ onClick,
9523
+ disabled,
9524
+ testid,
9525
+ className: cn(
9526
+ "transition-all duration-200 ease-in-out group",
9527
+ "hover:scale-105",
9528
+ "active:scale-90",
9529
+ "disabled:hover:scale-100"
9530
+ ),
9531
+ ...props,
9532
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9533
+ import_react40.CopyIcon,
9534
+ {
9535
+ size: 18,
9536
+ className: "transition-transform duration-200 group-hover:scale-110"
9537
+ }
9538
+ )
9539
+ }
9540
+ );
9541
+ var RefreshButton = ({
9542
+ disabled,
9543
+ onClick,
9544
+ testid = "button-refresh",
9545
+ ...props
9546
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9547
+ ButtonBase,
9548
+ {
9549
+ variant: "ghost",
9550
+ size: "icon",
9551
+ onClick,
9552
+ disabled,
9553
+ testid,
9554
+ className: cn(
9555
+ "transition-all duration-200 ease-in-out group",
9556
+ "hover:scale-105",
9557
+ "active:scale-95",
9558
+ "disabled:hover:scale-100"
9559
+ ),
9560
+ ...props,
9561
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9562
+ import_react40.ArrowClockwiseIcon,
9563
+ {
9564
+ size: 18,
9565
+ className: "transition-transform duration-500 group-hover:rotate-180"
9566
+ }
9567
+ )
9568
+ }
9569
+ );
9570
+ var SearchButton = ({
9571
+ disabled,
9572
+ onClick,
9573
+ testid = "button-search",
9574
+ ...props
9575
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9576
+ ButtonBase,
9577
+ {
9578
+ variant: "outline",
9579
+ size: "icon",
9580
+ onClick,
9581
+ disabled,
9582
+ testid,
9583
+ className: cn(
9584
+ "transition-all duration-200 ease-in-out group",
9585
+ "hover:scale-105",
9586
+ "active:scale-95",
9587
+ "disabled:hover:scale-100"
9588
+ ),
9589
+ ...props,
9590
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9591
+ import_react40.MagnifyingGlassIcon,
9592
+ {
9593
+ size: 18,
9594
+ className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
9595
+ }
9596
+ )
9597
+ }
9598
+ );
9599
+ var BackButton = ({
9600
+ disabled,
9601
+ onClick,
9602
+ testid = "button-back",
9603
+ ...props
9604
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9605
+ ButtonBase,
9606
+ {
9607
+ variant: "ghost",
9608
+ size: "icon",
9609
+ onClick,
9610
+ disabled,
9611
+ testid,
9612
+ className: cn(
9613
+ "transition-all duration-200 ease-in-out group",
9614
+ "hover:scale-105",
9615
+ "active:scale-95",
9616
+ "disabled:hover:scale-100"
9617
+ ),
9618
+ ...props,
9619
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9620
+ import_react40.ArrowLeftIcon,
9621
+ {
9622
+ size: 18,
9623
+ className: "transition-transform duration-300 group-hover:-translate-x-1"
9624
+ }
9625
+ )
9626
+ }
9627
+ );
9628
+ var SettingsButton = ({
9629
+ disabled,
9630
+ onClick,
9631
+ testid = "button-settings",
9632
+ ...props
9633
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9634
+ ButtonBase,
9635
+ {
9636
+ variant: "ghost",
9637
+ size: "icon",
9638
+ onClick,
9639
+ disabled,
9640
+ testid,
9641
+ className: cn(
9642
+ "transition-all duration-200 ease-in-out group",
9643
+ "hover:scale-105",
9644
+ "active:scale-95",
9645
+ "disabled:hover:scale-100"
9646
+ ),
9647
+ ...props,
9648
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9649
+ import_react40.GearIcon,
9650
+ {
9651
+ size: 18,
9652
+ className: "transition-transform duration-500 group-hover:rotate-90"
9653
+ }
9654
+ )
9655
+ }
9656
+ );
9657
+ var NotificationButton = ({
9658
+ disabled,
9659
+ onClick,
9660
+ testid = "button-notification",
9661
+ ...props
9662
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9663
+ ButtonBase,
9664
+ {
9665
+ variant: "ghost",
9666
+ size: "icon",
9667
+ onClick,
9668
+ disabled,
9669
+ testid,
9670
+ className: cn(
9671
+ "transition-all duration-200 ease-in-out group",
9672
+ "hover:scale-105",
9673
+ "active:scale-95",
9674
+ "disabled:hover:scale-100"
9675
+ ),
9676
+ ...props,
9677
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9678
+ import_react40.BellIcon,
9679
+ {
9680
+ size: 18,
9681
+ className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
9682
+ }
9683
+ )
9684
+ }
9685
+ );
9686
+ var MoreButton = ({
9687
+ disabled,
9688
+ onClick,
9689
+ testid = "button-more",
9690
+ ...props
9691
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9692
+ ButtonBase,
9693
+ {
9694
+ variant: "ghost",
9695
+ size: "icon",
9696
+ onClick,
9697
+ disabled,
9698
+ testid,
9699
+ className: cn(
9700
+ "transition-all duration-200 ease-in-out group",
9701
+ "hover:scale-105",
9702
+ "active:scale-95",
9703
+ "disabled:hover:scale-100"
9704
+ ),
9705
+ ...props,
9706
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9707
+ import_react40.DotsThreeIcon,
9708
+ {
9709
+ size: 18,
9710
+ className: "transition-transform duration-200 group-hover:scale-110"
9711
+ }
9712
+ )
9713
+ }
9714
+ );
9715
+ var CheckButton = ({
9716
+ disabled,
9717
+ onClick,
9718
+ testid = "button-check",
9719
+ ...props
9720
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9721
+ ButtonBase,
9722
+ {
9723
+ variant: "default",
9724
+ size: "icon",
9725
+ onClick,
9726
+ disabled,
9727
+ testid,
9728
+ className: cn(
9729
+ "transition-all duration-200 ease-in-out group",
9730
+ "hover:scale-110",
9731
+ "active:scale-95",
9732
+ "disabled:hover:scale-100"
9733
+ ),
9734
+ ...props,
9735
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9736
+ import_react40.CheckIcon,
9737
+ {
9738
+ size: 18,
9739
+ className: "transition-transform duration-200 group-hover:scale-110"
9740
+ }
9741
+ )
9742
+ }
9743
+ );
9744
+ var FilterButton = ({
9745
+ disabled,
9746
+ onClick,
9747
+ testid = "button-filter",
9748
+ active = false,
9749
+ className,
9750
+ iconSize = 18,
9751
+ iconColor,
9752
+ variant,
9753
+ size = "icon",
9754
+ ...props
9755
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9756
+ ButtonBase,
9757
+ {
9758
+ variant: variant || (active ? "default" : "outline"),
9759
+ size,
9760
+ onClick,
9761
+ disabled,
9762
+ testid,
9763
+ className: cn(
9764
+ "transition-all duration-200 ease-in-out",
9765
+ "hover:scale-105",
9766
+ "active:scale-95",
9767
+ "disabled:hover:scale-100",
9768
+ className
9769
+ ),
9770
+ ...props,
9771
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9772
+ import_react40.FunnelIcon,
9773
+ {
9774
+ size: iconSize,
9775
+ color: iconColor,
9776
+ weight: active ? "fill" : "regular",
9777
+ className: "transition-all duration-200"
9778
+ }
9779
+ )
9780
+ }
9781
+ );
9782
+ var LikeButton = ({
9783
+ disabled,
9784
+ onClick,
9785
+ testid = "button-like",
9786
+ isLiked = false,
9787
+ className,
9788
+ iconSize = 18,
9789
+ iconColor,
9790
+ variant = "ghost",
9791
+ size = "icon",
9792
+ ...props
9793
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9794
+ ButtonBase,
9795
+ {
9796
+ variant,
9797
+ size,
9798
+ onClick,
9799
+ disabled,
9800
+ testid,
9801
+ className: cn(
9802
+ "transition-all duration-200 ease-in-out group",
9803
+ "hover:scale-110",
9804
+ "active:scale-95",
9805
+ "disabled:hover:scale-100",
9806
+ !iconColor && (isLiked ? "text-red-500 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300" : "hover:text-red-500 dark:hover:text-red-400"),
9807
+ className
9808
+ ),
9809
+ ...props,
9810
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9811
+ import_react40.HeartIcon,
9812
+ {
9813
+ size: iconSize,
9814
+ color: iconColor,
9815
+ weight: isLiked ? "fill" : "regular",
9816
+ className: "transition-all duration-300 group-hover:scale-110"
9817
+ }
9818
+ )
9819
+ }
9820
+ );
9821
+ var FavoriteButton = ({
9822
+ disabled,
9823
+ onClick,
9824
+ testid = "button-favorite",
9825
+ isFavorite = false,
9826
+ className,
9827
+ iconSize = 18,
9828
+ iconColor,
9829
+ variant = "ghost",
9830
+ size = "icon",
9831
+ ...props
9832
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9833
+ ButtonBase,
9834
+ {
9835
+ variant,
9836
+ size,
9837
+ onClick,
9838
+ disabled,
9839
+ testid,
9840
+ className: cn(
9841
+ "transition-all duration-200 ease-in-out group",
9842
+ "hover:scale-110",
9843
+ "active:scale-95",
9844
+ "disabled:hover:scale-100",
9845
+ !iconColor && (isFavorite ? "text-yellow-500 dark:text-yellow-400 hover:text-yellow-600 dark:hover:text-yellow-300" : "hover:text-yellow-500 dark:hover:text-yellow-400"),
9846
+ className
9847
+ ),
9848
+ ...props,
9849
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9850
+ import_react40.StarIcon,
9851
+ {
9852
+ size: iconSize,
9853
+ color: iconColor,
9854
+ weight: isFavorite ? "fill" : "regular",
9855
+ className: "transition-all duration-300 group-hover:rotate-12"
9856
+ }
9857
+ )
9858
+ }
9859
+ );
9860
+ var VisibilityButton = ({
9861
+ disabled,
9862
+ onClick,
9863
+ testid = "button-visibility",
9864
+ isVisible = true,
9865
+ className,
9866
+ iconSize = 18,
9867
+ iconColor,
9868
+ variant = "ghost",
9869
+ size = "icon",
9870
+ ...props
9871
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9872
+ ButtonBase,
9873
+ {
9874
+ variant,
9875
+ size,
9876
+ onClick,
9877
+ disabled,
9878
+ testid,
9879
+ className: cn(
9880
+ "transition-all duration-200 ease-in-out",
9881
+ "hover:scale-105",
9882
+ "active:scale-95",
9883
+ "disabled:hover:scale-100",
9884
+ className
9885
+ ),
9886
+ ...props,
9887
+ children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9888
+ import_react40.EyeIcon,
9889
+ {
9890
+ size: iconSize,
9891
+ color: iconColor,
9892
+ className: "transition-opacity duration-200"
9893
+ }
9894
+ ) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9895
+ import_react40.EyeSlashIcon,
9896
+ {
9897
+ size: iconSize,
9898
+ color: iconColor,
9899
+ className: "transition-opacity duration-200"
9900
+ }
9901
+ )
9902
+ }
9903
+ );
9904
+ var ViewButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VisibilityButton, { isVisible: true, testid: "button-view", ...props });
9905
+ var HideButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VisibilityButton, { isVisible: false, testid: "button-hide", ...props });
9906
+ var LockButton = ({
9907
+ disabled,
9908
+ onClick,
9909
+ testid = "button-lock",
9910
+ isLocked = true,
9911
+ className,
9912
+ iconSize = 18,
9913
+ iconColor,
9914
+ variant = "ghost",
9915
+ size = "icon",
9916
+ ...props
9917
+ }) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9918
+ ButtonBase,
9919
+ {
9920
+ variant,
9921
+ size,
9922
+ onClick,
9923
+ disabled,
9924
+ testid,
9925
+ className: cn(
9926
+ "transition-all duration-200 ease-in-out group",
9927
+ "hover:scale-105",
9928
+ "active:scale-95",
9929
+ "disabled:hover:scale-100",
9930
+ !iconColor && (isLocked ? "text-red-500 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300" : "text-emerald-500 dark:text-emerald-400 hover:text-emerald-600 dark:hover:text-emerald-300"),
9931
+ className
9932
+ ),
9933
+ ...props,
9934
+ children: isLocked ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9935
+ import_react40.LockIcon,
9936
+ {
9937
+ size: iconSize,
9938
+ color: iconColor,
9939
+ className: "transition-all duration-200 group-hover:scale-110"
9940
+ }
9941
+ ) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
9942
+ import_react40.LockOpenIcon,
9943
+ {
9944
+ size: iconSize,
9945
+ color: iconColor,
9946
+ className: "transition-all duration-200 group-hover:scale-110"
9947
+ }
9948
+ )
9949
+ }
9950
+ );
9951
+ var UnlockButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(LockButton, { isLocked: false, testid: "button-unlock", ...props });
9952
+
9953
+ // src/components/ui/DebounceInput.tsx
9954
+ var import_react41 = require("react");
9955
+ var import_react42 = require("@phosphor-icons/react");
9956
+ var import_jsx_runtime62 = require("react/jsx-runtime");
9957
+
9958
+ // src/components/ui/FileUploader.tsx
9959
+ var React38 = __toESM(require("react"));
9960
+ var import_framer_motion16 = require("framer-motion");
9961
+ var import_react43 = require("@phosphor-icons/react");
9962
+ var import_jsx_runtime63 = require("react/jsx-runtime");
9963
+ var formatFileSize = (bytes) => {
9964
+ if (bytes === 0) return "0 Bytes";
9965
+ const k = 1024;
9966
+ const sizes = ["Bytes", "KB", "MB", "GB"];
9967
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
9968
+ return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
9969
+ };
9970
+ var getFileExtension = (filename) => {
9971
+ return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
9972
+ };
9973
+ var getFileTypeIcon = (file) => {
9974
+ const extension = getFileExtension(file.name).toLowerCase();
9975
+ const mimeType = file.type.toLowerCase();
9976
+ if (extension === "pdf" || mimeType === "application/pdf") {
9977
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FilePdfIcon, { size: 20, className: "text-red-500" });
9978
+ }
9979
+ if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
9980
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileDocIcon, { size: 20, className: "text-blue-500" });
9981
+ }
9982
+ if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
9983
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileXlsIcon, { size: 20, className: "text-green-500" });
9984
+ }
9985
+ if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
9986
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FilePptIcon, { size: 20, className: "text-orange-500" });
9987
+ }
9988
+ if (extension === "csv" || mimeType === "text/csv") {
9989
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileCsvIcon, { size: 20, className: "text-green-600" });
9990
+ }
9991
+ if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
9992
+ extension
9993
+ ) || mimeType.includes("text")) {
9994
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileTextIcon, { size: 20, className: "text-gray-500" });
9995
+ }
9996
+ if (mimeType.startsWith("image/")) {
9997
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileImageIcon, { size: 20, className: "text-purple-500" });
9998
+ }
9999
+ if (mimeType.startsWith("video/")) {
10000
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileVideoIcon, { size: 20, className: "text-pink-500" });
10001
+ }
10002
+ if (mimeType.startsWith("audio/")) {
10003
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileAudioIcon, { size: 20, className: "text-indigo-500" });
10004
+ }
10005
+ if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
10006
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileZipIcon, { size: 20, className: "text-yellow-600" });
10007
+ }
10008
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileIcon, { size: 20, className: "text-muted-foreground" });
10009
+ };
10010
+ var createImagePreview = (file) => {
10011
+ return new Promise((resolve) => {
10012
+ if (!file.type.startsWith("image/")) {
10013
+ resolve(null);
10014
+ return;
10015
+ }
10016
+ const reader = new FileReader();
10017
+ reader.onload = (e) => {
10018
+ resolve(e.target?.result);
10019
+ };
10020
+ reader.onerror = () => {
10021
+ resolve(null);
10022
+ };
10023
+ reader.readAsDataURL(file);
10024
+ });
10025
+ };
10026
+ var FileUploader = React38.forwardRef(
10027
+ ({
10028
+ className,
10029
+ accept,
10030
+ maxSize,
10031
+ maxFiles = 1,
10032
+ disabled = false,
10033
+ value = [],
10034
+ onValueChange,
10035
+ onUpload,
10036
+ showPreview = true,
10037
+ dropzoneText = "Arraste arquivos aqui ou clique para selecionar",
10038
+ dropzoneSubtext,
10039
+ animate = true,
10040
+ ...props
10041
+ }, ref) => {
10042
+ const [isDragging, setIsDragging] = React38.useState(false);
10043
+ const [files, setFiles] = React38.useState(value);
10044
+ const inputRef = React38.useRef(null);
10045
+ const dragCounterRef = React38.useRef(0);
10046
+ const multiple = maxFiles > 1;
10047
+ React38.useEffect(() => {
10048
+ setFiles(value);
10049
+ }, [value]);
10050
+ React38.useEffect(() => {
10051
+ return () => {
10052
+ files.forEach((file) => {
10053
+ if (file.preview) {
10054
+ URL.revokeObjectURL(file.preview);
10055
+ }
10056
+ });
10057
+ };
10058
+ }, [files]);
10059
+ const validateFile = (file) => {
10060
+ if (file.size > maxSize) {
10061
+ return `Arquivo muito grande. M\xE1ximo: ${formatFileSize(maxSize)}`;
10062
+ }
10063
+ if (accept.length > 0) {
10064
+ const fileExtension = `.${getFileExtension(file.name)}`;
10065
+ const fileType = file.type;
10066
+ const isAccepted = accept.some((acceptItem) => {
10067
+ if (acceptItem.startsWith(".")) {
10068
+ return fileExtension.toLowerCase() === acceptItem.toLowerCase();
10069
+ }
10070
+ if (acceptItem.endsWith("/*")) {
10071
+ return fileType.startsWith(acceptItem.replace("/*", ""));
10072
+ }
10073
+ return fileType === acceptItem;
10074
+ });
10075
+ if (!isAccepted) {
10076
+ return `Tipo de arquivo n\xE3o permitido. Aceitos: ${accept.join(", ")}`;
10077
+ }
10078
+ }
10079
+ return null;
10080
+ };
10081
+ const createFileWithPreview = async (file) => {
10082
+ const fileWithPreview = file;
10083
+ fileWithPreview.id = `${file.name}-${Date.now()}-${Math.random()}`;
10084
+ const error = validateFile(file);
10085
+ if (error) {
10086
+ fileWithPreview.error = error;
10087
+ }
10088
+ if (file.type.startsWith("image/")) {
10089
+ try {
10090
+ const preview = await createImagePreview(file);
10091
+ if (preview) {
10092
+ fileWithPreview.preview = preview;
10093
+ }
10094
+ } catch (error2) {
10095
+ console.warn("Erro ao criar preview da imagem:", error2);
10096
+ }
10097
+ }
10098
+ return fileWithPreview;
10099
+ };
10100
+ const handleFiles = async (newFiles) => {
10101
+ if (disabled) return;
10102
+ const availableSlots = maxFiles - files.length;
10103
+ const filesToAdd = multiple ? newFiles.slice(0, availableSlots) : [newFiles[0]];
10104
+ const filesWithPreview = await Promise.all(
10105
+ filesToAdd.map((file) => createFileWithPreview(file))
10106
+ );
10107
+ const updatedFiles = multiple ? [...files, ...filesWithPreview] : filesWithPreview;
10108
+ setFiles(updatedFiles);
10109
+ onValueChange(updatedFiles);
10110
+ if (onUpload) {
10111
+ const validFiles = filesWithPreview.filter((f) => !f.error);
10112
+ if (validFiles.length > 0) {
10113
+ try {
10114
+ await onUpload(validFiles);
10115
+ } catch (error) {
10116
+ console.error("Erro no upload:", error);
10117
+ }
10118
+ }
10119
+ }
10120
+ };
10121
+ const handleDragEnter = (e) => {
10122
+ e.preventDefault();
10123
+ e.stopPropagation();
10124
+ dragCounterRef.current++;
10125
+ if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
10126
+ setIsDragging(true);
10127
+ }
10128
+ };
10129
+ const handleDragLeave = (e) => {
10130
+ e.preventDefault();
10131
+ e.stopPropagation();
10132
+ dragCounterRef.current--;
10133
+ if (dragCounterRef.current === 0) {
10134
+ setIsDragging(false);
10135
+ }
10136
+ };
10137
+ const handleDragOver = (e) => {
10138
+ e.preventDefault();
10139
+ e.stopPropagation();
10140
+ };
10141
+ const handleDrop = (e) => {
10142
+ e.preventDefault();
10143
+ e.stopPropagation();
10144
+ setIsDragging(false);
10145
+ dragCounterRef.current = 0;
10146
+ if (disabled) return;
10147
+ const droppedFiles = Array.from(e.dataTransfer.files);
10148
+ handleFiles(droppedFiles);
10149
+ };
10150
+ const handleInputChange = (e) => {
10151
+ if (e.target.files) {
10152
+ const selectedFiles = Array.from(e.target.files);
10153
+ handleFiles(selectedFiles);
10154
+ }
10155
+ };
10156
+ const handleRemoveFile = (fileId) => {
10157
+ const fileToRemove = files.find((f) => f.id === fileId);
10158
+ if (fileToRemove?.preview) {
10159
+ URL.revokeObjectURL(fileToRemove.preview);
10160
+ }
10161
+ const updatedFiles = files.filter((f) => f.id !== fileId);
10162
+ setFiles(updatedFiles);
10163
+ onValueChange(updatedFiles);
10164
+ };
10165
+ const handleClick = () => {
10166
+ if (!disabled) {
10167
+ inputRef.current?.click();
10168
+ }
10169
+ };
10170
+ const acceptString = accept.join(",");
10171
+ const defaultSubtext = dropzoneSubtext || `Formatos: ${accept.join(", ")}. M\xE1ximo: ${formatFileSize(maxSize)}`;
10172
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
10173
+ import_framer_motion16.motion.div,
10174
+ {
10175
+ className: cn(
10176
+ "relative flex cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-10 transition-all duration-300 dark:shadow-black/20",
10177
+ isDragging && "border-primary bg-primary/10 scale-[1.02]",
10178
+ !isDragging && "border-border hover:border-primary/60 hover:bg-muted/50",
10179
+ disabled && "cursor-not-allowed opacity-50 hover:scale-100"
10180
+ ),
10181
+ onDragEnter: handleDragEnter,
10182
+ onDragOver: handleDragOver,
10183
+ onDragLeave: handleDragLeave,
10184
+ onDrop: handleDrop,
10185
+ onClick: handleClick,
10186
+ whileHover: !disabled ? { scale: 1.01 } : void 0,
10187
+ whileTap: !disabled ? { scale: 0.99 } : void 0,
10188
+ animate: isDragging ? {
10189
+ borderColor: `hsl(var(--primary))`,
10190
+ backgroundColor: `hsl(var(--primary) / 0.1)`,
10191
+ scale: 1.02
10192
+ } : {
10193
+ borderColor: `hsl(var(--border))`,
10194
+ backgroundColor: `hsl(var(--background))`,
10195
+ scale: 1
10196
+ },
10197
+ transition: {
10198
+ type: "spring",
10199
+ stiffness: 300,
10200
+ damping: 25,
10201
+ duration: 0.3
10202
+ },
10203
+ children: [
10204
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10205
+ "input",
10206
+ {
10207
+ ref: inputRef,
10208
+ type: "file",
10209
+ className: "hidden",
10210
+ accept: acceptString,
10211
+ multiple,
10212
+ disabled,
10213
+ onChange: handleInputChange
10214
+ }
10215
+ ),
10216
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10217
+ import_framer_motion16.motion.div,
10218
+ {
10219
+ animate: isDragging ? { scale: 1.2, rotate: 10 } : { scale: 1, rotate: 0 },
10220
+ transition: {
10221
+ type: "spring",
10222
+ stiffness: 300,
10223
+ damping: 20,
10224
+ duration: 0.3
10225
+ },
10226
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10227
+ import_framer_motion16.motion.div,
10228
+ {
10229
+ className: cn(
10230
+ "mb-4 h-16 w-16 text-muted-foreground transition-colors duration-300 drop-shadow-lg flex items-center justify-center",
10231
+ isDragging && "text-primary"
10232
+ ),
10233
+ initial: false,
10234
+ animate: {
10235
+ color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
10236
+ },
10237
+ transition: { duration: 0.3 },
10238
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.CloudArrowUpIcon, { size: 64 })
10239
+ }
10240
+ )
10241
+ }
10242
+ ),
10243
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10244
+ import_framer_motion16.motion.p,
10245
+ {
10246
+ className: "mb-2 text-base font-semibold text-foreground",
10247
+ initial: animate ? { opacity: 0, y: -10 } : false,
10248
+ animate: { opacity: 1, y: 0 },
10249
+ transition: { delay: 0.1 },
10250
+ children: dropzoneText
10251
+ }
10252
+ ),
10253
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10254
+ import_framer_motion16.motion.p,
10255
+ {
10256
+ className: "text-sm text-muted-foreground",
10257
+ initial: animate ? { opacity: 0, y: -10 } : false,
10258
+ animate: { opacity: 1, y: 0 },
10259
+ transition: { delay: 0.2 },
10260
+ children: defaultSubtext
10261
+ }
10262
+ ),
10263
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion16.AnimatePresence, { children: files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
10264
+ import_framer_motion16.motion.div,
10265
+ {
10266
+ initial: { opacity: 0, scale: 0.8, y: 10 },
10267
+ animate: {
10268
+ opacity: 1,
10269
+ scale: 1,
10270
+ y: 0,
10271
+ backgroundColor: `hsl(var(--primary) / 0.1)`,
10272
+ borderColor: `hsl(var(--primary) / 0.2)`
10273
+ },
10274
+ exit: { opacity: 0, scale: 0.8, y: 10 },
10275
+ className: cn(
10276
+ "mt-4 flex items-center gap-2 rounded-full border px-4 py-2 backdrop-blur-sm bg-primary/20 border-primary/30 shadow-lg"
10277
+ ),
10278
+ transition: { duration: 0.3 },
10279
+ children: [
10280
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.CheckIcon, { size: 16, className: "text-emerald-500" }) }),
10281
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
10282
+ import_framer_motion16.motion.span,
10283
+ {
10284
+ className: "text-sm font-semibold text-primary",
10285
+ animate: { color: `hsl(var(--primary))` },
10286
+ transition: { duration: 0.3 },
10287
+ children: [
10288
+ files.length,
10289
+ " ",
10290
+ files.length === 1 ? "arquivo selecionado" : "arquivos selecionados"
10291
+ ]
10292
+ }
10293
+ )
10294
+ ]
10295
+ }
10296
+ ) }),
10297
+ showPreview && files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10298
+ import_framer_motion16.motion.div,
10299
+ {
10300
+ className: "mt-6 w-full",
10301
+ initial: animate ? { opacity: 0, y: 10 } : false,
10302
+ animate: { opacity: 1, y: 0 },
10303
+ transition: { delay: 0.3 },
10304
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { children: [
10305
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("h4", { className: "mb-3 text-sm font-medium text-muted-foreground", children: [
10306
+ "Arquivos selecionados (",
10307
+ files.length,
10308
+ "/",
10309
+ maxFiles,
10310
+ ")"
10311
+ ] }),
10312
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "space-y-2 overflow-y-auto max-h-44", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion16.AnimatePresence, { mode: "popLayout", children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
10313
+ import_framer_motion16.motion.div,
10314
+ {
10315
+ layout: true,
10316
+ initial: animate ? { opacity: 0, x: -20 } : false,
10317
+ animate: { opacity: 1, x: 0 },
10318
+ exit: {
10319
+ opacity: 0,
10320
+ x: -20,
10321
+ transition: { duration: 0.2 }
10322
+ },
10323
+ transition: {
10324
+ delay: animate ? index * 0.05 : 0,
10325
+ layout: { duration: 0.2 }
10326
+ },
10327
+ className: cn(
10328
+ "flex items-center gap-3 rounded-md border p-3 transition-all duration-300",
10329
+ file.error ? "border-destructive/50 bg-destructive/5" : "border-border bg-background/80 hover:bg-muted/50 hover:shadow-md hover:shadow-primary/10 hover:border-primary/30"
10330
+ ),
10331
+ children: [
10332
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-muted overflow-hidden", children: file.preview ? (
10333
+ // Preview de imagem
10334
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10335
+ "img",
10336
+ {
10337
+ src: file.preview,
10338
+ alt: file.name,
10339
+ className: "h-full w-full object-cover rounded-md"
10340
+ }
10341
+ )
10342
+ ) : (
10343
+ // Ícone baseado no tipo de arquivo
10344
+ getFileTypeIcon(file)
10345
+ ) }),
10346
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "min-w-0 flex-1", children: [
10347
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10348
+ "p",
10349
+ {
10350
+ className: "truncate text-sm font-medium text-foreground",
10351
+ title: `${file.name} (${file.type || "Tipo desconhecido"})`,
10352
+ children: file.name
10353
+ }
10354
+ ),
10355
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
10356
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: formatFileSize(file.size) }),
10357
+ file.type && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
10358
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: "\u2022" }),
10359
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "uppercase", children: getFileExtension(file.name) })
10360
+ ] })
10361
+ ] }),
10362
+ file.error && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10363
+ import_framer_motion16.motion.p,
10364
+ {
10365
+ className: "mt-1 text-xs text-destructive",
10366
+ initial: { opacity: 0, y: -5 },
10367
+ animate: { opacity: 1, y: 0 },
10368
+ children: file.error
10369
+ }
10370
+ )
10371
+ ] }),
10372
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
10373
+ DeleteButton,
10374
+ {
10375
+ type: "button",
10376
+ variant: "destructive",
10377
+ size: "icon",
10378
+ onClick: (e) => {
10379
+ e?.stopPropagation();
10380
+ handleRemoveFile(file.id);
10381
+ },
10382
+ className: "",
10383
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.XIcon, { size: 12 })
10384
+ }
10385
+ )
10386
+ ]
10387
+ },
10388
+ file.id
10389
+ )) }) })
10390
+ ] })
10391
+ }
10392
+ )
10393
+ ]
10394
+ }
10395
+ ) });
10396
+ }
10397
+ );
10398
+ FileUploader.displayName = "FileUploader";
10399
+
9155
10400
  // src/hooks/use-drag.tsx
9156
- var import_react40 = require("react");
10401
+ var import_react44 = require("react");
9157
10402
  var useDrag = (options = {}) => {
9158
- const [isDragging, setIsDragging] = (0, import_react40.useState)(null);
9159
- const [positions, setPositions] = (0, import_react40.useState)({});
9160
- const dragStartPos = (0, import_react40.useRef)(null);
9161
- const dragId = (0, import_react40.useRef)(null);
9162
- const handleMouseDown = (0, import_react40.useCallback)((id, e) => {
10403
+ const [isDragging, setIsDragging] = (0, import_react44.useState)(null);
10404
+ const [positions, setPositions] = (0, import_react44.useState)({});
10405
+ const dragStartPos = (0, import_react44.useRef)(null);
10406
+ const dragId = (0, import_react44.useRef)(null);
10407
+ const handleMouseDown = (0, import_react44.useCallback)((id, e) => {
9163
10408
  e.preventDefault();
9164
10409
  const currentPosition = positions[id] || { top: 0, left: 0 };
9165
10410
  dragStartPos.current = {
@@ -9172,7 +10417,7 @@ var useDrag = (options = {}) => {
9172
10417
  setIsDragging(id);
9173
10418
  options.onDragStart?.(id);
9174
10419
  }, [positions, options]);
9175
- const handleMouseMove = (0, import_react40.useCallback)((e) => {
10420
+ const handleMouseMove = (0, import_react44.useCallback)((e) => {
9176
10421
  if (!isDragging || !dragStartPos.current || !dragId.current) return;
9177
10422
  const deltaX = e.clientX - dragStartPos.current.x;
9178
10423
  const deltaY = e.clientY - dragStartPos.current.y;
@@ -9188,7 +10433,7 @@ var useDrag = (options = {}) => {
9188
10433
  }));
9189
10434
  options.onDrag?.(dragId.current, newPosition);
9190
10435
  }, [isDragging, options]);
9191
- const handleMouseUp = (0, import_react40.useCallback)(() => {
10436
+ const handleMouseUp = (0, import_react44.useCallback)(() => {
9192
10437
  if (dragId.current) {
9193
10438
  options.onDragEnd?.(dragId.current);
9194
10439
  }
@@ -9196,7 +10441,7 @@ var useDrag = (options = {}) => {
9196
10441
  dragStartPos.current = null;
9197
10442
  dragId.current = null;
9198
10443
  }, [options]);
9199
- (0, import_react40.useEffect)(() => {
10444
+ (0, import_react44.useEffect)(() => {
9200
10445
  if (isDragging) {
9201
10446
  document.addEventListener("mousemove", handleMouseMove);
9202
10447
  document.addEventListener("mouseup", handleMouseUp);
@@ -9208,16 +10453,16 @@ var useDrag = (options = {}) => {
9208
10453
  };
9209
10454
  }
9210
10455
  }, [isDragging, handleMouseMove, handleMouseUp]);
9211
- const setPosition = (0, import_react40.useCallback)((id, position) => {
10456
+ const setPosition = (0, import_react44.useCallback)((id, position) => {
9212
10457
  setPositions((prev) => ({
9213
10458
  ...prev,
9214
10459
  [id]: position
9215
10460
  }));
9216
10461
  }, []);
9217
- const getPosition = (0, import_react40.useCallback)((id) => {
10462
+ const getPosition = (0, import_react44.useCallback)((id) => {
9218
10463
  return positions[id] || { top: 0, left: 0 };
9219
10464
  }, [positions]);
9220
- const isElementDragging = (0, import_react40.useCallback)((id) => {
10465
+ const isElementDragging = (0, import_react44.useCallback)((id) => {
9221
10466
  return isDragging === id;
9222
10467
  }, [isDragging]);
9223
10468
  return {