@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
package/src/Checkbox.tsx
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import {AriaCheckboxGroupProps, AriaCheckboxProps, HoverEvents, mergeProps, useCheckbox, useCheckboxGroup, useCheckboxGroupItem, useFocusRing, useHover, VisuallyHidden} from 'react-aria';
|
|
13
|
+
import {CheckboxContext} from './RSPContexts';
|
|
14
|
+
import {CheckboxGroupState, useCheckboxGroupState, useToggleState} from 'react-stately';
|
|
15
|
+
import {
|
|
16
|
+
ClassNameOrFunction,
|
|
17
|
+
ContextValue,
|
|
18
|
+
dom,
|
|
19
|
+
Provider,
|
|
20
|
+
RACValidation,
|
|
21
|
+
removeDataAttributes,
|
|
22
|
+
RenderProps,
|
|
23
|
+
SlotProps,
|
|
24
|
+
useContextProps,
|
|
25
|
+
useRenderProps,
|
|
26
|
+
useSlot,
|
|
27
|
+
useSlottedContext
|
|
28
|
+
} from './utils';
|
|
29
|
+
import {FieldErrorContext} from './FieldError';
|
|
30
|
+
import {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';
|
|
31
|
+
import {FormContext} from './Form';
|
|
32
|
+
import {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';
|
|
33
|
+
import {LabelContext} from './Label';
|
|
34
|
+
import React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';
|
|
35
|
+
import {TextContext} from './Text';
|
|
36
|
+
|
|
37
|
+
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<CheckboxGroupRenderProps, 'div'>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
38
|
+
/**
|
|
39
|
+
* 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.
|
|
40
|
+
* @default 'react-aria-CheckboxGroup'
|
|
41
|
+
*/
|
|
42
|
+
className?: ClassNameOrFunction<CheckboxGroupRenderProps>
|
|
43
|
+
}
|
|
44
|
+
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>, HoverEvents, RACValidation, RenderProps<CheckboxRenderProps, 'label'>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {
|
|
45
|
+
/**
|
|
46
|
+
* 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.
|
|
47
|
+
* @default 'react-aria-Checkbox'
|
|
48
|
+
*/
|
|
49
|
+
className?: ClassNameOrFunction<CheckboxRenderProps>,
|
|
50
|
+
/**
|
|
51
|
+
* A ref for the HTML input element.
|
|
52
|
+
*/
|
|
53
|
+
inputRef?: RefObject<HTMLInputElement | null>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface CheckboxGroupRenderProps {
|
|
57
|
+
/**
|
|
58
|
+
* Whether the checkbox group is disabled.
|
|
59
|
+
* @selector [data-disabled]
|
|
60
|
+
*/
|
|
61
|
+
isDisabled: boolean,
|
|
62
|
+
/**
|
|
63
|
+
* Whether the checkbox group is read only.
|
|
64
|
+
* @selector [data-readonly]
|
|
65
|
+
*/
|
|
66
|
+
isReadOnly: boolean,
|
|
67
|
+
/**
|
|
68
|
+
* Whether the checkbox group is required.
|
|
69
|
+
* @selector [data-required]
|
|
70
|
+
*/
|
|
71
|
+
isRequired: boolean,
|
|
72
|
+
/**
|
|
73
|
+
* Whether the checkbox group is invalid.
|
|
74
|
+
* @selector [data-invalid]
|
|
75
|
+
*/
|
|
76
|
+
isInvalid: boolean,
|
|
77
|
+
/**
|
|
78
|
+
* State of the checkbox group.
|
|
79
|
+
*/
|
|
80
|
+
state: CheckboxGroupState
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface CheckboxRenderProps {
|
|
84
|
+
/**
|
|
85
|
+
* Whether the checkbox is selected.
|
|
86
|
+
* @selector [data-selected]
|
|
87
|
+
*/
|
|
88
|
+
isSelected: boolean,
|
|
89
|
+
/**
|
|
90
|
+
* Whether the checkbox is indeterminate.
|
|
91
|
+
* @selector [data-indeterminate]
|
|
92
|
+
*/
|
|
93
|
+
isIndeterminate: boolean,
|
|
94
|
+
/**
|
|
95
|
+
* Whether the checkbox is currently hovered with a mouse.
|
|
96
|
+
* @selector [data-hovered]
|
|
97
|
+
*/
|
|
98
|
+
isHovered: boolean,
|
|
99
|
+
/**
|
|
100
|
+
* Whether the checkbox is currently in a pressed state.
|
|
101
|
+
* @selector [data-pressed]
|
|
102
|
+
*/
|
|
103
|
+
isPressed: boolean,
|
|
104
|
+
/**
|
|
105
|
+
* Whether the checkbox is focused, either via a mouse or keyboard.
|
|
106
|
+
* @selector [data-focused]
|
|
107
|
+
*/
|
|
108
|
+
isFocused: boolean,
|
|
109
|
+
/**
|
|
110
|
+
* Whether the checkbox is keyboard focused.
|
|
111
|
+
* @selector [data-focus-visible]
|
|
112
|
+
*/
|
|
113
|
+
isFocusVisible: boolean,
|
|
114
|
+
/**
|
|
115
|
+
* Whether the checkbox is disabled.
|
|
116
|
+
* @selector [data-disabled]
|
|
117
|
+
*/
|
|
118
|
+
isDisabled: boolean,
|
|
119
|
+
/**
|
|
120
|
+
* Whether the checkbox is read only.
|
|
121
|
+
* @selector [data-readonly]
|
|
122
|
+
*/
|
|
123
|
+
isReadOnly: boolean,
|
|
124
|
+
/**
|
|
125
|
+
* Whether the checkbox invalid.
|
|
126
|
+
* @selector [data-invalid]
|
|
127
|
+
*/
|
|
128
|
+
isInvalid: boolean,
|
|
129
|
+
/**
|
|
130
|
+
* Whether the checkbox is required.
|
|
131
|
+
* @selector [data-required]
|
|
132
|
+
*/
|
|
133
|
+
isRequired: boolean
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const CheckboxGroupContext = createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);
|
|
137
|
+
export const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* A checkbox group allows a user to select multiple items from a list of options.
|
|
141
|
+
*/
|
|
142
|
+
export const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(props: CheckboxGroupProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
143
|
+
[props, ref] = useContextProps(props, ref, CheckboxGroupContext);
|
|
144
|
+
let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};
|
|
145
|
+
let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';
|
|
146
|
+
let state = useCheckboxGroupState({
|
|
147
|
+
...props,
|
|
148
|
+
validationBehavior
|
|
149
|
+
});
|
|
150
|
+
let [labelRef, label] = useSlot(
|
|
151
|
+
!props['aria-label'] && !props['aria-labelledby']
|
|
152
|
+
);
|
|
153
|
+
let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useCheckboxGroup({
|
|
154
|
+
...props,
|
|
155
|
+
label,
|
|
156
|
+
validationBehavior
|
|
157
|
+
}, state);
|
|
158
|
+
|
|
159
|
+
let renderProps = useRenderProps({
|
|
160
|
+
...props,
|
|
161
|
+
values: {
|
|
162
|
+
isDisabled: state.isDisabled,
|
|
163
|
+
isReadOnly: state.isReadOnly,
|
|
164
|
+
isRequired: props.isRequired || false,
|
|
165
|
+
isInvalid: state.isInvalid,
|
|
166
|
+
state
|
|
167
|
+
},
|
|
168
|
+
defaultClassName: 'react-aria-CheckboxGroup'
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
let DOMProps = filterDOMProps(props, {global: true});
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<dom.div
|
|
175
|
+
{...mergeProps(DOMProps, renderProps, groupProps)}
|
|
176
|
+
ref={ref}
|
|
177
|
+
slot={props.slot || undefined}
|
|
178
|
+
data-readonly={state.isReadOnly || undefined}
|
|
179
|
+
data-required={props.isRequired || undefined}
|
|
180
|
+
data-invalid={state.isInvalid || undefined}
|
|
181
|
+
data-disabled={props.isDisabled || undefined}>
|
|
182
|
+
<Provider
|
|
183
|
+
values={[
|
|
184
|
+
[CheckboxGroupStateContext, state],
|
|
185
|
+
[LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],
|
|
186
|
+
[TextContext, {
|
|
187
|
+
slots: {
|
|
188
|
+
description: descriptionProps,
|
|
189
|
+
errorMessage: errorMessageProps
|
|
190
|
+
}
|
|
191
|
+
}],
|
|
192
|
+
[FieldErrorContext, validation]
|
|
193
|
+
]}>
|
|
194
|
+
{renderProps.children}
|
|
195
|
+
</Provider>
|
|
196
|
+
</dom.div>
|
|
197
|
+
);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* A checkbox allows a user to select multiple items from a list of individual items, or
|
|
202
|
+
* to mark one individual item as selected.
|
|
203
|
+
*/
|
|
204
|
+
export const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(props: CheckboxProps, ref: ForwardedRef<HTMLLabelElement>) {
|
|
205
|
+
let {
|
|
206
|
+
inputRef: userProvidedInputRef = null,
|
|
207
|
+
...otherProps
|
|
208
|
+
} = props;
|
|
209
|
+
[props, ref] = useContextProps(otherProps, ref, CheckboxContext);
|
|
210
|
+
let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};
|
|
211
|
+
let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';
|
|
212
|
+
let groupState = useContext(CheckboxGroupStateContext);
|
|
213
|
+
let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));
|
|
214
|
+
let {labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState
|
|
215
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
216
|
+
? useCheckboxGroupItem({
|
|
217
|
+
...removeDataAttributes(props),
|
|
218
|
+
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
219
|
+
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
220
|
+
// @ts-ignore
|
|
221
|
+
value: props.value,
|
|
222
|
+
// ReactNode type doesn't allow function children.
|
|
223
|
+
children: typeof props.children === 'function' ? true : props.children
|
|
224
|
+
}, groupState, inputRef)
|
|
225
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
226
|
+
: useCheckbox({
|
|
227
|
+
...removeDataAttributes(props),
|
|
228
|
+
children: typeof props.children === 'function' ? true : props.children,
|
|
229
|
+
validationBehavior
|
|
230
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
231
|
+
}, useToggleState(props), inputRef);
|
|
232
|
+
let {isFocused, isFocusVisible, focusProps} = useFocusRing();
|
|
233
|
+
let isInteractionDisabled = isDisabled || isReadOnly;
|
|
234
|
+
|
|
235
|
+
let {hoverProps, isHovered} = useHover({
|
|
236
|
+
...props,
|
|
237
|
+
isDisabled: isInteractionDisabled
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
let renderProps = useRenderProps({
|
|
241
|
+
...props,
|
|
242
|
+
defaultClassName: 'react-aria-Checkbox',
|
|
243
|
+
values: {
|
|
244
|
+
isSelected,
|
|
245
|
+
isIndeterminate: props.isIndeterminate || false,
|
|
246
|
+
isPressed,
|
|
247
|
+
isHovered,
|
|
248
|
+
isFocused,
|
|
249
|
+
isFocusVisible,
|
|
250
|
+
isDisabled,
|
|
251
|
+
isReadOnly,
|
|
252
|
+
isInvalid,
|
|
253
|
+
isRequired: props.isRequired || false
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
let DOMProps = filterDOMProps(props, {global: true});
|
|
258
|
+
delete DOMProps.id;
|
|
259
|
+
delete DOMProps.onClick;
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<dom.label
|
|
263
|
+
{...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}
|
|
264
|
+
ref={ref}
|
|
265
|
+
slot={props.slot || undefined}
|
|
266
|
+
data-selected={isSelected || undefined}
|
|
267
|
+
data-indeterminate={props.isIndeterminate || undefined}
|
|
268
|
+
data-pressed={isPressed || undefined}
|
|
269
|
+
data-hovered={isHovered || undefined}
|
|
270
|
+
data-focused={isFocused || undefined}
|
|
271
|
+
data-focus-visible={isFocusVisible || undefined}
|
|
272
|
+
data-disabled={isDisabled || undefined}
|
|
273
|
+
data-readonly={isReadOnly || undefined}
|
|
274
|
+
data-invalid={isInvalid || undefined}
|
|
275
|
+
data-required={props.isRequired || undefined}>
|
|
276
|
+
<VisuallyHidden elementType="span">
|
|
277
|
+
<input {...mergeProps(inputProps, focusProps)} ref={inputRef} />
|
|
278
|
+
</VisuallyHidden>
|
|
279
|
+
{renderProps.children}
|
|
280
|
+
</dom.label>
|
|
281
|
+
);
|
|
282
|
+
});
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import {CollectionBase, DropTargetDelegate, GlobalDOMAttributes, ItemDropTarget, Key, LayoutDelegate, RefObject} from '@react-types/shared';
|
|
13
|
+
import {createBranchComponent, useCachedChildren} from '@react-aria/collections';
|
|
14
|
+
import {Collection as ICollection, Node, SelectionBehavior, SelectionMode, SectionProps as SharedSectionProps} from 'react-stately';
|
|
15
|
+
import React, {cloneElement, createContext, ForwardedRef, HTMLAttributes, isValidElement, JSX, ReactElement, ReactNode, useContext, useMemo} from 'react';
|
|
16
|
+
import {StyleProps} from './utils';
|
|
17
|
+
|
|
18
|
+
export interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'> {
|
|
19
|
+
/** The contents of the collection. */
|
|
20
|
+
children?: ReactNode | ((item: T) => ReactNode),
|
|
21
|
+
/** Values that should invalidate the item cache when using dynamic collections. */
|
|
22
|
+
dependencies?: ReadonlyArray<any>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ItemRenderProps {
|
|
26
|
+
/**
|
|
27
|
+
* Whether the item is currently hovered with a mouse.
|
|
28
|
+
* @selector [data-hovered]
|
|
29
|
+
*/
|
|
30
|
+
isHovered: boolean,
|
|
31
|
+
/**
|
|
32
|
+
* Whether the item is currently in a pressed state.
|
|
33
|
+
* @selector [data-pressed]
|
|
34
|
+
*/
|
|
35
|
+
isPressed: boolean,
|
|
36
|
+
/**
|
|
37
|
+
* Whether the item is currently selected.
|
|
38
|
+
* @selector [data-selected]
|
|
39
|
+
*/
|
|
40
|
+
isSelected: boolean,
|
|
41
|
+
/**
|
|
42
|
+
* Whether the item is currently focused.
|
|
43
|
+
* @selector [data-focused]
|
|
44
|
+
*/
|
|
45
|
+
isFocused: boolean,
|
|
46
|
+
/**
|
|
47
|
+
* Whether the item is currently keyboard focused.
|
|
48
|
+
* @selector [data-focus-visible]
|
|
49
|
+
*/
|
|
50
|
+
isFocusVisible: boolean,
|
|
51
|
+
/**
|
|
52
|
+
* Whether the item is non-interactive, i.e. both selection and actions are disabled and the item may
|
|
53
|
+
* not be focused. Dependent on `disabledKeys` and `disabledBehavior`.
|
|
54
|
+
* @selector [data-disabled]
|
|
55
|
+
*/
|
|
56
|
+
isDisabled: boolean,
|
|
57
|
+
/**
|
|
58
|
+
* The type of selection that is allowed in the collection.
|
|
59
|
+
* @selector [data-selection-mode="single | multiple"]
|
|
60
|
+
*/
|
|
61
|
+
selectionMode: SelectionMode,
|
|
62
|
+
/** The selection behavior for the collection. */
|
|
63
|
+
selectionBehavior: SelectionBehavior,
|
|
64
|
+
/**
|
|
65
|
+
* Whether the item allows dragging.
|
|
66
|
+
* @note This property is only available in collection components that support drag and drop.
|
|
67
|
+
* @selector [data-allows-dragging]
|
|
68
|
+
*/
|
|
69
|
+
allowsDragging?: boolean,
|
|
70
|
+
/**
|
|
71
|
+
* Whether the item is currently being dragged.
|
|
72
|
+
* @note This property is only available in collection components that support drag and drop.
|
|
73
|
+
* @selector [data-dragging]
|
|
74
|
+
*/
|
|
75
|
+
isDragging?: boolean,
|
|
76
|
+
/**
|
|
77
|
+
* Whether the item is currently an active drop target.
|
|
78
|
+
* @note This property is only available in collection components that support drag and drop.
|
|
79
|
+
* @selector [data-drop-target]
|
|
80
|
+
*/
|
|
81
|
+
isDropTarget?: boolean
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface SectionProps<T> extends Omit<SharedSectionProps<T>, 'children' | 'title'>, StyleProps, GlobalDOMAttributes<HTMLElement> {
|
|
85
|
+
/** The unique id of the section. */
|
|
86
|
+
id?: Key,
|
|
87
|
+
/** The object value that this section represents. When using dynamic collections, this is set automatically. */
|
|
88
|
+
value?: T,
|
|
89
|
+
/** Static child items or a function to render children. */
|
|
90
|
+
children?: ReactNode | ((item: T) => ReactElement),
|
|
91
|
+
/** Values that should invalidate the item cache when using dynamic collections. */
|
|
92
|
+
dependencies?: ReadonlyArray<any>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface SectionContextValue {
|
|
96
|
+
name: string,
|
|
97
|
+
render: (props: SectionProps<any>, ref: ForwardedRef<HTMLElement>, section: Node<any>, className?: string) => ReactElement
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const SectionContext = createContext<SectionContextValue | null>(null);
|
|
101
|
+
|
|
102
|
+
/** @deprecated */
|
|
103
|
+
export const Section = /*#__PURE__*/ createBranchComponent('section', <T extends object>(props: SectionProps<T>, ref: ForwardedRef<HTMLElement>, section: Node<T>): JSX.Element => {
|
|
104
|
+
let {name, render} = useContext(SectionContext)!;
|
|
105
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
106
|
+
console.warn(`<Section> is deprecated. Please use <${name}> instead.`);
|
|
107
|
+
}
|
|
108
|
+
return render(props, ref, section, 'react-aria-Section');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export interface CollectionBranchProps {
|
|
112
|
+
/** The collection of items to render. */
|
|
113
|
+
collection: ICollection<Node<unknown>>,
|
|
114
|
+
/** The parent node of the items to render. */
|
|
115
|
+
parent: Node<unknown>,
|
|
116
|
+
/** A function that renders a drop indicator between items. */
|
|
117
|
+
renderDropIndicator?: (target: ItemDropTarget) => ReactNode
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface CollectionRootProps extends HTMLAttributes<HTMLElement> {
|
|
121
|
+
/** The collection of items to render. */
|
|
122
|
+
collection: ICollection<Node<unknown>>,
|
|
123
|
+
/** A set of keys for items that should always be persisted in the DOM. */
|
|
124
|
+
persistedKeys?: Set<Key> | null,
|
|
125
|
+
/** A ref to the scroll container for the collection. */
|
|
126
|
+
scrollRef?: RefObject<HTMLElement | null>,
|
|
127
|
+
/** A function that renders a drop indicator between items. */
|
|
128
|
+
renderDropIndicator?: (target: ItemDropTarget) => ReactNode
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface CollectionRenderer {
|
|
132
|
+
/** Whether this is a virtualized collection. */
|
|
133
|
+
isVirtualized?: boolean,
|
|
134
|
+
/** A delegate object that provides layout information for items in the collection. */
|
|
135
|
+
layoutDelegate?: LayoutDelegate,
|
|
136
|
+
/** A delegate object that provides drop targets for pointer coordinates within the collection. */
|
|
137
|
+
dropTargetDelegate?: DropTargetDelegate,
|
|
138
|
+
/** A component that renders the root collection items. */
|
|
139
|
+
CollectionRoot: React.ComponentType<CollectionRootProps>,
|
|
140
|
+
/** A component that renders the child collection items. */
|
|
141
|
+
CollectionBranch: React.ComponentType<CollectionBranchProps>
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const DefaultCollectionRenderer: CollectionRenderer = {
|
|
145
|
+
CollectionRoot({collection, renderDropIndicator}) {
|
|
146
|
+
return useCollectionRender(collection, null, renderDropIndicator);
|
|
147
|
+
},
|
|
148
|
+
CollectionBranch({collection, parent, renderDropIndicator}) {
|
|
149
|
+
return useCollectionRender(collection, parent, renderDropIndicator);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
function useCollectionRender(
|
|
154
|
+
collection: ICollection<Node<unknown>>,
|
|
155
|
+
parent: Node<unknown> | null,
|
|
156
|
+
renderDropIndicator?: (target: ItemDropTarget) => ReactNode
|
|
157
|
+
) {
|
|
158
|
+
return useCachedChildren({
|
|
159
|
+
items: parent ? collection.getChildren!(parent.key) : collection,
|
|
160
|
+
dependencies: [renderDropIndicator],
|
|
161
|
+
children(node) {
|
|
162
|
+
// Return a empty fragment since we don't want to render the content twice
|
|
163
|
+
// If we don't skip the content node here, we end up rendering them twice in a Tree since we also render the content node in TreeItem
|
|
164
|
+
if (node.type === 'content') {
|
|
165
|
+
return <></>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
let rendered = node.render!(node);
|
|
169
|
+
if (!renderDropIndicator || node.type !== 'item') {
|
|
170
|
+
return rendered;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<>
|
|
175
|
+
{renderDropIndicator({type: 'item', key: node.key, dropPosition: 'before'})}
|
|
176
|
+
{rendered}
|
|
177
|
+
{renderAfterDropIndicators(collection, node, renderDropIndicator)}
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function renderAfterDropIndicators(collection: ICollection<Node<unknown>>, node: Node<unknown>, renderDropIndicator: (target: ItemDropTarget) => ReactNode): ReactNode {
|
|
185
|
+
let key = node.key;
|
|
186
|
+
let keyAfter = collection.getKeyAfter(key);
|
|
187
|
+
let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
|
|
188
|
+
while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== 'item') {
|
|
189
|
+
keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
|
|
190
|
+
nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
|
|
194
|
+
while (nextItemInSameLevel != null && nextItemInSameLevel.type !== 'item') {
|
|
195
|
+
nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Render one or more "after" drop indicators when the next item in the flattened collection
|
|
199
|
+
// has a smaller level, is not an item, or there are no more items in the collection.
|
|
200
|
+
// Otherwise, the "after" position is equivalent to the next item's "before" position.
|
|
201
|
+
let afterIndicators: ReactNode[] = [];
|
|
202
|
+
if (nextItemInSameLevel == null) {
|
|
203
|
+
let current: Node<unknown> | null = node;
|
|
204
|
+
while (current?.type === 'item' && (!nextItemInFlattenedCollection || (current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level))) {
|
|
205
|
+
let indicator = renderDropIndicator({
|
|
206
|
+
type: 'item',
|
|
207
|
+
key: current.key,
|
|
208
|
+
dropPosition: 'after'
|
|
209
|
+
});
|
|
210
|
+
if (isValidElement(indicator)) {
|
|
211
|
+
afterIndicators.push(cloneElement(indicator, {key: `${current.key}-after`}));
|
|
212
|
+
}
|
|
213
|
+
current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return afterIndicators;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const CollectionRendererContext = createContext<CollectionRenderer>(DefaultCollectionRenderer);
|
|
221
|
+
|
|
222
|
+
type PersistedKeysReturnValue = Set<Key> | null;
|
|
223
|
+
export function usePersistedKeys(focusedKey: Key | null): PersistedKeysReturnValue {
|
|
224
|
+
return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);
|
|
225
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {AriaColorAreaProps, useColorArea} from 'react-aria';
|
|
2
|
+
import {
|
|
3
|
+
ClassNameOrFunction,
|
|
4
|
+
dom,
|
|
5
|
+
Provider,
|
|
6
|
+
RenderProps,
|
|
7
|
+
SlotProps,
|
|
8
|
+
useContextProps,
|
|
9
|
+
useRenderProps
|
|
10
|
+
} from './utils';
|
|
11
|
+
import {ColorAreaContext} from './RSPContexts';
|
|
12
|
+
import {ColorAreaState, useColorAreaState} from 'react-stately';
|
|
13
|
+
import {filterDOMProps, mergeProps} from '@react-aria/utils';
|
|
14
|
+
import {GlobalDOMAttributes} from '@react-types/shared';
|
|
15
|
+
import {InternalColorThumbContext} from './ColorThumb';
|
|
16
|
+
import React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';
|
|
17
|
+
|
|
18
|
+
export interface ColorAreaRenderProps {
|
|
19
|
+
/**
|
|
20
|
+
* Whether the color area is disabled.
|
|
21
|
+
* @selector [data-disabled]
|
|
22
|
+
*/
|
|
23
|
+
isDisabled: boolean,
|
|
24
|
+
/**
|
|
25
|
+
* State of the color area.
|
|
26
|
+
*/
|
|
27
|
+
state: ColorAreaState
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ColorAreaProps extends AriaColorAreaProps, RenderProps<ColorAreaRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
31
|
+
/**
|
|
32
|
+
* 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.
|
|
33
|
+
* @default 'react-aria-ColorArea'
|
|
34
|
+
*/
|
|
35
|
+
className?: ClassNameOrFunction<ColorAreaRenderProps>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const ColorAreaStateContext = createContext<ColorAreaState | null>(null);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A color area allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
|
|
42
|
+
*/
|
|
43
|
+
export const ColorArea = forwardRef(function ColorArea(props: ColorAreaProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
44
|
+
[props, ref] = useContextProps(props, ref, ColorAreaContext);
|
|
45
|
+
let inputXRef = useRef(null);
|
|
46
|
+
let inputYRef = useRef(null);
|
|
47
|
+
|
|
48
|
+
let state = useColorAreaState(props);
|
|
49
|
+
let {
|
|
50
|
+
colorAreaProps,
|
|
51
|
+
xInputProps,
|
|
52
|
+
yInputProps,
|
|
53
|
+
thumbProps
|
|
54
|
+
} = useColorArea({
|
|
55
|
+
...props,
|
|
56
|
+
inputXRef,
|
|
57
|
+
inputYRef,
|
|
58
|
+
containerRef: ref
|
|
59
|
+
}, state);
|
|
60
|
+
|
|
61
|
+
let renderProps = useRenderProps({
|
|
62
|
+
...props,
|
|
63
|
+
defaultClassName: 'react-aria-ColorArea',
|
|
64
|
+
defaultStyle: colorAreaProps.style,
|
|
65
|
+
values: {
|
|
66
|
+
state,
|
|
67
|
+
isDisabled: props.isDisabled || false
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
let DOMProps = filterDOMProps(props, {global: true});
|
|
72
|
+
delete DOMProps.id;
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<dom.div
|
|
76
|
+
ref={ref}
|
|
77
|
+
{...mergeProps(DOMProps, colorAreaProps, renderProps)}
|
|
78
|
+
slot={props.slot || undefined}
|
|
79
|
+
data-disabled={props.isDisabled || undefined}>
|
|
80
|
+
<Provider
|
|
81
|
+
values={[
|
|
82
|
+
[ColorAreaStateContext, state],
|
|
83
|
+
[InternalColorThumbContext, {state, thumbProps, inputXRef, xInputProps, inputYRef, yInputProps, isDisabled: props.isDisabled}]
|
|
84
|
+
]}>
|
|
85
|
+
{renderProps.children}
|
|
86
|
+
</Provider>
|
|
87
|
+
</dom.div>
|
|
88
|
+
);
|
|
89
|
+
});
|