{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "prompt-composer",
  "title": "Prompt composer",
  "description": "The box people type to an AI in — grows with the text, sends on Enter, turns Send into Stop while the AI works, with slots for tools, files and a model picker.",
  "registryDependencies": [
    "button",
    "textarea",
    "command",
    "https://www.quilldesignsystem.com/r/icon.json",
    "https://www.quilldesignsystem.com/r/ai-mark.json"
  ],
  "files": [
    {
      "path": "registry/lib/prompt-composer.tsx",
      "content": "'use client'\n\nimport * as React from 'react'\nimport { Button } from '@/components/ui/button'\nimport { Textarea } from '@/components/ui/textarea'\nimport { Icon } from '@/components/ui/icon'\nimport { AiMark } from '@/components/ui/ai-mark'\nimport { Command, CommandEmpty, CommandGroup, CommandItem, CommandList } from '@/components/ui/command'\nimport { cn } from '@/lib/utils'\n\nexport type ComposerStatus = 'idle' | 'working' | 'disabled' | 'error'\n\n// Safari delivers the word-confirming Enter just after the input pop-up closes; 100ms covers that\n// gap and is far shorter than a deliberate second Enter to send.\nconst IME_SETTLE_MS = 100\n\n// The selected tab flares into the box: at each base corner a small piece draws an inward curve (CURVE, 8px, the size\n// of the tab's own top corners) in place of the hard T where the tab's side meets the box's top edge. The curve is a ring the\n// edge's 1px thickness, centred on the tab's side and the box's top edge so it continues both without a step,\n// coloured from the tab side's colour into the box edge's, with the page showing inside it and the field colour\n// outside it (which hides the straight edge and side it replaces). The edge is 1px, not 1.5: Chrome and Firefox\n// draw a 1.5px border at 1px, so a 1.5px curve looked thicker than the lines it joins.\n// A fixed size, not the large-radius token: apps installed through the CLI never receive that variable.\nconst CURVE = '0.5rem'\nconst EDGE_A = 'color-mix(in oklab, var(--ai-from) 55%, var(--ai-text-from))'\nconst EDGE_REST = (c: string) => `color-mix(in oklab, ${c} 45%, var(--line-control))`\nfunction filletStyle(side: 'left' | 'right', lit: boolean, notebook: boolean): React.CSSProperties {\n  const [a, b, c] = lit ? [EDGE_A, 'var(--ai-via)', 'var(--ai-to)'] : [EDGE_REST(EDGE_A), EDGE_REST('var(--ai-via)'), EDGE_REST('var(--ai-to)')]\n  // The tabs sit near the start of the box's 115deg gradient; the notebook box has a plain border instead.\n  const box = notebook ? (lit ? 'var(--ring)' : 'var(--input)') : `color-mix(in oklab, ${a} 75%, ${b})`\n  const tabSide = side === 'left' ? `color-mix(in oklab, ${a} 70%, ${b})` : `color-mix(in oklab, ${c} 70%, ${b})`\n  const at = side === 'left' ? '0 0' : '100% 0'\n  const ring = side === 'left'\n    ? `conic-gradient(from 90deg at ${at}, ${tabSide}, ${box} 90deg)`\n    : `conic-gradient(from 180deg at ${at}, ${box}, ${tabSide} 90deg)`\n  const size = `calc(${CURVE} + 1px)`\n  return {\n    position: 'absolute',\n    bottom: 0,\n    [side]: `calc(-1 * ${size})`,\n    width: size,\n    height: size,\n    pointerEvents: 'none',\n    // The ring runs from CURVE to CURVE + 1px; each side softens over half a pixel centred on its edge.\n    background: `radial-gradient(circle at ${at}, transparent calc(${CURVE} + 0.75px), var(--background) calc(${CURVE} + 1.25px)), ${ring}`,\n    // A mask reads only opacity, so any solid colour works; currentColor keeps raw colours out of shipped code.\n    mask: `radial-gradient(circle at ${at}, transparent calc(${CURVE} - 0.25px), currentColor calc(${CURVE} + 0.25px))`,\n  }\n}\n\nexport type ComposerAttachment = { id: string; name: string; meta?: string; kind?: string } // kind: 'PDF', 'CSV'… shown on the thumb\nexport type ComposerTool = { id: string; label: string }\n\n// ai: the tab shows the AI mark. icon: any other mode's own icon (e.g. a person for Agent); ignored when ai is set.\nexport type ComposerMode = { value: string; label: string; placeholder?: string; ai?: boolean; icon?: React.ReactNode }\nexport type ComposerCommand = { value: string; label: string; description?: string; trigger: '/' | '@'; ai?: boolean }\n\nexport type PromptComposerProps = {\n  onSubmit: (value: string) => void\n  onStop?: () => void\n  value?: string\n  defaultValue?: string\n  onValueChange?: (value: string) => void\n  status?: ComposerStatus\n  error?: string\n  size?: 'lg' | 'sm'\n  label?: string\n  placeholder?: string\n  onMic?: () => void\n  leading?: React.ReactNode\n  trailing?: React.ReactNode\n  attachments?: ComposerAttachment[]\n  onRemoveAttachment?: (id: string) => void\n  /** Enables the drop target. */\n  onFilesDropped?: (files: File[]) => void\n  /** Active AI tools, shown as chips with the mark. */\n  tools?: ComposerTool[]\n  onRemoveTool?: (id: string) => void\n  /** Mode tabs above the box (Ask, Agent…); the selected tab shares the AI edge. */\n  modes?: ComposerMode[]\n  showModes?: boolean // false hides the tabs without removing the modes; default true\n  mode?: string\n  onModeChange?: (value: string) => void\n  /** Items for the `/` and `@` menu. Picking one inserts `${trigger}${value} ` and calls onCommand. */\n  commands?: ComposerCommand[]\n  onCommand?: (command: ComposerCommand) => void\n  /** `notebook`: ruled page, serif text, the AI gradient as a margin rule, and a word count — for prompts that are writing. */\n  variant?: 'default' | 'notebook'\n  /** Focus the textbox on mount (an AI home page, a chat that opens on demand). */\n  autoFocus?: boolean\n  /** The textbox, so a page can focus it (after a starter card fills it, say). */\n  ref?: React.Ref<HTMLTextAreaElement>\n  className?: string\n}\n\n// Controlled use: when you pass `value`, clear it yourself in `onSubmit`; the composer only empties its own state when uncontrolled.\n/** The box people type to an AI in — grows with the text, sends on Enter, turns Send into Stop while the AI works, with slots for tools, files and a model picker. */\nexport function PromptComposer({\n  onSubmit, onStop, value, defaultValue = '', onValueChange, status = 'idle', error,\n  size = 'lg', label = 'Message', placeholder, onMic, leading, trailing, className,\n  attachments, onRemoveAttachment, onFilesDropped, tools, onRemoveTool,\n  modes, showModes = true, mode, onModeChange, commands, onCommand, variant = 'default', autoFocus, ref,\n}: PromptComposerProps) {\n  const [inner, setInner] = React.useState(defaultValue)\n  const text = value ?? inner\n  const setText = (v: string) => { if (value === undefined) setInner(v); onValueChange?.(v) }\n  const working = status === 'working'\n  const disabled = status === 'disabled'\n  const hasText = text.trim().length > 0\n  const notebook = variant === 'notebook'\n  const wordCount = hasText ? text.trim().split(/\\s+/).length : 0\n  const errorId = React.useId()\n  const [dragging, setDragging] = React.useState(false)\n  const dropTarget = onFilesDropped && !disabled\n\n  const [innerMode, setInnerMode] = React.useState(modes?.[0]?.value)\n  const currentMode = mode ?? innerMode\n  const activeMode = modes?.find((m) => m.value === currentMode)\n  // The selected tab lights with the box; :focus-within cannot reach a sibling, so track focus.\n  const [focused, setFocused] = React.useState(false)\n\n  const match = /(^|\\s)([/@])([\\w-]*)$/.exec(text)\n  const trigger = match?.[2] as '/' | '@' | undefined\n  const query = match?.[3] ?? ''\n  const matches = trigger ? (commands ?? []).filter((c) => c.trigger === trigger && c.value.startsWith(query.toLowerCase())) : []\n  const [active, setActive] = React.useState(0)\n  // Back to the first option whenever the match changes (reset during render, not in an effect).\n  const matchKey = `${trigger ?? ''}|${query}|${matches.map((o) => o.value).join(',')}`\n  // Escape closes the menu for this match only; typing changes the key and reopens it. The text is never touched.\n  const [dismissedKey, setDismissedKey] = React.useState<string | null>(null)\n  const [seenMatchKey, setSeenMatchKey] = React.useState(matchKey)\n  if (seenMatchKey !== matchKey) { setSeenMatchKey(matchKey); setActive(0); setDismissedKey(null) }\n  const options = dismissedKey === matchKey ? [] : matches\n  const textareaRef = React.useRef<HTMLTextAreaElement>(null)\n  // Merge the caller's ref with ours: the menu, Send and pick all need the textbox too.\n  const setTextareaRef = React.useCallback((node: HTMLTextAreaElement | null) => {\n    textareaRef.current = node\n    if (typeof ref === 'function') return ref(node)\n    if (ref) (ref as React.RefObject<HTMLTextAreaElement | null>).current = node\n  }, [ref])\n  React.useEffect(() => { if (autoFocus) textareaRef.current?.focus() }, [autoFocus])\n  // Clamp: the options can shrink between renders while `active` still points past the end.\n  const activeIndex = Math.min(active, options.length - 1)\n  const menuRef = React.useRef<HTMLDivElement>(null)\n  const menuOpen = options.length > 0\n  // cmdk gives the list and every option its own id (it ignores ours), so aria-controls and aria-activedescendant have to follow the option cmdk marks\n  // selected. Watch the menu and mirror that id onto the textbox, so a screen reader announces the arrowing.\n  React.useEffect(() => {\n    const menu = menuRef.current\n    const box = textareaRef.current\n    if (!menuOpen || !menu || !box) return\n    const sync = () => {\n      const listId = menu.querySelector('[role=\"listbox\"]')?.id\n      if (listId) box.setAttribute('aria-controls', listId)\n      const id = menu.querySelector('[role=\"option\"][aria-selected=\"true\"]')?.id\n      if (id) box.setAttribute('aria-activedescendant', id)\n      else box.removeAttribute('aria-activedescendant')\n    }\n    sync()\n    const observer = new MutationObserver(sync)\n    observer.observe(menu, { subtree: true, childList: true, attributes: true, attributeFilter: ['aria-selected'] })\n    return () => { observer.disconnect(); box.removeAttribute('aria-activedescendant'); box.removeAttribute('aria-controls') }\n  }, [menuOpen])\n  // The menu opens upward, over the content above the composer. A composer near the top of the screen, or of a\n  // panel that clips its content, has no room there, so the menu flips below it instead of opening out of sight.\n  const [menuBelow, setMenuBelow] = React.useState(false)\n  React.useLayoutEffect(() => {\n    const menu = menuRef.current\n    const anchor = menu?.parentElement\n    if (!menuOpen || !menu || !anchor) return\n    // The visible area is the window, cut down by the nearest ancestor that clips (a scrolling side panel, say).\n    let areaTop = 0\n    let areaBottom = window.innerHeight\n    for (let el = anchor.parentElement; el && el !== document.body; el = el.parentElement) {\n      if (getComputedStyle(el).overflowY === 'visible') continue\n      const r = el.getBoundingClientRect()\n      areaTop = Math.max(areaTop, r.top)\n      areaBottom = Math.min(areaBottom, r.bottom)\n      break\n    }\n    const { top, bottom } = anchor.getBoundingClientRect()\n    const spaceAbove = top - areaTop\n    const spaceBelow = areaBottom - bottom\n    setMenuBelow(spaceAbove < menu.offsetHeight + 8 && spaceBelow > spaceAbove)\n  }, [menuOpen, options.length])\n  const pick = (c: ComposerCommand) => {\n    setText(text.slice(0, text.length - query.length - 1) + `${c.trigger}${c.value} `)\n    onCommand?.(c)\n    textareaRef.current?.focus()\n  }\n\n  // Japanese and Chinese input open a pop-up of candidate words, and Enter confirms the chosen\n  // word. That Enter must never send or pick a command. Browsers mark it differently — Chrome\n  // sends it while the pop-up is open (isComposing), Safari just after the pop-up closes (keyCode\n  // 229, isComposing false) — so the composer also tracks the pop-up itself and treats an Enter\n  // within IME_SETTLE_MS of it closing as part of confirming the word.\n  const composingRef = React.useRef(false)\n  const compositionEndedAt = React.useRef(Number.NEGATIVE_INFINITY)\n  const isConfirmingWord = (e: React.KeyboardEvent) =>\n    e.nativeEvent.isComposing ||\n    e.nativeEvent.keyCode === 229 ||\n    composingRef.current ||\n    e.timeStamp - compositionEndedAt.current < IME_SETTLE_MS\n\n  const submit = () => {\n    if (!hasText || working || disabled) return\n    onSubmit(text)\n    if (value === undefined) setInner('')\n    // Clicking Send disables it (the box is now empty), which would drop focus to the page.\n    textareaRef.current?.focus()\n  }\n\n  return (\n    <div className={cn('grid gap-1.5', className)}>\n      <div className=\"relative\">\n        {options.length ? (\n          <Command ref={menuRef} className={cn('absolute inset-x-0 z-dropdown h-auto rounded-xl border border-border shadow-lg', menuBelow ? 'top-full mt-2' : 'bottom-full mb-2')} data-side={menuBelow ? 'bottom' : 'top'} shouldFilter={false}\n            value={options[activeIndex]?.value} onMouseDown={(e) => e.preventDefault()} onValueChange={(v) => setActive(Math.max(0, options.findIndex((o) => o.value === v)))}>\n            <CommandList>\n              <CommandEmpty>No matches</CommandEmpty>\n              <CommandGroup heading={trigger === '/' ? 'Commands' : 'Add context'}>\n                {options.map((c) => (\n                  <CommandItem key={c.value} value={c.value} onSelect={() => pick(c)} className=\"gap-2.5\">\n                    {/* An empty slot the mark's width (the item draws every svg at 16px) keeps labels on one edge when only some commands carry it. */}\n                    {c.ai ? <AiMark size=\"icon-md\" /> : options.some((o) => o.ai) ? <span aria-hidden className=\"size-4 shrink-0\" /> : null}\n                    <span className=\"grid\"><span>{c.label}</span>{c.description ? <span className=\"text-xs text-muted-foreground\">{c.description}</span> : null}</span>\n                  </CommandItem>\n                ))}\n              </CommandGroup>\n            </CommandList>\n          </Command>\n        ) : null}\n        {showModes && modes?.length ? (\n          // pl-6 (24px) = the box's 16px corner + the tab's 8px base curve, so the curve meets the box's straight edge.\n          <div role=\"tablist\" aria-label=\"Mode\" className=\"relative z-raised -mb-px flex gap-0.5 pl-6\">\n            {modes.map((m) => {\n              const selected = m.value === currentMode\n              return (\n                <button\n                  key={m.value}\n                  type=\"button\"\n                  role=\"tab\"\n                  aria-selected={selected}\n                  data-lit={selected && focused ? '' : undefined}\n                  onClick={() => { if (mode === undefined) setInnerMode(m.value); onModeChange?.(m.value) }}\n                  // ai-edge's border shorthand outranks a border-b-0 class, which left a thin gradient bottom border\n                  // whose ends poked out past the tab's base; an inline width always wins.\n                  style={selected ? { borderBottomWidth: 0 } : undefined}\n                  className={cn(\n                    // Without outline-hidden a keyboard-focused tab drew the browser's own focus ring, not Quill's. Inset, so the\n                    // ring stays inside the tab and does not lay a bar across the box edge the tab joins.\n                    'relative inline-flex items-center gap-1.5 rounded-t-lg px-3.5 pt-1.5 pb-2 text-sm font-semibold outline-hidden focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/50',\n                    // The selected tab shares the AI edge; the after: strip covers the box's top\n                    // edge under it so tab and box read as one shape (approved 2026-10-02). z-raised keeps its\n                    // base curves above a neighbouring tab, which would otherwise paint over the right one.\n                    selected\n                      ? 'z-raised ai-edge text-foreground after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-background'\n                      // Unselected tabs keep a subtle muted fill and a hairline outline so they still\n                      // read as tabs (the fill alone vanishes on the dark themes), and stop 1px short\n                      // so the box's gradient edge runs in front of them; only the selected tab joins the box.\n                      : 'mb-px border border-b-0 border-border bg-muted text-muted-foreground hover:text-foreground',\n                  )}\n                >\n                  {selected ? (\n                    <>\n                      <span aria-hidden data-slot=\"tab-fillet\" style={filletStyle('left', focused, notebook)} />\n                      <span aria-hidden data-slot=\"tab-fillet\" style={filletStyle('right', focused, notebook)} />\n                    </>\n                  ) : null}\n                  {m.ai ? <AiMark size=\"icon-lg\" /> : m.icon ? <span aria-hidden className=\"inline-grid size-4.5 place-items-center [&>svg]:size-4.5\">{m.icon}</span> : null}\n                  {m.label}\n                </button>\n              )\n            })}\n          </div>\n        ) : null}\n        <div\n          data-slot=\"prompt-composer\"\n          data-size={size}\n          onDragOver={dropTarget ? (e) => { e.preventDefault(); setDragging(true) } : undefined}\n          // dragleave also fires when the pointer moves onto a child (the textarea, the hint); only leaving the box ends the drag.\n          onDragLeave={dropTarget ? (e) => { if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setDragging(false) } : undefined}\n          onDrop={dropTarget ? (e) => { e.preventDefault(); setDragging(false); onFilesDropped([...e.dataTransfer.files]) } : undefined}\n          className={cn(\n            'shadow-md',\n            notebook\n              // The margin rule and border replace the AI edge; focus-within stands in for the textarea's cancelled ring.\n              ? 'relative overflow-hidden rounded-l-sm rounded-r-xl border border-input bg-background focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/40'\n              : cn('rounded-xl', working ? 'ai-edge-working' : 'ai-edge'),\n            disabled && 'cursor-not-allowed opacity-disabled',\n          )}\n        >\n          {notebook ? <span aria-hidden className=\"absolute inset-y-0 left-0 w-1 bg-[linear-gradient(180deg,var(--ai-from),var(--ai-via),var(--ai-to))]\" /> : null}\n          {/* The edge animation is off in notebook mode, so a sweeping top line carries the working cue. */}\n          {notebook && working ? <span aria-hidden className=\"ai-line absolute inset-x-0 top-0\" /> : null}\n          {attachments?.length ? (\n            <ul className={cn('flex flex-wrap gap-2', size === 'lg' ? 'px-3.5 pt-3' : 'px-2.5 pt-2')} aria-label=\"Attached files\">\n              {attachments.map((a) => (\n                <li key={a.id} className=\"relative flex max-w-chip-lg items-center gap-2 rounded-lg border border-border bg-card py-1.5 pr-8 pl-1.5 text-xs\">\n                  {a.kind ? <span className=\"grid size-8 shrink-0 place-items-center rounded-md bg-muted text-2xs font-semibold text-ink-soft\">{a.kind}</span> : null}\n                  <span className=\"min-w-0\">\n                    <span className=\"block truncate font-semibold text-foreground\">{a.name}</span>\n                    {a.meta ? <span className=\"block text-muted-foreground\">{a.meta}</span> : null}\n                  </span>\n                  {onRemoveAttachment ? (\n                    <button type=\"button\" aria-label={`Remove ${a.name}`} onClick={() => onRemoveAttachment(a.id)}\n                      className=\"absolute top-1/2 right-1 grid size-6 -translate-y-1/2 place-items-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground outline-hidden focus-visible:ring-3 focus-visible:ring-ring/50\">\n                      <Icon name=\"close\" className=\"size-icon-sm\" />\n                    </button>\n                  ) : null}\n                </li>\n              ))}\n            </ul>\n          ) : null}\n          {dragging && dropTarget ? <p className=\"mx-3.5 mt-2 rounded-lg border border-dashed border-input p-2 text-center text-xs text-muted-foreground\">Drop files to attach</p> : null}\n          <Textarea\n            aria-label={label}\n            aria-invalid={status === 'error' || undefined}\n            aria-describedby={status === 'error' && error ? errorId : undefined}\n            disabled={disabled}\n            placeholder={activeMode?.placeholder ?? placeholder}\n            ref={setTextareaRef}\n            onFocus={() => setFocused(true)}\n            onBlur={() => setFocused(false)}\n            value={text}\n            onChange={(e) => setText(e.target.value)}\n            onCompositionStart={() => { composingRef.current = true }}\n            onCompositionEnd={(e) => { composingRef.current = false; compositionEndedAt.current = e.timeStamp }}\n            onKeyDown={(e) => {\n              // The menu goes first so Enter picks a command instead of sending. It honours the same IME guard.\n              if (options.length) {\n                if (e.key === 'ArrowDown') { e.preventDefault(); setActive((i) => (i + 1) % options.length); return }\n                if (e.key === 'ArrowUp') { e.preventDefault(); setActive((i) => (i - 1 + options.length) % options.length); return }\n                if (e.key === 'Enter') {\n                  if (isConfirmingWord(e)) return\n                  e.preventDefault(); pick(options[activeIndex]); return\n                }\n                if (e.key === 'Escape') { e.preventDefault(); setDismissedKey(matchKey); return }\n              }\n              if (e.key === 'Enter' && !e.shiftKey && !isConfirmingWord(e)) {\n                e.preventDefault()\n                submit()\n              }\n            }}\n            className={cn(\n              // aria-invalid:* cancel the stock textarea's red ring; the AI edge and the alert carry the error. disabled:* cancel\n              // the stock grey fill and fade, which covered only the text area; the whole box fades as one instead.\n              'max-h-area resize-none border-0 bg-transparent shadow-none focus-visible:ring-0 disabled:bg-transparent disabled:opacity-100 dark:disabled:bg-transparent aria-invalid:border-transparent aria-invalid:ring-0 dark:bg-transparent dark:aria-invalid:border-transparent dark:aria-invalid:ring-0',\n              // md:text-* overrides the stock textarea's md:text-sm, which would shrink lg on desktop.\n              notebook\n                ? // The rules live on the textarea so they scroll with the text (bg-local) and follow its padding. Each 32px line (leading-8) starts\n                // at the top padding (pt-3.5 = 14px) and its rule is the line's last pixel, so the background y offset must equal that padding.\n                'font-heading text-lg leading-8 md:text-lg pt-3.5 pl-6 placeholder:italic bg-local bg-[repeating-linear-gradient(to_bottom,transparent_0,transparent_31px,var(--line-soft)_31px,var(--line-soft)_32px)] bg-[position:0_14px]'\n                : size === 'lg' ? 'min-h-16 px-4 pt-3.5 text-base md:text-base' : 'min-h-touch px-3 pt-2.5 text-sm md:text-sm',\n            )}\n          />\n          <div className={cn('flex items-center gap-1.5', size === 'lg' ? 'px-2.5 pb-2.5' : 'px-1.5 pb-1.5')}>\n            {leading}\n            {tools?.map((t) => (\n              <span key={t.id} className=\"inline-flex h-7 items-center gap-1.5 rounded-full border border-border bg-card pr-1 pl-2 text-xs font-semibold text-foreground\">\n                <AiMark size=\"icon-xs\" />\n                {t.label}\n                {onRemoveTool ? (\n                  <button type=\"button\" aria-label={`Turn off ${t.label}`} onClick={() => onRemoveTool(t.id)}\n                    className=\"grid size-5 place-items-center rounded-full text-muted-foreground hover:bg-muted hover:text-foreground outline-hidden focus-visible:ring-3 focus-visible:ring-ring/50\">\n                    <Icon name=\"close\" className=\"size-icon-xs\" />\n                  </button>\n                ) : null}\n              </span>\n            ))}\n            <span className=\"flex-1\" />\n            {trailing}\n            {notebook ? (\n              // Plain text, not a live region: announcing every word as it is typed is noise.\n              <span className=\"text-xs text-muted-foreground tabular-nums\">\n                {wordCount === 1 ? '1 word' : `${wordCount} words`}\n              </span>\n            ) : null}\n            {working ? (\n              <Button type=\"button\" size=\"icon\" className=\"rounded-full\" aria-label=\"Stop\" onClick={onStop}>\n                <Icon name=\"stop\" />\n              </Button>\n            ) : !hasText && onMic ? (\n              <Button type=\"button\" size=\"icon\" variant=\"ghost\" className=\"rounded-full\" aria-label=\"Dictate\" onClick={onMic} disabled={disabled}>\n                {/* quill-check: allow icon-size — the mic glyph is drawn larger than the Button's 16px icons (approved 2026-10-02) */}\n                <Icon name=\"mic\" className=\"size-icon-xl\" />\n              </Button>\n            ) : (\n              <Button type=\"button\" size=\"icon\" className=\"rounded-full\" aria-label=\"Send\" onClick={submit} disabled={!hasText || disabled}>\n                <Icon name=\"arrow_upward\" />\n              </Button>\n            )}\n          </div>\n        </div>\n      </div>\n      {status === 'error' && error ? (\n        <p id={errorId} role=\"alert\" className=\"flex items-start gap-1.5 px-1 text-sm text-destructive\">\n          <Icon name=\"error\" className=\"size-icon-md mt-0.5 shrink-0\" />\n          {error}\n        </p>\n      ) : null}\n    </div>\n  )\n}\n",
      "type": "registry:ui",
      "target": "components/ui/prompt-composer.tsx"
    }
  ],
  "docs": "The box people type to an AI in — grows with the text, sends on Enter, turns Send into Stop while the AI works, with slots for tools, files and a model picker. Do: Let the composer draw its own AI edge: muted at rest, full on focus, sweeping while working. Don't: Wrap it in a thick glowing gradient ring or a second border — one thin line marks AI. Do: Keep Send and Stop solid ink in the same spot. Don't: Fill the Send button with the AI gradient — it competes with the edge and breaks the never-on-Send rule. Do: Use `lg` on an AI home page and `sm` in threads, side panels and inline bars. Don't: Put the large composer inside a narrow panel — use `sm`. Do: When you pass `value`, clear it yourself in `onSubmit` (set it to an empty string). Don't: Pass `value` and expect the composer to empty itself after sending — it only clears its own state when uncontrolled. Do: Show active AI tools (Analyze data, Web search) as chips with the mark, and attached files as neutral file chips. Don't: Put the AI mark on attached files — the files are the person's, not the AI's. Do: Mark AI commands in the / menu with the AI sparkle and leave ordinary app commands unmarked. Don't: Mark every command — the mark is how people tell which actions call the AI. Do: Set `status=\"working\"` while the AI answers and pass `onStop`. Don't: Disable the whole composer while the AI works — people should be able to stop it. Do: Use `variant=\"notebook\"` where the prompt is a piece of writing — a brief, a spec, a long instruction. Don't: Use the notebook for quick questions or a help widget — its ruled page reads as \"write at length\". Do: Give each mode its own icon (`icon`) — the AI mode uses `ai: true` for the mark — and use `showModes={false}` to hide the tabs where a page has only one mode. Don't: Remove the `modes` list just to hide the tabs; that also drops each mode's placeholder. Use ai-home when you need the whole AI start page around the composer, not just the box. Use chat when two people are messaging each other and no AI is involved. Use textarea when it is an ordinary form field whose text is saved, not sent to an AI.",
  "type": "registry:ui"
}