@burtson-labs/ui 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +5 -1
- package/THIRD_PARTY_NOTICES.md +15 -3
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +9 -8
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +12 -11
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.js +1 -0
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-shell.js +1 -0
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/attachment.js +1 -0
- package/dist/components/attachment.js.map +1 -1
- package/dist/components/audio-player.js +1 -0
- package/dist/components/audio-player.js.map +1 -1
- package/dist/components/avatar.d.ts +1 -1
- package/dist/components/avatar.js +7 -6
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.js +3 -3
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.js +3 -3
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +3 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +1 -0
- package/dist/components/card.js.map +1 -1
- package/dist/components/chat-history.js +1 -0
- package/dist/components/chat-history.js.map +1 -1
- package/dist/components/chat-layout.js +1 -0
- package/dist/components/chat-layout.js.map +1 -1
- package/dist/components/checkbox-card.d.ts +1 -1
- package/dist/components/checkbox-card.js +3 -3
- package/dist/components/checkbox-card.js.map +1 -1
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +6 -5
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/collapsible.js +7 -6
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.js +1 -0
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +1 -1
- package/dist/components/command.js +12 -11
- package/dist/components/command.js.map +1 -1
- package/dist/components/composer.js +1 -0
- package/dist/components/composer.js.map +1 -1
- package/dist/components/connection-status.js +1 -0
- package/dist/components/connection-status.js.map +1 -1
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +19 -18
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/conversation.js +1 -0
- package/dist/components/conversation.js.map +1 -1
- package/dist/components/copy-button.js +1 -0
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table.js +1 -0
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +13 -12
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.js +19 -18
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editor-tabs.js +1 -0
- package/dist/components/editor-tabs.js.map +1 -1
- package/dist/components/empty-state.js +1 -0
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/field.js +1 -0
- package/dist/components/field.js.map +1 -1
- package/dist/components/icon-button.js +1 -0
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/input.js +1 -0
- package/dist/components/input.js.map +1 -1
- package/dist/components/kbd.js +1 -0
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +5 -4
- package/dist/components/label.js.map +1 -1
- package/dist/components/markdown.js +1 -0
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/menubar.d.ts +1 -1
- package/dist/components/menubar.js +20 -19
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/message-actions.js +1 -0
- package/dist/components/message-actions.js.map +1 -1
- package/dist/components/message.js +1 -0
- package/dist/components/message.js.map +1 -1
- package/dist/components/mobile-nav.js +1 -0
- package/dist/components/mobile-nav.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +1 -1
- package/dist/components/navigation-menu.js +12 -11
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/onboarding-checklist.js +1 -0
- package/dist/components/onboarding-checklist.js.map +1 -1
- package/dist/components/page-header.js +1 -0
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.js +1 -0
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +8 -7
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +6 -5
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/radio-group.js +7 -6
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/reasoning.js +5 -4
- 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 +1 -1
- package/dist/components/scroll-area.js +9 -8
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/secret-input.js +1 -0
- package/dist/components/secret-input.js.map +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +18 -17
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +5 -4
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sheet.js +10 -9
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/skeleton.js +1 -0
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.js +1 -0
- package/dist/components/slider.js.map +1 -1
- package/dist/components/source.js +1 -0
- package/dist/components/source.js.map +1 -1
- package/dist/components/spinner.js +1 -0
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stat-card.js +1 -0
- package/dist/components/stat-card.js.map +1 -1
- package/dist/components/status.js +1 -0
- package/dist/components/status.js.map +1 -1
- package/dist/components/steps.js +1 -0
- package/dist/components/steps.js.map +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +6 -5
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +1 -0
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.js +8 -7
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.js +1 -0
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.d.ts +1 -1
- package/dist/components/toast.js +11 -10
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toaster.js +1 -0
- package/dist/components/toaster.js.map +1 -1
- package/dist/components/tool-call.js +5 -4
- package/dist/components/tool-call.js.map +1 -1
- package/dist/components/toolbar.js +1 -0
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +10 -9
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tour.js +8 -6
- package/dist/components/tour.js.map +1 -1
- package/dist/components/tree-view.js +1 -0
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/voice-recorder.js +1 -0
- package/dist/components/voice-recorder.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/package.json +21 -11
- package/vendor-manifest.json +1101 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare module 'react' {
|
|
3
|
+
interface CSSProperties {
|
|
4
|
+
[varName: `--radix-${string}`]: string | number | undefined | null;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "select", "span", "svg", "ul"];
|
|
8
|
+
type Primitives = {
|
|
9
|
+
[E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E>;
|
|
10
|
+
};
|
|
11
|
+
type PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
};
|
|
14
|
+
interface PrimitiveForwardRefComponent<E extends React.ElementType> extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {
|
|
15
|
+
}
|
|
16
|
+
declare const Primitive: Primitives;
|
|
17
|
+
/**
|
|
18
|
+
* Flush custom event dispatch
|
|
19
|
+
* https://github.com/radix-ui/primitives/pull/1378
|
|
20
|
+
*
|
|
21
|
+
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
|
22
|
+
*
|
|
23
|
+
* Internally, React prioritises events in the following order:
|
|
24
|
+
* - discrete
|
|
25
|
+
* - continuous
|
|
26
|
+
* - default
|
|
27
|
+
*
|
|
28
|
+
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
|
29
|
+
*
|
|
30
|
+
* `discrete` is an important distinction as updates within these events are applied immediately.
|
|
31
|
+
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
|
32
|
+
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
|
33
|
+
* dispatched by another `discrete` event.
|
|
34
|
+
*
|
|
35
|
+
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
|
36
|
+
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
|
37
|
+
* is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
|
38
|
+
* For example:
|
|
39
|
+
*
|
|
40
|
+
* dispatching a known click 👎
|
|
41
|
+
* target.dispatchEvent(new Event(‘click’))
|
|
42
|
+
*
|
|
43
|
+
* dispatching a custom type within a non-discrete event 👎
|
|
44
|
+
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
|
45
|
+
*
|
|
46
|
+
* dispatching a custom type within a `discrete` event 👍
|
|
47
|
+
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
|
48
|
+
*
|
|
49
|
+
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
50
|
+
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
51
|
+
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
52
|
+
*/
|
|
53
|
+
declare function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E): void;
|
|
54
|
+
declare const Root: Primitives;
|
|
55
|
+
export { Primitive, Root, dispatchDiscreteCustomEvent, };
|
|
56
|
+
export type { PrimitivePropsWithRef };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createSlot } from "../react-slot/slot.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import * as ReactDOM from "react-dom";
|
|
6
|
+
//#region src/primitives/vendor/radix/react-primitive/primitive.tsx
|
|
7
|
+
/* @__NO_SIDE_EFFECTS__ */ var Primitive = [
|
|
8
|
+
"a",
|
|
9
|
+
"button",
|
|
10
|
+
"div",
|
|
11
|
+
"form",
|
|
12
|
+
"h2",
|
|
13
|
+
"h3",
|
|
14
|
+
"img",
|
|
15
|
+
"input",
|
|
16
|
+
"label",
|
|
17
|
+
"li",
|
|
18
|
+
"nav",
|
|
19
|
+
"ol",
|
|
20
|
+
"p",
|
|
21
|
+
"select",
|
|
22
|
+
"span",
|
|
23
|
+
"svg",
|
|
24
|
+
"ul"
|
|
25
|
+
].reduce((primitive, node) => {
|
|
26
|
+
const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
27
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
28
|
+
const { asChild, ...primitiveProps } = props;
|
|
29
|
+
const Comp = asChild ? Slot : node;
|
|
30
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
31
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
32
|
+
...primitiveProps,
|
|
33
|
+
ref: forwardedRef
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
Node.displayName = `Primitive.${node}`;
|
|
37
|
+
return {
|
|
38
|
+
...primitive,
|
|
39
|
+
[node]: Node
|
|
40
|
+
};
|
|
41
|
+
}, {});
|
|
42
|
+
/**
|
|
43
|
+
* Flush custom event dispatch
|
|
44
|
+
* https://github.com/radix-ui/primitives/pull/1378
|
|
45
|
+
*
|
|
46
|
+
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
|
47
|
+
*
|
|
48
|
+
* Internally, React prioritises events in the following order:
|
|
49
|
+
* - discrete
|
|
50
|
+
* - continuous
|
|
51
|
+
* - default
|
|
52
|
+
*
|
|
53
|
+
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
|
54
|
+
*
|
|
55
|
+
* `discrete` is an important distinction as updates within these events are applied immediately.
|
|
56
|
+
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
|
57
|
+
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
|
58
|
+
* dispatched by another `discrete` event.
|
|
59
|
+
*
|
|
60
|
+
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
|
61
|
+
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
|
62
|
+
* is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
|
63
|
+
* For example:
|
|
64
|
+
*
|
|
65
|
+
* dispatching a known click 👎
|
|
66
|
+
* target.dispatchEvent(new Event(‘click’))
|
|
67
|
+
*
|
|
68
|
+
* dispatching a custom type within a non-discrete event 👎
|
|
69
|
+
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
|
70
|
+
*
|
|
71
|
+
* dispatching a custom type within a `discrete` event 👍
|
|
72
|
+
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
|
73
|
+
*
|
|
74
|
+
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
75
|
+
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
76
|
+
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
77
|
+
*/
|
|
78
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
79
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { Primitive, dispatchDiscreteCustomEvent };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=primitive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive.js","names":[],"sources":["../../../../../src/primitives/vendor/radix/react-primitive/primitive.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 * as ReactDOM from 'react-dom';\nimport { createSlot } from '../react-slot';\n\ndeclare module 'react' {\n interface CSSProperties {\n [varName: `--radix-${string}`]: string | number | undefined | null;\n }\n}\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<\n E extends React.ElementType,\n> extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\n/* @__NO_SIDE_EFFECTS__ */ const Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n"],"mappings":";;;;;;2BA6C2B,IAAM,YAAY;CAhC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAgB2C,CAAA,CAAM,QAAQ,WAAW,SAAS;CAC7E,MAAM,OAAO,2BAAW,aAAa,MAAM;CAC3C,MAAM,OAAO,MAAM,YAAY,OAA2C,iBAAsB;EAC9F,MAAM,EAAE,SAAS,GAAG,mBAAmB;EACvC,MAAM,OAAY,UAAU,OAAO;EAEnC,IAAI,OAAO,WAAW,aACpB,OAAgB,OAAO,IAAI,UAAU,KAAK;EAG5C,OAAO,oBAAC,MAAD;GAAM,GAAI;GAAgB,KAAK;EAAe,CAAA;CACvD,CAAC;CAED,KAAK,cAAc,aAAa;CAEhC,OAAO;EAAE,GAAG;GAAY,OAAO;CAAK;AACtC,GAAG,CAAC,CAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CnB,SAAS,4BAAmD,QAAqB,OAAU;CACzF,IAAI,QAAQ,SAAS,gBAAgB,OAAO,cAAc,KAAK,CAAC;AAClE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Primitive } from '../react-primitive';
|
|
3
|
+
declare const createProgressScope: import("../react-context").CreateScope;
|
|
4
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
5
|
+
interface ProgressProps extends PrimitiveDivProps {
|
|
6
|
+
value?: number | null | undefined;
|
|
7
|
+
max?: number;
|
|
8
|
+
getValueLabel?(value: number, max: number): string;
|
|
9
|
+
}
|
|
10
|
+
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
interface ProgressIndicatorProps extends PrimitiveDivProps {
|
|
12
|
+
}
|
|
13
|
+
declare const ProgressIndicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const Root: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const Indicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { createProgressScope, Progress, ProgressIndicator, Root, Indicator, };
|
|
17
|
+
export type { ProgressProps, ProgressIndicatorProps };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContextScope } from "../react-context/create-context.js";
|
|
3
|
+
import { Primitive } from "../react-primitive/primitive.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/primitives/vendor/radix/react-progress/progress.tsx
|
|
7
|
+
var PROGRESS_NAME = "Progress";
|
|
8
|
+
var DEFAULT_MAX = 100;
|
|
9
|
+
var [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);
|
|
10
|
+
var [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
11
|
+
var Progress = /* @__PURE__ */ React.forwardRef(function Progress(props, forwardedRef) {
|
|
12
|
+
const { __scopeProgress, value: valueProp = null, max: maxProp, getValueLabel = defaultGetValueLabel, ...progressProps } = props;
|
|
13
|
+
if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) console.error(getInvalidMaxError(`${maxProp}`, "Progress"));
|
|
14
|
+
const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
|
|
15
|
+
if (valueProp !== null && !isValidValueNumber(valueProp, max)) console.error(getInvalidValueError(`${valueProp}`, "Progress"));
|
|
16
|
+
const value = isValidValueNumber(valueProp, max) ? valueProp : null;
|
|
17
|
+
const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
|
|
18
|
+
return /* @__PURE__ */ jsx(ProgressProvider, {
|
|
19
|
+
scope: __scopeProgress,
|
|
20
|
+
value,
|
|
21
|
+
max,
|
|
22
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
23
|
+
"aria-valuemax": max,
|
|
24
|
+
"aria-valuemin": 0,
|
|
25
|
+
"aria-valuenow": isNumber(value) ? value : void 0,
|
|
26
|
+
"aria-valuetext": valueLabel,
|
|
27
|
+
role: "progressbar",
|
|
28
|
+
"data-state": getProgressState(value, max),
|
|
29
|
+
"data-value": value ?? void 0,
|
|
30
|
+
"data-max": max,
|
|
31
|
+
...progressProps,
|
|
32
|
+
ref: forwardedRef
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
var INDICATOR_NAME = "ProgressIndicator";
|
|
37
|
+
var ProgressIndicator = /* @__PURE__ */ React.forwardRef(function ProgressIndicator(props, forwardedRef) {
|
|
38
|
+
const { __scopeProgress, ...indicatorProps } = props;
|
|
39
|
+
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
40
|
+
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
41
|
+
"data-state": getProgressState(context.value, context.max),
|
|
42
|
+
"data-value": context.value ?? void 0,
|
|
43
|
+
"data-max": context.max,
|
|
44
|
+
...indicatorProps,
|
|
45
|
+
ref: forwardedRef
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
function defaultGetValueLabel(value, max) {
|
|
49
|
+
return `${Math.round(value / max * 100)}%`;
|
|
50
|
+
}
|
|
51
|
+
function getProgressState(value, maxValue) {
|
|
52
|
+
return value == null ? "indeterminate" : value === maxValue ? "complete" : "loading";
|
|
53
|
+
}
|
|
54
|
+
function isNumber(value) {
|
|
55
|
+
return typeof value === "number";
|
|
56
|
+
}
|
|
57
|
+
function isValidMaxNumber(max) {
|
|
58
|
+
return isNumber(max) && !isNaN(max) && max > 0;
|
|
59
|
+
}
|
|
60
|
+
function isValidValueNumber(value, max) {
|
|
61
|
+
return isNumber(value) && !isNaN(value) && value <= max && value >= 0;
|
|
62
|
+
}
|
|
63
|
+
function getInvalidMaxError(propValue, componentName) {
|
|
64
|
+
return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`;
|
|
65
|
+
}
|
|
66
|
+
function getInvalidValueError(propValue, componentName) {
|
|
67
|
+
return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be:
|
|
68
|
+
- a positive number
|
|
69
|
+
- less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set)
|
|
70
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
71
|
+
|
|
72
|
+
Defaulting to \`null\`.`;
|
|
73
|
+
}
|
|
74
|
+
var Root = Progress;
|
|
75
|
+
var Indicator = ProgressIndicator;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { Indicator, Progress, ProgressIndicator, Root };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","names":[],"sources":["../../../../../src/primitives/vendor/radix/react-progress/progress.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 { createContextScope } from '../react-context';\nimport { Primitive } from '../react-primitive';\n\nimport type { Scope } from '../react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * Progress\n * -----------------------------------------------------------------------------------------------*/\n\nconst PROGRESS_NAME = 'Progress';\nconst DEFAULT_MAX = 100;\n\ntype ScopedProps<P> = P & { __scopeProgress?: Scope };\nconst [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\n\ntype ProgressState = 'indeterminate' | 'complete' | 'loading';\ntype ProgressContextValue = { value: number | null; max: number };\nconst [ProgressProvider, useProgressContext] =\n createProgressContext<ProgressContextValue>(PROGRESS_NAME);\n\ntype ProgressElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface ProgressProps extends PrimitiveDivProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?(value: number, max: number): string;\n}\n\nconst Progress = /* @__PURE__ */ React.forwardRef<ProgressElement, ProgressProps>(\n // blank line to reduce diff noise\n function Progress(props: ScopedProps<ProgressProps>, forwardedRef) {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, 'Progress'));\n }\n\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, 'Progress'));\n }\n\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined;\n\n return (\n <ProgressProvider scope={__scopeProgress} value={value} max={max}>\n <Primitive.div\n aria-valuemax={max}\n aria-valuemin={0}\n aria-valuenow={isNumber(value) ? value : undefined}\n aria-valuetext={valueLabel}\n role=\"progressbar\"\n data-state={getProgressState(value, max)}\n data-value={value ?? undefined}\n data-max={max}\n {...progressProps}\n ref={forwardedRef}\n />\n </ProgressProvider>\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * ProgressIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'ProgressIndicator';\n\ntype ProgressIndicatorElement = React.ComponentRef<typeof Primitive.div>;\ninterface ProgressIndicatorProps extends PrimitiveDivProps {}\n\nconst ProgressIndicator = /* @__PURE__ */ React.forwardRef<\n ProgressIndicatorElement,\n ProgressIndicatorProps\n>(\n // blank line to reduce diff noise\n function ProgressIndicator(props: ScopedProps<ProgressIndicatorProps>, forwardedRef) {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return (\n <Primitive.div\n data-state={getProgressState(context.value, context.max)}\n data-value={context.value ?? undefined}\n data-max={context.max}\n {...indicatorProps}\n ref={forwardedRef}\n />\n );\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\nfunction defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n}\n\nfunction getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n}\n\nfunction isNumber(value: any): value is number {\n return typeof value === 'number';\n}\n\nfunction isValidMaxNumber(max: any): max is number {\n // oxfmt-ignore\n return (\n isNumber(max) &&\n !isNaN(max) &&\n max > 0\n );\n}\n\nfunction isValidValueNumber(value: any, max: number): value is number {\n // oxfmt-ignore\n return (\n isNumber(value) &&\n !isNaN(value) &&\n value <= max &&\n value >= 0\n );\n}\n\n// Split this out for clearer readability of the error message.\nfunction getInvalidMaxError(propValue: string, componentName: string) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\n\nfunction getInvalidValueError(propValue: string, componentName: string) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\n\nconst Root = Progress;\nconst Indicator = ProgressIndicator;\n\nexport {\n createProgressScope,\n //\n Progress,\n ProgressIndicator,\n //\n Root,\n Indicator,\n};\nexport type { ProgressProps, ProgressIndicatorProps };\n"],"mappings":";;;;;;AAYA,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAGpB,IAAM,CAAC,uBAAuB,uBAAuB,mBAAmB,aAAa;AAIrF,IAAM,CAAC,kBAAkB,sBACvB,sBAA4C,aAAa;AAU3D,IAAM,WAA2B,sBAAM,WAErC,SAAS,SAAS,OAAmC,cAAc;CACjE,MAAM,EACJ,iBACA,OAAO,YAAY,MACnB,KAAK,SACL,gBAAgB,sBAChB,GAAG,kBACD;CAEJ,KAAK,WAAW,YAAY,MAAM,CAAC,iBAAiB,OAAO,GACzD,QAAQ,MAAM,mBAAmB,GAAG,WAAW,UAAU,CAAC;CAG5D,MAAM,MAAM,iBAAiB,OAAO,IAAI,UAAU;CAElD,IAAI,cAAc,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAC1D,QAAQ,MAAM,qBAAqB,GAAG,aAAa,UAAU,CAAC;CAGhE,MAAM,QAAQ,mBAAmB,WAAW,GAAG,IAAI,YAAY;CAC/D,MAAM,aAAa,SAAS,KAAK,IAAI,cAAc,OAAO,GAAG,IAAI,KAAA;CAEjE,OACE,oBAAC,kBAAD;EAAkB,OAAO;EAAwB;EAAY;EAC3D,UAAA,oBAAC,UAAU,KAAX;GACE,iBAAe;GACf,iBAAe;GACf,iBAAe,SAAS,KAAK,IAAI,QAAQ,KAAA;GACzC,kBAAgB;GAChB,MAAK;GACL,cAAY,iBAAiB,OAAO,GAAG;GACvC,cAAY,SAAS,KAAA;GACrB,YAAU;GACV,GAAI;GACJ,KAAK;EACN,CAAA;CACe,CAAA;AAEtB,CACF;AAMA,IAAM,iBAAiB;AAKvB,IAAM,oBAAoC,sBAAM,WAK9C,SAAS,kBAAkB,OAA4C,cAAc;CACnF,MAAM,EAAE,iBAAiB,GAAG,mBAAmB;CAC/C,MAAM,UAAU,mBAAmB,gBAAgB,eAAe;CAClE,OACE,oBAAC,UAAU,KAAX;EACE,cAAY,iBAAiB,QAAQ,OAAO,QAAQ,GAAG;EACvD,cAAY,QAAQ,SAAS,KAAA;EAC7B,YAAU,QAAQ;EAClB,GAAI;EACJ,KAAK;CACN,CAAA;AAEL,CACF;AAIA,SAAS,qBAAqB,OAAe,KAAa;CACxD,OAAO,GAAG,KAAK,MAAO,QAAQ,MAAO,GAAG,EAAE;AAC5C;AAEA,SAAS,iBAAiB,OAAkC,UAAiC;CAC3F,OAAO,SAAS,OAAO,kBAAkB,UAAU,WAAW,aAAa;AAC7E;AAEA,SAAS,SAAS,OAA6B;CAC7C,OAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,iBAAiB,KAAyB;CAEjD,OACE,SAAS,GAAG,KACZ,CAAC,MAAM,GAAG,KACV,MAAM;AAEV;AAEA,SAAS,mBAAmB,OAAY,KAA8B;CAEpE,OACE,SAAS,KAAK,KACd,CAAC,MAAM,KAAK,KACZ,SAAS,OACT,SAAS;AAEb;AAGA,SAAS,mBAAmB,WAAmB,eAAuB;CACpE,OAAO,mCAAmC,UAAU,mBAAmB,cAAc,wEAAwE,YAAY;AAC3K;AAEA,SAAS,qBAAqB,WAAmB,eAAuB;CACtE,OAAO,qCAAqC,UAAU,mBAAmB,cAAc;;gDAEzC,YAAY;;;;AAI5D;AAEA,IAAM,OAAO;AACb,IAAM,YAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createRadioGroupScope, RadioGroup, RadioGroupItem, RadioGroupItemProvider as unstable_RadioGroupItemProvider, RadioGroupItemTrigger as unstable_RadioGroupItemTrigger, RadioGroupItemBubbleInput as unstable_RadioGroupItemBubbleInput, RadioGroupIndicator, Root, Item, ItemProvider as unstable_ItemProvider, ItemTrigger as unstable_ItemTrigger, ItemBubbleInput as unstable_ItemBubbleInput, Indicator, } from './radio-group';
|
|
2
|
+
export type { RadioGroupProps, RadioGroupItemProps, RadioGroupItemProviderProps as unstable_RadioGroupItemProviderProps, RadioGroupItemTriggerProps as unstable_RadioGroupItemTriggerProps, RadioGroupItemBubbleInputProps as unstable_RadioGroupItemBubbleInputProps, RadioGroupIndicatorProps, } from './radio-group';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Primitive } from '../react-primitive';
|
|
3
|
+
import * as RovingFocusGroup from '../react-roving-focus';
|
|
4
|
+
import { type Radio, RadioTrigger, RadioBubbleInput, RadioIndicator } from './radio';
|
|
5
|
+
import type { Scope } from '../react-context';
|
|
6
|
+
type ScopedProps<P> = P & {
|
|
7
|
+
__scopeRadioGroup?: Scope;
|
|
8
|
+
};
|
|
9
|
+
declare const createRadioGroupScope: import("../react-context").CreateScope;
|
|
10
|
+
type RadioGroupContextValue = {
|
|
11
|
+
name?: string;
|
|
12
|
+
form?: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
value: string | null;
|
|
16
|
+
onValueChange(value: string): void;
|
|
17
|
+
};
|
|
18
|
+
type RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
|
|
19
|
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
20
|
+
interface RadioGroupProps extends PrimitiveDivProps {
|
|
21
|
+
name?: RadioGroupContextValue['name'];
|
|
22
|
+
form?: React.ComponentPropsWithoutRef<typeof Radio>['form'];
|
|
23
|
+
required?: React.ComponentPropsWithoutRef<typeof Radio>['required'];
|
|
24
|
+
disabled?: React.ComponentPropsWithoutRef<typeof Radio>['disabled'];
|
|
25
|
+
dir?: RovingFocusGroupProps['dir'];
|
|
26
|
+
orientation?: RovingFocusGroupProps['orientation'];
|
|
27
|
+
loop?: RovingFocusGroupProps['loop'];
|
|
28
|
+
defaultValue?: string;
|
|
29
|
+
value?: string | null;
|
|
30
|
+
onValueChange?: RadioGroupContextValue['onValueChange'];
|
|
31
|
+
}
|
|
32
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
interface RadioGroupItemProviderProps {
|
|
34
|
+
value: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare function RadioGroupItemProvider(props: ScopedProps<RadioGroupItemProviderProps>): React.JSX.Element;
|
|
39
|
+
interface RadioGroupItemTriggerProps extends React.ComponentPropsWithoutRef<typeof RadioTrigger> {
|
|
40
|
+
}
|
|
41
|
+
declare const RadioGroupItemTrigger: React.ForwardRefExoticComponent<RadioGroupItemTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
type RadioProps = React.ComponentPropsWithoutRef<typeof Radio>;
|
|
43
|
+
interface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {
|
|
44
|
+
value: string;
|
|
45
|
+
}
|
|
46
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
47
|
+
interface RadioGroupItemBubbleInputProps extends React.ComponentPropsWithoutRef<typeof RadioBubbleInput> {
|
|
48
|
+
}
|
|
49
|
+
declare const RadioGroupItemBubbleInput: React.ForwardRefExoticComponent<RadioGroupItemBubbleInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
50
|
+
type RadioIndicatorProps = React.ComponentPropsWithoutRef<typeof RadioIndicator>;
|
|
51
|
+
interface RadioGroupIndicatorProps extends RadioIndicatorProps {
|
|
52
|
+
}
|
|
53
|
+
declare const RadioGroupIndicator: React.ForwardRefExoticComponent<RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
54
|
+
export { createRadioGroupScope, RadioGroup, RadioGroupItem, RadioGroupItemProvider, RadioGroupItemTrigger, RadioGroupItemBubbleInput, RadioGroupIndicator, RadioGroup as Root, RadioGroupItem as Item, RadioGroupItemProvider as ItemProvider, RadioGroupItemTrigger as ItemTrigger, RadioGroupItemBubbleInput as ItemBubbleInput, RadioGroupIndicator as Indicator, };
|
|
55
|
+
export type { RadioGroupProps, RadioGroupItemProps, RadioGroupItemProviderProps, RadioGroupItemTriggerProps, RadioGroupItemBubbleInputProps, RadioGroupIndicatorProps, };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContextScope } from "../react-context/create-context.js";
|
|
3
|
+
import { useComposedRefs } from "../react-compose-refs/compose-refs.js";
|
|
4
|
+
import { composeEventHandlers } from "../primitive/primitive.js";
|
|
5
|
+
import { useControllableState } from "../react-use-controllable-state/use-controllable-state.js";
|
|
6
|
+
import { Primitive } from "../react-primitive/primitive.js";
|
|
7
|
+
import { useDirection } from "../react-direction/direction.js";
|
|
8
|
+
import { Item, Root, createRovingFocusGroupScope } from "../react-roving-focus/roving-focus-group.js";
|
|
9
|
+
import { RadioBubbleInput, RadioIndicator, RadioProvider, RadioTrigger, createRadioScope, useRadioContext } from "./radio.js";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
//#region src/primitives/vendor/radix/react-radio-group/radio-group.tsx
|
|
13
|
+
var ARROW_KEYS = [
|
|
14
|
+
"ArrowUp",
|
|
15
|
+
"ArrowDown",
|
|
16
|
+
"ArrowLeft",
|
|
17
|
+
"ArrowRight"
|
|
18
|
+
];
|
|
19
|
+
var RADIO_GROUP_NAME = "RadioGroup";
|
|
20
|
+
var [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [createRovingFocusGroupScope, createRadioScope]);
|
|
21
|
+
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
22
|
+
var useRadioScope = createRadioScope();
|
|
23
|
+
var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
|
|
24
|
+
var RadioGroup = /* @__PURE__ */ React.forwardRef(function RadioGroup(props, forwardedRef) {
|
|
25
|
+
const { __scopeRadioGroup, name, form, defaultValue, value: valueProp, required = false, disabled = false, orientation, dir, loop = true, onValueChange, ...groupProps } = props;
|
|
26
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
|
27
|
+
const direction = useDirection(dir);
|
|
28
|
+
const [value, setValue] = useControllableState({
|
|
29
|
+
prop: valueProp,
|
|
30
|
+
defaultProp: defaultValue ?? null,
|
|
31
|
+
onChange: onValueChange,
|
|
32
|
+
caller: RADIO_GROUP_NAME
|
|
33
|
+
});
|
|
34
|
+
const [control, setControl] = React.useState(null);
|
|
35
|
+
const composedRefs = useComposedRefs(forwardedRef, setControl);
|
|
36
|
+
const initialValueRef = React.useRef(value);
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
const associatedForm = form ? control?.ownerDocument.getElementById(form) : control?.closest("form");
|
|
39
|
+
if (associatedForm instanceof HTMLFormElement) {
|
|
40
|
+
const reset = () => setValue(initialValueRef.current);
|
|
41
|
+
associatedForm.addEventListener("reset", reset);
|
|
42
|
+
return () => associatedForm.removeEventListener("reset", reset);
|
|
43
|
+
}
|
|
44
|
+
}, [
|
|
45
|
+
control,
|
|
46
|
+
form,
|
|
47
|
+
setValue
|
|
48
|
+
]);
|
|
49
|
+
return /* @__PURE__ */ jsx(RadioGroupProvider, {
|
|
50
|
+
scope: __scopeRadioGroup,
|
|
51
|
+
name,
|
|
52
|
+
form,
|
|
53
|
+
required,
|
|
54
|
+
disabled,
|
|
55
|
+
value,
|
|
56
|
+
onValueChange: setValue,
|
|
57
|
+
children: /* @__PURE__ */ jsx(Root, {
|
|
58
|
+
asChild: true,
|
|
59
|
+
...rovingFocusGroupScope,
|
|
60
|
+
orientation,
|
|
61
|
+
dir: direction,
|
|
62
|
+
loop,
|
|
63
|
+
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
64
|
+
role: "radiogroup",
|
|
65
|
+
"aria-required": required,
|
|
66
|
+
"aria-orientation": orientation,
|
|
67
|
+
"data-disabled": disabled ? "" : void 0,
|
|
68
|
+
dir: direction,
|
|
69
|
+
...groupProps,
|
|
70
|
+
ref: composedRefs
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var ITEM_PROVIDER_NAME = "RadioGroupItemProvider";
|
|
76
|
+
var ITEM_TRIGGER_NAME = "RadioGroupItemTrigger";
|
|
77
|
+
function RadioGroupItemProvider(props) {
|
|
78
|
+
const { __scopeRadioGroup, value, disabled, children, internal_do_not_use_render } = props;
|
|
79
|
+
const context = useRadioGroupContext(ITEM_PROVIDER_NAME, __scopeRadioGroup);
|
|
80
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
81
|
+
const isDisabled = context.disabled || disabled;
|
|
82
|
+
return /* @__PURE__ */ jsx(RadioProvider, {
|
|
83
|
+
...radioScope,
|
|
84
|
+
checked: context.value === value,
|
|
85
|
+
disabled: isDisabled,
|
|
86
|
+
required: context.required,
|
|
87
|
+
name: context.name,
|
|
88
|
+
form: context.form,
|
|
89
|
+
value,
|
|
90
|
+
onCheck: () => context.onValueChange(value),
|
|
91
|
+
internal_do_not_use_render,
|
|
92
|
+
children
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
var RadioGroupItemTrigger = /* @__PURE__ */ React.forwardRef(function RadioGroupItemTrigger(props, forwardedRef) {
|
|
96
|
+
const { __scopeRadioGroup, ...triggerProps } = props;
|
|
97
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
|
98
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
99
|
+
const { checked, disabled } = useRadioContext(ITEM_TRIGGER_NAME, radioScope.__scopeRadio);
|
|
100
|
+
const ref = React.useRef(null);
|
|
101
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
102
|
+
const isArrowKeyPressedRef = React.useRef(false);
|
|
103
|
+
React.useEffect(() => {
|
|
104
|
+
const handleKeyDown = (event) => {
|
|
105
|
+
if (ARROW_KEYS.includes(event.key)) isArrowKeyPressedRef.current = true;
|
|
106
|
+
};
|
|
107
|
+
const handleKeyUp = () => isArrowKeyPressedRef.current = false;
|
|
108
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
109
|
+
document.addEventListener("keyup", handleKeyUp);
|
|
110
|
+
return () => {
|
|
111
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
112
|
+
document.removeEventListener("keyup", handleKeyUp);
|
|
113
|
+
};
|
|
114
|
+
}, []);
|
|
115
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
116
|
+
asChild: true,
|
|
117
|
+
...rovingFocusGroupScope,
|
|
118
|
+
focusable: !disabled,
|
|
119
|
+
active: checked,
|
|
120
|
+
children: /* @__PURE__ */ jsx(RadioTrigger, {
|
|
121
|
+
...radioScope,
|
|
122
|
+
...triggerProps,
|
|
123
|
+
ref: composedRefs,
|
|
124
|
+
onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {
|
|
125
|
+
if (event.key === "Enter") event.preventDefault();
|
|
126
|
+
}),
|
|
127
|
+
onFocus: composeEventHandlers(triggerProps.onFocus, () => {
|
|
128
|
+
/**
|
|
129
|
+
* Our `RovingFocusGroup` will focus the radio when navigating with
|
|
130
|
+
* arrow keys and we need to "check" it in that case. We click it to
|
|
131
|
+
* "check" it (instead of updating `context.value`) so that the radio
|
|
132
|
+
* change event fires.
|
|
133
|
+
*/
|
|
134
|
+
if (isArrowKeyPressedRef.current) ref.current?.click();
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
var RadioGroupItem = /* @__PURE__ */ React.forwardRef(function RadioGroupItem(props, forwardedRef) {
|
|
140
|
+
const { __scopeRadioGroup, value, disabled, ...itemProps } = props;
|
|
141
|
+
return /* @__PURE__ */ jsx(RadioGroupItemProvider, {
|
|
142
|
+
__scopeRadioGroup,
|
|
143
|
+
value,
|
|
144
|
+
disabled,
|
|
145
|
+
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RadioGroupItemTrigger, {
|
|
146
|
+
...itemProps,
|
|
147
|
+
ref: forwardedRef,
|
|
148
|
+
__scopeRadioGroup
|
|
149
|
+
}), isFormControl && /* @__PURE__ */ jsx(RadioGroupItemBubbleInput, { __scopeRadioGroup })] })
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
var RadioGroupItemBubbleInput = /* @__PURE__ */ React.forwardRef(function RadioGroupItemBubbleInput(props, forwardedRef) {
|
|
153
|
+
const { __scopeRadioGroup, ...bubbleProps } = props;
|
|
154
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
155
|
+
return /* @__PURE__ */ jsx(RadioBubbleInput, {
|
|
156
|
+
...radioScope,
|
|
157
|
+
...bubbleProps,
|
|
158
|
+
ref: forwardedRef
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
var RadioGroupIndicator = /* @__PURE__ */ React.forwardRef(function RadioGroupIndicator(props, forwardedRef) {
|
|
162
|
+
const { __scopeRadioGroup, ...indicatorProps } = props;
|
|
163
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
164
|
+
return /* @__PURE__ */ jsx(RadioIndicator, {
|
|
165
|
+
...radioScope,
|
|
166
|
+
...indicatorProps,
|
|
167
|
+
ref: forwardedRef
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
//#endregion
|
|
171
|
+
export { RadioGroupIndicator as Indicator, RadioGroupIndicator, RadioGroupItem as Item, RadioGroupItem, RadioGroupItemBubbleInput as ItemBubbleInput, RadioGroupItemBubbleInput, RadioGroupItemProvider as ItemProvider, RadioGroupItemProvider, RadioGroupItemTrigger as ItemTrigger, RadioGroupItemTrigger, RadioGroup, RadioGroup as Root };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=radio-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["RovingFocusGroup.Root","RovingFocusGroup.Item","_Fragment"],"sources":["../../../../../src/primitives/vendor/radix/react-radio-group/radio-group.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 { Primitive } from '../react-primitive';\nimport * as RovingFocusGroup from '../react-roving-focus';\nimport { createRovingFocusGroupScope } from '../react-roving-focus';\nimport { useControllableState } from '../react-use-controllable-state';\nimport { useDirection } from '../react-direction';\nimport {\n type Radio,\n RadioProvider,\n RadioTrigger,\n RadioBubbleInput,\n RadioIndicator,\n createRadioScope,\n useRadioContext,\n} from './radio';\n\nimport type { Scope } from '../react-context';\n\nconst ARROW_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Scope };\nconst [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [\n createRovingFocusGroupScope,\n createRadioScope,\n]);\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\nconst useRadioScope = createRadioScope();\n\ntype RadioGroupContextValue = {\n name?: string;\n form?: string;\n required: boolean;\n disabled: boolean;\n value: string | null;\n onValueChange(value: string): void;\n};\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME);\n\ntype RadioGroupElement = React.ComponentRef<typeof Primitive.div>;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RadioGroupProps extends PrimitiveDivProps {\n name?: RadioGroupContextValue['name'];\n form?: React.ComponentPropsWithoutRef<typeof Radio>['form'];\n required?: React.ComponentPropsWithoutRef<typeof Radio>['required'];\n disabled?: React.ComponentPropsWithoutRef<typeof Radio>['disabled'];\n dir?: RovingFocusGroupProps['dir'];\n orientation?: RovingFocusGroupProps['orientation'];\n loop?: RovingFocusGroupProps['loop'];\n defaultValue?: string;\n value?: string | null;\n onValueChange?: RadioGroupContextValue['onValueChange'];\n}\n\nconst RadioGroup = /* @__PURE__ */ React.forwardRef<RadioGroupElement, RadioGroupProps>(\n function RadioGroup(props: ScopedProps<RadioGroupProps>, forwardedRef) {\n const {\n __scopeRadioGroup,\n name,\n form,\n defaultValue,\n value: valueProp,\n required = false,\n disabled = false,\n orientation,\n dir,\n loop = true,\n onValueChange,\n ...groupProps\n } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? null,\n onChange: onValueChange as (value: string | null) => void,\n caller: RADIO_GROUP_NAME,\n });\n const [control, setControl] = React.useState<RadioGroupElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, setControl);\n\n const initialValueRef = React.useRef(value);\n React.useEffect(() => {\n const associatedForm = form\n ? control?.ownerDocument.getElementById(form)\n : control?.closest('form');\n if (associatedForm instanceof HTMLFormElement) {\n const reset = () => setValue(initialValueRef.current);\n associatedForm.addEventListener('reset', reset);\n return () => associatedForm.removeEventListener('reset', reset);\n }\n }, [control, form, setValue]);\n\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={value}\n onValueChange={setValue}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n orientation={orientation}\n dir={direction}\n loop={loop}\n >\n <Primitive.div\n role=\"radiogroup\"\n aria-required={required}\n aria-orientation={orientation}\n data-disabled={disabled ? '' : undefined}\n dir={direction}\n {...groupProps}\n ref={composedRefs}\n />\n </RovingFocusGroup.Root>\n </RadioGroupProvider>\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemProvider\n * -----------------------------------------------------------------------------------------------*/\nconst ITEM_PROVIDER_NAME = 'RadioGroupItemProvider';\nconst ITEM_TRIGGER_NAME = 'RadioGroupItemTrigger';\n\ninterface RadioGroupItemProviderProps {\n value: string;\n disabled?: boolean;\n children?: React.ReactNode;\n}\n\nfunction RadioGroupItemProvider(props: ScopedProps<RadioGroupItemProviderProps>) {\n const {\n __scopeRadioGroup,\n value,\n disabled,\n children,\n // @ts-expect-error\n internal_do_not_use_render,\n } = props;\n const context = useRadioGroupContext(ITEM_PROVIDER_NAME, __scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const isDisabled = context.disabled || disabled;\n\n return (\n <RadioProvider\n {...radioScope}\n checked={context.value === value}\n disabled={isDisabled}\n required={context.required}\n name={context.name}\n form={context.form}\n value={value}\n onCheck={() => context.onValueChange(value)}\n // @ts-expect-error\n internal_do_not_use_render={internal_do_not_use_render}\n >\n {children}\n </RadioProvider>\n );\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemTrigger\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemTriggerElement = React.ComponentRef<typeof RadioTrigger>;\ninterface RadioGroupItemTriggerProps extends React.ComponentPropsWithoutRef<typeof RadioTrigger> {}\n\nconst RadioGroupItemTrigger = /* @__PURE__ */ React.forwardRef<\n RadioGroupItemTriggerElement,\n RadioGroupItemTriggerProps\n>(function RadioGroupItemTrigger(props: ScopedProps<RadioGroupItemTriggerProps>, forwardedRef) {\n const { __scopeRadioGroup, ...triggerProps } = props;\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);\n const radioScope = useRadioScope(__scopeRadioGroup);\n const { checked, disabled } = useRadioContext(ITEM_TRIGGER_NAME, radioScope.__scopeRadio);\n const ref = React.useRef<RadioGroupItemTriggerElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isArrowKeyPressedRef = React.useRef(false);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (ARROW_KEYS.includes(event.key)) {\n isArrowKeyPressedRef.current = true;\n }\n };\n const handleKeyUp = () => (isArrowKeyPressedRef.current = false);\n document.addEventListener('keydown', handleKeyDown);\n document.addEventListener('keyup', handleKeyUp);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n document.removeEventListener('keyup', handleKeyUp);\n };\n }, []);\n\n return (\n <RovingFocusGroup.Item\n asChild\n {...rovingFocusGroupScope}\n focusable={!disabled}\n active={checked}\n >\n <RadioTrigger\n {...radioScope}\n {...triggerProps}\n ref={composedRefs}\n onKeyDown={composeEventHandlers(triggerProps.onKeyDown, (event) => {\n // According to WAI ARIA, radio groups don't activate items on enter\n // keypress\n if (event.key === 'Enter') event.preventDefault();\n })}\n onFocus={composeEventHandlers(triggerProps.onFocus, () => {\n /**\n * Our `RovingFocusGroup` will focus the radio when navigating with\n * arrow keys and we need to \"check\" it in that case. We click it to\n * \"check\" it (instead of updating `context.value`) so that the radio\n * change event fires.\n */\n if (isArrowKeyPressedRef.current) {\n ref.current?.click();\n }\n })}\n />\n </RovingFocusGroup.Item>\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemElement = React.ComponentRef<typeof Radio>;\ntype RadioProps = React.ComponentPropsWithoutRef<typeof Radio>;\ninterface RadioGroupItemProps extends Omit<RadioProps, 'onCheck' | 'name'> {\n value: string;\n}\n\nconst RadioGroupItem = /* @__PURE__ */ React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n function RadioGroupItem(props: ScopedProps<RadioGroupItemProps>, forwardedRef) {\n const { __scopeRadioGroup, value, disabled, ...itemProps } = props;\n\n return (\n <RadioGroupItemProvider\n __scopeRadioGroup={__scopeRadioGroup}\n value={value}\n disabled={disabled}\n // @ts-expect-error\n internal_do_not_use_render={({ isFormControl }: { isFormControl: boolean }) => (\n <>\n <RadioGroupItemTrigger\n {...itemProps}\n ref={forwardedRef}\n // @ts-expect-error\n __scopeRadioGroup={__scopeRadioGroup}\n />\n {isFormControl && (\n <RadioGroupItemBubbleInput\n // @ts-expect-error\n __scopeRadioGroup={__scopeRadioGroup}\n />\n )}\n </>\n )}\n />\n );\n },\n);\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupItemBubbleInput\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupItemBubbleInputElement = React.ComponentRef<typeof RadioBubbleInput>;\ninterface RadioGroupItemBubbleInputProps extends React.ComponentPropsWithoutRef<\n typeof RadioBubbleInput\n> {}\n\nconst RadioGroupItemBubbleInput = /* @__PURE__ */ React.forwardRef<\n RadioGroupItemBubbleInputElement,\n RadioGroupItemBubbleInputProps\n>(function RadioGroupItemBubbleInput(\n props: ScopedProps<RadioGroupItemBubbleInputProps>,\n forwardedRef,\n) {\n const { __scopeRadioGroup, ...bubbleProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return <RadioBubbleInput {...radioScope} {...bubbleProps} ref={forwardedRef} />;\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RadioGroupIndicator\n * -----------------------------------------------------------------------------------------------*/\n\ntype RadioGroupIndicatorElement = React.ComponentRef<typeof RadioIndicator>;\ntype RadioIndicatorProps = React.ComponentPropsWithoutRef<typeof RadioIndicator>;\ninterface RadioGroupIndicatorProps extends RadioIndicatorProps {}\n\nconst RadioGroupIndicator = /* @__PURE__ */ React.forwardRef<\n RadioGroupIndicatorElement,\n RadioGroupIndicatorProps\n>(\n // blank line to reduce diff noise\n function RadioGroupIndicator(props: ScopedProps<RadioGroupIndicatorProps>, forwardedRef) {\n const { __scopeRadioGroup, ...indicatorProps } = props;\n const radioScope = useRadioScope(__scopeRadioGroup);\n return <RadioIndicator {...radioScope} {...indicatorProps} ref={forwardedRef} />;\n },\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n createRadioGroupScope,\n //\n RadioGroup,\n RadioGroupItem,\n RadioGroupItemProvider,\n RadioGroupItemTrigger,\n RadioGroupItemBubbleInput,\n RadioGroupIndicator,\n //\n RadioGroup as Root,\n RadioGroupItem as Item,\n RadioGroupItemProvider as ItemProvider,\n RadioGroupItemTrigger as ItemTrigger,\n RadioGroupItemBubbleInput as ItemBubbleInput,\n RadioGroupIndicator as Indicator,\n};\nexport type {\n RadioGroupProps,\n RadioGroupItemProps,\n RadioGroupItemProviderProps,\n RadioGroupItemTriggerProps,\n RadioGroupItemBubbleInputProps,\n RadioGroupIndicatorProps,\n};\n"],"mappings":";;;;;;;;;;;;AAuBA,IAAM,aAAa;CAAC;CAAW;CAAa;CAAa;AAAY;AAKrE,IAAM,mBAAmB;AAGzB,IAAM,CAAC,yBAAyB,yBAAyB,mBAAmB,kBAAkB,CAC5F,6BACA,gBACF,CAAC;AACD,IAAM,2BAA2B,4BAA4B;AAC7D,IAAM,gBAAgB,iBAAiB;AAWvC,IAAM,CAAC,oBAAoB,wBACzB,wBAAgD,gBAAgB;AAkBlE,IAAM,aAA6B,sBAAM,WACvC,SAAS,WAAW,OAAqC,cAAc;CACrE,MAAM,EACJ,mBACA,MACA,MACA,cACA,OAAO,WACP,WAAW,OACX,WAAW,OACX,aACA,KACA,OAAO,MACP,eACA,GAAG,eACD;CACJ,MAAM,wBAAwB,yBAAyB,iBAAiB;CACxE,MAAM,YAAY,aAAa,GAAG;CAClC,MAAM,CAAC,OAAO,YAAY,qBAAqB;EAC7C,MAAM;EACN,aAAa,gBAAgB;EAC7B,UAAU;EACV,QAAQ;CACV,CAAC;CACD,MAAM,CAAC,SAAS,cAAc,MAAM,SAAmC,IAAI;CAC3E,MAAM,eAAe,gBAAgB,cAAc,UAAU;CAE7D,MAAM,kBAAkB,MAAM,OAAO,KAAK;CAC1C,MAAM,gBAAgB;EACpB,MAAM,iBAAiB,OACnB,SAAS,cAAc,eAAe,IAAI,IAC1C,SAAS,QAAQ,MAAM;EAC3B,IAAI,0BAA0B,iBAAiB;GAC7C,MAAM,cAAc,SAAS,gBAAgB,OAAO;GACpD,eAAe,iBAAiB,SAAS,KAAK;GAC9C,aAAa,eAAe,oBAAoB,SAAS,KAAK;EAChE;CACF,GAAG;EAAC;EAAS;EAAM;CAAQ,CAAC;CAE5B,OACE,oBAAC,oBAAD;EACE,OAAO;EACD;EACA;EACI;EACA;EACH;EACP,eAAe;EAEf,UAAA,oBAACA,MAAD;GACE,SAAA;GACA,GAAI;GACS;GACb,KAAK;GACC;GAEN,UAAA,oBAAC,UAAU,KAAX;IACE,MAAK;IACL,iBAAe;IACf,oBAAkB;IAClB,iBAAe,WAAW,KAAK,KAAA;IAC/B,KAAK;IACL,GAAI;IACJ,KAAK;GACN,CAAA;EACoB,CAAA;CACL,CAAA;AAExB,CACF;AAKA,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAQ1B,SAAS,uBAAuB,OAAiD;CAC/E,MAAM,EACJ,mBACA,OACA,UACA,UAEA,+BACE;CACJ,MAAM,UAAU,qBAAqB,oBAAoB,iBAAiB;CAC1E,MAAM,aAAa,cAAc,iBAAiB;CAClD,MAAM,aAAa,QAAQ,YAAY;CAEvC,OACE,oBAAC,eAAD;EACE,GAAI;EACJ,SAAS,QAAQ,UAAU;EAC3B,UAAU;EACV,UAAU,QAAQ;EAClB,MAAM,QAAQ;EACd,MAAM,QAAQ;EACP;EACP,eAAe,QAAQ,cAAc,KAAK;EAEd;EAE3B;CACY,CAAA;AAEnB;AASA,IAAM,wBAAwC,sBAAM,WAGlD,SAAS,sBAAsB,OAAgD,cAAc;CAC7F,MAAM,EAAE,mBAAmB,GAAG,iBAAiB;CAC/C,MAAM,wBAAwB,yBAAyB,iBAAiB;CACxE,MAAM,aAAa,cAAc,iBAAiB;CAClD,MAAM,EAAE,SAAS,aAAa,gBAAgB,mBAAmB,WAAW,YAAY;CACxF,MAAM,MAAM,MAAM,OAAqC,IAAI;CAC3D,MAAM,eAAe,gBAAgB,cAAc,GAAG;CACtD,MAAM,uBAAuB,MAAM,OAAO,KAAK;CAE/C,MAAM,gBAAgB;EACpB,MAAM,iBAAiB,UAAyB;GAC9C,IAAI,WAAW,SAAS,MAAM,GAAG,GAC/B,qBAAqB,UAAU;EAEnC;EACA,MAAM,oBAAqB,qBAAqB,UAAU;EAC1D,SAAS,iBAAiB,WAAW,aAAa;EAClD,SAAS,iBAAiB,SAAS,WAAW;EAC9C,aAAa;GACX,SAAS,oBAAoB,WAAW,aAAa;GACrD,SAAS,oBAAoB,SAAS,WAAW;EACnD;CACF,GAAG,CAAC,CAAC;CAEL,OACE,oBAACC,MAAD;EACE,SAAA;EACA,GAAI;EACJ,WAAW,CAAC;EACZ,QAAQ;EAER,UAAA,oBAAC,cAAD;GACE,GAAI;GACJ,GAAI;GACJ,KAAK;GACL,WAAW,qBAAqB,aAAa,YAAY,UAAU;IAGjE,IAAI,MAAM,QAAQ,SAAS,MAAM,eAAe;GAClD,CAAC;GACD,SAAS,qBAAqB,aAAa,eAAe;;;;;;;IAOxD,IAAI,qBAAqB,SACvB,IAAI,SAAS,MAAM;GAEvB,CAAC;EACF,CAAA;CACoB,CAAA;AAE3B,CAAC;AAYD,IAAM,iBAAiC,sBAAM,WAC3C,SAAS,eAAe,OAAyC,cAAc;CAC7E,MAAM,EAAE,mBAAmB,OAAO,UAAU,GAAG,cAAc;CAE7D,OACE,oBAAC,wBAAD;EACqB;EACZ;EACG;EAEV,6BAA6B,EAAE,oBAC7B,qBAAAC,UAAA,EAAA,UAAA,CACE,oBAAC,uBAAD;GACE,GAAI;GACJ,KAAK;GAEc;EACpB,CAAA,GACA,iBACC,oBAAC,2BAAD,EAEqB,kBACpB,CAAA,CAEH,EAAA,CAAA;CAEL,CAAA;AAEL,CACF;AAWA,IAAM,4BAA4C,sBAAM,WAGtD,SAAS,0BACT,OACA,cACA;CACA,MAAM,EAAE,mBAAmB,GAAG,gBAAgB;CAC9C,MAAM,aAAa,cAAc,iBAAiB;CAClD,OAAO,oBAAC,kBAAD;EAAkB,GAAI;EAAY,GAAI;EAAa,KAAK;CAAe,CAAA;AAChF,CAAC;AAUD,IAAM,sBAAsC,sBAAM,WAKhD,SAAS,oBAAoB,OAA8C,cAAc;CACvF,MAAM,EAAE,mBAAmB,GAAG,mBAAmB;CACjD,MAAM,aAAa,cAAc,iBAAiB;CAClD,OAAO,oBAAC,gBAAD;EAAgB,GAAI;EAAY,GAAI;EAAgB,KAAK;CAAe,CAAA;AACjF,CACF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Primitive } from '../react-primitive';
|
|
3
|
+
import type { Scope } from '../react-context';
|
|
4
|
+
type ScopedProps<P> = P & {
|
|
5
|
+
__scopeRadio?: Scope;
|
|
6
|
+
};
|
|
7
|
+
declare const createRadioScope: import("../react-context").CreateScope;
|
|
8
|
+
type RadioContextValue = {
|
|
9
|
+
checked: boolean;
|
|
10
|
+
disabled: boolean | undefined;
|
|
11
|
+
required: boolean | undefined;
|
|
12
|
+
name: string | undefined;
|
|
13
|
+
form: string | undefined;
|
|
14
|
+
value: string | number | readonly string[];
|
|
15
|
+
control: HTMLButtonElement | null;
|
|
16
|
+
setControl: React.Dispatch<React.SetStateAction<HTMLButtonElement | null>>;
|
|
17
|
+
hasConsumerStoppedPropagationRef: React.RefObject<boolean>;
|
|
18
|
+
userInteractionCount: number;
|
|
19
|
+
onUserInteraction: () => void;
|
|
20
|
+
isFormControl: boolean;
|
|
21
|
+
bubbleInput: HTMLInputElement | null;
|
|
22
|
+
setBubbleInput: React.Dispatch<React.SetStateAction<HTMLInputElement | null>>;
|
|
23
|
+
onCheck(): void;
|
|
24
|
+
};
|
|
25
|
+
declare const useRadioContext: import("../react-context/create-context").UseScopedContext<RadioContextValue>;
|
|
26
|
+
interface RadioProviderProps {
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
name?: string;
|
|
31
|
+
form?: string;
|
|
32
|
+
value?: string | number | readonly string[];
|
|
33
|
+
onCheck?(): void;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
declare function RadioProvider(props: ScopedProps<RadioProviderProps>): React.JSX.Element;
|
|
37
|
+
interface RadioTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof Primitive.button>, keyof RadioProviderProps> {
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
}
|
|
40
|
+
declare const RadioTrigger: React.ForwardRefExoticComponent<RadioTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
42
|
+
interface RadioProps extends Omit<PrimitiveButtonProps, 'checked'> {
|
|
43
|
+
checked?: boolean;
|
|
44
|
+
required?: boolean;
|
|
45
|
+
onCheck?(): void;
|
|
46
|
+
}
|
|
47
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
49
|
+
export interface RadioIndicatorProps extends PrimitiveSpanProps {
|
|
50
|
+
/**
|
|
51
|
+
* Used to force mounting when more control is needed. Useful when
|
|
52
|
+
* controlling animation with React animation libraries.
|
|
53
|
+
*/
|
|
54
|
+
forceMount?: true;
|
|
55
|
+
}
|
|
56
|
+
declare const RadioIndicator: React.ForwardRefExoticComponent<RadioIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
57
|
+
type InputProps = React.ComponentPropsWithoutRef<typeof Primitive.input>;
|
|
58
|
+
interface RadioBubbleInputProps extends Omit<InputProps, 'checked'> {
|
|
59
|
+
}
|
|
60
|
+
declare const RadioBubbleInput: React.ForwardRefExoticComponent<RadioBubbleInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
61
|
+
export { createRadioScope, useRadioContext, Radio, RadioProvider, RadioTrigger, RadioIndicator, RadioBubbleInput, };
|
|
62
|
+
export type { RadioProps, RadioProviderProps, RadioTriggerProps, RadioBubbleInputProps };
|