@mlw-packages/react-components 1.7.0 → 1.7.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/README.md +9 -7
- package/dist/index.d.mts +655 -1
- package/dist/index.d.ts +655 -1
- package/dist/index.js +4726 -26
- package/dist/index.mjs +4771 -26
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -485,17 +485,161 @@ var require_colors2 = __commonJS({
|
|
|
485
485
|
// src/index.ts
|
|
486
486
|
var index_exports = {};
|
|
487
487
|
__export(index_exports, {
|
|
488
|
+
AddButton: () => AddButton,
|
|
489
|
+
AlertDialogActionBase: () => AlertDialogActionBase,
|
|
490
|
+
AlertDialogBase: () => AlertDialogBase,
|
|
491
|
+
AlertDialogCancelBase: () => AlertDialogCancelBase,
|
|
492
|
+
AlertDialogContentBase: () => AlertDialogContentBase,
|
|
493
|
+
AlertDialogDescriptionBase: () => AlertDialogDescriptionBase,
|
|
494
|
+
AlertDialogFooterBase: () => AlertDialogFooterBase,
|
|
495
|
+
AlertDialogHeaderBase: () => AlertDialogHeaderBase,
|
|
496
|
+
AlertDialogOverlayBase: () => AlertDialogOverlayBase,
|
|
497
|
+
AlertDialogPortalBase: () => AlertDialogPortalBase,
|
|
498
|
+
AlertDialogTitleBase: () => AlertDialogTitleBase,
|
|
499
|
+
AlertDialogTriggerBase: () => AlertDialogTriggerBase,
|
|
500
|
+
AvatarBase: () => AvatarBase,
|
|
501
|
+
AvatarFallbackBase: () => AvatarFallbackBase,
|
|
502
|
+
AvatarImageBase: () => AvatarImageBase,
|
|
503
|
+
BackButton: () => BackButton,
|
|
504
|
+
BadgeBase: () => BadgeBase,
|
|
488
505
|
BarChart: () => BarChart_default,
|
|
506
|
+
BreadcrumbBase: () => BreadcrumbBase,
|
|
507
|
+
BreadcrumbEllipsisBase: () => BreadcrumbEllipsisBase,
|
|
508
|
+
BreadcrumbItemBase: () => BreadcrumbItemBase,
|
|
509
|
+
BreadcrumbLinkBase: () => BreadcrumbLinkBase,
|
|
510
|
+
BreadcrumbListBase: () => BreadcrumbListBase,
|
|
511
|
+
BreadcrumbPageBase: () => BreadcrumbPageBase,
|
|
512
|
+
BreadcrumbSeparatorBase: () => BreadcrumbSeparatorBase,
|
|
513
|
+
ButtonBase: () => ButtonBase,
|
|
514
|
+
ButtonGroupBase: () => ButtonGroupBase,
|
|
515
|
+
CalendarBase: () => CalendarBase,
|
|
516
|
+
CardBase: () => CardBase,
|
|
517
|
+
CardContentBase: () => CardContentBase,
|
|
518
|
+
CardDescriptionBase: () => CardDescriptionBase,
|
|
519
|
+
CardFooterBase: () => CardFooterBase,
|
|
520
|
+
CardHeaderBase: () => CardHeaderBase,
|
|
521
|
+
CardTitleBase: () => CardTitleBase,
|
|
522
|
+
CarouselBase: () => CarouselBase,
|
|
523
|
+
CarouselContentBase: () => CarouselContentBase,
|
|
524
|
+
CarouselItemBase: () => CarouselItemBase,
|
|
525
|
+
CarouselNextBase: () => CarouselNextBase,
|
|
526
|
+
CarouselPrevious: () => CarouselPrevious,
|
|
527
|
+
ChangeButton: () => ChangeButton,
|
|
489
528
|
Chart: () => Chart_default,
|
|
529
|
+
CheckButton: () => CheckButton,
|
|
530
|
+
CheckboxBase: () => CheckboxBase,
|
|
490
531
|
CloseAllButton: () => CloseAllButton_default,
|
|
532
|
+
CloseButton: () => CloseButton,
|
|
533
|
+
CollapsibleBase: () => CollapsibleBase,
|
|
534
|
+
CollapsibleContentBase: () => CollapsibleContentBase,
|
|
535
|
+
CollapsibleTriggerBase: () => CollapsibleTriggerBase,
|
|
491
536
|
Combobox: () => Combobox,
|
|
537
|
+
CommandBase: () => CommandBase,
|
|
538
|
+
CommandDialogBase: () => CommandDialogBase,
|
|
539
|
+
CommandEmptyBase: () => CommandEmptyBase,
|
|
540
|
+
CommandGroupBase: () => CommandGroupBase,
|
|
541
|
+
CommandInputBase: () => CommandInputBase,
|
|
542
|
+
CommandItemBase: () => CommandItemBase,
|
|
543
|
+
CommandListBase: () => CommandListBase,
|
|
544
|
+
CommandSeparatorBase: () => CommandSeparatorBase,
|
|
545
|
+
CommandShortcutBase: () => CommandShortcutBase,
|
|
546
|
+
CopyButton: () => CopyButton,
|
|
547
|
+
DeleteButton: () => DeleteButton,
|
|
548
|
+
DestructiveDialog: () => DestructiveDialog,
|
|
549
|
+
DialogBase: () => DialogBase,
|
|
550
|
+
DialogCloseBase: () => DialogCloseBase,
|
|
551
|
+
DialogContentBase: () => DialogContentBase,
|
|
552
|
+
DialogDescriptionBase: () => DialogDescriptionBase,
|
|
553
|
+
DialogFooterBase: () => DialogFooterBase,
|
|
554
|
+
DialogHeaderBase: () => DialogHeaderBase,
|
|
555
|
+
DialogOverlayBase: () => DialogOverlayBase,
|
|
556
|
+
DialogPortalBase: () => DialogPortalBase,
|
|
557
|
+
DialogTitleBase: () => DialogTitleBase,
|
|
558
|
+
DialogTriggerBase: () => DialogTriggerBase,
|
|
559
|
+
DownloadButton: () => DownloadButton,
|
|
492
560
|
DraggableTooltip: () => DraggableTooltip_default,
|
|
561
|
+
DrawerBase: () => DrawerBase,
|
|
562
|
+
DrawerCloseBase: () => DrawerCloseBase,
|
|
563
|
+
DrawerContentBase: () => DrawerContentBase,
|
|
564
|
+
DrawerDescriptionBase: () => DrawerDescriptionBase,
|
|
565
|
+
DrawerFooterBase: () => DrawerFooterBase,
|
|
566
|
+
DrawerHeaderBase: () => DrawerHeaderBase,
|
|
567
|
+
DrawerOverlayBase: () => DrawerOverlayBase,
|
|
568
|
+
DrawerPortalBase: () => DrawerPortalBase,
|
|
569
|
+
DrawerTitleBase: () => DrawerTitleBase,
|
|
570
|
+
DrawerTriggerBase: () => DrawerTriggerBase,
|
|
571
|
+
DropDownMenuBase: () => DropDownMenuBase,
|
|
572
|
+
DropDownMenuCheckboxItemBase: () => DropDownMenuCheckboxItemBase,
|
|
573
|
+
DropDownMenuContentBase: () => DropDownMenuContentBase,
|
|
574
|
+
DropDownMenuGroupBase: () => DropDownMenuGroupBase,
|
|
575
|
+
DropDownMenuItemBase: () => DropDownMenuItemBase,
|
|
576
|
+
DropDownMenuLabelBase: () => DropDownMenuLabelBase,
|
|
577
|
+
DropDownMenuPortalBase: () => DropDownMenuPortalBase,
|
|
578
|
+
DropDownMenuRadioGroupBase: () => DropDownMenuRadioGroupBase,
|
|
579
|
+
DropDownMenuRadioItemBase: () => DropDownMenuRadioItemBase,
|
|
580
|
+
DropDownMenuSeparatorBase: () => DropDownMenuSeparatorBase,
|
|
581
|
+
DropDownMenuShortcutBase: () => DropDownMenuShortcutBase,
|
|
582
|
+
DropDownMenuSubBase: () => DropDownMenuSubBase,
|
|
583
|
+
DropDownMenuSubContentBase: () => DropDownMenuSubContentBase,
|
|
584
|
+
DropDownMenuSubTriggerBase: () => DropDownMenuSubTriggerBase,
|
|
585
|
+
DropDownMenuTriggerBase: () => DropDownMenuTriggerBase,
|
|
586
|
+
EditButton: () => EditButton,
|
|
587
|
+
ErrorMessage: () => ErrorMessage_default,
|
|
588
|
+
FavoriteButton: () => FavoriteButton,
|
|
589
|
+
FileUploader: () => FileUploader,
|
|
590
|
+
FilterButton: () => FilterButton,
|
|
591
|
+
HideButton: () => HideButton,
|
|
493
592
|
Highlights: () => Highlights_default,
|
|
593
|
+
HoverCardBase: () => HoverCardBase,
|
|
594
|
+
HoverCardContentBase: () => HoverCardContentBase,
|
|
595
|
+
HoverCardTriggerBase: () => HoverCardTriggerBase,
|
|
596
|
+
InputBase: () => InputBase,
|
|
597
|
+
InputOTPBase: () => InputOTPBase,
|
|
598
|
+
InputOTPGroupBase: () => InputOTPGroupBase,
|
|
599
|
+
InputOTPSeparatorBase: () => InputOTPSeparatorBase,
|
|
600
|
+
InputOTPSlotBase: () => InputOTPSlotBase,
|
|
601
|
+
LabelBase: () => LabelBase_default,
|
|
602
|
+
LikeButton: () => LikeButton,
|
|
494
603
|
LineChart: () => LineChart_default,
|
|
604
|
+
LoadingBase: () => LoadingBase,
|
|
605
|
+
LockButton: () => LockButton,
|
|
606
|
+
ModalBase: () => ModalBase,
|
|
607
|
+
ModalCloseBase: () => ModalCloseBase,
|
|
608
|
+
ModalContentBase: () => ModalContentBase,
|
|
609
|
+
ModalDescriptionBase: () => ModalDescriptionBase,
|
|
610
|
+
ModalFooterBase: () => ModalFooterBase,
|
|
611
|
+
ModalHeaderBase: () => ModalHeaderBase,
|
|
612
|
+
ModalOverlayBase: () => ModalOverlayBase,
|
|
613
|
+
ModalPortalBase: () => ModalPortalBase,
|
|
614
|
+
ModalTitleBase: () => ModalTitleBase,
|
|
615
|
+
ModalTriggerBase: () => ModalTriggerBase,
|
|
495
616
|
ModeToggleBase: () => ModeToggleBase,
|
|
617
|
+
MoreButton: () => MoreButton,
|
|
496
618
|
MultiCombobox: () => MultiCombobox,
|
|
619
|
+
NavigationMenuBase: () => NavigationMenuBase,
|
|
620
|
+
NavigationMenuContentBase: () => NavigationMenuContentBase,
|
|
621
|
+
NavigationMenuIndicatorBase: () => NavigationMenuIndicatorBase,
|
|
622
|
+
NavigationMenuItemBase: () => NavigationMenuItemBase,
|
|
623
|
+
NavigationMenuLinkBase: () => NavigationMenuLinkBase,
|
|
624
|
+
NavigationMenuListBase: () => NavigationMenuListBase,
|
|
625
|
+
NavigationMenuTriggerBase: () => NavigationMenuTriggerBase,
|
|
626
|
+
NavigationMenuViewportBase: () => NavigationMenuViewportBase,
|
|
627
|
+
NotificationButton: () => NotificationButton,
|
|
497
628
|
PeriodsDropdown: () => PeriodsDropdown_default,
|
|
498
629
|
PieChart: () => PieChart_default,
|
|
630
|
+
PopoverAnchorBase: () => PopoverAnchorBase,
|
|
631
|
+
PopoverBase: () => PopoverBase,
|
|
632
|
+
PopoverContentBase: () => PopoverContentBase,
|
|
633
|
+
PopoverTriggerBase: () => PopoverTriggerBase,
|
|
634
|
+
ProgressBase: () => ProgressBase,
|
|
635
|
+
ProgressCirclesBase: () => ProgressCirclesBase,
|
|
636
|
+
ProgressPanelsBase: () => ProgressPanelsBase,
|
|
637
|
+
ProgressSegmentsBase: () => ProgressSegmentsBase,
|
|
638
|
+
RefreshButton: () => RefreshButton,
|
|
639
|
+
SaveButton: () => SaveButton,
|
|
640
|
+
ScrollAreaBase: () => ScrollAreaBase,
|
|
641
|
+
ScrollBarBase: () => ScrollBarBase,
|
|
642
|
+
SearchButton: () => SearchButton,
|
|
499
643
|
Select: () => Select,
|
|
500
644
|
SelectBase: () => SelectBase,
|
|
501
645
|
SelectContentBase: () => SelectContentBase,
|
|
@@ -507,10 +651,74 @@ __export(index_exports, {
|
|
|
507
651
|
SelectSeparatorBase: () => SelectSeparatorBase,
|
|
508
652
|
SelectTriggerBase: () => SelectTriggerBase,
|
|
509
653
|
SelectValueBase: () => SelectValueBase,
|
|
654
|
+
SeparatorBase: () => SeparatorBase,
|
|
655
|
+
SettingsButton: () => SettingsButton,
|
|
656
|
+
SheetBase: () => SheetBase,
|
|
657
|
+
SheetCloseBase: () => SheetCloseBase,
|
|
658
|
+
SheetContentBase: () => SheetContentBase,
|
|
659
|
+
SheetDescriptionBase: () => SheetDescriptionBase,
|
|
660
|
+
SheetFooterBase: () => SheetFooterBase,
|
|
661
|
+
SheetHeaderBase: () => SheetHeaderBase,
|
|
662
|
+
SheetOverlayBase: () => SheetOverlayBase,
|
|
663
|
+
SheetPortalBase: () => SheetPortalBase,
|
|
664
|
+
SheetTitleBase: () => SheetTitleBase,
|
|
665
|
+
SheetTriggerBase: () => SheetTriggerBase,
|
|
510
666
|
ShowOnly: () => ShowOnly_default,
|
|
667
|
+
SidebarBase: () => SidebarBase,
|
|
668
|
+
SidebarContentBase: () => SidebarContentBase,
|
|
669
|
+
SidebarFooterBase: () => SidebarFooterBase,
|
|
670
|
+
SidebarGroupActionBase: () => SidebarGroupActionBase,
|
|
671
|
+
SidebarGroupBase: () => SidebarGroupBase,
|
|
672
|
+
SidebarGroupContentBase: () => SidebarGroupContentBase,
|
|
673
|
+
SidebarGroupLabelBase: () => SidebarGroupLabelBase,
|
|
674
|
+
SidebarHeaderBase: () => SidebarHeaderBase,
|
|
675
|
+
SidebarInputBase: () => SidebarInputBase,
|
|
676
|
+
SidebarInsetBase: () => SidebarInsetBase,
|
|
677
|
+
SidebarMenuActionBase: () => SidebarMenuActionBase,
|
|
678
|
+
SidebarMenuBadgeBase: () => SidebarMenuBadgeBase,
|
|
679
|
+
SidebarMenuBase: () => SidebarMenuBase,
|
|
680
|
+
SidebarMenuButtonBase: () => SidebarMenuButtonBase,
|
|
681
|
+
SidebarMenuItemBase: () => SidebarMenuItemBase,
|
|
682
|
+
SidebarMenuSkeletonBase: () => SidebarMenuSkeletonBase,
|
|
683
|
+
SidebarMenuSubBase: () => SidebarMenuSubBase,
|
|
684
|
+
SidebarMenuSubButtonBase: () => SidebarMenuSubButtonBase,
|
|
685
|
+
SidebarMenuSubItemBase: () => SidebarMenuSubItemBase,
|
|
686
|
+
SidebarProviderBase: () => SidebarProviderBase,
|
|
687
|
+
SidebarRailBase: () => SidebarRailBase,
|
|
688
|
+
SidebarSeparatorBase: () => SidebarSeparatorBase,
|
|
689
|
+
SidebarTriggerBase: () => SidebarTriggerBase,
|
|
690
|
+
SkeletonBase: () => SkeletonBase,
|
|
691
|
+
SlideBase: () => SlideBase,
|
|
692
|
+
SwitchBase: () => SwitchBase,
|
|
693
|
+
TableBase: () => TableBase,
|
|
694
|
+
TableBodyBase: () => TableBodyBase,
|
|
695
|
+
TableCaptionBase: () => TableCaptionBase,
|
|
696
|
+
TableCellBase: () => TableCellBase,
|
|
697
|
+
TableFooterBase: () => TableFooterBase,
|
|
698
|
+
TableHeadBase: () => TableHeadBase,
|
|
699
|
+
TableHeaderBase: () => TableHeaderBase,
|
|
700
|
+
TableRowBase: () => TableRowBase,
|
|
701
|
+
TabsBase: () => TabsBase,
|
|
702
|
+
TabsContentBase: () => TabsContentBase,
|
|
703
|
+
TabsListBase: () => TabsListBase,
|
|
704
|
+
TabsTriggerBase: () => TabsTriggerBase,
|
|
705
|
+
TextAreaBase: () => TextAreaBase,
|
|
511
706
|
ThemeProviderBase: () => ThemeProviderBase,
|
|
707
|
+
Toaster: () => Toaster,
|
|
708
|
+
TooltipBase: () => TooltipBase,
|
|
709
|
+
TooltipContentBase: () => TooltipContentBase,
|
|
710
|
+
TooltipProviderBase: () => TooltipProviderBase,
|
|
512
711
|
TooltipSimple: () => TooltipSimple_default,
|
|
712
|
+
TooltipTriggerBase: () => TooltipTriggerBase,
|
|
513
713
|
TooltipWithTotal: () => TooltipWithTotal_default,
|
|
714
|
+
UniversalTooltipRenderer: () => UniversalTooltipRenderer,
|
|
715
|
+
UnlockButton: () => UnlockButton,
|
|
716
|
+
UploadButton: () => UploadButton,
|
|
717
|
+
UseSideBarBase: () => UseSideBarBase,
|
|
718
|
+
ViewButton: () => ViewButton,
|
|
719
|
+
VisibilityButton: () => VisibilityButton,
|
|
720
|
+
badgeVariants: () => badgeVariants,
|
|
721
|
+
buttonVariantsBase: () => buttonVariantsBase,
|
|
514
722
|
compactTick: () => compactTick,
|
|
515
723
|
detectDataFields: () => detectDataFields,
|
|
516
724
|
detectXAxis: () => detectXAxis,
|
|
@@ -520,6 +728,7 @@ __export(index_exports, {
|
|
|
520
728
|
renderPillLabel: () => pillLabelRenderer_default,
|
|
521
729
|
resolveChartMargins: () => resolveChartMargins,
|
|
522
730
|
resolveContainerPaddingLeft: () => resolveContainerPaddingLeft,
|
|
731
|
+
toast: () => toast2,
|
|
523
732
|
useChartHighlights: () => useChartHighlights,
|
|
524
733
|
useDrag: () => useDrag,
|
|
525
734
|
useIsMobile: () => useIsMobile,
|
|
@@ -631,7 +840,10 @@ var React2 = __toESM(require("react"));
|
|
|
631
840
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
632
841
|
var import_react = require("@phosphor-icons/react");
|
|
633
842
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
843
|
+
var DialogBase = DialogPrimitive.Root;
|
|
844
|
+
var DialogTriggerBase = DialogPrimitive.Trigger;
|
|
634
845
|
var DialogPortalBase = DialogPrimitive.Portal;
|
|
846
|
+
var DialogCloseBase = DialogPrimitive.Close;
|
|
635
847
|
var DialogOverlayBase = React2.forwardRef(({ className, testid: dataTestId = "dialog-overlay", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
636
848
|
DialogPrimitive.Overlay,
|
|
637
849
|
{
|
|
@@ -830,6 +1042,26 @@ var CommandBase = React5.forwardRef(({ className, testid: dataTestId = "command-
|
|
|
830
1042
|
}
|
|
831
1043
|
));
|
|
832
1044
|
CommandBase.displayName = import_cmdk.Command.displayName;
|
|
1045
|
+
var dialogVariants = {
|
|
1046
|
+
hidden: { opacity: 0, scale: 0.95, y: -20 },
|
|
1047
|
+
visible: { opacity: 1, scale: 1, y: 0 },
|
|
1048
|
+
exit: { opacity: 0, scale: 0.95, y: -20 }
|
|
1049
|
+
};
|
|
1050
|
+
var CommandDialogBase = ({ children, open, ...props }) => {
|
|
1051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogBase, { open, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_framer_motion.AnimatePresence, { children: open && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogContentBase, { asChild: true, forceMount: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1052
|
+
import_framer_motion.motion.div,
|
|
1053
|
+
{
|
|
1054
|
+
initial: "hidden",
|
|
1055
|
+
animate: "visible",
|
|
1056
|
+
exit: "exit",
|
|
1057
|
+
variants: dialogVariants,
|
|
1058
|
+
transition: { duration: 0.2, ease: "easeOut" },
|
|
1059
|
+
className: "overflow-hidden p-0",
|
|
1060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommandBase, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
|
|
1061
|
+
},
|
|
1062
|
+
"command-dialog"
|
|
1063
|
+
) }) }) });
|
|
1064
|
+
};
|
|
833
1065
|
var CommandInputBase = React5.forwardRef(({ className, testid: dataTestId = "command-input", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
834
1066
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react2.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 text-primary" }),
|
|
835
1067
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -925,6 +1157,7 @@ var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
|
925
1157
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
926
1158
|
var PopoverBase = PopoverPrimitive.Root;
|
|
927
1159
|
var PopoverTriggerBase = PopoverPrimitive.Trigger;
|
|
1160
|
+
var PopoverAnchorBase = PopoverPrimitive.Anchor;
|
|
928
1161
|
var PopoverContentBase = React6.forwardRef(
|
|
929
1162
|
({
|
|
930
1163
|
className,
|
|
@@ -1274,6 +1507,9 @@ function MultiCombobox({
|
|
|
1274
1507
|
var React7 = __toESM(require("react"));
|
|
1275
1508
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1276
1509
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1510
|
+
var TooltipProviderBase = TooltipPrimitive.Provider;
|
|
1511
|
+
var TooltipBase = TooltipPrimitive.Root;
|
|
1512
|
+
var TooltipTriggerBase = TooltipPrimitive.Trigger;
|
|
1277
1513
|
var TooltipContentBase = React7.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1278
1514
|
TooltipPrimitive.Content,
|
|
1279
1515
|
{
|
|
@@ -1465,6 +1701,10 @@ var import_framer_motion5 = require("framer-motion");
|
|
|
1465
1701
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1466
1702
|
var DropDownMenuBase = DropdownMenuPrimitive.Root;
|
|
1467
1703
|
var DropDownMenuTriggerBase = DropdownMenuPrimitive.Trigger;
|
|
1704
|
+
var DropDownMenuGroupBase = DropdownMenuPrimitive.Group;
|
|
1705
|
+
var DropDownMenuPortalBase = DropdownMenuPrimitive.Portal;
|
|
1706
|
+
var DropDownMenuSubBase = DropdownMenuPrimitive.Sub;
|
|
1707
|
+
var DropDownMenuRadioGroupBase = DropdownMenuPrimitive.RadioGroup;
|
|
1468
1708
|
var DropDownMenuSubTriggerBase = React9.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1469
1709
|
DropdownMenuPrimitive.SubTrigger,
|
|
1470
1710
|
{
|
|
@@ -5324,31 +5564,4491 @@ var useChartHighlights = () => {
|
|
|
5324
5564
|
};
|
|
5325
5565
|
};
|
|
5326
5566
|
|
|
5327
|
-
// src/
|
|
5567
|
+
// src/components/ui/data/AvatarBase.tsx
|
|
5328
5568
|
var React16 = __toESM(require("react"));
|
|
5329
|
-
var
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
}
|
|
5341
|
-
|
|
5569
|
+
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
5570
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5571
|
+
var AvatarBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5572
|
+
AvatarPrimitive.Root,
|
|
5573
|
+
{
|
|
5574
|
+
ref,
|
|
5575
|
+
className: cn(
|
|
5576
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
5577
|
+
className
|
|
5578
|
+
),
|
|
5579
|
+
...props
|
|
5580
|
+
}
|
|
5581
|
+
));
|
|
5582
|
+
AvatarBase.displayName = AvatarPrimitive.Root.displayName;
|
|
5583
|
+
var AvatarImageBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5584
|
+
AvatarPrimitive.Image,
|
|
5585
|
+
{
|
|
5586
|
+
ref,
|
|
5587
|
+
className: cn("aspect-square h-full w-full", className),
|
|
5588
|
+
...props
|
|
5589
|
+
}
|
|
5590
|
+
));
|
|
5591
|
+
AvatarImageBase.displayName = AvatarPrimitive.Image.displayName;
|
|
5592
|
+
var AvatarFallbackBase = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5593
|
+
AvatarPrimitive.Fallback,
|
|
5594
|
+
{
|
|
5595
|
+
ref,
|
|
5596
|
+
className: cn(
|
|
5597
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
5598
|
+
className
|
|
5599
|
+
),
|
|
5600
|
+
...props
|
|
5601
|
+
}
|
|
5602
|
+
));
|
|
5603
|
+
AvatarFallbackBase.displayName = AvatarPrimitive.Fallback.displayName;
|
|
5604
|
+
|
|
5605
|
+
// src/components/ui/data/BadgeBase.tsx
|
|
5606
|
+
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
5607
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
5608
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5609
|
+
var tailwindColors = {
|
|
5610
|
+
// Red
|
|
5611
|
+
"red-50": "#fef2f2",
|
|
5612
|
+
"red-100": "#fee2e2",
|
|
5613
|
+
"red-200": "#fecaca",
|
|
5614
|
+
"red-300": "#fca5a5",
|
|
5615
|
+
"red-400": "#f87171",
|
|
5616
|
+
"red-500": "#ef4444",
|
|
5617
|
+
"red-600": "#dc2626",
|
|
5618
|
+
"red-700": "#b91c1c",
|
|
5619
|
+
"red-800": "#991b1b",
|
|
5620
|
+
"red-900": "#7f1d1d",
|
|
5621
|
+
// Orange
|
|
5622
|
+
"orange-50": "#fff7ed",
|
|
5623
|
+
"orange-100": "#ffedd5",
|
|
5624
|
+
"orange-200": "#fed7aa",
|
|
5625
|
+
"orange-300": "#fdba74",
|
|
5626
|
+
"orange-400": "#fb923c",
|
|
5627
|
+
"orange-500": "#f97316",
|
|
5628
|
+
"orange-600": "#ea580c",
|
|
5629
|
+
"orange-700": "#c2410c",
|
|
5630
|
+
"orange-800": "#9a3412",
|
|
5631
|
+
"orange-900": "#7c2d12",
|
|
5632
|
+
// Yellow
|
|
5633
|
+
"yellow-50": "#fefce8",
|
|
5634
|
+
"yellow-100": "#fef3c7",
|
|
5635
|
+
"yellow-200": "#fde68a",
|
|
5636
|
+
"yellow-300": "#fcd34d",
|
|
5637
|
+
"yellow-400": "#fbbf24",
|
|
5638
|
+
"yellow-500": "#f59e0b",
|
|
5639
|
+
"yellow-600": "#d97706",
|
|
5640
|
+
"yellow-700": "#b45309",
|
|
5641
|
+
"yellow-800": "#92400e",
|
|
5642
|
+
"yellow-900": "#78350f",
|
|
5643
|
+
// Green
|
|
5644
|
+
"green-50": "#f0fdf4",
|
|
5645
|
+
"green-100": "#dcfce7",
|
|
5646
|
+
"green-200": "#bbf7d0",
|
|
5647
|
+
"green-300": "#86efac",
|
|
5648
|
+
"green-400": "#4ade80",
|
|
5649
|
+
"green-500": "#22c55e",
|
|
5650
|
+
"green-600": "#16a34a",
|
|
5651
|
+
"green-700": "#15803d",
|
|
5652
|
+
"green-800": "#166534",
|
|
5653
|
+
"green-900": "#14532d",
|
|
5654
|
+
// Blue
|
|
5655
|
+
"blue-50": "#eff6ff",
|
|
5656
|
+
"blue-100": "#dbeafe",
|
|
5657
|
+
"blue-200": "#bfdbfe",
|
|
5658
|
+
"blue-300": "#93c5fd",
|
|
5659
|
+
"blue-400": "#60a5fa",
|
|
5660
|
+
"blue-500": "#3b82f6",
|
|
5661
|
+
"blue-600": "#2563eb",
|
|
5662
|
+
"blue-700": "#1d4ed8",
|
|
5663
|
+
"blue-800": "#1e40af",
|
|
5664
|
+
"blue-900": "#1e3a8a",
|
|
5665
|
+
// Purple
|
|
5666
|
+
"purple-50": "#faf5ff",
|
|
5667
|
+
"purple-100": "#f3e8ff",
|
|
5668
|
+
"purple-200": "#e9d5ff",
|
|
5669
|
+
"purple-300": "#d8b4fe",
|
|
5670
|
+
"purple-400": "#c084fc",
|
|
5671
|
+
"purple-500": "#a855f7",
|
|
5672
|
+
"purple-600": "#9333ea",
|
|
5673
|
+
"purple-700": "#7c3aed",
|
|
5674
|
+
"purple-800": "#6b21a8",
|
|
5675
|
+
"purple-900": "#581c87",
|
|
5676
|
+
// Pink
|
|
5677
|
+
"pink-50": "#fdf2f8",
|
|
5678
|
+
"pink-100": "#fce7f3",
|
|
5679
|
+
"pink-200": "#fbcfe8",
|
|
5680
|
+
"pink-300": "#f9a8d4",
|
|
5681
|
+
"pink-400": "#f472b6",
|
|
5682
|
+
"pink-500": "#ec4899",
|
|
5683
|
+
"pink-600": "#db2777",
|
|
5684
|
+
"pink-700": "#be185d",
|
|
5685
|
+
"pink-800": "#9d174d",
|
|
5686
|
+
"pink-900": "#831843",
|
|
5687
|
+
// Gray
|
|
5688
|
+
"gray-50": "#f9fafb",
|
|
5689
|
+
"gray-100": "#f3f4f6",
|
|
5690
|
+
"gray-200": "#e5e7eb",
|
|
5691
|
+
"gray-300": "#d1d5db",
|
|
5692
|
+
"gray-400": "#9ca3af",
|
|
5693
|
+
"gray-500": "#6b7280",
|
|
5694
|
+
"gray-600": "#4b5563",
|
|
5695
|
+
"gray-700": "#374151",
|
|
5696
|
+
"gray-800": "#1f2937",
|
|
5697
|
+
"gray-900": "#111827",
|
|
5698
|
+
// Indigo
|
|
5699
|
+
"indigo-50": "#eef2ff",
|
|
5700
|
+
"indigo-100": "#e0e7ff",
|
|
5701
|
+
"indigo-200": "#c7d2fe",
|
|
5702
|
+
"indigo-300": "#a5b4fc",
|
|
5703
|
+
"indigo-400": "#818cf8",
|
|
5704
|
+
"indigo-500": "#6366f1",
|
|
5705
|
+
"indigo-600": "#4f46e5",
|
|
5706
|
+
"indigo-700": "#4338ca",
|
|
5707
|
+
"indigo-800": "#3730a3",
|
|
5708
|
+
"indigo-900": "#312e81",
|
|
5709
|
+
// Teal
|
|
5710
|
+
"teal-50": "#f0fdfa",
|
|
5711
|
+
"teal-100": "#ccfbf1",
|
|
5712
|
+
"teal-200": "#99f6e4",
|
|
5713
|
+
"teal-300": "#5eead4",
|
|
5714
|
+
"teal-400": "#2dd4bf",
|
|
5715
|
+
"teal-500": "#14b8a6",
|
|
5716
|
+
"teal-600": "#0d9488",
|
|
5717
|
+
"teal-700": "#0f766e",
|
|
5718
|
+
"teal-800": "#115e59",
|
|
5719
|
+
"teal-900": "#134e4a",
|
|
5720
|
+
// Emerald
|
|
5721
|
+
"emerald-50": "#ecfdf5",
|
|
5722
|
+
"emerald-100": "#d1fae5",
|
|
5723
|
+
"emerald-200": "#a7f3d0",
|
|
5724
|
+
"emerald-300": "#6ee7b7",
|
|
5725
|
+
"emerald-400": "#34d399",
|
|
5726
|
+
"emerald-500": "#10b981",
|
|
5727
|
+
"emerald-600": "#059669",
|
|
5728
|
+
"emerald-700": "#047857",
|
|
5729
|
+
"emerald-800": "#065f46",
|
|
5730
|
+
"emerald-900": "#064e3b",
|
|
5731
|
+
// Cyan
|
|
5732
|
+
"cyan-50": "#ecfeff",
|
|
5733
|
+
"cyan-100": "#cffafe",
|
|
5734
|
+
"cyan-200": "#a5f3fc",
|
|
5735
|
+
"cyan-300": "#67e8f9",
|
|
5736
|
+
"cyan-400": "#22d3ee",
|
|
5737
|
+
"cyan-500": "#06b6d4",
|
|
5738
|
+
"cyan-600": "#0891b2",
|
|
5739
|
+
"cyan-700": "#0e7490",
|
|
5740
|
+
"cyan-800": "#155e75",
|
|
5741
|
+
"cyan-900": "#164e63"
|
|
5742
|
+
};
|
|
5743
|
+
var getTailwindColor = (color) => {
|
|
5744
|
+
if (color.startsWith("#") || color.startsWith("rgb") || color.startsWith("hsl")) {
|
|
5745
|
+
return color;
|
|
5746
|
+
}
|
|
5747
|
+
if (tailwindColors[color]) {
|
|
5748
|
+
return tailwindColors[color];
|
|
5749
|
+
}
|
|
5750
|
+
if (!color.includes("-")) {
|
|
5751
|
+
const defaultColor = `${color}-500`;
|
|
5752
|
+
if (tailwindColors[defaultColor]) {
|
|
5753
|
+
return tailwindColors[defaultColor];
|
|
5754
|
+
}
|
|
5755
|
+
}
|
|
5756
|
+
return color;
|
|
5757
|
+
};
|
|
5758
|
+
var badgeVariants = (0, import_class_variance_authority2.cva)(
|
|
5759
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
5760
|
+
{
|
|
5761
|
+
variants: {
|
|
5762
|
+
variant: {
|
|
5763
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
5764
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
5765
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
5766
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
5767
|
+
},
|
|
5768
|
+
status: {
|
|
5769
|
+
success: "bg-green-500 border-white dark:border-zinc-900",
|
|
5770
|
+
desactivated: "bg-gray-400 border-white dark:border-zinc-900",
|
|
5771
|
+
destructive: "bg-red-500 border-white dark:border-zinc-900",
|
|
5772
|
+
away: "bg-yellow-400 border-white dark:border-zinc-900",
|
|
5773
|
+
custom: "border-white dark:border-zinc-900"
|
|
5774
|
+
}
|
|
5775
|
+
},
|
|
5776
|
+
defaultVariants: {
|
|
5777
|
+
variant: "default"
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
);
|
|
5781
|
+
function BadgeBase({
|
|
5782
|
+
className,
|
|
5783
|
+
variant,
|
|
5784
|
+
status,
|
|
5785
|
+
statusColor,
|
|
5786
|
+
asChild = false,
|
|
5787
|
+
children,
|
|
5788
|
+
style,
|
|
5789
|
+
...props
|
|
5790
|
+
}) {
|
|
5791
|
+
const Comp = asChild ? import_react_slot3.Slot : "span";
|
|
5792
|
+
const isStatus = Boolean(status);
|
|
5793
|
+
const resolvedStatusColor = statusColor ? getTailwindColor(statusColor) : void 0;
|
|
5794
|
+
const customStyle = status === "custom" && resolvedStatusColor ? { ...style, backgroundColor: resolvedStatusColor } : style;
|
|
5795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5796
|
+
Comp,
|
|
5797
|
+
{
|
|
5798
|
+
"data-slot": "badge",
|
|
5799
|
+
className: cn(
|
|
5800
|
+
badgeVariants({ variant, status: isStatus ? status : void 0 }),
|
|
5801
|
+
isStatus && "absolute bottom-0 right-0 rounded-full p-0 h-4 w-4 flex items-center justify-center border-2",
|
|
5802
|
+
className
|
|
5803
|
+
),
|
|
5804
|
+
style: customStyle,
|
|
5805
|
+
...props,
|
|
5806
|
+
children: isStatus ? null : children
|
|
5807
|
+
}
|
|
5808
|
+
);
|
|
5809
|
+
}
|
|
5810
|
+
|
|
5811
|
+
// src/components/ui/data/CalendarBase.tsx
|
|
5812
|
+
var import_react22 = require("@phosphor-icons/react");
|
|
5813
|
+
var import_react_day_picker = require("react-day-picker");
|
|
5814
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5815
|
+
function CalendarBase({
|
|
5816
|
+
className,
|
|
5817
|
+
classNames,
|
|
5818
|
+
showOutsideDays = true,
|
|
5819
|
+
...props
|
|
5820
|
+
}) {
|
|
5821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5822
|
+
import_react_day_picker.DayPicker,
|
|
5823
|
+
{
|
|
5824
|
+
showOutsideDays,
|
|
5825
|
+
className: cn("bg-background p-3", className),
|
|
5826
|
+
classNames: {
|
|
5827
|
+
months: "flex items-center flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
5828
|
+
month: "space-y-4",
|
|
5829
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
5830
|
+
caption_label: "text-sm font-medium",
|
|
5831
|
+
nav: "space-x-1 flex items-center",
|
|
5832
|
+
nav_button: cn(
|
|
5833
|
+
buttonVariantsBase({ variant: "outline" }),
|
|
5834
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
5835
|
+
),
|
|
5836
|
+
nav_button_previous: "absolute left-1",
|
|
5837
|
+
nav_button_next: "absolute right-1",
|
|
5838
|
+
table: "w-full border-collapse space-y-1",
|
|
5839
|
+
head_row: "flex",
|
|
5840
|
+
head_cell: "text-slate-500 rounded-md w-9 font-normal text-[0.8rem] dark:text-slate-400",
|
|
5841
|
+
row: "flex w-full mt-2",
|
|
5842
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-slate-100/50 [&:has([aria-selected])]:bg-slate-100 first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 dark:[&:has([aria-selected].day-outside)]:bg-slate-800/50 dark:[&:has([aria-selected])]:bg-slate-800",
|
|
5843
|
+
day: cn(
|
|
5844
|
+
buttonVariantsBase({ variant: "ghost" }),
|
|
5845
|
+
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
|
5846
|
+
),
|
|
5847
|
+
day_range_end: "day-range-end",
|
|
5848
|
+
day_selected: "bg-purple text-slate-50 hover:bg-primary hover:text-slate-50 focus:bg-purple-500 focus:text-slate-50 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50 dark:hover:text-slate-900 dark:focus:bg-slate-50 dark:focus:text-slate-900",
|
|
5849
|
+
day_today: "bg-slate-100 text-slate-900 dark:bg-primary dark:text-slate-50",
|
|
5850
|
+
day_outside: "day-outside text-slate-500 opacity-50 aria-selected:bg-slate-100/50 aria-selected:text-slate-500 aria-selected:opacity-30 dark:text-slate-400 dark:aria-selected:bg-slate-800/50 dark:aria-selected:text-slate-400",
|
|
5851
|
+
day_disabled: "text-slate-500 opacity-50 dark:text-slate-400",
|
|
5852
|
+
day_range_middle: "aria-selected:bg-slate-100 aria-selected:text-slate-900 dark:aria-selected:bg-primary dark:aria-selected:text-primary",
|
|
5853
|
+
day_hidden: "invisible",
|
|
5854
|
+
...classNames
|
|
5855
|
+
},
|
|
5856
|
+
components: {
|
|
5857
|
+
IconLeft: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react22.CaretLeftIcon, { className: "h-4 w-4" }),
|
|
5858
|
+
IconRight: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react22.CaretRightIcon, { className: "h-4 w-4" })
|
|
5859
|
+
},
|
|
5860
|
+
...props
|
|
5861
|
+
}
|
|
5862
|
+
);
|
|
5342
5863
|
}
|
|
5864
|
+
CalendarBase.displayName = "Calendar";
|
|
5865
|
+
|
|
5866
|
+
// src/components/ui/data/CardBase.tsx
|
|
5867
|
+
var React17 = __toESM(require("react"));
|
|
5868
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5869
|
+
var CardBase = React17.forwardRef(({ className, testid: dataTestId = "card-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5870
|
+
"div",
|
|
5871
|
+
{
|
|
5872
|
+
ref,
|
|
5873
|
+
className: cn(
|
|
5874
|
+
"rounded-xl border bg-card text-card-foreground shadow",
|
|
5875
|
+
className
|
|
5876
|
+
),
|
|
5877
|
+
"data-testid": dataTestId,
|
|
5878
|
+
...props
|
|
5879
|
+
}
|
|
5880
|
+
));
|
|
5881
|
+
CardBase.displayName = "Card";
|
|
5882
|
+
var CardHeaderBase = React17.forwardRef(({ className, testid: dataTestId = "card-header", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5883
|
+
"div",
|
|
5884
|
+
{
|
|
5885
|
+
ref,
|
|
5886
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
5887
|
+
"data-testid": dataTestId,
|
|
5888
|
+
...props
|
|
5889
|
+
}
|
|
5890
|
+
));
|
|
5891
|
+
CardHeaderBase.displayName = "CardHeader";
|
|
5892
|
+
var CardTitleBase = React17.forwardRef(({ className, testid: dataTestId = "card-title", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5893
|
+
"div",
|
|
5894
|
+
{
|
|
5895
|
+
ref,
|
|
5896
|
+
className: cn("font-semibold leading-none tracking-tight", className),
|
|
5897
|
+
"data-testid": dataTestId,
|
|
5898
|
+
...props
|
|
5899
|
+
}
|
|
5900
|
+
));
|
|
5901
|
+
CardTitleBase.displayName = "CardTitle";
|
|
5902
|
+
var CardDescriptionBase = React17.forwardRef(({ className, testid: dataTestId = "card-description", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5903
|
+
"div",
|
|
5904
|
+
{
|
|
5905
|
+
ref,
|
|
5906
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
5907
|
+
"data-testid": dataTestId,
|
|
5908
|
+
...props
|
|
5909
|
+
}
|
|
5910
|
+
));
|
|
5911
|
+
CardDescriptionBase.displayName = "CardDescription";
|
|
5912
|
+
var CardContentBase = React17.forwardRef(({ className, testid: dataTestId = "card-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5913
|
+
"div",
|
|
5914
|
+
{
|
|
5915
|
+
ref,
|
|
5916
|
+
className: cn("p-6 pt-0", className),
|
|
5917
|
+
"data-testid": dataTestId,
|
|
5918
|
+
...props
|
|
5919
|
+
}
|
|
5920
|
+
));
|
|
5921
|
+
CardContentBase.displayName = "CardContent";
|
|
5922
|
+
var CardFooterBase = React17.forwardRef(({ className, testid: dataTestId = "card-footer", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5923
|
+
"div",
|
|
5924
|
+
{
|
|
5925
|
+
ref,
|
|
5926
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
5927
|
+
"data-testid": dataTestId,
|
|
5928
|
+
...props
|
|
5929
|
+
}
|
|
5930
|
+
));
|
|
5931
|
+
CardFooterBase.displayName = "CardFooter";
|
|
5932
|
+
|
|
5933
|
+
// src/components/ui/data/FileUploader.tsx
|
|
5934
|
+
var React21 = __toESM(require("react"));
|
|
5935
|
+
var import_framer_motion10 = require("framer-motion");
|
|
5936
|
+
var import_react25 = require("@phosphor-icons/react");
|
|
5937
|
+
|
|
5938
|
+
// src/components/ui/form/SmallButtons.tsx
|
|
5939
|
+
var React20 = __toESM(require("react"));
|
|
5940
|
+
|
|
5941
|
+
// src/components/ui/feedback/DestructiveDialog.tsx
|
|
5942
|
+
var React19 = __toESM(require("react"));
|
|
5943
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
5944
|
+
|
|
5945
|
+
// src/components/ui/feedback/AlertDialogBase.tsx
|
|
5946
|
+
var React18 = __toESM(require("react"));
|
|
5947
|
+
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"));
|
|
5948
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5949
|
+
var AlertDialogBase = AlertDialogPrimitive.Root;
|
|
5950
|
+
var AlertDialogTriggerBase = AlertDialogPrimitive.Trigger;
|
|
5951
|
+
var AlertDialogPortalBase = AlertDialogPrimitive.Portal;
|
|
5952
|
+
var AlertDialogOverlayBase = React18.forwardRef(({ className, testid = "alertdialog-overlay", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5953
|
+
AlertDialogPrimitive.Overlay,
|
|
5954
|
+
{
|
|
5955
|
+
className: cn(
|
|
5956
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
5957
|
+
className
|
|
5958
|
+
),
|
|
5959
|
+
"data-testid": testid,
|
|
5960
|
+
...props,
|
|
5961
|
+
ref
|
|
5962
|
+
}
|
|
5963
|
+
));
|
|
5964
|
+
AlertDialogOverlayBase.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
5965
|
+
var AlertDialogContentBase = React18.forwardRef(({ className, testid = "alertdialog-content", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(AlertDialogPortalBase, { children: [
|
|
5966
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AlertDialogOverlayBase, {}),
|
|
5967
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5968
|
+
AlertDialogPrimitive.Content,
|
|
5969
|
+
{
|
|
5970
|
+
ref,
|
|
5971
|
+
className: cn(
|
|
5972
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
5973
|
+
className
|
|
5974
|
+
),
|
|
5975
|
+
"data-testid": testid,
|
|
5976
|
+
...props
|
|
5977
|
+
}
|
|
5978
|
+
)
|
|
5979
|
+
] }));
|
|
5980
|
+
AlertDialogContentBase.displayName = AlertDialogPrimitive.Content.displayName;
|
|
5981
|
+
var AlertDialogHeaderBase = ({
|
|
5982
|
+
className,
|
|
5983
|
+
...props
|
|
5984
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5985
|
+
"div",
|
|
5986
|
+
{
|
|
5987
|
+
className: cn(
|
|
5988
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
5989
|
+
className
|
|
5990
|
+
),
|
|
5991
|
+
...props
|
|
5992
|
+
}
|
|
5993
|
+
);
|
|
5994
|
+
AlertDialogHeaderBase.displayName = "AlertDialogHeaderBase";
|
|
5995
|
+
var AlertDialogFooterBase = ({
|
|
5996
|
+
className,
|
|
5997
|
+
...props
|
|
5998
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5999
|
+
"div",
|
|
6000
|
+
{
|
|
6001
|
+
className: cn(
|
|
6002
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end",
|
|
6003
|
+
className
|
|
6004
|
+
),
|
|
6005
|
+
...props
|
|
6006
|
+
}
|
|
6007
|
+
);
|
|
6008
|
+
AlertDialogFooterBase.displayName = "AlertDialogFooterBase";
|
|
6009
|
+
var AlertDialogTitleBase = React18.forwardRef(({ className, testid = "alertdialog-title", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6010
|
+
AlertDialogPrimitive.Title,
|
|
6011
|
+
{
|
|
6012
|
+
ref,
|
|
6013
|
+
className: cn("text-lg font-semibold", className),
|
|
6014
|
+
"data-testid": testid,
|
|
6015
|
+
...props
|
|
6016
|
+
}
|
|
6017
|
+
));
|
|
6018
|
+
AlertDialogTitleBase.displayName = AlertDialogPrimitive.Title.displayName;
|
|
6019
|
+
var AlertDialogDescriptionBase = React18.forwardRef(({ className, testid = "alertdialog-description", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6020
|
+
AlertDialogPrimitive.Description,
|
|
6021
|
+
{
|
|
6022
|
+
ref,
|
|
6023
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
6024
|
+
"data-testid": testid,
|
|
6025
|
+
...props
|
|
6026
|
+
}
|
|
6027
|
+
));
|
|
6028
|
+
AlertDialogDescriptionBase.displayName = AlertDialogPrimitive.Description.displayName;
|
|
6029
|
+
var AlertDialogActionBase = React18.forwardRef(({ className, testid = "alertdialog-action", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6030
|
+
AlertDialogPrimitive.Action,
|
|
6031
|
+
{
|
|
6032
|
+
ref,
|
|
6033
|
+
className: cn(buttonVariantsBase(), className),
|
|
6034
|
+
"data-testid": testid,
|
|
6035
|
+
...props
|
|
6036
|
+
}
|
|
6037
|
+
));
|
|
6038
|
+
AlertDialogActionBase.displayName = AlertDialogPrimitive.Action.displayName;
|
|
6039
|
+
var AlertDialogCancelBase = React18.forwardRef(({ className, testid = "alertdialog-cancel", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6040
|
+
AlertDialogPrimitive.Cancel,
|
|
6041
|
+
{
|
|
6042
|
+
ref,
|
|
6043
|
+
className: cn(buttonVariantsBase({ variant: "outline" }), className),
|
|
6044
|
+
"data-testid": testid,
|
|
6045
|
+
...props
|
|
6046
|
+
}
|
|
6047
|
+
));
|
|
6048
|
+
AlertDialogCancelBase.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
6049
|
+
|
|
6050
|
+
// src/components/ui/feedback/DestructiveDialog.tsx
|
|
6051
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6052
|
+
var DestructiveDialog = ({
|
|
6053
|
+
title,
|
|
6054
|
+
description,
|
|
6055
|
+
onConfirm,
|
|
6056
|
+
onCancel,
|
|
6057
|
+
children,
|
|
6058
|
+
triggerContent
|
|
6059
|
+
}) => {
|
|
6060
|
+
const triggerEl = React19.isValidElement(children) ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AlertDialogTriggerBase, { asChild: true, children }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AlertDialogTriggerBase, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ButtonBase, { variant: "destructive", children: triggerContent ?? "Excluir" }) });
|
|
6061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(AlertDialogBase, { children: [
|
|
6062
|
+
triggerEl,
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
6064
|
+
AlertDialogContentBase,
|
|
6065
|
+
{
|
|
6066
|
+
className: cn("border border-destructive bg-background"),
|
|
6067
|
+
children: [
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-start gap-4", children: [
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react23.XCircleIcon, { className: "w-6 h-6 text-destructive" }) }),
|
|
6070
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex-1", children: [
|
|
6071
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AlertDialogTitleBase, { className: "text-lg sm:text-xl font-semibold text-destructive", children: title }),
|
|
6072
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AlertDialogDescriptionBase, { className: "mt-2 text-sm text-muted-foreground", children: description })
|
|
6073
|
+
] })
|
|
6074
|
+
] }),
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(AlertDialogFooterBase, { className: "mt-2 flex justify-end gap-3", children: [
|
|
6076
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6077
|
+
AlertDialogCancelBase,
|
|
6078
|
+
{
|
|
6079
|
+
onClick: onCancel,
|
|
6080
|
+
className: cn(
|
|
6081
|
+
buttonVariantsBase({ variant: "outline", size: "default" }),
|
|
6082
|
+
"hover:bg-foreground/5 hover:text-primary hover:opacity-90 hover:shadow-none"
|
|
6083
|
+
),
|
|
6084
|
+
children: "Cancelar"
|
|
6085
|
+
}
|
|
6086
|
+
),
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6088
|
+
AlertDialogActionBase,
|
|
6089
|
+
{
|
|
6090
|
+
onClick: onConfirm,
|
|
6091
|
+
className: cn(
|
|
6092
|
+
buttonVariantsBase({ variant: "destructive", size: "default" })
|
|
6093
|
+
),
|
|
6094
|
+
children: "Confirmar"
|
|
6095
|
+
}
|
|
6096
|
+
)
|
|
6097
|
+
] })
|
|
6098
|
+
]
|
|
6099
|
+
}
|
|
6100
|
+
)
|
|
6101
|
+
] });
|
|
6102
|
+
};
|
|
6103
|
+
|
|
6104
|
+
// src/components/ui/form/SmallButtons.tsx
|
|
6105
|
+
var import_react24 = require("@phosphor-icons/react");
|
|
6106
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6107
|
+
var EditButton = React20.forwardRef(
|
|
6108
|
+
({
|
|
6109
|
+
disabled,
|
|
6110
|
+
onClick,
|
|
6111
|
+
testid = "button-edit",
|
|
6112
|
+
className,
|
|
6113
|
+
iconSize = 18,
|
|
6114
|
+
iconColor,
|
|
6115
|
+
variant = "default",
|
|
6116
|
+
size = "icon",
|
|
6117
|
+
...props
|
|
6118
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6119
|
+
ButtonBase,
|
|
6120
|
+
{
|
|
6121
|
+
ref,
|
|
6122
|
+
variant,
|
|
6123
|
+
size,
|
|
6124
|
+
onClick,
|
|
6125
|
+
disabled,
|
|
6126
|
+
testid,
|
|
6127
|
+
className: cn(
|
|
6128
|
+
"transition-all duration-200 ease-in-out group",
|
|
6129
|
+
"hover:scale-105",
|
|
6130
|
+
"active:scale-95",
|
|
6131
|
+
"disabled:hover:scale-100",
|
|
6132
|
+
className
|
|
6133
|
+
),
|
|
6134
|
+
...props,
|
|
6135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6136
|
+
import_react24.PencilSimpleIcon,
|
|
6137
|
+
{
|
|
6138
|
+
size: iconSize,
|
|
6139
|
+
color: iconColor,
|
|
6140
|
+
className: "transition-transform duration-200 group-hover:-rotate-12"
|
|
6141
|
+
}
|
|
6142
|
+
)
|
|
6143
|
+
}
|
|
6144
|
+
)
|
|
6145
|
+
);
|
|
6146
|
+
EditButton.displayName = "EditButton";
|
|
6147
|
+
var ChangeButton = React20.forwardRef(
|
|
6148
|
+
({
|
|
6149
|
+
disabled,
|
|
6150
|
+
onClick,
|
|
6151
|
+
testid = "button-edit",
|
|
6152
|
+
className,
|
|
6153
|
+
iconSize = 18,
|
|
6154
|
+
iconColor,
|
|
6155
|
+
variant = "default",
|
|
6156
|
+
size = "icon",
|
|
6157
|
+
...props
|
|
6158
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6159
|
+
ButtonBase,
|
|
6160
|
+
{
|
|
6161
|
+
ref,
|
|
6162
|
+
variant,
|
|
6163
|
+
size,
|
|
6164
|
+
onClick,
|
|
6165
|
+
disabled,
|
|
6166
|
+
testid,
|
|
6167
|
+
className: cn(
|
|
6168
|
+
"transition-all duration-200 ease-in-out group",
|
|
6169
|
+
"hover:scale-105",
|
|
6170
|
+
"active:scale-95",
|
|
6171
|
+
"disabled:hover:scale-100",
|
|
6172
|
+
className
|
|
6173
|
+
),
|
|
6174
|
+
...props,
|
|
6175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6176
|
+
import_react24.ArrowsLeftRightIcon,
|
|
6177
|
+
{
|
|
6178
|
+
size: iconSize,
|
|
6179
|
+
color: iconColor,
|
|
6180
|
+
className: "transition-transform duration-200 group-hover:-rotate-180"
|
|
6181
|
+
}
|
|
6182
|
+
)
|
|
6183
|
+
}
|
|
6184
|
+
)
|
|
6185
|
+
);
|
|
6186
|
+
ChangeButton.displayName = "ChangeButton";
|
|
6187
|
+
var SaveButton = React20.forwardRef(
|
|
6188
|
+
({
|
|
6189
|
+
disabled,
|
|
6190
|
+
onClick,
|
|
6191
|
+
testid = "button-save",
|
|
6192
|
+
className,
|
|
6193
|
+
iconSize = 18,
|
|
6194
|
+
iconColor,
|
|
6195
|
+
variant = "default",
|
|
6196
|
+
size = "icon",
|
|
6197
|
+
...props
|
|
6198
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6199
|
+
ButtonBase,
|
|
6200
|
+
{
|
|
6201
|
+
ref,
|
|
6202
|
+
variant,
|
|
6203
|
+
size,
|
|
6204
|
+
onClick,
|
|
6205
|
+
disabled,
|
|
6206
|
+
testid,
|
|
6207
|
+
className: cn(
|
|
6208
|
+
"transition-all duration-200 ease-in-out group",
|
|
6209
|
+
"hover:scale-105",
|
|
6210
|
+
"active:scale-95",
|
|
6211
|
+
"disabled:hover:scale-100",
|
|
6212
|
+
className
|
|
6213
|
+
),
|
|
6214
|
+
...props,
|
|
6215
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6216
|
+
import_react24.FloppyDiskIcon,
|
|
6217
|
+
{
|
|
6218
|
+
size: iconSize,
|
|
6219
|
+
color: iconColor,
|
|
6220
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
6221
|
+
}
|
|
6222
|
+
)
|
|
6223
|
+
}
|
|
6224
|
+
)
|
|
6225
|
+
);
|
|
6226
|
+
SaveButton.displayName = "SaveButton";
|
|
6227
|
+
var AddButton = React20.forwardRef(
|
|
6228
|
+
({
|
|
6229
|
+
disabled,
|
|
6230
|
+
onClick,
|
|
6231
|
+
testid = "button-add",
|
|
6232
|
+
className,
|
|
6233
|
+
iconSize = 18,
|
|
6234
|
+
iconColor,
|
|
6235
|
+
variant = "default",
|
|
6236
|
+
size = "icon",
|
|
6237
|
+
...props
|
|
6238
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6239
|
+
ButtonBase,
|
|
6240
|
+
{
|
|
6241
|
+
ref,
|
|
6242
|
+
variant,
|
|
6243
|
+
size,
|
|
6244
|
+
onClick,
|
|
6245
|
+
disabled,
|
|
6246
|
+
testid,
|
|
6247
|
+
className: cn(
|
|
6248
|
+
"transition-all duration-200 ease-in-out",
|
|
6249
|
+
"hover:scale-105",
|
|
6250
|
+
"active:scale-95",
|
|
6251
|
+
"disabled:hover:scale-100",
|
|
6252
|
+
className
|
|
6253
|
+
),
|
|
6254
|
+
...props,
|
|
6255
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6256
|
+
import_react24.PlusIcon,
|
|
6257
|
+
{
|
|
6258
|
+
size: iconSize,
|
|
6259
|
+
color: iconColor,
|
|
6260
|
+
className: "transition-transform duration-300"
|
|
6261
|
+
}
|
|
6262
|
+
)
|
|
6263
|
+
}
|
|
6264
|
+
)
|
|
6265
|
+
);
|
|
6266
|
+
AddButton.displayName = "AddButton";
|
|
6267
|
+
var CloseButton = React20.forwardRef(
|
|
6268
|
+
({
|
|
6269
|
+
disabled,
|
|
6270
|
+
onClick,
|
|
6271
|
+
testid = "button-close",
|
|
6272
|
+
className,
|
|
6273
|
+
iconSize = 18,
|
|
6274
|
+
iconColor,
|
|
6275
|
+
variant = "ghost",
|
|
6276
|
+
size = "icon",
|
|
6277
|
+
...props
|
|
6278
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6279
|
+
ButtonBase,
|
|
6280
|
+
{
|
|
6281
|
+
ref,
|
|
6282
|
+
variant,
|
|
6283
|
+
size,
|
|
6284
|
+
onClick,
|
|
6285
|
+
disabled,
|
|
6286
|
+
testid,
|
|
6287
|
+
className: cn(
|
|
6288
|
+
"transition-all duration-200 ease-in-out",
|
|
6289
|
+
"hover:scale-110 hover:rotate-90 hover:bg-destructive/10",
|
|
6290
|
+
"active:scale-95 active:rotate-0",
|
|
6291
|
+
"disabled:hover:scale-100 disabled:hover:rotate-0",
|
|
6292
|
+
className
|
|
6293
|
+
),
|
|
6294
|
+
...props,
|
|
6295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6296
|
+
import_react24.XIcon,
|
|
6297
|
+
{
|
|
6298
|
+
size: iconSize,
|
|
6299
|
+
color: iconColor,
|
|
6300
|
+
className: "transition-transform duration-300"
|
|
6301
|
+
}
|
|
6302
|
+
)
|
|
6303
|
+
}
|
|
6304
|
+
)
|
|
6305
|
+
);
|
|
6306
|
+
CloseButton.displayName = "CloseButton";
|
|
6307
|
+
var DeleteButton = React20.forwardRef(
|
|
6308
|
+
({
|
|
6309
|
+
disabled,
|
|
6310
|
+
onClick,
|
|
6311
|
+
testid = "button-delete",
|
|
6312
|
+
className,
|
|
6313
|
+
iconSize = 18,
|
|
6314
|
+
iconColor,
|
|
6315
|
+
variant = "destructive",
|
|
6316
|
+
size = "icon",
|
|
6317
|
+
destructiveTitle,
|
|
6318
|
+
destructiveDescription,
|
|
6319
|
+
destructiveOnConfirm,
|
|
6320
|
+
destructiveOnCancel,
|
|
6321
|
+
destructiveTriggerContent,
|
|
6322
|
+
...props
|
|
6323
|
+
}, ref) => {
|
|
6324
|
+
const effectiveDestructiveTitle = destructiveTitle ?? props.title;
|
|
6325
|
+
const trigger = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6326
|
+
ButtonBase,
|
|
6327
|
+
{
|
|
6328
|
+
ref,
|
|
6329
|
+
variant,
|
|
6330
|
+
size,
|
|
6331
|
+
onClick,
|
|
6332
|
+
disabled,
|
|
6333
|
+
testid,
|
|
6334
|
+
className: cn(
|
|
6335
|
+
"transition-all duration-200 ease-in-out group",
|
|
6336
|
+
"hover:scale-105",
|
|
6337
|
+
"active:scale-95",
|
|
6338
|
+
"disabled:hover:scale-100",
|
|
6339
|
+
className
|
|
6340
|
+
),
|
|
6341
|
+
...props,
|
|
6342
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6343
|
+
import_react24.TrashIcon,
|
|
6344
|
+
{
|
|
6345
|
+
size: iconSize,
|
|
6346
|
+
color: iconColor,
|
|
6347
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
6348
|
+
}
|
|
6349
|
+
)
|
|
6350
|
+
}
|
|
6351
|
+
);
|
|
6352
|
+
if (effectiveDestructiveTitle) {
|
|
6353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6354
|
+
DestructiveDialog,
|
|
6355
|
+
{
|
|
6356
|
+
title: effectiveDestructiveTitle,
|
|
6357
|
+
description: destructiveDescription ?? "Essa a\xE7\xE3o \xE9 irrevers\xEDvel.",
|
|
6358
|
+
onConfirm: destructiveOnConfirm ?? (() => {
|
|
6359
|
+
}),
|
|
6360
|
+
onCancel: destructiveOnCancel,
|
|
6361
|
+
triggerContent: destructiveTriggerContent,
|
|
6362
|
+
children: trigger
|
|
6363
|
+
}
|
|
6364
|
+
);
|
|
6365
|
+
}
|
|
6366
|
+
return trigger;
|
|
6367
|
+
}
|
|
6368
|
+
);
|
|
6369
|
+
DeleteButton.displayName = "DeleteButton";
|
|
6370
|
+
var DownloadButton = ({
|
|
6371
|
+
disabled,
|
|
6372
|
+
onClick,
|
|
6373
|
+
testid = "button-download",
|
|
6374
|
+
...props
|
|
6375
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6376
|
+
ButtonBase,
|
|
6377
|
+
{
|
|
6378
|
+
variant: "outline",
|
|
6379
|
+
size: "icon",
|
|
6380
|
+
onClick,
|
|
6381
|
+
disabled,
|
|
6382
|
+
testid,
|
|
6383
|
+
className: cn(
|
|
6384
|
+
"transition-all duration-200 ease-in-out group",
|
|
6385
|
+
"hover:scale-105",
|
|
6386
|
+
"active:scale-95",
|
|
6387
|
+
"disabled:hover:scale-100"
|
|
6388
|
+
),
|
|
6389
|
+
...props,
|
|
6390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6391
|
+
import_react24.DownloadSimpleIcon,
|
|
6392
|
+
{
|
|
6393
|
+
size: 18,
|
|
6394
|
+
className: "transition-transform duration-300 group-hover:translate-y-0.5"
|
|
6395
|
+
}
|
|
6396
|
+
)
|
|
6397
|
+
}
|
|
6398
|
+
);
|
|
6399
|
+
var UploadButton = ({
|
|
6400
|
+
disabled,
|
|
6401
|
+
onClick,
|
|
6402
|
+
testid = "button-upload",
|
|
6403
|
+
...props
|
|
6404
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6405
|
+
ButtonBase,
|
|
6406
|
+
{
|
|
6407
|
+
variant: "outline",
|
|
6408
|
+
size: "icon",
|
|
6409
|
+
onClick,
|
|
6410
|
+
disabled,
|
|
6411
|
+
testid,
|
|
6412
|
+
className: cn(
|
|
6413
|
+
"transition-all duration-200 ease-in-out group",
|
|
6414
|
+
"hover:scale-105",
|
|
6415
|
+
"active:scale-95",
|
|
6416
|
+
"disabled:hover:scale-100"
|
|
6417
|
+
),
|
|
6418
|
+
...props,
|
|
6419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6420
|
+
import_react24.UploadSimpleIcon,
|
|
6421
|
+
{
|
|
6422
|
+
size: 18,
|
|
6423
|
+
className: "transition-transform duration-300 group-hover:-translate-y-0.5"
|
|
6424
|
+
}
|
|
6425
|
+
)
|
|
6426
|
+
}
|
|
6427
|
+
);
|
|
6428
|
+
var CopyButton = ({
|
|
6429
|
+
disabled,
|
|
6430
|
+
onClick,
|
|
6431
|
+
testid = "button-copy",
|
|
6432
|
+
...props
|
|
6433
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6434
|
+
ButtonBase,
|
|
6435
|
+
{
|
|
6436
|
+
variant: "ghost",
|
|
6437
|
+
size: "icon",
|
|
6438
|
+
onClick,
|
|
6439
|
+
disabled,
|
|
6440
|
+
testid,
|
|
6441
|
+
className: cn(
|
|
6442
|
+
"transition-all duration-200 ease-in-out group",
|
|
6443
|
+
"hover:scale-105",
|
|
6444
|
+
"active:scale-90",
|
|
6445
|
+
"disabled:hover:scale-100"
|
|
6446
|
+
),
|
|
6447
|
+
...props,
|
|
6448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6449
|
+
import_react24.CopyIcon,
|
|
6450
|
+
{
|
|
6451
|
+
size: 18,
|
|
6452
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
6453
|
+
}
|
|
6454
|
+
)
|
|
6455
|
+
}
|
|
6456
|
+
);
|
|
6457
|
+
var RefreshButton = ({
|
|
6458
|
+
disabled,
|
|
6459
|
+
onClick,
|
|
6460
|
+
testid = "button-refresh",
|
|
6461
|
+
...props
|
|
6462
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6463
|
+
ButtonBase,
|
|
6464
|
+
{
|
|
6465
|
+
variant: "ghost",
|
|
6466
|
+
size: "icon",
|
|
6467
|
+
onClick,
|
|
6468
|
+
disabled,
|
|
6469
|
+
testid,
|
|
6470
|
+
className: cn(
|
|
6471
|
+
"transition-all duration-200 ease-in-out group",
|
|
6472
|
+
"hover:scale-105",
|
|
6473
|
+
"active:scale-95",
|
|
6474
|
+
"disabled:hover:scale-100"
|
|
6475
|
+
),
|
|
6476
|
+
...props,
|
|
6477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6478
|
+
import_react24.ArrowClockwiseIcon,
|
|
6479
|
+
{
|
|
6480
|
+
size: 18,
|
|
6481
|
+
className: "transition-transform duration-500 group-hover:rotate-180"
|
|
6482
|
+
}
|
|
6483
|
+
)
|
|
6484
|
+
}
|
|
6485
|
+
);
|
|
6486
|
+
var SearchButton = ({
|
|
6487
|
+
disabled,
|
|
6488
|
+
onClick,
|
|
6489
|
+
testid = "button-search",
|
|
6490
|
+
...props
|
|
6491
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6492
|
+
ButtonBase,
|
|
6493
|
+
{
|
|
6494
|
+
variant: "outline",
|
|
6495
|
+
size: "icon",
|
|
6496
|
+
onClick,
|
|
6497
|
+
disabled,
|
|
6498
|
+
testid,
|
|
6499
|
+
className: cn(
|
|
6500
|
+
"transition-all duration-200 ease-in-out group",
|
|
6501
|
+
"hover:scale-105",
|
|
6502
|
+
"active:scale-95",
|
|
6503
|
+
"disabled:hover:scale-100"
|
|
6504
|
+
),
|
|
6505
|
+
...props,
|
|
6506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6507
|
+
import_react24.MagnifyingGlassIcon,
|
|
6508
|
+
{
|
|
6509
|
+
size: 18,
|
|
6510
|
+
className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
|
|
6511
|
+
}
|
|
6512
|
+
)
|
|
6513
|
+
}
|
|
6514
|
+
);
|
|
6515
|
+
var BackButton = ({
|
|
6516
|
+
disabled,
|
|
6517
|
+
onClick,
|
|
6518
|
+
testid = "button-back",
|
|
6519
|
+
...props
|
|
6520
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6521
|
+
ButtonBase,
|
|
6522
|
+
{
|
|
6523
|
+
variant: "ghost",
|
|
6524
|
+
size: "icon",
|
|
6525
|
+
onClick,
|
|
6526
|
+
disabled,
|
|
6527
|
+
testid,
|
|
6528
|
+
className: cn(
|
|
6529
|
+
"transition-all duration-200 ease-in-out group",
|
|
6530
|
+
"hover:scale-105",
|
|
6531
|
+
"active:scale-95",
|
|
6532
|
+
"disabled:hover:scale-100"
|
|
6533
|
+
),
|
|
6534
|
+
...props,
|
|
6535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6536
|
+
import_react24.ArrowLeftIcon,
|
|
6537
|
+
{
|
|
6538
|
+
size: 18,
|
|
6539
|
+
className: "transition-transform duration-300 group-hover:-translate-x-1"
|
|
6540
|
+
}
|
|
6541
|
+
)
|
|
6542
|
+
}
|
|
6543
|
+
);
|
|
6544
|
+
var SettingsButton = ({
|
|
6545
|
+
disabled,
|
|
6546
|
+
onClick,
|
|
6547
|
+
testid = "button-settings",
|
|
6548
|
+
...props
|
|
6549
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6550
|
+
ButtonBase,
|
|
6551
|
+
{
|
|
6552
|
+
variant: "ghost",
|
|
6553
|
+
size: "icon",
|
|
6554
|
+
onClick,
|
|
6555
|
+
disabled,
|
|
6556
|
+
testid,
|
|
6557
|
+
className: cn(
|
|
6558
|
+
"transition-all duration-200 ease-in-out group",
|
|
6559
|
+
"hover:scale-105",
|
|
6560
|
+
"active:scale-95",
|
|
6561
|
+
"disabled:hover:scale-100"
|
|
6562
|
+
),
|
|
6563
|
+
...props,
|
|
6564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6565
|
+
import_react24.GearIcon,
|
|
6566
|
+
{
|
|
6567
|
+
size: 18,
|
|
6568
|
+
className: "transition-transform duration-500 group-hover:rotate-90"
|
|
6569
|
+
}
|
|
6570
|
+
)
|
|
6571
|
+
}
|
|
6572
|
+
);
|
|
6573
|
+
var NotificationButton = ({
|
|
6574
|
+
disabled,
|
|
6575
|
+
onClick,
|
|
6576
|
+
testid = "button-notification",
|
|
6577
|
+
...props
|
|
6578
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6579
|
+
ButtonBase,
|
|
6580
|
+
{
|
|
6581
|
+
variant: "ghost",
|
|
6582
|
+
size: "icon",
|
|
6583
|
+
onClick,
|
|
6584
|
+
disabled,
|
|
6585
|
+
testid,
|
|
6586
|
+
className: cn(
|
|
6587
|
+
"transition-all duration-200 ease-in-out group",
|
|
6588
|
+
"hover:scale-105",
|
|
6589
|
+
"active:scale-95",
|
|
6590
|
+
"disabled:hover:scale-100"
|
|
6591
|
+
),
|
|
6592
|
+
...props,
|
|
6593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6594
|
+
import_react24.BellIcon,
|
|
6595
|
+
{
|
|
6596
|
+
size: 18,
|
|
6597
|
+
className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
|
|
6598
|
+
}
|
|
6599
|
+
)
|
|
6600
|
+
}
|
|
6601
|
+
);
|
|
6602
|
+
var MoreButton = ({
|
|
6603
|
+
disabled,
|
|
6604
|
+
onClick,
|
|
6605
|
+
testid = "button-more",
|
|
6606
|
+
...props
|
|
6607
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6608
|
+
ButtonBase,
|
|
6609
|
+
{
|
|
6610
|
+
variant: "ghost",
|
|
6611
|
+
size: "icon",
|
|
6612
|
+
onClick,
|
|
6613
|
+
disabled,
|
|
6614
|
+
testid,
|
|
6615
|
+
className: cn(
|
|
6616
|
+
"transition-all duration-200 ease-in-out group",
|
|
6617
|
+
"hover:scale-105",
|
|
6618
|
+
"active:scale-95",
|
|
6619
|
+
"disabled:hover:scale-100"
|
|
6620
|
+
),
|
|
6621
|
+
...props,
|
|
6622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6623
|
+
import_react24.DotsThreeIcon,
|
|
6624
|
+
{
|
|
6625
|
+
size: 18,
|
|
6626
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
6627
|
+
}
|
|
6628
|
+
)
|
|
6629
|
+
}
|
|
6630
|
+
);
|
|
6631
|
+
var CheckButton = ({
|
|
6632
|
+
disabled,
|
|
6633
|
+
onClick,
|
|
6634
|
+
testid = "button-check",
|
|
6635
|
+
...props
|
|
6636
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6637
|
+
ButtonBase,
|
|
6638
|
+
{
|
|
6639
|
+
variant: "default",
|
|
6640
|
+
size: "icon",
|
|
6641
|
+
onClick,
|
|
6642
|
+
disabled,
|
|
6643
|
+
testid,
|
|
6644
|
+
className: cn(
|
|
6645
|
+
"transition-all duration-200 ease-in-out group",
|
|
6646
|
+
"hover:scale-110",
|
|
6647
|
+
"active:scale-95",
|
|
6648
|
+
"disabled:hover:scale-100"
|
|
6649
|
+
),
|
|
6650
|
+
...props,
|
|
6651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6652
|
+
import_react24.CheckIcon,
|
|
6653
|
+
{
|
|
6654
|
+
size: 18,
|
|
6655
|
+
className: "transition-transform duration-200 group-hover:scale-110"
|
|
6656
|
+
}
|
|
6657
|
+
)
|
|
6658
|
+
}
|
|
6659
|
+
);
|
|
6660
|
+
var FilterButton = ({
|
|
6661
|
+
disabled,
|
|
6662
|
+
onClick,
|
|
6663
|
+
testid = "button-filter",
|
|
6664
|
+
active = false,
|
|
6665
|
+
className,
|
|
6666
|
+
iconSize = 18,
|
|
6667
|
+
iconColor,
|
|
6668
|
+
variant,
|
|
6669
|
+
size = "icon",
|
|
6670
|
+
...props
|
|
6671
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6672
|
+
ButtonBase,
|
|
6673
|
+
{
|
|
6674
|
+
variant: variant || (active ? "default" : "outline"),
|
|
6675
|
+
size,
|
|
6676
|
+
onClick,
|
|
6677
|
+
disabled,
|
|
6678
|
+
testid,
|
|
6679
|
+
className: cn(
|
|
6680
|
+
"transition-all duration-200 ease-in-out",
|
|
6681
|
+
"hover:scale-105",
|
|
6682
|
+
"active:scale-95",
|
|
6683
|
+
"disabled:hover:scale-100",
|
|
6684
|
+
className
|
|
6685
|
+
),
|
|
6686
|
+
...props,
|
|
6687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6688
|
+
import_react24.FunnelIcon,
|
|
6689
|
+
{
|
|
6690
|
+
size: iconSize,
|
|
6691
|
+
color: iconColor,
|
|
6692
|
+
weight: active ? "fill" : "regular",
|
|
6693
|
+
className: "transition-all duration-200"
|
|
6694
|
+
}
|
|
6695
|
+
)
|
|
6696
|
+
}
|
|
6697
|
+
);
|
|
6698
|
+
var LikeButton = ({
|
|
6699
|
+
disabled,
|
|
6700
|
+
onClick,
|
|
6701
|
+
testid = "button-like",
|
|
6702
|
+
isLiked = false,
|
|
6703
|
+
className,
|
|
6704
|
+
iconSize = 18,
|
|
6705
|
+
iconColor,
|
|
6706
|
+
variant = "ghost",
|
|
6707
|
+
size = "icon",
|
|
6708
|
+
...props
|
|
6709
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6710
|
+
ButtonBase,
|
|
6711
|
+
{
|
|
6712
|
+
variant,
|
|
6713
|
+
size,
|
|
6714
|
+
onClick,
|
|
6715
|
+
disabled,
|
|
6716
|
+
testid,
|
|
6717
|
+
className: cn(
|
|
6718
|
+
"transition-all duration-200 ease-in-out group",
|
|
6719
|
+
"hover:scale-110",
|
|
6720
|
+
"active:scale-95",
|
|
6721
|
+
"disabled:hover:scale-100",
|
|
6722
|
+
!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"),
|
|
6723
|
+
className
|
|
6724
|
+
),
|
|
6725
|
+
...props,
|
|
6726
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6727
|
+
import_react24.HeartIcon,
|
|
6728
|
+
{
|
|
6729
|
+
size: iconSize,
|
|
6730
|
+
color: iconColor,
|
|
6731
|
+
weight: isLiked ? "fill" : "regular",
|
|
6732
|
+
className: "transition-all duration-300 group-hover:scale-110"
|
|
6733
|
+
}
|
|
6734
|
+
)
|
|
6735
|
+
}
|
|
6736
|
+
);
|
|
6737
|
+
var FavoriteButton = ({
|
|
6738
|
+
disabled,
|
|
6739
|
+
onClick,
|
|
6740
|
+
testid = "button-favorite",
|
|
6741
|
+
isFavorite = false,
|
|
6742
|
+
className,
|
|
6743
|
+
iconSize = 18,
|
|
6744
|
+
iconColor,
|
|
6745
|
+
variant = "ghost",
|
|
6746
|
+
size = "icon",
|
|
6747
|
+
...props
|
|
6748
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6749
|
+
ButtonBase,
|
|
6750
|
+
{
|
|
6751
|
+
variant,
|
|
6752
|
+
size,
|
|
6753
|
+
onClick,
|
|
6754
|
+
disabled,
|
|
6755
|
+
testid,
|
|
6756
|
+
className: cn(
|
|
6757
|
+
"transition-all duration-200 ease-in-out group",
|
|
6758
|
+
"hover:scale-110",
|
|
6759
|
+
"active:scale-95",
|
|
6760
|
+
"disabled:hover:scale-100",
|
|
6761
|
+
!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"),
|
|
6762
|
+
className
|
|
6763
|
+
),
|
|
6764
|
+
...props,
|
|
6765
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6766
|
+
import_react24.StarIcon,
|
|
6767
|
+
{
|
|
6768
|
+
size: iconSize,
|
|
6769
|
+
color: iconColor,
|
|
6770
|
+
weight: isFavorite ? "fill" : "regular",
|
|
6771
|
+
className: "transition-all duration-300 group-hover:rotate-12"
|
|
6772
|
+
}
|
|
6773
|
+
)
|
|
6774
|
+
}
|
|
6775
|
+
);
|
|
6776
|
+
var VisibilityButton = ({
|
|
6777
|
+
disabled,
|
|
6778
|
+
onClick,
|
|
6779
|
+
testid = "button-visibility",
|
|
6780
|
+
isVisible = true,
|
|
6781
|
+
className,
|
|
6782
|
+
iconSize = 18,
|
|
6783
|
+
iconColor,
|
|
6784
|
+
variant = "ghost",
|
|
6785
|
+
size = "icon",
|
|
6786
|
+
...props
|
|
6787
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6788
|
+
ButtonBase,
|
|
6789
|
+
{
|
|
6790
|
+
variant,
|
|
6791
|
+
size,
|
|
6792
|
+
onClick,
|
|
6793
|
+
disabled,
|
|
6794
|
+
testid,
|
|
6795
|
+
className: cn(
|
|
6796
|
+
"transition-all duration-200 ease-in-out",
|
|
6797
|
+
"hover:scale-105",
|
|
6798
|
+
"active:scale-95",
|
|
6799
|
+
"disabled:hover:scale-100",
|
|
6800
|
+
className
|
|
6801
|
+
),
|
|
6802
|
+
...props,
|
|
6803
|
+
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6804
|
+
import_react24.EyeIcon,
|
|
6805
|
+
{
|
|
6806
|
+
size: iconSize,
|
|
6807
|
+
color: iconColor,
|
|
6808
|
+
className: "transition-opacity duration-200"
|
|
6809
|
+
}
|
|
6810
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6811
|
+
import_react24.EyeSlashIcon,
|
|
6812
|
+
{
|
|
6813
|
+
size: iconSize,
|
|
6814
|
+
color: iconColor,
|
|
6815
|
+
className: "transition-opacity duration-200"
|
|
6816
|
+
}
|
|
6817
|
+
)
|
|
6818
|
+
}
|
|
6819
|
+
);
|
|
6820
|
+
var ViewButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(VisibilityButton, { isVisible: true, testid: "button-view", ...props });
|
|
6821
|
+
var HideButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(VisibilityButton, { isVisible: false, testid: "button-hide", ...props });
|
|
6822
|
+
var LockButton = ({
|
|
6823
|
+
disabled,
|
|
6824
|
+
onClick,
|
|
6825
|
+
testid = "button-lock",
|
|
6826
|
+
isLocked = true,
|
|
6827
|
+
className,
|
|
6828
|
+
iconSize = 18,
|
|
6829
|
+
iconColor,
|
|
6830
|
+
variant = "ghost",
|
|
6831
|
+
size = "icon",
|
|
6832
|
+
...props
|
|
6833
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6834
|
+
ButtonBase,
|
|
6835
|
+
{
|
|
6836
|
+
variant,
|
|
6837
|
+
size,
|
|
6838
|
+
onClick,
|
|
6839
|
+
disabled,
|
|
6840
|
+
testid,
|
|
6841
|
+
className: cn(
|
|
6842
|
+
"transition-all duration-200 ease-in-out group",
|
|
6843
|
+
"hover:scale-105",
|
|
6844
|
+
"active:scale-95",
|
|
6845
|
+
"disabled:hover:scale-100",
|
|
6846
|
+
!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"),
|
|
6847
|
+
className
|
|
6848
|
+
),
|
|
6849
|
+
...props,
|
|
6850
|
+
children: isLocked ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6851
|
+
import_react24.LockIcon,
|
|
6852
|
+
{
|
|
6853
|
+
size: iconSize,
|
|
6854
|
+
color: iconColor,
|
|
6855
|
+
className: "transition-all duration-200 group-hover:scale-110"
|
|
6856
|
+
}
|
|
6857
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6858
|
+
import_react24.LockOpenIcon,
|
|
6859
|
+
{
|
|
6860
|
+
size: iconSize,
|
|
6861
|
+
color: iconColor,
|
|
6862
|
+
className: "transition-all duration-200 group-hover:scale-110"
|
|
6863
|
+
}
|
|
6864
|
+
)
|
|
6865
|
+
}
|
|
6866
|
+
);
|
|
6867
|
+
var UnlockButton = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(LockButton, { isLocked: false, testid: "button-unlock", ...props });
|
|
6868
|
+
|
|
6869
|
+
// src/components/ui/data/FileUploader.tsx
|
|
6870
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6871
|
+
var formatFileSize = (bytes) => {
|
|
6872
|
+
if (bytes === 0) return "0 Bytes";
|
|
6873
|
+
const k = 1024;
|
|
6874
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
6875
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
6876
|
+
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
|
|
6877
|
+
};
|
|
6878
|
+
var getFileExtension = (filename) => {
|
|
6879
|
+
return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
|
|
6880
|
+
};
|
|
6881
|
+
var getFileTypeIcon = (file) => {
|
|
6882
|
+
const extension = getFileExtension(file.name).toLowerCase();
|
|
6883
|
+
const mimeType = file.type.toLowerCase();
|
|
6884
|
+
if (extension === "pdf" || mimeType === "application/pdf") {
|
|
6885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FilePdfIcon, { size: 20, className: "text-red-500" });
|
|
6886
|
+
}
|
|
6887
|
+
if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
|
|
6888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileDocIcon, { size: 20, className: "text-blue-500" });
|
|
6889
|
+
}
|
|
6890
|
+
if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
|
|
6891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileXlsIcon, { size: 20, className: "text-green-500" });
|
|
6892
|
+
}
|
|
6893
|
+
if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
|
|
6894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FilePptIcon, { size: 20, className: "text-orange-500" });
|
|
6895
|
+
}
|
|
6896
|
+
if (extension === "csv" || mimeType === "text/csv") {
|
|
6897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileCsvIcon, { size: 20, className: "text-green-600" });
|
|
6898
|
+
}
|
|
6899
|
+
if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
|
|
6900
|
+
extension
|
|
6901
|
+
) || mimeType.includes("text")) {
|
|
6902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileTextIcon, { size: 20, className: "text-gray-500" });
|
|
6903
|
+
}
|
|
6904
|
+
if (mimeType.startsWith("image/")) {
|
|
6905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileImageIcon, { size: 20, className: "text-purple-500" });
|
|
6906
|
+
}
|
|
6907
|
+
if (mimeType.startsWith("video/")) {
|
|
6908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileVideoIcon, { size: 20, className: "text-pink-500" });
|
|
6909
|
+
}
|
|
6910
|
+
if (mimeType.startsWith("audio/")) {
|
|
6911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileAudioIcon, { size: 20, className: "text-indigo-500" });
|
|
6912
|
+
}
|
|
6913
|
+
if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
|
|
6914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileZipIcon, { size: 20, className: "text-yellow-600" });
|
|
6915
|
+
}
|
|
6916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.FileIcon, { size: 20, className: "text-muted-foreground" });
|
|
6917
|
+
};
|
|
6918
|
+
var createImagePreview = (file) => {
|
|
6919
|
+
return new Promise((resolve) => {
|
|
6920
|
+
if (!file.type.startsWith("image/")) {
|
|
6921
|
+
resolve(null);
|
|
6922
|
+
return;
|
|
6923
|
+
}
|
|
6924
|
+
const reader = new FileReader();
|
|
6925
|
+
reader.onload = (e) => {
|
|
6926
|
+
resolve(e.target?.result);
|
|
6927
|
+
};
|
|
6928
|
+
reader.onerror = () => {
|
|
6929
|
+
resolve(null);
|
|
6930
|
+
};
|
|
6931
|
+
reader.readAsDataURL(file);
|
|
6932
|
+
});
|
|
6933
|
+
};
|
|
6934
|
+
var FileUploader = React21.forwardRef(
|
|
6935
|
+
({
|
|
6936
|
+
className,
|
|
6937
|
+
accept,
|
|
6938
|
+
maxSize,
|
|
6939
|
+
maxFiles = 1,
|
|
6940
|
+
disabled = false,
|
|
6941
|
+
value = [],
|
|
6942
|
+
onValueChange,
|
|
6943
|
+
onUpload,
|
|
6944
|
+
showPreview = true,
|
|
6945
|
+
dropzoneText = "Arraste arquivos aqui ou clique para selecionar",
|
|
6946
|
+
dropzoneSubtext,
|
|
6947
|
+
animate = true,
|
|
6948
|
+
...props
|
|
6949
|
+
}, ref) => {
|
|
6950
|
+
const [isDragging, setIsDragging] = React21.useState(false);
|
|
6951
|
+
const [files, setFiles] = React21.useState(value);
|
|
6952
|
+
const inputRef = React21.useRef(null);
|
|
6953
|
+
const dragCounterRef = React21.useRef(0);
|
|
6954
|
+
const multiple = maxFiles > 1;
|
|
6955
|
+
React21.useEffect(() => {
|
|
6956
|
+
setFiles(value);
|
|
6957
|
+
}, [value]);
|
|
6958
|
+
React21.useEffect(() => {
|
|
6959
|
+
return () => {
|
|
6960
|
+
files.forEach((file) => {
|
|
6961
|
+
if (file.preview) {
|
|
6962
|
+
URL.revokeObjectURL(file.preview);
|
|
6963
|
+
}
|
|
6964
|
+
});
|
|
6965
|
+
};
|
|
6966
|
+
}, [files]);
|
|
6967
|
+
const validateFile = (file) => {
|
|
6968
|
+
if (file.size > maxSize) {
|
|
6969
|
+
return `Arquivo muito grande. M\xE1ximo: ${formatFileSize(maxSize)}`;
|
|
6970
|
+
}
|
|
6971
|
+
if (accept.length > 0) {
|
|
6972
|
+
const fileExtension = `.${getFileExtension(file.name)}`;
|
|
6973
|
+
const fileType = file.type;
|
|
6974
|
+
const isAccepted = accept.some((acceptItem) => {
|
|
6975
|
+
if (acceptItem.startsWith(".")) {
|
|
6976
|
+
return fileExtension.toLowerCase() === acceptItem.toLowerCase();
|
|
6977
|
+
}
|
|
6978
|
+
if (acceptItem.endsWith("/*")) {
|
|
6979
|
+
return fileType.startsWith(acceptItem.replace("/*", ""));
|
|
6980
|
+
}
|
|
6981
|
+
return fileType === acceptItem;
|
|
6982
|
+
});
|
|
6983
|
+
if (!isAccepted) {
|
|
6984
|
+
return `Tipo de arquivo n\xE3o permitido. Aceitos: ${accept.join(", ")}`;
|
|
6985
|
+
}
|
|
6986
|
+
}
|
|
6987
|
+
return null;
|
|
6988
|
+
};
|
|
6989
|
+
const createFileWithPreview = async (file) => {
|
|
6990
|
+
const fileWithPreview = file;
|
|
6991
|
+
fileWithPreview.id = `${file.name}-${Date.now()}-${Math.random()}`;
|
|
6992
|
+
const error = validateFile(file);
|
|
6993
|
+
if (error) {
|
|
6994
|
+
fileWithPreview.error = error;
|
|
6995
|
+
}
|
|
6996
|
+
if (file.type.startsWith("image/")) {
|
|
6997
|
+
try {
|
|
6998
|
+
const preview = await createImagePreview(file);
|
|
6999
|
+
if (preview) {
|
|
7000
|
+
fileWithPreview.preview = preview;
|
|
7001
|
+
}
|
|
7002
|
+
} catch (error2) {
|
|
7003
|
+
console.warn("Erro ao criar preview da imagem:", error2);
|
|
7004
|
+
}
|
|
7005
|
+
}
|
|
7006
|
+
return fileWithPreview;
|
|
7007
|
+
};
|
|
7008
|
+
const handleFiles = async (newFiles) => {
|
|
7009
|
+
if (disabled) return;
|
|
7010
|
+
const availableSlots = maxFiles - files.length;
|
|
7011
|
+
const filesToAdd = multiple ? newFiles.slice(0, availableSlots) : [newFiles[0]];
|
|
7012
|
+
const filesWithPreview = await Promise.all(
|
|
7013
|
+
filesToAdd.map((file) => createFileWithPreview(file))
|
|
7014
|
+
);
|
|
7015
|
+
const updatedFiles = multiple ? [...files, ...filesWithPreview] : filesWithPreview;
|
|
7016
|
+
setFiles(updatedFiles);
|
|
7017
|
+
onValueChange(updatedFiles);
|
|
7018
|
+
if (onUpload) {
|
|
7019
|
+
const validFiles = filesWithPreview.filter((f) => !f.error);
|
|
7020
|
+
if (validFiles.length > 0) {
|
|
7021
|
+
try {
|
|
7022
|
+
await onUpload(validFiles);
|
|
7023
|
+
} catch (error) {
|
|
7024
|
+
console.error("Erro no upload:", error);
|
|
7025
|
+
}
|
|
7026
|
+
}
|
|
7027
|
+
}
|
|
7028
|
+
};
|
|
7029
|
+
const handleDragEnter = (e) => {
|
|
7030
|
+
e.preventDefault();
|
|
7031
|
+
e.stopPropagation();
|
|
7032
|
+
dragCounterRef.current++;
|
|
7033
|
+
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
|
|
7034
|
+
setIsDragging(true);
|
|
7035
|
+
}
|
|
7036
|
+
};
|
|
7037
|
+
const handleDragLeave = (e) => {
|
|
7038
|
+
e.preventDefault();
|
|
7039
|
+
e.stopPropagation();
|
|
7040
|
+
dragCounterRef.current--;
|
|
7041
|
+
if (dragCounterRef.current === 0) {
|
|
7042
|
+
setIsDragging(false);
|
|
7043
|
+
}
|
|
7044
|
+
};
|
|
7045
|
+
const handleDragOver = (e) => {
|
|
7046
|
+
e.preventDefault();
|
|
7047
|
+
e.stopPropagation();
|
|
7048
|
+
};
|
|
7049
|
+
const handleDrop = (e) => {
|
|
7050
|
+
e.preventDefault();
|
|
7051
|
+
e.stopPropagation();
|
|
7052
|
+
setIsDragging(false);
|
|
7053
|
+
dragCounterRef.current = 0;
|
|
7054
|
+
if (disabled) return;
|
|
7055
|
+
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
7056
|
+
handleFiles(droppedFiles);
|
|
7057
|
+
};
|
|
7058
|
+
const handleInputChange = (e) => {
|
|
7059
|
+
if (e.target.files) {
|
|
7060
|
+
const selectedFiles = Array.from(e.target.files);
|
|
7061
|
+
handleFiles(selectedFiles);
|
|
7062
|
+
}
|
|
7063
|
+
};
|
|
7064
|
+
const handleRemoveFile = (fileId) => {
|
|
7065
|
+
const fileToRemove = files.find((f) => f.id === fileId);
|
|
7066
|
+
if (fileToRemove?.preview) {
|
|
7067
|
+
URL.revokeObjectURL(fileToRemove.preview);
|
|
7068
|
+
}
|
|
7069
|
+
const updatedFiles = files.filter((f) => f.id !== fileId);
|
|
7070
|
+
setFiles(updatedFiles);
|
|
7071
|
+
onValueChange(updatedFiles);
|
|
7072
|
+
};
|
|
7073
|
+
const handleClick = () => {
|
|
7074
|
+
if (!disabled) {
|
|
7075
|
+
inputRef.current?.click();
|
|
7076
|
+
}
|
|
7077
|
+
};
|
|
7078
|
+
const acceptString = accept.join(",");
|
|
7079
|
+
const defaultSubtext = dropzoneSubtext || `Formatos: ${accept.join(", ")}. M\xE1ximo: ${formatFileSize(maxSize)}`;
|
|
7080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7081
|
+
import_framer_motion10.motion.div,
|
|
7082
|
+
{
|
|
7083
|
+
className: cn(
|
|
7084
|
+
"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",
|
|
7085
|
+
isDragging && "border-primary bg-primary/10 scale-[1.02]",
|
|
7086
|
+
!isDragging && "border-border hover:border-primary/60 hover:bg-muted/50",
|
|
7087
|
+
disabled && "cursor-not-allowed opacity-50 hover:scale-100"
|
|
7088
|
+
),
|
|
7089
|
+
onDragEnter: handleDragEnter,
|
|
7090
|
+
onDragOver: handleDragOver,
|
|
7091
|
+
onDragLeave: handleDragLeave,
|
|
7092
|
+
onDrop: handleDrop,
|
|
7093
|
+
onClick: handleClick,
|
|
7094
|
+
whileHover: !disabled ? { scale: 1.01 } : void 0,
|
|
7095
|
+
whileTap: !disabled ? { scale: 0.99 } : void 0,
|
|
7096
|
+
animate: isDragging ? {
|
|
7097
|
+
borderColor: `hsl(var(--primary))`,
|
|
7098
|
+
backgroundColor: `hsl(var(--primary) / 0.1)`,
|
|
7099
|
+
scale: 1.02
|
|
7100
|
+
} : {
|
|
7101
|
+
borderColor: `hsl(var(--border))`,
|
|
7102
|
+
backgroundColor: `hsl(var(--background))`,
|
|
7103
|
+
scale: 1
|
|
7104
|
+
},
|
|
7105
|
+
transition: {
|
|
7106
|
+
type: "spring",
|
|
7107
|
+
stiffness: 300,
|
|
7108
|
+
damping: 25,
|
|
7109
|
+
duration: 0.3
|
|
7110
|
+
},
|
|
7111
|
+
children: [
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7113
|
+
"input",
|
|
7114
|
+
{
|
|
7115
|
+
ref: inputRef,
|
|
7116
|
+
type: "file",
|
|
7117
|
+
className: "hidden",
|
|
7118
|
+
accept: acceptString,
|
|
7119
|
+
multiple,
|
|
7120
|
+
disabled,
|
|
7121
|
+
onChange: handleInputChange
|
|
7122
|
+
}
|
|
7123
|
+
),
|
|
7124
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7125
|
+
import_framer_motion10.motion.div,
|
|
7126
|
+
{
|
|
7127
|
+
animate: isDragging ? { scale: 1.2, rotate: 10 } : { scale: 1, rotate: 0 },
|
|
7128
|
+
transition: {
|
|
7129
|
+
type: "spring",
|
|
7130
|
+
stiffness: 300,
|
|
7131
|
+
damping: 20,
|
|
7132
|
+
duration: 0.3
|
|
7133
|
+
},
|
|
7134
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7135
|
+
import_framer_motion10.motion.div,
|
|
7136
|
+
{
|
|
7137
|
+
className: cn(
|
|
7138
|
+
"mb-4 h-16 w-16 text-muted-foreground transition-colors duration-300 drop-shadow-lg flex items-center justify-center",
|
|
7139
|
+
isDragging && "text-primary"
|
|
7140
|
+
),
|
|
7141
|
+
initial: false,
|
|
7142
|
+
animate: {
|
|
7143
|
+
color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
|
|
7144
|
+
},
|
|
7145
|
+
transition: { duration: 0.3 },
|
|
7146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.CloudArrowUpIcon, { size: 64 })
|
|
7147
|
+
}
|
|
7148
|
+
)
|
|
7149
|
+
}
|
|
7150
|
+
),
|
|
7151
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7152
|
+
import_framer_motion10.motion.p,
|
|
7153
|
+
{
|
|
7154
|
+
className: "mb-2 text-base font-semibold text-foreground",
|
|
7155
|
+
initial: animate ? { opacity: 0, y: -10 } : false,
|
|
7156
|
+
animate: { opacity: 1, y: 0 },
|
|
7157
|
+
transition: { delay: 0.1 },
|
|
7158
|
+
children: dropzoneText
|
|
7159
|
+
}
|
|
7160
|
+
),
|
|
7161
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7162
|
+
import_framer_motion10.motion.p,
|
|
7163
|
+
{
|
|
7164
|
+
className: "text-sm text-muted-foreground",
|
|
7165
|
+
initial: animate ? { opacity: 0, y: -10 } : false,
|
|
7166
|
+
animate: { opacity: 1, y: 0 },
|
|
7167
|
+
transition: { delay: 0.2 },
|
|
7168
|
+
children: defaultSubtext
|
|
7169
|
+
}
|
|
7170
|
+
),
|
|
7171
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_framer_motion10.AnimatePresence, { children: files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7172
|
+
import_framer_motion10.motion.div,
|
|
7173
|
+
{
|
|
7174
|
+
initial: { opacity: 0, scale: 0.8, y: 10 },
|
|
7175
|
+
animate: {
|
|
7176
|
+
opacity: 1,
|
|
7177
|
+
scale: 1,
|
|
7178
|
+
y: 0,
|
|
7179
|
+
backgroundColor: `hsl(var(--primary) / 0.1)`,
|
|
7180
|
+
borderColor: `hsl(var(--primary) / 0.2)`
|
|
7181
|
+
},
|
|
7182
|
+
exit: { opacity: 0, scale: 0.8, y: 10 },
|
|
7183
|
+
className: cn(
|
|
7184
|
+
"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"
|
|
7185
|
+
),
|
|
7186
|
+
transition: { duration: 0.3 },
|
|
7187
|
+
children: [
|
|
7188
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.CheckIcon, { size: 16, className: "text-emerald-500" }) }),
|
|
7189
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7190
|
+
import_framer_motion10.motion.span,
|
|
7191
|
+
{
|
|
7192
|
+
className: "text-sm font-semibold text-primary",
|
|
7193
|
+
animate: { color: `hsl(var(--primary))` },
|
|
7194
|
+
transition: { duration: 0.3 },
|
|
7195
|
+
children: [
|
|
7196
|
+
files.length,
|
|
7197
|
+
" ",
|
|
7198
|
+
files.length === 1 ? "arquivo selecionado" : "arquivos selecionados"
|
|
7199
|
+
]
|
|
7200
|
+
}
|
|
7201
|
+
)
|
|
7202
|
+
]
|
|
7203
|
+
}
|
|
7204
|
+
) }),
|
|
7205
|
+
showPreview && files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7206
|
+
import_framer_motion10.motion.div,
|
|
7207
|
+
{
|
|
7208
|
+
className: "mt-6 w-full",
|
|
7209
|
+
initial: animate ? { opacity: 0, y: 10 } : false,
|
|
7210
|
+
animate: { opacity: 1, y: 0 },
|
|
7211
|
+
transition: { delay: 0.3 },
|
|
7212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
7213
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("h4", { className: "mb-3 text-sm font-medium text-muted-foreground", children: [
|
|
7214
|
+
"Arquivos selecionados (",
|
|
7215
|
+
files.length,
|
|
7216
|
+
"/",
|
|
7217
|
+
maxFiles,
|
|
7218
|
+
")"
|
|
7219
|
+
] }),
|
|
7220
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-2 overflow-y-auto max-h-44", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_framer_motion10.AnimatePresence, { mode: "popLayout", children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7221
|
+
import_framer_motion10.motion.div,
|
|
7222
|
+
{
|
|
7223
|
+
layout: true,
|
|
7224
|
+
initial: animate ? { opacity: 0, x: -20 } : false,
|
|
7225
|
+
animate: { opacity: 1, x: 0 },
|
|
7226
|
+
exit: {
|
|
7227
|
+
opacity: 0,
|
|
7228
|
+
x: -20,
|
|
7229
|
+
transition: { duration: 0.2 }
|
|
7230
|
+
},
|
|
7231
|
+
transition: {
|
|
7232
|
+
delay: animate ? index * 0.05 : 0,
|
|
7233
|
+
layout: { duration: 0.2 }
|
|
7234
|
+
},
|
|
7235
|
+
className: cn(
|
|
7236
|
+
"flex items-center gap-3 rounded-md border p-3 transition-all duration-300",
|
|
7237
|
+
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"
|
|
7238
|
+
),
|
|
7239
|
+
children: [
|
|
7240
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-muted overflow-hidden", children: file.preview ? (
|
|
7241
|
+
// Preview de imagem
|
|
7242
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7243
|
+
"img",
|
|
7244
|
+
{
|
|
7245
|
+
src: file.preview,
|
|
7246
|
+
alt: file.name,
|
|
7247
|
+
className: "h-full w-full object-cover rounded-md"
|
|
7248
|
+
}
|
|
7249
|
+
)
|
|
7250
|
+
) : (
|
|
7251
|
+
// Ícone baseado no tipo de arquivo
|
|
7252
|
+
getFileTypeIcon(file)
|
|
7253
|
+
) }),
|
|
7254
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
7255
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7256
|
+
"p",
|
|
7257
|
+
{
|
|
7258
|
+
className: "truncate text-sm font-medium text-foreground",
|
|
7259
|
+
title: `${file.name} (${file.type || "Tipo desconhecido"})`,
|
|
7260
|
+
children: file.name
|
|
7261
|
+
}
|
|
7262
|
+
),
|
|
7263
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: formatFileSize(file.size) }),
|
|
7265
|
+
file.type && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: "\u2022" }),
|
|
7267
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "uppercase", children: getFileExtension(file.name) })
|
|
7268
|
+
] })
|
|
7269
|
+
] }),
|
|
7270
|
+
file.error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7271
|
+
import_framer_motion10.motion.p,
|
|
7272
|
+
{
|
|
7273
|
+
className: "mt-1 text-xs text-destructive",
|
|
7274
|
+
initial: { opacity: 0, y: -5 },
|
|
7275
|
+
animate: { opacity: 1, y: 0 },
|
|
7276
|
+
children: file.error
|
|
7277
|
+
}
|
|
7278
|
+
)
|
|
7279
|
+
] }),
|
|
7280
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7281
|
+
DeleteButton,
|
|
7282
|
+
{
|
|
7283
|
+
type: "button",
|
|
7284
|
+
variant: "destructive",
|
|
7285
|
+
size: "icon",
|
|
7286
|
+
onClick: (e) => {
|
|
7287
|
+
e?.stopPropagation();
|
|
7288
|
+
handleRemoveFile(file.id);
|
|
7289
|
+
},
|
|
7290
|
+
className: "",
|
|
7291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react25.XIcon, { size: 12 })
|
|
7292
|
+
}
|
|
7293
|
+
)
|
|
7294
|
+
]
|
|
7295
|
+
},
|
|
7296
|
+
file.id
|
|
7297
|
+
)) }) })
|
|
7298
|
+
] })
|
|
7299
|
+
}
|
|
7300
|
+
)
|
|
7301
|
+
]
|
|
7302
|
+
}
|
|
7303
|
+
) });
|
|
7304
|
+
}
|
|
7305
|
+
);
|
|
7306
|
+
FileUploader.displayName = "FileUploader";
|
|
7307
|
+
|
|
7308
|
+
// src/components/ui/feedback/LoadingBase.tsx
|
|
7309
|
+
var React22 = __toESM(require("react"));
|
|
7310
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
7311
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
7312
|
+
var loadingVariants = (0, import_class_variance_authority3.cva)(
|
|
7313
|
+
"rounded-full border-2 animate-spin border-muted border-t-primary",
|
|
7314
|
+
{
|
|
7315
|
+
variants: {
|
|
7316
|
+
size: {
|
|
7317
|
+
sm: "h-4 w-4",
|
|
7318
|
+
md: "h-6 w-6",
|
|
7319
|
+
lg: "h-8 w-8",
|
|
7320
|
+
xl: "h-12 w-12 border-[3px]"
|
|
7321
|
+
}
|
|
7322
|
+
},
|
|
7323
|
+
defaultVariants: {
|
|
7324
|
+
size: "md"
|
|
7325
|
+
}
|
|
7326
|
+
}
|
|
7327
|
+
);
|
|
7328
|
+
var dotsVariants = (0, import_class_variance_authority3.cva)(
|
|
7329
|
+
"flex items-center justify-center",
|
|
7330
|
+
{
|
|
7331
|
+
variants: {
|
|
7332
|
+
size: {
|
|
7333
|
+
sm: "gap-1",
|
|
7334
|
+
md: "gap-1.5",
|
|
7335
|
+
lg: "gap-2",
|
|
7336
|
+
xl: "gap-2.5"
|
|
7337
|
+
}
|
|
7338
|
+
},
|
|
7339
|
+
defaultVariants: {
|
|
7340
|
+
size: "md"
|
|
7341
|
+
}
|
|
7342
|
+
}
|
|
7343
|
+
);
|
|
7344
|
+
var dotVariants = (0, import_class_variance_authority3.cva)(
|
|
7345
|
+
"rounded-full bg-gradient-to-r from-primary to-primary/70 shadow-sm",
|
|
7346
|
+
{
|
|
7347
|
+
variants: {
|
|
7348
|
+
size: {
|
|
7349
|
+
sm: "h-1.5 w-2",
|
|
7350
|
+
md: "h-2.5 w-2.5",
|
|
7351
|
+
lg: "h-2.5 w-3",
|
|
7352
|
+
xl: "h-3.5 w-4"
|
|
7353
|
+
}
|
|
7354
|
+
},
|
|
7355
|
+
defaultVariants: {
|
|
7356
|
+
size: "md"
|
|
7357
|
+
}
|
|
7358
|
+
}
|
|
7359
|
+
);
|
|
7360
|
+
var LoadingBase = React22.forwardRef(
|
|
7361
|
+
({ className, size, message, overlay = false, variant = "spinner", ...props }, ref) => {
|
|
7362
|
+
React22.useEffect(() => {
|
|
7363
|
+
const style = document.createElement("style");
|
|
7364
|
+
style.textContent = `
|
|
7365
|
+
@keyframes dotBounce {
|
|
7366
|
+
0%, 80%, 100% {
|
|
7367
|
+
transform: translateY(0);
|
|
7368
|
+
opacity: 0.8;
|
|
7369
|
+
}
|
|
7370
|
+
40% {
|
|
7371
|
+
transform: translateY(-8px);
|
|
7372
|
+
opacity: 1;
|
|
7373
|
+
}
|
|
7374
|
+
}
|
|
7375
|
+
`;
|
|
7376
|
+
document.head.appendChild(style);
|
|
7377
|
+
return () => {
|
|
7378
|
+
if (document.head.contains(style)) {
|
|
7379
|
+
document.head.removeChild(style);
|
|
7380
|
+
}
|
|
7381
|
+
};
|
|
7382
|
+
}, []);
|
|
7383
|
+
const renderSpinner = () => {
|
|
7384
|
+
if (variant === "dots") {
|
|
7385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: cn(dotsVariants({ size })), "aria-hidden": "true", children: [
|
|
7386
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7387
|
+
"div",
|
|
7388
|
+
{
|
|
7389
|
+
className: cn(dotVariants({ size })),
|
|
7390
|
+
style: {
|
|
7391
|
+
animation: "dotBounce 1.4s ease-in-out infinite",
|
|
7392
|
+
animationDelay: "0ms",
|
|
7393
|
+
transform: "translateY(0px)"
|
|
7394
|
+
}
|
|
7395
|
+
}
|
|
7396
|
+
),
|
|
7397
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7398
|
+
"div",
|
|
7399
|
+
{
|
|
7400
|
+
className: cn(dotVariants({ size })),
|
|
7401
|
+
style: {
|
|
7402
|
+
animation: "dotBounce 1.4s ease-in-out infinite",
|
|
7403
|
+
animationDelay: "0.16s",
|
|
7404
|
+
transform: "translateY(0px)"
|
|
7405
|
+
}
|
|
7406
|
+
}
|
|
7407
|
+
),
|
|
7408
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7409
|
+
"div",
|
|
7410
|
+
{
|
|
7411
|
+
className: cn(dotVariants({ size })),
|
|
7412
|
+
style: {
|
|
7413
|
+
animation: "dotBounce 1.4s ease-in-out infinite",
|
|
7414
|
+
animationDelay: "0.32s",
|
|
7415
|
+
transform: "translateY(0px)"
|
|
7416
|
+
}
|
|
7417
|
+
}
|
|
7418
|
+
)
|
|
7419
|
+
] });
|
|
7420
|
+
}
|
|
7421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7422
|
+
"div",
|
|
7423
|
+
{
|
|
7424
|
+
className: cn(loadingVariants({ size })),
|
|
7425
|
+
style: {
|
|
7426
|
+
animation: "spin 1s linear infinite"
|
|
7427
|
+
},
|
|
7428
|
+
"aria-hidden": "true"
|
|
7429
|
+
}
|
|
7430
|
+
);
|
|
7431
|
+
};
|
|
7432
|
+
const loadingContent = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-col items-center gap-4", children: [
|
|
7433
|
+
renderSpinner(),
|
|
7434
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-sm font-medium text-muted-foreground animate-pulse", children: message })
|
|
7435
|
+
] });
|
|
7436
|
+
if (overlay) {
|
|
7437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7438
|
+
"div",
|
|
7439
|
+
{
|
|
7440
|
+
ref,
|
|
7441
|
+
className: cn(
|
|
7442
|
+
"fixed inset-0 z-50 flex items-center justify-center",
|
|
7443
|
+
"bg-background/80 dark:bg-background/60",
|
|
7444
|
+
"backdrop-blur-md backdrop-saturate-150",
|
|
7445
|
+
"transition-all duration-300 ease-in-out",
|
|
7446
|
+
"animate-in fade-in-0",
|
|
7447
|
+
className
|
|
7448
|
+
),
|
|
7449
|
+
role: "status",
|
|
7450
|
+
"aria-label": message || "Carregando",
|
|
7451
|
+
...props,
|
|
7452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: cn(
|
|
7453
|
+
"relative p-8 rounded-2xl",
|
|
7454
|
+
"bg-card/90 dark:bg-card/95",
|
|
7455
|
+
"border border-border/50",
|
|
7456
|
+
"shadow-2xl shadow-black/10 dark:shadow-black/30",
|
|
7457
|
+
"backdrop-blur-xl backdrop-saturate-150",
|
|
7458
|
+
"animate-in zoom-in-95 fade-in-0 duration-300",
|
|
7459
|
+
"text-center space-y-4"
|
|
7460
|
+
), children: loadingContent })
|
|
7461
|
+
}
|
|
7462
|
+
);
|
|
7463
|
+
}
|
|
7464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7465
|
+
"div",
|
|
7466
|
+
{
|
|
7467
|
+
ref,
|
|
7468
|
+
className: cn("flex items-center justify-center", className),
|
|
7469
|
+
role: "status",
|
|
7470
|
+
"aria-label": message || "Carregando",
|
|
7471
|
+
...props,
|
|
7472
|
+
children: loadingContent
|
|
7473
|
+
}
|
|
7474
|
+
);
|
|
7475
|
+
}
|
|
7476
|
+
);
|
|
7477
|
+
LoadingBase.displayName = "LoadingBase";
|
|
7478
|
+
|
|
7479
|
+
// src/components/ui/feedback/ModalBase.tsx
|
|
7480
|
+
var React23 = __toESM(require("react"));
|
|
7481
|
+
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"));
|
|
7482
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
7483
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
7484
|
+
var ModalBase = DialogPrimitive2.Root;
|
|
7485
|
+
var ModalTriggerBase = DialogPrimitive2.Trigger;
|
|
7486
|
+
var ModalPortalBase = DialogPrimitive2.Portal;
|
|
7487
|
+
var ModalCloseBase = DialogPrimitive2.Close;
|
|
7488
|
+
var ModalOverlayBase = React23.forwardRef(({ className, testid: dataTestId = "modal-overlay", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7489
|
+
DialogPrimitive2.Overlay,
|
|
7490
|
+
{
|
|
7491
|
+
ref,
|
|
7492
|
+
className: cn(
|
|
7493
|
+
"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",
|
|
7494
|
+
className
|
|
7495
|
+
),
|
|
7496
|
+
"data-testid": dataTestId,
|
|
7497
|
+
...props
|
|
7498
|
+
}
|
|
7499
|
+
));
|
|
7500
|
+
ModalOverlayBase.displayName = DialogPrimitive2.Overlay.displayName;
|
|
7501
|
+
var ModalContentBase = React23.forwardRef(
|
|
7502
|
+
({
|
|
7503
|
+
className,
|
|
7504
|
+
children,
|
|
7505
|
+
testid: dataTestId = "modal-content",
|
|
7506
|
+
size = "md",
|
|
7507
|
+
centered = true,
|
|
7508
|
+
backdropBlur = true,
|
|
7509
|
+
...props
|
|
7510
|
+
}, ref) => {
|
|
7511
|
+
const sizeClass = size === "sm" ? "max-w-md" : size === "lg" ? "max-w-4xl" : size === "full" ? "w-full max-w-[calc(100%-2rem)]" : "max-w-2xl";
|
|
7512
|
+
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";
|
|
7513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(ModalPortalBase, { children: [
|
|
7514
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7515
|
+
ModalOverlayBase,
|
|
7516
|
+
{
|
|
7517
|
+
className: cn("bg-black/40", backdropBlur ? "backdrop-blur-sm" : "")
|
|
7518
|
+
}
|
|
7519
|
+
),
|
|
7520
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7521
|
+
"style",
|
|
7522
|
+
{
|
|
7523
|
+
dangerouslySetInnerHTML: {
|
|
7524
|
+
__html: `
|
|
7525
|
+
@keyframes modal-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
7526
|
+
@keyframes modal-fade-out { from { opacity: 1 } to { opacity: 0 } }
|
|
7527
|
+
@keyframes modal-scale-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98) } to { opacity:1; transform: translate(-50%, -50%) scale(1) } }
|
|
7528
|
+
@keyframes modal-scale-out { from { opacity:1; transform: translate(-50%, -50%) scale(1) } to { opacity: 0; transform: translate(-50%, -48%) scale(.98) } }
|
|
7529
|
+
@keyframes overlay-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
7530
|
+
@keyframes overlay-fade-out { from { opacity: 1 } to { opacity: 0 } }
|
|
7531
|
+
.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 }
|
|
7532
|
+
.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 }
|
|
7533
|
+
.data-[state=open]\\:animate-overlay-in { animation: overlay-fade-in 220ms cubic-bezier(.16,.84,.24,1) both }
|
|
7534
|
+
.data-[state=closed]\\:animate-overlay-out { animation: overlay-fade-out 160ms cubic-bezier(.16,.84,.24,1) both }
|
|
7535
|
+
`
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7538
|
+
),
|
|
7539
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
7540
|
+
DialogPrimitive2.Content,
|
|
7541
|
+
{
|
|
7542
|
+
ref,
|
|
7543
|
+
className: cn(
|
|
7544
|
+
"fixed z-50 grid w-full gap-4 border bg-background p-6 shadow-lg sm:rounded-lg max-h-[90dvh] overflow-auto",
|
|
7545
|
+
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out",
|
|
7546
|
+
positionClass,
|
|
7547
|
+
sizeClass,
|
|
7548
|
+
className
|
|
7549
|
+
),
|
|
7550
|
+
"data-testid": dataTestId,
|
|
7551
|
+
...props,
|
|
7552
|
+
children: [
|
|
7553
|
+
children,
|
|
7554
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.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: [
|
|
7555
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react26.XIcon, { className: "h-5 w-5 sm:h-4 sm:w-4 text-foreground" }),
|
|
7556
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "sr-only", children: "Close" })
|
|
7557
|
+
] })
|
|
7558
|
+
]
|
|
7559
|
+
}
|
|
7560
|
+
)
|
|
7561
|
+
] });
|
|
7562
|
+
}
|
|
7563
|
+
);
|
|
7564
|
+
ModalContentBase.displayName = DialogPrimitive2.Content.displayName;
|
|
7565
|
+
var ModalHeaderBase = React23.forwardRef(({ className, testid: dataTestId = "modal-header", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7566
|
+
"div",
|
|
7567
|
+
{
|
|
7568
|
+
ref,
|
|
7569
|
+
className: cn(
|
|
7570
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
7571
|
+
className
|
|
7572
|
+
),
|
|
7573
|
+
"data-testid": dataTestId,
|
|
7574
|
+
...props
|
|
7575
|
+
}
|
|
7576
|
+
));
|
|
7577
|
+
ModalHeaderBase.displayName = "ModalHeader";
|
|
7578
|
+
var ModalFooterBase = React23.forwardRef(({ className, testid: dataTestId = "modal-footer", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7579
|
+
"div",
|
|
7580
|
+
{
|
|
7581
|
+
ref,
|
|
7582
|
+
className: cn(
|
|
7583
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
7584
|
+
className
|
|
7585
|
+
),
|
|
7586
|
+
"data-testid": dataTestId,
|
|
7587
|
+
...props
|
|
7588
|
+
}
|
|
7589
|
+
));
|
|
7590
|
+
ModalFooterBase.displayName = "ModalFooter";
|
|
7591
|
+
var ModalTitleBase = React23.forwardRef(({ className, testid: dataTestId = "modal-title", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7592
|
+
DialogPrimitive2.Title,
|
|
7593
|
+
{
|
|
7594
|
+
ref,
|
|
7595
|
+
className: cn(
|
|
7596
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
7597
|
+
className
|
|
7598
|
+
),
|
|
7599
|
+
"data-testid": dataTestId,
|
|
7600
|
+
...props
|
|
7601
|
+
}
|
|
7602
|
+
));
|
|
7603
|
+
ModalTitleBase.displayName = DialogPrimitive2.Title.displayName;
|
|
7604
|
+
var ModalDescriptionBase = React23.forwardRef(({ className, testid: dataTestId = "modal-description", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7605
|
+
DialogPrimitive2.Description,
|
|
7606
|
+
{
|
|
7607
|
+
ref,
|
|
7608
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
7609
|
+
"data-testid": dataTestId,
|
|
7610
|
+
...props
|
|
7611
|
+
}
|
|
7612
|
+
));
|
|
7613
|
+
ModalDescriptionBase.displayName = DialogPrimitive2.Description.displayName;
|
|
7614
|
+
|
|
7615
|
+
// src/components/ui/feedback/ProgressBase.tsx
|
|
7616
|
+
var React24 = __toESM(require("react"));
|
|
7617
|
+
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
7618
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7619
|
+
var ProgressBase = React24.forwardRef(
|
|
7620
|
+
({
|
|
7621
|
+
className,
|
|
7622
|
+
value: rawValue,
|
|
7623
|
+
label,
|
|
7624
|
+
leftIcon,
|
|
7625
|
+
rightIcon,
|
|
7626
|
+
variant = "bar",
|
|
7627
|
+
segments = 5,
|
|
7628
|
+
steps = [],
|
|
7629
|
+
currentStep = 0,
|
|
7630
|
+
showValue = false,
|
|
7631
|
+
valuePosition = "right",
|
|
7632
|
+
autocolor,
|
|
7633
|
+
plusIndicator,
|
|
7634
|
+
...props
|
|
7635
|
+
}, ref) => {
|
|
7636
|
+
const value = Number(rawValue || 0);
|
|
7637
|
+
const indicatorWidth = Math.min(value, 100);
|
|
7638
|
+
switch (variant) {
|
|
7639
|
+
case "segments":
|
|
7640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7641
|
+
ProgressSegmentsBase,
|
|
7642
|
+
{
|
|
7643
|
+
label,
|
|
7644
|
+
segments,
|
|
7645
|
+
value: value || 0
|
|
7646
|
+
}
|
|
7647
|
+
);
|
|
7648
|
+
case "panels":
|
|
7649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7650
|
+
ProgressPanelsBase,
|
|
7651
|
+
{
|
|
7652
|
+
label,
|
|
7653
|
+
steps,
|
|
7654
|
+
currentStep
|
|
7655
|
+
}
|
|
7656
|
+
);
|
|
7657
|
+
case "circles":
|
|
7658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7659
|
+
ProgressCirclesBase,
|
|
7660
|
+
{
|
|
7661
|
+
label,
|
|
7662
|
+
steps,
|
|
7663
|
+
currentStep
|
|
7664
|
+
}
|
|
7665
|
+
);
|
|
7666
|
+
case "bar":
|
|
7667
|
+
default:
|
|
7668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
7669
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(LabelBase_default, { className: "py-2", children: label }),
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7671
|
+
showValue && valuePosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-12 text-sm text-right font-extrabold", children: [
|
|
7672
|
+
Math.round(value || 0),
|
|
7673
|
+
"%"
|
|
7674
|
+
] }),
|
|
7675
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
|
|
7676
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7677
|
+
ProgressPrimitive.Root,
|
|
7678
|
+
{
|
|
7679
|
+
ref,
|
|
7680
|
+
className: cn(
|
|
7681
|
+
" relative h-3 w-full overflow-visible rounded-full bg-muted/80 shadow-inner transition-all ",
|
|
7682
|
+
className
|
|
7683
|
+
),
|
|
7684
|
+
value,
|
|
7685
|
+
...props,
|
|
7686
|
+
children: [
|
|
7687
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7688
|
+
ProgressPrimitive.Indicator,
|
|
7689
|
+
{
|
|
7690
|
+
className: cn(
|
|
7691
|
+
"h-full transition-all duration-500 ease-in-out rounded-lg",
|
|
7692
|
+
// quando não usa autocolor, Indicator deve mostrar a cor primária
|
|
7693
|
+
autocolor && autocolor.length >= 2 ? "bg-transparent" : "bg-primary"
|
|
7694
|
+
),
|
|
7695
|
+
style: { width: `${indicatorWidth}%` }
|
|
7696
|
+
}
|
|
7697
|
+
),
|
|
7698
|
+
autocolor && Array.isArray(autocolor) && autocolor.length >= 2 && (() => {
|
|
7699
|
+
const [t1Raw, t2Raw] = autocolor;
|
|
7700
|
+
const [t1, t2] = [Number(t1Raw), Number(t2Raw)].sort(
|
|
7701
|
+
(a, b) => a - b
|
|
7702
|
+
);
|
|
7703
|
+
const v = Number(value || 0);
|
|
7704
|
+
let colorClass = "bg-red-500";
|
|
7705
|
+
if (v <= t1) {
|
|
7706
|
+
colorClass = "bg-red-500";
|
|
7707
|
+
} else if (v <= t2) {
|
|
7708
|
+
colorClass = "bg-yellow-500";
|
|
7709
|
+
} else {
|
|
7710
|
+
colorClass = "bg-emerald-500";
|
|
7711
|
+
}
|
|
7712
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7713
|
+
"div",
|
|
7714
|
+
{
|
|
7715
|
+
"aria-hidden": true,
|
|
7716
|
+
className: cn(
|
|
7717
|
+
"absolute top-0 left-0 h-full transition-all duration-500 ease-in-out rounded-lg",
|
|
7718
|
+
colorClass
|
|
7719
|
+
),
|
|
7720
|
+
style: { width: `${indicatorWidth}%` }
|
|
7721
|
+
}
|
|
7722
|
+
);
|
|
7723
|
+
})(),
|
|
7724
|
+
plusIndicator && value > 100 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7725
|
+
"div",
|
|
7726
|
+
{
|
|
7727
|
+
"aria-hidden": "true",
|
|
7728
|
+
className: "absolute top-0 bottom-0 w-0.5 bg-black/70 transition-all duration-500 ease-in-out pointer-events-none",
|
|
7729
|
+
style: { left: `100%` },
|
|
7730
|
+
children: value > 115 && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "absolute left-full ml-2 top-1/2 -translate-y-1/2 text-xs whitespace-nowrap font-extrabold", children: `+${Math.round(
|
|
7731
|
+
value - 100
|
|
7732
|
+
)}%` })
|
|
7733
|
+
}
|
|
7734
|
+
),
|
|
7735
|
+
showValue && valuePosition === "inside" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7736
|
+
"span",
|
|
7737
|
+
{
|
|
7738
|
+
className: "absolute inset-0 flex items-center justify-center text-sm select-none pointer-events-none text-secondary font-extrabold",
|
|
7739
|
+
"aria-hidden": true,
|
|
7740
|
+
children: [
|
|
7741
|
+
Math.round(value || 0),
|
|
7742
|
+
"%"
|
|
7743
|
+
]
|
|
7744
|
+
}
|
|
7745
|
+
)
|
|
7746
|
+
]
|
|
7747
|
+
}
|
|
7748
|
+
),
|
|
7749
|
+
showValue && valuePosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-12 text-sm font-extrabold text-left", children: [
|
|
7750
|
+
Math.round(value || 0),
|
|
7751
|
+
"%"
|
|
7752
|
+
] }),
|
|
7753
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
|
|
7754
|
+
] })
|
|
7755
|
+
] });
|
|
7756
|
+
}
|
|
7757
|
+
}
|
|
7758
|
+
);
|
|
7759
|
+
ProgressBase.displayName = "ProgressBase";
|
|
7760
|
+
var ProgressSegmentsBase = ({
|
|
7761
|
+
label,
|
|
7762
|
+
segments,
|
|
7763
|
+
value
|
|
7764
|
+
}) => {
|
|
7765
|
+
const filled = Math.round(value / 100 * segments);
|
|
7766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
|
|
7767
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(LabelBase_default, { className: "py-2", children: label }),
|
|
7768
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex gap-1 w-full", children: Array.from({ length: segments }).map((_, idx) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7769
|
+
"div",
|
|
7770
|
+
{
|
|
7771
|
+
className: cn(
|
|
7772
|
+
"h-2 flex-1 rounded-full transition-all duration-300",
|
|
7773
|
+
idx < filled ? "bg-primary" : "bg-zinc-300 hover:bg-zinc-400"
|
|
7774
|
+
)
|
|
7775
|
+
},
|
|
7776
|
+
idx
|
|
7777
|
+
)) })
|
|
7778
|
+
] });
|
|
7779
|
+
};
|
|
7780
|
+
var ArrowRightIcon = () => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7781
|
+
"svg",
|
|
7782
|
+
{
|
|
7783
|
+
className: "w-6 h-6 text-zinc-400 transition-transform duration-300 group-hover:translate-x-1",
|
|
7784
|
+
fill: "none",
|
|
7785
|
+
stroke: "currentColor",
|
|
7786
|
+
strokeWidth: 2,
|
|
7787
|
+
viewBox: "0 0 24 24",
|
|
7788
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
7790
|
+
}
|
|
7791
|
+
);
|
|
7792
|
+
var ProgressPanelsBase = ({
|
|
7793
|
+
label,
|
|
7794
|
+
steps,
|
|
7795
|
+
currentStep
|
|
7796
|
+
}) => {
|
|
7797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-1 w-full", children: [
|
|
7798
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(LabelBase_default, { className: "py-2", children: label }),
|
|
7799
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex w-full gap-1 rounded-lg overflow-hidden", children: steps.map((step, idx) => {
|
|
7800
|
+
const isActive = idx === currentStep;
|
|
7801
|
+
const isLast = idx === steps.length - 1;
|
|
7802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(React24.Fragment, { children: [
|
|
7803
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7804
|
+
"div",
|
|
7805
|
+
{
|
|
7806
|
+
className: cn(
|
|
7807
|
+
"relative flex items-center justify-center cursor-pointer select-none rounded-lg border transition-shadow duration-300 ease-in-out",
|
|
7808
|
+
"hover:shadow-md hover:z-10",
|
|
7809
|
+
"aspect-[5/1] min-w-[90px] px-4",
|
|
7810
|
+
isActive ? "bg-primary/20 border-2 border-primary shadow-lg font-semibold" : "border-zinc-300"
|
|
7811
|
+
),
|
|
7812
|
+
style: { flex: "1 1 0" },
|
|
7813
|
+
children: [
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "truncate", children: step }),
|
|
7815
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "absolute bottom-0 left-0 h-1 w-full animate-pulse rounded-b-lg" })
|
|
7816
|
+
]
|
|
7817
|
+
}
|
|
7818
|
+
),
|
|
7819
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex items-center px-2 group", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ArrowRightIcon, {}) })
|
|
7820
|
+
] }, idx);
|
|
7821
|
+
}) })
|
|
7822
|
+
] });
|
|
7823
|
+
};
|
|
7824
|
+
var ProgressCirclesBase = ({
|
|
7825
|
+
label,
|
|
7826
|
+
steps,
|
|
7827
|
+
currentStep
|
|
7828
|
+
}) => {
|
|
7829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-2 w-full", children: [
|
|
7830
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { className: "py-2 text-base font-semibold text-gray-700 dark:text-gray-300", children: label }),
|
|
7831
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative flex items-center justify-between w-full", children: [
|
|
7832
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "absolute top-5 left-0 w-full h-1 bg-zinc-200 dark:bg-zinc-700" }),
|
|
7833
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7834
|
+
"div",
|
|
7835
|
+
{
|
|
7836
|
+
className: "absolute top-5 left-0 h-1 bg-primary transition-all duration-300",
|
|
7837
|
+
style: {
|
|
7838
|
+
width: `${currentStep / (steps.length - 1) * 100}%`
|
|
7839
|
+
}
|
|
7840
|
+
}
|
|
7841
|
+
),
|
|
7842
|
+
steps.map((step, idx) => {
|
|
7843
|
+
const isActive = idx <= currentStep;
|
|
7844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
7845
|
+
"div",
|
|
7846
|
+
{
|
|
7847
|
+
className: "relative flex flex-col items-center w-10",
|
|
7848
|
+
style: { zIndex: isActive ? 10 : 1 },
|
|
7849
|
+
children: [
|
|
7850
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7851
|
+
"div",
|
|
7852
|
+
{
|
|
7853
|
+
className: cn(
|
|
7854
|
+
"w-10 h-10 rounded-full flex items-center justify-center font-bold text-sm transition-all duration-300 cursor-pointer select-none",
|
|
7855
|
+
isActive ? "bg-primary text-white dark:text-black shadow-md" : "bg-zinc-200 text-zinc-500 hover:bg-zinc-300 dark:bg-zinc-500 dark:text-black"
|
|
7856
|
+
),
|
|
7857
|
+
children: idx + 1
|
|
7858
|
+
}
|
|
7859
|
+
),
|
|
7860
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "text-xs text-center font-medium mt-1 max-w-[80px] break-words", children: step })
|
|
7861
|
+
]
|
|
7862
|
+
},
|
|
7863
|
+
idx
|
|
7864
|
+
);
|
|
7865
|
+
})
|
|
7866
|
+
] })
|
|
7867
|
+
] });
|
|
7868
|
+
};
|
|
7869
|
+
|
|
7870
|
+
// src/components/ui/feedback/SkeletonBase.tsx
|
|
7871
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7872
|
+
function SkeletonBase({
|
|
7873
|
+
className,
|
|
7874
|
+
...props
|
|
7875
|
+
}) {
|
|
7876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: cn("animate-pulse bg-primary/10", className), ...props });
|
|
7877
|
+
}
|
|
7878
|
+
|
|
7879
|
+
// src/components/ui/feedback/SonnerBase.tsx
|
|
7880
|
+
var import_react27 = require("@phosphor-icons/react");
|
|
7881
|
+
var import_sonner2 = require("sonner");
|
|
7882
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7883
|
+
var iconBaseClass = "w-5 h-auto";
|
|
7884
|
+
var Toaster = ({ testId, ...props }) => {
|
|
7885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7886
|
+
import_sonner2.Toaster,
|
|
7887
|
+
{
|
|
7888
|
+
className: "toaster group",
|
|
7889
|
+
position: "top-center",
|
|
7890
|
+
toastOptions: {
|
|
7891
|
+
classNames: {
|
|
7892
|
+
toast: `
|
|
7893
|
+
group toast
|
|
7894
|
+
bg-background
|
|
7895
|
+
text-foreground
|
|
7896
|
+
shadow-lg rounded-md
|
|
7897
|
+
border-l-4
|
|
7898
|
+
border-border
|
|
7899
|
+
flex items-center gap-3
|
|
7900
|
+
data-[type=success]:border-l-green-500 data-[type=success]:bg-green-50 data-[type=success]:text-green-800 data-[type=success]:border-green-500
|
|
7901
|
+
data-[type=error]:border-l-red-500 data-[type=error]:bg-red-50 data-[type=error]:text-red-800 data-[type=error]:border-red-500
|
|
7902
|
+
data-[type=WarningIcon]:border-l-yellow-500 data-[type=WarningIcon]:bg-yellow-50 data-[type=WarningIcon]:text-yellow-800 data-[type=WarningIcon]:border-yellow-500
|
|
7903
|
+
data-[type=InfoIcon]:border-l-blue-500 data-[type=InfoIcon]:bg-blue-50 data-[type=InfoIcon]:text-blue-800 data-[type=InfoIcon]:border-blue-500
|
|
7904
|
+
`,
|
|
7905
|
+
description: `
|
|
7906
|
+
text-sm
|
|
7907
|
+
group-[.toast]:text-neutral-600
|
|
7908
|
+
`,
|
|
7909
|
+
actionButton: `
|
|
7910
|
+
ml-auto
|
|
7911
|
+
rounded-md px-3 py-1 text-sm font-semibold
|
|
7912
|
+
bg-neutral-800 text-white
|
|
7913
|
+
hover:bg-neutral-700
|
|
7914
|
+
transition-colors duration-200
|
|
7915
|
+
`,
|
|
7916
|
+
cancelButton: `
|
|
7917
|
+
ml-2
|
|
7918
|
+
rounded-md px-3 py-1 text-sm font-semibold
|
|
7919
|
+
bg-neutral-100 text-neutral-700
|
|
7920
|
+
hover:bg-neutral-200
|
|
7921
|
+
transition-colors duration-200
|
|
7922
|
+
`
|
|
7923
|
+
}
|
|
7924
|
+
},
|
|
7925
|
+
"data-testid": testId,
|
|
7926
|
+
...props
|
|
7927
|
+
}
|
|
7928
|
+
);
|
|
7929
|
+
};
|
|
7930
|
+
var toast2 = {
|
|
7931
|
+
success: (message) => import_sonner2.toast.success(message, {
|
|
7932
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react27.CheckCircleIcon, { className: `${iconBaseClass} text-green-600`, weight: "fill" }),
|
|
7933
|
+
className: "sonner-success"
|
|
7934
|
+
}),
|
|
7935
|
+
error: (message) => import_sonner2.toast.error(message, {
|
|
7936
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react27.XCircleIcon, { className: `${iconBaseClass} text-red-600`, weight: "fill" }),
|
|
7937
|
+
className: "sonner-error"
|
|
7938
|
+
}),
|
|
7939
|
+
warning: (message) => import_sonner2.toast.warning(message, {
|
|
7940
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react27.WarningIcon, { className: `${iconBaseClass} text-yellow-600`, weight: "fill" }),
|
|
7941
|
+
className: "sonner-WarningIcon"
|
|
7942
|
+
}),
|
|
7943
|
+
info: (message) => import_sonner2.toast.info(message, {
|
|
7944
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react27.InfoIcon, { className: `${iconBaseClass} text-blue-600`, weight: "fill" }),
|
|
7945
|
+
className: "sonner-InfoIcon"
|
|
7946
|
+
}),
|
|
7947
|
+
loading: (message) => (0, import_sonner2.toast)(message, {
|
|
7948
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react27.SpinnerIcon, { className: `${iconBaseClass} animate-spin text-neutral-500`, weight: "fill" }),
|
|
7949
|
+
className: "sonner-loading"
|
|
7950
|
+
})
|
|
7951
|
+
};
|
|
7952
|
+
|
|
7953
|
+
// src/components/ui/form/CheckBoxBase.tsx
|
|
7954
|
+
var React25 = __toESM(require("react"));
|
|
7955
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
7956
|
+
var import_react28 = require("@phosphor-icons/react");
|
|
7957
|
+
var import_framer_motion11 = require("framer-motion");
|
|
7958
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7959
|
+
var CheckboxBase = React25.forwardRef(({ className, testid: dataTestId = "checkbox-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7960
|
+
CheckboxPrimitive.Root,
|
|
7961
|
+
{
|
|
7962
|
+
ref,
|
|
7963
|
+
className: cn(
|
|
7964
|
+
"peer h-4 w-4 shrink-0 rounded-md border border-primary shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground transition-colors",
|
|
7965
|
+
className
|
|
7966
|
+
),
|
|
7967
|
+
"data-testid": dataTestId,
|
|
7968
|
+
...props,
|
|
7969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7970
|
+
import_framer_motion11.motion.div,
|
|
7971
|
+
{
|
|
7972
|
+
initial: { scale: 0, opacity: 0, rotate: -90 },
|
|
7973
|
+
animate: { scale: 1, opacity: 1, rotate: 0 },
|
|
7974
|
+
exit: { scale: 0, opacity: 0, rotate: 90 },
|
|
7975
|
+
transition: { type: "spring", stiffness: 500, damping: 30 },
|
|
7976
|
+
className: "flex items-center justify-center text-current",
|
|
7977
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react28.CheckIcon, { className: "h-4 w-4", weight: "bold" })
|
|
7978
|
+
}
|
|
7979
|
+
) })
|
|
7980
|
+
}
|
|
7981
|
+
));
|
|
7982
|
+
CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
|
|
7983
|
+
|
|
7984
|
+
// src/components/ui/form/CollapsibleBase.tsx
|
|
7985
|
+
var React26 = __toESM(require("react"));
|
|
7986
|
+
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
7987
|
+
var import_react29 = require("@phosphor-icons/react");
|
|
7988
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7989
|
+
var CollapsibleBase = React26.forwardRef(({ ...props }, ref) => {
|
|
7990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CollapsiblePrimitive.Root, { ref, "data-slot": "collapsible", ...props });
|
|
7991
|
+
});
|
|
7992
|
+
CollapsibleBase.displayName = CollapsiblePrimitive.Root.displayName;
|
|
7993
|
+
var CollapsibleTriggerBase = React26.forwardRef(({ className, children, leftIcon, showCaret = true, ...props }, ref) => {
|
|
7994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
7995
|
+
CollapsiblePrimitive.CollapsibleTrigger,
|
|
7996
|
+
{
|
|
7997
|
+
ref,
|
|
7998
|
+
className: cn(
|
|
7999
|
+
"flex w-full items-center justify-between p-3 text-left font-medium transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] hover:bg-accent hover:text-accent-foreground rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [&[data-state=open]_.caret-icon]:rotate-180",
|
|
8000
|
+
className
|
|
8001
|
+
),
|
|
8002
|
+
"data-slot": "collapsible-trigger",
|
|
8003
|
+
...props,
|
|
8004
|
+
children: [
|
|
8005
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8006
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "flex-shrink-0 [&>svg]:size-4", children: leftIcon }),
|
|
8007
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children })
|
|
8008
|
+
] }),
|
|
8009
|
+
showCaret && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "caret-icon flex-shrink-0 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react29.CaretUpDownIcon, { className: "h-4 w-4" }) })
|
|
8010
|
+
]
|
|
8011
|
+
}
|
|
8012
|
+
);
|
|
8013
|
+
});
|
|
8014
|
+
CollapsibleTriggerBase.displayName = CollapsiblePrimitive.CollapsibleTrigger.displayName;
|
|
8015
|
+
var CollapsibleContentBase = React26.forwardRef(({ className, children, ...props }, ref) => {
|
|
8016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
8017
|
+
CollapsiblePrimitive.CollapsibleContent,
|
|
8018
|
+
{
|
|
8019
|
+
ref,
|
|
8020
|
+
className: cn(
|
|
8021
|
+
"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
8022
|
+
className
|
|
8023
|
+
),
|
|
8024
|
+
"data-slot": "collapsible-content",
|
|
8025
|
+
...props,
|
|
8026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "pb-3 pt-1", children })
|
|
8027
|
+
}
|
|
8028
|
+
);
|
|
8029
|
+
});
|
|
8030
|
+
CollapsibleContentBase.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
8031
|
+
|
|
8032
|
+
// src/components/ui/form/DebounceInput.tsx
|
|
8033
|
+
var import_react30 = require("react");
|
|
8034
|
+
var import_react31 = require("@phosphor-icons/react");
|
|
8035
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
8036
|
+
|
|
8037
|
+
// src/components/ui/form/HoverCardBase.tsx
|
|
8038
|
+
var HoverCardPrimitive = __toESM(require("@radix-ui/react-hover-card"));
|
|
8039
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
8040
|
+
function HoverCardBase(props) {
|
|
8041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HoverCardPrimitive.Root, { ...props });
|
|
8042
|
+
}
|
|
8043
|
+
function HoverCardTriggerBase(props) {
|
|
8044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HoverCardPrimitive.Trigger, { ...props });
|
|
8045
|
+
}
|
|
8046
|
+
function HoverCardContentBase({
|
|
8047
|
+
className,
|
|
8048
|
+
align = "center",
|
|
8049
|
+
sideOffset = 4,
|
|
8050
|
+
...props
|
|
8051
|
+
}) {
|
|
8052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
8053
|
+
HoverCardPrimitive.Content,
|
|
8054
|
+
{
|
|
8055
|
+
align,
|
|
8056
|
+
sideOffset,
|
|
8057
|
+
className: cn(
|
|
8058
|
+
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
8059
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
8060
|
+
"data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
|
|
8061
|
+
"data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95",
|
|
8062
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
8063
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
8064
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
8065
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
8066
|
+
className
|
|
8067
|
+
),
|
|
8068
|
+
...props
|
|
8069
|
+
}
|
|
8070
|
+
) });
|
|
8071
|
+
}
|
|
8072
|
+
|
|
8073
|
+
// src/components/ui/form/Input-OTP-Base.tsx
|
|
8074
|
+
var React27 = __toESM(require("react"));
|
|
8075
|
+
var import_input_otp = require("input-otp");
|
|
8076
|
+
var import_react32 = require("@phosphor-icons/react");
|
|
8077
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
8078
|
+
function InputOTPBase({
|
|
8079
|
+
className,
|
|
8080
|
+
containerClassName,
|
|
8081
|
+
...props
|
|
8082
|
+
}) {
|
|
8083
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8084
|
+
import_input_otp.OTPInput,
|
|
8085
|
+
{
|
|
8086
|
+
"data-slot": "input-otp",
|
|
8087
|
+
containerClassName: cn(
|
|
8088
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
8089
|
+
containerClassName
|
|
8090
|
+
),
|
|
8091
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
8092
|
+
...props
|
|
8093
|
+
}
|
|
8094
|
+
);
|
|
8095
|
+
}
|
|
8096
|
+
function InputOTPGroupBase({ className, ...props }) {
|
|
8097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
8098
|
+
"div",
|
|
8099
|
+
{
|
|
8100
|
+
"data-slot": "input-otp-group",
|
|
8101
|
+
className: cn("flex items-center", className),
|
|
8102
|
+
...props
|
|
8103
|
+
}
|
|
8104
|
+
);
|
|
8105
|
+
}
|
|
8106
|
+
function InputOTPSlotBase({
|
|
8107
|
+
index,
|
|
8108
|
+
className,
|
|
8109
|
+
...props
|
|
8110
|
+
}) {
|
|
8111
|
+
const inputOTPContext = React27.useContext(import_input_otp.OTPInputContext);
|
|
8112
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
8113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
8114
|
+
"div",
|
|
8115
|
+
{
|
|
8116
|
+
"data-slot": "input-otp-slot",
|
|
8117
|
+
"data-active": isActive,
|
|
8118
|
+
className: cn(
|
|
8119
|
+
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
8120
|
+
className
|
|
8121
|
+
),
|
|
8122
|
+
...props,
|
|
8123
|
+
children: [
|
|
8124
|
+
char,
|
|
8125
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
8126
|
+
]
|
|
8127
|
+
}
|
|
8128
|
+
);
|
|
8129
|
+
}
|
|
8130
|
+
function InputOTPSeparatorBase({ ...props }) {
|
|
8131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react32.MinusIcon, {}) });
|
|
8132
|
+
}
|
|
8133
|
+
|
|
8134
|
+
// src/components/ui/form/SliderBase.tsx
|
|
8135
|
+
var React28 = __toESM(require("react"));
|
|
8136
|
+
var SliderPrimitive = __toESM(require("@radix-ui/react-slider"));
|
|
8137
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
8138
|
+
var SlideBase = React28.forwardRef(
|
|
8139
|
+
({
|
|
8140
|
+
className,
|
|
8141
|
+
orientation = "horizontal",
|
|
8142
|
+
label,
|
|
8143
|
+
leftIcon,
|
|
8144
|
+
rightIcon,
|
|
8145
|
+
...props
|
|
8146
|
+
}, ref) => {
|
|
8147
|
+
const isVertical = orientation === "vertical";
|
|
8148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8149
|
+
"div",
|
|
8150
|
+
{
|
|
8151
|
+
className: cn("flex flex-col gap-1", isVertical ? "h-full " : "w-full"),
|
|
8152
|
+
children: [
|
|
8153
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(LabelBase_default, { className: "py-2", children: label }),
|
|
8154
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8155
|
+
"div",
|
|
8156
|
+
{
|
|
8157
|
+
className: cn(
|
|
8158
|
+
"flex gap-2",
|
|
8159
|
+
isVertical ? "flex-col h-full" : "flex-row items-center w-full"
|
|
8160
|
+
),
|
|
8161
|
+
children: [
|
|
8162
|
+
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-center justify-center", children: leftIcon }),
|
|
8163
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
8164
|
+
SliderPrimitive.Root,
|
|
8165
|
+
{
|
|
8166
|
+
ref,
|
|
8167
|
+
orientation,
|
|
8168
|
+
className: cn(
|
|
8169
|
+
"relative flex touch-none select-none items-center",
|
|
8170
|
+
isVertical ? "flex-col h-full" : "flex-row w-full",
|
|
8171
|
+
className
|
|
8172
|
+
),
|
|
8173
|
+
...props,
|
|
8174
|
+
children: [
|
|
8175
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8176
|
+
SliderPrimitive.Track,
|
|
8177
|
+
{
|
|
8178
|
+
className: cn(
|
|
8179
|
+
"relative overflow-hidden bg-primary/20 rounded-full",
|
|
8180
|
+
isVertical ? "w-1.5 h-full" : "h-1.5 w-full"
|
|
8181
|
+
),
|
|
8182
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8183
|
+
SliderPrimitive.Range,
|
|
8184
|
+
{
|
|
8185
|
+
className: cn(
|
|
8186
|
+
"absolute bg-primary",
|
|
8187
|
+
isVertical ? "w-full" : "h-full"
|
|
8188
|
+
)
|
|
8189
|
+
}
|
|
8190
|
+
)
|
|
8191
|
+
}
|
|
8192
|
+
),
|
|
8193
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
8194
|
+
SliderPrimitive.Thumb,
|
|
8195
|
+
{
|
|
8196
|
+
className: cn(
|
|
8197
|
+
"block h-4 w-4 rounded-full border border-primary/70 bg-background shadow-md transition-transform",
|
|
8198
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
8199
|
+
"hover:scale-125 active:scale-125"
|
|
8200
|
+
)
|
|
8201
|
+
}
|
|
8202
|
+
)
|
|
8203
|
+
]
|
|
8204
|
+
}
|
|
8205
|
+
),
|
|
8206
|
+
rightIcon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex items-center justify-center", children: rightIcon })
|
|
8207
|
+
]
|
|
8208
|
+
}
|
|
8209
|
+
)
|
|
8210
|
+
]
|
|
8211
|
+
}
|
|
8212
|
+
);
|
|
8213
|
+
}
|
|
8214
|
+
);
|
|
8215
|
+
SlideBase.displayName = "SlideBase";
|
|
8216
|
+
|
|
8217
|
+
// src/components/ui/form/SwitchBase.tsx
|
|
8218
|
+
var React29 = __toESM(require("react"));
|
|
8219
|
+
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"));
|
|
8220
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
8221
|
+
var SwitchBase = React29.forwardRef(({ className, testid: dataTestId = "switch-base", ...props }, ref) => {
|
|
8222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8223
|
+
SwitchPrimitives.Root,
|
|
8224
|
+
{
|
|
8225
|
+
...props,
|
|
8226
|
+
ref,
|
|
8227
|
+
className: cn(
|
|
8228
|
+
"peer relative inline-flex w-12 cursor-pointer items-center rounded-full border-2 border-transparent shadow-md transition-colors duration-300 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input data-[state=checked]:shadow-[0_0_15px_4px_var(--tw-shadow-color)] data-[state=checked]:shadow-primary/30",
|
|
8229
|
+
className
|
|
8230
|
+
),
|
|
8231
|
+
"data-testid": dataTestId,
|
|
8232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
8233
|
+
SwitchPrimitives.Thumb,
|
|
8234
|
+
{
|
|
8235
|
+
className: cn(
|
|
8236
|
+
"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-xl ring-0 transition-transform duration-350 ease-out peer-focus:shadow-lg peer-focus:ring-2 peer-focus:ring-primary/70 data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-7 data-[state=checked]:animate-bounce-thumb"
|
|
8237
|
+
),
|
|
8238
|
+
style: {
|
|
8239
|
+
transformOrigin: "center",
|
|
8240
|
+
transition: "transform 350ms cubic-bezier(0.68, -0.55, 0.265, 1.55)"
|
|
8241
|
+
}
|
|
8242
|
+
}
|
|
8243
|
+
)
|
|
8244
|
+
}
|
|
8245
|
+
);
|
|
8246
|
+
});
|
|
8247
|
+
SwitchBase.displayName = SwitchPrimitives.Root.displayName;
|
|
8248
|
+
|
|
8249
|
+
// src/components/ui/form/TextAreaBase.tsx
|
|
8250
|
+
var React30 = __toESM(require("react"));
|
|
8251
|
+
var import_framer_motion12 = require("framer-motion");
|
|
8252
|
+
var import_react33 = require("@phosphor-icons/react");
|
|
8253
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
8254
|
+
var TextAreaBase = React30.forwardRef(
|
|
8255
|
+
({ className, clearable = false, onClear, ...props }, ref) => {
|
|
8256
|
+
const [isFocused, setIsFocused] = React30.useState(false);
|
|
8257
|
+
const [hasContent, setHasContent] = React30.useState(
|
|
8258
|
+
!!props.value || !!props.defaultValue
|
|
8259
|
+
);
|
|
8260
|
+
const [showConfirmTooltip, setShowConfirmTooltip] = React30.useState(false);
|
|
8261
|
+
const textareaRef = React30.useRef(null);
|
|
8262
|
+
const handleFocus = (e) => {
|
|
8263
|
+
setIsFocused(true);
|
|
8264
|
+
props.onFocus?.(e);
|
|
8265
|
+
};
|
|
8266
|
+
const handleBlur = (e) => {
|
|
8267
|
+
setIsFocused(false);
|
|
8268
|
+
props.onBlur?.(e);
|
|
8269
|
+
};
|
|
8270
|
+
const handleChange = (e) => {
|
|
8271
|
+
setHasContent(e.target.value.length > 0);
|
|
8272
|
+
props.onChange?.(e);
|
|
8273
|
+
};
|
|
8274
|
+
const handleClearClick = () => {
|
|
8275
|
+
setShowConfirmTooltip(true);
|
|
8276
|
+
};
|
|
8277
|
+
const handleConfirmClear = () => {
|
|
8278
|
+
if (textareaRef.current) {
|
|
8279
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
|
|
8280
|
+
window.HTMLTextAreaElement.prototype,
|
|
8281
|
+
"value"
|
|
8282
|
+
)?.set;
|
|
8283
|
+
if (nativeInputValueSetter) {
|
|
8284
|
+
nativeInputValueSetter.call(textareaRef.current, "");
|
|
8285
|
+
const event = new Event("input", { bubbles: true });
|
|
8286
|
+
textareaRef.current.dispatchEvent(event);
|
|
8287
|
+
}
|
|
8288
|
+
setHasContent(false);
|
|
8289
|
+
setShowConfirmTooltip(false);
|
|
8290
|
+
textareaRef.current.focus();
|
|
8291
|
+
onClear?.();
|
|
8292
|
+
}
|
|
8293
|
+
};
|
|
8294
|
+
const handleCancelClear = () => {
|
|
8295
|
+
setShowConfirmTooltip(false);
|
|
8296
|
+
};
|
|
8297
|
+
React30.useImperativeHandle(ref, () => textareaRef.current);
|
|
8298
|
+
React30.useEffect(() => {
|
|
8299
|
+
setHasContent(!!props.value || !!props.defaultValue);
|
|
8300
|
+
}, [props.value, props.defaultValue]);
|
|
8301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "relative", children: [
|
|
8302
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8303
|
+
"textarea",
|
|
8304
|
+
{
|
|
8305
|
+
className: cn(
|
|
8306
|
+
"peer flex min-h-[80px] min-w-[200px] w-full rounded-lg border border-input bg-background/50 backdrop-blur-sm",
|
|
8307
|
+
"px-4 py-3 text-base shadow-sm placeholder:text-muted-foreground/60",
|
|
8308
|
+
"transition-all duration-300 ease-out",
|
|
8309
|
+
"hover:border-input/80 hover:shadow-md",
|
|
8310
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:border-ring",
|
|
8311
|
+
"focus-visible:shadow-lg focus-visible:bg-background",
|
|
8312
|
+
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted/30",
|
|
8313
|
+
"resize",
|
|
8314
|
+
"md:text-sm",
|
|
8315
|
+
clearable && hasContent && "pr-10",
|
|
8316
|
+
className
|
|
8317
|
+
),
|
|
8318
|
+
ref: textareaRef,
|
|
8319
|
+
onFocus: handleFocus,
|
|
8320
|
+
onBlur: handleBlur,
|
|
8321
|
+
onChange: handleChange,
|
|
8322
|
+
...props
|
|
8323
|
+
}
|
|
8324
|
+
),
|
|
8325
|
+
clearable && hasContent && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipProviderBase, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8326
|
+
TooltipBase,
|
|
8327
|
+
{
|
|
8328
|
+
open: showConfirmTooltip,
|
|
8329
|
+
onOpenChange: setShowConfirmTooltip,
|
|
8330
|
+
children: [
|
|
8331
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8332
|
+
import_framer_motion12.motion.button,
|
|
8333
|
+
{
|
|
8334
|
+
type: "button",
|
|
8335
|
+
initial: { opacity: 0, scale: 0.8 },
|
|
8336
|
+
animate: { opacity: 1, scale: 1 },
|
|
8337
|
+
exit: { opacity: 0, scale: 0.8 },
|
|
8338
|
+
transition: { duration: 0.2 },
|
|
8339
|
+
onClick: handleClearClick,
|
|
8340
|
+
className: cn(
|
|
8341
|
+
"absolute top-3 right-3 p-1.5 rounded-md",
|
|
8342
|
+
"text-muted-foreground/50 hover:text-destructive hover:bg-destructive/10",
|
|
8343
|
+
"transition-all duration-200",
|
|
8344
|
+
"focus:outline-none focus:ring-2 focus:ring-destructive/30",
|
|
8345
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
8346
|
+
),
|
|
8347
|
+
disabled: props.disabled,
|
|
8348
|
+
"aria-label": "Limpar texto",
|
|
8349
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react33.TrashIcon, { size: 16, weight: "regular" })
|
|
8350
|
+
}
|
|
8351
|
+
) }),
|
|
8352
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8353
|
+
TooltipContentBase,
|
|
8354
|
+
{
|
|
8355
|
+
side: "left",
|
|
8356
|
+
className: "bg-background border border-border shadow-lg p-3 flex flex-col gap-2",
|
|
8357
|
+
children: [
|
|
8358
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-sm text-foreground font-medium mb-1", children: "Limpar todo o texto?" }),
|
|
8359
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex gap-2", children: [
|
|
8360
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8361
|
+
"button",
|
|
8362
|
+
{
|
|
8363
|
+
type: "button",
|
|
8364
|
+
onClick: handleConfirmClear,
|
|
8365
|
+
className: cn(
|
|
8366
|
+
"px-3 py-1.5 text-xs rounded-md font-medium",
|
|
8367
|
+
"bg-destructive text-destructive-foreground",
|
|
8368
|
+
"hover:bg-destructive/90",
|
|
8369
|
+
"transition-colors"
|
|
8370
|
+
),
|
|
8371
|
+
children: "Confirmar"
|
|
8372
|
+
}
|
|
8373
|
+
),
|
|
8374
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8375
|
+
"button",
|
|
8376
|
+
{
|
|
8377
|
+
type: "button",
|
|
8378
|
+
onClick: handleCancelClear,
|
|
8379
|
+
className: cn(
|
|
8380
|
+
"px-3 py-1.5 text-xs rounded-md font-medium",
|
|
8381
|
+
"bg-secondary text-secondary-foreground",
|
|
8382
|
+
"hover:bg-secondary/80",
|
|
8383
|
+
"transition-colors"
|
|
8384
|
+
),
|
|
8385
|
+
children: "Cancelar"
|
|
8386
|
+
}
|
|
8387
|
+
)
|
|
8388
|
+
] })
|
|
8389
|
+
]
|
|
8390
|
+
}
|
|
8391
|
+
)
|
|
8392
|
+
]
|
|
8393
|
+
}
|
|
8394
|
+
) }),
|
|
8395
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
8396
|
+
import_framer_motion12.motion.div,
|
|
8397
|
+
{
|
|
8398
|
+
className: "pointer-events-none absolute inset-0 rounded-lg",
|
|
8399
|
+
initial: { opacity: 0 },
|
|
8400
|
+
animate: { opacity: isFocused ? 1 : 0 },
|
|
8401
|
+
transition: { duration: 0.3 },
|
|
8402
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "absolute inset-0 rounded-lg bg-gradient-to-r from-ring/20 via-ring/10 to-ring/20 blur-sm" })
|
|
8403
|
+
}
|
|
8404
|
+
),
|
|
8405
|
+
isFocused && hasContent && props.maxLength && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
8406
|
+
import_framer_motion12.motion.div,
|
|
8407
|
+
{
|
|
8408
|
+
initial: { opacity: 0, y: -10 },
|
|
8409
|
+
animate: { opacity: 1, y: 0 },
|
|
8410
|
+
exit: { opacity: 0, y: -10 },
|
|
8411
|
+
className: "absolute bottom-2 right-3 text-xs text-muted-foreground/70 font-medium",
|
|
8412
|
+
children: [
|
|
8413
|
+
props.value?.length || 0,
|
|
8414
|
+
" / ",
|
|
8415
|
+
props.maxLength
|
|
8416
|
+
]
|
|
8417
|
+
}
|
|
8418
|
+
)
|
|
8419
|
+
] });
|
|
8420
|
+
}
|
|
8421
|
+
);
|
|
8422
|
+
TextAreaBase.displayName = "TextAreaBase";
|
|
8423
|
+
|
|
8424
|
+
// src/components/ui/layout/CarouselBase.tsx
|
|
8425
|
+
var React31 = __toESM(require("react"));
|
|
8426
|
+
var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
|
|
8427
|
+
var import_react34 = require("@phosphor-icons/react");
|
|
8428
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
8429
|
+
var CarouselContext = React31.createContext(null);
|
|
8430
|
+
function useCarousel() {
|
|
8431
|
+
const context = React31.useContext(CarouselContext);
|
|
8432
|
+
if (!context) {
|
|
8433
|
+
throw new Error("useCarousel must be used within a <CarouselBase />");
|
|
8434
|
+
}
|
|
8435
|
+
return context;
|
|
8436
|
+
}
|
|
8437
|
+
function CarouselBase({
|
|
8438
|
+
orientation = "horizontal",
|
|
8439
|
+
opts,
|
|
8440
|
+
setApi,
|
|
8441
|
+
plugins,
|
|
8442
|
+
className,
|
|
8443
|
+
children,
|
|
8444
|
+
...props
|
|
8445
|
+
}) {
|
|
8446
|
+
const [carouselRef, api] = (0, import_embla_carousel_react.default)(
|
|
8447
|
+
{
|
|
8448
|
+
...opts,
|
|
8449
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
8450
|
+
},
|
|
8451
|
+
plugins
|
|
8452
|
+
);
|
|
8453
|
+
const [canScrollPrev, setCanScrollPrev] = React31.useState(false);
|
|
8454
|
+
const [canScrollNext, setCanScrollNext] = React31.useState(false);
|
|
8455
|
+
const onSelect = React31.useCallback((api2) => {
|
|
8456
|
+
if (!api2) return;
|
|
8457
|
+
setCanScrollPrev(api2.canScrollPrev());
|
|
8458
|
+
setCanScrollNext(api2.canScrollNext());
|
|
8459
|
+
}, []);
|
|
8460
|
+
const scrollPrev = React31.useCallback(() => {
|
|
8461
|
+
api?.scrollPrev();
|
|
8462
|
+
}, [api]);
|
|
8463
|
+
const scrollNext = React31.useCallback(() => {
|
|
8464
|
+
api?.scrollNext();
|
|
8465
|
+
}, [api]);
|
|
8466
|
+
const handleKeyDown = React31.useCallback(
|
|
8467
|
+
(event) => {
|
|
8468
|
+
if (event.key === "ArrowLeft") {
|
|
8469
|
+
event.preventDefault();
|
|
8470
|
+
scrollPrev();
|
|
8471
|
+
} else if (event.key === "ArrowRight") {
|
|
8472
|
+
event.preventDefault();
|
|
8473
|
+
scrollNext();
|
|
8474
|
+
}
|
|
8475
|
+
},
|
|
8476
|
+
[scrollPrev, scrollNext]
|
|
8477
|
+
);
|
|
8478
|
+
React31.useEffect(() => {
|
|
8479
|
+
if (!api || !setApi) return;
|
|
8480
|
+
setApi(api);
|
|
8481
|
+
}, [api, setApi]);
|
|
8482
|
+
React31.useEffect(() => {
|
|
8483
|
+
if (!api) return;
|
|
8484
|
+
onSelect(api);
|
|
8485
|
+
api.on("reInit", onSelect);
|
|
8486
|
+
api.on("select", onSelect);
|
|
8487
|
+
return () => {
|
|
8488
|
+
api?.off("select", onSelect);
|
|
8489
|
+
};
|
|
8490
|
+
}, [api, onSelect]);
|
|
8491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8492
|
+
CarouselContext.Provider,
|
|
8493
|
+
{
|
|
8494
|
+
value: {
|
|
8495
|
+
carouselRef,
|
|
8496
|
+
api,
|
|
8497
|
+
opts,
|
|
8498
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
8499
|
+
scrollPrev,
|
|
8500
|
+
scrollNext,
|
|
8501
|
+
canScrollPrev,
|
|
8502
|
+
canScrollNext
|
|
8503
|
+
},
|
|
8504
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8505
|
+
"div",
|
|
8506
|
+
{
|
|
8507
|
+
onKeyDownCapture: handleKeyDown,
|
|
8508
|
+
className: cn("relative", className),
|
|
8509
|
+
role: "region",
|
|
8510
|
+
"aria-roledescription": "carousel",
|
|
8511
|
+
"data-slot": "carousel",
|
|
8512
|
+
...props,
|
|
8513
|
+
children
|
|
8514
|
+
}
|
|
8515
|
+
)
|
|
8516
|
+
}
|
|
8517
|
+
);
|
|
8518
|
+
}
|
|
8519
|
+
function CarouselContentBase({
|
|
8520
|
+
className,
|
|
8521
|
+
...props
|
|
8522
|
+
}) {
|
|
8523
|
+
const { carouselRef, orientation } = useCarousel();
|
|
8524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8525
|
+
"div",
|
|
8526
|
+
{
|
|
8527
|
+
ref: carouselRef,
|
|
8528
|
+
className: "overflow-hidden",
|
|
8529
|
+
"data-slot": "carousel-content",
|
|
8530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8531
|
+
"div",
|
|
8532
|
+
{
|
|
8533
|
+
className: cn(
|
|
8534
|
+
"flex",
|
|
8535
|
+
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
8536
|
+
className
|
|
8537
|
+
),
|
|
8538
|
+
...props
|
|
8539
|
+
}
|
|
8540
|
+
)
|
|
8541
|
+
}
|
|
8542
|
+
);
|
|
8543
|
+
}
|
|
8544
|
+
function CarouselItemBase({
|
|
8545
|
+
className,
|
|
8546
|
+
...props
|
|
8547
|
+
}) {
|
|
8548
|
+
const { orientation } = useCarousel();
|
|
8549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8550
|
+
"div",
|
|
8551
|
+
{
|
|
8552
|
+
role: "group",
|
|
8553
|
+
"aria-roledescription": "slide",
|
|
8554
|
+
"data-slot": "carousel-item",
|
|
8555
|
+
className: cn(
|
|
8556
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
8557
|
+
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
8558
|
+
className
|
|
8559
|
+
),
|
|
8560
|
+
...props
|
|
8561
|
+
}
|
|
8562
|
+
);
|
|
8563
|
+
}
|
|
8564
|
+
function CarouselPrevious({
|
|
8565
|
+
className,
|
|
8566
|
+
variant = "outline",
|
|
8567
|
+
size = "icon",
|
|
8568
|
+
...props
|
|
8569
|
+
}) {
|
|
8570
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
8571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
8572
|
+
ButtonBase,
|
|
8573
|
+
{
|
|
8574
|
+
"data-slot": "carousel-previous",
|
|
8575
|
+
variant,
|
|
8576
|
+
size,
|
|
8577
|
+
className: cn(
|
|
8578
|
+
"absolute size-8 rounded-full",
|
|
8579
|
+
orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
8580
|
+
className
|
|
8581
|
+
),
|
|
8582
|
+
disabled: !canScrollPrev,
|
|
8583
|
+
onClick: scrollPrev,
|
|
8584
|
+
...props,
|
|
8585
|
+
children: [
|
|
8586
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react34.ArrowLeftIcon, {}),
|
|
8587
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "Previous slide" })
|
|
8588
|
+
]
|
|
8589
|
+
}
|
|
8590
|
+
);
|
|
8591
|
+
}
|
|
8592
|
+
function CarouselNextBase({
|
|
8593
|
+
className,
|
|
8594
|
+
variant = "outline",
|
|
8595
|
+
size = "icon",
|
|
8596
|
+
...props
|
|
8597
|
+
}) {
|
|
8598
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
8599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
8600
|
+
ButtonBase,
|
|
8601
|
+
{
|
|
8602
|
+
"data-slot": "carousel-next",
|
|
8603
|
+
variant,
|
|
8604
|
+
size,
|
|
8605
|
+
className: cn(
|
|
8606
|
+
"absolute size-8 rounded-full",
|
|
8607
|
+
orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
8608
|
+
className
|
|
8609
|
+
),
|
|
8610
|
+
disabled: !canScrollNext,
|
|
8611
|
+
onClick: scrollNext,
|
|
8612
|
+
...props,
|
|
8613
|
+
children: [
|
|
8614
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react34.ArrowRightIcon, {}),
|
|
8615
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "sr-only", children: "Next slide" })
|
|
8616
|
+
]
|
|
8617
|
+
}
|
|
8618
|
+
);
|
|
8619
|
+
}
|
|
8620
|
+
|
|
8621
|
+
// src/components/ui/layout/SeparatorBase.tsx
|
|
8622
|
+
var React32 = __toESM(require("react"));
|
|
8623
|
+
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
|
|
8624
|
+
var import_framer_motion13 = require("framer-motion");
|
|
8625
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
8626
|
+
var SeparatorBase = React32.forwardRef(
|
|
8627
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
|
|
8628
|
+
const isHorizontal = orientation === "horizontal";
|
|
8629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8630
|
+
SeparatorPrimitive.Root,
|
|
8631
|
+
{
|
|
8632
|
+
ref,
|
|
8633
|
+
decorative,
|
|
8634
|
+
orientation,
|
|
8635
|
+
asChild: true,
|
|
8636
|
+
...props,
|
|
8637
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8638
|
+
import_framer_motion13.motion.div,
|
|
8639
|
+
{
|
|
8640
|
+
className: cn(
|
|
8641
|
+
"shrink-0 bg-border",
|
|
8642
|
+
isHorizontal ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
8643
|
+
className
|
|
8644
|
+
),
|
|
8645
|
+
initial: {
|
|
8646
|
+
scaleX: isHorizontal ? 0 : 1,
|
|
8647
|
+
scaleY: isHorizontal ? 1 : 0
|
|
8648
|
+
},
|
|
8649
|
+
animate: { scaleX: 1, scaleY: 1 },
|
|
8650
|
+
transition: { duration: 0.2, ease: "easeInOut" }
|
|
8651
|
+
}
|
|
8652
|
+
)
|
|
8653
|
+
}
|
|
8654
|
+
);
|
|
8655
|
+
}
|
|
8656
|
+
);
|
|
8657
|
+
SeparatorBase.displayName = SeparatorPrimitive.Root.displayName;
|
|
8658
|
+
|
|
8659
|
+
// src/components/ui/layout/TableBase.tsx
|
|
8660
|
+
var React33 = __toESM(require("react"));
|
|
8661
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
8662
|
+
var TableBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8663
|
+
"table",
|
|
8664
|
+
{
|
|
8665
|
+
ref,
|
|
8666
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
8667
|
+
...props
|
|
8668
|
+
}
|
|
8669
|
+
) }));
|
|
8670
|
+
TableBase.displayName = "TableBase";
|
|
8671
|
+
var TableHeaderBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
8672
|
+
TableHeaderBase.displayName = "TableHeaderBase";
|
|
8673
|
+
var TableBodyBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8674
|
+
"tbody",
|
|
8675
|
+
{
|
|
8676
|
+
ref,
|
|
8677
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
8678
|
+
...props
|
|
8679
|
+
}
|
|
8680
|
+
));
|
|
8681
|
+
TableBodyBase.displayName = "TableBodyBase";
|
|
8682
|
+
var TableFooterBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8683
|
+
"tfoot",
|
|
8684
|
+
{
|
|
8685
|
+
ref,
|
|
8686
|
+
className: cn(
|
|
8687
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
8688
|
+
className
|
|
8689
|
+
),
|
|
8690
|
+
...props
|
|
8691
|
+
}
|
|
8692
|
+
));
|
|
8693
|
+
TableFooterBase.displayName = "TableFooterBase";
|
|
8694
|
+
var TableRowBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8695
|
+
"tr",
|
|
8696
|
+
{
|
|
8697
|
+
ref,
|
|
8698
|
+
className: cn(
|
|
8699
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
8700
|
+
className
|
|
8701
|
+
),
|
|
8702
|
+
...props
|
|
8703
|
+
}
|
|
8704
|
+
));
|
|
8705
|
+
TableRowBase.displayName = "TableRowBase";
|
|
8706
|
+
var TableHeadBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8707
|
+
"th",
|
|
8708
|
+
{
|
|
8709
|
+
ref,
|
|
8710
|
+
className: cn(
|
|
8711
|
+
"h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
8712
|
+
className
|
|
8713
|
+
),
|
|
8714
|
+
...props
|
|
8715
|
+
}
|
|
8716
|
+
));
|
|
8717
|
+
TableHeadBase.displayName = "TableHeadBase";
|
|
8718
|
+
var TableCellBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8719
|
+
"td",
|
|
8720
|
+
{
|
|
8721
|
+
ref,
|
|
8722
|
+
className: cn(
|
|
8723
|
+
"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
8724
|
+
className
|
|
8725
|
+
),
|
|
8726
|
+
...props
|
|
8727
|
+
}
|
|
8728
|
+
));
|
|
8729
|
+
TableCellBase.displayName = "TableCellBase";
|
|
8730
|
+
var TableCaptionBase = React33.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8731
|
+
"caption",
|
|
8732
|
+
{
|
|
8733
|
+
ref,
|
|
8734
|
+
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
8735
|
+
...props
|
|
8736
|
+
}
|
|
8737
|
+
));
|
|
8738
|
+
TableCaptionBase.displayName = "TableCaptionBase";
|
|
8739
|
+
|
|
8740
|
+
// src/components/ui/layout/TabsBase.tsx
|
|
8741
|
+
var React34 = __toESM(require("react"));
|
|
8742
|
+
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
|
|
8743
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
8744
|
+
var TabsBase = TabsPrimitive.Root;
|
|
8745
|
+
var TabsListBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8746
|
+
TabsPrimitive.List,
|
|
8747
|
+
{
|
|
8748
|
+
ref,
|
|
8749
|
+
className: cn(
|
|
8750
|
+
"relative flex w-full items-center justify-start gap-2 border-b border-border",
|
|
8751
|
+
"bg-transparent",
|
|
8752
|
+
className
|
|
8753
|
+
),
|
|
8754
|
+
...props
|
|
8755
|
+
}
|
|
8756
|
+
));
|
|
8757
|
+
TabsListBase.displayName = TabsPrimitive.List.displayName;
|
|
8758
|
+
var TabsTriggerBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8759
|
+
TabsPrimitive.Trigger,
|
|
8760
|
+
{
|
|
8761
|
+
ref,
|
|
8762
|
+
className: cn(
|
|
8763
|
+
"relative inline-flex items-center justify-center whitespace-nowrap px-4 py-2 text-sm font-medium",
|
|
8764
|
+
"text-muted-foreground hover:text-foreground",
|
|
8765
|
+
"transition-colors duration-300 ease-in-out",
|
|
8766
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
8767
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
8768
|
+
"data-[state=active]:text-primary",
|
|
8769
|
+
"after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full",
|
|
8770
|
+
"after:scale-x-0 after:bg-primary after:origin-left",
|
|
8771
|
+
"after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.34,1.56,0.64,1)]",
|
|
8772
|
+
"data-[state=active]:after:scale-x-100",
|
|
8773
|
+
className
|
|
8774
|
+
),
|
|
8775
|
+
...props
|
|
8776
|
+
}
|
|
8777
|
+
));
|
|
8778
|
+
var TabsContentBase = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8779
|
+
TabsPrimitive.Content,
|
|
8780
|
+
{
|
|
8781
|
+
ref,
|
|
8782
|
+
className: cn(
|
|
8783
|
+
"mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
8784
|
+
"animate-in fade-in-0 duration-500 ease-in-out",
|
|
8785
|
+
className
|
|
8786
|
+
),
|
|
8787
|
+
...props
|
|
8788
|
+
}
|
|
8789
|
+
));
|
|
8790
|
+
TabsContentBase.displayName = TabsPrimitive.Content.displayName;
|
|
8791
|
+
|
|
8792
|
+
// src/components/ui/navigation/BreadcrumbBase.tsx
|
|
8793
|
+
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
8794
|
+
var import_react35 = require("@phosphor-icons/react");
|
|
8795
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8796
|
+
function BreadcrumbBase({ ...props }) {
|
|
8797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
8798
|
+
}
|
|
8799
|
+
function BreadcrumbListBase({ className, ...props }) {
|
|
8800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8801
|
+
"ol",
|
|
8802
|
+
{
|
|
8803
|
+
"data-slot": "breadcrumb-list",
|
|
8804
|
+
className: cn(
|
|
8805
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
8806
|
+
className
|
|
8807
|
+
),
|
|
8808
|
+
...props
|
|
8809
|
+
}
|
|
8810
|
+
);
|
|
8811
|
+
}
|
|
8812
|
+
function BreadcrumbItemBase({ className, ...props }) {
|
|
8813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8814
|
+
"li",
|
|
8815
|
+
{
|
|
8816
|
+
"data-slot": "breadcrumb-item",
|
|
8817
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
8818
|
+
...props
|
|
8819
|
+
}
|
|
8820
|
+
);
|
|
8821
|
+
}
|
|
8822
|
+
function BreadcrumbLinkBase({
|
|
8823
|
+
asChild,
|
|
8824
|
+
className,
|
|
8825
|
+
...props
|
|
8826
|
+
}) {
|
|
8827
|
+
const Comp = asChild ? import_react_slot4.Slot : "a";
|
|
8828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8829
|
+
Comp,
|
|
8830
|
+
{
|
|
8831
|
+
"data-slot": "breadcrumb-link",
|
|
8832
|
+
className: cn("hover:text-foreground transition-colors", className),
|
|
8833
|
+
...props
|
|
8834
|
+
}
|
|
8835
|
+
);
|
|
8836
|
+
}
|
|
8837
|
+
function BreadcrumbPageBase({ className, ...props }) {
|
|
8838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8839
|
+
"span",
|
|
8840
|
+
{
|
|
8841
|
+
"data-slot": "breadcrumb-page",
|
|
8842
|
+
role: "link",
|
|
8843
|
+
"aria-disabled": "true",
|
|
8844
|
+
"aria-current": "page",
|
|
8845
|
+
className: cn("text-foreground font-normal", className),
|
|
8846
|
+
...props
|
|
8847
|
+
}
|
|
8848
|
+
);
|
|
8849
|
+
}
|
|
8850
|
+
function BreadcrumbSeparatorBase({
|
|
8851
|
+
children,
|
|
8852
|
+
className,
|
|
8853
|
+
...props
|
|
8854
|
+
}) {
|
|
8855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8856
|
+
"li",
|
|
8857
|
+
{
|
|
8858
|
+
"data-slot": "breadcrumb-separator",
|
|
8859
|
+
role: "presentation",
|
|
8860
|
+
"aria-hidden": "true",
|
|
8861
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
8862
|
+
...props,
|
|
8863
|
+
children: children ?? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react35.CaretRightIcon, {})
|
|
8864
|
+
}
|
|
8865
|
+
);
|
|
8866
|
+
}
|
|
8867
|
+
function BreadcrumbEllipsisBase({
|
|
8868
|
+
className,
|
|
8869
|
+
...props
|
|
8870
|
+
}) {
|
|
8871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8872
|
+
"span",
|
|
8873
|
+
{
|
|
8874
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
8875
|
+
role: "presentation",
|
|
8876
|
+
"aria-hidden": "true",
|
|
8877
|
+
className: cn("flex size-9 items-center justify-center", className),
|
|
8878
|
+
...props,
|
|
8879
|
+
children: [
|
|
8880
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_react35.DotsThreeIcon, { className: "size-4" }),
|
|
8881
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "sr-only", children: "More" })
|
|
8882
|
+
]
|
|
8883
|
+
}
|
|
8884
|
+
);
|
|
8885
|
+
}
|
|
8886
|
+
|
|
8887
|
+
// src/components/ui/navigation/NavigationMenuBase.tsx
|
|
8888
|
+
var NavigationMenuPrimitive = __toESM(require("@radix-ui/react-navigation-menu"));
|
|
8889
|
+
var import_react36 = require("@phosphor-icons/react");
|
|
8890
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8891
|
+
function NavigationMenuBase({
|
|
8892
|
+
className,
|
|
8893
|
+
children,
|
|
8894
|
+
viewport = true,
|
|
8895
|
+
...props
|
|
8896
|
+
}) {
|
|
8897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
8898
|
+
NavigationMenuPrimitive.Root,
|
|
8899
|
+
{
|
|
8900
|
+
"data-slot": "navigation-menu",
|
|
8901
|
+
"data-viewport": viewport,
|
|
8902
|
+
className: cn(
|
|
8903
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center z-[999]",
|
|
8904
|
+
className
|
|
8905
|
+
),
|
|
8906
|
+
...props,
|
|
8907
|
+
children: [
|
|
8908
|
+
children,
|
|
8909
|
+
viewport && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(NavigationMenuViewportBase, {})
|
|
8910
|
+
]
|
|
8911
|
+
}
|
|
8912
|
+
);
|
|
8913
|
+
}
|
|
8914
|
+
function NavigationMenuListBase({
|
|
8915
|
+
className,
|
|
8916
|
+
...props
|
|
8917
|
+
}) {
|
|
8918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8919
|
+
NavigationMenuPrimitive.List,
|
|
8920
|
+
{
|
|
8921
|
+
"data-slot": "navigation-menu-list",
|
|
8922
|
+
className: cn(
|
|
8923
|
+
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
8924
|
+
className
|
|
8925
|
+
),
|
|
8926
|
+
...props
|
|
8927
|
+
}
|
|
8928
|
+
);
|
|
8929
|
+
}
|
|
8930
|
+
function NavigationMenuItemBase({
|
|
8931
|
+
className,
|
|
8932
|
+
...props
|
|
8933
|
+
}) {
|
|
8934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8935
|
+
NavigationMenuPrimitive.Item,
|
|
8936
|
+
{
|
|
8937
|
+
"data-slot": "navigation-menu-item",
|
|
8938
|
+
className: cn("relative", className),
|
|
8939
|
+
...props
|
|
8940
|
+
}
|
|
8941
|
+
);
|
|
8942
|
+
}
|
|
8943
|
+
function NavigationMenuTriggerBase({
|
|
8944
|
+
className,
|
|
8945
|
+
children,
|
|
8946
|
+
...props
|
|
8947
|
+
}) {
|
|
8948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
8949
|
+
NavigationMenuPrimitive.Trigger,
|
|
8950
|
+
{
|
|
8951
|
+
"data-slot": "navigation-menu-trigger",
|
|
8952
|
+
className: cn("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1", "group", className),
|
|
8953
|
+
...props,
|
|
8954
|
+
children: [
|
|
8955
|
+
children,
|
|
8956
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8957
|
+
import_react36.CaretDownIcon,
|
|
8958
|
+
{
|
|
8959
|
+
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
8960
|
+
"aria-hidden": "true"
|
|
8961
|
+
}
|
|
8962
|
+
)
|
|
8963
|
+
]
|
|
8964
|
+
}
|
|
8965
|
+
);
|
|
8966
|
+
}
|
|
8967
|
+
function NavigationMenuContentBase({
|
|
8968
|
+
className,
|
|
8969
|
+
...props
|
|
8970
|
+
}) {
|
|
8971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8972
|
+
NavigationMenuPrimitive.Content,
|
|
8973
|
+
{
|
|
8974
|
+
"data-slot": "navigation-menu-content",
|
|
8975
|
+
className: cn(
|
|
8976
|
+
"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
|
|
8977
|
+
"group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
|
|
8978
|
+
className
|
|
8979
|
+
),
|
|
8980
|
+
...props
|
|
8981
|
+
}
|
|
8982
|
+
);
|
|
8983
|
+
}
|
|
8984
|
+
function NavigationMenuViewportBase({
|
|
8985
|
+
className,
|
|
8986
|
+
...props
|
|
8987
|
+
}) {
|
|
8988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: cn("absolute top-full left-0 isolate z-50 flex justify-center"), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8989
|
+
NavigationMenuPrimitive.Viewport,
|
|
8990
|
+
{
|
|
8991
|
+
"data-slot": "navigation-menu-viewport",
|
|
8992
|
+
className: cn(
|
|
8993
|
+
"origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
8994
|
+
className
|
|
8995
|
+
),
|
|
8996
|
+
...props
|
|
8997
|
+
}
|
|
8998
|
+
) });
|
|
8999
|
+
}
|
|
9000
|
+
function NavigationMenuLinkBase({
|
|
9001
|
+
className,
|
|
9002
|
+
...props
|
|
9003
|
+
}) {
|
|
9004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9005
|
+
NavigationMenuPrimitive.Link,
|
|
9006
|
+
{
|
|
9007
|
+
"data-slot": "navigation-menu-link",
|
|
9008
|
+
className: cn(
|
|
9009
|
+
"data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
9010
|
+
className
|
|
9011
|
+
),
|
|
9012
|
+
...props
|
|
9013
|
+
}
|
|
9014
|
+
);
|
|
9015
|
+
}
|
|
9016
|
+
function NavigationMenuIndicatorBase({
|
|
9017
|
+
className,
|
|
9018
|
+
...props
|
|
9019
|
+
}) {
|
|
9020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
9021
|
+
NavigationMenuPrimitive.Indicator,
|
|
9022
|
+
{
|
|
9023
|
+
"data-slot": "navigation-menu-indicator",
|
|
9024
|
+
className: cn(
|
|
9025
|
+
"data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
|
|
9026
|
+
className
|
|
9027
|
+
),
|
|
9028
|
+
...props,
|
|
9029
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
9030
|
+
}
|
|
9031
|
+
);
|
|
9032
|
+
}
|
|
9033
|
+
|
|
9034
|
+
// src/components/ui/navigation/SidebarBase.tsx
|
|
9035
|
+
var React37 = __toESM(require("react"));
|
|
9036
|
+
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
9037
|
+
var import_class_variance_authority5 = require("class-variance-authority");
|
|
9038
|
+
|
|
9039
|
+
// src/hooks/use-mobile.tsx
|
|
9040
|
+
var React35 = __toESM(require("react"));
|
|
9041
|
+
var MOBILE_BREAKPOINT = 768;
|
|
9042
|
+
function useIsMobile() {
|
|
9043
|
+
const [isMobile, setIsMobile] = React35.useState(void 0);
|
|
9044
|
+
React35.useEffect(() => {
|
|
9045
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
9046
|
+
const onChange = () => {
|
|
9047
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9048
|
+
};
|
|
9049
|
+
mql.addEventListener("change", onChange);
|
|
9050
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9051
|
+
return () => mql.removeEventListener("change", onChange);
|
|
9052
|
+
}, []);
|
|
9053
|
+
return !!isMobile;
|
|
9054
|
+
}
|
|
9055
|
+
|
|
9056
|
+
// src/components/ui/overlays/SheetBase.tsx
|
|
9057
|
+
var React36 = __toESM(require("react"));
|
|
9058
|
+
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
9059
|
+
var import_class_variance_authority4 = require("class-variance-authority");
|
|
9060
|
+
var import_react37 = require("@phosphor-icons/react");
|
|
9061
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
9062
|
+
var SheetBase = SheetPrimitive.Root;
|
|
9063
|
+
var SheetTriggerBase = SheetPrimitive.Trigger;
|
|
9064
|
+
var SheetCloseBase = SheetPrimitive.Close;
|
|
9065
|
+
var SheetPortalBase = SheetPrimitive.Portal;
|
|
9066
|
+
var SheetOverlayBase = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9067
|
+
SheetPrimitive.Overlay,
|
|
9068
|
+
{
|
|
9069
|
+
className: cn(
|
|
9070
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
9071
|
+
className
|
|
9072
|
+
),
|
|
9073
|
+
...props,
|
|
9074
|
+
ref
|
|
9075
|
+
}
|
|
9076
|
+
));
|
|
9077
|
+
SheetOverlayBase.displayName = SheetPrimitive.Overlay.displayName;
|
|
9078
|
+
var sheetVariants = (0, import_class_variance_authority4.cva)(
|
|
9079
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
9080
|
+
{
|
|
9081
|
+
variants: {
|
|
9082
|
+
side: {
|
|
9083
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
9084
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
9085
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
9086
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
9087
|
+
}
|
|
9088
|
+
},
|
|
9089
|
+
defaultVariants: {
|
|
9090
|
+
side: "right"
|
|
9091
|
+
}
|
|
9092
|
+
}
|
|
9093
|
+
);
|
|
9094
|
+
var SheetContentBase = React36.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(SheetPortalBase, { children: [
|
|
9095
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(SheetOverlayBase, {}),
|
|
9096
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
9097
|
+
SheetPrimitive.Content,
|
|
9098
|
+
{
|
|
9099
|
+
ref,
|
|
9100
|
+
className: cn(sheetVariants({ side }), className),
|
|
9101
|
+
...props,
|
|
9102
|
+
children: [
|
|
9103
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
9104
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_react37.XIcon, { className: "h-4 w-4" }),
|
|
9105
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "sr-only", children: "Close" })
|
|
9106
|
+
] }),
|
|
9107
|
+
children
|
|
9108
|
+
]
|
|
9109
|
+
}
|
|
9110
|
+
)
|
|
9111
|
+
] }));
|
|
9112
|
+
SheetContentBase.displayName = SheetPrimitive.Content.displayName;
|
|
9113
|
+
var SheetHeaderBase = ({
|
|
9114
|
+
className,
|
|
9115
|
+
...props
|
|
9116
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9117
|
+
"div",
|
|
9118
|
+
{
|
|
9119
|
+
className: cn(
|
|
9120
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
9121
|
+
className
|
|
9122
|
+
),
|
|
9123
|
+
...props
|
|
9124
|
+
}
|
|
9125
|
+
);
|
|
9126
|
+
SheetHeaderBase.displayName = "SheetHeaderBase";
|
|
9127
|
+
var SheetFooterBase = ({
|
|
9128
|
+
className,
|
|
9129
|
+
...props
|
|
9130
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9131
|
+
"div",
|
|
9132
|
+
{
|
|
9133
|
+
className: cn(
|
|
9134
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
9135
|
+
className
|
|
9136
|
+
),
|
|
9137
|
+
...props
|
|
9138
|
+
}
|
|
9139
|
+
);
|
|
9140
|
+
SheetFooterBase.displayName = "SheetFooterBase";
|
|
9141
|
+
var SheetTitleBase = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9142
|
+
SheetPrimitive.Title,
|
|
9143
|
+
{
|
|
9144
|
+
ref,
|
|
9145
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
9146
|
+
...props
|
|
9147
|
+
}
|
|
9148
|
+
));
|
|
9149
|
+
SheetTitleBase.displayName = SheetPrimitive.Title.displayName;
|
|
9150
|
+
var SheetDescriptionBase = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
9151
|
+
SheetPrimitive.Description,
|
|
9152
|
+
{
|
|
9153
|
+
ref,
|
|
9154
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
9155
|
+
...props
|
|
9156
|
+
}
|
|
9157
|
+
));
|
|
9158
|
+
SheetDescriptionBase.displayName = SheetPrimitive.Description.displayName;
|
|
9159
|
+
|
|
9160
|
+
// src/components/ui/navigation/SidebarBase.tsx
|
|
9161
|
+
var import_react38 = require("@phosphor-icons/react");
|
|
9162
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
9163
|
+
var SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
9164
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
9165
|
+
var SIDEBAR_WIDTH = "16rem";
|
|
9166
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
9167
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
9168
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
9169
|
+
var SidebarContext = React37.createContext(null);
|
|
9170
|
+
function UseSideBarBase() {
|
|
9171
|
+
const context = React37.useContext(SidebarContext);
|
|
9172
|
+
if (!context) {
|
|
9173
|
+
throw new Error(
|
|
9174
|
+
"UseSideBarBase must be used within a SidebarProviderBase."
|
|
9175
|
+
);
|
|
9176
|
+
}
|
|
9177
|
+
return context;
|
|
9178
|
+
}
|
|
9179
|
+
var SidebarProviderBase = React37.forwardRef(
|
|
9180
|
+
({
|
|
9181
|
+
defaultOpen = true,
|
|
9182
|
+
open: openProp,
|
|
9183
|
+
onOpenChange: setOpenProp,
|
|
9184
|
+
className,
|
|
9185
|
+
style,
|
|
9186
|
+
children,
|
|
9187
|
+
...props
|
|
9188
|
+
}, ref) => {
|
|
9189
|
+
const isMobile = useIsMobile();
|
|
9190
|
+
const [openMobile, setOpenMobile] = React37.useState(false);
|
|
9191
|
+
const [_open, _setOpen] = React37.useState(defaultOpen);
|
|
9192
|
+
const open = openProp ?? _open;
|
|
9193
|
+
const setOpen = React37.useCallback(
|
|
9194
|
+
(value) => {
|
|
9195
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
9196
|
+
if (setOpenProp) {
|
|
9197
|
+
setOpenProp(openState);
|
|
9198
|
+
} else {
|
|
9199
|
+
_setOpen(openState);
|
|
9200
|
+
}
|
|
9201
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
9202
|
+
},
|
|
9203
|
+
[setOpenProp, open]
|
|
9204
|
+
);
|
|
9205
|
+
const toggleSidebar = React37.useCallback(() => {
|
|
9206
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
9207
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
9208
|
+
React37.useEffect(() => {
|
|
9209
|
+
const handleKeyDown = (event) => {
|
|
9210
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
9211
|
+
event.preventDefault();
|
|
9212
|
+
toggleSidebar();
|
|
9213
|
+
}
|
|
9214
|
+
};
|
|
9215
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
9216
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
9217
|
+
}, [toggleSidebar]);
|
|
9218
|
+
const state = open ? "expanded" : "collapsed";
|
|
9219
|
+
const contextValue = React37.useMemo(
|
|
9220
|
+
() => ({
|
|
9221
|
+
state,
|
|
9222
|
+
open,
|
|
9223
|
+
setOpen,
|
|
9224
|
+
isMobile,
|
|
9225
|
+
openMobile,
|
|
9226
|
+
setOpenMobile,
|
|
9227
|
+
toggleSidebar
|
|
9228
|
+
}),
|
|
9229
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
9230
|
+
);
|
|
9231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipProviderBase, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9232
|
+
"div",
|
|
9233
|
+
{
|
|
9234
|
+
style: {
|
|
9235
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
9236
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
9237
|
+
...style
|
|
9238
|
+
},
|
|
9239
|
+
className: cn(
|
|
9240
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
|
|
9241
|
+
className
|
|
9242
|
+
),
|
|
9243
|
+
ref,
|
|
9244
|
+
...props,
|
|
9245
|
+
children
|
|
9246
|
+
}
|
|
9247
|
+
) }) });
|
|
9248
|
+
}
|
|
9249
|
+
);
|
|
9250
|
+
SidebarProviderBase.displayName = "SidebarProviderBase";
|
|
9251
|
+
var SidebarBase = React37.forwardRef(
|
|
9252
|
+
({
|
|
9253
|
+
side = "left",
|
|
9254
|
+
variant = "sidebar",
|
|
9255
|
+
collapsible = "offcanvas",
|
|
9256
|
+
className,
|
|
9257
|
+
children,
|
|
9258
|
+
...props
|
|
9259
|
+
}, ref) => {
|
|
9260
|
+
const { isMobile, state, openMobile, setOpenMobile } = UseSideBarBase();
|
|
9261
|
+
if (collapsible === "none") {
|
|
9262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9263
|
+
"div",
|
|
9264
|
+
{
|
|
9265
|
+
className: cn(
|
|
9266
|
+
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
|
9267
|
+
className
|
|
9268
|
+
),
|
|
9269
|
+
ref,
|
|
9270
|
+
...props,
|
|
9271
|
+
children
|
|
9272
|
+
}
|
|
9273
|
+
);
|
|
9274
|
+
}
|
|
9275
|
+
if (isMobile) {
|
|
9276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SheetBase, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9277
|
+
SheetContentBase,
|
|
9278
|
+
{
|
|
9279
|
+
"data-sidebar": "sidebar",
|
|
9280
|
+
"data-mobile": "true",
|
|
9281
|
+
className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
9282
|
+
style: {
|
|
9283
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
9284
|
+
},
|
|
9285
|
+
side,
|
|
9286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
9287
|
+
}
|
|
9288
|
+
) });
|
|
9289
|
+
}
|
|
9290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
9291
|
+
"div",
|
|
9292
|
+
{
|
|
9293
|
+
ref,
|
|
9294
|
+
className: "group peer hidden text-sidebar-foreground md:block",
|
|
9295
|
+
"data-state": state,
|
|
9296
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
9297
|
+
"data-variant": variant,
|
|
9298
|
+
"data-side": side,
|
|
9299
|
+
children: [
|
|
9300
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9301
|
+
"div",
|
|
9302
|
+
{
|
|
9303
|
+
className: cn(
|
|
9304
|
+
"relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear",
|
|
9305
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
9306
|
+
"group-data-[side=right]:rotate-180",
|
|
9307
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
9308
|
+
)
|
|
9309
|
+
}
|
|
9310
|
+
),
|
|
9311
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9312
|
+
"div",
|
|
9313
|
+
{
|
|
9314
|
+
className: cn(
|
|
9315
|
+
"fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
9316
|
+
side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
9317
|
+
// Adjust the padding for floating and inset variants.
|
|
9318
|
+
variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
9319
|
+
className
|
|
9320
|
+
),
|
|
9321
|
+
...props,
|
|
9322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9323
|
+
"div",
|
|
9324
|
+
{
|
|
9325
|
+
"data-sidebar": "sidebar",
|
|
9326
|
+
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",
|
|
9327
|
+
children
|
|
9328
|
+
}
|
|
9329
|
+
)
|
|
9330
|
+
}
|
|
9331
|
+
)
|
|
9332
|
+
]
|
|
9333
|
+
}
|
|
9334
|
+
);
|
|
9335
|
+
}
|
|
9336
|
+
);
|
|
9337
|
+
SidebarBase.displayName = "SidebarBase";
|
|
9338
|
+
var SidebarTriggerBase = React37.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
9339
|
+
const { toggleSidebar } = UseSideBarBase();
|
|
9340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
9341
|
+
ButtonBase,
|
|
9342
|
+
{
|
|
9343
|
+
ref,
|
|
9344
|
+
"data-sidebar": "trigger",
|
|
9345
|
+
variant: "ghost",
|
|
9346
|
+
size: "icon",
|
|
9347
|
+
className: cn("h-7 w-7", className),
|
|
9348
|
+
onClick: (event) => {
|
|
9349
|
+
onClick?.(event);
|
|
9350
|
+
toggleSidebar();
|
|
9351
|
+
},
|
|
9352
|
+
...props,
|
|
9353
|
+
children: [
|
|
9354
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "sr-only", children: "Toggle SidebarBase" }),
|
|
9355
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react38.SidebarSimpleIcon, {})
|
|
9356
|
+
]
|
|
9357
|
+
}
|
|
9358
|
+
) });
|
|
9359
|
+
});
|
|
9360
|
+
SidebarTriggerBase.displayName = "SidebarTriggerBase";
|
|
9361
|
+
var SidebarRailBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9362
|
+
const { toggleSidebar } = UseSideBarBase();
|
|
9363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9364
|
+
"button",
|
|
9365
|
+
{
|
|
9366
|
+
ref,
|
|
9367
|
+
"data-sidebar": "rail",
|
|
9368
|
+
"aria-label": "Toggle SidebarBase",
|
|
9369
|
+
tabIndex: -1,
|
|
9370
|
+
onClick: toggleSidebar,
|
|
9371
|
+
title: "Toggle SidebarBase",
|
|
9372
|
+
className: cn(
|
|
9373
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
9374
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
9375
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
9376
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
9377
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
9378
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
9379
|
+
className
|
|
9380
|
+
),
|
|
9381
|
+
...props
|
|
9382
|
+
}
|
|
9383
|
+
);
|
|
9384
|
+
});
|
|
9385
|
+
SidebarRailBase.displayName = "SidebarRailBase";
|
|
9386
|
+
var SidebarInsetBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9388
|
+
"main",
|
|
9389
|
+
{
|
|
9390
|
+
ref,
|
|
9391
|
+
className: cn(
|
|
9392
|
+
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
9393
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
|
9394
|
+
className
|
|
9395
|
+
),
|
|
9396
|
+
...props
|
|
9397
|
+
}
|
|
9398
|
+
);
|
|
9399
|
+
});
|
|
9400
|
+
SidebarInsetBase.displayName = "SidebarInsetBase";
|
|
9401
|
+
var SidebarInputBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9403
|
+
InputBase,
|
|
9404
|
+
{
|
|
9405
|
+
ref,
|
|
9406
|
+
"data-sidebar": "input",
|
|
9407
|
+
className: cn(
|
|
9408
|
+
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
9409
|
+
className
|
|
9410
|
+
),
|
|
9411
|
+
...props
|
|
9412
|
+
}
|
|
9413
|
+
);
|
|
9414
|
+
});
|
|
9415
|
+
SidebarInputBase.displayName = "SidebarInputBase";
|
|
9416
|
+
var SidebarHeaderBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9418
|
+
"div",
|
|
9419
|
+
{
|
|
9420
|
+
ref,
|
|
9421
|
+
"data-sidebar": "header",
|
|
9422
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
9423
|
+
...props
|
|
9424
|
+
}
|
|
9425
|
+
);
|
|
9426
|
+
});
|
|
9427
|
+
SidebarHeaderBase.displayName = "SidebarHeaderBase";
|
|
9428
|
+
var SidebarFooterBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9430
|
+
"div",
|
|
9431
|
+
{
|
|
9432
|
+
ref,
|
|
9433
|
+
"data-sidebar": "footer",
|
|
9434
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
9435
|
+
...props
|
|
9436
|
+
}
|
|
9437
|
+
);
|
|
9438
|
+
});
|
|
9439
|
+
SidebarFooterBase.displayName = "SidebarFooterBase";
|
|
9440
|
+
var SidebarSeparatorBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9442
|
+
SeparatorBase,
|
|
9443
|
+
{
|
|
9444
|
+
ref,
|
|
9445
|
+
"data-sidebar": "separator",
|
|
9446
|
+
className: cn("mx-2 w-auto bg-sidebar-border", className),
|
|
9447
|
+
...props
|
|
9448
|
+
}
|
|
9449
|
+
);
|
|
9450
|
+
});
|
|
9451
|
+
SidebarSeparatorBase.displayName = "SidebarSeparatorBase";
|
|
9452
|
+
var SidebarContentBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9454
|
+
"div",
|
|
9455
|
+
{
|
|
9456
|
+
ref,
|
|
9457
|
+
"data-sidebar": "content",
|
|
9458
|
+
className: cn(
|
|
9459
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
9460
|
+
className
|
|
9461
|
+
),
|
|
9462
|
+
...props
|
|
9463
|
+
}
|
|
9464
|
+
);
|
|
9465
|
+
});
|
|
9466
|
+
SidebarContentBase.displayName = "SidebarContentBase";
|
|
9467
|
+
var SidebarGroupBase = React37.forwardRef(({ className, ...props }, ref) => {
|
|
9468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9469
|
+
"div",
|
|
9470
|
+
{
|
|
9471
|
+
ref,
|
|
9472
|
+
"data-sidebar": "group",
|
|
9473
|
+
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
9474
|
+
...props
|
|
9475
|
+
}
|
|
9476
|
+
);
|
|
9477
|
+
});
|
|
9478
|
+
SidebarGroupBase.displayName = "SidebarGroupBase";
|
|
9479
|
+
var SidebarGroupLabelBase = React37.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
9480
|
+
const Comp = asChild ? import_react_slot5.Slot : "div";
|
|
9481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9482
|
+
Comp,
|
|
9483
|
+
{
|
|
9484
|
+
ref,
|
|
9485
|
+
"data-sidebar": "group-label",
|
|
9486
|
+
className: cn(
|
|
9487
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
9488
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
9489
|
+
className
|
|
9490
|
+
),
|
|
9491
|
+
...props
|
|
9492
|
+
}
|
|
9493
|
+
);
|
|
9494
|
+
});
|
|
9495
|
+
SidebarGroupLabelBase.displayName = "SidebarGroupLabelBase";
|
|
9496
|
+
var SidebarGroupActionBase = React37.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
9497
|
+
const Comp = asChild ? import_react_slot5.Slot : "button";
|
|
9498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9499
|
+
Comp,
|
|
9500
|
+
{
|
|
9501
|
+
ref,
|
|
9502
|
+
"data-sidebar": "group-action",
|
|
9503
|
+
className: cn(
|
|
9504
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
9505
|
+
// Increases the hit area of the button on mobile.
|
|
9506
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
9507
|
+
"group-data-[collapsible=icon]:hidden",
|
|
9508
|
+
className
|
|
9509
|
+
),
|
|
9510
|
+
...props
|
|
9511
|
+
}
|
|
9512
|
+
);
|
|
9513
|
+
});
|
|
9514
|
+
SidebarGroupActionBase.displayName = "SidebarGroupActionBase";
|
|
9515
|
+
var SidebarGroupContentBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9516
|
+
"div",
|
|
9517
|
+
{
|
|
9518
|
+
ref,
|
|
9519
|
+
"data-sidebar": "group-content",
|
|
9520
|
+
className: cn("w-full text-sm", className),
|
|
9521
|
+
...props
|
|
9522
|
+
}
|
|
9523
|
+
));
|
|
9524
|
+
SidebarGroupContentBase.displayName = "SidebarGroupContentBase";
|
|
9525
|
+
var SidebarMenuBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9526
|
+
"ul",
|
|
9527
|
+
{
|
|
9528
|
+
ref,
|
|
9529
|
+
"data-sidebar": "menu",
|
|
9530
|
+
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
9531
|
+
...props
|
|
9532
|
+
}
|
|
9533
|
+
));
|
|
9534
|
+
SidebarMenuBase.displayName = "SidebarMenuBase";
|
|
9535
|
+
var SidebarMenuItemBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9536
|
+
"li",
|
|
9537
|
+
{
|
|
9538
|
+
ref,
|
|
9539
|
+
"data-sidebar": "menu-item",
|
|
9540
|
+
className: cn("group/menu-item relative", className),
|
|
9541
|
+
...props
|
|
9542
|
+
}
|
|
9543
|
+
));
|
|
9544
|
+
SidebarMenuItemBase.displayName = "SidebarMenuItemBase";
|
|
9545
|
+
var sidebarMenuButtonVariants = (0, import_class_variance_authority5.cva)(
|
|
9546
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
9547
|
+
{
|
|
9548
|
+
variants: {
|
|
9549
|
+
variant: {
|
|
9550
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
9551
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
9552
|
+
},
|
|
9553
|
+
size: {
|
|
9554
|
+
default: "h-8 text-sm",
|
|
9555
|
+
sm: "h-7 text-xs",
|
|
9556
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0"
|
|
9557
|
+
}
|
|
9558
|
+
},
|
|
9559
|
+
defaultVariants: {
|
|
9560
|
+
variant: "default",
|
|
9561
|
+
size: "default"
|
|
9562
|
+
}
|
|
9563
|
+
}
|
|
9564
|
+
);
|
|
9565
|
+
var SidebarMenuButtonBase = React37.forwardRef(
|
|
9566
|
+
({
|
|
9567
|
+
asChild = false,
|
|
9568
|
+
isActive = false,
|
|
9569
|
+
variant = "default",
|
|
9570
|
+
size = "default",
|
|
9571
|
+
tooltip,
|
|
9572
|
+
className,
|
|
9573
|
+
...props
|
|
9574
|
+
}, ref) => {
|
|
9575
|
+
const Comp = asChild ? import_react_slot5.Slot : "button";
|
|
9576
|
+
const { isMobile, state } = UseSideBarBase();
|
|
9577
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9578
|
+
Comp,
|
|
9579
|
+
{
|
|
9580
|
+
ref,
|
|
9581
|
+
"data-sidebar": "menu-button",
|
|
9582
|
+
"data-size": size,
|
|
9583
|
+
"data-active": isActive,
|
|
9584
|
+
className: cn(sidebarMenuButtonVariants({ variant, size }), className),
|
|
9585
|
+
...props
|
|
9586
|
+
}
|
|
9587
|
+
);
|
|
9588
|
+
if (!tooltip) {
|
|
9589
|
+
return button;
|
|
9590
|
+
}
|
|
9591
|
+
if (typeof tooltip === "string") {
|
|
9592
|
+
tooltip = {
|
|
9593
|
+
children: tooltip
|
|
9594
|
+
};
|
|
9595
|
+
}
|
|
9596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(TooltipBase, { children: [
|
|
9597
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipTriggerBase, { asChild: true, children: button }),
|
|
9598
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9599
|
+
TooltipContentBase,
|
|
9600
|
+
{
|
|
9601
|
+
side: "right",
|
|
9602
|
+
align: "center",
|
|
9603
|
+
hidden: state !== "collapsed" || isMobile,
|
|
9604
|
+
...tooltip
|
|
9605
|
+
}
|
|
9606
|
+
)
|
|
9607
|
+
] });
|
|
9608
|
+
}
|
|
9609
|
+
);
|
|
9610
|
+
SidebarMenuButtonBase.displayName = "SidebarMenuButtonBase";
|
|
9611
|
+
var SidebarMenuActionBase = React37.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
9612
|
+
const Comp = asChild ? import_react_slot5.Slot : "button";
|
|
9613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9614
|
+
Comp,
|
|
9615
|
+
{
|
|
9616
|
+
ref,
|
|
9617
|
+
"data-sidebar": "menu-action",
|
|
9618
|
+
className: cn(
|
|
9619
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
9620
|
+
// Increases the hit area of the button on mobile.
|
|
9621
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
9622
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
9623
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
9624
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
9625
|
+
"group-data-[collapsible=icon]:hidden",
|
|
9626
|
+
showOnHover && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
|
9627
|
+
className
|
|
9628
|
+
),
|
|
9629
|
+
...props
|
|
9630
|
+
}
|
|
9631
|
+
);
|
|
9632
|
+
});
|
|
9633
|
+
SidebarMenuActionBase.displayName = "SidebarMenuActionBase";
|
|
9634
|
+
var SidebarMenuBadgeBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9635
|
+
"div",
|
|
9636
|
+
{
|
|
9637
|
+
ref,
|
|
9638
|
+
"data-sidebar": "menu-badge",
|
|
9639
|
+
className: cn(
|
|
9640
|
+
"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground",
|
|
9641
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
9642
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
9643
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
9644
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
9645
|
+
"group-data-[collapsible=icon]:hidden",
|
|
9646
|
+
className
|
|
9647
|
+
),
|
|
9648
|
+
...props
|
|
9649
|
+
}
|
|
9650
|
+
));
|
|
9651
|
+
SidebarMenuBadgeBase.displayName = "SidebarMenuBadgeBase";
|
|
9652
|
+
var SidebarMenuSkeletonBase = React37.forwardRef(({ className, showIcon = false, ...props }, ref) => {
|
|
9653
|
+
const width = React37.useMemo(() => {
|
|
9654
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
9655
|
+
}, []);
|
|
9656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
9657
|
+
"div",
|
|
9658
|
+
{
|
|
9659
|
+
ref,
|
|
9660
|
+
"data-sidebar": "menu-skeleton",
|
|
9661
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
9662
|
+
...props,
|
|
9663
|
+
children: [
|
|
9664
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9665
|
+
SkeletonBase,
|
|
9666
|
+
{
|
|
9667
|
+
className: "size-4 rounded-md",
|
|
9668
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
9669
|
+
}
|
|
9670
|
+
),
|
|
9671
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9672
|
+
SkeletonBase,
|
|
9673
|
+
{
|
|
9674
|
+
className: "h-4 max-w-[--skeleton-width] flex-1",
|
|
9675
|
+
"data-sidebar": "menu-skeleton-text",
|
|
9676
|
+
style: {
|
|
9677
|
+
"--skeleton-width": width
|
|
9678
|
+
}
|
|
9679
|
+
}
|
|
9680
|
+
)
|
|
9681
|
+
]
|
|
9682
|
+
}
|
|
9683
|
+
);
|
|
9684
|
+
});
|
|
9685
|
+
SidebarMenuSkeletonBase.displayName = "SidebarMenuSkeletonBase";
|
|
9686
|
+
var SidebarMenuSubBase = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9687
|
+
"ul",
|
|
9688
|
+
{
|
|
9689
|
+
ref,
|
|
9690
|
+
"data-sidebar": "menu-sub",
|
|
9691
|
+
className: cn(
|
|
9692
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
|
|
9693
|
+
"group-data-[collapsible=icon]:hidden",
|
|
9694
|
+
className
|
|
9695
|
+
),
|
|
9696
|
+
...props
|
|
9697
|
+
}
|
|
9698
|
+
));
|
|
9699
|
+
SidebarMenuSubBase.displayName = "SidebarMenuSubBase";
|
|
9700
|
+
var SidebarMenuSubItemBase = React37.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("li", { ref, ...props }));
|
|
9701
|
+
SidebarMenuSubItemBase.displayName = "SidebarMenuSubItemBase";
|
|
9702
|
+
var SidebarMenuSubButtonBase = React37.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
9703
|
+
const Comp = asChild ? import_react_slot5.Slot : "a";
|
|
9704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9705
|
+
Comp,
|
|
9706
|
+
{
|
|
9707
|
+
ref,
|
|
9708
|
+
"data-sidebar": "menu-sub-button",
|
|
9709
|
+
"data-size": size,
|
|
9710
|
+
"data-active": isActive,
|
|
9711
|
+
className: cn(
|
|
9712
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
9713
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
9714
|
+
size === "sm" && "text-xs",
|
|
9715
|
+
size === "md" && "text-sm",
|
|
9716
|
+
"group-data-[collapsible=icon]:hidden",
|
|
9717
|
+
className
|
|
9718
|
+
),
|
|
9719
|
+
...props
|
|
9720
|
+
}
|
|
9721
|
+
);
|
|
9722
|
+
});
|
|
9723
|
+
SidebarMenuSubButtonBase.displayName = "SidebarMenuSubButtonBase";
|
|
9724
|
+
|
|
9725
|
+
// src/components/ui/overlays/DrawerBase.tsx
|
|
9726
|
+
var import_vaul = require("vaul");
|
|
9727
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
9728
|
+
function DrawerBase({
|
|
9729
|
+
...props
|
|
9730
|
+
}) {
|
|
9731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_vaul.Drawer.Root, { "data-slot": "drawer", ...props });
|
|
9732
|
+
}
|
|
9733
|
+
function DrawerTriggerBase({
|
|
9734
|
+
...props
|
|
9735
|
+
}) {
|
|
9736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_vaul.Drawer.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
9737
|
+
}
|
|
9738
|
+
function DrawerPortalBase({
|
|
9739
|
+
...props
|
|
9740
|
+
}) {
|
|
9741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
|
|
9742
|
+
}
|
|
9743
|
+
function DrawerCloseBase({
|
|
9744
|
+
...props
|
|
9745
|
+
}) {
|
|
9746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_vaul.Drawer.Close, { "data-slot": "drawer-close", ...props });
|
|
9747
|
+
}
|
|
9748
|
+
function DrawerOverlayBase({
|
|
9749
|
+
className,
|
|
9750
|
+
...props
|
|
9751
|
+
}) {
|
|
9752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9753
|
+
import_vaul.Drawer.Overlay,
|
|
9754
|
+
{
|
|
9755
|
+
"data-slot": "drawer-overlay",
|
|
9756
|
+
className: cn(
|
|
9757
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
9758
|
+
className
|
|
9759
|
+
),
|
|
9760
|
+
...props
|
|
9761
|
+
}
|
|
9762
|
+
);
|
|
9763
|
+
}
|
|
9764
|
+
function DrawerContentBase({
|
|
9765
|
+
className,
|
|
9766
|
+
children,
|
|
9767
|
+
...props
|
|
9768
|
+
}) {
|
|
9769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(DrawerPortalBase, { children: [
|
|
9770
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DrawerOverlayBase, {}),
|
|
9771
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
9772
|
+
import_vaul.Drawer.Content,
|
|
9773
|
+
{
|
|
9774
|
+
"data-slot": "drawer-content",
|
|
9775
|
+
className: cn(
|
|
9776
|
+
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
9777
|
+
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
9778
|
+
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
9779
|
+
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
9780
|
+
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
9781
|
+
className
|
|
9782
|
+
),
|
|
9783
|
+
...props,
|
|
9784
|
+
children: [
|
|
9785
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
9786
|
+
children
|
|
9787
|
+
]
|
|
9788
|
+
}
|
|
9789
|
+
)
|
|
9790
|
+
] });
|
|
9791
|
+
}
|
|
9792
|
+
function DrawerHeaderBase({
|
|
9793
|
+
className,
|
|
9794
|
+
...props
|
|
9795
|
+
}) {
|
|
9796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9797
|
+
"div",
|
|
9798
|
+
{
|
|
9799
|
+
"data-slot": "drawer-header",
|
|
9800
|
+
className: cn(
|
|
9801
|
+
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
9802
|
+
className
|
|
9803
|
+
),
|
|
9804
|
+
...props
|
|
9805
|
+
}
|
|
9806
|
+
);
|
|
9807
|
+
}
|
|
9808
|
+
function DrawerFooterBase({
|
|
9809
|
+
className,
|
|
9810
|
+
...props
|
|
9811
|
+
}) {
|
|
9812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9813
|
+
"div",
|
|
9814
|
+
{
|
|
9815
|
+
"data-slot": "drawer-footer",
|
|
9816
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
9817
|
+
...props
|
|
9818
|
+
}
|
|
9819
|
+
);
|
|
9820
|
+
}
|
|
9821
|
+
function DrawerTitleBase({
|
|
9822
|
+
className,
|
|
9823
|
+
...props
|
|
9824
|
+
}) {
|
|
9825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9826
|
+
import_vaul.Drawer.Title,
|
|
9827
|
+
{
|
|
9828
|
+
"data-slot": "drawer-title",
|
|
9829
|
+
className: cn("text-foreground font-semibold", className),
|
|
9830
|
+
...props
|
|
9831
|
+
}
|
|
9832
|
+
);
|
|
9833
|
+
}
|
|
9834
|
+
function DrawerDescriptionBase({
|
|
9835
|
+
className,
|
|
9836
|
+
...props
|
|
9837
|
+
}) {
|
|
9838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9839
|
+
import_vaul.Drawer.Description,
|
|
9840
|
+
{
|
|
9841
|
+
"data-slot": "drawer-description",
|
|
9842
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
9843
|
+
...props
|
|
9844
|
+
}
|
|
9845
|
+
);
|
|
9846
|
+
}
|
|
9847
|
+
|
|
9848
|
+
// src/hooks/use-universal-tooltip.tsx
|
|
9849
|
+
var import_react39 = require("react");
|
|
9850
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
9851
|
+
var UniversalTooltipContext = (0, import_react39.createContext)(null);
|
|
9852
|
+
var useUniversalTooltip = () => {
|
|
9853
|
+
const context = (0, import_react39.useContext)(UniversalTooltipContext);
|
|
9854
|
+
if (!context) {
|
|
9855
|
+
throw new Error("useUniversalTooltip deve ser usado dentro de UniversalTooltipProvider");
|
|
9856
|
+
}
|
|
9857
|
+
return context;
|
|
9858
|
+
};
|
|
9859
|
+
var useTooltip = () => {
|
|
9860
|
+
const { addTooltip, removeTooltip, startDrag } = useUniversalTooltip();
|
|
9861
|
+
const createTooltip = (0, import_react39.useCallback)((element, content, options) => {
|
|
9862
|
+
const rect = element.getBoundingClientRect();
|
|
9863
|
+
let position;
|
|
9864
|
+
switch (options?.position || "auto") {
|
|
9865
|
+
case "top":
|
|
9866
|
+
position = { top: rect.top - 10, left: rect.left + rect.width / 2 };
|
|
9867
|
+
break;
|
|
9868
|
+
case "bottom":
|
|
9869
|
+
position = { top: rect.bottom + 10, left: rect.left + rect.width / 2 };
|
|
9870
|
+
break;
|
|
9871
|
+
case "left":
|
|
9872
|
+
position = { top: rect.top + rect.height / 2, left: rect.left - 10 };
|
|
9873
|
+
break;
|
|
9874
|
+
case "right":
|
|
9875
|
+
position = { top: rect.top + rect.height / 2, left: rect.right + 10 };
|
|
9876
|
+
break;
|
|
9877
|
+
default:
|
|
9878
|
+
position = { top: rect.top - 10, left: rect.left + rect.width / 2 };
|
|
9879
|
+
}
|
|
9880
|
+
if (options?.offset) {
|
|
9881
|
+
position.top += options.offset.y;
|
|
9882
|
+
position.left += options.offset.x;
|
|
9883
|
+
}
|
|
9884
|
+
return addTooltip({
|
|
9885
|
+
position,
|
|
9886
|
+
content,
|
|
9887
|
+
sourceElement: element,
|
|
9888
|
+
metadata: options?.metadata
|
|
9889
|
+
});
|
|
9890
|
+
}, [addTooltip]);
|
|
9891
|
+
const handleElementMouseDown = (0, import_react39.useCallback)((tooltipId, event) => {
|
|
9892
|
+
const rect = event.target.getBoundingClientRect();
|
|
9893
|
+
const offset = {
|
|
9894
|
+
x: event.clientX - rect.left,
|
|
9895
|
+
y: event.clientY - rect.top
|
|
9896
|
+
};
|
|
9897
|
+
startDrag(tooltipId, offset);
|
|
9898
|
+
}, [startDrag]);
|
|
9899
|
+
return {
|
|
9900
|
+
createTooltip,
|
|
9901
|
+
removeTooltip,
|
|
9902
|
+
handleElementMouseDown
|
|
9903
|
+
};
|
|
9904
|
+
};
|
|
9905
|
+
|
|
9906
|
+
// src/components/ui/UniversalTooltipRenderer.tsx
|
|
9907
|
+
var import_ssr6 = require("@phosphor-icons/react/dist/ssr");
|
|
9908
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
9909
|
+
var UniversalTooltipRenderer = ({
|
|
9910
|
+
className,
|
|
9911
|
+
showCloseButton = true,
|
|
9912
|
+
showCloseAllButton = true,
|
|
9913
|
+
tooltipClassName,
|
|
9914
|
+
guideClassName,
|
|
9915
|
+
closeButtonClassName,
|
|
9916
|
+
closeAllButtonClassName
|
|
9917
|
+
}) => {
|
|
9918
|
+
const {
|
|
9919
|
+
tooltips,
|
|
9920
|
+
alignmentGuides,
|
|
9921
|
+
isDragging,
|
|
9922
|
+
clearAllTooltips
|
|
9923
|
+
} = useUniversalTooltip();
|
|
9924
|
+
const { removeTooltip, handleElementMouseDown } = useTooltip();
|
|
9925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: cn("fixed inset-0 pointer-events-none z-50", className), children: [
|
|
9926
|
+
showCloseAllButton && tooltips.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "fixed top-6 left-1/2 transform -translate-x-1/2 z-50 pointer-events-auto animate-in fade-in slide-in-from-top-2 duration-300", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
9927
|
+
"button",
|
|
9928
|
+
{
|
|
9929
|
+
onClick: clearAllTooltips,
|
|
9930
|
+
className: cn(
|
|
9931
|
+
"bg-red-500 hover:bg-red-600 text-white font-semibold text-sm px-4 py-2.5 rounded-full shadow-xl border border-white/20 backdrop-blur-sm transition-all duration-200 ease-in-out hover:scale-105 active:scale-95 hover:shadow-2xl",
|
|
9932
|
+
closeAllButtonClassName
|
|
9933
|
+
),
|
|
9934
|
+
children: [
|
|
9935
|
+
"Fechar Todos (",
|
|
9936
|
+
tooltips.length,
|
|
9937
|
+
")"
|
|
9938
|
+
]
|
|
9939
|
+
}
|
|
9940
|
+
) }),
|
|
9941
|
+
alignmentGuides.map((guide, index) => {
|
|
9942
|
+
const isHorizontal = guide.type === "horizontal";
|
|
9943
|
+
const color = isHorizontal ? "#3b82f6" : "#ef4444";
|
|
9944
|
+
const startX = isHorizontal ? Math.min(guide.sourceTooltip.left + guide.sourceTooltip.width / 2, guide.targetTooltip.left + guide.targetTooltip.width / 2) : guide.sourceTooltip.left + guide.sourceTooltip.width / 2;
|
|
9945
|
+
const endX = isHorizontal ? Math.max(guide.sourceTooltip.left + guide.sourceTooltip.width / 2, guide.targetTooltip.left + guide.targetTooltip.width / 2) : guide.targetTooltip.left + guide.targetTooltip.width / 2;
|
|
9946
|
+
const startY = isHorizontal ? guide.sourceTooltip.top + guide.sourceTooltip.height / 2 : Math.min(guide.sourceTooltip.top + guide.sourceTooltip.height / 2, guide.targetTooltip.top + guide.targetTooltip.height / 2);
|
|
9947
|
+
const endY = isHorizontal ? guide.targetTooltip.top + guide.targetTooltip.height / 2 : Math.max(guide.sourceTooltip.top + guide.sourceTooltip.height / 2, guide.targetTooltip.top + guide.targetTooltip.height / 2);
|
|
9948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "pointer-events-none", children: [
|
|
9949
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
9950
|
+
"div",
|
|
9951
|
+
{
|
|
9952
|
+
className: cn("fixed z-30", guideClassName),
|
|
9953
|
+
style: {
|
|
9954
|
+
left: startX,
|
|
9955
|
+
top: startY,
|
|
9956
|
+
width: isHorizontal ? endX - startX : "2px",
|
|
9957
|
+
height: isHorizontal ? "2px" : endY - startY,
|
|
9958
|
+
backgroundColor: color,
|
|
9959
|
+
boxShadow: `0 0 8px ${color}60`,
|
|
9960
|
+
opacity: 0.9,
|
|
9961
|
+
borderStyle: "dashed",
|
|
9962
|
+
borderWidth: "1px",
|
|
9963
|
+
borderColor: color,
|
|
9964
|
+
transform: "translateZ(0)"
|
|
9965
|
+
}
|
|
9966
|
+
}
|
|
9967
|
+
),
|
|
9968
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
9969
|
+
"div",
|
|
9970
|
+
{
|
|
9971
|
+
className: "fixed z-31",
|
|
9972
|
+
style: {
|
|
9973
|
+
left: guide.sourceTooltip.left + guide.sourceTooltip.width / 2 - 4,
|
|
9974
|
+
top: guide.sourceTooltip.top + guide.sourceTooltip.height / 2 - 4,
|
|
9975
|
+
width: "8px",
|
|
9976
|
+
height: "8px",
|
|
9977
|
+
backgroundColor: color,
|
|
9978
|
+
borderRadius: "50%",
|
|
9979
|
+
boxShadow: `0 0 4px ${color}80`,
|
|
9980
|
+
opacity: 0.8
|
|
9981
|
+
}
|
|
9982
|
+
}
|
|
9983
|
+
),
|
|
9984
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
9985
|
+
"div",
|
|
9986
|
+
{
|
|
9987
|
+
className: "fixed z-31",
|
|
9988
|
+
style: {
|
|
9989
|
+
left: guide.targetTooltip.left + guide.targetTooltip.width / 2 - 4,
|
|
9990
|
+
top: guide.targetTooltip.top + guide.targetTooltip.height / 2 - 4,
|
|
9991
|
+
width: "8px",
|
|
9992
|
+
height: "8px",
|
|
9993
|
+
backgroundColor: color,
|
|
9994
|
+
borderRadius: "50%",
|
|
9995
|
+
boxShadow: `0 0 4px ${color}80`,
|
|
9996
|
+
opacity: 0.8
|
|
9997
|
+
}
|
|
9998
|
+
}
|
|
9999
|
+
)
|
|
10000
|
+
] }, index);
|
|
10001
|
+
}),
|
|
10002
|
+
tooltips.map((tooltip) => /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
10003
|
+
"div",
|
|
10004
|
+
{
|
|
10005
|
+
className: cn(
|
|
10006
|
+
"fixed bg-card border border-border rounded-lg shadow-lg min-w-56 select-none pointer-events-auto",
|
|
10007
|
+
isDragging === tooltip.id ? "cursor-grabbing z-60" : "cursor-grab z-50",
|
|
10008
|
+
tooltipClassName
|
|
10009
|
+
),
|
|
10010
|
+
style: {
|
|
10011
|
+
top: tooltip.position.top,
|
|
10012
|
+
left: tooltip.position.left
|
|
10013
|
+
},
|
|
10014
|
+
onMouseDown: (e) => handleElementMouseDown(tooltip.id, e),
|
|
10015
|
+
children: [
|
|
10016
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center justify-between p-3 border-b bg-muted/20 rounded-t-lg", children: [
|
|
10017
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10018
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "w-2 h-2 bg-primary rounded-full" }),
|
|
10019
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "text-sm font-medium text-muted-foreground", children: "Tooltip" })
|
|
10020
|
+
] }),
|
|
10021
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10022
|
+
"button",
|
|
10023
|
+
{
|
|
10024
|
+
onClick: (e) => {
|
|
10025
|
+
e.stopPropagation();
|
|
10026
|
+
removeTooltip(tooltip.id);
|
|
10027
|
+
},
|
|
10028
|
+
className: cn(
|
|
10029
|
+
"text-muted-foreground hover:text-foreground transition-colors p-1 hover:bg-muted rounded",
|
|
10030
|
+
closeButtonClassName
|
|
10031
|
+
),
|
|
10032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ssr6.XIcon, { size: 16 })
|
|
10033
|
+
}
|
|
10034
|
+
)
|
|
10035
|
+
] }),
|
|
10036
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "p-4", children: tooltip.content })
|
|
10037
|
+
]
|
|
10038
|
+
},
|
|
10039
|
+
tooltip.id
|
|
10040
|
+
))
|
|
10041
|
+
] });
|
|
10042
|
+
};
|
|
5343
10043
|
|
|
5344
10044
|
// src/hooks/use-drag.tsx
|
|
5345
|
-
var
|
|
10045
|
+
var import_react40 = require("react");
|
|
5346
10046
|
var useDrag = (options = {}) => {
|
|
5347
|
-
const [isDragging, setIsDragging] = (0,
|
|
5348
|
-
const [positions, setPositions] = (0,
|
|
5349
|
-
const dragStartPos = (0,
|
|
5350
|
-
const dragId = (0,
|
|
5351
|
-
const handleMouseDown = (0,
|
|
10047
|
+
const [isDragging, setIsDragging] = (0, import_react40.useState)(null);
|
|
10048
|
+
const [positions, setPositions] = (0, import_react40.useState)({});
|
|
10049
|
+
const dragStartPos = (0, import_react40.useRef)(null);
|
|
10050
|
+
const dragId = (0, import_react40.useRef)(null);
|
|
10051
|
+
const handleMouseDown = (0, import_react40.useCallback)((id, e) => {
|
|
5352
10052
|
e.preventDefault();
|
|
5353
10053
|
const currentPosition = positions[id] || { top: 0, left: 0 };
|
|
5354
10054
|
dragStartPos.current = {
|
|
@@ -5361,7 +10061,7 @@ var useDrag = (options = {}) => {
|
|
|
5361
10061
|
setIsDragging(id);
|
|
5362
10062
|
options.onDragStart?.(id);
|
|
5363
10063
|
}, [positions, options]);
|
|
5364
|
-
const handleMouseMove = (0,
|
|
10064
|
+
const handleMouseMove = (0, import_react40.useCallback)((e) => {
|
|
5365
10065
|
if (!isDragging || !dragStartPos.current || !dragId.current) return;
|
|
5366
10066
|
const deltaX = e.clientX - dragStartPos.current.x;
|
|
5367
10067
|
const deltaY = e.clientY - dragStartPos.current.y;
|
|
@@ -5377,7 +10077,7 @@ var useDrag = (options = {}) => {
|
|
|
5377
10077
|
}));
|
|
5378
10078
|
options.onDrag?.(dragId.current, newPosition);
|
|
5379
10079
|
}, [isDragging, options]);
|
|
5380
|
-
const handleMouseUp = (0,
|
|
10080
|
+
const handleMouseUp = (0, import_react40.useCallback)(() => {
|
|
5381
10081
|
if (dragId.current) {
|
|
5382
10082
|
options.onDragEnd?.(dragId.current);
|
|
5383
10083
|
}
|
|
@@ -5385,7 +10085,7 @@ var useDrag = (options = {}) => {
|
|
|
5385
10085
|
dragStartPos.current = null;
|
|
5386
10086
|
dragId.current = null;
|
|
5387
10087
|
}, [options]);
|
|
5388
|
-
(0,
|
|
10088
|
+
(0, import_react40.useEffect)(() => {
|
|
5389
10089
|
if (isDragging) {
|
|
5390
10090
|
document.addEventListener("mousemove", handleMouseMove);
|
|
5391
10091
|
document.addEventListener("mouseup", handleMouseUp);
|
|
@@ -5397,16 +10097,16 @@ var useDrag = (options = {}) => {
|
|
|
5397
10097
|
};
|
|
5398
10098
|
}
|
|
5399
10099
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
5400
|
-
const setPosition = (0,
|
|
10100
|
+
const setPosition = (0, import_react40.useCallback)((id, position) => {
|
|
5401
10101
|
setPositions((prev) => ({
|
|
5402
10102
|
...prev,
|
|
5403
10103
|
[id]: position
|
|
5404
10104
|
}));
|
|
5405
10105
|
}, []);
|
|
5406
|
-
const getPosition = (0,
|
|
10106
|
+
const getPosition = (0, import_react40.useCallback)((id) => {
|
|
5407
10107
|
return positions[id] || { top: 0, left: 0 };
|
|
5408
10108
|
}, [positions]);
|
|
5409
|
-
const isElementDragging = (0,
|
|
10109
|
+
const isElementDragging = (0, import_react40.useCallback)((id) => {
|
|
5410
10110
|
return isDragging === id;
|
|
5411
10111
|
}, [isDragging]);
|
|
5412
10112
|
return {
|