2026-01-10 13:19:59 -06:00
|
|
|
import type { ComponentProps } from "react";
|
|
|
|
|
import { classNames } from "../../core/ui/classNames";
|
2026-01-31 23:21:43 -06:00
|
|
|
import type { Color } from "../../core/ui/color";
|
|
|
|
|
import styles from "./index.module.css";
|
2026-01-10 13:19:59 -06:00
|
|
|
|
|
|
|
|
export interface LinkProps extends ComponentProps<"a"> {
|
|
|
|
|
underline?: "always" | "hover" | "never";
|
2026-01-18 15:14:26 -06:00
|
|
|
highContrast?: boolean;
|
2026-01-31 23:21:43 -06:00
|
|
|
color?: Color | "accent";
|
2026-01-10 13:19:59 -06:00
|
|
|
}
|
|
|
|
|
|
2026-01-18 15:14:26 -06:00
|
|
|
export function Link({
|
|
|
|
|
highContrast,
|
|
|
|
|
className,
|
|
|
|
|
underline = "always",
|
2026-01-31 23:21:43 -06:00
|
|
|
color = "accent",
|
|
|
|
|
style,
|
2026-01-18 15:14:26 -06:00
|
|
|
...props
|
|
|
|
|
}: LinkProps) {
|
2026-01-10 13:19:59 -06:00
|
|
|
return (
|
|
|
|
|
<a
|
2026-01-31 23:21:43 -06:00
|
|
|
className={classNames(styles.link, className)}
|
|
|
|
|
style={{
|
|
|
|
|
color: `var(--${color}-${highContrast ? 12 : 11})`,
|
|
|
|
|
...style,
|
|
|
|
|
}}
|
2026-01-10 13:19:59 -06:00
|
|
|
{...props}
|
|
|
|
|
data-underline={underline}
|
2026-01-18 15:14:26 -06:00
|
|
|
data-high-contrast={highContrast}
|
2026-01-10 13:19:59 -06:00
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|