/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
const require_styles_styler = require('../styles/styler.cjs');
const require_components_IconSlot = require('./IconSlot.cjs');
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");

//#region src/components/Link.tsx
/**
* A Link provides navigation or actionable functionality by linking users to
* another location within an application, an external resource, or triggering
* specific in-page interactions (i.e. scroll-to-section).
*
* @componentType Client component
*
* @description
* A link component provides navigation or actionable functionality by linking users to another location within an application, an external resource, or triggering specific in-page interactions (i.e. scroll-to-section). This is different than a “button” link which is a button component without a border or fill.
*
* @see
* Check out the {@link https://uds.build/docs/components/link Link Docs} for more info
*
* @usage
* - Provide a way for users to navigate to another location.
* - Provide a trigger for in-page interactions.
*
* @example
* ```tsx
* 'use client';
* import { Link } from '@yahoo/uds';
* import { Share, Link as LinkIcon } from '@yahoo/uds-icons';
*
* <Link href="#">My Link</Link>
* <Link href="#" startIcon={Share} />
* <Link href="https://yahoo.com" target="_blank" endIcon={LinkIcon} />
*```
**/
const Link = (0, react.forwardRef)(function Input({ variant = "primary", textVariant, startIcon, endIcon, alwaysUnderline = false, children, className, ...anchorProps }, ref) {
	const shouldSizeRelativeToContainingText = !textVariant;
	const rootClasses = (0, react.useMemo)(() => {
		return require_styles_styler.getStyles({
			linkVariantRoot: variant,
			display: "inline-flex",
			alignItems: "center",
			className: require_styles_styler.cx(!shouldSizeRelativeToContainingText && require_styles_styler.getStyles({
				linkTextStyleRoot: textVariant,
				fontSize: textVariant,
				fontFamily: textVariant,
				fontWeight: textVariant,
				lineHeight: textVariant,
				textTransform: textVariant
			}), "uds-ring", alwaysUnderline && "underline", className)
		});
	}, [
		alwaysUnderline,
		shouldSizeRelativeToContainingText,
		textVariant,
		variant,
		className
	]);
	const iconStartStyles = require_styles_styler.getStyles({
		linkVariantIconStart: variant,
		linkTextStyleIcon: textVariant,
		className: require_styles_styler.cx(shouldSizeRelativeToContainingText && "w-[0.7em] h-[0.7em]")
	});
	const iconEndStyles = require_styles_styler.getStyles({
		linkVariantIconEnd: variant,
		linkTextStyleIcon: textVariant,
		className: require_styles_styler.cx(shouldSizeRelativeToContainingText && "w-[0.7em] h-[0.7em]")
	});
	const iconProps = {
		variant: "outline",
		color: "current"
	};
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("a", {
		ref,
		className: rootClasses,
		...anchorProps,
		children: [
			startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
				className: iconStartStyles,
				icon: startIcon,
				iconProps,
				"data-testid": "start-icon"
			}),
			children,
			endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
				className: iconEndStyles,
				icon: endIcon,
				iconProps,
				"data-testid": "end-icon"
			})
		]
	});
});
Link.displayName = "Link";

//#endregion
exports.Link = Link;