@thecb/components 8.4.4 → 8.4.5-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "8.4.4",
3
+ "version": "8.4.5-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -20,13 +20,13 @@ const LinkCard = ({
20
20
  extraActiveStyles = "",
21
21
  titleVariant = "h3"
22
22
  }) => {
23
+ console.log("LinkCard themeValues", themeValues);
23
24
  const { isMobile } = useContext(ThemeContext);
24
25
  const regex = /\W/g;
25
26
  const locatorSlug = title.toLowerCase().replaceAll(regex, "-");
26
27
 
27
28
  return (
28
29
  <Styled.Container
29
- border={`1px solid ${themeValues.background};`}
30
30
  borderRadius="8px"
31
31
  dataQa={`link-card-${locatorSlug}`}
32
32
  width="100%"
@@ -34,6 +34,7 @@ const LinkCard = ({
34
34
  minWidth={isMobile ? "240px" : "288px"}
35
35
  minHeight="141px"
36
36
  padding="24px"
37
+ themeValues={themeValues}
37
38
  extraStyles={extraStyles}
38
39
  hoverStyles={extraHoverStyles}
39
40
  activeStyles={extraActiveStyles}
@@ -49,15 +50,14 @@ const LinkCard = ({
49
50
  <Box padding={0} width="100%">
50
51
  <Styled.Title
51
52
  variant={titleVariant}
52
- weight={FONT_WEIGHT_SEMIBOLD}
53
- color={themeValues.color}
53
+ themeValues={themeValues}
54
54
  margin={0}
55
55
  >
56
56
  {title}
57
57
  </Styled.Title>
58
58
  </Box>
59
59
  <Box padding={"0 0 40px"} width="100%">
60
- <Styled.Subtitle variant="pS" color={themeValues.color}>
60
+ <Styled.Subtitle variant="pS" themeValues={themeValues}>
61
61
  {subtitle}
62
62
  </Styled.Subtitle>
63
63
  </Box>
@@ -67,7 +67,12 @@ const LinkCard = ({
67
67
  padding="0"
68
68
  width="100%"
69
69
  >
70
- <Styled.Footer direction="row" childGap="6px" justify="space-between">
70
+ <Styled.Footer
71
+ themeValues={themeValues}
72
+ direction="row"
73
+ childGap="6px"
74
+ justify="space-between"
75
+ >
71
76
  {/* To keep rightContent aligned right, use an empty Box as leftContent if none is provided */}
72
77
  {showLeft && !leftContent && <Box />}
73
78
  {showLeft && leftContent}
@@ -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={ROYAL_BLUE_VIVID}
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={ROYAL_BLUE_VIVID} />
36
+ <PlusCircleIcon color={themeValues.color} />
38
37
  </Stack>
39
38
  }
40
39
  extraHoverStyles={`
41
- .show-on-hover {color: ${ROYAL_BLUE_VIVID};}
40
+ .show-on-hover {color: ${themeValues.color};}
42
41
  `}
43
42
  extraActiveStyles={`
44
- background-color: ${CORNFLOWER_BLUE};
43
+ background-color: ${themeValues.activeBackgroundColor};
45
44
  `}
46
45
  />
47
46
  );
@@ -3,12 +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";
11
-
6
+ import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
12
7
  export const Container = styled(Box)`
13
8
  display: flex;
14
9
  flex-direction: column;
@@ -18,6 +13,11 @@ export const Container = styled(Box)`
18
13
  flex-shrink: 0;
19
14
  align-self: stretch;
20
15
  border-radius: 8px;
16
+ ${({ themeValues }) => `
17
+ background-color: ${themeValues.backgroundColor};
18
+ border: 1px solid ${themeValues.borderColor};
19
+ `}
20
+ transition: all .2s ease-in-out;
21
21
 
22
22
  &:hover,
23
23
  &:active {
@@ -31,12 +31,14 @@ export const Container = styled(Box)`
31
31
  }
32
32
 
33
33
  &:hover:not(:active) {
34
- border: 1px solid ${MOON_RAKER};
35
- background-color: ${LINK_WATER};
34
+ ${({ themeValues }) => `border: 1px solid ${themeValues.borderColor};`}
36
35
  }
37
36
 
38
37
  &:active {
39
- border: 1px solid ${ROYAL_BLUE_VIVID};
38
+ ${({ themeValues }) => `
39
+ background-color: ${themeValues.activeBackgroundColor};
40
+ border: 1px solid ${themeValues.color};
41
+ ;`}
40
42
  }
41
43
  `;
42
44
 
@@ -50,6 +52,8 @@ export const Title = styled(Heading)`
50
52
  font-size: 16px;
51
53
  line-height: 150%;
52
54
  background-color: transparent;
55
+ font-weight: ${FONT_WEIGHT_SEMIBOLD};
56
+ ${({ themeValues }) => `color: ${themeValues.color};`};
53
57
  `;
54
58
 
55
59
  export const Subtitle = styled(Paragraph)`
@@ -62,6 +66,8 @@ export const Subtitle = styled(Paragraph)`
62
66
  font-size: 14px;
63
67
  line-height: 150 %;
64
68
  letter-spacing: 0.14px;
69
+ font-weight: ${FONT_WEIGHT_SEMIBOLD};
70
+ ${({ themeValues }) => `color: ${themeValues.color};`};
65
71
  `;
66
72
 
67
73
  export const Footer = styled(Stack)`
@@ -1,9 +1,18 @@
1
- import { ROYAL_BLUE_VIVID, MOON_RAKER } from "../../../constants/colors";
1
+ import {
2
+ CORNFLOWER_BLUE,
3
+ LINK_WATER,
4
+ MOON_RAKER,
5
+ ROYAL_BLUE_VIVID
6
+ } from "../../../constants/colors";
2
7
 
3
- const background = { default: MOON_RAKER };
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
- background,
14
+ activeBackgroundColor,
15
+ backgroundColor,
16
+ borderColor,
8
17
  color
9
18
  };