import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{$ as t}from"./vendor-charts-iXlq6Rne.js";import{_ as n}from"./vendor-flow-IzlrcDx6.js";import{rn as r}from"./index-HkVQGc9M.js";var i=e(t(),1),a=n(),o=(0,i.createContext)(null);function s({tabs:e,defaultTab:t,onChange:n,children:s,className:c}){let[l,u]=(0,i.useState)(t||e[0]?.id||``),d=e=>{u(e),n?.(e)};return(0,a.jsx)(o.Provider,{value:{activeTab:l,setActiveTab:d},children:(0,a.jsxs)(`div`,{className:c,children:[(0,a.jsx)(`div`,{className:`flex border-b border-[var(--color-border)]`,role:`tablist`,children:e.map(e=>(0,a.jsxs)(`button`,{role:`tab`,"aria-selected":l===e.id,onClick:()=>d(e.id),className:r(`flex items-center gap-2 px-4 py-3 text-sm border-b-2 -mb-px transition-colors duration-[var(--transition-fast)]`,l===e.id?`border-[var(--color-accent)] text-[var(--color-text-primary)] font-semibold`:`border-transparent text-[var(--color-text-muted)] font-medium hover:text-[var(--color-text-primary)] hover:border-[var(--color-border)]`),children:[e.icon,e.label,e.badge!==void 0&&(0,a.jsx)(`span`,{className:r(`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 rounded-full text-[11px] font-semibold`,l===e.id?`bg-[var(--color-accent-soft)] text-[var(--color-accent-ink)]`:`bg-slate-100 dark:bg-slate-800 text-[var(--color-text-muted)]`),children:e.badge})]},e.id))}),(0,a.jsx)(`div`,{className:`pt-4`,children:s})]})})}function c({id:e,children:t,className:n}){let r=(0,i.useContext)(o);if(!r)throw Error(`TabPanel must be used within Tabs`);return r.activeTab===e?(0,a.jsx)(`div`,{role:`tabpanel`,className:n,children:t}):null}export{s as n,c as t};