@thecb/components 8.4.11-beta.10 → 8.4.11-beta.12
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 +39 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +39 -27
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +17 -14
- package/src/components/atoms/form-layouts/FormInput.js +21 -9
- package/src/components/atoms/form-select/FormSelect.js +21 -6
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +3 -0
- package/src/components/molecules/address-form/AddressForm.js +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -22151,7 +22151,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
22151
22151
|
onChange: onChange,
|
|
22152
22152
|
tabIndex: "-1",
|
|
22153
22153
|
"aria-invalid": error,
|
|
22154
|
-
"aria-describedby": name
|
|
22154
|
+
"aria-describedby": error ? "".concat(name, "-error-message") : ""
|
|
22155
22155
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
22156
22156
|
error: error,
|
|
22157
22157
|
disabled: disabled,
|
|
@@ -23984,11 +23984,11 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
23984
23984
|
width: "100%"
|
|
23985
23985
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
23986
23986
|
as: "input",
|
|
23987
|
+
role: "combobox",
|
|
23987
23988
|
"aria-multiline": "false",
|
|
23988
|
-
"aria-
|
|
23989
|
-
|
|
23990
|
-
|
|
23991
|
-
,
|
|
23989
|
+
"aria-activedescendant": "focused_option",
|
|
23990
|
+
"aria-owns": "".concat(ariaLabelledby, "_listbox"),
|
|
23991
|
+
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
23992
23992
|
"aria-haspopup": "listbox",
|
|
23993
23993
|
"aria-labelledby": ariaLabelledby,
|
|
23994
23994
|
"aria-describedby": ariaDescribedby,
|
|
@@ -24002,8 +24002,8 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24002
24002
|
isOpen: isOpen,
|
|
24003
24003
|
minHeight: "48px",
|
|
24004
24004
|
minWidth: "100%",
|
|
24005
|
-
name: autocompleteValue
|
|
24006
|
-
,
|
|
24005
|
+
name: autocompleteValue,
|
|
24006
|
+
"aria-expanded": isOpen,
|
|
24007
24007
|
onChange: function onChange(e) {
|
|
24008
24008
|
// support autofill and copy/paste
|
|
24009
24009
|
if (e.target.value !== inputValue) {
|
|
@@ -24019,7 +24019,9 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24019
24019
|
tabIndex: 0,
|
|
24020
24020
|
value: inputValue,
|
|
24021
24021
|
width: "100%",
|
|
24022
|
-
dataQa: placeholder
|
|
24022
|
+
dataQa: placeholder,
|
|
24023
|
+
required: options.required,
|
|
24024
|
+
"aria-required": options.required
|
|
24023
24025
|
}), /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
24024
24026
|
open: isOpen,
|
|
24025
24027
|
onClick: _onClick
|
|
@@ -24055,17 +24057,18 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24055
24057
|
selected: choice.value === value,
|
|
24056
24058
|
"aria-selected": choice.value === value,
|
|
24057
24059
|
disabled: disabledValues.includes(choice.value),
|
|
24060
|
+
"aria-disabled": disabledValues.includes(choice.value),
|
|
24058
24061
|
"data-qa": choice.text,
|
|
24059
24062
|
themeValues: themeValues,
|
|
24060
24063
|
title: hasTitles ? choice.text : null,
|
|
24061
|
-
role: "option",
|
|
24062
24064
|
onFocus: function onFocus() {
|
|
24063
24065
|
return setFocusedRef(optionRefs.current[i]);
|
|
24064
|
-
}
|
|
24066
|
+
},
|
|
24067
|
+
role: "option"
|
|
24065
24068
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
24066
24069
|
variant: "p",
|
|
24067
24070
|
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
24068
|
-
extraStyles: "padding-left: 16px; \n
|
|
24071
|
+
extraStyles: "padding-left: 16px; \n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", "; \n white-space: nowrap; \n overflow: hidden; \n text-overflow: ellipsis;")
|
|
24069
24072
|
}, choice.text));
|
|
24070
24073
|
}))) : /*#__PURE__*/React__default.createElement(React.Fragment, null)));
|
|
24071
24074
|
};
|
|
@@ -24194,7 +24197,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24194
24197
|
});
|
|
24195
24198
|
return /*#__PURE__*/React__default.createElement(SelectContainer, {
|
|
24196
24199
|
ref: dropdownRef,
|
|
24197
|
-
disabled: disabled
|
|
24200
|
+
disabled: disabled,
|
|
24201
|
+
className: "form-select-component"
|
|
24198
24202
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
24199
24203
|
padding: "0",
|
|
24200
24204
|
minWidth: "100%"
|
|
@@ -24208,9 +24212,9 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24208
24212
|
weight: themeValues.fontWeight,
|
|
24209
24213
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24210
24214
|
id: createIdFromString(labelTextWhenNoError)
|
|
24211
|
-
}, labelTextWhenNoError))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
24215
|
+
}, "".concat(labelTextWhenNoError).concat(options.required ? "*" : "")))), /*#__PURE__*/React__default.createElement(Dropdown$1, {
|
|
24212
24216
|
ariaLabelledby: createIdFromString(labelTextWhenNoError),
|
|
24213
|
-
ariaDescribedby: createIdFromString(labelTextWhenNoError),
|
|
24217
|
+
ariaDescribedby: "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
|
|
24214
24218
|
maxHeight: dropdownMaxHeight,
|
|
24215
24219
|
hasTitles: hasTitles,
|
|
24216
24220
|
placeholder: options[0] ? options[0].text : "",
|
|
@@ -24219,6 +24223,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24219
24223
|
disabledValues: disabledValues,
|
|
24220
24224
|
isOpen: open,
|
|
24221
24225
|
isError: field.hasErrors && field.dirty || field.hasErrors && showErrors,
|
|
24226
|
+
"aria-invalid": field.hasErrors && field.dirty || field.hasErrors && showErrors,
|
|
24222
24227
|
onSelect: onChange ? function (value) {
|
|
24223
24228
|
return onChange(value);
|
|
24224
24229
|
} : function (value) {
|
|
@@ -24228,19 +24233,22 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24228
24233
|
return setOpen(!open);
|
|
24229
24234
|
},
|
|
24230
24235
|
disabled: disabled,
|
|
24236
|
+
"aria-disabled": disabled,
|
|
24231
24237
|
autocompleteValue: autocompleteValue,
|
|
24232
24238
|
smoothScroll: smoothScroll,
|
|
24233
|
-
required: options.required
|
|
24239
|
+
required: options.required,
|
|
24240
|
+
"aria-required": options.required,
|
|
24241
|
+
id: "".concat(createIdFromString(labelTextWhenNoError), "-input")
|
|
24234
24242
|
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
24235
24243
|
direction: "row",
|
|
24236
|
-
justify: "space-between"
|
|
24237
|
-
role: "alert"
|
|
24244
|
+
justify: "space-between"
|
|
24238
24245
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
24239
24246
|
color: ERROR_COLOR,
|
|
24240
24247
|
variant: "pXS",
|
|
24241
24248
|
weight: themeValues.fontWeight,
|
|
24242
|
-
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24243
|
-
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
24249
|
+
extraStyles: "\n word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
24250
|
+
id: createIdFromString(labelTextWhenNoError, "error message"),
|
|
24251
|
+
"aria-live": "polite"
|
|
24244
24252
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? errorMessages[field.errors[0]] : "")));
|
|
24245
24253
|
};
|
|
24246
24254
|
|
|
@@ -25982,7 +25990,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25982
25990
|
color: themeValues.labelColor,
|
|
25983
25991
|
variant: "pS",
|
|
25984
25992
|
fontWeight: themeValues.fontWeight,
|
|
25985
|
-
extraStyles: "word-break: break-word;\n
|
|
25993
|
+
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
25986
25994
|
id: createIdFromString(labelTextWhenNoError)
|
|
25987
25995
|
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
25988
25996
|
variant: "pS",
|
|
@@ -25993,10 +26001,11 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25993
26001
|
onClick: function onClick() {
|
|
25994
26002
|
return setShowPassword(!showPassword);
|
|
25995
26003
|
},
|
|
25996
|
-
"aria-label": "Show password",
|
|
25997
26004
|
tabIndex: "0",
|
|
26005
|
+
"aria-label": showPassword ? "Hide Password" : "Show password",
|
|
26006
|
+
"aria-live": "polite",
|
|
25998
26007
|
onKeyPress: function onKeyPress(e) {
|
|
25999
|
-
return e.key === "Enter" && setShowPassword(!showPassword);
|
|
26008
|
+
return (e.key === "Enter" || e.code === "Space") && setShowPassword(!showPassword);
|
|
26000
26009
|
}
|
|
26001
26010
|
}, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
|
|
26002
26011
|
padding: "0 0 0 auto"
|
|
@@ -26004,7 +26013,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26004
26013
|
padding: "0"
|
|
26005
26014
|
}, formatter ? /*#__PURE__*/React__default.createElement(FormattedInputField, _extends({
|
|
26006
26015
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26007
|
-
"aria-describedby": createIdFromString(labelTextWhenNoError),
|
|
26016
|
+
"aria-describedby": "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
|
|
26008
26017
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
26009
26018
|
onChange: function onChange(value) {
|
|
26010
26019
|
return setValue(value);
|
|
@@ -26023,7 +26032,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26023
26032
|
autocomplete: autocomplete
|
|
26024
26033
|
}, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
|
|
26025
26034
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26026
|
-
"aria-describedby": createIdFromString(labelTextWhenNoError),
|
|
26035
|
+
"aria-describedby": "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
|
|
26027
26036
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
26028
26037
|
onChange: function onChange(e) {
|
|
26029
26038
|
return setValue(e.target.value);
|
|
@@ -26043,7 +26052,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26043
26052
|
}, props))), /*#__PURE__*/React__default.createElement(Stack, {
|
|
26044
26053
|
direction: "row",
|
|
26045
26054
|
justify: "space-between",
|
|
26046
|
-
|
|
26055
|
+
"aria-live": "assertive",
|
|
26056
|
+
"aria-atomic": true
|
|
26047
26057
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26048
26058
|
color: ERROR_COLOR,
|
|
26049
26059
|
variant: "pXS",
|
|
@@ -37935,12 +37945,15 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
37935
37945
|
var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
37936
37946
|
var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
|
|
37937
37947
|
return /*#__PURE__*/React__default.createElement(FormSelect$1, {
|
|
37948
|
+
"aria-live": "polite",
|
|
37949
|
+
"aria-atomic": true,
|
|
37938
37950
|
options: options,
|
|
37939
37951
|
field: field,
|
|
37940
37952
|
fieldActions: fieldActions,
|
|
37941
37953
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
37942
37954
|
errorMessages: errorMessages,
|
|
37943
37955
|
showErrors: showErrors,
|
|
37956
|
+
"aria-invalid": !!(errorMessages !== null && errorMessages !== void 0 && errorMessages.length),
|
|
37944
37957
|
autocompleteValue: autocomplete
|
|
37945
37958
|
});
|
|
37946
37959
|
};
|
|
@@ -40374,8 +40387,7 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
40374
40387
|
actions.fields.zip.set("");
|
|
40375
40388
|
}
|
|
40376
40389
|
},
|
|
40377
|
-
showErrors: showErrors
|
|
40378
|
-
"aria-label": "Country"
|
|
40390
|
+
showErrors: showErrors
|
|
40379
40391
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
40380
40392
|
labelTextWhenNoError: "Address",
|
|
40381
40393
|
errorMessages: street1ErrorMessages,
|