UNPKG

react-email-builder

Version:
15 lines (14 loc) 659 B
import clsx from 'clsx'; import React from 'react'; import { createPortal } from 'react-dom'; import { css } from './hooks'; export function Popover({ className, children, style, open, popoverRef, noStyle, arrow }) { const { root, bg, body } = css(); return open ? createPortal(React.createElement("div", { ref: popoverRef, className: clsx(root, className, { [bg]: !noStyle }), style: style }, arrow ? (React.createElement("div", { className: css().arrow }, arrow === true ? null : arrow)) : null, React.createElement("div", { className: body }, children)), document.body) : null; }