@anoki/fse-ui
Version:
FSE UI components library
158 lines (157 loc) • 5.37 kB
JavaScript
import { j as e } from "./index.es237.js";
import { clsx as p } from "./index.es238.js";
import './components/ui/CardDocument/CardDocument.css';/* empty css */
import { Divider as R } from "./index.es72.js";
import { Loader as j } from "./index.es106.js";
import { Obscured as $ } from "./index.es219.js";
import { Row as s } from "./index.es116.js";
import { Favourite as L } from "./index.es198.js";
import { Col as i } from "./index.es61.js";
import { Button as h } from "./index.es32.js";
import { Download as P } from "./index.es189.js";
const W = ({
eventNumber: r,
date: u = "--/--/--",
documentType: w,
showBottomActions: o = !0,
showFavorite: t = !1,
favorite: c = !1,
favoriteLabel: N = "Preferito",
handleFavoriteClick: b,
showIsHidden: v = !1,
documentTitle: y,
label: l,
subtitle: d,
action: m,
CTA: n,
handleDownloadDocument: g,
hrefDocument: x = "#",
isLoading: a = !1,
openDocumentLabel: C = "Apri documento",
releaseDateLabel: k = "Inserito il",
eventLabel: I = "Evento n.",
asLink: D = "a",
isLoadingVisibility: f = !1,
obscuredLabel: z = "Oscurato"
}) => {
const E = D, O = () => m ? /* @__PURE__ */ e.jsxs(
s,
{
alignItems: "center",
className: p(
!a && "cursor-pointer",
"text-decoration-none text-primary",
"ui-document-download-row"
),
onClick: a ? void 0 : g,
children: [
/* @__PURE__ */ e.jsx(P, {}),
/* @__PURE__ */ e.jsx("p", { children: m }),
/* @__PURE__ */ e.jsx(j, { loading: a, className: "ml-x8" })
]
}
) : null;
return /* @__PURE__ */ e.jsxs(
"div",
{
className: p(
"ui-card-document shadow br-x4 fw-semibold text-slate-28 fs-7"
),
children: [
/* @__PURE__ */ e.jsxs(
s,
{
"max-h": "x40",
"min-h": "x40",
as: "header",
justifyContent: r || t ? "space-between" : "flex-end",
alignItems: "center",
px: "x24",
className: "ui-document-header",
children: [
r && /* @__PURE__ */ e.jsx(s, { children: r ? `${I} ${r}` : "" }),
t && /* @__PURE__ */ e.jsxs(s, { alignItems: "center", gap: "x8", children: [
/* @__PURE__ */ e.jsx(
L,
{
filled: c,
color: "secondary",
onClick: b
}
),
c && /* @__PURE__ */ e.jsx("div", { children: N })
] }),
/* @__PURE__ */ e.jsxs(s, { className: "fw-semibold fs-7", children: [
k,
" ",
u
] })
]
}
),
/* @__PURE__ */ e.jsxs("main", { className: "py-x16 px-x24", children: [
/* @__PURE__ */ e.jsxs(s, { justifyContent: "space-between", children: [
/* @__PURE__ */ e.jsxs(
i,
{
pb: o ? "x32" : void 0,
justifyContent: "space-between",
children: [
/* @__PURE__ */ e.jsxs("div", { children: [
/* @__PURE__ */ e.jsx(s, { className: "fw-semibold", pb: "x8", children: w }),
/* @__PURE__ */ e.jsx("p", { className: "fs-4 text-slate-20", children: y }),
l && /* @__PURE__ */ e.jsx(s, { pt: "x8", children: /* @__PURE__ */ e.jsx(
"div",
{
className: "bg-secondary text-white rounded py-x4 px-x16",
style: { width: "max-content" },
children: l
}
) })
] }),
d && /* @__PURE__ */ e.jsx("p", { className: "fw-regular fs-6 pt-x8", children: d })
]
}
),
f ? /* @__PURE__ */ e.jsx(j, { loading: f, className: "m-x16" }) : v && /* @__PURE__ */ e.jsxs(i, { gap: "x4", alignItems: "center", children: [
/* @__PURE__ */ e.jsx($, {}),
/* @__PURE__ */ e.jsx("div", { className: "fs-7 fw-semibold", children: z })
] })
] }),
o && /* @__PURE__ */ e.jsx(i, { mt: "x16", className: "ui-document-footer", children: /* @__PURE__ */ e.jsxs("div", { className: "ui-document-footer-actions", children: [
O(),
/* @__PURE__ */ e.jsx(R, { bg: "border-divider", className: "ui-document-divider" }),
n && /* @__PURE__ */ e.jsx(
h,
{
fwClassName: "fw-semibold",
className: "ui-document-cta",
variant: "secondary",
size: "5",
asLink: E,
href: x,
children: n
}
),
!n && /* @__PURE__ */ e.jsx(
h,
{
fwClassName: "fw-semibold",
className: "ui-document-open-cta",
variant: "secondary",
size: "4",
asLink: "a",
href: x,
children: C
}
)
] }) })
] })
]
}
);
};
export {
W as CardDocument
};
//# sourceMappingURL=index.es41.js.map