@anoki/fse-marche-ui
Version:
FSE UI components library
73 lines (72 loc) • 2.52 kB
JavaScript
import { j as e } from "./index.es137.js";
import './components/ui/TabsGlossary/TabsGlossary.css';/* empty css */
import { clsx as i } from "./index.es139.js";
import x, { useState as p } from "react";
import { Row as u } from "./index.es9.js";
import { Loader as j } from "./index.es64.js";
const N = ({
CTA: l = "link",
navigationItems: t,
children: n,
activeIndex: o = 0,
onTabChange: c,
actions: r = []
// onDownload,
// onAdd,
// downloadAllLabel = "Scarica tutti",
// addDocumentLabel = "Aggiungi documento",
// actionType,
}) => {
const [d, m] = p(o);
return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: i("ui-document-container-tabs"), children: [
/* @__PURE__ */ e.jsx("nav", { "aria-label": "Menu di navigazione", children: /* @__PURE__ */ e.jsx(
u,
{
gap: "x20",
fw: "semibold",
text: "secondary",
className: i(
"ui-document-container-tabs-nav list-style-none ui-tabs"
),
children: t.map((s, a) => /* @__PURE__ */ e.jsx(
"li",
{
className: i(
s.disabled ? "text-muted" : "cursor-pointer",
"ui-tab",
d === a && "text-primary ui-active-tab-glossary"
),
onClick: () => {
s.disabled || (m(a), c(a));
},
children: /* @__PURE__ */ e.jsx("a", { className: "text-decoration-none", children: s.label })
},
a
))
}
) }),
n,
l === "link" && /* @__PURE__ */ e.jsx("nav", { children: /* @__PURE__ */ e.jsx("ul", { className: "list-style-none base-row gap-x20 fw-semibold text-primary fs-8 pb-x8", children: r.map((s, a) => /* @__PURE__ */ e.jsxs(x.Fragment, { children: [
/* @__PURE__ */ e.jsxs(
"li",
{
className: i(
!s.loading && "cursor-pointer",
"text-primary base-row justify-content-center align-items-center gap-x8"
),
onClick: () => !s.loading && s.onClick(),
children: [
s.icon,
/* @__PURE__ */ e.jsx("p", { children: s.label }),
s.loading && /* @__PURE__ */ e.jsx(j, { loading: s.loading })
]
}
),
a < r.length - 1 && /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "ui-divider" }) })
] }, a)) }) })
] }) });
};
export {
N as TabsGlossary
};
//# sourceMappingURL=index.es33.js.map