@thecb/components 9.3.2 → 9.3.3-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 +51 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +51 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +3 -0
- package/src/components/molecules/modal/Modal.js +16 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -0
- package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +19 -2
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV1.js +3 -1
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +3 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +5 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +8 -3
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -50,6 +50,7 @@ const AccountAndRoutingModal = ({
|
|
|
50
50
|
toggleAccepted(true);
|
|
51
51
|
toggleOpen(false);
|
|
52
52
|
}}
|
|
53
|
+
initialFocusSelector={"[name='Close']"}
|
|
53
54
|
>
|
|
54
55
|
<Text
|
|
55
56
|
variant="pS"
|
|
@@ -60,6 +61,8 @@ const AccountAndRoutingModal = ({
|
|
|
60
61
|
weight={themeValues.fontWeight}
|
|
61
62
|
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
62
63
|
extraStyles={`cursor: pointer;`}
|
|
64
|
+
role="button"
|
|
65
|
+
className="modal-trigger"
|
|
63
66
|
>
|
|
64
67
|
{link}
|
|
65
68
|
</Text>
|
|
@@ -45,10 +45,12 @@ const Modal = ({
|
|
|
45
45
|
isLoading,
|
|
46
46
|
buttonExtraStyles,
|
|
47
47
|
children,
|
|
48
|
-
dataQa = null
|
|
48
|
+
dataQa = null,
|
|
49
|
+
initialFocusSelector = ""
|
|
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 && (
|
|
@@ -71,6 +73,9 @@ const Modal = ({
|
|
|
71
73
|
overflow: "auto"
|
|
72
74
|
}}
|
|
73
75
|
underlayClickExits={underlayClickExits}
|
|
76
|
+
aria-modal={true}
|
|
77
|
+
initialFocus={initialFocusSelector}
|
|
78
|
+
focusDialog={!initialFocusSelector} // Focus the dialogue box itself if no selector for initial focus was provided
|
|
74
79
|
>
|
|
75
80
|
<Box
|
|
76
81
|
padding="0"
|
|
@@ -125,6 +130,8 @@ const Modal = ({
|
|
|
125
130
|
dataQa={cancelButtonText}
|
|
126
131
|
extraStyles={buttonExtraStyles}
|
|
127
132
|
className="modal-cancel-button"
|
|
133
|
+
role="button"
|
|
134
|
+
name={cancelButtonText}
|
|
128
135
|
/>
|
|
129
136
|
</Box>
|
|
130
137
|
<Box width="100%" padding="0">
|
|
@@ -139,6 +146,8 @@ const Modal = ({
|
|
|
139
146
|
disabled={isContinueActionDisabled}
|
|
140
147
|
extraStyles={buttonExtraStyles}
|
|
141
148
|
className="modal-continue-button"
|
|
149
|
+
role="button"
|
|
150
|
+
name={continueButtonText}
|
|
142
151
|
/>
|
|
143
152
|
</Box>
|
|
144
153
|
</Stack>
|
|
@@ -157,6 +166,8 @@ const Modal = ({
|
|
|
157
166
|
dataQa={cancelButtonText}
|
|
158
167
|
extraStyles={buttonExtraStyles}
|
|
159
168
|
className="modal-cancel-button"
|
|
169
|
+
role="button"
|
|
170
|
+
name={cancelButtonText}
|
|
160
171
|
/>
|
|
161
172
|
<ButtonWithAction
|
|
162
173
|
variant={
|
|
@@ -169,6 +180,8 @@ const Modal = ({
|
|
|
169
180
|
disabled={isContinueActionDisabled}
|
|
170
181
|
extraStyles={buttonExtraStyles}
|
|
171
182
|
className="modal-continue-button"
|
|
183
|
+
role="button"
|
|
184
|
+
name={continueButtonText}
|
|
172
185
|
/>
|
|
173
186
|
</Stack>
|
|
174
187
|
)}
|
|
@@ -182,6 +195,8 @@ const Modal = ({
|
|
|
182
195
|
dataQa={closeButtonText}
|
|
183
196
|
extraStyles={buttonExtraStyles}
|
|
184
197
|
className="modal-close-button"
|
|
198
|
+
role="button"
|
|
199
|
+
name={closeButtonText}
|
|
185
200
|
/>
|
|
186
201
|
</Box>
|
|
187
202
|
)}
|
|
@@ -7,14 +7,31 @@ import { noop } from "../../../util/general";
|
|
|
7
7
|
|
|
8
8
|
const groupId = "props";
|
|
9
9
|
|
|
10
|
+
const Terms = () => (
|
|
11
|
+
<p>
|
|
12
|
+
Modal Content: Elit voluptate cupidatat in pariatur anim in excepteur non.{" "}
|
|
13
|
+
<a href="#modal-bottom" id="focus-me">
|
|
14
|
+
Laboris elit laboris labore pariatur incididunt
|
|
15
|
+
</a>{" "}
|
|
16
|
+
proident occaecat laboris sit elit. Dolor irure enim adipisicing irure
|
|
17
|
+
consectetur dolor enim eiusmod elit eiusmod ut. Pariatur ut quis et pariatur
|
|
18
|
+
nulla nostrud sit esse. Veniam est occaecat cupidatat est nulla dolor minim
|
|
19
|
+
nostrud anim ea voluptate. modal content. Elit voluptate cupidatat in
|
|
20
|
+
pariatur anim in excepteur non. Laboris elit laboris labore pariatur
|
|
21
|
+
incididunt proident occaecat laboris sit elit. Dolor irure enim adipisicing
|
|
22
|
+
irure consectetur dolor enim eiusmod elit eiusmod ut. Pariatur ut quis et
|
|
23
|
+
pariatur nulla nostrud sit esse.
|
|
24
|
+
</p>
|
|
25
|
+
);
|
|
26
|
+
|
|
10
27
|
export const termsAndConditions = () => (
|
|
11
28
|
<TermsAndConditions
|
|
12
29
|
version={select("version", ["v1", "v2"], "v1", groupId)}
|
|
13
30
|
onCheck={noop}
|
|
14
31
|
isChecked={boolean("isChecked", false, groupId)}
|
|
15
|
-
|
|
16
|
-
terms={text("terms", "terms and conditions modal text", groupId)}
|
|
32
|
+
terms={<Terms />}
|
|
17
33
|
error={boolean("error", false, groupId)}
|
|
34
|
+
initialFocusSelector={text("initialFocusSelector", "#focus-me", groupId)}
|
|
18
35
|
description={text("description", "I definitely agree to the", groupId)}
|
|
19
36
|
/>
|
|
20
37
|
);
|
|
@@ -10,7 +10,8 @@ const TermsAndConditionsControlV1 = ({
|
|
|
10
10
|
html,
|
|
11
11
|
terms,
|
|
12
12
|
error = false,
|
|
13
|
-
linkVariant
|
|
13
|
+
linkVariant,
|
|
14
|
+
initialFocusSelector = ""
|
|
14
15
|
}) => {
|
|
15
16
|
const [showTerms, toggleShowTerms] = useState(false);
|
|
16
17
|
return (
|
|
@@ -33,6 +34,7 @@ const TermsAndConditionsControlV1 = ({
|
|
|
33
34
|
isOpen={showTerms}
|
|
34
35
|
toggleOpen={toggleShowTerms}
|
|
35
36
|
linkVariant={linkVariant}
|
|
37
|
+
initialFocusSelector={initialFocusSelector}
|
|
36
38
|
/>
|
|
37
39
|
)}
|
|
38
40
|
</Stack>
|
|
@@ -28,7 +28,8 @@ const TermsAndConditionsControlV2 = ({
|
|
|
28
28
|
modalVariant = "default",
|
|
29
29
|
containerBackground = ATHENS_GREY,
|
|
30
30
|
checkboxMargin = "4px 8px 4px 4px",
|
|
31
|
-
modalTitle = "Terms and Conditions"
|
|
31
|
+
modalTitle = "Terms and Conditions",
|
|
32
|
+
initialFocusSelector = ""
|
|
32
33
|
}) => {
|
|
33
34
|
const [showTerms, toggleShowTerms] = useState(false);
|
|
34
35
|
const standardBoxShadow = generateShadows().standard.base;
|
|
@@ -79,6 +80,7 @@ const TermsAndConditionsControlV2 = ({
|
|
|
79
80
|
toggleOpen={toggleTerms}
|
|
80
81
|
linkVariant={modalVariant}
|
|
81
82
|
title={modalTitle}
|
|
83
|
+
initialFocusSelector={initialFocusSelector}
|
|
82
84
|
/>
|
|
83
85
|
)}
|
|
84
86
|
</Cluster>
|
|
@@ -15,7 +15,8 @@ const TermsAndConditionsModal = ({
|
|
|
15
15
|
terms,
|
|
16
16
|
variant,
|
|
17
17
|
linkVariant = "p",
|
|
18
|
-
themeValues
|
|
18
|
+
themeValues,
|
|
19
|
+
initialFocusSelector = ""
|
|
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
|
+
initialFocusSelector={initialFocusSelector}
|
|
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" // This should always be a "button" since it opens a modal
|
|
58
|
+
className="modal-trigger"
|
|
55
59
|
>
|
|
56
60
|
{link}
|
|
57
61
|
</Text>
|
package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js
CHANGED
|
@@ -20,17 +20,22 @@ const linkVariants = {
|
|
|
20
20
|
pXL: "PXL"
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
const Terms = () => (
|
|
24
|
+
<p>
|
|
25
|
+
Terms content with a <a href="#">link</a> that should NOT get initial focus.
|
|
26
|
+
Instead, the <code>Cancel</code> button below should.
|
|
27
|
+
</p>
|
|
28
|
+
);
|
|
23
29
|
export const termsAndConditionsModal = () => (
|
|
24
30
|
<TermsAndConditionsModal
|
|
25
31
|
link={text("text", "Show modal", groupId)}
|
|
26
32
|
title={text("title", "Title", groupId)}
|
|
27
33
|
isOpen={boolean("isOpen", false, groupId)}
|
|
28
|
-
// toggleOpen={setShowTerms}
|
|
29
|
-
// toggleAccepted={toggleTermsAccepted}
|
|
30
34
|
acceptText={text("acceptText", "Accept", groupId)}
|
|
31
|
-
terms={
|
|
35
|
+
terms={<Terms />}
|
|
32
36
|
variant={select("variants", variants, "default", groupId)}
|
|
33
37
|
linkVariant={select("linkVariants", linkVariants, groupId)}
|
|
38
|
+
initialFocusSelector="[name='Cancel']"
|
|
34
39
|
/>
|
|
35
40
|
);
|
|
36
41
|
|
|
File without changes
|