{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "kanban-move-to-menu",
  "title": "Kanban Move To Menu",
  "description": "Kanban Move To Menu from the Get IT Done design system.",
  "dependencies": [
    "lucide-react@^0.379.0"
  ],
  "registryDependencies": [
    "https://zero-design.itdone.de/r/button.json",
    "https://zero-design.itdone.de/r/dropdown-menu.json",
    "https://zero-design.itdone.de/r/kanban.json",
    "https://zero-design.itdone.de/r/labels-context.json",
    "https://zero-design.itdone.de/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ui/kanban-move-to-menu.tsx",
      "content": "'use client';\n\nimport { MoreHorizontal } from 'lucide-react';\nimport { useId, useRef, type ReactNode } from 'react';\n\nimport { Button } from '@/components/ui/button';\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';\nimport { useKanbanMoveNotice } from '@/components/ui/kanban';\nimport { useLabels } from '@/components/ui/labels-context';\n\nexport interface KanbanMoveTarget {\n  id: string;\n  label: string;\n}\n\nexport interface KanbanMoveToMenuLabels {\n  // Heading of the target list.\n  moveTo: string;\n  // Accessible name of the trigger.\n  actions: (title: string) => string;\n  // Text of the disabled entry of the column the card is in.\n  current: (column: string) => string;\n}\n\nexport interface KanbanMoveToMenuProps {\n  // Card title, names the trigger, e.g. \"Actions for Data platform pilot\".\n  title: string;\n  // Columns in board order.\n  targets: KanbanMoveTarget[];\n  // Column the card is in. It is listed disabled and marked as current.\n  currentId: string;\n  onMove: (targetId: string) => void;\n  // Further card actions below the move targets, e.g. open or archive.\n  children?: ReactNode;\n  // Visible texts. Win over the provider text.\n  labels?: Partial<KanbanMoveToMenuLabels>;\n}\n\n// Card actions for the `actions` slot of KanbanCard: a pointer and keyboard way to move a card without dragging, also for touch without long press.\nconst KanbanMoveToMenu = ({ title, targets, currentId, onMove, children, labels }: KanbanMoveToMenuProps) => {\n  const l = useLabels();\n  const labelId = useId();\n  const moveTo = labels?.moveTo ?? l.kanbanMoveTo;\n  const actions = labels?.actions ?? l.kanbanCardActions;\n  const current = labels?.current ?? l.kanbanCurrentColumn;\n  const noteMove = useKanbanMoveNotice();\n  const triggerRef = useRef<HTMLButtonElement>(null);\n  const movedRef = useRef(false);\n  const select = (target: KanbanMoveTarget) => {\n    // Announce the move and hand focus to the card in its new column. Without a card around the trigger there is nothing to focus.\n    const cardId = triggerRef.current?.closest<HTMLElement>('[data-kanban-card]')?.dataset.cardId;\n    if (cardId) {\n      movedRef.current = true;\n      noteMove(cardId, target.label);\n    }\n    onMove(target.id);\n  };\n  return (\n    // Non-modal: a modal menu sets aria-hidden on the board and page around it, which leaves focusable content inside hidden regions (axe aria-hidden-focus). Focus return, Escape and outside click still close it.\n    <DropdownMenu modal={false}>\n      <DropdownMenuTrigger asChild>\n        <Button type=\"button\" ref={triggerRef} variant=\"ghost\" size=\"icon-sm\" aria-label={actions(title)}>\n          <MoreHorizontal aria-hidden=\"true\" className=\"h-icon-sm w-icon-sm\" />\n        </Button>\n      </DropdownMenuTrigger>\n      <DropdownMenuContent\n        align=\"end\"\n        onCloseAutoFocus={(event) => {\n          // The card (and this trigger) already moved to another column: the board focuses the card, so the menu must not pull focus back. While the board still waits for the server response the trigger is attached, so focus stays on it until the card appears.\n          if (movedRef.current && !triggerRef.current?.isConnected) event.preventDefault();\n          movedRef.current = false;\n        }}\n      >\n        <DropdownMenuLabel id={labelId}>{moveTo}</DropdownMenuLabel>\n        <DropdownMenuGroup aria-labelledby={labelId}>\n          {targets.map((t) => (\n            <DropdownMenuItem key={t.id} disabled={t.id === currentId} onSelect={() => select(t)}>\n              {t.id === currentId ? current(t.label) : t.label}\n            </DropdownMenuItem>\n          ))}\n        </DropdownMenuGroup>\n        {children}\n      </DropdownMenuContent>\n    </DropdownMenu>\n  );\n};\nKanbanMoveToMenu.displayName = 'KanbanMoveToMenu';\n\nexport { KanbanMoveToMenu };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}