@thecb/components 9.0.0-beta.4 → 9.0.0-beta.5

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.d.ts CHANGED
@@ -457,7 +457,7 @@ interface FormInputProps {
457
457
  customHeight?: string;
458
458
  autocompleteValue?: string;
459
459
  removeFromValue?: RegExp;
460
- dataQa?: string;
460
+ dataQa?: string | null;
461
461
  }
462
462
 
463
463
  declare const FormInput: React.FC<Expand<FormInputProps> &
@@ -478,7 +478,7 @@ interface FormSelectProps {
478
478
  hasTitles?: boolean;
479
479
  autocompleteValue?: string;
480
480
  smoothScroll?: boolean;
481
- dataQa?: string;
481
+ dataQa?: string | null;
482
482
  }
483
483
 
484
484
  declare const FormSelect: React.FC<Expand<FormSelectProps> &
package/dist/index.esm.js CHANGED
@@ -22107,7 +22107,7 @@ var Checkbox = function Checkbox(_ref4) {
22107
22107
  extraStyles = _ref4.extraStyles,
22108
22108
  textExtraStyles = _ref4.textExtraStyles,
22109
22109
  _ref4$dataQa = _ref4.dataQa,
22110
- dataQa = _ref4$dataQa === void 0 ? "Checkbox Label" : _ref4$dataQa;
22110
+ dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22111
22111
 
22112
22112
  var _useState = useState(false),
22113
22113
  _useState2 = _slicedToArray(_useState, 2),
@@ -22150,6 +22150,7 @@ var Checkbox = function Checkbox(_ref4) {
22150
22150
  "aria-invalid": error,
22151
22151
  "aria-describedby": error ? "".concat(name, "-error-message") : ""
22152
22152
  }), /*#__PURE__*/React.createElement(StyledCheckbox, {
22153
+ role: "checkbox",
22153
22154
  error: error,
22154
22155
  disabled: disabled,
22155
22156
  checked: checked,
@@ -23986,17 +23987,20 @@ var Dropdown = function Dropdown(_ref8) {
23986
23987
  as: "input",
23987
23988
  "aria-multiline": "false",
23988
23989
  autoComplete: autocompleteValue,
23989
- "aria-controls": "".concat(createIdFromString(ariaLabelledby), "_listbox"),
23990
+ "aria-controls": "".concat(ariaLabelledby, "_listbox"),
23990
23991
  "aria-activedescendant": "focused_option",
23991
23992
  "aria-owns": "".concat(ariaLabelledby, "_listbox"),
23992
23993
  "aria-haspopup": "listbox",
23993
23994
  "aria-labelledby": ariaLabelledby,
23994
23995
  "aria-describedby": ariaDescribedby,
23995
23996
  "aria-expanded": isOpen,
23997
+ "aria-required": options.required,
23998
+ "aria-invalid": ariaInvalid,
23996
23999
  background: isOpen ? themeValues.hoverColor : WHITE,
23997
24000
  borderRadius: "2px",
23998
24001
  borderSize: "1px",
23999
24002
  borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
24003
+ dataQa: placeholder,
24000
24004
  extraStyles: disabled ? "".concat(inputPlaceholderTextStyle).concat(inputDisabledStyle) : inputPlaceholderTextStyle,
24001
24005
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
24002
24006
  isOpen: isOpen,
@@ -24012,17 +24016,14 @@ var Dropdown = function Dropdown(_ref8) {
24012
24016
  },
24013
24017
  padding: "12px",
24014
24018
  placeholder: getSelection(),
24019
+ required: options.required,
24015
24020
  role: "combobox",
24016
24021
  themeValues: themeValues,
24017
24022
  title: hasTitles ? getSelection() : null,
24018
24023
  type: "text",
24019
24024
  tabIndex: 0,
24020
24025
  value: inputValue,
24021
- width: "100%",
24022
- dataQa: placeholder,
24023
- required: options.required,
24024
- "aria-required": options.required,
24025
- "aria-invalid": ariaInvalid
24026
+ width: "100%"
24026
24027
  }), /*#__PURE__*/React.createElement(IconWrapper, {
24027
24028
  open: isOpen,
24028
24029
  onClick: _onClick
@@ -24064,8 +24065,7 @@ var Dropdown = function Dropdown(_ref8) {
24064
24065
  title: hasTitles ? choice.text : null,
24065
24066
  onFocus: function onFocus() {
24066
24067
  return setFocusedRef(optionRefs.current[i]);
24067
- },
24068
- role: "option"
24068
+ }
24069
24069
  }, /*#__PURE__*/React.createElement(Text$1, {
24070
24070
  variant: "p",
24071
24071
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
@@ -24174,11 +24174,11 @@ var FormSelect = function FormSelect(_ref) {
24174
24174
  _ref$hasTitles = _ref.hasTitles,
24175
24175
  hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
24176
24176
  _ref$autocompleteValu = _ref.autocompleteValue,
24177
- autocompleteValue = _ref$autocompleteValu === void 0 ? "" : _ref$autocompleteValu,
24177
+ autocompleteValue = _ref$autocompleteValu === void 0 ? null : _ref$autocompleteValu,
24178
24178
  _ref$smoothScroll = _ref.smoothScroll,
24179
24179
  smoothScroll = _ref$smoothScroll === void 0 ? true : _ref$smoothScroll,
24180
24180
  _ref$dataQa = _ref.dataQa,
24181
- dataQa = _ref$dataQa === void 0 ? "FormSelect" : _ref$dataQa;
24181
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
24182
24182
 
24183
24183
  var _useState = useState(false),
24184
24184
  _useState2 = _slicedToArray(_useState, 2),
@@ -24202,6 +24202,7 @@ var FormSelect = function FormSelect(_ref) {
24202
24202
  return /*#__PURE__*/React.createElement(SelectContainer, {
24203
24203
  ref: dropdownRef,
24204
24204
  disabled: disabled,
24205
+ "aria-disabled": disabled,
24205
24206
  "data-qa": dataQa
24206
24207
  }, /*#__PURE__*/React.createElement(Box, {
24207
24208
  padding: "0",
@@ -24217,7 +24218,7 @@ var FormSelect = function FormSelect(_ref) {
24217
24218
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24218
24219
  id: createIdFromString(labelTextWhenNoError)
24219
24220
  }, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
24220
- ariaLabelledby: labelTextWhenNoError,
24221
+ ariaLabelledby: createIdFromString(labelTextWhenNoError),
24221
24222
  ariaDescribedBy: createIdFromString(labelTextWhenNoError, "error message"),
24222
24223
  maxHeight: dropdownMaxHeight,
24223
24224
  hasTitles: hasTitles,
@@ -25007,13 +25008,13 @@ var CountryDropdown = function CountryDropdown(_ref) {
25007
25008
  showErrors = _ref.showErrors,
25008
25009
  onChange = _ref.onChange,
25009
25010
  _ref$dataQa = _ref.dataQa,
25010
- dataQa = _ref$dataQa === void 0 ? "Country Dropdown" : _ref$dataQa;
25011
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
25011
25012
  return /*#__PURE__*/React.createElement(FormSelect$1, {
25012
25013
  options: options,
25013
25014
  field: field,
25014
25015
  fieldActions: fieldActions,
25015
25016
  labelTextWhenNoError: labelTextWhenNoError,
25016
- dataQa: dataQa,
25017
+ dataQa: dataQa || "CountryDropdown",
25017
25018
  errorMessages: errorMessages,
25018
25019
  showErrors: showErrors,
25019
25020
  onChange: onChange,
@@ -25165,7 +25166,7 @@ var DisplayBox = function DisplayBox(_ref) {
25165
25166
  themeValues = _ref.themeValues,
25166
25167
  showError = _ref.showError,
25167
25168
  _ref$dataQa = _ref.dataQa,
25168
- dataQa = _ref$dataQa === void 0 ? "DisplayBox" : _ref$dataQa;
25169
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
25169
25170
  return /*#__PURE__*/React.createElement(Box, {
25170
25171
  padding: "0.5rem 0 1.5rem 0"
25171
25172
  }, /*#__PURE__*/React.createElement(Box, {
@@ -37949,9 +37950,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
37949
37950
  showErrors = _ref.showErrors,
37950
37951
  countryCode = _ref.countryCode,
37951
37952
  _ref$autocompleteValu = _ref.autocompleteValue,
37952
- autocompleteValue = _ref$autocompleteValu === void 0 ? "administrative-area" : _ref$autocompleteValu,
37953
- _ref$dataQa = _ref.dataQa,
37954
- dataQa = _ref$dataQa === void 0 ? "StateProvinceDropdown" : _ref$dataQa;
37953
+ autocompleteValue = _ref$autocompleteValu === void 0 ? null : _ref$autocompleteValu;
37955
37954
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
37956
37955
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
37957
37956
  return /*#__PURE__*/React.createElement(FormSelect$1, {
@@ -37961,9 +37960,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
37961
37960
  labelTextWhenNoError: labelTextWhenNoError,
37962
37961
  errorMessages: errorMessages,
37963
37962
  showErrors: showErrors,
37964
- "aria-invalid": !!(errorMessages !== null && errorMessages !== void 0 && errorMessages.length),
37965
- autocompleteValue: autocompleteValue,
37966
- dataQa: dataQa
37963
+ autocompleteValue: autocompleteValue
37967
37964
  });
37968
37965
  };
37969
37966
 
@@ -40355,7 +40352,9 @@ var AddressForm = function AddressForm(_ref) {
40355
40352
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
40356
40353
  showWalletCheckbox = _ref.showWalletCheckbox,
40357
40354
  saveToWallet = _ref.saveToWallet,
40358
- walletCheckboxMarked = _ref.walletCheckboxMarked;
40355
+ walletCheckboxMarked = _ref.walletCheckboxMarked,
40356
+ _ref$dataQa = _ref.dataQa,
40357
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
40359
40358
 
40360
40359
  if (clearOnDismount) {
40361
40360
  useEffect$1(function () {
@@ -40379,7 +40378,8 @@ var AddressForm = function AddressForm(_ref) {
40379
40378
  return /*#__PURE__*/React.createElement(FormContainer$1, {
40380
40379
  variant: variant,
40381
40380
  role: "form",
40382
- "aria-label": "Address"
40381
+ "aria-label": "Address",
40382
+ dataQa: dataQa
40383
40383
  }, /*#__PURE__*/React.createElement(FormInputColumn, null, /*#__PURE__*/React.createElement(CountryDropdown, {
40384
40384
  labelTextWhenNoError: "Country",
40385
40385
  errorMessages: countryErrorMessages,
@@ -48528,7 +48528,7 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
48528
48528
  imageType = _ref.imageType,
48529
48529
  themeValues = _ref.themeValues,
48530
48530
  _ref$dataQa = _ref.dataQa,
48531
- dataQa = _ref$dataQa === void 0 ? "AccountAndRoutingModal" : _ref$dataQa;
48531
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
48532
48532
  return /*#__PURE__*/React.createElement(Modal$1, {
48533
48533
  modalOpen: isOpen,
48534
48534
  hideModal: function hideModal() {
@@ -48677,9 +48677,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
48677
48677
  terms = _ref.terms,
48678
48678
  _ref$error = _ref.error,
48679
48679
  error = _ref$error === void 0 ? false : _ref$error,
48680
- linkVariant = _ref.linkVariant,
48681
- _ref$dataQa = _ref.dataQa,
48682
- dataQa = _ref$dataQa === void 0 ? "TermsAndConditionsControlV1" : _ref$dataQa;
48680
+ linkVariant = _ref.linkVariant;
48683
48681
 
48684
48682
  var _useState = useState(false),
48685
48683
  _useState2 = _slicedToArray(_useState, 2),
@@ -48687,7 +48685,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
48687
48685
  toggleShowTerms = _useState2[1];
48688
48686
 
48689
48687
  return /*#__PURE__*/React.createElement(DisplayBox$1, {
48690
- dataQ: dataQa
48688
+ dataQa: "TermsAndConditionsControlV1"
48691
48689
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Checkbox$1, {
48692
48690
  name: "terms",
48693
48691
  title: "Terms and Conditions",
@@ -48770,9 +48768,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48770
48768
  _ref$checkboxMargin = _ref.checkboxMargin,
48771
48769
  checkboxMargin = _ref$checkboxMargin === void 0 ? "4px 8px 4px 4px" : _ref$checkboxMargin,
48772
48770
  _ref$modalTitle = _ref.modalTitle,
48773
- modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
48774
- _ref$dataQa = _ref.dataQa,
48775
- dataQa = _ref$dataQa === void 0 ? "TermsAndConditionsControlV2" : _ref$dataQa;
48771
+ modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
48776
48772
 
48777
48773
  var _useState = useState(false),
48778
48774
  _useState2 = _slicedToArray(_useState, 2),
@@ -48795,7 +48791,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48795
48791
  background: displayInline ? "transparent" : containerBackground,
48796
48792
  boxShadow: displayInline ? "none" : standardBoxShadow,
48797
48793
  borderRadius: displayInline ? "0" : "4px",
48798
- dataQa: dataQa
48794
+ dataQa: "TermsAndConditionsControlV2"
48799
48795
  }, /*#__PURE__*/React.createElement(Stack, {
48800
48796
  childGap: "0"
48801
48797
  }, html && /*#__PURE__*/React.createElement(Box, {