import { jsx as _jsx } from "react/jsx-runtime";
import { UiFloatingPanel } from "../UiFloatingPanel/UiFloatingPanel.js";
import { useComboboxState } from "./UiComboboxContext.js";
/** @internal */
export function UiComboboxPopup({ children, style }) {
    const { isOpen, setIsOpen, anchorRef, shouldRenderPopup } = useComboboxState();
    if (!shouldRenderPopup) {
        return null;
    }
    return (_jsx(UiFloatingPanel, { anchor: anchorRef, isOpen: isOpen, onClose: () => setIsOpen(false), placement: "bottom-start", width: "same-as-anchor", padding: "listbox", closeOnOutsideClick: true, accessibilityConfig: { role: undefined }, style: style, children: _jsx("div", { onMouseDown: (event) => event.preventDefault(), children: children }) }));
}
