/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
const require_styles_styler = require("../../../styles/styler.cjs");
const require_utils_createSlot = require("../../../utils/createSlot.cjs");
const require_generateDefaultClassName = require("../../../automated-config/dist/utils/generateDefaultClassName.cjs");
let react = require("react");
//#region src/components/client/IconButton/IconButtonBase.tsx
const defaultSizeRootClass = require_generateDefaultClassName.generateDefaultClassName("iconbutton", "size", "root");
const defaultSizeIconClass = require_generateDefaultClassName.generateDefaultClassName("iconbutton", "size", "icon");
const defaultVariantRootClass = require_generateDefaultClassName.generateDefaultClassName("button", "variant", "root");
const defaultVariantIconClass = require_generateDefaultClassName.generateDefaultClassName("button", "variant", "icon");
const IconButtonBase = (0, react.forwardRef)(function IconButtonBase({ variant, size, iconVariant, loading, disableEffects, name, asChild = false, slotProps, type = "button", htmlName, className, children, renderIconContent, renderRoot, ...rest }, forwardedRef) {
	const { className: iconSlotClassName, ...iconSlotProps } = slotProps?.icon ?? {};
	const Slot = (0, react.useMemo)(() => require_utils_createSlot.createSlot(), []);
	const rootSizeClass = (0, react.useMemo)(() => size ? require_styles_styler.getStyles({ iconbuttonSizeRoot: size }) : defaultSizeRootClass, [size]);
	const rootVariantClass = (0, react.useMemo)(() => variant ? require_styles_styler.getStyles({ buttonVariantRoot: variant }) : defaultVariantRootClass, [variant]);
	const iconSizeClass = (0, react.useMemo)(() => size ? require_styles_styler.getStyles({ iconbuttonSizeIcon: size }) : defaultSizeIconClass, [size]);
	const iconVariantClass = (0, react.useMemo)(() => variant ? require_styles_styler.getStyles({ buttonVariantIcon: variant }) : defaultVariantIconClass, [variant]);
	const styles = (0, react.useMemo)(() => ({
		root: require_styles_styler.cx("uds-ring", "uds-hit-target", "inline-flex overflow-hidden justify-center items-center", "[transform-origin:center]", "[backface-visibility:hidden]", "[transition-property:color,background-color,border-color,box-shadow,text-decoration-color,fill,stroke]", "[transition-timing-function:cubic-bezier(0,0,0.2,1)]", "[transition-duration:220ms]", rootSizeClass, rootVariantClass, rest?.disabled && "cursor-not-allowed", loading && "uds-button-loading", disableEffects && "uds-button-without-effects", className),
		icon: require_styles_styler.getStyles({ className: require_styles_styler.cx(iconSizeClass, iconVariantClass) }),
		loadingIcon: require_styles_styler.getStyles({ className: require_styles_styler.cx([
			"animate-spin",
			iconSizeClass,
			iconVariantClass
		]) })
	}), [
		className,
		disableEffects,
		iconSizeClass,
		iconVariantClass,
		loading,
		rest?.disabled,
		rootSizeClass,
		rootVariantClass
	]);
	return renderRoot({
		asChild,
		Slot,
		children,
		buttonRef: forwardedRef,
		type,
		htmlName,
		rootClassName: styles.root,
		rest,
		iconContent: renderIconContent({
			asChild,
			loading,
			name,
			iconVariant,
			children,
			iconClassName: styles.icon,
			loadingIconClassName: styles.loadingIcon,
			iconSlotClassName,
			iconSlotProps
		})
	});
});
IconButtonBase.displayName = "IconButtonBase";
function renderIconButtonAsChild(children, content) {
	const childProps = children.props;
	return (0, react.cloneElement)(children, childProps, content);
}
//#endregion
exports.IconButtonBase = IconButtonBase;
exports.renderIconButtonAsChild = renderIconButtonAsChild;
