UNPKG

@lanaco/lnc-react-ui

Version:

React component library

2 lines (1 loc) 473 B
"use strict";const c=require("react/jsx-runtime"),r=require("react"),i=require("./floating-ui.react.esm-CsrI9PVk.cjs"),a=require("./PopoverContext.cjs"),p=()=>{const e=r.useContext(a);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},d=r.forwardRef(function({children:n,...s},u){const{setLabelId:o}=p(),t=i.useId();return r.useLayoutEffect(()=>(o(t),()=>o(void 0)),[t,o]),c.jsx("h2",{...s,ref:u,id:t,children:n})});module.exports=d;