{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "restaurant-waitlist",
  "title": "Restaurant Waitlist",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/restaurant-waitlist/RestaurantWaitlist.tsx",
      "content": "import { View, type ViewProps } from 'react-native'\nimport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogTrigger,\n} from '@/components/ui/alert-dialog'\nimport { Button } from '@/components/ui/button'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nexport type RestaurantWaitlistStatus = 'queued' | 'ready' | 'cancelled'\ntype WaitRange = readonly [earliest: number, latest: number]\n\ninterface RestaurantWaitlistLabels {\n  queued: string\n  ready: string\n  cancelled: string\n  estimate: string\n  estimateUnavailable: string\n  leave: string\n  leaveTitle: string\n  leaveDescription: string\n  confirmLeave: string\n  stay: string\n  retry: string\n}\n\nexport interface RestaurantWaitlistProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  restaurant: string\n  /** Locale-ready party description, for example \"Party of 4\". */\n  party: string\n  status: RestaurantWaitlistStatus\n  /** Caller-provided wait estimate bounds in whole minutes. Only visible while queued. */\n  waitMinutes?: WaitRange\n  formatWaitRange?: (range: WaitRange) => string\n  /** Caller-provided check-in direction or deadline. Visible when the table is ready. */\n  instructions?: string\n  pending?: 'leave' | 'retry'\n  error?: string\n  labels?: Partial<RestaurantWaitlistLabels>\n  onLeave?: () => void\n  onRetry?: () => void\n}\n\nconst numberFormat = new Intl.NumberFormat()\n\nexport function RestaurantWaitlist({\n  className,\n  restaurant,\n  party,\n  status,\n  waitMinutes,\n  formatWaitRange,\n  instructions,\n  pending,\n  error,\n  labels,\n  onLeave,\n  onRetry,\n  ...props\n}: RestaurantWaitlistProps) {\n  const [earliest, latest] = waitMinutes ?? []\n  const validRange =\n    waitMinutes &&\n    earliest != null &&\n    latest != null &&\n    Number.isSafeInteger(earliest) &&\n    Number.isSafeInteger(latest) &&\n    earliest >= 0 &&\n    latest > earliest\n  const statusLabel =\n    status === 'queued'\n      ? (labels?.queued ?? 'On the waitlist')\n      : status === 'ready'\n        ? (labels?.ready ?? 'Your table is ready')\n        : (labels?.cancelled ?? 'Waitlist canceled')\n  const wait =\n    status !== 'queued'\n      ? undefined\n      : validRange\n        ? (formatWaitRange?.(waitMinutes) ?? `${numberFormat.format(earliest)}–${numberFormat.format(latest)} min`)\n        : (labels?.estimateUnavailable ?? 'Wait estimate unavailable')\n  const visibleError = status === 'cancelled' ? undefined : error\n  const readyInstructions = status === 'ready' ? instructions : undefined\n  useAnnouncement(visibleError ?? [restaurant, statusLabel, wait, readyInstructions].filter(Boolean).join('. '))\n\n  return (\n    <View {...props} className={cn('gap-[16px] rounded-lg border border-border bg-card p-[16px]', className)}>\n      <View className=\"gap-[4px]\">\n        <Text size=\"title\" accessibilityRole=\"header\" className=\"text-card-foreground\">\n          {restaurant}\n        </Text>\n        <Text variant=\"muted\">{party}</Text>\n      </View>\n\n      <View className=\"gap-[4px] border-t border-border pt-[16px]\">\n        <Text size={status === 'ready' ? 'xl' : 'default'} className=\"font-semibold text-card-foreground\">\n          {statusLabel}\n        </Text>\n        {wait ? (\n          <>\n            {validRange ? (\n              <Text size=\"sm\" variant=\"muted\">\n                {labels?.estimate ?? 'Estimated wait'}\n              </Text>\n            ) : null}\n            <Text size={validRange ? 'xl' : 'default'} variant={validRange ? 'default' : 'muted'}>\n              {wait}\n            </Text>\n          </>\n        ) : null}\n        {readyInstructions ? <Text>{readyInstructions}</Text> : null}\n      </View>\n\n      {visibleError ? (\n        <View className=\"gap-[8px]\">\n          <Text size=\"sm\" className=\"text-destructive\" accessibilityRole=\"alert\">\n            {visibleError}\n          </Text>\n          {onRetry ? (\n            <Button\n              variant=\"outline\"\n              disabled={pending === 'leave'}\n              loading={pending === 'retry'}\n              accessibilityLabel={labels?.retry ?? 'Try again'}\n              onPress={() => {\n                if (!pending) onRetry()\n              }}\n            >\n              {labels?.retry ?? 'Try again'}\n            </Button>\n          ) : null}\n        </View>\n      ) : null}\n      {status !== 'cancelled' && onLeave ? (\n        <AlertDialog>\n          <AlertDialogTrigger\n            variant=\"outline\"\n            disabled={pending === 'retry'}\n            loading={pending === 'leave'}\n            accessibilityLabel={labels?.leave ?? 'Leave waitlist'}\n          >\n            {labels?.leave ?? 'Leave waitlist'}\n          </AlertDialogTrigger>\n          <AlertDialogContent\n            title={labels?.leaveTitle ?? 'Leave the waitlist?'}\n            description={labels?.leaveDescription ?? 'Your party will lose its place in line.'}\n          >\n            <AlertDialogCancel variant=\"outline\" accessibilityLabel={labels?.stay ?? 'Stay on waitlist'}>\n              {labels?.stay ?? 'Stay on waitlist'}\n            </AlertDialogCancel>\n            <AlertDialogAction\n              variant=\"destructive\"\n              disabled={Boolean(pending)}\n              accessibilityLabel={labels?.confirmLeave ?? 'Leave the line'}\n              onPress={() => {\n                if (!pending) onLeave()\n              }}\n            >\n              {labels?.confirmLeave ?? 'Leave the line'}\n            </AlertDialogAction>\n          </AlertDialogContent>\n        </AlertDialog>\n      ) : null}\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/restaurant-waitlist/RestaurantWaitlist.tsx"
    },
    {
      "path": "packages/registry-native/blocks/restaurant-waitlist/index.ts",
      "content": "export { RestaurantWaitlist, type RestaurantWaitlistProps, type RestaurantWaitlistStatus } from './RestaurantWaitlist'\n",
      "type": "registry:block",
      "target": "~/components/blocks/restaurant-waitlist/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/alert-dialog.json",
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/text.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "Restaurant wait estimate, ready and canceled states with confirm-to-leave and retry actions.",
  "categories": [
    "reservation",
    "commerce"
  ]
}