@thecb/components 10.6.6-beta.5 → 10.6.7-beta.0

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,9 +6304,9 @@ 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]\d{13}$/.test(number)) {
6307
+ } else if (/^3[4,7]/.test(number)) {
6308
6308
  return "American Express";
6309
- } else return "Unknown";
6309
+ } else return "Unknown Card";
6310
6310
  };
6311
6311
  var checkDeniedCards = function checkDeniedCards(name) {
6312
6312
  switch (name) {
@@ -49551,7 +49551,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
49551
49551
  }
49552
49552
  }, []);
49553
49553
  var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
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"));
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), " is not accepted"));
49555
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");
49556
49556
  var cvvErrors = _defineProperty(_defineProperty({}, required.error, "CVV is required"), hasLength.error, "CVV is invalid");
49557
49557
  var zipCodeErrors = _defineProperty(_defineProperty({}, required.error, "Zip code is required"), hasLength.error, "Zip code is invalid");
@@ -50687,6 +50687,7 @@ var Timeout = function Timeout(_ref) {
50687
50687
  };
50688
50688
  var Timeout$1 = withWindowSize(Timeout);
50689
50689
 
50690
+ var _excluded$F = ["variant", "message", "toastOpen", "closeToastNotification", "extraStyles", "minWidth", "maxWidth", "height", "childGap", "backgroundColor", "role", "ariaLive"];
50690
50691
  var VARIANTS = {
50691
50692
  SUCCESS: "success",
50692
50693
  ERROR: "error"
@@ -50709,9 +50710,15 @@ var ToastNotification = function ToastNotification(_ref) {
50709
50710
  childGap = _ref$childGap === void 0 ? "1rem" : _ref$childGap,
50710
50711
  backgroundColor = _ref.backgroundColor,
50711
50712
  _ref$role = _ref.role,
50712
- role = _ref$role === void 0 ? "alert" : _ref$role;
50713
- return /*#__PURE__*/React__default.createElement(Box, {
50713
+ role = _ref$role === void 0 ? "alert" : _ref$role,
50714
+ _ref$ariaLive = _ref.ariaLive,
50715
+ ariaLive = _ref$ariaLive === void 0 ? "polite" : _ref$ariaLive,
50716
+ rest = _objectWithoutProperties(_ref, _excluded$F);
50717
+ return /*#__PURE__*/React__default.createElement(Box, _extends({
50714
50718
  onClick: closeToastNotification,
50719
+ onKeyDown: function onKeyDown(e) {
50720
+ return e.key === "Enter" && closeToastNotification();
50721
+ },
50715
50722
  background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === VARIANTS.ERROR ? ERROR_BACKGROUND_COLOR : WHITE,
50716
50723
  minWidth: minWidth,
50717
50724
  minHeight: height && parseInt(height) < 100 ? height : "100px",
@@ -50721,8 +50728,9 @@ var ToastNotification = function ToastNotification(_ref) {
50721
50728
  borderRadius: "4px",
50722
50729
  boxShadow: generateShadows().standard.base,
50723
50730
  extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n "),
50724
- role: role
50725
- }, /*#__PURE__*/React__default.createElement(Cluster, {
50731
+ role: role,
50732
+ "aria-live": ariaLive
50733
+ }, rest), /*#__PURE__*/React__default.createElement(Cluster, {
50726
50734
  align: "center",
50727
50735
  childGap: childGap,
50728
50736
  justify: "space-between"
@@ -50870,7 +50878,7 @@ var PopupMenuItemContainer = styled__default(ButtonWithAction).withConfig({
50870
50878
  return "\n background-color: ".concat(isDeleteAction ? theme.menuItemHoverBackgroundColorDelete : theme.menuItemHoverBackgroundColor, ";\n ");
50871
50879
  });
50872
50880
 
50873
- var _excluded$F = ["id", "closeMenuCallback", "action", "themeValues", "text", "hasIcon", "isDeleteAction", "icon", "textExtraStyles", "hoverStyles", "activeStyles", "extraStyles"];
50881
+ var _excluded$G = ["id", "closeMenuCallback", "action", "themeValues", "text", "hasIcon", "isDeleteAction", "icon", "textExtraStyles", "hoverStyles", "activeStyles", "extraStyles"];
50874
50882
  var PopupMenuItem = function PopupMenuItem(_ref) {
50875
50883
  var id = _ref.id,
50876
50884
  closeMenuCallback = _ref.closeMenuCallback,
@@ -50886,7 +50894,7 @@ var PopupMenuItem = function PopupMenuItem(_ref) {
50886
50894
  hoverStyles = _ref.hoverStyles,
50887
50895
  activeStyles = _ref.activeStyles,
50888
50896
  extraStyles = _ref.extraStyles,
50889
- rest = _objectWithoutProperties(_ref, _excluded$F);
50897
+ rest = _objectWithoutProperties(_ref, _excluded$G);
50890
50898
  return /*#__PURE__*/React__default.createElement(PopupMenuItemContainer, _extends({
50891
50899
  id: id,
50892
50900
  role: "menuItem",