UNPKG

@anoki/fse-ui

Version:

FSE UI components library

158 lines (157 loc) 5.48 kB
import { j as e } from "./index.es278.js"; import { clsx as p } from "./index.es280.js"; import './components/ui/CardDocument/CardDocument.css';/* empty css */ import { Divider as R } from "./index.es104.js"; import { Loader as h } from "./index.es183.js"; import { Obscured as $ } from "./index.es203.js"; import { Row as s } from "./index.es219.js"; import { Favourite as L } from "./index.es130.js"; import { Col as l } from "./index.es82.js"; import { Button as u } from "./index.es36.js"; import { Download as P } from "./index.es117.js"; const W = ({ eventNumber: r, date: w = "--/--/--", documentType: N, showBottomActions: c = !0, showFavorite: t = !1, favorite: d = !1, favoriteLabel: v = "Preferito", handleFavoriteClick: y, showIsHidden: b = !1, documentTitle: g, label: m, subtitle: x, action: f, CTA: n, handleDownloadDocument: C, hrefDocument: i = "#", isLoading: a = !1, openDocumentLabel: k = "Apri documento", releaseDateLabel: I = "Inserito il", eventLabel: z = "Evento n.", asLink: D = "a", isLoadingVisibility: j = !1, obscuredLabel: E = "Oscurato" }) => { const o = D, O = () => f ? /* @__PURE__ */ e.jsxs( s, { alignItems: "center", className: p( !a && "cursor-pointer", "text-decoration-none text-primary", "ui-document-download-row" ), onClick: a ? void 0 : C, children: [ /* @__PURE__ */ e.jsx(P, {}), /* @__PURE__ */ e.jsx("p", { children: f }), /* @__PURE__ */ e.jsx(h, { 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 ? `${z} ${r}` : "" }), t && /* @__PURE__ */ e.jsxs(s, { alignItems: "center", gap: "x8", children: [ /* @__PURE__ */ e.jsx( L, { filled: d, color: "secondary", onClick: y } ), d && /* @__PURE__ */ e.jsx("div", { children: v }) ] }), /* @__PURE__ */ e.jsxs(s, { className: "fw-semibold fs-7", children: [ I, " ", w ] }) ] } ), /* @__PURE__ */ e.jsxs("main", { className: "py-x16 px-x24", children: [ /* @__PURE__ */ e.jsxs(s, { justifyContent: "space-between", children: [ /* @__PURE__ */ e.jsxs( l, { pb: c ? "x32" : void 0, justifyContent: "space-between", children: [ /* @__PURE__ */ e.jsxs("div", { children: [ /* @__PURE__ */ e.jsx(s, { className: "fw-semibold", pb: "x8", children: N }), /* @__PURE__ */ e.jsx("h3", { className: "fs-4 text-slate-20 cursor-pointer hover-underline", children: /* @__PURE__ */ e.jsx(o, { className: "link-unstyled", href: i, children: g }) }), m && /* @__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: m } ) }) ] }), x && /* @__PURE__ */ e.jsx("p", { className: "fw-regular fs-6 pt-x8", children: x }) ] } ), j ? /* @__PURE__ */ e.jsx(h, { loading: j, className: "m-x16" }) : b && /* @__PURE__ */ e.jsxs(l, { gap: "x4", alignItems: "center", children: [ /* @__PURE__ */ e.jsx($, {}), /* @__PURE__ */ e.jsx("div", { className: "fs-7 fw-semibold", children: E }) ] }) ] }), c && /* @__PURE__ */ e.jsx(l, { 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( u, { fwClassName: "fw-semibold", className: "ui-document-cta", variant: "secondary", size: "5", asLink: o, href: i, children: n } ), !n && /* @__PURE__ */ e.jsx( u, { fwClassName: "fw-semibold", className: "ui-document-open-cta", variant: "secondary", size: "4", asLink: o, href: i, children: k } ) ] }) }) ] }) ] } ); }; export { W as CardDocument }; //# sourceMappingURL=index.es47.js.map