{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "map-preview",
  "title": "Map Preview",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/map-preview/MapPreview.tsx",
      "content": "import * as React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport MapView from 'react-native-maps'\nimport { cn } from '@/lib/utils'\nimport { MapPreviewFallback } from './MapPreviewFallback'\nimport type { MapPreviewProps } from './MapPreview.types'\n\nexport const MapPreview = React.forwardRef<React.ComponentRef<typeof MapView>, MapPreviewProps>(\n  (\n    {\n      className,\n      style,\n      testID,\n      available = true,\n      interactive = false,\n      fallback,\n      accessible,\n      accessibilityLabel = 'Map',\n      accessibilityRole,\n      accessibilityHint,\n      accessibilityElementsHidden,\n      importantForAccessibility,\n      scrollEnabled,\n      zoomEnabled,\n      rotateEnabled,\n      pitchEnabled,\n      showsMyLocationButton = false,\n      showsUserLocation = false,\n      ...props\n    },\n    ref,\n  ) => {\n    if (!available) return <MapPreviewFallback {...{ className, style, testID, fallback }} />\n\n    return (\n      <View\n        style={style}\n        accessible={interactive ? undefined : (accessible ?? true)}\n        accessibilityLabel={interactive ? undefined : accessibilityLabel}\n        accessibilityRole={interactive ? undefined : (accessibilityRole ?? 'image')}\n        accessibilityHint={interactive ? undefined : accessibilityHint}\n        className={cn('min-h-[240px] overflow-hidden rounded-lg border border-border bg-muted', className)}\n      >\n        <MapView\n          {...props}\n          ref={ref}\n          testID={testID}\n          style={StyleSheet.absoluteFill}\n          pointerEvents={interactive ? 'auto' : 'none'}\n          accessible={interactive ? accessible : false}\n          accessibilityLabel={interactive ? accessibilityLabel : undefined}\n          accessibilityRole={interactive ? accessibilityRole : undefined}\n          accessibilityHint={interactive ? accessibilityHint : undefined}\n          accessibilityElementsHidden={interactive ? accessibilityElementsHidden : true}\n          importantForAccessibility={interactive ? importantForAccessibility : 'no-hide-descendants'}\n          showsMyLocationButton={showsMyLocationButton}\n          showsUserLocation={showsUserLocation}\n          scrollEnabled={interactive && (scrollEnabled ?? true)}\n          zoomEnabled={interactive && (zoomEnabled ?? true)}\n          rotateEnabled={interactive && (rotateEnabled ?? true)}\n          pitchEnabled={interactive && (pitchEnabled ?? true)}\n        />\n      </View>\n    )\n  },\n)\nMapPreview.displayName = 'MapPreview'\n\nexport { Marker as MapPreviewMarker, Polyline as MapPreviewPolyline } from 'react-native-maps'\n",
      "type": "registry:ui",
      "target": "~/components/ui/map-preview/MapPreview.tsx"
    },
    {
      "path": "packages/registry-native/components/map-preview/MapPreview.web.tsx",
      "content": "import type { ComponentType } from 'react'\nimport type { MapMarkerProps, MapPolylineProps } from 'react-native-maps'\nimport { MapPreviewFallback } from './MapPreviewFallback'\nimport type { MapPreviewProps } from './MapPreview.types'\n\nexport function MapPreview({ className, style, testID, fallback }: MapPreviewProps) {\n  return <MapPreviewFallback {...{ className, style, testID, fallback }} />\n}\n\nexport const MapPreviewMarker: ComponentType<MapMarkerProps> = () => null\nexport const MapPreviewPolyline: ComponentType<MapPolylineProps> = () => null\n",
      "type": "registry:ui",
      "target": "~/components/ui/map-preview/MapPreview.web.tsx"
    },
    {
      "path": "packages/registry-native/components/map-preview/MapPreview.types.ts",
      "content": "import type { ReactNode } from 'react'\nimport type { ViewProps } from 'react-native'\nimport type { MapViewProps } from 'react-native-maps'\n\nexport interface MapPreviewProps extends Omit<MapViewProps, 'style'> {\n  className?: string\n  style?: ViewProps['style']\n  /** Render the fallback when the app's map provider is unavailable. */\n  available?: boolean\n  /** Opt into map gestures when users need to explore an embedded map. */\n  interactive?: boolean\n  /** Accessible alternative, such as a list of stops or pinned addresses. */\n  fallback?: ReactNode\n}\n\nexport type { LatLng, Region } from 'react-native-maps'\n",
      "type": "registry:ui",
      "target": "~/components/ui/map-preview/MapPreview.types.ts"
    },
    {
      "path": "packages/registry-native/components/map-preview/MapPreviewFallback.tsx",
      "content": "import { View } from 'react-native'\nimport { renderTextChildren } from '@/lib/label-children'\nimport { cn } from '@/lib/utils'\nimport type { MapPreviewProps } from './MapPreview.types'\n\nexport function MapPreviewFallback({\n  className,\n  style,\n  testID,\n  fallback,\n}: Pick<MapPreviewProps, 'className' | 'style' | 'testID' | 'fallback'>) {\n  return (\n    <View\n      testID={testID}\n      style={style}\n      className={cn('min-h-[240px] justify-center rounded-lg border border-border bg-muted p-4', className)}\n    >\n      {renderTextChildren(fallback ?? 'Map unavailable', 'text-muted-foreground')}\n    </View>\n  )\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/map-preview/MapPreviewFallback.tsx"
    },
    {
      "path": "packages/registry-native/components/map-preview/index.ts",
      "content": "export { MapPreview, MapPreviewMarker, MapPreviewPolyline } from './MapPreview'\nexport type { LatLng, MapPreviewProps, Region } from './MapPreview.types'\n",
      "type": "registry:ui",
      "target": "~/components/ui/map-preview/index.ts"
    }
  ],
  "dependencies": [
    "react-native-maps"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/label-children.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Embeddable native map with opt-in gestures, markers, route lines, and an accessible fallback.",
  "categories": [
    "data-display"
  ]
}