@abgov/react-components 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/textarea/textarea.d.ts +3 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -57,4 +57,5 @@ export * from "./lib/textarea/textarea";
|
|
|
57
57
|
export * from "./lib/three-column-layout/three-column-layout";
|
|
58
58
|
export * from "./lib/tooltip/tooltip";
|
|
59
59
|
export * from "./lib/two-column-layout/two-column-layout";
|
|
60
|
+
export * from "./lib/filter-chip/filter-chip";
|
|
60
61
|
export * from "./common/styling";
|
package/index.js
CHANGED
|
@@ -12,15 +12,31 @@ function GoAAccordion({
|
|
|
12
12
|
iconPosition,
|
|
13
13
|
maxWidth,
|
|
14
14
|
testid,
|
|
15
|
+
onChange,
|
|
15
16
|
children,
|
|
16
17
|
mt,
|
|
17
18
|
mr,
|
|
18
19
|
mb,
|
|
19
20
|
ml
|
|
20
21
|
}) {
|
|
22
|
+
const ref = react.useRef(null);
|
|
23
|
+
react.useEffect(() => {
|
|
24
|
+
const element = ref.current;
|
|
25
|
+
if (element && onChange) {
|
|
26
|
+
const handler = (event) => {
|
|
27
|
+
const customEvent = event;
|
|
28
|
+
onChange(customEvent.detail.open);
|
|
29
|
+
};
|
|
30
|
+
element.addEventListener("_change", handler);
|
|
31
|
+
return () => {
|
|
32
|
+
element.removeEventListener("_change", handler);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}, [onChange]);
|
|
21
36
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22
37
|
"goa-accordion",
|
|
23
38
|
{
|
|
39
|
+
ref,
|
|
24
40
|
open,
|
|
25
41
|
headingSize,
|
|
26
42
|
heading,
|
|
@@ -239,6 +255,7 @@ function GoAButton({
|
|
|
239
255
|
variant,
|
|
240
256
|
leadingIcon,
|
|
241
257
|
trailingIcon,
|
|
258
|
+
width,
|
|
242
259
|
testId,
|
|
243
260
|
children,
|
|
244
261
|
onClick,
|
|
@@ -274,6 +291,7 @@ function GoAButton({
|
|
|
274
291
|
disabled,
|
|
275
292
|
leadingicon: leadingIcon,
|
|
276
293
|
trailingicon: trailingIcon,
|
|
294
|
+
width,
|
|
277
295
|
testid: testId,
|
|
278
296
|
mt,
|
|
279
297
|
mr,
|
|
@@ -677,7 +695,7 @@ function GoADropdownOption(props) {
|
|
|
677
695
|
}, []);
|
|
678
696
|
return /* @__PURE__ */ jsxRuntime.jsx(GoADropdownItem, { ...props });
|
|
679
697
|
}
|
|
680
|
-
function GoADropdownItem({ value, label, filter, name, testId, mountType = "
|
|
698
|
+
function GoADropdownItem({ value, label, filter, name, testId, mountType = "reset" }) {
|
|
681
699
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
682
700
|
"goa-dropdown-item",
|
|
683
701
|
{
|
|
@@ -3409,6 +3427,7 @@ function GoATextarea({
|
|
|
3409
3427
|
value,
|
|
3410
3428
|
placeholder,
|
|
3411
3429
|
rows,
|
|
3430
|
+
readOnly,
|
|
3412
3431
|
disabled,
|
|
3413
3432
|
countBy,
|
|
3414
3433
|
maxCount,
|
|
@@ -3461,6 +3480,7 @@ function GoATextarea({
|
|
|
3461
3480
|
placeholder,
|
|
3462
3481
|
value,
|
|
3463
3482
|
rows,
|
|
3483
|
+
readOnly,
|
|
3464
3484
|
disabled,
|
|
3465
3485
|
countby: countBy,
|
|
3466
3486
|
maxcount: maxCount,
|
|
@@ -3525,6 +3545,42 @@ function GoATwoColumnLayout(props) {
|
|
|
3525
3545
|
}
|
|
3526
3546
|
);
|
|
3527
3547
|
}
|
|
3548
|
+
const GoAFilterChip = ({
|
|
3549
|
+
iconTheme = "outline",
|
|
3550
|
+
error = false,
|
|
3551
|
+
content,
|
|
3552
|
+
onClick,
|
|
3553
|
+
mt,
|
|
3554
|
+
mr,
|
|
3555
|
+
mb,
|
|
3556
|
+
ml,
|
|
3557
|
+
testId
|
|
3558
|
+
}) => {
|
|
3559
|
+
const el = react.useRef(null);
|
|
3560
|
+
react.useEffect(() => {
|
|
3561
|
+
if (!el.current) return;
|
|
3562
|
+
if (!onClick) return;
|
|
3563
|
+
const current = el.current;
|
|
3564
|
+
current.addEventListener("_click", onClick);
|
|
3565
|
+
return () => {
|
|
3566
|
+
current.removeEventListener("_click", onClick);
|
|
3567
|
+
};
|
|
3568
|
+
}, [el, onClick]);
|
|
3569
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3570
|
+
"goa-filter-chip",
|
|
3571
|
+
{
|
|
3572
|
+
ref: el,
|
|
3573
|
+
icontheme: iconTheme,
|
|
3574
|
+
error,
|
|
3575
|
+
content,
|
|
3576
|
+
mt,
|
|
3577
|
+
mr,
|
|
3578
|
+
mb,
|
|
3579
|
+
ml,
|
|
3580
|
+
"data-testid": testId
|
|
3581
|
+
}
|
|
3582
|
+
);
|
|
3583
|
+
};
|
|
3528
3584
|
exports.GoAIcon = icon.GoAIcon;
|
|
3529
3585
|
exports.GoAAccordion = GoAAccordion;
|
|
3530
3586
|
exports.GoAAppFooter = GoAAppFooter;
|
|
@@ -3552,6 +3608,7 @@ exports.GoAEmergencyBadge = GoAEmergencyBadge;
|
|
|
3552
3608
|
exports.GoAFieldset = GoAFieldset;
|
|
3553
3609
|
exports.GoAFileUploadCard = GoAFileUploadCard;
|
|
3554
3610
|
exports.GoAFileUploadInput = GoAFileUploadInput;
|
|
3611
|
+
exports.GoAFilterChip = GoAFilterChip;
|
|
3555
3612
|
exports.GoAFormItem = GoAFormItem;
|
|
3556
3613
|
exports.GoAFormStep = GoAFormStep;
|
|
3557
3614
|
exports.GoAFormStepper = GoAFormStepper;
|