diff --git a/src/components/surfaces/Card/Card.tsx b/src/components/surfaces/Card/Card.tsx index 462ccdce..999c4eee 100644 --- a/src/components/surfaces/Card/Card.tsx +++ b/src/components/surfaces/Card/Card.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import React from 'react' import PropTypes from 'prop-types' -import MuiCard, { CardContent, iconStyle } from './CardStyles' +import MuiCard, { CardContent, iconStyle as baseIconStyle } from './CardStyles' import CardMedia from '@mui/material/CardMedia' import { any, isNil } from 'ramda' import { CardProps, CardColor } from './types' @@ -47,6 +47,7 @@ const Card: React.FC = ({ mediaProps, avatarProps, headerContentProps, + iconStyle = {}, ...props }) => { const hasIcon = !!Icon @@ -54,7 +55,7 @@ const Card: React.FC = ({ const cardHeaderProps = { title, subheader, - avatar: Icon && , + avatar: Icon && , actions, filled, ...headerProps @@ -166,7 +167,12 @@ Card.propTypes = { * @default {} * Props applied to the CardHeader component. */ - headerContentProps: PropTypes.object + headerContentProps: PropTypes.object, + /** + * @default {} + * Style applied to icon avatar. + */ + iconStyle: PropTypes.object } export default Card diff --git a/src/components/surfaces/Card/types.ts b/src/components/surfaces/Card/types.ts index da03082f..57f2bf77 100644 --- a/src/components/surfaces/Card/types.ts +++ b/src/components/surfaces/Card/types.ts @@ -150,4 +150,8 @@ export interface CardProps extends Omit { * Style applied to the header content. */ headerContentProps?: HTMLAttributes + /** + * Icon style. + */ + iconStyle?: React.CSSProperties }