@rafal.lemieszewski/tide-ui 0.87.6 → 0.87.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),i=require("../fundamental/sidebar.cjs"),R=require("../fundamental/button.cjs"),p=require("../fundamental/icon.cjs"),d=require("lucide-react"),u=require("../fundamental/avatar.cjs"),F=require("../fundamental/separator.cjs"),V=require("../fundamental/kbd.cjs"),a=require("../fundamental/dropdown-menu.cjs"),c=require("../fundamental/tooltip.cjs"),h=require("../fundamental/command.cjs");function U(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const x in o)if(x!=="default"){const n=Object.getOwnPropertyDescriptor(o,x);Object.defineProperty(l,x,n.get?n:{enumerable:!0,get:()=>o[x]})}}return l.default=o,Object.freeze(l)}const g=U(E),G={name:"John Doe",email:"john@example.com",avatarUrl:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=32&h=32&fit=crop&crop=face"},P=[{name:"Acme Corp",role:"Admin",plan:"Enterprise",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"},{name:"Startup Inc",role:"Member",plan:"Pro",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"}],q={main:[{title:"Home",icon:d.House,url:"/home",isActive:!1},{title:"News",icon:d.Newspaper,url:"/news",isActive:!1},{title:"Boards",icon:d.LayoutDashboard,url:"/boards",isActive:!1}],operations:[{title:"Voyage economics",icon:d.Ship,url:"/freight-planner",isActive:!1,items:[]},{title:"Trade desk",icon:d.TrendingUp,url:"/trade-desk",isActive:!1,items:[]},{title:"Agreements",icon:d.ScrollText,url:"/agreements",isActive:!0,items:[{title:"Recaps",url:"/agreements/recaps",isActive:!0},{title:"Contracts",url:"/agreements/contracts",isActive:!1},{title:"Clause library",url:"/agreements/clause-library",isActive:!1}]},{title:"Compliance",icon:d.ShieldCheck,url:"/compliance",isActive:!1,items:[]}],intelligence:[{title:"Global market",icon:d.Globe,url:"/global-market",isActive:!1,items:[{title:"Supply",url:"/global-market/supply",isActive:!1},{title:"Commodities",url:"/global-market/commodities",isActive:!1},{title:"Freight",url:"/global-market/freight",isActive:!1}]},{title:"Assets",icon:d.Container,url:"/assets",isActive:!1,items:[{title:"Vessels",url:"/assets/vessels",isActive:!1},{title:"Fleets",url:"/assets/fleets",isActive:!1},{title:"Ports",url:"/assets/ports",isActive:!1},{title:"Chokepoints",url:"/assets/chokepoints",isActive:!1}]},{title:"Fixtures",icon:d.Anchor,url:"/fixtures",isActive:!1}],support:[{title:"Notifications",icon:d.Bell,url:"/notifications",isActive:!1},{title:"Help & support",icon:d.CircleHelp,url:"/help-support",isActive:!1}]},H=o=>o.split(" ").filter(Boolean).map(l=>l[0]).join("").slice(0,2).toUpperCase(),L=o=>o.split(" ").filter(Boolean).map(l=>l[0]).join("").slice(0,2).toUpperCase(),D=()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);function K(o,l){return o.reduce((x,n)=>{const b=l(n);return(x[b]??=[]).push(n),x},{})}function B(o){const l={};return[...o.main||[],...o.operations||[],...o.intelligence||[],...o.support||[]].forEach(n=>{if(n.items&&n.items.length>0){const b=n.items.some(v=>v.isActive);l[n.title]=b}}),l}function Z({navigationData:o,user:l,teams:x,onNavigate:n,navigationMode:b,onNavigationModeChange:v,onSearchChange:y,searchItems:j,searchLoading:k}){const[A,f]=g.useState(!1),[I,N]=g.useState(""),[C,M]=g.useState(()=>B(o)),[s,m]=g.useState(x[0]),S=r=>{M(t=>({...t,[r]:!t[r]}))},O=r=>r.items&&r.items.some(t=>t.isActive),z=r=>{if(r.items&&r.items.length>0){const t=r.items.find(w=>w.isActive);if(t)return`${r.title} → ${t.title}`}return r.title};return g.useEffect(()=>{const r=t=>{t.key==="k"&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),f(w=>!w))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[]),g.useEffect(()=>{M(B(o))},[o]),e.jsxs(c.TooltipProvider,{delayDuration:100,children:[e.jsxs(i.Sidebar,{variant:"sidebar",collapsible:"icon",className:"flex h-full flex-col",children:[e.jsx(i.SidebarHeader,{className:"sticky top-0 z-10 h-12 border-b border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2 box-border",children:e.jsx("div",{className:"flex h-[22px] w-7 items-center justify-center",children:e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"#005F85"})})})}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto group-data-[collapsible=icon]:overflow-hidden","data-sidebar":"content",children:[e.jsx("div",{className:"p-[var(--space-m)] pt-[var(--space-s)] group-data-[collapsible=icon]:px-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})}),e.jsxs("div",{className:"group-data-[collapsible=icon]:hidden",children:[e.jsx("button",{onClick:()=>f(!0),className:"text-body-md flex h-8 w-full cursor-pointer items-center rounded-m border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] px-3 py-1 pr-20 pl-8 text-left text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",children:"Search"}),e.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 gap-1",children:[e.jsx(V.Kbd,{size:"s",children:D()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",children:"K"})]})]}),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx("button",{onClick:()=>f(!0),className:"hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]","aria-label":"Search",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Search"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(V.Kbd,{size:"s",variant:"dark",children:D()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"K"})]})]})})]})]})}),e.jsx(i.SidebarGroup,{className:"pb-1 mt-1 p-[var(--space-s)]",children:e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.main.map(r=>e.jsx(i.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(F.Separator,{layout:"vertical"})}),e.jsxs(i.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(i.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Operations"}),e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.operations.map(r=>e.jsx(i.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(i.SidebarMenuSub,{children:r.items.map(t=>e.jsx(i.SidebarMenuSubItem,{children:e.jsx(i.SidebarMenuSubButton,{isActive:t.isActive,onClick:w=>{n&&(w.preventDefault(),n(t.url))},children:e.jsx("span",{children:t.title})})},t.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(i.SidebarMenuButton,{isActive:O(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(t=>e.jsx(a.DropdownMenuItem,{className:t.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{n&&n(t.url)},children:t.title},t.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(F.Separator,{layout:"vertical"})}),e.jsxs(i.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(i.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Intelligence"}),e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.intelligence.map(r=>e.jsx(i.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(i.SidebarMenuSub,{children:r.items.map(t=>e.jsx(i.SidebarMenuSubItem,{children:e.jsx(i.SidebarMenuSubButton,{isActive:t.isActive,onClick:w=>{n&&(w.preventDefault(),n(t.url))},children:e.jsx("span",{children:t.title})})},t.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(i.SidebarMenuButton,{isActive:O(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(t=>e.jsx(a.DropdownMenuItem,{className:t.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{n&&n(t.url)},children:t.title},t.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx(i.SidebarGroup,{className:"pb-2 p-[var(--space-s)] pt-[var(--space-l)] mt-auto",children:e.jsx(i.SidebarGroupContent,{children:e.jsx(i.SidebarMenu,{children:o.support.map(r=>e.jsx(i.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(i.SidebarMenuButton,{isActive:r.isActive,onClick:t=>{n&&(t.preventDefault(),n(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})})]}),e.jsx(i.SidebarFooter,{className:"sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2",children:e.jsx("div",{className:"group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none",children:e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsxs(R.Button,{variant:"ghost",className:"h-auto min-h-[56px] w-full justify-start rounded-m px-3 py-2 hover:!bg-[var(--color-background-neutral-subtlest-hovered)] group-data-[collapsible=icon]:h-8 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:w-8 group-data-[collapsible=icon]:p-0",children:[e.jsxs("div",{className:"flex w-full items-center gap-3 group-data-[collapsible=icon]:hidden",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs(u.Avatar,{size:"m",type:"user",children:[e.jsx(u.AvatarImage,{src:l.avatarUrl,alt:l.name}),e.jsx(u.AvatarFallback,{size:"m",type:"user",children:H(l.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]}),e.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[e.jsx("div",{className:"text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]",children:l.name}),e.jsxs("div",{className:"text-body-xsm text-[var(--color-text-secondary)]",children:[s.role," at ",s.name]})]}),e.jsx(p.Icon,{name:d.ChevronDown,size:"m",className:"opacity-50"})]}),e.jsxs("div",{className:"relative hidden group-data-[collapsible=icon]:block",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:l.avatarUrl,alt:l.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:H(l.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]})]})}),e.jsxs(a.DropdownMenuContent,{className:"w-[--radix-dropdown-menu-trigger-width]",align:"start",side:"top",sideOffset:4,children:[e.jsx(a.DropdownMenuLabel,{className:"p-0 font-normal",children:e.jsxs("div",{className:"flex items-center gap-3 px-2 py-2",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:l.avatarUrl,alt:l.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:H(l.name)})]}),e.jsxs("div",{className:"grid flex-1 text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:l.name}),e.jsx("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:l.email})]})]})}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Organizations"}),x.map(r=>e.jsxs(a.DropdownMenuItem,{onSelect:()=>m(r),className:"mx-1 mb-1 h-10 cursor-pointer gap-2 px-1 pr-2 pl-1",children:[e.jsxs(u.Avatar,{size:"s",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsxs("div",{className:"flex flex-1 flex-col text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:r.name}),e.jsxs("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:[r.role," • ",r.plan," plan"]})]}),s.name===r.name&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]},r.name)),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Navigation"}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-0.5 cursor-pointer gap-2 px-2",onSelect:()=>v("sidebar"),children:[e.jsx("span",{className:"flex-1",children:"New sidebar navigation"}),b==="sidebar"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-1 cursor-pointer gap-2 px-2",onSelect:()=>v("horizontal"),children:[e.jsx("span",{className:"flex-1",children:"Old horizontal menu"}),b==="horizontal"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.User,className:"cursor-pointer",onSelect:()=>{n&&n("/user/profile")},children:"User profile"}),e.jsx(a.DropdownMenuItem,{icon:d.Settings,className:"cursor-pointer",onSelect:()=>{n&&n("/organization/settings")},children:"Organization settings"}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.LogOut,destructive:!0,className:"cursor-pointer",onSelect:()=>{n&&n("/auth/sign-out")},children:"Sign out"})]})]})})}),e.jsx(i.SidebarRail,{})]}),e.jsxs(h.CommandDialog,{open:A,onOpenChange:f,commandProps:j&&j.length>0?{shouldFilter:!1}:void 0,children:[e.jsx(h.CommandInput,{placeholder:"Type a command or search...",value:I,onValueChange:r=>{N(r),y?.(r)},clearable:!1}),e.jsxs(h.CommandList,{children:[e.jsx(h.CommandEmpty,{children:"No results found."}),k&&e.jsx("div",{className:"py-[var(--space-m)] text-center text-body-sm text-[var(--color-text-tertiary)]",children:"Searching…"}),j&&j.length>0&&(()=>{const r=K(j,t=>t.group??"Results");return Object.entries(r).map(([t,w])=>e.jsx(h.CommandGroup,{heading:t,children:w.map(T=>e.jsxs(h.CommandItem,{value:T.id,onSelect:()=>{T.onSelect?.(),f(!1)},children:[T.icon&&e.jsx(p.Icon,{name:T.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:T.label})]},T.id))},t))})(),!j?.length&&e.jsxs(e.Fragment,{children:[e.jsxs(h.CommandGroup,{heading:"Quick actions",children:[e.jsxs(h.CommandItem,{onSelect:()=>console.log("Reload"),children:[e.jsx(p.Icon,{name:d.RotateCcw,size:"s",className:"mr-2"}),e.jsx("span",{children:"Reload Page"}),e.jsxs("span",{className:"text-caption-sm ml-auto text-[var(--color-text-tertiary)]",children:[D()?"⌘":"Ctrl","R"]})]}),e.jsxs(h.CommandItem,{onSelect:()=>f(!1),children:[e.jsx(p.Icon,{name:d.Search,size:"s",className:"mr-2"}),e.jsx("span",{children:"Search"}),e.jsxs("span",{className:"text-caption-sm ml-auto text-[var(--color-text-tertiary)]",children:[D()?"⌘":"Ctrl","K"]})]})]}),e.jsxs(h.CommandGroup,{heading:"Navigation",children:[o.main.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>f(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.operations.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>f(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.intelligence.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>f(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))]}),e.jsx(h.CommandGroup,{heading:"Settings",children:o.support.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>f(!1),children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))}),e.jsx(h.CommandGroup,{heading:"Switch team",children:x.map(r=>e.jsxs(h.CommandItem,{onSelect:()=>f(!1),children:[e.jsxs(u.Avatar,{size:"s",className:"mr-2",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsx("span",{children:r.name})]},r.name))})]})]})]})]})}function W({navigationData:o,user:l,activeTeam:x,onNavigate:n,navigationMode:b,onNavigationModeChange:v}){const[y,j]=g.useState(!1),k=g.useRef(null);g.useEffect(()=>{if(!y)return;const s=m=>{k.current&&!k.current.contains(m.target)&&j(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[y]);const A=[...o.main,...o.operations,...o.intelligence],f=A.find(s=>s.isActive||s.items?.some(m=>m.isActive))?.title??null,[I,N]=g.useState(f),C=A.find(s=>s.title===I)?.items??[],M=H(l.name);return e.jsxs("div",{style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",height:48,backgroundColor:"#162736",padding:"0 16px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("rect",{width:"20",height:"20",rx:"4",fill:"#005F85"}),e.jsx("rect",{x:"4",y:"4",width:"5",height:"5",rx:"1",fill:"white"}),e.jsx("rect",{x:"11",y:"4",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"4",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"11",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.4"})]}),e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"white"})})]}),e.jsx("div",{style:{flex:1}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("button",{onClick:()=>n?.("/notifications"),style:{background:"none",border:"none",cursor:"pointer",padding:6,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]})}),e.jsxs("div",{ref:k,style:{position:"relative"},children:[e.jsx("button",{onClick:()=>j(s=>!s),style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#005F85",color:"white",border:"2px solid rgba(255,255,255,0.3)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:600,padding:0},children:l.avatarUrl?e.jsx("img",{src:l.avatarUrl,alt:l.name,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):M}),y&&e.jsxs("div",{style:{position:"absolute",top:40,right:0,width:220,backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 24px rgba(0,0,0,0.15)",zIndex:9999,padding:"4px 0",fontSize:14},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{fontWeight:600,color:"#111827"},children:l.name}),e.jsx("div",{style:{fontSize:12,color:"#6b7280"},children:l.email})]}),e.jsxs("div",{style:{padding:"4px 0",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{padding:"4px 12px",fontSize:11,fontWeight:500,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Navigation"}),e.jsxs("button",{onClick:()=>{v("sidebar"),j(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"New sidebar navigation"}),b==="sidebar"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]}),e.jsxs("button",{onClick:()=>{v("horizontal"),j(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"Old horizontal menu"}),b==="horizontal"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]})]}),e.jsx("div",{style:{padding:"4px 0"},children:e.jsx("button",{onClick:()=>{n?.("/auth/sign-out"),j(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#dc2626",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#fef2f2"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:"Sign out"})})]})]})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",height:40,backgroundColor:"#1e3a4f",padding:"0 16px",gap:2,overflowX:"auto"},children:A.map(s=>{const m=s.isActive||(s.items?.some(S=>S.isActive)??!1);return e.jsx("button",{onClick:S=>{S.preventDefault(),N(s.title),n?.(s.url)},style:{padding:"6px 14px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:m?600:400,color:"white",backgroundColor:m?"#005F85":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:S=>{m||(S.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)")},onMouseLeave:S=>{m||(S.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title)})}),C.length>0&&e.jsx("div",{style:{display:"flex",alignItems:"center",height:36,backgroundColor:"#f0f5f8",padding:"0 16px",gap:2,borderBottom:"1px solid #d1dde6",overflowX:"auto"},children:C.map(s=>e.jsx("button",{onClick:m=>{m.preventDefault(),n?.(s.url)},style:{padding:"4px 12px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:s.isActive?600:400,color:s.isActive?"#005F85":"#374151",backgroundColor:s.isActive?"#dbeeff":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:m=>{s.isActive||(m.currentTarget.style.backgroundColor="#e5eef4")},onMouseLeave:m=>{s.isActive||(m.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title))})]})}function $(){const{state:o,toggleSidebar:l}=i.useSidebar(),x=o==="collapsed";return g.useEffect(()=>{const n=b=>{b.key==="["&&(b.preventDefault(),l())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[l]),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(i.SidebarTrigger,{className:"-ml-1"})}),e.jsx(c.TooltipContent,{side:"bottom",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x?"Expand sidebar":"Collapse sidebar"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"["})]})})]})}function _({navigationData:o=q,user:l=G,teams:x=P,defaultSidebarOpen:n=!0,headerContent:b,headerTabs:v,headerActions:y,children:j,onNavigate:k,onSearchChange:A,searchItems:f,searchLoading:I}){const[N,C]=g.useState("sidebar"),[M]=g.useState(x[0]);return N==="horizontal"?e.jsxs("div",{className:"h-screen overflow-hidden",style:{display:"flex",flexDirection:"column"},children:[e.jsx(W,{navigationData:o,user:l,activeTeam:M,onNavigate:k,navigationMode:N,onNavigationModeChange:C}),e.jsx("div",{style:{flex:1,overflow:"auto",minHeight:0,backgroundColor:"var(--color-surface-base)"},children:j})]}):e.jsx("div",{className:"h-screen overflow-hidden",children:e.jsxs(i.SidebarProvider,{defaultOpen:n,children:[e.jsx(Z,{navigationData:o,user:l,teams:x,onNavigate:k,navigationMode:N,onNavigationModeChange:C,onSearchChange:A,searchItems:f,searchLoading:I}),e.jsxs(i.SidebarInset,{children:[(b||y||v)&&e.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]",children:[e.jsx($,{}),e.jsx(F.Separator,{layout:"horizontal",className:"mr-2 h-4"}),e.jsx("div",{className:"flex-1 min-w-0",children:b}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[v&&e.jsx("div",{className:"flex items-center gap-2",children:v}),v&&y&&e.jsx("span",{className:"text-[var(--color-text-tertiary)] select-none","aria-hidden":!0,children:"•"}),y&&e.jsx("div",{className:"flex items-center gap-2",children:y})]})]}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto min-h-0 min-w-0",children:j})]})]})})}exports.AppFrame=_;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),l=require("../fundamental/sidebar.cjs"),U=require("../fundamental/button.cjs"),p=require("../fundamental/icon.cjs"),d=require("lucide-react"),u=require("../fundamental/avatar.cjs"),H=require("../fundamental/separator.cjs"),V=require("../fundamental/kbd.cjs"),a=require("../fundamental/dropdown-menu.cjs"),c=require("../fundamental/tooltip.cjs"),j=require("../fundamental/command.cjs");function R(o){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const x in o)if(x!=="default"){const t=Object.getOwnPropertyDescriptor(o,x);Object.defineProperty(n,x,t.get?t:{enumerable:!0,get:()=>o[x]})}}return n.default=o,Object.freeze(n)}const g=R(E),G={name:"John Doe",email:"john@example.com",avatarUrl:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=32&h=32&fit=crop&crop=face"},P=[{name:"Acme Corp",role:"Admin",plan:"Enterprise",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"},{name:"Startup Inc",role:"Member",plan:"Pro",avatarUrl:"https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"}],q={main:[{title:"Home",icon:d.House,url:"/home",isActive:!1},{title:"News",icon:d.Newspaper,url:"/news",isActive:!1},{title:"Boards",icon:d.LayoutDashboard,url:"/boards",isActive:!1}],operations:[{title:"Voyage economics",icon:d.Ship,url:"/freight-planner",isActive:!1,items:[]},{title:"Trade desk",icon:d.TrendingUp,url:"/trade-desk",isActive:!1,items:[]},{title:"Agreements",icon:d.ScrollText,url:"/agreements",isActive:!0,items:[{title:"Recaps",url:"/agreements/recaps",isActive:!0},{title:"Contracts",url:"/agreements/contracts",isActive:!1},{title:"Clause library",url:"/agreements/clause-library",isActive:!1}]},{title:"Compliance",icon:d.ShieldCheck,url:"/compliance",isActive:!1,items:[]}],intelligence:[{title:"Global market",icon:d.Globe,url:"/global-market",isActive:!1,items:[{title:"Supply",url:"/global-market/supply",isActive:!1},{title:"Commodities",url:"/global-market/commodities",isActive:!1},{title:"Freight",url:"/global-market/freight",isActive:!1}]},{title:"Assets",icon:d.Container,url:"/assets",isActive:!1,items:[{title:"Vessels",url:"/assets/vessels",isActive:!1},{title:"Fleets",url:"/assets/fleets",isActive:!1},{title:"Ports",url:"/assets/ports",isActive:!1},{title:"Chokepoints",url:"/assets/chokepoints",isActive:!1}]},{title:"Fixtures",icon:d.Anchor,url:"/fixtures",isActive:!1}],support:[{title:"Notifications",icon:d.Bell,url:"/notifications",isActive:!1},{title:"Help & support",icon:d.CircleHelp,url:"/help-support",isActive:!1}]},D=o=>o.split(" ").filter(Boolean).map(n=>n[0]).join("").slice(0,2).toUpperCase(),L=o=>o.split(" ").filter(Boolean).map(n=>n[0]).join("").slice(0,2).toUpperCase(),O=()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);function K(o,n){return o.reduce((x,t)=>{const m=n(t);return(x[m]??=[]).push(t),x},{})}function B(o){const n={};return[...o.main||[],...o.operations||[],...o.intelligence||[],...o.support||[]].forEach(t=>{if(t.items&&t.items.length>0){const m=t.items.some(v=>v.isActive);n[t.title]=m}}),n}function Z({navigationData:o,user:n,teams:x,onNavigate:t,navigationMode:m,onNavigationModeChange:v,onSearchChange:y,searchItems:b,searchLoading:k}){const[A,f]=g.useState(!1),[I,M]=g.useState(""),[C,N]=g.useState(()=>B(o)),[s,h]=g.useState(x[0]),S=r=>{N(i=>({...i,[r]:!i[r]}))},F=r=>r.items&&r.items.some(i=>i.isActive),z=r=>{if(r.items&&r.items.length>0){const i=r.items.find(w=>w.isActive);if(i)return`${r.title} → ${i.title}`}return r.title};return g.useEffect(()=>{const r=i=>{i.key==="k"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),f(w=>!w))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[]),g.useEffect(()=>{N(B(o))},[o]),e.jsxs(c.TooltipProvider,{delayDuration:100,children:[e.jsxs(l.Sidebar,{variant:"sidebar",collapsible:"icon",className:"flex h-full flex-col",children:[e.jsx(l.SidebarHeader,{className:"sticky top-0 z-10 h-12 border-b border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2 box-border",children:e.jsx("div",{className:"flex h-[22px] w-7 items-center justify-center",children:e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"#005F85"})})})}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto group-data-[collapsible=icon]:overflow-hidden","data-sidebar":"content",children:[e.jsx("div",{className:"p-[var(--space-m)] pt-[var(--space-s)] group-data-[collapsible=icon]:px-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})}),e.jsxs("div",{className:"group-data-[collapsible=icon]:hidden",children:[e.jsx("button",{onClick:()=>f(!0),className:"text-body-md flex h-8 w-full cursor-pointer items-center rounded-m border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] px-3 py-1 pr-20 pl-8 text-left text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",children:"Search"}),e.jsxs("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 gap-1",children:[e.jsx(V.Kbd,{size:"s",children:O()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",children:"K"})]})]}),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx("button",{onClick:()=>f(!0),className:"hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]","aria-label":"Search",children:e.jsx(p.Icon,{name:d.Search,size:"m",color:"tertiary"})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Search"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(V.Kbd,{size:"s",variant:"dark",children:O()?"⌘":"Ctrl"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"K"})]})]})})]})]})}),e.jsx(l.SidebarGroup,{className:"pb-1 mt-1 p-[var(--space-s)]",children:e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.main.map(r=>e.jsx(l.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(H.Separator,{layout:"vertical"})}),e.jsxs(l.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(l.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Operations"}),e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.operations.map(r=>e.jsx(l.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(l.SidebarMenuSub,{children:r.items.map(i=>e.jsx(l.SidebarMenuSubItem,{children:e.jsx(l.SidebarMenuSubButton,{isActive:i.isActive,onClick:w=>{t&&(w.preventDefault(),t(i.url))},children:e.jsx("span",{children:i.title})})},i.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l.SidebarMenuButton,{isActive:F(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(i=>e.jsx(a.DropdownMenuItem,{className:i.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{t&&t(i.url)},children:i.title},i.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx("div",{className:"my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex",children:e.jsx(H.Separator,{layout:"vertical"})}),e.jsxs(l.SidebarGroup,{className:"mt-1 p-[var(--space-s)]",children:[e.jsx(l.SidebarGroupLabel,{className:"py-1 pb-1.5 group-data-[collapsible=icon]:hidden",children:"Intelligence"}),e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.intelligence.map(r=>e.jsx(l.SidebarMenuItem,{children:r.items&&r.items.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive&&!r.items?.length,onClick:()=>S(r.title),children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title}),e.jsx(p.Icon,{name:d.ChevronRight,size:"s",className:`ml-auto transition-transform ${C[r.title]?"rotate-90":""}`})]})}),r.items&&r.items.length>0&&C[r.title]&&e.jsx(l.SidebarMenuSub,{children:r.items.map(i=>e.jsx(l.SidebarMenuSubItem,{children:e.jsx(l.SidebarMenuSubButton,{isActive:i.isActive,onClick:w=>{t&&(w.preventDefault(),t(i.url))},children:e.jsx("span",{children:i.title})})},i.title))}),e.jsx("div",{className:"hidden group-data-[collapsible=icon]:block",children:e.jsxs(a.DropdownMenu,{children:[e.jsxs(c.Tooltip,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l.SidebarMenuButton,{isActive:F(r),className:"w-full justify-center",children:e.jsx(p.Icon,{name:r.icon,size:"s"})})})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]}),e.jsxs(a.DropdownMenuContent,{side:"right",sideOffset:8,align:"start",children:[e.jsx(a.DropdownMenuLabel,{className:"text-body-medium-sm font-medium",children:r.title}),e.jsx(a.DropdownMenuSeparator,{}),r.items.map(i=>e.jsx(a.DropdownMenuItem,{className:i.isActive?"bg-[var(--color-background-blue-subtle-selected)] text-[var(--color-text-brand-bold)]":"",onSelect:()=>{t&&t(i.url)},children:i.title},i.title))]})]})})]}):e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})]}),e.jsx(l.SidebarGroup,{className:"pb-2 p-[var(--space-s)] pt-[var(--space-l)] mt-auto",children:e.jsx(l.SidebarGroupContent,{children:e.jsx(l.SidebarMenu,{children:o.support.map(r=>e.jsx(l.SidebarMenuItem,{children:e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsxs(l.SidebarMenuButton,{isActive:r.isActive,onClick:i=>{t&&(i.preventDefault(),t(r.url))},children:[e.jsx(p.Icon,{name:r.icon,size:"s"}),e.jsx("span",{children:r.title})]})}),e.jsx(c.TooltipContent,{side:"right",className:"hidden group-data-[collapsible=icon]:block",children:z(r)})]})},r.title))})})})]}),e.jsx(l.SidebarFooter,{className:"sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2",children:e.jsx("div",{className:"group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none",children:e.jsxs(a.DropdownMenu,{children:[e.jsx(a.DropdownMenuTrigger,{asChild:!0,children:e.jsxs(U.Button,{variant:"ghost",className:"h-auto min-h-[56px] w-full justify-start rounded-m px-3 py-2 hover:!bg-[var(--color-background-neutral-subtlest-hovered)] group-data-[collapsible=icon]:h-8 group-data-[collapsible=icon]:min-h-0 group-data-[collapsible=icon]:w-8 group-data-[collapsible=icon]:p-0",children:[e.jsxs("div",{className:"flex w-full items-center gap-3 group-data-[collapsible=icon]:hidden",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsxs(u.Avatar,{size:"m",type:"user",children:[e.jsx(u.AvatarImage,{src:n.avatarUrl,alt:n.name}),e.jsx(u.AvatarFallback,{size:"m",type:"user",children:D(n.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]}),e.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[e.jsx("div",{className:"text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]",children:n.name}),e.jsxs("div",{className:"text-body-xsm text-[var(--color-text-secondary)]",children:[s.role," at ",s.name]})]}),e.jsx(p.Icon,{name:d.ChevronDown,size:"m",className:"opacity-50"})]}),e.jsxs("div",{className:"relative hidden group-data-[collapsible=icon]:block",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:n.avatarUrl,alt:n.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:D(n.name)})]}),e.jsx("div",{className:"absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]",children:e.jsxs(u.Avatar,{size:"xxs",type:"organization",children:[e.jsx(u.AvatarImage,{src:s.avatarUrl,alt:s.name}),e.jsx(u.AvatarFallback,{size:"xxs",type:"organization",children:L(s.name)})]})})]})]})}),e.jsxs(a.DropdownMenuContent,{className:"w-[--radix-dropdown-menu-trigger-width]",align:"start",side:"top",sideOffset:4,children:[e.jsx(a.DropdownMenuLabel,{className:"p-0 font-normal",children:e.jsxs("div",{className:"flex items-center gap-3 px-2 py-2",children:[e.jsxs(u.Avatar,{size:"s",type:"user",children:[e.jsx(u.AvatarImage,{src:n.avatarUrl,alt:n.name}),e.jsx(u.AvatarFallback,{size:"s",type:"user",children:D(n.name)})]}),e.jsxs("div",{className:"grid flex-1 text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:n.name}),e.jsx("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:n.email})]})]})}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Organizations"}),x.map(r=>e.jsxs(a.DropdownMenuItem,{onSelect:()=>h(r),className:"mx-1 mb-1 h-10 cursor-pointer gap-2 px-1 pr-2 pl-1",children:[e.jsxs(u.Avatar,{size:"s",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsxs("div",{className:"flex flex-1 flex-col text-left",children:[e.jsx("span",{className:"text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]",children:r.name}),e.jsxs("span",{className:"text-caption-xsm truncate text-[var(--color-text-secondary)]",children:[r.role," • ",r.plan," plan"]})]}),s.name===r.name&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]},r.name)),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuLabel,{className:"px-2 py-1 text-[12px] font-medium text-[var(--color-text-tertiary)]",children:"Navigation"}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-0.5 cursor-pointer gap-2 px-2",onSelect:()=>v("sidebar"),children:[e.jsx("span",{className:"flex-1",children:"New sidebar navigation"}),m==="sidebar"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsxs(a.DropdownMenuItem,{className:"mx-1 mb-1 cursor-pointer gap-2 px-2",onSelect:()=>v("horizontal"),children:[e.jsx("span",{className:"flex-1",children:"Old horizontal menu"}),m==="horizontal"&&e.jsx(p.Icon,{name:d.Check,size:"m",className:"text-[var(--color-icon-brand-bold)]"})]}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.User,className:"cursor-pointer",onSelect:()=>{t&&t("/user/profile")},children:"User profile"}),e.jsx(a.DropdownMenuItem,{icon:d.Settings,className:"cursor-pointer",onSelect:()=>{t&&t("/organization/settings")},children:"Organization settings"}),e.jsx(a.DropdownMenuSeparator,{}),e.jsx(a.DropdownMenuItem,{icon:d.LogOut,destructive:!0,className:"cursor-pointer",onSelect:()=>{t&&t("/auth/sign-out")},children:"Sign out"})]})]})})}),e.jsx(l.SidebarRail,{})]}),e.jsxs(j.CommandDialog,{open:A,onOpenChange:f,commandProps:b&&b.length>0?{shouldFilter:!1}:void 0,children:[e.jsx(j.CommandInput,{placeholder:"Type a command or search...",value:I,onValueChange:r=>{M(r),y?.(r)},clearable:!1}),e.jsxs(j.CommandList,{children:[e.jsx(j.CommandEmpty,{children:"No results found."}),k&&e.jsx("div",{className:"py-[var(--space-m)] text-center text-body-sm text-[var(--color-text-tertiary)]",children:"Searching…"}),b&&b.length>0&&(()=>{const r=K(b,i=>i.group??"Results");return Object.entries(r).map(([i,w])=>e.jsx(j.CommandGroup,{heading:i,children:w.map(T=>e.jsxs(j.CommandItem,{value:T.id,onSelect:()=>{T.onSelect?.(),f(!1)},children:[T.icon&&e.jsx(p.Icon,{name:T.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:T.label})]},T.id))},i))})(),!b?.length&&e.jsxs(e.Fragment,{children:[e.jsxs(j.CommandGroup,{heading:"Navigation",children:[o.main.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.operations.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title)),o.intelligence.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))]}),e.jsx(j.CommandGroup,{heading:"Settings",children:o.support.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>{t?.(r.url),f(!1)},children:[e.jsx(p.Icon,{name:r.icon,size:"s",className:"mr-2"}),e.jsx("span",{children:r.title})]},r.title))}),e.jsx(j.CommandGroup,{heading:"Switch team",children:x.map(r=>e.jsxs(j.CommandItem,{onSelect:()=>f(!1),children:[e.jsxs(u.Avatar,{size:"s",className:"mr-2",type:"organization",children:[e.jsx(u.AvatarImage,{src:r.avatarUrl,alt:r.name}),e.jsx(u.AvatarFallback,{size:"s",type:"organization",children:L(r.name)})]}),e.jsx("span",{children:r.name})]},r.name))})]})]})]})]})}function W({navigationData:o,user:n,activeTeam:x,onNavigate:t,navigationMode:m,onNavigationModeChange:v}){const[y,b]=g.useState(!1),k=g.useRef(null);g.useEffect(()=>{if(!y)return;const s=h=>{k.current&&!k.current.contains(h.target)&&b(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[y]);const A=[...o.main,...o.operations,...o.intelligence],f=A.find(s=>s.isActive||s.items?.some(h=>h.isActive))?.title??null,[I,M]=g.useState(f),C=A.find(s=>s.title===I)?.items??[],N=D(n.name);return e.jsxs("div",{style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",height:48,backgroundColor:"#162736",padding:"0 16px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("rect",{width:"20",height:"20",rx:"4",fill:"#005F85"}),e.jsx("rect",{x:"4",y:"4",width:"5",height:"5",rx:"1",fill:"white"}),e.jsx("rect",{x:"11",y:"4",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"4",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.6"}),e.jsx("rect",{x:"11",y:"11",width:"5",height:"5",rx:"1",fill:"white",opacity:"0.4"})]}),e.jsx("svg",{width:"28",height:"22",viewBox:"0 0 28 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.39355 0.688477C6.89528 0.688477 8.12094 1.67409 8.12109 3.74609V7.69043H5.5332V2.87695H3.28711V8.03125L8.12109 11.458V18.2705C8.12109 20.3262 6.92916 21.3125 4.39355 21.3125C1.85827 21.3124 0.701172 20.3261 0.701172 18.2705L0.700195 13.7412H3.28711V19.1396H5.5332V12.6777L0.701172 9.23438V3.74609C0.701322 1.67422 1.89214 0.688597 4.39355 0.688477ZM13.8379 0.6875C16.4752 0.687615 17.6152 1.67395 17.6152 3.74609V10.5312L12.6113 13.7236V19.123H15.0273V14.3096H17.6143V18.2705C17.6143 20.3262 16.4235 21.3125 13.8027 21.3125C11.1821 21.3125 10.0244 20.3262 10.0244 18.2705V3.74609H10.0254C10.0254 1.67382 11.2003 0.6875 13.8379 0.6875ZM23.333 0.6875C25.9537 0.6875 27.1113 1.67378 27.1113 3.72949V18.2539H27.1104C27.1104 20.3261 25.9363 21.3125 23.2988 21.3125C20.6612 21.3125 19.5205 20.3262 19.5205 18.2539V11.4688L24.5254 8.27637V2.87695H22.1084V7.69043H19.5215V3.72949C19.5215 1.67384 20.7124 0.687556 23.333 0.6875ZM22.1084 12.2197V19.1396H24.5254V10.5986L22.1084 12.2197ZM12.6113 11.4014L15.0273 9.78027V2.86035H12.6113V11.4014Z",fill:"white"})})]}),e.jsx("div",{style:{flex:1}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("button",{onClick:()=>t?.("/notifications"),style:{background:"none",border:"none",cursor:"pointer",padding:6,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]})}),e.jsxs("div",{ref:k,style:{position:"relative"},children:[e.jsx("button",{onClick:()=>b(s=>!s),style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#005F85",color:"white",border:"2px solid rgba(255,255,255,0.3)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:600,padding:0},children:n.avatarUrl?e.jsx("img",{src:n.avatarUrl,alt:n.name,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):N}),y&&e.jsxs("div",{style:{position:"absolute",top:40,right:0,width:220,backgroundColor:"white",borderRadius:8,boxShadow:"0 4px 24px rgba(0,0,0,0.15)",zIndex:9999,padding:"4px 0",fontSize:14},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{fontWeight:600,color:"#111827"},children:n.name}),e.jsx("div",{style:{fontSize:12,color:"#6b7280"},children:n.email})]}),e.jsxs("div",{style:{padding:"4px 0",borderBottom:"1px solid #e5e7eb"},children:[e.jsx("div",{style:{padding:"4px 12px",fontSize:11,fontWeight:500,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Navigation"}),e.jsxs("button",{onClick:()=>{v("sidebar"),b(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"New sidebar navigation"}),m==="sidebar"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]}),e.jsxs("button",{onClick:()=>{v("horizontal"),b(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#374151",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#f3f4f6"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{style:{flex:1},children:"Old horizontal menu"}),m==="horizontal"&&e.jsx("span",{style:{color:"#005F85",fontWeight:700},children:"✓"})]})]}),e.jsx("div",{style:{padding:"4px 0"},children:e.jsx("button",{onClick:()=>{t?.("/auth/sign-out"),b(!1)},style:{display:"flex",alignItems:"center",width:"100%",padding:"6px 12px",background:"none",border:"none",cursor:"pointer",fontSize:14,color:"#dc2626",textAlign:"left"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="#fef2f2"},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent"},children:"Sign out"})})]})]})]})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",height:40,backgroundColor:"#1e3a4f",padding:"0 16px",gap:2,overflowX:"auto"},children:A.map(s=>{const h=s.isActive||(s.items?.some(S=>S.isActive)??!1);return e.jsx("button",{onClick:S=>{S.preventDefault(),M(s.title),t?.(s.url)},style:{padding:"6px 14px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:h?600:400,color:"white",backgroundColor:h?"#005F85":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:S=>{h||(S.currentTarget.style.backgroundColor="rgba(255,255,255,0.1)")},onMouseLeave:S=>{h||(S.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title)})}),C.length>0&&e.jsx("div",{style:{display:"flex",alignItems:"center",height:36,backgroundColor:"#f0f5f8",padding:"0 16px",gap:2,borderBottom:"1px solid #d1dde6",overflowX:"auto"},children:C.map(s=>e.jsx("button",{onClick:h=>{h.preventDefault(),t?.(s.url)},style:{padding:"4px 12px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:s.isActive?600:400,color:s.isActive?"#005F85":"#374151",backgroundColor:s.isActive?"#dbeeff":"transparent",whiteSpace:"nowrap",transition:"background-color 0.15s"},onMouseEnter:h=>{s.isActive||(h.currentTarget.style.backgroundColor="#e5eef4")},onMouseLeave:h=>{s.isActive||(h.currentTarget.style.backgroundColor="transparent")},children:s.title},s.title))})]})}function $(){const{state:o,toggleSidebar:n}=l.useSidebar(),x=o==="collapsed";return g.useEffect(()=>{const t=m=>{m.key==="["&&(m.preventDefault(),n())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n]),e.jsxs(c.Tooltip,{delayDuration:500,children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(l.SidebarTrigger,{className:"-ml-1"})}),e.jsx(c.TooltipContent,{side:"bottom",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:x?"Expand sidebar":"Collapse sidebar"}),e.jsx(V.Kbd,{size:"s",variant:"dark",children:"["})]})})]})}function _({navigationData:o=q,user:n=G,teams:x=P,defaultSidebarOpen:t=!0,headerContent:m,headerTabs:v,headerActions:y,children:b,onNavigate:k,onSearchChange:A,searchItems:f,searchLoading:I}){const[M,C]=g.useState("sidebar"),[N]=g.useState(x[0]);return M==="horizontal"?e.jsxs("div",{className:"h-screen overflow-hidden",style:{display:"flex",flexDirection:"column"},children:[e.jsx(W,{navigationData:o,user:n,activeTeam:N,onNavigate:k,navigationMode:M,onNavigationModeChange:C}),e.jsx("div",{style:{flex:1,overflow:"auto",minHeight:0,backgroundColor:"var(--color-surface-base)"},children:b})]}):e.jsx("div",{className:"h-screen overflow-hidden",children:e.jsxs(l.SidebarProvider,{defaultOpen:t,children:[e.jsx(Z,{navigationData:o,user:n,teams:x,onNavigate:k,navigationMode:M,onNavigationModeChange:C,onSearchChange:A,searchItems:f,searchLoading:I}),e.jsxs(l.SidebarInset,{children:[(m||y||v)&&e.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]",children:[e.jsx($,{}),e.jsx(H.Separator,{layout:"horizontal",className:"mr-2 h-4"}),e.jsx("div",{className:"flex-1 min-w-0",children:m}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[v&&e.jsx("div",{className:"flex items-center gap-2",children:v}),v&&y&&e.jsx("span",{className:"text-[var(--color-text-tertiary)] select-none","aria-hidden":!0,children:"•"}),y&&e.jsx("div",{className:"flex items-center gap-2",children:y})]})]}),e.jsx("div",{className:"flex flex-1 flex-col overflow-auto min-h-0 min-w-0",children:b})]})]})})}exports.AppFrame=_;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as l, jsx as e, Fragment as G } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
|
-
import { SidebarProvider as
|
|
3
|
+
import { SidebarProvider as ae, SidebarInset as se, Sidebar as ce, SidebarHeader as de, SidebarGroup as F, SidebarGroupContent as B, SidebarMenu as I, SidebarMenuItem as P, SidebarMenuButton as C, SidebarGroupLabel as _, SidebarMenuSub as ee, SidebarMenuSubItem as re, SidebarMenuSubButton as le, SidebarFooter as pe, SidebarRail as he, useSidebar as ue, SidebarTrigger as me } from "../fundamental/sidebar.js";
|
|
4
4
|
import { Button as fe } from "../fundamental/button.js";
|
|
5
5
|
import { Icon as s } from "../fundamental/icon.js";
|
|
6
|
-
import { Bell as be, CircleHelp as ge, Globe as ve, Container as xe, Anchor as ye, Ship as Ce, TrendingUp as we, ScrollText as ke, ShieldCheck as Se, House as Ne, Newspaper as ze, LayoutDashboard as Ae, Search as
|
|
7
|
-
import { Avatar as
|
|
8
|
-
import { Separator as
|
|
9
|
-
import { Kbd as
|
|
10
|
-
import { DropdownMenu as
|
|
11
|
-
import { TooltipProvider as
|
|
12
|
-
import { CommandDialog as
|
|
13
|
-
const
|
|
6
|
+
import { Bell as be, CircleHelp as ge, Globe as ve, Container as xe, Anchor as ye, Ship as Ce, TrendingUp as we, ScrollText as ke, ShieldCheck as Se, House as Ne, Newspaper as ze, LayoutDashboard as Ae, Search as ie, ChevronRight as te, ChevronDown as Me, Check as $, User as Ve, Settings as Le, LogOut as Te } from "lucide-react";
|
|
7
|
+
import { Avatar as M, AvatarImage as V, AvatarFallback as L } from "../fundamental/avatar.js";
|
|
8
|
+
import { Separator as Q } from "../fundamental/separator.js";
|
|
9
|
+
import { Kbd as D } from "../fundamental/kbd.js";
|
|
10
|
+
import { DropdownMenu as X, DropdownMenuTrigger as J, DropdownMenuContent as q, DropdownMenuLabel as O, DropdownMenuSeparator as U, DropdownMenuItem as w } from "../fundamental/dropdown-menu.js";
|
|
11
|
+
import { TooltipProvider as He, Tooltip as k, TooltipTrigger as S, TooltipContent as N } from "../fundamental/tooltip.js";
|
|
12
|
+
import { CommandDialog as Ee, CommandInput as Ue, CommandList as Re, CommandEmpty as je, CommandGroup as Z, CommandItem as R } from "../fundamental/command.js";
|
|
13
|
+
const Oe = {
|
|
14
14
|
name: "John Doe",
|
|
15
15
|
email: "john@example.com",
|
|
16
16
|
avatarUrl: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=32&h=32&fit=crop&crop=face"
|
|
17
|
-
},
|
|
17
|
+
}, De = [
|
|
18
18
|
{
|
|
19
19
|
name: "Acme Corp",
|
|
20
20
|
role: "Admin",
|
|
@@ -27,7 +27,7 @@ const De = {
|
|
|
27
27
|
plan: "Pro",
|
|
28
28
|
avatarUrl: "https://useful-toucan-91.convex.cloud/api/storage/5e36a31d-3f0a-4bb0-95db-f5b1c8e8af93"
|
|
29
29
|
}
|
|
30
|
-
],
|
|
30
|
+
], Fe = {
|
|
31
31
|
main: [
|
|
32
32
|
{
|
|
33
33
|
title: "Home",
|
|
@@ -139,36 +139,36 @@ const De = {
|
|
|
139
139
|
isActive: !1
|
|
140
140
|
}
|
|
141
141
|
]
|
|
142
|
-
},
|
|
143
|
-
function
|
|
144
|
-
return
|
|
145
|
-
const d =
|
|
142
|
+
}, K = (a) => a.split(" ").filter(Boolean).map((o) => o[0]).join("").slice(0, 2).toUpperCase(), W = (a) => a.split(" ").filter(Boolean).map((o) => o[0]).join("").slice(0, 2).toUpperCase(), ne = () => typeof navigator < "u" && /Mac|iPod|iPhone|iPad/.test(navigator.userAgent);
|
|
143
|
+
function Be(a, o) {
|
|
144
|
+
return a.reduce((u, n) => {
|
|
145
|
+
const d = o(n);
|
|
146
146
|
return (u[d] ??= []).push(n), u;
|
|
147
147
|
}, {});
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
149
|
+
function oe(a) {
|
|
150
|
+
const o = {};
|
|
151
151
|
return [
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
...
|
|
155
|
-
...
|
|
152
|
+
...a.main || [],
|
|
153
|
+
...a.operations || [],
|
|
154
|
+
...a.intelligence || [],
|
|
155
|
+
...a.support || []
|
|
156
156
|
].forEach((n) => {
|
|
157
157
|
if (n.items && n.items.length > 0) {
|
|
158
158
|
const d = n.items.some((f) => f.isActive);
|
|
159
|
-
|
|
159
|
+
o[n.title] = d;
|
|
160
160
|
}
|
|
161
|
-
}),
|
|
161
|
+
}), o;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
const [
|
|
165
|
-
() =>
|
|
163
|
+
function Ie({ navigationData: a, user: o, teams: u, onNavigate: n, navigationMode: d, onNavigationModeChange: f, onSearchChange: b, searchItems: p, searchLoading: y }) {
|
|
164
|
+
const [z, h] = m.useState(!1), [j, A] = m.useState(""), [g, T] = m.useState(
|
|
165
|
+
() => oe(a)
|
|
166
166
|
), [i, c] = m.useState(u[0]), v = (r) => {
|
|
167
|
-
|
|
167
|
+
T((t) => ({
|
|
168
168
|
...t,
|
|
169
169
|
[r]: !t[r]
|
|
170
170
|
}));
|
|
171
|
-
},
|
|
171
|
+
}, Y = (r) => r.items && r.items.some((t) => t.isActive), H = (r) => {
|
|
172
172
|
if (r.items && r.items.length > 0) {
|
|
173
173
|
const t = r.items.find((x) => x.isActive);
|
|
174
174
|
if (t)
|
|
@@ -182,8 +182,8 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
182
182
|
};
|
|
183
183
|
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
184
184
|
}, []), m.useEffect(() => {
|
|
185
|
-
|
|
186
|
-
}, [
|
|
185
|
+
T(oe(a));
|
|
186
|
+
}, [a]), /* @__PURE__ */ l(He, { delayDuration: 100, children: [
|
|
187
187
|
/* @__PURE__ */ l(ce, { variant: "sidebar", collapsible: "icon", className: "flex h-full flex-col", children: [
|
|
188
188
|
/* @__PURE__ */ e(de, { className: "sticky top-0 z-10 h-12 border-b border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:flex group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2 box-border", children: /* @__PURE__ */ e("div", { className: "flex h-[22px] w-7 items-center justify-center", children: /* @__PURE__ */ e(
|
|
189
189
|
"svg",
|
|
@@ -209,7 +209,7 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
209
209
|
"data-sidebar": "content",
|
|
210
210
|
children: [
|
|
211
211
|
/* @__PURE__ */ e("div", { className: "p-[var(--space-m)] pt-[var(--space-s)] group-data-[collapsible=icon]:px-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
212
|
-
/* @__PURE__ */ e("div", { className: "absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ e(s, { name:
|
|
212
|
+
/* @__PURE__ */ e("div", { className: "absolute top-1/2 left-2 -translate-y-1/2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ e(s, { name: ie, size: "m", color: "tertiary" }) }),
|
|
213
213
|
/* @__PURE__ */ l("div", { className: "group-data-[collapsible=icon]:hidden", children: [
|
|
214
214
|
/* @__PURE__ */ e(
|
|
215
215
|
"button",
|
|
@@ -220,31 +220,31 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
222
|
/* @__PURE__ */ l("div", { className: "absolute top-1/2 right-2 flex -translate-y-1/2 gap-1", children: [
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
-
/* @__PURE__ */ e(
|
|
223
|
+
/* @__PURE__ */ e(D, { size: "s", children: ne() ? "⌘" : "Ctrl" }),
|
|
224
|
+
/* @__PURE__ */ e(D, { size: "s", children: "K" })
|
|
225
225
|
] })
|
|
226
226
|
] }),
|
|
227
|
-
/* @__PURE__ */ l(
|
|
228
|
-
/* @__PURE__ */ e(
|
|
227
|
+
/* @__PURE__ */ l(k, { delayDuration: 500, children: [
|
|
228
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
229
229
|
"button",
|
|
230
230
|
{
|
|
231
231
|
onClick: () => h(!0),
|
|
232
232
|
className: "hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:!bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)]/20 focus:ring-offset-0 focus:outline-none active:border-[var(--color-border-primary-medium)]",
|
|
233
233
|
"aria-label": "Search",
|
|
234
|
-
children: /* @__PURE__ */ e(s, { name:
|
|
234
|
+
children: /* @__PURE__ */ e(s, { name: ie, size: "m", color: "tertiary" })
|
|
235
235
|
}
|
|
236
236
|
) }),
|
|
237
|
-
/* @__PURE__ */ e(
|
|
237
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
238
238
|
/* @__PURE__ */ e("span", { children: "Search" }),
|
|
239
239
|
/* @__PURE__ */ l("div", { className: "flex gap-1", children: [
|
|
240
|
-
/* @__PURE__ */ e(
|
|
241
|
-
/* @__PURE__ */ e(
|
|
240
|
+
/* @__PURE__ */ e(D, { size: "s", variant: "dark", children: ne() ? "⌘" : "Ctrl" }),
|
|
241
|
+
/* @__PURE__ */ e(D, { size: "s", variant: "dark", children: "K" })
|
|
242
242
|
] })
|
|
243
243
|
] }) })
|
|
244
244
|
] })
|
|
245
245
|
] }) }),
|
|
246
|
-
/* @__PURE__ */ e(
|
|
247
|
-
/* @__PURE__ */ e(
|
|
246
|
+
/* @__PURE__ */ e(F, { className: "pb-1 mt-1 p-[var(--space-s)]", children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.main.map((r) => /* @__PURE__ */ e(P, { children: /* @__PURE__ */ l(k, { children: [
|
|
247
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
|
|
248
248
|
C,
|
|
249
249
|
{
|
|
250
250
|
isActive: r.isActive,
|
|
@@ -257,12 +257,12 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
257
257
|
]
|
|
258
258
|
}
|
|
259
259
|
) }),
|
|
260
|
-
/* @__PURE__ */ e(
|
|
260
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
261
261
|
] }) }, r.title)) }) }) }),
|
|
262
|
-
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(
|
|
263
|
-
/* @__PURE__ */ l(
|
|
264
|
-
/* @__PURE__ */ e(
|
|
265
|
-
/* @__PURE__ */ e(
|
|
262
|
+
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, { layout: "vertical" }) }),
|
|
263
|
+
/* @__PURE__ */ l(F, { className: "mt-1 p-[var(--space-s)]", children: [
|
|
264
|
+
/* @__PURE__ */ e(_, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Operations" }),
|
|
265
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.operations.map((r) => /* @__PURE__ */ e(P, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(G, { children: [
|
|
266
266
|
/* @__PURE__ */ e("div", { className: "group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ l(
|
|
267
267
|
C,
|
|
268
268
|
{
|
|
@@ -274,7 +274,7 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
274
274
|
/* @__PURE__ */ e(
|
|
275
275
|
s,
|
|
276
276
|
{
|
|
277
|
-
name:
|
|
277
|
+
name: te,
|
|
278
278
|
size: "s",
|
|
279
279
|
className: `ml-auto transition-transform ${g[r.title] ? "rotate-90" : ""}`
|
|
280
280
|
}
|
|
@@ -282,8 +282,8 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
282
282
|
]
|
|
283
283
|
}
|
|
284
284
|
) }),
|
|
285
|
-
r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(
|
|
286
|
-
|
|
285
|
+
r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(ee, { children: r.items.map((t) => /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(
|
|
286
|
+
le,
|
|
287
287
|
{
|
|
288
288
|
isActive: t.isActive,
|
|
289
289
|
onClick: (x) => {
|
|
@@ -292,19 +292,19 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
292
292
|
children: /* @__PURE__ */ e("span", { children: t.title })
|
|
293
293
|
}
|
|
294
294
|
) }, t.title)) }),
|
|
295
|
-
/* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(
|
|
296
|
-
/* @__PURE__ */ l(
|
|
297
|
-
/* @__PURE__ */ e(
|
|
295
|
+
/* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(X, { children: [
|
|
296
|
+
/* @__PURE__ */ l(k, { children: [
|
|
297
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
298
298
|
C,
|
|
299
299
|
{
|
|
300
|
-
isActive:
|
|
300
|
+
isActive: Y(r),
|
|
301
301
|
className: "w-full justify-center",
|
|
302
302
|
children: /* @__PURE__ */ e(s, { name: r.icon, size: "s" })
|
|
303
303
|
}
|
|
304
304
|
) }) }),
|
|
305
|
-
/* @__PURE__ */ e(
|
|
305
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
306
306
|
] }),
|
|
307
|
-
/* @__PURE__ */ l(
|
|
307
|
+
/* @__PURE__ */ l(q, { side: "right", sideOffset: 8, align: "start", children: [
|
|
308
308
|
/* @__PURE__ */ e(O, { className: "text-body-medium-sm font-medium", children: r.title }),
|
|
309
309
|
/* @__PURE__ */ e(U, {}),
|
|
310
310
|
r.items.map((t) => /* @__PURE__ */ e(
|
|
@@ -320,8 +320,8 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
320
320
|
))
|
|
321
321
|
] })
|
|
322
322
|
] }) })
|
|
323
|
-
] }) : /* @__PURE__ */ l(
|
|
324
|
-
/* @__PURE__ */ e(
|
|
323
|
+
] }) : /* @__PURE__ */ l(k, { children: [
|
|
324
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
|
|
325
325
|
C,
|
|
326
326
|
{
|
|
327
327
|
isActive: r.isActive,
|
|
@@ -334,13 +334,13 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
334
334
|
]
|
|
335
335
|
}
|
|
336
336
|
) }),
|
|
337
|
-
/* @__PURE__ */ e(
|
|
337
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
338
338
|
] }) }, r.title)) }) })
|
|
339
339
|
] }),
|
|
340
|
-
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(
|
|
341
|
-
/* @__PURE__ */ l(
|
|
342
|
-
/* @__PURE__ */ e(
|
|
343
|
-
/* @__PURE__ */ e(
|
|
340
|
+
/* @__PURE__ */ e("div", { className: "my-2 hidden justify-center px-2 group-data-[collapsible=icon]:flex", children: /* @__PURE__ */ e(Q, { layout: "vertical" }) }),
|
|
341
|
+
/* @__PURE__ */ l(F, { className: "mt-1 p-[var(--space-s)]", children: [
|
|
342
|
+
/* @__PURE__ */ e(_, { className: "py-1 pb-1.5 group-data-[collapsible=icon]:hidden", children: "Intelligence" }),
|
|
343
|
+
/* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.intelligence.map((r) => /* @__PURE__ */ e(P, { children: r.items && r.items.length > 0 ? /* @__PURE__ */ l(G, { children: [
|
|
344
344
|
/* @__PURE__ */ e("div", { className: "group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ l(
|
|
345
345
|
C,
|
|
346
346
|
{
|
|
@@ -352,7 +352,7 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
352
352
|
/* @__PURE__ */ e(
|
|
353
353
|
s,
|
|
354
354
|
{
|
|
355
|
-
name:
|
|
355
|
+
name: te,
|
|
356
356
|
size: "s",
|
|
357
357
|
className: `ml-auto transition-transform ${g[r.title] ? "rotate-90" : ""}`
|
|
358
358
|
}
|
|
@@ -360,8 +360,8 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
360
360
|
]
|
|
361
361
|
}
|
|
362
362
|
) }),
|
|
363
|
-
r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(
|
|
364
|
-
|
|
363
|
+
r.items && r.items.length > 0 && g[r.title] && /* @__PURE__ */ e(ee, { children: r.items.map((t) => /* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(
|
|
364
|
+
le,
|
|
365
365
|
{
|
|
366
366
|
isActive: t.isActive,
|
|
367
367
|
onClick: (x) => {
|
|
@@ -370,19 +370,19 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
370
370
|
children: /* @__PURE__ */ e("span", { children: t.title })
|
|
371
371
|
}
|
|
372
372
|
) }, t.title)) }),
|
|
373
|
-
/* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(
|
|
374
|
-
/* @__PURE__ */ l(
|
|
375
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e("div", { className: "hidden group-data-[collapsible=icon]:block", children: /* @__PURE__ */ l(X, { children: [
|
|
374
|
+
/* @__PURE__ */ l(k, { children: [
|
|
375
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
376
376
|
C,
|
|
377
377
|
{
|
|
378
|
-
isActive:
|
|
378
|
+
isActive: Y(r),
|
|
379
379
|
className: "w-full justify-center",
|
|
380
380
|
children: /* @__PURE__ */ e(s, { name: r.icon, size: "s" })
|
|
381
381
|
}
|
|
382
382
|
) }) }),
|
|
383
|
-
/* @__PURE__ */ e(
|
|
383
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
384
384
|
] }),
|
|
385
|
-
/* @__PURE__ */ l(
|
|
385
|
+
/* @__PURE__ */ l(q, { side: "right", sideOffset: 8, align: "start", children: [
|
|
386
386
|
/* @__PURE__ */ e(O, { className: "text-body-medium-sm font-medium", children: r.title }),
|
|
387
387
|
/* @__PURE__ */ e(U, {}),
|
|
388
388
|
r.items.map((t) => /* @__PURE__ */ e(
|
|
@@ -398,8 +398,8 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
398
398
|
))
|
|
399
399
|
] })
|
|
400
400
|
] }) })
|
|
401
|
-
] }) : /* @__PURE__ */ l(
|
|
402
|
-
/* @__PURE__ */ e(
|
|
401
|
+
] }) : /* @__PURE__ */ l(k, { children: [
|
|
402
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
|
|
403
403
|
C,
|
|
404
404
|
{
|
|
405
405
|
isActive: r.isActive,
|
|
@@ -412,11 +412,11 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
412
412
|
]
|
|
413
413
|
}
|
|
414
414
|
) }),
|
|
415
|
-
/* @__PURE__ */ e(
|
|
415
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
416
416
|
] }) }, r.title)) }) })
|
|
417
417
|
] }),
|
|
418
|
-
/* @__PURE__ */ e(
|
|
419
|
-
/* @__PURE__ */ e(
|
|
418
|
+
/* @__PURE__ */ e(F, { className: "pb-2 p-[var(--space-s)] pt-[var(--space-l)] mt-auto", children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(I, { children: a.support.map((r) => /* @__PURE__ */ e(P, { children: /* @__PURE__ */ l(k, { children: [
|
|
419
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ l(
|
|
420
420
|
C,
|
|
421
421
|
{
|
|
422
422
|
isActive: r.isActive,
|
|
@@ -429,13 +429,13 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
429
429
|
]
|
|
430
430
|
}
|
|
431
431
|
) }),
|
|
432
|
-
/* @__PURE__ */ e(
|
|
432
|
+
/* @__PURE__ */ e(N, { side: "right", className: "hidden group-data-[collapsible=icon]:block", children: H(r) })
|
|
433
433
|
] }) }, r.title)) }) }) })
|
|
434
434
|
]
|
|
435
435
|
}
|
|
436
436
|
),
|
|
437
|
-
/* @__PURE__ */ e(pe, { className: "sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2", children: /* @__PURE__ */ e("div", { className: "group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none", children: /* @__PURE__ */ l(
|
|
438
|
-
/* @__PURE__ */ e(
|
|
437
|
+
/* @__PURE__ */ e(pe, { className: "sticky bottom-0 z-10 border-t border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] group-data-[collapsible=icon]:px-2 group-data-[collapsible=icon]:py-2", children: /* @__PURE__ */ e("div", { className: "group/user-menu rounded-m border border-[var(--color-border-primary-subtle)] transition-colors hover:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:rounded-none group-data-[collapsible=icon]:border-none", children: /* @__PURE__ */ l(X, { children: [
|
|
438
|
+
/* @__PURE__ */ e(J, { asChild: !0, children: /* @__PURE__ */ l(
|
|
439
439
|
fe,
|
|
440
440
|
{
|
|
441
441
|
variant: "ghost",
|
|
@@ -443,17 +443,17 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
443
443
|
children: [
|
|
444
444
|
/* @__PURE__ */ l("div", { className: "flex w-full items-center gap-3 group-data-[collapsible=icon]:hidden", children: [
|
|
445
445
|
/* @__PURE__ */ l("div", { className: "relative flex-shrink-0", children: [
|
|
446
|
-
/* @__PURE__ */ l(
|
|
447
|
-
/* @__PURE__ */ e(
|
|
448
|
-
/* @__PURE__ */ e(
|
|
446
|
+
/* @__PURE__ */ l(M, { size: "m", type: "user", children: [
|
|
447
|
+
/* @__PURE__ */ e(V, { src: o.avatarUrl, alt: o.name }),
|
|
448
|
+
/* @__PURE__ */ e(L, { size: "m", type: "user", children: K(o.name) })
|
|
449
449
|
] }),
|
|
450
|
-
/* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0", children: /* @__PURE__ */ l(
|
|
451
|
-
/* @__PURE__ */ e(
|
|
452
|
-
/* @__PURE__ */ e(
|
|
450
|
+
/* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[4px] border-2 border-white p-0", children: /* @__PURE__ */ l(M, { size: "xxs", type: "organization", children: [
|
|
451
|
+
/* @__PURE__ */ e(V, { src: i.avatarUrl, alt: i.name }),
|
|
452
|
+
/* @__PURE__ */ e(L, { size: "xxs", type: "organization", children: W(i.name) })
|
|
453
453
|
] }) })
|
|
454
454
|
] }),
|
|
455
455
|
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1 text-left", children: [
|
|
456
|
-
/* @__PURE__ */ e("div", { className: "text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]", children:
|
|
456
|
+
/* @__PURE__ */ e("div", { className: "text-body-medium-sm truncate font-medium text-[var(--color-text-primary)]", children: o.name }),
|
|
457
457
|
/* @__PURE__ */ l("div", { className: "text-body-xsm text-[var(--color-text-secondary)]", children: [
|
|
458
458
|
i.role,
|
|
459
459
|
" at ",
|
|
@@ -463,20 +463,20 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
463
463
|
/* @__PURE__ */ e(s, { name: Me, size: "m", className: "opacity-50" })
|
|
464
464
|
] }),
|
|
465
465
|
/* @__PURE__ */ l("div", { className: "relative hidden group-data-[collapsible=icon]:block", children: [
|
|
466
|
-
/* @__PURE__ */ l(
|
|
467
|
-
/* @__PURE__ */ e(
|
|
468
|
-
/* @__PURE__ */ e(
|
|
466
|
+
/* @__PURE__ */ l(M, { size: "s", type: "user", children: [
|
|
467
|
+
/* @__PURE__ */ e(V, { src: o.avatarUrl, alt: o.name }),
|
|
468
|
+
/* @__PURE__ */ e(L, { size: "s", type: "user", children: K(o.name) })
|
|
469
469
|
] }),
|
|
470
|
-
/* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]", children: /* @__PURE__ */ l(
|
|
471
|
-
/* @__PURE__ */ e(
|
|
472
|
-
/* @__PURE__ */ e(
|
|
470
|
+
/* @__PURE__ */ e("div", { className: "absolute -right-1 -bottom-1 rounded-[2px] border-2 border-white bg-[var(--color-surface-primary)]", children: /* @__PURE__ */ l(M, { size: "xxs", type: "organization", children: [
|
|
471
|
+
/* @__PURE__ */ e(V, { src: i.avatarUrl, alt: i.name }),
|
|
472
|
+
/* @__PURE__ */ e(L, { size: "xxs", type: "organization", children: W(i.name) })
|
|
473
473
|
] }) })
|
|
474
474
|
] })
|
|
475
475
|
]
|
|
476
476
|
}
|
|
477
477
|
) }),
|
|
478
478
|
/* @__PURE__ */ l(
|
|
479
|
-
|
|
479
|
+
q,
|
|
480
480
|
{
|
|
481
481
|
className: "w-[--radix-dropdown-menu-trigger-width]",
|
|
482
482
|
align: "start",
|
|
@@ -484,13 +484,13 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
484
484
|
sideOffset: 4,
|
|
485
485
|
children: [
|
|
486
486
|
/* @__PURE__ */ e(O, { className: "p-0 font-normal", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3 px-2 py-2", children: [
|
|
487
|
-
/* @__PURE__ */ l(
|
|
488
|
-
/* @__PURE__ */ e(
|
|
489
|
-
/* @__PURE__ */ e(
|
|
487
|
+
/* @__PURE__ */ l(M, { size: "s", type: "user", children: [
|
|
488
|
+
/* @__PURE__ */ e(V, { src: o.avatarUrl, alt: o.name }),
|
|
489
|
+
/* @__PURE__ */ e(L, { size: "s", type: "user", children: K(o.name) })
|
|
490
490
|
] }),
|
|
491
491
|
/* @__PURE__ */ l("div", { className: "grid flex-1 text-left", children: [
|
|
492
|
-
/* @__PURE__ */ e("span", { className: "text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]", children:
|
|
493
|
-
/* @__PURE__ */ e("span", { className: "text-caption-xsm truncate text-[var(--color-text-secondary)]", children:
|
|
492
|
+
/* @__PURE__ */ e("span", { className: "text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]", children: o.name }),
|
|
493
|
+
/* @__PURE__ */ e("span", { className: "text-caption-xsm truncate text-[var(--color-text-secondary)]", children: o.email })
|
|
494
494
|
] })
|
|
495
495
|
] }) }),
|
|
496
496
|
/* @__PURE__ */ e(U, {}),
|
|
@@ -501,9 +501,9 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
501
501
|
onSelect: () => c(r),
|
|
502
502
|
className: "mx-1 mb-1 h-10 cursor-pointer gap-2 px-1 pr-2 pl-1",
|
|
503
503
|
children: [
|
|
504
|
-
/* @__PURE__ */ l(
|
|
505
|
-
/* @__PURE__ */ e(
|
|
506
|
-
/* @__PURE__ */ e(
|
|
504
|
+
/* @__PURE__ */ l(M, { size: "s", type: "organization", children: [
|
|
505
|
+
/* @__PURE__ */ e(V, { src: r.avatarUrl, alt: r.name }),
|
|
506
|
+
/* @__PURE__ */ e(L, { size: "s", type: "organization", children: W(r.name) })
|
|
507
507
|
] }),
|
|
508
508
|
/* @__PURE__ */ l("div", { className: "flex flex-1 flex-col text-left", children: [
|
|
509
509
|
/* @__PURE__ */ e("span", { className: "text-body-medium-sm truncate font-semibold text-[var(--color-text-primary)]", children: r.name }),
|
|
@@ -514,7 +514,7 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
514
514
|
" plan"
|
|
515
515
|
] })
|
|
516
516
|
] }),
|
|
517
|
-
i.name === r.name && /* @__PURE__ */ e(s, { name:
|
|
517
|
+
i.name === r.name && /* @__PURE__ */ e(s, { name: $, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
|
|
518
518
|
]
|
|
519
519
|
},
|
|
520
520
|
r.name
|
|
@@ -528,7 +528,7 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
528
528
|
onSelect: () => f("sidebar"),
|
|
529
529
|
children: [
|
|
530
530
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "New sidebar navigation" }),
|
|
531
|
-
d === "sidebar" && /* @__PURE__ */ e(s, { name:
|
|
531
|
+
d === "sidebar" && /* @__PURE__ */ e(s, { name: $, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
|
|
532
532
|
]
|
|
533
533
|
}
|
|
534
534
|
),
|
|
@@ -539,7 +539,7 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
539
539
|
onSelect: () => f("horizontal"),
|
|
540
540
|
children: [
|
|
541
541
|
/* @__PURE__ */ e("span", { className: "flex-1", children: "Old horizontal menu" }),
|
|
542
|
-
d === "horizontal" && /* @__PURE__ */ e(s, { name:
|
|
542
|
+
d === "horizontal" && /* @__PURE__ */ e(s, { name: $, size: "m", className: "text-[var(--color-icon-brand-bold)]" })
|
|
543
543
|
]
|
|
544
544
|
}
|
|
545
545
|
),
|
|
@@ -585,79 +585,69 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
585
585
|
] }) }) }),
|
|
586
586
|
/* @__PURE__ */ e(he, {})
|
|
587
587
|
] }),
|
|
588
|
-
/* @__PURE__ */ l(
|
|
588
|
+
/* @__PURE__ */ l(Ee, { open: z, onOpenChange: h, commandProps: p && p.length > 0 ? { shouldFilter: !1 } : void 0, children: [
|
|
589
589
|
/* @__PURE__ */ e(
|
|
590
590
|
Ue,
|
|
591
591
|
{
|
|
592
592
|
placeholder: "Type a command or search...",
|
|
593
593
|
value: j,
|
|
594
594
|
onValueChange: (r) => {
|
|
595
|
-
|
|
595
|
+
A(r), b?.(r);
|
|
596
596
|
},
|
|
597
597
|
clearable: !1
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
|
-
/* @__PURE__ */ l(
|
|
601
|
-
/* @__PURE__ */ e(
|
|
600
|
+
/* @__PURE__ */ l(Re, { children: [
|
|
601
|
+
/* @__PURE__ */ e(je, { children: "No results found." }),
|
|
602
602
|
y && /* @__PURE__ */ e("div", { className: "py-[var(--space-m)] text-center text-body-sm text-[var(--color-text-tertiary)]", children: "Searching…" }),
|
|
603
603
|
p && p.length > 0 && (() => {
|
|
604
|
-
const r =
|
|
605
|
-
return Object.entries(r).map(([t, x]) => /* @__PURE__ */ e(
|
|
606
|
-
|
|
604
|
+
const r = Be(p, (t) => t.group ?? "Results");
|
|
605
|
+
return Object.entries(r).map(([t, x]) => /* @__PURE__ */ e(Z, { heading: t, children: x.map((E) => /* @__PURE__ */ l(
|
|
606
|
+
R,
|
|
607
607
|
{
|
|
608
|
-
value:
|
|
608
|
+
value: E.id,
|
|
609
609
|
onSelect: () => {
|
|
610
|
-
|
|
610
|
+
E.onSelect?.(), h(!1);
|
|
611
611
|
},
|
|
612
612
|
children: [
|
|
613
|
-
|
|
614
|
-
/* @__PURE__ */ e("span", { children:
|
|
613
|
+
E.icon && /* @__PURE__ */ e(s, { name: E.icon, size: "s", className: "mr-2" }),
|
|
614
|
+
/* @__PURE__ */ e("span", { children: E.label })
|
|
615
615
|
]
|
|
616
616
|
},
|
|
617
|
-
|
|
617
|
+
E.id
|
|
618
618
|
)) }, t));
|
|
619
619
|
})(),
|
|
620
|
-
!p?.length && /* @__PURE__ */ l(
|
|
621
|
-
/* @__PURE__ */ l(
|
|
622
|
-
/* @__PURE__ */ l(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
/* @__PURE__ */ l("span", { className: "text-caption-sm ml-auto text-[var(--color-text-tertiary)]", children: [
|
|
626
|
-
K() ? "⌘" : "Ctrl",
|
|
627
|
-
"R"
|
|
628
|
-
] })
|
|
629
|
-
] }),
|
|
630
|
-
/* @__PURE__ */ l(k, { onSelect: () => h(!1), children: [
|
|
631
|
-
/* @__PURE__ */ e(s, { name: X, size: "s", className: "mr-2" }),
|
|
632
|
-
/* @__PURE__ */ e("span", { children: "Search" }),
|
|
633
|
-
/* @__PURE__ */ l("span", { className: "text-caption-sm ml-auto text-[var(--color-text-tertiary)]", children: [
|
|
634
|
-
K() ? "⌘" : "Ctrl",
|
|
635
|
-
"K"
|
|
636
|
-
] })
|
|
637
|
-
] })
|
|
638
|
-
] }),
|
|
639
|
-
/* @__PURE__ */ l(D, { heading: "Navigation", children: [
|
|
640
|
-
o.main.map((r) => /* @__PURE__ */ l(k, { onSelect: () => h(!1), children: [
|
|
620
|
+
!p?.length && /* @__PURE__ */ l(G, { children: [
|
|
621
|
+
/* @__PURE__ */ l(Z, { heading: "Navigation", children: [
|
|
622
|
+
a.main.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
|
|
623
|
+
n?.(r.url), h(!1);
|
|
624
|
+
}, children: [
|
|
641
625
|
/* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
|
|
642
626
|
/* @__PURE__ */ e("span", { children: r.title })
|
|
643
627
|
] }, r.title)),
|
|
644
|
-
|
|
628
|
+
a.operations.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
|
|
629
|
+
n?.(r.url), h(!1);
|
|
630
|
+
}, children: [
|
|
645
631
|
/* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
|
|
646
632
|
/* @__PURE__ */ e("span", { children: r.title })
|
|
647
633
|
] }, r.title)),
|
|
648
|
-
|
|
634
|
+
a.intelligence.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
|
|
635
|
+
n?.(r.url), h(!1);
|
|
636
|
+
}, children: [
|
|
649
637
|
/* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
|
|
650
638
|
/* @__PURE__ */ e("span", { children: r.title })
|
|
651
639
|
] }, r.title))
|
|
652
640
|
] }),
|
|
653
|
-
/* @__PURE__ */ e(
|
|
641
|
+
/* @__PURE__ */ e(Z, { heading: "Settings", children: a.support.map((r) => /* @__PURE__ */ l(R, { onSelect: () => {
|
|
642
|
+
n?.(r.url), h(!1);
|
|
643
|
+
}, children: [
|
|
654
644
|
/* @__PURE__ */ e(s, { name: r.icon, size: "s", className: "mr-2" }),
|
|
655
645
|
/* @__PURE__ */ e("span", { children: r.title })
|
|
656
646
|
] }, r.title)) }),
|
|
657
|
-
/* @__PURE__ */ e(
|
|
658
|
-
/* @__PURE__ */ l(
|
|
659
|
-
/* @__PURE__ */ e(
|
|
660
|
-
/* @__PURE__ */ e(
|
|
647
|
+
/* @__PURE__ */ e(Z, { heading: "Switch team", children: u.map((r) => /* @__PURE__ */ l(R, { onSelect: () => h(!1), children: [
|
|
648
|
+
/* @__PURE__ */ l(M, { size: "s", className: "mr-2", type: "organization", children: [
|
|
649
|
+
/* @__PURE__ */ e(V, { src: r.avatarUrl, alt: r.name }),
|
|
650
|
+
/* @__PURE__ */ e(L, { size: "s", type: "organization", children: W(r.name) })
|
|
661
651
|
] }),
|
|
662
652
|
/* @__PURE__ */ e("span", { children: r.name })
|
|
663
653
|
] }, r.name)) })
|
|
@@ -666,9 +656,9 @@ function Pe({ navigationData: o, user: a, teams: u, onNavigate: n, navigationMod
|
|
|
666
656
|
] })
|
|
667
657
|
] });
|
|
668
658
|
}
|
|
669
|
-
function
|
|
670
|
-
navigationData:
|
|
671
|
-
user:
|
|
659
|
+
function Pe({
|
|
660
|
+
navigationData: a,
|
|
661
|
+
user: o,
|
|
672
662
|
activeTeam: u,
|
|
673
663
|
onNavigate: n,
|
|
674
664
|
navigationMode: d,
|
|
@@ -682,11 +672,11 @@ function Ze({
|
|
|
682
672
|
};
|
|
683
673
|
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
684
674
|
}, [b]);
|
|
685
|
-
const
|
|
686
|
-
...
|
|
687
|
-
...
|
|
688
|
-
...
|
|
689
|
-
], h =
|
|
675
|
+
const z = [
|
|
676
|
+
...a.main,
|
|
677
|
+
...a.operations,
|
|
678
|
+
...a.intelligence
|
|
679
|
+
], h = z.find((i) => i.isActive || i.items?.some((c) => c.isActive))?.title ?? null, [j, A] = m.useState(h), g = z.find((i) => i.title === j)?.items ?? [], T = K(o.name);
|
|
690
680
|
return /* @__PURE__ */ l("div", { style: { width: "100%" }, children: [
|
|
691
681
|
/* @__PURE__ */ l(
|
|
692
682
|
"div",
|
|
@@ -773,14 +763,14 @@ function Ze({
|
|
|
773
763
|
fontWeight: 600,
|
|
774
764
|
padding: 0
|
|
775
765
|
},
|
|
776
|
-
children:
|
|
766
|
+
children: o.avatarUrl ? /* @__PURE__ */ e(
|
|
777
767
|
"img",
|
|
778
768
|
{
|
|
779
|
-
src:
|
|
780
|
-
alt:
|
|
769
|
+
src: o.avatarUrl,
|
|
770
|
+
alt: o.name,
|
|
781
771
|
style: { width: "100%", height: "100%", borderRadius: "50%", objectFit: "cover" }
|
|
782
772
|
}
|
|
783
|
-
) :
|
|
773
|
+
) : T
|
|
784
774
|
}
|
|
785
775
|
),
|
|
786
776
|
b && /* @__PURE__ */ l(
|
|
@@ -800,8 +790,8 @@ function Ze({
|
|
|
800
790
|
},
|
|
801
791
|
children: [
|
|
802
792
|
/* @__PURE__ */ l("div", { style: { padding: "8px 12px", borderBottom: "1px solid #e5e7eb" }, children: [
|
|
803
|
-
/* @__PURE__ */ e("div", { style: { fontWeight: 600, color: "#111827" }, children:
|
|
804
|
-
/* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#6b7280" }, children:
|
|
793
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 600, color: "#111827" }, children: o.name }),
|
|
794
|
+
/* @__PURE__ */ e("div", { style: { fontSize: 12, color: "#6b7280" }, children: o.email })
|
|
805
795
|
] }),
|
|
806
796
|
/* @__PURE__ */ l("div", { style: { padding: "4px 0", borderBottom: "1px solid #e5e7eb" }, children: [
|
|
807
797
|
/* @__PURE__ */ e("div", { style: { padding: "4px 12px", fontSize: 11, fontWeight: 500, color: "#9ca3af", textTransform: "uppercase", letterSpacing: "0.05em" }, children: "Navigation" }),
|
|
@@ -913,13 +903,13 @@ function Ze({
|
|
|
913
903
|
gap: 2,
|
|
914
904
|
overflowX: "auto"
|
|
915
905
|
},
|
|
916
|
-
children:
|
|
906
|
+
children: z.map((i) => {
|
|
917
907
|
const c = i.isActive || (i.items?.some((v) => v.isActive) ?? !1);
|
|
918
908
|
return /* @__PURE__ */ e(
|
|
919
909
|
"button",
|
|
920
910
|
{
|
|
921
911
|
onClick: (v) => {
|
|
922
|
-
v.preventDefault(),
|
|
912
|
+
v.preventDefault(), A(i.title), n?.(i.url);
|
|
923
913
|
},
|
|
924
914
|
style: {
|
|
925
915
|
padding: "6px 14px",
|
|
@@ -991,68 +981,68 @@ function Ze({
|
|
|
991
981
|
)
|
|
992
982
|
] });
|
|
993
983
|
}
|
|
994
|
-
function
|
|
995
|
-
const { state:
|
|
984
|
+
function Ze() {
|
|
985
|
+
const { state: a, toggleSidebar: o } = ue(), u = a === "collapsed";
|
|
996
986
|
return m.useEffect(() => {
|
|
997
987
|
const n = (d) => {
|
|
998
|
-
d.key === "[" && (d.preventDefault(),
|
|
988
|
+
d.key === "[" && (d.preventDefault(), o());
|
|
999
989
|
};
|
|
1000
990
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
1001
|
-
}, [
|
|
1002
|
-
/* @__PURE__ */ e(
|
|
1003
|
-
/* @__PURE__ */ e(
|
|
991
|
+
}, [o]), /* @__PURE__ */ l(k, { delayDuration: 500, children: [
|
|
992
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(me, { className: "-ml-1" }) }),
|
|
993
|
+
/* @__PURE__ */ e(N, { side: "bottom", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
1004
994
|
/* @__PURE__ */ e("span", { children: u ? "Expand sidebar" : "Collapse sidebar" }),
|
|
1005
|
-
/* @__PURE__ */ e(
|
|
995
|
+
/* @__PURE__ */ e(D, { size: "s", variant: "dark", children: "[" })
|
|
1006
996
|
] }) })
|
|
1007
997
|
] });
|
|
1008
998
|
}
|
|
1009
|
-
function
|
|
1010
|
-
navigationData:
|
|
1011
|
-
user:
|
|
1012
|
-
teams: u =
|
|
999
|
+
function rr({
|
|
1000
|
+
navigationData: a = Fe,
|
|
1001
|
+
user: o = Oe,
|
|
1002
|
+
teams: u = De,
|
|
1013
1003
|
defaultSidebarOpen: n = !0,
|
|
1014
1004
|
headerContent: d,
|
|
1015
1005
|
headerTabs: f,
|
|
1016
1006
|
headerActions: b,
|
|
1017
1007
|
children: p,
|
|
1018
1008
|
onNavigate: y,
|
|
1019
|
-
onSearchChange:
|
|
1009
|
+
onSearchChange: z,
|
|
1020
1010
|
searchItems: h,
|
|
1021
1011
|
searchLoading: j
|
|
1022
1012
|
}) {
|
|
1023
|
-
const [
|
|
1024
|
-
return
|
|
1013
|
+
const [A, g] = m.useState("sidebar"), [T] = m.useState(u[0]);
|
|
1014
|
+
return A === "horizontal" ? /* @__PURE__ */ l("div", { className: "h-screen overflow-hidden", style: { display: "flex", flexDirection: "column" }, children: [
|
|
1025
1015
|
/* @__PURE__ */ e(
|
|
1026
|
-
|
|
1016
|
+
Pe,
|
|
1027
1017
|
{
|
|
1028
|
-
navigationData:
|
|
1029
|
-
user:
|
|
1030
|
-
activeTeam:
|
|
1018
|
+
navigationData: a,
|
|
1019
|
+
user: o,
|
|
1020
|
+
activeTeam: T,
|
|
1031
1021
|
onNavigate: y,
|
|
1032
|
-
navigationMode:
|
|
1022
|
+
navigationMode: A,
|
|
1033
1023
|
onNavigationModeChange: g
|
|
1034
1024
|
}
|
|
1035
1025
|
),
|
|
1036
1026
|
/* @__PURE__ */ e("div", { style: { flex: 1, overflow: "auto", minHeight: 0, backgroundColor: "var(--color-surface-base)" }, children: p })
|
|
1037
|
-
] }) : /* @__PURE__ */ e("div", { className: "h-screen overflow-hidden", children: /* @__PURE__ */ l(
|
|
1027
|
+
] }) : /* @__PURE__ */ e("div", { className: "h-screen overflow-hidden", children: /* @__PURE__ */ l(ae, { defaultOpen: n, children: [
|
|
1038
1028
|
/* @__PURE__ */ e(
|
|
1039
|
-
|
|
1029
|
+
Ie,
|
|
1040
1030
|
{
|
|
1041
|
-
navigationData:
|
|
1042
|
-
user:
|
|
1031
|
+
navigationData: a,
|
|
1032
|
+
user: o,
|
|
1043
1033
|
teams: u,
|
|
1044
1034
|
onNavigate: y,
|
|
1045
|
-
navigationMode:
|
|
1035
|
+
navigationMode: A,
|
|
1046
1036
|
onNavigationModeChange: g,
|
|
1047
|
-
onSearchChange:
|
|
1037
|
+
onSearchChange: z,
|
|
1048
1038
|
searchItems: h,
|
|
1049
1039
|
searchLoading: j
|
|
1050
1040
|
}
|
|
1051
1041
|
),
|
|
1052
1042
|
/* @__PURE__ */ l(se, { children: [
|
|
1053
1043
|
(d || b || f) && /* @__PURE__ */ l("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-[var(--color-border-primary-subtle)] transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 box-border px-[var(--space-m)]", children: [
|
|
1054
|
-
/* @__PURE__ */ e(
|
|
1055
|
-
/* @__PURE__ */ e(
|
|
1044
|
+
/* @__PURE__ */ e(Ze, {}),
|
|
1045
|
+
/* @__PURE__ */ e(Q, { layout: "horizontal", className: "mr-2 h-4" }),
|
|
1056
1046
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: d }),
|
|
1057
1047
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 ml-auto shrink-0", children: [
|
|
1058
1048
|
f && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: f }),
|
|
@@ -1065,5 +1055,5 @@ function lr({
|
|
|
1065
1055
|
] }) });
|
|
1066
1056
|
}
|
|
1067
1057
|
export {
|
|
1068
|
-
|
|
1058
|
+
rr as AppFrame
|
|
1069
1059
|
};
|
package/package.json
CHANGED