{"version":3,"file":"chatMessage.types.mjs","names":[],"sources":["../../../../package/common/chatMessage/chatMessage.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\nimport type { ColorValue } from '../themeProvider/color.types';\n\n/** How much the message stands out. Independent of its colour. */\nexport enum ChatMessageStyleType {\n  /** Solid bubble, text in a contrasting colour. The default for `isOwn`. */\n  Filled = 'filled',\n  /** A light tint of the colour. The default for everyone else. */\n  Light = 'light',\n  /** No bubble, full width: an AI assistant's answer. */\n  Plain = 'plain',\n}\n\n/** Delivery state of an own message: an icon next to `time`, and `Failed` a notice under the bubble. */\nexport enum ChatMessageStatus {\n  Sending = 'sending',\n  Sent = 'sent',\n  Delivered = 'delivered',\n  Read = 'read',\n  Failed = 'failed',\n}\n\nexport type ChatMessageSlots = 'avatar' | 'body' | 'author' | 'bubble' | 'meta' | 'actions';\n\n/** Text ChatMessage renders of its own, for translating it. */\nexport interface ChatMessageLabels {\n  /** Read out for the status icon. */\n  sending?: string;\n  sent?: string;\n  delivered?: string;\n  read?: string;\n  /** Shown under the bubble. */\n  failed?: string;\n  /** Names an own message without `author` for screen readers. */\n  you?: string;\n}\n\nexport interface ChatMessageProps extends HtmlProps<HTMLDivElement> {\n  /** The message. A string keeps its line breaks; anything else (rendered Markdown, an image) renders as given. */\n  children?: ReactNode;\n  /** Sent by the current user: aligned to the end, `Filled` in `Primary` by default. */\n  isOwn?: boolean;\n  /** Follows a message from the same author: hides `author` from view, keeps the space of `avatar` and tightens the gap above. */\n  isContinued?: boolean;\n  /** Shown beside the bubble, typically an `Avatar`. */\n  avatar?: ReactNode;\n  /** Name above the bubble. Screen readers get it on every message of a run, not only the first. */\n  author?: ReactNode;\n  /** Shown in the bubble's corner. Format it yourself, e.g. with `Intl.DateTimeFormat`. */\n  time?: ReactNode;\n  status?: ChatMessageStatus;\n  /** Shown below the bubble, after the `Failed` notice: copy, retry, rate. */\n  actions?: ReactNode;\n  /** Default `Filled` when `isOwn`, otherwise `Light`. */\n  styleType?: ChatMessageStyleType;\n  /** A `ThemeColor` or any CSS colour. Default `Primary` when `isOwn`, otherwise `Neutral`. */\n  color?: ColorValue;\n  /** Overrides the text ChatMessage renders of its own. Merged per key. */\n  labels?: ChatMessageLabels;\n  className?: string;\n  style?: CSSProperties;\n  classNames?: SlotClassNames<ChatMessageSlots>;\n  styles?: SlotStyles<ChatMessageSlots>;\n}\n"],"mappings":"aAKA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,OAAA,SAEA,EAAA,MAAA,QAEA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAGY,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,KAAA,OACA,EAAA,UAAA,YACA,EAAA,KAAA,OACA,EAAA,OAAA,UACF,EAAA,CAAA,CAAA"}