react-aria-components 1.17.0 → 1.18.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/dist/exports/Autocomplete.cjs.map +1 -1
- package/dist/exports/Autocomplete.js.map +1 -1
- package/dist/exports/Autocomplete.mjs.map +1 -1
- package/dist/exports/Calendar.cjs +3 -0
- package/dist/exports/Calendar.cjs.map +1 -1
- package/dist/exports/Calendar.js +2 -2
- package/dist/exports/Calendar.js.map +1 -1
- package/dist/exports/Calendar.mjs +2 -2
- package/dist/exports/Calendar.mjs.map +1 -1
- package/dist/exports/Checkbox.cjs +8 -0
- package/dist/exports/Checkbox.cjs.map +1 -1
- package/dist/exports/Checkbox.js +6 -2
- package/dist/exports/Checkbox.js.map +1 -1
- package/dist/exports/Checkbox.mjs +6 -2
- package/dist/exports/Checkbox.mjs.map +1 -1
- package/dist/exports/CheckboxGroup.cjs.map +1 -1
- package/dist/exports/CheckboxGroup.js.map +1 -1
- package/dist/exports/CheckboxGroup.mjs.map +1 -1
- package/dist/exports/CollectionBuilder.cjs.map +1 -1
- package/dist/exports/CollectionBuilder.js.map +1 -1
- package/dist/exports/CollectionBuilder.mjs.map +1 -1
- package/dist/exports/ColorArea.cjs.map +1 -1
- package/dist/exports/ColorArea.js.map +1 -1
- package/dist/exports/ColorArea.mjs.map +1 -1
- package/dist/exports/ColorField.cjs.map +1 -1
- package/dist/exports/ColorField.js.map +1 -1
- package/dist/exports/ColorField.mjs.map +1 -1
- package/dist/exports/ColorPicker.cjs.map +1 -1
- package/dist/exports/ColorPicker.js.map +1 -1
- package/dist/exports/ColorPicker.mjs.map +1 -1
- package/dist/exports/ColorSlider.cjs.map +1 -1
- package/dist/exports/ColorSlider.js.map +1 -1
- package/dist/exports/ColorSlider.mjs.map +1 -1
- package/dist/exports/ColorSwatch.cjs.map +1 -1
- package/dist/exports/ColorSwatch.js.map +1 -1
- package/dist/exports/ColorSwatch.mjs.map +1 -1
- package/dist/exports/ColorSwatchPicker.cjs.map +1 -1
- package/dist/exports/ColorSwatchPicker.js.map +1 -1
- package/dist/exports/ColorSwatchPicker.mjs.map +1 -1
- package/dist/exports/ColorThumb.cjs.map +1 -1
- package/dist/exports/ColorThumb.js.map +1 -1
- package/dist/exports/ColorThumb.mjs.map +1 -1
- package/dist/exports/ColorWheel.cjs.map +1 -1
- package/dist/exports/ColorWheel.js.map +1 -1
- package/dist/exports/ColorWheel.mjs.map +1 -1
- package/dist/exports/ComboBox.cjs.map +1 -1
- package/dist/exports/ComboBox.js.map +1 -1
- package/dist/exports/ComboBox.mjs.map +1 -1
- package/dist/exports/DateField.cjs.map +1 -1
- package/dist/exports/DateField.js.map +1 -1
- package/dist/exports/DateField.mjs.map +1 -1
- package/dist/exports/DatePicker.cjs.map +1 -1
- package/dist/exports/DatePicker.js.map +1 -1
- package/dist/exports/DatePicker.mjs.map +1 -1
- package/dist/exports/DateRangePicker.cjs.map +1 -1
- package/dist/exports/DateRangePicker.js.map +1 -1
- package/dist/exports/DateRangePicker.mjs.map +1 -1
- package/dist/exports/Disclosure.cjs.map +1 -1
- package/dist/exports/Disclosure.js.map +1 -1
- package/dist/exports/Disclosure.mjs.map +1 -1
- package/dist/exports/DisclosureGroup.cjs.map +1 -1
- package/dist/exports/DisclosureGroup.js.map +1 -1
- package/dist/exports/DisclosureGroup.mjs.map +1 -1
- package/dist/exports/GridList.cjs.map +1 -1
- package/dist/exports/GridList.js.map +1 -1
- package/dist/exports/GridList.mjs.map +1 -1
- package/dist/exports/ListBox.cjs.map +1 -1
- package/dist/exports/ListBox.js.map +1 -1
- package/dist/exports/ListBox.mjs.map +1 -1
- package/dist/exports/Menu.cjs.map +1 -1
- package/dist/exports/Menu.js.map +1 -1
- package/dist/exports/Menu.mjs.map +1 -1
- package/dist/exports/RadioGroup.cjs +3 -0
- package/dist/exports/RadioGroup.cjs.map +1 -1
- package/dist/exports/RadioGroup.js +2 -2
- package/dist/exports/RadioGroup.js.map +1 -1
- package/dist/exports/RadioGroup.mjs +2 -2
- package/dist/exports/RadioGroup.mjs.map +1 -1
- package/dist/exports/RangeCalendar.cjs +3 -0
- package/dist/exports/RangeCalendar.cjs.map +1 -1
- package/dist/exports/RangeCalendar.js +2 -2
- package/dist/exports/RangeCalendar.js.map +1 -1
- package/dist/exports/RangeCalendar.mjs +2 -2
- package/dist/exports/RangeCalendar.mjs.map +1 -1
- package/dist/exports/Select.cjs.map +1 -1
- package/dist/exports/Select.js.map +1 -1
- package/dist/exports/Select.mjs.map +1 -1
- package/dist/exports/SharedElementTransition.cjs.map +1 -1
- package/dist/exports/SharedElementTransition.js.map +1 -1
- package/dist/exports/SharedElementTransition.mjs.map +1 -1
- package/dist/exports/Slider.cjs +2 -0
- package/dist/exports/Slider.cjs.map +1 -1
- package/dist/exports/Slider.js +2 -2
- package/dist/exports/Slider.js.map +1 -1
- package/dist/exports/Slider.mjs +2 -2
- package/dist/exports/Slider.mjs.map +1 -1
- package/dist/exports/Switch.cjs +8 -0
- package/dist/exports/Switch.cjs.map +1 -1
- package/dist/exports/Switch.js +6 -2
- package/dist/exports/Switch.js.map +1 -1
- package/dist/exports/Switch.mjs +6 -2
- package/dist/exports/Switch.mjs.map +1 -1
- package/dist/exports/Table.cjs +1 -0
- package/dist/exports/Table.cjs.map +1 -1
- package/dist/exports/Table.js +2 -2
- package/dist/exports/Table.js.map +1 -1
- package/dist/exports/Table.mjs +2 -2
- package/dist/exports/Table.mjs.map +1 -1
- package/dist/exports/Tabs.cjs.map +1 -1
- package/dist/exports/Tabs.js.map +1 -1
- package/dist/exports/Tabs.mjs.map +1 -1
- package/dist/exports/TagGroup.cjs.map +1 -1
- package/dist/exports/TagGroup.js.map +1 -1
- package/dist/exports/TagGroup.mjs.map +1 -1
- package/dist/exports/TimeField.cjs.map +1 -1
- package/dist/exports/TimeField.js.map +1 -1
- package/dist/exports/TimeField.mjs.map +1 -1
- package/dist/exports/Toast.cjs.map +1 -1
- package/dist/exports/Toast.js.map +1 -1
- package/dist/exports/Toast.mjs.map +1 -1
- package/dist/exports/ToggleButtonGroup.cjs.map +1 -1
- package/dist/exports/ToggleButtonGroup.js.map +1 -1
- package/dist/exports/ToggleButtonGroup.mjs.map +1 -1
- package/dist/exports/Tree.cjs.map +1 -1
- package/dist/exports/Tree.js.map +1 -1
- package/dist/exports/Tree.mjs.map +1 -1
- package/dist/exports/Virtualizer.cjs.map +1 -1
- package/dist/exports/Virtualizer.js.map +1 -1
- package/dist/exports/Virtualizer.mjs.map +1 -1
- package/dist/exports/index.cjs +19 -1
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.js +11 -8
- package/dist/exports/index.js.map +1 -1
- package/dist/exports/index.mjs +11 -8
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/useAsyncList.cjs.map +1 -1
- package/dist/exports/useAsyncList.js.map +1 -1
- package/dist/exports/useAsyncList.mjs.map +1 -1
- package/dist/exports/useDragAndDrop.cjs.map +1 -1
- package/dist/exports/useDragAndDrop.js.map +1 -1
- package/dist/exports/useDragAndDrop.mjs.map +1 -1
- package/dist/exports/useDrop.cjs.map +1 -1
- package/dist/exports/useDrop.js.map +1 -1
- package/dist/exports/useDrop.mjs.map +1 -1
- package/dist/private/Autocomplete.cjs.map +1 -1
- package/dist/private/Autocomplete.js.map +1 -1
- package/dist/private/Autocomplete.mjs.map +1 -1
- package/dist/private/Breadcrumbs.cjs.map +1 -1
- package/dist/private/Breadcrumbs.js.map +1 -1
- package/dist/private/Breadcrumbs.mjs.map +1 -1
- package/dist/private/Button.cjs.map +1 -1
- package/dist/private/Button.js.map +1 -1
- package/dist/private/Button.mjs.map +1 -1
- package/dist/private/Calendar.cjs +34 -2
- package/dist/private/Calendar.cjs.map +1 -1
- package/dist/private/Calendar.js +34 -5
- package/dist/private/Calendar.js.map +1 -1
- package/dist/private/Calendar.mjs +34 -5
- package/dist/private/Calendar.mjs.map +1 -1
- package/dist/private/Checkbox.cjs +104 -17
- package/dist/private/Checkbox.cjs.map +1 -1
- package/dist/private/Checkbox.js +102 -18
- package/dist/private/Checkbox.js.map +1 -1
- package/dist/private/Checkbox.mjs +102 -18
- package/dist/private/Checkbox.mjs.map +1 -1
- package/dist/private/Collection.cjs.map +1 -1
- package/dist/private/Collection.js.map +1 -1
- package/dist/private/Collection.mjs.map +1 -1
- package/dist/private/ColorArea.cjs.map +1 -1
- package/dist/private/ColorArea.js.map +1 -1
- package/dist/private/ColorArea.mjs.map +1 -1
- package/dist/private/ColorField.cjs.map +1 -1
- package/dist/private/ColorField.js.map +1 -1
- package/dist/private/ColorField.mjs.map +1 -1
- package/dist/private/ColorPicker.cjs.map +1 -1
- package/dist/private/ColorPicker.js.map +1 -1
- package/dist/private/ColorPicker.mjs.map +1 -1
- package/dist/private/ColorSlider.cjs.map +1 -1
- package/dist/private/ColorSlider.js.map +1 -1
- package/dist/private/ColorSlider.mjs.map +1 -1
- package/dist/private/ColorSwatch.cjs.map +1 -1
- package/dist/private/ColorSwatch.js.map +1 -1
- package/dist/private/ColorSwatch.mjs.map +1 -1
- package/dist/private/ColorSwatchPicker.cjs.map +1 -1
- package/dist/private/ColorSwatchPicker.js.map +1 -1
- package/dist/private/ColorSwatchPicker.mjs.map +1 -1
- package/dist/private/ColorThumb.cjs.map +1 -1
- package/dist/private/ColorThumb.js.map +1 -1
- package/dist/private/ColorThumb.mjs.map +1 -1
- package/dist/private/ColorWheel.cjs.map +1 -1
- package/dist/private/ColorWheel.js.map +1 -1
- package/dist/private/ColorWheel.mjs.map +1 -1
- package/dist/private/ComboBox.cjs +15 -3
- package/dist/private/ComboBox.cjs.map +1 -1
- package/dist/private/ComboBox.js +16 -4
- package/dist/private/ComboBox.js.map +1 -1
- package/dist/private/ComboBox.mjs +16 -4
- package/dist/private/ComboBox.mjs.map +1 -1
- package/dist/private/DateField.cjs.map +1 -1
- package/dist/private/DateField.js.map +1 -1
- package/dist/private/DateField.mjs.map +1 -1
- package/dist/private/DatePicker.cjs +0 -26
- package/dist/private/DatePicker.cjs.map +1 -1
- package/dist/private/DatePicker.js +1 -27
- package/dist/private/DatePicker.js.map +1 -1
- package/dist/private/DatePicker.mjs +1 -27
- package/dist/private/DatePicker.mjs.map +1 -1
- package/dist/private/Dialog.cjs +1 -17
- package/dist/private/Dialog.cjs.map +1 -1
- package/dist/private/Dialog.js +2 -18
- package/dist/private/Dialog.js.map +1 -1
- package/dist/private/Dialog.mjs +2 -18
- package/dist/private/Dialog.mjs.map +1 -1
- package/dist/private/Disclosure.cjs.map +1 -1
- package/dist/private/Disclosure.js.map +1 -1
- package/dist/private/Disclosure.mjs.map +1 -1
- package/dist/private/DragAndDrop.cjs +3 -3
- package/dist/private/DragAndDrop.cjs.map +1 -1
- package/dist/private/DragAndDrop.js +3 -3
- package/dist/private/DragAndDrop.js.map +1 -1
- package/dist/private/DragAndDrop.mjs +3 -3
- package/dist/private/DragAndDrop.mjs.map +1 -1
- package/dist/private/DropZone.cjs.map +1 -1
- package/dist/private/DropZone.js.map +1 -1
- package/dist/private/DropZone.mjs.map +1 -1
- package/dist/private/FieldError.cjs.map +1 -1
- package/dist/private/FieldError.js.map +1 -1
- package/dist/private/FieldError.mjs.map +1 -1
- package/dist/private/FileTrigger.cjs.map +1 -1
- package/dist/private/FileTrigger.js.map +1 -1
- package/dist/private/FileTrigger.mjs.map +1 -1
- package/dist/private/Form.cjs.map +1 -1
- package/dist/private/Form.js.map +1 -1
- package/dist/private/Form.mjs.map +1 -1
- package/dist/private/GridLayout.cjs +37 -0
- package/dist/private/GridLayout.cjs.map +1 -0
- package/dist/private/GridLayout.js +32 -0
- package/dist/private/GridLayout.js.map +1 -0
- package/dist/private/GridLayout.mjs +32 -0
- package/dist/private/GridLayout.mjs.map +1 -0
- package/dist/private/GridList.cjs +19 -2
- package/dist/private/GridList.cjs.map +1 -1
- package/dist/private/GridList.js +20 -3
- package/dist/private/GridList.js.map +1 -1
- package/dist/private/GridList.mjs +20 -3
- package/dist/private/GridList.mjs.map +1 -1
- package/dist/private/Group.cjs.map +1 -1
- package/dist/private/Group.js.map +1 -1
- package/dist/private/Group.mjs.map +1 -1
- package/dist/private/Header.cjs.map +1 -1
- package/dist/private/Header.js.map +1 -1
- package/dist/private/Header.mjs.map +1 -1
- package/dist/private/Heading.cjs.map +1 -1
- package/dist/private/Heading.js.map +1 -1
- package/dist/private/Heading.mjs.map +1 -1
- package/dist/private/HiddenDateInput.cjs +3 -3
- package/dist/private/HiddenDateInput.cjs.map +1 -1
- package/dist/private/HiddenDateInput.js +3 -3
- package/dist/private/HiddenDateInput.js.map +1 -1
- package/dist/private/HiddenDateInput.mjs +3 -3
- package/dist/private/HiddenDateInput.mjs.map +1 -1
- package/dist/private/Input.cjs.map +1 -1
- package/dist/private/Input.js.map +1 -1
- package/dist/private/Input.mjs.map +1 -1
- package/dist/private/Keyboard.cjs.map +1 -1
- package/dist/private/Keyboard.js.map +1 -1
- package/dist/private/Keyboard.mjs.map +1 -1
- package/dist/private/Label.cjs.map +1 -1
- package/dist/private/Label.js.map +1 -1
- package/dist/private/Label.mjs.map +1 -1
- package/dist/private/Link.cjs.map +1 -1
- package/dist/private/Link.js.map +1 -1
- package/dist/private/Link.mjs.map +1 -1
- package/dist/private/ListBox.cjs +6 -5
- package/dist/private/ListBox.cjs.map +1 -1
- package/dist/private/ListBox.js +6 -5
- package/dist/private/ListBox.js.map +1 -1
- package/dist/private/ListBox.mjs +6 -5
- package/dist/private/ListBox.mjs.map +1 -1
- package/dist/private/Menu.cjs +5 -15
- package/dist/private/Menu.cjs.map +1 -1
- package/dist/private/Menu.js +6 -16
- package/dist/private/Menu.js.map +1 -1
- package/dist/private/Menu.mjs +6 -16
- package/dist/private/Menu.mjs.map +1 -1
- package/dist/private/Meter.cjs.map +1 -1
- package/dist/private/Meter.js.map +1 -1
- package/dist/private/Meter.mjs.map +1 -1
- package/dist/private/Modal.cjs.map +1 -1
- package/dist/private/Modal.js.map +1 -1
- package/dist/private/Modal.mjs.map +1 -1
- package/dist/private/NumberField.cjs.map +1 -1
- package/dist/private/NumberField.js.map +1 -1
- package/dist/private/NumberField.mjs.map +1 -1
- package/dist/private/OverlayArrow.cjs.map +1 -1
- package/dist/private/OverlayArrow.js.map +1 -1
- package/dist/private/OverlayArrow.mjs.map +1 -1
- package/dist/private/Popover.cjs +17 -1
- package/dist/private/Popover.cjs.map +1 -1
- package/dist/private/Popover.js +19 -2
- package/dist/private/Popover.js.map +1 -1
- package/dist/private/Popover.mjs +18 -2
- package/dist/private/Popover.mjs.map +1 -1
- package/dist/private/ProgressBar.cjs.map +1 -1
- package/dist/private/ProgressBar.js.map +1 -1
- package/dist/private/ProgressBar.mjs.map +1 -1
- package/dist/private/RadioGroup.cjs +87 -7
- package/dist/private/RadioGroup.cjs.map +1 -1
- package/dist/private/RadioGroup.js +86 -9
- package/dist/private/RadioGroup.js.map +1 -1
- package/dist/private/RadioGroup.mjs +86 -9
- package/dist/private/RadioGroup.mjs.map +1 -1
- package/dist/private/SearchField.cjs.map +1 -1
- package/dist/private/SearchField.js.map +1 -1
- package/dist/private/SearchField.mjs.map +1 -1
- package/dist/private/Select.cjs +1 -17
- package/dist/private/Select.cjs.map +1 -1
- package/dist/private/Select.js +2 -18
- package/dist/private/Select.js.map +1 -1
- package/dist/private/Select.mjs +2 -18
- package/dist/private/Select.mjs.map +1 -1
- package/dist/private/SelectionIndicator.cjs.map +1 -1
- package/dist/private/SelectionIndicator.js.map +1 -1
- package/dist/private/SelectionIndicator.mjs.map +1 -1
- package/dist/private/Separator.cjs.map +1 -1
- package/dist/private/Separator.js.map +1 -1
- package/dist/private/Separator.mjs.map +1 -1
- package/dist/private/SharedElementTransition.cjs.map +1 -1
- package/dist/private/SharedElementTransition.js.map +1 -1
- package/dist/private/SharedElementTransition.mjs.map +1 -1
- package/dist/private/Slider.cjs +51 -1
- package/dist/private/Slider.cjs.map +1 -1
- package/dist/private/Slider.js +50 -2
- package/dist/private/Slider.js.map +1 -1
- package/dist/private/Slider.mjs +50 -2
- package/dist/private/Slider.mjs.map +1 -1
- package/dist/private/Switch.cjs +118 -4
- package/dist/private/Switch.cjs.map +1 -1
- package/dist/private/Switch.js +119 -7
- package/dist/private/Switch.js.map +1 -1
- package/dist/private/Switch.mjs +118 -7
- package/dist/private/Switch.mjs.map +1 -1
- package/dist/private/Table.cjs +115 -24
- package/dist/private/Table.cjs.map +1 -1
- package/dist/private/Table.js +116 -26
- package/dist/private/Table.js.map +1 -1
- package/dist/private/Table.mjs +116 -26
- package/dist/private/Table.mjs.map +1 -1
- package/dist/private/TableLayout.cjs.map +1 -1
- package/dist/private/TableLayout.js.map +1 -1
- package/dist/private/TableLayout.mjs.map +1 -1
- package/dist/private/Tabs.cjs +4 -3
- package/dist/private/Tabs.cjs.map +1 -1
- package/dist/private/Tabs.js +4 -3
- package/dist/private/Tabs.js.map +1 -1
- package/dist/private/Tabs.mjs +4 -3
- package/dist/private/Tabs.mjs.map +1 -1
- package/dist/private/TagGroup.cjs.map +1 -1
- package/dist/private/TagGroup.js.map +1 -1
- package/dist/private/TagGroup.mjs.map +1 -1
- package/dist/private/Text.cjs.map +1 -1
- package/dist/private/Text.js.map +1 -1
- package/dist/private/Text.mjs.map +1 -1
- package/dist/private/TextArea.cjs.map +1 -1
- package/dist/private/TextArea.js.map +1 -1
- package/dist/private/TextArea.mjs.map +1 -1
- package/dist/private/TextField.cjs.map +1 -1
- package/dist/private/TextField.js.map +1 -1
- package/dist/private/TextField.mjs.map +1 -1
- package/dist/private/Toast.cjs +2 -1
- package/dist/private/Toast.cjs.map +1 -1
- package/dist/private/Toast.js +2 -1
- package/dist/private/Toast.js.map +1 -1
- package/dist/private/Toast.mjs +2 -1
- package/dist/private/Toast.mjs.map +1 -1
- package/dist/private/ToggleButton.cjs.map +1 -1
- package/dist/private/ToggleButton.js.map +1 -1
- package/dist/private/ToggleButton.mjs.map +1 -1
- package/dist/private/ToggleButtonGroup.cjs.map +1 -1
- package/dist/private/ToggleButtonGroup.js.map +1 -1
- package/dist/private/ToggleButtonGroup.mjs.map +1 -1
- package/dist/private/Toolbar.cjs.map +1 -1
- package/dist/private/Toolbar.js.map +1 -1
- package/dist/private/Toolbar.mjs.map +1 -1
- package/dist/private/Tooltip.cjs.map +1 -1
- package/dist/private/Tooltip.js.map +1 -1
- package/dist/private/Tooltip.mjs.map +1 -1
- package/dist/private/Tree.cjs +18 -6
- package/dist/private/Tree.cjs.map +1 -1
- package/dist/private/Tree.js +19 -7
- package/dist/private/Tree.js.map +1 -1
- package/dist/private/Tree.mjs +19 -7
- package/dist/private/Tree.mjs.map +1 -1
- package/dist/private/TreeDropTargetDelegate.cjs +9 -4
- package/dist/private/TreeDropTargetDelegate.cjs.map +1 -1
- package/dist/private/TreeDropTargetDelegate.js +10 -4
- package/dist/private/TreeDropTargetDelegate.js.map +1 -1
- package/dist/private/TreeDropTargetDelegate.mjs +9 -4
- package/dist/private/TreeDropTargetDelegate.mjs.map +1 -1
- package/dist/private/Virtualizer.cjs.map +1 -1
- package/dist/private/Virtualizer.js.map +1 -1
- package/dist/private/Virtualizer.mjs.map +1 -1
- package/dist/private/useDragAndDrop.cjs.map +1 -1
- package/dist/private/useDragAndDrop.js.map +1 -1
- package/dist/private/useDragAndDrop.mjs.map +1 -1
- package/dist/private/utils.cjs.map +1 -1
- package/dist/private/utils.js.map +1 -1
- package/dist/private/utils.mjs.map +1 -1
- package/dist/types/exports/Calendar.d.ts +4 -3
- package/dist/types/exports/Checkbox.d.ts +7 -2
- package/dist/types/exports/RadioGroup.d.ts +2 -2
- package/dist/types/exports/RangeCalendar.d.ts +3 -2
- package/dist/types/exports/Slider.d.ts +2 -2
- package/dist/types/exports/Switch.d.ts +7 -2
- package/dist/types/exports/Table.d.ts +2 -2
- package/dist/types/exports/index.d.ts +15 -13
- package/dist/types/exports/useDragAndDrop.d.ts +1 -1
- package/dist/types/src/Autocomplete.d.ts +1 -1
- package/dist/types/src/Breadcrumbs.d.ts +13 -4
- package/dist/types/src/Button.d.ts +9 -1
- package/dist/types/src/Calendar.d.ts +93 -33
- package/dist/types/src/Checkbox.d.ts +93 -2
- package/dist/types/src/Collection.d.ts +17 -4
- package/dist/types/src/ColorArea.d.ts +6 -2
- package/dist/types/src/ColorField.d.ts +8 -1
- package/dist/types/src/ColorPicker.d.ts +4 -1
- package/dist/types/src/ColorSlider.d.ts +5 -1
- package/dist/types/src/ColorSwatch.d.ts +3 -1
- package/dist/types/src/ColorSwatchPicker.d.ts +7 -2
- package/dist/types/src/ColorThumb.d.ts +10 -2
- package/dist/types/src/ColorWheel.d.ts +7 -2
- package/dist/types/src/ComboBox.d.ts +24 -11
- package/dist/types/src/DateField.d.ts +29 -4
- package/dist/types/src/DatePicker.d.ts +15 -3
- package/dist/types/src/Dialog.d.ts +3 -1
- package/dist/types/src/Disclosure.d.ts +21 -5
- package/dist/types/src/DragAndDrop.d.ts +6 -2
- package/dist/types/src/DropZone.d.ts +8 -1
- package/dist/types/src/FieldError.d.ts +4 -1
- package/dist/types/src/FileTrigger.d.ts +2 -1
- package/dist/types/src/Form.d.ts +4 -1
- package/dist/types/src/GridLayout.d.ts +5 -0
- package/dist/types/src/GridList.d.ts +44 -13
- package/dist/types/src/Group.d.ts +9 -1
- package/dist/types/src/Heading.d.ts +12 -0
- package/dist/types/src/HiddenDateInput.d.ts +2 -1
- package/dist/types/src/Input.d.ts +8 -1
- package/dist/types/src/Link.d.ts +9 -1
- package/dist/types/src/ListBox.d.ts +35 -12
- package/dist/types/src/Menu.d.ts +22 -10
- package/dist/types/src/Meter.d.ts +4 -1
- package/dist/types/src/Modal.d.ts +9 -3
- package/dist/types/src/NumberField.d.ts +9 -2
- package/dist/types/src/OverlayArrow.d.ts +4 -1
- package/dist/types/src/Popover.d.ts +12 -3
- package/dist/types/src/ProgressBar.d.ts +5 -1
- package/dist/types/src/RadioGroup.d.ts +88 -2
- package/dist/types/src/SearchField.d.ts +8 -1
- package/dist/types/src/Select.d.ts +19 -6
- package/dist/types/src/SelectionIndicator.d.ts +7 -2
- package/dist/types/src/Separator.d.ts +5 -2
- package/dist/types/src/SharedElementTransition.d.ts +2 -0
- package/dist/types/src/Slider.d.ts +48 -4
- package/dist/types/src/Switch.d.ts +100 -3
- package/dist/types/src/Table.d.ts +138 -31
- package/dist/types/src/Tabs.d.ts +37 -12
- package/dist/types/src/TagGroup.d.ts +18 -7
- package/dist/types/src/TextArea.d.ts +3 -1
- package/dist/types/src/TextField.d.ts +7 -1
- package/dist/types/src/Toast.d.ts +13 -3
- package/dist/types/src/ToggleButton.d.ts +10 -3
- package/dist/types/src/ToggleButtonGroup.d.ts +7 -2
- package/dist/types/src/Toolbar.d.ts +6 -3
- package/dist/types/src/Tooltip.d.ts +13 -4
- package/dist/types/src/Tree.d.ts +52 -16
- package/dist/types/src/useDragAndDrop.d.ts +10 -4
- package/dist/types/src/utils.d.ts +109 -17
- package/package.json +9 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuDM,MAAM,0DACX,CAAA,GAAA,oBAAY,EAAkD;AAMzD,MAAM,0DAAc,CAAA,GAAA,iBAAS,EAAE,SAAS,YAC7C,KAAuB,EACvB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SAAC,QAAQ,aAAG,WAAW,aAAG,WAAW,sBAAK,kBAAkB,OAAM,GAAG;IACzE,QAAQ,CAAA,GAAA,YAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAAE,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IACjF,IAAI,oBAAC,gBAAgB,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAEpE,0DAA0D;IAC1D,IAAI,aAAa,kBAAkB,YAAY,AAAE,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAM;IAE9F,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,gBAAgB,CAAC,iBAAiB;6BAC7C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,iBAAiB;QACvD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;qBACpB,gCAAC,CAAA,GAAA,yCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaProgressBarProps, useProgressBar} from 'react-aria/useProgressBar';\n\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps\n extends\n Omit<AriaProgressBarProps, 'label'>,\n RenderProps<ProgressBarRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-ProgressBar'\n */\n className?: ClassNameOrFunction<ProgressBarRenderProps>;\n}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage: number | undefined;\n /**\n * A formatted version of the value.\n *\n * @selector [aria-valuetext]\n */\n valueText: string | undefined;\n /**\n * Whether the progress bar is indeterminate.\n *\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean;\n}\n\nexport const ProgressBarContext =\n createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(\n props: ProgressBarProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {value = 0, minValue = 0, maxValue = 100, isIndeterminate = false} = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {progressBarProps, labelProps} = useProgressBar({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = isIndeterminate ? undefined : ((value - minValue) / (maxValue - minValue)) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, progressBarProps)}\n ref={ref}\n slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.mjs.map"}
|
|
@@ -27,9 +27,12 @@ function $parcel$export(e, n, v, s) {
|
|
|
27
27
|
|
|
28
28
|
$parcel$export(module.exports, "RadioGroupContext", function () { return $ecfe484c0a342e33$export$a79eda4ff50e30b6; });
|
|
29
29
|
$parcel$export(module.exports, "RadioContext", function () { return $ecfe484c0a342e33$export$b118023277d4a5c3; });
|
|
30
|
+
$parcel$export(module.exports, "RadioFieldContext", function () { return $ecfe484c0a342e33$export$29c6814b341e632b; });
|
|
30
31
|
$parcel$export(module.exports, "RadioGroupStateContext", function () { return $ecfe484c0a342e33$export$29d84393af70866c; });
|
|
31
32
|
$parcel$export(module.exports, "RadioGroup", function () { return $ecfe484c0a342e33$export$a98f0dcb43a68a25; });
|
|
32
33
|
$parcel$export(module.exports, "Radio", function () { return $ecfe484c0a342e33$export$d7b12c4107be0d61; });
|
|
34
|
+
$parcel$export(module.exports, "RadioButton", function () { return $ecfe484c0a342e33$export$f4422ae58352e179; });
|
|
35
|
+
$parcel$export(module.exports, "RadioField", function () { return $ecfe484c0a342e33$export$4aaf0c609b3e241e; });
|
|
33
36
|
/*
|
|
34
37
|
* Copyright 2022 Adobe. All rights reserved.
|
|
35
38
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -59,6 +62,7 @@ $parcel$export(module.exports, "Radio", function () { return $ecfe484c0a342e33$e
|
|
|
59
62
|
|
|
60
63
|
const $ecfe484c0a342e33$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $kyCvN$react.createContext)(null);
|
|
61
64
|
const $ecfe484c0a342e33$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $kyCvN$react.createContext)(null);
|
|
65
|
+
const $ecfe484c0a342e33$export$29c6814b341e632b = /*#__PURE__*/ (0, $kyCvN$react.createContext)(null);
|
|
62
66
|
const $ecfe484c0a342e33$export$29d84393af70866c = /*#__PURE__*/ (0, $kyCvN$react.createContext)(null);
|
|
63
67
|
const $ecfe484c0a342e33$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $kyCvN$react.forwardRef)(function RadioGroup(props, ref) {
|
|
64
68
|
[props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $ecfe484c0a342e33$export$a79eda4ff50e30b6);
|
|
@@ -136,11 +140,91 @@ const $ecfe484c0a342e33$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $kyCvN$react
|
|
|
136
140
|
userProvidedInputRef,
|
|
137
141
|
props.inputRef
|
|
138
142
|
]));
|
|
139
|
-
let
|
|
143
|
+
let aria = (0, $kyCvN$reactariauseRadioGroup.useRadio)({
|
|
140
144
|
...(0, $048d76b84370f141$exports.removeDataAttributes)(props),
|
|
141
145
|
// ReactNode type doesn't allow function children.
|
|
142
146
|
children: typeof props.children === 'function' ? true : props.children
|
|
143
147
|
}, state, inputRef);
|
|
148
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kyCvN$react))).createElement($ecfe484c0a342e33$var$InternalRadioContext.Provider, {
|
|
149
|
+
value: {
|
|
150
|
+
...aria,
|
|
151
|
+
inputRef: inputRef,
|
|
152
|
+
defaultClassName: 'react-aria-Radio'
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kyCvN$react))).createElement($ecfe484c0a342e33$export$f4422ae58352e179, {
|
|
155
|
+
...props,
|
|
156
|
+
ref: ref
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
const $ecfe484c0a342e33$var$InternalRadioContext = /*#__PURE__*/ (0, $kyCvN$react.createContext)(null);
|
|
160
|
+
const $ecfe484c0a342e33$export$4aaf0c609b3e241e = /*#__PURE__*/ (0, $kyCvN$react.forwardRef)(function RadioField(props, ref) {
|
|
161
|
+
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
162
|
+
[props, ref] = (0, $048d76b84370f141$exports.useContextProps)(otherProps, ref, $ecfe484c0a342e33$export$29c6814b341e632b);
|
|
163
|
+
let state = (0, ($parcel$interopDefault($kyCvN$react))).useContext($ecfe484c0a342e33$export$29d84393af70866c);
|
|
164
|
+
let inputRef = (0, $kyCvN$reactariauseObjectRef.useObjectRef)((0, $kyCvN$react.useMemo)(()=>(0, $kyCvN$reactariamergeRefs.mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [
|
|
165
|
+
userProvidedInputRef,
|
|
166
|
+
props.inputRef
|
|
167
|
+
]));
|
|
168
|
+
let aria = (0, $kyCvN$reactariauseRadioGroup.useRadio)({
|
|
169
|
+
...(0, $048d76b84370f141$exports.removeDataAttributes)(props),
|
|
170
|
+
// ReactNode type doesn't allow function children.
|
|
171
|
+
children: typeof props.children === 'function' ? true : props.children
|
|
172
|
+
}, state, inputRef);
|
|
173
|
+
let { descriptionProps: descriptionProps, isSelected: isSelected, isDisabled: isDisabled } = aria;
|
|
174
|
+
let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
|
|
175
|
+
...props,
|
|
176
|
+
defaultClassName: 'react-aria-RadioField',
|
|
177
|
+
values: {
|
|
178
|
+
isSelected: isSelected,
|
|
179
|
+
isDisabled: isDisabled,
|
|
180
|
+
isReadOnly: state.isReadOnly,
|
|
181
|
+
isInvalid: state.isInvalid,
|
|
182
|
+
isRequired: state.isRequired
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
let DOMProps = (0, $kyCvN$reactariafilterDOMProps.filterDOMProps)(props, {
|
|
186
|
+
global: true
|
|
187
|
+
});
|
|
188
|
+
delete DOMProps.id;
|
|
189
|
+
delete DOMProps.onClick;
|
|
190
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kyCvN$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
|
|
191
|
+
...(0, $kyCvN$reactariamergeProps.mergeProps)(DOMProps, renderProps),
|
|
192
|
+
ref: ref,
|
|
193
|
+
"data-selected": isSelected || undefined,
|
|
194
|
+
"data-disabled": isDisabled || undefined,
|
|
195
|
+
"data-readonly": state.isReadOnly || undefined,
|
|
196
|
+
"data-invalid": state.isInvalid || undefined,
|
|
197
|
+
"data-required": state.isRequired || undefined
|
|
198
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kyCvN$react))).createElement((0, $048d76b84370f141$exports.Provider), {
|
|
199
|
+
values: [
|
|
200
|
+
[
|
|
201
|
+
(0, $61557b2a9b2862a8$exports.SelectionIndicatorContext),
|
|
202
|
+
{
|
|
203
|
+
isSelected: isSelected
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
$ecfe484c0a342e33$var$InternalRadioContext,
|
|
208
|
+
{
|
|
209
|
+
...aria,
|
|
210
|
+
inputRef: inputRef,
|
|
211
|
+
defaultClassName: 'react-aria-RadioButton'
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
(0, $cab7d9a238d19c33$exports.TextContext),
|
|
216
|
+
{
|
|
217
|
+
slots: {
|
|
218
|
+
description: descriptionProps
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
]
|
|
223
|
+
}, renderProps.children));
|
|
224
|
+
});
|
|
225
|
+
const $ecfe484c0a342e33$export$f4422ae58352e179 = /*#__PURE__*/ (0, $kyCvN$react.forwardRef)(function RadioButton(props, ref) {
|
|
226
|
+
let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed, defaultClassName: defaultClassName, inputRef: inputRef } = (0, $kyCvN$react.useContext)($ecfe484c0a342e33$var$InternalRadioContext);
|
|
227
|
+
let state = (0, ($parcel$interopDefault($kyCvN$react))).useContext($ecfe484c0a342e33$export$29d84393af70866c);
|
|
144
228
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $kyCvN$reactariauseFocusRing.useFocusRing)();
|
|
145
229
|
let interactionDisabled = isDisabled || state.isReadOnly;
|
|
146
230
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $kyCvN$reactariauseHover.useHover)({
|
|
@@ -149,7 +233,7 @@ const $ecfe484c0a342e33$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $kyCvN$react
|
|
|
149
233
|
});
|
|
150
234
|
let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
|
|
151
235
|
...props,
|
|
152
|
-
defaultClassName:
|
|
236
|
+
defaultClassName: defaultClassName,
|
|
153
237
|
values: {
|
|
154
238
|
isSelected: isSelected,
|
|
155
239
|
isPressed: isPressed,
|
|
@@ -184,11 +268,7 @@ const $ecfe484c0a342e33$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $kyCvN$react
|
|
|
184
268
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kyCvN$react))).createElement("input", {
|
|
185
269
|
...(0, $kyCvN$reactariamergeProps.mergeProps)(inputProps, focusProps),
|
|
186
270
|
ref: inputRef
|
|
187
|
-
})),
|
|
188
|
-
value: {
|
|
189
|
-
isSelected: isSelected
|
|
190
|
-
}
|
|
191
|
-
}, renderProps.children));
|
|
271
|
+
})), renderProps.children);
|
|
192
272
|
});
|
|
193
273
|
|
|
194
274
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAuIM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAAuD;AACxF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE,CAAA,GAAA,qCAAU,MAAM,CAAC;IACtF,IAAI,qBAAqB,MAAM,kBAAkB,IAAI,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W,MAAM,SAAS;YAC1B,YAAY,MAAM,UAAU;QAC9B;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,KAAK;QACP,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,6CAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;uBAEtD,0DAAC,CAAA,GAAA,mDAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaRadioGroupProps, AriaRadioProps, useRadio, useRadioGroup} from 'react-aria/useRadioGroup';\n\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents, Orientation} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately/useRadioGroupState';\nimport React, {createContext, ForwardedRef, forwardRef, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<RadioGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>\n}\nexport interface RadioProps extends Omit<AriaRadioProps, 'children'>, HoverEvents, RenderProps<RadioRenderProps, 'label'>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the radio group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the radio group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the radio group.\n */\n state: RadioGroupState\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the radio is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the radio is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the radio is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the radio is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext = createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useRadioGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>\n {renderProps.children}\n </SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(props: RadioProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isPressed} = useRadio({\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAuPM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DACX,CAAA,GAAA,0BAAY,EAAuD;AAC9D,MAAM,0DACX,CAAA,GAAA,0BAAY,EAA0D;AACjE,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SA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,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,6CAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n AriaRadioGroupProps,\n AriaRadioProps,\n RadioAria,\n useRadio,\n useRadioGroup\n} from 'react-aria/useRadioGroup';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents, Orientation} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately/useRadioGroupState';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface RadioGroupProps\n extends\n Omit<\n AriaRadioGroupProps,\n | 'children'\n | 'label'\n | 'description'\n | 'errorMessage'\n | 'validationState'\n | 'validationBehavior'\n >,\n RACValidation,\n RenderProps<RadioGroupRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>;\n}\nexport interface RadioProps\n extends\n Omit<AriaRadioProps, 'children'>,\n HoverEvents,\n RenderProps<RadioRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface RadioFieldProps\n extends\n Omit<AriaRadioProps, 'children'>,\n RenderProps<RadioFieldRenderProps>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioField'\n */\n className?: ClassNameOrFunction<RadioFieldRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface RadioButtonProps\n extends\n HoverEvents,\n RenderProps<RadioButtonRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioButton'\n */\n className?: ClassNameOrFunction<RadioButtonRenderProps>;\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n *\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation;\n /**\n * Whether the radio group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio group is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio group is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n /**\n * Whether the radio group is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * State of the radio group.\n */\n state: RadioGroupState;\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the radio is currently in a pressed state.\n *\n * @selector [data-pressed]\n */\n isPressed: boolean;\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the radio is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioFieldRenderProps {\n /**\n * Whether the radio is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioButtonRenderProps extends RadioRenderProps {}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext =\n createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioFieldContext =\n createContext<ContextValue<Partial<RadioFieldProps>, HTMLDivElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(\n props: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} =\n useRadioGroup(\n {\n ...props,\n label,\n validationBehavior\n },\n state\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>{renderProps.children}</SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n *\n * @deprecated Use RadioField + RadioButton instead.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(\n props: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n\n return (\n <InternalRadioContext.Provider\n value={{...aria, inputRef, defaultClassName: 'react-aria-Radio'}}>\n <RadioButton {...props} ref={ref} />\n </InternalRadioContext.Provider>\n );\n});\n\ninterface InternalRadioContextValue extends RadioAria {\n inputRef: RefObject<HTMLInputElement | null>;\n defaultClassName: string;\n}\n\nconst InternalRadioContext = createContext<InternalRadioContextValue | null>(null);\n\n/**\n * A RadioField represents an individual option within a radio group, containing a RadioButton and\n * optional description.\n */\nexport const RadioField = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioField(\n props: RadioFieldProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioFieldContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioFieldProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n let {descriptionProps, isSelected, isDisabled} = aria;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-RadioField',\n values: {\n isSelected,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [SelectionIndicatorContext, {isSelected}],\n [\n InternalRadioContext,\n {\n ...aria,\n inputRef,\n defaultClassName: 'react-aria-RadioButton'\n }\n ],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps\n }\n }\n ]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A RadioButton is the clickable area of a radio, including the indicator and label.\n */\nexport const RadioButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioButton(\n props: RadioButtonProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {labelProps, inputProps, isSelected, isDisabled, isPressed, defaultClassName, inputRef} =\n useContext(InternalRadioContext)!;\n let state = React.useContext(RadioGroupStateContext)!;\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName,\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.cjs.map"}
|
|
@@ -10,7 +10,7 @@ import {filterDOMProps as $kK41C$filterDOMProps} from "react-aria/filterDOMProps
|
|
|
10
10
|
import {mergeProps as $kK41C$mergeProps} from "react-aria/mergeProps";
|
|
11
11
|
import {mergeRefs as $kK41C$mergeRefs} from "react-aria/mergeRefs";
|
|
12
12
|
import {useRadioGroupState as $kK41C$useRadioGroupState} from "react-stately/useRadioGroupState";
|
|
13
|
-
import $kK41C$react, {createContext as $kK41C$createContext, forwardRef as $kK41C$forwardRef, useMemo as $kK41C$useMemo} from "react";
|
|
13
|
+
import $kK41C$react, {createContext as $kK41C$createContext, forwardRef as $kK41C$forwardRef, useMemo as $kK41C$useMemo, useContext as $kK41C$useContext} from "react";
|
|
14
14
|
import {useFocusRing as $kK41C$useFocusRing} from "react-aria/useFocusRing";
|
|
15
15
|
import {useHover as $kK41C$useHover} from "react-aria/useHover";
|
|
16
16
|
import {useObjectRef as $kK41C$useObjectRef} from "react-aria/useObjectRef";
|
|
@@ -45,6 +45,7 @@ import {VisuallyHidden as $kK41C$VisuallyHidden} from "react-aria/VisuallyHidden
|
|
|
45
45
|
|
|
46
46
|
const $0ff6aa0fd4e52420$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $kK41C$createContext)(null);
|
|
47
47
|
const $0ff6aa0fd4e52420$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $kK41C$createContext)(null);
|
|
48
|
+
const $0ff6aa0fd4e52420$export$29c6814b341e632b = /*#__PURE__*/ (0, $kK41C$createContext)(null);
|
|
48
49
|
const $0ff6aa0fd4e52420$export$29d84393af70866c = /*#__PURE__*/ (0, $kK41C$createContext)(null);
|
|
49
50
|
const $0ff6aa0fd4e52420$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $kK41C$forwardRef)(function RadioGroup(props, ref) {
|
|
50
51
|
[props, ref] = (0, $b7b7a92703138c9b$export$29f1550f4b0d4415)(props, ref, $0ff6aa0fd4e52420$export$a79eda4ff50e30b6);
|
|
@@ -123,11 +124,91 @@ const $0ff6aa0fd4e52420$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $kK41C$forwa
|
|
|
123
124
|
userProvidedInputRef,
|
|
124
125
|
props.inputRef
|
|
125
126
|
]));
|
|
126
|
-
let
|
|
127
|
+
let aria = (0, $kK41C$useRadio)({
|
|
127
128
|
...(0, $b7b7a92703138c9b$export$ef03459518577ad4)(props),
|
|
128
129
|
// ReactNode type doesn't allow function children.
|
|
129
130
|
children: typeof props.children === 'function' ? true : props.children
|
|
130
131
|
}, state, inputRef);
|
|
132
|
+
return /*#__PURE__*/ (0, $kK41C$react).createElement($0ff6aa0fd4e52420$var$InternalRadioContext.Provider, {
|
|
133
|
+
value: {
|
|
134
|
+
...aria,
|
|
135
|
+
inputRef: inputRef,
|
|
136
|
+
defaultClassName: 'react-aria-Radio'
|
|
137
|
+
}
|
|
138
|
+
}, /*#__PURE__*/ (0, $kK41C$react).createElement($0ff6aa0fd4e52420$export$f4422ae58352e179, {
|
|
139
|
+
...props,
|
|
140
|
+
ref: ref
|
|
141
|
+
}));
|
|
142
|
+
});
|
|
143
|
+
const $0ff6aa0fd4e52420$var$InternalRadioContext = /*#__PURE__*/ (0, $kK41C$createContext)(null);
|
|
144
|
+
const $0ff6aa0fd4e52420$export$4aaf0c609b3e241e = /*#__PURE__*/ (0, $kK41C$forwardRef)(function RadioField(props, ref) {
|
|
145
|
+
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
146
|
+
[props, ref] = (0, $b7b7a92703138c9b$export$29f1550f4b0d4415)(otherProps, ref, $0ff6aa0fd4e52420$export$29c6814b341e632b);
|
|
147
|
+
let state = (0, $kK41C$react).useContext($0ff6aa0fd4e52420$export$29d84393af70866c);
|
|
148
|
+
let inputRef = (0, $kK41C$useObjectRef)((0, $kK41C$useMemo)(()=>(0, $kK41C$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [
|
|
149
|
+
userProvidedInputRef,
|
|
150
|
+
props.inputRef
|
|
151
|
+
]));
|
|
152
|
+
let aria = (0, $kK41C$useRadio)({
|
|
153
|
+
...(0, $b7b7a92703138c9b$export$ef03459518577ad4)(props),
|
|
154
|
+
// ReactNode type doesn't allow function children.
|
|
155
|
+
children: typeof props.children === 'function' ? true : props.children
|
|
156
|
+
}, state, inputRef);
|
|
157
|
+
let { descriptionProps: descriptionProps, isSelected: isSelected, isDisabled: isDisabled } = aria;
|
|
158
|
+
let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
|
|
159
|
+
...props,
|
|
160
|
+
defaultClassName: 'react-aria-RadioField',
|
|
161
|
+
values: {
|
|
162
|
+
isSelected: isSelected,
|
|
163
|
+
isDisabled: isDisabled,
|
|
164
|
+
isReadOnly: state.isReadOnly,
|
|
165
|
+
isInvalid: state.isInvalid,
|
|
166
|
+
isRequired: state.isRequired
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
let DOMProps = (0, $kK41C$filterDOMProps)(props, {
|
|
170
|
+
global: true
|
|
171
|
+
});
|
|
172
|
+
delete DOMProps.id;
|
|
173
|
+
delete DOMProps.onClick;
|
|
174
|
+
return /*#__PURE__*/ (0, $kK41C$react).createElement((0, $b7b7a92703138c9b$export$df3a06d6289f983e).div, {
|
|
175
|
+
...(0, $kK41C$mergeProps)(DOMProps, renderProps),
|
|
176
|
+
ref: ref,
|
|
177
|
+
"data-selected": isSelected || undefined,
|
|
178
|
+
"data-disabled": isDisabled || undefined,
|
|
179
|
+
"data-readonly": state.isReadOnly || undefined,
|
|
180
|
+
"data-invalid": state.isInvalid || undefined,
|
|
181
|
+
"data-required": state.isRequired || undefined
|
|
182
|
+
}, /*#__PURE__*/ (0, $kK41C$react).createElement((0, $b7b7a92703138c9b$export$2881499e37b75b9a), {
|
|
183
|
+
values: [
|
|
184
|
+
[
|
|
185
|
+
(0, $0d6f83ad40839938$export$c9549807523555e0),
|
|
186
|
+
{
|
|
187
|
+
isSelected: isSelected
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
[
|
|
191
|
+
$0ff6aa0fd4e52420$var$InternalRadioContext,
|
|
192
|
+
{
|
|
193
|
+
...aria,
|
|
194
|
+
inputRef: inputRef,
|
|
195
|
+
defaultClassName: 'react-aria-RadioButton'
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
[
|
|
199
|
+
(0, $20d769b1e2b13352$export$9afb8bc826b033ea),
|
|
200
|
+
{
|
|
201
|
+
slots: {
|
|
202
|
+
description: descriptionProps
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
]
|
|
207
|
+
}, renderProps.children));
|
|
208
|
+
});
|
|
209
|
+
const $0ff6aa0fd4e52420$export$f4422ae58352e179 = /*#__PURE__*/ (0, $kK41C$forwardRef)(function RadioButton(props, ref) {
|
|
210
|
+
let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed, defaultClassName: defaultClassName, inputRef: inputRef } = (0, $kK41C$useContext)($0ff6aa0fd4e52420$var$InternalRadioContext);
|
|
211
|
+
let state = (0, $kK41C$react).useContext($0ff6aa0fd4e52420$export$29d84393af70866c);
|
|
131
212
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $kK41C$useFocusRing)();
|
|
132
213
|
let interactionDisabled = isDisabled || state.isReadOnly;
|
|
133
214
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $kK41C$useHover)({
|
|
@@ -136,7 +217,7 @@ const $0ff6aa0fd4e52420$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $kK41C$forwa
|
|
|
136
217
|
});
|
|
137
218
|
let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
|
|
138
219
|
...props,
|
|
139
|
-
defaultClassName:
|
|
220
|
+
defaultClassName: defaultClassName,
|
|
140
221
|
values: {
|
|
141
222
|
isSelected: isSelected,
|
|
142
223
|
isPressed: isPressed,
|
|
@@ -171,13 +252,9 @@ const $0ff6aa0fd4e52420$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $kK41C$forwa
|
|
|
171
252
|
}, /*#__PURE__*/ (0, $kK41C$react).createElement("input", {
|
|
172
253
|
...(0, $kK41C$mergeProps)(inputProps, focusProps),
|
|
173
254
|
ref: inputRef
|
|
174
|
-
})),
|
|
175
|
-
value: {
|
|
176
|
-
isSelected: isSelected
|
|
177
|
-
}
|
|
178
|
-
}, renderProps.children));
|
|
255
|
+
})), renderProps.children);
|
|
179
256
|
});
|
|
180
257
|
|
|
181
258
|
|
|
182
|
-
export {$0ff6aa0fd4e52420$export$a79eda4ff50e30b6 as RadioGroupContext, $0ff6aa0fd4e52420$export$b118023277d4a5c3 as RadioContext, $0ff6aa0fd4e52420$export$29d84393af70866c as RadioGroupStateContext, $0ff6aa0fd4e52420$export$a98f0dcb43a68a25 as RadioGroup, $0ff6aa0fd4e52420$export$d7b12c4107be0d61 as Radio};
|
|
259
|
+
export {$0ff6aa0fd4e52420$export$a79eda4ff50e30b6 as RadioGroupContext, $0ff6aa0fd4e52420$export$b118023277d4a5c3 as RadioContext, $0ff6aa0fd4e52420$export$29c6814b341e632b as RadioFieldContext, $0ff6aa0fd4e52420$export$29d84393af70866c as RadioGroupStateContext, $0ff6aa0fd4e52420$export$a98f0dcb43a68a25 as RadioGroup, $0ff6aa0fd4e52420$export$d7b12c4107be0d61 as Radio, $0ff6aa0fd4e52420$export$f4422ae58352e179 as RadioButton, $0ff6aa0fd4e52420$export$4aaf0c609b3e241e as RadioField};
|
|
183
260
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAuIM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAiD;AACvF,MAAM,0DAAe,CAAA,GAAA,oBAAY,EAAuD;AACxF,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,QAAQ,CAAA,GAAA,yBAAiB,EAAE;QAC7B,GAAG,KAAK;4BACR;IACF;I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AE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,KAAK;QACP,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;uBAEtD,gCAAC,CAAA,GAAA,yCAAwB,EAAE,QAAQ;QAAC,OAAO;wBAAC;QAAU;OACnD,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaRadioGroupProps, AriaRadioProps, useRadio, useRadioGroup} from 'react-aria/useRadioGroup';\n\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents, Orientation} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately/useRadioGroupState';\nimport React, {createContext, ForwardedRef, forwardRef, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<RadioGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>\n}\nexport interface RadioProps extends Omit<AriaRadioProps, 'children'>, HoverEvents, RenderProps<RadioRenderProps, 'label'>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the radio group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the radio group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the radio group.\n */\n state: RadioGroupState\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the radio is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the radio is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the radio is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the radio is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext = createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useRadioGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>\n {renderProps.children}\n </SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(props: RadioProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isPressed} = useRadio({\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;AAuPM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAiD;AACvF,MAAM,0DACX,CAAA,GAAA,oBAAY,EAAuD;AAC9D,MAAM,0DACX,CAAA,GAAA,oBAAY,EAA0D;AACjE,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAC9E,KAAsB,EACtB,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,E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AAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,qBAAa;QAAE,aAAY;qBAC1B,gCAAC;QAAO,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/RadioGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n AriaRadioGroupProps,\n AriaRadioProps,\n RadioAria,\n useRadio,\n useRadioGroup\n} from 'react-aria/useRadioGroup';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RACValidation,\n removeDataAttributes,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents, Orientation} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately/useRadioGroupState';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface RadioGroupProps\n extends\n Omit<\n AriaRadioGroupProps,\n | 'children'\n | 'label'\n | 'description'\n | 'errorMessage'\n | 'validationState'\n | 'validationBehavior'\n >,\n RACValidation,\n RenderProps<RadioGroupRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioGroup'\n */\n className?: ClassNameOrFunction<RadioGroupRenderProps>;\n}\nexport interface RadioProps\n extends\n Omit<AriaRadioProps, 'children'>,\n HoverEvents,\n RenderProps<RadioRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Radio'\n */\n className?: ClassNameOrFunction<RadioRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface RadioFieldProps\n extends\n Omit<AriaRadioProps, 'children'>,\n RenderProps<RadioFieldRenderProps>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioField'\n */\n className?: ClassNameOrFunction<RadioFieldRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface RadioButtonProps\n extends\n HoverEvents,\n RenderProps<RadioButtonRenderProps, 'label'>,\n SlotProps,\n Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-RadioButton'\n */\n className?: ClassNameOrFunction<RadioButtonRenderProps>;\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n *\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation;\n /**\n * Whether the radio group is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio group is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio group is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n /**\n * Whether the radio group is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * State of the radio group.\n */\n state: RadioGroupState;\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the radio is currently in a pressed state.\n *\n * @selector [data-pressed]\n */\n isPressed: boolean;\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the radio is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioFieldRenderProps {\n /**\n * Whether the radio is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the radio is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the radio is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n /**\n * Whether the radio is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the checkbox is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface RadioButtonRenderProps extends RadioRenderProps {}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext =\n createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioFieldContext =\n createContext<ContextValue<Partial<RadioFieldProps>, HTMLDivElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(\n props: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} =\n useRadioGroup(\n {\n ...props,\n label,\n validationBehavior\n },\n state\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [FieldErrorContext, validation]\n ]}>\n <SharedElementTransition>{renderProps.children}</SharedElementTransition>\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n *\n * @deprecated Use RadioField + RadioButton instead.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(\n props: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n\n return (\n <InternalRadioContext.Provider\n value={{...aria, inputRef, defaultClassName: 'react-aria-Radio'}}>\n <RadioButton {...props} ref={ref} />\n </InternalRadioContext.Provider>\n );\n});\n\ninterface InternalRadioContextValue extends RadioAria {\n inputRef: RefObject<HTMLInputElement | null>;\n defaultClassName: string;\n}\n\nconst InternalRadioContext = createContext<InternalRadioContextValue | null>(null);\n\n/**\n * A RadioField represents an individual option within a radio group, containing a RadioButton and\n * optional description.\n */\nexport const RadioField = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioField(\n props: RadioFieldProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n [props, ref] = useContextProps(otherProps, ref, RadioFieldContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(\n useMemo(\n () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n [userProvidedInputRef, props.inputRef]\n )\n );\n let aria = useRadio(\n {\n ...removeDataAttributes<RadioFieldProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n },\n state,\n inputRef\n );\n let {descriptionProps, isSelected, isDisabled} = aria;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-RadioField',\n values: {\n isSelected,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [SelectionIndicatorContext, {isSelected}],\n [\n InternalRadioContext,\n {\n ...aria,\n inputRef,\n defaultClassName: 'react-aria-RadioButton'\n }\n ],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps\n }\n }\n ]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A RadioButton is the clickable area of a radio, including the indicator and label.\n */\nexport const RadioButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioButton(\n props: RadioButtonProps,\n ref: ForwardedRef<HTMLLabelElement>\n) {\n let {labelProps, inputProps, isSelected, isDisabled, isPressed, defaultClassName, inputRef} =\n useContext(InternalRadioContext)!;\n let state = React.useContext(RadioGroupStateContext)!;\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName,\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </dom.label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.js.map"}
|
|
@@ -10,7 +10,7 @@ import {filterDOMProps as $64B8K$filterDOMProps} from "react-aria/filterDOMProps
|
|
|
10
10
|
import {mergeProps as $64B8K$mergeProps} from "react-aria/mergeProps";
|
|
11
11
|
import {mergeRefs as $64B8K$mergeRefs} from "react-aria/mergeRefs";
|
|
12
12
|
import {useRadioGroupState as $64B8K$useRadioGroupState} from "react-stately/useRadioGroupState";
|
|
13
|
-
import $64B8K$react, {createContext as $64B8K$createContext, forwardRef as $64B8K$forwardRef, useMemo as $64B8K$useMemo} from "react";
|
|
13
|
+
import $64B8K$react, {createContext as $64B8K$createContext, forwardRef as $64B8K$forwardRef, useMemo as $64B8K$useMemo, useContext as $64B8K$useContext} from "react";
|
|
14
14
|
import {useFocusRing as $64B8K$useFocusRing} from "react-aria/useFocusRing";
|
|
15
15
|
import {useHover as $64B8K$useHover} from "react-aria/useHover";
|
|
16
16
|
import {useObjectRef as $64B8K$useObjectRef} from "react-aria/useObjectRef";
|
|
@@ -45,6 +45,7 @@ import {VisuallyHidden as $64B8K$VisuallyHidden} from "react-aria/VisuallyHidden
|
|
|
45
45
|
|
|
46
46
|
const $fe21c36db05242bb$export$a79eda4ff50e30b6 = /*#__PURE__*/ (0, $64B8K$createContext)(null);
|
|
47
47
|
const $fe21c36db05242bb$export$b118023277d4a5c3 = /*#__PURE__*/ (0, $64B8K$createContext)(null);
|
|
48
|
+
const $fe21c36db05242bb$export$29c6814b341e632b = /*#__PURE__*/ (0, $64B8K$createContext)(null);
|
|
48
49
|
const $fe21c36db05242bb$export$29d84393af70866c = /*#__PURE__*/ (0, $64B8K$createContext)(null);
|
|
49
50
|
const $fe21c36db05242bb$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $64B8K$forwardRef)(function RadioGroup(props, ref) {
|
|
50
51
|
[props, ref] = (0, $7230ffa83bc0c2cf$export$29f1550f4b0d4415)(props, ref, $fe21c36db05242bb$export$a79eda4ff50e30b6);
|
|
@@ -122,11 +123,91 @@ const $fe21c36db05242bb$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $64B8K$forwa
|
|
|
122
123
|
userProvidedInputRef,
|
|
123
124
|
props.inputRef
|
|
124
125
|
]));
|
|
125
|
-
let
|
|
126
|
+
let aria = (0, $64B8K$useRadio)({
|
|
126
127
|
...(0, $7230ffa83bc0c2cf$export$ef03459518577ad4)(props),
|
|
127
128
|
// ReactNode type doesn't allow function children.
|
|
128
129
|
children: typeof props.children === 'function' ? true : props.children
|
|
129
130
|
}, state, inputRef);
|
|
131
|
+
return /*#__PURE__*/ (0, $64B8K$react).createElement($fe21c36db05242bb$var$InternalRadioContext.Provider, {
|
|
132
|
+
value: {
|
|
133
|
+
...aria,
|
|
134
|
+
inputRef: inputRef,
|
|
135
|
+
defaultClassName: 'react-aria-Radio'
|
|
136
|
+
}
|
|
137
|
+
}, /*#__PURE__*/ (0, $64B8K$react).createElement($fe21c36db05242bb$export$f4422ae58352e179, {
|
|
138
|
+
...props,
|
|
139
|
+
ref: ref
|
|
140
|
+
}));
|
|
141
|
+
});
|
|
142
|
+
const $fe21c36db05242bb$var$InternalRadioContext = /*#__PURE__*/ (0, $64B8K$createContext)(null);
|
|
143
|
+
const $fe21c36db05242bb$export$4aaf0c609b3e241e = /*#__PURE__*/ (0, $64B8K$forwardRef)(function RadioField(props, ref) {
|
|
144
|
+
let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
|
|
145
|
+
[props, ref] = (0, $7230ffa83bc0c2cf$export$29f1550f4b0d4415)(otherProps, ref, $fe21c36db05242bb$export$29c6814b341e632b);
|
|
146
|
+
let state = (0, $64B8K$react).useContext($fe21c36db05242bb$export$29d84393af70866c);
|
|
147
|
+
let inputRef = (0, $64B8K$useObjectRef)((0, $64B8K$useMemo)(()=>(0, $64B8K$mergeRefs)(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [
|
|
148
|
+
userProvidedInputRef,
|
|
149
|
+
props.inputRef
|
|
150
|
+
]));
|
|
151
|
+
let aria = (0, $64B8K$useRadio)({
|
|
152
|
+
...(0, $7230ffa83bc0c2cf$export$ef03459518577ad4)(props),
|
|
153
|
+
// ReactNode type doesn't allow function children.
|
|
154
|
+
children: typeof props.children === 'function' ? true : props.children
|
|
155
|
+
}, state, inputRef);
|
|
156
|
+
let { descriptionProps: descriptionProps, isSelected: isSelected, isDisabled: isDisabled } = aria;
|
|
157
|
+
let renderProps = (0, $7230ffa83bc0c2cf$export$4d86445c2cf5e3)({
|
|
158
|
+
...props,
|
|
159
|
+
defaultClassName: 'react-aria-RadioField',
|
|
160
|
+
values: {
|
|
161
|
+
isSelected: isSelected,
|
|
162
|
+
isDisabled: isDisabled,
|
|
163
|
+
isReadOnly: state.isReadOnly,
|
|
164
|
+
isInvalid: state.isInvalid,
|
|
165
|
+
isRequired: state.isRequired
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
let DOMProps = (0, $64B8K$filterDOMProps)(props, {
|
|
169
|
+
global: true
|
|
170
|
+
});
|
|
171
|
+
delete DOMProps.id;
|
|
172
|
+
delete DOMProps.onClick;
|
|
173
|
+
return /*#__PURE__*/ (0, $64B8K$react).createElement((0, $7230ffa83bc0c2cf$export$df3a06d6289f983e).div, {
|
|
174
|
+
...(0, $64B8K$mergeProps)(DOMProps, renderProps),
|
|
175
|
+
ref: ref,
|
|
176
|
+
"data-selected": isSelected || undefined,
|
|
177
|
+
"data-disabled": isDisabled || undefined,
|
|
178
|
+
"data-readonly": state.isReadOnly || undefined,
|
|
179
|
+
"data-invalid": state.isInvalid || undefined,
|
|
180
|
+
"data-required": state.isRequired || undefined
|
|
181
|
+
}, /*#__PURE__*/ (0, $64B8K$react).createElement((0, $7230ffa83bc0c2cf$export$2881499e37b75b9a), {
|
|
182
|
+
values: [
|
|
183
|
+
[
|
|
184
|
+
(0, $91fe5e721c7f36c1$export$c9549807523555e0),
|
|
185
|
+
{
|
|
186
|
+
isSelected: isSelected
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
[
|
|
190
|
+
$fe21c36db05242bb$var$InternalRadioContext,
|
|
191
|
+
{
|
|
192
|
+
...aria,
|
|
193
|
+
inputRef: inputRef,
|
|
194
|
+
defaultClassName: 'react-aria-RadioButton'
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
[
|
|
198
|
+
(0, $efe09c6d1c304b50$export$9afb8bc826b033ea),
|
|
199
|
+
{
|
|
200
|
+
slots: {
|
|
201
|
+
description: descriptionProps
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
]
|
|
206
|
+
}, renderProps.children));
|
|
207
|
+
});
|
|
208
|
+
const $fe21c36db05242bb$export$f4422ae58352e179 = /*#__PURE__*/ (0, $64B8K$forwardRef)(function RadioButton(props, ref) {
|
|
209
|
+
let { labelProps: labelProps, inputProps: inputProps, isSelected: isSelected, isDisabled: isDisabled, isPressed: isPressed, defaultClassName: defaultClassName, inputRef: inputRef } = (0, $64B8K$useContext)($fe21c36db05242bb$var$InternalRadioContext);
|
|
210
|
+
let state = (0, $64B8K$react).useContext($fe21c36db05242bb$export$29d84393af70866c);
|
|
130
211
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $64B8K$useFocusRing)();
|
|
131
212
|
let interactionDisabled = isDisabled || state.isReadOnly;
|
|
132
213
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $64B8K$useHover)({
|
|
@@ -135,7 +216,7 @@ const $fe21c36db05242bb$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $64B8K$forwa
|
|
|
135
216
|
});
|
|
136
217
|
let renderProps = (0, $7230ffa83bc0c2cf$export$4d86445c2cf5e3)({
|
|
137
218
|
...props,
|
|
138
|
-
defaultClassName:
|
|
219
|
+
defaultClassName: defaultClassName,
|
|
139
220
|
values: {
|
|
140
221
|
isSelected: isSelected,
|
|
141
222
|
isPressed: isPressed,
|
|
@@ -170,13 +251,9 @@ const $fe21c36db05242bb$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $64B8K$forwa
|
|
|
170
251
|
}, /*#__PURE__*/ (0, $64B8K$react).createElement("input", {
|
|
171
252
|
...(0, $64B8K$mergeProps)(inputProps, focusProps),
|
|
172
253
|
ref: inputRef
|
|
173
|
-
})),
|
|
174
|
-
value: {
|
|
175
|
-
isSelected: isSelected
|
|
176
|
-
}
|
|
177
|
-
}, renderProps.children));
|
|
254
|
+
})), renderProps.children);
|
|
178
255
|
});
|
|
179
256
|
|
|
180
257
|
|
|
181
|
-
export {$fe21c36db05242bb$export$a79eda4ff50e30b6 as RadioGroupContext, $fe21c36db05242bb$export$b118023277d4a5c3 as RadioContext, $fe21c36db05242bb$export$29d84393af70866c as RadioGroupStateContext, $fe21c36db05242bb$export$a98f0dcb43a68a25 as RadioGroup, $fe21c36db05242bb$export$d7b12c4107be0d61 as Radio};
|
|
258
|
+
export {$fe21c36db05242bb$export$a79eda4ff50e30b6 as RadioGroupContext, $fe21c36db05242bb$export$b118023277d4a5c3 as RadioContext, $fe21c36db05242bb$export$29c6814b341e632b as RadioFieldContext, $fe21c36db05242bb$export$29d84393af70866c as RadioGroupStateContext, $fe21c36db05242bb$export$a98f0dcb43a68a25 as RadioGroup, $fe21c36db05242bb$export$d7b12c4107be0d61 as Radio, $fe21c36db05242bb$export$f4422ae58352e179 as RadioButton, $fe21c36db05242bb$export$4aaf0c609b3e241e as RadioField};
|
|
182
259
|
//# sourceMappingURL=RadioGroup.mjs.map
|