import React from 'react'; import type { AriaLinkOptions } from 'react-aria'; export type LinkVariant = 'inline' | 'standalone'; /** * The plain anchor attributes React Aria has no opinion about — `target`, * `rel`, `download`, `hreflang` and the rest. `AriaLinkOptions` wins every * overlap, the same split `Input` makes against `AriaTextFieldProps`. */ type LinkDOMProps = Omit, keyof AriaLinkOptions | 'color'>; export interface LinkProps extends AriaLinkOptions, LinkDOMProps { /** * Matches the Figma `Type` variant. * * `inline` is for links inside body copy and is underlined in every state — * a link in a paragraph must not rely on colour alone (WCAG 1.4.1). * `standalone` is for links that already read as interactive from their * position, and underlines on hover only. */ variant?: LinkVariant; /** Optional icon before the label. */ startIcon?: React.ReactNode; /** Optional icon after the label — the external-link or arrow affordance. */ endIcon?: React.ReactNode; className?: string; children?: React.ReactNode; /** * @deprecated Use `isDisabled`. Accepted as an alias for one minor version. */ disabled?: boolean; } /** * Link — Figma `Link` (774:1516). * * Renders an `` when given an `href` and a `