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