@abgov/react-components 5.3.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -0
- package/index.js +58 -1
- package/index.js.map +1 -1
- package/index.mjs +58 -1
- package/index.mjs.map +1 -1
- package/lib/accordion/accordion.d.ts +4 -2
- package/lib/button/button.d.ts +3 -1
- package/lib/filter-chip/filter-chip.d.ts +24 -0
- package/lib/input/input.d.ts +1 -1
- package/lib/textarea/textarea.d.ts +3 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -10,15 +10,31 @@ function GoAAccordion({
|
|
|
10
10
|
iconPosition,
|
|
11
11
|
maxWidth,
|
|
12
12
|
testid,
|
|
13
|
+
onChange,
|
|
13
14
|
children,
|
|
14
15
|
mt,
|
|
15
16
|
mr,
|
|
16
17
|
mb,
|
|
17
18
|
ml
|
|
18
19
|
}) {
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const element = ref.current;
|
|
23
|
+
if (element && onChange) {
|
|
24
|
+
const handler = (event) => {
|
|
25
|
+
const customEvent = event;
|
|
26
|
+
onChange(customEvent.detail.open);
|
|
27
|
+
};
|
|
28
|
+
element.addEventListener("_change", handler);
|
|
29
|
+
return () => {
|
|
30
|
+
element.removeEventListener("_change", handler);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}, [onChange]);
|
|
19
34
|
return /* @__PURE__ */ jsxs(
|
|
20
35
|
"goa-accordion",
|
|
21
36
|
{
|
|
37
|
+
ref,
|
|
22
38
|
open,
|
|
23
39
|
headingSize,
|
|
24
40
|
heading,
|
|
@@ -237,6 +253,7 @@ function GoAButton({
|
|
|
237
253
|
variant,
|
|
238
254
|
leadingIcon,
|
|
239
255
|
trailingIcon,
|
|
256
|
+
width,
|
|
240
257
|
testId,
|
|
241
258
|
children,
|
|
242
259
|
onClick,
|
|
@@ -272,6 +289,7 @@ function GoAButton({
|
|
|
272
289
|
disabled,
|
|
273
290
|
leadingicon: leadingIcon,
|
|
274
291
|
trailingicon: trailingIcon,
|
|
292
|
+
width,
|
|
275
293
|
testid: testId,
|
|
276
294
|
mt,
|
|
277
295
|
mr,
|
|
@@ -675,7 +693,7 @@ function GoADropdownOption(props) {
|
|
|
675
693
|
}, []);
|
|
676
694
|
return /* @__PURE__ */ jsx(GoADropdownItem, { ...props });
|
|
677
695
|
}
|
|
678
|
-
function GoADropdownItem({ value, label, filter, name, testId, mountType = "
|
|
696
|
+
function GoADropdownItem({ value, label, filter, name, testId, mountType = "reset" }) {
|
|
679
697
|
return /* @__PURE__ */ jsx(
|
|
680
698
|
"goa-dropdown-item",
|
|
681
699
|
{
|
|
@@ -3407,6 +3425,7 @@ function GoATextarea({
|
|
|
3407
3425
|
value,
|
|
3408
3426
|
placeholder,
|
|
3409
3427
|
rows,
|
|
3428
|
+
readOnly,
|
|
3410
3429
|
disabled,
|
|
3411
3430
|
countBy,
|
|
3412
3431
|
maxCount,
|
|
@@ -3459,6 +3478,7 @@ function GoATextarea({
|
|
|
3459
3478
|
placeholder,
|
|
3460
3479
|
value,
|
|
3461
3480
|
rows,
|
|
3481
|
+
readOnly,
|
|
3462
3482
|
disabled,
|
|
3463
3483
|
countby: countBy,
|
|
3464
3484
|
maxcount: maxCount,
|
|
@@ -3523,6 +3543,42 @@ function GoATwoColumnLayout(props) {
|
|
|
3523
3543
|
}
|
|
3524
3544
|
);
|
|
3525
3545
|
}
|
|
3546
|
+
const GoAFilterChip = ({
|
|
3547
|
+
iconTheme = "outline",
|
|
3548
|
+
error = false,
|
|
3549
|
+
content,
|
|
3550
|
+
onClick,
|
|
3551
|
+
mt,
|
|
3552
|
+
mr,
|
|
3553
|
+
mb,
|
|
3554
|
+
ml,
|
|
3555
|
+
testId
|
|
3556
|
+
}) => {
|
|
3557
|
+
const el = useRef(null);
|
|
3558
|
+
useEffect(() => {
|
|
3559
|
+
if (!el.current) return;
|
|
3560
|
+
if (!onClick) return;
|
|
3561
|
+
const current = el.current;
|
|
3562
|
+
current.addEventListener("_click", onClick);
|
|
3563
|
+
return () => {
|
|
3564
|
+
current.removeEventListener("_click", onClick);
|
|
3565
|
+
};
|
|
3566
|
+
}, [el, onClick]);
|
|
3567
|
+
return /* @__PURE__ */ jsx(
|
|
3568
|
+
"goa-filter-chip",
|
|
3569
|
+
{
|
|
3570
|
+
ref: el,
|
|
3571
|
+
icontheme: iconTheme,
|
|
3572
|
+
error,
|
|
3573
|
+
content,
|
|
3574
|
+
mt,
|
|
3575
|
+
mr,
|
|
3576
|
+
mb,
|
|
3577
|
+
ml,
|
|
3578
|
+
"data-testid": testId
|
|
3579
|
+
}
|
|
3580
|
+
);
|
|
3581
|
+
};
|
|
3526
3582
|
export {
|
|
3527
3583
|
GoAAccordion,
|
|
3528
3584
|
GoAAppFooter,
|
|
@@ -3550,6 +3606,7 @@ export {
|
|
|
3550
3606
|
GoAFieldset,
|
|
3551
3607
|
GoAFileUploadCard,
|
|
3552
3608
|
GoAFileUploadInput,
|
|
3609
|
+
GoAFilterChip,
|
|
3553
3610
|
GoAFormItem,
|
|
3554
3611
|
GoAFormStep,
|
|
3555
3612
|
GoAFormStepper,
|