@thecb/components 9.2.10-beta.0 → 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.cjs.js CHANGED
@@ -13683,7 +13683,9 @@ var AccountNumberImage = function AccountNumberImage() {
13683
13683
  xmlns: "http://www.w3.org/2000/svg",
13684
13684
  width: "371",
13685
13685
  height: "164",
13686
- viewBox: "0 0 371 164"
13686
+ viewBox: "0 0 371 164",
13687
+ role: "img",
13688
+ "aria-label": "A check with the account number highlighted in the bottom center"
13687
13689
  }, /*#__PURE__*/React__default.createElement("g", {
13688
13690
  fill: "none",
13689
13691
  fillRule: "evenodd",
@@ -13764,7 +13766,9 @@ var RoutingNumberImage = function RoutingNumberImage() {
13764
13766
  xmlns: "http://www.w3.org/2000/svg",
13765
13767
  width: "371",
13766
13768
  height: "164",
13767
- viewBox: "0 0 371 164"
13769
+ viewBox: "0 0 371 164",
13770
+ role: "img",
13771
+ "aria-label": "A check with the routing number highlighted in the lower left hand corner"
13768
13772
  }, /*#__PURE__*/React__default.createElement("g", {
13769
13773
  fill: "none",
13770
13774
  fillRule: "evenodd",
@@ -13847,7 +13851,9 @@ var CheckmarkIcon = function CheckmarkIcon() {
13847
13851
  viewBox: "0 0 98 98",
13848
13852
  version: "1.1",
13849
13853
  xmlns: "http://www.w3.org/2000/svg",
13850
- xmlnsXlink: "http://www.w3.org/1999/xlink"
13854
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
13855
+ role: "img",
13856
+ "aria-label": "Successful payment, green checkmark"
13851
13857
  }, /*#__PURE__*/React__default.createElement("g", {
13852
13858
  id: "Cityville-Checkout---Desktop---Logged-In",
13853
13859
  stroke: "none",
@@ -13892,7 +13898,9 @@ var BankIcon = function BankIcon() {
13892
13898
  height: "18",
13893
13899
  viewBox: "0 0 28 18",
13894
13900
  fill: "none",
13895
- xmlns: "http://www.w3.org/2000/svg"
13901
+ xmlns: "http://www.w3.org/2000/svg",
13902
+ role: "img",
13903
+ "aria-label": "Check Payment"
13896
13904
  }, /*#__PURE__*/React__default.createElement("path", {
13897
13905
  d: "M0 2.25C0 1.00736 1.04467 0 2.33333 0H25.6667C26.9553 0 28 1.00736 28 2.25V15.75C28 16.9926 26.9553 18 25.6667 18H2.33333C1.04467 18 0 16.9926 0 15.75V2.25Z",
13898
13906
  fill: "#E4F4FD"
@@ -13939,7 +13947,9 @@ var GenericCard = function GenericCard() {
13939
13947
  height: "18",
13940
13948
  viewBox: "0 0 28 18",
13941
13949
  fill: "none",
13942
- xmlns: "http://www.w3.org/2000/svg"
13950
+ xmlns: "http://www.w3.org/2000/svg",
13951
+ role: "img",
13952
+ "aria-label": "Card Payment"
13943
13953
  }, /*#__PURE__*/React__default.createElement("rect", {
13944
13954
  width: "28",
13945
13955
  height: "18",
@@ -15198,7 +15208,9 @@ var GenericCardLarge = function GenericCardLarge() {
15198
15208
  height: "24",
15199
15209
  viewBox: "0 0 36 24",
15200
15210
  fill: "none",
15201
- xmlns: "http://www.w3.org/2000/svg"
15211
+ xmlns: "http://www.w3.org/2000/svg",
15212
+ role: "img",
15213
+ "aria-label": "Card Payment"
15202
15214
  }, /*#__PURE__*/React__default.createElement("rect", {
15203
15215
  width: "36",
15204
15216
  height: "24",
@@ -22095,7 +22107,7 @@ var HiddenCheckbox = styled__default.input.attrs({
22095
22107
  }).withConfig({
22096
22108
  displayName: "Checkbox__HiddenCheckbox",
22097
22109
  componentId: "sc-36kqbv-3"
22098
- })(["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;"]);
22099
22111
  var StyledCheckbox = styled__default.div.withConfig({
22100
22112
  displayName: "Checkbox__StyledCheckbox",
22101
22113
  componentId: "sc-36kqbv-4"
@@ -22163,14 +22175,14 @@ var Checkbox = function Checkbox(_ref4) {
22163
22175
  background: themeValues.backgroundColor,
22164
22176
  extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
22165
22177
  }, /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22166
- "data-qa": dataQa
22178
+ "data-qa": dataQa,
22179
+ id: "".concat(name, "_label_container")
22167
22180
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22168
22181
  "data-qa": "Checkbox"
22169
22182
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22170
22183
  id: "checkbox-".concat(name),
22171
22184
  disabled: disabled,
22172
22185
  name: name,
22173
- "aria-label": name,
22174
22186
  checked: checked,
22175
22187
  onChange: onChange,
22176
22188
  tabIndex: "-1",
@@ -22188,7 +22200,8 @@ var Checkbox = function Checkbox(_ref4) {
22188
22200
  errorStyles: themeValues.errorStyles,
22189
22201
  disabledStyles: themeValues.disabledStyles,
22190
22202
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22191
- focusedStyles: themeValues.focusedStyles
22203
+ focusedStyles: themeValues.focusedStyles,
22204
+ "aria-labelledby": title ? "".concat(name, "_title_id") : "".concat(name, "_label_container")
22192
22205
  }, /*#__PURE__*/React__default.createElement(CheckboxIcon, {
22193
22206
  viewBox: "0 0 24 24",
22194
22207
  disabled: disabled,
@@ -22200,6 +22213,7 @@ var Checkbox = function Checkbox(_ref4) {
22200
22213
  variant: "p",
22201
22214
  weight: themeValues.textFontWeight,
22202
22215
  color: themeValues.textColor,
22216
+ id: "".concat(name, "_title_id"),
22203
22217
  extraStyles: textExtraStyles ? "".concat(textExtraStyles, " ").concat(disabled && "color: #6e727e; background-color: #f7f7f7;", " ") : "margin-left: 1rem ".concat(disabled && "color: #6e727e; background-color: #f7f7f7;")
22204
22218
  }, title)));
22205
22219
  };
@@ -45755,9 +45769,7 @@ var Modal$1 = function Modal(_ref) {
45755
45769
  _ref$dataQa = _ref.dataQa,
45756
45770
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45757
45771
  _ref$initialFocusSele = _ref.initialFocusSelector,
45758
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
45759
- _ref$modalName = _ref.modalName,
45760
- modalName = _ref$modalName === void 0 ? "" : _ref$modalName;
45772
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45761
45773
 
45762
45774
  var _useContext = React.useContext(styled.ThemeContext),
45763
45775
  isMobile = _useContext.isMobile;
@@ -45786,8 +45798,9 @@ var Modal$1 = function Modal(_ref) {
45786
45798
  },
45787
45799
  underlayClickExits: underlayClickExits,
45788
45800
  "aria-modal": true,
45789
- "aria-name": !!modalName.length ? modalName : modalHeaderText,
45790
- initialFocus: initialFocusSelector
45801
+ initialFocus: initialFocusSelector,
45802
+ focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45803
+
45791
45804
  }, /*#__PURE__*/React__default.createElement(Box, {
45792
45805
  padding: "0",
45793
45806
  borderRadius: "2px",
@@ -47717,7 +47730,8 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47717
47730
  continueAction: function continueAction() {
47718
47731
  toggleAccepted(true);
47719
47732
  toggleOpen(false);
47720
- }
47733
+ },
47734
+ initialFocusSelector: "[name='Close']"
47721
47735
  }, /*#__PURE__*/React__default.createElement(Text$1, {
47722
47736
  variant: "pS",
47723
47737
  onClick: function onClick() {
@@ -47849,7 +47863,13 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47849
47863
  error = _ref$error === void 0 ? false : _ref$error,
47850
47864
  linkVariant = _ref.linkVariant,
47851
47865
  _ref$initialFocusSele = _ref.initialFocusSelector,
47852
- 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;
47853
47873
 
47854
47874
  var _useState = React.useState(false),
47855
47875
  _useState2 = _slicedToArray(_useState, 2),
@@ -47861,11 +47881,16 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47861
47881
  title: "Terms and Conditions",
47862
47882
  error: error,
47863
47883
  checked: isChecked,
47864
- onChange: onCheck
47884
+ onChange: onCheck,
47885
+ "aria-labelledby": ariaLabelledBy || (screenReaderCheckboxLabel ? "".concat(id, "_sr_only_label") : "".concat(id, "_html_label"))
47865
47886
  }), /*#__PURE__*/React__default.createElement(Box, {
47866
47887
  padding: "0 0 0 58px"
47867
- }, /*#__PURE__*/React__default.createElement(Stack, null, /*#__PURE__*/React__default.createElement(Box, {
47868
- padding: "0"
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, {
47892
+ padding: "0",
47893
+ id: "".concat(id, "_html_label")
47869
47894
  }, html), terms && /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
47870
47895
  link: "Learn More",
47871
47896
  terms: terms,
@@ -47903,7 +47928,11 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47903
47928
  _ref$modalTitle = _ref.modalTitle,
47904
47929
  modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47905
47930
  _ref$initialFocusSele = _ref.initialFocusSelector,
47906
- 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;
47907
47936
 
47908
47937
  var _useState = React.useState(false),
47909
47938
  _useState2 = _slicedToArray(_useState, 2),
@@ -47929,19 +47958,24 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47929
47958
  }, /*#__PURE__*/React__default.createElement(Stack, {
47930
47959
  childGap: "0"
47931
47960
  }, html && /*#__PURE__*/React__default.createElement(Box, {
47932
- padding: "0"
47961
+ padding: "0",
47962
+ id: "".concat(id, "_html_label")
47933
47963
  }, html), /*#__PURE__*/React__default.createElement(Cluster, {
47934
47964
  justify: "flex-start",
47935
47965
  align: "center",
47936
47966
  nowrap: true
47937
- }, showCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
47967
+ }, showCheckbox && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Checkbox$1, {
47938
47968
  name: id,
47939
47969
  error: hasError,
47940
47970
  checked: isChecked,
47941
47971
  onChange: onCheck,
47942
47972
  checkboxMargin: checkboxMargin,
47943
- extraStyles: "align-self: flex-start;"
47944
- }), /*#__PURE__*/React__default.createElement(Stack, {
47973
+ extraStyles: "align-self: flex-start;",
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, {
47945
47979
  childGap: "0.25rem",
47946
47980
  fullHeight: true
47947
47981
  }, /*#__PURE__*/React__default.createElement(Cluster, {
@@ -47977,9 +48011,7 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
47977
48011
  rest = _objectWithoutProperties(_ref, _excluded$y);
47978
48012
 
47979
48013
  var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
47980
- return /*#__PURE__*/React__default.createElement(TermsAndConditionsControl, _extends({
47981
- initialFocusSelector: "[role='button']:not(.modal-trigger)"
47982
- }, rest));
48014
+ return /*#__PURE__*/React__default.createElement(TermsAndConditionsControl, rest);
47983
48015
  };
47984
48016
 
47985
48017
  var PaymentFormACH = function PaymentFormACH(_ref) {
@@ -48161,7 +48193,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48161
48193
  version: "v2",
48162
48194
  showCheckbox: false,
48163
48195
  description: "View",
48164
- terms: termsContent
48196
+ terms: termsContent,
48197
+ initialFocusSelector: ".modal-close-button"
48165
48198
  })))));
48166
48199
  };
48167
48200
 
@@ -48357,7 +48390,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48357
48390
  version: "v2",
48358
48391
  showCheckbox: false,
48359
48392
  description: "View",
48360
- terms: termsContent
48393
+ terms: termsContent,
48394
+ initialFocusSelector: ".modal-close-button"
48361
48395
  })))));
48362
48396
  };
48363
48397