@thecb/components 8.4.11-beta.7 → 8.4.11-beta.9

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
@@ -22151,7 +22151,7 @@ var Checkbox = function Checkbox(_ref4) {
22151
22151
  onChange: onChange,
22152
22152
  tabIndex: "-1",
22153
22153
  "aria-invalid": error,
22154
- "aria-describedby": error ? "".concat(name, "-error-message") : ""
22154
+ "aria-describedby": name
22155
22155
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22156
22156
  error: error,
22157
22157
  disabled: disabled,
@@ -23985,15 +23985,13 @@ var Dropdown = function Dropdown(_ref8) {
23985
23985
  }, /*#__PURE__*/React__default.createElement(Box, {
23986
23986
  as: "input",
23987
23987
  "aria-multiline": "false",
23988
- "aria-autocomplete": "list",
23989
- "aria-controls": "".concat(ariaLabelledby, "_listbox"),
23990
- "aria-activedescendant": "focused_option",
23991
- "aria-owns": "".concat(ariaLabelledby, "_listbox"),
23988
+ "aria-autocomplete": "list" // aria-activedescendant="focused_option"
23989
+ // aria-owns={`${ariaLabelledby}_listbox`}
23990
+ // aria-controls={`${ariaLabelledby}_listbox`}
23991
+ ,
23992
23992
  "aria-haspopup": "listbox",
23993
23993
  "aria-labelledby": ariaLabelledby,
23994
23994
  "aria-describedby": ariaDescribedby,
23995
- "aria-expanded": isOpen,
23996
- "aria-live": "polite",
23997
23995
  autoComplete: autocompleteValue,
23998
23996
  background: isOpen ? themeValues.hoverColor : WHITE,
23999
23997
  borderRadius: "2px",
@@ -24004,7 +24002,8 @@ var Dropdown = function Dropdown(_ref8) {
24004
24002
  isOpen: isOpen,
24005
24003
  minHeight: "48px",
24006
24004
  minWidth: "100%",
24007
- name: autocompleteValue,
24005
+ name: autocompleteValue // aria-expanded={isOpen}
24006
+ ,
24008
24007
  onChange: function onChange(e) {
24009
24008
  // support autofill and copy/paste
24010
24009
  if (e.target.value !== inputValue) {
@@ -24066,7 +24065,7 @@ var Dropdown = function Dropdown(_ref8) {
24066
24065
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24067
24066
  variant: "p",
24068
24067
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
24069
- extraStyles: "padding-left: 16px; \n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", "; \n white-space: nowrap; \n overflow: hidden; \n text-overflow: ellipsis;")
24068
+ extraStyles: "padding-left: 16px; \n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", "; \n white-space: nowrap; \n overflow: hidden; \n text-overflow: ellipsis;")
24070
24069
  }, choice.text));
24071
24070
  }))) : /*#__PURE__*/React__default.createElement(React.Fragment, null)));
24072
24071
  };
@@ -24211,7 +24210,7 @@ var FormSelect = function FormSelect(_ref) {
24211
24210
  id: createIdFromString(labelTextWhenNoError)
24212
24211
  }, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
24213
24212
  ariaLabelledby: createIdFromString(labelTextWhenNoError),
24214
- ariaDescribedby: createIdFromString(labelTextWhenNoError, "error message"),
24213
+ ariaDescribedby: createIdFromString(labelTextWhenNoError),
24215
24214
  maxHeight: dropdownMaxHeight,
24216
24215
  hasTitles: hasTitles,
24217
24216
  placeholder: options[0] ? options[0].text : "",
@@ -24234,14 +24233,14 @@ var FormSelect = function FormSelect(_ref) {
24234
24233
  required: options.required
24235
24234
  }), /*#__PURE__*/React__default.createElement(Stack, {
24236
24235
  direction: "row",
24237
- justify: "space-between"
24236
+ justify: "space-between",
24237
+ role: "alert"
24238
24238
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24239
24239
  color: ERROR_COLOR,
24240
24240
  variant: "pXS",
24241
24241
  weight: themeValues.fontWeight,
24242
24242
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24243
- id: createIdFromString(labelTextWhenNoError, "error message"),
24244
- "aria-live": "polite"
24243
+ id: createIdFromString(labelTextWhenNoError, "error message")
24245
24244
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? errorMessages[field.errors[0]] : "")));
24246
24245
  };
24247
24246
 
@@ -25955,7 +25954,8 @@ var FormInput = function FormInput(_ref15) {
25955
25954
  };
25956
25955
 
