@abgov/react-components 5.0.0-alpha.11 → 5.0.0-alpha.12
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 +53 -0
- package/index.js.map +1 -1
- package/index.mjs +53 -0
- package/index.mjs.map +1 -1
- package/lib/accordion/accordion.d.ts +4 -2
- package/lib/filter-chip/filter-chip.d.ts +24 -0
- 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,
|
|
@@ -3523,6 +3539,42 @@ function GoATwoColumnLayout(props) {
|
|
|
3523
3539
|
}
|
|
3524
3540
|
);
|
|
3525
3541
|
}
|
|
3542
|
+
const GoAFilterChip = ({
|
|
3543
|
+
iconTheme = "outline",
|
|
3544
|
+
error = false,
|
|
3545
|
+
content,
|
|
3546
|
+
onClick,
|
|
3547
|
+
mt,
|
|
3548
|
+
mr,
|
|
3549
|
+
mb,
|
|
3550
|
+
ml,
|
|
3551
|
+
testId
|
|
3552
|
+
}) => {
|
|
3553
|
+
const el = useRef(null);
|
|
3554
|
+
useEffect(() => {
|
|
3555
|
+
if (!el.current) return;
|
|
3556
|
+
if (!onClick) return;
|
|
3557
|
+
const current = el.current;
|
|
3558
|
+
current.addEventListener("_click", onClick);
|
|
3559
|
+
return () => {
|
|
3560
|
+
current.removeEventListener("_click", onClick);
|
|
3561
|
+
};
|
|
3562
|
+
}, [el, onClick]);
|
|
3563
|
+
return /* @__PURE__ */ jsx(
|
|
3564
|
+
"goa-filter-chip",
|
|
3565
|
+
{
|
|
3566
|
+
ref: el,
|
|
3567
|
+
icontheme: iconTheme,
|
|
3568
|
+
error,
|
|
3569
|
+
content,
|
|
3570
|
+
mt,
|
|
3571
|
+
mr,
|
|
3572
|
+
mb,
|
|
3573
|
+
ml,
|
|
3574
|
+
"data-testid": testId
|
|
3575
|
+
}
|
|
3576
|
+
);
|
|
3577
|
+
};
|
|
3526
3578
|
export {
|
|
3527
3579
|
GoAAccordion,
|
|
3528
3580
|
GoAAppFooter,
|
|
@@ -3550,6 +3602,7 @@ export {
|
|
|
3550
3602
|
GoAFieldset,
|
|
3551
3603
|
GoAFileUploadCard,
|
|
3552
3604
|
GoAFileUploadInput,
|
|
3605
|
+
GoAFilterChip,
|
|
3553
3606
|
GoAFormItem,
|
|
3554
3607
|
GoAFormStep,
|
|
3555
3608
|
GoAFormStepper,
|