@thecb/components 9.2.5 → 9.2.6-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.5",
3
+ "version": "9.2.6-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",
package/src/.DS_Store ADDED
Binary file
Binary file
Binary file
@@ -60,6 +60,8 @@ const AccountAndRoutingModal = ({
60
60
  weight={themeValues.fontWeight}
61
61
  hoverStyles={themeValues.modalLinkHoverFocus}
62
62
  extraStyles={`cursor: pointer;`}
63
+ role="button"
64
+ className="modal-trigger"
63
65
  >
64
66
  {link}
65
67
  </Text>
@@ -45,10 +45,12 @@ const Modal = ({
45
45
  isLoading,
46
46
  buttonExtraStyles,
47
47
  children,
48
- dataQa = null
48
+ dataQa = null,
49
+ initialFocus = null
49
50
  }) => {
50
51
  const { isMobile } = useContext(ThemeContext);
51
52
  const modalContainerRef = useRef(null);
53
+
52
54
  return (
53
55
  <div ref={modalContainerRef} data-qa={dataQa}>
54
56
  {modalOpen && (
@@ -67,10 +69,12 @@ const Modal = ({
67
69
  alignItems: "center"
68
70
  }}
69
71
  dialogStyle={{
70
- width: customWidth || "615px",
71
- overflow: "auto"
72
+ width: customWidth || "615px"
72
73
  }}
73
74
  underlayClickExits={underlayClickExits}
75
+ aria-modal={true}
76
+ aria-name={modalHeaderText}
77
+ {...(initialFocus ? { initialFocus: initialFocus } : {})}
74
78
  >
75
79
  <Box
76
80
  padding="0"
@@ -125,6 +129,8 @@ const Modal = ({
125
129
  dataQa={cancelButtonText}
126
130
  extraStyles={buttonExtraStyles}
127
131
  className="modal-cancel-button"
132
+ role="button"
133
+ name={cancelButtonText}
128
134
  />
129
135
  </Box>
130
136
  <Box width="100%" padding="0">
@@ -139,6 +145,8 @@ const Modal = ({
139
145
  disabled={isContinueActionDisabled}
140
146
  extraStyles={buttonExtraStyles}
141
147
  className="modal-continue-button"
148
+ role="button"
149
+ name={continueButtonText}
142
150
  />
143
151
  </Box>
144
152
  </Stack>
@@ -157,6 +165,8 @@ const Modal = ({
157
165
  dataQa={cancelButtonText}
158
166
  extraStyles={buttonExtraStyles}
159
167
  className="modal-cancel-button"
168
+ role="button"
169
+ name={cancelButtonText}
160
170
  />
161
171
  <ButtonWithAction
162
172
  variant={
@@ -169,6 +179,8 @@ const Modal = ({
169
179
  disabled={isContinueActionDisabled}
170
180
  extraStyles={buttonExtraStyles}
171
181
  className="modal-continue-button"
182
+ role="button"
183
+ name={continueButtonText}
172
184
  />
173
185
  </Stack>
174
186
  )}
@@ -182,6 +194,8 @@ const Modal = ({
182
194
  dataQa={closeButtonText}
183
195
  extraStyles={buttonExtraStyles}
184
196
  className="modal-close-button"
197
+ role="button"
198
+ name={closeButtonText}
185
199
  />
186
200
  </Box>
187
201
  )}
@@ -33,6 +33,7 @@ const TermsAndConditionsControlV1 = ({
33
33
  isOpen={showTerms}
34
34
  toggleOpen={toggleShowTerms}
35
35
  linkVariant={linkVariant}
36
+ initialFocus={`[role="button"]:not(.modal-trigger)`}
36
37
  />
37
38
  )}
38
39
  </Stack>
@@ -75,6 +75,7 @@ const TermsAndConditionsControlV2 = ({
75
75
  toggleOpen={toggleTerms}
76
76
  linkVariant={modalVariant}
77
77
  title={modalTitle}
78
+ initialFocus={`.modal-close-button`}
78
79
  />
79
80
  )}
80
81
  </Cluster>
@@ -15,7 +15,8 @@ const TermsAndConditionsModal = ({
15
15
  terms,
16
16
  variant,
17
17
  linkVariant = "p",
18
- themeValues
18
+ themeValues,
19
+ initialFocus = null
19
20
  }) => (
20
21
  <Modal
21
22
  modalOpen={isOpen}
@@ -42,6 +43,7 @@ const TermsAndConditionsModal = ({
42
43
  toggleAccepted(true);
43
44
  toggleOpen(false);
44
45
  }}
46
+ {...(initialFocus ? { initialFocus: initialFocus } : {})}
45
47
  >
46
48
  <Text
47
49
  variant={linkVariant}
@@ -52,6 +54,8 @@ const TermsAndConditionsModal = ({
52
54
  weight={themeValues.fontWeight}
53
55
  hoverStyles={themeValues.modalLinkHoverFocus}
54
56
  extraStyles={`display: inline-block; width: fit-content; cursor: pointer`}
57
+ role="button"
58
+ className="modal-trigger"
55
59
  >
56
60
  {link}
57
61
  </Text>