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