"use client";
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
import { cx, getStyles } from "../../../styles/styler.js";
import { mergeSlotProps } from "../../../utils/mergeSlotProps.js";
import { ChipBase, VARIANT_DEFAULT } from "./ChipBase.js";
import React, { forwardRef, useMemo } from "react";
import { jsx } from "react/jsx-runtime";

//#region src/components/client/Chip/ChipLink.tsx
const ChipLink = forwardRef(function ChipLink({ variant = VARIANT_DEFAULT, href, disabled, slotProps, className, ...rest }, ref) {
	const classNames = useMemo(() => ({
		root: getStyles({
			chipLinkVariantRoot: variant,
			className: cx("uds-ring", className)
		}),
		icon: getStyles({ chipLinkVariantIcon: variant })
	}), [className, variant]);
	const mergedSlotProps = mergeSlotProps(slotProps, {
		startIcon: { className: classNames.icon },
		endIcon: { className: classNames.icon }
	});
	return /* @__PURE__ */ jsx(ChipBase, {
		as: "a",
		ref,
		disabled,
		className: classNames.root,
		slotProps: mergedSlotProps,
		tabIndex: disabled ? -1 : 0,
		...rest,
		href: disabled ? void 0 : href
	});
});
ChipLink.displayName = "ChipLink";

//#endregion
export { ChipLink };