@react-spectrum/textfield 3.12.0 → 3.12.1
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/dist/TextArea.main.js +7 -7
- package/dist/TextArea.mjs +8 -8
- package/dist/TextArea.module.js +7 -7
- package/dist/TextField.main.js +1 -1
- package/dist/TextField.mjs +2 -2
- package/dist/TextField.module.js +1 -1
- package/dist/TextFieldBase.main.js +18 -18
- package/dist/TextFieldBase.mjs +19 -19
- package/dist/TextFieldBase.module.js +18 -18
- package/dist/textfield_vars_css.mjs +1 -1
- package/package.json +13 -13
package/dist/TextArea.main.js
CHANGED
@@ -39,7 +39,7 @@ function $eec649e464f3832d$var$TextArea(props, ref) {
|
|
39
39
|
let { isDisabled: isDisabled = false, isQuiet: isQuiet = false, isReadOnly: isReadOnly = false, isRequired: isRequired = false, onChange: onChange, ...otherProps } = props;
|
40
40
|
var _props_defaultValue;
|
41
41
|
// not in stately because this is so we know when to re-measure, which is a spectrum design
|
42
|
-
let [inputValue, setInputValue] = (0, $5VIId$reactstatelyutils.useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue :
|
42
|
+
let [inputValue, setInputValue] = (0, $5VIId$reactstatelyutils.useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : '', ()=>{});
|
43
43
|
let inputRef = (0, $5VIId$react.useRef)(null);
|
44
44
|
let onHeightChange = (0, $5VIId$react.useCallback)(()=>{
|
45
45
|
// Quiet textareas always grow based on their text content.
|
@@ -51,10 +51,10 @@ function $eec649e464f3832d$var$TextArea(props, ref) {
|
|
51
51
|
// Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.
|
52
52
|
// The measure/applied height is also incorrect/reset if we turn on and off
|
53
53
|
// overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062
|
54
|
-
let isFirefox =
|
55
|
-
if (!isFirefox) input.style.overflow =
|
56
|
-
input.style.alignSelf =
|
57
|
-
input.style.height =
|
54
|
+
let isFirefox = 'MozAppearance' in input.style;
|
55
|
+
if (!isFirefox) input.style.overflow = 'hidden';
|
56
|
+
input.style.alignSelf = 'start';
|
57
|
+
input.style.height = 'auto';
|
58
58
|
// offsetHeight - clientHeight accounts for the border/padding.
|
59
59
|
input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;
|
60
60
|
input.style.overflow = prevOverflow;
|
@@ -72,11 +72,11 @@ function $eec649e464f3832d$var$TextArea(props, ref) {
|
|
72
72
|
inputValue,
|
73
73
|
inputRef
|
74
74
|
]);
|
75
|
-
if (props.placeholder) console.warn(
|
75
|
+
if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
|
76
76
|
let result = (0, $5VIId$reactariatextfield.useTextField)({
|
77
77
|
...props,
|
78
78
|
onChange: (0, $5VIId$reactariautils.chain)(onChange, setInputValue),
|
79
|
-
inputElementType:
|
79
|
+
inputElementType: 'textarea'
|
80
80
|
}, inputRef);
|
81
81
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($5VIId$react))).createElement((0, $86793250183ac29e$exports.TextFieldBase), {
|
82
82
|
...otherProps,
|
package/dist/TextArea.mjs
CHANGED
@@ -29,7 +29,7 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
29
29
|
let { isDisabled: isDisabled = false, isQuiet: isQuiet = false, isReadOnly: isReadOnly = false, isRequired: isRequired = false, onChange: onChange, ...otherProps } = props;
|
30
30
|
var _props_defaultValue;
|
31
31
|
// not in stately because this is so we know when to re-measure, which is a spectrum design
|
32
|
-
let [inputValue, setInputValue] = (0, $hi3T0$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue :
|
32
|
+
let [inputValue, setInputValue] = (0, $hi3T0$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : '', ()=>{});
|
33
33
|
let inputRef = (0, $hi3T0$useRef)(null);
|
34
34
|
let onHeightChange = (0, $hi3T0$useCallback)(()=>{
|
35
35
|
// Quiet textareas always grow based on their text content.
|
@@ -41,10 +41,10 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
41
41
|
// Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.
|
42
42
|
// The measure/applied height is also incorrect/reset if we turn on and off
|
43
43
|
// overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062
|
44
|
-
let isFirefox =
|
45
|
-
if (!isFirefox) input.style.overflow =
|
46
|
-
input.style.alignSelf =
|
47
|
-
input.style.height =
|
44
|
+
let isFirefox = 'MozAppearance' in input.style;
|
45
|
+
if (!isFirefox) input.style.overflow = 'hidden';
|
46
|
+
input.style.alignSelf = 'start';
|
47
|
+
input.style.height = 'auto';
|
48
48
|
// offsetHeight - clientHeight accounts for the border/padding.
|
49
49
|
input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;
|
50
50
|
input.style.overflow = prevOverflow;
|
@@ -62,11 +62,11 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
62
62
|
inputValue,
|
63
63
|
inputRef
|
64
64
|
]);
|
65
|
-
if (props.placeholder) console.warn(
|
65
|
+
if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
|
66
66
|
let result = (0, $hi3T0$useTextField)({
|
67
67
|
...props,
|
68
68
|
onChange: (0, $hi3T0$chain)(onChange, setInputValue),
|
69
|
-
inputElementType:
|
69
|
+
inputElementType: 'textarea'
|
70
70
|
}, inputRef);
|
71
71
|
return /*#__PURE__*/ (0, $hi3T0$react).createElement((0, $599adb75312e6492$export$d22444a338b6e3c2), {
|
72
72
|
...otherProps,
|
@@ -88,4 +88,4 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
88
88
|
|
89
89
|
|
90
90
|
export {$cc187bf91f8eea73$export$f5c9f3c2c4054eec as TextArea};
|
91
|
-
//# sourceMappingURL=TextArea.
|
91
|
+
//# sourceMappingURL=TextArea.module.js.map
|
package/dist/TextArea.module.js
CHANGED
@@ -29,7 +29,7 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
29
29
|
let { isDisabled: isDisabled = false, isQuiet: isQuiet = false, isReadOnly: isReadOnly = false, isRequired: isRequired = false, onChange: onChange, ...otherProps } = props;
|
30
30
|
var _props_defaultValue;
|
31
31
|
// not in stately because this is so we know when to re-measure, which is a spectrum design
|
32
|
-
let [inputValue, setInputValue] = (0, $hi3T0$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue :
|
32
|
+
let [inputValue, setInputValue] = (0, $hi3T0$useControlledState)(props.value, (_props_defaultValue = props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : '', ()=>{});
|
33
33
|
let inputRef = (0, $hi3T0$useRef)(null);
|
34
34
|
let onHeightChange = (0, $hi3T0$useCallback)(()=>{
|
35
35
|
// Quiet textareas always grow based on their text content.
|
@@ -41,10 +41,10 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
41
41
|
// Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.
|
42
42
|
// The measure/applied height is also incorrect/reset if we turn on and off
|
43
43
|
// overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062
|
44
|
-
let isFirefox =
|
45
|
-
if (!isFirefox) input.style.overflow =
|
46
|
-
input.style.alignSelf =
|
47
|
-
input.style.height =
|
44
|
+
let isFirefox = 'MozAppearance' in input.style;
|
45
|
+
if (!isFirefox) input.style.overflow = 'hidden';
|
46
|
+
input.style.alignSelf = 'start';
|
47
|
+
input.style.height = 'auto';
|
48
48
|
// offsetHeight - clientHeight accounts for the border/padding.
|
49
49
|
input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;
|
50
50
|
input.style.overflow = prevOverflow;
|
@@ -62,11 +62,11 @@ function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
|
62
62
|
inputValue,
|
63
63
|
inputRef
|
64
64
|
]);
|
65
|
-
if (props.placeholder) console.warn(
|
65
|
+
if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextArea.html#help-text');
|
66
66
|
let result = (0, $hi3T0$useTextField)({
|
67
67
|
...props,
|
68
68
|
onChange: (0, $hi3T0$chain)(onChange, setInputValue),
|
69
|
-
inputElementType:
|
69
|
+
inputElementType: 'textarea'
|
70
70
|
}, inputRef);
|
71
71
|
return /*#__PURE__*/ (0, $hi3T0$react).createElement((0, $599adb75312e6492$export$d22444a338b6e3c2), {
|
72
72
|
...otherProps,
|
package/dist/TextField.main.js
CHANGED
@@ -34,7 +34,7 @@ function $34fd51d50eb4b056$var$TextField(props, ref) {
|
|
34
34
|
props = (0, $em8OD$reactspectrumform.useFormProps)(props);
|
35
35
|
let inputRef = (0, $em8OD$react.useRef)(null);
|
36
36
|
let result = (0, $em8OD$reactariatextfield.useTextField)(props, inputRef);
|
37
|
-
if (props.placeholder) console.warn(
|
37
|
+
if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextField.html#help-text');
|
38
38
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($em8OD$react))).createElement((0, $86793250183ac29e$exports.TextFieldBase), {
|
39
39
|
...props,
|
40
40
|
...result,
|
package/dist/TextField.mjs
CHANGED
@@ -24,7 +24,7 @@ function $265457f9427aa380$var$TextField(props, ref) {
|
|
24
24
|
props = (0, $9R76J$useFormProps)(props);
|
25
25
|
let inputRef = (0, $9R76J$useRef)(null);
|
26
26
|
let result = (0, $9R76J$useTextField)(props, inputRef);
|
27
|
-
if (props.placeholder) console.warn(
|
27
|
+
if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextField.html#help-text');
|
28
28
|
return /*#__PURE__*/ (0, $9R76J$react).createElement((0, $599adb75312e6492$export$d22444a338b6e3c2), {
|
29
29
|
...props,
|
30
30
|
...result,
|
@@ -40,4 +40,4 @@ function $265457f9427aa380$var$TextField(props, ref) {
|
|
40
40
|
|
41
41
|
|
42
42
|
export {$265457f9427aa380$export$2c73285ae9390cec as TextField};
|
43
|
-
//# sourceMappingURL=TextField.
|
43
|
+
//# sourceMappingURL=TextField.module.js.map
|
package/dist/TextField.module.js
CHANGED
@@ -24,7 +24,7 @@ function $265457f9427aa380$var$TextField(props, ref) {
|
|
24
24
|
props = (0, $9R76J$useFormProps)(props);
|
25
25
|
let inputRef = (0, $9R76J$useRef)(null);
|
26
26
|
let result = (0, $9R76J$useTextField)(props, inputRef);
|
27
|
-
if (props.placeholder) console.warn(
|
27
|
+
if (props.placeholder) console.warn('Placeholders are deprecated due to accessibility issues. Please use help text instead. See the docs for details: https://react-spectrum.adobe.com/react-spectrum/TextField.html#help-text');
|
28
28
|
return /*#__PURE__*/ (0, $9R76J$react).createElement((0, $599adb75312e6492$export$d22444a338b6e3c2), {
|
29
29
|
...props,
|
30
30
|
...result,
|
@@ -39,7 +39,7 @@ $parcel$export(module.exports, "TextFieldBase", () => $86793250183ac29e$export$d
|
|
39
39
|
|
40
40
|
|
41
41
|
function $86793250183ac29e$var$TextFieldBase(props, ref) {
|
42
|
-
let { validationState: validationState = props.isInvalid ?
|
42
|
+
let { validationState: validationState = props.isInvalid ? 'invalid' : null, icon: icon, isQuiet: isQuiet = false, isDisabled: isDisabled, multiLine: multiLine, autoFocus: autoFocus, inputClassName: inputClassName, wrapperChildren: wrapperChildren, labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, inputRef: userInputRef, isLoading: isLoading, loadingIndicator: loadingIndicator, validationIconClassName: validationIconClassName, disableFocusRing: disableFocusRing } = props;
|
43
43
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fWjzu$reactariainteractions.useHover)({
|
44
44
|
isDisabled: isDisabled
|
45
45
|
});
|
@@ -56,39 +56,39 @@ function $86793250183ac29e$var$TextFieldBase(props, ref) {
|
|
56
56
|
return inputRef.current;
|
57
57
|
}
|
58
58
|
}));
|
59
|
-
let ElementType = multiLine ?
|
60
|
-
let isInvalid = validationState ===
|
59
|
+
let ElementType = multiLine ? 'textarea' : 'input';
|
60
|
+
let isInvalid = validationState === 'invalid' && !isDisabled;
|
61
61
|
if (icon) {
|
62
|
-
let UNSAFE_className = (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), icon.props && icon.props.UNSAFE_className,
|
62
|
+
let UNSAFE_className = (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), icon.props && icon.props.UNSAFE_className, 'spectrum-Textfield-icon');
|
63
63
|
icon = /*#__PURE__*/ (0, $fWjzu$react.cloneElement)(icon, {
|
64
64
|
UNSAFE_className: UNSAFE_className,
|
65
|
-
size:
|
65
|
+
size: 'S'
|
66
66
|
});
|
67
67
|
}
|
68
68
|
let validationIcon = isInvalid ? /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, ($parcel$interopDefault($fWjzu$spectrumiconsuiAlertMedium))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, ($parcel$interopDefault($fWjzu$spectrumiconsuiCheckmarkMedium))), null);
|
69
69
|
let validation = /*#__PURE__*/ (0, $fWjzu$react.cloneElement)(validationIcon, {
|
70
|
-
UNSAFE_className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
70
|
+
UNSAFE_className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-validationIcon', validationIconClassName)
|
71
71
|
});
|
72
72
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $fWjzu$reactariafocus.useFocusRing)({
|
73
73
|
isTextInput: true,
|
74
74
|
autoFocus: autoFocus
|
75
75
|
});
|
76
76
|
let textField = /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement("div", {
|
77
|
-
className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
77
|
+
className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield', {
|
78
|
+
'spectrum-Textfield--invalid': isInvalid,
|
79
|
+
'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
|
80
|
+
'spectrum-Textfield--loadable': loadingIndicator,
|
81
|
+
'spectrum-Textfield--quiet': isQuiet,
|
82
|
+
'spectrum-Textfield--multiline': multiLine,
|
83
|
+
'focus-ring': !disableFocusRing && isFocusVisible
|
84
84
|
})
|
85
85
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement(ElementType, {
|
86
86
|
...(0, $fWjzu$reactariautils.mergeProps)(inputProps, hoverProps, focusProps),
|
87
87
|
ref: inputRef,
|
88
88
|
rows: multiLine ? 1 : undefined,
|
89
|
-
className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
90
|
-
|
91
|
-
|
89
|
+
className: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-input', {
|
90
|
+
'spectrum-Textfield-inputIcon': icon,
|
91
|
+
'is-hovered': isHovered
|
92
92
|
}, inputClassName)
|
93
93
|
}), icon, validationState && !isLoading && !isDisabled ? validation : null, isLoading && loadingIndicator, wrapperChildren);
|
94
94
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($fWjzu$react))).createElement((0, $fWjzu$reactspectrumlabel.Field), {
|
@@ -96,8 +96,8 @@ function $86793250183ac29e$var$TextFieldBase(props, ref) {
|
|
96
96
|
labelProps: labelProps,
|
97
97
|
descriptionProps: descriptionProps,
|
98
98
|
errorMessageProps: errorMessageProps,
|
99
|
-
wrapperClassName: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))),
|
100
|
-
|
99
|
+
wrapperClassName: (0, $fWjzu$reactspectrumutils.classNames)((0, ($parcel$interopDefault($40cb3a00c193680f$exports))), 'spectrum-Textfield-wrapper', {
|
100
|
+
'spectrum-Textfield-wrapper--quiet': isQuiet
|
101
101
|
}),
|
102
102
|
showErrorIcon: false,
|
103
103
|
ref: domRef
|
package/dist/TextFieldBase.mjs
CHANGED
@@ -33,7 +33,7 @@ function $parcel$interopDefault(a) {
|
|
33
33
|
|
34
34
|
|
35
35
|
function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
36
|
-
let { validationState: validationState = props.isInvalid ?
|
36
|
+
let { validationState: validationState = props.isInvalid ? 'invalid' : null, icon: icon, isQuiet: isQuiet = false, isDisabled: isDisabled, multiLine: multiLine, autoFocus: autoFocus, inputClassName: inputClassName, wrapperChildren: wrapperChildren, labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, inputRef: userInputRef, isLoading: isLoading, loadingIndicator: loadingIndicator, validationIconClassName: validationIconClassName, disableFocusRing: disableFocusRing } = props;
|
37
37
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $264pK$useHover)({
|
38
38
|
isDisabled: isDisabled
|
39
39
|
});
|
@@ -50,39 +50,39 @@ function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
|
50
50
|
return inputRef.current;
|
51
51
|
}
|
52
52
|
}));
|
53
|
-
let ElementType = multiLine ?
|
54
|
-
let isInvalid = validationState ===
|
53
|
+
let ElementType = multiLine ? 'textarea' : 'input';
|
54
|
+
let isInvalid = validationState === 'invalid' && !isDisabled;
|
55
55
|
if (icon) {
|
56
|
-
let UNSAFE_className = (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), icon.props && icon.props.UNSAFE_className,
|
56
|
+
let UNSAFE_className = (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), icon.props && icon.props.UNSAFE_className, 'spectrum-Textfield-icon');
|
57
57
|
icon = /*#__PURE__*/ (0, $264pK$cloneElement)(icon, {
|
58
58
|
UNSAFE_className: UNSAFE_className,
|
59
|
-
size:
|
59
|
+
size: 'S'
|
60
60
|
});
|
61
61
|
}
|
62
62
|
let validationIcon = isInvalid ? /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiAlertMedium), null) : /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiCheckmarkMedium), null);
|
63
63
|
let validation = /*#__PURE__*/ (0, $264pK$cloneElement)(validationIcon, {
|
64
|
-
UNSAFE_className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
64
|
+
UNSAFE_className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon', validationIconClassName)
|
65
65
|
});
|
66
66
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $264pK$useFocusRing)({
|
67
67
|
isTextInput: true,
|
68
68
|
autoFocus: autoFocus
|
69
69
|
});
|
70
70
|
let textField = /*#__PURE__*/ (0, $264pK$react).createElement("div", {
|
71
|
-
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield', {
|
72
|
+
'spectrum-Textfield--invalid': isInvalid,
|
73
|
+
'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
|
74
|
+
'spectrum-Textfield--loadable': loadingIndicator,
|
75
|
+
'spectrum-Textfield--quiet': isQuiet,
|
76
|
+
'spectrum-Textfield--multiline': multiLine,
|
77
|
+
'focus-ring': !disableFocusRing && isFocusVisible
|
78
78
|
})
|
79
79
|
}, /*#__PURE__*/ (0, $264pK$react).createElement(ElementType, {
|
80
80
|
...(0, $264pK$mergeProps)(inputProps, hoverProps, focusProps),
|
81
81
|
ref: inputRef,
|
82
82
|
rows: multiLine ? 1 : undefined,
|
83
|
-
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
84
|
-
|
85
|
-
|
83
|
+
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-input', {
|
84
|
+
'spectrum-Textfield-inputIcon': icon,
|
85
|
+
'is-hovered': isHovered
|
86
86
|
}, inputClassName)
|
87
87
|
}), icon, validationState && !isLoading && !isDisabled ? validation : null, isLoading && loadingIndicator, wrapperChildren);
|
88
88
|
return /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$Field), {
|
@@ -90,8 +90,8 @@ function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
|
90
90
|
labelProps: labelProps,
|
91
91
|
descriptionProps: descriptionProps,
|
92
92
|
errorMessageProps: errorMessageProps,
|
93
|
-
wrapperClassName: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
94
|
-
|
93
|
+
wrapperClassName: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-wrapper', {
|
94
|
+
'spectrum-Textfield-wrapper--quiet': isQuiet
|
95
95
|
}),
|
96
96
|
showErrorIcon: false,
|
97
97
|
ref: domRef
|
@@ -101,4 +101,4 @@ const $599adb75312e6492$export$d22444a338b6e3c2 = /*#__PURE__*/ (0, $264pK$forwa
|
|
101
101
|
|
102
102
|
|
103
103
|
export {$599adb75312e6492$export$d22444a338b6e3c2 as TextFieldBase};
|
104
|
-
//# sourceMappingURL=TextFieldBase.
|
104
|
+
//# sourceMappingURL=TextFieldBase.module.js.map
|
@@ -33,7 +33,7 @@ function $parcel$interopDefault(a) {
|
|
33
33
|
|
34
34
|
|
35
35
|
function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
36
|
-
let { validationState: validationState = props.isInvalid ?
|
36
|
+
let { validationState: validationState = props.isInvalid ? 'invalid' : null, icon: icon, isQuiet: isQuiet = false, isDisabled: isDisabled, multiLine: multiLine, autoFocus: autoFocus, inputClassName: inputClassName, wrapperChildren: wrapperChildren, labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, inputRef: userInputRef, isLoading: isLoading, loadingIndicator: loadingIndicator, validationIconClassName: validationIconClassName, disableFocusRing: disableFocusRing } = props;
|
37
37
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $264pK$useHover)({
|
38
38
|
isDisabled: isDisabled
|
39
39
|
});
|
@@ -50,39 +50,39 @@ function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
|
50
50
|
return inputRef.current;
|
51
51
|
}
|
52
52
|
}));
|
53
|
-
let ElementType = multiLine ?
|
54
|
-
let isInvalid = validationState ===
|
53
|
+
let ElementType = multiLine ? 'textarea' : 'input';
|
54
|
+
let isInvalid = validationState === 'invalid' && !isDisabled;
|
55
55
|
if (icon) {
|
56
|
-
let UNSAFE_className = (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), icon.props && icon.props.UNSAFE_className,
|
56
|
+
let UNSAFE_className = (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), icon.props && icon.props.UNSAFE_className, 'spectrum-Textfield-icon');
|
57
57
|
icon = /*#__PURE__*/ (0, $264pK$cloneElement)(icon, {
|
58
58
|
UNSAFE_className: UNSAFE_className,
|
59
|
-
size:
|
59
|
+
size: 'S'
|
60
60
|
});
|
61
61
|
}
|
62
62
|
let validationIcon = isInvalid ? /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiAlertMedium), null) : /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$spectrumiconsuiCheckmarkMedium), null);
|
63
63
|
let validation = /*#__PURE__*/ (0, $264pK$cloneElement)(validationIcon, {
|
64
|
-
UNSAFE_className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
64
|
+
UNSAFE_className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-validationIcon', validationIconClassName)
|
65
65
|
});
|
66
66
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $264pK$useFocusRing)({
|
67
67
|
isTextInput: true,
|
68
68
|
autoFocus: autoFocus
|
69
69
|
});
|
70
70
|
let textField = /*#__PURE__*/ (0, $264pK$react).createElement("div", {
|
71
|
-
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield', {
|
72
|
+
'spectrum-Textfield--invalid': isInvalid,
|
73
|
+
'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,
|
74
|
+
'spectrum-Textfield--loadable': loadingIndicator,
|
75
|
+
'spectrum-Textfield--quiet': isQuiet,
|
76
|
+
'spectrum-Textfield--multiline': multiLine,
|
77
|
+
'focus-ring': !disableFocusRing && isFocusVisible
|
78
78
|
})
|
79
79
|
}, /*#__PURE__*/ (0, $264pK$react).createElement(ElementType, {
|
80
80
|
...(0, $264pK$mergeProps)(inputProps, hoverProps, focusProps),
|
81
81
|
ref: inputRef,
|
82
82
|
rows: multiLine ? 1 : undefined,
|
83
|
-
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
84
|
-
|
85
|
-
|
83
|
+
className: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-input', {
|
84
|
+
'spectrum-Textfield-inputIcon': icon,
|
85
|
+
'is-hovered': isHovered
|
86
86
|
}, inputClassName)
|
87
87
|
}), icon, validationState && !isLoading && !isDisabled ? validation : null, isLoading && loadingIndicator, wrapperChildren);
|
88
88
|
return /*#__PURE__*/ (0, $264pK$react).createElement((0, $264pK$Field), {
|
@@ -90,8 +90,8 @@ function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
|
90
90
|
labelProps: labelProps,
|
91
91
|
descriptionProps: descriptionProps,
|
92
92
|
errorMessageProps: errorMessageProps,
|
93
|
-
wrapperClassName: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))),
|
94
|
-
|
93
|
+
wrapperClassName: (0, $264pK$classNames)((0, ($parcel$interopDefault($264pK$textfield_vars_cssmodulejs))), 'spectrum-Textfield-wrapper', {
|
94
|
+
'spectrum-Textfield-wrapper--quiet': isQuiet
|
95
95
|
}),
|
96
96
|
showErrorIcon: false,
|
97
97
|
ref: domRef
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/textfield",
|
3
|
-
"version": "3.12.
|
3
|
+
"version": "3.12.1",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -36,17 +36,17 @@
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@react-aria/focus": "^3.17.
|
40
|
-
"@react-aria/interactions": "^3.21.
|
41
|
-
"@react-aria/textfield": "^3.14.
|
42
|
-
"@react-aria/utils": "^3.24.
|
43
|
-
"@react-spectrum/form": "^3.7.
|
44
|
-
"@react-spectrum/label": "^3.16.
|
45
|
-
"@react-spectrum/utils": "^3.11.
|
46
|
-
"@react-stately/utils": "^3.10.
|
47
|
-
"@react-types/shared": "^3.23.
|
48
|
-
"@react-types/textfield": "^3.9.
|
49
|
-
"@spectrum-icons/ui": "^3.6.
|
39
|
+
"@react-aria/focus": "^3.17.1",
|
40
|
+
"@react-aria/interactions": "^3.21.3",
|
41
|
+
"@react-aria/textfield": "^3.14.5",
|
42
|
+
"@react-aria/utils": "^3.24.1",
|
43
|
+
"@react-spectrum/form": "^3.7.6",
|
44
|
+
"@react-spectrum/label": "^3.16.6",
|
45
|
+
"@react-spectrum/utils": "^3.11.7",
|
46
|
+
"@react-stately/utils": "^3.10.1",
|
47
|
+
"@react-types/shared": "^3.23.1",
|
48
|
+
"@react-types/textfield": "^3.9.3",
|
49
|
+
"@spectrum-icons/ui": "^3.6.7",
|
50
50
|
"@swc/helpers": "^0.5.0"
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
@@ -60,5 +60,5 @@
|
|
60
60
|
"publishConfig": {
|
61
61
|
"access": "public"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
64
64
|
}
|