@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 +17 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +17 -9
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.stories.js +1 -10
- package/src/components/molecules/toast-notification/ToastNotification.js +6 -1
- package/src/util/general.js +2 -2
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -6296,9 +6296,9 @@ var displayCardBrand = function displayCardBrand(number) {
|
|
|
6296
6296
|
return "Mastercard";
|
|
6297
6297
|
} else if (/^4/.test(number)) {
|
|
6298
6298
|
return "Visa";
|
|
6299
|
-
} else if (/^3[4,7]
|
|
6299
|
+
} else if (/^3[4,7]/.test(number)) {
|
|
6300
6300
|
return "American Express";
|
|
6301
|
-
} else return "Unknown";
|
|
6301
|
+
} else return "Unknown Card";
|
|
6302
6302
|
};
|
|
6303
6303
|
var checkDeniedCards = function checkDeniedCards(name) {
|
|
6304
6304
|
switch (name) {
|
|
@@ -49543,7 +49543,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
49543
49543
|
}
|
|
49544
49544
|
}, []);
|
|
49545
49545
|
var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
|
|
49546
|
-
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), "
|
|
49546
|
+
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"));
|
|
49547
49547
|
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");
|
|
49548
49548
|
var cvvErrors = _defineProperty(_defineProperty({}, required.error, "CVV is required"), hasLength.error, "CVV is invalid");
|
|
49549
49549
|
var zipCodeErrors = _defineProperty(_defineProperty({}, required.error, "Zip code is required"), hasLength.error, "Zip code is invalid");
|
|
@@ -50679,6 +50679,7 @@ var Timeout = function Timeout(_ref) {
|
|
|
50679
50679
|
};
|
|
50680
50680
|
var Timeout$1 = withWindowSize(Timeout);
|
|
50681
50681
|
|
|
50682
|
+
var _excluded$F = ["variant", "message", "toastOpen", "closeToastNotification", "extraStyles", "minWidth", "maxWidth", "height", "childGap", "backgroundColor", "role", "ariaLive"];
|
|
50682
50683
|
var VARIANTS = {
|
|
50683
50684
|
SUCCESS: "success",
|
|
50684
50685
|
ERROR: "error"
|
|
@@ -50701,9 +50702,15 @@ var ToastNotification = function ToastNotification(_ref) {
|
|
|
50701
50702
|
childGap = _ref$childGap === void 0 ? "1rem" : _ref$childGap,
|
|
50702
50703
|
backgroundColor = _ref.backgroundColor,
|
|
50703
50704
|
_ref$role = _ref.role,
|
|
50704
|
-
role = _ref$role === void 0 ? "alert" : _ref$role
|
|
50705
|
-
|
|
50705
|
+
role = _ref$role === void 0 ? "alert" : _ref$role,
|
|
50706
|
+
_ref$ariaLive = _ref.ariaLive,
|
|
50707
|
+
ariaLive = _ref$ariaLive === void 0 ? "polite" : _ref$ariaLive,
|
|
50708
|
+
rest = _objectWithoutProperties(_ref, _excluded$F);
|
|
50709
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
50706
50710
|
onClick: closeToastNotification,
|
|
50711
|
+
onKeyDown: function onKeyDown(e) {
|
|
50712
|
+
return e.key === "Enter" && closeToastNotification();
|
|
50713
|
+
},
|
|
50707
50714
|
background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === VARIANTS.ERROR ? ERROR_BACKGROUND_COLOR : WHITE,
|
|
50708
50715
|
minWidth: minWidth,
|
|
50709
50716
|
minHeight: height && parseInt(height) < 100 ? height : "100px",
|
|
@@ -50713,8 +50720,9 @@ var ToastNotification = function ToastNotification(_ref) {
|
|
|
50713
50720
|
borderRadius: "4px",
|
|
50714
50721
|
boxShadow: generateShadows().standard.base,
|
|
50715
50722
|
extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n "),
|
|
50716
|
-
role: role
|
|
50717
|
-
|
|
50723
|
+
role: role,
|
|
50724
|
+
"aria-live": ariaLive
|
|
50725
|
+
}, rest), /*#__PURE__*/React.createElement(Cluster, {
|
|
50718
50726
|
align: "center",
|
|
50719
50727
|
childGap: childGap,
|
|
50720
50728
|
justify: "space-between"
|
|
@@ -50862,7 +50870,7 @@ var PopupMenuItemContainer = styled(ButtonWithAction).withConfig({
|
|
|
50862
50870
|
return "\n background-color: ".concat(isDeleteAction ? theme.menuItemHoverBackgroundColorDelete : theme.menuItemHoverBackgroundColor, ";\n ");
|
|
50863
50871
|
});
|
|
50864
50872
|
|
|
50865
|
-
var _excluded$
|
|
50873
|
+
var _excluded$G = ["id", "closeMenuCallback", "action", "themeValues", "text", "hasIcon", "isDeleteAction", "icon", "textExtraStyles", "hoverStyles", "activeStyles", "extraStyles"];
|
|
50866
50874
|
var PopupMenuItem = function PopupMenuItem(_ref) {
|
|
50867
50875
|
var id = _ref.id,
|
|
50868
50876
|
closeMenuCallback = _ref.closeMenuCallback,
|
|
@@ -50878,7 +50886,7 @@ var PopupMenuItem = function PopupMenuItem(_ref) {
|
|
|
50878
50886
|
hoverStyles = _ref.hoverStyles,
|
|
50879
50887
|
activeStyles = _ref.activeStyles,
|
|
50880
50888
|
extraStyles = _ref.extraStyles,
|
|
50881
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
50889
|
+
rest = _objectWithoutProperties(_ref, _excluded$G);
|
|
50882
50890
|
return /*#__PURE__*/React.createElement(PopupMenuItemContainer, _extends({
|
|
50883
50891
|
id: id,
|
|
50884
50892
|
role: "menuItem",
|