@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 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAyBM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAA0B;AAqChE,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAAe,KAA0B,EAAE,GAAiC;IAC3J,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,QAAQ,CAAA,GAAA,iCAAY,EAAE,MAAM,KA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;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,YAAY,WAAW;QAC7D,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAqB;aAAa;YACnC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;oBACT;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAIO,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D,CAAC;AAKtG,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,aAAa,KAAwB,EAAE,GAAiC;IACpI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QAAC,QAAQ,MAAM,MAAM;QAAE,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OAChF,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.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 {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useHover, useLocale, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n DOMRenderProps,\n Provider,\n RenderProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createPortal} from 'react-dom';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, ReactNode, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useUNSAFE_PortalContext} from '@react-aria/overlays';\n\nexport const ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>>, 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-ToastRegion'\n */\n className?: ClassNameOrFunction<ToastRegionRenderProps<T>>,\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast, or children containing a `<ToastList>`. */\n children: ReactNode | ((renderProps: {toast: QueuedToast<T>}) => ReactElement)\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({});\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n let {direction} = useLocale();\n let portalContainer;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!isSSR) {\n portalContainer = document.body;\n if (getContainer) {\n portalContainer = getContainer();\n }\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, regionProps, focusProps, hoverProps)}\n dir={direction}\n ref={objectRef}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} render={undefined} className={undefined} style={{display: 'contents'}}>{props.children}</ToastList> : props.children}\n </dom.div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\nexport interface ToastListProps<T> extends Omit<ToastRegionProps<T>, 'queue' | 'children' | 'render'>, DOMRenderProps<'ol', ToastRegionRenderProps<T>> {\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement\n}\n\nexport const ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastListProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n let {hoverProps, isHovered} = useHover({});\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastList',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused: false,\n isFocusVisible: false,\n isHovered\n }\n });\n\n return (\n <dom.ol {...hoverProps} {...renderProps} ref={ref}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </dom.ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>>, 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-Toast'\n */\n className?: ClassNameOrFunction<ToastRenderProps<T>>\n}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\nexport interface ToastContentProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'div', undefined> {}\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: ToastContentProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <dom.div render={props.render} className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.main.js.map"}
|
package/dist/Toast.mjs
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
|
|
2
|
+
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
3
|
+
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
4
|
+
import {useToastRegion as $9il6O$useToastRegion, useFocusRing as $9il6O$useFocusRing, useHover as $9il6O$useHover, useLocale as $9il6O$useLocale, mergeProps as $9il6O$mergeProps, useToast as $9il6O$useToast} from "react-aria";
|
|
5
|
+
import {createPortal as $9il6O$createPortal} from "react-dom";
|
|
6
|
+
import {useObjectRef as $9il6O$useObjectRef, filterDOMProps as $9il6O$filterDOMProps} from "@react-aria/utils";
|
|
7
|
+
import {useToastQueue as $9il6O$useToastQueue} from "react-stately";
|
|
8
|
+
import $9il6O$react, {createContext as $9il6O$createContext, forwardRef as $9il6O$forwardRef, useContext as $9il6O$useContext} from "react";
|
|
9
|
+
import {useIsSSR as $9il6O$useIsSSR} from "@react-aria/ssr";
|
|
10
|
+
import {useUNSAFE_PortalContext as $9il6O$useUNSAFE_PortalContext} from "@react-aria/overlays";
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const $692df8403b6ac2c7$export$e9e2a1fc7373c1e1 = /*#__PURE__*/ (0, $9il6O$createContext)(null);
|
|
33
|
+
const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastRegion(props, ref) {
|
|
34
|
+
let isSSR = (0, $9il6O$useIsSSR)();
|
|
35
|
+
let state = (0, $9il6O$useToastQueue)(props.queue);
|
|
36
|
+
let objectRef = (0, $9il6O$useObjectRef)(ref);
|
|
37
|
+
let { regionProps: regionProps } = (0, $9il6O$useToastRegion)(props, state, objectRef);
|
|
38
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $9il6O$useFocusRing)();
|
|
39
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9il6O$useHover)({});
|
|
40
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
41
|
+
...props,
|
|
42
|
+
children: undefined,
|
|
43
|
+
defaultClassName: 'react-aria-ToastRegion',
|
|
44
|
+
values: {
|
|
45
|
+
visibleToasts: state.visibleToasts,
|
|
46
|
+
isHovered: isHovered,
|
|
47
|
+
isFocused: isFocused,
|
|
48
|
+
isFocusVisible: isFocusVisible
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
let { direction: direction } = (0, $9il6O$useLocale)();
|
|
52
|
+
let portalContainer;
|
|
53
|
+
let { getContainer: getContainer } = (0, $9il6O$useUNSAFE_PortalContext)();
|
|
54
|
+
if (!isSSR) {
|
|
55
|
+
portalContainer = document.body;
|
|
56
|
+
if (getContainer) portalContainer = getContainer();
|
|
57
|
+
}
|
|
58
|
+
let DOMProps = (0, $9il6O$filterDOMProps)(props, {
|
|
59
|
+
global: true
|
|
60
|
+
});
|
|
61
|
+
let region = /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$export$e9e2a1fc7373c1e1.Provider, {
|
|
62
|
+
value: state
|
|
63
|
+
}, /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
64
|
+
...(0, $9il6O$mergeProps)(DOMProps, renderProps, regionProps, focusProps, hoverProps),
|
|
65
|
+
dir: direction,
|
|
66
|
+
ref: objectRef,
|
|
67
|
+
"data-hovered": isHovered || undefined,
|
|
68
|
+
"data-focused": isFocused || undefined,
|
|
69
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
70
|
+
}, typeof props.children === 'function' ? /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$export$c20d626a86a69756, {
|
|
71
|
+
...props,
|
|
72
|
+
render: undefined,
|
|
73
|
+
className: undefined,
|
|
74
|
+
style: {
|
|
75
|
+
display: 'contents'
|
|
76
|
+
}
|
|
77
|
+
}, props.children) : props.children));
|
|
78
|
+
return state.visibleToasts.length > 0 && portalContainer ? /*#__PURE__*/ (0, $9il6O$createPortal)(region, portalContainer) : null;
|
|
79
|
+
});
|
|
80
|
+
const $692df8403b6ac2c7$export$c20d626a86a69756 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastList(props, ref) {
|
|
81
|
+
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$export$e9e2a1fc7373c1e1);
|
|
82
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9il6O$useHover)({});
|
|
83
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
84
|
+
...props,
|
|
85
|
+
children: undefined,
|
|
86
|
+
defaultClassName: 'react-aria-ToastList',
|
|
87
|
+
values: {
|
|
88
|
+
visibleToasts: state.visibleToasts,
|
|
89
|
+
isFocused: false,
|
|
90
|
+
isFocusVisible: false,
|
|
91
|
+
isHovered: isHovered
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).ol, {
|
|
95
|
+
...hoverProps,
|
|
96
|
+
...renderProps,
|
|
97
|
+
ref: ref
|
|
98
|
+
}, state.visibleToasts.map((toast)=>/*#__PURE__*/ (0, $9il6O$react).createElement("li", {
|
|
99
|
+
key: toast.key,
|
|
100
|
+
style: {
|
|
101
|
+
display: 'contents'
|
|
102
|
+
}
|
|
103
|
+
}, props.children({
|
|
104
|
+
toast: toast
|
|
105
|
+
}))));
|
|
106
|
+
});
|
|
107
|
+
const $692df8403b6ac2c7$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $9il6O$forwardRef)(function Toast(props, ref) {
|
|
108
|
+
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$export$e9e2a1fc7373c1e1);
|
|
109
|
+
let objectRef = (0, $9il6O$useObjectRef)(ref);
|
|
110
|
+
let { toastProps: toastProps, contentProps: contentProps, titleProps: titleProps, descriptionProps: descriptionProps, closeButtonProps: closeButtonProps } = (0, $9il6O$useToast)(props, state, objectRef);
|
|
111
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $9il6O$useFocusRing)();
|
|
112
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
113
|
+
...props,
|
|
114
|
+
defaultClassName: 'react-aria-Toast',
|
|
115
|
+
values: {
|
|
116
|
+
toast: props.toast,
|
|
117
|
+
isFocused: isFocused,
|
|
118
|
+
isFocusVisible: isFocusVisible
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
let DOMProps = (0, $9il6O$filterDOMProps)(props, {
|
|
122
|
+
global: true
|
|
123
|
+
});
|
|
124
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
125
|
+
...(0, $9il6O$mergeProps)(DOMProps, renderProps, toastProps, focusProps),
|
|
126
|
+
ref: objectRef,
|
|
127
|
+
"data-focused": isFocused || undefined,
|
|
128
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
129
|
+
}, /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
130
|
+
values: [
|
|
131
|
+
[
|
|
132
|
+
$692df8403b6ac2c7$export$3a0d85872d9f73f2,
|
|
133
|
+
contentProps
|
|
134
|
+
],
|
|
135
|
+
[
|
|
136
|
+
(0, $514c0188e459b4c0$export$9afb8bc826b033ea),
|
|
137
|
+
{
|
|
138
|
+
slots: {
|
|
139
|
+
[(0, $64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
|
|
140
|
+
title: titleProps,
|
|
141
|
+
description: descriptionProps
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
(0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),
|
|
147
|
+
{
|
|
148
|
+
slots: {
|
|
149
|
+
[(0, $64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
|
|
150
|
+
close: closeButtonProps
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
]
|
|
155
|
+
}, renderProps.children));
|
|
156
|
+
});
|
|
157
|
+
const $692df8403b6ac2c7$export$3a0d85872d9f73f2 = /*#__PURE__*/ (0, $9il6O$createContext)({});
|
|
158
|
+
const $692df8403b6ac2c7$export$b134a6cc89b08851 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastContent(props, ref) {
|
|
159
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $692df8403b6ac2c7$export$3a0d85872d9f73f2);
|
|
160
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
161
|
+
render: props.render,
|
|
162
|
+
className: "react-aria-ToastContent",
|
|
163
|
+
...props,
|
|
164
|
+
ref: ref
|
|
165
|
+
}, props.children);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
export {$692df8403b6ac2c7$export$e9e2a1fc7373c1e1 as ToastStateContext, $692df8403b6ac2c7$export$2cbf5519fbeaa538 as ToastRegion, $692df8403b6ac2c7$export$c20d626a86a69756 as ToastList, $692df8403b6ac2c7$export$8d8dc7d5f743331b as Toast, $692df8403b6ac2c7$export$3a0d85872d9f73f2 as ToastContentContext, $692df8403b6ac2c7$export$b134a6cc89b08851 as ToastContent};
|
|
170
|
+
//# sourceMappingURL=Toast.module.js.map
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.module.js";
|
|
2
|
+
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, dom as $64fa3d84918910a7$export$df3a06d6289f983e, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
3
|
+
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
|
|
4
|
+
import {useToastRegion as $9il6O$useToastRegion, useFocusRing as $9il6O$useFocusRing, useHover as $9il6O$useHover, useLocale as $9il6O$useLocale, mergeProps as $9il6O$mergeProps, useToast as $9il6O$useToast} from "react-aria";
|
|
5
|
+
import {createPortal as $9il6O$createPortal} from "react-dom";
|
|
6
|
+
import {useObjectRef as $9il6O$useObjectRef, filterDOMProps as $9il6O$filterDOMProps} from "@react-aria/utils";
|
|
7
|
+
import {useToastQueue as $9il6O$useToastQueue} from "react-stately";
|
|
8
|
+
import $9il6O$react, {createContext as $9il6O$createContext, forwardRef as $9il6O$forwardRef, useContext as $9il6O$useContext} from "react";
|
|
9
|
+
import {useIsSSR as $9il6O$useIsSSR} from "@react-aria/ssr";
|
|
10
|
+
import {useUNSAFE_PortalContext as $9il6O$useUNSAFE_PortalContext} from "@react-aria/overlays";
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2025 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const $692df8403b6ac2c7$export$e9e2a1fc7373c1e1 = /*#__PURE__*/ (0, $9il6O$createContext)(null);
|
|
33
|
+
const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastRegion(props, ref) {
|
|
34
|
+
let isSSR = (0, $9il6O$useIsSSR)();
|
|
35
|
+
let state = (0, $9il6O$useToastQueue)(props.queue);
|
|
36
|
+
let objectRef = (0, $9il6O$useObjectRef)(ref);
|
|
37
|
+
let { regionProps: regionProps } = (0, $9il6O$useToastRegion)(props, state, objectRef);
|
|
38
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $9il6O$useFocusRing)();
|
|
39
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9il6O$useHover)({});
|
|
40
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
41
|
+
...props,
|
|
42
|
+
children: undefined,
|
|
43
|
+
defaultClassName: 'react-aria-ToastRegion',
|
|
44
|
+
values: {
|
|
45
|
+
visibleToasts: state.visibleToasts,
|
|
46
|
+
isHovered: isHovered,
|
|
47
|
+
isFocused: isFocused,
|
|
48
|
+
isFocusVisible: isFocusVisible
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
let { direction: direction } = (0, $9il6O$useLocale)();
|
|
52
|
+
let portalContainer;
|
|
53
|
+
let { getContainer: getContainer } = (0, $9il6O$useUNSAFE_PortalContext)();
|
|
54
|
+
if (!isSSR) {
|
|
55
|
+
portalContainer = document.body;
|
|
56
|
+
if (getContainer) portalContainer = getContainer();
|
|
57
|
+
}
|
|
58
|
+
let DOMProps = (0, $9il6O$filterDOMProps)(props, {
|
|
59
|
+
global: true
|
|
60
|
+
});
|
|
61
|
+
let region = /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$export$e9e2a1fc7373c1e1.Provider, {
|
|
62
|
+
value: state
|
|
63
|
+
}, /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
64
|
+
...(0, $9il6O$mergeProps)(DOMProps, renderProps, regionProps, focusProps, hoverProps),
|
|
65
|
+
dir: direction,
|
|
66
|
+
ref: objectRef,
|
|
67
|
+
"data-hovered": isHovered || undefined,
|
|
68
|
+
"data-focused": isFocused || undefined,
|
|
69
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
70
|
+
}, typeof props.children === 'function' ? /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$export$c20d626a86a69756, {
|
|
71
|
+
...props,
|
|
72
|
+
render: undefined,
|
|
73
|
+
className: undefined,
|
|
74
|
+
style: {
|
|
75
|
+
display: 'contents'
|
|
76
|
+
}
|
|
77
|
+
}, props.children) : props.children));
|
|
78
|
+
return state.visibleToasts.length > 0 && portalContainer ? /*#__PURE__*/ (0, $9il6O$createPortal)(region, portalContainer) : null;
|
|
79
|
+
});
|
|
80
|
+
const $692df8403b6ac2c7$export$c20d626a86a69756 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastList(props, ref) {
|
|
81
|
+
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$export$e9e2a1fc7373c1e1);
|
|
82
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9il6O$useHover)({});
|
|
83
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
84
|
+
...props,
|
|
85
|
+
children: undefined,
|
|
86
|
+
defaultClassName: 'react-aria-ToastList',
|
|
87
|
+
values: {
|
|
88
|
+
visibleToasts: state.visibleToasts,
|
|
89
|
+
isFocused: false,
|
|
90
|
+
isFocusVisible: false,
|
|
91
|
+
isHovered: isHovered
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).ol, {
|
|
95
|
+
...hoverProps,
|
|
96
|
+
...renderProps,
|
|
97
|
+
ref: ref
|
|
98
|
+
}, state.visibleToasts.map((toast)=>/*#__PURE__*/ (0, $9il6O$react).createElement("li", {
|
|
99
|
+
key: toast.key,
|
|
100
|
+
style: {
|
|
101
|
+
display: 'contents'
|
|
102
|
+
}
|
|
103
|
+
}, props.children({
|
|
104
|
+
toast: toast
|
|
105
|
+
}))));
|
|
106
|
+
});
|
|
107
|
+
const $692df8403b6ac2c7$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $9il6O$forwardRef)(function Toast(props, ref) {
|
|
108
|
+
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$export$e9e2a1fc7373c1e1);
|
|
109
|
+
let objectRef = (0, $9il6O$useObjectRef)(ref);
|
|
110
|
+
let { toastProps: toastProps, contentProps: contentProps, titleProps: titleProps, descriptionProps: descriptionProps, closeButtonProps: closeButtonProps } = (0, $9il6O$useToast)(props, state, objectRef);
|
|
111
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $9il6O$useFocusRing)();
|
|
112
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
113
|
+
...props,
|
|
114
|
+
defaultClassName: 'react-aria-Toast',
|
|
115
|
+
values: {
|
|
116
|
+
toast: props.toast,
|
|
117
|
+
isFocused: isFocused,
|
|
118
|
+
isFocusVisible: isFocusVisible
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
let DOMProps = (0, $9il6O$filterDOMProps)(props, {
|
|
122
|
+
global: true
|
|
123
|
+
});
|
|
124
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
125
|
+
...(0, $9il6O$mergeProps)(DOMProps, renderProps, toastProps, focusProps),
|
|
126
|
+
ref: objectRef,
|
|
127
|
+
"data-focused": isFocused || undefined,
|
|
128
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
129
|
+
}, /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
130
|
+
values: [
|
|
131
|
+
[
|
|
132
|
+
$692df8403b6ac2c7$export$3a0d85872d9f73f2,
|
|
133
|
+
contentProps
|
|
134
|
+
],
|
|
135
|
+
[
|
|
136
|
+
(0, $514c0188e459b4c0$export$9afb8bc826b033ea),
|
|
137
|
+
{
|
|
138
|
+
slots: {
|
|
139
|
+
[(0, $64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
|
|
140
|
+
title: titleProps,
|
|
141
|
+
description: descriptionProps
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
[
|
|
146
|
+
(0, $d2b4bc8c273e7be6$export$24d547caef80ccd1),
|
|
147
|
+
{
|
|
148
|
+
slots: {
|
|
149
|
+
[(0, $64fa3d84918910a7$export$c62b8e45d58ddad9)]: {},
|
|
150
|
+
close: closeButtonProps
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
]
|
|
155
|
+
}, renderProps.children));
|
|
156
|
+
});
|
|
157
|
+
const $692df8403b6ac2c7$export$3a0d85872d9f73f2 = /*#__PURE__*/ (0, $9il6O$createContext)({});
|
|
158
|
+
const $692df8403b6ac2c7$export$b134a6cc89b08851 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastContent(props, ref) {
|
|
159
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $692df8403b6ac2c7$export$3a0d85872d9f73f2);
|
|
160
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).div, {
|
|
161
|
+
render: props.render,
|
|
162
|
+
className: "react-aria-ToastContent",
|
|
163
|
+
...props,
|
|
164
|
+
ref: ref
|
|
165
|
+
}, props.children);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
export {$692df8403b6ac2c7$export$e9e2a1fc7373c1e1 as ToastStateContext, $692df8403b6ac2c7$export$2cbf5519fbeaa538 as ToastRegion, $692df8403b6ac2c7$export$c20d626a86a69756 as ToastList, $692df8403b6ac2c7$export$8d8dc7d5f743331b as Toast, $692df8403b6ac2c7$export$3a0d85872d9f73f2 as ToastContentContext, $692df8403b6ac2c7$export$b134a6cc89b08851 as ToastContent};
|
|
170
|
+
//# sourceMappingURL=Toast.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AAyBM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAA0B;AAqChE,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAAe,KAA0B,EAAE,GAAiC;IAC3J,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,QAAQ,CAAA,GAAA,oBAAY,EAAE,MAAM,KAAK;IACrC,IAAI,YAAY,CAAA,GAAA,mBAAW,EAAE;IAC7B,IAAI,eAAC,WAAW,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,OAAO,OAAO;IAEjD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IACzD,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE,CAAC;IACxC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,UAAU;QACV,kBAAkB;QAClB,QAAQ;YACN,eAAe,MAAM,aAAa;uBAClC;uBACA;4BACA;QACF;IACF;IAEA,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI;IACJ,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,8BAAsB;IAC3C,IAAI,CAAC,OAAO;QACV,kBAAkB,SAAS,IAAI;QAC/B,IAAI,cACF,kBAAkB;IAEtB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,IAAI,uBACF,gCAAC,0CAAkB,QAAQ;QA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K;IAC3C,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,GAAG;QAAC,QAAQ,MAAM,MAAM;QAAE,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OAChF,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.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 {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useHover, useLocale, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n DEFAULT_SLOT,\n dom,\n DOMRenderProps,\n Provider,\n RenderProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {createPortal} from 'react-dom';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, ReactNode, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useUNSAFE_PortalContext} from '@react-aria/overlays';\n\nexport const ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>>, 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-ToastRegion'\n */\n className?: ClassNameOrFunction<ToastRegionRenderProps<T>>,\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast, or children containing a `<ToastList>`. */\n children: ReactNode | ((renderProps: {toast: QueuedToast<T>}) => ReactElement)\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({});\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n let {direction} = useLocale();\n let portalContainer;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!isSSR) {\n portalContainer = document.body;\n if (getContainer) {\n portalContainer = getContainer();\n }\n }\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <dom.div\n {...mergeProps(DOMProps, renderProps, regionProps, focusProps, hoverProps)}\n dir={direction}\n ref={objectRef}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} render={undefined} className={undefined} style={{display: 'contents'}}>{props.children}</ToastList> : props.children}\n </dom.div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\nexport interface ToastListProps<T> extends Omit<ToastRegionProps<T>, 'queue' | 'children' | 'render'>, DOMRenderProps<'ol', ToastRegionRenderProps<T>> {\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement\n}\n\nexport const ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastListProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n let {hoverProps, isHovered} = useHover({});\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastList',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused: false,\n isFocusVisible: false,\n isHovered\n }\n });\n\n return (\n <dom.ol {...hoverProps} {...renderProps} ref={ref}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </dom.ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>>, 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-Toast'\n */\n className?: ClassNameOrFunction<ToastRenderProps<T>>\n}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...mergeProps(DOMProps, renderProps, toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\nexport interface ToastContentProps extends HTMLAttributes<HTMLElement>, DOMRenderProps<'div', undefined> {}\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: ToastContentProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <dom.div render={props.render} className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </dom.div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.module.js.map"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
2
|
+
var $54e872c96e6d295b$exports = require("./SelectionIndicator.main.js");
|
|
3
|
+
var $fed71ed29b70a020$exports = require("./ToggleButtonGroup.main.js");
|
|
4
|
+
var $3sDBP$reactaria = require("react-aria");
|
|
5
|
+
var $3sDBP$reactariautils = require("@react-aria/utils");
|
|
6
|
+
var $3sDBP$react = require("react");
|
|
7
|
+
var $3sDBP$reactstately = require("react-stately");
|
|
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, "ToggleButtonContext", () => $3def510c5b419a98$export$43506d75ebd2e218);
|
|
19
|
+
$parcel$export(module.exports, "ToggleButton", () => $3def510c5b419a98$export$d2b052e7b4be1756);
|
|
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 $3def510c5b419a98$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $3sDBP$react.createContext)({});
|
|
38
|
+
const $3def510c5b419a98$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $3sDBP$react.forwardRef)(function ToggleButton(props, ref) {
|
|
39
|
+
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $3def510c5b419a98$export$43506d75ebd2e218);
|
|
40
|
+
let groupState = (0, $3sDBP$react.useContext)((0, $fed71ed29b70a020$exports.ToggleGroupStateContext));
|
|
41
|
+
let state = (0, $3sDBP$reactstately.useToggleState)(groupState && props.id != null ? {
|
|
42
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
43
|
+
onChange (isSelected) {
|
|
44
|
+
groupState.setSelected(props.id, isSelected);
|
|
45
|
+
}
|
|
46
|
+
} : props);
|
|
47
|
+
let { buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled } = groupState && props.id != null ? (0, $3sDBP$reactaria.useToggleButtonGroupItem)({
|
|
48
|
+
...props,
|
|
49
|
+
id: props.id
|
|
50
|
+
}, groupState, ref) : (0, $3sDBP$reactaria.useToggleButton)({
|
|
51
|
+
...props,
|
|
52
|
+
id: props.id != null ? String(props.id) : undefined
|
|
53
|
+
}, state, ref);
|
|
54
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $3sDBP$reactaria.useFocusRing)(props);
|
|
55
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3sDBP$reactaria.useHover)({
|
|
56
|
+
...props,
|
|
57
|
+
isDisabled: isDisabled
|
|
58
|
+
});
|
|
59
|
+
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
60
|
+
...props,
|
|
61
|
+
id: undefined,
|
|
62
|
+
values: {
|
|
63
|
+
isHovered: isHovered,
|
|
64
|
+
isPressed: isPressed,
|
|
65
|
+
isFocused: isFocused,
|
|
66
|
+
isSelected: state.isSelected,
|
|
67
|
+
isFocusVisible: isFocusVisible,
|
|
68
|
+
isDisabled: isDisabled,
|
|
69
|
+
state: state
|
|
70
|
+
},
|
|
71
|
+
defaultClassName: 'react-aria-ToggleButton'
|
|
72
|
+
});
|
|
73
|
+
let DOMProps = (0, $3sDBP$reactariautils.filterDOMProps)(props, {
|
|
74
|
+
global: true
|
|
75
|
+
});
|
|
76
|
+
delete DOMProps.id;
|
|
77
|
+
delete DOMProps.onClick;
|
|
78
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($3sDBP$react))).createElement((0, $c5ccf687772c0422$exports.dom).button, {
|
|
79
|
+
...(0, $3sDBP$reactaria.mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
80
|
+
ref: ref,
|
|
81
|
+
slot: props.slot || undefined,
|
|
82
|
+
"data-focused": isFocused || undefined,
|
|
83
|
+
"data-disabled": isDisabled || undefined,
|
|
84
|
+
"data-pressed": isPressed || undefined,
|
|
85
|
+
"data-selected": isSelected || undefined,
|
|
86
|
+
"data-hovered": isHovered || undefined,
|
|
87
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
88
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3sDBP$react))).createElement((0, $54e872c96e6d295b$exports.SelectionIndicatorContext).Provider, {
|
|
89
|
+
value: {
|
|
90
|
+
isSelected: isSelected
|
|
91
|
+
}
|
|
92
|
+
}, renderProps.children));
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=ToggleButton.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA0CM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAsD,CAAC;AAK/F,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,aAAa,KAAwB,EAAE,GAAoC;IAC3J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE,cAAc,MAAM,EAAE,IAAI,OAAO;QAC1D,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;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leButton.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 {AriaToggleButtonProps, HoverEvents, mergeProps, useFocusRing, useHover, useToggleButton, useToggleButtonGroupItem} from 'react-aria';\nimport {ButtonRenderProps} from './Button';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n RenderProps,\n SlotProps,\n useContextProps,\n useRenderProps\n} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {SelectionIndicatorContext} from './SelectionIndicator';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * State of the toggle button.\n */\n state: ToggleState\n}\n\nexport interface ToggleButtonProps extends Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>, HoverEvents, SlotProps, RenderProps<ToggleButtonRenderProps, 'button'>, Omit<GlobalDOMAttributes<HTMLDivElement>, '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-ToggleButton'\n */\n className?: ClassNameOrFunction<ToggleButtonRenderProps>,\n /** When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used standalone, a DOM id. */\n id?: Key\n}\n\nexport const ToggleButtonContext = createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(props: ToggleButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(groupState && props.id != null ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n } : props);\n\n let {buttonProps, isPressed, isSelected, isDisabled} = groupState && props.id != null\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useToggleButton({...props, id: props.id != null ? String(props.id) : undefined}, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover({...props, isDisabled});\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {isHovered, isPressed, isFocused, isSelected: state.isSelected, isFocusVisible, isDisabled, state},\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <dom.button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <SelectionIndicatorContext.Provider value={{isSelected}}>\n {renderProps.children}\n </SelectionIndicatorContext.Provider>\n </dom.button>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.main.js.map"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {dom as $64fa3d84918910a7$export$df3a06d6289f983e, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
|
+
import {SelectionIndicatorContext as $1d5b8b8664671ef2$export$c9549807523555e0} from "./SelectionIndicator.mjs";
|
|
3
|
+
import {ToggleGroupStateContext as $84b7d8702d4ff4a8$export$a8a71863db173133} from "./ToggleButtonGroup.mjs";
|
|
4
|
+
import {useToggleButtonGroupItem as $jrJ9L$useToggleButtonGroupItem, useToggleButton as $jrJ9L$useToggleButton, useFocusRing as $jrJ9L$useFocusRing, useHover as $jrJ9L$useHover, mergeProps as $jrJ9L$mergeProps} from "react-aria";
|
|
5
|
+
import {filterDOMProps as $jrJ9L$filterDOMProps} from "@react-aria/utils";
|
|
6
|
+
import $jrJ9L$react, {createContext as $jrJ9L$createContext, forwardRef as $jrJ9L$forwardRef, useContext as $jrJ9L$useContext} from "react";
|
|
7
|
+
import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
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 $efde0372d7a700fe$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $jrJ9L$createContext)({});
|
|
27
|
+
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)(function ToggleButton(props, ref) {
|
|
28
|
+
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
29
|
+
let groupState = (0, $jrJ9L$useContext)((0, $84b7d8702d4ff4a8$export$a8a71863db173133));
|
|
30
|
+
let state = (0, $jrJ9L$useToggleState)(groupState && props.id != null ? {
|
|
31
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
32
|
+
onChange (isSelected) {
|
|
33
|
+
groupState.setSelected(props.id, isSelected);
|
|
34
|
+
}
|
|
35
|
+
} : props);
|
|
36
|
+
let { buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled } = groupState && props.id != null ? (0, $jrJ9L$useToggleButtonGroupItem)({
|
|
37
|
+
...props,
|
|
38
|
+
id: props.id
|
|
39
|
+
}, groupState, ref) : (0, $jrJ9L$useToggleButton)({
|
|
40
|
+
...props,
|
|
41
|
+
id: props.id != null ? String(props.id) : undefined
|
|
42
|
+
}, state, ref);
|
|
43
|
+
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $jrJ9L$useFocusRing)(props);
|
|
44
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jrJ9L$useHover)({
|
|
45
|
+
...props,
|
|
46
|
+
isDisabled: isDisabled
|
|
47
|
+
});
|
|
48
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
49
|
+
...props,
|
|
50
|
+
id: undefined,
|
|
51
|
+
values: {
|
|
52
|
+
isHovered: isHovered,
|
|
53
|
+
isPressed: isPressed,
|
|
54
|
+
isFocused: isFocused,
|
|
55
|
+
isSelected: state.isSelected,
|
|
56
|
+
isFocusVisible: isFocusVisible,
|
|
57
|
+
isDisabled: isDisabled,
|
|
58
|
+
state: state
|
|
59
|
+
},
|
|
60
|
+
defaultClassName: 'react-aria-ToggleButton'
|
|
61
|
+
});
|
|
62
|
+
let DOMProps = (0, $jrJ9L$filterDOMProps)(props, {
|
|
63
|
+
global: true
|
|
64
|
+
});
|
|
65
|
+
delete DOMProps.id;
|
|
66
|
+
delete DOMProps.onClick;
|
|
67
|
+
return /*#__PURE__*/ (0, $jrJ9L$react).createElement((0, $64fa3d84918910a7$export$df3a06d6289f983e).button, {
|
|
68
|
+
...(0, $jrJ9L$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
69
|
+
ref: ref,
|
|
70
|
+
slot: props.slot || undefined,
|
|
71
|
+
"data-focused": isFocused || undefined,
|
|
72
|
+
"data-disabled": isDisabled || undefined,
|
|
73
|
+
"data-pressed": isPressed || undefined,
|
|
74
|
+
"data-selected": isSelected || undefined,
|
|
75
|
+
"data-hovered": isHovered || undefined,
|
|
76
|
+
"data-focus-visible": isFocusVisible || undefined
|
|
77
|
+
}, /*#__PURE__*/ (0, $jrJ9L$react).createElement((0, $1d5b8b8664671ef2$export$c9549807523555e0).Provider, {
|
|
78
|
+
value: {
|
|
79
|
+
isSelected: isSelected
|
|
80
|
+
}
|
|
81
|
+
}, renderProps.children));
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
export {$efde0372d7a700fe$export$43506d75ebd2e218 as ToggleButtonContext, $efde0372d7a700fe$export$d2b052e7b4be1756 as ToggleButton};
|
|
86
|
+
//# sourceMappingURL=ToggleButton.module.js.map
|