{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert",
  "title": "Alert",
  "description": "Inline callout carried by a pastel fill alone, no border or icon, that turns into pastel ink on a faint wash in dark mode.",
  "registryDependencies": [
    "https://www.deltacomponents.dev/r/utils.json",
    "https://www.deltacomponents.dev/r/font-weight.json"
  ],
  "files": [
    {
      "path": "registry/ui/alert.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { fontWeights } from \"@/lib/font-weight\"\n\n// Pastels at matched lightness and chroma, so a page of mixed alerts reads as\n// one family. Light: the pastel is a solid fill under near-black ink (11.4:1\n// at worst). Dark: the same pastel becomes the ink, over a 15% wash of itself,\n// so each type keeps its hue without a light slab on a dark page.\nconst alertTypes = {\n  note: \"[--alert:#ffeba1]\",\n  tip: \"[--alert:#a1f0d5]\",\n  info: \"[--alert:#a1d5ff]\",\n  warning: \"[--alert:#ffd2a1]\",\n  danger: \"[--alert:#ffb1a1]\",\n  success: \"[--alert:#b6f0a1]\",\n  caution: \"[--alert:#ffc4a1]\",\n} as const\n\ntype AlertType = keyof typeof alertTypes\n\ninterface AlertProps extends Omit<React.ComponentProps<\"div\">, \"title\"> {\n  type?: AlertType\n  title?: React.ReactNode\n}\n\nfunction Alert({\n  type = \"note\",\n  title,\n  children,\n  className,\n  ...props\n}: AlertProps) {\n  return (\n    <div\n      data-slot=\"alert\"\n      data-type={type}\n      className={cn(\n        \"rounded-xs p-4 text-base leading-normal\",\n        \"bg-(--alert) text-[#0a0a0a] dark:bg-(--alert)/15 dark:text-(--alert)\",\n        alertTypes[type],\n        className\n      )}\n      {...props}\n    >\n      {title && (\n        <div\n          data-slot=\"alert-title\"\n          className=\"[text-box-trim:trim-start]\"\n          style={{ fontVariationSettings: fontWeights.medium }}\n        >\n          {title}\n        </div>\n      )}\n      {children && (\n        <div\n          data-slot=\"alert-description\"\n          className={cn(\n            \"[text-box-trim:trim-start]\",\n            // Rich children (links, code, <p>) take the alert's ink and size\n            // rather than the page's, which would clash with the pastel.\n            \"[&_*]:!text-inherit [&_*]:![font-size:inherit]\",\n            title && \"mt-1.5\"\n          )}\n        >\n          {children}\n        </div>\n      )}\n    </div>\n  )\n}\n\nexport { Alert }\nexport type { AlertProps, AlertType }\n",
      "type": "registry:ui",
      "target": "components/ui/alert.tsx"
    }
  ],
  "docs": "Docs & live playground: https://www.deltacomponents.dev/docs/alert.",
  "categories": [
    "components"
  ],
  "type": "registry:ui"
}
