decocms
Version:
Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools
2 lines (1 loc) • 5.32 kB
JavaScript
import{r as b,j as u,g3 as M,c9 as g,ca as h,g4 as P,e4 as S,c3 as V,c4 as k,c6 as F,g5 as _,cn as D,c as m,m as v}from"./index-ztdGKvBm.js";import{A as G,t as z}from"./active-indicator-CCMhAsc_.js";var x="Tabs",[L]=D(x,[_]),C=_(),[K,T]=L(x),N=b.forwardRef((o,e)=>{const{__scopeTabs:a,value:t,onValueChange:n,defaultValue:r,orientation:s="horizontal",dir:i,activationMode:d="automatic",...f}=o,l=V(i),[c,p]=k({prop:t,onChange:n,defaultProp:r??"",caller:x});return u.jsx(K,{scope:a,baseId:F(),value:c,onValueChange:p,orientation:s,dir:l,activationMode:d,children:u.jsx(g.div,{dir:l,"data-orientation":s,...f,ref:e})})});N.displayName=x;var y="TabsList",I=b.forwardRef((o,e)=>{const{__scopeTabs:a,loop:t=!0,...n}=o,r=T(y,a),s=C(a);return u.jsx(P,{asChild:!0,...s,orientation:r.orientation,dir:r.dir,loop:t,children:u.jsx(g.div,{role:"tablist","aria-orientation":r.orientation,...n,ref:e})})});I.displayName=y;var j="TabsTrigger",w=b.forwardRef((o,e)=>{const{__scopeTabs:a,value:t,disabled:n=!1,...r}=o,s=T(j,a),i=C(a),d=E(s.baseId,t),f=$(s.baseId,t),l=t===s.value;return u.jsx(M,{asChild:!0,...i,focusable:!n,active:l,children:u.jsx(g.button,{type:"button",role:"tab","aria-selected":l,"aria-controls":f,"data-state":l?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:d,...r,ref:e,onMouseDown:h(o.onMouseDown,c=>{!n&&c.button===0&&c.ctrlKey===!1?s.onValueChange(t):c.preventDefault()}),onKeyDown:h(o.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&s.onValueChange(t)}),onFocus:h(o.onFocus,()=>{const c=s.activationMode!=="manual";!l&&!n&&c&&s.onValueChange(t)})})})});w.displayName=j;var A="TabsContent",R=b.forwardRef((o,e)=>{const{__scopeTabs:a,value:t,forceMount:n,children:r,...s}=o,i=T(A,a),d=E(i.baseId,t),f=$(i.baseId,t),l=t===i.value,c=b.useRef(l);return b.useEffect(()=>{const p=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(p)},[]),u.jsx(S,{present:n||l,children:({present:p})=>u.jsx(g.div,{"data-state":l?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":d,hidden:!p,id:f,tabIndex:0,...s,ref:e,style:{...o.style,animationDuration:c.current?"0s":void 0},children:p&&r})})});R.displayName=A;function E(o,e){return`${o}-trigger-${e}`}function $(o,e){return`${o}-content-${e}`}var B=N,O=I,q=w,H=R;function W(o){const e=m.c(10);let a,t,n;e[0]!==o?({className:a,variant:n,...t}=o,e[0]=o,e[1]=a,e[2]=t,e[3]=n):(a=e[1],t=e[2],n=e[3]);const r=n===void 0?"pill":n;let s;e[4]!==a?(s=v("flex flex-col gap-2",a),e[4]=a,e[5]=s):s=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==r?(i=u.jsx(B,{"data-slot":"tabs","data-variant":r,className:s,...t}),e[6]=t,e[7]=s,e[8]=r,e[9]=i):i=e[9],i}const J=z(':scope > [data-slot="tabs-trigger"][data-state="active"]');function X(o){const e=m.c(17);let a,t,n,r;e[0]!==o?({className:t,variant:r,children:a,...n}=o,e[0]=o,e[1]=a,e[2]=t,e[3]=n,e[4]=r):(a=e[1],t=e[2],n=e[3],r=e[4]);const s=r||"pill",i=s!=="canvas",d=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background":"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center gap-1 rounded-full p-1";let f;e[5]!==t||e[6]!==d?(f=v("relative",d,t),e[5]=t,e[6]=d,e[7]=f):f=e[7];let l;e[8]!==s||e[9]!==i?(l=i&&u.jsx("span",{"aria-hidden":!0,ref:J,"data-slot":"tabs-indicator",className:v(G,s==="underline"?"bottom-[-1px] h-0.5 rounded-full bg-primary":"top-1 bottom-1 rounded-full bg-background shadow-[0_1px_2px_0_#0000000d] dark:bg-input/30")}),e[8]=s,e[9]=i,e[10]=l):l=e[10];let c;return e[11]!==a||e[12]!==s||e[13]!==n||e[14]!==f||e[15]!==l?(c=u.jsxs(O,{"data-slot":"tabs-list","data-variant":s,className:f,...n,children:[l,a]}),e[11]=a,e[12]=s,e[13]=n,e[14]=f,e[15]=l,e[16]=c):c=e[16],c}function Y(o){const e=m.c(11);let a,t,n;e[0]!==o?({className:a,variant:n,...t}=o,e[0]=o,e[1]=a,e[2]=t,e[3]=n):(a=e[1],t=e[2],n=e[3]);const r=n||"pill",s=r==="underline"?"relative z-10 flex items-center h-full px-3 text-sm whitespace-nowrap transition-colors text-muted-foreground hover:text-foreground data-[state=active]:text-foreground focus-ring disabled:pointer-events-none disabled:opacity-50":r==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"relative z-10 data-[state=active]:text-foreground hover:text-foreground focus-ring text-muted-foreground inline-flex h-7 flex-1 items-center justify-center gap-1.5 rounded-full px-3 text-sm font-medium whitespace-nowrap transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==s?(i=v(s,a),e[4]=a,e[5]=s,e[6]=i):i=e[6];let d;return e[7]!==r||e[8]!==t||e[9]!==i?(d=u.jsx(q,{"data-slot":"tabs-trigger","data-variant":r,className:i,...t}),e[7]=r,e[8]=t,e[9]=i,e[10]=d):d=e[10],d}function Z(o){const e=m.c(8);let a,t;e[0]!==o?({className:a,...t}=o,e[0]=o,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let n;e[3]!==a?(n=v("flex-1 outline-none h-full",a),e[3]=a,e[4]=n):n=e[4];let r;return e[5]!==t||e[6]!==n?(r=u.jsx(H,{"data-slot":"tabs-content",className:n,...t}),e[5]=t,e[6]=n,e[7]=r):r=e[7],r}export{Y as T,X as a,W as b,Z as c};