@patternfly/chatbot 2.2.0-prerelease.26 → 2.2.0-prerelease.28

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.
Files changed (65) hide show
  1. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
  2. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +11 -4
  3. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +22 -10
  4. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +60 -0
  5. package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
  6. package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.js +29 -0
  7. package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
  8. package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.js +45 -0
  9. package/dist/cjs/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
  10. package/dist/cjs/ChatbotFooter/ChatbotFootnote.js +1 -1
  11. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +3 -3
  12. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +2 -2
  13. package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
  14. package/dist/cjs/ResponseActions/ResponseActions.test.js +2 -2
  15. package/dist/css/main.css +17 -3
  16. package/dist/css/main.css.map +1 -1
  17. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
  18. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +11 -4
  19. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +22 -10
  20. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +60 -0
  21. package/dist/esm/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
  22. package/dist/esm/ChatbotConversationHistoryNav/EmptyState.js +22 -0
  23. package/dist/esm/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
  24. package/dist/esm/ChatbotConversationHistoryNav/LoadingState.js +38 -0
  25. package/dist/esm/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
  26. package/dist/esm/ChatbotFooter/ChatbotFootnote.js +1 -1
  27. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +3 -3
  28. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +2 -2
  29. package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
  30. package/dist/esm/ResponseActions/ResponseActions.test.js +2 -2
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +1 -1
  33. package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
  34. package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +19 -6
  35. package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDropZone.tsx +2 -1
  36. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithAttachment.tsx +2 -2
  37. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +1 -1
  38. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +1 -1
  39. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
  40. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +1 -1
  41. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +1 -1
  42. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +2 -2
  43. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx +4 -4
  44. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +1 -1
  45. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +34 -1
  46. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +1 -1
  47. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomePrompt.tsx +7 -7
  48. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +10 -10
  49. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +1 -1
  50. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +1 -1
  51. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +10 -10
  52. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +1 -1
  53. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +3 -3
  54. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +14 -0
  55. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +130 -0
  56. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +60 -25
  57. package/src/ChatbotConversationHistoryNav/EmptyState.tsx +44 -0
  58. package/src/ChatbotConversationHistoryNav/LoadingState.tsx +38 -0
  59. package/src/ChatbotFooter/ChatbotFootnote.tsx +2 -2
  60. package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +2 -2
  61. package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +3 -3
  62. package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +26 -18
  63. package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +2 -2
  64. package/src/MessageBar/MessageBar.scss +3 -3
  65. package/src/ResponseActions/ResponseActions.test.tsx +4 -2
