import React from 'react'; import type { Polymorphic } from '../core/polymorphism'; import { type PressableBaseProps } from '../system/Pressable'; export type CardRootBaseProps = Polymorphic.ExtendableProps< PressableBaseProps, { /** Content to render inside the card. */ children?: React.ReactNode; /** * If true, the CardRoot will be rendered as a Pressable component. * When false, renders as an HStack for layout purposes. * @default true if `as` is 'button' or 'a', otherwise false */ renderAsPressable?: boolean; } >; export type CardRootProps = Polymorphic.Props< AsComponent, CardRootBaseProps >; type CardRootComponent = (( props: Polymorphic.Props, ) => Polymorphic.ReactReturn) & Polymorphic.ReactNamed; /** * CardRoot is the foundational wrapper component for card layouts. * * By default, it renders as a `
` element using HStack for horizontal layout. * When `renderAsPressable` is true, it renders as a Pressable component (defaults to `