UNPKG

@anoki/fse-ui

Version:

FSE UI components library

3 lines (2 loc) 2.01 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/CardMapStructure/CardMap.css');const e=require("./index.cjs278.js"),a=require("react");;/* empty css */const b=require("./index.cjs212.js"),s=require("./index.cjs82.js"),C=require("./index.cjs219.js"),q=require("./index.cjs257.js"),N=({id:d,title:m,titleTag:p="h2",href:t,description:c,isExternal:n=!1,asLink:j="a",className:f,plainAddress:x,showGoToLabel:h=!1,goToLabel:l="Indicazioni",setSelectedCard:R=()=>{},addressLabel:g="Indirizzo",addressLabelTitleTag:w="h3"})=>{const E=j,[r,u]=a.useState(!1),i=a.useRef(null);return a.useEffect(()=>{const o=v=>{i.current&&!i.current.contains(v.target)&&u(!1)};return r?document.addEventListener("mousedown",o):document.removeEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[r]),e.jsxRuntimeExports.jsxs(s.Col,{as:"div",justifyContent:"center",ref:i,br:"x4",p:"x24",bg:"white",className:`${f} ${r?"ui-is-active":"ui-card-search"} shadow cursor-pointer text-slate-28`,onClick:()=>{u(!0),R(d)},children:[e.jsxRuntimeExports.jsxs(s.Col,{pb:"x24",children:[e.jsxRuntimeExports.jsx(p,{className:"flex-1",children:e.jsxRuntimeExports.jsx(E,{className:"text-decoration-none fs-4 text-primary fw-semibold",href:t,target:n?"_blank":void 0,rel:n?"noreferrer noopener":void 0,children:m})}),c&&e.jsxRuntimeExports.jsx(C.Row,{flexWrap:"wrap",gap:"x8",py:"x8",children:e.jsxRuntimeExports.jsx(q.Tag,{label:c,className:"ui-card-map-tag"})})]}),x&&e.jsxRuntimeExports.jsxs(s.Col,{as:"footer",gap:"x8",bg:"white",children:[e.jsxRuntimeExports.jsx(w,{className:"fw-semibold fs-6",children:g}),e.jsxRuntimeExports.jsx("p",{className:"fw-regular",children:x})]}),h&&l&&t&&e.jsxRuntimeExports.jsx(s.Col,{as:"footer",bg:"white",alignItems:"end",pt:"x16",children:e.jsxRuntimeExports.jsx(b.PositionLink,{href:t,isExternal:n,iconPosition:"left",children:l.toUpperCase()})})]})};exports.CardMap=N; //# sourceMappingURL=index.cjs52.js.map