import React from "react"; import * as react_jsx_runtime0 from "react/jsx-runtime"; //#region src/react/portal-container-context.d.ts /** * Context for providing a custom portal container. * This is used when rendering components in isolated contexts like iframes or shadow DOM. * Portal components (AlertDialog, ContextMenu, etc.) will use this container instead of document.body */ declare const PortalContainerContext: React.Context; declare function usePortalContainer(): HTMLElement | null; /** * Resolves the final portal container from explicit prop or context. * * This hook enables Portal components to work seamlessly in isolated rendering contexts * (like iframes, shadow DOM, or isolated component previews) by accepting a container * from either: * 1. An explicit `container` prop (highest priority) * 2. A `PortalContainerProvider` context (fallback) * 3. undefined (lets Radix UI use document.body as default) * * @param containerProp - Optional explicit container element from props * @returns The resolved container element to use for portal rendering * * @example * ```tsx * function MyPortal({ container, ...props }) { * return ( * * * * ); * } * ``` */ declare function useResolvedPortalContainer(containerProp?: Element | DocumentFragment | HTMLElement | null | undefined): Element | DocumentFragment | HTMLElement | null | undefined; interface PortalContainerProviderProps { container: HTMLElement | null; children: React.ReactNode; } declare function PortalContainerProvider({ container, children }: PortalContainerProviderProps): react_jsx_runtime0.JSX.Element; //#endregion export { PortalContainerContext, PortalContainerProvider, usePortalContainer, useResolvedPortalContainer }; //# sourceMappingURL=portal-container-context.d.ts.map