@thecb/components 5.0.0 → 5.2.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 +48 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +48 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/icons/CashIcon.js +21 -0
- package/src/components/atoms/icons/index.js +3 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +3 -1
package/dist/index.cjs.js
CHANGED
|
@@ -15273,6 +15273,24 @@ var WarningIconXS = function WarningIconXS() {
|
|
|
15273
15273
|
})))));
|
|
15274
15274
|
};
|
|
15275
15275
|
|
|
15276
|
+
var CashIcon = function CashIcon() {
|
|
15277
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
15278
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15279
|
+
width: "36",
|
|
15280
|
+
height: "24",
|
|
15281
|
+
fill: "none",
|
|
15282
|
+
viewBox: "0 0 36 24"
|
|
15283
|
+
}, /*#__PURE__*/React__default.createElement("rect", {
|
|
15284
|
+
width: "36",
|
|
15285
|
+
height: "24",
|
|
15286
|
+
fill: "#E8FFEF",
|
|
15287
|
+
rx: "1"
|
|
15288
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
15289
|
+
fill: "#317D4F",
|
|
15290
|
+
d: "M17.178 5.464v1.372c-1.799.294-3.115 1.407-3.094 3.08.021 1.645 1.05 2.597 2.611 2.884l1.617.308c.924.182 1.365.406 1.365 1.085 0 .609-.553 1.092-1.484 1.092-1.036 0-1.743-.455-1.932-1.267l-2.478.021c.175 1.834 1.414 2.8 3.374 3.038v1.197h2.023V17.07c1.876-.266 3.024-1.33 3.024-2.877 0-1.617-.798-2.751-2.702-3.178l-1.603-.357c-.994-.231-1.267-.497-1.267-1.029 0-.546.511-1.015 1.596-1.015 1.015 0 1.302.511 1.393 1.267l2.415-.014c.05-1.484-1.043-2.695-2.835-3.024V5.464h-2.023z"
|
|
15291
|
+
}));
|
|
15292
|
+
};
|
|
15293
|
+
|
|
15276
15294
|
var color$2 = "#15749D";
|
|
15277
15295
|
var hoverColor$1 = "#116285";
|
|
15278
15296
|
var activeColor$1 = "#0E506D";
|
|
@@ -33446,6 +33464,33 @@ validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
|
|
|
33446
33464
|
return dateValue.isAfter(now, unit);
|
|
33447
33465
|
};
|
|
33448
33466
|
|
|
33467
|
+
const IS_VALID_MONTH = "validator/IS_VALID_MONTH";
|
|
33468
|
+
const IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
|
|
33469
|
+
const isValidMonth$1 = createValidator(
|
|
33470
|
+
IS_VALID_MONTH,
|
|
33471
|
+
IS_VALID_MONTH_ERROR
|
|
33472
|
+
);
|
|
33473
|
+
validatorFns[IS_VALID_MONTH] = (value, args, form) => {
|
|
33474
|
+
if (value === "") {
|
|
33475
|
+
return true;
|
|
33476
|
+
}
|
|
33477
|
+
// Function takes one argument representing the character position
|
|
33478
|
+
// In a date string to identify where the month is
|
|
33479
|
+
// Eg "10/21/2021" - start position is 0
|
|
33480
|
+
// Or "18/03/1990" - start position is 3
|
|
33481
|
+
// Only works with two digit months (01, 02, 03, etc)
|
|
33482
|
+
const monthStartPosition = parseInt(args[0]);
|
|
33483
|
+
const monthEndPosition = monthStartPosition + 2;
|
|
33484
|
+
if (monthStartPosition === NaN) {
|
|
33485
|
+
throw new Error("Month start position has to be a valid integer string");
|
|
33486
|
+
}
|
|
33487
|
+
const month = parseInt(value.slice(monthStartPosition, monthEndPosition));
|
|
33488
|
+
if (month === NaN) {
|
|
33489
|
+
return false;
|
|
33490
|
+
}
|
|
33491
|
+
return month >= 1 && month <= 12;
|
|
33492
|
+
};
|
|
33493
|
+
|
|
33449
33494
|
const MATCHES_REGEX = "validator/MATCHES_REGEX";
|
|
33450
33495
|
const MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
|
|
33451
33496
|
const matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
|
|
@@ -40205,7 +40250,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
40205
40250
|
var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
|
|
40206
40251
|
|
|
40207
40252
|
var creditCardNumberErrors = (_creditCardNumberErro = {}, _defineProperty(_creditCardNumberErro, required.error, "Credit card number is required"), _defineProperty(_creditCardNumberErro, hasLength.error, "Credit card number is invalid"), _defineProperty(_creditCardNumberErro, matchesRegex.error, "".concat(displayCardBrand(fields.creditCardNumber.rawValue), " is not accepted")), _creditCardNumberErro);
|
|
40208
|
-
var expirationDateErrors = (_expirationDateErrors = {}, _defineProperty(_expirationDateErrors, required.error, "Expiration date is required"), _defineProperty(_expirationDateErrors, hasLength.error, "Expiration date is invalid"), _defineProperty(_expirationDateErrors, dateAfterToday.error, "Expiration date is invalid"), _expirationDateErrors);
|
|
40253
|
+
var expirationDateErrors = (_expirationDateErrors = {}, _defineProperty(_expirationDateErrors, required.error, "Expiration date is required"), _defineProperty(_expirationDateErrors, hasLength.error, "Expiration date is invalid"), _defineProperty(_expirationDateErrors, isValidMonth.error, "Expiration month is invalid"), _defineProperty(_expirationDateErrors, dateAfterToday.error, "Expiration date is invalid"), _expirationDateErrors);
|
|
40209
40254
|
var cvvErrors = (_cvvErrors = {}, _defineProperty(_cvvErrors, required.error, "CVV is required"), _defineProperty(_cvvErrors, hasLength.error, "CVV is invalid"), _cvvErrors);
|
|
40210
40255
|
var zipCodeErrors = (_zipCodeErrors = {}, _defineProperty(_zipCodeErrors, required.error, "Zip code is required"), _defineProperty(_zipCodeErrors, hasLength.error, "Zip code is invalid"), _zipCodeErrors);
|
|
40211
40256
|
|
|
@@ -40311,7 +40356,7 @@ var formConfig$8 = {
|
|
|
40311
40356
|
constraints: [onlyIntegers(), hasLength(0, 16)]
|
|
40312
40357
|
},
|
|
40313
40358
|
expirationDate: {
|
|
40314
|
-
validators: [required(), hasLength(4, 4), dateAfterToday("MMYY", "month", true)],
|
|
40359
|
+
validators: [required(), hasLength(4, 4), isValidMonth$1(0), dateAfterToday("MMYY", "month", true)],
|
|
40315
40360
|
constraints: [onlyIntegers(), hasLength(0, 4)]
|
|
40316
40361
|
},
|
|
40317
40362
|
cvv: {
|
|
@@ -41604,6 +41649,7 @@ exports.ButtonWithAction = ButtonWithAction;
|
|
|
41604
41649
|
exports.ButtonWithLink = ButtonWithLink;
|
|
41605
41650
|
exports.CalendarIcon = CalendarIcon;
|
|
41606
41651
|
exports.CarrotIcon = CarrotIcon$1;
|
|
41652
|
+
exports.CashIcon = CashIcon;
|
|
41607
41653
|
exports.Center = Center;
|
|
41608
41654
|
exports.CenterSingle = CenterSingle$1;
|
|
41609
41655
|
exports.CenterStack = CenterStack$1;
|