{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cookie-consent-preferences",
  "title": "Cookie Consent — Preferences",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/cookie-consent-preferences/CookieConsentPreferences.tsx",
      "content": "'use client'\n\nimport { useState } from 'react'\nimport { Lock } from 'lucide-react'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogTitle,\n} from '@/components/ui/dialog'\nimport { Separator } from '@/components/ui/separator'\nimport { Switch } from '@/components/ui/switch'\n\nconst categories = [\n  {\n    id: 'necessary',\n    label: 'Strictly necessary',\n    purpose: 'Session and sign-in state. Without these the app cannot keep you logged in.',\n    retention: 'Session',\n    locked: true,\n  },\n  {\n    id: 'analytics',\n    label: 'Product analytics',\n    purpose: 'Which pages are read and where people give up. Aggregated, never sold.',\n    retention: '13 months',\n    locked: false,\n  },\n  {\n    id: 'support',\n    label: 'Support chat',\n    purpose: 'Keeps a conversation open across page loads so you do not repeat yourself.',\n    retention: '30 days',\n    locked: false,\n  },\n]\n\nexport function CookieConsentPreferences() {\n  const [open, setOpen] = useState(true)\n  const [choices, setChoices] = useState<Record<string, boolean>>({\n    necessary: true,\n    analytics: false,\n    support: false,\n  })\n\n  return (\n    <div data-slot=\"cookie-consent-preferences\">\n      <Dialog open={open} onOpenChange={setOpen}>\n        <DialogContent className=\"sm:max-w-lg\">\n          <DialogHeader>\n            <Badge variant=\"secondary\" className=\"w-fit\">\n              Privacy\n            </Badge>\n            <DialogTitle className=\"mt-3 text-xl\">Choose what we store</DialogTitle>\n            <DialogDescription>\n              Each category says what it is for and how long it is kept. Nothing here is advertising.\n            </DialogDescription>\n          </DialogHeader>\n\n          <Separator />\n\n          <ul className=\"space-y-4\">\n            {categories.map((category) => (\n              <li key={category.id} className=\"flex items-start gap-4\">\n                <div className=\"min-w-0 flex-1\">\n                  <div className=\"flex flex-wrap items-center gap-2\">\n                    <p className=\"text-sm font-medium\">{category.label}</p>\n                    {category.locked && (\n                      <Badge variant=\"outline\" className=\"gap-1\">\n                        <Lock className=\"size-2.5\" aria-hidden=\"true\" />\n                        Required\n                      </Badge>\n                    )}\n                  </div>\n                  <p className=\"text-muted-foreground mt-1 text-xs leading-relaxed\">{category.purpose}</p>\n                  <p className=\"text-muted-foreground/80 mt-1 font-mono text-xs\">Kept {category.retention}</p>\n                </div>\n                <Switch\n                  checked={choices[category.id]}\n                  onCheckedChange={(value: boolean) => setChoices((c) => ({ ...c, [category.id]: value }))}\n                  disabled={category.locked}\n                  aria-label={`Allow ${category.label}`}\n                  className=\"mt-1 shrink-0\"\n                />\n              </li>\n            ))}\n          </ul>\n\n          <DialogFooter className=\"sm:justify-start\">\n            <Button onClick={() => setOpen(false)}>Save choices</Button>\n            <Button variant=\"outline\" onClick={() => setOpen(false)}>\n              Reject optional\n            </Button>\n          </DialogFooter>\n        </DialogContent>\n      </Dialog>\n    </div>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/CookieConsentPreferences.tsx"
    }
  ],
  "dependencies": [
    "lucide-react"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/button.json",
    "https://uipkge.dev/r/react/dialog.json",
    "https://uipkge.dev/r/react/separator.json",
    "https://uipkge.dev/r/react/switch.json"
  ],
  "description": "Granular consent dialog listing each cookie category with its purpose, retention, and a switch, with strictly-necessary shown as locked rather than hidden.",
  "categories": [
    "marketing"
  ],
  "deprecated": true,
  "replacedBy": "cookie-consent"
}