@react-spectrum/textfield 3.3.2 → 3.4.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/dist/main.js +123 -121
- package/dist/main.js.map +1 -1
- package/dist/module.js +121 -119
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/TextArea.tsx +3 -0
- package/src/TextField.tsx +5 -0
package/dist/main.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
require("./main.css");
|
2
|
-
var $
|
3
|
-
var $
|
4
|
-
var $
|
5
|
-
var $
|
6
|
-
var $
|
7
|
-
var $
|
8
|
-
var $
|
9
|
-
var $
|
10
|
-
var $
|
11
|
-
var $
|
12
|
-
var $
|
2
|
+
var $74aPB$reactariautils = require("@react-aria/utils");
|
3
|
+
var $74aPB$react = require("react");
|
4
|
+
var $74aPB$reactstatelyutils = require("@react-stately/utils");
|
5
|
+
var $74aPB$reactspectrumprovider = require("@react-spectrum/provider");
|
6
|
+
var $74aPB$reactariatextfield = require("@react-aria/textfield");
|
7
|
+
var $74aPB$spectrumiconsuiAlertMedium = require("@spectrum-icons/ui/AlertMedium");
|
8
|
+
var $74aPB$spectrumiconsuiCheckmarkMedium = require("@spectrum-icons/ui/CheckmarkMedium");
|
9
|
+
var $74aPB$reactspectrumutils = require("@react-spectrum/utils");
|
10
|
+
var $74aPB$reactspectrumlabel = require("@react-spectrum/label");
|
11
|
+
var $74aPB$reactariafocus = require("@react-aria/focus");
|
12
|
+
var $74aPB$reactariainteractions = require("@react-aria/interactions");
|
13
13
|
|
14
14
|
function $parcel$exportWildcard(dest, source) {
|
15
15
|
Object.keys(source).forEach(function(key) {
|
@@ -33,85 +33,85 @@ function $parcel$interopDefault(a) {
|
|
33
33
|
function $parcel$export(e, n, v, s) {
|
34
34
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
35
35
|
}
|
36
|
-
var $
|
37
|
-
|
38
|
-
$parcel$export($
|
39
|
-
|
40
|
-
|
41
|
-
var $
|
42
|
-
|
43
|
-
$parcel$export($
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
var $
|
52
|
-
|
53
|
-
$parcel$export($
|
54
|
-
$parcel$export($
|
55
|
-
$parcel$export($
|
56
|
-
$parcel$export($
|
57
|
-
$parcel$export($
|
58
|
-
$parcel$export($
|
59
|
-
$parcel$export($
|
60
|
-
$parcel$export($
|
61
|
-
$parcel$export($
|
62
|
-
$parcel$export($
|
63
|
-
$parcel$export($
|
64
|
-
$parcel$export($
|
65
|
-
$parcel$export($
|
66
|
-
$parcel$export($
|
67
|
-
$parcel$export($
|
68
|
-
$parcel$export($
|
69
|
-
var $
|
70
|
-
var $
|
71
|
-
var $
|
72
|
-
var $
|
73
|
-
var $
|
74
|
-
var $
|
75
|
-
var $
|
76
|
-
var $
|
77
|
-
var $
|
78
|
-
var $
|
79
|
-
var $
|
80
|
-
var $
|
81
|
-
var $
|
82
|
-
var $
|
83
|
-
var $
|
84
|
-
var $
|
85
|
-
$
|
86
|
-
$
|
87
|
-
$
|
88
|
-
$
|
89
|
-
$
|
90
|
-
$
|
91
|
-
$
|
92
|
-
$
|
93
|
-
$
|
94
|
-
$
|
95
|
-
$
|
96
|
-
$
|
97
|
-
$
|
98
|
-
$
|
99
|
-
$
|
100
|
-
$
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
function $
|
36
|
+
var $eec649e464f3832d$exports = {};
|
37
|
+
|
38
|
+
$parcel$export($eec649e464f3832d$exports, "TextArea", () => $eec649e464f3832d$export$f5c9f3c2c4054eec);
|
39
|
+
|
40
|
+
|
41
|
+
var $86793250183ac29e$exports = {};
|
42
|
+
|
43
|
+
$parcel$export($86793250183ac29e$exports, "TextFieldBase", () => $86793250183ac29e$export$d22444a338b6e3c2);
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
var $40cb3a00c193680f$exports = {};
|
52
|
+
|
53
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield-input", () => $40cb3a00c193680f$export$1ac009feb2b0bd0c, (v) => $40cb3a00c193680f$export$1ac009feb2b0bd0c = v);
|
54
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield", () => $40cb3a00c193680f$export$2c8a10299d8b3418, (v) => $40cb3a00c193680f$export$2c8a10299d8b3418 = v);
|
55
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield--quiet", () => $40cb3a00c193680f$export$bffd5e3d61a81737, (v) => $40cb3a00c193680f$export$bffd5e3d61a81737 = v);
|
56
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield--multiline", () => $40cb3a00c193680f$export$9699f1c538a448a0, (v) => $40cb3a00c193680f$export$9699f1c538a448a0 = v);
|
57
|
+
$parcel$export($40cb3a00c193680f$exports, "is-placeholder", () => $40cb3a00c193680f$export$e5b2f5233e4e5194, (v) => $40cb3a00c193680f$export$e5b2f5233e4e5194 = v);
|
58
|
+
$parcel$export($40cb3a00c193680f$exports, "is-hovered", () => $40cb3a00c193680f$export$b8813cd5d7824ce7, (v) => $40cb3a00c193680f$export$b8813cd5d7824ce7 = v);
|
59
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield--valid", () => $40cb3a00c193680f$export$c2abbc3f970170b7, (v) => $40cb3a00c193680f$export$c2abbc3f970170b7 = v);
|
60
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield--invalid", () => $40cb3a00c193680f$export$58e50b10d30123df, (v) => $40cb3a00c193680f$export$58e50b10d30123df = v);
|
61
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield--loadable", () => $40cb3a00c193680f$export$14fd30fea6f1348c, (v) => $40cb3a00c193680f$export$14fd30fea6f1348c = v);
|
62
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield-validationIcon", () => $40cb3a00c193680f$export$cf0ead5b44db0da3, (v) => $40cb3a00c193680f$export$cf0ead5b44db0da3 = v);
|
63
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield-icon", () => $40cb3a00c193680f$export$222d1ccd1870be1d, (v) => $40cb3a00c193680f$export$222d1ccd1870be1d = v);
|
64
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield-inputIcon", () => $40cb3a00c193680f$export$c1cdcaa5fe76a871, (v) => $40cb3a00c193680f$export$c1cdcaa5fe76a871 = v);
|
65
|
+
$parcel$export($40cb3a00c193680f$exports, "spectrum-Textfield-circleLoader", () => $40cb3a00c193680f$export$82a249fb4d6127, (v) => $40cb3a00c193680f$export$82a249fb4d6127 = v);
|
66
|
+
$parcel$export($40cb3a00c193680f$exports, "is-focused", () => $40cb3a00c193680f$export$e7dc768d35940237, (v) => $40cb3a00c193680f$export$e7dc768d35940237 = v);
|
67
|
+
$parcel$export($40cb3a00c193680f$exports, "focus-ring", () => $40cb3a00c193680f$export$f39a09f249340e2a, (v) => $40cb3a00c193680f$export$f39a09f249340e2a = v);
|
68
|
+
$parcel$export($40cb3a00c193680f$exports, "is-disabled", () => $40cb3a00c193680f$export$d35bc1e505d1ebbf, (v) => $40cb3a00c193680f$export$d35bc1e505d1ebbf = v);
|
69
|
+
var $40cb3a00c193680f$export$1ac009feb2b0bd0c;
|
70
|
+
var $40cb3a00c193680f$export$2c8a10299d8b3418;
|
71
|
+
var $40cb3a00c193680f$export$bffd5e3d61a81737;
|
72
|
+
var $40cb3a00c193680f$export$9699f1c538a448a0;
|
73
|
+
var $40cb3a00c193680f$export$e5b2f5233e4e5194;
|
74
|
+
var $40cb3a00c193680f$export$b8813cd5d7824ce7;
|
75
|
+
var $40cb3a00c193680f$export$c2abbc3f970170b7;
|
76
|
+
var $40cb3a00c193680f$export$58e50b10d30123df;
|
77
|
+
var $40cb3a00c193680f$export$14fd30fea6f1348c;
|
78
|
+
var $40cb3a00c193680f$export$cf0ead5b44db0da3;
|
79
|
+
var $40cb3a00c193680f$export$222d1ccd1870be1d;
|
80
|
+
var $40cb3a00c193680f$export$c1cdcaa5fe76a871;
|
81
|
+
var $40cb3a00c193680f$export$82a249fb4d6127;
|
82
|
+
var $40cb3a00c193680f$export$e7dc768d35940237;
|
83
|
+
var $40cb3a00c193680f$export$f39a09f249340e2a;
|
84
|
+
var $40cb3a00c193680f$export$d35bc1e505d1ebbf;
|
85
|
+
$40cb3a00c193680f$export$1ac009feb2b0bd0c = "spectrum-Textfield-input_73bc77";
|
86
|
+
$40cb3a00c193680f$export$2c8a10299d8b3418 = "spectrum-Textfield_73bc77";
|
87
|
+
$40cb3a00c193680f$export$bffd5e3d61a81737 = "spectrum-Textfield--quiet_73bc77";
|
88
|
+
$40cb3a00c193680f$export$9699f1c538a448a0 = "spectrum-Textfield--multiline_73bc77";
|
89
|
+
$40cb3a00c193680f$export$e5b2f5233e4e5194 = "is-placeholder_73bc77";
|
90
|
+
$40cb3a00c193680f$export$b8813cd5d7824ce7 = "is-hovered_73bc77";
|
91
|
+
$40cb3a00c193680f$export$c2abbc3f970170b7 = "spectrum-Textfield--valid_73bc77";
|
92
|
+
$40cb3a00c193680f$export$58e50b10d30123df = "spectrum-Textfield--invalid_73bc77";
|
93
|
+
$40cb3a00c193680f$export$14fd30fea6f1348c = "spectrum-Textfield--loadable_73bc77";
|
94
|
+
$40cb3a00c193680f$export$cf0ead5b44db0da3 = "spectrum-Textfield-validationIcon_73bc77";
|
95
|
+
$40cb3a00c193680f$export$222d1ccd1870be1d = "spectrum-Textfield-icon_73bc77";
|
96
|
+
$40cb3a00c193680f$export$c1cdcaa5fe76a871 = "spectrum-Textfield-inputIcon_73bc77";
|
97
|
+
$40cb3a00c193680f$export$82a249fb4d6127 = "spectrum-Textfield-circleLoader_73bc77";
|
98
|
+
$40cb3a00c193680f$export$e7dc768d35940237 = "is-focused_73bc77";
|
99
|
+
$40cb3a00c193680f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
100
|
+
$40cb3a00c193680f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
function $86793250183ac29e$var$TextFieldBase(props, ref) {
|
105
105
|
let { label: label , validationState: validationState , icon: icon , isQuiet: isQuiet = false , isDisabled: isDisabled , multiLine: multiLine , autoFocus: autoFocus , inputClassName: inputClassName , wrapperChildren: wrapperChildren , labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps , inputRef: inputRef , isLoading: isLoading , loadingIndicator: loadingIndicator , validationIconClassName: validationIconClassName } = props;
|
106
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $
|
106
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = $74aPB$reactariainteractions.useHover({
|
107
107
|
isDisabled: isDisabled
|
108
108
|
});
|
109
|
-
let domRef = $
|
110
|
-
let defaultInputRef = $
|
109
|
+
let domRef = $74aPB$react.useRef(null);
|
110
|
+
let defaultInputRef = $74aPB$react.useRef(null);
|
111
111
|
inputRef = inputRef || defaultInputRef;
|
112
112
|
// Expose imperative interface for ref
|
113
|
-
$
|
114
|
-
...$
|
113
|
+
$74aPB$react.useImperativeHandle(ref, ()=>({
|
114
|
+
...$74aPB$reactspectrumutils.createFocusableRef(domRef, inputRef),
|
115
115
|
select () {
|
116
116
|
if (inputRef.current) inputRef.current.select();
|
117
117
|
},
|
@@ -123,41 +123,41 @@ function $f728b3265180f1f9$var$TextFieldBase(props, ref) {
|
|
123
123
|
let ElementType = multiLine ? 'textarea' : 'input';
|
124
124
|
let isInvalid = validationState === 'invalid';
|
125
125
|
if (icon) {
|
126
|
-
let UNSAFE_className = $
|
127
|
-
icon = /*#__PURE__*/ $
|
126
|
+
let UNSAFE_className = $74aPB$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)), icon.props && icon.props.UNSAFE_className, 'spectrum-Textfield-icon');
|
127
|
+
icon = /*#__PURE__*/ $74aPB$react.cloneElement(icon, {
|
128
128
|
UNSAFE_className: UNSAFE_className,
|
129
129
|
size: 'S'
|
130
130
|
});
|
131
131
|
}
|
132
|
-
let validationIcon = isInvalid ? /*#__PURE__*/ ($parcel$interopDefault($
|
133
|
-
let validation = /*#__PURE__*/ $
|
134
|
-
UNSAFE_className: $
|
132
|
+
let validationIcon = isInvalid ? /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement(($parcel$interopDefault($74aPB$spectrumiconsuiAlertMedium)), null) : /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement(($parcel$interopDefault($74aPB$spectrumiconsuiCheckmarkMedium)), null);
|
133
|
+
let validation = /*#__PURE__*/ $74aPB$react.cloneElement(validationIcon, {
|
134
|
+
UNSAFE_className: $74aPB$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)), 'spectrum-Textfield-validationIcon', validationIconClassName)
|
135
135
|
});
|
136
|
-
let textField = /*#__PURE__*/ ($parcel$interopDefault($
|
137
|
-
className: $
|
136
|
+
let textField = /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement("div", {
|
137
|
+
className: $74aPB$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)), 'spectrum-Textfield', {
|
138
138
|
'spectrum-Textfield--invalid': isInvalid,
|
139
139
|
'spectrum-Textfield--valid': validationState === 'valid',
|
140
140
|
'spectrum-Textfield--loadable': loadingIndicator,
|
141
141
|
'spectrum-Textfield--quiet': isQuiet,
|
142
142
|
'spectrum-Textfield--multiline': multiLine
|
143
143
|
})
|
144
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
145
|
-
focusRingClass: $
|
144
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement($74aPB$reactariafocus.FocusRing, {
|
145
|
+
focusRingClass: $74aPB$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)), 'focus-ring'),
|
146
146
|
isTextInput: true,
|
147
147
|
autoFocus: autoFocus
|
148
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
149
|
-
...$
|
148
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement(ElementType, {
|
149
|
+
...$74aPB$reactariautils.mergeProps(inputProps, hoverProps),
|
150
150
|
ref: inputRef,
|
151
151
|
rows: multiLine ? 1 : undefined,
|
152
|
-
className: $
|
152
|
+
className: $74aPB$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($40cb3a00c193680f$exports)), 'spectrum-Textfield-input', {
|
153
153
|
'spectrum-Textfield-inputIcon': icon,
|
154
154
|
'is-hovered': isHovered
|
155
155
|
}, inputClassName)
|
156
156
|
})), icon, validationState && !isLoading ? validation : null, isLoading && loadingIndicator, wrapperChildren);
|
157
|
-
if (label) textField = /*#__PURE__*/ ($parcel$interopDefault($
|
157
|
+
if (label) textField = /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).cloneElement(textField, $74aPB$reactariautils.mergeProps(textField.props, {
|
158
158
|
className: multiLine ? 'spectrum-Field-field--multiline' : ''
|
159
159
|
}));
|
160
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
160
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement($74aPB$reactspectrumlabel.Field, {
|
161
161
|
...props,
|
162
162
|
labelProps: labelProps,
|
163
163
|
descriptionProps: descriptionProps,
|
@@ -166,20 +166,20 @@ function $f728b3265180f1f9$var$TextFieldBase(props, ref) {
|
|
166
166
|
ref: domRef
|
167
167
|
}, textField));
|
168
168
|
}
|
169
|
-
const $
|
169
|
+
const $86793250183ac29e$export$d22444a338b6e3c2 = /*#__PURE__*/ $74aPB$react.forwardRef($86793250183ac29e$var$TextFieldBase);
|
170
170
|
|
171
171
|
|
172
172
|
|
173
173
|
|
174
174
|
|
175
|
-
function $
|
176
|
-
props = $
|
175
|
+
function $eec649e464f3832d$var$TextArea(props, ref) {
|
176
|
+
props = $74aPB$reactspectrumprovider.useProviderProps(props);
|
177
177
|
let { isDisabled: isDisabled = false , isQuiet: isQuiet = false , isReadOnly: isReadOnly = false , isRequired: isRequired = false , onChange: onChange , ...otherProps } = props;
|
178
178
|
// not in stately because this is so we know when to re-measure, which is a spectrum design
|
179
|
-
let [inputValue, setInputValue] = $
|
179
|
+
let [inputValue, setInputValue] = $74aPB$reactstatelyutils.useControlledState(props.value, props.defaultValue, ()=>{
|
180
180
|
});
|
181
|
-
let inputRef = $
|
182
|
-
let onHeightChange = $
|
181
|
+
let inputRef = $74aPB$react.useRef();
|
182
|
+
let onHeightChange = $74aPB$react.useCallback(()=>{
|
183
183
|
if (isQuiet) {
|
184
184
|
let input = inputRef.current;
|
185
185
|
let prevAlignment = input.style.alignSelf;
|
@@ -192,19 +192,20 @@ function $0771a1439a157af4$var$TextArea(props, ref) {
|
|
192
192
|
isQuiet,
|
193
193
|
inputRef
|
194
194
|
]);
|
195
|
-
$
|
195
|
+
$74aPB$reactariautils.useLayoutEffect(()=>{
|
196
196
|
if (inputRef.current) onHeightChange();
|
197
197
|
}, [
|
198
198
|
onHeightChange,
|
199
199
|
inputValue,
|
200
200
|
inputRef
|
201
201
|
]);
|
202
|
-
|
202
|
+
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');
|
203
|
+
let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $74aPB$reactariatextfield.useTextField({
|
203
204
|
...props,
|
204
|
-
onChange: $
|
205
|
+
onChange: $74aPB$reactariautils.chain(onChange, setInputValue),
|
205
206
|
inputElementType: 'textarea'
|
206
207
|
}, inputRef);
|
207
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
208
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement($86793250183ac29e$export$d22444a338b6e3c2, {
|
208
209
|
...otherProps,
|
209
210
|
ref: ref,
|
210
211
|
inputRef: inputRef,
|
@@ -223,21 +224,22 @@ function $0771a1439a157af4$var$TextArea(props, ref) {
|
|
223
224
|
* TextAreas are multiline text inputs, useful for cases where users have
|
224
225
|
* a sizable amount of text to enter. They allow for all customizations that
|
225
226
|
* are available to text fields.
|
226
|
-
*/ let $
|
227
|
+
*/ let $eec649e464f3832d$export$f5c9f3c2c4054eec = /*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).forwardRef($eec649e464f3832d$var$TextArea);
|
227
228
|
|
228
229
|
|
229
|
-
var $
|
230
|
+
var $34fd51d50eb4b056$exports = {};
|
230
231
|
|
231
|
-
$parcel$export($
|
232
|
+
$parcel$export($34fd51d50eb4b056$exports, "TextField", () => $34fd51d50eb4b056$export$2c73285ae9390cec);
|
232
233
|
|
233
234
|
|
234
235
|
|
235
236
|
|
236
|
-
function $
|
237
|
-
props = $
|
238
|
-
let inputRef = $
|
239
|
-
let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $
|
240
|
-
|
237
|
+
function $34fd51d50eb4b056$var$TextField(props, ref) {
|
238
|
+
props = $74aPB$reactspectrumprovider.useProviderProps(props);
|
239
|
+
let inputRef = $74aPB$react.useRef();
|
240
|
+
let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $74aPB$reactariatextfield.useTextField(props, inputRef);
|
241
|
+
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');
|
242
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($74aPB$react)).createElement($86793250183ac29e$export$d22444a338b6e3c2, {
|
241
243
|
...props,
|
242
244
|
labelProps: labelProps,
|
243
245
|
inputProps: inputProps,
|
@@ -251,13 +253,13 @@ function $27469905ba6c02ac$var$TextField(props, ref) {
|
|
251
253
|
* TextFields are text inputs that allow users to input custom text entries
|
252
254
|
* with a keyboard. Various decorations can be displayed around the field to
|
253
255
|
* communicate the entry requirements.
|
254
|
-
*/ const $
|
256
|
+
*/ const $34fd51d50eb4b056$export$2c73285ae9390cec = /*#__PURE__*/ $74aPB$react.forwardRef($34fd51d50eb4b056$var$TextField);
|
255
257
|
|
256
258
|
|
257
259
|
|
258
|
-
$parcel$exportWildcard(module.exports, $
|
259
|
-
$parcel$exportWildcard(module.exports, $
|
260
|
-
$parcel$exportWildcard(module.exports, $
|
260
|
+
$parcel$exportWildcard(module.exports, $eec649e464f3832d$exports);
|
261
|
+
$parcel$exportWildcard(module.exports, $34fd51d50eb4b056$exports);
|
262
|
+
$parcel$exportWildcard(module.exports, $86793250183ac29e$exports);
|
261
263
|
|
262
264
|
|
263
265
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,GAA0C;AAC1C,GAAoC;AACpC,GAA2C;AAC3C,GAA+C;AAC/C,GAAgC;AAChC,GAA4B;AAC5B,GAA2C;AAC3C,GAA6C;AAC7C,GAA8C;AAC9C,GAAmD;AACnD,GAAyC;AACzC,GAA8C;AAC9C,GAAiD;AACjD,GAA4B;AAC5B,GAA4B;AAC5B,GAA6B;AAf7B,yCAA0C,GAAG,CAAiC;AAC9E,yCAAoC,GAAG,CAA2B;AAClE,yCAA2C,GAAG,CAAkC;AAChF,yCAA+C,GAAG,CAAsC;AACxF,yCAAgC,GAAG,CAAuB;AAC1D,yCAA4B,GAAG,CAAmB;AAClD,yCAA2C,GAAG,CAAkC;AAChF,yCAA6C,GAAG,CAAoC;AACpF,yCAA8C,GAAG,CAAqC;AACtF,yCAAmD,GAAG,CAA0C;AAChG,yCAAyC,GAAG,CAAgC;AAC5E,yCAA8C,GAAG,CAAqC;AACtF,uCAAiD,GAAG,CAAwC;AAC5F,y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QAAQ;;AAExB,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,KAAK,CAAC,yCAAU,iBAAG,uBAAU,CAAC,+BAAS;;","sources":["packages/@react-spectrum/textfield/src/index.ts","packages/@react-spectrum/textfield/src/TextArea.tsx","packages/@react-spectrum/textfield/src/TextFieldBase.tsx","packages/@adobe/spectrum-css-temp/components/textfield/vars.css","packages/@react-spectrum/textfield/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport * from './TextArea';\nexport * from './TextField';\nexport * from './TextFieldBase';\n","/*\n * Copyright 2020 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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {RefObject, useCallback, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextArea(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue, () => {});\n\n let inputRef = useRef<HTMLTextAreaElement>();\n\n let onHeightChange = useCallback(() => {\n if (isQuiet) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n input.style.height = `${input.scrollHeight}px`;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={ref}\n inputRef={inputRef}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = React.forwardRef(TextArea);\nexport {_TextArea as TextArea};\n","/*\n * Copyright 2020 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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport {PressEvents} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, RefObject, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useHover} from '@react-aria/interactions';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange'>, PressEvents {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean\n}\n\nfunction TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) {\n let {\n label,\n validationState,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n inputRef = inputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid';\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && icon.props.UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n });\n }\n\n let validationIcon = isInvalid ? <AlertMedium /> : <CheckmarkMedium />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid',\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine\n }\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} isTextInput autoFocus={autoFocus}>\n <ElementType\n {...mergeProps(inputProps, hoverProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n </FocusRing>\n {icon}\n {validationState && !isLoading ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n if (label) {\n textField = React.cloneElement(textField, mergeProps(textField.props, {\n className: multiLine ? 'spectrum-Field-field--multiline' : ''\n }));\n }\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n}\n\nconst _TextFieldBase = forwardRef(TextFieldBase);\nexport {_TextFieldBase as TextFieldBase};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 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 React, {forwardRef, RefObject, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextField(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n\n let inputRef = useRef<HTMLInputElement>();\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField(props, inputRef);\n return (\n <TextFieldBase\n {...props}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n ref={ref}\n inputRef={inputRef} />\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n"],"names":[],"version":3,"file":"main.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGA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T,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;;AAE5B,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,GAAG,CAAC,yCAAS,iBAAG,sCAAK,CAAC,UAAU,CAAC,8BAAQ;;;;;;;;;;SGnEhC,+BAAS,CAAC,KAA6B,EAAE,GAA4B,EAAE,CAAC;IAC/E,KAAK,GAAG,6CAAgB,CAAC,KAAK;IAE9B,GAAG,CAAC,QAAQ,GAAG,mBAAM;IACrB,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,qBAAE,gBAAgB,sBAAE,iBAAiB,EAAA,CAAC,GAAG,sCAAY,CAAC,KAAK,EAAE,QAAQ;IAEhG,EAAE,EAAE,KAAK,CAAC,WAAW,EACnB,OAAO,CAAC,IAAI,CAAC,CAA2L;IAG1M,MAAM,oEACH,yCAAa;WACR,KAAK;QACT,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,gBAAgB;QAClC,iBAAiB,EAAE,iBAAiB;QACpC,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ;;AAExB,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,KAAK,CAAC,yCAAU,iBAAG,uBAAU,CAAC,+BAAS;;","sources":["packages/@react-spectrum/textfield/src/index.ts","packages/@react-spectrum/textfield/src/TextArea.tsx","packages/@react-spectrum/textfield/src/TextFieldBase.tsx","packages/@adobe/spectrum-css-temp/components/textfield/vars.css","packages/@react-spectrum/textfield/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport * from './TextArea';\nexport * from './TextField';\nexport * from './TextFieldBase';\n","/*\n * Copyright 2020 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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {RefObject, useCallback, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextArea(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue, () => {});\n\n let inputRef = useRef<HTMLTextAreaElement>();\n\n let onHeightChange = useCallback(() => {\n if (isQuiet) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n input.style.height = `${input.scrollHeight}px`;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n if (props.placeholder) {\n 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');\n }\n\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={ref}\n inputRef={inputRef}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = React.forwardRef(TextArea);\nexport {_TextArea as TextArea};\n","/*\n * Copyright 2020 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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport {PressEvents} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, RefObject, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useHover} from '@react-aria/interactions';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange'>, PressEvents {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean\n}\n\nfunction TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) {\n let {\n label,\n validationState,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n inputRef = inputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid';\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && icon.props.UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n });\n }\n\n let validationIcon = isInvalid ? <AlertMedium /> : <CheckmarkMedium />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid',\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine\n }\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} isTextInput autoFocus={autoFocus}>\n <ElementType\n {...mergeProps(inputProps, hoverProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n </FocusRing>\n {icon}\n {validationState && !isLoading ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n if (label) {\n textField = React.cloneElement(textField, mergeProps(textField.props, {\n className: multiLine ? 'spectrum-Field-field--multiline' : ''\n }));\n }\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n}\n\nconst _TextFieldBase = forwardRef(TextFieldBase);\nexport {_TextFieldBase as TextFieldBase};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 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 React, {forwardRef, RefObject, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextField(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n\n let inputRef = useRef<HTMLInputElement>();\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField(props, inputRef);\n\n if (props.placeholder) {\n 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');\n }\n\n return (\n <TextFieldBase\n {...props}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n ref={ref}\n inputRef={inputRef} />\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
import "./main.css";
|
2
|
-
import {useLayoutEffect as $
|
3
|
-
import $
|
4
|
-
import {useControlledState as $
|
5
|
-
import {useProviderProps as $
|
6
|
-
import {useTextField as $
|
7
|
-
import $
|
8
|
-
import $
|
9
|
-
import {createFocusableRef as $
|
10
|
-
import {Field as $
|
11
|
-
import {FocusRing as $
|
12
|
-
import {useHover as $
|
2
|
+
import {useLayoutEffect as $evhxb$useLayoutEffect, chain as $evhxb$chain, mergeProps as $evhxb$mergeProps} from "@react-aria/utils";
|
3
|
+
import $evhxb$react, {useRef as $evhxb$useRef, useCallback as $evhxb$useCallback, useImperativeHandle as $evhxb$useImperativeHandle, cloneElement as $evhxb$cloneElement, forwardRef as $evhxb$forwardRef} from "react";
|
4
|
+
import {useControlledState as $evhxb$useControlledState} from "@react-stately/utils";
|
5
|
+
import {useProviderProps as $evhxb$useProviderProps} from "@react-spectrum/provider";
|
6
|
+
import {useTextField as $evhxb$useTextField} from "@react-aria/textfield";
|
7
|
+
import $evhxb$spectrumiconsuiAlertMedium from "@spectrum-icons/ui/AlertMedium";
|
8
|
+
import $evhxb$spectrumiconsuiCheckmarkMedium from "@spectrum-icons/ui/CheckmarkMedium";
|
9
|
+
import {createFocusableRef as $evhxb$createFocusableRef, classNames as $evhxb$classNames} from "@react-spectrum/utils";
|
10
|
+
import {Field as $evhxb$Field} from "@react-spectrum/label";
|
11
|
+
import {FocusRing as $evhxb$FocusRing} from "@react-aria/focus";
|
12
|
+
import {useHover as $evhxb$useHover} from "@react-aria/interactions";
|
13
13
|
|
14
14
|
function $parcel$export(e, n, v, s) {
|
15
15
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
@@ -17,85 +17,85 @@ function $parcel$export(e, n, v, s) {
|
|
17
17
|
function $parcel$interopDefault(a) {
|
18
18
|
return a && a.__esModule ? a.default : a;
|
19
19
|
}
|
20
|
-
var $
|
21
|
-
|
22
|
-
$parcel$export($
|
23
|
-
|
24
|
-
|
25
|
-
var $
|
26
|
-
|
27
|
-
$parcel$export($
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
var $
|
36
|
-
|
37
|
-
$parcel$export($
|
38
|
-
$parcel$export($
|
39
|
-
$parcel$export($
|
40
|
-
$parcel$export($
|
41
|
-
$parcel$export($
|
42
|
-
$parcel$export($
|
43
|
-
$parcel$export($
|
44
|
-
$parcel$export($
|
45
|
-
$parcel$export($
|
46
|
-
$parcel$export($
|
47
|
-
$parcel$export($
|
48
|
-
$parcel$export($
|
49
|
-
$parcel$export($
|
50
|
-
$parcel$export($
|
51
|
-
$parcel$export($
|
52
|
-
$parcel$export($
|
53
|
-
var $
|
54
|
-
var $
|
55
|
-
var $
|
56
|
-
var $
|
57
|
-
var $
|
58
|
-
var $
|
59
|
-
var $
|
60
|
-
var $
|
61
|
-
var $
|
62
|
-
var $
|
63
|
-
var $
|
64
|
-
var $
|
65
|
-
var $
|
66
|
-
var $
|
67
|
-
var $
|
68
|
-
var $
|
69
|
-
$
|
70
|
-
$
|
71
|
-
$
|
72
|
-
$
|
73
|
-
$
|
74
|
-
$
|
75
|
-
$
|
76
|
-
$
|
77
|
-
$
|
78
|
-
$
|
79
|
-
$
|
80
|
-
$
|
81
|
-
$
|
82
|
-
$
|
83
|
-
$
|
84
|
-
$
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
function $
|
20
|
+
var $cc187bf91f8eea73$exports = {};
|
21
|
+
|
22
|
+
$parcel$export($cc187bf91f8eea73$exports, "TextArea", () => $cc187bf91f8eea73$export$f5c9f3c2c4054eec);
|
23
|
+
|
24
|
+
|
25
|
+
var $599adb75312e6492$exports = {};
|
26
|
+
|
27
|
+
$parcel$export($599adb75312e6492$exports, "TextFieldBase", () => $599adb75312e6492$export$d22444a338b6e3c2);
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
var $c14528ddc146317f$exports = {};
|
36
|
+
|
37
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-input", () => $c14528ddc146317f$export$1ac009feb2b0bd0c, (v) => $c14528ddc146317f$export$1ac009feb2b0bd0c = v);
|
38
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield", () => $c14528ddc146317f$export$2c8a10299d8b3418, (v) => $c14528ddc146317f$export$2c8a10299d8b3418 = v);
|
39
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--quiet", () => $c14528ddc146317f$export$bffd5e3d61a81737, (v) => $c14528ddc146317f$export$bffd5e3d61a81737 = v);
|
40
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--multiline", () => $c14528ddc146317f$export$9699f1c538a448a0, (v) => $c14528ddc146317f$export$9699f1c538a448a0 = v);
|
41
|
+
$parcel$export($c14528ddc146317f$exports, "is-placeholder", () => $c14528ddc146317f$export$e5b2f5233e4e5194, (v) => $c14528ddc146317f$export$e5b2f5233e4e5194 = v);
|
42
|
+
$parcel$export($c14528ddc146317f$exports, "is-hovered", () => $c14528ddc146317f$export$b8813cd5d7824ce7, (v) => $c14528ddc146317f$export$b8813cd5d7824ce7 = v);
|
43
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--valid", () => $c14528ddc146317f$export$c2abbc3f970170b7, (v) => $c14528ddc146317f$export$c2abbc3f970170b7 = v);
|
44
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--invalid", () => $c14528ddc146317f$export$58e50b10d30123df, (v) => $c14528ddc146317f$export$58e50b10d30123df = v);
|
45
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield--loadable", () => $c14528ddc146317f$export$14fd30fea6f1348c, (v) => $c14528ddc146317f$export$14fd30fea6f1348c = v);
|
46
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-validationIcon", () => $c14528ddc146317f$export$cf0ead5b44db0da3, (v) => $c14528ddc146317f$export$cf0ead5b44db0da3 = v);
|
47
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-icon", () => $c14528ddc146317f$export$222d1ccd1870be1d, (v) => $c14528ddc146317f$export$222d1ccd1870be1d = v);
|
48
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-inputIcon", () => $c14528ddc146317f$export$c1cdcaa5fe76a871, (v) => $c14528ddc146317f$export$c1cdcaa5fe76a871 = v);
|
49
|
+
$parcel$export($c14528ddc146317f$exports, "spectrum-Textfield-circleLoader", () => $c14528ddc146317f$export$82a249fb4d6127, (v) => $c14528ddc146317f$export$82a249fb4d6127 = v);
|
50
|
+
$parcel$export($c14528ddc146317f$exports, "is-focused", () => $c14528ddc146317f$export$e7dc768d35940237, (v) => $c14528ddc146317f$export$e7dc768d35940237 = v);
|
51
|
+
$parcel$export($c14528ddc146317f$exports, "focus-ring", () => $c14528ddc146317f$export$f39a09f249340e2a, (v) => $c14528ddc146317f$export$f39a09f249340e2a = v);
|
52
|
+
$parcel$export($c14528ddc146317f$exports, "is-disabled", () => $c14528ddc146317f$export$d35bc1e505d1ebbf, (v) => $c14528ddc146317f$export$d35bc1e505d1ebbf = v);
|
53
|
+
var $c14528ddc146317f$export$1ac009feb2b0bd0c;
|
54
|
+
var $c14528ddc146317f$export$2c8a10299d8b3418;
|
55
|
+
var $c14528ddc146317f$export$bffd5e3d61a81737;
|
56
|
+
var $c14528ddc146317f$export$9699f1c538a448a0;
|
57
|
+
var $c14528ddc146317f$export$e5b2f5233e4e5194;
|
58
|
+
var $c14528ddc146317f$export$b8813cd5d7824ce7;
|
59
|
+
var $c14528ddc146317f$export$c2abbc3f970170b7;
|
60
|
+
var $c14528ddc146317f$export$58e50b10d30123df;
|
61
|
+
var $c14528ddc146317f$export$14fd30fea6f1348c;
|
62
|
+
var $c14528ddc146317f$export$cf0ead5b44db0da3;
|
63
|
+
var $c14528ddc146317f$export$222d1ccd1870be1d;
|
64
|
+
var $c14528ddc146317f$export$c1cdcaa5fe76a871;
|
65
|
+
var $c14528ddc146317f$export$82a249fb4d6127;
|
66
|
+
var $c14528ddc146317f$export$e7dc768d35940237;
|
67
|
+
var $c14528ddc146317f$export$f39a09f249340e2a;
|
68
|
+
var $c14528ddc146317f$export$d35bc1e505d1ebbf;
|
69
|
+
$c14528ddc146317f$export$1ac009feb2b0bd0c = "spectrum-Textfield-input_73bc77";
|
70
|
+
$c14528ddc146317f$export$2c8a10299d8b3418 = "spectrum-Textfield_73bc77";
|
71
|
+
$c14528ddc146317f$export$bffd5e3d61a81737 = "spectrum-Textfield--quiet_73bc77";
|
72
|
+
$c14528ddc146317f$export$9699f1c538a448a0 = "spectrum-Textfield--multiline_73bc77";
|
73
|
+
$c14528ddc146317f$export$e5b2f5233e4e5194 = "is-placeholder_73bc77";
|
74
|
+
$c14528ddc146317f$export$b8813cd5d7824ce7 = "is-hovered_73bc77";
|
75
|
+
$c14528ddc146317f$export$c2abbc3f970170b7 = "spectrum-Textfield--valid_73bc77";
|
76
|
+
$c14528ddc146317f$export$58e50b10d30123df = "spectrum-Textfield--invalid_73bc77";
|
77
|
+
$c14528ddc146317f$export$14fd30fea6f1348c = "spectrum-Textfield--loadable_73bc77";
|
78
|
+
$c14528ddc146317f$export$cf0ead5b44db0da3 = "spectrum-Textfield-validationIcon_73bc77";
|
79
|
+
$c14528ddc146317f$export$222d1ccd1870be1d = "spectrum-Textfield-icon_73bc77";
|
80
|
+
$c14528ddc146317f$export$c1cdcaa5fe76a871 = "spectrum-Textfield-inputIcon_73bc77";
|
81
|
+
$c14528ddc146317f$export$82a249fb4d6127 = "spectrum-Textfield-circleLoader_73bc77";
|
82
|
+
$c14528ddc146317f$export$e7dc768d35940237 = "is-focused_73bc77";
|
83
|
+
$c14528ddc146317f$export$f39a09f249340e2a = "focus-ring_73bc77";
|
84
|
+
$c14528ddc146317f$export$d35bc1e505d1ebbf = "is-disabled_73bc77";
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
function $599adb75312e6492$var$TextFieldBase(props, ref) {
|
89
89
|
let { label: label , validationState: validationState , icon: icon , isQuiet: isQuiet = false , isDisabled: isDisabled , multiLine: multiLine , autoFocus: autoFocus , inputClassName: inputClassName , wrapperChildren: wrapperChildren , labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps , inputRef: inputRef , isLoading: isLoading , loadingIndicator: loadingIndicator , validationIconClassName: validationIconClassName } = props;
|
90
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $
|
90
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = $evhxb$useHover({
|
91
91
|
isDisabled: isDisabled
|
92
92
|
});
|
93
|
-
let domRef = $
|
94
|
-
let defaultInputRef = $
|
93
|
+
let domRef = $evhxb$useRef(null);
|
94
|
+
let defaultInputRef = $evhxb$useRef(null);
|
95
95
|
inputRef = inputRef || defaultInputRef;
|
96
96
|
// Expose imperative interface for ref
|
97
|
-
$
|
98
|
-
...$
|
97
|
+
$evhxb$useImperativeHandle(ref, ()=>({
|
98
|
+
...$evhxb$createFocusableRef(domRef, inputRef),
|
99
99
|
select () {
|
100
100
|
if (inputRef.current) inputRef.current.select();
|
101
101
|
},
|
@@ -107,41 +107,41 @@ function $83651c7a03742561$var$TextFieldBase(props, ref) {
|
|
107
107
|
let ElementType = multiLine ? 'textarea' : 'input';
|
108
108
|
let isInvalid = validationState === 'invalid';
|
109
109
|
if (icon) {
|
110
|
-
let UNSAFE_className = $
|
111
|
-
icon = /*#__PURE__*/ $
|
110
|
+
let UNSAFE_className = $evhxb$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), icon.props && icon.props.UNSAFE_className, 'spectrum-Textfield-icon');
|
111
|
+
icon = /*#__PURE__*/ $evhxb$cloneElement(icon, {
|
112
112
|
UNSAFE_className: UNSAFE_className,
|
113
113
|
size: 'S'
|
114
114
|
});
|
115
115
|
}
|
116
|
-
let validationIcon = isInvalid ? /*#__PURE__*/ $
|
117
|
-
let validation = /*#__PURE__*/ $
|
118
|
-
UNSAFE_className: $
|
116
|
+
let validationIcon = isInvalid ? /*#__PURE__*/ $evhxb$react.createElement($evhxb$spectrumiconsuiAlertMedium, null) : /*#__PURE__*/ $evhxb$react.createElement($evhxb$spectrumiconsuiCheckmarkMedium, null);
|
117
|
+
let validation = /*#__PURE__*/ $evhxb$cloneElement(validationIcon, {
|
118
|
+
UNSAFE_className: $evhxb$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'spectrum-Textfield-validationIcon', validationIconClassName)
|
119
119
|
});
|
120
|
-
let textField = /*#__PURE__*/ $
|
121
|
-
className: $
|
120
|
+
let textField = /*#__PURE__*/ $evhxb$react.createElement("div", {
|
121
|
+
className: $evhxb$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'spectrum-Textfield', {
|
122
122
|
'spectrum-Textfield--invalid': isInvalid,
|
123
123
|
'spectrum-Textfield--valid': validationState === 'valid',
|
124
124
|
'spectrum-Textfield--loadable': loadingIndicator,
|
125
125
|
'spectrum-Textfield--quiet': isQuiet,
|
126
126
|
'spectrum-Textfield--multiline': multiLine
|
127
127
|
})
|
128
|
-
}, /*#__PURE__*/ $
|
129
|
-
focusRingClass: $
|
128
|
+
}, /*#__PURE__*/ $evhxb$react.createElement($evhxb$FocusRing, {
|
129
|
+
focusRingClass: $evhxb$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'focus-ring'),
|
130
130
|
isTextInput: true,
|
131
131
|
autoFocus: autoFocus
|
132
|
-
}, /*#__PURE__*/ $
|
133
|
-
...$
|
132
|
+
}, /*#__PURE__*/ $evhxb$react.createElement(ElementType, {
|
133
|
+
...$evhxb$mergeProps(inputProps, hoverProps),
|
134
134
|
ref: inputRef,
|
135
135
|
rows: multiLine ? 1 : undefined,
|
136
|
-
className: $
|
136
|
+
className: $evhxb$classNames((/*@__PURE__*/$parcel$interopDefault($c14528ddc146317f$exports)), 'spectrum-Textfield-input', {
|
137
137
|
'spectrum-Textfield-inputIcon': icon,
|
138
138
|
'is-hovered': isHovered
|
139
139
|
}, inputClassName)
|
140
140
|
})), icon, validationState && !isLoading ? validation : null, isLoading && loadingIndicator, wrapperChildren);
|
141
|
-
if (label) textField = /*#__PURE__*/ $
|
141
|
+
if (label) textField = /*#__PURE__*/ $evhxb$react.cloneElement(textField, $evhxb$mergeProps(textField.props, {
|
142
142
|
className: multiLine ? 'spectrum-Field-field--multiline' : ''
|
143
143
|
}));
|
144
|
-
return(/*#__PURE__*/ $
|
144
|
+
return(/*#__PURE__*/ $evhxb$react.createElement($evhxb$Field, {
|
145
145
|
...props,
|
146
146
|
labelProps: labelProps,
|
147
147
|
descriptionProps: descriptionProps,
|
@@ -150,20 +150,20 @@ function $83651c7a03742561$var$TextFieldBase(props, ref) {
|
|
150
150
|
ref: domRef
|
151
151
|
}, textField));
|
152
152
|
}
|
153
|
-
const $
|
153
|
+
const $599adb75312e6492$export$d22444a338b6e3c2 = /*#__PURE__*/ $evhxb$forwardRef($599adb75312e6492$var$TextFieldBase);
|
154
154
|
|
155
155
|
|
156
156
|
|
157
157
|
|
158
158
|
|
159
|
-
function $
|
160
|
-
props = $
|
159
|
+
function $cc187bf91f8eea73$var$TextArea(props, ref) {
|
160
|
+
props = $evhxb$useProviderProps(props);
|
161
161
|
let { isDisabled: isDisabled = false , isQuiet: isQuiet = false , isReadOnly: isReadOnly = false , isRequired: isRequired = false , onChange: onChange , ...otherProps } = props;
|
162
162
|
// not in stately because this is so we know when to re-measure, which is a spectrum design
|
163
|
-
let [inputValue, setInputValue] = $
|
163
|
+
let [inputValue, setInputValue] = $evhxb$useControlledState(props.value, props.defaultValue, ()=>{
|
164
164
|
});
|
165
|
-
let inputRef = $
|
166
|
-
let onHeightChange = $
|
165
|
+
let inputRef = $evhxb$useRef();
|
166
|
+
let onHeightChange = $evhxb$useCallback(()=>{
|
167
167
|
if (isQuiet) {
|
168
168
|
let input = inputRef.current;
|
169
169
|
let prevAlignment = input.style.alignSelf;
|
@@ -176,19 +176,20 @@ function $de5a8a929fce58e7$var$TextArea(props, ref) {
|
|
176
176
|
isQuiet,
|
177
177
|
inputRef
|
178
178
|
]);
|
179
|
-
$
|
179
|
+
$evhxb$useLayoutEffect(()=>{
|
180
180
|
if (inputRef.current) onHeightChange();
|
181
181
|
}, [
|
182
182
|
onHeightChange,
|
183
183
|
inputValue,
|
184
184
|
inputRef
|
185
185
|
]);
|
186
|
-
|
186
|
+
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');
|
187
|
+
let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $evhxb$useTextField({
|
187
188
|
...props,
|
188
|
-
onChange: $
|
189
|
+
onChange: $evhxb$chain(onChange, setInputValue),
|
189
190
|
inputElementType: 'textarea'
|
190
191
|
}, inputRef);
|
191
|
-
return(/*#__PURE__*/ $
|
192
|
+
return(/*#__PURE__*/ $evhxb$react.createElement($599adb75312e6492$export$d22444a338b6e3c2, {
|
192
193
|
...otherProps,
|
193
194
|
ref: ref,
|
194
195
|
inputRef: inputRef,
|
@@ -207,21 +208,22 @@ function $de5a8a929fce58e7$var$TextArea(props, ref) {
|
|
207
208
|
* TextAreas are multiline text inputs, useful for cases where users have
|
208
209
|
* a sizable amount of text to enter. They allow for all customizations that
|
209
210
|
* are available to text fields.
|
210
|
-
*/ let $
|
211
|
+
*/ let $cc187bf91f8eea73$export$f5c9f3c2c4054eec = /*#__PURE__*/ $evhxb$react.forwardRef($cc187bf91f8eea73$var$TextArea);
|
211
212
|
|
212
213
|
|
213
|
-
var $
|
214
|
+
var $265457f9427aa380$exports = {};
|
214
215
|
|
215
|
-
$parcel$export($
|
216
|
+
$parcel$export($265457f9427aa380$exports, "TextField", () => $265457f9427aa380$export$2c73285ae9390cec);
|
216
217
|
|
217
218
|
|
218
219
|
|
219
220
|
|
220
|
-
function $
|
221
|
-
props = $
|
222
|
-
let inputRef = $
|
223
|
-
let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $
|
224
|
-
|
221
|
+
function $265457f9427aa380$var$TextField(props, ref) {
|
222
|
+
props = $evhxb$useProviderProps(props);
|
223
|
+
let inputRef = $evhxb$useRef();
|
224
|
+
let { labelProps: labelProps , inputProps: inputProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $evhxb$useTextField(props, inputRef);
|
225
|
+
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');
|
226
|
+
return(/*#__PURE__*/ $evhxb$react.createElement($599adb75312e6492$export$d22444a338b6e3c2, {
|
225
227
|
...props,
|
226
228
|
labelProps: labelProps,
|
227
229
|
inputProps: inputProps,
|
@@ -235,11 +237,11 @@ function $2d97b2be3a1f9c23$var$TextField(props, ref) {
|
|
235
237
|
* TextFields are text inputs that allow users to input custom text entries
|
236
238
|
* with a keyboard. Various decorations can be displayed around the field to
|
237
239
|
* communicate the entry requirements.
|
238
|
-
*/ const $
|
240
|
+
*/ const $265457f9427aa380$export$2c73285ae9390cec = /*#__PURE__*/ $evhxb$forwardRef($265457f9427aa380$var$TextField);
|
239
241
|
|
240
242
|
|
241
243
|
|
242
244
|
|
243
245
|
|
244
|
-
export {$
|
246
|
+
export {$cc187bf91f8eea73$export$f5c9f3c2c4054eec as TextArea, $265457f9427aa380$export$2c73285ae9390cec as TextField, $599adb75312e6492$export$d22444a338b6e3c2 as TextFieldBase};
|
245
247
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,GAA0C;AAC1C,GAAoC;AACpC,GAA2C;AAC3C,GAA+C;AAC/C,GAAgC;AAChC,GAA4B;AAC5B,GAA2C;AAC3C,GAA6C;AAC7C,GAA8C;AAC9C,GAAmD;AACnD,GAAyC;AACzC,GAA8C;AAC9C,GAAiD;AACjD,GAA4B;AAC5B,GAA4B;AAC5B,GAA6B;AAf7B,yCAA0C,GAAG,CAAiC;AAC9E,yCAAoC,GAAG,CAA2B;AAClE,yCAA2C,GAAG,CAAkC;AAChF,yCAA+C,GAAG,CAAsC;AACxF,yCAAgC,GAAG,CAAuB;AAC1D,yCAA4B,GAAG,CAAmB;AAClD,yCAA2C,GAAG,CAAkC;AAChF,yCAA6C,G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K;QACT,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,gBAAgB;QAClC,iBAAiB,EAAE,iBAAiB;QACpC,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ;;AAExB,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,KAAK,CAAC,yCAAU,iBAAG,iBAAU,CAAC,+BAAS;;","sources":["packages/@react-spectrum/textfield/src/index.ts","packages/@react-spectrum/textfield/src/TextArea.tsx","packages/@react-spectrum/textfield/src/TextFieldBase.tsx","packages/@adobe/spectrum-css-temp/components/textfield/vars.css","packages/@react-spectrum/textfield/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport * from './TextArea';\nexport * from './TextField';\nexport * from './TextFieldBase';\n","/*\n * Copyright 2020 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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {RefObject, useCallback, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextArea(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue, () => {});\n\n let inputRef = useRef<HTMLTextAreaElement>();\n\n let onHeightChange = useCallback(() => {\n if (isQuiet) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n input.style.height = `${input.scrollHeight}px`;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={ref}\n inputRef={inputRef}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = React.forwardRef(TextArea);\nexport {_TextArea as TextArea};\n","/*\n * Copyright 2020 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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport {PressEvents} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, RefObject, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useHover} from '@react-aria/interactions';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange'>, PressEvents {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean\n}\n\nfunction TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) {\n let {\n label,\n validationState,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n inputRef = inputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid';\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && icon.props.UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n });\n }\n\n let validationIcon = isInvalid ? <AlertMedium /> : <CheckmarkMedium />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid',\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine\n }\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} isTextInput autoFocus={autoFocus}>\n <ElementType\n {...mergeProps(inputProps, hoverProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n </FocusRing>\n {icon}\n {validationState && !isLoading ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n if (label) {\n textField = React.cloneElement(textField, mergeProps(textField.props, {\n className: multiLine ? 'spectrum-Field-field--multiline' : ''\n }));\n }\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n}\n\nconst _TextFieldBase = forwardRef(TextFieldBase);\nexport {_TextFieldBase as TextFieldBase};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 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 React, {forwardRef, RefObject, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextField(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n\n let inputRef = useRef<HTMLInputElement>();\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField(props, inputRef);\n return (\n <TextFieldBase\n {...props}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n ref={ref}\n inputRef={inputRef} />\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _TextField = forwardRef(TextField);\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,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,gBAAgB;QAClC,iBAAiB,EAAE,iBAAiB;QACpC,SAAS,EAAT,IAAS;QACT,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;;AAE5B,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,GAAG,CAAC,yCAAS,iBAAG,YAAK,CAAC,UAAU,CAAC,8BAAQ;;;;;;;;;;SGnEhC,+BAAS,CAAC,KAA6B,EAAE,GAA4B,EAAE,CAAC;IAC/E,KAAK,GAAG,uBAAgB,CAAC,KAAK;IAE9B,GAAG,CAAC,QAAQ,GAAG,aAAM;IACrB,GAAG,CAAC,CAAC,aAAA,UAAU,eAAE,UAAU,qBAAE,gBAAgB,sBAAE,iBAAiB,EAAA,CAAC,GAAG,mBAAY,CAAC,KAAK,EAAE,QAAQ;IAEhG,EAAE,EAAE,KAAK,CAAC,WAAW,EACnB,OAAO,CAAC,IAAI,CAAC,CAA2L;IAG1M,MAAM,0CACH,yCAAa;WACR,KAAK;QACT,UAAU,EAAE,UAAU;QACtB,UAAU,EAAE,UAAU;QACtB,gBAAgB,EAAE,gBAAgB;QAClC,iBAAiB,EAAE,iBAAiB;QACpC,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,QAAQ;;AAExB,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,KAAK,CAAC,yCAAU,iBAAG,iBAAU,CAAC,+BAAS;;","sources":["packages/@react-spectrum/textfield/src/index.ts","packages/@react-spectrum/textfield/src/TextArea.tsx","packages/@react-spectrum/textfield/src/TextFieldBase.tsx","packages/@adobe/spectrum-css-temp/components/textfield/vars.css","packages/@react-spectrum/textfield/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport * from './TextArea';\nexport * from './TextField';\nexport * from './TextFieldBase';\n","/*\n * Copyright 2020 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 {chain, useLayoutEffect} from '@react-aria/utils';\nimport React, {RefObject, useCallback, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useControlledState} from '@react-stately/utils';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextArea(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n let {\n isDisabled = false,\n isQuiet = false,\n isReadOnly = false,\n isRequired = false,\n onChange,\n ...otherProps\n } = props;\n\n // not in stately because this is so we know when to re-measure, which is a spectrum design\n let [inputValue, setInputValue] = useControlledState(props.value, props.defaultValue, () => {});\n\n let inputRef = useRef<HTMLTextAreaElement>();\n\n let onHeightChange = useCallback(() => {\n if (isQuiet) {\n let input = inputRef.current;\n let prevAlignment = input.style.alignSelf;\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n input.style.height = `${input.scrollHeight}px`;\n input.style.alignSelf = prevAlignment;\n }\n }, [isQuiet, inputRef]);\n\n useLayoutEffect(() => {\n if (inputRef.current) {\n onHeightChange();\n }\n }, [onHeightChange, inputValue, inputRef]);\n\n if (props.placeholder) {\n 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');\n }\n\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField({\n ...props,\n onChange: chain(onChange, setInputValue),\n inputElementType: 'textarea'\n }, inputRef);\n\n return (\n <TextFieldBase\n {...otherProps}\n ref={ref}\n inputRef={inputRef}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n multiLine\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = React.forwardRef(TextArea);\nexport {_TextArea as TextArea};\n","/*\n * Copyright 2020 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 AlertMedium from '@spectrum-icons/ui/AlertMedium';\nimport CheckmarkMedium from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, createFocusableRef} from '@react-spectrum/utils';\nimport {Field} from '@react-spectrum/label';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport {PressEvents} from '@react-types/shared';\nimport React, {cloneElement, forwardRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, ReactElement, Ref, RefObject, TextareaHTMLAttributes, useImperativeHandle, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport styles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useHover} from '@react-aria/interactions';\n\ninterface TextFieldBaseProps extends Omit<SpectrumTextFieldProps, 'onChange'>, PressEvents {\n wrapperChildren?: ReactElement | ReactElement[],\n inputClassName?: string,\n validationIconClassName?: string,\n multiLine?: boolean,\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>,\n inputProps: InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement>,\n descriptionProps?: HTMLAttributes<HTMLElement>,\n errorMessageProps?: HTMLAttributes<HTMLElement>,\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>,\n loadingIndicator?: ReactElement,\n isLoading?: boolean\n}\n\nfunction TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) {\n let {\n label,\n validationState,\n icon,\n isQuiet = false,\n isDisabled,\n multiLine,\n autoFocus,\n inputClassName,\n wrapperChildren,\n labelProps,\n inputProps,\n descriptionProps,\n errorMessageProps,\n inputRef,\n isLoading,\n loadingIndicator,\n validationIconClassName\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let domRef = useRef<HTMLDivElement>(null);\n let defaultInputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n inputRef = inputRef || defaultInputRef;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n let ElementType: React.ElementType = multiLine ? 'textarea' : 'input';\n let isInvalid = validationState === 'invalid';\n\n if (icon) {\n let UNSAFE_className = classNames(\n styles,\n icon.props && icon.props.UNSAFE_className,\n 'spectrum-Textfield-icon'\n );\n\n icon = cloneElement(icon, {\n UNSAFE_className,\n size: 'S'\n });\n }\n\n let validationIcon = isInvalid ? <AlertMedium /> : <CheckmarkMedium />;\n let validation = cloneElement(validationIcon, {\n UNSAFE_className: classNames(\n styles,\n 'spectrum-Textfield-validationIcon',\n validationIconClassName\n )\n });\n\n let textField = (\n <div\n className={\n classNames(\n styles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid',\n 'spectrum-Textfield--loadable': loadingIndicator,\n 'spectrum-Textfield--quiet': isQuiet,\n 'spectrum-Textfield--multiline': multiLine\n }\n )\n }>\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} isTextInput autoFocus={autoFocus}>\n <ElementType\n {...mergeProps(inputProps, hoverProps)}\n ref={inputRef as any}\n rows={multiLine ? 1 : undefined}\n className={\n classNames(\n styles,\n 'spectrum-Textfield-input',\n {\n 'spectrum-Textfield-inputIcon': icon,\n 'is-hovered': isHovered\n },\n inputClassName\n )\n } />\n </FocusRing>\n {icon}\n {validationState && !isLoading ? validation : null}\n {isLoading && loadingIndicator}\n {wrapperChildren}\n </div>\n );\n\n if (label) {\n textField = React.cloneElement(textField, mergeProps(textField.props, {\n className: multiLine ? 'spectrum-Field-field--multiline' : ''\n }));\n }\n\n return (\n <Field\n {...props}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n showErrorIcon={false}\n ref={domRef}>\n {textField}\n </Field>\n );\n}\n\nconst _TextFieldBase = forwardRef(TextFieldBase);\nexport {_TextFieldBase as TextFieldBase};\n","/*\n * Copyright 2020 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\n@import './index.css';\n@import './skin.css';\n","/*\n * Copyright 2020 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 React, {forwardRef, RefObject, useRef} from 'react';\nimport {SpectrumTextFieldProps, TextFieldRef} from '@react-types/textfield';\nimport {TextFieldBase} from './TextFieldBase';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTextField} from '@react-aria/textfield';\n\nfunction TextField(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {\n props = useProviderProps(props);\n\n let inputRef = useRef<HTMLInputElement>();\n let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField(props, inputRef);\n\n if (props.placeholder) {\n 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');\n }\n\n return (\n <TextFieldBase\n {...props}\n labelProps={labelProps}\n inputProps={inputProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n ref={ref}\n inputRef={inputRef} />\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nconst _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;AAwBA,4BAA6B,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,WAAW;IACxF,eAAe,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uBAAuB,CAAC,EAAE,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sources":["packages/@react-spectrum/textfield/src/packages/@react-spectrum/textfield/src/TextFieldBase.tsx","packages/@react-spectrum/textfield/src/packages/@react-spectrum/textfield/src/TextArea.tsx","packages/@react-spectrum/textfield/src/packages/@react-spectrum/textfield/src/TextField.tsx","packages/@react-spectrum/textfield/src/packages/@react-spectrum/textfield/src/index.ts","packages/@react-spectrum/textfield/src/index.ts"],"sourcesContent":[null,null,null,null,"/*\n * Copyright 2020 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\n/// <reference types=\"css-module-types\" />\n\nexport * from './TextArea';\nexport * from './TextField';\nexport * from './TextFieldBase';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/textfield",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.4.0",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -32,17 +32,17 @@
|
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@babel/runtime": "^7.6.2",
|
35
|
-
"@react-aria/focus": "^3.5.
|
36
|
-
"@react-aria/i18n": "^3.3.
|
37
|
-
"@react-aria/interactions": "^3.8.
|
38
|
-
"@react-aria/textfield": "^3.5.
|
39
|
-
"@react-aria/utils": "^3.
|
40
|
-
"@react-spectrum/label": "^3.
|
41
|
-
"@react-spectrum/utils": "^3.6.
|
35
|
+
"@react-aria/focus": "^3.5.5",
|
36
|
+
"@react-aria/i18n": "^3.3.9",
|
37
|
+
"@react-aria/interactions": "^3.8.4",
|
38
|
+
"@react-aria/textfield": "^3.5.5",
|
39
|
+
"@react-aria/utils": "^3.12.0",
|
40
|
+
"@react-spectrum/label": "^3.5.0",
|
41
|
+
"@react-spectrum/utils": "^3.6.8",
|
42
42
|
"@react-stately/utils": "^3.4.1",
|
43
|
-
"@react-types/shared": "^3.
|
44
|
-
"@react-types/textfield": "^3.
|
45
|
-
"@spectrum-icons/ui": "^3.2.
|
43
|
+
"@react-types/shared": "^3.12.0",
|
44
|
+
"@react-types/textfield": "^3.4.0",
|
45
|
+
"@spectrum-icons/ui": "^3.2.6"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
48
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
|
@@ -55,5 +55,5 @@
|
|
55
55
|
"publishConfig": {
|
56
56
|
"access": "public"
|
57
57
|
},
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "6a503b715e0dbbf92038cd7f08b1bcdde4c78e82"
|
59
59
|
}
|
package/src/TextArea.tsx
CHANGED
@@ -51,6 +51,9 @@ function TextArea(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>) {
|
|
51
51
|
}
|
52
52
|
}, [onHeightChange, inputValue, inputRef]);
|
53
53
|
|
54
|
+
if (props.placeholder) {
|
55
|
+
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');
|
56
|
+
}
|
54
57
|
|
55
58
|
let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField({
|
56
59
|
...props,
|
package/src/TextField.tsx
CHANGED
@@ -21,6 +21,11 @@ function TextField(props: SpectrumTextFieldProps, ref: RefObject<TextFieldRef>)
|
|
21
21
|
|
22
22
|
let inputRef = useRef<HTMLInputElement>();
|
23
23
|
let {labelProps, inputProps, descriptionProps, errorMessageProps} = useTextField(props, inputRef);
|
24
|
+
|
25
|
+
if (props.placeholder) {
|
26
|
+
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');
|
27
|
+
}
|
28
|
+
|
24
29
|
return (
|
25
30
|
<TextFieldBase
|
26
31
|
{...props}
|