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 55 flex-direction : column ;
66 background : $color__n-85 ;
77 border-radius : $border-radius__m ;
8+ width : 100% ;
89
910 & --transparent {
1011 background : transparent ;
1920 align-self : flex-end ;
2021 }
2122 }
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+ }
2240
2341 & __main {
2442 display : flex ;
2543 flex-direction : row ;
2644 align-items : flex-start ;
27- justify-content : space-evenly ;
45+ justify-content : space-between ;
2846 padding : $spacing__m ;
2947 }
3048
3856 align-items : center ;
3957 object-fit : cover ;
4058 aspect-ratio : 1 / 1 ;
59+ order : 1 ;
4160
4261 img {
4362 height : 100% ;
84103 font-size : 1.125rem ;
85104 display : flex ;
86105 flex-direction : column ;
87- margin : 0 $spacing__m
106+ margin : 0 $spacing__m ;
107+ order : 2 ;
108+ }
109+
110+ & __cta {
111+ order : 3 ;
88112 }
89113
90114 & __footer {
Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ SampleComponent.parameters = {
2929} ;
3030
3131SampleComponent . args = {
32- children : < div style = { { width : "300px" } } > Team lead</ div > ,
32+ children : < div > Team lead</ div > ,
3333 title : "MangoBurger" ,
34- imageSize : CardImageSize . LARGE ,
34+ imageSize : CardImageSize . MEDIUM ,
3535 image : < img src = "/images/default-avatar.png" /> ,
36- imageBorderRadius : CardImageBorderRadius . MEDIUM ,
36+ imageBorderRadius : CardImageBorderRadius . CIRCLE ,
3737 cta : { text : "Follow" , onClick : ( ) => console . log ( "follow" ) } ,
3838 variants : [
3939 CardVariant . TRANSPARENT ,
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export const Card: React.FC<CardProps> = ({
4040 { /* CTA */ }
4141 { cta && (
4242 < Button
43+ className = "card__cta"
4344 onClick = { cta . onClick }
4445 label = { cta . text }
4546 variant = { ButtonVariant . SECONDARY }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export interface CardProps extends React.PropsWithChildren {
3535 /** An array of links to be rendered in the footer of the card. */
3636 footerLinks ?: ReactElement < HTMLAnchorElement > [ ] ;
3737 /** The size of the image displayed in the top left corner. Defaults to medium */
38- imageSize : CardImageSize ;
38+ imageSize ? : CardImageSize ;
3939 /** The image to be displayed in the top left corner */
4040 image : ReactElement < HTMLImageElement > ;
4141 /** Border radius of the image. Defaults to circle */
You can’t perform that action at this time.
0 commit comments