1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-17 01:17:29 +02:00

chore: stylable card (#9604)

https://linear.app/unleash/issue/2-3442/make-card-component-stylable

Makes the Card component introduced in
https://github.com/Unleash/unleash/pull/9096 stylable.

E.g.

```tsx
const StyledCard = styled(Card)(({ theme }) => ({
    backgroundColor: 'pink',
}));
```
This commit is contained in:
Nuno Góis 2025-03-25 15:39:32 +00:00 committed by GitHub
parent 4677b28aee
commit b885a927e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
import { styled, Card as MUICard, Box } from '@mui/material';
import { styled, Card as MUICard, Box, type CardProps } from '@mui/material';
const StyledCard = styled(MUICard)(({ theme }) => ({
display: 'flex',
@ -77,7 +77,7 @@ const StyledCardFooter = styled(Box)(({ theme }) => ({
textWrap: 'nowrap',
}));
interface ICardProps {
interface ICardProps extends Omit<CardProps, 'title'> {
icon?: React.ReactNode;
title?: React.ReactNode;
headerActions?: React.ReactNode;
@ -91,8 +91,9 @@ export const Card = ({
headerActions,
footer,
children,
...props
}: ICardProps) => (
<StyledCard>
<StyledCard {...props}>
<StyledCardBody>
<StyledCardBodyHeader>
{icon && (