@thecb/components 9.2.10-beta.8 → 9.2.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
@@ -22137,6 +22137,7 @@ var Checkbox = function Checkbox(_ref4) {
22137
22137
  checkboxMargin = _ref4$checkboxMargin === void 0 ? "0 16px 0 0" : _ref4$checkboxMargin,
22138
22138
  extraStyles = _ref4.extraStyles,
22139
22139
  textExtraStyles = _ref4.textExtraStyles,
22140
+ labelledById = _ref4.labelledById,
22140
22141
  _ref4$dataQa = _ref4.dataQa,
22141
22142
  dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22142
22143
 
@@ -22151,6 +22152,9 @@ var Checkbox = function Checkbox(_ref4) {
22151
22152
  }
22152
22153
  };
22153
22154
 
22155
+ var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22156
+ var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22157
+ var ariaLabel = ariaLabelledById ? undefined : name;
22154
22158
  return /*#__PURE__*/React.createElement(Box, {
22155
22159
  padding: "0",
22156
22160
  tabIndex: "0",
@@ -22174,6 +22178,8 @@ var Checkbox = function Checkbox(_ref4) {
22174
22178
  id: "checkbox-".concat(name),
22175
22179
  disabled: disabled,
22176
22180
  name: name,
22181
+ "aria-label": ariaLabel,
22182
+ "aria-labelledby": ariaLabelledById,
22177
22183
  checked: checked,
22178
22184
  onChange: onChange,
22179
22185
  tabIndex: "-1",
@@ -22191,8 +22197,7 @@ var Checkbox = function Checkbox(_ref4) {
22191
22197
  errorStyles: themeValues.errorStyles,
22192
22198
  disabledStyles: themeValues.disabledStyles,
22193
22199
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22194
- focusedStyles: themeValues.focusedStyles,
22195
- "aria-labelledby": "".concat(name, "_title_id")
22200
+ focusedStyles: themeValues.focusedStyles
22196
22201
  }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22197
22202
  viewBox: "0 0 24 24",
22198
22203
  disabled: disabled,
@@ -22201,10 +22206,10 @@ var Checkbox = function Checkbox(_ref4) {
22201
22206
  }, /*#__PURE__*/React.createElement("polyline", {
22202
22207
  points: "20 6 9 17 4 12"
22203
22208
  })))), title && /*#__PURE__*/React.createElement(Text$1, {
22209
+ id: titleId,
22204
22210
  variant: "p",
22205
22211
  weight: themeValues.textFontWeight,
22206
22212
  color: themeValues.textColor,
22207
- id: "".concat(name, "_title_id"),
22208
22213
  extraStyles: textExtraStyles ? "".concat(textExtraStyles, " ").concat(disabled && "color: #6e727e; background-color: #f7f7f7;", " ") : "margin-left: 1rem ".concat(disabled && "color: #6e727e; background-color: #f7f7f7;")
22209
22214
  }, title)));
22210
22215
  };
@@ -45758,9 +45763,7 @@ var Modal$1 = function Modal(_ref) {
45758
45763
  buttonExtraStyles = _ref.buttonExtraStyles,
45759
45764
  children = _ref.children,
45760
45765
  _ref$dataQa = _ref.dataQa,
45761
- dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45762
- _ref$initialFocusSele = _ref.initialFocusSelector,
45763
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45766
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
45764
45767
 
45765
45768
  var _useContext = useContext(ThemeContext),
45766
45769
  isMobile = _useContext.isMobile;
@@ -45787,11 +45790,7 @@ var Modal$1 = function Modal(_ref) {
45787
45790
  width: customWidth || "615px",
45788
45791
  overflow: "auto"
45789
45792
  },
45790
- underlayClickExits: underlayClickExits,
45791
- "aria-modal": true,
45792
- initialFocus: initialFocusSelector,
45793
- focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45794
-
45793
+ underlayClickExits: underlayClickExits
45795
45794
  }, /*#__PURE__*/React.createElement(Box, {
45796
45795
  padding: "0",
45797
45796
  borderRadius: "2px",
@@ -45838,9 +45837,7 @@ var Modal$1 = function Modal(_ref) {
45838
45837
  text: cancelButtonText,
45839
45838
  dataQa: cancelButtonText,
45840
45839
  extraStyles: buttonExtraStyles,
45841
- className: "modal-cancel-button",
45842
- role: "button",
45843
- name: cancelButtonText
45840
+ className: "modal-cancel-button"
45844
45841
  })), /*#__PURE__*/React.createElement(Box, {
45845
45842
  width: "100%",
45846
45843
  padding: "0"
@@ -45852,9 +45849,7 @@ var Modal$1 = function Modal(_ref) {
45852
45849
  isLoading: isLoading,
45853
45850
  disabled: isContinueActionDisabled,
45854
45851
  extraStyles: buttonExtraStyles,
45855
- className: "modal-continue-button",
45856
- role: "button",
45857
- name: continueButtonText
45852
+ className: "modal-continue-button"
45858
45853
  }))) : /*#__PURE__*/React.createElement(Stack, {
45859
45854
  childGap: "1rem",
45860
45855
  direction: "row",
@@ -45865,9 +45860,7 @@ var Modal$1 = function Modal(_ref) {
45865
45860
  text: cancelButtonText,
45866
45861
  dataQa: cancelButtonText,
45867
45862
  extraStyles: buttonExtraStyles,
45868
- className: "modal-cancel-button",
45869
- role: "button",
45870
- name: cancelButtonText
45863
+ className: "modal-cancel-button"
45871
45864
  }), /*#__PURE__*/React.createElement(ButtonWithAction, {
45872
45865
  variant: useDangerButton ? "danger" : "primary",
45873
45866
  action: continueAction,
@@ -45876,9 +45869,7 @@ var Modal$1 = function Modal(_ref) {
45876
45869
  isLoading: isLoading,
45877
45870
  disabled: isContinueActionDisabled,
45878
45871
  extraStyles: buttonExtraStyles,
45879
- className: "modal-continue-button",
45880
- role: "button",
45881
- name: continueButtonText
45872
+ className: "modal-continue-button"
45882
45873
  }))) : /*#__PURE__*/React.createElement(Box, {
45883
45874
  padding: "0.5rem"
45884
45875
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
@@ -45887,9 +45878,7 @@ var Modal$1 = function Modal(_ref) {
45887
45878
  text: closeButtonText,
45888
45879
  dataQa: closeButtonText,
45889
45880
  extraStyles: buttonExtraStyles,
45890
- className: "modal-close-button",
45891
- role: "button",
45892
- name: closeButtonText
45881
+ className: "modal-close-button"
45893
45882
  }))))))))), children);