25957
25956
  return /*#__PURE__*/React__default.createElement(Stack, {
25958
- childGap: "0.25rem"
25957
+ childGap: "0.25rem",
25958
+ "aria-live": "assertive"
25959
25959
  }, /*#__PURE__*/React__default.createElement(Box, {
25960
25960
  padding: "0"
25961
25961
  }, helperModal ? /*#__PURE__*/React__default.createElement(Cluster, {
@@ -26002,10 +26002,11 @@ var FormInput = function FormInput(_ref15) {
26002
26002
  }, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
26003
26003
  padding: "0 0 0 auto"
26004
26004
  }, decorator)))), /*#__PURE__*/React__default.createElement(Box, {
26005
- padding: "0"
26005
+ padding: "0",
26006
+ "aria-live": "assertive"
26006
26007
  }, formatter ? /*#__PURE__*/React__default.createElement(FormattedInputField, _extends({
26007
26008
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26008
- "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
26009
+ "aria-describedby": createIdFromString(labelTextWhenNoError),
26009
26010
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
26010
26011
  onChange: function onChange(value) {
26011
26012
  return setValue(value);
@@ -26021,10 +26022,10 @@ var FormInput = function FormInput(_ref15) {
26021
26022
  themeValues: themeValues,
26022
26023
  $customHeight: customHeight,
26023
26024
  $extraStyles: extraStyles,
26024
- autoComplete: autocomplete
26025
+ autocomplete: autocomplete
26025
26026
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
26026
26027
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26027
- "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
26028
+ "aria-describedby": createIdFromString(labelTextWhenNoError),
26028
26029
  "aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
26029
26030
  onChange: function onChange(e) {
26030
26031
  return setValue(e.target.value);
@@ -26040,11 +26041,11 @@ var FormInput = function FormInput(_ref15) {
26040
26041
  background: background,
26041
26042
  $customHeight: customHeight,
26042
26043
  $extraStyles: extraStyles,
26043
- autoComplete: autocomplete
26044
+ autocomplete: autocomplete
26044
26045
  }, props))), /*#__PURE__*/React__default.createElement(Stack, {
26045
26046
  direction: "row",
26046
26047
  justify: "space-between",
26047
- "aria-role": "alert"
26048
+ role: "alert"
26048
26049
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
26049
26050
  color: ERROR_COLOR,
26050
26051
  variant: "pXS",
@@ -40388,7 +40389,7 @@ var AddressForm = function AddressForm(_ref) {
40388
40389
  return e.key === "Enter" && handleSubmit(e);
40389
40390
  },
40390
40391
  autocomplete: "address-line1",
40391
- "aria-label": "address line 1"
40392
+ "aria-label": "Address Line 1"
40392
40393
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
40393
40394
  labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
40394
40395
  field: fields.street2,
@@ -40398,7 +40399,7 @@ var AddressForm = function AddressForm(_ref) {
40398
40399
  return e.key === "Enter" && handleSubmit(e);
40399
40400
  },
40400
40401
  autocomplete: "address-line2",
40401
- "aria-label": "Apt, Suite, Unit, Floor, etc. (Optional)"
40402
+ "aria-label": "Address Line 2"
40402
40403
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
40403
40404
  labelTextWhenNoError: "City",
40404
40405
  required: true,
@@ -40410,7 +40411,7 @@ var AddressForm = function AddressForm(_ref) {
40410
40411
  return e.key === "Enter" && handleSubmit(e);
40411
40412
  },
40412
40413
  autocomplete: "city",
40413
- "aria-label": "city"
40414
+ "aria-label": "City"
40414
40415
  }), /*#__PURE__*/React__default.createElement(FormStateDropdown, {
40415
40416
  labelTextWhenNoError: isUS ? "State" : "State or Province",
40416
40417
  errorMessages: stateProvinceErrorMessages,
@@ -40421,8 +40422,7 @@ var AddressForm = function AddressForm(_ref) {
40421
40422
  onKeyDown: function onKeyDown(e) {
40422
40423
  return e.key === "Enter" && handleSubmit(e);
40423
40424
  },
40424
- autoComplete: "administrative-area",
40425
- "aria-label": isUS ? "state" : "state or province",
40425
+ "aria-label": isUS ? "State" : "State or Province",
40426
40426
  required: true
40427
40427
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
40428
40428
  isNum: isUS,
@@ -40436,7 +40436,8 @@ var AddressForm = function AddressForm(_ref) {
40436
40436
  return e.key === "Enter" && handleSubmit(e);
40437
40437
  },
40438
40438
  "aria-label": "zip code",
40439
- autocomplete: "postal-code"
40439
+ autocomplete: "postal-code",
40440
+ required: true
40440
40441
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
40441
40442
  name: "address checkbox",
40442
40443
  title: "Save address to Wallet",