UNPKG

@payfit/unity-components

Version:

27 lines (26 loc) • 1.1 kB
import { PropsWithChildren } from 'react'; import { ButtonProps } from 'react-aria-components/Button'; import { RawLinkProps } from '../../../../../core/components/link/RawLink.js'; export interface FormContextualLinkProps extends RawLinkProps { /** * The href of the contextual link */ href: string; onPress?: never; } export interface FormContextualLinkActionProps extends ButtonProps { /** * A function to open a contextual panel */ onPress: () => void; href?: never; } export type RawFormContextualLinkProps = PropsWithChildren<FormContextualLinkProps | FormContextualLinkActionProps>; /** * `RawFormContextualLink` renders a contextual action associated with the * current form field. It can render either: * - an anchor (`RawLink`) when `href` is provided; or * - a button (from `react-aria-components`) when `onPress` is provided. */ declare const RawFormContextualLink: import('react').ForwardRefExoticComponent<RawFormContextualLinkProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>; export { RawFormContextualLink };