45894
45883
  };
45895
45884
 
@@ -47721,8 +47710,7 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47721
47710
  continueAction: function continueAction() {
47722
47711
  toggleAccepted(true);
47723
47712
  toggleOpen(false);
47724
- },
47725
- initialFocusSelector: "[name='Close']"
47713
+ }
47726
47714
  }, /*#__PURE__*/React.createElement(Text$1, {
47727
47715
  variant: "pS",
47728
47716
  onClick: function onClick() {
@@ -47735,9 +47723,7 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47735
47723
  color: themeValues.linkColor,
47736
47724
  weight: themeValues.fontWeight,
47737
47725
  hoverStyles: themeValues.modalLinkHoverFocus,
47738
- extraStyles: "cursor: pointer;",
47739
- role: "button",
47740
- className: "modal-trigger"
47726
+ extraStyles: "cursor: pointer;"
47741
47727
  }, link));
47742
47728
  };
47743
47729
 
@@ -47794,9 +47780,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47794
47780
  variant = _ref.variant,
47795
47781
  _ref$linkVariant = _ref.linkVariant,
47796
47782
  linkVariant = _ref$linkVariant === void 0 ? "p" : _ref$linkVariant,
47797
- themeValues = _ref.themeValues,
47798
- _ref$initialFocusSele = _ref.initialFocusSelector,
47799
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47783
+ themeValues = _ref.themeValues;
47800
47784
  return /*#__PURE__*/React.createElement(Modal$1, {
47801
47785
  modalOpen: isOpen,
47802
47786
  hideModal: function hideModal() {
@@ -47822,8 +47806,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47822
47806
  continueAction: function continueAction() {
47823
47807
  toggleAccepted(true);
47824
47808
  toggleOpen(false);
47825
- },
47826
- initialFocusSelector: initialFocusSelector
47809
+ }
47827
47810
  }, /*#__PURE__*/React.createElement(Text$1, {
47828
47811
  variant: linkVariant,
47829
47812
  onClick: function onClick() {
@@ -47836,10 +47819,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47836
47819
  color: themeValues.linkColor,
47837
47820
  weight: themeValues.fontWeight,
47838
47821
  hoverStyles: themeValues.modalLinkHoverFocus,
47839
- extraStyles: "display: inline-block; width: fit-content; cursor: pointer",
47840
- role: "button" // This should always be a "button" since it opens a modal
47841
- ,
47842
- className: "modal-trigger"
47822
+ extraStyles: "display: inline-block; width: fit-content; cursor: pointer"
47843
47823
  }, link));
47844
47824
  };
47845
47825
 
@@ -47852,11 +47832,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47852
47832
  terms = _ref.terms,
47853
47833
  _ref$error = _ref.error,
47854
47834
  error = _ref$error === void 0 ? false : _ref$error,
47855
- linkVariant = _ref.linkVariant,
47856
- _ref$initialFocusSele = _ref.initialFocusSelector,
47857
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
47858
- _ref$id = _ref.id,
47859
- id = _ref$id === void 0 ? "terms-and-conditions" : _ref$id;
47835
+ linkVariant = _ref.linkVariant;
47860
47836
 
