@anoki/fse-marche-ui
Version:
FSE UI components library
3 lines (2 loc) • 1.51 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/InfoPopup/InfoPopup.css');const t=require("./index.cjs137.js"),i=require("react"),n=require("./index.cjs139.js");;/* empty css */const m=require("./index.cjs79.js"),p=({title:d="Info",description:o,isOpen:s=!1,onClickCloseBtn:e,className:l=""})=>{const u=i.useRef(null),a=i.useRef(null);return i.useEffect(()=>{var c;const r=x=>{x.key==="Escape"&&s&&(e==null||e())};return s?(a.current=document.activeElement,(c=u.current)==null||c.focus(),document.addEventListener("keydown",r)):a.current&&a.current.focus(),()=>{document.removeEventListener("keydown",r)}},[s,e]),s?t.jsxRuntimeExports.jsx("div",{className:n.clsx("popupContainer",s?"open":"close",l),onClick:r=>{r.stopPropagation()},children:t.jsxRuntimeExports.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title","aria-describedby":"dialog-description",className:n.clsx("dialog"),tabIndex:-1,children:[t.jsxRuntimeExports.jsxs("div",{className:"header",children:[t.jsxRuntimeExports.jsx("h3",{id:"dialog-title",className:"title",children:d}),t.jsxRuntimeExports.jsx("button",{onClick:r=>{r.stopPropagation(),e==null||e()},className:"closeButton","aria-label":"Close dialog",children:t.jsxRuntimeExports.jsx(m.Close,{className:"closeIcon"})})]}),o&&t.jsxRuntimeExports.jsx("div",{id:"dialog-description",className:"content",children:o})]})}):null};exports.InfoPopup=p;
//# sourceMappingURL=index.cjs66.js.map