@mlw-packages/react-components 1.7.12 → 1.7.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.css CHANGED
@@ -729,6 +729,9 @@ body {
729
729
  .ml-5 {
730
730
  margin-left: 1.25rem;
731
731
  }
732
+ .ml-6 {
733
+ margin-left: 1.5rem;
734
+ }
732
735
  .ml-64 {
733
736
  margin-left: 16rem;
734
737
  }
@@ -750,6 +753,9 @@ body {
750
753
  .mr-5 {
751
754
  margin-right: 1.25rem;
752
755
  }
756
+ .ms-6 {
757
+ margin-inline-start: 1.5rem;
758
+ }
753
759
  .mt-1 {
754
760
  margin-top: 0.25rem;
755
761
  }
@@ -1523,6 +1529,11 @@ body {
1523
1529
  .list-none {
1524
1530
  list-style-type: none;
1525
1531
  }
1532
+ .appearance-none {
1533
+ -webkit-appearance: none;
1534
+ -moz-appearance: none;
1535
+ appearance: none;
1536
+ }
1526
1537
  .auto-cols-fr {
1527
1538
  grid-auto-columns: minmax(0, 1fr);
1528
1539
  }
@@ -2631,6 +2642,9 @@ body {
2631
2642
  .pe-4 {
2632
2643
  padding-inline-end: 1rem;
2633
2644
  }
2645
+ .pl-1 {
2646
+ padding-left: 0.25rem;
2647
+ }
2634
2648
  .pl-3 {
2635
2649
  padding-left: 0.75rem;
2636
2650
  }
@@ -3783,6 +3797,14 @@ body {
3783
3797
  .last\:border-r-0:last-child {
3784
3798
  border-right-width: 0px;
3785
3799
  }
3800
+ .checked\:border-blue-600:checked {
3801
+ --tw-border-opacity: 1;
3802
+ border-color: rgb(37 99 235 / var(--tw-border-opacity, 1));
3803
+ }
3804
+ .checked\:bg-blue-600:checked {
3805
+ --tw-bg-opacity: 1;
3806
+ background-color: rgb(37 99 235 / var(--tw-bg-opacity, 1));
3807
+ }
3786
3808
  .focus-within\:relative:focus-within {
3787
3809
  position: relative;
3788
3810
  }
@@ -3977,6 +3999,10 @@ body {
3977
3999
  .hover\:bg-sky-200\/40:hover {
3978
4000
  background-color: rgb(186 230 253 / 0.4);
3979
4001
  }
4002
+ .hover\:bg-slate-100:hover {
4003
+ --tw-bg-opacity: 1;
4004
+ background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));
4005
+ }
3980
4006
  .hover\:bg-violet-200\/40:hover {
3981
4007
  background-color: rgb(221 214 254 / 0.4);
3982
4008
  }
@@ -4691,9 +4717,6 @@ body {
4691
4717
  --tw-bg-opacity: 1;
4692
4718
  background-color: rgb(167 139 250 / var(--tw-bg-opacity, 1));
4693
4719
  }
4694
- .data-\[state\=indeterminate\]\:bg-primary[data-state=indeterminate] {
4695
- background-color: hsl(var(--primary));
4696
- }
4697
4720
  .data-\[state\=open\]\:bg-accent[data-state=open] {
4698
4721
  background-color: hsl(var(--accent));
4699
4722
  }
@@ -4740,12 +4763,6 @@ body {
4740
4763
  .data-\[state\=active\]\:text-primary[data-state=active] {
4741
4764
  color: hsl(var(--primary));
4742
4765
  }
4743
- .data-\[state\=checked\]\:text-primary-foreground[data-state=checked] {
4744
- color: hsl(var(--primary-foreground));
4745
- }
4746
- .data-\[state\=indeterminate\]\:text-primary-foreground[data-state=indeterminate] {
4747
- color: hsl(var(--primary-foreground));
4748
- }
4749
4766
  .data-\[state\=open\]\:text-accent-foreground[data-state=open] {
4750
4767
  color: hsl(var(--accent-foreground));
4751
4768
  }
@@ -5016,12 +5033,6 @@ body {
5016
5033
  .group\/navigation-menu[data-viewport=false] .group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5 {
5017
5034
  margin-top: 0.375rem;
5018
5035
  }
5019
- .group[data-state=checked] .group-data-\[state\=checked\]\:block {
5020
- display: block;
5021
- }
5022
- .group[data-state=indeterminate] .group-data-\[state\=indeterminate\]\:block {
5023
- display: block;
5024
- }
5025
5036
  .group\/drawer-content[data-vaul-drawer-direction=bottom] .group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block {
5026
5037
  display: block;
5027
5038
  }
@@ -5290,6 +5301,10 @@ body {
5290
5301
  .dark\:bg-slate-800\/60:is(.dark *) {
5291
5302
  background-color: rgb(30 41 59 / 0.6);
5292
5303
  }
5304
+ .dark\:bg-slate-900:is(.dark *) {
5305
+ --tw-bg-opacity: 1;
5306
+ background-color: rgb(15 23 42 / var(--tw-bg-opacity, 1));
5307
+ }
5293
5308
  .dark\:bg-slate-900\/30:is(.dark *) {
5294
5309
  background-color: rgb(15 23 42 / 0.3);
5295
5310
  }
@@ -5438,6 +5453,10 @@ body {
5438
5453
  --tw-bg-opacity: 1;
5439
5454
  background-color: rgb(51 65 85 / var(--tw-bg-opacity, 1));
5440
5455
  }
5456
+ .dark\:hover\:bg-slate-800:hover:is(.dark *) {
5457
+ --tw-bg-opacity: 1;
5458
+ background-color: rgb(30 41 59 / var(--tw-bg-opacity, 1));
5459
+ }
5441
5460
  .dark\:hover\:bg-violet-400\/20:hover:is(.dark *) {
5442
5461
  background-color: rgb(167 139 250 / 0.2);
5443
5462
  }
package/dist/index.d.mts CHANGED
@@ -1528,6 +1528,23 @@ interface WeekViewProps {
1528
1528
  }
1529
1529
  declare function WeekView({ currentDate, events, onEventSelect, onEventCreate, }: WeekViewProps): react_jsx_runtime.JSX.Element;
1530
1530
 
1531
+ interface TreeNode {
1532
+ id: string;
1533
+ label: string;
1534
+ defaultChecked?: boolean;
1535
+ children?: TreeNode[];
1536
+ }
1537
+ interface CheckboxTreeProps {
1538
+ tree: TreeNode;
1539
+ renderNode: (props: {
1540
+ node: TreeNode;
1541
+ isChecked: boolean | "indeterminate";
1542
+ onCheckedChange: () => void;
1543
+ children: React__default.ReactNode;
1544
+ }) => React__default.ReactNode;
1545
+ }
1546
+ declare function CheckboxTree({ tree, renderNode }: CheckboxTreeProps): React__default.ReactNode;
1547
+
1531
1548
  declare function useIsMobile(): boolean;
1532
1549
 
1533
1550
  interface Position {
@@ -1547,4 +1564,4 @@ declare const useDrag: (options?: UseDragOptions) => {
1547
1564
  isDragging: boolean;
1548
1565
  };
1549
1566
 
1550
- export { AddButton, AgendaDaysToShow, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, AvatarSelect, type AvatarSelectItem, BackButton, Badge, type BadgeColorType, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, CalendarDndProvider, type CalendarEvent, type CalendarProps, type CalendarView, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart, CheckButton, CheckboxBase, CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DebouncedInput, type DebouncedInputProps, DefaultEndHour, DefaultStartHour, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, EditButton, EndHour, ErrorMessage, EventCalendar, type EventColor, EventDialog, EventGap, EventHeight, EventItem, EventsPopup, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, StartHour, StatusIndicator, type StatusProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, WeekCellsHeight, WeekView, addHoursToDate, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getAgendaEventsForDay, getAllEventsForDay, getArrowByType, getBorderRadiusClasses, getDateByType, getEventColorClasses, getEventsForDay, getSpanningEventsForDay, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, toast, useCalendarDnd, useChartHighlights, useCurrentTimeIndicator, useDrag, useEventVisibility, useIsMobile, useTheme, type valueFormatter };
1567
+ export { AddButton, AgendaDaysToShow, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, AvatarSelect, type AvatarSelectItem, BackButton, Badge, type BadgeColorType, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, CalendarDndProvider, type CalendarEvent, type CalendarProps, type CalendarView, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DebouncedInput, type DebouncedInputProps, DefaultEndHour, DefaultStartHour, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, EditButton, EndHour, ErrorMessage, EventCalendar, type EventColor, EventDialog, EventGap, EventHeight, EventItem, EventsPopup, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, StartHour, StatusIndicator, type StatusProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, WeekCellsHeight, WeekView, addHoursToDate, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getAgendaEventsForDay, getAllEventsForDay, getArrowByType, getBorderRadiusClasses, getDateByType, getEventColorClasses, getEventsForDay, getSpanningEventsForDay, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, toast, useCalendarDnd, useChartHighlights, useCurrentTimeIndicator, useDrag, useEventVisibility, useIsMobile, useTheme, type valueFormatter };
package/dist/index.d.ts CHANGED
@@ -1528,6 +1528,23 @@ interface WeekViewProps {
1528
1528
  }
1529
1529
  declare function WeekView({ currentDate, events, onEventSelect, onEventCreate, }: WeekViewProps): react_jsx_runtime.JSX.Element;
1530
1530
 
1531
+ interface TreeNode {
1532
+ id: string;
1533
+ label: string;
1534
+ defaultChecked?: boolean;
1535
+ children?: TreeNode[];
1536
+ }
1537
+ interface CheckboxTreeProps {
1538
+ tree: TreeNode;
1539
+ renderNode: (props: {
1540
+ node: TreeNode;
1541
+ isChecked: boolean | "indeterminate";
1542
+ onCheckedChange: () => void;
1543
+ children: React__default.ReactNode;
1544
+ }) => React__default.ReactNode;
1545
+ }
1546
+ declare function CheckboxTree({ tree, renderNode }: CheckboxTreeProps): React__default.ReactNode;
1547
+
1531
1548
  declare function useIsMobile(): boolean;
1532
1549
 
1533
1550
  interface Position {
@@ -1547,4 +1564,4 @@ declare const useDrag: (options?: UseDragOptions) => {
1547
1564
  isDragging: boolean;
1548
1565
  };
1549
1566
 
1550
- export { AddButton, AgendaDaysToShow, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, AvatarSelect, type AvatarSelectItem, BackButton, Badge, type BadgeColorType, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, CalendarDndProvider, type CalendarEvent, type CalendarProps, type CalendarView, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart, CheckButton, CheckboxBase, CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DebouncedInput, type DebouncedInputProps, DefaultEndHour, DefaultStartHour, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, EditButton, EndHour, ErrorMessage, EventCalendar, type EventColor, EventDialog, EventGap, EventHeight, EventItem, EventsPopup, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, StartHour, StatusIndicator, type StatusProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, WeekCellsHeight, WeekView, addHoursToDate, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getAgendaEventsForDay, getAllEventsForDay, getArrowByType, getBorderRadiusClasses, getDateByType, getEventColorClasses, getEventsForDay, getSpanningEventsForDay, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, toast, useCalendarDnd, useChartHighlights, useCurrentTimeIndicator, useDrag, useEventVisibility, useIsMobile, useTheme, type valueFormatter };
1567
+ export { AddButton, AgendaDaysToShow, AgendaView, AlertDialogActionBase, AlertDialogBase, AlertDialogCancelBase, AlertDialogContentBase, AlertDialogDescriptionBase, AlertDialogFooterBase, AlertDialogHeaderBase, AlertDialogOverlayBase, AlertDialogPortalBase, AlertDialogTitleBase, AlertDialogTriggerBase, AvatarBase, AvatarFallbackBase, AvatarImageBase, AvatarSelect, type AvatarSelectItem, BackButton, Badge, type BadgeColorType, BarChart, BreadcrumbBase, BreadcrumbEllipsisBase, BreadcrumbItemBase, BreadcrumbLinkBase, BreadcrumbListBase, BreadcrumbPageBase, BreadcrumbSeparatorBase, ButtonBase, ButtonGroupBase, type ButtonProps, CalendarBase, CalendarDndProvider, type CalendarEvent, type CalendarProps, type CalendarView, CardBase, CardContentBase, CardDescriptionBase, CardFooterBase, CardHeaderBase, CardTitleBase, type CarouselApi, CarouselBase, CarouselContentBase, CarouselItemBase, CarouselNextBase, CarouselPreviousBase, ChangeButton, Chart, CheckButton, CheckboxBase, CheckboxTree, CloseAllButton, CloseButton, CodeBlock, CollapsibleBase, CollapsibleContentBase, CollapsibleTriggerBase, Combobox, type ComboboxProps, type ComboboxTestIds, CommandBase, CommandDialogBase, CommandEmptyBase, CommandGroupBase, CommandInputBase, CommandItemBase, CommandListBase, CommandSeparatorBase, CommandShortcutBase, ContextMenuBase, ContextMenuCheckboxItemBase, ContextMenuContentBase, ContextMenuGroupBase, ContextMenuItemBase, ContextMenuLabelBase, ContextMenuPortalBase, ContextMenuRadioGroupBase, ContextMenuRadioItemBase, ContextMenuSeparatorBase, ContextMenuShortcutBase, ContextMenuSubBase, ContextMenuSubContentBase, ContextMenuSubTriggerBase, ContextMenuTriggerBase, CopyButton, DateTimePicker, DayView, DebouncedInput, type DebouncedInputProps, DefaultEndHour, DefaultStartHour, DestructiveDialog, DialogBase, DialogCloseBase, DialogContentBase, DialogDescriptionBase, DialogFooterBase, DialogHeaderBase, DialogOverlayBase, DialogPortalBase, DialogTitleBase, DialogTriggerBase, DownloadButton, DraggableEvent, DraggableTooltip, DrawerBase, DrawerCloseBase, DrawerContentBase, DrawerDescriptionBase, DrawerFooterBase, DrawerHeaderBase, DrawerOverlayBase, DrawerPortalBase, DrawerTitleBase, DrawerTriggerBase, DropDownMenuBase, DropDownMenuCheckboxItemBase, DropDownMenuContentBase, DropDownMenuGroupBase, DropDownMenuItemBase, DropDownMenuLabelBase, DropDownMenuPortalBase, DropDownMenuRadioGroupBase, DropDownMenuRadioItemBase, DropDownMenuSeparatorBase, DropDownMenuShortcutBase, DropDownMenuSubBase, DropDownMenuSubContentBase, DropDownMenuSubTriggerBase, DropDownMenuTriggerBase, DroppableCell, EditButton, EndHour, ErrorMessage, EventCalendar, type EventColor, EventDialog, EventGap, EventHeight, EventItem, EventsPopup, FavoriteButton, FileUploader, type FileUploaderProps, type FileWithPreview, FilterButton, HideButton, Highlights, HoverCardBase, HoverCardContentBase, HoverCardTriggerBase, InputBase, type InputBaseProps, InputOTPBase, InputOTPGroupBase, InputOTPSeparatorBase, InputOTPSlotBase, LabelBase, LikeButton, CustomLineChart as LineChart, LoadingBase, LockButton, type Margins, ModalBase, ModalCloseBase, ModalContentBase, ModalDescriptionBase, ModalFooterBase, ModalHeaderBase, ModalOverlayBase, ModalPortalBase, ModalTitleBase, ModalTriggerBase, ModeToggleBase, MonthView, MoreButton, MultiCombobox, NavigationMenuBase, NavigationMenuContentBase, NavigationMenuIndicatorBase, NavigationMenuItemBase, NavigationMenuLinkBase, NavigationMenuListBase, NavigationMenuTriggerBase, NavigationMenuViewportBase, NotificationButton, type Padding, type Period, PeriodsDropdown, CustomPieChart as PieChart, PopoverAnchorBase, PopoverBase, PopoverContentBase, PopoverTriggerBase, ProgressBase, type ProgressBaseProps, ProgressCirclesBase, type ProgressCirclesBaseProps, ProgressPanelsBase, type ProgressPanelsBaseProps, ProgressSegmentsBase, type ProgressSegmentsBaseProps, type ProgressType, RangePicker, type RangePickerProps, RefreshButton, SaveButton, ScrollAreaBase, ScrollBarBase, SearchButton, Select, SelectBase, SelectContentBase, SelectGroupBase, type SelectItem, SelectItemBase, SelectLabelBase, SelectScrollDownButtonBase, SelectScrollUpButtonBase, SelectSeparatorBase, SelectTriggerBase, SelectValueBase, SeparatorBase, SettingsButton, SheetBase, SheetCloseBase, SheetContentBase, SheetDescriptionBase, SheetFooterBase, SheetHeaderBase, SheetOverlayBase, SheetPortalBase, SheetTitleBase, SheetTriggerBase, ShowOnly, SidebarBase, SidebarContentBase, SidebarFooterBase, SidebarGroupActionBase, SidebarGroupBase, SidebarGroupContentBase, SidebarGroupLabelBase, SidebarHeaderBase, SidebarInputBase, SidebarInsetBase, SidebarMenuActionBase, SidebarMenuBadgeBase, SidebarMenuBase, SidebarMenuButtonBase, SidebarMenuItemBase, SidebarMenuSkeletonBase, SidebarMenuSubBase, SidebarMenuSubButtonBase, SidebarMenuSubItemBase, SidebarProviderBase, SidebarRailBase, SidebarSeparatorBase, SidebarTriggerBase, SkeletonBase, SlideBase, type SliderBaseProps, StartHour, StatusIndicator, type StatusProps, SwitchBase, TableBase, TableBodyBase, TableCaptionBase, TableCellBase, TableFooterBase, TableHeadBase, TableHeaderBase, TableRowBase, TabsBase, TabsContentBase, TabsListBase, TabsTriggerBase, TextAreaBase, type TextAreaBaseProps, type Theme, ThemeProviderBase, TimePicker, TimePickerInput, type TimePickerInputProps, type TimePickerType, Toaster, TooltipBase, TooltipContentBase, TooltipProviderBase, TooltipSimple, TooltipTriggerBase, RechartTooltipWithTotal as TooltipWithTotal, UniversalTooltipRenderer, UnlockButton, UploadButton, UseSideBarBase, ViewButton, VisibilityButton, WeekCellsHeight, WeekView, addHoursToDate, badgeVariants, buttonVariantsBase, compactTick, convert12HourTo24Hour, detectDataFields, detectXAxis, display12HourValue, formatFieldName, generateAdditionalColors, getAgendaEventsForDay, getAllEventsForDay, getArrowByType, getBorderRadiusClasses, getDateByType, getEventColorClasses, getEventsForDay, getSpanningEventsForDay, getValid12Hour, getValidArrow12Hour, getValidArrowHour, getValidArrowMinuteOrSecond, getValidArrowNumber, getValidHour, getValidMinuteOrSecond, getValidNumber, isMultiDayEvent, isValid12Hour, isValidHour, isValidMinuteOrSecond, niceCeil, renderPillLabel, resolveChartMargins, resolveContainerPaddingLeft, set12Hours, setDateByType, setHours, setMinutes, setSeconds, sortEvents, toast, useCalendarDnd, useChartHighlights, useCurrentTimeIndicator, useDrag, useEventVisibility, useIsMobile, useTheme, type valueFormatter };
package/dist/index.js CHANGED
@@ -532,6 +532,7 @@ __export(index_exports, {
532
532
  Chart: () => Chart_default,
533
533
  CheckButton: () => CheckButton,
534
534
  CheckboxBase: () => CheckboxBase,
535
+ CheckboxTree: () => CheckboxTree,
535
536
  CloseAllButton: () => CloseAllButton_default,
536
537
  CloseButton: () => CloseButton,
537
538
  CodeBlock: () => CodeBlock,
@@ -7527,44 +7528,50 @@ var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
7527
7528
  var import_react30 = require("@phosphor-icons/react");
7528
7529
  var import_framer_motion11 = require("framer-motion");
7529
7530
  var import_jsx_runtime44 = require("react/jsx-runtime");
7530
- var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7531
- CheckboxPrimitive.Root,
7532
- {
7533
- ref,
7534
- className: cn(
7535
- "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 data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground transition-colors",
7536
- className
7537
- ),
7538
- "data-testid": dataTestId,
7539
- ...props,
7540
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7541
- import_framer_motion11.motion.div,
7542
- {
7543
- initial: { scale: 0, opacity: 0, rotate: -90 },
7544
- animate: { scale: 1, opacity: 1, rotate: 0 },
7545
- exit: { scale: 0, opacity: 0, rotate: 90 },
7546
- transition: { type: "spring", stiffness: 500, damping: 30 },
7547
- className: "flex items-center justify-center text-current group",
7548
- children: [
7549
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7550
- import_react30.CheckIcon,
7551
- {
7552
- className: "h-4 w-4 hidden group-data-[state=checked]:block",
7553
- weight: "bold"
7554
- }
7555
- ),
7556
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7557
- import_react30.MinusIcon,
7558
- {
7559
- className: "h-4 w-4 hidden group-data-[state=indeterminate]:block",
7560
- weight: "bold"
7561
- }
7562
- )
7563
- ]
7564
- }
7565
- ) })
7566
- }
7567
- ));
7531
+ var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", checked: checkedProp, defaultChecked, onCheckedChange, ...props }, ref) => {
7532
+ const isControlled = checkedProp !== void 0;
7533
+ const [checkedState, setCheckedState] = React24.useState(
7534
+ isControlled ? checkedProp : defaultChecked ?? false
7535
+ );
7536
+ React24.useEffect(() => {
7537
+ if (isControlled) setCheckedState(checkedProp);
7538
+ }, [checkedProp, isControlled]);
7539
+ const handleCheckedChange = (next) => {
7540
+ if (!isControlled) setCheckedState(next);
7541
+ onCheckedChange?.(next);
7542
+ };
7543
+ const stateClass = checkedState === true || checkedState === "indeterminate" ? "bg-primary text-primary-foreground" : "";
7544
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
7545
+ CheckboxPrimitive.Root,
7546
+ {
7547
+ ref,
7548
+ checked: checkedProp,
7549
+ defaultChecked,
7550
+ onCheckedChange: handleCheckedChange,
7551
+ className: cn(
7552
+ "group 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 transition-colors",
7553
+ stateClass,
7554
+ className
7555
+ ),
7556
+ "data-testid": dataTestId,
7557
+ ...props,
7558
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7559
+ import_framer_motion11.motion.div,
7560
+ {
7561
+ initial: { scale: 0, opacity: 0, rotate: -90 },
7562
+ animate: { scale: 1, opacity: 1, rotate: 0 },
7563
+ exit: { scale: 0, opacity: 0, rotate: 90 },
7564
+ transition: { type: "spring", stiffness: 500, damping: 30 },
7565
+ className: "flex items-center justify-center text-current",
7566
+ children: [
7567
+ checkedState === true && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react30.CheckIcon, { className: "h-4 w-4", weight: "bold" }),
7568
+ checkedState === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react30.MinusIcon, { className: "h-4 w-4", weight: "bold" })
7569
+ ]
7570
+ }
7571
+ ) })
7572
+ }
7573
+ );
7574
+ });
7568
7575
  CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
