@abgov/react-components 5.0.0-alpha.10 → 5.0.0-alpha.12

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
@@ -7,21 +7,39 @@ function GoAAccordion({
7
7
  headingSize,
8
8
  secondaryText,
9
9
  headingContent,
10
+ iconPosition,
10
11
  maxWidth,
11
12
  testid,
13
+ onChange,
12
14
  children,
13
15
  mt,
14
16
  mr,
15
17
  mb,
16
18
  ml
17
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]);
18
34
  return /* @__PURE__ */ jsxs(
19
35
  "goa-accordion",
20
36
  {
37
+ ref,
21
38
  open,
22
39
  headingSize,
23
40
  heading,
24
41
  secondaryText,
42
+ iconposition: iconPosition,
25
43
  maxwidth: maxWidth,
26
44
  testid,
27
45
  mt,
@@ -41,16 +59,36 @@ function GoAAppHeader({
41
59
  maxContentWidth,
42
60
  fullMenuBreakpoint,
43
61
  testId,
44
- children
62
+ children,
63
+ onMenuClick
45
64
  }) {
65
+ const el = useRef(null);
66
+ useEffect(() => {
67
+ if (!el.current) {
68
+ return;
69
+ }
70
+ if (!onMenuClick) {
71
+ return;
72
+ }
73
+ const current = el.current;
74
+ const listener = () => {
75
+ onMenuClick();
76
+ };
77
+ current.addEventListener("_menuClick", listener);
78
+ return () => {
79
+ current.removeEventListener("_menuClick", listener);
80
+ };
81
+ }, [el, onMenuClick]);
46
82
  return /* @__PURE__ */ jsx(
47
83
  "goa-app-header",
48
84
  {
85
+ ref: el,
49
86
  heading,
50
87
  url,
51
88
  fullmenubreakpoint: fullMenuBreakpoint,
52
89
  maxcontentwidth: maxContentWidth,
53
90
  testid: testId,
91
+ hasmenuclickhandler: !!onMenuClick,
54
92
  children
55
93
  }
56
94
  );
@@ -324,6 +362,7 @@ function GoACalendar({
324
362
  const GoACallout = ({
325
363
  heading,
326
364
  type = "information",
365
+ iconTheme = "outline",
327
366
  size = "large",
328
367
  maxWidth,
329
368
  testId,
@@ -342,6 +381,7 @@ const GoACallout = ({
342
381
  size,
343
382
  maxwidth: maxWidth,
344
383
  arialive: ariaLive,
384
+ icontheme: iconTheme,
345
385
  mt,
346
386
  mr,
347
387
  mb,
@@ -3216,7 +3256,12 @@ function GoASideMenuGroup(props) {
3216
3256
  "goa-side-menu-group",
3217
3257
  {
3218
3258
  heading: props.heading,
3259
+ icon: props.icon,
3219
3260
  testid: props.testId,
3261
+ mt: props.mt,
3262
+ mr: props.mr,
3263
+ mb: props.mb,
3264
+ ml: props.ml,
3220
3265
  children: props.children
3221
3266
  }
3222
3267
  );
@@ -3494,6 +3539,42 @@ function GoATwoColumnLayout(props) {
3494
3539
  }
3495
3540
  );
3496
3541
  }
3542
+ const GoAFilterChip = ({
3543
+ iconTheme = "outline",
3544
+ error = false,
3545
+ content,
3546
+ onClick,
3547
+ mt,
3548
+ mr,
3549
+ mb,
3550
+ ml,
3551
+ testId
3552
+ }) => {
3553
+ const el = useRef(null);
3554
+ useEffect(() => {
3555
+ if (!el.current) return;
3556
+ if (!onClick) return;
3557
+ const current = el.current;
3558
+ current.addEventListener("_click", onClick);
3559
+ return () => {
3560
+ current.removeEventListener("_click", onClick);
3561
+ };
3562
+ }, [el, onClick]);
3563
+ return /* @__PURE__ */ jsx(
3564
+ "goa-filter-chip",
3565
+ {
3566
+ ref: el,
3567
+ icontheme: iconTheme,
3568
+ error,
3569
+ content,
3570
+ mt,
3571
+ mr,
3572
+ mb,
3573
+ ml,
3574
+ "data-testid": testId
3575
+ }
3576
+ );
3577
+ };
3497
3578
  export {
3498
3579
  GoAAccordion,
3499
3580
  GoAAppFooter,
@@ -3521,6 +3602,7 @@ export {
3521
3602
  GoAFieldset,
3522
3603
  GoAFileUploadCard,
3523
3604
  GoAFileUploadInput,
3605
+ GoAFilterChip,
3524
3606
  GoAFormItem,
3525
3607
  GoAFormStep,
3526
3608
  GoAFormStepper,