UNPKG

braid-design-system

Version:
16 lines (15 loc) 657 B
import { jsx } from "react/jsx-runtime"; import { createPortal } from "react-dom"; import { useBraidTheme } from "../BraidProvider/BraidThemeContext.mjs"; import { VanillaThemeContainer } from "../BraidProvider/VanillaThemeContainer.mjs"; import { TextContext } from "../Text/TextContext.mjs"; const BraidPortal = ({ children, container }) => { const { vanillaTheme } = useBraidTheme(); return createPortal( /* @__PURE__ */ jsx(TextContext.Provider, { value: null, children: /* @__PURE__ */ jsx(VanillaThemeContainer, { theme: vanillaTheme, setDefaultTextTones: true, children }) }), container ?? document.body ); }; export { BraidPortal };