{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "store-locator-map",
  "title": "Store Locator Map",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-vue/blocks/store-locator-map/StoreLocatorMap.vue",
      "content": "<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue'\nimport { computed, ref } from 'vue'\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 {\n  class?: HTMLAttributes['class']\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\nconst props = withDefaults(defineProps<StoreLocatorMapProps>(), {\n  accessToken: '',\n})\n\nconst stores = computed(() => props.stores ?? DEFAULT_STORES)\nconst selectedId = ref(DEFAULT_STORES[0]?.id ?? '')\n\nlet mapboxInstance: any = null\nfunction onMapCreated(map: any) {\n  mapboxInstance = map\n}\n\nfunction selectStore(store: RetailStore) {\n  selectedId.value = store.id\n  mapboxInstance?.flyTo?.({\n    center: [store.lng, store.lat],\n    zoom: 12.5,\n    essential: true,\n    duration: 900,\n  })\n}\n</script>\n\n<template>\n  <div data-slot=\"store-locator-map\" :class=\"cn('flex h-full min-h-0 flex-col gap-4', props.class)\">\n    <div class=\"flex flex-wrap items-center justify-between gap-3\">\n      <h2 class=\"text-foreground text-lg font-semibold tracking-tight\">Stores</h2>\n      <p class=\"text-muted-foreground text-xs\">\n        {{ stores.filter((s) => s.isOpen).length }} open · {{ stores.length }} locations\n      </p>\n    </div>\n\n    <div class=\"grid min-h-0 flex-1 grid-cols-1 gap-4 lg:grid-cols-12\">\n      <Card class=\"border-border flex min-h-0 flex-col overflow-hidden shadow-xs lg:col-span-8\">\n        <div class=\"relative min-h-[360px] flex-1 overflow-hidden\">\n          <Map\n            :access-token=\"accessToken\"\n            variant=\"dark\"\n            :center=\"[10, 20]\"\n            :zoom=\"1.5\"\n            class=\"absolute inset-0 size-full\"\n            @created=\"onMapCreated\"\n          >\n            <MapMarker v-for=\"store in stores\" :key=\"store.id\" :lng-lat=\"[store.lng, store.lat]\" anchor=\"center\">\n              <button\n                type=\"button\"\n                class=\"rounded-full border px-2 py-0.5 text-xs font-semibold shadow-xs\"\n                :class=\"\n                  selectedId === store.id\n                    ? 'border-primary bg-primary text-primary-foreground'\n                    : 'border-border bg-card text-foreground'\n                \"\n                @click.stop=\"selectStore(store)\"\n              >\n                {{ store.city }}\n              </button>\n            </MapMarker>\n          </Map>\n        </div>\n      </Card>\n\n      <Card class=\"border-border flex min-h-0 flex-col overflow-hidden shadow-xs lg:col-span-4\">\n        <CardHeader class=\"border-border border-b p-4\">\n          <CardTitle class=\"text-sm font-semibold\">Locations</CardTitle>\n        </CardHeader>\n        <CardContent class=\"divide-border min-h-0 flex-1 divide-y overflow-auto p-0\">\n          <button\n            v-for=\"store in stores\"\n            :key=\"store.id\"\n            type=\"button\"\n            :class=\"\n              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            \"\n            @click=\"selectStore(store)\"\n          >\n            <div class=\"min-w-0\">\n              <p class=\"text-foreground truncate text-sm font-medium\">{{ store.name }}</p>\n              <p class=\"text-muted-foreground truncate text-xs\">{{ store.city }}, {{ store.country }}</p>\n            </div>\n            <Badge :variant=\"store.isOpen ? 'info' : 'secondary'\" class=\"shrink-0 text-xs\">\n              {{ store.isOpen ? 'Open' : 'Closed' }}\n            </Badge>\n          </button>\n        </CardContent>\n      </Card>\n    </div>\n  </div>\n</template>\n",
      "type": "registry:block",
      "target": "~/app/components/blocks/StoreLocatorMap.vue"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/vue/badge.json",
    "https://uipkge.dev/r/vue/card.json",
    "https://uipkge.dev/r/vue/map.json"
  ],
  "description": "Store locator. Map pins plus a compact list with open/closed status and fly-to on select.",
  "categories": [
    "dashboard",
    "app",
    "ecommerce"
  ]
}