@depup/react-aria-components 1.16.0-depup.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/LICENSE +201 -0
- package/README.md +31 -0
- package/changes.json +10 -0
- package/dist/Autocomplete.main.js +78 -0
- package/dist/Autocomplete.main.js.map +1 -0
- package/dist/Autocomplete.mjs +67 -0
- package/dist/Autocomplete.module.js +67 -0
- package/dist/Autocomplete.module.js.map +1 -0
- package/dist/Breadcrumbs.main.js +103 -0
- package/dist/Breadcrumbs.main.js.map +1 -0
- package/dist/Breadcrumbs.mjs +92 -0
- package/dist/Breadcrumbs.module.js +92 -0
- package/dist/Breadcrumbs.module.js.map +1 -0
- package/dist/Button.main.js +123 -0
- package/dist/Button.main.js.map +1 -0
- package/dist/Button.mjs +113 -0
- package/dist/Button.module.js +113 -0
- package/dist/Button.module.js.map +1 -0
- package/dist/Calendar.main.js +364 -0
- package/dist/Calendar.main.js.map +1 -0
- package/dist/Calendar.mjs +345 -0
- package/dist/Calendar.module.js +345 -0
- package/dist/Calendar.module.js.map +1 -0
- package/dist/Checkbox.main.js +188 -0
- package/dist/Checkbox.main.js.map +1 -0
- package/dist/Checkbox.mjs +176 -0
- package/dist/Checkbox.module.js +176 -0
- package/dist/Checkbox.module.js.map +1 -0
- package/dist/Collection.main.js +105 -0
- package/dist/Collection.main.js.map +1 -0
- package/dist/Collection.mjs +91 -0
- package/dist/Collection.module.js +91 -0
- package/dist/Collection.module.js.map +1 -0
- package/dist/ColorArea.main.js +80 -0
- package/dist/ColorArea.main.js.map +1 -0
- package/dist/ColorArea.mjs +70 -0
- package/dist/ColorArea.module.js +70 -0
- package/dist/ColorArea.module.js.map +1 -0
- package/dist/ColorField.main.js +168 -0
- package/dist/ColorField.main.js.map +1 -0
- package/dist/ColorField.mjs +158 -0
- package/dist/ColorField.module.js +158 -0
- package/dist/ColorField.module.js.map +1 -0
- package/dist/ColorPicker.main.js +102 -0
- package/dist/ColorPicker.main.js.map +1 -0
- package/dist/ColorPicker.mjs +91 -0
- package/dist/ColorPicker.module.js +91 -0
- package/dist/ColorPicker.module.js.map +1 -0
- package/dist/ColorSlider.main.js +112 -0
- package/dist/ColorSlider.main.js.map +1 -0
- package/dist/ColorSlider.mjs +102 -0
- package/dist/ColorSlider.module.js +102 -0
- package/dist/ColorSlider.module.js.map +1 -0
- package/dist/ColorSwatch.main.js +44 -0
- package/dist/ColorSwatch.main.js.map +1 -0
- package/dist/ColorSwatch.mjs +34 -0
- package/dist/ColorSwatch.module.js +34 -0
- package/dist/ColorSwatch.module.js.map +1 -0
- package/dist/ColorSwatchPicker.main.js +102 -0
- package/dist/ColorSwatchPicker.main.js.map +1 -0
- package/dist/ColorSwatchPicker.mjs +95 -0
- package/dist/ColorSwatchPicker.module.js +95 -0
- package/dist/ColorSwatchPicker.module.js.map +1 -0
- package/dist/ColorThumb.main.js +67 -0
- package/dist/ColorThumb.main.js.map +1 -0
- package/dist/ColorThumb.mjs +57 -0
- package/dist/ColorThumb.module.js +57 -0
- package/dist/ColorThumb.module.js.map +1 -0
- package/dist/ColorWheel.main.js +102 -0
- package/dist/ColorWheel.main.js.map +1 -0
- package/dist/ColorWheel.mjs +90 -0
- package/dist/ColorWheel.module.js +90 -0
- package/dist/ColorWheel.module.js.map +1 -0
- package/dist/ComboBox.main.js +322 -0
- package/dist/ComboBox.main.js.map +1 -0
- package/dist/ComboBox.mjs +309 -0
- package/dist/ComboBox.module.js +309 -0
- package/dist/ComboBox.module.js.map +1 -0
- package/dist/DateField.main.js +361 -0
- package/dist/DateField.main.js.map +1 -0
- package/dist/DateField.mjs +345 -0
- package/dist/DateField.module.js +345 -0
- package/dist/DateField.module.js.map +1 -0
- package/dist/DatePicker.main.js +342 -0
- package/dist/DatePicker.main.js.map +1 -0
- package/dist/DatePicker.mjs +328 -0
- package/dist/DatePicker.module.js +328 -0
- package/dist/DatePicker.module.js.map +1 -0
- package/dist/Dialog.main.js +167 -0
- package/dist/Dialog.main.js.map +1 -0
- package/dist/Dialog.mjs +155 -0
- package/dist/Dialog.module.js +155 -0
- package/dist/Dialog.module.js.map +1 -0
- package/dist/Disclosure.main.js +171 -0
- package/dist/Disclosure.main.js.map +1 -0
- package/dist/Disclosure.mjs +157 -0
- package/dist/Disclosure.module.js +157 -0
- package/dist/Disclosure.module.js.map +1 -0
- package/dist/DragAndDrop.main.js +103 -0
- package/dist/DragAndDrop.main.js.map +1 -0
- package/dist/DragAndDrop.mjs +90 -0
- package/dist/DragAndDrop.module.js +90 -0
- package/dist/DragAndDrop.module.js.map +1 -0
- package/dist/DropZone.main.js +127 -0
- package/dist/DropZone.main.js.map +1 -0
- package/dist/DropZone.mjs +121 -0
- package/dist/DropZone.module.js +121 -0
- package/dist/DropZone.module.js.map +1 -0
- package/dist/FieldError.main.js +61 -0
- package/dist/FieldError.main.js.map +1 -0
- package/dist/FieldError.mjs +51 -0
- package/dist/FieldError.module.js +51 -0
- package/dist/FieldError.module.js.map +1 -0
- package/dist/FileTrigger.main.js +60 -0
- package/dist/FileTrigger.main.js.map +1 -0
- package/dist/FileTrigger.mjs +51 -0
- package/dist/FileTrigger.module.js +51 -0
- package/dist/FileTrigger.module.js.map +1 -0
- package/dist/Form.main.js +49 -0
- package/dist/Form.main.js.map +1 -0
- package/dist/Form.mjs +39 -0
- package/dist/Form.module.js +39 -0
- package/dist/Form.module.js.map +1 -0
- package/dist/GridList.main.js +589 -0
- package/dist/GridList.main.js.map +1 -0
- package/dist/GridList.mjs +573 -0
- package/dist/GridList.module.js +573 -0
- package/dist/GridList.module.js.map +1 -0
- package/dist/Group.main.js +72 -0
- package/dist/Group.main.js.map +1 -0
- package/dist/Group.mjs +62 -0
- package/dist/Group.module.js +62 -0
- package/dist/Group.module.js.map +1 -0
- package/dist/Header.main.js +40 -0
- package/dist/Header.main.js.map +1 -0
- package/dist/Header.mjs +30 -0
- package/dist/Header.module.js +30 -0
- package/dist/Header.module.js.map +1 -0
- package/dist/Heading.main.js +40 -0
- package/dist/Heading.main.js.map +1 -0
- package/dist/Heading.mjs +31 -0
- package/dist/Heading.module.js +31 -0
- package/dist/Heading.module.js.map +1 -0
- package/dist/HiddenDateInput.main.js +126 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +117 -0
- package/dist/HiddenDateInput.module.js +117 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Input.main.js +72 -0
- package/dist/Input.main.js.map +1 -0
- package/dist/Input.mjs +62 -0
- package/dist/Input.module.js +62 -0
- package/dist/Input.module.js.map +1 -0
- package/dist/Keyboard.main.js +38 -0
- package/dist/Keyboard.main.js.map +1 -0
- package/dist/Keyboard.mjs +28 -0
- package/dist/Keyboard.module.js +28 -0
- package/dist/Keyboard.module.js.map +1 -0
- package/dist/Label.main.js +43 -0
- package/dist/Label.main.js.map +1 -0
- package/dist/Label.mjs +33 -0
- package/dist/Label.module.js +33 -0
- package/dist/Label.module.js.map +1 -0
- package/dist/Link.main.js +72 -0
- package/dist/Link.main.js.map +1 -0
- package/dist/Link.mjs +62 -0
- package/dist/Link.module.js +62 -0
- package/dist/Link.module.js.map +1 -0
- package/dist/ListBox.main.js +477 -0
- package/dist/ListBox.main.js.map +1 -0
- package/dist/ListBox.mjs +463 -0
- package/dist/ListBox.module.js +463 -0
- package/dist/ListBox.module.js.map +1 -0
- package/dist/Menu.main.js +459 -0
- package/dist/Menu.main.js.map +1 -0
- package/dist/Menu.mjs +443 -0
- package/dist/Menu.module.js +443 -0
- package/dist/Menu.module.js.map +1 -0
- package/dist/Meter.main.js +72 -0
- package/dist/Meter.main.js.map +1 -0
- package/dist/Meter.mjs +62 -0
- package/dist/Meter.module.js +62 -0
- package/dist/Meter.module.js.map +1 -0
- package/dist/Modal.main.js +191 -0
- package/dist/Modal.main.js.map +1 -0
- package/dist/Modal.mjs +180 -0
- package/dist/Modal.module.js +180 -0
- package/dist/Modal.module.js.map +1 -0
- package/dist/NumberField.main.js +147 -0
- package/dist/NumberField.main.js.map +1 -0
- package/dist/NumberField.mjs +136 -0
- package/dist/NumberField.module.js +136 -0
- package/dist/NumberField.module.js.map +1 -0
- package/dist/OverlayArrow.main.js +64 -0
- package/dist/OverlayArrow.main.js.map +1 -0
- package/dist/OverlayArrow.mjs +54 -0
- package/dist/OverlayArrow.module.js +54 -0
- package/dist/OverlayArrow.module.js.map +1 -0
- package/dist/Popover.main.js +196 -0
- package/dist/Popover.main.js.map +1 -0
- package/dist/Popover.mjs +186 -0
- package/dist/Popover.module.js +186 -0
- package/dist/Popover.module.js.map +1 -0
- package/dist/ProgressBar.main.js +73 -0
- package/dist/ProgressBar.main.js.map +1 -0
- package/dist/ProgressBar.mjs +63 -0
- package/dist/ProgressBar.module.js +63 -0
- package/dist/ProgressBar.module.js.map +1 -0
- package/dist/RSPContexts.main.js +37 -0
- package/dist/RSPContexts.main.js.map +1 -0
- package/dist/RSPContexts.mjs +25 -0
- package/dist/RSPContexts.module.js +25 -0
- package/dist/RSPContexts.module.js.map +1 -0
- package/dist/RadioGroup.main.js +184 -0
- package/dist/RadioGroup.main.js.map +1 -0
- package/dist/RadioGroup.mjs +171 -0
- package/dist/RadioGroup.module.js +171 -0
- package/dist/RadioGroup.module.js.map +1 -0
- package/dist/SearchField.main.js +140 -0
- package/dist/SearchField.main.js.map +1 -0
- package/dist/SearchField.mjs +130 -0
- package/dist/SearchField.module.js +130 -0
- package/dist/SearchField.module.js.map +1 -0
- package/dist/Select.main.js +324 -0
- package/dist/Select.main.js.map +1 -0
- package/dist/Select.mjs +315 -0
- package/dist/Select.module.js +315 -0
- package/dist/Select.module.js.map +1 -0
- package/dist/SelectionIndicator.main.js +45 -0
- package/dist/SelectionIndicator.main.js.map +1 -0
- package/dist/SelectionIndicator.mjs +35 -0
- package/dist/SelectionIndicator.module.js +35 -0
- package/dist/SelectionIndicator.module.js.map +1 -0
- package/dist/Separator.main.js +71 -0
- package/dist/Separator.main.js.map +1 -0
- package/dist/Separator.mjs +61 -0
- package/dist/Separator.module.js +61 -0
- package/dist/Separator.module.js.map +1 -0
- package/dist/SharedElementTransition.main.js +140 -0
- package/dist/SharedElementTransition.main.js.map +1 -0
- package/dist/SharedElementTransition.mjs +130 -0
- package/dist/SharedElementTransition.module.js +130 -0
- package/dist/SharedElementTransition.module.js.map +1 -0
- package/dist/Slider.main.js +220 -0
- package/dist/Slider.main.js.map +1 -0
- package/dist/Slider.mjs +204 -0
- package/dist/Slider.module.js +204 -0
- package/dist/Slider.module.js.map +1 -0
- package/dist/Switch.main.js +89 -0
- package/dist/Switch.main.js.map +1 -0
- package/dist/Switch.mjs +79 -0
- package/dist/Switch.module.js +79 -0
- package/dist/Switch.module.js.map +1 -0
- package/dist/Table.main.js +1171 -0
- package/dist/Table.main.js.map +1 -0
- package/dist/Table.mjs +1154 -0
- package/dist/Table.module.js +1154 -0
- package/dist/Table.module.js.map +1 -0
- package/dist/TableLayout.main.js +38 -0
- package/dist/TableLayout.main.js.map +1 -0
- package/dist/TableLayout.mjs +33 -0
- package/dist/TableLayout.module.js +33 -0
- package/dist/TableLayout.module.js.map +1 -0
- package/dist/Tabs.main.js +330 -0
- package/dist/Tabs.main.js.map +1 -0
- package/dist/Tabs.mjs +315 -0
- package/dist/Tabs.module.js +315 -0
- package/dist/Tabs.module.js.map +1 -0
- package/dist/TagGroup.main.js +255 -0
- package/dist/TagGroup.main.js.map +1 -0
- package/dist/TagGroup.mjs +242 -0
- package/dist/TagGroup.module.js +242 -0
- package/dist/TagGroup.module.js.map +1 -0
- package/dist/Text.main.js +41 -0
- package/dist/Text.main.js.map +1 -0
- package/dist/Text.mjs +31 -0
- package/dist/Text.module.js +31 -0
- package/dist/Text.module.js.map +1 -0
- package/dist/TextArea.main.js +57 -0
- package/dist/TextArea.main.js.map +1 -0
- package/dist/TextArea.mjs +47 -0
- package/dist/TextArea.module.js +47 -0
- package/dist/TextArea.module.js.map +1 -0
- package/dist/TextField.main.js +145 -0
- package/dist/TextField.main.js.map +1 -0
- package/dist/TextField.mjs +135 -0
- package/dist/TextField.module.js +135 -0
- package/dist/TextField.module.js.map +1 -0
- package/dist/Toast.main.js +183 -0
- package/dist/Toast.main.js.map +1 -0
- package/dist/Toast.mjs +170 -0
- package/dist/Toast.module.js +170 -0
- package/dist/Toast.module.js.map +1 -0
- package/dist/ToggleButton.main.js +96 -0
- package/dist/ToggleButton.main.js.map +1 -0
- package/dist/ToggleButton.mjs +86 -0
- package/dist/ToggleButton.module.js +86 -0
- package/dist/ToggleButton.module.js.map +1 -0
- package/dist/ToggleButtonGroup.main.js +66 -0
- package/dist/ToggleButtonGroup.main.js.map +1 -0
- package/dist/ToggleButtonGroup.mjs +55 -0
- package/dist/ToggleButtonGroup.module.js +55 -0
- package/dist/ToggleButtonGroup.module.js.map +1 -0
- package/dist/Toolbar.main.js +55 -0
- package/dist/Toolbar.main.js.map +1 -0
- package/dist/Toolbar.mjs +45 -0
- package/dist/Toolbar.module.js +45 -0
- package/dist/Toolbar.module.js.map +1 -0
- package/dist/Tooltip.main.js +132 -0
- package/dist/Tooltip.main.js.map +1 -0
- package/dist/Tooltip.mjs +120 -0
- package/dist/Tooltip.module.js +120 -0
- package/dist/Tooltip.module.js.map +1 -0
- package/dist/Tree.main.js +834 -0
- package/dist/Tree.main.js.map +1 -0
- package/dist/Tree.mjs +818 -0
- package/dist/Tree.module.js +818 -0
- package/dist/Tree.module.js.map +1 -0
- package/dist/TreeDropTargetDelegate.main.js +216 -0
- package/dist/TreeDropTargetDelegate.main.js.map +1 -0
- package/dist/TreeDropTargetDelegate.mjs +211 -0
- package/dist/TreeDropTargetDelegate.module.js +211 -0
- package/dist/TreeDropTargetDelegate.module.js.map +1 -0
- package/dist/Virtualizer.main.js +135 -0
- package/dist/Virtualizer.main.js.map +1 -0
- package/dist/Virtualizer.mjs +126 -0
- package/dist/Virtualizer.module.js +126 -0
- package/dist/Virtualizer.module.js.map +1 -0
- package/dist/ar-AE.main.js +9 -0
- package/dist/ar-AE.main.js.map +1 -0
- package/dist/ar-AE.mjs +11 -0
- package/dist/ar-AE.module.js +11 -0
- package/dist/ar-AE.module.js.map +1 -0
- package/dist/bg-BG.main.js +9 -0
- package/dist/bg-BG.main.js.map +1 -0
- package/dist/bg-BG.mjs +11 -0
- package/dist/bg-BG.module.js +11 -0
- package/dist/bg-BG.module.js.map +1 -0
- package/dist/cs-CZ.main.js +9 -0
- package/dist/cs-CZ.main.js.map +1 -0
- package/dist/cs-CZ.mjs +11 -0
- package/dist/cs-CZ.module.js +11 -0
- package/dist/cs-CZ.module.js.map +1 -0
- package/dist/da-DK.main.js +9 -0
- package/dist/da-DK.main.js.map +1 -0
- package/dist/da-DK.mjs +11 -0
- package/dist/da-DK.module.js +11 -0
- package/dist/da-DK.module.js.map +1 -0
- package/dist/de-DE.main.js +9 -0
- package/dist/de-DE.main.js.map +1 -0
- package/dist/de-DE.mjs +11 -0
- package/dist/de-DE.module.js +11 -0
- package/dist/de-DE.module.js.map +1 -0
- package/dist/el-GR.main.js +9 -0
- package/dist/el-GR.main.js.map +1 -0
- package/dist/el-GR.mjs +11 -0
- package/dist/el-GR.module.js +11 -0
- package/dist/el-GR.module.js.map +1 -0
- package/dist/en-US.main.js +9 -0
- package/dist/en-US.main.js.map +1 -0
- package/dist/en-US.mjs +11 -0
- package/dist/en-US.module.js +11 -0
- package/dist/en-US.module.js.map +1 -0
- package/dist/es-ES.main.js +9 -0
- package/dist/es-ES.main.js.map +1 -0
- package/dist/es-ES.mjs +11 -0
- package/dist/es-ES.module.js +11 -0
- package/dist/es-ES.module.js.map +1 -0
- package/dist/et-EE.main.js +9 -0
- package/dist/et-EE.main.js.map +1 -0
- package/dist/et-EE.mjs +11 -0
- package/dist/et-EE.module.js +11 -0
- package/dist/et-EE.module.js.map +1 -0
- package/dist/fi-FI.main.js +9 -0
- package/dist/fi-FI.main.js.map +1 -0
- package/dist/fi-FI.mjs +11 -0
- package/dist/fi-FI.module.js +11 -0
- package/dist/fi-FI.module.js.map +1 -0
- package/dist/fr-FR.main.js +9 -0
- package/dist/fr-FR.main.js.map +1 -0
- package/dist/fr-FR.mjs +11 -0
- package/dist/fr-FR.module.js +11 -0
- package/dist/fr-FR.module.js.map +1 -0
- package/dist/he-IL.main.js +9 -0
- package/dist/he-IL.main.js.map +1 -0
- package/dist/he-IL.mjs +11 -0
- package/dist/he-IL.module.js +11 -0
- package/dist/he-IL.module.js.map +1 -0
- package/dist/hr-HR.main.js +9 -0
- package/dist/hr-HR.main.js.map +1 -0
- package/dist/hr-HR.mjs +11 -0
- package/dist/hr-HR.module.js +11 -0
- package/dist/hr-HR.module.js.map +1 -0
- package/dist/hu-HU.main.js +9 -0
- package/dist/hu-HU.main.js.map +1 -0
- package/dist/hu-HU.mjs +11 -0
- package/dist/hu-HU.module.js +11 -0
- package/dist/hu-HU.module.js.map +1 -0
- package/dist/import.mjs +161 -0
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.main.js +9 -0
- package/dist/it-IT.main.js.map +1 -0
- package/dist/it-IT.mjs +11 -0
- package/dist/it-IT.module.js +11 -0
- package/dist/it-IT.module.js.map +1 -0
- package/dist/ja-JP.main.js +9 -0
- package/dist/ja-JP.main.js.map +1 -0
- package/dist/ja-JP.mjs +11 -0
- package/dist/ja-JP.module.js +11 -0
- package/dist/ja-JP.module.js.map +1 -0
- package/dist/ko-KR.main.js +9 -0
- package/dist/ko-KR.main.js.map +1 -0
- package/dist/ko-KR.mjs +11 -0
- package/dist/ko-KR.module.js +11 -0
- package/dist/ko-KR.module.js.map +1 -0
- package/dist/lt-LT.main.js +9 -0
- package/dist/lt-LT.main.js.map +1 -0
- package/dist/lt-LT.mjs +11 -0
- package/dist/lt-LT.module.js +11 -0
- package/dist/lt-LT.module.js.map +1 -0
- package/dist/lv-LV.main.js +9 -0
- package/dist/lv-LV.main.js.map +1 -0
- package/dist/lv-LV.mjs +11 -0
- package/dist/lv-LV.module.js +11 -0
- package/dist/lv-LV.module.js.map +1 -0
- package/dist/main.js +430 -0
- package/dist/main.js.map +1 -0
- package/dist/module.js +161 -0
- package/dist/module.js.map +1 -0
- package/dist/nb-NO.main.js +9 -0
- package/dist/nb-NO.main.js.map +1 -0
- package/dist/nb-NO.mjs +11 -0
- package/dist/nb-NO.module.js +11 -0
- package/dist/nb-NO.module.js.map +1 -0
- package/dist/nl-NL.main.js +9 -0
- package/dist/nl-NL.main.js.map +1 -0
- package/dist/nl-NL.mjs +11 -0
- package/dist/nl-NL.module.js +11 -0
- package/dist/nl-NL.module.js.map +1 -0
- package/dist/pl-PL.main.js +9 -0
- package/dist/pl-PL.main.js.map +1 -0
- package/dist/pl-PL.mjs +11 -0
- package/dist/pl-PL.module.js +11 -0
- package/dist/pl-PL.module.js.map +1 -0
- package/dist/pt-BR.main.js +9 -0
- package/dist/pt-BR.main.js.map +1 -0
- package/dist/pt-BR.mjs +11 -0
- package/dist/pt-BR.module.js +11 -0
- package/dist/pt-BR.module.js.map +1 -0
- package/dist/pt-PT.main.js +9 -0
- package/dist/pt-PT.main.js.map +1 -0
- package/dist/pt-PT.mjs +11 -0
- package/dist/pt-PT.module.js +11 -0
- package/dist/pt-PT.module.js.map +1 -0
- package/dist/ro-RO.main.js +9 -0
- package/dist/ro-RO.main.js.map +1 -0
- package/dist/ro-RO.mjs +11 -0
- package/dist/ro-RO.module.js +11 -0
- package/dist/ro-RO.module.js.map +1 -0
- package/dist/ru-RU.main.js +9 -0
- package/dist/ru-RU.main.js.map +1 -0
- package/dist/ru-RU.mjs +11 -0
- package/dist/ru-RU.module.js +11 -0
- package/dist/ru-RU.module.js.map +1 -0
- package/dist/sk-SK.main.js +9 -0
- package/dist/sk-SK.main.js.map +1 -0
- package/dist/sk-SK.mjs +11 -0
- package/dist/sk-SK.module.js +11 -0
- package/dist/sk-SK.module.js.map +1 -0
- package/dist/sl-SI.main.js +9 -0
- package/dist/sl-SI.main.js.map +1 -0
- package/dist/sl-SI.mjs +11 -0
- package/dist/sl-SI.module.js +11 -0
- package/dist/sl-SI.module.js.map +1 -0
- package/dist/sr-SP.main.js +9 -0
- package/dist/sr-SP.main.js.map +1 -0
- package/dist/sr-SP.mjs +11 -0
- package/dist/sr-SP.module.js +11 -0
- package/dist/sr-SP.module.js.map +1 -0
- package/dist/sv-SE.main.js +9 -0
- package/dist/sv-SE.main.js.map +1 -0
- package/dist/sv-SE.mjs +11 -0
- package/dist/sv-SE.module.js +11 -0
- package/dist/sv-SE.module.js.map +1 -0
- package/dist/tr-TR.main.js +9 -0
- package/dist/tr-TR.main.js.map +1 -0
- package/dist/tr-TR.mjs +11 -0
- package/dist/tr-TR.module.js +11 -0
- package/dist/tr-TR.module.js.map +1 -0
- package/dist/types.d.ts +3764 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/uk-UA.main.js +9 -0
- package/dist/uk-UA.main.js.map +1 -0
- package/dist/uk-UA.mjs +11 -0
- package/dist/uk-UA.module.js +11 -0
- package/dist/uk-UA.module.js.map +1 -0
- package/dist/useDragAndDrop.main.js +74 -0
- package/dist/useDragAndDrop.main.js.map +1 -0
- package/dist/useDragAndDrop.mjs +69 -0
- package/dist/useDragAndDrop.module.js +69 -0
- package/dist/useDragAndDrop.module.js.map +1 -0
- package/dist/utils.main.js +205 -0
- package/dist/utils.main.js.map +1 -0
- package/dist/utils.mjs +188 -0
- package/dist/utils.module.js +188 -0
- package/dist/utils.module.js.map +1 -0
- package/dist/zh-CN.main.js +9 -0
- package/dist/zh-CN.main.js.map +1 -0
- package/dist/zh-CN.mjs +11 -0
- package/dist/zh-CN.module.js +11 -0
- package/dist/zh-CN.module.js.map +1 -0
- package/dist/zh-TW.main.js +9 -0
- package/dist/zh-TW.main.js.map +1 -0
- package/dist/zh-TW.mjs +11 -0
- package/dist/zh-TW.module.js +11 -0
- package/dist/zh-TW.module.js.map +1 -0
- package/i18n/ar-AE.js +1 -0
- package/i18n/ar-AE.mjs +1 -0
- package/i18n/bg-BG.js +1 -0
- package/i18n/bg-BG.mjs +1 -0
- package/i18n/cs-CZ.js +1 -0
- package/i18n/cs-CZ.mjs +1 -0
- package/i18n/da-DK.js +1 -0
- package/i18n/da-DK.mjs +1 -0
- package/i18n/de-DE.js +1 -0
- package/i18n/de-DE.mjs +1 -0
- package/i18n/el-GR.js +1 -0
- package/i18n/el-GR.mjs +1 -0
- package/i18n/en-US.js +1 -0
- package/i18n/en-US.mjs +1 -0
- package/i18n/es-ES.js +1 -0
- package/i18n/es-ES.mjs +1 -0
- package/i18n/et-EE.js +1 -0
- package/i18n/et-EE.mjs +1 -0
- package/i18n/fi-FI.js +1 -0
- package/i18n/fi-FI.mjs +1 -0
- package/i18n/fr-FR.js +1 -0
- package/i18n/fr-FR.mjs +1 -0
- package/i18n/he-IL.js +1 -0
- package/i18n/he-IL.mjs +1 -0
- package/i18n/hr-HR.js +1 -0
- package/i18n/hr-HR.mjs +1 -0
- package/i18n/hu-HU.js +1 -0
- package/i18n/hu-HU.mjs +1 -0
- package/i18n/index.d.ts +13 -0
- package/i18n/index.js +118 -0
- package/i18n/index.mjs +115 -0
- package/i18n/it-IT.js +1 -0
- package/i18n/it-IT.mjs +1 -0
- package/i18n/ja-JP.js +1 -0
- package/i18n/ja-JP.mjs +1 -0
- package/i18n/ko-KR.js +1 -0
- package/i18n/ko-KR.mjs +1 -0
- package/i18n/lang.d.ts +7 -0
- package/i18n/lt-LT.js +1 -0
- package/i18n/lt-LT.mjs +1 -0
- package/i18n/lv-LV.js +1 -0
- package/i18n/lv-LV.mjs +1 -0
- package/i18n/nb-NO.js +1 -0
- package/i18n/nb-NO.mjs +1 -0
- package/i18n/nl-NL.js +1 -0
- package/i18n/nl-NL.mjs +1 -0
- package/i18n/pl-PL.js +1 -0
- package/i18n/pl-PL.mjs +1 -0
- package/i18n/pt-BR.js +1 -0
- package/i18n/pt-BR.mjs +1 -0
- package/i18n/pt-PT.js +1 -0
- package/i18n/pt-PT.mjs +1 -0
- package/i18n/ro-RO.js +1 -0
- package/i18n/ro-RO.mjs +1 -0
- package/i18n/ru-RU.js +1 -0
- package/i18n/ru-RU.mjs +1 -0
- package/i18n/sk-SK.js +1 -0
- package/i18n/sk-SK.mjs +1 -0
- package/i18n/sl-SI.js +1 -0
- package/i18n/sl-SI.mjs +1 -0
- package/i18n/sr-SP.js +1 -0
- package/i18n/sr-SP.mjs +1 -0
- package/i18n/sv-SE.js +1 -0
- package/i18n/sv-SE.mjs +1 -0
- package/i18n/tr-TR.js +1 -0
- package/i18n/tr-TR.mjs +1 -0
- package/i18n/uk-UA.js +1 -0
- package/i18n/uk-UA.mjs +1 -0
- package/i18n/zh-CN.js +1 -0
- package/i18n/zh-CN.mjs +1 -0
- package/i18n/zh-TW.js +1 -0
- package/i18n/zh-TW.mjs +1 -0
- package/package.json +105 -0
- package/src/Autocomplete.tsx +64 -0
- package/src/Breadcrumbs.tsx +137 -0
- package/src/Button.tsx +185 -0
- package/src/Calendar.tsx +620 -0
- package/src/Checkbox.tsx +282 -0
- package/src/Collection.tsx +225 -0
- package/src/ColorArea.tsx +89 -0
- package/src/ColorField.tsx +243 -0
- package/src/ColorPicker.tsx +63 -0
- package/src/ColorSlider.tsx +110 -0
- package/src/ColorSwatch.tsx +54 -0
- package/src/ColorSwatchPicker.tsx +125 -0
- package/src/ColorThumb.tsx +108 -0
- package/src/ColorWheel.tsx +122 -0
- package/src/ComboBox.tsx +325 -0
- package/src/DateField.tsx +425 -0
- package/src/DatePicker.tsx +334 -0
- package/src/Dialog.tsx +159 -0
- package/src/Disclosure.tsx +259 -0
- package/src/DragAndDrop.tsx +115 -0
- package/src/DropZone.tsx +145 -0
- package/src/FieldError.tsx +57 -0
- package/src/FileTrigger.tsx +79 -0
- package/src/Form.tsx +52 -0
- package/src/GridList.tsx +678 -0
- package/src/Group.tsx +114 -0
- package/src/Header.tsx +28 -0
- package/src/Heading.tsx +31 -0
- package/src/HiddenDateInput.tsx +152 -0
- package/src/Input.tsx +113 -0
- package/src/Keyboard.tsx +23 -0
- package/src/Label.tsx +29 -0
- package/src/Link.tsx +115 -0
- package/src/ListBox.tsx +577 -0
- package/src/Menu.tsx +496 -0
- package/src/Meter.tsx +93 -0
- package/src/Modal.tsx +262 -0
- package/src/NumberField.tsx +152 -0
- package/src/OverlayArrow.tsx +91 -0
- package/src/Popover.tsx +267 -0
- package/src/ProgressBar.tsx +101 -0
- package/src/RSPContexts.ts +52 -0
- package/src/RadioGroup.tsx +273 -0
- package/src/SearchField.tsx +152 -0
- package/src/Select.tsx +356 -0
- package/src/SelectionIndicator.tsx +46 -0
- package/src/Separator.tsx +76 -0
- package/src/SharedElementTransition.tsx +186 -0
- package/src/Slider.tsx +310 -0
- package/src/Switch.tsx +146 -0
- package/src/Table.tsx +1597 -0
- package/src/TableLayout.ts +28 -0
- package/src/Tabs.tsx +495 -0
- package/src/TagGroup.tsx +310 -0
- package/src/Text.tsx +28 -0
- package/src/TextArea.tsx +65 -0
- package/src/TextField.tsx +148 -0
- package/src/Toast.tsx +248 -0
- package/src/ToggleButton.tsx +103 -0
- package/src/ToggleButtonGroup.tsx +90 -0
- package/src/Toolbar.tsx +69 -0
- package/src/Tooltip.tsx +187 -0
- package/src/Tree.tsx +1066 -0
- package/src/TreeDropTargetDelegate.ts +308 -0
- package/src/Virtualizer.tsx +174 -0
- package/src/index.ts +160 -0
- package/src/useDragAndDrop.tsx +150 -0
- package/src/utils.tsx +351 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.mjs";
|
|
2
|
+
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5} from "./Collection.mjs";
|
|
3
|
+
import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.mjs";
|
|
4
|
+
import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
|
|
5
|
+
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, CollectionNode as $c5cc5$CollectionNode, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
+
import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
|
|
7
|
+
import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const $778035c5624f61e7$export$65596d3621b0a4a0 = /*#__PURE__*/ (0, $c5cc5$createContext)(null);
|
|
27
|
+
const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwardRef)(function Breadcrumbs(props, ref) {
|
|
28
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
|
|
29
|
+
let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
30
|
+
let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
|
|
31
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
32
|
+
global: true,
|
|
33
|
+
labelable: true
|
|
34
|
+
});
|
|
35
|
+
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
|
|
36
|
+
content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
|
|
37
|
+
}, (collection)=>{
|
|
38
|
+
var _props_className;
|
|
39
|
+
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).ol, {
|
|
40
|
+
render: props.render,
|
|
41
|
+
ref: ref,
|
|
42
|
+
...(0, $c5cc5$mergeProps)(DOMProps, navProps),
|
|
43
|
+
slot: props.slot || undefined,
|
|
44
|
+
style: props.style,
|
|
45
|
+
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
46
|
+
}, /*#__PURE__*/ (0, $c5cc5$react).createElement($778035c5624f61e7$export$65596d3621b0a4a0.Provider, {
|
|
47
|
+
value: props
|
|
48
|
+
}, /*#__PURE__*/ (0, $c5cc5$react).createElement(CollectionRoot, {
|
|
49
|
+
collection: collection
|
|
50
|
+
})));
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
class $778035c5624f61e7$var$BreadcrumbNode extends (0, $c5cc5$CollectionNode) {
|
|
54
|
+
}
|
|
55
|
+
$778035c5624f61e7$var$BreadcrumbNode.type = 'item';
|
|
56
|
+
const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$createLeafComponent)($778035c5624f61e7$var$BreadcrumbNode, function Breadcrumb(props, ref, node) {
|
|
57
|
+
// Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
|
|
58
|
+
let isCurrent = node.nextKey == null;
|
|
59
|
+
let { isDisabled: isDisabled, onAction: onAction } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($778035c5624f61e7$export$65596d3621b0a4a0);
|
|
60
|
+
let linkProps = {
|
|
61
|
+
'aria-current': isCurrent ? 'page' : null,
|
|
62
|
+
isDisabled: isDisabled || isCurrent,
|
|
63
|
+
onPress: ()=>onAction === null || onAction === void 0 ? void 0 : onAction(node.key)
|
|
64
|
+
};
|
|
65
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
66
|
+
...node.props,
|
|
67
|
+
children: node.rendered,
|
|
68
|
+
values: {
|
|
69
|
+
isDisabled: isDisabled || isCurrent,
|
|
70
|
+
isCurrent: isCurrent
|
|
71
|
+
},
|
|
72
|
+
defaultClassName: 'react-aria-Breadcrumb'
|
|
73
|
+
});
|
|
74
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
75
|
+
global: true,
|
|
76
|
+
labelable: true
|
|
77
|
+
});
|
|
78
|
+
delete DOMProps.id;
|
|
79
|
+
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).li, {
|
|
80
|
+
...DOMProps,
|
|
81
|
+
...renderProps,
|
|
82
|
+
ref: ref,
|
|
83
|
+
"data-disabled": isDisabled || isCurrent || undefined,
|
|
84
|
+
"data-current": isCurrent || undefined
|
|
85
|
+
}, /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $4f118338184dc1d9$export$e2509388b49734e7).Provider, {
|
|
86
|
+
value: linkProps
|
|
87
|
+
}, renderProps.children));
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export {$778035c5624f61e7$export$65596d3621b0a4a0 as BreadcrumbsContext, $778035c5624f61e7$export$2dc68d50d56fbbd as Breadcrumbs, $778035c5624f61e7$export$dabcc1ec9dd9d1cc as Breadcrumb};
|
|
92
|
+
//# sourceMappingURL=Breadcrumbs.module.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3, useSlottedContext as $64fa3d84918910a7$export$fabf2dc03a41866e} from "./utils.module.js";
|
|
2
|
+
import {CollectionRendererContext as $7135fc7d473fd974$export$4feb769f8ddf26c5} from "./Collection.module.js";
|
|
3
|
+
import {LinkContext as $4f118338184dc1d9$export$e2509388b49734e7} from "./Link.module.js";
|
|
4
|
+
import {useBreadcrumbs as $c5cc5$useBreadcrumbs} from "react-aria";
|
|
5
|
+
import {CollectionBuilder as $c5cc5$CollectionBuilder, Collection as $c5cc5$Collection, CollectionNode as $c5cc5$CollectionNode, createLeafComponent as $c5cc5$createLeafComponent} from "@react-aria/collections";
|
|
6
|
+
import {filterDOMProps as $c5cc5$filterDOMProps, mergeProps as $c5cc5$mergeProps} from "@react-aria/utils";
|
|
7
|
+
import $c5cc5$react, {createContext as $c5cc5$createContext, forwardRef as $c5cc5$forwardRef, useContext as $c5cc5$useContext} from "react";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const $778035c5624f61e7$export$65596d3621b0a4a0 = /*#__PURE__*/ (0, $c5cc5$createContext)(null);
|
|
27
|
+
const $778035c5624f61e7$export$2dc68d50d56fbbd = /*#__PURE__*/ (0, $c5cc5$forwardRef)(function Breadcrumbs(props, ref) {
|
|
28
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $778035c5624f61e7$export$65596d3621b0a4a0);
|
|
29
|
+
let { CollectionRoot: CollectionRoot } = (0, $c5cc5$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
|
|
30
|
+
let { navProps: navProps } = (0, $c5cc5$useBreadcrumbs)(props);
|
|
31
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
32
|
+
global: true,
|
|
33
|
+
labelable: true
|
|
34
|
+
});
|
|
35
|
+
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$CollectionBuilder), {
|
|
36
|
+
content: /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $c5cc5$Collection), props)
|
|
37
|
+
}, (collection)=>{
|
|
38
|
+
var _props_className;
|
|
39
|
+
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).ol, {
|
|
40
|
+
render: props.render,
|
|
41
|
+
ref: ref,
|
|
42
|
+
...(0, $c5cc5$mergeProps)(DOMProps, navProps),
|
|
43
|
+
slot: props.slot || undefined,
|
|
44
|
+
style: props.style,
|
|
45
|
+
className: (_props_className = props.className) !== null && _props_className !== void 0 ? _props_className : 'react-aria-Breadcrumbs'
|
|
46
|
+
}, /*#__PURE__*/ (0, $c5cc5$react).createElement($778035c5624f61e7$export$65596d3621b0a4a0.Provider, {
|
|
47
|
+
value: props
|
|
48
|
+
}, /*#__PURE__*/ (0, $c5cc5$react).createElement(CollectionRoot, {
|
|
49
|
+
collection: collection
|
|
50
|
+
})));
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
class $778035c5624f61e7$var$BreadcrumbNode extends (0, $c5cc5$CollectionNode) {
|
|
54
|
+
}
|
|
55
|
+
$778035c5624f61e7$var$BreadcrumbNode.type = 'item';
|
|
56
|
+
const $778035c5624f61e7$export$dabcc1ec9dd9d1cc = /*#__PURE__*/ (0, $c5cc5$createLeafComponent)($778035c5624f61e7$var$BreadcrumbNode, function Breadcrumb(props, ref, node) {
|
|
57
|
+
// Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.
|
|
58
|
+
let isCurrent = node.nextKey == null;
|
|
59
|
+
let { isDisabled: isDisabled, onAction: onAction } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)($778035c5624f61e7$export$65596d3621b0a4a0);
|
|
60
|
+
let linkProps = {
|
|
61
|
+
'aria-current': isCurrent ? 'page' : null,
|
|
62
|
+
isDisabled: isDisabled || isCurrent,
|
|
63
|
+
onPress: ()=>onAction === null || onAction === void 0 ? void 0 : onAction(node.key)
|
|
64
|
+
};
|
|
65
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
66
|
+
...node.props,
|
|
67
|
+
children: node.rendered,
|
|
68
|
+
values: {
|
|
69
|
+
isDisabled: isDisabled || isCurrent,
|
|
70
|
+
isCurrent: isCurrent
|
|
71
|
+
},
|
|
72
|
+
defaultClassName: 'react-aria-Breadcrumb'
|
|
73
|
+
});
|
|
74
|
+
let DOMProps = (0, $c5cc5$filterDOMProps)(props, {
|
|
75
|
+
global: true,
|
|
76
|
+
labelable: true
|
|
77
|
+
});
|
|
78
|
+
delete DOMProps.id;
|
|
79
|
+
return /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).li, {
|
|
80
|
+
...DOMProps,
|
|
81
|
+
...renderProps,
|
|
82
|
+
ref: ref,
|
|
83
|
+
"data-disabled": isDisabled || isCurrent || undefined,
|
|
84
|
+
"data-current": isCurrent || undefined
|
|
85
|
+
}, /*#__PURE__*/ (0, $c5cc5$react).createElement((0, $4f118338184dc1d9$export$e2509388b49734e7).Provider, {
|
|
86
|
+
value: linkProps
|
|
87
|
+
}, renderProps.children));
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export {$778035c5624f61e7$export$65596d3621b0a4a0 as BreadcrumbsContext, $778035c5624f61e7$export$2dc68d50d56fbbd as Breadcrumbs, $778035c5624f61e7$export$dabcc1ec9dd9d1cc as Breadcrumb};
|
|
92
|
+
//# sourceMappingURL=Breadcrumbs.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkCM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAKhG,MAAM,2CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAA8B,KAA0B,EAAE,GAAmC;IAC5K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAChC,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;QAAM,WAAW;IAAI;IAEnE,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA;YAOc;6BANb,gCAAC,CAAA,GAAA,yCAAE,EAAE,EAAE;YACL,QAAQ,MAAM,MAAM;YACpB,KAAK;YACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,SAAS;YAClC,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,gCAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,gCAAC;YAAe,YAAY;;;AAMxC;AAyBA,MAAM,6CAAuB,CAAA,GAAA,qBAAa;AAE1C;AAFM,qCACY,OAAO;AAMlB,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,sCAAgB,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IAC3K,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAc;QAAC,QAAQ;QAAM,WAAW;IAAI;IAC1E,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,EAAE;QACJ,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n DOMRenderProps,\n RenderProps,\n SlotProps,\n StyleProps,\n useContextProps,\n useRenderProps,\n useSlottedContext\n} from './utils';\nimport {Collection, CollectionBuilder, CollectionNode, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps, AriaLabelingProps, DOMRenderProps<'ol', undefined>, GlobalDOMAttributes<HTMLOListElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.\n * @default 'react-aria-Breadcrumbs'\n */\n className?: string,\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport const Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n let DOMProps = filterDOMProps(props, {global: true, labelable: true});\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <dom.ol\n render={props.render}\n ref={ref}\n {...mergeProps(DOMProps, navProps)}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </dom.ol>\n )}\n </CollectionBuilder>\n );\n});\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps, 'li'>, AriaLabelingProps, GlobalDOMAttributes<HTMLLIElement> {\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-Breadcrumb'\n */\n className?: ClassNameOrFunction<BreadcrumbRenderProps>,\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\nclass BreadcrumbNode extends CollectionNode<unknown> {\n static readonly type = 'item';\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent(BreadcrumbNode, function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true, labelable: true});\n delete DOMProps.id;\n\n return (\n <dom.li\n {...DOMProps}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </dom.li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
2
|
+
var $0d6436f6a1b0b001$exports = require("./ProgressBar.main.js");
|
|
3
|
+
var $3vfYa$reactarialiveannouncer = require("@react-aria/live-announcer");
|
|
4
|
+
var $3vfYa$reactaria = require("react-aria");
|
|
5
|
+
var $3vfYa$reactariacollections = require("@react-aria/collections");
|
|
6
|
+
var $3vfYa$reactariautils = require("@react-aria/utils");
|
|
7
|
+
var $3vfYa$react = require("react");
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
function $parcel$interopDefault(a) {
|
|
11
|
+
return a && a.__esModule ? a.default : a;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function $parcel$export(e, n, v, s) {
|
|
15
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
$parcel$export(module.exports, "ButtonContext", () => $b856e6788a7ea5bf$export$24d547caef80ccd1);
|
|
19
|
+
$parcel$export(module.exports, "Button", () => $b856e6788a7ea5bf$export$353f5b6fc5456de1);
|
|
20
|
+
/*
|
|
21
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
22
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
24
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
27
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
28
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
29
|
+
* governing permissions and limitations under the License.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const $b856e6788a7ea5bf$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $3vfYa$react.createContext)({});
|
|
38
|
+
const $b856e6788a7ea5bf$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $3vfYa$reactariacollections.createHideableComponent)(function Button(props, ref) {
|
|
39
|
+
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $b856e6788a7ea5bf$export$24d547caef80ccd1);
|
|
40
|
+
let ctx = props;
|
|
41
|
+
let { isPending: isPending } = ctx;
|
|
42
|
+
let { buttonProps: buttonProps, isPressed: isPressed } = (0, $3vfYa$reactaria.useButton)(props, ref);
|
|
43
|
+
buttonProps = $b856e6788a7ea5bf$var$useDisableInteractions(buttonProps, isPending);
|
|
44
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $3vfYa$reactaria.useFocusRing)(props);
|
|
45
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3vfYa$reactaria.useHover)({
|
|
46
|
+
...props,
|
|
47
|
+
isDisabled: props.isDisabled || isPending
|
|
48
|
+
});
|
|
49
|
+
let renderValues = {
|
|
50
|
+
isHovered: isHovered,
|
|
51
|
+
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
52
|
+
isFocused: isFocused,
|
|
53
|
+
isFocusVisible: isFocusVisible,
|
|
54
|
+
isDisabled: props.isDisabled || false,
|
|
55
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
56
|
+
};
|
|
57
|
+
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
58
|
+
...props,
|
|
59
|
+
values: renderValues,
|
|
60
|
+
defaultClassName: 'react-aria-Button'
|
|
61
|
+
});
|
|
62
|
+
let buttonId = (0, $3vfYa$reactaria.useId)(buttonProps.id);
|
|
63
|
+
let progressId = (0, $3vfYa$reactaria.useId)();
|
|
64
|
+
let ariaLabelledby = buttonProps['aria-labelledby'];
|
|
65
|
+
if (isPending) {
|
|
66
|
+
// aria-labelledby wins over aria-label
|
|
67
|
+
// https://www.w3.org/TR/accname-1.2/#computation-steps
|
|
68
|
+
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
69
|
+
else if (buttonProps['aria-label']) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
70
|
+
}
|
|
71
|
+
let wasPending = (0, $3vfYa$react.useRef)(isPending);
|
|
72
|
+
(0, $3vfYa$react.useEffect)(()=>{
|
|
73
|
+
let message = {
|
|
74
|
+
'aria-labelledby': ariaLabelledby || buttonId
|
|
75
|
+
};
|
|
76
|
+
if (!wasPending.current && isFocused && isPending) (0, $3vfYa$reactarialiveannouncer.announce)(message, 'assertive');
|
|
77
|
+
else if (wasPending.current && isFocused && !isPending) (0, $3vfYa$reactarialiveannouncer.announce)(message, 'assertive');
|
|
78
|
+
wasPending.current = isPending;
|
|
79
|
+
}, [
|
|
80
|
+
isPending,
|
|
81
|
+
isFocused,
|
|
82
|
+
ariaLabelledby,
|
|
83
|
+
buttonId
|
|
84
|
+
]);
|
|
85
|
+
let DOMProps = (0, $3vfYa$reactariautils.filterDOMProps)(props, {
|
|
86
|
+
global: true
|
|
87
|
+
});
|
|
88
|
+
delete DOMProps.onClick;
|
|
89
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3vfYa$react))).createElement((0, $c5ccf687772c0422$exports.dom).button, {
|
|
90
|
+
...(0, $3vfYa$reactaria.mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
91
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
92
|
+
// We do this by changing the button's type to button.
|
|
93
|
+
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
94
|
+
id: buttonId,
|
|
95
|
+
ref: ref,
|
|
96
|
+
"aria-labelledby": ariaLabelledby,
|
|
97
|
+
slot: props.slot || undefined,
|
|
98
|
+
"aria-disabled": isPending ? 'true' : buttonProps['aria-disabled'],
|
|
99
|
+
"data-disabled": props.isDisabled || undefined,
|
|
100
|
+
"data-pressed": renderValues.isPressed || undefined,
|
|
101
|
+
"data-hovered": isHovered || undefined,
|
|
102
|
+
"data-focused": isFocused || undefined,
|
|
103
|
+
"data-pending": isPending || undefined,
|
|
104
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
105
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3vfYa$react))).createElement((0, $0d6436f6a1b0b001$exports.ProgressBarContext).Provider, {
|
|
106
|
+
value: {
|
|
107
|
+
id: progressId
|
|
108
|
+
}
|
|
109
|
+
}, renderProps.children));
|
|
110
|
+
});
|
|
111
|
+
// Events to preserve when isPending is true (for tooltips and other overlays)
|
|
112
|
+
const $b856e6788a7ea5bf$var$PRESERVED_EVENT_PATTERN = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;
|
|
113
|
+
function $b856e6788a7ea5bf$var$useDisableInteractions(props, isPending) {
|
|
114
|
+
if (isPending) {
|
|
115
|
+
for(const key in props)if (key.startsWith('on') && !$b856e6788a7ea5bf$var$PRESERVED_EVENT_PATTERN.test(key)) props[key] = undefined;
|
|
116
|
+
props.href = undefined;
|
|
117
|
+
props.target = undefined;
|
|
118
|
+
}
|
|
119
|
+
return props;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=Button.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"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","sources":["packages/react-aria-components/src/Button.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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps, 'button'>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Button'\n */\n className?: ClassNameOrFunction<ButtonRenderProps>,\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n buttonProps = useDisableInteractions(buttonProps, isPending);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </dom.button>\n );\n});\n\n// Events to preserve when isPending is true (for tooltips and other overlays)\nconst PRESERVED_EVENT_PATTERN = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;\n\nfunction useDisableInteractions(props, isPending) {\n if (isPending) {\n for (const key in props) {\n if (key.startsWith('on') && !PRESERVED_EVENT_PATTERN.test(key)) {\n props[key] = undefined;\n }\n }\n props.href = undefined;\n props.target = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.main.js.map"}
|
package/dist/Button.mjs
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
|
+
import {ProgressBarContext as $0393f8ab869a0f1a$export$e9f3bf65a26ce129} from "./ProgressBar.mjs";
|
|
3
|
+
import {announce as $fM325$announce} from "@react-aria/live-announcer";
|
|
4
|
+
import {useButton as $fM325$useButton, useFocusRing as $fM325$useFocusRing, useHover as $fM325$useHover, useId as $fM325$useId, mergeProps as $fM325$mergeProps} from "react-aria";
|
|
5
|
+
import {createHideableComponent as $fM325$createHideableComponent} from "@react-aria/collections";
|
|
6
|
+
import {filterDOMProps as $fM325$filterDOMProps} from "@react-aria/utils";
|
|
7
|
+
import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$useRef, useEffect as $fM325$useEffect} from "react";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
|
|
27
|
+
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
|
|
28
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
29
|
+
let ctx = props;
|
|
30
|
+
let { isPending: isPending } = ctx;
|
|
31
|
+
let { buttonProps: buttonProps, isPressed: isPressed } = (0, $fM325$useButton)(props, ref);
|
|
32
|
+
buttonProps = $d2b4bc8c273e7be6$var$useDisableInteractions(buttonProps, isPending);
|
|
33
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $fM325$useFocusRing)(props);
|
|
34
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fM325$useHover)({
|
|
35
|
+
...props,
|
|
36
|
+
isDisabled: props.isDisabled || isPending
|
|
37
|
+
});
|
|
38
|
+
let renderValues = {
|
|
39
|
+
isHovered: isHovered,
|
|
40
|
+
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
41
|
+
isFocused: isFocused,
|
|
42
|
+
isFocusVisible: isFocusVisible,
|
|
43
|
+
isDisabled: props.isDisabled || false,
|
|
44
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
45
|
+
};
|
|
46
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
47
|
+
...props,
|
|
48
|
+
values: renderValues,
|
|
49
|
+
defaultClassName: 'react-aria-Button'
|
|
50
|
+
});
|
|
51
|
+
let buttonId = (0, $fM325$useId)(buttonProps.id);
|
|
52
|
+
let progressId = (0, $fM325$useId)();
|
|
53
|
+
let ariaLabelledby = buttonProps['aria-labelledby'];
|
|
54
|
+
if (isPending) {
|
|
55
|
+
// aria-labelledby wins over aria-label
|
|
56
|
+
// https://www.w3.org/TR/accname-1.2/#computation-steps
|
|
57
|
+
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
58
|
+
else if (buttonProps['aria-label']) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
59
|
+
}
|
|
60
|
+
let wasPending = (0, $fM325$useRef)(isPending);
|
|
61
|
+
(0, $fM325$useEffect)(()=>{
|
|
62
|
+
let message = {
|
|
63
|
+
'aria-labelledby': ariaLabelledby || buttonId
|
|
64
|
+
};
|
|
65
|
+
if (!wasPending.current && isFocused && isPending) (0, $fM325$announce)(message, 'assertive');
|
|
66
|
+
else if (wasPending.current && isFocused && !isPending) (0, $fM325$announce)(message, 'assertive');
|
|
67
|
+
wasPending.current = isPending;
|
|
68
|
+
}, [
|
|
69
|
+
isPending,
|
|
70
|
+
isFocused,
|
|
71
|
+
ariaLabelledby,
|
|
72
|
+
buttonId
|
|
73
|
+
]);
|
|
74
|
+
let DOMProps = (0, $fM325$filterDOMProps)(props, {
|
|
75
|
+
global: true
|
|
76
|
+
});
|
|
77
|
+
delete DOMProps.onClick;
|
|
78
|
+
return /*#__PURE__*/ (0, $fM325$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).button, {
|
|
79
|
+
...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
80
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
81
|
+
// We do this by changing the button's type to button.
|
|
82
|
+
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
83
|
+
id: buttonId,
|
|
84
|
+
ref: ref,
|
|
85
|
+
"aria-labelledby": ariaLabelledby,
|
|
86
|
+
slot: props.slot || undefined,
|
|
87
|
+
"aria-disabled": isPending ? 'true' : buttonProps['aria-disabled'],
|
|
88
|
+
"data-disabled": props.isDisabled || undefined,
|
|
89
|
+
"data-pressed": renderValues.isPressed || undefined,
|
|
90
|
+
"data-hovered": isHovered || undefined,
|
|
91
|
+
"data-focused": isFocused || undefined,
|
|
92
|
+
"data-pending": isPending || undefined,
|
|
93
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
94
|
+
}, /*#__PURE__*/ (0, $fM325$react).createElement((0, $0393f8ab869a0f1a$export$e9f3bf65a26ce129).Provider, {
|
|
95
|
+
value: {
|
|
96
|
+
id: progressId
|
|
97
|
+
}
|
|
98
|
+
}, renderProps.children));
|
|
99
|
+
});
|
|
100
|
+
// Events to preserve when isPending is true (for tooltips and other overlays)
|
|
101
|
+
const $d2b4bc8c273e7be6$var$PRESERVED_EVENT_PATTERN = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;
|
|
102
|
+
function $d2b4bc8c273e7be6$var$useDisableInteractions(props, isPending) {
|
|
103
|
+
if (isPending) {
|
|
104
|
+
for(const key in props)if (key.startsWith('on') && !$d2b4bc8c273e7be6$var$PRESERVED_EVENT_PATTERN.test(key)) props[key] = undefined;
|
|
105
|
+
props.href = undefined;
|
|
106
|
+
props.target = undefined;
|
|
107
|
+
}
|
|
108
|
+
return props;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
export {$d2b4bc8c273e7be6$export$24d547caef80ccd1 as ButtonContext, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as Button};
|
|
113
|
+
//# sourceMappingURL=Button.module.js.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
|
+
import {ProgressBarContext as $0393f8ab869a0f1a$export$e9f3bf65a26ce129} from "./ProgressBar.module.js";
|
|
3
|
+
import {announce as $fM325$announce} from "@react-aria/live-announcer";
|
|
4
|
+
import {useButton as $fM325$useButton, useFocusRing as $fM325$useFocusRing, useHover as $fM325$useHover, useId as $fM325$useId, mergeProps as $fM325$mergeProps} from "react-aria";
|
|
5
|
+
import {createHideableComponent as $fM325$createHideableComponent} from "@react-aria/collections";
|
|
6
|
+
import {filterDOMProps as $fM325$filterDOMProps} from "@react-aria/utils";
|
|
7
|
+
import $fM325$react, {createContext as $fM325$createContext, useRef as $fM325$useRef, useEffect as $fM325$useEffect} from "react";
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const $d2b4bc8c273e7be6$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $fM325$createContext)({});
|
|
27
|
+
const $d2b4bc8c273e7be6$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $fM325$createHideableComponent)(function Button(props, ref) {
|
|
28
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $d2b4bc8c273e7be6$export$24d547caef80ccd1);
|
|
29
|
+
let ctx = props;
|
|
30
|
+
let { isPending: isPending } = ctx;
|
|
31
|
+
let { buttonProps: buttonProps, isPressed: isPressed } = (0, $fM325$useButton)(props, ref);
|
|
32
|
+
buttonProps = $d2b4bc8c273e7be6$var$useDisableInteractions(buttonProps, isPending);
|
|
33
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $fM325$useFocusRing)(props);
|
|
34
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fM325$useHover)({
|
|
35
|
+
...props,
|
|
36
|
+
isDisabled: props.isDisabled || isPending
|
|
37
|
+
});
|
|
38
|
+
let renderValues = {
|
|
39
|
+
isHovered: isHovered,
|
|
40
|
+
isPressed: (ctx.isPressed || isPressed) && !isPending,
|
|
41
|
+
isFocused: isFocused,
|
|
42
|
+
isFocusVisible: isFocusVisible,
|
|
43
|
+
isDisabled: props.isDisabled || false,
|
|
44
|
+
isPending: isPending !== null && isPending !== void 0 ? isPending : false
|
|
45
|
+
};
|
|
46
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
47
|
+
...props,
|
|
48
|
+
values: renderValues,
|
|
49
|
+
defaultClassName: 'react-aria-Button'
|
|
50
|
+
});
|
|
51
|
+
let buttonId = (0, $fM325$useId)(buttonProps.id);
|
|
52
|
+
let progressId = (0, $fM325$useId)();
|
|
53
|
+
let ariaLabelledby = buttonProps['aria-labelledby'];
|
|
54
|
+
if (isPending) {
|
|
55
|
+
// aria-labelledby wins over aria-label
|
|
56
|
+
// https://www.w3.org/TR/accname-1.2/#computation-steps
|
|
57
|
+
if (ariaLabelledby) ariaLabelledby = `${ariaLabelledby} ${progressId}`;
|
|
58
|
+
else if (buttonProps['aria-label']) ariaLabelledby = `${buttonId} ${progressId}`;
|
|
59
|
+
}
|
|
60
|
+
let wasPending = (0, $fM325$useRef)(isPending);
|
|
61
|
+
(0, $fM325$useEffect)(()=>{
|
|
62
|
+
let message = {
|
|
63
|
+
'aria-labelledby': ariaLabelledby || buttonId
|
|
64
|
+
};
|
|
65
|
+
if (!wasPending.current && isFocused && isPending) (0, $fM325$announce)(message, 'assertive');
|
|
66
|
+
else if (wasPending.current && isFocused && !isPending) (0, $fM325$announce)(message, 'assertive');
|
|
67
|
+
wasPending.current = isPending;
|
|
68
|
+
}, [
|
|
69
|
+
isPending,
|
|
70
|
+
isFocused,
|
|
71
|
+
ariaLabelledby,
|
|
72
|
+
buttonId
|
|
73
|
+
]);
|
|
74
|
+
let DOMProps = (0, $fM325$filterDOMProps)(props, {
|
|
75
|
+
global: true
|
|
76
|
+
});
|
|
77
|
+
delete DOMProps.onClick;
|
|
78
|
+
return /*#__PURE__*/ (0, $fM325$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).button, {
|
|
79
|
+
...(0, $fM325$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
80
|
+
// When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).
|
|
81
|
+
// We do this by changing the button's type to button.
|
|
82
|
+
type: buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type,
|
|
83
|
+
id: buttonId,
|
|
84
|
+
ref: ref,
|
|
85
|
+
"aria-labelledby": ariaLabelledby,
|
|
86
|
+
slot: props.slot || undefined,
|
|
87
|
+
"aria-disabled": isPending ? 'true' : buttonProps['aria-disabled'],
|
|
88
|
+
"data-disabled": props.isDisabled || undefined,
|
|
89
|
+
"data-pressed": renderValues.isPressed || undefined,
|
|
90
|
+
"data-hovered": isHovered || undefined,
|
|
91
|
+
"data-focused": isFocused || undefined,
|
|
92
|
+
"data-pending": isPending || undefined,
|
|
93
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
94
|
+
}, /*#__PURE__*/ (0, $fM325$react).createElement((0, $0393f8ab869a0f1a$export$e9f3bf65a26ce129).Provider, {
|
|
95
|
+
value: {
|
|
96
|
+
id: progressId
|
|
97
|
+
}
|
|
98
|
+
}, renderProps.children));
|
|
99
|
+
});
|
|
100
|
+
// Events to preserve when isPending is true (for tooltips and other overlays)
|
|
101
|
+
const $d2b4bc8c273e7be6$var$PRESERVED_EVENT_PATTERN = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;
|
|
102
|
+
function $d2b4bc8c273e7be6$var$useDisableInteractions(props, isPending) {
|
|
103
|
+
if (isPending) {
|
|
104
|
+
for(const key in props)if (key.startsWith('on') && !$d2b4bc8c273e7be6$var$PRESERVED_EVENT_PATTERN.test(key)) props[key] = undefined;
|
|
105
|
+
props.href = undefined;
|
|
106
|
+
props.target = undefined;
|
|
107
|
+
}
|
|
108
|
+
return props;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
export {$d2b4bc8c273e7be6$export$24d547caef80ccd1 as ButtonContext, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as Button};
|
|
113
|
+
//# sourceMappingURL=Button.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"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","sources":["packages/react-aria-components/src/Button.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 {announce} from '@react-aria/live-announcer';\nimport {\n AriaButtonProps,\n HoverEvents,\n mergeProps,\n useButton,\n useFocusRing,\n useHover,\n useId\n} from 'react-aria';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createHideableComponent} from '@react-aria/collections';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {ProgressBarContext} from './ProgressBar';\nimport React, {createContext, ForwardedRef, useEffect, useRef} from 'react';\n\nexport interface ButtonRenderProps {\n /**\n * Whether the button is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the button is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the button is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the button is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the button is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the button is currently in a pending state.\n * @selector [data-pending]\n */\n isPending: boolean\n}\n\nexport interface ButtonProps extends Omit<AriaButtonProps, 'children' | 'href' | 'target' | 'rel' | 'elementType'>, HoverEvents, SlotProps, RenderProps<ButtonRenderProps, 'button'>, Omit<GlobalDOMAttributes<HTMLButtonElement>, 'onClick'> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n * @default 'react-aria-Button'\n */\n className?: ClassNameOrFunction<ButtonRenderProps>,\n /**\n * Whether the button is in a pending state. This disables press and hover events\n * while retaining focusability, and announces the pending state to screen readers.\n */\n isPending?: boolean\n}\n\ninterface ButtonContextValue extends ButtonProps {\n isPressed?: boolean\n}\n\nexport const ButtonContext = createContext<ContextValue<ButtonContextValue, HTMLButtonElement>>({});\n\n/**\n * A button allows a user to perform an action, with mouse, touch, and keyboard interactions.\n */\nexport const Button = /*#__PURE__*/ createHideableComponent(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ButtonContext);\n let ctx = props as ButtonContextValue;\n let {isPending} = ctx;\n let {buttonProps, isPressed} = useButton(props, ref);\n buttonProps = useDisableInteractions(buttonProps, isPending);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: props.isDisabled || isPending\n });\n let renderValues = {\n isHovered,\n isPressed: (ctx.isPressed || isPressed) && !isPending,\n isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isPending: isPending ?? false\n };\n\n let renderProps = useRenderProps({\n ...props,\n values: renderValues,\n defaultClassName: 'react-aria-Button'\n });\n\n let buttonId = useId(buttonProps.id);\n let progressId = useId();\n\n let ariaLabelledby = buttonProps['aria-labelledby'];\n if (isPending) {\n // aria-labelledby wins over aria-label\n // https://www.w3.org/TR/accname-1.2/#computation-steps\n if (ariaLabelledby) {\n ariaLabelledby = `${ariaLabelledby} ${progressId}`;\n } else if (buttonProps['aria-label']) {\n ariaLabelledby = `${buttonId} ${progressId}`;\n }\n }\n\n let wasPending = useRef(isPending);\n useEffect(() => {\n let message = {'aria-labelledby': ariaLabelledby || buttonId};\n if (!wasPending.current && isFocused && isPending) {\n announce(message, 'assertive');\n } else if (wasPending.current && isFocused && !isPending) {\n announce(message, 'assertive');\n }\n wasPending.current = isPending;\n }, [isPending, isFocused, ariaLabelledby, buttonId]);\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n // When the button is in a pending state, we want to stop implicit form submission (ie. when the user presses enter on a text input).\n // We do this by changing the button's type to button.\n type={buttonProps.type === 'submit' && isPending ? 'button' : buttonProps.type}\n id={buttonId}\n ref={ref}\n aria-labelledby={ariaLabelledby}\n slot={props.slot || undefined}\n aria-disabled={isPending ? 'true' : buttonProps['aria-disabled']}\n data-disabled={props.isDisabled || undefined}\n data-pressed={renderValues.isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-pending={isPending || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <ProgressBarContext.Provider value={{id: progressId}}>\n {renderProps.children}\n </ProgressBarContext.Provider>\n </dom.button>\n );\n});\n\n// Events to preserve when isPending is true (for tooltips and other overlays)\nconst PRESERVED_EVENT_PATTERN = /Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;\n\nfunction useDisableInteractions(props, isPending) {\n if (isPending) {\n for (const key in props) {\n if (key.startsWith('on') && !PRESERVED_EVENT_PATTERN.test(key)) {\n props[key] = undefined;\n }\n }\n props.href = undefined;\n props.target = undefined;\n }\n return props;\n}\n"],"names":[],"version":3,"file":"Button.module.js.map"}
|