{
  "name": "user-panel",
  "type": "registry:ui",
  "framework": "react",
  "title": "User Panel",
  "description": "The strip at the foot of a sidebar: the signed-in user and their mute, deafen and settings controls.",
  "files": [
    {
      "path": "ui/user-panel.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/*\n * The strip at the foot of a sidebar: who you are signed in as, and the two\n * or three controls that follow you everywhere. Put the avatar first, then\n * `UserPanelInfo`, then `UserPanelActions`.\n */\nconst UserPanel = React.forwardRef<\n  HTMLElement,\n  React.ComponentProps<\"section\">\n>(({ className, \"aria-label\": label = \"User controls\", ...props }, ref) => (\n  <section\n    ref={ref}\n    aria-label={label}\n    className={cn(\n      \"flex w-full items-center gap-2 rounded-[var(--newt-radius-md)] bg-newt-bg-base p-2\",\n      className\n    )}\n    {...props}\n  />\n))\nUserPanel.displayName = \"UserPanel\"\n\nexport interface UserPanelInfoProps extends React.ComponentProps<\"div\"> {\n  name: string\n  /** The quieter line under the name: a status, a tag, an activity. */\n  status?: string\n}\n\nconst UserPanelInfo = React.forwardRef<HTMLDivElement, UserPanelInfoProps>(\n  ({ className, name, status, ...props }, ref) => (\n    <div\n      ref={ref}\n      className={cn(\"flex min-w-0 flex-1 flex-col\", className)}\n      {...props}\n    >\n      <span className=\"truncate text-sm font-semibold leading-[18px] text-newt-text-primary\">\n        {name}\n      </span>\n      {status === undefined ? null : (\n        <span className=\"truncate text-xs leading-4 text-newt-text-muted\">\n          {status}\n        </span>\n      )}\n    </div>\n  )\n)\nUserPanelInfo.displayName = \"UserPanelInfo\"\n\nconst UserPanelActions = React.forwardRef<\n  HTMLDivElement,\n  React.ComponentProps<\"div\">\n>(({ className, ...props }, ref) => (\n  <div ref={ref} className={cn(\"flex shrink-0\", className)} {...props} />\n))\nUserPanelActions.displayName = \"UserPanelActions\"\n\nexport type UserPanelIcon = \"microphone\" | \"headphones\" | \"settings\"\n\nexport interface UserPanelButtonProps extends Omit<\n  React.ComponentProps<\"button\">,\n  \"children\"\n> {\n  icon: UserPanelIcon\n  /** The button's accessible name; it has no visible text. */\n  label: string\n  /**\n   * Makes the button a switch. On, the icon is struck through as well as\n   * recoloured, so the state does not rest on colour.\n   */\n  pressed?: boolean\n  onPressedChange?: (pressed: boolean) => void\n}\n\nconst UserPanelButton = React.forwardRef<\n  HTMLButtonElement,\n  UserPanelButtonProps\n>(\n  (\n    { className, icon, label, pressed, onPressedChange, onClick, ...props },\n    ref\n  ) => (\n    <button\n      ref={ref}\n      type=\"button\"\n      aria-label={label}\n      aria-pressed={pressed}\n      onClick={(event) => {\n        onClick?.(event)\n        if (!event.defaultPrevented && pressed !== undefined) {\n          onPressedChange?.(!pressed)\n        }\n      }}\n      className={cn(\n        \"inline-flex h-8 w-8 items-center justify-center rounded-[var(--newt-radius-sm)] text-newt-text-secondary transition-colors duration-fast ease-newt hover:bg-newt-bg-hover hover:text-newt-text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-newt-text-link aria-pressed:text-newt-danger\",\n        className\n      )}\n      {...props}\n    >\n      <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" className=\"h-[18px] w-[18px]\">\n        {icon === \"microphone\" ? (\n          <>\n            <path\n              fill=\"currentColor\"\n              d=\"M8 1.5a2 2 0 0 0-2 2v4a2 2 0 0 0 4 0v-4a2 2 0 0 0-2-2Z\"\n            />\n            <path\n              fill=\"none\"\n              stroke=\"currentColor\"\n              strokeWidth=\"1.5\"\n              strokeLinecap=\"round\"\n              d=\"M3.5 7.5a4.5 4.5 0 0 0 9 0M8 12v2.5\"\n            />\n          </>\n        ) : icon === \"headphones\" ? (\n          <>\n            <path\n              fill=\"none\"\n              stroke=\"currentColor\"\n              strokeWidth=\"1.5\"\n              strokeLinecap=\"round\"\n              d=\"M2.75 9.5V8a5.25 5.25 0 0 1 10.5 0v1.5\"\n            />\n            <rect x=\"2\" y=\"9\" width=\"3\" height=\"5\" rx=\"1\" fill=\"currentColor\" />\n            <rect\n              x=\"11\"\n              y=\"9\"\n              width=\"3\"\n              height=\"5\"\n              rx=\"1\"\n              fill=\"currentColor\"\n            />\n          </>\n        ) : (\n          <>\n            <circle\n              cx=\"8\"\n              cy=\"8\"\n              r=\"5.2\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              strokeWidth=\"2.6\"\n              strokeDasharray=\"2.2 1.88\"\n            />\n            <circle\n              cx=\"8\"\n              cy=\"8\"\n              r=\"2.4\"\n              fill=\"none\"\n              stroke=\"currentColor\"\n              strokeWidth=\"1.5\"\n            />\n          </>\n        )}\n        {pressed === true ? (\n          <path\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.75\"\n            strokeLinecap=\"round\"\n            d=\"M2.5 2.5l11 11\"\n          />\n        ) : null}\n      </svg>\n    </button>\n  )\n)\nUserPanelButton.displayName = \"UserPanelButton\"\n\nexport { UserPanel, UserPanelInfo, UserPanelActions, UserPanelButton }\n",
      "type": "registry:ui"
    }
  ]
}