UNPKG

@trail-ui/react

Version:
37 lines (34 loc) 1.59 kB
import * as react from 'react'; import { HTMLAttributes, ReactNode } from 'react'; import { SlotsToClasses, CardSlots, CardVariantProps, CardReturnType } from '@trail-ui/theme'; import { PressEvents, FocusableProps } from '@react-types/shared'; import { ContextValue } from 'react-aria-components'; interface Props extends HTMLAttributes<HTMLButtonElement> { elementType?: string; /** * Usually the Card parts, `CardHeader`, `CardBody` and `CardFooter`. */ children?: ReactNode | ReactNode[]; /** * Whether the card should allow text selection on press. (only for pressable cards) * @default true */ allowTextSelectionOnPress?: boolean; /** * Classes object to style the card and its children. */ classNames?: SlotsToClasses<CardSlots>; } type CardProps = Props & PressEvents & FocusableProps & CardVariantProps; interface CardContextValue extends CardProps { slots: CardReturnType; classNames?: SlotsToClasses<CardSlots>; isDisabled?: CardVariantProps['isDisabled']; isFooterBlurred?: CardVariantProps['isFooterBlurred']; disableAnimation?: CardVariantProps['disableAnimation']; fullWidth?: CardVariantProps['fullWidth']; isPressable?: CardVariantProps['isPressable']; } declare const CardContext: react.Context<ContextValue<CardContextValue, HTMLDivElement>>; declare const _Card: react.ForwardRefExoticComponent<Props & PressEvents & FocusableProps<Element> & CardVariantProps & react.RefAttributes<HTMLDivElement>>; export { _Card as Card, CardContext, CardContextValue, CardProps, Props };