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