@thecb/components 9.2.10-beta.7 → 9.2.10-beta.9

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
@@ -22175,7 +22175,8 @@ var Checkbox = function Checkbox(_ref4) {
22175
22175
  background: themeValues.backgroundColor,
22176
22176
  extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
22177
22177
  }, /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22178
- "data-qa": dataQa
22178
+ "data-qa": dataQa,
22179
+ id: "".concat(id, "_label_container")
22179
22180
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22180
22181
  "data-qa": "Checkbox"
22181
22182
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
@@ -22200,7 +22201,7 @@ var Checkbox = function Checkbox(_ref4) {
22200
22201
  disabledStyles: themeValues.disabledStyles,
22201
22202
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22202
22203
  focusedStyles: themeValues.focusedStyles,
22203
- "aria-labelledby": "".concat(name, "_title_id")
22204
+ "aria-labelledby": title ? "".concat(name, "_title_id") : "".concat(id, "_label_container")
22204
22205
  }, /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22205
22206
  viewBox: "0 0 24 24",
22206
22207
  disabled: disabled,
@@ -47862,7 +47863,13 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47862
47863
  error = _ref$error === void 0 ? false : _ref$error,
47863
47864
  linkVariant = _ref.linkVariant,
47864
47865
  _ref$initialFocusSele = _ref.initialFocusSelector,
47865
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47866
+ 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;
47866
47873
 
47867
47874
  var _useState = React.useState(false),
47868
47875
  _useState2 = _slicedToArray(_useState, 2),
@@ -47875,12 +47882,15 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47875
47882
  error: error,
47876
47883
  checked: isChecked,
47877
47884
  onChange: onCheck,
47878
- "aria-labelledby": "".concat(id, "_label")
47885
+ "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47879
47886
  }), /*#__PURE__*/React__default.createElement(Box, {
47880
47887
  padding: "0 0 0 58px"
47881
- }, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Box, {
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, {
47882
47892
  padding: "0",
47883
- id: "".concat(id, "_label")
47893
+ id: "".concat(id, "_html_label")
47884
47894
  }, html), terms && /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
47885
47895
  link: "Learn More",
47886
47896
  terms: terms,
@@ -47918,7 +47928,11 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47918
47928
  _ref$modalTitle = _ref.modalTitle,
47919
47929
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47920
47930
  _ref$initialFocusSele = _ref.initialFocusSelector,
47921
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47931
+ 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;
47922
47936
 
47923
47937
  var _useState = React.useState(false),
47924
47938
  _useState2 = _slicedToArray(_useState, 2),
@@ -47945,20 +47959,23 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47945
47959
  childGap: "0"
47946
47960
  }, html && /*#__PURE__*/React__default.createElement(Box, {
47947
47961
  padding: "0",
47948
- id: "".concat(id, "_label")
47962
+ id: "".concat(id, "_html_label")
47949
47963
  }, html), /*#__PURE__*/React__default.createElement(Cluster, {
47950
47964
  justify: "flex-start",
47951
47965
  align: "center",
47952
47966
  nowrap: true
47953
- }, showCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
47967
+ }, showCheckbox && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Checkbox$1, {
47954
47968
  name: id,
47955
47969
  error: hasError,
47956
47970
  checked: isChecked,
47957
47971
  onChange: onCheck,
47958
47972
  checkboxMargin: checkboxMargin,
47959
47973
  extraStyles: "align-self: flex-start;",
47960
- "aria-labelledby": "".concat(id, "_label")
47961
- }), /*#__PURE__*/React__default.createElement(Stack, {
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, {
47962
47979
  childGap: "0.25rem",
47963
47980
  fullHeight: true
47964
47981
  }, /*#__PURE__*/React__default.createElement(Cluster, {