@abgov/react-components 7.5.0 → 8.0.0-dev.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/README.md +2 -4
- package/index.js +22 -73
- package/index.js.map +1 -1
- package/index.mjs +22 -73
- package/index.mjs.map +1 -1
- package/lib/accordion/accordion.d.ts +3 -3
- package/lib/app-header/app-header.d.ts +2 -11
- package/lib/badge/badge.d.ts +0 -1
- package/lib/button/button.d.ts +0 -1
- package/lib/button-group/button-group.d.ts +3 -3
- package/lib/calendar/calendar.d.ts +0 -1
- package/lib/callout/callout.d.ts +2 -6
- package/lib/checkbox/checkbox.d.ts +4 -5
- package/lib/checkbox-list/checkbox-list.d.ts +7 -5
- package/lib/data-grid/data-grid.d.ts +2 -2
- package/lib/date-picker/date-picker.d.ts +0 -1
- package/lib/drawer/drawer.d.ts +1 -2
- package/lib/dropdown/dropdown-item.d.ts +1 -1
- package/lib/dropdown/dropdown.d.ts +2 -3
- package/lib/file-upload-card/file-upload-card.d.ts +0 -1
- package/lib/file-upload-input/file-upload-input.d.ts +0 -1
- package/lib/filter-chip/filter-chip.d.ts +0 -1
- package/lib/footer/footer.d.ts +0 -4
- package/lib/form-item/form-item.d.ts +0 -1
- package/lib/input/input.d.ts +3 -4
- package/lib/modal/modal.d.ts +0 -1
- package/lib/notification/notification.d.ts +0 -1
- package/lib/pagination/pagination.d.ts +0 -1
- package/lib/push-drawer/push-drawer.d.ts +0 -1
- package/lib/radio-group/radio-group.d.ts +3 -4
- package/lib/radio-group/radio.d.ts +3 -4
- package/lib/side-menu/side-menu.d.ts +0 -1
- package/lib/side-menu-group/side-menu-group.d.ts +0 -1
- package/lib/side-menu-heading/side-menu-heading.d.ts +0 -1
- package/lib/table/table-sort-header.d.ts +0 -1
- package/lib/table/table.d.ts +0 -1
- package/lib/tabs/tabs.d.ts +0 -1
- package/lib/textarea/textarea.d.ts +4 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Supported React versions: 17, 18, and 19.
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm i @abgov/react-components @abgov/web-components @abgov/ui-components-common
|
|
12
|
+
npm i @abgov/react-components @abgov/web-components @abgov/ui-components-common
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Register the web components
|
|
@@ -23,12 +23,10 @@ import "@abgov/web-components";
|
|
|
23
23
|
|
|
24
24
|
## Add styles
|
|
25
25
|
|
|
26
|
-
Import the component styles
|
|
27
|
-
`src/index.css`:
|
|
26
|
+
Import the component styles in your main stylesheet, such as `src/index.css`. This stylesheet includes the design tokens and dark theme overrides:
|
|
28
27
|
|
|
29
28
|
```css
|
|
30
29
|
@import "@abgov/web-components/index.css";
|
|
31
|
-
@import "@abgov/design-tokens/dist/tokens.css";
|
|
32
30
|
```
|
|
33
31
|
|
|
34
32
|
## Add icons
|
package/index.js
CHANGED
|
@@ -78,7 +78,6 @@ function renderSlottedItems(children, slot) {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function GoabAppHeader({
|
|
81
|
-
onMenuClick,
|
|
82
81
|
children,
|
|
83
82
|
secondaryText,
|
|
84
83
|
banner,
|
|
@@ -87,41 +86,14 @@ function GoabAppHeader({
|
|
|
87
86
|
utilities,
|
|
88
87
|
...rest
|
|
89
88
|
}) {
|
|
90
|
-
const el = react.useRef(null);
|
|
91
89
|
const _props = transformProps(rest, lowercase);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const current = el.current;
|
|
100
|
-
const listener = () => {
|
|
101
|
-
onMenuClick == null ? void 0 : onMenuClick();
|
|
102
|
-
};
|
|
103
|
-
current.addEventListener("_menuClick", listener);
|
|
104
|
-
return () => {
|
|
105
|
-
current.removeEventListener("_menuClick", listener);
|
|
106
|
-
};
|
|
107
|
-
}, [el, onMenuClick]);
|
|
108
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
109
|
-
"goa-app-header",
|
|
110
|
-
{
|
|
111
|
-
ref: el,
|
|
112
|
-
hasmenuclickhandler: onMenuClick ? "true" : "false",
|
|
113
|
-
secondarytext: secondaryText,
|
|
114
|
-
..._props,
|
|
115
|
-
version: "2",
|
|
116
|
-
children: [
|
|
117
|
-
children,
|
|
118
|
-
banner && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "banner", children: banner }),
|
|
119
|
-
phase && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "phase", children: phase }),
|
|
120
|
-
navigation && renderSlottedItems(navigation, "navigation"),
|
|
121
|
-
utilities && renderSlottedItems(utilities, "utilities")
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
);
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("goa-app-header", { secondarytext: secondaryText, ..._props, children: [
|
|
91
|
+
children,
|
|
92
|
+
banner && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "banner", children: banner }),
|
|
93
|
+
phase && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "phase", children: phase }),
|
|
94
|
+
navigation && renderSlottedItems(navigation, "navigation"),
|
|
95
|
+
utilities && renderSlottedItems(utilities, "utilities")
|
|
96
|
+
] });
|
|
125
97
|
}
|
|
126
98
|
function GoabAppHeaderMenu({
|
|
127
99
|
children,
|
|
@@ -153,7 +125,6 @@ function GoabBadge({
|
|
|
153
125
|
icontype: iconType,
|
|
154
126
|
content: typeof content === "string" ? content : void 0,
|
|
155
127
|
..._props,
|
|
156
|
-
version: "2",
|
|
157
128
|
size,
|
|
158
129
|
emphasis,
|
|
159
130
|
children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
|
|
@@ -205,16 +176,16 @@ function GoabButton({
|
|
|
205
176
|
"action-args": JSON.stringify(actionArgs),
|
|
206
177
|
arialabel: ariaLabel || void 0,
|
|
207
178
|
..._props,
|
|
208
|
-
version: "2",
|
|
209
179
|
children
|
|
210
180
|
}
|
|
211
181
|
);
|
|
212
182
|
}
|
|
213
183
|
function GoabButtonGroup({
|
|
214
184
|
children,
|
|
185
|
+
alignment = "start",
|
|
215
186
|
...rest
|
|
216
187
|
}) {
|
|
217
|
-
const _props = transformProps(rest, lowercase);
|
|
188
|
+
const _props = transformProps({ alignment, ...rest }, lowercase);
|
|
218
189
|
return /* @__PURE__ */ jsxRuntime.jsx("goa-button-group", { ..._props, children });
|
|
219
190
|
}
|
|
220
191
|
function GoabCalendar({
|
|
@@ -249,7 +220,6 @@ function GoabCalendar({
|
|
|
249
220
|
name,
|
|
250
221
|
min: min || void 0,
|
|
251
222
|
max: max || void 0,
|
|
252
|
-
version: "2",
|
|
253
223
|
..._props
|
|
254
224
|
}
|
|
255
225
|
);
|
|
@@ -257,17 +227,16 @@ function GoabCalendar({
|
|
|
257
227
|
const GoabCallout = ({
|
|
258
228
|
type = "information",
|
|
259
229
|
iconTheme = "outline",
|
|
260
|
-
size = "large",
|
|
261
230
|
ariaLive = "off",
|
|
262
231
|
emphasis = "medium",
|
|
263
232
|
children,
|
|
264
233
|
...rest
|
|
265
234
|
}) => {
|
|
266
235
|
const _props = transformProps(
|
|
267
|
-
{ type, icontheme: iconTheme,
|
|
236
|
+
{ type, icontheme: iconTheme, arialive: ariaLive, emphasis, ...rest },
|
|
268
237
|
lowercase
|
|
269
238
|
);
|
|
270
|
-
return /* @__PURE__ */ jsxRuntime.jsx("goa-callout", { ..._props,
|
|
239
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-callout", { ..._props, children });
|
|
271
240
|
};
|
|
272
241
|
function GoabCheckbox({
|
|
273
242
|
error,
|
|
@@ -325,7 +294,6 @@ function GoabCheckbox({
|
|
|
325
294
|
disabled: disabled ? "true" : void 0,
|
|
326
295
|
value: typeof value === "boolean" ? value ? "true" : void 0 : value,
|
|
327
296
|
description: typeof description === "string" ? description : void 0,
|
|
328
|
-
version: "2",
|
|
329
297
|
children: [
|
|
330
298
|
children,
|
|
331
299
|
typeof description !== "string" && description && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "description", children: description }),
|
|
@@ -342,6 +310,7 @@ function GoabCheckboxList({
|
|
|
342
310
|
testId,
|
|
343
311
|
maxWidth,
|
|
344
312
|
size = "default",
|
|
313
|
+
ariaLabel,
|
|
345
314
|
children,
|
|
346
315
|
onChange,
|
|
347
316
|
onFocus,
|
|
@@ -386,8 +355,8 @@ function GoabCheckboxList({
|
|
|
386
355
|
error: error ? "true" : void 0,
|
|
387
356
|
testid: testId,
|
|
388
357
|
maxwidth: maxWidth,
|
|
389
|
-
version: "2",
|
|
390
358
|
size,
|
|
359
|
+
arialabel: ariaLabel,
|
|
391
360
|
mt,
|
|
392
361
|
mr,
|
|
393
362
|
mb,
|
|
@@ -459,7 +428,7 @@ function GoabContainer({
|
|
|
459
428
|
function GoabDataGrid({
|
|
460
429
|
keyboardIconVisibility = "visible",
|
|
461
430
|
keyboardIconPosition = "left",
|
|
462
|
-
keyboardNav,
|
|
431
|
+
keyboardNav = "table",
|
|
463
432
|
children
|
|
464
433
|
}) {
|
|
465
434
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2734,7 +2703,6 @@ function GoabDatePicker({
|
|
|
2734
2703
|
min: formatValue(min) || void 0,
|
|
2735
2704
|
max: formatValue(max) || void 0,
|
|
2736
2705
|
relative: relative ? "true" : void 0,
|
|
2737
|
-
version: "2",
|
|
2738
2706
|
..._props
|
|
2739
2707
|
}
|
|
2740
2708
|
);
|
|
@@ -2757,7 +2725,7 @@ function GoabDivider(props) {
|
|
|
2757
2725
|
}
|
|
2758
2726
|
function GoabDrawer({
|
|
2759
2727
|
position,
|
|
2760
|
-
open,
|
|
2728
|
+
open = false,
|
|
2761
2729
|
heading,
|
|
2762
2730
|
maxSize,
|
|
2763
2731
|
testId,
|
|
@@ -2791,7 +2759,6 @@ function GoabDrawer({
|
|
|
2791
2759
|
heading: typeof heading === "string" ? heading : void 0,
|
|
2792
2760
|
maxsize: maxSize,
|
|
2793
2761
|
testid: testId,
|
|
2794
|
-
version: "2",
|
|
2795
2762
|
children: [
|
|
2796
2763
|
heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
|
|
2797
2764
|
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
|
|
@@ -2868,7 +2835,6 @@ function GoabDropdown({
|
|
|
2868
2835
|
native: native ? "true" : void 0,
|
|
2869
2836
|
relative: relative ? "true" : void 0,
|
|
2870
2837
|
..._props,
|
|
2871
|
-
version: "2",
|
|
2872
2838
|
children
|
|
2873
2839
|
}
|
|
2874
2840
|
);
|
|
@@ -2982,7 +2948,7 @@ function GoabFileUploadCard({
|
|
|
2982
2948
|
current.removeEventListener("_cancel", cancelHandler);
|
|
2983
2949
|
};
|
|
2984
2950
|
}, [el, onDelete, onCancel, filename]);
|
|
2985
|
-
return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-card", { ref: el, ..._props
|
|
2951
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-card", { ref: el, ..._props });
|
|
2986
2952
|
}
|
|
2987
2953
|
function GoabFileUploadInput({ onSelectFile, ...rest }) {
|
|
2988
2954
|
const el = react.useRef(null);
|
|
@@ -2999,11 +2965,11 @@ function GoabFileUploadInput({ onSelectFile, ...rest }) {
|
|
|
2999
2965
|
current.removeEventListener("_selectFile", handler);
|
|
3000
2966
|
};
|
|
3001
2967
|
}, [el, onSelectFile]);
|
|
3002
|
-
return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-input", { ref: el, ..._props
|
|
2968
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-input", { ref: el, ..._props });
|
|
3003
2969
|
}
|
|
3004
2970
|
function GoabAppFooter({ children, ...rest }) {
|
|
3005
2971
|
const _props = transformProps(rest, lowercase);
|
|
3006
|
-
return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props,
|
|
2972
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props, children });
|
|
3007
2973
|
}
|
|
3008
2974
|
function GoabAppFooterMetaSection({
|
|
3009
2975
|
children,
|
|
@@ -3213,7 +3179,6 @@ function GoabFormItem({
|
|
|
3213
3179
|
helptext: typeof helpText === "string" ? helpText : void 0,
|
|
3214
3180
|
"public-form-summary-order": publicFormSummaryOrder,
|
|
3215
3181
|
..._props,
|
|
3216
|
-
version: "2",
|
|
3217
3182
|
children: [
|
|
3218
3183
|
error && typeof error !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "error", children: error }),
|
|
3219
3184
|
helpText && typeof helpText !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "helptext", children: helpText }),
|
|
@@ -3443,7 +3408,6 @@ function GoabInput({
|
|
|
3443
3408
|
readonly: readonly ? "true" : void 0,
|
|
3444
3409
|
error: error ? "true" : void 0,
|
|
3445
3410
|
handletrailingiconclick: onTrailingIconClick ? "true" : "false",
|
|
3446
|
-
version: "2",
|
|
3447
3411
|
children: [
|
|
3448
3412
|
leadingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "leadingContent", children: leadingContent }),
|
|
3449
3413
|
trailingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "trailingContent", children: trailingContent })
|
|
@@ -3686,10 +3650,7 @@ function GoabMenuButton({
|
|
|
3686
3650
|
current.removeEventListener("_action", listener);
|
|
3687
3651
|
};
|
|
3688
3652
|
}, [el, onAction]);
|
|
3689
|
-
return (
|
|
3690
|
-
// @ts-expect-error - stable WCProps requires text, but experimental supports icon-only mode
|
|
3691
|
-
/* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, version: "2", ref: el, children })
|
|
3692
|
-
);
|
|
3653
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, ref: el, children });
|
|
3693
3654
|
}
|
|
3694
3655
|
function GoabMenuAction(props) {
|
|
3695
3656
|
const _props = transformProps(props, lowercase);
|
|
@@ -3777,7 +3738,6 @@ function GoabModal({
|
|
|
3777
3738
|
transition,
|
|
3778
3739
|
calloutvariant: calloutVariant,
|
|
3779
3740
|
testid: testId,
|
|
3780
|
-
version: "2",
|
|
3781
3741
|
children: [
|
|
3782
3742
|
heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
|
|
3783
3743
|
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
|
|
@@ -3820,7 +3780,6 @@ const GoabNotification = ({
|
|
|
3820
3780
|
arialive: ariaLive,
|
|
3821
3781
|
emphasis,
|
|
3822
3782
|
compact: compact ? "true" : void 0,
|
|
3823
|
-
version: "2",
|
|
3824
3783
|
children
|
|
3825
3784
|
}
|
|
3826
3785
|
);
|
|
@@ -3872,8 +3831,7 @@ function GoabPagination({ onChange, ...props }) {
|
|
|
3872
3831
|
mb: props.mb,
|
|
3873
3832
|
ml: props.ml,
|
|
3874
3833
|
mr: props.mr,
|
|
3875
|
-
testid: props.testId
|
|
3876
|
-
version: "2"
|
|
3834
|
+
testid: props.testId
|
|
3877
3835
|
}
|
|
3878
3836
|
);
|
|
3879
3837
|
}
|
|
@@ -3932,7 +3890,6 @@ function GoabPushDrawer({
|
|
|
3932
3890
|
heading: typeof heading === "string" ? heading : void 0,
|
|
3933
3891
|
width,
|
|
3934
3892
|
testid: testId,
|
|
3935
|
-
version: "2",
|
|
3936
3893
|
children: [
|
|
3937
3894
|
heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
|
|
3938
3895
|
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
|
|
@@ -3978,7 +3935,6 @@ function GoabRadioItem({
|
|
|
3978
3935
|
mr,
|
|
3979
3936
|
mb,
|
|
3980
3937
|
ml,
|
|
3981
|
-
version: "2",
|
|
3982
3938
|
children: [
|
|
3983
3939
|
description && typeof description !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "description", children: description }),
|
|
3984
3940
|
reveal && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "reveal", children: reveal }),
|
|
@@ -4036,7 +3992,6 @@ function GoabRadioGroup({
|
|
|
4036
3992
|
name,
|
|
4037
3993
|
disabled: disabled ? "true" : void 0,
|
|
4038
3994
|
error: error ? "true" : void 0,
|
|
4039
|
-
version: "2",
|
|
4040
3995
|
children
|
|
4041
3996
|
}
|
|
4042
3997
|
);
|
|
@@ -4061,7 +4016,6 @@ function GoabSideMenuGroup({
|
|
|
4061
4016
|
mr,
|
|
4062
4017
|
mb,
|
|
4063
4018
|
ml,
|
|
4064
|
-
version: "2",
|
|
4065
4019
|
children
|
|
4066
4020
|
}
|
|
4067
4021
|
);
|
|
@@ -4072,13 +4026,13 @@ function GoabSideMenuHeading({
|
|
|
4072
4026
|
icon,
|
|
4073
4027
|
children
|
|
4074
4028
|
}) {
|
|
4075
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("goa-side-menu-heading", { icon, testid: testId,
|
|
4029
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("goa-side-menu-heading", { icon, testid: testId, children: [
|
|
4076
4030
|
children,
|
|
4077
4031
|
meta && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "meta", children: meta })
|
|
4078
4032
|
] });
|
|
4079
4033
|
}
|
|
4080
4034
|
function GoabSideMenu({ testId, children }) {
|
|
4081
|
-
return /* @__PURE__ */ jsxRuntime.jsx("goa-side-menu", { testid: testId,
|
|
4035
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-side-menu", { testid: testId, children });
|
|
4082
4036
|
}
|
|
4083
4037
|
const GoabSkeleton = ({
|
|
4084
4038
|
maxWidth,
|
|
@@ -4195,7 +4149,6 @@ function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
|
|
|
4195
4149
|
mb: props.mb,
|
|
4196
4150
|
ml: props.ml,
|
|
4197
4151
|
mr: props.mr,
|
|
4198
|
-
version: "2",
|
|
4199
4152
|
children: /* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%" }, children: props.children })
|
|
4200
4153
|
}
|
|
4201
4154
|
);
|
|
@@ -4213,7 +4166,6 @@ function GoabTableSortHeader({
|
|
|
4213
4166
|
name,
|
|
4214
4167
|
direction,
|
|
4215
4168
|
"sort-order": sortOrder,
|
|
4216
|
-
version: "2",
|
|
4217
4169
|
...rest,
|
|
4218
4170
|
children
|
|
4219
4171
|
}
|
|
@@ -4249,7 +4201,6 @@ function GoabTabs({
|
|
|
4249
4201
|
initialtab: initialTab,
|
|
4250
4202
|
testid: testId,
|
|
4251
4203
|
variant,
|
|
4252
|
-
version: "2",
|
|
4253
4204
|
orientation,
|
|
4254
4205
|
navigation,
|
|
4255
4206
|
children
|
|
@@ -4347,7 +4298,6 @@ function GoabTextArea({
|
|
|
4347
4298
|
readOnly: readOnly ? "true" : void 0,
|
|
4348
4299
|
disabled: disabled ? "true" : void 0,
|
|
4349
4300
|
error: error ? "true" : void 0,
|
|
4350
|
-
version: "2",
|
|
4351
4301
|
..._props
|
|
4352
4302
|
}
|
|
4353
4303
|
);
|
|
@@ -4421,7 +4371,6 @@ const GoabFilterChip = ({
|
|
|
4421
4371
|
ref: el,
|
|
4422
4372
|
content: typeof content === "string" ? content : void 0,
|
|
4423
4373
|
error: error ? "true" : void 0,
|
|
4424
|
-
version: "2",
|
|
4425
4374
|
..._props,
|
|
4426
4375
|
children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
|
|
4427
4376
|
}
|