{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "application-01",
  "title": "Team workspace",
  "description": "A Mossline workspace: a sidebar that hides and goes into a sheet on phones, My tasks grouped by status whose rows open a task drawer, an inbox behind the bell and as a page, a board whose moves change the same tasks, and the team with time today.",
  "dependencies": [
    "@dnd-kit/core",
    "@dnd-kit/sortable",
    "@dnd-kit/utilities",
    "date-fns",
    "motion",
    "sonner"
  ],
  "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/chip.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/input.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/popover.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/textarea.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/templates/team-workspace/application-01/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 { BoardPage } from './board-page';\nimport { tasksInColumnsOf, type Columns } from './board-model';\nimport {\n  CURRENT_USER_ID,\n  INBOX,\n  NAV_GROUPS,\n  PEOPLE,\n  TASKS,\n  WORKSPACES,\n  type FeedComment,\n  type InboxItem,\n  type NavItem,\n  type PageId,\n  type StatusId,\n  type Task,\n} from './data';\nimport { InboxPage } from './inbox-page';\nimport { InboxPopover } from './inbox-popover';\nimport type { CreateKind } from './quick-create-menu';\nimport { CommandPalette } from './search-palette';\nimport { TaskDrawer } from './task-drawer';\nimport { newTaskOf, patchedTask, withComment } from './task-edits';\nimport { NEW_TASK_STATUS, TaskListPage } from './task-list-page';\nimport { currentUser, isAssignedTo, nextNumberOf } from './task-model';\nimport { TeamPage } from './team-page';\nimport { TopBar } from './top-bar';\nimport { useTeam } from './use-team';\n\nconst NAV_ITEMS = NAV_GROUPS.flatMap((group) => group.items);\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) {\n  const group = NAV_GROUPS.find((candidate) =>\n    candidate.items.some((item) => item.id === pageId)\n  );\n  return group?.team?.name;\n}\n\nfunction replacedTask(\n  tasks: Task[],\n  taskId: string,\n  update: (task: Task) => Task\n) {\n  return tasks.map((task) => {\n    if (task.id !== taskId) {\n      return task;\n    }\n    return update(task);\n  });\n}\n\nfunction withRead(items: InboxItem[], itemId: string, isUnread: boolean) {\n  return items.map((item) => {\n    if (item.id !== itemId) {\n      return item;\n    }\n    return { ...item, isUnread };\n  });\n}\n\nfunction inboxSequenceOf(items: InboxItem[], tasks: Task[]) {\n  const ids: string[] = [];\n  for (const item of items) {\n    const task = tasks.find(\n      (candidate) => candidate.number === item.taskNumber\n    );\n    const isNew = task !== undefined && !ids.includes(task.id);\n    if (task && isNew) {\n      ids.push(task.id);\n    }\n  }\n  return ids;\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\nfunction keepWorkspace() {\n  return undefined;\n}\n\nexport default function Application01() {\n  const [activePageId, setActivePageId] = useState<PageId>('my-tasks');\n  const [isSidebarHidden, setIsSidebarHidden] = useState(false);\n  const [isNavigationOpen, setIsNavigationOpen] = useState(false);\n  const [isPaletteOpen, setIsPaletteOpen] = useState(false);\n  const [tasks, setTasks] = useState<Task[]>(TASKS);\n  const [inbox, setInbox] = useState<InboxItem[]>(INBOX);\n  const [draftStatus, setDraftStatus] = useState<StatusId | null>(null);\n  const [openTaskId, setOpenTaskId] = useState<string | null>(null);\n  const [shownTaskId, setShownTaskId] = useState<string | null>(null);\n  const [sequence, setSequence] = useState<string[]>([]);\n  const team = useTeam();\n\n  const workspace = WORKSPACES[0];\n  const activePage = navItemOf(activePageId);\n  const ancestor = ancestorOf(activePageId);\n  const me = currentUser();\n  const myTasks = tasks.filter((task) => isAssignedTo(task, CURRENT_USER_ID));\n  const myOpenTasks = myTasks.filter((task) => task.status !== 'done');\n  const unreadItems = inbox.filter((item) => item.isUnread);\n  const isDrawerOpen = openTaskId !== null;\n  const counts: PageCounts = {\n    inbox: unreadItems.length,\n    'my-tasks': myOpenTasks.length,\n  };\n\n  const startNewTask = useCallback(() => {\n    setIsNavigationOpen(false);\n    setActivePageId('my-tasks');\n    setDraftStatus(NEW_TASK_STATUS);\n  }, []);\n\n  const showTask = useCallback((taskId: string) => {\n    setOpenTaskId(taskId);\n    setShownTaskId(taskId);\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 (isDrawerOpen) {\n        return;\n      }\n      if (isCreateShortcut(event)) {\n        event.preventDefault();\n        startNewTask();\n      }\n    }\n\n    document.addEventListener('keydown', handleKeyDown);\n    return () => document.removeEventListener('keydown', handleKeyDown);\n  }, [isDrawerOpen, startNewTask]);\n\n  function navigate(pageId: PageId) {\n    setActivePageId(pageId);\n    setIsNavigationOpen(false);\n  }\n\n  function create(kind: CreateKind) {\n    if (kind === 'task') {\n      startNewTask();\n      return;\n    }\n    navigate('team');\n  }\n\n  function openSearch() {\n    setIsNavigationOpen(false);\n    setIsPaletteOpen(true);\n  }\n\n  function hideSidebar() {\n    setIsSidebarHidden(true);\n  }\n\n  function showSidebar() {\n    setIsSidebarHidden(false);\n  }\n\n  function openNavigation() {\n    setIsNavigationOpen(true);\n  }\n\n  function openTask(taskId: string, nextSequence: string[]) {\n    setSequence(nextSequence);\n    showTask(taskId);\n  }\n\n  function closeDrawer() {\n    setOpenTaskId(null);\n  }\n\n  function patchTask(taskId: string, patch: Partial<Task>) {\n    setTasks((current) =>\n      replacedTask(current, taskId, (task) => patchedTask(task, patch))\n    );\n  }\n\n  function commentOnTask(taskId: string, comment: FeedComment) {\n    setTasks((current) =>\n      replacedTask(current, taskId, (task) => withComment(task, comment))\n    );\n  }\n\n  function addTask(status: StatusId, title: string, assigneeIds: string[]) {\n    const number = nextNumberOf(tasks);\n    const task = newTaskOf(number, status, title, assigneeIds);\n    setTasks((current) => [task, ...current]);\n    return task.id;\n  }\n\n  function createMyTask(status: StatusId, title: string) {\n    addTask(status, title, [CURRENT_USER_ID]);\n  }\n\n  function createBoardTask(status: StatusId, title: string) {\n    return addTask(status, title, []);\n  }\n\n  function applyColumns(columns: Columns) {\n    setTasks((current) => tasksInColumnsOf(current, columns));\n  }\n\n  function openInboxItem(itemId: string) {\n    const item = inbox.find((entry) => entry.id === itemId);\n    setInbox((current) => withRead(current, itemId, false));\n    if (!item) {\n      return;\n    }\n    const task = tasks.find((entry) => entry.number === item.taskNumber);\n    if (!task) {\n      return;\n    }\n    openTask(task.id, inboxSequenceOf(inbox, tasks));\n  }\n\n  function toggleRead(itemId: string) {\n    const item = inbox.find((entry) => entry.id === itemId);\n    if (!item) {\n      return;\n    }\n    setInbox((current) => withRead(current, itemId, !item.isUnread));\n  }\n\n  function archive(itemId: string) {\n    setInbox((current) => current.filter((item) => item.id !== itemId));\n  }\n\n  function markAllRead() {\n    setInbox((current) =>\n      current.map((item) => ({ ...item, isUnread: false }))\n    );\n  }\n\n  const sidebarProps = {\n    workspaces: WORKSPACES,\n    workspace,\n    onWorkspaceChange: keepWorkspace,\n    groups: NAV_GROUPS,\n    activePageId,\n    counts,\n    person: me,\n    onNavigate: navigate,\n    onOpenSearch: openSearch,\n    onCreate: create,\n  };\n\n  const inboxActions = {\n    onOpen: openInboxItem,\n    onToggleRead: toggleRead,\n    onArchive: archive,\n    onMarkAllRead: markAllRead,\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          inert={isSidebarHidden}\n          className='m-0 h-full'\n          contentClassName={cn('h-full p-0', isSidebarHidden && 'w-0')}\n        >\n          <div className='h-full w-60 pr-2'>\n            <AppSidebar {...sidebarProps} onHide={hideSidebar} />\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} />\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          isSidebarHidden={isSidebarHidden}\n          onShowSidebar={showSidebar}\n          onOpenNavigation={openNavigation}\n        >\n          <InboxPopover items={inbox} {...inboxActions} />\n        </TopBar>\n        {activePageId === 'inbox' && (\n          <InboxPage items={inbox} {...inboxActions} />\n        )}\n        {activePageId === 'my-tasks' && (\n          <TaskListPage\n            tasks={myTasks}\n            openTaskId={openTaskId}\n            draftStatus={draftStatus}\n            onDraftStatusChange={setDraftStatus}\n            onOpenTask={openTask}\n            onPatchTask={patchTask}\n            onCreateTask={createMyTask}\n          />\n        )}\n        {activePageId === 'board' && (\n          <BoardPage\n            tasks={tasks}\n            onColumnsChange={applyColumns}\n            onCreateTask={createBoardTask}\n          />\n        )}\n        {activePageId === 'team' && <TeamPage team={team} />}\n      </main>\n      <TaskDrawer\n        tasks={tasks}\n        sequence={sequence}\n        openTaskId={openTaskId}\n        shownTaskId={shownTaskId}\n        onOpenTask={showTask}\n        onClose={closeDrawer}\n        onPatch={patchTask}\n        onComment={commentOnTask}\n      />\n      <CommandPalette\n        open={isPaletteOpen}\n        onOpenChange={setIsPaletteOpen}\n        groups={NAV_GROUPS}\n        onNavigate={navigate}\n        onCreateTask={startNewTask}\n      />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/index.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/app-sidebar.tsx",
      "content": "'use client';\n\nimport { useId } from 'react';\n\nimport { LayoutIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\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 } 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  onNavigate: (pageId: PageId) => void;\n  onOpenSearch: () => void;\n  onCreate: (kind: CreateKind) => void;\n  onHide?: () => void;\n};\n\nfunction GroupLabel({ group }: { group: NavGroup }) {\n  if (group.team) {\n    return (\n      <p className='text-muted-foreground flex h-6 items-center gap-2 px-2 text-xs font-medium'>\n        <EntityTile entity={group.team} size='xs' />\n        {group.team.name}\n      </p>\n    );\n  }\n  if (group.label) {\n    return (\n      <p className='text-muted-foreground flex h-6 items-center px-2 text-xs font-medium'>\n        {group.label}\n      </p>\n    );\n  }\n  return null;\n}\n\nexport function AppSidebar({\n  workspaces,\n  workspace,\n  onWorkspaceChange,\n  groups,\n  activePageId,\n  counts,\n  person,\n  onNavigate,\n  onOpenSearch,\n  onCreate,\n  onHide,\n}: AppSidebarProps) {\n  const indicatorId = useId();\n  const canHide = Boolean(onHide);\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        <div className='flex items-center gap-1'>\n          <WorkspaceSwitcher\n            workspaces={workspaces}\n            current={workspace}\n            onSelect={onWorkspaceChange}\n          />\n          {canHide && (\n            <Button\n              variant='ghost'\n              size='icon-sm'\n              aria-label='Hide sidebar'\n              onClick={onHide}\n              className='text-muted-foreground'\n            >\n              <LayoutIcon />\n            </Button>\n          )}\n        </div>\n        <div className='flex items-center gap-2'>\n          <SearchTrigger onOpen={onOpenSearch} />\n          <QuickCreateMenu onCreate={onCreate} />\n        </div>\n      </div>\n      <nav\n        aria-label='Main'\n        className='-mx-2 flex min-h-0 flex-1 flex-col gap-4 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} />\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                  indicatorId={indicatorId}\n                  count={counts[item.id]}\n                  onSelect={selectItem}\n                />\n              ))}\n            </ul>\n          </div>\n        ))}\n      </nav>\n      <AccountMenu person={person} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/app-sidebar.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/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 { MeshTile } from '@/registry/ndeko/ui/mesh-tile';\n\nimport type { Entity, NavItem } 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\nfunction travelOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return INDICATOR_TRAVEL;\n}\n\n/** The one highlight of the active row. It travels from the old row to the new one. */\nexport function ActiveRowIndicator({ layoutId }: { layoutId: string }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n\n  return (\n    <motion.span\n      aria-hidden='true'\n      layoutId={layoutId}\n      transition={travelOf(shouldReduceMotion)}\n      className='bg-foreground/[0.07] absolute inset-0 rounded-md'\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 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  indicatorId: string;\n  count?: number;\n  onSelect: (item: NavItem) => void;\n};\n\nexport function NavRow({\n  item,\n  isActive,\n  indicatorId,\n  count = 0,\n  onSelect,\n}: NavRowProps) {\n  const hasCount = count > 0;\n  const ItemIcon = item.icon;\n  const ariaCurrent = ariaCurrentOf(isActive);\n\n  function selectItem() {\n    onSelect(item);\n  }\n\n  return (\n    <li>\n      <button\n        type='button'\n        aria-current={ariaCurrent}\n        onClick={selectItem}\n        className={NAV_ROW}\n      >\n        {isActive && <ActiveRowIndicator layoutId={indicatorId} />}\n        <ItemIcon />\n        <span className='relative min-w-0 flex-1 truncate'>{item.label}</span>\n        {hasCount && (\n          <MotionNumber\n            value={count}\n            className='text-muted-foreground text-xs font-normal'\n          />\n        )}\n      </button>\n    </li>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/sidebar-parts.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/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.5 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  onSelect: (workspaceId: string) => void;\n};\n\nexport function WorkspaceSwitcher({\n  workspaces,\n  current,\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        <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      </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/templates/application-01/workspace-switcher.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/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';\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\nexport function SearchTrigger({ onOpen }: { onOpen: () => void }) {\n  return (\n    <button\n      type='button'\n      onClick={onOpen}\n      className={cn(\n        CONTROL_RECIPE,\n        'text-muted-foreground flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 px-2.5 text-left'\n      )}\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/templates/application-01/search-palette.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/quick-create-menu.tsx",
      "content": "'use client';\n\nimport {\n  CircleCheckIcon,\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';\n\nexport type CreateKind = 'task' | 'invite';\n\ntype QuickCreateMenuProps = {\n  onCreate: (kind: CreateKind) => void;\n  side?: 'bottom' | 'right';\n};\n\nexport function QuickCreateMenu({\n  onCreate,\n  side = 'bottom',\n}: QuickCreateMenuProps) {\n  function createTask() {\n    onCreate('task');\n  }\n\n  function invitePeople() {\n    onCreate('invite');\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={<Button variant='outline' size='icon' aria-label='Create' />}\n      >\n        <PlusIcon />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent side={side} align='end' className='w-52'>\n        <DropdownMenuItem onClick={createTask}>\n          <CircleCheckIcon />\n          New task\n          <Kbd className='ml-auto'>C</Kbd>\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/templates/application-01/quick-create-menu.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/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 './task-glyphs';\n\nconst TRIGGER = [\n  'flex h-9 w-full min-w-0 items-center gap-2 rounded-md px-1.5 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} className='size-8 text-xs' />\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({ person }: { person: Person }) {\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        <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      </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/templates/application-01/account-menu.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/top-bar.tsx",
      "content": "'use client';\n\nimport { LayoutIcon, MenuIcon } 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';\n\nimport type { NavItem, Person } from './data';\nimport { PersonAvatar } from './task-glyphs';\n\nconst STACK_LIMIT = 4;\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  isSidebarHidden: boolean;\n  onShowSidebar: () => void;\n  onOpenNavigation: () => void;\n  children?: React.ReactNode;\n};\n\nexport function TopBar({\n  page,\n  ancestor,\n  people,\n  isSidebarHidden,\n  onShowSidebar,\n  onOpenNavigation,\n  children,\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      {isSidebarHidden && (\n        <Button\n          variant='ghost'\n          size='icon-sm'\n          aria-label='Show sidebar'\n          onClick={onShowSidebar}\n          className='text-muted-foreground hidden md:inline-flex'\n        >\n          <LayoutIcon />\n        </Button>\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        {children}\n      </div>\n    </header>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/top-bar.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-list-page.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useState } from 'react';\n\nimport { PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { ColumnLabels } from './column-labels';\nimport type { PriorityId, StatusId, Task } from './data';\nimport { FilteredEmpty, ScopeEmpty } from './empty-list';\nimport { FilterMenu } from './filter-menu';\nimport { fadePresence } from './motion-parts';\nimport { ScopeSwitch } from './scope-switch';\nimport { SearchField } from './search-field';\nimport { TaskGroup } from './task-group';\nimport {\n  countLabel,\n  EMPTY_FILTERS,\n  groupsOf,\n  isFiltering,\n  isInScope,\n  matchesFilters,\n  matchesSearch,\n  scopeCountsOf,\n  toggledFilters,\n  toggledIds,\n  type FilterKey,\n  type Filters,\n  type Scope,\n  type TaskGroupData,\n} from './task-model';\nimport { useDelayedPlacement } from './use-delayed-placement';\n\nexport const NEW_TASK_STATUS: StatusId = 'todo';\n\nfunction headerMetaOf(tasks: Task[]) {\n  const total = countLabel(tasks.length, 'task', 'tasks');\n  const trackedCount = tasks.filter((task) => task.trackedById).length;\n  if (trackedCount === 0) {\n    return total;\n  }\n  return `${total} · ${trackedCount} tracked now`;\n}\n\nfunction sequenceOf(groups: TaskGroupData[]) {\n  const ids: string[] = [];\n  for (const group of groups) {\n    const groupIds = group.tasks.map((task) => task.id);\n    ids.push(...groupIds);\n  }\n  return ids;\n}\n\nfunction matchesQueryAndFilters(task: Task, query: string, filters: Filters) {\n  const isSearchMatch = matchesSearch(task, query);\n  const isFilterMatch = matchesFilters(task, filters);\n  return isSearchMatch && isFilterMatch;\n}\n\ntype TaskListPageProps = {\n  tasks: Task[];\n  openTaskId: string | null;\n  draftStatus: StatusId | null;\n  onDraftStatusChange: (status: StatusId | null) => void;\n  onOpenTask: (taskId: string, sequence: string[]) => void;\n  onPatchTask: (taskId: string, patch: Partial<Task>) => void;\n  onCreateTask: (status: StatusId, title: string) => void;\n};\n\nexport function TaskListPage({\n  tasks,\n  openTaskId,\n  draftStatus,\n  onDraftStatusChange,\n  onOpenTask,\n  onPatchTask,\n  onCreateTask,\n}: TaskListPageProps) {\n  const [scope, setScope] = useState<Scope>('active');\n  const [query, setQuery] = useState('');\n  const [filters, setFilters] = useState<Filters>(EMPTY_FILTERS);\n  const [collapsed, setCollapsed] = useState<StatusId[]>([]);\n  const placement = useDelayedPlacement();\n  const hasDraft = draftStatus !== null;\n\n  if (hasDraft && !isInScope(draftStatus, scope)) {\n    setScope('active');\n  }\n  if (hasDraft && collapsed.includes(draftStatus)) {\n    setCollapsed(toggledIds(collapsed, draftStatus, false));\n  }\n\n  const matchingTasks = tasks.filter((task) =>\n    matchesQueryAndFilters(task, query, filters)\n  );\n  const scopeCounts = scopeCountsOf(matchingTasks);\n  const allScopeCounts = scopeCountsOf(tasks);\n  const scopeTasks = tasks.filter((task) => isInScope(task.status, scope));\n  const visibleTasks = matchingTasks.filter((task) =>\n    isInScope(placement.placementOf(task), scope)\n  );\n  const groups = groupsOf(\n    visibleTasks,\n    scope,\n    placement.placementOf,\n    draftStatus\n  );\n  const sequence = sequenceOf(groups);\n  const hasGroups = groups.length > 0;\n  const isFiltered = isFiltering(query, filters);\n  const showsFilteredEmpty = !hasGroups && isFiltered;\n  const showsScopeEmpty = !hasGroups && !isFiltered;\n\n  function changeStatus(taskId: string, status: StatusId) {\n    const task = tasks.find((item) => item.id === taskId);\n    if (!task) {\n      return;\n    }\n    if (task.status === status) {\n      return;\n    }\n    placement.hold(taskId, task.status);\n    onPatchTask(taskId, { status });\n  }\n\n  function changePriority(taskId: string, priority: PriorityId) {\n    onPatchTask(taskId, { priority });\n  }\n\n  function changeAssignees(taskId: string, assigneeIds: string[]) {\n    onPatchTask(taskId, { assigneeIds });\n  }\n\n  function openTask(taskId: string) {\n    onOpenTask(taskId, sequence);\n  }\n\n  function toggleCollapsed(status: StatusId) {\n    const isCollapsed = collapsed.includes(status);\n    setCollapsed(toggledIds(collapsed, status, !isCollapsed));\n  }\n\n  function startDraft(status: StatusId) {\n    onDraftStatusChange(status);\n  }\n\n  function startDefaultDraft() {\n    startDraft(NEW_TASK_STATUS);\n  }\n\n  function cancelDraft() {\n    onDraftStatusChange(null);\n  }\n\n  function createTask(status: StatusId, title: string) {\n    onCreateTask(status, title);\n    onDraftStatusChange(null);\n  }\n\n  function toggleFilter(key: FilterKey, value: string, isIncluded: boolean) {\n    setFilters((current) => toggledFilters(current, key, value, isIncluded));\n  }\n\n  function clearFilters() {\n    setQuery('');\n    setFilters(EMPTY_FILTERS);\n  }\n\n  function showActive() {\n    setScope('active');\n  }\n\n  return (\n    <div className='@container flex min-h-0 flex-1 flex-col'>\n      <header className='flex flex-col gap-3 px-3 pt-4 pb-3 sm:px-5'>\n        <div className='flex items-center justify-between gap-3'>\n          <div className='min-w-0'>\n            <h1 className='truncate text-sm font-semibold'>My tasks</h1>\n            <p className='text-muted-foreground text-xs'>\n              {headerMetaOf(tasks)}\n            </p>\n          </div>\n          <Button onClick={startDefaultDraft}>\n            <PlusIcon />\n            New task\n          </Button>\n        </div>\n        <div className='flex flex-wrap items-center gap-2'>\n          <ScopeSwitch scope={scope} counts={scopeCounts} onChange={setScope} />\n          <div className='flex w-full items-center gap-2 @xl:ml-auto @xl:w-auto'>\n            <SearchField\n              value={query}\n              onChange={setQuery}\n              placeholder='Search my tasks'\n              className='min-w-0 flex-1 @xl:w-56 @xl:flex-none'\n            />\n            <FilterMenu\n              tasks={scopeTasks}\n              filters={filters}\n              onToggle={toggleFilter}\n              onClear={clearFilters}\n            />\n          </div>\n        </div>\n      </header>\n      <div className='relative min-h-0 flex-1 overflow-y-auto'>\n        <AnimatePresence mode='popLayout' initial={false}>\n          {hasGroups && (\n            <motion.div\n              key='list'\n              role='table'\n              aria-label='My tasks'\n              {...fadePresence()}\n              className='pb-6'\n            >\n              <ColumnLabels />\n              <AnimatePresence initial={false}>\n                {groups.map((group) => (\n                  <TaskGroup\n                    key={group.status}\n                    status={group.status}\n                    tasks={group.tasks}\n                    openTaskId={openTaskId}\n                    isCollapsed={collapsed.includes(group.status)}\n                    isDrafting={draftStatus === group.status}\n                    onToggleCollapsed={toggleCollapsed}\n                    onStartDraft={startDraft}\n                    onCreate={createTask}\n                    onCancelDraft={cancelDraft}\n                    onStatusChange={changeStatus}\n                    onPriorityChange={changePriority}\n                    onAssigneesChange={changeAssignees}\n                    onOpen={openTask}\n                  />\n                ))}\n              </AnimatePresence>\n            </motion.div>\n          )}\n          {showsFilteredEmpty && (\n            <motion.div key='filtered' {...fadePresence()}>\n              <FilteredEmpty\n                scope={scope}\n                query={query}\n                filters={filters}\n                scopeTotal={allScopeCounts[scope]}\n                onClear={clearFilters}\n              />\n            </motion.div>\n          )}\n          {showsScopeEmpty && (\n            <motion.div key='empty' {...fadePresence()}>\n              <ScopeEmpty\n                scope={scope}\n                onNewTask={startDefaultDraft}\n                onShowActive={showActive}\n              />\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-list-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/column-labels.tsx",
      "content": "import { cn } from '@/registry/ndeko/lib/utils';\n\nimport {\n  DUE_CELL,\n  ID_CELL,\n  LABELS_CELL,\n  PRIORITY_CELL,\n  TASK_GRID,\n} from './task-grid';\n\nconst LABEL_CELL = 'text-xs font-medium text-muted-foreground';\n\nexport function ColumnLabels() {\n  return (\n    <div\n      role='row'\n      className={cn(\n        TASK_GRID,\n        'bg-background hairline-b border-border sticky top-0 z-20 h-9'\n      )}\n    >\n      <div role='columnheader' className={PRIORITY_CELL}>\n        <span className='sr-only'>Priority</span>\n      </div>\n      <div role='columnheader' className={cn(ID_CELL, LABEL_CELL)}>\n        ID\n      </div>\n      <div role='columnheader'>\n        <span className='sr-only'>Status</span>\n      </div>\n      <div role='columnheader' className={LABEL_CELL}>\n        Title\n      </div>\n      <div role='columnheader' className={cn(LABELS_CELL, LABEL_CELL)}>\n        Labels\n      </div>\n      <div\n        role='columnheader'\n        className={cn(LABEL_CELL, 'text-right @2xl:text-left')}\n      >\n        People\n      </div>\n      <div role='columnheader' className={cn(DUE_CELL, LABEL_CELL)}>\n        Due\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/column-labels.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/draft-row.tsx",
      "content": "'use client';\n\nimport { motion } from 'motion/react';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport type { StatusId } from './data';\nimport { heightPresenceOf } from './motion-parts';\nimport { IssueTypeGem, StatusGlyph } from './task-glyphs';\nimport {\n  DRAFT_TITLE_CELL,\n  ID_CELL,\n  PRIORITY_CELL,\n  ROW_CLASS,\n  TASK_GRID,\n} from './task-grid';\nimport { statusOf } from './task-model';\n\ntype DraftRowProps = {\n  status: StatusId;\n  onCreate: (title: string) => void;\n  onCancel: () => void;\n};\n\nexport function DraftRow({ status, onCreate, onCancel }: DraftRowProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const presence = heightPresenceOf(shouldReduceMotion);\n  const inputRef = useRef<HTMLInputElement>(null);\n  const [title, setTitle] = useState('');\n  const statusName = statusOf(status).name;\n\n  useEffect(() => {\n    inputRef.current?.focus();\n  }, []);\n\n  function submit() {\n    const trimmed = title.trim();\n    if (!trimmed) {\n      onCancel();\n      return;\n    }\n    onCreate(trimmed);\n  }\n\n  function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n    if (event.key === 'Enter') {\n      event.preventDefault();\n      submit();\n      return;\n    }\n    if (event.key === 'Escape') {\n      event.preventDefault();\n      onCancel();\n    }\n  }\n\n  function handleBlur() {\n    const isEmpty = title.trim().length === 0;\n    if (isEmpty) {\n      onCancel();\n    }\n  }\n\n  return (\n    <motion.div\n      role='row'\n      {...presence}\n      className={cn(TASK_GRID, ROW_CLASS, 'bg-primary/[0.04]')}\n    >\n      <div role='cell' className={PRIORITY_CELL} />\n      <div role='cell' className={cn(ID_CELL, 'text-muted-foreground text-xs')}>\n        New\n      </div>\n      <div role='cell' className='flex size-7 items-center justify-center'>\n        <StatusGlyph status={status} />\n      </div>\n      <div\n        role='cell'\n        className={cn('flex min-w-0 items-center gap-2', DRAFT_TITLE_CELL)}\n      >\n        <IssueTypeGem type='task' />\n        <input\n          ref={inputRef}\n          value={title}\n          onChange={(event) => setTitle(event.target.value)}\n          onKeyDown={handleKeyDown}\n          onBlur={handleBlur}\n          aria-label={`New task in ${statusName}`}\n          placeholder='Task title'\n          className='placeholder:text-muted-foreground/75 h-7 min-w-0 flex-1 bg-transparent text-base outline-none md:text-[13px]'\n        />\n        <Kbd className='hidden sm:inline-flex'>Enter</Kbd>\n      </div>\n    </motion.div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/draft-row.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/empty-list.tsx",
      "content": "import {\n  CircleCheckIcon,\n  PlusIcon,\n  SearchIcon,\n  XIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport {\n  activeFilterCountOf,\n  countLabel,\n  scopeOf,\n  type Filters,\n  type Scope,\n} from './task-model';\n\ntype EmptyFrameProps = {\n  icon: React.ReactNode;\n  title: string;\n  line: string;\n  action: React.ReactNode;\n};\n\nfunction EmptyFrame({ icon, title, line, action }: EmptyFrameProps) {\n  return (\n    <div className='flex flex-col items-center px-6 py-16 text-center'>\n      <span className='keycap-3d text-muted-foreground flex size-9 items-center justify-center rounded-lg'>\n        {icon}\n      </span>\n      <p className='mt-4 text-sm font-medium'>{title}</p>\n      <p className='text-muted-foreground mt-1 max-w-sm text-[13px] text-balance'>\n        {line}\n      </p>\n      <div className='mt-4'>{action}</div>\n    </div>\n  );\n}\n\nfunction criteriaOf(query: string, filters: Filters) {\n  const trimmed = query.trim();\n  const filterCount = activeFilterCountOf(filters);\n  const filterPhrase = countLabel(filterCount, 'filter', 'filters');\n  const hasFilters = filterCount > 0;\n  if (!trimmed) {\n    return filterPhrase;\n  }\n  if (!hasFilters) {\n    return `“${trimmed}”`;\n  }\n  return `“${trimmed}” with ${filterPhrase}`;\n}\n\nfunction reachOf(scope: Scope, scopeTotal: number) {\n  const option = scopeOf(scope);\n  if (scopeTotal === 0) {\n    return `and there are no ${option.plural} yet`;\n  }\n  if (scopeTotal === 1) {\n    return `clear them to see the one ${option.singular}`;\n  }\n  return `clear them to see all ${scopeTotal} ${option.plural}`;\n}\n\nfunction filteredLineOf(\n  scope: Scope,\n  query: string,\n  filters: Filters,\n  scopeTotal: number\n) {\n  const option = scopeOf(scope);\n  const criteria = criteriaOf(query, filters);\n  const reach = reachOf(scope, scopeTotal);\n  return `No ${option.singular} matches ${criteria}, ${reach}`;\n}\n\ntype FilteredEmptyProps = {\n  scope: Scope;\n  query: string;\n  filters: Filters;\n  scopeTotal: number;\n  onClear: () => void;\n};\n\nexport function FilteredEmpty({\n  scope,\n  query,\n  filters,\n  scopeTotal,\n  onClear,\n}: FilteredEmptyProps) {\n  return (\n    <EmptyFrame\n      icon={<SearchIcon />}\n      title='No tasks match'\n      line={filteredLineOf(scope, query, filters, scopeTotal)}\n      action={\n        <Button variant='outline' onClick={onClear}>\n          <XIcon />\n          Clear filters\n        </Button>\n      }\n    />\n  );\n}\n\ntype ScopeEmptyProps = {\n  scope: Scope;\n  onNewTask: () => void;\n  onShowActive: () => void;\n};\n\nexport function ScopeEmpty({\n  scope,\n  onNewTask,\n  onShowActive,\n}: ScopeEmptyProps) {\n  if (scope === 'done') {\n    return (\n      <EmptyFrame\n        icon={<CircleCheckIcon />}\n        title='No finished tasks'\n        line='Tasks moved to Done appear here'\n        action={\n          <Button variant='outline' onClick={onShowActive}>\n            Show active tasks\n          </Button>\n        }\n      />\n    );\n  }\n  return (\n    <EmptyFrame\n      icon={<CircleCheckIcon />}\n      title='No active tasks'\n      line='All tasks are done, add one to plan what comes next'\n      action={\n        <Button onClick={onNewTask}>\n          <PlusIcon />\n          New task\n        </Button>\n      }\n    />\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/empty-list.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/filter-menu.tsx",
      "content": "'use client';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport {\n  CircleDashedIcon,\n  HashIcon,\n  LayersIcon,\n  ListFilterIcon,\n  UserIcon,\n  UserRoundIcon,\n  XIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  DropdownMenu,\n  DropdownMenuCheckboxItem,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuSeparator,\n  DropdownMenuSub,\n  DropdownMenuSubContent,\n  DropdownMenuSubTrigger,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport {\n  ISSUE_TYPES,\n  LABELS,\n  PEOPLE,\n  PRIORITIES,\n  STATUSES,\n  type Task,\n} from './data';\nimport {\n  IssueTypeGem,\n  PersonAvatar,\n  PriorityGlyph,\n  StatusGlyph,\n} from './task-glyphs';\nimport {\n  activeFilterCountOf,\n  assigneeValuesOf,\n  NO_ASSIGNEE,\n  type FilterKey,\n  type Filters,\n} from './task-model';\n\ntype FilterOption = {\n  value: string;\n  label: string;\n  glyph: React.ReactNode;\n  count: number;\n};\n\ntype FilterProperty = {\n  key: FilterKey;\n  label: string;\n  glyph: React.ReactNode;\n  options: FilterOption[];\n};\n\nfunction countBy(tasks: Task[], valuesOf: (task: Task) => string[]) {\n  const counts = new Map<string, number>();\n  for (const task of tasks) {\n    for (const value of valuesOf(task)) {\n      const current = counts.get(value) ?? 0;\n      counts.set(value, current + 1);\n    }\n  }\n  return counts;\n}\n\nfunction LabelDot({ color }: { color: string }) {\n  const dotStyle = { backgroundColor: color } as React.CSSProperties;\n  return (\n    <span\n      aria-hidden='true'\n      style={dotStyle}\n      className='mx-1 size-2 shrink-0 rounded-full'\n    />\n  );\n}\n\nfunction filterPropertiesOf(tasks: Task[]): FilterProperty[] {\n  const statusCounts = countBy(tasks, (task) => [task.status]);\n  const priorityCounts = countBy(tasks, (task) => [task.priority]);\n  const assigneeCounts = countBy(tasks, assigneeValuesOf);\n  const labelCounts = countBy(tasks, (task) => task.labelIds);\n  const typeCounts = countBy(tasks, (task) => [task.type]);\n\n  const assigneeOptions: FilterOption[] = PEOPLE.map((person) => ({\n    value: person.id,\n    label: person.name,\n    glyph: <PersonAvatar person={person} className='size-4 text-[8px]' />,\n    count: assigneeCounts.get(person.id) ?? 0,\n  }));\n  assigneeOptions.push({\n    value: NO_ASSIGNEE,\n    label: 'No assignee',\n    glyph: <UserRoundIcon />,\n    count: assigneeCounts.get(NO_ASSIGNEE) ?? 0,\n  });\n\n  return [\n    {\n      key: 'status',\n      label: 'Status',\n      glyph: <CircleDashedIcon />,\n      options: STATUSES.map((status) => ({\n        value: status.id,\n        label: status.name,\n        glyph: <StatusGlyph status={status.id} />,\n        count: statusCounts.get(status.id) ?? 0,\n      })),\n    },\n    {\n      key: 'priority',\n      label: 'Priority',\n      glyph: (\n        <PriorityGlyph priority='high' className='text-muted-foreground' />\n      ),\n      options: PRIORITIES.map((priority) => ({\n        value: priority.id,\n        label: priority.name,\n        glyph: <PriorityGlyph priority={priority.id} />,\n        count: priorityCounts.get(priority.id) ?? 0,\n      })),\n    },\n    {\n      key: 'assignee',\n      label: 'Assignee',\n      glyph: <UserIcon />,\n      options: assigneeOptions,\n    },\n    {\n      key: 'label',\n      label: 'Label',\n      glyph: <HashIcon />,\n      options: LABELS.map((label) => ({\n        value: label.id,\n        label: label.name,\n        glyph: <LabelDot color={label.color} />,\n        count: labelCounts.get(label.id) ?? 0,\n      })),\n    },\n    {\n      key: 'type',\n      label: 'Type',\n      glyph: <LayersIcon />,\n      options: ISSUE_TYPES.map((type) => ({\n        value: type.id,\n        label: type.name,\n        glyph: <IssueTypeGem type={type.id} />,\n        count: typeCounts.get(type.id) ?? 0,\n      })),\n    },\n  ];\n}\n\ntype FilterMenuProps = {\n  tasks: Task[];\n  filters: Filters;\n  onToggle: (key: FilterKey, value: string, isIncluded: boolean) => void;\n  onClear: () => void;\n};\n\nexport function FilterMenu({\n  tasks,\n  filters,\n  onToggle,\n  onClear,\n}: FilterMenuProps) {\n  const properties = filterPropertiesOf(tasks);\n  const activeCount = activeFilterCountOf(filters);\n  const hasActive = activeCount > 0;\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger render={<Button variant='outline' />}>\n        <ListFilterIcon />\n        Filter\n        {hasActive && (\n          <span className='bg-primary/10 text-primary-ink -me-1.5 inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-xs'>\n            <MotionNumber value={activeCount} />\n            <span className='sr-only'> active</span>\n          </span>\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align='end' className='w-52'>\n        {properties.map((property) => {\n          const selected = filters[property.key];\n          const selectedCount = selected.length;\n          const hasSelection = selectedCount > 0;\n          return (\n            <DropdownMenuSub key={property.key}>\n              <DropdownMenuSubTrigger>\n                {property.glyph}\n                <span className='flex-1'>{property.label}</span>\n                {hasSelection && <Kbd>{selectedCount}</Kbd>}\n              </DropdownMenuSubTrigger>\n              <DropdownMenuSubContent className='w-56'>\n                {property.options.map((option) => (\n                  <DropdownMenuCheckboxItem\n                    key={option.value}\n                    checked={selected.includes(option.value)}\n                    onCheckedChange={(checked) =>\n                      onToggle(property.key, option.value, checked)\n                    }\n                  >\n                    {option.glyph}\n                    <span className='min-w-0 flex-1 truncate'>\n                      {option.label}\n                    </span>\n                    <span className='text-muted-foreground text-xs tabular-nums'>\n                      {option.count}\n                    </span>\n                  </DropdownMenuCheckboxItem>\n                ))}\n              </DropdownMenuSubContent>\n            </DropdownMenuSub>\n          );\n        })}\n        <DropdownMenuSeparator />\n        <DropdownMenuItem disabled={!hasActive} onClick={onClear}>\n          <XIcon />\n          Clear filters\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/filter-menu.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/property-menus.tsx",
      "content": "'use client';\n\nimport { UserRoundPlusIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  DropdownMenu,\n  DropdownMenuCheckboxItem,\n  DropdownMenuContent,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\n\nimport {\n  PEOPLE,\n  PRIORITIES,\n  STATUSES,\n  type PriorityId,\n  type StatusId,\n} from './data';\nimport { Swap } from './motion-parts';\nimport {\n  PeopleStack,\n  PersonAvatar,\n  PriorityGlyph,\n  StatusGlyph,\n} from './task-glyphs';\nimport { CELL_TRIGGER, HOVER_ONLY } from './task-grid';\nimport {\n  isPriorityId,\n  isStatusId,\n  peopleOf,\n  peopleSentenceOf,\n  priorityOf,\n  statusOf,\n  toggledIds,\n} from './task-model';\n\nexport function StatusPicker({\n  status,\n  onChange,\n}: {\n  status: StatusId;\n  onChange: (status: StatusId) => void;\n}) {\n  const meta = statusOf(status);\n\n  function pick(value: unknown) {\n    if (isStatusId(value)) {\n      onChange(value);\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        aria-label={`Status: ${meta.name}. Change status`}\n        className={CELL_TRIGGER}\n      >\n        <Swap swapKey={status}>\n          <StatusGlyph status={status} />\n        </Swap>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-48'>\n        <DropdownMenuRadioGroup value={status} onValueChange={pick}>\n          {STATUSES.map((option) => (\n            <DropdownMenuRadioItem\n              key={option.id}\n              value={option.id}\n              closeOnClick\n            >\n              <StatusGlyph status={option.id} />\n              {option.name}\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nexport function PriorityPicker({\n  priority,\n  onChange,\n}: {\n  priority: PriorityId;\n  onChange: (priority: PriorityId) => void;\n}) {\n  const meta = priorityOf(priority);\n  const isUnset = priority === 'none';\n\n  function pick(value: unknown) {\n    if (isPriorityId(value)) {\n      onChange(value);\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        aria-label={`Priority: ${meta.name}. Change priority`}\n        className={CELL_TRIGGER}\n      >\n        <Swap swapKey={priority} className={cn(isUnset && HOVER_ONLY)}>\n          <PriorityGlyph priority={priority} />\n        </Swap>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-44'>\n        <DropdownMenuRadioGroup value={priority} onValueChange={pick}>\n          {PRIORITIES.map((option) => (\n            <DropdownMenuRadioItem\n              key={option.id}\n              value={option.id}\n              closeOnClick\n            >\n              <PriorityGlyph priority={option.id} />\n              {option.name}\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nfunction assigneeLabelOf(names: string[]) {\n  const people = peopleSentenceOf(names);\n  return `Assigned to ${people}. Change assignees`;\n}\n\nexport function AssigneePicker({\n  assigneeIds,\n  onChange,\n}: {\n  assigneeIds: string[];\n  onChange: (assigneeIds: string[]) => void;\n}) {\n  const assignees = peopleOf(assigneeIds);\n  const names = assignees.map((person) => person.name);\n  const hasAssignees = assignees.length > 0;\n\n  function toggle(personId: string, isIncluded: boolean) {\n    onChange(toggledIds(assigneeIds, personId, isIncluded));\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        aria-label={assigneeLabelOf(names)}\n        className={cn(CELL_TRIGGER, 'w-auto min-w-7 px-1')}\n      >\n        {hasAssignees && <PeopleStack people={assignees} />}\n        {!hasAssignees && (\n          <UserRoundPlusIcon\n            className={cn('text-muted-foreground size-4', HOVER_ONLY)}\n          />\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align='end' className='w-52'>\n        {PEOPLE.map((person) => (\n          <DropdownMenuCheckboxItem\n            key={person.id}\n            checked={assigneeIds.includes(person.id)}\n            onCheckedChange={(checked) => toggle(person.id, checked)}\n          >\n            <PersonAvatar person={person} />\n            {person.name}\n          </DropdownMenuCheckboxItem>\n        ))}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/property-menus.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/scope-switch.tsx",
      "content": "'use client';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { Tabs, TabsList, TabsTab } from '@/registry/ndeko/ui/tabs';\n\nimport { isScope, SCOPES, type Scope } from './task-model';\n\ntype ScopeSwitchProps = {\n  scope: Scope;\n  counts: Record<Scope, number>;\n  onChange: (scope: Scope) => void;\n};\n\nexport function ScopeSwitch({ scope, counts, onChange }: ScopeSwitchProps) {\n  function change(value: unknown) {\n    if (isScope(value)) {\n      onChange(value);\n    }\n  }\n\n  return (\n    <Tabs value={scope} onValueChange={change}>\n      <TabsList variant='segmented' aria-label='Which tasks to show'>\n        {SCOPES.map((option) => (\n          <TabsTab key={option.id} value={option.id}>\n            {option.label}\n            <MotionNumber\n              value={counts[option.id]}\n              className='text-muted-foreground text-xs'\n            />\n          </TabsTab>\n        ))}\n      </TabsList>\n    </Tabs>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/scope-switch.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/search-field.tsx",
      "content": "'use client';\n\nimport { useEffect, useRef } from 'react';\n\nimport { SearchIcon, XIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Input } from '@/registry/ndeko/ui/input';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport { Swap } from './motion-parts';\n\nconst TYPING_TARGETS = 'input, textarea, select, [contenteditable=\"true\"]';\n\nfunction isTypingTarget(target: EventTarget | null) {\n  if (!(target instanceof HTMLElement)) {\n    return false;\n  }\n  return Boolean(target.closest(TYPING_TARGETS));\n}\n\nfunction hasModifier(event: KeyboardEvent) {\n  const isCommand = event.metaKey || event.ctrlKey;\n  return isCommand || event.altKey;\n}\n\ntype SearchFieldProps = {\n  value: string;\n  onChange: (value: string) => void;\n  placeholder: string;\n  className?: string;\n};\n\nexport function SearchField({\n  value,\n  onChange,\n  placeholder,\n  className,\n}: SearchFieldProps) {\n  const inputRef = useRef<HTMLInputElement>(null);\n  const hasValue = value.length > 0;\n\n  useEffect(() => {\n    function focusOnSlash(event: KeyboardEvent) {\n      if (event.key !== '/') {\n        return;\n      }\n      if (hasModifier(event)) {\n        return;\n      }\n      if (isTypingTarget(event.target)) {\n        return;\n      }\n      event.preventDefault();\n      inputRef.current?.focus();\n    }\n    document.addEventListener('keydown', focusOnSlash);\n    return () => document.removeEventListener('keydown', focusOnSlash);\n  }, []);\n\n  function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n    if (event.key !== 'Escape') {\n      return;\n    }\n    event.preventDefault();\n    if (hasValue) {\n      onChange('');\n      return;\n    }\n    inputRef.current?.blur();\n  }\n\n  function clear() {\n    onChange('');\n    inputRef.current?.focus();\n  }\n\n  return (\n    <div className={cn('relative', className)}>\n      <SearchIcon className='text-muted-foreground pointer-events-none absolute start-2.5 top-1/2 size-4 -translate-y-1/2' />\n      <Input\n        ref={inputRef}\n        type='search'\n        value={value}\n        onChange={(event) => onChange(event.target.value)}\n        onKeyDown={handleKeyDown}\n        placeholder={placeholder}\n        aria-label={placeholder}\n        className='ps-8 pe-9'\n      />\n      <Swap\n        swapKey={String(hasValue)}\n        className='absolute end-1.5 top-1/2 -translate-y-1/2'\n      >\n        {hasValue && (\n          <button\n            type='button'\n            onClick={clear}\n            aria-label='Clear search'\n            className='text-muted-foreground hover:bg-foreground/5 hover:text-foreground focus-visible:ring-ring/25 inline-flex size-6 cursor-pointer items-center justify-center rounded-md outline-none focus-visible:ring-[3px]'\n          >\n            <XIcon className='size-3.5' />\n          </button>\n        )}\n        {!hasValue && <Kbd className='me-0.5'>/</Kbd>}\n      </Swap>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/search-field.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-group.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { ChevronDownIcon, PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport type { StatusId, Task } from './data';\nimport { DraftRow } from './draft-row';\nimport { fadePresence, heightPresenceOf } from './motion-parts';\nimport { StatusGlyph } from './task-glyphs';\nimport { BAND_FILL, COUNT_CHIP, TASK_GRID } from './task-grid';\nimport { countLabel, statusOf } from './task-model';\nimport { TaskRow, type TaskRowHandlers } from './task-row';\n\ntype TaskGroupProps = TaskRowHandlers & {\n  status: StatusId;\n  tasks: Task[];\n  openTaskId: string | null;\n  isCollapsed: boolean;\n  isDrafting: boolean;\n  onToggleCollapsed: (status: StatusId) => void;\n  onStartDraft: (status: StatusId) => void;\n  onCreate: (status: StatusId, title: string) => void;\n  onCancelDraft: () => void;\n};\n\nfunction foldLabelOf(name: string, isCollapsed: boolean) {\n  if (isCollapsed) {\n    return `Show ${name}`;\n  }\n  return `Fold ${name}`;\n}\n\nexport function TaskGroup({\n  status,\n  tasks,\n  openTaskId,\n  isCollapsed,\n  isDrafting,\n  onToggleCollapsed,\n  onStartDraft,\n  onCreate,\n  onCancelDraft,\n  ...rowHandlers\n}: TaskGroupProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const bodyPresence = heightPresenceOf(shouldReduceMotion);\n  const meta = statusOf(status);\n  const isOpen = !isCollapsed;\n\n  return (\n    <motion.section role='rowgroup' aria-label={meta.name} {...fadePresence()}>\n      <div\n        role='row'\n        className={cn(TASK_GRID, BAND_FILL, 'sticky top-9 z-10 h-9')}\n      >\n        <div role='cell' className='col-[1/-2] flex min-w-0 items-center gap-2'>\n          <button\n            type='button'\n            aria-expanded={isOpen}\n            aria-label={foldLabelOf(meta.name, isCollapsed)}\n            onClick={() => onToggleCollapsed(status)}\n            className='text-muted-foreground hover:bg-foreground/5 hover:text-foreground focus-visible:ring-ring/25 -ml-1 inline-flex size-6 cursor-pointer items-center justify-center rounded-md outline-none focus-visible:ring-[3px]'\n          >\n            <ChevronDownIcon\n              className={cn(\n                'size-3.5 transition-transform duration-200 ease-(--ease-out-strong)',\n                isCollapsed && '-rotate-90'\n              )}\n            />\n          </button>\n          <StatusGlyph status={status} />\n          <span className='truncate text-[13px] font-medium'>{meta.name}</span>\n          <span className={COUNT_CHIP}>\n            <span aria-hidden='true'>\n              <MotionNumber value={tasks.length} />\n            </span>\n            <span className='sr-only'>\n              {countLabel(tasks.length, 'task', 'tasks')}\n            </span>\n          </span>\n        </div>\n        <div role='cell' className='flex justify-end'>\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label={`Add a task to ${meta.name}`}\n            onClick={() => onStartDraft(status)}\n            className='text-muted-foreground'\n          >\n            <PlusIcon />\n          </Button>\n        </div>\n      </div>\n      <AnimatePresence initial={false}>\n        {isOpen && (\n          <motion.div key='body' {...bodyPresence} className='overflow-hidden'>\n            <AnimatePresence initial={false}>\n              {isDrafting && (\n                <DraftRow\n                  key='draft'\n                  status={status}\n                  onCreate={(title) => onCreate(status, title)}\n                  onCancel={onCancelDraft}\n                />\n              )}\n              {tasks.map((task) => (\n                <TaskRow\n                  key={task.id}\n                  task={task}\n                  isOpen={task.id === openTaskId}\n                  {...rowHandlers}\n                />\n              ))}\n            </AnimatePresence>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </motion.section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-group.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-row.tsx",
      "content": "'use client';\n\nimport { motion } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport type { PriorityId, StatusId, Task } from './data';\nimport { heightPresenceOf } from './motion-parts';\nimport { AssigneePicker, PriorityPicker, StatusPicker } from './property-menus';\nimport {\n  IssueTypeGem,\n  LabelChips,\n  LivePill,\n  SubTaskCountTag,\n} from './task-glyphs';\nimport {\n  DUE_CELL,\n  ID_CELL,\n  LABELS_CELL,\n  PRIORITY_CELL,\n  ROW_CLASS,\n  TASK_GRID,\n  TRACKED_ROW,\n} from './task-grid';\nimport {\n  dueLabelOf,\n  isOverdue,\n  subTaskCountOf,\n  taskKeyOf,\n  trackerOf,\n} from './task-model';\n\nexport type TaskRowHandlers = {\n  onStatusChange: (taskId: string, status: StatusId) => void;\n  onPriorityChange: (taskId: string, priority: PriorityId) => void;\n  onAssigneesChange: (taskId: string, assigneeIds: string[]) => void;\n  onOpen: (taskId: string) => void;\n};\n\ntype TaskRowProps = TaskRowHandlers & {\n  task: Task;\n  isOpen: boolean;\n};\n\nconst OPEN_ROW = 'bg-primary/[0.06] hover:bg-primary/[0.08]';\n\nfunction dueToneOf(task: Task) {\n  if (isOverdue(task)) {\n    return 'text-destructive-ink';\n  }\n  return 'text-muted-foreground';\n}\n\nfunction DueDate({ task }: { task: Task }) {\n  if (!task.due) {\n    return null;\n  }\n  return (\n    <span className={cn('text-xs tabular-nums', dueToneOf(task))}>\n      {dueLabelOf(task.due)}\n      {isOverdue(task) && <span className='sr-only'>, overdue</span>}\n    </span>\n  );\n}\n\nexport function TaskRow({\n  task,\n  isOpen,\n  onStatusChange,\n  onPriorityChange,\n  onAssigneesChange,\n  onOpen,\n}: TaskRowProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const presence = heightPresenceOf(shouldReduceMotion);\n  const isDone = task.status === 'done';\n  const tracker = trackerOf(task);\n  const isTracked = Boolean(tracker);\n  const subTasks = subTaskCountOf(task);\n\n  function open() {\n    onOpen(task.id);\n  }\n\n  return (\n    <motion.div\n      role='row'\n      {...presence}\n      className={cn(\n        TASK_GRID,\n        ROW_CLASS,\n        isTracked && TRACKED_ROW,\n        isOpen && OPEN_ROW\n      )}\n    >\n      <div role='cell' className={PRIORITY_CELL}>\n        <PriorityPicker\n          priority={task.priority}\n          onChange={(priority) => onPriorityChange(task.id, priority)}\n        />\n      </div>\n      <div\n        role='cell'\n        className={cn(ID_CELL, 'text-muted-foreground text-xs tabular-nums')}\n      >\n        {taskKeyOf(task)}\n      </div>\n      <div role='cell' className='flex'>\n        <StatusPicker\n          status={task.status}\n          onChange={(status) => onStatusChange(task.id, status)}\n        />\n      </div>\n      <div role='cell' className='flex min-w-0 items-center gap-2'>\n        <IssueTypeGem type={task.type} />\n        <button\n          type='button'\n          aria-haspopup='dialog'\n          onClick={open}\n          className={cn(\n            'focus-visible:ring-ring/25 min-w-0 cursor-pointer truncate rounded-sm text-left text-[13px] outline-none focus-visible:ring-[3px]',\n            isDone && 'text-muted-foreground'\n          )}\n        >\n          {task.title}\n        </button>\n        {subTasks && <SubTaskCountTag count={subTasks} />}\n        {tracker && <LivePill personName={tracker.name} />}\n      </div>\n      <div role='cell' className={LABELS_CELL}>\n        <LabelChips labelIds={task.labelIds} />\n      </div>\n      <div role='cell' className='flex justify-end @2xl:justify-start'>\n        <AssigneePicker\n          assigneeIds={task.assigneeIds}\n          onChange={(assigneeIds) => onAssigneesChange(task.id, assigneeIds)}\n        />\n      </div>\n      <div role='cell' className={DUE_CELL}>\n        <DueDate task={task} />\n      </div>\n    </motion.div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-row.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-grid.ts",
      "content": "export const TASK_GRID = [\n  'grid items-center gap-x-2 px-3 sm:px-5',\n  'grid-cols-[1.75rem_minmax(0,1fr)_3.75rem]',\n  '@2xl:grid-cols-[1.75rem_4rem_1.75rem_minmax(0,1fr)_4.25rem_4.25rem]',\n  '@4xl:grid-cols-[1.75rem_4rem_1.75rem_minmax(0,1fr)_11rem_4.25rem_4.25rem]',\n].join(' ');\n\nexport const PRIORITY_CELL = 'hidden @2xl:flex';\n\nexport const ID_CELL = 'hidden @2xl:flex';\n\nexport const LABELS_CELL = 'hidden min-w-0 @4xl:flex';\n\nexport const DUE_CELL = 'hidden @2xl:flex';\n\nexport const DRAFT_TITLE_CELL = 'col-[2/-1] @2xl:col-[4/-1]';\n\nexport const ROW_CLASS =\n  'group/row relative h-10 overflow-hidden hairline-b border-border transition-colors duration-150 hover:bg-foreground/[0.025]';\n\nexport const TRACKED_ROW =\n  'before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-primary';\n\nexport const BAND_FILL =\n  'bg-[color-mix(in_oklab,var(--foreground)_3%,var(--background))]';\n\nexport const COUNT_CHIP =\n  'inline-flex h-5 min-w-5 items-center justify-center rounded-sm bg-foreground/[0.06] px-1.5 text-xs font-medium text-muted-foreground';\n\nexport const CELL_TRIGGER =\n  'inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md outline-none transition-colors duration-150 hover:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25 data-popup-open:bg-foreground/5';\n\nexport const HOVER_ONLY =\n  'opacity-0 transition-opacity duration-150 group-hover/row:opacity-100 group-focus-within/row:opacity-100 in-data-popup-open:opacity-100 pointer-coarse:opacity-100';\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-grid.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/use-delayed-placement.ts",
      "content": "'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\n\nimport type { StatusId, Task } from './data';\n\nconst MOVE_DELAY_MS = 450;\n\ntype HeldPlacements = Record<string, StatusId>;\n\nfunction withoutKey(placements: HeldPlacements, taskId: string) {\n  const next = { ...placements };\n  delete next[taskId];\n  return next;\n}\n\nfunction heldOnce(\n  placements: HeldPlacements,\n  taskId: string,\n  status: StatusId\n): HeldPlacements {\n  if (placements[taskId]) {\n    return placements;\n  }\n  return { ...placements, [taskId]: status };\n}\n\nexport function useDelayedPlacement() {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const [held, setHeld] = useState<HeldPlacements>({});\n  const timers = useRef(new Map<string, ReturnType<typeof setTimeout>>());\n\n  useEffect(() => {\n    const pending = timers.current;\n    return () => {\n      pending.forEach((timer) => clearTimeout(timer));\n    };\n  }, []);\n\n  function release(taskId: string) {\n    timers.current.delete(taskId);\n    setHeld((current) => withoutKey(current, taskId));\n  }\n\n  function hold(taskId: string, previousStatus: StatusId) {\n    if (shouldReduceMotion) {\n      return;\n    }\n    const existing = timers.current.get(taskId);\n    if (existing) {\n      clearTimeout(existing);\n    }\n    setHeld((current) => heldOnce(current, taskId, previousStatus));\n    const timer = setTimeout(() => release(taskId), MOVE_DELAY_MS);\n    timers.current.set(taskId, timer);\n  }\n\n  function placementOf(task: Task) {\n    return held[task.id] ?? task.status;\n  }\n\n  return { hold, placementOf };\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/use-delayed-placement.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-drawer.tsx",
      "content": "'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { Sheet, SheetContent, SheetTitle } from '@/registry/ndeko/ui/sheet';\n\nimport { ChildIssues } from './child-issues';\nimport { CommentComposer } from './comment-composer';\nimport type { ChildIssue, FeedComment, Task } from './data';\nimport { DescriptionBlock } from './description-block';\nimport { taskUrlOf, type FeedFilter } from './detail-model';\nimport { DrawerBar } from './drawer-bar';\nimport { PropertyRows } from './property-rows';\nimport { TaskBand } from './task-band';\nimport { commentOf } from './task-edits';\nimport { TaskFeed } from './task-feed';\nimport { keyOf, nextNumberOf } from './task-model';\n\nconst IGNORED_KEY_TARGETS =\n  'input, textarea, select, [contenteditable=\"true\"], [role=\"menu\"]';\n\nfunction isIgnoredKey(event: KeyboardEvent) {\n  const isCommand = event.metaKey || event.ctrlKey;\n  if (isCommand || event.altKey) {\n    return true;\n  }\n  if (!(event.target instanceof HTMLElement)) {\n    return false;\n  }\n  return Boolean(event.target.closest(IGNORED_KEY_TARGETS));\n}\n\nfunction stepOfKey(key: string) {\n  const lowered = key.toLowerCase();\n  if (lowered === 'j') {\n    return 1;\n  }\n  if (lowered === 'k') {\n    return -1;\n  }\n  return 0;\n}\n\n/** A task opened from outside the walked list, or one that left it, is walked on its own. */\nfunction walkOf(sequence: string[], taskId: string) {\n  if (sequence.includes(taskId)) {\n    return sequence;\n  }\n  return [taskId];\n}\n\ntype TaskDrawerProps = {\n  tasks: Task[];\n  sequence: string[];\n  openTaskId: string | null;\n  shownTaskId: string | null;\n  onOpenTask: (taskId: string) => void;\n  onClose: () => void;\n  onPatch: (taskId: string, patch: Partial<Task>) => void;\n  onComment: (taskId: string, comment: FeedComment) => void;\n};\n\nexport function TaskDrawer({\n  tasks,\n  sequence,\n  openTaskId,\n  shownTaskId,\n  onOpenTask,\n  onClose,\n  onPatch,\n  onComment,\n}: TaskDrawerProps) {\n  const [feedFilter, setFeedFilter] = useState<FeedFilter>('all');\n  const [freshItemId, setFreshItemId] = useState<string | null>(null);\n  const isOpen = openTaskId !== null;\n  const task = tasks.find((item) => item.id === shownTaskId);\n  const shownId = task?.id ?? '';\n  const walk = walkOf(sequence, shownId);\n  const position = walk.indexOf(shownId);\n\n  useEffect(() => {\n    if (!isOpen) {\n      return;\n    }\n    function walkWithKeys(event: KeyboardEvent) {\n      if (isIgnoredKey(event)) {\n        return;\n      }\n      const step = stepOfKey(event.key);\n      if (step === 0) {\n        return;\n      }\n      const nextId = walk[position + step];\n      if (!nextId) {\n        return;\n      }\n      event.preventDefault();\n      onOpenTask(nextId);\n    }\n    document.addEventListener('keydown', walkWithKeys);\n    return () => document.removeEventListener('keydown', walkWithKeys);\n  }, [isOpen, position, walk, onOpenTask]);\n\n  if (!task) {\n    return null;\n  }\n\n  const shownTask = task;\n\n  function handleOpenChange(nextOpen: boolean) {\n    if (!nextOpen) {\n      onClose();\n    }\n  }\n\n  function step(delta: number) {\n    const nextId = walk[position + delta];\n    if (nextId) {\n      onOpenTask(nextId);\n    }\n  }\n\n  function showPrevious() {\n    step(-1);\n  }\n\n  function showNext() {\n    step(1);\n  }\n\n  function patch(changes: Partial<Task>) {\n    onPatch(shownTask.id, changes);\n  }\n\n  function saveDescription(description: string[]) {\n    patch({ description });\n  }\n\n  function changeChildren(children: ChildIssue[]) {\n    patch({ children });\n  }\n\n  function postComment(body: string) {\n    const comment = commentOf(body);\n    onComment(shownTask.id, comment);\n    setFreshItemId(comment.id);\n    if (feedFilter === 'history') {\n      setFeedFilter('all');\n    }\n  }\n\n  return (\n    <Sheet open={isOpen} onOpenChange={handleOpenChange}>\n      <SheetContent\n        showCloseButton={false}\n        className='w-[calc(100%-1rem)] max-w-[42rem] gap-0 overflow-hidden p-0'\n      >\n        <DrawerBar\n          position={position + 1}\n          total={walk.length}\n          link={taskUrlOf(task.number)}\n          onPrevious={showPrevious}\n          onNext={showNext}\n        />\n        <div\n          key={task.id}\n          className='@container min-h-0 flex-1 overflow-y-auto px-5 pb-6'\n        >\n          <TaskBand task={task} />\n          <SheetTitle className='mt-5 text-xl leading-snug font-semibold text-balance'>\n            {task.title}\n          </SheetTitle>\n          {task.parent && (\n            <p className='text-muted-foreground mt-1 text-xs'>\n              Part of {keyOf(task.parent.number)} {task.parent.title}\n            </p>\n          )}\n          <div className='mt-5'>\n            <PropertyRows task={task} onPatch={patch} columns={2} />\n          </div>\n          <div className='mt-8'>\n            <DescriptionBlock\n              paragraphs={task.description}\n              onSave={saveDescription}\n            />\n          </div>\n          <div className='mt-8'>\n            <ChildIssues\n              items={task.children}\n              nextNumber={nextNumberOf(tasks)}\n              onChange={changeChildren}\n            />\n          </div>\n          <div className='mt-8'>\n            <TaskFeed\n              items={task.feed}\n              filter={feedFilter}\n              onFilterChange={setFeedFilter}\n              freshItemId={freshItemId}\n            />\n          </div>\n        </div>\n        <div className='before:from-card relative shrink-0 px-5 pt-3 pb-4 before:pointer-events-none before:absolute before:inset-x-0 before:-top-4 before:h-4 before:bg-linear-to-t before:to-transparent'>\n          <CommentComposer onSubmit={postComment} />\n        </div>\n      </SheetContent>\n    </Sheet>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-drawer.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/drawer-bar.tsx",
      "content": "'use client';\n\nimport {\n  CheckIcon,\n  ChevronDownIcon,\n  ChevronUpIcon,\n  LinkIcon,\n  XIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\nimport { SheetClose } from '@/registry/ndeko/ui/sheet';\nimport {\n  TOOLTIP_GLIDE_CLOSE_DELAY,\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n  useTooltipHandle,\n} from '@/registry/ndeko/ui/tooltip';\n\nimport { Swap } from './motion-parts';\nimport { useCopied } from './use-copied';\n\ntype TaskStepHint = { label: string; shortcut: string };\n\nconst PREVIOUS_TASK_HINT: TaskStepHint = {\n  label: 'Previous task',\n  shortcut: 'K',\n};\n\nconst NEXT_TASK_HINT: TaskStepHint = { label: 'Next task', shortcut: 'J' };\n\nfunction TaskStepHintLabel({ hint }: { hint: TaskStepHint | undefined }) {\n  if (!hint) {\n    return null;\n  }\n  return (\n    <>\n      {hint.label} <Kbd>{hint.shortcut}</Kbd>\n    </>\n  );\n}\n\ntype DrawerBarProps = {\n  position: number;\n  total: number;\n  link: string;\n  onPrevious: () => void;\n  onNext: () => void;\n};\n\nfunction copyLabelOf(isCopied: boolean) {\n  if (isCopied) {\n    return 'Link copied';\n  }\n  return 'Copy link';\n}\n\nexport function DrawerBar({\n  position,\n  total,\n  link,\n  onPrevious,\n  onNext,\n}: DrawerBarProps) {\n  const { isCopied, copy } = useCopied();\n  const isFirst = position <= 1;\n  const isLast = position >= total;\n  const stepHint = useTooltipHandle<TaskStepHint>();\n\n  return (\n    <div className='flex h-12 shrink-0 items-center gap-1 px-3'>\n      <TooltipTrigger\n        handle={stepHint}\n        payload={PREVIOUS_TASK_HINT}\n        closeDelay={TOOLTIP_GLIDE_CLOSE_DELAY}\n        render={\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label='Previous task'\n            disabled={isFirst}\n            onClick={onPrevious}\n          />\n        }\n      >\n        <ChevronUpIcon />\n      </TooltipTrigger>\n      <TooltipTrigger\n        handle={stepHint}\n        payload={NEXT_TASK_HINT}\n        closeDelay={TOOLTIP_GLIDE_CLOSE_DELAY}\n        render={\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label='Next task'\n            disabled={isLast}\n            onClick={onNext}\n          />\n        }\n      >\n        <ChevronDownIcon />\n      </TooltipTrigger>\n      <Tooltip handle={stepHint}>\n        {({ payload }) => (\n          <TooltipContent glide>\n            <TaskStepHintLabel hint={payload} />\n          </TooltipContent>\n        )}\n      </Tooltip>\n      <span className='text-muted-foreground ms-1 text-xs tabular-nums'>\n        {position} of {total}\n      </span>\n      <div className='ms-auto flex items-center gap-1'>\n        <Button\n          variant='ghost'\n          size='icon-sm'\n          aria-label={copyLabelOf(isCopied)}\n          onClick={() => copy(link)}\n        >\n          <Swap swapKey={String(isCopied)}>\n            {isCopied && <CheckIcon className='text-success-foreground' />}\n            {!isCopied && <LinkIcon />}\n          </Swap>\n        </Button>\n        <SheetClose\n          render={<Button variant='ghost' size='icon-sm' aria-label='Close' />}\n        >\n          <XIcon />\n        </SheetClose>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/drawer-bar.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-band.tsx",
      "content": "import { TEAM_NAME, type Task } from './data';\nimport { shortDateOf } from './detail-model';\nimport { Swap } from './motion-parts';\nimport { IssueTypeGem, StatusGlyph } from './task-glyphs';\nimport { issueTypeOf, keyOf, statusOf } from './task-model';\n\nexport function TaskBand({ task }: { task: Task }) {\n  const type = issueTypeOf(task.type);\n  const status = statusOf(task.status);\n\n  return (\n    <div className='bg-foreground/[0.03] text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1.5 rounded-lg px-3 py-2 text-xs'>\n      <span className='text-foreground flex items-center gap-1.5 font-medium'>\n        <IssueTypeGem type={task.type} />\n        {type.name}\n      </span>\n      <span>{TEAM_NAME}</span>\n      <span className='tabular-nums'>{keyOf(task.number)}</span>\n      <span>Created {shortDateOf(task.createdAt)}</span>\n      <span className='text-foreground ms-auto flex items-center gap-1.5'>\n        <Swap swapKey={task.status}>\n          <StatusGlyph status={task.status} />\n        </Swap>\n        {status.name}\n      </span>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-band.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/property-rows.tsx",
      "content": "'use client';\n\nimport {\n  CalendarIcon,\n  CircleDashedIcon,\n  ClockIcon,\n  HashIcon,\n  PlusIcon,\n  UsersIcon,\n  XIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Chip } from '@/registry/ndeko/ui/chip';\nimport {\n  DropdownMenu,\n  DropdownMenuCheckboxItem,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\n\nimport { LABELS, PEOPLE, PRIORITIES, STATUSES, type Task } from './data';\nimport {\n  datePresetsOf,\n  durationLabel,\n  ESTIMATE_PRESETS,\n  longDateOf,\n} from './detail-model';\nimport { Swap } from './motion-parts';\nimport { PersonAvatar, PriorityGlyph, StatusGlyph } from './task-glyphs';\nimport {\n  isOverdue,\n  isPriorityId,\n  isStatusId,\n  labelsOf,\n  peopleOf,\n  priorityOf,\n  statusOf,\n  toggledIds,\n} from './task-model';\n\ntype Patch = (patch: Partial<Task>) => void;\n\nconst VALUE_TRIGGER =\n  'inline-flex h-7 min-w-0 max-w-full -mx-1.5 cursor-pointer items-center gap-1.5 rounded-md px-1.5 text-[13px] outline-none transition-colors duration-150 hover:bg-foreground/5 focus-visible:ring-[3px] focus-visible:ring-ring/25 data-popup-open:bg-foreground/5';\n\nconst ADD_SLOT =\n  'inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full hairline-border border-dashed border-foreground/20 text-muted-foreground outline-none transition-colors duration-150 hover:border-foreground/35 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/25 data-popup-open:border-foreground/35';\n\nfunction EmptyValue({ text }: { text: string }) {\n  return (\n    <span className='text-muted-foreground inline-flex items-center gap-1'>\n      <PlusIcon className='size-3.5' />\n      {text}\n    </span>\n  );\n}\n\ntype PropertyRowProps = {\n  icon: React.ReactNode;\n  label: string;\n  children: React.ReactNode;\n};\n\nfunction PropertyRow({ icon, label, children }: PropertyRowProps) {\n  return (\n    <div className='flex min-h-9 items-center gap-2'>\n      <div className='text-muted-foreground flex w-[6.75rem] shrink-0 items-center gap-2 text-[13px] [&_svg]:size-4'>\n        {icon}\n        {label}\n      </div>\n      <div className='flex min-w-0 flex-1 flex-wrap items-center gap-1'>\n        {children}\n      </div>\n    </div>\n  );\n}\n\nfunction StatusValue({ task, onPatch }: { task: Task; onPatch: Patch }) {\n  const meta = statusOf(task.status);\n\n  function pick(value: unknown) {\n    if (isStatusId(value)) {\n      onPatch({ status: value });\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        aria-label={`Status: ${meta.name}. Change status`}\n        className={VALUE_TRIGGER}\n      >\n        <Swap swapKey={task.status}>\n          <StatusGlyph status={task.status} />\n        </Swap>\n        <span className='truncate'>{meta.name}</span>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-48'>\n        <DropdownMenuRadioGroup value={task.status} onValueChange={pick}>\n          {STATUSES.map((status) => (\n            <DropdownMenuRadioItem\n              key={status.id}\n              value={status.id}\n              closeOnClick\n            >\n              <StatusGlyph status={status.id} />\n              {status.name}\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nfunction PriorityValue({ task, onPatch }: { task: Task; onPatch: Patch }) {\n  const meta = priorityOf(task.priority);\n  const isUnset = task.priority === 'none';\n\n  function pick(value: unknown) {\n    if (isPriorityId(value)) {\n      onPatch({ priority: value });\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        aria-label={`Priority: ${meta.name}. Change priority`}\n        className={VALUE_TRIGGER}\n      >\n        {isUnset && <EmptyValue text='Set priority' />}\n        {!isUnset && (\n          <>\n            <Swap swapKey={task.priority}>\n              <PriorityGlyph priority={task.priority} />\n            </Swap>\n            <span className='truncate'>{meta.name}</span>\n          </>\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-44'>\n        <DropdownMenuRadioGroup value={task.priority} onValueChange={pick}>\n          {PRIORITIES.map((priority) => (\n            <DropdownMenuRadioItem\n              key={priority.id}\n              value={priority.id}\n              closeOnClick\n            >\n              <PriorityGlyph priority={priority.id} />\n              {priority.name}\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nfunction firstNameOf(name: string) {\n  return name.split(' ')[0];\n}\n\nfunction PeopleValue({ task, onPatch }: { task: Task; onPatch: Patch }) {\n  const assignees = peopleOf(task.assigneeIds);\n  const hasAssignees = assignees.length > 0;\n\n  function toggle(personId: string, isIncluded: boolean) {\n    onPatch({\n      assigneeIds: toggledIds(task.assigneeIds, personId, isIncluded),\n    });\n  }\n\n  const menu = (\n    <DropdownMenuContent className='w-52'>\n      {PEOPLE.map((person) => (\n        <DropdownMenuCheckboxItem\n          key={person.id}\n          checked={task.assigneeIds.includes(person.id)}\n          onCheckedChange={(checked) => toggle(person.id, checked)}\n        >\n          <PersonAvatar person={person} />\n          {person.name}\n        </DropdownMenuCheckboxItem>\n      ))}\n    </DropdownMenuContent>\n  );\n\n  if (!hasAssignees) {\n    return (\n      <DropdownMenu>\n        <DropdownMenuTrigger className={VALUE_TRIGGER}>\n          <EmptyValue text='Add people' />\n        </DropdownMenuTrigger>\n        {menu}\n      </DropdownMenu>\n    );\n  }\n\n  return (\n    <>\n      {assignees.map((person) => (\n        <span\n          key={person.id}\n          className='bg-card hairline-ring ring-border inline-flex h-6 max-w-40 items-center gap-1.5 rounded-full ps-0.5 pe-2 text-xs'\n        >\n          <PersonAvatar person={person} />\n          <span className='truncate'>{firstNameOf(person.name)}</span>\n        </span>\n      ))}\n      <DropdownMenu>\n        <DropdownMenuTrigger aria-label='Change people' className={ADD_SLOT}>\n          <PlusIcon className='size-3.5' />\n        </DropdownMenuTrigger>\n        {menu}\n      </DropdownMenu>\n    </>\n  );\n}\n\nfunction LabelsValue({ task, onPatch }: { task: Task; onPatch: Patch }) {\n  const labels = labelsOf(task.labelIds);\n  const hasLabels = labels.length > 0;\n\n  function toggle(labelId: string, isIncluded: boolean) {\n    onPatch({ labelIds: toggledIds(task.labelIds, labelId, isIncluded) });\n  }\n\n  const menu = (\n    <DropdownMenuContent className='w-48'>\n      {LABELS.map((label) => {\n        const dotStyle = {\n          backgroundColor: label.color,\n        } as React.CSSProperties;\n        return (\n          <DropdownMenuCheckboxItem\n            key={label.id}\n            checked={task.labelIds.includes(label.id)}\n            onCheckedChange={(checked) => toggle(label.id, checked)}\n          >\n            <span\n              aria-hidden='true'\n              style={dotStyle}\n              className='mx-1 size-2 shrink-0 rounded-full'\n            />\n            {label.name}\n          </DropdownMenuCheckboxItem>\n        );\n      })}\n    </DropdownMenuContent>\n  );\n\n  if (!hasLabels) {\n    return (\n      <DropdownMenu>\n        <DropdownMenuTrigger className={VALUE_TRIGGER}>\n          <EmptyValue text='Add label' />\n        </DropdownMenuTrigger>\n        {menu}\n      </DropdownMenu>\n    );\n  }\n\n  return (\n    <>\n      {labels.map((label) => (\n        <Chip key={label.id} color={label.color} className='h-6 px-2'>\n          {label.name}\n        </Chip>\n      ))}\n      <DropdownMenu>\n        <DropdownMenuTrigger aria-label='Change labels' className={ADD_SLOT}>\n          <PlusIcon className='size-3.5' />\n        </DropdownMenuTrigger>\n        {menu}\n      </DropdownMenu>\n    </>\n  );\n}\n\nfunction dueToneOf(task: Task) {\n  if (isOverdue(task)) {\n    return 'text-destructive-ink';\n  }\n  return '';\n}\n\nfunction DueValue({ task, onPatch }: { task: Task; onPatch: Patch }) {\n  const presets = datePresetsOf();\n\n  function pick(value: unknown) {\n    if (typeof value === 'string') {\n      onPatch({ due: value });\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger className={VALUE_TRIGGER}>\n        {!task.due && <EmptyValue text='Add date' />}\n        {task.due && (\n          <Swap swapKey={task.due} className={dueToneOf(task)}>\n            {longDateOf(task.due)}\n            {isOverdue(task) && <span className='sr-only'>, overdue</span>}\n          </Swap>\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-60'>\n        <DropdownMenuRadioGroup value={task.due ?? ''} onValueChange={pick}>\n          {presets.map((preset) => (\n            <DropdownMenuRadioItem\n              key={preset.label}\n              value={preset.date}\n              closeOnClick\n            >\n              <CalendarIcon />\n              <span className='flex-1'>{preset.label}</span>\n              <span className='text-muted-foreground text-xs tabular-nums'>\n                {longDateOf(preset.date)}\n              </span>\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n        {task.due && (\n          <>\n            <DropdownMenuSeparator />\n            <DropdownMenuItem onClick={() => onPatch({ due: undefined })}>\n              <XIcon />\n              Clear date\n            </DropdownMenuItem>\n          </>\n        )}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nfunction EstimateValue({ task, onPatch }: { task: Task; onPatch: Patch }) {\n  const estimate = task.estimateMinutes;\n  const hasEstimate = estimate !== undefined;\n\n  function pick(value: unknown) {\n    const minutes = Number(value);\n    if (Number.isFinite(minutes)) {\n      onPatch({ estimateMinutes: minutes });\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger className={VALUE_TRIGGER}>\n        {!hasEstimate && <EmptyValue text='Estimate' />}\n        {hasEstimate && (\n          <Swap swapKey={String(estimate)} className='tabular-nums'>\n            {durationLabel(estimate)}\n          </Swap>\n        )}\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-40'>\n        <DropdownMenuRadioGroup\n          value={String(estimate ?? '')}\n          onValueChange={pick}\n        >\n          {ESTIMATE_PRESETS.map((minutes) => (\n            <DropdownMenuRadioItem\n              key={minutes}\n              value={String(minutes)}\n              closeOnClick\n            >\n              <ClockIcon />\n              <span className='tabular-nums'>{durationLabel(minutes)}</span>\n            </DropdownMenuRadioItem>\n          ))}\n        </DropdownMenuRadioGroup>\n        {hasEstimate && (\n          <>\n            <DropdownMenuSeparator />\n            <DropdownMenuItem\n              onClick={() => onPatch({ estimateMinutes: undefined })}\n            >\n              <XIcon />\n              Clear estimate\n            </DropdownMenuItem>\n          </>\n        )}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\ntype PropertyRowsProps = {\n  task: Task;\n  onPatch: Patch;\n  columns: 1 | 2;\n};\n\nexport function PropertyRows({ task, onPatch, columns }: PropertyRowsProps) {\n  const isTwoColumn = columns === 2;\n\n  return (\n    <div className={cn('grid gap-x-8', isTwoColumn && '@xl:grid-cols-2')}>\n      <PropertyRow icon={<CircleDashedIcon />} label='Status'>\n        <StatusValue task={task} onPatch={onPatch} />\n      </PropertyRow>\n      <PropertyRow\n        icon={\n          <PriorityGlyph priority='high' className='text-muted-foreground' />\n        }\n        label='Priority'\n      >\n        <PriorityValue task={task} onPatch={onPatch} />\n      </PropertyRow>\n      <PropertyRow icon={<UsersIcon />} label='People'>\n        <PeopleValue task={task} onPatch={onPatch} />\n      </PropertyRow>\n      <PropertyRow icon={<HashIcon />} label='Labels'>\n        <LabelsValue task={task} onPatch={onPatch} />\n      </PropertyRow>\n      <PropertyRow icon={<CalendarIcon />} label='Due date'>\n        <DueValue task={task} onPatch={onPatch} />\n      </PropertyRow>\n      <PropertyRow icon={<ClockIcon />} label='Estimate'>\n        <EstimateValue task={task} onPatch={onPatch} />\n      </PropertyRow>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/property-rows.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/description-block.tsx",
      "content": "'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { PencilIcon, PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Textarea } from '@/registry/ndeko/ui/textarea';\n\nfunction paragraphsOf(text: string) {\n  const blocks = text.split(/\\n\\s*\\n/);\n  const trimmed = blocks.map((block) => block.trim());\n  return trimmed.filter(Boolean);\n}\n\ntype DescriptionBlockProps = {\n  paragraphs: string[];\n  onSave: (paragraphs: string[]) => void;\n};\n\nexport function DescriptionBlock({\n  paragraphs,\n  onSave,\n}: DescriptionBlockProps) {\n  const textareaRef = useRef<HTMLTextAreaElement>(null);\n  const [isEditing, setIsEditing] = useState(false);\n  const [draft, setDraft] = useState('');\n  const isEmpty = paragraphs.length === 0;\n  const showsText = !isEditing && !isEmpty;\n  const showsAdd = !isEditing && isEmpty;\n\n  useEffect(() => {\n    if (isEditing) {\n      textareaRef.current?.focus();\n    }\n  }, [isEditing]);\n\n  function startEditing() {\n    setDraft(paragraphs.join('\\n\\n'));\n    setIsEditing(true);\n  }\n\n  function cancel() {\n    setIsEditing(false);\n  }\n\n  function save() {\n    onSave(paragraphsOf(draft));\n    setIsEditing(false);\n  }\n\n  function handleKeyDown(event: React.KeyboardEvent<HTMLTextAreaElement>) {\n    if (event.key === 'Escape') {\n      event.preventDefault();\n      event.stopPropagation();\n      cancel();\n      return;\n    }\n    const isCommand = event.metaKey || event.ctrlKey;\n    if (event.key === 'Enter' && isCommand) {\n      event.preventDefault();\n      save();\n    }\n  }\n\n  return (\n    <section aria-label='Description'>\n      <div className='flex h-7 items-center justify-between gap-2'>\n        <h3 className='text-[13px] font-medium'>Description</h3>\n        {showsText && (\n          <Button\n            variant='ghost'\n            size='sm'\n            onClick={startEditing}\n            className='text-muted-foreground'\n          >\n            <PencilIcon />\n            Edit\n          </Button>\n        )}\n      </div>\n      <AnimatedSize className='mt-2'>\n        {showsText && (\n          <div\n            onDoubleClick={startEditing}\n            className='flex flex-col gap-3 text-sm leading-relaxed text-pretty'\n          >\n            {paragraphs.map((paragraph) => (\n              <p key={paragraph}>{paragraph}</p>\n            ))}\n          </div>\n        )}\n        {showsAdd && (\n          <button\n            type='button'\n            onClick={startEditing}\n            className='text-muted-foreground hover:text-foreground focus-visible:ring-ring/25 inline-flex h-7 cursor-pointer items-center gap-1 rounded-md text-[13px] outline-none focus-visible:ring-[3px]'\n          >\n            <PlusIcon className='size-3.5' />\n            Add a description\n          </button>\n        )}\n        {isEditing && (\n          <div className='flex flex-col gap-2'>\n            <Textarea\n              ref={textareaRef}\n              value={draft}\n              onChange={(event) => setDraft(event.target.value)}\n              onKeyDown={handleKeyDown}\n              aria-label='Description'\n              placeholder='What needs to happen, and why'\n              className='min-h-28 text-base leading-relaxed md:text-sm'\n            />\n            <div className='flex items-center justify-end gap-2'>\n              <Button variant='ghost' size='sm' onClick={cancel}>\n                Cancel\n              </Button>\n              <Button size='sm' onClick={save}>\n                Save\n              </Button>\n            </div>\n          </div>\n        )}\n      </AnimatedSize>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/description-block.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/child-issues.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useState } from 'react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nimport type { ChildIssue, StatusId } from './data';\nimport { heightPresenceOf, Swap } from './motion-parts';\nimport { PersonAvatar, StatusGlyph } from './task-glyphs';\nimport { keyOf, personOf, statusOf } from './task-model';\n\nconst RING_RADIUS = 6;\nconst RING_CIRCUMFERENCE = 2 * Math.PI * RING_RADIUS;\n\nconst ADD_ROW =\n  'flex h-9 w-full items-center gap-2.5 rounded-lg px-2.5 text-[13px] text-muted-foreground hairline-border border-dashed border-foreground/20 outline-none transition-colors duration-150';\n\nfunction shareOf(done: number, total: number) {\n  if (total === 0) {\n    return 0;\n  }\n  return done / total;\n}\n\nfunction ProgressRing({ done, total }: { done: number; total: number }) {\n  const share = shareOf(done, total);\n  const offset = RING_CIRCUMFERENCE * (1 - share);\n\n  return (\n    <svg viewBox='0 0 16 16' aria-hidden='true' className='size-4 -rotate-90'>\n      <circle\n        cx='8'\n        cy='8'\n        r={RING_RADIUS}\n        fill='none'\n        stroke='currentColor'\n        strokeWidth='2'\n        className='text-foreground/10'\n      />\n      <circle\n        cx='8'\n        cy='8'\n        r={RING_RADIUS}\n        fill='none'\n        stroke='var(--success)'\n        strokeWidth='2'\n        strokeDasharray={RING_CIRCUMFERENCE}\n        strokeDashoffset={offset}\n        className='transition-[stroke-dashoffset] duration-300 ease-(--ease-out-strong)'\n      />\n    </svg>\n  );\n}\n\nfunction nextStatusOf(status: StatusId): StatusId {\n  if (status === 'done') {\n    return 'todo';\n  }\n  return 'done';\n}\n\nfunction toggleLabelOf(child: ChildIssue) {\n  const key = keyOf(child.number);\n  if (child.status === 'done') {\n    return `Reopen ${key}`;\n  }\n  return `Mark ${key} as done`;\n}\n\nfunction assigneeOf(child: ChildIssue) {\n  if (!child.assigneeId) {\n    return undefined;\n  }\n  return personOf(child.assigneeId);\n}\n\nfunction ChildRow({\n  child,\n  onToggle,\n}: {\n  child: ChildIssue;\n  onToggle: (childId: string) => void;\n}) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const presence = heightPresenceOf(shouldReduceMotion);\n  const isDone = child.status === 'done';\n  const assignee = assigneeOf(child);\n\n  return (\n    <motion.li {...presence} className='overflow-hidden'>\n      <div className='flex h-9 items-center gap-2.5 px-1.5'>\n        <button\n          type='button'\n          aria-label={toggleLabelOf(child)}\n          onClick={() => onToggle(child.id)}\n          className='hover:bg-foreground/5 focus-visible:ring-ring/25 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md outline-none focus-visible:ring-[3px]'\n        >\n          <Swap swapKey={child.status}>\n            <StatusGlyph status={child.status} />\n          </Swap>\n        </button>\n        <span className='text-muted-foreground w-14 shrink-0 text-xs tabular-nums'>\n          {keyOf(child.number)}\n        </span>\n        <span\n          className={cn(\n            'min-w-0 flex-1 truncate text-[13px]',\n            isDone && 'text-muted-foreground line-through'\n          )}\n        >\n          {child.title}\n        </span>\n        <span className='sr-only'>{statusOf(child.status).name}</span>\n        {assignee && <PersonAvatar person={assignee} className='me-1' />}\n      </div>\n    </motion.li>\n  );\n}\n\ntype ChildIssuesProps = {\n  items: ChildIssue[];\n  nextNumber: number;\n  onChange: (items: ChildIssue[]) => void;\n};\n\nexport function ChildIssues({ items, nextNumber, onChange }: ChildIssuesProps) {\n  const [isAdding, setIsAdding] = useState(false);\n  const [title, setTitle] = useState('');\n  const doneCount = items.filter((child) => child.status === 'done').length;\n  const hasItems = items.length > 0;\n\n  function toggle(childId: string) {\n    const next = items.map((child) => {\n      if (child.id !== childId) {\n        return child;\n      }\n      return { ...child, status: nextStatusOf(child.status) };\n    });\n    onChange(next);\n  }\n\n  function add() {\n    const trimmed = title.trim();\n    if (!trimmed) {\n      return;\n    }\n    const child: ChildIssue = {\n      id: `child-${nextNumber}`,\n      number: nextNumber,\n      title: trimmed,\n      status: 'todo',\n    };\n    onChange([...items, child]);\n    setTitle('');\n  }\n\n  function stopAdding() {\n    setIsAdding(false);\n    setTitle('');\n  }\n\n  function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n    if (event.key === 'Enter') {\n      event.preventDefault();\n      add();\n      return;\n    }\n    if (event.key === 'Escape') {\n      event.preventDefault();\n      event.stopPropagation();\n      stopAdding();\n    }\n  }\n\n  function handleBlur() {\n    const isEmpty = title.trim().length === 0;\n    if (isEmpty) {\n      stopAdding();\n    }\n  }\n\n  return (\n    <section aria-label='Child issues'>\n      <div className='flex h-7 items-center gap-2'>\n        <h3 className='text-[13px] font-medium'>Child issues</h3>\n        {hasItems && (\n          <span className='text-muted-foreground flex items-center gap-1.5 text-xs tabular-nums'>\n            <ProgressRing done={doneCount} total={items.length} />\n            <span aria-hidden='true' className='flex'>\n              <MotionNumber value={doneCount} />/\n              <MotionNumber value={items.length} />\n            </span>\n            <span className='sr-only'>\n              {doneCount} of {items.length} done\n            </span>\n          </span>\n        )}\n      </div>\n      <div className='mt-2 flex flex-col gap-2'>\n        {hasItems && (\n          <ul className='bg-card hairline-ring ring-border hairline-divide-y divide-border overflow-clip rounded-lg'>\n            <AnimatePresence initial={false}>\n              {items.map((child) => (\n                <ChildRow key={child.id} child={child} onToggle={toggle} />\n              ))}\n            </AnimatePresence>\n          </ul>\n        )}\n        {!isAdding && (\n          <button\n            type='button'\n            onClick={() => setIsAdding(true)}\n            className={cn(\n              ADD_ROW,\n              'hover:border-foreground/35 hover:text-foreground focus-visible:ring-ring/25 cursor-pointer focus-visible:ring-[3px]'\n            )}\n          >\n            <PlusIcon className='size-4' />\n            Add child issue\n          </button>\n        )}\n        {isAdding && (\n          <div className={cn(ADD_ROW, 'border-foreground/35 text-foreground')}>\n            <StatusGlyph status='todo' />\n            <input\n              autoFocus\n              value={title}\n              onChange={(event) => setTitle(event.target.value)}\n              onKeyDown={handleKeyDown}\n              onBlur={handleBlur}\n              aria-label='Child issue title'\n              placeholder='Child issue title, then Enter'\n              className='placeholder:text-muted-foreground/75 h-7 min-w-0 flex-1 bg-transparent text-base outline-none md:text-[13px]'\n            />\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/child-issues.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-feed.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useRef } from 'react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  CircleDashedIcon,\n  ClockIcon,\n  HashIcon,\n  PlusIcon,\n  UserIcon,\n} from '@/registry/ndeko/lib/icons';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Tabs, TabsList, TabsTab } from '@/registry/ndeko/ui/tabs';\n\nimport type { ChangeKind, FeedChange, FeedComment, FeedItem } from './data';\nimport {\n  dayGroupsOf,\n  feedCountsOf,\n  isFeedFilter,\n  timeOf,\n  type FeedFilter,\n} from './detail-model';\nimport { heightPresenceOf } from './motion-parts';\nimport { PersonAvatar, PriorityGlyph } from './task-glyphs';\nimport { personOf } from './task-model';\n\nconst FILTERS: { id: FeedFilter; label: string }[] = [\n  { id: 'all', label: 'All' },\n  { id: 'comments', label: 'Comments' },\n  { id: 'history', label: 'History' },\n];\n\nconst EMPTY_LINE: Record<FeedFilter, string> = {\n  all: 'Nothing has happened on this task yet',\n  comments: 'No comments yet, write the first one below',\n  history: 'No changes recorded yet',\n};\n\nconst CHANGE_GLYPH: Record<ChangeKind, React.ReactNode> = {\n  created: <PlusIcon />,\n  status: <CircleDashedIcon />,\n  assignee: <UserIcon />,\n  estimate: <ClockIcon />,\n  label: <HashIcon />,\n  priority: <PriorityGlyph priority='high' className='text-muted-foreground' />,\n};\n\nconst THREAD =\n  'relative before:absolute before:inset-y-4 before:start-3 before:hairline-l before:border-dashed before:border-foreground/15';\n\nfunction scrollBehaviorOf(shouldReduceMotion: boolean | null): ScrollBehavior {\n  if (shouldReduceMotion) {\n    return 'auto';\n  }\n  return 'smooth';\n}\n\nfunction CommentEntry({ item }: { item: FeedComment }) {\n  const author = personOf(item.authorId);\n  return (\n    <div className='flex gap-3'>\n      <PersonAvatar person={author} className='relative size-6 text-[10px]' />\n      <div className='min-w-0 flex-1 pt-0.5'>\n        <p className='flex items-baseline gap-2 text-[13px]'>\n          <span className='font-medium'>{author.name}</span>\n          <time\n            dateTime={item.at}\n            className='text-muted-foreground text-xs tabular-nums'\n          >\n            {timeOf(item.at)}\n          </time>\n        </p>\n        <p className='mt-1 text-[13px] leading-relaxed whitespace-pre-line'>\n          {item.body}\n        </p>\n      </div>\n    </div>\n  );\n}\n\nfunction ChangeEntry({ item }: { item: FeedChange }) {\n  const author = personOf(item.authorId);\n  return (\n    <div className='flex items-center gap-3'>\n      <span className='keycap-3d text-muted-foreground relative flex size-6 shrink-0 items-center justify-center rounded-full [&_svg]:size-3'>\n        {CHANGE_GLYPH[item.change]}\n      </span>\n      <p className='text-muted-foreground min-w-0 text-[13px]'>\n        <span className='text-foreground font-medium'>{author.name}</span>{' '}\n        {item.text}\n        <time dateTime={item.at} className='ms-2 text-xs tabular-nums'>\n          {timeOf(item.at)}\n        </time>\n      </p>\n    </div>\n  );\n}\n\nfunction FeedEntry({ item, isFresh }: { item: FeedItem; isFresh: boolean }) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const presence = heightPresenceOf(shouldReduceMotion);\n  const entryRef = useRef<HTMLLIElement>(null);\n\n  function revealIfFresh() {\n    if (!isFresh) {\n      return;\n    }\n    entryRef.current?.scrollIntoView({\n      block: 'nearest',\n      behavior: scrollBehaviorOf(shouldReduceMotion),\n    });\n  }\n\n  return (\n    <motion.li\n      ref={entryRef}\n      {...presence}\n      onAnimationComplete={revealIfFresh}\n      className='overflow-hidden'\n    >\n      <div className='py-1.5'>\n        {item.kind === 'comment' && <CommentEntry item={item} />}\n        {item.kind === 'change' && <ChangeEntry item={item} />}\n      </div>\n    </motion.li>\n  );\n}\n\nfunction DayGroupBlock({\n  label,\n  items,\n  freshItemId,\n}: {\n  label: string;\n  items: FeedItem[];\n  freshItemId: string | null;\n}) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const presence = heightPresenceOf(shouldReduceMotion);\n\n  return (\n    <motion.div {...presence} className='overflow-hidden'>\n      <p className='text-muted-foreground pt-3 pb-1 text-xs font-medium'>\n        {label}\n      </p>\n      <ul className={THREAD}>\n        <AnimatePresence initial={false}>\n          {items.map((item) => (\n            <FeedEntry\n              key={item.id}\n              item={item}\n              isFresh={item.id === freshItemId}\n            />\n          ))}\n        </AnimatePresence>\n      </ul>\n    </motion.div>\n  );\n}\n\ntype TaskFeedProps = {\n  items: FeedItem[];\n  filter: FeedFilter;\n  onFilterChange: (filter: FeedFilter) => void;\n  freshItemId: string | null;\n  children?: React.ReactNode;\n};\n\nexport function TaskFeed({\n  items,\n  filter,\n  onFilterChange,\n  freshItemId,\n  children,\n}: TaskFeedProps) {\n  const counts = feedCountsOf(items);\n  const groups = dayGroupsOf(items, filter);\n  const isEmpty = groups.length === 0;\n\n  function change(value: unknown) {\n    if (isFeedFilter(value)) {\n      onFilterChange(value);\n    }\n  }\n\n  return (\n    <section aria-label='Activity'>\n      <div className='flex flex-wrap items-center justify-between gap-2'>\n        <h3 className='text-[13px] font-medium'>Activity</h3>\n        <Tabs value={filter} onValueChange={change}>\n          <TabsList variant='segmented' aria-label='What the activity shows'>\n            {FILTERS.map((option) => (\n              <TabsTab key={option.id} value={option.id}>\n                {option.label}\n                <MotionNumber\n                  value={counts[option.id]}\n                  className='text-muted-foreground text-xs'\n                />\n              </TabsTab>\n            ))}\n          </TabsList>\n        </Tabs>\n      </div>\n      <AnimatedSize className='mt-1'>\n        <div key={filter}>\n          {isEmpty && (\n            <p className='text-muted-foreground py-4 text-[13px]'>\n              {EMPTY_LINE[filter]}\n            </p>\n          )}\n          <AnimatePresence initial={false}>\n            {groups.map((group) => (\n              <DayGroupBlock\n                key={group.day}\n                label={group.label}\n                items={group.items}\n                freshItemId={freshItemId}\n              />\n            ))}\n          </AnimatePresence>\n        </div>\n      </AnimatedSize>\n      {children}\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-feed.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/comment-composer.tsx",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Textarea } from '@/registry/ndeko/ui/textarea';\n\nimport { PersonAvatar } from './task-glyphs';\nimport { currentUser } from './task-model';\n\ntype CommentComposerProps = {\n  onSubmit: (body: string) => void;\n  className?: string;\n};\n\nexport function CommentComposer({ onSubmit, className }: CommentComposerProps) {\n  const [body, setBody] = useState('');\n  const me = currentUser();\n  const trimmed = body.trim();\n  const canSend = trimmed.length > 0;\n\n  function submit() {\n    if (!canSend) {\n      return;\n    }\n    onSubmit(trimmed);\n    setBody('');\n  }\n\n  function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    submit();\n  }\n\n  function handleKeyDown(event: React.KeyboardEvent<HTMLTextAreaElement>) {\n    if (event.key === 'Escape') {\n      event.stopPropagation();\n      event.currentTarget.blur();\n      return;\n    }\n    const isCommand = event.metaKey || event.ctrlKey;\n    if (event.key === 'Enter' && isCommand) {\n      event.preventDefault();\n      submit();\n    }\n  }\n\n  return (\n    <form\n      onSubmit={handleSubmit}\n      className={cn('flex items-start gap-2.5', className)}\n    >\n      <PersonAvatar person={me} className='mt-1 size-7 text-[10px]' />\n      <div className='relative min-w-0 flex-1'>\n        <Textarea\n          value={body}\n          onChange={(event) => setBody(event.target.value)}\n          onKeyDown={handleKeyDown}\n          rows={1}\n          aria-label={`Comment as ${me.name}`}\n          placeholder='Leave a comment'\n          className='min-h-9 py-2 pe-24'\n        />\n        <Button\n          type='submit'\n          size='sm'\n          disabled={!canSend}\n          className='absolute end-1 bottom-1'\n        >\n          Comment\n        </Button>\n      </div>\n    </form>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/comment-composer.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/use-copied.ts",
      "content": "'use client';\n\nimport { useEffect, useRef, useState } from 'react';\nimport { toast } from 'sonner';\n\nconst COPIED_FOR_MS = 1600;\n\nexport function useCopied() {\n  const [isCopied, setIsCopied] = useState(false);\n  const timers = useRef(new Set<ReturnType<typeof setTimeout>>());\n\n  useEffect(() => {\n    const pending = timers.current;\n    return () => {\n      pending.forEach((timer) => clearTimeout(timer));\n    };\n  }, []);\n\n  async function copy(text: string) {\n    try {\n      await navigator.clipboard.writeText(text);\n    } catch {\n      toast.error('Couldn’t copy', {\n        description:\n          'The browser blocked the clipboard, copy it from the address bar instead',\n      });\n      return;\n    }\n    setIsCopied(true);\n    timers.current.forEach((timer) => clearTimeout(timer));\n    timers.current.clear();\n    const timer = setTimeout(() => setIsCopied(false), COPIED_FOR_MS);\n    timers.current.add(timer);\n  }\n\n  return { isCopied, copy };\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/use-copied.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-edits.ts",
      "content": "import { format } from 'date-fns';\n\nimport {\n  CURRENT_USER_ID,\n  TODAY,\n  type FeedChange,\n  type FeedComment,\n  type StatusId,\n  type Task,\n} from './data';\nimport { statusOf } from './task-model';\n\nfunction nowStamp() {\n  const time = format(new Date(), 'HH:mm:ss');\n  return `${TODAY}T${time}`;\n}\n\nfunction localIdOf(prefix: string) {\n  return `${prefix}-${Date.now()}`;\n}\n\nfunction statusChangeOf(from: StatusId, to: StatusId): FeedChange {\n  const fromName = statusOf(from).name;\n  const toName = statusOf(to).name;\n  return {\n    kind: 'change',\n    id: localIdOf('change'),\n    authorId: CURRENT_USER_ID,\n    at: nowStamp(),\n    change: 'status',\n    text: `moved it from ${fromName} to ${toName}`,\n  };\n}\n\nexport function patchedTask(task: Task, patch: Partial<Task>): Task {\n  const next = { ...task, ...patch, updatedAt: nowStamp() };\n  const nextStatus = patch.status;\n  if (!nextStatus) {\n    return next;\n  }\n  if (nextStatus === task.status) {\n    return next;\n  }\n  const change = statusChangeOf(task.status, nextStatus);\n  return { ...next, feed: [...task.feed, change] };\n}\n\nexport function newTaskOf(\n  number: number,\n  status: StatusId,\n  title: string,\n  assigneeIds: string[]\n): Task {\n  const stamp = nowStamp();\n  const created: FeedChange = {\n    kind: 'change',\n    id: localIdOf('created'),\n    authorId: CURRENT_USER_ID,\n    at: stamp,\n    change: 'created',\n    text: 'created the task',\n  };\n  return {\n    id: `mos-${number}`,\n    number,\n    title,\n    type: 'task',\n    status,\n    priority: 'none',\n    labelIds: [],\n    assigneeIds,\n    createdAt: stamp,\n    updatedAt: stamp,\n    reporterId: CURRENT_USER_ID,\n    description: [],\n    children: [],\n    feed: [created],\n    worked: [],\n  };\n}\n\nexport function commentOf(body: string): FeedComment {\n  return {\n    kind: 'comment',\n    id: localIdOf('comment'),\n    authorId: CURRENT_USER_ID,\n    at: nowStamp(),\n    body,\n  };\n}\n\nexport function withComment(task: Task, comment: FeedComment) {\n  return { ...task, feed: [...task.feed, comment], updatedAt: comment.at };\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-edits.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/detail-model.ts",
      "content": "import {\n  addDays,\n  format,\n  isSameDay,\n  nextMonday,\n  parseISO,\n  subDays,\n} from 'date-fns';\n\nimport { TODAY, type FeedItem } from './data';\nimport { keyOf } from './task-model';\n\nexport type FeedFilter = 'all' | 'comments' | 'history';\n\nexport type DayGroup = {\n  day: string;\n  label: string;\n  items: FeedItem[];\n};\n\nexport type DatePreset = {\n  label: string;\n  date: string;\n};\n\nexport function isFeedFilter(value: unknown): value is FeedFilter {\n  const isAll = value === 'all';\n  const isComments = value === 'comments';\n  const isHistory = value === 'history';\n  return isAll || isComments || isHistory;\n}\n\nexport function taskUrlOf(number: number) {\n  return `https://example.com/mossline/tasks/${keyOf(number)}`;\n}\n\nexport function durationLabel(minutes: number) {\n  const hours = Math.floor(minutes / 60);\n  const rest = minutes % 60;\n  const paddedRest = String(rest).padStart(2, '0');\n  return `${hours}h ${paddedRest}m`;\n}\n\nexport function shortDateOf(iso: string) {\n  return format(parseISO(iso), 'MMM d');\n}\n\nexport function longDateOf(iso: string) {\n  return format(parseISO(iso), 'EEE, MMM d');\n}\n\nexport function timeOf(iso: string) {\n  return format(parseISO(iso), 'HH:mm');\n}\n\nfunction isoDayOf(date: Date) {\n  return format(date, 'yyyy-MM-dd');\n}\n\nexport function datePresetsOf(): DatePreset[] {\n  const today = parseISO(TODAY);\n  return [\n    { label: 'Today', date: TODAY },\n    { label: 'Tomorrow', date: isoDayOf(addDays(today, 1)) },\n    { label: 'Next Monday', date: isoDayOf(nextMonday(today)) },\n    { label: 'In a week', date: isoDayOf(addDays(today, 7)) },\n    { label: 'In two weeks', date: isoDayOf(addDays(today, 14)) },\n  ];\n}\n\nexport const ESTIMATE_PRESETS = [30, 60, 120, 240, 480];\n\nfunction dayLabelOf(day: string) {\n  const date = parseISO(day);\n  const today = parseISO(TODAY);\n  if (isSameDay(date, today)) {\n    return 'Today';\n  }\n  if (isSameDay(date, subDays(today, 1))) {\n    return 'Yesterday';\n  }\n  return format(date, 'EEE, MMM d');\n}\n\nfunction matchesFeedFilter(item: FeedItem, filter: FeedFilter) {\n  if (filter === 'comments') {\n    return item.kind === 'comment';\n  }\n  if (filter === 'history') {\n    return item.kind === 'change';\n  }\n  return true;\n}\n\nexport function feedCountsOf(items: FeedItem[]): Record<FeedFilter, number> {\n  const comments = items.filter((item) => item.kind === 'comment').length;\n  const history = items.length - comments;\n  return { all: items.length, comments, history };\n}\n\nexport function dayGroupsOf(items: FeedItem[], filter: FeedFilter) {\n  const shown = items.filter((item) => matchesFeedFilter(item, filter));\n  const sorted = [...shown].sort((first, second) =>\n    first.at.localeCompare(second.at)\n  );\n  const groups: DayGroup[] = [];\n  for (const item of sorted) {\n    const day = item.at.slice(0, 10);\n    const last = groups.at(-1);\n    const isSameGroup = last?.day === day;\n    if (isSameGroup) {\n      last.items.push(item);\n      continue;\n    }\n    groups.push({ day, label: dayLabelOf(day), items: [item] });\n  }\n  return groups;\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/detail-model.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-model.ts",
      "content": "import { format, isBefore, parseISO } from 'date-fns';\n\nimport {\n  CURRENT_USER_ID,\n  ISSUE_TYPES,\n  LABELS,\n  PEOPLE,\n  PRIORITIES,\n  STATUSES,\n  TEAM_KEY,\n  TODAY,\n  type IssueTypeId,\n  type PriorityId,\n  type StatusId,\n  type SubTaskCount,\n  type Task,\n} from './data';\n\nexport type Scope = 'active' | 'done' | 'all';\n\nexport type ScopeOption = {\n  id: Scope;\n  label: string;\n  singular: string;\n  plural: string;\n};\n\nexport const SCOPES: ScopeOption[] = [\n  {\n    id: 'active',\n    label: 'Active',\n    singular: 'active task',\n    plural: 'active tasks',\n  },\n  {\n    id: 'done',\n    label: 'Done',\n    singular: 'finished task',\n    plural: 'finished tasks',\n  },\n  { id: 'all', label: 'All', singular: 'task', plural: 'tasks' },\n];\n\nexport const SCOPE_GROUPS: Record<Scope, StatusId[]> = {\n  active: ['in_progress', 'in_review', 'todo', 'backlog'],\n  done: ['done'],\n  all: ['in_progress', 'in_review', 'todo', 'backlog', 'done'],\n};\n\nexport type FilterKey = 'status' | 'priority' | 'assignee' | 'label' | 'type';\n\nexport type Filters = Record<FilterKey, string[]>;\n\nexport const EMPTY_FILTERS: Filters = {\n  status: [],\n  priority: [],\n  assignee: [],\n  label: [],\n  type: [],\n};\n\nexport const NO_ASSIGNEE = 'none';\n\nexport type TaskGroupData = {\n  status: StatusId;\n  tasks: Task[];\n};\n\nfunction byId<Item extends { id: string }>(items: Item[], id: string): Item {\n  const found = items.find((item) => item.id === id);\n  if (found) {\n    return found;\n  }\n  return items[0];\n}\n\nexport function statusOf(id: StatusId) {\n  return byId(STATUSES, id);\n}\n\nexport function priorityOf(id: PriorityId) {\n  return byId(PRIORITIES, id);\n}\n\nexport function issueTypeOf(id: IssueTypeId) {\n  return byId(ISSUE_TYPES, id);\n}\n\nexport function personOf(id: string) {\n  return byId(PEOPLE, id);\n}\n\nexport function currentUser() {\n  return personOf(CURRENT_USER_ID);\n}\n\nexport function peopleOf(ids: string[]) {\n  return PEOPLE.filter((person) => ids.includes(person.id));\n}\n\nexport function labelsOf(ids: string[]) {\n  return LABELS.filter((label) => ids.includes(label.id));\n}\n\nexport function trackerOf(task: Task) {\n  if (!task.trackedById) {\n    return undefined;\n  }\n  return PEOPLE.find((person) => person.id === task.trackedById);\n}\n\nexport function isStatusId(value: unknown): value is StatusId {\n  return STATUSES.some((status) => status.id === value);\n}\n\nexport function isPriorityId(value: unknown): value is PriorityId {\n  return PRIORITIES.some((priority) => priority.id === value);\n}\n\nexport function isScope(value: unknown): value is Scope {\n  return SCOPES.some((scope) => scope.id === value);\n}\n\nexport function scopeOf(id: Scope) {\n  return byId(SCOPES, id);\n}\n\nexport function keyOf(number: number) {\n  return `${TEAM_KEY}-${number}`;\n}\n\nexport function taskKeyOf(task: Task) {\n  return keyOf(task.number);\n}\n\nexport function isAssignedTo(task: Task, personId: string) {\n  return task.assigneeIds.includes(personId);\n}\n\nexport function subTaskCountOf(task: Task): SubTaskCount | undefined {\n  const total = task.children.length;\n  if (total === 0) {\n    return undefined;\n  }\n  const done = task.children.filter((child) => child.status === 'done').length;\n  return { done, total };\n}\n\nexport function isInScope(status: StatusId, scope: Scope) {\n  if (scope === 'all') {\n    return true;\n  }\n  const isDone = status === 'done';\n  if (scope === 'done') {\n    return isDone;\n  }\n  return !isDone;\n}\n\nexport function matchesSearch(task: Task, query: string) {\n  const needle = query.trim().toLowerCase();\n  if (!needle) {\n    return true;\n  }\n  const title = task.title.toLowerCase();\n  const key = taskKeyOf(task).toLowerCase();\n  return title.includes(needle) || key.includes(needle);\n}\n\nfunction matchesAny(selected: string[], values: string[]) {\n  if (selected.length === 0) {\n    return true;\n  }\n  return values.some((value) => selected.includes(value));\n}\n\nexport function assigneeValuesOf(task: Task) {\n  if (task.assigneeIds.length === 0) {\n    return [NO_ASSIGNEE];\n  }\n  return task.assigneeIds;\n}\n\nexport function matchesFilters(task: Task, filters: Filters) {\n  const checks = [\n    matchesAny(filters.status, [task.status]),\n    matchesAny(filters.priority, [task.priority]),\n    matchesAny(filters.type, [task.type]),\n    matchesAny(filters.label, task.labelIds),\n    matchesAny(filters.assignee, assigneeValuesOf(task)),\n  ];\n  return checks.every(Boolean);\n}\n\nexport function activeFilterCountOf(filters: Filters) {\n  let count = 0;\n  for (const values of Object.values(filters)) {\n    count += values.length;\n  }\n  return count;\n}\n\nexport function isFiltering(query: string, filters: Filters) {\n  const hasQuery = query.trim().length > 0;\n  const hasFilters = activeFilterCountOf(filters) > 0;\n  return hasQuery || hasFilters;\n}\n\nexport function toggledIds<Id extends string>(\n  ids: Id[],\n  id: Id,\n  isIncluded: boolean\n): Id[] {\n  const withoutId = ids.filter((current) => current !== id);\n  if (isIncluded) {\n    return [...withoutId, id];\n  }\n  return withoutId;\n}\n\nexport function toggledFilters(\n  filters: Filters,\n  key: FilterKey,\n  value: string,\n  isIncluded: boolean\n): Filters {\n  const values = toggledIds(filters[key], value, isIncluded);\n  return { ...filters, [key]: values };\n}\n\nexport function scopeCountsOf(tasks: Task[]): Record<Scope, number> {\n  const doneCount = tasks.filter((task) => task.status === 'done').length;\n  const activeCount = tasks.length - doneCount;\n  return { active: activeCount, done: doneCount, all: tasks.length };\n}\n\nexport function groupsOf(\n  tasks: Task[],\n  scope: Scope,\n  placementOf: (task: Task) => StatusId,\n  draftStatus: StatusId | null\n): TaskGroupData[] {\n  const groups: TaskGroupData[] = [];\n  for (const status of SCOPE_GROUPS[scope]) {\n    const groupTasks = tasks.filter((task) => placementOf(task) === status);\n    const hasTasks = groupTasks.length > 0;\n    const isDrafting = draftStatus === status;\n    if (hasTasks || isDrafting) {\n      groups.push({ status, tasks: groupTasks });\n    }\n  }\n  return groups;\n}\n\nexport function nextNumberOf(tasks: Task[]) {\n  const numbers: number[] = [];\n  for (const task of tasks) {\n    numbers.push(task.number);\n    const childNumbers = task.children.map((child) => child.number);\n    numbers.push(...childNumbers);\n  }\n  return Math.max(0, ...numbers) + 1;\n}\n\nexport function dueLabelOf(due: string) {\n  return format(parseISO(due), 'MMM d');\n}\n\nexport function isOverdue(task: Task) {\n  if (!task.due) {\n    return false;\n  }\n  if (task.status === 'done') {\n    return false;\n  }\n  return isBefore(parseISO(task.due), parseISO(TODAY));\n}\n\nexport function countLabel(count: number, singular: string, plural: string) {\n  if (count === 1) {\n    return `${count} ${singular}`;\n  }\n  return `${count} ${plural}`;\n}\n\nexport function peopleSentenceOf(names: string[]) {\n  if (names.length === 0) {\n    return 'nobody';\n  }\n  if (names.length === 1) {\n    return names[0];\n  }\n  const head = names.slice(0, -1).join(', ');\n  const last = names[names.length - 1];\n  return `${head} and ${last}`;\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-model.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/task-glyphs.tsx",
      "content": "import {\n  BookmarkIcon,\n  CheckIcon,\n  CircleAlertIcon,\n  ListTreeIcon,\n  ZapIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { Badge } from '@/registry/ndeko/ui/badge';\nimport { Chip } from '@/registry/ndeko/ui/chip';\n\nimport type {\n  IssueTypeId,\n  Person,\n  PriorityId,\n  StatusId,\n  SubTaskCount,\n} from './data';\nimport { issueTypeOf, labelsOf, statusOf } from './task-model';\n\nconst PIE_RADIUS = 2;\nconst PIE_CIRCUMFERENCE = 2 * Math.PI * PIE_RADIUS;\n\nfunction pieDashOf(share: number) {\n  const filled = share * PIE_CIRCUMFERENCE;\n  return `${filled} ${PIE_CIRCUMFERENCE}`;\n}\n\nfunction StartedShape({ share }: { share: number }) {\n  return (\n    <>\n      <circle cx='7' cy='7' r='6' stroke='currentColor' strokeWidth='1.5' />\n      <circle\n        cx='7'\n        cy='7'\n        r={PIE_RADIUS}\n        stroke='currentColor'\n        strokeWidth={PIE_RADIUS * 2}\n        strokeDasharray={pieDashOf(share)}\n        transform='rotate(-90 7 7)'\n      />\n    </>\n  );\n}\n\nfunction statusShapeOf(status: StatusId) {\n  if (status === 'backlog') {\n    return (\n      <circle\n        cx='7'\n        cy='7'\n        r='6'\n        stroke='currentColor'\n        strokeWidth='1.5'\n        strokeDasharray='1.6 1.9'\n      />\n    );\n  }\n  if (status === 'todo') {\n    return (\n      <circle cx='7' cy='7' r='6' stroke='currentColor' strokeWidth='1.5' />\n    );\n  }\n  if (status === 'in_progress') {\n    return <StartedShape share={0.5} />;\n  }\n  if (status === 'in_review') {\n    return <StartedShape share={0.75} />;\n  }\n  return (\n    <>\n      <circle cx='7' cy='7' r='7' fill='currentColor' />\n      <path\n        d='M4.4 7.2 6.2 9l3.4-3.8'\n        stroke='var(--card)'\n        strokeWidth='1.6'\n        strokeLinecap='round'\n        strokeLinejoin='round'\n      />\n    </>\n  );\n}\n\nexport function StatusGlyph({\n  status,\n  className,\n}: {\n  status: StatusId;\n  className?: string;\n}) {\n  const meta = statusOf(status);\n  const glyphStyle = { color: meta.color } as React.CSSProperties;\n\n  return (\n    <svg\n      viewBox='0 0 14 14'\n      fill='none'\n      aria-hidden='true'\n      style={glyphStyle}\n      className={cn('size-3.5 shrink-0', className)}\n    >\n      {statusShapeOf(status)}\n    </svg>\n  );\n}\n\nconst PRIORITY_BARS = [\n  { x: 1.5, height: 4 },\n  { x: 5.75, height: 7 },\n  { x: 10, height: 10 },\n];\n\nconst FILLED_BAR_COUNT: Record<PriorityId, number> = {\n  urgent: 3,\n  high: 3,\n  medium: 2,\n  low: 1,\n  none: 0,\n};\n\nfunction barOpacityOf(index: number, filledCount: number) {\n  if (index < filledCount) {\n    return 0.75;\n  }\n  return 0.2;\n}\n\nfunction priorityShapeOf(priority: PriorityId) {\n  if (priority === 'urgent') {\n    return (\n      <g style={{ color: 'var(--destructive)' }}>\n        <rect\n          x='1'\n          y='1'\n          width='12'\n          height='12'\n          rx='3.5'\n          fill='currentColor'\n          fillOpacity='0.16'\n        />\n        <rect\n          x='6.25'\n          y='3.5'\n          width='1.5'\n          height='4.75'\n          rx='0.75'\n          fill='currentColor'\n        />\n        <circle cx='7' cy='10.1' r='0.95' fill='currentColor' />\n      </g>\n    );\n  }\n  if (priority === 'none') {\n    return (\n      <g fill='currentColor' fillOpacity='0.45'>\n        {PRIORITY_BARS.map((bar) => (\n          <rect\n            key={bar.x}\n            x={bar.x}\n            y='6.25'\n            width='2.5'\n            height='1.5'\n            rx='0.75'\n          />\n        ))}\n      </g>\n    );\n  }\n  const filledCount = FILLED_BAR_COUNT[priority];\n  return (\n    <g fill='currentColor'>\n      {PRIORITY_BARS.map((bar, index) => (\n        <rect\n          key={bar.x}\n          x={bar.x}\n          y={12 - bar.height}\n          width='2.5'\n          height={bar.height}\n          rx='0.75'\n          fillOpacity={barOpacityOf(index, filledCount)}\n        />\n      ))}\n    </g>\n  );\n}\n\nexport function PriorityGlyph({\n  priority,\n  className,\n}: {\n  priority: PriorityId;\n  className?: string;\n}) {\n  return (\n    <svg\n      viewBox='0 0 14 14'\n      aria-hidden='true'\n      className={cn('text-foreground size-3.5 shrink-0', className)}\n    >\n      {priorityShapeOf(priority)}\n    </svg>\n  );\n}\n\nconst TYPE_GLYPH: Record<IssueTypeId, Icon> = {\n  task: CheckIcon,\n  bug: CircleAlertIcon,\n  story: BookmarkIcon,\n  epic: ZapIcon,\n};\n\nexport function IssueTypeGem({\n  type,\n  className,\n}: {\n  type: IssueTypeId;\n  className?: string;\n}) {\n  const meta = issueTypeOf(type);\n  const Glyph = TYPE_GLYPH[type];\n  const gemStyle = { '--gem': meta.color } as React.CSSProperties;\n\n  return (\n    <span\n      role='img'\n      aria-label={meta.name}\n      style={gemStyle}\n      className={cn(\n        'gem-plate inline-flex size-4 shrink-0 items-center justify-center rounded-[5px]',\n        className\n      )}\n    >\n      <Glyph strokeWidth={2.5} className='size-2.5' />\n    </span>\n  );\n}\n\nexport function LivePill({ personName }: { personName: string }) {\n  return (\n    <span className='bg-success/10 text-success-foreground inline-flex h-5 shrink-0 items-center gap-1 rounded-full px-1.5 text-[11px] font-medium'>\n      <span aria-hidden='true' className='bg-success size-1.5 rounded-full' />\n      Live\n      <span className='sr-only'>, {personName} is tracking time on it</span>\n    </span>\n  );\n}\n\nexport function SubTaskCountTag({ count }: { count: SubTaskCount }) {\n  return (\n    <span className='text-muted-foreground inline-flex shrink-0 items-center gap-1 text-xs tabular-nums'>\n      <ListTreeIcon className='size-3' />\n      {count.done}/{count.total}\n      <span className='sr-only'>sub-tasks done</span>\n    </span>\n  );\n}\n\nexport function PersonAvatar({\n  person,\n  className,\n}: {\n  person: Person;\n  className?: string;\n}) {\n  return (\n    <Avatar className={cn('size-5 text-[9px]', className)} seed={person.name} />\n  );\n}\n\nconst MAX_STACKED_PEOPLE = 3;\n\nexport function PeopleStack({ people }: { people: Person[] }) {\n  const shown = people.slice(0, MAX_STACKED_PEOPLE);\n  const hiddenCount = people.length - shown.length;\n  const hasHidden = hiddenCount > 0;\n\n  return (\n    <span className='flex items-center -space-x-1.5'>\n      {shown.map((person) => (\n        <PersonAvatar\n          key={person.id}\n          person={person}\n          className='ring-background ring-2'\n        />\n      ))}\n      {hasHidden && (\n        <span className='bg-muted text-muted-foreground ring-background relative inline-flex size-5 items-center justify-center rounded-full text-[10px] font-medium tabular-nums ring-2'>\n          +{hiddenCount}\n        </span>\n      )}\n    </span>\n  );\n}\n\nconst MAX_SHOWN_LABELS = 2;\n\nexport function LabelChips({ labelIds }: { labelIds: string[] }) {\n  const labels = labelsOf(labelIds);\n  const shown = labels.slice(0, MAX_SHOWN_LABELS);\n  const hiddenCount = labels.length - shown.length;\n  const hasHidden = hiddenCount > 0;\n\n  return (\n    <span className='flex min-w-0 items-center gap-1'>\n      {shown.map((label) => (\n        <Chip key={label.id} color={label.color} className='min-w-0 shrink'>\n          <span className='truncate'>{label.name}</span>\n        </Chip>\n      ))}\n      {hasHidden && (\n        <Badge\n          variant='secondary'\n          className='text-muted-foreground tabular-nums'\n        >\n          +{hiddenCount}\n        </Badge>\n      )}\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/task-glyphs.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/motion-parts.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type MotionProps,\n  type Transition,\n  type Variants,\n} from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nconst EASE_OUT_STRONG: [number, number, number, number] = [0.23, 1, 0.32, 1];\n\nconst ENTER: Transition = { duration: 0.2, ease: EASE_OUT_STRONG };\n\nconst EXIT: Transition = { duration: 0.15, ease: EASE_OUT_STRONG };\n\ntype PresenceProps = Pick<\n  MotionProps,\n  'initial' | 'animate' | 'exit' | 'transition'\n>;\n\nconst HEIGHT_PRESENCE: PresenceProps = {\n  initial: { height: 0, opacity: 0 },\n  animate: { height: 'auto', opacity: 1 },\n  exit: { height: 0, opacity: 0, transition: EXIT },\n  transition: ENTER,\n};\n\nconst FADE_PRESENCE: PresenceProps = {\n  initial: { opacity: 0 },\n  animate: { opacity: 1 },\n  exit: { opacity: 0, transition: EXIT },\n  transition: ENTER,\n};\n\nexport function heightPresenceOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_PRESENCE;\n  }\n  return HEIGHT_PRESENCE;\n}\n\nexport function fadePresence() {\n  return FADE_PRESENCE;\n}\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: EASE_OUT_STRONG };\n\nconst SWAP_VARIANTS: Variants = {\n  hidden: { opacity: 0, scale: 0.6, filter: 'blur(2px)' },\n  shown: { opacity: 1, scale: 1, filter: 'blur(0px)' },\n};\n\nconst FADE_VARIANTS: Variants = {\n  hidden: { opacity: 0 },\n  shown: { opacity: 1 },\n};\n\nfunction swapVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SWAP_VARIANTS;\n}\n\ntype SwapProps = {\n  swapKey: string;\n  children: React.ReactNode;\n  className?: string;\n};\n\nexport function Swap({ swapKey, children, className }: SwapProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n\n  return (\n    <span className={cn('relative inline-flex', className)}>\n      <AnimatePresence mode='popLayout' initial={false}>\n        <motion.span\n          key={swapKey}\n          variants={variants}\n          initial='hidden'\n          animate='shown'\n          exit='hidden'\n          transition={SWAP_TRANSITION}\n          className='inline-flex'\n        >\n          {children}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/motion-parts.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/inbox-popover.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion, type Transition } from 'motion/react';\nimport { useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { BellIcon, CheckIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  Popover,\n  PopoverContent,\n  PopoverTitle,\n  PopoverTrigger,\n} from '@/registry/ndeko/ui/popover';\n\nimport type { InboxItem } from './data';\nimport { InboxList, unreadLabelOf, type InboxActions } from './inbox-list';\n\nconst DOT_TRANSITION: Transition = { duration: 0.18, ease: [0.23, 1, 0.32, 1] };\n\nfunction dotScaleOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return 1;\n  }\n  return 0.4;\n}\n\nfunction bellLabelOf(unreadCount: number) {\n  if (unreadCount === 0) {\n    return 'Inbox, nothing unread';\n  }\n  if (unreadCount === 1) {\n    return 'Inbox, 1 unread';\n  }\n  return `Inbox, ${unreadCount} unread`;\n}\n\ntype InboxPopoverProps = InboxActions & {\n  items: InboxItem[];\n  onMarkAllRead: () => void;\n};\n\nexport function InboxPopover({\n  items,\n  onMarkAllRead,\n  onOpen,\n  onToggleRead,\n  onArchive,\n}: InboxPopoverProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const [isOpen, setIsOpen] = useState(false);\n  const unreadCount = items.filter((item) => item.isUnread).length;\n  const hasUnread = unreadCount > 0;\n  const dotScale = dotScaleOf(shouldReduceMotion);\n\n  function openItem(itemId: string) {\n    setIsOpen(false);\n    onOpen(itemId);\n  }\n\n  return (\n    <Popover open={isOpen} onOpenChange={setIsOpen}>\n      <PopoverTrigger\n        render={\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label={bellLabelOf(unreadCount)}\n            className='text-muted-foreground'\n          />\n        }\n      >\n        <BellIcon />\n        <AnimatePresence initial={false}>\n          {hasUnread && (\n            <motion.span\n              key='dot'\n              aria-hidden='true'\n              initial={{ opacity: 0, scale: dotScale }}\n              animate={{ opacity: 1, scale: 1 }}\n              exit={{ opacity: 0, scale: dotScale }}\n              transition={DOT_TRANSITION}\n              className='bg-primary ring-background absolute top-1 right-1 size-2 rounded-full ring-2'\n            />\n          )}\n        </AnimatePresence>\n      </PopoverTrigger>\n      <PopoverContent\n        align='end'\n        className='w-[26rem] max-w-[calc(100vw-1rem)] p-0'\n      >\n        <div className='flex h-11 items-center justify-between gap-2 ps-4 pe-2'>\n          <div className='flex items-baseline gap-2'>\n            <PopoverTitle className='text-[13px] leading-none font-semibold'>\n              Inbox\n            </PopoverTitle>\n            <span className='text-muted-foreground text-xs tabular-nums'>\n              {unreadLabelOf(unreadCount)}\n            </span>\n          </div>\n          <Button\n            variant='ghost'\n            size='sm'\n            disabled={!hasUnread}\n            onClick={onMarkAllRead}\n            className='text-muted-foreground'\n          >\n            <CheckIcon />\n            Mark all as read\n          </Button>\n        </div>\n        <InboxList\n          items={items}\n          listClassName='max-h-[24rem] overflow-y-auto'\n          onOpen={openItem}\n          onToggleRead={onToggleRead}\n          onArchive={onArchive}\n        />\n      </PopoverContent>\n    </Popover>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/inbox-popover.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/inbox-page.tsx",
      "content": "import { CheckIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { WORKSPACE_NAME, type InboxItem } from './data';\nimport { InboxList, unreadLabelOf, type InboxActions } from './inbox-list';\n\ntype InboxPageProps = InboxActions & {\n  items: InboxItem[];\n  onMarkAllRead: () => void;\n};\n\nexport function InboxPage({\n  items,\n  onMarkAllRead,\n  onOpen,\n  onToggleRead,\n  onArchive,\n}: InboxPageProps) {\n  const unreadCount = items.filter((item) => item.isUnread).length;\n  const hasUnread = unreadCount > 0;\n\n  return (\n    <div className='min-h-0 flex-1 overflow-y-auto'>\n      <div className='mx-auto w-full max-w-2xl px-4 py-6 sm:px-6'>\n        <div className='flex items-center justify-between gap-3'>\n          <div className='min-w-0'>\n            <h1 className='truncate text-sm font-semibold'>Inbox</h1>\n            <p className='text-muted-foreground text-xs tabular-nums'>\n              {`${unreadLabelOf(unreadCount)} · ${WORKSPACE_NAME}`}\n            </p>\n          </div>\n          <Button\n            variant='ghost'\n            size='sm'\n            disabled={!hasUnread}\n            onClick={onMarkAllRead}\n            className='text-muted-foreground'\n          >\n            <CheckIcon />\n            Mark all as read\n          </Button>\n        </div>\n        <div className='bg-card hairline-ring ring-border mt-4 rounded-xl pt-1.5 shadow-[0_1px_2px_rgb(0_0_0/0.04)]'>\n          <InboxList\n            items={items}\n            onOpen={onOpen}\n            onToggleRead={onToggleRead}\n            onArchive={onArchive}\n          />\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/inbox-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/inbox-list.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion, type Transition } from 'motion/react';\n\nimport { InboxIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\n\nimport type { InboxItem } from './data';\nimport { InboxRow } from './inbox-row';\n\nconst EASE_OUT_STRONG: [number, number, number, number] = [0.23, 1, 0.32, 1];\n\nconst FADE_TRANSITION: Transition = { duration: 0.18, ease: EASE_OUT_STRONG };\n\nexport type InboxActions = {\n  onOpen: (itemId: string) => void;\n  onToggleRead: (itemId: string) => void;\n  onArchive: (itemId: string) => void;\n};\n\nfunction InboxEmpty() {\n  return (\n    <div className='flex flex-col items-center px-6 py-10 text-center'>\n      <span className='keycap-3d text-muted-foreground flex size-9 items-center justify-center rounded-lg'>\n        <InboxIcon />\n      </span>\n      <p className='mt-3 text-sm font-medium'>No notifications</p>\n      <p className='text-muted-foreground mt-1 max-w-64 text-[13px] text-balance'>\n        Mentions, assignments and comments on your tasks arrive here\n      </p>\n    </div>\n  );\n}\n\ntype InboxListProps = InboxActions & {\n  items: InboxItem[];\n  listClassName?: string;\n};\n\nexport function InboxList({\n  items,\n  listClassName,\n  onOpen,\n  onToggleRead,\n  onArchive,\n}: InboxListProps) {\n  const hasItems = items.length > 0;\n\n  return (\n    <AnimatedSize>\n      <div className='relative'>\n        <AnimatePresence mode='popLayout' initial={false}>\n          {hasItems && (\n            <motion.ul\n              key='list'\n              aria-label='Notifications'\n              initial={{ opacity: 0 }}\n              animate={{ opacity: 1 }}\n              exit={{ opacity: 0 }}\n              transition={FADE_TRANSITION}\n              className={cn('px-1.5 pb-1.5', listClassName)}\n            >\n              <AnimatePresence initial={false}>\n                {items.map((item) => (\n                  <InboxRow\n                    key={item.id}\n                    item={item}\n                    onOpen={onOpen}\n                    onToggleRead={onToggleRead}\n                    onArchive={onArchive}\n                  />\n                ))}\n              </AnimatePresence>\n            </motion.ul>\n          )}\n          {!hasItems && (\n            <motion.div\n              key='empty'\n              initial={{ opacity: 0 }}\n              animate={{ opacity: 1 }}\n              exit={{ opacity: 0 }}\n              transition={FADE_TRANSITION}\n            >\n              <InboxEmpty />\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </AnimatedSize>\n  );\n}\n\nexport function unreadLabelOf(unreadCount: number) {\n  if (unreadCount === 0) {\n    return 'All read';\n  }\n  return `${unreadCount} unread`;\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/inbox-list.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/inbox-row.tsx",
      "content": "'use client';\n\nimport { motion, type MotionProps, type Transition } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { ArchiveIcon, CheckIcon, MailIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  TOOLTIP_GLIDE_CLOSE_DELAY,\n  Tooltip,\n  TooltipContent,\n  TooltipTrigger,\n  useTooltipHandle,\n} from '@/registry/ndeko/ui/tooltip';\n\nimport { PEOPLE, TEAM_KEY, type InboxItem } from './data';\nimport { SenderAvatar } from './inbox-glyphs';\nimport { IssueTypeGem } from './task-glyphs';\n\nconst EASE_OUT_STRONG: [number, number, number, number] = [0.23, 1, 0.32, 1];\n\nconst ENTER: Transition = { duration: 0.2, ease: EASE_OUT_STRONG };\n\nconst EXIT: Transition = { duration: 0.16, ease: EASE_OUT_STRONG };\n\ntype PresenceProps = Pick<\n  MotionProps,\n  'initial' | 'animate' | 'exit' | 'transition'\n>;\n\nconst ROW_PRESENCE: PresenceProps = {\n  initial: { height: 0, opacity: 0 },\n  animate: { height: 'auto', opacity: 1 },\n  exit: { height: 0, opacity: 0, transition: EXIT },\n  transition: ENTER,\n};\n\nconst ROW_FADE: PresenceProps = {\n  initial: { opacity: 0 },\n  animate: { opacity: 1 },\n  exit: { opacity: 0, transition: EXIT },\n  transition: ENTER,\n};\n\nfunction rowPresenceOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return ROW_FADE;\n  }\n  return ROW_PRESENCE;\n}\n\nconst ACTION_BUTTON =\n  'inline-flex size-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground outline-none transition-colors duration-150 hover:bg-foreground/5 hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/25';\n\nfunction senderOf(item: InboxItem) {\n  const found = PEOPLE.find((person) => person.id === item.senderId);\n  if (found) {\n    return found;\n  }\n  return PEOPLE[0];\n}\n\nfunction readToggleLabelOf(item: InboxItem) {\n  if (item.isUnread) {\n    return 'Mark as read';\n  }\n  return 'Mark as unread';\n}\n\nfunction eventLineOf(senderName: string, item: InboxItem) {\n  const firstName = senderName.split(' ')[0];\n  if (item.excerpt) {\n    return `${firstName} ${item.event}: ${item.excerpt}`;\n  }\n  return `${firstName} ${item.event}`;\n}\n\ntype InboxRowProps = {\n  item: InboxItem;\n  onOpen: (itemId: string) => void;\n  onToggleRead: (itemId: string) => void;\n  onArchive: (itemId: string) => void;\n};\n\nexport function InboxRow({\n  item,\n  onOpen,\n  onToggleRead,\n  onArchive,\n}: InboxRowProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const sender = senderOf(item);\n  const key = `${TEAM_KEY}-${item.taskNumber}`;\n  const readLabel = readToggleLabelOf(item);\n  const actionHint = useTooltipHandle<string>();\n\n  return (\n    <motion.li\n      {...rowPresenceOf(shouldReduceMotion)}\n      className='overflow-hidden'\n    >\n      <div className='group/row hover:bg-foreground/[0.03] focus-within:bg-foreground/[0.03] relative flex items-start gap-3 rounded-lg px-2.5 py-2.5'>\n        {item.isUnread && (\n          <span\n            aria-hidden='true'\n            className='bg-primary absolute start-1 top-[1.15rem] size-1.5 rounded-full'\n          />\n        )}\n        <SenderAvatar person={sender} kind={item.kind} />\n        <button\n          type='button'\n          aria-haspopup='dialog'\n          onClick={() => onOpen(item.id)}\n          className='focus-visible:after:ring-ring/25 min-w-0 flex-1 cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg focus-visible:after:ring-[3px]'\n        >\n          <span className='flex min-w-0 items-center gap-1.5'>\n            <IssueTypeGem type={item.taskType} />\n            <span className='text-muted-foreground shrink-0 text-xs tabular-nums'>\n              {key}\n            </span>\n            <span\n              className={cn(\n                'truncate text-[13px] font-medium',\n                !item.isUnread && 'text-muted-foreground'\n              )}\n            >\n              {item.taskTitle}\n            </span>\n          </span>\n          <span className='text-muted-foreground mt-0.5 line-clamp-1 block text-xs'>\n            <span aria-hidden='true' className='hidden pointer-coarse:inline'>\n              {item.age} ·{' '}\n            </span>\n            {eventLineOf(sender.name, item)}\n          </span>\n          <span className='sr-only'>\n            , {item.age}\n            {item.isUnread && ', unread'}\n          </span>\n        </button>\n        <span className='relative z-10 flex h-5 shrink-0 items-center'>\n          <span\n            aria-hidden='true'\n            className='text-muted-foreground text-xs tabular-nums transition-opacity duration-150 group-focus-within/row:opacity-0 group-hover/row:opacity-0 pointer-coarse:hidden'\n          >\n            {item.age}\n          </span>\n          <span className='absolute end-0 flex items-center gap-0.5 opacity-0 transition-opacity duration-150 group-focus-within/row:opacity-100 group-hover/row:opacity-100 pointer-coarse:static pointer-coarse:opacity-100'>\n            <TooltipTrigger\n              handle={actionHint}\n              payload={readLabel}\n              closeDelay={TOOLTIP_GLIDE_CLOSE_DELAY}\n              aria-label={readLabel}\n              onClick={() => onToggleRead(item.id)}\n              className={ACTION_BUTTON}\n            >\n              {item.isUnread && <CheckIcon className='size-3.5' />}\n              {!item.isUnread && <MailIcon className='size-3.5' />}\n            </TooltipTrigger>\n            <TooltipTrigger\n              handle={actionHint}\n              payload='Archive'\n              closeDelay={TOOLTIP_GLIDE_CLOSE_DELAY}\n              aria-label='Archive'\n              onClick={() => onArchive(item.id)}\n              className={ACTION_BUTTON}\n            >\n              <ArchiveIcon className='size-3.5' />\n            </TooltipTrigger>\n            <Tooltip handle={actionHint}>\n              {({ payload }) => (\n                <TooltipContent glide>{payload}</TooltipContent>\n              )}\n            </Tooltip>\n          </span>\n        </span>\n      </div>\n    </motion.li>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/inbox-row.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/inbox-glyphs.tsx",
      "content": "import {\n  AtSignIcon,\n  CircleDashedIcon,\n  MessageCircleIcon,\n  UserIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\n\nimport type { NotificationKind, Person } from './data';\n\nconst KIND_GLYPH: Record<NotificationKind, Icon> = {\n  mention: AtSignIcon,\n  comment: MessageCircleIcon,\n  assigned: UserIcon,\n  status: CircleDashedIcon,\n};\n\nfunction badgeMaterialOf(kind: NotificationKind) {\n  if (kind === 'mention') {\n    return 'chip-3d [--chip:var(--primary)]';\n  }\n  return 'keycap-3d text-muted-foreground';\n}\n\nexport function SenderAvatar({\n  person,\n  kind,\n}: {\n  person: Person;\n  kind: NotificationKind;\n}) {\n  const Glyph = KIND_GLYPH[kind];\n\n  return (\n    <span className='relative inline-flex shrink-0'>\n      <Avatar className='size-7' seed={person.name} />\n      <span\n        aria-hidden='true'\n        className='bg-popover absolute -end-1.5 -bottom-1.5 inline-flex rounded-full p-0.5'\n      >\n        <span\n          className={cn(\n            'inline-flex size-4 items-center justify-center rounded-full',\n            badgeMaterialOf(kind)\n          )}\n        >\n          <Glyph strokeWidth={2.25} className='size-2.5' />\n        </span>\n      </span>\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/inbox-glyphs.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/board-page.tsx",
      "content": "'use client';\n\nimport {\n  DndContext,\n  DragOverlay,\n  KeyboardSensor,\n  MeasuringStrategy,\n  MouseSensor,\n  TouchSensor,\n  defaultDropAnimationSideEffects,\n  useSensor,\n  useSensors,\n  type Announcements,\n  type CollisionDetection,\n  type DragEndEvent,\n  type DragMoveEvent,\n  type DragOverEvent,\n  type DragStartEvent,\n  type DropAnimation,\n  type UniqueIdentifier,\n} from '@dnd-kit/core';\nimport { sortableKeyboardCoordinates } from '@dnd-kit/sortable';\nimport { useMotionValue } from 'motion/react';\nimport {\n  useCallback,\n  useEffect,\n  useId,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { BoardLane } from './board-lane';\nimport {\n  detectBoardCollision,\n  laneOf,\n  moveAcrossLanes,\n  reorderInLane,\n  targetLaneOf,\n} from './board-moves';\nimport {\n  LANES,\n  cardsOf,\n  columnsOf,\n  type BoardCard,\n  type Columns,\n  type LaneId,\n} from './board-model';\nimport { TEAM_NAME, type Task } from './data';\nimport { OverlayCard } from './drag-overlay-card';\n\nconst MEASURING = { droppable: { strategy: MeasuringStrategy.Always } };\n\nconst DROP_ANIMATION: DropAnimation = {\n  duration: 220,\n  easing: 'cubic-bezier(0.23, 1, 0.32, 1)',\n  sideEffects: defaultDropAnimationSideEffects({\n    styles: { active: { opacity: '0.4' } },\n  }),\n};\n\nconst SCREEN_READER_INSTRUCTIONS = {\n  draggable:\n    'To pick up a task, press Space or Enter. Use the arrow keys to move it between lanes and cards, Space or Enter to drop it, Escape to cancel.',\n};\n\nconst DEFAULT_COMPOSER_LANE: LaneId = 'todo';\n\nfunction dropAnimationOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return null;\n  }\n  return DROP_ANIMATION;\n}\n\nfunction laneLabelOf(laneId: LaneId | null) {\n  const lane = LANES.find((candidate) => candidate.id === laneId);\n  if (lane) {\n    return lane.label;\n  }\n  return 'the board';\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\ntype BoardPageProps = {\n  tasks: Task[];\n  onColumnsChange: (columns: Columns) => void;\n  onCreateTask: (laneId: LaneId, title: string) => string;\n};\n\nexport function BoardPage({\n  tasks: sharedTasks,\n  onColumnsChange,\n  onCreateTask,\n}: BoardPageProps) {\n  const [columns, setColumns] = useState<Columns>(() => columnsOf(sharedTasks));\n  const tasks = useMemo(() => cardsOf(sharedTasks), [sharedTasks]);\n  const [activeId, setActiveId] = useState<string | null>(null);\n  const [targetLaneId, setTargetLaneId] = useState<LaneId | null>(null);\n  const [composerLaneId, setComposerLaneId] = useState<LaneId | null>(null);\n  const [newTaskIds, setNewTaskIds] = useState<ReadonlySet<string>>(\n    () => new Set()\n  );\n  const columnsRef = useRef(columns);\n  const snapshotRef = useRef<Columns | null>(null);\n  const lastOverIdRef = useRef<UniqueIdentifier | null>(null);\n  const movedLaneRef = useRef(false);\n  const dragX = useMotionValue(0);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const dndContextId = useId();\n  const sensors = useSensors(\n    useSensor(MouseSensor, { activationConstraint: { distance: 4 } }),\n    useSensor(TouchSensor, {\n      activationConstraint: { delay: 180, tolerance: 6 },\n    }),\n    useSensor(KeyboardSensor, {\n      coordinateGetter: sortableKeyboardCoordinates,\n    })\n  );\n\n  const allTaskIds = Object.values(columns).flat();\n  const trackedCount = allTaskIds.filter(\n    (taskId) => tasks[taskId].isTracked\n  ).length;\n  const taskCountText = countLabel(allTaskIds.length, 'task', 'tasks');\n  const timerText = countLabel(trackedCount, 'timer running', 'timers running');\n  const metaText = `${taskCountText} · ${timerText}`;\n  let activeTask: BoardCard | null = null;\n  if (activeId) {\n    activeTask = tasks[activeId];\n  }\n\n  useEffect(() => {\n    columnsRef.current = columns;\n    const frame = requestAnimationFrame(() => {\n      movedLaneRef.current = false;\n    });\n    return () => cancelAnimationFrame(frame);\n  }, [columns]);\n\n  const collisionDetection = useCallback<CollisionDetection>((args) => {\n    const hits = detectBoardCollision(args, columnsRef.current);\n    if (hits.length > 0) {\n      lastOverIdRef.current = hits[0].id;\n      return hits;\n    }\n    if (movedLaneRef.current) {\n      lastOverIdRef.current = args.active.id;\n    }\n    const lastOverId = lastOverIdRef.current;\n    if (lastOverId) {\n      return [{ id: lastOverId }];\n    }\n    return [];\n  }, []);\n\n  const announcements: Announcements = {\n    onDragStart({ active }) {\n      const lane = laneOf(columnsRef.current, String(active.id));\n      return `Picked up ${tasks[String(active.id)].number} in ${laneLabelOf(lane)}`;\n    },\n    onDragOver({ active, over }) {\n      if (!over) {\n        return `${tasks[String(active.id)].number} is no longer over a lane`;\n      }\n      const lane = targetLaneOf(columnsRef.current, String(over.id));\n      return `${tasks[String(active.id)].number} is over ${laneLabelOf(lane)}`;\n    },\n    onDragEnd({ active }) {\n      const lane = laneOf(columnsRef.current, String(active.id));\n      return `${tasks[String(active.id)].number} dropped in ${laneLabelOf(lane)}`;\n    },\n    onDragCancel({ active }) {\n      return `Moving ${tasks[String(active.id)].number} was cancelled`;\n    },\n  };\n\n  function handleDragStart({ active }: DragStartEvent) {\n    const taskId = String(active.id);\n    snapshotRef.current = columns;\n    dragX.set(0);\n    setActiveId(taskId);\n    setTargetLaneId(laneOf(columns, taskId));\n    setComposerLaneId(null);\n  }\n\n  function handleDragMove({ delta }: DragMoveEvent) {\n    dragX.set(delta.x);\n  }\n\n  function handleDragOver({ active, over }: DragOverEvent) {\n    if (!over) {\n      return;\n    }\n    const overLane = targetLaneOf(columnsRef.current, String(over.id));\n    setTargetLaneId(overLane);\n    const fromLane = laneOf(columnsRef.current, String(active.id));\n    const isOtherLane = fromLane !== overLane;\n    if (!isOtherLane) {\n      return;\n    }\n    movedLaneRef.current = true;\n    setColumns((previous) => moveAcrossLanes(previous, active, over));\n  }\n\n  function handleDragEnd({ active, over }: DragEndEvent) {\n    setActiveId(null);\n    setTargetLaneId(null);\n    snapshotRef.current = null;\n    const currentColumns = columnsRef.current;\n    if (!over) {\n      onColumnsChange(currentColumns);\n      return;\n    }\n    const activeTaskId = String(active.id);\n    const overId = String(over.id);\n    const nextColumns = reorderInLane(currentColumns, activeTaskId, overId);\n    setColumns(nextColumns);\n    onColumnsChange(nextColumns);\n  }\n\n  function handleDragCancel() {\n    const snapshot = snapshotRef.current;\n    if (snapshot) {\n      setColumns(snapshot);\n    }\n    snapshotRef.current = null;\n    setActiveId(null);\n    setTargetLaneId(null);\n  }\n\n  const openComposer = useCallback((laneId: LaneId) => {\n    setComposerLaneId(laneId);\n  }, []);\n\n  const closeComposer = useCallback(() => {\n    setComposerLaneId(null);\n  }, []);\n\n  const createTask = useCallback(\n    (laneId: LaneId, title: string) => {\n      const taskId = onCreateTask(laneId, title);\n      setColumns((previous) => ({\n        ...previous,\n        [laneId]: [...previous[laneId], taskId],\n      }));\n      setNewTaskIds((previous) => new Set(previous).add(taskId));\n    },\n    [onCreateTask]\n  );\n\n  function openDefaultComposer() {\n    setComposerLaneId(DEFAULT_COMPOSER_LANE);\n  }\n\n  return (\n    <div className='flex min-h-0 w-full flex-1 flex-col'>\n      <div className='hairline-b border-border 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'>{`${TEAM_NAME} board`}</h1>\n          <span className='text-muted-foreground text-xs tabular-nums'>\n            {metaText}\n          </span>\n        </div>\n        <Button onClick={openDefaultComposer} className='ml-auto'>\n          <PlusIcon />\n          Create task\n        </Button>\n      </div>\n      <DndContext\n        id={dndContextId}\n        sensors={sensors}\n        collisionDetection={collisionDetection}\n        measuring={MEASURING}\n        accessibility={{\n          announcements,\n          screenReaderInstructions: SCREEN_READER_INSTRUCTIONS,\n        }}\n        onDragStart={handleDragStart}\n        onDragMove={handleDragMove}\n        onDragOver={handleDragOver}\n        onDragEnd={handleDragEnd}\n        onDragCancel={handleDragCancel}\n      >\n        <div className='min-h-0 flex-1 overflow-x-auto overscroll-x-contain max-md:snap-x max-md:snap-proximity max-md:scroll-px-4'>\n          <div className='flex h-full w-max items-start gap-3 px-4 py-3 md:px-6'>\n            {LANES.map((lane) => (\n              <BoardLane\n                key={lane.id}\n                lane={lane}\n                taskIds={columns[lane.id]}\n                tasks={tasks}\n                newTaskIds={newTaskIds}\n                isTarget={targetLaneId === lane.id}\n                isComposerOpen={composerLaneId === lane.id}\n                emptyLine='Drop a task here or create one'\n                onOpenComposer={openComposer}\n                onCloseComposer={closeComposer}\n                onCreateTask={createTask}\n              />\n            ))}\n          </div>\n        </div>\n        <DragOverlay dropAnimation={dropAnimationOf(shouldReduceMotion)}>\n          {activeTask && <OverlayCard task={activeTask} dragX={dragX} />}\n        </DragOverlay>\n      </DndContext>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/board-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/board-lane.tsx",
      "content": "'use client';\n\nimport { useDroppable } from '@dnd-kit/core';\nimport {\n  SortableContext,\n  useSortable,\n  verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { motion, type Transition, type Variants } from 'motion/react';\nimport { memo, useEffect, useRef, useState } from 'react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input } from '@/registry/ndeko/ui/input';\n\nimport {\n  CARD_SURFACE,\n  TRACKED_CARD,\n  TaskCardBody,\n  formatDuration,\n} from './card-parts';\nimport type { BoardCard, LaneId, LaneMeta } from './board-model';\n\nconst SORT_TRANSITION = {\n  duration: 220,\n  easing: 'cubic-bezier(0.23, 1, 0.32, 1)',\n};\n\nconst ENTER_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst CARD_PRESENCE: Variants = {\n  hidden: { height: 0, opacity: 0, overflow: 'hidden' },\n  shown: {\n    height: 'auto',\n    opacity: 1,\n    transition: ENTER_IN,\n    transitionEnd: { overflow: 'visible' },\n  },\n};\n\nconst CARD_FADE: Variants = {\n  hidden: { opacity: 0 },\n  shown: { opacity: 1, transition: ENTER_IN },\n};\n\nfunction sortTransitionOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return null;\n  }\n  return SORT_TRANSITION;\n}\n\nfunction cardVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return CARD_FADE;\n  }\n  return CARD_PRESENCE;\n}\n\nfunction initialOf(isNew: boolean) {\n  if (isNew) {\n    return 'hidden';\n  }\n  return false;\n}\n\nfunction taskCountLabel(count: number) {\n  if (count === 1) {\n    return '1 task';\n  }\n  return `${count} tasks`;\n}\n\nfunction cardLabelOf(task: BoardCard) {\n  const worked = formatDuration(task.workedMinutes);\n  return `${task.number} ${task.title}, ${worked} worked`;\n}\n\nfunction LaneCount({ value }: { value: number }) {\n  const label = taskCountLabel(value);\n\n  return (\n    <span className='bg-foreground/[0.06] text-muted-foreground inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1.5 text-xs tabular-nums'>\n      <span aria-hidden='true' className='inline-flex'>\n        <MotionNumber value={value} />\n      </span>\n      <span className='sr-only'>{` ${label}`}</span>\n    </span>\n  );\n}\n\nexport function LaneTile({ lane }: { lane: LaneMeta }) {\n  const LaneGlyph = lane.icon;\n  const tileStyle = { '--chip': lane.color } as React.CSSProperties;\n\n  return (\n    <span\n      style={tileStyle}\n      className='chip-3d flex size-5 shrink-0 items-center justify-center rounded-md'\n    >\n      <LaneGlyph className='size-3' strokeWidth={2.25} />\n    </span>\n  );\n}\n\nfunction SortableTaskCard({\n  task,\n  isNew,\n}: {\n  task: BoardCard;\n  isNew: boolean;\n}) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const cardVariants = cardVariantsOf(shouldReduceMotion);\n  const {\n    attributes,\n    listeners,\n    setNodeRef,\n    transform,\n    transition,\n    isDragging,\n  } = useSortable({\n    id: task.id,\n    transition: sortTransitionOf(shouldReduceMotion),\n  });\n  const style = {\n    transform: CSS.Translate.toString(transform),\n    transition,\n  } as React.CSSProperties;\n\n  return (\n    <motion.li\n      variants={cardVariants}\n      initial={initialOf(isNew)}\n      animate='shown'\n    >\n      <div\n        ref={setNodeRef}\n        style={style}\n        {...attributes}\n        {...listeners}\n        aria-label={cardLabelOf(task)}\n        className={cn(\n          CARD_SURFACE,\n          task.isTracked && TRACKED_CARD,\n          'focus-visible:ring-ring/25 cursor-grab touch-manipulation outline-none focus-visible:ring-[3px] active:cursor-grabbing',\n          '[contain-intrinsic-size:auto_9rem] [content-visibility:auto]',\n          isDragging && 'opacity-40'\n        )}\n      >\n        <TaskCardBody task={task} />\n      </div>\n    </motion.li>\n  );\n}\n\nfunction LaneComposer({\n  laneLabel,\n  onCreate,\n  onClose,\n}: {\n  laneLabel: string;\n  onCreate: (title: string) => void;\n  onClose: () => void;\n}) {\n  const [title, setTitle] = useState('');\n  const formRef = useRef<HTMLFormElement>(null);\n\n  useEffect(() => {\n    formRef.current?.scrollIntoView({ block: 'nearest' });\n  }, []);\n\n  function changeTitle(event: React.ChangeEvent<HTMLInputElement>) {\n    setTitle(event.target.value);\n  }\n\n  function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n    if (event.key === 'Escape') {\n      event.preventDefault();\n      onClose();\n    }\n  }\n\n  function create(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    const trimmed = title.trim();\n    if (trimmed.length === 0) {\n      return;\n    }\n    onCreate(trimmed);\n    setTitle('');\n  }\n\n  return (\n    <form\n      ref={formRef}\n      onSubmit={create}\n      className={cn(CARD_SURFACE, 'flex flex-col gap-2 p-2')}\n    >\n      <Input\n        autoFocus\n        value={title}\n        placeholder='Task title'\n        aria-label={`Title of the new task in ${laneLabel}`}\n        onChange={changeTitle}\n        onKeyDown={handleKeyDown}\n      />\n      <div className='flex items-center justify-end gap-1'>\n        <Button type='button' variant='ghost' size='sm' onClick={onClose}>\n          Cancel\n        </Button>\n        <Button type='submit' size='sm'>\n          Add task\n        </Button>\n      </div>\n    </form>\n  );\n}\n\ntype BoardLaneProps = {\n  lane: LaneMeta;\n  taskIds: string[];\n  tasks: Record<string, BoardCard>;\n  newTaskIds: ReadonlySet<string>;\n  isTarget: boolean;\n  isComposerOpen: boolean;\n  emptyLine: string;\n  menu?: React.ReactNode;\n  onOpenComposer: (laneId: LaneId) => void;\n  onCloseComposer: () => void;\n  onCreateTask: (laneId: LaneId, title: string) => void;\n};\n\n/** A tinted lane whose body scrolls on its own. It takes drops anywhere, even when empty. */\nexport const BoardLane = memo(function BoardLane({\n  lane,\n  taskIds,\n  tasks,\n  newTaskIds,\n  isTarget,\n  isComposerOpen,\n  emptyLine,\n  menu,\n  onOpenComposer,\n  onCloseComposer,\n  onCreateTask,\n}: BoardLaneProps) {\n  const { setNodeRef } = useDroppable({ id: lane.id });\n  const shownIds = taskIds.filter((taskId) => Boolean(tasks[taskId]));\n  const isEmpty = shownIds.length === 0;\n\n  function openComposer() {\n    onOpenComposer(lane.id);\n  }\n\n  function createTask(title: string) {\n    onCreateTask(lane.id, title);\n  }\n\n  return (\n    <section\n      ref={setNodeRef}\n      aria-label={lane.label}\n      className={cn(\n        'flex max-h-full w-72 shrink-0 snap-start flex-col rounded-xl transition-colors duration-150',\n        isTarget && 'bg-primary/[0.06]',\n        !isTarget && 'bg-foreground/[0.03]'\n      )}\n    >\n      <header className='flex h-11 shrink-0 items-center gap-2 pr-1.5 pl-3'>\n        <LaneTile lane={lane} />\n        <h2 className='min-w-0 truncate text-[13px] font-semibold'>\n          {lane.label}\n        </h2>\n        <LaneCount value={shownIds.length} />\n        <div className='ml-auto flex items-center'>\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label={`Add a task to ${lane.label}`}\n            onClick={openComposer}\n            className='text-muted-foreground'\n          >\n            <PlusIcon />\n          </Button>\n          {menu}\n        </div>\n      </header>\n      <div className='flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-2 pt-0.5 pb-2'>\n        <SortableContext\n          items={shownIds}\n          strategy={verticalListSortingStrategy}\n        >\n          <ul className='flex flex-col gap-2'>\n            {shownIds.map((taskId) => (\n              <SortableTaskCard\n                key={taskId}\n                task={tasks[taskId]}\n                isNew={newTaskIds.has(taskId)}\n              />\n            ))}\n          </ul>\n        </SortableContext>\n        {isEmpty && (\n          <div\n            className={cn(\n              'hairline-border text-muted-foreground flex h-20 items-center justify-center rounded-lg border-dashed px-3 text-center text-xs transition-colors duration-150',\n              isTarget && 'border-primary/40',\n              !isTarget && 'border-foreground/20'\n            )}\n          >\n            {emptyLine}\n          </div>\n        )}\n        {isComposerOpen && (\n          <LaneComposer\n            laneLabel={lane.label}\n            onCreate={createTask}\n            onClose={onCloseComposer}\n          />\n        )}\n        {!isComposerOpen && (\n          <button\n            type='button'\n            onClick={openComposer}\n            className='text-muted-foreground hover:bg-foreground/5 hover:text-foreground focus-visible:ring-ring/25 flex h-8 w-full shrink-0 cursor-pointer items-center gap-2 rounded-md px-2 text-[13px] transition-colors duration-150 outline-none focus-visible:ring-[3px]'\n          >\n            <PlusIcon className='size-4' />\n            Create task\n          </button>\n        )}\n      </div>\n    </section>\n  );\n});\n",
      "type": "registry:component",
      "target": "components/templates/application-01/board-lane.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/card-parts.tsx",
      "content": "import { memo } from 'react';\n\nimport { ClockIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Avatar } from '@/registry/ndeko/ui/avatar';\nimport { Badge } from '@/registry/ndeko/ui/badge';\nimport { Chip } from '@/registry/ndeko/ui/chip';\n\nimport type { BoardCard } from './board-model';\nimport { IssueTypeGem } from './task-glyphs';\nimport { labelsOf, peopleOf, priorityOf } from './task-model';\n\nconst VISIBLE_LABELS = 2;\n\nconst VISIBLE_ASSIGNEES = 3;\n\nexport const CARD_SURFACE =\n  'bg-card hairline-ring ring-border rounded-lg shadow-[0_1px_2px_rgb(0_0_0/0.04)]';\n\nexport const TRACKED_CARD = 'ring-primary/45';\n\nexport function formatDuration(minutes: number) {\n  const hours = Math.floor(minutes / 60);\n  const rest = minutes % 60;\n  const paddedRest = String(rest).padStart(2, '0');\n  return `${hours}h ${paddedRest}m`;\n}\n\nfunction progressOf(task: BoardCard) {\n  if (task.estimateMinutes === 0) {\n    return 0;\n  }\n  const ratio = task.workedMinutes / task.estimateMinutes;\n  return Math.min(100, Math.round(ratio * 100));\n}\n\nfunction AssigneeStack({ assigneeIds }: { assigneeIds: string[] }) {\n  const people = peopleOf(assigneeIds);\n  const shown = people.slice(0, VISIBLE_ASSIGNEES);\n  const hiddenCount = people.length - shown.length;\n  const hasHidden = hiddenCount > 0;\n  const isUnassigned = people.length === 0;\n\n  if (isUnassigned) {\n    return <span className='text-muted-foreground text-xs'>Unassigned</span>;\n  }\n\n  return (\n    <span className='flex items-center'>\n      {shown.map((person) => (\n        <Avatar\n          key={person.id}\n          className='ring-card -ml-1 size-5 ring-2 first:ml-0'\n          seed={person.name}\n        />\n      ))}\n      {hasHidden && (\n        <span className='bg-muted text-muted-foreground ring-card -ml-1 inline-flex size-5 items-center justify-center rounded-full text-[9px] font-medium ring-2'>\n          +{hiddenCount}\n        </span>\n      )}\n      <span className='sr-only'>\n        {`Assigned to ${people.map((person) => person.name).join(', ')}`}\n      </span>\n    </span>\n  );\n}\n\ntype TaskCardBodyProps = {\n  task: BoardCard;\n};\n\n/** The content of a card. Memoised, so a drag re-renders only the thin sortable wrapper around it. */\nexport const TaskCardBody = memo(function TaskCardBody({\n  task,\n}: TaskCardBodyProps) {\n  const priority = priorityOf(task.priority);\n  const hasPriority = task.priority !== 'none';\n  const labels = labelsOf(task.labelIds);\n  const shownLabels = labels.slice(0, VISIBLE_LABELS);\n  const hiddenLabelCount = labels.length - shownLabels.length;\n  const hasHiddenLabels = hiddenLabelCount > 0;\n  const hasEstimate = task.estimateMinutes > 0;\n  const progress = progressOf(task);\n  const progressStyle = { width: `${progress}%` } as React.CSSProperties;\n\n  return (\n    <div className='flex flex-col gap-2.5 p-3'>\n      <div className='flex flex-wrap items-center gap-1'>\n        {hasPriority && <Chip color={priority.color}>{priority.name}</Chip>}\n        {task.size && (\n          <Badge variant='secondary' className='text-muted-foreground'>\n            {`Size ${task.size}`}\n          </Badge>\n        )}\n        {shownLabels.map((label) => (\n          <Chip key={label.id} color={label.color}>\n            {label.name}\n          </Chip>\n        ))}\n        {hasHiddenLabels && (\n          <Badge\n            variant='secondary'\n            className='text-muted-foreground tabular-nums'\n          >\n            {`+${hiddenLabelCount}`}\n          </Badge>\n        )}\n      </div>\n      <div className='flex flex-col gap-1'>\n        <span className='text-muted-foreground flex items-center gap-1.5 text-xs tabular-nums'>\n          <IssueTypeGem type={task.type} />\n          {task.number}\n        </span>\n        <p className='line-clamp-2 text-[13px] leading-snug font-medium text-balance'>\n          {task.title}\n        </p>\n      </div>\n      {hasEstimate && (\n        <div\n          role='meter'\n          aria-label={`${formatDuration(task.workedMinutes)} of ${formatDuration(task.estimateMinutes)} estimated`}\n          aria-valuemin={0}\n          aria-valuemax={100}\n          aria-valuenow={progress}\n          className='bg-foreground/[0.06] h-1 overflow-hidden rounded-full'\n        >\n          <span\n            style={progressStyle}\n            className='bg-primary block h-full rounded-full'\n          />\n        </div>\n      )}\n      <div className='hairline-t border-border flex items-center justify-between gap-2 border-dashed pt-2.5'>\n        <AssigneeStack assigneeIds={task.assigneeIds} />\n        <span\n          className={cn(\n            'text-muted-foreground flex items-center gap-1.5 text-xs font-medium tabular-nums',\n            task.isTracked && 'text-primary-ink'\n          )}\n        >\n          {task.isTracked && (\n            <span className='bg-primary size-1.5 rounded-full'>\n              <span className='sr-only'>Timer running,</span>\n            </span>\n          )}\n          {!task.isTracked && <ClockIcon className='size-3.5' />}\n          {formatDuration(task.workedMinutes)}\n        </span>\n      </div>\n    </div>\n  );\n});\n",
      "type": "registry:component",
      "target": "components/templates/application-01/card-parts.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/drag-overlay-card.tsx",
      "content": "'use client';\n\nimport {\n  motion,\n  type MotionValue,\n  type Transition,\n  useSpring,\n  useTransform,\n  useVelocity,\n} from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\n\nimport { TaskCardBody } from './card-parts';\nimport type { BoardCard } from './board-model';\n\nconst VELOCITY_RANGE = [-1400, 0, 1400];\n\nconst TILT_RANGE = [-5, 0, 5];\n\nconst TILT_SPRING = { stiffness: 380, damping: 26, mass: 0.6 };\n\nconst LIFT: Transition = { type: 'spring', bounce: 0, duration: 0.25 };\n\nconst INSTANT: Transition = { duration: 0 };\n\nfunction liftOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return INSTANT;\n  }\n  return LIFT;\n}\n\nfunction liftScaleOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return 1;\n  }\n  return 1.02;\n}\n\ntype OverlayCardProps = {\n  task: BoardCard;\n  dragX: MotionValue<number>;\n};\n\n/** The card under the pointer: it leans with the speed of the drag and settles on a spring when the pointer slows. */\nexport function OverlayCard({ task, dragX }: OverlayCardProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const velocity = useVelocity(dragX);\n  const tiltTarget = useTransform(velocity, VELOCITY_RANGE, TILT_RANGE, {\n    clamp: true,\n  });\n  const tilt = useSpring(tiltTarget, TILT_SPRING);\n  const noTilt = useTransform(tilt, () => 0);\n  let rotate = tilt;\n  if (shouldReduceMotion) {\n    rotate = noTilt;\n  }\n\n  return (\n    <motion.div\n      style={{ rotate }}\n      initial={{ scale: 1 }}\n      animate={{ scale: liftScaleOf(shouldReduceMotion) }}\n      transition={liftOf(shouldReduceMotion)}\n      className='surface-raised cursor-grabbing rounded-lg'\n    >\n      <TaskCardBody task={task} />\n    </motion.div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/drag-overlay-card.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/board-moves.ts",
      "content": "import {\n  closestCenter,\n  closestCorners,\n  pointerWithin,\n  type Active,\n  type CollisionDetection,\n  type Over,\n} from '@dnd-kit/core';\nimport { arrayMove } from '@dnd-kit/sortable';\n\nimport type { Columns, LaneId } from './board-model';\n\nexport function isLaneId(columns: Columns, id: string): id is LaneId {\n  return Object.prototype.hasOwnProperty.call(columns, id);\n}\n\nexport function laneOf(columns: Columns, taskId: string): LaneId | null {\n  const lanes = Object.keys(columns) as LaneId[];\n  const lane = lanes.find((laneId) => columns[laneId].includes(taskId));\n  if (lane) {\n    return lane;\n  }\n  return null;\n}\n\nexport function targetLaneOf(columns: Columns, overId: string) {\n  if (isLaneId(columns, overId)) {\n    return overId;\n  }\n  return laneOf(columns, overId);\n}\n\n/** Inside the lane under the pointer, the closest card wins; an empty lane is the target itself. */\nexport function detectBoardCollision(\n  args: Parameters<CollisionDetection>[0],\n  columns: Columns\n) {\n  const hasPointer = Boolean(args.pointerCoordinates);\n  if (!hasPointer) {\n    return closestCorners(args);\n  }\n  const pointerHits = pointerWithin(args);\n  const laneHit = pointerHits.find((hit) => isLaneId(columns, String(hit.id)));\n  if (!laneHit) {\n    return pointerHits;\n  }\n  const laneTaskIds = columns[laneHit.id as LaneId];\n  const cardContainers = args.droppableContainers.filter((container) =>\n    laneTaskIds.includes(String(container.id))\n  );\n  const isEmptyLane = cardContainers.length === 0;\n  if (isEmptyLane) {\n    return [laneHit];\n  }\n  return closestCenter({ ...args, droppableContainers: cardContainers });\n}\n\nfunction isBelowOver(active: Active, over: Over) {\n  const translated = active.rect.current.translated;\n  if (!translated) {\n    return false;\n  }\n  const overMiddle = over.rect.top + over.rect.height / 2;\n  return translated.top > overMiddle;\n}\n\n/** Moves the dragged card into the lane under it, before or after the card it hovers. */\nexport function moveAcrossLanes(\n  columns: Columns,\n  active: Active,\n  over: Over\n): Columns {\n  const activeId = String(active.id);\n  const overId = String(over.id);\n  const fromLane = laneOf(columns, activeId);\n  const toLane = targetLaneOf(columns, overId);\n  if (!fromLane) {\n    return columns;\n  }\n  if (!toLane) {\n    return columns;\n  }\n  if (fromLane === toLane) {\n    return columns;\n  }\n  const fromItems = columns[fromLane].filter((id) => id !== activeId);\n  const toItems = columns[toLane];\n  let insertAt = toItems.length;\n  const isOverCard = !isLaneId(columns, overId);\n  if (isOverCard) {\n    const overIndex = toItems.indexOf(overId);\n    insertAt = overIndex;\n    if (isBelowOver(active, over)) {\n      insertAt = overIndex + 1;\n    }\n  }\n  const nextToItems = [\n    ...toItems.slice(0, insertAt),\n    activeId,\n    ...toItems.slice(insertAt),\n  ];\n  return { ...columns, [fromLane]: fromItems, [toLane]: nextToItems };\n}\n\n/** Reorders the dragged card inside its lane once it is dropped. */\nexport function reorderInLane(\n  columns: Columns,\n  activeId: string,\n  overId: string\n): Columns {\n  const lane = laneOf(columns, activeId);\n  if (!lane) {\n    return columns;\n  }\n  const items = columns[lane];\n  const oldIndex = items.indexOf(activeId);\n  const newIndex = items.indexOf(overId);\n  const isMissing = newIndex === -1;\n  const isSamePlace = oldIndex === newIndex;\n  if (isMissing || isSamePlace) {\n    return columns;\n  }\n  return { ...columns, [lane]: arrayMove(items, oldIndex, newIndex) };\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/board-moves.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/board-model.ts",
      "content": "import {\n  BOARD_ORDER,\n  STATUS_ICONS,\n  type IssueTypeId,\n  type PriorityId,\n  type Size,\n  type StatusId,\n  type Task,\n} from './data';\nimport { patchedTask } from './task-edits';\nimport { statusOf, taskKeyOf } from './task-model';\n\nexport type LaneId = StatusId;\n\nexport type Columns = Record<LaneId, string[]>;\n\nexport type LaneMeta = ReturnType<typeof laneMetaOf>;\n\nexport type BoardCard = {\n  id: string;\n  number: string;\n  title: string;\n  type: IssueTypeId;\n  priority: PriorityId;\n  size: Size | null;\n  labelIds: string[];\n  assigneeIds: string[];\n  estimateMinutes: number;\n  workedMinutes: number;\n  isTracked: boolean;\n};\n\nfunction laneMetaOf(id: LaneId) {\n  const status = statusOf(id);\n  return {\n    id,\n    label: status.name,\n    color: status.color,\n    icon: STATUS_ICONS[id],\n  };\n}\n\nexport const LANES = BOARD_ORDER.map(laneMetaOf);\n\nfunction workedMinutesOf(task: Task) {\n  let total = 0;\n  for (const entry of task.worked) {\n    total += entry.minutes;\n  }\n  return total;\n}\n\nfunction cardOf(task: Task): BoardCard {\n  return {\n    id: task.id,\n    number: taskKeyOf(task),\n    title: task.title,\n    type: task.type,\n    priority: task.priority,\n    size: task.size ?? null,\n    labelIds: task.labelIds,\n    assigneeIds: task.assigneeIds,\n    estimateMinutes: task.estimateMinutes ?? 0,\n    workedMinutes: workedMinutesOf(task),\n    isTracked: Boolean(task.trackedById),\n  };\n}\n\nexport function cardsOf(tasks: Task[]) {\n  const cards: Record<string, BoardCard> = {};\n  for (const task of tasks) {\n    cards[task.id] = cardOf(task);\n  }\n  return cards;\n}\n\nexport function columnsOf(tasks: Task[]): Columns {\n  const columns: Columns = {\n    backlog: [],\n    todo: [],\n    in_progress: [],\n    in_review: [],\n    done: [],\n  };\n  for (const task of tasks) {\n    columns[task.status].push(task.id);\n  }\n  return columns;\n}\n\nfunction movedTask(task: Task, status: StatusId) {\n  if (task.status === status) {\n    return task;\n  }\n  return patchedTask(task, { status });\n}\n\n/** The board order becomes the order of the tasks, and each lane the status of its cards. */\nexport function tasksInColumnsOf(tasks: Task[], columns: Columns) {\n  const remaining = new Map(tasks.map((task) => [task.id, task]));\n  const placed: Task[] = [];\n  for (const laneId of BOARD_ORDER) {\n    for (const taskId of columns[laneId]) {\n      const task = remaining.get(taskId);\n      if (!task) {\n        continue;\n      }\n      placed.push(movedTask(task, laneId));\n      remaining.delete(taskId);\n    }\n  }\n  const unplaced = [...remaining.values()];\n  return [...placed, ...unplaced];\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/board-model.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/team-page.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 { SearchIcon, XIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input } from '@/registry/ndeko/ui/input';\n\nimport { TEAM_NAME } from './data';\nimport { InvitationRow } from './invitation-row';\nimport { InvitePopover } from './invite-popover';\nimport { MemberCard } from './member-card';\nimport { MEMBER_GRID } from './member-parts';\nimport type { TeamState } from './use-team';\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 ITEM_PRESENCE: Variants = {\n  hidden: {\n    height: 0,\n    opacity: 0,\n    overflow: 'hidden',\n    transition: PRESENCE_OUT,\n  },\n  shown: {\n    height: 'auto',\n    opacity: 1,\n    transition: PRESENCE_IN,\n    transitionEnd: { overflow: 'visible' },\n  },\n};\n\nconst ITEM_FADE: Variants = {\n  hidden: { opacity: 0, transition: PRESENCE_OUT },\n  shown: { opacity: 1, transition: PRESENCE_IN },\n};\n\nconst COLUMN_LABELS = [\n  { id: 'member', label: 'Member', isFigure: false },\n  { id: 'task', label: 'Current task', isFigure: false },\n  { id: 'worked', label: 'Worked today', isFigure: true },\n  { id: 'estimate', label: 'Estimate', isFigure: true },\n  { id: 'total', label: 'Total today', isFigure: true },\n];\n\nfunction itemVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return ITEM_FADE;\n  }\n  return ITEM_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 matchesQuery(text: string, query: string) {\n  return text.toLowerCase().includes(query);\n}\n\nfunction ColumnLabels() {\n  return (\n    <div\n      aria-hidden='true'\n      className={cn(\n        MEMBER_GRID,\n        'text-muted-foreground hidden h-9 text-xs font-medium xl:grid'\n      )}\n    >\n      {COLUMN_LABELS.map((column, index) => {\n        const isFirst = index === 0;\n\n        return (\n          <span\n            key={column.id}\n            className={cn(\n              'border-border flex items-center px-4',\n              !isFirst && 'hairline-l',\n              column.isFigure && 'justify-center'\n            )}\n          >\n            {column.label}\n          </span>\n        );\n      })}\n      <span className='hairline-l border-border' />\n    </div>\n  );\n}\n\ntype TeamPageProps = {\n  team: TeamState;\n};\n\nexport function TeamPage({ team }: TeamPageProps) {\n  const { members, invitations, openTasks, actions } = team;\n  const [query, setQuery] = useState('');\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const itemVariants = itemVariantsOf(shouldReduceMotion);\n\n  const normalizedQuery = query.trim().toLowerCase();\n  const hasQuery = normalizedQuery.length > 0;\n  const visibleMembers = members.filter((member) =>\n    matchesQuery(member.name, normalizedQuery)\n  );\n  const visibleInvitations = invitations.filter((invitation) =>\n    matchesQuery(invitation.email, normalizedQuery)\n  );\n  const visibleCount = visibleMembers.length + visibleInvitations.length;\n  const isEmptySearch = hasQuery && visibleCount === 0;\n  const trackingCount = members.filter(\n    (member) => member.presence === 'tracking'\n  ).length;\n  const memberCountText = countLabel(members.length, 'member', 'members');\n  const trackingText = countLabel(\n    trackingCount,\n    'person tracking time',\n    'people tracking time'\n  );\n  const takenEmails = invitations.map((invitation) => invitation.email);\n\n  function changeQuery(event: React.ChangeEvent<HTMLInputElement>) {\n    setQuery(event.target.value);\n  }\n\n  function clearQuery() {\n    setQuery('');\n  }\n\n  return (\n    <div className='flex min-h-0 w-full flex-1 flex-col overflow-y-auto'>\n      <div className='hairline-b border-border flex 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'>{`${TEAM_NAME} team`}</h1>\n          <span className='text-muted-foreground text-xs tabular-nums'>\n            {`${memberCountText} · ${trackingText}`}\n          </span>\n        </div>\n        <div className='flex w-full items-center gap-2 sm:ml-auto sm:w-auto'>\n          <div className='relative min-w-0 flex-1 sm:w-56 sm:flex-none'>\n            <SearchIcon className='text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2' />\n            <Input\n              type='search'\n              value={query}\n              placeholder='Search people'\n              aria-label='Search members and invitations'\n              onChange={changeQuery}\n              className='pl-8'\n            />\n          </div>\n          <InvitePopover\n            teamName={TEAM_NAME}\n            takenEmails={takenEmails}\n            onInvite={team.invite}\n          />\n        </div>\n      </div>\n      <div className='flex flex-col gap-3 px-4 pt-3 pb-6 md:px-6'>\n        <ColumnLabels />\n        {isEmptySearch && (\n          <div className='hairline-border border-foreground/20 flex flex-col items-center gap-3 rounded-xl border-dashed px-4 py-12 text-center'>\n            <div className='flex flex-col gap-1'>\n              <p className='text-sm font-medium'>\n                {`No member or invitation matches “${query.trim()}”`}\n              </p>\n              <p className='text-muted-foreground text-[13px]'>\n                Search by first name, last name or e-mail address\n              </p>\n            </div>\n            <Button variant='outline' onClick={clearQuery}>\n              <XIcon />\n              Clear search\n            </Button>\n          </div>\n        )}\n        <ul className='flex flex-col'>\n          <AnimatePresence initial={false}>\n            {visibleMembers.map((member) => (\n              <motion.li\n                key={member.id}\n                variants={itemVariants}\n                initial='hidden'\n                animate='shown'\n                exit='hidden'\n              >\n                <div className='pb-2'>\n                  <MemberCard\n                    member={member}\n                    openTasks={openTasks}\n                    actions={actions}\n                  />\n                </div>\n              </motion.li>\n            ))}\n            {visibleInvitations.map((invitation) => (\n              <motion.li\n                key={invitation.id}\n                variants={itemVariants}\n                initial='hidden'\n                animate='shown'\n                exit='hidden'\n              >\n                <div className='pb-2'>\n                  <InvitationRow\n                    invitation={invitation}\n                    onResend={team.resendInvitation}\n                    onRevoke={team.revokeInvitation}\n                  />\n                </div>\n              </motion.li>\n            ))}\n          </AnimatePresence>\n        </ul>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/team-page.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/use-team.ts",
      "content": "'use client';\n\nimport { useState } from 'react';\n\nimport {\n  INVITATIONS,\n  MEMBERS,\n  OPEN_TASKS,\n  type Invitation,\n  type Member,\n  type MemberTask,\n  type Role,\n  type StatusId,\n} from './data';\nimport type { MemberActions } from './member-card';\n\nfunction updateMember(\n  members: Member[],\n  memberId: string,\n  change: (member: Member) => Member\n) {\n  return members.map((member) => {\n    if (member.id !== memberId) {\n      return member;\n    }\n    return change(member);\n  });\n}\n\nfunction withAddedTime(member: Member, minutes: number): Member {\n  const task = member.task;\n  if (!task) {\n    return member;\n  }\n  const hasEntry = member.activity.some((entry) => entry.taskId === task.id);\n  if (!hasEntry) {\n    const entry = {\n      taskId: task.id,\n      number: task.number,\n      title: task.title,\n      minutes,\n    };\n    return { ...member, activity: [entry, ...member.activity] };\n  }\n  const activity = member.activity.map((entry) => {\n    if (entry.taskId !== task.id) {\n      return entry;\n    }\n    return { ...entry, minutes: entry.minutes + minutes };\n  });\n  return { ...member, activity };\n}\n\n/** The team of the Team page, kept by the shell so a visit to another page leaves it as it was. */\nexport function useTeam() {\n  const [members, setMembers] = useState<Member[]>(MEMBERS);\n  const [invitations, setInvitations] = useState<Invitation[]>(INVITATIONS);\n  const [openTasks, setOpenTasks] = useState<MemberTask[]>(OPEN_TASKS);\n\n  function returnTask(task: MemberTask | null) {\n    if (!task) {\n      return;\n    }\n    setOpenTasks((previous) => [task, ...previous]);\n  }\n\n  const actions: MemberActions = {\n    assignTask(memberId, task) {\n      setOpenTasks((previous) =>\n        previous.filter((candidate) => candidate.id !== task.id)\n      );\n      setMembers((previous) =>\n        updateMember(previous, memberId, (member) => ({\n          ...member,\n          task,\n          estimateMinutes: 0,\n        }))\n      );\n    },\n    unassignTask(memberId) {\n      const member = members.find((candidate) => candidate.id === memberId);\n      returnTask(member?.task ?? null);\n      setMembers((previous) =>\n        updateMember(previous, memberId, (current) => ({\n          ...current,\n          task: null,\n          estimateMinutes: 0,\n        }))\n      );\n    },\n    changeStatus(memberId, status: StatusId) {\n      setMembers((previous) =>\n        updateMember(previous, memberId, (member) => {\n          if (!member.task) {\n            return member;\n          }\n          return { ...member, task: { ...member.task, status } };\n        })\n      );\n    },\n    changeEstimate(memberId, minutes) {\n      setMembers((previous) =>\n        updateMember(previous, memberId, (member) => ({\n          ...member,\n          estimateMinutes: minutes,\n        }))\n      );\n    },\n    addTime(memberId, minutes) {\n      setMembers((previous) =>\n        updateMember(previous, memberId, (member) =>\n          withAddedTime(member, minutes)\n        )\n      );\n    },\n    changeRole(memberId, role: Role) {\n      setMembers((previous) =>\n        updateMember(previous, memberId, (member) => ({ ...member, role }))\n      );\n    },\n    removeMember(memberId) {\n      const member = members.find((candidate) => candidate.id === memberId);\n      returnTask(member?.task ?? null);\n      setMembers((previous) =>\n        previous.filter((candidate) => candidate.id !== memberId)\n      );\n    },\n  };\n\n  function invite(email: string) {\n    const invitation: Invitation = {\n      id: `invite-${email}`,\n      email,\n      role: 'member',\n      sentLabel: 'Sent just now',\n    };\n    setInvitations((previous) => [...previous, invitation]);\n  }\n\n  function resendInvitation(invitationId: string) {\n    setInvitations((previous) =>\n      previous.map((invitation) => {\n        if (invitation.id !== invitationId) {\n          return invitation;\n        }\n        return { ...invitation, sentLabel: 'Sent again just now' };\n      })\n    );\n  }\n\n  function revokeInvitation(invitationId: string) {\n    setInvitations((previous) =>\n      previous.filter((invitation) => invitation.id !== invitationId)\n    );\n  }\n\n  return {\n    members,\n    invitations,\n    openTasks,\n    actions,\n    invite,\n    resendInvitation,\n    revokeInvitation,\n  };\n}\n\nexport type TeamState = ReturnType<typeof useTeam>;\n",
      "type": "registry:component",
      "target": "components/templates/application-01/use-team.ts"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/member-card.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useId, useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport {\n  ChartLineIcon,\n  ChevronDownIcon,\n  EllipsisIcon,\n  PlusIcon,\n  ShieldCheckIcon,\n  TrashIcon,\n  XIcon,\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 {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuLabel,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuSeparator,\n  DropdownMenuSub,\n  DropdownMenuSubContent,\n  DropdownMenuSubTrigger,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\n\nimport {\n  ROLE_LABEL,\n  type Member,\n  type MemberTask,\n  type Role,\n  type StatusId,\n} from './data';\nimport { EstimateField } from './estimate-field';\nimport {\n  FIGURE_LABEL,\n  MEMBER_CARD_HEIGHT,\n  MEMBER_GRID,\n  PresenceAvatar,\n  DurationFigure,\n  StatusChipMenu,\n  formatDuration,\n  totalTodayOf,\n  workedTodayOf,\n} from './member-parts';\nimport { IssueTypeGem } from './task-glyphs';\n\nexport type MemberActions = {\n  assignTask: (memberId: string, task: MemberTask) => void;\n  unassignTask: (memberId: string) => void;\n  changeStatus: (memberId: string, status: StatusId) => void;\n  changeEstimate: (memberId: string, minutes: number) => void;\n  addTime: (memberId: string, minutes: number) => void;\n  changeRole: (memberId: string, role: Role) => void;\n  removeMember: (memberId: string) => void;\n};\n\nconst OWN_CARD = 'ring-primary/45';\n\nconst QUICK_TIME = [15, 30, 60];\n\nconst TASK_SWAP_TRANSITION: Transition = {\n  duration: 0.18,\n  ease: [0.23, 1, 0.32, 1],\n};\n\nconst TASK_SWAP: Variants = {\n  enter: { opacity: 0, y: 6 },\n  visible: { opacity: 1, y: 0 },\n  exit: { opacity: 0, y: -6 },\n};\n\nconst PANEL_IN: Transition = { duration: 0.2, ease: [0.23, 1, 0.32, 1] };\n\nconst PANEL_OUT: Transition = { duration: 0.14, ease: [0.23, 1, 0.32, 1] };\n\nconst PANEL_PRESENCE: Variants = {\n  hidden: { height: 0, opacity: 0, transition: PANEL_OUT },\n  shown: { height: 'auto', opacity: 1, transition: PANEL_IN },\n};\n\nconst FADE: Variants = {\n  enter: { opacity: 0 },\n  visible: { opacity: 1 },\n  exit: { opacity: 0 },\n  hidden: { opacity: 0, transition: PANEL_OUT },\n  shown: { opacity: 1, transition: PANEL_IN },\n};\n\nconst ROLES: Role[] = ['manager', 'member', 'viewer'];\n\nfunction taskSwapOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE;\n  }\n  return TASK_SWAP;\n}\n\nfunction panelPresenceOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE;\n  }\n  return PANEL_PRESENCE;\n}\n\nfunction controlsOf(isOpen: boolean, panelId: string) {\n  if (isOpen) {\n    return panelId;\n  }\n  return undefined;\n}\n\nfunction isRole(value: unknown): value is Role {\n  return ROLES.some((role) => role === value);\n}\n\nfunction shareOf(minutes: number, total: number) {\n  if (total === 0) {\n    return 0;\n  }\n  return Math.round((minutes / total) * 100);\n}\n\nfunction quickTimeLabelOf(minutes: number) {\n  if (minutes < 60) {\n    return `+${minutes}m`;\n  }\n  return `+${minutes / 60}h`;\n}\n\nfunction AssignTaskMenu({\n  member,\n  openTasks,\n  onAssign,\n}: {\n  member: Member;\n  openTasks: MemberTask[];\n  onAssign: (task: MemberTask) => void;\n}) {\n  const hasOpenTasks = openTasks.length > 0;\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Assign a task to ${member.name}`}\n            className='hairline-border border-foreground/20 hover:border-foreground/35 text-muted-foreground hover:text-foreground focus-visible:ring-ring/25 data-popup-open:border-foreground/35 inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-md border-dashed px-2.5 text-[13px] transition-colors duration-150 outline-none focus-visible:ring-[3px]'\n          />\n        }\n      >\n        <PlusIcon className='size-3.5' />\n        Assign task\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-80'>\n        <DropdownMenuLabel>Open tasks</DropdownMenuLabel>\n        {!hasOpenTasks && (\n          <DropdownMenuItem disabled>\n            No open task left to assign\n          </DropdownMenuItem>\n        )}\n        {openTasks.map((task) => {\n          function assign() {\n            onAssign(task);\n          }\n\n          return (\n            <DropdownMenuItem key={task.id} onClick={assign}>\n              <IssueTypeGem type={task.type} />\n              <span className='text-muted-foreground text-xs tabular-nums'>\n                {task.number}\n              </span>\n              <span className='min-w-0 flex-1 truncate'>{task.title}</span>\n            </DropdownMenuItem>\n          );\n        })}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nfunction TaskCell({\n  member,\n  openTasks,\n  actions,\n}: {\n  member: Member;\n  openTasks: MemberTask[];\n  actions: MemberActions;\n}) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = taskSwapOf(shouldReduceMotion);\n  const task = member.task;\n  let swapKey = 'no-task';\n  if (task) {\n    swapKey = task.id;\n  }\n\n  function assign(nextTask: MemberTask) {\n    actions.assignTask(member.id, nextTask);\n  }\n\n  function changeStatus(status: StatusId) {\n    actions.changeStatus(member.id, status);\n  }\n\n  return (\n    <AnimatePresence mode='popLayout' initial={false}>\n      <motion.div\n        key={swapKey}\n        variants={variants}\n        initial='enter'\n        animate='visible'\n        exit='exit'\n        transition={TASK_SWAP_TRANSITION}\n        className='flex min-w-0 flex-col gap-1.5'\n      >\n        {task && (\n          <>\n            <div className='flex min-w-0 items-center gap-2'>\n              <IssueTypeGem type={task.type} />\n              <span className='text-muted-foreground text-xs tabular-nums'>\n                {task.number}\n              </span>\n              <StatusChipMenu\n                status={task.status}\n                taskNumber={task.number}\n                onChange={changeStatus}\n              />\n            </div>\n            <p className='line-clamp-2 text-[13px] leading-snug'>\n              {task.title}\n            </p>\n          </>\n        )}\n        {!task && (\n          <div className='flex items-center gap-3'>\n            <AssignTaskMenu\n              member={member}\n              openTasks={openTasks}\n              onAssign={assign}\n            />\n            <span className='text-muted-foreground hidden text-xs sm:inline'>\n              No task in progress\n            </span>\n          </div>\n        )}\n      </motion.div>\n    </AnimatePresence>\n  );\n}\n\nfunction MemberMenu({\n  member,\n  actions,\n}: {\n  member: Member;\n  actions: MemberActions;\n}) {\n  const task = member.task;\n  const canRemove = !member.isCurrentUser;\n\n  function unassign() {\n    actions.unassignTask(member.id);\n  }\n\n  function changeRole(value: unknown) {\n    if (isRole(value)) {\n      actions.changeRole(member.id, value);\n    }\n  }\n\n  function remove() {\n    actions.removeMember(member.id);\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <Button\n            variant='ghost'\n            size='icon-sm'\n            aria-label={`Actions for ${member.name}`}\n            className='text-muted-foreground'\n          />\n        }\n      >\n        <EllipsisIcon />\n      </DropdownMenuTrigger>\n      <DropdownMenuContent align='end' className='w-56'>\n        {task && (\n          <DropdownMenuItem onClick={unassign}>\n            <XIcon />\n            {`Unassign ${task.number}`}\n          </DropdownMenuItem>\n        )}\n        <DropdownMenuSub>\n          <DropdownMenuSubTrigger>\n            <ShieldCheckIcon />\n            Change role\n          </DropdownMenuSubTrigger>\n          <DropdownMenuSubContent>\n            <DropdownMenuRadioGroup\n              value={member.role}\n              onValueChange={changeRole}\n            >\n              {ROLES.map((role) => (\n                <DropdownMenuRadioItem key={role} value={role} closeOnClick>\n                  {ROLE_LABEL[role]}\n                </DropdownMenuRadioItem>\n              ))}\n            </DropdownMenuRadioGroup>\n          </DropdownMenuSubContent>\n        </DropdownMenuSub>\n        <DropdownMenuSeparator />\n        <DropdownMenuItem\n          variant='destructive'\n          disabled={!canRemove}\n          onClick={remove}\n        >\n          <TrashIcon />\n          Remove from team\n        </DropdownMenuItem>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n\nfunction ActivityPanel({\n  member,\n  panelId,\n  actions,\n}: {\n  member: Member;\n  panelId: string;\n  actions: MemberActions;\n}) {\n  const total = totalTodayOf(member);\n  const task = member.task;\n  const hasActivity = member.activity.length > 0;\n\n  return (\n    <div\n      id={panelId}\n      className='bg-foreground/[0.04] flex flex-col gap-3 rounded-b-xl px-4 py-3'\n    >\n      <p className='text-muted-foreground text-xs font-medium'>Today</p>\n      {!hasActivity && (\n        <p className='text-muted-foreground text-[13px]'>\n          No time tracked today\n        </p>\n      )}\n      {hasActivity && (\n        <ul className='flex flex-col gap-2.5'>\n          {member.activity.map((entry) => {\n            const share = shareOf(entry.minutes, total);\n            const barStyle = { width: `${share}%` } as React.CSSProperties;\n\n            return (\n              <li\n                key={entry.taskId}\n                className='grid grid-cols-[1fr_auto] items-center gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(0,1fr)_8rem_4.5rem_2.5rem]'\n              >\n                <span className='flex min-w-0 items-center gap-2 text-[13px]'>\n                  <span className='text-muted-foreground shrink-0 text-xs tabular-nums'>\n                    {entry.number}\n                  </span>\n                  <span className='truncate'>{entry.title}</span>\n                </span>\n                <span className='bg-foreground/[0.06] col-span-2 h-1 overflow-hidden rounded-full sm:col-span-1'>\n                  <span\n                    style={barStyle}\n                    className='bg-primary block h-full rounded-full transition-[width] duration-300 ease-(--ease-out-strong)'\n                  />\n                </span>\n                <DurationFigure\n                  minutes={entry.minutes}\n                  className='row-start-1 justify-end text-[13px] font-medium sm:row-auto'\n                />\n                <span className='text-muted-foreground hidden text-right text-xs tabular-nums sm:block'>\n                  {`${share}%`}\n                </span>\n              </li>\n            );\n          })}\n        </ul>\n      )}\n      {task && (\n        <div className='flex flex-wrap items-center gap-2'>\n          <span className='text-muted-foreground text-xs'>\n            {`Add time to ${task.number}`}\n          </span>\n          {QUICK_TIME.map((minutes) => {\n            function addTime() {\n              actions.addTime(member.id, minutes);\n            }\n\n            return (\n              <Button\n                key={minutes}\n                variant='secondary'\n                size='sm'\n                onClick={addTime}\n                className='tabular-nums'\n              >\n                {quickTimeLabelOf(minutes)}\n              </Button>\n            );\n          })}\n        </div>\n      )}\n    </div>\n  );\n}\n\ntype MemberCardProps = {\n  member: Member;\n  openTasks: MemberTask[];\n  actions: MemberActions;\n};\n\nexport function MemberCard({ member, openTasks, actions }: MemberCardProps) {\n  const [isActivityOpen, setIsActivityOpen] = useState(false);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const panelVariants = panelPresenceOf(shouldReduceMotion);\n  const panelId = useId();\n  const task = member.task;\n  const worked = workedTodayOf(member);\n  const total = totalTodayOf(member);\n  const isManager = member.role === 'manager';\n  const activityLabel = `Today’s activity of ${member.name}: ${formatDuration(total)}`;\n\n  function toggleActivity() {\n    setIsActivityOpen((isOpen) => !isOpen);\n  }\n\n  function changeEstimate(minutes: number) {\n    actions.changeEstimate(member.id, minutes);\n  }\n\n  return (\n    <div\n      className={cn(\n        MEMBER_GRID,\n        MEMBER_CARD_HEIGHT,\n        'bg-card hairline-ring ring-border relative rounded-xl shadow-[0_1px_2px_rgb(0_0_0/0.04)]',\n        member.isCurrentUser && OWN_CARD\n      )}\n    >\n      <div className='col-span-3 flex min-w-0 items-center gap-3 py-3 pr-12 pl-4 xl:col-span-1 xl:pr-4'>\n        <PresenceAvatar member={member} />\n        <div className='flex min-w-0 flex-col gap-0.5'>\n          <p className='flex min-w-0 items-center gap-2 text-[13px] font-medium'>\n            <span className='truncate'>{member.name}</span>\n            {member.isCurrentUser && (\n              <Badge variant='secondary' className='text-muted-foreground'>\n                You\n              </Badge>\n            )}\n          </p>\n          <p className='text-muted-foreground truncate text-xs'>\n            {member.title}\n            {isManager && ' · Manager'}\n          </p>\n        </div>\n      </div>\n      <div className='xl:hairline-l border-border col-span-3 flex min-w-0 items-center px-4 pb-3 xl:col-span-1 xl:py-3'>\n        <TaskCell member={member} openTasks={openTasks} actions={actions} />\n      </div>\n      <div className='xl:hairline-l border-border flex flex-col justify-center gap-1 px-4 py-3 xl:items-center'>\n        <span className={FIGURE_LABEL}>Worked today</span>\n        <DurationFigure minutes={worked} className='text-[13px] font-medium' />\n      </div>\n      <div className='xl:hairline-l border-border flex flex-col justify-center gap-1 px-4 py-3 xl:items-center'>\n        <span className={FIGURE_LABEL}>Estimate</span>\n        {task && (\n          <EstimateField\n            minutes={member.estimateMinutes}\n            taskNumber={task.number}\n            onChange={changeEstimate}\n          />\n        )}\n        {!task && (\n          <span className='text-muted-foreground text-[13px]'>\n            <span aria-hidden='true'>–</span>\n            <span className='sr-only'>No task</span>\n          </span>\n        )}\n      </div>\n      <div className='xl:hairline-l border-border flex flex-col justify-center gap-1 px-4 py-3 xl:items-center'>\n        <span className={FIGURE_LABEL}>Total today</span>\n        <button\n          type='button'\n          aria-label={activityLabel}\n          aria-expanded={isActivityOpen}\n          aria-controls={controlsOf(isActivityOpen, panelId)}\n          onClick={toggleActivity}\n          className='bg-foreground/[0.04] hairline-ring ring-foreground/10 hover:bg-foreground/[0.07] aria-expanded:bg-foreground/[0.07] focus-visible:ring-ring/25 inline-flex h-7 w-fit cursor-pointer items-center gap-1.5 rounded-full px-2.5 text-[13px] font-medium transition-[background-color,scale] duration-150 ease-(--ease-out-strong) outline-none focus-visible:ring-[3px] active:scale-[0.97]'\n        >\n          <ChartLineIcon className='text-muted-foreground size-3.5' />\n          <DurationFigure minutes={total} />\n          <ChevronDownIcon\n            className={cn(\n              'text-muted-foreground size-3.5 transition-transform duration-200 ease-(--ease-out-strong)',\n              isActivityOpen && 'rotate-180'\n            )}\n          />\n        </button>\n      </div>\n      <div className='xl:hairline-l border-border absolute top-2.5 right-2 flex items-center justify-center xl:static'>\n        <MemberMenu member={member} actions={actions} />\n      </div>\n      <AnimatePresence initial={false}>\n        {isActivityOpen && (\n          <motion.div\n            key='activity'\n            variants={panelVariants}\n            initial='hidden'\n            animate='shown'\n            exit='hidden'\n            className='col-span-full overflow-hidden'\n          >\n            <ActivityPanel\n              member={member}\n              panelId={panelId}\n              actions={actions}\n            />\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/member-card.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/member-parts.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} 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 {\n  DropdownMenu,\n  DropdownMenuContent,\n  DropdownMenuLabel,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\n\nimport {\n  BOARD_ORDER,\n  PRESENCE_META,\n  STATUS_ICONS,\n  type Member,\n  type StatusId,\n} from './data';\nimport { isStatusId, statusOf } from './task-model';\n\n/** One column template for the labels, every member card and every invitation, so the dividers line up from xl. */\nexport const MEMBER_GRID =\n  'grid grid-cols-3 xl:grid-cols-[minmax(13rem,1fr)_minmax(15rem,1.7fr)_7.5rem_7.5rem_8.5rem_3rem]';\n\nexport const MEMBER_CARD_HEIGHT = 'xl:min-h-[84px]';\n\nexport const FIGURE_LABEL = 'text-muted-foreground text-xs xl:hidden';\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\nconst TWO_DIGITS: Intl.NumberFormatOptions = { minimumIntegerDigits: 2 };\n\nexport function swapVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return SWAP_VARIANTS;\n}\n\nfunction durationPartsOf(totalMinutes: number) {\n  const rawHours = totalMinutes / 60;\n  const hours = Math.floor(rawHours);\n  const minutes = totalMinutes % 60;\n  return { hours, minutes };\n}\n\nexport function formatDuration(totalMinutes: number) {\n  const { hours, minutes } = durationPartsOf(totalMinutes);\n  const paddedMinutes = String(minutes).padStart(2, '0');\n  return `${hours}h ${paddedMinutes}m`;\n}\n\nexport function workedTodayOf(member: Member) {\n  const task = member.task;\n  if (!task) {\n    return 0;\n  }\n  const entry = member.activity.find((item) => item.taskId === task.id);\n  if (!entry) {\n    return 0;\n  }\n  return entry.minutes;\n}\n\nexport function totalTodayOf(member: Member) {\n  let total = 0;\n  for (const entry of member.activity) {\n    total += entry.minutes;\n  }\n  return total;\n}\n\n/** Hours and minutes roll as two numbers, but a screen reader hears the duration once. */\nexport function DurationFigure({\n  minutes,\n  className,\n}: {\n  minutes: number;\n  className?: string;\n}) {\n  const parts = durationPartsOf(minutes);\n  const text = formatDuration(minutes);\n\n  return (\n    <span\n      className={cn(\n        'inline-flex items-baseline whitespace-nowrap tabular-nums',\n        className\n      )}\n    >\n      <span className='sr-only'>{text}</span>\n      <span aria-hidden='true'>\n        <MotionNumber value={parts.hours} suffix='h' />{' '}\n        <MotionNumber value={parts.minutes} format={TWO_DIGITS} suffix='m' />\n      </span>\n    </span>\n  );\n}\n\nexport function PresenceAvatar({\n  member,\n  className,\n}: {\n  member: Member;\n  className?: string;\n}) {\n  const presence = PRESENCE_META[member.presence];\n  const PresenceGlyph = presence.icon;\n  const badgeStyle = { '--chip': presence.color } as React.CSSProperties;\n\n  return (\n    <span className={cn('relative inline-flex shrink-0', className)}>\n      <Avatar className='size-9' seed={member.name} />\n      <span className='bg-card absolute -right-0.5 -bottom-0.5 flex rounded-full p-px'>\n        <span\n          style={badgeStyle}\n          className='chip-3d flex size-4 items-center justify-center rounded-full'\n        >\n          <PresenceGlyph className='size-2.5' strokeWidth={2.75} />\n        </span>\n      </span>\n      <span className='sr-only'>{presence.label}</span>\n    </span>\n  );\n}\n\nfunction statusChipMetaOf(status: StatusId) {\n  const meta = statusOf(status);\n  return { label: meta.name, color: meta.color, icon: STATUS_ICONS[status] };\n}\n\ntype StatusChipMenuProps = {\n  status: StatusId;\n  taskNumber: string;\n  onChange: (status: StatusId) => void;\n};\n\n/** The status of a task as an assigned label. Picking another one applies it at once. */\nexport function StatusChipMenu({\n  status,\n  taskNumber,\n  onChange,\n}: StatusChipMenuProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n  const meta = statusChipMetaOf(status);\n  const StatusGlyph = meta.icon;\n  const chipStyle = { '--chip': meta.color } as React.CSSProperties;\n\n  function changeStatus(value: unknown) {\n    if (isStatusId(value)) {\n      onChange(value);\n    }\n  }\n\n  return (\n    <DropdownMenu>\n      <DropdownMenuTrigger\n        render={\n          <button\n            type='button'\n            aria-label={`Status of ${taskNumber}: ${meta.label}. Change status`}\n            style={chipStyle}\n            className='chip-3d focus-visible:ring-ring/25 inline-flex h-5 shrink-0 cursor-pointer items-center gap-1 overflow-hidden rounded-md px-1.5 text-xs font-medium whitespace-nowrap outline-none focus-visible:ring-[3px]'\n          />\n        }\n      >\n        <AnimatePresence mode='popLayout' initial={false}>\n          <motion.span\n            key={status}\n            variants={variants}\n            initial='enter'\n            animate='visible'\n            exit='exit'\n            transition={SWAP_TRANSITION}\n            className='flex items-center gap-1'\n          >\n            <StatusGlyph className='size-3' strokeWidth={2.25} />\n            {meta.label}\n          </motion.span>\n        </AnimatePresence>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent className='w-48'>\n        <DropdownMenuLabel>Status</DropdownMenuLabel>\n        <DropdownMenuRadioGroup value={status} onValueChange={changeStatus}>\n          {BOARD_ORDER.map((statusId) => {\n            const optionMeta = statusChipMetaOf(statusId);\n            const OptionGlyph = optionMeta.icon;\n            const glyphStyle = {\n              color: optionMeta.color,\n            } as React.CSSProperties;\n\n            return (\n              <DropdownMenuRadioItem\n                key={statusId}\n                value={statusId}\n                closeOnClick\n              >\n                <OptionGlyph style={glyphStyle} />\n                {optionMeta.label}\n              </DropdownMenuRadioItem>\n            );\n          })}\n        </DropdownMenuRadioGroup>\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/member-parts.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/estimate-field.tsx",
      "content": "'use client';\n\nimport { useId, useState } from 'react';\n\nimport { PencilIcon, PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input } from '@/registry/ndeko/ui/input';\nimport {\n  Popover,\n  PopoverClose,\n  PopoverContent,\n  PopoverTrigger,\n} from '@/registry/ndeko/ui/popover';\n\nimport { DurationFigure, formatDuration } from './member-parts';\n\nconst VALUE_FIELD = [\n  'group/estimate inline-flex h-6 cursor-pointer items-center gap-1.5 rounded-md px-2 text-[13px] font-medium tabular-nums outline-none',\n  'hairline-border border-dashed border-foreground/20 transition-[border-color,background-color] duration-150',\n  'hover:border-foreground/35 active:bg-foreground/5 data-popup-open:border-solid data-popup-open:border-foreground/30',\n  'focus-visible:ring-[3px] focus-visible:ring-ring/25',\n].join(' ');\n\nconst PRESETS = [30, 60, 120, 240, 480];\n\nconst MAX_HOURS = 99;\n\nconst MINUTES_PER_HOUR = 60;\n\ntype Draft = { hours: string; minutes: string };\n\nfunction draftOf(totalMinutes: number): Draft {\n  const hours = Math.floor(totalMinutes / MINUTES_PER_HOUR);\n  const minutes = totalMinutes % MINUTES_PER_HOUR;\n  return { hours: String(hours), minutes: String(minutes) };\n}\n\nfunction clamp(value: number, min: number, max: number) {\n  const atLeastMin = Math.max(min, value);\n  return Math.min(max, atLeastMin);\n}\n\nfunction wholeNumberOf(text: string) {\n  const parsed = Number.parseInt(text, 10);\n  if (Number.isNaN(parsed)) {\n    return 0;\n  }\n  return parsed;\n}\n\nfunction minutesOf(draft: Draft) {\n  const hours = clamp(wholeNumberOf(draft.hours), 0, MAX_HOURS);\n  const minutes = clamp(wholeNumberOf(draft.minutes), 0, MINUTES_PER_HOUR - 1);\n  return hours * MINUTES_PER_HOUR + minutes;\n}\n\nfunction presetLabelOf(minutes: number) {\n  if (minutes < MINUTES_PER_HOUR) {\n    return `${minutes}m`;\n  }\n  return `${minutes / MINUTES_PER_HOUR}h`;\n}\n\ntype EstimateFieldProps = {\n  minutes: number;\n  taskNumber: string;\n  onChange: (minutes: number) => void;\n};\n\n/** A value you can change in place: Enter saves, clicking away keeps what was typed, Escape puts the saved value back. */\nexport function EstimateField({\n  minutes,\n  taskNumber,\n  onChange,\n}: EstimateFieldProps) {\n  const [isOpen, setIsOpen] = useState(false);\n  const [draft, setDraft] = useState<Draft>(() => draftOf(minutes));\n  const hoursId = useId();\n  const minutesId = useId();\n  const hasEstimate = minutes > 0;\n  const triggerLabel = `Estimate of ${taskNumber}: ${formatDuration(minutes)}. Edit`;\n\n  function changeOpen(nextOpen: boolean, details: { reason: string }) {\n    if (nextOpen) {\n      setDraft(draftOf(minutes));\n      setIsOpen(true);\n      return;\n    }\n    const keepsDraft = details.reason === 'outside-press';\n    if (keepsDraft) {\n      onChange(minutesOf(draft));\n    }\n    setIsOpen(false);\n  }\n\n  function changeHours(event: React.ChangeEvent<HTMLInputElement>) {\n    setDraft((previous) => ({ ...previous, hours: event.target.value }));\n  }\n\n  function changeMinutes(event: React.ChangeEvent<HTMLInputElement>) {\n    setDraft((previous) => ({ ...previous, minutes: event.target.value }));\n  }\n\n  function save(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    onChange(minutesOf(draft));\n    setIsOpen(false);\n  }\n\n  function clear() {\n    onChange(0);\n    setIsOpen(false);\n  }\n\n  return (\n    <Popover open={isOpen} onOpenChange={changeOpen}>\n      <PopoverTrigger\n        render={\n          <button\n            type='button'\n            aria-label={triggerLabel}\n            className={cn(VALUE_FIELD, !hasEstimate && 'text-muted-foreground')}\n          />\n        }\n      >\n        {hasEstimate && (\n          <>\n            <DurationFigure minutes={minutes} />\n            <PencilIcon className='text-muted-foreground size-3' />\n          </>\n        )}\n        {!hasEstimate && (\n          <>\n            <PlusIcon className='size-3' />\n            Estimate\n          </>\n        )}\n      </PopoverTrigger>\n      <PopoverContent className='w-64 p-3' align='center'>\n        <form onSubmit={save} className='flex flex-col gap-3'>\n          <p className='text-muted-foreground text-xs font-medium'>\n            {`Estimate of ${taskNumber}`}\n          </p>\n          <div className='flex items-center gap-2'>\n            <label htmlFor={hoursId} className='sr-only'>\n              Hours\n            </label>\n            <Input\n              id={hoursId}\n              autoFocus\n              type='number'\n              inputMode='numeric'\n              min={0}\n              max={MAX_HOURS}\n              size='sm'\n              value={draft.hours}\n              onChange={changeHours}\n              className='w-16 tabular-nums'\n            />\n            <span className='text-muted-foreground text-xs'>h</span>\n            <label htmlFor={minutesId} className='sr-only'>\n              Minutes\n            </label>\n            <Input\n              id={minutesId}\n              type='number'\n              inputMode='numeric'\n              min={0}\n              max={MINUTES_PER_HOUR - 1}\n              step={5}\n              size='sm'\n              value={draft.minutes}\n              onChange={changeMinutes}\n              className='w-16 tabular-nums'\n            />\n            <span className='text-muted-foreground text-xs'>m</span>\n          </div>\n          <div className='flex flex-wrap gap-1'>\n            {PRESETS.map((preset) => {\n              function pickPreset() {\n                setDraft(draftOf(preset));\n              }\n\n              return (\n                <Button\n                  key={preset}\n                  type='button'\n                  variant='secondary'\n                  size='sm'\n                  onClick={pickPreset}\n                  className='tabular-nums'\n                >\n                  {presetLabelOf(preset)}\n                </Button>\n              );\n            })}\n          </div>\n          <div className='flex items-center gap-2'>\n            <Button type='button' variant='ghost' size='sm' onClick={clear}>\n              Clear\n            </Button>\n            <PopoverClose\n              render={\n                <Button\n                  type='button'\n                  variant='ghost'\n                  size='sm'\n                  className='ml-auto'\n                />\n              }\n            >\n              Cancel\n            </PopoverClose>\n            <Button type='submit' size='sm'>\n              Save\n            </Button>\n          </div>\n        </form>\n      </PopoverContent>\n    </Popover>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/estimate-field.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/invitation-row.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion, type Transition } from 'motion/react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { MailIcon } from '@/registry/ndeko/lib/icons';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { ROLE_LABEL, type Invitation } from './data';\nimport {\n  MEMBER_CARD_HEIGHT,\n  MEMBER_GRID,\n  swapVariantsOf,\n} from './member-parts';\n\nconst SWAP_TRANSITION: Transition = { duration: 0.15, ease: [0.2, 0, 0, 1] };\n\ntype InvitationRowProps = {\n  invitation: Invitation;\n  onResend: (invitationId: string) => void;\n  onRevoke: (invitationId: string) => void;\n};\n\n/** A pending invitation: not a member yet, so its outline is dashed. */\nexport function InvitationRow({\n  invitation,\n  onResend,\n  onRevoke,\n}: InvitationRowProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const variants = swapVariantsOf(shouldReduceMotion);\n\n  function resend() {\n    onResend(invitation.id);\n  }\n\n  function revoke() {\n    onRevoke(invitation.id);\n  }\n\n  return (\n    <div\n      className={cn(\n        MEMBER_GRID,\n        MEMBER_CARD_HEIGHT,\n        'hairline-border border-foreground/20 rounded-xl border-dashed'\n      )}\n    >\n      <div className='col-span-3 flex min-w-0 items-center gap-3 px-4 py-3 xl:col-span-1'>\n        <span className='keycap-3d text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full'>\n          <MailIcon className='size-4' />\n        </span>\n        <div className='flex min-w-0 flex-col gap-0.5'>\n          <p className='truncate text-[13px] font-medium'>{invitation.email}</p>\n          <p className='text-muted-foreground truncate text-xs'>\n            {`Invited as ${ROLE_LABEL[invitation.role]}`}\n          </p>\n        </div>\n      </div>\n      <div className='xl:hairline-l border-foreground/20 col-span-3 flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-dashed px-4 pb-3 xl:col-span-5 xl:py-3'>\n        <span className='text-muted-foreground relative inline-flex text-xs'>\n          <AnimatePresence mode='popLayout' initial={false}>\n            <motion.span\n              key={invitation.sentLabel}\n              variants={variants}\n              initial='enter'\n              animate='visible'\n              exit='exit'\n              transition={SWAP_TRANSITION}\n            >\n              {`Waiting for them to join · ${invitation.sentLabel}`}\n            </motion.span>\n          </AnimatePresence>\n        </span>\n        <div className='ml-auto flex items-center gap-1'>\n          <Button variant='ghost' size='sm' onClick={resend}>\n            Resend\n          </Button>\n          <Button\n            variant='ghost'\n            size='sm'\n            onClick={revoke}\n            className='text-destructive-ink hover:bg-destructive/10 hover:text-destructive-ink'\n          >\n            Revoke\n          </Button>\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/invitation-row.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/invite-popover.tsx",
      "content": "'use client';\n\nimport { useId, useState } from 'react';\n\nimport { UserRoundPlusIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { Input } from '@/registry/ndeko/ui/input';\nimport {\n  Popover,\n  PopoverContent,\n  PopoverDescription,\n  PopoverTitle,\n  PopoverTrigger,\n} from '@/registry/ndeko/ui/popover';\n\nconst EMAIL_PATTERN = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\nfunction describedByOf(hasError: boolean, errorId: string) {\n  if (hasError) {\n    return errorId;\n  }\n  return undefined;\n}\n\ntype InvitePopoverProps = {\n  teamName: string;\n  takenEmails: string[];\n  onInvite: (email: string) => void;\n};\n\nexport function InvitePopover({\n  teamName,\n  takenEmails,\n  onInvite,\n}: InvitePopoverProps) {\n  const [isOpen, setIsOpen] = useState(false);\n  const [email, setEmail] = useState('');\n  const [error, setError] = useState<string | null>(null);\n  const fieldId = useId();\n  const errorId = useId();\n  const hasError = Boolean(error);\n  const describedBy = describedByOf(hasError, errorId);\n\n  function changeOpen(nextOpen: boolean) {\n    if (nextOpen) {\n      setEmail('');\n      setError(null);\n    }\n    setIsOpen(nextOpen);\n  }\n\n  function changeEmail(event: React.ChangeEvent<HTMLInputElement>) {\n    setEmail(event.target.value);\n    setError(null);\n  }\n\n  function invite(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    const address = email.trim().toLowerCase();\n    const isEmail = EMAIL_PATTERN.test(address);\n    if (!isEmail) {\n      setError('Enter an address like name@company.com');\n      return;\n    }\n    const isTaken = takenEmails.includes(address);\n    if (isTaken) {\n      setError(`${address} is already invited`);\n      return;\n    }\n    onInvite(address);\n    setIsOpen(false);\n  }\n\n  return (\n    <Popover open={isOpen} onOpenChange={changeOpen}>\n      <PopoverTrigger render={<Button variant='outline' />}>\n        <UserRoundPlusIcon />\n        Invite\n      </PopoverTrigger>\n      <PopoverContent align='end' className='w-80'>\n        <form onSubmit={invite} className='flex flex-col gap-3'>\n          <div className='flex flex-col gap-1'>\n            <PopoverTitle>{`Invite to ${teamName}`}</PopoverTitle>\n            <PopoverDescription>\n              They join as a member once they accept the e-mail\n            </PopoverDescription>\n          </div>\n          <div className='flex flex-col gap-1.5'>\n            <label htmlFor={fieldId} className='sr-only'>\n              E-mail address\n            </label>\n            <Input\n              id={fieldId}\n              autoFocus\n              type='email'\n              placeholder='name@company.com'\n              value={email}\n              aria-invalid={hasError}\n              aria-describedby={describedBy}\n              onChange={changeEmail}\n            />\n            {hasError && (\n              <p id={errorId} className='text-destructive-ink text-xs'>\n                {error}\n              </p>\n            )}\n          </div>\n          <Button type='submit' className='self-end'>\n            Send invitation\n          </Button>\n        </form>\n      </PopoverContent>\n    </Popover>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/templates/application-01/invite-popover.tsx"
    },
    {
      "path": "registry/ndeko/templates/team-workspace/application-01/data.ts",
      "content": "import {\n  CheckIcon,\n  CircleCheckIcon,\n  CircleDashedIcon,\n  CircleIcon,\n  ClockIcon,\n  Columns3Icon,\n  EclipseIcon,\n  EyeIcon,\n  InboxIcon,\n  MinusIcon,\n  MoonIcon,\n  UsersIcon,\n  type Icon,\n} from '@/registry/ndeko/lib/icons';\n\nexport type StatusId =\n  'in_progress' | 'in_review' | 'todo' | 'backlog' | 'done';\n\nexport type PriorityId = 'urgent' | 'high' | 'medium' | 'low' | 'none';\n\nexport type IssueTypeId = 'task' | 'bug' | 'story' | 'epic';\n\nexport type Size = 'S' | 'M' | 'L' | 'XL';\n\nexport type Person = {\n  id: string;\n  name: string;\n  role: string;\n};\n\nexport type Label = {\n  id: string;\n  name: string;\n  color: string;\n};\n\nexport type Status = {\n  id: StatusId;\n  name: string;\n  color: string;\n};\n\nexport type Priority = {\n  id: PriorityId;\n  name: string;\n  color: string;\n};\n\nexport type IssueType = {\n  id: IssueTypeId;\n  name: string;\n  color: string;\n};\n\nexport type SubTaskCount = {\n  done: number;\n  total: number;\n};\n\nexport type ChildIssue = {\n  id: string;\n  number: number;\n  title: string;\n  status: StatusId;\n  assigneeId?: string;\n};\n\nexport type ChangeKind =\n  'created' | 'status' | 'assignee' | 'estimate' | 'label' | 'priority';\n\nexport type FeedComment = {\n  kind: 'comment';\n  id: string;\n  authorId: string;\n  at: string;\n  body: string;\n};\n\nexport type FeedChange = {\n  kind: 'change';\n  id: string;\n  authorId: string;\n  at: string;\n  change: ChangeKind;\n  text: string;\n};\n\nexport type FeedItem = FeedComment | FeedChange;\n\nexport type WorkedTime = {\n  personId: string;\n  minutes: number;\n};\n\nexport type ParentTask = {\n  number: number;\n  title: string;\n};\n\nexport type Task = {\n  id: string;\n  number: number;\n  title: string;\n  type: IssueTypeId;\n  status: StatusId;\n  priority: PriorityId;\n  labelIds: string[];\n  assigneeIds: string[];\n  due?: string;\n  estimateMinutes?: number;\n  size?: Size;\n  trackedById?: string;\n  createdAt: string;\n  updatedAt: string;\n  reporterId: string;\n  parent?: ParentTask;\n  description: string[];\n  children: ChildIssue[];\n  feed: FeedItem[];\n  worked: WorkedTime[];\n};\n\nexport type PageId = 'inbox' | 'my-tasks' | 'board' | 'team';\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 NotificationKind = 'mention' | 'comment' | 'assigned' | 'status';\n\nexport type InboxItem = {\n  id: string;\n  kind: NotificationKind;\n  senderId: string;\n  taskNumber: number;\n  taskTitle: string;\n  taskType: IssueTypeId;\n  event: string;\n  excerpt?: string;\n  age: string;\n  isUnread: boolean;\n};\n\nexport type Presence = 'tracking' | 'online' | 'away' | 'offline';\n\nexport type Role = 'manager' | 'member' | 'viewer';\n\nexport type MemberTask = {\n  id: string;\n  number: string;\n  title: string;\n  type: IssueTypeId;\n  status: StatusId;\n};\n\nexport type ActivityEntry = {\n  taskId: string;\n  number: string;\n  title: string;\n  minutes: number;\n};\n\nexport type Member = {\n  id: string;\n  name: string;\n  title: string;\n  role: Role;\n  presence: Presence;\n  isCurrentUser: boolean;\n  task: MemberTask | null;\n  estimateMinutes: number;\n  activity: ActivityEntry[];\n};\n\nexport type Invitation = {\n  id: string;\n  email: string;\n  role: Role;\n  sentLabel: string;\n};\n\ntype GlyphMeta = { label: string; color: string; icon: Icon };\n\nexport const WORKSPACE_NAME = 'Mossline';\n\nexport const TEAM_KEY = 'MOS';\n\nexport const TEAM_NAME = 'Mossline Web';\n\nexport const TODAY = '2026-11-05';\n\nexport const CURRENT_USER_ID = 'amara';\n\nexport const WORKSPACES: Workspace[] = [\n  {\n    id: 'mossline',\n    name: WORKSPACE_NAME,\n    memberCount: 5,\n  },\n];\n\nexport const WEB_TEAM: Entity = {\n  id: 'web',\n  name: TEAM_NAME,\n  color: 'var(--info)',\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: 'team',\n    team: WEB_TEAM,\n    items: [\n      { id: 'board', label: 'Board', icon: Columns3Icon },\n      { id: 'team', label: 'Team', icon: UsersIcon },\n    ],\n  },\n];\n\nexport const PEOPLE: Person[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n    role: 'Product designer',\n  },\n  {\n    id: 'leo',\n    name: 'Léo Martin',\n    role: 'Frontend engineer',\n  },\n  {\n    id: 'sana',\n    name: 'Sana Iqbal',\n    role: 'Backend engineer',\n  },\n  {\n    id: 'tomas',\n    name: 'Tomás Rivera',\n    role: 'Mobile engineer',\n  },\n  {\n    id: 'mei',\n    name: 'Mei Lin',\n    role: 'Product manager',\n  },\n];\n\nexport const STATUSES: Status[] = [\n  { id: 'in_progress', name: 'In progress', color: 'var(--warning)' },\n  { id: 'in_review', name: 'In review', color: 'var(--primary)' },\n  { id: 'todo', name: 'Todo', color: 'var(--muted-foreground)' },\n  { id: 'backlog', name: 'Backlog', color: 'var(--muted-foreground)' },\n  { id: 'done', name: 'Done', color: 'var(--success)' },\n];\n\nexport const STATUS_ICONS: Record<StatusId, Icon> = {\n  backlog: CircleDashedIcon,\n  todo: CircleIcon,\n  in_progress: EclipseIcon,\n  in_review: EyeIcon,\n  done: CircleCheckIcon,\n};\n\nexport const BOARD_ORDER: StatusId[] = [\n  'backlog',\n  'todo',\n  'in_progress',\n  'in_review',\n  'done',\n];\n\nexport const PRIORITIES: Priority[] = [\n  { id: 'urgent', name: 'Urgent', color: 'var(--destructive)' },\n  { id: 'high', name: 'High', color: 'var(--warning)' },\n  { id: 'medium', name: 'Medium', color: 'var(--info)' },\n  { id: 'low', name: 'Low', color: 'var(--muted-foreground)' },\n  { id: 'none', name: 'No priority', color: 'var(--muted-foreground)' },\n];\n\nexport const ISSUE_TYPES: IssueType[] = [\n  { id: 'task', name: 'Task', color: 'var(--info)' },\n  { id: 'bug', name: 'Bug', color: 'var(--destructive)' },\n  { id: 'story', name: 'Story', color: 'var(--success)' },\n  { id: 'epic', name: 'Epic', color: 'var(--primary)' },\n];\n\nexport const LABELS: Label[] = [\n  { id: 'frontend', name: 'Frontend', color: 'var(--info)' },\n  { id: 'design', name: 'Design', color: 'hsl(280 62% 58%)' },\n  { id: 'api', name: 'API', color: 'var(--success)' },\n  { id: 'mobile', name: 'Mobile', color: 'hsl(190 75% 40%)' },\n  { id: 'performance', name: 'Performance', color: 'var(--warning)' },\n  { id: 'accessibility', name: 'Accessibility', color: 'hsl(330 70% 55%)' },\n];\n\nfunction createdBy(\n  taskNumber: number,\n  authorId: string,\n  at: string\n): FeedChange {\n  return {\n    kind: 'change',\n    id: `f-${taskNumber}-0`,\n    authorId,\n    at,\n    change: 'created',\n    text: 'created the task',\n  };\n}\n\nexport const TASKS: Task[] = [\n  {\n    id: 'mos-148',\n    number: 148,\n    title: 'Booking calendar skips the first week on Safari',\n    type: 'bug',\n    status: 'in_progress',\n    priority: 'urgent',\n    labelIds: ['frontend'],\n    assigneeIds: ['leo'],\n    due: '2026-11-06',\n    estimateMinutes: 480,\n    size: 'M',\n    trackedById: 'leo',\n    createdAt: '2026-11-02T09:14:00',\n    updatedAt: '2026-11-05T10:58:00',\n    reporterId: 'mei',\n    parent: { number: 131, title: 'Booking flow redesign' },\n    description: [\n      'On Safari, the booking calendar opens on the second week of the month when the month starts on a Sunday. The first row of days is never drawn, so nobody can book the 1st or the 2nd.',\n      'Open a studio page, pick November and look at the first row: it is there in the other browsers and missing in Safari.',\n      'The month should start on its first day in every browser, with the week starting on the day set for the workspace.',\n    ],\n    children: [\n      {\n        id: 'mos-149',\n        number: 149,\n        title: 'Reproduce on the last two Safari versions',\n        status: 'done',\n        assigneeId: 'leo',\n      },\n      {\n        id: 'mos-150',\n        number: 150,\n        title: 'Fix the week offset when a month starts on Sunday',\n        status: 'in_progress',\n        assigneeId: 'leo',\n      },\n      {\n        id: 'mos-151',\n        number: 151,\n        title: 'Add a test month that starts on a Sunday',\n        status: 'todo',\n        assigneeId: 'sana',\n      },\n      {\n        id: 'mos-153',\n        number: 153,\n        title: 'Check the calendar in the mobile web view',\n        status: 'todo',\n        assigneeId: 'tomas',\n      },\n    ],\n    feed: [\n      createdBy(148, 'mei', '2026-11-02T09:14:00'),\n      {\n        kind: 'change',\n        id: 'f-148-2',\n        authorId: 'mei',\n        at: '2026-11-02T09:15:00',\n        change: 'assignee',\n        text: 'assigned Léo Martin',\n      },\n      {\n        kind: 'comment',\n        id: 'f-148-3',\n        authorId: 'leo',\n        at: '2026-11-03T11:02:00',\n        body: 'Reproduced on both versions. It only happens when the 1st is a Sunday and the week starts on Monday.',\n      },\n      {\n        kind: 'change',\n        id: 'f-148-4',\n        authorId: 'leo',\n        at: '2026-11-04T08:40:00',\n        change: 'status',\n        text: 'moved it from Todo to In progress',\n      },\n      {\n        kind: 'comment',\n        id: 'f-148-5',\n        authorId: 'sana',\n        at: '2026-11-04T16:20:00',\n        body: 'The week number for the 1st comes back one higher on Safari. I can pair on it tomorrow morning.',\n      },\n      {\n        kind: 'change',\n        id: 'f-148-6',\n        authorId: 'leo',\n        at: '2026-11-05T09:05:00',\n        change: 'estimate',\n        text: 'set the estimate to 8h 00m',\n      },\n      {\n        kind: 'comment',\n        id: 'f-148-7',\n        authorId: 'mei',\n        at: '2026-11-05T10:31:00',\n        body: 'Studios open November bookings on Monday, so this is the one to land first.',\n      },\n      {\n        kind: 'comment',\n        id: 'f-148-8',\n        authorId: 'sana',\n        at: '2026-11-05T10:58:00',\n        body: 'Can you check the empty week on the mobile view?',\n      },\n    ],\n    worked: [\n      { personId: 'leo', minutes: 145 },\n      { personId: 'sana', minutes: 55 },\n    ],\n  },\n  {\n    id: 'mos-152',\n    number: 152,\n    title: 'Offline drafts for field notes',\n    type: 'story',\n    status: 'in_progress',\n    priority: 'high',\n    labelIds: ['frontend', 'mobile'],\n    assigneeIds: ['tomas', 'amara'],\n    due: '2026-11-12',\n    estimateMinutes: 720,\n    size: 'L',\n    trackedById: 'tomas',\n    createdAt: '2026-10-29T14:02:00',\n    updatedAt: '2026-11-05T10:24:00',\n    reporterId: 'mei',\n    description: [\n      'A note written without a connection stays on the device as a draft and syncs on its own once the device is back online.',\n      'Drafts show a quiet mark in the list until they are synced, and a conflict keeps both versions side by side.',\n    ],\n    children: [\n      {\n        id: 'mos-156',\n        number: 156,\n        title: 'Store drafts on the device',\n        status: 'done',\n        assigneeId: 'tomas',\n      },\n      {\n        id: 'mos-157',\n        number: 157,\n        title: 'Draft mark in the notes list',\n        status: 'done',\n        assigneeId: 'amara',\n      },\n      {\n        id: 'mos-158',\n        number: 158,\n        title: 'Sync drafts when the device is back online',\n        status: 'in_progress',\n        assigneeId: 'tomas',\n      },\n      {\n        id: 'mos-159',\n        number: 159,\n        title: 'Conflict view with both versions',\n        status: 'todo',\n        assigneeId: 'amara',\n      },\n      {\n        id: 'mos-162',\n        number: 162,\n        title: 'Copy for the offline banner',\n        status: 'backlog',\n      },\n    ],\n    feed: [\n      createdBy(152, 'mei', '2026-10-29T14:02:00'),\n      {\n        kind: 'comment',\n        id: 'f-152-2',\n        authorId: 'amara',\n        at: '2026-11-03T10:12:00',\n        body: 'The draft mark is in review. I kept it to a small dot so the list does not get louder.',\n      },\n      {\n        kind: 'change',\n        id: 'f-152-3',\n        authorId: 'tomas',\n        at: '2026-11-04T17:45:00',\n        change: 'label',\n        text: 'added the label Mobile',\n      },\n      {\n        kind: 'comment',\n        id: 'f-152-4',\n        authorId: 'leo',\n        at: '2026-11-05T10:24:00',\n        body: 'Drafts now sync as soon as the tab is back online',\n      },\n    ],\n    worked: [\n      { personId: 'tomas', minutes: 380 },\n      { personId: 'amara', minutes: 150 },\n    ],\n  },\n  {\n    id: 'mos-139',\n    number: 139,\n    title: 'Rate limit the public share links',\n    type: 'task',\n    status: 'in_review',\n    priority: 'high',\n    labelIds: ['api'],\n    assigneeIds: ['sana'],\n    due: '2026-11-04',\n    estimateMinutes: 240,\n    size: 'S',\n    createdAt: '2026-10-27T11:30:00',\n    updatedAt: '2026-11-03T15:10:00',\n    reporterId: 'sana',\n    description: [\n      'Shared notes can be opened by anyone with the link. Limit each link to a fair number of opens per minute so a leaked link cannot be scraped.',\n    ],\n    children: [],\n    feed: [\n      createdBy(139, 'sana', '2026-10-27T11:30:00'),\n      {\n        kind: 'change',\n        id: 'f-139-2',\n        authorId: 'sana',\n        at: '2026-11-03T15:10:00',\n        change: 'status',\n        text: 'moved it from In progress to In review',\n      },\n    ],\n    worked: [{ personId: 'sana', minutes: 265 }],\n  },\n  {\n    id: 'mos-155',\n    number: 155,\n    title: 'Empty states for the plant library',\n    type: 'task',\n    status: 'in_review',\n    priority: 'medium',\n    labelIds: ['design'],\n    assigneeIds: ['amara'],\n    due: '2026-11-09',\n    estimateMinutes: 180,\n    size: 'S',\n    trackedById: 'amara',\n    createdAt: '2026-11-01T10:05:00',\n    updatedAt: '2026-11-04T16:40:00',\n    reporterId: 'mei',\n    description: [\n      'A library without plants, a search without results and a tag without notes each get one sentence on what is missing and the action that fills it.',\n    ],\n    children: [],\n    feed: [\n      createdBy(155, 'mei', '2026-11-01T10:05:00'),\n      {\n        kind: 'change',\n        id: 'f-155-2',\n        authorId: 'amara',\n        at: '2026-11-04T16:40:00',\n        change: 'status',\n        text: 'moved it from In progress to In review',\n      },\n    ],\n    worked: [{ personId: 'amara', minutes: 140 }],\n  },\n  {\n    id: 'mos-160',\n    number: 160,\n    title: 'Sync photo captions across devices',\n    type: 'story',\n    status: 'todo',\n    priority: 'medium',\n    labelIds: ['api', 'mobile'],\n    assigneeIds: ['sana', 'tomas'],\n    due: '2026-11-18',\n    estimateMinutes: 360,\n    size: 'M',\n    createdAt: '2026-10-30T09:40:00',\n    updatedAt: '2026-11-04T18:12:00',\n    reporterId: 'tomas',\n    description: [\n      'A caption edited on the phone shows on the web within a few seconds, and two edits made offline keep the order they were written in.',\n    ],\n    children: [\n      {\n        id: 'mos-165',\n        number: 165,\n        title: 'Store captions with their edit time',\n        status: 'todo',\n        assigneeId: 'sana',\n      },\n      {\n        id: 'mos-167',\n        number: 167,\n        title: 'Merge offline edits by edit time',\n        status: 'todo',\n        assigneeId: 'tomas',\n      },\n      {\n        id: 'mos-168',\n        number: 168,\n        title: 'Show the caption sync state on the photo',\n        status: 'todo',\n      },\n    ],\n    feed: [\n      createdBy(160, 'tomas', '2026-10-30T09:40:00'),\n      {\n        kind: 'comment',\n        id: 'f-160-2',\n        authorId: 'tomas',\n        at: '2026-11-04T18:12:00',\n        body: 'Captions written offline keep their order now',\n      },\n    ],\n    worked: [],\n  },\n  {\n    id: 'mos-161',\n    number: 161,\n    title: 'Keyboard shortcuts sheet',\n    type: 'task',\n    status: 'todo',\n    priority: 'low',\n    labelIds: ['frontend', 'accessibility'],\n    assigneeIds: ['leo', 'amara'],\n    estimateMinutes: 120,\n    size: 'S',\n    createdAt: '2026-11-02T15:20:00',\n    updatedAt: '2026-11-02T15:20:00',\n    reporterId: 'leo',\n    description: [\n      'One sheet that lists every shortcut of the notes editor, opened with the question mark key.',\n    ],\n    children: [],\n    feed: [createdBy(161, 'leo', '2026-11-02T15:20:00')],\n    worked: [],\n  },\n  {\n    id: 'mos-163',\n    number: 163,\n    title: 'Map tiles flicker when zooming out',\n    type: 'bug',\n    status: 'todo',\n    priority: 'high',\n    labelIds: ['frontend', 'performance'],\n    assigneeIds: [],\n    due: '2026-11-10',\n    size: 'M',\n    createdAt: '2026-11-04T13:22:00',\n    updatedAt: '2026-11-04T13:22:00',\n    reporterId: 'tomas',\n    description: [\n      'Zooming out on the garden map shows grey squares for a moment before the tiles come back.',\n    ],\n    children: [],\n    feed: [createdBy(163, 'tomas', '2026-11-04T13:22:00')],\n    worked: [],\n  },\n  {\n    id: 'mos-164',\n    number: 164,\n    title: 'Copy for the weekly digest email',\n    type: 'task',\n    status: 'todo',\n    priority: 'low',\n    labelIds: ['design'],\n    assigneeIds: ['amara'],\n    due: '2026-11-20',\n    estimateMinutes: 60,\n    size: 'S',\n    createdAt: '2026-11-03T14:30:00',\n    updatedAt: '2026-11-05T08:55:00',\n    reporterId: 'mei',\n    description: [\n      'The weekly digest lists the notes a person missed. It needs a subject line, one sentence of intro and the label of the button that opens the app.',\n    ],\n    children: [],\n    feed: [\n      createdBy(164, 'mei', '2026-11-03T14:30:00'),\n      {\n        kind: 'change',\n        id: 'f-164-2',\n        authorId: 'mei',\n        at: '2026-11-05T08:55:00',\n        change: 'assignee',\n        text: 'assigned Amara Okafor',\n      },\n    ],\n    worked: [],\n  },\n  {\n    id: 'mos-166',\n    number: 166,\n    title: 'Search across notes and tags',\n    type: 'epic',\n    status: 'todo',\n    priority: 'medium',\n    labelIds: ['api', 'frontend', 'performance'],\n    assigneeIds: ['sana', 'leo', 'mei'],\n    due: '2026-12-01',\n    size: 'XL',\n    createdAt: '2026-10-26T10:00:00',\n    updatedAt: '2026-11-04T11:15:00',\n    reporterId: 'mei',\n    description: [\n      'One search field that finds notes by their text, their tags and the plants they mention, with results that arrive while typing.',\n    ],\n    children: [\n      {\n        id: 'mos-175',\n        number: 175,\n        title: 'Index note text and tags',\n        status: 'done',\n        assigneeId: 'sana',\n      },\n      {\n        id: 'mos-176',\n        number: 176,\n        title: 'Search endpoint with paging',\n        status: 'in_progress',\n        assigneeId: 'sana',\n      },\n      {\n        id: 'mos-177',\n        number: 177,\n        title: 'Search field with results while typing',\n        status: 'todo',\n        assigneeId: 'leo',\n      },\n      {\n        id: 'mos-178',\n        number: 178,\n        title: 'Highlight the matched words',\n        status: 'todo',\n        assigneeId: 'leo',\n      },\n      {\n        id: 'mos-179',\n        number: 179,\n        title: 'Empty state for a search without results',\n        status: 'backlog',\n      },\n      {\n        id: 'mos-180',\n        number: 180,\n        title: 'Search plants mentioned in notes',\n        status: 'backlog',\n        assigneeId: 'mei',\n      },\n    ],\n    feed: [\n      createdBy(166, 'mei', '2026-10-26T10:00:00'),\n      {\n        kind: 'change',\n        id: 'f-166-2',\n        authorId: 'mei',\n        at: '2026-11-04T11:15:00',\n        change: 'priority',\n        text: 'set the priority to Medium',\n      },\n    ],\n    worked: [\n      { personId: 'sana', minutes: 90 },\n      { personId: 'leo', minutes: 60 },\n    ],\n  },\n  {\n    id: 'mos-170',\n    number: 170,\n    title: 'Dark mode for the print view',\n    type: 'task',\n    status: 'backlog',\n    priority: 'none',\n    labelIds: ['design'],\n    assigneeIds: ['amara'],\n    size: 'M',\n    createdAt: '2026-10-28T12:00:00',\n    updatedAt: '2026-10-28T12:00:00',\n    reporterId: 'amara',\n    description: [\n      'Printing a note from dark mode keeps a white page and black text, whatever the theme on screen.',\n    ],\n    children: [],\n    feed: [createdBy(170, 'amara', '2026-10-28T12:00:00')],\n    worked: [],\n  },\n  {\n    id: 'mos-171',\n    number: 171,\n    title: 'Import notes from a CSV file',\n    type: 'story',\n    status: 'backlog',\n    priority: 'low',\n    labelIds: ['api'],\n    assigneeIds: [],\n    size: 'M',\n    createdAt: '2026-10-29T16:45:00',\n    updatedAt: '2026-10-29T16:45:00',\n    reporterId: 'sana',\n    description: [\n      'A gardener moving from a spreadsheet picks a CSV file, matches its columns to note fields and sees the notes before they are created.',\n    ],\n    children: [],\n    feed: [createdBy(171, 'sana', '2026-10-29T16:45:00')],\n    worked: [],\n  },\n  {\n    id: 'mos-172',\n    number: 172,\n    title: 'Shorter cold start on the mobile app',\n    type: 'task',\n    status: 'backlog',\n    priority: 'medium',\n    labelIds: ['mobile', 'performance'],\n    assigneeIds: ['tomas'],\n    estimateMinutes: 480,\n    size: 'L',\n    createdAt: '2026-10-30T08:20:00',\n    updatedAt: '2026-10-30T08:20:00',\n    reporterId: 'tomas',\n    description: [\n      'Load the notes list before the map and the photo cache, so the first screen appears before anything else is ready.',\n    ],\n    children: [],\n    feed: [createdBy(172, 'tomas', '2026-10-30T08:20:00')],\n    worked: [],\n  },\n  {\n    id: 'mos-174',\n    number: 174,\n    title: 'Screen reader names for the map controls',\n    type: 'bug',\n    status: 'backlog',\n    priority: 'high',\n    labelIds: ['accessibility'],\n    assigneeIds: ['amara'],\n    estimateMinutes: 90,\n    size: 'S',\n    createdAt: '2026-11-03T09:10:00',\n    updatedAt: '2026-11-03T09:10:00',\n    reporterId: 'leo',\n    description: [\n      'The zoom and layer buttons of the garden map are read as “button” with no name.',\n    ],\n    children: [],\n    feed: [createdBy(174, 'leo', '2026-11-03T09:10:00')],\n    worked: [],\n  },\n  {\n    id: 'mos-120',\n    number: 120,\n    title: 'Onboarding checklist',\n    type: 'story',\n    status: 'done',\n    priority: 'medium',\n    labelIds: ['design', 'frontend'],\n    assigneeIds: ['amara', 'leo'],\n    due: '2026-10-30',\n    estimateMinutes: 600,\n    size: 'L',\n    createdAt: '2026-10-12T10:00:00',\n    updatedAt: '2026-10-30T17:20:00',\n    reporterId: 'mei',\n    description: [\n      'Four steps for a new gardener: add a first plant, write a first note, take a photo and invite someone.',\n    ],\n    children: [\n      {\n        id: 'mos-121',\n        number: 121,\n        title: 'Checklist card on the home screen',\n        status: 'done',\n        assigneeId: 'amara',\n      },\n      {\n        id: 'mos-122',\n        number: 122,\n        title: 'Mark a step done when it happens',\n        status: 'done',\n        assigneeId: 'leo',\n      },\n      {\n        id: 'mos-123',\n        number: 123,\n        title: 'Hide the checklist once it is complete',\n        status: 'done',\n        assigneeId: 'leo',\n      },\n      {\n        id: 'mos-125',\n        number: 125,\n        title: 'Copy for each step',\n        status: 'done',\n        assigneeId: 'amara',\n      },\n    ],\n    feed: [\n      createdBy(120, 'mei', '2026-10-12T10:00:00'),\n      {\n        kind: 'change',\n        id: 'f-120-2',\n        authorId: 'leo',\n        at: '2026-10-30T17:20:00',\n        change: 'status',\n        text: 'moved it from In review to Done',\n      },\n    ],\n    worked: [\n      { personId: 'amara', minutes: 420 },\n      { personId: 'leo', minutes: 300 },\n    ],\n  },\n  {\n    id: 'mos-124',\n    number: 124,\n    title: 'Crash when a photo has no capture date',\n    type: 'bug',\n    status: 'done',\n    priority: 'urgent',\n    labelIds: ['mobile'],\n    assigneeIds: ['tomas'],\n    due: '2026-10-28',\n    estimateMinutes: 120,\n    size: 'S',\n    createdAt: '2026-10-26T08:30:00',\n    updatedAt: '2026-10-28T15:00:00',\n    reporterId: 'mei',\n    description: [\n      'Photos saved by some messaging apps have no capture date, and the timeline crashed while sorting them.',\n    ],\n    children: [],\n    feed: [\n      createdBy(124, 'mei', '2026-10-26T08:30:00'),\n      {\n        kind: 'change',\n        id: 'f-124-2',\n        authorId: 'tomas',\n        at: '2026-10-28T15:00:00',\n        change: 'status',\n        text: 'moved it from In review to Done',\n      },\n    ],\n    worked: [{ personId: 'tomas', minutes: 185 }],\n  },\n  {\n    id: 'mos-127',\n    number: 127,\n    title: 'Paginate the notes list',\n    type: 'task',\n    status: 'done',\n    priority: 'medium',\n    labelIds: ['api', 'performance'],\n    assigneeIds: ['sana'],\n    due: '2026-11-02',\n    estimateMinutes: 240,\n    size: 'M',\n    createdAt: '2026-10-20T11:00:00',\n    updatedAt: '2026-11-02T16:30:00',\n    reporterId: 'sana',\n    description: [\n      'The notes list loads fifty notes at a time and the next fifty as the list scrolls.',\n    ],\n    children: [],\n    feed: [\n      createdBy(127, 'sana', '2026-10-20T11:00:00'),\n      {\n        kind: 'change',\n        id: 'f-127-2',\n        authorId: 'leo',\n        at: '2026-11-02T16:30:00',\n        change: 'status',\n        text: 'moved it from In review to Done',\n      },\n    ],\n    worked: [{ personId: 'sana', minutes: 240 }],\n  },\n  {\n    id: 'mos-133',\n    number: 133,\n    title: 'Tag colours in the sidebar',\n    type: 'task',\n    status: 'done',\n    priority: 'low',\n    labelIds: ['design'],\n    assigneeIds: ['amara'],\n    estimateMinutes: 60,\n    size: 'S',\n    createdAt: '2026-10-22T09:00:00',\n    updatedAt: '2026-10-27T12:10:00',\n    reporterId: 'amara',\n    description: [\n      'Each tag in the sidebar shows the colour picked for it, so a tag reads the same in the list and on the note.',\n    ],\n    children: [],\n    feed: [createdBy(133, 'amara', '2026-10-22T09:00:00')],\n    worked: [{ personId: 'amara', minutes: 75 }],\n  },\n  {\n    id: 'mos-141',\n    number: 141,\n    title: 'Share sheet on Android',\n    type: 'task',\n    status: 'done',\n    priority: 'medium',\n    labelIds: ['mobile'],\n    assigneeIds: ['tomas'],\n    due: '2026-11-03',\n    estimateMinutes: 180,\n    size: 'S',\n    createdAt: '2026-10-27T13:00:00',\n    updatedAt: '2026-11-03T10:45:00',\n    reporterId: 'tomas',\n    description: [\n      'Sharing a note on Android opens the system share sheet with the note text and its first photo.',\n    ],\n    children: [],\n    feed: [createdBy(141, 'tomas', '2026-10-27T13:00:00')],\n    worked: [{ personId: 'tomas', minutes: 150 }],\n  },\n];\n\nexport const INBOX: InboxItem[] = [\n  {\n    id: 'n-1',\n    kind: 'mention',\n    senderId: 'sana',\n    taskNumber: 148,\n    taskTitle: 'Booking calendar skips the first week on Safari',\n    taskType: 'bug',\n    event: 'mentioned you',\n    excerpt: 'Can you check the empty week on the mobile view?',\n    age: '4m',\n    isUnread: true,\n  },\n  {\n    id: 'n-2',\n    kind: 'comment',\n    senderId: 'leo',\n    taskNumber: 152,\n    taskTitle: 'Offline drafts for field notes',\n    taskType: 'story',\n    event: 'commented',\n    excerpt: 'Drafts now sync as soon as the tab is back online',\n    age: '38m',\n    isUnread: true,\n  },\n  {\n    id: 'n-3',\n    kind: 'assigned',\n    senderId: 'mei',\n    taskNumber: 164,\n    taskTitle: 'Copy for the weekly digest email',\n    taskType: 'task',\n    event: 'assigned it to you',\n    age: '2h',\n    isUnread: true,\n  },\n  {\n    id: 'n-4',\n    kind: 'comment',\n    senderId: 'tomas',\n    taskNumber: 160,\n    taskTitle: 'Sync photo captions across devices',\n    taskType: 'story',\n    event: 'commented',\n    excerpt: 'Captions written offline keep their order now',\n    age: 'Yesterday',\n    isUnread: false,\n  },\n  {\n    id: 'n-5',\n    kind: 'status',\n    senderId: 'sana',\n    taskNumber: 139,\n    taskTitle: 'Rate limit the public share links',\n    taskType: 'task',\n    event: 'moved it to In review',\n    age: 'Tue',\n    isUnread: false,\n  },\n  {\n    id: 'n-6',\n    kind: 'status',\n    senderId: 'leo',\n    taskNumber: 127,\n    taskTitle: 'Paginate the notes list',\n    taskType: 'task',\n    event: 'moved it to Done',\n    age: 'Mon',\n    isUnread: false,\n  },\n];\n\nexport const PRESENCE_META: Record<Presence, GlyphMeta> = {\n  tracking: {\n    label: 'Tracking time',\n    color: 'var(--primary)',\n    icon: ClockIcon,\n  },\n  online: { label: 'Online', color: 'var(--success)', icon: CheckIcon },\n  away: { label: 'Away', color: 'var(--warning)', icon: MoonIcon },\n  offline: {\n    label: 'Offline',\n    color: 'var(--muted-foreground)',\n    icon: MinusIcon,\n  },\n};\n\nexport const ROLE_LABEL: Record<Role, string> = {\n  manager: 'Manager',\n  member: 'Member',\n  viewer: 'Viewer',\n};\n\nexport const MEMBERS: Member[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n    title: 'Product designer',\n    role: 'manager',\n    presence: 'tracking',\n    isCurrentUser: true,\n    task: {\n      id: 'mos-155',\n      number: 'MOS-155',\n      title: 'Empty states for the plant library',\n      type: 'task',\n      status: 'in_review',\n    },\n    estimateMinutes: 180,\n    activity: [\n      {\n        taskId: 'mos-155',\n        number: 'MOS-155',\n        title: 'Empty states for the plant library',\n        minutes: 40,\n      },\n      {\n        taskId: 'mos-152',\n        number: 'MOS-152',\n        title: 'Offline drafts for field notes',\n        minutes: 35,\n      },\n    ],\n  },\n  {\n    id: 'leo',\n    name: 'Léo Martin',\n    title: 'Frontend engineer',\n    role: 'member',\n    presence: 'tracking',\n    isCurrentUser: false,\n    task: {\n      id: 'mos-148',\n      number: 'MOS-148',\n      title: 'Booking calendar skips the first week on Safari',\n      type: 'bug',\n      status: 'in_progress',\n    },\n    estimateMinutes: 480,\n    activity: [\n      {\n        taskId: 'mos-148',\n        number: 'MOS-148',\n        title: 'Booking calendar skips the first week on Safari',\n        minutes: 95,\n      },\n      {\n        taskId: 'mos-166',\n        number: 'MOS-166',\n        title: 'Search across notes and tags',\n        minutes: 20,\n      },\n    ],\n  },\n  {\n    id: 'sana',\n    name: 'Sana Iqbal',\n    title: 'Backend engineer',\n    role: 'member',\n    presence: 'online',\n    isCurrentUser: false,\n    task: {\n      id: 'mos-139',\n      number: 'MOS-139',\n      title: 'Rate limit the public share links',\n      type: 'task',\n      status: 'in_review',\n    },\n    estimateMinutes: 240,\n    activity: [\n      {\n        taskId: 'mos-139',\n        number: 'MOS-139',\n        title: 'Rate limit the public share links',\n        minutes: 25,\n      },\n      {\n        taskId: 'mos-166',\n        number: 'MOS-166',\n        title: 'Search across notes and tags',\n        minutes: 50,\n      },\n    ],\n  },\n  {\n    id: 'tomas',\n    name: 'Tomás Rivera',\n    title: 'Mobile engineer',\n    role: 'member',\n    presence: 'tracking',\n    isCurrentUser: false,\n    task: {\n      id: 'mos-152',\n      number: 'MOS-152',\n      title: 'Offline drafts for field notes',\n      type: 'story',\n      status: 'in_progress',\n    },\n    estimateMinutes: 720,\n    activity: [\n      {\n        taskId: 'mos-152',\n        number: 'MOS-152',\n        title: 'Offline drafts for field notes',\n        minutes: 110,\n      },\n    ],\n  },\n  {\n    id: 'mei',\n    name: 'Mei Lin',\n    title: 'Product manager',\n    role: 'manager',\n    presence: 'away',\n    isCurrentUser: false,\n    task: {\n      id: 'mos-166',\n      number: 'MOS-166',\n      title: 'Search across notes and tags',\n      type: 'epic',\n      status: 'todo',\n    },\n    estimateMinutes: 0,\n    activity: [\n      {\n        taskId: 'mos-166',\n        number: 'MOS-166',\n        title: 'Search across notes and tags',\n        minutes: 30,\n      },\n    ],\n  },\n];\n\nexport const OPEN_TASKS: MemberTask[] = [\n  {\n    id: 'mos-161',\n    number: 'MOS-161',\n    title: 'Keyboard shortcuts sheet',\n    type: 'task',\n    status: 'todo',\n  },\n  {\n    id: 'mos-163',\n    number: 'MOS-163',\n    title: 'Map tiles flicker when zooming out',\n    type: 'bug',\n    status: 'todo',\n  },\n  {\n    id: 'mos-174',\n    number: 'MOS-174',\n    title: 'Screen reader names for the map controls',\n    type: 'bug',\n    status: 'backlog',\n  },\n];\n\nexport const INVITATIONS: Invitation[] = [\n  {\n    id: 'invite-noor',\n    email: 'noor.haddad@mossline.example',\n    role: 'member',\n    sentLabel: 'Sent 2 days ago',\n  },\n  {\n    id: 'invite-kofi',\n    email: 'kofi.mensah@mossline.example',\n    role: 'viewer',\n    sentLabel: 'Sent this morning',\n  },\n];\n",
      "type": "registry:component",
      "target": "components/templates/application-01/data.ts"
    }
  ],
  "categories": [
    "templates",
    "team-workspace"
  ],
  "type": "registry:block"
}