"use client";
import { cnb } from "cnbuilder";
import { Children, cloneElement, isValidElement } from "react";
import { maxWidthTransition } from "./maxWidthTransition.js";
/**
 * @since 6.0.0
 */ export function useMaxWidthTransition(options) {
    const { element, disabled, disableTransition, transitionIn, className } = options;
    if (disabled || !isValidElement(element)) {
        return element;
    }
    const child = Children.only(element);
    return cloneElement(element, {
        className: maxWidthTransition({
            className: cnb(child.props.className, className),
            disabled: disableTransition,
            transitionIn
        })
    });
}

//# sourceMappingURL=useMaxWidthTransition.js.map