diff --git a/packages/components/src/components/Card/Card.tsx b/packages/components/src/components/Card/Card.tsx index 78ea8b5c92f..34d82e574e8 100644 --- a/packages/components/src/components/Card/Card.tsx +++ b/packages/components/src/components/Card/Card.tsx @@ -106,19 +106,24 @@ const CardContainer = styled.div< ${withFrameProps} `; -export type CardProps = AllowedFrameProps & - AccessibilityProps & { - paddingType?: PaddingType; - onMouseEnter?: HTMLAttributes['onMouseEnter']; - onMouseLeave?: HTMLAttributes['onMouseLeave']; - onClick?: HTMLAttributes['onClick']; - children?: ReactNode; - className?: string; - label?: ReactNode; - forceElevation?: Elevation; - }; +type CommonCardProps = AccessibilityProps & { + paddingType?: PaddingType; + onMouseEnter?: HTMLAttributes['onMouseEnter']; + onMouseLeave?: HTMLAttributes['onMouseLeave']; + onClick?: HTMLAttributes['onClick']; + children?: ReactNode; + className?: string; + label?: ReactNode; + forceElevation?: Elevation; +}; -const CardComponent = forwardRef( +export type CardPropsWithTransientProps = CommonCardProps & TransientProps; +export type CardProps = CommonCardProps & AllowedFrameProps; + +const CardComponent = forwardRef< + HTMLDivElement, + CardPropsWithTransientProps & { $paddingType: PaddingType } +>( ( { children, @@ -129,6 +134,7 @@ const CardComponent = forwardRef { @@ -145,6 +151,7 @@ const CardComponent = forwardRef {children}