@thecb/components 10.6.5-beta.1 → 10.6.6-beta.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.
package/dist/index.cjs.js CHANGED
@@ -6304,7 +6304,7 @@ var displayCardBrand = function displayCardBrand(number) {
6304
6304
  return "Mastercard";
6305
6305
  } else if (/^4/.test(number)) {
6306
6306
  return "Visa";
6307
- } else if (/^3[4,7]/.test(number)) {
6307
+ } else if (/^3[4,7]\d{13}$/.test(number)) {
6308
6308
  return "American Express";
6309
6309
  } else return "Unknown Card";
6310
6310
  };
@@ -39730,9 +39730,7 @@ var WalletName = function WalletName(_ref) {
39730
39730
  _ref$linkButtonExtraS = _ref.linkButtonExtraStyles,
39731
39731
  linkButtonExtraStyles = _ref$linkButtonExtraS === void 0 ? "" : _ref$linkButtonExtraS,
39732
39732
  _ref$isLoading = _ref.isLoading,
39733
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
39734
- _ref$dataQa = _ref.dataQa,
39735
- dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
39733
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
39736
39734
  var _useContext = React.useContext(styled.ThemeContext),
39737
39735
  isMobile = _useContext.isMobile;
39738
39736
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Module$1, {
@@ -39762,7 +39760,6 @@ var WalletName = function WalletName(_ref) {
39762
39760
  }, text), (text || actionText) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\xA0"), action && actionText && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
39763
39761
  disabled: disableAction,
39764
39762
  text: actionText,
39765
- dataQa: dataQa,
39766
39763
  action: action,
39767
39764
  variant: "smallGhost",
39768
39765
  extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.75rem;}\n ".concat(linkButtonExtraStyles, "\n ")
@@ -48550,11 +48547,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
48550
48547
  buttonGroupStyles = _ref.buttonGroupStyles,
48551
48548
  _ref$hideAdditionalBu = _ref.hideAdditionalButton,
48552
48549
  hideAdditionalButton = _ref$hideAdditionalBu === void 0 ? false : _ref$hideAdditionalBu,
48553
- additionalButton = _ref.additionalButton,
48554
- _ref$nextButtonTestId = _ref.nextButtonTestId,
48555
- nextButtonTestId = _ref$nextButtonTestId === void 0 ? null : _ref$nextButtonTestId,
48556
- _ref$backButtonTestId = _ref.backButtonTestId,
48557
- backButtonTestId = _ref$backButtonTestId === void 0 ? null : _ref$backButtonTestId;
48550
+ additionalButton = _ref.additionalButton;
48558
48551
  var _useContext = React.useContext(styled.ThemeContext),
48559
48552
  isMobile = _useContext.isMobile;
48560
48553
  var backButton = !!cancelURL && !!cancelText ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
@@ -48562,7 +48555,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
48562
48555
  url: cancelURL,
48563
48556
  variant: backButtonVariant,
48564
48557
  extraStyles: isMobile && "flex-grow: 1",
48565
- dataQa: backButtonTestId || cancelText,
48558
+ dataQa: cancelText,
48566
48559
  "aria-labelledby": "".concat(kebabCaseString(cancelText), "-button"),
48567
48560
  role: "link"
48568
48561
  }) : backButtonAction && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
@@ -48579,7 +48572,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
48579
48572
  text: redirectText,
48580
48573
  variant: forwardButtonVariant,
48581
48574
  extraStyles: isMobile && "flex-grow: 1",
48582
- dataQa: nextButtonTestId || redirectText,
48575
+ dataQa: redirectText,
48583
48576
  disabled: isForwardButtonDisabled,
48584
48577
  "aria-labelledby": "".concat(kebabCaseString(redirectText), "-button"),
48585
48578
  role: forwardButtonAriaRole
@@ -48589,7 +48582,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
48589
48582
  action: forwardButtonAction,
48590
48583
  isLoading: forwardButtonLoading,
48591
48584
  extraStyles: isMobile && "flex-grow: 1",
48592
- dataQa: nextButtonTestId || forwardButtonText,
48585
+ dataQa: forwardButtonText,
48593
48586
  disabled: isForwardButtonDisabled,
48594
48587
  "aria-labelledby": "".concat(kebabCaseString(forwardButtonText), "-button"),
48595
48588
  role: forwardButtonAriaRole
@@ -49558,7 +49551,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
49558
49551
  }
49559
49552
  }, []);
49560
49553
  var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
49561
- var creditCardNumberErrors = _defineProperty(_defineProperty(_defineProperty({}, required.error, "Credit card number is required"), hasLength.error, "Credit card number is invalid"), matchesRegex.error, "".concat(displayCardBrand(fields.creditCardNumber.rawValue), " is not accepted"));
49554
+ var creditCardNumberErrors = _defineProperty(_defineProperty(_defineProperty({}, required.error, "Credit card number is required"), hasLength.error, "Credit card number is invalid"), matchesRegex.error, "".concat(displayCardBrand(fields.creditCardNumber.rawValue), " cards are not available for payment"));
49562
49555
  var expirationDateErrors = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, required.error, "Expiration date is required"), hasLength.error, "Expiration date is invalid"), isValidMonth.error, "Expiration month is invalid"), dateAfterToday.error, "Expiration date is invalid");
49563
49556
  var cvvErrors = _defineProperty(_defineProperty({}, required.error, "CVV is required"), hasLength.error, "CVV is invalid");
49564
49557
  var zipCodeErrors = _defineProperty(_defineProperty({}, required.error, "Zip code is required"), hasLength.error, "Zip code is invalid");