@thecb/components 9.0.0-beta.3 → 9.0.0-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 +29 -33
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +29 -33
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +2 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.js +2 -2
- package/src/components/atoms/display-box/DisplayBox.js +1 -6
- package/src/components/atoms/dropdown/Dropdown.js +5 -6
- package/src/components/atoms/form-layouts/index.d.ts +1 -1
- package/src/components/atoms/form-select/FormSelect.js +9 -4
- package/src/components/atoms/form-select/index.d.ts +1 -1
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +1 -4
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +1 -1
- package/src/components/molecules/address-form/AddressForm.js +8 -2
- package/src/components/molecules/link-card/index.d.ts +1 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -1
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV1.js +2 -3
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +2 -3
package/dist/index.cjs.js
CHANGED
|
@@ -22115,7 +22115,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
22115
22115
|
extraStyles = _ref4.extraStyles,
|
|
22116
22116
|
textExtraStyles = _ref4.textExtraStyles,
|
|
22117
22117
|
_ref4$dataQa = _ref4.dataQa,
|
|
22118
|
-
dataQa = _ref4$dataQa === void 0 ?
|
|
22118
|
+
dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
|
|
22119
22119
|
|
|
22120
22120
|
var _useState = React.useState(false),
|
|
22121
22121
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -22158,6 +22158,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
22158
22158
|
"aria-invalid": error,
|
|
22159
22159
|
"aria-describedby": error ? "".concat(name, "-error-message") : ""
|
|
22160
22160
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
22161
|
+
role: "checkbox",
|
|
22161
22162
|
error: error,
|
|
22162
22163
|
disabled: disabled,
|
|
22163
22164
|
checked: checked,
|
|
@@ -23994,17 +23995,20 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
23994
23995
|
as: "input",
|
|
23995
23996
|
"aria-multiline": "false",
|
|
23996
23997
|
autoComplete: autocompleteValue,
|
|
23997
|
-
"aria-controls": "".concat(
|
|
23998
|
+
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
23998
23999
|
"aria-activedescendant": "focused_option",
|
|
23999
24000
|
"aria-owns": "".concat(ariaLabelledby, "_listbox"),
|
|
24000
24001
|
"aria-haspopup": "listbox",
|
|
24001
24002
|
"aria-labelledby": ariaLabelledby,
|
|
24002
24003
|
"aria-describedby": ariaDescribedby,
|
|
24003
24004
|
"aria-expanded": isOpen,
|
|
24005
|
+
"aria-required": options.required,
|
|
24006
|
+
"aria-invalid": ariaInvalid,
|
|
24004
24007
|
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
24005
24008
|
borderRadius: "2px",
|
|
24006
24009
|
borderSize: "1px",
|
|
24007
24010
|
borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
|
|
24011
|
+
dataQa: placeholder,
|
|
24008
24012
|
extraStyles: disabled ? "".concat(inputPlaceholderTextStyle).concat(inputDisabledStyle) : inputPlaceholderTextStyle,
|
|
24009
24013
|
hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
|
|
24010
24014
|
isOpen: isOpen,
|
|
@@ -24020,17 +24024,14 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24020
24024
|
},
|
|
24021
24025
|
padding: "12px",
|
|
24022
24026
|
placeholder: getSelection(),
|
|
24027
|
+
required: options.required,
|
|
24023
24028
|
role: "combobox",
|
|
24024
24029
|
themeValues: themeValues,
|
|
24025
24030
|
title: hasTitles ? getSelection() : null,
|
|
24026
24031
|
type: "text",
|
|
24027
24032
|
tabIndex: 0,
|
|
24028
24033
|
value: inputValue,
|
|
24029
|
-
width: "100%"
|
|
24030
|
-
dataQa: placeholder,
|
|
24031
|
-
required: options.required,
|
|
24032
|
-
"aria-required": options.required,
|
|
24033
|
-
"aria-invalid": ariaInvalid
|
|
24034
|
+
width: "100%"
|
|
24034
24035
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
24035
24036
|
open: isOpen,
|
|
24036
24037
|
onClick: _onClick
|
|
@@ -24072,8 +24073,7 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24072
24073
|
title: hasTitles ? choice.text : null,
|
|
24073
24074
|
onFocus: function onFocus() {
|
|
24074
24075
|
return setFocusedRef(optionRefs.current[i]);
|
|
24075
|
-
}
|
|
24076
|
-
role: "option"
|
|
24076
|
+
}
|
|
24077
24077
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
24078
24078
|
variant: "p",
|
|
24079
24079
|
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
@@ -24182,11 +24182,11 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24182
24182
|
_ref$hasTitles = _ref.hasTitles,
|
|
24183
24183
|
hasTitles = _ref$hasTitles === void 0 ? false : _ref$hasTitles,
|
|
24184
24184
|
_ref$autocompleteValu = _ref.autocompleteValue,
|
|
24185
|
-
autocompleteValue = _ref$autocompleteValu === void 0 ?
|
|
24185
|
+
autocompleteValue = _ref$autocompleteValu === void 0 ? null : _ref$autocompleteValu,
|
|
24186
24186
|
_ref$smoothScroll = _ref.smoothScroll,
|
|
24187
24187
|
smoothScroll = _ref$smoothScroll === void 0 ? true : _ref$smoothScroll,
|
|
24188
24188
|
_ref$dataQa = _ref.dataQa,
|
|
24189
|
-
dataQa = _ref$dataQa === void 0 ?
|
|
24189
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
24190
24190
|
|
|
24191
24191
|
var _useState = React.useState(false),
|
|
24192
24192
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24210,6 +24210,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24210
24210
|
return /*#__PURE__*/React__default.createElement(SelectContainer, {
|
|
24211
24211
|
ref: dropdownRef,
|
|
24212
24212
|
disabled: disabled,
|
|
24213
|
+
"aria-disabled": disabled,
|
|
24213
24214
|
"data-qa": dataQa
|
|
24214
24215
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
24215
24216
|
padding: "0",
|
|
@@ -24225,7 +24226,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24225
24226
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24226
24227
|
id: createIdFromString(labelTextWhenNoError)
|
|
24227
24228
|
}, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
24228
|
-
ariaLabelledby: labelTextWhenNoError,
|
|
24229
|
+
ariaLabelledby: createIdFromString(labelTextWhenNoError),
|
|
24229
24230
|
ariaDescribedBy: createIdFromString(labelTextWhenNoError, "error message"),
|
|
24230
24231
|
maxHeight: dropdownMaxHeight,
|
|
24231
24232
|
hasTitles: hasTitles,
|
|
@@ -25015,13 +25016,13 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25015
25016
|
showErrors = _ref.showErrors,
|
|
25016
25017
|
onChange = _ref.onChange,
|
|
25017
25018
|
_ref$dataQa = _ref.dataQa,
|
|
25018
|
-
dataQa = _ref$dataQa === void 0 ?
|
|
25019
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
25019
25020
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
25020
25021
|
options: options,
|
|
25021
25022
|
field: field,
|
|
25022
25023
|
fieldActions: fieldActions,
|
|
25023
25024
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
25024
|
-
dataQa: dataQa,
|
|
25025
|
+
dataQa: dataQa || "CountryDropdown",
|
|
25025
25026
|
errorMessages: errorMessages,
|
|
25026
25027
|
showErrors: showErrors,
|
|
25027
25028
|
onChange: onChange,
|
|
@@ -25173,7 +25174,7 @@ var DisplayBox = function DisplayBox(_ref) {
|
|
|
25173
25174
|
themeValues = _ref.themeValues,
|
|
25174
25175
|
showError = _ref.showError,
|
|
25175
25176
|
_ref$dataQa = _ref.dataQa,
|
|
25176
|
-
dataQa = _ref$dataQa === void 0 ?
|
|
25177
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
25177
25178
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
25178
25179
|
padding: "0.5rem 0 1.5rem 0"
|
|
25179
25180
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -37957,9 +37958,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
37957
37958
|
showErrors = _ref.showErrors,
|
|
37958
37959
|
countryCode = _ref.countryCode,
|
|
37959
37960
|
_ref$autocompleteValu = _ref.autocompleteValue,
|
|
37960
|
-
autocompleteValue = _ref$autocompleteValu === void 0 ?
|
|
37961
|
-
_ref$dataQa = _ref.dataQa,
|
|
37962
|
-
dataQa = _ref$dataQa === void 0 ? "StateProvinceDropdown" : _ref$dataQa;
|
|
37961
|
+
autocompleteValue = _ref$autocompleteValu === void 0 ? null : _ref$autocompleteValu;
|
|
37963
37962
|
var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
37964
37963
|
var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
|
|
37965
37964
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
@@ -37969,9 +37968,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
37969
37968
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
37970
37969
|
errorMessages: errorMessages,
|
|
37971
37970
|
showErrors: showErrors,
|
|
37972
|
-
|
|
37973
|
-
autocompleteValue: autocompleteValue,
|
|
37974
|
-
dataQa: dataQa
|
|
37971
|
+
autocompleteValue: autocompleteValue
|
|
37975
37972
|
});
|
|
37976
37973
|
};
|
|
37977
37974
|
|
|
@@ -40363,7 +40360,9 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
40363
40360
|
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
40364
40361
|
showWalletCheckbox = _ref.showWalletCheckbox,
|
|
40365
40362
|
saveToWallet = _ref.saveToWallet,
|
|
40366
|
-
walletCheckboxMarked = _ref.walletCheckboxMarked
|
|
40363
|
+
walletCheckboxMarked = _ref.walletCheckboxMarked,
|
|
40364
|
+
_ref$dataQa = _ref.dataQa,
|
|
40365
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
40367
40366
|
|
|
40368
40367
|
if (clearOnDismount) {
|
|
40369
40368
|
React.useEffect(function () {
|
|
@@ -40387,7 +40386,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
40387
40386
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
40388
40387
|
variant: variant,
|
|
40389
40388
|
role: "form",
|
|
40390
|
-
"aria-label": "Address"
|
|
40389
|
+
"aria-label": "Address",
|
|
40390
|
+
dataQa: dataQa
|
|
40391
40391
|
}, /*#__PURE__*/React__default.createElement(FormInputColumn, null, /*#__PURE__*/React__default.createElement(CountryDropdown, {
|
|
40392
40392
|
labelTextWhenNoError: "Country",
|
|
40393
40393
|
errorMessages: countryErrorMessages,
|
|
@@ -48536,7 +48536,7 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
|
|
|
48536
48536
|
imageType = _ref.imageType,
|
|
48537
48537
|
themeValues = _ref.themeValues,
|
|
48538
48538
|
_ref$dataQa = _ref.dataQa,
|
|
48539
|
-
dataQa = _ref$dataQa === void 0 ?
|
|
48539
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
48540
48540
|
return /*#__PURE__*/React__default.createElement(Modal$1, {
|
|
48541
48541
|
modalOpen: isOpen,
|
|
48542
48542
|
hideModal: function hideModal() {
|
|
@@ -48685,9 +48685,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
|
48685
48685
|
terms = _ref.terms,
|
|
48686
48686
|
_ref$error = _ref.error,
|
|
48687
48687
|
error = _ref$error === void 0 ? false : _ref$error,
|
|
48688
|
-
linkVariant = _ref.linkVariant
|
|
48689
|
-
_ref$dataQa = _ref.dataQa,
|
|
48690
|
-
dataQa = _ref$dataQa === void 0 ? "TermsAndConditionsControlV1" : _ref$dataQa;
|
|
48688
|
+
linkVariant = _ref.linkVariant;
|
|
48691
48689
|
|
|
48692
48690
|
var _useState = React.useState(false),
|
|
48693
48691
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -48695,7 +48693,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
|
48695
48693
|
toggleShowTerms = _useState2[1];
|
|
48696
48694
|
|
|
48697
48695
|
return /*#__PURE__*/React__default.createElement(DisplayBox$1, {
|
|
48698
|
-
|
|
48696
|
+
dataQa: "TermsAndConditionsControlV1"
|
|
48699
48697
|
}, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48700
48698
|
name: "terms",
|
|
48701
48699
|
title: "Terms and Conditions",
|
|
@@ -48778,9 +48776,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48778
48776
|
_ref$checkboxMargin = _ref.checkboxMargin,
|
|
48779
48777
|
checkboxMargin = _ref$checkboxMargin === void 0 ? "4px 8px 4px 4px" : _ref$checkboxMargin,
|
|
48780
48778
|
_ref$modalTitle = _ref.modalTitle,
|
|
48781
|
-
modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle
|
|
48782
|
-
_ref$dataQa = _ref.dataQa,
|
|
48783
|
-
dataQa = _ref$dataQa === void 0 ? "TermsAndConditionsControlV2" : _ref$dataQa;
|
|
48779
|
+
modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
|
|
48784
48780
|
|
|
48785
48781
|
var _useState = React.useState(false),
|
|
48786
48782
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -48803,7 +48799,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48803
48799
|
background: displayInline ? "transparent" : containerBackground,
|
|
48804
48800
|
boxShadow: displayInline ? "none" : standardBoxShadow,
|
|
48805
48801
|
borderRadius: displayInline ? "0" : "4px",
|
|
48806
|
-
dataQa:
|
|
48802
|
+
dataQa: "TermsAndConditionsControlV2"
|
|
48807
48803
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48808
48804
|
childGap: "0"
|
|
48809
48805
|
}, html && /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -49164,7 +49160,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
49164
49160
|
childGap: isMobile ? "0rem" : "1rem"
|
|
49165
49161
|
}, /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
49166
49162
|
labelTextWhenNoError: "Expiration date (MM/YY)",
|
|
49167
|
-
dataQa: "Expiration date",
|
|
49163
|
+
dataQa: "Expiration date (MM/YY)",
|
|
49168
49164
|
errorMessages: expirationDateErrors,
|
|
49169
49165
|
field: fields.expirationDate,
|
|
49170
49166
|
fieldActions: actions.fields.expirationDate,
|