{
  "name": "channel-welcome",
  "type": "registry:ui",
  "framework": "react",
  "title": "Channel Welcome",
  "description": "The header that opens a channel, shown above its very first message.",
  "files": [
    {
      "path": "ui/channel-welcome.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* The header that opens a channel, shown above its very first message. */\nconst ChannelWelcome = React.forwardRef<\n  HTMLElement,\n  React.ComponentProps<\"section\">\n>(({ className, ...props }, ref) => (\n  <section ref={ref} className={cn(\"px-4 pb-2 pt-10\", className)} {...props} />\n))\nChannelWelcome.displayName = \"ChannelWelcome\"\n\nconst ChannelWelcomeIcon = React.forwardRef<\n  HTMLDivElement,\n  React.ComponentProps<\"div\">\n>(({ className, children = \"#\", ...props }, ref) => (\n  <div\n    ref={ref}\n    aria-hidden=\"true\"\n    className={cn(\n      \"mb-4 flex h-[68px] w-[68px] items-center justify-center rounded-full bg-newt-bg-elevated text-[32px] font-bold leading-none text-newt-text-primary\",\n      className\n    )}\n    {...props}\n  >\n    {children}\n  </div>\n))\nChannelWelcomeIcon.displayName = \"ChannelWelcomeIcon\"\n\nconst ChannelWelcomeTitle = React.forwardRef<\n  HTMLHeadingElement,\n  React.ComponentProps<\"h2\">\n>(({ className, ...props }, ref) => (\n  <h2\n    ref={ref}\n    className={cn(\n      \"text-[28px] font-bold leading-tight text-newt-text-primary\",\n      className\n    )}\n    {...props}\n  />\n))\nChannelWelcomeTitle.displayName = \"ChannelWelcomeTitle\"\n\nconst ChannelWelcomeDescription = React.forwardRef<\n  HTMLParagraphElement,\n  React.ComponentProps<\"p\">\n>(({ className, ...props }, ref) => (\n  <p\n    ref={ref}\n    className={cn(\"mt-2 text-base text-newt-text-muted\", className)}\n    {...props}\n  />\n))\nChannelWelcomeDescription.displayName = \"ChannelWelcomeDescription\"\n\nexport interface ChannelWelcomeActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  /**\n   * The element or component to render. Defaults to `button`, or to `a` when\n   * `href` is set; pass a router link component to keep client navigation.\n   * `span` renders the decorative form: hidden from assistive technology, out\n   * of the tab order, with no pointer and no hover.\n   * Its event handlers do not run.\n   */\n  as?: React.ElementType\n  /** Render a link to this URL. */\n  href?: string\n  /**\n   * Turns the control off. A link loses its URL, which takes it out of the\n   * tab order, and says so with `aria-disabled`.\n   */\n  disabled?: boolean\n  /** Link target, with `href`. */\n  target?: React.AnchorHTMLAttributes<HTMLAnchorElement>[\"target\"]\n  /** Link relationship, with `href`. */\n  rel?: string\n}\n\n/*\n * The `span` form runs nothing: it drops every event handler, so a click\n * cannot start an action that the keyboard and assistive technology miss.\n */\nfunction withoutHandlers(\n  props: React.HTMLAttributes<HTMLElement>\n): React.HTMLAttributes<HTMLElement> {\n  return Object.fromEntries(\n    Object.entries(props).filter(([name]) => !/^on[A-Z]/.test(name))\n  )\n}\n\nconst ChannelWelcomeAction = React.forwardRef<\n  HTMLElement,\n  ChannelWelcomeActionProps\n>(({ as, href, disabled, className, type = \"button\", ...props }, ref) => {\n  const Tag: React.ElementType = as ?? (href === undefined ? \"button\" : \"a\")\n  const isButton = Tag === \"button\"\n  const decorative = Tag === \"span\"\n  return (\n    <Tag\n      ref={ref}\n      type={isButton ? type : undefined}\n      href={decorative || disabled ? undefined : href}\n      disabled={isButton ? disabled : undefined}\n      aria-disabled={!isButton && !decorative && disabled ? true : undefined}\n      aria-hidden={decorative ? true : undefined}\n      className={cn(\n        \"mt-3 inline-flex items-center gap-2 rounded-[var(--newt-radius-sm)] border-0 bg-newt-bg-elevated px-4 py-1.5 text-sm font-medium text-newt-text-primary no-underline\",\n        !decorative &&\n          \"cursor-pointer transition-colors duration-fast ease-newt hover:bg-newt-bg-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-newt-text-link disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50\",\n        className\n      )}\n      {...(decorative ? withoutHandlers(props) : props)}\n    />\n  )\n})\nChannelWelcomeAction.displayName = \"ChannelWelcomeAction\"\n\nexport interface ChannelWelcomeDateProps extends Omit<\n  React.ComponentProps<\"div\">,\n  \"children\"\n> {\n  /** Machine-readable date for the rendered `<time>` element. */\n  dateTime?: string\n  children?: React.ReactNode\n}\n\n/* Creation date, centred between two hairlines. */\nconst ChannelWelcomeDate = React.forwardRef<\n  HTMLDivElement,\n  ChannelWelcomeDateProps\n>(({ className, dateTime, children, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\n      \"mt-6 grid grid-cols-[1fr_auto_1fr] items-center gap-2 text-[12px] font-semibold uppercase tracking-wide text-newt-text-muted\",\n      \"[&>span]:h-px [&>span]:bg-newt-border\",\n      className\n    )}\n    {...props}\n  >\n    <span aria-hidden=\"true\" />\n    <time dateTime={dateTime}>{children}</time>\n    <span aria-hidden=\"true\" />\n  </div>\n))\nChannelWelcomeDate.displayName = \"ChannelWelcomeDate\"\n\nexport {\n  ChannelWelcome,\n  ChannelWelcomeIcon,\n  ChannelWelcomeTitle,\n  ChannelWelcomeDescription,\n  ChannelWelcomeAction,\n  ChannelWelcomeDate,\n}\n",
      "type": "registry:ui"
    }
  ]
}