{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chat-parts",
  "title": "Chat parts",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "Reasoning that opens while the model thinks, tool calls with status, input and output, sources, citations and images.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.5",
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://uiset.dev/r/uiset.json",
    "https://uiset.dev/r/chat.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/chat-parts.tsx",
      "content": "\"use client\"\n\nimport {\n  Collapsible,\n  CollapsiblePanel,\n  CollapsibleTrigger,\n} from \"@ui-sdk/react/collapsible\"\nimport { HoverCard, HoverCardContent, HoverCardTrigger } from \"@ui-sdk/react/hover-card\"\nimport { useEffect, useRef, useState, type ReactNode } from \"react\"\nimport { ChatShimmer } from \"./chat\"\nimport \"./chat/chat.css\"\n\n// Opens while the model thinks, closes when it's done, unless the person chose.\nfunction ChatReasoning({\n  streaming = false,\n  seconds,\n  children,\n}: {\n  streaming?: boolean\n  seconds?: number\n  children: ReactNode\n}) {\n  const [open, setOpen] = useState(streaming)\n  const chosen = useRef(false)\n\n  useEffect(() => {\n    if (!chosen.current) setOpen(streaming)\n  }, [streaming])\n\n  return (\n    <Collapsible\n      className=\"chat-reasoning\"\n      open={open}\n      onOpenChange={(next) => {\n        // Only people and agents call this; the streaming effect sets `open` directly.\n        chosen.current = true\n        setOpen(next)\n      }}\n    >\n      <CollapsibleTrigger className=\"chat-disclosure\">\n        {streaming ? (\n          <ChatShimmer>Thinking…</ChatShimmer>\n        ) : (\n          <span>\n            {seconds ? `Thought for ${Math.max(1, Math.round(seconds))}s` : \"Reasoning\"}\n          </span>\n        )}\n      </CollapsibleTrigger>\n      <CollapsiblePanel className=\"chat-reasoning-panel\">{children}</CollapsiblePanel>\n    </Collapsible>\n  )\n}\n\ntype ToolStatus = \"pending\" | \"running\" | \"approval\" | \"done\" | \"error\" | \"denied\"\n\nconst toolWords: Record<ToolStatus, string> = {\n  pending: \"Queued\",\n  running: \"Running\",\n  approval: \"Needs your approval\",\n  done: \"Done\",\n  error: \"Failed\",\n  denied: \"Not allowed\",\n}\n\nfunction json(value: unknown) {\n  if (typeof value === \"string\") return value\n  try {\n    return JSON.stringify(value, null, 2)\n  } catch {\n    return String(value)\n  }\n}\n\nfunction ChatTool({\n  name,\n  title,\n  status,\n  input,\n  output,\n  error,\n  defaultOpen,\n  children,\n}: {\n  name: string\n  title?: string\n  status: ToolStatus\n  input?: unknown\n  output?: unknown\n  error?: string\n  defaultOpen?: boolean\n  children?: ReactNode\n}) {\n  return (\n    <Collapsible\n      className=\"chat-tool\"\n      data-status={status}\n      defaultOpen={defaultOpen ?? (status === \"approval\" || status === \"error\")}\n    >\n      <CollapsibleTrigger className=\"chat-disclosure\">\n        <span className=\"chat-tool-name\">\n          <span className=\"chat-tool-mark\" aria-hidden=\"true\" />\n          <span translate=\"no\">{title ?? name}</span>\n        </span>\n        <span className=\"chat-visually-hidden\">, </span>\n        <span className=\"chat-tool-status\">{toolWords[status]}</span>\n      </CollapsibleTrigger>\n      <CollapsiblePanel className=\"chat-tool-panel\">\n        {input !== undefined && (\n          <section>\n            <h4>Input</h4>\n            <pre tabIndex={0} role=\"region\" aria-label={`${title ?? name} input`}>\n              <code translate=\"no\">{json(input)}</code>\n            </pre>\n          </section>\n        )}\n        {error ? (\n          <section>\n            <h4>Error</h4>\n            <p className=\"chat-tool-error\">{error}</p>\n          </section>\n        ) : (\n          output !== undefined && (\n            <section>\n              <h4>Output</h4>\n              <pre tabIndex={0} role=\"region\" aria-label={`${title ?? name} output`}>\n                <code translate=\"no\">{json(output)}</code>\n              </pre>\n            </section>\n          )\n        )}\n        {children}\n      </CollapsiblePanel>\n    </Collapsible>\n  )\n}\n\ntype Source = { href: string; title: string; description?: string }\n\nfunction host(href: string) {\n  try {\n    return new URL(href).hostname.replace(/^www\\./, \"\")\n  } catch {\n    return href\n  }\n}\n\nfunction ChatSources({ sources }: { sources: Source[] }) {\n  if (!sources.length) return null\n  return (\n    <Collapsible className=\"chat-sources\">\n      <CollapsibleTrigger className=\"chat-disclosure\">\n        <span>\n          Used {sources.length} source{sources.length === 1 ? \"\" : \"s\"}\n        </span>\n      </CollapsibleTrigger>\n      <CollapsiblePanel>\n        <ol className=\"chat-source-list\">\n          {sources.map((source) => (\n            <li key={source.href}>\n              <a href={source.href} target=\"_blank\" rel=\"noopener noreferrer\">\n                {source.title}\n                <span className=\"chat-visually-hidden\"> (opens in a new tab)</span>\n              </a>\n              <span className=\"chat-source-host\">{host(source.href)}</span>\n            </li>\n          ))}\n        </ol>\n      </CollapsiblePanel>\n    </Collapsible>\n  )\n}\n\nfunction ChatCitation({ index, source }: { index: number; source: Source }) {\n  return (\n    <HoverCard>\n      <HoverCardTrigger\n        className=\"chat-citation\"\n        render={<a href={source.href} target=\"_blank\" rel=\"noopener noreferrer\" />}\n        aria-label={`Source ${index}: ${source.title}`}\n      >\n        {index}\n      </HoverCardTrigger>\n      <HoverCardContent className=\"chat-citation-card\">\n        <p className=\"chat-citation-title\">{source.title}</p>\n        <p className=\"chat-source-host\">{host(source.href)}</p>\n        {source.description && <p>{source.description}</p>}\n      </HoverCardContent>\n    </HoverCard>\n  )\n}\n\nfunction ChatImage({\n  src,\n  alt,\n  width,\n  height,\n  caption,\n}: {\n  src: string\n  alt: string\n  width: number\n  height: number\n  caption?: string\n}) {\n  return (\n    <figure className=\"chat-image\">\n      <img\n        src={src}\n        alt={alt}\n        width={width}\n        height={height}\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n      {caption && <figcaption>{caption}</figcaption>}\n    </figure>\n  )\n}\n\nexport { ChatCitation, ChatImage, ChatReasoning, ChatSources, ChatTool }\nexport type { Source as ChatSource, ToolStatus as ChatToolStatus }\n",
      "type": "registry:ui",
      "target": "@ui/chat-parts.tsx"
    },
    {
      "path": "registry/uiset/ui/chat/chat.css",
      "content": "@layer ui-sdk, uiset.tokens, uiset.base, uiset.skin;\n\n@layer uiset.base {\n  :where([data-uiset]) {\n    --chat-bubble: var(--ui-primary);\n    --chat-bubble-text: var(--ui-primary-foreground);\n    --chat-surface: var(--ui-muted);\n    --chat-code-bg: var(--ui-muted);\n\n    /* Code token colors live in code/code.css, shared with the IDE kit. */\n  }\n\n  /* A user's plain message and the files they attached (the chat-app template). */\n  .chat-plain {\n    margin: 0;\n  }\n\n  .chat-file-note {\n    color: var(--ui-muted-foreground);\n    font-size: 0.8125rem;\n  }\n\n  .chat-visually-hidden {\n    position: absolute;\n    width: 1px;\n    height: 1px;\n    overflow: hidden;\n    clip-path: inset(50%);\n    white-space: nowrap;\n  }\n\n  .chat-icon {\n    width: 1rem;\n    height: 1rem;\n    fill: none;\n    stroke: currentColor;\n    stroke-width: 1.75;\n    stroke-linecap: round;\n    stroke-linejoin: round;\n  }\n\n  /* Thread */\n\n  .chat-thread {\n    position: relative;\n    min-height: 0;\n  }\n\n  .chat-thread-scroller {\n    max-height: var(--chat-thread-height, 26rem);\n    overflow-y: auto;\n    overscroll-behavior: contain;\n    border-radius: var(--ui-radius, 0px);\n\n    &:focus-visible {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 2px;\n    }\n  }\n\n  .chat-thread-log {\n    display: flex;\n    flex-direction: column;\n    gap: 1rem;\n    padding: 0.25rem 0.25rem 0.75rem;\n  }\n\n  .chat-thread-jump {\n    position: absolute;\n    bottom: 0.5rem;\n    left: 50%;\n    translate: -50% 0;\n    box-shadow: var(--ui-shadow);\n  }\n\n  .chat-empty {\n    display: grid;\n    justify-items: center;\n    gap: 0.75rem;\n    padding: 2.5rem 1rem;\n    text-align: center;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-empty-title {\n    margin: 0;\n    font-size: 1.125rem;\n    font-weight: 600;\n    color: var(--ui-foreground);\n  }\n\n  /* Messages */\n\n  .chat-message {\n    display: grid;\n    grid-template-columns: auto minmax(0, 1fr);\n    gap: 0.625rem;\n    align-items: start;\n\n    &:not(:has(.chat-message-avatar)) {\n      grid-template-columns: minmax(0, 1fr);\n    }\n  }\n\n  .chat-message-avatar {\n    width: 1.75rem;\n    height: 1.75rem;\n    font-size: 0.75rem;\n  }\n\n  .chat-message-body {\n    display: grid;\n    gap: 0.25rem;\n    min-width: 0;\n  }\n\n  .chat-message-meta {\n    display: flex;\n    align-items: baseline;\n    gap: 0.5rem;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-message-name {\n    font-weight: 600;\n    color: var(--ui-foreground);\n  }\n\n  .chat-message-content {\n    display: grid;\n    gap: 0.5rem;\n    line-height: 1.55;\n    /* A long URL or token wraps rather than widening the message. (Short messages stay on\n       one line because a person's bubble may use 90% of the row, see below.) */\n    overflow-wrap: anywhere;\n  }\n\n  /* The body takes the row and puts the bubble at its end; a bubble's 90% is of the row,\n     not of a body shrunk to the name and time above it. */\n  .chat-message[data-from=\"user\"] {\n    grid-template-columns: minmax(0, 1fr) auto;\n\n    .chat-message-avatar {\n      order: 2;\n    }\n\n    .chat-message-body {\n      justify-items: end;\n    }\n\n    .chat-message-content {\n      max-width: min(36rem, 90%);\n      padding: 0.5rem 0.875rem;\n      border-radius: calc(var(--ui-radius, 0px) + 10px);\n      background: var(--chat-bubble);\n      color: var(--chat-bubble-text);\n    }\n  }\n\n  /* Without an avatar, a person's bubble sits flush at the end of the row. */\n  .chat-message[data-from=\"user\"]:not(:has(.chat-message-avatar)) {\n    grid-template-columns: minmax(0, 1fr);\n  }\n\n  /* Files in a person's own bubble read in the bubble's text color. */\n  .chat-message[data-from=\"user\"] .chat-message-content :is(a, figcaption) {\n    color: inherit;\n  }\n\n  .chat-message[data-from=\"system\"] .chat-message-content {\n    color: var(--ui-muted-foreground);\n    font-style: italic;\n  }\n\n  .chat-message[data-streaming] .chat-message-content > :last-child::after {\n    content: \"▍\";\n    margin-inline-start: 1px;\n    animation: chat-blink 1s steps(2) infinite;\n  }\n\n  @keyframes chat-blink {\n    50% {\n      opacity: 0;\n    }\n  }\n\n  :is(.chat-actions, .chat-suggestions)[data-slot=\"toolbar\"] {\n    padding: 0;\n    border: 0;\n    background: none;\n    box-shadow: none;\n  }\n\n  .chat-actions,\n  .chat-suggestions {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.25rem;\n  }\n\n  .chat-actions {\n    :is([data-slot=\"toolbar-button\"], [data-slot=\"toggle\"]) {\n      height: 1.875rem;\n      width: 1.875rem;\n      padding: 0;\n      border-color: transparent;\n      background: transparent;\n      color: var(--ui-muted-foreground);\n\n      &:hover {\n        background: var(--ui-muted);\n        color: var(--ui-foreground);\n      }\n\n      &[data-pressed] {\n        color: var(--ui-foreground);\n        background: var(--ui-muted);\n      }\n    }\n\n    [data-slot=\"toggle-group\"] {\n      display: flex;\n      gap: 0.25rem;\n    }\n  }\n\n  /* Suggestions are chips you can press: an outline, and a fill on hover. */\n  .chat-suggestions [data-slot=\"toolbar-button\"] {\n    height: auto;\n    min-height: 2rem;\n    padding: 0.375rem 0.875rem;\n    border: 1px solid var(--ui-border);\n    border-radius: 999px;\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    text-align: start;\n    white-space: normal;\n\n    &:hover:not([data-disabled]) {\n      border-color: var(--ui-input);\n      background: var(--ui-muted);\n    }\n  }\n\n  .chat-branch {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n    font-variant-numeric: tabular-nums;\n\n    [data-slot=\"button\"] {\n      width: 1.75rem;\n      height: 1.75rem;\n      padding: 0;\n    }\n  }\n\n  .chat-shimmer {\n    background: linear-gradient(\n        90deg,\n        var(--ui-muted-foreground) 0 40%,\n        var(--ui-foreground) 50%,\n        var(--ui-muted-foreground) 60% 100%\n      )\n      0 0 / 300% 100%;\n    background-clip: text;\n    color: transparent;\n    animation: chat-shimmer 1.8s linear infinite;\n  }\n\n  @keyframes chat-shimmer {\n    from {\n      background-position: 100% 0;\n    }\n    to {\n      background-position: 0 0;\n    }\n  }\n\n  /* Disclosures: reasoning, tools, sources, tasks */\n\n  .chat-disclosure {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.75rem;\n    width: 100%;\n    height: auto;\n    min-height: 2.25rem;\n    padding: 0.375rem 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius, 0px) + 4px);\n    background: var(--ui-background);\n    color: var(--ui-foreground);\n    font: inherit;\n    font-size: 0.8125rem;\n    text-align: start;\n    cursor: pointer;\n\n    &[data-open] {\n      border-end-start-radius: 0;\n      border-end-end-radius: 0;\n    }\n\n    /* The label takes the room, so a status (\"Done\") sits by the chevron at the end\n       rather than floating in the middle. */\n    & > :first-child {\n      flex: 1 1 auto;\n      min-inline-size: 0;\n    }\n  }\n\n  .chat-disclosure-meta,\n  .chat-tool-status {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  :is(.chat-reasoning, .chat-tool, .chat-sources, .chat-tasks)\n    [data-slot=\"collapsible-panel\"] {\n    padding: 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-top: 0;\n    border-end-start-radius: calc(var(--ui-radius, 0px) + 4px);\n    border-end-end-radius: calc(var(--ui-radius, 0px) + 4px);\n    font-size: 0.8125rem;\n  }\n\n  .chat-reasoning-panel {\n    color: var(--ui-muted-foreground);\n    white-space: pre-wrap;\n  }\n\n  .chat-tool-name {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.5rem;\n    font-weight: 500;\n  }\n\n  .chat-tool-mark {\n    width: 0.5rem;\n    height: 0.5rem;\n    border: 1.5px solid currentColor;\n    border-radius: 50%;\n  }\n\n  .chat-tool[data-status=\"done\"] .chat-tool-mark {\n    background: currentColor;\n  }\n\n  .chat-tool[data-status=\"running\"] .chat-tool-mark {\n    border-style: dashed;\n    animation: chat-blink 1s ease-in-out infinite;\n  }\n\n  .chat-tool[data-status=\"approval\"] {\n    --chat-tool-accent: oklch(0.72 0.16 75);\n\n    .chat-disclosure {\n      border-color: var(--chat-tool-accent);\n    }\n\n    .chat-tool-mark {\n      border-color: var(--chat-tool-accent);\n      background: var(--chat-tool-accent);\n    }\n  }\n\n  :is(.chat-tool[data-status=\"error\"], .chat-tool[data-status=\"denied\"]) .chat-tool-mark {\n    border-radius: 1px;\n    rotate: 45deg;\n  }\n\n  .chat-tool-panel {\n    display: grid;\n    gap: 0.625rem;\n\n    h4 {\n      margin: 0 0 0.25rem;\n      font-size: 0.75rem;\n      font-weight: 600;\n      color: var(--ui-muted-foreground);\n    }\n\n    pre {\n      margin: 0;\n      padding: 0.5rem;\n      max-height: 14rem;\n      overflow: auto;\n      border-radius: var(--ui-radius, 0px);\n      background: var(--chat-code-bg);\n      font-family: var(--ui-font-mono);\n      font-size: 0.75rem;\n    }\n  }\n\n  .chat-tool-error {\n    margin: 0;\n    color: var(--ui-destructive);\n  }\n\n  .chat-source-list,\n  .chat-task-list {\n    display: grid;\n    gap: 0.375rem;\n    margin: 0;\n    padding: 0;\n    list-style: none;\n  }\n\n  .chat-source-list li {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0 0.5rem;\n  }\n\n  .chat-source-host {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  .chat-citation {\n    display: inline-grid;\n    place-items: center;\n    min-width: 1.25rem;\n    height: 1.25rem;\n    margin-inline: 0.125rem;\n    padding-inline: 0.25rem;\n    border-radius: 999px;\n    background: var(--ui-muted);\n    color: var(--ui-foreground);\n    font-size: 0.6875rem;\n    font-weight: 600;\n    vertical-align: 0.125em;\n    text-decoration: none;\n  }\n\n  .chat-citation-card {\n    max-width: 18rem;\n    font-size: 0.8125rem;\n\n    p {\n      margin: 0 0 0.25rem;\n    }\n  }\n\n  .chat-citation-title {\n    font-weight: 600;\n  }\n\n  .chat-task-list li {\n    display: grid;\n    grid-template-columns: auto minmax(0, 1fr) auto;\n    align-items: center;\n    gap: 0 0.5rem;\n  }\n\n  .chat-task-mark {\n    width: 0.75rem;\n    height: 0.75rem;\n    border: 1.5px solid var(--ui-muted-foreground);\n    border-radius: 50%;\n  }\n\n  .chat-task-list li[data-status=\"done\"] {\n    .chat-task-mark {\n      border-color: var(--ui-primary);\n      background: var(--ui-primary);\n    }\n\n    .chat-task-title {\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  .chat-task-list li[data-status=\"running\"] .chat-task-mark {\n    border-style: dashed;\n    border-color: var(--ui-primary);\n  }\n\n  .chat-task-list li[data-status=\"failed\"] .chat-task-mark {\n    border-color: var(--ui-destructive);\n    border-radius: 2px;\n  }\n\n  .chat-task-status {\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  .chat-task-detail {\n    grid-column: 2 / -1;\n    color: var(--ui-muted-foreground);\n    font-size: 0.75rem;\n  }\n\n  .chat-image {\n    margin: 0;\n\n    img {\n      max-width: 100%;\n      height: auto;\n      border-radius: calc(var(--ui-radius, 0px) + 4px);\n    }\n\n    figcaption {\n      margin-top: 0.25rem;\n      font-size: 0.75rem;\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  /* Response: markdown */\n\n  .chat-response {\n    display: grid;\n    gap: 0.625rem;\n\n    > * {\n      margin: 0;\n    }\n\n    :is(ul, ol) {\n      margin: 0;\n      padding-inline-start: 1.25rem;\n    }\n\n    li + li {\n      margin-top: 0.25rem;\n    }\n\n    :is(h1, h2, h3, h4) {\n      margin: 0.5rem 0 0;\n      font-size: 1rem;\n      line-height: 1.3;\n    }\n\n    a {\n      color: inherit;\n      text-underline-offset: 0.2em;\n    }\n\n    :not(pre) > code {\n      padding: 0.0625rem 0.3125rem;\n      border-radius: calc(var(--ui-radius, 0px) / 2 + 2px);\n      background: var(--chat-code-bg);\n      font-family: var(--ui-font-mono);\n      font-size: 0.875em;\n    }\n\n    blockquote {\n      padding-inline-start: 0.75rem;\n      border-inline-start: 3px solid var(--ui-border);\n      color: var(--ui-muted-foreground);\n    }\n\n    hr {\n      margin: 0.25rem 0;\n    }\n\n    img {\n      max-width: 100%;\n      height: auto;\n    }\n  }\n\n  .chat-table {\n    max-width: 100%;\n    overflow-x: auto;\n\n    table {\n      border-collapse: collapse;\n      font-size: 0.8125rem;\n    }\n\n    :is(th, td) {\n      padding: 0.375rem 0.625rem;\n      border: 1px solid var(--ui-border);\n      text-align: start;\n    }\n  }\n\n  .chat-code {\n    margin: 0;\n    overflow: hidden;\n    border: 1px solid var(--ui-border);\n    border-radius: calc(var(--ui-radius, 0px) + 4px);\n    background: var(--chat-code-bg);\n\n    pre {\n      margin: 0;\n      padding: 0.75rem;\n      overflow-x: auto;\n      font-family: var(--ui-font-mono);\n      font-size: 0.8125rem;\n      line-height: 1.6;\n      color: var(--shiki-foreground);\n      tab-size: 2;\n\n      &:focus-visible {\n        outline: 2px solid var(--ui-ring-border);\n        outline-offset: -2px;\n      }\n    }\n\n    &[data-wrap] pre {\n      white-space: pre-wrap;\n      overflow-wrap: anywhere;\n    }\n  }\n\n  .chat-code-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 0.5rem;\n    padding: 0.25rem 0.25rem 0.25rem 0.75rem;\n    border-bottom: 1px solid var(--ui-border);\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-code-actions {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.25rem;\n\n    :is([data-slot=\"toggle\"], [data-slot=\"button\"]) {\n      height: 1.75rem;\n      min-width: 1.75rem;\n      padding: 0 0.5rem;\n      font-size: 0.75rem;\n    }\n  }\n\n  /* Composer */\n\n  .chat-composer,\n  .chat-composer > [data-slot=\"file-input\"] {\n    display: block;\n    width: 100%;\n    max-width: none;\n  }\n\n  .chat-composer-box {\n    display: grid;\n    gap: 0.375rem;\n    padding: 0.5rem;\n    border: 1px solid var(--ui-input);\n    border-radius: calc(var(--ui-radius, 0px) + 8px);\n    background: var(--ui-background);\n\n    &:focus-within {\n      outline: 2px solid var(--ui-ring-border);\n      outline-offset: 1px;\n    }\n\n    &[data-drag-over] {\n      outline: 2px dashed var(--ui-ring-border);\n    }\n  }\n\n  .chat-composer-input {\n    width: 100%;\n    min-height: 2.5rem;\n    max-height: 12rem;\n    padding: 0.375rem 0.5rem;\n    border: 0;\n    background: transparent;\n    color: inherit;\n    font: inherit;\n    resize: none;\n    field-sizing: content;\n  }\n\n  /* The composer box draws the focus ring for the field inside it. */\n  [data-uiset] .chat-composer-input[data-slot]:focus-visible {\n    outline: none;\n\n    &::placeholder {\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  /* Wraps on a phone, so the model picker and usage never widen the page. */\n  .chat-composer-toolbar {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 0.375rem;\n  }\n\n  .chat-composer-spacer {\n    flex: 1;\n  }\n\n  .chat-composer-attach {\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n  }\n\n  .chat-attachments {\n    display: flex;\n    flex-direction: row;\n    flex-wrap: wrap;\n    gap: 0.375rem;\n    margin: 0;\n    padding: 0;\n    border: 0;\n    border-radius: 0;\n    list-style: none;\n\n    &:empty {\n      display: none;\n    }\n  }\n\n  .chat-attachment {\n    display: inline-flex;\n    align-items: center;\n    gap: 0.375rem;\n    min-height: 0;\n    max-width: 16rem;\n    padding: 0.25rem 0.25rem 0.25rem 0.625rem;\n    border: 1px solid var(--ui-border);\n    border-radius: 999px;\n    background: var(--ui-muted);\n    font-size: 0.75rem;\n\n    [data-slot=\"file-input-item-remove\"] {\n      width: 1.5rem;\n      height: 1.5rem;\n      padding: 0;\n    }\n  }\n\n  .chat-attachment-name {\n    flex: 0 1 auto;\n    text-align: start;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .chat-attachment-size {\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-menu {\n    min-width: 14rem;\n  }\n\n  .chat-menu-label {\n    font-weight: 500;\n  }\n\n  .chat-menu-hint,\n  .chat-model-description {\n    display: block;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n  }\n\n  .chat-model-trigger {\n    height: 2rem;\n    min-width: 8rem;\n    font-size: 0.8125rem;\n  }\n\n  .chat-model-name {\n    display: block;\n  }\n\n  /* Each model's description sits under its name, as a command's does in the menu. */\n  .chat-model-list [data-slot=\"select-item\"] {\n    flex-direction: column;\n    align-items: flex-start;\n    gap: 0.0625rem;\n    padding-block: 0.4375rem;\n  }\n\n  .chat-usage {\n    white-space: nowrap;\n    display: inline-flex;\n    flex-direction: row;\n    align-items: center;\n    gap: 0.5rem;\n    min-width: 0;\n    width: auto;\n    font-size: 0.75rem;\n    color: var(--ui-muted-foreground);\n\n    [data-slot=\"meter-track\"] {\n      width: 4rem;\n      height: 0.375rem;\n    }\n\n    &[data-level=\"medium\"] [data-slot=\"meter-indicator\"] {\n      background: oklch(0.72 0.16 75);\n    }\n\n    &[data-level=\"high\"] [data-slot=\"meter-indicator\"] {\n      background: var(--ui-destructive);\n    }\n  }\n\n  .chat-dialog-actions {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 0.5rem;\n  }\n\n  /* Chat list */\n\n  /* No clipping here: focus rings on full-width rows (a chat, the rename field) stay whole.\n     The padding gives them room; the margin keeps the list aligned with what's around it. */\n  .chat-threads {\n    display: grid;\n    align-content: start;\n    gap: 0.5rem;\n    min-width: 0;\n    padding: 0.25rem;\n    margin: -0.25rem;\n\n    ul {\n      display: grid;\n      gap: 0.125rem;\n      margin: 0;\n      padding: 0;\n      list-style: none;\n    }\n\n    li {\n      display: flex;\n      align-items: center;\n      gap: 0.25rem;\n      min-width: 0;\n      border-radius: var(--ui-radius, 0px);\n\n      &[data-active] {\n        background: var(--ui-muted);\n      }\n    }\n  }\n\n  .chat-thread-link {\n    flex: 1 1 0;\n    justify-content: space-between;\n    min-width: 0;\n    overflow: hidden;\n    height: auto;\n    min-height: 2.25rem;\n    gap: 0.5rem;\n    text-align: start;\n\n    time {\n      flex-shrink: 0;\n      font-size: 0.75rem;\n      color: var(--ui-muted-foreground);\n    }\n  }\n\n  .chat-thread-title {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .chat-thread-more {\n    flex-shrink: 0;\n    width: 2rem;\n    height: 2rem;\n    padding: 0;\n    color: var(--ui-muted-foreground);\n\n    &:hover:not([data-disabled]),\n    &[data-open] {\n      background: var(--ui-muted);\n      color: var(--ui-foreground);\n    }\n  }\n\n  .chat-thread-rename {\n    flex: 1;\n  }\n\n  .chat-threads-empty {\n    margin: 0.5rem 0;\n    color: var(--ui-muted-foreground);\n  }\n\n  /* Launcher */\n\n  .chat-launcher {\n    position: fixed;\n    inset: auto 1.25rem 1.25rem auto;\n    z-index: 5;\n    width: 3.25rem;\n    height: 3.25rem;\n    padding: 0;\n    border-radius: 50%;\n    background: var(--ui-primary);\n    color: var(--ui-primary-foreground);\n    box-shadow: var(--ui-shadow);\n\n    .chat-icon {\n      width: 1.375rem;\n      height: 1.375rem;\n    }\n  }\n\n  .chat-launcher-panel {\n    display: grid;\n    grid-template-rows: auto minmax(0, 1fr);\n    gap: 0.75rem;\n    width: min(24rem, calc(100vw - 2rem));\n    height: min(36rem, calc(100dvh - 7rem));\n    padding: 1rem;\n  }\n\n  .chat-launcher-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n\n    [data-slot=\"popover-title\"] {\n      margin: 0;\n      font-size: 1rem;\n    }\n\n    [data-slot=\"popover-close\"] {\n      width: 2rem;\n      height: 2rem;\n      padding: 0;\n    }\n  }\n\n  @media (prefers-reduced-motion: reduce) {\n    .chat-shimmer {\n      animation: none;\n      background: none;\n      color: var(--ui-muted-foreground);\n    }\n\n    .chat-message[data-streaming] .chat-message-content > :last-child::after,\n    .chat-tool[data-status=\"running\"] .chat-tool-mark {\n      animation: none;\n    }\n  }\n\n  @media (forced-colors: active) {\n    .chat-shimmer {\n      background: none;\n      color: CanvasText;\n    }\n\n    .chat-message[data-from=\"user\"] .chat-message-content,\n    .chat-attachment,\n    .chat-citation {\n      border: 1px solid CanvasText;\n    }\n\n    .chat-code pre span {\n      forced-color-adjust: auto;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/chat/chat.css"
    }
  ],
  "type": "registry:ui"
}