UNPKG

@payfit/unity-components

Version:

31 lines (30 loc) • 1.5 kB
import { ReactNode } from 'react'; import { TextProps } from '../../../../../core/components/text/Text.js'; /** Props for {@link AIOutcomeCardDescription}. */ export type AIOutcomeCardDescriptionProps = Omit<TextProps, 'children' | 'variant' | 'color' | 'className' | 'isTruncated' | 'style'> & { children: ReactNode | ((renderProps: { isHovered: boolean; isFocused: boolean; }) => ReactNode); }; /** * Adds supporting context to an Outcome Card without competing with its title. * * Renders `children` in the prescribed small body typography and connects the * text to the parent card through `aria-describedby`. A function child also * receives the card's hover and focus-visible state. * * Compose `AIOutcomeCardDescription` inside `RawAIOutcomeCard`. Pass static * `children` for persistent context, or a render function that reads * `isHovered` and `isFocused` to change the visible description. * @param props - Text attributes and static or state-aware `children`. * @param props.children - Description content, or a function receiving * `isHovered` and `isFocused`. */ declare const AIOutcomeCardDescription: import('react').ForwardRefExoticComponent<Omit<TextProps, "color" | "children" | "className" | "style" | "variant" | "isTruncated"> & { children: ReactNode | ((renderProps: { isHovered: boolean; isFocused: boolean; }) => ReactNode); } & import('react').RefAttributes<HTMLElement>>; export { AIOutcomeCardDescription };