@anoki/fse-ui
Version:
FSE UI components library
122 lines (121 loc) • 5.19 kB
JavaScript
import { j as a } from "./index.es278.js";
import { clsx as c } from "./index.es280.js";
import './components/ui/CardPaymentDocument/CardPaymentDocument.css';/* empty css */
import { Divider as w } from "./index.es104.js";
import { Row as d } from "./index.es219.js";
import { Col as r } from "./index.es82.js";
import { Download as N } from "./index.es117.js";
import { Loader as v } from "./index.es183.js";
import { Button as C } from "./index.es36.js";
const P = ({
headerText: u,
beforeTitle: n,
title: g,
subtitle: m,
footer: s,
isLoading: i,
asLink: y = "a"
}) => {
var l, h, e, p, t, j;
const x = y;
return /* @__PURE__ */ a.jsxs(
"div",
{
className: c(
"ui-card-payment shadow br-x4 fw-semibold text-slate-28 fs-7"
),
children: [
/* @__PURE__ */ a.jsx(
d,
{
"max-h": "x40",
"min-h": "x40",
as: "header",
justifyContent: "flex-end",
alignItems: "center",
px: "x24",
className: "ui-card-payment-header",
children: /* @__PURE__ */ a.jsx(d, { className: "fw-semibold fs-7", children: u })
}
),
/* @__PURE__ */ a.jsxs("div", { className: "ui-card-payment-main py-x16 px-x24", children: [
/* @__PURE__ */ a.jsxs(
r,
{
pb: "x32",
justifyContent: "space-between",
gap: "x8",
children: [
/* @__PURE__ */ a.jsxs(d, { justifyContent: n != null && n.rightBadgeText ? "space-between" : "flex-end", alignItems: "center", children: [
n && /* @__PURE__ */ a.jsx("div", { className: "fw-semibold", children: n == null ? void 0 : n.leftText }),
(n == null ? void 0 : n.rightBadgeText) && /* @__PURE__ */ a.jsx(
"div",
{
className: c(
"rounded py-x4 px-x16"
),
style: { backgroundColor: n.rightBadgeColor || "#000", color: "#fff", width: "max-content" },
children: n.rightBadgeText
}
)
] }),
/* @__PURE__ */ a.jsx(
"h3",
{
className: c(
"ui-card-payment-title fs-4 text-slate-20",
"cursor-pointer hover-underline"
),
children: /* @__PURE__ */ a.jsx(x, { className: "link-unstyled", href: ((l = s == null ? void 0 : s.ctaRight) == null ? void 0 : l.href) ?? "#", children: g })
}
),
m && /* @__PURE__ */ a.jsx("div", { style: { fontWeight: 500 }, children: m })
]
}
),
s && /* @__PURE__ */ a.jsxs(r, { mt: "x16", className: "ui-card-payment-footer", children: [
(s == null ? void 0 : s.descriptionText) && /* @__PURE__ */ a.jsx("div", { children: (s == null ? void 0 : s.descriptionText) && /* @__PURE__ */ a.jsx("p", { className: "fw-regular fs-7 text-slate-28 mb-x8", children: s.descriptionText }) }),
/* @__PURE__ */ a.jsxs(d, { className: "ui-card-payment-footer-actions", justifyContent: s != null && s.downloadDoc ? "space-between" : "flex-end", alignItems: "center", children: [
(s == null ? void 0 : s.downloadDoc) && /* @__PURE__ */ a.jsxs(
d,
{
alignItems: "center",
className: c(
!i && "cursor-pointer",
"text-decoration-none text-primary",
"ui-card-payment-download-row"
),
onClick: i || (h = s == null ? void 0 : s.downloadDoc) == null ? void 0 : h.clickCta,
children: [
/* @__PURE__ */ a.jsx(N, {}),
/* @__PURE__ */ a.jsx("p", { children: (e = s == null ? void 0 : s.downloadDoc) == null ? void 0 : e.label }),
/* @__PURE__ */ a.jsx(v, { loading: i, className: "ml-x8" })
]
}
),
(s == null ? void 0 : s.ctaRight) && ((p = s == null ? void 0 : s.ctaRight) == null ? void 0 : p.href) && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
/* @__PURE__ */ a.jsx(w, { bg: "border-divider", className: "ui-document-divider" }),
/* @__PURE__ */ a.jsx(
C,
{
fwClassName: "fw-semibold",
className: "ui-card-payment-cta px-x12",
variant: "secondary",
size: "5",
asLink: x,
href: ((t = s == null ? void 0 : s.ctaRight) == null ? void 0 : t.href) ?? void 0,
children: (j = s == null ? void 0 : s.ctaRight) == null ? void 0 : j.label
}
)
] })
] })
] })
] })
]
}
);
};
export {
P as CardPaymentDocument
};
//# sourceMappingURL=index.es57.js.map