@abgov/react-components 7.2.0-dev.20 → 7.2.0-dev.21

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.js CHANGED
@@ -65,10 +65,26 @@ function GoabAccordion({
65
65
  }
66
66
  );
67
67
  }
68
+ function renderSlottedItems(children, slot) {
69
+ return react.Children.map(children, (child) => {
70
+ if (!react.isValidElement(child)) {
71
+ return child;
72
+ }
73
+ if (child.type === react.Fragment) {
74
+ const fragment = child;
75
+ return renderSlottedItems(fragment.props.children, slot);
76
+ }
77
+ return react.cloneElement(child, { slot });
78
+ });
79
+ }
68
80
  function GoabAppHeader({
69
81
  onMenuClick,
70
82
  children,
71
83
  secondaryText,
84
+ banner,
85
+ phase,
86
+ navigation,
87
+ utilities,
72
88
  ...rest
73
89
  }) {
74
90
  const el = react.useRef(null);
@@ -89,7 +105,7 @@ function GoabAppHeader({
89
105
  current.removeEventListener("_menuClick", listener);
90
106
  };
91
107
  }, [el, onMenuClick]);
92
- return /* @__PURE__ */ jsxRuntime.jsx(
108
+ return /* @__PURE__ */ jsxRuntime.jsxs(
93
109
  "goa-app-header",
94
110
  {
95
111
  ref: el,
@@ -97,7 +113,13 @@ function GoabAppHeader({
97
113
  secondarytext: secondaryText,
98
114
  ..._props,
99
115
  version: "2",
100
- children
116
+ children: [
117
+ children,
118
+ banner && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "banner", children: banner }),
119
+ phase && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "phase", children: phase }),
120
+ navigation && renderSlottedItems(navigation, "navigation"),
121
+ utilities && renderSlottedItems(utilities, "utilities")
122
+ ]
101
123
  }
102
124
  );
103
125
  }
@@ -2857,7 +2879,8 @@ function GoabDropdownItem({
2857
2879
  label,
2858
2880
  filter,
2859
2881
  name,
2860
- mountType = "append"
2882
+ mountType = "append",
2883
+ children
2861
2884
  }) {
2862
2885
  return /* @__PURE__ */ jsxRuntime.jsx(
2863
2886
  "goa-dropdown-item",
@@ -2866,7 +2889,8 @@ function GoabDropdownItem({
2866
2889
  label,
2867
2890
  filter,
2868
2891
  name,
2869
- mount: mountType
2892
+ mount: mountType,
2893
+ children
2870
2894
  }
2871
2895
  );
2872
2896
  }