{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "letter-tile",
  "title": "Letter Tile",
  "description": "A drawn initial for a model lab or a site, tinted by a series colour or left neutral.",
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/utils.json",
    "https://ui.ndekocode.dev/r/agent-run.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/ui/letter-tile.tsx",
      "content": "import type { CSSProperties } from 'react';\n\nimport { seriesColorOf, type SeriesSlot } from '@/registry/ndeko/lib/agent-run';\nimport { cn } from '@/registry/ndeko/lib/utils';\n\nexport type LetterTileSize = 'sm' | 'md' | 'lg';\n\nconst SIZE_CLASS: Record<LetterTileSize, string> = {\n  sm: 'size-4 rounded-[4px] text-[9px]',\n  md: 'size-5 rounded-[5px] text-[10px]',\n  lg: 'size-7 rounded-md text-xs',\n};\n\ntype LetterTileProps = {\n  initial: string;\n  /** Without a series the tile stays neutral, for views where agents already own the series colours. */\n  series?: SeriesSlot;\n  size?: LetterTileSize;\n  className?: string;\n};\n\nfunction materialOf(series: SeriesSlot | undefined) {\n  if (series === undefined) {\n    return 'keycap-3d text-foreground';\n  }\n  return 'gem-plate';\n}\n\nfunction plateStyleOf(series: SeriesSlot | undefined) {\n  if (series === undefined) {\n    return undefined;\n  }\n  const style = { '--gem': seriesColorOf(series) } as CSSProperties;\n  return style;\n}\n\n/** A drawn initial for a model lab or a site, never a real logo. */\nexport function LetterTile({\n  initial,\n  series,\n  size = 'md',\n  className,\n}: LetterTileProps) {\n  return (\n    <span\n      aria-hidden='true'\n      style={plateStyleOf(series)}\n      className={cn(\n        'inline-flex shrink-0 items-center justify-center leading-none font-semibold select-none',\n        materialOf(series),\n        SIZE_CLASS[size],\n        className\n      )}\n    >\n      {initial}\n    </span>\n  );\n}\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "primitives",
    "ai"
  ],
  "type": "registry:ui"
}