@thecb/components 8.4.0-beta.0 → 8.4.0-beta.2
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 +30 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +30 -41
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/link-card/LinkCard.js +45 -47
- package/src/components/molecules/link-card/LinkCard.stories.js +30 -8
- package/src/components/molecules/link-card/index.d.ts +6 -3
package/package.json
CHANGED
|
@@ -2,57 +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 = "Find",
|
|
16
|
+
title = "Test Workflow",
|
|
17
|
+
subtitle = "Link your benefit plan",
|
|
19
18
|
themeValues,
|
|
20
|
-
|
|
19
|
+
path,
|
|
20
|
+
showLeft,
|
|
21
|
+
leftContent,
|
|
22
|
+
showRight,
|
|
23
|
+
rightContent
|
|
21
24
|
}) => {
|
|
22
25
|
const navigate = useNavigate();
|
|
26
|
+
const activeHoverStyles = `
|
|
27
|
+
border-radius: 8px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
border: 1px solid ${themeValues.color};
|
|
30
|
+
background: var(--primary-color-primary-10, #EBEFFB);
|
|
31
|
+
/* Primitives/New Shadow/3-Pressed-New */
|
|
32
|
+
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);
|
|
33
|
+
.show-on-hover {color: ${themeValues.color};}
|
|
34
|
+
`;
|
|
23
35
|
|
|
24
36
|
return (
|
|
25
37
|
<Box
|
|
26
38
|
background="#FEFEFE" // --grays-cool-gray-00
|
|
27
39
|
border="1px solid #C4CEF4;" // --primary-color-primary-30
|
|
28
|
-
padding={0}
|
|
29
40
|
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;
|
|
41
|
+
dataQa={`link-card-${title}`}
|
|
42
|
+
width="100%"
|
|
43
|
+
maxWidth="288px"
|
|
44
|
+
minWidth="240px"
|
|
45
|
+
minHeight="141px"
|
|
46
|
+
padding="16px 24px"
|
|
47
|
+
extraStyles="
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
align-items: flex-start;
|
|
51
|
+
gap: 40px;
|
|
52
|
+
flex-shrink: 0;
|
|
50
53
|
align-self: stretch;"
|
|
54
|
+
hoverStyles={activeHoverStyles}
|
|
55
|
+
activeStyles={activeHoverStyles}
|
|
51
56
|
onClick={() => {
|
|
52
|
-
|
|
53
|
-
console.log("attempting navigation...");
|
|
54
|
-
// window.location.pathname = `/service/${slug}`;
|
|
55
|
-
navigate(`/service/${slug}`);
|
|
57
|
+
navigate(path);
|
|
56
58
|
}}
|
|
57
59
|
>
|
|
58
60
|
<Stack childGap={0} bottomItem={3} fullHeight>
|
|
@@ -61,13 +63,13 @@ const LinkCard = ({
|
|
|
61
63
|
variant="h6"
|
|
62
64
|
weight={FONT_WEIGHT_SEMIBOLD}
|
|
63
65
|
color={themeValues.color}
|
|
64
|
-
margin={
|
|
66
|
+
margin={0}
|
|
65
67
|
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
68
|
>
|
|
67
|
-
{
|
|
69
|
+
{title}
|
|
68
70
|
</Heading>
|
|
69
71
|
</Box>
|
|
70
|
-
<Box padding={"0 1rem
|
|
72
|
+
<Box padding={"0 1rem 40px"} /* minHeight={"4.25rem"}*/>
|
|
71
73
|
<Paragraph
|
|
72
74
|
variant="pS"
|
|
73
75
|
color={themeValues.color}
|
|
@@ -86,23 +88,19 @@ const LinkCard = ({
|
|
|
86
88
|
line-height: 150%; /* 21px */
|
|
87
89
|
letter-spacing: 0.14px;"
|
|
88
90
|
>
|
|
89
|
-
{
|
|
91
|
+
{subtitle}
|
|
90
92
|
</Paragraph>
|
|
91
93
|
</Box>
|
|
92
94
|
<Box
|
|
93
95
|
background="transparent"
|
|
94
96
|
borderWidthOverride="0 0 0 0"
|
|
95
|
-
padding="
|
|
97
|
+
padding="0 1rem 1rem 1rem"
|
|
96
98
|
>
|
|
97
99
|
<Stack direction="row" justify="space-between">
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
>
|
|
103
|
-
<Badge label="Autopay Available" Icon={AutopayIcon} />
|
|
104
|
-
</Box>
|
|
105
|
-
<Stack direction="row" childGap="6px">
|
|
100
|
+
{showLeft && leftContent}
|
|
101
|
+
{showRight && rightContent}
|
|
102
|
+
|
|
103
|
+
{/* <Stack direction="row" childGap="6px">
|
|
106
104
|
<Text
|
|
107
105
|
variant="pS"
|
|
108
106
|
color={themeValues.color}
|
|
@@ -117,7 +115,7 @@ const LinkCard = ({
|
|
|
117
115
|
{workflowActionName === "Pay" && (
|
|
118
116
|
<ArrowRightIcon color={themeValues.color} />
|
|
119
117
|
)}
|
|
120
|
-
</Stack>
|
|
118
|
+
</Stack> */}
|
|
121
119
|
</Stack>
|
|
122
120
|
</Box>
|
|
123
121
|
</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,14 @@ 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;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export const LinkCard: React.FC<Expand<LinkCardProps> &
|