@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,243 @@
|
|
|
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
|
+
|
|
13
|
+
import {AriaColorFieldProps, useColorChannelField, useColorField, useLocale} from 'react-aria';
|
|
14
|
+
import {
|
|
15
|
+
ClassNameOrFunction,
|
|
16
|
+
dom,
|
|
17
|
+
Provider,
|
|
18
|
+
RACValidation,
|
|
19
|
+
removeDataAttributes,
|
|
20
|
+
RenderProps,
|
|
21
|
+
SlotProps,
|
|
22
|
+
useContextProps,
|
|
23
|
+
useRenderProps,
|
|
24
|
+
useSlot
|
|
25
|
+
} from './utils';
|
|
26
|
+
import {ColorChannel, ColorFieldState, ColorSpace, useColorChannelFieldState, useColorFieldState} from 'react-stately';
|
|
27
|
+
import {ColorFieldContext} from './RSPContexts';
|
|
28
|
+
import {FieldErrorContext} from './FieldError';
|
|
29
|
+
import {filterDOMProps} from '@react-aria/utils';
|
|
30
|
+
import {GlobalDOMAttributes, InputDOMProps, ValidationResult} from '@react-types/shared';
|
|
31
|
+
import {GroupContext} from './Group';
|
|
32
|
+
import {InputContext} from './Input';
|
|
33
|
+
import {LabelContext} from './Label';
|
|
34
|
+
import React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, Ref, useRef} from 'react';
|
|
35
|
+
import {TextContext} from './Text';
|
|
36
|
+
|
|
37
|
+
export interface ColorFieldRenderProps {
|
|
38
|
+
/**
|
|
39
|
+
* Whether the color field is disabled.
|
|
40
|
+
* @selector [data-disabled]
|
|
41
|
+
*/
|
|
42
|
+
isDisabled: boolean,
|
|
43
|
+
/**
|
|
44
|
+
* Whether the color field is invalid.
|
|
45
|
+
* @selector [data-invalid]
|
|
46
|
+
*/
|
|
47
|
+
isInvalid: boolean,
|
|
48
|
+
/**
|
|
49
|
+
* Whether the color field is read only.
|
|
50
|
+
* @selector [data-readonly]
|
|
51
|
+
*/
|
|
52
|
+
isReadOnly: boolean,
|
|
53
|
+
/**
|
|
54
|
+
* Whether the color field is required.
|
|
55
|
+
* @selector [data-required]
|
|
56
|
+
*/
|
|
57
|
+
isRequired: boolean,
|
|
58
|
+
/**
|
|
59
|
+
* The color channel that this field edits, or "hex" if no `channel` prop is set.
|
|
60
|
+
* @selector [data-channel="hex | hue | saturation | ..."]
|
|
61
|
+
*/
|
|
62
|
+
channel: ColorChannel | 'hex',
|
|
63
|
+
/**
|
|
64
|
+
* State of the color field.
|
|
65
|
+
*/
|
|
66
|
+
state: ColorFieldState
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ColorFieldProps extends Omit<AriaColorFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, InputDOMProps, RenderProps<ColorFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
70
|
+
/**
|
|
71
|
+
* 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.
|
|
72
|
+
* @default 'react-aria-ColorField'
|
|
73
|
+
*/
|
|
74
|
+
className?: ClassNameOrFunction<ColorFieldRenderProps>,
|
|
75
|
+
/**
|
|
76
|
+
* The color channel that this field edits. If not provided,
|
|
77
|
+
* the color is edited as a hex value.
|
|
78
|
+
*/
|
|
79
|
+
channel?: ColorChannel,
|
|
80
|
+
/**
|
|
81
|
+
* The color space that the color field operates in if a `channel` prop is provided.
|
|
82
|
+
* If no `channel` is provided, the color field always displays the color as an RGB hex value.
|
|
83
|
+
*/
|
|
84
|
+
colorSpace?: ColorSpace
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const ColorFieldStateContext = createContext<ColorFieldState | null>(null);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A color field allows users to edit a hex color or individual color channel value.
|
|
91
|
+
*/
|
|
92
|
+
export const ColorField = forwardRef(function ColorField(props: ColorFieldProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
93
|
+
[props, ref] = useContextProps(props, ref, ColorFieldContext);
|
|
94
|
+
if (props.channel) {
|
|
95
|
+
return <ColorChannelField {...props} channel={props.channel} forwardedRef={ref} />;
|
|
96
|
+
} else {
|
|
97
|
+
return <HexColorField {...props} forwardedRef={ref} />;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
interface ColorChannelFieldProps extends Omit<ColorFieldProps, 'channel'> {
|
|
102
|
+
channel: ColorChannel,
|
|
103
|
+
forwardedRef: ForwardedRef<HTMLDivElement>
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function ColorChannelField(props: ColorChannelFieldProps) {
|
|
107
|
+
let {locale} = useLocale();
|
|
108
|
+
let state = useColorChannelFieldState({
|
|
109
|
+
...props,
|
|
110
|
+
locale
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
let inputRef = useRef<HTMLInputElement>(null);
|
|
114
|
+
let [labelRef, label] = useSlot(
|
|
115
|
+
!props['aria-label'] && !props['aria-labelledby']
|
|
116
|
+
);
|
|
117
|
+
let {
|
|
118
|
+
labelProps,
|
|
119
|
+
inputProps,
|
|
120
|
+
descriptionProps,
|
|
121
|
+
errorMessageProps,
|
|
122
|
+
...validation
|
|
123
|
+
} = useColorChannelField({
|
|
124
|
+
...removeDataAttributes(props),
|
|
125
|
+
label,
|
|
126
|
+
validationBehavior: props.validationBehavior ?? 'native'
|
|
127
|
+
}, state, inputRef);
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<>
|
|
131
|
+
{useChildren(
|
|
132
|
+
props,
|
|
133
|
+
state,
|
|
134
|
+
props.forwardedRef,
|
|
135
|
+
inputProps,
|
|
136
|
+
inputRef,
|
|
137
|
+
labelProps,
|
|
138
|
+
labelRef,
|
|
139
|
+
descriptionProps,
|
|
140
|
+
errorMessageProps,
|
|
141
|
+
validation
|
|
142
|
+
)}
|
|
143
|
+
{props.name && <input type="hidden" name={props.name} form={props.form} value={isNaN(state.numberValue) ? '' : state.numberValue} />}
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface HexColorFieldProps extends ColorFieldProps {
|
|
149
|
+
forwardedRef: ForwardedRef<HTMLDivElement>
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function HexColorField(props: HexColorFieldProps) {
|
|
153
|
+
let state = useColorFieldState({
|
|
154
|
+
...props,
|
|
155
|
+
validationBehavior: props.validationBehavior ?? 'native'
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
let inputRef = useRef<HTMLInputElement>(null);
|
|
159
|
+
let [labelRef, label] = useSlot(
|
|
160
|
+
!props['aria-label'] && !props['aria-labelledby']
|
|
161
|
+
);
|
|
162
|
+
let {
|
|
163
|
+
labelProps,
|
|
164
|
+
inputProps,
|
|
165
|
+
descriptionProps,
|
|
166
|
+
errorMessageProps,
|
|
167
|
+
...validation
|
|
168
|
+
} = useColorField({
|
|
169
|
+
...removeDataAttributes(props),
|
|
170
|
+
label,
|
|
171
|
+
validationBehavior: props.validationBehavior ?? 'native'
|
|
172
|
+
}, state, inputRef);
|
|
173
|
+
|
|
174
|
+
return useChildren(
|
|
175
|
+
props,
|
|
176
|
+
state,
|
|
177
|
+
props.forwardedRef,
|
|
178
|
+
inputProps,
|
|
179
|
+
inputRef,
|
|
180
|
+
labelProps,
|
|
181
|
+
labelRef,
|
|
182
|
+
descriptionProps,
|
|
183
|
+
errorMessageProps,
|
|
184
|
+
validation
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function useChildren(
|
|
189
|
+
props: ColorFieldProps,
|
|
190
|
+
state: ColorFieldState,
|
|
191
|
+
ref: ForwardedRef<HTMLDivElement>,
|
|
192
|
+
inputProps: InputHTMLAttributes<HTMLElement>,
|
|
193
|
+
inputRef: Ref<HTMLInputElement>,
|
|
194
|
+
labelProps: LabelHTMLAttributes<HTMLLabelElement>,
|
|
195
|
+
labelRef: Ref<HTMLLabelElement>,
|
|
196
|
+
descriptionProps: HTMLAttributes<HTMLElement>,
|
|
197
|
+
errorMessageProps: HTMLAttributes<HTMLElement>,
|
|
198
|
+
validation: ValidationResult
|
|
199
|
+
) {
|
|
200
|
+
let renderProps = useRenderProps({
|
|
201
|
+
...props,
|
|
202
|
+
values: {
|
|
203
|
+
state,
|
|
204
|
+
channel: props.channel || 'hex',
|
|
205
|
+
isDisabled: props.isDisabled || false,
|
|
206
|
+
isInvalid: validation.isInvalid || false,
|
|
207
|
+
isReadOnly: props.isReadOnly || false,
|
|
208
|
+
isRequired: props.isRequired || false
|
|
209
|
+
},
|
|
210
|
+
defaultClassName: 'react-aria-ColorField'
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
let DOMProps = filterDOMProps(props, {global: true});
|
|
214
|
+
delete DOMProps.id;
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
<Provider
|
|
218
|
+
values={[
|
|
219
|
+
[ColorFieldStateContext, state],
|
|
220
|
+
[InputContext, {...inputProps, ref: inputRef}],
|
|
221
|
+
[LabelContext, {...labelProps, ref: labelRef}],
|
|
222
|
+
[GroupContext, {role: 'presentation', isInvalid: validation.isInvalid, isDisabled: props.isDisabled || false}],
|
|
223
|
+
[TextContext, {
|
|
224
|
+
slots: {
|
|
225
|
+
description: descriptionProps,
|
|
226
|
+
errorMessage: errorMessageProps
|
|
227
|
+
}
|
|
228
|
+
}],
|
|
229
|
+
[FieldErrorContext, validation]
|
|
230
|
+
]}>
|
|
231
|
+
<dom.div
|
|
232
|
+
{...DOMProps}
|
|
233
|
+
{...renderProps}
|
|
234
|
+
ref={ref}
|
|
235
|
+
slot={props.slot || undefined}
|
|
236
|
+
data-channel={props.channel || 'hex'}
|
|
237
|
+
data-disabled={props.isDisabled || undefined}
|
|
238
|
+
data-invalid={validation.isInvalid || undefined}
|
|
239
|
+
data-readonly={props.isReadOnly || undefined}
|
|
240
|
+
data-required={props.isRequired || undefined} />
|
|
241
|
+
</Provider>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 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
|
+
|
|
13
|
+
import {ChildrenOrFunction, Provider, SlotProps, SlottedContextValue, useRenderProps, useSlottedContext} from './utils';
|
|
14
|
+
import {Color, ColorPickerState, ColorPickerProps as StatelyColorPickerProps, useColorPickerState} from 'react-stately';
|
|
15
|
+
import {ColorAreaContext, ColorFieldContext, ColorSliderContext, ColorWheelContext} from './RSPContexts';
|
|
16
|
+
import {ColorSwatchContext} from './ColorSwatch';
|
|
17
|
+
import {ColorSwatchPickerContext} from './ColorSwatchPicker';
|
|
18
|
+
import {mergeProps} from 'react-aria';
|
|
19
|
+
import React, {createContext, JSX} from 'react';
|
|
20
|
+
|
|
21
|
+
export interface ColorPickerRenderProps {
|
|
22
|
+
/** The currently selected color. */
|
|
23
|
+
color: Color
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ColorPickerProps extends StatelyColorPickerProps, SlotProps {
|
|
27
|
+
/** The children of the component. A function may be provided to alter the children based on component state. */
|
|
28
|
+
children: ChildrenOrFunction<ColorPickerRenderProps>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const ColorPickerContext = createContext<SlottedContextValue<ColorPickerProps>>(null);
|
|
32
|
+
export const ColorPickerStateContext = createContext<ColorPickerState | null>(null);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A ColorPicker synchronizes a color value between multiple React Aria color components.
|
|
36
|
+
* It simplifies building color pickers with customizable layouts via composition.
|
|
37
|
+
*/
|
|
38
|
+
export function ColorPicker(props: ColorPickerProps): JSX.Element {
|
|
39
|
+
let ctx = useSlottedContext(ColorPickerContext, props.slot);
|
|
40
|
+
props = mergeProps(ctx, props);
|
|
41
|
+
let state = useColorPickerState(props);
|
|
42
|
+
let renderProps = useRenderProps({
|
|
43
|
+
...props,
|
|
44
|
+
values: {
|
|
45
|
+
color: state.color
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Provider
|
|
51
|
+
values={[
|
|
52
|
+
[ColorPickerStateContext, state],
|
|
53
|
+
[ColorSliderContext, {value: state.color, onChange: state.setColor}],
|
|
54
|
+
[ColorAreaContext, {value: state.color, onChange: state.setColor}],
|
|
55
|
+
[ColorWheelContext, {value: state.color, onChange: state.setColor}],
|
|
56
|
+
[ColorFieldContext, {value: state.color, onChange: state.setColor}],
|
|
57
|
+
[ColorSwatchContext, {color: state.color}],
|
|
58
|
+
[ColorSwatchPickerContext, {value: state.color, onChange: state.setColor}]
|
|
59
|
+
]}>
|
|
60
|
+
{renderProps.children}
|
|
61
|
+
</Provider>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {AriaColorSliderProps, Orientation, useColorSlider, useLocale} from 'react-aria';
|
|
2
|
+
import {
|
|
3
|
+
ClassNameOrFunction,
|
|
4
|
+
dom,
|
|
5
|
+
Provider,
|
|
6
|
+
RenderProps,
|
|
7
|
+
SlotProps,
|
|
8
|
+
useContextProps,
|
|
9
|
+
useRenderProps,
|
|
10
|
+
useSlot
|
|
11
|
+
} from './utils';
|
|
12
|
+
import {ColorSliderContext} from './RSPContexts';
|
|
13
|
+
import {ColorSliderState, useColorSliderState} from 'react-stately';
|
|
14
|
+
import {filterDOMProps} from '@react-aria/utils';
|
|
15
|
+
import {GlobalDOMAttributes} from '@react-types/shared';
|
|
16
|
+
import {InternalColorThumbContext} from './ColorThumb';
|
|
17
|
+
import {LabelContext} from './Label';
|
|
18
|
+
import React, {createContext, ForwardedRef, forwardRef} from 'react';
|
|
19
|
+
import {SliderOutputContext, SliderStateContext, SliderTrackContext} from './Slider';
|
|
20
|
+
|
|
21
|
+
export interface ColorSliderRenderProps {
|
|
22
|
+
/**
|
|
23
|
+
* The orientation of the color slider.
|
|
24
|
+
* @selector [data-orientation="horizontal | vertical"]
|
|
25
|
+
*/
|
|
26
|
+
orientation: Orientation,
|
|
27
|
+
/**
|
|
28
|
+
* Whether the color slider is disabled.
|
|
29
|
+
* @selector [data-disabled]
|
|
30
|
+
*/
|
|
31
|
+
isDisabled: boolean,
|
|
32
|
+
/**
|
|
33
|
+
* State of the color slider.
|
|
34
|
+
*/
|
|
35
|
+
state: ColorSliderState
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ColorSliderProps extends Omit<AriaColorSliderProps, 'label'>, RenderProps<ColorSliderRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
39
|
+
/**
|
|
40
|
+
* 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.
|
|
41
|
+
* @default 'react-aria-ColorSlider'
|
|
42
|
+
*/
|
|
43
|
+
className?: ClassNameOrFunction<ColorSliderRenderProps>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const ColorSliderStateContext = createContext<ColorSliderState | null>(null);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A color slider allows users to adjust an individual channel of a color value.
|
|
50
|
+
*/
|
|
51
|
+
export const ColorSlider = forwardRef(function ColorSlider(props: ColorSliderProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
52
|
+
[props, ref] = useContextProps(props, ref, ColorSliderContext);
|
|
53
|
+
let {locale} = useLocale();
|
|
54
|
+
let state = useColorSliderState({...props, locale});
|
|
55
|
+
let trackRef = React.useRef(null);
|
|
56
|
+
let inputRef = React.useRef(null);
|
|
57
|
+
|
|
58
|
+
let [labelRef, label] = useSlot(
|
|
59
|
+
!props['aria-label'] && !props['aria-labelledby']
|
|
60
|
+
);
|
|
61
|
+
let {
|
|
62
|
+
trackProps,
|
|
63
|
+
thumbProps,
|
|
64
|
+
inputProps,
|
|
65
|
+
labelProps,
|
|
66
|
+
outputProps
|
|
67
|
+
} = useColorSlider({
|
|
68
|
+
...props,
|
|
69
|
+
label,
|
|
70
|
+
trackRef,
|
|
71
|
+
inputRef
|
|
72
|
+
}, state);
|
|
73
|
+
|
|
74
|
+
let renderProps = useRenderProps({
|
|
75
|
+
...props,
|
|
76
|
+
values: {
|
|
77
|
+
orientation: state.orientation,
|
|
78
|
+
isDisabled: state.isDisabled,
|
|
79
|
+
state
|
|
80
|
+
},
|
|
81
|
+
defaultClassName: 'react-aria-ColorSlider'
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
let DOMProps = filterDOMProps(props, {global: true});
|
|
85
|
+
delete DOMProps.id;
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Provider
|
|
89
|
+
values={[
|
|
90
|
+
[ColorSliderStateContext, state],
|
|
91
|
+
[SliderStateContext, state],
|
|
92
|
+
[SliderTrackContext, {...trackProps, ref: trackRef}],
|
|
93
|
+
[SliderOutputContext, outputProps],
|
|
94
|
+
[LabelContext, {
|
|
95
|
+
...labelProps,
|
|
96
|
+
ref: labelRef,
|
|
97
|
+
children: state.value.getChannelName(props.channel, locale)
|
|
98
|
+
}],
|
|
99
|
+
[InternalColorThumbContext, {state, thumbProps, inputXRef: inputRef, xInputProps: inputProps, isDisabled: props.isDisabled}]
|
|
100
|
+
]}>
|
|
101
|
+
<dom.div
|
|
102
|
+
{...DOMProps}
|
|
103
|
+
{...renderProps}
|
|
104
|
+
ref={ref}
|
|
105
|
+
slot={props.slot || undefined}
|
|
106
|
+
data-orientation={state.orientation}
|
|
107
|
+
data-disabled={state.isDisabled || undefined} />
|
|
108
|
+
</Provider>
|
|
109
|
+
);
|
|
110
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {AriaColorSwatchProps, useColorSwatch} from 'react-aria';
|
|
2
|
+
import {
|
|
3
|
+
ClassNameOrFunction,
|
|
4
|
+
ContextValue,
|
|
5
|
+
dom,
|
|
6
|
+
SlotProps,
|
|
7
|
+
StyleRenderProps,
|
|
8
|
+
useContextProps,
|
|
9
|
+
useRenderProps
|
|
10
|
+
} from './utils';
|
|
11
|
+
import {Color} from 'react-stately';
|
|
12
|
+
import {filterDOMProps, mergeProps} from '@react-aria/utils';
|
|
13
|
+
import {GlobalDOMAttributes} from '@react-types/shared';
|
|
14
|
+
import React, {createContext, ForwardedRef, forwardRef} from 'react';
|
|
15
|
+
|
|
16
|
+
export interface ColorSwatchRenderProps {
|
|
17
|
+
/** The color of the swatch. */
|
|
18
|
+
color: Color
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ColorSwatchProps extends AriaColorSwatchProps, StyleRenderProps<ColorSwatchRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {
|
|
22
|
+
/**
|
|
23
|
+
* 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.
|
|
24
|
+
* @default 'react-aria-ColorSwatch'
|
|
25
|
+
*/
|
|
26
|
+
className?: ClassNameOrFunction<ColorSwatchRenderProps>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const ColorSwatchContext = createContext<ContextValue<ColorSwatchProps, HTMLDivElement>>(null);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A ColorSwatch displays a preview of a selected color.
|
|
33
|
+
*/
|
|
34
|
+
export const ColorSwatch = forwardRef(function ColorSwatch(props: ColorSwatchProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
35
|
+
[props, ref] = useContextProps(props, ref, ColorSwatchContext);
|
|
36
|
+
let {colorSwatchProps, color} = useColorSwatch(props);
|
|
37
|
+
let renderProps = useRenderProps({
|
|
38
|
+
...props,
|
|
39
|
+
defaultClassName: 'react-aria-ColorSwatch',
|
|
40
|
+
defaultStyle: colorSwatchProps.style,
|
|
41
|
+
values: {
|
|
42
|
+
color
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
let DOMProps = filterDOMProps(props, {global: true});
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<dom.div
|
|
50
|
+
{...mergeProps(DOMProps, colorSwatchProps, renderProps)}
|
|
51
|
+
slot={props.slot || undefined}
|
|
52
|
+
ref={ref} />
|
|
53
|
+
);
|
|
54
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import {AriaLabelingProps, GlobalDOMAttributes, HoverEvents, PressEvents, ValueBase} from '@react-types/shared';
|
|
2
|
+
import {
|
|
3
|
+
ClassNameOrFunction,
|
|
4
|
+
composeRenderProps,
|
|
5
|
+
ContextValue,
|
|
6
|
+
RenderProps,
|
|
7
|
+
StyleRenderProps,
|
|
8
|
+
useContextProps
|
|
9
|
+
} from './utils';
|
|
10
|
+
import {Color, parseColor, useColorPickerState} from 'react-stately';
|
|
11
|
+
import {ColorSwatchContext} from './ColorSwatch';
|
|
12
|
+
import {filterDOMProps} from '@react-aria/utils';
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import intlMessages from '../intl/*.json';
|
|
15
|
+
import {ListBox, ListBoxItem, ListBoxItemRenderProps, ListBoxRenderProps} from './ListBox';
|
|
16
|
+
import React, {createContext, ForwardedRef, forwardRef, ReactNode, useContext, useEffect, useMemo} from 'react';
|
|
17
|
+
import {useLocale, useLocalizedStringFormatter} from 'react-aria';
|
|
18
|
+
|
|
19
|
+
export interface ColorSwatchPickerRenderProps extends Omit<ListBoxRenderProps, 'isDropTarget'> {}
|
|
20
|
+
export interface ColorSwatchPickerProps extends ValueBase<string | Color, Color>, AriaLabelingProps, StyleRenderProps<ColorSwatchPickerRenderProps>, GlobalDOMAttributes<HTMLDivElement> {
|
|
21
|
+
/**
|
|
22
|
+
* 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.
|
|
23
|
+
* @default 'react-aria-ColorSwatchPicker'
|
|
24
|
+
*/
|
|
25
|
+
className?: ClassNameOrFunction<ColorSwatchPickerRenderProps>,
|
|
26
|
+
/** The children of the ColorSwatchPicker. */
|
|
27
|
+
children?: ReactNode,
|
|
28
|
+
/**
|
|
29
|
+
* Whether the items are arranged in a stack or grid.
|
|
30
|
+
* @default 'grid'
|
|
31
|
+
*/
|
|
32
|
+
layout?: 'grid' | 'stack'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const ColorSwatchPickerContext = createContext<ContextValue<ColorSwatchPickerProps, HTMLDivElement>>(null);
|
|
36
|
+
const ColorMapContext = createContext<Map<string, Color> | null>(null);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A ColorSwatchPicker displays a list of color swatches and allows a user to select one of them.
|
|
40
|
+
*/
|
|
41
|
+
export const ColorSwatchPicker = forwardRef(function ColorSwatchPicker(props: ColorSwatchPickerProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
42
|
+
[props, ref] = useContextProps(props, ref, ColorSwatchPickerContext);
|
|
43
|
+
let state = useColorPickerState(props);
|
|
44
|
+
let colorMap = useMemo(() => new Map(), []);
|
|
45
|
+
let formatter = useLocalizedStringFormatter(intlMessages, 'react-aria-components');
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ListBox
|
|
49
|
+
{...filterDOMProps(props, {labelable: true})}
|
|
50
|
+
ref={ref}
|
|
51
|
+
className={props.className || 'react-aria-ColorSwatchPicker'}
|
|
52
|
+
style={props.style}
|
|
53
|
+
aria-label={props['aria-label'] || (!props['aria-labelledby'] ? formatter.format('colorSwatchPicker') : undefined)}
|
|
54
|
+
layout={props.layout || 'grid'}
|
|
55
|
+
selectionMode="single"
|
|
56
|
+
selectedKeys={[state.color.toString('hexa')]}
|
|
57
|
+
onSelectionChange={(keys) => {
|
|
58
|
+
// single select, 'all' cannot occur. appease typescript.
|
|
59
|
+
if (keys !== 'all') {
|
|
60
|
+
state.setColor(colorMap.get([...keys][0]));
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
disallowEmptySelection>
|
|
64
|
+
<ColorMapContext.Provider value={colorMap}>
|
|
65
|
+
{props.children}
|
|
66
|
+
</ColorMapContext.Provider>
|
|
67
|
+
</ListBox>
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export interface ColorSwatchPickerItemRenderProps extends Omit<ListBoxItemRenderProps, 'selectionMode' | 'selectionBehavior'> {
|
|
72
|
+
/** The color of the swatch. */
|
|
73
|
+
color: Color
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ColorSwatchPickerItemProps extends RenderProps<ColorSwatchPickerItemRenderProps>, HoverEvents, PressEvents, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {
|
|
77
|
+
/**
|
|
78
|
+
* 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.
|
|
79
|
+
* @default 'react-aria-ColorSwatchPickerItem'
|
|
80
|
+
*/
|
|
81
|
+
className?: ClassNameOrFunction<ColorSwatchPickerItemRenderProps>,
|
|
82
|
+
/** The color of the swatch. */
|
|
83
|
+
color: string | Color,
|
|
84
|
+
/** Whether the color swatch is disabled. */
|
|
85
|
+
isDisabled?: boolean
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const ColorSwatchPickerItem = forwardRef(function ColorSwatchPickerItem(props: ColorSwatchPickerItemProps, ref: ForwardedRef<HTMLDivElement>) {
|
|
89
|
+
let propColor = props.color || '#0000';
|
|
90
|
+
let color = useMemo(() => typeof propColor === 'string' ? parseColor(propColor) : propColor, [propColor]);
|
|
91
|
+
let {locale} = useLocale();
|
|
92
|
+
let map = useContext(ColorMapContext)!;
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
let key = color.toString('hexa');
|
|
95
|
+
map.set(key, color);
|
|
96
|
+
return () => {
|
|
97
|
+
map.delete(key);
|
|
98
|
+
};
|
|
99
|
+
}, [color, map]);
|
|
100
|
+
|
|
101
|
+
let wrap = (v) => {
|
|
102
|
+
if (typeof v === 'function') {
|
|
103
|
+
return (renderProps) => v({...renderProps, color});
|
|
104
|
+
}
|
|
105
|
+
return v;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<ListBoxItem
|
|
110
|
+
{...props}
|
|
111
|
+
// ColorSwatchPickerItem is never a link.
|
|
112
|
+
render={props.render as any}
|
|
113
|
+
ref={ref}
|
|
114
|
+
id={color.toString('hexa')}
|
|
115
|
+
textValue={color.getColorName(locale)}
|
|
116
|
+
className={wrap(props.className || 'react-aria-ColorSwatchPickerItem')}
|
|
117
|
+
style={wrap(props.style)}>
|
|
118
|
+
{composeRenderProps(wrap(props.children), children => (
|
|
119
|
+
<ColorSwatchContext.Provider value={{color}}>
|
|
120
|
+
{children}
|
|
121
|
+
</ColorSwatchContext.Provider>
|
|
122
|
+
))}
|
|
123
|
+
</ListBoxItem>
|
|
124
|
+
);
|
|
125
|
+
});
|