47861
47837
  var _useState = useState(false),
47862
47838
  _useState2 = _slicedToArray(_useState, 2),
@@ -47868,23 +47844,22 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47868
47844
  title: "Terms and Conditions",
47869
47845
  error: error,
47870
47846
  checked: isChecked,
47871
- onChange: onCheck,
47872
- "aria-labelledby": "".concat(id, "_label")
47847
+ onChange: onCheck
47873
47848
  }), /*#__PURE__*/React.createElement(Box, {
47874
47849
  padding: "0 0 0 58px"
47875
47850
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
47876
- padding: "0",
47877
- id: "".concat(id, "_label")
47851
+ padding: "0"
47878
47852
  }, html), terms && /*#__PURE__*/React.createElement(TermsAndConditionsModal$1, {
47879
47853
  link: "Learn More",
47880
47854
  terms: terms,
47881
47855
  isOpen: showTerms,
47882
47856
  toggleOpen: toggleShowTerms,
47883
- linkVariant: linkVariant,
47884
- initialFocusSelector: initialFocusSelector
47857
+ linkVariant: linkVariant
47885
47858
  })))));
47886
47859
  };
47887
47860
 
47861
+ var TermsAndConditionsTitleDivId = "terms-and-conditions-title";
47862
+
47888
47863
  var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47889
47864
  var _ref$showCheckbox = _ref.showCheckbox,
47890
47865
  showCheckbox = _ref$showCheckbox === void 0 ? true : _ref$showCheckbox,
@@ -47910,9 +47885,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47910
47885
  _ref$checkboxMargin = _ref.checkboxMargin,
47911
47886
  checkboxMargin = _ref$checkboxMargin === void 0 ? "4px 8px 4px 4px" : _ref$checkboxMargin,
47912
47887
  _ref$modalTitle = _ref.modalTitle,
47913
- modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47914
- _ref$initialFocusSele = _ref.initialFocusSelector,
47915
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47888
+ modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
47916
47889
 
47917
47890
  var _useState = useState(false),
47918
47891
  _useState2 = _slicedToArray(_useState, 2),
@@ -47938,8 +47911,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47938
47911
  }, /*#__PURE__*/React.createElement(Stack, {
47939
47912
  childGap: "0"
47940
47913
  }, html && /*#__PURE__*/React.createElement(Box, {
47941
- padding: "0",
47942
- id: "".concat(id, "_label")
47914
+ padding: "0"
47943
47915
  }, html), /*#__PURE__*/React.createElement(Cluster, {
47944
47916
  justify: "flex-start",
47945
47917
  align: "center",
@@ -47951,7 +47923,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47951
47923
  onChange: onCheck,
47952
47924
  checkboxMargin: checkboxMargin,
47953
47925
  extraStyles: "align-self: flex-start;",
47954
- "aria-labelledby": "".concat(id, "_label")
47926
+ labelledById: TermsAndConditionsTitleDivId
47955
47927
  }), /*#__PURE__*/React.createElement(Stack, {
47956
47928
  childGap: "0.25rem",
47957
47929
  fullHeight: true
@@ -47959,7 +47931,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47959
47931
  justify: "flex-start",
47960
47932
  align: "center",
47961
47933
  nowrap: true,
47962
- extraStyles: "padding-right: 2px; > div > * { margin: 4px 2px; };"
47934
+ extraStyles: "padding-right: 2px; > div > * { margin: 4px 2px; };",
47935
+ id: TermsAndConditionsTitleDivId
47963
47936
  }, description && /*#__PURE__*/React.createElement(Text$1, {
47964
47937
  color: CHARADE_GREY
47965
47938
  }, description), terms && /*#__PURE__*/React.createElement(TermsAndConditionsModal$1, {
@@ -47968,8 +47941,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47968
47941
  isOpen: showTerms,
47969
47942
  toggleOpen: toggleTerms,
47970
47943
  linkVariant: modalVariant,
47971
- title: modalTitle,
47972
- initialFocusSelector: initialFocusSelector
47944
+ title: modalTitle
47973
47945
  })), /*#__PURE__*/React.createElement("div", {
47974
47946
  "aria-live": "polite",
47975
47947
  "aria-atomic": true
@@ -48170,8 +48142,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48170
48142
  version: "v2",
48171
48143
  showCheckbox: false,
48172
48144
  description: "View",
48173
- terms: termsContent,
48174
- initialFocusSelector: ".modal-close-button"
48145
+ terms: termsContent
48175
48146
  })))));
48176
48147
  };
48177
48148
 
@@ -48367,8 +48338,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48367
48338
  version: "v2",
48368
48339
  showCheckbox: false,
48369
48340
  description: "View",
48370
- terms: termsContent,
48371
- initialFocusSelector: ".modal-close-button"
48341
+ terms: termsContent
48372
48342
  })))));
48373
48343
  };
48374
48344