{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "location-03",
  "type": "registry:block",
  "description": "A store finder with a searchable list of locations and a map panel.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "input"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/location/location-03.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  MapPin,\n  Search,\n} from \"@designali/icons\"\n\nimport { Input } from \"@workspace/ui/components/input\"\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nimport { GridPattern } from \"@/registry/designali/ui/grid-pattern\"\n\nconst stores = [\n  {\n    name: \"Americas\",\n    address: \"Remote · UTC−8 to UTC−3\",\n    distance: \"Async\",\n    open: true,\n    x: 38,\n    y: 42,\n  },\n  {\n    name: \"Europe\",\n    address: \"Remote · UTC to UTC+3\",\n    distance: \"Live\",\n    open: true,\n    x: 46,\n    y: 66,\n  },\n  {\n    name: \"Middle East\",\n    address: \"Remote · UTC+3 to UTC+4\",\n    distance: \"Live\",\n    open: false,\n    x: 64,\n    y: 18,\n  },\n  {\n    name: \"Asia Pacific\",\n    address: \"Remote · UTC+5:30 to UTC+10\",\n    distance: \"Live\",\n    open: true,\n    x: 16,\n    y: 56,\n  },\n]\n\nexport default function Location03() {\n  const [active, setActive] = useState(0)\n  const [query, setQuery] = useState(\"\")\n  const results = stores.filter((store) =>\n    `${store.name} ${store.address}`.toLowerCase().includes(query.toLowerCase())\n  )\n\n  return (\n    <section className=\"w-full bg-background\">\n      <div className=\"mx-auto grid max-w-7xl border-y md:h-[640px] md:grid-cols-[380px_1fr] md:border-x\">\n        <aside className=\"flex flex-col border-b md:border-e md:border-b-0\">\n          <div className=\"space-y-4 border-b p-6\">\n            <h2 className=\"text-2xl font-semibold tracking-tight\">\n              Designali time zones\n            </h2>\n            <div className=\"relative\">\n              <Search className=\"absolute start-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground\" />\n              <Input\n                value={query}\n                onChange={(event) => setQuery(event.target.value)}\n                placeholder=\"Search by region\"\n                className=\"h-10 ps-9\"\n              />\n            </div>\n          </div>\n          <ul className=\"flex-1 divide-y overflow-y-auto\">\n            {results.map((store) => {\n              const index = stores.indexOf(store)\n              return (\n                <li key={store.name}>\n                  <button\n                    type=\"button\"\n                    onClick={() => setActive(index)}\n                    className={cn(\n                      \"flex w-full items-start gap-3 p-6 text-start transition-colors hover:bg-muted/50\",\n                      active === index && \"bg-muted\"\n                    )}\n                  >\n                    <MapPin className=\"mt-0.5 size-4 shrink-0\" />\n                    <span className=\"flex-1\">\n                      <span className=\"block font-medium\">{store.name}</span>\n                      <span className=\"block text-sm text-muted-foreground\">\n                        {store.address}\n                      </span>\n                      <span\n                        className={cn(\n                          \"mt-2 block text-xs\",\n                          store.open ? \"text-primary\" : \"text-muted-foreground\"\n                        )}\n                      >\n                        {store.open ? \"Available now\" : \"Offline · replies within 24h\"}\n                      </span>\n                    </span>\n                    <span className=\"text-xs text-muted-foreground\">\n                      {store.distance}\n                    </span>\n                  </button>\n                </li>\n              )\n            })}\n            {results.length === 0 && (\n              <li className=\"p-6 text-sm text-muted-foreground\">\n                No regions match &ldquo;{query}&rdquo;.\n              </li>\n            )}\n          </ul>\n        </aside>\n\n        <div className=\"relative min-h-96 overflow-hidden bg-muted\">\n          <GridPattern width={48} height={48} className=\"stroke-border\" />\n          {stores.map((store, index) => (\n            <button\n              key={store.name}\n              type=\"button\"\n              onClick={() => setActive(index)}\n              style={{ left: `${store.x}%`, top: `${store.y}%` }}\n              className=\"absolute -translate-x-1/2 -translate-y-1/2\"\n              aria-label={store.name}\n            >\n              <span\n                className={cn(\n                  \"flex size-4 items-center justify-center rounded-full border-2 border-background transition-transform\",\n                  active === index\n                    ? \"scale-150 bg-primary ring-8 ring-primary/20\"\n                    : \"bg-foreground/60\"\n                )}\n              />\n            </button>\n          ))}\n          <div className=\"absolute end-4 bottom-4 border bg-background p-4 text-sm shadow-sm\">\n            <p className=\"font-medium\">{stores[active]?.name}</p>\n            <p className=\"text-muted-foreground\">{stores[active]?.address}</p>\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "800px"
  },
  "categories": [
    "location"
  ]
}