@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 1.35 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs278.js"),j=require("./index.cjs22.js"),g=require("./index.cjs20.js"),w=({href:l,asLink:c="a",isExternal:o=!1,fs:p="6",children:i,className:h="",onClick:a,type:m="button",asButton:d,arrowVisible:r=!0,iconPosition:t="right",...u})=>{const x=`max-w-fit text-decoration-none text-primary base-row align-items-center fw-bold gap-x8 hover-underline cursor-pointer ${(n=>`fs-${n}`)(p)} ${h}`,s=t==="left"?g.ArrowLeft:j.ArrowRight;if(d)return e.jsxRuntimeExports.jsxs("button",{className:`bg-transparent border-none ${x}`,onClick:n=>{n.preventDefault(),n.stopPropagation(),a&&a()},type:m,...u,children:[r&&t==="left"&&e.jsxRuntimeExports.jsx(s,{color:"primary",width:24,height:24}),i,r&&t==="right"&&e.jsxRuntimeExports.jsx(s,{color:"primary",width:24,height:24})]});const f=c;return e.jsxRuntimeExports.jsxs(f,{className:x,href:l,target:o?"_blank":void 0,rel:o?"noreferrer noopener":void 0,...u,children:[r&&t==="left"&&e.jsxRuntimeExports.jsx(s,{color:"primary",width:24,height:24}),i,o&&e.jsxRuntimeExports.jsxs("span",{className:"visually-hidden",children:[" ","(si apre in una nuova finestra)"]}),r&&t==="right"&&e.jsxRuntimeExports.jsx(s,{color:"primary",width:24,height:24})]})};exports.ArrowLink=w;
//# sourceMappingURL=index.cjs21.js.map