@anoki/fse-ui
Version:
FSE UI components library
104 lines (103 loc) • 3.44 kB
JavaScript
import { j as s } from "./index.es244.js";
import { clsx as t } from "./index.es246.js";
import { ArrowLink as v } from "./index.es42.js";
import './components/ui/CardCategory/CardCategory.css';/* empty css */
import { ExternalLink as N } from "./index.es159.js";
import { Col as C } from "./index.es10.js";
import { Row as k } from "./index.es9.js";
const z = ({
image: r,
title: a,
titleTag: i = "h1",
href: n,
description: p,
description2: x,
isExternal: e = !1,
showIcon: h = !1,
goToLabel: c,
asLink: f = "a",
asImage: u = "img",
className: j,
classNameTitle: o,
classNameDescription: m,
classNameDescriptionTitle: l,
handleOnClick: d
}) => {
const w = u, y = f;
return /* @__PURE__ */ s.jsxs(
y,
{
className: t(
"ui-card-category shadow br-x4 bg-white",
j,
d && "cursor-pointer"
),
href: n,
target: e ? "_blank" : void 0,
rel: e ? "noreferrer noopener" : void 0,
onClick: d ?? void 0,
children: [
(r == null ? void 0 : r.src) && /* @__PURE__ */ s.jsx("header", { className: "ui-card-category-header", children: /* @__PURE__ */ s.jsx(
w,
{
src: r == null ? void 0 : r.src,
alt: r == null ? void 0 : r.alt,
title: r == null ? void 0 : r.title
}
) }),
/* @__PURE__ */ s.jsxs(
C,
{
className: t(
r != null && r.src ? "ui-card-category-content-with-image ui-mt-negative" : "ui-card-category-content",
"gap-x8 br-x4 bg-white"
),
children: [
/* @__PURE__ */ s.jsxs(k, { alignItems: "center", justifyContent: "space-between", gap: "x4", children: [
/* @__PURE__ */ s.jsxs(
i,
{
className: t(
"flex-1 cursor-pointer hover-underline",
o || "text-primary fs-5 md-fs-custom-2"
),
children: [
a,
e && /* @__PURE__ */ s.jsx("span", { className: "visually-hidden", children: "(si apre in una nuova finestra)" })
]
}
),
h && /* @__PURE__ */ s.jsx("span", { children: /* @__PURE__ */ s.jsx(
N,
{
width: 24,
height: 24,
color: "primary",
className: "ui-external-link"
}
) })
] }),
/* @__PURE__ */ s.jsxs("div", { className: t(m), children: [
/* @__PURE__ */ s.jsx(
"p",
{
className: t(
l || "fs-6 md-fs-custom text-slate-20"
),
children: p
}
),
/* @__PURE__ */ s.jsx("p", { className: "fs-6 md-fs-custom fw-regular text-slate-28", children: x })
] })
]
}
),
c && n && /* @__PURE__ */ s.jsx("footer", { className: "ui-card-category-footer bg-white", children: /* @__PURE__ */ s.jsx(v, { href: n ?? "#", isExternal: e, children: c == null ? void 0 : c.toUpperCase() }) })
]
}
);
};
export {
z as CardCategory
};
//# sourceMappingURL=index.es30.js.map