{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "vertical-sidebar-header",
  "title": "Vertical Sidebar Header",
  "description": "A collapsible vertical workspace header with icon navigation, a shared active indicator, item badges and a compact profile footer.",
  "dependencies": [
    "motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/vertical-sidebar-header/vertical-sidebar-header.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { ChevronLeft, ChevronRight, LayoutDashboard, Folder, Layers, CalendarDays, Settings, Grid2X2 } from \"lucide-react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); }\n\nexport type NavbarTheme = \"dark\" | \"light\";\n\nexport interface NavbarLink {\n  /** A stable, unique item identifier. */\n  id: string;\n  label: string;\n  href: string;\n  description?: string;\n  badge?: string;\n  icon?: React.ReactNode;\n}\n\nfunction palette(theme: NavbarTheme): React.CSSProperties & Record<`--${string}`, string> {\n const light=theme===\"light\";\n return {\"--nav-page\":light?\"#f5f4f1\":\"#0e0e0e\",\"--nav-ink\":light?\"#0a0a0a\":\"#f5f4f1\",\"--nav-muted\":light?\"rgba(10,10,10,.52)\":\"rgba(245,244,241,.52)\",\"--nav-line\":light?\"rgba(10,10,10,.1)\":\"rgba(245,244,241,.1)\",\"--nav-soft\":light?\"rgba(10,10,10,.045)\":\"rgba(245,244,241,.045)\",\"--nav-panel\":light?\"rgba(245,244,241,.96)\":\"rgba(14,14,14,.96)\",\"--nav-serif\":\"var(--navbar-serif, 'Instrument Serif', Georgia, serif)\"};\n}\n\nconst focus=\"outline-none focus-visible:ring-2 focus-visible:ring-[var(--nav-ink)]/40 focus-visible:ring-offset-4 focus-visible:ring-offset-[var(--nav-page)]\";\n\nconst muted=\"text-[color:var(--nav-muted)]\";\n\nconst serif=\"font-[family-name:var(--nav-serif)] font-normal tracking-[-.035em]\";\n\nconst EASE=[.16,1,.3,1] as const;\n\nfunction useDisclosure(value: boolean|undefined, defaultValue: boolean, onChange?: (open:boolean)=>void) {\n const [internal,setInternal]=React.useState(defaultValue);const open=value??internal;\n const setOpen=React.useCallback((next:boolean)=>{if(value===undefined)setInternal(next);onChange?.(next);},[value,onChange]);\n return [open,setOpen] as const;\n}\n\nfunction useActive(value:string|undefined,initial:string,onChange?:(id:string)=>void){const[internal,setInternal]=React.useState(initial);const active=value??internal;const setActive=(id:string)=>{if(value===undefined)setInternal(id);onChange?.(id);};return[active,setActive]as const;}\n\nfunction subscribeReducedMotion(onChange:()=>void){const query=window.matchMedia(\"(prefers-reduced-motion: reduce)\");query.addEventListener(\"change\",onChange);return()=>query.removeEventListener(\"change\",onChange);}\n\nfunction reducedMotionSnapshot(){return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;}\n\nfunction serverReducedMotionSnapshot(){return false;}\n\nfunction useReducedMotion(){return React.useSyncExternalStore(subscribeReducedMotion,reducedMotionSnapshot,serverReducedMotionSnapshot);}\n\nconst SIDEBAR_LINKS:NavbarLink[]=[{id:\"overview\",label:\"Overview\",href:\"/overview\",icon:<LayoutDashboard size={17}/>},{id:\"projects\",label:\"Projects\",href:\"/projects\",icon:<Folder size={17}/>,badge:\"08\"},{id:\"library\",label:\"Library\",href:\"/library\",icon:<Layers size={17}/>},{id:\"calendar\",label:\"Calendar\",href:\"/calendar\",icon:<CalendarDays size={17}/>},{id:\"settings\",label:\"Settings\",href:\"/settings\",icon:<Settings size={17}/>}];\nexport interface VerticalSidebarHeaderProps extends Omit<React.ComponentPropsWithoutRef<\"aside\">,\"onChange\">{\n theme?:NavbarTheme;\n logo?:React.ReactNode;\n logoHref?:string;\n items?:NavbarLink[];\n activeId?:string;\n defaultActiveId?:string;\n onActiveChange?:(id:string)=>void;\n collapsed?:boolean;\n defaultCollapsed?:boolean;\n onCollapsedChange?:(collapsed:boolean)=>void;\n profileName?:string;\n profileDetail?:string;\n profileInitials?:string;\n height?:number|string;\n onNavigate?:(item:NavbarLink,event:React.MouseEvent<HTMLAnchorElement>)=>void;\n}\nexport function VerticalSidebarHeader({theme=\"dark\",logo=\"Forme.\",logoHref=\"/\",items=SIDEBAR_LINKS,activeId,defaultActiveId=\"overview\",onActiveChange,collapsed:controlledCollapsed,defaultCollapsed=false,onCollapsedChange,profileName=\"Alex Morgan\",profileDetail=\"Personal workspace\",profileInitials=\"AM\",height=560,onNavigate,className,style,...props}:VerticalSidebarHeaderProps){\n const[collapsed,setCollapsed]=useDisclosure(controlledCollapsed,defaultCollapsed,onCollapsedChange);const[active,setActive]=useActive(activeId,defaultActiveId,onActiveChange);const reduce=useReducedMotion();const group=React.useId();\n return <aside {...props} data-theme={theme} className={cn(\"flex max-w-full shrink-0 flex-col overflow-hidden rounded-[22px] border border-[var(--nav-line)] bg-[var(--nav-page)] text-[color:var(--nav-ink)]\",className)} style={{...palette(theme),height,width:collapsed?76:232,transition:reduce?\"none\":\"width 350ms cubic-bezier(.16,1,.3,1)\",...style}}><div className={cn(\"flex min-h-24 items-center border-b border-[var(--nav-line)]\",collapsed?\"flex-col justify-center gap-3 py-4\":\"justify-between gap-3 px-5\")}><a href={logoHref} aria-label=\"Home\" className={cn(serif,collapsed?\"text-[28px]\":\"text-[30px]\",focus)}>{collapsed?\"F.\":logo}</a><button onClick={()=>setCollapsed(!collapsed)} aria-label={collapsed?\"Expand sidebar\":\"Collapse sidebar\"} aria-expanded={!collapsed} className={cn(\"flex size-7 cursor-pointer items-center justify-center rounded-full border border-[var(--nav-line)] hover:bg-[var(--nav-soft)]\",focus)}>{collapsed?<ChevronRight size={13}/>:<ChevronLeft size={13}/>}</button></div><div className={cn(\"flex-1 overflow-x-hidden overflow-y-auto py-5\",collapsed?\"px-3\":\"px-4\")}><p className={cn(\"mb-4 text-[9px] tracking-[.17em] uppercase\",muted,collapsed?\"text-center\":\"px-2\")}>{collapsed?\"✦\":\"✦ Workspace\"}</p><nav aria-label=\"Workspace navigation\" className=\"space-y-1.5\">{items.map(item=>{const selected=active===item.id;return <a key={item.id} href={item.href} aria-label={item.label} title={collapsed?item.label:undefined} aria-current={selected?\"page\":undefined} onClick={e=>{setActive(item.id);onNavigate?.(item,e);}} className={cn(\"relative flex min-h-11 items-center rounded-xl text-xs transition-colors\",collapsed?\"justify-center\":\"gap-3 px-3\",selected?\"text-[color:var(--nav-ink)]\":muted,\"hover:text-[color:var(--nav-ink)]\",focus)}>{selected&&<motion.span layoutId={`${group}-active`} className=\"absolute inset-0 rounded-xl border border-[var(--nav-line)] bg-[var(--nav-soft)]\" transition={{duration:reduce?0:.3,ease:EASE}}/>}<span className=\"relative shrink-0\">{item.icon??<Grid2X2 size={17}/>}</span>{!collapsed&&<><span className=\"relative whitespace-nowrap\">{item.label}</span>{item.badge&&<span className={cn(\"relative ml-auto text-[10px] tabular-nums\",muted)}>{item.badge}</span>}</>}</a>;})}</nav></div><div className={cn(\"border-t border-[var(--nav-line)]\",collapsed?\"px-3 py-4\":\"p-4\")}><div className={cn(\"flex items-center\",collapsed?\"justify-center\":\"gap-3\")}><span className=\"flex size-9 shrink-0 items-center justify-center rounded-full border border-[var(--nav-line)] bg-[var(--nav-soft)] text-[10px]\">{profileInitials}</span>{!collapsed&&<div className=\"min-w-0\"><p className=\"truncate text-xs\">{profileName}</p><p className={cn(\"mt-1 truncate text-[10px]\",muted)}>{profileDetail}</p></div>}</div></div></aside>;\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}