@abgov/react-components 6.7.1-alpha.5 → 6.8.0-alpha.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.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './lib/button-group/button-group';
8
8
  export * from './lib/calendar/calendar';
9
9
  export * from './lib/callout/callout';
10
10
  export * from './lib/checkbox/checkbox';
11
+ export * from './lib/checkbox-list/checkbox-list';
11
12
  export * from './lib/chip/chip';
12
13
  export * from './lib/circular-progress/circular-progress';
13
14
  export * from './lib/container/container';
@@ -41,6 +42,8 @@ export * from './lib/icon/icon';
41
42
  export * from './lib/input/input';
42
43
  export * from './lib/link/link';
43
44
  export * from './lib/link-button/link-button';
45
+ export * from './lib/menu-button/menu-button';
46
+ export * from './lib/menu-button/menu-action';
44
47
  export * from './lib/microsite-header/microsite-header';
45
48
  export * from './lib/modal/modal';
46
49
  export * from './lib/notification/notification';
package/index.js CHANGED
@@ -116,6 +116,12 @@ function GoabAppHeaderMenu(props) {
116
116
  }
117
117
  );
118
118
  }
119
+ function getIconValue(icon2, iconType) {
120
+ if (icon2 !== void 0) {
121
+ return icon2 ? "true" : "false";
122
+ }
123
+ return iconType ? "true" : "false";
124
+ }
119
125
  function GoabBadge({
120
126
  type,
121
127
  content,
@@ -125,16 +131,18 @@ function GoabBadge({
125
131
  mr,
126
132
  mb,
127
133
  ml,
128
- ariaLabel
134
+ ariaLabel,
135
+ iconType
129
136
  }) {
130
137
  return /* @__PURE__ */ jsxRuntime.jsx(
131
138
  "goa-badge",
132
139
  {
133
140
  type,
134
141
  content,
135
- icon: icon2 ? "true" : void 0,
142
+ icon: getIconValue(icon2, iconType),
136
143
  testid: testId,
137
144
  arialabel: ariaLabel,
145
+ icontype: iconType,
138
146
  mt,
139
147
  mr,
140
148
  mb,
@@ -421,6 +429,7 @@ function GoabCheckbox({
421
429
  error,
422
430
  disabled,
423
431
  checked,
432
+ indeterminate,
424
433
  value,
425
434
  text,
426
435
  description,
@@ -459,6 +468,7 @@ function GoabCheckbox({
459
468
  name,
460
469
  error: error ? "true" : void 0,
461
470
  checked: checked ? "true" : void 0,
471
+ indeterminate: indeterminate ? "true" : void 0,
462
472
  disabled: disabled ? "true" : void 0,
463
473
  text,
464
474
  value: typeof value === "boolean" ? value ? "true" : void 0 : value,
@@ -478,6 +488,63 @@ function GoabCheckbox({
478
488
  }
479
489
  );
480
490
  }
491
+ function GoabCheckboxList({
492
+ name,
493
+ value = [],
494
+ disabled,
495
+ error,
496
+ testId,
497
+ maxWidth,
498
+ children,
499
+ onChange,
500
+ mt,
501
+ mr,
502
+ mb,
503
+ ml
504
+ }) {
505
+ const el = react.useRef(null);
506
+ react.useEffect(() => {
507
+ if (!el.current) return;
508
+ const current = el.current;
509
+ const listener = (e) => {
510
+ try {
511
+ const detail = e.detail;
512
+ onChange == null ? void 0 : onChange(detail);
513
+ } catch (error2) {
514
+ console.error("Error handling checkbox list change:", error2);
515
+ }
516
+ };
517
+ try {
518
+ current.addEventListener("_change", listener);
519
+ } catch (error2) {
520
+ console.error("Failed to attach checkbox list listener:", error2);
521
+ }
522
+ return () => {
523
+ try {
524
+ current.removeEventListener("_change", listener);
525
+ } catch (error2) {
526
+ console.error("Failed to remove checkbox list listener:", error2);
527
+ }
528
+ };
529
+ }, [onChange]);
530
+ return /* @__PURE__ */ jsxRuntime.jsx(
531
+ "goa-checkbox-list",
532
+ {
533
+ ref: el,
534
+ name,
535
+ value,
536
+ disabled: disabled ? "true" : void 0,
537
+ error: error ? "true" : void 0,
538
+ testid: testId,
539
+ maxwidth: maxWidth,
540
+ mt,
541
+ mr,
542
+ mb,
543
+ ml,
544
+ children
545
+ }
546
+ );
547
+ }
481
548
  const GoabChip = ({
482
549
  leadingIcon,
483
550
  iconTheme,
@@ -3228,6 +3295,36 @@ function GoALinkButton({ type = "primary", ...props }) {
3228
3295
  }
3229
3296
  );
3230
3297
  }
3298
+ function GoabMenuButton({
3299
+ text,
3300
+ type = "primary",
3301
+ testId,
3302
+ onAction,
3303
+ children
3304
+ }) {
3305
+ const el = react.useRef(null);
3306
+ react.useEffect(() => {
3307
+ if (!el.current) {
3308
+ return;
3309
+ }
3310
+ if (!onAction) {
3311
+ return;
3312
+ }
3313
+ const current = el.current;
3314
+ const listener = (e) => {
3315
+ const detail = e.detail;
3316
+ onAction(detail.action);
3317
+ };
3318
+ current.addEventListener("_action", listener);
3319
+ return () => {
3320
+ current.removeEventListener("_action", listener);
3321
+ };
3322
+ }, [el, onAction]);
3323
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ref: el, text, type, testid: testId, children });
3324
+ }
3325
+ function GoabMenuAction({ text, icon: icon2, action, testId }) {
3326
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-action", { text, action, icon: icon2, testid: testId });
3327
+ }
3231
3328
  function GoabMicrositeHeader({
3232
3329
  type,
3233
3330
  version,
@@ -3409,6 +3506,7 @@ function GoabPopover({
3409
3506
  position,
3410
3507
  relative,
3411
3508
  children,
3509
+ tabIndex = -1,
3412
3510
  mt,
3413
3511
  mr,
3414
3512
  mb,
@@ -3423,6 +3521,7 @@ function GoabPopover({
3423
3521
  padded: typeof padded === "undefined" ? void 0 : padded ? "true" : "false",
3424
3522
  position,
3425
3523
  relative: relative ? "true" : void 0,
3524
+ tabindex: tabIndex,
3426
3525
  mt,
3427
3526
  mr,
3428
3527
  mb,
@@ -4297,6 +4396,7 @@ exports.GoabButtonGroup = GoabButtonGroup;
4297
4396
  exports.GoabCalendar = GoabCalendar;
4298
4397
  exports.GoabCallout = GoabCallout;
4299
4398
  exports.GoabCheckbox = GoabCheckbox;
4399
+ exports.GoabCheckboxList = GoabCheckboxList;
4300
4400
  exports.GoabChip = GoabChip;
4301
4401
  exports.GoabCircularProgress = GoabCircularProgress;
4302
4402
  exports.GoabContainer = GoabContainer;
@@ -4335,6 +4435,8 @@ exports.GoabInputText = GoabInputText;
4335
4435
  exports.GoabInputTime = GoabInputTime;
4336
4436
  exports.GoabInputUrl = GoabInputUrl;
4337
4437
  exports.GoabLink = GoabLink;
4438
+ exports.GoabMenuAction = GoabMenuAction;
4439
+ exports.GoabMenuButton = GoabMenuButton;
4338
4440
  exports.GoabMicrositeHeader = GoabMicrositeHeader;
4339
4441
  exports.GoabModal = GoabModal;
4340
4442
  exports.GoabNotification = GoabNotification;