"use strict";const s=require("react/jsx-runtime"),m=require("react");function v({tabs:d,activeTab:l,onTabChange:i,ariaLabel:u,children:b,className:x}){const a=m.useRef(new Map),t=d.filter(e=>!e.hidden),f=e=>{const r=a.current.get(e);r&&r.focus()},p=(e,r)=>{const n=t.findIndex(h=>h.id===r);if(n===-1)return;let o=null;switch(e.key){case"ArrowRight":o=(n+1)%t.length;break;case"ArrowLeft":o=(n-1+t.length)%t.length;break;case"Home":o=0;break;case"End":o=t.length-1;break;default:return}e.preventDefault();const c=t[o];i(c.id),f(c.id)};return s.jsx("div",{className:`border-b border-[var(--border-color)] ${x??""}`,children:s.jsxs("div",{className:"flex gap-1 -mb-px overflow-x-auto",role:"tablist","aria-label":u,children:[t.map(e=>{const r=l===e.id;return s.jsxs("button",{ref:n=>{a.current.set(e.id,n)},type:"button",role:"tab",id:`tab-${e.id}`,"aria-selected":r,"aria-controls":`tabpanel-${e.id}`,tabIndex:r?0:-1,onClick:()=>i(e.id),onKeyDown:n=>p(n,e.id),className:`flex-shrink-0 flex items-center gap-2 px-4 py-2 whitespace-nowrap border-b-2 font-medium transition-colors ${r?"border-[var(--color-accent-600)] text-[var(--color-accent-600)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[e.icon,e.label]},e.id)}),b]})})}exports.UnderlinedTabs=v;
//# sourceMappingURL=UnderlinedTabs-u3WNiDaV.js.map