7569
7576
 
7570
7577
  // src/components/ui/form/CollapsibleBase.tsx
@@ -14481,14 +14488,164 @@ function WeekView({
14481
14488
  ] });
14482
14489
  }
14483
14490
 
14484
- // src/hooks/use-drag.tsx
14491
+ // src/components/ui/form/CheckBoxThree.tsx
14485
14492
  var import_react69 = require("react");
14493
+ var import_framer_motion19 = require("framer-motion");
14494
+ var import_jsx_runtime83 = require("react/jsx-runtime");
14495
+ function useCheckboxTree(initialTree) {
14496
+ const initialCheckedNodes = (0, import_react69.useMemo)(() => {
14497
+ const checkedSet = /* @__PURE__ */ new Set();
14498
+ const initializeCheckedNodes = (node) => {
14499
+ if (node.defaultChecked) {
14500
+ checkedSet.add(node.id);
14501
+ }
14502
+ node.children?.forEach(initializeCheckedNodes);
14503
+ };
14504
+ initializeCheckedNodes(initialTree);
14505
+ return checkedSet;
14506
+ }, [initialTree]);
14507
+ const [checkedNodes, setCheckedNodes] = (0, import_react69.useState)(initialCheckedNodes);
14508
+ const isChecked = (0, import_react69.useCallback)(
14509
+ (node) => {
14510
+ if (!node.children) {
14511
+ return checkedNodes.has(node.id);
14512
+ }
14513
+ const childrenChecked = node.children.map((child) => isChecked(child));
14514
+ if (childrenChecked.every((status) => status === true)) {
14515
+ return true;
14516
+ }
14517
+ if (childrenChecked.some(
14518
+ (status) => status === true || status === "indeterminate"
14519
+ )) {
14520
+ return "indeterminate";
14521
+ }
14522
+ return false;
14523
+ },
14524
+ [checkedNodes]
14525
+ );
14526
+ const handleCheck = (0, import_react69.useCallback)(
14527
+ (node) => {
14528
+ const newCheckedNodes = new Set(checkedNodes);
14529
+ const toggleNode = (n, check) => {
14530
+ if (check) {
14531
+ newCheckedNodes.add(n.id);
14532
+ } else {
14533
+ newCheckedNodes.delete(n.id);
14534
+ }
14535
+ for (const child of n.children ?? []) {
14536
+ toggleNode(child, check);
14537
+ }
14538
+ };
14539
+ const currentStatus = isChecked(node);
14540
+ const newCheck = currentStatus !== true;
14541
+ toggleNode(node, newCheck);
14542
+ setCheckedNodes(newCheckedNodes);
14543
+ },
14544
+ [checkedNodes, isChecked]
14545
+ );
14546
+ return { handleCheck, isChecked };
14547
+ }
14548
+ function CheckboxTree({ tree, renderNode }) {
14549
+ const { isChecked, handleCheck } = useCheckboxTree(tree);
14550
+ const DefaultNode = ({
14551
+ node,
14552
+ isChecked: status,
14553
+ onCheckedChange,
14554
+ children
14555
+ }) => {
14556
+ const [open, setOpen] = (0, import_react69.useState)(() => !!node.children && status !== false);
14557
+ const checkboxRef = (0, import_react69.useRef)(null);
14558
+ (0, import_react69.useEffect)(() => {
14559
+ if (checkboxRef.current) {
14560
+ checkboxRef.current.indeterminate = status === "indeterminate";
14561
+ }
14562
+ if (node.children) {
14563
+ setOpen(status !== false);
14564
+ }
14565
+ }, [status, node.children]);
14566
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "pl-1", children: [
14567
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "flex items-center gap-2", children: [
14568
+ node.children ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
14569
+ "button",
14570
+ {
14571
+ "aria-label": open ? "Fechar" : "Abrir",
14572
+ onClick: () => setOpen((v) => !v),
14573
+ className: "w-6 h-6 flex items-center justify-center rounded hover:bg-slate-100 dark:hover:bg-slate-800",
14574
+ children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
14575
+ import_framer_motion19.motion.span,
14576
+ {
14577
+ animate: { rotate: open ? 90 : 0 },
14578
+ transition: { duration: 0.18 },
14579
+ className: "inline-block text-slate-500",
14580
+ children: "\u25B6"
14581
+ }
14582
+ )
14583
+ }
14584
+ ) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "w-6 h-6" }),
14585
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
14586
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "relative", children: [
14587
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
14588
+ "input",
14589
+ {
14590
+ ref: checkboxRef,
14591
+ type: "checkbox",
14592
+ checked: status === true,
14593
+ onChange: onCheckedChange,
14594
+ className: "appearance-none w-5 h-5 rounded border border-slate-300 dark:border-slate-700 flex items-center justify-center bg-white dark:bg-slate-900 checked:bg-blue-600 checked:border-blue-600 focus:outline-none"
14595
+ }
14596
+ ),
14597
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
14598
+ import_framer_motion19.motion.span,
14599
+ {
14600
+ initial: false,
14601
+ animate: { scale: status === true ? 1 : 0.8, opacity: status === true ? 1 : 0 },
14602
+ transition: { duration: 0.14 },
14603
+ className: "pointer-events-none absolute left-0 top-0 w-5 h-5 flex items-center justify-center text-white",
14604
+ children: status === true ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("svg", { width: "12", height: "10", viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("path", { d: "M1 5L4 8L11 1", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : null
14605
+ }
14606
+ )
14607
+ ] }),
14608
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "text-sm text-slate-700 dark:text-slate-200", children: node.label })
14609
+ ] })
14610
+ ] }),
14611
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_framer_motion19.AnimatePresence, { initial: false, children: open && node.children && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
14612
+ import_framer_motion19.motion.div,
14613
+ {
14614
+ initial: { height: 0, opacity: 0 },
14615
+ animate: { height: "auto", opacity: 1 },
14616
+ exit: { height: 0, opacity: 0 },
14617
+ transition: { duration: 0.18 },
14618
+ className: "ml-6 mt-2 overflow-hidden",
14619
+ children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "flex flex-col gap-1", children })
14620
+ },
14621
+ "children"
14622
+ ) })
14623
+ ] });
14624
+ };
14625
+ const renderTreeNode = (node) => {
14626
+ const children = node.children?.map(renderTreeNode);
14627
+ const nodePayload = {
14628
+ children,
14629
+ isChecked: isChecked(node),
14630
+ node,
14631
+ onCheckedChange: () => handleCheck(node)
14632
+ };
14633
+ if (renderNode) {
14634
+ return renderNode(nodePayload);
14635
+ }
14636
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(DefaultNode, { ...nodePayload });
14637
+ };
14638
+ return renderTreeNode(tree);
14639
+ }
14640
+
14641
+ // src/hooks/use-drag.tsx
14642
+ var import_react70 = require("react");
14486
14643
  var useDrag = (options = {}) => {
14487
- const [isDragging, setIsDragging] = (0, import_react69.useState)(null);
14488
- const [positions, setPositions] = (0, import_react69.useState)({});
14489
- const dragStartPos = (0, import_react69.useRef)(null);
14490
- const dragId = (0, import_react69.useRef)(null);
14491
- const handleMouseDown = (0, import_react69.useCallback)((id, e) => {
14644
+ const [isDragging, setIsDragging] = (0, import_react70.useState)(null);
14645
+ const [positions, setPositions] = (0, import_react70.useState)({});
14646
+ const dragStartPos = (0, import_react70.useRef)(null);
14647
+ const dragId = (0, import_react70.useRef)(null);
14648
+ const handleMouseDown = (0, import_react70.useCallback)((id, e) => {
14492
14649
  e.preventDefault();
14493
14650
  const currentPosition = positions[id] || { top: 0, left: 0 };
14494
14651
  dragStartPos.current = {
@@ -14501,7 +14658,7 @@ var useDrag = (options = {}) => {
14501
14658
  setIsDragging(id);
14502
14659
  options.onDragStart?.(id);
14503
14660
  }, [positions, options]);
14504
- const handleMouseMove = (0, import_react69.useCallback)((e) => {
14661
+ const handleMouseMove = (0, import_react70.useCallback)((e) => {
14505
14662
  if (!isDragging || !dragStartPos.current || !dragId.current) return;
14506
14663
  const deltaX = e.clientX - dragStartPos.current.x;
14507
14664
  const deltaY = e.clientY - dragStartPos.current.y;
@@ -14517,7 +14674,7 @@ var useDrag = (options = {}) => {
14517
14674
  }));
14518
14675
  options.onDrag?.(dragId.current, newPosition);
14519
14676
  }, [isDragging, options]);
14520
- const handleMouseUp = (0, import_react69.useCallback)(() => {
14677
+ const handleMouseUp = (0, import_react70.useCallback)(() => {
14521
14678
  if (dragId.current) {
14522
14679
  options.onDragEnd?.(dragId.current);
14523
14680
  }
@@ -14525,7 +14682,7 @@ var useDrag = (options = {}) => {
14525
14682
  dragStartPos.current = null;
14526
14683
  dragId.current = null;
14527
14684
  }, [options]);
14528
- (0, import_react69.useEffect)(() => {
14685
+ (0, import_react70.useEffect)(() => {
14529
14686
  if (isDragging) {
14530
14687
  document.addEventListener("mousemove", handleMouseMove);
14531
14688
  document.addEventListener("mouseup", handleMouseUp);
@@ -14537,16 +14694,16 @@ var useDrag = (options = {}) => {
14537
14694
  };
14538
14695
  }
14539
14696
  }, [isDragging, handleMouseMove, handleMouseUp]);
14540
- const setPosition = (0, import_react69.useCallback)((id, position) => {
14697
+ const setPosition = (0, import_react70.useCallback)((id, position) => {
14541
14698
  setPositions((prev) => ({
14542
14699
  ...prev,
14543
14700
  [id]: position
14544
14701
  }));
14545
14702
  }, []);
14546
- const getPosition = (0, import_react69.useCallback)((id) => {
14703
+ const getPosition = (0, import_react70.useCallback)((id) => {
14547
14704
  return positions[id] || { top: 0, left: 0 };
14548
14705
  }, [positions]);
14549
- const isElementDragging = (0, import_react69.useCallback)((id) => {
14706
+ const isElementDragging = (0, import_react70.useCallback)((id) => {
14550
14707
  return isDragging === id;
14551
14708
  }, [isDragging]);
14552
14709
  return {
package/dist/index.mjs CHANGED
@@ -7268,44 +7268,50 @@ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
7268
7268
  import { CheckIcon as CheckIcon8, MinusIcon } from "@phosphor-icons/react";
7269
7269
  import { motion as motion11 } from "framer-motion";
7270
7270
  import { jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
7271
- var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", ...props }, ref) => /* @__PURE__ */ jsx44(
7272
- CheckboxPrimitive.Root,
7273
- {
7274
- ref,
7275
- className: cn(
7276
- "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 data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground transition-colors",
7277
- className
7278
- ),
7279
- "data-testid": dataTestId,
7280
- ...props,
7281
- children: /* @__PURE__ */ jsx44(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ jsxs33(
7282
- motion11.div,
7283
- {
7284
- initial: { scale: 0, opacity: 0, rotate: -90 },
7285
- animate: { scale: 1, opacity: 1, rotate: 0 },
7286
- exit: { scale: 0, opacity: 0, rotate: 90 },
7287
- transition: { type: "spring", stiffness: 500, damping: 30 },
7288
- className: "flex items-center justify-center text-current group",
7289
- children: [
7290
- /* @__PURE__ */ jsx44(
7291
- CheckIcon8,
7292
- {
7293
- className: "h-4 w-4 hidden group-data-[state=checked]:block",
7294
- weight: "bold"
7295
- }
7296
- ),
7297
- /* @__PURE__ */ jsx44(
7298
- MinusIcon,
7299
- {
7300
- className: "h-4 w-4 hidden group-data-[state=indeterminate]:block",
7301
- weight: "bold"
7302
- }
7303
- )
7304
- ]
7305
- }
7306
- ) })
7307
- }
7308
- ));
7271
+ var CheckboxBase = React24.forwardRef(({ className, testid: dataTestId = "checkbox-base", checked: checkedProp, defaultChecked, onCheckedChange, ...props }, ref) => {
7272
+ const isControlled = checkedProp !== void 0;
7273
+ const [checkedState, setCheckedState] = React24.useState(
7274
+ isControlled ? checkedProp : defaultChecked ?? false
7275
+ );
7276
+ React24.useEffect(() => {
7277
+ if (isControlled) setCheckedState(checkedProp);
7278
+ }, [checkedProp, isControlled]);
7279
+ const handleCheckedChange = (next) => {
7280
+ if (!isControlled) setCheckedState(next);
7281
+ onCheckedChange?.(next);
7282
+ };
7283
+ const stateClass = checkedState === true || checkedState === "indeterminate" ? "bg-primary text-primary-foreground" : "";
7284
+ return /* @__PURE__ */ jsx44(
7285
+ CheckboxPrimitive.Root,
7286
+ {
7287
+ ref,
7288
+ checked: checkedProp,
7289
+ defaultChecked,
7290
+ onCheckedChange: handleCheckedChange,
7291
+ className: cn(
7292
+ "group 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 transition-colors",
7293
+ stateClass,
7294
+ className
7295
+ ),
7296
+ "data-testid": dataTestId,
7297
+ ...props,
7298
+ children: /* @__PURE__ */ jsx44(CheckboxPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ jsxs33(
7299
+ motion11.div,
7300
+ {
7301
+ initial: { scale: 0, opacity: 0, rotate: -90 },
7302
+ animate: { scale: 1, opacity: 1, rotate: 0 },
7303
+ exit: { scale: 0, opacity: 0, rotate: 90 },
7304
+ transition: { type: "spring", stiffness: 500, damping: 30 },
7305
+ className: "flex items-center justify-center text-current",
7306
+ children: [
7307
+ checkedState === true && /* @__PURE__ */ jsx44(CheckIcon8, { className: "h-4 w-4", weight: "bold" }),
7308
+ checkedState === "indeterminate" && /* @__PURE__ */ jsx44(MinusIcon, { className: "h-4 w-4", weight: "bold" })
7309
+ ]
7310
+ }
7311
+ ) })
7312
+ }
7313
+ );
7314
+ });
7309
7315
  CheckboxBase.displayName = CheckboxPrimitive.Root.displayName;
7310
7316
 
7311
7317
  // src/components/ui/form/CollapsibleBase.tsx
@@ -9920,7 +9926,7 @@ function DrawerDescriptionBase({
9920
9926
  }
9921
9927
 
9922
9928
  // src/hooks/use-universal-tooltip.tsx
9923
- import { createContext as createContext4, useContext as useContext5, useState as useState16, useCallback as useCallback11, useEffect as useEffect14, useRef as useRef7 } from "react";
9929
+ import { createContext as createContext4, useContext as useContext5, useState as useState17, useCallback as useCallback11, useEffect as useEffect15, useRef as useRef7 } from "react";
9924
9930
  import { jsx as jsx61 } from "react/jsx-runtime";
9925
9931
  var UniversalTooltipContext = createContext4(null);
9926
9932
  var useUniversalTooltip = () => {
@@ -10220,7 +10226,7 @@ CalendarBase2.displayName = "CalendarBase";
10220
10226
 
10221
10227
  // src/components/picker/DateTimePicker.tsx
10222
10228
  import { ptBR } from "date-fns/locale";
10223
- import { useEffect as useEffect15, useState as useState18 } from "react";
10229
+ import { useEffect as useEffect16, useState as useState19 } from "react";
10224
10230
 
10225
10231
  // src/components/picker/TimePicker.tsx
10226
10232
  import { motion as motion14, AnimatePresence as AnimatePresence10 } from "framer-motion";
@@ -10681,9 +10687,9 @@ function DateTimePicker({
10681
10687
  className,
10682
10688
  error
10683
10689
  }) {
10684
- const [internalDate, setInternalDate] = useState18(date);
10685
- const [open, setOpen] = useState18(false);
10686
- const [timePickerOpen, setTimePickerOpen] = useState18(false);
10690
+ const [internalDate, setInternalDate] = useState19(date);
10691
+ const [open, setOpen] = useState19(false);
10692
+ const [timePickerOpen, setTimePickerOpen] = useState19(false);
10687
10693
  const handleSelect = (newDay) => {
10688
10694
  if (!newDay) return;
10689
10695
  if (!internalDate) {
@@ -10714,7 +10720,7 @@ function DateTimePicker({
10714
10720
  if (!timeFormat) return "dd MMMM yyyy";
10715
10721
  return `dd MMMM yyyy - ${timeFormat}`;
10716
10722
  };
10717
- useEffect15(() => {
10723
+ useEffect16(() => {
10718
10724
  setInternalDate(date);
10719
10725
  }, [date, open]);
10720
10726
  return /* @__PURE__ */ jsxs49("div", { className: cn("w-full sm:w-auto", className), children: [
@@ -11668,7 +11674,7 @@ function StatusIndicator({
11668
11674
  }
11669
11675
 
11670
11676
  // src/components/ui/form/DebouncedInput.tsx
11671
- import { useEffect as useEffect17, useState as useState20 } from "react";
11677
+ import { useEffect as useEffect18, useState as useState21 } from "react";
11672
11678
  import { CircleNotchIcon as CircleNotchIcon2 } from "@phosphor-icons/react";
11673
11679
  import { jsx as jsx71 } from "react/jsx-runtime";
11674
11680
  function DebouncedInput({
@@ -11684,12 +11690,12 @@ function DebouncedInput({
11684
11690
  error,
11685
11691
  ...props
11686
11692
  }) {
11687
- const [value, setValue] = useState20(initialValue);
11688
- const [isDebouncing, setIsDebouncing] = useState20(false);
11689
- useEffect17(() => {
11693
+ const [value, setValue] = useState21(initialValue);
11694
+ const [isDebouncing, setIsDebouncing] = useState21(false);
11695
+ useEffect18(() => {
11690
11696
  setValue(initialValue);
11691
11697
  }, [initialValue]);
11692
- useEffect17(() => {
11698
+ useEffect18(() => {
11693
11699
  if (value !== initialValue) {
11694
11700
  setIsDebouncing(true);
11695
11701
  }
@@ -11800,7 +11806,7 @@ import {
11800
11806
  useSensors
11801
11807
  } from "@dnd-kit/core";
11802
11808
  import { addMinutes, differenceInMinutes } from "date-fns";
11803
- import { useId as useId2, useRef as useRef9, useState as useState21 } from "react";
11809
+ import { useId as useId2, useRef as useRef9, useState as useState22 } from "react";
11804
11810
 
11805
11811
  // src/components/event-calendar/hooks.ts
11806
11812
  import { createContext as createContext5, useContext as useContext6 } from "react";
@@ -11822,16 +11828,16 @@ function CalendarDndProvider({
11822
11828
  children,
11823
11829
  onEventUpdate
11824
11830
  }) {
11825
- const [activeEvent, setActiveEvent] = useState21(null);
11826
- const [activeId, setActiveId] = useState21(null);
11827
- const [activeView, setActiveView] = useState21(
11831
+ const [activeEvent, setActiveEvent] = useState22(null);
11832
+ const [activeId, setActiveId] = useState22(null);
11833
+ const [activeView, setActiveView] = useState22(
11828
11834
  null
11829
11835
  );
11830
- const [currentTime, setCurrentTime] = useState21(null);
11831
- const [eventHeight, setEventHeight] = useState21(null);
11832
- const [isMultiDay, setIsMultiDay] = useState21(false);
11833
- const [multiDayWidth, setMultiDayWidth] = useState21(null);
11834
- const [dragHandlePosition, setDragHandlePosition] = useState21(null);
11836
+ const [currentTime, setCurrentTime] = useState22(null);
11837
+ const [eventHeight, setEventHeight] = useState22(null);
11838
+ const [isMultiDay, setIsMultiDay] = useState22(false);
11839
+ const [multiDayWidth, setMultiDayWidth] = useState22(null);
11840
+ const [dragHandlePosition, setDragHandlePosition] = useState22(null);
11835
11841
  const eventDimensions = useRef9({ height: 0 });
11836
11842
  const sensors = useSensors(
11837
11843
  useSensor(MouseSensor, {
@@ -12271,7 +12277,7 @@ function DayView({
12271
12277
  import { useDraggable } from "@dnd-kit/core";
12272
12278
  import { CSS } from "@dnd-kit/utilities";
12273
12279
  import { differenceInDays } from "date-fns";
12274
- import { useRef as useRef10, useState as useState22 } from "react";
12280
+ import { useRef as useRef10, useState as useState23 } from "react";
12275
12281
  import { jsx as jsx75 } from "react/jsx-runtime";
12276
12282
  function DraggableEvent({
12277
12283
  event,
@@ -12287,7 +12293,7 @@ function DraggableEvent({
12287
12293
  }) {
12288
12294
  const { activeId } = useCalendarDnd();
12289
12295
  const elementRef = useRef10(null);
12290
- const [dragHandlePosition, setDragHandlePosition] = useState22(null);
12296
+ const [dragHandlePosition, setDragHandlePosition] = useState23(null);
12291
12297
  const eventStart = new Date(event.start);
12292
12298
  const eventEnd = new Date(event.end);
12293
12299
  const isMultiDayEvent2 = isMultiDay || event.allDay || differenceInDays(eventEnd, eventStart) >= 1;
@@ -12422,7 +12428,7 @@ import {
12422
12428
  subWeeks
12423
12429
  } from "date-fns";
12424
12430
  import { ptBR as ptBR4 } from "date-fns/locale";
12425
- import { useEffect as useEffect18, useMemo as useMemo11, useState as useState23, useCallback as useCallback12 } from "react";
12431
+ import { useEffect as useEffect19, useMemo as useMemo11, useState as useState24, useCallback as useCallback12 } from "react";
12426
12432
  import { toast as toast3 } from "sonner";
12427
12433
  import {
12428
12434
  ArrowDownIcon,
@@ -12440,9 +12446,9 @@ function EventCalendar({
12440
12446
  className,
12441
12447
  initialView = "month"
12442
12448
  }) {
12443
- const [currentDate, setCurrentDate] = useState23(/* @__PURE__ */ new Date());
12444
- const [view, setView] = useState23(initialView);
12445
- const [isFading, setIsFading] = useState23(false);
12449
+ const [currentDate, setCurrentDate] = useState24(/* @__PURE__ */ new Date());
12450
+ const [view, setView] = useState24(initialView);
12451
+ const [isFading, setIsFading] = useState24(false);
12446
12452
  const FADE_DURATION = 220;
12447
12453
  const changeView = useCallback12(
12448
12454
  (next) => {
@@ -12455,8 +12461,8 @@ function EventCalendar({
12455
12461
  },
12456
12462
  [view]
12457
12463
  );
12458
- const [isPaging, setIsPaging] = useState23(false);
12459
- const [pageDirection, setPageDirection] = useState23(
12464
+ const [isPaging, setIsPaging] = useState24(false);
12465
+ const [pageDirection, setPageDirection] = useState24(
12460
12466
  null
12461
12467
  );
12462
12468
  const PAGE_DURATION = 200;
@@ -12474,11 +12480,11 @@ function EventCalendar({
12474
12480
  },
12475
12481
  []
12476
12482
  );
12477
- const [isEventDialogOpen, setIsEventDialogOpen] = useState23(false);
12478
- const [selectedEvent, setSelectedEvent] = useState23(
12483
+ const [isEventDialogOpen, setIsEventDialogOpen] = useState24(false);
12484
+ const [selectedEvent, setSelectedEvent] = useState24(
12479
12485
  null
12480
12486
  );
12481
- useEffect18(() => {
12487
+ useEffect19(() => {
12482
12488
  const handleKeyDown = (e) => {
12483
12489
  if (isEventDialogOpen || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLElement && e.target.isContentEditable) {
12484
12490
  return;
@@ -12865,7 +12871,7 @@ function EventCalendar({
12865
12871
 
12866
12872
  // src/components/event-calendar/EventDialog.tsx
12867
12873
  import { format as format6, isBefore } from "date-fns";
12868
- import { useCallback as useCallback13, useEffect as useEffect19, useMemo as useMemo12, useState as useState24 } from "react";
12874
+ import { useCallback as useCallback13, useEffect as useEffect20, useMemo as useMemo12, useState as useState25 } from "react";
12869
12875
  import { RadioGroup as RadioGroup3, RadioGroupItem } from "@radix-ui/react-radio-group";
12870
12876
  import { motion as motion16 } from "framer-motion";
12871
12877
  import { ptBR as ptBR5 } from "date-fns/locale";
@@ -12878,19 +12884,19 @@ function EventDialog({
12878
12884
  onSave,
12879
12885
  onDelete
12880
12886
  }) {
12881
- const [title, setTitle] = useState24("");
12882
- const [description, setDescription] = useState24("");
12883
- const [startDate, setStartDate] = useState24(/* @__PURE__ */ new Date());
12884
- const [endDate, setEndDate] = useState24(/* @__PURE__ */ new Date());
12885
- const [startTime, setStartTime] = useState24(`${DefaultStartHour}:00`);
12886
- const [endTime, setEndTime] = useState24(`${DefaultEndHour}:00`);
12887
- const [allDay, setAllDay] = useState24(false);
12888
- const [location, setLocation] = useState24("");
12889
- const [color, setColor] = useState24("sky");
12890
- const [error, setError] = useState24(null);
12891
- const [startDateOpen, setStartDateOpen] = useState24(false);
12892
- const [endDateOpen, setEndDateOpen] = useState24(false);
12893
- useEffect19(() => {
12887
+ const [title, setTitle] = useState25("");
12888
+ const [description, setDescription] = useState25("");
12889
+ const [startDate, setStartDate] = useState25(/* @__PURE__ */ new Date());
12890
+ const [endDate, setEndDate] = useState25(/* @__PURE__ */ new Date());
12891
+ const [startTime, setStartTime] = useState25(`${DefaultStartHour}:00`);
12892
+ const [endTime, setEndTime] = useState25(`${DefaultEndHour}:00`);
12893
+ const [allDay, setAllDay] = useState25(false);
12894
+ const [location, setLocation] = useState25("");
12895
+ const [color, setColor] = useState25("sky");
12896
+ const [error, setError] = useState25(null);
12897
+ const [startDateOpen, setStartDateOpen] = useState25(false);
12898
+ const [endDateOpen, setEndDateOpen] = useState25(false);
12899
+ useEffect20(() => {
12894
12900
  }, [event]);
12895
12901
  const resetForm = useCallback13(() => {
12896
12902
  setTitle("");
@@ -12909,7 +12915,7 @@ function EventDialog({
12909
12915
  const minutes = Math.floor(date.getMinutes() / 15) * 15;
12910
12916
  return `${hours}:${minutes.toString().padStart(2, "0")}`;
12911
12917
  }, []);
12912
- useEffect19(() => {
12918
+ useEffect20(() => {
12913
12919
  if (event) {
12914
12920
  setTitle(event.title || "");
12915
12921
  setDescription(event.description || "");
@@ -13521,7 +13527,7 @@ function EventItem({
13521
13527
  // src/components/event-calendar/EventsPopUp.tsx
13522
13528
  import { format as format8, isSameDay as isSameDay2 } from "date-fns";
13523
13529
  import { ptBR as ptBR6 } from "date-fns/locale";
13524
- import { useEffect as useEffect20, useMemo as useMemo14, useRef as useRef11 } from "react";
13530
+ import { useEffect as useEffect21, useMemo as useMemo14, useRef as useRef11 } from "react";
13525
13531
  import { motion as motion17 } from "framer-motion";
13526
13532
  import { XIcon as XIcon11 } from "@phosphor-icons/react";
13527
13533
  import { jsx as jsx80, jsxs as jsxs60 } from "react/jsx-runtime";
@@ -13533,7 +13539,7 @@ function EventsPopup({
13533
13539
  onEventSelect
13534
13540
  }) {
13535
13541
  const popupRef = useRef11(null);
13536
- useEffect20(() => {
13542
+ useEffect21(() => {
13537
13543
  const handleClickOutside = (event) => {
13538
13544
  if (popupRef.current && !popupRef.current.contains(event.target)) {
13539
13545
  onClose();
@@ -13544,7 +13550,7 @@ function EventsPopup({
13544
13550
  document.removeEventListener("mousedown", handleClickOutside);
13545
13551
  };
13546
13552
  }, [onClose]);
13547
- useEffect20(() => {
13553
+ useEffect21(() => {
13548
13554
  const handleEscKey = (event) => {
13549
13555
  if (event.key === "Escape") {
13550
13556
  onClose();
@@ -13638,11 +13644,11 @@ function EventsPopup({
13638
13644
  // src/components/event-calendar/hooks/use-current-time-indicator.ts
13639
13645
  import { endOfWeek as endOfWeek2, isSameDay as isSameDay3, isWithinInterval, startOfWeek as startOfWeek2 } from "date-fns";
13640
13646
  import { ptBR as ptBR7 } from "date-fns/locale";
13641
- import { useEffect as useEffect21, useState as useState25 } from "react";
13647
+ import { useEffect as useEffect22, useState as useState26 } from "react";
13642
13648
  function useCurrentTimeIndicator(currentDate, view) {
13643
- const [currentTimePosition, setCurrentTimePosition] = useState25(0);
13644
- const [currentTimeVisible, setCurrentTimeVisible] = useState25(false);
13645
- useEffect21(() => {
13649
+ const [currentTimePosition, setCurrentTimePosition] = useState26(0);
13650
+ const [currentTimeVisible, setCurrentTimeVisible] = useState26(false);
13651
+ useEffect22(() => {
13646
13652
  const calculateTimePosition = () => {
13647
13653
  const now = /* @__PURE__ */ new Date();
13648
13654
  const hours = now.getHours();
@@ -13673,14 +13679,14 @@ function useCurrentTimeIndicator(currentDate, view) {
13673
13679
  }
13674
13680
 
13675
13681
  // src/components/event-calendar/hooks/use-event-visibility.ts
13676
- import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo15, useRef as useRef12, useState as useState26 } from "react";
13682
+ import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo15, useRef as useRef12, useState as useState27 } from "react";
13677
13683
  function useEventVisibility({
13678
13684
  eventHeight,
13679
13685
  eventGap
13680
13686
  }) {
13681
13687
  const contentRef = useRef12(null);
13682
13688
  const observerRef = useRef12(null);
13683
- const [contentHeight, setContentHeight] = useState26(null);
13689
+ const [contentHeight, setContentHeight] = useState27(null);
13684
13690
  useLayoutEffect2(() => {
13685
13691
  if (!contentRef.current) return;
13686
13692
  const updateHeight = () => {
@@ -13732,7 +13738,7 @@ import {
13732
13738
  startOfWeek as startOfWeek3
13733
13739
  } from "date-fns";
13734
13740
  import { ptBR as ptBR8 } from "date-fns/locale";
13735
- import { useEffect as useEffect22, useMemo as useMemo16, useState as useState27 } from "react";
13741
+ import { useEffect as useEffect23, useMemo as useMemo16, useState as useState28 } from "react";
13736
13742
  import { jsx as jsx81, jsxs as jsxs61 } from "react/jsx-runtime";
13737
13743
  function MonthView({
13738
13744
  currentDate,
@@ -13770,12 +13776,12 @@ function MonthView({
13770
13776
  e.stopPropagation();
13771
13777
  onEventSelect(event);
13772
13778
  };
13773
- const [isMounted, setIsMounted] = useState27(false);
13779
+ const [isMounted, setIsMounted] = useState28(false);
13774
13780
  const { contentRef, getVisibleEventCount } = useEventVisibility({
13775
13781
  eventGap: EventGap,
13776
13782
  eventHeight: EventHeight
13777
13783
  });
13778
- useEffect22(() => {
13784
+ useEffect23(() => {
13779
13785
  setIsMounted(true);
13780
13786
  }, []);
13781
13787
  return /* @__PURE__ */ jsxs61("div", { className: "contents", "data-slot": "month-view", children: [
@@ -14327,14 +14333,164 @@ function WeekView({
14327
14333
  ] });
14328
14334
  }
14329
14335
 
14336
+ // src/components/ui/form/CheckBoxThree.tsx
14337
+ import { useCallback as useCallback14, useMemo as useMemo18, useState as useState29, useEffect as useEffect24, useRef as useRef13 } from "react";
14338
+ import { motion as motion18, AnimatePresence as AnimatePresence12 } from "framer-motion";
14339
+ import { jsx as jsx83, jsxs as jsxs63 } from "react/jsx-runtime";
14340
+ function useCheckboxTree(initialTree) {
14341
+ const initialCheckedNodes = useMemo18(() => {
14342
+ const checkedSet = /* @__PURE__ */ new Set();
14343
+ const initializeCheckedNodes = (node) => {
14344
+ if (node.defaultChecked) {
14345
+ checkedSet.add(node.id);
14346
+ }
14347
+ node.children?.forEach(initializeCheckedNodes);
14348
+ };
14349
+ initializeCheckedNodes(initialTree);
14350
+ return checkedSet;
14351
+ }, [initialTree]);
14352
+ const [checkedNodes, setCheckedNodes] = useState29(initialCheckedNodes);
14353
+ const isChecked = useCallback14(
14354
+ (node) => {
14355
+ if (!node.children) {
14356
+ return checkedNodes.has(node.id);
14357
+ }
14358
+ const childrenChecked = node.children.map((child) => isChecked(child));
14359
+ if (childrenChecked.every((status) => status === true)) {
14360
+ return true;
14361
+ }
14362
+ if (childrenChecked.some(
14363
+ (status) => status === true || status === "indeterminate"
14364
+ )) {
14365
+ return "indeterminate";
14366
+ }
14367
+ return false;
14368
+ },
14369
+ [checkedNodes]
14370
+ );
14371
+ const handleCheck = useCallback14(
14372
+ (node) => {
14373
+ const newCheckedNodes = new Set(checkedNodes);
14374
+ const toggleNode = (n, check) => {
14375
+ if (check) {
14376
+ newCheckedNodes.add(n.id);
14377
+ } else {
14378
+ newCheckedNodes.delete(n.id);
14379
+ }
14380
+ for (const child of n.children ?? []) {
14381
+ toggleNode(child, check);
14382
+ }
14383
+ };
14384
+ const currentStatus = isChecked(node);
14385
+ const newCheck = currentStatus !== true;
14386
+ toggleNode(node, newCheck);
14387
+ setCheckedNodes(newCheckedNodes);
14388
+ },
14389
+ [checkedNodes, isChecked]
14390
+ );
14391
+ return { handleCheck, isChecked };
14392
+ }
14393
+ function CheckboxTree({ tree, renderNode }) {
14394
+ const { isChecked, handleCheck } = useCheckboxTree(tree);
14395
+ const DefaultNode = ({
14396
+ node,
14397
+ isChecked: status,
14398
+ onCheckedChange,
14399
+ children
14400
+ }) => {
14401
+ const [open, setOpen] = useState29(() => !!node.children && status !== false);
14402
+ const checkboxRef = useRef13(null);
14403
+ useEffect24(() => {
14404
+ if (checkboxRef.current) {
14405
+ checkboxRef.current.indeterminate = status === "indeterminate";
14406
+ }
14407
+ if (node.children) {
14408
+ setOpen(status !== false);
14409
+ }
14410
+ }, [status, node.children]);
14411
+ return /* @__PURE__ */ jsxs63("div", { className: "pl-1", children: [
14412
+ /* @__PURE__ */ jsxs63("div", { className: "flex items-center gap-2", children: [
14413
+ node.children ? /* @__PURE__ */ jsx83(
14414
+ "button",
14415
+ {
14416
+ "aria-label": open ? "Fechar" : "Abrir",
14417
+ onClick: () => setOpen((v) => !v),
14418
+ className: "w-6 h-6 flex items-center justify-center rounded hover:bg-slate-100 dark:hover:bg-slate-800",
14419
+ children: /* @__PURE__ */ jsx83(
14420
+ motion18.span,
14421
+ {
14422
+ animate: { rotate: open ? 90 : 0 },
14423
+ transition: { duration: 0.18 },
14424
+ className: "inline-block text-slate-500",
14425
+ children: "\u25B6"
14426
+ }
14427
+ )
14428
+ }
14429
+ ) : /* @__PURE__ */ jsx83("div", { className: "w-6 h-6" }),
14430
+ /* @__PURE__ */ jsxs63("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
14431
+ /* @__PURE__ */ jsxs63("span", { className: "relative", children: [
14432
+ /* @__PURE__ */ jsx83(
14433
+ "input",
14434
+ {
14435
+ ref: checkboxRef,
14436
+ type: "checkbox",
14437
+ checked: status === true,
14438
+ onChange: onCheckedChange,
14439
+ className: "appearance-none w-5 h-5 rounded border border-slate-300 dark:border-slate-700 flex items-center justify-center bg-white dark:bg-slate-900 checked:bg-blue-600 checked:border-blue-600 focus:outline-none"
14440
+ }
14441
+ ),
14442
+ /* @__PURE__ */ jsx83(
14443
+ motion18.span,
14444
+ {
14445
+ initial: false,
14446
+ animate: { scale: status === true ? 1 : 0.8, opacity: status === true ? 1 : 0 },
14447
+ transition: { duration: 0.14 },
14448
+ className: "pointer-events-none absolute left-0 top-0 w-5 h-5 flex items-center justify-center text-white",
14449
+ children: status === true ? /* @__PURE__ */ jsx83("svg", { width: "12", height: "10", viewBox: "0 0 12 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx83("path", { d: "M1 5L4 8L11 1", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : null
14450
+ }
14451
+ )
14452
+ ] }),
14453
+ /* @__PURE__ */ jsx83("span", { className: "text-sm text-slate-700 dark:text-slate-200", children: node.label })
14454
+ ] })
14455
+ ] }),
14456
+ /* @__PURE__ */ jsx83(AnimatePresence12, { initial: false, children: open && node.children && /* @__PURE__ */ jsx83(
14457
+ motion18.div,
14458
+ {
14459
+ initial: { height: 0, opacity: 0 },
14460
+ animate: { height: "auto", opacity: 1 },
14461
+ exit: { height: 0, opacity: 0 },
14462
+ transition: { duration: 0.18 },
14463
+ className: "ml-6 mt-2 overflow-hidden",
14464
+ children: /* @__PURE__ */ jsx83("div", { className: "flex flex-col gap-1", children })
14465
+ },
14466
+ "children"
14467
+ ) })
14468
+ ] });
14469
+ };
14470
+ const renderTreeNode = (node) => {
14471
+ const children = node.children?.map(renderTreeNode);
14472
+ const nodePayload = {
14473
+ children,
14474
+ isChecked: isChecked(node),
14475
+ node,
14476
+ onCheckedChange: () => handleCheck(node)
14477
+ };
14478
+ if (renderNode) {
14479
+ return renderNode(nodePayload);
14480
+ }
14481
+ return /* @__PURE__ */ jsx83(DefaultNode, { ...nodePayload });
14482
+ };
14483
+ return renderTreeNode(tree);
14484
+ }
14485
+
14330
14486
  // src/hooks/use-drag.tsx
14331
- import { useState as useState28, useCallback as useCallback14, useRef as useRef13, useEffect as useEffect23 } from "react";
14487
+ import { useState as useState30, useCallback as useCallback15, useRef as useRef14, useEffect as useEffect25 } from "react";
14332
14488
  var useDrag = (options = {}) => {
14333
- const [isDragging, setIsDragging] = useState28(null);
14334
- const [positions, setPositions] = useState28({});
14335
- const dragStartPos = useRef13(null);
14336
- const dragId = useRef13(null);
14337
- const handleMouseDown = useCallback14((id, e) => {
14489
+ const [isDragging, setIsDragging] = useState30(null);
14490
+ const [positions, setPositions] = useState30({});
14491
+ const dragStartPos = useRef14(null);
14492
+ const dragId = useRef14(null);
14493
+ const handleMouseDown = useCallback15((id, e) => {
14338
14494
  e.preventDefault();
14339
14495
  const currentPosition = positions[id] || { top: 0, left: 0 };
14340
14496
  dragStartPos.current = {
@@ -14347,7 +14503,7 @@ var useDrag = (options = {}) => {
14347
14503
  setIsDragging(id);
14348
14504
  options.onDragStart?.(id);
14349
14505
  }, [positions, options]);
14350
- const handleMouseMove = useCallback14((e) => {
14506
+ const handleMouseMove = useCallback15((e) => {
14351
14507
  if (!isDragging || !dragStartPos.current || !dragId.current) return;
14352
14508
  const deltaX = e.clientX - dragStartPos.current.x;
14353
14509
  const deltaY = e.clientY - dragStartPos.current.y;
@@ -14363,7 +14519,7 @@ var useDrag = (options = {}) => {
14363
14519
  }));
14364
14520
  options.onDrag?.(dragId.current, newPosition);
14365
14521
  }, [isDragging, options]);
14366
- const handleMouseUp = useCallback14(() => {
14522
+ const handleMouseUp = useCallback15(() => {
14367
14523
  if (dragId.current) {
14368
14524
  options.onDragEnd?.(dragId.current);
14369
14525
  }
@@ -14371,7 +14527,7 @@ var useDrag = (options = {}) => {
14371
14527
  dragStartPos.current = null;
14372
14528
  dragId.current = null;
14373
14529
  }, [options]);
14374
- useEffect23(() => {
14530
+ useEffect25(() => {
14375
14531
  if (isDragging) {
14376
14532
  document.addEventListener("mousemove", handleMouseMove);
14377
14533
  document.addEventListener("mouseup", handleMouseUp);
@@ -14383,16 +14539,16 @@ var useDrag = (options = {}) => {
14383
14539
  };
14384
14540
  }
14385
14541
  }, [isDragging, handleMouseMove, handleMouseUp]);
14386
- const setPosition = useCallback14((id, position) => {
14542
+ const setPosition = useCallback15((id, position) => {
14387
14543
  setPositions((prev) => ({
14388
14544
  ...prev,
14389
14545
  [id]: position
14390
14546
  }));
14391
14547
  }, []);
14392
- const getPosition = useCallback14((id) => {
14548
+ const getPosition = useCallback15((id) => {
14393
14549
  return positions[id] || { top: 0, left: 0 };
14394
14550
  }, [positions]);
14395
- const isElementDragging = useCallback14((id) => {
14551
+ const isElementDragging = useCallback15((id) => {
14396
14552
  return isDragging === id;
14397
14553
  }, [isDragging]);
14398
14554
  return {
@@ -14451,6 +14607,7 @@ export {
14451
14607
  Chart_default as Chart,
14452
14608
  CheckButton,
14453
14609
  CheckboxBase,
14610
+ CheckboxTree,
14454
14611
  CloseAllButton_default as CloseAllButton,
14455
14612
  CloseButton,
14456
14613
  CodeBlock,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.7.12",
6
+ "version": "1.7.13",
7
7
  "homepage": "https://main--68e80310a069c2f10b546ef3.chromatic.com/",
8
8
  "repository": {
9
9
  "type": "git",
@@ -58,6 +58,7 @@
58
58
  "@radix-ui/react-switch": "^1.1.2",
59
59
  "@radix-ui/react-tabs": "^1.1.2",
60
60
  "@radix-ui/react-tooltip": "^1.1.7",
61
+ "chromatic": "^13.3.4",
61
62
  "class-variance-authority": "^0.7.1",
62
63
  "clsx": "^2.1.1",
63
64
  "cmdk": "^1.0.4",