import{j as i}from"./vendor-mui-69397583.js";import{r as b}from"./vendor-react-ece1c85f.js";import{u as g,a as w}from"./useControllableState-d0909575.js";import{d as C,b9 as L}from"./index-c62ac197.js";const p=b.createContext({}),P=p.Provider;p.Consumer;function N(){return b.useContext(p)}const $=b.forwardRef((s,n)=>{const{className:t,defaultValue:a,onChange:o,value:e,variant:r="pill",...l}=s,[d,v]=g({prop:e,onChange:o,defaultProp:a}),u=C("tabs",t);return i.jsx(P,{value:{value:d,onValueChange:v,variant:r},children:i.jsx("div",{className:u,...l,ref:n})})});$.displayName="Tabs";const h=b.forwardRef((s,n)=>{const{className:t,children:a,...o}=s,{variant:e}=N(),r=C("tab-list",`tab-list-${e}`,t);return i.jsx("div",{ref:n,role:"tablist",className:r,...o,children:a})});h.displayName="TabList";const j=b.forwardRef((s,n)=>{const{value:t,disabled:a,className:o,icon:e,children:r,...l}=s,{value:d,onValueChange:v,variant:u}=N(),c=t===d,{themeColor:m,primaryColorLevel:y}=L(),T=w(()=>{!c&&!a&&(v==null||v(t))}),x=`${m}-${y}`,R=C("tab-nav",`tab-nav-${u}`,c&&`tab-nav-active text-${x} dark:text-${m}-100`,c&&u==="underline"&&`border-${x}`,c&&u==="pill"&&`bg-${m}-50 dark:bg-${x} dark:text-gray-100`,a&&"tab-nav-disabled",!a&&!c&&`hover:text-${x} dark:hover:text-${m}-100`,o);return i.jsxs("div",{ref:n,className:R,role:"tab","aria-selected":c,tabIndex:0,onClick:T,onKeyDown:T,...l,children:[e&&i.jsx("div",{className:"tab-nav-icon",children:e}),r]})});j.displayName="TabNav";const k=b.forwardRef((s,n)=>{const{value:t,children:a,className:o,...e}=s,r=N(),l=t===r.value,d=C("tab-content",l&&"tab-content-active",o);return i.jsx("div",{ref:n,role:"tabpanel",tabIndex:0,className:d,...e,children:l&&a})});k.displayName="TabContent";const f=$;f.TabList=h;f.TabNav=j;f.TabContent=k;export{f as T,h as a,j as b,k as c};
