@thecb/components 6.3.1-beta.4 → 6.3.1-beta.7
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 +12 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -9
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/card/Card.js +15 -12
- package/src/components/atoms/card/CardText.js +18 -14
package/package.json
CHANGED
|
@@ -30,7 +30,11 @@ const Card = ({
|
|
|
30
30
|
borderRadius = "4px",
|
|
31
31
|
padding = "24px"
|
|
32
32
|
}) => {
|
|
33
|
-
const numberOfChildren =
|
|
33
|
+
const numberOfChildren =
|
|
34
|
+
(typeof children === "Array" ? children.length : 1) +
|
|
35
|
+
(text ? 1 : 0) +
|
|
36
|
+
(imgSrc ? 1 : 0) +
|
|
37
|
+
(headerText ? 1 : 0);
|
|
34
38
|
|
|
35
39
|
return (
|
|
36
40
|
<BoxWithShadow
|
|
@@ -42,7 +46,7 @@ const Card = ({
|
|
|
42
46
|
minWidth={width}
|
|
43
47
|
extraStyles={extraStyles}
|
|
44
48
|
>
|
|
45
|
-
<Cover singleChild>
|
|
49
|
+
<Cover singleChild fillCenter>
|
|
46
50
|
<Stack fullHeight childGap="0" bottomItem={numberOfChildren}>
|
|
47
51
|
{headerText && (
|
|
48
52
|
<CardHeader
|
|
@@ -62,16 +66,15 @@ const Card = ({
|
|
|
62
66
|
src={imgSrc}
|
|
63
67
|
/>
|
|
64
68
|
)}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</Box>
|
|
69
|
+
{text && (
|
|
70
|
+
<CardText
|
|
71
|
+
padding={padding}
|
|
72
|
+
titleText={titleText}
|
|
73
|
+
text={text}
|
|
74
|
+
titleVariant={titleVariant}
|
|
75
|
+
/>
|
|
76
|
+
)}
|
|
77
|
+
{children}
|
|
75
78
|
</Stack>
|
|
76
79
|
</Cover>
|
|
77
80
|
</BoxWithShadow>
|
|
@@ -5,32 +5,36 @@ import withWindowSize from "../../withWindowSize";
|
|
|
5
5
|
|
|
6
6
|
import { fallbackValues } from "./CardText.theme";
|
|
7
7
|
|
|
8
|
+
import Box from "../layouts/Box";
|
|
8
9
|
import Cover from "../layouts/Cover";
|
|
9
10
|
import Paragraph from "../paragraph";
|
|
10
11
|
import Stack from "../layouts/Stack";
|
|
11
12
|
import Title from "../title";
|
|
12
13
|
|
|
13
14
|
export const CardText = ({
|
|
15
|
+
padding,
|
|
14
16
|
text,
|
|
15
17
|
titleText,
|
|
16
18
|
titleVariant = "small",
|
|
17
19
|
themeValues
|
|
18
20
|
}) => {
|
|
19
21
|
return (
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
<Box padding={padding}>
|
|
23
|
+
<Cover>
|
|
24
|
+
<Stack>
|
|
25
|
+
{titleText && (
|
|
26
|
+
<Title
|
|
27
|
+
variant={titleVariant}
|
|
28
|
+
color={themeValues.titleColor}
|
|
29
|
+
weight={themeValues?.titleWeight}
|
|
30
|
+
>
|
|
31
|
+
{titleText}
|
|
32
|
+
</Title>
|
|
33
|
+
)}
|
|
34
|
+
<Paragraph color={themeValues.textColor}>{text}</Paragraph>
|
|
35
|
+
</Stack>
|
|
36
|
+
</Cover>
|
|
37
|
+
</Box>
|
|
34
38
|
);
|
|
35
39
|
};
|
|
36
40
|
|