import type { HTMLAttributes, ReactNode } from 'react' import { cx } from '../../utils/cx' import { renderAsChild } from '../../utils/asChild' import { usePressFeedback } from '../../hooks/usePressFeedback' /** * `elevated` floats above the page and is the only variant that casts a * shadow. `grouped` is the iOS Settings card — the same surface, separated * from the page by VALUE alone. `nested` is the darker fill a card takes when * it sits inside another card. `plain` is structure without a surface. * * There is no `outlined` variant: nothing in this system is separated by a * stroke, and a card is exactly where that temptation is strongest. */ export type CardVariant = 'elevated' | 'grouped' | 'nested' | 'plain' /** Padding rung. `none` lets a `List` or an image sit flush to the corners. */ export type CardPadding = 'none' | 'xs' | 'sm' | 'md' | 'lg' export interface CardProps extends Omit, 'onClick'> { children?: ReactNode /** @default 'elevated' */ variant?: CardVariant /** @default 'md' */ padding?: CardPadding /** * Makes the whole card activatable: press feedback, a hover lift, and a real * ` ) } export interface CardHeaderProps extends HTMLAttributes { /** Trailing element — a `Badge`, an overflow button, a chevron. */ accessory?: ReactNode } /** Title block. Sits inside the card's own padding, so it adds none of its own. */ export function CardHeader({ children, accessory, className, ...rest }: CardHeaderProps) { return (
{children}
{accessory &&
{accessory}
}
) } export interface CardTitleProps extends HTMLAttributes { /** * Heading level. A card is rarely the top of the document outline, so the * default is h3 — but the level must follow the page, not the component. * @default 'h3' */ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' } export function CardTitle({ as: Tag = 'h3', className, ...rest }: CardTitleProps) { return } export type CardDescriptionProps = HTMLAttributes export function CardDescription({ className, ...rest }: CardDescriptionProps) { return (

) } export type CardBodyProps = HTMLAttributes export function CardBody({ className, ...rest }: CardBodyProps) { return

} export type CardFooterProps = HTMLAttributes /** Actions. Pushed to the bottom of a stretched card, trailing-aligned. */ export function CardFooter({ className, ...rest }: CardFooterProps) { return
}