@thecb/components 9.2.10-beta.10 → 9.2.10-beta.11

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 CHANGED
@@ -22146,7 +22146,9 @@ var Checkbox = function Checkbox(_ref4) {
22146
22146
  extraStyles = _ref4.extraStyles,
22147
22147
  textExtraStyles = _ref4.textExtraStyles,
22148
22148
  _ref4$dataQa = _ref4.dataQa,
22149
- dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22149
+ dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa,
22150
+ _ref4$checkboxAriaLab = _ref4.checkboxAriaLabel,
22151
+ checkboxAriaLabel = _ref4$checkboxAriaLab === void 0 ? "" : _ref4$checkboxAriaLab;
22150
22152
 
22151
22153
  var _useState = React.useState(false),
22152
22154
  _useState2 = _slicedToArray(_useState, 2),
@@ -22159,6 +22161,10 @@ var Checkbox = function Checkbox(_ref4) {
22159
22161
  }
22160
22162
  };
22161
22163
 
22164
+ var checkboxProps = _objectSpread2({}, checkboxAriaLabel ? {
22165
+ "aria-label": checkboxAriaLabel
22166
+ } : {});
22167
+
22162
22168
  return /*#__PURE__*/React__default.createElement(Box, {
22163
22169
  padding: "0",
22164
22170
  tabIndex: "0",
@@ -22175,23 +22181,26 @@ var Checkbox = function Checkbox(_ref4) {
22175
22181
  background: themeValues.backgroundColor,
22176
22182
  extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
22177
22183
  }, /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22178
- "data-qa": dataQa,
22179
- id: "".concat(name, "_label_container")
22184
+ "data-qa": dataQa
22180
22185
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22181
22186
  "data-qa": "Checkbox"
22182
22187
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22183
22188
  id: "checkbox-".concat(name),
22184
22189
  disabled: disabled,
22185
22190
  name: name,
22191
+ "aria-label": checkboxAriaLabel || "".concat(title, " checkbox"),
22186
22192
  checked: checked,
22187
22193
  onChange: onChange,
22188
22194
  tabIndex: "-1",
22189
22195
  "aria-invalid": error,
22190
22196
  "aria-describedby": error ? "".concat(name, "-error-message") : ""
22191
- }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22197
+ }), /*#__PURE__*/React__default.createElement(StyledCheckbox, _extends({
22192
22198
  role: "checkbox",
22199
+ name: name,
22193
22200
  error: error,
22201
+ "aria-invalid": error,
22194
22202
  disabled: disabled,
22203
+ "aria-disabled": disabled,
22195
22204
  checked: checked,
22196
22205
  "aria-checked": checked,
22197
22206
  focused: focused,
@@ -22200,9 +22209,8 @@ var Checkbox = function Checkbox(_ref4) {
22200
22209
  errorStyles: themeValues.errorStyles,
22201
22210
  disabledStyles: themeValues.disabledStyles,
22202
22211
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22203
- focusedStyles: themeValues.focusedStyles,
22204
- "aria-labelledby": title ? "".concat(name, "_title_id") : "".concat(name, "_label_container")
22205
- }, /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22212
+ focusedStyles: themeValues.focusedStyles
22213
+ }, checkboxProps), /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22206
22214
  viewBox: "0 0 24 24",
22207
22215
  disabled: disabled,
22208
22216
  disabledCheckColor: themeValues.disabledCheckColor,
@@ -22213,7 +22221,6 @@ var Checkbox = function Checkbox(_ref4) {
22213
22221
  variant: "p",
22214
22222
  weight: themeValues.textFontWeight,
22215
22223
  color: themeValues.textColor,
22216
- id: "".concat(name, "_title_id"),
22217
22224
  extraStyles: textExtraStyles ? "".concat(textExtraStyles, " ").concat(disabled && "color: #6e727e; background-color: #f7f7f7;", " ") : "margin-left: 1rem ".concat(disabled && "color: #6e727e; background-color: #f7f7f7;")
22218
22225
  }, title)));
22219
22226
  };
