{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "surface-classes",
  "title": "Surface Class Lookup",
  "description": "Static lookup tables for bg-surface-N and shadow-surface-N utilities. Required because Tailwind v4 cannot detect template-literal class names.",
  "registryDependencies": [
    "https://www.deltacomponents.dev/r/surfaces.json"
  ],
  "files": [
    {
      "path": "registry/lib/surface-classes.ts",
      "content": "/**\n * Static lookup tables for surface tokens.\n *\n * Tailwind v4's static scanner only generates utility classes for literal\n * strings it sees in source. Template-literal class names like\n * `bg-surface-${level}` are invisible to the scanner, so the matching\n * utility never gets generated and the background renders transparent.\n *\n * Use these maps when picking a surface level at runtime:\n *\n *   <div className={surfaceClasses(level)} />\n *\n * Each entry below contains the literal class name, which is enough for\n * Tailwind to detect and emit the utility.\n */\n\nconst SURFACE_BG: Record<number, string> = {\n  1: \"bg-surface-1\",\n  2: \"bg-surface-2\",\n  3: \"bg-surface-3\",\n  4: \"bg-surface-4\",\n  5: \"bg-surface-5\",\n  6: \"bg-surface-6\",\n  7: \"bg-surface-7\",\n  8: \"bg-surface-8\",\n};\n\nconst SURFACE_SHADOW: Record<number, string> = {\n  1: \"shadow-surface-1\",\n  2: \"shadow-surface-2\",\n  3: \"shadow-surface-3\",\n  4: \"shadow-surface-4\",\n  5: \"shadow-surface-5\",\n  6: \"shadow-surface-6\",\n  7: \"shadow-surface-7\",\n  8: \"shadow-surface-8\",\n};\n\nexport function surfaceClasses(bgLevel: number, shadowLevel: number = bgLevel): string {\n  // Round after clamping so a fractional level can't index out of the lookup\n  // tables (which would render \"undefined undefined\").\n  const bg = Math.round(Math.max(1, Math.min(8, bgLevel)));\n  const shadow = Math.round(Math.max(1, Math.min(8, shadowLevel)));\n  return `${SURFACE_BG[bg]} ${SURFACE_SHADOW[shadow]}`;\n}\n\n",
      "type": "registry:lib"
    }
  ],
  "categories": [
    "lib"
  ],
  "type": "registry:lib"
}
