File tree Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Expand file tree Collapse file tree 4 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 5
5
flex-direction : column ;
6
6
background : $color__n-85 ;
7
7
border-radius : $border-radius__m ;
8
+ width : 100% ;
8
9
9
10
& --transparent {
10
11
background : transparent ;
19
20
align-self : flex-end ;
20
21
}
21
22
}
23
+
24
+ & --compact {
25
+ .card__main {
26
+ flex-wrap : wrap ;
27
+ }
28
+
29
+ .card__body {
30
+ width : 100% ;
31
+ order : 3 ;
32
+ margin-top : $spacing__s ;
33
+ margin-left : 0 ;
34
+ }
35
+
36
+ .card__cta {
37
+ order : 2 ;
38
+ }
39
+ }
22
40
23
41
& __main {
24
42
display : flex ;
25
43
flex-direction : row ;
26
44
align-items : flex-start ;
27
- justify-content : space-evenly ;
45
+ justify-content : space-between ;
28
46
padding : $spacing__m ;
29
47
}
30
48
38
56
align-items : center ;
39
57
object-fit : cover ;
40
58
aspect-ratio : 1 / 1 ;
59
+ order : 1 ;
41
60
42
61
img {
43
62
height : 100% ;
84
103
font-size : 1.125rem ;
85
104
display : flex ;
86
105
flex-direction : column ;
87
- margin : 0 $spacing__m
106
+ margin : 0 $spacing__m ;
107
+ order : 2 ;
108
+ }
109
+
110
+ & __cta {
111
+ order : 3 ;
88
112
}
89
113
90
114
& __footer {
Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ SampleComponent.parameters = {
29
29
} ;
30
30
31
31
SampleComponent . args = {
32
- children : < div style = { { width : "300px" } } > Team lead</ div > ,
32
+ children : < div > Team lead</ div > ,
33
33
title : "MangoBurger" ,
34
- imageSize : CardImageSize . LARGE ,
34
+ imageSize : CardImageSize . MEDIUM ,
35
35
image : < img src = "/images/default-avatar.png" /> ,
36
- imageBorderRadius : CardImageBorderRadius . MEDIUM ,
36
+ imageBorderRadius : CardImageBorderRadius . CIRCLE ,
37
37
cta : { text : "Follow" , onClick : ( ) => console . log ( "follow" ) } ,
38
38
variants : [
39
39
CardVariant . TRANSPARENT ,
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export const Card: React.FC<CardProps> = ({
40
40
{ /* CTA */ }
41
41
{ cta && (
42
42
< Button
43
+ className = "card__cta"
43
44
onClick = { cta . onClick }
44
45
label = { cta . text }
45
46
variant = { ButtonVariant . SECONDARY }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export interface CardProps extends React.PropsWithChildren {
35
35
/** An array of links to be rendered in the footer of the card. */
36
36
footerLinks ?: ReactElement < HTMLAnchorElement > [ ] ;
37
37
/** The size of the image displayed in the top left corner. Defaults to medium */
38
- imageSize : CardImageSize ;
38
+ imageSize ? : CardImageSize ;
39
39
/** The image to be displayed in the top left corner */
40
40
image : ReactElement < HTMLImageElement > ;
41
41
/** Border radius of the image. Defaults to circle */
You can’t perform that action at this time.
0 commit comments