@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 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,
@@ -3525,6 +3543,42 @@ function GoATwoColumnLayout(props) {
3525
3543
  }
3526
3544
  );
3527
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 = react.useRef(null);
3558
+ react.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__ */ jsxRuntime.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
+ };
3528
3582
  exports.GoAIcon = icon.GoAIcon;
3529
3583
  exports.GoAAccordion = GoAAccordion;
3530
3584
  exports.GoAAppFooter = GoAAppFooter;
@@ -3552,6 +3606,7 @@ exports.GoAEmergencyBadge = GoAEmergencyBadge;
3552
3606
  exports.GoAFieldset = GoAFieldset;
3553
3607
  exports.GoAFileUploadCard = GoAFileUploadCard;
3554
3608
  exports.GoAFileUploadInput = GoAFileUploadInput;
3609
+ exports.GoAFilterChip = GoAFilterChip;
3555
3610
  exports.GoAFormItem = GoAFormItem;
3556
3611
  exports.GoAFormStep = GoAFormStep;
3557
3612
  exports.GoAFormStepper = GoAFormStepper;