{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "shader-surface-demo",
  "title": "Shader Surface Demo",
  "description": "A worked example of Shader Surface: Four shader backdrops -- caustics, metal, plasma and ripple -- each taking its two colours from your theme, so the same surface arrives dark in a dark application and light in a light one.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/shader-surface.json"
  ],
  "files": [
    {
      "path": "components/demos/shader-surface-demo.tsx",
      "content": "\"use client\"\n\nimport { DemoVariants } from \"@/components/demos/demo-variants\"\nimport {\n  ShaderSurface,\n  type ShaderSurfaceVariant,\n} from \"@/registry/default/shader-surface/shader-surface\"\n\nconst variants: ShaderSurfaceVariant[] = [\n  \"plasma\",\n  \"caustics\",\n  \"metal\",\n  \"ripple\",\n]\n\nfunction Panel({ variant }: { variant: ShaderSurfaceVariant }) {\n  return (\n    <ShaderSurface\n      variant={variant}\n      className=\"border-border mx-auto w-full max-w-xl rounded-[var(--radius)] border\"\n    >\n      <div className=\"px-8 py-20 text-center\">\n        <h3 className=\"text-3xl font-semibold capitalize drop-shadow-sm\">\n          {variant}\n        </h3>\n      </div>\n    </ShaderSurface>\n  )\n}\n\nexport function ShaderSurfaceDemo() {\n  return (\n    <DemoVariants\n      label=\"Shader\"\n      variants={\n        variants.map((variant) => ({\n          id: variant,\n          label: variant,\n          render: () => <Panel variant={variant} />,\n        })) as [\n          { id: string; label: string; render: () => React.ReactNode },\n          ...{ id: string; label: string; render: () => React.ReactNode }[],\n        ]\n      }\n    />\n  )\n}\n",
      "type": "registry:example"
    },
    {
      "path": "components/demos/demo-variants.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nexport type DemoVariant = {\n  id: string\n  label: string\n  render: () => React.ReactNode\n}\n\nexport function DemoVariants({\n  variants,\n  label = \"Demo variant\",\n}: {\n  variants: [DemoVariant, ...DemoVariant[]]\n  label?: string\n}) {\n  const [activeId, setActiveId] = React.useState(variants[0].id)\n  const active =\n    variants.find((variant) => variant.id === activeId) ?? variants[0]\n\n  return (\n    <div className=\"grid w-full justify-items-center gap-6\">\n      {/* Centres whatever the variant renders. Without this a demo that caps\n          its own width sits against the left edge while the switch below it\n          is centred, which reads as a mistake. */}\n      <div className=\"flex w-full justify-center\">{active.render()}</div>\n\n      <div\n        role=\"group\"\n        aria-label={label}\n        className=\"border-border bg-background/70 inline-flex flex-wrap justify-center gap-1 rounded-full border p-1\"\n      >\n        {variants.map((variant) => {\n          const isActive = variant.id === active.id\n\n          return (\n            <button\n              key={variant.id}\n              type=\"button\"\n              aria-pressed={isActive}\n              className={\n                isActive\n                  ? \"bg-foreground text-background rounded-full px-3 py-1.5 text-xs font-semibold\"\n                  : \"text-muted-foreground hover:text-foreground rounded-full px-3 py-1.5 text-xs font-semibold\"\n              }\n              onClick={() => setActiveId(variant.id)}\n            >\n              {variant.label}\n            </button>\n          )\n        })}\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}