{
  "name": "system-message",
  "type": "registry:ui",
  "framework": "react",
  "title": "System Message",
  "description": "The lines a channel writes about itself — joins, boosts, pins — with no author and no avatar.",
  "dependencies": [
    "class-variance-authority"
  ],
  "files": [
    {
      "path": "ui/system-message.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 lines a channel writes about itself: somebody joined, somebody boosted,\n * a message was pinned. They sit in the timeline where a message would, but\n * they have no author and no avatar — the icon carries the whole meaning, and\n * the colour says which kind of event it was.\n */\nconst systemMessageVariants = cva(\"shrink-0\", {\n  variants: {\n    kind: {\n      join: \"text-newt-online\",\n      leave: \"text-newt-dnd\",\n      boost: \"text-[#ff73fa]\",\n      pin: \"text-newt-text-muted\",\n      call: \"text-newt-online\",\n    },\n  },\n  defaultVariants: { kind: \"join\" },\n})\n\n/*\n * Drawn here rather than pulled from an icon set: the registry ships no\n * runtime dependency, and each of these is one shape.\n */\nconst ICONS = {\n  join: \"M12 4a1 1 0 0 1 1 1v6h6a1 1 0 1 1 0 2h-6v6a1 1 0 1 1-2 0v-6H5a1 1 0 1 1 0-2h6V5a1 1 0 0 1 1-1Z\",\n  leave:\n    \"M7.05 5.64a1 1 0 0 1 1.41 0L12 9.17l3.54-3.53a1 1 0 1 1 1.41 1.41L13.41 10.6l3.54 3.53a1 1 0 0 1-1.41 1.42L12 12.01l-3.54 3.54a1 1 0 0 1-1.41-1.42l3.53-3.53-3.53-3.54a1 1 0 0 1 0-1.42Z\",\n  boost:\n    \"M12 2.5 14.8 8l6.2.9-4.5 4.3 1.1 6.1-5.6-3-5.6 3 1.1-6.1L3 8.9 9.2 8 12 2.5Z\",\n  pin: \"M14.5 2.5a1 1 0 0 1 1.7.7v4.3l3.1 3.1a1 1 0 0 1-.7 1.7h-5.2l-1.7 6.9a1 1 0 0 1-1.9.1L8 12.3H3.8a1 1 0 0 1-.7-1.7l3.1-3.1V3.2a1 1 0 0 1 1.7-.7h6.6Z\",\n  call: \"M6.6 3a1 1 0 0 1 .9.6l1.4 3a1 1 0 0 1-.3 1.2L7.2 8.9a11 11 0 0 0 4.9 4.9l1.1-1.4a1 1 0 0 1 1.2-.3l3 1.4a1 1 0 0 1 .6.9v2.9a1 1 0 0 1-1.1 1A15.4 15.4 0 0 1 3.6 4.1 1 1 0 0 1 4.6 3h2Z\",\n} as const satisfies Record<\n  NonNullable<VariantProps<typeof systemMessageVariants>[\"kind\"]>,\n  string\n>\n\nexport interface SystemMessageProps\n  extends\n    React.HTMLAttributes<HTMLDivElement>,\n    VariantProps<typeof systemMessageVariants> {\n  /** Replaces the drawn glyph, for an event this list does not cover. */\n  icon?: React.ReactNode\n}\n\nconst SystemMessage = React.forwardRef<HTMLDivElement, SystemMessageProps>(\n  ({ className, kind = \"join\", icon, children, ...props }, ref) => (\n    <div\n      ref={ref}\n      className={cn(\n        \"flex items-center gap-3 px-2 py-1 text-sm leading-[1.375] text-newt-text-muted\",\n        className\n      )}\n      {...props}\n    >\n      <span\n        aria-hidden=\"true\"\n        className={cn(\n          \"flex h-4 w-4 items-center justify-center\",\n          systemMessageVariants({ kind })\n        )}\n      >\n        {icon ?? (\n          <svg viewBox=\"0 0 24 24\" className=\"h-full w-full\">\n            <path fill=\"currentColor\" d={ICONS[kind ?? \"join\"]} />\n          </svg>\n        )}\n      </span>\n      <span className=\"min-w-0\">{children}</span>\n    </div>\n  )\n)\nSystemMessage.displayName = \"SystemMessage\"\n\n/** The name inside a system line, which is bolder than the sentence it sits in. */\nconst SystemMessageActor = React.forwardRef<\n  HTMLSpanElement,\n  React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n  <span\n    ref={ref}\n    className={cn(\"font-medium text-newt-text-primary\", className)}\n    {...props}\n  />\n))\nSystemMessageActor.displayName = \"SystemMessageActor\"\n\nconst SystemMessageTime = React.forwardRef<\n  HTMLSpanElement,\n  React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n  <span\n    ref={ref}\n    className={cn(\"text-xs text-newt-text-muted\", className)}\n    {...props}\n  />\n))\nSystemMessageTime.displayName = \"SystemMessageTime\"\n\nexport {\n  SystemMessage,\n  SystemMessageActor,\n  SystemMessageTime,\n  systemMessageVariants,\n}\n",
      "type": "registry:ui"
    }
  ]
}