@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
|
@@ -8,13 +8,6 @@ import * as React from "react";
|
|
|
8
8
|
import {cn} from "@/lib/utilities";
|
|
9
9
|
import styles from "./number-field.module.css";
|
|
10
10
|
|
|
11
|
-
type NumberFieldProps = React.ComponentPropsWithRef<typeof BaseNumberField.Root>;
|
|
12
|
-
type NumberFieldGroupProps = React.ComponentPropsWithRef<typeof BaseNumberField.Group>;
|
|
13
|
-
type NumberFieldInputProps = React.ComponentPropsWithRef<typeof BaseNumberField.Input>;
|
|
14
|
-
type NumberFieldIncrementProps = React.ComponentPropsWithRef<typeof BaseNumberField.Increment>;
|
|
15
|
-
type NumberFieldDecrementProps = React.ComponentPropsWithRef<typeof BaseNumberField.Decrement>;
|
|
16
|
-
type NumberFieldScrubAreaProps = React.ComponentPropsWithRef<typeof BaseNumberField.ScrubArea>;
|
|
17
|
-
|
|
18
11
|
/**
|
|
19
12
|
* Provides a styled numeric input with optional steppers and scrub support.
|
|
20
13
|
*
|
|
@@ -210,37 +203,37 @@ function NumberFieldScrubArea(props: Readonly<NumberFieldScrubArea.Props>): Reac
|
|
|
210
203
|
|
|
211
204
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
212
205
|
namespace NumberField {
|
|
213
|
-
export type Props =
|
|
206
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseNumberField.Root>;
|
|
214
207
|
export type State = BaseNumberField.Root.State;
|
|
215
208
|
}
|
|
216
209
|
|
|
217
210
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
218
211
|
namespace NumberFieldGroup {
|
|
219
|
-
export type Props =
|
|
212
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseNumberField.Group>;
|
|
220
213
|
export type State = BaseNumberField.Group.State;
|
|
221
214
|
}
|
|
222
215
|
|
|
223
216
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
224
217
|
namespace NumberFieldInput {
|
|
225
|
-
export type Props =
|
|
218
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseNumberField.Input>;
|
|
226
219
|
export type State = BaseNumberField.Input.State;
|
|
227
220
|
}
|
|
228
221
|
|
|
229
222
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
230
223
|
namespace NumberFieldIncrement {
|
|
231
|
-
export type Props =
|
|
224
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseNumberField.Increment>;
|
|
232
225
|
export type State = BaseNumberField.Increment.State;
|
|
233
226
|
}
|
|
234
227
|
|
|
235
228
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
236
229
|
namespace NumberFieldDecrement {
|
|
237
|
-
export type Props =
|
|
230
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseNumberField.Decrement>;
|
|
238
231
|
export type State = BaseNumberField.Decrement.State;
|
|
239
232
|
}
|
|
240
233
|
|
|
241
234
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
242
235
|
namespace NumberFieldScrubArea {
|
|
243
|
-
export type Props =
|
|
236
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseNumberField.ScrubArea>;
|
|
244
237
|
export type State = BaseNumberField.ScrubArea.State;
|
|
245
238
|
}
|
|
246
239
|
|
|
@@ -33,13 +33,14 @@ export interface ProgressProps extends Omit<React.ComponentPropsWithRef<typeof B
|
|
|
33
33
|
*
|
|
34
34
|
* @see {@link https://base-ui.com/react/components/progress | Base UI Documentation}
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
const Progress = React.forwardRef<HTMLDivElement, Progress.Props>(function Progress(props, forwardedRef) {
|
|
37
37
|
const {className, render, value = 0, ...otherProps} = props;
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<BaseProgress.Root
|
|
41
41
|
value={value}
|
|
42
42
|
{...otherProps}
|
|
43
|
+
ref={forwardedRef}
|
|
43
44
|
render={useRender({
|
|
44
45
|
defaultTagName: "div",
|
|
45
46
|
render: render as never,
|
|
@@ -49,7 +50,7 @@ function Progress(props: Readonly<Progress.Props>): React.ReactElement {
|
|
|
49
50
|
</BaseProgress.Track>
|
|
50
51
|
</BaseProgress.Root>
|
|
51
52
|
);
|
|
52
|
-
}
|
|
53
|
+
});
|
|
53
54
|
Progress.displayName = "Progress";
|
|
54
55
|
|
|
55
56
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
@@ -10,9 +10,6 @@ import * as React from "react";
|
|
|
10
10
|
import {cn} from "@/lib/utilities";
|
|
11
11
|
import styles from "./radio-group.module.css";
|
|
12
12
|
|
|
13
|
-
type RadioGroupProps = React.ComponentPropsWithRef<typeof BaseRadioGroup>;
|
|
14
|
-
type RadioGroupItemProps = React.ComponentPropsWithRef<typeof Radio.Root>;
|
|
15
|
-
|
|
16
13
|
/**
|
|
17
14
|
* Coordinates radio group state and selection behavior.
|
|
18
15
|
*
|
|
@@ -84,13 +81,13 @@ const RadioGroupItem = React.forwardRef<React.ComponentRef<typeof Radio.Root>, R
|
|
|
84
81
|
|
|
85
82
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
86
83
|
namespace RadioGroup {
|
|
87
|
-
export type Props =
|
|
84
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseRadioGroup>;
|
|
88
85
|
export type State = BaseRadioGroup.State;
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
92
89
|
namespace RadioGroupItem {
|
|
93
|
-
export type Props =
|
|
90
|
+
export type Props = React.ComponentPropsWithRef<typeof Radio.Root>;
|
|
94
91
|
export type State = Radio.Root.State;
|
|
95
92
|
}
|
|
96
93
|
|
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import {GripVertical} from "lucide-react";
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import type {
|
|
7
|
+
import type {GroupImperativeHandle, PanelImperativeHandle} from "react-resizable-panels";
|
|
8
8
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
9
9
|
|
|
10
10
|
import {cn} from "@/lib/utilities";
|
|
11
11
|
|
|
12
12
|
import styles from "./resizable.module.css";
|
|
13
13
|
|
|
14
|
-
export type {
|
|
14
|
+
export type {GroupImperativeHandle, PanelImperativeHandle};
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Props for the {@link ResizablePanelGroup} component.
|
|
18
18
|
*/
|
|
19
|
-
export type ResizablePanelGroupProps = React.ComponentProps<typeof ResizablePrimitive.
|
|
19
|
+
export type ResizablePanelGroupProps = React.ComponentProps<typeof ResizablePrimitive.Group>;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Props for the {@link ResizablePanel} component.
|
|
@@ -28,7 +28,7 @@ export type ResizablePanelProps = React.ComponentProps<typeof ResizablePrimitive
|
|
|
28
28
|
*
|
|
29
29
|
* @see {@link https://github.com/bvaughn/react-resizable-panels | react-resizable-panels docs}
|
|
30
30
|
*/
|
|
31
|
-
export interface ResizableHandleProps extends React.ComponentProps<typeof ResizablePrimitive.
|
|
31
|
+
export interface ResizableHandleProps extends React.ComponentProps<typeof ResizablePrimitive.Separator> {
|
|
32
32
|
/**
|
|
33
33
|
* Renders a visual drag grip inside the resize handle to indicate that adjacent panels can be resized.
|
|
34
34
|
*
|
|
@@ -42,26 +42,25 @@ export interface ResizableHandleProps extends React.ComponentProps<typeof Resiza
|
|
|
42
42
|
* Wraps `react-resizable-panels` panel groups with shared styles.
|
|
43
43
|
*
|
|
44
44
|
* @remarks
|
|
45
|
-
* - Third-party wrapper component
|
|
45
|
+
* - Third-party wrapper component (v4 API: `Group` with `orientation` prop)
|
|
46
46
|
* - Styling via CSS Modules with `--ac-*` custom properties
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```tsx
|
|
50
|
-
* <ResizablePanelGroup
|
|
50
|
+
* <ResizablePanelGroup orientation='horizontal'>...</ResizablePanelGroup>
|
|
51
51
|
* ```
|
|
52
52
|
*
|
|
53
53
|
* @see {@link ResizablePanelGroupProps} for available props
|
|
54
54
|
* @see {@link https://github.com/bvaughn/react-resizable-panels | react-resizable-panels docs}
|
|
55
|
-
* @see {@link https://github.com/bvaughn/react-resizable-panels/tree/main/packages/react-resizable-panels#readme | react-resizable-panels API reference}
|
|
56
55
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<ResizablePrimitive.
|
|
60
|
-
ref={ref}
|
|
56
|
+
function ResizablePanelGroup({className, ...props}: Readonly<ResizablePanelGroupProps>): React.JSX.Element {
|
|
57
|
+
return (
|
|
58
|
+
<ResizablePrimitive.Group
|
|
61
59
|
className={cn(styles.group, className)}
|
|
62
60
|
{...props}
|
|
63
61
|
/>
|
|
64
|
-
)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
65
64
|
|
|
66
65
|
/**
|
|
67
66
|
* Re-exports the underlying resizable panel primitive for consistent composition.
|
|
@@ -72,12 +71,11 @@ const ResizablePanelGroup: React.ForwardRefExoticComponent<ResizablePanelGroupPr
|
|
|
72
71
|
*
|
|
73
72
|
* @example
|
|
74
73
|
* ```tsx
|
|
75
|
-
* <ResizablePanel defaultSize=
|
|
74
|
+
* <ResizablePanel defaultSize="50%">Content</ResizablePanel>
|
|
76
75
|
* ```
|
|
77
76
|
*
|
|
78
77
|
* @see {@link ResizablePanelProps} for available props
|
|
79
78
|
* @see {@link https://github.com/bvaughn/react-resizable-panels | react-resizable-panels docs}
|
|
80
|
-
* @see {@link https://github.com/bvaughn/react-resizable-panels/tree/main/packages/react-resizable-panels#readme | react-resizable-panels API reference}
|
|
81
79
|
*/
|
|
82
80
|
const ResizablePanel = ResizablePrimitive.Panel;
|
|
83
81
|
|
|
@@ -85,7 +83,7 @@ const ResizablePanel = ResizablePrimitive.Panel;
|
|
|
85
83
|
* Renders a draggable resize handle between resizable panels.
|
|
86
84
|
*
|
|
87
85
|
* @remarks
|
|
88
|
-
* - Third-party wrapper component
|
|
86
|
+
* - Third-party wrapper component (v4 API: `Separator`)
|
|
89
87
|
* - Styling via CSS Modules with `--ac-*` custom properties
|
|
90
88
|
*
|
|
91
89
|
* @example
|
|
@@ -95,11 +93,10 @@ const ResizablePanel = ResizablePrimitive.Panel;
|
|
|
95
93
|
*
|
|
96
94
|
* @see {@link ResizableHandleProps} for available props
|
|
97
95
|
* @see {@link https://github.com/bvaughn/react-resizable-panels | react-resizable-panels docs}
|
|
98
|
-
* @see {@link https://github.com/bvaughn/react-resizable-panels/tree/main/packages/react-resizable-panels#readme | react-resizable-panels API reference}
|
|
99
96
|
*/
|
|
100
97
|
function ResizableHandle({withHandle = false, className, children, ...props}: Readonly<ResizableHandleProps>): React.JSX.Element {
|
|
101
98
|
return (
|
|
102
|
-
<ResizablePrimitive.
|
|
99
|
+
<ResizablePrimitive.Separator
|
|
103
100
|
className={cn(styles.handle, className)}
|
|
104
101
|
{...props}>
|
|
105
102
|
{Boolean(withHandle) && (
|
|
@@ -108,7 +105,7 @@ function ResizableHandle({withHandle = false, className, children, ...props}: Re
|
|
|
108
105
|
</div>
|
|
109
106
|
)}
|
|
110
107
|
{children}
|
|
111
|
-
</ResizablePrimitive.
|
|
108
|
+
</ResizablePrimitive.Separator>
|
|
112
109
|
);
|
|
113
110
|
}
|
|
114
111
|
|
|
@@ -43,15 +43,10 @@ const ignoreAnimationError = (): null => null;
|
|
|
43
43
|
*
|
|
44
44
|
* @see {@link ScratcherProps} for available props
|
|
45
45
|
*/
|
|
46
|
-
export const Scratcher
|
|
47
|
-
width,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onComplete,
|
|
51
|
-
children,
|
|
52
|
-
className,
|
|
53
|
-
gradientColors = defaultGradientColors,
|
|
54
|
-
}): React.JSX.Element => {
|
|
46
|
+
export const Scratcher = React.forwardRef<HTMLDivElement, ScratcherProps>(function Scratcher(
|
|
47
|
+
{width, height, minScratchPercentage = 50, onComplete, children, className, gradientColors = defaultGradientColors},
|
|
48
|
+
forwardedRef,
|
|
49
|
+
) {
|
|
55
50
|
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
56
51
|
const [isScratching, setIsScratching] = useState(false);
|
|
57
52
|
const [isComplete, setIsComplete] = useState(false);
|
|
@@ -173,6 +168,7 @@ export const Scratcher: React.FC<ScratcherProps> = ({
|
|
|
173
168
|
|
|
174
169
|
return (
|
|
175
170
|
<motion.div
|
|
171
|
+
ref={forwardedRef}
|
|
176
172
|
className={cn(styles.root, className)}
|
|
177
173
|
style={{
|
|
178
174
|
width,
|
|
@@ -192,6 +188,6 @@ export const Scratcher: React.FC<ScratcherProps> = ({
|
|
|
192
188
|
{children}
|
|
193
189
|
</motion.div>
|
|
194
190
|
);
|
|
195
|
-
};
|
|
191
|
+
});
|
|
196
192
|
|
|
197
193
|
Scratcher.displayName = "Scratcher";
|
|
@@ -8,9 +8,6 @@ import * as React from "react";
|
|
|
8
8
|
import {cn} from "@/lib/utilities";
|
|
9
9
|
import styles from "./scroll-area.module.css";
|
|
10
10
|
|
|
11
|
-
type ScrollAreaProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Root>;
|
|
12
|
-
type ScrollBarProps = React.ComponentPropsWithRef<typeof BaseScrollArea.Scrollbar>;
|
|
13
|
-
|
|
14
11
|
/**
|
|
15
12
|
* Coordinates scroll area layout and scrolling behavior.
|
|
16
13
|
*
|
|
@@ -88,13 +85,13 @@ function ScrollBar(props: Readonly<ScrollBar.Props>): React.ReactElement {
|
|
|
88
85
|
|
|
89
86
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
90
87
|
namespace ScrollArea {
|
|
91
|
-
export type Props =
|
|
88
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseScrollArea.Root>;
|
|
92
89
|
export type State = BaseScrollArea.Root.State;
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
96
93
|
namespace ScrollBar {
|
|
97
|
-
export type Props =
|
|
94
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseScrollArea.Scrollbar>;
|
|
98
95
|
export type State = BaseScrollArea.Scrollbar.State;
|
|
99
96
|
}
|
|
100
97
|
|
|
@@ -36,13 +36,14 @@ export interface SeparatorProps extends Omit<React.ComponentPropsWithRef<typeof
|
|
|
36
36
|
*
|
|
37
37
|
* @see {@link https://base-ui.com/react/components/separator | Base UI Documentation}
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
const {className,
|
|
39
|
+
const Separator = React.forwardRef<HTMLDivElement, Separator.Props>(function Separator(props, forwardedRef) {
|
|
40
|
+
const {className, orientation = "horizontal", render, ...otherProps} = props;
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
43
|
<BaseSeparator
|
|
44
44
|
orientation={orientation}
|
|
45
45
|
{...otherProps}
|
|
46
|
+
ref={forwardedRef}
|
|
46
47
|
render={useRender({
|
|
47
48
|
defaultTagName: "div",
|
|
48
49
|
render: render as never,
|
|
@@ -55,7 +56,7 @@ function Separator(props: Readonly<Separator.Props>): React.ReactElement {
|
|
|
55
56
|
})}
|
|
56
57
|
/>
|
|
57
58
|
);
|
|
58
|
-
}
|
|
59
|
+
});
|
|
59
60
|
Separator.displayName = "Separator";
|
|
60
61
|
|
|
61
62
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
@@ -171,6 +171,7 @@ const SheetClose = BaseDialog.Close;
|
|
|
171
171
|
*/
|
|
172
172
|
const SheetTrigger = React.forwardRef<HTMLButtonElement, SheetTrigger.Props>(
|
|
173
173
|
(props: Readonly<SheetTrigger.Props>, ref): React.ReactElement => {
|
|
174
|
+
// eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API
|
|
174
175
|
const {asChild = false, children, className, render, ...otherProps} = props;
|
|
175
176
|
const renderProp = asChild && React.isValidElement(children) ? children : render;
|
|
176
177
|
|
|
@@ -277,6 +278,7 @@ const SheetContent = React.forwardRef<React.ComponentRef<typeof BaseDialog.Popup
|
|
|
277
278
|
* @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}
|
|
278
279
|
*/
|
|
279
280
|
function SheetHeader(props: Readonly<SheetHeader.Props>): React.ReactElement {
|
|
281
|
+
// eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API
|
|
280
282
|
const {asChild = false, children, className, render, ...otherProps} = props;
|
|
281
283
|
const renderProp = asChild && React.isValidElement(children) ? children : render;
|
|
282
284
|
|
|
@@ -305,6 +307,7 @@ function SheetHeader(props: Readonly<SheetHeader.Props>): React.ReactElement {
|
|
|
305
307
|
* @see {@link https://base-ui.com/react/components/dialog | Base UI Documentation}
|
|
306
308
|
*/
|
|
307
309
|
function SheetFooter(props: Readonly<SheetFooter.Props>): React.ReactElement {
|
|
310
|
+
// eslint-disable-next-line sonarjs/deprecation -- backward-compatible asChild API
|
|
308
311
|
const {asChild = false, children, className, render, ...otherProps} = props;
|
|
309
312
|
const renderProp = asChild && React.isValidElement(children) ? children : render;
|
|
310
313
|
|
|
@@ -13,7 +13,7 @@ import {AlertCircle, BellRing, CheckCircle2, Info, LoaderCircle, TriangleAlert,
|
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
|
|
15
15
|
import {cn} from "@/lib/utilities";
|
|
16
|
-
import styles from "./
|
|
16
|
+
import styles from "./toast.module.css";
|
|
17
17
|
|
|
18
18
|
const DEFAULT_TOAST_DURATION = 5000;
|
|
19
19
|
const DEFAULT_TOAST_LIMIT = 3;
|
|
@@ -384,7 +384,7 @@ function updateToast(toastId: ToastIdentifier, options: ToastUpdateOptions): str
|
|
|
384
384
|
const normalizedToastId = String(toastId);
|
|
385
385
|
const existingRecord = toastRecords.get(normalizedToastId);
|
|
386
386
|
const mergedOptions: ToastOptions = {
|
|
387
|
-
...
|
|
387
|
+
...existingRecord?.options,
|
|
388
388
|
...options,
|
|
389
389
|
};
|
|
390
390
|
const variant = options.variant ?? existingRecord?.snapshot.variant ?? "default";
|
|
@@ -594,16 +594,23 @@ function ToastViewportContent(): React.JSX.Element {
|
|
|
594
594
|
*
|
|
595
595
|
* @see {@link https://base-ui.com/react/components/toast | Base UI Toast Docs}
|
|
596
596
|
*/
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
597
|
+
/**
|
|
598
|
+
* Toaster is the root viewport container for displaying toast notifications.
|
|
599
|
+
* It should be rendered once at the app root level.
|
|
600
|
+
*/
|
|
601
|
+
const Toaster = React.forwardRef<HTMLDivElement, ToasterProps>(function Toaster(
|
|
602
|
+
{
|
|
603
|
+
className,
|
|
604
|
+
closeButton = true,
|
|
605
|
+
containerAriaLabel = DEFAULT_VIEWPORT_ARIA_LABEL,
|
|
606
|
+
duration = DEFAULT_TOAST_DURATION,
|
|
607
|
+
position = "bottom-right",
|
|
608
|
+
style,
|
|
609
|
+
toastOptions,
|
|
610
|
+
visibleToasts = DEFAULT_TOAST_LIMIT,
|
|
611
|
+
},
|
|
612
|
+
forwardedRef,
|
|
613
|
+
) {
|
|
607
614
|
const toasterId = React.useId();
|
|
608
615
|
|
|
609
616
|
React.useEffect(() => {
|
|
@@ -624,6 +631,7 @@ function Toaster({
|
|
|
624
631
|
toastManager={toastManager}>
|
|
625
632
|
<Toast.Portal>
|
|
626
633
|
<Toast.Viewport
|
|
634
|
+
ref={forwardedRef}
|
|
627
635
|
aria-label={containerAriaLabel}
|
|
628
636
|
className={cn(styles.viewport, positionStyles[position], className)}
|
|
629
637
|
style={style}>
|
|
@@ -632,7 +640,7 @@ function Toaster({
|
|
|
632
640
|
</Toast.Portal>
|
|
633
641
|
</Toast.Provider>
|
|
634
642
|
);
|
|
635
|
-
}
|
|
643
|
+
});
|
|
636
644
|
|
|
637
645
|
Toaster.displayName = "Toaster";
|
|
638
646
|
|
|
@@ -776,5 +784,5 @@ toast.promise = async function promise<Value>(promiseValue: ToastPromise<Value>,
|
|
|
776
784
|
toast.getToasts = (): ReadonlyArray<ToastSnapshot> => [...activeToasts.values()];
|
|
777
785
|
toast.getHistory = (): ReadonlyArray<ToastSnapshot> => [...toastHistory];
|
|
778
786
|
|
|
779
|
-
export type {Toast}
|
|
787
|
+
export type {Toast};
|
|
780
788
|
export {toast, Toaster};
|
|
@@ -63,12 +63,13 @@ export interface ToggleGroupItemProps extends Omit<ToggleProps, "pressed" | "def
|
|
|
63
63
|
*
|
|
64
64
|
* @see {@link https://base-ui.com/react/components/toggle-group | Base UI Toggle Group Docs}
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
const ToggleGroup = React.forwardRef<HTMLDivElement, ToggleGroup.Props>(function ToggleGroup(props, forwardedRef) {
|
|
67
67
|
const {className, children, render, size, variant, ...otherProps} = props;
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<BaseToggleGroup
|
|
71
71
|
{...otherProps}
|
|
72
|
+
ref={forwardedRef}
|
|
72
73
|
render={useRender({
|
|
73
74
|
defaultTagName: "div",
|
|
74
75
|
render: render as never,
|
|
@@ -77,7 +78,7 @@ function ToggleGroup(props: Readonly<ToggleGroup.Props>): React.ReactElement {
|
|
|
77
78
|
<ToggleGroupContext.Provider value={{variant, size}}>{children}</ToggleGroupContext.Provider>
|
|
78
79
|
</BaseToggleGroup>
|
|
79
80
|
);
|
|
80
|
-
}
|
|
81
|
+
});
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
84
|
* Renders an individual toggle item within a toggle group.
|
|
@@ -96,12 +97,13 @@ function ToggleGroup(props: Readonly<ToggleGroup.Props>): React.ReactElement {
|
|
|
96
97
|
*
|
|
97
98
|
* @see {@link https://base-ui.com/react/components/toggle-group | Base UI Toggle Group Docs}
|
|
98
99
|
*/
|
|
99
|
-
|
|
100
|
+
const ToggleGroupItem = React.forwardRef<HTMLButtonElement, ToggleGroupItem.Props>(function ToggleGroupItem(props, forwardedRef) {
|
|
100
101
|
const {className, size, variant, ...otherProps} = props;
|
|
101
102
|
const context = React.useContext(ToggleGroupContext);
|
|
102
103
|
|
|
103
104
|
return (
|
|
104
105
|
<Toggle
|
|
106
|
+
ref={forwardedRef}
|
|
105
107
|
className={cn(
|
|
106
108
|
toggleVariants({
|
|
107
109
|
variant: variant ?? context.variant,
|
|
@@ -114,7 +116,7 @@ function ToggleGroupItem(props: Readonly<ToggleGroupItem.Props>): React.ReactEle
|
|
|
114
116
|
{...otherProps}
|
|
115
117
|
/>
|
|
116
118
|
);
|
|
117
|
-
}
|
|
119
|
+
});
|
|
118
120
|
|
|
119
121
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
120
122
|
namespace ToggleGroup {
|
|
@@ -8,12 +8,6 @@ import * as React from "react";
|
|
|
8
8
|
import {cn} from "@/lib/utilities";
|
|
9
9
|
import styles from "./toolbar.module.css";
|
|
10
10
|
|
|
11
|
-
type ToolbarProps = React.ComponentPropsWithRef<typeof BaseToolbar.Root>;
|
|
12
|
-
type ToolbarButtonProps = React.ComponentPropsWithRef<typeof BaseToolbar.Button>;
|
|
13
|
-
type ToolbarGroupProps = React.ComponentPropsWithRef<typeof BaseToolbar.Group>;
|
|
14
|
-
type ToolbarSeparatorProps = React.ComponentPropsWithRef<typeof BaseToolbar.Separator>;
|
|
15
|
-
type ToolbarLinkProps = React.ComponentPropsWithRef<typeof BaseToolbar.Link>;
|
|
16
|
-
|
|
17
11
|
/**
|
|
18
12
|
* Arranges related actions into a keyboard-accessible toolbar.
|
|
19
13
|
*
|
|
@@ -32,12 +26,13 @@ type ToolbarLinkProps = React.ComponentPropsWithRef<typeof BaseToolbar.Link>;
|
|
|
32
26
|
*
|
|
33
27
|
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar Docs}
|
|
34
28
|
*/
|
|
35
|
-
|
|
29
|
+
const Toolbar = React.forwardRef<HTMLDivElement, Toolbar.Props>(function Toolbar(props, forwardedRef) {
|
|
36
30
|
const {className, children, render, ...otherProps} = props;
|
|
37
31
|
|
|
38
32
|
return (
|
|
39
33
|
<BaseToolbar.Root
|
|
40
34
|
{...otherProps}
|
|
35
|
+
ref={forwardedRef}
|
|
41
36
|
render={useRender({
|
|
42
37
|
defaultTagName: "div",
|
|
43
38
|
render: render as never,
|
|
@@ -46,7 +41,7 @@ function Toolbar(props: Readonly<Toolbar.Props>): React.ReactElement {
|
|
|
46
41
|
{children}
|
|
47
42
|
</BaseToolbar.Root>
|
|
48
43
|
);
|
|
49
|
-
}
|
|
44
|
+
});
|
|
50
45
|
|
|
51
46
|
/**
|
|
52
47
|
* Renders an interactive button within a toolbar.
|
|
@@ -63,12 +58,13 @@ function Toolbar(props: Readonly<Toolbar.Props>): React.ReactElement {
|
|
|
63
58
|
*
|
|
64
59
|
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar Docs}
|
|
65
60
|
*/
|
|
66
|
-
|
|
61
|
+
const ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButton.Props>(function ToolbarButton(props, forwardedRef) {
|
|
67
62
|
const {className, children, render, ...otherProps} = props;
|
|
68
63
|
|
|
69
64
|
return (
|
|
70
65
|
<BaseToolbar.Button
|
|
71
66
|
{...otherProps}
|
|
67
|
+
ref={forwardedRef}
|
|
72
68
|
render={useRender({
|
|
73
69
|
defaultTagName: "button",
|
|
74
70
|
render: render as never,
|
|
@@ -77,7 +73,7 @@ function ToolbarButton(props: Readonly<ToolbarButton.Props>): React.ReactElement
|
|
|
77
73
|
{children}
|
|
78
74
|
</BaseToolbar.Button>
|
|
79
75
|
);
|
|
80
|
-
}
|
|
76
|
+
});
|
|
81
77
|
|
|
82
78
|
/**
|
|
83
79
|
* Groups related toolbar controls into a single visual cluster.
|
|
@@ -96,12 +92,13 @@ function ToolbarButton(props: Readonly<ToolbarButton.Props>): React.ReactElement
|
|
|
96
92
|
*
|
|
97
93
|
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar Docs}
|
|
98
94
|
*/
|
|
99
|
-
|
|
95
|
+
const ToolbarGroup = React.forwardRef<HTMLDivElement, ToolbarGroup.Props>(function ToolbarGroup(props, forwardedRef) {
|
|
100
96
|
const {className, children, render, ...otherProps} = props;
|
|
101
97
|
|
|
102
98
|
return (
|
|
103
99
|
<BaseToolbar.Group
|
|
104
100
|
{...otherProps}
|
|
101
|
+
ref={forwardedRef}
|
|
105
102
|
render={useRender({
|
|
106
103
|
defaultTagName: "div",
|
|
107
104
|
render: render as never,
|
|
@@ -110,7 +107,7 @@ function ToolbarGroup(props: Readonly<ToolbarGroup.Props>): React.ReactElement {
|
|
|
110
107
|
{children}
|
|
111
108
|
</BaseToolbar.Group>
|
|
112
109
|
);
|
|
113
|
-
}
|
|
110
|
+
});
|
|
114
111
|
|
|
115
112
|
/**
|
|
116
113
|
* Renders a visual separator between toolbar items or groups.
|
|
@@ -126,12 +123,13 @@ function ToolbarGroup(props: Readonly<ToolbarGroup.Props>): React.ReactElement {
|
|
|
126
123
|
*
|
|
127
124
|
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar Docs}
|
|
128
125
|
*/
|
|
129
|
-
|
|
126
|
+
const ToolbarSeparator = React.forwardRef<HTMLDivElement, ToolbarSeparator.Props>(function ToolbarSeparator(props, forwardedRef) {
|
|
130
127
|
const {className, render, ...otherProps} = props;
|
|
131
128
|
|
|
132
129
|
return (
|
|
133
130
|
<BaseToolbar.Separator
|
|
134
131
|
{...otherProps}
|
|
132
|
+
ref={forwardedRef}
|
|
135
133
|
render={useRender({
|
|
136
134
|
defaultTagName: "div",
|
|
137
135
|
render: render as never,
|
|
@@ -139,7 +137,7 @@ function ToolbarSeparator(props: Readonly<ToolbarSeparator.Props>): React.ReactE
|
|
|
139
137
|
})}
|
|
140
138
|
/>
|
|
141
139
|
);
|
|
142
|
-
}
|
|
140
|
+
});
|
|
143
141
|
|
|
144
142
|
/**
|
|
145
143
|
* Renders a link that visually matches toolbar buttons.
|
|
@@ -155,12 +153,13 @@ function ToolbarSeparator(props: Readonly<ToolbarSeparator.Props>): React.ReactE
|
|
|
155
153
|
*
|
|
156
154
|
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar Docs}
|
|
157
155
|
*/
|
|
158
|
-
|
|
156
|
+
const ToolbarLink = React.forwardRef<HTMLAnchorElement, ToolbarLink.Props>(function ToolbarLink(props, forwardedRef) {
|
|
159
157
|
const {className, children, render, ...otherProps} = props;
|
|
160
158
|
|
|
161
159
|
return (
|
|
162
160
|
<BaseToolbar.Link
|
|
163
161
|
{...otherProps}
|
|
162
|
+
ref={forwardedRef}
|
|
164
163
|
render={useRender({
|
|
165
164
|
defaultTagName: "a",
|
|
166
165
|
render: render as never,
|
|
@@ -169,35 +168,35 @@ function ToolbarLink(props: Readonly<ToolbarLink.Props>): React.ReactElement {
|
|
|
169
168
|
{children}
|
|
170
169
|
</BaseToolbar.Link>
|
|
171
170
|
);
|
|
172
|
-
}
|
|
171
|
+
});
|
|
173
172
|
|
|
174
173
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
175
174
|
namespace Toolbar {
|
|
176
|
-
export type Props =
|
|
175
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseToolbar.Root>;
|
|
177
176
|
export type State = BaseToolbar.Root.State;
|
|
178
177
|
}
|
|
179
178
|
|
|
180
179
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
181
180
|
namespace ToolbarButton {
|
|
182
|
-
export type Props =
|
|
181
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseToolbar.Button>;
|
|
183
182
|
export type State = BaseToolbar.Button.State;
|
|
184
183
|
}
|
|
185
184
|
|
|
186
185
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
187
186
|
namespace ToolbarGroup {
|
|
188
|
-
export type Props =
|
|
187
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseToolbar.Group>;
|
|
189
188
|
export type State = BaseToolbar.Group.State;
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
193
192
|
namespace ToolbarSeparator {
|
|
194
|
-
export type Props =
|
|
193
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseToolbar.Separator>;
|
|
195
194
|
export type State = BaseToolbar.Separator.State;
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
// eslint-disable-next-line no-redeclare -- required for the canonical component namespace typing API
|
|
199
198
|
namespace ToolbarLink {
|
|
200
|
-
export type Props =
|
|
199
|
+
export type Props = React.ComponentPropsWithRef<typeof BaseToolbar.Link>;
|
|
201
200
|
export type State = BaseToolbar.Link.State;
|
|
202
201
|
}
|
|
203
202
|
|