@anoki/fse-ui
Version:
FSE UI components library
81 lines (80 loc) • 2.87 kB
JavaScript
import { j as e } from "./index.es237.js";
import './components/ui/TabsGlossary/TabsGlossary.css';/* empty css */
import { clsx as i } from "./index.es238.js";
import u, { useState as x } from "react";
import { Row as p } from "./index.es116.js";
import { Loader as b } from "./index.es106.js";
const N = ({
CTA: t = "link",
navigationItems: r,
children: l,
activeIndex: o = 0,
onTabChange: c,
actions: n = []
// onDownload,
// onAdd,
// downloadAllLabel = "Scarica tutti",
// addDocumentLabel = "Aggiungi documento",
// actionType,
}) => {
const [m, d] = x(o);
return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: i("ui-document-container-tabs"), children: [
/* @__PURE__ */ e.jsx(
"nav",
{
className: "ui-document-container-tabs-nav-new",
"aria-label": "Menu di navigazione",
children: /* @__PURE__ */ e.jsx(
p,
{
fw: "semibold",
text: "secondary",
className: i(
"ui-document-container-tabs-nav list-style-none ui-tabs"
),
as: "ul",
children: r.map((s, a) => /* @__PURE__ */ e.jsx(
"li",
{
className: i(
"ui-document-container-tabs-nav-responsive-flex ui-text-center-col fs-6 md-fs-custom",
s.disabled ? "text-muted" : "cursor-pointer",
"ui-tab",
m === a && "text-primary ui-active-tab-glossary"
),
onClick: () => {
s.disabled || (d(a), c(a));
},
children: /* @__PURE__ */ e.jsx("a", { className: "text-decoration-none", children: s.label })
},
a
))
}
)
}
),
l,
t === "link" && /* @__PURE__ */ e.jsx("nav", { className: "ui-document-container-tabs-nav-new", children: /* @__PURE__ */ e.jsx("ul", { className: "list-style-none base-row gap-x20 fw-semibold text-primary fs-7 pb-x8", children: n.map((s, a) => /* @__PURE__ */ e.jsxs(u.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(b, { loading: s.loading })
]
}
),
a < n.length - 1 && /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("span", { className: "ui-divider" }) })
] }, a)) }) })
] }) });
};
export {
N as TabsGlossary
};
//# sourceMappingURL=index.es133.js.map