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

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
@@ -22099,7 +22099,7 @@ var HiddenCheckbox = styled.input.attrs({
22099
22099
  }).withConfig({
22100
22100
  displayName: "Checkbox__HiddenCheckbox",
22101
22101
  componentId: "sc-36kqbv-3"
22102
- })(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]);
22102
+ })(["border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]);
22103
22103
  var StyledCheckbox = styled.div.withConfig({
22104
22104
  displayName: "Checkbox__StyledCheckbox",
22105
22105
  componentId: "sc-36kqbv-4"
@@ -22167,14 +22167,14 @@ var Checkbox = function Checkbox(_ref4) {
22167
22167
  background: themeValues.backgroundColor,
22168
22168
  extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
22169
22169
  }, /*#__PURE__*/React.createElement(CheckboxLabelContainer, {
22170
- "data-qa": dataQa
22170
+ "data-qa": dataQa,
22171
+ id: "".concat(name, "_label_container")
22171
22172
  }, /*#__PURE__*/React.createElement(CheckboxContainer, {
22172
22173
  "data-qa": "Checkbox"
22173
22174
  }, /*#__PURE__*/React.createElement(HiddenCheckbox, {
22174
22175
  id: "checkbox-".concat(name),
22175
22176
  disabled: disabled,
22176
22177
  name: name,
22177
- "aria-label": name,
22178
22178
  checked: checked,
22179
22179
  onChange: onChange,
22180
22180
  tabIndex: "-1",
@@ -22192,7 +22192,8 @@ var Checkbox = function Checkbox(_ref4) {
22192
22192
  errorStyles: themeValues.errorStyles,
22193
22193
  disabledStyles: themeValues.disabledStyles,
22194
22194
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22195
- focusedStyles: themeValues.focusedStyles
22195
+ focusedStyles: themeValues.focusedStyles,
22196
+ "aria-labelledby": title ? "".concat(name, "_title_id") : "".concat(name, "_label_container")
22196
22197
  }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22197
22198
  viewBox: "0 0 24 24",
22198
22199
  disabled: disabled,
@@ -22204,6 +22205,7 @@ var Checkbox = function Checkbox(_ref4) {
22204
22205
  variant: "p",
22205
22206
  weight: themeValues.textFontWeight,
22206
22207
  color: themeValues.textColor,
22208
+ id: "".concat(name, "_title_id"),
22207
22209
  extraStyles: textExtraStyles ? "".concat(textExtraStyles, " ").concat(disabled && "color: #6e727e; background-color: #f7f7f7;", " ") : "margin-left: 1rem ".concat(disabled && "color: #6e727e; background-color: #f7f7f7;")
22208
22210
  }, title)));
22209
22211
  };
@@ -45759,9 +45761,7 @@ var Modal$1 = function Modal(_ref) {
45759
45761
  _ref$dataQa = _ref.dataQa,
45760
45762
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45761
45763
  _ref$initialFocusSele = _ref.initialFocusSelector,
45762
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
45763
- _ref$modalName = _ref.modalName,
45764
- modalName = _ref$modalName === void 0 ? "" : _ref$modalName;
45764
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45765
45765
 
45766
45766
  var _useContext = useContext(ThemeContext),
45767
45767
  isMobile = _useContext.isMobile;
@@ -45790,8 +45790,9 @@ var Modal$1 = function Modal(_ref) {
45790
45790
  },
45791
45791
  underlayClickExits: underlayClickExits,
45792
45792
  "aria-modal": true,
45793
- "aria-name": !!modalName.length ? modalName : modalHeaderText,
45794
- initialFocus: initialFocusSelector
45793
+ initialFocus: initialFocusSelector,
45794
+ focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45795
+
45795
45796
  }, /*#__PURE__*/React.createElement(Box, {
45796
45797
  padding: "0",
45797
45798
  borderRadius: "2px",
@@ -47721,7 +47722,8 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47721
47722
  continueAction: function continueAction() {
47722
47723
  toggleAccepted(true);
47723
47724
  toggleOpen(false);
47724
- }
47725
+ },
47726
+ initialFocusSelector: "[name='Close']"
47725
47727
  }, /*#__PURE__*/React.createElement(Text$1, {
47726
47728
  variant: "pS",
47727
47729
  onClick: function onClick() {
@@ -47853,7 +47855,13 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47853
47855
  error = _ref$error === void 0 ? false : _ref$error,
47854
47856
  linkVariant = _ref.linkVariant,
47855
47857
  _ref$initialFocusSele = _ref.initialFocusSelector,
47856
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47858
+ 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;
47857
47865
 
47858
47866
  var _useState = useState(false),
47859
47867
  _useState2 = _slicedToArray(_useState, 2),
@@ -47865,11 +47873,16 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47865
47873
  title: "Terms and Conditions",
47866
47874
  error: error,
47867
47875
  checked: isChecked,
47868
- onChange: onCheck
47876
+ onChange: onCheck,
47877
+ "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47869
47878
  }), /*#__PURE__*/React.createElement(Box, {
47870
47879
  padding: "0 0 0 58px"
47871
- }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
47872
- padding: "0"
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")
47873
47886
  }, html), terms && /*#__PURE__*/React.createElement(TermsAndConditionsModal$1, {
47874
47887
  link: "Learn More",
47875
47888
  terms: terms,
@@ -47907,7 +47920,11 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47907
47920
  _ref$modalTitle = _ref.modalTitle,
47908
47921
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47909
47922
  _ref$initialFocusSele = _ref.initialFocusSelector,
47910
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47923
+ 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;
47911
47928
 
47912
47929
  var _useState = useState(false),
47913
47930
  _useState2 = _slicedToArray(_useState, 2),
@@ -47933,19 +47950,24 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47933
47950
  }, /*#__PURE__*/React.createElement(Stack, {
47934
47951
  childGap: "0"
47935
47952
  }, html && /*#__PURE__*/React.createElement(Box, {
47936
- padding: "0"
47953
+ padding: "0",
47954
+ id: "".concat(id, "_html_label")
47937
47955
  }, html), /*#__PURE__*/React.createElement(Cluster, {
47938
47956
  justify: "flex-start",
47939
47957
  align: "center",
47940
47958
  nowrap: true
47941
- }, showCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
47959
+ }, showCheckbox && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Checkbox$1, {
47942
47960
  name: id,
47943
47961
  error: hasError,
47944
47962
  checked: isChecked,
47945
47963
  onChange: onCheck,
47946
47964
  checkboxMargin: checkboxMargin,
47947
- extraStyles: "align-self: flex-start;"
47948
- }), /*#__PURE__*/React.createElement(Stack, {
47965
+ 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, {
47949
47971
  childGap: "0.25rem",
47950
47972
  fullHeight: true
47951
47973
  }, /*#__PURE__*/React.createElement(Cluster, {
@@ -47981,9 +48003,7 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
47981
48003
  rest = _objectWithoutProperties(_ref, _excluded$y);
47982
48004
 
47983
48005
  var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
47984
- return /*#__PURE__*/React.createElement(TermsAndConditionsControl, _extends({
47985
- initialFocusSelector: "[role='button']:not(.modal-trigger)"
47986
- }, rest));
48006
+ return /*#__PURE__*/React.createElement(TermsAndConditionsControl, rest);
47987
48007
  };
47988
48008
 
47989
48009
  var PaymentFormACH = function PaymentFormACH(_ref) {
@@ -48165,7 +48185,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48165
48185
  version: "v2",
48166
48186
  showCheckbox: false,
48167
48187
  description: "View",
48168
- terms: termsContent
48188
+ terms: termsContent,
48189
+ initialFocusSelector: ".modal-close-button"
48169
48190
  })))));
48170
48191
  };
48171
48192
 
@@ -48361,7 +48382,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48361
48382
  version: "v2",
48362
48383
  showCheckbox: false,
48363
48384
  description: "View",
48364
- terms: termsContent
48385
+ terms: termsContent,
48386
+ initialFocusSelector: ".modal-close-button"
48365
48387
  })))));
48366
48388
  };
48367
48389