import{c as j,j as r}from"./index-C8aoN8t4.js";import{r as u}from"./vendor-ChGFRQAq.js";const T=({items:p,activeId:l,onChange:b,variant:s="pill",direction:y="horizontal",className:n="",showIndicator:g=!0})=>{const{theme:x}=j(),d=x.mode==="dark",[a,h]=u.useState(null),f=u.useRef({}),c=u.useRef(null);u.useEffect(()=>{const e=f.current[l];if(e&&(h({left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}),s==="ribbon"&&c.current)){const t=c.current;if(e.offsetLeft<t.scrollLeft||e.offsetLeft+e.offsetWidth>t.scrollLeft+t.offsetWidth){const i=e.offsetLeft-t.offsetWidth/2+e.offsetWidth/2;t.scrollTo({left:i,behavior:"smooth"})}}},[l,s]);const m=()=>{const e="relative flex transition-all duration-300";switch(s){case"pill":return`${e} p-1.5 rounded-[1.75rem] flex-wrap justify-center sm:justify-start ${d?"bg-slate-800/50":"bg-slate-50"}`;case"ribbon":return`${e} p-1.5 gap-2 overflow-x-auto whitespace-nowrap no-scrollbar scroll-smooth w-full min-w-0`;case"compact":return`${e} p-1 rounded-xl border flex-wrap sm:flex-nowrap ${d?"border-slate-800 bg-slate-950":"border-slate-100 bg-slate-50"}`;case"sidebar":return`${e} flex-col w-full gap-1.5 min-w-0`;default:return e}},w=(e,t)=>{const o="relative z-10 flex items-center transition-all duration-200 font-bold active:scale-95";if(s==="pill"){const i=(t==null?void 0:t.gradient)||n.includes("bg-gradient");return`${o} ${n.includes("gap-")?"":"gap-3"} ${n.includes("px-")?"":"px-6"} ${n.includes("py-")?"":"py-3"} rounded-[1.5rem] ${n.includes("text-")?"":"text-sm"} ${e?i?"text-white":"text-indigo-600 dark:text-white scale-[1.02]":"text-slate-500 hover:text-indigo-600 dark:text-slate-400 dark:hover:text-white"} ${n}`}return s==="ribbon"?`${o} gap-2.5 px-4 py-2 rounded-xl text-[11.5px] ${e?"text-white shadow-lg shadow-indigo-500/20 scale-[1.02]":d?"text-slate-400 hover:text-white hover:bg-slate-800":"text-slate-600 hover:text-indigo-600 hover:bg-slate-50/50"}`:s==="compact"?`${o} px-3 py-1.5 text-[10.5px] uppercase tracking-wider rounded-lg flex-1 justify-center ${e?"text-white shadow-sm":d?"text-slate-500 hover:text-white":"text-slate-400 hover:text-slate-900"}`:s==="sidebar"?`${o} w-full px-4 py-3.5 rounded-xl text-[14px] ${e?"text-white shadow-lg shadow-indigo-500/25":d?"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50":"text-slate-500 hover:text-indigo-600 hover:bg-indigo-50/50"}`:o},$=e=>{const t="absolute transition-all z-0";if(s==="pill"){const o=e==null?void 0:e.gradient;return`${t} ${o?`bg-gradient-to-br ${o}`:"bg-white dark:bg-slate-700"} shadow-md rounded-[1.5rem]`}if(s==="ribbon"){const o=(e==null?void 0:e.gradient)||"from-indigo-600 to-purple-600";return`${t} bg-gradient-to-br ${o} shadow-lg rounded-xl`}return s==="compact"?`${t} bg-indigo-600 shadow-md rounded-lg`:s==="sidebar"?`${t} bg-gradient-to-r from-indigo-600 to-purple-600 shadow-lg shadow-indigo-500/25 rounded-xl`:t},N=p.find(e=>e.id===l);return r.jsxDEV("div",{ref:c,className:`${m()} ${n}`,role:"tablist",children:[g&&l&&a&&r.jsxDEV("div",{className:$(N),style:{left:a.left,top:a.top,width:a.width,height:a.height,transitionDuration:"200ms",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)"}},void 0,!1,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:160,columnNumber:17},void 0),p.map(e=>{const t=e.icon,o=l===e.id;return r.jsxDEV("button",{role:"tab","aria-selected":o,ref:i=>{i?f.current[e.id]=i:delete f.current[e.id]},onClick:()=>b(e.id),className:w(o,e),children:[t&&r.jsxDEV(t,{className:`
                                    flex-shrink-0 transition-all duration-300
                                    ${s==="pill"?"h-5 w-5":s==="ribbon"||s==="sidebar"?"h-4 w-4":"h-3.5 w-3.5"}
                                    ${o?"text-white":"text-slate-400"}
                                `},void 0,!1,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:190,columnNumber:29},void 0),r.jsxDEV("span",{children:e.label},void 0,!1,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:198,columnNumber:25},void 0),e.count!==void 0&&r.jsxDEV("span",{className:`
                                px-2 py-0.5 rounded-full text-[10px] font-black transition-colors ml-2
                                ${o?"bg-white/20 text-white":"bg-slate-200 dark:bg-slate-800 text-slate-500"}
                            `,children:e.count},void 0,!1,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:200,columnNumber:29},void 0),s==="sidebar"&&o&&r.jsxDEV("div",{className:"absolute right-3 w-1.5 h-1.5 rounded-full bg-white animate-pulse"},void 0,!1,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:209,columnNumber:30},void 0)]},e.id,!0,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:178,columnNumber:21},void 0)})]},void 0,!0,{fileName:"D:/devlop/projects/printing system/src/components/ui/modern/SlidingTabs.tsx",lineNumber:154,columnNumber:9},void 0)};export{T as S};
