import { type VariantProps } from 'class-variance-authority'; import * as React from 'react'; import { type PasteKind } from './paste-detection.js'; declare const inputVariants: (props?: ({ state?: "attachments" | "default" | "disabled" | "dragover" | "focused" | "withText" | null | undefined; variant?: "compact" | "default" | "inline" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; export interface UploadingFile { id: string; name: string; size: string; progress: number; status: 'uploading' | 'complete' | 'error'; /** File extension for icon display (e.g., 'pdf', 'docx') */ fileExtension?: string; } export type { PasteKind } from './paste-detection.js'; export interface PasteAsFileConfig { /** Char count above which plain text always converts. Default: 500 */ threshold?: number; /** Line count above which plain text always converts. Default: 10 */ lineThreshold?: number; /** Run structured-content heuristics (JSON/XML/CSV/code/log). Default: true */ detectStructured?: boolean; /** * Auto-fill textarea after conversion. Receives filename + detected kind. * Return string to set as textarea value (appended with leading space if textarea non-empty). * Empty/whitespace-only return is treated as no-op. * Default: undefined → textarea stays empty. */ prefillTemplate?: (filename: string, kind: PasteKind) => string; /** Fired after onFilesSelected and prefill. */ onConverted?: (filename: string, kind: PasteKind) => void; } /** * Accepts boolean for runtime toggling. `false` and `undefined` both disable. * `true` enables with defaults. Object enables with overrides. */ export type PasteAsFileProp = boolean | PasteAsFileConfig; interface AIInputContextValue { /** Current input value */ value: string; /** Whether the input has text */ hasText: boolean; /** Whether the input is focused */ isFocused: boolean; /** Whether the input is disabled */ disabled: boolean; /** Visual variant */ variant: 'default' | 'compact' | 'inline'; /** Files being uploaded */ uploadingFiles: UploadingFile[]; /** Has attachments */ hasAttachments: boolean; /** Update input value */ setValue: (value: string) => void; /** Set focus state */ setIsFocused: (focused: boolean) => void; /** Handle submit */ handleSubmit: () => void; /** Handle key down */ handleKeyDown: (e: React.KeyboardEvent) => void; /** Handle clear */ handleClear: () => void; /** Paste handler from usePasteAsFile (only set when paste-as-file is active). */ onPaste?: React.ClipboardEventHandler; /** Remove file */ onRemoveFile?: (fileId: string) => void; /** Cancel upload */ onCancelUpload?: (fileId: string) => void; /** Retry failed upload */ onRetryUpload?: (fileId: string) => void; /** Remove all files */ onRemoveAllFiles?: () => void; /** Whether files are being dragged over the input */ isDragging: boolean; /** Open the native file picker */ openFilePicker: () => void; /** Callback when files are selected (via drop or picker) */ onFilesSelected?: (files: FileList) => void; /** Textarea ref (for default variant) */ textareaRef: React.RefObject; /** Input ref (for compact variant) */ inputRef: React.RefObject; } declare const useAIInputContext: () => AIInputContextValue; export interface ActionButtonProps extends React.ButtonHTMLAttributes { /** Icon component to render */ icon: React.ComponentType<{ className?: string; }>; /** Tooltip text */ tooltip?: string; } declare function ActionButton({ icon: Icon, onClick, disabled, tooltip, className, ...props }: ActionButtonProps): React.JSX.Element; declare namespace ActionButton { var displayName: string; } export interface SubmitButtonProps extends Omit, 'children'> { /** Icon component to render (defaults to ArrowUp) */ icon?: React.ComponentType<{ className?: string; }>; } declare function SubmitButton({ icon: Icon, className, onClick, disabled, ...props }: SubmitButtonProps): React.JSX.Element; declare namespace SubmitButton { var displayName: string; } export interface CompactActionButtonProps extends Omit, 'children'> { /** Icon component to render */ icon: React.ComponentType<{ className?: string; }>; /** Accessible label for the icon-only button (required for a11y) */ 'aria-label': string; } /** * @deprecated Use `ActionButton` instead. CompactActionButton will be removed in a future major version. */ declare function CompactActionButton({ icon: Icon, className, onClick, disabled, ...props }: CompactActionButtonProps): React.JSX.Element; declare namespace CompactActionButton { var displayName: string; } /** Props passed to custom submit button render function */ export interface SubmitButtonRenderProps { onClick: () => void; disabled: boolean; } /** Render function type for custom submit button */ export type SubmitButtonRenderFn = (props: SubmitButtonRenderProps) => React.ReactElement; /** Props passed to custom default button render function */ export interface DefaultButtonRenderProps { disabled: boolean; } /** Render function type for custom default button */ export type DefaultButtonRenderFn = (props: DefaultButtonRenderProps) => React.ReactElement; export interface AIInputRootProps { /** Children (composable subcomponents) */ children: React.ReactNode; /** Visual variant of the input */ variant?: 'default' | 'compact' | 'inline'; /** Current input value (controlled) */ value?: string; /** Default input value (uncontrolled) */ defaultValue?: string; /** Callback when value changes */ onChange?: (value: string) => void; /** Callback when message is submitted */ onSubmit?: (message: string) => void; /** Files being uploaded */ uploadingFiles?: UploadingFile[]; /** Callback when file is removed */ onRemoveFile?: (fileId: string) => void; /** Callback when file upload is cancelled */ onCancelUpload?: (fileId: string) => void; /** Callback to retry a failed upload */ onRetryUpload?: (fileId: string) => void; /** Callback to remove all files */ onRemoveAllFiles?: () => void; /** Whether the input is disabled */ disabled?: boolean; /** Additional class name */ className?: string; /** Callback when files are selected (via drag-drop or file picker) */ onFilesSelected?: (files: FileList) => void; /** Accepted file types (e.g. 'image/*,.pdf') */ accept?: string; /** Allow multiple file selection */ multiple?: boolean; /** Text shown in the drop overlay */ dropText?: string; /** Convert large/structured paste into a file attachment. Requires onFilesSelected. */ pasteAsFile?: PasteAsFileProp; } declare function AIInputRoot({ children, variant, value: controlledValue, defaultValue, onChange, onSubmit, uploadingFiles, onRemoveFile, onCancelUpload, onRetryUpload, onRemoveAllFiles, disabled, className, onFilesSelected, accept, multiple, dropText, pasteAsFile, }: AIInputRootProps): React.JSX.Element; declare namespace AIInputRoot { var displayName: string; } export interface AIInputTextAreaProps { /** Placeholder text */ placeholder?: string; /** Additional class name */ className?: string; /** Show clear button when text is present */ showClearButton?: boolean; } declare function AIInputTextArea({ placeholder, className, showClearButton, }: AIInputTextAreaProps): React.JSX.Element; declare namespace AIInputTextArea { var displayName: string; } export interface AIInputLeadingIconProps { /** Icon content (brand icon, spinner, avatar) */ children: React.ReactNode; /** Additional class name */ className?: string; } declare function AIInputLeadingIcon({ children, className }: AIInputLeadingIconProps): React.JSX.Element; declare namespace AIInputLeadingIcon { var displayName: string; } export interface AIInputSendButtonProps extends Omit, 'children'> { /** Icon component to render */ icon?: React.ComponentType<{ className?: string; }>; } declare function AIInputSendButton({ icon, className, ...props }: AIInputSendButtonProps): React.JSX.Element; declare namespace AIInputSendButton { var displayName: string; } export interface AIInputAttachButtonProps extends React.ButtonHTMLAttributes { /** Icon component to render */ icon: React.ComponentType<{ className?: string; }>; /** Tooltip text */ tooltip?: string; } declare function AIInputAttachButton({ icon: Icon, tooltip, className, onClick, ...props }: AIInputAttachButtonProps): React.JSX.Element; declare namespace AIInputAttachButton { var displayName: string; } export interface AIInputActionsProps { /** Children (action buttons) */ children?: React.ReactNode; /** Position of actions */ position?: 'leading' | 'trailing'; /** Additional class name */ className?: string; } declare function AIInputActions({ children, position, className, }: AIInputActionsProps): React.JSX.Element; declare namespace AIInputActions { var displayName: string; } export interface AIInputActionBarProps { /** Children (leading actions, trailing actions, send button) */ children?: React.ReactNode; /** Additional class name */ className?: string; } declare function AIInputActionBar({ children, className }: AIInputActionBarProps): React.JSX.Element; declare namespace AIInputActionBar { var displayName: string; } export interface AIInputFilePreviewProps { /** Additional class name */ className?: string; } declare function AIInputFilePreview({ className }: AIInputFilePreviewProps): React.JSX.Element | null; declare namespace AIInputFilePreview { var displayName: string; } export interface AIInputProps extends VariantProps { /** Visual variant of the input */ variant?: 'default' | 'compact' | 'inline'; /** Placeholder text */ placeholder?: string; /** Current input value */ value?: string; /** Initial input value for uncontrolled usage */ defaultValue?: string; /** Callback when value changes */ onChange?: (value: string) => void; /** Callback when message is submitted */ onSubmit?: (message: string) => void; /** Files being uploaded */ uploadingFiles?: UploadingFile[]; /** Callback when file is removed */ onRemoveFile?: (fileId: string) => void; /** Callback when file upload is cancelled */ onCancelUpload?: (fileId: string) => void; /** Callback to retry a failed upload */ onRetryUpload?: (fileId: string) => void; /** Callback to remove all files */ onRemoveAllFiles?: () => void; /** Callback when files are selected (via drag-drop or file picker) */ onFilesSelected?: (files: FileList) => void; /** Accepted file types (e.g. 'image/*,.pdf') */ accept?: string; /** Allow multiple file selection */ multiple?: boolean; /** Text shown in the drop overlay */ dropText?: string; /** Whether the input is disabled */ disabled?: boolean; /** Additional class name */ className?: string; /** Actions rendered on the left side of the action bar, or before submit in inline mode */ leadingActions?: React.ReactNode; /** Actions rendered on the right side, before submit button */ trailingActions?: React.ReactNode; /** Custom submit button render function - receives onClick and disabled */ submitButton?: SubmitButtonRenderFn; /** Custom default button render function (default variant only) - receives disabled */ defaultButton?: DefaultButtonRenderFn; /** Leading icon for inline variant (brand icon, spinner, avatar). Required for inline, ignored for other variants. */ leadingIcon?: React.ReactNode; /** Convert large/structured paste into a file attachment. */ pasteAsFile?: PasteAsFileProp; } declare function AIInputDefault({ variant, placeholder, value, defaultValue, onChange, onSubmit, uploadingFiles, onRemoveFile, onCancelUpload, onRetryUpload, onRemoveAllFiles, onFilesSelected, accept, multiple, dropText, disabled, className, leadingActions, trailingActions, submitButton, defaultButton, leadingIcon, pasteAsFile, }: AIInputProps): React.JSX.Element; /** * AIInput - Dual-API component for AI chat input. * * Supports two usage patterns: * * 1. **Monolithic API (batteries-included)**: * ```tsx * } * /> * ``` * * 2. **Composable API (full customization)**: * ```tsx * * * * * * * * * * * * * ``` */ declare const AIInput: typeof AIInputDefault & { Root: typeof AIInputRoot; TextArea: typeof AIInputTextArea; LeadingIcon: typeof AIInputLeadingIcon; SendButton: typeof AIInputSendButton; AttachButton: typeof AIInputAttachButton; Actions: typeof AIInputActions; ActionBar: typeof AIInputActionBar; FilePreview: typeof AIInputFilePreview; ActionButton: typeof ActionButton; SubmitButton: typeof SubmitButton; CompactActionButton: typeof CompactActionButton; }; export { ActionButton, AIInput, AIInputActionBar, AIInputActions, AIInputAttachButton, AIInputFilePreview, AIInputLeadingIcon, AIInputRoot, AIInputSendButton, AIInputTextArea, CompactActionButton, inputVariants, SubmitButton, useAIInputContext, };