@thecb/components 8.4.11-beta.11 → 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 +32 -21
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +32 -21
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +5 -3
- 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.esm.js
CHANGED
|
@@ -23976,8 +23976,8 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
23976
23976
|
width: "100%"
|
|
23977
23977
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
23978
23978
|
as: "input",
|
|
23979
|
+
role: "combobox",
|
|
23979
23980
|
"aria-multiline": "false",
|
|
23980
|
-
"aria-autocomplete": "list",
|
|
23981
23981
|
"aria-activedescendant": "focused_option",
|
|
23982
23982
|
"aria-owns": "".concat(ariaLabelledby, "_listbox"),
|
|
23983
23983
|
"aria-controls": "".concat(ariaLabelledby, "_listbox"),
|
|
@@ -24006,13 +24006,14 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24006
24006
|
padding: "12px",
|
|
24007
24007
|
placeholder: getSelection(),
|
|
24008
24008
|
themeValues: themeValues,
|
|
24009
|
-
role: "combobox",
|
|
24010
24009
|
title: hasTitles ? getSelection() : null,
|
|
24011
24010
|
type: "text",
|
|
24012
24011
|
tabIndex: 0,
|
|
24013
24012
|
value: inputValue,
|
|
24014
24013
|
width: "100%",
|
|
24015
|
-
dataQa: placeholder
|
|
24014
|
+
dataQa: placeholder,
|
|
24015
|
+
required: options.required,
|
|
24016
|
+
"aria-required": options.required
|
|
24016
24017
|
}), /*#__PURE__*/React.createElement(IconWrapper, {
|
|
24017
24018
|
open: isOpen,
|
|
24018
24019
|
onClick: _onClick
|
|
@@ -24048,13 +24049,14 @@ var Dropdown = function Dropdown(_ref8) {
|
|
|
24048
24049
|
selected: choice.value === value,
|
|
24049
24050
|
"aria-selected": choice.value === value,
|
|
24050
24051
|
disabled: disabledValues.includes(choice.value),
|
|
24052
|
+
"aria-disabled": disabledValues.includes(choice.value),
|
|
24051
24053
|
"data-qa": choice.text,
|
|
24052
24054
|
themeValues: themeValues,
|
|
24053
24055
|
title: hasTitles ? choice.text : null,
|
|
24054
|
-
role: "option",
|
|
24055
24056
|
onFocus: function onFocus() {
|
|
24056
24057
|
return setFocusedRef(optionRefs.current[i]);
|
|
24057
|
-
}
|
|
24058
|
+
},
|
|
24059
|
+
role: "option"
|
|
24058
24060
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
24059
24061
|
variant: "p",
|
|
24060
24062
|
color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
|
|
@@ -24187,7 +24189,8 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24187
24189
|
});
|
|
24188
24190
|
return /*#__PURE__*/React.createElement(SelectContainer, {
|
|
24189
24191
|
ref: dropdownRef,
|
|
24190
|
-
disabled: disabled
|
|
24192
|
+
disabled: disabled,
|
|
24193
|
+
className: "form-select-component"
|
|
24191
24194
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
24192
24195
|
padding: "0",
|
|
24193
24196
|
minWidth: "100%"
|
|
@@ -24201,9 +24204,9 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24201
24204
|
weight: themeValues.fontWeight,
|
|
24202
24205
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24203
24206
|
id: createIdFromString(labelTextWhenNoError)
|
|
24204
|
-
}, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
|
|
24207
|
+
}, "".concat(labelTextWhenNoError).concat(options.required ? "*" : "")))), /*#__PURE__*/React.createElement(Dropdown$1, {
|
|
24205
24208
|
ariaLabelledby: createIdFromString(labelTextWhenNoError),
|
|
24206
|
-
ariaDescribedby: createIdFromString(labelTextWhenNoError),
|
|
24209
|
+
ariaDescribedby: "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
|
|
24207
24210
|
maxHeight: dropdownMaxHeight,
|
|
24208
24211
|
hasTitles: hasTitles,
|
|
24209
24212
|
placeholder: options[0] ? options[0].text : "",
|
|
@@ -24212,6 +24215,7 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24212
24215
|
disabledValues: disabledValues,
|
|
24213
24216
|
isOpen: open,
|
|
24214
24217
|
isError: field.hasErrors && field.dirty || field.hasErrors && showErrors,
|
|
24218
|
+
"aria-invalid": field.hasErrors && field.dirty || field.hasErrors && showErrors,
|
|
24215
24219
|
onSelect: onChange ? function (value) {
|
|
24216
24220
|
return onChange(value);
|
|
24217
24221
|
} : function (value) {
|
|
@@ -24221,19 +24225,22 @@ var FormSelect = function FormSelect(_ref) {
|
|
|
24221
24225
|
return setOpen(!open);
|
|
24222
24226
|
},
|
|
24223
24227
|
disabled: disabled,
|
|
24228
|
+
"aria-disabled": disabled,
|
|
24224
24229
|
autocompleteValue: autocompleteValue,
|
|
24225
24230
|
smoothScroll: smoothScroll,
|
|
24226
|
-
required: options.required
|
|
24231
|
+
required: options.required,
|
|
24232
|
+
"aria-required": options.required,
|
|
24233
|
+
id: "".concat(createIdFromString(labelTextWhenNoError), "-input")
|
|
24227
24234
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
24228
24235
|
direction: "row",
|
|
24229
|
-
justify: "space-between"
|
|
24230
|
-
role: "alert"
|
|
24236
|
+
justify: "space-between"
|
|
24231
24237
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
24232
24238
|
color: ERROR_COLOR,
|
|
24233
24239
|
variant: "pXS",
|
|
24234
24240
|
weight: themeValues.fontWeight,
|
|
24235
|
-
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
24236
|
-
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
24241
|
+
extraStyles: "\n word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
24242
|
+
id: createIdFromString(labelTextWhenNoError, "error message"),
|
|
24243
|
+
"aria-live": "polite"
|
|
24237
24244
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? errorMessages[field.errors[0]] : "")));
|
|
24238
24245
|
};
|
|
24239
24246
|
|
|
@@ -25975,7 +25982,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25975
25982
|
color: themeValues.labelColor,
|
|
25976
25983
|
variant: "pS",
|
|
25977
25984
|
fontWeight: themeValues.fontWeight,
|
|
25978
|
-
extraStyles: "word-break: break-word;\n
|
|
25985
|
+
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }\n ",
|
|
25979
25986
|
id: createIdFromString(labelTextWhenNoError)
|
|
25980
25987
|
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React.createElement(Text$1, {
|
|
25981
25988
|
variant: "pS",
|
|
@@ -25986,10 +25993,11 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25986
25993
|
onClick: function onClick() {
|
|
25987
25994
|
return setShowPassword(!showPassword);
|
|
25988
25995
|
},
|
|
25989
|
-
"aria-label": "Show password",
|
|
25990
25996
|
tabIndex: "0",
|
|
25997
|
+
"aria-label": showPassword ? "Hide Password" : "Show password",
|
|
25998
|
+
"aria-live": "polite",
|
|
25991
25999
|
onKeyPress: function onKeyPress(e) {
|
|
25992
|
-
return e.key === "Enter" && setShowPassword(!showPassword);
|
|
26000
|
+
return (e.key === "Enter" || e.code === "Space") && setShowPassword(!showPassword);
|
|
25993
26001
|
}
|
|
25994
26002
|
}, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React.createElement(Box, {
|
|
25995
26003
|
padding: "0 0 0 auto"
|
|
@@ -25997,7 +26005,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25997
26005
|
padding: "0"
|
|
25998
26006
|
}, formatter ? /*#__PURE__*/React.createElement(FormattedInputField, _extends({
|
|
25999
26007
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26000
|
-
"aria-describedby": createIdFromString(labelTextWhenNoError),
|
|
26008
|
+
"aria-describedby": "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
|
|
26001
26009
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
26002
26010
|
onChange: function onChange(value) {
|
|
26003
26011
|
return setValue(value);
|
|
@@ -26016,7 +26024,7 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26016
26024
|
autocomplete: autocomplete
|
|
26017
26025
|
}, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
|
|
26018
26026
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26019
|
-
"aria-describedby": createIdFromString(labelTextWhenNoError),
|
|
26027
|
+
"aria-describedby": "".concat(createIdFromString(labelTextWhenNoError), "-error-message"),
|
|
26020
26028
|
"aria-invalid": field.dirty && field.hasErrors || field.hasErrors && showErrors,
|
|
26021
26029
|
onChange: function onChange(e) {
|
|
26022
26030
|
return setValue(e.target.value);
|
|
@@ -26036,7 +26044,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26036
26044
|
}, props))), /*#__PURE__*/React.createElement(Stack, {
|
|
26037
26045
|
direction: "row",
|
|
26038
26046
|
justify: "space-between",
|
|
26039
|
-
|
|
26047
|
+
"aria-live": "assertive",
|
|
26048
|
+
"aria-atomic": true
|
|
26040
26049
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React.createElement(Text$1, {
|
|
26041
26050
|
color: ERROR_COLOR,
|
|
26042
26051
|
variant: "pXS",
|
|
@@ -37928,12 +37937,15 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
|
|
|
37928
37937
|
var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
|
|
37929
37938
|
var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
|
|
37930
37939
|
return /*#__PURE__*/React.createElement(FormSelect$1, {
|
|
37940
|
+
"aria-live": "polite",
|
|
37941
|
+
"aria-atomic": true,
|
|
37931
37942
|
options: options,
|
|
37932
37943
|
field: field,
|
|
37933
37944
|
fieldActions: fieldActions,
|
|
37934
37945
|
labelTextWhenNoError: labelTextWhenNoError,
|
|
37935
37946
|
errorMessages: errorMessages,
|
|
37936
37947
|
showErrors: showErrors,
|
|
37948
|
+
"aria-invalid": !!(errorMessages !== null && errorMessages !== void 0 && errorMessages.length),
|
|
37937
37949
|
autocompleteValue: autocomplete
|
|
37938
37950
|
});
|
|
37939
37951
|
};
|
|
@@ -40367,8 +40379,7 @@ var AddressForm = function AddressForm(_ref) {
|
|
|
40367
40379
|
actions.fields.zip.set("");
|
|
40368
40380
|
}
|
|
40369
40381
|
},
|
|
40370
|
-
showErrors: showErrors
|
|
40371
|
-
"aria-label": "Country"
|
|
40382
|
+
showErrors: showErrors
|
|
40372
40383
|
}), /*#__PURE__*/React.createElement(FormInput$1, {
|
|
40373
40384
|
labelTextWhenNoError: "Address",
|
|
40374
40385
|
errorMessages: street1ErrorMessages,
|