@@ -47864,12 +47871,8 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47864
47871
  linkVariant = _ref.linkVariant,
47865
47872
  _ref$initialFocusSele = _ref.initialFocusSelector,
47866
47873
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47867
- _ref$id = _ref.id,
47868
- id = _ref$id === void 0 ? "terms-and-conditions" : _ref$id,
47869
- _ref$screenReaderChec = _ref.screenReaderCheckboxLabel,
47870
- screenReaderCheckboxLabel = _ref$screenReaderChec === void 0 ? "" : _ref$screenReaderChec,
47871
- _ref$ariaLabelledBy = _ref.ariaLabelledBy,
47872
- ariaLabelledBy = _ref$ariaLabelledBy === void 0 ? "" : _ref$ariaLabelledBy;
47874
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47875
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47873
47876
 
47874
47877
  var _useState = React.useState(false),
47875
47878
  _useState2 = _slicedToArray(_useState, 2),
@@ -47882,15 +47885,11 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47882
47885
  error: error,
47883
47886
  checked: isChecked,
47884
47887
  onChange: onCheck,
47885
- "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47888
+ "aria-label": checkboxAriaLabel
47886
47889
  }), /*#__PURE__*/React__default.createElement(Box, {
47887
47890
  padding: "0 0 0 58px"
47888
- }, screenReaderCheckboxLabel && /*#__PURE__*/React__default.createElement("span", {
47889
- className: "sr-only-text",
47890
- id: "".concat(id, "_sr_only_label")
47891
- }, screenReaderCheckboxLabel), /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Box, {
47892
- padding: "0",
47893
- id: "".concat(id, "_html_label")
47891
+ }, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Box, {
47892
+ padding: "0"
47894
47893
  }, html), terms && /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
47895
47894
  link: "Learn More",
47896
47895
  terms: terms,
@@ -47929,10 +47928,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47929
47928
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47930
47929
  _ref$initialFocusSele = _ref.initialFocusSelector,
47931
47930
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47932
- _ref$screenReaderChec = _ref.screenReaderCheckboxLabel,
47933
- screenReaderCheckboxLabel = _ref$screenReaderChec === void 0 ? "" : _ref$screenReaderChec,
47934
- _ref$ariaLabelledBy = _ref.ariaLabelledBy,
47935
- ariaLabelledBy = _ref$ariaLabelledBy === void 0 ? "" : _ref$ariaLabelledBy;
47931
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47932
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47936
47933
 
47937
47934
  var _useState = React.useState(false),
47938
47935
  _useState2 = _slicedToArray(_useState, 2),
@@ -47958,24 +47955,20 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47958
47955
  }, /*#__PURE__*/React__default.createElement(Stack, {
47959
47956
  childGap: "0"
47960
47957
  }, html && /*#__PURE__*/React__default.createElement(Box, {
47961
- padding: "0",
47962
- id: "".concat(id, "_html_label")
47958
+ padding: "0"
47963
47959
  }, html), /*#__PURE__*/React__default.createElement(Cluster, {
47964
47960
  justify: "flex-start",
47965
47961
  align: "center",
47966
47962
  nowrap: true
47967
- }, showCheckbox && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Checkbox$1, {
47963
+ }, showCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
47968
47964
  name: id,
47969
47965
  error: hasError,
47970
47966
  checked: isChecked,
47971
47967
  onChange: onCheck,
47972
47968
  checkboxMargin: checkboxMargin,
47973
47969
  extraStyles: "align-self: flex-start;",
47974
- "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47975
- }), screenReaderCheckboxLabel && /*#__PURE__*/React__default.createElement("span", {
47976
- className: "sr-only-text",
47977
- id: "".concat(id, "_sr_only_label")
47978
- }, screenReaderCheckboxLabel)), /*#__PURE__*/React__default.createElement(Stack, {
47970
+ "aria-label": checkboxAriaLabel
47971
+ }), /*#__PURE__*/React__default.createElement(Stack, {
47979
47972
  childGap: "0.25rem",
47980
47973
  fullHeight: true
47981
47974
  }, /*#__PURE__*/React__default.createElement(Cluster, {