{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert",
  "title": "Alert",
  "author": "Poyraz Avsever",
  "description": "Poyraz Soft Glass alert with semantic states and composable variants.",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "lucide-react@^0.574.0"
  ],
  "registryDependencies": [
    "@poyraz/poyraz-utils",
    "@poyraz/poyraz-theme"
  ],
  "files": [
    {
      "path": "registry/poyraz/ui/phase7/molecules/alert.tsx",
      "content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { AlertCircle, AlertTriangle, CheckCircle2, Info, Terminal, X } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst alertVariants = cva(\n  \"relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 border p-4 transition-[color,background-color,border-color,transform,opacity] duration-[var(--poyraz-motion-duration-base)] ease-[var(--poyraz-motion-ease-out)] [&>svg]:mt-0.5 [&>svg]:size-4\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"[--alert-bg:var(--poyraz-surface-subtle)] [--alert-border:var(--poyraz-border)] [--alert-fg:var(--poyraz-foreground)] [--alert-icon:var(--poyraz-muted-foreground)] [--alert-solid:var(--poyraz-foreground)]\",\n        info: \"[--alert-bg:var(--poyraz-info)] [--alert-border:var(--poyraz-info-border)] [--alert-fg:var(--poyraz-info-foreground)] [--alert-icon:var(--poyraz-info-icon)] [--alert-solid:var(--poyraz-info-solid)]\",\n        success:\n          \"[--alert-bg:var(--poyraz-success)] [--alert-border:var(--poyraz-success-border)] [--alert-fg:var(--poyraz-success-foreground)] [--alert-icon:var(--poyraz-success-icon)] [--alert-solid:var(--poyraz-success-solid)]\",\n        warning:\n          \"[--alert-bg:var(--poyraz-warning)] [--alert-border:var(--poyraz-warning-border)] [--alert-fg:var(--poyraz-warning-foreground)] [--alert-icon:var(--poyraz-warning-icon)] [--alert-solid:var(--poyraz-warning-solid)]\",\n        destructive:\n          \"[--alert-bg:var(--poyraz-destructive-muted)] [--alert-border:var(--poyraz-invalid-border)] [--alert-fg:var(--poyraz-destructive-muted-foreground)] [--alert-icon:var(--poyraz-destructive)] [--alert-solid:var(--poyraz-destructive)]\",\n      },\n      appearance: {\n        soft: \"border-[var(--alert-border)] bg-[var(--alert-bg)] text-[var(--alert-fg)] [&>svg]:text-[var(--alert-icon)]\",\n        outline:\n          \"border-[var(--alert-border)] bg-transparent text-[var(--alert-fg)] [&>svg]:text-[var(--alert-icon)]\",\n        filled:\n          \"border-transparent bg-[var(--alert-solid)] text-primary-foreground shadow-sm [&>svg]:text-current\",\n        glass:\n          \"border-[var(--alert-border)] bg-glass text-[var(--alert-fg)] shadow-md backdrop-blur-glass [&>svg]:text-[var(--alert-icon)]\",\n        inline:\n          \"border-[var(--alert-border)] border-l-4 border-l-[var(--alert-icon)] bg-[var(--alert-bg)] px-4 py-3 text-[var(--alert-fg)] shadow-xs [&>svg]:text-[var(--alert-icon)]\",\n      },\n      radius: {\n        none: \"rounded-none\",\n        sm: \"rounded-sm\",\n        md: \"rounded-md\",\n        lg: \"rounded-lg\",\n        xl: \"rounded-xl\",\n      },\n      motion: {\n        none: \"\",\n        fade: \"animate-poyraz-fade-in motion-reduce:animate-none\",\n        slide: \"animate-poyraz-slide-in-from-top motion-reduce:animate-poyraz-fade-in\",\n        scale: \"animate-poyraz-scale-in motion-reduce:animate-poyraz-fade-in\",\n      },\n    },\n    compoundVariants: [\n      { variant: \"warning\", appearance: \"filled\", className: \"text-warning-foreground\" },\n    ],\n    defaultVariants: { variant: \"default\", appearance: \"soft\", radius: \"lg\", motion: \"slide\" },\n  },\n);\n\nconst variantIcons = {\n  default: Terminal,\n  info: Info,\n  success: CheckCircle2,\n  warning: AlertTriangle,\n  destructive: AlertCircle,\n} satisfies Record<string, React.ElementType>;\n\nexport interface AlertProps\n  extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {\n  icon?: React.ReactNode;\n  dismissible?: boolean;\n  onDismiss?: () => void;\n  dismissLabel?: string;\n}\n\nconst Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n  (\n    {\n      appearance,\n      className,\n      dismissible = false,\n      dismissLabel = \"Dismiss alert\",\n      icon,\n      motion,\n      onDismiss,\n      radius,\n      variant = \"default\",\n      children,\n      ...props\n    },\n    ref,\n  ) => {\n    const Icon = variantIcons[variant ?? \"default\"];\n    return (\n      <div\n        ref={ref}\n        role={variant === \"destructive\" ? \"alert\" : \"status\"}\n        aria-live={variant === \"destructive\" ? \"assertive\" : \"polite\"}\n        data-slot=\"alert\"\n        data-variant={variant}\n        data-appearance={appearance ?? \"soft\"}\n        className={cn(\n          alertVariants({ appearance, motion, radius, variant }),\n          dismissible && \"pr-11\",\n          className,\n        )}\n        {...props}\n      >\n        {icon !== undefined ? icon : <Icon aria-hidden=\"true\" />}\n        <div data-slot=\"alert-content\" className=\"min-w-0\">\n          {children}\n        </div>\n        {dismissible && (\n          <button\n            type=\"button\"\n            aria-label={dismissLabel}\n            onClick={onDismiss}\n            className=\"absolute right-3 top-3 flex size-7 items-center justify-center rounded-md text-current opacity-60 transition-[opacity,background-color,transform] hover:bg-current/10 hover:opacity-100 active:scale-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n          >\n            <X className=\"size-3.5\" />\n          </button>\n        )}\n      </div>\n    );\n  },\n);\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTMLHeadingElement>>(\n  ({ className, ...props }, ref) => (\n    <h5\n      ref={ref}\n      data-slot=\"alert-title\"\n      className={cn(\"font-semibold leading-5 tracking-tight\", className)}\n      {...props}\n    />\n  ),\n);\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n  ({ className, ...props }, ref) => (\n    <div\n      ref={ref}\n      data-slot=\"alert-description\"\n      className={cn(\"mt-0.5 text-sm leading-5 opacity-85 [&_p]:leading-relaxed\", className)}\n      {...props}\n    />\n  ),\n);\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\n",
      "type": "registry:ui",
      "target": "@ui/molecules/alert.tsx"
    }
  ],
  "meta": {
    "category": "phase-7-composite",
    "phase": "beta"
  },
  "type": "registry:ui"
}