@mlw-packages/react-components 1.5.9 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +260 -20
- package/dist/index.d.mts +126 -20
- package/dist/index.d.ts +126 -20
- package/dist/index.js +1745 -178
- package/dist/index.mjs +1776 -170
- package/package.json +3 -2
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,
|
|
@@ -522,9 +524,12 @@ __export(index_exports, {
|
|
|
522
524
|
CarouselItemBase: () => CarouselItemBase,
|
|
523
525
|
CarouselNextBase: () => CarouselNextBase,
|
|
524
526
|
CarouselPrevious: () => CarouselPrevious,
|
|
527
|
+
ChangeButton: () => ChangeButton,
|
|
525
528
|
Chart: () => Chart_default,
|
|
529
|
+
CheckButton: () => CheckButton,
|
|
526
530
|
CheckboxBase: () => CheckboxBase,
|
|
527
531
|
CloseAllButton: () => CloseAllButton_default,
|
|
532
|
+
CloseButton: () => CloseButton,
|
|
528
533
|
CollapsibleBase: () => CollapsibleBase,
|
|
529
534
|
CollapsibleContentBase: () => CollapsibleContentBase,
|
|
530
535
|
CollapsibleTriggerBase: () => CollapsibleTriggerBase,
|
|
@@ -553,7 +558,9 @@ __export(index_exports, {
|
|
|
553
558
|
ContextMenuSubContentBase: () => ContextMenuSubContentBase,
|
|
554
559
|
ContextMenuSubTriggerBase: () => ContextMenuSubTriggerBase,
|
|
555
560
|
ContextMenuTriggerBase: () => ContextMenuTriggerBase,
|
|
561
|
+
CopyButton: () => CopyButton,
|
|
556
562
|
DateTimePicker: () => DateTimePicker,
|
|
563
|
+
DeleteButton: () => DeleteButton,
|
|
557
564
|
DestructiveDialog: () => DestructiveDialog,
|
|
558
565
|
DialogBase: () => DialogBase,
|
|
559
566
|
DialogCloseBase: () => DialogCloseBase,
|
|
@@ -565,6 +572,7 @@ __export(index_exports, {
|
|
|
565
572
|
DialogPortalBase: () => DialogPortalBase,
|
|
566
573
|
DialogTitleBase: () => DialogTitleBase,
|
|
567
574
|
DialogTriggerBase: () => DialogTriggerBase,
|
|
575
|
+
DownloadButton: () => DownloadButton,
|
|
568
576
|
DraggableTooltip: () => DraggableTooltip_default,
|
|
569
577
|
DrawerBase: () => DrawerBase,
|
|
570
578
|
DrawerCloseBase: () => DrawerCloseBase,
|
|
@@ -591,6 +599,11 @@ __export(index_exports, {
|
|
|
591
599
|
DropDownMenuSubContentBase: () => DropDownMenuSubContentBase,
|
|
592
600
|
DropDownMenuSubTriggerBase: () => DropDownMenuSubTriggerBase,
|
|
593
601
|
DropDownMenuTriggerBase: () => DropDownMenuTriggerBase,
|
|
602
|
+
EditButton: () => EditButton,
|
|
603
|
+
FavoriteButton: () => FavoriteButton,
|
|
604
|
+
FileUploader: () => FileUploader,
|
|
605
|
+
FilterButton: () => FilterButton,
|
|
606
|
+
HideButton: () => HideButton,
|
|
594
607
|
Highlights: () => Highlights_default,
|
|
595
608
|
HoverCardBase: () => HoverCardBase,
|
|
596
609
|
HoverCardContentBase: () => HoverCardContentBase,
|
|
@@ -601,9 +614,22 @@ __export(index_exports, {
|
|
|
601
614
|
InputOTPSeparatorBase: () => InputOTPSeparatorBase,
|
|
602
615
|
InputOTPSlotBase: () => InputOTPSlotBase,
|
|
603
616
|
LabelBase: () => LabelBase_default,
|
|
617
|
+
LikeButton: () => LikeButton,
|
|
604
618
|
LineChart: () => LineChart_default,
|
|
605
619
|
LoadingBase: () => LoadingBase,
|
|
620
|
+
LockButton: () => LockButton,
|
|
621
|
+
ModalBase: () => ModalBase,
|
|
622
|
+
ModalCloseBase: () => ModalCloseBase,
|
|
623
|
+
ModalContentBase: () => ModalContentBase,
|
|
624
|
+
ModalDescriptionBase: () => ModalDescriptionBase,
|
|
625
|
+
ModalFooterBase: () => ModalFooterBase,
|
|
626
|
+
ModalHeaderBase: () => ModalHeaderBase,
|
|
627
|
+
ModalOverlayBase: () => ModalOverlayBase,
|
|
628
|
+
ModalPortalBase: () => ModalPortalBase,
|
|
629
|
+
ModalTitleBase: () => ModalTitleBase,
|
|
630
|
+
ModalTriggerBase: () => ModalTriggerBase,
|
|
606
631
|
ModeToggleBase: () => ModeToggleBase,
|
|
632
|
+
MoreButton: () => MoreButton,
|
|
607
633
|
MultiCombobox: () => MultiCombobox,
|
|
608
634
|
NavigationMenuBase: () => NavigationMenuBase,
|
|
609
635
|
NavigationMenuContentBase: () => NavigationMenuContentBase,
|
|
@@ -613,6 +639,7 @@ __export(index_exports, {
|
|
|
613
639
|
NavigationMenuListBase: () => NavigationMenuListBase,
|
|
614
640
|
NavigationMenuTriggerBase: () => NavigationMenuTriggerBase,
|
|
615
641
|
NavigationMenuViewportBase: () => NavigationMenuViewportBase,
|
|
642
|
+
NotificationButton: () => NotificationButton,
|
|
616
643
|
PeriodsDropdown: () => PeriodsDropdown_default,
|
|
617
644
|
PieChart: () => PieChart_default,
|
|
618
645
|
PopoverAnchorBase: () => PopoverAnchorBase,
|
|
@@ -623,8 +650,11 @@ __export(index_exports, {
|
|
|
623
650
|
ProgressCirclesBase: () => ProgressCirclesBase,
|
|
624
651
|
ProgressPanelsBase: () => ProgressPanelsBase,
|
|
625
652
|
ProgressSegmentsBase: () => ProgressSegmentsBase,
|
|
653
|
+
RefreshButton: () => RefreshButton,
|
|
654
|
+
SaveButton: () => SaveButton,
|
|
626
655
|
ScrollAreaBase: () => ScrollAreaBase,
|
|
627
656
|
ScrollBarBase: () => ScrollBarBase,
|
|
657
|
+
SearchButton: () => SearchButton,
|
|
628
658
|
Select: () => Select,
|
|
629
659
|
SelectBase: () => SelectBase,
|
|
630
660
|
SelectContentBase: () => SelectContentBase,
|
|
@@ -637,6 +667,7 @@ __export(index_exports, {
|
|
|
637
667
|
SelectTriggerBase: () => SelectTriggerBase,
|
|
638
668
|
SelectValueBase: () => SelectValueBase,
|
|
639
669
|
SeparatorBase: () => SeparatorBase,
|
|
670
|
+
SettingsButton: () => SettingsButton,
|
|
640
671
|
SheetBase: () => SheetBase,
|
|
641
672
|
SheetCloseBase: () => SheetCloseBase,
|
|
642
673
|
SheetContentBase: () => SheetContentBase,
|
|
@@ -697,7 +728,11 @@ __export(index_exports, {
|
|
|
697
728
|
TooltipSimple: () => TooltipSimple_default,
|
|
698
729
|
TooltipTriggerBase: () => TooltipTriggerBase,
|
|
699
730
|
TooltipWithTotal: () => TooltipWithTotal_default,
|
|
731
|
+
UnlockButton: () => UnlockButton,
|
|
732
|
+
UploadButton: () => UploadButton,
|
|
700
733
|
UseSideBarBase: () => UseSideBarBase,
|
|
734
|
+
ViewButton: () => ViewButton,
|
|
735
|
+
VisibilityButton: () => VisibilityButton,
|
|
701
736
|
badgeVariants: () => badgeVariants,
|
|
702
737
|
buttonVariantsBase: () => buttonVariantsBase,
|
|
703
738
|
compactTick: () => compactTick,
|
|
@@ -741,6 +776,7 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
|
741
776
|
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
742
777
|
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
743
778
|
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-background dark:border-input dark:hover:bg-background/95",
|
|
779
|
+
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
780
|
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
745
781
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
746
782
|
link: "text-primary underline-offset-4 hover:underline"
|
|
@@ -749,7 +785,8 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
|
749
785
|
default: "h-9 py-2 px-4 has-[>svg]:px-3",
|
|
750
786
|
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
751
787
|
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
752
|
-
icon: "size-9"
|
|
788
|
+
icon: "size-9",
|
|
789
|
+
select: "h-[34px] py-[7px] px-4 has-[>svg]:px-3"
|
|
753
790
|
}
|
|
754
791
|
},
|
|
755
792
|
defaultVariants: {
|
|
@@ -759,7 +796,14 @@ var buttonVariantsBase = (0, import_class_variance_authority.cva)(
|
|
|
759
796
|
}
|
|
760
797
|
);
|
|
761
798
|
var ButtonBase = React.forwardRef(
|
|
762
|
-
({
|
|
799
|
+
({
|
|
800
|
+
className,
|
|
801
|
+
variant,
|
|
802
|
+
size,
|
|
803
|
+
asChild = false,
|
|
804
|
+
testid = `button-${variant ?? "default"}`,
|
|
805
|
+
...props
|
|
806
|
+
}, ref) => {
|
|
763
807
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
764
808
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
765
809
|
Comp,
|
|
@@ -1818,7 +1862,7 @@ var CommandItemBase = React9.forwardRef(({ className, testid: dataTestId = "comm
|
|
|
1818
1862
|
{
|
|
1819
1863
|
ref,
|
|
1820
1864
|
className: cn(
|
|
1821
|
-
"relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-all data-[disabled=true]:pointer-events-none data-[selected=true]:bg-
|
|
1865
|
+
"relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-all data-[disabled=true]:pointer-events-none data-[selected=true]:bg-muted data-[selected=true]:text-primary data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:scale-[1.02] active:scale-[0.98]",
|
|
1822
1866
|
className
|
|
1823
1867
|
),
|
|
1824
1868
|
"data-testid": dataTestId,
|
|
@@ -2426,19 +2470,22 @@ var PopoverContentBase = React13.forwardRef(({ className, align = "center", side
|
|
|
2426
2470
|
PopoverContentBase.displayName = PopoverPrimitive.Content.displayName;
|
|
2427
2471
|
|
|
2428
2472
|
// src/components/selects/ComboboxBase.tsx
|
|
2429
|
-
var
|
|
2430
|
-
var
|
|
2473
|
+
var import_framer_motion4 = require("framer-motion");
|
|
2474
|
+
var import_react10 = require("react");
|
|
2475
|
+
var import_react11 = require("@phosphor-icons/react");
|
|
2431
2476
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2432
2477
|
function ComboboxBase({
|
|
2433
2478
|
items,
|
|
2434
2479
|
renderSelected,
|
|
2435
2480
|
handleSelection,
|
|
2436
2481
|
checkIsSelected,
|
|
2482
|
+
keepOpen = false,
|
|
2483
|
+
closeAll,
|
|
2437
2484
|
searchPlaceholder,
|
|
2438
2485
|
errorMessage,
|
|
2439
2486
|
testIds = {}
|
|
2440
2487
|
}) {
|
|
2441
|
-
const [open, setOpen] = (0,
|
|
2488
|
+
const [open, setOpen] = (0, import_react10.useState)(false);
|
|
2442
2489
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2443
2490
|
"div",
|
|
2444
2491
|
{
|
|
@@ -2453,17 +2500,27 @@ function ComboboxBase({
|
|
|
2453
2500
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2454
2501
|
ButtonBase,
|
|
2455
2502
|
{
|
|
2456
|
-
variant: "
|
|
2503
|
+
variant: "select",
|
|
2504
|
+
size: "select",
|
|
2457
2505
|
role: "combobox",
|
|
2458
2506
|
"aria-expanded": open,
|
|
2459
2507
|
className: cn(
|
|
2460
|
-
"flex items-
|
|
2508
|
+
"flex items-center gap-2 justify-between h-auto [&>div]:line-clamp-1 [&>span]:line-clamp-1",
|
|
2461
2509
|
errorMessage && "border-red-500"
|
|
2462
2510
|
),
|
|
2463
2511
|
"data-testid": testIds.trigger ?? "combobox-trigger",
|
|
2464
2512
|
children: [
|
|
2465
2513
|
renderSelected,
|
|
2466
|
-
|
|
2514
|
+
closeAll,
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2516
|
+
import_framer_motion4.motion.div,
|
|
2517
|
+
{
|
|
2518
|
+
animate: { rotate: open ? 180 : 0 },
|
|
2519
|
+
transition: { duration: 0.3 },
|
|
2520
|
+
className: "flex",
|
|
2521
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react11.CaretDownIcon, { className: " flex-shrink-0" })
|
|
2522
|
+
}
|
|
2523
|
+
)
|
|
2467
2524
|
]
|
|
2468
2525
|
}
|
|
2469
2526
|
)
|
|
@@ -2477,7 +2534,7 @@ function ComboboxBase({
|
|
|
2477
2534
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2478
2535
|
CommandBase,
|
|
2479
2536
|
{
|
|
2480
|
-
className: "dark:text-white",
|
|
2537
|
+
className: "dark:text-white hover:bg-rsecondary",
|
|
2481
2538
|
"data-testid": testIds.command ?? "combobox-command",
|
|
2482
2539
|
children: [
|
|
2483
2540
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
@@ -2499,19 +2556,32 @@ function ComboboxBase({
|
|
|
2499
2556
|
value: item.value,
|
|
2500
2557
|
onSelect: (value) => {
|
|
2501
2558
|
handleSelection(value);
|
|
2502
|
-
setOpen(false);
|
|
2559
|
+
if (!keepOpen) setOpen(false);
|
|
2503
2560
|
},
|
|
2504
2561
|
"data-testid": testIds.option ?? "combobox-option",
|
|
2505
2562
|
children: [
|
|
2506
2563
|
item.label,
|
|
2507
2564
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2508
|
-
|
|
2565
|
+
import_framer_motion4.motion.div,
|
|
2509
2566
|
{
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2567
|
+
initial: { scale: 0 },
|
|
2568
|
+
animate: { scale: isSelected ? 1 : 0 },
|
|
2569
|
+
transition: {
|
|
2570
|
+
type: "spring",
|
|
2571
|
+
stiffness: 500,
|
|
2572
|
+
damping: 30
|
|
2573
|
+
},
|
|
2574
|
+
className: "ml-auto ",
|
|
2575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2576
|
+
import_react11.CheckIcon,
|
|
2577
|
+
{
|
|
2578
|
+
className: cn(
|
|
2579
|
+
"ml-auto",
|
|
2580
|
+
isSelected ? "opacity-100" : "opacity-0"
|
|
2581
|
+
),
|
|
2582
|
+
"data-testid": isSelected ? testIds.check ?? "combobox-option-check" : void 0
|
|
2583
|
+
}
|
|
2584
|
+
)
|
|
2515
2585
|
}
|
|
2516
2586
|
)
|
|
2517
2587
|
]
|
|
@@ -2583,6 +2653,7 @@ function Combobox({
|
|
|
2583
2653
|
// src/components/selects/MultiCombobox.tsx
|
|
2584
2654
|
var import_react13 = require("react");
|
|
2585
2655
|
var import_react14 = require("@phosphor-icons/react");
|
|
2656
|
+
var import_framer_motion5 = require("framer-motion");
|
|
2586
2657
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2587
2658
|
function MultiCombobox({
|
|
2588
2659
|
items,
|
|
@@ -2593,7 +2664,8 @@ function MultiCombobox({
|
|
|
2593
2664
|
searchPlaceholder,
|
|
2594
2665
|
label,
|
|
2595
2666
|
labelClassname,
|
|
2596
|
-
testIds = {}
|
|
2667
|
+
testIds = {},
|
|
2668
|
+
keepOpen = true
|
|
2597
2669
|
}) {
|
|
2598
2670
|
const selectedItems = items.filter((item) => selected.includes(item.value));
|
|
2599
2671
|
const checkIsSelected = (0, import_react13.useCallback)(
|
|
@@ -2611,13 +2683,27 @@ function MultiCombobox({
|
|
|
2611
2683
|
},
|
|
2612
2684
|
[selected, onChange]
|
|
2613
2685
|
);
|
|
2686
|
+
const closeAll = selectedItems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: " flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2687
|
+
ButtonBase,
|
|
2688
|
+
{
|
|
2689
|
+
variant: "ghost",
|
|
2690
|
+
"data-testid": testIds.clearAll ?? "combobox-clear-all",
|
|
2691
|
+
size: "icon",
|
|
2692
|
+
onClick: (e) => {
|
|
2693
|
+
e.stopPropagation();
|
|
2694
|
+
onChange([]);
|
|
2695
|
+
},
|
|
2696
|
+
className: "text-xs hover:bg-red-50 hover:text-red-500 transition-colors rounded-md mr-2",
|
|
2697
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react14.XIcon, {})
|
|
2698
|
+
}
|
|
2699
|
+
) }) : null;
|
|
2614
2700
|
const renderSelected = (0, import_react13.useMemo)(() => {
|
|
2615
2701
|
if (selectedItems.length === 0) {
|
|
2616
2702
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2617
2703
|
"span",
|
|
2618
2704
|
{
|
|
2619
2705
|
"data-testid": testIds.emptyPlaceholder ?? "combobox-selected-empty",
|
|
2620
|
-
className: "text-gray-500",
|
|
2706
|
+
className: "text-gray-500 truncate",
|
|
2621
2707
|
children: placeholder ?? "Selecione uma op\xE7\xE3o..."
|
|
2622
2708
|
}
|
|
2623
2709
|
);
|
|
@@ -2626,16 +2712,25 @@ function MultiCombobox({
|
|
|
2626
2712
|
"div",
|
|
2627
2713
|
{
|
|
2628
2714
|
"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
|
-
|
|
2715
|
+
className: "flex w-full flex-wrap gap-2 overflow-hidden pr-1.5",
|
|
2716
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_framer_motion5.AnimatePresence, { mode: "popLayout", children: selectedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2717
|
+
import_framer_motion5.motion.div,
|
|
2632
2718
|
{
|
|
2633
|
-
|
|
2719
|
+
layout: true,
|
|
2720
|
+
initial: { scale: 0, opacity: 0 },
|
|
2721
|
+
animate: { scale: 1, opacity: 1 },
|
|
2722
|
+
exit: { scale: 0, opacity: 0 },
|
|
2723
|
+
transition: {
|
|
2724
|
+
type: "spring",
|
|
2725
|
+
stiffness: 500,
|
|
2726
|
+
damping: 30
|
|
2727
|
+
},
|
|
2728
|
+
className: "flex items-center justify-between gap-2 my-1 rounded-md border p-1 max-w-full",
|
|
2634
2729
|
"data-testid": testIds.selectedItem?.(item.value) ?? `combobox-selected-${item.value}`,
|
|
2635
2730
|
children: [
|
|
2636
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "
|
|
2731
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-xs truncate", children: item.label }),
|
|
2637
2732
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2638
|
-
|
|
2733
|
+
import_framer_motion5.motion.span,
|
|
2639
2734
|
{
|
|
2640
2735
|
role: "button",
|
|
2641
2736
|
tabIndex: 0,
|
|
@@ -2643,14 +2738,16 @@ function MultiCombobox({
|
|
|
2643
2738
|
e.stopPropagation();
|
|
2644
2739
|
handleSelection(item.value);
|
|
2645
2740
|
},
|
|
2646
|
-
|
|
2741
|
+
whileHover: { scale: 1.1 },
|
|
2742
|
+
whileTap: { scale: 0.95 },
|
|
2743
|
+
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
2744
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react14.XIcon, { size: 14 })
|
|
2648
2745
|
}
|
|
2649
2746
|
)
|
|
2650
2747
|
]
|
|
2651
2748
|
},
|
|
2652
2749
|
item.value
|
|
2653
|
-
))
|
|
2750
|
+
)) })
|
|
2654
2751
|
}
|
|
2655
2752
|
);
|
|
2656
2753
|
}, [handleSelection, placeholder, selectedItems, testIds]);
|
|
@@ -2675,6 +2772,8 @@ function MultiCombobox({
|
|
|
2675
2772
|
renderSelected,
|
|
2676
2773
|
handleSelection,
|
|
2677
2774
|
checkIsSelected,
|
|
2775
|
+
keepOpen,
|
|
2776
|
+
closeAll,
|
|
2678
2777
|
searchPlaceholder
|
|
2679
2778
|
}
|
|
2680
2779
|
)
|
|
@@ -3131,7 +3230,7 @@ var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
|
3131
3230
|
var ProgressBase = React17.forwardRef(
|
|
3132
3231
|
({
|
|
3133
3232
|
className,
|
|
3134
|
-
value,
|
|
3233
|
+
value: rawValue,
|
|
3135
3234
|
label,
|
|
3136
3235
|
leftIcon,
|
|
3137
3236
|
rightIcon,
|
|
@@ -3139,8 +3238,14 @@ var ProgressBase = React17.forwardRef(
|
|
|
3139
3238
|
segments = 5,
|
|
3140
3239
|
steps = [],
|
|
3141
3240
|
currentStep = 0,
|
|
3241
|
+
showValue = false,
|
|
3242
|
+
valuePosition = "right",
|
|
3243
|
+
autocolor,
|
|
3244
|
+
plusIndicator,
|
|
3142
3245
|
...props
|
|
3143
3246
|
}, ref) => {
|
|
3247
|
+
const value = Number(rawValue || 0);
|
|
3248
|
+
const indicatorWidth = Math.min(value, 100);
|
|
3144
3249
|
switch (variant) {
|
|
3145
3250
|
case "segments":
|
|
3146
3251
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -3174,26 +3279,89 @@ var ProgressBase = React17.forwardRef(
|
|
|
3174
3279
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
3175
3280
|
label && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LabelBase_default, { className: "py-2", children: label }),
|
|
3176
3281
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3282
|
+
showValue && valuePosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-12 text-sm text-right font-extrabold", children: [
|
|
3283
|
+
Math.round(value || 0),
|
|
3284
|
+
"%"
|
|
3285
|
+
] }),
|
|
3177
3286
|
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
|
|
3178
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.
|
|
3287
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3179
3288
|
ProgressPrimitive.Root,
|
|
3180
3289
|
{
|
|
3181
3290
|
ref,
|
|
3182
3291
|
className: cn(
|
|
3183
|
-
"relative h-3 w-full overflow-
|
|
3292
|
+
" relative h-3 w-full overflow-visible rounded-full bg-muted/80 shadow-inner transition-all ",
|
|
3184
3293
|
className
|
|
3185
3294
|
),
|
|
3186
3295
|
value,
|
|
3187
3296
|
...props,
|
|
3188
|
-
children:
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3297
|
+
children: [
|
|
3298
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3299
|
+
ProgressPrimitive.Indicator,
|
|
3300
|
+
{
|
|
3301
|
+
className: cn(
|
|
3302
|
+
"h-full w-full flex-1 transition-all duration-500 ease-in-out rounded-lg ",
|
|
3303
|
+
autocolor && autocolor.length >= 2 ? "bg-transparent" : "bg-primary"
|
|
3304
|
+
),
|
|
3305
|
+
style: { transform: `translateX(-${100 - indicatorWidth}%)` }
|
|
3306
|
+
}
|
|
3307
|
+
),
|
|
3308
|
+
autocolor && Array.isArray(autocolor) && autocolor.length >= 2 && (() => {
|
|
3309
|
+
const [t1Raw, t2Raw] = autocolor;
|
|
3310
|
+
const [t1, t2] = [Number(t1Raw), Number(t2Raw)].sort(
|
|
3311
|
+
(a, b) => a - b
|
|
3312
|
+
);
|
|
3313
|
+
const v = Number(value || 0);
|
|
3314
|
+
let colorClass = "bg-red-500";
|
|
3315
|
+
if (v <= t1) {
|
|
3316
|
+
colorClass = "bg-red-500";
|
|
3317
|
+
} else if (v <= t2) {
|
|
3318
|
+
colorClass = "bg-yellow-500";
|
|
3319
|
+
} else {
|
|
3320
|
+
colorClass = "bg-emerald-500";
|
|
3321
|
+
}
|
|
3322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3323
|
+
"div",
|
|
3324
|
+
{
|
|
3325
|
+
"aria-hidden": true,
|
|
3326
|
+
className: cn(
|
|
3327
|
+
"absolute top-0 left-0 h-full transition-all duration-500 ease-in-out rounded-lg",
|
|
3328
|
+
colorClass
|
|
3329
|
+
),
|
|
3330
|
+
style: { width: `${indicatorWidth}%` }
|
|
3331
|
+
}
|
|
3332
|
+
);
|
|
3333
|
+
})(),
|
|
3334
|
+
plusIndicator && value > 100 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3335
|
+
"div",
|
|
3336
|
+
{
|
|
3337
|
+
"aria-hidden": "true",
|
|
3338
|
+
className: "absolute top-0 bottom-0 w-0.5 bg-black/70 transition-all duration-500 ease-in-out pointer-events-none",
|
|
3339
|
+
style: {
|
|
3340
|
+
left: `${100 / value * 100}%`
|
|
3341
|
+
},
|
|
3342
|
+
children: value > 115 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute left-full ml-2 top-1/2 -translate-y-1/2 text-xs whitespace-nowrap font-extrabold", children: `+${Math.round(
|
|
3343
|
+
value - 100
|
|
3344
|
+
)}%` })
|
|
3345
|
+
}
|
|
3346
|
+
),
|
|
3347
|
+
showValue && valuePosition === "inside" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3348
|
+
"span",
|
|
3349
|
+
{
|
|
3350
|
+
className: "absolute inset-0 flex items-center justify-center text-sm select-none pointer-events-none text-secondary font-extrabold",
|
|
3351
|
+
"aria-hidden": true,
|
|
3352
|
+
children: [
|
|
3353
|
+
Math.round(value || 0),
|
|
3354
|
+
"%"
|
|
3355
|
+
]
|
|
3356
|
+
}
|
|
3357
|
+
)
|
|
3358
|
+
]
|
|
3195
3359
|
}
|
|
3196
3360
|
),
|
|
3361
|
+
showValue && valuePosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-12 text-sm font-extrabold text-left", children: [
|
|
3362
|
+
Math.round(value || 0),
|
|
3363
|
+
"%"
|
|
3364
|
+
] }),
|
|
3197
3365
|
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
|
|
3198
3366
|
] })
|
|
3199
3367
|
] });
|
|
@@ -3350,7 +3518,7 @@ ScrollBarBase.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
|
3350
3518
|
var React19 = __toESM(require("react"));
|
|
3351
3519
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
3352
3520
|
var import_react19 = require("@phosphor-icons/react");
|
|
3353
|
-
var
|
|
3521
|
+
var import_framer_motion6 = require("framer-motion");
|
|
3354
3522
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3355
3523
|
var SelectBase = SelectPrimitive.Root;
|
|
3356
3524
|
var SelectGroupBase = SelectPrimitive.Group;
|
|
@@ -3367,7 +3535,7 @@ var SelectTriggerBase = React19.forwardRef(({ className, children, open, ...prop
|
|
|
3367
3535
|
children: [
|
|
3368
3536
|
children,
|
|
3369
3537
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3370
|
-
|
|
3538
|
+
import_framer_motion6.motion.span,
|
|
3371
3539
|
{
|
|
3372
3540
|
animate: { rotate: open ? 180 : 0 },
|
|
3373
3541
|
transition: { duration: 0.3 },
|
|
@@ -3405,43 +3573,51 @@ var SelectScrollDownButtonBase = React19.forwardRef(({ className, ...props }, re
|
|
|
3405
3573
|
}
|
|
3406
3574
|
));
|
|
3407
3575
|
SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
3408
|
-
var SelectContentBase = React19.forwardRef(
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3576
|
+
var SelectContentBase = React19.forwardRef(
|
|
3577
|
+
({
|
|
3578
|
+
className,
|
|
3579
|
+
children,
|
|
3580
|
+
position = "popper",
|
|
3581
|
+
testid: dataTestId = "select-content",
|
|
3582
|
+
...props
|
|
3583
|
+
}, 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)(
|
|
3584
|
+
SelectPrimitive.Content,
|
|
3585
|
+
{
|
|
3586
|
+
ref,
|
|
3587
|
+
className: cn(
|
|
3588
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
3589
|
+
className
|
|
3590
|
+
),
|
|
3591
|
+
position,
|
|
3592
|
+
"data-testid": dataTestId,
|
|
3593
|
+
...props,
|
|
3594
|
+
asChild: true,
|
|
3595
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3596
|
+
import_framer_motion6.motion.div,
|
|
3597
|
+
{
|
|
3598
|
+
initial: { opacity: 0, scale: 0.95 },
|
|
3599
|
+
animate: { opacity: 1, scale: 1 },
|
|
3600
|
+
exit: { opacity: 0, scale: 0.95 },
|
|
3601
|
+
transition: { duration: 0.2 },
|
|
3602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3603
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollUpButtonBase, {}),
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3605
|
+
SelectPrimitive.Viewport,
|
|
3606
|
+
{
|
|
3607
|
+
className: cn(
|
|
3608
|
+
"p-1",
|
|
3609
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
3610
|
+
),
|
|
3611
|
+
children
|
|
3612
|
+
}
|
|
3613
|
+
),
|
|
3614
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectScrollDownButtonBase, {})
|
|
3615
|
+
] })
|
|
3616
|
+
}
|
|
3617
|
+
)
|
|
3618
|
+
}
|
|
3619
|
+
) }) })
|
|
3620
|
+
);
|
|
3445
3621
|
SelectContentBase.displayName = SelectPrimitive.Content.displayName;
|
|
3446
3622
|
var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3447
3623
|
SelectPrimitive.Label,
|
|
@@ -3452,19 +3628,36 @@ var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3452
3628
|
}
|
|
3453
3629
|
));
|
|
3454
3630
|
SelectLabelBase.displayName = SelectPrimitive.Label.displayName;
|
|
3455
|
-
var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.
|
|
3631
|
+
var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3456
3632
|
SelectPrimitive.Item,
|
|
3457
3633
|
{
|
|
3458
3634
|
ref,
|
|
3459
3635
|
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",
|
|
3636
|
+
"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
3637
|
className
|
|
3462
3638
|
),
|
|
3463
3639
|
...props,
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3640
|
+
asChild: true,
|
|
3641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3642
|
+
import_framer_motion6.motion.div,
|
|
3643
|
+
{
|
|
3644
|
+
whileHover: { x: 4 },
|
|
3645
|
+
whileTap: { scale: 0.98 },
|
|
3646
|
+
transition: { duration: 0.2 },
|
|
3647
|
+
children: [
|
|
3648
|
+
/* @__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)(
|
|
3649
|
+
import_framer_motion6.motion.div,
|
|
3650
|
+
{
|
|
3651
|
+
initial: { scale: 0 },
|
|
3652
|
+
animate: { scale: 1 },
|
|
3653
|
+
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
3654
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react19.CheckIcon, { className: "h-4 w-4" })
|
|
3655
|
+
}
|
|
3656
|
+
) }) }),
|
|
3657
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SelectPrimitive.ItemText, { children })
|
|
3658
|
+
]
|
|
3659
|
+
}
|
|
3660
|
+
)
|
|
3468
3661
|
}
|
|
3469
3662
|
));
|
|
3470
3663
|
SelectItemBase.displayName = SelectPrimitive.Item.displayName;
|
|
@@ -3481,7 +3674,7 @@ SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
|
|
|
3481
3674
|
// src/components/ui/SeparatorBase.tsx
|
|
3482
3675
|
var React20 = __toESM(require("react"));
|
|
3483
3676
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
3484
|
-
var
|
|
3677
|
+
var import_framer_motion7 = require("framer-motion");
|
|
3485
3678
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3486
3679
|
var SeparatorBase = React20.forwardRef(
|
|
3487
3680
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
|
|
@@ -3495,7 +3688,7 @@ var SeparatorBase = React20.forwardRef(
|
|
|
3495
3688
|
asChild: true,
|
|
3496
3689
|
...props,
|
|
3497
3690
|
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3498
|
-
|
|
3691
|
+
import_framer_motion7.motion.div,
|
|
3499
3692
|
{
|
|
3500
3693
|
className: cn(
|
|
3501
3694
|
"shrink-0 bg-border",
|
|
@@ -4546,7 +4739,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
|
|
|
4546
4739
|
|
|
4547
4740
|
// src/components/ui/TextAreaBase.tsx
|
|
4548
4741
|
var React28 = __toESM(require("react"));
|
|
4549
|
-
var
|
|
4742
|
+
var import_framer_motion8 = require("framer-motion");
|
|
4550
4743
|
var import_react23 = require("@phosphor-icons/react");
|
|
4551
4744
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4552
4745
|
var TextAreaBase = React28.forwardRef(
|
|
@@ -4627,7 +4820,7 @@ var TextAreaBase = React28.forwardRef(
|
|
|
4627
4820
|
onOpenChange: setShowConfirmTooltip,
|
|
4628
4821
|
children: [
|
|
4629
4822
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4630
|
-
|
|
4823
|
+
import_framer_motion8.motion.button,
|
|
4631
4824
|
{
|
|
4632
4825
|
type: "button",
|
|
4633
4826
|
initial: { opacity: 0, scale: 0.8 },
|
|
@@ -4691,7 +4884,7 @@ var TextAreaBase = React28.forwardRef(
|
|
|
4691
4884
|
}
|
|
4692
4885
|
) }),
|
|
4693
4886
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4694
|
-
|
|
4887
|
+
import_framer_motion8.motion.div,
|
|
4695
4888
|
{
|
|
4696
4889
|
className: "pointer-events-none absolute inset-0 rounded-lg",
|
|
4697
4890
|
initial: { opacity: 0 },
|
|
@@ -4701,7 +4894,7 @@ var TextAreaBase = React28.forwardRef(
|
|
|
4701
4894
|
}
|
|
4702
4895
|
),
|
|
4703
4896
|
isFocused && hasContent && props.maxLength && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4704
|
-
|
|
4897
|
+
import_framer_motion8.motion.div,
|
|
4705
4898
|
{
|
|
4706
4899
|
initial: { opacity: 0, y: -10 },
|
|
4707
4900
|
animate: { opacity: 1, y: 0 },
|
|
@@ -4915,7 +5108,7 @@ var import_date_fns = require("date-fns");
|
|
|
4915
5108
|
var React30 = __toESM(require("react"));
|
|
4916
5109
|
var import_react_day_picker2 = require("react-day-picker");
|
|
4917
5110
|
var import_react27 = require("@phosphor-icons/react");
|
|
4918
|
-
var
|
|
5111
|
+
var import_framer_motion9 = require("framer-motion");
|
|
4919
5112
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4920
5113
|
function CalendarBase2({
|
|
4921
5114
|
className,
|
|
@@ -4937,10 +5130,10 @@ function CalendarBase2({
|
|
|
4937
5130
|
"div",
|
|
4938
5131
|
{
|
|
4939
5132
|
className: cn(
|
|
4940
|
-
"rounded-md border bg-background p-
|
|
5133
|
+
"rounded-md border bg-background p-2 overflow-hidden flex flex-col",
|
|
4941
5134
|
className
|
|
4942
5135
|
),
|
|
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)(
|
|
5136
|
+
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
5137
|
"div",
|
|
4945
5138
|
{
|
|
4946
5139
|
className: "w-full h-full flex flex-col",
|
|
@@ -4980,11 +5173,11 @@ function CalendarBase2({
|
|
|
4980
5173
|
),
|
|
4981
5174
|
day: cn(
|
|
4982
5175
|
buttonVariantsBase({ variant: "ghost" }),
|
|
4983
|
-
"w-full h-full p-0
|
|
4984
|
-
"aria-selected:opacity-100 hover:bg-muted
|
|
4985
|
-
"
|
|
5176
|
+
"w-full h-full p-0",
|
|
5177
|
+
"aria-selected:opacity-100 hover:bg-muted flex items-center justify-center",
|
|
5178
|
+
" transition-all duration-200 ease-out hover:scale-105 active:scale-95"
|
|
4986
5179
|
),
|
|
4987
|
-
day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold",
|
|
5180
|
+
day_selected: "bg-primary text-primary-foreground hover:bg-primary/90 focus:bg-primary/90 font-semibold hover:text-white",
|
|
4988
5181
|
day_today: "bg-muted text-foreground font-bold ring-2 ring-primary/30 ring-inset",
|
|
4989
5182
|
day_outside: "day-outside text-muted-foreground/40 opacity-40 aria-selected:bg-muted/50 aria-selected:text-foreground",
|
|
4990
5183
|
day_disabled: "text-muted-foreground/30 opacity-40 cursor-not-allowed",
|
|
@@ -5012,7 +5205,7 @@ var import_locale = require("date-fns/locale");
|
|
|
5012
5205
|
var import_react30 = require("react");
|
|
5013
5206
|
|
|
5014
5207
|
// src/components/date-time-picker/TimePicker.tsx
|
|
5015
|
-
var
|
|
5208
|
+
var import_framer_motion10 = require("framer-motion");
|
|
5016
5209
|
var React32 = __toESM(require("react"));
|
|
5017
5210
|
|
|
5018
5211
|
// src/components/date-time-picker/TimePickerInput.tsx
|
|
@@ -5384,7 +5577,7 @@ function TimePicker({
|
|
|
5384
5577
|
visible: { opacity: 1, y: 0 }
|
|
5385
5578
|
};
|
|
5386
5579
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5387
|
-
|
|
5580
|
+
import_framer_motion10.motion.div,
|
|
5388
5581
|
{
|
|
5389
5582
|
variants: containerVariants,
|
|
5390
5583
|
initial: "hidden",
|
|
@@ -5392,7 +5585,7 @@ function TimePicker({
|
|
|
5392
5585
|
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
5586
|
children: [
|
|
5394
5587
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5395
|
-
|
|
5588
|
+
import_framer_motion10.motion.div,
|
|
5396
5589
|
{
|
|
5397
5590
|
variants: itemVariants2,
|
|
5398
5591
|
className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
|
|
@@ -5410,7 +5603,7 @@ function TimePicker({
|
|
|
5410
5603
|
}
|
|
5411
5604
|
),
|
|
5412
5605
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5413
|
-
|
|
5606
|
+
import_framer_motion10.motion.div,
|
|
5414
5607
|
{
|
|
5415
5608
|
variants: itemVariants2,
|
|
5416
5609
|
className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
|
|
@@ -5428,8 +5621,8 @@ function TimePicker({
|
|
|
5428
5621
|
)
|
|
5429
5622
|
}
|
|
5430
5623
|
),
|
|
5431
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5432
|
-
|
|
5624
|
+
/* @__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)(
|
|
5625
|
+
import_framer_motion10.motion.div,
|
|
5433
5626
|
{
|
|
5434
5627
|
variants: itemVariants2,
|
|
5435
5628
|
initial: "hidden",
|
|
@@ -5514,9 +5707,9 @@ function DateTimePicker({
|
|
|
5514
5707
|
variant: "outline",
|
|
5515
5708
|
className: cn(
|
|
5516
5709
|
"w-full justify-start text-left min-w-0 overflow-hidden",
|
|
5517
|
-
"",
|
|
5710
|
+
"text-foreground/70",
|
|
5518
5711
|
"text-sm sm:text-base",
|
|
5519
|
-
!date && "text-muted-foreground"
|
|
5712
|
+
!date && "text-muted-foreground/"
|
|
5520
5713
|
),
|
|
5521
5714
|
children: [
|
|
5522
5715
|
/* @__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" }),
|
|
@@ -5544,7 +5737,7 @@ function DateTimePicker({
|
|
|
5544
5737
|
initialFocus: true,
|
|
5545
5738
|
fromDate,
|
|
5546
5739
|
toDate,
|
|
5547
|
-
className: "w-full"
|
|
5740
|
+
className: cn("w-full", hideHour && hideMinute && "border-0")
|
|
5548
5741
|
}
|
|
5549
5742
|
),
|
|
5550
5743
|
!(hideHour && hideMinute) && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex justify-center w-full px-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
@@ -5570,7 +5763,7 @@ function DateTimePicker({
|
|
|
5570
5763
|
),
|
|
5571
5764
|
children: [
|
|
5572
5765
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react31.ClockIcon, { className: "text-primary flex-shrink-0 w-4 h-4 sm:w-5 sm:h-5" }),
|
|
5573
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-
|
|
5766
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-black truncate", children: internalDate ? (0, import_date_fns.format)(internalDate, getTimeFormat() || "HH:mm", {
|
|
5574
5767
|
locale: import_locale.ptBR
|
|
5575
5768
|
}) : "00:00" })
|
|
5576
5769
|
]
|
|
@@ -5619,6 +5812,7 @@ function DateTimePicker({
|
|
|
5619
5812
|
}
|
|
5620
5813
|
|
|
5621
5814
|
// src/components/selects/Select.tsx
|
|
5815
|
+
var import_framer_motion11 = require("framer-motion");
|
|
5622
5816
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5623
5817
|
function Select({
|
|
5624
5818
|
items,
|
|
@@ -5629,53 +5823,77 @@ function Select({
|
|
|
5629
5823
|
testIds = {}
|
|
5630
5824
|
}) {
|
|
5631
5825
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { "data-testid": testIds.root ?? "select-root", children: [
|
|
5632
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
"data-testid": testIds.trigger ?? "select-trigger",
|
|
5641
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5642
|
-
SelectValueBase,
|
|
5826
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5827
|
+
SelectBase,
|
|
5828
|
+
{
|
|
5829
|
+
onValueChange: onChange,
|
|
5830
|
+
"data-testid": testIds.base ?? "select-base",
|
|
5831
|
+
children: [
|
|
5832
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5833
|
+
SelectTriggerBase,
|
|
5643
5834
|
{
|
|
5644
|
-
|
|
5645
|
-
|
|
5835
|
+
className: cn(
|
|
5836
|
+
"flex h-9 w-full content-start text-lg shadow-md",
|
|
5837
|
+
errorMessage && "border-red-500"
|
|
5838
|
+
),
|
|
5839
|
+
"data-testid": testIds.trigger ?? "select-trigger",
|
|
5840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5841
|
+
SelectValueBase,
|
|
5842
|
+
{
|
|
5843
|
+
placeholder,
|
|
5844
|
+
"data-testid": testIds.value ?? "select-value"
|
|
5845
|
+
}
|
|
5846
|
+
)
|
|
5646
5847
|
}
|
|
5647
|
-
)
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5848
|
+
),
|
|
5849
|
+
/* @__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)(
|
|
5850
|
+
SelectGroupBase,
|
|
5851
|
+
{
|
|
5852
|
+
"data-testid": testIds.group ?? "select-group",
|
|
5853
|
+
children: [
|
|
5854
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5855
|
+
SelectLabelBase,
|
|
5856
|
+
{
|
|
5857
|
+
"data-testid": testIds.label ?? "select-label",
|
|
5858
|
+
children: key
|
|
5859
|
+
}
|
|
5860
|
+
),
|
|
5861
|
+
groupItems[key].map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5862
|
+
SelectItemBase,
|
|
5863
|
+
{
|
|
5864
|
+
value: item.value,
|
|
5865
|
+
"data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
|
|
5866
|
+
children: item.label
|
|
5867
|
+
},
|
|
5868
|
+
item.value
|
|
5869
|
+
))
|
|
5870
|
+
]
|
|
5871
|
+
},
|
|
5872
|
+
key
|
|
5873
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5874
|
+
SelectItemBase,
|
|
5875
|
+
{
|
|
5876
|
+
value: item.value,
|
|
5877
|
+
"data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
|
|
5878
|
+
children: item.label
|
|
5879
|
+
},
|
|
5880
|
+
item.value
|
|
5881
|
+
)) }) }) })
|
|
5882
|
+
]
|
|
5883
|
+
}
|
|
5884
|
+
),
|
|
5885
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_framer_motion11.AnimatePresence, { children: errorMessage && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5886
|
+
import_framer_motion11.motion.p,
|
|
5673
5887
|
{
|
|
5888
|
+
initial: { opacity: 0, y: -10 },
|
|
5889
|
+
animate: { opacity: 1, y: 0 },
|
|
5890
|
+
exit: { opacity: 0, y: -10 },
|
|
5891
|
+
transition: { duration: 0.2 },
|
|
5674
5892
|
className: "text-sm text-red-500",
|
|
5675
5893
|
"data-testid": testIds.error ?? "select-error",
|
|
5676
5894
|
children: errorMessage
|
|
5677
5895
|
}
|
|
5678
|
-
)
|
|
5896
|
+
) })
|
|
5679
5897
|
] });
|
|
5680
5898
|
}
|
|
5681
5899
|
|
|
@@ -5828,7 +6046,7 @@ var import_sonner2 = require("sonner");
|
|
|
5828
6046
|
|
|
5829
6047
|
// src/components/charts/components/controls/PeriodsDropdown.tsx
|
|
5830
6048
|
var import_react32 = require("react");
|
|
5831
|
-
var
|
|
6049
|
+
var import_framer_motion12 = require("framer-motion");
|
|
5832
6050
|
var import_ssr = require("@phosphor-icons/react/dist/ssr");
|
|
5833
6051
|
var import_ssr2 = require("@phosphor-icons/react/dist/ssr");
|
|
5834
6052
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -5903,8 +6121,8 @@ function PeriodsDropdown({
|
|
|
5903
6121
|
]
|
|
5904
6122
|
}
|
|
5905
6123
|
),
|
|
5906
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5907
|
-
|
|
6124
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_framer_motion12.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6125
|
+
import_framer_motion12.motion.div,
|
|
5908
6126
|
{
|
|
5909
6127
|
initial: "hidden",
|
|
5910
6128
|
animate: "visible",
|
|
@@ -5933,7 +6151,7 @@ function PeriodsDropdown({
|
|
|
5933
6151
|
className: "flex flex-col p-2 gap-1",
|
|
5934
6152
|
style: { maxHeight: 200, overflowY: "auto" },
|
|
5935
6153
|
children: periods.map((p, idx) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5936
|
-
|
|
6154
|
+
import_framer_motion12.motion.button,
|
|
5937
6155
|
{
|
|
5938
6156
|
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
6157
|
variants: itemVariants,
|
|
@@ -5961,7 +6179,7 @@ function PeriodsDropdown({
|
|
|
5961
6179
|
var PeriodsDropdown_default = PeriodsDropdown;
|
|
5962
6180
|
|
|
5963
6181
|
// src/components/charts/components/controls/ShowOnly.tsx
|
|
5964
|
-
var
|
|
6182
|
+
var import_framer_motion13 = require("framer-motion");
|
|
5965
6183
|
var import_react33 = require("@phosphor-icons/react");
|
|
5966
6184
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5967
6185
|
var ShowOnly = ({
|
|
@@ -5972,7 +6190,7 @@ var ShowOnly = ({
|
|
|
5972
6190
|
const hasHighlights = highlightedSeriesSize > 0;
|
|
5973
6191
|
if (!hasHighlights) return null;
|
|
5974
6192
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "ml-auto flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5975
|
-
|
|
6193
|
+
import_framer_motion13.motion.div,
|
|
5976
6194
|
{
|
|
5977
6195
|
whileTap: { scale: hasHighlights ? 0.985 : 1 },
|
|
5978
6196
|
whileHover: { y: hasHighlights ? -2 : 0 },
|
|
@@ -6005,7 +6223,7 @@ var ShowOnly = ({
|
|
|
6005
6223
|
var ShowOnly_default = ShowOnly;
|
|
6006
6224
|
|
|
6007
6225
|
// src/components/charts/components/controls/Highlights.tsx
|
|
6008
|
-
var
|
|
6226
|
+
var import_framer_motion14 = require("framer-motion");
|
|
6009
6227
|
var import_ssr3 = require("@phosphor-icons/react/dist/ssr");
|
|
6010
6228
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6011
6229
|
var Highlights = ({
|
|
@@ -6026,13 +6244,13 @@ var Highlights = ({
|
|
|
6026
6244
|
visible: { opacity: 1, transition: { staggerChildren: 0.03 } }
|
|
6027
6245
|
};
|
|
6028
6246
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6029
|
-
|
|
6247
|
+
import_framer_motion14.motion.div,
|
|
6030
6248
|
{
|
|
6031
6249
|
className: "flex-1 flex items-center gap-2 flex-wrap",
|
|
6032
6250
|
initial: "hidden",
|
|
6033
6251
|
animate: "visible",
|
|
6034
6252
|
variants: containerVariants,
|
|
6035
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_framer_motion14.AnimatePresence, { initial: false, mode: "popLayout", children: allKeys.map((k) => {
|
|
6036
6254
|
const isHighlighted = highlightedSeries.has(k);
|
|
6037
6255
|
const label = mapperConfig[k]?.label ?? k;
|
|
6038
6256
|
const color = finalColors[k];
|
|
@@ -6042,7 +6260,7 @@ var Highlights = ({
|
|
|
6042
6260
|
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
6261
|
);
|
|
6044
6262
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6045
|
-
|
|
6263
|
+
import_framer_motion14.motion.div,
|
|
6046
6264
|
{
|
|
6047
6265
|
layout: true,
|
|
6048
6266
|
initial: "hidden",
|
|
@@ -6059,7 +6277,7 @@ var Highlights = ({
|
|
|
6059
6277
|
style: { minWidth: showFullLabel ? void 0 : 36 },
|
|
6060
6278
|
"aria-pressed": isHighlighted,
|
|
6061
6279
|
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
6062
|
-
|
|
6280
|
+
import_framer_motion14.motion.button,
|
|
6063
6281
|
{
|
|
6064
6282
|
whileHover: { scale: isHighlighted ? 1.04 : 1.03 },
|
|
6065
6283
|
whileTap: { scale: 0.96 },
|
|
@@ -6067,7 +6285,7 @@ var Highlights = ({
|
|
|
6067
6285
|
className: "flex items-center gap-2 min-w-0 pr-2",
|
|
6068
6286
|
children: [
|
|
6069
6287
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6070
|
-
|
|
6288
|
+
import_framer_motion14.motion.span,
|
|
6071
6289
|
{
|
|
6072
6290
|
className: cn("w-3 h-3 rounded-sm flex-shrink-0 border"),
|
|
6073
6291
|
style: {
|
|
@@ -6081,8 +6299,8 @@ var Highlights = ({
|
|
|
6081
6299
|
transition: { type: "spring", stiffness: 400, damping: 30 }
|
|
6082
6300
|
}
|
|
6083
6301
|
),
|
|
6084
|
-
showFullLabel ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6085
|
-
|
|
6302
|
+
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)(
|
|
6303
|
+
import_framer_motion14.motion.span,
|
|
6086
6304
|
{
|
|
6087
6305
|
className: "truncate max-w-[6rem] text-xs pr-2",
|
|
6088
6306
|
layout: true,
|
|
@@ -6090,7 +6308,7 @@ var Highlights = ({
|
|
|
6090
6308
|
}
|
|
6091
6309
|
) : null,
|
|
6092
6310
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6093
|
-
|
|
6311
|
+
import_framer_motion14.motion.span,
|
|
6094
6312
|
{
|
|
6095
6313
|
"aria-hidden": true,
|
|
6096
6314
|
initial: { opacity: 0, scale: 0.6 },
|
|
@@ -6200,7 +6418,7 @@ var CloseAllButton_default = CloseAllButton;
|
|
|
6200
6418
|
|
|
6201
6419
|
// src/components/charts/components/tooltips/DraggableTooltip.tsx
|
|
6202
6420
|
var import_react34 = __toESM(require("react"));
|
|
6203
|
-
var
|
|
6421
|
+
var import_framer_motion15 = require("framer-motion");
|
|
6204
6422
|
var import_react35 = require("@phosphor-icons/react");
|
|
6205
6423
|
var import_ssr5 = require("@phosphor-icons/react/dist/ssr");
|
|
6206
6424
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
@@ -6575,7 +6793,7 @@ var DraggableTooltipComponent = ({
|
|
|
6575
6793
|
);
|
|
6576
6794
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
|
|
6577
6795
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6578
|
-
|
|
6796
|
+
import_framer_motion15.motion.div,
|
|
6579
6797
|
{
|
|
6580
6798
|
className: "fixed pointer-events-none z-30",
|
|
6581
6799
|
variants: guideVariants,
|
|
@@ -6597,7 +6815,7 @@ var DraggableTooltipComponent = ({
|
|
|
6597
6815
|
}
|
|
6598
6816
|
),
|
|
6599
6817
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6600
|
-
|
|
6818
|
+
import_framer_motion15.motion.div,
|
|
6601
6819
|
{
|
|
6602
6820
|
className: "fixed pointer-events-none z-31",
|
|
6603
6821
|
variants: guideDotVariants,
|
|
@@ -6616,7 +6834,7 @@ var DraggableTooltipComponent = ({
|
|
|
6616
6834
|
}
|
|
6617
6835
|
),
|
|
6618
6836
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6619
|
-
|
|
6837
|
+
import_framer_motion15.motion.div,
|
|
6620
6838
|
{
|
|
6621
6839
|
className: "fixed pointer-events-none z-31",
|
|
6622
6840
|
variants: guideDotVariants,
|
|
@@ -6636,8 +6854,8 @@ var DraggableTooltipComponent = ({
|
|
|
6636
6854
|
)
|
|
6637
6855
|
] }, index);
|
|
6638
6856
|
}),
|
|
6639
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6640
|
-
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_framer_motion15.AnimatePresence, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6858
|
+
import_framer_motion15.motion.div,
|
|
6641
6859
|
{
|
|
6642
6860
|
className: "fixed bg-card border border-border rounded-lg shadow-lg z-50 min-w-80 select-none",
|
|
6643
6861
|
variants: tooltipVariants,
|
|
@@ -9152,14 +9370,1363 @@ var useChartHighlights = () => {
|
|
|
9152
9370
|
};
|
|
9153
9371
|
};
|
|
9154
9372
|
|
|
9373
|
+
// src/components/ui/SmallButtons.tsx
|
|
9374
|
+
var React38 = __toESM(require("react"));
|
|
9375
|
+
var import_react40 = require("@phosphor-icons/react");
|
|
9376
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
9377
|
+
var EditButton = React38.forwardRef(
|
|
9378
|
+
({
|
|
9379
|
+
disabled,
|
|
9380
|
+
onClick,
|
|
9381
|
+
testid = "button-edit",
|
|
9382
|
+
className,
|
|
9383
|
+
iconSize = 18,
|
|
9384
|
+
iconColor,
|
|
9385
|
+
variant = "default",
|
|
9386
|
+
size = "icon",
|
|
9387
|
+
...props
|
|
9388
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9389
|
+
ButtonBase,
|
|
9390
|
+
{
|
|
9391
|
+
ref,
|
|
9392
|
+
variant,
|
|
9393
|
+
size,
|
|
9394
|
+
onClick,
|
|
9395
|
+
disabled,
|
|
9396
|
+
testid,
|
|
9397
|
+
className: cn(
|
|
9398
|
+
"transition-all duration-200 ease-in-out group",
|
|
9399
|
+
"hover:scale-105",
|
|
9400
|
+
"active:scale-95",
|
|
9401
|
+
"disabled:hover:scale-100",
|
|
9402
|
+
className
|
|
9403
|
+
),
|
|
9404
|
+
...props,
|
|
9405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9406
|
+
import_react40.PencilSimpleIcon,
|
|
9407
|
+
{
|
|
9408
|
+
size: iconSize,
|
|
9409
|
+
color: iconColor,
|
|
9410
|
+
className: "transition-transform duration-200 group-hover:-rotate-12"
|
|
9411
|
+
}
|
|
9412
|
+
)
|
|
9413
|
+
}
|
|
9414
|
+
)
|
|
9415
|
+
);
|
|
9416
|
+
EditButton.displayName = "EditButton";
|
|
9417
|
+
var ChangeButton = React38.forwardRef(
|
|
9418
|
+
({
|
|
9419
|
+
disabled,
|
|
9420
|
+
onClick,
|
|
9421
|
+
testid = "button-edit",
|
|
9422
|
+
className,
|
|
9423
|
+
iconSize = 18,
|
|
9424
|
+
iconColor,
|
|
9425
|
+
variant = "default",
|
|
9426
|
+
size = "icon",
|
|
9427
|
+
...props
|
|
9428
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9429
|
+
ButtonBase,
|
|
9430
|
+
{
|
|
9431
|
+
ref,
|
|
9432
|
+
variant,
|
|
9433
|
+
size,
|
|
9434
|
+
onClick,
|
|
9435
|
+
disabled,
|
|
9436
|
+
testid,
|
|
9437
|
+
className: cn(
|
|
9438
|
+
"transition-all duration-200 ease-in-out group",
|
|
9439
|
+
"hover:scale-105",
|
|
9440
|
+
"active:scale-95",
|
|
9441
|
+
"disabled:hover:scale-100",
|
|
9442
|
+
className
|
|
9443
|
+
),
|
|
9444
|
+
...props,
|
|
9445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9446
|
+
import_react40.ArrowsLeftRightIcon,
|
|
9447
|
+
{
|
|
9448
|
+
size: iconSize,
|
|
9449
|
+
color: iconColor,
|
|
9450
|
+
className: "transition-transform duration-200 group-hover:-rotate-180"
|
|
9451
|
+
}
|
|
9452
|
+
)
|
|
9453
|
+
}
|
|
9454
|
+
)
|
|
9455
|
+
);
|
|
9456
|
+
ChangeButton.displayName = "ChangeButton";
|
|
9457
|
+
var SaveButton = React38.forwardRef(
|
|
9458
|
+
({
|
|
9459
|
+
disabled,
|
|
9460
|
+
onClick,
|
|
9461
|
+
testid = "button-save",
|
|
9462
|
+
className,
|
|
9463
|
+
iconSize = 18,
|
|
9464
|
+
iconColor,
|
|
9465
|
+
variant = "default",
|
|
9466
|
+
size = "icon",
|
|
9467
|
+
...props
|
|
9468
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9469
|
+
ButtonBase,
|
|
9470
|
+
{
|
|
9471
|
+
ref,
|
|
9472
|
+
variant,
|
|
9473
|
+
size,
|
|
9474
|
+
onClick,
|
|
9475
|
+
disabled,
|
|
9476
|
+
testid,
|
|
9477
|
+
className: cn(
|
|
9478
|
+
"transition-all duration-200 ease-in-out group",
|
|
9479
|
+
"hover:scale-105",
|
|
9480
|
+
"active:scale-95",
|
|
9481
|
+
"disabled:hover:scale-100",
|
|
9482
|
+
className
|
|
9483
|
+
),
|
|
9484
|
+
...props,
|
|
9485
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9486
|
+
import_react40.FloppyDiskIcon,
|
|
9487
|
+
{
|
|
9488
|
+
size: iconSize,
|
|
9489
|
+
color: iconColor,
|
|
9490
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
9491
|
+
}
|
|
9492
|
+
)
|
|
9493
|
+
}
|
|
9494
|
+
)
|
|
9495
|
+
);
|
|
9496
|
+
SaveButton.displayName = "SaveButton";
|
|
9497
|
+
var AddButton = React38.forwardRef(
|
|
9498
|
+
({
|
|
9499
|
+
disabled,
|
|
9500
|
+
onClick,
|
|
9501
|
+
testid = "button-add",
|
|
9502
|
+
className,
|
|
9503
|
+
iconSize = 18,
|
|
9504
|
+
iconColor,
|
|
9505
|
+
variant = "default",
|
|
9506
|
+
size = "icon",
|
|
9507
|
+
...props
|
|
9508
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9509
|
+
ButtonBase,
|
|
9510
|
+
{
|
|
9511
|
+
ref,
|
|
9512
|
+
variant,
|
|
9513
|
+
size,
|
|
9514
|
+
onClick,
|
|
9515
|
+
disabled,
|
|
9516
|
+
testid,
|
|
9517
|
+
className: cn(
|
|
9518
|
+
"transition-all duration-200 ease-in-out",
|
|
9519
|
+
"hover:scale-105",
|
|
9520
|
+
"active:scale-95",
|
|
9521
|
+
"disabled:hover:scale-100",
|
|
9522
|
+
className
|
|
9523
|
+
),
|
|
9524
|
+
...props,
|
|
9525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9526
|
+
import_react40.PlusIcon,
|
|
9527
|
+
{
|
|
9528
|
+
size: iconSize,
|
|
9529
|
+
color: iconColor,
|
|
9530
|
+
className: "transition-transform duration-300"
|
|
9531
|
+
}
|
|
9532
|
+
)
|
|
9533
|
+
}
|
|
9534
|
+
)
|
|
9535
|
+
);
|
|
9536
|
+
AddButton.displayName = "AddButton";
|
|
9537
|
+
var CloseButton = React38.forwardRef(
|
|
9538
|
+
({
|
|
9539
|
+
disabled,
|
|
9540
|
+
onClick,
|
|
9541
|
+
testid = "button-close",
|
|
9542
|
+
className,
|
|
9543
|
+
iconSize = 18,
|
|
9544
|
+
iconColor,
|
|
9545
|
+
variant = "ghost",
|
|
9546
|
+
size = "icon",
|
|
9547
|
+
...props
|
|
9548
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9549
|
+
ButtonBase,
|
|
9550
|
+
{
|
|
9551
|
+
ref,
|
|
9552
|
+
variant,
|
|
9553
|
+
size,
|
|
9554
|
+
onClick,
|
|
9555
|
+
disabled,
|
|
9556
|
+
testid,
|
|
9557
|
+
className: cn(
|
|
9558
|
+
"transition-all duration-200 ease-in-out",
|
|
9559
|
+
"hover:scale-110 hover:rotate-90 hover:bg-destructive/10",
|
|
9560
|
+
"active:scale-95 active:rotate-0",
|
|
9561
|
+
"disabled:hover:scale-100 disabled:hover:rotate-0",
|
|
9562
|
+
className
|
|
9563
|
+
),
|
|
9564
|
+
...props,
|
|
9565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9566
|
+
import_react40.XIcon,
|
|
9567
|
+
{
|
|
9568
|
+
size: iconSize,
|
|
9569
|
+
color: iconColor,
|
|
9570
|
+
className: "transition-transform duration-300"
|
|
9571
|
+
}
|
|
9572
|
+
)
|
|
9573
|
+
}
|
|
9574
|
+
)
|
|
9575
|
+
);
|
|
9576
|
+
CloseButton.displayName = "CloseButton";
|
|
9577
|
+
var DeleteButton = React38.forwardRef(
|
|
9578
|
+
({
|
|
9579
|
+
disabled,
|
|
9580
|
+
onClick,
|
|
9581
|
+
testid = "button-delete",
|
|
9582
|
+
className,
|
|
9583
|
+
iconSize = 18,
|
|
9584
|
+
iconColor,
|
|
9585
|
+
variant = "destructive",
|
|
9586
|
+
size = "icon",
|
|
9587
|
+
destructiveTitle,
|
|
9588
|
+
destructiveDescription,
|
|
9589
|
+
destructiveOnConfirm,
|
|
9590
|
+
destructiveOnCancel,
|
|
9591
|
+
destructiveTriggerContent,
|
|
9592
|
+
...props
|
|
9593
|
+
}, ref) => {
|
|
9594
|
+
const effectiveDestructiveTitle = destructiveTitle ?? props.title;
|
|
9595
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9596
|
+
ButtonBase,
|
|
9597
|
+
{
|
|
9598
|
+
ref,
|
|
9599
|
+
variant,
|
|
9600
|
+
size,
|
|
9601
|
+
onClick,
|
|
9602
|
+
disabled,
|
|
9603
|
+
testid,
|
|
9604
|
+
className: cn(
|
|
9605
|
+
"transition-all duration-200 ease-in-out group",
|
|
9606
|
+
"hover:scale-105",
|
|
9607
|
+
"active:scale-95",
|
|
9608
|
+
"disabled:hover:scale-100",
|
|
9609
|
+
className
|
|
9610
|
+
),
|
|
9611
|
+
...props,
|
|
9612
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9613
|
+
import_react40.TrashIcon,
|
|
9614
|
+
{
|
|
9615
|
+
size: iconSize,
|
|
9616
|
+
color: iconColor,
|
|
9617
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
9618
|
+
}
|
|
9619
|
+
)
|
|
9620
|
+
}
|
|
9621
|
+
);
|
|
9622
|
+
if (effectiveDestructiveTitle) {
|
|
9623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9624
|
+
DestructiveDialog,
|
|
9625
|
+
{
|
|
9626
|
+
title: effectiveDestructiveTitle,
|
|
9627
|
+
description: destructiveDescription ?? "Essa a\xE7\xE3o \xE9 irrevers\xEDvel.",
|
|
9628
|
+
onConfirm: destructiveOnConfirm ?? (() => {
|
|
9629
|
+
}),
|
|
9630
|
+
onCancel: destructiveOnCancel,
|
|
9631
|
+
triggerContent: destructiveTriggerContent,
|
|
9632
|
+
children: trigger
|
|
9633
|
+
}
|
|
9634
|
+
);
|
|
9635
|
+
}
|
|
9636
|
+
return trigger;
|
|
9637
|
+
}
|
|
9638
|
+
);
|
|
9639
|
+
DeleteButton.displayName = "DeleteButton";
|
|
9640
|
+
var DownloadButton = ({
|
|
9641
|
+
disabled,
|
|
9642
|
+
onClick,
|
|
9643
|
+
testid = "button-download",
|
|
9644
|
+
...props
|
|
9645
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9646
|
+
ButtonBase,
|
|
9647
|
+
{
|
|
9648
|
+
variant: "outline",
|
|
9649
|
+
size: "icon",
|
|
9650
|
+
onClick,
|
|
9651
|
+
disabled,
|
|
9652
|
+
testid,
|
|
9653
|
+
className: cn(
|
|
9654
|
+
"transition-all duration-200 ease-in-out group",
|
|
9655
|
+
"hover:scale-105",
|
|
9656
|
+
"active:scale-95",
|
|
9657
|
+
"disabled:hover:scale-100"
|
|
9658
|
+
),
|
|
9659
|
+
...props,
|
|
9660
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9661
|
+
import_react40.DownloadSimpleIcon,
|
|
9662
|
+
{
|
|
9663
|
+
size: 18,
|
|
9664
|
+
className: "transition-transform duration-300 group-hover:translate-y-0.5"
|
|
9665
|
+
}
|
|
9666
|
+
)
|
|
9667
|
+
}
|
|
9668
|
+
);
|
|
9669
|
+
var UploadButton = ({
|
|
9670
|
+
disabled,
|
|
9671
|
+
onClick,
|
|
9672
|
+
testid = "button-upload",
|
|
9673
|
+
...props
|
|
9674
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9675
|
+
ButtonBase,
|
|
9676
|
+
{
|
|
9677
|
+
variant: "outline",
|
|
9678
|
+
size: "icon",
|
|
9679
|
+
onClick,
|
|
9680
|
+
disabled,
|
|
9681
|
+
testid,
|
|
9682
|
+
className: cn(
|
|
9683
|
+
"transition-all duration-200 ease-in-out group",
|
|
9684
|
+
"hover:scale-105",
|
|
9685
|
+
"active:scale-95",
|
|
9686
|
+
"disabled:hover:scale-100"
|
|
9687
|
+
),
|
|
9688
|
+
...props,
|
|
9689
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9690
|
+
import_react40.UploadSimpleIcon,
|
|
9691
|
+
{
|
|
9692
|
+
size: 18,
|
|
9693
|
+
className: "transition-transform duration-300 group-hover:-translate-y-0.5"
|
|
9694
|
+
}
|
|
9695
|
+
)
|
|
9696
|
+
}
|
|
9697
|
+
);
|
|
9698
|
+
var CopyButton = ({
|
|
9699
|
+
disabled,
|
|
9700
|
+
onClick,
|
|
9701
|
+
testid = "button-copy",
|
|
9702
|
+
...props
|
|
9703
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9704
|
+
ButtonBase,
|
|
9705
|
+
{
|
|
9706
|
+
variant: "ghost",
|
|
9707
|
+
size: "icon",
|
|
9708
|
+
onClick,
|
|
9709
|
+
disabled,
|
|
9710
|
+
testid,
|
|
9711
|
+
className: cn(
|
|
9712
|
+
"transition-all duration-200 ease-in-out group",
|
|
9713
|
+
"hover:scale-105",
|
|
9714
|
+
"active:scale-90",
|
|
9715
|
+
"disabled:hover:scale-100"
|
|
9716
|
+
),
|
|
9717
|
+
...props,
|
|
9718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9719
|
+
import_react40.CopyIcon,
|
|
9720
|
+
{
|
|
9721
|
+
size: 18,
|
|
9722
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
9723
|
+
}
|
|
9724
|
+
)
|
|
9725
|
+
}
|
|
9726
|
+
);
|
|
9727
|
+
var RefreshButton = ({
|
|
9728
|
+
disabled,
|
|
9729
|
+
onClick,
|
|
9730
|
+
testid = "button-refresh",
|
|
9731
|
+
...props
|
|
9732
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9733
|
+
ButtonBase,
|
|
9734
|
+
{
|
|
9735
|
+
variant: "ghost",
|
|
9736
|
+
size: "icon",
|
|
9737
|
+
onClick,
|
|
9738
|
+
disabled,
|
|
9739
|
+
testid,
|
|
9740
|
+
className: cn(
|
|
9741
|
+
"transition-all duration-200 ease-in-out group",
|
|
9742
|
+
"hover:scale-105",
|
|
9743
|
+
"active:scale-95",
|
|
9744
|
+
"disabled:hover:scale-100"
|
|
9745
|
+
),
|
|
9746
|
+
...props,
|
|
9747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9748
|
+
import_react40.ArrowClockwiseIcon,
|
|
9749
|
+
{
|
|
9750
|
+
size: 18,
|
|
9751
|
+
className: "transition-transform duration-500 group-hover:rotate-180"
|
|
9752
|
+
}
|
|
9753
|
+
)
|
|
9754
|
+
}
|
|
9755
|
+
);
|
|
9756
|
+
var SearchButton = ({
|
|
9757
|
+
disabled,
|
|
9758
|
+
onClick,
|
|
9759
|
+
testid = "button-search",
|
|
9760
|
+
...props
|
|
9761
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9762
|
+
ButtonBase,
|
|
9763
|
+
{
|
|
9764
|
+
variant: "outline",
|
|
9765
|
+
size: "icon",
|
|
9766
|
+
onClick,
|
|
9767
|
+
disabled,
|
|
9768
|
+
testid,
|
|
9769
|
+
className: cn(
|
|
9770
|
+
"transition-all duration-200 ease-in-out group",
|
|
9771
|
+
"hover:scale-105",
|
|
9772
|
+
"active:scale-95",
|
|
9773
|
+
"disabled:hover:scale-100"
|
|
9774
|
+
),
|
|
9775
|
+
...props,
|
|
9776
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9777
|
+
import_react40.MagnifyingGlassIcon,
|
|
9778
|
+
{
|
|
9779
|
+
size: 18,
|
|
9780
|
+
className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
|
|
9781
|
+
}
|
|
9782
|
+
)
|
|
9783
|
+
}
|
|
9784
|
+
);
|
|
9785
|
+
var BackButton = ({
|
|
9786
|
+
disabled,
|
|
9787
|
+
onClick,
|
|
9788
|
+
testid = "button-back",
|
|
9789
|
+
...props
|
|
9790
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9791
|
+
ButtonBase,
|
|
9792
|
+
{
|
|
9793
|
+
variant: "ghost",
|
|
9794
|
+
size: "icon",
|
|
9795
|
+
onClick,
|
|
9796
|
+
disabled,
|
|
9797
|
+
testid,
|
|
9798
|
+
className: cn(
|
|
9799
|
+
"transition-all duration-200 ease-in-out group",
|
|
9800
|
+
"hover:scale-105",
|
|
9801
|
+
"active:scale-95",
|
|
9802
|
+
"disabled:hover:scale-100"
|
|
9803
|
+
),
|
|
9804
|
+
...props,
|
|
9805
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9806
|
+
import_react40.ArrowLeftIcon,
|
|
9807
|
+
{
|
|
9808
|
+
size: 18,
|
|
9809
|
+
className: "transition-transform duration-300 group-hover:-translate-x-1"
|
|
9810
|
+
}
|
|
9811
|
+
)
|
|
9812
|
+
}
|
|
9813
|
+
);
|
|
9814
|
+
var SettingsButton = ({
|
|
9815
|
+
disabled,
|
|
9816
|
+
onClick,
|
|
9817
|
+
testid = "button-settings",
|
|
9818
|
+
...props
|
|
9819
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9820
|
+
ButtonBase,
|
|
9821
|
+
{
|
|
9822
|
+
variant: "ghost",
|
|
9823
|
+
size: "icon",
|
|
9824
|
+
onClick,
|
|
9825
|
+
disabled,
|
|
9826
|
+
testid,
|
|
9827
|
+
className: cn(
|
|
9828
|
+
"transition-all duration-200 ease-in-out group",
|
|
9829
|
+
"hover:scale-105",
|
|
9830
|
+
"active:scale-95",
|
|
9831
|
+
"disabled:hover:scale-100"
|
|
9832
|
+
),
|
|
9833
|
+
...props,
|
|
9834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9835
|
+
import_react40.GearIcon,
|
|
9836
|
+
{
|
|
9837
|
+
size: 18,
|
|
9838
|
+
className: "transition-transform duration-500 group-hover:rotate-90"
|
|
9839
|
+
}
|
|
9840
|
+
)
|
|
9841
|
+
}
|
|
9842
|
+
);
|
|
9843
|
+
var NotificationButton = ({
|
|
9844
|
+
disabled,
|
|
9845
|
+
onClick,
|
|
9846
|
+
testid = "button-notification",
|
|
9847
|
+
...props
|
|
9848
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9849
|
+
ButtonBase,
|
|
9850
|
+
{
|
|
9851
|
+
variant: "ghost",
|
|
9852
|
+
size: "icon",
|
|
9853
|
+
onClick,
|
|
9854
|
+
disabled,
|
|
9855
|
+
testid,
|
|
9856
|
+
className: cn(
|
|
9857
|
+
"transition-all duration-200 ease-in-out group",
|
|
9858
|
+
"hover:scale-105",
|
|
9859
|
+
"active:scale-95",
|
|
9860
|
+
"disabled:hover:scale-100"
|
|
9861
|
+
),
|
|
9862
|
+
...props,
|
|
9863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9864
|
+
import_react40.BellIcon,
|
|
9865
|
+
{
|
|
9866
|
+
size: 18,
|
|
9867
|
+
className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
|
|
9868
|
+
}
|
|
9869
|
+
)
|
|
9870
|
+
}
|
|
9871
|
+
);
|
|
9872
|
+
var MoreButton = ({
|
|
9873
|
+
disabled,
|
|
9874
|
+
onClick,
|
|
9875
|
+
testid = "button-more",
|
|
9876
|
+
...props
|
|
9877
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9878
|
+
ButtonBase,
|
|
9879
|
+
{
|
|
9880
|
+
variant: "ghost",
|
|
9881
|
+
size: "icon",
|
|
9882
|
+
onClick,
|
|
9883
|
+
disabled,
|
|
9884
|
+
testid,
|
|
9885
|
+
className: cn(
|
|
9886
|
+
"transition-all duration-200 ease-in-out group",
|
|
9887
|
+
"hover:scale-105",
|
|
9888
|
+
"active:scale-95",
|
|
9889
|
+
"disabled:hover:scale-100"
|
|
9890
|
+
),
|
|
9891
|
+
...props,
|
|
9892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9893
|
+
import_react40.DotsThreeIcon,
|
|
9894
|
+
{
|
|
9895
|
+
size: 18,
|
|
9896
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
9897
|
+
}
|
|
9898
|
+
)
|
|
9899
|
+
}
|
|
9900
|
+
);
|
|
9901
|
+
var CheckButton = ({
|
|
9902
|
+
disabled,
|
|
9903
|
+
onClick,
|
|
9904
|
+
testid = "button-check",
|
|
9905
|
+
...props
|
|
9906
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9907
|
+
ButtonBase,
|
|
9908
|
+
{
|
|
9909
|
+
variant: "default",
|
|
9910
|
+
size: "icon",
|
|
9911
|
+
onClick,
|
|
9912
|
+
disabled,
|
|
9913
|
+
testid,
|
|
9914
|
+
className: cn(
|
|
9915
|
+
"transition-all duration-200 ease-in-out group",
|
|
9916
|
+
"hover:scale-110",
|
|
9917
|
+
"active:scale-95",
|
|
9918
|
+
"disabled:hover:scale-100"
|
|
9919
|
+
),
|
|
9920
|
+
...props,
|
|
9921
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9922
|
+
import_react40.CheckIcon,
|
|
9923
|
+
{
|
|
9924
|
+
size: 18,
|
|
9925
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
9926
|
+
}
|
|
9927
|
+
)
|
|
9928
|
+
}
|
|
9929
|
+
);
|
|
9930
|
+
var FilterButton = ({
|
|
9931
|
+
disabled,
|
|
9932
|
+
onClick,
|
|
9933
|
+
testid = "button-filter",
|
|
9934
|
+
active = false,
|
|
9935
|
+
className,
|
|
9936
|
+
iconSize = 18,
|
|
9937
|
+
iconColor,
|
|
9938
|
+
variant,
|
|
9939
|
+
size = "icon",
|
|
9940
|
+
...props
|
|
9941
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9942
|
+
ButtonBase,
|
|
9943
|
+
{
|
|
9944
|
+
variant: variant || (active ? "default" : "outline"),
|
|
9945
|
+
size,
|
|
9946
|
+
onClick,
|
|
9947
|
+
disabled,
|
|
9948
|
+
testid,
|
|
9949
|
+
className: cn(
|
|
9950
|
+
"transition-all duration-200 ease-in-out",
|
|
9951
|
+
"hover:scale-105",
|
|
9952
|
+
"active:scale-95",
|
|
9953
|
+
"disabled:hover:scale-100",
|
|
9954
|
+
className
|
|
9955
|
+
),
|
|
9956
|
+
...props,
|
|
9957
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9958
|
+
import_react40.FunnelIcon,
|
|
9959
|
+
{
|
|
9960
|
+
size: iconSize,
|
|
9961
|
+
color: iconColor,
|
|
9962
|
+
weight: active ? "fill" : "regular",
|
|
9963
|
+
className: "transition-all duration-200"
|
|
9964
|
+
}
|
|
9965
|
+
)
|
|
9966
|
+
}
|
|
9967
|
+
);
|
|
9968
|
+
var LikeButton = ({
|
|
9969
|
+
disabled,
|
|
9970
|
+
onClick,
|
|
9971
|
+
testid = "button-like",
|
|
9972
|
+
isLiked = false,
|
|
9973
|
+
className,
|
|
9974
|
+
iconSize = 18,
|
|
9975
|
+
iconColor,
|
|
9976
|
+
variant = "ghost",
|
|
9977
|
+
size = "icon",
|
|
9978
|
+
...props
|
|
9979
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9980
|
+
ButtonBase,
|
|
9981
|
+
{
|
|
9982
|
+
variant,
|
|
9983
|
+
size,
|
|
9984
|
+
onClick,
|
|
9985
|
+
disabled,
|
|
9986
|
+
testid,
|
|
9987
|
+
className: cn(
|
|
9988
|
+
"transition-all duration-200 ease-in-out group",
|
|
9989
|
+
"hover:scale-110",
|
|
9990
|
+
"active:scale-95",
|
|
9991
|
+
"disabled:hover:scale-100",
|
|
9992
|
+
!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"),
|
|
9993
|
+
className
|
|
9994
|
+
),
|
|
9995
|
+
...props,
|
|
9996
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9997
|
+
import_react40.HeartIcon,
|
|
9998
|
+
{
|
|
9999
|
+
size: iconSize,
|
|
10000
|
+
color: iconColor,
|
|
10001
|
+
weight: isLiked ? "fill" : "regular",
|
|
10002
|
+
className: "transition-all duration-300 group-hover:scale-110"
|
|
10003
|
+
}
|
|
10004
|
+
)
|
|
10005
|
+
}
|
|
10006
|
+
);
|
|
10007
|
+
var FavoriteButton = ({
|
|
10008
|
+
disabled,
|
|
10009
|
+
onClick,
|
|
10010
|
+
testid = "button-favorite",
|
|
10011
|
+
isFavorite = false,
|
|
10012
|
+
className,
|
|
10013
|
+
iconSize = 18,
|
|
10014
|
+
iconColor,
|
|
10015
|
+
variant = "ghost",
|
|
10016
|
+
size = "icon",
|
|
10017
|
+
...props
|
|
10018
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10019
|
+
ButtonBase,
|
|
10020
|
+
{
|
|
10021
|
+
variant,
|
|
10022
|
+
size,
|
|
10023
|
+
onClick,
|
|
10024
|
+
disabled,
|
|
10025
|
+
testid,
|
|
10026
|
+
className: cn(
|
|
10027
|
+
"transition-all duration-200 ease-in-out group",
|
|
10028
|
+
"hover:scale-110",
|
|
10029
|
+
"active:scale-95",
|
|
10030
|
+
"disabled:hover:scale-100",
|
|
10031
|
+
!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"),
|
|
10032
|
+
className
|
|
10033
|
+
),
|
|
10034
|
+
...props,
|
|
10035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10036
|
+
import_react40.StarIcon,
|
|
10037
|
+
{
|
|
10038
|
+
size: iconSize,
|
|
10039
|
+
color: iconColor,
|
|
10040
|
+
weight: isFavorite ? "fill" : "regular",
|
|
10041
|
+
className: "transition-all duration-300 group-hover:rotate-12"
|
|
10042
|
+
}
|
|
10043
|
+
)
|
|
10044
|
+
}
|
|
10045
|
+
);
|
|
10046
|
+
var VisibilityButton = ({
|
|
10047
|
+
disabled,
|
|
10048
|
+
onClick,
|
|
10049
|
+
testid = "button-visibility",
|
|
10050
|
+
isVisible = true,
|
|
10051
|
+
className,
|
|
10052
|
+
iconSize = 18,
|
|
10053
|
+
iconColor,
|
|
10054
|
+
variant = "ghost",
|
|
10055
|
+
size = "icon",
|
|
10056
|
+
...props
|
|
10057
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10058
|
+
ButtonBase,
|
|
10059
|
+
{
|
|
10060
|
+
variant,
|
|
10061
|
+
size,
|
|
10062
|
+
onClick,
|
|
10063
|
+
disabled,
|
|
10064
|
+
testid,
|
|
10065
|
+
className: cn(
|
|
10066
|
+
"transition-all duration-200 ease-in-out",
|
|
10067
|
+
"hover:scale-105",
|
|
10068
|
+
"active:scale-95",
|
|
10069
|
+
"disabled:hover:scale-100",
|
|
10070
|
+
className
|
|
10071
|
+
),
|
|
10072
|
+
...props,
|
|
10073
|
+
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10074
|
+
import_react40.EyeIcon,
|
|
10075
|
+
{
|
|
10076
|
+
size: iconSize,
|
|
10077
|
+
color: iconColor,
|
|
10078
|
+
className: "transition-opacity duration-200"
|
|
10079
|
+
}
|
|
10080
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10081
|
+
import_react40.EyeSlashIcon,
|
|
10082
|
+
{
|
|
10083
|
+
size: iconSize,
|
|
10084
|
+
color: iconColor,
|
|
10085
|
+
className: "transition-opacity duration-200"
|
|
10086
|
+
}
|
|
10087
|
+
)
|
|
10088
|
+
}
|
|
10089
|
+
);
|
|
10090
|
+
var ViewButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VisibilityButton, { isVisible: true, testid: "button-view", ...props });
|
|
10091
|
+
var HideButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VisibilityButton, { isVisible: false, testid: "button-hide", ...props });
|
|
10092
|
+
var LockButton = ({
|
|
10093
|
+
disabled,
|
|
10094
|
+
onClick,
|
|
10095
|
+
testid = "button-lock",
|
|
10096
|
+
isLocked = true,
|
|
10097
|
+
className,
|
|
10098
|
+
iconSize = 18,
|
|
10099
|
+
iconColor,
|
|
10100
|
+
variant = "ghost",
|
|
10101
|
+
size = "icon",
|
|
10102
|
+
...props
|
|
10103
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10104
|
+
ButtonBase,
|
|
10105
|
+
{
|
|
10106
|
+
variant,
|
|
10107
|
+
size,
|
|
10108
|
+
onClick,
|
|
10109
|
+
disabled,
|
|
10110
|
+
testid,
|
|
10111
|
+
className: cn(
|
|
10112
|
+
"transition-all duration-200 ease-in-out group",
|
|
10113
|
+
"hover:scale-105",
|
|
10114
|
+
"active:scale-95",
|
|
10115
|
+
"disabled:hover:scale-100",
|
|
10116
|
+
!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"),
|
|
10117
|
+
className
|
|
10118
|
+
),
|
|
10119
|
+
...props,
|
|
10120
|
+
children: isLocked ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10121
|
+
import_react40.LockIcon,
|
|
10122
|
+
{
|
|
10123
|
+
size: iconSize,
|
|
10124
|
+
color: iconColor,
|
|
10125
|
+
className: "transition-all duration-200 group-hover:scale-110"
|
|
10126
|
+
}
|
|
10127
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
10128
|
+
import_react40.LockOpenIcon,
|
|
10129
|
+
{
|
|
10130
|
+
size: iconSize,
|
|
10131
|
+
color: iconColor,
|
|
10132
|
+
className: "transition-all duration-200 group-hover:scale-110"
|
|
10133
|
+
}
|
|
10134
|
+
)
|
|
10135
|
+
}
|
|
10136
|
+
);
|
|
10137
|
+
var UnlockButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(LockButton, { isLocked: false, testid: "button-unlock", ...props });
|
|
10138
|
+
|
|
10139
|
+
// src/components/ui/DebounceInput.tsx
|
|
10140
|
+
var import_react41 = require("react");
|
|
10141
|
+
var import_react42 = require("@phosphor-icons/react");
|
|
10142
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
10143
|
+
|
|
10144
|
+
// src/components/ui/FileUploader.tsx
|
|
10145
|
+
var React39 = __toESM(require("react"));
|
|
10146
|
+
var import_framer_motion16 = require("framer-motion");
|
|
10147
|
+
var import_react43 = require("@phosphor-icons/react");
|
|
10148
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10149
|
+
var formatFileSize = (bytes) => {
|
|
10150
|
+
if (bytes === 0) return "0 Bytes";
|
|
10151
|
+
const k = 1024;
|
|
10152
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
10153
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
10154
|
+
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
|
|
10155
|
+
};
|
|
10156
|
+
var getFileExtension = (filename) => {
|
|
10157
|
+
return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
|
|
10158
|
+
};
|
|
10159
|
+
var getFileTypeIcon = (file) => {
|
|
10160
|
+
const extension = getFileExtension(file.name).toLowerCase();
|
|
10161
|
+
const mimeType = file.type.toLowerCase();
|
|
10162
|
+
if (extension === "pdf" || mimeType === "application/pdf") {
|
|
10163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
10164
|
+
}
|
|
10165
|
+
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
10166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
10167
|
+
}
|
|
10168
|
+
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
10169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
10170
|
+
}
|
|
10171
|
+
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
10172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
10173
|
+
}
|
|
10174
|
+
if (extension === "csv" || mimeType === "text/csv") {
|
|
10175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
10176
|
+
}
|
|
10177
|
+
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
10178
|
+
extension
|
|
10179
|
+
) || mimeType.includes("text")) {
|
|
10180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
10181
|
+
}
|
|
10182
|
+
if (mimeType.startsWith("image/")) {
|
|
10183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
10184
|
+
}
|
|
10185
|
+
if (mimeType.startsWith("video/")) {
|
|
10186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
10187
|
+
}
|
|
10188
|
+
if (mimeType.startsWith("audio/")) {
|
|
10189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
10190
|
+
}
|
|
10191
|
+
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
10192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
10193
|
+
}
|
|
10194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
10195
|
+
};
|
|
10196
|
+
var createImagePreview = (file) => {
|
|
10197
|
+
return new Promise((resolve) => {
|
|
10198
|
+
if (!file.type.startsWith("image/")) {
|
|
10199
|
+
resolve(null);
|
|
10200
|
+
return;
|
|
10201
|
+
}
|
|
10202
|
+
const reader = new FileReader();
|
|
10203
|
+
reader.onload = (e) => {
|
|
10204
|
+
resolve(e.target?.result);
|
|
10205
|
+
};
|
|
10206
|
+
reader.onerror = () => {
|
|
10207
|
+
resolve(null);
|
|
10208
|
+
};
|
|
10209
|
+
reader.readAsDataURL(file);
|
|
10210
|
+
});
|
|
10211
|
+
};
|
|
10212
|
+
var FileUploader = React39.forwardRef(
|
|
10213
|
+
({
|
|
10214
|
+
className,
|
|
10215
|
+
accept,
|
|
10216
|
+
maxSize,
|
|
10217
|
+
maxFiles = 1,
|
|
10218
|
+
disabled = false,
|
|
10219
|
+
value = [],
|
|
10220
|
+
onValueChange,
|
|
10221
|
+
onUpload,
|
|
10222
|
+
showPreview = true,
|
|
10223
|
+
dropzoneText = "Arraste arquivos aqui ou clique para selecionar",
|
|
10224
|
+
dropzoneSubtext,
|
|
10225
|
+
animate = true,
|
|
10226
|
+
...props
|
|
10227
|
+
}, ref) => {
|
|
10228
|
+
const [isDragging, setIsDragging] = React39.useState(false);
|
|
10229
|
+
const [files, setFiles] = React39.useState(value);
|
|
10230
|
+
const inputRef = React39.useRef(null);
|
|
10231
|
+
const dragCounterRef = React39.useRef(0);
|
|
10232
|
+
const multiple = maxFiles > 1;
|
|
10233
|
+
React39.useEffect(() => {
|
|
10234
|
+
setFiles(value);
|
|
10235
|
+
}, [value]);
|
|
10236
|
+
React39.useEffect(() => {
|
|
10237
|
+
return () => {
|
|
10238
|
+
files.forEach((file) => {
|
|
10239
|
+
if (file.preview) {
|
|
10240
|
+
URL.revokeObjectURL(file.preview);
|
|
10241
|
+
}
|
|
10242
|
+
});
|
|
10243
|
+
};
|
|
10244
|
+
}, [files]);
|
|
10245
|
+
const validateFile = (file) => {
|
|
10246
|
+
if (file.size > maxSize) {
|
|
10247
|
+
return `Arquivo muito grande. M\xE1ximo: ${formatFileSize(maxSize)}`;
|
|
10248
|
+
}
|
|
10249
|
+
if (accept.length > 0) {
|
|
10250
|
+
const fileExtension = `.${getFileExtension(file.name)}`;
|
|
10251
|
+
const fileType = file.type;
|
|
10252
|
+
const isAccepted = accept.some((acceptItem) => {
|
|
10253
|
+
if (acceptItem.startsWith(".")) {
|
|
10254
|
+
return fileExtension.toLowerCase() === acceptItem.toLowerCase();
|
|
10255
|
+
}
|
|
10256
|
+
if (acceptItem.endsWith("/*")) {
|
|
10257
|
+
return fileType.startsWith(acceptItem.replace("/*", ""));
|
|
10258
|
+
}
|
|
10259
|
+
return fileType === acceptItem;
|
|
10260
|
+
});
|
|
10261
|
+
if (!isAccepted) {
|
|
10262
|
+
return `Tipo de arquivo n\xE3o permitido. Aceitos: ${accept.join(", ")}`;
|
|
10263
|
+
}
|
|
10264
|
+
}
|
|
10265
|
+
return null;
|
|
10266
|
+
};
|
|
10267
|
+
const createFileWithPreview = async (file) => {
|
|
10268
|
+
const fileWithPreview = file;
|
|
10269
|
+
fileWithPreview.id = `${file.name}-${Date.now()}-${Math.random()}`;
|
|
10270
|
+
const error = validateFile(file);
|
|
10271
|
+
if (error) {
|
|
10272
|
+
fileWithPreview.error = error;
|
|
10273
|
+
}
|
|
10274
|
+
if (file.type.startsWith("image/")) {
|
|
10275
|
+
try {
|
|
10276
|
+
const preview = await createImagePreview(file);
|
|
10277
|
+
if (preview) {
|
|
10278
|
+
fileWithPreview.preview = preview;
|
|
10279
|
+
}
|
|
10280
|
+
} catch (error2) {
|
|
10281
|
+
console.warn("Erro ao criar preview da imagem:", error2);
|
|
10282
|
+
}
|
|
10283
|
+
}
|
|
10284
|
+
return fileWithPreview;
|
|
10285
|
+
};
|
|
10286
|
+
const handleFiles = async (newFiles) => {
|
|
10287
|
+
if (disabled) return;
|
|
10288
|
+
const availableSlots = maxFiles - files.length;
|
|
10289
|
+
const filesToAdd = multiple ? newFiles.slice(0, availableSlots) : [newFiles[0]];
|
|
10290
|
+
const filesWithPreview = await Promise.all(
|
|
10291
|
+
filesToAdd.map((file) => createFileWithPreview(file))
|
|
10292
|
+
);
|
|
10293
|
+
const updatedFiles = multiple ? [...files, ...filesWithPreview] : filesWithPreview;
|
|
10294
|
+
setFiles(updatedFiles);
|
|
10295
|
+
onValueChange(updatedFiles);
|
|
10296
|
+
if (onUpload) {
|
|
10297
|
+
const validFiles = filesWithPreview.filter((f) => !f.error);
|
|
10298
|
+
if (validFiles.length > 0) {
|
|
10299
|
+
try {
|
|
10300
|
+
await onUpload(validFiles);
|
|
10301
|
+
} catch (error) {
|
|
10302
|
+
console.error("Erro no upload:", error);
|
|
10303
|
+
}
|
|
10304
|
+
}
|
|
10305
|
+
}
|
|
10306
|
+
};
|
|
10307
|
+
const handleDragEnter = (e) => {
|
|
10308
|
+
e.preventDefault();
|
|
10309
|
+
e.stopPropagation();
|
|
10310
|
+
dragCounterRef.current++;
|
|
10311
|
+
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
|
|
10312
|
+
setIsDragging(true);
|
|
10313
|
+
}
|
|
10314
|
+
};
|
|
10315
|
+
const handleDragLeave = (e) => {
|
|
10316
|
+
e.preventDefault();
|
|
10317
|
+
e.stopPropagation();
|
|
10318
|
+
dragCounterRef.current--;
|
|
10319
|
+
if (dragCounterRef.current === 0) {
|
|
10320
|
+
setIsDragging(false);
|
|
10321
|
+
}
|
|
10322
|
+
};
|
|
10323
|
+
const handleDragOver = (e) => {
|
|
10324
|
+
e.preventDefault();
|
|
10325
|
+
e.stopPropagation();
|
|
10326
|
+
};
|
|
10327
|
+
const handleDrop = (e) => {
|
|
10328
|
+
e.preventDefault();
|
|
10329
|
+
e.stopPropagation();
|
|
10330
|
+
setIsDragging(false);
|
|
10331
|
+
dragCounterRef.current = 0;
|
|
10332
|
+
if (disabled) return;
|
|
10333
|
+
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
10334
|
+
handleFiles(droppedFiles);
|
|
10335
|
+
};
|
|
10336
|
+
const handleInputChange = (e) => {
|
|
10337
|
+
if (e.target.files) {
|
|
10338
|
+
const selectedFiles = Array.from(e.target.files);
|
|
10339
|
+
handleFiles(selectedFiles);
|
|
10340
|
+
}
|
|
10341
|
+
};
|
|
10342
|
+
const handleRemoveFile = (fileId) => {
|
|
10343
|
+
const fileToRemove = files.find((f) => f.id === fileId);
|
|
10344
|
+
if (fileToRemove?.preview) {
|
|
10345
|
+
URL.revokeObjectURL(fileToRemove.preview);
|
|
10346
|
+
}
|
|
10347
|
+
const updatedFiles = files.filter((f) => f.id !== fileId);
|
|
10348
|
+
setFiles(updatedFiles);
|
|
10349
|
+
onValueChange(updatedFiles);
|
|
10350
|
+
};
|
|
10351
|
+
const handleClick = () => {
|
|
10352
|
+
if (!disabled) {
|
|
10353
|
+
inputRef.current?.click();
|
|
10354
|
+
}
|
|
10355
|
+
};
|
|
10356
|
+
const acceptString = accept.join(",");
|
|
10357
|
+
const defaultSubtext = dropzoneSubtext || `Formatos: ${accept.join(", ")}. M\xE1ximo: ${formatFileSize(maxSize)}`;
|
|
10358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
10359
|
+
import_framer_motion16.motion.div,
|
|
10360
|
+
{
|
|
10361
|
+
className: cn(
|
|
10362
|
+
"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",
|
|
10363
|
+
isDragging && "border-primary bg-primary/10 scale-[1.02]",
|
|
10364
|
+
!isDragging && "border-border hover:border-primary/60 hover:bg-muted/50",
|
|
10365
|
+
disabled && "cursor-not-allowed opacity-50 hover:scale-100"
|
|
10366
|
+
),
|
|
10367
|
+
onDragEnter: handleDragEnter,
|
|
10368
|
+
onDragOver: handleDragOver,
|
|
10369
|
+
onDragLeave: handleDragLeave,
|
|
10370
|
+
onDrop: handleDrop,
|
|
10371
|
+
onClick: handleClick,
|
|
10372
|
+
whileHover: !disabled ? { scale: 1.01 } : void 0,
|
|
10373
|
+
whileTap: !disabled ? { scale: 0.99 } : void 0,
|
|
10374
|
+
animate: isDragging ? {
|
|
10375
|
+
borderColor: `hsl(var(--primary))`,
|
|
10376
|
+
backgroundColor: `hsl(var(--primary) / 0.1)`,
|
|
10377
|
+
scale: 1.02
|
|
10378
|
+
} : {
|
|
10379
|
+
borderColor: `hsl(var(--border))`,
|
|
10380
|
+
backgroundColor: `hsl(var(--background))`,
|
|
10381
|
+
scale: 1
|
|
10382
|
+
},
|
|
10383
|
+
transition: {
|
|
10384
|
+
type: "spring",
|
|
10385
|
+
stiffness: 300,
|
|
10386
|
+
damping: 25,
|
|
10387
|
+
duration: 0.3
|
|
10388
|
+
},
|
|
10389
|
+
children: [
|
|
10390
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10391
|
+
"input",
|
|
10392
|
+
{
|
|
10393
|
+
ref: inputRef,
|
|
10394
|
+
type: "file",
|
|
10395
|
+
className: "hidden",
|
|
10396
|
+
accept: acceptString,
|
|
10397
|
+
multiple,
|
|
10398
|
+
disabled,
|
|
10399
|
+
onChange: handleInputChange
|
|
10400
|
+
}
|
|
10401
|
+
),
|
|
10402
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10403
|
+
import_framer_motion16.motion.div,
|
|
10404
|
+
{
|
|
10405
|
+
animate: isDragging ? { scale: 1.2, rotate: 10 } : { scale: 1, rotate: 0 },
|
|
10406
|
+
transition: {
|
|
10407
|
+
type: "spring",
|
|
10408
|
+
stiffness: 300,
|
|
10409
|
+
damping: 20,
|
|
10410
|
+
duration: 0.3
|
|
10411
|
+
},
|
|
10412
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10413
|
+
import_framer_motion16.motion.div,
|
|
10414
|
+
{
|
|
10415
|
+
className: cn(
|
|
10416
|
+
"mb-4 h-16 w-16 text-muted-foreground transition-colors duration-300 drop-shadow-lg flex items-center justify-center",
|
|
10417
|
+
isDragging && "text-primary"
|
|
10418
|
+
),
|
|
10419
|
+
initial: false,
|
|
10420
|
+
animate: {
|
|
10421
|
+
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
10422
|
+
},
|
|
10423
|
+
transition: { duration: 0.3 },
|
|
10424
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.CloudArrowUpIcon, { size: 64 })
|
|
10425
|
+
}
|
|
10426
|
+
)
|
|
10427
|
+
}
|
|
10428
|
+
),
|
|
10429
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10430
|
+
import_framer_motion16.motion.p,
|
|
10431
|
+
{
|
|
10432
|
+
className: "mb-2 text-base font-semibold text-foreground",
|
|
10433
|
+
initial: animate ? { opacity: 0, y: -10 } : false,
|
|
10434
|
+
animate: { opacity: 1, y: 0 },
|
|
10435
|
+
transition: { delay: 0.1 },
|
|
10436
|
+
children: dropzoneText
|
|
10437
|
+
}
|
|
10438
|
+
),
|
|
10439
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10440
|
+
import_framer_motion16.motion.p,
|
|
10441
|
+
{
|
|
10442
|
+
className: "text-sm text-muted-foreground",
|
|
10443
|
+
initial: animate ? { opacity: 0, y: -10 } : false,
|
|
10444
|
+
animate: { opacity: 1, y: 0 },
|
|
10445
|
+
transition: { delay: 0.2 },
|
|
10446
|
+
children: defaultSubtext
|
|
10447
|
+
}
|
|
10448
|
+
),
|
|
10449
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_framer_motion16.AnimatePresence, { children: files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
10450
|
+
import_framer_motion16.motion.div,
|
|
10451
|
+
{
|
|
10452
|
+
initial: { opacity: 0, scale: 0.8, y: 10 },
|
|
10453
|
+
animate: {
|
|
10454
|
+
opacity: 1,
|
|
10455
|
+
scale: 1,
|
|
10456
|
+
y: 0,
|
|
10457
|
+
backgroundColor: `hsl(var(--primary) / 0.1)`,
|
|
10458
|
+
borderColor: `hsl(var(--primary) / 0.2)`
|
|
10459
|
+
},
|
|
10460
|
+
exit: { opacity: 0, scale: 0.8, y: 10 },
|
|
10461
|
+
className: cn(
|
|
10462
|
+
"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"
|
|
10463
|
+
),
|
|
10464
|
+
transition: { duration: 0.3 },
|
|
10465
|
+
children: [
|
|
10466
|
+
/* @__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" }) }),
|
|
10467
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
10468
|
+
import_framer_motion16.motion.span,
|
|
10469
|
+
{
|
|
10470
|
+
className: "text-sm font-semibold text-primary",
|
|
10471
|
+
animate: { color: `hsl(var(--primary))` },
|
|
10472
|
+
transition: { duration: 0.3 },
|
|
10473
|
+
children: [
|
|
10474
|
+
files.length,
|
|
10475
|
+
" ",
|
|
10476
|
+
files.length === 1 ? "arquivo selecionado" : "arquivos selecionados"
|
|
10477
|
+
]
|
|
10478
|
+
}
|
|
10479
|
+
)
|
|
10480
|
+
]
|
|
10481
|
+
}
|
|
10482
|
+
) }),
|
|
10483
|
+
showPreview && files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10484
|
+
import_framer_motion16.motion.div,
|
|
10485
|
+
{
|
|
10486
|
+
className: "mt-6 w-full",
|
|
10487
|
+
initial: animate ? { opacity: 0, y: 10 } : false,
|
|
10488
|
+
animate: { opacity: 1, y: 0 },
|
|
10489
|
+
transition: { delay: 0.3 },
|
|
10490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { children: [
|
|
10491
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("h4", { className: "mb-3 text-sm font-medium text-muted-foreground", children: [
|
|
10492
|
+
"Arquivos selecionados (",
|
|
10493
|
+
files.length,
|
|
10494
|
+
"/",
|
|
10495
|
+
maxFiles,
|
|
10496
|
+
")"
|
|
10497
|
+
] }),
|
|
10498
|
+
/* @__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)(
|
|
10499
|
+
import_framer_motion16.motion.div,
|
|
10500
|
+
{
|
|
10501
|
+
layout: true,
|
|
10502
|
+
initial: animate ? { opacity: 0, x: -20 } : false,
|
|
10503
|
+
animate: { opacity: 1, x: 0 },
|
|
10504
|
+
exit: {
|
|
10505
|
+
opacity: 0,
|
|
10506
|
+
x: -20,
|
|
10507
|
+
transition: { duration: 0.2 }
|
|
10508
|
+
},
|
|
10509
|
+
transition: {
|
|
10510
|
+
delay: animate ? index * 0.05 : 0,
|
|
10511
|
+
layout: { duration: 0.2 }
|
|
10512
|
+
},
|
|
10513
|
+
className: cn(
|
|
10514
|
+
"flex items-center gap-3 rounded-md border p-3 transition-all duration-300",
|
|
10515
|
+
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"
|
|
10516
|
+
),
|
|
10517
|
+
children: [
|
|
10518
|
+
/* @__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 ? (
|
|
10519
|
+
// Preview de imagem
|
|
10520
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10521
|
+
"img",
|
|
10522
|
+
{
|
|
10523
|
+
src: file.preview,
|
|
10524
|
+
alt: file.name,
|
|
10525
|
+
className: "h-full w-full object-cover rounded-md"
|
|
10526
|
+
}
|
|
10527
|
+
)
|
|
10528
|
+
) : (
|
|
10529
|
+
// Ícone baseado no tipo de arquivo
|
|
10530
|
+
getFileTypeIcon(file)
|
|
10531
|
+
) }),
|
|
10532
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
10533
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10534
|
+
"p",
|
|
10535
|
+
{
|
|
10536
|
+
className: "truncate text-sm font-medium text-foreground",
|
|
10537
|
+
title: `${file.name} (${file.type || "Tipo desconhecido"})`,
|
|
10538
|
+
children: file.name
|
|
10539
|
+
}
|
|
10540
|
+
),
|
|
10541
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
10542
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: formatFileSize(file.size) }),
|
|
10543
|
+
file.type && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
10544
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: "\u2022" }),
|
|
10545
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "uppercase", children: getFileExtension(file.name) })
|
|
10546
|
+
] })
|
|
10547
|
+
] }),
|
|
10548
|
+
file.error && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10549
|
+
import_framer_motion16.motion.p,
|
|
10550
|
+
{
|
|
10551
|
+
className: "mt-1 text-xs text-destructive",
|
|
10552
|
+
initial: { opacity: 0, y: -5 },
|
|
10553
|
+
animate: { opacity: 1, y: 0 },
|
|
10554
|
+
children: file.error
|
|
10555
|
+
}
|
|
10556
|
+
)
|
|
10557
|
+
] }),
|
|
10558
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10559
|
+
DeleteButton,
|
|
10560
|
+
{
|
|
10561
|
+
type: "button",
|
|
10562
|
+
variant: "destructive",
|
|
10563
|
+
size: "icon",
|
|
10564
|
+
onClick: (e) => {
|
|
10565
|
+
e?.stopPropagation();
|
|
10566
|
+
handleRemoveFile(file.id);
|
|
10567
|
+
},
|
|
10568
|
+
className: "",
|
|
10569
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react43.XIcon, { size: 12 })
|
|
10570
|
+
}
|
|
10571
|
+
)
|
|
10572
|
+
]
|
|
10573
|
+
},
|
|
10574
|
+
file.id
|
|
10575
|
+
)) }) })
|
|
10576
|
+
] })
|
|
10577
|
+
}
|
|
10578
|
+
)
|
|
10579
|
+
]
|
|
10580
|
+
}
|
|
10581
|
+
) });
|
|
10582
|
+
}
|
|
10583
|
+
);
|
|
10584
|
+
FileUploader.displayName = "FileUploader";
|
|
10585
|
+
|
|
10586
|
+
// src/components/ui/ModalBase.tsx
|
|
10587
|
+
var React40 = __toESM(require("react"));
|
|
10588
|
+
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
10589
|
+
var import_react44 = require("@phosphor-icons/react");
|
|
10590
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
10591
|
+
var ModalBase = DialogPrimitive2.Root;
|
|
10592
|
+
var ModalTriggerBase = DialogPrimitive2.Trigger;
|
|
10593
|
+
var ModalPortalBase = DialogPrimitive2.Portal;
|
|
10594
|
+
var ModalCloseBase = DialogPrimitive2.Close;
|
|
10595
|
+
var ModalOverlayBase = React40.forwardRef(({ className, testid: dataTestId = "modal-overlay", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10596
|
+
DialogPrimitive2.Overlay,
|
|
10597
|
+
{
|
|
10598
|
+
ref,
|
|
10599
|
+
className: cn(
|
|
10600
|
+
"fixed inset-0 z-50 bg-black/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
10601
|
+
className
|
|
10602
|
+
),
|
|
10603
|
+
"data-testid": dataTestId,
|
|
10604
|
+
...props
|
|
10605
|
+
}
|
|
10606
|
+
));
|
|
10607
|
+
ModalOverlayBase.displayName = DialogPrimitive2.Overlay.displayName;
|
|
10608
|
+
var ModalContentBase = React40.forwardRef(
|
|
10609
|
+
({
|
|
10610
|
+
className,
|
|
10611
|
+
children,
|
|
10612
|
+
testid: dataTestId = "modal-content",
|
|
10613
|
+
size = "md",
|
|
10614
|
+
centered = true,
|
|
10615
|
+
backdropBlur = true,
|
|
10616
|
+
...props
|
|
10617
|
+
}, ref) => {
|
|
10618
|
+
const sizeClass = size === "sm" ? "max-w-md" : size === "lg" ? "max-w-4xl" : size === "full" ? "w-full max-w-[calc(100%-2rem)]" : "max-w-2xl";
|
|
10619
|
+
const positionClass = centered ? "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%]" : "left-[50%] top-20 translate-x-[-50%] translate-y-0 sm:translate-y-0";
|
|
10620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(ModalPortalBase, { children: [
|
|
10621
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10622
|
+
ModalOverlayBase,
|
|
10623
|
+
{
|
|
10624
|
+
className: cn("bg-black/40", backdropBlur ? "backdrop-blur-sm" : "")
|
|
10625
|
+
}
|
|
10626
|
+
),
|
|
10627
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10628
|
+
"style",
|
|
10629
|
+
{
|
|
10630
|
+
dangerouslySetInnerHTML: {
|
|
10631
|
+
__html: `
|
|
10632
|
+
@keyframes modal-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
10633
|
+
@keyframes modal-fade-out { from { opacity: 1 } to { opacity: 0 } }
|
|
10634
|
+
@keyframes modal-scale-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98) } to { opacity:1; transform: translate(-50%, -50%) scale(1) } }
|
|
10635
|
+
@keyframes modal-scale-out { from { opacity:1; transform: translate(-50%, -50%) scale(1) } to { opacity: 0; transform: translate(-50%, -48%) scale(.98) } }
|
|
10636
|
+
@keyframes overlay-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
10637
|
+
@keyframes overlay-fade-out { from { opacity: 1 } to { opacity: 0 } }
|
|
10638
|
+
.data-[state=open]\\:animate-modal-in { animation: modal-fade-in 220ms cubic-bezier(.16,.84,.24,1) both, modal-scale-in 220ms cubic-bezier(.16,.84,.24,1) both }
|
|
10639
|
+
.data-[state=closed]\\:animate-modal-out { animation: modal-scale-out 160ms cubic-bezier(.16,.84,.24,1) both, modal-fade-out 160ms cubic-bezier(.16,.84,.24,1) both }
|
|
10640
|
+
.data-[state=open]\\:animate-overlay-in { animation: overlay-fade-in 220ms cubic-bezier(.16,.84,.24,1) both }
|
|
10641
|
+
.data-[state=closed]\\:animate-overlay-out { animation: overlay-fade-out 160ms cubic-bezier(.16,.84,.24,1) both }
|
|
10642
|
+
`
|
|
10643
|
+
}
|
|
10644
|
+
}
|
|
10645
|
+
),
|
|
10646
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
10647
|
+
DialogPrimitive2.Content,
|
|
10648
|
+
{
|
|
10649
|
+
ref,
|
|
10650
|
+
className: cn(
|
|
10651
|
+
"fixed z-50 grid w-full gap-4 border bg-background p-6 shadow-lg sm:rounded-lg max-h-[90dvh] overflow-auto",
|
|
10652
|
+
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out",
|
|
10653
|
+
positionClass,
|
|
10654
|
+
sizeClass,
|
|
10655
|
+
className
|
|
10656
|
+
),
|
|
10657
|
+
"data-testid": dataTestId,
|
|
10658
|
+
...props,
|
|
10659
|
+
children: [
|
|
10660
|
+
children,
|
|
10661
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(DialogPrimitive2.Close, { className: "absolute right-3 top-3 sm:right-4 sm:top-4 rounded-md bg-muted/10 p-1.5 opacity-80 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none z-10 hover:bg-muted/20 transition-colors", children: [
|
|
10662
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react44.XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 text-foreground" }),
|
|
10663
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: "Close" })
|
|
10664
|
+
] })
|
|
10665
|
+
]
|
|
10666
|
+
}
|
|
10667
|
+
)
|
|
10668
|
+
] });
|
|
10669
|
+
}
|
|
10670
|
+
);
|
|
10671
|
+
ModalContentBase.displayName = DialogPrimitive2.Content.displayName;
|
|
10672
|
+
var ModalHeaderBase = React40.forwardRef(({ className, testid: dataTestId = "modal-header", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10673
|
+
"div",
|
|
10674
|
+
{
|
|
10675
|
+
ref,
|
|
10676
|
+
className: cn(
|
|
10677
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
10678
|
+
className
|
|
10679
|
+
),
|
|
10680
|
+
"data-testid": dataTestId,
|
|
10681
|
+
...props
|
|
10682
|
+
}
|
|
10683
|
+
));
|
|
10684
|
+
ModalHeaderBase.displayName = "ModalHeader";
|
|
10685
|
+
var ModalFooterBase = React40.forwardRef(({ className, testid: dataTestId = "modal-footer", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10686
|
+
"div",
|
|
10687
|
+
{
|
|
10688
|
+
ref,
|
|
10689
|
+
className: cn(
|
|
10690
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
10691
|
+
className
|
|
10692
|
+
),
|
|
10693
|
+
"data-testid": dataTestId,
|
|
10694
|
+
...props
|
|
10695
|
+
}
|
|
10696
|
+
));
|
|
10697
|
+
ModalFooterBase.displayName = "ModalFooter";
|
|
10698
|
+
var ModalTitleBase = React40.forwardRef(({ className, testid: dataTestId = "modal-title", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10699
|
+
DialogPrimitive2.Title,
|
|
10700
|
+
{
|
|
10701
|
+
ref,
|
|
10702
|
+
className: cn(
|
|
10703
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
10704
|
+
className
|
|
10705
|
+
),
|
|
10706
|
+
"data-testid": dataTestId,
|
|
10707
|
+
...props
|
|
10708
|
+
}
|
|
10709
|
+
));
|
|
10710
|
+
ModalTitleBase.displayName = DialogPrimitive2.Title.displayName;
|
|
10711
|
+
var ModalDescriptionBase = React40.forwardRef(({ className, testid: dataTestId = "modal-description", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10712
|
+
DialogPrimitive2.Description,
|
|
10713
|
+
{
|
|
10714
|
+
ref,
|
|
10715
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
10716
|
+
"data-testid": dataTestId,
|
|
10717
|
+
...props
|
|
10718
|
+
}
|
|
10719
|
+
));
|
|
10720
|
+
ModalDescriptionBase.displayName = DialogPrimitive2.Description.displayName;
|
|
10721
|
+
|
|
9155
10722
|
// src/hooks/use-drag.tsx
|
|
9156
|
-
var
|
|
10723
|
+
var import_react45 = require("react");
|
|
9157
10724
|
var useDrag = (options = {}) => {
|
|
9158
|
-
const [isDragging, setIsDragging] = (0,
|
|
9159
|
-
const [positions, setPositions] = (0,
|
|
9160
|
-
const dragStartPos = (0,
|
|
9161
|
-
const dragId = (0,
|
|
9162
|
-
const handleMouseDown = (0,
|
|
10725
|
+
const [isDragging, setIsDragging] = (0, import_react45.useState)(null);
|
|
10726
|
+
const [positions, setPositions] = (0, import_react45.useState)({});
|
|
10727
|
+
const dragStartPos = (0, import_react45.useRef)(null);
|
|
10728
|
+
const dragId = (0, import_react45.useRef)(null);
|
|
10729
|
+
const handleMouseDown = (0, import_react45.useCallback)((id, e) => {
|
|
9163
10730
|
e.preventDefault();
|
|
9164
10731
|
const currentPosition = positions[id] || { top: 0, left: 0 };
|
|
9165
10732
|
dragStartPos.current = {
|
|
@@ -9172,7 +10739,7 @@ var useDrag = (options = {}) => {
|
|
|
9172
10739
|
setIsDragging(id);
|
|
9173
10740
|
options.onDragStart?.(id);
|
|
9174
10741
|
}, [positions, options]);
|
|
9175
|
-
const handleMouseMove = (0,
|
|
10742
|
+
const handleMouseMove = (0, import_react45.useCallback)((e) => {
|
|
9176
10743
|
if (!isDragging || !dragStartPos.current || !dragId.current) return;
|
|
9177
10744
|
const deltaX = e.clientX - dragStartPos.current.x;
|
|
9178
10745
|
const deltaY = e.clientY - dragStartPos.current.y;
|
|
@@ -9188,7 +10755,7 @@ var useDrag = (options = {}) => {
|
|
|
9188
10755
|
}));
|
|
9189
10756
|
options.onDrag?.(dragId.current, newPosition);
|
|
9190
10757
|
}, [isDragging, options]);
|
|
9191
|
-
const handleMouseUp = (0,
|
|
10758
|
+
const handleMouseUp = (0, import_react45.useCallback)(() => {
|
|
9192
10759
|
if (dragId.current) {
|
|
9193
10760
|
options.onDragEnd?.(dragId.current);
|
|
9194
10761
|
}
|
|
@@ -9196,7 +10763,7 @@ var useDrag = (options = {}) => {
|
|
|
9196
10763
|
dragStartPos.current = null;
|
|
9197
10764
|
dragId.current = null;
|
|
9198
10765
|
}, [options]);
|
|
9199
|
-
(0,
|
|
10766
|
+
(0, import_react45.useEffect)(() => {
|
|
9200
10767
|
if (isDragging) {
|
|
9201
10768
|
document.addEventListener("mousemove", handleMouseMove);
|
|
9202
10769
|
document.addEventListener("mouseup", handleMouseUp);
|
|
@@ -9208,16 +10775,16 @@ var useDrag = (options = {}) => {
|
|
|
9208
10775
|
};
|
|
9209
10776
|
}
|
|
9210
10777
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
9211
|
-
const setPosition = (0,
|
|
10778
|
+
const setPosition = (0, import_react45.useCallback)((id, position) => {
|
|
9212
10779
|
setPositions((prev) => ({
|
|
9213
10780
|
...prev,
|
|
9214
10781
|
[id]: position
|
|
9215
10782
|
}));
|
|
9216
10783
|
}, []);
|
|
9217
|
-
const getPosition = (0,
|
|
10784
|
+
const getPosition = (0, import_react45.useCallback)((id) => {
|
|
9218
10785
|
return positions[id] || { top: 0, left: 0 };
|
|
9219
10786
|
}, [positions]);
|
|
9220
|
-
const isElementDragging = (0,
|
|
10787
|
+
const isElementDragging = (0, import_react45.useCallback)((id) => {
|
|
9221
10788
|
return isDragging === id;
|
|
9222
10789
|
}, [isDragging]);
|
|
9223
10790
|
return {
|