@thecb/components 5.0.0 → 5.2.2

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
@@ -12549,7 +12549,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
12549
12549
  activeStyles: activeStyles,
12550
12550
  disabledStyles: disabledStyles,
12551
12551
  as: "button",
12552
- onClick: !isLoading && action,
12552
+ onClick: isLoading ? undefined : action,
12553
12553
  borderRadius: "2px",
12554
12554
  theme: themeContext,
12555
12555
  extraStyles: "margin: 0.5rem; ".concat(extraStyles),
@@ -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";
@@ -19270,15 +19288,12 @@ var DropdownIcon = function DropdownIcon() {
19270
19288
  transform: "translate(1 1)"
19271
19289
  }, /*#__PURE__*/React__default.createElement("g", {
19272
19290
  fillRule: "evenodd",
19273
- fill: "none",
19274
- id: "Symbols_1548197283918"
19291
+ fill: "none"
19275
19292
  }, /*#__PURE__*/React__default.createElement("g", {
19276
19293
  fill: "#333",
19277
- transform: "translate(-155 -22)",
19278
- id: "Dropdown/Closed_1548197283918"
19294
+ transform: "translate(-155 -22)"
19279
19295
  }, /*#__PURE__*/React__default.createElement("polygon", {
19280
19296
  points: "165.59 22.59 161 27.17 156.41 22.59 155 24 161 30 167 24",
19281
- id: "Path_1548197283918",
19282
19297
  vectorEffect: "non-scaling-stroke"
19283
19298
  })))));
19284
19299
  };
@@ -33446,6 +33461,33 @@ validatorFns[DATE_AFTER_TODAY] = (value, args, form) => {
33446
33461
  return dateValue.isAfter(now, unit);
33447
33462
  };
33448
33463
 
33464
+ const IS_VALID_MONTH = "validator/IS_VALID_MONTH";
33465
+ const IS_VALID_MONTH_ERROR = "error/IS_VALID_MONTH";
33466
+ const isValidMonth = createValidator(
33467
+ IS_VALID_MONTH,
33468
+ IS_VALID_MONTH_ERROR
33469
+ );
33470
+ validatorFns[IS_VALID_MONTH] = (value, args, form) => {
33471
+ if (value === "") {
33472
+ return true;
33473
+ }
33474
+ // Function takes one argument representing the character position
33475
+ // In a date string to identify where the month is
33476
+ // Eg "10/21/2021" - start position is 0
33477
+ // Or "18/03/1990" - start position is 3
33478
+ // Only works with two digit months (01, 02, 03, etc)
33479
+ const monthStartPosition = parseInt(args[0]);
33480
+ const monthEndPosition = monthStartPosition + 2;
33481
+ if (monthStartPosition === NaN) {
33482
+ throw new Error("Month start position has to be a valid integer string");
33483
+ }
33484
+ const month = parseInt(value.slice(monthStartPosition, monthEndPosition));
33485
+ if (month === NaN) {
33486
+ return false;
33487
+ }
33488
+ return month >= 1 && month <= 12;
33489
+ };
33490
+
33449
33491
  const MATCHES_REGEX = "validator/MATCHES_REGEX";
33450
33492
  const MATCHES_REGEX_ERROR = "error/MATCHES_REGEX";
33451
33493
  const matchesRegex = createValidator(MATCHES_REGEX, MATCHES_REGEX_ERROR);
@@ -40205,7 +40247,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40205
40247
  var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
40206
40248
 
40207
40249
  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);
40250
+ 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
40251
  var cvvErrors = (_cvvErrors = {}, _defineProperty(_cvvErrors, required.error, "CVV is required"), _defineProperty(_cvvErrors, hasLength.error, "CVV is invalid"), _cvvErrors);
40210
40252
  var zipCodeErrors = (_zipCodeErrors = {}, _defineProperty(_zipCodeErrors, required.error, "Zip code is required"), _defineProperty(_zipCodeErrors, hasLength.error, "Zip code is invalid"), _zipCodeErrors);
40211
40253
 
@@ -40311,7 +40353,7 @@ var formConfig$8 = {
40311
40353
  constraints: [onlyIntegers(), hasLength(0, 16)]
40312
40354
  },
40313
40355
  expirationDate: {
40314
- validators: [required(), hasLength(4, 4), dateAfterToday("MMYY", "month", true)],
40356
+ validators: [required(), hasLength(4, 4), isValidMonth(0), dateAfterToday("MMYY", "month", true)],
40315
40357
  constraints: [onlyIntegers(), hasLength(0, 4)]
40316
40358
  },
40317
40359
  cvv: {
@@ -41604,6 +41646,7 @@ exports.ButtonWithAction = ButtonWithAction;
41604
41646
  exports.ButtonWithLink = ButtonWithLink;
41605
41647
  exports.CalendarIcon = CalendarIcon;
41606
41648
  exports.CarrotIcon = CarrotIcon$1;
41649
+ exports.CashIcon = CashIcon;
41607
41650
  exports.Center = Center;
41608
41651
  exports.CenterSingle = CenterSingle$1;
41609
41652
  exports.CenterStack = CenterStack$1;