Skip to content

Commit 96f9b56

Browse files
author
Lucas Araujo
committed
feat: add card image variant
1 parent 22e74e6 commit 96f9b56

File tree

8 files changed

+28
-0
lines changed

8 files changed

+28
-0
lines changed

src/design-system/cards/base-card.css.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export const card = recipe({
2727
borderStyle: 'solid',
2828
borderWidth: vars.spacing.$2,
2929
},
30+
[Scheme.Img]: {
31+
borderColor: vars.colors.$card_img_borderColor,
32+
backgroundColor: vars.colors.$card_img_bgColor,
33+
borderRadius: vars.radius.$large,
34+
},
3035
},
3136
},
3237
});

src/design-system/cards/cards.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export const Overview = (): JSX.Element => {
4141
Component: Card.Outlined,
4242
variant: Scheme.Outlined,
4343
},
44+
{
45+
Component: Card.Img,
46+
variant: Scheme.Img,
47+
},
4448
];
4549

4650
const renderTable = (showHeader = false): JSX.Element => (
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { createCardVariantComponent } from './create-card-variant-component.util';
2+
import { Scheme } from './types';
3+
4+
import type { VariantCardProps } from './create-card-variant-component.util';
5+
6+
export type ElevatedProps = VariantCardProps;
7+
8+
export const Img = createCardVariantComponent<ElevatedProps>(Scheme.Img);

src/design-system/cards/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export { Elevated } from './elevated.component';
22
export { Greyed } from './greyed.component';
33
export { Outlined } from './outlined.component';
4+
export { Img } from './img.component';

src/design-system/cards/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum Scheme {
22
Elevated = 'Elevated',
33
Greyed = 'Greyed',
44
Outlined = 'Outlined',
5+
Img = 'Img',
56
}

src/design-tokens/colors.data.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export const colors = {
3838
$card_greyed_backgroundColor: '',
3939
$card_outlined_backgroundColor: '',
4040
$card_outlined_borderColor: '',
41+
$card_img_bgColor: '',
42+
$card_img_borderColor: '',
4143

4244
$control_buttons_label_color: '',
4345
$control_buttons_label_color_danger: '',
@@ -202,6 +204,7 @@ export const colors = {
202204
$data_green: '',
203205
$data_yellow: '',
204206
$data_orange: '',
207+
$white: '',
205208

206209
$educational_card_root_container_bgColor: '',
207210
$educational_card_root_container_borderColor: '',

src/design-tokens/theme/dark-theme.css.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ const colors: Colors = {
7373
$card_greyed_backgroundColor: darkColorScheme.$primary_dark_grey_plus,
7474
$card_outlined_backgroundColor: darkColorScheme.$primary_mid_black,
7575
$card_outlined_borderColor: colorTransparent,
76+
$card_img_bgColor: darkColorScheme.$primary_mid_grey,
77+
$card_img_borderColor: darkColorScheme.$primary_light_black,
7678

7779
$control_buttons_label_color: darkColorScheme.$primary_white,
7880
$control_buttons_label_color_hover: darkColorScheme.$primary_light_grey,
@@ -289,6 +291,7 @@ const colors: Colors = {
289291
$data_pink: darkColorScheme.$secondary_data_pink,
290292
$data_yellow: darkColorScheme.$secondary_lace_yellow,
291293
$data_orange: darkColorScheme.$secondary_data_orange,
294+
$white: darkColorScheme.$primary_white,
292295

293296
$educational_card_root_container_bgColor: darkColorScheme.$primary_mid_black,
294297
$educational_card_root_container_borderColor: colorTransparent,

src/design-tokens/theme/light-theme.css.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ const colors: Colors = {
7676
$card_greyed_backgroundColor: lightColorScheme.$primary_light_grey,
7777
$card_outlined_backgroundColor: lightColorScheme.$primary_white,
7878
$card_outlined_borderColor: lightColorScheme.$primary_light_grey_plus,
79+
$card_img_bgColor: lightColorScheme.$primary_light_grey_plus_0_56,
80+
$card_img_borderColor: lightColorScheme.$primary_light_grey_0_56,
7981

8082
$control_buttons_label_color: lightColorScheme.$primary_black,
8183
$control_buttons_label_color_hover: lightColorScheme.$primary_black,
@@ -309,6 +311,7 @@ const colors: Colors = {
309311
$data_pink: lightColorScheme.$secondary_data_pink,
310312
$data_yellow: lightColorScheme.$secondary_lace_yellow,
311313
$data_orange: lightColorScheme.$secondary_data_orange,
314+
$white: lightColorScheme.$primary_white,
312315

313316
$educational_card_root_container_bgColor: lightColorScheme.$primary_white,
314317
$educational_card_root_container_borderColor:

0 commit comments

Comments
 (0)