@burtson-labs/ui 0.13.1 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/DEPENDENCIES.txt +2745 -0
- package/LICENSES/Radix-MIT.txt +21 -0
- package/LICENSES/cmdk-MIT.txt +21 -0
- package/LICENSES/overrides/react-remove-scroll-bar.txt +26 -0
- package/LICENSES/shadcn-MIT.txt +21 -0
- package/README.md +20 -12
- package/THIRD_PARTY_NOTICES.md +15 -3
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +22 -18
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +13 -11
- package/dist/components/alert-dialog.js +41 -31
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +5 -3
- package/dist/components/alert.js +12 -7
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-shell.d.ts +7 -6
- package/dist/components/app-shell.js +22 -14
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/attachment.d.ts +3 -3
- package/dist/components/attachment.js +11 -7
- package/dist/components/attachment.js.map +1 -1
- package/dist/components/audio-player.d.ts +2 -2
- package/dist/components/audio-player.js +9 -6
- package/dist/components/audio-player.js.map +1 -1
- package/dist/components/avatar.d.ts +4 -4
- package/dist/components/avatar.js +16 -12
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +15 -13
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +27 -20
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.d.ts +9 -2
- package/dist/components/button.js +15 -6
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +9 -9
- package/dist/components/card.js +33 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/chat-history.d.ts +1 -1
- package/dist/components/chat-history.js +11 -9
- package/dist/components/chat-history.js.map +1 -1
- package/dist/components/chat-layout.d.ts +1 -1
- package/dist/components/chat-layout.js +8 -3
- package/dist/components/chat-layout.js.map +1 -1
- package/dist/components/checkbox-card.d.ts +3 -3
- package/dist/components/checkbox-card.js +12 -10
- package/dist/components/checkbox-card.js.map +1 -1
- package/dist/components/checkbox.d.ts +24 -3
- package/dist/components/checkbox.js +52 -9
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.d.ts +3 -3
- package/dist/components/collapsible.js +14 -11
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +14 -4
- package/dist/components/combobox.js +19 -8
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +68 -12
- package/dist/components/command.js +48 -34
- package/dist/components/command.js.map +1 -1
- package/dist/components/composer.d.ts +2 -2
- package/dist/components/composer.js +10 -7
- package/dist/components/composer.js.map +1 -1
- package/dist/components/connection-status.d.ts +3 -3
- package/dist/components/connection-status.js +19 -14
- package/dist/components/connection-status.js.map +1 -1
- package/dist/components/context-menu.d.ts +15 -14
- package/dist/components/context-menu.js +52 -41
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/conversation.d.ts +1 -1
- package/dist/components/conversation.js +7 -5
- package/dist/components/conversation.js.map +1 -1
- package/dist/components/copy-button.d.ts +1 -1
- package/dist/components/copy-button.js +4 -2
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table.d.ts +7 -2
- package/dist/components/data-table.js +17 -42
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/dialog.d.ts +19 -10
- package/dist/components/dialog.js +50 -33
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +15 -14
- package/dist/components/dropdown-menu.js +52 -41
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editor-tabs.d.ts +1 -1
- package/dist/components/editor-tabs.js +7 -5
- package/dist/components/editor-tabs.js.map +1 -1
- package/dist/components/empty-state.d.ts +5 -5
- package/dist/components/empty-state.js +17 -11
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/error-summary.d.ts +21 -0
- package/dist/components/error-summary.js +62 -0
- package/dist/components/error-summary.js.map +1 -0
- package/dist/components/field.d.ts +66 -7
- package/dist/components/field.js +152 -20
- package/dist/components/field.js.map +1 -1
- package/dist/components/form-actions.d.ts +18 -0
- package/dist/components/form-actions.js +30 -0
- package/dist/components/form-actions.js.map +1 -0
- package/dist/components/icon-button.d.ts +3 -1
- package/dist/components/icon-button.js +6 -3
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/input.d.ts +42 -7
- package/dist/components/input.js +54 -10
- package/dist/components/input.js.map +1 -1
- package/dist/components/kbd.d.ts +2 -2
- package/dist/components/kbd.js +8 -5
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/label.d.ts +7 -2
- package/dist/components/label.js +14 -7
- package/dist/components/label.js.map +1 -1
- package/dist/components/markdown.d.ts +4 -3
- package/dist/components/markdown.js +8 -6
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/menubar.d.ts +17 -15
- package/dist/components/menubar.js +58 -45
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/message-actions.d.ts +3 -3
- package/dist/components/message-actions.js +16 -12
- package/dist/components/message-actions.js.map +1 -1
- package/dist/components/message.d.ts +1 -1
- package/dist/components/message.js +6 -3
- package/dist/components/message.js.map +1 -1
- package/dist/components/mobile-nav.d.ts +1 -1
- package/dist/components/mobile-nav.js +7 -5
- package/dist/components/mobile-nav.js.map +1 -1
- package/dist/components/native-select.d.ts +16 -0
- package/dist/components/native-select.js +33 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +13 -12
- package/dist/components/navigation-menu.js +43 -33
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/number-input.d.ts +23 -0
- package/dist/components/number-input.js +45 -0
- package/dist/components/number-input.js.map +1 -0
- package/dist/components/onboarding-checklist.d.ts +1 -1
- package/dist/components/onboarding-checklist.js +5 -3
- package/dist/components/onboarding-checklist.js.map +1 -1
- package/dist/components/page-header.d.ts +7 -6
- package/dist/components/page-header.js +23 -15
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +4 -2
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.d.ts +14 -11
- package/dist/components/popover.js +30 -23
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +11 -9
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.d.ts +23 -4
- package/dist/components/radio-group.js +56 -14
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/reasoning.d.ts +3 -3
- package/dist/components/reasoning.js +14 -11
- package/dist/components/reasoning.js.map +1 -1
- package/dist/components/resizable.js +1 -0
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scroll-area.d.ts +4 -3
- package/dist/components/scroll-area.js +18 -14
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/secret-input.d.ts +3 -2
- package/dist/components/secret-input.js +7 -4
- package/dist/components/secret-input.js.map +1 -1
- package/dist/components/select.d.ts +12 -7
- package/dist/components/select.js +42 -35
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/separator.js +8 -6
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.d.ts +11 -9
- package/dist/components/sheet.js +41 -29
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/skeleton.d.ts +2 -1
- package/dist/components/skeleton.js +7 -4
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +10 -6
- package/dist/components/slider.js +16 -7
- package/dist/components/slider.js.map +1 -1
- package/dist/components/source.d.ts +2 -2
- package/dist/components/source.js +10 -7
- package/dist/components/source.js.map +1 -1
- package/dist/components/spinner.d.ts +4 -2
- package/dist/components/spinner.js +5 -3
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stat-card.d.ts +27 -2
- package/dist/components/stat-card.js +70 -9
- package/dist/components/stat-card.js.map +1 -1
- package/dist/components/status.d.ts +7 -6
- package/dist/components/status.js +12 -5
- package/dist/components/status.js.map +1 -1
- package/dist/components/steps.d.ts +1 -1
- package/dist/components/steps.js +5 -3
- package/dist/components/steps.js.map +1 -1
- package/dist/components/switch.d.ts +47 -3
- package/dist/components/switch.js +89 -11
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +29 -12
- package/dist/components/table.js +80 -34
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +10 -5
- package/dist/components/tabs.js +29 -19
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.d.ts +6 -1
- package/dist/components/textarea.js +4 -3
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.d.ts +11 -7
- package/dist/components/toast.js +37 -27
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toaster.d.ts +4 -2
- package/dist/components/toaster.js +7 -2
- package/dist/components/toaster.js.map +1 -1
- package/dist/components/tool-call.d.ts +2 -2
- package/dist/components/tool-call.js +15 -12
- package/dist/components/tool-call.js.map +1 -1
- package/dist/components/toolbar.d.ts +9 -4
- package/dist/components/toolbar.js +15 -9
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.d.ts +4 -3
- package/dist/components/tooltip.js +17 -13
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tour.js +10 -8
- package/dist/components/tour.js.map +1 -1
- package/dist/components/tree-view.d.ts +1 -1
- package/dist/components/tree-view.js +10 -5
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/voice-recorder.d.ts +1 -1
- package/dist/components/voice-recorder.js +5 -2
- package/dist/components/voice-recorder.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +17 -12
- package/dist/lib/media.d.ts +18 -0
- package/dist/lib/media.js +34 -0
- package/dist/lib/media.js.map +1 -0
- package/dist/lib/utils.d.ts +32 -0
- package/dist/lib/utils.js +33 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/mui/index.js +20 -8
- package/dist/mui/index.js.map +1 -1
- package/dist/primitives/vendor/cmdk/command-score.d.ts +1 -0
- package/dist/primitives/vendor/cmdk/command-score.js +64 -0
- package/dist/primitives/vendor/cmdk/command-score.js.map +1 -0
- package/dist/primitives/vendor/cmdk/index.d.ts +384 -0
- package/dist/primitives/vendor/cmdk/index.js +687 -0
- package/dist/primitives/vendor/cmdk/index.js.map +1 -0
- package/dist/primitives/vendor/radix/number/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/number/number.d.ts +2 -0
- package/dist/primitives/vendor/radix/number/number.js +9 -0
- package/dist/primitives/vendor/radix/number/number.js.map +1 -0
- package/dist/primitives/vendor/radix/primitive/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/primitive/is-development.d.ts +1 -0
- package/dist/primitives/vendor/radix/primitive/is-development.js +7 -0
- package/dist/primitives/vendor/radix/primitive/is-development.js.map +1 -0
- package/dist/primitives/vendor/radix/primitive/primitive.d.ts +14 -0
- package/dist/primitives/vendor/radix/primitive/primitive.js +12 -0
- package/dist/primitives/vendor/radix/primitive/primitive.js.map +1 -0
- package/dist/primitives/vendor/radix/primitive/types.d.ts +5 -0
- package/dist/primitives/vendor/radix/react-accordion/accordion.d.ts +112 -0
- package/dist/primitives/vendor/radix/react-accordion/accordion.js +266 -0
- package/dist/primitives/vendor/radix/react-accordion/accordion.js.map +1 -0
- package/dist/primitives/vendor/radix/react-accordion/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.d.ts +49 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js +122 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js.map +1 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-arrow/arrow.d.ts +9 -0
- package/dist/primitives/vendor/radix/react-arrow/arrow.js +22 -0
- package/dist/primitives/vendor/radix/react-arrow/arrow.js.map +1 -0
- package/dist/primitives/vendor/radix/react-arrow/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-avatar/avatar.d.ts +19 -0
- package/dist/primitives/vendor/radix/react-avatar/avatar.js +132 -0
- package/dist/primitives/vendor/radix/react-avatar/avatar.js.map +1 -0
- package/dist/primitives/vendor/radix/react-avatar/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-checkbox/checkbox.d.ts +47 -0
- package/dist/primitives/vendor/radix/react-checkbox/checkbox.js +197 -0
- package/dist/primitives/vendor/radix/react-checkbox/checkbox.js.map +1 -0
- package/dist/primitives/vendor/radix/react-checkbox/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-collapsible/collapsible.d.ts +31 -0
- package/dist/primitives/vendor/radix/react-collapsible/collapsible.js +133 -0
- package/dist/primitives/vendor/radix/react-collapsible/collapsible.js.map +1 -0
- package/dist/primitives/vendor/radix/react-collapsible/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-collection/collection-legacy.d.ts +21 -0
- package/dist/primitives/vendor/radix/react-collection/collection-legacy.js +84 -0
- package/dist/primitives/vendor/radix/react-collection/collection-legacy.js.map +1 -0
- package/dist/primitives/vendor/radix/react-collection/collection.d.ts +32 -0
- package/dist/primitives/vendor/radix/react-collection/index.d.ts +4 -0
- package/dist/primitives/vendor/radix/react-collection/ordered-dictionary.d.ts +51 -0
- package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.d.ts +13 -0
- package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js +43 -0
- package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js.map +1 -0
- package/dist/primitives/vendor/radix/react-compose-refs/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-context/create-context.d.ts +45 -0
- package/dist/primitives/vendor/radix/react-context/create-context.js +74 -0
- package/dist/primitives/vendor/radix/react-context/create-context.js.map +1 -0
- package/dist/primitives/vendor/radix/react-context/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-context-menu/context-menu.d.ts +95 -0
- package/dist/primitives/vendor/radix/react-context-menu/context-menu.js +279 -0
- package/dist/primitives/vendor/radix/react-context-menu/context-menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-context-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-dialog/dialog.d.ts +97 -0
- package/dist/primitives/vendor/radix/react-dialog/dialog.js +262 -0
- package/dist/primitives/vendor/radix/react-dialog/dialog.js.map +1 -0
- package/dist/primitives/vendor/radix/react-dialog/index.d.ts +4 -0
- package/dist/primitives/vendor/radix/react-direction/direction.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-direction/direction.js +13 -0
- package/dist/primitives/vendor/radix/react-direction/direction.js.map +1 -0
- package/dist/primitives/vendor/radix/react-direction/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.d.ts +61 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js +336 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js.map +1 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/index.d.ts +4 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.d.ts +95 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js +257 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.d.ts +11 -0
- package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js +49 -0
- package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js.map +1 -0
- package/dist/primitives/vendor/radix/react-focus-guards/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.d.ts +31 -0
- package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js +221 -0
- package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js.map +1 -0
- package/dist/primitives/vendor/radix/react-focus-scope/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-id/id.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-id/id.js +17 -0
- package/dist/primitives/vendor/radix/react-id/id.js.map +1 -0
- package/dist/primitives/vendor/radix/react-id/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-label/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-label/label.d.ts +9 -0
- package/dist/primitives/vendor/radix/react-label/label.js +21 -0
- package/dist/primitives/vendor/radix/react-label/label.js.map +1 -0
- package/dist/primitives/vendor/radix/react-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-menu/menu.d.ts +173 -0
- package/dist/primitives/vendor/radix/react-menu/menu.js +806 -0
- package/dist/primitives/vendor/radix/react-menu/menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-menubar/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-menubar/menubar.d.ts +106 -0
- package/dist/primitives/vendor/radix/react-menubar/menubar.js +377 -0
- package/dist/primitives/vendor/radix/react-menubar/menubar.js.map +1 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.d.ts +124 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js +743 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-popover/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-popover/popover.d.ts +83 -0
- package/dist/primitives/vendor/radix/react-popover/popover.js +236 -0
- package/dist/primitives/vendor/radix/react-popover/popover.js.map +1 -0
- package/dist/primitives/vendor/radix/react-popper/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-popper/popper.d.ts +44 -0
- package/dist/primitives/vendor/radix/react-popper/popper.js +276 -0
- package/dist/primitives/vendor/radix/react-popper/popper.js.map +1 -0
- package/dist/primitives/vendor/radix/react-portal/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-portal/portal.d.ts +13 -0
- package/dist/primitives/vendor/radix/react-portal/portal.js +21 -0
- package/dist/primitives/vendor/radix/react-portal/portal.js.map +1 -0
- package/dist/primitives/vendor/radix/react-presence/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-presence/presence.d.ts +11 -0
- package/dist/primitives/vendor/radix/react-presence/presence.js +152 -0
- package/dist/primitives/vendor/radix/react-presence/presence.js.map +1 -0
- package/dist/primitives/vendor/radix/react-presence/use-state-machine.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-presence/use-state-machine.js +12 -0
- package/dist/primitives/vendor/radix/react-presence/use-state-machine.js.map +1 -0
- package/dist/primitives/vendor/radix/react-primitive/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-primitive/primitive.d.ts +56 -0
- package/dist/primitives/vendor/radix/react-primitive/primitive.js +84 -0
- package/dist/primitives/vendor/radix/react-primitive/primitive.js.map +1 -0
- package/dist/primitives/vendor/radix/react-progress/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-progress/progress.d.ts +17 -0
- package/dist/primitives/vendor/radix/react-progress/progress.js +79 -0
- package/dist/primitives/vendor/radix/react-progress/progress.js.map +1 -0
- package/dist/primitives/vendor/radix/react-radio-group/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio-group.d.ts +55 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio-group.js +173 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio-group.js.map +1 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio.d.ts +62 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio.js +150 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio.js.map +1 -0
- package/dist/primitives/vendor/radix/react-roving-focus/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.d.ts +47 -0
- package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js +218 -0
- package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js.map +1 -0
- package/dist/primitives/vendor/radix/react-scroll-area/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.d.ts +121 -0
- package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js +713 -0
- package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js.map +1 -0
- package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js +12 -0
- package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js.map +1 -0
- package/dist/primitives/vendor/radix/react-select/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-select/select.d.ts +163 -0
- package/dist/primitives/vendor/radix/react-select/select.js +1040 -0
- package/dist/primitives/vendor/radix/react-select/select.js.map +1 -0
- package/dist/primitives/vendor/radix/react-separator/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-separator/separator.d.ts +20 -0
- package/dist/primitives/vendor/radix/react-separator/separator.js +29 -0
- package/dist/primitives/vendor/radix/react-separator/separator.js.map +1 -0
- package/dist/primitives/vendor/radix/react-slot/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-slot/slot.d.ts +29 -0
- package/dist/primitives/vendor/radix/react-slot/slot.js +107 -0
- package/dist/primitives/vendor/radix/react-slot/slot.js.map +1 -0
- package/dist/primitives/vendor/radix/react-switch/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-switch/switch.d.ts +41 -0
- package/dist/primitives/vendor/radix/react-switch/switch.js +185 -0
- package/dist/primitives/vendor/radix/react-switch/switch.js.map +1 -0
- package/dist/primitives/vendor/radix/react-tabs/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-tabs/tabs.d.ts +54 -0
- package/dist/primitives/vendor/radix/react-tabs/tabs.js +145 -0
- package/dist/primitives/vendor/radix/react-tabs/tabs.js.map +1 -0
- package/dist/primitives/vendor/radix/react-toast/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-toast/toast.d.ts +125 -0
- package/dist/primitives/vendor/radix/react-toast/toast.js +557 -0
- package/dist/primitives/vendor/radix/react-toast/toast.js.map +1 -0
- package/dist/primitives/vendor/radix/react-tooltip/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-tooltip/tooltip.d.ts +99 -0
- package/dist/primitives/vendor/radix/react-tooltip/tooltip.js +503 -0
- package/dist/primitives/vendor/radix/react-tooltip/tooltip.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.d.ts +6 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js +18 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state-reducer.d.ts +28 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.d.ts +11 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js +59 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-effect-event/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-effect-event/use-effect-event.d.ts +7 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js +18 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.d.ts +6 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js +19 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js +15 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-previous/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-previous/use-previous.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-use-previous/use-previous.js +20 -0
- package/dist/primitives/vendor/radix/react-use-previous/use-previous.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-size/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-size/use-size.d.ts +5 -0
- package/dist/primitives/vendor/radix/react-use-size/use-size.js +42 -0
- package/dist/primitives/vendor/radix/react-use-size/use-size.js.map +1 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.d.ts +21 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js +32 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js.map +1 -0
- package/dist/primitives/vendor/radix/rect/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/rect/observe-element-rect.d.ts +16 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +36 -17
- package/dist/tokens.d.ts +78 -36
- package/dist/tokens.js +63 -32
- package/dist/tokens.js.map +1 -1
- package/package.json +25 -13
- package/vendor-manifest.json +1101 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":["MenuPrimitive.Root","_Fragment","MenuPrimitive.Anchor","MenuPrimitive.Portal","MenuPrimitive.Content","MenuPrimitive.Group","MenuPrimitive.Label","MenuPrimitive.Item","MenuPrimitive.CheckboxItem","MenuPrimitive.RadioGroup","MenuPrimitive.RadioItem","MenuPrimitive.ItemIndicator","MenuPrimitive.Separator","MenuPrimitive.Sub","MenuPrimitive.SubTrigger","MenuPrimitive.SubContent"],"sources":["../../../../../src/primitives/vendor/radix/react-context-menu/context-menu.tsx"],"sourcesContent":["// Vendored from Radix Primitives (c) 2022 WorkOS, MIT. See vendor/LICENSE.radix.\n// Local modification: package imports resolve to the pinned local source.\nimport * as React from 'react';\nimport { IS_DEVELOPMENT } from '../primitive/is-development';\nimport { composeEventHandlers } from '../primitive';\nimport { createContextScope } from '../react-context';\nimport { Primitive } from '../react-primitive';\nimport * as MenuPrimitive from '../react-menu';\nimport { createMenuScope } from '../react-menu';\nimport { useControllableState } from '../react-use-controllable-state';\nimport type { Scope } from '../react-context';\n\ntype Direction = 'ltr' | 'rtl';\ntype Point = { x: number; y: number };\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTEXT_MENU_NAME = 'ContextMenu';\n\ntype ScopedProps<P> = P & { __scopeContextMenu?: Scope };\nconst [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [\n createMenuScope,\n]);\nconst useMenuScope = createMenuScope();\n\ninterface ContextMenuContextValue {\n open: boolean;\n onOpenChange(open: boolean): void;\n modal: boolean;\n hasInteractedRef: React.RefObject<boolean>;\n}\n\nconst [ContextMenuProvider, useContextMenuContext] =\n createContextMenuContext<ContextMenuContextValue>(CONTEXT_MENU_NAME);\n\ninterface ContextMenuProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst ContextMenu: React.FC<ContextMenuProps> = (props: ScopedProps<ContextMenuProps>) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, dir, modal = true } = props;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n const hasInteractedRef = React.useRef(false);\n if (IS_DEVELOPMENT) {\n const hasWarnedRef = React.useRef(false);\n React.useEffect(() => {\n if (openProp === true && !hasInteractedRef.current && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n // dev warning: open prop is controllable but its position has not been set\n // because the user has not interacted with the trigger. The controllable\n // state is only enabled so that the user can read or programatically close\n // the menu. Programatically opening the menu will anchor it to the most\n // recently interacted position.\n console.warn(\n 'ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport.',\n );\n }\n }, [openProp]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: false,\n onChange: onOpenChange,\n caller: CONTEXT_MENU_NAME,\n });\n\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n <ContextMenuProvider\n scope={__scopeContextMenu}\n open={open}\n onOpenChange={setOpen}\n modal={modal}\n hasInteractedRef={hasInteractedRef}\n >\n <MenuPrimitive.Root {...menuScope} dir={dir} open={open} onOpenChange={setOpen} modal={modal}>\n {children}\n </MenuPrimitive.Root>\n </ContextMenuProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'ContextMenuTrigger';\n\ntype ContextMenuTriggerElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface ContextMenuTriggerProps extends PrimitiveSpanProps {\n disabled?: boolean;\n}\n\nconst ContextMenuTrigger = /* @__PURE__ */ React.forwardRef<\n ContextMenuTriggerElement,\n ContextMenuTriggerProps\n>(\n // blank line to reduce diff noise\n function ContextMenuTrigger(props: ScopedProps<ContextMenuTriggerProps>, forwardedRef) {\n const { __scopeContextMenu, disabled = false, ...triggerProps } = props;\n const context = useContextMenuContext(TRIGGER_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const [point, setPoint] = React.useState<Point>({ x: 0, y: 0 });\n\n // Re-create the virtual anchor whenever the pointer position changes so the\n // content re-anchors to the latest point when the menu is re-triggered while\n // already open (e.g. right-clicking in a new location, #2611).\n const virtualRef = React.useMemo(\n () => ({\n current: {\n getBoundingClientRect: () => DOMRect.fromRect({ width: 0, height: 0, ...point }),\n },\n }),\n [point],\n );\n const longPressTimerRef = React.useRef(0);\n const clearLongPress = React.useCallback(\n () => window.clearTimeout(longPressTimerRef.current),\n [],\n );\n const handleOpen = (event: React.MouseEvent | React.PointerEvent) => {\n context.hasInteractedRef.current = true;\n setPoint({ x: event.clientX, y: event.clientY });\n context.onOpenChange(true);\n };\n\n React.useEffect(() => clearLongPress, [clearLongPress]);\n React.useEffect(() => void (disabled && clearLongPress()), [disabled, clearLongPress]);\n\n return (\n <>\n <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef} />\n <Primitive.span\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n {...triggerProps}\n ref={forwardedRef}\n // prevent iOS context menu from appearing\n style={{ WebkitTouchCallout: 'none', ...props.style }}\n // if trigger is disabled, enable the native Context Menu\n onContextMenu={\n disabled\n ? props.onContextMenu\n : composeEventHandlers(props.onContextMenu, (event) => {\n // clearing the long press here because some platforms already support\n // long press to trigger a `contextmenu` event\n clearLongPress();\n handleOpen(event);\n event.preventDefault();\n })\n }\n onPointerDown={\n disabled\n ? props.onPointerDown\n : composeEventHandlers(\n props.onPointerDown,\n whenTouchOrPen((event) => {\n // clear the long press here in case there's multiple touch points\n clearLongPress();\n if (context.open) {\n context.onOpenChange(false);\n }\n longPressTimerRef.current = window.setTimeout(() => handleOpen(event), 700);\n }),\n )\n }\n onPointerMove={\n disabled\n ? props.onPointerMove\n : composeEventHandlers(props.onPointerMove, whenTouchOrPen(clearLongPress))\n }\n onPointerCancel={\n disabled\n ? props.onPointerCancel\n : composeEventHandlers(props.onPointerCancel, whenTouchOrPen(clearLongPress))\n }\n onPointerUp={\n disabled\n ? props.onPointerUp\n : composeEventHandlers(props.onPointerUp, whenTouchOrPen(clearLongPress))\n }\n />\n </>\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ninterface ContextMenuPortalProps extends MenuPortalProps {}\n\nconst ContextMenuPortal: React.FC<ContextMenuPortalProps> = (\n props: ScopedProps<ContextMenuPortalProps>,\n) => {\n const { __scopeContextMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'ContextMenuContent';\n\ntype ContextMenuContentElement = React.ComponentRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface ContextMenuContentProps extends Omit<\n MenuContentProps,\n 'onEntryFocus' | 'side' | 'sideOffset' | 'align'\n> {}\n\nconst ContextMenuContent = /* @__PURE__ */ React.forwardRef<\n ContextMenuContentElement,\n ContextMenuContentProps\n>(\n // blank line to reduce diff noise\n function ContextMenuContent(props: ScopedProps<ContextMenuContentProps>, forwardedRef) {\n const { __scopeContextMenu, ...contentProps } = props;\n const context = useContextMenuContext(CONTENT_NAME, __scopeContextMenu);\n const menuScope = useMenuScope(__scopeContextMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <MenuPrimitive.Content\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n side=\"right\"\n sideOffset={2}\n align=\"start\"\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented && hasInteractedOutsideRef.current) {\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented && !context.modal) hasInteractedOutsideRef.current = true;\n }}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-context-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-context-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-context-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-context-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-context-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuGroupElement = React.ComponentRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface ContextMenuGroupProps extends MenuGroupProps {}\n\nconst ContextMenuGroup = /* @__PURE__ */ React.forwardRef<\n ContextMenuGroupElement,\n ContextMenuGroupProps\n>(\n // blank line to reduce diff noise\n function ContextMenuGroup(props: ScopedProps<ContextMenuGroupProps>, forwardedRef) {\n const { __scopeContextMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuLabelElement = React.ComponentRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface ContextMenuLabelProps extends MenuLabelProps {}\n\nconst ContextMenuLabel = /* @__PURE__ */ React.forwardRef<\n ContextMenuLabelElement,\n ContextMenuLabelProps\n>(\n // blank line to reduce diff noise\n function ContextMenuLabel(props: ScopedProps<ContextMenuLabelProps>, forwardedRef) {\n const { __scopeContextMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuItemElement = React.ComponentRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface ContextMenuItemProps extends MenuItemProps {}\n\nconst ContextMenuItem = /* @__PURE__ */ React.forwardRef<\n ContextMenuItemElement,\n ContextMenuItemProps\n>(\n // blank line to reduce diff noise\n function ContextMenuItem(props: ScopedProps<ContextMenuItemProps>, forwardedRef) {\n const { __scopeContextMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuCheckboxItemElement = React.ComponentRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface ContextMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst ContextMenuCheckboxItem = /* @__PURE__ */ React.forwardRef<\n ContextMenuCheckboxItemElement,\n ContextMenuCheckboxItemProps\n>(function ContextMenuCheckboxItem(props: ScopedProps<ContextMenuCheckboxItemProps>, forwardedRef) {\n const { __scopeContextMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuRadioGroupElement = React.ComponentRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface ContextMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst ContextMenuRadioGroup = /* @__PURE__ */ React.forwardRef<\n ContextMenuRadioGroupElement,\n ContextMenuRadioGroupProps\n>(function ContextMenuRadioGroup(props: ScopedProps<ContextMenuRadioGroupProps>, forwardedRef) {\n const { __scopeContextMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuRadioItemElement = React.ComponentRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface ContextMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst ContextMenuRadioItem = /* @__PURE__ */ React.forwardRef<\n ContextMenuRadioItemElement,\n ContextMenuRadioItemProps\n>(function ContextMenuRadioItem(props: ScopedProps<ContextMenuRadioItemProps>, forwardedRef) {\n const { __scopeContextMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuItemIndicatorElement = React.ComponentRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface ContextMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst ContextMenuItemIndicator = /* @__PURE__ */ React.forwardRef<\n ContextMenuItemIndicatorElement,\n ContextMenuItemIndicatorProps\n>(function ContextMenuItemIndicator(\n props: ScopedProps<ContextMenuItemIndicatorProps>,\n forwardedRef,\n) {\n const { __scopeContextMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuSeparatorElement = React.ComponentRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface ContextMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst ContextMenuSeparator = /* @__PURE__ */ React.forwardRef<\n ContextMenuSeparatorElement,\n ContextMenuSeparatorProps\n>(function ContextMenuSeparator(props: ScopedProps<ContextMenuSeparatorProps>, forwardedRef) {\n const { __scopeContextMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuArrowElement = React.ComponentRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface ContextMenuArrowProps extends MenuArrowProps {}\n\nconst ContextMenuArrow = /* @__PURE__ */ React.forwardRef<\n ContextMenuArrowElement,\n ContextMenuArrowProps\n>(\n // blank line to reduce diff noise\n function ContextMenuArrow(props: ScopedProps<ContextMenuArrowProps>, forwardedRef) {\n const { __scopeContextMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'ContextMenuSub';\n\ninterface ContextMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst ContextMenuSub: React.FC<ContextMenuSubProps> = (props: ScopedProps<ContextMenuSubProps>) => {\n const { __scopeContextMenu, children, onOpenChange, open: openProp, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: SUB_NAME,\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuSubTriggerElement = React.ComponentRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface ContextMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst ContextMenuSubTrigger = /* @__PURE__ */ React.forwardRef<\n ContextMenuSubTriggerElement,\n ContextMenuSubTriggerProps\n>(function ContextMenuSubTrigger(props: ScopedProps<ContextMenuSubTriggerProps>, forwardedRef) {\n const { __scopeContextMenu, ...triggerItemProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...triggerItemProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * ContextMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\ntype ContextMenuSubContentElement = React.ComponentRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ninterface ContextMenuSubContentProps extends MenuSubContentProps {}\n\nconst ContextMenuSubContent = /* @__PURE__ */ React.forwardRef<\n ContextMenuSubContentElement,\n ContextMenuSubContentProps\n>(function ContextMenuSubContent(props: ScopedProps<ContextMenuSubContentProps>, forwardedRef) {\n const { __scopeContextMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeContextMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-context-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-context-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-context-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-context-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-context-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n});\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction whenTouchOrPen<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n return (event) => (event.pointerType !== 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = ContextMenu;\nconst Trigger = ContextMenuTrigger;\nconst Portal = ContextMenuPortal;\nconst Content = ContextMenuContent;\nconst Group = ContextMenuGroup;\nconst Label = ContextMenuLabel;\nconst Item = ContextMenuItem;\nconst CheckboxItem = ContextMenuCheckboxItem;\nconst RadioGroup = ContextMenuRadioGroup;\nconst RadioItem = ContextMenuRadioItem;\nconst ItemIndicator = ContextMenuItemIndicator;\nconst Separator = ContextMenuSeparator;\nconst Arrow = ContextMenuArrow;\nconst Sub = ContextMenuSub;\nconst SubTrigger = ContextMenuSubTrigger;\nconst SubContent = ContextMenuSubContent;\n\nexport {\n createContextMenuScope,\n //\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuPortal,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuLabel,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuItemIndicator,\n ContextMenuSeparator,\n ContextMenuArrow,\n ContextMenuSub,\n ContextMenuSubTrigger,\n ContextMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n ContextMenuPortalProps,\n ContextMenuContentProps,\n ContextMenuGroupProps,\n ContextMenuLabelProps,\n ContextMenuItemProps,\n ContextMenuCheckboxItemProps,\n ContextMenuRadioGroupProps,\n ContextMenuRadioItemProps,\n ContextMenuItemIndicatorProps,\n ContextMenuSeparatorProps,\n ContextMenuArrowProps,\n ContextMenuSubProps,\n ContextMenuSubTriggerProps,\n ContextMenuSubContentProps,\n};\n"],"mappings":";;;;;;;;;;AAmBA,IAAM,oBAAoB;AAG1B,IAAM,CAAC,0BAA0B,0BAA0B,mBAAmB,mBAAmB,CAC/F,eACF,CAAC;AACD,IAAM,eAAe,gBAAgB;AASrC,IAAM,CAAC,qBAAqB,yBAC1B,yBAAkD,iBAAiB;AAUrE,IAAM,eAA2C,UAAyC;CACxF,MAAM,EAAE,oBAAoB,UAAU,cAAc,MAAM,UAAU,KAAK,QAAQ,SAAS;CAM1F,MAAM,mBAAmB,MAAM,OAAO,KAAK;CAC3C,IAAI,gBAAgB;EAClB,MAAM,eAAe,MAAM,OAAO,KAAK;EACvC,MAAM,gBAAgB;GACpB,IAAI,aAAa,QAAQ,CAAC,iBAAiB,WAAW,CAAC,aAAa,SAAS;IAC3E,aAAa,UAAU;IAMvB,QAAQ,KACN,qPACF;GACF;EACF,GAAG,CAAC,QAAQ,CAAC;CACf;CAGA,MAAM,CAAC,MAAM,WAAW,qBAAqB;EAC3C,MAAM;EACN,aAAa;EACb,UAAU;EACV,QAAQ;CACV,CAAC;CAED,MAAM,YAAY,aAAa,kBAAkB;CAEjD,OACE,oBAAC,qBAAD;EACE,OAAO;EACD;EACN,cAAc;EACP;EACW;EAElB,UAAA,oBAACA,QAAD;GAAoB,GAAI;GAAgB;GAAW;GAAM,cAAc;GAAgB;GACpF;EACiB,CAAA;CACD,CAAA;AAEzB;AAMA,IAAM,eAAe;AAQrB,IAAM,qBAAqC,sBAAM,WAK/C,SAAS,mB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EACE,GAAI;EACJ,GAAI;EACJ,KAAK;EACL,OAAO;GACL,GAAG,MAAM;GAGP,iDAAiD;GACjD,gDAAgD;GAChD,iDAAiD;GACjD,sCAAsC;GACtC,uCAAuC;EAE3C;CACD,CAAA;AAEL,CAAC;AAID,SAAS,eAAkB,SAAqE;CAC9F,QAAQ,UAAW,MAAM,gBAAgB,UAAU,QAAQ,KAAK,IAAI,KAAA;AACtE;AAEA,IAAM,OAAO;AACb,IAAM,UAAU;AAChB,IAAM,SAAS;AACf,IAAM,UAAU;AAChB,IAAM,QAAQ;AACd,IAAM,QAAQ;AACd,IAAM,OAAO;AACb,IAAM,eAAe;AACrB,IAAM,aAAa;AACnB,IAAM,YAAY;AAClB,IAAM,gBAAgB;AACtB,IAAM,YAAY;AAElB,IAAM,MAAM;AACZ,IAAM,aAAa;AACnB,IAAM,aAAa"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createContextMenuScope, ContextMenu, ContextMenuTrigger, ContextMenuPortal, ContextMenuContent, ContextMenuGroup, ContextMenuLabel, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuItemIndicator, ContextMenuSeparator, ContextMenuArrow, ContextMenuSub, ContextMenuSubTrigger, ContextMenuSubContent, Root, Trigger, Portal, Content, Group, Label, Item, CheckboxItem, RadioGroup, RadioItem, ItemIndicator, Separator, Arrow, Sub, SubTrigger, SubContent, } from './context-menu';
|
|
2
|
+
export type { ContextMenuProps, ContextMenuTriggerProps, ContextMenuPortalProps, ContextMenuContentProps, ContextMenuGroupProps, ContextMenuLabelProps, ContextMenuItemProps, ContextMenuCheckboxItemProps, ContextMenuRadioGroupProps, ContextMenuRadioItemProps, ContextMenuItemIndicatorProps, ContextMenuSeparatorProps, ContextMenuArrowProps, ContextMenuSubProps, ContextMenuSubTriggerProps, ContextMenuSubContentProps, } from './context-menu';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DismissableLayer } from '../react-dismissable-layer';
|
|
3
|
+
import { FocusScope } from '../react-focus-scope';
|
|
4
|
+
import { Portal as PortalPrimitive } from '../react-portal';
|
|
5
|
+
import { Primitive } from '../react-primitive';
|
|
6
|
+
import type { Scope } from '../react-context';
|
|
7
|
+
type ScopedProps<P> = P & {
|
|
8
|
+
__scopeDialog?: Scope;
|
|
9
|
+
};
|
|
10
|
+
declare const createDialogScope: import("../react-context").CreateScope;
|
|
11
|
+
interface DialogProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
onOpenChange?(open: boolean): void;
|
|
16
|
+
modal?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const Dialog: React.FC<DialogProps>;
|
|
19
|
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
20
|
+
interface DialogTriggerProps extends PrimitiveButtonProps {
|
|
21
|
+
}
|
|
22
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
type PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;
|
|
24
|
+
interface DialogPortalProps {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Specify a container element to portal the content into.
|
|
28
|
+
*/
|
|
29
|
+
container?: PortalProps['container'];
|
|
30
|
+
/**
|
|
31
|
+
* Used to force mounting when more control is needed. Useful when
|
|
32
|
+
* controlling animation with React animation libraries.
|
|
33
|
+
*/
|
|
34
|
+
forceMount?: true;
|
|
35
|
+
}
|
|
36
|
+
declare const DialogPortal: React.FC<DialogPortalProps>;
|
|
37
|
+
interface DialogOverlayProps extends DialogOverlayImplProps {
|
|
38
|
+
/**
|
|
39
|
+
* Used to force mounting when more control is needed. Useful when
|
|
40
|
+
* controlling animation with React animation libraries.
|
|
41
|
+
*/
|
|
42
|
+
forceMount?: true;
|
|
43
|
+
}
|
|
44
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
46
|
+
interface DialogOverlayImplProps extends PrimitiveDivProps {
|
|
47
|
+
}
|
|
48
|
+
interface DialogContentProps extends DialogContentTypeProps {
|
|
49
|
+
/**
|
|
50
|
+
* Used to force mounting when more control is needed. Useful when
|
|
51
|
+
* controlling animation with React animation libraries.
|
|
52
|
+
*/
|
|
53
|
+
forceMount?: true;
|
|
54
|
+
}
|
|
55
|
+
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
56
|
+
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
|
|
57
|
+
}
|
|
58
|
+
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
59
|
+
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
|
|
60
|
+
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
|
|
61
|
+
/**
|
|
62
|
+
* When `true`, focus cannot escape the `Content` via keyboard,
|
|
63
|
+
* pointer, or a programmatic focus.
|
|
64
|
+
* @defaultValue false
|
|
65
|
+
*/
|
|
66
|
+
trapFocus?: FocusScopeProps['trapped'];
|
|
67
|
+
/**
|
|
68
|
+
* Event handler called when auto-focusing on open.
|
|
69
|
+
* Can be prevented.
|
|
70
|
+
*/
|
|
71
|
+
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
|
|
72
|
+
/**
|
|
73
|
+
* Event handler called when auto-focusing on close.
|
|
74
|
+
* Can be prevented.
|
|
75
|
+
*/
|
|
76
|
+
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
|
|
77
|
+
}
|
|
78
|
+
type PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
79
|
+
interface DialogTitleProps extends PrimitiveHeading2Props {
|
|
80
|
+
}
|
|
81
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
82
|
+
type PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;
|
|
83
|
+
interface DialogDescriptionProps extends PrimitiveParagraphProps {
|
|
84
|
+
}
|
|
85
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
86
|
+
interface DialogCloseProps extends PrimitiveButtonProps {
|
|
87
|
+
}
|
|
88
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
89
|
+
/** @deprecated Noop component to avoid breaking changes. */
|
|
90
|
+
export declare const WarningProvider: React.FC<ScopedProps<{
|
|
91
|
+
children?: React.ReactNode;
|
|
92
|
+
contentName: string;
|
|
93
|
+
titleName: string;
|
|
94
|
+
docsSlug: 'dialog';
|
|
95
|
+
}>>;
|
|
96
|
+
export { createDialogScope, Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, Dialog as Root, DialogTrigger as Trigger, DialogPortal as Portal, DialogOverlay as Overlay, DialogContent as Content, DialogTitle as Title, DialogDescription as Description, DialogClose as Close, };
|
|
97
|
+
export type { DialogProps, DialogTriggerProps, DialogPortalProps, DialogOverlayProps, DialogContentProps, DialogTitleProps, DialogDescriptionProps, DialogCloseProps, };
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContextScope } from "../react-context/create-context.js";
|
|
3
|
+
import { useComposedRefs } from "../react-compose-refs/compose-refs.js";
|
|
4
|
+
import { createSlot } from "../react-slot/slot.js";
|
|
5
|
+
import { composeEventHandlers } from "../primitive/primitive.js";
|
|
6
|
+
import { useLayoutEffect } from "../react-use-layout-effect/use-layout-effect.js";
|
|
7
|
+
import { useControllableState } from "../react-use-controllable-state/use-controllable-state.js";
|
|
8
|
+
import { Primitive } from "../react-primitive/primitive.js";
|
|
9
|
+
import { Presence } from "../react-presence/presence.js";
|
|
10
|
+
import { useId } from "../react-id/id.js";
|
|
11
|
+
import { DismissableLayer, useDismissableLayerSurface } from "../react-dismissable-layer/dismissable-layer.js";
|
|
12
|
+
import { FocusScope } from "../react-focus-scope/focus-scope.js";
|
|
13
|
+
import { Portal } from "../react-portal/portal.js";
|
|
14
|
+
import { useFocusGuards } from "../react-focus-guards/focus-guards.js";
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
17
|
+
import { RemoveScroll } from "react-remove-scroll";
|
|
18
|
+
import { hideOthers } from "aria-hidden";
|
|
19
|
+
//#region src/primitives/vendor/radix/react-dialog/dialog.tsx
|
|
20
|
+
var DIALOG_NAME = "Dialog";
|
|
21
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
22
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
23
|
+
var Dialog = (props) => {
|
|
24
|
+
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
25
|
+
const triggerRef = React.useRef(null);
|
|
26
|
+
const contentRef = React.useRef(null);
|
|
27
|
+
const [open, setOpen] = useControllableState({
|
|
28
|
+
prop: openProp,
|
|
29
|
+
defaultProp: defaultOpen ?? false,
|
|
30
|
+
onChange: onOpenChange,
|
|
31
|
+
caller: DIALOG_NAME
|
|
32
|
+
});
|
|
33
|
+
const [titleCount, setTitleCount] = React.useState(0);
|
|
34
|
+
const [descriptionCount, setDescriptionCount] = React.useState(0);
|
|
35
|
+
return /* @__PURE__ */ jsx(DialogProvider, {
|
|
36
|
+
scope: __scopeDialog,
|
|
37
|
+
triggerRef,
|
|
38
|
+
contentRef,
|
|
39
|
+
contentId: useId(),
|
|
40
|
+
titleId: useId(),
|
|
41
|
+
descriptionId: useId(),
|
|
42
|
+
titlePresent: titleCount > 0,
|
|
43
|
+
descriptionPresent: descriptionCount > 0,
|
|
44
|
+
setTitleCount,
|
|
45
|
+
setDescriptionCount,
|
|
46
|
+
open,
|
|
47
|
+
onOpenChange: setOpen,
|
|
48
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
49
|
+
modal,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
var TRIGGER_NAME = "DialogTrigger";
|
|
54
|
+
var DialogTrigger = /* @__PURE__ */ React.forwardRef(function DialogTrigger(props, forwardedRef) {
|
|
55
|
+
const { __scopeDialog, ...triggerProps } = props;
|
|
56
|
+
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
57
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
58
|
+
return /* @__PURE__ */ jsx(Primitive.button, {
|
|
59
|
+
type: "button",
|
|
60
|
+
"aria-haspopup": "dialog",
|
|
61
|
+
"aria-expanded": context.open,
|
|
62
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
63
|
+
"data-state": getState(context.open),
|
|
64
|
+
...triggerProps,
|
|
65
|
+
ref: composedTriggerRef,
|
|
66
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
var PORTAL_NAME = "DialogPortal";
|
|
70
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { forceMount: void 0 });
|
|
71
|
+
var DialogPortal = (props) => {
|
|
72
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
73
|
+
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
74
|
+
return /* @__PURE__ */ jsx(PortalProvider, {
|
|
75
|
+
scope: __scopeDialog,
|
|
76
|
+
forceMount,
|
|
77
|
+
children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, {
|
|
78
|
+
present: forceMount || context.open,
|
|
79
|
+
children: /* @__PURE__ */ jsx(Portal, {
|
|
80
|
+
asChild: true,
|
|
81
|
+
container,
|
|
82
|
+
children: child
|
|
83
|
+
})
|
|
84
|
+
}))
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
88
|
+
var DialogOverlay = /* @__PURE__ */ React.forwardRef(function DialogOverlay(props, forwardedRef) {
|
|
89
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
90
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
91
|
+
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
92
|
+
return context.modal ? /* @__PURE__ */ jsx(Presence, {
|
|
93
|
+
present: forceMount || context.open,
|
|
94
|
+
children: /* @__PURE__ */ jsx(DialogOverlayImpl, {
|
|
95
|
+
...overlayProps,
|
|
96
|
+
ref: forwardedRef
|
|
97
|
+
})
|
|
98
|
+
}) : null;
|
|
99
|
+
});
|
|
100
|
+
var Slot = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
|
|
101
|
+
var DialogOverlayImpl = /* @__PURE__ */ React.forwardRef(function DialogOverlayImpl(props, forwardedRef) {
|
|
102
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
103
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
104
|
+
const registerDismissableSurface = useDismissableLayerSurface();
|
|
105
|
+
const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);
|
|
106
|
+
return /* @__PURE__ */ jsx(RemoveScroll, {
|
|
107
|
+
as: Slot,
|
|
108
|
+
allowPinchZoom: true,
|
|
109
|
+
shards: [context.contentRef],
|
|
110
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
111
|
+
"data-state": getState(context.open),
|
|
112
|
+
...overlayProps,
|
|
113
|
+
ref: composedRefs,
|
|
114
|
+
style: {
|
|
115
|
+
pointerEvents: "auto",
|
|
116
|
+
...overlayProps.style
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
var CONTENT_NAME = "DialogContent";
|
|
122
|
+
var DialogContent = /* @__PURE__ */ React.forwardRef(function DialogContent(props, forwardedRef) {
|
|
123
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
124
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
125
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
126
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
127
|
+
present: forceMount || context.open,
|
|
128
|
+
children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, {
|
|
129
|
+
...contentProps,
|
|
130
|
+
ref: forwardedRef
|
|
131
|
+
}) : /* @__PURE__ */ jsx(DialogContentNonModal, {
|
|
132
|
+
...contentProps,
|
|
133
|
+
ref: forwardedRef
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
var DialogContentModal = /* @__PURE__ */ React.forwardRef(function DialogContentModal(props, forwardedRef) {
|
|
138
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
139
|
+
const contentRef = React.useRef(null);
|
|
140
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
141
|
+
React.useEffect(() => {
|
|
142
|
+
const content = contentRef.current;
|
|
143
|
+
if (content) return hideOthers(content);
|
|
144
|
+
}, []);
|
|
145
|
+
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
146
|
+
...props,
|
|
147
|
+
ref: composedRefs,
|
|
148
|
+
trapFocus: context.open,
|
|
149
|
+
disableOutsidePointerEvents: context.open,
|
|
150
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
context.triggerRef.current?.focus();
|
|
153
|
+
}),
|
|
154
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
155
|
+
const originalEvent = event.detail.originalEvent;
|
|
156
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
157
|
+
if (originalEvent.button === 2 || ctrlLeftClick) event.preventDefault();
|
|
158
|
+
}),
|
|
159
|
+
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
var DialogContentNonModal = /* @__PURE__ */ React.forwardRef(function DialogContentNonModal(props, forwardedRef) {
|
|
163
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
164
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
165
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
166
|
+
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
167
|
+
...props,
|
|
168
|
+
ref: forwardedRef,
|
|
169
|
+
trapFocus: false,
|
|
170
|
+
disableOutsidePointerEvents: false,
|
|
171
|
+
onCloseAutoFocus: (event) => {
|
|
172
|
+
props.onCloseAutoFocus?.(event);
|
|
173
|
+
if (!event.defaultPrevented) {
|
|
174
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
}
|
|
177
|
+
hasInteractedOutsideRef.current = false;
|
|
178
|
+
hasPointerDownOutsideRef.current = false;
|
|
179
|
+
},
|
|
180
|
+
onInteractOutside: (event) => {
|
|
181
|
+
props.onInteractOutside?.(event);
|
|
182
|
+
if (!event.defaultPrevented) {
|
|
183
|
+
hasInteractedOutsideRef.current = true;
|
|
184
|
+
if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.current = true;
|
|
185
|
+
}
|
|
186
|
+
const target = event.target;
|
|
187
|
+
if (context.triggerRef.current?.contains(target)) event.preventDefault();
|
|
188
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
var DialogContentImpl = /* @__PURE__ */ React.forwardRef(function DialogContentImpl(props, forwardedRef) {
|
|
193
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
194
|
+
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
195
|
+
useFocusGuards();
|
|
196
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(FocusScope, {
|
|
197
|
+
asChild: true,
|
|
198
|
+
loop: true,
|
|
199
|
+
trapped: trapFocus,
|
|
200
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
201
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
202
|
+
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
203
|
+
role: "dialog",
|
|
204
|
+
id: context.contentId,
|
|
205
|
+
"aria-describedby": context.descriptionPresent ? context.descriptionId : void 0,
|
|
206
|
+
"aria-labelledby": context.titlePresent ? context.titleId : void 0,
|
|
207
|
+
"data-state": getState(context.open),
|
|
208
|
+
...contentProps,
|
|
209
|
+
ref: forwardedRef,
|
|
210
|
+
deferPointerDownOutside: true,
|
|
211
|
+
onDismiss: () => context.onOpenChange(false)
|
|
212
|
+
})
|
|
213
|
+
}) });
|
|
214
|
+
});
|
|
215
|
+
var TITLE_NAME = "DialogTitle";
|
|
216
|
+
var DialogTitle = /* @__PURE__ */ React.forwardRef(function DialogTitle(props, forwardedRef) {
|
|
217
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
218
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
219
|
+
const { setTitleCount } = context;
|
|
220
|
+
useLayoutEffect(() => {
|
|
221
|
+
setTitleCount((count) => count + 1);
|
|
222
|
+
return () => setTitleCount((count) => count - 1);
|
|
223
|
+
}, [setTitleCount]);
|
|
224
|
+
return /* @__PURE__ */ jsx(Primitive.h2, {
|
|
225
|
+
id: context.titleId,
|
|
226
|
+
...titleProps,
|
|
227
|
+
ref: forwardedRef
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
231
|
+
var DialogDescription = /* @__PURE__ */ React.forwardRef(function DialogDescription(props, forwardedRef) {
|
|
232
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
233
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
234
|
+
const { setDescriptionCount } = context;
|
|
235
|
+
useLayoutEffect(() => {
|
|
236
|
+
setDescriptionCount((count) => count + 1);
|
|
237
|
+
return () => setDescriptionCount((count) => count - 1);
|
|
238
|
+
}, [setDescriptionCount]);
|
|
239
|
+
return /* @__PURE__ */ jsx(Primitive.p, {
|
|
240
|
+
id: context.descriptionId,
|
|
241
|
+
...descriptionProps,
|
|
242
|
+
ref: forwardedRef
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
var CLOSE_NAME = "DialogClose";
|
|
246
|
+
var DialogClose = /* @__PURE__ */ React.forwardRef(function DialogClose(props, forwardedRef) {
|
|
247
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
248
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
249
|
+
return /* @__PURE__ */ jsx(Primitive.button, {
|
|
250
|
+
type: "button",
|
|
251
|
+
...closeProps,
|
|
252
|
+
ref: forwardedRef,
|
|
253
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
function getState(open) {
|
|
257
|
+
return open ? "open" : "closed";
|
|
258
|
+
}
|
|
259
|
+
//#endregion
|
|
260
|
+
export { DialogClose as Close, DialogClose, DialogContent as Content, DialogContent, DialogDescription as Description, DialogDescription, Dialog, Dialog as Root, DialogOverlay, DialogOverlay as Overlay, DialogPortal, DialogPortal as Portal, DialogTitle, DialogTitle as Title, DialogTrigger, DialogTrigger as Trigger, createDialogScope };
|
|
261
|
+
|
|
262
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","names":["PortalPrimitive","_Fragment"],"sources":["../../../../../src/primitives/vendor/radix/react-dialog/dialog.tsx"],"sourcesContent":["// Vendored from Radix Primitives (c) 2022 WorkOS, MIT. See vendor/LICENSE.radix.\n// Local modification: package imports resolve to the pinned local source.\nimport * as React from 'react';\nimport { composeEventHandlers } from '../primitive';\nimport { useComposedRefs } from '../react-compose-refs';\nimport { createContextScope } from '../react-context';\nimport { useId } from '../react-id';\nimport { useControllableState } from '../react-use-controllable-state';\nimport { DismissableLayer, useDismissableLayerSurface } from '../react-dismissable-layer';\nimport { FocusScope } from '../react-focus-scope';\nimport { Portal as PortalPrimitive } from '../react-portal';\nimport { Presence } from '../react-presence';\nimport { Primitive } from '../react-primitive';\nimport { useFocusGuards } from '../react-focus-guards';\nimport { useLayoutEffect } from '../react-use-layout-effect';\nimport { RemoveScroll } from 'react-remove-scroll';\nimport { hideOthers } from 'aria-hidden';\nimport { createSlot } from '../react-slot';\n\nimport type { Scope } from '../react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Dialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst DIALOG_NAME = 'Dialog';\n\ntype ScopedProps<P> = P & { __scopeDialog?: Scope };\nconst [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\n\ntype DialogContextValue = {\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n contentRef: React.RefObject<DialogContentElement | null>;\n contentId: string;\n titleId: string;\n descriptionId: string;\n titlePresent: boolean;\n descriptionPresent: boolean;\n setTitleCount: React.Dispatch<React.SetStateAction<number>>;\n setDescriptionCount: React.Dispatch<React.SetStateAction<number>>;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DialogProvider, useDialogContext] = createDialogContext<DialogContextValue>(DIALOG_NAME);\n\ninterface DialogProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst Dialog: React.FC<DialogProps> = (props: ScopedProps<DialogProps>) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const contentRef = React.useRef<DialogContentElement>(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME,\n });\n\n const [titleCount, setTitleCount] = React.useState(0);\n const [descriptionCount, setDescriptionCount] = React.useState(0);\n\n return (\n <DialogProvider\n scope={__scopeDialog}\n triggerRef={triggerRef}\n contentRef={contentRef}\n contentId={useId()}\n titleId={useId()}\n descriptionId={useId()}\n titlePresent={titleCount > 0}\n descriptionPresent={descriptionCount > 0}\n setTitleCount={setTitleCount}\n setDescriptionCount={setDescriptionCount}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n {children}\n </DialogProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DialogTrigger';\n\ntype DialogTriggerElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DialogTriggerProps extends PrimitiveButtonProps {}\n\nconst DialogTrigger = /* @__PURE__ */ React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n function DialogTrigger(props: ScopedProps<DialogTriggerProps>, forwardedRef) {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return (\n <Primitive.button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={context.open}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={getState(context.open)}\n {...triggerProps}\n ref={composedTriggerRef}\n onClick={composeEventHandlers(props.onClick, context.onOpenToggle)}\n />\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DialogPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createDialogContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface DialogPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogPortal: React.FC<DialogPortalProps> = (props: ScopedProps<DialogPortalProps>) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return (\n <PortalProvider scope={__scopeDialog} forceMount={forceMount}>\n {React.Children.map(children, (child) => (\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {child}\n </PortalPrimitive>\n </Presence>\n ))}\n </PortalProvider>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DialogOverlay\n * -----------------------------------------------------------------------------------------------*/\n\nconst OVERLAY_NAME = 'DialogOverlay';\n\ntype DialogOverlayElement = DialogOverlayImplElement;\ninterface DialogOverlayProps extends DialogOverlayImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogOverlay = /* @__PURE__ */ React.forwardRef<DialogOverlayElement, DialogOverlayProps>(\n function DialogOverlay(props: ScopedProps<DialogOverlayProps>, forwardedRef) {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? (\n <Presence present={forceMount || context.open}>\n <DialogOverlayImpl {...overlayProps} ref={forwardedRef} />\n </Presence>\n ) : null;\n },\n);\n\ntype DialogOverlayImplElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface DialogOverlayImplProps extends PrimitiveDivProps {}\n\nconst Slot = createSlot('DialogOverlay.RemoveScroll');\n\nconst DialogOverlayImpl = /* @__PURE__ */ React.forwardRef<\n DialogOverlayImplElement,\n DialogOverlayImplProps\n>(\n // blank line to reduce diff noise\n function DialogOverlayImpl(props: ScopedProps<DialogOverlayImplProps>, forwardedRef) {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n\n // Register the overlay as a dismiss surface so a consumer calling\n // `stopPropagation` on it (eg. to avoid triggering parent handlers) does not\n // prevent the dialog from closing. See: https://github.com/radix-ui/primitives/issues/3346\n const registerDismissableSurface = useDismissableLayerSurface();\n const composedRefs = useComposedRefs(forwardedRef, registerDismissableSurface);\n\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n <RemoveScroll as={Slot} allowPinchZoom shards={[context.contentRef]}>\n <Primitive.div\n data-state={getState(context.open)}\n {...overlayProps}\n ref={composedRefs}\n // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.\n style={{ pointerEvents: 'auto', ...overlayProps.style }}\n />\n </RemoveScroll>\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DialogContent';\n\ntype DialogContentElement = DialogContentTypeElement;\ninterface DialogContentProps extends DialogContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst DialogContent = /* @__PURE__ */ React.forwardRef<DialogContentElement, DialogContentProps>(\n function DialogContent(props: ScopedProps<DialogContentProps>, forwardedRef) {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return (\n <Presence present={forceMount || context.open}>\n {context.modal ? (\n <DialogContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <DialogContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Presence>\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentTypeElement = DialogContentImplElement;\ninterface DialogContentTypeProps extends Omit<\n DialogContentImplProps,\n 'trapFocus' | 'disableOutsidePointerEvents'\n> {}\n\nconst DialogContentModal = /* @__PURE__ */ React.forwardRef<\n DialogContentTypeElement,\n DialogContentTypeProps\n>(\n // blank line to reduce diff noise\n function DialogContentModal(props: ScopedProps<DialogContentTypeProps>, forwardedRef) {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n\n // aria-hide everything except the content (better supported equivalent to setting aria-modal)\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <DialogContentImpl\n {...props}\n ref={composedRefs}\n // we make sure focus isn't trapped once `DialogContent` has been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n disableOutsidePointerEvents={context.open}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n })}\n onPointerDownOutside={composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n\n // If the event is a right-click, we shouldn't close because\n // it is effectively as if we right-clicked the `Overlay`.\n if (isRightClick) event.preventDefault();\n })}\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) =>\n event.preventDefault(),\n )}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst DialogContentNonModal = /* @__PURE__ */ React.forwardRef<\n DialogContentTypeElement,\n DialogContentTypeProps\n>(\n // blank line to reduce diff noise\n function DialogContentNonModal(props: ScopedProps<DialogContentTypeProps>, forwardedRef) {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n\n return (\n <DialogContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n onCloseAutoFocus={(event) => {\n props.onCloseAutoFocus?.(event);\n\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n }\n\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n }}\n onInteractOutside={(event) => {\n props.onInteractOutside?.(event);\n\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === 'pointerdown') {\n hasPointerDownOutsideRef.current = true;\n }\n }\n\n // Prevent dismissing when clicking the trigger.\n // As the trigger is already setup to close, without doing so would\n // cause it to close and immediately open.\n const target = event.target as HTMLElement;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n\n // On Safari if the trigger is inside a container with tabIndex={0}, when clicked\n // we will get the pointer down outside event on the trigger, but then a subsequent\n // focus outside event on the container, we ignore any focus outside event when we've\n // already had a pointer down outside event.\n if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }}\n />\n );\n },\n);\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype DialogContentImplElement = React.ComponentRef<typeof DismissableLayer>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;\ninterface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {\n /**\n * When `true`, focus cannot escape the `Content` via keyboard,\n * pointer, or a programmatic focus.\n * @defaultValue false\n */\n trapFocus?: FocusScopeProps['trapped'];\n\n /**\n * Event handler called when auto-focusing on open.\n * Can be prevented.\n */\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n}\n\nconst DialogContentImpl = /* @__PURE__ */ React.forwardRef<\n DialogContentImplElement,\n DialogContentImplProps\n>(\n // blank line to reduce diff noise\n function DialogContentImpl(props: ScopedProps<DialogContentImplProps>, forwardedRef) {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n\n // Make sure the whole tree has focus guards as our `Dialog` will be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n return (\n <>\n <FocusScope\n asChild\n loop\n trapped={trapFocus}\n onMountAutoFocus={onOpenAutoFocus}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n role=\"dialog\"\n id={context.contentId}\n aria-describedby={context.descriptionPresent ? context.descriptionId : undefined}\n aria-labelledby={context.titlePresent ? context.titleId : undefined}\n data-state={getState(context.open)}\n {...contentProps}\n ref={forwardedRef}\n deferPointerDownOutside\n onDismiss={() => context.onOpenChange(false)}\n />\n </FocusScope>\n </>\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'DialogTitle';\n\ntype DialogTitleElement = React.ComponentRef<typeof Primitive.h2>;\ntype PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;\ninterface DialogTitleProps extends PrimitiveHeading2Props {}\n\nconst DialogTitle = /* @__PURE__ */ React.forwardRef<DialogTitleElement, DialogTitleProps>(\n function DialogTitle(props: ScopedProps<DialogTitleProps>, forwardedRef) {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n const { setTitleCount } = context;\n useLayoutEffect(() => {\n setTitleCount((count) => count + 1);\n return () => setTitleCount((count) => count - 1);\n }, [setTitleCount]);\n return <Primitive.h2 id={context.titleId} {...titleProps} ref={forwardedRef} />;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'DialogDescription';\n\ntype DialogDescriptionElement = React.ComponentRef<typeof Primitive.p>;\ntype PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;\ninterface DialogDescriptionProps extends PrimitiveParagraphProps {}\n\nconst DialogDescription = /* @__PURE__ */ React.forwardRef<\n DialogDescriptionElement,\n DialogDescriptionProps\n>(\n // blank line to reduce diff noise\n function DialogDescription(props: ScopedProps<DialogDescriptionProps>, forwardedRef) {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n const { setDescriptionCount } = context;\n useLayoutEffect(() => {\n setDescriptionCount((count) => count + 1);\n return () => setDescriptionCount((count) => count - 1);\n }, [setDescriptionCount]);\n return <Primitive.p id={context.descriptionId} {...descriptionProps} ref={forwardedRef} />;\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * DialogClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'DialogClose';\n\ntype DialogCloseElement = React.ComponentRef<typeof Primitive.button>;\ninterface DialogCloseProps extends PrimitiveButtonProps {}\n\nconst DialogClose = /* @__PURE__ */ React.forwardRef<DialogCloseElement, DialogCloseProps>(\n function DialogClose(props: ScopedProps<DialogCloseProps>, forwardedRef) {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return (\n <Primitive.button\n type=\"button\"\n {...closeProps}\n ref={forwardedRef}\n onClick={composeEventHandlers(props.onClick, () => context.onOpenChange(false))}\n />\n );\n },\n);\n\n/** @deprecated Noop component to avoid breaking changes. */\nexport const WarningProvider: React.FC<\n ScopedProps<{\n children?: React.ReactNode;\n contentName: string;\n titleName: string;\n docsSlug: 'dialog';\n }>\n> = (props) => {\n return props.children;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nexport {\n createDialogScope,\n //\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogClose,\n //\n Dialog as Root,\n DialogTrigger as Trigger,\n DialogPortal as Portal,\n DialogOverlay as Overlay,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogContentProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogCloseProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,qBAAqB,mBAAmB,WAAW;AAkB/E,IAAM,CAAC,gBAAgB,oBAAoB,oBAAwC,WAAW;AAU9F,IAAM,UAAiC,UAAoC;CACzE,MAAM,EACJ,eACA,UACA,MAAM,UACN,aACA,cACA,QAAQ,SACN;CACJ,MAAM,aAAa,MAAM,OAA0B,IAAI;CACvD,MAAM,aAAa,MAAM,OAA6B,IAAI;CAC1D,MAAM,CAAC,MAAM,WAAW,qBAAqB;EAC3C,MAAM;EACN,aAAa,eAAe;EAC5B,UAAU;EACV,QAAQ;CACV,CAAC;C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kBAAkB;CAC1B,sBAAsB;EACpB,eAAe,UAAU,QAAQ,CAAC;EAClC,aAAa,eAAe,UAAU,QAAQ,CAAC;CACjD,GAAG,CAAC,aAAa,CAAC;CAClB,OAAO,oBAAC,UAAU,IAAX;EAAc,IAAI,QAAQ;EAAS,GAAI;EAAY,KAAK;CAAe,CAAA;AAChF,CACF;AAMA,IAAM,mBAAmB;AAMzB,IAAM,oBAAoC,sBAAM,WAK9C,SAAS,kBAAkB,OAA4C,cAAc;CACnF,MAAM,EAAE,eAAe,GAAG,qBAAqB;CAC/C,MAAM,UAAU,iBAAiB,kBAAkB,aAAa;CAChE,MAAM,EAAE,wBAAwB;CAChC,sBAAsB;EACpB,qBAAqB,UAAU,QAAQ,CAAC;EACxC,aAAa,qBAAqB,UAAU,QAAQ,CAAC;CACvD,GAAG,CAAC,mBAAmB,CAAC;CACxB,OAAO,oBAAC,UAAU,GAAX;EAAa,IAAI,QAAQ;EAAe,GAAI;EAAkB,KAAK;CAAe,CAAA;AAC3F,CACF;AAMA,IAAM,aAAa;AAKnB,IAAM,cAA8B,sBAAM,WACxC,SAAS,YAAY,OAAsC,cAAc;CACvE,MAAM,EAAE,eAAe,GAAG,eAAe;CACzC,MAAM,UAAU,iBAAiB,YAAY,aAAa;CAC1D,OACE,oBAAC,UAAU,QAAX;EACE,MAAK;EACL,GAAI;EACJ,KAAK;EACL,SAAS,qBAAqB,MAAM,eAAe,QAAQ,aAAa,KAAK,CAAC;CAC/E,CAAA;AAEL,CACF;AAgBA,SAAS,SAAS,MAAe;CAC/B,OAAO,OAAO,SAAS;AACzB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createDialogScope, Dialog, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, Root, Trigger, Portal, Overlay, Content, Title, Description, Close,
|
|
2
|
+
/** @deprecated Noop component to avoid breaking changes. */
|
|
3
|
+
WarningProvider, } from './dialog';
|
|
4
|
+
export type { DialogProps, DialogTriggerProps, DialogPortalProps, DialogOverlayProps, DialogContentProps, DialogTitleProps, DialogDescriptionProps, DialogCloseProps, } from './dialog';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Direction = 'ltr' | 'rtl';
|
|
3
|
+
interface DirectionProviderProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
dir: Direction;
|
|
6
|
+
}
|
|
7
|
+
declare const DirectionProvider: React.FC<DirectionProviderProps>;
|
|
8
|
+
declare function useDirection(localDir?: Direction): Direction;
|
|
9
|
+
declare const Provider: React.FC<DirectionProviderProps>;
|
|
10
|
+
export { useDirection, Provider, DirectionProvider, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
//#region src/primitives/vendor/radix/react-direction/direction.tsx
|
|
5
|
+
var DirectionContext = React.createContext(void 0);
|
|
6
|
+
function useDirection(localDir) {
|
|
7
|
+
const globalDir = React.useContext(DirectionContext);
|
|
8
|
+
return localDir || globalDir || "ltr";
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { useDirection };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=direction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direction.js","names":[],"sources":["../../../../../src/primitives/vendor/radix/react-direction/direction.tsx"],"sourcesContent":["// Vendored from Radix Primitives (c) 2022 WorkOS, MIT. See vendor/LICENSE.radix.\n// Local modification: package imports resolve to the pinned local source.\nimport * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],"mappings":";;;;AAKA,IAAM,mBAAmB,MAAM,cAAqC,KAAA,CAAS;AAiB7E,SAAS,aAAa,UAAsB;CAC1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;CACnD,OAAO,YAAY,aAAa;AAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useDirection, Provider, DirectionProvider, } from './direction';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Primitive } from '../react-primitive';
|
|
3
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
4
|
+
interface DismissableLayerProps extends PrimitiveDivProps {
|
|
5
|
+
/**
|
|
6
|
+
* When `true`, hover/focus/click interactions will be disabled on elements outside
|
|
7
|
+
* the `DismissableLayer`. Users will need to click twice on outside elements to
|
|
8
|
+
* interact with them: once to close the `DismissableLayer`, and again to trigger the element.
|
|
9
|
+
*/
|
|
10
|
+
disableOutsidePointerEvents?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* When `true`, a `'pointerdown'` event outside of the layered element will
|
|
13
|
+
* wait for the interaction's click event before dispatching, allowing
|
|
14
|
+
* third-party code to stop propagation of later events and cancel dismissal.
|
|
15
|
+
*/
|
|
16
|
+
deferPointerDownOutside?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Event handler called when the escape key is down.
|
|
19
|
+
* Can be prevented.
|
|
20
|
+
*/
|
|
21
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
|
|
24
|
+
* Can be prevented.
|
|
25
|
+
*/
|
|
26
|
+
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Event handler called when the focus moves outside of the `DismissableLayer`.
|
|
29
|
+
* Can be prevented.
|
|
30
|
+
*/
|
|
31
|
+
onFocusOutside?: (event: FocusOutsideEvent) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Event handler called when an interaction happens outside the `DismissableLayer`.
|
|
34
|
+
* Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
|
|
35
|
+
* Can be prevented.
|
|
36
|
+
*/
|
|
37
|
+
onInteractOutside?: (event: PointerDownOutsideEvent | FocusOutsideEvent) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Handler called when the `DismissableLayer` should be dismissed
|
|
40
|
+
*/
|
|
41
|
+
onDismiss?: () => void;
|
|
42
|
+
}
|
|
43
|
+
declare const DismissableLayer: React.ForwardRefExoticComponent<DismissableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
type DismissableLayerBranchElement = React.ComponentRef<typeof Primitive.div>;
|
|
45
|
+
interface DismissableLayerBranchProps extends PrimitiveDivProps {
|
|
46
|
+
}
|
|
47
|
+
declare const DismissableLayerBranch: React.ForwardRefExoticComponent<DismissableLayerBranchProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
+
/**
|
|
49
|
+
* Registers a node as a "dismiss surface" for the enclosing DismissableLayer
|
|
50
|
+
*/
|
|
51
|
+
declare function useDismissableLayerSurface(): React.RefCallback<DismissableLayerBranchElement>;
|
|
52
|
+
type PointerDownOutsideEvent = CustomEvent<{
|
|
53
|
+
originalEvent: PointerEvent;
|
|
54
|
+
}>;
|
|
55
|
+
type FocusOutsideEvent = CustomEvent<{
|
|
56
|
+
originalEvent: FocusEvent;
|
|
57
|
+
}>;
|
|
58
|
+
declare const Root: React.ForwardRefExoticComponent<DismissableLayerProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
|
+
declare const Branch: React.ForwardRefExoticComponent<DismissableLayerBranchProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export { DismissableLayer, DismissableLayerBranch, useDismissableLayerSurface, Root, Branch, };
|
|
61
|
+
export type { DismissableLayerProps };
|