@thecb/components 4.3.15 → 4.4.0-beta.1

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
@@ -40363,14 +40363,11 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40363
40363
  showErrors = _ref.showErrors,
40364
40364
  _ref$handleSubmit = _ref.handleSubmit,
40365
40365
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
40366
+ isMobile = _ref.isMobile,
40366
40367
  showWalletCheckbox = _ref.showWalletCheckbox,
40367
40368
  saveToWallet = _ref.saveToWallet,
40368
40369
  walletCheckboxMarked = _ref.walletCheckboxMarked,
40369
40370
  deniedCards = _ref.deniedCards;
40370
-
40371
- var _useContext = React.useContext(styled.ThemeContext),
40372
- isMobile = _useContext.isMobile;
40373
-
40374
40371
  React.useEffect(function () {
40375
40372
  if (deniedCards) {
40376
40373
  deniedCards.map(function (card) {
@@ -40434,8 +40431,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40434
40431
  },
40435
40432
  isNum: true
40436
40433
  }), /*#__PURE__*/React__default.createElement(FormInputRow, {
40437
- breakpoint: isMobile ? "1000rem" : "21rem",
40438
- childGap: isMobile ? "0rem" : "1rem"
40434
+ breakpoint: "20rem"
40439
40435
  }, /*#__PURE__*/React__default.createElement(FormInput$1, {
40440
40436
  labelTextWhenNoError: "Expiration date (MM/YY)",
40441
40437
  errorMessages: expirationDateErrors,
@@ -40480,8 +40476,6 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40480
40476
  })));
40481
40477
  };
40482
40478
 
40483
- var PaymentFormCard$1 = withWindowSize(PaymentFormCard);
40484
-
40485
40479
  var formConfig$8 = {
40486
40480
  country: {
40487
40481
  defaultValue: "US",
@@ -40513,9 +40507,9 @@ var _createFormState$8 = createFormState(formConfig$8),
40513
40507
  mapStateToProps$9 = _createFormState$8.mapStateToProps,
40514
40508
  mapDispatchToProps$8 = _createFormState$8.mapDispatchToProps;
40515
40509
 
40516
- PaymentFormCard$1.reducer = reducer$8;
40517
- PaymentFormCard$1.mapStateToProps = mapStateToProps$9;
40518
- PaymentFormCard$1.mapDispatchToProps = mapDispatchToProps$8;
40510
+ PaymentFormCard.reducer = reducer$8;
40511
+ PaymentFormCard.mapStateToProps = mapStateToProps$9;
40512
+ PaymentFormCard.mapDispatchToProps = mapDispatchToProps$8;
40519
40513
 
40520
40514
  var PhoneForm = function PhoneForm(_ref) {
40521
40515
  var _phoneErrorMessage;
@@ -41875,7 +41869,7 @@ exports.PasswordRequirements = PasswordRequirements;
41875
41869
  exports.PaymentButtonBar = PaymentButtonBar;
41876
41870
  exports.PaymentDetails = PaymentDetails$1;
41877
41871
  exports.PaymentFormACH = PaymentFormACH;
41878
- exports.PaymentFormCard = PaymentFormCard$1;
41872
+ exports.PaymentFormCard = PaymentFormCard;
41879
41873
  exports.PaymentIcon = PaymentIcon;
41880
41874
  exports.PaymentMethodAddIcon = PaymentMethodAddIcon$1;
41881
41875
  exports.PaymentMethodIcon = PaymentMethodIcon$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.3.15",
3
+ "version": "4.4.0-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,5 +1,4 @@
1
- import React, { useEffect, useContext } from "react";
2
- import { ThemeContext } from "styled-components";
1
+ import React, { useEffect } from "react";
3
2
  import { required, hasLength, matchesRegex } from "redux-freeform";
4
3
  import Checkbox from "../../atoms/checkbox";
5
4
  import CountryDropdown from "../../atoms/country-dropdown";
@@ -21,7 +20,6 @@ import {
21
20
  FormInputRow
22
21
  } from "../../atoms/form-layouts";
23
22
  import { Box } from "../../atoms/layouts";
24
- import withWindowSize from "../../withWindowSize";
25
23
 
26
24
  const PaymentFormCard = ({
27
25
  variant = "default",
@@ -31,12 +29,12 @@ const PaymentFormCard = ({
31
29
  actions,
32
30
  showErrors,
33
31
  handleSubmit = noop,
32
+ isMobile,
34
33
  showWalletCheckbox,
35
34
  saveToWallet,
36
35
  walletCheckboxMarked,
37
36
  deniedCards
38
37
  }) => {
39
- const { isMobile } = useContext(ThemeContext);
40
38
  useEffect(() => {
41
39
  if (deniedCards) {
42
40
  deniedCards.map(card =>
@@ -118,10 +116,7 @@ const PaymentFormCard = ({
118
116
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
119
117
  isNum
120
118
  />
121
- <FormInputRow
122
- breakpoint={isMobile ? "1000rem" : "21rem"}
123
- childGap={isMobile ? "0rem" : "1rem"}
124
- >
119
+ <FormInputRow breakpoint="20rem">
125
120
  <FormInput
126
121
  labelTextWhenNoError="Expiration date (MM/YY)"
127
122
  errorMessages={expirationDateErrors}
@@ -177,4 +172,4 @@ const PaymentFormCard = ({
177
172
  );
178
173
  };
179
174
 
180
- export default withWindowSize(PaymentFormCard);
175
+ export default PaymentFormCard;