@thecb/components 9.1.3 → 9.1.4-beta.5
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 +61 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +61 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/country-dropdown/CountryDropdown.js +3 -1
- package/src/components/atoms/form-layouts/FormInput.js +3 -0
- package/src/components/atoms/form-select/FormSelect.js +3 -1
- package/src/components/{molecules → atoms/icons}/.DS_Store +0 -0
- package/src/components/atoms/layouts/Motion.styled.js +1 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +19 -3
- package/src/components/molecules/payment-form-ach/PaymentFormACH.state.js +2 -2
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +15 -1
- package/src/components/molecules/radio-section/RadioSection.js +4 -1
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -12406,7 +12406,7 @@ if (typeof window !== "undefined") {
|
|
|
12406
12406
|
var MotionWrapper = styled__default(motion.div).withConfig({
|
|
12407
12407
|
displayName: "Motionstyled__MotionWrapper",
|
|
12408
12408
|
componentId: "sc-1m6r1io-0"
|
|
12409
|
-
})(["position:", ";display:", ";box-sizing:border-box;padding:", ";border:", ";border-color:", ";border-
|
|
12409
|
+
})(["position:", ";display:", ";box-sizing:border-box;padding:", ";border:", ";border-color:", ";border-width:", ";border-style:", ";border-width:", ";border-radius:", ";background-color:", ";box-shadow:", ";min-height:", ";min-width:", ";height:", ";width:", ";text-align:", ";margin:", ";&:hover,&:focus{", ";}&:active{", ";}&:disabled{", ";}", ";"], function (_ref) {
|
|
12410
12410
|
var position = _ref.position;
|
|
12411
12411
|
return position;
|
|
12412
12412
|
}, function (_ref2) {
|
|
@@ -24203,7 +24203,9 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24203
24203
|
_ref$dataQa = _ref.dataQa,
|
|
24204
24204
|
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
|
|
24205
24205
|
_ref$widthFitOptions = _ref.widthFitOptions,
|
|
24206
|
-
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions
|
|
24206
|
+
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
|
|
24207
|
+
_ref$isRequired = _ref.isRequired,
|
|
24208
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
24207
24209
|
|
|
24208
24210
|
var _useState = React.useState(false),
|
|
24209
24211
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24265,7 +24267,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24265
24267
|
},
|
|
24266
24268
|
disabled: disabled,
|
|
24267
24269
|
autocompleteValue: autocompleteValue,
|
|
24268
|
-
smoothScroll: smoothScroll
|
|
24270
|
+
smoothScroll: smoothScroll,
|
|
24271
|
+
required: isRequired
|
|
24269
24272
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
24270
24273
|
direction: "row",
|
|
24271
24274
|
justify: "space-between"
|
|
@@ -25035,7 +25038,9 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25035
25038
|
showErrors = _ref.showErrors,
|
|
25036
25039
|
onChange = _ref.onChange,
|
|
25037
25040
|
_ref$dataQa = _ref.dataQa,
|
|
25038
|
-
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa
|
|
25041
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
|
|
25042
|
+
_ref$isRequired = _ref.isRequired,
|
|
25043
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
25039
25044
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
25040
25045
|
options: options,
|
|
25041
25046
|
field: field,
|
|
@@ -25045,7 +25050,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25045
25050
|
errorMessages: errorMessages,
|
|
25046
25051
|
showErrors: showErrors,
|
|
25047
25052
|
onChange: onChange,
|
|
25048
|
-
autocompleteValue: "country-name"
|
|
25053
|
+
autocompleteValue: "country-name",
|
|
25054
|
+
isRequired: isRequired
|
|
25049
25055
|
});
|
|
25050
25056
|
};
|
|
25051
25057
|
|
|
@@ -25890,7 +25896,7 @@ var fallbackValues$k = {
|
|
|
25890
25896
|
};
|
|
25891
25897
|
|
|
25892
25898
|
var _excluded$p = ["showErrors", "themeValues"],
|
|
25893
|
-
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa"];
|
|
25899
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
|
|
25894
25900
|
var InputField = styled__default.input.withConfig({
|
|
25895
25901
|
displayName: "FormInput__InputField",
|
|
25896
25902
|
componentId: "sc-l094r1-0"
|
|
@@ -25977,6 +25983,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25977
25983
|
removeFromValue = _ref15.removeFromValue,
|
|
25978
25984
|
_ref15$dataQa = _ref15.dataQa,
|
|
25979
25985
|
dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
|
|
25986
|
+
_ref15$isRequired = _ref15.isRequired,
|
|
25987
|
+
isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
|
|
25980
25988
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
25981
25989
|
|
|
25982
25990
|
var _useState = React.useState(false),
|
|
@@ -26063,7 +26071,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26063
26071
|
$customHeight: customHeight,
|
|
26064
26072
|
$extraStyles: extraStyles,
|
|
26065
26073
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26066
|
-
autoComplete: autocompleteValue
|
|
26074
|
+
autoComplete: autocompleteValue,
|
|
26075
|
+
required: isRequired
|
|
26067
26076
|
}, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
|
|
26068
26077
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26069
26078
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -26082,7 +26091,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26082
26091
|
$customHeight: customHeight,
|
|
26083
26092
|
$extraStyles: extraStyles,
|
|
26084
26093
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26085
|
-
autoComplete: autocompleteValue
|
|
26094
|
+
autoComplete: autocompleteValue,
|
|
26095
|
+
required: isRequired
|
|
26086
26096
|
}, props))), /*#__PURE__*/React__default.createElement(Stack, {
|
|
26087
26097
|
direction: "row",
|
|
26088
26098
|
justify: "space-between",
|
|
@@ -47857,7 +47867,7 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
|
47857
47867
|
};
|
|
47858
47868
|
|
|
47859
47869
|
var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
47860
|
-
var _routingNumberErrors, _accountNumberErrors;
|
|
47870
|
+
var _routingNumberErrors, _confirmRoutingNumber, _accountNumberErrors, _confirmAccountNumber;
|
|
47861
47871
|
|
|
47862
47872
|
var _ref$variant = _ref.variant,
|
|
47863
47873
|
variant = _ref$variant === void 0 ? "default" : _ref$variant,
|
|
@@ -47900,15 +47910,19 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47900
47910
|
var nameErrors = _defineProperty({}, required.error, "Name is required");
|
|
47901
47911
|
|
|
47902
47912
|
var routingNumberErrors = (_routingNumberErrors = {}, _defineProperty(_routingNumberErrors, required.error, "Routing number is required"), _defineProperty(_routingNumberErrors, hasLength.error, "Routing number must be 9 digits"), _defineProperty(_routingNumberErrors, isRoutingNumber.error, "Invalid routing number"), _routingNumberErrors);
|
|
47903
|
-
|
|
47904
|
-
var confirmRoutingNumberErrors = _defineProperty({}, matchesField.error, "Confirm routing number field must match routing number");
|
|
47905
|
-
|
|
47913
|
+
var confirmRoutingNumberErrors = (_confirmRoutingNumber = {}, _defineProperty(_confirmRoutingNumber, matchesField.error, "Confirm routing number field must match routing number"), _defineProperty(_confirmRoutingNumber, required.error, "Confirm routing number is required"), _confirmRoutingNumber);
|
|
47906
47914
|
var accountNumberErrors = (_accountNumberErrors = {}, _defineProperty(_accountNumberErrors, required.error, "Account number is required"), _defineProperty(_accountNumberErrors, hasLength.error, "Account number must be between 5 and 17 digits"), _accountNumberErrors);
|
|
47907
|
-
|
|
47908
|
-
var confirmAccountNumberErrors = _defineProperty({}, matchesField.error, "Confirm account number field must match account number");
|
|
47915
|
+
var confirmAccountNumberErrors = (_confirmAccountNumber = {}, _defineProperty(_confirmAccountNumber, matchesField.error, "Confirm account number field must match account number"), _defineProperty(_confirmAccountNumber, required.error, "Confirm account number is required"), _confirmAccountNumber);
|
|
47909
47916
|
|
|
47910
47917
|
var accountTypeErrors = _defineProperty({}, required.error, "Account type is required");
|
|
47911
47918
|
|
|
47919
|
+
var getIsRequiredFromValidators = React.useCallback(function (field) {
|
|
47920
|
+
var _field$validators;
|
|
47921
|
+
|
|
47922
|
+
return !!(field !== null && field !== void 0 && (_field$validators = field.validators) !== null && _field$validators !== void 0 && _field$validators.find(function (validator) {
|
|
47923
|
+
return validator.type === "validator/REQUIRED";
|
|
47924
|
+
}));
|
|
47925
|
+
}, []);
|
|
47912
47926
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
47913
47927
|
variant: variant,
|
|
47914
47928
|
role: "form",
|
|
@@ -47923,7 +47937,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47923
47937
|
onKeyDown: function onKeyDown(e) {
|
|
47924
47938
|
return e.key === "Enter" && handleSubmit(e);
|
|
47925
47939
|
},
|
|
47926
|
-
autocompleteValue: "name"
|
|
47940
|
+
autocompleteValue: "name",
|
|
47941
|
+
isRequired: getIsRequiredFromValidators(fields.name)
|
|
47927
47942
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
47928
47943
|
labelTextWhenNoError: "Routing number",
|
|
47929
47944
|
dataQa: "Routing number",
|
|
@@ -47931,6 +47946,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47931
47946
|
field: fields.routingNumber,
|
|
47932
47947
|
fieldActions: actions.fields.routingNumber,
|
|
47933
47948
|
showErrors: showErrors,
|
|
47949
|
+
isRequired: getIsRequiredFromValidators(fields.routingNumber),
|
|
47934
47950
|
isNum: true,
|
|
47935
47951
|
helperModal: function helperModal() {
|
|
47936
47952
|
return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
|
|
@@ -47956,6 +47972,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47956
47972
|
onKeyDown: function onKeyDown(e) {
|
|
47957
47973
|
return e.key === "Enter" && handleSubmit(e);
|
|
47958
47974
|
},
|
|
47975
|
+
isRequired: getIsRequiredFromValidators(fields.confirmRoutingNumber),
|
|
47959
47976
|
isNum: true
|
|
47960
47977
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
47961
47978
|
labelTextWhenNoError: "Account number",
|
|
@@ -47964,6 +47981,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47964
47981
|
field: fields.accountNumber,
|
|
47965
47982
|
fieldActions: actions.fields.accountNumber,
|
|
47966
47983
|
showErrors: showErrors,
|
|
47984
|
+
isRequired: getIsRequiredFromValidators(fields.accountNumber),
|
|
47967
47985
|
isNum: true,
|
|
47968
47986
|
helperModal: function helperModal() {
|
|
47969
47987
|
return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
|
|
@@ -47989,6 +48007,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47989
48007
|
onKeyDown: function onKeyDown(e) {
|
|
47990
48008
|
return e.key === "Enter" && handleSubmit(e);
|
|
47991
48009
|
},
|
|
48010
|
+
isRequired: getIsRequiredFromValidators(fields.confirmAccountNumber),
|
|
47992
48011
|
isNum: true
|
|
47993
48012
|
}), allowBankAccountType && /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
47994
48013
|
labelTextWhenNoError: "Account type",
|
|
@@ -48006,7 +48025,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48006
48025
|
fieldActions: actions.fields.accountType,
|
|
48007
48026
|
showErrors: showErrors,
|
|
48008
48027
|
errorMessages: accountTypeErrors,
|
|
48009
|
-
field: fields.accountType
|
|
48028
|
+
field: fields.accountType,
|
|
48029
|
+
isRequired: getIsRequiredFromValidators(fields.accountType)
|
|
48010
48030
|
}), !hideDefaultPayment && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48011
48031
|
title: "Save as Default Payment Method",
|
|
48012
48032
|
dataQa: "default-payment-ach",
|
|
@@ -48042,7 +48062,7 @@ var formConfig$6 = {
|
|
|
48042
48062
|
constraints: [onlyIntegers(), hasLength(0, 9)]
|
|
48043
48063
|
},
|
|
48044
48064
|
confirmRoutingNumber: {
|
|
48045
|
-
validators: [matchesField("routingNumber")],
|
|
48065
|
+
validators: [matchesField("routingNumber"), required()],
|
|
48046
48066
|
constraints: [onlyIntegers(), hasLength(0, 9)]
|
|
48047
48067
|
},
|
|
48048
48068
|
accountNumber: {
|
|
@@ -48050,7 +48070,7 @@ var formConfig$6 = {
|
|
|
48050
48070
|
constraints: [onlyIntegers(), hasLength(0, 17)]
|
|
48051
48071
|
},
|
|
48052
48072
|
confirmAccountNumber: {
|
|
48053
|
-
validators: [matchesField("accountNumber")],
|
|
48073
|
+
validators: [matchesField("accountNumber"), required()],
|
|
48054
48074
|
constraints: [onlyIntegers(), hasLength(0, 17)]
|
|
48055
48075
|
},
|
|
48056
48076
|
accountType: {
|
|
@@ -48091,6 +48111,13 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48091
48111
|
isMobile = _useContext.isMobile;
|
|
48092
48112
|
|
|
48093
48113
|
var showTerms = !!termsContent;
|
|
48114
|
+
var getIsRequiredFromValidators = React.useCallback(function (field) {
|
|
48115
|
+
var _field$validators;
|
|
48116
|
+
|
|
48117
|
+
return !!(field !== null && field !== void 0 && (_field$validators = field.validators) !== null && _field$validators !== void 0 && _field$validators.find(function (validator) {
|
|
48118
|
+
return validator.type === "validator/REQUIRED";
|
|
48119
|
+
}));
|
|
48120
|
+
}, []);
|
|
48094
48121
|
React.useEffect(function () {
|
|
48095
48122
|
if (deniedCards) {
|
|
48096
48123
|
deniedCards.map(function (card) {
|
|
@@ -48133,7 +48160,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48133
48160
|
}
|
|
48134
48161
|
},
|
|
48135
48162
|
showErrors: showErrors,
|
|
48136
|
-
dataQa: "Country"
|
|
48163
|
+
dataQa: "Country",
|
|
48164
|
+
isRequired: getIsRequiredFromValidators(fields.country)
|
|
48137
48165
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48138
48166
|
labelTextWhenNoError: "Name on card",
|
|
48139
48167
|
dataQa: "Name on card",
|
|
@@ -48144,7 +48172,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48144
48172
|
onKeyDown: function onKeyDown(e) {
|
|
48145
48173
|
return e.key === "Enter" && handleSubmit(e);
|
|
48146
48174
|
},
|
|
48147
|
-
autocompleteValue: "cc-name"
|
|
48175
|
+
autocompleteValue: "cc-name",
|
|
48176
|
+
isRequired: getIsRequiredFromValidators(fields.nameOnCard)
|
|
48148
48177
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48149
48178
|
labelTextWhenNoError: "Credit card number",
|
|
48150
48179
|
dataQa: "Credit card number",
|
|
@@ -48157,7 +48186,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48157
48186
|
return e.key === "Enter" && handleSubmit(e);
|
|
48158
48187
|
},
|
|
48159
48188
|
isNum: true,
|
|
48160
|
-
autocompleteValue: "cc-number"
|
|
48189
|
+
autocompleteValue: "cc-number",
|
|
48190
|
+
isRequired: getIsRequiredFromValidators(fields.creditCardNumber)
|
|
48161
48191
|
}), /*#__PURE__*/React__default.createElement(FormInputRow, {
|
|
48162
48192
|
breakpoint: isMobile ? "1000rem" : "21rem",
|
|
48163
48193
|
childGap: isMobile ? "0rem" : "1rem"
|
|
@@ -48175,7 +48205,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48175
48205
|
isNum: true,
|
|
48176
48206
|
removeFromValue: /\// // removes "/" from browser autofill
|
|
48177
48207
|
,
|
|
48178
|
-
autocompleteValue: "cc-exp"
|
|
48208
|
+
autocompleteValue: "cc-exp",
|
|
48209
|
+
isRequired: getIsRequiredFromValidators(fields.expirationDate)
|
|
48179
48210
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48180
48211
|
labelTextWhenNoError: "CVV",
|
|
48181
48212
|
dataQa: "CVV",
|
|
@@ -48188,7 +48219,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48188
48219
|
onKeyDown: function onKeyDown(e) {
|
|
48189
48220
|
return e.key === "Enter" && handleSubmit(e);
|
|
48190
48221
|
},
|
|
48191
|
-
autocompleteValue: "cc-csc"
|
|
48222
|
+
autocompleteValue: "cc-csc",
|
|
48223
|
+
isRequired: getIsRequiredFromValidators(fields.cvv)
|
|
48192
48224
|
})), !hideZipCode && /*#__PURE__*/React__default.createElement(Box, {
|
|
48193
48225
|
padding: isMobile ? "0" : "0 0.5rem 0 0",
|
|
48194
48226
|
width: isMobile ? "100%" : "50%"
|
|
@@ -48204,7 +48236,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48204
48236
|
onKeyDown: function onKeyDown(e) {
|
|
48205
48237
|
return e.key === "Enter" && handleSubmit(e);
|
|
48206
48238
|
},
|
|
48207
|
-
autocompleteValue: "billing postal-code"
|
|
48239
|
+
autocompleteValue: "billing postal-code",
|
|
48240
|
+
isRequired: getIsRequiredFromValidators(fields.zipCode)
|
|
48208
48241
|
})), (showWalletCheckbox || showTerms) && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48209
48242
|
childGap: "4px",
|
|
48210
48243
|
align: "center"
|
|
@@ -48635,7 +48668,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48635
48668
|
extraStyles: borderStyles,
|
|
48636
48669
|
role: "radio",
|
|
48637
48670
|
"aria-checked": openSection === section.id,
|
|
48638
|
-
|
|
48671
|
+
disabled: section.disabled,
|
|
48672
|
+
required: section === null || section === void 0 ? void 0 : section.required
|
|
48639
48673
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48640
48674
|
childGap: "0"
|
|
48641
48675
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -48665,6 +48699,8 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48665
48699
|
}, !section.hideRadioButton && /*#__PURE__*/React__default.createElement(Box, {
|
|
48666
48700
|
padding: "0"
|
|
48667
48701
|
}, /*#__PURE__*/React__default.createElement(RadioButton$2, {
|
|
48702
|
+
role: "radio",
|
|
48703
|
+
required: !!(section !== null && section !== void 0 && section.required),
|
|
48668
48704
|
id: "radio-input-".concat(idString(section)),
|
|
48669
48705
|
name: idString(section),
|
|
48670
48706
|
ariaDescribedBy: ariaDescribedBy,
|