{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "color-panels-newsletter",
  "title": "Color Panels Newsletter",
  "description": "A compact newsletter signup band with slowly turning glass panels beside the form.",
  "dependencies": [
    "@paper-design/shaders-react",
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "input"
  ],
  "files": [
    {
      "path": "registry/shaders/color-panels-newsletter/color-panels-newsletter.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ColorPanels } from \"@paper-design/shaders-react\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\n\ntype ColorPanelsNewsletterProps = React.ComponentProps<\"section\"> & {\n  eyebrow?: string\n  title?: string\n  description?: string\n  /** Small print shown under the form. */\n  note?: string\n  /**\n   * Called with the email when someone subscribes. Throw to show an error.\n   * Works with server actions.\n   */\n  onSubscribe?: (email: string) => void | Promise<void>\n  colors?: string[]\n  speed?: number\n}\n\nfunction ColorPanelsNewsletter({\n  eyebrow = \"Newsletter\",\n  title = \"Stay in the loop\",\n  description = \"One email a month with new components, behind-the-scenes notes and nothing else.\",\n  note = \"No spam. Unsubscribe anytime.\",\n  onSubscribe,\n  colors = [\"#00cfff\", \"#ff2d55\", \"#34c759\", \"#af52de\"],\n  speed = 0.4,\n  className,\n  ...props\n}: ColorPanelsNewsletterProps) {\n  const [state, setState] = React.useState<\n    \"idle\" | \"pending\" | \"subscribed\" | \"error\"\n  >(\"idle\")\n  const [email, setEmail] = React.useState(\"\")\n\n  return (\n    <section\n      data-slot=\"color-panels-newsletter\"\n      className={cn(\n        \"flex w-full flex-col justify-center px-6 py-12\",\n        className\n      )}\n      {...props}\n    >\n      <div className=\"mx-auto grid w-full max-w-5xl overflow-hidden border bg-card text-card-foreground md:grid-cols-[1fr_20rem]\">\n        <div className=\"flex flex-col gap-5 p-8 sm:p-10\">\n          <div className=\"flex flex-col gap-2\">\n            <span className=\"font-mono text-[11px] tracking-widest text-muted-foreground uppercase\">\n              {eyebrow}\n            </span>\n            <h2 className=\"font-heading text-2xl leading-tight tracking-tight text-balance sm:text-3xl\">\n              {title}\n            </h2>\n            <p className=\"max-w-md text-sm text-pretty text-muted-foreground\">\n              {description}\n            </p>\n          </div>\n          {state === \"subscribed\" ? (\n            <p\n              role=\"status\"\n              className=\"flex w-fit items-center gap-2 border bg-muted/50 px-4 py-3 text-sm\"\n            >\n              <CheckIcon className=\"size-4 shrink-0\" />\n              Thanks! Check {email} to confirm your subscription.\n            </p>\n          ) : (\n            <form\n              className=\"flex w-full max-w-md flex-col gap-2 sm:flex-row\"\n              onSubmit={async (event) => {\n                event.preventDefault()\n                setState(\"pending\")\n                try {\n                  await onSubscribe?.(email)\n                  setState(\"subscribed\")\n                } catch {\n                  setState(\"error\")\n                }\n              }}\n            >\n              <Input\n                type=\"email\"\n                name=\"email\"\n                autoComplete=\"email\"\n                aria-label=\"Email\"\n                placeholder=\"you@example.com\"\n                required\n                value={email}\n                onChange={(event) => setEmail(event.target.value)}\n                className=\"h-10 text-sm md:text-sm\"\n              />\n              <Button\n                type=\"submit\"\n                size=\"lg\"\n                disabled={state === \"pending\"}\n                className=\"h-10 px-4\"\n              >\n                {state === \"pending\" ? \"Subscribing…\" : \"Subscribe\"}\n              </Button>\n            </form>\n          )}\n          {state === \"error\" ? (\n            <p role=\"alert\" className=\"text-xs text-destructive\">\n              Something went wrong. Please try again.\n            </p>\n          ) : (\n            state !== \"subscribed\" &&\n            note && <p className=\"text-xs text-muted-foreground\">{note}</p>\n          )}\n        </div>\n        {/*\n          The panels are drawn on a transparent background, so they pick up the\n          card color and work in both light and dark themes.\n        */}\n        <div\n          aria-hidden\n          className=\"relative min-h-44 border-t md:border-t-0 md:border-l\"\n        >\n          <ColorPanels\n            className=\"absolute inset-0 size-full\"\n            colors={colors}\n            colorBack=\"#00000000\"\n            angle1={0.3}\n            angle2={0.3}\n            length={1}\n            edges\n            blur={0.25}\n            fadeIn={0.85}\n            fadeOut={0.3}\n            density={1.6}\n            rotation={112}\n            scale={0.85}\n            speed={speed}\n          />\n        </div>\n      </div>\n    </section>\n  )\n}\n\nexport { ColorPanelsNewsletter }\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "sections",
    "newsletter"
  ],
  "type": "registry:block"
}