UNPKG

@anoki/fse-ui

Version:

FSE UI components library

3 lines (2 loc) 1.99 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components/ui/TabsGlossary/TabsGlossary.css');const e=require("./index.cjs180.js");;/* empty css */const n=require("./index.cjs182.js"),r=require("react"),d=require("./index.cjs9.js"),j=require("./index.cjs64.js"),p=({CTA:a="link",navigationItems:l,children:o,activeIndex:x=0,onTabChange:c,actions:i=[]})=>{const[u,m]=r.useState(x);return e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:n.clsx("ui-document-container-tabs"),children:[e.jsxRuntimeExports.jsx("nav",{className:"ui-document-container-tabs-nav-new","aria-label":"Menu di navigazione",children:e.jsxRuntimeExports.jsx(d.Row,{gap:"x20",fw:"semibold",text:"secondary",className:n.clsx("ui-document-container-tabs-nav list-style-none ui-tabs"),children:l.map((s,t)=>e.jsxRuntimeExports.jsx("li",{className:n.clsx("ui-document-container-tabs-nav-responsive-flex",s.disabled?"text-muted":"cursor-pointer","ui-tab",u===t&&"text-primary ui-active-tab-glossary "),onClick:()=>{s.disabled||(m(t),c(t))},children:e.jsxRuntimeExports.jsx("a",{className:"text-decoration-none",children:s.label})},t))})}),o,a==="link"&&e.jsxRuntimeExports.jsx("nav",{className:"ui-document-container-tabs-nav-new",children:e.jsxRuntimeExports.jsx("ul",{className:"list-style-none base-row gap-x20 fw-semibold text-primary fs-8 pb-x8",children:i.map((s,t)=>e.jsxRuntimeExports.jsxs(r.Fragment,{children:[e.jsxRuntimeExports.jsxs("li",{className:n.clsx(!s.loading&&"cursor-pointer","text-primary base-row justify-content-center align-items-center gap-x8"),onClick:()=>!s.loading&&s.onClick(),children:[s.icon,e.jsxRuntimeExports.jsx("p",{children:s.label}),s.loading&&e.jsxRuntimeExports.jsx(j.Loader,{loading:s.loading})]}),t<i.length-1&&e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx("span",{className:"ui-divider"})})]},t))})})]})})};exports.TabsGlossary=p; //# sourceMappingURL=index.cjs33.js.map