@thecb/components 8.4.11-beta.11 → 8.4.11-beta.12

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/dist/index.cjs.js CHANGED
@@ -23984,8 +23984,8 @@ var Dropdown = function Dropdown(_ref8) {
23984
23984
  width: "100%"
23985
23985
  }, /*#__PURE__*/React__default.createElement(Box, {
23986
23986
  as: "input",
23987
+ role: "combobox",
23987
23988
  "aria-multiline": "false",
23988
- "aria-autocomplete": "list",
23989
23989
  "aria-activedescendant": "focused_option",
23990
23990
  "aria-owns": "".concat(ariaLabelledby, "_listbox"),
23991
23991
  "aria-controls": "".concat(ariaLabelledby, "_listbox"),
@@ -24014,13 +24014,14 @@ var Dropdown = function Dropdown(_ref8) {
24014
24014
  padding: "12px",
24015
24015
  placeholder: getSelection(),
24016
24016
  themeValues: themeValues,
24017
- role: "combobox",
24018
24017
  title: hasTitles ? getSelection() : null,
24019
24018
  type: "text",
24020
24019
  tabIndex: 0,
24021
24020
  value: inputValue,
24022
24021
  width: "100%",
24023
- dataQa: placeholder
24022
+ dataQa: placeholder,
24023
+ required: options.required,
24024
+ "aria-required": options.required
24024
24025
  }), /*#__PURE__*/React__default.createElement(IconWrapper, {
24025
24026
  open: isOpen,
24026
24027
  onClick: _onClick
@@ -24056,13 +24057,14 @@ var Dropdown = function Dropdown(_ref8) {
24056
24057
  selected: choice.value === value,
24057
24058
  "aria-selected": choice.value === value,
24058
24059
  disabled: disabledValues.includes(choice.value),
24060
+ "aria-disabled": disabledValues.includes(choice.value),
24059
24061
  "data-qa": choice.text,
24060
24062
  themeValues: themeValues,
24061
24063
  title: hasTitles ? choice.text : null,
24062
- role: "option",
24063
24064
  onFocus: function onFocus() {
24064
24065
  return setFocusedRef(optionRefs.current[i]);
24065
- }
24066
+ },
24067
+ role: "option"
24066
24068
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24067
24069
  variant: "p",
24068
24070
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
@@ -24195,7 +24197,8 @@ var FormSelect = function FormSelect(_ref) {
24195
24197
  });
24196
24198
  return /*#__PURE__*/React__default.createElement(SelectContainer, {
24197
24199
  ref: dropdownRef,
24198
- disabled: disabled
24200
+ disabled: disabled,
24201
+ className: "form-select-component"
24199
24202
  }, /*#__PURE__*/React__default.createElement(Box, {
24200
24203
  padding: "0",
24201
24204
  minWidth: "100%"
@@ -24209,9 +24212,9 @@ var FormSelect = function FormSelect(_ref) {
24209
24212
  weight: themeValues.fontWeight,
24210
24213
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24211
24214
  id: createIdFromString(labelTextWhenNoError)
24212
- }, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
24215
+ }, "".concat(labelTextWhenNoError).concat(options.required ? "*" : "")))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
24213
24216
  ariaLabelledby: createIdFromString(labelTextWhenNoError),
24214
- ariaDescribedby: createIdFromString(labelTextWhenNoError),
24217
+ ariaDescribedby: "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
24215
24218
  maxHeight: dropdownMaxHeight,
24216
24219
  hasTitles: hasTitles,
24217
24220
  placeholder: options[0] ? options[0].text : "",
@@ -24220,6 +24223,7 @@ var FormSelect = function FormSelect(_ref) {
24220
24223
  disabledValues: disabledValues,
24221
24224
  isOpen: open,
24222
24225
  isError: field.hasErrors && field.dirty || field.hasErrors && showErrors,
24226
+ "aria-invalid": field.hasErrors && field.dirty || field.hasErrors && showErrors,
24223
24227
  onSelect: onChange ? function (value) {
24224
24228
  return onChange(value);
24225
24229
  } : function (value) {
@@ -24229,19 +24233,22 @@ var FormSelect = function FormSelect(_ref) {
24229
24233
  return setOpen(!open);
24230
24234
  },
24231
24235
  disabled: disabled,
24236
+ "aria-disabled": disabled,
24232
24237
  autocompleteValue: autocompleteValue,
24233
24238
  smoothScroll: smoothScroll,
24234
- required: options.required
24239
+ required: options.required,
24240
+ "aria-required": options.required,
24241
+ id: "".concat(createIdFromString(labelTextWhenNoError), "-input")
24235
24242
  }), /*#__PURE__*/React__default.createElement(Stack, {
24236
24243
  direction: "row",
24237
- justify: "space-between",
24238
- role: "alert"
24244
+ justify: "space-between"
24239
24245
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24240
24246
  color: ERROR_COLOR,
24241
24247
  variant: "pXS",
24242
24248
  weight: themeValues.fontWeight,
24243
- extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24244
- id: createIdFromString(labelTextWhenNoError, "error message")
24249
+ extraStyles: "\n word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
24250
+ id: createIdFromString(labelTextWhenNoError, "error message"),
24251
+ "aria-live": "polite"
24245
24252
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? errorMessages[field.errors[0]] : "")));
24246
24253
  };
