/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { cn } from "../../utils/cn.js";
import { buildSpacingClasses } from "../../tokens/spacing.js";
import { buttonStyles } from "../Button/Button2.js";
/* empty css     */
import React from "react";
import { jsx } from "react/jsx-runtime";
//#region src/core/Link/Link.tsx
var Link = React.forwardRef(({ component: Component = "a", componentProps, href, children, className = "", block = false, variant, linkOverlay = false, padding, paddingX, paddingY, paddingTop, paddingBottom, margin, marginX, marginY, marginTop, marginBottom, gap, testId, ...rest }, ref) => {
	const spacingClasses = buildSpacingClasses({
		padding,
		paddingX,
		paddingY,
		paddingTop,
		paddingBottom,
		margin,
		marginX,
		marginY,
		marginTop,
		marginBottom,
		gap
	});
	const defaultLinkClasses = !variant && !className ? "text-(--primary) hover:opacity-80 underline decoration-current/30 hover:decoration-current underline-offset-2 transition-colors" : "";
	const textColor = variant === "button-outline" || variant === "button-text" ? "text-(--text)" : "";
	const blockClass = block ? "block" : "";
	let variantClasses = "";
	if (variant?.startsWith("button-")) {
		const key = variant.replace("button-", "");
		if (buttonStyles[key]) variantClasses = "px-4 py-2 inline-flex items-center gap-2 whitespace-nowrap " + buttonStyles[key];
	}
	return /* @__PURE__ */ jsx(Component, {
		href,
		className: cn(spacingClasses, defaultLinkClasses, variantClasses, textColor, blockClass, linkOverlay && "link-overlay", className),
		ref,
		...testId ? {
			...componentProps,
			"data-testid": testId
		} : componentProps,
		...rest,
		children
	});
});
Link.displayName = "Link";
//#endregion
export { Link };

//# sourceMappingURL=Link2.js.map