@abgov/react-components 6.7.1-alpha.5 → 6.8.0-alpha.1

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,
@@ -4294,6 +4361,7 @@ export {
4294
4361
  GoabCalendar,
4295
4362
  GoabCallout,
4296
4363
  GoabCheckbox,
4364
+ GoabCheckboxList,
4297
4365
  GoabChip,
4298
4366
  GoabCircularProgress,
4299
4367
  GoabContainer,