24247
24254
 
@@ -25983,7 +25990,7 @@ var FormInput = function FormInput(_ref15) {
25983
25990
  color: themeValues.labelColor,
25984
25991
  variant: "pS",
25985
25992
  fontWeight: themeValues.fontWeight,
25986
- extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
25993
+ extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
25987
25994
  id: createIdFromString(labelTextWhenNoError)
25988
25995
  }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(Text$1, {
25989
25996
  variant: "pS",
@@ -25994,10 +26001,11 @@ var FormInput = function FormInput(_ref15) {
25994
26001
  onClick: function onClick() {
25995
26002
  return setShowPassword(!showPassword);
25996
26003
  },
25997
- "aria-label": "Show password",
25998
26004
  tabIndex: "0",
26005
+ "aria-label": showPassword ? "Hide Password" : "Show password",
26006
+ "aria-live": "polite",
25999
26007
  onKeyPress: function onKeyPress(e) {
26000
- return e.key === "Enter" && setShowPassword(!showPassword);
26008
+ return (e.key === "Enter" || e.code === "Space") && setShowPassword(!showPassword);
26001
26009
  }
26002
26010
  }, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
26003
26011
  padding: "0 0 0 auto"
@@ -26005,7 +26013,7 @@ var FormInput = function FormInput(_ref15) {
26005
26013
  padding: "0"
26006
26014
  }, formatter ? /*#__PURE__*/React__default.createElement(FormattedInputField, _extends({
26007
26015
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26008
- "aria-describedby": createIdFromString(labelTextWhenNoError),
26016
+ "aria-describedby": "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
26009
26017
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
26010
26018
  onChange: function onChange(value) {
26011
26019
  return setValue(value);
@@ -26024,7 +26032,7 @@ var FormInput = function FormInput(_ref15) {
26024
26032
  autocomplete: autocomplete
26025
26033
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
26026
26034
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26027
- "aria-describedby": createIdFromString(labelTextWhenNoError),
26035
+ "aria-describedby": "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
26028
26036
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
26029
26037
  onChange: function onChange(e) {
26030
26038
  return setValue(e.target.value);
@@ -26044,7 +26052,8 @@ var FormInput = function FormInput(_ref15) {
26044
26052
  }, props))), /*#__PURE__*/React__default.createElement(Stack, {
26045
26053
  direction: "row",
26046
26054
  justify: "space-between",
26047
- role: "alert"
26055
+ "aria-live": "assertive",
26056
+ "aria-atomic": true
26048
26057
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
26049
26058
  color: ERROR_COLOR,
26050
26059
  variant: "pXS",
@@ -37936,12 +37945,15 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
37936
37945
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
37937
37946
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
37938
37947
  return /*#__PURE__*/React__default.createElement(FormSelect$1, {
37948
+ "aria-live": "polite",
37949
+ "aria-atomic": true,
37939
37950
  options: options,
37940
37951
  field: field,
37941
37952
  fieldActions: fieldActions,
37942
37953
  labelTextWhenNoError: labelTextWhenNoError,
37943
37954
  errorMessages: errorMessages,
37944
37955
  showErrors: showErrors,
37956
+ "aria-invalid": !!(errorMessages !== null && errorMessages !== void 0 && errorMessages.length),
37945
37957
  autocompleteValue: autocomplete
37946
37958
  });
37947
37959
  };
@@ -40375,8 +40387,7 @@ var AddressForm = function AddressForm(_ref) {
40375
40387
  actions.fields.zip.set("");
40376
40388
  }
40377
40389
  },
40378
- showErrors: showErrors,
40379
- "aria-label": "Country"
40390
+ showErrors: showErrors
40380
40391
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
40381
40392
  labelTextWhenNoError: "Address",
40382
40393
  errorMessages: street1ErrorMessages,