{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ink/alert",
  "title": "Alert",
  "description": "Alert box with success/error/warning/info variants",
  "dependencies": [
    "ink"
  ],
  "registryDependencies": [
    "https://termcn.dev/r/ink/terminal-style.json",
    "https://termcn.dev/r/ink/terminal-symbols.json",
    "https://termcn.dev/r/ink/types.json",
    "https://termcn.dev/r/ink/use-theme.json",
    "https://termcn.dev/r/ink/use-unicode.json"
  ],
  "files": [
    {
      "path": "registry/ui/alert.tsx",
      "content": "import { useIsScreenReaderEnabled, Box, Text } from \"ink\";\nimport type { ReactNode } from \"react\";\n\nimport { useTheme } from \"@/hooks/use-theme\";\nimport { useUnicode } from \"@/hooks/use-unicode\";\nimport { resolveBorderStyle } from \"@/lib/terminal-style\";\nimport { resolveStatusSymbol } from \"@/lib/terminal-symbols\";\nimport type { BorderStyle } from \"@/components/ui/types\";\n\nexport type AlertVariant = \"success\" | \"error\" | \"warning\" | \"info\";\n\nexport interface AlertProps {\n  variant?: AlertVariant;\n  title?: string;\n  children?: ReactNode;\n  icon?: string;\n  bordered?: boolean;\n  borderStyle?: BorderStyle;\n  color?: string;\n  paddingX?: number;\n  paddingY?: number;\n  \"aria-label\"?: string;\n}\n\nexport const Alert = ({\n  variant = \"info\",\n  title,\n  children,\n  icon,\n  bordered = true,\n  borderStyle,\n  color,\n  paddingX = 1,\n  paddingY = 0,\n  \"aria-label\": ariaLabel,\n}: AlertProps) => {\n  const unicode = useUnicode();\n  const theme = useTheme();\n  const isScreenReaderEnabled = useIsScreenReaderEnabled();\n\n  const variantColor =\n    color ??\n    (() => {\n      switch (variant) {\n        case \"success\": {\n          return theme.colors.success;\n        }\n        case \"error\": {\n          return theme.colors.error;\n        }\n        case \"warning\": {\n          return theme.colors.warning;\n        }\n        default: {\n          return theme.colors.info;\n        }\n      }\n    })();\n\n  const resolvedIcon = icon ?? resolveStatusSymbol(unicode, variant);\n\n  const inner = (\n    <>\n      <Box gap={1}>\n        <Text aria-hidden color={variantColor} bold>\n          {resolvedIcon}\n        </Text>\n        <Text\n          aria-label={\n            ariaLabel ?? `${variant} alert${title ? `: ${title}` : \"\"}`\n          }\n        >\n          {\"\"}\n        </Text>\n        {title && (\n          <Text bold color={variantColor}>\n            {title}\n          </Text>\n        )}\n      </Box>\n      {children && <Text>{children}</Text>}\n    </>\n  );\n\n  if (!bordered) {\n    return (\n      <Box flexDirection=\"column\" paddingX={paddingX} paddingY={paddingY}>\n        {inner}\n      </Box>\n    );\n  }\n\n  return (\n    <Box\n      borderStyle={resolveBorderStyle(\n        isScreenReaderEnabled ? undefined : (borderStyle ?? theme.border.style),\n        unicode\n      )}\n      borderColor={variantColor}\n      paddingX={paddingX}\n      paddingY={paddingY}\n      flexDirection=\"column\"\n    >\n      {inner}\n    </Box>\n  );\n};\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "feedback"
  ],
  "type": "registry:ui"
}