import * as React from "react"; import type { CardOwnProps, PolymorphicWithRef } from "../types"; import { CardBase } from "../base-components"; import { CardHeader } from "../CardHeader"; import { CardTitle } from "../CardTitle"; import { CardSupportingText } from "../CardSupportingText"; import { CardActions } from "../CardActions"; import { CardImage } from "../CardImage"; import { CardContent } from "../CardContent"; // TODO: Add width property to Card type CardProps = PolymorphicWithRef< T, CardOwnProps >; type CardElement = ( props: CardProps ) => React.ReactElement>; const CardContainer: CardElement = React.forwardRef( ( props: CardProps, innerRef: typeof props.ref ) => { const { component, ...rest } = props; return ; } ); /** * Card component. * - A card is identifiable as a single unit. * - A card can hold anything from images to headlines, supporting text, buttons, lists and other components. * - A card's layout and dimensions depends on its content. There is no one right way to make a card. */ const Card = Object.assign(CardContainer, { Header: CardHeader, Title: CardTitle, SupportingText: CardSupportingText, Actions: CardActions, Image: CardImage, Content: CardContent, }); export default Card;