@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.mjs CHANGED
@@ -114,6 +114,12 @@ function GoabAppHeaderMenu(props) {
114
114
  }
115
115
  );
116
116
  }
117
+ function getIconValue(icon, iconType) {
118
+ if (icon !== void 0) {
119
+ return icon ? "true" : "false";
120
+ }
121
+ return iconType ? "true" : "false";
122
+ }
117
123
  function GoabBadge({
118
124
  type,
119
125
  content,
@@ -123,16 +129,18 @@ function GoabBadge({
123
129
  mr,
124
130
  mb,
125
131
  ml,
126
- ariaLabel
132
+ ariaLabel,
133
+ iconType
127
134
  }) {
128
135
  return /* @__PURE__ */ jsx(
129
136
  "goa-badge",
130
137
  {
131
138
  type,
132
139
  content,
133
- icon: icon ? "true" : void 0,
140
+ icon: getIconValue(icon, iconType),
134
141
  testid: testId,
135
142
  arialabel: ariaLabel,
143
+ icontype: iconType,
136
144
  mt,
137
145
  mr,
138
146
  mb,
@@ -419,6 +427,7 @@ function GoabCheckbox({
419
427
  error,
420
428
  disabled,
421
429
  checked,
430
+ indeterminate,
422
431
  value,
423
432
  text,
424
433
  description,
@@ -457,6 +466,7 @@ function GoabCheckbox({
457
466
  name,
458
467
  error: error ? "true" : void 0,
459
468
  checked: checked ? "true" : void 0,
469
+ indeterminate: indeterminate ? "true" : void 0,
460
470
  disabled: disabled ? "true" : void 0,
461
471
  text,
462
472
  value: typeof value === "boolean" ? value ? "true" : void 0 : value,
@@ -476,6 +486,63 @@ function GoabCheckbox({
476
486
  }
477
487
  );
478
488
  }
489
+ function GoabCheckboxList({
490
+ name,
491
+ value = [],
492
+ disabled,
493
+ error,
494
+ testId,
495
+ maxWidth,
496
+ children,
497
+ onChange,
498
+ mt,
499
+ mr,
500
+ mb,
501
+ ml
502
+ }) {
503
+ const el = useRef(null);
504
+ useEffect(() => {
505
+ if (!el.current) return;
506
+ const current = el.current;
507
+ const listener = (e) => {
508
+ try {
509
+ const detail = e.detail;
510
+ onChange == null ? void 0 : onChange(detail);
511
+ } catch (error2) {
512
+ console.error("Error handling checkbox list change:", error2);
513
+ }
514
+ };
515
+ try {
516
+ current.addEventListener("_change", listener);
517
+ } catch (error2) {
518
+ console.error("Failed to attach checkbox list listener:", error2);
519
+ }
520
+ return () => {
521
+ try {
522
+ current.removeEventListener("_change", listener);
523
+ } catch (error2) {
524
+ console.error("Failed to remove checkbox list listener:", error2);
525
+ }
526
+ };
527
+ }, [onChange]);
528
+ return /* @__PURE__ */ jsx(
529
+ "goa-checkbox-list",
530
+ {
531
+ ref: el,
532
+ name,
533
+ value,
534
+ disabled: disabled ? "true" : void 0,
535
+ error: error ? "true" : void 0,
536
+ testid: testId,
537
+ maxwidth: maxWidth,
538
+ mt,
539
+ mr,
540
+ mb,
541
+ ml,
542
+ children
543
+ }
544
+ );
545
+ }
479
546
  const GoabChip = ({
480
547
  leadingIcon,
481
548
  iconTheme,
@@ -3226,6 +3293,36 @@ function GoALinkButton({ type = "primary", ...props }) {
3226
3293
  }
3227
3294
  );
3228
3295
  }
3296
+ function GoabMenuButton({
3297
+ text,
3298
+ type = "primary",
3299
+ testId,
3300
+ onAction,
3301
+ children
3302
+ }) {
3303
+ const el = useRef(null);
3304
+ useEffect(() => {
3305
+ if (!el.current) {
3306
+ return;
3307
+ }
3308
+ if (!onAction) {
3309
+ return;
3310
+ }
3311
+ const current = el.current;
3312
+ const listener = (e) => {
3313
+ const detail = e.detail;
3314
+ onAction(detail.action);
3315
+ };
3316
+ current.addEventListener("_action", listener);
3317
+ return () => {
3318
+ current.removeEventListener("_action", listener);
3319
+ };
3320
+ }, [el, onAction]);
3321
+ return /* @__PURE__ */ jsx("goa-menu-button", { ref: el, text, type, testid: testId, children });
3322
+ }
3323
+ function GoabMenuAction({ text, icon, action, testId }) {
3324
+ return /* @__PURE__ */ jsx("goa-menu-action", { text, action, icon, testid: testId });
3325
+ }
3229
3326
  function GoabMicrositeHeader({
3230
3327
  type,
3231
3328
  version,
@@ -3407,6 +3504,7 @@ function GoabPopover({
3407
3504
  position,
3408
3505
  relative,
3409
3506
  children,
3507
+ tabIndex = -1,
3410
3508
  mt,
3411
3509
  mr,
3412
3510
  mb,
@@ -3421,6 +3519,7 @@ function GoabPopover({
3421
3519
  padded: typeof padded === "undefined" ? void 0 : padded ? "true" : "false",
3422
3520
  position,
3423
3521
  relative: relative ? "true" : void 0,
3522
+ tabindex: tabIndex,
3424
3523
  mt,
3425
3524
  mr,
3426
3525
  mb,
@@ -4294,6 +4393,7 @@ export {
4294
4393
  GoabCalendar,
4295
4394
  GoabCallout,
4296
4395
  GoabCheckbox,
4396
+ GoabCheckboxList,
4297
4397
  GoabChip,
4298
4398
  GoabCircularProgress,
4299
4399
  GoabContainer,
@@ -4334,6 +4434,8 @@ export {
4334
4434
  GoabInputTime,
4335
4435
  GoabInputUrl,
4336
4436
  GoabLink,
4437
+ GoabMenuAction,
4438
+ GoabMenuButton,
4337
4439
  GoabMicrositeHeader,
4338
4440
  GoabModal,
4339
4441
  GoabNotification,