{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "store-locator-map",
  "title": "Store Locator Map",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-react/blocks/store-locator-map/StoreLocatorMap.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { cn } from '@/lib/utils'\nimport { Badge } from '@/components/ui/badge'\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'\nimport { Map, MapMarker } from '@/components/ui/map'\n\nexport interface RetailStore {\n  id: string\n  name: string\n  city: string\n  country: string\n  lat: number\n  lng: number\n  isOpen: boolean\n}\n\nexport interface StoreLocatorMapProps extends React.HTMLAttributes<HTMLDivElement> {\n  accessToken?: string\n  stores?: RetailStore[]\n}\n\nconst DEFAULT_STORES: RetailStore[] = [\n  {\n    id: 'nyc-soho',\n    name: 'SoHo Flagship',\n    city: 'New York',\n    country: 'United States',\n    lat: 40.7248,\n    lng: -73.9984,\n    isOpen: true,\n  },\n  {\n    id: 'lon-regent',\n    name: 'Regent Street',\n    city: 'London',\n    country: 'United Kingdom',\n    lat: 51.5142,\n    lng: -0.1418,\n    isOpen: true,\n  },\n  { id: 'tyo-ginza', name: 'Ginza Studio', city: 'Tokyo', country: 'Japan', lat: 35.6719, lng: 139.7658, isOpen: true },\n  {\n    id: 'par-champs',\n    name: 'Champs-Élysées',\n    city: 'Paris',\n    country: 'France',\n    lat: 48.8718,\n    lng: 2.3013,\n    isOpen: true,\n  },\n  {\n    id: 'syd-george',\n    name: 'George Street',\n    city: 'Sydney',\n    country: 'Australia',\n    lat: -33.8688,\n    lng: 151.2093,\n    isOpen: false,\n  },\n]\n\nexport function StoreLocatorMap({\n  className,\n  accessToken = '',\n  stores = DEFAULT_STORES,\n  ...props\n}: StoreLocatorMapProps) {\n  const [selectedId, setSelectedId] = React.useState(stores[0]?.id ?? '')\n  const mapRef = React.useRef<any>(null)\n\n  const selectStore = (store: RetailStore) => {\n    setSelectedId(store.id)\n    mapRef.current?.flyTo?.({\n      center: [store.lng, store.lat],\n      zoom: 12.5,\n      essential: true,\n      duration: 900,\n    })\n  }\n\n  return (\n    <div data-slot=\"store-locator-map\" className={cn('flex h-full min-h-0 flex-col gap-4', className)} {...props}>\n      <div className=\"flex flex-wrap items-center justify-between gap-3\">\n        <h2 className=\"text-foreground text-lg font-semibold tracking-tight\">Stores</h2>\n        <p className=\"text-muted-foreground text-xs\">\n          {stores.filter((s) => s.isOpen).length} open · {stores.length} locations\n        </p>\n      </div>\n\n      <div className=\"grid min-h-0 flex-1 grid-cols-1 gap-4 lg:grid-cols-12\">\n        <Card className=\"border-border flex min-h-0 flex-col overflow-hidden shadow-xs lg:col-span-8\">\n          <div className=\"relative min-h-[360px] flex-1 overflow-hidden\">\n            <Map\n              accessToken={accessToken}\n              variant=\"dark\"\n              center={[10, 20]}\n              zoom={1.5}\n              className=\"absolute inset-0 size-full\"\n              onCreated={(map) => {\n                mapRef.current = map\n              }}\n            >\n              {stores.map((store) => (\n                <MapMarker key={store.id} longitude={store.lng} latitude={store.lat} anchor=\"center\">\n                  <button\n                    type=\"button\"\n                    className={\n                      selectedId === store.id\n                        ? 'border-primary bg-primary text-primary-foreground rounded-full border px-2 py-0.5 text-xs font-semibold shadow-xs'\n                        : 'border-border bg-card text-foreground rounded-full border px-2 py-0.5 text-xs font-semibold shadow-xs'\n                    }\n                    onClick={() => selectStore(store)}\n                  >\n                    {store.city}\n                  </button>\n                </MapMarker>\n              ))}\n            </Map>\n          </div>\n        </Card>\n\n        <Card className=\"border-border flex min-h-0 flex-col overflow-hidden shadow-xs lg:col-span-4\">\n          <CardHeader className=\"border-border border-b p-4\">\n            <CardTitle className=\"text-sm font-semibold\">Locations</CardTitle>\n          </CardHeader>\n          <CardContent className=\"divide-border min-h-0 flex-1 divide-y overflow-auto p-0\">\n            {stores.map((store) => (\n              <button\n                key={store.id}\n                type=\"button\"\n                className={cn(\n                  'hover:bg-accent/50 flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition-colors',\n                  selectedId === store.id && 'bg-accent/60',\n                )}\n                onClick={() => selectStore(store)}\n              >\n                <div className=\"min-w-0\">\n                  <p className=\"text-foreground truncate text-sm font-medium\">{store.name}</p>\n                  <p className=\"text-muted-foreground truncate text-xs\">\n                    {store.city}, {store.country}\n                  </p>\n                </div>\n                <Badge variant={store.isOpen ? 'info' : 'secondary'} className=\"shrink-0 text-xs\">\n                  {store.isOpen ? 'Open' : 'Closed'}\n                </Badge>\n              </button>\n            ))}\n          </CardContent>\n        </Card>\n      </div>\n    </div>\n  )\n}\n\nexport default StoreLocatorMap\n",
      "type": "registry:block",
      "target": "~/components/blocks/StoreLocatorMap.tsx"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/react/badge.json",
    "https://uipkge.dev/r/react/card.json",
    "https://uipkge.dev/r/react/map.json"
  ],
  "description": "Store locator. Map pins plus a compact list with open/closed status and fly-to on select.",
  "categories": [
    "dashboard",
    "app",
    "ecommerce"
  ]
}