@launchpad-ui/form 0.4.0 → 0.5.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/Checkbox.d.ts +1 -37
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/CompactTextField.d.ts +0 -1
- package/dist/CompactTextField.d.ts.map +1 -1
- package/dist/FieldError.d.ts +3 -4
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FieldSet.d.ts +3 -6
- package/dist/FieldSet.d.ts.map +1 -1
- package/dist/Form.d.ts +2 -11
- package/dist/Form.d.ts.map +1 -1
- package/dist/FormField.d.ts +2 -1
- package/dist/FormField.d.ts.map +1 -1
- package/dist/FormGroup.d.ts +2 -6
- package/dist/FormGroup.d.ts.map +1 -1
- package/dist/FormHint.d.ts +2 -6
- package/dist/FormHint.d.ts.map +1 -1
- package/dist/IconField.d.ts +4 -4
- package/dist/IconField.d.ts.map +1 -1
- package/dist/Label.d.ts +3 -8
- package/dist/Label.d.ts.map +1 -1
- package/dist/Radio.d.ts +3 -49
- package/dist/Radio.d.ts.map +1 -1
- package/dist/RequiredAsterisk.d.ts +2 -4
- package/dist/RequiredAsterisk.d.ts.map +1 -1
- package/dist/Select.d.ts +3 -15
- package/dist/Select.d.ts.map +1 -1
- package/dist/TextField.d.ts +0 -2
- package/dist/TextField.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +30 -63
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +30 -63
- package/dist/index.js.map +1 -1
- package/dist/style.css +0 -7
- package/package.json +1 -1
- package/dist/InputGroup.d.ts +0 -7
- package/dist/InputGroup.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
@@ -7,32 +7,28 @@ import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
7
7
|
const RequiredAsterisk$1 = "";
|
8
8
|
const RequiredAsterisk = ({
|
9
9
|
className,
|
10
|
-
testId,
|
11
10
|
...rest
|
12
11
|
}) => {
|
13
|
-
const classes = cx("RequiredAsterisk");
|
12
|
+
const classes = cx("RequiredAsterisk", className);
|
14
13
|
return /* @__PURE__ */ jsx("span", {
|
15
|
-
className: classes,
|
16
|
-
"data-test-id": testId,
|
17
14
|
...rest,
|
15
|
+
className: classes,
|
18
16
|
children: "*"
|
19
17
|
});
|
20
18
|
};
|
21
19
|
const Form$1 = "";
|
22
20
|
const Label = ({
|
23
|
-
htmlFor,
|
24
21
|
disabled,
|
25
22
|
className,
|
26
23
|
children,
|
27
24
|
required = false,
|
28
25
|
optional = false,
|
29
|
-
...
|
26
|
+
...rest
|
30
27
|
}) => {
|
31
28
|
const classes = cx("Form-label", className, disabled && "Form-label--disabled");
|
32
29
|
return /* @__PURE__ */ jsxs("label", {
|
33
|
-
...
|
30
|
+
...rest,
|
34
31
|
className: classes,
|
35
|
-
htmlFor,
|
36
32
|
children: [children, optional && !required && /* @__PURE__ */ jsx("small", {
|
37
33
|
className: "Form-labelOptional",
|
38
34
|
children: "(optional)"
|
@@ -44,10 +40,9 @@ const Checkbox = forwardRef(({
|
|
44
40
|
"aria-labelledby": ariaLabelledby,
|
45
41
|
children,
|
46
42
|
disabled,
|
47
|
-
testId,
|
48
43
|
checked,
|
49
44
|
labelClassName,
|
50
|
-
...
|
45
|
+
...rest
|
51
46
|
}, ref) => {
|
52
47
|
const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
|
53
48
|
if (!children && !hasAriaLabel) {
|
@@ -56,7 +51,7 @@ const Checkbox = forwardRef(({
|
|
56
51
|
return /* @__PURE__ */ jsxs(Label, {
|
57
52
|
className: labelClassName,
|
58
53
|
children: [/* @__PURE__ */ jsx("input", {
|
59
|
-
...
|
54
|
+
...rest,
|
60
55
|
ref,
|
61
56
|
checked,
|
62
57
|
"aria-checked": checked ? "true" : "false",
|
@@ -64,7 +59,6 @@ const Checkbox = forwardRef(({
|
|
64
59
|
"aria-labelledby": ariaLabelledby,
|
65
60
|
className: "Form-checkbox",
|
66
61
|
disabled,
|
67
|
-
"data-test-id": testId,
|
68
62
|
type: "checkbox"
|
69
63
|
}), " ", disabled ? /* @__PURE__ */ jsx("span", {
|
70
64
|
className: "Form-label--disabled",
|
@@ -81,7 +75,6 @@ const TextField = forwardRef(({
|
|
81
75
|
tiny = false,
|
82
76
|
readOnly,
|
83
77
|
tabIndex = 0,
|
84
|
-
testId,
|
85
78
|
suffix,
|
86
79
|
overrideWidth,
|
87
80
|
...rest
|
@@ -96,7 +89,6 @@ const TextField = forwardRef(({
|
|
96
89
|
className: cx(classes, "FormInput-suffix"),
|
97
90
|
readOnly,
|
98
91
|
ref,
|
99
|
-
"data-test-id": testId,
|
100
92
|
"aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)
|
101
93
|
}), /* @__PURE__ */ jsx("label", {
|
102
94
|
className: "FormInput-suffix",
|
@@ -112,7 +104,6 @@ const TextField = forwardRef(({
|
|
112
104
|
readOnly,
|
113
105
|
tabIndex,
|
114
106
|
ref,
|
115
|
-
"data-test-id": testId,
|
116
107
|
style: overrideWidth ? {
|
117
108
|
width: overrideWidth
|
118
109
|
} : void 0,
|
@@ -124,9 +115,7 @@ const CompactTextField$1 = "";
|
|
124
115
|
const CompactTextField = forwardRef(({
|
125
116
|
className,
|
126
117
|
id,
|
127
|
-
name,
|
128
118
|
label,
|
129
|
-
type,
|
130
119
|
needsErrorFeedback,
|
131
120
|
value,
|
132
121
|
onFocus,
|
@@ -158,8 +147,6 @@ const CompactTextField = forwardRef(({
|
|
158
147
|
}), /* @__PURE__ */ jsx(TextField, {
|
159
148
|
...rest,
|
160
149
|
id,
|
161
|
-
name,
|
162
|
-
type,
|
163
150
|
placeholder,
|
164
151
|
value,
|
165
152
|
ref,
|
@@ -172,12 +159,14 @@ CompactTextField.displayName = "CompactTextField";
|
|
172
159
|
const FieldError = ({
|
173
160
|
name,
|
174
161
|
errorMessage,
|
175
|
-
className
|
162
|
+
className,
|
163
|
+
...rest
|
176
164
|
}) => {
|
177
165
|
if (!errorMessage) {
|
178
166
|
return null;
|
179
167
|
}
|
180
168
|
return /* @__PURE__ */ jsx("span", {
|
169
|
+
...rest,
|
181
170
|
className: cx("Form-fieldError", className),
|
182
171
|
"aria-live": "polite",
|
183
172
|
id: createFieldErrorId(name),
|
@@ -187,30 +176,26 @@ const FieldError = ({
|
|
187
176
|
const FieldSet$1 = "";
|
188
177
|
const FieldSet = ({
|
189
178
|
children,
|
190
|
-
|
179
|
+
className,
|
180
|
+
...rest
|
191
181
|
}) => {
|
182
|
+
const classes = cx("FieldSet", className);
|
192
183
|
return /* @__PURE__ */ jsx("fieldset", {
|
193
|
-
className:
|
194
|
-
|
184
|
+
className: classes,
|
185
|
+
...rest,
|
195
186
|
children
|
196
187
|
});
|
197
188
|
};
|
198
189
|
const Form = (props) => {
|
199
190
|
const {
|
200
|
-
id,
|
201
|
-
name,
|
202
191
|
className,
|
203
192
|
inline,
|
204
193
|
children,
|
205
|
-
ariaLabel,
|
206
194
|
hasIncreasedErrorMargin,
|
207
195
|
...rest
|
208
196
|
} = props;
|
209
197
|
const classes = cx("Form", className, inline && "Form--inline", !!hasIncreasedErrorMargin && "Form--increasedErrorMargin");
|
210
198
|
return /* @__PURE__ */ jsx("form", {
|
211
|
-
id,
|
212
|
-
name,
|
213
|
-
"aria-label": ariaLabel,
|
214
199
|
...rest,
|
215
200
|
className: classes,
|
216
201
|
children
|
@@ -223,14 +208,12 @@ const FormGroup = (props) => {
|
|
223
208
|
ignoreValidation,
|
224
209
|
isInvalid,
|
225
210
|
children,
|
226
|
-
|
227
|
-
...other
|
211
|
+
...rest
|
228
212
|
} = props;
|
229
213
|
const classes = cx("Form-group", className, !ignoreValidation && isInvalid && "is-invalid");
|
230
214
|
return /* @__PURE__ */ jsx("div", {
|
231
215
|
className: classes,
|
232
|
-
|
233
|
-
...other,
|
216
|
+
...rest,
|
234
217
|
children
|
235
218
|
});
|
236
219
|
};
|
@@ -259,7 +242,8 @@ const FormField = ({
|
|
259
242
|
isInvalid,
|
260
243
|
children,
|
261
244
|
className,
|
262
|
-
onBlur
|
245
|
+
onBlur,
|
246
|
+
"data-test-id": testId
|
263
247
|
}) => {
|
264
248
|
const handleBlur = () => {
|
265
249
|
onBlur && onBlur(name);
|
@@ -270,6 +254,7 @@ const FormField = ({
|
|
270
254
|
ignoreValidation,
|
271
255
|
isInvalid,
|
272
256
|
onBlur: handleBlur,
|
257
|
+
"data-test-id": testId,
|
273
258
|
children: [label && /* @__PURE__ */ jsxs("label", {
|
274
259
|
htmlFor,
|
275
260
|
children: [label, isRequired && /* @__PURE__ */ jsx(RequiredAsterisk, {})]
|
@@ -286,29 +271,20 @@ const FormField = ({
|
|
286
271
|
const IconField$1 = "";
|
287
272
|
const IconField = ({
|
288
273
|
icon,
|
289
|
-
children
|
274
|
+
children,
|
275
|
+
className,
|
276
|
+
...rest
|
290
277
|
}) => {
|
291
278
|
const Icon = icon;
|
279
|
+
const classes = cx("IconField", className);
|
292
280
|
return /* @__PURE__ */ jsxs("div", {
|
293
|
-
className:
|
281
|
+
className: classes,
|
282
|
+
...rest,
|
294
283
|
children: [children, /* @__PURE__ */ jsx(Icon, {
|
295
284
|
size: IconSize.SMALL
|
296
285
|
})]
|
297
286
|
});
|
298
287
|
};
|
299
|
-
const InputGroup$1 = "";
|
300
|
-
const InputGroup = ({
|
301
|
-
className,
|
302
|
-
children,
|
303
|
-
...other
|
304
|
-
}) => {
|
305
|
-
const classes = cx("InputGroup", className);
|
306
|
-
return /* @__PURE__ */ jsx("div", {
|
307
|
-
...other,
|
308
|
-
className: classes,
|
309
|
-
children
|
310
|
-
});
|
311
|
-
};
|
312
288
|
const Radio = ({
|
313
289
|
"aria-label": ariaLabel,
|
314
290
|
"aria-labelledby": ariaLabelledby,
|
@@ -318,11 +294,8 @@ const Radio = ({
|
|
318
294
|
disabled = false,
|
319
295
|
id,
|
320
296
|
labelClassName,
|
321
|
-
name,
|
322
|
-
onChange = () => void 0,
|
323
297
|
labelStyle,
|
324
|
-
|
325
|
-
...props
|
298
|
+
...rest
|
326
299
|
}) => {
|
327
300
|
const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
|
328
301
|
if (!children && !hasAriaLabel) {
|
@@ -330,17 +303,14 @@ const Radio = ({
|
|
330
303
|
}
|
331
304
|
return /* @__PURE__ */ jsxs(Fragment, {
|
332
305
|
children: [/* @__PURE__ */ jsx("input", {
|
306
|
+
...rest,
|
333
307
|
"aria-label": ariaLabel,
|
334
308
|
"aria-labelledby": ariaLabelledby,
|
335
309
|
className: cx("Form-radio", className),
|
336
310
|
checked,
|
337
311
|
disabled,
|
338
312
|
id,
|
339
|
-
|
340
|
-
onChange,
|
341
|
-
type: "radio",
|
342
|
-
value,
|
343
|
-
...props
|
313
|
+
type: "radio"
|
344
314
|
}), /* @__PURE__ */ jsx(Label, {
|
345
315
|
className: labelClassName,
|
346
316
|
htmlFor: id,
|
@@ -360,7 +330,7 @@ const RadioGroup = (props) => {
|
|
360
330
|
children,
|
361
331
|
disabled,
|
362
332
|
legend,
|
363
|
-
...
|
333
|
+
...rest
|
364
334
|
} = props;
|
365
335
|
const fieldsetRef = useRef(null);
|
366
336
|
function updateRadioElems(elem) {
|
@@ -409,7 +379,7 @@ const RadioGroup = (props) => {
|
|
409
379
|
children: legend
|
410
380
|
})
|
411
381
|
}), /* @__PURE__ */ jsx("div", {
|
412
|
-
...
|
382
|
+
...rest,
|
413
383
|
children: radios
|
414
384
|
})]
|
415
385
|
});
|
@@ -417,14 +387,12 @@ const RadioGroup = (props) => {
|
|
417
387
|
const Select = ({
|
418
388
|
className,
|
419
389
|
children,
|
420
|
-
testId,
|
421
390
|
...rest
|
422
391
|
}) => {
|
423
392
|
const classes = cx("FormInput", "FormInput-select", className);
|
424
393
|
return /* @__PURE__ */ jsx("select", {
|
425
394
|
...rest,
|
426
395
|
className: classes,
|
427
|
-
"data-test-id": testId,
|
428
396
|
children
|
429
397
|
});
|
430
398
|
};
|
@@ -459,7 +427,6 @@ export {
|
|
459
427
|
FormGroup,
|
460
428
|
FormHint,
|
461
429
|
IconField,
|
462
|
-
InputGroup,
|
463
430
|
Label,
|
464
431
|
Radio,
|
465
432
|
RadioGroup,
|
package/dist/index.es.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/RequiredAsterisk.tsx","../src/Label.tsx","../src/Checkbox.tsx","../src/utils/index.ts","../src/TextField.tsx","../src/CompactTextField.tsx","../src/FieldError.tsx","../src/FieldSet.tsx","../src/Form.tsx","../src/FormGroup.tsx","../src/FormHint.tsx","../src/FormField.tsx","../src/IconField.tsx","../src/InputGroup.tsx","../src/Radio.tsx","../src/RadioGroup.tsx","../src/Select.tsx","../src/TextArea.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/RequiredAsterisk.css';\n\ntype RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement> & {\n testId?: string;\n};\n\nconst RequiredAsterisk = ({ className, testId, ...rest }: RequiredAsteriskProps) => {\n const classes = cx('RequiredAsterisk');\n\n return (\n <span className={classes} data-test-id={testId} {...rest}>\n *\n </span>\n );\n};\n\nexport { RequiredAsterisk };\nexport type { RequiredAsteriskProps };\n","import type { CSSProperties, ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/Form.css';\n\ntype LabelProps = {\n htmlFor?: string;\n required?: boolean;\n optional?: boolean;\n disabled?: boolean;\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n hidden?: boolean;\n};\n\nconst Label = ({\n htmlFor,\n disabled,\n className,\n children,\n required = false,\n optional = false,\n ...other\n}: LabelProps) => {\n const classes = cx('Form-label', className, disabled && 'Form-label--disabled');\n return (\n <label {...other} className={classes} htmlFor={htmlFor}>\n {children}\n {optional && !required && <small className=\"Form-labelOptional\">(optional)</small>}\n {required && !optional && <RequiredAsterisk />}\n </label>\n );\n};\n\nexport { Label };\nexport type { LabelProps };\n","import type { InputHTMLAttributes, ReactNode } from 'react';\n\nimport { forwardRef } from 'react';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {\n /**\n * Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.\n */\n 'aria-label'?: string;\n /**\n * id attribute of the label text elsewhere in the app, used for screen reader support\n * Use this for cases where you have a visible label on the page that is not close to\n * the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/\n */\n 'aria-labelledby'?: string;\n /**\n * Label for the Checkbox\n */\n children?: ReactNode;\n /**\n * The className to pass into the Checkbox's Label component\n */\n labelClassName?: string;\n /**\n * The test id for the data-test-id attribute for React Testing Library support\n */\n testId?: string;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n disabled,\n testId,\n checked,\n labelClassName,\n ...other\n },\n ref\n ) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <Label className={labelClassName}>\n <input\n {...other}\n ref={ref}\n checked={checked}\n aria-checked={checked ? 'true' : 'false'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className=\"Form-checkbox\"\n disabled={disabled}\n data-test-id={testId}\n type=\"checkbox\"\n />{' '}\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox };\nexport type { CheckboxProps };\n","type FieldPath = string | string[];\n\nconst createFieldErrorId = (fieldIdentifier?: FieldPath) =>\n fieldIdentifier ? `${[...fieldIdentifier].join('')}-err` : undefined;\n\nexport { createFieldErrorId };\nexport type { FieldPath };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextFieldProps = InputHTMLAttributes<HTMLInputElement> & {\n suffix?: string;\n testId?: string;\n tiny?: boolean;\n overrideWidth?: string;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n className,\n type = 'text',\n tiny = false,\n readOnly,\n tabIndex = 0,\n testId,\n suffix,\n overrideWidth,\n ...rest\n },\n ref\n ) => {\n const classes = overrideWidth\n ? className\n : cx('FormInput', `FormInput-${type}`, className, tiny && 'FormInput--tiny');\n if (suffix) {\n return (\n <div className=\"FormInput-suffixContainer\">\n <input\n {...rest}\n type={type}\n className={cx(classes, 'FormInput-suffix')}\n readOnly={readOnly}\n ref={ref}\n data-test-id={testId}\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n <label className=\"FormInput-suffix\" htmlFor={rest.id}>\n {suffix}\n </label>\n </div>\n );\n }\n\n return (\n <input\n {...rest}\n type={type}\n className={classes}\n readOnly={readOnly}\n tabIndex={tabIndex}\n ref={ref}\n data-test-id={testId}\n style={\n overrideWidth\n ? {\n width: overrideWidth,\n }\n : undefined\n }\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n );\n }\n);\n\nTextField.displayName = 'TextField';\n\nexport { TextField };\nexport type { TextFieldProps };\n","import type { TextFieldProps } from './TextField';\nimport type { FocusEvent } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef, useState } from 'react';\n\nimport { Label } from './Label';\nimport { TextField } from './TextField';\nimport './styles/CompactTextField.css';\nimport './styles/FormInput.css';\n\ntype CompactTextFieldProps = TextFieldProps & {\n label: string;\n needsErrorFeedback?: boolean;\n};\n\nconst CompactTextField = forwardRef<HTMLInputElement, CompactTextFieldProps>(\n (\n { className, id, name, label, type, needsErrorFeedback, value, onFocus, onBlur, ...rest },\n ref\n ) => {\n const [isActive, setIsActive] = useState(\n (typeof value === 'boolean' || value ? value.toString() : '').trim().length !== 0\n );\n\n const isActiveState = isActive || needsErrorFeedback;\n\n const classes = cx('CompactTextField', className, isActiveState && 'is-active');\n\n const placeholder = isActiveState ? '' : label;\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setIsActive(true);\n if (onFocus) {\n onFocus(event);\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n const value = event.target.value || '';\n setIsActive(value.trim().length !== 0);\n if (onBlur) {\n onBlur(event);\n }\n };\n\n return (\n <div className={classes}>\n <Label htmlFor={id}>{label}</Label>\n <TextField\n {...rest}\n id={id}\n name={name}\n type={type}\n placeholder={placeholder}\n value={value}\n ref={ref}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </div>\n );\n }\n);\n\nCompactTextField.displayName = 'CompactTextField';\n\nexport { CompactTextField };\nexport type { CompactTextFieldProps };\n","import type { FieldPath } from './utils';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\nimport { createFieldErrorId } from './utils';\n\ntype FieldErrorProps = {\n name: FieldPath;\n errorMessage?: string;\n className?: string;\n};\n\nconst FieldError = ({ name, errorMessage, className }: FieldErrorProps) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n <span\n className={cx('Form-fieldError', className)}\n aria-live=\"polite\"\n id={createFieldErrorId(name)}\n >\n {`Error - ${errorMessage}`}\n </span>\n );\n};\n\nexport { FieldError };\nexport type { FieldErrorProps };\n","import type { ReactNode } from 'react';\n\nimport './styles/FieldSet.css';\n\ntype FieldSetProps = {\n children?: ReactNode;\n testId?: string;\n};\n\nconst FieldSet = ({ children, testId }: FieldSetProps) => {\n return (\n <fieldset className=\"FieldSet\" data-test-id={testId}>\n {children}\n </fieldset>\n );\n};\n\nexport { FieldSet };\nexport type { FieldSetProps };\n","import type { FocusEvent, FormEvent, ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormProps = {\n id?: string;\n name?: string;\n action?: string;\n className?: string;\n inline?: boolean;\n method?: string;\n // Increases margin between form fields to make room for error messages.\n // This prevents the form from shifting when rendering a field error.\n // This may be desired when the form contains external links that will\n // shift while clicking if the form shifts from validation.\n hasIncreasedErrorMargin?: boolean;\n onBlurCapture?(e: FocusEvent): void;\n onSubmit?(e: FormEvent<EventTarget>): void;\n ariaLabel?: string;\n children: ReactNode;\n};\n\nconst Form = (props: FormProps) => {\n const { id, name, className, inline, children, ariaLabel, hasIncreasedErrorMargin, ...rest } =\n props;\n const classes = cx(\n 'Form',\n className,\n inline && 'Form--inline',\n !!hasIncreasedErrorMargin && 'Form--increasedErrorMargin'\n );\n\n return (\n <form id={id} name={name} aria-label={ariaLabel} {...rest} className={classes}>\n {children}\n </form>\n );\n};\n\nexport { Form };\nexport type { FormProps };\n","import type { ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormGroupProps = {\n name?: string | string[];\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n className?: string;\n onBlur?: () => void;\n testId?: string;\n children: ReactNode;\n};\n\nconst FormGroup = (props: FormGroupProps) => {\n const { className, name, ignoreValidation, isInvalid, children, testId, ...other } = props;\n\n const classes = cx('Form-group', className, !ignoreValidation && isInvalid && 'is-invalid');\n\n return (\n <div className={classes} data-test-id={testId} {...other}>\n {children}\n </div>\n );\n};\n\nexport { FormGroup };\nexport type { FormGroupProps };\n","import type { ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormHint.css';\n\ntype FormHintProps = {\n children: ReactNode;\n className?: string;\n id?: string;\n};\n\nconst FormHint = ({ className, children, ...rest }: FormHintProps) => {\n const classes = cx('Form-hint', className);\n\n return (\n <div {...rest} className={classes}>\n {children}\n </div>\n );\n};\n\nexport { FormHint };\nexport type { FormHintProps };\n","import { cx } from 'classix';\n\nimport { FieldError } from './FieldError';\nimport { FormGroup } from './FormGroup';\nimport { FormHint } from './FormHint';\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/FormField.css';\n\ntype FormFieldProps = {\n isRequired: boolean;\n label?: string;\n name: string;\n htmlFor: string;\n hint?: string;\n errorMessage?: string;\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n children: JSX.Element;\n className?: string;\n onBlur?: (field: string) => void;\n};\n\nconst FormField = ({\n isRequired,\n label,\n name,\n htmlFor,\n hint,\n errorMessage,\n ignoreValidation,\n isInvalid,\n children,\n className,\n onBlur,\n}: FormFieldProps) => {\n const handleBlur = () => {\n onBlur && onBlur(name);\n };\n\n return (\n <FormGroup\n className={cx('FormField', className)}\n name={name}\n ignoreValidation={ignoreValidation}\n isInvalid={isInvalid}\n onBlur={handleBlur}\n >\n {label && (\n <label htmlFor={htmlFor}>\n {label}\n {isRequired && <RequiredAsterisk />}\n </label>\n )}\n {hint && <FormHint className=\"FormField-hint\">{hint}</FormHint>}\n {children}\n <FieldError className=\"FormField-errorMessage\" name={name} errorMessage={errorMessage} />\n </FormGroup>\n );\n};\n\nexport type { FormFieldProps };\nexport { FormField };\n","import type { IconProps } from '@launchpad-ui/icons';\n\nimport { IconSize } from '@launchpad-ui/icons';\n\nimport './styles/IconField.css';\n\ntype IconFieldProps = {\n icon({ ...other }: IconProps): JSX.Element;\n children: JSX.Element | JSX.Element[];\n};\n\nconst IconField = ({ icon, children }: IconFieldProps) => {\n const Icon = icon;\n\n return (\n <div className=\"IconField\">\n {children}\n <Icon size={IconSize.SMALL} />\n </div>\n );\n};\n\nexport { IconField };\nexport type { IconFieldProps };\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/InputGroup.css';\n\ntype InputGroupProps = ComponentPropsWithRef<'div'>;\n\nconst InputGroup = ({ className, children, ...other }: InputGroupProps) => {\n const classes = cx('InputGroup', className);\n\n return (\n <div {...other} className={classes}>\n {children}\n </div>\n );\n};\n\nexport { InputGroup };\nexport type { InputGroupProps };\n","import type { ChangeEvent, CSSProperties, ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype RadioProps = {\n /**\n * Use an aria-label if you don't pass in children and don't have a visible label to associate with the input element.\n */\n 'aria-label'?: string;\n /**\n * id attribute of the label text elsewhere in the app, used for screen reader support. Use this for cases where you have a visible label on the page that **is not close to** to the input. https://tink.uk/the-difference-between-aria-label-and-aria-labelledby/\n */\n 'aria-labelledby'?: string;\n /**\n * Is the Radio checked?\n */\n checked?: boolean;\n /**\n * Label for the Checkbox\n */\n children?: ReactNode;\n /**\n * Custom classname(s) to add to the Radio.\n */\n className?: string;\n /**\n * Is the Radio disabled?\n */\n disabled?: boolean;\n /**\n * The id to pair the Radio input with the label for screen reader support.\n */\n id?: string;\n /**\n * The className to pass into the Radio's Label component\n */\n labelClassName?: string;\n /**\n * Name to apply to the underlying Radio. Pass in the same name value to each Radio when grouping in a RadioGroup for screen reader support.\n */\n name?: string;\n /**\n * The function to pass into the Radio onChange synthetic event handler.\n */\n onChange?(e: ChangeEvent): void;\n /**\n * Optional inline CSS styles to add to the Radio label.\n */\n labelStyle?: CSSProperties;\n /**\n * The value passed into Radio.\n */\n value: number | string;\n};\n\nconst Radio = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n checked = false,\n children,\n className,\n disabled = false,\n id,\n labelClassName,\n name,\n onChange = () => undefined,\n labelStyle,\n value,\n ...props\n}: RadioProps) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <>\n <input\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className={cx('Form-radio', className)}\n checked={checked}\n disabled={disabled}\n id={id}\n name={name}\n onChange={onChange}\n type=\"radio\"\n value={value}\n {...props}\n />\n <Label className={labelClassName} htmlFor={id} style={labelStyle}>\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n </>\n );\n};\n\nexport { Radio };\nexport type { RadioProps };\n","import type { ChangeEvent, FormEvent, ReactElement, ReactNode } from 'react';\n\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { Children, cloneElement, isValidElement, useRef } from 'react';\n\nimport { Label } from './Label';\nimport { Radio } from './Radio';\nimport './styles/Form.css';\n\ntype RadioGroupProps = {\n /**\n * The legend that describes this groups of radio buttons. The legend\n * is important for screen reader users.\n */\n legend?: string;\n /**\n * The children passed into the RadioGroup.\n */\n children?: ReactNode;\n /**\n * Custom classname(s) passed to the fieldset inner div.\n */\n className?: string;\n /**\n * Set the underlying Radio to disabled if the Radio's disabled prop is undefined.\n */\n disabled?: boolean;\n /**\n * The RadioGroup's id.\n */\n id?: string;\n /**\n * Name to apply to the underlying Radio. The same name value is passed to each Radio when grouping in a RadioGroup for screen reader support.\n */\n name: string;\n /**\n * This function is passed into each Radio onChange synthetic event handler.\n */\n onChange?(e: ChangeEvent | FormEvent<HTMLInputElement>): void;\n /**\n * The value to compare against the Radio's value to determine if the Radio will be checked.\n */\n value: string;\n};\n\nconst RadioGroup = (props: RadioGroupProps) => {\n const { name, value, onChange, children, disabled, legend, ...other } = props;\n const fieldsetRef = useRef<HTMLFieldSetElement>(null);\n\n function updateRadioElems(elem: ReactNode): ReactNode {\n if (!isValidElement(elem)) {\n return elem;\n }\n\n const item = elem as ReactElement;\n\n if (item?.type && item.type === Radio) {\n return cloneElement(item, {\n ...item.props,\n name,\n checked: item.props.value === value,\n onChange,\n disabled: typeof item.props?.disabled !== 'undefined' ? item.props.disabled : disabled,\n });\n }\n\n if (item?.type && item.type === Label) {\n return cloneElement(item, {\n ...item.props,\n onChange,\n disabled,\n });\n }\n\n const elemChildren = item?.props?.children;\n if (elemChildren) {\n if (Array.isArray(elemChildren)) {\n return cloneElement(item, {\n children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild)),\n });\n }\n return cloneElement(item, {\n children: updateRadioElems(elemChildren),\n });\n }\n\n if (item?.type && item.type !== Radio && item.type !== Label) {\n return item;\n }\n\n return null;\n }\n\n const radios = Children.map(children, (child) => updateRadioElems(child));\n return (\n <fieldset ref={fieldsetRef}>\n {legend && (\n <legend>\n <VisuallyHidden>{legend}</VisuallyHidden>\n </legend>\n )}\n <div {...other}>{radios}</div>\n </fieldset>\n );\n};\n\nexport { RadioGroup };\nexport type { RadioGroupProps };\n","import type { ChangeEvent, FocusEvent, ReactNode } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormInput.css';\n\ntype SelectProps = {\n children: ReactNode;\n className?: string;\n disabled?: boolean;\n id?: string;\n name?: string;\n onChange?(event: ChangeEvent<HTMLInputElement> | ChangeEvent<HTMLSelectElement>): void;\n onBlur?(event: FocusEvent<HTMLSelectElement, HTMLElement>): void;\n testId?: string;\n value?: number | string;\n placeholder?: string;\n 'aria-label'?: string;\n};\n\nconst Select = ({ className, children, testId, ...rest }: SelectProps) => {\n const classes = cx('FormInput', 'FormInput-select', className);\n\n return (\n <select {...rest} className={classes} data-test-id={testId}>\n {children}\n </select>\n );\n};\n\nexport { Select };\nexport type { SelectProps };\n","import type { KeyboardEvent, TextareaHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(({ className, ...props }, ref) => {\n const onKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (\n e.key === 'ArrowRight' ||\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft'\n ) {\n e.stopPropagation();\n }\n if (e.key === 'Escape') {\n e.nativeEvent.stopImmediatePropagation();\n }\n };\n\n return (\n <textarea\n {...props}\n className={cx('FormInput', className)}\n ref={ref}\n aria-describedby={props['aria-describedby'] || createFieldErrorId(props.id)}\n onKeyDown={onKeyDown}\n />\n );\n});\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\nexport type { TextAreaProps };\n"],"names":["RequiredAsterisk","className","testId","rest","classes","cx","Label","htmlFor","disabled","children","required","optional","other","_jsx","Checkbox","forwardRef","ariaLabel","ariaLabelledby","checked","labelClassName","ref","hasAriaLabel","undefined","console","warn","displayName","TextField","type","tiny","readOnly","tabIndex","suffix","overrideWidth","createFieldErrorId","id","width","CompactTextField","name","label","needsErrorFeedback","value","onFocus","onBlur","isActive","setIsActive","useState","toString","trim","length","isActiveState","placeholder","handleFocus","event","handleBlur","target","FieldError","errorMessage","FieldSet","Form","props","inline","hasIncreasedErrorMargin","FormGroup","ignoreValidation","isInvalid","FormHint","FormField","isRequired","hint","_jsxs","IconField","icon","Icon","IconSize","SMALL","InputGroup","Radio","onChange","labelStyle","_Fragment","RadioGroup","legend","fieldsetRef","useRef","elem","isValidElement","item","cloneElement","elemChildren","Array","isArray","Children","map","elemChild","updateRadioElems","radios","child","Select","TextArea","onKeyDown","e","key","stopPropagation","nativeEvent","stopImmediatePropagation"],"mappings":";;;;;;AAUA,MAAMA,mBAAmB,CAAC;AAAA,EAAEC;AAAAA,EAAWC;AAAAA,KAAWC;AAAAA,MAAkC;AAC5EC,QAAAA,UAAUC,GAAG,kBAAD;AAElB,6BACE,QAAA;AAAA,IAAM,WAAWD;AAAAA,IAAS,gBAAcF;AAAAA,IAAxC,GAAoDC;AAAAA,IAApD,UAAA;AAAA,EAAA,CADF;AAKD;;ACAD,MAAMG,QAAQ,CAAC;AAAA,EACbC;AAAAA,EACAC;AAAAA,EACAP;AAAAA,EACAQ;AAAAA,EACAC,WAAW;AAAA,EACXC,WAAW;AAAA,KACRC;AAAAA,MACa;AAChB,QAAMR,UAAUC,GAAG,cAAcJ,WAAWO,YAAY,sBAAtC;AAClB;OACaI;AAAAA,IAAO,WAAWR;AAAAA,IAAS;AAAA,IAAtC,UAAA,CACGK,UACAE,YAAY,CAACD,gCAAY,SAAA;AAAA,MAAO,WAAU;AAAA,MAAjB,UAAA;AAAA,IAA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AA;AAGH;OAEQ7C;AAAAA,IACJ,WAAWtD,GAAG,aAAaJ,SAAd;AAAA,IACb;AAAA,IACA,oBAAkB0D,MAAM,uBAAuB1B,mBAAmB0B,MAAMzB,EAAP;AAAA,IACjE;AAAA,EAAA,CANJ;AASD,CAxB0B;AA0B3BgE,SAASzE,cAAc;"}
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/RequiredAsterisk.tsx","../src/Label.tsx","../src/Checkbox.tsx","../src/utils/index.ts","../src/TextField.tsx","../src/CompactTextField.tsx","../src/FieldError.tsx","../src/FieldSet.tsx","../src/Form.tsx","../src/FormGroup.tsx","../src/FormHint.tsx","../src/FormField.tsx","../src/IconField.tsx","../src/Radio.tsx","../src/RadioGroup.tsx","../src/Select.tsx","../src/TextArea.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/RequiredAsterisk.css';\n\ntype RequiredAsteriskProps = HTMLAttributes<HTMLSpanElement>;\n\nconst RequiredAsterisk = ({ className, ...rest }: RequiredAsteriskProps) => {\n const classes = cx('RequiredAsterisk', className);\n\n return (\n <span {...rest} className={classes}>\n *\n </span>\n );\n};\n\nexport { RequiredAsterisk };\nexport type { RequiredAsteriskProps };\n","import type { LabelHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/Form.css';\n\ntype LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n required?: boolean;\n optional?: boolean;\n disabled?: boolean;\n};\n\nconst Label = ({\n disabled,\n className,\n children,\n required = false,\n optional = false,\n ...rest\n}: LabelProps) => {\n const classes = cx('Form-label', className, disabled && 'Form-label--disabled');\n\n return (\n <label {...rest} className={classes}>\n {children}\n {optional && !required && <small className=\"Form-labelOptional\">(optional)</small>}\n {required && !optional && <RequiredAsterisk />}\n </label>\n );\n};\n\nexport { Label };\nexport type { LabelProps };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { forwardRef } from 'react';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {\n /**\n * The className to pass into the Checkbox's Label component\n */\n labelClassName?: string;\n};\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n disabled,\n checked,\n labelClassName,\n ...rest\n },\n ref\n ) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <Label className={labelClassName}>\n <input\n {...rest}\n ref={ref}\n checked={checked}\n aria-checked={checked ? 'true' : 'false'}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className=\"Form-checkbox\"\n disabled={disabled}\n type=\"checkbox\"\n />{' '}\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport { Checkbox };\nexport type { CheckboxProps };\n","type FieldPath = string | string[];\n\nconst createFieldErrorId = (fieldIdentifier?: FieldPath) =>\n fieldIdentifier ? `${[...fieldIdentifier].join('')}-err` : undefined;\n\nexport { createFieldErrorId };\nexport type { FieldPath };\n","import type { InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextFieldProps = InputHTMLAttributes<HTMLInputElement> & {\n suffix?: string;\n tiny?: boolean;\n overrideWidth?: string;\n};\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n className,\n type = 'text',\n tiny = false,\n readOnly,\n tabIndex = 0,\n suffix,\n overrideWidth,\n ...rest\n },\n ref\n ) => {\n const classes = overrideWidth\n ? className\n : cx('FormInput', `FormInput-${type}`, className, tiny && 'FormInput--tiny');\n\n if (suffix) {\n return (\n <div className=\"FormInput-suffixContainer\">\n <input\n {...rest}\n type={type}\n className={cx(classes, 'FormInput-suffix')}\n readOnly={readOnly}\n ref={ref}\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n <label className=\"FormInput-suffix\" htmlFor={rest.id}>\n {suffix}\n </label>\n </div>\n );\n }\n\n return (\n <input\n {...rest}\n type={type}\n className={classes}\n readOnly={readOnly}\n tabIndex={tabIndex}\n ref={ref}\n style={\n overrideWidth\n ? {\n width: overrideWidth,\n }\n : undefined\n }\n aria-describedby={rest['aria-describedby'] || createFieldErrorId(rest.id)}\n />\n );\n }\n);\n\nTextField.displayName = 'TextField';\n\nexport { TextField };\nexport type { TextFieldProps };\n","import type { TextFieldProps } from './TextField';\nimport type { FocusEvent } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef, useState } from 'react';\n\nimport { Label } from './Label';\nimport { TextField } from './TextField';\nimport './styles/CompactTextField.css';\nimport './styles/FormInput.css';\n\ntype CompactTextFieldProps = TextFieldProps & {\n label: string;\n needsErrorFeedback?: boolean;\n};\n\nconst CompactTextField = forwardRef<HTMLInputElement, CompactTextFieldProps>(\n ({ className, id, label, needsErrorFeedback, value, onFocus, onBlur, ...rest }, ref) => {\n const [isActive, setIsActive] = useState(\n (typeof value === 'boolean' || value ? value.toString() : '').trim().length !== 0\n );\n\n const isActiveState = isActive || needsErrorFeedback;\n\n const classes = cx('CompactTextField', className, isActiveState && 'is-active');\n\n const placeholder = isActiveState ? '' : label;\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setIsActive(true);\n if (onFocus) {\n onFocus(event);\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n const value = event.target.value || '';\n setIsActive(value.trim().length !== 0);\n if (onBlur) {\n onBlur(event);\n }\n };\n\n return (\n <div className={classes}>\n <Label htmlFor={id}>{label}</Label>\n <TextField\n {...rest}\n id={id}\n placeholder={placeholder}\n value={value}\n ref={ref}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </div>\n );\n }\n);\n\nCompactTextField.displayName = 'CompactTextField';\n\nexport { CompactTextField };\nexport type { CompactTextFieldProps };\n","import type { FieldPath } from './utils';\nimport type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\nimport { createFieldErrorId } from './utils';\n\ntype FieldErrorProps = HTMLAttributes<HTMLSpanElement> & {\n name: FieldPath;\n errorMessage?: string;\n};\n\nconst FieldError = ({ name, errorMessage, className, ...rest }: FieldErrorProps) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n <span\n {...rest}\n className={cx('Form-fieldError', className)}\n aria-live=\"polite\"\n id={createFieldErrorId(name)}\n >\n {`Error - ${errorMessage}`}\n </span>\n );\n};\n\nexport { FieldError };\nexport type { FieldErrorProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FieldSet.css';\n\ntype FieldSetProps = HTMLAttributes<HTMLFieldSetElement>;\n\nconst FieldSet = ({ children, className, ...rest }: FieldSetProps) => {\n const classes = cx('FieldSet', className);\n\n return (\n <fieldset className={classes} {...rest}>\n {children}\n </fieldset>\n );\n};\n\nexport { FieldSet };\nexport type { FieldSetProps };\n","import type { FormHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormProps = FormHTMLAttributes<HTMLFormElement> & {\n inline?: boolean;\n // Increases margin between form fields to make room for error messages.\n // This prevents the form from shifting when rendering a field error.\n // This may be desired when the form contains external links that will\n // shift while clicking if the form shifts from validation.\n hasIncreasedErrorMargin?: boolean;\n};\n\nconst Form = (props: FormProps) => {\n const { className, inline, children, hasIncreasedErrorMargin, ...rest } = props;\n\n const classes = cx(\n 'Form',\n className,\n inline && 'Form--inline',\n !!hasIncreasedErrorMargin && 'Form--increasedErrorMargin'\n );\n\n return (\n <form {...rest} className={classes}>\n {children}\n </form>\n );\n};\n\nexport { Form };\nexport type { FormProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/Form.css';\n\ntype FormGroupProps = HTMLAttributes<HTMLDivElement> & {\n name?: string | string[];\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n};\n\nconst FormGroup = (props: FormGroupProps) => {\n const { className, name, ignoreValidation, isInvalid, children, ...rest } = props;\n\n const classes = cx('Form-group', className, !ignoreValidation && isInvalid && 'is-invalid');\n\n return (\n <div className={classes} {...rest}>\n {children}\n </div>\n );\n};\n\nexport { FormGroup };\nexport type { FormGroupProps };\n","import type { HTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormHint.css';\n\ntype FormHintProps = HTMLAttributes<HTMLDivElement>;\n\nconst FormHint = ({ className, children, ...rest }: FormHintProps) => {\n const classes = cx('Form-hint', className);\n\n return (\n <div {...rest} className={classes}>\n {children}\n </div>\n );\n};\n\nexport { FormHint };\nexport type { FormHintProps };\n","import { cx } from 'classix';\n\nimport { FieldError } from './FieldError';\nimport { FormGroup } from './FormGroup';\nimport { FormHint } from './FormHint';\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/FormField.css';\n\ntype FormFieldProps = {\n isRequired: boolean;\n label?: string;\n name: string;\n htmlFor: string;\n hint?: string;\n errorMessage?: string;\n ignoreValidation?: boolean;\n isInvalid?: boolean;\n children: JSX.Element;\n className?: string;\n onBlur?: (field: string) => void;\n 'data-test-id': string;\n};\n\nconst FormField = ({\n isRequired,\n label,\n name,\n htmlFor,\n hint,\n errorMessage,\n ignoreValidation,\n isInvalid,\n children,\n className,\n onBlur,\n 'data-test-id': testId,\n}: FormFieldProps) => {\n const handleBlur = () => {\n onBlur && onBlur(name);\n };\n\n return (\n <FormGroup\n className={cx('FormField', className)}\n name={name}\n ignoreValidation={ignoreValidation}\n isInvalid={isInvalid}\n onBlur={handleBlur}\n data-test-id={testId}\n >\n {label && (\n <label htmlFor={htmlFor}>\n {label}\n {isRequired && <RequiredAsterisk />}\n </label>\n )}\n {hint && <FormHint className=\"FormField-hint\">{hint}</FormHint>}\n {children}\n <FieldError className=\"FormField-errorMessage\" name={name} errorMessage={errorMessage} />\n </FormGroup>\n );\n};\n\nexport type { FormFieldProps };\nexport { FormField };\n","import type { IconProps } from '@launchpad-ui/icons';\nimport type { HTMLAttributes } from 'react';\n\nimport { IconSize } from '@launchpad-ui/icons';\nimport { cx } from 'classix';\n\nimport './styles/IconField.css';\n\ntype IconFieldProps = HTMLAttributes<HTMLDivElement> & {\n icon(args: IconProps): JSX.Element;\n children: JSX.Element | JSX.Element[];\n};\n\nconst IconField = ({ icon, children, className, ...rest }: IconFieldProps) => {\n const Icon = icon;\n\n const classes = cx('IconField', className);\n\n return (\n <div className={classes} {...rest}>\n {children}\n <Icon size={IconSize.SMALL} />\n </div>\n );\n};\n\nexport { IconField };\nexport type { IconFieldProps };\n","import type { CSSProperties, InputHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport { Label } from './Label';\nimport './styles/Form.css';\n\ntype RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n labelClassName?: string;\n labelStyle?: CSSProperties;\n};\n\nconst Radio = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n checked = false,\n children,\n className,\n disabled = false,\n id,\n labelClassName,\n labelStyle,\n ...rest\n}: RadioProps) => {\n const hasAriaLabel = ariaLabel !== undefined || ariaLabelledby !== undefined;\n\n if (!children && !hasAriaLabel) {\n console.warn(\n 'If you do not provide children, you must specify an aria-label for accessibility'\n );\n }\n\n return (\n <>\n <input\n {...rest}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n className={cx('Form-radio', className)}\n checked={checked}\n disabled={disabled}\n id={id}\n type=\"radio\"\n />\n <Label className={labelClassName} htmlFor={id} style={labelStyle}>\n {disabled ? <span className=\"Form-label--disabled\">{children}</span> : children}\n </Label>\n </>\n );\n};\n\nexport { Radio };\nexport type { RadioProps };\n","import type { ChangeEvent, FormEvent, ReactElement, ReactNode } from 'react';\n\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\nimport { Children, cloneElement, isValidElement, useRef } from 'react';\n\nimport { Label } from './Label';\nimport { Radio } from './Radio';\nimport './styles/Form.css';\n\ntype RadioGroupProps = {\n /**\n * The legend that describes this groups of radio buttons. The legend\n * is important for screen reader users.\n */\n legend?: string;\n /**\n * The children passed into the RadioGroup.\n */\n children?: ReactNode;\n /**\n * Custom classname(s) passed to the fieldset inner div.\n */\n className?: string;\n /**\n * Set the underlying Radio to disabled if the Radio's disabled prop is undefined.\n */\n disabled?: boolean;\n /**\n * The RadioGroup's id.\n */\n id?: string;\n /**\n * Name to apply to the underlying Radio. The same name value is passed to each Radio when grouping in a RadioGroup for screen reader support.\n */\n name: string;\n /**\n * This function is passed into each Radio onChange synthetic event handler.\n */\n onChange?(e: ChangeEvent | FormEvent<HTMLInputElement>): void;\n /**\n * The value to compare against the Radio's value to determine if the Radio will be checked.\n */\n value: string;\n};\n\nconst RadioGroup = (props: RadioGroupProps) => {\n const { name, value, onChange, children, disabled, legend, ...rest } = props;\n const fieldsetRef = useRef<HTMLFieldSetElement>(null);\n\n function updateRadioElems(elem: ReactNode): ReactNode {\n if (!isValidElement(elem)) {\n return elem;\n }\n\n const item = elem as ReactElement;\n\n if (item?.type && item.type === Radio) {\n return cloneElement(item, {\n ...item.props,\n name,\n checked: item.props.value === value,\n onChange,\n disabled: typeof item.props?.disabled !== 'undefined' ? item.props.disabled : disabled,\n });\n }\n\n if (item?.type && item.type === Label) {\n return cloneElement(item, {\n ...item.props,\n onChange,\n disabled,\n });\n }\n\n const elemChildren = item?.props?.children;\n if (elemChildren) {\n if (Array.isArray(elemChildren)) {\n return cloneElement(item, {\n children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild)),\n });\n }\n return cloneElement(item, {\n children: updateRadioElems(elemChildren),\n });\n }\n\n if (item?.type && item.type !== Radio && item.type !== Label) {\n return item;\n }\n\n return null;\n }\n\n const radios = Children.map(children, (child) => updateRadioElems(child));\n return (\n <fieldset ref={fieldsetRef}>\n {legend && (\n <legend>\n <VisuallyHidden>{legend}</VisuallyHidden>\n </legend>\n )}\n <div {...rest}>{radios}</div>\n </fieldset>\n );\n};\n\nexport { RadioGroup };\nexport type { RadioGroupProps };\n","import type { SelectHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\n\nimport './styles/FormInput.css';\n\ntype SelectProps = SelectHTMLAttributes<HTMLSelectElement>;\n\nconst Select = ({ className, children, ...rest }: SelectProps) => {\n const classes = cx('FormInput', 'FormInput-select', className);\n\n return (\n <select {...rest} className={classes}>\n {children}\n </select>\n );\n};\n\nexport { Select };\nexport type { SelectProps };\n","import type { KeyboardEvent, TextareaHTMLAttributes } from 'react';\n\nimport { cx } from 'classix';\nimport { forwardRef } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(({ className, ...props }, ref) => {\n const onKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (\n e.key === 'ArrowRight' ||\n e.key === 'ArrowDown' ||\n e.key === 'ArrowUp' ||\n e.key === 'ArrowLeft'\n ) {\n e.stopPropagation();\n }\n if (e.key === 'Escape') {\n e.nativeEvent.stopImmediatePropagation();\n }\n };\n\n return (\n <textarea\n {...props}\n className={cx('FormInput', className)}\n ref={ref}\n aria-describedby={props['aria-describedby'] || createFieldErrorId(props.id)}\n onKeyDown={onKeyDown}\n />\n );\n});\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\nexport type { TextAreaProps };\n"],"names":["RequiredAsterisk","className","rest","classes","cx","Label","disabled","children","required","optional","_jsx","Checkbox","forwardRef","ariaLabel","ariaLabelledby","checked","labelClassName","ref","hasAriaLabel","undefined","console","warn","displayName","TextField","type","tiny","readOnly","tabIndex","suffix","overrideWidth","createFieldErrorId","id","width","CompactTextField","label","needsErrorFeedback","value","onFocus","onBlur","isActive","setIsActive","useState","toString","trim","length","isActiveState","placeholder","handleFocus","event","handleBlur","target","FieldError","name","errorMessage","FieldSet","Form","props","inline","hasIncreasedErrorMargin","FormGroup","ignoreValidation","isInvalid","FormHint","FormField","isRequired","htmlFor","hint","testId","_jsxs","IconField","icon","Icon","IconSize","SMALL","Radio","labelStyle","_Fragment","RadioGroup","onChange","legend","fieldsetRef","useRef","updateRadioElems","elem","isValidElement","item","cloneElement","elemChildren","Array","isArray","Children","map","elemChild","radios","child","Select","TextArea","onKeyDown","e","key","stopPropagation","nativeEvent","stopImmediatePropagation"],"mappings":";;;;;;AAQA,MAAMA,mBAAmB,CAAC;AAAA,EAAEC;AAAAA,KAAcC;AAAhB,MAAkD;AACpEC,QAAAA,UAAUC,GAAG,oBAAoBH,SAArB;AAElB;OACYC;AAAAA,IAAM,WAAWC;AAAAA,IAA3B,UAAA;AAAA,EAAA,CADF;AAKD;;ACHD,MAAME,QAAQ,CAAC;AAAA,EACbC;AAAAA,EACAL;AAAAA,EACAM;AAAAA,EACAC,WAAW;AAAA,EACXC,WAAW;AAAA,KACRP;AANU,MAOG;AAChB,QAAMC,UAAUC,GAAG,cAAcH,WAAWK,YAAY,sBAAtC;AAElB;OACaJ;AAAAA,IAAM,WAAWC;AAAAA,IAA5B,UAAA,CACGI,UACAE,YAAY,CAACD,gCAAY,SAAA;AAAA,MAAO,WAAU;AAAA,MAAjB,UAAA;AAAA,IAAA,CAF5B,GAGGA,YAAY,CAACC,YAAaC,oBAAA,kBAH7B,CAAA,CAAA,CAAA;AAAA,EAAA,CADF;AAOD;AChBKC,MAAAA,WAAWC,WACf,CACE;AAAA,EACE,cAAcC;AAAAA,EACd,mBAAmBC;AAAAA,EACnBP;AAAAA,EACAD;AAAAA,EACAS;AAAAA,EACAC;AAAAA,KACGd;AAPL,GASAe,QACG;AACGC,QAAAA,eAAeL,cAAcM,UAAaL,mBAAmBK;AAC/D,MAAA,CAACZ,YAAY,CAACW,cAAc;AAC9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