import * as React from 'react'; import { RefObject, HTMLAttributes, FormEvent, ComponentProps, ReactNode, PropsWithChildren } from 'react'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { FileUIPart, SourceDocumentUIPart, ChatStatus } from 'ai'; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../ui/command.js'; import { DropdownMenuItem, DropdownMenu, DropdownMenuContent } from '../ui/dropdown-menu.js'; import { HoverCard, HoverCardContent, HoverCardTrigger } from '../ui/hover-card.js'; import { InputGroupButton, InputGroupAddon, InputGroupTextarea } from '../ui/input-group.js'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select.js'; import { TooltipContent } from '../ui/tooltip.js'; import 'cmdk'; import '../ui/dialog.js'; import '@base-ui/react/dialog'; import '@base-ui/react/menu'; import '@base-ui/react/preview-card'; import 'class-variance-authority/types'; import 'class-variance-authority'; import '../ui/button.js'; import '@base-ui/react/button'; import '@base-ui/react/select'; import '@base-ui/react/tooltip'; interface AttachmentsContext { files: (FileUIPart & { id: string; })[]; add: (files: File[] | FileList) => void; remove: (id: string) => void; clear: () => void; openFileDialog: () => void; fileInputRef: RefObject; } interface TextInputContext { value: string; setInput: (v: string) => void; clear: () => void; } interface PromptInputControllerProps { textInput: TextInputContext; attachments: AttachmentsContext; /** INTERNAL: Allows PromptInput to register its file textInput + "open" callback */ __registerFileInput: (ref: RefObject, open: () => void) => void; } declare const usePromptInputController: () => PromptInputControllerProps; declare const useProviderAttachments: () => AttachmentsContext; type PromptInputProviderProps = PropsWithChildren<{ initialInput?: string; }>; /** * Optional global provider that lifts PromptInput state outside of PromptInput. * If you don't use it, PromptInput stays fully self-managed. */ declare const PromptInputProvider: ({ initialInput: initialTextInput, children, }: PromptInputProviderProps) => react_jsx_runtime.JSX.Element; declare const usePromptInputAttachments: () => AttachmentsContext; interface ReferencedSourcesContext { sources: (SourceDocumentUIPart & { id: string; })[]; add: (sources: SourceDocumentUIPart[] | SourceDocumentUIPart) => void; remove: (id: string) => void; clear: () => void; } declare const LocalReferencedSourcesContext: React.Context; declare const usePromptInputReferencedSources: () => ReferencedSourcesContext; type PromptInputActionAddAttachmentsProps = ComponentProps & { label?: string; }; declare const PromptInputActionAddAttachments: ({ label, ...props }: PromptInputActionAddAttachmentsProps) => react_jsx_runtime.JSX.Element; type PromptInputActionAddScreenshotProps = ComponentProps & { label?: string; }; declare const PromptInputActionAddScreenshot: ({ label, onSelect, ...props }: PromptInputActionAddScreenshotProps) => react_jsx_runtime.JSX.Element; interface PromptInputMessage { text: string; files: FileUIPart[]; } type PromptInputProps = Omit, "onSubmit" | "onError"> & { accept?: string; multiple?: boolean; globalDrop?: boolean; syncHiddenInput?: boolean; maxFiles?: number; maxFileSize?: number; onError?: (err: { code: "max_files" | "max_file_size" | "accept"; message: string; }) => void; onSubmit: (message: PromptInputMessage, event: FormEvent) => void | Promise; }; declare const PromptInput: ({ className, accept, multiple, globalDrop, syncHiddenInput, maxFiles, maxFileSize, onError, onSubmit, children, ...props }: PromptInputProps) => react_jsx_runtime.JSX.Element; type PromptInputBodyProps = HTMLAttributes; declare const PromptInputBody: ({ className, ...props }: PromptInputBodyProps) => react_jsx_runtime.JSX.Element; type PromptInputTextareaProps = ComponentProps; declare const PromptInputTextarea: ({ onChange, onKeyDown, className, placeholder, ...props }: PromptInputTextareaProps) => react_jsx_runtime.JSX.Element; type PromptInputHeaderProps = Omit, "align">; declare const PromptInputHeader: ({ className, ...props }: PromptInputHeaderProps) => react_jsx_runtime.JSX.Element; type PromptInputFooterProps = Omit, "align">; declare const PromptInputFooter: ({ className, ...props }: PromptInputFooterProps) => react_jsx_runtime.JSX.Element; type PromptInputToolsProps = HTMLAttributes; declare const PromptInputTools: ({ className, ...props }: PromptInputToolsProps) => react_jsx_runtime.JSX.Element; type PromptInputButtonTooltip = string | { content: ReactNode; shortcut?: string; side?: ComponentProps["side"]; }; type PromptInputButtonProps = ComponentProps & { tooltip?: PromptInputButtonTooltip; }; declare const PromptInputButton: ({ variant, className, size, tooltip, ...props }: PromptInputButtonProps) => react_jsx_runtime.JSX.Element; type PromptInputActionMenuProps = ComponentProps; declare const PromptInputActionMenu: (props: PromptInputActionMenuProps) => react_jsx_runtime.JSX.Element; type PromptInputActionMenuTriggerProps = PromptInputButtonProps; declare const PromptInputActionMenuTrigger: ({ className, children, ...props }: PromptInputActionMenuTriggerProps) => react_jsx_runtime.JSX.Element; type PromptInputActionMenuContentProps = ComponentProps; declare const PromptInputActionMenuContent: ({ className, ...props }: PromptInputActionMenuContentProps) => react_jsx_runtime.JSX.Element; type PromptInputActionMenuItemProps = ComponentProps; declare const PromptInputActionMenuItem: ({ className, ...props }: PromptInputActionMenuItemProps) => react_jsx_runtime.JSX.Element; type PromptInputSubmitProps = ComponentProps & { status?: ChatStatus; onStop?: () => void; }; declare const PromptInputSubmit: ({ className, variant, size, status, onStop, onClick, children, ...props }: PromptInputSubmitProps) => react_jsx_runtime.JSX.Element; type PromptInputSelectProps = ComponentProps; declare const PromptInputSelect: (props: PromptInputSelectProps) => react_jsx_runtime.JSX.Element; type PromptInputSelectTriggerProps = ComponentProps; declare const PromptInputSelectTrigger: ({ className, ...props }: PromptInputSelectTriggerProps) => react_jsx_runtime.JSX.Element; type PromptInputSelectContentProps = ComponentProps; declare const PromptInputSelectContent: ({ className, ...props }: PromptInputSelectContentProps) => react_jsx_runtime.JSX.Element; type PromptInputSelectItemProps = ComponentProps; declare const PromptInputSelectItem: ({ className, ...props }: PromptInputSelectItemProps) => react_jsx_runtime.JSX.Element; type PromptInputSelectValueProps = ComponentProps; declare const PromptInputSelectValue: ({ className, ...props }: PromptInputSelectValueProps) => react_jsx_runtime.JSX.Element; type PromptInputHoverCardProps = ComponentProps; declare const PromptInputHoverCard: (props: PromptInputHoverCardProps) => react_jsx_runtime.JSX.Element; type PromptInputHoverCardTriggerProps = ComponentProps; declare const PromptInputHoverCardTrigger: (props: PromptInputHoverCardTriggerProps) => react_jsx_runtime.JSX.Element; type PromptInputHoverCardContentProps = ComponentProps; declare const PromptInputHoverCardContent: ({ align, ...props }: PromptInputHoverCardContentProps) => react_jsx_runtime.JSX.Element; type PromptInputTabsListProps = HTMLAttributes; declare const PromptInputTabsList: ({ className, ...props }: PromptInputTabsListProps) => react_jsx_runtime.JSX.Element; type PromptInputTabProps = HTMLAttributes; declare const PromptInputTab: ({ className, ...props }: PromptInputTabProps) => react_jsx_runtime.JSX.Element; type PromptInputTabLabelProps = HTMLAttributes; declare const PromptInputTabLabel: ({ className, ...props }: PromptInputTabLabelProps) => react_jsx_runtime.JSX.Element; type PromptInputTabBodyProps = HTMLAttributes; declare const PromptInputTabBody: ({ className, ...props }: PromptInputTabBodyProps) => react_jsx_runtime.JSX.Element; type PromptInputTabItemProps = HTMLAttributes; declare const PromptInputTabItem: ({ className, ...props }: PromptInputTabItemProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandProps = ComponentProps; declare const PromptInputCommand: ({ className, ...props }: PromptInputCommandProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandInputProps = ComponentProps; declare const PromptInputCommandInput: ({ className, ...props }: PromptInputCommandInputProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandListProps = ComponentProps; declare const PromptInputCommandList: ({ className, ...props }: PromptInputCommandListProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandEmptyProps = ComponentProps; declare const PromptInputCommandEmpty: ({ className, ...props }: PromptInputCommandEmptyProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandGroupProps = ComponentProps; declare const PromptInputCommandGroup: ({ className, ...props }: PromptInputCommandGroupProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandItemProps = ComponentProps; declare const PromptInputCommandItem: ({ className, ...props }: PromptInputCommandItemProps) => react_jsx_runtime.JSX.Element; type PromptInputCommandSeparatorProps = ComponentProps; declare const PromptInputCommandSeparator: ({ className, ...props }: PromptInputCommandSeparatorProps) => react_jsx_runtime.JSX.Element; export { type AttachmentsContext, LocalReferencedSourcesContext, PromptInput, PromptInputActionAddAttachments, type PromptInputActionAddAttachmentsProps, PromptInputActionAddScreenshot, type PromptInputActionAddScreenshotProps, PromptInputActionMenu, PromptInputActionMenuContent, type PromptInputActionMenuContentProps, PromptInputActionMenuItem, type PromptInputActionMenuItemProps, type PromptInputActionMenuProps, PromptInputActionMenuTrigger, type PromptInputActionMenuTriggerProps, PromptInputBody, type PromptInputBodyProps, PromptInputButton, type PromptInputButtonProps, type PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, type PromptInputCommandEmptyProps, PromptInputCommandGroup, type PromptInputCommandGroupProps, PromptInputCommandInput, type PromptInputCommandInputProps, PromptInputCommandItem, type PromptInputCommandItemProps, PromptInputCommandList, type PromptInputCommandListProps, type PromptInputCommandProps, PromptInputCommandSeparator, type PromptInputCommandSeparatorProps, type PromptInputControllerProps, PromptInputFooter, type PromptInputFooterProps, PromptInputHeader, type PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, type PromptInputHoverCardContentProps, type PromptInputHoverCardProps, PromptInputHoverCardTrigger, type PromptInputHoverCardTriggerProps, type PromptInputMessage, type PromptInputProps, PromptInputProvider, type PromptInputProviderProps, PromptInputSelect, PromptInputSelectContent, type PromptInputSelectContentProps, PromptInputSelectItem, type PromptInputSelectItemProps, type PromptInputSelectProps, PromptInputSelectTrigger, type PromptInputSelectTriggerProps, PromptInputSelectValue, type PromptInputSelectValueProps, PromptInputSubmit, type PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, type PromptInputTabBodyProps, PromptInputTabItem, type PromptInputTabItemProps, PromptInputTabLabel, type PromptInputTabLabelProps, type PromptInputTabProps, PromptInputTabsList, type PromptInputTabsListProps, PromptInputTextarea, type PromptInputTextareaProps, PromptInputTools, type PromptInputToolsProps, type ReferencedSourcesContext, type TextInputContext, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments };