@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.d.ts +1 -0
- package/index.js +70 -2
- package/index.js.map +1 -1
- package/index.mjs +70 -2
- package/index.mjs.map +1 -1
- package/lib/badge/badge.d.ts +4 -2
- package/lib/checkbox/checkbox.d.ts +3 -1
- package/lib/checkbox-list/checkbox-list.d.ts +30 -0
- package/package.json +1 -1
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';
|
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
|
|
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,
|
|
@@ -4297,6 +4364,7 @@ exports.GoabButtonGroup = GoabButtonGroup;
|
|
|
4297
4364
|
exports.GoabCalendar = GoabCalendar;
|
|
4298
4365
|
exports.GoabCallout = GoabCallout;
|
|
4299
4366
|
exports.GoabCheckbox = GoabCheckbox;
|
|
4367
|
+
exports.GoabCheckboxList = GoabCheckboxList;
|
|
4300
4368
|
exports.GoabChip = GoabChip;
|
|
4301
4369
|
exports.GoabCircularProgress = GoabCircularProgress;
|
|
4302
4370
|
exports.GoabContainer = GoabContainer;
|