{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "file-type-icon",
  "type": "registry:ui",
  "title": "File Type Icon",
  "description": "The file-type-icon primitive.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/theme.json"
  ],
  "files": [
    {
      "path": "src/ui/file-type-icon.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/ui/file-type-icon.tsx",
      "content": "import type { ReactNode } from 'react';\n\n/**\n * The kinds a file-type icon is drawn for: the workspace Library's kinds (LibraryItem.kind), with PDFs apart from other\n * documents, plus a project and a task for cards that have no picture.\n */\nexport type FileKind = 'document' | 'pdf' | 'email_template' | 'style_guide' | 'brand_guide' | 'image' | 'video' | 'logo' | 'mockup' | 'other' | 'project' | 'task';\n\n// Drawn by the prototype seat (2026-10-21, Felix 13:39: \"create a custom icon per file type and have it be the main image\"),\n// on lucide's grid: 48 units, 2 px round stroke in currentColor, one detail in the accent.\nconst A = 'var(--kh-accent)';\n/** The page with a folded corner most file icons start from. */\nconst Sheet = ({ children }: { children?: ReactNode }) => (\n  <>\n    <path d=\"M13 5h16l10 10v26a2 2 0 0 1-2 2H13a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z\" />\n    <path d=\"M29 5v8a2 2 0 0 0 2 2h8\" />\n    {children}\n  </>\n);\n\nconst ICONS: Record<FileKind, ReactNode> = {\n  document: <Sheet><path d=\"M17 21h10\" stroke={A} /><path d=\"M17 27h16M17 32h16M17 37h10\" /></Sheet>,\n  pdf: (\n    <Sheet>\n      <path d=\"M17 21h16M17 26h12\" />\n      <rect x=\"15\" y=\"31\" width=\"20\" height=\"8\" rx=\"2\" fill={A} stroke={A} />\n      <text x=\"25\" y=\"37.4\" textAnchor=\"middle\" fontSize=\"6.5\" fontWeight=\"700\" fill=\"var(--kh-surface)\" stroke=\"none\" fontFamily=\"var(--kh-font-sans)\">PDF</text>\n    </Sheet>\n  ),\n  email_template: (\n    <>\n      <path d=\"M14 22V9a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v13\" />\n      <path d=\"M19 13h10\" stroke={A} /><path d=\"M19 18h10\" />\n      <path d=\"M13 18H9a2 2 0 0 0-2 2v19a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V20a2 2 0 0 0-2-2h-4\" />\n      <path d=\"m7 21 17 11 17-11\" />\n    </>\n  ),\n  style_guide: (\n    <Sheet>\n      <text x=\"16\" y=\"28\" fontSize=\"12\" fontWeight=\"600\" fill=\"currentColor\" stroke=\"none\" fontFamily=\"var(--kh-font-display)\">Aa</text>\n      <rect x=\"16\" y=\"32\" width=\"6\" height=\"6\" rx=\"1.5\" fill={A} stroke={A} />\n      <rect x=\"25\" y=\"32\" width=\"6\" height=\"6\" rx=\"1.5\" />\n    </Sheet>\n  ),\n  brand_guide: (\n    <>\n      <path d=\"M10 8a3 3 0 0 1 3-3h25v34H13a3 3 0 0 0-3 3Z\" />\n      <path d=\"M10 42a3 3 0 0 0 3 3h25v-6\" />\n      <circle cx=\"24\" cy=\"20\" r=\"6\" fill={A} stroke={A} />\n      <path d=\"M18 31h12\" />\n    </>\n  ),\n  image: (\n    <>\n      <rect x=\"6\" y=\"9\" width=\"36\" height=\"30\" rx=\"3\" />\n      <circle cx=\"31\" cy=\"18\" r=\"3.5\" fill={A} stroke={A} />\n      <path d=\"m6 33 10-10 9 9 5-5 12 12\" />\n    </>\n  ),\n  video: (\n    <>\n      <rect x=\"6\" y=\"9\" width=\"36\" height=\"30\" rx=\"3\" />\n      <path d=\"M12 9v30M36 9v30M6 16h6M6 32h6M36 16h6M36 32h6\" />\n      <path d=\"m21 18 9 6-9 6Z\" fill={A} stroke={A} />\n    </>\n  ),\n  logo: (\n    <>\n      <circle cx=\"17\" cy=\"17\" r=\"8\" fill={A} stroke={A} />\n      <rect x=\"25\" y=\"25\" width=\"15\" height=\"15\" rx=\"3\" />\n      <path d=\"M10 40 17 28l7 12Z\" />\n    </>\n  ),\n  mockup: (\n    <>\n      <rect x=\"5\" y=\"8\" width=\"38\" height=\"28\" rx=\"3\" />\n      <path d=\"M5 15h38\" /><circle cx=\"10\" cy=\"11.5\" r=\".5\" /><circle cx=\"14\" cy=\"11.5\" r=\".5\" />\n      <path d=\"M12 21h12M12 26h8\" />\n      <path d=\"m29 24 11 4-5 2-2 5Z\" fill={A} stroke={A} />\n    </>\n  ),\n  other: <Sheet><path d=\"M17 27h16M17 32h12\" /></Sheet>,\n  // Projects and tasks without a picture (Felix 13:40: they get an icon in the square too).\n  project: (\n    <>\n      <path d=\"M5 13a3 3 0 0 1 3-3h9l4 4h19a3 3 0 0 1 3 3v21a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3Z\" />\n      <rect x=\"13\" y=\"22\" width=\"9\" height=\"6\" rx=\"1.5\" fill={A} stroke={A} /><rect x=\"26\" y=\"22\" width=\"9\" height=\"6\" rx=\"1.5\" />\n      <rect x=\"13\" y=\"31\" width=\"9\" height=\"5\" rx=\"1.5\" /><rect x=\"26\" y=\"31\" width=\"9\" height=\"5\" rx=\"1.5\" />\n    </>\n  ),\n  task: (\n    <Sheet>\n      <path d=\"m16 21 2 2 4-4\" stroke={A} /><path d=\"M26 21h7\" />\n      <rect x=\"16\" y=\"27\" width=\"5\" height=\"5\" rx=\"1.2\" /><path d=\"M26 30h7\" />\n      <rect x=\"16\" y=\"35\" width=\"5\" height=\"5\" rx=\"1.2\" /><path d=\"M26 38h5\" />\n    </Sheet>\n  ),\n};\n\nexport interface FileTypeIconProps {\n  kind: FileKind;\n  /** Names the icon for assistive tech. Omit when the card's text already says the kind (the default: hidden). */\n  label?: string;\n  className?: string;\n}\n\n/** One icon per kind of file, in the library's icon style: ink lines and one accent detail. Sized by className (size-10). */\nexport function FileTypeIcon({ kind, label, className }: FileTypeIconProps) {\n  return (\n    <svg viewBox=\"0 0 48 48\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\"\n      {...(label ? { role: 'img', 'aria-label': label } : { 'aria-hidden': true })} className={className}>\n      {ICONS[kind]}\n    </svg>\n  );\n}\n\nexport const FILE_KINDS = Object.keys(ICONS) as FileKind[];\n"
    }
  ]
}
