/*! © 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_components_Icon = require("../../components/Icon.cjs");
const require_components_Box = require("../../components/Box.cjs");
const require_components_client_Checkbox_CheckboxBase = require("../../components/client/Checkbox/CheckboxBase.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/css-animation/Checkbox/Checkbox.tsx
/**
* CSS-animation Checkbox variant. This component intentionally never imports motion.
*
* @componentType Client component
*
* @example
* ```tsx
* 'use client';
* import { Checkbox } from '@yahoo/uds/css-animation';
*
* <Checkbox label="Name" required />
* ```
*/
const Checkbox = (0, react.forwardRef)(function Checkbox(props, parentRef) {
	const cssAnimationDuration = "duration-120";
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Checkbox_CheckboxBase.CheckboxBase, {
		...props,
		ref: parentRef,
		cssAnimationDuration,
		renderRoot: ({ className, style, rootSlotProps, hasLabel, children }) => {
			return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(hasLabel ? "label" : "div", {
				className: require_styles_styler.cx("group", className),
				"data-testid": "container",
				style,
				tabIndex: -1,
				...rootSlotProps,
				children
			});
		},
		renderIndicator: ({ size, variant, valueState, checked, disabled, cssAnimationDuration, checkIcon, checkboxSlotProps, iconSlotProps, children }) => {
			const classNames = {
				checkbox: require_styles_styler.getStyles({
					checkboxSizeCheckbox: size,
					checkboxVariantCheckbox: variant,
					checkboxVariantValueCheckbox: valueState,
					className: require_styles_styler.cx("uds-ring", "uds-ring-within", !disabled && "group-hover:scale-110", !disabled && "group-active:scale-90", cssAnimationDuration, "transition-[background-color,border-color,box-shadow,transform]")
				}),
				check: require_styles_styler.getStyles({
					checkboxVariantCheckboxIcon: variant,
					checkboxVariantValueCheckboxIcon: valueState,
					className: require_styles_styler.cx("pointer-events-none", checked ? "opacity-100" : "opacity-0", Boolean(checked) && !disabled && "group-active:opacity-55", cssAnimationDuration, "transition-opacity")
				})
			};
			return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
				position: "relative",
				className: classNames.checkbox,
				alignItems: "center",
				justifyContent: "center",
				flex: "none",
				...checkboxSlotProps,
				children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
					name: checkIcon,
					size: "sm",
					className: classNames.check,
					...iconSlotProps
				})]
			});
		}
	});
});
Checkbox.displayName = "Checkbox";
//#endregion
exports.Checkbox = Checkbox;
