Skip to content

Commit 3276679

Browse files
committed
styling: added mui cardheader variants
1 parent 49dc83f commit 3276679

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

packages/curve-ui-kit/src/themes/components.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type ThemeOptions } from '@mui/material/styles'
2+
import type { TypographyOptions } from '@mui/material/styles/createTypography'
23
import { defineMuiButton, defineMuiIconButton, defineMuiToggleButton } from './button'
34
import { defineMuiTypography } from './typography'
45
import { defineMuiTab, defineMuiTabs } from './tabs'
@@ -9,7 +10,6 @@ import { basicMuiTheme } from './basic-theme'
910
import { alpha } from '@mui/system'
1011
import { defineMuiMenuItem } from '@ui-kit/themes/mui-menu-item'
1112
import { defineMuiAlert, defineMuiAlertTitle } from '@ui-kit/themes/mui-alert'
12-
import type { TypographyOptions } from '@mui/material/styles/createTypography'
1313
import { TransitionFunction } from '@ui-kit/themes/design/0_primitives'
1414

1515
export const DEFAULT_BAR_SIZE = SizesAndSpaces.ButtonSize.sm
@@ -30,9 +30,30 @@ export const createComponents = (design: DesignSystem, typography: TypographyOpt
3030
paddingBlock: SizesAndSpaces.Spacing.sm.desktop + ' 0',
3131
paddingInline: SizesAndSpaces.Spacing.md.desktop + ' 0',
3232
borderBottom: `1px solid ${design.Layer[3].Outline}`,
33+
height: '4rem',
3334
minHeight: `calc(${SizesAndSpaces.ButtonSize.lg} + 1px)`, // 1px for the border
35+
variants: [
36+
{
37+
props: { size: 'small' },
38+
style: {
39+
minHeight: SizesAndSpaces.Sizing.md,
40+
padding: `0 ${SizesAndSpaces.Spacing.md} ${SizesAndSpaces.Spacing.sm}`,
41+
},
42+
},
43+
],
3444
},
3545
action: { alignContent: 'center', margin: 0 },
46+
title: {
47+
...typography.headingSBold,
48+
variants: [
49+
{
50+
props: { size: 'small' },
51+
style: {
52+
...typography.headingXsBold,
53+
},
54+
},
55+
],
56+
},
3657
},
3758
},
3859
MuiCardActions: {

packages/curve-ui-kit/src/themes/mui-overrides.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ declare module '@mui/material/styles' {
1414
highlight: string
1515
}
1616
}
17+
18+
declare module '@mui/material/CardHeader' {
19+
interface CardHeaderPropsVariantOverrides {
20+
size?: 'small'
21+
}
22+
}

0 commit comments

Comments
 (0)