@thecb/components 9.2.7-beta.9 → 9.2.9-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "9.2.7-beta.9",
3
+ "version": "9.2.9-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -265,11 +265,13 @@ const Dropdown = ({
265
265
  clearTimeout(timer);
266
266
  setTimer(setTimeout(() => setInputValue(""), 20000));
267
267
  }
268
+
268
269
  setFilteredOptions(
269
270
  options.filter(
270
271
  option =>
271
- option.value.toLowerCase().match(inputValue.toLowerCase()) ||
272
- option.text.toLowerCase().match(inputValue.toLowerCase())
272
+ option?.value?.toLowerCase()?.indexOf(inputValue?.toLowerCase()) >=
273
+ 0 ||
274
+ option.text?.toLowerCase()?.indexOf(inputValue?.toLowerCase()) >= 0
273
275
  )
274
276
  );
275
277
  }, [inputValue]);
@@ -7,6 +7,8 @@ const AccountNumberImage = () => {
7
7
  width="371"
8
8
  height="164"
9
9
  viewBox="0 0 371 164"
10
+ role="img"
11
+ aria-label="A check with the account number highlighted in the bottom center"
10
12
  >
11
13
  <g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
12
14
  <g transform="translate(-364 -546)">
@@ -8,6 +8,8 @@ export const BankIcon = () => {
8
8
  viewBox="0 0 28 18"
9
9
  fill="none"
10
10
  xmlns="http://www.w3.org/2000/svg"
11
+ role="img"
12
+ aria-label="Check Payment"
11
13
  >
12
14
  <path
13
15
  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"
@@ -9,6 +9,8 @@ const CheckmarkIcon = () => (
9
9
  version="1.1"
10
10
  xmlns="http://www.w3.org/2000/svg"
11
11
  xmlnsXlink="http://www.w3.org/1999/xlink"
12
+ role="img"
13
+ aria-label="Successful payment, green checkmark"
12
14
  >
13
15
  <g
14
16
  id="Cityville-Checkout---Desktop---Logged-In"
@@ -7,6 +7,8 @@ const GenericCard = () => (
7
7
  viewBox="0 0 28 18"
8
8
  fill="none"
9
9
  xmlns="http://www.w3.org/2000/svg"
10
+ role="img"
11
+ aria-label="Card Payment"
10
12
  >
11
13
  <rect width="28" height="18" rx="2" fill="#15749D" />
12
14
  <path
@@ -7,6 +7,8 @@ const RoutingNumberImage = () => {
7
7
  width="371"
8
8
  height="164"
9
9
  viewBox="0 0 371 164"
10
+ role="img"
11
+ aria-label="A check with the routing number highlighted in the lower left hand corner"
10
12
  >
11
13
  <g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
12
14
  <g transform="translate(-365 -522)">
@@ -60,8 +60,6 @@ const AccountAndRoutingModal = ({
60
60
  weight={themeValues.fontWeight}
61
61
  hoverStyles={themeValues.modalLinkHoverFocus}
62
62
  extraStyles={`cursor: pointer;`}
63
- role="button"
64
- className="modal-trigger"
65
63
  >
66
64
  {link}
67
65
  </Text>
@@ -45,12 +45,10 @@ const Modal = ({
45
45
  isLoading,
46
46
  buttonExtraStyles,
47
47
  children,
48
- dataQa = null,
49
- initialFocus = null
48
+ dataQa = null
50
49
  }) => {
51
50
  const { isMobile } = useContext(ThemeContext);
52
51
  const modalContainerRef = useRef(null);
53
-
54
52
  return (
55
53
  <div ref={modalContainerRef} data-qa={dataQa}>
56
54
  {modalOpen && (
@@ -69,12 +67,10 @@ const Modal = ({
69
67
  alignItems: "center"
70
68
  }}
71
69
  dialogStyle={{
72
- width: customWidth || "615px"
70
+ width: customWidth || "615px",
71
+ overflow: "auto"
73
72
  }}
74
73
  underlayClickExits={underlayClickExits}
75
- aria-modal={true}
76
- aria-name={modalHeaderText}
77
- {...(initialFocus ? { initialFocus: initialFocus } : {})}
78
74
  >
79
75
  <Box
80
76
  padding="0"
@@ -129,8 +125,6 @@ const Modal = ({
129
125
  dataQa={cancelButtonText}
130
126
  extraStyles={buttonExtraStyles}
131
127
  className="modal-cancel-button"
132
- role="button"
133
- name={cancelButtonText}
134
128
  />
135
129
  </Box>
136
130
  <Box width="100%" padding="0">
@@ -145,8 +139,6 @@ const Modal = ({
145
139
  disabled={isContinueActionDisabled}
146
140
  extraStyles={buttonExtraStyles}
147
141
  className="modal-continue-button"
148
- role="button"
149
- name={continueButtonText}
150
142
  />
151
143
  </Box>
152
144
  </Stack>
@@ -165,8 +157,6 @@ const Modal = ({
165
157
  dataQa={cancelButtonText}
166
158
  extraStyles={buttonExtraStyles}
167
159
  className="modal-cancel-button"
168
- role="button"
169
- name={cancelButtonText}
170
160
  />
171
161
  <ButtonWithAction
172
162
  variant={
@@ -179,8 +169,6 @@ const Modal = ({
179
169
  disabled={isContinueActionDisabled}
180
170
  extraStyles={buttonExtraStyles}
181
171
  className="modal-continue-button"
182
- role="button"
183
- name={continueButtonText}
184
172
  />
185
173
  </Stack>
186
174
  )}
@@ -194,8 +182,6 @@ const Modal = ({
194
182
  dataQa={closeButtonText}
195
183
  extraStyles={buttonExtraStyles}
196
184
  className="modal-close-button"
197
- role="button"
198
- name={closeButtonText}
199
185
  />
200
186
  </Box>
201
187
  )}
@@ -33,7 +33,6 @@ const TermsAndConditionsControlV1 = ({
33
33
  isOpen={showTerms}
34
34
  toggleOpen={toggleShowTerms}
35
35
  linkVariant={linkVariant}
36
- initialFocus={`[role="button"]:not(.modal-trigger)`}
37
36
  />
38
37
  )}
39
38
  </Stack>
@@ -75,7 +75,6 @@ const TermsAndConditionsControlV2 = ({
75
75
  toggleOpen={toggleTerms}
76
76
  linkVariant={modalVariant}
77
77
  title={modalTitle}
78
- initialFocus={`.modal-close-button`}
79
78
  />
80
79
  )}
81
80
  </Cluster>
@@ -15,8 +15,7 @@ const TermsAndConditionsModal = ({
15
15
  terms,
16
16
  variant,
17
17
  linkVariant = "p",
18
- themeValues,
19
- initialFocus = null
18
+ themeValues
20
19
  }) => (
21
20
  <Modal
22
21
  modalOpen={isOpen}
@@ -43,7 +42,6 @@ const TermsAndConditionsModal = ({
43
42
  toggleAccepted(true);
44
43
  toggleOpen(false);
45
44
  }}
46
- {...(initialFocus ? { initialFocus: initialFocus } : {})}
47
45
  >
48
46
  <Text
49
47
  variant={linkVariant}
@@ -54,8 +52,6 @@ const TermsAndConditionsModal = ({
54
52
  weight={themeValues.fontWeight}
55
53
  hoverStyles={themeValues.modalLinkHoverFocus}
56
54
  extraStyles={`display: inline-block; width: fit-content; cursor: pointer`}
57
- role="button"
58
- className="modal-trigger"
59
55
  >
60
56
  {link}
61
57
  </Text>