{
  "name": "text-display",
  "type": "registry:ui",
  "framework": "react",
  "title": "Text Display",
  "description": "A block of message text that keeps its line breaks, with the chat markdown heading and subtext sizes.",
  "dependencies": [
    "class-variance-authority"
  ],
  "files": [
    {
      "path": "ui/text-display.tsx",
      "content": "import { cva, type VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/*\n * The sizes are the chat markdown ones, so a text display and a `Markdown`\n * message agree: `#` is 24px, `##` is 20px, `###` is 16px and `-#` subtext\n * is 13px in the muted colour. `default` keeps the size and colour of the\n * container around it.\n */\nconst textDisplayVariants = cva(\n  \"m-0 min-w-0 whitespace-pre-line break-words [overflow-wrap:anywhere]\",\n  {\n    variants: {\n      size: {\n        default: \"\",\n        \"heading-1\":\n          \"text-2xl font-bold leading-[1.375] text-newt-text-primary\",\n        \"heading-2\": \"text-xl font-bold leading-[1.375] text-newt-text-primary\",\n        \"heading-3\":\n          \"text-base font-bold leading-[1.375] text-newt-text-primary\",\n        subtext: \"text-[13px] leading-[1.3] text-newt-text-muted\",\n      },\n    },\n    defaultVariants: {\n      size: \"default\",\n    },\n  }\n)\n\nexport interface TextDisplayProps\n  extends\n    React.HTMLAttributes<HTMLElement>,\n    VariantProps<typeof textDisplayVariants> {\n  /**\n   * The element or component to render. Defaults to `div`; pass `h2` or\n   * `h3` when a heading size is also a heading of the page.\n   */\n  as?: React.ElementType\n}\n\n/*\n * A block of message text, the most common Components V2 part. Line breaks\n * in the text are kept (`white-space: pre-line`), so a string with `\\n`\n * renders the way the message was written.\n */\nconst TextDisplay = React.forwardRef<HTMLElement, TextDisplayProps>(\n  ({ as: Tag = \"div\", className, size, ...props }, ref) => (\n    <Tag\n      ref={ref}\n      className={cn(textDisplayVariants({ size }), className)}\n      {...props}\n    />\n  )\n)\nTextDisplay.displayName = \"TextDisplay\"\n\nexport { TextDisplay, textDisplayVariants }\n",
      "type": "registry:ui"
    }
  ]
}