import "./composer.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type HighlightRange } from "./highlight_segments"; import { type StyleProps } from "./style_props"; /** * The composer chrome: an auto-growing field with Enter-to-send, send/stop and a footer. Labels and * the `pills` / `files` / `children` slots are injected; no i18n or domain types. A minimal * composer starts as the compact pill `AgentRun variant="pill"` morphs into, and expands once text * wraps or slot chrome appears, latching until cleared since the wider expanded field would * oscillate. */ export interface ComposerProps extends StyleProps { onSend: (text: string) => void; onStop?: () => void; disabled?: boolean; /** Overrides the empty-text send block (e.g. attachments only). */ sendDisabled?: boolean; placeholder?: string; /** Defaults to `placeholder`, which is an overlay and names nothing on its own. */ accessibilityLabel?: string; autoFocus?: boolean; testID?: string; /** Omit to let the composer own its state. */ value?: string; onChangeText?: (text: string) => void; /** What they mean is the caller's; omitted, nothing renders. */ highlightRanges?: readonly HighlightRange[]; /** * A consumer `onKeyDown` runs before Enter-to-send and may `preventDefault()` it. The `data-*` * index lets a caller pass `data-testid`, which no object type admits otherwise. */ textareaProps?: Omit, "value" | "defaultValue" | "onChange" | "className" | "style" | "children"> & { [dataAttr: `data-${string}`]: string | undefined; }; /** * A caret set from outside is `setSelectionRange` here; React state would fight the user's own * selection. */ inputRef?: React.Ref; pills?: React.ReactNode; files?: React.ReactNode; children?: React.ReactNode; /** Inline-left in the pill, footer-left when expanded. */ actionsButton?: React.ReactNode; /** Before the send button (e.g. a model picker). Forces the expanded layout. */ footerRight?: React.ReactNode; maxLines?: number; sendLabel?: string; /** Shown while `disabled` with `onStop`. */ stopLabel?: string; ref?: React.Ref; render?: useRender.RenderProp; } export declare function Composer(props: ComposerProps): React.ReactElement>;