{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cookie-01",
  "title": "Cookie 01",
  "description": "A floating cookie consent card with accept button and learn more link",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "card"
  ],
  "files": [
    {
      "path": "src/registry/blocks/cookie-01/cookie.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { Cookie } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent } from \"@/components/ui/card\";\n\ninterface Cookie01Props {\n  description?: string;\n  learnMore?: {\n    text?: string;\n    url?: string;\n  };\n  acceptButton?: {\n    text?: string;\n  };\n  declineButton?: {\n    text?: string;\n  };\n  className?: string;\n}\n\nconst Cookie01 = ({\n  description = \"We use third-party cookies to personalize content, ads, and analyze site traffic.\",\n  learnMore = {\n    text: \"Learn more\",\n    url: \"#\",\n  },\n  acceptButton = {\n    text: \"Accept\",\n  },\n  declineButton = {\n    text: \"Decline\",\n  },\n  className,\n}: Cookie01Props) => {\n  const [visible, setVisible] = useState(true);\n\n  if (!visible) return null;\n\n  return (\n    <div\n      className={cn(\n        \"fixed bottom-0 z-50 w-full p-4 sm:right-4 sm:w-92\",\n        className,\n      )}\n    >\n      <Card className=\"rounded-md shadow-none\">\n        <CardContent className=\"flex flex-col items-center gap-5 p-6 text-center\">\n          <Cookie className=\"size-10 text-primary\" strokeWidth={1.5} />\n          <div className=\"flex flex-col items-center gap-2\">\n            <p className=\"text-sm text-muted-foreground\">{description}</p>\n            {learnMore && (\n              <a\n                href={learnMore.url}\n                className=\"text-sm font-medium underline underline-offset-4 transition-colors hover:text-muted-foreground\"\n              >\n                {learnMore.text}\n              </a>\n            )}\n          </div>\n          <div className=\"flex w-full gap-3\">\n            <Button className=\"flex-1\" onClick={() => setVisible(false)}>\n              {acceptButton.text}\n            </Button>\n            <Button\n              variant=\"outline\"\n              className=\"flex-1\"\n              onClick={() => setVisible(false)}\n            >\n              {declineButton.text}\n            </Button>\n          </div>\n        </CardContent>\n      </Card>\n    </div>\n  );\n};\n\nexport default Cookie01;\n",
      "type": "registry:component",
      "target": "components/cookie-01.tsx"
    }
  ],
  "meta": {
    "image": "/r/previews/cookie-01.webp",
    "imageDark": "/r/previews/cookie-01-dark.webp",
    "prose": {
      "about": "Cookie 01 is a floating cookie-consent card fixed to a corner of the viewport, with an accept button and a learn-more link to your privacy policy. Built with shadcn/ui Button and Card components, it renders on top of page content without blocking interaction elsewhere on the page.",
      "whenToUse": [
        "Any site serving EU or UK visitors where GDPR/ePrivacy cookie consent is required",
        "Products that set analytics or marketing cookies and need a visible opt-in before doing so",
        "Sites that want a lightweight, non-blocking consent pattern instead of a full-page modal",
        "Projects where the consent choice needs to persist across page loads"
      ],
      "notes": "The component doesn't persist the accept choice by itself — store it in localStorage or a cookie after the accept handler fires, and check that value before rendering the card again.",
      "faqs": [
        {
          "question": "Does Cookie 01 block cookies until the user accepts?",
          "answer": "No, it's a UI-only consent prompt — you still need to gate your analytics/marketing scripts behind the accept event yourself for actual compliance."
        },
        {
          "question": "Does it remember the user's choice after they accept?",
          "answer": "Not by default. Persist the choice in localStorage or a cookie in the accept handler, and check that value before rendering the card on future page loads."
        },
        {
          "question": "Can I link it to my own privacy policy page?",
          "answer": "Yes, the learn-more link URL is a prop — point it at your /legal or /privacy page."
        }
      ]
    }
  },
  "categories": [
    "cookie"
  ],
  "type": "registry:block"
}