braid-design-system 32.14.2 → 32.14.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 32.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - **Autosuggest:** Fix aria-label and aria-labelledby features ([#1420](https://github.com/seek-oss/braid-design-system/pull/1420))
8
+
9
+ Fixes an issue where the `aria-label` and `aria-labelledby` props provided by a consumer were being overidden internally by the `Autosuggest` component.
10
+
3
11
  ## 32.14.2
4
12
 
5
13
  ### Patch Changes
@@ -255,12 +255,8 @@ const createAccessbilityProps = ({
255
255
  isOpen
256
256
  }) => {
257
257
  const menuId = `${id}-menu`;
258
- const labelId = `${id}-label`;
259
258
  const assistiveDescriptionId = `${id}-aria-description`;
260
259
  return {
261
- labelProps: {
262
- id: labelId
263
- },
264
260
  inputProps: {
265
261
  id,
266
262
  role: "combobox",
@@ -269,7 +265,6 @@ const createAccessbilityProps = ({
269
265
  // backwards compatibility for screenreaders implementing ARIA 1.0
270
266
  "aria-controls": menuId,
271
267
  "aria-expanded": isOpen,
272
- "aria-labelledby": labelId,
273
268
  "aria-autocomplete": "list",
274
269
  "aria-activedescendant": typeof highlightedIndex === "number" ? getItemId(id, highlightedIndex) : void 0,
275
270
  "aria-describedby": assistiveDescriptionId,
@@ -775,7 +770,6 @@ const Autosuggest = React.forwardRef(function({
775
770
  {
776
771
  ...restProps,
777
772
  id,
778
- labelId: a11y.labelProps.id,
779
773
  value: value.text,
780
774
  prefix: void 0,
781
775
  secondaryIcon: onClear ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -251,12 +251,8 @@ const createAccessbilityProps = ({
251
251
  isOpen
252
252
  }) => {
253
253
  const menuId = `${id}-menu`;
254
- const labelId = `${id}-label`;
255
254
  const assistiveDescriptionId = `${id}-aria-description`;
256
255
  return {
257
- labelProps: {
258
- id: labelId
259
- },
260
256
  inputProps: {
261
257
  id,
262
258
  role: "combobox",
@@ -265,7 +261,6 @@ const createAccessbilityProps = ({
265
261
  // backwards compatibility for screenreaders implementing ARIA 1.0
266
262
  "aria-controls": menuId,
267
263
  "aria-expanded": isOpen,
268
- "aria-labelledby": labelId,
269
264
  "aria-autocomplete": "list",
270
265
  "aria-activedescendant": typeof highlightedIndex === "number" ? getItemId(id, highlightedIndex) : void 0,
271
266
  "aria-describedby": assistiveDescriptionId,
@@ -771,7 +766,6 @@ const Autosuggest = forwardRef(function({
771
766
  {
772
767
  ...restProps,
773
768
  id,
774
- labelId: a11y.labelProps.id,
775
769
  value: value.text,
776
770
  prefix: void 0,
777
771
  secondaryIcon: onClear ? /* @__PURE__ */ jsx(
@@ -23,7 +23,6 @@ const Dropdown = React.forwardRef(
23
23
  {
24
24
  ...restProps,
25
25
  disabled,
26
- labelId: void 0,
27
26
  prefix: void 0,
28
27
  secondaryMessage: null,
29
28
  value,
@@ -22,7 +22,6 @@ const Dropdown = forwardRef(
22
22
  {
23
23
  ...restProps,
24
24
  disabled,
25
- labelId: void 0,
26
25
  prefix: void 0,
27
26
  secondaryMessage: null,
28
27
  value,
@@ -274,7 +274,6 @@ const MonthPicker = ({
274
274
  ...restProps,
275
275
  icon: void 0,
276
276
  prefix: void 0,
277
- labelId: void 0,
278
277
  name: void 0,
279
278
  autoComplete: void 0,
280
279
  secondaryMessage: null,
@@ -271,7 +271,6 @@ const MonthPicker = ({
271
271
  ...restProps,
272
272
  icon: void 0,
273
273
  prefix: void 0,
274
- labelId: void 0,
275
274
  name: void 0,
276
275
  autoComplete: void 0,
277
276
  secondaryMessage: null,
@@ -112,7 +112,6 @@ const Textarea = React.forwardRef(
112
112
  value,
113
113
  icon: void 0,
114
114
  prefix: void 0,
115
- labelId: void 0,
116
115
  secondaryMessage: characterLimit ? getCharacterLimitStatus({
117
116
  value,
118
117
  characterLimit
@@ -109,7 +109,6 @@ const Textarea = forwardRef(
109
109
  value,
110
110
  icon: void 0,
111
111
  prefix: void 0,
112
- labelId: void 0,
113
112
  secondaryMessage: characterLimit ? getCharacterLimitStatus({
114
113
  value,
115
114
  characterLimit
@@ -19,7 +19,6 @@ const clsx__default = /* @__PURE__ */ _interopDefaultCompat(clsx);
19
19
  const Field = ({
20
20
  id,
21
21
  value,
22
- labelId,
23
22
  name,
24
23
  disabled,
25
24
  autoComplete,
@@ -76,7 +75,6 @@ const Field = ({
76
75
  hasVisualLabelOrDescription ? /* @__PURE__ */ jsxRuntime.jsx(
77
76
  styles_lib_components_MonthPicker_MonthPicker_cjs.FieldLabel,
78
77
  {
79
- id: labelId,
80
78
  htmlFor: id,
81
79
  label: "label" in restProps ? restProps.label : void 0,
82
80
  disabled,
@@ -15,7 +15,6 @@ import { useBackgroundLightness } from "../../Box/BackgroundContext.mjs";
15
15
  const Field = ({
16
16
  id,
17
17
  value,
18
- labelId,
19
18
  name,
20
19
  disabled,
21
20
  autoComplete,
@@ -72,7 +71,6 @@ const Field = ({
72
71
  hasVisualLabelOrDescription ? /* @__PURE__ */ jsx(
73
72
  FieldLabel,
74
73
  {
75
- id: labelId,
76
74
  htmlFor: id,
77
75
  label: "label" in restProps ? restProps.label : void 0,
78
76
  disabled,
@@ -630,7 +630,6 @@ const PasswordField = React.forwardRef(
630
630
  value,
631
631
  icon: void 0,
632
632
  prefix: void 0,
633
- labelId: void 0,
634
633
  disabled,
635
634
  secondaryMessage: null,
636
635
  alwaysShowSecondaryIcon: !disabled,
@@ -887,7 +886,6 @@ const TextField = React.forwardRef(
887
886
  ...restProps,
888
887
  id,
889
888
  value,
890
- labelId: void 0,
891
889
  secondaryMessage: characterLimit ? styles_lib_components_Textarea_Textarea_cjs.getCharacterLimitStatus({
892
890
  value,
893
891
  characterLimit
@@ -624,7 +624,6 @@ const PasswordField = forwardRef(
624
624
  value,
625
625
  icon: void 0,
626
626
  prefix: void 0,
627
- labelId: void 0,
628
627
  disabled,
629
628
  secondaryMessage: null,
630
629
  alwaysShowSecondaryIcon: !disabled,
@@ -881,7 +880,6 @@ const TextField = forwardRef(
881
880
  ...restProps,
882
881
  id,
883
882
  value,
884
- labelId: void 0,
885
883
  secondaryMessage: characterLimit ? getCharacterLimitStatus({
886
884
  value,
887
885
  characterLimit
@@ -2926,7 +2926,6 @@ type FieldLabelVariant$1 = {
2926
2926
  interface FieldBaseProps {
2927
2927
  id: NonNullable<FormElementProps$1['id']>;
2928
2928
  value?: FormElementProps$1['value'];
2929
- labelId?: string;
2930
2929
  name?: FormElementProps$1['name'];
2931
2930
  disabled?: FormElementProps$1['disabled'];
2932
2931
  autoComplete?: FormElementProps$1['autoComplete'];
@@ -2976,7 +2975,7 @@ interface LegacyMessageSuggestion {
2976
2975
  /** @deprecated Use `noSuggestionsMessage` prop instead */
2977
2976
  message: string;
2978
2977
  }
2979
- type AutosuggestBaseProps<Value> = Omit<FieldBaseProps, 'value' | 'autoComplete' | 'labelId' | 'prefix'> & {
2978
+ type AutosuggestBaseProps<Value> = Omit<FieldBaseProps, 'value' | 'autoComplete' | 'prefix'> & {
2980
2979
  value: AutosuggestValue<Value>;
2981
2980
  suggestions: Suggestions<Value> | LegacyMessageSuggestion | ((value: AutosuggestValue<Value>) => Suggestions<Value> | LegacyMessageSuggestion);
2982
2981
  noSuggestionsMessage?: string | {
@@ -3247,7 +3246,7 @@ declare const Drawer$1: ({ width, position, ...restProps }: DrawerProps) => JSX.
3247
3246
 
3248
3247
  type ValidDropdownChildren = AllHTMLAttributes<HTMLOptionElement | HTMLOptGroupElement>;
3249
3248
  type SelectProps = AllHTMLAttributes<HTMLSelectElement>;
3250
- type DropdownBaseProps = Omit<FieldBaseProps, 'value' | 'labelId' | 'secondaryMessage' | 'prefix'> & {
3249
+ type DropdownBaseProps = Omit<FieldBaseProps, 'value' | 'secondaryMessage' | 'prefix'> & {
3251
3250
  children: ValidDropdownChildren[] | ValidDropdownChildren;
3252
3251
  value: NonNullable<SelectProps['value']>;
3253
3252
  onChange: NonNullable<SelectProps['onChange']>;
@@ -3474,7 +3473,7 @@ type MonthNames = [
3474
3473
  ];
3475
3474
  type FocusHandler = () => void;
3476
3475
  type ChangeHandler$1 = (value: MonthPickerValue) => void;
3477
- type MonthPickerBaseProps = Omit<FieldGroupBaseProps, 'value' | 'labelId' | 'aria-describedby' | 'name' | 'autoComplete' | 'secondaryMessage' | 'autoFocus' | 'icon' | 'prefix'> & {
3476
+ type MonthPickerBaseProps = Omit<FieldGroupBaseProps, 'value' | 'aria-describedby' | 'name' | 'autoComplete' | 'secondaryMessage' | 'autoFocus' | 'icon' | 'prefix'> & {
3478
3477
  value: MonthPickerValue;
3479
3478
  onChange: ChangeHandler$1;
3480
3479
  onBlur?: FocusHandler;
@@ -3535,7 +3534,7 @@ interface PaginationProps {
3535
3534
  declare const Pagination$1: ({ page, total, linkProps, label, pageLabel, nextLabel, previousLabel, pageLimit, data, ...restProps }: PaginationProps) => JSX.Element;
3536
3535
 
3537
3536
  type InputProps$1 = AllHTMLAttributes<HTMLInputElement>;
3538
- type PasswordFieldBaseProps = Omit<FieldBaseProps, 'value' | 'labelId' | 'secondaryMessage' | 'icon' | 'prefix'> & {
3537
+ type PasswordFieldBaseProps = Omit<FieldBaseProps, 'value' | 'secondaryMessage' | 'icon' | 'prefix'> & {
3539
3538
  value: NonNullable<InputProps$1['value']>;
3540
3539
  onChange: NonNullable<InputProps$1['onChange']>;
3541
3540
  onBlur?: InputProps$1['onBlur'];
@@ -3703,7 +3702,7 @@ type TagProps = {
3703
3702
  declare const Tag$1: ({ onClear, clearLabel, data, id, icon, children, ...restProps }: TagProps) => JSX.Element;
3704
3703
 
3705
3704
  type NativeTextareaProps = AllHTMLAttributes<HTMLTextAreaElement>;
3706
- type TextareaBaseProps = Omit<FieldBaseProps, 'value' | 'labelId' | 'secondaryMessage' | 'icon' | 'prefix'> & {
3705
+ type TextareaBaseProps = Omit<FieldBaseProps, 'value' | 'secondaryMessage' | 'icon' | 'prefix'> & {
3707
3706
  value: NonNullable<NativeTextareaProps['value']>;
3708
3707
  onChange: NonNullable<NativeTextareaProps['onChange']>;
3709
3708
  onBlur?: NativeTextareaProps['onBlur'];
@@ -3750,7 +3749,7 @@ declare const validTypes: {
3750
3749
  url: string;
3751
3750
  };
3752
3751
  type InputProps = AllHTMLAttributes<HTMLInputElement>;
3753
- type TextFieldBaseProps = Omit<FieldBaseProps, 'value' | 'labelId' | 'secondaryMessage'> & {
3752
+ type TextFieldBaseProps = Omit<FieldBaseProps, 'value' | 'secondaryMessage'> & {
3754
3753
  value: NonNullable<InputProps['value']>;
3755
3754
  type?: keyof typeof validTypes;
3756
3755
  inputMode?: InputProps['inputMode'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "32.14.2",
3
+ "version": "32.14.3",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {