@anoki/fse-marche-ui
Version:
FSE UI components library
102 lines (101 loc) • 2.98 kB
JavaScript
import { j as r } from "./index.es137.js";
import { clsx as n } from "./index.es139.js";
import './components/ui/SupportBanner/SupportBanner.css';/* empty css */
import { useMemo as h } from "react";
import { Attachment as g } from "./index.es112.js";
import { ArrowLink as w } from "./index.es35.js";
import { Col as A } from "./index.es10.js";
import { Button as C } from "./index.es25.js";
const b = {
link: (s, a) => /* @__PURE__ */ r.jsx(w, { href: a, children: s }),
button: (s) => /* @__PURE__ */ r.jsx("button", { className: "button-style", children: s }),
outlineButton: (s, a, l, u) => /* @__PURE__ */ r.jsxs(
C,
{
size: "2",
textColor: "primary",
bg: "lightblue-a03",
className: "w-full ",
border: "primary",
onClick: u,
children: [
l && /* @__PURE__ */ r.jsx(g, { className: "mr-x8" }),
/* @__PURE__ */ r.jsx("p", { className: "fs-6 fw-bold", children: s })
]
}
)
}, z = ({
cta: s = "link",
bannerType: a = "outline",
title: l,
description: u = "",
titleTag: d = "h3",
href: e = "#",
icon: m = !0,
linkText: t = "Vai al supporto",
mainLayout: p = "layout1",
className: x = "",
classNameTitle: y = "",
classNameDescription: j = "",
handleAction: i
}) => {
const f = h(() => Array.isArray(e) ? e.map((c, o) => {
const N = Array.isArray(t) ? t[o] : t;
return /* @__PURE__ */ r.jsx("div", { className: "ui-banner-link", children: b[s](
N,
c,
m,
i
) }, o);
}) : Array.isArray(t) ? t.map((c, o) => /* @__PURE__ */ r.jsx("div", { className: "ui-banner-link", children: b[s](c, e, m, i) }, o)) : b[s](t, e, m, i), [s, t, e, i]);
return /* @__PURE__ */ r.jsxs(
A,
{
br: "x4",
gap: "x16",
className: n(
x,
a === "outline" ? "ui-outline" : "bg-lightblue-a03",
"ui-banner shadow "
),
children: [
/* @__PURE__ */ r.jsx(
d,
{
className: n(
"ui-banner-title text-slate-20",
y || "fs-4 fw-bold"
),
children: l
}
),
/* @__PURE__ */ r.jsxs(
"main",
{
className: n(
p === "layout1" ? "ui-banner-content-layout1 fs-6 text-secondary justify-content-between " : "ui-banner-content-layout2",
"ui-banner-content fs-6 text-secondary w-100"
),
children: [
/* @__PURE__ */ r.jsx(
"div",
{
className: n(
j,
p === "layout1" ? "ui-banner-description" : ""
),
children: u
}
),
/* @__PURE__ */ r.jsx("div", { className: n("ui-banner-cta"), children: f })
]
}
)
]
}
);
};
export {
z as SupportBanner
};
//# sourceMappingURL=index.es32.js.map