/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
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_utils_mergeSlotProps = require("../../../utils/mergeSlotProps.cjs");
const require_components_client_Chip_ChipBase = require("./ChipBase.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/client/Chip/ChipToggle.tsx
const ChipToggle = (0, react.forwardRef)(function ChipToggle({ isToggled = false, onToggle, onClick, variant = require_components_client_Chip_ChipBase.VARIANT_DEFAULT, slotProps, className, role = "checkbox", ...rest }, ref) {
	const classNames = (0, react.useMemo)(() => ({
		root: require_styles_styler.getStyles({
			chipToggleVariantRoot: variant,
			chipToggleVariantActiveRoot: isToggled ? "on" : "off",
			className: require_styles_styler.cx("uds-ring", className)
		}),
		icon: require_styles_styler.getStyles({ chipToggleVariantIcon: variant })
	}), [
		className,
		isToggled,
		variant
	]);
	const handleClick = (0, react.useCallback)((e) => {
		onToggle?.(!isToggled);
		onClick?.(e);
	}, [
		isToggled,
		onClick,
		onToggle
	]);
	const mergedSlotProps = require_utils_mergeSlotProps.mergeSlotProps(slotProps, {
		startIcon: { className: classNames.icon },
		endIcon: { className: classNames.icon }
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Chip_ChipBase.ChipBase, {
		ref,
		as: "button",
		role,
		"aria-checked": role === "checkbox" || role === "switch" ? isToggled : void 0,
		onClick: handleClick,
		className: classNames.root,
		slotProps: mergedSlotProps,
		tabIndex: 0,
		...rest
	});
});
ChipToggle.displayName = "ChipToggle";
//#endregion
exports.ChipToggle = ChipToggle;
