@patternfly/chatbot 6.4.0-prerelease.2 → 6.4.0-prerelease.20
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/Chatbot/Chatbot.js +1 -7
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +2 -0
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +22 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +15 -9
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +40 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.d.ts +18 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.js +25 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.test.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/ChatbotHeaderNewChatButton.test.js +22 -0
- package/dist/cjs/ChatbotHeader/index.d.ts +1 -0
- package/dist/cjs/ChatbotHeader/index.js +1 -0
- package/dist/cjs/DeepThinking/DeepThinking.d.ts +18 -0
- package/dist/cjs/DeepThinking/DeepThinking.js +18 -0
- package/dist/cjs/DeepThinking/DeepThinking.test.d.ts +1 -0
- package/dist/cjs/DeepThinking/DeepThinking.test.js +48 -0
- package/dist/cjs/DeepThinking/index.d.ts +2 -0
- package/dist/cjs/DeepThinking/index.js +23 -0
- package/dist/cjs/FilePreview/FilePreview.d.ts +26 -0
- package/dist/cjs/FilePreview/FilePreview.js +26 -0
- package/dist/cjs/FilePreview/FilePreview.test.d.ts +1 -0
- package/dist/cjs/FilePreview/FilePreview.test.js +97 -0
- package/dist/cjs/FilePreview/index.d.ts +2 -0
- package/dist/cjs/FilePreview/index.js +23 -0
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +3 -3
- package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +2 -1
- package/dist/cjs/Message/LinkMessage/LinkMessage.js +7 -3
- package/dist/cjs/Message/ListMessage/ListItemMessage.d.ts +1 -1
- package/dist/cjs/Message/ListMessage/ListItemMessage.js +16 -1
- package/dist/cjs/Message/Message.d.ts +15 -0
- package/dist/cjs/Message/Message.js +129 -32
- package/dist/cjs/Message/Message.test.js +71 -0
- package/dist/cjs/Message/SuperscriptMessage/SuperscriptMessage.d.ts +3 -0
- package/dist/cjs/Message/SuperscriptMessage/SuperscriptMessage.js +5 -0
- package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +15 -1
- package/dist/cjs/Message/UserFeedback/UserFeedback.js +4 -4
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +44 -0
- package/dist/cjs/MessageBar/MessageBar.js +19 -4
- package/dist/cjs/MessageBox/JumpButton.d.ts +5 -0
- package/dist/cjs/MessageBox/JumpButton.js +1 -1
- package/dist/cjs/MessageBox/JumpButton.test.js +4 -4
- package/dist/cjs/MessageBox/MessageBox.d.ts +9 -0
- package/dist/cjs/MessageBox/MessageBox.js +2 -2
- package/dist/cjs/MessageBox/MessageBox.test.js +2 -2
- package/dist/cjs/SourcesCard/SourcesCard.d.ts +13 -1
- package/dist/cjs/SourcesCard/SourcesCard.js +6 -6
- package/dist/cjs/SourcesCard/SourcesCard.test.js +49 -0
- package/dist/cjs/ToolResponse/ToolResponse.d.ts +30 -0
- package/dist/cjs/ToolResponse/ToolResponse.js +18 -0
- package/dist/cjs/ToolResponse/ToolResponse.test.d.ts +1 -0
- package/dist/cjs/ToolResponse/ToolResponse.test.js +60 -0
- package/dist/cjs/ToolResponse/index.d.ts +2 -0
- package/dist/cjs/ToolResponse/index.js +23 -0
- package/dist/cjs/index.d.ts +6 -0
- package/dist/cjs/index.js +10 -1
- package/dist/css/main.css +273 -17
- package/dist/css/main.css.map +1 -1
- package/dist/dynamic/DeepThinking/package.json +1 -0
- package/dist/dynamic/FilePreview/package.json +1 -0
- package/dist/dynamic/ToolResponse/package.json +1 -0
- package/dist/esm/Chatbot/Chatbot.js +1 -7
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +2 -0
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +22 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +17 -11
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +41 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.d.ts +18 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.js +22 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.test.d.ts +1 -0
- package/dist/esm/ChatbotHeader/ChatbotHeaderNewChatButton.test.js +20 -0
- package/dist/esm/ChatbotHeader/index.d.ts +1 -0
- package/dist/esm/ChatbotHeader/index.js +1 -0
- package/dist/esm/DeepThinking/DeepThinking.d.ts +18 -0
- package/dist/esm/DeepThinking/DeepThinking.js +14 -0
- package/dist/esm/DeepThinking/DeepThinking.test.d.ts +1 -0
- package/dist/esm/DeepThinking/DeepThinking.test.js +43 -0
- package/dist/esm/DeepThinking/index.d.ts +2 -0
- package/dist/esm/DeepThinking/index.js +2 -0
- package/dist/esm/FilePreview/FilePreview.d.ts +26 -0
- package/dist/esm/FilePreview/FilePreview.js +21 -0
- package/dist/esm/FilePreview/FilePreview.test.d.ts +1 -0
- package/dist/esm/FilePreview/FilePreview.test.js +92 -0
- package/dist/esm/FilePreview/index.d.ts +2 -0
- package/dist/esm/FilePreview/index.js +2 -0
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +5 -5
- package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +2 -1
- package/dist/esm/Message/LinkMessage/LinkMessage.js +7 -3
- package/dist/esm/Message/ListMessage/ListItemMessage.d.ts +1 -1
- package/dist/esm/Message/ListMessage/ListItemMessage.js +16 -1
- package/dist/esm/Message/Message.d.ts +15 -0
- package/dist/esm/Message/Message.js +129 -32
- package/dist/esm/Message/Message.test.js +71 -0
- package/dist/esm/Message/SuperscriptMessage/SuperscriptMessage.d.ts +3 -0
- package/dist/esm/Message/SuperscriptMessage/SuperscriptMessage.js +3 -0
- package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +15 -1
- package/dist/esm/Message/UserFeedback/UserFeedback.js +4 -4
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +45 -1
- package/dist/esm/MessageBar/MessageBar.js +19 -4
- package/dist/esm/MessageBox/JumpButton.d.ts +5 -0
- package/dist/esm/MessageBox/JumpButton.js +1 -1
- package/dist/esm/MessageBox/JumpButton.test.js +4 -4
- package/dist/esm/MessageBox/MessageBox.d.ts +9 -0
- package/dist/esm/MessageBox/MessageBox.js +2 -2
- package/dist/esm/MessageBox/MessageBox.test.js +2 -2
- package/dist/esm/SourcesCard/SourcesCard.d.ts +13 -1
- package/dist/esm/SourcesCard/SourcesCard.js +6 -6
- package/dist/esm/SourcesCard/SourcesCard.test.js +50 -1
- package/dist/esm/ToolResponse/ToolResponse.d.ts +30 -0
- package/dist/esm/ToolResponse/ToolResponse.js +14 -0
- package/dist/esm/ToolResponse/ToolResponse.test.d.ts +1 -0
- package/dist/esm/ToolResponse/ToolResponse.test.js +55 -0
- package/dist/esm/ToolResponse/index.d.ts +2 -0
- package/dist/esm/ToolResponse/index.js +2 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +101 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FilePreview.tsx +33 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDeepThinking.tsx +17 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +111 -85
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +70 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolResponse.tsx +135 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +28 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +107 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +616 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotConversationEditing.tsx +202 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +17 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +36 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithPin.tsx +12 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +22 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +1 -1
- package/patternfly-docs/patternfly-docs.config.js +1 -1
- package/src/Chatbot/Chatbot.scss +9 -2
- package/src/Chatbot/Chatbot.tsx +18 -31
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +5 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +28 -10
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +132 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +80 -33
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +1 -1
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderNewChatButton.test.tsx +25 -0
- package/src/ChatbotHeader/ChatbotHeaderNewChatButton.tsx +64 -0
- package/src/ChatbotHeader/index.ts +1 -0
- package/src/ChatbotModal/ChatbotModal.scss +1 -1
- package/src/DeepThinking/DeepThinking.scss +24 -0
- package/src/DeepThinking/DeepThinking.test.tsx +61 -0
- package/src/DeepThinking/DeepThinking.tsx +68 -0
- package/src/DeepThinking/index.ts +3 -0
- package/src/FileDetails/__snapshots__/FileDetails.test.tsx.snap +6 -9
- package/src/FileDetailsLabel/__snapshots__/FileDetailsLabel.test.tsx.snap +6 -9
- package/src/FilePreview/FilePreview.scss +22 -0
- package/src/FilePreview/FilePreview.test.tsx +112 -0
- package/src/FilePreview/FilePreview.tsx +58 -0
- package/src/FilePreview/index.ts +3 -0
- package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +2 -1
- package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +6 -5
- package/src/Message/LinkMessage/LinkMessage.tsx +6 -2
- package/src/Message/ListMessage/ListItemMessage.tsx +5 -1
- package/src/Message/ListMessage/ListMessage.scss +17 -0
- package/src/Message/Message.scss +44 -0
- package/src/Message/Message.test.tsx +90 -0
- package/src/Message/Message.tsx +171 -46
- package/src/Message/SuperscriptMessage/SuperscriptMessage.scss +8 -0
- package/src/Message/SuperscriptMessage/SuperscriptMessage.tsx +13 -0
- package/src/Message/TextMessage/TextMessage.scss +46 -5
- package/src/Message/UserFeedback/UserFeedback.test.tsx +107 -0
- package/src/Message/UserFeedback/UserFeedback.tsx +41 -6
- package/src/MessageBar/MessageBar.tsx +23 -3
- package/src/MessageBox/JumpButton.test.tsx +4 -4
- package/src/MessageBox/JumpButton.tsx +20 -4
- package/src/MessageBox/MessageBox.test.tsx +2 -2
- package/src/MessageBox/MessageBox.tsx +22 -1
- package/src/SourcesCard/SourcesCard.scss +17 -0
- package/src/SourcesCard/SourcesCard.test.tsx +93 -0
- package/src/SourcesCard/SourcesCard.tsx +116 -80
- package/src/ToolResponse/ToolResponse.scss +36 -0
- package/src/ToolResponse/ToolResponse.test.tsx +78 -0
- package/src/ToolResponse/ToolResponse.tsx +95 -0
- package/src/ToolResponse/index.ts +3 -0
- package/src/index.ts +9 -0
- package/src/main.scss +3 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// From Cursor, with aid
|
|
2
|
+
import React, { FunctionComponent, useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
|
4
|
+
import ChatbotConversationHistoryNav, {
|
|
5
|
+
Conversation
|
|
6
|
+
} from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
|
|
7
|
+
import { ChatbotModal } from '@patternfly/chatbot/dist/dynamic/ChatbotModal';
|
|
8
|
+
import {
|
|
9
|
+
Checkbox,
|
|
10
|
+
DropdownItem,
|
|
11
|
+
DropdownList,
|
|
12
|
+
Button,
|
|
13
|
+
TextInput,
|
|
14
|
+
Form,
|
|
15
|
+
FormGroup,
|
|
16
|
+
ModalHeader,
|
|
17
|
+
ModalBody,
|
|
18
|
+
ModalFooter
|
|
19
|
+
} from '@patternfly/react-core';
|
|
20
|
+
|
|
21
|
+
export const ChatbotHeaderTitleDemo: FunctionComponent = () => {
|
|
22
|
+
const [isDrawerOpen, setIsDrawerOpen] = useState(true);
|
|
23
|
+
const displayMode = ChatbotDisplayMode.embedded;
|
|
24
|
+
|
|
25
|
+
// Modal state
|
|
26
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
27
|
+
const [editingConversationId, setEditingConversationId] = useState<string | number | null>(null);
|
|
28
|
+
const [editingText, setEditingText] = useState('');
|
|
29
|
+
|
|
30
|
+
// Ref for the text input
|
|
31
|
+
const textInputRef = useRef<HTMLInputElement>(null);
|
|
32
|
+
|
|
33
|
+
// Focus the text input when modal opens
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (isModalOpen && textInputRef.current) {
|
|
36
|
+
textInputRef.current.focus();
|
|
37
|
+
// Move cursor to the end of the text
|
|
38
|
+
const length = textInputRef.current.value.length;
|
|
39
|
+
textInputRef.current.setSelectionRange(length, length);
|
|
40
|
+
}
|
|
41
|
+
}, [isModalOpen]);
|
|
42
|
+
|
|
43
|
+
const findConversationAndGroup = (conversations: { [key: string]: Conversation[] }, itemId: string | number) => {
|
|
44
|
+
for (const [groupKey, conversationList] of Object.entries(conversations)) {
|
|
45
|
+
const conversationIndex = conversationList.findIndex((conv) => conv.id === itemId);
|
|
46
|
+
if (conversationIndex !== -1) {
|
|
47
|
+
return { groupKey, conversationIndex, conversation: conversationList[conversationIndex] };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const onRenameClick = (itemId: string | number) => {
|
|
54
|
+
const result = findConversationAndGroup(conversations, itemId);
|
|
55
|
+
if (result) {
|
|
56
|
+
setEditingConversationId(itemId);
|
|
57
|
+
setEditingText(result.conversation.text);
|
|
58
|
+
setIsModalOpen(true);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const handleModalSave = () => {
|
|
63
|
+
if (editingConversationId) {
|
|
64
|
+
setConversations((prevConversations) => {
|
|
65
|
+
const result = findConversationAndGroup(prevConversations, editingConversationId);
|
|
66
|
+
if (!result) {
|
|
67
|
+
return prevConversations;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const { groupKey, conversationIndex } = result;
|
|
71
|
+
const newConversations = { ...prevConversations };
|
|
72
|
+
const newGroup = [...newConversations[groupKey]];
|
|
73
|
+
|
|
74
|
+
newGroup[conversationIndex] = { ...newGroup[conversationIndex], text: editingText };
|
|
75
|
+
newConversations[groupKey] = newGroup;
|
|
76
|
+
|
|
77
|
+
return newConversations;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
handleModalClose();
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleModalCancel = () => {
|
|
84
|
+
handleModalClose();
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const handleModalClose = () => {
|
|
88
|
+
setIsModalOpen(false);
|
|
89
|
+
setEditingConversationId(null);
|
|
90
|
+
setEditingText('');
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const handleTextInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
|
94
|
+
if (event.key === 'Enter') {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
handleModalSave();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const renderMenuItems = (itemId: string | number) => [
|
|
101
|
+
<DropdownList key={`list-${itemId}`}>
|
|
102
|
+
<DropdownItem value="Download" id="Download">
|
|
103
|
+
Download
|
|
104
|
+
</DropdownItem>
|
|
105
|
+
<DropdownItem value="Rename" id="Rename" onClick={() => onRenameClick(itemId)}>
|
|
106
|
+
Rename
|
|
107
|
+
</DropdownItem>
|
|
108
|
+
<DropdownItem value="Archive" id="Archive">
|
|
109
|
+
Archive
|
|
110
|
+
</DropdownItem>
|
|
111
|
+
<DropdownItem value="Delete" id="Delete">
|
|
112
|
+
Delete
|
|
113
|
+
</DropdownItem>
|
|
114
|
+
</DropdownList>
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
const initialConversations: { [key: string]: Conversation[] } = {
|
|
118
|
+
Today: [{ id: '1', text: 'Red Hat products and services' }],
|
|
119
|
+
'This month': [
|
|
120
|
+
{
|
|
121
|
+
id: '2',
|
|
122
|
+
text: 'Enterprise Linux installation and setup'
|
|
123
|
+
},
|
|
124
|
+
{ id: '3', text: 'Troubleshoot system crash' }
|
|
125
|
+
],
|
|
126
|
+
March: [
|
|
127
|
+
{ id: '4', text: 'Ansible security and updates' },
|
|
128
|
+
{ id: '5', text: 'Red Hat certification' },
|
|
129
|
+
{ id: '6', text: 'Lightspeed user documentation' }
|
|
130
|
+
],
|
|
131
|
+
February: [
|
|
132
|
+
{ id: '7', text: 'Crashing pod assistance' },
|
|
133
|
+
{ id: '8', text: 'OpenShift AI pipelines' },
|
|
134
|
+
{ id: '9', text: 'Updating subscription plan' },
|
|
135
|
+
{ id: '10', text: 'Red Hat licensing options' }
|
|
136
|
+
],
|
|
137
|
+
January: [
|
|
138
|
+
{ id: '11', text: 'RHEL system performance' },
|
|
139
|
+
{ id: '12', text: 'Manage user accounts' }
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const [conversations, setConversations] = useState(initialConversations);
|
|
144
|
+
|
|
145
|
+
// Create conversations with menu items dynamically
|
|
146
|
+
const conversationsWithMenuItems = () => {
|
|
147
|
+
const newConversations = { ...conversations };
|
|
148
|
+
Object.keys(newConversations).forEach((groupKey) => {
|
|
149
|
+
newConversations[groupKey] = newConversations[groupKey].map((conv) => ({
|
|
150
|
+
...conv,
|
|
151
|
+
menuItems: renderMenuItems(conv.id)
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
return newConversations;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<>
|
|
159
|
+
<Checkbox
|
|
160
|
+
label="Display drawer"
|
|
161
|
+
isChecked={isDrawerOpen}
|
|
162
|
+
onChange={() => setIsDrawerOpen(!isDrawerOpen)}
|
|
163
|
+
id="drawer-actions-visible"
|
|
164
|
+
name="drawer-actions-visible"
|
|
165
|
+
></Checkbox>
|
|
166
|
+
<ChatbotConversationHistoryNav
|
|
167
|
+
displayMode={displayMode}
|
|
168
|
+
onDrawerToggle={() => setIsDrawerOpen(!isDrawerOpen)}
|
|
169
|
+
isDrawerOpen={isDrawerOpen}
|
|
170
|
+
setIsDrawerOpen={setIsDrawerOpen}
|
|
171
|
+
conversations={conversationsWithMenuItems()}
|
|
172
|
+
drawerContent={<div>Drawer content</div>}
|
|
173
|
+
/>
|
|
174
|
+
|
|
175
|
+
<ChatbotModal displayMode={displayMode} isOpen={isModalOpen} onClose={handleModalClose}>
|
|
176
|
+
<ModalHeader title="Rename Conversation" />
|
|
177
|
+
<ModalBody>
|
|
178
|
+
<Form>
|
|
179
|
+
<FormGroup label="Conversation Name" fieldId="conversation-name" isRequired>
|
|
180
|
+
<TextInput
|
|
181
|
+
isRequired
|
|
182
|
+
ref={textInputRef}
|
|
183
|
+
value={editingText}
|
|
184
|
+
onChange={(_, value) => setEditingText(value)}
|
|
185
|
+
onKeyDown={handleTextInputKeyDown}
|
|
186
|
+
id="conversation-name"
|
|
187
|
+
/>
|
|
188
|
+
</FormGroup>
|
|
189
|
+
</Form>
|
|
190
|
+
</ModalBody>
|
|
191
|
+
<ModalFooter>
|
|
192
|
+
<Button key="save" variant="primary" onClick={handleModalSave}>
|
|
193
|
+
Save
|
|
194
|
+
</Button>
|
|
195
|
+
<Button key="cancel" variant="link" onClick={handleModalCancel}>
|
|
196
|
+
Cancel
|
|
197
|
+
</Button>
|
|
198
|
+
</ModalFooter>
|
|
199
|
+
</ChatbotModal>
|
|
200
|
+
</>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
ChatbotHeaderActions,
|
|
18
18
|
ChatbotHeaderTitle,
|
|
19
19
|
ChatbotHeaderOptionsDropdown,
|
|
20
|
-
ChatbotHeaderSelectorDropdown
|
|
20
|
+
ChatbotHeaderSelectorDropdown,
|
|
21
|
+
ChatbotHeaderNewChatButton
|
|
21
22
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
22
23
|
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
|
23
24
|
import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon';
|
|
@@ -31,6 +32,7 @@ export const BasicDemo: FunctionComponent = () => {
|
|
|
31
32
|
const [selectedModel, setSelectedModel] = useState('Granite Code 7B');
|
|
32
33
|
const [showAll, setShowAll] = useState<boolean>(true);
|
|
33
34
|
const [showMenu, setShowMenu] = useState<boolean>(true);
|
|
35
|
+
const [showNewChatButton, setShowNewChatButton] = useState<boolean>(true);
|
|
34
36
|
const [showLogo, setShowLogo] = useState<boolean>(false);
|
|
35
37
|
const [showCenteredLogo, setShowCenteredLogo] = useState<boolean>(true);
|
|
36
38
|
const [showSelectorDropdown, setShowSelectorDropdown] = useState<boolean>(true);
|
|
@@ -58,9 +60,10 @@ export const BasicDemo: FunctionComponent = () => {
|
|
|
58
60
|
<Stack hasGutter>
|
|
59
61
|
<FormGroup role="radiogroup" isInline fieldId="header-variant-form-radio-group" label="Variant">
|
|
60
62
|
<Checkbox
|
|
61
|
-
isChecked={showMenu && showCenteredLogo && showSelectorDropdown && showOptionsDropdown}
|
|
63
|
+
isChecked={showMenu && showNewChatButton && showCenteredLogo && showSelectorDropdown && showOptionsDropdown}
|
|
62
64
|
onChange={() => {
|
|
63
65
|
setShowMenu(true);
|
|
66
|
+
setShowNewChatButton(true);
|
|
64
67
|
setShowCenteredLogo(true);
|
|
65
68
|
setShowSelectorDropdown(true);
|
|
66
69
|
setShowOptionsDropdown(true);
|
|
@@ -80,6 +83,16 @@ export const BasicDemo: FunctionComponent = () => {
|
|
|
80
83
|
label="With menu"
|
|
81
84
|
id="menu"
|
|
82
85
|
/>
|
|
86
|
+
<Checkbox
|
|
87
|
+
isChecked={showNewChatButton}
|
|
88
|
+
onChange={() => {
|
|
89
|
+
setShowNewChatButton(!showNewChatButton);
|
|
90
|
+
showAll && setShowAll(!showAll);
|
|
91
|
+
}}
|
|
92
|
+
name="basic-inline-radio"
|
|
93
|
+
label="With new chat button"
|
|
94
|
+
id="new-chat-button"
|
|
95
|
+
/>
|
|
83
96
|
<Checkbox
|
|
84
97
|
isChecked={showLogo}
|
|
85
98
|
onChange={() => {
|
|
@@ -124,9 +137,10 @@ export const BasicDemo: FunctionComponent = () => {
|
|
|
124
137
|
</FormGroup>
|
|
125
138
|
|
|
126
139
|
<ChatbotHeader>
|
|
127
|
-
{(showMenu || showLogo || showCenteredLogo) && (
|
|
140
|
+
{(showMenu || showNewChatButton || showLogo || showCenteredLogo) && (
|
|
128
141
|
<ChatbotHeaderMain>
|
|
129
142
|
{showMenu && <ChatbotHeaderMenu onMenuToggle={() => alert('Menu toggle clicked')} />}
|
|
143
|
+
{showNewChatButton && <ChatbotHeaderNewChatButton onClick={() => alert('New chat button clicked')} />}
|
|
130
144
|
{(showLogo || showCenteredLogo) && (
|
|
131
145
|
<ChatbotHeaderTitle>{showCenteredLogo ? <Bullseye>{title}</Bullseye> : title}</ChatbotHeaderTitle>
|
|
132
146
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, FunctionComponent } from 'react';
|
|
1
|
+
import { useState, useEffect, useRef, FunctionComponent } from 'react';
|
|
2
2
|
import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
|
|
3
3
|
import ChatbotConversationHistoryNav, {
|
|
4
4
|
Conversation
|
|
@@ -71,8 +71,28 @@ export const ChatbotHeaderTitleDemo: FunctionComponent = () => {
|
|
|
71
71
|
const [hasError, setHasError] = useState(false);
|
|
72
72
|
const [isEmpty, setIsEmpty] = useState(false);
|
|
73
73
|
const [hasNoResults, setHasNoResults] = useState(false);
|
|
74
|
+
const [announcement, setAnnouncement] = useState('');
|
|
75
|
+
const [debouncedAnnouncement, setDebouncedAnnouncement] = useState('');
|
|
76
|
+
const announcementTimeoutRef = useRef<NodeJS.Timeout>();
|
|
74
77
|
const displayMode = ChatbotDisplayMode.embedded;
|
|
75
78
|
|
|
79
|
+
// Debounce announcement updates to prevent screen reader overload
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (announcementTimeoutRef.current) {
|
|
82
|
+
clearTimeout(announcementTimeoutRef.current);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
announcementTimeoutRef.current = setTimeout(() => {
|
|
86
|
+
setDebouncedAnnouncement(announcement);
|
|
87
|
+
}, 500);
|
|
88
|
+
|
|
89
|
+
return () => {
|
|
90
|
+
if (announcementTimeoutRef.current) {
|
|
91
|
+
clearTimeout(announcementTimeoutRef.current);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}, [announcement]);
|
|
95
|
+
|
|
76
96
|
const findMatchingItems = (targetValue: string) => {
|
|
77
97
|
const filteredConversations = Object.entries(initialConversations).reduce((acc, [key, items]) => {
|
|
78
98
|
const filteredItems = items.filter((item) => item.text.toLowerCase().includes(targetValue.toLowerCase()));
|
|
@@ -168,12 +188,23 @@ export const ChatbotHeaderTitleDemo: FunctionComponent = () => {
|
|
|
168
188
|
handleTextInputChange={(value: string) => {
|
|
169
189
|
if (value === '') {
|
|
170
190
|
setConversations(initialConversations);
|
|
191
|
+
setAnnouncement('');
|
|
192
|
+
setDebouncedAnnouncement('');
|
|
193
|
+
setHasNoResults(false);
|
|
194
|
+
} else {
|
|
195
|
+
// this is where you would perform search on the items in the drawer
|
|
196
|
+
// and update the state
|
|
197
|
+
const newConversations: { [key: string]: Conversation[] } = findMatchingItems(value);
|
|
198
|
+
const totalCount = Object.values(newConversations).flat().length;
|
|
199
|
+
const newAnnouncement =
|
|
200
|
+
totalCount === 1
|
|
201
|
+
? `${totalCount} conversation matches "${value}"`
|
|
202
|
+
: `${totalCount} conversations match "${value}"`;
|
|
203
|
+
setAnnouncement(newAnnouncement);
|
|
204
|
+
setConversations(newConversations);
|
|
171
205
|
}
|
|
172
|
-
// this is where you would perform search on the items in the drawer
|
|
173
|
-
// and update the state
|
|
174
|
-
const newConversations: { [key: string]: Conversation[] } = findMatchingItems(value);
|
|
175
|
-
setConversations(newConversations);
|
|
176
206
|
}}
|
|
207
|
+
searchInputScreenReaderText={debouncedAnnouncement}
|
|
177
208
|
drawerContent={<div>Drawer content</div>}
|
|
178
209
|
isLoading={isLoading}
|
|
179
210
|
errorState={hasError ? ERROR : undefined}
|
package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithPin.tsx
CHANGED
|
@@ -97,6 +97,14 @@ export const ChatbotHeaderPinDemo: FunctionComponent = () => {
|
|
|
97
97
|
}
|
|
98
98
|
return newPinned;
|
|
99
99
|
});
|
|
100
|
+
|
|
101
|
+
// Focus the conversation input after pin/unpin action
|
|
102
|
+
setTimeout(() => {
|
|
103
|
+
const dropdown = document.getElementById(`pin-demo-${conversationId}-dropdown`);
|
|
104
|
+
if (dropdown) {
|
|
105
|
+
dropdown.focus();
|
|
106
|
+
}
|
|
107
|
+
}, 100);
|
|
100
108
|
};
|
|
101
109
|
|
|
102
110
|
const createMenuItems = (conversationId: string) => {
|
|
@@ -136,7 +144,8 @@ export const ChatbotHeaderPinDemo: FunctionComponent = () => {
|
|
|
136
144
|
pinnedItems.push({
|
|
137
145
|
...conv,
|
|
138
146
|
menuItems: createMenuItems(conv.id),
|
|
139
|
-
icon: <ThumbtackIcon
|
|
147
|
+
icon: <ThumbtackIcon />,
|
|
148
|
+
dropdownId: `pin-demo-${conv.id}-dropdown`
|
|
140
149
|
});
|
|
141
150
|
}
|
|
142
151
|
});
|
|
@@ -153,7 +162,8 @@ export const ChatbotHeaderPinDemo: FunctionComponent = () => {
|
|
|
153
162
|
.filter((conv) => !pinnedConversations.has(conv.id))
|
|
154
163
|
.map((conv) => ({
|
|
155
164
|
...conv,
|
|
156
|
-
menuItems: createMenuItems(conv.id)
|
|
165
|
+
menuItems: createMenuItems(conv.id),
|
|
166
|
+
dropdownId: `pin-demo-${conv.id}-dropdown`
|
|
157
167
|
}));
|
|
158
168
|
|
|
159
169
|
if (unpinnedConversations.length > 0) {
|
|
@@ -61,7 +61,8 @@ ChatbotHeaderMenu,
|
|
|
61
61
|
ChatbotHeaderActions,
|
|
62
62
|
ChatbotHeaderTitle,
|
|
63
63
|
ChatbotHeaderOptionsDropdown,
|
|
64
|
-
ChatbotHeaderSelectorDropdown
|
|
64
|
+
ChatbotHeaderSelectorDropdown,
|
|
65
|
+
ChatbotHeaderNewChatButton
|
|
65
66
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
66
67
|
import { ChatbotFooter, ChatbotFootnote } from '@patternfly/chatbot/dist/dynamic/ChatbotFooter';
|
|
67
68
|
import { MessageBar } from '@patternfly/chatbot/dist/dynamic/MessageBar';
|
|
@@ -78,13 +79,15 @@ import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/ou
|
|
|
78
79
|
import ExpandIcon from '@patternfly/react-icons/dist/esm/icons/expand-icon';
|
|
79
80
|
import OpenDrawerRightIcon from '@patternfly/react-icons/dist/esm/icons/open-drawer-right-icon';
|
|
80
81
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
82
|
+
import PenToSquareIcon from '@patternfly/react-icons/dist/esm/icons/pen-to-square-icon';
|
|
81
83
|
import PFHorizontalLogoColor from './PF-HorizontalLogo-Color.svg';
|
|
82
84
|
import PFHorizontalLogoReverse from './PF-HorizontalLogo-Reverse.svg';
|
|
83
85
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
84
86
|
import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
|
|
85
87
|
import termsAndConditionsHeader from './PF-TermsAndConditionsHeader.svg';
|
|
86
88
|
import { CloseIcon, SearchIcon, OutlinedCommentsIcon } from '@patternfly/react-icons';
|
|
87
|
-
import { FunctionComponent, FormEvent, useState, useRef, MouseEvent, isValidElement, cloneElement, Children, ReactNode, Ref, MouseEvent as ReactMouseEvent, CSSProperties} from 'react';
|
|
89
|
+
import { FunctionComponent, FormEvent, useState, useRef, MouseEvent, isValidElement, cloneElement, Children, ReactNode, Ref, MouseEvent as ReactMouseEvent, CSSProperties, useEffect} from 'react';
|
|
90
|
+
import FilePreview from '@patternfly/chatbot/dist/dynamic/FilePreview';
|
|
88
91
|
|
|
89
92
|
## Structure
|
|
90
93
|
|
|
@@ -184,9 +187,10 @@ The ChatBot header is persistent, and contains the title for the ChatBot window,
|
|
|
184
187
|
|
|
185
188
|
The `<ChatbotHeader>` has 2 sections:
|
|
186
189
|
|
|
187
|
-
- `<ChatbotHeaderMain>` contains the title and an optional menu toggle:
|
|
190
|
+
- `<ChatbotHeaderMain>` contains the title and an optional menu toggle or new chat button:
|
|
188
191
|
- `<ChatbotHeaderTitle>` handles the layout and display of a title or image at different responsive sizes.
|
|
189
192
|
- `<ChatbotHeaderMenu>` (optional) is placed on the left side of the header and used to toggle a chat history menu.
|
|
193
|
+
- `<ChatbotHeaderNewChatButton>` (optional) is placed on the left side of the header and used to initiate a new chat.
|
|
190
194
|
- `<ChatbotHeaderActions>` contains any additional controls:
|
|
191
195
|
- The `<ChatbotHeaderSelectorDropdown>` component is a standard PatternFly dropdown that matches the ChatBot styles.
|
|
192
196
|
- The `<ChatbotHeaderOptionsDropdown>` component is a dropdown with a menu toggle that is intended to be used to update ChatBot settings (like the display mode).
|
|
@@ -197,6 +201,7 @@ Your `<ChatbotHeader>` code structure should look like this:
|
|
|
197
201
|
<ChatbotHeader>
|
|
198
202
|
<ChatbotHeaderMain>
|
|
199
203
|
<ChatbotHeaderMenu ... />
|
|
204
|
+
<ChatbotHeaderNewChatButton ... />
|
|
200
205
|
<ChatbotHeaderTitle ... />
|
|
201
206
|
</ChatbotHeaderMain>
|
|
202
207
|
<ChatbotHeaderActions>
|
|
@@ -221,6 +226,7 @@ There are a variety of options and customizations you can make to the header, to
|
|
|
221
226
|
In this example, select the respective checkbox to toggle these features:
|
|
222
227
|
|
|
223
228
|
- **Menu:** Users can select the menu toggle to open a menu of additional options or actions.
|
|
229
|
+
- **New chat button:** Used to start a new chat session. The header button can be used in addition to or in place of a new chat button within the [conversation history drawer](/patternfly-ai/chatbot/ui/#drawer-with-search-and-new-chat-button).
|
|
224
230
|
- **Left-aligned logo**
|
|
225
231
|
- **Centered logo**
|
|
226
232
|
- **Selector dropdown:** Users can choose from preselected options in a dropdown menu. For example, they can toggle between AI models.
|
|
@@ -369,6 +375,19 @@ To help users track important conversations, add a "pin" option to the conversat
|
|
|
369
375
|
|
|
370
376
|
```
|
|
371
377
|
|
|
378
|
+
### Renaming conversations in history drawer
|
|
379
|
+
|
|
380
|
+
You can allow users to rename a conversation in the history drawer by implementing a modal that opens upon clicking a "Rename" (or similar) action. When doing so, you must ensure the following:
|
|
381
|
+
|
|
382
|
+
- When the modal opens, focus is placed at the end of the text input.
|
|
383
|
+
- When the modal closes, focus goes back to the action toggle that was previously opened.
|
|
384
|
+
- Changes can be canceled via the **<kbd>Escape</kbd>** key or clicking a "Cancel" button.
|
|
385
|
+
- Changes can be saved via the **<kbd>Enter</kbd>** key or by clicking a "Save" button.
|
|
386
|
+
|
|
387
|
+
```js file="./ChatbotConversationEditing.tsx"
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
|
|
372
391
|
### Drawer with active conversation
|
|
373
392
|
|
|
374
393
|
If you're showing a conversation that is already active, you can set the `activeItemId` prop on your `<ChatbotConversationHistoryNav>` to apply an active visual state.
|
|
@@ -45,7 +45,7 @@ ChatbotHeaderTitle,
|
|
|
45
45
|
ChatbotHeaderActions,
|
|
46
46
|
ChatbotHeaderSelectorDropdown,
|
|
47
47
|
ChatbotHeaderOptionsDropdown,
|
|
48
|
-
ChatbotHeaderCloseButton
|
|
48
|
+
ChatbotHeaderCloseButton,
|
|
49
49
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
50
50
|
|
|
51
51
|
import ExpandIcon from '@patternfly/react-icons/dist/esm/icons/expand-icon';
|
package/src/Chatbot/Chatbot.scss
CHANGED
|
@@ -16,10 +16,17 @@
|
|
|
16
16
|
z-index: var(--pf-t--global--z-index--md);
|
|
17
17
|
-webkit-font-smoothing: antialiased;
|
|
18
18
|
-moz-osx-font-smoothing: grayscale;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
transition:
|
|
20
|
+
opacity 0.3s ease-out,
|
|
21
|
+
transform 0.3s ease-out;
|
|
21
22
|
&--hidden {
|
|
22
23
|
pointer-events: none;
|
|
24
|
+
opacity: 0;
|
|
25
|
+
transform: translateY(16px);
|
|
26
|
+
}
|
|
27
|
+
&--visible {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: translateY(0);
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
// 32 rem is the width of the overlay chatbot plus the insets
|
package/src/Chatbot/Chatbot.tsx
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import type { Ref, FunctionComponent } from 'react';
|
|
5
5
|
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
|
-
import { motion } from 'framer-motion';
|
|
8
7
|
|
|
9
8
|
export interface ChatbotProps {
|
|
10
9
|
/** Content to be displayed in the chatbot */
|
|
@@ -40,36 +39,24 @@ const ChatbotBase: FunctionComponent<ChatbotProps> = ({
|
|
|
40
39
|
ariaLabel,
|
|
41
40
|
isCompact,
|
|
42
41
|
...props
|
|
43
|
-
}: ChatbotProps) =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<section
|
|
62
|
-
aria-label={ariaLabel ?? 'Chatbot'}
|
|
63
|
-
className={`pf-chatbot-container pf-chatbot-container--${displayMode} ${!isVisible ? 'pf-chatbot-container--hidden' : ''}`}
|
|
64
|
-
tabIndex={-1}
|
|
65
|
-
ref={innerRef}
|
|
66
|
-
>
|
|
67
|
-
{children}
|
|
68
|
-
</section>
|
|
69
|
-
) : undefined}
|
|
70
|
-
</motion.div>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
42
|
+
}: ChatbotProps) => (
|
|
43
|
+
<div
|
|
44
|
+
className={`pf-chatbot pf-chatbot--${displayMode} ${!isVisible ? 'pf-chatbot--hidden' : 'pf-chatbot--visible'} ${isCompact ? 'pf-m-compact' : ''} ${className ?? ''}`}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{/* Ref is intended for use with skip to chatbot links, etc. */}
|
|
48
|
+
{isVisible ? (
|
|
49
|
+
<section
|
|
50
|
+
aria-label={ariaLabel ?? 'Chatbot'}
|
|
51
|
+
className={`pf-chatbot-container pf-chatbot-container--${displayMode} ${!isVisible ? 'pf-chatbot-container--hidden' : ''}`}
|
|
52
|
+
tabIndex={-1}
|
|
53
|
+
ref={innerRef}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</section>
|
|
57
|
+
) : undefined}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
73
60
|
|
|
74
61
|
const Chatbot = forwardRef((props: ChatbotProps, ref: Ref<HTMLDivElement>) => (
|
|
75
62
|
<ChatbotBase innerRef={ref} {...props} />
|
|
@@ -19,13 +19,16 @@ export interface ChatbotConversationHistoryDropdownProps extends Omit<DropdownPr
|
|
|
19
19
|
label?: string;
|
|
20
20
|
/** Callback for when user selects item. */
|
|
21
21
|
onSelect?: (event?: React.MouseEvent, value?: string | number) => void;
|
|
22
|
+
/** Id applied to dropdown menu toggle */
|
|
23
|
+
id?: string;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export const ChatbotConversationHistoryDropdown: FunctionComponent<ChatbotConversationHistoryDropdownProps> = ({
|
|
25
27
|
menuItems,
|
|
26
28
|
menuClassName,
|
|
27
29
|
onSelect,
|
|
28
|
-
label
|
|
30
|
+
label,
|
|
31
|
+
id
|
|
29
32
|
}: ChatbotConversationHistoryDropdownProps) => {
|
|
30
33
|
const [isOpen, setIsOpen] = useState(false);
|
|
31
34
|
|
|
@@ -44,6 +47,7 @@ export const ChatbotConversationHistoryDropdown: FunctionComponent<ChatbotConver
|
|
|
44
47
|
ref={toggleRef}
|
|
45
48
|
isExpanded={isOpen}
|
|
46
49
|
onClick={() => setIsOpen(!isOpen)}
|
|
50
|
+
id={id}
|
|
47
51
|
role="menuitem"
|
|
48
52
|
>
|
|
49
53
|
<EllipsisIcon />
|
|
@@ -2,28 +2,43 @@
|
|
|
2
2
|
// Chatbot Header - Menu
|
|
3
3
|
// ============================================================================
|
|
4
4
|
.pf-chatbot__history {
|
|
5
|
+
// hide from view but not assistive technologies
|
|
6
|
+
// https://css-tricks.com/inclusively-hidden/
|
|
7
|
+
.pf-chatbot__filter-announcement {
|
|
8
|
+
clip: rect(0 0 0 0);
|
|
9
|
+
clip-path: inset(50%);
|
|
10
|
+
height: 1px;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
position: absolute;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
width: 1px;
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
.pf-chatbot__drawer-backdrop {
|
|
6
18
|
position: absolute;
|
|
7
19
|
border-radius: var(--pf-t--global--border--radius--medium);
|
|
8
20
|
}
|
|
9
|
-
|
|
10
|
-
// ----------------------------------------------------------------------------
|
|
11
|
-
.pf-chatbot__input {
|
|
12
|
-
}
|
|
21
|
+
|
|
13
22
|
// Drawer title
|
|
14
23
|
// ----------------------------------------------------------------------------
|
|
15
|
-
.pf-
|
|
24
|
+
.pf-chatbot__heading-container {
|
|
16
25
|
padding-inline-start: var(--pf-t--global--spacer--lg);
|
|
17
26
|
padding-inline-end: var(--pf-t--global--spacer--lg);
|
|
18
27
|
display: flex;
|
|
19
28
|
flex-direction: column;
|
|
20
29
|
row-gap: var(--pf-t--global--spacer--sm);
|
|
21
30
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
.pf-chatbot__title {
|
|
32
|
+
font-size: var(--pf-v6-c-title--m-h3--FontSize);
|
|
33
|
+
font-weight: var(--pf-v6-c-title--m-h3--FontWeight);
|
|
34
|
+
line-height: var(--pf-v6-c-title--m-h3--LineHeight);
|
|
35
|
+
}
|
|
36
|
+
.pf-chatbot__title-container {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
align-items: baseline;
|
|
40
|
+
justify-content: flex-start;
|
|
41
|
+
gap: var(--pf-t--global--spacer--gap--text-to-element--default);
|
|
27
42
|
}
|
|
28
43
|
// Drawer menu
|
|
29
44
|
// ----------------------------------------------------------------------------
|
|
@@ -36,6 +51,7 @@
|
|
|
36
51
|
.pf-v6-c-menu__item-main {
|
|
37
52
|
--pf-v6-c-menu__item-main--ColumnGap: var(--pf-t--global--spacer--md);
|
|
38
53
|
}
|
|
54
|
+
|
|
39
55
|
.pf-chatbot__menu-item-header > .pf-v6-c-menu__group-title {
|
|
40
56
|
color: var(--pf-t--global--text--color--subtle);
|
|
41
57
|
font-weight: var(--pf-t--global--font--weight--body--bold);
|
|
@@ -48,6 +64,7 @@
|
|
|
48
64
|
background-color: var(--pf-t--global--background--color--floating--default);
|
|
49
65
|
z-index: var(--pf-t--global--z-index--md);
|
|
50
66
|
}
|
|
67
|
+
|
|
51
68
|
.pf-chatbot__menu-item {
|
|
52
69
|
--pf-v6-c-menu__item--PaddingInlineStart: var(--pf-t--global--spacer--sm);
|
|
53
70
|
--pf-v6-c-menu__item--PaddingInlineEnd: var(--pf-t--global--spacer--sm);
|
|
@@ -62,6 +79,7 @@
|
|
|
62
79
|
.pf-v6-c-menu__list-item.pf-chatbot__menu-item {
|
|
63
80
|
overflow: hidden;
|
|
64
81
|
}
|
|
82
|
+
|
|
65
83
|
.pf-chatbot__history-actions {
|
|
66
84
|
transform: rotate(90deg);
|
|
67
85
|
}
|