@arolariu/components 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +89 -0
- package/EXAMPLES.md +2510 -0
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/accordion_module.css.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +4 -16
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +21 -17
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert-dialog_module.css +1 -1
- package/dist/components/ui/alert-dialog_module.css.map +1 -1
- package/dist/components/ui/alert.js +4 -4
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/alert_module.css.map +1 -1
- package/dist/components/ui/aspect-ratio.js +2 -2
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/aspect-ratio_module.css.map +1 -1
- package/dist/components/ui/async-boundary.js +2 -2
- package/dist/components/ui/async-boundary.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +3 -12
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +18 -15
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/avatar_module.css.map +1 -1
- package/dist/components/ui/background-beams.js +3 -3
- package/dist/components/ui/background-beams.js.map +1 -1
- package/dist/components/ui/background-beams_module.css.map +1 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/badge_module.css.map +1 -1
- package/dist/components/ui/breadcrumb.js +10 -10
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/breadcrumb_module.css.map +1 -1
- package/dist/components/ui/bubble-background.js +5 -5
- package/dist/components/ui/bubble-background.js.map +1 -1
- package/dist/components/ui/bubble-background_module.css.map +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group.js +6 -6
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button-group_module.css.map +1 -1
- package/dist/components/ui/button.js +4 -4
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/button_module.css.map +1 -1
- package/dist/components/ui/calendar.d.ts +3 -5
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +9 -9
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/calendar_module.css.map +1 -1
- package/dist/components/ui/card-skeleton.js +2 -2
- package/dist/components/ui/card-skeleton.js.map +1 -1
- package/dist/components/ui/card-skeleton_module.css.map +1 -1
- package/dist/components/ui/card.js +8 -8
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/card_module.css.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +16 -16
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/carousel_module.css +1 -1
- package/dist/components/ui/carousel_module.css.map +1 -1
- package/dist/components/ui/chart.d.ts +6 -3
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +70 -70
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/chart_module.css.map +1 -1
- package/dist/components/ui/checkbox-group.d.ts +2 -6
- package/dist/components/ui/checkbox-group.d.ts.map +1 -1
- package/dist/components/ui/checkbox-group.js +8 -7
- package/dist/components/ui/checkbox-group.js.map +1 -1
- package/dist/components/ui/checkbox-group_module.css.map +1 -1
- package/dist/components/ui/checkbox.d.ts +3 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +6 -3
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/checkbox_module.css.map +1 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +4 -4
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/collapsible_module.css.map +1 -1
- package/dist/components/ui/combobox.d.ts +335 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +206 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/combobox.module.js +23 -0
- package/dist/components/ui/combobox.module.js.map +1 -0
- package/dist/components/ui/combobox_module.css +142 -0
- package/dist/components/ui/combobox_module.css.map +1 -0
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +62 -53
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/command_module.css +1 -1
- package/dist/components/ui/command_module.css.map +1 -1
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +6 -6
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/context-menu_module.css.map +1 -1
- package/dist/components/ui/copy-button.js +6 -6
- package/dist/components/ui/copy-button.js.map +1 -1
- package/dist/components/ui/copy-button_module.css.map +1 -1
- package/dist/components/ui/counting-number.js +6 -6
- package/dist/components/ui/counting-number.js.map +1 -1
- package/dist/components/ui/counting-number_module.css.map +1 -1
- package/dist/components/ui/dialog.js +6 -6
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dialog_module.css +1 -1
- package/dist/components/ui/dialog_module.css.map +1 -1
- package/dist/components/ui/dot-background_module.css.map +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +5 -5
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/drawer_module.css.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +6 -6
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu_module.css.map +1 -1
- package/dist/components/ui/dropdrawer.d.ts +10 -16
- package/dist/components/ui/dropdrawer.d.ts.map +1 -1
- package/dist/components/ui/dropdrawer.js +73 -65
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/dropdrawer_module.css.map +1 -1
- package/dist/components/ui/empty.js +7 -7
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/empty_module.css.map +1 -1
- package/dist/components/ui/error-boundary.js +2 -2
- package/dist/components/ui/error-boundary.js.map +1 -1
- package/dist/components/ui/error-boundary_module.css.map +1 -1
- package/dist/components/ui/field.js +12 -12
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/field_module.css.map +1 -1
- package/dist/components/ui/fireworks-background.js +6 -6
- package/dist/components/ui/fireworks-background.js.map +1 -1
- package/dist/components/ui/fireworks-background_module.css.map +1 -1
- package/dist/components/ui/flip-button.js +5 -5
- package/dist/components/ui/flip-button.js.map +1 -1
- package/dist/components/ui/flip-button_module.css.map +1 -1
- package/dist/components/ui/focus-scope.js +6 -6
- package/dist/components/ui/focus-scope.js.map +1 -1
- package/dist/components/ui/focus-scope_module.css.map +1 -1
- package/dist/components/ui/form-skeleton.js +2 -2
- package/dist/components/ui/form-skeleton.js.map +1 -1
- package/dist/components/ui/form-skeleton_module.css.map +1 -1
- package/dist/components/ui/form.d.ts +3 -3
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +13 -13
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/form_module.css.map +1 -1
- package/dist/components/ui/gradient-background.js +2 -2
- package/dist/components/ui/gradient-background.js.map +1 -1
- package/dist/components/ui/gradient-background_module.css.map +1 -1
- package/dist/components/ui/gradient-text.js +2 -2
- package/dist/components/ui/gradient-text.js.map +1 -1
- package/dist/components/ui/gradient-text_module.css.map +1 -1
- package/dist/components/ui/highlight-text.js +4 -4
- package/dist/components/ui/highlight-text.js.map +1 -1
- package/dist/components/ui/highlight-text_module.css.map +1 -1
- package/dist/components/ui/hole-background.js +21 -21
- package/dist/components/ui/hole-background.js.map +1 -1
- package/dist/components/ui/hole-background_module.css.map +1 -1
- package/dist/components/ui/hover-card.js +3 -3
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/hover-card_module.css.map +1 -1
- package/dist/components/ui/input-group.js +7 -7
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-group_module.css.map +1 -1
- package/dist/components/ui/input-otp.d.ts +3 -3
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +6 -6
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input-otp_module.css.map +1 -1
- package/dist/components/ui/input.js +2 -2
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/input_module.css.map +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/item.js +13 -13
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/item_module.css.map +1 -1
- package/dist/components/ui/kbd.js +3 -3
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/kbd_module.css.map +1 -1
- package/dist/components/ui/label.js +2 -2
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/label_module.css.map +1 -1
- package/dist/components/ui/list-skeleton.js +2 -2
- package/dist/components/ui/list-skeleton.js.map +1 -1
- package/dist/components/ui/list-skeleton_module.css.map +1 -1
- package/dist/components/ui/loading-overlay.js +2 -2
- package/dist/components/ui/loading-overlay.js.map +1 -1
- package/dist/components/ui/loading-overlay_module.css.map +1 -1
- package/dist/components/ui/menubar.d.ts +11 -13
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +4 -4
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/menubar_module.css.map +1 -1
- package/dist/components/ui/meter.d.ts +8 -24
- package/dist/components/ui/meter.d.ts.map +1 -1
- package/dist/components/ui/meter.js +23 -19
- package/dist/components/ui/meter.js.map +1 -1
- package/dist/components/ui/meter_module.css.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +3 -12
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +15 -12
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/navigation-menu_module.css +1 -1
- package/dist/components/ui/navigation-menu_module.css.map +1 -1
- package/dist/components/ui/number-field.d.ts +6 -12
- package/dist/components/ui/number-field.d.ts.map +1 -1
- package/dist/components/ui/number-field.js +3 -3
- package/dist/components/ui/number-field.js.map +1 -1
- package/dist/components/ui/number-field_module.css.map +1 -1
- package/dist/components/ui/pagination.js +8 -8
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/pagination_module.css.map +1 -1
- package/dist/components/ui/popover.js +5 -5
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/popover_module.css.map +1 -1
- package/dist/components/ui/progress.d.ts +1 -4
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +10 -9
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/progress_module.css.map +1 -1
- package/dist/components/ui/radio-group.d.ts +2 -4
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +3 -3
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/radio-group_module.css.map +1 -1
- package/dist/components/ui/resizable.d.ts +13 -29
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +8 -7
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/resizable_module.css.map +1 -1
- package/dist/components/ui/ripple-button.js +9 -9
- package/dist/components/ui/ripple-button.js.map +1 -1
- package/dist/components/ui/ripple-button_module.css.map +1 -1
- package/dist/components/ui/scratcher.d.ts +1 -1
- package/dist/components/ui/scratcher.d.ts.map +1 -1
- package/dist/components/ui/scratcher.js +5 -4
- package/dist/components/ui/scratcher.js.map +1 -1
- package/dist/components/ui/scratcher_module.css.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +2 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +2 -2
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/scroll-area_module.css.map +1 -1
- package/dist/components/ui/select.js +4 -4
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/select_module.css.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -4
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +9 -8
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/separator_module.css.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +6 -6
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sheet_module.css.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +36 -36
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/sidebar_module.css.map +1 -1
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/skeleton_module.css.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/slider_module.css.map +1 -1
- package/dist/components/ui/spinner.js +2 -2
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/spinner_module.css.map +1 -1
- package/dist/components/ui/stepper.js +2 -2
- package/dist/components/ui/stepper.js.map +1 -1
- package/dist/components/ui/stepper_module.css.map +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/switch_module.css.map +1 -1
- package/dist/components/ui/table-skeleton.js +2 -2
- package/dist/components/ui/table-skeleton.js.map +1 -1
- package/dist/components/ui/table-skeleton_module.css.map +1 -1
- package/dist/components/ui/table.js +9 -9
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/table_module.css.map +1 -1
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/tabs_module.css.map +1 -1
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/textarea_module.css.map +1 -1
- package/dist/components/ui/timeline.js +5 -5
- package/dist/components/ui/timeline.js.map +1 -1
- package/dist/components/ui/timeline_module.css.map +1 -1
- package/dist/components/ui/{sonner.d.ts → toast.d.ts} +15 -6
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/{sonner.js → toast.js} +43 -42
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toast.module.js +34 -0
- package/dist/components/ui/toast.module.js.map +1 -0
- package/dist/components/ui/{sonner_module.css → toast_module.css} +35 -35
- package/dist/components/ui/toast_module.css.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +2 -8
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +14 -12
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle-group_module.css.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/toggle_module.css.map +1 -1
- package/dist/components/ui/toolbar.d.ts +10 -30
- package/dist/components/ui/toolbar.d.ts.map +1 -1
- package/dist/components/ui/toolbar.js +28 -23
- package/dist/components/ui/toolbar.js.map +1 -1
- package/dist/components/ui/toolbar_module.css.map +1 -1
- package/dist/components/ui/tooltip.js +4 -4
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/tooltip_module.css.map +1 -1
- package/dist/components/ui/typewriter.js +4 -4
- package/dist/components/ui/typewriter.js.map +1 -1
- package/dist/components/ui/typewriter_module.css.map +1 -1
- package/dist/components/ui/visually-hidden.js +2 -2
- package/dist/components/ui/visually-hidden.js.map +1 -1
- package/dist/components/ui/visually-hidden_module.css.map +1 -1
- package/dist/hooks/useAnnounce.js +5 -5
- package/dist/hooks/useAnnounce.js.map +1 -1
- package/dist/hooks/useClipboard.d.ts +77 -0
- package/dist/hooks/useClipboard.d.ts.map +1 -0
- package/dist/hooks/useClipboard.js +42 -0
- package/dist/hooks/useClipboard.js.map +1 -0
- package/dist/hooks/useControllableState.d.ts +54 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +29 -0
- package/dist/hooks/useControllableState.js.map +1 -0
- package/dist/hooks/useDebounce.d.ts +33 -0
- package/dist/hooks/useDebounce.d.ts.map +1 -0
- package/dist/hooks/useDebounce.js +20 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useEventCallback.d.ts +34 -0
- package/dist/hooks/useEventCallback.d.ts.map +1 -0
- package/dist/hooks/useEventCallback.js +12 -0
- package/dist/hooks/useEventCallback.js.map +1 -0
- package/dist/hooks/useFocusManager.js +6 -6
- package/dist/hooks/useFocusManager.js.map +1 -1
- package/dist/hooks/useFocusVisible.js +5 -5
- package/dist/hooks/useFocusVisible.js.map +1 -1
- package/dist/hooks/useId.d.ts +30 -0
- package/dist/hooks/useId.d.ts.map +1 -0
- package/dist/hooks/useId.js +9 -0
- package/dist/hooks/useId.js.map +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +51 -0
- package/dist/hooks/useIntersectionObserver.d.ts.map +1 -0
- package/dist/hooks/useIntersectionObserver.js +25 -0
- package/dist/hooks/useIntersectionObserver.js.map +1 -0
- package/dist/hooks/useInterval.d.ts +55 -0
- package/dist/hooks/useInterval.d.ts.map +1 -0
- package/dist/hooks/useInterval.js +24 -0
- package/dist/hooks/useInterval.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +43 -0
- package/dist/hooks/useLocalStorage.d.ts.map +1 -0
- package/dist/hooks/useLocalStorage.js +53 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/useMediaQuery.js +3 -3
- package/dist/hooks/useMediaQuery.js.map +1 -1
- package/dist/hooks/useMergedRefs.d.ts +27 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +11 -0
- package/dist/hooks/useMergedRefs.js.map +1 -0
- package/dist/hooks/useOnClickOutside.d.ts +32 -0
- package/dist/hooks/useOnClickOutside.d.ts.map +1 -0
- package/dist/hooks/useOnClickOutside.js +23 -0
- package/dist/hooks/useOnClickOutside.js.map +1 -0
- package/dist/hooks/usePrevious.d.ts +33 -0
- package/dist/hooks/usePrevious.d.ts.map +1 -0
- package/dist/hooks/usePrevious.js +14 -0
- package/dist/hooks/usePrevious.js.map +1 -0
- package/dist/hooks/useThrottle.d.ts +37 -0
- package/dist/hooks/useThrottle.d.ts.map +1 -0
- package/dist/hooks/useThrottle.js +34 -0
- package/dist/hooks/useThrottle.js.map +1 -0
- package/dist/hooks/useTimeout.d.ts +28 -0
- package/dist/hooks/useTimeout.d.ts.map +1 -0
- package/dist/hooks/useTimeout.js +24 -0
- package/dist/hooks/useTimeout.js.map +1 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +17 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/lib/utilities.d.ts +2 -3
- package/dist/lib/utilities.d.ts.map +1 -1
- package/dist/lib/utilities.js.map +1 -1
- package/dist/motion/Collapse.js +2 -2
- package/dist/motion/Collapse.js.map +1 -1
- package/dist/motion/Collapse_module.css.map +1 -1
- package/dist/motion/tokens.js +5 -5
- package/dist/motion/tokens.js.map +1 -1
- package/package.json +88 -10
- package/src/components/ui/alert-dialog.tsx +15 -8
- package/src/components/ui/avatar.tsx +9 -6
- package/src/components/ui/calendar.tsx +9 -14
- package/src/components/ui/carousel.tsx +2 -0
- package/src/components/ui/chart.tsx +65 -62
- package/src/components/ui/checkbox-group.tsx +4 -5
- package/src/components/ui/checkbox.tsx +10 -2
- package/src/components/ui/collapsible.tsx +1 -0
- package/src/components/ui/combobox.module.css +158 -0
- package/src/components/ui/combobox.tsx +569 -0
- package/src/components/ui/command.tsx +31 -15
- package/src/components/ui/context-menu.tsx +3 -0
- package/src/components/ui/drawer.tsx +2 -0
- package/src/components/ui/dropdown-menu.tsx +3 -0
- package/src/components/ui/dropdrawer.tsx +80 -62
- package/src/components/ui/form.tsx +28 -3
- package/src/components/ui/input-otp.tsx +3 -3
- package/src/components/ui/menubar.tsx +9 -10
- package/src/components/ui/meter.tsx +16 -17
- package/src/components/ui/navigation-menu.tsx +41 -33
- package/src/components/ui/number-field.tsx +6 -13
- package/src/components/ui/progress.tsx +3 -2
- package/src/components/ui/radio-group.tsx +2 -5
- package/src/components/ui/resizable.tsx +15 -18
- package/src/components/ui/scratcher.tsx +6 -10
- package/src/components/ui/scroll-area.tsx +2 -5
- package/src/components/ui/separator.tsx +4 -3
- package/src/components/ui/sheet.tsx +3 -0
- package/src/components/ui/sidebar.tsx +1 -0
- package/src/components/ui/{sonner.module.css → toast.module.css} +1 -1
- package/src/components/ui/{sonner.tsx → toast.tsx} +22 -14
- package/src/components/ui/toggle-group.tsx +6 -4
- package/src/components/ui/toolbar.tsx +20 -21
- package/src/hooks/useClipboard.tsx +137 -0
- package/src/hooks/useControllableState.tsx +81 -0
- package/src/hooks/useDebounce.tsx +50 -0
- package/src/hooks/useEventCallback.tsx +47 -0
- package/src/hooks/useId.tsx +36 -0
- package/src/hooks/useIntersectionObserver.tsx +81 -0
- package/src/hooks/useInterval.tsx +80 -0
- package/src/hooks/useLocalStorage.tsx +111 -0
- package/src/hooks/useMergedRefs.tsx +48 -0
- package/src/hooks/useOnClickOutside.tsx +55 -0
- package/src/hooks/usePrevious.tsx +44 -0
- package/src/hooks/useThrottle.tsx +78 -0
- package/src/hooks/useTimeout.tsx +51 -0
- package/src/index.ts +27 -4
- package/src/lib/utilities.ts +4 -4
- package/src/motion/tokens.ts +4 -4
- package/src/stories/DesignPrinciples.mdx +48 -0
- package/src/stories/GettingStarted.mdx +92 -0
- package/src/stories/Welcome.mdx +44 -0
- package/dist/components/ui/sonner.d.ts.map +0 -1
- package/dist/components/ui/sonner.js.map +0 -1
- package/dist/components/ui/sonner.module.js +0 -34
- package/dist/components/ui/sonner.module.js.map +0 -1
- package/dist/components/ui/sonner_module.css.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PanelLeft } from "lucide-react";
|
|
4
|
-
import { cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
5
4
|
import { createPortal } from "react-dom";
|
|
6
5
|
import { Button } from "./button.js";
|
|
7
6
|
import { Input } from "./input.js";
|
|
@@ -11,24 +10,25 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tool
|
|
|
11
10
|
import { useIsMobile } from "../../hooks/useIsMobile.js";
|
|
12
11
|
import { cn } from "../../lib/utilities.js";
|
|
13
12
|
import sidebar_module from "./sidebar.module.js";
|
|
13
|
+
import * as __rspack_external_react from "react";
|
|
14
14
|
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
15
15
|
const SIDEBAR_COOKIE_MAX_AGE = 604800;
|
|
16
16
|
const SIDEBAR_WIDTH = "16rem";
|
|
17
17
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
18
18
|
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
19
19
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
20
|
-
const SidebarContext = /*#__PURE__*/ createContext(null);
|
|
20
|
+
const SidebarContext = /*#__PURE__*/ __rspack_external_react.createContext(null);
|
|
21
21
|
function useSidebar() {
|
|
22
|
-
const context = useContext(SidebarContext);
|
|
22
|
+
const context = __rspack_external_react.useContext(SidebarContext);
|
|
23
23
|
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
24
24
|
return context;
|
|
25
25
|
}
|
|
26
|
-
const SidebarProvider = /*#__PURE__*/ forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref)=>{
|
|
26
|
+
const SidebarProvider = /*#__PURE__*/ __rspack_external_react.forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref)=>{
|
|
27
27
|
const isMobile = useIsMobile();
|
|
28
|
-
const [openMobile, setOpenMobile] = useState(false);
|
|
29
|
-
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
28
|
+
const [openMobile, setOpenMobile] = __rspack_external_react.useState(false);
|
|
29
|
+
const [internalOpen, setInternalOpen] = __rspack_external_react.useState(defaultOpen);
|
|
30
30
|
const open = openProp ?? internalOpen;
|
|
31
|
-
const setOpen = useCallback((value)=>{
|
|
31
|
+
const setOpen = __rspack_external_react.useCallback((value)=>{
|
|
32
32
|
const nextValue = "function" == typeof value ? value(open) : value;
|
|
33
33
|
if (setOpenProp) setOpenProp(nextValue);
|
|
34
34
|
else setInternalOpen(nextValue);
|
|
@@ -37,14 +37,14 @@ const SidebarProvider = /*#__PURE__*/ forwardRef(({ defaultOpen = true, open: op
|
|
|
37
37
|
open,
|
|
38
38
|
setOpenProp
|
|
39
39
|
]);
|
|
40
|
-
const toggleSidebar = useCallback(()=>{
|
|
40
|
+
const toggleSidebar = __rspack_external_react.useCallback(()=>{
|
|
41
41
|
if (isMobile) return void setOpenMobile((currentOpen)=>!currentOpen);
|
|
42
42
|
setOpen((currentOpen)=>!currentOpen);
|
|
43
43
|
}, [
|
|
44
44
|
isMobile,
|
|
45
45
|
setOpen
|
|
46
46
|
]);
|
|
47
|
-
useEffect(()=>{
|
|
47
|
+
__rspack_external_react.useEffect(()=>{
|
|
48
48
|
const handleKeyDown = (event)=>{
|
|
49
49
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
50
50
|
event.preventDefault();
|
|
@@ -59,7 +59,7 @@ const SidebarProvider = /*#__PURE__*/ forwardRef(({ defaultOpen = true, open: op
|
|
|
59
59
|
toggleSidebar
|
|
60
60
|
]);
|
|
61
61
|
const state = open ? "expanded" : "collapsed";
|
|
62
|
-
const contextValue = useMemo(()=>({
|
|
62
|
+
const contextValue = __rspack_external_react.useMemo(()=>({
|
|
63
63
|
isMobile,
|
|
64
64
|
open,
|
|
65
65
|
openMobile,
|
|
@@ -93,7 +93,7 @@ const SidebarProvider = /*#__PURE__*/ forwardRef(({ defaultOpen = true, open: op
|
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
SidebarProvider.displayName = "SidebarProvider";
|
|
96
|
-
const Sidebar = /*#__PURE__*/ forwardRef(({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }, ref)=>{
|
|
96
|
+
const Sidebar = /*#__PURE__*/ __rspack_external_react.forwardRef(({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }, ref)=>{
|
|
97
97
|
const { isMobile, openMobile, setOpenMobile, state } = useSidebar();
|
|
98
98
|
if ("none" === collapsible) return /*#__PURE__*/ jsx("div", {
|
|
99
99
|
ref: ref,
|
|
@@ -134,7 +134,7 @@ const Sidebar = /*#__PURE__*/ forwardRef(({ side = "left", variant = "sidebar",
|
|
|
134
134
|
});
|
|
135
135
|
Sidebar.displayName = "Sidebar";
|
|
136
136
|
function MobileSidebarPortal({ open, side, onOpenChange, className, children, ...props }) {
|
|
137
|
-
useEffect(()=>{
|
|
137
|
+
__rspack_external_react.useEffect(()=>{
|
|
138
138
|
if (!open) return;
|
|
139
139
|
const previousOverflow = document.body.style.overflow;
|
|
140
140
|
const handleKeyDown = (event)=>{
|
|
@@ -191,7 +191,7 @@ function MobileSidebarPortal({ open, side, onOpenChange, className, children, ..
|
|
|
191
191
|
]
|
|
192
192
|
}), document.body);
|
|
193
193
|
}
|
|
194
|
-
const SidebarTrigger = /*#__PURE__*/ forwardRef(({ className, onClick, ...props }, ref)=>{
|
|
194
|
+
const SidebarTrigger = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, onClick, ...props }, ref)=>{
|
|
195
195
|
const { toggleSidebar } = useSidebar();
|
|
196
196
|
return /*#__PURE__*/ jsxs(Button, {
|
|
197
197
|
ref: ref,
|
|
@@ -216,7 +216,7 @@ const SidebarTrigger = /*#__PURE__*/ forwardRef(({ className, onClick, ...props
|
|
|
216
216
|
});
|
|
217
217
|
});
|
|
218
218
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
219
|
-
const SidebarRail = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
219
|
+
const SidebarRail = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>{
|
|
220
220
|
const { toggleSidebar } = useSidebar();
|
|
221
221
|
return /*#__PURE__*/ jsx("button", {
|
|
222
222
|
ref: ref,
|
|
@@ -231,48 +231,48 @@ const SidebarRail = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>{
|
|
|
231
231
|
});
|
|
232
232
|
});
|
|
233
233
|
SidebarRail.displayName = "SidebarRail";
|
|
234
|
-
const SidebarInset = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("main", {
|
|
234
|
+
const SidebarInset = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("main", {
|
|
235
235
|
ref: ref,
|
|
236
236
|
className: cn(sidebar_module.inset, className),
|
|
237
237
|
...props
|
|
238
238
|
}));
|
|
239
239
|
SidebarInset.displayName = "SidebarInset";
|
|
240
|
-
const SidebarInput = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Input, {
|
|
240
|
+
const SidebarInput = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Input, {
|
|
241
241
|
ref: ref,
|
|
242
242
|
"data-sidebar": "input",
|
|
243
243
|
className: cn(sidebar_module.input, className),
|
|
244
244
|
...props
|
|
245
245
|
}));
|
|
246
246
|
SidebarInput.displayName = "SidebarInput";
|
|
247
|
-
const SidebarHeader = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
247
|
+
const SidebarHeader = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
248
248
|
ref: ref,
|
|
249
249
|
"data-sidebar": "header",
|
|
250
250
|
className: cn(sidebar_module.header, className),
|
|
251
251
|
...props
|
|
252
252
|
}));
|
|
253
253
|
SidebarHeader.displayName = "SidebarHeader";
|
|
254
|
-
const SidebarFooter = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
254
|
+
const SidebarFooter = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
255
255
|
ref: ref,
|
|
256
256
|
"data-sidebar": "footer",
|
|
257
257
|
className: cn(sidebar_module.footer, className),
|
|
258
258
|
...props
|
|
259
259
|
}));
|
|
260
260
|
SidebarFooter.displayName = "SidebarFooter";
|
|
261
|
-
const SidebarSeparator = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Separator, {
|
|
261
|
+
const SidebarSeparator = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Separator, {
|
|
262
262
|
ref: ref,
|
|
263
263
|
"data-sidebar": "separator",
|
|
264
264
|
className: cn(sidebar_module.separator, className),
|
|
265
265
|
...props
|
|
266
266
|
}));
|
|
267
267
|
SidebarSeparator.displayName = "SidebarSeparator";
|
|
268
|
-
const SidebarContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
268
|
+
const SidebarContent = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
269
269
|
ref: ref,
|
|
270
270
|
"data-sidebar": "content",
|
|
271
271
|
className: cn(sidebar_module.content, className),
|
|
272
272
|
...props
|
|
273
273
|
}));
|
|
274
274
|
SidebarContent.displayName = "SidebarContent";
|
|
275
|
-
const SidebarGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
275
|
+
const SidebarGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
276
276
|
ref: ref,
|
|
277
277
|
"data-sidebar": "group",
|
|
278
278
|
className: cn(sidebar_module.group, className),
|
|
@@ -280,14 +280,14 @@ const SidebarGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*
|
|
|
280
280
|
}));
|
|
281
281
|
SidebarGroup.displayName = "SidebarGroup";
|
|
282
282
|
function cloneSidebarChild(children, mergedProps) {
|
|
283
|
-
if (!/*#__PURE__*/ isValidElement(children)) return null;
|
|
283
|
+
if (!/*#__PURE__*/ __rspack_external_react.isValidElement(children)) return null;
|
|
284
284
|
const child = children;
|
|
285
|
-
return /*#__PURE__*/ cloneElement(child, {
|
|
285
|
+
return /*#__PURE__*/ __rspack_external_react.cloneElement(child, {
|
|
286
286
|
...mergedProps,
|
|
287
287
|
className: cn(mergedProps.className, child.props.className)
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
|
-
const SidebarGroupLabel = /*#__PURE__*/ forwardRef(({ className, asChild = false, children, ...props }, ref)=>{
|
|
290
|
+
const SidebarGroupLabel = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, asChild = false, children, ...props }, ref)=>{
|
|
291
291
|
const mergedProps = {
|
|
292
292
|
...props,
|
|
293
293
|
children,
|
|
@@ -304,7 +304,7 @@ const SidebarGroupLabel = /*#__PURE__*/ forwardRef(({ className, asChild = false
|
|
|
304
304
|
});
|
|
305
305
|
});
|
|
306
306
|
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
307
|
-
const SidebarGroupAction = /*#__PURE__*/ forwardRef(({ className, asChild = false, children, ...props }, ref)=>{
|
|
307
|
+
const SidebarGroupAction = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, asChild = false, children, ...props }, ref)=>{
|
|
308
308
|
const mergedProps = {
|
|
309
309
|
...props,
|
|
310
310
|
children,
|
|
@@ -323,21 +323,21 @@ const SidebarGroupAction = /*#__PURE__*/ forwardRef(({ className, asChild = fals
|
|
|
323
323
|
});
|
|
324
324
|
});
|
|
325
325
|
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
326
|
-
const SidebarGroupContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
326
|
+
const SidebarGroupContent = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
327
327
|
ref: ref,
|
|
328
328
|
"data-sidebar": "group-content",
|
|
329
329
|
className: cn(sidebar_module.groupContent, className),
|
|
330
330
|
...props
|
|
331
331
|
}));
|
|
332
332
|
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
333
|
-
const SidebarMenu = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("ul", {
|
|
333
|
+
const SidebarMenu = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("ul", {
|
|
334
334
|
ref: ref,
|
|
335
335
|
"data-sidebar": "menu",
|
|
336
336
|
className: cn(sidebar_module.menu, className),
|
|
337
337
|
...props
|
|
338
338
|
}));
|
|
339
339
|
SidebarMenu.displayName = "SidebarMenu";
|
|
340
|
-
const SidebarMenuItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("li", {
|
|
340
|
+
const SidebarMenuItem = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("li", {
|
|
341
341
|
ref: ref,
|
|
342
342
|
"data-sidebar": "menu-item",
|
|
343
343
|
className: cn(sidebar_module.menuItem, className),
|
|
@@ -353,7 +353,7 @@ const sidebarMenuButtonSizeStyles = {
|
|
|
353
353
|
sm: sidebar_module.menuButtonSizeSm,
|
|
354
354
|
lg: sidebar_module.menuButtonSizeLg
|
|
355
355
|
};
|
|
356
|
-
const SidebarMenuButton = /*#__PURE__*/ forwardRef(({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, children, ...props }, ref)=>{
|
|
356
|
+
const SidebarMenuButton = /*#__PURE__*/ __rspack_external_react.forwardRef(({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, children, ...props }, ref)=>{
|
|
357
357
|
const { isMobile, state } = useSidebar();
|
|
358
358
|
const mergedProps = {
|
|
359
359
|
...props,
|
|
@@ -387,7 +387,7 @@ const SidebarMenuButton = /*#__PURE__*/ forwardRef(({ asChild = false, isActive
|
|
|
387
387
|
});
|
|
388
388
|
});
|
|
389
389
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
390
|
-
const SidebarMenuAction = /*#__PURE__*/ forwardRef(({ className, asChild = false, showOnHover = false, children, ...props }, ref)=>{
|
|
390
|
+
const SidebarMenuAction = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, asChild = false, showOnHover = false, children, ...props }, ref)=>{
|
|
391
391
|
const mergedProps = {
|
|
392
392
|
...props,
|
|
393
393
|
children,
|
|
@@ -406,15 +406,15 @@ const SidebarMenuAction = /*#__PURE__*/ forwardRef(({ className, asChild = false
|
|
|
406
406
|
});
|
|
407
407
|
});
|
|
408
408
|
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
409
|
-
const SidebarMenuBadge = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
409
|
+
const SidebarMenuBadge = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
|
|
410
410
|
ref: ref,
|
|
411
411
|
"data-sidebar": "menu-badge",
|
|
412
412
|
className: cn(sidebar_module.menuBadge, className),
|
|
413
413
|
...props
|
|
414
414
|
}));
|
|
415
415
|
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
416
|
-
const SidebarMenuSkeleton = /*#__PURE__*/ forwardRef(({ className, showIcon = false, ...props }, ref)=>{
|
|
417
|
-
const width = useMemo(()=>`${Math.floor(40 * Math.random()) + 50}%`, []);
|
|
416
|
+
const SidebarMenuSkeleton = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, showIcon = false, ...props }, ref)=>{
|
|
417
|
+
const width = __rspack_external_react.useMemo(()=>`${Math.floor(40 * Math.random()) + 50}%`, []);
|
|
418
418
|
return /*#__PURE__*/ jsxs("div", {
|
|
419
419
|
ref: ref,
|
|
420
420
|
"data-sidebar": "menu-skeleton",
|
|
@@ -436,19 +436,19 @@ const SidebarMenuSkeleton = /*#__PURE__*/ forwardRef(({ className, showIcon = fa
|
|
|
436
436
|
});
|
|
437
437
|
});
|
|
438
438
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
439
|
-
const SidebarMenuSub = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("ul", {
|
|
439
|
+
const SidebarMenuSub = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("ul", {
|
|
440
440
|
ref: ref,
|
|
441
441
|
"data-sidebar": "menu-sub",
|
|
442
442
|
className: cn(sidebar_module.menuSub, className),
|
|
443
443
|
...props
|
|
444
444
|
}));
|
|
445
445
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
446
|
-
const SidebarMenuSubItem = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx("li", {
|
|
446
|
+
const SidebarMenuSubItem = /*#__PURE__*/ __rspack_external_react.forwardRef((props, ref)=>/*#__PURE__*/ jsx("li", {
|
|
447
447
|
ref: ref,
|
|
448
448
|
...props
|
|
449
449
|
}));
|
|
450
450
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
451
|
-
const SidebarMenuSubButton = /*#__PURE__*/ forwardRef(({ asChild = false, size = "md", isActive, className, children, ...props }, ref)=>{
|
|
451
|
+
const SidebarMenuSubButton = /*#__PURE__*/ __rspack_external_react.forwardRef(({ asChild = false, size = "md", isActive, className, children, ...props }, ref)=>{
|
|
452
452
|
const mergedProps = {
|
|
453
453
|
...props,
|
|
454
454
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/ui/sidebar.js","sources":["../../../src/components/ui/sidebar.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {PanelLeft} from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport {createPortal} from \"react-dom\";\r\n\r\nimport {Button} from \"@/components/ui/button\";\r\nimport {Input} from \"@/components/ui/input\";\r\nimport {Separator} from \"@/components/ui/separator\";\r\nimport {Skeleton} from \"@/components/ui/skeleton\";\r\nimport {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from \"@/components/ui/tooltip\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nimport styles from \"./sidebar.module.css\";\r\n\r\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\r\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\r\nconst SIDEBAR_WIDTH = \"16rem\";\r\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\r\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\r\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\r\n\r\ntype SidebarDataAttributes = Record<`data-${string}`, string | boolean | undefined>;\r\ntype SidebarCloneableDivProps = React.ComponentProps<\"div\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLDivElement>};\r\ntype SidebarCloneableButtonProps = React.ComponentProps<\"button\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLButtonElement>};\r\ntype SidebarCloneableAnchorProps = React.ComponentProps<\"a\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLAnchorElement>};\r\n\r\ntype SidebarContextProps = {\r\n state: \"expanded\" | \"collapsed\";\r\n open: boolean;\r\n setOpen: (open: boolean) => void;\r\n openMobile: boolean;\r\n setOpenMobile: (open: boolean) => void;\r\n isMobile: boolean;\r\n toggleSidebar: () => void;\r\n};\r\n\r\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\r\n\r\n/**\r\n * Returns the active sidebar context and enforces provider usage.\r\n *\r\n * @remarks\r\n * Must be called from within {@link SidebarProvider}. Exposes desktop and mobile\r\n * open state along with the shared toggle helper used by sidebar primitives.\r\n *\r\n * @example\r\n * ```tsx\r\n * const {open, toggleSidebar} = useSidebar();\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React useContext Docs}\r\n */\r\nfunction useSidebar(): SidebarContextProps {\r\n const context = React.useContext(SidebarContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\r\n }\r\n\r\n return context;\r\n}\r\n\r\n/**\r\n * Props for the sidebar provider.\r\n */\r\ninterface SidebarProviderProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Initial uncontrolled open state for desktop layouts.\r\n * @default true\r\n */\r\n defaultOpen?: boolean;\r\n /**\r\n * Controlled open state for desktop layouts.\r\n * @default undefined\r\n */\r\n open?: boolean;\r\n /**\r\n * Callback invoked when the desktop open state changes.\r\n * @default undefined\r\n */\r\n onOpenChange?: (open: boolean) => void;\r\n}\r\n\r\n/**\r\n * Provides shared sidebar state, keyboard shortcuts, and responsive behavior.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built on shared React context and tooltip primitives\r\n * - Persists desktop collapse state to a cookie for cross-page continuity\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarProvider>\r\n * <Sidebar />\r\n * </SidebarProvider>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React Context Docs}\r\n */\r\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\r\n ({defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props}, ref) => {\r\n const isMobile = useIsMobile();\r\n const [openMobile, setOpenMobile] = React.useState(false);\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = openProp ?? internalOpen;\r\n\r\n const setOpen = React.useCallback(\r\n (value: boolean | ((value: boolean) => boolean)) => {\r\n const nextValue = typeof value === \"function\" ? value(open) : value;\r\n\r\n if (setOpenProp) {\r\n setOpenProp(nextValue);\r\n } else {\r\n setInternalOpen(nextValue);\r\n }\r\n\r\n // eslint-disable-next-line unicorn/no-document-cookie -- persistent sidebar state matches V1 behavior\r\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${nextValue}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\r\n },\r\n [open, setOpenProp],\r\n );\r\n\r\n const toggleSidebar = React.useCallback(() => {\r\n if (isMobile) {\r\n setOpenMobile((currentOpen) => !currentOpen);\r\n return;\r\n }\r\n\r\n setOpen((currentOpen) => !currentOpen);\r\n }, [isMobile, setOpen]);\r\n\r\n React.useEffect(() => {\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\r\n event.preventDefault();\r\n toggleSidebar();\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [toggleSidebar]);\r\n\r\n const state = open ? \"expanded\" : \"collapsed\";\r\n\r\n const contextValue = React.useMemo<SidebarContextProps>(\r\n () => ({\r\n isMobile,\r\n open,\r\n openMobile,\r\n setOpen,\r\n setOpenMobile,\r\n state,\r\n toggleSidebar,\r\n }),\r\n [isMobile, open, openMobile, setOpen, state, toggleSidebar],\r\n );\r\n\r\n return (\r\n <SidebarContext.Provider value={contextValue}>\r\n <TooltipProvider>\r\n <div\r\n ref={ref}\r\n style={\r\n {\r\n \"--ac-sidebar-width\": SIDEBAR_WIDTH,\r\n \"--ac-sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\r\n ...style,\r\n } as React.CSSProperties\r\n }\r\n className={cn(styles.wrapper, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n </TooltipProvider>\r\n </SidebarContext.Provider>\r\n );\r\n },\r\n);\r\nSidebarProvider.displayName = \"SidebarProvider\";\r\n\r\n/**\r\n * Props for the root sidebar panel.\r\n */\r\ntype SidebarProps = React.ComponentProps<\"div\"> & {\r\n /**\r\n * Edge of the screen where the sidebar is rendered.\r\n * @default \"left\"\r\n */\r\n side?: \"left\" | \"right\";\r\n /**\r\n * Visual presentation style used for desktop rendering.\r\n * @default \"sidebar\"\r\n */\r\n variant?: \"sidebar\" | \"floating\" | \"inset\";\r\n /**\r\n * Desktop collapse behavior for the sidebar.\r\n * @default \"offcanvas\"\r\n */\r\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\r\n};\r\n\r\n/**\r\n * Renders the responsive sidebar panel for desktop and mobile layouts.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element on desktop and a dialog portal on mobile\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <Sidebar>\r\n * <SidebarContent />\r\n * </Sidebar>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/dialog_role | ARIA Dialog Role}\r\n */\r\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\r\n ({side = \"left\", variant = \"sidebar\", collapsible = \"offcanvas\", className, children, ...props}, ref) => {\r\n const {isMobile, openMobile, setOpenMobile, state} = useSidebar();\r\n\r\n if (collapsible === \"none\") {\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.staticSidebar, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n }\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileSidebarPortal\r\n className={className}\r\n open={openMobile}\r\n side={side}\r\n onOpenChange={setOpenMobile}\r\n {...props}>\r\n {children}\r\n </MobileSidebarPortal>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={styles.desktopRoot}\r\n data-state={state}\r\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\r\n data-variant={variant}\r\n data-side={side}>\r\n <div className={styles.gap} />\r\n <div\r\n className={cn(styles.panelWrap, className)}\r\n {...props}>\r\n <div\r\n data-sidebar='sidebar'\r\n className={styles.panel}>\r\n {children}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n);\r\nSidebar.displayName = \"Sidebar\";\r\n\r\ntype MobileSidebarPortalProps = React.ComponentProps<\"div\"> & {\r\n open: boolean;\r\n side: \"left\" | \"right\";\r\n onOpenChange: (open: boolean) => void;\r\n};\r\n\r\nfunction MobileSidebarPortal({\r\n open,\r\n side,\r\n onOpenChange,\r\n className,\r\n children,\r\n ...props\r\n}: Readonly<MobileSidebarPortalProps>): React.ReactPortal | null {\r\n React.useEffect(() => {\r\n if (!open) {\r\n return;\r\n }\r\n\r\n const previousOverflow = document.body.style.overflow;\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === \"Escape\") {\r\n onOpenChange(false);\r\n }\r\n };\r\n\r\n document.body.style.overflow = \"hidden\";\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n document.body.style.overflow = previousOverflow;\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [onOpenChange, open]);\r\n\r\n if (!open || typeof document === \"undefined\") {\r\n return null;\r\n }\r\n\r\n return createPortal(\r\n <div className={styles.mobilePortal}>\r\n <button\r\n type='button'\r\n aria-label='Close sidebar'\r\n className={styles.mobileOverlay}\r\n onClick={() => onOpenChange(false)}\r\n />\r\n <div\r\n role='dialog'\r\n aria-modal='true'\r\n aria-label='Sidebar'\r\n data-sidebar='sidebar'\r\n className={cn(styles.mobilePanel, side === \"right\" ? styles.mobilePanelRight : styles.mobilePanelLeft, className)}\r\n style={{\"--ac-sidebar-width\": SIDEBAR_WIDTH_MOBILE} as React.CSSProperties}\r\n {...props}>\r\n <div className={styles.srOnly}>\r\n <h2>Sidebar</h2>\r\n <p>Displays the mobile sidebar.</p>\r\n </div>\r\n <div className={styles.mobileContent}>{children}</div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n\r\n/**\r\n * Renders the primary button used to toggle the sidebar.\r\n *\r\n * @remarks\r\n * - Renders the shared `Button` component\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarTrigger />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarTrigger = React.forwardRef<React.ComponentRef<typeof Button>, React.ComponentProps<typeof Button>>(\r\n ({className, onClick, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n data-sidebar='trigger'\r\n variant='ghost'\r\n size='icon'\r\n className={cn(styles.trigger, className)}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n toggleSidebar();\r\n }}\r\n {...props}>\r\n <PanelLeft className={styles.triggerIcon} />\r\n <span className={styles.srOnly}>Toggle Sidebar</span>\r\n </Button>\r\n );\r\n },\r\n);\r\nSidebarTrigger.displayName = \"SidebarTrigger\";\r\n\r\n/**\r\n * Renders a slim rail button used to toggle the sidebar collapsed state.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarRail />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarRail = React.forwardRef<HTMLButtonElement, React.ComponentProps<\"button\">>(({className, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n data-sidebar='rail'\r\n aria-label='Toggle Sidebar'\r\n tabIndex={-1}\r\n title='Toggle Sidebar'\r\n type='button'\r\n className={cn(styles.rail, className)}\r\n onClick={toggleSidebar}\r\n {...props}\r\n />\r\n );\r\n});\r\nSidebarRail.displayName = \"SidebarRail\";\r\n\r\n/**\r\n * Renders the inset main content region adjacent to the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<main>` element\r\n * - Built as a layout helper for inset sidebar variants\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInset>Main content</SidebarInset>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/main | HTML main element}\r\n */\r\nconst SidebarInset = React.forwardRef<HTMLDivElement, React.ComponentProps<\"main\">>(({className, ...props}, ref) => (\r\n <main\r\n ref={ref}\r\n className={cn(styles.inset, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarInset.displayName = \"SidebarInset\";\r\n\r\n/**\r\n * Renders a styled input inside sidebar layouts.\r\n *\r\n * @remarks\r\n * - Renders the shared `Input` component\r\n * - Built for sidebar search and filtering affordances\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInput placeholder='Search...' />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/input | HTML input element}\r\n */\r\nconst SidebarInput = React.forwardRef<React.ComponentRef<typeof Input>, React.ComponentProps<typeof Input>>(\r\n ({className, ...props}, ref) => (\r\n <Input\r\n ref={ref}\r\n data-sidebar='input'\r\n className={cn(styles.input, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarInput.displayName = \"SidebarInput\";\r\n\r\n/**\r\n * Renders the header region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for branding or primary controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarHeader>Workspace</SidebarHeader>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='header'\r\n className={cn(styles.header, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarHeader.displayName = \"SidebarHeader\";\r\n\r\n/**\r\n * Renders the footer region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for actions or account controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarFooter>Footer content</SidebarFooter>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='footer'\r\n className={cn(styles.footer, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarFooter.displayName = \"SidebarFooter\";\r\n\r\n/**\r\n * Renders a separator between sidebar regions or menu groups.\r\n *\r\n * @remarks\r\n * - Renders the shared `Separator` component\r\n * - Built as a lightweight structural divider\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarSeparator />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/hr | HTML thematic break}\r\n */\r\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, React.ComponentProps<typeof Separator>>(\r\n ({className, ...props}, ref) => (\r\n <Separator\r\n ref={ref}\r\n data-sidebar='separator'\r\n className={cn(styles.separator, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarSeparator.displayName = \"SidebarSeparator\";\r\n\r\n/**\r\n * Renders the scrollable content region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for menu groups and custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarContent>\r\n * <SidebarMenu />\r\n * </SidebarContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='content'\r\n className={cn(styles.content, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarContent.displayName = \"SidebarContent\";\r\n\r\n/**\r\n * Renders a logical grouping container inside the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for related navigation sections\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroup>\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * </SidebarGroup>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group'\r\n className={cn(styles.group, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroup.displayName = \"SidebarGroup\";\r\n\r\nfunction cloneSidebarChild<TProps extends {className?: string}>(children: React.ReactNode, mergedProps: TProps): React.JSX.Element | null {\r\n if (!React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<TProps>;\r\n\r\n // eslint-disable-next-line react-x/no-clone-element -- replaces Radix Slot while preserving asChild prop merging\r\n return React.cloneElement(child, {\r\n ...mergedProps,\r\n className: cn(mergedProps.className, child.props.className),\r\n });\r\n}\r\n\r\n/**\r\n * Props for the sidebar group label.\r\n */\r\ninterface SidebarGroupLabelProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<div>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders the heading label for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Supports `asChild` composition for custom markup\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableDivProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupLabel, className),\r\n \"data-sidebar\": \"group-label\",\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <div {...mergedProps} />;\r\n },\r\n);\r\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\";\r\n\r\n/**\r\n * Props for the sidebar group action button.\r\n */\r\ninterface SidebarGroupActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action aligned with a sidebar group heading.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupAction aria-label='Add project'>+</SidebarGroupAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupAction = React.forwardRef<HTMLButtonElement, SidebarGroupActionProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupAction, className),\r\n \"data-sidebar\": \"group-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarGroupAction.displayName = \"SidebarGroupAction\";\r\n\r\n/**\r\n * Renders the content container for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a structural wrapper for nested menu items or custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupContent>\r\n * <SidebarMenu />\r\n * </SidebarGroupContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group-content'\r\n className={cn(styles.groupContent, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroupContent.displayName = \"SidebarGroupContent\";\r\n\r\n/**\r\n * Renders the root sidebar navigation list.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built as the primary menu container for sidebar navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenu>\r\n * <SidebarMenuItem />\r\n * </SidebarMenu>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenu = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu'\r\n className={cn(styles.menu, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenu.displayName = \"SidebarMenu\";\r\n\r\n/**\r\n * Renders a single list item within the sidebar menu.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for menu buttons and actions\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuItem>\r\n * <SidebarMenuButton>Dashboard</SidebarMenuButton>\r\n * </SidebarMenuItem>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>(({className, ...props}, ref) => (\r\n <li\r\n ref={ref}\r\n data-sidebar='menu-item'\r\n className={cn(styles.menuItem, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuItem.displayName = \"SidebarMenuItem\";\r\n\r\nconst sidebarMenuButtonVariantStyles = {\r\n default: styles.menuButtonDefault,\r\n outline: styles.menuButtonOutline,\r\n} as const;\r\n\r\nconst sidebarMenuButtonSizeStyles = {\r\n default: styles.menuButtonSizeDefault,\r\n sm: styles.menuButtonSizeSm,\r\n lg: styles.menuButtonSizeLg,\r\n} as const;\r\n\r\n/**\r\n * Props for the sidebar menu button.\r\n */\r\ninterface SidebarMenuButtonProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the menu item should be styled as active.\r\n * @default false\r\n */\r\n isActive?: boolean;\r\n /**\r\n * Tooltip content displayed when the sidebar is collapsed on desktop.\r\n * @default undefined\r\n */\r\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\r\n /**\r\n * Visual style variant for the menu button.\r\n * @default \"default\"\r\n */\r\n variant?: keyof typeof sidebarMenuButtonVariantStyles;\r\n /**\r\n * Size preset for the menu button.\r\n * @default \"default\"\r\n */\r\n size?: keyof typeof sidebarMenuButtonSizeStyles;\r\n}\r\n\r\n/**\r\n * Renders the primary interactive element for a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition and contextual tooltips when collapsed\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuButton isActive>Dashboard</SidebarMenuButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\r\n ({asChild = false, isActive = false, variant = \"default\", size = \"default\", tooltip, className, children, ...props}, ref) => {\r\n const {isMobile, state} = useSidebar();\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuButton, sidebarMenuButtonVariantStyles[variant], sidebarMenuButtonSizeStyles[size], className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-button\",\r\n \"data-size\": size,\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n const clonedChild = asChild ? cloneSidebarChild(children, mergedProps) : null;\r\n\r\n const button = clonedChild ?? (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n\r\n if (!tooltip) {\r\n return button;\r\n }\r\n\r\n const resolvedTooltip = typeof tooltip === \"string\" ? {children: tooltip} : tooltip;\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger render={button as React.ReactElement} />\r\n <TooltipContent\r\n hidden={state !== \"collapsed\" || isMobile}\r\n {...resolvedTooltip}\r\n />\r\n </Tooltip>\r\n );\r\n },\r\n);\r\nSidebarMenuButton.displayName = \"SidebarMenuButton\";\r\n\r\n/**\r\n * Props for the sidebar menu action button.\r\n */\r\ninterface SidebarMenuActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the action should remain hidden until its parent item is hovered.\r\n * @default false\r\n */\r\n showOnHover?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action button aligned within a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuAction showOnHover>⋯</SidebarMenuAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuAction = React.forwardRef<HTMLButtonElement, SidebarMenuActionProps>(\r\n ({className, asChild = false, showOnHover = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuAction, showOnHover && styles.menuActionShowOnHover, className),\r\n \"data-sidebar\": \"menu-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarMenuAction.displayName = \"SidebarMenuAction\";\r\n\r\n/**\r\n * Renders a badge alongside a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a lightweight presentational helper for counts and statuses\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuBadge>3</SidebarMenuBadge>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-badge'\r\n className={cn(styles.menuBadge, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\";\r\n\r\n/**\r\n * Props for the sidebar menu skeleton.\r\n */\r\ninterface SidebarMenuSkeletonProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to render a leading skeleton icon placeholder.\r\n * @default false\r\n */\r\n showIcon?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a loading placeholder for sidebar menu items.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built from shared `Skeleton` primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSkeleton showIcon />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuSkeleton = React.forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>(({className, showIcon = false, ...props}, ref) => {\r\n const width = React.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-skeleton'\r\n className={cn(styles.menuSkeleton, className)}\r\n {...props}>\r\n {Boolean(showIcon) && (\r\n <Skeleton\r\n className={styles.menuSkeletonIcon}\r\n data-sidebar='menu-skeleton-icon'\r\n />\r\n )}\r\n <Skeleton\r\n className={styles.menuSkeletonText}\r\n data-sidebar='menu-skeleton-text'\r\n style={{\"--ac-skeleton-width\": width} as React.CSSProperties}\r\n />\r\n </div>\r\n );\r\n});\r\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\";\r\n\r\n/**\r\n * Renders a nested menu list within the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built for multi-level navigation structures\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSub>\r\n * <SidebarMenuSubItem />\r\n * </SidebarMenuSub>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenuSub = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu-sub'\r\n className={cn(styles.menuSub, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSub.displayName = \"SidebarMenuSub\";\r\n\r\n/**\r\n * Renders a single nested sidebar menu list item.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for nested menu links\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubItem />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuSubItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>((props, ref) => (\r\n <li\r\n ref={ref}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\";\r\n\r\n/**\r\n * Props for the sidebar nested menu button.\r\n */\r\ninterface SidebarMenuSubButtonProps extends React.ComponentProps<\"a\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<a>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Size preset for the nested menu link.\r\n * @default \"md\"\r\n */\r\n size?: \"sm\" | \"md\";\r\n /**\r\n * Whether the nested menu item should be styled as active.\r\n * @default undefined\r\n */\r\n isActive?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a nested sidebar menu link.\r\n *\r\n * @remarks\r\n * - Renders an `<a>` element by default\r\n * - Supports `asChild` composition for custom link components\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubButton href='/settings/profile'>Profile</SidebarMenuSubButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuSubButton = React.forwardRef<HTMLAnchorElement, SidebarMenuSubButtonProps>(\r\n ({asChild = false, size = \"md\", isActive, className, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableAnchorProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuSubButton, size === \"sm\" ? styles.menuSubButtonSm : styles.menuSubButtonMd, className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-sub-button\",\r\n \"data-size\": size,\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <a {...mergedProps}>{children}</a>;\r\n },\r\n);\r\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\";\r\n\r\nexport {\r\n Sidebar,\r\n SidebarContent,\r\n SidebarFooter,\r\n SidebarGroup,\r\n SidebarGroupAction,\r\n SidebarGroupContent,\r\n SidebarGroupLabel,\r\n SidebarHeader,\r\n SidebarInput,\r\n SidebarInset,\r\n SidebarMenu,\r\n SidebarMenuAction,\r\n SidebarMenuBadge,\r\n SidebarMenuButton,\r\n SidebarMenuItem,\r\n SidebarMenuSkeleton,\r\n SidebarMenuSub,\r\n SidebarMenuSubButton,\r\n SidebarMenuSubItem,\r\n SidebarProvider,\r\n SidebarRail,\r\n SidebarSeparator,\r\n SidebarTrigger,\r\n useSidebar,\r\n};\r\n"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","Error","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","useIsMobile","openMobile","setOpenMobile","internalOpen","setInternalOpen","open","setOpen","value","nextValue","document","toggleSidebar","currentOpen","handleKeyDown","event","globalThis","state","contextValue","TooltipProvider","cn","styles","Sidebar","side","variant","collapsible","MobileSidebarPortal","onOpenChange","previousOverflow","createPortal","SidebarTrigger","onClick","Button","PanelLeft","SidebarRail","SidebarInset","SidebarInput","Input","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","cloneSidebarChild","mergedProps","child","SidebarGroupLabel","asChild","clonedChild","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariantStyles","sidebarMenuButtonSizeStyles","SidebarMenuButton","isActive","size","tooltip","button","resolvedTooltip","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Math","Boolean","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":";;;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QAC7B,GAAGG,KAAK;;AAGb2E,eAAe,WAAW,GAAG;AAgB7B,MAAMC,qBAAqB,WAAHA,GAAGvF,WAA4D,CAACW,OAAOC,MAAAA,WAAAA,GAC7F,IAAC;QACC,KAAKA;QACJ,GAAGD,KAAK;;AAGb4E,mBAAmB,WAAW,GAAG;AAqCjC,MAAMC,uBAAuB,WAAHA,GAAGxF,WAC3B,CAAC,EAAC4D,UAAU,KAAK,EAAEU,OAAO,IAAI,EAAED,QAAQ,EAAE7D,SAAS,EAAEE,QAAQ,EAAE,GAAGC,OAAM,EAAEC;IACxE,MAAM6C,cAA2C;QAC/C,GAAG9C,KAAK;QACRD;QACA,WAAWsB,GAAGC,eAAAA,aAAoB,EAAEqC,AAAS,SAATA,OAAgBrC,eAAAA,eAAsB,GAAGA,eAAAA,eAAsB,EAAEzB;QACrG,eAAe6D;QACf,gBAAgB;QAChB,aAAaC;QACb1D;IACF;IAEA,IAAIgD,SAAS;QACX,MAAMC,cAAcL,kBAAkB9C,UAAU+C;QAEhD,IAAII,aACF,OAAOA;IAEX;IAEA,OAAO,WAAP,GAAO,IAAC;QAAG,GAAGJ,WAAW;kBAAG/C;;AAC9B;AAEF8E,qBAAqB,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"file":"components/ui/sidebar.js","sources":["../../../src/components/ui/sidebar.tsx"],"sourcesContent":["/* eslint-disable max-lines */\r\n\"use client\";\r\n\r\nimport {PanelLeft} from \"lucide-react\";\r\nimport * as React from \"react\";\r\nimport {createPortal} from \"react-dom\";\r\n\r\nimport {Button} from \"@/components/ui/button\";\r\nimport {Input} from \"@/components/ui/input\";\r\nimport {Separator} from \"@/components/ui/separator\";\r\nimport {Skeleton} from \"@/components/ui/skeleton\";\r\nimport {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from \"@/components/ui/tooltip\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nimport styles from \"./sidebar.module.css\";\r\n\r\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\r\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\r\nconst SIDEBAR_WIDTH = \"16rem\";\r\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\r\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\r\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\r\n\r\ntype SidebarDataAttributes = Record<`data-${string}`, string | boolean | undefined>;\r\ntype SidebarCloneableDivProps = React.ComponentProps<\"div\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLDivElement>};\r\ntype SidebarCloneableButtonProps = React.ComponentProps<\"button\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLButtonElement>};\r\ntype SidebarCloneableAnchorProps = React.ComponentProps<\"a\"> & SidebarDataAttributes & {ref?: React.Ref<HTMLAnchorElement>};\r\n\r\ntype SidebarContextProps = {\r\n state: \"expanded\" | \"collapsed\";\r\n open: boolean;\r\n setOpen: (open: boolean) => void;\r\n openMobile: boolean;\r\n setOpenMobile: (open: boolean) => void;\r\n isMobile: boolean;\r\n toggleSidebar: () => void;\r\n};\r\n\r\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\r\n\r\n/**\r\n * Returns the active sidebar context and enforces provider usage.\r\n *\r\n * @remarks\r\n * Must be called from within {@link SidebarProvider}. Exposes desktop and mobile\r\n * open state along with the shared toggle helper used by sidebar primitives.\r\n *\r\n * @example\r\n * ```tsx\r\n * const {open, toggleSidebar} = useSidebar();\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React useContext Docs}\r\n */\r\nfunction useSidebar(): SidebarContextProps {\r\n const context = React.useContext(SidebarContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\r\n }\r\n\r\n return context;\r\n}\r\n\r\n/**\r\n * Props for the sidebar provider.\r\n */\r\ninterface SidebarProviderProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Initial uncontrolled open state for desktop layouts.\r\n * @default true\r\n */\r\n defaultOpen?: boolean;\r\n /**\r\n * Controlled open state for desktop layouts.\r\n * @default undefined\r\n */\r\n open?: boolean;\r\n /**\r\n * Callback invoked when the desktop open state changes.\r\n * @default undefined\r\n */\r\n onOpenChange?: (open: boolean) => void;\r\n}\r\n\r\n/**\r\n * Provides shared sidebar state, keyboard shortcuts, and responsive behavior.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built on shared React context and tooltip primitives\r\n * - Persists desktop collapse state to a cookie for cross-page continuity\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarProvider>\r\n * <Sidebar />\r\n * </SidebarProvider>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useContext | React Context Docs}\r\n */\r\nconst SidebarProvider = React.forwardRef<HTMLDivElement, SidebarProviderProps>(\r\n ({defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props}, ref) => {\r\n const isMobile = useIsMobile();\r\n const [openMobile, setOpenMobile] = React.useState(false);\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = openProp ?? internalOpen;\r\n\r\n const setOpen = React.useCallback(\r\n (value: boolean | ((value: boolean) => boolean)) => {\r\n const nextValue = typeof value === \"function\" ? value(open) : value;\r\n\r\n if (setOpenProp) {\r\n setOpenProp(nextValue);\r\n } else {\r\n setInternalOpen(nextValue);\r\n }\r\n\r\n // eslint-disable-next-line unicorn/no-document-cookie -- persistent sidebar state matches V1 behavior\r\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${nextValue}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\r\n },\r\n [open, setOpenProp],\r\n );\r\n\r\n const toggleSidebar = React.useCallback(() => {\r\n if (isMobile) {\r\n setOpenMobile((currentOpen) => !currentOpen);\r\n return;\r\n }\r\n\r\n setOpen((currentOpen) => !currentOpen);\r\n }, [isMobile, setOpen]);\r\n\r\n React.useEffect(() => {\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\r\n event.preventDefault();\r\n toggleSidebar();\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [toggleSidebar]);\r\n\r\n const state = open ? \"expanded\" : \"collapsed\";\r\n\r\n const contextValue = React.useMemo<SidebarContextProps>(\r\n () => ({\r\n isMobile,\r\n open,\r\n openMobile,\r\n setOpen,\r\n setOpenMobile,\r\n state,\r\n toggleSidebar,\r\n }),\r\n [isMobile, open, openMobile, setOpen, state, toggleSidebar],\r\n );\r\n\r\n return (\r\n <SidebarContext.Provider value={contextValue}>\r\n <TooltipProvider>\r\n <div\r\n ref={ref}\r\n style={\r\n {\r\n \"--ac-sidebar-width\": SIDEBAR_WIDTH,\r\n \"--ac-sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\r\n ...style,\r\n } as React.CSSProperties\r\n }\r\n className={cn(styles.wrapper, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n </TooltipProvider>\r\n </SidebarContext.Provider>\r\n );\r\n },\r\n);\r\nSidebarProvider.displayName = \"SidebarProvider\";\r\n\r\n/**\r\n * Props for the root sidebar panel.\r\n */\r\ntype SidebarProps = React.ComponentProps<\"div\"> & {\r\n /**\r\n * Edge of the screen where the sidebar is rendered.\r\n * @default \"left\"\r\n */\r\n side?: \"left\" | \"right\";\r\n /**\r\n * Visual presentation style used for desktop rendering.\r\n * @default \"sidebar\"\r\n */\r\n variant?: \"sidebar\" | \"floating\" | \"inset\";\r\n /**\r\n * Desktop collapse behavior for the sidebar.\r\n * @default \"offcanvas\"\r\n */\r\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\r\n};\r\n\r\n/**\r\n * Renders the responsive sidebar panel for desktop and mobile layouts.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element on desktop and a dialog portal on mobile\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <Sidebar>\r\n * <SidebarContent />\r\n * </Sidebar>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/dialog_role | ARIA Dialog Role}\r\n */\r\nconst Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(\r\n ({side = \"left\", variant = \"sidebar\", collapsible = \"offcanvas\", className, children, ...props}, ref) => {\r\n const {isMobile, openMobile, setOpenMobile, state} = useSidebar();\r\n\r\n if (collapsible === \"none\") {\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.staticSidebar, className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n }\r\n\r\n if (isMobile) {\r\n return (\r\n <MobileSidebarPortal\r\n className={className}\r\n open={openMobile}\r\n side={side}\r\n onOpenChange={setOpenMobile}\r\n {...props}>\r\n {children}\r\n </MobileSidebarPortal>\r\n );\r\n }\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={styles.desktopRoot}\r\n data-state={state}\r\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\r\n data-variant={variant}\r\n data-side={side}>\r\n <div className={styles.gap} />\r\n <div\r\n className={cn(styles.panelWrap, className)}\r\n {...props}>\r\n <div\r\n data-sidebar='sidebar'\r\n className={styles.panel}>\r\n {children}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n },\r\n);\r\nSidebar.displayName = \"Sidebar\";\r\n\r\ntype MobileSidebarPortalProps = React.ComponentProps<\"div\"> & {\r\n open: boolean;\r\n side: \"left\" | \"right\";\r\n onOpenChange: (open: boolean) => void;\r\n};\r\n\r\nfunction MobileSidebarPortal({\r\n open,\r\n side,\r\n onOpenChange,\r\n className,\r\n children,\r\n ...props\r\n}: Readonly<MobileSidebarPortalProps>): React.ReactPortal | null {\r\n React.useEffect(() => {\r\n if (!open) {\r\n return;\r\n }\r\n\r\n const previousOverflow = document.body.style.overflow;\r\n const handleKeyDown = (event: KeyboardEvent) => {\r\n if (event.key === \"Escape\") {\r\n onOpenChange(false);\r\n }\r\n };\r\n\r\n document.body.style.overflow = \"hidden\";\r\n globalThis.window.addEventListener(\"keydown\", handleKeyDown);\r\n\r\n return () => {\r\n document.body.style.overflow = previousOverflow;\r\n globalThis.window.removeEventListener(\"keydown\", handleKeyDown);\r\n };\r\n }, [onOpenChange, open]);\r\n\r\n if (!open || typeof document === \"undefined\") {\r\n return null;\r\n }\r\n\r\n return createPortal(\r\n <div className={styles.mobilePortal}>\r\n <button\r\n type='button'\r\n aria-label='Close sidebar'\r\n className={styles.mobileOverlay}\r\n onClick={() => onOpenChange(false)}\r\n />\r\n <div\r\n role='dialog'\r\n aria-modal='true'\r\n aria-label='Sidebar'\r\n data-sidebar='sidebar'\r\n className={cn(styles.mobilePanel, side === \"right\" ? styles.mobilePanelRight : styles.mobilePanelLeft, className)}\r\n style={{\"--ac-sidebar-width\": SIDEBAR_WIDTH_MOBILE} as React.CSSProperties}\r\n {...props}>\r\n <div className={styles.srOnly}>\r\n <h2>Sidebar</h2>\r\n <p>Displays the mobile sidebar.</p>\r\n </div>\r\n <div className={styles.mobileContent}>{children}</div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n\r\n/**\r\n * Renders the primary button used to toggle the sidebar.\r\n *\r\n * @remarks\r\n * - Renders the shared `Button` component\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarTrigger />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarTrigger = React.forwardRef<React.ComponentRef<typeof Button>, React.ComponentProps<typeof Button>>(\r\n ({className, onClick, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <Button\r\n ref={ref}\r\n data-sidebar='trigger'\r\n variant='ghost'\r\n size='icon'\r\n className={cn(styles.trigger, className)}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n toggleSidebar();\r\n }}\r\n {...props}>\r\n <PanelLeft className={styles.triggerIcon} />\r\n <span className={styles.srOnly}>Toggle Sidebar</span>\r\n </Button>\r\n );\r\n },\r\n);\r\nSidebarTrigger.displayName = \"SidebarTrigger\";\r\n\r\n/**\r\n * Renders a slim rail button used to toggle the sidebar collapsed state.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element\r\n * - Built on the shared sidebar context\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarRail />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/button | HTML button element}\r\n */\r\nconst SidebarRail = React.forwardRef<HTMLButtonElement, React.ComponentProps<\"button\">>(({className, ...props}, ref) => {\r\n const {toggleSidebar} = useSidebar();\r\n\r\n return (\r\n <button\r\n ref={ref}\r\n data-sidebar='rail'\r\n aria-label='Toggle Sidebar'\r\n tabIndex={-1}\r\n title='Toggle Sidebar'\r\n type='button'\r\n className={cn(styles.rail, className)}\r\n onClick={toggleSidebar}\r\n {...props}\r\n />\r\n );\r\n});\r\nSidebarRail.displayName = \"SidebarRail\";\r\n\r\n/**\r\n * Renders the inset main content region adjacent to the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<main>` element\r\n * - Built as a layout helper for inset sidebar variants\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInset>Main content</SidebarInset>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/main | HTML main element}\r\n */\r\nconst SidebarInset = React.forwardRef<HTMLDivElement, React.ComponentProps<\"main\">>(({className, ...props}, ref) => (\r\n <main\r\n ref={ref}\r\n className={cn(styles.inset, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarInset.displayName = \"SidebarInset\";\r\n\r\n/**\r\n * Renders a styled input inside sidebar layouts.\r\n *\r\n * @remarks\r\n * - Renders the shared `Input` component\r\n * - Built for sidebar search and filtering affordances\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarInput placeholder='Search...' />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/input | HTML input element}\r\n */\r\nconst SidebarInput = React.forwardRef<React.ComponentRef<typeof Input>, React.ComponentProps<typeof Input>>(\r\n ({className, ...props}, ref) => (\r\n <Input\r\n ref={ref}\r\n data-sidebar='input'\r\n className={cn(styles.input, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarInput.displayName = \"SidebarInput\";\r\n\r\n/**\r\n * Renders the header region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for branding or primary controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarHeader>Workspace</SidebarHeader>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarHeader = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='header'\r\n className={cn(styles.header, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarHeader.displayName = \"SidebarHeader\";\r\n\r\n/**\r\n * Renders the footer region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for actions or account controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarFooter>Footer content</SidebarFooter>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarFooter = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='footer'\r\n className={cn(styles.footer, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarFooter.displayName = \"SidebarFooter\";\r\n\r\n/**\r\n * Renders a separator between sidebar regions or menu groups.\r\n *\r\n * @remarks\r\n * - Renders the shared `Separator` component\r\n * - Built as a lightweight structural divider\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarSeparator />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/hr | HTML thematic break}\r\n */\r\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, React.ComponentProps<typeof Separator>>(\r\n ({className, ...props}, ref) => (\r\n <Separator\r\n ref={ref}\r\n data-sidebar='separator'\r\n className={cn(styles.separator, className)}\r\n {...props}\r\n />\r\n ),\r\n);\r\nSidebarSeparator.displayName = \"SidebarSeparator\";\r\n\r\n/**\r\n * Renders the scrollable content region of the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for menu groups and custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarContent>\r\n * <SidebarMenu />\r\n * </SidebarContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='content'\r\n className={cn(styles.content, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarContent.displayName = \"SidebarContent\";\r\n\r\n/**\r\n * Renders a logical grouping container inside the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a layout helper for related navigation sections\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroup>\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * </SidebarGroup>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group'\r\n className={cn(styles.group, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroup.displayName = \"SidebarGroup\";\r\n\r\nfunction cloneSidebarChild<TProps extends {className?: string}>(children: React.ReactNode, mergedProps: TProps): React.JSX.Element | null {\r\n if (!React.isValidElement(children)) {\r\n return null;\r\n }\r\n\r\n const child = children as React.ReactElement<TProps>;\r\n\r\n // eslint-disable-next-line react-x/no-clone-element -- replaces Radix Slot while preserving asChild prop merging\r\n return React.cloneElement(child, {\r\n ...mergedProps,\r\n className: cn(mergedProps.className, child.props.className),\r\n });\r\n}\r\n\r\n/**\r\n * Props for the sidebar group label.\r\n */\r\ninterface SidebarGroupLabelProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<div>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders the heading label for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element by default\r\n * - Supports `asChild` composition for custom markup\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupLabel>Projects</SidebarGroupLabel>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableDivProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupLabel, className),\r\n \"data-sidebar\": \"group-label\",\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <div {...mergedProps} />;\r\n },\r\n);\r\nSidebarGroupLabel.displayName = \"SidebarGroupLabel\";\r\n\r\n/**\r\n * Props for the sidebar group action button.\r\n */\r\ninterface SidebarGroupActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action aligned with a sidebar group heading.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupAction aria-label='Add project'>+</SidebarGroupAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarGroupAction = React.forwardRef<HTMLButtonElement, SidebarGroupActionProps>(\r\n ({className, asChild = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.groupAction, className),\r\n \"data-sidebar\": \"group-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarGroupAction.displayName = \"SidebarGroupAction\";\r\n\r\n/**\r\n * Renders the content container for a sidebar group.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a structural wrapper for nested menu items or custom content\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarGroupContent>\r\n * <SidebarMenu />\r\n * </SidebarGroupContent>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='group-content'\r\n className={cn(styles.groupContent, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarGroupContent.displayName = \"SidebarGroupContent\";\r\n\r\n/**\r\n * Renders the root sidebar navigation list.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built as the primary menu container for sidebar navigation\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenu>\r\n * <SidebarMenuItem />\r\n * </SidebarMenu>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenu = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu'\r\n className={cn(styles.menu, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenu.displayName = \"SidebarMenu\";\r\n\r\n/**\r\n * Renders a single list item within the sidebar menu.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for menu buttons and actions\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuItem>\r\n * <SidebarMenuButton>Dashboard</SidebarMenuButton>\r\n * </SidebarMenuItem>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>(({className, ...props}, ref) => (\r\n <li\r\n ref={ref}\r\n data-sidebar='menu-item'\r\n className={cn(styles.menuItem, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuItem.displayName = \"SidebarMenuItem\";\r\n\r\nconst sidebarMenuButtonVariantStyles = {\r\n default: styles.menuButtonDefault,\r\n outline: styles.menuButtonOutline,\r\n} as const;\r\n\r\nconst sidebarMenuButtonSizeStyles = {\r\n default: styles.menuButtonSizeDefault,\r\n sm: styles.menuButtonSizeSm,\r\n lg: styles.menuButtonSizeLg,\r\n} as const;\r\n\r\n/**\r\n * Props for the sidebar menu button.\r\n */\r\ninterface SidebarMenuButtonProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the menu item should be styled as active.\r\n * @default false\r\n */\r\n isActive?: boolean;\r\n /**\r\n * Tooltip content displayed when the sidebar is collapsed on desktop.\r\n * @default undefined\r\n */\r\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\r\n /**\r\n * Visual style variant for the menu button.\r\n * @default \"default\"\r\n */\r\n variant?: keyof typeof sidebarMenuButtonVariantStyles;\r\n /**\r\n * Size preset for the menu button.\r\n * @default \"default\"\r\n */\r\n size?: keyof typeof sidebarMenuButtonSizeStyles;\r\n}\r\n\r\n/**\r\n * Renders the primary interactive element for a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition and contextual tooltips when collapsed\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuButton isActive>Dashboard</SidebarMenuButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\r\n ({asChild = false, isActive = false, variant = \"default\", size = \"default\", tooltip, className, children, ...props}, ref) => {\r\n const {isMobile, state} = useSidebar();\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuButton, sidebarMenuButtonVariantStyles[variant], sidebarMenuButtonSizeStyles[size], className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-button\",\r\n \"data-size\": size,\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n const clonedChild = asChild ? cloneSidebarChild(children, mergedProps) : null;\r\n\r\n const button = clonedChild ?? (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n\r\n if (!tooltip) {\r\n return button;\r\n }\r\n\r\n const resolvedTooltip = typeof tooltip === \"string\" ? {children: tooltip} : tooltip;\r\n\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger render={button as React.ReactElement} />\r\n <TooltipContent\r\n hidden={state !== \"collapsed\" || isMobile}\r\n {...resolvedTooltip}\r\n />\r\n </Tooltip>\r\n );\r\n },\r\n);\r\nSidebarMenuButton.displayName = \"SidebarMenuButton\";\r\n\r\n/**\r\n * Props for the sidebar menu action button.\r\n */\r\ninterface SidebarMenuActionProps extends React.ComponentProps<\"button\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<button>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Whether the action should remain hidden until its parent item is hovered.\r\n * @default false\r\n */\r\n showOnHover?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a secondary action button aligned within a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<button>` element by default\r\n * - Supports `asChild` composition for custom controls\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuAction showOnHover>⋯</SidebarMenuAction>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuAction = React.forwardRef<HTMLButtonElement, SidebarMenuActionProps>(\r\n ({className, asChild = false, showOnHover = false, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableButtonProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuAction, showOnHover && styles.menuActionShowOnHover, className),\r\n \"data-sidebar\": \"menu-action\",\r\n ref,\r\n type: props.type ?? \"button\",\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return (\r\n <button\r\n type={props.type === \"submit\" ? \"submit\" : props.type === \"reset\" ? \"reset\" : \"button\"}\r\n {...mergedProps}\r\n />\r\n );\r\n },\r\n);\r\nSidebarMenuAction.displayName = \"SidebarMenuAction\";\r\n\r\n/**\r\n * Renders a badge alongside a sidebar menu item.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built as a lightweight presentational helper for counts and statuses\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuBadge>3</SidebarMenuBadge>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(({className, ...props}, ref) => (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-badge'\r\n className={cn(styles.menuBadge, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuBadge.displayName = \"SidebarMenuBadge\";\r\n\r\n/**\r\n * Props for the sidebar menu skeleton.\r\n */\r\ninterface SidebarMenuSkeletonProps extends React.ComponentProps<\"div\"> {\r\n /**\r\n * Whether to render a leading skeleton icon placeholder.\r\n * @default false\r\n */\r\n showIcon?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a loading placeholder for sidebar menu items.\r\n *\r\n * @remarks\r\n * - Renders a `<div>` element\r\n * - Built from shared `Skeleton` primitives\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSkeleton showIcon />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/div | HTML div element}\r\n */\r\nconst SidebarMenuSkeleton = React.forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>(({className, showIcon = false, ...props}, ref) => {\r\n const width = React.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n data-sidebar='menu-skeleton'\r\n className={cn(styles.menuSkeleton, className)}\r\n {...props}>\r\n {Boolean(showIcon) && (\r\n <Skeleton\r\n className={styles.menuSkeletonIcon}\r\n data-sidebar='menu-skeleton-icon'\r\n />\r\n )}\r\n <Skeleton\r\n className={styles.menuSkeletonText}\r\n data-sidebar='menu-skeleton-text'\r\n style={{\"--ac-skeleton-width\": width} as React.CSSProperties}\r\n />\r\n </div>\r\n );\r\n});\r\nSidebarMenuSkeleton.displayName = \"SidebarMenuSkeleton\";\r\n\r\n/**\r\n * Renders a nested menu list within the sidebar.\r\n *\r\n * @remarks\r\n * - Renders a `<ul>` element\r\n * - Built for multi-level navigation structures\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSub>\r\n * <SidebarMenuSubItem />\r\n * </SidebarMenuSub>\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/ul | HTML ul element}\r\n */\r\nconst SidebarMenuSub = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(({className, ...props}, ref) => (\r\n <ul\r\n ref={ref}\r\n data-sidebar='menu-sub'\r\n className={cn(styles.menuSub, className)}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSub.displayName = \"SidebarMenuSub\";\r\n\r\n/**\r\n * Renders a single nested sidebar menu list item.\r\n *\r\n * @remarks\r\n * - Renders an `<li>` element\r\n * - Built as a structural wrapper for nested menu links\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubItem />\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/li | HTML li element}\r\n */\r\nconst SidebarMenuSubItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>((props, ref) => (\r\n <li\r\n ref={ref}\r\n {...props}\r\n />\r\n));\r\nSidebarMenuSubItem.displayName = \"SidebarMenuSubItem\";\r\n\r\n/**\r\n * Props for the sidebar nested menu button.\r\n */\r\ninterface SidebarMenuSubButtonProps extends React.ComponentProps<\"a\"> {\r\n /**\r\n * Whether to merge props into the single child element instead of rendering a wrapper `<a>`.\r\n * @default false\r\n */\r\n asChild?: boolean;\r\n /**\r\n * Size preset for the nested menu link.\r\n * @default \"md\"\r\n */\r\n size?: \"sm\" | \"md\";\r\n /**\r\n * Whether the nested menu item should be styled as active.\r\n * @default undefined\r\n */\r\n isActive?: boolean;\r\n}\r\n\r\n/**\r\n * Renders a nested sidebar menu link.\r\n *\r\n * @remarks\r\n * - Renders an `<a>` element by default\r\n * - Supports `asChild` composition for custom link components\r\n *\r\n * @example\r\n * ```tsx\r\n * <SidebarMenuSubButton href='/settings/profile'>Profile</SidebarMenuSubButton>\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/cloneElement | React cloneElement Docs}\r\n */\r\nconst SidebarMenuSubButton = React.forwardRef<HTMLAnchorElement, SidebarMenuSubButtonProps>(\r\n ({asChild = false, size = \"md\", isActive, className, children, ...props}, ref) => {\r\n const mergedProps: SidebarCloneableAnchorProps = {\r\n ...props,\r\n children,\r\n className: cn(styles.menuSubButton, size === \"sm\" ? styles.menuSubButtonSm : styles.menuSubButtonMd, className),\r\n \"data-active\": isActive,\r\n \"data-sidebar\": \"menu-sub-button\",\r\n \"data-size\": size,\r\n ref,\r\n };\r\n\r\n if (asChild) {\r\n const clonedChild = cloneSidebarChild(children, mergedProps);\r\n\r\n if (clonedChild) {\r\n return clonedChild;\r\n }\r\n }\r\n\r\n return <a {...mergedProps}>{children}</a>;\r\n },\r\n);\r\nSidebarMenuSubButton.displayName = \"SidebarMenuSubButton\";\r\n\r\nexport {\r\n Sidebar,\r\n SidebarContent,\r\n SidebarFooter,\r\n SidebarGroup,\r\n SidebarGroupAction,\r\n SidebarGroupContent,\r\n SidebarGroupLabel,\r\n SidebarHeader,\r\n SidebarInput,\r\n SidebarInset,\r\n SidebarMenu,\r\n SidebarMenuAction,\r\n SidebarMenuBadge,\r\n SidebarMenuButton,\r\n SidebarMenuItem,\r\n SidebarMenuSkeleton,\r\n SidebarMenuSub,\r\n SidebarMenuSubButton,\r\n SidebarMenuSubItem,\r\n SidebarProvider,\r\n SidebarRail,\r\n SidebarSeparator,\r\n SidebarTrigger,\r\n useSidebar,\r\n};\r\n"],"names":["SIDEBAR_COOKIE_NAME","SIDEBAR_COOKIE_MAX_AGE","SIDEBAR_WIDTH","SIDEBAR_WIDTH_MOBILE","SIDEBAR_WIDTH_ICON","SIDEBAR_KEYBOARD_SHORTCUT","SidebarContext","React","useSidebar","context","Error","SidebarProvider","defaultOpen","openProp","setOpenProp","className","style","children","props","ref","isMobile","useIsMobile","openMobile","setOpenMobile","internalOpen","setInternalOpen","open","setOpen","value","nextValue","document","toggleSidebar","currentOpen","handleKeyDown","event","globalThis","state","contextValue","TooltipProvider","cn","styles","Sidebar","side","variant","collapsible","MobileSidebarPortal","onOpenChange","previousOverflow","createPortal","SidebarTrigger","onClick","Button","PanelLeft","SidebarRail","SidebarInset","SidebarInput","Input","SidebarHeader","SidebarFooter","SidebarSeparator","Separator","SidebarContent","SidebarGroup","cloneSidebarChild","mergedProps","child","SidebarGroupLabel","asChild","clonedChild","SidebarGroupAction","SidebarGroupContent","SidebarMenu","SidebarMenuItem","sidebarMenuButtonVariantStyles","sidebarMenuButtonSizeStyles","SidebarMenuButton","isActive","size","tooltip","button","resolvedTooltip","Tooltip","TooltipTrigger","TooltipContent","SidebarMenuAction","showOnHover","SidebarMenuBadge","SidebarMenuSkeleton","showIcon","width","Math","Boolean","Skeleton","SidebarMenuSub","SidebarMenuSubItem","SidebarMenuSubButton"],"mappings":";;;;;;;;;;;;;AAiBA,MAAMA,sBAAsB;AAC5B,MAAMC,yBAAyB;AAC/B,MAAMC,gBAAgB;AACtB,MAAMC,uBAAuB;AAC7B,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAiBlC,MAAMC,iBAAiB,WAAHA,GAAGC,wBAAAA,aAAmB,CAA6B;AAgBvE,SAASC;IACP,MAAMC,UAAUF,wBAAAA,UAAgB,CAACD;IAEjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAGlB,OAAOD;AACT;AAwCA,MAAME,kBAAkB,WAAHA,GAAGJ,wBAAAA,UAAgB,CACtC,CAAC,EAACK,cAAc,IAAI,EAAE,MAAMC,QAAQ,EAAE,cAAcC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,OAAM,EAAEC;IACtG,MAAMC,WAAWC;IACjB,MAAM,CAACC,YAAYC,cAAc,GAAGhB,wBAAAA,QAAc,CAAC;IACnD,MAAM,CAACiB,cAAcC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