@@ -18,8 +18,10 @@ import { Button, Drawer, DrawerPanelContent, DrawerContent, DrawerPanelBody, Dra
18
18
  import { OutlinedCommentAltIcon } from '@patternfly/react-icons';
19
19
  import { ChatbotDisplayMode } from '../Chatbot/Chatbot';
20
20
  import ConversationHistoryDropdown from './ChatbotConversationHistoryDropdown';
21
+ import LoadingState from './LoadingState';
22
+ import HistoryEmptyState from './EmptyState';
21
23
  export const ChatbotConversationHistoryNav = (_a) => {
22
- var { onDrawerToggle, isDrawerOpen, setIsDrawerOpen, activeItemId, onSelectActiveItem, conversations, newChatButtonText = 'New chat', drawerContent, onNewChat, searchInputPlaceholder = 'Search...', searchInputAriaLabel = 'Filter menu items', handleTextInputChange, displayMode, reverseButtonOrder = false, drawerActionsTestId = 'chatbot-nav-drawer-actions', menuProps, drawerPanelContentProps, drawerContentProps, drawerContentBodyProps, drawerHeadProps, drawerActionsProps, drawerCloseButtonProps, drawerPanelBodyProps } = _a, props = __rest(_a, ["onDrawerToggle", "isDrawerOpen", "setIsDrawerOpen", "activeItemId", "onSelectActiveItem", "conversations", "newChatButtonText", "drawerContent", "onNewChat", "searchInputPlaceholder", "searchInputAriaLabel", "handleTextInputChange", "displayMode", "reverseButtonOrder", "drawerActionsTestId", "menuProps", "drawerPanelContentProps", "drawerContentProps", "drawerContentBodyProps", "drawerHeadProps", "drawerActionsProps", "drawerCloseButtonProps", "drawerPanelBodyProps"]);
24
+ var { onDrawerToggle, isDrawerOpen, setIsDrawerOpen, activeItemId, onSelectActiveItem, conversations, newChatButtonText = 'New chat', drawerContent, onNewChat, searchInputPlaceholder = 'Search previous conversations...', searchInputAriaLabel = 'Filter menu items', handleTextInputChange, displayMode, reverseButtonOrder = false, drawerActionsTestId = 'chatbot-nav-drawer-actions', menuProps, drawerPanelContentProps, drawerContentProps, drawerContentBodyProps, drawerHeadProps, drawerActionsProps, drawerCloseButtonProps, drawerPanelBodyProps, isLoading, loadingState, errorState } = _a, props = __rest(_a, ["onDrawerToggle", "isDrawerOpen", "setIsDrawerOpen", "activeItemId", "onSelectActiveItem", "conversations", "newChatButtonText", "drawerContent", "onNewChat", "searchInputPlaceholder", "searchInputAriaLabel", "handleTextInputChange", "displayMode", "reverseButtonOrder", "drawerActionsTestId", "menuProps", "drawerPanelContentProps", "drawerContentProps", "drawerContentBodyProps", "drawerHeadProps", "drawerActionsProps", "drawerCloseButtonProps", "drawerPanelBodyProps", "isLoading", "loadingState", "errorState"]);
23
25
  const drawerRef = React.useRef(null);
24
26
  const onExpand = () => {
25
27
  drawerRef.current && drawerRef.current.focus();
@@ -46,16 +48,26 @@ export const ChatbotConversationHistoryNav = (_a) => {
46
48
  // Menu Content
47
49
  // - Consumers should pass an array to <Chatbot> of the list of conversations
48
50
  // - Groups could be optional, but items need to be ordered by date
49
- const menuContent = (React.createElement(Menu, Object.assign({ isPlain: true, onSelect: onSelectActiveItem, activeItemId: activeItemId }, menuProps),
50
- React.createElement(MenuContent, null, buildMenu())));
51
- const panelContent = (React.createElement(DrawerPanelContent, Object.assign({ focusTrap: { enabled: true }, defaultSize: "384px" }, drawerPanelContentProps),
52
- React.createElement(DrawerHead, Object.assign({}, drawerHeadProps),
53
- React.createElement(DrawerActions, Object.assign({ "data-testid": drawerActionsTestId, className: reverseButtonOrder ? 'pf-v6-c-drawer__actions--reversed' : '' }, drawerActionsProps),
54
- React.createElement(DrawerCloseButton, Object.assign({ onClick: onDrawerToggle }, drawerCloseButtonProps)),
55
- onNewChat && React.createElement(Button, { onClick: onNewChat }, newChatButtonText))),
51
+ const renderMenuContent = () => {
52
+ if (errorState) {
53
+ return React.createElement(HistoryEmptyState, Object.assign({}, errorState));
54
+ }
55
+ return (React.createElement(Menu, Object.assign({ isPlain: true, onSelect: onSelectActiveItem, activeItemId: activeItemId }, menuProps),
56
+ React.createElement(MenuContent, null, buildMenu())));
57
+ };
58
+ const renderDrawerContent = () => (React.createElement(React.Fragment, null,
56
59
  handleTextInputChange && (React.createElement("div", { className: "pf-chatbot__input" },
57
60
  React.createElement(SearchInput, { "aria-label": searchInputAriaLabel, onChange: (_event, value) => handleTextInputChange(value), placeholder: searchInputPlaceholder }))),
58
- React.createElement(DrawerPanelBody, Object.assign({}, drawerPanelBodyProps), menuContent)));
61
+ React.createElement(DrawerPanelBody, Object.assign({}, drawerPanelBodyProps), renderMenuContent())));
62
+ const renderPanelContent = () => {
63
+ const drawer = (React.createElement(React.Fragment, null,
64
+ React.createElement(DrawerHead, Object.assign({}, drawerHeadProps),
65
+ React.createElement(DrawerActions, Object.assign({ "data-testid": drawerActionsTestId, className: reverseButtonOrder ? 'pf-v6-c-drawer__actions--reversed' : '' }, drawerActionsProps),
66
+ React.createElement(DrawerCloseButton, Object.assign({ onClick: onDrawerToggle }, drawerCloseButtonProps)),
67
+ onNewChat && React.createElement(Button, { onClick: onNewChat }, newChatButtonText))),
68
+ isLoading ? React.createElement(LoadingState, Object.assign({}, loadingState)) : renderDrawerContent()));
69
+ return (React.createElement(DrawerPanelContent, Object.assign({ "aria-live": "polite", focusTrap: { enabled: true }, defaultSize: "384px" }, drawerPanelContentProps), drawer));
70
+ };
59
71
  // An onKeyDown property must be passed to the Drawer component to handle closing
60
72
  // the drawer panel and deactivating the focus trap via the Escape key.
61
73
  const onEscape = (event) => {
@@ -67,7 +79,7 @@ export const ChatbotConversationHistoryNav = (_a) => {
67
79
  }
68
80
  };
69
81
  return (React.createElement(Drawer, Object.assign({ className: "pf-chatbot__history", isExpanded: isDrawerOpen, onExpand: onExpand, position: "start", onKeyDown: onEscape, isInline: displayMode === ChatbotDisplayMode.fullscreen || displayMode === ChatbotDisplayMode.embedded }, props),
70
- React.createElement(DrawerContent, Object.assign({ panelContent: panelContent }, drawerContentProps),
82
+ React.createElement(DrawerContent, Object.assign({ panelContent: renderPanelContent() }, drawerContentProps),
71
83
  React.createElement(DrawerContentBody, Object.assign({}, drawerContentBodyProps),
72
84
  React.createElement(React.Fragment, null,
73
85
  React.createElement("div", { className: `${isDrawerOpen && (displayMode === ChatbotDisplayMode.default || displayMode === ChatbotDisplayMode.docked) ? 'pf-v6-c-backdrop pf-chatbot__drawer-backdrop' : undefined} ` }),
@@ -12,6 +12,33 @@ import '@testing-library/jest-dom';
12
12
  import { fireEvent, render, screen, waitFor } from '@testing-library/react';
13
13
  import { ChatbotDisplayMode } from '../Chatbot/Chatbot';
14
14
  import ChatbotConversationHistoryNav from './ChatbotConversationHistoryNav';
15
+ import { EmptyStateStatus, Spinner } from '@patternfly/react-core';
16
+ const ERROR = {
17
+ bodyText: (React.createElement(React.Fragment, null,
18
+ "To try again, check your connection and reload this page. If the issue persists,",
19
+ ' ',
20
+ React.createElement("a", { href: "" }, "contact the support team"),
21
+ ".")),
22
+ buttonText: 'Reload',
23
+ buttonIcon: React.createElement(Spinner, { size: "sm" }),
24
+ hasButton: true,
25
+ titleText: 'Could not load chat history',
26
+ status: EmptyStateStatus.danger,
27
+ onClick: () => alert('Clicked Reload')
28
+ };
29
+ const ERROR_WITHOUT_BUTTON = {
30
+ bodyText: (React.createElement(React.Fragment, null,
31
+ "To try again, check your connection and reload this page. If the issue persists,",
32
+ ' ',
33
+ React.createElement("a", { href: "" }, "contact the support team"),
34
+ ".")),
35
+ buttonText: 'Reload',
36
+ buttonIcon: React.createElement(Spinner, { size: "sm" }),
37
+ hasButton: false,
38
+ titleText: 'Could not load chat history',
39
+ status: EmptyStateStatus.danger,
40
+ onClick: () => alert('Clicked Reload')
41
+ };
15
42
  describe('ChatbotConversationHistoryNav', () => {
16
43
  const onDrawerToggle = jest.fn();
17
44
  const initialConversations = [
@@ -97,4 +124,37 @@ describe('ChatbotConversationHistoryNav', () => {
97
124
  const element = container.querySelector('.test');
98
125
  expect(element).toBeInTheDocument();
99
126
  });
127
+ it('should show loading state if triggered', () => {
128
+ render(React.createElement(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), reverseButtonOrder: false, handleTextInputChange: jest.fn(), conversations: initialConversations, isLoading: true }));
129
+ expect(screen.getByRole('dialog', { name: /Loading chatbot conversation history/i })).toBeTruthy();
130
+ expect(screen.getByRole('button', { name: /Close drawer panel/i })).toBeTruthy();
131
+ });
132
+ it('should pass alternative aria label to loading state', () => {
133
+ render(React.createElement(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), reverseButtonOrder: false, handleTextInputChange: jest.fn(), conversations: initialConversations, isLoading: true, loadingState: { screenreaderText: 'I am a test' } }));
134
+ expect(screen.getByRole('dialog', { name: /I am a test/i })).toBeTruthy();
135
+ });
136
+ it('should accept errorState', () => {
137
+ render(React.createElement(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), reverseButtonOrder: false, handleTextInputChange: jest.fn(), conversations: initialConversations, errorState: ERROR }));
138
+ expect(screen.getByRole('dialog', {
139
+ name: /Could not load chat history To try again, check your connection and reload this page. If the issue persists, contact the support team . Loading... Reload/i
140
+ })).toBeTruthy();
141
+ expect(screen.getByRole('button', { name: /Close drawer panel/i })).toBeTruthy();
142
+ expect(screen.getByRole('button', { name: /Loading... Reload/i })).toBeTruthy();
143
+ expect(screen.getByRole('textbox', { name: /Filter menu items/i })).toBeTruthy();
144
+ expect(screen.getByRole('heading', { name: /Could not load chat history/i })).toBeTruthy();
145
+ });
146
+ it('should accept errorState without button', () => {
147
+ render(React.createElement(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), reverseButtonOrder: false, handleTextInputChange: jest.fn(), conversations: initialConversations, errorState: ERROR_WITHOUT_BUTTON }));
148
+ expect(screen.getByRole('dialog', {
149
+ name: /Could not load chat history To try again, check your connection and reload this page. If the issue persists, contact the support team ./i
150
+ })).toBeTruthy();
151
+ expect(screen.getByRole('button', { name: /Close drawer panel/i })).toBeTruthy();
152
+ expect(screen.queryByRole('button', { name: /Loading... Reload/i })).toBeFalsy();
153
+ expect(screen.getByRole('textbox', { name: /Filter menu items/i })).toBeTruthy();
154
+ expect(screen.getByRole('heading', { name: /Could not load chat history/i })).toBeTruthy();
155
+ });
156
+ it('should show loading state over error state if both are supplied', () => {
157
+ render(React.createElement(ChatbotConversationHistoryNav, { onDrawerToggle: onDrawerToggle, isDrawerOpen: true, displayMode: ChatbotDisplayMode.fullscreen, setIsDrawerOpen: jest.fn(), reverseButtonOrder: false, handleTextInputChange: jest.fn(), conversations: initialConversations, isLoading: true, errorState: ERROR }));
158
+ expect(screen.getByRole('dialog', { name: /Loading/i })).toBeTruthy();
159
+ });
100
160
  });
@@ -0,0 +1,11 @@
1
+ import { EmptyStateProps } from '@patternfly/react-core';
2
+ import React from 'react';
3
+ export interface HistoryEmptyStateProps extends EmptyStateProps {
4
+ onClick?: () => void;
5
+ bodyText?: string | React.ReactNode;
6
+ buttonText?: string;
7
+ buttonIcon?: React.ReactNode;
8
+ hasButton?: boolean;
9
+ }
10
+ export declare const HistoryEmptyState: React.FunctionComponent<HistoryEmptyStateProps>;
11
+ export default HistoryEmptyState;
@@ -0,0 +1,22 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { Button, EmptyState, EmptyStateActions, EmptyStateBody, EmptyStateFooter } from '@patternfly/react-core';
13
+ import React from 'react';
14
+ export const HistoryEmptyState = (_a) => {
15
+ var { bodyText, buttonIcon, buttonText, status, titleText, headingLevel, onClick, hasButton = false } = _a, props = __rest(_a, ["bodyText", "buttonIcon", "buttonText", "status", "titleText", "headingLevel", "onClick", "hasButton"]);
16
+ return (React.createElement(EmptyState, Object.assign({ status: status, titleText: titleText, headingLevel: headingLevel }, props),
17
+ React.createElement(EmptyStateBody, null, bodyText),
18
+ hasButton && (React.createElement(EmptyStateFooter, null,
19
+ React.createElement(EmptyStateActions, null,
20
+ React.createElement(Button, { icon: buttonIcon, variant: "secondary", onClick: onClick }, buttonText))))));
21
+ };
22
+ export default HistoryEmptyState;
@@ -0,0 +1,4 @@
1
+ import { SkeletonProps } from '@patternfly/react-core';
2
+ import React from 'react';
3
+ export declare const LoadingState: React.FunctionComponent<SkeletonProps>;
4
+ export default LoadingState;
@@ -0,0 +1,38 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { Skeleton } from '@patternfly/react-core';
13
+ import React from 'react';
14
+ export const LoadingState = (_a) => {
15
+ var { screenreaderText } = _a, rest = __rest(_a, ["screenreaderText"]);
16
+ return (React.createElement("div", { className: "pf-chatbot__history-loading" },
17
+ React.createElement("div", { className: "pf-chatbot__history-loading-block" },
18
+ React.createElement(Skeleton, Object.assign({ screenreaderText: screenreaderText !== null && screenreaderText !== void 0 ? screenreaderText : 'Loading chatbot conversation history', fontSize: "3xl" }, rest))),
19
+ React.createElement("div", { className: "pf-chatbot__history-loading-block" },
20
+ React.createElement(Skeleton, Object.assign({ fontSize: "sm", width: "70%" }, rest)),
21
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)),
22
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest))),
23
+ React.createElement("div", { className: "pf-chatbot__history-loading-block" },
24
+ React.createElement(Skeleton, Object.assign({ fontSize: "sm", width: "70%" }, rest)),
25
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)),
26
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)),
27
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest))),
28
+ React.createElement("div", { className: "pf-chatbot__history-loading-block" },
29
+ React.createElement(Skeleton, Object.assign({ fontSize: "sm", width: "70%" }, rest)),
30
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)),
31
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)),
32
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)),
33
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest))),
34
+ React.createElement("div", { className: "pf-chatbot__history-loading-block" },
35
+ React.createElement(Skeleton, Object.assign({ fontSize: "sm", width: "70%" }, rest)),
36
+ React.createElement(Skeleton, Object.assign({ fontSize: "3xl" }, rest)))));
37
+ };
38
+ export default LoadingState;
@@ -17,7 +17,7 @@ export interface ChatbotFootnotePopover {
17
17
  bannerImage?: ChatbotFootnotePopoverBannerImage;
18
18
  /** Optional CTA button that can be used to trigger an action and close the popover */
19
19
  cta?: ChatbotFootnotePopoverCTA;
20
- /** Optional link that can be used to show and external link like **Learn More** */
20
+ /** Optional link that can be used to show an external link like **View AI policy** */
21
21
  link?: ChatbotFootnotePopoverLink;
22
22
  /** Props for PF Popover */
23
23
  popoverProps?: PopoverProps;
@@ -36,7 +36,7 @@ export const ChatbotFootnote = (_a) => {
36
36
  var _a;
37
37
  setIsVisible(false);
38
38
  (_a = popover.cta) === null || _a === void 0 ? void 0 : _a.onClick();
39
- } }, ((_b = popover.cta) === null || _b === void 0 ? void 0 : _b.label) || 'Got it')),
39
+ } }, ((_b = popover.cta) === null || _b === void 0 ? void 0 : _b.label) || 'Dismiss')),
40
40
  (popover === null || popover === void 0 ? void 0 : popover.link) && (React.createElement(Button, { variant: "link", component: "a", href: popover.link.url, target: "_blank", icon: React.createElement(ExternalLinkAltIcon, null), iconPosition: "end" }, popover.link.label))));
