// Anchor primitive. External links get `rel` hardening and a translated // "opens in a new tab" hint automatically — never a bare `target="_blank"`. // `appearance="button"` is Button's look on the same anchor: a control that navigates is a link. import type { JSX } from 'solid-js'; import { cx } from '../cx'; import buttonStyles from './Button.module.scss'; import styles from './Link.module.scss'; import { linkClasses } from './link-classes'; import { linkRel, linkTarget } from './link-target'; import type { ButtonVariant, Size, Tone } from './variants'; interface LinkBaseProps { href: string; children: JSX.Element; external?: boolean | undefined; /** Announced suffix for external links; supply via `t()` at the call site. */ externalHint?: string | undefined; /** A pager's direction. Joins the hardening an external link always carries, never replaces it. */ rel?: 'next' | 'prev' | undefined; id?: string | undefined; class?: string | undefined; 'aria-current'?: 'page' | 'step' | 'true' | false | undefined; onClick?: JSX.EventHandlerUnion | undefined; } /** Inline text — the default. */ export interface TextLinkProps extends LinkBaseProps { /** `button` wears Button's classes on the same ``; the two looks take different props. */ appearance?: 'link' | undefined; underline?: 'always' | 'hover' | 'none' | undefined; /** A text link: `accent` or `inherit`. A button-link: any `Tone`. */ tone?: 'accent' | 'inherit' | undefined; variant?: undefined; size?: undefined; fullWidth?: undefined; iconStart?: undefined; iconEnd?: undefined; } /** Button's look on an anchor. There is no `href` on `