{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert",
  "title": "Alert",
  "description": "inline, persistent · `variant` default/info/success/warning/destructive · `icon` · `onDismiss`/`action` make it a nudge",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "lucide-react-native@^1.21.0"
  ],
  "registryDependencies": [
    "@kit-native/icon",
    "@kit-native/lib-utils",
    "@kit-native/text"
  ],
  "files": [
    {
      "path": "components/ui/alert.tsx",
      "content": "import { Icon } from '@/components/ui/icon';\nimport { Text, TextClassContext } from '@/components/ui/text';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { XIcon, type LucideIcon } from 'lucide-react-native';\nimport * as React from 'react';\nimport { Pressable, View } from 'react-native';\n\n/** Tone-tinted alert surfaces: background, border and icon share the semantic colour. */\nconst alertVariants = cva('relative w-full rounded-lg border px-4 py-4', {\n  variants: {\n    variant: {\n      default: 'bg-card border-border',\n      info: 'bg-info/10 border-info/40',\n      success: 'bg-success/10 border-success/40',\n      warning: 'bg-warning/15 border-warning/50',\n      destructive: 'bg-destructive/10 border-destructive/40',\n    },\n  },\n  defaultVariants: { variant: 'default' },\n});\n\nconst ICON_TONE: Record<NonNullable<VariantProps<typeof alertVariants>['variant']>, string> = {\n  default: 'text-foreground',\n  info: 'text-info',\n  success: 'text-success',\n  warning: 'text-warning',\n  destructive: 'text-destructive',\n};\n\nfunction Alert({\n  className,\n  variant = 'default',\n  children,\n  icon,\n  iconClassName,\n  onDismiss,\n  action,\n  ...props\n}: React.ComponentProps<typeof View> &\n  React.RefAttributes<View> &\n  VariantProps<typeof alertVariants> & {\n    icon: LucideIcon;\n    iconClassName?: string;\n    /** Adds the dismiss X. Use it for nudges, never for errors the user must act on. */\n    onDismiss?: () => void;\n    /** Inline text link under the description. */\n    action?: { label: string; onPress: () => void };\n  }) {\n  const tone = variant ?? 'default';\n  return (\n    <TextClassContext.Provider value=\"text-foreground\">\n      <View\n        role=\"alert\"\n        accessibilityLiveRegion=\"polite\"\n        className={cn(alertVariants({ variant: tone }), onDismiss && 'pr-12', className)}\n        {...props}>\n        <View className=\"absolute left-4 top-4\">\n          <Icon as={icon} className={cn('size-5', ICON_TONE[tone], iconClassName)} size={20} />\n        </View>\n        {children}\n        {action ? (\n          <Pressable\n            onPress={action.onPress}\n            hitSlop={8}\n            accessibilityRole=\"button\"\n            className=\"mt-2 min-h-6 justify-center pl-8\">\n            <Text className={cn('text-sm font-semibold', ICON_TONE[tone])}>{action.label} →</Text>\n          </Pressable>\n        ) : null}\n        {onDismiss ? (\n          <Pressable\n            onPress={onDismiss}\n            hitSlop={8}\n            accessibilityRole=\"button\"\n            accessibilityLabel=\"Dismiss\"\n            className=\"absolute right-1 top-1 size-11 items-center justify-center rounded-full active:opacity-70\">\n            <Icon as={XIcon} size={16} className=\"text-muted-foreground\" />\n          </Pressable>\n        ) : null}\n      </View>\n    </TextClassContext.Provider>\n  );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<typeof Text>) {\n  return <Text className={cn('mb-1 min-h-5 pl-8 text-base font-semibold leading-5', className)} {...props} />;\n}\n\nfunction AlertDescription({ className, ...props }: React.ComponentProps<typeof Text>) {\n  return <Text className={cn('text-muted-foreground pl-8 text-sm leading-relaxed', className)} {...props} />;\n}\n\nexport { Alert, AlertDescription, AlertTitle };\n",
      "type": "registry:ui",
      "target": "components/ui/alert.tsx"
    }
  ],
  "meta": {
    "exports": [
      "Alert"
    ],
    "api": "<Alert icon variant=\"default|info|success|warning|destructive\" onDismiss? action?><AlertTitle /><AlertDescription /></Alert>"
  },
  "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": [
    "feedback"
  ],
  "type": "registry:ui"
}