@thecb/components 9.2.10-beta.1 → 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.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"
@@ -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",
@@ -22174,16 +22180,19 @@ var Checkbox = function Checkbox(_ref4) {
22174
22180
  id: "checkbox-".concat(name),
22175
22181
  disabled: disabled,
22176
22182
  name: name,
22177
- "aria-label": 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,
@@ -22193,7 +22202,7 @@ var Checkbox = function Checkbox(_ref4) {
22193
22202
  disabledStyles: themeValues.disabledStyles,
22194
22203
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22195
22204
  focusedStyles: themeValues.focusedStyles
22196
- }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22205
+ }, checkboxProps), /*#__PURE__*/React.createElement(CheckboxIcon, {
22197
22206
  viewBox: "0 0 24 24",
22198
22207
  disabled: disabled,
22199
22208
  disabledCheckColor: themeValues.disabledCheckColor,
@@ -45759,9 +45768,7 @@ var Modal$1 = function Modal(_ref) {
45759
45768
  _ref$dataQa = _ref.dataQa,
45760
45769
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45761
45770
  _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;
45771
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45765
45772
 
45766
45773
  var _useContext = useContext(ThemeContext),
45767
45774
  isMobile = _useContext.isMobile;
@@ -45790,8 +45797,9 @@ var Modal$1 = function Modal(_ref) {
45790
45797
  },
45791
45798
  underlayClickExits: underlayClickExits,
45792
45799
  "aria-modal": true,
45793
- "aria-name": !!modalName.length ? modalName : modalHeaderText,
45794
- initialFocus: initialFocusSelector
45800
+ initialFocus: initialFocusSelector,
45801
+ focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45802
+
45795
45803
  }, /*#__PURE__*/React.createElement(Box, {
45796
45804
  padding: "0",
45797
45805
  borderRadius: "2px",
@@ -47721,7 +47729,8 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47721
47729
  continueAction: function continueAction() {
47722
47730
  toggleAccepted(true);
47723
47731
  toggleOpen(false);
47724
- }
47732
+ },
47733
+ initialFocusSelector: "[name='Close']"
47725
47734
  }, /*#__PURE__*/React.createElement(Text$1, {
47726
47735
  variant: "pS",
47727
47736
  onClick: function onClick() {
@@ -47853,7 +47862,9 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47853
47862
  error = _ref$error === void 0 ? false : _ref$error,
47854
47863
  linkVariant = _ref.linkVariant,
47855
47864
  _ref$initialFocusSele = _ref.initialFocusSelector,
47856
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47865
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47866
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47867
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47857
47868
 
47858
47869
  var _useState = useState(false),
47859
47870
  _useState2 = _slicedToArray(_useState, 2),
@@ -47865,7 +47876,8 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47865
47876
  title: "Terms and Conditions",
47866
47877
  error: error,
47867
47878
  checked: isChecked,
47868
- onChange: onCheck
47879
+ onChange: onCheck,
47880
+ "aria-label": checkboxAriaLabel
47869
47881
  }), /*#__PURE__*/React.createElement(Box, {
47870
47882
  padding: "0 0 0 58px"
47871
47883
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
@@ -47907,7 +47919,9 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47907
47919
  _ref$modalTitle = _ref.modalTitle,
47908
47920
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47909
47921
  _ref$initialFocusSele = _ref.initialFocusSelector,
47910
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47922
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47923
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47924
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47911
47925
 
47912
47926
  var _useState = useState(false),
47913
47927
  _useState2 = _slicedToArray(_useState, 2),
@@ -47944,7 +47958,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47944
47958
  checked: isChecked,
47945
47959
  onChange: onCheck,
47946
47960
  checkboxMargin: checkboxMargin,
47947
- extraStyles: "align-self: flex-start;"
47961
+ extraStyles: "align-self: flex-start;",
47962
+ "aria-label": checkboxAriaLabel
47948
47963
  }), /*#__PURE__*/React.createElement(Stack, {
47949
47964
  childGap: "0.25rem",
47950
47965
  fullHeight: true
@@ -47981,9 +47996,7 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
47981
47996
  rest = _objectWithoutProperties(_ref, _excluded$y);
47982
47997
 
47983
47998
  var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
47984
- return /*#__PURE__*/React.createElement(TermsAndConditionsControl, _extends({
47985
- initialFocusSelector: "[role='button']:not(.modal-trigger)"
47986
- }, rest));
47999
+ return /*#__PURE__*/React.createElement(TermsAndConditionsControl, rest);
47987
48000
  };
47988
48001
 
47989
48002
  var PaymentFormACH = function PaymentFormACH(_ref) {
@@ -48165,7 +48178,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48165
48178
  version: "v2",
48166
48179
  showCheckbox: false,
48167
48180
  description: "View",
48168
- terms: termsContent
48181
+ terms: termsContent,
48182
+ initialFocusSelector: ".modal-close-button"
48169
48183
  })))));
48170
48184
  };
48171
48185
 
@@ -48361,7 +48375,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48361
48375
  version: "v2",
48362
48376
  showCheckbox: false,
48363
48377
  description: "View",
48364
- terms: termsContent
48378
+ terms: termsContent,
48379
+ initialFocusSelector: ".modal-close-button"
48365
48380
  })))));
48366
48381
  };
48367
48382