@infinityfx/fluid
Version:
React UI library, using zero-runtime CSS-in-JS.
4 lines (3 loc) • 795 B
JavaScript
"use client";
import{jsx as o}from"react/jsx-runtime";import{getAbsoluteZIndex as r,combineRefs as e}from"../../../core/utils.js";import{LayoutGroup as t}from"@infinityfx/lively/layout";import{useMemo as i}from"react";import{createPortal as n}from"react-dom";import{usePopover as m}from"./root.js";import d from"../modal.js";function l({children:l,ref:f,...c}){const{id:s,mounted:p,isModal:u,trigger:a,content:y,opened:g,toggle:h}=m(),x=i((()=>p&&a.current?r(a.current)+2:1),[p]);return p?u?o(d,{ref:e(y,f),...c,id:s,show:g,onClose:()=>h(!1),children:l}):n(o(t,{children:o("div",{ref:e(y,f),...c,id:s,style:{...c.style,position:"fixed",zIndex:x},children:g&&l})}),document.getElementById("__fluid")):null}l.displayName="Popover.Content";export{l as default};
//# sourceMappingURL=content.js.map