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