@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
37 lines (36 loc) • 2.28 kB
TypeScript
import { ThemingProps } from "../theme/types.js";
import { BoxProps } from "../box/box.types.js";
import { ButtonProps } from "../button/button.types.js";
import { MessageProps } from "../message/message.types.js";
//#region src/chat/chat.types.d.ts
type ChatInputStatus = 'default' | 'processing' | 'disabled';
type ChatProps = Omit<BoxProps, 'size' | 'variant'> & ThemingProps<'Chat'> & {
/** Status of the chat input @default 'default' */inputStatus?: ChatInputStatus; /** An array of chat messages */
messages?: MessageProps[]; /** Optional string indicating a help text under the input */
helpText?: string; /** Max height for the textarea @default 120 */
maxTextareaHeight?: number; /** Optional string indicating a message being processed */
processingMessage?: string; /** An array of suggestion strings */
suggestions?: string[]; /** Callback function for when a new topic is clicked */
onNewTopicClick?: () => void; /** Callback function for when a suggestion is clicked */
onSuggestionClick?: (suggestion: string) => void; /** Optional callback function for sending a message */
onSend?: (message: string) => void; /** Optional callback function for stopping an action */
onStop?: () => void;
};
type ChatInputProps = Omit<BoxProps, 'size' | 'variant'> & {
/** Placeholder text for the input */placeholder?: string; /** Status of the chat input */
status?: ChatInputStatus; /** Optional string indicating a help text */
helpText?: string; /** Max height for the textarea @default 120 */
maxTextareaHeight?: number; /** @default 'Generating message' */
processingMessage?: string; /** Callback function for when a new topic is clicked */
onNewTopicClick?: () => void; /** Optional callback function for sending a message */
onSend?: (message: string) => void; /** Optional callback function for stopping an action */
onStop?: () => void;
};
type ChatInputButtonProps = Omit<ButtonProps, 'size'> & {
/** Status of the chat input */status?: ChatInputStatus; /** Callback function for sending a message */
onSend?: () => void; /** Callback function for stopping an action */
onStop?: () => void;
};
//#endregion
export { ChatInputButtonProps, ChatInputProps, ChatInputStatus, ChatProps };
//# sourceMappingURL=chat.types.d.ts.map