/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-d4047d7
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { useRef } from 'react';
import { CSSTransition } from 'react-transition-group';
import { Portal } from '../portal/index.js';
export function OverlayWrapper({ isOpen, placement, minOffset, minScale, children, container = null, }) {
    const containerRef = useRef(container);
    const nodeRef = useRef(null);
    const contents = (_jsx(CSSTransition, { unmountOnExit: true, nodeRef: nodeRef, in: isOpen, timeout: 120, classNames: "cube-overlay-transition", children: _jsx("div", { ref: nodeRef, children: children }) }));
    return _jsx(Portal, { root: containerRef, children: contents });
}

        