import { CSSProperties, ReactNode } from 'react'; import { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types.js'; import { ColorValue } from '../themeProvider/color.types.js'; /** How much the message stands out. Independent of its colour. */ export declare enum ChatMessageStyleType { /** Solid bubble, text in a contrasting colour. The default for `isOwn`. */ Filled = "filled", /** A light tint of the colour. The default for everyone else. */ Light = "light", /** No bubble, full width: an AI assistant's answer. */ Plain = "plain" } /** Delivery state of an own message: an icon next to `time`, and `Failed` a notice under the bubble. */ export declare enum ChatMessageStatus { Sending = "sending", Sent = "sent", Delivered = "delivered", Read = "read", Failed = "failed" } export type ChatMessageSlots = 'avatar' | 'body' | 'author' | 'bubble' | 'meta' | 'actions'; /** Text ChatMessage renders of its own, for translating it. */ export interface ChatMessageLabels { /** Read out for the status icon. */ sending?: string; sent?: string; delivered?: string; read?: string; /** Shown under the bubble. */ failed?: string; /** Names an own message without `author` for screen readers. */ you?: string; } export interface ChatMessageProps extends HtmlProps { /** The message. A string keeps its line breaks; anything else (rendered Markdown, an image) renders as given. */ children?: ReactNode; /** Sent by the current user: aligned to the end, `Filled` in `Primary` by default. */ isOwn?: boolean; /** Follows a message from the same author: hides `author` from view, keeps the space of `avatar` and tightens the gap above. */ isContinued?: boolean; /** Shown beside the bubble, typically an `Avatar`. */ avatar?: ReactNode; /** Name above the bubble. Screen readers get it on every message of a run, not only the first. */ author?: ReactNode; /** Shown in the bubble's corner. Format it yourself, e.g. with `Intl.DateTimeFormat`. */ time?: ReactNode; status?: ChatMessageStatus; /** Shown below the bubble, after the `Failed` notice: copy, retry, rate. */ actions?: ReactNode; /** Default `Filled` when `isOwn`, otherwise `Light`. */ styleType?: ChatMessageStyleType; /** A `ThemeColor` or any CSS colour. Default `Primary` when `isOwn`, otherwise `Neutral`. */ color?: ColorValue; /** Overrides the text ChatMessage renders of its own. Merged per key. */ labels?: ChatMessageLabels; className?: string; style?: CSSProperties; classNames?: SlotClassNames; styles?: SlotStyles; }