@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.cjs.js CHANGED
@@ -22107,7 +22107,7 @@ var HiddenCheckbox = styled__default.input.attrs({
22107
22107
  }).withConfig({
22108
22108
  displayName: "Checkbox__HiddenCheckbox",
22109
22109
  componentId: "sc-36kqbv-3"
22110
- })(["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;"]);
22110
+ })(["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;"]);
22111
22111
  var StyledCheckbox = styled__default.div.withConfig({
22112
22112
  displayName: "Checkbox__StyledCheckbox",
22113
22113
  componentId: "sc-36kqbv-4"
@@ -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",
@@ -22182,16 +22188,19 @@ var Checkbox = function Checkbox(_ref4) {
22182
22188
  id: "checkbox-".concat(name),
22183
22189
  disabled: disabled,
22184
22190
  name: name,
22185
- "aria-label": 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,
@@ -22201,7 +22210,7 @@ var Checkbox = function Checkbox(_ref4) {
22201
22210
  disabledStyles: themeValues.disabledStyles,
22202
22211
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22203
22212
  focusedStyles: themeValues.focusedStyles
22204
- }, /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22213
+ }, checkboxProps), /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22205
22214
  viewBox: "0 0 24 24",
22206
22215
  disabled: disabled,
22207
22216
  disabledCheckColor: themeValues.disabledCheckColor,
@@ -45767,9 +45776,7 @@ var Modal$1 = function Modal(_ref) {
45767
45776
  _ref$dataQa = _ref.dataQa,
45768
45777
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45769
45778
  _ref$initialFocusSele = _ref.initialFocusSelector,
45770
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
45771
- _ref$modalName = _ref.modalName,
45772
- modalName = _ref$modalName === void 0 ? "" : _ref$modalName;
45779
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45773
45780
 
45774
45781
  var _useContext = React.useContext(styled.ThemeContext),
45775
45782
  isMobile = _useContext.isMobile;
@@ -45798,8 +45805,9 @@ var Modal$1 = function Modal(_ref) {
45798
45805
  },
45799
45806
  underlayClickExits: underlayClickExits,
45800
45807
  "aria-modal": true,
45801
- "aria-name": !!modalName.length ? modalName : modalHeaderText,
45802
- initialFocus: initialFocusSelector
45808
+ initialFocus: initialFocusSelector,
45809
+ focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45810
+
45803
45811
  }, /*#__PURE__*/React__default.createElement(Box, {
45804
45812
  padding: "0",
45805
45813
  borderRadius: "2px",
@@ -47729,7 +47737,8 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47729
47737
  continueAction: function continueAction() {
47730
47738
  toggleAccepted(true);
47731
47739
  toggleOpen(false);
47732
- }
47740
+ },
47741
+ initialFocusSelector: "[name='Close']"
47733
47742
  }, /*#__PURE__*/React__default.createElement(Text$1, {
47734
47743
  variant: "pS",
47735
47744
  onClick: function onClick() {
@@ -47861,7 +47870,9 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47861
47870
  error = _ref$error === void 0 ? false : _ref$error,
47862
47871
  linkVariant = _ref.linkVariant,
47863
47872
  _ref$initialFocusSele = _ref.initialFocusSelector,
47864
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47873
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47874
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47875
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47865
47876
 
47866
47877
  var _useState = React.useState(false),
47867
47878
  _useState2 = _slicedToArray(_useState, 2),
@@ -47873,7 +47884,8 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47873
47884
  title: "Terms and Conditions",
47874
47885
  error: error,
47875
47886
  checked: isChecked,
47876
- onChange: onCheck
47887
+ onChange: onCheck,
47888
+ "aria-label": checkboxAriaLabel
47877
47889
  }), /*#__PURE__*/React__default.createElement(Box, {
47878
47890
  padding: "0 0 0 58px"
47879
47891
  }, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Box, {
@@ -47915,7 +47927,9 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47915
47927
  _ref$modalTitle = _ref.modalTitle,
47916
47928
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47917
47929
  _ref$initialFocusSele = _ref.initialFocusSelector,
47918
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47930
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47931
+ _ref$checkboxAriaLabe = _ref.checkboxAriaLabel,
47932
+ checkboxAriaLabel = _ref$checkboxAriaLabe === void 0 ? "" : _ref$checkboxAriaLabe;
47919
47933
 
47920
47934
  var _useState = React.useState(false),
47921
47935
  _useState2 = _slicedToArray(_useState, 2),
@@ -47952,7 +47966,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47952
47966
  checked: isChecked,
47953
47967
  onChange: onCheck,
47954
47968
  checkboxMargin: checkboxMargin,
47955
- extraStyles: "align-self: flex-start;"
47969
+ extraStyles: "align-self: flex-start;",
47970
+ "aria-label": checkboxAriaLabel
47956
47971
  }), /*#__PURE__*/React__default.createElement(Stack, {
47957
47972
  childGap: "0.25rem",
47958
47973
  fullHeight: true
@@ -47989,9 +48004,7 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
47989
48004
  rest = _objectWithoutProperties(_ref, _excluded$y);
47990
48005
 
47991
48006
  var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
47992
- return /*#__PURE__*/React__default.createElement(TermsAndConditionsControl, _extends({
47993
- initialFocusSelector: "[role='button']:not(.modal-trigger)"
47994
- }, rest));
48007
+ return /*#__PURE__*/React__default.createElement(TermsAndConditionsControl, rest);
47995
48008
  };
47996
48009
 
47997
48010
  var PaymentFormACH = function PaymentFormACH(_ref) {
@@ -48173,7 +48186,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48173
48186
  version: "v2",
48174
48187
  showCheckbox: false,
48175
48188
  description: "View",
48176
- terms: termsContent
48189
+ terms: termsContent,
48190
+ initialFocusSelector: ".modal-close-button"
48177
48191
  })))));
48178
48192
  };
48179
48193
 
@@ -48369,7 +48383,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48369
48383
  version: "v2",
48370
48384
  showCheckbox: false,
48371
48385
  description: "View",
48372
- terms: termsContent
48386
+ terms: termsContent,
48387
+ initialFocusSelector: ".modal-close-button"
48373
48388
  })))));
48374
48389
  };
48375
48390