{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-shells-02",
  "title": "Icon rail sidebar",
  "description": "The same shell with the sidebar folded into an icon rail that explains itself with tooltips and morphs back to full width.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/badge.json",
    "https://ui.ndekocode.dev/r/breadcrumb.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/command.json",
    "https://ui.ndekocode.dev/r/company-mark.json",
    "https://ui.ndekocode.dev/r/dropdown-menu.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/kbd.json",
    "https://ui.ndekocode.dev/r/mesh-tile.json",
    "https://ui.ndekocode.dev/r/motion-number.json",
    "https://ui.ndekocode.dev/r/recipes.json",
    "https://ui.ndekocode.dev/r/sheet.json",
    "https://ui.ndekocode.dev/r/tabs.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/tooltip.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/index.tsx",
      "content": "'use client';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Sheet, SheetContent, SheetTitle } from '@/registry/ndeko/ui/sheet';\n\nimport { AppSidebar, type PageCounts } from './app-sidebar';\nimport {\n  CURRENT_USER_ID,\n  EMPTY_PAGES,\n  NAV_GROUPS,\n  NOTIFICATIONS,\n  PEOPLE,\n  PROJECTS,\n  TASKS,\n  WORKSPACES,\n  personOf,\n  type NavItem,\n  type Notification,\n  type PageId,\n  type Project,\n  type Task,\n} from './data';\nimport {\n  EmptyPageView,\n  InboxPage,\n  MembersPage,\n  ProjectsPage,\n  TaskListPage,\n} from './page-views';\nimport type { CreateKind } from './quick-create-menu';\nimport { CommandPalette } from './search-palette';\nimport { TopBar } from './top-bar';\n\nconst NAV_ITEMS = NAV_GROUPS.flatMap((group) => group.items);\n\nconst FIRST_TASK_NUMBER = 100;\n\nfunction navItemOf(pageId: PageId): NavItem {\n  const item = NAV_ITEMS.find((candidate) => candidate.id === pageId);\n  if (item) {\n    return item;\n  }\n  return NAV_ITEMS[0];\n}\n\nfunction ancestorOf(pageId: PageId, workspaceName: string) {\n  const group = NAV_GROUPS.find((candidate) =>\n    candidate.items.some((item) => item.id === pageId)\n  );\n  if (group?.team) {\n    return group.team.name;\n  }\n  if (group?.label) {\n    return workspaceName;\n  }\n  return undefined;\n}\n\nfunction workspaceOf(workspaceId: string) {\n  const workspace = WORKSPACES.find(\n    (candidate) => candidate.id === workspaceId\n  );\n  if (workspace) {\n    return workspace;\n  }\n  return WORKSPACES[0];\n}\n\nfunction numberOf(task: Task) {\n  const digits = task.number.replace(/\\D/g, '');\n  return Number(digits);\n}\n\nfunction draftTaskAfter(tasks: Task[]): Task {\n  const numbers = tasks.map(numberOf);\n  const nextNumber = Math.max(FIRST_TASK_NUMBER, ...numbers) + 1;\n  return {\n    id: `task-${nextNumber}`,\n    number: `LAT-${nextNumber}`,\n    title: 'Untitled task',\n    projectId: 'onboarding',\n    assigneeId: CURRENT_USER_ID,\n    due: 'No date',\n    isDone: false,\n  };\n}\n\nfunction draftProjectAfter(projects: Project[]): Project {\n  const draftNumber = projects.length + 1;\n  return {\n    id: `project-${draftNumber}`,\n    name: 'Untitled project',\n    color: 'var(--muted-foreground)',\n    leadId: CURRENT_USER_ID,\n  };\n}\n\nfunction sidebarWidthOf(isCollapsed: boolean) {\n  if (isCollapsed) {\n    return 'w-10';\n  }\n  return 'w-60';\n}\n\nfunction isTypingTarget(target: EventTarget | null) {\n  if (!(target instanceof HTMLElement)) {\n    return false;\n  }\n  const isField = target.matches('input, textarea, select');\n  return isField || target.isContentEditable;\n}\n\nfunction isPaletteShortcut(event: KeyboardEvent) {\n  const isKKey = event.key.toLowerCase() === 'k';\n  const hasModifier = event.metaKey || event.ctrlKey;\n  return isKKey && hasModifier;\n}\n\nfunction isCreateShortcut(event: KeyboardEvent) {\n  const isCKey = event.key.toLowerCase() === 'c';\n  const hasModifier = event.metaKey || event.ctrlKey || event.altKey;\n  const isTyping = isTypingTarget(event.target);\n  return isCKey && !hasModifier && !isTyping;\n}\n\nexport default function AppShells02() {\n  const [activePageId, setActivePageId] = useState<PageId>('my-tasks');\n  const [workspaceId, setWorkspaceId] = useState(WORKSPACES[0].id);\n  const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(true);\n  const [isNavigationOpen, setIsNavigationOpen] = useState(false);\n  const [isPaletteOpen, setIsPaletteOpen] = useState(false);\n  const [tasks, setTasks] = useState<Task[]>(TASKS);\n  const [projects, setProjects] = useState<Project[]>(PROJECTS);\n  const [notifications, setNotifications] =\n    useState<Notification[]>(NOTIFICATIONS);\n\n  const workspace = workspaceOf(workspaceId);\n  const activePage = navItemOf(activePageId);\n  const ancestor = ancestorOf(activePageId, workspace.name);\n  const currentUser = personOf(CURRENT_USER_ID);\n  const myTasks = tasks.filter((task) => task.assigneeId === CURRENT_USER_ID);\n  const myOpenTasks = myTasks.filter((task) => !task.isDone);\n  const teamOpenTasks = tasks.filter((task) => !task.isDone);\n  const unreadNotifications = notifications.filter((note) => note.isUnread);\n  const counts: PageCounts = {\n    inbox: unreadNotifications.length,\n    'my-tasks': myOpenTasks.length,\n    'team-tasks': teamOpenTasks.length,\n  };\n  const emptyPage = EMPTY_PAGES[activePageId];\n\n  const createTask = useCallback(() => {\n    setTasks((previous) => {\n      const draft = draftTaskAfter(previous);\n      return [draft, ...previous];\n    });\n    setActivePageId('my-tasks');\n  }, []);\n\n  useEffect(() => {\n    function handleKeyDown(event: KeyboardEvent) {\n      if (isPaletteShortcut(event)) {\n        event.preventDefault();\n        setIsPaletteOpen((isOpen) => !isOpen);\n        return;\n      }\n      if (isCreateShortcut(event)) {\n        event.preventDefault();\n        createTask();\n      }\n    }\n\n    document.addEventListener('keydown', handleKeyDown);\n    return () => document.removeEventListener('keydown', handleKeyDown);\n  }, [createTask]);\n\n  function navigate(pageId: PageId) {\n    setActivePageId(pageId);\n    setIsNavigationOpen(false);\n  }\n\n  function create(kind: CreateKind) {\n    setIsNavigationOpen(false);\n    if (kind === 'task') {\n      createTask();\n      return;\n    }\n    if (kind === 'project') {\n      setProjects((previous) => {\n        const draft = draftProjectAfter(previous);\n        return [...previous, draft];\n      });\n      setActivePageId('projects');\n      return;\n    }\n    setActivePageId('members');\n  }\n\n  function createProject() {\n    create('project');\n  }\n\n  function openSearch() {\n    setIsNavigationOpen(false);\n    setIsPaletteOpen(true);\n  }\n\n  function toggleSidebar() {\n    setIsSidebarCollapsed((isCollapsed) => !isCollapsed);\n  }\n\n  function openNavigation() {\n    setIsNavigationOpen(true);\n  }\n\n  function toggleTask(taskId: string) {\n    setTasks((previous) =>\n      previous.map((task) => {\n        if (task.id !== taskId) {\n          return task;\n        }\n        return { ...task, isDone: !task.isDone };\n      })\n    );\n  }\n\n  function readNotification(notificationId: string) {\n    setNotifications((previous) =>\n      previous.map((note) => {\n        if (note.id !== notificationId) {\n          return note;\n        }\n        return { ...note, isUnread: false };\n      })\n    );\n  }\n\n  function readAllNotifications() {\n    setNotifications((previous) =>\n      previous.map((note) => ({ ...note, isUnread: false }))\n    );\n  }\n\n  const sidebarProps = {\n    workspaces: WORKSPACES,\n    workspace,\n    onWorkspaceChange: setWorkspaceId,\n    groups: NAV_GROUPS,\n    activePageId,\n    counts,\n    person: currentUser,\n    onNavigate: navigate,\n    onOpenSearch: openSearch,\n    onCreate: create,\n  };\n\n  return (\n    <div className='bg-sidebar text-foreground flex h-dvh min-h-0 w-full md:p-2'>\n      <aside aria-label='Sidebar' className='hidden shrink-0 md:block'>\n        <AnimatedSize\n          axis='width'\n          className='m-0 h-full'\n          contentClassName='h-full p-0'\n        >\n          <div\n            className={cn('h-full pr-2', sidebarWidthOf(isSidebarCollapsed))}\n          >\n            <AppSidebar {...sidebarProps} isCollapsed={isSidebarCollapsed} />\n          </div>\n        </AnimatedSize>\n      </aside>\n      <Sheet open={isNavigationOpen} onOpenChange={setIsNavigationOpen}>\n        <SheetContent\n          side='left'\n          showCloseButton={false}\n          className='bg-sidebar w-72 gap-0 p-2'\n        >\n          <SheetTitle className='sr-only'>Navigation</SheetTitle>\n          <AppSidebar {...sidebarProps} isCollapsed={false} />\n        </SheetContent>\n      </Sheet>\n      <main className='bg-background md:hairline-ring md:ring-border flex min-w-0 flex-1 flex-col overflow-clip md:rounded-xl md:shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n        <TopBar\n          page={activePage}\n          ancestor={ancestor}\n          people={PEOPLE}\n          isSidebarCollapsed={isSidebarCollapsed}\n          onToggleSidebar={toggleSidebar}\n          onOpenNavigation={openNavigation}\n        />\n        {activePageId === 'inbox' && (\n          <InboxPage\n            notifications={notifications}\n            onRead={readNotification}\n            onReadAll={readAllNotifications}\n          />\n        )}\n        {activePageId === 'my-tasks' && (\n          <TaskListPage\n            key='my-tasks'\n            title='My tasks'\n            tasks={myTasks}\n            showAssignee={false}\n            onToggleTask={toggleTask}\n            onCreateTask={createTask}\n          />\n        )}\n        {activePageId === 'team-tasks' && (\n          <TaskListPage\n            key='team-tasks'\n            title='Product tasks'\n            tasks={tasks}\n            showAssignee\n            onToggleTask={toggleTask}\n            onCreateTask={createTask}\n          />\n        )}\n        {activePageId === 'projects' && (\n          <ProjectsPage\n            projects={projects}\n            tasks={tasks}\n            onCreateProject={createProject}\n          />\n        )}\n        {activePageId === 'members' && <MembersPage people={PEOPLE} />}\n        {emptyPage && (\n          <EmptyPageView\n            title={activePage.label}\n            icon={activePage.icon}\n            page={emptyPage}\n          />\n        )}\n      </main>\n      <CommandPalette\n        open={isPaletteOpen}\n        onOpenChange={setIsPaletteOpen}\n        groups={NAV_GROUPS}\n        onNavigate={navigate}\n        onCreateTask={createTask}\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/app-sidebar.tsx",
      "content": "'use client';\n\nimport { motion } from 'motion/react';\nimport { useId } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport { AccountMenu } from './account-menu';\nimport type { NavGroup, NavItem, PageId, Person, Workspace } from './data';\nimport { QuickCreateMenu, type CreateKind } from './quick-create-menu';\nimport { SearchTrigger } from './search-palette';\nimport { EntityTile, NavRow, morphOf } from './sidebar-parts';\nimport { WorkspaceSwitcher } from './workspace-switcher';\n\nexport type PageCounts = Partial<Record<PageId, number>>;\n\ntype AppSidebarProps = {\n  workspaces: Workspace[];\n  workspace: Workspace;\n  onWorkspaceChange: (workspaceId: string) => void;\n  groups: NavGroup[];\n  activePageId: PageId;\n  counts: PageCounts;\n  person: Person;\n  isCollapsed: boolean;\n  onNavigate: (pageId: PageId) => void;\n  onOpenSearch: () => void;\n  onCreate: (kind: CreateKind) => void;\n};\n\nfunction labelTextOf(group: NavGroup) {\n  if (group.team) {\n    return group.team.name;\n  }\n  return group.label;\n}\n\nfunction GroupLabel({\n  group,\n  isCollapsed,\n}: {\n  group: NavGroup;\n  isCollapsed: boolean;\n}) {\n  const labelText = labelTextOf(group);\n  if (!labelText) {\n    return null;\n  }\n\n  return (\n    <p className='text-muted-foreground flex h-6 items-center gap-2 px-2 text-xs font-medium'>\n      {group.team && <EntityTile entity={group.team} size='xs' />}\n      <span className={cn('truncate', isCollapsed && 'sr-only')}>\n        {labelText}\n      </span>\n    </p>\n  );\n}\n\nexport function AppSidebar({\n  workspaces,\n  workspace,\n  onWorkspaceChange,\n  groups,\n  activePageId,\n  counts,\n  person,\n  isCollapsed,\n  onNavigate,\n  onOpenSearch,\n  onCreate,\n}: AppSidebarProps) {\n  const indicatorId = useId();\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const morph = morphOf(shouldReduceMotion);\n\n  function selectItem(item: NavItem) {\n    onNavigate(item.id);\n  }\n\n  return (\n    <div className='flex h-full min-h-0 flex-col gap-3'>\n      <div className='flex flex-col gap-2'>\n        <motion.div layout='position' transition={morph} className='flex'>\n          <WorkspaceSwitcher\n            workspaces={workspaces}\n            current={workspace}\n            isCollapsed={isCollapsed}\n            onSelect={onWorkspaceChange}\n          />\n        </motion.div>\n        <div className={cn('flex gap-2', isCollapsed && 'flex-col')}>\n          <motion.div\n            layout='position'\n            transition={morph}\n            className='flex min-w-0 flex-1'\n          >\n            <SearchTrigger isCollapsed={isCollapsed} onOpen={onOpenSearch} />\n          </motion.div>\n          <motion.div layout='position' transition={morph} className='flex'>\n            <QuickCreateMenu isCollapsed={isCollapsed} onCreate={onCreate} />\n          </motion.div>\n        </div>\n      </div>\n      <motion.nav\n        layout='position'\n        transition={morph}\n        aria-label='Main'\n        className='-mx-2 flex min-h-0 flex-1 flex-col gap-4 overflow-x-hidden overflow-y-auto px-2'\n      >\n        {groups.map((group) => (\n          <div key={group.id} className='flex flex-col gap-0.5'>\n            <GroupLabel group={group} isCollapsed={isCollapsed} />\n            <ul className='flex flex-col gap-px'>\n              {group.items.map((item) => (\n                <NavRow\n                  key={item.id}\n                  item={item}\n                  isActive={item.id === activePageId}\n                  isCollapsed={isCollapsed}\n                  indicatorId={indicatorId}\n                  count={counts[item.id]}\n                  onSelect={selectItem}\n                />\n              ))}\n            </ul>\n          </div>\n        ))}\n      </motion.nav>\n      <AccountMenu person={person} isCollapsed={isCollapsed} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/app-sidebar.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/sidebar-parts.tsx",
      "content": "'use client';\n\nimport { motion, type Transition } from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { MeshTile } from '@/registry/ndeko/ui/mesh-tile';\n\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n} from '@/registry/ndeko/ui/tooltip';\n\nimport type { Entity, NavItem, Person } from './data';\n\nexport const NAV_ROW = [\n  'relative flex h-7 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left text-[13px] font-medium text-foreground outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n  \"[&_svg]:pointer-events-none [&_svg]:relative [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n].join(' ');\n\nconst INDICATOR_TRAVEL: Transition = {\n  duration: 0.25,\n  ease: [0.77, 0, 0.175, 1],\n};\n\nconst INSTANT: Transition = { duration: 0 };\n\n/** The spring of the rail morph, the same as the width of the sidebar. */\nconst MORPH_SPRING: Transition = { type: 'spring', bounce: 0, duration: 0.3 };\n\nconst INDICATOR_RADIUS = { borderRadius: 6 };\n\nfunction travelOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return INDICATOR_TRAVEL;\n}\n\nexport function morphOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return MORPH_SPRING;\n}\n\n/** The one highlight of the active row. It travels from the old row to the new one and morphs with the rail. */\nexport function ActiveRowIndicator({ layoutId }: { layoutId: string }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n\n  return (\n    <motion.span\n      aria-hidden='true'\n      layout\n      layoutId={layoutId}\n      transition={travelOf(shouldReduceMotion)}\n      style={INDICATOR_RADIUS}\n      className='bg-foreground/[0.07] absolute inset-0'\n    />\n  );\n}\n\nconst TILE_SIZE = {\n  xs: 'size-4 rounded-[4px]',\n  sm: 'size-5 rounded-[5px]',\n  md: 'size-6 rounded-md',\n} as const;\n\n/** The picture of a team: a gradient drawn from its name, in its colour. */\nexport function EntityTile({\n  entity,\n  size = 'md',\n  className,\n}: {\n  entity: Entity;\n  size?: keyof typeof TILE_SIZE;\n  className?: string;\n}) {\n  return (\n    <MeshTile\n      seed={entity.name}\n      color={entity.color}\n      className={cn(TILE_SIZE[size], className)}\n    />\n  );\n}\n\nexport function PersonAvatar({\n  person,\n  className,\n}: {\n  person: Person;\n  className?: string;\n}) {\n  return <Avatar className={className} seed={person.name} />;\n}\n\nexport function ariaCurrentOf(isActive: boolean) {\n  if (isActive) {\n    return 'page' as const;\n  }\n  return undefined;\n}\n\ntype NavRowProps = {\n  item: NavItem;\n  isActive: boolean;\n  isCollapsed: boolean;\n  indicatorId: string;\n  count?: number;\n  onSelect: (item: NavItem) => void;\n};\n\nexport function NavRow({\n  item,\n  isActive,\n  isCollapsed,\n  indicatorId,\n  count = 0,\n  onSelect,\n}: NavRowProps) {\n  const hasCount = count > 0;\n  const showsCount = hasCount && !isCollapsed;\n  const showsCountDot = hasCount && isCollapsed;\n  const ItemIcon = item.icon;\n  const ariaCurrent = ariaCurrentOf(isActive);\n\n  function selectItem() {\n    onSelect(item);\n  }\n\n  return (\n    <li>\n      <Tooltip disabled={!isCollapsed}>\n        <TooltipTrigger\n          type='button'\n          aria-current={ariaCurrent}\n          onClick={selectItem}\n          className={NAV_ROW}\n        >\n          {isActive && <ActiveRowIndicator layoutId={indicatorId} />}\n          <span className='relative flex'>\n            <ItemIcon />\n            {showsCountDot && (\n              <span className='bg-primary ring-sidebar absolute -top-0.5 -right-0.5 size-1.5 rounded-full ring-2' />\n            )}\n          </span>\n          <span\n            className={cn(\n              'relative min-w-0 flex-1 truncate',\n              isCollapsed && 'sr-only'\n            )}\n          >\n            {item.label}\n            {showsCountDot && <span>{`, ${count}`}</span>}\n          </span>\n          {showsCount && (\n            <MotionNumber\n              value={count}\n              className='text-muted-foreground text-xs font-normal'\n            />\n          )}\n        </TooltipTrigger>\n        <TooltipContent side='right' className='flex items-center gap-2'>\n          {item.label}\n          {hasCount && (\n            <span className='text-muted-foreground tabular-nums'>{count}</span>\n          )}\n        </TooltipContent>\n      </Tooltip>\n    </li>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/sidebar-parts.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/workspace-switcher.tsx",
      "content": "'use client';\n\nimport {\n  ChevronsUpDownIcon,\n  PlusIcon,\n  SettingsIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { CompanyMark } from '@/registry/ndeko/ui/company-mark';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { Workspace } from './data';\n\nconst TRIGGER = [\n  'flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-1 text-left outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 data-popup-open:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\nfunction memberCountLabelOf(count: number) {\n  if (count === 1) {\n    return '1 member';\n  }\n  return `${count} members`;\n}\n\ntype WorkspaceSwitcherProps = {\n  workspaces: Workspace[];\n  current: Workspace;\n  isCollapsed: boolean;\n  onSelect: (workspaceId: string) => void;\n};\n\nexport function WorkspaceSwitcher({\n  workspaces,\n  current,\n  isCollapsed,\n  onSelect,\n}: WorkspaceSwitcherProps) {\n  function selectWorkspace(value: unknown) {\n    if (typeof value === 'string') {\n      onSelect(value);\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Workspace: ${current.name}`}\n            className={TRIGGER}\n          />\n        }\n      >\n        <CompanyMark seed={current.name} className='size-6 rounded-md' />\n        {!isCollapsed && (\n          <>\n            <span className='min-w-0 flex-1 truncate text-[13px] font-semibold'>\n              {current.name}\n            </span>\n            <ChevronsUpDownIcon className='text-muted-foreground size-3.5 shrink-0' />\n          </>\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-64'>\n        <DropdownMenuLabel>Workspaces</DropdownMenuLabel>\n        <DropdownMenuRadioGroup\n          value={current.id}\n          onValueChange={selectWorkspace}\n        >\n          {workspaces.map((workspace) => (\n            <DropdownMenuRadioItem\n              key={workspace.id}\n              value={workspace.id}\n              closeOnClick\n              className='h-9'\n            >\n              <CompanyMark seed={workspace.name} />\n              <span className='min-w-0 flex-1 truncate'>{workspace.name}</span>\n              <Kbd aria-hidden='true'>{workspace.memberCount}</Kbd>\n              <span className='sr-only'>\n                {memberCountLabelOf(workspace.memberCount)}\n              </span>\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n        <DropdownMenuSeparator />\n        <DropdownMenuItem>\n          <SettingsIcon />\n          Workspace settings\n        </DropdownMenuItem>\n        <DropdownMenuItem>\n          <PlusIcon />\n          Add workspace\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/workspace-switcher.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/search-palette.tsx",
      "content": "'use client';\n\nimport { CircleCheckIcon, SearchIcon } from '@/registry/ndeko/lib/icons';\nimport { CONTROL_RECIPE } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  CommandDialog,\n  CommandEmpty,\n  CommandGroup,\n  CommandInput,\n  CommandItem,\n  CommandList,\n  CommandShortcut,\n} from '@/registry/ndeko/ui/command';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n} from '@/registry/ndeko/ui/tooltip';\n\nimport type { NavGroup, PageId } from './data';\n\nfunction headingOf(group: NavGroup) {\n  if (group.team) {\n    return group.team.name;\n  }\n  if (group.label) {\n    return group.label;\n  }\n  return 'Personal';\n}\n\nconst SEARCH_FIELD =\n  'text-muted-foreground flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2.5 text-left';\n\nconst SEARCH_ICON_BUTTON =\n  'text-muted-foreground flex size-8 shrink-0 cursor-pointer items-center justify-center px-0';\n\ntype SearchTriggerProps = {\n  isCollapsed: boolean;\n  onOpen: () => void;\n};\n\nexport function SearchTrigger({ isCollapsed, onOpen }: SearchTriggerProps) {\n  if (isCollapsed) {\n    return (\n      <Tooltip>\n        <TooltipTrigger\n          type='button'\n          aria-label='Search'\n          onClick={onOpen}\n          className={cn(CONTROL_RECIPE, SEARCH_ICON_BUTTON)}\n        >\n          <SearchIcon className='size-4' />\n        </TooltipTrigger>\n        <TooltipContent side='right' className='flex items-center gap-2'>\n          Search\n          <Kbd>⌘K</Kbd>\n        </TooltipContent>\n      </Tooltip>\n    );\n  }\n\n  return (\n    <button\n      type='button'\n      onClick={onOpen}\n      className={cn(CONTROL_RECIPE, SEARCH_FIELD)}\n    >\n      <SearchIcon className='size-4 shrink-0' />\n      <span className='min-w-0 flex-1 truncate'>Search</span>\n      <Kbd>⌘K</Kbd>\n    </button>\n  );\n}\n\ntype CommandPaletteProps = {\n  open: boolean;\n  onOpenChange: (open: boolean) => void;\n  groups: NavGroup[];\n  onNavigate: (pageId: PageId) => void;\n  onCreateTask: () => void;\n};\n\nexport function CommandPalette({\n  open,\n  onOpenChange,\n  groups,\n  onNavigate,\n  onCreateTask,\n}: CommandPaletteProps) {\n  function closePalette() {\n    onOpenChange(false);\n  }\n\n  function createTask() {\n    closePalette();\n    onCreateTask();\n  }\n\n  return (\n    <CommandDialog\n      open={open}\n      onOpenChange={onOpenChange}\n      title='Search'\n      description='Go to a page or run an action'\n    >\n      <CommandInput placeholder='Go to a page or run an action' />\n      <CommandList>\n        <CommandEmpty>Nothing matches. Try the name of a page.</CommandEmpty>\n        <CommandGroup heading='Actions'>\n          <CommandItem onSelect={createTask}>\n            <CircleCheckIcon />\n            New task\n            <CommandShortcut>C</CommandShortcut>\n          </CommandItem>\n        </CommandGroup>\n        {groups.map((group) => (\n          <CommandGroup key={group.id} heading={headingOf(group)}>\n            {group.items.map((item) => {\n              const ItemIcon = item.icon;\n\n              function goToPage() {\n                closePalette();\n                onNavigate(item.id);\n              }\n\n              return (\n                <CommandItem\n                  key={item.id}\n                  value={`${group.id} ${item.label}`}\n                  onSelect={goToPage}\n                >\n                  <ItemIcon />\n                  {item.label}\n                </CommandItem>\n              );\n            })}\n          </CommandGroup>\n        ))}\n      </CommandList>\n    </CommandDialog>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/search-palette.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/quick-create-menu.tsx",
      "content": "'use client';\n\nimport {\n  CircleCheckIcon,\n  FolderPlusIcon,\n  PlusIcon,\n  UserRoundPlusIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n} from '@/registry/ndeko/ui/tooltip';\n\nexport type CreateKind = 'task' | 'project' | 'invite';\n\ntype QuickCreateMenuProps = {\n  onCreate: (kind: CreateKind) => void;\n  isCollapsed: boolean;\n};\n\nfunction menuSideOf(isCollapsed: boolean) {\n  if (isCollapsed) {\n    return 'right' as const;\n  }\n  return 'bottom' as const;\n}\n\nfunction menuAlignOf(isCollapsed: boolean) {\n  if (isCollapsed) {\n    return 'start' as const;\n  }\n  return 'end' as const;\n}\n\nexport function QuickCreateMenu({\n  onCreate,\n  isCollapsed,\n}: QuickCreateMenuProps) {\n  const menuSide = menuSideOf(isCollapsed);\n  const menuAlign = menuAlignOf(isCollapsed);\n\n  function createTask() {\n    onCreate('task');\n  }\n\n  function createProject() {\n    onCreate('project');\n  }\n\n  function invitePeople() {\n    onCreate('invite');\n  }\n\n  return (\n    <DropdownMenu>\n      <Tooltip disabled={!isCollapsed}>\n        <TooltipTrigger\n          render={\n            <DropdownMenuTrigger\n              render={\n                <Button variant='outline' size='icon' aria-label='Create' />\n              }\n            />\n          }\n        >\n          <PlusIcon />\n        </TooltipTrigger>\n        <TooltipContent side='right'>Create</TooltipContent>\n      </Tooltip>\n      <DropdownMenuContent side={menuSide} align={menuAlign} className='w-52'>\n        <DropdownMenuItem onClick={createTask}>\n          <CircleCheckIcon />\n          New task\n          <Kbd className='ml-auto'>C</Kbd>\n        </DropdownMenuItem>\n        <DropdownMenuItem onClick={createProject}>\n          <FolderPlusIcon />\n          New project\n        </DropdownMenuItem>\n        <DropdownMenuItem onClick={invitePeople}>\n          <UserRoundPlusIcon />\n          Invite people\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/quick-create-menu.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/account-menu.tsx",
      "content": "'use client';\n\nimport {\n  ChevronsUpDownIcon,\n  CommandIcon,\n  LifeBuoyIcon,\n  LogOutIcon,\n  SettingsIcon,\n  UserIcon,\n} from '@/registry/ndeko/lib/icons';\nimport {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { Person } from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst TRIGGER = [\n  'flex h-9 w-full min-w-0 items-center gap-2 rounded-md px-1 text-left outline-none',\n  'transition-colors duration-150 hover:bg-foreground/5 data-popup-open:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\nexport function AccountMenuItems({ person }: { person: Person }) {\n  return (\n    <>\n      <div className='flex items-center gap-2.5 px-2 py-2'>\n        <PersonAvatar person={person} />\n        <div className='min-w-0'>\n          <p className='truncate text-[13px] font-medium'>{person.name}</p>\n          <p className='text-muted-foreground truncate text-xs'>\n            {person.role}\n          </p>\n        </div>\n      </div>\n      <DropdownMenuSeparator />\n      <DropdownMenuItem>\n        <UserIcon />\n        Profile\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <SettingsIcon />\n        Preferences\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <CommandIcon />\n        Keyboard shortcuts\n        <Kbd className='ml-auto'>?</Kbd>\n      </DropdownMenuItem>\n      <DropdownMenuItem>\n        <LifeBuoyIcon />\n        Help and docs\n      </DropdownMenuItem>\n      <DropdownMenuSeparator />\n      <DropdownMenuItem variant='destructive'>\n        <LogOutIcon />\n        Log out\n      </DropdownMenuItem>\n    </>\n  );\n}\n\nexport function AccountMenu({\n  person,\n  isCollapsed,\n}: {\n  person: Person;\n  isCollapsed: boolean;\n}) {\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Account: ${person.name}`}\n            className={TRIGGER}\n          />\n        }\n      >\n        <PersonAvatar person={person} className='size-6 text-[10px]' />\n        {!isCollapsed && (\n          <>\n            <span className='min-w-0 flex-1 truncate text-[13px] font-medium'>\n              {person.name}\n            </span>\n            <ChevronsUpDownIcon className='text-muted-foreground size-3.5 shrink-0' />\n          </>\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent side='top' align='start' className='w-60'>\n        <AccountMenuItems person={person} />\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/account-menu.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/top-bar.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  ArrowLeftToLineIcon,\n  ArrowRightToLineIcon,\n  MenuIcon,\n} from '@/registry/ndeko/lib/icons';\nimport {\n  Breadcrumb,\n  BreadcrumbItem,\n  BreadcrumbList,\n  BreadcrumbPage,\n  BreadcrumbSeparator,\n} from '@/registry/ndeko/ui/breadcrumb';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n} from '@/registry/ndeko/ui/tooltip';\n\nimport type { NavItem, Person } from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst STACK_LIMIT = 4;\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\nconst SWAP_VARIANTS: Variants = {\n  enter: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n  visible: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n  exit: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n};\n\nconst FADE_VARIANTS: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n};\n\nfunction swapVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SWAP_VARIANTS;\n}\n\nfunction toggleLabelOf(isCollapsed: boolean) {\n  if (isCollapsed) {\n    return 'Expand sidebar';\n  }\n  return 'Collapse sidebar';\n}\n\nfunction ToggleGlyph({ isCollapsed }: { isCollapsed: boolean }) {\n  if (isCollapsed) {\n    return <ArrowRightToLineIcon />;\n  }\n  return <ArrowLeftToLineIcon />;\n}\n\nfunction SidebarToggle({\n  isCollapsed,\n  onToggle,\n}: {\n  isCollapsed: boolean;\n  onToggle: () => void;\n}) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n  const label = toggleLabelOf(isCollapsed);\n  const glyphKey = String(isCollapsed);\n\n  return (\n    <Tooltip>\n      <TooltipTrigger\n        render={\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label={label}\n            aria-expanded={!isCollapsed}\n            onClick={onToggle}\n            className='text-muted-foreground hidden md:inline-flex'\n          />\n        }\n      >\n        <AnimatePresence mode='popLayout' initial={false}>\n          <motion.span\n            key={glyphKey}\n            className='flex'\n            variants={variants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            transition={SWAP_TRANSITION}\n          >\n            <ToggleGlyph isCollapsed={isCollapsed} />\n          </motion.span>\n        </AnimatePresence>\n      </TooltipTrigger>\n      <TooltipContent side='bottom'>{label}</TooltipContent>\n    </Tooltip>\n  );\n}\n\nfunction AvatarStack({ people }: { people: Person[] }) {\n  const shown = people.slice(0, STACK_LIMIT);\n  const hiddenCount = people.length - shown.length;\n  const hasHidden = hiddenCount > 0;\n\n  return (\n    <div\n      role='group'\n      aria-label='Team members'\n      className='hidden items-center sm:flex'\n    >\n      {shown.map((person) => (\n        <PersonAvatar\n          key={person.id}\n          person={person}\n          className='ring-background -ml-1.5 size-6 text-[10px] ring-2 first:ml-0'\n        />\n      ))}\n      {hasHidden && (\n        <span className='bg-muted text-muted-foreground ring-background -ml-1.5 inline-flex size-6 items-center justify-center rounded-full text-[10px] font-medium tabular-nums ring-2'>\n          +{hiddenCount}\n        </span>\n      )}\n    </div>\n  );\n}\n\ntype TopBarProps = {\n  page: NavItem;\n  ancestor?: string;\n  people: Person[];\n  isSidebarCollapsed: boolean;\n  onToggleSidebar: () => void;\n  onOpenNavigation: () => void;\n};\n\nexport function TopBar({\n  page,\n  ancestor,\n  people,\n  isSidebarCollapsed,\n  onToggleSidebar,\n  onOpenNavigation,\n}: TopBarProps) {\n  const PageIcon = page.icon;\n  const hasAncestor = Boolean(ancestor);\n\n  return (\n    <header className='hairline-b border-border flex h-11 shrink-0 items-center gap-2 px-3 md:px-4'>\n      <Button\n        variant='ghost'\n        size='icon-sm'\n        aria-label='Open navigation'\n        onClick={onOpenNavigation}\n        className='text-muted-foreground md:hidden'\n      >\n        <MenuIcon />\n      </Button>\n      <SidebarToggle\n        isCollapsed={isSidebarCollapsed}\n        onToggle={onToggleSidebar}\n      />\n      <Breadcrumb className='min-w-0'>\n        <BreadcrumbList className='flex-nowrap'>\n          <li aria-hidden='true' className='flex'>\n            <PageIcon className='text-muted-foreground size-4 shrink-0' />\n          </li>\n          {hasAncestor && (\n            <>\n              <BreadcrumbItem className='hidden sm:inline-flex'>\n                {ancestor}\n              </BreadcrumbItem>\n              <BreadcrumbSeparator className='hidden sm:block' />\n            </>\n          )}\n          <BreadcrumbItem className='min-w-0'>\n            <BreadcrumbPage className='truncate'>{page.label}</BreadcrumbPage>\n          </BreadcrumbItem>\n        </BreadcrumbList>\n      </Breadcrumb>\n      <div className='ml-auto flex items-center gap-2'>\n        <AvatarStack people={people} />\n      </div>\n    </header>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/top-bar.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/page-views.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  CircleCheckIcon,\n  CircleIcon,\n  FolderIcon,\n  InboxIcon,\n  PlusIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Badge } from '@/registry/ndeko/ui/badge';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Tabs, TabsList, TabsTab } from '@/registry/ndeko/ui/tabs';\n\nimport {\n  CURRENT_USER_ID,\n  personOf,\n  projectOf,\n  type EmptyPage,\n  type Notification,\n  type Person,\n  type Project,\n  type Task,\n} from './data';\nimport { PersonAvatar } from './sidebar-parts';\n\nconst LIST_SURFACE =\n  'bg-card hairline-ring ring-border overflow-hidden rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.04)]';\n\nconst PRESENCE_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst PRESENCE_OUT: Transition = { duration: 0.14, ease: [0.23, 1, 0.32, 1] };\n\nconst ROW_PRESENCE: Variants = {\n  hidden: { height: 0, opacity: 0, transition: PRESENCE_OUT },\n  shown: { height: 'auto', opacity: 1, transition: PRESENCE_IN },\n};\n\nconst ROW_FADE: Variants = {\n  hidden: { opacity: 0, transition: PRESENCE_OUT },\n  shown: { opacity: 1, transition: PRESENCE_IN },\n};\n\nfunction rowVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return ROW_FADE;\n  }\n  return ROW_PRESENCE;\n}\n\nfunction countLabel(count: number, singular: string, plural: string) {\n  if (count === 1) {\n    return `1 ${singular}`;\n  }\n  return `${count} ${plural}`;\n}\n\nfunction PresenceRow({\n  children,\n  className,\n}: {\n  children: React.ReactNode;\n  className?: string;\n}) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = rowVariantsOf(shouldReduceMotion);\n\n  return (\n    <motion.li\n      variants={variants}\n      initial='hidden'\n      animate='shown'\n      exit='hidden'\n      className={cn('overflow-hidden', className)}\n    >\n      {children}\n    </motion.li>\n  );\n}\n\nfunction PageToolbar({\n  title,\n  meta,\n  children,\n}: {\n  title: string;\n  meta: string;\n  children?: React.ReactNode;\n}) {\n  return (\n    <div className='flex shrink-0 flex-wrap items-center gap-x-3 gap-y-2 px-4 py-3 md:px-6'>\n      <div className='flex min-w-0 items-baseline gap-2'>\n        <h1 className='truncate text-lg font-semibold text-balance'>{title}</h1>\n        <span className='text-muted-foreground shrink-0 text-xs tabular-nums'>\n          {meta}\n        </span>\n      </div>\n      <div className='ml-auto flex items-center gap-2'>{children}</div>\n    </div>\n  );\n}\n\nfunction PageBody({ children }: { children: React.ReactNode }) {\n  return (\n    <div className='min-h-0 flex-1 overflow-y-auto p-4 md:p-6'>\n      <div className='mx-auto w-full max-w-4xl'>{children}</div>\n    </div>\n  );\n}\n\nfunction EmptyState({\n  icon: StateIcon,\n  title,\n  line,\n  children,\n}: {\n  icon: Icon;\n  title: string;\n  line: string;\n  children?: React.ReactNode;\n}) {\n  return (\n    <div className='flex flex-col items-center gap-3 px-4 py-16 text-center'>\n      <span className='keycap-3d text-muted-foreground flex size-10 items-center justify-center rounded-lg'>\n        <StateIcon className='size-5' />\n      </span>\n      <div className='flex flex-col gap-1'>\n        <p className='text-sm font-medium text-balance'>{title}</p>\n        <p className='text-muted-foreground max-w-xs text-[13px] text-balance'>\n          {line}\n        </p>\n      </div>\n      {children}\n    </div>\n  );\n}\n\ntype Scope = 'active' | 'done';\n\nfunction isScope(value: unknown): value is Scope {\n  const isActive = value === 'active';\n  const isDone = value === 'done';\n  return isActive || isDone;\n}\n\nfunction isInScope(task: Task, scope: Scope) {\n  if (scope === 'done') {\n    return task.isDone;\n  }\n  return !task.isDone;\n}\n\nfunction toggleLabelOf(task: Task) {\n  if (task.isDone) {\n    return `Reopen ${task.number}`;\n  }\n  return `Mark ${task.number} as done`;\n}\n\nfunction StatusGlyph({ isDone }: { isDone: boolean }) {\n  if (isDone) {\n    return <CircleCheckIcon className='text-success-foreground size-4' />;\n  }\n  return <CircleIcon className='text-muted-foreground size-4' />;\n}\n\nfunction TaskRow({\n  task,\n  showAssignee,\n  onToggle,\n}: {\n  task: Task;\n  showAssignee: boolean;\n  onToggle: (taskId: string) => void;\n}) {\n  const project = projectOf(task.projectId);\n  const assignee = personOf(task.assigneeId);\n\n  function toggleTask() {\n    onToggle(task.id);\n  }\n\n  return (\n    <div className='flex h-10 items-center gap-3 px-3'>\n      <button\n        type='button'\n        aria-label={toggleLabelOf(task)}\n        onClick={toggleTask}\n        className='hover:bg-foreground/5 focus-visible:ring-ring/25 -m-1 flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md outline-none focus-visible:ring-[3px]'\n      >\n        <StatusGlyph isDone={task.isDone} />\n      </button>\n      <span className='text-muted-foreground w-14 shrink-0 text-xs tabular-nums'>\n        {task.number}\n      </span>\n      <span\n        className={cn(\n          'min-w-0 flex-1 truncate text-[13px]',\n          task.isDone && 'text-muted-foreground'\n        )}\n      >\n        {task.title}\n      </span>\n      <Badge\n        variant='secondary'\n        className='text-muted-foreground hidden sm:inline-flex'\n      >\n        {project.name}\n      </Badge>\n      <span className='text-muted-foreground hidden w-20 shrink-0 text-right text-xs md:block'>\n        {task.due}\n      </span>\n      {showAssignee && (\n        <PersonAvatar person={assignee} className='size-6 text-[10px]' />\n      )}\n    </div>\n  );\n}\n\ntype TaskListPageProps = {\n  title: string;\n  tasks: Task[];\n  showAssignee: boolean;\n  onToggleTask: (taskId: string) => void;\n  onCreateTask: () => void;\n};\n\nexport function TaskListPage({\n  title,\n  tasks,\n  showAssignee,\n  onToggleTask,\n  onCreateTask,\n}: TaskListPageProps) {\n  const [scope, setScope] = useState<Scope>('active');\n  const activeTasks = tasks.filter((task) => !task.isDone);\n  const doneTasks = tasks.filter((task) => task.isDone);\n  const visibleTasks = tasks.filter((task) => isInScope(task, scope));\n  const isEmpty = visibleTasks.length === 0;\n  const isActiveScope = scope === 'active';\n  const showsActiveEmpty = isEmpty && isActiveScope;\n  const showsDoneEmpty = isEmpty && !isActiveScope;\n  const meta = countLabel(activeTasks.length, 'open task', 'open tasks');\n\n  function changeScope(value: unknown) {\n    if (isScope(value)) {\n      setScope(value);\n    }\n  }\n\n  function showDone() {\n    setScope('done');\n  }\n\n  function showActive() {\n    setScope('active');\n  }\n\n  return (\n    <>\n      <PageToolbar title={title} meta={meta}>\n        <Tabs value={scope} onValueChange={changeScope}>\n          <TabsList variant='segmented' aria-label='Tasks to show'>\n            <TabsTab value='active'>\n              Active\n              <span className='text-muted-foreground text-xs tabular-nums'>\n                {activeTasks.length}\n              </span>\n            </TabsTab>\n            <TabsTab value='done'>\n              Done\n              <span className='text-muted-foreground text-xs tabular-nums'>\n                {doneTasks.length}\n              </span>\n            </TabsTab>\n          </TabsList>\n        </Tabs>\n        <Button onClick={onCreateTask}>\n          <PlusIcon />\n          New task\n        </Button>\n      </PageToolbar>\n      <PageBody>\n        {showsActiveEmpty && (\n          <EmptyState\n            icon={CircleCheckIcon}\n            title='Nothing left to do'\n            line='Every task on this list is done'\n          >\n            <Button variant='outline' onClick={showDone}>\n              Show done tasks\n            </Button>\n          </EmptyState>\n        )}\n        {showsDoneEmpty && (\n          <EmptyState\n            icon={CircleIcon}\n            title='No finished task yet'\n            line='Tasks you mark as done move here'\n          >\n            <Button variant='outline' onClick={showActive}>\n              Show active tasks\n            </Button>\n          </EmptyState>\n        )}\n        {!isEmpty && (\n          <ul className={LIST_SURFACE}>\n            <AnimatePresence initial={false}>\n              {visibleTasks.map((task) => (\n                <PresenceRow key={task.id}>\n                  <TaskRow\n                    task={task}\n                    showAssignee={showAssignee}\n                    onToggle={onToggleTask}\n                  />\n                </PresenceRow>\n              ))}\n            </AnimatePresence>\n          </ul>\n        )}\n      </PageBody>\n    </>\n  );\n}\n\ntype InboxScope = 'unread' | 'all';\n\nfunction isInboxScope(value: unknown): value is InboxScope {\n  const isUnread = value === 'unread';\n  const isAll = value === 'all';\n  return isUnread || isAll;\n}\n\nfunction NotificationRow({\n  notification,\n  onRead,\n}: {\n  notification: Notification;\n  onRead: (notificationId: string) => void;\n}) {\n  const actor = personOf(notification.actorId);\n\n  function readNotification() {\n    onRead(notification.id);\n  }\n\n  return (\n    <button\n      type='button'\n      onClick={readNotification}\n      className='hover:bg-foreground/[0.025] focus-visible:ring-ring/25 flex w-full cursor-pointer items-center gap-3 px-3 py-2.5 text-left outline-none focus-visible:ring-[3px] focus-visible:ring-inset'\n    >\n      <span className='flex w-1.5 shrink-0 justify-center'>\n        {notification.isUnread && (\n          <span className='bg-primary size-1.5 rounded-full'>\n            <span className='sr-only'>Unread</span>\n          </span>\n        )}\n      </span>\n      <PersonAvatar person={actor} className='size-7 text-[10px]' />\n      <span className='min-w-0 flex-1'>\n        <span className='block truncate text-[13px]'>\n          <span className='font-medium'>{actor.name}</span>{' '}\n          {notification.action}\n        </span>\n        <span className='text-muted-foreground block truncate text-xs'>\n          {notification.subject}\n        </span>\n      </span>\n      <span className='text-muted-foreground shrink-0 text-xs'>\n        {notification.time}\n      </span>\n    </button>\n  );\n}\n\ntype InboxPageProps = {\n  notifications: Notification[];\n  onRead: (notificationId: string) => void;\n  onReadAll: () => void;\n};\n\nexport function InboxPage({\n  notifications,\n  onRead,\n  onReadAll,\n}: InboxPageProps) {\n  const [scope, setScope] = useState<InboxScope>('unread');\n  const unreadNotifications = notifications.filter((note) => note.isUnread);\n  const unreadCount = unreadNotifications.length;\n  const hasUnread = unreadCount > 0;\n  const isUnreadScope = scope === 'unread';\n  let visibleNotifications = notifications;\n  if (isUnreadScope) {\n    visibleNotifications = unreadNotifications;\n  }\n  const isEmpty = visibleNotifications.length === 0;\n  const meta = countLabel(unreadCount, 'unread', 'unread');\n\n  function changeScope(value: unknown) {\n    if (isInboxScope(value)) {\n      setScope(value);\n    }\n  }\n\n  function showAll() {\n    setScope('all');\n  }\n\n  return (\n    <>\n      <PageToolbar title='Inbox' meta={meta}>\n        <Tabs value={scope} onValueChange={changeScope}>\n          <TabsList variant='segmented' aria-label='Notifications to show'>\n            <TabsTab value='unread'>Unread</TabsTab>\n            <TabsTab value='all'>All</TabsTab>\n          </TabsList>\n        </Tabs>\n        <Button variant='outline' disabled={!hasUnread} onClick={onReadAll}>\n          Mark all as read\n        </Button>\n      </PageToolbar>\n      <PageBody>\n        {isEmpty && (\n          <EmptyState\n            icon={InboxIcon}\n            title='You are all caught up'\n            line='Earlier notifications stay under All'\n          >\n            <Button variant='outline' onClick={showAll}>\n              Show all notifications\n            </Button>\n          </EmptyState>\n        )}\n        {!isEmpty && (\n          <ul className={LIST_SURFACE}>\n            <AnimatePresence initial={false}>\n              {visibleNotifications.map((notification) => (\n                <PresenceRow key={notification.id}>\n                  <NotificationRow\n                    notification={notification}\n                    onRead={onRead}\n                  />\n                </PresenceRow>\n              ))}\n            </AnimatePresence>\n          </ul>\n        )}\n      </PageBody>\n    </>\n  );\n}\n\ntype ProjectsPageProps = {\n  projects: Project[];\n  tasks: Task[];\n  onCreateProject: () => void;\n};\n\nexport function ProjectsPage({\n  projects,\n  tasks,\n  onCreateProject,\n}: ProjectsPageProps) {\n  const meta = countLabel(projects.length, 'project', 'projects');\n\n  function openCountOf(projectId: string) {\n    const openTasks = tasks.filter((task) => {\n      const isOfProject = task.projectId === projectId;\n      return isOfProject && !task.isDone;\n    });\n    return openTasks.length;\n  }\n\n  return (\n    <>\n      <PageToolbar title='Projects' meta={meta}>\n        <Button onClick={onCreateProject}>\n          <PlusIcon />\n          New project\n        </Button>\n      </PageToolbar>\n      <PageBody>\n        <ul className={LIST_SURFACE}>\n          <AnimatePresence initial={false}>\n            {projects.map((project) => {\n              const lead = personOf(project.leadId);\n              const openCount = openCountOf(project.id);\n              return (\n                <PresenceRow key={project.id}>\n                  <div className='flex h-12 items-center gap-3 px-3'>\n                    <span className='keycap-3d text-muted-foreground flex size-7 shrink-0 items-center justify-center rounded-md'>\n                      <FolderIcon className='size-4' />\n                    </span>\n                    <span className='min-w-0 flex-1 truncate text-[13px] font-medium'>\n                      {project.name}\n                    </span>\n                    <span className='text-muted-foreground shrink-0 text-xs tabular-nums'>\n                      {countLabel(openCount, 'open task', 'open tasks')}\n                    </span>\n                    <span className='hidden w-36 shrink-0 items-center gap-2 sm:flex'>\n                      <PersonAvatar\n                        person={lead}\n                        className='size-6 text-[10px]'\n                      />\n                      <span className='text-muted-foreground truncate text-xs'>\n                        {lead.name}\n                      </span>\n                    </span>\n                  </div>\n                </PresenceRow>\n              );\n            })}\n          </AnimatePresence>\n        </ul>\n      </PageBody>\n    </>\n  );\n}\n\nexport function MembersPage({ people }: { people: Person[] }) {\n  const meta = countLabel(people.length, 'member', 'members');\n\n  return (\n    <>\n      <PageToolbar title='Members' meta={meta} />\n      <PageBody>\n        <ul className={LIST_SURFACE}>\n          {people.map((person) => {\n            const isCurrentUser = person.id === CURRENT_USER_ID;\n\n            return (\n              <li key={person.id} className='flex h-12 items-center gap-3 px-3'>\n                <PersonAvatar person={person} className='size-7 text-[10px]' />\n                <span className='flex min-w-0 flex-1 items-center gap-2'>\n                  <span className='truncate text-[13px] font-medium'>\n                    {person.name}\n                  </span>\n                  {isCurrentUser && (\n                    <Badge\n                      variant='secondary'\n                      className='text-muted-foreground'\n                    >\n                      You\n                    </Badge>\n                  )}\n                </span>\n                <span className='text-muted-foreground truncate text-xs'>\n                  {person.role}\n                </span>\n              </li>\n            );\n          })}\n        </ul>\n      </PageBody>\n    </>\n  );\n}\n\nexport function EmptyPageView({\n  title,\n  icon,\n  page,\n}: {\n  title: string;\n  icon: Icon;\n  page: EmptyPage;\n}) {\n  return (\n    <>\n      <PageToolbar title={title} meta='Product team' />\n      <PageBody>\n        <EmptyState icon={icon} title={page.title} line={page.line} />\n      </PageBody>\n    </>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/page-views.tsx"
    },
    {
      "path": "registry/ndeko/blocks/app-shells/app-shells-02/data.ts",
      "content": "import {\n  CircleCheckIcon,\n  ClockIcon,\n  FolderIcon,\n  InboxIcon,\n  LayersIcon,\n  RefreshCwIcon,\n  UsersIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\n\nexport type PageId =\n  | 'inbox'\n  | 'my-tasks'\n  | 'projects'\n  | 'members'\n  | 'team-tasks'\n  | 'team-cycles'\n  | 'team-timesheets';\n\nexport type Entity = {\n  id: string;\n  name: string;\n  color: string;\n};\n\nexport type Workspace = {\n  id: string;\n  name: string;\n  memberCount: number;\n};\n\nexport type NavItem = {\n  id: PageId;\n  label: string;\n  icon: Icon;\n};\n\nexport type NavGroup = {\n  id: string;\n  label?: string;\n  team?: Entity;\n  items: NavItem[];\n};\n\nexport type Person = {\n  id: string;\n  name: string;\n  role: string;\n};\n\nexport type Project = {\n  id: string;\n  name: string;\n  color: string;\n  leadId: string;\n};\n\nexport type Task = {\n  id: string;\n  number: string;\n  title: string;\n  projectId: string;\n  assigneeId: string;\n  due: string;\n  isDone: boolean;\n};\n\nexport type Notification = {\n  id: string;\n  actorId: string;\n  action: string;\n  subject: string;\n  time: string;\n  isUnread: boolean;\n};\n\nexport type EmptyPage = {\n  title: string;\n  line: string;\n};\n\nexport const WORKSPACES: Workspace[] = [\n  {\n    id: 'lattice',\n    name: 'Lattice Studio',\n    memberCount: 6,\n  },\n  {\n    id: 'quarry',\n    name: 'Quarry Works',\n    memberCount: 21,\n  },\n  {\n    id: 'moonridge',\n    name: 'Moonridge',\n    memberCount: 1,\n  },\n];\n\nexport const PRODUCT_TEAM: Entity = {\n  id: 'product',\n  name: 'Product',\n  color: 'var(--info)',\n};\n\nexport const CURRENT_USER_ID = 'amara';\n\nexport const PEOPLE: Person[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n    role: 'Product designer',\n  },\n  {\n    id: 'lucas',\n    name: 'Lucas Moreau',\n    role: 'Engineering lead',\n  },\n  {\n    id: 'priya',\n    name: 'Priya Raman',\n    role: 'Frontend engineer',\n  },\n  {\n    id: 'mateo',\n    name: 'Mateo Silva',\n    role: 'Backend engineer',\n  },\n  {\n    id: 'hana',\n    name: 'Hana Kobayashi',\n    role: 'Product manager',\n  },\n  {\n    id: 'jonas',\n    name: 'Jonas Weber',\n    role: 'QA engineer',\n  },\n];\n\nexport const PROJECTS: Project[] = [\n  {\n    id: 'onboarding',\n    name: 'Onboarding',\n    color: 'var(--primary)',\n    leadId: 'hana',\n  },\n  { id: 'reports', name: 'Reports', color: 'var(--info)', leadId: 'lucas' },\n  { id: 'billing', name: 'Billing', color: 'var(--warning)', leadId: 'mateo' },\n  {\n    id: 'design-system',\n    name: 'Design system',\n    color: 'var(--success)',\n    leadId: 'amara',\n  },\n];\n\nexport const NAV_GROUPS: NavGroup[] = [\n  {\n    id: 'personal',\n    items: [\n      { id: 'inbox', label: 'Inbox', icon: InboxIcon },\n      { id: 'my-tasks', label: 'My tasks', icon: CircleCheckIcon },\n    ],\n  },\n  {\n    id: 'workspace',\n    label: 'Workspace',\n    items: [\n      { id: 'projects', label: 'Projects', icon: FolderIcon },\n      { id: 'members', label: 'Members', icon: UsersIcon },\n    ],\n  },\n  {\n    id: 'team',\n    team: PRODUCT_TEAM,\n    items: [\n      { id: 'team-tasks', label: 'Tasks', icon: LayersIcon },\n      { id: 'team-cycles', label: 'Cycles', icon: RefreshCwIcon },\n      { id: 'team-timesheets', label: 'Timesheets', icon: ClockIcon },\n    ],\n  },\n];\n\nexport const TASKS: Task[] = [\n  {\n    id: 'task-142',\n    number: 'LAT-142',\n    title: 'Redraw the onboarding checklist for small screens',\n    projectId: 'onboarding',\n    assigneeId: 'amara',\n    due: 'Today',\n    isDone: false,\n  },\n  {\n    id: 'task-141',\n    number: 'LAT-141',\n    title: 'Paginate the invoices endpoint',\n    projectId: 'billing',\n    assigneeId: 'mateo',\n    due: 'Today',\n    isDone: false,\n  },\n  {\n    id: 'task-138',\n    number: 'LAT-138',\n    title: 'Review the empty states of the reports page',\n    projectId: 'reports',\n    assigneeId: 'amara',\n    due: 'Tomorrow',\n    isDone: false,\n  },\n  {\n    id: 'task-136',\n    number: 'LAT-136',\n    title: 'Chart the hours of the week as day bars',\n    projectId: 'reports',\n    assigneeId: 'priya',\n    due: 'Thursday',\n    isDone: false,\n  },\n  {\n    id: 'task-131',\n    number: 'LAT-131',\n    title: 'Pick the icon set for the billing settings',\n    projectId: 'billing',\n    assigneeId: 'amara',\n    due: 'Friday',\n    isDone: false,\n  },\n  {\n    id: 'task-129',\n    number: 'LAT-129',\n    title: 'Test the invitation flow on a slow network',\n    projectId: 'onboarding',\n    assigneeId: 'jonas',\n    due: 'Friday',\n    isDone: false,\n  },\n  {\n    id: 'task-127',\n    number: 'LAT-127',\n    title: 'Write the copy for the invitation e-mail',\n    projectId: 'onboarding',\n    assigneeId: 'amara',\n    due: 'Next week',\n    isDone: false,\n  },\n  {\n    id: 'task-119',\n    number: 'LAT-119',\n    title: 'Audit the contrast of the status chips',\n    projectId: 'design-system',\n    assigneeId: 'amara',\n    due: 'Monday',\n    isDone: true,\n  },\n  {\n    id: 'task-117',\n    number: 'LAT-117',\n    title: 'Plan the reports beta with two customers',\n    projectId: 'reports',\n    assigneeId: 'hana',\n    due: 'Monday',\n    isDone: true,\n  },\n];\n\nexport const NOTIFICATIONS: Notification[] = [\n  {\n    id: 'note-1',\n    actorId: 'lucas',\n    action: 'assigned you',\n    subject: 'LAT-142 Redraw the onboarding checklist',\n    time: '12 min',\n    isUnread: true,\n  },\n  {\n    id: 'note-2',\n    actorId: 'priya',\n    action: 'commented on',\n    subject: 'LAT-138 Review the empty states',\n    time: '1 h',\n    isUnread: true,\n  },\n  {\n    id: 'note-3',\n    actorId: 'jonas',\n    action: 'moved to In review',\n    subject: 'LAT-131 Pick the icon set',\n    time: '3 h',\n    isUnread: true,\n  },\n  {\n    id: 'note-4',\n    actorId: 'mateo',\n    action: 'mentioned you in',\n    subject: 'LAT-141 Paginate the invoices endpoint',\n    time: 'Yesterday',\n    isUnread: false,\n  },\n];\n\nexport const EMPTY_PAGES: Partial<Record<PageId, EmptyPage>> = {\n  'team-cycles': {\n    title: 'No cycle running',\n    line: 'A cycle is a time box of one or two weeks for the team’s tasks',\n  },\n  'team-timesheets': {\n    title: 'No time logged this week',\n    line: 'Hours the team logs on tasks appear here, day by day',\n  },\n};\n\nexport function personOf(personId: string) {\n  const person = PEOPLE.find((candidate) => candidate.id === personId);\n  if (person) {\n    return person;\n  }\n  return PEOPLE[0];\n}\n\nexport function projectOf(projectId: string) {\n  const project = PROJECTS.find((candidate) => candidate.id === projectId);\n  if (project) {\n    return project;\n  }\n  return PROJECTS[0];\n}\n",
      "type": "registry:component",
      "target": "components/blocks/app-shells-02/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "app-shells"
  ],
  "type": "registry:block"
}