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;;;;;;;;;;;;;;;;;;;;;AA0FM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAAiE;AACnG,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA8C;AAKrF,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAkE,KAAwB,EAAE,GAAiC;IACvM,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,cAAE,aAAa,kBAAO,YAAY,mBAAO,aAAa,OAAM,GAAG;IAC5E,IAAI,UAAU,CAAA,GAAA,cAAM,EAAE,IACpB,OAAO,aAAa,aAChB,SAAS;YACT,QAAQ;wBACR;uBACA;wBACA;YACA,WAAW;YACX,gBAAgB;YAChB,iBAAiB;QACnB,KACE,UACH;QAAC;QAAU;QAAY;QAAW;KAAW;IAEhD,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,gCAAC;YAAY,OAAO;YAAO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MAAM,KAAK;mBAC9C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,IAAI;QAAC,KAAK;QAAM,GAAG,QAAQ;QAAG,GAAG,WAAW;QAAE,oBAAkB,MAAM,aAAa,CAAC,MAAM,KAAK,KAAK;qBAEvG,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Select.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 {AriaSelectProps, HiddenSelect, useSelect} from 'react-aria/useSelect';\n\nimport {ButtonContext} from './Button';\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 {Collection, Node} from '@react-types/shared';\nimport {CollectionBuilder} from 'react-aria/CollectionBuilder';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport intlMessages from '../intl/*.json';\nimport {ItemRenderProps} from './Collection';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerStateContext} from './Dialog';\n// @ts-ignore\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, Fragment, HTMLAttributes, ReactNode, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {SelectState, useSelectState} from 'react-stately/useSelectState';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useListFormatter} from 'react-aria/useListFormatter';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useResizeObserver} from 'react-aria/private/utils/useResizeObserver';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface SelectRenderProps {\n /**\n * Whether the select is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the select is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the select is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the select is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * Whether the select is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the select is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface SelectProps<T extends object = {}, M extends SelectionMode = 'single'> extends Omit<AriaSelectProps<T, M>, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' | 'items'>, RACValidation, RenderProps<SelectRenderProps>, 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-Select'\n */\n className?: ClassNameOrFunction<SelectRenderProps>,\n /**\n * Temporary text that occupies the select when it is empty.\n * @default 'Select an item' (localized)\n */\n placeholder?: string\n}\n\nexport const SelectContext = createContext<ContextValue<SelectProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const SelectStateContext = createContext<SelectState<unknown, SelectionMode> | null>(null);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport const Select = /*#__PURE__*/ (forwardRef as forwardRefType)(function Select<T extends object = {}, M extends SelectionMode = 'single'>(props: SelectProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;\n let content = useMemo(() => (\n typeof children === 'function'\n ? children({\n isOpen: false,\n isDisabled,\n isInvalid,\n isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n })\n : children\n ), [children, isDisabled, isInvalid, isRequired]);\n\n return (\n <CollectionBuilder content={content}>\n {collection => <SelectInner props={props} collection={collection} selectRef={ref} />}\n </CollectionBuilder>\n );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, TextContext];\n\ninterface SelectInnerProps<T extends object> {\n props: SelectProps<T, SelectionMode>,\n selectRef: ForwardedRef<HTMLDivElement>,\n collection: Collection<Node<T>>\n}\n\nfunction SelectInner<T extends object>({props, selectRef: ref, collection}: SelectInnerProps<T>) {\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useSelectState({\n ...props,\n collection,\n children: undefined,\n validationBehavior\n });\n\n let {isFocusVisible, focusProps} = useFocusRing({within: true});\n\n // Get props for child elements from useSelect\n let buttonRef = useRef<HTMLButtonElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n descriptionProps,\n errorMessageProps,\n hiddenSelectProps,\n ...validation\n } = useSelect({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, buttonRef);\n\n // Make menu width match input + button\n let [buttonWidth, setButtonWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (buttonRef.current) {\n setButtonWidth(buttonRef.current.offsetWidth + 'px');\n }\n }, [buttonRef]);\n\n useResizeObserver({\n ref: buttonRef,\n onResize: onResize\n });\n\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = useMemo(() => ({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }), [state.isOpen, state.isFocused, isFocusVisible, props.isDisabled, validation.isInvalid, props.isRequired]);\n\n let renderProps = useRenderProps({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [SelectContext, props],\n [SelectStateContext, state],\n [SelectValueContext, valueProps],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [ButtonContext, {...triggerProps, ref: buttonRef, isPressed: state.isOpen, autoFocus: props.autoFocus}],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef,\n placement: 'bottom start',\n style: {'--trigger-width': buttonWidth} as React.CSSProperties,\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: CLEAR_CONTEXTS\n }],\n [ListBoxContext, {...menuProps, ref: scrollRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-open={state.isOpen || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n {renderProps.children}\n <HiddenSelect\n {...hiddenSelectProps}\n autoComplete={props.autoComplete} />\n </dom.div>\n </Provider>\n );\n}\n\nexport interface SelectValueRenderProps<T> {\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * The object value of the first selected item.\n * @deprecated\n */\n selectedItem: T | null,\n /** The object values of the currently selected items. */\n selectedItems: (T | null)[],\n /** The textValue of the currently selected items. */\n selectedText: string,\n /** The state of the select. */\n state: SelectState<T, 'single' | 'multiple'>\n}\n\nexport interface SelectValueProps<T extends object> extends Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>, RenderProps<SelectValueRenderProps<T>, 'span'> {\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-SelectValue'\n */\n className?: ClassNameOrFunction<SelectValueRenderProps<T>>\n}\n\nexport const SelectValueContext = createContext<ContextValue<SelectValueProps<any>, HTMLSpanElement>>(null);\n\n/**\n * SelectValue renders the current value of a Select, or a placeholder if no value is selected.\n * It is usually placed within the button element.\n */\nexport const SelectValue = /*#__PURE__*/ createHideableComponent(function SelectValue<T extends object>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n [props, ref] = useContextProps(props, ref, SelectValueContext);\n let state = useContext(SelectStateContext)! as SelectState<T, 'single' | 'multiple'>;\n let {placeholder} = useSlottedContext(SelectContext)!;\n let rendered = state.selectedItems.map((item) => {\n let rendered = item.props?.children;\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n if (typeof rendered === 'function') {\n let fn = rendered as (s: ItemRenderProps) => ReactNode;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n\n return rendered;\n });\n\n let formatter = useListFormatter();\n let textValue = useMemo(() => state.selectedItems.map(item => item?.textValue), [state.selectedItems]);\n let selectionMode = state.selectionManager.selectionMode;\n let selectedText = useMemo(() => (\n selectionMode === 'single' \n ? textValue[0] ?? '' \n : formatter.format(textValue)\n ), [selectionMode, formatter, textValue]);\n\n let defaultChildren = useMemo(() => {\n if (selectionMode === 'single') {\n return rendered[0];\n }\n\n let parts = formatter.formatToParts(textValue);\n if (parts.length === 0) {\n return null;\n }\n\n let index = 0;\n return parts.map(part => {\n if (part.type === 'element') {\n return <Fragment key={index}>{rendered[index++]}</Fragment>;\n } else {\n return part.value;\n }\n });\n }, [selectionMode, formatter, textValue, rendered]);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let renderProps = useRenderProps({\n ...props,\n defaultChildren: defaultChildren ?? placeholder ?? stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: state.selectedItems[0]?.value as T ?? null,\n selectedItems: useMemo(() => state.selectedItems.map(item => item.value as T ?? null), [state.selectedItems]),\n selectedText,\n isPlaceholder: state.selectedItems.length === 0,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.span ref={ref} {...DOMProps} {...renderProps} data-placeholder={state.selectedItems.length === 0 || undefined}>\n {/* clear description and error message slots */}\n <TextContext.Provider value={undefined}>\n {renderProps.children}\n </TextContext.Provider>\n </dom.span>\n );\n});\n"],"names":[],"version":3,"file":"Select.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;AA0HM,MAAM,0DACX,CAAA,GAAA,oBAAY,EAAiE;AACxE,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAA8C;AAKrF,MAAM,4CAAS,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE,SAAS,OAGnE,KAAwB,EAAE,GAAiC;IAC3D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,cAAE,aAAa,kBAAO,YAAY,mBAAO,aAAa,OAAM,GAAG;IAC5E,IAAI,UAAU,CAAA,GAAA,cAAM,EAClB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O;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,IAAI;QACP,KAAK;QACJ,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,oBAAkB,MAAM,aAAa,CAAC,MAAM,KAAK,KAAK;qBAEtD,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAAY,YAAY,QAAQ;AAGnE","sources":["packages/react-aria-components/src/Select.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 {AriaSelectProps, HiddenSelect, useSelect} from 'react-aria/useSelect';\n\nimport {ButtonContext} from './Button';\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 {Collection, Node} from '@react-types/shared';\nimport {CollectionBuilder} from 'react-aria/CollectionBuilder';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {GlobalDOMAttributes} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ItemRenderProps} from './Collection';\nimport {LabelContext} from './Label';\nimport {ListBoxContext, ListStateContext} from './ListBox';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport {PopoverContext} from './Popover';\nimport React, {\n createContext,\n ForwardedRef,\n Fragment,\n HTMLAttributes,\n ReactNode,\n useContext,\n useMemo,\n useRef\n} from 'react';\nimport {SelectState, useSelectState} from 'react-stately/useSelectState';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useListFormatter} from 'react-aria/useListFormatter';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\ntype SelectionMode = 'single' | 'multiple';\n\nexport interface SelectRenderProps {\n /**\n * Whether the select is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the select is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the select is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the select is currently open.\n *\n * @selector [data-open]\n */\n isOpen: boolean;\n /**\n * Whether the select is invalid.\n *\n * @selector [data-invalid]\n */\n isInvalid: boolean;\n /**\n * Whether the select is required.\n *\n * @selector [data-required]\n */\n isRequired: boolean;\n}\n\nexport interface SelectProps<T, M extends SelectionMode = 'single'>\n extends\n Omit<\n AriaSelectProps<T, M>,\n | 'children'\n | 'label'\n | 'description'\n | 'errorMessage'\n | 'validationState'\n | 'validationBehavior'\n | 'items'\n >,\n RACValidation,\n RenderProps<SelectRenderProps>,\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-Select'\n */\n className?: ClassNameOrFunction<SelectRenderProps>;\n /**\n * Temporary text that occupies the select when it is empty.\n *\n * @default 'Select an item' (localized)\n */\n placeholder?: string;\n}\n\nexport const SelectContext =\n createContext<ContextValue<SelectProps<any, SelectionMode>, HTMLDivElement>>(null);\nexport const SelectStateContext = createContext<SelectState<unknown, SelectionMode> | null>(null);\n\n/**\n * A select displays a collapsible list of options and allows a user to select one of them.\n */\nexport const Select = /*#__PURE__*/ createHideableComponent(function Select<\n T,\n M extends SelectionMode = 'single'\n>(props: SelectProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n let {children, isDisabled = false, isInvalid = false, isRequired = false} = props;\n let content = useMemo(\n () =>\n typeof children === 'function'\n ? children({\n isOpen: false,\n isDisabled,\n isInvalid,\n isRequired,\n isFocused: false,\n isFocusVisible: false,\n defaultChildren: null\n })\n : children,\n [children, isDisabled, isInvalid, isRequired]\n );\n\n return (\n <CollectionBuilder content={content}>\n {collection => <SelectInner props={props} collection={collection} selectRef={ref} />}\n </CollectionBuilder>\n );\n});\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [LabelContext, ButtonContext, TextContext];\n\ninterface SelectInnerProps<T> {\n props: SelectProps<T, SelectionMode>;\n selectRef: ForwardedRef<HTMLDivElement>;\n collection: Collection<Node<T>>;\n}\n\nfunction SelectInner<T>({props, selectRef: ref, collection}: SelectInnerProps<T>) {\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useSelectState({\n ...props,\n collection,\n children: undefined,\n validationBehavior\n });\n\n let {isFocusVisible, focusProps} = useFocusRing({within: true});\n\n // Get props for child elements from useSelect\n let buttonRef = useRef<HTMLButtonElement>(null);\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {\n labelProps,\n triggerProps,\n valueProps,\n menuProps,\n descriptionProps,\n errorMessageProps,\n hiddenSelectProps,\n ...validation\n } = useSelect(\n {\n ...removeDataAttributes(props),\n label,\n validationBehavior\n },\n state,\n buttonRef\n );\n\n // Only expose a subset of state to renderProps function to avoid infinite render loop\n let renderPropsState = useMemo(\n () => ({\n isOpen: state.isOpen,\n isFocused: state.isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n }),\n [\n state.isOpen,\n state.isFocused,\n isFocusVisible,\n props.isDisabled,\n validation.isInvalid,\n props.isRequired\n ]\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: renderPropsState,\n defaultClassName: 'react-aria-Select'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n let scrollRef = useRef(null);\n\n return (\n <Provider\n values={[\n [SelectContext, props],\n [SelectStateContext, state],\n [SelectValueContext, valueProps],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [\n ButtonContext,\n {...triggerProps, ref: buttonRef, isPressed: state.isOpen, autoFocus: props.autoFocus}\n ],\n [OverlayTriggerStateContext, state],\n [\n PopoverContext,\n {\n trigger: 'Select',\n triggerRef: buttonRef,\n scrollRef,\n placement: 'bottom start',\n 'aria-labelledby': menuProps['aria-labelledby'],\n clearContexts: CLEAR_CONTEXTS\n }\n ],\n [ListBoxContext, {...menuProps, ref: scrollRef}],\n [ListStateContext, state],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }\n ],\n [FieldErrorContext, validation]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={state.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-open={state.isOpen || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-required={props.isRequired || undefined}>\n {renderProps.children}\n <HiddenSelect {...hiddenSelectProps} autoComplete={props.autoComplete} />\n </dom.div>\n </Provider>\n );\n}\n\nexport interface SelectValueRenderProps<T> {\n /**\n * Whether the value is a placeholder.\n *\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean;\n /**\n * The object value of the first selected item.\n *\n * @deprecated\n */\n selectedItem: T | null;\n /** The object values of the currently selected items. */\n selectedItems: (T | null)[];\n /** The textValue of the currently selected items. */\n selectedText: string;\n /** The state of the select. */\n state: SelectState<T, 'single' | 'multiple'>;\n}\n\nexport interface SelectValueProps<T>\n extends\n Omit<HTMLAttributes<HTMLElement>, keyof RenderProps<unknown>>,\n RenderProps<SelectValueRenderProps<T>, 'span'> {\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-SelectValue'\n */\n className?: ClassNameOrFunction<SelectValueRenderProps<T>>;\n}\n\nexport const SelectValueContext =\n createContext<ContextValue<SelectValueProps<any>, HTMLSpanElement>>(null);\n\n/**\n * SelectValue renders the current value of a Select, or a placeholder if no value is selected.\n * It is usually placed within the button element.\n */\nexport const SelectValue = /*#__PURE__*/ createHideableComponent(function SelectValue<T>(\n props: SelectValueProps<T>,\n ref: ForwardedRef<HTMLSpanElement>\n) {\n [props, ref] = useContextProps(props, ref, SelectValueContext);\n let state = useContext(SelectStateContext)! as SelectState<T, 'single' | 'multiple'>;\n let {placeholder} = useSlottedContext(SelectContext)!;\n let rendered = state.selectedItems.map(item => {\n let rendered = item.props?.children;\n // If the selected item has a function as a child, we need to call it to render to React.JSX.\n if (typeof rendered === 'function') {\n let fn = rendered as (s: ItemRenderProps) => ReactNode;\n rendered = fn({\n isHovered: false,\n isPressed: false,\n isSelected: false,\n isFocused: false,\n isFocusVisible: false,\n isDisabled: false,\n selectionMode: 'single',\n selectionBehavior: 'toggle'\n });\n }\n\n return rendered;\n });\n\n let formatter = useListFormatter();\n let textValue = useMemo(\n () => state.selectedItems.map(item => item?.textValue),\n [state.selectedItems]\n );\n let selectionMode = state.selectionManager.selectionMode;\n let selectedText = useMemo(\n () => (selectionMode === 'single' ? (textValue[0] ?? '') : formatter.format(textValue)),\n [selectionMode, formatter, textValue]\n );\n\n let defaultChildren = useMemo(() => {\n if (selectionMode === 'single') {\n return rendered[0];\n }\n\n let parts = formatter.formatToParts(textValue);\n if (parts.length === 0) {\n return null;\n }\n\n let index = 0;\n return parts.map(part => {\n if (part.type === 'element') {\n return <Fragment key={index}>{rendered[index++]}</Fragment>;\n } else {\n return part.value;\n }\n });\n }, [selectionMode, formatter, textValue, rendered]);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');\n\n let renderProps = useRenderProps({\n ...props,\n defaultChildren: defaultChildren ?? placeholder ?? stringFormatter.format('selectPlaceholder'),\n defaultClassName: 'react-aria-SelectValue',\n values: {\n selectedItem: (state.selectedItems[0]?.value as T) ?? null,\n selectedItems: useMemo(\n () => state.selectedItems.map(item => (item.value as T) ?? null),\n [state.selectedItems]\n ),\n selectedText,\n isPlaceholder: state.selectedItems.length === 0,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.span\n ref={ref}\n {...DOMProps}\n {...renderProps}\n data-placeholder={state.selectedItems.length === 0 || undefined}>\n {/* clear description and error message slots */}\n <TextContext.Provider value={undefined}>{renderProps.children}</TextContext.Provider>\n </dom.span>\n );\n});\n"],"names":[],"version":3,"file":"Select.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAyBM,MAAM,0DAA4B,CAAA,GAAA,0BAAY,EAEnD;IACA,YAAY;AACd;AAKO,MAAM,0DAAqB,CAAA,GAAA,uBAAS,EAAE,SAAS,mBACpD,KAA8B,EAC9B,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAC,UAAU,EAAE,GAAG,YAAW,GAAG;IAClC,qBACE,0DAAC,CAAA,GAAA,uCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,WAAW,MAAM,SAAS,IAAI;QAC9B,MAAK;QACL,WAAW;;AAGjB","sources":["packages/react-aria-components/src/SelectionIndicator.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {ClassNameOrFunction, ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {\n SharedElement,\n SharedElementPropsBase,\n SharedElementRenderProps\n} from './SharedElementTransition';\n\nexport interface SelectionIndicatorProps extends SharedElementPropsBase {\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-SelectionIndicator'\n */\n className?: ClassNameOrFunction<SharedElementRenderProps>;\n /**\n * Whether the SelectionIndicator is visible. This is usually set automatically by the parent\n * component.\n */\n isSelected?: boolean;\n}\n\nexport const SelectionIndicatorContext = createContext<\n ContextValue<SelectionIndicatorProps, HTMLDivElement>\n>({\n isSelected: false\n});\n\n/**\n * An animated indicator of selection state within a group of items.\n */\nexport const SelectionIndicator = forwardRef(function SelectionIndicator(\n props: SelectionIndicatorProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, SelectionIndicatorContext);\n let {isSelected, ...otherProps} = props;\n return (\n <SharedElement\n {...otherProps}\n ref={ref}\n className={props.className || 'react-aria-SelectionIndicator'}\n name=\"SelectionIndicator\"\n isVisible={isSelected}\n />\n );\n});\n"],"names":[],"version":3,"file":"SelectionIndicator.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAyBM,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAEnD;IACA,YAAY;AACd;AAKO,MAAM,0DAAqB,CAAA,GAAA,iBAAS,EAAE,SAAS,mBACpD,KAA8B,EAC9B,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAC,UAAU,EAAE,GAAG,YAAW,GAAG;IAClC,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,WAAW,MAAM,SAAS,IAAI;QAC9B,MAAK;QACL,WAAW;;AAGjB","sources":["packages/react-aria-components/src/SelectionIndicator.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {ClassNameOrFunction, ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {\n SharedElement,\n SharedElementPropsBase,\n SharedElementRenderProps\n} from './SharedElementTransition';\n\nexport interface SelectionIndicatorProps extends SharedElementPropsBase {\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-SelectionIndicator'\n */\n className?: ClassNameOrFunction<SharedElementRenderProps>;\n /**\n * Whether the SelectionIndicator is visible. This is usually set automatically by the parent\n * component.\n */\n isSelected?: boolean;\n}\n\nexport const SelectionIndicatorContext = createContext<\n ContextValue<SelectionIndicatorProps, HTMLDivElement>\n>({\n isSelected: false\n});\n\n/**\n * An animated indicator of selection state within a group of items.\n */\nexport const SelectionIndicator = forwardRef(function SelectionIndicator(\n props: SelectionIndicatorProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, SelectionIndicatorContext);\n let {isSelected, ...otherProps} = props;\n return (\n <SharedElement\n {...otherProps}\n ref={ref}\n className={props.className || 'react-aria-SelectionIndicator'}\n name=\"SelectionIndicator\"\n isVisible={isSelected}\n />\n );\n});\n"],"names":[],"version":3,"file":"SelectionIndicator.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAyBM,MAAM,0DAA4B,CAAA,GAAA,oBAAY,EAEnD;IACA,YAAY;AACd;AAKO,MAAM,0DAAqB,CAAA,GAAA,iBAAS,EAAE,SAAS,mBACpD,KAA8B,EAC9B,GAAiC;IAEjC,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,cAAC,UAAU,EAAE,GAAG,YAAW,GAAG;IAClC,qBACE,gCAAC,CAAA,GAAA,yCAAY;QACV,GAAG,UAAU;QACd,KAAK;QACL,WAAW,MAAM,SAAS,IAAI;QAC9B,MAAK;QACL,WAAW;;AAGjB","sources":["packages/react-aria-components/src/SelectionIndicator.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {ClassNameOrFunction, ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {\n SharedElement,\n SharedElementPropsBase,\n SharedElementRenderProps\n} from './SharedElementTransition';\n\nexport interface SelectionIndicatorProps extends SharedElementPropsBase {\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-SelectionIndicator'\n */\n className?: ClassNameOrFunction<SharedElementRenderProps>;\n /**\n * Whether the SelectionIndicator is visible. This is usually set automatically by the parent\n * component.\n */\n isSelected?: boolean;\n}\n\nexport const SelectionIndicatorContext = createContext<\n ContextValue<SelectionIndicatorProps, HTMLDivElement>\n>({\n isSelected: false\n});\n\n/**\n * An animated indicator of selection state within a group of items.\n */\nexport const SelectionIndicator = forwardRef(function SelectionIndicator(\n props: SelectionIndicatorProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, SelectionIndicatorContext);\n let {isSelected, ...otherProps} = props;\n return (\n <SharedElement\n {...otherProps}\n ref={ref}\n className={props.className || 'react-aria-SelectionIndicator'}\n name=\"SelectionIndicator\"\n isVisible={isSelected}\n />\n );\n});\n"],"names":[],"version":3,"file":"SelectionIndicator.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4BM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,+DAAa;;aAC9B,OAAO;;IAEvB,OACE,UAA+B,EAC/B,aAAkC,EACN;QAC5B,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAMO,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,qDAAkB,EACvD,2CACA,SAAS,UAAU,KAAqB,EAAE,GAA8B;IACtE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,6BAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,aAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAGpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria/useSeparator';\n\nimport {BaseCollection, CollectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps\n extends\n AriaSeparatorProps,\n StyleProps,\n SlotProps,\n DOMRenderProps<'hr' | 'div', undefined>,\n GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-Separator'\n */\n className?: string;\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(\n collection: BaseCollection<any>,\n newCollection: BaseCollection<any>\n ): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or\n * sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(\n SeparatorNode,\n function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = elementType || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let ElementType = dom[Element];\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <ElementType\n render={props.render}\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined}\n />\n );\n }\n);\n"],"names":[],"version":3,"file":"Separator.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4BM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,qBAAa;IAG9C,OACE,UAA+B,EAC/B,aAAkC,EACN;QAC5B,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAhBa,0CACK,OAAO;AAqBlB,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EACvD,2CACA,SAAS,UAAU,KAAqB,EAAE,GAA8B;IACtE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,sBAAA,uBAAA,YAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAGpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria/useSeparator';\n\nimport {BaseCollection, CollectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps\n extends\n AriaSeparatorProps,\n StyleProps,\n SlotProps,\n DOMRenderProps<'hr' | 'div', undefined>,\n GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-Separator'\n */\n className?: string;\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(\n collection: BaseCollection<any>,\n newCollection: BaseCollection<any>\n ): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or\n * sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(\n SeparatorNode,\n function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = elementType || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let ElementType = dom[Element];\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <ElementType\n render={props.render}\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined}\n />\n );\n }\n);\n"],"names":[],"version":3,"file":"Separator.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4BM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,qBAAa;;aAC9B,OAAO;;IAEvB,OACE,UAA+B,EAC/B,aAAkC,EACN;QAC5B,IAAI,WAAW,cAAc,OAAO,CAAC,IAAI,CAAC,OAAO;QACjD,IAAI,YAAY,SAAS,IAAI,KAAK,aAAa;YAC7C,IAAI,QAAQ,IAAI,CAAC,KAAK;YACtB,cAAc,cAAc,CAAC,OAAO;YACpC,OAAO;QACT;QAEA,OAAO;IACT;AACF;AAMO,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EACvD,2CACA,SAAS,UAAU,KAAqB,EAAE,GAA8B;IACtE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,eAAC,WAAW,eAAE,WAAW,SAAE,KAAK,aAAE,SAAS,QAAE,IAAI,EAAE,GAAG,YAAW,GAAG;IACxE,IAAI,UAAU,eAAe;IAC7B,IAAI,YAAY,QAAQ,gBAAgB,YACtC,UAAU;IAGZ,IAAI,cAAc,CAAA,GAAA,yCAAE,CAAC,CAAC,QAAQ;IAE9B,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,UAAU;qBACb;qBACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACC,QAAQ,MAAM,MAAM;QACnB,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe;QACxC,OAAO;QACP,WAAW,aAAa;QACxB,KAAK;QACL,MAAM,QAAQ;;AAGpB","sources":["packages/react-aria-components/src/Separator.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 {SeparatorProps as AriaSeparatorProps, useSeparator} from 'react-aria/useSeparator';\n\nimport {BaseCollection, CollectionNode} from 'react-aria/private/collections/BaseCollection';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {createLeafComponent} from 'react-aria/CollectionBuilder';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps\n extends\n AriaSeparatorProps,\n StyleProps,\n SlotProps,\n DOMRenderProps<'hr' | 'div', undefined>,\n GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element.\n *\n * @default 'react-aria-Separator'\n */\n className?: string;\n}\n\nexport const SeparatorContext = createContext<ContextValue<SeparatorProps, HTMLElement>>({});\n\nexport class SeparatorNode extends CollectionNode<any> {\n static readonly type = 'separator';\n\n filter(\n collection: BaseCollection<any>,\n newCollection: BaseCollection<any>\n ): CollectionNode<any> | null {\n let prevItem = newCollection.getItem(this.prevKey!);\n if (prevItem && prevItem.type !== 'separator') {\n let clone = this.clone();\n newCollection.addDescendants(clone, collection);\n return clone;\n }\n\n return null;\n }\n}\n\n/**\n * A separator is a visual divider between two groups of content, e.g. groups of menu items or\n * sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(\n SeparatorNode,\n function Separator(props: SeparatorProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, SeparatorContext);\n\n let {elementType, orientation, style, className, slot, ...otherProps} = props;\n let Element = elementType || 'hr';\n if (Element === 'hr' && orientation === 'vertical') {\n Element = 'div';\n }\n\n let ElementType = dom[Element];\n\n let {separatorProps} = useSeparator({\n ...otherProps,\n elementType,\n orientation\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <ElementType\n render={props.render}\n {...mergeProps(DOMProps, separatorProps)}\n style={style}\n className={className ?? 'react-aria-Separator'}\n ref={ref}\n slot={slot || undefined}\n />\n );\n }\n);\n"],"names":[],"version":3,"file":"Separator.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBD,MAAM,2DAAuB,CAAA,GAAA,0BAAY,EAAgD;AASlF,SAAS,0CAAwB,KAAmC;IACzE,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAE,CAAC;IAClB,qBACE,0DAAC,2CAAqB,QAAQ;QAAC,OAAO;OAAM,MAAM,QAAQ;AAE9D;AA8BO,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAC/C,KAAyB,EACzB,GAAiC;IAEjC,IAAI,QAAC,IAAI,aAAE,YAAY,gBAAM,QAAQ,aAAE,SAAS,SAAE,K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BAAE,EAAE,GAAG;QACL,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,UAAU,cAAc;QACvC,gBAAc,UAAU,aAAa;;AAG3C","sources":["packages/react-aria-components/src/SharedElementTransition.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {dom, RenderProps, useRenderProps} from './utils';\nimport {flushSync} from 'react-dom';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefObject,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\ninterface Snapshot {\n rect: DOMRect;\n style: [string, string][];\n}\n\nconst SharedElementContext = createContext<RefObject<{[name: string]: Snapshot}> | null>(null);\n\nexport interface SharedElementTransitionProps {\n children: ReactNode;\n}\n\n/**\n * A scope for SharedElements, which animate between parents.\n */\nexport function SharedElementTransition(props: SharedElementTransitionProps) {\n let ref = useRef({});\n return (\n <SharedElementContext.Provider value={ref}>{props.children}</SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n /**\n * Whether the element is currently entering.\n *\n * @selector [data-entering]\n */\n isEntering: boolean;\n /**\n * Whether the element is currently exiting.\n *\n * @selector [data-exiting]\n */\n isExiting: boolean;\n}\n\nexport interface SharedElementPropsBase\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>,\n RenderProps<SharedElementRenderProps> {}\n\nexport interface SharedElementProps extends SharedElementPropsBase {\n name: string;\n isVisible?: boolean;\n}\n\n/**\n * An element that animates between its old and new position when moving between parents.\n */\nexport const SharedElement = forwardRef(function SharedElement(\n props: SharedElementProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {name, isVisible = true, children, className, style, render, ...divProps} = props;\n let [state, setState] = useState(isVisible ? 'visible' : 'hidden');\n let scopeRef = useContext(SharedElementContext);\n if (!scopeRef) {\n throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');\n }\n\n if (isVisible && state === 'hidden') {\n setState('visible');\n }\n\n ref = useObjectRef(ref);\n useLayoutEffect(() => {\n let element = ref.current;\n let scope = scopeRef.current;\n let prevSnapshot = scope[name];\n let frame: number | null = null;\n\n if (element && isVisible && prevSnapshot) {\n // Element is transitioning from a previous instance.\n setState('visible');\n let animations = element.getAnimations();\n\n // Set properties to animate from.\n let values = prevSnapshot.style.map(([property, prevValue]) => {\n let value = element.style[property];\n if (property === 'translate') {\n let prevRect = prevSnapshot.rect;\n let currentItem = element.getBoundingClientRect();\n let deltaX = prevRect.left - currentItem?.left;\n let deltaY = prevRect.top - currentItem?.top;\n element.style.translate = `${deltaX}px ${deltaY}px`;\n } else {\n element.style[property] = prevValue;\n }\n return [property, value];\n });\n\n // Cancel any new animations triggered by these properties.\n for (let a of element.getAnimations()) {\n if (!animations.includes(a)) {\n a.cancel();\n }\n }\n\n // Remove overrides after one frame to animate to the current values.\n frame = requestAnimationFrame(() => {\n frame = null;\n for (let [property, value] of values) {\n element.style[property] = value;\n }\n });\n\n delete scope[name];\n } else if (element && isVisible && !prevSnapshot) {\n // No previous instance exists, apply the entering state.\n queueMicrotask(() => flushSync(() => setState('entering')));\n frame = requestAnimationFrame(() => {\n frame = null;\n setState('visible');\n });\n } else if (element && !isVisible) {\n // Wait until layout effects finish, and check if a snapshot still exists.\n // If so, no new SharedElement consumed it, so enter the exiting state.\n queueMicrotask(() => {\n if (scope[name]) {\n delete scope[name];\n flushSync(() => setState('exiting'));\n Promise.all(element.getAnimations().map(a => a.finished))\n .then(() => setState('hidden'))\n .catch(() => {});\n } else {\n // Snapshot was consumed by another instance, unmount.\n setState('hidden');\n }\n });\n }\n\n return () => {\n if (frame != null) {\n cancelAnimationFrame(frame);\n }\n\n if (element && element.isConnected && !element.hasAttribute('data-exiting')) {\n // On unmount, store a snapshot of the rectangle and computed style for transitioning properties.\n let style = window.getComputedStyle(element);\n if (style.transitionProperty !== 'none') {\n let transitionProperty = style.transitionProperty.split(/\\s*,\\s*/);\n scope[name] = {\n rect: element.getBoundingClientRect(),\n style: transitionProperty.map(p => [p, style[p]])\n };\n }\n }\n };\n }, [ref, scopeRef, name, isVisible]);\n\n let renderProps = useRenderProps({\n children,\n className,\n style,\n render,\n values: {\n isEntering: state === 'entering',\n isExiting: state === 'exiting'\n }\n });\n\n if (state === 'hidden') {\n return null;\n }\n\n return (\n <dom.div\n {...divProps}\n {...renderProps}\n ref={ref}\n data-entering={state === 'entering' || undefined}\n data-exiting={state === 'exiting' || undefined}\n />\n );\n});\n"],"names":[],"version":3,"file":"SharedElementTransition.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBD,MAAM,2DAAuB,CAAA,GAAA,oBAAY,EAAgD;AASlF,SAAS,0CAAwB,KAAmC;IACzE,IAAI,MAAM,CAAA,GAAA,aAAK,EAAE,CAAC;IAClB,qBACE,gCAAC,2CAAqB,QAAQ;QAAC,OAAO;OAAM,MAAM,QAAQ;AAE9D;AA8BO,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAC/C,KAAyB,EACzB,GAAiC;IAEjC,IAAI,QAAC,IAAI,aAAE,YAAY,gBAAM,QAAQ,aAAE,SAAS,SAAE,KAAK,UAAE,MAAM,EAAE,GAAG,UAAS,GAAG;IAChF,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,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AAW;QACf,KAAK;QACL,iBAAe,UAAU,cAAc;QACvC,gBAAc,UAAU,aAAa;;AAG3C","sources":["packages/react-aria-components/src/SharedElementTransition.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {dom, RenderProps, useRenderProps} from './utils';\nimport {flushSync} from 'react-dom';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefObject,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\ninterface Snapshot {\n rect: DOMRect;\n style: [string, string][];\n}\n\nconst SharedElementContext = createContext<RefObject<{[name: string]: Snapshot}> | null>(null);\n\nexport interface SharedElementTransitionProps {\n children: ReactNode;\n}\n\n/**\n * A scope for SharedElements, which animate between parents.\n */\nexport function SharedElementTransition(props: SharedElementTransitionProps) {\n let ref = useRef({});\n return (\n <SharedElementContext.Provider value={ref}>{props.children}</SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n /**\n * Whether the element is currently entering.\n *\n * @selector [data-entering]\n */\n isEntering: boolean;\n /**\n * Whether the element is currently exiting.\n *\n * @selector [data-exiting]\n */\n isExiting: boolean;\n}\n\nexport interface SharedElementPropsBase\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>,\n RenderProps<SharedElementRenderProps> {}\n\nexport interface SharedElementProps extends SharedElementPropsBase {\n name: string;\n isVisible?: boolean;\n}\n\n/**\n * An element that animates between its old and new position when moving between parents.\n */\nexport const SharedElement = forwardRef(function SharedElement(\n props: SharedElementProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {name, isVisible = true, children, className, style, render, ...divProps} = props;\n let [state, setState] = useState(isVisible ? 'visible' : 'hidden');\n let scopeRef = useContext(SharedElementContext);\n if (!scopeRef) {\n throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');\n }\n\n if (isVisible && state === 'hidden') {\n setState('visible');\n }\n\n ref = useObjectRef(ref);\n useLayoutEffect(() => {\n let element = ref.current;\n let scope = scopeRef.current;\n let prevSnapshot = scope[name];\n let frame: number | null = null;\n\n if (element && isVisible && prevSnapshot) {\n // Element is transitioning from a previous instance.\n setState('visible');\n let animations = element.getAnimations();\n\n // Set properties to animate from.\n let values = prevSnapshot.style.map(([property, prevValue]) => {\n let value = element.style[property];\n if (property === 'translate') {\n let prevRect = prevSnapshot.rect;\n let currentItem = element.getBoundingClientRect();\n let deltaX = prevRect.left - currentItem?.left;\n let deltaY = prevRect.top - currentItem?.top;\n element.style.translate = `${deltaX}px ${deltaY}px`;\n } else {\n element.style[property] = prevValue;\n }\n return [property, value];\n });\n\n // Cancel any new animations triggered by these properties.\n for (let a of element.getAnimations()) {\n if (!animations.includes(a)) {\n a.cancel();\n }\n }\n\n // Remove overrides after one frame to animate to the current values.\n frame = requestAnimationFrame(() => {\n frame = null;\n for (let [property, value] of values) {\n element.style[property] = value;\n }\n });\n\n delete scope[name];\n } else if (element && isVisible && !prevSnapshot) {\n // No previous instance exists, apply the entering state.\n queueMicrotask(() => flushSync(() => setState('entering')));\n frame = requestAnimationFrame(() => {\n frame = null;\n setState('visible');\n });\n } else if (element && !isVisible) {\n // Wait until layout effects finish, and check if a snapshot still exists.\n // If so, no new SharedElement consumed it, so enter the exiting state.\n queueMicrotask(() => {\n if (scope[name]) {\n delete scope[name];\n flushSync(() => setState('exiting'));\n Promise.all(element.getAnimations().map(a => a.finished))\n .then(() => setState('hidden'))\n .catch(() => {});\n } else {\n // Snapshot was consumed by another instance, unmount.\n setState('hidden');\n }\n });\n }\n\n return () => {\n if (frame != null) {\n cancelAnimationFrame(frame);\n }\n\n if (element && element.isConnected && !element.hasAttribute('data-exiting')) {\n // On unmount, store a snapshot of the rectangle and computed style for transitioning properties.\n let style = window.getComputedStyle(element);\n if (style.transitionProperty !== 'none') {\n let transitionProperty = style.transitionProperty.split(/\\s*,\\s*/);\n scope[name] = {\n rect: element.getBoundingClientRect(),\n style: transitionProperty.map(p => [p, style[p]])\n };\n }\n }\n };\n }, [ref, scopeRef, name, isVisible]);\n\n let renderProps = useRenderProps({\n children,\n className,\n style,\n render,\n values: {\n isEntering: state === 'entering',\n isExiting: state === 'exiting'\n }\n });\n\n if (state === 'hidden') {\n return null;\n }\n\n return (\n <dom.div\n {...divProps}\n {...renderProps}\n ref={ref}\n data-entering={state === 'entering' || undefined}\n data-exiting={state === 'exiting' || undefined}\n />\n );\n});\n"],"names":[],"version":3,"file":"SharedElementTransition.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuBD,MAAM,2DAAuB,CAAA,GAAA,oBAAY,EAAgD;AASlF,SAAS,0CAAwB,KAAmC;IACzE,IAAI,MAAM,CAAA,GAAA,aAAK,EAAE,CAAC;IAClB,qBACE,gCAAC,2CAAqB,QAAQ;QAAC,OAAO;OAAM,MAAM,QAAQ;AAE9D;AA8BO,MAAM,0DAAgB,CAAA,GAAA,iBAAS,EAAE,SAAS,cAC/C,KAAyB,EACzB,GAAiC;IAEjC,IAAI,QAAC,IAAI,aAAE,YAAY,gBAAM,QAAQ,aAAE,SAAS,SAAE,KAAK,UAAE,MAAM,EAAE,GAAG,UAAS,GAAG;IAChF,IAAI,CAAC,OAAO,SAAS,GAAG,CAAA,GAAA,eAAO,EAAE,YAAY,YAAY;IACzD,IAAI,WAAW,CAAA,GA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SharedElementTransition.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {dom, RenderProps, useRenderProps} from './utils';\nimport {flushSync} from 'react-dom';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefObject,\n useContext,\n useRef,\n useState\n} from 'react';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\ninterface Snapshot {\n rect: DOMRect;\n style: [string, string][];\n}\n\nconst SharedElementContext = createContext<RefObject<{[name: string]: Snapshot}> | null>(null);\n\nexport interface SharedElementTransitionProps {\n children: ReactNode;\n}\n\n/**\n * A scope for SharedElements, which animate between parents.\n */\nexport function SharedElementTransition(props: SharedElementTransitionProps) {\n let ref = useRef({});\n return (\n <SharedElementContext.Provider value={ref}>{props.children}</SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n /**\n * Whether the element is currently entering.\n *\n * @selector [data-entering]\n */\n isEntering: boolean;\n /**\n * Whether the element is currently exiting.\n *\n * @selector [data-exiting]\n */\n isExiting: boolean;\n}\n\nexport interface SharedElementPropsBase\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>,\n RenderProps<SharedElementRenderProps> {}\n\nexport interface SharedElementProps extends SharedElementPropsBase {\n name: string;\n isVisible?: boolean;\n}\n\n/**\n * An element that animates between its old and new position when moving between parents.\n */\nexport const SharedElement = forwardRef(function SharedElement(\n props: SharedElementProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {name, isVisible = true, children, className, style, render, ...divProps} = props;\n let [state, setState] = useState(isVisible ? 'visible' : 'hidden');\n let scopeRef = useContext(SharedElementContext);\n if (!scopeRef) {\n throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');\n }\n\n if (isVisible && state === 'hidden') {\n setState('visible');\n }\n\n ref = useObjectRef(ref);\n useLayoutEffect(() => {\n let element = ref.current;\n let scope = scopeRef.current;\n let prevSnapshot = scope[name];\n let frame: number | null = null;\n\n if (element && isVisible && prevSnapshot) {\n // Element is transitioning from a previous instance.\n setState('visible');\n let animations = element.getAnimations();\n\n // Set properties to animate from.\n let values = prevSnapshot.style.map(([property, prevValue]) => {\n let value = element.style[property];\n if (property === 'translate') {\n let prevRect = prevSnapshot.rect;\n let currentItem = element.getBoundingClientRect();\n let deltaX = prevRect.left - currentItem?.left;\n let deltaY = prevRect.top - currentItem?.top;\n element.style.translate = `${deltaX}px ${deltaY}px`;\n } else {\n element.style[property] = prevValue;\n }\n return [property, value];\n });\n\n // Cancel any new animations triggered by these properties.\n for (let a of element.getAnimations()) {\n if (!animations.includes(a)) {\n a.cancel();\n }\n }\n\n // Remove overrides after one frame to animate to the current values.\n frame = requestAnimationFrame(() => {\n frame = null;\n for (let [property, value] of values) {\n element.style[property] = value;\n }\n });\n\n delete scope[name];\n } else if (element && isVisible && !prevSnapshot) {\n // No previous instance exists, apply the entering state.\n queueMicrotask(() => flushSync(() => setState('entering')));\n frame = requestAnimationFrame(() => {\n frame = null;\n setState('visible');\n });\n } else if (element && !isVisible) {\n // Wait until layout effects finish, and check if a snapshot still exists.\n // If so, no new SharedElement consumed it, so enter the exiting state.\n queueMicrotask(() => {\n if (scope[name]) {\n delete scope[name];\n flushSync(() => setState('exiting'));\n Promise.all(element.getAnimations().map(a => a.finished))\n .then(() => setState('hidden'))\n .catch(() => {});\n } else {\n // Snapshot was consumed by another instance, unmount.\n setState('hidden');\n }\n });\n }\n\n return () => {\n if (frame != null) {\n cancelAnimationFrame(frame);\n }\n\n if (element && element.isConnected && !element.hasAttribute('data-exiting')) {\n // On unmount, store a snapshot of the rectangle and computed style for transitioning properties.\n let style = window.getComputedStyle(element);\n if (style.transitionProperty !== 'none') {\n let transitionProperty = style.transitionProperty.split(/\\s*,\\s*/);\n scope[name] = {\n rect: element.getBoundingClientRect(),\n style: transitionProperty.map(p => [p, style[p]])\n };\n }\n }\n };\n }, [ref, scopeRef, name, isVisible]);\n\n let renderProps = useRenderProps({\n children,\n className,\n style,\n render,\n values: {\n isEntering: state === 'entering',\n isExiting: state === 'exiting'\n }\n });\n\n if (state === 'hidden') {\n return null;\n }\n\n return (\n <dom.div\n {...divProps}\n {...renderProps}\n ref={ref}\n data-entering={state === 'entering' || undefined}\n data-exiting={state === 'exiting' || undefined}\n />\n );\n});\n"],"names":[],"version":3,"file":"SharedElementTransition.mjs.map"}
|
package/dist/private/Slider.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var $048d76b84370f141$exports = require("./utils.cjs");
|
|
2
2
|
var $d5d46822336ca1e1$exports = require("./Label.cjs");
|
|
3
3
|
var $1Kg7x$reactariauseSlider = require("react-aria/useSlider");
|
|
4
|
+
var $1Kg7x$reactstatelyprivateutilsnumber = require("react-stately/private/utils/number");
|
|
4
5
|
var $1Kg7x$reactariafilterDOMProps = require("react-aria/filterDOMProps");
|
|
5
6
|
var $1Kg7x$reactariamergeProps = require("react-aria/mergeProps");
|
|
6
7
|
var $1Kg7x$react = require("react");
|
|
@@ -22,11 +23,13 @@ function $parcel$export(e, n, v, s) {
|
|
|
22
23
|
$parcel$export(module.exports, "SliderContext", function () { return $30cd4abd8dfcbef7$export$e99164f0030f3bff; });
|
|
23
24
|
$parcel$export(module.exports, "SliderStateContext", function () { return $30cd4abd8dfcbef7$export$1e7083018727fa60; });
|
|
24
25
|
$parcel$export(module.exports, "SliderTrackContext", function () { return $30cd4abd8dfcbef7$export$f1fce0420cc6d8ee; });
|
|
26
|
+
$parcel$export(module.exports, "SliderFillContext", function () { return $30cd4abd8dfcbef7$export$7ed6e0ce9ec48be7; });
|
|
25
27
|
$parcel$export(module.exports, "SliderOutputContext", function () { return $30cd4abd8dfcbef7$export$6189c2744041d8f8; });
|
|
26
28
|
$parcel$export(module.exports, "Slider", function () { return $30cd4abd8dfcbef7$export$472062a354075cee; });
|
|
27
29
|
$parcel$export(module.exports, "SliderOutput", function () { return $30cd4abd8dfcbef7$export$a590f758a961cb5b; });
|
|
28
30
|
$parcel$export(module.exports, "SliderTrack", function () { return $30cd4abd8dfcbef7$export$105594979f116971; });
|
|
29
31
|
$parcel$export(module.exports, "SliderThumb", function () { return $30cd4abd8dfcbef7$export$2c1b491743890dec; });
|
|
32
|
+
$parcel$export(module.exports, "SliderFill", function () { return $30cd4abd8dfcbef7$export$2ede0a3f7b0c0db; });
|
|
30
33
|
/*
|
|
31
34
|
* Copyright 2022 Adobe. All rights reserved.
|
|
32
35
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -48,9 +51,11 @@ $parcel$export(module.exports, "SliderThumb", function () { return $30cd4abd8dfc
|
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
|
|
54
|
+
|
|
51
55
|
const $30cd4abd8dfcbef7$export$e99164f0030f3bff = /*#__PURE__*/ (0, $1Kg7x$react.createContext)(null);
|
|
52
56
|
const $30cd4abd8dfcbef7$export$1e7083018727fa60 = /*#__PURE__*/ (0, $1Kg7x$react.createContext)(null);
|
|
53
57
|
const $30cd4abd8dfcbef7$export$f1fce0420cc6d8ee = /*#__PURE__*/ (0, $1Kg7x$react.createContext)(null);
|
|
58
|
+
const $30cd4abd8dfcbef7$export$7ed6e0ce9ec48be7 = /*#__PURE__*/ (0, $1Kg7x$react.createContext)(null);
|
|
54
59
|
const $30cd4abd8dfcbef7$export$6189c2744041d8f8 = /*#__PURE__*/ (0, $1Kg7x$react.createContext)(null);
|
|
55
60
|
const $30cd4abd8dfcbef7$export$472062a354075cee = /*#__PURE__*/ (0, $1Kg7x$react.forwardRef)(function Slider(props, ref) {
|
|
56
61
|
[props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $30cd4abd8dfcbef7$export$e99164f0030f3bff);
|
|
@@ -120,7 +125,7 @@ const $30cd4abd8dfcbef7$export$a590f758a961cb5b = /*#__PURE__*/ (0, $1Kg7x$react
|
|
|
120
125
|
style: style,
|
|
121
126
|
children: children,
|
|
122
127
|
render: render,
|
|
123
|
-
defaultChildren: state.
|
|
128
|
+
defaultChildren: state.getFormattedValue(),
|
|
124
129
|
defaultClassName: 'react-aria-SliderOutput',
|
|
125
130
|
values: {
|
|
126
131
|
orientation: state.orientation,
|
|
@@ -225,6 +230,51 @@ const $30cd4abd8dfcbef7$export$2c1b491743890dec = /*#__PURE__*/ (0, $1Kg7x$react
|
|
|
225
230
|
]
|
|
226
231
|
}, renderProps.children));
|
|
227
232
|
});
|
|
233
|
+
const $30cd4abd8dfcbef7$export$2ede0a3f7b0c0db = /*#__PURE__*/ (0, $1Kg7x$react.forwardRef)(function SliderFill(props, ref) {
|
|
234
|
+
[props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $30cd4abd8dfcbef7$export$7ed6e0ce9ec48be7);
|
|
235
|
+
let state = (0, $1Kg7x$react.useContext)($30cd4abd8dfcbef7$export$1e7083018727fa60);
|
|
236
|
+
let { onHoverStart: onHoverStart, onHoverEnd: onHoverEnd, onHoverChange: onHoverChange, ...otherProps } = props;
|
|
237
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $1Kg7x$reactariauseHover.useHover)({
|
|
238
|
+
onHoverStart: onHoverStart,
|
|
239
|
+
onHoverEnd: onHoverEnd,
|
|
240
|
+
onHoverChange: onHoverChange
|
|
241
|
+
});
|
|
242
|
+
let offset = props.offset != null ? (0, $1Kg7x$reactstatelyprivateutilsnumber.clamp)(props.offset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : state.getThumbMinValue(0);
|
|
243
|
+
let start = state.values.length > 1 ? state.getThumbPercent(0) * 100 : state.getValuePercent(offset) * 100;
|
|
244
|
+
let end = state.values.length > 0 ? state.getThumbPercent(state.values.length - 1) * 100 : 0;
|
|
245
|
+
let startPercent = Math.min(start, end);
|
|
246
|
+
let endPercent = Math.max(start, end);
|
|
247
|
+
let sizePercent = Math.max(0, endPercent - startPercent);
|
|
248
|
+
let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
|
|
249
|
+
...props,
|
|
250
|
+
defaultClassName: 'react-aria-SliderFill',
|
|
251
|
+
defaultStyle: state.orientation === 'vertical' ? {
|
|
252
|
+
position: 'absolute',
|
|
253
|
+
bottom: `${startPercent}%`,
|
|
254
|
+
height: `${sizePercent}%`,
|
|
255
|
+
width: '100%'
|
|
256
|
+
} : {
|
|
257
|
+
position: 'absolute',
|
|
258
|
+
insetInlineStart: `${startPercent}%`,
|
|
259
|
+
width: `${sizePercent}%`,
|
|
260
|
+
height: '100%'
|
|
261
|
+
},
|
|
262
|
+
values: {
|
|
263
|
+
orientation: state.orientation,
|
|
264
|
+
isDisabled: state.isDisabled,
|
|
265
|
+
isHovered: isHovered,
|
|
266
|
+
state: state
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($1Kg7x$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
|
|
270
|
+
...(0, $1Kg7x$reactariamergeProps.mergeProps)(otherProps, hoverProps),
|
|
271
|
+
...renderProps,
|
|
272
|
+
ref: ref,
|
|
273
|
+
"data-hovered": isHovered || undefined,
|
|
274
|
+
"data-orientation": state.orientation || undefined,
|
|
275
|
+
"data-disabled": state.isDisabled || undefined
|
|
276
|
+
});
|
|
277
|
+
});
|
|
228
278
|
|
|
229
279
|
|
|
230
280
|
//# sourceMappingURL=Slider.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAwCM,MAAM,0DAAgB,CAAA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AE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;IAEvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;mBACN;uBACA;wBACA;uBACA;4BACA;wBACA;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,YAAY,WAAW;QAC/C,GAAG,WAAW;QACf,KAAK;QACL,OAAO;YAAC,GAAG,WAAW,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACjD,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,6CAAa,uBACZ,0DAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;uBAE9D,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;SAC/C;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Slider.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 {AriaSliderProps, AriaSliderThumbProps, useSlider, useSliderThumb} from 'react-aria/useSlider';\n\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\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 React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately/useSliderState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useNumberFormatter} from 'react-aria/useNumberFormatter';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, 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-Slider'\n */\n className?: ClassNameOrFunction<SliderRenderProps>,\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext = createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderOutputContext = createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the slider is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the slider.\n */\n state: SliderState\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<T extends number | number[]>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n trackProps,\n labelProps,\n outputProps\n } = useSlider({...props, label}, state, trackRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps extends RenderProps<SliderRenderProps, 'output'>, GlobalDOMAttributes<HTMLOutputElement> {\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-SliderOutput'\n */\n className?: ClassNameOrFunction<SliderRenderProps>\n}\ninterface SliderOutputContextValue extends Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>, SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(props: SliderOutputProps, ref: ForwardedRef<HTMLOutputElement>) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, render, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n render,\n defaultChildren: state.getThumbValueLabel(0),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <dom.output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean\n}\n\nexport interface SliderTrackProps extends HoverEvents, RenderProps<SliderTrackRenderProps>, 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-SliderTrack'\n */\n className?: ClassNameOrFunction<SliderTrackRenderProps>\n}\ninterface SliderTrackContextValue extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>, SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(props: SliderTrackProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <dom.div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined} />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState,\n /**\n * Whether this thumb is currently being dragged.\n * @selector [data-dragging]\n */\n isDragging: boolean,\n /**\n * Whether the thumb is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the thumb is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the thumb is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the thumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface SliderThumbProps extends Omit<AriaSliderThumbProps, 'label' | 'validationState'>, HoverEvents, RenderProps<SliderThumbRenderProps>, 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-SliderThumb'\n */\n className?: ClassNameOrFunction<SliderThumbRenderProps>,\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(props: SliderThumbProps, ref: ForwardedRef<HTMLDivElement>) {\n let {\n inputRef: userInputRef = null\n } = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb({\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n }, state);\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AA6DM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0DACX,CAAA,GAAA,0BAAY,EAAyD;AAChE,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DACX,CAAA,GAAA,0BAAY,EAA6D;AAwBpE,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAE1E,KAAqB,EAAE,GAAiC;IACxD,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,qDAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,gDAAa,EAAE;QAAC,GAAG,KAAK;yBAAE;IAAe;IACrD,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAAE,CAAC,K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KAAK;QACR,kBAAkB;QAClB,cACE,MAAM,WAAW,KAAK,aAClB;YACE,UAAU;YACV,QAAQ,GAAG,aAAa,CAAC,CAAC;YAC1B,QAAQ,GAAG,YAAY,CAAC,CAAC;YACzB,OAAO;QACT,IACA;YACE,UAAU;YACV,kBAAkB,GAAG,aAAa,CAAC,CAAC;YACpC,OAAO,GAAG,YAAY,CAAC,CAAC;YACxB,QAAQ;QACV;QACN,QAAQ;YACN,aAAa,MAAM,WAAW;YAC9B,YAAY,MAAM,UAAU;uBAC5B;mBACA;QACF;IACF;IAEA,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;QACrC,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,oBAAkB,MAAM,WAAW,IAAI;QACvC,iBAAe,MAAM,UAAU,IAAI;;AAGzC","sources":["packages/react-aria-components/src/Slider.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 AriaSliderProps,\n AriaSliderThumbProps,\n useSlider,\n useSliderThumb\n} from 'react-aria/useSlider';\n\nimport {clamp} from 'react-stately/private/utils/number';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\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 React, {\n createContext,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n OutputHTMLAttributes,\n useContext,\n useRef\n} from 'react';\nimport {SliderState, useSliderState} from 'react-stately/useSliderState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useNumberFormatter} from 'react-aria/useNumberFormatter';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface SliderProps<T = number | number[]>\n extends\n Omit<AriaSliderProps<T>, 'label'>,\n RenderProps<SliderRenderProps>,\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-Slider'\n */\n className?: ClassNameOrFunction<SliderRenderProps>;\n /**\n * The display format of the value label.\n */\n formatOptions?: Intl.NumberFormatOptions;\n}\n\nexport const SliderContext = createContext<ContextValue<SliderProps, HTMLDivElement>>(null);\nexport const SliderStateContext = createContext<SliderState | null>(null);\nexport const SliderTrackContext =\n createContext<ContextValue<SliderTrackContextValue, HTMLDivElement>>(null);\nexport const SliderFillContext = createContext<ContextValue<SliderFillProps, HTMLDivElement>>(null);\nexport const SliderOutputContext =\n createContext<ContextValue<SliderOutputContextValue, HTMLOutputElement>>(null);\n\nexport interface SliderRenderProps {\n /**\n * The orientation of the slider.\n *\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation;\n /**\n * Whether the slider is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * State of the slider.\n */\n state: SliderState;\n}\n\n/**\n * A slider allows a user to select one or more values within a range.\n */\nexport const Slider = /*#__PURE__*/ (forwardRef as forwardRefType)(function Slider<\n T extends number | number[]\n>(props: SliderProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, SliderContext);\n let trackRef = useRef<HTMLDivElement>(null);\n let numberFormatter = useNumberFormatter(props.formatOptions);\n let state = useSliderState({...props, numberFormatter});\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {groupProps, trackProps, labelProps, outputProps} = useSlider(\n {...props, label},\n state,\n trackRef\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-Slider'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [SliderStateContext, state],\n [SliderTrackContext, {...trackProps, ref: trackRef}],\n [SliderOutputContext, outputProps],\n [LabelContext, {...labelProps, ref: labelRef}]\n ]}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={state.orientation}\n data-disabled={state.isDisabled || undefined}\n />\n </Provider>\n );\n});\n\nexport interface SliderOutputProps\n extends RenderProps<SliderRenderProps, 'output'>, GlobalDOMAttributes<HTMLOutputElement> {\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-SliderOutput'\n */\n className?: ClassNameOrFunction<SliderRenderProps>;\n}\ninterface SliderOutputContextValue\n extends\n Omit<OutputHTMLAttributes<HTMLOutputElement>, 'children' | 'className' | 'style'>,\n SliderOutputProps {}\n\n/**\n * A slider output displays the current value of a slider as text.\n */\nexport const SliderOutput = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderOutput(\n props: SliderOutputProps,\n ref: ForwardedRef<HTMLOutputElement>\n) {\n [props, ref] = useContextProps(props, ref, SliderOutputContext);\n let {children, style, className, render, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\n render,\n defaultChildren: state.getFormattedValue(),\n defaultClassName: 'react-aria-SliderOutput',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n state\n }\n });\n\n return (\n <dom.output\n {...otherProps}\n {...renderProps}\n ref={ref}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined}\n />\n );\n});\n\nexport interface SliderTrackRenderProps extends SliderRenderProps {\n /**\n * Whether the slider track is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n}\n\nexport interface SliderTrackProps\n extends HoverEvents, RenderProps<SliderTrackRenderProps>, 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-SliderTrack'\n */\n className?: ClassNameOrFunction<SliderTrackRenderProps>;\n}\ninterface SliderTrackContextValue\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>,\n SliderTrackProps {}\n\n/**\n * A slider track is a container for one or more slider thumbs.\n */\nexport const SliderTrack = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderTrack(\n props: SliderTrackProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, SliderTrackContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderTrack',\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <dom.div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined}\n />\n );\n});\n\nexport interface SliderThumbRenderProps {\n /**\n * State of the slider.\n */\n state: SliderState;\n /**\n * Whether this thumb is currently being dragged.\n *\n * @selector [data-dragging]\n */\n isDragging: boolean;\n /**\n * Whether the thumb is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the thumb is currently focused.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the thumb is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the thumb is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n}\n\nexport interface SliderThumbProps\n extends\n Omit<AriaSliderThumbProps, 'label' | 'validationState'>,\n HoverEvents,\n RenderProps<SliderThumbRenderProps>,\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-SliderThumb'\n */\n className?: ClassNameOrFunction<SliderThumbRenderProps>;\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>;\n}\n\n/**\n * A slider thumb represents an individual value that the user can adjust within a slider track.\n */\nexport const SliderThumb = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderThumb(\n props: SliderThumbProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n let {inputRef: userInputRef = null} = props;\n let state = useContext(SliderStateContext)!;\n let {ref: trackRef} = useSlottedContext(SliderTrackContext)!;\n let {index = 0} = props;\n let defaultInputRef = useRef<HTMLInputElement>(null);\n let inputRef = userInputRef || defaultInputRef;\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n let {thumbProps, inputProps, labelProps, isDragging, isFocused, isDisabled} = useSliderThumb(\n {\n ...props,\n index,\n trackRef: trackRef as RefObject<HTMLDivElement | null>,\n inputRef,\n label\n },\n state\n );\n\n let {focusProps, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover(props);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderThumb',\n values: {\n state,\n isHovered,\n isDragging,\n isFocused,\n isFocusVisible,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <dom.div\n {...mergeProps(DOMProps, thumbProps, hoverProps)}\n {...renderProps}\n ref={ref}\n style={{...thumbProps.style, ...renderProps.style}}\n data-hovered={isHovered || undefined}\n data-dragging={isDragging || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}>\n <VisuallyHidden>\n <input ref={inputRef} {...mergeProps(inputProps, focusProps)} />\n </VisuallyHidden>\n <Provider values={[[LabelContext, {...labelProps, ref: labelRef}]]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\nexport interface SliderFillRenderProps extends SliderRenderProps {\n /**\n * Whether the slider fill is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n}\n\nexport interface SliderFillProps\n extends HoverEvents, RenderProps<SliderFillRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The offset from which to start the fill.\n *\n * @default 0\n */\n offset?: number;\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-SliderFill'\n */\n className?: ClassNameOrFunction<SliderFillRenderProps>;\n}\n\n/**\n * Displays the selected range.\n */\nexport const SliderFill = /*#__PURE__*/ (forwardRef as forwardRefType)(function SliderFill(\n props: SliderFillProps,\n ref: ForwardedRef<HTMLDivElement>\n) {\n [props, ref] = useContextProps(props, ref, SliderFillContext);\n let state = useContext(SliderStateContext)!;\n let {onHoverStart, onHoverEnd, onHoverChange, ...otherProps} = props;\n let {hoverProps, isHovered} = useHover({onHoverStart, onHoverEnd, onHoverChange});\n\n let offset =\n props.offset != null\n ? clamp(props.offset, state.getThumbMinValue(0), state.getThumbMaxValue(0))\n : state.getThumbMinValue(0);\n let start =\n state.values.length > 1 ? state.getThumbPercent(0) * 100 : state.getValuePercent(offset) * 100;\n let end = state.values.length > 0 ? state.getThumbPercent(state.values.length - 1) * 100 : 0;\n let startPercent = Math.min(start, end);\n let endPercent = Math.max(start, end);\n let sizePercent = Math.max(0, endPercent - startPercent);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-SliderFill',\n defaultStyle:\n state.orientation === 'vertical'\n ? {\n position: 'absolute',\n bottom: `${startPercent}%`,\n height: `${sizePercent}%`,\n width: '100%'\n }\n : {\n position: 'absolute',\n insetInlineStart: `${startPercent}%`,\n width: `${sizePercent}%`,\n height: '100%'\n },\n values: {\n orientation: state.orientation,\n isDisabled: state.isDisabled,\n isHovered,\n state\n }\n });\n\n return (\n <dom.div\n {...mergeProps(otherProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-hovered={isHovered || undefined}\n data-orientation={state.orientation || undefined}\n data-disabled={state.isDisabled || undefined}\n />\n );\n});\n"],"names":[],"version":3,"file":"Slider.cjs.map"}
|