@anoki/fse-ui
Version:
FSE UI components library
120 lines (119 loc) • 3.85 kB
JavaScript
import { j as r } from "./index.es244.js";
import { Container as N } from "./index.es6.js";
import { Divider as F } from "./index.es137.js";
import './components/navigations/Footer/Footer.css';/* empty css */
import { clsx as b } from "./index.es246.js";
import { FseDGT as E } from "./index.es165.js";
import { FseMEF as I } from "./index.es167.js";
import { FseMS as T } from "./index.es169.js";
import { FseIT as v } from "./index.es166.js";
import { FseUE as U } from "./index.es170.js";
const w = (i) => {
if (!i) return !1;
try {
const o = new URL(i);
if (typeof window > "u")
return !0;
const a = new URL(window.location.href);
return o.hostname !== a.hostname;
} catch {
return !0;
}
}, $ = ({
footerLinks: i,
version: o,
asLink: a = "a",
className: u,
additionalLogo: c,
additionalLogoName: f = "Logo aggiuntivo",
settingsFooterLinks: n = {
FseMS: "",
FseIT: "",
FseMEF: "",
FseDGT: "",
FseUE: "",
externalLink: ""
}
}) => {
const t = a, d = {
FseUE: U,
FseIT: v,
FseMS: T,
FseMEF: I,
FseDGT: E
}, x = {
FseUE: "Unione Europea",
FseIT: "Repubblica Italiana",
FseMS: "Ministero della Salute",
FseMEF: "Ministero dell'Economia e delle Finanze",
FseDGT: "Agenzia per l'Italia Digitale"
}, p = Object.entries(n).filter(([e]) => e !== "externalLink").map(([e]) => ({
key: e,
Logo: d[e],
name: x[e],
href: n[e] || "#"
}));
return /* @__PURE__ */ r.jsx("footer", { className: b("bg-slate-20", "ui-footer", u), children: /* @__PURE__ */ r.jsxs(N, { children: [
/* @__PURE__ */ r.jsxs("section", { className: "ui-footer-institution-logos", children: [
p.map(({ key: e, Logo: l, name: h, href: m }, j) => {
const s = w(m);
return /* @__PURE__ */ r.jsx(
t,
{
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(
t,
{
className: "ui-footer-logo-link",
href: n == null ? void 0 : n.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(F, {}),
/* @__PURE__ */ r.jsxs("section", { className: "ui-footer-links-container", children: [
/* @__PURE__ */ r.jsx("h3", { className: "visually-hidden", children: "Sezione Link Utili" }),
/* @__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(
t,
{
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: o })
] })
] }) });
};
export {
$ as Footer
};
//# sourceMappingURL=index.es16.js.map