// src/theme/portal-provider.tsx
import { createContext, useContext, useRef } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
var PortalContext = createContext(
  null
);
function PortalProvider({
  children
}) {
  const dialogContainerRef = useRef(null);
  const drawerContainerRef = useRef(null);
  const popoverContainerRef = useRef(null);
  return /* @__PURE__ */ jsxs(PortalContext.Provider, { value: { dialogContainerRef, drawerContainerRef }, children: [
    children,
    /* @__PURE__ */ jsx("div", { className: "drawer-portal-container", ref: drawerContainerRef }),
    /* @__PURE__ */ jsx("div", { className: "dialog-portal-container", ref: dialogContainerRef }),
    /* @__PURE__ */ jsx("div", { className: "popover-portal-container", ref: popoverContainerRef })
  ] });
}
var usePortalContainer = () => {
  try {
    const state = useContext(PortalContext);
    return state;
  } catch (error) {
    throw new Error("PortalProvider not found");
  }
};
var portal_provider_default = PortalProvider;

export {
  PortalProvider,
  usePortalContainer,
  portal_provider_default
};
//# sourceMappingURL=chunk-BMODJOM5.js.map