{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ecommerce-14",
  "type": "registry:block",
  "description": "Shop-the-room scene with clickable hotspots on an SVG interior linked to a product list and bundle price.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/ecommerce/ecommerce-14.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  Plus,\n} from \"@designali/icons\"\n\nimport { Button } from \"@workspace/ui/components/button\"\nimport { cn } from \"@workspace/ui/lib/utils\"\nimport { IPad } from \"@/registry/designali/ui/apple/ipad\"\nimport { IPhone } from \"@/registry/designali/ui/apple/iphone\"\nimport { Macbook } from \"@/registry/designali/ui/apple/macbook\"\nimport { StudioDisplay } from \"@/registry/designali/ui/apple/studio-display\"\nimport { GridPattern } from \"@/registry/designali/ui/grid-pattern\"\n\nconst hotspots = [\n  { id: \"lamp\", name: \"iPhone Mockup\", price: 19, detail: \"PNG + Figma, light and dark\", x: 18, y: 38 },\n  { id: \"sofa\", name: \"MacBook Mockup\", price: 29, detail: \"Next.js component + Figma\", x: 52, y: 66 },\n  { id: \"art\", name: \"Studio Display Mockup\", price: 25, detail: \"5K frame, React component\", x: 54, y: 24 },\n  { id: \"plant\", name: \"iPad Mockup\", price: 19, detail: \"Portrait and landscape\", x: 86, y: 62 },\n]\n\nexport default function Ecommerce14() {\n  const [active, setActive] = useState<string>(\"sofa\")\n  const [cart, setCart] = useState<string[]>([])\n  const current = hotspots.find((h) => h.id === active)\n  const total = hotspots.reduce((s, h) => s + h.price, 0)\n\n  return (\n    <section className=\"w-full bg-background py-16 text-foreground md:py-24\">\n      <div className=\"mx-auto max-w-6xl px-6\">\n        <div className=\"grid gap-8 lg:grid-cols-[1.6fr_1fr]\">\n          <div className=\"relative aspect-[4/3] overflow-hidden border border-border bg-gradient-to-b from-muted to-border dark:from-card dark:to-card\">\n            <GridPattern className=\"[mask-image:linear-gradient(to_bottom,white,transparent)]\" />\n            <div className=\"absolute top-[4%] left-1/2 w-[46%] -translate-x-1/2\">\n              <StudioDisplay color=\"light\" size=\"sm\" className=\"h-auto! w-full! max-w-full\">\n                <img src=\"/images/templates/design-agency.jpg\" alt=\"Studio Display mockup\" className=\"size-full object-cover object-top\" />\n              </StudioDisplay>\n            </div>\n            <div className=\"absolute bottom-[3%] left-1/2 w-[50%] -translate-x-1/2\">\n              <Macbook variant=\"macbook-pro\" color=\"silver\" size=\"sm\" className=\"w-full! max-w-full\">\n                <img src=\"/img/dashboard-1-light.jpg\" alt=\"MacBook mockup\" className=\"size-full object-cover object-top\" />\n              </Macbook>\n            </div>\n            <div className=\"absolute top-[18%] left-[6%] w-[14%]\">\n              <IPhone size=\"sm\" color=\"silver\" className=\"h-auto! w-full! max-w-full\">\n                <img src=\"/img/chat-1-light.jpg\" alt=\"iPhone mockup\" className=\"size-full object-cover object-top\" />\n              </IPhone>\n            </div>\n            <div className=\"absolute right-[4%] bottom-[12%] w-[22%]\">\n              <IPad variant=\"ipad-pro\" color=\"silver\" size=\"sm\" className=\"h-auto! w-full! max-w-full\">\n                <img src=\"/images/templates/portfolio-simple.jpg\" alt=\"iPad mockup\" className=\"size-full object-cover object-top\" />\n              </IPad>\n            </div>\n\n            {hotspots.map((h) => (\n              <button\n                key={h.id}\n                type=\"button\"\n                onClick={() => setActive(h.id)}\n                aria-label={`Show ${h.name}`}\n                aria-pressed={active === h.id}\n                className=\"absolute z-20 -translate-x-1/2 -translate-y-1/2\"\n                style={{ left: `${h.x}%`, top: `${h.y}%` }}\n              >\n                <span\n                  className={cn(\n                    \"relative flex size-8 items-center justify-center rounded-full border-2 border-white shadow-lg transition-all\",\n                    active === h.id ? \"scale-110 bg-foreground text-background\" : \"bg-white/90 text-black\"\n                  )}\n                >\n                  {active !== h.id && (\n                    <span className=\"absolute inset-0 animate-ping rounded-full bg-white/60\" />\n                  )}\n                  <Plus className={cn(\"relative size-4 transition-transform\", active === h.id && \"rotate-45\")} />\n                </span>\n              </button>\n            ))}\n          </div>\n\n          <div className=\"flex flex-col\">\n            <p className=\"text-xs tracking-widest text-muted-foreground uppercase\">Shop the mockups</p>\n            <h2 className=\"mt-2 text-3xl font-medium tracking-tight\">The Designali Mockup Set</h2>\n            <p className=\"mt-2 text-sm text-muted-foreground\">\n              Tap a marker to see each Apple device mockup. Buy them together and save 10%.\n            </p>\n\n            <ul className=\"mt-6 divide-y divide-border border-y border-border\">\n              {hotspots.map((h) => {\n                const added = cart.includes(h.id)\n                return (\n                  <li key={h.id}>\n                    <div\n                      className={cn(\n                        \"flex items-center gap-3 py-3 transition-colors\",\n                        active === h.id ? \"text-foreground\" : \"text-muted-foreground\"\n                      )}\n                    >\n                      <button type=\"button\" onClick={() => setActive(h.id)} className=\"flex flex-1 items-center gap-3 text-left\">\n                        <span\n                          className={cn(\n                            \"size-2 shrink-0 rounded-full\",\n                            active === h.id ? \"bg-foreground\" : \"bg-border\"\n                          )}\n                        />\n                        <span className=\"flex-1\">\n                          <span className=\"block text-sm font-medium\">{h.name}</span>\n                          {active === h.id && current && (\n                            <span className=\"block text-xs text-muted-foreground\">{current.detail}</span>\n                          )}\n                        </span>\n                        <span className=\"text-sm tabular-nums\">${h.price.toLocaleString()}</span>\n                      </button>\n                      <Button\n                        size=\"sm\"\n                        variant={added ? \"secondary\" : \"outline\"}\n                        onClick={() =>\n                          setCart((c) => (c.includes(h.id) ? c.filter((x) => x !== h.id) : [...c, h.id]))\n                        }\n                      >\n                        {added ? \"Added\" : \"Add\"}\n                      </Button>\n                    </div>\n                  </li>\n                )\n              })}\n            </ul>\n\n            <div className=\"mt-auto pt-6\">\n              <div className=\"flex items-baseline justify-between text-sm\">\n                <span className=\"text-muted-foreground\">Complete the set</span>\n                <span>\n                  <span className=\"mr-2 text-muted-foreground line-through tabular-nums\">${total.toLocaleString()}</span>\n                  <span className=\"text-lg font-medium tabular-nums\">${Math.round(total * 0.9).toLocaleString()}</span>\n                </span>\n              </div>\n              <Button size=\"lg\" className=\"mt-4 w-full\" onClick={() => setCart(hotspots.map((h) => h.id))}>\n                Add all 4 mockups\n              </Button>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "750px"
  },
  "categories": [
    "ecommerce"
  ]
}