{
  "antiPatterns": [
    "Installing a second global Escape listener to stop sending."
  ],
  "api": {
    "importPath": "@ancrel/workspace",
    "props": [
      {
        "name": "busy",
        "required": false,
        "type": "boolean"
      },
      {
        "name": "className",
        "required": false,
        "type": "string"
      },
      {
        "name": "compact",
        "required": false,
        "type": "boolean"
      },
      {
        "name": "disabled",
        "required": false,
        "type": "boolean"
      },
      {
        "name": "interruptLabel",
        "required": false,
        "type": "string"
      },
      {
        "name": "key",
        "required": false,
        "type": "React.Key | null | undefined"
      },
      {
        "name": "label",
        "required": true,
        "type": "string"
      },
      {
        "name": "leading",
        "required": false,
        "type": "ReactNode"
      },
      {
        "name": "onInterrupt",
        "required": false,
        "type": "(() => void) | undefined"
      },
      {
        "name": "onSend",
        "required": true,
        "type": "(value: string) => void"
      },
      {
        "name": "onValueChange",
        "required": true,
        "type": "(value: string) => void"
      },
      {
        "name": "placeholder",
        "required": false,
        "type": "string"
      },
      {
        "name": "ref",
        "required": false,
        "type": "React.Ref<HTMLTextAreaElement> | undefined"
      },
      {
        "name": "sendLabel",
        "required": false,
        "type": "string"
      },
      {
        "name": "shortcut",
        "required": false,
        "type": "SendShortcut"
      },
      {
        "name": "trailing",
        "required": false,
        "type": "ReactNode"
      },
      {
        "name": "value",
        "required": true,
        "type": "string"
      }
    ],
    "symbol": "ChatComposer",
    "typeRef": "api/workspace/composer/index.d.ts"
  },
  "constraints": [
    "Keep the draft controlled and set busy while a send is in progress."
  ],
  "docs": "raw/frontend/chat-composer.md",
  "examples": [
    {
      "code": "'use client'\n\nimport { useState } from 'react'\nimport { ChatComposer } from '@ancrel/workspace'\n\nexport default function App() {\n  const [draft, setDraft] = useState('')\n  const [sending, setSending] = useState(false)\n  const [message, setMessage] = useState('')\n  return <>\n    <ChatComposer label=\"Message\" placeholder=\"Write a message\" value={draft} onValueChange={setDraft}\n      busy={sending} onSend={text => { setMessage(text); setDraft(''); setSending(true) }}\n      onInterrupt={() => setSending(false)} leading={<span>{draft.length} characters</span>} />\n    <output aria-label=\"Delivery\">{sending ? 'Sending' : 'Idle'}</output>\n    <p>{message}</p>\n  </>\n}\n",
      "command": "pnpm test",
      "entry": "examples/fe.chat-composer/App.tsx",
      "fixture": "examples/fe.chat-composer/",
      "id": "minimal"
    }
  ],
  "id": "fe.chat-composer",
  "kind": "react-component",
  "language": "typescript",
  "layer": "frontend",
  "owner": "frontend-infra",
  "package": {
    "ecosystem": "npm",
    "name": "@ancrel/workspace",
    "version": "0.2.0"
  },
  "provenance": {
    "changes": "Replaced preference storage, global Escape handling and icons with controlled callbacks, a bubbling focus-scoped interrupt, accessible action labels and footer slots. Reused the keyboard adapter for composition-safe submission.",
    "commit": "4cc384c3bdbd09a3a50268adf81ba23f53aac93e",
    "mode": "extracted",
    "origin": "rule-studio",
    "path": "frontend/src/components/common/ChatComposer.tsx",
    "rights": "org-internal; approved-by=owner; ref=item-19"
  },
  "schemaVersion": 1,
  "stability": "experimental",
  "summary": "Compose a controlled message with an IME-safe send shortcut and a focused Escape interrupt.",
  "tokenDependencies": [
    "ref.color.x16161a",
    "ref.color.x202025",
    "ref.color.x52525e",
    "ref.color.x684a84",
    "ref.color.x737380",
    "ref.color.x858591",
    "ref.color.xa5a5b0",
    "ref.color.xcdb2ea",
    "ref.color.xededef",
    "ref.color.xffffff",
    "ref.family.sans",
    "ref.leading.x1p6",
    "ref.space.px11",
    "ref.space.px12",
    "ref.space.px16",
    "ref.space.px2",
    "ref.space.px4",
    "ref.space.px6",
    "ref.space.px8",
    "sys.action.focus",
    "sys.border.control",
    "sys.ink.muted",
    "sys.ink.primary",
    "sys.radius.lg",
    "sys.space.gap",
    "sys.space.hair",
    "sys.space.inset",
    "sys.space.snug",
    "sys.space.tight",
    "sys.surface.panel",
    "sys.type.body.lineHeight",
    "sys.type.body.size",
    "sys.type.family.sans",
    "sys.type.meta.size"
  ]
}
