import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
import { forwardRef } from 'react';
import textStyles from '../text/text.module.css.js';
import styles from './link.module.css.js';

const link = cva([styles.link], {
    variants: {
        variant: {
            primary: textStyles["text-primary"],
            secondary: textStyles["text-secondary"],
            tertiary: textStyles["text-tertiary"],
            emphasis: textStyles["text-emphasis"],
            accent: textStyles["text-accent"],
            attention: textStyles["text-attention"],
            danger: textStyles["text-danger"],
            success: textStyles["text-success"],
        },
        size: {
            1: textStyles["text-1"],
            2: textStyles["text-2"],
            3: textStyles["text-3"],
            4: textStyles["text-4"],
            5: textStyles["text-5"],
            6: textStyles["text-6"],
            7: textStyles["text-7"],
            8: textStyles["text-8"],
            9: textStyles["text-9"],
            10: textStyles["text-10"],
        },
        weight: {
            bold: textStyles["text-weight-bold"],
            bolder: textStyles["text-weight-bolder"],
            normal: textStyles["text-weight-normal"],
            lighter: textStyles["text-weight-lighter"],
            100: textStyles["text-weight-100"],
            200: textStyles["text-weight-200"],
            300: textStyles["text-weight-300"],
            400: textStyles["text-weight-400"],
            500: textStyles["text-weight-500"],
            600: textStyles["text-weight-600"],
            700: textStyles["text-weight-700"],
            800: textStyles["text-weight-800"],
            900: textStyles["text-weight-900"],
        },
        underline: {
            true: styles["link-underline"],
        },
    },
    defaultVariants: {
        variant: "accent",
        size: 2,
        weight: 400,
        underline: false,
    },
});
const Link = forwardRef(({ className, children, href, size, weight, variant, underline, external, download, rel, hrefLang, "aria-label": ariaLabel, ...props }, ref) => {
    const externalProps = external ? {
        target: "_blank",
        rel: "noopener noreferrer",
        "aria-label": ariaLabel || `${children} (opens in new tab)`
    } : {};
    const downloadProps = download ? {
        download: typeof download === "string" ? download : true,
        "aria-label": ariaLabel || `${children} (download)`
    } : {};
    return (jsxRuntimeExports.jsx("a", { ref: ref, className: link({ size, weight, variant, underline, className }), href: href, hrefLang: hrefLang, rel: rel, role: "link", ...externalProps, ...downloadProps, ...props, children: children }));
});
Link.displayName = "Link";

export { Link };
//# sourceMappingURL=link.js.map
