@thecb/components 9.2.4-beta.10 → 9.2.4-beta.2
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 +108 -52
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +108 -52
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +3 -1
- package/src/components/atoms/checkbox/Checkbox.stories.js +3 -2
- package/src/components/atoms/country-dropdown/CountryDropdown.js +3 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +1 -0
- package/src/components/atoms/dropdown/Dropdown.js +7 -3
- package/src/components/atoms/form-layouts/FormInput.js +3 -0
- package/src/components/atoms/form-select/FormSelect.js +22 -9
- package/src/components/atoms/form-select/FormSelect.stories.js +2 -2
- package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +12 -7
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +4 -1
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +1 -0
- package/src/components/molecules/address-form/AddressForm.js +6 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +6 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +6 -0
- package/src/components/molecules/radio-group/RadioGroup.js +5 -2
- package/src/components/molecules/radio-group/RadioGroup.stories.js +1 -0
- package/src/components/molecules/radio-section/RadioSection.js +3 -5
- package/src/components/molecules/radio-section/RadioSection.stories.js +0 -1
- package/src/components/molecules/radio-section/radio-button/RadioButton.js +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -22134,7 +22134,9 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
22134
22134
|
extraStyles = _ref4.extraStyles,
|
|
22135
22135
|
textExtraStyles = _ref4.textExtraStyles,
|
|
22136
22136
|
_ref4$dataQa = _ref4.dataQa,
|
|
22137
|
-
dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa
|
|
22137
|
+
dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa,
|
|
22138
|
+
_ref4$isRequired = _ref4.isRequired,
|
|
22139
|
+
isRequired = _ref4$isRequired === void 0 ? false : _ref4$isRequired;
|
|
22138
22140
|
|
|
22139
22141
|
var _useState = React.useState(false),
|
|
22140
22142
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -22188,7 +22190,8 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
22188
22190
|
errorStyles: themeValues.errorStyles,
|
|
22189
22191
|
disabledStyles: themeValues.disabledStyles,
|
|
22190
22192
|
disabledCheckedStyles: themeValues.disabledCheckedStyles,
|
|
22191
|
-
focusedStyles: themeValues.focusedStyles
|
|
22193
|
+
focusedStyles: themeValues.focusedStyles,
|
|
22194
|
+
"aria-required": isRequired
|
|
22192
22195
|
}, /*#__PURE__*/React__default.createElement(CheckboxIcon, {
|
|
22193
22196
|
viewBox: "0 0 24 24",
|
|
22194
22197
|
disabled: disabled,
|
|
@@ -23799,7 +23802,11 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
23799
23802
|
_ref13$smoothScroll = _ref13.smoothScroll,
|
|
23800
23803
|
smoothScroll = _ref13$smoothScroll === void 0 ? true : _ref13$smoothScroll,
|
|
23801
23804
|
_ref13$ariaInvalid = _ref13.ariaInvalid,
|
|
23802
|
-
ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid
|
|
23805
|
+
ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
|
|
23806
|
+
_ref13$isRequired = _ref13.isRequired,
|
|
23807
|
+
isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
|
|
23808
|
+
|
|
23809
|
+
var required = options.required || isRequired;
|
|
23803
23810
|
|
|
23804
23811
|
var _useState = React.useState(""),
|
|
23805
23812
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24048,7 +24055,7 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24048
24055
|
"aria-labelledby": ariaLabelledby,
|
|
24049
24056
|
"aria-describedby": ariaDescribedby,
|
|
24050
24057
|
"aria-expanded": isOpen,
|
|
24051
|
-
"aria-required":
|
|
24058
|
+
"aria-required": required,
|
|
24052
24059
|
"aria-invalid": ariaInvalid,
|
|
24053
24060
|
background: isOpen ? themeValues.hoverColor : WHITE,
|
|
24054
24061
|
borderRadius: "2px",
|
|
@@ -24070,7 +24077,6 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24070
24077
|
},
|
|
24071
24078
|
padding: "12px",
|
|
24072
24079
|
placeholder: getSelection(),
|
|
24073
|
-
required: options.required,
|
|
24074
24080
|
role: "combobox",
|
|
24075
24081
|
themeValues: themeValues,
|
|
24076
24082
|
title: hasTitles ? getSelection() : null,
|
|
@@ -24078,6 +24084,9 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24078
24084
|
tabIndex: 0,
|
|
24079
24085
|
value: inputValue,
|
|
24080
24086
|
width: "100%"
|
|
24087
|
+
/* Non-semantic elements need the aria-* version of the attribute */
|
|
24088
|
+
,
|
|
24089
|
+
"aria-disabled": disabledValues.includes(inputValue)
|
|
24081
24090
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
24082
24091
|
open: isOpen,
|
|
24083
24092
|
onClick: _onClick
|
|
@@ -24088,7 +24097,8 @@ var Dropdown = function Dropdown(_ref13) {
|
|
|
24088
24097
|
widthFitOptions: widthFitOptions,
|
|
24089
24098
|
tabIndex: 0,
|
|
24090
24099
|
role: "listbox",
|
|
24091
|
-
id: "".concat(ariaLabelledby, "_listbox")
|
|
24100
|
+
id: "".concat(ariaLabelledby, "_listbox"),
|
|
24101
|
+
required: required
|
|
24092
24102
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
24093
24103
|
childGap: "0",
|
|
24094
24104
|
as: "ul"
|
|
@@ -24238,7 +24248,9 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24238
24248
|
_ref$dataQa = _ref.dataQa,
|
|
24239
24249
|
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
|
|
24240
24250
|
_ref$widthFitOptions = _ref.widthFitOptions,
|
|
24241
|
-
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions
|
|
24251
|
+
widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
|
|
24252
|
+
_ref$isRequired = _ref.isRequired,
|
|
24253
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
24242
24254
|
|
|
24243
24255
|
var _useState = React.useState(false),
|
|
24244
24256
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -24246,6 +24258,17 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24246
24258
|
setOpen = _useState2[1];
|
|
24247
24259
|
|
|
24248
24260
|
var dropdownRef = React.useRef(null);
|
|
24261
|
+
var required = (options === null || options === void 0 ? void 0 : options.required) || isRequired;
|
|
24262
|
+
var labelId = React.useMemo(function () {
|
|
24263
|
+
return function (labelTextWhenNoError) {
|
|
24264
|
+
return createIdFromString(labelTextWhenNoError);
|
|
24265
|
+
};
|
|
24266
|
+
}, [labelTextWhenNoError]);
|
|
24267
|
+
var descriptionId = React.useMemo(function () {
|
|
24268
|
+
return function (field, labelTextWhenNoError) {
|
|
24269
|
+
return field.hasErrors && field.dirty ? labelId(labelTextWhenNoError) + "error-message" : "";
|
|
24270
|
+
};
|
|
24271
|
+
}, [field, labelTextWhenNoError]);
|
|
24249
24272
|
|
|
24250
24273
|
var handleClickAway = function handleClickAway(event) {
|
|
24251
24274
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -24261,8 +24284,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24261
24284
|
});
|
|
24262
24285
|
return /*#__PURE__*/React__default.createElement(SelectContainer, {
|
|
24263
24286
|
ref: dropdownRef,
|
|
24287
|
+
"aria-role": "group",
|
|
24264
24288
|
disabled: disabled,
|
|
24265
|
-
"aria-disabled": disabled,
|
|
24266
24289
|
"data-qa": dataQa
|
|
24267
24290
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
24268
24291
|
padding: "0",
|
|
@@ -24276,10 +24299,10 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24276
24299
|
color: themeValues.labelColor,
|
|
24277
24300
|
weight: themeValues.fontWeight,
|
|
24278
24301
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24279
|
-
id:
|
|
24302
|
+
id: labelId(labelTextWhenNoError)
|
|
24280
24303
|
}, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
24281
|
-
ariaLabelledby:
|
|
24282
|
-
ariaDescribedby:
|
|
24304
|
+
ariaLabelledby: labelId(labelTextWhenNoError),
|
|
24305
|
+
ariaDescribedby: descriptionId(field, labelTextWhenNoError),
|
|
24283
24306
|
maxHeight: dropdownMaxHeight,
|
|
24284
24307
|
widthFitOptions: widthFitOptions,
|
|
24285
24308
|
hasTitles: hasTitles,
|
|
@@ -24300,7 +24323,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24300
24323
|
},
|
|
24301
24324
|
disabled: disabled,
|
|
24302
24325
|
autocompleteValue: autocompleteValue,
|
|
24303
|
-
smoothScroll: smoothScroll
|
|
24326
|
+
smoothScroll: smoothScroll,
|
|
24327
|
+
isRequired: required
|
|
24304
24328
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
24305
24329
|
direction: "row",
|
|
24306
24330
|
justify: "space-between"
|
|
@@ -25072,7 +25096,9 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25072
25096
|
showErrors = _ref.showErrors,
|
|
25073
25097
|
onChange = _ref.onChange,
|
|
25074
25098
|
_ref$dataQa = _ref.dataQa,
|
|
25075
|
-
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa
|
|
25099
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
|
|
25100
|
+
_ref$isRequired = _ref.isRequired,
|
|
25101
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
25076
25102
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
25077
25103
|
options: options,
|
|
25078
25104
|
field: field,
|
|
@@ -25082,7 +25108,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
|
|
|
25082
25108
|
errorMessages: errorMessages,
|
|
25083
25109
|
showErrors: showErrors,
|
|
25084
25110
|
onChange: onChange,
|
|
25085
|
-
autocompleteValue: "country-name"
|
|
25111
|
+
autocompleteValue: "country-name",
|
|
25112
|
+
isRequired: isRequired
|
|
25086
25113
|
});
|
|
25087
25114
|
};
|
|
25088
25115
|
|
|
@@ -25929,7 +25956,7 @@ var fallbackValues$k = {
|
|
|
25929
25956
|
};
|
|
25930
25957
|
|
|
25931
25958
|
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"];
|
|
25959
|
+
_excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
|
|
25933
25960
|
var InputField = styled__default.input.withConfig({
|
|
25934
25961
|
displayName: "FormInput__InputField",
|
|
25935
25962
|
componentId: "sc-l094r1-0"
|
|
@@ -26016,6 +26043,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26016
26043
|
removeFromValue = _ref15.removeFromValue,
|
|
26017
26044
|
_ref15$dataQa = _ref15.dataQa,
|
|
26018
26045
|
dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
|
|
26046
|
+
_ref15$isRequired = _ref15.isRequired,
|
|
26047
|
+
isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
|
|
26019
26048
|
props = _objectWithoutProperties(_ref15, _excluded2);
|
|
26020
26049
|
|
|
26021
26050
|
var _useState = React.useState(false),
|
|
@@ -26102,7 +26131,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26102
26131
|
$customHeight: customHeight,
|
|
26103
26132
|
$extraStyles: extraStyles,
|
|
26104
26133
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26105
|
-
autoComplete: autocompleteValue
|
|
26134
|
+
autoComplete: autocompleteValue,
|
|
26135
|
+
required: isRequired
|
|
26106
26136
|
}, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
|
|
26107
26137
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26108
26138
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -26121,7 +26151,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26121
26151
|
$customHeight: customHeight,
|
|
26122
26152
|
$extraStyles: extraStyles,
|
|
26123
26153
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26124
|
-
autoComplete: autocompleteValue
|
|
26154
|
+
autoComplete: autocompleteValue,
|
|
26155
|
+
required: isRequired
|
|
26125
26156
|
}, props))), /*#__PURE__*/React__default.createElement(Stack, {
|
|
26126
26157
|
direction: "row",
|
|
26127
26158
|
justify: "space-between",
|
|
@@ -27254,7 +27285,7 @@ var HiddenRadioInput = styled__default.input.withConfig({
|
|
|
27254
27285
|
var Circle = styled__default.div.withConfig({
|
|
27255
27286
|
displayName: "RadioButtonWithLabel__Circle",
|
|
27256
27287
|
componentId: "sc-1m9whwg-1"
|
|
27257
|
-
})(["flex-shrink:0;margin-right:8px;width:1.5rem;height
|
|
27288
|
+
})(["flex-shrink:0;margin-right:8px;width:1.5rem;height:1.5rem;border:", ";border-radius:50%;box-sizing:border-box;padding:2px;:after{content:\"\";width:100%;height:100%;display:block;background:", ";border-radius:50%;transform:scale(0);}"], function (_ref) {
|
|
27258
27289
|
var inactiveBorderColor = _ref.inactiveBorderColor;
|
|
27259
27290
|
return "1px solid ".concat(inactiveBorderColor);
|
|
27260
27291
|
}, function (_ref2) {
|
|
@@ -27264,12 +27295,12 @@ var Circle = styled__default.div.withConfig({
|
|
|
27264
27295
|
var InputAndLabelContainer = styled__default(Cluster).withConfig({
|
|
27265
27296
|
displayName: "RadioButtonWithLabel__InputAndLabelContainer",
|
|
27266
27297
|
componentId: "sc-1m9whwg-2"
|
|
27267
|
-
})(["overflow:visible;", ":checked + label ", ":after{transform:scale(0.85);transition:transform 0.15s;}", ":checked + label ", "{border:", "}", ":focus + label ", "{
|
|
27298
|
+
})(["overflow:visible;", ":checked + label ", ":after{transform:scale(0.85);transition:transform 0.15s;}", ":checked + label ", "{border:", ";}", ":focus + label ", "{box-shadow:", ";}"], HiddenRadioInput, Circle, HiddenRadioInput, Circle, function (_ref3) {
|
|
27268
27299
|
var activeColor = _ref3.activeColor;
|
|
27269
|
-
return "1px solid "
|
|
27300
|
+
return "1px solid " + activeColor;
|
|
27270
27301
|
}, HiddenRadioInput, Circle, function (_ref4) {
|
|
27271
27302
|
var activeColor = _ref4.activeColor;
|
|
27272
|
-
return "0px 0px 2px 1px "
|
|
27303
|
+
return "0px 0px 2px 1px " + activeColor;
|
|
27273
27304
|
});
|
|
27274
27305
|
|
|
27275
27306
|
var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
@@ -27287,7 +27318,9 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27287
27318
|
_ref5$handleChange = _ref5.handleChange,
|
|
27288
27319
|
handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
|
|
27289
27320
|
field = _ref5.field,
|
|
27290
|
-
config = _ref5.config
|
|
27321
|
+
config = _ref5.config,
|
|
27322
|
+
_ref5$isRequired = _ref5.isRequired,
|
|
27323
|
+
isRequired = _ref5$isRequired === void 0 ? false : _ref5$isRequired;
|
|
27291
27324
|
|
|
27292
27325
|
var getDefaultChecked = function getDefaultChecked(value, idx) {
|
|
27293
27326
|
var selectionExistsInConfig = config === null || config === void 0 ? void 0 : config.map(function (c) {
|
|
@@ -27320,7 +27353,8 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
|
|
|
27320
27353
|
setValue(e.target.value);
|
|
27321
27354
|
handleChange(e);
|
|
27322
27355
|
},
|
|
27323
|
-
defaultChecked: getDefaultChecked(value, index)
|
|
27356
|
+
defaultChecked: getDefaultChecked(value, index),
|
|
27357
|
+
required: isRequired
|
|
27324
27358
|
}), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
27325
27359
|
as: "label",
|
|
27326
27360
|
htmlFor: id,
|
|
@@ -27364,8 +27398,8 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
27364
27398
|
ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
|
|
27365
27399
|
_ref2$ariaLabel = _ref2.ariaLabel,
|
|
27366
27400
|
ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel,
|
|
27367
|
-
_ref2$
|
|
27368
|
-
|
|
27401
|
+
_ref2$required = _ref2.required,
|
|
27402
|
+
required = _ref2$required === void 0 ? false : _ref2$required;
|
|
27369
27403
|
var buttonBorder = {
|
|
27370
27404
|
onFocused: {
|
|
27371
27405
|
borderColor: themeValues.activeColor,
|
|
@@ -27425,10 +27459,11 @@ var RadioButton$1 = function RadioButton(_ref2) {
|
|
|
27425
27459
|
type: "radio",
|
|
27426
27460
|
id: "radio-".concat(name),
|
|
27427
27461
|
disabled: disabled,
|
|
27462
|
+
required: required,
|
|
27463
|
+
"aria-required": required,
|
|
27428
27464
|
onClick: toggleRadio,
|
|
27429
27465
|
"aria-describedby": ariaDescribedBy,
|
|
27430
|
-
tabIndex: "-1"
|
|
27431
|
-
required: isRequired
|
|
27466
|
+
tabIndex: "-1"
|
|
27432
27467
|
}, extraProps)), /*#__PURE__*/React__default.createElement(Motion, {
|
|
27433
27468
|
borderWidth: "1px",
|
|
27434
27469
|
borderStyle: "solid",
|
|
@@ -38118,7 +38153,9 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38118
38153
|
field = _ref.field,
|
|
38119
38154
|
fieldActions = _ref.fieldActions,
|
|
38120
38155
|
showErrors = _ref.showErrors,
|
|
38121
|
-
countryCode = _ref.countryCode
|
|
38156
|
+
countryCode = _ref.countryCode,
|
|
38157
|
+
_ref$isRequired = _ref.isRequired,
|
|
38158
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
38122
38159
|
var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
38123
38160
|
var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
|
|
38124
38161
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
@@ -38128,7 +38165,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
38128
38165
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
38129
38166
|
errorMessages: errorMessages,
|
|
38130
38167
|
showErrors: showErrors,
|
|
38131
|
-
autocompleteValue: "address-level1"
|
|
38168
|
+
autocompleteValue: "address-level1",
|
|
38169
|
+
isRequired: isRequired
|
|
38132
38170
|
});
|
|
38133
38171
|
};
|
|
38134
38172
|
|
|
@@ -39454,6 +39492,7 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39454
39492
|
labelTextWhenNoError: "Country",
|
|
39455
39493
|
errorMessages: countryErrorMessages,
|
|
39456
39494
|
field: fields.country,
|
|
39495
|
+
isRequired: true,
|
|
39457
39496
|
onChange: function onChange(value) {
|
|
39458
39497
|
actions.fields.country.set(value); // temporary measure to not dirty fields until
|
|
39459
39498
|
// we can write a reset function for fields
|
|
@@ -39478,7 +39517,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39478
39517
|
return e.key === "Enter" && handleSubmit(e);
|
|
39479
39518
|
},
|
|
39480
39519
|
autocompleteValue: "address-line1",
|
|
39481
|
-
dataQa: "Address"
|
|
39520
|
+
dataQa: "Address",
|
|
39521
|
+
isRequired: true
|
|
39482
39522
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
39483
39523
|
labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
|
|
39484
39524
|
field: fields.street2,
|
|
@@ -39488,7 +39528,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39488
39528
|
return e.key === "Enter" && handleSubmit(e);
|
|
39489
39529
|
},
|
|
39490
39530
|
autocompleteValue: "address-line2",
|
|
39491
|
-
dataQa: "Address Line 2"
|
|
39531
|
+
dataQa: "Address Line 2",
|
|
39532
|
+
isRequired: false
|
|
39492
39533
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
39493
39534
|
labelTextWhenNoError: "City",
|
|
39494
39535
|
errorMessages: cityErrorMessages,
|
|
@@ -39499,7 +39540,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39499
39540
|
return e.key === "Enter" && handleSubmit(e);
|
|
39500
39541
|
},
|
|
39501
39542
|
autocompleteValue: "address-level2",
|
|
39502
|
-
dataQa: "City"
|
|
39543
|
+
dataQa: "City",
|
|
39544
|
+
isRequired: true
|
|
39503
39545
|
}), /*#__PURE__*/React__default.createElement(FormStateDropdown, {
|
|
39504
39546
|
labelTextWhenNoError: isUS ? "State" : "State or Province",
|
|
39505
39547
|
errorMessages: stateProvinceErrorMessages,
|
|
@@ -39510,7 +39552,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39510
39552
|
onKeyDown: function onKeyDown(e) {
|
|
39511
39553
|
return e.key === "Enter" && handleSubmit(e);
|
|
39512
39554
|
},
|
|
39513
|
-
dataQa: "State or Province"
|
|
39555
|
+
dataQa: "State or Province",
|
|
39556
|
+
isRequired: true
|
|
39514
39557
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
39515
39558
|
isNum: isUS,
|
|
39516
39559
|
formatter: isUS ? zipFormat : null,
|
|
@@ -39523,7 +39566,8 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
39523
39566
|
return e.key === "Enter" && handleSubmit(e);
|
|
39524
39567
|
},
|
|
39525
39568
|
autocompleteValue: "postal-code",
|
|
39526
|
-
dataQa: "Zip code"
|
|
39569
|
+
dataQa: "Zip code",
|
|
39570
|
+
isRequired: true
|
|
39527
39571
|
}), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
39528
39572
|
name: "address checkbox",
|
|
39529
39573
|
title: "Save address to wallet",
|
|
@@ -47990,7 +48034,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47990
48034
|
onKeyDown: function onKeyDown(e) {
|
|
47991
48035
|
return e.key === "Enter" && handleSubmit(e);
|
|
47992
48036
|
},
|
|
47993
|
-
autocompleteValue: "name"
|
|
48037
|
+
autocompleteValue: "name",
|
|
48038
|
+
isRequired: true
|
|
47994
48039
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
47995
48040
|
labelTextWhenNoError: "Routing number",
|
|
47996
48041
|
dataQa: "Routing number",
|
|
@@ -48012,7 +48057,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48012
48057
|
},
|
|
48013
48058
|
onKeyDown: function onKeyDown(e) {
|
|
48014
48059
|
return e.key === "Enter" && handleSubmit(e);
|
|
48015
|
-
}
|
|
48060
|
+
},
|
|
48061
|
+
isRequired: true
|
|
48016
48062
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48017
48063
|
labelTextWhenNoError: "Confirm routing number",
|
|
48018
48064
|
dataQa: "Confirm routing number",
|
|
@@ -48023,6 +48069,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48023
48069
|
onKeyDown: function onKeyDown(e) {
|
|
48024
48070
|
return e.key === "Enter" && handleSubmit(e);
|
|
48025
48071
|
},
|
|
48072
|
+
isRequired: true,
|
|
48026
48073
|
isNum: true
|
|
48027
48074
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48028
48075
|
labelTextWhenNoError: "Account number",
|
|
@@ -48031,6 +48078,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48031
48078
|
field: fields.accountNumber,
|
|
48032
48079
|
fieldActions: actions.fields.accountNumber,
|
|
48033
48080
|
showErrors: showErrors,
|
|
48081
|
+
isRequired: true,
|
|
48034
48082
|
isNum: true,
|
|
48035
48083
|
helperModal: function helperModal() {
|
|
48036
48084
|
return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
|
|
@@ -48049,6 +48097,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48049
48097
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48050
48098
|
labelTextWhenNoError: "Confirm account number",
|
|
48051
48099
|
dataQa: "Confirm account number",
|
|
48100
|
+
isRequired: true,
|
|
48052
48101
|
errorMessages: confirmAccountNumberErrors,
|
|
48053
48102
|
field: fields.confirmAccountNumber,
|
|
48054
48103
|
fieldActions: actions.fields.confirmAccountNumber,
|
|
@@ -48059,6 +48108,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48059
48108
|
isNum: true
|
|
48060
48109
|
}), allowBankAccountType && /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
48061
48110
|
labelTextWhenNoError: "Account type",
|
|
48111
|
+
isRequired: true,
|
|
48062
48112
|
dataQa: "Account type",
|
|
48063
48113
|
options: [{
|
|
48064
48114
|
text: "Select account type",
|
|
@@ -48189,6 +48239,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48189
48239
|
"aria-label": "Card payment"
|
|
48190
48240
|
}, /*#__PURE__*/React__default.createElement(FormInputColumn, null, !hideZipCode && /*#__PURE__*/React__default.createElement(CountryDropdown, {
|
|
48191
48241
|
labelTextWhenNoError: "Country",
|
|
48242
|
+
isRequired: true,
|
|
48192
48243
|
errorMessages: countryErrorMessages,
|
|
48193
48244
|
field: fields.country,
|
|
48194
48245
|
onChange: function onChange(value) {
|
|
@@ -48211,8 +48262,10 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48211
48262
|
onKeyDown: function onKeyDown(e) {
|
|
48212
48263
|
return e.key === "Enter" && handleSubmit(e);
|
|
48213
48264
|
},
|
|
48214
|
-
autocompleteValue: "cc-name"
|
|
48265
|
+
autocompleteValue: "cc-name",
|
|
48266
|
+
isRequired: true
|
|
48215
48267
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48268
|
+
isRequired: true,
|
|
48216
48269
|
labelTextWhenNoError: "Credit card number",
|
|
48217
48270
|
dataQa: "Credit card number",
|
|
48218
48271
|
errorMessages: creditCardNumberErrors,
|
|
@@ -48242,7 +48295,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48242
48295
|
isNum: true,
|
|
48243
48296
|
removeFromValue: /\// // removes "/" from browser autofill
|
|
48244
48297
|
,
|
|
48245
|
-
autocompleteValue: "cc-exp"
|
|
48298
|
+
autocompleteValue: "cc-exp",
|
|
48299
|
+
isRequired: true
|
|
48246
48300
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48247
48301
|
labelTextWhenNoError: "CVV",
|
|
48248
48302
|
dataQa: "CVV",
|
|
@@ -48255,7 +48309,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48255
48309
|
onKeyDown: function onKeyDown(e) {
|
|
48256
48310
|
return e.key === "Enter" && handleSubmit(e);
|
|
48257
48311
|
},
|
|
48258
|
-
autocompleteValue: "cc-csc"
|
|
48312
|
+
autocompleteValue: "cc-csc",
|
|
48313
|
+
isRequired: true
|
|
48259
48314
|
})), !hideZipCode && /*#__PURE__*/React__default.createElement(Box, {
|
|
48260
48315
|
padding: isMobile ? "0" : "0 0.5rem 0 0",
|
|
48261
48316
|
width: isMobile ? "100%" : "50%"
|
|
@@ -48271,7 +48326,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48271
48326
|
onKeyDown: function onKeyDown(e) {
|
|
48272
48327
|
return e.key === "Enter" && handleSubmit(e);
|
|
48273
48328
|
},
|
|
48274
|
-
autocompleteValue: "billing postal-code"
|
|
48329
|
+
autocompleteValue: "billing postal-code",
|
|
48330
|
+
isRequired: true
|
|
48275
48331
|
})), (showWalletCheckbox || showTerms) && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48276
48332
|
childGap: "4px",
|
|
48277
48333
|
align: "center"
|
|
@@ -48519,7 +48575,7 @@ PhoneForm.mapDispatchToProps = mapDispatchToProps$8;
|
|
|
48519
48575
|
var DefaultHeading = styled__default.div.withConfig({
|
|
48520
48576
|
displayName: "RadioGroup__DefaultHeading",
|
|
48521
48577
|
componentId: "sc-7lqrl8-0"
|
|
48522
|
-
})(["font-size:0.875rem;color:", "
|
|
48578
|
+
})(["font-size:0.875rem;color:", ";margin:0;padding:8px 0px;"], CHARADE_GREY);
|
|
48523
48579
|
var StyledFieldset = styled__default.fieldset.withConfig({
|
|
48524
48580
|
displayName: "RadioGroup__StyledFieldset",
|
|
48525
48581
|
componentId: "sc-7lqrl8-1"
|
|
@@ -48540,7 +48596,9 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
48540
48596
|
_ref$handleChange = _ref.handleChange,
|
|
48541
48597
|
handleChange = _ref$handleChange === void 0 ? noop : _ref$handleChange,
|
|
48542
48598
|
field = _ref.field,
|
|
48543
|
-
fieldActions = _ref.fieldActions
|
|
48599
|
+
fieldActions = _ref.fieldActions,
|
|
48600
|
+
_ref$isRequired = _ref.isRequired,
|
|
48601
|
+
isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
|
|
48544
48602
|
|
|
48545
48603
|
var setValue = function setValue(value) {
|
|
48546
48604
|
return fieldActions.set(value);
|
|
@@ -48549,7 +48607,8 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
48549
48607
|
return /*#__PURE__*/React__default.createElement(StyledFieldset, {
|
|
48550
48608
|
role: "radiogroup",
|
|
48551
48609
|
"aria-labelledby": "radio-group-".concat(groupName, "-heading"),
|
|
48552
|
-
$extraStyles: extraStyles
|
|
48610
|
+
$extraStyles: extraStyles,
|
|
48611
|
+
required: isRequired
|
|
48553
48612
|
}, Heading !== null && Heading, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48554
48613
|
childGap: "4px"
|
|
48555
48614
|
}, config.map(function (c, idx) {
|
|
@@ -48562,7 +48621,8 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
48562
48621
|
handleChange: handleChange,
|
|
48563
48622
|
field: field,
|
|
48564
48623
|
config: config,
|
|
48565
|
-
"aria-invalid": field.dirty && field.hasErrors
|
|
48624
|
+
"aria-invalid": field.dirty && field.hasErrors,
|
|
48625
|
+
isRequired: isRequired
|
|
48566
48626
|
}));
|
|
48567
48627
|
})));
|
|
48568
48628
|
};
|
|
@@ -48624,9 +48684,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48624
48684
|
openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
|
|
48625
48685
|
_ref$containerStyles = _ref.containerStyles,
|
|
48626
48686
|
containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
|
|
48627
|
-
ariaDescribedBy = _ref.ariaDescribedBy
|
|
48628
|
-
_ref$isSectionRequire = _ref.isSectionRequired,
|
|
48629
|
-
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire;
|
|
48687
|
+
ariaDescribedBy = _ref.ariaDescribedBy;
|
|
48630
48688
|
|
|
48631
48689
|
var handleKeyDown = function handleKeyDown(id, e) {
|
|
48632
48690
|
if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
|
|
@@ -48682,8 +48740,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48682
48740
|
extraStyles: containerStyles
|
|
48683
48741
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48684
48742
|
childGap: "0",
|
|
48685
|
-
role: "radiogroup"
|
|
48686
|
-
"aria-required": isSectionRequired
|
|
48743
|
+
role: "radiogroup"
|
|
48687
48744
|
}, sections.filter(function (section) {
|
|
48688
48745
|
return !section.hidden;
|
|
48689
48746
|
}).map(function (section) {
|
|
@@ -48705,8 +48762,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48705
48762
|
extraStyles: borderStyles,
|
|
48706
48763
|
role: "radio",
|
|
48707
48764
|
"aria-checked": openSection === section.id,
|
|
48708
|
-
"aria-disabled": section.disabled
|
|
48709
|
-
"aria-required": !!(section !== null && section !== void 0 && section.required)
|
|
48765
|
+
"aria-disabled": section.disabled
|
|
48710
48766
|
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48711
48767
|
childGap: "0"
|
|
48712
48768
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -48745,7 +48801,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48745
48801
|
return toggleOpenSection(section.id);
|
|
48746
48802
|
},
|
|
48747
48803
|
tabIndex: "-1",
|
|
48748
|
-
|
|
48804
|
+
required: section === null || section === void 0 ? void 0 : section.required
|
|
48749
48805
|
})), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48750
48806
|
align: "center"
|
|
48751
48807
|
}, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
|