@abgov/react-components 5.2.0 → 5.4.0
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/experimental/form/form-summary.d.ts +9 -0
- package/experimental/form/form.d.ts +35 -0
- package/experimental/form/task-list.d.ts +18 -0
- package/experimental/form/task.d.ts +18 -0
- package/experimental/form-hook.d.ts +8 -0
- package/experimental/index.d.ts +2 -0
- package/experimental/resizable-panel/ResizablePanel.d.ts +7 -0
- package/experimental/validators.d.ts +50 -0
- package/experimental.js +123 -0
- package/experimental.js.map +1 -0
- package/experimental.mjs +123 -0
- package/experimental.mjs.map +1 -0
- package/icon-1IRcN4Uf.js +38 -0
- package/icon-1IRcN4Uf.js.map +1 -0
- package/icon-DgSW1II3.mjs +39 -0
- package/icon-DgSW1II3.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +102 -49
- package/index.js.map +1 -1
- package/index.mjs +90 -37
- package/index.mjs.map +1 -1
- package/lib/accordion/accordion.d.ts +7 -2
- package/lib/app-header/app-header.d.ts +4 -1
- package/lib/button/button.d.ts +3 -1
- package/lib/callout/callout.d.ts +4 -1
- package/lib/card/card-actions.d.ts +12 -0
- package/lib/card/card-content.d.ts +12 -0
- package/lib/card/card-group.d.ts +12 -0
- package/lib/card/card-image.d.ts +17 -0
- package/lib/card/card.d.ts +21 -0
- package/lib/card/index.d.ts +5 -0
- package/lib/drawer/drawer.d.ts +30 -0
- package/lib/filter-chip/filter-chip.d.ts +24 -0
- package/lib/side-menu-group/side-menu-group.d.ts +6 -2
- package/lib/textarea/textarea.d.ts +3 -1
- package/package.json +6 -1
- package/style.css +49 -0
package/index.js
CHANGED
|
@@ -2,27 +2,46 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
+
const icon = require("./icon-1IRcN4Uf.js");
|
|
5
6
|
function GoAAccordion({
|
|
6
7
|
open,
|
|
7
8
|
heading,
|
|
8
9
|
headingSize,
|
|
9
10
|
secondaryText,
|
|
10
11
|
headingContent,
|
|
12
|
+
iconPosition,
|
|
11
13
|
maxWidth,
|
|
12
14
|
testid,
|
|
15
|
+
onChange,
|
|
13
16
|
children,
|
|
14
17
|
mt,
|
|
15
18
|
mr,
|
|
16
19
|
mb,
|
|
17
20
|
ml
|
|
18
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]);
|
|
19
36
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20
37
|
"goa-accordion",
|
|
21
38
|
{
|
|
39
|
+
ref,
|
|
22
40
|
open,
|
|
23
41
|
headingSize,
|
|
24
42
|
heading,
|
|
25
43
|
secondaryText,
|
|
44
|
+
iconposition: iconPosition,
|
|
26
45
|
maxwidth: maxWidth,
|
|
27
46
|
testid,
|
|
28
47
|
mt,
|
|
@@ -42,16 +61,36 @@ function GoAAppHeader({
|
|
|
42
61
|
maxContentWidth,
|
|
43
62
|
fullMenuBreakpoint,
|
|
44
63
|
testId,
|
|
45
|
-
children
|
|
64
|
+
children,
|
|
65
|
+
onMenuClick
|
|
46
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]);
|
|
47
84
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
85
|
"goa-app-header",
|
|
49
86
|
{
|
|
87
|
+
ref: el,
|
|
50
88
|
heading,
|
|
51
89
|
url,
|
|
52
90
|
fullmenubreakpoint: fullMenuBreakpoint,
|
|
53
91
|
maxcontentwidth: maxContentWidth,
|
|
54
92
|
testid: testId,
|
|
93
|
+
hasmenuclickhandler: !!onMenuClick,
|
|
55
94
|
children
|
|
56
95
|
}
|
|
57
96
|
);
|
|
@@ -70,7 +109,7 @@ function GoAAppHeaderMenu(props) {
|
|
|
70
109
|
function GoABadge({
|
|
71
110
|
type,
|
|
72
111
|
content,
|
|
73
|
-
icon,
|
|
112
|
+
icon: icon2,
|
|
74
113
|
testId,
|
|
75
114
|
mt,
|
|
76
115
|
mr,
|
|
@@ -83,7 +122,7 @@ function GoABadge({
|
|
|
83
122
|
{
|
|
84
123
|
type,
|
|
85
124
|
content,
|
|
86
|
-
icon,
|
|
125
|
+
icon: icon2,
|
|
87
126
|
testid: testId,
|
|
88
127
|
arialabel: ariaLabel,
|
|
89
128
|
mt,
|
|
@@ -96,7 +135,7 @@ function GoABadge({
|
|
|
96
135
|
function GoAInfoBadge({
|
|
97
136
|
content,
|
|
98
137
|
testId,
|
|
99
|
-
icon,
|
|
138
|
+
icon: icon2,
|
|
100
139
|
mt,
|
|
101
140
|
mr,
|
|
102
141
|
mb,
|
|
@@ -107,7 +146,7 @@ function GoAInfoBadge({
|
|
|
107
146
|
GoABadge,
|
|
108
147
|
{
|
|
109
148
|
type: "information",
|
|
110
|
-
icon,
|
|
149
|
+
icon: icon2,
|
|
111
150
|
content,
|
|
112
151
|
testId,
|
|
113
152
|
ariaLabel,
|
|
@@ -121,7 +160,7 @@ function GoAInfoBadge({
|
|
|
121
160
|
function GoASuccessBadge({
|
|
122
161
|
content,
|
|
123
162
|
testId,
|
|
124
|
-
icon,
|
|
163
|
+
icon: icon2,
|
|
125
164
|
mt,
|
|
126
165
|
mr,
|
|
127
166
|
mb,
|
|
@@ -132,7 +171,7 @@ function GoASuccessBadge({
|
|
|
132
171
|
GoABadge,
|
|
133
172
|
{
|
|
134
173
|
type: "success",
|
|
135
|
-
icon,
|
|
174
|
+
icon: icon2,
|
|
136
175
|
content,
|
|
137
176
|
ariaLabel,
|
|
138
177
|
testId,
|
|
@@ -146,7 +185,7 @@ function GoASuccessBadge({
|
|
|
146
185
|
function GoAImportantBadge({
|
|
147
186
|
content,
|
|
148
187
|
testId,
|
|
149
|
-
icon,
|
|
188
|
+
icon: icon2,
|
|
150
189
|
mt,
|
|
151
190
|
mr,
|
|
152
191
|
mb,
|
|
@@ -157,7 +196,7 @@ function GoAImportantBadge({
|
|
|
157
196
|
GoABadge,
|
|
158
197
|
{
|
|
159
198
|
type: "important",
|
|
160
|
-
icon,
|
|
199
|
+
icon: icon2,
|
|
161
200
|
content,
|
|
162
201
|
testId,
|
|
163
202
|
ariaLabel,
|
|
@@ -171,7 +210,7 @@ function GoAImportantBadge({
|
|
|
171
210
|
function GoAEmergencyBadge({
|
|
172
211
|
content,
|
|
173
212
|
testId,
|
|
174
|
-
icon,
|
|
213
|
+
icon: icon2,
|
|
175
214
|
mt,
|
|
176
215
|
mr,
|
|
177
216
|
mb,
|
|
@@ -182,7 +221,7 @@ function GoAEmergencyBadge({
|
|
|
182
221
|
GoABadge,
|
|
183
222
|
{
|
|
184
223
|
type: "emergency",
|
|
185
|
-
icon,
|
|
224
|
+
icon: icon2,
|
|
186
225
|
content,
|
|
187
226
|
testId,
|
|
188
227
|
ariaLabel,
|
|
@@ -216,6 +255,7 @@ function GoAButton({
|
|
|
216
255
|
variant,
|
|
217
256
|
leadingIcon,
|
|
218
257
|
trailingIcon,
|
|
258
|
+
width,
|
|
219
259
|
testId,
|
|
220
260
|
children,
|
|
221
261
|
onClick,
|
|
@@ -251,6 +291,7 @@ function GoAButton({
|
|
|
251
291
|
disabled,
|
|
252
292
|
leadingicon: leadingIcon,
|
|
253
293
|
trailingicon: trailingIcon,
|
|
294
|
+
width,
|
|
254
295
|
testid: testId,
|
|
255
296
|
mt,
|
|
256
297
|
mr,
|
|
@@ -325,6 +366,7 @@ function GoACalendar({
|
|
|
325
366
|
const GoACallout = ({
|
|
326
367
|
heading,
|
|
327
368
|
type = "information",
|
|
369
|
+
iconTheme = "outline",
|
|
328
370
|
size = "large",
|
|
329
371
|
maxWidth,
|
|
330
372
|
testId,
|
|
@@ -343,6 +385,7 @@ const GoACallout = ({
|
|
|
343
385
|
size,
|
|
344
386
|
maxwidth: maxWidth,
|
|
345
387
|
arialive: ariaLive,
|
|
388
|
+
icontheme: iconTheme,
|
|
346
389
|
mt,
|
|
347
390
|
mr,
|
|
348
391
|
mb,
|
|
@@ -652,7 +695,7 @@ function GoADropdownOption(props) {
|
|
|
652
695
|
}, []);
|
|
653
696
|
return /* @__PURE__ */ jsxRuntime.jsx(GoADropdownItem, { ...props });
|
|
654
697
|
}
|
|
655
|
-
function GoADropdownItem({ value, label, filter, name, testId, mountType = "
|
|
698
|
+
function GoADropdownItem({ value, label, filter, name, testId, mountType = "reset" }) {
|
|
656
699
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
657
700
|
"goa-dropdown-item",
|
|
658
701
|
{
|
|
@@ -946,7 +989,7 @@ function GoAHeroBannerActions({
|
|
|
946
989
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children });
|
|
947
990
|
}
|
|
948
991
|
function GoAIconButton({
|
|
949
|
-
icon,
|
|
992
|
+
icon: icon2,
|
|
950
993
|
disabled,
|
|
951
994
|
variant = "color",
|
|
952
995
|
onClick,
|
|
@@ -981,7 +1024,7 @@ function GoAIconButton({
|
|
|
981
1024
|
"goa-icon-button",
|
|
982
1025
|
{
|
|
983
1026
|
ref,
|
|
984
|
-
icon,
|
|
1027
|
+
icon: icon2,
|
|
985
1028
|
disabled,
|
|
986
1029
|
variant,
|
|
987
1030
|
size,
|
|
@@ -996,40 +1039,6 @@ function GoAIconButton({
|
|
|
996
1039
|
}
|
|
997
1040
|
);
|
|
998
1041
|
}
|
|
999
|
-
function GoAIcon({
|
|
1000
|
-
type,
|
|
1001
|
-
theme,
|
|
1002
|
-
size,
|
|
1003
|
-
inverted,
|
|
1004
|
-
fillColor,
|
|
1005
|
-
opacity,
|
|
1006
|
-
title,
|
|
1007
|
-
ariaLabel,
|
|
1008
|
-
mt,
|
|
1009
|
-
mr,
|
|
1010
|
-
mb,
|
|
1011
|
-
ml,
|
|
1012
|
-
testId
|
|
1013
|
-
}) {
|
|
1014
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1015
|
-
"goa-icon",
|
|
1016
|
-
{
|
|
1017
|
-
type,
|
|
1018
|
-
theme,
|
|
1019
|
-
size,
|
|
1020
|
-
inverted,
|
|
1021
|
-
fillcolor: fillColor,
|
|
1022
|
-
opacity,
|
|
1023
|
-
title,
|
|
1024
|
-
arialabel: ariaLabel,
|
|
1025
|
-
mt,
|
|
1026
|
-
mr,
|
|
1027
|
-
mb,
|
|
1028
|
-
ml,
|
|
1029
|
-
testid: testId
|
|
1030
|
-
}
|
|
1031
|
-
);
|
|
1032
|
-
}
|
|
1033
1042
|
function toDate(argument) {
|
|
1034
1043
|
const argStr = Object.prototype.toString.call(argument);
|
|
1035
1044
|
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
|
|
@@ -3251,7 +3260,12 @@ function GoASideMenuGroup(props) {
|
|
|
3251
3260
|
"goa-side-menu-group",
|
|
3252
3261
|
{
|
|
3253
3262
|
heading: props.heading,
|
|
3263
|
+
icon: props.icon,
|
|
3254
3264
|
testid: props.testId,
|
|
3265
|
+
mt: props.mt,
|
|
3266
|
+
mr: props.mr,
|
|
3267
|
+
mb: props.mb,
|
|
3268
|
+
ml: props.ml,
|
|
3255
3269
|
children: props.children
|
|
3256
3270
|
}
|
|
3257
3271
|
);
|
|
@@ -3413,6 +3427,7 @@ function GoATextarea({
|
|
|
3413
3427
|
value,
|
|
3414
3428
|
placeholder,
|
|
3415
3429
|
rows,
|
|
3430
|
+
readOnly,
|
|
3416
3431
|
disabled,
|
|
3417
3432
|
countBy,
|
|
3418
3433
|
maxCount,
|
|
@@ -3465,6 +3480,7 @@ function GoATextarea({
|
|
|
3465
3480
|
placeholder,
|
|
3466
3481
|
value,
|
|
3467
3482
|
rows,
|
|
3483
|
+
readOnly,
|
|
3468
3484
|
disabled,
|
|
3469
3485
|
countby: countBy,
|
|
3470
3486
|
maxcount: maxCount,
|
|
@@ -3529,6 +3545,43 @@ function GoATwoColumnLayout(props) {
|
|
|
3529
3545
|
}
|
|
3530
3546
|
);
|
|
3531
3547
|
}
|
|
3548
|
+
const GoAFilterChip = ({
|
|
3549
|
+
iconTheme = "outline",
|
|
3550
|
+
error = false,
|
|
3551
|
+
content,
|
|
3552
|
+
onClick,
|
|
3553
|
+
mt,
|
|
3554
|
+
mr,
|
|
3555
|
+
mb,
|
|
3556
|
+
ml,
|
|
3557
|
+
testId
|
|
3558
|
+
}) => {
|
|
3559
|
+
const el = react.useRef(null);
|
|
3560
|
+
react.useEffect(() => {
|
|
3561
|
+
if (!el.current) return;
|
|
3562
|
+
if (!onClick) return;
|
|
3563
|
+
const current = el.current;
|
|
3564
|
+
current.addEventListener("_click", onClick);
|
|
3565
|
+
return () => {
|
|
3566
|
+
current.removeEventListener("_click", onClick);
|
|
3567
|
+
};
|
|
3568
|
+
}, [el, onClick]);
|
|
3569
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3570
|
+
"goa-filter-chip",
|
|
3571
|
+
{
|
|
3572
|
+
ref: el,
|
|
3573
|
+
icontheme: iconTheme,
|
|
3574
|
+
error,
|
|
3575
|
+
content,
|
|
3576
|
+
mt,
|
|
3577
|
+
mr,
|
|
3578
|
+
mb,
|
|
3579
|
+
ml,
|
|
3580
|
+
"data-testid": testId
|
|
3581
|
+
}
|
|
3582
|
+
);
|
|
3583
|
+
};
|
|
3584
|
+
exports.GoAIcon = icon.GoAIcon;
|
|
3532
3585
|
exports.GoAAccordion = GoAAccordion;
|
|
3533
3586
|
exports.GoAAppFooter = GoAAppFooter;
|
|
3534
3587
|
exports.GoAAppFooterMetaSection = GoAAppFooterMetaSection;
|
|
@@ -3555,13 +3608,13 @@ exports.GoAEmergencyBadge = GoAEmergencyBadge;
|
|
|
3555
3608
|
exports.GoAFieldset = GoAFieldset;
|
|
3556
3609
|
exports.GoAFileUploadCard = GoAFileUploadCard;
|
|
3557
3610
|
exports.GoAFileUploadInput = GoAFileUploadInput;
|
|
3611
|
+
exports.GoAFilterChip = GoAFilterChip;
|
|
3558
3612
|
exports.GoAFormItem = GoAFormItem;
|
|
3559
3613
|
exports.GoAFormStep = GoAFormStep;
|
|
3560
3614
|
exports.GoAFormStepper = GoAFormStepper;
|
|
3561
3615
|
exports.GoAGrid = GoAGrid;
|
|
3562
3616
|
exports.GoAHeroBanner = GoAHeroBanner;
|
|
3563
3617
|
exports.GoAHeroBannerActions = GoAHeroBannerActions;
|
|
3564
|
-
exports.GoAIcon = GoAIcon;
|
|
3565
3618
|
exports.GoAIconButton = GoAIconButton;
|
|
3566
3619
|
exports.GoAImportantBadge = GoAImportantBadge;
|
|
3567
3620
|
exports.GoAInfoBadge = GoAInfoBadge;
|