@thecb/components 8.4.4 → 8.4.5-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 +59 -56
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +59 -56
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/link-card/LinkCard.js +15 -10
- package/src/components/molecules/link-card/LinkCard.stories.js +4 -5
- package/src/components/molecules/link-card/LinkCard.styled.js +15 -8
- package/src/components/molecules/link-card/LinkCard.theme.js +12 -3
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
|
-
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
3
2
|
import { Box, Stack } from "../../atoms/layouts";
|
|
4
|
-
import { themeComponent } from "../../../util/themeUtils";
|
|
5
|
-
import { fallbackValues } from "./LinkCard.theme";
|
|
3
|
+
// import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
+
// import { fallbackValues } from "./LinkCard.theme";
|
|
6
5
|
import { ThemeContext } from "styled-components";
|
|
7
6
|
import * as Styled from "./LinkCard.styled";
|
|
8
7
|
|
|
9
8
|
const LinkCard = ({
|
|
10
9
|
title = "Test Workflow",
|
|
11
10
|
subtitle = "Link your benefit plan",
|
|
12
|
-
|
|
11
|
+
parentThemeValues,
|
|
13
12
|
showLeft,
|
|
14
13
|
leftContent,
|
|
15
14
|
showRight,
|
|
@@ -20,13 +19,13 @@ const LinkCard = ({
|
|
|
20
19
|
extraActiveStyles = "",
|
|
21
20
|
titleVariant = "h3"
|
|
22
21
|
}) => {
|
|
22
|
+
console.log("LinkCard themeValues", themeValues);
|
|
23
23
|
const { isMobile } = useContext(ThemeContext);
|
|
24
24
|
const regex = /\W/g;
|
|
25
25
|
const locatorSlug = title.toLowerCase().replaceAll(regex, "-");
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<Styled.Container
|
|
29
|
-
border={`1px solid ${themeValues.background};`}
|
|
30
29
|
borderRadius="8px"
|
|
31
30
|
dataQa={`link-card-${locatorSlug}`}
|
|
32
31
|
width="100%"
|
|
@@ -34,6 +33,7 @@ const LinkCard = ({
|
|
|
34
33
|
minWidth={isMobile ? "240px" : "288px"}
|
|
35
34
|
minHeight="141px"
|
|
36
35
|
padding="24px"
|
|
36
|
+
themeValues={parentThemeValues}
|
|
37
37
|
extraStyles={extraStyles}
|
|
38
38
|
hoverStyles={extraHoverStyles}
|
|
39
39
|
activeStyles={extraActiveStyles}
|
|
@@ -49,15 +49,14 @@ const LinkCard = ({
|
|
|
49
49
|
<Box padding={0} width="100%">
|
|
50
50
|
<Styled.Title
|
|
51
51
|
variant={titleVariant}
|
|
52
|
-
|
|
53
|
-
color={themeValues.color}
|
|
52
|
+
themeValues={parentThemeValues}
|
|
54
53
|
margin={0}
|
|
55
54
|
>
|
|
56
55
|
{title}
|
|
57
56
|
</Styled.Title>
|
|
58
57
|
</Box>
|
|
59
58
|
<Box padding={"0 0 40px"} width="100%">
|
|
60
|
-
<Styled.Subtitle variant="pS"
|
|
59
|
+
<Styled.Subtitle variant="pS" themeValues={parentThemeValues}>
|
|
61
60
|
{subtitle}
|
|
62
61
|
</Styled.Subtitle>
|
|
63
62
|
</Box>
|
|
@@ -67,7 +66,12 @@ const LinkCard = ({
|
|
|
67
66
|
padding="0"
|
|
68
67
|
width="100%"
|
|
69
68
|
>
|
|
70
|
-
<Styled.Footer
|
|
69
|
+
<Styled.Footer
|
|
70
|
+
themeValues={parentThemeValues}
|
|
71
|
+
direction="row"
|
|
72
|
+
childGap="6px"
|
|
73
|
+
justify="space-between"
|
|
74
|
+
>
|
|
71
75
|
{/* To keep rightContent aligned right, use an empty Box as leftContent if none is provided */}
|
|
72
76
|
{showLeft && !leftContent && <Box />}
|
|
73
77
|
{showLeft && leftContent}
|
|
@@ -79,4 +83,5 @@ const LinkCard = ({
|
|
|
79
83
|
);
|
|
80
84
|
};
|
|
81
85
|
|
|
82
|
-
export default themeComponent(LinkCard, "LinkCard", fallbackValues, "default");
|
|
86
|
+
// export default themeComponent(LinkCard, "LinkCard", fallbackValues, "default");
|
|
87
|
+
export default LinkCard;
|
|
@@ -8,7 +8,6 @@ import { text } from "@storybook/addon-knobs";
|
|
|
8
8
|
import Badge from "../../atoms/badge/Badge";
|
|
9
9
|
import PlusCircleIcon from "../../atoms/icons/PlusCircleIcon";
|
|
10
10
|
import AutopayIcon from "../../atoms/icons/AutopayIcon";
|
|
11
|
-
import { ROYAL_BLUE_VIVID, CORNFLOWER_BLUE } from "../../../constants/colors";
|
|
12
11
|
|
|
13
12
|
const groupId = "props";
|
|
14
13
|
|
|
@@ -28,20 +27,20 @@ export const linkCard = () => (
|
|
|
28
27
|
<Stack direction="row" childGap="6px">
|
|
29
28
|
<Text
|
|
30
29
|
variant="pS"
|
|
31
|
-
color={
|
|
30
|
+
color={themeValues.color}
|
|
32
31
|
extraStyles="text-align: right; color: transparent;"
|
|
33
32
|
className="show-on-hover"
|
|
34
33
|
>
|
|
35
34
|
Find
|
|
36
35
|
</Text>
|
|
37
|
-
<PlusCircleIcon color={
|
|
36
|
+
<PlusCircleIcon color={themeValues.color} />
|
|
38
37
|
</Stack>
|
|
39
38
|
}
|
|
40
39
|
extraHoverStyles={`
|
|
41
|
-
.show-on-hover {color: ${
|
|
40
|
+
.show-on-hover {color: ${themeValues.color};}
|
|
42
41
|
`}
|
|
43
42
|
extraActiveStyles={`
|
|
44
|
-
background-color: ${
|
|
43
|
+
background-color: ${themeValues.activeBackgroundColor};
|
|
45
44
|
`}
|
|
46
45
|
/>
|
|
47
46
|
);
|
|
@@ -3,11 +3,7 @@ import Heading from "../../atoms/heading";
|
|
|
3
3
|
import Paragraph from "../../atoms/paragraph";
|
|
4
4
|
import Stack from "../../atoms/layouts/Stack";
|
|
5
5
|
import { Box } from "../../atoms/layouts";
|
|
6
|
-
import {
|
|
7
|
-
ROYAL_BLUE_VIVID,
|
|
8
|
-
LINK_WATER,
|
|
9
|
-
MOON_RAKER
|
|
10
|
-
} from "../../../constants/colors";
|
|
6
|
+
import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
|
|
11
7
|
|
|
12
8
|
export const Container = styled(Box)`
|
|
13
9
|
display: flex;
|
|
@@ -18,6 +14,11 @@ export const Container = styled(Box)`
|
|
|
18
14
|
flex-shrink: 0;
|
|
19
15
|
align-self: stretch;
|
|
20
16
|
border-radius: 8px;
|
|
17
|
+
${({ themeValues }) => `
|
|
18
|
+
background-color: ${themeValues.cardBackgroundColor};
|
|
19
|
+
border: 1px solid ${themeValues.cardBorderColor};
|
|
20
|
+
`}
|
|
21
|
+
transition: all .2s ease-in-out;
|
|
21
22
|
|
|
22
23
|
&:hover,
|
|
23
24
|
&:active {
|
|
@@ -31,12 +32,14 @@ export const Container = styled(Box)`
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
&:hover:not(:active) {
|
|
34
|
-
border: 1px solid ${
|
|
35
|
-
background-color: ${LINK_WATER};
|
|
35
|
+
${({ themeValues }) => `border: 1px solid ${themeValues.cardBorderColor};`}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&:active {
|
|
39
|
-
|
|
39
|
+
${({ themeValues }) => `
|
|
40
|
+
background-color: ${themeValues.cardActiveBackgroundColor};
|
|
41
|
+
border: 1px solid ${themeValues.cardColor};
|
|
42
|
+
;`}
|
|
40
43
|
}
|
|
41
44
|
`;
|
|
42
45
|
|
|
@@ -50,6 +53,8 @@ export const Title = styled(Heading)`
|
|
|
50
53
|
font-size: 16px;
|
|
51
54
|
line-height: 150%;
|
|
52
55
|
background-color: transparent;
|
|
56
|
+
font-weight: ${FONT_WEIGHT_SEMIBOLD};
|
|
57
|
+
${({ themeValues }) => `color: ${themeValues.cardColor};`};
|
|
53
58
|
`;
|
|
54
59
|
|
|
55
60
|
export const Subtitle = styled(Paragraph)`
|
|
@@ -62,6 +67,8 @@ export const Subtitle = styled(Paragraph)`
|
|
|
62
67
|
font-size: 14px;
|
|
63
68
|
line-height: 150 %;
|
|
64
69
|
letter-spacing: 0.14px;
|
|
70
|
+
font-weight: ${FONT_WEIGHT_SEMIBOLD};
|
|
71
|
+
${({ themeValues }) => `color: ${themeValues.cardColor};`};
|
|
65
72
|
`;
|
|
66
73
|
|
|
67
74
|
export const Footer = styled(Stack)`
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
CORNFLOWER_BLUE,
|
|
3
|
+
LINK_WATER,
|
|
4
|
+
MOON_RAKER,
|
|
5
|
+
ROYAL_BLUE_VIVID
|
|
6
|
+
} from "../../../constants/colors";
|
|
2
7
|
|
|
3
|
-
const
|
|
8
|
+
const activeBackgroundColor = { default: CORNFLOWER_BLUE };
|
|
9
|
+
const backgroundColor = { default: LINK_WATER };
|
|
10
|
+
const borderColor = { default: MOON_RAKER };
|
|
4
11
|
const color = { default: ROYAL_BLUE_VIVID };
|
|
5
12
|
|
|
6
13
|
export const fallbackValues = {
|
|
7
|
-
|
|
14
|
+
activeBackgroundColor,
|
|
15
|
+
backgroundColor,
|
|
16
|
+
borderColor,
|
|
8
17
|
color
|
|
9
18
|
};
|