@abgov/react-components 7.1.0 → 7.2.0-dev.2

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.mjs CHANGED
@@ -2676,14 +2676,19 @@ function GoabDrawer({
2676
2676
  }) {
2677
2677
  const el = useRef(null);
2678
2678
  useEffect(() => {
2679
- var _a;
2680
2679
  if (!(el == null ? void 0 : el.current) || !onClose) {
2681
2680
  return;
2682
2681
  }
2683
- (_a = el.current) == null ? void 0 : _a.addEventListener("_close", onClose);
2682
+ const current = el.current;
2683
+ const listener = (e) => {
2684
+ if (e.target !== current) {
2685
+ return;
2686
+ }
2687
+ onClose();
2688
+ };
2689
+ current.addEventListener("_close", listener);
2684
2690
  return () => {
2685
- var _a2;
2686
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_close", onClose);
2691
+ current.removeEventListener("_close", listener);
2687
2692
  };
2688
2693
  }, [el, onClose]);
2689
2694
  return /* @__PURE__ */ jsxs(
@@ -3121,9 +3126,10 @@ function GoabHeroBanner({
3121
3126
  backgroundColor,
3122
3127
  textColor,
3123
3128
  children,
3129
+ actions,
3124
3130
  testId
3125
3131
  }) {
3126
- return /* @__PURE__ */ jsx(
3132
+ return /* @__PURE__ */ jsxs(
3127
3133
  "goa-hero-banner",
3128
3134
  {
3129
3135
  heading,
@@ -3133,7 +3139,10 @@ function GoabHeroBanner({
3133
3139
  backgroundcolor: backgroundColor,
3134
3140
  textcolor: textColor,
3135
3141
  testid: testId,
3136
- children
3142
+ children: [
3143
+ children,
3144
+ actions && /* @__PURE__ */ jsx("div", { slot: "actions", children: actions })
3145
+ ]
3137
3146
  }
3138
3147
  );
3139
3148
  }
@@ -3574,7 +3583,10 @@ function GoabModal({
3574
3583
  return;
3575
3584
  }
3576
3585
  const current = el.current;
3577
- const listener = () => {
3586
+ const listener = (e) => {
3587
+ if (e.target !== current) {
3588
+ return;
3589
+ }
3578
3590
  onClose == null ? void 0 : onClose();
3579
3591
  };
3580
3592
  current.addEventListener("_close", listener);
@@ -3725,14 +3737,19 @@ function GoabPushDrawer({
3725
3737
  }) {
3726
3738
  const el = useRef(null);
3727
3739
  useEffect(() => {
3728
- var _a;
3729
3740
  if (!(el == null ? void 0 : el.current) || !onClose) {
3730
3741
  return;
3731
3742
  }
3732
- (_a = el.current) == null ? void 0 : _a.addEventListener("_close", onClose);
3743
+ const current = el.current;
3744
+ const listener = (e) => {
3745
+ if (e.target !== current) {
3746
+ return;
3747
+ }
3748
+ onClose();
3749
+ };
3750
+ current.addEventListener("_close", listener);
3733
3751
  return () => {
3734
- var _a2;
3735
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_close", onClose);
3752
+ current.removeEventListener("_close", listener);
3736
3753
  };
3737
3754
  }, [el, onClose]);
3738
3755
  return /* @__PURE__ */ jsxs(