@thecb/components 9.2.4-beta.12 → 9.2.4-beta.14
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 +56 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +56 -25
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.js +2 -0
- package/src/components/atoms/dropdown/Dropdown.js +3 -2
- package/src/components/atoms/form-layouts/FormInput.js +3 -0
- package/src/components/atoms/form-select/FormSelect.js +3 -1
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +3 -1
- package/src/components/molecules/address-form/AddressForm.js +5 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +6 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +5 -0
package/dist/index.cjs.js
CHANGED
|
@@ -23799,7 +23799,9 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
23799
23799
|
_ref13$smoothScroll = _ref13.smoothScroll,
|
|
23800
23800
|
smoothScroll = _ref13$smoothScroll === void 0 ? true : _ref13$smoothScroll,
|
|
23801
23801
|
_ref13$ariaInvalid = _ref13.ariaInvalid,
|
|
23802
|
-
ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid
|
|
23802
|
+
ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
|
|
23803
|
+
_ref13$isRequired = _ref13.isRequired,
|
|
23804
|
+
isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
|
|
23803
23805
|
|
|
23804
23806
|
var _useState = React.useState(""),
|
|
23805
23807
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24070,7 +24072,7 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24070
24072
|
},
|
|
24071
24073
|
padding: "12px",
|
|
24072
24074
|
placeholder: getSelection(),
|
|
24073
|
-
required: options.required,
|
|
24075
|
+
required: options.required || isRequired,
|
|
24074
24076
|
role: "combobox",
|
|
24075
24077
|
themeValues: themeValues,
|
|
24076
24078
|
title: hasTitles ? getSelection() : null,
|
|
@@ -24238,7 +24240,9 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24238
24240
|
_ref$dataQa = _ref.dataQa,
|
|
24239
24241
|
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
|
|
24240
24242
|
_ref$widthFitOptions = _ref.widthFitOptions,
|
|
24241
|
-
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions
|
|
24243
|
+
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
|
|
24244
|
+
_ref$isRequired = _ref.isRequired,
|
|
24245
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
24242
24246
|
|
|
24243
24247
|
var _useState = React.useState(false),
|
|
24244
24248
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24300,7 +24304,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24300
24304
|
},
|
|
24301
24305
|
disabled: disabled,
|
|
24302
24306
|
autocompleteValue: autocompleteValue,
|
|
24303
|
-
smoothScroll: smoothScroll
|
|
24307
|
+
smoothScroll: smoothScroll,
|
|
24308
|
+
isRequired: isRequired
|
|
24304
24309
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
24305
24310
|
direction: "row",
|
|
24306
24311
|
justify: "space-between"
|
|
@@ -25071,6 +25076,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25071
25076
|
fieldActions = _ref.fieldActions,
|
|
25072
25077
|
showErrors = _ref.showErrors,
|
|
25073
25078
|
onChange = _ref.onChange,
|
|
25079
|
+
_ref$isRequired = _ref.isRequired,
|
|
25080
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
|
|
25074
25081
|
_ref$dataQa = _ref.dataQa,
|
|
25075
25082
|
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
25076
25083
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
@@ -25082,7 +25089,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25082
25089
|
errorMessages: errorMessages,
|
|
25083
25090
|
showErrors: showErrors,
|
|
25084
25091
|
onChange: onChange,
|
|
25085
|
-
autocompleteValue: "country-name"
|
|
25092
|
+
autocompleteValue: "country-name",
|
|
25093
|
+
isRequired: isRequired
|
|
25086
25094
|
});
|
|
25087
25095
|
};
|
|
25088
25096
|
|
|
@@ -25929,7 +25937,7 @@ var fallbackValues$k = {
|
|
|
25929
25937
|
};
|
|
25930
25938
|
|
|
25931
25939
|
var _excluded$p = ["showErrors", "themeValues"],
|
|
25932
|
-
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa"];
|
|
25940
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
|
|
25933
25941
|
var InputField = styled__default.input.withConfig({
|
|
25934
25942
|
displayName: "FormInput__InputField",
|
|
25935
25943
|
componentId: "sc-l094r1-0"
|
|
@@ -26016,6 +26024,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26016
26024
|
removeFromValue = _ref15.removeFromValue,
|
|
26017
26025
|
_ref15$dataQa = _ref15.dataQa,
|
|
26018
26026
|
dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
|
|
26027
|
+
_ref15$isRequired = _ref15.isRequired,
|
|
26028
|
+
isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
|
|
26019
26029
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
26020
26030
|
|
|
26021
26031
|
var _useState = React.useState(false),
|
|
@@ -26102,7 +26112,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26102
26112
|
$customHeight: customHeight,
|
|
26103
26113
|
$extraStyles: extraStyles,
|
|
26104
26114
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26105
|
-
autoComplete: autocompleteValue
|
|
26115
|
+
autoComplete: autocompleteValue,
|
|
26116
|
+
required: isRequired
|
|
26106
26117
|
}, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
|
|
26107
26118
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26108
26119
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -26121,7 +26132,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26121
26132
|
$customHeight: customHeight,
|
|
26122
26133
|
$extraStyles: extraStyles,
|
|
26123
26134
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26124
|
-
autoComplete: autocompleteValue
|
|
26135
|
+
autoComplete: autocompleteValue,
|
|
26136
|
+
required: isRequired
|
|
26125
26137
|
}, props))), /*#__PURE__*/React__default.createElement(Stack, {
|
|
26126
26138
|
direction: "row",
|
|
26127
26139
|
justify: "space-between",
|
|
@@ -38118,7 +38130,9 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38118
38130
|
field = _ref.field,
|
|
38119
38131
|
fieldActions = _ref.fieldActions,
|
|
38120
38132
|
showErrors = _ref.showErrors,
|
|
38121
|
-
countryCode = _ref.countryCode
|
|
38133
|
+
countryCode = _ref.countryCode,
|
|
38134
|
+
_ref$isRequired = _ref.isRequired,
|
|
38135
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
38122
38136
|
var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
38123
38137
|
var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
|
|
38124
38138
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
@@ -38128,7 +38142,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38128
38142
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
38129
38143
|
errorMessages: errorMessages,
|
|
38130
38144
|
showErrors: showErrors,
|
|
38131
|
-
autocompleteValue: "address-level1"
|
|
38145
|
+
autocompleteValue: "address-level1",
|
|
38146
|
+
isRequired: isRequired
|
|
38132
38147
|
});
|
|
38133
38148
|
};
|
|
38134
38149
|
|
|
@@ -39467,7 +39482,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39467
39482
|
}
|
|
39468
39483
|
},
|
|
39469
39484
|
showErrors: showErrors,
|
|
39470
|
-
dataQa: "Country"
|
|
39485
|
+
dataQa: "Country",
|
|
39486
|
+
isRequired: true
|
|
39471
39487
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
39472
39488
|
labelTextWhenNoError: "Address",
|
|
39473
39489
|
errorMessages: street1ErrorMessages,
|
|
@@ -39478,7 +39494,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39478
39494
|
return e.key === "Enter" && handleSubmit(e);
|
|
39479
39495
|
},
|
|
39480
39496
|
autocompleteValue: "address-line1",
|
|
39481
|
-
dataQa: "Address"
|
|
39497
|
+
dataQa: "Address",
|
|
39498
|
+
isRequired: true
|
|
39482
39499
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
39483
39500
|
labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
|
|
39484
39501
|
field: fields.street2,
|
|
@@ -39499,7 +39516,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39499
39516
|
return e.key === "Enter" && handleSubmit(e);
|
|
39500
39517
|
},
|
|
39501
39518
|
autocompleteValue: "address-level2",
|
|
39502
|
-
dataQa: "City"
|
|
39519
|
+
dataQa: "City",
|
|
39520
|
+
isRequired: true
|
|
39503
39521
|
}), /*#__PURE__*/React__default.createElement(FormStateDropdown, {
|
|
39504
39522
|
labelTextWhenNoError: isUS ? "State" : "State or Province",
|
|
39505
39523
|
errorMessages: stateProvinceErrorMessages,
|
|
@@ -39510,7 +39528,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39510
39528
|
onKeyDown: function onKeyDown(e) {
|
|
39511
39529
|
return e.key === "Enter" && handleSubmit(e);
|
|
39512
39530
|
},
|
|
39513
|
-
dataQa: "State or Province"
|
|
39531
|
+
dataQa: "State or Province",
|
|
39532
|
+
isRequired: true
|
|
39514
39533
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
39515
39534
|
isNum: isUS,
|
|
39516
39535
|
formatter: isUS ? zipFormat : null,
|
|
@@ -39523,7 +39542,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39523
39542
|
return e.key === "Enter" && handleSubmit(e);
|
|
39524
39543
|
},
|
|
39525
39544
|
autocompleteValue: "postal-code",
|
|
39526
|
-
dataQa: "Zip code"
|
|
39545
|
+
dataQa: "Zip code",
|
|
39546
|
+
isRequired: true
|
|
39527
39547
|
}), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
39528
39548
|
name: "address checkbox",
|
|
39529
39549
|
title: "Save address to wallet",
|
|
@@ -47990,7 +48010,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47990
48010
|
onKeyDown: function onKeyDown(e) {
|
|
47991
48011
|
return e.key === "Enter" && handleSubmit(e);
|
|
47992
48012
|
},
|
|
47993
|
-
autocompleteValue: "name"
|
|
48013
|
+
autocompleteValue: "name",
|
|
48014
|
+
isRequired: true
|
|
47994
48015
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
47995
48016
|
labelTextWhenNoError: "Routing number",
|
|
47996
48017
|
dataQa: "Routing number",
|
|
@@ -48012,7 +48033,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48012
48033
|
},
|
|
48013
48034
|
onKeyDown: function onKeyDown(e) {
|
|
48014
48035
|
return e.key === "Enter" && handleSubmit(e);
|
|
48015
|
-
}
|
|
48036
|
+
},
|
|
48037
|
+
isRequired: true
|
|
48016
48038
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48017
48039
|
labelTextWhenNoError: "Confirm routing number",
|
|
48018
48040
|
dataQa: "Confirm routing number",
|
|
@@ -48023,7 +48045,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48023
48045
|
onKeyDown: function onKeyDown(e) {
|
|
48024
48046
|
return e.key === "Enter" && handleSubmit(e);
|
|
48025
48047
|
},
|
|
48026
|
-
isNum: true
|
|
48048
|
+
isNum: true,
|
|
48049
|
+
isRequired: true
|
|
48027
48050
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48028
48051
|
labelTextWhenNoError: "Account number",
|
|
48029
48052
|
dataQa: "Account number",
|
|
@@ -48045,7 +48068,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48045
48068
|
},
|
|
48046
48069
|
onKeyDown: function onKeyDown(e) {
|
|
48047
48070
|
return e.key === "Enter" && handleSubmit(e);
|
|
48048
|
-
}
|
|
48071
|
+
},
|
|
48072
|
+
isRequired: true
|
|
48049
48073
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48050
48074
|
labelTextWhenNoError: "Confirm account number",
|
|
48051
48075
|
dataQa: "Confirm account number",
|
|
@@ -48056,6 +48080,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48056
48080
|
onKeyDown: function onKeyDown(e) {
|
|
48057
48081
|
return e.key === "Enter" && handleSubmit(e);
|
|
48058
48082
|
},
|
|
48083
|
+
isRequired: true,
|
|
48059
48084
|
isNum: true
|
|
48060
48085
|
}), allowBankAccountType && /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
48061
48086
|
labelTextWhenNoError: "Account type",
|
|
@@ -48073,7 +48098,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48073
48098
|
fieldActions: actions.fields.accountType,
|
|
48074
48099
|
showErrors: showErrors,
|
|
48075
48100
|
errorMessages: accountTypeErrors,
|
|
48076
|
-
field: fields.accountType
|
|
48101
|
+
field: fields.accountType,
|
|
48102
|
+
isRequired: true
|
|
48077
48103
|
}), !hideDefaultPayment && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48078
48104
|
title: "Save as Default Payment Method",
|
|
48079
48105
|
dataQa: "default-payment-ach",
|
|
@@ -48211,7 +48237,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48211
48237
|
onKeyDown: function onKeyDown(e) {
|
|
48212
48238
|
return e.key === "Enter" && handleSubmit(e);
|
|
48213
48239
|
},
|
|
48214
|
-
autocompleteValue: "cc-name"
|
|
48240
|
+
autocompleteValue: "cc-name",
|
|
48241
|
+
isRequired: true
|
|
48215
48242
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48216
48243
|
labelTextWhenNoError: "Credit card number",
|
|
48217
48244
|
dataQa: "Credit card number",
|
|
@@ -48224,7 +48251,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48224
48251
|
return e.key === "Enter" && handleSubmit(e);
|
|
48225
48252
|
},
|
|
48226
48253
|
isNum: true,
|
|
48227
|
-
autocompleteValue: "cc-number"
|
|
48254
|
+
autocompleteValue: "cc-number",
|
|
48255
|
+
isRequired: true
|
|
48228
48256
|
}), /*#__PURE__*/React__default.createElement(FormInputRow, {
|
|
48229
48257
|
breakpoint: isMobile ? "1000rem" : "21rem",
|
|
48230
48258
|
childGap: isMobile ? "0rem" : "1rem"
|
|
@@ -48242,7 +48270,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48242
48270
|
isNum: true,
|
|
48243
48271
|
removeFromValue: /\// // removes "/" from browser autofill
|
|
48244
48272
|
,
|
|
48245
|
-
autocompleteValue: "cc-exp"
|
|
48273
|
+
autocompleteValue: "cc-exp",
|
|
48274
|
+
isRequired: true
|
|
48246
48275
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48247
48276
|
labelTextWhenNoError: "CVV",
|
|
48248
48277
|
dataQa: "CVV",
|
|
@@ -48255,7 +48284,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48255
48284
|
onKeyDown: function onKeyDown(e) {
|
|
48256
48285
|
return e.key === "Enter" && handleSubmit(e);
|
|
48257
48286
|
},
|
|
48258
|
-
autocompleteValue: "cc-csc"
|
|
48287
|
+
autocompleteValue: "cc-csc",
|
|
48288
|
+
isRequired: true
|
|
48259
48289
|
})), !hideZipCode && /*#__PURE__*/React__default.createElement(Box, {
|
|
48260
48290
|
padding: isMobile ? "0" : "0 0.5rem 0 0",
|
|
48261
48291
|
width: isMobile ? "100%" : "50%"
|
|
@@ -48271,7 +48301,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48271
48301
|
onKeyDown: function onKeyDown(e) {
|
|
48272
48302
|
return e.key === "Enter" && handleSubmit(e);
|
|
48273
48303
|
},
|
|
48274
|
-
autocompleteValue: "billing postal-code"
|
|
48304
|
+
autocompleteValue: "billing postal-code",
|
|
48305
|
+
isRequired: true
|
|
48275
48306
|
})), (showWalletCheckbox || showTerms) && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48276
48307
|
childGap: "4px",
|
|
48277
48308
|
align: "center"
|