@launchpad-ui/form 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -0
- package/dist/Checkbox.d.ts +36 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/CompactTextField.d.ts +22 -0
- package/dist/CompactTextField.d.ts.map +1 -0
- package/dist/FieldError.d.ts +12 -0
- package/dist/FieldError.d.ts.map +1 -0
- package/dist/FieldSet.d.ts +10 -0
- package/dist/FieldSet.d.ts.map +1 -0
- package/dist/Form.d.ts +19 -0
- package/dist/Form.d.ts.map +1 -0
- package/dist/FormField.d.ts +19 -0
- package/dist/FormField.d.ts.map +1 -0
- package/dist/FormGroup.d.ts +15 -0
- package/dist/FormGroup.d.ts.map +1 -0
- package/dist/FormHint.d.ts +11 -0
- package/dist/FormHint.d.ts.map +1 -0
- package/dist/IconField.d.ts +11 -0
- package/dist/IconField.d.ts.map +1 -0
- package/dist/InputGroup.d.ts +6 -0
- package/dist/InputGroup.d.ts.map +1 -0
- package/dist/Label.d.ts +14 -0
- package/dist/Label.d.ts.map +1 -0
- package/dist/Radio.d.ts +56 -0
- package/dist/Radio.d.ts.map +1 -0
- package/dist/RadioGroup.d.ts +41 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RequiredAsterisk.d.ts +8 -0
- package/dist/RequiredAsterisk.d.ts.map +1 -0
- package/dist/Select.d.ts +17 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/TextArea.d.ts +12 -0
- package/dist/TextArea.d.ts.map +1 -0
- package/dist/TextField.d.ts +21 -0
- package/dist/TextField.d.ts.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +511 -0
- package/dist/index.es.js.map +7 -0
- package/dist/index.js +556 -0
- package/dist/index.js.map +7 -0
- package/dist/styles/CompactTextField.css +2 -0
- package/dist/styles/CompactTextField.css.map +1 -0
- package/dist/styles/FieldSet.css +2 -0
- package/dist/styles/FieldSet.css.map +1 -0
- package/dist/styles/Form.css +2 -0
- package/dist/styles/Form.css.map +1 -0
- package/dist/styles/FormField.css +2 -0
- package/dist/styles/FormField.css.map +1 -0
- package/dist/styles/FormHint.css +2 -0
- package/dist/styles/FormHint.css.map +1 -0
- package/dist/styles/FormInput.css +2 -0
- package/dist/styles/FormInput.css.map +1 -0
- package/dist/styles/IconField.css +2 -0
- package/dist/styles/IconField.css.map +1 -0
- package/dist/styles/InputGroup.css +2 -0
- package/dist/styles/InputGroup.css.map +1 -0
- package/dist/styles/RequiredAsterisk.css +2 -0
- package/dist/styles/RequiredAsterisk.css.map +1 -0
- package/dist/styles/styles.css +2 -0
- package/dist/styles/styles.css.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +50 -0
package/dist/index.es.js
ADDED
@@ -0,0 +1,511 @@
|
|
1
|
+
// ../../scripts/react-shim.js
|
2
|
+
import * as React from "react";
|
3
|
+
|
4
|
+
// src/Checkbox.tsx
|
5
|
+
import { Component, createRef } from "react";
|
6
|
+
|
7
|
+
// src/Label.tsx
|
8
|
+
import cx2 from "clsx";
|
9
|
+
|
10
|
+
// src/RequiredAsterisk.tsx
|
11
|
+
import cx from "clsx";
|
12
|
+
import "./styles/RequiredAsterisk.css";
|
13
|
+
var RequiredAsterisk = ({ className, testId, ...rest }) => {
|
14
|
+
const classes = cx("RequiredAsterisk");
|
15
|
+
return /* @__PURE__ */ React.createElement("span", {
|
16
|
+
className: classes,
|
17
|
+
"data-test-id": testId,
|
18
|
+
...rest
|
19
|
+
}, "*");
|
20
|
+
};
|
21
|
+
|
22
|
+
// src/Label.tsx
|
23
|
+
import "./styles/Form.css";
|
24
|
+
var Label = ({
|
25
|
+
htmlFor,
|
26
|
+
disabled,
|
27
|
+
className,
|
28
|
+
children,
|
29
|
+
required = false,
|
30
|
+
optional = false,
|
31
|
+
...other
|
32
|
+
}) => {
|
33
|
+
const classes = cx2("Form-label", className, { "Form-label--disabled": disabled });
|
34
|
+
return /* @__PURE__ */ React.createElement("label", {
|
35
|
+
...other,
|
36
|
+
className: classes,
|
37
|
+
htmlFor
|
38
|
+
}, children, optional && !required && /* @__PURE__ */ React.createElement("small", {
|
39
|
+
className: "Form-labelOptional u-subtle"
|
40
|
+
}, "(optional)"), required && !optional && /* @__PURE__ */ React.createElement(RequiredAsterisk, null));
|
41
|
+
};
|
42
|
+
|
43
|
+
// src/Checkbox.tsx
|
44
|
+
import "./styles/Form.css";
|
45
|
+
var Checkbox = class extends Component {
|
46
|
+
constructor(props) {
|
47
|
+
super(props);
|
48
|
+
this.inputRef = createRef();
|
49
|
+
}
|
50
|
+
value() {
|
51
|
+
return this.inputRef.current?.value;
|
52
|
+
}
|
53
|
+
checked() {
|
54
|
+
return this.inputRef.current?.checked;
|
55
|
+
}
|
56
|
+
render() {
|
57
|
+
const {
|
58
|
+
"aria-label": ariaLabel,
|
59
|
+
"aria-labelledby": ariaLabelledby,
|
60
|
+
children,
|
61
|
+
disabled,
|
62
|
+
testId,
|
63
|
+
checked,
|
64
|
+
labelClassName,
|
65
|
+
...other
|
66
|
+
} = this.props;
|
67
|
+
const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
|
68
|
+
if (!children && !hasAriaLabel) {
|
69
|
+
console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
70
|
+
}
|
71
|
+
return /* @__PURE__ */ React.createElement(Label, {
|
72
|
+
className: labelClassName
|
73
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
74
|
+
...other,
|
75
|
+
ref: this.inputRef,
|
76
|
+
checked,
|
77
|
+
"aria-checked": checked ? "true" : "false",
|
78
|
+
"aria-label": ariaLabel,
|
79
|
+
"aria-labelledby": ariaLabelledby,
|
80
|
+
className: "Form-checkbox",
|
81
|
+
disabled,
|
82
|
+
"data-test-id": testId,
|
83
|
+
type: "checkbox"
|
84
|
+
}), " ", disabled ? /* @__PURE__ */ React.createElement("span", {
|
85
|
+
className: "Form-label--disabled"
|
86
|
+
}, children) : children);
|
87
|
+
}
|
88
|
+
};
|
89
|
+
|
90
|
+
// src/CompactTextField.tsx
|
91
|
+
import cx4 from "clsx";
|
92
|
+
import { isBoolean } from "lodash-es";
|
93
|
+
import { Component as Component3 } from "react";
|
94
|
+
|
95
|
+
// src/TextField.tsx
|
96
|
+
import cx3 from "clsx";
|
97
|
+
import { Component as Component2, createRef as createRef2 } from "react";
|
98
|
+
import "./styles/FormInput.css";
|
99
|
+
|
100
|
+
// src/utils/index.ts
|
101
|
+
var createFieldErrorId = (fieldIdentifier) => fieldIdentifier ? `${[...fieldIdentifier].join("")}-err` : void 0;
|
102
|
+
|
103
|
+
// src/TextField.tsx
|
104
|
+
var TextField = class extends Component2 {
|
105
|
+
constructor(props) {
|
106
|
+
super(props);
|
107
|
+
this.inputRef = createRef2();
|
108
|
+
}
|
109
|
+
render() {
|
110
|
+
const {
|
111
|
+
className,
|
112
|
+
type = "text",
|
113
|
+
tiny = false,
|
114
|
+
readOnly,
|
115
|
+
tabIndex = 0,
|
116
|
+
testId,
|
117
|
+
suffix,
|
118
|
+
overrideWidth,
|
119
|
+
...rest
|
120
|
+
} = this.props;
|
121
|
+
const classes = overrideWidth ? className : cx3("FormInput", `FormInput-${type}`, className, {
|
122
|
+
"FormInput--tiny": tiny
|
123
|
+
});
|
124
|
+
if (suffix) {
|
125
|
+
return /* @__PURE__ */ React.createElement("div", {
|
126
|
+
className: "FormInput-suffixContainer"
|
127
|
+
}, /* @__PURE__ */ React.createElement("input", {
|
128
|
+
...rest,
|
129
|
+
type,
|
130
|
+
className: cx3(classes, "FormInput-suffix"),
|
131
|
+
readOnly,
|
132
|
+
ref: this.inputRef,
|
133
|
+
"data-test-id": testId,
|
134
|
+
"aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)
|
135
|
+
}), /* @__PURE__ */ React.createElement("label", {
|
136
|
+
className: "FormInput-suffix",
|
137
|
+
htmlFor: rest.id
|
138
|
+
}, suffix));
|
139
|
+
}
|
140
|
+
return /* @__PURE__ */ React.createElement("input", {
|
141
|
+
...rest,
|
142
|
+
type,
|
143
|
+
className: classes,
|
144
|
+
readOnly,
|
145
|
+
tabIndex,
|
146
|
+
ref: this.inputRef,
|
147
|
+
"data-test-id": testId,
|
148
|
+
style: overrideWidth ? {
|
149
|
+
width: overrideWidth
|
150
|
+
} : void 0,
|
151
|
+
"aria-describedby": rest["aria-describedby"] || createFieldErrorId(rest.id)
|
152
|
+
});
|
153
|
+
}
|
154
|
+
getElement() {
|
155
|
+
return this.inputRef.current;
|
156
|
+
}
|
157
|
+
value() {
|
158
|
+
return this.inputRef.current?.value;
|
159
|
+
}
|
160
|
+
focus() {
|
161
|
+
this.inputRef.current?.focus();
|
162
|
+
}
|
163
|
+
blur() {
|
164
|
+
this.inputRef.current?.blur();
|
165
|
+
}
|
166
|
+
select() {
|
167
|
+
this.inputRef.current?.focus();
|
168
|
+
}
|
169
|
+
};
|
170
|
+
|
171
|
+
// src/CompactTextField.tsx
|
172
|
+
import "./styles/CompactTextField.css";
|
173
|
+
import "./styles/FormInput.css";
|
174
|
+
var CompactTextField = class extends Component3 {
|
175
|
+
constructor(props) {
|
176
|
+
super(props);
|
177
|
+
this.handleFocus = (event) => {
|
178
|
+
this.setState({ isActive: true });
|
179
|
+
if (this.props.onFocus) {
|
180
|
+
this.props.onFocus(event);
|
181
|
+
}
|
182
|
+
};
|
183
|
+
this.handleBlur = (event) => {
|
184
|
+
const value = event.target.value || "";
|
185
|
+
this.setState({ isActive: value.trim().length !== 0 });
|
186
|
+
if (this.props.onBlur) {
|
187
|
+
this.props.onBlur(event);
|
188
|
+
}
|
189
|
+
};
|
190
|
+
this.value = () => this.textField ? this.textField.value() : "";
|
191
|
+
this.focus = () => {
|
192
|
+
if (this.textField) {
|
193
|
+
this.textField.focus();
|
194
|
+
}
|
195
|
+
};
|
196
|
+
const value = props.value;
|
197
|
+
this.state = {
|
198
|
+
isActive: (isBoolean(value) || value ? value.toString() : "").trim().length !== 0
|
199
|
+
};
|
200
|
+
}
|
201
|
+
render() {
|
202
|
+
const { className, id, name, label, type, needsErrorFeedback, ...rest } = this.props;
|
203
|
+
const isActive = this.state.isActive || needsErrorFeedback;
|
204
|
+
const classes = cx4("CompactTextField", className, {
|
205
|
+
"is-active": isActive
|
206
|
+
});
|
207
|
+
const placeholder = isActive ? "" : label;
|
208
|
+
return /* @__PURE__ */ React.createElement("div", {
|
209
|
+
className: classes
|
210
|
+
}, /* @__PURE__ */ React.createElement(Label, {
|
211
|
+
htmlFor: id
|
212
|
+
}, label), /* @__PURE__ */ React.createElement(TextField, {
|
213
|
+
...rest,
|
214
|
+
id,
|
215
|
+
name,
|
216
|
+
type,
|
217
|
+
placeholder,
|
218
|
+
ref: (textField) => {
|
219
|
+
this.textField = textField;
|
220
|
+
},
|
221
|
+
onFocus: this.handleFocus,
|
222
|
+
onBlur: this.handleBlur
|
223
|
+
}));
|
224
|
+
}
|
225
|
+
};
|
226
|
+
|
227
|
+
// src/FieldError.tsx
|
228
|
+
import cx5 from "clsx";
|
229
|
+
import "./styles/Form.css";
|
230
|
+
var FieldError = ({ name, errorMessage, className }) => {
|
231
|
+
if (!errorMessage) {
|
232
|
+
return null;
|
233
|
+
}
|
234
|
+
return /* @__PURE__ */ React.createElement("span", {
|
235
|
+
className: cx5("Form-fieldError", className),
|
236
|
+
"aria-live": "polite",
|
237
|
+
id: createFieldErrorId(name)
|
238
|
+
}, `Error - ${errorMessage}`);
|
239
|
+
};
|
240
|
+
|
241
|
+
// src/FieldSet.tsx
|
242
|
+
import "./styles/FieldSet.css";
|
243
|
+
var FieldSet = ({ children, testId }) => {
|
244
|
+
return /* @__PURE__ */ React.createElement("fieldset", {
|
245
|
+
className: "FieldSet",
|
246
|
+
"data-test-id": testId
|
247
|
+
}, children);
|
248
|
+
};
|
249
|
+
|
250
|
+
// src/Form.tsx
|
251
|
+
import cx6 from "clsx";
|
252
|
+
import "./styles/Form.css";
|
253
|
+
var Form = (props) => {
|
254
|
+
const { id, name, className, inline, children, ariaLabel, hasIncreasedErrorMargin, ...rest } = props;
|
255
|
+
const classes = cx6("Form", className, {
|
256
|
+
"Form--inline": inline,
|
257
|
+
"Form--increasedErrorMargin": !!hasIncreasedErrorMargin
|
258
|
+
});
|
259
|
+
return /* @__PURE__ */ React.createElement("form", {
|
260
|
+
id,
|
261
|
+
name,
|
262
|
+
"aria-label": ariaLabel,
|
263
|
+
...rest,
|
264
|
+
className: classes
|
265
|
+
}, children);
|
266
|
+
};
|
267
|
+
|
268
|
+
// src/FormField.tsx
|
269
|
+
import cx9 from "clsx";
|
270
|
+
|
271
|
+
// src/FormGroup.tsx
|
272
|
+
import cx7 from "clsx";
|
273
|
+
import "./styles/Form.css";
|
274
|
+
var FormGroup = (props) => {
|
275
|
+
const { className, name, ignoreValidation, isInvalid, children, testId, ...other } = props;
|
276
|
+
const classes = cx7("Form-group", className, {
|
277
|
+
"is-invalid": !ignoreValidation && isInvalid
|
278
|
+
});
|
279
|
+
return /* @__PURE__ */ React.createElement("div", {
|
280
|
+
className: classes,
|
281
|
+
"data-test-id": testId,
|
282
|
+
...other
|
283
|
+
}, children);
|
284
|
+
};
|
285
|
+
|
286
|
+
// src/FormHint.tsx
|
287
|
+
import cx8 from "clsx";
|
288
|
+
import "./styles/FormHint.css";
|
289
|
+
var FormHint = ({ className, children, ...rest }) => {
|
290
|
+
const classes = cx8("Form-hint", className);
|
291
|
+
return /* @__PURE__ */ React.createElement("div", {
|
292
|
+
...rest,
|
293
|
+
className: classes
|
294
|
+
}, children);
|
295
|
+
};
|
296
|
+
|
297
|
+
// src/FormField.tsx
|
298
|
+
import "./styles/FormField.css";
|
299
|
+
var FormField = ({
|
300
|
+
isRequired,
|
301
|
+
label,
|
302
|
+
name,
|
303
|
+
htmlFor,
|
304
|
+
hint,
|
305
|
+
errorMessage,
|
306
|
+
ignoreValidation,
|
307
|
+
isInvalid,
|
308
|
+
children,
|
309
|
+
className,
|
310
|
+
onBlur
|
311
|
+
}) => {
|
312
|
+
const handleBlur = () => {
|
313
|
+
onBlur && onBlur(name);
|
314
|
+
};
|
315
|
+
return /* @__PURE__ */ React.createElement(FormGroup, {
|
316
|
+
className: cx9("FormField", className),
|
317
|
+
name,
|
318
|
+
ignoreValidation,
|
319
|
+
isInvalid,
|
320
|
+
onBlur: handleBlur
|
321
|
+
}, label && /* @__PURE__ */ React.createElement("label", {
|
322
|
+
htmlFor
|
323
|
+
}, label, isRequired && /* @__PURE__ */ React.createElement(RequiredAsterisk, null)), hint && /* @__PURE__ */ React.createElement(FormHint, {
|
324
|
+
className: "FormField-hint u-subtle"
|
325
|
+
}, hint), children, /* @__PURE__ */ React.createElement(FieldError, {
|
326
|
+
className: "FormField-errorMessage",
|
327
|
+
name,
|
328
|
+
errorMessage
|
329
|
+
}));
|
330
|
+
};
|
331
|
+
|
332
|
+
// src/IconField.tsx
|
333
|
+
import { IconSize } from "@launchpad-ui/icons";
|
334
|
+
import "./styles/IconField.css";
|
335
|
+
var IconField = ({ icon, children }) => {
|
336
|
+
const Icon = icon;
|
337
|
+
return /* @__PURE__ */ React.createElement("div", {
|
338
|
+
className: "IconField"
|
339
|
+
}, children, /* @__PURE__ */ React.createElement(Icon, {
|
340
|
+
size: IconSize.SMALL
|
341
|
+
}));
|
342
|
+
};
|
343
|
+
|
344
|
+
// src/InputGroup.tsx
|
345
|
+
import cx10 from "clsx";
|
346
|
+
import "./styles/InputGroup.css";
|
347
|
+
var InputGroup = ({ className, children, ...other }) => {
|
348
|
+
const classes = cx10("InputGroup", className);
|
349
|
+
return /* @__PURE__ */ React.createElement("div", {
|
350
|
+
...other,
|
351
|
+
className: classes
|
352
|
+
}, children);
|
353
|
+
};
|
354
|
+
|
355
|
+
// src/Radio.tsx
|
356
|
+
import cx11 from "clsx";
|
357
|
+
import "./styles/Form.css";
|
358
|
+
var Radio = ({
|
359
|
+
"aria-label": ariaLabel,
|
360
|
+
"aria-labelledby": ariaLabelledby,
|
361
|
+
checked = false,
|
362
|
+
children,
|
363
|
+
className,
|
364
|
+
disabled = false,
|
365
|
+
id,
|
366
|
+
labelClassName,
|
367
|
+
name,
|
368
|
+
onChange = () => void 0,
|
369
|
+
labelStyle,
|
370
|
+
value,
|
371
|
+
...props
|
372
|
+
}) => {
|
373
|
+
const hasAriaLabel = ariaLabel !== void 0 || ariaLabelledby !== void 0;
|
374
|
+
if (!children && !hasAriaLabel) {
|
375
|
+
console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
376
|
+
}
|
377
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("input", {
|
378
|
+
"aria-label": ariaLabel,
|
379
|
+
"aria-labelledby": ariaLabelledby,
|
380
|
+
className: cx11("Form-radio", className),
|
381
|
+
checked,
|
382
|
+
disabled,
|
383
|
+
id,
|
384
|
+
name,
|
385
|
+
onChange,
|
386
|
+
type: "radio",
|
387
|
+
value,
|
388
|
+
...props
|
389
|
+
}), /* @__PURE__ */ React.createElement(Label, {
|
390
|
+
className: labelClassName,
|
391
|
+
htmlFor: id,
|
392
|
+
style: labelStyle
|
393
|
+
}, disabled ? /* @__PURE__ */ React.createElement("span", {
|
394
|
+
className: "Form-label--disabled"
|
395
|
+
}, children) : children));
|
396
|
+
};
|
397
|
+
|
398
|
+
// src/RadioGroup.tsx
|
399
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
400
|
+
import { Children, cloneElement, isValidElement, useRef } from "react";
|
401
|
+
import "./styles/Form.css";
|
402
|
+
var RadioGroup = (props) => {
|
403
|
+
const { name, value, onChange, children, disabled, legend, ...other } = props;
|
404
|
+
const fieldsetRef = useRef(null);
|
405
|
+
function updateRadioElems(elem) {
|
406
|
+
if (!isValidElement(elem)) {
|
407
|
+
return elem;
|
408
|
+
}
|
409
|
+
if (elem?.type && elem.type === Radio) {
|
410
|
+
return cloneElement(elem, {
|
411
|
+
...elem.props,
|
412
|
+
name,
|
413
|
+
checked: elem.props.value === value,
|
414
|
+
onChange,
|
415
|
+
disabled: typeof elem.props?.disabled !== "undefined" ? elem.props.disabled : disabled
|
416
|
+
});
|
417
|
+
}
|
418
|
+
if (elem?.type && elem.type === Label) {
|
419
|
+
return cloneElement(elem, {
|
420
|
+
...elem.props,
|
421
|
+
onChange,
|
422
|
+
disabled
|
423
|
+
});
|
424
|
+
}
|
425
|
+
const elemChildren = elem?.props?.children;
|
426
|
+
if (elemChildren) {
|
427
|
+
if (Array.isArray(elemChildren)) {
|
428
|
+
return cloneElement(elem, {
|
429
|
+
children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild))
|
430
|
+
});
|
431
|
+
}
|
432
|
+
return cloneElement(elem, {
|
433
|
+
children: updateRadioElems(elemChildren)
|
434
|
+
});
|
435
|
+
}
|
436
|
+
if (elem?.type && elem.type !== Radio && elem.type !== Label) {
|
437
|
+
return elem;
|
438
|
+
}
|
439
|
+
return null;
|
440
|
+
}
|
441
|
+
const radios = Children.map(children, (child) => updateRadioElems(child));
|
442
|
+
return /* @__PURE__ */ React.createElement("fieldset", {
|
443
|
+
ref: fieldsetRef
|
444
|
+
}, legend && /* @__PURE__ */ React.createElement("legend", null, /* @__PURE__ */ React.createElement(VisuallyHidden, null, legend)), /* @__PURE__ */ React.createElement("div", {
|
445
|
+
...other
|
446
|
+
}, radios));
|
447
|
+
};
|
448
|
+
|
449
|
+
// src/Select.tsx
|
450
|
+
import cx12 from "clsx";
|
451
|
+
import "./styles/FormInput.css";
|
452
|
+
var Select = ({ className, children, testId, ...rest }) => {
|
453
|
+
const classes = cx12("FormInput", "FormInput-select", className);
|
454
|
+
return /* @__PURE__ */ React.createElement("select", {
|
455
|
+
...rest,
|
456
|
+
className: classes,
|
457
|
+
"data-test-id": testId
|
458
|
+
}, children);
|
459
|
+
};
|
460
|
+
|
461
|
+
// src/TextArea.tsx
|
462
|
+
import cx13 from "clsx";
|
463
|
+
import { Component as Component4, createRef as createRef3 } from "react";
|
464
|
+
import "./styles/FormInput.css";
|
465
|
+
var TextArea = class extends Component4 {
|
466
|
+
constructor(props) {
|
467
|
+
super(props);
|
468
|
+
this.textareaRef = createRef3();
|
469
|
+
}
|
470
|
+
render() {
|
471
|
+
const { className, ...props } = this.props;
|
472
|
+
return /* @__PURE__ */ React.createElement("textarea", {
|
473
|
+
...props,
|
474
|
+
className: cx13("FormInput", className),
|
475
|
+
ref: this.textareaRef,
|
476
|
+
"aria-describedby": props["aria-describedby"] || createFieldErrorId(props.id),
|
477
|
+
onKeyDown
|
478
|
+
});
|
479
|
+
}
|
480
|
+
focus() {
|
481
|
+
this.textareaRef.current?.focus();
|
482
|
+
}
|
483
|
+
};
|
484
|
+
function onKeyDown(e) {
|
485
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "ArrowLeft") {
|
486
|
+
e.stopPropagation();
|
487
|
+
}
|
488
|
+
if (e.key === "Escape") {
|
489
|
+
e.nativeEvent.stopImmediatePropagation();
|
490
|
+
}
|
491
|
+
}
|
492
|
+
export {
|
493
|
+
Checkbox,
|
494
|
+
CompactTextField,
|
495
|
+
FieldError,
|
496
|
+
FieldSet,
|
497
|
+
Form,
|
498
|
+
FormField,
|
499
|
+
FormGroup,
|
500
|
+
FormHint,
|
501
|
+
IconField,
|
502
|
+
InputGroup,
|
503
|
+
Label,
|
504
|
+
Radio,
|
505
|
+
RadioGroup,
|
506
|
+
RequiredAsterisk,
|
507
|
+
Select,
|
508
|
+
TextArea,
|
509
|
+
TextField
|
510
|
+
};
|
511
|
+
//# sourceMappingURL=index.es.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../scripts/react-shim.js", "../src/Checkbox.tsx", "../src/Label.tsx", "../src/RequiredAsterisk.tsx", "../src/CompactTextField.tsx", "../src/TextField.tsx", "../src/utils/index.ts", "../src/FieldError.tsx", "../src/FieldSet.tsx", "../src/Form.tsx", "../src/FormField.tsx", "../src/FormGroup.tsx", "../src/FormHint.tsx", "../src/IconField.tsx", "../src/InputGroup.tsx", "../src/Radio.tsx", "../src/RadioGroup.tsx", "../src/Select.tsx", "../src/TextArea.tsx"],
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component, createRef, InputHTMLAttributes, RefObject } 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?: React.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\nclass Checkbox extends Component<CheckboxProps> {\n inputRef: RefObject<HTMLInputElement>;\n\n constructor(props: CheckboxProps) {\n super(props);\n this.inputRef = createRef();\n }\n\n value() {\n return this.inputRef.current?.value;\n }\n\n checked() {\n return this.inputRef.current?.checked;\n }\n\n render() {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n children,\n disabled,\n testId,\n checked,\n labelClassName,\n ...other\n } = this.props;\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={this.inputRef}\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\nexport { Checkbox };\nexport type { CheckboxProps };\n", "import cx from 'clsx';\n\nimport { RequiredAsterisk } from './RequiredAsterisk';\nimport './styles/Form.css';\n\nexport type LabelProps = {\n htmlFor?: string;\n required?: boolean;\n optional?: boolean;\n disabled?: boolean;\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n hidden?: boolean;\n};\n\nexport const 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, { 'Form-label--disabled': disabled });\n return (\n <label {...other} className={classes} htmlFor={htmlFor}>\n {children}\n {optional && !required && <small className=\"Form-labelOptional u-subtle\">(optional)</small>}\n {required && !optional && <RequiredAsterisk />}\n </label>\n );\n};\n", "import type { HTMLAttributes } from 'react';\n\nimport cx from 'clsx';\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 };\n", "import cx from 'clsx';\nimport { isBoolean } from 'lodash-es';\nimport { Component, FocusEvent } from 'react';\n\nimport { Label } from './Label';\nimport { TextField, TextFieldProps } from './TextField';\nimport './styles/CompactTextField.css';\nimport './styles/FormInput.css';\n\ntype CompactTextFieldProps = TextFieldProps & {\n label: string;\n needsErrorFeedback?: boolean;\n};\n\nclass CompactTextField extends Component<CompactTextFieldProps, { isActive: boolean }> {\n textField?: TextField | null;\n\n constructor(props: CompactTextFieldProps) {\n super(props);\n const value = props.value;\n\n this.state = {\n isActive: (isBoolean(value) || value ? value.toString() : '').trim().length !== 0,\n };\n }\n\n render() {\n const { className, id, name, label, type, needsErrorFeedback, ...rest } = this.props;\n const isActive = this.state.isActive || needsErrorFeedback;\n\n const classes = cx('CompactTextField', className, {\n 'is-active': isActive,\n });\n\n const placeholder = isActive ? '' : label;\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 ref={(textField) => {\n this.textField = textField;\n }}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n </div>\n );\n }\n\n handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n this.setState({ isActive: true });\n if (this.props.onFocus) {\n this.props.onFocus(event);\n }\n };\n\n handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n const value = event.target.value || '';\n this.setState({ isActive: value.trim().length !== 0 });\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n };\n\n value = () => (this.textField ? this.textField.value() : '');\n\n focus = () => {\n if (this.textField) {\n this.textField.focus();\n }\n };\n}\n\nexport { CompactTextField };\nexport type { CompactTextFieldProps };\n", "import cx from 'clsx';\nimport { Component, createRef, InputHTMLAttributes, RefObject } 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\nclass TextField extends Component<TextFieldProps> {\n inputRef: RefObject<HTMLInputElement>;\n constructor(props: TextFieldProps) {\n super(props);\n this.inputRef = createRef();\n }\n\n render() {\n const {\n className,\n type = 'text',\n tiny = false,\n readOnly,\n tabIndex = 0,\n testId,\n suffix,\n overrideWidth,\n ...rest\n } = this.props;\n const classes = overrideWidth\n ? className\n : cx('FormInput', `FormInput-${type}`, className, {\n 'FormInput--tiny': 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={this.inputRef}\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={this.inputRef}\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 getElement() {\n return this.inputRef.current;\n }\n\n value() {\n return this.inputRef.current?.value;\n }\n\n focus() {\n this.inputRef.current?.focus();\n }\n\n blur() {\n this.inputRef.current?.blur();\n }\n\n select() {\n this.inputRef.current?.focus();\n }\n}\n\nexport type { TextFieldProps };\nexport { TextField };\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 { FieldPath } from './utils';\n\nimport cx from 'clsx';\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 'clsx';\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('Form', className, {\n 'Form--inline': inline,\n 'Form--increasedErrorMargin': !!hasIncreasedErrorMargin,\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 cx from 'clsx';\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 u-subtle\">{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 { ReactNode } from 'react';\n\nimport cx from 'clsx';\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, {\n 'is-invalid': !ignoreValidation && isInvalid,\n });\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 'clsx';\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 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 'clsx';\n\nimport './styles/InputGroup.css';\n\ntype InputGroupProps = ComponentPropsWithRef<'div'>;\n\nexport const 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", "import cx from 'clsx';\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?: React.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: React.ChangeEvent): void;\n /**\n * Optional inline CSS styles to add to the Radio label.\n */\n labelStyle?: object;\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 { 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?: React.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: React.ChangeEvent | React.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: React.ReactNode): React.ReactNode {\n if (!isValidElement(elem)) {\n return elem;\n }\n\n if (elem?.type && elem.type === Radio) {\n return cloneElement(elem, {\n ...elem.props,\n name,\n checked: elem.props.value === value,\n onChange,\n disabled: typeof elem.props?.disabled !== 'undefined' ? elem.props.disabled : disabled,\n });\n }\n\n if (elem?.type && elem.type === Label) {\n return cloneElement(elem, {\n ...elem.props,\n onChange,\n disabled,\n });\n }\n\n const elemChildren = elem?.props?.children;\n if (elemChildren) {\n if (Array.isArray(elemChildren)) {\n return cloneElement(elem, {\n children: Children.map(elemChildren, (elemChild) => updateRadioElems(elemChild)),\n });\n }\n return cloneElement(elem, {\n children: updateRadioElems(elemChildren),\n });\n }\n\n if (elem?.type && elem.type !== Radio && elem.type !== Label) {\n return elem;\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, ReactNode } from 'react';\n\nimport cx from 'clsx';\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 testId?: string;\n value?: number | 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 cx from 'clsx';\nimport { Component, createRef, RefObject, TextareaHTMLAttributes } from 'react';\n\nimport './styles/FormInput.css';\nimport { createFieldErrorId } from './utils';\n\ntype TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\nclass TextArea extends Component<TextAreaProps> {\n textareaRef: RefObject<HTMLTextAreaElement>;\n\n constructor(props: TextAreaProps) {\n super(props);\n this.textareaRef = createRef();\n }\n\n render() {\n const { className, ...props } = this.props;\n\n return (\n <textarea\n {...props}\n className={cx('FormInput', className)}\n ref={this.textareaRef}\n aria-describedby={props['aria-describedby'] || createFieldErrorId(props.id)}\n onKeyDown={onKeyDown}\n />\n );\n }\n\n focus() {\n this.textareaRef.current?.focus();\n }\n}\n\nfunction onKeyDown(e: React.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\nexport { TextArea };\nexport type { TextAreaProps };\n"],
|
5
|
+
"mappings": ";AAAA;;;ACAA;;;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