{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert",
  "title": "Alert",
  "description": "상황 알림 박스 — default/destructive 변형, ⓘ/⚠ 글리프, role=alert. variant는 context로 하위 텍스트 톤 전달.",
  "dependencies": [
    "@unikit-bridge/ui",
    "class-variance-authority",
    "clsx",
    "tailwind-merge",
    "tailwindcss"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/alert.tsx",
      "content": "// Alert — shadcn/ui new-york-v4 alert 포팅（shadcn-ref/ui/alert.tsx）. 3종 export.\n// 포팅 판단:\n// - 원본은 grid + has-자손 셀렉터로 선택적 아이콘 열을 배치한다.\n//   data·자손 셀렉터는 네이티브에서 동작하지 않으므로 flex-row（아이콘 + 콘텐츠 열）\n//   구조로 재작성하고, 좌측 아이콘은 브리지 lucide 아이콘 프리미티브（default\n//   InfoIcon / destructive AlertCircleIcon）로 표시한다（아이콘 없는 배치는 미지원）.\n//   색·여백·rounding 토큰은 유지.\n// - 원본의 텍스트 색 상속（text-card-foreground / text-destructive）은 이중 지정\n//   원칙에 따라 내부 Text로 이동. 특히 AlertDescription의 destructive 톤（원본은\n//   data-slot=alert-description 자손 셀렉터의 text-destructive/90）은 셀렉터를\n//   쓸 수 없어 React context로 variant를 전달한다 — variant prop은 원본대로\n//   Alert에만 존재한다（Alert 단독 사용 시 하위 컴포넌트는 default 톤）.\n// - role=\"alert\"은 원본 그대로 유지（신규 접근성 계약 BridgeRole \"alert\"）.\n// - 웹 전용 토큰 처리: line-clamp-1·tracking-tight은 web: 접두, 그리드 전용\n//   col-start-*·min-h-4와 ［&_p］:leading-relaxed（단락 자손 스타일）은 소실.\nimport { createContext, forwardRef, useContext } from \"react\";\nimport {\n  AlertCircleIcon,\n  InfoIcon,\n  Text,\n  View,\n  type BridgeTextRef,\n  type BridgeViewRef,\n  type TextProps,\n  type ViewProps,\n} from \"@unikit-bridge/ui/primitives\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\n// 컨테이너（View） — 배경·테두리. 원본의 grid 배치를 flex-row（글리프+콘텐츠 열）로 치환.\nconst alertVariants = cva(\n  \"relative w-full flex-row items-start gap-3 rounded-lg border px-4 py-3\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-card\",\n        // 원본 destructive는 border 클래스가 없다（bg-card + text-destructive뿐）.\n        // border-destructive/50은 구버전 유물로 제거 — destructive는 글자색·\n        // 아이콘·설명 톤(/90)으로만 구분된다.\n        destructive: \"bg-card\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  },\n);\n\n// 좌측 글리프 Text — 원본 ［&>svg］:size-4·text-current 아이콘의 글리프 대체.\nconst alertGlyphVariants = cva(\"text-base leading-none\", {\n  variants: {\n    variant: {\n      default: \"text-card-foreground\",\n      destructive: \"text-destructive\",\n    },\n  },\n  defaultVariants: {\n    variant: \"default\",\n  },\n});\n\n// 제목 Text — 원본 col-start-2 line-clamp-1 font-medium tracking-tight.\nconst alertTitleVariants = cva(\n  \"font-sans text-sm font-medium leading-none web:line-clamp-1 web:tracking-tight\",\n  {\n    variants: {\n      variant: {\n        default: \"text-card-foreground\",\n        destructive: \"text-destructive\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  },\n);\n\n// 설명 Text — 원본 text-muted-foreground, destructive는 /90 톤（자손 셀렉터 대체）.\nconst alertDescriptionVariants = cva(\n  \"font-sans text-sm text-muted-foreground\",\n  {\n    variants: {\n      variant: {\n        default: \"\",\n        destructive: \"text-destructive/90\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n    },\n  },\n);\n\n// variant 전파용 React context — 원본의 `*:` 자손 셀렉터를 대체한다.\nconst AlertContext = createContext<\n  NonNullable<VariantProps<typeof alertVariants>[\"variant\"]>\n>(\"default\");\n\nexport type AlertProps = ViewProps & VariantProps<typeof alertVariants>;\nexport type AlertTitleProps = TextProps;\nexport type AlertDescriptionProps = TextProps;\n\nconst Alert = forwardRef<BridgeViewRef, AlertProps>(\n  ({ className, variant, children, ...props }, ref) => (\n    <AlertContext.Provider value={variant ?? \"default\"}>\n      <View\n        ref={ref}\n        accessibilityRole=\"alert\"\n        className={cn(alertVariants({ variant }), className)}\n        {...props}\n      >\n        <View aria-hidden className=\"mt-0.5 shrink-0\">\n          {variant === \"destructive\" ? (\n            <AlertCircleIcon className=\"size-4 text-destructive\" />\n          ) : (\n            <InfoIcon className=\"size-4 text-foreground\" />\n          )}\n        </View>\n        <View className=\"flex flex-col gap-0.5\">{children}</View>\n      </View>\n    </AlertContext.Provider>\n  ),\n);\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = forwardRef<BridgeTextRef, AlertTitleProps>(\n  ({ className, ...props }, ref) => {\n    const variant = useContext(AlertContext);\n    return (\n      <Text\n        ref={ref}\n        className={cn(alertTitleVariants({ variant }), className)}\n        {...props}\n      />\n    );\n  },\n);\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = forwardRef<BridgeTextRef, AlertDescriptionProps>(\n  ({ className, ...props }, ref) => {\n    const variant = useContext(AlertContext);\n    return (\n      <Text\n        ref={ref}\n        className={cn(alertDescriptionVariants({ variant }), className)}\n        {...props}\n      />\n    );\n  },\n);\nAlertDescription.displayName = \"AlertDescription\";\n\nexport {\n  Alert,\n  AlertTitle,\n  AlertDescription,\n  alertVariants,\n  alertGlyphVariants,\n  alertTitleVariants,\n  alertDescriptionVariants,\n};\n",
      "type": "registry:ui",
      "target": "components/unikit/alert.tsx"
    }
  ],
  "type": "registry:ui"
}
