{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-kanban",
  "title": "Use Kanban",
  "type": "registry:hook",
  "files": [
    {
      "path": "packages/registry-react/bootstrap/use-kanban/useKanban.ts",
      "content": "import {\n  CircleAlert,\n  ArrowUp,\n  ArrowDown,\n  Minus,\n  FileText,\n  FileSpreadsheet,\n  FileImage,\n  File,\n  type LucideIcon,\n} from 'lucide-react'\n\nexport interface CommentItem {\n  id: string\n  author: string\n  authorColor: string\n  text: string\n  time: string\n}\n\nexport interface FileItem {\n  id: string\n  name: string\n  size: string\n  type: 'pdf' | 'spreadsheet' | 'image' | 'other'\n}\n\nexport interface KanbanTask {\n  id: string\n  title: string\n  description?: string\n  priority: 'low' | 'medium' | 'high' | 'urgent'\n  assignee: { name: string; color: string }\n  tags: { label: string; color: string }[]\n  dueDate?: string\n  parentId?: string\n  subtaskIds: string[]\n  commentItems: CommentItem[]\n  fileItems: FileItem[]\n}\n\nexport interface KanbanColumn {\n  id: string\n  title: string\n  color: string\n  dotColor: string\n  tasks: KanbanTask[]\n}\n\nexport const priorityConfig: Record<string, { icon: LucideIcon; class: string; label: string; bg: string }> = {\n  urgent: { icon: CircleAlert, class: 'text-red-500', label: 'Urgent', bg: 'bg-red-500' },\n  high: { icon: ArrowUp, class: 'text-orange-500', label: 'High', bg: 'bg-orange-500' },\n  medium: { icon: Minus, class: 'text-yellow-500 dark:text-yellow-400', label: 'Medium', bg: 'bg-yellow-500' },\n  low: { icon: ArrowDown, class: 'text-blue-400', label: 'Low', bg: 'bg-blue-400' },\n}\n\nexport const assignees = {\n  alice: { name: 'Alice Chen', color: 'bg-orange-500/15 text-orange-600 dark:text-orange-400' },\n  bob: { name: 'Bob Martinez', color: 'bg-blue-500/15 text-blue-600 dark:text-blue-400' },\n  carol: { name: 'Carol White', color: 'bg-emerald-500/15 text-emerald-600 dark:text-emerald-400' },\n  david: { name: 'David Kim', color: 'bg-violet-500/15 text-violet-600 dark:text-violet-400' },\n  eva: { name: 'Eva Johnson', color: 'bg-rose-500/15 text-rose-600 dark:text-rose-400' },\n  frank: { name: 'Frank Lee', color: 'bg-cyan-500/15 text-cyan-600 dark:text-cyan-400' },\n}\n\nexport const tagPresets = {\n  onboarding: { label: 'Onboarding', color: 'bg-sky-500/10 text-sky-600 dark:text-sky-400 ring-sky-500/20' },\n  compliance: { label: 'Compliance', color: 'bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-amber-500/20' },\n  recruitment: {\n    label: 'Recruitment',\n    color: 'bg-violet-500/10 text-violet-600 dark:text-violet-400 ring-violet-500/20',\n  },\n  payroll: { label: 'Payroll', color: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20' },\n  training: { label: 'Training', color: 'bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-rose-500/20' },\n  benefits: { label: 'Benefits', color: 'bg-orange-500/10 text-orange-600 dark:text-orange-400 ring-orange-500/20' },\n  policy: { label: 'Policy', color: 'bg-slate-500/10 text-slate-600 dark:text-slate-400 ring-slate-500/20' },\n}\n\nexport const fileIconMap: Record<string, LucideIcon> = {\n  pdf: FileText,\n  spreadsheet: FileSpreadsheet,\n  image: FileImage,\n  other: File,\n}\n\nexport function getInitials(name: string) {\n  return name\n    .split(' ')\n    .map((n) => n[0])\n    .join('')\n    .toUpperCase()\n}\n\nexport function getDueStatus(dueDate?: string): 'overdue' | 'soon' | 'normal' | null {\n  if (!dueDate) return null\n  const now = new Date()\n  const due = new Date(dueDate + 'T00:00:00')\n  const diffDays = Math.ceil((due.getTime() - now.getTime()) / (1000 * 60 * 60 * 24))\n  if (diffDays < 0) return 'overdue'\n  if (diffDays <= 3) return 'soon'\n  return 'normal'\n}\n\nexport function formatDueDate(dueDate: string): string {\n  const date = new Date(dueDate + 'T00:00:00')\n  return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' })\n}\n\nexport function getAssigneeKey(name: string): keyof typeof assignees {\n  for (const [key, val] of Object.entries(assignees)) {\n    if (val.name === name) return key as keyof typeof assignees\n  }\n  return 'alice'\n}\n\nexport function findTaskById(columns: KanbanColumn[], taskId: string): KanbanTask | undefined {\n  for (const col of columns) {\n    const task = col.tasks.find((t) => t.id === taskId)\n    if (task) return task\n  }\n  return undefined\n}\n\nexport function getTaskColumn(columns: KanbanColumn[], taskId: string): KanbanColumn | undefined {\n  return columns.find((col) => col.tasks.some((t) => t.id === taskId))\n}\n",
      "type": "registry:hook",
      "target": "~/lib/use-kanban.ts"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Types (KanbanTask, KanbanColumn, CommentItem, FileItem), configs (priorityConfig with icons, assignee colour palette, tagPresets, fileIconMap), and helpers (getInitials, getDueStatus, formatDueDate, findTaskById, getTaskColumn). Shipped as a sibling to the kanban-board block so all the kanban files import the same types and assignee/tag presets."
}