import { ReactNode } from 'react'; import { AriaLinkOptions } from 'react-aria'; import { IconProps } from '../icon/index.js'; export type BaseLinkProps = { /** * Link text or component */ children?: ReactNode; /** * Classname for overriding base style */ className?: string; /** * Places an icon within the button, after the button’s text */ iconAfter?: (props: IconProps) => JSX.Element; /** * Places an icon within the button, before the button’s text */ iconBefore?: (props: IconProps) => JSX.Element; /** * set size of icon * @default small */ iconSize?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; /** * Link type * @default standalone */ type?: 'inline' | 'standalone'; /** * Visually style the (inline) link with an underline * @default true */ underline?: boolean; /** * Specifies DOM element rendered by a custom component * Required when the custom component does not render an '' element * @default 'a' */ elementType?: AriaLinkOptions['elementType']; } & Omit; export type LinkRef = React.ComponentRef; export type PolymorphicRef = React.ComponentPropsWithRef['ref']; export type LinkProps = BaseLinkProps & { /** * Type to render * @default a */ tag?: C; } & Omit, keyof BaseLinkProps | 'tag'>; export type LinkImplementationProps = BaseLinkProps & { className?: string; href?: unknown; tag?: React.ElementType; } & Record; export type LinkComponent = (props: LinkProps & { ref?: PolymorphicRef; }) => React.ReactElement | null;