@thecb/components 8.4.0-beta.1 → 8.4.0-beta.3
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 +65 -74
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +65 -74
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/link-card/LinkCard.js +57 -70
- package/src/components/molecules/link-card/LinkCard.stories.js +30 -8
- package/src/components/molecules/link-card/index.d.ts +7 -3
package/package.json
CHANGED
|
@@ -2,58 +2,59 @@ import React from "react";
|
|
|
2
2
|
import { useNavigate } from "react-router-dom";
|
|
3
3
|
import Heading from "../../atoms/heading";
|
|
4
4
|
import Paragraph from "../../atoms/paragraph";
|
|
5
|
-
import Text from "../../atoms/text
|
|
6
|
-
import { ROYAL_BLUE_VIVID } from "../../../constants/colors";
|
|
5
|
+
// import { Text } from "../../atoms/text";
|
|
6
|
+
// import { ROYAL_BLUE_VIVID } from "../../../constants/colors";
|
|
7
7
|
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
8
8
|
import { Box, Stack } from "../../atoms/layouts";
|
|
9
|
-
import Badge from "../../atoms/badge/Badge";
|
|
10
|
-
import { PlusCircleIcon, AutopayIcon, ArrowRightIcon } from "../../atoms/icons";
|
|
11
9
|
import { themeComponent } from "../../../util/themeUtils";
|
|
12
10
|
import { fallbackValues } from "./LinkCard.theme";
|
|
11
|
+
// import PlusCircleIcon from "../../atoms/icons/PlusCircleIcon";
|
|
12
|
+
// import ArrowRightIcon from "../../atoms/icons/ArrowRightIcon";
|
|
13
13
|
|
|
14
14
|
const LinkCard = ({
|
|
15
15
|
variant = "default",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
workflowActionName = "Link an account",
|
|
16
|
+
title = "Test Workflow",
|
|
17
|
+
subtitle = "Link your benefit plan",
|
|
19
18
|
themeValues,
|
|
20
|
-
|
|
19
|
+
path,
|
|
20
|
+
showLeft,
|
|
21
|
+
leftContent,
|
|
22
|
+
showRight,
|
|
23
|
+
rightContent,
|
|
24
|
+
onClick = () => navigate(path)
|
|
21
25
|
}) => {
|
|
22
26
|
const navigate = useNavigate();
|
|
27
|
+
const activeHoverStyles = `
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
border: 1px solid ${themeValues.color};
|
|
31
|
+
background: var(--primary-color-primary-10, #EBEFFB);
|
|
32
|
+
/* Primitives/New Shadow/3-Pressed-New */
|
|
33
|
+
box-shadow: 0px 0px 0px 0px rgba(41, 42, 51, 0.10), 0px 5px 11px 0px rgba(41, 42, 51, 0.10), 0px 4px 19px 0px rgba(41, 42, 51, 0.09), 0px 27px 26px 0px rgba(41, 42, 51, 0.05), 0px 56px 31px 0px rgba(41, 42, 51, 0.01), 0px 80px 33px 0px rgba(41, 42, 51, 0.00);
|
|
34
|
+
.show-on-hover {color: ${themeValues.color};}
|
|
35
|
+
`;
|
|
23
36
|
|
|
24
37
|
return (
|
|
25
38
|
<Box
|
|
26
39
|
background="#FEFEFE" // --grays-cool-gray-00
|
|
27
40
|
border="1px solid #C4CEF4;" // --primary-color-primary-30
|
|
28
|
-
padding={0}
|
|
29
41
|
borderRadius="8px"
|
|
30
|
-
dataQa={`link-card-${
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
min-width: 240px;
|
|
43
|
-
max-width: 288px;
|
|
44
|
-
min-height: 141px;
|
|
45
|
-
padding: 16px 24px;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: flex-start;
|
|
48
|
-
gap: 40px;
|
|
49
|
-
flex-shrink: 0;
|
|
42
|
+
dataQa={`link-card-${title}`}
|
|
43
|
+
width="100%"
|
|
44
|
+
maxWidth="288px"
|
|
45
|
+
minWidth="240px"
|
|
46
|
+
minHeight="141px"
|
|
47
|
+
padding="16px 24px"
|
|
48
|
+
extraStyles="
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
gap: 40px;
|
|
53
|
+
flex-shrink: 0;
|
|
50
54
|
align-self: stretch;"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// window.location.pathname = `/service/${slug}`;
|
|
55
|
-
navigate(`/service/${slug}`);
|
|
56
|
-
}}
|
|
55
|
+
hoverStyles={activeHoverStyles}
|
|
56
|
+
activeStyles={activeHoverStyles}
|
|
57
|
+
onClick={onClick}
|
|
57
58
|
>
|
|
58
59
|
<Stack childGap={0} bottomItem={3} fullHeight>
|
|
59
60
|
<Box padding={"1rem 1rem 0 1rem"}>
|
|
@@ -64,10 +65,10 @@ const LinkCard = ({
|
|
|
64
65
|
margin={0}
|
|
65
66
|
extraStyles="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; align-self: stretch; overflow: hidden; text-overflow: ellipsis; font-family: Public Sans; font-size: 16px; font-style: normal; font-weight: 600; line-height: 150%;"
|
|
66
67
|
>
|
|
67
|
-
{
|
|
68
|
+
{title}
|
|
68
69
|
</Heading>
|
|
69
70
|
</Box>
|
|
70
|
-
<Box padding={"0 1rem
|
|
71
|
+
<Box padding={"0 1rem 40px"} /* minHeight={"4.25rem"}*/>
|
|
71
72
|
<Paragraph
|
|
72
73
|
variant="pS"
|
|
73
74
|
color={themeValues.color}
|
|
@@ -86,7 +87,7 @@ const LinkCard = ({
|
|
|
86
87
|
line-height: 150%; /* 21px */
|
|
87
88
|
letter-spacing: 0.14px;"
|
|
88
89
|
>
|
|
89
|
-
{
|
|
90
|
+
{subtitle}
|
|
90
91
|
</Paragraph>
|
|
91
92
|
</Box>
|
|
92
93
|
<Box
|
|
@@ -95,41 +96,27 @@ const LinkCard = ({
|
|
|
95
96
|
padding="0 1rem 1rem 1rem"
|
|
96
97
|
>
|
|
97
98
|
<Stack direction="row" justify="space-between">
|
|
98
|
-
<Box
|
|
99
|
-
background="transparent"
|
|
100
|
-
borderWidthOverride="0 0 0 0"
|
|
101
|
-
padding="0"
|
|
102
|
-
>
|
|
103
|
-
<Badge label="Autopay Available" Icon={AutopayIcon} />
|
|
104
|
-
</Box>
|
|
105
99
|
<Stack direction="row" childGap="6px">
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
{showLeft && leftContent}
|
|
101
|
+
{showRight && rightContent}
|
|
102
|
+
</Stack>
|
|
103
|
+
|
|
104
|
+
{/* <Stack direction="row" childGap="6px">
|
|
105
|
+
<Text
|
|
106
|
+
variant="pS"
|
|
107
|
+
color={themeValues.color}
|
|
108
|
+
extraStyles="text-align: right; color: transparent;"
|
|
109
|
+
className="show-on-hover"
|
|
110
|
+
>
|
|
111
|
+
{workflowActionName}
|
|
112
|
+
</Text>
|
|
113
|
+
{workflowActionName === "Find" && (
|
|
114
|
+
<PlusCircleIcon color={themeValues.color} />
|
|
118
115
|
)}
|
|
119
|
-
{workflowActionName === "Pay
|
|
120
|
-
|
|
121
|
-
<Text
|
|
122
|
-
variant="pS"
|
|
123
|
-
color={themeValues.color}
|
|
124
|
-
extraStyles="text-align: right; color: transparent;"
|
|
125
|
-
className="show-on-hover"
|
|
126
|
-
>
|
|
127
|
-
Pay
|
|
128
|
-
</Text>
|
|
129
|
-
<ArrowRightIcon color={themeValues.color} />
|
|
130
|
-
</>
|
|
116
|
+
{workflowActionName === "Pay" && (
|
|
117
|
+
<ArrowRightIcon color={themeValues.color} />
|
|
131
118
|
)}
|
|
132
|
-
</Stack>
|
|
119
|
+
</Stack> */}
|
|
133
120
|
</Stack>
|
|
134
121
|
</Box>
|
|
135
122
|
</Stack>
|
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LinkCard from "./LinkCard";
|
|
3
|
+
import Box from "../../atoms/layouts/Box";
|
|
4
|
+
import Stack from "../../atoms/layouts/Stack";
|
|
5
|
+
import Text from "../../atoms/text/Text";
|
|
3
6
|
import page from "../../../../.storybook/page";
|
|
4
7
|
import { text } from "@storybook/addon-knobs";
|
|
8
|
+
import Badge from "../../atoms/badge/Badge";
|
|
9
|
+
import PlusCircleIcon from "../../atoms/icons/PlusCircleIcon";
|
|
10
|
+
import AutopayIcon from "../../atoms/icons/AutopayIcon";
|
|
11
|
+
import { ROYAL_BLUE_VIVID } from "../../../constants/colors";
|
|
5
12
|
|
|
6
13
|
const groupId = "props";
|
|
7
14
|
|
|
8
15
|
export const linkCard = () => (
|
|
9
16
|
<LinkCard
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
title={text("title", "Link Card Title", "props")}
|
|
18
|
+
subtitle={text("subtitle", "Link card description", groupId)}
|
|
19
|
+
path={text("path", "/service/animal-care-and-control", "props")}
|
|
20
|
+
showLeft={true}
|
|
21
|
+
leftContent={
|
|
22
|
+
<Box background="transparent" borderWidthOverride="0 0 0 0" padding="0">
|
|
23
|
+
<Badge label="Autopay Available" Icon={AutopayIcon} />
|
|
24
|
+
</Box>
|
|
25
|
+
}
|
|
26
|
+
showRight={true}
|
|
27
|
+
rightContent={
|
|
28
|
+
<Stack direction="row" childGap="6px">
|
|
29
|
+
<Text
|
|
30
|
+
variant="pS"
|
|
31
|
+
color={ROYAL_BLUE_VIVID}
|
|
32
|
+
extraStyles="text-align: right; color: transparent;"
|
|
33
|
+
className="show-on-hover"
|
|
34
|
+
>
|
|
35
|
+
Find
|
|
36
|
+
</Text>
|
|
37
|
+
<PlusCircleIcon color={ROYAL_BLUE_VIVID} />
|
|
38
|
+
</Stack>
|
|
39
|
+
}
|
|
18
40
|
/>
|
|
19
41
|
);
|
|
20
42
|
|
|
@@ -3,11 +3,15 @@ import Expand from "../../../util/expand";
|
|
|
3
3
|
|
|
4
4
|
export interface LinkCardProps {
|
|
5
5
|
variant?: string; // "default" is only one
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
workflowActionName: "Find" | "Pay";
|
|
6
|
+
title?: string; // title
|
|
7
|
+
subtitle?: string; // beneath title
|
|
9
8
|
slug: string; // path segment of button on click (/service/${slug})
|
|
10
9
|
themeValues?: any;
|
|
10
|
+
showLeft?: boolean;
|
|
11
|
+
leftContent?: JSX.Element;
|
|
12
|
+
showRight?: boolean;
|
|
13
|
+
rightContent?: JSX.Element;
|
|
14
|
+
onClick: () => void;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
export const LinkCard: React.FC<Expand<LinkCardProps> &
|