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