@anoki/fse-ui
Version:
FSE UI components library
113 lines (112 loc) • 3.66 kB
JavaScript
import { j as r } from "./index.es237.js";
import { Container as N } from "./index.es65.js";
import { Divider as F } from "./index.es72.js";
import './components/navigations/Footer/Footer.css';/* empty css */
import { clsx as b } from "./index.es238.js";
import { FseDGT as E } from "./index.es201.js";
import { FseMEF as I } from "./index.es203.js";
import { FseMS as T } from "./index.es204.js";
import { FseIT as v } from "./index.es202.js";
import { FseUE as w } from "./index.es205.js";
const M = (i) => {
if (!i) return !1;
try {
const n = new URL(i);
if (typeof window > "u")
return !0;
const t = new URL(window.location.href);
return n.hostname !== t.hostname;
} catch {
return !0;
}
}, z = ({
footerLinks: i,
version: n,
asLink: t = "a",
className: f,
additionalLogo: c,
additionalLogoName: u = "Logo aggiuntivo",
settingsFooterLinks: o = {
FseMS: "",
FseIT: "",
FseMEF: "",
FseDGT: "",
FseUE: "",
externalLink: ""
}
}) => {
const a = t, d = {
FseUE: w,
FseIT: v,
FseMS: T,
FseMEF: I,
FseDGT: E
}, p = {
FseUE: "Unione Europea",
FseIT: "Repubblica Italiana",
FseMS: "Ministero della Salute",
FseMEF: "Ministero dell'Economia e delle Finanze",
FseDGT: "Agenzia per l'Italia Digitale"
}, x = Object.entries(o).filter(([e]) => e !== "externalLink").map(([e]) => ({
key: e,
Logo: d[e],
name: p[e],
href: o[e] || "#"
}));
return /* @__PURE__ */ r.jsx("footer", { className: b("bg-slate-20", "ui-footer", f), children: /* @__PURE__ */ r.jsxs(N, { children: [
/* @__PURE__ */ r.jsxs("section", { className: "ui-footer-institution-logos", children: [
x.map(({ key: e, Logo: l, name: h, href: m }, j) => {
const s = M(m);
return /* @__PURE__ */ r.jsx(
a,
{
className: "ui-footer-logo-link",
href: m,
target: s ? "_blank" : "_self",
rel: s ? "noopener noreferrer" : void 0,
"aria-label": `Visita il sito di ${h}${s ? " (si apre in una nuova finestra)" : ""}`,
children: /* @__PURE__ */ r.jsx(l, { className: "ui-footer-logo", decorative: !0 })
},
[e, j].join("-")
);
}),
c && /* @__PURE__ */ r.jsx(
a,
{
className: "ui-footer-logo-link",
href: o == null ? void 0 : o.externalLink,
target: "_blank",
rel: "noopener noreferrer",
"aria-label": `Visita il sito di ${u} (si apre in una nuova finestra)`,
children: /* @__PURE__ */ r.jsx(
"img",
{
src: c,
alt: "",
className: "ui-footer-logo",
role: "presentation"
}
)
}
)
] }),
/* @__PURE__ */ r.jsx(F, {}),
/* @__PURE__ */ r.jsxs("section", { className: "ui-footer-links-container", children: [
/* @__PURE__ */ r.jsx("ul", { className: "ui-footer-links-list", role: "list", children: i == null ? void 0 : i.map((e, l) => e.visible ? /* @__PURE__ */ r.jsx("li", { children: /* @__PURE__ */ r.jsx(
a,
{
href: e.href,
className: "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
}
) }, l) : null) }),
/* @__PURE__ */ r.jsx("span", { className: "text-white fw-normal ui-footer-version", children: n })
] })
] }) });
};
export {
z as Footer
};
//# sourceMappingURL=index.es8.js.map