@anoki/fse-ui
Version:
FSE UI components library
57 lines (56 loc) • 1.4 kB
JavaScript
import { j as e } from "./index.es244.js";
import { ArrowRight as l } from "./index.es174.js";
const v = ({
href: c,
asLink: m = "a",
isExternal: r = !1,
fs: p = "6",
children: n,
className: f = "",
onClick: o,
type: d = "button",
asButton: u,
arrowVisible: s = !0,
...a
}) => {
const i = `max-w-fit text-decoration-none text-primary base-row align-items-center fw-bold gap-x8 hover-underline ${((t) => `fs-${t}`)(p)} ${f}`;
if (u)
return /* @__PURE__ */ e.jsxs(
"button",
{
className: `bg-transparent border-none ${i}`,
onClick: (t) => {
t.preventDefault(), t.stopPropagation(), o && o();
},
type: d,
...a,
children: [
n,
s && /* @__PURE__ */ e.jsx(l, { color: "primary", width: 24, height: 24 })
]
}
);
const h = m;
return /* @__PURE__ */ e.jsxs(
h,
{
className: i,
href: c,
target: r ? "_blank" : void 0,
rel: r ? "noreferrer noopener" : void 0,
...a,
children: [
n,
r && /* @__PURE__ */ e.jsxs("span", { className: "visually-hidden", children: [
" ",
"(si apre in una nuova finestra)"
] }),
s && /* @__PURE__ */ e.jsx(l, { color: "primary", width: 24, height: 24 })
]
}
);
};
export {
v as ArrowLink
};
//# sourceMappingURL=index.es42.js.map