import { AriaAttributes, AriaRole, ReactNode } from 'react'; import { ButtonProps as RACButtonProps, LinkProps as RACLinkProps } from 'react-aria-components'; export type CardPadding = "snug" | "base" | "relaxed"; type CardCommon = { /** Defaults to `base`. */ padding?: CardPadding; /** * Card body. Nested controls remain independently operable in interactive * cards. */ content: ReactNode; className?: string; }; type StaticPassthrough = AriaAttributes & { id?: string; role?: AriaRole; tabIndex?: number; title?: string; } & { [dataAttr: `data-${string}`]: string | number | boolean | undefined; }; type StaticCardProps = CardCommon & StaticPassthrough & { href?: never; onPress?: never; label?: never; }; type LinkCardProps = CardCommon & Omit & { /** Required for link cards and mutually exclusive with `onPress`. */ href: string; /** Accessible name shared by the containing group and primary action. */ label: string; onPress?: never; }; type ButtonCardProps = CardCommon & Omit & { /** Required for button cards and mutually exclusive with `href`. */ onPress: () => void; /** Accessible name shared by the containing group and primary action. */ label: string; href?: never; }; /** * A card is one of three shapes, selected by props: * - neither `href` nor `onPress` → a static `
` surface; * - `href` → a link-interactive card (``); * - `onPress` → a button-interactive card (`