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

const Link = forwardRef(({ children, className, variant = "accent", size = "small", external, download, ...props }, ref) => {
    const externalProps = external
        ? {
            target: "_blank",
            rel: "noopener noreferrer",
            "aria-label": `${children} (opens in new tab)`,
        }
        : {};
    const downloadProps = download
        ? {
            download: typeof download === "string" ? download : true,
            "aria-label": `${children} (download)`,
        }
        : {};
    return (jsxRuntimeExports.jsx(Text, { ref: ref, className: cx(styles.link, className), variant: variant, size: size, role: "link", ...externalProps, ...downloadProps, ...props, as: "a", children: children }));
});
Link.displayName = "Link";

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