{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "store-01",
  "title": "Store Product",
  "author": "VenusUI",
  "description": "A product page with a zoomable gallery, options, quantity and add to bag.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/default/blocks/store-01/components/store-01.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Check, Minus, Plus, RotateCcw, ShieldCheck, Truck } from \"lucide-react\"\n\nimport { Button } from \"@/components/ui/button\"\nimport { cn } from \"@/lib/utils\"\n\n// Photo: Unsplash (free under the Unsplash License). The product is made up.\nconst PHOTO = \"https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=1200&h=1200&fit=crop&auto=format&q=80\"\n\nconst views = [\n  { label: \"Whole product\", alt: \"Black over-ear headphones on a yellow background\", zoom: 1, origin: \"50% 50%\" },\n  { label: \"Ear cup detail\", alt: \"Close-up of the padded ear cup\", zoom: 2.1, origin: \"48% 72%\" },\n  { label: \"Headband detail\", alt: \"Close-up of the curved headband\", zoom: 2.1, origin: \"52% 18%\" },\n]\nconst pads = [\n  { name: \"Memory foam\", extra: 0 },\n  { name: \"Lambskin\", extra: 30 },\n]\nconst promises = [\n  { icon: Truck, text: \"Free delivery in 2 to 4 days\" },\n  { icon: RotateCcw, text: \"30-day returns\" },\n  { icon: ShieldCheck, text: \"2-year warranty\" },\n]\nconst PRICE = 249\n\n/** A product page: zoomable gallery, options, quantity and add to bag. */\nexport function Store01() {\n  const [view, setView] = React.useState(0)\n  const [pad, setPad] = React.useState(0)\n  const [quantity, setQuantity] = React.useState(1)\n  const [inBag, setInBag] = React.useState(0)\n  const name = React.useId()\n  const current = views[view]\n  const unit = PRICE + pads[pad].extra\n\n  return (\n    <section aria-labelledby=\"store-01-title\" className=\"py-24 sm:py-28\">\n      <div className=\"mx-auto grid max-w-6xl gap-10 px-4 sm:px-6 lg:grid-cols-2 lg:gap-16\">\n        <div className=\"flex flex-col-reverse gap-3 sm:flex-row\">\n          <div role=\"group\" aria-label=\"Product views\" className=\"flex gap-3 sm:flex-col\">\n            {views.map((item, i) => (\n              <button\n                key={item.label}\n                type=\"button\"\n                aria-pressed={view === i}\n                aria-label={item.label}\n                onClick={() => setView(i)}\n                className={cn(\"size-16 overflow-hidden rounded-lg outline-none ring-1 ring-border focus-visible:ring-3 focus-visible:ring-ring/50\", view === i && \"ring-2 ring-foreground\")}\n              >\n                <img src={PHOTO} alt=\"\" className=\"size-full object-cover\" style={{ transform: `scale(${item.zoom})`, transformOrigin: item.origin }} />\n              </button>\n            ))}\n          </div>\n          <div className=\"aspect-square min-w-0 flex-1 overflow-hidden rounded-2xl bg-muted\">\n            <img src={PHOTO} alt={current.alt} className=\"size-full object-cover transition-transform duration-500 ease-out motion-reduce:transition-none\" style={{ transform: `scale(${current.zoom})`, transformOrigin: current.origin }} />\n          </div>\n        </div>\n\n        <div>\n          <p className=\"text-sm text-muted-foreground\">Fieldnote Audio</p>\n          <h2 id=\"store-01-title\" className=\"mt-1 text-3xl font-semibold tracking-tight sm:text-4xl\">\n            Studio One headphones\n          </h2>\n          <p className=\"mt-3 font-mono text-xl tabular-nums\">${unit}</p>\n          <p className=\"mt-5 leading-7 text-muted-foreground\">Closed-back, hand-tuned drivers in a frame light enough to forget. Made for long sessions and quiet rooms.</p>\n\n          <fieldset className=\"mt-7\">\n            <legend className=\"text-sm font-medium\">Ear pads</legend>\n            <div className=\"mt-2 grid grid-cols-2 gap-2\">\n              {pads.map((item, i) => (\n                <label key={item.name} className=\"cursor-pointer\">\n                  <input type=\"radio\" name={name} className=\"peer sr-only\" checked={pad === i} onChange={() => setPad(i)} />\n                  <span className=\"flex items-baseline justify-between gap-2 rounded-lg border px-3 py-2.5 text-sm peer-checked:border-foreground peer-checked:ring-1 peer-checked:ring-foreground peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50\">\n                    {item.name}\n                    <span className=\"text-xs text-muted-foreground\">{item.extra ? `+$${item.extra}` : \"Included\"}</span>\n                  </span>\n                </label>\n              ))}\n            </div>\n          </fieldset>\n\n          <div className=\"mt-6 flex flex-wrap items-center gap-3\">\n            <div role=\"group\" aria-label=\"Quantity\" className=\"flex items-center rounded-lg border\">\n              <Button type=\"button\" variant=\"ghost\" size=\"icon\" aria-label=\"Decrease quantity\" disabled={quantity === 1} onClick={() => setQuantity(quantity - 1)}>\n                <Minus aria-hidden=\"true\" className=\"size-4\" />\n              </Button>\n              <output aria-live=\"polite\" className=\"w-8 text-center text-sm tabular-nums\">\n                {quantity}\n              </output>\n              <Button type=\"button\" variant=\"ghost\" size=\"icon\" aria-label=\"Increase quantity\" disabled={quantity === 9} onClick={() => setQuantity(quantity + 1)}>\n                <Plus aria-hidden=\"true\" className=\"size-4\" />\n              </Button>\n            </div>\n            <Button type=\"button\" size=\"lg\" className=\"min-w-44 flex-1\" onClick={() => setInBag(inBag + quantity)}>\n              Add to bag · ${unit * quantity}\n            </Button>\n          </div>\n          <p role=\"status\" className=\"mt-2 flex min-h-5 items-center gap-1.5 text-sm text-muted-foreground\">\n            {inBag > 0 ? (\n              <>\n                <Check aria-hidden=\"true\" className=\"size-4\" />\n                {inBag} in your bag\n              </>\n            ) : null}\n          </p>\n\n          <ul className=\"mt-5 space-y-2 border-t pt-5 text-sm text-muted-foreground\">\n            {promises.map((item) => (\n              <li key={item.text} className=\"flex items-center gap-2.5\">\n                <item.icon aria-hidden=\"true\" className=\"size-4\" />\n                {item.text}\n              </li>\n            ))}\n          </ul>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "version": "0.1.0"
  },
  "categories": [
    "content"
  ],
  "type": "registry:block"
}