{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chat-composer",
  "title": "Chat composer",
  "author": "superzero11 <https://github.com/superzero11/uiset>",
  "description": "The message box: Enter to send, history with ArrowUp, slash commands and mentions, attachments by drop, paste or picker, a model picker and a usage meter.",
  "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",
    "https://uiset.dev/r/button.json"
  ],
  "files": [
    {
      "path": "registry/uiset/ui/chat-composer.tsx",
      "content": "\"use client\"\n\nimport { createInputHistory, isComposing } from \"@ui-sdk/core\"\nimport {\n  FileInput,\n  FileInputDropzone,\n  FileInputItem,\n  FileInputItemRemove,\n  FileInputList,\n  FileInputTrigger,\n  formatFileSize,\n} from \"@ui-sdk/react/file-input\"\nimport { Meter, MeterIndicator, MeterTrack } from \"@ui-sdk/react/meter\"\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectLabel,\n  SelectTrigger,\n  SelectValue,\n} from \"@ui-sdk/react/select\"\nimport {\n  TriggerMenu,\n  TriggerMenuContent,\n  TriggerMenuEmpty,\n  TriggerMenuInput,\n  TriggerMenuItem,\n  TriggerMenuList,\n  type TriggerMenuDataItem,\n} from \"@ui-sdk/react/trigger-menu\"\nimport { useMemo, useRef, useState, type ReactNode } from \"react\"\nimport { Button } from \"./button\"\nimport { ChatIcon } from \"./chat\"\nimport \"./chat/chat.css\"\n\ntype ComposerItem = { value: string; label: string; description?: string }\ntype Message = { text: string; files: File[] }\n\nconst paperclip =\n  \"M15.5 7.5l-6.8 6.8a2 2 0 0 0 2.8 2.8l7-7a4 4 0 0 0-5.6-5.6l-7 7a6 6 0 0 0 8.5 8.5l6.3-6.3\"\nconst remove = \"M6 6l12 12M18 6L6 18\"\n\nfunction ChatComposer({\n  onSubmit,\n  running = false,\n  onStop,\n  label = \"Message\",\n  placeholder = \"Message…\",\n  commands,\n  mentions,\n  attachments = false,\n  tools,\n}: {\n  onSubmit: (message: Message) => void\n  running?: boolean\n  onStop?: () => void\n  label?: string\n  placeholder?: string\n  commands?: ComposerItem[]\n  mentions?: ComposerItem[]\n  attachments?: false | { accept?: string; maxFiles?: number; maxSize?: number }\n  tools?: ReactNode\n}) {\n  const field = useRef<HTMLTextAreaElement>(null)\n  // The textarea doesn't carry aria-expanded, so follow the menu through its callback.\n  const menuOpen = useRef(false)\n  const sent = useRef<string[]>([])\n  const [hasText, setHasText] = useState(false)\n  const [files, setFiles] = useState<File[]>([])\n\n  const write = (value: string) => {\n    const el = field.current\n    if (!el) return\n    el.value = value\n    el.dispatchEvent(new Event(\"input\", { bubbles: true }))\n  }\n\n  const history = useMemo(\n    () =>\n      createInputHistory({\n        entries: () => sent.current,\n        read: () => field.current?.value ?? \"\",\n        write: (value) => write(value as string),\n      }),\n    [],\n  )\n\n  const triggers = useMemo(\n    () => [\n      ...(commands?.length\n        ? [{ char: \"/\", boundary: \"start\" as const, items: commands }]\n        : []),\n      ...(mentions?.length ? [{ char: \"@\", items: mentions }] : []),\n    ],\n    [commands, mentions],\n  )\n\n  const submit = () => {\n    const text = field.current?.value.trim() ?? \"\"\n    if ((!text && !files.length) || running) return\n    if (text) sent.current = [...sent.current, text]\n    history.reset()\n    onSubmit({ text, files })\n    write(\"\")\n    setFiles([])\n  }\n\n  const box = (\n    <>\n      {attachments && (\n        <FileInputList aria-label=\"Attachments\" className=\"chat-attachments\">\n          <FileInputItem className=\"chat-attachment\">\n            {({ file }) => (\n              <>\n                <span className=\"chat-attachment-name\">{file.name}</span>\n                <span className=\"chat-attachment-size\">{formatFileSize(file.size)}</span>\n                <FileInputItemRemove aria-label={`Remove ${file.name}`}>\n                  <ChatIcon path={remove} />\n                </FileInputItemRemove>\n              </>\n            )}\n          </FileInputItem>\n        </FileInputList>\n      )}\n      <TriggerMenu\n        triggers={triggers}\n        onOpenChange={(open) => {\n          menuOpen.current = open\n        }}\n      >\n        <TriggerMenuInput\n          ref={field}\n          aria-label={label}\n          placeholder={placeholder}\n          rows={1}\n          className=\"chat-composer-input\"\n          onInput={(event) => setHasText(event.currentTarget.value.trim().length > 0)}\n          onKeyDown={(event) => {\n            if (menuOpen.current) return\n            if (history.keydown(event.nativeEvent)) return\n            if (\n              event.key === \"Enter\" &&\n              !event.shiftKey &&\n              !isComposing(event.nativeEvent)\n            ) {\n              event.preventDefault()\n              submit()\n            }\n          }}\n        />\n        <TriggerMenuContent className=\"chat-menu\">\n          <TriggerMenuEmpty>No matches</TriggerMenuEmpty>\n          <TriggerMenuList>\n            {(state) =>\n              (state.items as TriggerMenuDataItem<string>[]).map((item) => {\n                const description = [...(commands ?? []), ...(mentions ?? [])].find(\n                  (entry) => entry.value === item.value,\n                )?.description\n                return (\n                  <TriggerMenuItem key={item.value} value={item.value} label={item.label}>\n                    <span className=\"chat-menu-label\">{item.label}</span>\n                    {description && <span className=\"chat-menu-hint\">{description}</span>}\n                  </TriggerMenuItem>\n                )\n              })\n            }\n          </TriggerMenuList>\n        </TriggerMenuContent>\n      </TriggerMenu>\n      <div className=\"chat-composer-toolbar\">\n        {attachments && (\n          <FileInputTrigger aria-label=\"Attach files\" className=\"chat-composer-attach\">\n            <ChatIcon path={paperclip} />\n          </FileInputTrigger>\n        )}\n        {tools}\n        <span className=\"chat-composer-spacer\" />\n        {running && onStop ? (\n          <Button type=\"button\" variant=\"outline\" onClick={onStop}>\n            Stop\n          </Button>\n        ) : (\n          <Button type=\"submit\" disabled={!hasText && !files.length}>\n            Send\n          </Button>\n        )}\n      </div>\n    </>\n  )\n\n  return (\n    <form\n      className=\"chat-composer\"\n      onSubmit={(event) => {\n        event.preventDefault()\n        submit()\n      }}\n    >\n      {attachments ? (\n        <FileInput\n          multiple\n          value={files}\n          onValueChange={setFiles}\n          accept={attachments.accept}\n          maxFiles={attachments.maxFiles}\n          maxSize={attachments.maxSize}\n        >\n          <FileInputDropzone className=\"chat-composer-box\">{box}</FileInputDropzone>\n        </FileInput>\n      ) : (\n        <div className=\"chat-composer-box\">{box}</div>\n      )}\n    </form>\n  )\n}\n\ntype Model = { value: string; label: string; description?: string }\n\nfunction ChatModelPicker({\n  models,\n  value,\n  defaultValue,\n  onValueChange,\n  label = \"Model\",\n}: {\n  models: Model[]\n  value?: string\n  defaultValue?: string\n  onValueChange?: (value: string) => void\n  label?: string\n}) {\n  return (\n    <Select\n      value={value}\n      // Controlled or not: a default only when no value is given.\n      defaultValue={value === undefined ? (defaultValue ?? models[0]?.value) : undefined}\n      onValueChange={(next) => next && onValueChange?.(next as string)}\n    >\n      <SelectLabel className=\"chat-visually-hidden\">{label}</SelectLabel>\n      <SelectTrigger className=\"chat-model-trigger\">\n        <SelectValue />\n      </SelectTrigger>\n      <SelectContent className=\"chat-model-list\">\n        {models.map((model) => (\n          <SelectItem key={model.value} value={model.value} label={model.label}>\n            <span className=\"chat-model-name\">{model.label}</span>\n            {model.description && (\n              <span className=\"chat-model-description\">{model.description}</span>\n            )}\n          </SelectItem>\n        ))}\n      </SelectContent>\n    </Select>\n  )\n}\n\nconst compact = new Intl.NumberFormat(undefined, {\n  notation: \"compact\",\n  maximumFractionDigits: 1,\n})\n\nfunction ChatUsage({\n  used,\n  limit,\n  label = \"Context used\",\n  unit = \"tokens\",\n}: {\n  used: number\n  limit: number\n  label?: string\n  unit?: string\n}) {\n  const text = `${compact.format(used)} of ${compact.format(limit)} ${unit}`\n  return (\n    <Meter\n      value={used}\n      min={0}\n      max={limit}\n      aria-label={label}\n      getValueLabel={() => text}\n      className=\"chat-usage\"\n      data-level={used / limit > 0.9 ? \"high\" : used / limit > 0.7 ? \"medium\" : undefined}\n    >\n      <MeterTrack>\n        <MeterIndicator />\n      </MeterTrack>\n      <span className=\"chat-usage-text\" aria-hidden=\"true\">\n        {text}\n      </span>\n    </Meter>\n  )\n}\n\nexport { ChatComposer, ChatModelPicker, ChatUsage }\nexport type {\n  ComposerItem as ChatComposerItem,\n  Message as ChatComposerMessage,\n  Model as ChatModel,\n}\n",
      "type": "registry:ui",
      "target": "@ui/chat-composer.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"
}