@patternfly/chatbot 6.7.0-prerelease.3 → 6.7.0-prerelease.5
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/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +2 -2
- package/dist/cjs/Message/Message.d.ts +4 -2
- package/dist/cjs/Message/Message.js +19 -2
- package/dist/cjs/Message/Message.test.js +13 -1
- package/dist/cjs/MessageDivider/MessageDivider.js +1 -1
- package/dist/css/main.css +61 -78
- package/dist/css/main.css.map +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +2 -2
- package/dist/esm/Message/Message.d.ts +4 -2
- package/dist/esm/Message/Message.js +19 -2
- package/dist/esm/Message/Message.test.js +13 -1
- package/dist/esm/MessageDivider/MessageDivider.js +1 -1
- package/package.json +8 -8
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +3 -13
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithClickedResponseActions.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomStructure.tsx +1 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDeepThinking.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDividers.tsx +1 -8
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +0 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithIconSwapping.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownDeepThinking.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownToolCall.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownToolResponse.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMultipleActionGroups.tsx +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithPersistedActions.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +0 -8
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +0 -10
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolCall.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolResponse.tsx +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +6 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +1 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotDisplayMode.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotScrolling.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotTranscripts.tsx +0 -7
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +0 -4
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +0 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/WhiteEmbeddedChatbot.tsx +0 -4
- package/src/Chatbot/Chatbot.scss +42 -26
- package/src/ChatbotContent/ChatbotContent.scss +10 -5
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +14 -0
- package/src/ChatbotFooter/ChatbotFooter.scss +12 -10
- package/src/ChatbotHeader/ChatbotHeader.scss +7 -53
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +2 -2
- package/src/ChatbotModal/ChatbotModal.scss +0 -9
- package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +1 -1
- package/src/FileDetailsLabel/FileDetailsLabel.scss +5 -0
- package/src/Message/Message.scss +5 -0
- package/src/Message/Message.test.tsx +13 -1
- package/src/Message/Message.tsx +37 -11
- package/src/MessageBar/MessageBar.scss +4 -24
- package/src/MessageDivider/MessageDivider.scss +7 -9
- package/src/MessageDivider/MessageDivider.tsx +1 -1
package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolCall.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent, useState } from 'react';
|
|
2
2
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
|
3
|
-
import patternflyAvatar from './patternfly_avatar.jpg';
|
|
4
3
|
import { Checkbox, Flex, FlexItem } from '@patternfly/react-core';
|
|
5
4
|
|
|
6
5
|
export const MessageWithToolCallExample: FunctionComponent = () => {
|
|
@@ -19,7 +18,6 @@ export const MessageWithToolCallExample: FunctionComponent = () => {
|
|
|
19
18
|
<Message
|
|
20
19
|
name="Bot"
|
|
21
20
|
role="bot"
|
|
22
|
-
avatar={patternflyAvatar}
|
|
23
21
|
content="This example has a static tool call title:"
|
|
24
22
|
toolCall={{
|
|
25
23
|
titleText: "Calling 'awesome_tool'",
|
|
@@ -30,7 +28,6 @@ export const MessageWithToolCallExample: FunctionComponent = () => {
|
|
|
30
28
|
<Message
|
|
31
29
|
name="Bot"
|
|
32
30
|
role="bot"
|
|
33
|
-
avatar={patternflyAvatar}
|
|
34
31
|
content="This example has an expandable tool call title, with an additional description:"
|
|
35
32
|
toolCall={{
|
|
36
33
|
titleText: "Calling 'awesome_tool_expansion'",
|
|
@@ -42,7 +39,6 @@ export const MessageWithToolCallExample: FunctionComponent = () => {
|
|
|
42
39
|
<Message
|
|
43
40
|
name="Bot"
|
|
44
41
|
role="bot"
|
|
45
|
-
avatar={patternflyAvatar}
|
|
46
42
|
content="This example has an expandable tool call that is expanded by default:"
|
|
47
43
|
toolCall={{
|
|
48
44
|
isDefaultExpanded: true,
|
package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolResponse.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useState, FunctionComponent, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
2
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
|
3
|
-
import patternflyAvatar from './patternfly_avatar.jpg';
|
|
4
3
|
import { CopyIcon, WrenchIcon } from '@patternfly/react-icons';
|
|
5
4
|
import {
|
|
6
5
|
Button,
|
|
@@ -27,7 +26,6 @@ export const MessageWithToolResponseExample: FunctionComponent = () => {
|
|
|
27
26
|
<Message
|
|
28
27
|
name="Bot"
|
|
29
28
|
role="bot"
|
|
30
|
-
avatar={patternflyAvatar}
|
|
31
29
|
content="This message has a body description that's within the recommended limit of 2 lines:"
|
|
32
30
|
toolResponse={{
|
|
33
31
|
toggleContent: 'Tool response: toolName',
|
|
@@ -138,7 +136,6 @@ export const MessageWithToolResponseExample: FunctionComponent = () => {
|
|
|
138
136
|
<Message
|
|
139
137
|
name="Bot"
|
|
140
138
|
role="bot"
|
|
141
|
-
avatar={patternflyAvatar}
|
|
142
139
|
content="This message has a tool response that is collapsed by default:"
|
|
143
140
|
toolResponse={{
|
|
144
141
|
isDefaultExpanded: false,
|
|
@@ -333,6 +333,12 @@ _Italic text, formatted with single underscores_
|
|
|
333
333
|
avatar={userAvatar}
|
|
334
334
|
avatarProps={{ isBordered: true }}
|
|
335
335
|
/>
|
|
336
|
+
<Message
|
|
337
|
+
name="User"
|
|
338
|
+
role="user"
|
|
339
|
+
content="This is a user message with `avatarProps` set to set an avatar with initials and a blue color."
|
|
340
|
+
avatarProps={{ initials: 'A', color: 'blue' }}
|
|
341
|
+
/>
|
|
336
342
|
<Message name="User" role="user" content="This is a user message with no avatar" />
|
|
337
343
|
<Message
|
|
338
344
|
name="User"
|
package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fragment, FunctionComponent, useState, useEffect } from 'react';
|
|
2
2
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
|
3
3
|
import userAvatar from './user_avatar.svg';
|
|
4
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
5
4
|
import {
|
|
6
5
|
Accordion,
|
|
7
6
|
AccordionContent,
|
|
@@ -637,7 +636,6 @@ export const UserMessageWithExtraContent: FunctionComponent = () => (
|
|
|
637
636
|
}}
|
|
638
637
|
/>
|
|
639
638
|
<Message
|
|
640
|
-
avatar={patternflyAvatar}
|
|
641
639
|
name="Bot"
|
|
642
640
|
role="bot"
|
|
643
641
|
content="This is a message with a live progress summmary card."
|
|
@@ -647,7 +645,6 @@ export const UserMessageWithExtraContent: FunctionComponent = () => (
|
|
|
647
645
|
}}
|
|
648
646
|
/>
|
|
649
647
|
<Message
|
|
650
|
-
avatar={patternflyAvatar}
|
|
651
648
|
name="Bot"
|
|
652
649
|
role="bot"
|
|
653
650
|
content="This is a message with a version selector card."
|
|
@@ -657,7 +654,6 @@ export const UserMessageWithExtraContent: FunctionComponent = () => (
|
|
|
657
654
|
}}
|
|
658
655
|
/>
|
|
659
656
|
<Message
|
|
660
|
-
avatar={patternflyAvatar}
|
|
661
657
|
name="Bot"
|
|
662
658
|
role="bot"
|
|
663
659
|
content="All set! I've finished building the Discovery ISO. The next step is to download it and boot your hosts, which you can do using the summary card I've prepared for you:"
|
package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx
CHANGED
|
@@ -8,7 +8,6 @@ import MessageBar from '@patternfly/chatbot/dist/dynamic/MessageBar';
|
|
|
8
8
|
import MessageBox from '@patternfly/chatbot/dist/dynamic/MessageBox';
|
|
9
9
|
import Message, { MessageProps } from '@patternfly/chatbot/dist/dynamic/Message';
|
|
10
10
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
11
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
12
11
|
import { FormGroup, Radio } from '@patternfly/react-core';
|
|
13
12
|
|
|
14
13
|
export const ChatbotWelcomeInteractionDemo: FunctionComponent = () => {
|
|
@@ -50,7 +49,6 @@ export const ChatbotWelcomeInteractionDemo: FunctionComponent = () => {
|
|
|
50
49
|
content: 'API response goes here',
|
|
51
50
|
name: 'Bot',
|
|
52
51
|
isLoading: true,
|
|
53
|
-
avatar: patternflyAvatar,
|
|
54
52
|
timestamp: date.toLocaleString()
|
|
55
53
|
});
|
|
56
54
|
setMessages(newMessages);
|
|
@@ -70,7 +68,6 @@ export const ChatbotWelcomeInteractionDemo: FunctionComponent = () => {
|
|
|
70
68
|
content: 'API response goes here',
|
|
71
69
|
name: 'Bot',
|
|
72
70
|
isLoading: false,
|
|
73
|
-
avatar: patternflyAvatar,
|
|
74
71
|
timestamp: date.toLocaleString(),
|
|
75
72
|
actions: {
|
|
76
73
|
// eslint-disable-next-line no-console
|
|
@@ -30,7 +30,6 @@ import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
|
30
30
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
31
31
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
32
32
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
33
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
34
33
|
import { getTrackingProviders } from '@patternfly/chatbot/dist/dynamic/tracking';
|
|
35
34
|
import { InitProps } from '@patternfly/chatbot/dist/dynamic/tracking';
|
|
36
35
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
@@ -108,7 +107,6 @@ const initialMessages: MessageProps[] = [
|
|
|
108
107
|
role: 'bot',
|
|
109
108
|
content: markdown,
|
|
110
109
|
name: 'Bot',
|
|
111
|
-
avatar: patternflyAvatar,
|
|
112
110
|
timestamp: date.toLocaleString(),
|
|
113
111
|
actions: {
|
|
114
112
|
positive: { onClick: () => tracking.trackSingleItem(actionEventName, { response: 'Good response' }) },
|
|
@@ -225,7 +223,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
225
223
|
content: 'API response goes here',
|
|
226
224
|
name: 'Bot',
|
|
227
225
|
isLoading: true,
|
|
228
|
-
avatar: patternflyAvatar,
|
|
229
226
|
timestamp: date.toLocaleString()
|
|
230
227
|
});
|
|
231
228
|
setMessages(newMessages);
|
|
@@ -245,7 +242,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
245
242
|
content: 'API response goes here',
|
|
246
243
|
name: 'Bot',
|
|
247
244
|
isLoading: false,
|
|
248
|
-
avatar: patternflyAvatar,
|
|
249
245
|
timestamp: date.toLocaleString(),
|
|
250
246
|
actions: {
|
|
251
247
|
positive: { onClick: () => tracking.trackSingleItem(actionEvent2, { response: 'Good response' }) },
|
|
@@ -28,7 +28,6 @@ import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
|
28
28
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
29
29
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
30
30
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
31
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
32
31
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
33
32
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
34
33
|
|
|
@@ -70,7 +69,6 @@ export const BasicDemo: FunctionComponent = () => {
|
|
|
70
69
|
{
|
|
71
70
|
role: 'bot',
|
|
72
71
|
content: 'Great, I can reference this attachment throughout our conversation.',
|
|
73
|
-
avatar: patternflyAvatar,
|
|
74
72
|
name: 'Bot'
|
|
75
73
|
}
|
|
76
74
|
];
|
|
@@ -14,7 +14,6 @@ import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel'
|
|
|
14
14
|
import { BellIcon, CalendarAltIcon, ClipboardIcon, CodeIcon, UploadIcon } from '@patternfly/react-icons';
|
|
15
15
|
import { useDropzone } from 'react-dropzone';
|
|
16
16
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
17
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
18
17
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
19
18
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
20
19
|
import { cloneElement, FunctionComponent, isValidElement, ReactNode, useState, Children } from 'react';
|
|
@@ -79,8 +78,7 @@ const messages: MessageProps[] = [
|
|
|
79
78
|
{
|
|
80
79
|
role: 'bot',
|
|
81
80
|
content: 'I sure can!',
|
|
82
|
-
name: 'Bot'
|
|
83
|
-
avatar: patternflyAvatar
|
|
81
|
+
name: 'Bot'
|
|
84
82
|
}
|
|
85
83
|
];
|
|
86
84
|
|
|
@@ -30,7 +30,6 @@ import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
|
30
30
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
31
31
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
32
32
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
33
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
34
33
|
|
|
35
34
|
const footnoteProps = {
|
|
36
35
|
label: 'Always review AI-generated content prior to use.'
|
|
@@ -89,7 +88,6 @@ const initialMessages: MessageProps[] = [
|
|
|
89
88
|
role: 'bot',
|
|
90
89
|
content: markdown,
|
|
91
90
|
name: 'Bot',
|
|
92
|
-
avatar: patternflyAvatar,
|
|
93
91
|
timestamp: date.toLocaleString(),
|
|
94
92
|
actions: {
|
|
95
93
|
// eslint-disable-next-line no-console
|
|
@@ -208,7 +206,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
208
206
|
content: 'API response goes here',
|
|
209
207
|
name: 'Bot',
|
|
210
208
|
isLoading: true,
|
|
211
|
-
avatar: patternflyAvatar,
|
|
212
209
|
timestamp: date.toLocaleString()
|
|
213
210
|
});
|
|
214
211
|
setMessages(newMessages);
|
|
@@ -228,7 +225,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
228
225
|
content: 'API response goes here',
|
|
229
226
|
name: 'Bot',
|
|
230
227
|
isLoading: false,
|
|
231
|
-
avatar: patternflyAvatar,
|
|
232
228
|
timestamp: date.toLocaleString(),
|
|
233
229
|
actions: {
|
|
234
230
|
// eslint-disable-next-line no-console
|
|
@@ -48,7 +48,6 @@ import ExpandIcon from '@patternfly/react-icons/dist/esm/icons/expand-icon';
|
|
|
48
48
|
import OpenDrawerRightIcon from '@patternfly/react-icons/dist/esm/icons/open-drawer-right-icon';
|
|
49
49
|
import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon';
|
|
50
50
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
51
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
52
51
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
53
52
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
54
53
|
|
|
@@ -75,7 +74,6 @@ const initialMessages: MessageProps[] = [
|
|
|
75
74
|
role: 'bot',
|
|
76
75
|
content: markdown,
|
|
77
76
|
name: 'Bot',
|
|
78
|
-
avatar: patternflyAvatar,
|
|
79
77
|
timestamp: date.toLocaleString(),
|
|
80
78
|
actions: {
|
|
81
79
|
// eslint-disable-next-line no-console
|
|
@@ -198,7 +196,6 @@ export const ChatbotDisplayModeDemo: FunctionComponent = () => {
|
|
|
198
196
|
role: 'bot',
|
|
199
197
|
content: 'API response goes here',
|
|
200
198
|
name: 'Bot',
|
|
201
|
-
avatar: patternflyAvatar,
|
|
202
199
|
isLoading: true,
|
|
203
200
|
timestamp: date.toLocaleString()
|
|
204
201
|
});
|
|
@@ -213,7 +210,6 @@ export const ChatbotDisplayModeDemo: FunctionComponent = () => {
|
|
|
213
210
|
role: 'bot',
|
|
214
211
|
content: 'API response goes here',
|
|
215
212
|
name: 'Bot',
|
|
216
|
-
avatar: patternflyAvatar,
|
|
217
213
|
isLoading: false,
|
|
218
214
|
actions: {
|
|
219
215
|
// eslint-disable-next-line no-console
|
|
@@ -41,7 +41,6 @@ import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
|
41
41
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
42
42
|
import { BarsIcon } from '@patternfly/react-icons';
|
|
43
43
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
44
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
45
44
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
46
45
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
47
46
|
|
|
@@ -102,7 +101,6 @@ const initialMessages: MessageProps[] = [
|
|
|
102
101
|
role: 'bot',
|
|
103
102
|
content: markdown,
|
|
104
103
|
name: 'Bot',
|
|
105
|
-
avatar: patternflyAvatar,
|
|
106
104
|
timestamp: date.toLocaleString(),
|
|
107
105
|
actions: {
|
|
108
106
|
// eslint-disable-next-line no-console
|
|
@@ -218,7 +216,6 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
218
216
|
role: 'bot',
|
|
219
217
|
content: 'API response goes here',
|
|
220
218
|
name: 'Bot',
|
|
221
|
-
avatar: patternflyAvatar,
|
|
222
219
|
isLoading: true,
|
|
223
220
|
timestamp: date.toLocaleString()
|
|
224
221
|
});
|
|
@@ -238,7 +235,6 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
238
235
|
role: 'bot',
|
|
239
236
|
content: 'API response goes here',
|
|
240
237
|
name: 'Bot',
|
|
241
|
-
avatar: patternflyAvatar,
|
|
242
238
|
isLoading: false,
|
|
243
239
|
actions: {
|
|
244
240
|
// eslint-disable-next-line no-console
|
|
@@ -31,7 +31,6 @@ import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
|
31
31
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
32
32
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
33
33
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
34
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
35
34
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
36
35
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
37
36
|
|
|
@@ -94,7 +93,6 @@ const initialMessages: MessageProps[] = [
|
|
|
94
93
|
role: 'bot',
|
|
95
94
|
content: markdown,
|
|
96
95
|
name: 'Bot',
|
|
97
|
-
avatar: patternflyAvatar,
|
|
98
96
|
timestamp: date.toLocaleString(),
|
|
99
97
|
actions: {
|
|
100
98
|
// eslint-disable-next-line no-console
|
|
@@ -233,7 +231,6 @@ export const ChatbotScrollingDemo: React.FunctionComponent = () => {
|
|
|
233
231
|
content: 'API response goes here',
|
|
234
232
|
name: 'Bot',
|
|
235
233
|
isLoading: true,
|
|
236
|
-
avatar: patternflyAvatar,
|
|
237
234
|
timestamp: date.toLocaleString()
|
|
238
235
|
});
|
|
239
236
|
setMessages(newMessages);
|
|
@@ -255,7 +252,6 @@ export const ChatbotScrollingDemo: React.FunctionComponent = () => {
|
|
|
255
252
|
content: 'API response goes here.',
|
|
256
253
|
name: 'Bot',
|
|
257
254
|
isLoading: false,
|
|
258
|
-
avatar: patternflyAvatar,
|
|
259
255
|
timestamp: date.toLocaleString(),
|
|
260
256
|
actions: {
|
|
261
257
|
// eslint-disable-next-line no-console
|
|
@@ -30,7 +30,6 @@ import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
|
30
30
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
31
31
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
32
32
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
33
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
34
33
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
35
34
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
36
35
|
import saveAs from 'file-saver';
|
|
@@ -182,7 +181,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
182
181
|
role: 'bot',
|
|
183
182
|
content: markdown,
|
|
184
183
|
name: 'Bot',
|
|
185
|
-
avatar: patternflyAvatar,
|
|
186
184
|
timestamp: date.toLocaleString(),
|
|
187
185
|
actions: {
|
|
188
186
|
download: {
|
|
@@ -193,7 +191,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
193
191
|
role: 'bot',
|
|
194
192
|
content: markdown,
|
|
195
193
|
name: 'Bot',
|
|
196
|
-
avatar: patternflyAvatar,
|
|
197
194
|
timestamp: date.toLocaleString()
|
|
198
195
|
},
|
|
199
196
|
selectedModel
|
|
@@ -292,7 +289,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
292
289
|
content: 'API response goes here',
|
|
293
290
|
name: 'Bot',
|
|
294
291
|
isLoading: true,
|
|
295
|
-
avatar: patternflyAvatar,
|
|
296
292
|
timestamp: date.toLocaleString()
|
|
297
293
|
});
|
|
298
294
|
setMessages(newMessages);
|
|
@@ -308,7 +304,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
308
304
|
loadedMessages.pop();
|
|
309
305
|
const id = generateId();
|
|
310
306
|
const timestamp = date.toLocaleString();
|
|
311
|
-
const avatar = patternflyAvatar;
|
|
312
307
|
const name = 'Bot';
|
|
313
308
|
const content = 'API response goes here';
|
|
314
309
|
const role = 'bot';
|
|
@@ -318,7 +313,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
318
313
|
content,
|
|
319
314
|
name,
|
|
320
315
|
isLoading: false,
|
|
321
|
-
avatar,
|
|
322
316
|
timestamp,
|
|
323
317
|
actions: {
|
|
324
318
|
download: {
|
|
@@ -329,7 +323,6 @@ export const ChatbotDemo: FunctionComponent = () => {
|
|
|
329
323
|
role,
|
|
330
324
|
content,
|
|
331
325
|
name,
|
|
332
|
-
avatar,
|
|
333
326
|
timestamp
|
|
334
327
|
},
|
|
335
328
|
selectedModel
|
|
@@ -39,7 +39,6 @@ import PFHorizontalLogoColor from '../UI/PF-HorizontalLogo-Color.svg';
|
|
|
39
39
|
import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
40
40
|
import { BarsIcon } from '@patternfly/react-icons';
|
|
41
41
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
42
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
43
42
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
44
43
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
45
44
|
|
|
@@ -100,7 +99,6 @@ const initialMessages: MessageProps[] = [
|
|
|
100
99
|
role: 'bot',
|
|
101
100
|
content: markdown,
|
|
102
101
|
name: 'Bot',
|
|
103
|
-
avatar: patternflyAvatar,
|
|
104
102
|
timestamp: date.toLocaleString(),
|
|
105
103
|
actions: {
|
|
106
104
|
// eslint-disable-next-line no-console
|
|
@@ -209,7 +207,6 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
209
207
|
role: 'bot',
|
|
210
208
|
content: 'API response goes here',
|
|
211
209
|
name: 'Bot',
|
|
212
|
-
avatar: patternflyAvatar,
|
|
213
210
|
isLoading: true,
|
|
214
211
|
timestamp: date.toLocaleString()
|
|
215
212
|
});
|
|
@@ -229,7 +226,6 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
229
226
|
role: 'bot',
|
|
230
227
|
content: 'API response goes here',
|
|
231
228
|
name: 'Bot',
|
|
232
|
-
avatar: patternflyAvatar,
|
|
233
229
|
isLoading: false,
|
|
234
230
|
actions: {
|
|
235
231
|
// eslint-disable-next-line no-console
|
package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx
CHANGED
|
@@ -22,7 +22,6 @@ import ChatbotHeader, { ChatbotHeaderMain } from '@patternfly/chatbot/dist/dynam
|
|
|
22
22
|
import Compare from '@patternfly/chatbot/dist/dynamic/Compare';
|
|
23
23
|
import { BarsIcon } from '@patternfly/react-icons';
|
|
24
24
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
25
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
26
25
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
27
26
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
28
27
|
|
|
@@ -53,7 +52,6 @@ export const CompareChild = ({ name, input, hasNewInput, setIsSendButtonDisabled
|
|
|
53
52
|
timestamp: `${date?.toLocaleDateString()} ${date?.toLocaleTimeString()}`
|
|
54
53
|
});
|
|
55
54
|
newMessages.push({
|
|
56
|
-
avatar: patternflyAvatar,
|
|
57
55
|
id: generateId(),
|
|
58
56
|
name,
|
|
59
57
|
role: 'bot',
|
|
@@ -76,7 +74,6 @@ export const CompareChild = ({ name, input, hasNewInput, setIsSendButtonDisabled
|
|
|
76
74
|
role: 'bot',
|
|
77
75
|
content: `API response from ${name} goes here`,
|
|
78
76
|
name,
|
|
79
|
-
avatar: patternflyAvatar,
|
|
80
77
|
isLoading: false,
|
|
81
78
|
actions: {
|
|
82
79
|
// eslint-disable-next-line no-console
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent, useState, useRef } from 'react';
|
|
2
2
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
|
3
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
4
3
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
5
4
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
6
5
|
|
|
@@ -37,7 +36,6 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
|
|
|
37
36
|
<Message
|
|
38
37
|
name="Bot"
|
|
39
38
|
role="bot"
|
|
40
|
-
avatar={patternflyAvatar}
|
|
41
39
|
content="Bot message with user feedback flow; click on a message action to launch the feedback flow. Click submit to see the thank-you message."
|
|
42
40
|
actions={{
|
|
43
41
|
positive: {
|
|
@@ -39,7 +39,6 @@ import PFHorizontalLogoColor from '../UI/PF-HorizontalLogo-Color.svg';
|
|
|
39
39
|
import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
40
40
|
import { BarsIcon } from '@patternfly/react-icons';
|
|
41
41
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
42
|
-
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
43
42
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
44
43
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
45
44
|
|
|
@@ -109,7 +108,6 @@ const initialMessages: MessageProps[] = [
|
|
|
109
108
|
role: 'bot',
|
|
110
109
|
content: markdown,
|
|
111
110
|
name: 'Bot',
|
|
112
|
-
avatar: patternflyAvatar,
|
|
113
111
|
timestamp: date.toLocaleString(),
|
|
114
112
|
actions: {
|
|
115
113
|
// eslint-disable-next-line no-console
|
|
@@ -221,7 +219,6 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
221
219
|
role: 'bot',
|
|
222
220
|
content: 'API response goes here',
|
|
223
221
|
name: 'Bot',
|
|
224
|
-
avatar: patternflyAvatar,
|
|
225
222
|
isLoading: true,
|
|
226
223
|
timestamp: date.toLocaleString(),
|
|
227
224
|
isPrimary: true
|
|
@@ -242,7 +239,6 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
242
239
|
role: 'bot',
|
|
243
240
|
content: 'API response goes here',
|
|
244
241
|
name: 'Bot',
|
|
245
|
-
avatar: patternflyAvatar,
|
|
246
242
|
isLoading: false,
|
|
247
243
|
actions: {
|
|
248
244
|
// eslint-disable-next-line no-console
|
package/src/Chatbot/Chatbot.scss
CHANGED
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
width: 30rem;
|
|
11
11
|
height: 70vh;
|
|
12
|
-
background-color: var(
|
|
13
|
-
--pf-t--global--background--color--floating--secondary--default,
|
|
14
|
-
--pf-t--global--background--color--secondary--default
|
|
15
|
-
);
|
|
12
|
+
background-color: var(--pf-t--global--background--color--floating--secondary--default);
|
|
16
13
|
border-radius: var(--pf-t--global--border--radius--medium);
|
|
17
14
|
box-shadow: var(--pf-t--global--box-shadow--lg);
|
|
18
15
|
font-size: var(--pf-t--global--font--size--md);
|
|
@@ -31,9 +28,8 @@
|
|
|
31
28
|
opacity: 1;
|
|
32
29
|
transform: translateY(0);
|
|
33
30
|
}
|
|
34
|
-
|
|
35
|
-
border: var(--pf-t--global--border--width--
|
|
36
|
-
var(--pf-t--global--border--color--high-contrast);
|
|
31
|
+
|
|
32
|
+
border: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--subtle);
|
|
37
33
|
|
|
38
34
|
// 32 rem is the width of the overlay chatbot plus the insets
|
|
39
35
|
// if the screen is smaller, we want to be 100%
|
|
@@ -46,24 +42,41 @@
|
|
|
46
42
|
@media screen and (max-height: 518px) {
|
|
47
43
|
overflow: auto;
|
|
48
44
|
}
|
|
45
|
+
|
|
46
|
+
&:not(&--default) {
|
|
47
|
+
background-color: var(
|
|
48
|
+
--pf-t--global--background--color--glass--primary--default,
|
|
49
|
+
var(--pf-t--global--background--color--secondary--default)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:root:where(.pf-v6-theme-felt):not(.pf-v6-theme-glass) {
|
|
55
|
+
.pf-chatbot.pf-chatbot--default {
|
|
56
|
+
box-shadow: var(--pf-t--global--box-shadow--md);
|
|
57
|
+
}
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
// ============================================================================
|
|
52
61
|
// Chatbot Display Mode - Docked
|
|
53
62
|
// ============================================================================
|
|
54
63
|
.pf-chatbot--docked {
|
|
55
|
-
// for high contrast support
|
|
56
64
|
border: unset;
|
|
57
|
-
border-left: var(--pf-t--global--border--width--
|
|
58
|
-
var(--pf-t--global--border--color--high-contrast);
|
|
65
|
+
border-left: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--subtle);
|
|
59
66
|
inset-block-end: 0;
|
|
60
67
|
inset-inline-end: 0;
|
|
61
68
|
padding: 0;
|
|
62
69
|
height: 100%;
|
|
63
70
|
border-radius: 0;
|
|
64
|
-
box-shadow: var(--pf-t--global--box-shadow--lg--left);
|
|
65
71
|
overflow: inherit;
|
|
66
72
|
|
|
73
|
+
@at-root :where(.pf-v6-theme-glass) & {
|
|
74
|
+
border-left: var(--pf-t--global--border--width--glass--default) solid
|
|
75
|
+
var(--pf-t--global--border--color--glass--default);
|
|
76
|
+
box-shadow: var(--pf-t--global--box-shadow--md--left);
|
|
77
|
+
backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
|
|
78
|
+
}
|
|
79
|
+
|
|
67
80
|
// 30rem is the width of the docked chatbot
|
|
68
81
|
// if the screen is smaller, we want to be 100%
|
|
69
82
|
@media screen and (max-width: 30rem) {
|
|
@@ -75,9 +88,6 @@
|
|
|
75
88
|
// Chatbot Display Mode - Fullscreen
|
|
76
89
|
// ============================================================================
|
|
77
90
|
.pf-chatbot--fullscreen {
|
|
78
|
-
background-color: var(--pf-t--global--background--color--secondary--default);
|
|
79
|
-
|
|
80
|
-
// for high contrast support
|
|
81
91
|
border: unset;
|
|
82
92
|
inset-block-end: 0;
|
|
83
93
|
inset-inline-end: 0;
|
|
@@ -86,21 +96,27 @@
|
|
|
86
96
|
height: 100%;
|
|
87
97
|
border-radius: 0;
|
|
88
98
|
box-shadow: none;
|
|
99
|
+
|
|
100
|
+
@at-root :where(.pf-v6-theme-glass) & {
|
|
101
|
+
backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
|
|
102
|
+
}
|
|
89
103
|
}
|
|
90
104
|
|
|
91
105
|
// ============================================================================
|
|
92
106
|
// Chatbot Display Mode - Embedded
|
|
93
107
|
// ============================================================================
|
|
94
108
|
.pf-chatbot--embedded {
|
|
95
|
-
background-color: var(--pf-t--global--background--color--secondary--default);
|
|
96
|
-
|
|
97
|
-
// for high contrast support
|
|
98
|
-
border: unset;
|
|
99
109
|
position: static;
|
|
100
110
|
width: 100%;
|
|
101
111
|
min-height: 100%;
|
|
102
112
|
border-radius: 0;
|
|
103
|
-
box-shadow:
|
|
113
|
+
box-shadow: var(--pf-t--global--box-shadow--lg);
|
|
114
|
+
|
|
115
|
+
@at-root :where(.pf-v6-theme-glass) & {
|
|
116
|
+
border: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
|
|
117
|
+
box-shadow: var(--pf-t--global--box-shadow--md);
|
|
118
|
+
backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
|
|
119
|
+
}
|
|
104
120
|
}
|
|
105
121
|
|
|
106
122
|
.pf-chatbot-container {
|
|
@@ -143,19 +159,19 @@
|
|
|
143
159
|
height: 100%;
|
|
144
160
|
border-radius: 0;
|
|
145
161
|
box-shadow: none;
|
|
146
|
-
border-color: var(--pf-t--global--border--color--
|
|
162
|
+
border-color: var(--pf-t--global--border--color--subtle);
|
|
147
163
|
|
|
148
|
-
.pf-
|
|
149
|
-
border
|
|
164
|
+
@at-root :where(.pf-v6-theme-glass) & {
|
|
165
|
+
border: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
|
|
166
|
+
box-shadow: var(--pf-t--global--box-shadow--md);
|
|
167
|
+
backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
|
|
150
168
|
}
|
|
151
169
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
border-left: var(--pf-t--global--border--width--divider--default) solid;
|
|
170
|
+
.pf-chatbot-container {
|
|
171
|
+
border-radius: var(--pf-t--global--border--radius--sharp);
|
|
155
172
|
}
|
|
156
173
|
}
|
|
157
174
|
|
|
158
|
-
// for high contrast support
|
|
159
175
|
:root:where(.pf-v6-theme-high-contrast) {
|
|
160
176
|
.pf-chatbot--drawer {
|
|
161
177
|
border: unset;
|
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
// ============================================================================
|
|
4
4
|
.pf-chatbot__content {
|
|
5
5
|
position: relative;
|
|
6
|
-
background-color: var(
|
|
7
|
-
--pf-t--global--background--color--floating--secondary--default,
|
|
8
|
-
--pf-t--global--background--color--secondary--default
|
|
9
|
-
);
|
|
6
|
+
background-color: var(--pf-t--global--background--color--floating--secondary--default);
|
|
10
7
|
overflow-y: auto;
|
|
11
8
|
overflow: hidden; // needed in Red Hat Developer Hub workspace
|
|
12
9
|
flex: 1; // needed in Composer AI
|
|
@@ -21,6 +18,15 @@
|
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
|
|
21
|
+
.pf-chatbot:not(.pf-chatbot--default) {
|
|
22
|
+
.pf-chatbot__content {
|
|
23
|
+
background-color: var(
|
|
24
|
+
--pf-t--global--background--color--glass--primary--default,
|
|
25
|
+
var(--pf-t--global--background--color--secondary--default)
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
24
30
|
// ============================================================================
|
|
25
31
|
// Chatbot Display Mode - Fullscreen and Embedded
|
|
26
32
|
// ============================================================================
|
|
@@ -29,7 +35,6 @@
|
|
|
29
35
|
.pf-chatbot--fullscreen,
|
|
30
36
|
.pf-chatbot--embedded {
|
|
31
37
|
.pf-chatbot__content {
|
|
32
|
-
background-color: var(--pf-t--global--background--color--secondary--default);
|
|
33
38
|
display: flex;
|
|
34
39
|
justify-content: center;
|
|
35
40
|
}
|