// @bun
import{Select as I,SelectContent as C,SelectItem as g,SelectTrigger as v,SelectValue as M}from"@contractspec/lib.ui-kit-web/ui/select";import*as W from"react";import{jsx as E,jsxs as L}from"react/jsx-runtime";function Y({title:q,subtitle:D,workspaceSelect:A,projectSelect:J,environmentSelect:z,stickyHeaderOffsetPx:Q,headerRight:U}){return E("div",{className:"sticky top-0 z-10 border-border border-b bg-card",style:{top:Q??0},children:L("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-3 px-4 py-3 md:flex-row md:items-center md:justify-between",children:[L("div",{className:"min-w-0",children:[L("div",{className:"flex items-center gap-2",children:[E("p",{className:"truncate font-semibold text-base",children:q}),D?E("p",{className:"hidden text-muted-foreground text-sm md:block",children:D}):null]}),L("div",{className:"mt-2 flex flex-wrap gap-2",children:[A?E(F,{select:A}):null,J?E(F,{select:J}):null,z?E(F,{select:z}):null]})]}),E("div",{className:"flex items-center justify-between gap-2 md:justify-end",children:U})]})})}function F({select:q}){let D=W.useId();return L("div",{className:"flex min-w-[220px] flex-col gap-1",children:[E("span",{id:D,className:"text-muted-foreground text-xs",children:q.label}),L(I,{value:q.value,onValueChange:q.onChange,children:[E(v,{"aria-labelledby":D,className:"w-full",children:E(M,{placeholder:q.placeholder??q.label})}),E(C,{children:q.options.map((A)=>E(g,{value:A.value,children:A.label},A.value))})]})]})}import{Sidebar as k,SidebarContent as p,SidebarFooter as h,SidebarHeader as m,SidebarMenu as b,SidebarMenuButton as P,SidebarMenuItem as H,SidebarRail as x}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{Settings as S}from"lucide-react";import{jsx as G,jsxs as Z}from"react/jsx-runtime";function _({modules:q,activeModuleId:D,onModuleChange:A,sidebarFooter:J}){return Z(k,{children:[G(x,{}),G(m,{}),G(p,{children:Z(b,{children:[q.map((z)=>G(H,{children:Z(P,{isActive:z.id===D,onClick:()=>A(z.id),children:[z.icon,G("span",{children:z.label}),z.badge!=null?G("span",{className:"ml-auto text-muted-foreground text-xs",children:String(z.badge)}):null]})},z.id)),G(H,{children:Z(P,{isActive:D==="settings",onClick:()=>A("settings"),children:[G(S,{className:"size-4"}),G("span",{children:"Settings"})]})})]})}),G(h,{children:J})]})}import{SidebarInset as u,SidebarProvider as j}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{cn as n}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as $,jsxs as w}from"react/jsx-runtime";function Eq({title:q,subtitle:D,workspaceSelect:A,projectSelect:J,environmentSelect:z,stickyHeaderOffsetPx:Q,headerRight:U,modules:T,activeModuleId:V,onModuleChange:B,sidebarFooter:y,assistant:N,children:X,className:O}){return w(j,{children:[$(_,{modules:T,activeModuleId:V,onModuleChange:B,sidebarFooter:y}),$(u,{children:w("div",{className:n("min-h-svh bg-background",O),children:[$(Y,{title:q,subtitle:D,workspaceSelect:A,projectSelect:J,environmentSelect:z,stickyHeaderOffsetPx:Q,headerRight:U}),$("main",{className:"m-4",children:X})]})}),N]})}import{BundleProvider as d,BundleRenderer as o}from"@contractspec/lib.surface-runtime/react";import{SidebarProvider as i}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{jsx as K}from"react/jsx-runtime";function Xq({plan:q,title:D,subtitle:A,workspaceSelect:J,projectSelect:z,environmentSelect:Q,stickyHeaderOffsetPx:U,headerRight:T,modules:V,activeModuleId:B,onModuleChange:y,sidebarFooter:N,assistant:X,children:O,className:f}){let R={header:K(Y,{title:D,subtitle:A,workspaceSelect:J,projectSelect:z,environmentSelect:Q,stickyHeaderOffsetPx:U,headerRight:T}),sidebar:K(_,{modules:V,activeModuleId:B,onModuleChange:y,sidebarFooter:N}),primary:K("main",{className:f?`m-4 ${f}`:"m-4",children:O})};if(X!=null)R.assistant=X;return K(i,{children:K(d,{plan:q,children:K("div",{className:"min-h-svh bg-background",children:K(o,{slotContent:R})})})})}export{_ as WorkspaceSidebar,Xq as WorkspaceShellRenderer,Eq as WorkspaceProjectShellLayout,Y as WorkspaceHeader};
