@abgov/react-components 5.2.0 → 5.3.0

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
@@ -2,12 +2,14 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const react = require("react");
5
+ const icon = require("./icon-1IRcN4Uf.js");
5
6
  function GoAAccordion({
6
7
  open,
7
8
  heading,
8
9
  headingSize,
9
10
  secondaryText,
10
11
  headingContent,
12
+ iconPosition,
11
13
  maxWidth,
12
14
  testid,
13
15
  children,
@@ -23,6 +25,7 @@ function GoAAccordion({
23
25
  headingSize,
24
26
  heading,
25
27
  secondaryText,
28
+ iconposition: iconPosition,
26
29
  maxwidth: maxWidth,
27
30
  testid,
28
31
  mt,
@@ -42,16 +45,36 @@ function GoAAppHeader({
42
45
  maxContentWidth,
43
46
  fullMenuBreakpoint,
44
47
  testId,
45
- children
48
+ children,
49
+ onMenuClick
46
50
  }) {
51
+ const el = react.useRef(null);
52
+ react.useEffect(() => {
53
+ if (!el.current) {
54
+ return;
55
+ }
56
+ if (!onMenuClick) {
57
+ return;
58
+ }
59
+ const current = el.current;
60
+ const listener = () => {
61
+ onMenuClick();
62
+ };
63
+ current.addEventListener("_menuClick", listener);
64
+ return () => {
65
+ current.removeEventListener("_menuClick", listener);
66
+ };
67
+ }, [el, onMenuClick]);
47
68
  return /* @__PURE__ */ jsxRuntime.jsx(
48
69
  "goa-app-header",
49
70
  {
71
+ ref: el,
50
72
  heading,
51
73
  url,
52
74
  fullmenubreakpoint: fullMenuBreakpoint,
53
75
  maxcontentwidth: maxContentWidth,
54
76
  testid: testId,
77
+ hasmenuclickhandler: !!onMenuClick,
55
78
  children
56
79
  }
57
80
  );
@@ -70,7 +93,7 @@ function GoAAppHeaderMenu(props) {
70
93
  function GoABadge({
71
94
  type,
72
95
  content,
73
- icon,
96
+ icon: icon2,
74
97
  testId,
75
98
  mt,
76
99
  mr,
@@ -83,7 +106,7 @@ function GoABadge({
83
106
  {
84
107
  type,
85
108
  content,
86
- icon,
109
+ icon: icon2,
87
110
  testid: testId,
88
111
  arialabel: ariaLabel,
89
112
  mt,
@@ -96,7 +119,7 @@ function GoABadge({
96
119
  function GoAInfoBadge({
97
120
  content,
98
121
  testId,
99
- icon,
122
+ icon: icon2,
100
123
  mt,
101
124
  mr,
102
125
  mb,
@@ -107,7 +130,7 @@ function GoAInfoBadge({
107
130
  GoABadge,
108
131
  {
109
132
  type: "information",
110
- icon,
133
+ icon: icon2,
111
134
  content,
112
135
  testId,
113
136
  ariaLabel,
@@ -121,7 +144,7 @@ function GoAInfoBadge({
121
144
  function GoASuccessBadge({
122
145
  content,
123
146
  testId,
124
- icon,
147
+ icon: icon2,
125
148
  mt,
126
149
  mr,
127
150
  mb,
@@ -132,7 +155,7 @@ function GoASuccessBadge({
132
155
  GoABadge,
133
156
  {
134
157
  type: "success",
135
- icon,
158
+ icon: icon2,
136
159
  content,
137
160
  ariaLabel,
138
161
  testId,
@@ -146,7 +169,7 @@ function GoASuccessBadge({
146
169
  function GoAImportantBadge({
147
170
  content,
148
171
  testId,
149
- icon,
172
+ icon: icon2,
150
173
  mt,
151
174
  mr,
152
175
  mb,
@@ -157,7 +180,7 @@ function GoAImportantBadge({
157
180
  GoABadge,
158
181
  {
159
182
  type: "important",
160
- icon,
183
+ icon: icon2,
161
184
  content,
162
185
  testId,
163
186
  ariaLabel,
@@ -171,7 +194,7 @@ function GoAImportantBadge({
171
194
  function GoAEmergencyBadge({
172
195
  content,
173
196
  testId,
174
- icon,
197
+ icon: icon2,
175
198
  mt,
176
199
  mr,
177
200
  mb,
@@ -182,7 +205,7 @@ function GoAEmergencyBadge({
182
205
  GoABadge,
183
206
  {
184
207
  type: "emergency",
185
- icon,
208
+ icon: icon2,
186
209
  content,
187
210
  testId,
188
211
  ariaLabel,
@@ -325,6 +348,7 @@ function GoACalendar({
325
348
  const GoACallout = ({
326
349
  heading,
327
350
  type = "information",
351
+ iconTheme = "outline",
328
352
  size = "large",
329
353
  maxWidth,
330
354
  testId,
@@ -343,6 +367,7 @@ const GoACallout = ({
343
367
  size,
344
368
  maxwidth: maxWidth,
345
369
  arialive: ariaLive,
370
+ icontheme: iconTheme,
346
371
  mt,
347
372
  mr,
348
373
  mb,
@@ -946,7 +971,7 @@ function GoAHeroBannerActions({
946
971
  return /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children });
947
972
  }
948
973
  function GoAIconButton({
949
- icon,
974
+ icon: icon2,
950
975
  disabled,
951
976
  variant = "color",
952
977
  onClick,
@@ -981,7 +1006,7 @@ function GoAIconButton({
981
1006
  "goa-icon-button",
982
1007
  {
983
1008
  ref,
984
- icon,
1009
+ icon: icon2,
985
1010
  disabled,
986
1011
  variant,
987
1012
  size,
@@ -996,40 +1021,6 @@ function GoAIconButton({
996
1021
  }
997
1022
  );
998
1023
  }
999
- function GoAIcon({
1000
- type,
1001
- theme,
1002
- size,
1003
- inverted,
1004
- fillColor,
1005
- opacity,
1006
- title,
1007
- ariaLabel,
1008
- mt,
1009
- mr,
1010
- mb,
1011
- ml,
1012
- testId
1013
- }) {
1014
- return /* @__PURE__ */ jsxRuntime.jsx(
1015
- "goa-icon",
1016
- {
1017
- type,
1018
- theme,
1019
- size,
1020
- inverted,
1021
- fillcolor: fillColor,
1022
- opacity,
1023
- title,
1024
- arialabel: ariaLabel,
1025
- mt,
1026
- mr,
1027
- mb,
1028
- ml,
1029
- testid: testId
1030
- }
1031
- );
1032
- }
1033
1024
  function toDate(argument) {
1034
1025
  const argStr = Object.prototype.toString.call(argument);
1035
1026
  if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
@@ -3251,7 +3242,12 @@ function GoASideMenuGroup(props) {
3251
3242
  "goa-side-menu-group",
3252
3243
  {
3253
3244
  heading: props.heading,
3245
+ icon: props.icon,
3254
3246
  testid: props.testId,
3247
+ mt: props.mt,
3248
+ mr: props.mr,
3249
+ mb: props.mb,
3250
+ ml: props.ml,
3255
3251
  children: props.children
3256
3252
  }
3257
3253
  );
@@ -3529,6 +3525,7 @@ function GoATwoColumnLayout(props) {
3529
3525
  }
3530
3526
  );
3531
3527
  }
3528
+ exports.GoAIcon = icon.GoAIcon;
3532
3529
  exports.GoAAccordion = GoAAccordion;
3533
3530
  exports.GoAAppFooter = GoAAppFooter;
3534
3531
  exports.GoAAppFooterMetaSection = GoAAppFooterMetaSection;
@@ -3561,7 +3558,6 @@ exports.GoAFormStepper = GoAFormStepper;
3561
3558
  exports.GoAGrid = GoAGrid;
3562
3559
  exports.GoAHeroBanner = GoAHeroBanner;
3563
3560
  exports.GoAHeroBannerActions = GoAHeroBannerActions;
3564
- exports.GoAIcon = GoAIcon;
3565
3561
  exports.GoAIconButton = GoAIconButton;
3566
3562
  exports.GoAImportantBadge = GoAImportantBadge;
3567
3563
  exports.GoAInfoBadge = GoAInfoBadge;