import type { ControlSize, IntentName, } from "@charcuterie/tokens" import type { ComponentPropsWithRef, ReactNode, } from "react" import { getControlClassName } from "../controlStyles.ts" import type { IntentAppearance } from "../intentStyles.ts" import { ARIA_DISABLED_CLASS } from "../intentStyles.ts" import { useRouterLink } from "../RouterLink/RouterLinkProvider.tsx" import { getIsRoutedHref } from "../RouterLink/routerLink.ts" import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden.tsx" export type ButtonLinkProps = Omit< ComponentPropsWithRef<"a">, "href" > & { appearance?: IntentAppearance /** * Required, and required even when disabled — a navigation that * cannot say where it goes is a button wearing a link's clothes. */ href: string iconEnd?: ReactNode iconStart?: ReactNode intent?: IntentName isDisabled?: boolean isExternal?: boolean isFullWidth?: boolean /** What `isExternal` announces. Not shown. */ newTabLabel?: string size?: ControlSize } /** * A navigation that looks like a button. * * This is Plex Channels' "Configure ›": it reads as the primary * action on the card, and it goes to another page — so it must be an * `` (middle-click, ctrl-click, "open in new tab", "copy link * address", and the status bar all come from the element, not from * the paint) while looking exactly like `Button`. Today that control * is a `