{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "callout",
  "title": "Callout",
  "description": "An inline message block with info, success, warning, danger and neutral variants, three appearances, self-drawing icons, an optional action link and an animated dismiss.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/callout/callout.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type CalloutVariant = \"info\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\nexport type CalloutAppearance = \"soft\" | \"outline\" | \"bar\";\nexport type CalloutSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface CalloutProps {\n  variant?: CalloutVariant;\n  appearance?: CalloutAppearance;\n  title?: React.ReactNode;\n  children?: React.ReactNode;\n  icon?: React.ReactNode;\n  dismissible?: boolean;\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  action?: { label: string; onClick?: () => void };\n  size?: CalloutSize;\n  theme?: \"dark\" | \"light\";\n  width?: number | string;\n  className?: string;\n}\n\nconst ACCENTS: Record<CalloutVariant, { dark: string; light: string }> = {\n  info: { dark: \"#8FB8FF\", light: \"#2563EB\" },\n  success: { dark: \"#87FFE3\", light: \"#0F9F7F\" },\n  warning: { dark: \"#F2A841\", light: \"#B7791F\" },\n  danger: { dark: \"#FF7A6B\", light: \"#E5484D\" },\n  neutral: { dark: \"#F5F4F1\", light: \"#0A0A0A\" },\n};\n\nconst PALETTES = {\n  dark: { text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", card: \"#0E0E0E\", hover: \"rgba(255,255,255,0.08)\", focus: \"rgba(245,244,241,0.85)\" },\n  light: { text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", card: \"#FFFFFF\", hover: \"rgba(10,10,10,0.06)\", focus: \"rgba(10,10,10,0.85)\" },\n};\n\nconst SIZES: Record<CalloutSize, { font: number; pad: number; radius: number; icon: number; gap: number }> = {\n  sm: { font: 13, pad: 12, radius: 12, icon: 16, gap: 10 },\n  md: { font: 14.5, pad: 16, radius: 16, icon: 18, gap: 12 },\n  lg: { font: 16, pad: 20, radius: 20, icon: 22, gap: 14 },\n};\n\nconst ICON_PATHS: Record<CalloutVariant, string[]> = {\n  info: [\"M10 9v5\", \"M10 6.2v.01\"],\n  success: [\"M6.2 10.4l2.6 2.6 5-5.6\"],\n  warning: [\"M10 6.5v4.2\", \"M10 13.6v.01\"],\n  danger: [\"M7.3 7.3l5.4 5.4\", \"M12.7 7.3l-5.4 5.4\"],\n  neutral: [\"M6.5 10h7\", \"M10 6.5v7\"],\n};\n\nfunction VariantIcon({ variant, size, animateKey }: { variant: CalloutVariant; size: number; animateKey: string }) {\n  const draw = { initial: { pathLength: 0, opacity: 0 }, animate: { pathLength: 1, opacity: 1 }, transition: { duration: 0.5, ease: \"easeOut\" as const } };\n  const shape = variant === \"warning\" ? <motion.path d=\"M10 2.8l7.2 12.4H2.8L10 2.8Z\" strokeLinejoin=\"round\" {...draw} /> : <motion.circle cx=\"10\" cy=\"10\" r=\"7.6\" {...draw} />;\n  return (\n    <svg key={animateKey} width={size} height={size} viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" aria-hidden=\"true\">\n      {shape}\n      {ICON_PATHS[variant].map((d, i) => (\n        <motion.path key={d} d={d} initial={{ pathLength: 0, opacity: 0 }} animate={{ pathLength: 1, opacity: 1 }} transition={{ duration: 0.35, delay: 0.3 + i * 0.12, ease: \"easeOut\" }} />\n      ))}\n    </svg>\n  );\n}\n\nexport function Callout({\n  variant = \"info\",\n  appearance = \"soft\",\n  title,\n  children,\n  icon,\n  dismissible = false,\n  open,\n  defaultOpen = true,\n  onOpenChange,\n  action,\n  size = \"md\",\n  theme = \"dark\",\n  width = 480,\n  className,\n}: CalloutProps) {\n  const p = PALETTES[theme];\n  const s = SIZES[size];\n  const accent = ACCENTS[variant][theme];\n  const controlled = open !== undefined;\n  const [internal, setInternal] = React.useState(defaultOpen);\n  const visible = controlled ? open : internal;\n  const [btnHover, setBtnHover] = React.useState(false);\n\n  const setOpen = (next: boolean) => {\n    if (!controlled) setInternal(next);\n    onOpenChange?.(next);\n  };\n\n  const assertive = variant === \"danger\" || variant === \"warning\";\n  const tint = (pct: number) => `color-mix(in srgb, ${accent} ${pct}%, transparent)`;\n\n  const background = appearance === \"soft\" ? tint(theme === \"dark\" ? 9 : 8) : p.card;\n  const border = appearance === \"outline\" ? tint(55) : appearance === \"soft\" ? tint(theme === \"dark\" ? 22 : 24) : theme === \"dark\" ? \"rgba(255,255,255,0.1)\" : \"rgba(10,10,10,0.12)\";\n\n  return (\n    <AnimatePresence initial={false}>\n      {visible && (\n        <motion.div\n          key=\"callout\"\n          role={assertive ? \"alert\" : \"status\"}\n          initial={{ opacity: 0, height: 0, y: -6 }}\n          animate={{ opacity: 1, height: \"auto\", y: 0 }}\n          exit={{ opacity: 0, height: 0, y: -6 }}\n          transition={{ duration: 0.28, ease: [0.16, 1, 0.3, 1] }}\n          className={cn(\"overflow-hidden\", className)}\n          style={{ width, maxWidth: \"100%\", fontFamily: \"Inter, sans-serif\" }}\n        >\n          <div className=\"relative flex items-start\" style={{ gap: s.gap, padding: s.pad, paddingLeft: appearance === \"bar\" ? s.pad + 4 : s.pad, borderRadius: s.radius, background, border: `1px solid ${border}` }}>\n            {appearance === \"bar\" && (\n              <motion.span aria-hidden=\"true\" className=\"absolute\" initial={{ scaleY: 0 }} animate={{ scaleY: 1 }} transition={{ duration: 0.4, ease: [0.16, 1, 0.3, 1] }} style={{ left: 0, top: s.pad * 0.75, bottom: s.pad * 0.75, width: 3, borderRadius: 3, background: accent, transformOrigin: \"top\" }} />\n            )}\n\n            <span className=\"flex shrink-0 items-center justify-center\" style={{ color: accent, width: s.icon + 2, height: s.icon + 2, marginTop: 1 }}>\n              {icon ?? <VariantIcon variant={variant} size={s.icon + 2} animateKey={`${variant}-${visible}`} />}\n            </span>\n\n            <div className=\"flex min-w-0 flex-1 flex-col\" style={{ gap: 4 }}>\n              {title && (\n                <div className=\"font-semibold tracking-[-0.01em]\" style={{ color: p.text, fontSize: s.font + 0.5, lineHeight: 1.4 }}>\n                  {title}\n                </div>\n              )}\n              {children && (\n                <div style={{ color: p.muted, fontSize: s.font, lineHeight: 1.55 }}>{children}</div>\n              )}\n              {action && (\n                <button\n                  type=\"button\"\n                  onClick={action.onClick}\n                  onMouseEnter={() => setBtnHover(true)}\n                  onMouseLeave={() => setBtnHover(false)}\n                  className=\"mt-2 inline-flex w-fit cursor-pointer items-center border-none bg-transparent p-0 font-semibold outline-none focus-visible:ring-2\"\n                  style={{ color: accent, fontSize: s.font - 0.5, gap: 4, borderRadius: 6, [\"--tw-ring-color\" as string]: p.focus }}\n                >\n                  <span style={{ textDecoration: btnHover ? \"underline\" : \"none\", textUnderlineOffset: 3 }}>{action.label}</span>\n                  <motion.span animate={{ x: btnHover ? 3 : 0 }} transition={{ type: \"spring\", stiffness: 500, damping: 26 }} aria-hidden=\"true\">\n                    →\n                  </motion.span>\n                </button>\n              )}\n            </div>\n\n            {dismissible && (\n              <button\n                type=\"button\"\n                aria-label=\"Dismiss\"\n                onClick={() => setOpen(false)}\n                className=\"-mr-1 -mt-1 flex shrink-0 cursor-pointer items-center justify-center rounded-lg border-none bg-transparent outline-none focus-visible:ring-2\"\n                style={{ width: 28, height: 28, color: p.muted, transition: \"background 0.14s ease\", [\"--tw-ring-color\" as string]: p.focus }}\n                onMouseEnter={(e) => (e.currentTarget.style.background = p.hover)}\n                onMouseLeave={(e) => (e.currentTarget.style.background = \"transparent\")}\n              >\n                <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" aria-hidden=\"true\">\n                  <path d=\"M3 3L9 9M9 3L3 9\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" />\n                </svg>\n              </button>\n            )}\n          </div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}