{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "trip-progress",
  "title": "Trip Progress",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/trip-progress/TripProgress.tsx",
      "content": "import type { ReactNode } from 'react'\nimport { View, type ViewProps } from 'react-native'\nimport { CarFront, CircleAlert, CircleCheck, CircleDot, MapPin } from 'lucide-react-native'\nimport { Button } from '@/components/ui/button'\nimport { Icon } from '@/components/ui/icon'\nimport { Progress } from '@/components/ui/progress'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nexport type TripStage = 'pickup' | 'in-progress' | 'arrived'\n\nexport type TripProgressState =\n  | { kind: 'pickup' | 'in-progress'; detail?: string; estimate?: string }\n  | { kind: 'arrived'; detail?: string }\n  | { kind: 'issue'; detail: string; stage?: TripStage }\n\nexport interface TripProgressDriver {\n  name: string\n  vehicle: string\n  plate: string\n  portrait?: ReactNode\n}\n\nconst defaultLabels = {\n  pickup: 'Pickup',\n  destination: 'Destination',\n  enRoute: 'On the way',\n  arrived: 'Arrived',\n  pickupStatus: 'Meeting your driver',\n  arrivedStatus: 'You’ve arrived',\n  issue: 'Trip needs attention',\n  progress: 'Trip progress',\n  driver: 'Driver',\n  plate: 'License plate',\n  help: 'Trip help',\n  share: 'Share trip',\n}\n\nconst stagePositions: Record<TripStage, number> = { pickup: 1, 'in-progress': 2, arrived: 3 }\n\nexport interface TripProgressProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  pickup: string\n  destination: string\n  state: TripProgressState\n  driver?: TripProgressDriver\n  /** Optional caller-owned route preview. Leave the map passive when embedded in a scroll view. */\n  route?: ReactNode\n  /** Opens the consuming application's help. */\n  onHelp?: () => void\n  /** Opens a caller-owned share flow only after the rider asks to share. */\n  onShare?: () => void\n  labels?: Partial<typeof defaultLabels>\n}\n\nexport function TripProgress({\n  pickup,\n  destination,\n  state,\n  driver,\n  route,\n  onHelp,\n  onShare,\n  labels,\n  className,\n  ...props\n}: TripProgressProps) {\n  const copy = { ...defaultLabels, ...labels }\n  const stages = { pickup: copy.pickup, 'in-progress': copy.enRoute, arrived: copy.arrived }\n  const status = {\n    pickup: copy.pickupStatus,\n    'in-progress': copy.enRoute,\n    arrived: copy.arrivedStatus,\n    issue: copy.issue,\n  }[state.kind]\n  const icon = state.kind === 'issue' ? CircleAlert : state.kind === 'arrived' ? CircleCheck : CarFront\n  const stage = state.kind === 'issue' ? state.stage : state.kind\n  useAnnouncement(state.kind === 'issue' ? `${status}. ${state.detail}` : status)\n  const actions =\n    onHelp || onShare ? (\n      <View className=\"flex-row flex-wrap gap-[8px]\">\n        {onHelp ? (\n          <Button\n            variant={state.kind === 'issue' ? 'default' : 'outline'}\n            accessibilityLabel={copy.help}\n            onPress={onHelp}\n          >\n            {copy.help}\n          </Button>\n        ) : null}\n        {onShare ? (\n          <Button variant=\"outline\" accessibilityLabel={copy.share} onPress={onShare}>\n            {copy.share}\n          </Button>\n        ) : null}\n      </View>\n    ) : null\n\n  return (\n    <View {...props} className={cn('gap-[16px]', className)}>\n      <View className=\"gap-[12px] rounded-lg border border-border bg-card p-[16px]\">\n        <View className=\"flex-row items-start gap-[12px]\">\n          <View className=\"size-[40px] items-center justify-center rounded-md bg-muted\">\n            <Icon icon={icon} size={20} className={state.kind === 'issue' ? 'text-destructive' : 'text-foreground'} />\n          </View>\n          <View className=\"min-w-0 flex-1 gap-[2px]\">\n            <Text size=\"xl\">{status}</Text>\n            {state.detail ? <Text variant=\"muted\">{state.detail}</Text> : null}\n            {'estimate' in state && state.estimate ? (\n              <Text size=\"sm\" className=\"font-medium\" style={{ fontVariant: ['tabular-nums'] }}>\n                {state.estimate}\n              </Text>\n            ) : null}\n          </View>\n        </View>\n        {stage ? (\n          <View className=\"gap-[6px]\">\n            <Progress\n              value={stagePositions[stage]}\n              max={3}\n              accessibilityLabel={copy.progress}\n              accessibilityValue={{ min: 0, max: 3, now: stagePositions[stage], text: stages[stage] }}\n            />\n            <View className=\"flex-row gap-[8px]\" aria-hidden>\n              <Text\n                size=\"xs\"\n                variant=\"muted\"\n                className={cn('min-w-0 flex-1', stage === 'pickup' && 'font-semibold text-foreground')}\n              >\n                {copy.pickup}\n              </Text>\n              <Text\n                size=\"xs\"\n                variant=\"muted\"\n                className={cn('min-w-0 flex-1 text-center', stage === 'in-progress' && 'font-semibold text-foreground')}\n              >\n                {copy.enRoute}\n              </Text>\n              <View className=\"min-w-0 flex-1 items-end\">\n                <Text size=\"xs\" variant=\"muted\" className={cn(stage === 'arrived' && 'font-semibold text-foreground')}>\n                  {copy.arrived}\n                </Text>\n              </View>\n            </View>\n          </View>\n        ) : null}\n      </View>\n\n      {state.kind === 'issue' ? actions : null}\n\n      {driver ? (\n        <View className=\"flex-row flex-wrap items-start gap-[16px] rounded-lg bg-muted p-[16px]\">\n          {driver.portrait}\n          <View className=\"min-w-[104px] flex-1 gap-[2px]\">\n            <Text size=\"xs\" variant=\"muted\">\n              {copy.driver}\n            </Text>\n            <Text className=\"font-semibold\">{driver.name}</Text>\n            <Text size=\"sm\">{driver.vehicle}</Text>\n          </View>\n          <View className=\"min-w-[104px] gap-[2px]\">\n            <Text size=\"xs\" variant=\"muted\">\n              {copy.plate}\n            </Text>\n            <Text className=\"font-semibold\" style={{ fontVariant: ['tabular-nums'] }}>\n              {driver.plate}\n            </Text>\n          </View>\n        </View>\n      ) : null}\n\n      <View className=\"gap-[8px]\">\n        <View className=\"flex-row items-start gap-[8px]\">\n          <Icon icon={CircleDot} size={17} className=\"mt-[3px] text-muted-foreground\" />\n          <View className=\"min-w-0 flex-1\">\n            <Text variant=\"muted\" size=\"xs\">\n              {copy.pickup}\n            </Text>\n            <Text className=\"font-medium\">{pickup}</Text>\n          </View>\n        </View>\n        <View className=\"flex-row items-start gap-[8px]\">\n          <Icon icon={MapPin} size={17} className=\"mt-[3px] text-muted-foreground\" />\n          <View className=\"min-w-0 flex-1\">\n            <Text variant=\"muted\" size=\"xs\">\n              {copy.destination}\n            </Text>\n            <Text className=\"font-medium\">{destination}</Text>\n          </View>\n        </View>\n        {route}\n      </View>\n\n      {state.kind !== 'issue' ? actions : null}\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/trip-progress/TripProgress.tsx"
    },
    {
      "path": "packages/registry-native/blocks/trip-progress/index.ts",
      "content": "export {\n  TripProgress,\n  type TripProgressDriver,\n  type TripProgressProps,\n  type TripProgressState,\n  type TripStage,\n} from './TripProgress'\n",
      "type": "registry:block",
      "target": "~/components/blocks/trip-progress/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react-native"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/icon.json",
    "https://native.uipkge.dev/r/native/progress.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Rider-facing pickup, journey, arrival, and issue states with vehicle verification, route and help/share slots.",
  "categories": [
    "transport"
  ]
}