feat(MED-97): allow different card heading sizes
This commit is contained in:
@@ -41,15 +41,19 @@ const CardHeader: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({
|
||||
);
|
||||
CardHeader.displayName = 'CardHeader';
|
||||
|
||||
const CardTitle: React.FC<React.HTMLAttributes<HTMLHeadingElement>> = ({
|
||||
const CardTitle: React.FC<React.HTMLAttributes<HTMLHeadingElement> & { size?: 'h3' | 'h4' | 'h5' }> = ({
|
||||
className,
|
||||
size = 'h3',
|
||||
...props
|
||||
}) => (
|
||||
<h3
|
||||
className={cn('leading-none font-semibold tracking-tight', className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}) => {
|
||||
const Component = size;
|
||||
return (
|
||||
<Component
|
||||
className={cn('leading-none font-semibold tracking-tight', className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
CardTitle.displayName = 'CardTitle';
|
||||
|
||||
const CardDescription: React.FC<React.HTMLAttributes<HTMLParagraphElement>> = ({
|
||||
|
||||
Reference in New Issue
Block a user