{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "task-lists-02",
  "title": "Task list with bulk edits",
  "description": "The grouped task list with row selection, shift-click ranges and a floating bar that changes the status, priority or assignees of every selected task.",
  "dependencies": [
    "date-fns",
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/avatar.json",
    "https://ui.ndekocode.dev/r/badge.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/checkbox.json",
    "https://ui.ndekocode.dev/r/chip.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/motion-number.json",
    "https://ui.ndekocode.dev/r/tabs.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/index.tsx",
      "content": "'use client';\n\nimport { AnimatePresence, motion } from 'motion/react';\nimport { useEffect, useState } from 'react';\n\nimport { PlusIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { ColumnLabels, type SelectionState } from './column-labels';\nimport { TASKS, type PriorityId, type StatusId, type 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 { SelectionBar } from './selection-bar';\nimport { TaskGroup } from './task-group';\nimport {\n  countLabel,\n  EMPTY_FILTERS,\n  groupsOf,\n  isFiltering,\n  isInScope,\n  matchesFilters,\n  matchesSearch,\n  nextTaskNumberOf,\n  rangeBetween,\n  scopeCountsOf,\n  toggledFilters,\n  toggledIds,\n  withRange,\n  type FilterKey,\n  type Filters,\n  type Scope,\n  type TaskGroupData,\n} from './task-model';\nimport { useDelayedPlacement } from './use-delayed-placement';\n\nconst NEW_TASK_STATUS: StatusId = 'todo';\n\nconst IGNORED_ESCAPE_TARGETS =\n  'input, textarea, select, [contenteditable=\"true\"], [role=\"menu\"]';\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 isIgnoredEscape(event: KeyboardEvent) {\n  if (event.defaultPrevented) {\n    return true;\n  }\n  if (!(event.target instanceof HTMLElement)) {\n    return false;\n  }\n  return Boolean(event.target.closest(IGNORED_ESCAPE_TARGETS));\n}\n\nfunction shownIdsOf(groups: TaskGroupData[], collapsed: StatusId[]) {\n  const openGroups = groups.filter(\n    (group) => !collapsed.includes(group.status)\n  );\n  return openGroups.flatMap((group) => group.tasks.map((task) => task.id));\n}\n\nfunction selectionStateOf(\n  selectedCount: number,\n  shownCount: number\n): SelectionState {\n  if (selectedCount === 0) {\n    return 'none';\n  }\n  if (selectedCount === shownCount) {\n    return 'all';\n  }\n  return 'some';\n}\n\nfunction patchedWhere(\n  tasks: Task[],\n  taskIds: string[],\n  patchOf: (task: Task) => Partial<Task>\n) {\n  return tasks.map((task) => {\n    if (!taskIds.includes(task.id)) {\n      return task;\n    }\n    return { ...task, ...patchOf(task) };\n  });\n}\n\nfunction assigneesAfter(\n  target: Task,\n  added: string[],\n  removed: string[]\n): Partial<Task> {\n  const kept = target.assigneeIds.filter((id) => !removed.includes(id));\n  const missing = added.filter((id) => !kept.includes(id));\n  return { assigneeIds: [...kept, ...missing] };\n}\n\nexport default function TaskLists02() {\n  const [tasks, setTasks] = useState<Task[]>(TASKS);\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 [draftStatus, setDraftStatus] = useState<StatusId | null>(null);\n  const [selectedIds, setSelectedIds] = useState<string[]>([]);\n  const [anchorId, setAnchorId] = useState<string | null>(null);\n  const placement = useDelayedPlacement();\n\n  const matchingTasks = tasks.filter(\n    (task) => matchesSearch(task, query) && matchesFilters(task, 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 hasGroups = groups.length > 0;\n  const isFiltered = isFiltering(query, filters);\n  const showsFilteredEmpty = !hasGroups && isFiltered;\n  const showsScopeEmpty = !hasGroups && !isFiltered;\n  const shownIds = shownIdsOf(groups, collapsed);\n  const shownSelectedIds = selectedIds.filter((id) => shownIds.includes(id));\n  const selectedTasks = tasks.filter((task) =>\n    shownSelectedIds.includes(task.id)\n  );\n  const hasSelection = shownSelectedIds.length > 0;\n  const selection = selectionStateOf(shownSelectedIds.length, shownIds.length);\n\n  useEffect(() => {\n    if (!hasSelection) {\n      return;\n    }\n    function clearOnEscape(event: KeyboardEvent) {\n      if (event.key !== 'Escape') {\n        return;\n      }\n      if (isIgnoredEscape(event)) {\n        return;\n      }\n      setSelectedIds([]);\n    }\n    document.addEventListener('keydown', clearOnEscape);\n    return () => document.removeEventListener('keydown', clearOnEscape);\n  }, [hasSelection]);\n\n  function targetsOf(taskId: string) {\n    const isInSelection = shownSelectedIds.includes(taskId);\n    if (isInSelection) {\n      return shownSelectedIds;\n    }\n    return [taskId];\n  }\n\n  function updateTasks(\n    taskIds: string[],\n    patchOf: (task: Task) => Partial<Task>\n  ) {\n    setTasks((current) => patchedWhere(current, taskIds, patchOf));\n  }\n\n  function applyStatus(taskIds: string[], status: StatusId) {\n    const targets = tasks.filter((task) => taskIds.includes(task.id));\n    const moving = targets.filter((task) => task.status !== status);\n    for (const task of moving) {\n      placement.hold(task.id, task.status);\n    }\n    updateTasks(taskIds, () => ({ status }));\n  }\n\n  function applyPriority(taskIds: string[], priority: PriorityId) {\n    updateTasks(taskIds, () => ({ priority }));\n  }\n\n  function applyAssignee(personId: string, isIncluded: boolean) {\n    updateTasks(shownSelectedIds, (task) => ({\n      assigneeIds: toggledIds(task.assigneeIds, personId, isIncluded),\n    }));\n  }\n\n  function changeAssignees(taskId: string, assigneeIds: string[]) {\n    const task = tasks.find((item) => item.id === taskId);\n    if (!task) {\n      return;\n    }\n    const added = assigneeIds.filter((id) => !task.assigneeIds.includes(id));\n    const removed = task.assigneeIds.filter((id) => !assigneeIds.includes(id));\n    updateTasks(targetsOf(taskId), (target) =>\n      assigneesAfter(target, added, removed)\n    );\n  }\n\n  function select(taskId: string, isSelected: boolean, isRange: boolean) {\n    if (isRange && anchorId) {\n      const range = rangeBetween(shownIds, anchorId, taskId);\n      setSelectedIds(withRange(shownSelectedIds, range, isSelected));\n      return;\n    }\n    setSelectedIds(toggledIds(shownSelectedIds, taskId, isSelected));\n    setAnchorId(taskId);\n  }\n\n  function toggleAll(isSelected: boolean) {\n    if (isSelected) {\n      setSelectedIds(shownIds);\n      return;\n    }\n    setSelectedIds([]);\n  }\n\n  function clearSelection() {\n    setSelectedIds([]);\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    const isHiddenByScope = !isInScope(status, scope);\n    if (isHiddenByScope) {\n      setScope('active');\n    }\n    setCollapsed((current) => current.filter((item) => item !== status));\n    setDraftStatus(status);\n  }\n\n  function createTask(status: StatusId, title: string) {\n    const number = nextTaskNumberOf(tasks);\n    const task: Task = {\n      id: `mos-${number}`,\n      number,\n      title,\n      type: 'task',\n      status,\n      priority: 'none',\n      labelIds: [],\n      assigneeIds: [],\n    };\n    setTasks((current) => [task, ...current]);\n    setDraftStatus(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  return (\n    <div className='bg-background text-foreground @container flex h-svh min-h-[28rem] 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'>Tasks</h1>\n            <p className='text-muted-foreground text-xs'>\n              {headerMetaOf(tasks)}\n            </p>\n          </div>\n          <Button onClick={() => startDraft(NEW_TASK_STATUS)}>\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 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'>\n        <div className='absolute inset-0 overflow-y-auto'>\n          <AnimatePresence mode='popLayout' initial={false}>\n            {hasGroups && (\n              <motion.div\n                key='list'\n                role='table'\n                aria-label='Tasks'\n                {...fadePresence()}\n                className='pb-24'\n              >\n                <ColumnLabels selection={selection} onToggleAll={toggleAll} />\n                <AnimatePresence initial={false}>\n                  {groups.map((group) => (\n                    <TaskGroup\n                      key={group.status}\n                      status={group.status}\n                      tasks={group.tasks}\n                      selectedIds={shownSelectedIds}\n                      onSelect={select}\n                      isCollapsed={collapsed.includes(group.status)}\n                      isDrafting={draftStatus === group.status}\n                      onToggleCollapsed={toggleCollapsed}\n                      onStartDraft={startDraft}\n                      onCreate={createTask}\n                      onCancelDraft={() => setDraftStatus(null)}\n                      onStatusChange={(taskId, status) =>\n                        applyStatus(targetsOf(taskId), status)\n                      }\n                      onPriorityChange={(taskId, priority) =>\n                        applyPriority(targetsOf(taskId), priority)\n                      }\n                      onAssigneesChange={changeAssignees}\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={() => startDraft(NEW_TASK_STATUS)}\n                  onShowActive={() => setScope('active')}\n                />\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n        <div className='pointer-events-none absolute inset-x-0 bottom-4 flex justify-center px-3'>\n          <AnimatePresence>\n            {hasSelection && (\n              <SelectionBar\n                key='selection-bar'\n                tasks={selectedTasks}\n                onStatus={(status) => applyStatus(shownSelectedIds, status)}\n                onPriority={(priority) =>\n                  applyPriority(shownSelectedIds, priority)\n                }\n                onAssignee={applyAssignee}\n                onClear={clearSelection}\n              />\n            )}\n          </AnimatePresence>\n        </div>\n      </div>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/task-lists-02/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/selection-bar.tsx",
      "content": "'use client';\n\nimport { motion, type MotionProps, type Transition } from 'motion/react';\n\nimport { MotionNumber } from '@/components/core/motion-number';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { CircleDashedIcon, UserIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport {\n  DropdownMenu,\n  DropdownMenuCheckboxItem,\n  DropdownMenuContent,\n  DropdownMenuRadioGroup,\n  DropdownMenuRadioItem,\n  DropdownMenuTrigger,\n} from '@/registry/ndeko/ui/dropdown-menu';\nimport { Kbd } from '@/registry/ndeko/ui/kbd';\n\nimport {\n  PEOPLE,\n  PRIORITIES,\n  STATUSES,\n  type PriorityId,\n  type StatusId,\n  type Task,\n} from './data';\nimport { PersonAvatar, PriorityGlyph, StatusGlyph } from './task-glyphs';\nimport { isPriorityId, isStatusId } from './task-model';\n\nconst EASE_OUT_STRONG: [number, number, number, number] = [0.23, 1, 0.32, 1];\n\nconst BAR_ENTER: Transition = { duration: 0.22, ease: EASE_OUT_STRONG };\n\nconst BAR_EXIT: Transition = { duration: 0.15, ease: EASE_OUT_STRONG };\n\ntype PresenceProps = Pick<\n  MotionProps,\n  'initial' | 'animate' | 'exit' | 'transition'\n>;\n\nconst BAR_PRESENCE: PresenceProps = {\n  initial: { opacity: 0, y: 12, scale: 0.97 },\n  animate: { opacity: 1, y: 0, scale: 1 },\n  exit: { opacity: 0, y: 8, scale: 0.98, transition: BAR_EXIT },\n  transition: BAR_ENTER,\n};\n\nconst BAR_FADE: PresenceProps = {\n  initial: { opacity: 0 },\n  animate: { opacity: 1 },\n  exit: { opacity: 0, transition: BAR_EXIT },\n  transition: BAR_ENTER,\n};\n\nfunction barPresenceOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return BAR_FADE;\n  }\n  return BAR_PRESENCE;\n}\n\nfunction sharedValueOf<Value extends string>(values: Value[]) {\n  const first = values[0];\n  const isShared = values.every((value) => value === first);\n  if (isShared) {\n    return first;\n  }\n  return '';\n}\n\nfunction BarDivider() {\n  return (\n    <span aria-hidden='true' className='bg-border mx-1 h-5 w-(--hairline)' />\n  );\n}\n\ntype SelectionBarProps = {\n  tasks: Task[];\n  onStatus: (status: StatusId) => void;\n  onPriority: (priority: PriorityId) => void;\n  onAssignee: (personId: string, isIncluded: boolean) => void;\n  onClear: () => void;\n};\n\nexport function SelectionBar({\n  tasks,\n  onStatus,\n  onPriority,\n  onAssignee,\n  onClear,\n}: SelectionBarProps) {\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const sharedStatus = sharedValueOf(tasks.map((task) => task.status));\n  const sharedPriority = sharedValueOf(tasks.map((task) => task.priority));\n\n  function pickStatus(value: unknown) {\n    if (isStatusId(value)) {\n      onStatus(value);\n    }\n  }\n\n  function pickPriority(value: unknown) {\n    if (isPriorityId(value)) {\n      onPriority(value);\n    }\n  }\n\n  function isAssignedToAll(personId: string) {\n    return tasks.every((task) => task.assigneeIds.includes(personId));\n  }\n\n  return (\n    <motion.div\n      role='toolbar'\n      aria-label='Edit the selected tasks'\n      {...barPresenceOf(shouldReduceMotion)}\n      className='surface-raised pointer-events-auto flex h-11 max-w-full items-center gap-0.5 rounded-full py-1 ps-4 pe-1.5'\n    >\n      <span className='flex items-center gap-1 text-[13px] font-medium whitespace-nowrap'>\n        <MotionNumber value={tasks.length} />\n        selected\n      </span>\n      <BarDivider />\n      <DropdownMenu>\n        <DropdownMenuTrigger\n          aria-label='Status'\n          render={<Button variant='ghost' size='sm' />}\n        >\n          <CircleDashedIcon />\n          <span className='hidden @lg:inline'>Status</span>\n        </DropdownMenuTrigger>\n        <DropdownMenuContent side='top' sideOffset={10} className='w-48'>\n          <DropdownMenuRadioGroup\n            value={sharedStatus}\n            onValueChange={pickStatus}\n          >\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      <DropdownMenu>\n        <DropdownMenuTrigger\n          aria-label='Priority'\n          render={<Button variant='ghost' size='sm' />}\n        >\n          <PriorityGlyph priority='high' className='text-muted-foreground' />\n          <span className='hidden @lg:inline'>Priority</span>\n        </DropdownMenuTrigger>\n        <DropdownMenuContent side='top' sideOffset={10} className='w-44'>\n          <DropdownMenuRadioGroup\n            value={sharedPriority}\n            onValueChange={pickPriority}\n          >\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      <DropdownMenu>\n        <DropdownMenuTrigger\n          aria-label='Assignee'\n          render={<Button variant='ghost' size='sm' />}\n        >\n          <UserIcon />\n          <span className='hidden @lg:inline'>Assignee</span>\n        </DropdownMenuTrigger>\n        <DropdownMenuContent side='top' sideOffset={10} className='w-52'>\n          {PEOPLE.map((person) => (\n            <DropdownMenuCheckboxItem\n              key={person.id}\n              checked={isAssignedToAll(person.id)}\n              onCheckedChange={(checked) => onAssignee(person.id, checked)}\n            >\n              <PersonAvatar person={person} />\n              {person.name}\n            </DropdownMenuCheckboxItem>\n          ))}\n        </DropdownMenuContent>\n      </DropdownMenu>\n      <BarDivider />\n      <Button variant='ghost' size='sm' onClick={onClear}>\n        Clear\n        <Kbd className='hidden @lg:inline-flex'>Esc</Kbd>\n      </Button>\n    </motion.div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/task-lists-02/selection-bar.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/column-labels.tsx",
      "content": "'use client';\n\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport { Checkbox } from '@/registry/ndeko/ui/checkbox';\n\nimport {\n  DUE_CELL,\n  GUTTER_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 type SelectionState = 'none' | 'some' | 'all';\n\ntype ColumnLabelsProps = {\n  selection: SelectionState;\n  onToggleAll: (isSelected: boolean) => void;\n};\n\nexport function ColumnLabels({ selection, onToggleAll }: ColumnLabelsProps) {\n  const isAllSelected = selection === 'all';\n  const isPartlySelected = selection === 'some';\n\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={GUTTER_CELL}>\n        <Checkbox\n          checked={isAllSelected}\n          indeterminate={isPartlySelected}\n          onCheckedChange={onToggleAll}\n          aria-label='Select every task shown'\n        />\n      </div>\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/blocks/task-lists-02/column-labels.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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' />\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/blocks/task-lists-02/draft-row.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/empty-list.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/filter-menu.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/motion-parts.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/property-menus.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/scope-switch.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/search-field.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/task-glyphs.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/task-grid.ts",
      "content": "export const TASK_GRID = [\n  'grid items-center gap-x-2 px-2 sm:px-4',\n  'grid-cols-[1.25rem_1.75rem_minmax(0,1fr)_3.75rem]',\n  '@2xl:grid-cols-[1.25rem_1.75rem_4rem_1.75rem_minmax(0,1fr)_4.25rem_4.25rem]',\n  '@4xl:grid-cols-[1.25rem_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 GUTTER_CELL = 'flex items-center justify-center';\n\nexport const DRAFT_TITLE_CELL = 'col-[3/-1] @2xl:col-[5/-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 SELECTED_ROW = 'bg-primary/[0.06] hover:bg-primary/[0.08]';\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/blocks/task-lists-02/task-grid.ts"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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  selectedIds: string[];\n  onSelect: (taskId: string, isSelected: boolean, isRange: boolean) => void;\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  selectedIds,\n  onSelect,\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                  isSelected={selectedIds.includes(task.id)}\n                  onSelect={onSelect}\n                  {...rowHandlers}\n                />\n              ))}\n            </AnimatePresence>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </motion.section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/task-lists-02/task-group.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/task-model.ts",
      "content": "import { format, isBefore, parseISO } from 'date-fns';\n\nimport {\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 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 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 taskKeyOf(task: Task) {\n  return `${TEAM_KEY}-${task.number}`;\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 patchedTask(\n  task: Task,\n  taskId: string,\n  patch: Partial<Task>\n): Task {\n  if (task.id !== taskId) {\n    return task;\n  }\n  return { ...task, ...patch };\n}\n\nexport function nextTaskNumberOf(tasks: Task[]) {\n  const numbers = tasks.map((task) => task.number);\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\nexport function rangeBetween(ids: string[], fromId: string, toId: string) {\n  const fromIndex = ids.indexOf(fromId);\n  const toIndex = ids.indexOf(toId);\n  const isMissing = fromIndex === -1 || toIndex === -1;\n  if (isMissing) {\n    return [toId];\n  }\n  const start = Math.min(fromIndex, toIndex);\n  const end = Math.max(fromIndex, toIndex);\n  return ids.slice(start, end + 1);\n}\n\nexport function withRange(\n  selectedIds: string[],\n  range: string[],\n  isIncluded: boolean\n) {\n  const remaining = selectedIds.filter((id) => !range.includes(id));\n  if (isIncluded) {\n    return [...remaining, ...range];\n  }\n  return remaining;\n}\n",
      "type": "registry:component",
      "target": "components/blocks/task-lists-02/task-model.ts"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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';\nimport { Checkbox } from '@/registry/ndeko/ui/checkbox';\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  GUTTER_CELL,\n  ID_CELL,\n  LABELS_CELL,\n  PRIORITY_CELL,\n  ROW_CLASS,\n  SELECTED_ROW,\n  TASK_GRID,\n  TRACKED_ROW,\n} from './task-grid';\nimport { dueLabelOf, isOverdue, taskKeyOf, trackerOf } 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};\n\ntype TaskRowProps = TaskRowHandlers & {\n  task: Task;\n  isSelected: boolean;\n  onSelect: (taskId: string, isSelected: boolean, isRange: boolean) => void;\n};\n\nfunction isRangeEvent(event: Event) {\n  const isPointer = event instanceof MouseEvent;\n  const isKey = event instanceof KeyboardEvent;\n  if (isPointer || isKey) {\n    return event.shiftKey;\n  }\n  return false;\n}\n\nfunction keepTextUnselected(event: React.MouseEvent) {\n  if (event.shiftKey) {\n    event.preventDefault();\n  }\n}\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  isSelected,\n  onSelect,\n  onStatusChange,\n  onPriorityChange,\n  onAssigneesChange,\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\n  return (\n    <motion.div\n      role='row'\n      {...presence}\n      className={cn(\n        TASK_GRID,\n        ROW_CLASS,\n        isSelected && SELECTED_ROW,\n        isTracked && TRACKED_ROW\n      )}\n    >\n      <div role='cell' className={GUTTER_CELL}>\n        <Checkbox\n          checked={isSelected}\n          onCheckedChange={(checked, details) =>\n            onSelect(task.id, checked, isRangeEvent(details.event))\n          }\n          onMouseDown={keepTextUnselected}\n          aria-label={`Select ${taskKeyOf(task)}`}\n        />\n      </div>\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        <span\n          className={cn(\n            'truncate text-[13px]',\n            isDone && 'text-muted-foreground'\n          )}\n        >\n          {task.title}\n        </span>\n        {task.subTasks && <SubTaskCountTag count={task.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/blocks/task-lists-02/task-row.tsx"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/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/blocks/task-lists-02/use-delayed-placement.ts"
    },
    {
      "path": "registry/ndeko/blocks/task-lists/task-lists-02/data.ts",
      "content": "export 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 Person = {\n  id: string;\n  name: 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};\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 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  subTasks?: SubTaskCount;\n  trackedById?: string;\n};\n\nexport const TEAM_KEY = 'MOS';\n\nexport const TODAY = '2026-11-05';\n\nexport const PEOPLE: Person[] = [\n  {\n    id: 'amara',\n    name: 'Amara Okafor',\n  },\n  {\n    id: 'leo',\n    name: 'Léo Martin',\n  },\n  {\n    id: 'sana',\n    name: 'Sana Iqbal',\n  },\n  {\n    id: 'tomas',\n    name: 'Tomás Rivera',\n  },\n  {\n    id: 'mei',\n    name: 'Mei Lin',\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 PRIORITIES: Priority[] = [\n  { id: 'urgent', name: 'Urgent' },\n  { id: 'high', name: 'High' },\n  { id: 'medium', name: 'Medium' },\n  { id: 'low', name: 'Low' },\n  { id: 'none', name: 'No priority' },\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\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    trackedById: 'leo',\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    subTasks: { done: 2, total: 5 },\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  },\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  },\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    subTasks: { done: 0, total: 3 },\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'],\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  },\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: ['mei'],\n    due: '2026-11-20',\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    subTasks: { done: 1, total: 6 },\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: [],\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  },\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  },\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: [],\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    subTasks: { done: 4, total: 4 },\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  },\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  },\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  },\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  },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/task-lists-02/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "task-lists"
  ],
  "type": "registry:block"
}