@langchain/macaw-components 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.json +623 -497
- package/dist/components/Accordion/Accordion.js +2 -8
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/ChatConversationList/ChatConversationList.d.ts +26 -0
- package/dist/components/ChatConversationList/ChatConversationList.js +83 -0
- package/dist/components/ChatConversationList/ChatConversationList.js.map +1 -0
- package/dist/components/ChatConversationList/ChatConversationListActions.d.ts +22 -0
- package/dist/components/ChatConversationList/ChatConversationListActions.js +61 -0
- package/dist/components/ChatConversationList/ChatConversationListActions.js.map +1 -0
- package/dist/components/ChatConversationList/ChatConversationListGroup.d.ts +27 -0
- package/dist/components/ChatConversationList/ChatConversationListGroup.js +96 -0
- package/dist/components/ChatConversationList/ChatConversationListGroup.js.map +1 -0
- package/dist/components/ChatConversationList/ChatConversationListItem.d.ts +40 -0
- package/dist/components/ChatConversationList/ChatConversationListItem.js +83 -0
- package/dist/components/ChatConversationList/ChatConversationListItem.js.map +1 -0
- package/dist/components/ChatConversationList/index.d.ts +6 -0
- package/dist/components/ChatConversationList/index.js +4 -0
- package/dist/components/ChatMessage/ChatMessage.d.ts +64 -0
- package/dist/components/ChatMessage/ChatMessage.js +216 -0
- package/dist/components/ChatMessage/ChatMessage.js.map +1 -0
- package/dist/components/ChatMessage/ChatMessage.types.d.ts +32 -0
- package/dist/components/ChatMessage/ChatMessage.types.js +0 -0
- package/dist/components/ChatMessage/index.d.ts +3 -0
- package/dist/components/ChatMessage/index.js +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +3 -2
- package/dist/icons/LongTailPhosphorIcons.js +1 -1
- package/dist/index.js +3 -2
- package/dist/utilities.css +1 -1
- package/dist/utils/hasContent.d.ts +3 -0
- package/dist/utils/hasContent.js +10 -0
- package/dist/utils/hasContent.js.map +1 -0
- package/package.json +14 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type AvatarProps } from '../Avatar/index.js';
|
|
3
|
+
import type { ChatMessageActionCapabilities, ChatMessageContentBlock, ChatMessageModel, ChatMessageStatus } from './ChatMessage.types.js';
|
|
4
|
+
export interface ChatMessageProps extends ComponentPropsWithRef<'div'> {
|
|
5
|
+
message: ChatMessageModel;
|
|
6
|
+
/** Metadata and actions share the message's footer layout and visibility. */
|
|
7
|
+
footer?: ReactNode;
|
|
8
|
+
/** `Avatar` shown before the name in the default header, sized to match it. */
|
|
9
|
+
avatar?: Omit<AvatarProps, 'size'>;
|
|
10
|
+
/**
|
|
11
|
+
* Name shown after the avatar in the default header. A string name also
|
|
12
|
+
* labels the message for screen readers; otherwise the avatar's label or
|
|
13
|
+
* the role label does.
|
|
14
|
+
*/
|
|
15
|
+
name?: ReactNode;
|
|
16
|
+
/** Defaults to end for user messages and start for other roles. */
|
|
17
|
+
align?: 'start' | 'end';
|
|
18
|
+
/** Keeps the footer visible; earlier messages reveal it on hover or focus. */
|
|
19
|
+
isLatest?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Fade in complete text blocks as they mount; keep their IDs stable. A
|
|
22
|
+
* message that mounts already settled, such as history, doesn't fade in.
|
|
23
|
+
*/
|
|
24
|
+
animateParagraphs?: boolean;
|
|
25
|
+
contentClassName?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* One message in a conversation. Renders a header and the message's content
|
|
29
|
+
* blocks, or `children` in their place for custom layouts. The footer is
|
|
30
|
+
* hidden, but keeps its space, while the message streams.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ChatMessage({ message, footer, avatar, name, align, isLatest, animateParagraphs, className, contentClassName, children, ...props }: ChatMessageProps): import("react").JSX.Element;
|
|
33
|
+
export interface ChatMessageHeaderProps extends ComponentPropsWithRef<'div'> {
|
|
34
|
+
avatar?: Omit<AvatarProps, 'size'>;
|
|
35
|
+
name?: ReactNode;
|
|
36
|
+
status?: ChatMessageStatus;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Avatar, name, and status line. Renders nothing without any of them or
|
|
40
|
+
* children, unless it has shown a streaming status.
|
|
41
|
+
*/
|
|
42
|
+
export declare function ChatMessageHeader({ avatar, name, status, children, className, ...props }: ChatMessageHeaderProps): import("react").JSX.Element | null;
|
|
43
|
+
export interface ChatMessageBodyProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
|
|
44
|
+
blocks: readonly ChatMessageContentBlock[];
|
|
45
|
+
/** Supply one complete paragraph per text block; existing blocks do not replay. */
|
|
46
|
+
animateParagraphs?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Content blocks in order. Text blocks render as escaped plain text. */
|
|
49
|
+
export declare function ChatMessageBody({ blocks, animateParagraphs, className, ...props }: ChatMessageBodyProps): import("react").JSX.Element | null;
|
|
50
|
+
export interface ChatMessageActionsProps extends ComponentPropsWithRef<'div'> {
|
|
51
|
+
actions?: ChatMessageActionCapabilities;
|
|
52
|
+
status?: ChatMessageStatus;
|
|
53
|
+
readOnly?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Copy, edit, and retry buttons, plus any host actions in `children`. Edit
|
|
57
|
+
* and retry are hidden while the message is pending or read-only; copy stays
|
|
58
|
+
* available. Renders nothing when no actions remain.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ChatMessageActions({ actions, status, readOnly, children, className, ...props }: ChatMessageActionsProps): import("react").JSX.Element | null;
|
|
61
|
+
export interface ChatTurnDividerProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
|
|
62
|
+
label: string;
|
|
63
|
+
}
|
|
64
|
+
export declare function ChatTurnDivider({ label, className, ...props }: ChatTurnDividerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.js";
|
|
2
|
+
import { Text } from "../Text/Text.js";
|
|
3
|
+
import { Avatar } from "../Avatar/Avatar.js";
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
|
+
import { Icon } from "../Icon/Icon.js";
|
|
6
|
+
import { Divider } from "../Divider/Divider.js";
|
|
7
|
+
import { ThinkingState } from "../ThinkingState/ThinkingState.js";
|
|
8
|
+
import { Fragment, useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { WarningCircleIcon } from "@phosphor-icons/react/dist/ssr/WarningCircle";
|
|
11
|
+
import { PencilSimpleIcon } from "@phosphor-icons/react/dist/ssr/PencilSimple";
|
|
12
|
+
import { ArrowClockwiseIcon } from "@phosphor-icons/react/dist/ssr/ArrowClockwise";
|
|
13
|
+
import { CopySimpleIcon } from "@phosphor-icons/react/dist/ssr/CopySimple";
|
|
14
|
+
//#region packages/components/src/components/ChatMessage/ChatMessage.tsx
|
|
15
|
+
var roleLabels = {
|
|
16
|
+
user: "User",
|
|
17
|
+
assistant: "Assistant",
|
|
18
|
+
system: "System",
|
|
19
|
+
tool: "Tool"
|
|
20
|
+
};
|
|
21
|
+
var statusLabels = {
|
|
22
|
+
idle: null,
|
|
23
|
+
queued: "Queued",
|
|
24
|
+
submitting: "Sending",
|
|
25
|
+
streaming: "Responding",
|
|
26
|
+
interrupted: "Interrupted",
|
|
27
|
+
failed: "Failed",
|
|
28
|
+
stopped: "Stopped",
|
|
29
|
+
completed: null
|
|
30
|
+
};
|
|
31
|
+
var settledStatuses = /* @__PURE__ */ new Set([
|
|
32
|
+
"completed",
|
|
33
|
+
"failed",
|
|
34
|
+
"stopped",
|
|
35
|
+
"interrupted"
|
|
36
|
+
]);
|
|
37
|
+
/**
|
|
38
|
+
* One message in a conversation. Renders a header and the message's content
|
|
39
|
+
* blocks, or `children` in their place for custom layouts. The footer is
|
|
40
|
+
* hidden, but keeps its space, while the message streams.
|
|
41
|
+
*/
|
|
42
|
+
function ChatMessage({ message, footer, avatar, name, align, isLatest = false, animateParagraphs = false, className, contentClassName, children, ...props }) {
|
|
43
|
+
const alignment = align ?? (message.role === "user" ? "end" : "start");
|
|
44
|
+
const isStreaming = message.status === "streaming";
|
|
45
|
+
const isSettled = settledStatuses.has(message.status);
|
|
46
|
+
const [isHistory, setIsHistory] = useState(isSettled);
|
|
47
|
+
if (isHistory && !isSettled) setIsHistory(false);
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
role: "article",
|
|
50
|
+
"aria-label": `${typeof name === "string" ? name : avatar?.label || roleLabels[message.role]} message`,
|
|
51
|
+
"aria-busy": isStreaming || message.status === "submitting",
|
|
52
|
+
className: cn("group/chat-message flex w-full min-w-0 text-primary", alignment === "end" && "justify-end", className),
|
|
53
|
+
...props,
|
|
54
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: cn("flex min-w-0 max-w-full flex-col gap-space-2", alignment === "end" ? "w-fit max-w-[85%] items-end" : "w-full", contentClassName),
|
|
56
|
+
children: [children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ChatMessageHeader, {
|
|
57
|
+
avatar,
|
|
58
|
+
name,
|
|
59
|
+
status: message.status
|
|
60
|
+
}), /* @__PURE__ */ jsx(ChatMessageBody, {
|
|
61
|
+
blocks: message.content,
|
|
62
|
+
animateParagraphs: animateParagraphs && !isHistory,
|
|
63
|
+
className: alignment === "end" ? "items-end" : void 0
|
|
64
|
+
})] }), footer != null && /* @__PURE__ */ jsx("div", {
|
|
65
|
+
inert: isStreaming,
|
|
66
|
+
className: cn("flex min-w-0 max-w-full flex-wrap items-center gap-space-2 [overflow-wrap:anywhere]", isStreaming && "invisible", !isLatest && "transition-opacity duration-fast focus-within:transition-none motion-reduce:transition-none pointer-fine:opacity-0 pointer-fine:focus-within:opacity-100 pointer-fine:group-hover/chat-message:opacity-100 pointer-fine:has-[[data-state=open]]:opacity-100"),
|
|
67
|
+
children: footer
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Avatar, name, and status line. Renders nothing without any of them or
|
|
74
|
+
* children, unless it has shown a streaming status.
|
|
75
|
+
*/
|
|
76
|
+
function ChatMessageHeader({ avatar, name, status = "completed", children, className, ...props }) {
|
|
77
|
+
const [hasStreamed, setHasStreamed] = useState(status === "streaming");
|
|
78
|
+
if (status === "streaming" && !hasStreamed) setHasStreamed(true);
|
|
79
|
+
const statusLabel = statusLabels[status];
|
|
80
|
+
const isEmpty = avatar == null && name == null && !statusLabel && children == null;
|
|
81
|
+
if (isEmpty && !hasStreamed) return null;
|
|
82
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: cn("flex min-w-0 max-w-full flex-wrap items-center gap-space-2 [overflow-wrap:anywhere]", isEmpty && "min-h-lh text-xxs leading-snug", className),
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
avatar && /* @__PURE__ */ jsx("span", {
|
|
87
|
+
"aria-hidden": "true",
|
|
88
|
+
className: "inline-flex shrink-0",
|
|
89
|
+
children: /* @__PURE__ */ jsx(Avatar, {
|
|
90
|
+
size: "xs",
|
|
91
|
+
...avatar
|
|
92
|
+
})
|
|
93
|
+
}),
|
|
94
|
+
name != null && /* @__PURE__ */ jsx(Text, {
|
|
95
|
+
as: "span",
|
|
96
|
+
variant: "xs",
|
|
97
|
+
weight: "medium",
|
|
98
|
+
className: "leading-snug",
|
|
99
|
+
children: name
|
|
100
|
+
}),
|
|
101
|
+
status === "streaming" ? /* @__PURE__ */ jsx(ThinkingState, {
|
|
102
|
+
size: "xs",
|
|
103
|
+
label: statusLabel,
|
|
104
|
+
motion: "subtle"
|
|
105
|
+
}) : statusLabel ? /* @__PURE__ */ jsxs(Text, {
|
|
106
|
+
as: "span",
|
|
107
|
+
variant: "xs",
|
|
108
|
+
color: status === "failed" ? "error" : "secondary",
|
|
109
|
+
className: "flex items-center gap-space-2 leading-snug",
|
|
110
|
+
children: [status === "failed" && /* @__PURE__ */ jsx(Icon, {
|
|
111
|
+
icon: WarningCircleIcon,
|
|
112
|
+
size: "sm",
|
|
113
|
+
weight: "fill",
|
|
114
|
+
className: "text-icon-error",
|
|
115
|
+
"aria-hidden": "true"
|
|
116
|
+
}), statusLabel]
|
|
117
|
+
}) : null,
|
|
118
|
+
children
|
|
119
|
+
]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** Content blocks in order. Text blocks render as escaped plain text. */
|
|
123
|
+
function ChatMessageBody({ blocks, animateParagraphs = false, className, ...props }) {
|
|
124
|
+
if (blocks.length === 0) return null;
|
|
125
|
+
return /* @__PURE__ */ jsx("div", {
|
|
126
|
+
className: cn("flex w-full min-w-0 max-w-full flex-col gap-space-3 [overflow-wrap:anywhere]", "[&_img]:max-w-full [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:block [&_table]:max-w-full [&_table]:overflow-x-auto", className),
|
|
127
|
+
...props,
|
|
128
|
+
children: blocks.map((block) => {
|
|
129
|
+
const content = block.type === "text" ? /* @__PURE__ */ jsx(Text, {
|
|
130
|
+
as: "p",
|
|
131
|
+
variant: "sm",
|
|
132
|
+
weight: "normal",
|
|
133
|
+
className: cn("min-w-0 whitespace-pre-wrap leading-normal tracking-normal text-inherit", animateParagraphs && "animate-in fade-in duration-normal ease-out motion-reduce:animate-none"),
|
|
134
|
+
children: block.text
|
|
135
|
+
}) : block.content;
|
|
136
|
+
return block.appearance === "bubble" ? /* @__PURE__ */ jsx("div", {
|
|
137
|
+
className: "w-fit min-w-0 max-w-full rounded-xl bg-surface-level-2 px-space-3 py-space-2",
|
|
138
|
+
children: content
|
|
139
|
+
}, block.id) : /* @__PURE__ */ jsx(Fragment, { children: content }, block.id);
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
var actionDefinitions = [
|
|
144
|
+
{
|
|
145
|
+
name: "copy",
|
|
146
|
+
label: "Copy message",
|
|
147
|
+
icon: CopySimpleIcon
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "edit",
|
|
151
|
+
label: "Edit message",
|
|
152
|
+
icon: PencilSimpleIcon
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "retry",
|
|
156
|
+
label: "Retry message",
|
|
157
|
+
icon: ArrowClockwiseIcon
|
|
158
|
+
}
|
|
159
|
+
];
|
|
160
|
+
function canChangeMessage(status, readOnly) {
|
|
161
|
+
return !readOnly && status !== "queued" && status !== "submitting" && status !== "streaming";
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Copy, edit, and retry buttons, plus any host actions in `children`. Edit
|
|
165
|
+
* and retry are hidden while the message is pending or read-only; copy stays
|
|
166
|
+
* available. Renders nothing when no actions remain.
|
|
167
|
+
*/
|
|
168
|
+
function ChatMessageActions({ actions, status = "completed", readOnly = false, children, className, ...props }) {
|
|
169
|
+
const canChange = canChangeMessage(status, readOnly);
|
|
170
|
+
const visibleActions = actionDefinitions.flatMap((definition) => {
|
|
171
|
+
const action = actions?.[definition.name];
|
|
172
|
+
return action && (definition.name === "copy" || canChange) ? [{
|
|
173
|
+
...definition,
|
|
174
|
+
action
|
|
175
|
+
}] : [];
|
|
176
|
+
});
|
|
177
|
+
if (visibleActions.length === 0 && children == null) return null;
|
|
178
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
179
|
+
role: "group",
|
|
180
|
+
"aria-label": "Message actions",
|
|
181
|
+
className: cn("flex min-w-0 max-w-full flex-wrap items-center gap-space-1", className),
|
|
182
|
+
...props,
|
|
183
|
+
children: [visibleActions.map(({ name, label, icon, action }) => /* @__PURE__ */ jsx(IconButton, {
|
|
184
|
+
icon,
|
|
185
|
+
iconWeight: "regular",
|
|
186
|
+
label: action.label ?? label,
|
|
187
|
+
color: "secondary",
|
|
188
|
+
variant: "plain",
|
|
189
|
+
size: "xs",
|
|
190
|
+
onClick: action.onClick
|
|
191
|
+
}, name)), children]
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function ChatTurnDivider({ label, className, ...props }) {
|
|
195
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
196
|
+
role: "separator",
|
|
197
|
+
"aria-label": label,
|
|
198
|
+
"aria-orientation": "horizontal",
|
|
199
|
+
className: cn("flex w-full min-w-0 items-center gap-space-3 py-space-3", className),
|
|
200
|
+
...props,
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsx(Divider, { className: "min-w-space-4 flex-1" }),
|
|
203
|
+
/* @__PURE__ */ jsx(Text, {
|
|
204
|
+
variant: "xs",
|
|
205
|
+
color: "tertiary",
|
|
206
|
+
className: "min-w-0 text-center [overflow-wrap:anywhere]",
|
|
207
|
+
children: label
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ jsx(Divider, { className: "min-w-space-4 flex-1" })
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
export { ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider };
|
|
215
|
+
|
|
216
|
+
//# sourceMappingURL=ChatMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatMessage.js","names":[],"sources":["../../../src/components/ChatMessage/ChatMessage.tsx"],"sourcesContent":["import {\n Fragment,\n useState,\n type ComponentPropsWithRef,\n type ReactNode,\n} from 'react';\n\nimport { ArrowClockwiseIcon } from '@phosphor-icons/react/dist/ssr/ArrowClockwise';\nimport { CopySimpleIcon } from '@phosphor-icons/react/dist/ssr/CopySimple';\nimport { PencilSimpleIcon } from '@phosphor-icons/react/dist/ssr/PencilSimple';\nimport { WarningCircleIcon } from '@phosphor-icons/react/dist/ssr/WarningCircle';\n\nimport { cn } from '../../utils/cn';\nimport type { IconComponent } from '../../utils/icon-types';\nimport { Avatar, type AvatarProps } from '../Avatar';\nimport { Divider } from '../Divider';\nimport { Icon } from '../Icon';\nimport { IconButton } from '../IconButton';\nimport { Text } from '../Text';\nimport { ThinkingState } from '../ThinkingState';\nimport type {\n ChatMessageActionCapabilities,\n ChatMessageContentBlock,\n ChatMessageModel,\n ChatMessageRole,\n ChatMessageStatus,\n} from './ChatMessage.types';\n\nconst roleLabels: Record<ChatMessageRole, string> = {\n user: 'User',\n assistant: 'Assistant',\n system: 'System',\n tool: 'Tool',\n};\n\nconst statusLabels: Record<ChatMessageStatus, string | null> = {\n idle: null,\n queued: 'Queued',\n submitting: 'Sending',\n streaming: 'Responding',\n interrupted: 'Interrupted',\n failed: 'Failed',\n stopped: 'Stopped',\n completed: null,\n};\n\nconst settledStatuses = new Set<ChatMessageStatus>([\n 'completed',\n 'failed',\n 'stopped',\n 'interrupted',\n]);\n\nexport interface ChatMessageProps extends ComponentPropsWithRef<'div'> {\n message: ChatMessageModel;\n /** Metadata and actions share the message's footer layout and visibility. */\n footer?: ReactNode;\n /** `Avatar` shown before the name in the default header, sized to match it. */\n avatar?: Omit<AvatarProps, 'size'>;\n /**\n * Name shown after the avatar in the default header. A string name also\n * labels the message for screen readers; otherwise the avatar's label or\n * the role label does.\n */\n name?: ReactNode;\n /** Defaults to end for user messages and start for other roles. */\n align?: 'start' | 'end';\n /** Keeps the footer visible; earlier messages reveal it on hover or focus. */\n isLatest?: boolean;\n /**\n * Fade in complete text blocks as they mount; keep their IDs stable. A\n * message that mounts already settled, such as history, doesn't fade in.\n */\n animateParagraphs?: boolean;\n contentClassName?: string;\n}\n\n/**\n * One message in a conversation. Renders a header and the message's content\n * blocks, or `children` in their place for custom layouts. The footer is\n * hidden, but keeps its space, while the message streams.\n */\nexport function ChatMessage({\n message,\n footer,\n avatar,\n name,\n align,\n isLatest = false,\n animateParagraphs = false,\n className,\n contentClassName,\n children,\n ...props\n}: ChatMessageProps) {\n const alignment = align ?? (message.role === 'user' ? 'end' : 'start');\n const isStreaming = message.status === 'streaming';\n const isSettled = settledStatuses.has(message.status);\n const [isHistory, setIsHistory] = useState(isSettled);\n if (isHistory && !isSettled) setIsHistory(false);\n\n return (\n <div\n role=\"article\"\n aria-label={`${typeof name === 'string' ? name : avatar?.label || roleLabels[message.role]} message`}\n aria-busy={isStreaming || message.status === 'submitting'}\n className={cn(\n 'group/chat-message flex w-full min-w-0 text-primary',\n alignment === 'end' && 'justify-end',\n className\n )}\n {...props}\n >\n <div\n className={cn(\n 'flex min-w-0 max-w-full flex-col gap-space-2',\n alignment === 'end' ? 'w-fit max-w-[85%] items-end' : 'w-full',\n contentClassName\n )}\n >\n {children ?? (\n <>\n <ChatMessageHeader\n avatar={avatar}\n name={name}\n status={message.status}\n />\n <ChatMessageBody\n blocks={message.content}\n animateParagraphs={animateParagraphs && !isHistory}\n className={alignment === 'end' ? 'items-end' : undefined}\n />\n </>\n )}\n {footer != null && (\n <div\n // Reserve the footer's space while streaming so it doesn't pop in.\n inert={isStreaming}\n className={cn(\n 'flex min-w-0 max-w-full flex-wrap items-center gap-space-2 [overflow-wrap:anywhere]',\n isStreaming && 'invisible',\n // Earlier messages hide their footer until hovered or focused,\n // except on touch screens, which have no hover to reveal it.\n // Keyboard focus reveals it without a fade.\n !isLatest &&\n 'transition-opacity duration-fast focus-within:transition-none motion-reduce:transition-none pointer-fine:opacity-0 pointer-fine:focus-within:opacity-100 pointer-fine:group-hover/chat-message:opacity-100 pointer-fine:has-[[data-state=open]]:opacity-100'\n )}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface ChatMessageHeaderProps extends ComponentPropsWithRef<'div'> {\n avatar?: Omit<AvatarProps, 'size'>;\n name?: ReactNode;\n status?: ChatMessageStatus;\n}\n\n/**\n * Avatar, name, and status line. Renders nothing without any of them or\n * children, unless it has shown a streaming status.\n */\nexport function ChatMessageHeader({\n avatar,\n name,\n status = 'completed',\n children,\n className,\n ...props\n}: ChatMessageHeaderProps) {\n const [hasStreamed, setHasStreamed] = useState(status === 'streaming');\n if (status === 'streaming' && !hasStreamed) setHasStreamed(true);\n\n const statusLabel = statusLabels[status];\n const isEmpty =\n avatar == null && name == null && !statusLabel && children == null;\n\n if (isEmpty && !hasStreamed) return null;\n\n return (\n <div\n className={cn(\n 'flex min-w-0 max-w-full flex-wrap items-center gap-space-2 [overflow-wrap:anywhere]',\n // Keep the line the streaming status used so the text below doesn't\n // jump up when it ends.\n isEmpty && 'min-h-lh text-xxs leading-snug',\n className\n )}\n {...props}\n >\n {avatar && (\n // The name and the message label already identify the speaker; this\n // keeps the avatar's initial from being read out before the name.\n <span aria-hidden=\"true\" className=\"inline-flex shrink-0\">\n <Avatar size=\"xs\" {...avatar} />\n </span>\n )}\n {name != null && (\n <Text as=\"span\" variant=\"xs\" weight=\"medium\" className=\"leading-snug\">\n {name}\n </Text>\n )}\n {status === 'streaming' ? (\n <ThinkingState size=\"xs\" label={statusLabel} motion=\"subtle\" />\n ) : statusLabel ? (\n <Text\n as=\"span\"\n variant=\"xs\"\n color={status === 'failed' ? 'error' : 'secondary'}\n className=\"flex items-center gap-space-2 leading-snug\"\n >\n {status === 'failed' && (\n <Icon\n icon={WarningCircleIcon}\n size=\"sm\"\n weight=\"fill\"\n className=\"text-icon-error\"\n aria-hidden=\"true\"\n />\n )}\n {statusLabel}\n </Text>\n ) : null}\n {children}\n </div>\n );\n}\n\nexport interface ChatMessageBodyProps extends Omit<\n ComponentPropsWithRef<'div'>,\n 'children'\n> {\n blocks: readonly ChatMessageContentBlock[];\n /** Supply one complete paragraph per text block; existing blocks do not replay. */\n animateParagraphs?: boolean;\n}\n\n/** Content blocks in order. Text blocks render as escaped plain text. */\nexport function ChatMessageBody({\n blocks,\n animateParagraphs = false,\n className,\n ...props\n}: ChatMessageBodyProps) {\n if (blocks.length === 0) return null;\n\n return (\n <div\n className={cn(\n 'flex w-full min-w-0 max-w-full flex-col gap-space-3 [overflow-wrap:anywhere]',\n // Keep wide host content from stretching the message.\n '[&_img]:max-w-full [&_pre]:max-w-full [&_pre]:overflow-x-auto [&_table]:block [&_table]:max-w-full [&_table]:overflow-x-auto',\n className\n )}\n {...props}\n >\n {blocks.map((block) => {\n const content =\n block.type === 'text' ? (\n <Text\n as=\"p\"\n variant=\"sm\"\n weight=\"normal\"\n className={cn(\n 'min-w-0 whitespace-pre-wrap leading-normal tracking-normal text-inherit',\n animateParagraphs &&\n 'animate-in fade-in duration-normal ease-out motion-reduce:animate-none'\n )}\n >\n {block.text}\n </Text>\n ) : (\n block.content\n );\n\n return block.appearance === 'bubble' ? (\n <div\n key={block.id}\n className=\"w-fit min-w-0 max-w-full rounded-xl bg-surface-level-2 px-space-3 py-space-2\"\n >\n {content}\n </div>\n ) : (\n <Fragment key={block.id}>{content}</Fragment>\n );\n })}\n </div>\n );\n}\n\nconst actionDefinitions: {\n name: keyof ChatMessageActionCapabilities;\n label: string;\n icon: IconComponent;\n}[] = [\n { name: 'copy', label: 'Copy message', icon: CopySimpleIcon },\n { name: 'edit', label: 'Edit message', icon: PencilSimpleIcon },\n { name: 'retry', label: 'Retry message', icon: ArrowClockwiseIcon },\n];\n\nfunction canChangeMessage(status: ChatMessageStatus, readOnly: boolean) {\n return (\n !readOnly &&\n status !== 'queued' &&\n status !== 'submitting' &&\n status !== 'streaming'\n );\n}\n\nexport interface ChatMessageActionsProps extends ComponentPropsWithRef<'div'> {\n actions?: ChatMessageActionCapabilities;\n status?: ChatMessageStatus;\n readOnly?: boolean;\n}\n\n/**\n * Copy, edit, and retry buttons, plus any host actions in `children`. Edit\n * and retry are hidden while the message is pending or read-only; copy stays\n * available. Renders nothing when no actions remain.\n */\nexport function ChatMessageActions({\n actions,\n status = 'completed',\n readOnly = false,\n children,\n className,\n ...props\n}: ChatMessageActionsProps) {\n const canChange = canChangeMessage(status, readOnly);\n const visibleActions = actionDefinitions.flatMap((definition) => {\n const action = actions?.[definition.name];\n return action && (definition.name === 'copy' || canChange)\n ? [{ ...definition, action }]\n : [];\n });\n if (visibleActions.length === 0 && children == null) return null;\n\n return (\n <div\n role=\"group\"\n aria-label=\"Message actions\"\n className={cn(\n 'flex min-w-0 max-w-full flex-wrap items-center gap-space-1',\n className\n )}\n {...props}\n >\n {visibleActions.map(({ name, label, icon, action }) => (\n <IconButton\n key={name}\n icon={icon}\n iconWeight=\"regular\"\n label={action.label ?? label}\n color=\"secondary\"\n variant=\"plain\"\n size=\"xs\"\n onClick={action.onClick}\n />\n ))}\n {children}\n </div>\n );\n}\n\nexport interface ChatTurnDividerProps extends Omit<\n ComponentPropsWithRef<'div'>,\n 'children'\n> {\n label: string;\n}\n\nexport function ChatTurnDivider({\n label,\n className,\n ...props\n}: ChatTurnDividerProps) {\n return (\n <div\n role=\"separator\"\n aria-label={label}\n aria-orientation=\"horizontal\"\n className={cn(\n 'flex w-full min-w-0 items-center gap-space-3 py-space-3',\n className\n )}\n {...props}\n >\n <Divider className=\"min-w-space-4 flex-1\" />\n <Text\n variant=\"xs\"\n color=\"tertiary\"\n className=\"min-w-0 text-center [overflow-wrap:anywhere]\"\n >\n {label}\n </Text>\n <Divider className=\"min-w-space-4 flex-1\" />\n </div>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ChatMessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
3
|
+
export type ChatMessageStatus = 'idle' | 'queued' | 'submitting' | 'streaming' | 'interrupted' | 'failed' | 'stopped' | 'completed';
|
|
4
|
+
export type ChatMessageContentBlock = {
|
|
5
|
+
/** Stable within a message, including while its content streams. */
|
|
6
|
+
id: string;
|
|
7
|
+
appearance?: 'plain' | 'bubble';
|
|
8
|
+
} & ({
|
|
9
|
+
type: 'text';
|
|
10
|
+
text: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'custom';
|
|
13
|
+
/** Host-rendered Markdown, attachments, tools, or rich content. */
|
|
14
|
+
content: ReactNode;
|
|
15
|
+
});
|
|
16
|
+
export interface ChatMessageAction {
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ChatMessageActionCapabilities {
|
|
21
|
+
copy?: ChatMessageAction;
|
|
22
|
+
edit?: ChatMessageAction;
|
|
23
|
+
retry?: ChatMessageAction;
|
|
24
|
+
}
|
|
25
|
+
/** Render-ready presentation data; product payloads and parsing stay in adapters. */
|
|
26
|
+
export interface ChatMessageModel {
|
|
27
|
+
id: string;
|
|
28
|
+
role: ChatMessageRole;
|
|
29
|
+
status: ChatMessageStatus;
|
|
30
|
+
readOnly?: boolean;
|
|
31
|
+
content: readonly ChatMessageContentBlock[];
|
|
32
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider, } from './ChatMessage.js';
|
|
2
|
+
export type { ChatMessageActionsProps, ChatMessageBodyProps, ChatMessageHeaderProps, ChatMessageProps, ChatTurnDividerProps, } from './ChatMessage.js';
|
|
3
|
+
export type { ChatMessageAction, ChatMessageActionCapabilities, ChatMessageContentBlock, ChatMessageModel, ChatMessageRole, ChatMessageStatus, } from './ChatMessage.types.js';
|
|
@@ -26,6 +26,8 @@ export { StatusBadge } from './StatusBadge/index.js';
|
|
|
26
26
|
export type { StatusBadgeProps, StatusBadgeSize, StatusBadgeVariant, } from './StatusBadge/index.js';
|
|
27
27
|
export { Banner } from './Banner/Banner.js';
|
|
28
28
|
export type { BannerProps } from './Banner/Banner.js';
|
|
29
|
+
export { ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider, } from './ChatMessage/index.js';
|
|
30
|
+
export type { ChatMessageAction, ChatMessageActionCapabilities, ChatMessageActionsProps, ChatMessageBodyProps, ChatMessageContentBlock, ChatMessageHeaderProps, ChatMessageModel, ChatMessageProps, ChatMessageRole, ChatMessageStatus, ChatTurnDividerProps, } from './ChatMessage/index.js';
|
|
29
31
|
export { Checkbox, getCheckedState } from './Checkbox/index.js';
|
|
30
32
|
export type { CheckboxProps } from './Checkbox/index.js';
|
|
31
33
|
export { ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow, } from './ChartTooltip/index.js';
|
package/dist/components/index.js
CHANGED
|
@@ -16,9 +16,10 @@ import { Link } from "./Link/Link.js";
|
|
|
16
16
|
import { EmptyState } from "./EmptyState/EmptyState.js";
|
|
17
17
|
import { CircleSkeleton, Skeleton, SkeletonRows } from "./Skeleton/Skeleton.js";
|
|
18
18
|
import { ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow } from "./ChartTooltip/ChartTooltip.js";
|
|
19
|
+
import { Divider } from "./Divider/Divider.js";
|
|
20
|
+
import { ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider } from "./ChatMessage/ChatMessage.js";
|
|
19
21
|
import { Checkbox } from "./Checkbox/Checkbox.js";
|
|
20
22
|
import { getCheckedState } from "./Checkbox/getCheckedState.js";
|
|
21
|
-
import { Divider } from "./Divider/Divider.js";
|
|
22
23
|
import { t as ErrorState } from "../_chunks/ErrorState-BY6VBCRB.js";
|
|
23
24
|
import { GroupedTabs } from "./GroupedTabs/GroupedTabs.js";
|
|
24
25
|
import { HeatmapBlock } from "./HeatmapChart/HeatmapBlock.js";
|
|
@@ -39,4 +40,4 @@ import { Slider } from "./Slider/Slider.js";
|
|
|
39
40
|
import { StatusBadge } from "./StatusBadge/StatusBadge.js";
|
|
40
41
|
import { Switch } from "./Switch/Switch.js";
|
|
41
42
|
import { Textarea } from "./Textarea/Textarea.js";
|
|
42
|
-
export { Attachment, AttachmentList, Avatar, Badge, Banner, Button, ButtonGroup, Card, ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow, Checkbox, CircleSkeleton, Divider, EmptyState, ErrorState, GroupedTabs, HeatmapBlock, HeatmapChart, Icon, IconButton, ImagePreviewBlock, ImagePreviewDialog, Input, Kbd, KbdGroup, LinearProgress, Link, MetricChart, ProgressBar, RadioButton, RadioCard, RadioGroup, RadioGroupItem, Skeleton, SkeletonRows, Slider, Spinner, SpinnerIcon, StatusBadge, Switch, Text, Textarea, Tooltip, TooltipProvider, formatMetricCurrency, formatMetricDate, formatMetricDuration, formatMetricNumber, formatMetricTime, getCheckedState };
|
|
43
|
+
export { Attachment, AttachmentList, Avatar, Badge, Banner, Button, ButtonGroup, Card, ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow, ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider, Checkbox, CircleSkeleton, Divider, EmptyState, ErrorState, GroupedTabs, HeatmapBlock, HeatmapChart, Icon, IconButton, ImagePreviewBlock, ImagePreviewDialog, Input, Kbd, KbdGroup, LinearProgress, Link, MetricChart, ProgressBar, RadioButton, RadioCard, RadioGroup, RadioGroupItem, Skeleton, SkeletonRows, Slider, Spinner, SpinnerIcon, StatusBadge, Switch, Text, Textarea, Tooltip, TooltipProvider, formatMetricCurrency, formatMetricDate, formatMetricDuration, formatMetricNumber, formatMetricTime, getCheckedState };
|
|
@@ -2,6 +2,7 @@ import { CaretDownIcon, CaretRightIcon, MinusIcon } from "./PaddedPhosphorIcons.
|
|
|
2
2
|
import { CaretUpDownIcon } from "@phosphor-icons/react/dist/ssr/CaretUpDown";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { InfoIcon } from "@phosphor-icons/react/dist/ssr/Info";
|
|
5
|
+
import { PushPinIcon } from "@phosphor-icons/react/dist/ssr/PushPin";
|
|
5
6
|
import { BinaryIcon } from "@phosphor-icons/react/dist/ssr/Binary";
|
|
6
7
|
import { BriefcaseIcon } from "@phosphor-icons/react/dist/ssr/Briefcase";
|
|
7
8
|
import { BuildingsIcon } from "@phosphor-icons/react/dist/ssr/Buildings";
|
|
@@ -25,7 +26,6 @@ import { LaptopIcon } from "@phosphor-icons/react/dist/ssr/Laptop";
|
|
|
25
26
|
import { ListBulletsIcon } from "@phosphor-icons/react/dist/ssr/ListBullets";
|
|
26
27
|
import { MoonIcon } from "@phosphor-icons/react/dist/ssr/Moon";
|
|
27
28
|
import { PackageIcon } from "@phosphor-icons/react/dist/ssr/Package";
|
|
28
|
-
import { PushPinIcon } from "@phosphor-icons/react/dist/ssr/PushPin";
|
|
29
29
|
import { RepeatIcon } from "@phosphor-icons/react/dist/ssr/Repeat";
|
|
30
30
|
import { ShieldIcon } from "@phosphor-icons/react/dist/ssr/Shield";
|
|
31
31
|
import { SignOutIcon } from "@phosphor-icons/react/dist/ssr/SignOut";
|
package/dist/index.js
CHANGED
|
@@ -16,9 +16,10 @@ import { Link } from "./components/Link/Link.js";
|
|
|
16
16
|
import { EmptyState } from "./components/EmptyState/EmptyState.js";
|
|
17
17
|
import { CircleSkeleton, Skeleton, SkeletonRows } from "./components/Skeleton/Skeleton.js";
|
|
18
18
|
import { ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow } from "./components/ChartTooltip/ChartTooltip.js";
|
|
19
|
+
import { Divider } from "./components/Divider/Divider.js";
|
|
20
|
+
import { ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider } from "./components/ChatMessage/ChatMessage.js";
|
|
19
21
|
import { Checkbox } from "./components/Checkbox/Checkbox.js";
|
|
20
22
|
import { getCheckedState } from "./components/Checkbox/getCheckedState.js";
|
|
21
|
-
import { Divider } from "./components/Divider/Divider.js";
|
|
22
23
|
import { t as ErrorState } from "./_chunks/ErrorState-BY6VBCRB.js";
|
|
23
24
|
import { GroupedTabs } from "./components/GroupedTabs/GroupedTabs.js";
|
|
24
25
|
import { HeatmapBlock } from "./components/HeatmapChart/HeatmapBlock.js";
|
|
@@ -40,4 +41,4 @@ import { StatusBadge } from "./components/StatusBadge/StatusBadge.js";
|
|
|
40
41
|
import { Switch } from "./components/Switch/Switch.js";
|
|
41
42
|
import { Textarea } from "./components/Textarea/Textarea.js";
|
|
42
43
|
import "./components/index.js";
|
|
43
|
-
export { Attachment, AttachmentList, Avatar, Badge, Banner, Button, ButtonGroup, Card, ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow, Checkbox, CircleSkeleton, Divider, EmptyState, ErrorState, GroupedTabs, HeatmapBlock, HeatmapChart, Icon, IconButton, ImagePreviewBlock, ImagePreviewDialog, Input, Kbd, KbdGroup, LinearProgress, Link, MetricChart, ProgressBar, RadioButton, RadioCard, RadioGroup, RadioGroupItem, Skeleton, SkeletonRows, Slider, Spinner, SpinnerIcon, StatusBadge, Switch, Text, Textarea, Tooltip, TooltipProvider, formatMetricCurrency, formatMetricDate, formatMetricDuration, formatMetricNumber, formatMetricTime, getCheckedState };
|
|
44
|
+
export { Attachment, AttachmentList, Avatar, Badge, Banner, Button, ButtonGroup, Card, ChartTooltip, ChartTooltipBody, ChartTooltipHeader, ChartTooltipRow, ChatMessage, ChatMessageActions, ChatMessageBody, ChatMessageHeader, ChatTurnDivider, Checkbox, CircleSkeleton, Divider, EmptyState, ErrorState, GroupedTabs, HeatmapBlock, HeatmapChart, Icon, IconButton, ImagePreviewBlock, ImagePreviewDialog, Input, Kbd, KbdGroup, LinearProgress, Link, MetricChart, ProgressBar, RadioButton, RadioCard, RadioGroup, RadioGroupItem, Skeleton, SkeletonRows, Slider, Spinner, SpinnerIcon, StatusBadge, Switch, Text, Textarea, Tooltip, TooltipProvider, formatMetricCurrency, formatMetricDate, formatMetricDuration, formatMetricNumber, formatMetricTime, getCheckedState };
|