{
  "name": "custom-emoji",
  "type": "registry:ui",
  "framework": "react",
  "title": "Custom Emoji",
  "description": "An uploaded emoji that sits on the text baseline and reads as :name:.",
  "dependencies": [
    "class-variance-authority"
  ],
  "files": [
    {
      "path": "ui/custom-emoji.tsx",
      "content": "import { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/*\n * A custom emoji is an image that has to behave like a letter: it sits on the\n * text baseline, it takes the line's colour nowhere, and it carries its name\n * as its accessible text so a reader who cannot see it still hears `:name:`.\n *\n * A message made only of emoji renders them large — that is the `jumbo` size,\n * and it is a property of the message, not of the emoji.\n */\nconst customEmojiVariants = cva(\"inline-block object-contain align-[-0.2em]\", {\n  variants: {\n    size: {\n      inline: \"h-[1.375em] w-[1.375em]\",\n      jumbo: \"h-12 w-12\",\n    },\n  },\n  defaultVariants: { size: \"inline\" },\n})\n\nexport interface CustomEmojiProps\n  extends\n    Omit<React.ImgHTMLAttributes<HTMLImageElement>, \"alt\">,\n    VariantProps<typeof customEmojiVariants> {\n  /** The name between the colons, without them. */\n  name: string\n}\n\nconst CustomEmoji = React.forwardRef<HTMLImageElement, CustomEmojiProps>(\n  ({ className, name, size, ...props }, ref) => (\n    <img\n      ref={ref}\n      /*\n       * `:name:` rather than the bare name: it is what the author typed, and\n       * it reads as an emoji rather than as a stray word in the sentence.\n       */\n      alt={`:${name}:`}\n      title={`:${name}:`}\n      draggable={false}\n      className={cn(customEmojiVariants({ size }), className)}\n      {...props}\n    />\n  )\n)\nCustomEmoji.displayName = \"CustomEmoji\"\n\nexport { CustomEmoji, customEmojiVariants }\n",
      "type": "registry:ui"
    }
  ]
}