@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.js
CHANGED
@@ -9,32 +9,28 @@ const visuallyHidden = require("@react-aria/visually-hidden");
|
|
9
9
|
const RequiredAsterisk$1 = "";
|
10
10
|
const RequiredAsterisk = ({
|
11
11
|
className,
|
12
|
-
testId,
|
13
12
|
...rest
|
14
13
|
}) => {
|
15
|
-
const classes = classix.cx("RequiredAsterisk");
|
14
|
+
const classes = classix.cx("RequiredAsterisk", className);
|
16
15
|
return /* @__PURE__ */ jsxRuntime.jsx("span", {
|
17
|
-
className: classes,
|
18
|
-
"data-test-id": testId,
|
19
16
|
...rest,
|
17
|
+
className: classes,
|
20
18
|
children: "*"
|
21
19
|
});
|
22
20
|
};
|
23
21
|
const Form$1 = "";
|
24
22
|
const Label = ({
|
25
|
-
htmlFor,
|
26
23
|
disabled,
|
27
24
|
className,
|
28
25
|
children,
|
29
26
|
required = false,
|
30
27
|
optional = false,
|
31
|
-
...
|
28
|
+
...rest
|
32
29
|
}) => {
|
33
30
|
const classes = classix.cx("Form-label", className, disabled && "Form-label--disabled");
|
34
31
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", {
|
35
|
-
...
|
32
|
+
...rest,
|
36
33
|
className: classes,
|
37
|
-
htmlFor,
|
38
34
|
children: [children, optional && !required && /* @__PURE__ */ jsxRuntime.jsx("small", {
|
39
35
|
className: "Form-labelOptional",
|
40
36
|
children: "(optional)"
|
@@ -46,10 +42,9 @@ const Checkbox = react.forwardRef(({
|
|
46
42
|
"aria-labelledby": ariaLabelledby,
|
47
43
|
children,
|
48
44
|
disabled,
|
49
|
-
testId,
|
50
45
|
checked,
|
51
46
|
labelClassName,
|
52
|
-
...
|
47
|
+
...rest
|
53
48
|
}, ref) => {
|
54
49
|
const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
|
55
50
|
if (!children && !hasAriaLabel) {
|
@@ -58,7 +53,7 @@ const Checkbox = react.forwardRef(({
|
|
58
53
|
return /* @__PURE__ */ jsxRuntime.jsxs(Label, {
|
59
54
|
className: labelClassName,
|
60
55
|
children: [/* @__PURE__ */ jsxRuntime.jsx("input", {
|
61
|
-
...
|
56
|
+
...rest,
|
62
57
|
ref,
|
63
58
|
checked,
|
64
59
|
"aria-checked": checked ? "true" : "false",
|
@@ -66,7 +61,6 @@ const Checkbox = react.forwardRef(({
|
|
66
61
|
"aria-labelledby": ariaLabelledby,
|
67
62
|
className: "Form-checkbox",
|
68
63
|
disabled,
|
69
|
-
"data-test-id": testId,
|
70
64
|
type: "checkbox"
|
71
65
|
}), " ", disabled ? /* @__PURE__ */ jsxRuntime.jsx("span", {
|
72
66
|
className: "Form-label--disabled",
|
@@ -83,7 +77,6 @@ const TextField = react.forwardRef(({
|
|
83
77
|
tiny = false,
|
84
78
|
readOnly,
|
85
79
|
tabIndex = 0,
|
86
|
-
testId,
|
87
80
|
suffix,
|
88
81
|
overrideWidth,
|
89
82
|
...rest
|
@@ -98,7 +91,6 @@ const TextField = react.forwardRef(({
|
|
98
91
|
className: classix.cx(classes, "FormInput-suffix"),
|
99
92
|
readOnly,
|
100
93
|
ref,
|
101
|
-
"data-test-id": testId,
|
102
94
|
"aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)
|
103
95
|
}), /* @__PURE__ */ jsxRuntime.jsx("label", {
|
104
96
|
className: "FormInput-suffix",
|
@@ -114,7 +106,6 @@ const TextField = react.forwardRef(({
|
|
114
106
|
readOnly,
|
115
107
|
tabIndex,
|
116
108
|
ref,
|
117
|
-
"data-test-id": testId,
|
118
109
|
style: overrideWidth ? {
|
119
110
|
width: overrideWidth
|
120
111
|
} : void 0,
|
@@ -126,9 +117,7 @@ const CompactTextField$1 = "";
|
|
126
117
|
const CompactTextField = react.forwardRef(({
|
127
118
|
className,
|
128
119
|
id,
|
129
|
-
name,
|
130
120
|
label,
|
131
|
-
type,
|
132
121
|
needsErrorFeedback,
|
133
122
|
value,
|
134
123
|
onFocus,
|
@@ -160,8 +149,6 @@ const CompactTextField = react.forwardRef(({
|
|
160
149
|
}), /* @__PURE__ */ jsxRuntime.jsx(TextField, {
|
161
150
|
...rest,
|
162
151
|
id,
|
163
|
-
name,
|
164
|
-
type,
|
165
152
|
placeholder,
|
166
153
|
value,
|
167
154
|
ref,
|
@@ -174,12 +161,14 @@ CompactTextField.displayName = "CompactTextField";
|
|
174
161
|
const FieldError = ({
|
175
162
|
name,
|
176
163
|
errorMessage,
|
177
|
-
className
|
164
|
+
className,
|
165
|
+
...rest
|
178
166
|
}) => {
|
179
167
|
if (!errorMessage) {
|
180
168
|
return null;
|
181
169
|
}
|
182
170
|
return /* @__PURE__ */ jsxRuntime.jsx("span", {
|
171
|
+
...rest,
|
183
172
|
className: classix.cx("Form-fieldError", className),
|
184
173
|
"aria-live": "polite",
|
185
174
|
id: createFieldErrorId(name),
|
@@ -189,30 +178,26 @@ const FieldError = ({
|
|
189
178
|
const FieldSet$1 = "";
|
190
179
|
const FieldSet = ({
|
191
180
|
children,
|
192
|
-
|
181
|
+
className,
|
182
|
+
...rest
|
193
183
|
}) => {
|
184
|
+
const classes = classix.cx("FieldSet", className);
|
194
185
|
return /* @__PURE__ */ jsxRuntime.jsx("fieldset", {
|
195
|
-
className:
|
196
|
-
|
186
|
+
className: classes,
|
187
|
+
...rest,
|
197
188
|
children
|
198
189
|
});
|
199
190
|
};
|
200
191
|
const Form = (props) => {
|
201
192
|
const {
|
202
|
-
id,
|
203
|
-
name,
|
204
193
|
className,
|
205
194
|
inline,
|
206
195
|
children,
|
207
|
-
ariaLabel,
|
208
196
|
hasIncreasedErrorMargin,
|
209
197
|
...rest
|
210
198
|
} = props;
|
211
199
|
const classes = classix.cx("Form", className, inline && "Form--inline", !!hasIncreasedErrorMargin && "Form--increasedErrorMargin");
|
212
200
|
return /* @__PURE__ */ jsxRuntime.jsx("form", {
|
213
|
-
id,
|
214
|
-
name,
|
215
|
-
"aria-label": ariaLabel,
|
216
201
|
...rest,
|
217
202
|
className: classes,
|
218
203
|
children
|
@@ -225,14 +210,12 @@ const FormGroup = (props) => {
|
|
225
210
|
ignoreValidation,
|
226
211
|
isInvalid,
|
227
212
|
children,
|
228
|
-
|
229
|
-
...other
|
213
|
+
...rest
|
230
214
|
} = props;
|
231
215
|
const classes = classix.cx("Form-group", className, !ignoreValidation && isInvalid && "is-invalid");
|
232
216
|
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
233
217
|
className: classes,
|
234
|
-
|
235
|
-
...other,
|
218
|
+
...rest,
|
236
219
|
children
|
237
220
|
});
|
238
221
|
};
|
@@ -261,7 +244,8 @@ const FormField = ({
|
|
261
244
|
isInvalid,
|
262
245
|
children,
|
263
246
|
className,
|
264
|
-
onBlur
|
247
|
+
onBlur,
|
248
|
+
"data-test-id": testId
|
265
249
|
}) => {
|
266
250
|
const handleBlur = () => {
|
267
251
|
onBlur && onBlur(name);
|
@@ -272,6 +256,7 @@ const FormField = ({
|
|
272
256
|
ignoreValidation,
|
273
257
|
isInvalid,
|
274
258
|
onBlur: handleBlur,
|
259
|
+
"data-test-id": testId,
|
275
260
|
children: [label && /* @__PURE__ */ jsxRuntime.jsxs("label", {
|
276
261
|
htmlFor,
|
277
262
|
children: [label, isRequired && /* @__PURE__ */ jsxRuntime.jsx(RequiredAsterisk, {})]
|
@@ -288,29 +273,20 @@ const FormField = ({
|
|
288
273
|
const IconField$1 = "";
|
289
274
|
const IconField = ({
|
290
275
|
icon,
|
291
|
-
children
|
276
|
+
children,
|
277
|
+
className,
|
278
|
+
...rest
|
292
279
|
}) => {
|
293
280
|
const Icon = icon;
|
281
|
+
const classes = classix.cx("IconField", className);
|
294
282
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
295
|
-
className:
|
283
|
+
className: classes,
|
284
|
+
...rest,
|
296
285
|
children: [children, /* @__PURE__ */ jsxRuntime.jsx(Icon, {
|
297
286
|
size: icons.IconSize.SMALL
|
298
287
|
})]
|
299
288
|
});
|
300
289
|
};
|
301
|
-
const InputGroup$1 = "";
|
302
|
-
const InputGroup = ({
|
303
|
-
className,
|
304
|
-
children,
|
305
|
-
...other
|
306
|
-
}) => {
|
307
|
-
const classes = classix.cx("InputGroup", className);
|
308
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
309
|
-
...other,
|
310
|
-
className: classes,
|
311
|
-
children
|
312
|
-
});
|
313
|
-
};
|
314
290
|
const Radio = ({
|
315
291
|
"aria-label": ariaLabel,
|
316
292
|
"aria-labelledby": ariaLabelledby,
|
@@ -320,11 +296,8 @@ const Radio = ({
|
|
320
296
|
disabled = false,
|
321
297
|
id,
|
322
298
|
labelClassName,
|
323
|
-
name,
|
324
|
-
onChange = () => void 0,
|
325
299
|
labelStyle,
|
326
|
-
|
327
|
-
...props
|
300
|
+
...rest
|
328
301
|
}) => {
|
329
302
|
const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
|
330
303
|
if (!children && !hasAriaLabel) {
|
@@ -332,17 +305,14 @@ const Radio = ({
|
|
332
305
|
}
|
333
306
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
334
307
|
children: [/* @__PURE__ */ jsxRuntime.jsx("input", {
|
308
|
+
...rest,
|
335
309
|
"aria-label": ariaLabel,
|
336
310
|
"aria-labelledby": ariaLabelledby,
|
337
311
|
className: classix.cx("Form-radio", className),
|
338
312
|
checked,
|
339
313
|
disabled,
|
340
314
|
id,
|
341
|
-
|
342
|
-
onChange,
|
343
|
-
type: "radio",
|
344
|
-
value,
|
345
|
-
...props
|
315
|
+
type: "radio"
|
346
316
|
}), /* @__PURE__ */ jsxRuntime.jsx(Label, {
|
347
317
|
className: labelClassName,
|
348
318
|
htmlFor: id,
|
@@ -362,7 +332,7 @@ const RadioGroup = (props) => {
|
|
362
332
|
children,
|
363
333
|
disabled,
|
364
334
|
legend,
|
365
|
-
...
|
335
|
+
...rest
|
366
336
|
} = props;
|
367
337
|
const fieldsetRef = react.useRef(null);
|
368
338
|
function updateRadioElems(elem) {
|
@@ -411,7 +381,7 @@ const RadioGroup = (props) => {
|
|
411
381
|
children: legend
|
412
382
|
})
|
413
383
|
}), /* @__PURE__ */ jsxRuntime.jsx("div", {
|
414
|
-
...
|
384
|
+
...rest,
|
415
385
|
children: radios
|
416
386
|
})]
|
417
387
|
});
|
@@ -419,14 +389,12 @@ const RadioGroup = (props) => {
|
|
419
389
|
const Select = ({
|
420
390
|
className,
|
421
391
|
children,
|
422
|
-
testId,
|
423
392
|
...rest
|
424
393
|
}) => {
|
425
394
|
const classes = classix.cx("FormInput", "FormInput-select", className);
|
426
395
|
return /* @__PURE__ */ jsxRuntime.jsx("select", {
|
427
396
|
...rest,
|
428
397
|
className: classes,
|
429
|
-
"data-test-id": testId,
|
430
398
|
children
|
431
399
|
});
|
432
400
|
};
|
@@ -460,7 +428,6 @@ exports.FormField = FormField;
|
|
460
428
|
exports.FormGroup = FormGroup;
|
461
429
|
exports.FormHint = FormHint;
|
462
430
|
exports.IconField = IconField;
|
463
|
-
exports.InputGroup = InputGroup;
|
464
431
|
exports.Label = Label;
|
465
432
|
exports.Radio = Radio;
|
466
433
|
exports.RadioGroup = RadioGroup;
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.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","VisuallyHidden","Select","TextArea","onKeyDown","e","key","stopPropagation","nativeEvent","stopImmediatePropagation"],"mappings":";;;;;;;;AAUA,MAAMA,mBAAmB,CAAC;AAAA,EAAEC;AAAAA,EAAWC;AAAAA,KAAWC;AAAAA,MAAkC;AAC5EC,QAAAA,UAAUC,WAAG,kBAAD;AAElB,wCACE,QAAA;AAAA,IAAM,WAAWD;AAAAA,IAAS,gBAAcF;AAAAA,IAAxC,GAAoDC;AAAAA,IAApD,UAAA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iBmF;AAAAA,IAAAA,CANnB,CAAA;AAAA,EAAA,CADF;AAUD;ACpFD,MAAMG,SAAS,CAAC;AAAA,EAAEjG;AAAAA,EAAWQ;AAAAA,EAAUP;AAAAA,KAAWC;AAAAA,MAAwB;AACxE,QAAMC,UAAUC,QAAAA,GAAG,aAAa,oBAAoBJ,SAAlC;AAElB;OACcE;AAAAA,IAAM,WAAWC;AAAAA,IAAS,gBAAcF;AAAAA,IAApD;AAAA,EAAA,CADF;AAKD;AClBKiG,MAAAA,WAAWpF,iBAA+C,CAAC;AAAA,EAAEd;AAAAA,KAAc0D;AAAAA,GAASvC,QAAQ;AAC1FgF,QAAAA,YAAY,CAACC,MAA0C;AAEzDA,QAAAA,EAAEC,QAAQ,gBACVD,EAAEC,QAAQ,eACVD,EAAEC,QAAQ,aACVD,EAAEC,QAAQ,aACV;AACAD,QAAEE,gBAAF;AAAA,IACD;AACGF,QAAAA,EAAEC,QAAQ,UAAU;AACtBD,QAAEG,YAAYC;IACf;AAAA,EAAA;AAGH;OAEQ9C;AAAAA,IACJ,WAAWtD,QAAAA,GAAG,aAAaJ,SAAd;AAAA,IACb;AAAA,IACA,oBAAkB0D,MAAM,uBAAuB1B,mBAAmB0B,MAAMzB,EAAP;AAAA,IACjE;AAAA,EAAA,CANJ;AASD,CAxB0B;AA0B3BiE,SAAS1E,cAAc;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"index.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","VisuallyHidden","Select","TextArea","onKeyDown","e","key","stopPropagation","nativeEvent","stopImmediatePropagation"],"mappings":";;;;;;;;AAQA,MAAMA,mBAAmB,CAAC;AAAA,EAAEC;AAAAA,KAAcC;AAAhB,MAAkD;AACpEC,QAAAA,UAAUC,QAAAA,GAAG,oBAAoBH,SAArB;AAElB;OACYC;AAAAA,IAAM,WAAWC;AAAAA,IAA3B,UAAA;AAAA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AA,EAAEC,QAAQ,gBACVD,EAAEC,QAAQ,eACVD,EAAEC,QAAQ,aACVD,EAAEC,QAAQ,aACV;AACAD,QAAEE,gBAAF;AAAA,IACD;AACGF,QAAAA,EAAEC,QAAQ,UAAU;AACtBD,QAAEG,YAAYC;IACf;AAAA,EAAA;AAGH;OAEQ/C;AAAAA,IACJ,WAAWpD,QAAAA,GAAG,aAAaH,SAAd;AAAA,IACb;AAAA,IACA,oBAAkBuD,MAAM,uBAAuB1B,mBAAmB0B,MAAMzB,EAAP;AAAA,IACjE;AAAA,EAAA,CANJ;AASD,CAxB0B;AA0B3BkE,SAAS3E,cAAc;;;;;;;;;;;;;;;;;"}
|
package/dist/style.css
CHANGED
package/package.json
CHANGED
package/dist/InputGroup.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
import type { ComponentPropsWithRef } from 'react';
|
2
|
-
import './styles/InputGroup.css';
|
3
|
-
declare type InputGroupProps = ComponentPropsWithRef<'div'>;
|
4
|
-
declare const InputGroup: ({ className, children, ...other }: InputGroupProps) => JSX.Element;
|
5
|
-
export { InputGroup };
|
6
|
-
export type { InputGroupProps };
|
7
|
-
//# sourceMappingURL=InputGroup.d.ts.map
|
package/dist/InputGroup.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../src/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,yBAAyB,CAAC;AAEjC,aAAK,eAAe,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEpD,QAAA,MAAM,UAAU,sCAAuC,eAAe,gBAQrE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|