@thecb/components 7.10.0-beta.0 → 7.10.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/dist/index.cjs.js +353 -257
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +353 -258
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +101 -96
- package/src/components/atoms/icons/PencilIcon.js +22 -0
- package/src/components/atoms/icons/icons.stories.js +2 -0
- package/src/components/atoms/icons/index.js +2 -0
- package/src/components/atoms/layouts/Box.styled.js +2 -2
- package/src/components/atoms/layouts/Cluster.d.ts +1 -0
- package/src/components/atoms/layouts/Cluster.js +2 -0
- package/src/components/atoms/line-item/LineItem.js +15 -1
- package/src/components/atoms/line-item/LineItem.stories.js +9 -0
- package/src/components/molecules/nav-menu/NavMenuMobile.js +3 -1
- package/src/components/molecules/pagination/Pagination.js +44 -20
- package/src/components/molecules/pagination/index.d.ts +1 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +35 -8
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +37 -10
- package/src/components/molecules/terms-and-conditions/TermsAndConditions.js +3 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +3 -2
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +10 -0
- package/src/components/molecules/workflow-tile/WorkflowTile.js +14 -35
- package/src/constants/colors.js +6 -0
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useContext } from "react";
|
|
1
|
+
import React, { useEffect, useContext, useState } from "react";
|
|
2
2
|
import { ThemeContext } from "styled-components";
|
|
3
3
|
import {
|
|
4
4
|
required,
|
|
@@ -26,8 +26,10 @@ import {
|
|
|
26
26
|
FormContainer,
|
|
27
27
|
FormInputRow
|
|
28
28
|
} from "../../atoms/form-layouts";
|
|
29
|
-
import { Box } from "../../atoms/layouts";
|
|
29
|
+
import { Box, Cluster, Cover } from "../../atoms/layouts";
|
|
30
30
|
import withWindowSize from "../../withWindowSize";
|
|
31
|
+
import TermsAndConditionsModal from "../terms-and-conditions-modal/TermsAndConditionsModal";
|
|
32
|
+
import Text from "../../atoms/text";
|
|
31
33
|
|
|
32
34
|
const PaymentFormCard = ({
|
|
33
35
|
variant = "default",
|
|
@@ -40,9 +42,15 @@ const PaymentFormCard = ({
|
|
|
40
42
|
showWalletCheckbox,
|
|
41
43
|
saveToWallet,
|
|
42
44
|
walletCheckboxMarked,
|
|
43
|
-
deniedCards
|
|
45
|
+
deniedCards,
|
|
46
|
+
termsContent,
|
|
47
|
+
termsTitle = "Terms & Conditions"
|
|
44
48
|
}) => {
|
|
45
49
|
const { isMobile } = useContext(ThemeContext);
|
|
50
|
+
const [termsModalOpen, setTermsModalOpen] = useState(false);
|
|
51
|
+
const showTerms = !!termsContent;
|
|
52
|
+
const showTermsLinkVariant = showWalletCheckbox ? "p" : "pS";
|
|
53
|
+
|
|
46
54
|
useEffect(() => {
|
|
47
55
|
if (deniedCards) {
|
|
48
56
|
deniedCards.map(card =>
|
|
@@ -177,13 +185,32 @@ const PaymentFormCard = ({
|
|
|
177
185
|
/>
|
|
178
186
|
</Box>
|
|
179
187
|
)}
|
|
180
|
-
{showWalletCheckbox && (
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
188
|
+
{(showWalletCheckbox || showTerms) && (
|
|
189
|
+
<Cluster childGap={"4px"}>
|
|
190
|
+
{showWalletCheckbox && (
|
|
191
|
+
<Checkbox
|
|
192
|
+
name="credit card checkbox"
|
|
193
|
+
title="Save credit card to wallet."
|
|
194
|
+
checked={walletCheckboxMarked}
|
|
195
|
+
onChange={saveToWallet}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
{showTerms && (
|
|
199
|
+
<Cover singleChild>
|
|
200
|
+
<Cluster childGap={0}>
|
|
201
|
+
<Text variant={showTermsLinkVariant}>View </Text>
|
|
202
|
+
<TermsAndConditionsModal
|
|
203
|
+
link={termsTitle}
|
|
204
|
+
linkVariant={showTermsLinkVariant}
|
|
205
|
+
terms={termsContent}
|
|
206
|
+
title={termsTitle}
|
|
207
|
+
isOpen={termsModalOpen}
|
|
208
|
+
toggleOpen={setTermsModalOpen}
|
|
209
|
+
/>
|
|
210
|
+
</Cluster>
|
|
211
|
+
</Cover>
|
|
212
|
+
)}
|
|
213
|
+
</Cluster>
|
|
187
214
|
)}
|
|
188
215
|
</FormInputColumn>
|
|
189
216
|
</FormContainer>
|
|
@@ -9,7 +9,8 @@ const TermsAndConditions = ({
|
|
|
9
9
|
isChecked,
|
|
10
10
|
html,
|
|
11
11
|
terms,
|
|
12
|
-
error = false
|
|
12
|
+
error = false,
|
|
13
|
+
linkVariant
|
|
13
14
|
}) => {
|
|
14
15
|
const [showTerms, toggleShowTerms] = useState(false);
|
|
15
16
|
return (
|
|
@@ -31,6 +32,7 @@ const TermsAndConditions = ({
|
|
|
31
32
|
terms={terms}
|
|
32
33
|
isOpen={showTerms}
|
|
33
34
|
toggleOpen={toggleShowTerms}
|
|
35
|
+
linkVariant={linkVariant}
|
|
34
36
|
/>
|
|
35
37
|
)}
|
|
36
38
|
</Stack>
|
|
@@ -14,6 +14,7 @@ const TermsAndConditionsModal = ({
|
|
|
14
14
|
acceptText,
|
|
15
15
|
terms,
|
|
16
16
|
variant,
|
|
17
|
+
linkVariant = "p",
|
|
17
18
|
themeValues
|
|
18
19
|
}) => (
|
|
19
20
|
<Modal
|
|
@@ -42,14 +43,14 @@ const TermsAndConditionsModal = ({
|
|
|
42
43
|
}}
|
|
43
44
|
>
|
|
44
45
|
<Text
|
|
45
|
-
variant={
|
|
46
|
+
variant={linkVariant}
|
|
46
47
|
onClick={() => toggleOpen(true)}
|
|
47
48
|
onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
|
|
48
49
|
tabIndex="0"
|
|
49
50
|
color={themeValues.linkColor}
|
|
50
51
|
weight={themeValues.fontWeight}
|
|
51
52
|
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
52
|
-
extraStyles={`display: inline-block; width: fit-content
|
|
53
|
+
extraStyles={`display: inline-block; width: fit-content; cursor: pointer`}
|
|
53
54
|
>
|
|
54
55
|
{link}
|
|
55
56
|
</Text>
|
package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js
CHANGED
|
@@ -11,6 +11,15 @@ const variants = {
|
|
|
11
11
|
};
|
|
12
12
|
const groupId = "props";
|
|
13
13
|
|
|
14
|
+
const linkVariants = {
|
|
15
|
+
p: "p",
|
|
16
|
+
pL: "pL",
|
|
17
|
+
pS: "pS",
|
|
18
|
+
pXS: "pXS",
|
|
19
|
+
pXXS: "pXXS",
|
|
20
|
+
pXL: "PXL"
|
|
21
|
+
};
|
|
22
|
+
|
|
14
23
|
export const termsAndConditionsModal = () => (
|
|
15
24
|
<TermsAndConditionsModal
|
|
16
25
|
link={text("text", "Show modal", groupId)}
|
|
@@ -21,6 +30,7 @@ export const termsAndConditionsModal = () => (
|
|
|
21
30
|
acceptText={text("acceptText", "Accept", groupId)}
|
|
22
31
|
terms={text("terms", "terms and conditions", groupId)}
|
|
23
32
|
variant={select("variants", variants, "default", groupId)}
|
|
33
|
+
linkVariant={select("linkVariants", linkVariants, groupId)}
|
|
24
34
|
/>
|
|
25
35
|
);
|
|
26
36
|
|
|
@@ -12,16 +12,13 @@ import {
|
|
|
12
12
|
} from "../../../constants/colors";
|
|
13
13
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
14
14
|
import ButtonWithLink from "../../atoms/button-with-link";
|
|
15
|
-
import ButtonWithAction from "../../atoms/button-with-action";
|
|
16
15
|
import { Box, Stack } from "../../atoms/layouts";
|
|
17
16
|
const WorkflowTile = ({
|
|
18
17
|
workflowName = "Test Workflow",
|
|
19
18
|
workflowDescription = "Link your benefit plan",
|
|
20
19
|
workflowActionName = "Search",
|
|
21
20
|
slug,
|
|
22
|
-
buttonVariant = "primary"
|
|
23
|
-
selectWorkflowAction,
|
|
24
|
-
navigate
|
|
21
|
+
buttonVariant = "primary"
|
|
25
22
|
}) => (
|
|
26
23
|
<Box
|
|
27
24
|
background={WHITE}
|
|
@@ -51,37 +48,19 @@ const WorkflowTile = ({
|
|
|
51
48
|
borderColor={GRECIAN_GREY}
|
|
52
49
|
borderWidthOverride="2px 0 0 0"
|
|
53
50
|
>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
navigate(`/service/${slug}`);
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
) : (
|
|
71
|
-
<ButtonWithLink
|
|
72
|
-
variant={buttonVariant}
|
|
73
|
-
primary={buttonVariant == "primary"}
|
|
74
|
-
primaryBG={MATISSE_BLUE}
|
|
75
|
-
fontWeight={FONT_WEIGHT_SEMIBOLD}
|
|
76
|
-
fontSize={"1.125rem"}
|
|
77
|
-
text={workflowActionName}
|
|
78
|
-
minWidth={"100%"}
|
|
79
|
-
url={`/service/${slug}`}
|
|
80
|
-
extraStyles={`width: 100%; margin: 0;`}
|
|
81
|
-
linkExtraStyles={`justify-content: center;`}
|
|
82
|
-
dataQa={slug}
|
|
83
|
-
/>
|
|
84
|
-
)}
|
|
51
|
+
<ButtonWithLink
|
|
52
|
+
variant={buttonVariant}
|
|
53
|
+
primary={buttonVariant == "primary"}
|
|
54
|
+
primaryBG={MATISSE_BLUE}
|
|
55
|
+
fontWeight={FONT_WEIGHT_SEMIBOLD}
|
|
56
|
+
fontSize={"1.125rem"}
|
|
57
|
+
text={workflowActionName}
|
|
58
|
+
minWidth={"100%"}
|
|
59
|
+
url={`/service/${slug}`}
|
|
60
|
+
extraStyles={`width: 100%; margin: 0;`}
|
|
61
|
+
linkExtraStyles={`justify-content: center;`}
|
|
62
|
+
dataQa={slug}
|
|
63
|
+
/>
|
|
85
64
|
</Box>
|
|
86
65
|
</Stack>
|
|
87
66
|
</Box>
|
package/src/constants/colors.js
CHANGED
|
@@ -54,6 +54,8 @@ const HOVER_LIGHT_BLUE = "#EFFAFF";
|
|
|
54
54
|
const MATISSE_BLUE = "#15749D";
|
|
55
55
|
const ROYAL_BLUE = "#3181E3";
|
|
56
56
|
const ASTRAL_BLUE = "#3176AA";
|
|
57
|
+
const SAPPHIRE_BLUE = "#116285";
|
|
58
|
+
const PEACOCK_BLUE = "#0E506D";
|
|
57
59
|
// GREEN
|
|
58
60
|
const FOREST_GREEN = "#19b03F";
|
|
59
61
|
const MEADOW_GREEN = "#16C98D";
|
|
@@ -76,6 +78,7 @@ const RED = "#FF0000";
|
|
|
76
78
|
const CRIMSON_RED = "#ED1C24";
|
|
77
79
|
const THUNDERBIRD_RED = "#C3191F";
|
|
78
80
|
const RAZZMATAZZ_RED = "#D11053";
|
|
81
|
+
const RASPBERRY = "#ED125F";
|
|
79
82
|
const FANTASY_RED = "#FCF4F4";
|
|
80
83
|
const COSMOS_RED = "#FFD0D3";
|
|
81
84
|
const BLUSH_RED = "#FFF0F5";
|
|
@@ -161,6 +164,8 @@ export {
|
|
|
161
164
|
MATISSE_BLUE,
|
|
162
165
|
ROYAL_BLUE,
|
|
163
166
|
ASTRAL_BLUE,
|
|
167
|
+
SAPPHIRE_BLUE,
|
|
168
|
+
PEACOCK_BLUE,
|
|
164
169
|
FOREST_GREEN,
|
|
165
170
|
MEADOW_GREEN,
|
|
166
171
|
POLAR_GREEN,
|
|
@@ -182,6 +187,7 @@ export {
|
|
|
182
187
|
FANTASY_RED,
|
|
183
188
|
COSMOS_RED,
|
|
184
189
|
BLUSH_RED,
|
|
190
|
+
RASPBERRY,
|
|
185
191
|
ALERT_COLORS,
|
|
186
192
|
ERROR_COLOR
|
|
187
193
|
};
|
package/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
File without changes
|