{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card",
  "title": "Card",
  "description": "A surface with a dither or ASCII border and optional fill around normal DOM children.",
  "dependencies": [],
  "registryDependencies": [
    "https://dotgrain.space/r/engine.json"
  ],
  "files": [
    {
      "path": "registry/ui/card.tsx",
      "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode, Ref } from \"react\";\nimport { paletteColors } from \"@/lib/dotgrain/palettes\";\nimport { useColorScheme, useDitherTokens } from \"@/lib/dotgrain/provider\";\nimport { Quantize } from \"@/lib/dotgrain/quantize\";\nimport type { DitherTokens } from \"@/lib/dotgrain/types\";\n\nexport type CardProps = Partial<DitherTokens> & {\n  /** Border width in marks (whole glyph cells in ASCII). */\n  border?: number;\n  /** Level inside the border, 0–1; keep it low so text stays legible. */\n  fill?: number;\n  children?: ReactNode;\n  className?: string;\n  style?: CSSProperties;\n  ref?: Ref<HTMLDivElement>;\n};\n\nexport function Card({ border = 3, fill = 0, children, className, style, ref, ...tokens }: CardProps) {\n  // Text takes the palette's foreground so it reads on the palette's background in any page theme.\n  const colors = paletteColors(useDitherTokens(tokens).palette, useColorScheme().scheme);\n  return (\n    <div ref={ref} className={className} style={{ position: \"relative\", padding: 24, color: colors[colors.length - 1], ...style }}>\n      <Quantize source={{ kind: \"field\", field: \"frame\", params: { border, fill } }} {...tokens} style={{ position: \"absolute\", inset: 0 }} />\n      <div style={{ position: \"relative\" }}>{children}</div>\n    </div>\n  );\n}\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "modes": [
      "dither",
      "ascii"
    ]
  },
  "categories": [
    "surface"
  ],
  "type": "registry:ui"
}