@thecb/components 9.2.10-beta.10 → 9.2.10-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.esm.js CHANGED
@@ -22138,7 +22138,9 @@ var Checkbox = function Checkbox(_ref4) {
22138
22138
  extraStyles = _ref4.extraStyles,
22139
22139
  textExtraStyles = _ref4.textExtraStyles,
22140
22140
  _ref4$dataQa = _ref4.dataQa,
22141
- dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22141
+ dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa,
22142
+ _ref4$checkboxAriaLab = _ref4.checkboxAriaLabel,
22143
+ checkboxAriaLabel = _ref4$checkboxAriaLab === void 0 ? "" : _ref4$checkboxAriaLab;
22142
22144
 
22143
22145
  var _useState = useState(false),
22144
22146
  _useState2 = _slicedToArray(_useState, 2),
@@ -22151,6 +22153,10 @@ var Checkbox = function Checkbox(_ref4) {
22151
22153
  }
22152
22154
  };
22153
22155
 
22156
+ var checkboxProps = _objectSpread2({}, checkboxAriaLabel ? {
22157
+ "aria-label": checkboxAriaLabel
22158
+ } : {});
22159
+
22154
22160
  return /*#__PURE__*/React.createElement(Box, {
22155
22161
  padding: "0",
22156
22162
  tabIndex: "0",
@@ -22167,23 +22173,26 @@ var Checkbox = function Checkbox(_ref4) {
22167
22173
  background: themeValues.backgroundColor,
22168
22174
  extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
22169
22175
  }, /*#__PURE__*/React.createElement(CheckboxLabelContainer, {
22170
- "data-qa": dataQa,
22171
- id: "".concat(name, "_label_container")
22176
+ "data-qa": dataQa
22172
22177
  }, /*#__PURE__*/React.createElement(CheckboxContainer, {
22173
22178
  "data-qa": "Checkbox"
22174
22179
  }, /*#__PURE__*/React.createElement(HiddenCheckbox, {
22175
22180
  id: "checkbox-".concat(name),
22176
22181
  disabled: disabled,
22177
22182
  name: name,
22183
+ "aria-label": checkboxAriaLabel || "".concat(title, " checkbox"),
22178
22184
  checked: checked,
22179
22185
  onChange: onChange,
22180
22186
  tabIndex: "-1",
22181
22187
  "aria-invalid": error,
22182
22188
  "aria-describedby": error ? "".concat(name, "-error-message") : ""
22183
- }), /*#__PURE__*/React.createElement(StyledCheckbox, {
22189
+ }), /*#__PURE__*/React.createElement(StyledCheckbox, _extends({
22184
22190
  role: "checkbox",
22191
+ name: name,
22185
22192
  error: error,
22193
+ "aria-invalid": error,
22186
22194
  disabled: disabled,
22195
+ "aria-disabled": disabled,
22187
22196
  checked: checked,
22188
22197
  "aria-checked": checked,
22189
22198
  focused: focused,
@@ -22192,9 +22201,8 @@ var Checkbox = function Checkbox(_ref4) {
22192
22201
  errorStyles: themeValues.errorStyles,
22193
22202
  disabledStyles: themeValues.disabledStyles,
22194
22203
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22195
- focusedStyles: themeValues.focusedStyles,
22196
- "aria-labelledby": title ? "".concat(name, "_title_id") : "".concat(name, "_label_container")
22197
- }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22204
+ focusedStyles: themeValues.focusedStyles
22205
+ }, checkboxProps), /*#__PURE__*/React.createElement(CheckboxIcon, {
22198
22206
  viewBox: "0 0 24 24",
22199
22207
  disabled: disabled,
22200
22208
  disabledCheckColor: themeValues.disabledCheckColor,
@@ -22205,7 +22213,6 @@ var Checkbox = function Checkbox(_ref4) {
22205
22213
  variant: "p",
22206
22214
  weight: themeValues.textFontWeight,
22207
22215
  color: themeValues.textColor,
22208
- id: "".concat(name, "_title_id"),
22209
22216
  extraStyles: textExtraStyles ? "".concat(textExtraStyles, " ").concat(disabled && "color: #6e727e; background-color: #f7f7f7;", " ") : "margin-left: 1rem ".concat(disabled && "color: #6e727e; background-color: #f7f7f7;")
22210
22217
  }, title)));
22211
22218
  };
@@ -47856,12 +47863,8 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47856
47863
  linkVariant = _ref.linkVariant,
47857
47864
  _ref$initialFocusSele = _ref.initialFocusSelector,
47858
47865
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47859
- _ref$id = _ref.id,
47860
- id = _ref$id === void 0 ? "terms-and-conditions" : _ref$id,
47861
- _ref$screenReaderChec = _ref.screenReaderCheckboxLabel,
47862
- screenReaderCheckboxLabel = _ref$screenReaderChec === void 0 ? "" : _ref$screenReaderChec,
47863
- _ref$ariaLabelledBy = _ref.ariaLabelledBy,
47864
- ariaLabelledBy = _ref$ariaLabelledBy === void 0 ? "" : _ref$ariaLabelledBy;
47866
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47867
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47865
47868
 
47866
47869
  var _useState = useState(false),
47867
47870
  _useState2 = _slicedToArray(_useState, 2),
@@ -47874,15 +47877,11 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47874
47877
  error: error,
47875
47878
  checked: isChecked,
47876
47879
  onChange: onCheck,
47877
- "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47880
+ "aria-label": checkboxAriaLabel
47878
47881
  }), /*#__PURE__*/React.createElement(Box, {
47879
47882
  padding: "0 0 0 58px"
47880
- }, screenReaderCheckboxLabel && /*#__PURE__*/React.createElement("span", {
47881
- className: "sr-only-text",
47882
- id: "".concat(id, "_sr_only_label")
47883
- }, screenReaderCheckboxLabel), /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
47884
- padding: "0",
47885
- id: "".concat(id, "_html_label")
47883
+ }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
47884
+ padding: "0"
47886
47885
  }, html), terms && /*#__PURE__*/React.createElement(TermsAndConditionsModal$1, {
47887
47886
  link: "Learn More",
47888
47887
  terms: terms,
@@ -47921,10 +47920,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47921
47920
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47922
47921
  _ref$initialFocusSele = _ref.initialFocusSelector,
47923
47922
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47924
- _ref$screenReaderChec = _ref.screenReaderCheckboxLabel,
47925
- screenReaderCheckboxLabel = _ref$screenReaderChec === void 0 ? "" : _ref$screenReaderChec,
47926
- _ref$ariaLabelledBy = _ref.ariaLabelledBy,
47927
- ariaLabelledBy = _ref$ariaLabelledBy === void 0 ? "" : _ref$ariaLabelledBy;
47923
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47924
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47928
47925
 
47929
47926
  var _useState = useState(false),
47930
47927
  _useState2 = _slicedToArray(_useState, 2),
@@ -47950,24 +47947,20 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47950
47947
  }, /*#__PURE__*/React.createElement(Stack, {
47951
47948
  childGap: "0"
47952
47949
  }, html && /*#__PURE__*/React.createElement(Box, {
47953
- padding: "0",
47954
- id: "".concat(id, "_html_label")
47950
+ padding: "0"
47955
47951
  }, html), /*#__PURE__*/React.createElement(Cluster, {
47956
47952
  justify: "flex-start",
47957
47953
  align: "center",
47958
47954
  nowrap: true
47959
- }, showCheckbox && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Checkbox$1, {
47955
+ }, showCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
47960
47956
  name: id,
47961
47957
  error: hasError,
47962
47958
  checked: isChecked,
47963
47959
  onChange: onCheck,
47964
47960
  checkboxMargin: checkboxMargin,
47965
47961
  extraStyles: "align-self: flex-start;",
47966
- "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47967
- }), screenReaderCheckboxLabel && /*#__PURE__*/React.createElement("span", {
47968
- className: "sr-only-text",
47969
- id: "".concat(id, "_sr_only_label")
47970
- }, screenReaderCheckboxLabel)), /*#__PURE__*/React.createElement(Stack, {
47962
+ checkboxAriaLabel: checkboxAriaLabel
47963
+ }), /*#__PURE__*/React.createElement(Stack, {
47971
47964
  childGap: "0.25rem",
47972
47965
  fullHeight: true
47973
47966
  }, /*#__PURE__*/React.createElement(Cluster, {