react-aria-components 1.13.0 → 1.15.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/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Breadcrumbs.main.js +8 -5
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +8 -5
- package/dist/Breadcrumbs.module.js +8 -5
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +1 -1
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +2 -2
- package/dist/Button.module.js +2 -2
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +13 -9
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +14 -10
- package/dist/Calendar.module.js +14 -10
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +2 -2
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +3 -3
- package/dist/Checkbox.module.js +3 -3
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.mjs +1 -1
- package/dist/Collection.module.js +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +2 -2
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +2 -2
- package/dist/ColorArea.module.js +2 -2
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +8 -4
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +8 -4
- package/dist/ColorField.module.js +8 -4
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorPicker.main.js +1 -1
- package/dist/ColorPicker.main.js.map +1 -1
- package/dist/ColorPicker.mjs +1 -1
- package/dist/ColorPicker.module.js +1 -1
- package/dist/ColorPicker.module.js.map +1 -1
- package/dist/ColorSlider.main.js +2 -2
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +2 -2
- package/dist/ColorSlider.module.js +2 -2
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +1 -1
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +2 -2
- package/dist/ColorSwatch.module.js +2 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +3 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +3 -1
- package/dist/ColorSwatchPicker.module.js +3 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +1 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +2 -2
- package/dist/ColorThumb.module.js +2 -2
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -3
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -3
- package/dist/ColorWheel.module.js +3 -3
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +2 -2
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +3 -3
- package/dist/ComboBox.module.js +3 -3
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +6 -4
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +7 -5
- package/dist/DateField.module.js +7 -5
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +2 -2
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +3 -3
- package/dist/DatePicker.module.js +3 -3
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +2 -1
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +3 -2
- package/dist/Dialog.module.js +3 -2
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +5 -4
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +6 -5
- package/dist/Disclosure.module.js +6 -5
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +2 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -5
- package/dist/DropZone.module.js +4 -5
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +1 -0
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +1 -0
- package/dist/FileTrigger.module.js +1 -0
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.mjs +2 -2
- package/dist/Form.module.js +2 -2
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +17 -14
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +17 -14
- package/dist/GridList.module.js +17 -14
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +3 -3
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +4 -4
- package/dist/Group.module.js +4 -4
- package/dist/Group.module.js.map +1 -1
- package/dist/Header.main.js +1 -1
- package/dist/Header.main.js.map +1 -1
- package/dist/Header.mjs +2 -2
- package/dist/Header.module.js +2 -2
- package/dist/Header.module.js.map +1 -1
- package/dist/Heading.main.js +2 -2
- package/dist/Heading.main.js.map +1 -1
- package/dist/Heading.mjs +2 -2
- package/dist/Heading.module.js +2 -2
- package/dist/Heading.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +10 -4
- package/dist/HiddenDateInput.main.js.map +1 -1
- package/dist/HiddenDateInput.mjs +11 -5
- package/dist/HiddenDateInput.module.js +11 -5
- package/dist/HiddenDateInput.module.js.map +1 -1
- package/dist/Input.main.js +5 -2
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +6 -3
- package/dist/Input.module.js +6 -3
- package/dist/Input.module.js.map +1 -1
- package/dist/Keyboard.main.js +1 -1
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.mjs +2 -2
- package/dist/Keyboard.module.js +2 -2
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/Label.main.js +2 -1
- package/dist/Label.main.js.map +1 -1
- package/dist/Label.mjs +3 -2
- package/dist/Label.module.js +3 -2
- package/dist/Label.module.js.map +1 -1
- package/dist/Link.main.js +3 -2
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +4 -3
- package/dist/Link.module.js +4 -3
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +18 -16
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +19 -17
- package/dist/ListBox.module.js +19 -17
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +22 -9
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +22 -9
- package/dist/Menu.module.js +22 -9
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +1 -1
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +2 -2
- package/dist/Meter.module.js +2 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +2 -2
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +3 -3
- package/dist/Modal.module.js +3 -3
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +1 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +2 -2
- package/dist/NumberField.module.js +2 -2
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +1 -1
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +2 -2
- package/dist/OverlayArrow.module.js +2 -2
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +2 -2
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +4 -4
- package/dist/Popover.module.js +4 -4
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +1 -1
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +2 -2
- package/dist/ProgressBar.module.js +2 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +2 -2
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +3 -3
- package/dist/RadioGroup.module.js +3 -3
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +6 -2
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +7 -3
- package/dist/SearchField.module.js +7 -3
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +2 -2
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +3 -3
- package/dist/Select.module.js +3 -3
- package/dist/Select.module.js.map +1 -1
- package/dist/SelectionIndicator.main.js.map +1 -1
- package/dist/SelectionIndicator.module.js.map +1 -1
- package/dist/Separator.main.js +3 -1
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +4 -2
- package/dist/Separator.module.js +4 -2
- package/dist/Separator.module.js.map +1 -1
- package/dist/SharedElementTransition.main.js +3 -2
- package/dist/SharedElementTransition.main.js.map +1 -1
- package/dist/SharedElementTransition.mjs +4 -3
- package/dist/SharedElementTransition.module.js +4 -3
- package/dist/SharedElementTransition.module.js.map +1 -1
- package/dist/Slider.main.js +6 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +7 -6
- package/dist/Slider.module.js +7 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +1 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +2 -2
- package/dist/Switch.module.js +2 -2
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +139 -50
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +139 -50
- package/dist/Table.module.js +139 -50
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +86 -10
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +88 -13
- package/dist/Tabs.module.js +88 -13
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +7 -6
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +7 -6
- package/dist/TagGroup.module.js +7 -6
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/Text.main.js +2 -1
- package/dist/Text.main.js.map +1 -1
- package/dist/Text.mjs +3 -2
- package/dist/Text.module.js +3 -2
- package/dist/Text.module.js.map +1 -1
- package/dist/TextArea.main.js +1 -1
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.mjs +2 -2
- package/dist/TextArea.module.js +2 -2
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +1 -1
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +2 -2
- package/dist/TextField.module.js +2 -2
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +6 -4
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +7 -5
- package/dist/Toast.module.js +7 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +5 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +6 -3
- package/dist/ToggleButton.module.js +6 -3
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +2 -1
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +3 -2
- package/dist/ToggleButtonGroup.module.js +3 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +1 -1
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +2 -2
- package/dist/Toolbar.module.js +2 -2
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +1 -1
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +2 -2
- package/dist/Tooltip.module.js +2 -2
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +6 -6
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +7 -7
- package/dist/Tree.module.js +7 -7
- package/dist/Tree.module.js.map +1 -1
- package/dist/import.mjs +4 -4
- package/dist/main.js +5 -0
- package/dist/main.js.map +1 -1
- package/dist/module.js +4 -4
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +679 -90
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +41 -4
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +42 -6
- package/dist/utils.module.js +42 -6
- package/dist/utils.module.js.map +1 -1
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/index.js +67 -67
- package/i18n/index.mjs +67 -67
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +26 -26
- package/src/Autocomplete.tsx +1 -1
- package/src/Breadcrumbs.tsx +32 -10
- package/src/Button.tsx +10 -3
- package/src/Calendar.tsx +76 -25
- package/src/Checkbox.tsx +31 -7
- package/src/Collection.tsx +1 -1
- package/src/ColorArea.tsx +18 -4
- package/src/ColorField.tsx +34 -4
- package/src/ColorPicker.tsx +5 -2
- package/src/ColorSlider.tsx +18 -3
- package/src/ColorSwatch.tsx +17 -3
- package/src/ColorSwatchPicker.tsx +20 -1
- package/src/ColorThumb.tsx +10 -4
- package/src/ColorWheel.tsx +28 -6
- package/src/ComboBox.tsx +21 -3
- package/src/DateField.tsx +45 -9
- package/src/DatePicker.tsx +30 -5
- package/src/Dialog.tsx +10 -4
- package/src/Disclosure.tsx +37 -11
- package/src/DragAndDrop.tsx +8 -2
- package/src/DropZone.tsx +21 -7
- package/src/FieldError.tsx +8 -2
- package/src/FileTrigger.tsx +1 -0
- package/src/Form.tsx +9 -4
- package/src/GridList.tsx +63 -24
- package/src/Group.tsx +33 -21
- package/src/Header.tsx +7 -5
- package/src/Heading.tsx +4 -4
- package/src/HiddenDateInput.tsx +16 -7
- package/src/Input.tsx +24 -9
- package/src/Keyboard.tsx +4 -2
- package/src/Label.tsx +4 -3
- package/src/Link.tsx +23 -7
- package/src/ListBox.tsx +66 -26
- package/src/Menu.tsx +60 -17
- package/src/Meter.tsx +19 -4
- package/src/Modal.tsx +24 -5
- package/src/NumberField.tsx +22 -3
- package/src/OverlayArrow.tsx +16 -3
- package/src/Popover.tsx +18 -5
- package/src/ProgressBar.tsx +19 -4
- package/src/RadioGroup.tsx +31 -7
- package/src/SearchField.tsx +38 -5
- package/src/Select.tsx +30 -6
- package/src/SelectionIndicator.tsx +8 -2
- package/src/Separator.tsx +17 -5
- package/src/SharedElementTransition.tsx +4 -3
- package/src/Slider.tsx +43 -9
- package/src/Switch.tsx +22 -8
- package/src/Table.tsx +217 -86
- package/src/Tabs.tsx +165 -23
- package/src/TagGroup.tsx +44 -14
- package/src/Text.tsx +4 -3
- package/src/TextArea.tsx +16 -3
- package/src/TextField.tsx +23 -4
- package/src/Toast.tsx +37 -13
- package/src/ToggleButton.tsx +18 -5
- package/src/ToggleButtonGroup.tsx +25 -5
- package/src/Toolbar.tsx +16 -3
- package/src/Tooltip.tsx +16 -3
- package/src/Tree.tsx +66 -36
- package/src/index.ts +7 -7
- package/src/utils.tsx +98 -13
|
@@ -1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AAEpB","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';\nimport {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, DOMRenderProps<'hr' | 'div', undefined>, GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\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(collection: BaseCollection<any>, newCollection: BaseCollection<any>): 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 sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, 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"],"names":[],"version":3,"file":"Separator.main.js.map"}
|
package/dist/Separator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.mjs";
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.mjs";
|
|
2
2
|
import {useSeparator as $i9JCE$useSeparator} from "react-aria";
|
|
3
3
|
import {CollectionNode as $i9JCE$CollectionNode, createLeafComponent as $i9JCE$createLeafComponent} from "@react-aria/collections";
|
|
4
4
|
import {filterDOMProps as $i9JCE$filterDOMProps, mergeProps as $i9JCE$mergeProps} from "@react-aria/utils";
|
|
@@ -37,6 +37,7 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
|
|
|
37
37
|
let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
|
|
38
38
|
let Element = elementType || 'hr';
|
|
39
39
|
if (Element === 'hr' && orientation === 'vertical') Element = 'div';
|
|
40
|
+
let ElementType = (0, $64fa3d84918910a7$export$df3a06d6289f983e)[Element];
|
|
40
41
|
let { separatorProps: separatorProps } = (0, $i9JCE$useSeparator)({
|
|
41
42
|
...otherProps,
|
|
42
43
|
elementType: elementType,
|
|
@@ -45,7 +46,8 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
|
|
|
45
46
|
let DOMProps = (0, $i9JCE$filterDOMProps)(props, {
|
|
46
47
|
global: true
|
|
47
48
|
});
|
|
48
|
-
return /*#__PURE__*/ (0, $i9JCE$react).createElement(
|
|
49
|
+
return /*#__PURE__*/ (0, $i9JCE$react).createElement(ElementType, {
|
|
50
|
+
render: props.render,
|
|
49
51
|
...(0, $i9JCE$mergeProps)(DOMProps, separatorProps),
|
|
50
52
|
style: style,
|
|
51
53
|
className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
|
package/dist/Separator.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.module.js";
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415} from "./utils.module.js";
|
|
2
2
|
import {useSeparator as $i9JCE$useSeparator} from "react-aria";
|
|
3
3
|
import {CollectionNode as $i9JCE$CollectionNode, createLeafComponent as $i9JCE$createLeafComponent} from "@react-aria/collections";
|
|
4
4
|
import {filterDOMProps as $i9JCE$filterDOMProps, mergeProps as $i9JCE$mergeProps} from "@react-aria/utils";
|
|
@@ -37,6 +37,7 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
|
|
|
37
37
|
let { elementType: elementType, orientation: orientation, style: style, className: className, slot: slot, ...otherProps } = props;
|
|
38
38
|
let Element = elementType || 'hr';
|
|
39
39
|
if (Element === 'hr' && orientation === 'vertical') Element = 'div';
|
|
40
|
+
let ElementType = (0, $64fa3d84918910a7$export$df3a06d6289f983e)[Element];
|
|
40
41
|
let { separatorProps: separatorProps } = (0, $i9JCE$useSeparator)({
|
|
41
42
|
...otherProps,
|
|
42
43
|
elementType: elementType,
|
|
@@ -45,7 +46,8 @@ const $431f98aba6844401$export$1ff3c3f08ae963c0 = /*#__PURE__*/ (0, $i9JCE$creat
|
|
|
45
46
|
let DOMProps = (0, $i9JCE$filterDOMProps)(props, {
|
|
46
47
|
global: true
|
|
47
48
|
});
|
|
48
|
-
return /*#__PURE__*/ (0, $i9JCE$react).createElement(
|
|
49
|
+
return /*#__PURE__*/ (0, $i9JCE$react).createElement(ElementType, {
|
|
50
|
+
render: props.render,
|
|
49
51
|
...(0, $i9JCE$mergeProps)(DOMProps, separatorProps),
|
|
50
52
|
style: style,
|
|
51
53
|
className: className !== null && className !== void 0 ? className : 'react-aria-Separator',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA6C,CAAC;AAEnF,MAAM,kDAAsB,CAAA,GAAA,qBAAa;IAG9C,OAAO,UAA+B,EAAE,aAAkC,EAA8B;QACtG,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;AAba,0CACK,OAAO;AAiBlB,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,2CAAe,SAAS,UAAU,KAAqB,EAAE,GAA8B;IAChJ,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;;AAEpB","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';\nimport {BaseCollection, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {ContextValue, dom, DOMRenderProps, SlotProps, StyleProps, useContextProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ForwardedRef} from 'react';\n\nexport interface SeparatorProps extends AriaSeparatorProps, StyleProps, SlotProps, DOMRenderProps<'hr' | 'div', undefined>, GlobalDOMAttributes<HTMLElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\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(collection: BaseCollection<any>, newCollection: BaseCollection<any>): 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 sections of a page.\n */\nexport const Separator = /*#__PURE__*/ createLeafComponent(SeparatorNode, 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"],"names":[],"version":3,"file":"Separator.module.js.map"}
|
|
@@ -38,7 +38,7 @@ function $2d10bc562fea46b3$export$758399f318e6385a(props) {
|
|
|
38
38
|
}, props.children);
|
|
39
39
|
}
|
|
40
40
|
const $2d10bc562fea46b3$export$c34620ff8881d89f = /*#__PURE__*/ (0, $aakJU$react.forwardRef)(function SharedElement(props, ref) {
|
|
41
|
-
let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, ...divProps } = props;
|
|
41
|
+
let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, render: render, ...divProps } = props;
|
|
42
42
|
let [state, setState] = (0, $aakJU$react.useState)(isVisible ? 'visible' : 'hidden');
|
|
43
43
|
let scopeRef = (0, $aakJU$react.useContext)($2d10bc562fea46b3$var$SharedElementContext);
|
|
44
44
|
if (!scopeRef) throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');
|
|
@@ -120,13 +120,14 @@ const $2d10bc562fea46b3$export$c34620ff8881d89f = /*#__PURE__*/ (0, $aakJU$react
|
|
|
120
120
|
children: children,
|
|
121
121
|
className: className,
|
|
122
122
|
style: style,
|
|
123
|
+
render: render,
|
|
123
124
|
values: {
|
|
124
125
|
isEntering: state === 'entering',
|
|
125
126
|
isExiting: state === 'exiting'
|
|
126
127
|
}
|
|
127
128
|
});
|
|
128
129
|
if (state === 'hidden') return null;
|
|
129
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($aakJU$react))).createElement(
|
|
130
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($aakJU$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
|
|
130
131
|
...divProps,
|
|
131
132
|
...renderProps,
|
|
132
133
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAaD,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;OACnC,MAAM,QAAQ;AAGrB;AAyBO,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAAiC;IACzH,IAAI,QAAC,IAAI,aAAE,YAAY,gBAAM,QAAQ,aAAE,SAAS,SAAE,KAAK,EAAE,GAAG,UAAS,GAAG;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAaD,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;OACnC,MAAM,QAAQ;AAGrB;AAyBO,MAAM,0DAAgB,CAAA,GAAA,uBAAS,EAAE,SAAS,cAAc,KAAyB,EAAE,GAAiC;IACzH,IAAI,QAAC,IAAI,aAAE,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W,UAAU;QACvB;IACF;IAEA,IAAI,UAAU,UACZ,OAAO;IAGT,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,UAAU,cAAc;QACvC,gBAAc,UAAU,aAAa;;AAE3C","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, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactNode, RefObject, useContext, useRef, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useObjectRef} from 'react-aria';\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}>\n {props.children}\n </SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n /**\n * Whether the element is currently entering.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the element is currently exiting.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\nexport interface SharedElementPropsBase extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>, 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(props: SharedElementProps, ref: ForwardedRef<HTMLDivElement>) {\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"],"names":[],"version":3,"file":"SharedElementTransition.main.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
2
|
import {flushSync as $I3GNx$flushSync} from "react-dom";
|
|
3
3
|
import $I3GNx$react, {createContext as $I3GNx$createContext, useRef as $I3GNx$useRef, forwardRef as $I3GNx$forwardRef, useState as $I3GNx$useState, useContext as $I3GNx$useContext} from "react";
|
|
4
4
|
import {useLayoutEffect as $I3GNx$useLayoutEffect} from "@react-aria/utils";
|
|
@@ -27,7 +27,7 @@ function $c8a5a149f625efcf$export$758399f318e6385a(props) {
|
|
|
27
27
|
}, props.children);
|
|
28
28
|
}
|
|
29
29
|
const $c8a5a149f625efcf$export$c34620ff8881d89f = /*#__PURE__*/ (0, $I3GNx$forwardRef)(function SharedElement(props, ref) {
|
|
30
|
-
let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, ...divProps } = props;
|
|
30
|
+
let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, render: render, ...divProps } = props;
|
|
31
31
|
let [state, setState] = (0, $I3GNx$useState)(isVisible ? 'visible' : 'hidden');
|
|
32
32
|
let scopeRef = (0, $I3GNx$useContext)($c8a5a149f625efcf$var$SharedElementContext);
|
|
33
33
|
if (!scopeRef) throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');
|
|
@@ -109,13 +109,14 @@ const $c8a5a149f625efcf$export$c34620ff8881d89f = /*#__PURE__*/ (0, $I3GNx$forwa
|
|
|
109
109
|
children: children,
|
|
110
110
|
className: className,
|
|
111
111
|
style: style,
|
|
112
|
+
render: render,
|
|
112
113
|
values: {
|
|
113
114
|
isEntering: state === 'entering',
|
|
114
115
|
isExiting: state === 'exiting'
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
if (state === 'hidden') return null;
|
|
118
|
-
return /*#__PURE__*/ (0, $I3GNx$react).createElement(
|
|
119
|
+
return /*#__PURE__*/ (0, $I3GNx$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
119
120
|
...divProps,
|
|
120
121
|
...renderProps,
|
|
121
122
|
ref: ref,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
2
|
import {flushSync as $I3GNx$flushSync} from "react-dom";
|
|
3
3
|
import $I3GNx$react, {createContext as $I3GNx$createContext, useRef as $I3GNx$useRef, forwardRef as $I3GNx$forwardRef, useState as $I3GNx$useState, useContext as $I3GNx$useContext} from "react";
|
|
4
4
|
import {useLayoutEffect as $I3GNx$useLayoutEffect} from "@react-aria/utils";
|
|
@@ -27,7 +27,7 @@ function $c8a5a149f625efcf$export$758399f318e6385a(props) {
|
|
|
27
27
|
}, props.children);
|
|
28
28
|
}
|
|
29
29
|
const $c8a5a149f625efcf$export$c34620ff8881d89f = /*#__PURE__*/ (0, $I3GNx$forwardRef)(function SharedElement(props, ref) {
|
|
30
|
-
let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, ...divProps } = props;
|
|
30
|
+
let { name: name, isVisible: isVisible = true, children: children, className: className, style: style, render: render, ...divProps } = props;
|
|
31
31
|
let [state, setState] = (0, $I3GNx$useState)(isVisible ? 'visible' : 'hidden');
|
|
32
32
|
let scopeRef = (0, $I3GNx$useContext)($c8a5a149f625efcf$var$SharedElementContext);
|
|
33
33
|
if (!scopeRef) throw new Error('<SharedElement> must be rendered inside a <SharedElementTransition>');
|
|
@@ -109,13 +109,14 @@ const $c8a5a149f625efcf$export$c34620ff8881d89f = /*#__PURE__*/ (0, $I3GNx$forwa
|
|
|
109
109
|
children: children,
|
|
110
110
|
className: className,
|
|
111
111
|
style: style,
|
|
112
|
+
render: render,
|
|
112
113
|
values: {
|
|
113
114
|
isEntering: state === 'entering',
|
|
114
115
|
isExiting: state === 'exiting'
|
|
115
116
|
}
|
|
116
117
|
});
|
|
117
118
|
if (state === 'hidden') return null;
|
|
118
|
-
return /*#__PURE__*/ (0, $I3GNx$react).createElement(
|
|
119
|
+
return /*#__PURE__*/ (0, $I3GNx$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
119
120
|
...divProps,
|
|
120
121
|
...renderProps,
|
|
121
122
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAaD,MAAM,2DAAuB,CAAA,GAAA,oBAAY,EAAgD;AASlF,SAAS,0CAAwB,KAAmC;IACzE,IAAI,MAAM,CAAA,GAAA,aAAK,EAAE,CAAC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,sDAAsD;YACtD,SAAS;QAEb;QAGF,OAAO;YACL,IAAI,SAAS,MACX,qBAAqB;YAGvB,IAAI,WAAW,QAAQ,WAAW,IAAI,CAAC,QAAQ,YAAY,CAAC,iBAAiB;gBAC3E,iGAAiG;gBACjG,IAAI,QAAQ,OAAO,gBAAgB,CAAC;gBACpC,IAAI,MAAM,kBAAkB,KAAK,QAAQ;oBACvC,IAAI,qBAAqB,MAAM,kBAAkB,CAAC,KAAK,CAAC;oBACxD,KAAK,CAAC,KAAK,GAAG;wBACZ,MAAM,QAAQ,qBAAqB;wBACnC,OAAO,mBAAmB,GAAG,CAAC,CAAA,IAAK;gCAAC;gCAAG,KAAK,CAAC,EAAE;6BAAC;oBAClD;gBACF;YACF;QACF;IACF,GAAG;QAAC;QAAK;QAAU;QAAM;KAAU;IAEnC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;kBAC/B;mBACA;eACA;gBACA;QACA,QAAQ;YACN,YAAY,UAAU;YACtB,WAAW,UAAU;QACvB;IACF;IAEA,IAAI,UAAU,UACZ,OAAO;IAGT,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QACL,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,UAAU,cAAc;QACvC,gBAAc,UAAU,aAAa;;AAE3C","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, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactNode, RefObject, useContext, useRef, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useObjectRef} from 'react-aria';\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}>\n {props.children}\n </SharedElementContext.Provider>\n );\n}\n\nexport interface SharedElementRenderProps {\n /**\n * Whether the element is currently entering.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the element is currently exiting.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\nexport interface SharedElementPropsBase extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className' | 'style'>, 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(props: SharedElementProps, ref: ForwardedRef<HTMLDivElement>) {\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"],"names":[],"version":3,"file":"SharedElementTransition.module.js.map"}
|
package/dist/Slider.main.js
CHANGED
|
@@ -93,7 +93,7 @@ const $b7152ce4839d0838$export$472062a354075cee = /*#__PURE__*/ (0, $e0QX4$react
|
|
|
93
93
|
}
|
|
94
94
|
]
|
|
95
95
|
]
|
|
96
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement(
|
|
96
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
|
|
97
97
|
...(0, $e0QX4$reactaria.mergeProps)(DOMProps, renderProps, groupProps),
|
|
98
98
|
ref: ref,
|
|
99
99
|
slot: props.slot || undefined,
|
|
@@ -103,12 +103,13 @@ const $b7152ce4839d0838$export$472062a354075cee = /*#__PURE__*/ (0, $e0QX4$react
|
|
|
103
103
|
});
|
|
104
104
|
const $b7152ce4839d0838$export$a590f758a961cb5b = /*#__PURE__*/ (0, $e0QX4$react.forwardRef)(function SliderOutput(props, ref) {
|
|
105
105
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $b7152ce4839d0838$export$6189c2744041d8f8);
|
|
106
|
-
let { children: children, style: style, className: className, ...otherProps } = props;
|
|
106
|
+
let { children: children, style: style, className: className, render: render, ...otherProps } = props;
|
|
107
107
|
let state = (0, $e0QX4$react.useContext)($b7152ce4839d0838$export$1e7083018727fa60);
|
|
108
108
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
109
109
|
className: className,
|
|
110
110
|
style: style,
|
|
111
111
|
children: children,
|
|
112
|
+
render: render,
|
|
112
113
|
defaultChildren: state.getThumbValueLabel(0),
|
|
113
114
|
defaultClassName: 'react-aria-SliderOutput',
|
|
114
115
|
values: {
|
|
@@ -117,7 +118,7 @@ const $b7152ce4839d0838$export$a590f758a961cb5b = /*#__PURE__*/ (0, $e0QX4$react
|
|
|
117
118
|
state: state
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement(
|
|
121
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement((0, $c5ccf687772c0422$exports.dom).output, {
|
|
121
122
|
...otherProps,
|
|
122
123
|
...renderProps,
|
|
123
124
|
ref: ref,
|
|
@@ -144,7 +145,7 @@ const $b7152ce4839d0838$export$105594979f116971 = /*#__PURE__*/ (0, $e0QX4$react
|
|
|
144
145
|
state: state
|
|
145
146
|
}
|
|
146
147
|
});
|
|
147
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement(
|
|
148
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
|
|
148
149
|
...(0, $e0QX4$reactaria.mergeProps)(otherProps, hoverProps),
|
|
149
150
|
...renderProps,
|
|
150
151
|
ref: ref,
|
|
@@ -186,7 +187,7 @@ const $b7152ce4839d0838$export$2c1b491743890dec = /*#__PURE__*/ (0, $e0QX4$react
|
|
|
186
187
|
global: true
|
|
187
188
|
});
|
|
188
189
|
delete DOMProps.id;
|
|
189
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement(
|
|
190
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($e0QX4$react))).createElement((0, $c5ccf687772c0422$exports.dom).div, {
|
|
190
191
|
...(0, $e0QX4$reactaria.mergeProps)(DOMProps, thumbProps, hoverProps),
|
|
191
192
|
...renderProps,
|
|
192
193
|
ref: ref,
|
package/dist/Slider.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0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AW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,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,+BAAa,uBACZ,0DAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,2BAAS,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, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\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 <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>, GlobalDOMAttributes<HTMLOutputElement> {}\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, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\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 <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> {}\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 <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 * 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 <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 </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiCM,MAAM,0DAAgB,CAAA,GAAA,0BAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,mC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,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,+BAAa,uBACZ,0DAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,2BAAS,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, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\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/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\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.main.js.map"}
|
package/dist/Slider.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
2
2
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.mjs";
|
|
3
3
|
import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, mergeProps as $6YMke$mergeProps, useHover as $6YMke$useHover, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
|
|
4
4
|
import {filterDOMProps as $6YMke$filterDOMProps} from "@react-aria/utils";
|
|
@@ -76,7 +76,7 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
]
|
|
79
|
-
}, /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
79
|
+
}, /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
80
80
|
...(0, $6YMke$mergeProps)(DOMProps, renderProps, groupProps),
|
|
81
81
|
ref: ref,
|
|
82
82
|
slot: props.slot || undefined,
|
|
@@ -86,12 +86,13 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
86
86
|
});
|
|
87
87
|
const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderOutput(props, ref) {
|
|
88
88
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$6189c2744041d8f8);
|
|
89
|
-
let { children: children, style: style, className: className, ...otherProps } = props;
|
|
89
|
+
let { children: children, style: style, className: className, render: render, ...otherProps } = props;
|
|
90
90
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
91
91
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
92
92
|
className: className,
|
|
93
93
|
style: style,
|
|
94
94
|
children: children,
|
|
95
|
+
render: render,
|
|
95
96
|
defaultChildren: state.getThumbValueLabel(0),
|
|
96
97
|
defaultClassName: 'react-aria-SliderOutput',
|
|
97
98
|
values: {
|
|
@@ -100,7 +101,7 @@ const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
100
101
|
state: state
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
|
-
return /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
104
|
+
return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).output, {
|
|
104
105
|
...otherProps,
|
|
105
106
|
...renderProps,
|
|
106
107
|
ref: ref,
|
|
@@ -127,7 +128,7 @@ const $6f909507e6374d18$export$105594979f116971 = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
127
128
|
state: state
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
|
-
return /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
131
|
+
return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
131
132
|
...(0, $6YMke$mergeProps)(otherProps, hoverProps),
|
|
132
133
|
...renderProps,
|
|
133
134
|
ref: ref,
|
|
@@ -169,7 +170,7 @@ const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
169
170
|
global: true
|
|
170
171
|
});
|
|
171
172
|
delete DOMProps.id;
|
|
172
|
-
return /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
173
|
+
return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
173
174
|
...(0, $6YMke$mergeProps)(DOMProps, thumbProps, hoverProps),
|
|
174
175
|
...renderProps,
|
|
175
176
|
ref: ref,
|
package/dist/Slider.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlot as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
2
2
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.module.js";
|
|
3
3
|
import {useNumberFormatter as $6YMke$useNumberFormatter, useSlider as $6YMke$useSlider, mergeProps as $6YMke$mergeProps, useHover as $6YMke$useHover, useSliderThumb as $6YMke$useSliderThumb, useFocusRing as $6YMke$useFocusRing, VisuallyHidden as $6YMke$VisuallyHidden} from "react-aria";
|
|
4
4
|
import {filterDOMProps as $6YMke$filterDOMProps} from "@react-aria/utils";
|
|
@@ -76,7 +76,7 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
]
|
|
79
|
-
}, /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
79
|
+
}, /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
80
80
|
...(0, $6YMke$mergeProps)(DOMProps, renderProps, groupProps),
|
|
81
81
|
ref: ref,
|
|
82
82
|
slot: props.slot || undefined,
|
|
@@ -86,12 +86,13 @@ const $6f909507e6374d18$export$472062a354075cee = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
86
86
|
});
|
|
87
87
|
const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwardRef)(function SliderOutput(props, ref) {
|
|
88
88
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $6f909507e6374d18$export$6189c2744041d8f8);
|
|
89
|
-
let { children: children, style: style, className: className, ...otherProps } = props;
|
|
89
|
+
let { children: children, style: style, className: className, render: render, ...otherProps } = props;
|
|
90
90
|
let state = (0, $6YMke$useContext)($6f909507e6374d18$export$1e7083018727fa60);
|
|
91
91
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
92
92
|
className: className,
|
|
93
93
|
style: style,
|
|
94
94
|
children: children,
|
|
95
|
+
render: render,
|
|
95
96
|
defaultChildren: state.getThumbValueLabel(0),
|
|
96
97
|
defaultClassName: 'react-aria-SliderOutput',
|
|
97
98
|
values: {
|
|
@@ -100,7 +101,7 @@ const $6f909507e6374d18$export$a590f758a961cb5b = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
100
101
|
state: state
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
|
-
return /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
104
|
+
return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).output, {
|
|
104
105
|
...otherProps,
|
|
105
106
|
...renderProps,
|
|
106
107
|
ref: ref,
|
|
@@ -127,7 +128,7 @@ const $6f909507e6374d18$export$105594979f116971 = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
127
128
|
state: state
|
|
128
129
|
}
|
|
129
130
|
});
|
|
130
|
-
return /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
131
|
+
return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
131
132
|
...(0, $6YMke$mergeProps)(otherProps, hoverProps),
|
|
132
133
|
...renderProps,
|
|
133
134
|
ref: ref,
|
|
@@ -169,7 +170,7 @@ const $6f909507e6374d18$export$2c1b491743890dec = /*#__PURE__*/ (0, $6YMke$forwa
|
|
|
169
170
|
global: true
|
|
170
171
|
});
|
|
171
172
|
delete DOMProps.id;
|
|
172
|
-
return /*#__PURE__*/ (0, $6YMke$react).createElement(
|
|
173
|
+
return /*#__PURE__*/ (0, $6YMke$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
173
174
|
...(0, $6YMke$mergeProps)(DOMProps, thumbProps, hoverProps),
|
|
174
175
|
...renderProps,
|
|
175
176
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiBM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,aAAK,EAAkB;IACtC,I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;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;qBAC7B,gCAAC,CAAA,GAAA,qBAAa,uBACZ,gCAAC;QAAM,KAAK;QAAW,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;uBAE9D,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAW;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, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\n\nexport interface SliderProps<T = number | number[]> extends Omit<AriaSliderProps<T>, 'label'>, RenderProps<SliderRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\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 <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>, GlobalDOMAttributes<HTMLOutputElement> {}\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, ...otherProps} = props;\n let state = useContext(SliderStateContext)!;\n let renderProps = useRenderProps({\n className,\n style,\n children,\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 <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> {}\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 <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 * 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 <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 </div>\n );\n});\n"],"names":[],"version":3,"file":"Slider.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAiCM,MAAM,0DAAgB,CAAA,GAAA,oBAAY,EAA6C;AAC/E,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAsB;AAC7D,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAChG,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA6D;AAsBrG,MAAM,4CAAuB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,OAAoC,KAAqB,EAAE,GAAiC;IACtK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,WAAW,CAAA,GAAA,aAAK,EAAkB;IACtC,IAAI,kBAAkB,CAAA,GAAA,yBAAiB,EAAE,MAAM,aAAa;IAC5D,IAAI,QAAQ,CAAA,GAAA,qBAAa,EAAE;QAAC,GAAG,KAAK;yBAAE;IAAe;IACrD,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI,cACF,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,EACZ,GAAG,CAAA,GAAA,gBAAQ,EAAE;QAAC,GAAG,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AC,CAAA,GAAA,yCAAW;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, HoverEvents, mergeProps, Orientation, useFocusRing, useHover, useNumberFormatter, useSlider, useSliderThumb, VisuallyHidden} from 'react-aria';\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/utils';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, OutputHTMLAttributes, useContext, useRef} from 'react';\nimport {SliderState, useSliderState} from 'react-stately';\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.module.js.map"}
|
package/dist/Switch.main.js
CHANGED
|
@@ -66,7 +66,7 @@ const $8d81efc5c2ff8011$export$b5d5cf8927ab7262 = /*#__PURE__*/ (0, $hNQDK$react
|
|
|
66
66
|
});
|
|
67
67
|
delete DOMProps.id;
|
|
68
68
|
delete DOMProps.onClick;
|
|
69
|
-
return /*#__PURE__*/ (0, ($parcel$interopDefault($hNQDK$react))).createElement(
|
|
69
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($hNQDK$react))).createElement((0, $c5ccf687772c0422$exports.dom).label, {
|
|
70
70
|
...(0, $hNQDK$reactaria.mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
|
|
71
71
|
ref: ref,
|
|
72
72
|
slot: props.slot || undefined,
|