@anoki/fse-ui
Version:
FSE UI components library
135 lines (134 loc) • 4.51 kB
JavaScript
import { j as r } from "./index.es278.js";
import { Container as I } from "./index.es91.js";
import { Divider as N } from "./index.es104.js";
import './components/navigations/Footer/Footer.css';/* empty css */
import { clsx as p } from "./index.es280.js";
import { FseOperatorsDGT as T } from "./index.es148.js";
import { FseOperatorsMEF as g } from "./index.es149.js";
import { FseOperatorsMS as w } from "./index.es150.js";
import { FseIT as u } from "./index.es144.js";
import { FseUE as d } from "./index.es151.js";
import { FseDGT as U } from "./index.es143.js";
import { FseMEF as O } from "./index.es145.js";
import { FseMS as S } from "./index.es146.js";
const D = (t) => {
if (!t) return !1;
try {
const a = new URL(t);
if (typeof window > "u")
return !0;
const l = new URL(window.location.href);
return a.hostname !== l.hostname;
} catch {
return !0;
}
}, H = ({
footerLinks: t,
version: a,
asLink: l = "a",
className: x,
additionalLogo: c,
additionalLogoName: F = "Logo aggiuntivo",
settingsFooterLinks: i = {
FseMS: "",
FseIT: "",
FseMEF: "",
FseDGT: "",
FseUE: "",
externalLink: ""
},
variant: o = "default"
}) => {
const s = l, h = {
default: {
FseUE: d,
FseIT: u,
FseMS: S,
FseMEF: O,
FseDGT: U
},
operator: {
FseUE: d,
FseIT: u,
FseOperatorsMS: w,
FseOperatorsMEF: g,
FseOperatorsDGT: T
}
}, b = {
default: {
FseUE: "Unione Europea",
FseIT: "Repubblica Italiana",
FseMS: "Ministero della Salute",
FseMEF: "Ministero dell'Economia e delle Finanze",
FseDGT: "Agenzia per l'Italia Digitale"
},
operator: {
FseUE: "Unione Europea",
FseIT: "Repubblica Italiana",
FseOperatorsMS: "Ministero della Salute",
FseOperatorsMEF: "Ministero dell'Economia e delle Finanze",
FseOperatorsDGT: "Agenzia per l'Italia Digitale"
}
}, j = Object.entries(i).filter(([e]) => e !== "externalLink").map(([e]) => ({
key: e,
Logo: h[o][e],
name: b[o][e],
href: i[e] || "#"
}));
return /* @__PURE__ */ r.jsx("footer", { className: p(o === "operator" ? "bg-white ui-footer-operator" : "bg-slate-20", "ui-footer", x), children: /* @__PURE__ */ r.jsxs(I, { children: [
/* @__PURE__ */ r.jsxs("section", { className: "ui-footer-institution-logos", children: [
j.map(({ key: e, Logo: n, name: E, href: f }, M) => {
const m = D(f);
return /* @__PURE__ */ r.jsx(
s,
{
className: "ui-footer-logo-link",
href: f,
target: m ? "_blank" : "_self",
rel: m ? "noopener noreferrer" : void 0,
"aria-label": `Visita il sito di ${E}${m ? " (si apre in una nuova finestra)" : ""}`,
children: /* @__PURE__ */ r.jsx(n, { className: "ui-footer-logo", decorative: !0, variant: o })
},
[e, M].join("-")
);
}),
c && /* @__PURE__ */ r.jsx(
s,
{
className: "ui-footer-logo-link",
href: i == null ? void 0 : i.externalLink,
target: "_blank",
rel: "noopener noreferrer",
"aria-label": `Visita il sito di ${F} (si apre in una nuova finestra)`,
children: /* @__PURE__ */ r.jsx(
"img",
{
src: c,
alt: "",
className: "ui-footer-logo",
role: "presentation"
}
)
}
)
] }),
/* @__PURE__ */ r.jsx(N, { bg: o === "operator" ? "border-divider" : "white" }),
/* @__PURE__ */ r.jsxs("section", { className: "ui-footer-links-container", children: [
/* @__PURE__ */ r.jsx("ul", { className: "ui-footer-links-list", role: "list", children: t == null ? void 0 : t.map((e, n) => e.visible ? /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
s,
{
href: e.href,
className: p(o === "operator" ? "text-slate-28" : "text-white", "fs-6 fw-semibold text-decoration-underline"),
target: e.externalLink ? "_blank" : void 0,
rel: e.externalLink ? "noopener noreferrer" : void 0,
children: e.label
}
) }, n) : null) }),
/* @__PURE__ */ r.jsx("span", { className: p(o === "operator" ? "text-slate-28" : "text-white", "fw-normal ui-footer-version"), children: a })
] })
] }) });
};
export {
H as Footer
};
//# sourceMappingURL=index.es141.js.map