@abgov/react-components 7.4.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.
Files changed (41) hide show
  1. package/README.md +2 -4
  2. package/index.js +26 -74
  3. package/index.js.map +1 -1
  4. package/index.mjs +26 -74
  5. package/index.mjs.map +1 -1
  6. package/lib/accordion/accordion.d.ts +3 -3
  7. package/lib/app-header/app-header.d.ts +2 -11
  8. package/lib/badge/badge.d.ts +0 -1
  9. package/lib/button/button.d.ts +5 -3
  10. package/lib/button-group/button-group.d.ts +3 -3
  11. package/lib/calendar/calendar.d.ts +0 -1
  12. package/lib/callout/callout.d.ts +2 -6
  13. package/lib/checkbox/checkbox.d.ts +4 -5
  14. package/lib/checkbox-list/checkbox-list.d.ts +7 -5
  15. package/lib/data-grid/data-grid.d.ts +2 -2
  16. package/lib/date-picker/date-picker.d.ts +3 -4
  17. package/lib/drawer/drawer.d.ts +1 -2
  18. package/lib/dropdown/dropdown-item.d.ts +1 -1
  19. package/lib/dropdown/dropdown.d.ts +5 -3
  20. package/lib/file-upload-card/file-upload-card.d.ts +0 -1
  21. package/lib/file-upload-input/file-upload-input.d.ts +0 -1
  22. package/lib/filter-chip/filter-chip.d.ts +0 -1
  23. package/lib/footer/footer.d.ts +0 -4
  24. package/lib/form-item/form-item.d.ts +0 -1
  25. package/lib/icon/icon.d.ts +4 -1
  26. package/lib/input/input.d.ts +6 -4
  27. package/lib/modal/modal.d.ts +0 -1
  28. package/lib/notification/notification.d.ts +0 -1
  29. package/lib/pagination/pagination.d.ts +0 -1
  30. package/lib/push-drawer/push-drawer.d.ts +0 -1
  31. package/lib/radio-group/radio-group.d.ts +3 -4
  32. package/lib/radio-group/radio.d.ts +3 -4
  33. package/lib/side-menu/side-menu.d.ts +0 -1
  34. package/lib/side-menu-group/side-menu-group.d.ts +0 -1
  35. package/lib/side-menu-heading/side-menu-heading.d.ts +0 -1
  36. package/lib/table/table-sort-header.d.ts +0 -1
  37. package/lib/table/table.d.ts +0 -1
  38. package/lib/tabs/tabs.d.ts +0 -1
  39. package/lib/text/text.d.ts +1 -1
  40. package/lib/textarea/textarea.d.ts +4 -5
  41. 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 @abgov/design-tokens
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 and design tokens in your main stylesheet, such as
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
- react.useEffect(() => {
93
- if (!el.current) {
94
- return;
95
- }
96
- if (!onMenuClick) {
97
- return;
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 })
@@ -174,6 +145,7 @@ function GoabButton({
174
145
  onClick,
175
146
  actionArgs,
176
147
  actionArg,
148
+ ariaLabel,
177
149
  children,
178
150
  ...rest
179
151
  }) {
@@ -202,17 +174,18 @@ function GoabButton({
202
174
  disabled: disabled ? "true" : void 0,
203
175
  "action-arg": actionArg,
204
176
  "action-args": JSON.stringify(actionArgs),
177
+ arialabel: ariaLabel || void 0,
205
178
  ..._props,
206
- version: "2",
207
179
  children
208
180
  }
209
181
  );
210
182
  }
211
183
  function GoabButtonGroup({
212
184
  children,
185
+ alignment = "start",
213
186
  ...rest
214
187
  }) {
215
- const _props = transformProps(rest, lowercase);
188
+ const _props = transformProps({ alignment, ...rest }, lowercase);
216
189
  return /* @__PURE__ */ jsxRuntime.jsx("goa-button-group", { ..._props, children });
217
190
  }
218
191
  function GoabCalendar({
@@ -247,7 +220,6 @@ function GoabCalendar({
247
220
  name,
248
221
  min: min || void 0,
249
222
  max: max || void 0,
250
- version: "2",
251
223
  ..._props
252
224
  }
253
225
  );
@@ -255,17 +227,16 @@ function GoabCalendar({
255
227
  const GoabCallout = ({
256
228
  type = "information",
257
229
  iconTheme = "outline",
258
- size = "large",
259
230
  ariaLive = "off",
260
231
  emphasis = "medium",
261
232
  children,
262
233
  ...rest
263
234
  }) => {
264
235
  const _props = transformProps(
265
- { type, icontheme: iconTheme, size, arialive: ariaLive, emphasis, ...rest },
236
+ { type, icontheme: iconTheme, arialive: ariaLive, emphasis, ...rest },
266
237
  lowercase
267
238
  );
268
- return /* @__PURE__ */ jsxRuntime.jsx("goa-callout", { ..._props, version: "2", children });
239
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-callout", { ..._props, children });
269
240
  };
270
241
  function GoabCheckbox({
271
242
  error,
@@ -323,7 +294,6 @@ function GoabCheckbox({
323
294
  disabled: disabled ? "true" : void 0,
324
295
  value: typeof value === "boolean" ? value ? "true" : void 0 : value,
325
296
  description: typeof description === "string" ? description : void 0,
326
- version: "2",
327
297
  children: [
328
298
  children,
329
299
  typeof description !== "string" && description && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "description", children: description }),
@@ -340,6 +310,7 @@ function GoabCheckboxList({
340
310
  testId,
341
311
  maxWidth,
342
312
  size = "default",
313
+ ariaLabel,
343
314
  children,
344
315
  onChange,
345
316
  onFocus,
@@ -384,8 +355,8 @@ function GoabCheckboxList({
384
355
  error: error ? "true" : void 0,
385
356
  testid: testId,
386
357
  maxwidth: maxWidth,
387
- version: "2",
388
358
  size,
359
+ arialabel: ariaLabel,
389
360
  mt,
390
361
  mr,
391
362
  mb,
@@ -457,7 +428,7 @@ function GoabContainer({
457
428
  function GoabDataGrid({
458
429
  keyboardIconVisibility = "visible",
459
430
  keyboardIconPosition = "left",
460
- keyboardNav,
431
+ keyboardNav = "table",
461
432
  children
462
433
  }) {
463
434
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2732,7 +2703,6 @@ function GoabDatePicker({
2732
2703
  min: formatValue(min) || void 0,
2733
2704
  max: formatValue(max) || void 0,
2734
2705
  relative: relative ? "true" : void 0,
2735
- version: "2",
2736
2706
  ..._props
2737
2707
  }
2738
2708
  );
@@ -2755,7 +2725,7 @@ function GoabDivider(props) {
2755
2725
  }
2756
2726
  function GoabDrawer({
2757
2727
  position,
2758
- open,
2728
+ open = false,
2759
2729
  heading,
2760
2730
  maxSize,
2761
2731
  testId,
@@ -2789,7 +2759,6 @@ function GoabDrawer({
2789
2759
  heading: typeof heading === "string" ? heading : void 0,
2790
2760
  maxsize: maxSize,
2791
2761
  testid: testId,
2792
- version: "2",
2793
2762
  children: [
2794
2763
  heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
2795
2764
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
@@ -2866,7 +2835,6 @@ function GoabDropdown({
2866
2835
  native: native ? "true" : void 0,
2867
2836
  relative: relative ? "true" : void 0,
2868
2837
  ..._props,
2869
- version: "2",
2870
2838
  children
2871
2839
  }
2872
2840
  );
@@ -2980,7 +2948,7 @@ function GoabFileUploadCard({
2980
2948
  current.removeEventListener("_cancel", cancelHandler);
2981
2949
  };
2982
2950
  }, [el, onDelete, onCancel, filename]);
2983
- return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-card", { ref: el, ..._props, version: "2" });
2951
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-card", { ref: el, ..._props });
2984
2952
  }
2985
2953
  function GoabFileUploadInput({ onSelectFile, ...rest }) {
2986
2954
  const el = react.useRef(null);
@@ -2997,11 +2965,11 @@ function GoabFileUploadInput({ onSelectFile, ...rest }) {
2997
2965
  current.removeEventListener("_selectFile", handler);
2998
2966
  };
2999
2967
  }, [el, onSelectFile]);
3000
- return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-input", { ref: el, ..._props, version: "2" });
2968
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-input", { ref: el, ..._props });
3001
2969
  }
3002
2970
  function GoabAppFooter({ children, ...rest }) {
3003
2971
  const _props = transformProps(rest, lowercase);
3004
- return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props, version: "2", children });
2972
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props, children });
3005
2973
  }
3006
2974
  function GoabAppFooterMetaSection({
3007
2975
  children,
@@ -3211,7 +3179,6 @@ function GoabFormItem({
3211
3179
  helptext: typeof helpText === "string" ? helpText : void 0,
3212
3180
  "public-form-summary-order": publicFormSummaryOrder,
3213
3181
  ..._props,
3214
- version: "2",
3215
3182
  children: [
3216
3183
  error && typeof error !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "error", children: error }),
3217
3184
  helpText && typeof helpText !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "helptext", children: helpText }),
@@ -3361,12 +3328,13 @@ function GoabIconButton({
3361
3328
  }
3362
3329
  );
3363
3330
  }
3364
- function GoabIcon({ inverted, ...rest }) {
3331
+ function GoabIcon({ inverted, ariaHidden, ...rest }) {
3365
3332
  const _props = transformProps(rest, lowercase);
3366
3333
  return /* @__PURE__ */ jsxRuntime.jsx(
3367
3334
  "goa-icon",
3368
3335
  {
3369
3336
  inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
3337
+ ariahidden: ariaHidden ? "true" : void 0,
3370
3338
  ..._props
3371
3339
  }
3372
3340
  );
@@ -3440,7 +3408,6 @@ function GoabInput({
3440
3408
  readonly: readonly ? "true" : void 0,
3441
3409
  error: error ? "true" : void 0,
3442
3410
  handletrailingiconclick: onTrailingIconClick ? "true" : "false",
3443
- version: "2",
3444
3411
  children: [
3445
3412
  leadingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "leadingContent", children: leadingContent }),
3446
3413
  trailingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "trailingContent", children: trailingContent })
@@ -3683,10 +3650,7 @@ function GoabMenuButton({
3683
3650
  current.removeEventListener("_action", listener);
3684
3651
  };
3685
3652
  }, [el, onAction]);
3686
- return (
3687
- // @ts-expect-error - stable WCProps requires text, but experimental supports icon-only mode
3688
- /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, version: "2", ref: el, children })
3689
- );
3653
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, ref: el, children });
3690
3654
  }
3691
3655
  function GoabMenuAction(props) {
3692
3656
  const _props = transformProps(props, lowercase);
@@ -3774,7 +3738,6 @@ function GoabModal({
3774
3738
  transition,
3775
3739
  calloutvariant: calloutVariant,
3776
3740
  testid: testId,
3777
- version: "2",
3778
3741
  children: [
3779
3742
  heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
3780
3743
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
@@ -3817,7 +3780,6 @@ const GoabNotification = ({
3817
3780
  arialive: ariaLive,
3818
3781
  emphasis,
3819
3782
  compact: compact ? "true" : void 0,
3820
- version: "2",
3821
3783
  children
3822
3784
  }
3823
3785
  );
@@ -3869,8 +3831,7 @@ function GoabPagination({ onChange, ...props }) {
3869
3831
  mb: props.mb,
3870
3832
  ml: props.ml,
3871
3833
  mr: props.mr,
3872
- testid: props.testId,
3873
- version: "2"
3834
+ testid: props.testId
3874
3835
  }
3875
3836
  );
3876
3837
  }
@@ -3929,7 +3890,6 @@ function GoabPushDrawer({
3929
3890
  heading: typeof heading === "string" ? heading : void 0,
3930
3891
  width,
3931
3892
  testid: testId,
3932
- version: "2",
3933
3893
  children: [
3934
3894
  heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
3935
3895
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
@@ -3975,7 +3935,6 @@ function GoabRadioItem({
3975
3935
  mr,
3976
3936
  mb,
3977
3937
  ml,
3978
- version: "2",
3979
3938
  children: [
3980
3939
  description && typeof description !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "description", children: description }),
3981
3940
  reveal && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "reveal", children: reveal }),
@@ -4033,7 +3992,6 @@ function GoabRadioGroup({
4033
3992
  name,
4034
3993
  disabled: disabled ? "true" : void 0,
4035
3994
  error: error ? "true" : void 0,
4036
- version: "2",
4037
3995
  children
4038
3996
  }
4039
3997
  );
@@ -4058,7 +4016,6 @@ function GoabSideMenuGroup({
4058
4016
  mr,
4059
4017
  mb,
4060
4018
  ml,
4061
- version: "2",
4062
4019
  children
4063
4020
  }
4064
4021
  );
@@ -4069,13 +4026,13 @@ function GoabSideMenuHeading({
4069
4026
  icon,
4070
4027
  children
4071
4028
  }) {
4072
- return /* @__PURE__ */ jsxRuntime.jsxs("goa-side-menu-heading", { icon, testid: testId, version: "2", children: [
4029
+ return /* @__PURE__ */ jsxRuntime.jsxs("goa-side-menu-heading", { icon, testid: testId, children: [
4073
4030
  children,
4074
4031
  meta && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "meta", children: meta })
4075
4032
  ] });
4076
4033
  }
4077
4034
  function GoabSideMenu({ testId, children }) {
4078
- return /* @__PURE__ */ jsxRuntime.jsx("goa-side-menu", { testid: testId, version: "2", children });
4035
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-side-menu", { testid: testId, children });
4079
4036
  }
4080
4037
  const GoabSkeleton = ({
4081
4038
  maxWidth,
@@ -4192,7 +4149,6 @@ function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
4192
4149
  mb: props.mb,
4193
4150
  ml: props.ml,
4194
4151
  mr: props.mr,
4195
- version: "2",
4196
4152
  children: /* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%" }, children: props.children })
4197
4153
  }
4198
4154
  );
@@ -4210,7 +4166,6 @@ function GoabTableSortHeader({
4210
4166
  name,
4211
4167
  direction,
4212
4168
  "sort-order": sortOrder,
4213
- version: "2",
4214
4169
  ...rest,
4215
4170
  children
4216
4171
  }
@@ -4246,7 +4201,6 @@ function GoabTabs({
4246
4201
  initialtab: initialTab,
4247
4202
  testid: testId,
4248
4203
  variant,
4249
- version: "2",
4250
4204
  orientation,
4251
4205
  navigation,
4252
4206
  children
@@ -4344,7 +4298,6 @@ function GoabTextArea({
4344
4298
  readOnly: readOnly ? "true" : void 0,
4345
4299
  disabled: disabled ? "true" : void 0,
4346
4300
  error: error ? "true" : void 0,
4347
- version: "2",
4348
4301
  ..._props
4349
4302
  }
4350
4303
  );
@@ -4418,7 +4371,6 @@ const GoabFilterChip = ({
4418
4371
  ref: el,
4419
4372
  content: typeof content === "string" ? content : void 0,
4420
4373
  error: error ? "true" : void 0,
4421
- version: "2",
4422
4374
  ..._props,
4423
4375
  children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
4424
4376
  }