Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.6.3]

### Fixed

- Fixed `variant` prop in `Card` component.

## [1.6.2]

### Added
Expand Down
10 changes: 8 additions & 2 deletions src/molecules/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ import { MetaCard } from './Meta';
import { CardStyles } from './styles';
import { RdCardCompoundedComponent, RdCardProps } from './types';

export const CardInternal = ({ className, variant = 'default', ...antdProps }: RdCardProps) => {
export const CardInternal: React.FC<RdCardProps> = ({
className,
variant = 'default',
...antdProps
}) => {
const variantClass: Record<NonNullable<RdCardProps['variant']>, string> = {
compact: 'rd-card-variant-compact',
default: '',
default: 'rd-card-variant-default',
borderless: 'rd-card-variant-borderless',
outlined: 'rd-card-variant-outlined',
};

return <CardStyles className={clsx(className, variantClass[variant])} {...antdProps} />;
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/Card/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ type CardPropsExtend = {
*
* This property allows you to customize the appearance of the card to match specific design requirements.
*/
variant?: 'default' | 'compact';
variant?: 'default' | 'compact' | CardPropsAntd['variant'];
};

type GridCardPropsExtend = {};
type MetaCardPropsExtend = {};
//#endregion

//#region Export types
export type RdCardProps = CardPropsAntd & CardPropsExtend;
export type RdCardProps = Omit<CardPropsAntd, 'variant'> & CardPropsExtend;
export type RdGridCardProps = GridCardPropsAntd & GridCardPropsExtend;
export type RdMetaCardProps = MetaCardPropsAntd & MetaCardPropsExtend;

Expand Down