41
41
  return (React.createElement("div", Object.assign({ className: `pf-chatbot__footnote ${className !== null && className !== void 0 ? className : ''}` }, props),
42
42
  popover && (React.createElement(ChatbotPopover, Object.assign({ className: "pf-chatbot__popover--footnote", "aria-label": ((_c = popover.popoverProps) === null || _c === void 0 ? void 0 : _c['aria-label']) || 'More information', isVisible: isVisible, shouldOpen: (_event, _fn) => setIsVisible(true), shouldClose: (_event, _fn) => setIsVisible(false), bodyContent: popoverBodyContent, footerContent: popoverFooterContent, minWidth: ((_d = popover.popoverProps) === null || _d === void 0 ? void 0 : _d.minWidth) || '432', maxWidth: ((_e = popover.popoverProps) === null || _e === void 0 ? void 0 : _e.maxWidth) || '432', distance: ((_f = popover.popoverProps) === null || _f === void 0 ? void 0 : _f.distance) || 16, showClose: false }, popover.popoverProps),
@@ -12,16 +12,16 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import React from 'react';
13
13
  import { Tooltip, Dropdown, MenuToggle } from '@patternfly/react-core';
14
14
  export const ChatbotHeaderSelectorDropdown = (_a) => {
15
- var { value, className, children, onSelect, tooltipProps, tooltipContent = 'Chatbot selector', menuToggleAriaLabel } = _a, props = __rest(_a, ["value", "className", "children", "onSelect", "tooltipProps", "tooltipContent", "menuToggleAriaLabel"]);
15
+ var { value, className, children, onSelect, tooltipProps, tooltipContent = 'Select model', menuToggleAriaLabel } = _a, props = __rest(_a, ["value", "className", "children", "onSelect", "tooltipProps", "tooltipContent", "menuToggleAriaLabel"]);
16
16
  const [isOptionsMenuOpen, setIsOptionsMenuOpen] = React.useState(false);
17
- const [defaultAriaLabel, setDefaultAriaLabel] = React.useState('Chatbot selector');
17
+ const [defaultAriaLabel, setDefaultAriaLabel] = React.useState('Select model');
18
18
  const toggle = (toggleRef) => (React.createElement(Tooltip, Object.assign({ className: "pf-chatbot__tooltip", content: tooltipContent, position: "bottom",
19
19
  // prevents VO announcements of both aria label and tooltip
20
20
  aria: "none" }, tooltipProps),
21
21
  React.createElement(MenuToggle, { variant: "secondary", "aria-label": menuToggleAriaLabel !== null && menuToggleAriaLabel !== void 0 ? menuToggleAriaLabel : defaultAriaLabel, ref: toggleRef, isExpanded: isOptionsMenuOpen, onClick: () => setIsOptionsMenuOpen(!isOptionsMenuOpen) }, value)));
22
22
  return (React.createElement(Dropdown, Object.assign({ className: `pf-chatbot__selections ${className !== null && className !== void 0 ? className : ''}`, isOpen: isOptionsMenuOpen, onSelect: (e, value) => {
23
23
  onSelect && onSelect(e, value);
24
- setDefaultAriaLabel(`Chatbot selector: ${value}`);
24
+ setDefaultAriaLabel(`Select model: ${value}`);
25
25
  setIsOptionsMenuOpen(false);
26
26
  }, onOpenChange: (isOpen) => setIsOptionsMenuOpen(isOpen), popperProps: { position: 'right', appendTo: 'inline' }, shouldFocusToggleOnSelect: true, shouldFocusFirstItemOnOpen: true, toggle: toggle }, props), children));
27
27
  };
@@ -18,13 +18,13 @@ describe('ChatbotHeaderSelectorDropdown', () => {
18
18
  React.createElement(DropdownItem, null, "Option 3")));
19
19
  it('should render ChatbotHeaderSelectorDropdown', () => {
20
20
  render(React.createElement(ChatbotHeaderSelectorDropdown, { value: "Option 1" }, dropdownItems));
21
- expect(screen.getByRole('button', { name: 'Chatbot selector' })).toBeTruthy();
21
+ expect(screen.getByRole('button', { name: /Select model/i })).toBeTruthy();
22
22
  });
23
23
  it('should call onselect handler when a dropdown item is clicked', () => __awaiter(void 0, void 0, void 0, function* () {
24
24
  const onSelect = jest.fn();
25
25
  const { container } = render(React.createElement(ChatbotHeaderSelectorDropdown, { value: "Option 1", className: "custom-header-selector-dropdown", onSelect: onSelect }, dropdownItems));
26
26
  act(() => {
27
- fireEvent.click(screen.getByRole('button', { name: 'Chatbot selector' }));
27
+ fireEvent.click(screen.getByRole('button', { name: /Select model/i }));
28
28
  });
29
29
  yield waitFor(() => {
30
30
  expect(container.querySelector('.custom-header-selector-dropdown')).toBeTruthy();
@@ -14,30 +14,38 @@ import ChatbotWelcomePrompt from './ChatbotWelcomePrompt';
14
14
  import userEvent from '@testing-library/user-event';
15
15
  describe('ChatbotWelcomePrompt', () => {
16
16
  it('should render welcome prompt', () => {
17
- const { container } = render(React.createElement(ChatbotWelcomePrompt, { title: "Hello, Chatbot User", description: "How may I help you today?" }));
17
+ const { container } = render(React.createElement(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?" }));
18
18
  expect(container).toMatchSnapshot();
19
19
  });
20
20
  it('should render correctly', () => {
21
- render(React.createElement(ChatbotWelcomePrompt, { title: "Hello, Chatbot User", description: "How may I help you today?" }));
22
- expect(screen.getByText('Hello, Chatbot User')).toBeTruthy();
23
- expect(screen.getByText('How may I help you today?')).toBeTruthy();
21
+ render(React.createElement(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?" }));
22
+ expect(screen.getByText('Hi, ChatBot User!')).toBeTruthy();
23
+ expect(screen.getByText('How can I help you today?')).toBeTruthy();
24
24
  });
25
25
  it('should render prompts with titles correctly', () => {
26
- render(React.createElement(ChatbotWelcomePrompt, { title: "Hello, Chatbot User", description: "How may I help you today?", prompts: [{ title: 'Topic 1' }] }));
27
- expect(screen.getByText('Topic 1')).toBeTruthy();
26
+ render(React.createElement(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [{ title: 'Set up account' }] }));
27
+ expect(screen.getByText('Set up account')).toBeTruthy();
28
28
  });
29
29
  it('should render prompts with messages correctly', () => {
30
- render(React.createElement(ChatbotWelcomePrompt, { title: "Hello, Chatbot User", description: "How may I help you today?", prompts: [{ title: 'Topic 1', message: 'Helpful prompt for Topic 1' }] }));
31
- expect(screen.getByText('Helpful prompt for Topic 1')).toBeTruthy();
30
+ render(React.createElement(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [
31
+ { title: 'Set up account', message: 'Choose the necessary settings and preferences for your account.' }
32
+ ] }));
33
+ expect(screen.getByText('Choose the necessary settings and preferences for your account.')).toBeTruthy();
32
34
  });
33
35
  it('should render prompts with onClick correctly', () => __awaiter(void 0, void 0, void 0, function* () {
34
36
  const spy = jest.fn();
35
- render(React.createElement(ChatbotWelcomePrompt, { title: "Hello, Chatbot User", description: "How may I help you today?", prompts: [{ title: 'Topic 1', message: 'Helpful prompt for Topic 1', onClick: spy }] }));
36
- yield userEvent.click(screen.getByRole('button', { name: /Topic 1/i }));
37
+ render(React.createElement(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", prompts: [
38
+ {
39
+ title: 'Set up account',
40
+ message: 'Choose the necessary settings and preferences for your account.',
41
+ onClick: spy
42
+ }
43
+ ] }));
44
+ yield userEvent.click(screen.getByRole('button', { name: /Set up account/i }));
37
45
  expect(spy).toHaveBeenCalled();
38
46
  }));
39
47
  it('should apply className appropriately', () => {
40
- render(React.createElement(ChatbotWelcomePrompt, { title: "Hello, Chatbot User", description: "How may I help you today?", className: "test", testId: "welcome-prompt" }));
48
+ render(React.createElement(ChatbotWelcomePrompt, { title: "Hi, ChatBot User!", description: "How can I help you today?", className: "test", testId: "welcome-prompt" }));
41
49
  const element = screen.getByTestId('welcome-prompt');
42
50
  expect(element).toHaveClass('test');
43
51
  });
@@ -83,7 +83,7 @@ describe('ResponseActions', () => {
83
83
  }));
84
84
  it('should handle click outside of group of buttons correctly', () => __awaiter(void 0, void 0, void 0, function* () {
85
85
  // using message just so we have something outside the group that's rendered
86
- render(React.createElement(Message, { name: "Bot", role: "bot", avatar: "", content: "Example with all prebuilt actions", actions: {
86
+ render(React.createElement(Message, { name: "Bot", role: "bot", avatar: "", content: "I updated your account with those settings. You're ready to set up your first dashboard!", actions: {
87
87
  positive: {},
88
88
  negative: {}
89
89
  } }));
@@ -97,7 +97,7 @@ describe('ResponseActions', () => {
97
97
  yield userEvent.click(badBtn);
98
98
  expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass('pf-chatbot__button--response-action-clicked');
99
99
  expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
100
- yield userEvent.click(screen.getByText('Example with all prebuilt actions'));
100
+ yield userEvent.click(screen.getByText("I updated your account with those settings. You're ready to set up your first dashboard!"));
101
101
  expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
102
102
  expect(badBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
103
103
  }));
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.test.tsx","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.test.tsx","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.test.tsx","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.test.tsx","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.test.tsx","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFooternote.test.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.test.tsx","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.test.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.tsx","../src/ChatbotHeader/ChatbotHeaderMain.test.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.test.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.test.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.test.tsx","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/Compare/Compare.test.tsx","../src/Compare/Compare.tsx","../src/Compare/index.ts","../src/FileDetails/FileDetails.test.tsx","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.test.tsx","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.test.tsx","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/LoadingMessage/LoadingMessage.test.tsx","../src/LoadingMessage/LoadingMessage.tsx","../src/LoadingMessage/index.ts","../src/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ImageMessage/ImageMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/QuickResponse/QuickResponse.tsx","../src/Message/QuickStarts/FallbackImg.tsx","../src/Message/QuickStarts/QuickStartTile.tsx","../src/Message/QuickStarts/QuickStartTileDescription.test.tsx","../src/Message/QuickStarts/QuickStartTileDescription.tsx","../src/Message/QuickStarts/QuickStartTileHeader.tsx","../src/Message/QuickStarts/monitor-sampleapp-quickstart-with-image.ts","../src/Message/QuickStarts/monitor-sampleapp-quickstart.ts","../src/Message/QuickStarts/types.ts","../src/Message/TableMessage/TableMessage.tsx","../src/Message/TableMessage/TbodyMessage.tsx","../src/Message/TableMessage/TdMessage.tsx","../src/Message/TableMessage/ThMessage.tsx","../src/Message/TableMessage/TheadMessage.tsx","../src/Message/TableMessage/TrMessage.tsx","../src/Message/TextMessage/TextMessage.tsx","../src/Message/UserFeedback/CloseButton.tsx","../src/Message/UserFeedback/UserFeedback.test.tsx","../src/Message/UserFeedback/UserFeedback.tsx","../src/Message/UserFeedback/UserFeedbackComplete.test.tsx","../src/Message/UserFeedback/UserFeedbackComplete.tsx","../src/MessageBar/AttachButton.test.tsx","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.test.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.test.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.test.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.test.tsx","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.test.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/PreviewAttachment/PreviewAttachment.test.tsx","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.test.tsx","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.test.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/index.ts","../src/Settings/SettingsForm.test.tsx","../src/Settings/SettingsForm.tsx","../src/Settings/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.test.tsx","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/TermsOfUse/TermsOfUse.test.tsx","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts","../src/__mocks__/rehype-unwrap-images.tsx"],"version":"5.6.3"}
1
+ {"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.test.tsx","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.test.tsx","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.test.tsx","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.test.tsx","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/EmptyState.tsx","../src/ChatbotConversationHistoryNav/LoadingState.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.test.tsx","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFooternote.test.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.test.tsx","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.test.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.tsx","../src/ChatbotHeader/ChatbotHeaderMain.test.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.test.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.test.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.test.tsx","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/Compare/Compare.test.tsx","../src/Compare/Compare.tsx","../src/Compare/index.ts","../src/FileDetails/FileDetails.test.tsx","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.test.tsx","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.test.tsx","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/LoadingMessage/LoadingMessage.test.tsx","../src/LoadingMessage/LoadingMessage.tsx","../src/LoadingMessage/index.ts","../src/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ImageMessage/ImageMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/QuickResponse/QuickResponse.tsx","../src/Message/QuickStarts/FallbackImg.tsx","../src/Message/QuickStarts/QuickStartTile.tsx","../src/Message/QuickStarts/QuickStartTileDescription.test.tsx","../src/Message/QuickStarts/QuickStartTileDescription.tsx","../src/Message/QuickStarts/QuickStartTileHeader.tsx","../src/Message/QuickStarts/monitor-sampleapp-quickstart-with-image.ts","../src/Message/QuickStarts/monitor-sampleapp-quickstart.ts","../src/Message/QuickStarts/types.ts","../src/Message/TableMessage/TableMessage.tsx","../src/Message/TableMessage/TbodyMessage.tsx","../src/Message/TableMessage/TdMessage.tsx","../src/Message/TableMessage/ThMessage.tsx","../src/Message/TableMessage/TheadMessage.tsx","../src/Message/TableMessage/TrMessage.tsx","../src/Message/TextMessage/TextMessage.tsx","../src/Message/UserFeedback/CloseButton.tsx","../src/Message/UserFeedback/UserFeedback.test.tsx","../src/Message/UserFeedback/UserFeedback.tsx","../src/Message/UserFeedback/UserFeedbackComplete.test.tsx","../src/Message/UserFeedback/UserFeedbackComplete.tsx","../src/MessageBar/AttachButton.test.tsx","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.test.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.test.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.test.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.test.tsx","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.test.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/PreviewAttachment/PreviewAttachment.test.tsx","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.test.tsx","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.test.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/index.ts","../src/Settings/SettingsForm.test.tsx","../src/Settings/SettingsForm.tsx","../src/Settings/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.test.tsx","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/TermsOfUse/TermsOfUse.test.tsx","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts","../src/__mocks__/rehype-unwrap-images.tsx"],"version":"5.6.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/chatbot",
3
- "version": "2.2.0-prerelease.26",
3
+ "version": "2.2.0-prerelease.28",
4
4
  "description": "This library provides React components based on PatternFly 6 that can be used to build chatbots.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -6,8 +6,8 @@ export const AttachmentErrorExample: React.FunctionComponent = () => (
6
6
  variant="danger"
7
7
  // eslint-disable-next-line no-console
8
8
  onClose={() => console.log('Clicked the close button')}
9
- title="File upload failed"
9
+ title="Could not upload file"
10
10
  >
11
- Your file size is too large. Please ensure that your file is less than 25 MB.
11
+ Your file size must be less than 25 MB.
12
12
  </ChatbotAlert>
13
13
  );
@@ -117,8 +117,8 @@ _Italic text, formatted with single underscores_
117
117
 
118
118
  1. **Using a \`toaster\`:**
119
119
 
120
- - Place \`bread\` in a \`toaster\`
121
- - Once \`bread\` is lightly browned, remove from \`toaster\`
120
+ - Place \`bread\` in a \`toaster\`.
121
+ - Once \`bread\` is lightly browned, remove from \`toaster\`.
122
122
 
123
123
  2. **Using a \`knife\`:**
124
124
 
@@ -142,19 +142,32 @@ _Italic text, formatted with single underscores_
142
142
 
143
143
  return (
144
144
  <>
145
- <Message name="Bot" role="bot" avatar={patternflyAvatar} content={`Text-based message from a bot named "Bot"`} />
146
- <Message role="bot" avatar={patternflyAvatar} content="Text-based message from a nameless bot" />
145
+ <Message
146
+ name="Bot"
147
+ role="bot"
148
+ avatar={patternflyAvatar}
149
+ content={`This is a text-based message from a bot named "Bot."`}
150
+ />
151
+ <Message
152
+ name="Bot"
153
+ role="bot"
154
+ avatar={patternflyAvatar}
155
+ content={`This is a text-based message from "Bot," with an updated timestamp.`}
156
+ timestamp="1 hour ago"
157
+ />
158
+ <Message name="Bot" role="bot" avatar={patternflyAvatar} content="Example content" isLoading />
159
+ <Message role="bot" avatar={patternflyAvatar} content="This message is from a nameless bot." />
147
160
  <Message
148
161
  name="Default Openshift Container Platform Assistant That Can Help With Any Query You Might Need Help With"
149
162
  role="bot"
150
163
  avatar={patternflyAvatar}
151
- content="Text-based message, where the bot's name is truncated"
164
+ content="This is a message from a bot with really long name: it's truncated!"
152
165
  />
153
166
  <Message
154
167
  name="Bot"
155
168
  role="bot"
156
169
  avatar={squareImg}
157
- content="Text-based message from a bot with a square avatar. You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`."
170
+ content="This bot has a square avatar. You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`."
158
171
  hasRoundAvatar={false}
159
172
  />
160
173
  <Message
@@ -53,7 +53,8 @@ export const DropzoneExample: React.FunctionComponent = () => {
53
53
  return (
54
54
  <FileDropZone onFileDrop={handleFileDrop} displayMode="fullscreen">
55
55
  <div className="pf-chatbot__file-drop-zone-example">
56
- Content that shows when no dragging is happening (drag an item here to see the drop zone)
56
+ This is example content that would be shown when no dragging is happening. To see the drop zone, start to drag
57
+ an item into this section. The static content will be replaced by an active drop zone message.
57
58
  </div>
58
59
  </FileDropZone>
59
60
  );
@@ -32,14 +32,14 @@ export const AttachmentMenuExample: React.FunctionComponent = () => {
32
32
  name="User"
33
33
  role="user"
34
34
  avatar={userAvatar}
35
- content="Here is an uploaded file"
35
+ content="Here is an uploaded file:"
36
36
  attachments={[{ name: 'auth-operator.yml', id: '1', onClick, onClose }]}
37
37
  />
38
38
  <Message
39
39
  name="User"
40
40
  role="user"
41
41
  avatar={userAvatar}
42
- content="Here are two uploaded files"
42
+ content="Here are 2 uploaded files:"
43
43
  attachments={[
44
44
  { name: 'auth-operator.yml', id: '1' },
45
45
  { name: 'patternfly.svg', id: '2' }
@@ -11,7 +11,7 @@ export const CustomActionExample: React.FunctionComponent = () => (
11
11
  name="Bot"
12
12
  role="bot"
13
13
  avatar={patternflyAvatar}
14
- content="Example with custom actions"
14
+ content="I updated your account with those settings. You're ready to set up your first dashboard!"
15
15
  actions={{
16
16
  regenerate: {
17
17
  ariaLabel: 'Regenerate',
@@ -31,7 +31,7 @@ export const MessageWithQuickResponsesExample: React.FunctionComponent = () => (
31
31
  name="Bot"
32
32
  role="bot"
33
33
  avatar={patternflyAvatar}
34
- content="Welcome back! How can I help?"
34
+ content="Welcome back, User! How can I help you today?"
35
35
  quickResponses={[
36
36
  { id: '1', content: 'Help me with an access issue', onClick: () => alert('Clicked id 1') },
37
37
  { id: '2', content: 'Show my critical vulnerabilities', onClick: () => alert('Clicked id 2') },
@@ -11,7 +11,7 @@ export const MessageWithQuickStartExample: React.FunctionComponent = () => (
11
11
  name="Bot"
12
12
  role="bot"
13
13
  avatar={patternflyAvatar}
14
- content="Text-based bot message with a quick start tile."
14
+ content="Follow this quick guide to install the Pipelines Operator."
15
15
  quickStarts={{
16
16
  quickStart: explorePipelinesQuickStart as QuickStart,
17
17
  onSelectQuickStart: (id) => alert(id)
@@ -21,7 +21,7 @@ export const MessageWithQuickStartExample: React.FunctionComponent = () => (
21
21
  name="Bot"
22
22
  role="bot"
23
23
  avatar={patternflyAvatar}
24
- content="Text-based bot message with a quick start tile that includes prerequisites and a default icon."
24
+ content="This quick start tile includes prerequisites and a default icon."
25
25
  quickStarts={{
26
26
  quickStart: monitorSampleAppQuickStart,
27
27
  onSelectQuickStart: (id) => alert(id)
@@ -8,7 +8,7 @@ export const ResponseActionExample: React.FunctionComponent = () => (
8
8
  name="Bot"
9
9
  role="bot"
10
10
  avatar={patternflyAvatar}
11
- content="Example with all prebuilt actions"
11
+ content="I updated your account with those settings. You're ready to set up your first dashboard!"
12
12
  actions={{
13
13
  // eslint-disable-next-line no-console
14
14
  positive: { onClick: () => console.log('Good response') },
@@ -61,7 +61,7 @@ export const MessageWithSourcesExample: React.FunctionComponent = () => {
61
61
  name="Bot"
62
62
  role="bot"
63
63
  avatar={patternflyAvatar}
64
- content="Example with only one source"
64
+ content="Example with only 1 source"
65
65
  sources={{
66
66
  sources: [
67
67
  {
@@ -145,14 +145,14 @@ _Italic text, formatted with single underscores_
145
145
  <Message
146
146
  name="User"
147
147
  role="user"
148
- content="Example content with updated timestamp text"
148
+ content="This is a user message with an updated timestamp."
149
149
  timestamp="1 hour ago"
150
150
  avatar={userAvatar}
151
151
  />
152
152
  <Message
153
153
  name="User"
154
154
  role="user"
155
- content="Example user message with `avatarProps` set to add a border"
155
+ content="This is a user message with `avatarProps` set to add a border."
156
156
  avatar={userAvatar}
157
157
  avatarProps={{ isBordered: true }}
158
158
  />
@@ -5,20 +5,20 @@ export const FootnoteDemo: React.FunctionComponent = () => (
5
5
  <ChatbotFootnote
6
6
  label="ChatBot uses AI. Check for mistakes."
7
7
  popover={{
8
- title: 'Verify accuracy',
9
- description: `While ChatBot strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,
8
+ title: 'Verify information',
9
+ description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
10
10
  bannerImage: {
11
11
  src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
12
12
  alt: 'Example image for footnote popover'
13
13
  },
14
14
  cta: {
15
- label: 'Got it',
15
+ label: 'Dismiss',
16
16
  onClick: () => {
17
17
  alert('Do something!');
18
18
  }
19
19
  },
20
20
  link: {
21
- label: 'Learn more',
21
+ label: 'View AI policy',
22
22
  url: 'https://www.redhat.com/'
23
23
  }
24
24
  }}