@thecb/components 10.6.6-beta.4 → 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 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +17 -24
- 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.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]
|
|
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) {
|
|
@@ -40380,21 +40380,6 @@ validatorFns[VALID_NAME] = (value, args, form) =>
|
|
|
40380
40380
|
? false
|
|
40381
40381
|
: new RegExp(/[A-zÀ-ÿ\-,'\S]+(\s?[A-zÀ-ÿ\-,'\S])*/).test(value);
|
|
40382
40382
|
|
|
40383
|
-
const IS_NOT_AMEX_CARD = 'validator/IS_NOT_AMEX_CARD';
|
|
40384
|
-
const IS_NOT_AMEX_CARD_ERROR = 'validator/IS_NOT_AMEX_CARD_ERROR';
|
|
40385
|
-
const isNotAmExCard = createValidator(
|
|
40386
|
-
IS_NOT_AMEX_CARD,
|
|
40387
|
-
IS_NOT_AMEX_CARD_ERROR
|
|
40388
|
-
);
|
|
40389
|
-
/* This regular expression looks for values not starting with 34 or 37, and
|
|
40390
|
-
* reflects that the shortest credit card number we will see is 8 digits,
|
|
40391
|
-
* while the longest we'd see is 19 digits according to ansi.org. We want to
|
|
40392
|
-
* allow any number with a length in that range that is not an AmEx Card.
|
|
40393
|
-
* Source: https://www.ansi.org/standards-news/all-news/2016/07/announcing-major-changes-to-the-issuer-identification-number-iin-standard-28
|
|
40394
|
-
*/
|
|
40395
|
-
validatorFns[IS_NOT_AMEX_CARD] = (value, args, form) =>
|
|
40396
|
-
new RegExp(/^([^3]\d{7,18}|3[^47]\d{6,17})$/).test(value);
|
|
40397
|
-
|
|
40398
40383
|
const runValidatorErrorMessage = (type) =>
|
|
40399
40384
|
`${type} was passed to runValidator, but that validator type does not exist.
|
|
40400
40385
|
Please check that you are only calling validator creator functions exported from
|
|
@@ -49566,7 +49551,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
49566
49551
|
}
|
|
49567
49552
|
}, []);
|
|
49568
49553
|
var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
|
|
49569
|
-
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), "
|
|
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"));
|
|
49570
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");
|
|
49571
49556
|
var cvvErrors = _defineProperty(_defineProperty({}, required.error, "CVV is required"), hasLength.error, "CVV is invalid");
|
|
49572
49557
|
var zipCodeErrors = _defineProperty(_defineProperty({}, required.error, "Zip code is required"), hasLength.error, "Zip code is invalid");
|
|
@@ -50702,6 +50687,7 @@ var Timeout = function Timeout(_ref) {
|
|
|
50702
50687
|
};
|
|
50703
50688
|
var Timeout$1 = withWindowSize(Timeout);
|
|
50704
50689
|
|
|
50690
|
+
var _excluded$F = ["variant", "message", "toastOpen", "closeToastNotification", "extraStyles", "minWidth", "maxWidth", "height", "childGap", "backgroundColor", "role", "ariaLive"];
|
|
50705
50691
|
var VARIANTS = {
|
|
50706
50692
|
SUCCESS: "success",
|
|
50707
50693
|
ERROR: "error"
|
|
@@ -50724,9 +50710,15 @@ var ToastNotification = function ToastNotification(_ref) {
|
|
|
50724
50710
|
childGap = _ref$childGap === void 0 ? "1rem" : _ref$childGap,
|
|
50725
50711
|
backgroundColor = _ref.backgroundColor,
|
|
50726
50712
|
_ref$role = _ref.role,
|
|
50727
|
-
role = _ref$role === void 0 ? "alert" : _ref$role
|
|
50728
|
-
|
|
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({
|
|
50729
50718
|
onClick: closeToastNotification,
|
|
50719
|
+
onKeyDown: function onKeyDown(e) {
|
|
50720
|
+
return e.key === "Enter" && closeToastNotification();
|
|
50721
|
+
},
|
|
50730
50722
|
background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === VARIANTS.ERROR ? ERROR_BACKGROUND_COLOR : WHITE,
|
|
50731
50723
|
minWidth: minWidth,
|
|
50732
50724
|
minHeight: height && parseInt(height) < 100 ? height : "100px",
|
|
@@ -50736,8 +50728,9 @@ var ToastNotification = function ToastNotification(_ref) {
|
|
|
50736
50728
|
borderRadius: "4px",
|
|
50737
50729
|
boxShadow: generateShadows().standard.base,
|
|
50738
50730
|
extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n "),
|
|
50739
|
-
role: role
|
|
50740
|
-
|
|
50731
|
+
role: role,
|
|
50732
|
+
"aria-live": ariaLive
|
|
50733
|
+
}, rest), /*#__PURE__*/React__default.createElement(Cluster, {
|
|
50741
50734
|
align: "center",
|
|
50742
50735
|
childGap: childGap,
|
|
50743
50736
|
justify: "space-between"
|
|
@@ -50885,7 +50878,7 @@ var PopupMenuItemContainer = styled__default(ButtonWithAction).withConfig({
|
|
|
50885
50878
|
return "\n background-color: ".concat(isDeleteAction ? theme.menuItemHoverBackgroundColorDelete : theme.menuItemHoverBackgroundColor, ";\n ");
|
|
50886
50879
|
});
|
|
50887
50880
|
|
|
50888
|
-
var _excluded$
|
|
50881
|
+
var _excluded$G = ["id", "closeMenuCallback", "action", "themeValues", "text", "hasIcon", "isDeleteAction", "icon", "textExtraStyles", "hoverStyles", "activeStyles", "extraStyles"];
|
|
50889
50882
|
var PopupMenuItem = function PopupMenuItem(_ref) {
|
|
50890
50883
|
var id = _ref.id,
|
|
50891
50884
|
closeMenuCallback = _ref.closeMenuCallback,
|
|
@@ -50901,7 +50894,7 @@ var PopupMenuItem = function PopupMenuItem(_ref) {
|
|
|
50901
50894
|
hoverStyles = _ref.hoverStyles,
|
|
50902
50895
|
activeStyles = _ref.activeStyles,
|
|
50903
50896
|
extraStyles = _ref.extraStyles,
|
|
50904
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
50897
|
+
rest = _objectWithoutProperties(_ref, _excluded$G);
|
|
50905
50898
|
return /*#__PURE__*/React__default.createElement(PopupMenuItemContainer, _extends({
|
|
50906
50899
|
id: id,
|
|
50907
50900
|
role: "menuItem",
|