{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dialog",
  "title": "Dialog",
  "description": "edits with a form",
  "dependencies": [
    "@rn-primitives/dialog@^1.5.2",
    "lucide-react-native@^1.21.0",
    "react-native-reanimated@4.5.1",
    "react-native-screens@~4.26.0"
  ],
  "registryDependencies": [
    "@kit-native/icon",
    "@kit-native/lib-utils",
    "https://reactnativereusables.com/r/nativewind/native-only-animated-view.json"
  ],
  "files": [
    {
      "path": "components/ui/dialog.tsx",
      "content": "import { Icon } from '@/components/ui/icon';\nimport { NativeOnlyAnimatedView } from '@/components/ui/native-only-animated-view';\nimport { cn } from '@/lib/utils';\nimport * as DialogPrimitive from '@rn-primitives/dialog';\nimport { X } from 'lucide-react-native';\nimport * as React from 'react';\nimport { Dimensions, Platform, Text, View, type GestureResponderEvent, type ViewProps } from 'react-native';\nimport { FadeIn, FadeOut, ReduceMotion } from 'react-native-reanimated';\nimport { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst FullWindowOverlay = Platform.OS === 'ios' ? RNFullWindowOverlay : React.Fragment;\n\nfunction DialogOverlay({\n  className,\n  children,\n  onPress,\n  ...props\n}: Omit<React.ComponentProps<typeof DialogPrimitive.Overlay>, 'asChild'> & {\n  children?: React.ReactNode;\n}) {\n  const { onOpenChange } = DialogPrimitive.useRootContext();\n\n  function onOverlayPress(event: GestureResponderEvent) {\n    onPress?.(event);\n    if (event.target === event.currentTarget && !event.isDefaultPrevented()) {\n      onOpenChange(false);\n    }\n  }\n\n  return (\n    <FullWindowOverlay>\n      <DialogPrimitive.Overlay\n        className={cn(\n          'absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center bg-black/50 p-2',\n          Platform.select({\n            web: 'animate-in fade-in-0 fixed cursor-default [&>*]:cursor-auto',\n          }),\n          className\n        )}\n        {...props}\n        onPress={Platform.select({ web: onOverlayPress, native: onPress })}\n        asChild={Platform.OS !== 'web'}>\n        <NativeOnlyAnimatedView\n          entering={FadeIn.duration(200).reduceMotion(ReduceMotion.System)}\n          exiting={FadeOut.duration(150).reduceMotion(ReduceMotion.System)}\n          as=\"Pressable\">\n          <NativeOnlyAnimatedView\n            entering={FadeIn.delay(50).reduceMotion(ReduceMotion.System)}\n            exiting={FadeOut.duration(150).reduceMotion(ReduceMotion.System)}>\n            <>{children}</>\n          </NativeOnlyAnimatedView>\n        </NativeOnlyAnimatedView>\n      </DialogPrimitive.Overlay>\n    </FullWindowOverlay>\n  );\n}\nfunction DialogContent({\n  className,\n  portalHost,\n  children,\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n  portalHost?: string;\n}) {\n  return (\n    <DialogPortal hostName={portalHost}>\n      <DialogOverlay>\n        <DialogPrimitive.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          style={[{ width: Math.min(Dimensions.get('window').width - 32, 448) }, props.style]}\n          {...props}>\n          <>{children}</>\n          <DialogPrimitive.Close\n            className={cn(\n              'absolute right-4 top-4 rounded opacity-70 active:opacity-100',\n              Platform.select({\n                web: 'ring-offset-background focus:ring-ring data-[state=open]:bg-accent transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2',\n              })\n            )}\n            hitSlop={12}>\n            <Icon\n              as={X}\n              className={cn('text-accent-foreground web:pointer-events-none size-4 shrink-0')}\n            />\n            <Text className=\"sr-only\">Close</Text>\n          </DialogPrimitive.Close>\n        </DialogPrimitive.Content>\n      </DialogOverlay>\n    </DialogPortal>\n  );\n}\n\nfunction DialogHeader({ className, ...props }: ViewProps) {\n  return (\n    <View className={cn('flex flex-col gap-2 text-center sm:text-left', className)} {...props} />\n  );\n}\n\nfunction DialogFooter({ 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 DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n  return (\n    <DialogPrimitive.Title\n      className={cn('text-foreground text-lg font-semibold leading-none', className)}\n      {...props}\n    />\n  );\n}\n\nfunction DialogDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n  return (\n    <DialogPrimitive.Description\n      className={cn('text-muted-foreground text-sm', className)}\n      {...props}\n    />\n  );\n}\n\nexport {\n  Dialog,\n  DialogClose,\n  DialogContent,\n  DialogDescription,\n  DialogFooter,\n  DialogHeader,\n  DialogOverlay,\n  DialogPortal,\n  DialogTitle,\n  DialogTrigger,\n};\n",
      "type": "registry:ui",
      "target": "components/ui/dialog.tsx"
    }
  ],
  "meta": {
    "exports": [
      "Dialog"
    ],
    "api": "<Dialog><DialogTrigger asChild /><DialogContent><DialogHeader /><DialogFooter /></DialogContent></Dialog>"
  },
  "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"
}