UNPKG

@payfit/unity-components

Version:

39 lines (38 loc) 1.47 kB
import { PropsWithChildren } from 'react'; import { ButtonProps as AriaButtonProps } from 'react-aria-components/Button'; import { LinkProps as AriaLinkProps } from 'react-aria-components/Link'; import { PaddingObject, SpacingToken } from '../../utils/spacing.js'; type NavigationCardAsLinkProps = Omit<AriaLinkProps, 'style' | 'className'>; type NavigationCardAsButtonProps = Omit<AriaButtonProps, 'style' | 'className'>; /** * Props for the NavigationCard component. */ export type NavigationCardProps = PropsWithChildren<(NavigationCardAsLinkProps | NavigationCardAsButtonProps) & { /** Render as either a link or button element */ asElement?: 'a' | 'button'; /** Content to display before the main body (e.g., icon, avatar) */ prefix?: React.ReactNode; /** Content to display after the main body (e.g., badge, chevron) */ suffix?: React.ReactNode; /** * Padding for all directions, or an object specifying individual sides. * @default '$300' */ padding?: SpacingToken | PaddingObject; /** * Padding for block direction (top & bottom). * Overrides `padding` for vertical spacing. */ paddingBlock?: SpacingToken; /** * Padding for inline direction (left & right). * Overrides `padding` for horizontal spacing. */ paddingInline?: SpacingToken; /** * Gap between prefix, body, and suffix elements. * @default '$150' */ gap?: SpacingToken; }>; export {};