@thecb/components 4.3.12 → 4.3.13

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
@@ -15886,10 +15886,19 @@ function _assertThisInitialized(self) {
15886
15886
  return self;
15887
15887
  }
15888
15888
 
15889
+ function _setPrototypeOf(o, p) {
15890
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
15891
+ o.__proto__ = p;
15892
+ return o;
15893
+ };
15894
+
15895
+ return _setPrototypeOf(o, p);
15896
+ }
15897
+
15889
15898
  function _inheritsLoose(subClass, superClass) {
15890
15899
  subClass.prototype = Object.create(superClass.prototype);
15891
15900
  subClass.prototype.constructor = subClass;
15892
- subClass.__proto__ = superClass;
15901
+ _setPrototypeOf(subClass, superClass);
15893
15902
  }
15894
15903
 
15895
15904
  function _getPrototypeOf(o) {
@@ -15899,15 +15908,6 @@ function _getPrototypeOf(o) {
15899
15908
  return _getPrototypeOf(o);
15900
15909
  }
15901
15910
 
15902
- function _setPrototypeOf(o, p) {
15903
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
15904
- o.__proto__ = p;
15905
- return o;
15906
- };
15907
-
15908
- return _setPrototypeOf(o, p);
15909
- }
15910
-
15911
15911
  function _isNativeFunction(fn) {
15912
15912
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
15913
15913
  }
@@ -15918,7 +15918,7 @@ function _isNativeReflectConstruct() {
15918
15918
  if (typeof Proxy === "function") return true;
15919
15919
 
15920
15920
  try {
15921
- Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
15921
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
15922
15922
  return true;
15923
15923
  } catch (e) {
15924
15924
  return false;
@@ -16058,7 +16058,9 @@ var ERRORS = {
16058
16058
  "73": "Please provide a valid CSS variable.\n\n",
16059
16059
  "74": "CSS variable not found and no default was provided.\n\n",
16060
16060
  "75": "important requires a valid style object, got a %s instead.\n\n",
16061
- "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
16061
+ "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
16062
+ "77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
16063
+ "78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
16062
16064
  };
16063
16065
  /**
16064
16066
  * super basic version of sprintf
@@ -40361,11 +40363,14 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40361
40363
  showErrors = _ref.showErrors,
40362
40364
  _ref$handleSubmit = _ref.handleSubmit,
40363
40365
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
40364
- isMobile = _ref.isMobile,
40365
40366
  showWalletCheckbox = _ref.showWalletCheckbox,
40366
40367
  saveToWallet = _ref.saveToWallet,
40367
40368
  walletCheckboxMarked = _ref.walletCheckboxMarked,
40368
40369
  deniedCards = _ref.deniedCards;
40370
+
40371
+ var _useContext = React.useContext(styled.ThemeContext),
40372
+ isMobile = _useContext.isMobile;
40373
+
40369
40374
  React.useEffect(function () {
40370
40375
  if (deniedCards) {
40371
40376
  deniedCards.map(function (card) {
@@ -40429,7 +40434,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40429
40434
  },
40430
40435
  isNum: true
40431
40436
  }), /*#__PURE__*/React__default.createElement(FormInputRow, {
40432
- breakpoint: "20rem"
40437
+ breakpoint: isMobile ? "1000rem" : "21rem",
40438
+ childGap: isMobile ? "0rem" : "1rem"
40433
40439
  }, /*#__PURE__*/React__default.createElement(FormInput$1, {
40434
40440
  labelTextWhenNoError: "Expiration date (MM/YY)",
40435
40441
  errorMessages: expirationDateErrors,
@@ -40474,6 +40480,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40474
40480
  })));
40475
40481
  };
40476
40482
 
40483
+ var PaymentFormCard$1 = withWindowSize(PaymentFormCard);
40484
+
40477
40485
  var formConfig$8 = {
40478
40486
  country: {
40479
40487
  defaultValue: "US",
@@ -40505,9 +40513,9 @@ var _createFormState$8 = createFormState(formConfig$8),
40505
40513
  mapStateToProps$9 = _createFormState$8.mapStateToProps,
40506
40514
  mapDispatchToProps$8 = _createFormState$8.mapDispatchToProps;
40507
40515
 
40508
- PaymentFormCard.reducer = reducer$8;
40509
- PaymentFormCard.mapStateToProps = mapStateToProps$9;
40510
- PaymentFormCard.mapDispatchToProps = mapDispatchToProps$8;
40516
+ PaymentFormCard$1.reducer = reducer$8;
40517
+ PaymentFormCard$1.mapStateToProps = mapStateToProps$9;
40518
+ PaymentFormCard$1.mapDispatchToProps = mapDispatchToProps$8;
40511
40519
 
40512
40520
  var PhoneForm = function PhoneForm(_ref) {
40513
40521
  var _phoneErrorMessage;
@@ -41867,7 +41875,7 @@ exports.PasswordRequirements = PasswordRequirements;
41867
41875
  exports.PaymentButtonBar = PaymentButtonBar;
41868
41876
  exports.PaymentDetails = PaymentDetails$1;
41869
41877
  exports.PaymentFormACH = PaymentFormACH;
41870
- exports.PaymentFormCard = PaymentFormCard;
41878
+ exports.PaymentFormCard = PaymentFormCard$1;
41871
41879
  exports.PaymentIcon = PaymentIcon;
41872
41880
  exports.PaymentMethodAddIcon = PaymentMethodAddIcon$1;
41873
41881
  exports.PaymentMethodIcon = PaymentMethodIcon$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.3.12",
3
+ "version": "4.3.13",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,4 +1,5 @@
1
- import React, { useEffect } from "react";
1
+ import React, { useEffect, useContext } from "react";
2
+ import { ThemeContext } from "styled-components";
2
3
  import { required, hasLength, matchesRegex } from "redux-freeform";
3
4
  import Checkbox from "../../atoms/checkbox";
4
5
  import CountryDropdown from "../../atoms/country-dropdown";
@@ -20,6 +21,7 @@ import {
20
21
  FormInputRow
21
22
  } from "../../atoms/form-layouts";
22
23
  import { Box } from "../../atoms/layouts";
24
+ import withWindowSize from "../../withWindowSize";
23
25
 
24
26
  const PaymentFormCard = ({
25
27
  variant = "default",
@@ -29,12 +31,12 @@ const PaymentFormCard = ({
29
31
  actions,
30
32
  showErrors,
31
33
  handleSubmit = noop,
32
- isMobile,
33
34
  showWalletCheckbox,
34
35
  saveToWallet,
35
36
  walletCheckboxMarked,
36
37
  deniedCards
37
38
  }) => {
39
+ const { isMobile } = useContext(ThemeContext);
38
40
  useEffect(() => {
39
41
  if (deniedCards) {
40
42
  deniedCards.map(card =>
@@ -116,7 +118,10 @@ const PaymentFormCard = ({
116
118
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
117
119
  isNum
118
120
  />
119
- <FormInputRow breakpoint="20rem">
121
+ <FormInputRow
122
+ breakpoint={isMobile ? "1000rem" : "21rem"}
123
+ childGap={isMobile ? "0rem" : "1rem"}
124
+ >
120
125
  <FormInput
121
126
  labelTextWhenNoError="Expiration date (MM/YY)"
122
127
  errorMessages={expirationDateErrors}
@@ -172,4 +177,4 @@ const PaymentFormCard = ({
172
177
  );
173
178
  };
174
179
 
175
- export default PaymentFormCard;
180
+ export default withWindowSize(PaymentFormCard);