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