{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "title": "Alert dialog",
  "description": "confirmations",
  "dependencies": [
    "@rn-primitives/alert-dialog@^1.5.2",
    "react-native-reanimated@4.5.1",
    "react-native-screens@~4.26.0"
  ],
  "registryDependencies": [
    "@kit-native/button",
    "@kit-native/lib-utils",
    "@kit-native/text",
    "https://reactnativereusables.com/r/nativewind/native-only-animated-view.json"
  ],
  "files": [
    {
      "path": "components/ui/alert-dialog.tsx",
      "content": "import { buttonTextVariants, buttonVariants } from '@/components/ui/button';\nimport { NativeOnlyAnimatedView } from '@/components/ui/native-only-animated-view';\nimport { TextClassContext } from '@/components/ui/text';\nimport { cn } from '@/lib/utils';\nimport * as AlertDialogPrimitive from '@rn-primitives/alert-dialog';\nimport * as React from 'react';\nimport { Dimensions, Platform, StyleSheet, View, type ViewProps } from 'react-native';\nimport { FadeIn, FadeOut, ReduceMotion } from 'react-native-reanimated';\nimport { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst FullWindowOverlay = Platform.OS === 'ios' ? RNFullWindowOverlay : React.Fragment;\n\nfunction AlertDialogOverlay({\n  className,\n  children,\n  ...props\n}: Omit<React.ComponentProps<typeof AlertDialogPrimitive.Overlay>, 'asChild'> & {\n    children?: React.ReactNode;\n  }) {\n  return (\n    <FullWindowOverlay>\n      <AlertDialogPrimitive.Overlay\n        className={cn(\n          'absolute bottom-0 left-0 right-0 top-0 z-50 flex items-center justify-center bg-black/50 p-2',\n          Platform.select({\n            web: 'animate-in fade-in-0 fixed',\n          }),\n          className\n        )}\n        {...props}\n        asChild={Platform.OS !== 'web'}>\n        <NativeOnlyAnimatedView\n          entering={FadeIn.duration(200).delay(50).reduceMotion(ReduceMotion.System)}\n          exiting={FadeOut.duration(150).reduceMotion(ReduceMotion.System)}\n          as=\"Pressable\">\n          <>{children}</>\n        </NativeOnlyAnimatedView>\n      </AlertDialogPrimitive.Overlay>\n    </FullWindowOverlay>\n  );\n}\n\nfunction AlertDialogContent({\n  className,\n  portalHost,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n    portalHost?: string;\n  }) {\n  return (\n    <AlertDialogPortal hostName={portalHost}>\n      <AlertDialogOverlay>\n        <AlertDialogPrimitive.Content\n          className={cn(\n            'bg-background border-border z-50 flex flex-col gap-4 rounded-xl border p-6 shadow-lg',\n            Platform.select({\n              web: 'animate-in fade-in-0 zoom-in-95 duration-200',\n            }),\n            className\n          )}\n          {...props}\n          // Flattened, and after the spread. On web this lands in a Radix `asChild` slot,\n          // which merges style by object spread — an array becomes {0: …, 1: …} and the DOM\n          // throws \"Failed to set an indexed property [0] on CSSStyleDeclaration\".\n          // The old order also let `props.style` (usually undefined) wipe the width.\n          style={StyleSheet.flatten([{ width: Math.min(Dimensions.get('window').width - 32, 448) }, props.style])}\n        />\n      </AlertDialogOverlay>\n    </AlertDialogPortal>\n  );\n}\n\nfunction AlertDialogHeader({ className, ...props }: ViewProps) {\n  return (\n    <TextClassContext.Provider value=\"text-center sm:text-left\">\n      <View className={cn('flex flex-col gap-2', className)} {...props} />\n    </TextClassContext.Provider>\n  );\n}\n\nfunction AlertDialogFooter({ className, ...props }: ViewProps) {\n  return (\n    <View\n      className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}\n      {...props}\n    />\n  );\n}\n\nfunction AlertDialogTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n  return (\n    <AlertDialogPrimitive.Title\n      className={cn('text-foreground text-lg font-semibold', className)}\n      {...props}\n    />\n  );\n}\n\nfunction AlertDialogDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n  return (\n    <AlertDialogPrimitive.Description\n      className={cn('text-muted-foreground text-sm', className)}\n      {...props}\n    />\n  );\n}\n\nfunction AlertDialogAction({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n  return (\n    <TextClassContext.Provider value={buttonTextVariants({ className })}>\n      <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />\n    </TextClassContext.Provider>\n  );\n}\n\nfunction AlertDialogCancel({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n  return (\n    <TextClassContext.Provider value={buttonTextVariants({ className, variant: 'outline' })}>\n      <AlertDialogPrimitive.Cancel\n        className={cn(buttonVariants({ variant: 'outline' }), className)}\n        {...props}\n      />\n    </TextClassContext.Provider>\n  );\n}\n\nexport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogOverlay,\n  AlertDialogPortal,\n  AlertDialogTitle,\n  AlertDialogTrigger,\n};\n",
      "type": "registry:ui",
      "target": "components/ui/alert-dialog.tsx"
    }
  ],
  "meta": {
    "exports": [
      "AlertDialog"
    ],
    "api": "<AlertDialog>…<AlertDialogCancel /><AlertDialogAction /></AlertDialog>"
  },
  "docs": "Run `npx expo install --fix` afterwards so Expo SDK packages match your SDK. Needs the kit theme (`@kit-native/theme`) and `KitThemeProvider` from `@kit-native/lib-theme-context` at the root.",
  "categories": [
    "overlays"
  ],
  "type": "registry:ui"
}