{
  "name": "invite",
  "type": "registry:ui",
  "framework": "react",
  "title": "Invite",
  "description": "The server invite card a link unfurls into inside a message.",
  "registryDependencies": [
    "@newtui/button"
  ],
  "files": [
    {
      "path": "ui/invite.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* The server-invite card a link unfurls into inside a message. */\nconst Invite = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\n      \"max-w-[432px] rounded-[var(--newt-radius-md)] bg-newt-bg-surface px-4 pb-4 pt-2 text-newt-text-primary\",\n      className\n    )}\n    {...props}\n  />\n))\nInvite.displayName = \"Invite\"\n\nconst InviteEyebrow = React.forwardRef<\n  HTMLSpanElement,\n  React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n  <span\n    ref={ref}\n    className={cn(\n      \"text-[12px] font-extrabold uppercase tracking-[0.02em] text-newt-text-muted\",\n      className\n    )}\n    {...props}\n  />\n))\nInviteEyebrow.displayName = \"InviteEyebrow\"\n\nconst InviteBody = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\"mt-2 flex items-center gap-4\", className)}\n    {...props}\n  />\n))\nInviteBody.displayName = \"InviteBody\"\n\n/*\n * The props of the element or component `as` names, so a custom image\n * component's own props type-check.\n */\nexport type InviteIconProps<E extends React.ElementType = \"img\"> = {\n  /**\n   * The image element or component to render. Defaults to `img`; pass your\n   * framework's image component for optimised sources.\n   */\n  as?: E\n} & Omit<React.ComponentPropsWithRef<E>, \"as\">\n\ntype InviteIconComponent = {\n  <E extends React.ElementType = \"img\">(\n    props: InviteIconProps<E>\n  ): React.ReactNode\n  displayName?: string\n}\n\n/*\n * SAFETY: `forwardRef` drops the generic signature. The render hands every\n * prop it does not set itself to `as` unchanged, so the props of `as` are\n * the props the part receives.\n */\n// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see SAFETY\nconst InviteIcon = React.forwardRef<HTMLImageElement, InviteIconProps>(\n  ({ as: Tag = \"img\", className, alt = \"\", ...props }, ref) => (\n    <Tag\n      ref={ref}\n      alt={alt}\n      aria-hidden={alt === \"\" ? true : undefined}\n      className={cn(\n        \"h-12 w-12 shrink-0 rounded-[var(--newt-radius-md)] object-cover\",\n        className\n      )}\n      {...props}\n    />\n  )\n) as InviteIconComponent\nInviteIcon.displayName = \"InviteIcon\"\n\nconst InviteInfo = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div ref={ref} className={cn(\"min-w-0 flex-1\", className)} {...props} />\n))\nInviteInfo.displayName = \"InviteInfo\"\n\n/*\n * The props of the element or component `as` names, so a router link's own\n * props, such as `to`, type-check.\n */\nexport type InviteNameProps<E extends React.ElementType = \"a\"> = {\n  /**\n   * The element or component to render. Defaults to `a`; pass a router link\n   * component to keep client navigation.\n   */\n  as?: E\n} & Omit<React.ComponentPropsWithRef<E>, \"as\">\n\ntype InviteNameComponent = {\n  <E extends React.ElementType = \"a\">(\n    props: InviteNameProps<E>\n  ): React.ReactNode\n  displayName?: string\n}\n\n/*\n * SAFETY: `forwardRef` drops the generic signature. The render hands every\n * prop it does not set itself to `as` unchanged, so the props of `as` are\n * the props the part receives.\n */\n// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- see SAFETY\nconst InviteName = React.forwardRef<HTMLAnchorElement, InviteNameProps>(\n  ({ as: Tag = \"a\", className, ...props }, ref) => (\n    <Tag\n      ref={ref}\n      className={cn(\n        \"block truncate font-bold text-newt-text-primary no-underline hover:underline\",\n        className\n      )}\n      {...props}\n    />\n  )\n) as InviteNameComponent\nInviteName.displayName = \"InviteName\"\n\nconst InviteCounts = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\n      \"mt-0.5 flex items-center gap-3 text-sm text-newt-text-muted\",\n      className\n    )}\n    {...props}\n  />\n))\nInviteCounts.displayName = \"InviteCounts\"\n\nexport interface InviteCountProps extends React.HTMLAttributes<HTMLSpanElement> {\n  /** Green dot for the online count, muted for the member total. */\n  online?: boolean\n}\n\nconst InviteCount = React.forwardRef<HTMLSpanElement, InviteCountProps>(\n  ({ className, online = false, children, ...props }, ref) => (\n    <span\n      ref={ref}\n      className={cn(\"inline-flex items-center gap-1.5\", className)}\n      {...props}\n    >\n      <span\n        aria-hidden=\"true\"\n        className={cn(\n          \"h-2 w-2 shrink-0 rounded-full\",\n          online ? \"bg-newt-online\" : \"bg-newt-offline\"\n        )}\n      />\n      {children}\n    </span>\n  )\n)\nInviteCount.displayName = \"InviteCount\"\n\nexport {\n  Invite,\n  InviteEyebrow,\n  InviteBody,\n  InviteIcon,\n  InviteInfo,\n  InviteName,\n  InviteCounts,\n  InviteCount,\n}\n",
      "type": "registry:ui"
    }
  ]
}