react-aria-components 1.4.1 → 1.6.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/README.md +1 -1
- package/dist/Autocomplete.main.js +80 -0
- package/dist/Autocomplete.main.js.map +1 -0
- package/dist/Autocomplete.mjs +68 -0
- package/dist/Autocomplete.module.js +68 -0
- package/dist/Autocomplete.module.js.map +1 -0
- package/dist/Breadcrumbs.main.js +4 -7
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +5 -8
- package/dist/Breadcrumbs.module.js +5 -8
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +5 -5
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +5 -5
- package/dist/Button.module.js +5 -5
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +29 -28
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +30 -29
- package/dist/Calendar.module.js +30 -29
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +5 -12
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +6 -13
- package/dist/Checkbox.module.js +6 -13
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js +3 -2
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.mjs +3 -2
- package/dist/Collection.module.js +3 -2
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +2 -5
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +3 -6
- package/dist/ColorArea.module.js +3 -6
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +2 -5
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +2 -5
- package/dist/ColorField.module.js +2 -5
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +2 -5
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +2 -5
- package/dist/ColorSlider.module.js +2 -5
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +2 -5
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +2 -5
- package/dist/ColorSwatch.module.js +2 -5
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +4 -8
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +5 -9
- package/dist/ColorSwatchPicker.module.js +5 -9
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +2 -5
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -6
- package/dist/ColorThumb.module.js +3 -6
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +5 -11
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +6 -12
- package/dist/ColorWheel.module.js +6 -12
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -7
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +5 -8
- package/dist/ComboBox.module.js +5 -8
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +8 -23
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +9 -24
- package/dist/DateField.module.js +9 -24
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +4 -11
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +5 -12
- package/dist/DatePicker.module.js +5 -12
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +36 -15
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +39 -18
- package/dist/Dialog.module.js +39 -18
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +8 -16
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +8 -16
- package/dist/Disclosure.module.js +8 -16
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +3 -6
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +4 -7
- package/dist/DragAndDrop.module.js +4 -7
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +2 -5
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +3 -6
- package/dist/DropZone.module.js +3 -6
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +2 -5
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -6
- package/dist/FieldError.module.js +3 -6
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +2 -5
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +2 -5
- package/dist/FileTrigger.module.js +2 -5
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js +2 -6
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.mjs +2 -6
- package/dist/Form.module.js +2 -6
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +3 -6
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +4 -7
- package/dist/GridList.module.js +4 -7
- package/dist/GridList.module.js.map +1 -1
- package/dist/Group.main.js +2 -5
- package/dist/Group.main.js.map +1 -1
- package/dist/Group.mjs +2 -5
- package/dist/Group.module.js +2 -5
- package/dist/Group.module.js.map +1 -1
- package/dist/Heading.main.js +2 -3
- package/dist/Heading.main.js.map +1 -1
- package/dist/Heading.mjs +2 -3
- package/dist/Heading.module.js +2 -3
- package/dist/Heading.module.js.map +1 -1
- package/dist/Input.main.js +2 -5
- package/dist/Input.main.js.map +1 -1
- package/dist/Input.mjs +2 -5
- package/dist/Input.module.js +2 -5
- package/dist/Input.module.js.map +1 -1
- package/dist/Keyboard.main.js +2 -3
- package/dist/Keyboard.main.js.map +1 -1
- package/dist/Keyboard.mjs +2 -3
- package/dist/Keyboard.module.js +2 -3
- package/dist/Keyboard.module.js.map +1 -1
- package/dist/Label.main.js +2 -3
- package/dist/Label.main.js.map +1 -1
- package/dist/Label.mjs +2 -3
- package/dist/Label.module.js +2 -3
- package/dist/Label.module.js.map +1 -1
- package/dist/Link.main.js +2 -6
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +2 -6
- package/dist/Link.module.js +2 -6
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +25 -9
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +28 -13
- package/dist/ListBox.module.js +28 -13
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +84 -65
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +87 -69
- package/dist/Menu.module.js +87 -69
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +2 -5
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +2 -5
- package/dist/Meter.module.js +2 -5
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +7 -10
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +10 -13
- package/dist/Modal.module.js +10 -13
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +2 -5
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +3 -6
- package/dist/NumberField.module.js +3 -6
- package/dist/NumberField.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +3 -7
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +3 -7
- package/dist/OverlayArrow.module.js +3 -7
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +5 -7
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +8 -10
- package/dist/Popover.module.js +8 -10
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +2 -6
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +2 -6
- package/dist/ProgressBar.module.js +2 -6
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +4 -10
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +4 -10
- package/dist/RadioGroup.module.js +4 -10
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +6 -8
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +8 -10
- package/dist/SearchField.module.js +8 -10
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +6 -12
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +7 -13
- package/dist/Select.module.js +7 -13
- package/dist/Select.module.js.map +1 -1
- package/dist/Slider.main.js +8 -20
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +9 -21
- package/dist/Slider.module.js +9 -21
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +2 -5
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +2 -5
- package/dist/Switch.module.js +2 -5
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +9 -22
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +10 -23
- package/dist/Table.module.js +10 -23
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +9 -17
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +11 -19
- package/dist/Tabs.module.js +11 -19
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +4 -10
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +5 -11
- package/dist/TagGroup.module.js +5 -11
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/Text.main.js +2 -3
- package/dist/Text.main.js.map +1 -1
- package/dist/Text.mjs +2 -3
- package/dist/Text.module.js +2 -3
- package/dist/Text.module.js.map +1 -1
- package/dist/TextArea.main.js +2 -5
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.mjs +2 -5
- package/dist/TextArea.module.js +2 -5
- package/dist/TextArea.module.js.map +1 -1
- package/dist/TextField.main.js +9 -9
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +11 -11
- package/dist/TextField.module.js +11 -11
- package/dist/TextField.module.js.map +1 -1
- package/dist/ToggleButton.main.js +22 -10
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +24 -12
- package/dist/ToggleButton.module.js +24 -12
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +59 -0
- package/dist/ToggleButtonGroup.main.js.map +1 -0
- package/dist/ToggleButtonGroup.mjs +48 -0
- package/dist/ToggleButtonGroup.module.js +48 -0
- package/dist/ToggleButtonGroup.module.js.map +1 -0
- package/dist/Toolbar.main.js +2 -6
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +2 -6
- package/dist/Toolbar.module.js +2 -6
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +7 -9
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +10 -12
- package/dist/Tooltip.module.js +10 -12
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +2 -6
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +3 -7
- package/dist/Tree.module.js +3 -7
- package/dist/Tree.module.js.map +1 -1
- package/dist/Virtualizer.main.js.map +1 -1
- package/dist/Virtualizer.module.js.map +1 -1
- package/dist/import.mjs +8 -4
- package/dist/main.js +16 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -4
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +371 -324
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js +0 -61
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +1 -60
- package/dist/utils.module.js +1 -60
- package/dist/utils.module.js.map +1 -1
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.mjs +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +35 -33
- package/src/Autocomplete.tsx +71 -0
- package/src/Breadcrumbs.tsx +5 -8
- package/src/Button.tsx +8 -8
- package/src/Calendar.tsx +35 -39
- package/src/Checkbox.tsx +11 -17
- package/src/Collection.tsx +7 -4
- package/src/ColorArea.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +7 -13
- package/src/ColorThumb.tsx +5 -8
- package/src/ColorWheel.tsx +10 -16
- package/src/ComboBox.tsx +5 -8
- package/src/DateField.tsx +21 -33
- package/src/DatePicker.tsx +9 -15
- package/src/Dialog.tsx +34 -22
- package/src/Disclosure.tsx +28 -29
- package/src/DragAndDrop.tsx +7 -10
- package/src/DropZone.tsx +5 -8
- package/src/FieldError.tsx +5 -8
- package/src/FileTrigger.tsx +5 -8
- package/src/Form.tsx +6 -9
- package/src/GridList.tsx +7 -9
- package/src/Group.tsx +5 -8
- package/src/Heading.tsx +2 -5
- package/src/Input.tsx +5 -8
- package/src/Keyboard.tsx +2 -5
- package/src/Label.tsx +2 -5
- package/src/Link.tsx +6 -9
- package/src/ListBox.tsx +24 -15
- package/src/Menu.tsx +88 -58
- package/src/Meter.tsx +5 -8
- package/src/Modal.tsx +7 -10
- package/src/NumberField.tsx +5 -8
- package/src/OverlayArrow.tsx +11 -12
- package/src/Popover.tsx +9 -12
- package/src/ProgressBar.tsx +6 -9
- package/src/RadioGroup.tsx +10 -16
- package/src/SearchField.tsx +9 -11
- package/src/Select.tsx +13 -18
- package/src/Slider.tsx +20 -32
- package/src/Switch.tsx +5 -8
- package/src/Table.tsx +12 -21
- package/src/Tabs.tsx +18 -25
- package/src/TagGroup.tsx +8 -14
- package/src/Text.tsx +2 -5
- package/src/TextArea.tsx +5 -7
- package/src/TextField.tsx +11 -13
- package/src/ToggleButton.tsx +31 -17
- package/src/ToggleButtonGroup.tsx +65 -0
- package/src/Toolbar.tsx +6 -9
- package/src/Tooltip.tsx +11 -13
- package/src/Tree.tsx +6 -9
- package/src/Virtualizer.tsx +2 -2
- package/src/index.ts +11 -7
- package/src/utils.tsx +0 -71
package/dist/TextArea.module.js
CHANGED
|
@@ -11,7 +11,7 @@ let $216918bed6669f72$var$filterHoverProps = (props)=>{
|
|
|
11
11
|
let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
|
|
12
12
|
return otherProps;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const $216918bed6669f72$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $9Usiy$forwardRef)(function TextArea(props, ref) {
|
|
15
15
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $216918bed6669f72$export$2dc6166a7e65358c);
|
|
16
16
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9Usiy$useHover)(props);
|
|
17
17
|
let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $9Usiy$useFocusRing)({
|
|
@@ -40,10 +40,7 @@ function $216918bed6669f72$var$TextArea(props, ref) {
|
|
|
40
40
|
"data-focus-visible": isFocusVisible || undefined,
|
|
41
41
|
"data-invalid": isInvalid || undefined
|
|
42
42
|
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* A textarea allows a user to input mult-line text.
|
|
46
|
-
*/ const $216918bed6669f72$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $9Usiy$forwardRef)($216918bed6669f72$var$TextArea);
|
|
43
|
+
});
|
|
47
44
|
|
|
48
45
|
|
|
49
46
|
export {$216918bed6669f72$export$2dc6166a7e65358c as TextAreaContext, $216918bed6669f72$export$f5c9f3c2c4054eec as TextArea};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;
|
|
1
|
+
{"mappings":";;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAsC;IAC/G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A textarea allows a user to input mult-line text.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.module.js.map"}
|
package/dist/TextField.main.js
CHANGED
|
@@ -41,12 +41,13 @@ $parcel$export(module.exports, "TextField", () => $3f2c5af9d7d8905b$export$2c732
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
const $3f2c5af9d7d8905b$export$2129e27b3ef0d483 = /*#__PURE__*/ (0, $1Ma1u$react.createContext)(null);
|
|
44
|
-
|
|
44
|
+
const $3f2c5af9d7d8905b$export$2c73285ae9390cec = /*#__PURE__*/ (0, $1Ma1u$react.forwardRef)(function TextField(props, ref) {
|
|
45
45
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $3f2c5af9d7d8905b$export$2129e27b3ef0d483);
|
|
46
46
|
let { validationBehavior: formValidationBehavior } = (0, $c5ccf687772c0422$exports.useSlottedContext)((0, $35157657e549736b$exports.FormContext)) || {};
|
|
47
47
|
var _props_validationBehavior, _ref;
|
|
48
48
|
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
49
49
|
let inputRef = (0, $1Ma1u$react.useRef)(null);
|
|
50
|
+
let [inputContextProps, mergedInputRef] = (0, $c5ccf687772c0422$exports.useContextProps)({}, inputRef, (0, $1bcfcef5af644e13$exports.InputContext));
|
|
50
51
|
let [labelRef, label] = (0, $c5ccf687772c0422$exports.useSlot)();
|
|
51
52
|
let [inputElementType, setInputElementType] = (0, $1Ma1u$react.useState)('input');
|
|
52
53
|
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $1Ma1u$reactaria.useTextField)({
|
|
@@ -54,13 +55,15 @@ function $3f2c5af9d7d8905b$var$TextField(props, ref) {
|
|
|
54
55
|
inputElementType: inputElementType,
|
|
55
56
|
label: label,
|
|
56
57
|
validationBehavior: validationBehavior
|
|
57
|
-
},
|
|
58
|
+
}, mergedInputRef);
|
|
58
59
|
// Intercept setting the input ref so we can determine what kind of element we have.
|
|
59
60
|
// useTextField uses this to determine what props to include.
|
|
60
61
|
let inputOrTextAreaRef = (0, $1Ma1u$react.useCallback)((el)=>{
|
|
61
|
-
|
|
62
|
+
mergedInputRef.current = el;
|
|
62
63
|
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? 'textarea' : 'input');
|
|
63
|
-
}, [
|
|
64
|
+
}, [
|
|
65
|
+
mergedInputRef
|
|
66
|
+
]);
|
|
64
67
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
65
68
|
...props,
|
|
66
69
|
values: {
|
|
@@ -94,7 +97,7 @@ function $3f2c5af9d7d8905b$var$TextField(props, ref) {
|
|
|
94
97
|
[
|
|
95
98
|
(0, $1bcfcef5af644e13$exports.InputContext),
|
|
96
99
|
{
|
|
97
|
-
...inputProps,
|
|
100
|
+
...(0, $1Ma1u$reactariautils.mergeProps)(inputProps, inputContextProps),
|
|
98
101
|
ref: inputOrTextAreaRef
|
|
99
102
|
}
|
|
100
103
|
],
|
|
@@ -120,10 +123,7 @@ function $3f2c5af9d7d8905b$var$TextField(props, ref) {
|
|
|
120
123
|
]
|
|
121
124
|
]
|
|
122
125
|
}, renderProps.children));
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* A text field allows a user to enter a plain text value with a keyboard.
|
|
126
|
-
*/ const $3f2c5af9d7d8905b$export$2c73285ae9390cec = /*#__PURE__*/ (0, $1Ma1u$react.forwardRef)($3f2c5af9d7d8905b$var$TextField);
|
|
126
|
+
});
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
//# sourceMappingURL=TextField.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAgD;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAAgD;AAKrF,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,UAAU,KAAqB,EAAE,GAAiC;IAC/I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE,CAAA,GAAA,qCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,CAAC,mBAAmB,eAAe,GAAG,CAAA,GAAA,yCAAc,EAAE,CAAC,GAAG,UAAU,CAAA,GAAA,sCAAW;IACnF,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,CAAC,kBAAkB,oBAAoB,GAAG,CAAA,GAAA,qBAAO,EAAE;IACvD,IAAI,cAAC,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,6BAAW,EAAO;QACnG,GAAG,CAAA,GAAA,8CAAmB,EAAE,MAAM;0BAC9B;eACA;4BACA;IACF,GAAG;IAEH,oFAAoF;IACpF,6DAA6D;IAC7D,IAAI,qBAAqB,CAAA,GAAA,wBAAU,EAAE,CAAC;QACpC,eAAe,OAAO,GAAG;QACzB,IAAI,IACF,oBAAoB,cAAc,sBAAsB,aAAa;IAEzE,GAAG;QAAC;KAAe;IAEnB,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,YAAY,MAAM,UAAU,IAAI;YAChC,WAAW,WAAW,SAAS;YAC/B,YAAY,MAAM,UAAU,IAAI;YAChC,YAAY,MAAM,UAAU,IAAI;QAClC;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,WAAW,SAAS,IAAI;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,sCAAW;gBAAG;oBAAC,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,kBAAkB;oBAAE,KAAK;gBAAkB;aAAE;YACvF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAkB;aAAE;YAC3D;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;aAAW;SAChC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTextFieldProps, useTextField} from 'react-aria';\nimport {ContextValue, DOMProps, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType} from '@react-types/shared';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextAreaContext} from './TextArea';\nimport {TextContext} from './Text';\n\nexport interface TextFieldRenderProps {\n /**\n * Whether the text field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the value is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the text field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the text field is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, Omit<DOMProps, 'style' | 'className' | 'children'>, SlotProps, RenderProps<TextFieldRenderProps> {\n /** Whether the value is invalid. */\n isInvalid?: boolean\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, HTMLDivElement>>(null);\n\n/**\n * A text field allows a user to enter a plain text value with a keyboard.\n */\nexport const TextField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TextField(props: TextFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let inputRef = useRef(null);\n let [inputContextProps, mergedInputRef] = useContextProps({}, inputRef, InputContext);\n let [labelRef, label] = useSlot();\n let [inputElementType, setInputElementType] = useState('input');\n let {labelProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTextField<any>({\n ...removeDataAttributes(props),\n inputElementType,\n label,\n validationBehavior\n }, mergedInputRef);\n\n // Intercept setting the input ref so we can determine what kind of element we have.\n // useTextField uses this to determine what props to include.\n let inputOrTextAreaRef = useCallback((el) => {\n mergedInputRef.current = el;\n if (el) {\n setInputElementType(el instanceof HTMLTextAreaElement ? 'textarea' : 'input');\n }\n }, [mergedInputRef]);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false\n },\n defaultClassName: 'react-aria-TextField'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}],\n [InputContext, {...mergeProps(inputProps, inputContextProps), ref: inputOrTextAreaRef}],\n [TextAreaContext, {...inputProps, ref: inputOrTextAreaRef}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TextField.main.js.map"}
|
package/dist/TextField.mjs
CHANGED
|
@@ -6,8 +6,8 @@ import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label
|
|
|
6
6
|
import {TextAreaContext as $216918bed6669f72$export$2dc6166a7e65358c} from "./TextArea.mjs";
|
|
7
7
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
8
8
|
import {useTextField as $jmnGn$useTextField} from "react-aria";
|
|
9
|
-
import {filterDOMProps as $jmnGn$filterDOMProps} from "@react-aria/utils";
|
|
10
|
-
import $jmnGn$react, {createContext as $jmnGn$createContext,
|
|
9
|
+
import {filterDOMProps as $jmnGn$filterDOMProps, mergeProps as $jmnGn$mergeProps} from "@react-aria/utils";
|
|
10
|
+
import $jmnGn$react, {createContext as $jmnGn$createContext, forwardRef as $jmnGn$forwardRef, useRef as $jmnGn$useRef, useState as $jmnGn$useState, useCallback as $jmnGn$useCallback} from "react";
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -30,12 +30,13 @@ import $jmnGn$react, {createContext as $jmnGn$createContext, useRef as $jmnGn$us
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /*#__PURE__*/ (0, $jmnGn$createContext)(null);
|
|
33
|
-
|
|
33
|
+
const $bcdf0525bf22703d$export$2c73285ae9390cec = /*#__PURE__*/ (0, $jmnGn$forwardRef)(function TextField(props, ref) {
|
|
34
34
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
35
35
|
let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
36
36
|
var _props_validationBehavior, _ref;
|
|
37
37
|
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
38
38
|
let inputRef = (0, $jmnGn$useRef)(null);
|
|
39
|
+
let [inputContextProps, mergedInputRef] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)({}, inputRef, (0, $3985021b0ad6602f$export$37fb8590cf2c088c));
|
|
39
40
|
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
40
41
|
let [inputElementType, setInputElementType] = (0, $jmnGn$useState)('input');
|
|
41
42
|
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $jmnGn$useTextField)({
|
|
@@ -43,13 +44,15 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
43
44
|
inputElementType: inputElementType,
|
|
44
45
|
label: label,
|
|
45
46
|
validationBehavior: validationBehavior
|
|
46
|
-
},
|
|
47
|
+
}, mergedInputRef);
|
|
47
48
|
// Intercept setting the input ref so we can determine what kind of element we have.
|
|
48
49
|
// useTextField uses this to determine what props to include.
|
|
49
50
|
let inputOrTextAreaRef = (0, $jmnGn$useCallback)((el)=>{
|
|
50
|
-
|
|
51
|
+
mergedInputRef.current = el;
|
|
51
52
|
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? 'textarea' : 'input');
|
|
52
|
-
}, [
|
|
53
|
+
}, [
|
|
54
|
+
mergedInputRef
|
|
55
|
+
]);
|
|
53
56
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
54
57
|
...props,
|
|
55
58
|
values: {
|
|
@@ -83,7 +86,7 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
83
86
|
[
|
|
84
87
|
(0, $3985021b0ad6602f$export$37fb8590cf2c088c),
|
|
85
88
|
{
|
|
86
|
-
...inputProps,
|
|
89
|
+
...(0, $jmnGn$mergeProps)(inputProps, inputContextProps),
|
|
87
90
|
ref: inputOrTextAreaRef
|
|
88
91
|
}
|
|
89
92
|
],
|
|
@@ -109,10 +112,7 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
109
112
|
]
|
|
110
113
|
]
|
|
111
114
|
}, renderProps.children));
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* A text field allows a user to enter a plain text value with a keyboard.
|
|
115
|
-
*/ const $bcdf0525bf22703d$export$2c73285ae9390cec = /*#__PURE__*/ (0, $jmnGn$forwardRef)($bcdf0525bf22703d$var$TextField);
|
|
115
|
+
});
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
export {$bcdf0525bf22703d$export$2129e27b3ef0d483 as TextFieldContext, $bcdf0525bf22703d$export$2c73285ae9390cec as TextField};
|
package/dist/TextField.module.js
CHANGED
|
@@ -6,8 +6,8 @@ import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label
|
|
|
6
6
|
import {TextAreaContext as $216918bed6669f72$export$2dc6166a7e65358c} from "./TextArea.module.js";
|
|
7
7
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
|
|
8
8
|
import {useTextField as $jmnGn$useTextField} from "react-aria";
|
|
9
|
-
import {filterDOMProps as $jmnGn$filterDOMProps} from "@react-aria/utils";
|
|
10
|
-
import $jmnGn$react, {createContext as $jmnGn$createContext,
|
|
9
|
+
import {filterDOMProps as $jmnGn$filterDOMProps, mergeProps as $jmnGn$mergeProps} from "@react-aria/utils";
|
|
10
|
+
import $jmnGn$react, {createContext as $jmnGn$createContext, forwardRef as $jmnGn$forwardRef, useRef as $jmnGn$useRef, useState as $jmnGn$useState, useCallback as $jmnGn$useCallback} from "react";
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
13
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -30,12 +30,13 @@ import $jmnGn$react, {createContext as $jmnGn$createContext, useRef as $jmnGn$us
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /*#__PURE__*/ (0, $jmnGn$createContext)(null);
|
|
33
|
-
|
|
33
|
+
const $bcdf0525bf22703d$export$2c73285ae9390cec = /*#__PURE__*/ (0, $jmnGn$forwardRef)(function TextField(props, ref) {
|
|
34
34
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
|
|
35
35
|
let { validationBehavior: formValidationBehavior } = (0, $64fa3d84918910a7$export$fabf2dc03a41866e)((0, $d3e0e05bdfcf66bd$export$c24727297075ec6a)) || {};
|
|
36
36
|
var _props_validationBehavior, _ref;
|
|
37
37
|
let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : 'native';
|
|
38
38
|
let inputRef = (0, $jmnGn$useRef)(null);
|
|
39
|
+
let [inputContextProps, mergedInputRef] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)({}, inputRef, (0, $3985021b0ad6602f$export$37fb8590cf2c088c));
|
|
39
40
|
let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
|
|
40
41
|
let [inputElementType, setInputElementType] = (0, $jmnGn$useState)('input');
|
|
41
42
|
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $jmnGn$useTextField)({
|
|
@@ -43,13 +44,15 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
43
44
|
inputElementType: inputElementType,
|
|
44
45
|
label: label,
|
|
45
46
|
validationBehavior: validationBehavior
|
|
46
|
-
},
|
|
47
|
+
}, mergedInputRef);
|
|
47
48
|
// Intercept setting the input ref so we can determine what kind of element we have.
|
|
48
49
|
// useTextField uses this to determine what props to include.
|
|
49
50
|
let inputOrTextAreaRef = (0, $jmnGn$useCallback)((el)=>{
|
|
50
|
-
|
|
51
|
+
mergedInputRef.current = el;
|
|
51
52
|
if (el) setInputElementType(el instanceof HTMLTextAreaElement ? 'textarea' : 'input');
|
|
52
|
-
}, [
|
|
53
|
+
}, [
|
|
54
|
+
mergedInputRef
|
|
55
|
+
]);
|
|
53
56
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
54
57
|
...props,
|
|
55
58
|
values: {
|
|
@@ -83,7 +86,7 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
83
86
|
[
|
|
84
87
|
(0, $3985021b0ad6602f$export$37fb8590cf2c088c),
|
|
85
88
|
{
|
|
86
|
-
...inputProps,
|
|
89
|
+
...(0, $jmnGn$mergeProps)(inputProps, inputContextProps),
|
|
87
90
|
ref: inputOrTextAreaRef
|
|
88
91
|
}
|
|
89
92
|
],
|
|
@@ -109,10 +112,7 @@ function $bcdf0525bf22703d$var$TextField(props, ref) {
|
|
|
109
112
|
]
|
|
110
113
|
]
|
|
111
114
|
}, renderProps.children));
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* A text field allows a user to enter a plain text value with a keyboard.
|
|
115
|
-
*/ const $bcdf0525bf22703d$export$2c73285ae9390cec = /*#__PURE__*/ (0, $jmnGn$forwardRef)($bcdf0525bf22703d$var$TextField);
|
|
115
|
+
});
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
export {$bcdf0525bf22703d$export$2129e27b3ef0d483 as TextFieldContext, $bcdf0525bf22703d$export$2c73285ae9390cec as TextField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAgD;
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;AA0CM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAgD;AAKrF,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,UAAU,KAAqB,EAAE,GAAiC;IAC/I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,CAAC,mBAAmB,eAAe,GAAG,CAAA,GAAA,yCAAc,EAAE,CAAC,GAAG,UAAU,CAAA,GAAA,yCAAW;IACnF,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM;IAC9B,IAAI,CAAC,kBAAkB,oBAAoB,GAAG,CAAA,GAAA,eAAO,EAAE;IACvD,IAAI,cAAC,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAE,GAAG,YAAW,GAAG,CAAA,GAAA,mBAAW,EAAO;QACnG,GAAG,CAAA,GAAA,yCAAmB,EAAE,MAAM;0BAC9B;eACA;4BACA;IACF,GAAG;IAEH,oFAAoF;IACpF,6DAA6D;IAC7D,IAAI,qBAAqB,CAAA,GAAA,kBAAU,EAAE,CAAC;QACpC,eAAe,OAAO,GAAG;QACzB,IAAI,IACF,oBAAoB,cAAc,sBAAsB,aAAa;IAEzE,GAAG;QAAC;KAAe;IAEnB,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,YAAY,MAAM,UAAU,IAAI;YAChC,WAAW,WAAW,SAAS;YAC/B,YAAY,MAAM,UAAU,IAAI;YAChC,YAAY,MAAM,UAAU,IAAI;QAClC;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,WAAW,SAAS,IAAI;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAQ;aAAE;YAC9C;gBAAC,CAAA,GAAA,yCAAW;gBAAG;oBAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,kBAAkB;oBAAE,KAAK;gBAAkB;aAAE;YACvF;gBAAC,CAAA,GAAA,yCAAc;gBAAG;oBAAC,GAAG,UAAU;oBAAE,KAAK;gBAAkB;aAAE;YAC3D;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTextFieldProps, useTextField} from 'react-aria';\nimport {ContextValue, DOMProps, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType} from '@react-types/shared';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextAreaContext} from './TextArea';\nimport {TextContext} from './Text';\n\nexport interface TextFieldRenderProps {\n /**\n * Whether the text field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the value is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the text field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the text field is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, Omit<DOMProps, 'style' | 'className' | 'children'>, SlotProps, RenderProps<TextFieldRenderProps> {\n /** Whether the value is invalid. */\n isInvalid?: boolean\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, HTMLDivElement>>(null);\n\n/**\n * A text field allows a user to enter a plain text value with a keyboard.\n */\nexport const TextField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TextField(props: TextFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let inputRef = useRef(null);\n let [inputContextProps, mergedInputRef] = useContextProps({}, inputRef, InputContext);\n let [labelRef, label] = useSlot();\n let [inputElementType, setInputElementType] = useState('input');\n let {labelProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTextField<any>({\n ...removeDataAttributes(props),\n inputElementType,\n label,\n validationBehavior\n }, mergedInputRef);\n\n // Intercept setting the input ref so we can determine what kind of element we have.\n // useTextField uses this to determine what props to include.\n let inputOrTextAreaRef = useCallback((el) => {\n mergedInputRef.current = el;\n if (el) {\n setInputElementType(el instanceof HTMLTextAreaElement ? 'textarea' : 'input');\n }\n }, [mergedInputRef]);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid,\n isReadOnly: props.isReadOnly || false,\n isRequired: props.isRequired || false\n },\n defaultClassName: 'react-aria-TextField'\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={props.isDisabled || undefined}\n data-invalid={validation.isInvalid || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-required={props.isRequired || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, ref: labelRef}],\n [InputContext, {...mergeProps(inputProps, inputContextProps), ref: inputOrTextAreaRef}],\n [TextAreaContext, {...inputProps, ref: inputOrTextAreaRef}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TextField.module.js.map"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
2
|
+
var $fed71ed29b70a020$exports = require("./ToggleButtonGroup.main.js");
|
|
2
3
|
var $3sDBP$reactaria = require("react-aria");
|
|
3
4
|
var $3sDBP$react = require("react");
|
|
4
5
|
var $3sDBP$reactstately = require("react-stately");
|
|
@@ -28,22 +29,36 @@ $parcel$export(module.exports, "ToggleButton", () => $3def510c5b419a98$export$d2
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
32
|
+
|
|
31
33
|
const $3def510c5b419a98$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $3sDBP$react.createContext)({});
|
|
32
|
-
|
|
34
|
+
const $3def510c5b419a98$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $3sDBP$react.forwardRef)(function ToggleButton(props, ref) {
|
|
33
35
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $3def510c5b419a98$export$43506d75ebd2e218);
|
|
34
|
-
let
|
|
35
|
-
let
|
|
36
|
+
let groupState = (0, $3sDBP$react.useContext)((0, $fed71ed29b70a020$exports.ToggleGroupStateContext));
|
|
37
|
+
let state = (0, $3sDBP$reactstately.useToggleState)(groupState && props.id != null ? {
|
|
38
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
39
|
+
onChange (isSelected) {
|
|
40
|
+
groupState.setSelected(props.id, isSelected);
|
|
41
|
+
}
|
|
42
|
+
} : props);
|
|
43
|
+
let { buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled } = groupState && props.id != null ? (0, $3sDBP$reactaria.useToggleButtonGroupItem)({
|
|
44
|
+
...props,
|
|
45
|
+
id: props.id
|
|
46
|
+
}, groupState, ref) : (0, $3sDBP$reactaria.useToggleButton)({
|
|
47
|
+
...props,
|
|
48
|
+
id: props.id != null ? String(props.id) : undefined
|
|
49
|
+
}, state, ref);
|
|
36
50
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $3sDBP$reactaria.useFocusRing)(props);
|
|
37
51
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $3sDBP$reactaria.useHover)(props);
|
|
38
52
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
39
53
|
...props,
|
|
54
|
+
id: undefined,
|
|
40
55
|
values: {
|
|
41
56
|
isHovered: isHovered,
|
|
42
57
|
isPressed: isPressed,
|
|
43
58
|
isFocused: isFocused,
|
|
44
59
|
isSelected: state.isSelected,
|
|
45
60
|
isFocusVisible: isFocusVisible,
|
|
46
|
-
isDisabled:
|
|
61
|
+
isDisabled: isDisabled,
|
|
47
62
|
state: state
|
|
48
63
|
},
|
|
49
64
|
defaultClassName: 'react-aria-ToggleButton'
|
|
@@ -54,16 +69,13 @@ function $3def510c5b419a98$var$ToggleButton(props, ref) {
|
|
|
54
69
|
ref: ref,
|
|
55
70
|
slot: props.slot || undefined,
|
|
56
71
|
"data-focused": isFocused || undefined,
|
|
57
|
-
"data-disabled":
|
|
72
|
+
"data-disabled": isDisabled || undefined,
|
|
58
73
|
"data-pressed": isPressed || undefined,
|
|
59
|
-
"data-selected":
|
|
74
|
+
"data-selected": isSelected || undefined,
|
|
60
75
|
"data-hovered": isHovered || undefined,
|
|
61
76
|
"data-focus-visible": isFocusVisible || undefined
|
|
62
77
|
});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.
|
|
66
|
-
*/ const $3def510c5b419a98$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $3sDBP$react.forwardRef)($3def510c5b419a98$var$ToggleButton);
|
|
78
|
+
});
|
|
67
79
|
|
|
68
80
|
|
|
69
81
|
//# sourceMappingURL=ToggleButton.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA2BM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAsD,CAAC;AAK/F,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,aAAa,KAAwB,EAAE,GAAoC;IAC3J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE,cAAc,MAAM,EAAE,IAAI,OAAO;QAC1D,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;IACF,IAAI;IAEJ,IAAI,eAAC,WAAW,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,cAAc,MAAM,EAAE,IAAI,OAE7E,CAAA,GAAA,yCAAuB,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE;IAAA,GAAG,YAAY,OAE/D,CAAA,GAAA,gCAAc,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE,IAAI,OAAO,OAAO,MAAM,EAAE,IAAI;IAAS,GAAG,OAAO;IAE5F,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,QAAQ;uBAAC;uBAAW;uBAAW;YAAW,YAAY,MAAM,UAAU;4BAAE;wBAAgB;mBAAY;QAAK;QACzG,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,aAAa,YAAY,WAAW;QAClD,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/ToggleButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaToggleButtonProps, HoverEvents, mergeProps, useFocusRing, useHover, useToggleButton, useToggleButtonGroupItem} from 'react-aria';\nimport {ButtonRenderProps} from './Button';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * State of the toggle button.\n */\n state: ToggleState\n}\n\nexport interface ToggleButtonProps extends Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>, HoverEvents, SlotProps, RenderProps<ToggleButtonRenderProps> {\n /** When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used standalone, a DOM id. */\n id?: Key\n}\n\nexport const ToggleButtonContext = createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(props: ToggleButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(groupState && props.id != null ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n } : props);\n\n let {buttonProps, isPressed, isSelected, isDisabled} = groupState && props.id != null\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useToggleButton({...props, id: props.id != null ? String(props.id) : undefined}, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover(props);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {isHovered, isPressed, isFocused, isSelected: state.isSelected, isFocusVisible, isDisabled, state},\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n return (\n <button\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.main.js.map"}
|
package/dist/ToggleButton.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import $jrJ9L$
|
|
2
|
+
import {ToggleGroupStateContext as $84b7d8702d4ff4a8$export$a8a71863db173133} from "./ToggleButtonGroup.mjs";
|
|
3
|
+
import {useToggleButtonGroupItem as $jrJ9L$useToggleButtonGroupItem, useToggleButton as $jrJ9L$useToggleButton, useFocusRing as $jrJ9L$useFocusRing, useHover as $jrJ9L$useHover, mergeProps as $jrJ9L$mergeProps} from "react-aria";
|
|
4
|
+
import $jrJ9L$react, {createContext as $jrJ9L$createContext, forwardRef as $jrJ9L$forwardRef, useContext as $jrJ9L$useContext} from "react";
|
|
4
5
|
import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
5
6
|
|
|
6
7
|
/*
|
|
@@ -17,22 +18,36 @@ import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
|
|
20
22
|
const $efde0372d7a700fe$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $jrJ9L$createContext)({});
|
|
21
|
-
|
|
23
|
+
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)(function ToggleButton(props, ref) {
|
|
22
24
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
23
|
-
let
|
|
24
|
-
let
|
|
25
|
+
let groupState = (0, $jrJ9L$useContext)((0, $84b7d8702d4ff4a8$export$a8a71863db173133));
|
|
26
|
+
let state = (0, $jrJ9L$useToggleState)(groupState && props.id != null ? {
|
|
27
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
28
|
+
onChange (isSelected) {
|
|
29
|
+
groupState.setSelected(props.id, isSelected);
|
|
30
|
+
}
|
|
31
|
+
} : props);
|
|
32
|
+
let { buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled } = groupState && props.id != null ? (0, $jrJ9L$useToggleButtonGroupItem)({
|
|
33
|
+
...props,
|
|
34
|
+
id: props.id
|
|
35
|
+
}, groupState, ref) : (0, $jrJ9L$useToggleButton)({
|
|
36
|
+
...props,
|
|
37
|
+
id: props.id != null ? String(props.id) : undefined
|
|
38
|
+
}, state, ref);
|
|
25
39
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $jrJ9L$useFocusRing)(props);
|
|
26
40
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jrJ9L$useHover)(props);
|
|
27
41
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
28
42
|
...props,
|
|
43
|
+
id: undefined,
|
|
29
44
|
values: {
|
|
30
45
|
isHovered: isHovered,
|
|
31
46
|
isPressed: isPressed,
|
|
32
47
|
isFocused: isFocused,
|
|
33
48
|
isSelected: state.isSelected,
|
|
34
49
|
isFocusVisible: isFocusVisible,
|
|
35
|
-
isDisabled:
|
|
50
|
+
isDisabled: isDisabled,
|
|
36
51
|
state: state
|
|
37
52
|
},
|
|
38
53
|
defaultClassName: 'react-aria-ToggleButton'
|
|
@@ -43,16 +58,13 @@ function $efde0372d7a700fe$var$ToggleButton(props, ref) {
|
|
|
43
58
|
ref: ref,
|
|
44
59
|
slot: props.slot || undefined,
|
|
45
60
|
"data-focused": isFocused || undefined,
|
|
46
|
-
"data-disabled":
|
|
61
|
+
"data-disabled": isDisabled || undefined,
|
|
47
62
|
"data-pressed": isPressed || undefined,
|
|
48
|
-
"data-selected":
|
|
63
|
+
"data-selected": isSelected || undefined,
|
|
49
64
|
"data-hovered": isHovered || undefined,
|
|
50
65
|
"data-focus-visible": isFocusVisible || undefined
|
|
51
66
|
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.
|
|
55
|
-
*/ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)($efde0372d7a700fe$var$ToggleButton);
|
|
67
|
+
});
|
|
56
68
|
|
|
57
69
|
|
|
58
70
|
export {$efde0372d7a700fe$export$43506d75ebd2e218 as ToggleButtonContext, $efde0372d7a700fe$export$d2b052e7b4be1756 as ToggleButton};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
|
-
import {
|
|
3
|
-
import $jrJ9L$
|
|
2
|
+
import {ToggleGroupStateContext as $84b7d8702d4ff4a8$export$a8a71863db173133} from "./ToggleButtonGroup.module.js";
|
|
3
|
+
import {useToggleButtonGroupItem as $jrJ9L$useToggleButtonGroupItem, useToggleButton as $jrJ9L$useToggleButton, useFocusRing as $jrJ9L$useFocusRing, useHover as $jrJ9L$useHover, mergeProps as $jrJ9L$mergeProps} from "react-aria";
|
|
4
|
+
import $jrJ9L$react, {createContext as $jrJ9L$createContext, forwardRef as $jrJ9L$forwardRef, useContext as $jrJ9L$useContext} from "react";
|
|
4
5
|
import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
5
6
|
|
|
6
7
|
/*
|
|
@@ -17,22 +18,36 @@ import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
|
|
20
22
|
const $efde0372d7a700fe$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $jrJ9L$createContext)({});
|
|
21
|
-
|
|
23
|
+
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)(function ToggleButton(props, ref) {
|
|
22
24
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
23
|
-
let
|
|
24
|
-
let
|
|
25
|
+
let groupState = (0, $jrJ9L$useContext)((0, $84b7d8702d4ff4a8$export$a8a71863db173133));
|
|
26
|
+
let state = (0, $jrJ9L$useToggleState)(groupState && props.id != null ? {
|
|
27
|
+
isSelected: groupState.selectedKeys.has(props.id),
|
|
28
|
+
onChange (isSelected) {
|
|
29
|
+
groupState.setSelected(props.id, isSelected);
|
|
30
|
+
}
|
|
31
|
+
} : props);
|
|
32
|
+
let { buttonProps: buttonProps, isPressed: isPressed, isSelected: isSelected, isDisabled: isDisabled } = groupState && props.id != null ? (0, $jrJ9L$useToggleButtonGroupItem)({
|
|
33
|
+
...props,
|
|
34
|
+
id: props.id
|
|
35
|
+
}, groupState, ref) : (0, $jrJ9L$useToggleButton)({
|
|
36
|
+
...props,
|
|
37
|
+
id: props.id != null ? String(props.id) : undefined
|
|
38
|
+
}, state, ref);
|
|
25
39
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $jrJ9L$useFocusRing)(props);
|
|
26
40
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jrJ9L$useHover)(props);
|
|
27
41
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
28
42
|
...props,
|
|
43
|
+
id: undefined,
|
|
29
44
|
values: {
|
|
30
45
|
isHovered: isHovered,
|
|
31
46
|
isPressed: isPressed,
|
|
32
47
|
isFocused: isFocused,
|
|
33
48
|
isSelected: state.isSelected,
|
|
34
49
|
isFocusVisible: isFocusVisible,
|
|
35
|
-
isDisabled:
|
|
50
|
+
isDisabled: isDisabled,
|
|
36
51
|
state: state
|
|
37
52
|
},
|
|
38
53
|
defaultClassName: 'react-aria-ToggleButton'
|
|
@@ -43,16 +58,13 @@ function $efde0372d7a700fe$var$ToggleButton(props, ref) {
|
|
|
43
58
|
ref: ref,
|
|
44
59
|
slot: props.slot || undefined,
|
|
45
60
|
"data-focused": isFocused || undefined,
|
|
46
|
-
"data-disabled":
|
|
61
|
+
"data-disabled": isDisabled || undefined,
|
|
47
62
|
"data-pressed": isPressed || undefined,
|
|
48
|
-
"data-selected":
|
|
63
|
+
"data-selected": isSelected || undefined,
|
|
49
64
|
"data-hovered": isHovered || undefined,
|
|
50
65
|
"data-focus-visible": isFocusVisible || undefined
|
|
51
66
|
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.
|
|
55
|
-
*/ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)($efde0372d7a700fe$var$ToggleButton);
|
|
67
|
+
});
|
|
56
68
|
|
|
57
69
|
|
|
58
70
|
export {$efde0372d7a700fe$export$43506d75ebd2e218 as ToggleButtonContext, $efde0372d7a700fe$export$d2b052e7b4be1756 as ToggleButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AA2BM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAsD,CAAC;AAK/F,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,aAAa,KAAwB,EAAE,GAAoC;IAC3J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,qBAAa,EAAE,cAAc,MAAM,EAAE,IAAI,OAAO;QAC1D,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;IACF,IAAI;IAEJ,IAAI,eAAC,WAAW,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,cAAc,MAAM,EAAE,IAAI,OAE7E,CAAA,GAAA,+BAAuB,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE;IAAA,GAAG,YAAY,OAE/D,CAAA,GAAA,sBAAc,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE,IAAI,OAAO,OAAO,MAAM,EAAE,IAAI;IAAS,GAAG,OAAO;IAE5F,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,QAAQ;uBAAC;uBAAW;uBAAW;YAAW,YAAY,MAAM,UAAU;4BAAE;wBAAgB;mBAAY;QAAK;QACzG,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,YAAY,WAAW;QAClD,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/ToggleButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaToggleButtonProps, HoverEvents, mergeProps, useFocusRing, useHover, useToggleButton, useToggleButtonGroupItem} from 'react-aria';\nimport {ButtonRenderProps} from './Button';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * State of the toggle button.\n */\n state: ToggleState\n}\n\nexport interface ToggleButtonProps extends Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>, HoverEvents, SlotProps, RenderProps<ToggleButtonRenderProps> {\n /** When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used standalone, a DOM id. */\n id?: Key\n}\n\nexport const ToggleButtonContext = createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(props: ToggleButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(groupState && props.id != null ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n } : props);\n\n let {buttonProps, isPressed, isSelected, isDisabled} = groupState && props.id != null\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useToggleButton({...props, id: props.id != null ? String(props.id) : undefined}, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover(props);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {isHovered, isPressed, isFocused, isSelected: state.isSelected, isFocusVisible, isDisabled, state},\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n return (\n <button\n {...mergeProps(buttonProps, focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.module.js.map"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
2
|
+
var $kZVyu$reactaria = require("react-aria");
|
|
3
|
+
var $kZVyu$react = require("react");
|
|
4
|
+
var $kZVyu$reactstately = require("react-stately");
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function $parcel$export(e, n, v, s) {
|
|
12
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$parcel$export(module.exports, "ToggleButtonGroupContext", () => $fed71ed29b70a020$export$298258635ae0dd97);
|
|
16
|
+
$parcel$export(module.exports, "ToggleGroupStateContext", () => $fed71ed29b70a020$export$a8a71863db173133);
|
|
17
|
+
$parcel$export(module.exports, "ToggleButtonGroup", () => $fed71ed29b70a020$export$40258cc1d95ff477);
|
|
18
|
+
/*
|
|
19
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
20
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
22
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
25
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
26
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
27
|
+
* governing permissions and limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const $fed71ed29b70a020$export$298258635ae0dd97 = /*#__PURE__*/ (0, $kZVyu$react.createContext)({});
|
|
33
|
+
const $fed71ed29b70a020$export$a8a71863db173133 = /*#__PURE__*/ (0, $kZVyu$react.createContext)(null);
|
|
34
|
+
const $fed71ed29b70a020$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $kZVyu$react.forwardRef)(function ToggleButtonGroup(props, ref) {
|
|
35
|
+
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $fed71ed29b70a020$export$298258635ae0dd97);
|
|
36
|
+
let state = (0, $kZVyu$reactstately.useToggleGroupState)(props);
|
|
37
|
+
let { groupProps: groupProps } = (0, $kZVyu$reactaria.useToggleButtonGroup)(props, state, ref);
|
|
38
|
+
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
39
|
+
...props,
|
|
40
|
+
values: {
|
|
41
|
+
isDisabled: state.isDisabled,
|
|
42
|
+
state: state
|
|
43
|
+
},
|
|
44
|
+
defaultClassName: 'react-aria-ToggleButtonGroup'
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kZVyu$react))).createElement("div", {
|
|
47
|
+
...groupProps,
|
|
48
|
+
...renderProps,
|
|
49
|
+
ref: ref,
|
|
50
|
+
slot: props.slot || undefined,
|
|
51
|
+
"data-orientation": props.orientation || 'horizontal',
|
|
52
|
+
"data-disabled": props.isDisabled || undefined
|
|
53
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kZVyu$react))).createElement($fed71ed29b70a020$export$a8a71863db173133.Provider, {
|
|
54
|
+
value: state
|
|
55
|
+
}, renderProps.children));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=ToggleButtonGroup.main.js.map
|