braid-design-system
Version:
Themeable design system for the SEEK Group
16 lines (15 loc) • 657 B
JavaScript
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
};