@patternfly/chatbot 6.3.0-prerelease.2 → 6.3.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/AttachMenu/AttachMenu.d.ts +2 -2
- package/dist/cjs/AttachMenu/AttachMenu.js +2 -12
- package/dist/cjs/AttachmentEdit/AttachmentEdit.d.ts +14 -2
- package/dist/cjs/AttachmentEdit/AttachmentEdit.js +3 -6
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +1 -1
- package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +33 -8
- package/dist/cjs/Chatbot/Chatbot.d.ts +3 -2
- package/dist/cjs/Chatbot/Chatbot.js +5 -10
- package/dist/cjs/Chatbot/Chatbot.test.js +13 -9
- package/dist/cjs/ChatbotAlert/ChatbotAlert.d.ts +2 -2
- package/dist/cjs/ChatbotAlert/ChatbotAlert.js +4 -8
- package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +10 -10
- package/dist/cjs/ChatbotContent/ChatbotContent.d.ts +3 -3
- package/dist/cjs/ChatbotContent/ChatbotContent.js +2 -8
- package/dist/cjs/ChatbotContent/ChatbotContent.test.js +5 -5
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +7 -11
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +31 -33
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +4 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +17 -34
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +58 -62
- package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.d.ts +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.js +2 -9
- package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.d.ts +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.js +2 -25
- package/dist/cjs/ChatbotFooter/ChatbotFooter.d.ts +4 -3
- package/dist/cjs/ChatbotFooter/ChatbotFooter.js +3 -16
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +1 -1
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +10 -5
- package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +28 -28
- package/dist/cjs/ChatbotFooter/ChatbotFootnote.d.ts +3 -3
- package/dist/cjs/ChatbotFooter/ChatbotFootnote.js +10 -23
- package/dist/cjs/ChatbotHeader/ChatbotHeader.d.ts +3 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeader.js +2 -7
- package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +5 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.d.ts +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.js +2 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +5 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +5 -4
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +19 -10
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +10 -8
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.d.ts +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.js +2 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +5 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.d.ts +5 -4
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +20 -8
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +10 -8
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +7 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +22 -19
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +9 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +11 -12
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -1
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +20 -17
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.d.ts +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.js +2 -5
- package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +23 -23
- package/dist/cjs/ChatbotModal/ChatbotModal.d.ts +5 -2
- package/dist/cjs/ChatbotModal/ChatbotModal.js +4 -10
- package/dist/cjs/ChatbotModal/ChatbotModal.test.d.ts +1 -0
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +16 -0
- package/dist/cjs/ChatbotPopover/ChatbotPopover.d.ts +2 -2
- package/dist/cjs/ChatbotPopover/ChatbotPopover.js +2 -8
- package/dist/cjs/ChatbotToggle/ChatbotToggle.d.ts +1 -2
- package/dist/cjs/ChatbotToggle/ChatbotToggle.js +8 -13
- package/dist/cjs/ChatbotToggle/ChatbotToggle.test.js +25 -25
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.d.ts +3 -2
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +7 -21
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +18 -14
- package/dist/cjs/CodeModal/CodeModal.d.ts +10 -2
- package/dist/cjs/CodeModal/CodeModal.js +8 -20
- package/dist/cjs/CodeModal/CodeModal.test.d.ts +1 -0
- package/dist/cjs/CodeModal/CodeModal.test.js +34 -0
- package/dist/cjs/Compare/Compare.d.ts +2 -2
- package/dist/cjs/Compare/Compare.js +7 -16
- package/dist/cjs/Compare/Compare.test.js +7 -9
- package/dist/cjs/FileDetails/FileDetails.d.ts +2 -2
- package/dist/cjs/FileDetails/FileDetails.js +2 -15
- package/dist/cjs/FileDetails/FileDetails.test.js +10 -10
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.d.ts +2 -2
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.js +2 -5
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.test.js +21 -21
- package/dist/cjs/FileDropZone/FileDropZone.d.ts +9 -2
- package/dist/cjs/FileDropZone/FileDropZone.js +6 -9
- package/dist/cjs/FileDropZone/FileDropZone.test.js +31 -5
- package/dist/cjs/LoadingMessage/LoadingMessage.d.ts +2 -2
- package/dist/cjs/LoadingMessage/LoadingMessage.js +2 -10
- package/dist/cjs/LoadingMessage/LoadingMessage.test.js +6 -6
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.d.ts +20 -3
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +22 -16
- package/dist/cjs/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.d.ts +62 -0
- package/dist/cjs/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.js +136 -0
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +1 -2
- package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +5 -8
- package/dist/cjs/Message/ImageMessage/ImageMessage.d.ts +1 -2
- package/dist/cjs/Message/ImageMessage/ImageMessage.js +2 -8
- package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +1 -2
- package/dist/cjs/Message/LinkMessage/LinkMessage.js +6 -9
- package/dist/cjs/Message/ListMessage/ListItemMessage.d.ts +1 -2
- package/dist/cjs/Message/ListMessage/ListItemMessage.js +2 -8
- package/dist/cjs/Message/ListMessage/OrderedListMessage.d.ts +1 -2
- package/dist/cjs/Message/ListMessage/OrderedListMessage.js +2 -9
- package/dist/cjs/Message/ListMessage/UnorderedListMessage.d.ts +1 -2
- package/dist/cjs/Message/ListMessage/UnorderedListMessage.js +2 -9
- package/dist/cjs/Message/Message.d.ts +26 -8
- package/dist/cjs/Message/Message.js +50 -72
- package/dist/cjs/Message/Message.test.js +119 -81
- package/dist/cjs/Message/MessageInput.d.ts +2 -2
- package/dist/cjs/Message/MessageInput.js +5 -14
- package/dist/cjs/Message/MessageLoading.d.ts +1 -2
- package/dist/cjs/Message/MessageLoading.js +3 -8
- package/dist/cjs/Message/Plugins/rehypeMoveImagesOutOfParagraphs.d.ts +2 -0
- package/dist/cjs/Message/Plugins/rehypeMoveImagesOutOfParagraphs.js +47 -0
- package/dist/cjs/Message/QuickResponse/QuickResponse.d.ts +4 -2
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +8 -10
- package/dist/cjs/Message/QuickStarts/FallbackImg.d.ts +2 -2
- package/dist/cjs/Message/QuickStarts/FallbackImg.js +5 -27
- package/dist/cjs/Message/QuickStarts/QuickStartTile.d.ts +4 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTile.js +8 -44
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.d.ts +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.js +9 -38
- package/dist/cjs/Message/QuickStarts/QuickStartTileDescription.test.js +16 -16
- package/dist/cjs/Message/QuickStarts/QuickStartTileHeader.d.ts +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTileHeader.js +2 -26
- package/dist/cjs/Message/QuickStarts/types.d.ts +4 -3
- package/dist/cjs/Message/TableMessage/TableMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/TableMessage.js +8 -10
- package/dist/cjs/Message/TableMessage/TbodyMessage.d.ts +2 -3
- package/dist/cjs/Message/TableMessage/TbodyMessage.js +7 -9
- package/dist/cjs/Message/TableMessage/TdMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/TdMessage.js +2 -8
- package/dist/cjs/Message/TableMessage/ThMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/ThMessage.js +2 -8
- package/dist/cjs/Message/TableMessage/TheadMessage.d.ts +1 -2
- package/dist/cjs/Message/TableMessage/TheadMessage.js +2 -8
- package/dist/cjs/Message/TableMessage/TrMessage.d.ts +2 -3
- package/dist/cjs/Message/TableMessage/TrMessage.js +8 -10
- package/dist/cjs/Message/TextMessage/TextMessage.d.ts +1 -2
- package/dist/cjs/Message/TextMessage/TextMessage.js +2 -9
- package/dist/cjs/Message/UserFeedback/CloseButton.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/CloseButton.js +2 -8
- package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedback.js +13 -24
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +55 -51
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +21 -45
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +83 -89
- package/dist/cjs/MessageBar/AttachButton.d.ts +9 -2
- package/dist/cjs/MessageBar/AttachButton.js +9 -17
- package/dist/cjs/MessageBar/AttachButton.test.js +50 -22
- package/dist/cjs/MessageBar/MessageBar.d.ts +16 -3
- package/dist/cjs/MessageBar/MessageBar.js +36 -37
- package/dist/cjs/MessageBar/MessageBar.test.js +122 -108
- package/dist/cjs/MessageBar/MicrophoneButton.d.ts +3 -2
- package/dist/cjs/MessageBar/MicrophoneButton.js +8 -15
- package/dist/cjs/MessageBar/SendButton.d.ts +4 -2
- package/dist/cjs/MessageBar/SendButton.js +4 -12
- package/dist/cjs/MessageBar/SendButton.test.js +18 -14
- package/dist/cjs/MessageBar/StopButton.d.ts +4 -2
- package/dist/cjs/MessageBar/StopButton.js +4 -13
- package/dist/cjs/MessageBar/StopButton.test.js +18 -14
- package/dist/cjs/MessageBox/JumpButton.d.ts +2 -2
- package/dist/cjs/MessageBox/JumpButton.js +2 -10
- package/dist/cjs/MessageBox/JumpButton.test.js +10 -10
- package/dist/cjs/MessageBox/MessageBox.d.ts +21 -5
- package/dist/cjs/MessageBox/MessageBox.js +181 -44
- package/dist/cjs/MessageBox/MessageBox.test.js +219 -6
- package/dist/cjs/PreviewAttachment/PreviewAttachment.d.ts +14 -2
- package/dist/cjs/PreviewAttachment/PreviewAttachment.js +3 -6
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +1 -1
- package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +34 -12
- package/dist/cjs/ResponseActions/ResponseActionButton.d.ts +5 -5
- package/dist/cjs/ResponseActions/ResponseActionButton.js +5 -8
- package/dist/cjs/ResponseActions/ResponseActionButton.test.js +19 -19
- package/dist/cjs/ResponseActions/ResponseActions.d.ts +6 -3
- package/dist/cjs/ResponseActions/ResponseActions.js +10 -14
- package/dist/cjs/ResponseActions/ResponseActions.test.js +55 -40
- package/dist/cjs/Settings/SettingsForm.d.ts +4 -2
- package/dist/cjs/Settings/SettingsForm.js +3 -9
- package/dist/cjs/Settings/SettingsForm.test.d.ts +1 -1
- package/dist/cjs/Settings/SettingsForm.test.js +18 -9
- package/dist/cjs/SourceDetailsMenuItem/SourceDetailsMenuItem.d.ts +2 -2
- package/dist/cjs/SourceDetailsMenuItem/SourceDetailsMenuItem.js +2 -11
- package/dist/cjs/SourcesCard/SourcesCard.d.ts +2 -2
- package/dist/cjs/SourcesCard/SourcesCard.js +17 -43
- package/dist/cjs/SourcesCard/SourcesCard.test.js +60 -60
- package/dist/cjs/TermsOfUse/TermsOfUse.d.ts +5 -3
- package/dist/cjs/TermsOfUse/TermsOfUse.js +5 -17
- package/dist/cjs/TermsOfUse/TermsOfUse.test.js +31 -33
- package/dist/css/main.css +228 -15
- package/dist/css/main.css.map +1 -1
- package/dist/esm/AttachMenu/AttachMenu.d.ts +2 -2
- package/dist/esm/AttachMenu/AttachMenu.js +2 -9
- package/dist/esm/AttachmentEdit/AttachmentEdit.d.ts +14 -2
- package/dist/esm/AttachmentEdit/AttachmentEdit.js +3 -6
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +1 -1
- package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +30 -5
- package/dist/esm/Chatbot/Chatbot.d.ts +3 -2
- package/dist/esm/Chatbot/Chatbot.js +5 -7
- package/dist/esm/Chatbot/Chatbot.test.js +9 -5
- package/dist/esm/ChatbotAlert/ChatbotAlert.d.ts +2 -2
- package/dist/esm/ChatbotAlert/ChatbotAlert.js +4 -5
- package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +4 -4
- package/dist/esm/ChatbotContent/ChatbotContent.d.ts +3 -3
- package/dist/esm/ChatbotContent/ChatbotContent.js +2 -5
- package/dist/esm/ChatbotContent/ChatbotContent.test.js +3 -3
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +7 -11
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.js +8 -10
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +4 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +17 -34
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +29 -33
- package/dist/esm/ChatbotConversationHistoryNav/EmptyState.d.ts +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/EmptyState.js +2 -6
- package/dist/esm/ChatbotConversationHistoryNav/LoadingState.d.ts +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/LoadingState.js +2 -22
- package/dist/esm/ChatbotFooter/ChatbotFooter.d.ts +4 -3
- package/dist/esm/ChatbotFooter/ChatbotFooter.js +3 -13
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +1 -1
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +8 -3
- package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +5 -5
- package/dist/esm/ChatbotFooter/ChatbotFootnote.d.ts +3 -3
- package/dist/esm/ChatbotFooter/ChatbotFootnote.js +10 -23
- package/dist/esm/ChatbotHeader/ChatbotHeader.d.ts +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeader.js +2 -4
- package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.d.ts +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +5 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +20 -8
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +8 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.d.ts +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +3 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.d.ts +5 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +20 -8
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +8 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +7 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +13 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +9 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +11 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +13 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.d.ts +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.js +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +12 -12
- package/dist/esm/ChatbotModal/ChatbotModal.d.ts +5 -2
- package/dist/esm/ChatbotModal/ChatbotModal.js +4 -7
- package/dist/esm/ChatbotModal/ChatbotModal.test.d.ts +1 -0
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +11 -0
- package/dist/esm/ChatbotPopover/ChatbotPopover.d.ts +2 -2
- package/dist/esm/ChatbotPopover/ChatbotPopover.js +2 -5
- package/dist/esm/ChatbotToggle/ChatbotToggle.d.ts +1 -2
- package/dist/esm/ChatbotToggle/ChatbotToggle.js +8 -13
- package/dist/esm/ChatbotToggle/ChatbotToggle.test.js +8 -8
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.d.ts +3 -2
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +7 -18
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +11 -7
- package/dist/esm/CodeModal/CodeModal.d.ts +10 -2
- package/dist/esm/CodeModal/CodeModal.js +8 -20
- package/dist/esm/CodeModal/CodeModal.test.d.ts +1 -0
- package/dist/esm/CodeModal/CodeModal.test.js +29 -0
- package/dist/esm/Compare/Compare.d.ts +2 -2
- package/dist/esm/Compare/Compare.js +7 -13
- package/dist/esm/Compare/Compare.test.js +4 -6
- package/dist/esm/FileDetails/FileDetails.d.ts +2 -2
- package/dist/esm/FileDetails/FileDetails.js +2 -15
- package/dist/esm/FileDetails/FileDetails.test.js +4 -4
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.d.ts +2 -2
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.js +2 -5
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.test.js +9 -9
- package/dist/esm/FileDropZone/FileDropZone.d.ts +9 -2
- package/dist/esm/FileDropZone/FileDropZone.js +6 -6
- package/dist/esm/FileDropZone/FileDropZone.test.js +29 -3
- package/dist/esm/LoadingMessage/LoadingMessage.d.ts +2 -2
- package/dist/esm/LoadingMessage/LoadingMessage.js +2 -10
- package/dist/esm/LoadingMessage/LoadingMessage.test.js +3 -3
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.d.ts +20 -3
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +23 -17
- package/dist/esm/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.d.ts +62 -0
- package/dist/esm/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.js +130 -0
- package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +1 -2
- package/dist/esm/Message/ErrorMessage/ErrorMessage.js +5 -5
- package/dist/esm/Message/ImageMessage/ImageMessage.d.ts +1 -2
- package/dist/esm/Message/ImageMessage/ImageMessage.js +2 -5
- package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +1 -2
- package/dist/esm/Message/LinkMessage/LinkMessage.js +6 -6
- package/dist/esm/Message/ListMessage/ListItemMessage.d.ts +1 -2
- package/dist/esm/Message/ListMessage/ListItemMessage.js +2 -5
- package/dist/esm/Message/ListMessage/OrderedListMessage.d.ts +1 -2
- package/dist/esm/Message/ListMessage/OrderedListMessage.js +2 -6
- package/dist/esm/Message/ListMessage/UnorderedListMessage.d.ts +1 -2
- package/dist/esm/Message/ListMessage/UnorderedListMessage.js +2 -6
- package/dist/esm/Message/Message.d.ts +26 -8
- package/dist/esm/Message/Message.js +50 -72
- package/dist/esm/Message/Message.test.js +119 -81
- package/dist/esm/Message/MessageInput.d.ts +2 -2
- package/dist/esm/Message/MessageInput.js +5 -11
- package/dist/esm/Message/MessageLoading.d.ts +1 -2
- package/dist/esm/Message/MessageLoading.js +2 -4
- package/dist/esm/Message/Plugins/rehypeMoveImagesOutOfParagraphs.d.ts +2 -0
- package/dist/esm/Message/Plugins/rehypeMoveImagesOutOfParagraphs.js +43 -0
- package/dist/esm/Message/QuickResponse/QuickResponse.d.ts +4 -2
- package/dist/esm/Message/QuickResponse/QuickResponse.js +8 -7
- package/dist/esm/Message/QuickStarts/FallbackImg.d.ts +2 -2
- package/dist/esm/Message/QuickStarts/FallbackImg.js +5 -4
- package/dist/esm/Message/QuickStarts/QuickStartTile.d.ts +4 -2
- package/dist/esm/Message/QuickStarts/QuickStartTile.js +8 -21
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.d.ts +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.js +9 -15
- package/dist/esm/Message/QuickStarts/QuickStartTileDescription.test.js +5 -5
- package/dist/esm/Message/QuickStarts/QuickStartTileHeader.d.ts +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTileHeader.js +2 -3
- package/dist/esm/Message/QuickStarts/types.d.ts +4 -3
- package/dist/esm/Message/TableMessage/TableMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/TableMessage.js +8 -7
- package/dist/esm/Message/TableMessage/TbodyMessage.d.ts +2 -3
- package/dist/esm/Message/TableMessage/TbodyMessage.js +7 -6
- package/dist/esm/Message/TableMessage/TdMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/TdMessage.js +2 -5
- package/dist/esm/Message/TableMessage/ThMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/ThMessage.js +2 -5
- package/dist/esm/Message/TableMessage/TheadMessage.d.ts +1 -2
- package/dist/esm/Message/TableMessage/TheadMessage.js +2 -5
- package/dist/esm/Message/TableMessage/TrMessage.d.ts +2 -3
- package/dist/esm/Message/TableMessage/TrMessage.js +8 -7
- package/dist/esm/Message/TextMessage/TextMessage.d.ts +1 -2
- package/dist/esm/Message/TextMessage/TextMessage.js +2 -6
- package/dist/esm/Message/UserFeedback/CloseButton.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/CloseButton.js +2 -5
- package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedback.js +13 -24
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +24 -20
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +21 -45
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +29 -35
- package/dist/esm/MessageBar/AttachButton.d.ts +9 -2
- package/dist/esm/MessageBar/AttachButton.js +9 -14
- package/dist/esm/MessageBar/AttachButton.test.js +44 -16
- package/dist/esm/MessageBar/MessageBar.d.ts +16 -3
- package/dist/esm/MessageBar/MessageBar.js +34 -35
- package/dist/esm/MessageBar/MessageBar.test.js +87 -73
- package/dist/esm/MessageBar/MicrophoneButton.d.ts +3 -2
- package/dist/esm/MessageBar/MicrophoneButton.js +8 -12
- package/dist/esm/MessageBar/SendButton.d.ts +4 -2
- package/dist/esm/MessageBar/SendButton.js +4 -9
- package/dist/esm/MessageBar/SendButton.test.js +13 -9
- package/dist/esm/MessageBar/StopButton.d.ts +4 -2
- package/dist/esm/MessageBar/StopButton.js +4 -10
- package/dist/esm/MessageBar/StopButton.test.js +13 -9
- package/dist/esm/MessageBox/JumpButton.d.ts +2 -2
- package/dist/esm/MessageBox/JumpButton.js +2 -7
- package/dist/esm/MessageBox/JumpButton.test.js +9 -9
- package/dist/esm/MessageBox/MessageBox.d.ts +21 -5
- package/dist/esm/MessageBox/MessageBox.js +181 -44
- package/dist/esm/MessageBox/MessageBox.test.js +220 -7
- package/dist/esm/PreviewAttachment/PreviewAttachment.d.ts +14 -2
- package/dist/esm/PreviewAttachment/PreviewAttachment.js +3 -6
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +1 -1
- package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +30 -5
- package/dist/esm/ResponseActions/ResponseActionButton.d.ts +5 -5
- package/dist/esm/ResponseActions/ResponseActionButton.js +5 -5
- package/dist/esm/ResponseActions/ResponseActionButton.test.js +7 -7
- package/dist/esm/ResponseActions/ResponseActions.d.ts +6 -3
- package/dist/esm/ResponseActions/ResponseActions.js +10 -14
- package/dist/esm/ResponseActions/ResponseActions.test.js +30 -15
- package/dist/esm/Settings/SettingsForm.d.ts +4 -2
- package/dist/esm/Settings/SettingsForm.js +3 -6
- package/dist/esm/Settings/SettingsForm.test.d.ts +1 -1
- package/dist/esm/Settings/SettingsForm.test.js +16 -4
- package/dist/esm/SourceDetailsMenuItem/SourceDetailsMenuItem.d.ts +2 -2
- package/dist/esm/SourceDetailsMenuItem/SourceDetailsMenuItem.js +2 -8
- package/dist/esm/SourcesCard/SourcesCard.d.ts +2 -2
- package/dist/esm/SourcesCard/SourcesCard.js +17 -40
- package/dist/esm/SourcesCard/SourcesCard.test.js +19 -19
- package/dist/esm/TermsOfUse/TermsOfUse.d.ts +5 -3
- package/dist/esm/TermsOfUse/TermsOfUse.js +5 -17
- package/dist/esm/TermsOfUse/TermsOfUse.test.js +10 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -6
- package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +10 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Customizing Messages/Customizing Messages.md +51 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachMenu.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentEdit.tsx +14 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +19 -12
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDetails.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDetailsLabel.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDropZone.tsx +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithAttachment.tsx +7 -7
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +37 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +26 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +13 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +24 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/PreviewAttachment.tsx +14 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +20 -14
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotContainer.tsx +59 -36
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFooter.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +10 -13
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +18 -9
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerNavigation.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerResizable.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithActions.tsx +12 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithSelection.tsx +15 -6
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderTitle.tsx +59 -34
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBar.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarAttach.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarDisabled.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarLanguage.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarStop.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotModal.tsx +74 -37
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotToggleBasic.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +7 -7
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomePrompt.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/CompactSettings.tsx +282 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/CustomClosedIcon.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/Settings.tsx +16 -23
- package/patternfly-docs/content/extensions/chatbot/examples/UI/SkipToContent.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/UI/SquareChatbotToggle.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/UI/TermsOfUse.tsx +91 -48
- package/patternfly-docs/content/extensions/chatbot/examples/UI/TermsOfUseCompact.tsx +179 -0
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +17 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +37 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +9 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +17 -23
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +23 -14
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +14 -14
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +475 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +15 -20
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotScrolling.tsx +536 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +15 -20
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +12 -12
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +7 -7
- package/patternfly-docs/content/extensions/chatbot/img/quick-response-confirmation.svg +67 -0
- package/src/AttachMenu/AttachMenu.tsx +2 -2
- package/src/AttachmentEdit/AttachmentEdit.test.tsx +46 -2
- package/src/AttachmentEdit/AttachmentEdit.tsx +29 -7
- package/src/Chatbot/Chatbot.scss +7 -0
- package/src/Chatbot/Chatbot.test.tsx +9 -1
- package/src/Chatbot/Chatbot.tsx +9 -4
- package/src/ChatbotAlert/ChatbotAlert.test.tsx +0 -1
- package/src/ChatbotAlert/ChatbotAlert.tsx +2 -2
- package/src/ChatbotContent/ChatbotContent.test.tsx +0 -1
- package/src/ChatbotContent/ChatbotContent.tsx +3 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx +0 -1
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +6 -4
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +38 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +21 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +17 -8
- package/src/ChatbotConversationHistoryNav/EmptyState.tsx +2 -2
- package/src/ChatbotConversationHistoryNav/LoadingState.tsx +2 -2
- package/src/ChatbotFooter/ChatbotFooter.scss +5 -0
- package/src/ChatbotFooter/ChatbotFooter.test.tsx +10 -1
- package/src/ChatbotFooter/ChatbotFooter.tsx +6 -4
- package/src/ChatbotFooter/ChatbotFooternote.test.tsx +0 -1
- package/src/ChatbotFooter/ChatbotFootnote.tsx +6 -4
- package/src/ChatbotHeader/ChatbotHeader.scss +25 -0
- package/src/ChatbotHeader/ChatbotHeader.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeader.tsx +4 -7
- package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderActions.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +6 -1
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +17 -10
- package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderMain.tsx +5 -3
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +8 -1
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +17 -12
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +15 -1
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +17 -7
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +19 -1
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +30 -6
- package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +2 -2
- package/src/ChatbotModal/ChatbotModal.scss +15 -4
- package/src/ChatbotModal/ChatbotModal.test.tsx +58 -0
- package/src/ChatbotModal/ChatbotModal.tsx +7 -3
- package/src/ChatbotPopover/ChatbotPopover.scss +9 -5
- package/src/ChatbotPopover/ChatbotPopover.tsx +2 -2
- package/src/ChatbotToggle/ChatbotToggle.test.tsx +0 -1
- package/src/ChatbotToggle/ChatbotToggle.tsx +5 -3
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss +9 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +13 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx +15 -4
- package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +1 -1
- package/src/CodeModal/CodeModal.scss +11 -3
- package/src/CodeModal/CodeModal.test.tsx +51 -0
- package/src/CodeModal/CodeModal.tsx +24 -10
- package/src/Compare/Compare.test.tsx +0 -1
- package/src/Compare/Compare.tsx +7 -6
- package/src/FileDetails/FileDetails.test.tsx +0 -1
- package/src/FileDetails/FileDetails.tsx +2 -2
- package/src/FileDetails/__snapshots__/FileDetails.test.tsx.snap +1 -1
- package/src/FileDetailsLabel/FileDetailsLabel.test.tsx +0 -1
- package/src/FileDetailsLabel/FileDetailsLabel.tsx +1 -1
- package/src/FileDetailsLabel/__snapshots__/FileDetailsLabel.test.tsx.snap +1 -1
- package/src/FileDropZone/FileDropZone.test.tsx +29 -1
- package/src/FileDropZone/FileDropZone.tsx +13 -3
- package/src/LoadingMessage/LoadingMessage.test.tsx +0 -1
- package/src/LoadingMessage/LoadingMessage.tsx +2 -2
- package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +7 -0
- package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +105 -18
- package/src/Message/CodeBlockMessage/ExpandableSectionForSyntaxHighlighter.tsx +220 -0
- package/src/Message/ErrorMessage/ErrorMessage.tsx +0 -1
- package/src/Message/ImageMessage/ImageMessage.tsx +1 -2
- package/src/Message/LinkMessage/LinkMessage.tsx +0 -1
- package/src/Message/ListMessage/ListItemMessage.tsx +0 -1
- package/src/Message/ListMessage/OrderedListMessage.tsx +0 -1
- package/src/Message/ListMessage/UnorderedListMessage.tsx +0 -1
- package/src/Message/Message.scss +27 -0
- package/src/Message/Message.test.tsx +66 -6
- package/src/Message/Message.tsx +41 -17
- package/src/Message/MessageInput.tsx +5 -5
- package/src/Message/MessageLoading.tsx +0 -2
- package/src/Message/Plugins/rehypeMoveImagesOutOfParagraphs.ts +53 -0
- package/src/Message/QuickResponse/QuickResponse.tsx +9 -4
- package/src/Message/QuickStarts/FallbackImg.tsx +4 -3
- package/src/Message/QuickStarts/QuickStartTile.tsx +8 -4
- package/src/Message/QuickStarts/QuickStartTileDescription.test.tsx +0 -1
- package/src/Message/QuickStarts/QuickStartTileDescription.tsx +4 -3
- package/src/Message/QuickStarts/QuickStartTileHeader.tsx +2 -2
- package/src/Message/QuickStarts/types.ts +4 -3
- package/src/Message/TableMessage/TableMessage.tsx +4 -4
- package/src/Message/TableMessage/TbodyMessage.tsx +3 -3
- package/src/Message/TableMessage/TdMessage.tsx +1 -2
- package/src/Message/TableMessage/ThMessage.tsx +1 -2
- package/src/Message/TableMessage/TheadMessage.tsx +3 -2
- package/src/Message/TableMessage/TrMessage.tsx +4 -4
- package/src/Message/TextMessage/TextMessage.scss +25 -0
- package/src/Message/TextMessage/TextMessage.tsx +1 -2
- package/src/Message/UserFeedback/CloseButton.tsx +2 -2
- package/src/Message/UserFeedback/UserFeedback.scss +24 -3
- package/src/Message/UserFeedback/UserFeedback.test.tsx +13 -1
- package/src/Message/UserFeedback/UserFeedback.tsx +12 -8
- package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +4 -1
- package/src/Message/UserFeedback/UserFeedbackComplete.tsx +26 -16
- package/src/MessageBar/AttachButton.scss +10 -0
- package/src/MessageBar/AttachButton.test.tsx +56 -8
- package/src/MessageBar/AttachButton.tsx +21 -8
- package/src/MessageBar/MessageBar.scss +17 -0
- package/src/MessageBar/MessageBar.test.tsx +81 -30
- package/src/MessageBar/MessageBar.tsx +60 -25
- package/src/MessageBar/MicrophoneButton.scss +10 -0
- package/src/MessageBar/MicrophoneButton.tsx +15 -9
- package/src/MessageBar/SendButton.scss +10 -0
- package/src/MessageBar/SendButton.test.tsx +10 -7
- package/src/MessageBar/SendButton.tsx +9 -5
- package/src/MessageBar/StopButton.scss +10 -0
- package/src/MessageBar/StopButton.test.tsx +10 -7
- package/src/MessageBar/StopButton.tsx +9 -5
- package/src/MessageBox/JumpButton.test.tsx +4 -5
- package/src/MessageBox/JumpButton.tsx +3 -3
- package/src/MessageBox/MessageBox.scss +6 -0
- package/src/MessageBox/MessageBox.test.tsx +295 -5
- package/src/MessageBox/MessageBox.tsx +301 -82
- package/src/PreviewAttachment/PreviewAttachment.test.tsx +44 -2
- package/src/PreviewAttachment/PreviewAttachment.tsx +29 -7
- package/src/ResponseActions/ResponseActionButton.test.tsx +0 -1
- package/src/ResponseActions/ResponseActionButton.tsx +6 -5
- package/src/ResponseActions/ResponseActions.test.tsx +18 -2
- package/src/ResponseActions/ResponseActions.tsx +18 -8
- package/src/Settings/Settings.scss +11 -0
- package/src/Settings/SettingsForm.test.tsx +17 -1
- package/src/Settings/SettingsForm.tsx +8 -3
- package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx +2 -2
- package/src/SourcesCard/SourcesCard.scss +8 -0
- package/src/SourcesCard/SourcesCard.test.tsx +0 -1
- package/src/SourcesCard/SourcesCard.tsx +9 -8
- package/src/TermsOfUse/TermsOfUse.scss +20 -0
- package/src/TermsOfUse/TermsOfUse.test.tsx +0 -1
- package/src/TermsOfUse/TermsOfUse.tsx +15 -9
- package/tsconfig.cjs.json +0 -1
- package/tsconfig.json +3 -3
@@ -1,23 +1,48 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
+
});
|
9
|
+
};
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
|
+
import { fireEvent, render, screen, within } from '@testing-library/react';
|
12
|
+
import '@testing-library/jest-dom';
|
3
13
|
import { PreviewAttachment } from './PreviewAttachment';
|
4
14
|
describe('PreviewAttachment', () => {
|
5
15
|
it('should render PreviewAttachment', () => {
|
6
|
-
render(
|
16
|
+
render(_jsx(PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn() }));
|
7
17
|
expect(screen.getByText('Preview attachment')).toBeTruthy();
|
8
18
|
expect(screen.getByText('greetings')).toBeTruthy();
|
9
19
|
expect(screen.getAllByText('TEXT')).toBeTruthy();
|
10
20
|
});
|
11
21
|
it('should call onEdit handler when edit button is pressed', () => {
|
12
22
|
const onEdit = jest.fn();
|
13
|
-
render(
|
23
|
+
render(_jsx(PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: onEdit, handleModalToggle: jest.fn() }));
|
14
24
|
fireEvent.click(screen.getByText('Edit'));
|
15
25
|
expect(onEdit).toHaveBeenCalled();
|
16
26
|
});
|
17
27
|
it('should call onDismiss handler when dismiss button is pressed', () => {
|
18
28
|
const onDismiss = jest.fn();
|
19
|
-
render(
|
29
|
+
render(_jsx(PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: onDismiss }));
|
20
30
|
fireEvent.click(screen.getByText('Dismiss'));
|
21
31
|
expect(onDismiss).toHaveBeenCalled();
|
22
32
|
});
|
33
|
+
it('should render custom button text for footer actions buttons', () => {
|
34
|
+
render(_jsx(PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn(), primaryActionButtonText: "Edit", secondaryActionButtonText: "Close" }));
|
35
|
+
screen.getByText('Edit');
|
36
|
+
screen.getByText('Close');
|
37
|
+
});
|
38
|
+
it('should render PreviewAttachment with custom classNames', () => __awaiter(void 0, void 0, void 0, function* () {
|
39
|
+
render(_jsx(PreviewAttachment, { code: "Hello world", fileName: "greetings.txt", isModalOpen: true, onEdit: jest.fn(), handleModalToggle: jest.fn(), primaryActionButtonText: "Edit", secondaryActionButtonText: "Close", modalHeaderClassName: "custom-header-class", modalBodyClassName: "custom-body-class", modalFooterClassName: "custom-footer-class" }));
|
40
|
+
const modal = screen.getByRole('dialog');
|
41
|
+
const modalHeader = within(modal).getByRole('banner');
|
42
|
+
expect(modalHeader).toHaveClass('custom-header-class');
|
43
|
+
const modalBody = modal.querySelector('#code-modal-body');
|
44
|
+
expect(modalBody).toHaveClass('custom-body-class');
|
45
|
+
const modalfooter = within(modal).getByRole('contentinfo');
|
46
|
+
expect(modalfooter).toHaveClass('custom-footer-class');
|
47
|
+
}));
|
23
48
|
});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import { TooltipProps } from '@patternfly/react-core';
|
3
|
-
export interface ResponseActionButtonProps {
|
1
|
+
import type { FunctionComponent, MouseEvent } from 'react';
|
2
|
+
import { ButtonProps, TooltipProps } from '@patternfly/react-core';
|
3
|
+
export interface ResponseActionButtonProps extends ButtonProps {
|
4
4
|
/** Aria-label for the button. Defaults to the value of the tooltipContent if none provided */
|
5
5
|
ariaLabel?: string;
|
6
6
|
/** Aria-label for the button, shown when the button is clicked. Defaults to the value of ariaLabel or tooltipContent if not provided. */
|
@@ -24,6 +24,6 @@ export interface ResponseActionButtonProps {
|
|
24
24
|
/** Ref applied to button */
|
25
25
|
innerRef?: React.Ref<HTMLButtonElement>;
|
26
26
|
}
|
27
|
-
export declare const ResponseActionButtonBase:
|
28
|
-
declare const ResponseActionButton:
|
27
|
+
export declare const ResponseActionButtonBase: FunctionComponent<ResponseActionButtonProps>;
|
28
|
+
declare const ResponseActionButton: import("react").ForwardRefExoticComponent<ResponseActionButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
29
29
|
export default ResponseActionButton;
|
@@ -9,7 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
9
9
|
}
|
10
10
|
return t;
|
11
11
|
};
|
12
|
-
import
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
+
import { forwardRef } from 'react';
|
13
14
|
import { Button, Icon, Tooltip } from '@patternfly/react-core';
|
14
15
|
export const ResponseActionButtonBase = (_a) => {
|
15
16
|
var { ariaLabel, clickedAriaLabel = ariaLabel, className, icon, isDisabled, onClick, tooltipContent, clickedTooltipContent = tooltipContent, tooltipProps, isClicked = false, innerRef } = _a, props = __rest(_a, ["ariaLabel", "clickedAriaLabel", "className", "icon", "isDisabled", "onClick", "tooltipContent", "clickedTooltipContent", "tooltipProps", "isClicked", "innerRef"]);
|
@@ -19,10 +20,9 @@ export const ResponseActionButtonBase = (_a) => {
|
|
19
20
|
}
|
20
21
|
return isClicked ? clickedTooltipContent : tooltipContent;
|
21
22
|
};
|
22
|
-
return (
|
23
|
+
return (_jsx(Tooltip, Object.assign({ id: `pf-chatbot__tooltip-response-action-${tooltipContent}`, content: isClicked ? clickedTooltipContent : tooltipContent, "aria-live": "polite", position: "bottom", entryDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.entryDelay) || 0, exitDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.exitDelay) || 0, distance: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.distance) || 8, animationDuration: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.animationDuration) || 0,
|
23
24
|
// prevents VO announcements of both aria label and tooltip
|
24
|
-
aria: "none" }, tooltipProps),
|
25
|
-
React.createElement(Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": generateAriaLabel(), icon: React.createElement(Icon, { isInline: true, size: "lg" }, icon), isDisabled: isDisabled, onClick: onClick, size: "sm", ref: innerRef }, props))));
|
25
|
+
aria: "none" }, tooltipProps, { children: _jsx(Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": generateAriaLabel(), icon: _jsx(Icon, { isInline: true, size: "lg", children: icon }), isDisabled: isDisabled, onClick: onClick, size: "sm", ref: innerRef }, props)) })));
|
26
26
|
};
|
27
|
-
const ResponseActionButton =
|
27
|
+
const ResponseActionButton = forwardRef((props, ref) => (_jsx(ResponseActionButtonBase, Object.assign({ innerRef: ref }, props))));
|
28
28
|
export default ResponseActionButton;
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
11
|
import { render, screen } from '@testing-library/react';
|
12
12
|
import '@testing-library/jest-dom';
|
13
13
|
import userEvent from '@testing-library/user-event';
|
@@ -15,35 +15,35 @@ import { DownloadIcon } from '@patternfly/react-icons';
|
|
15
15
|
import ResponseActionButton from './ResponseActionButton';
|
16
16
|
describe('ResponseActionButton', () => {
|
17
17
|
it('renders aria-label correctly if not clicked', () => {
|
18
|
-
render(
|
18
|
+
render(_jsx(ResponseActionButton, { icon: _jsx(DownloadIcon, {}), ariaLabel: "Download", clickedAriaLabel: "Downloaded" }));
|
19
19
|
expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
20
20
|
});
|
21
21
|
it('renders aria-label correctly if clicked', () => {
|
22
|
-
render(
|
22
|
+
render(_jsx(ResponseActionButton, { icon: _jsx(DownloadIcon, {}), ariaLabel: "Download", clickedAriaLabel: "Downloaded", isClicked: true }));
|
23
23
|
expect(screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
|
24
24
|
});
|
25
25
|
it('renders tooltip correctly if not clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
26
|
-
render(
|
26
|
+
render(_jsx(ResponseActionButton, { icon: _jsx(DownloadIcon, {}), tooltipContent: "Download", clickedTooltipContent: "Downloaded" }));
|
27
27
|
expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
28
28
|
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
29
29
|
yield userEvent.click(screen.getByRole('button', { name: 'Download' }));
|
30
30
|
expect(screen.getByRole('tooltip', { name: 'Download' })).toBeTruthy();
|
31
31
|
}));
|
32
32
|
it('renders tooltip correctly if clicked', () => __awaiter(void 0, void 0, void 0, function* () {
|
33
|
-
render(
|
33
|
+
render(_jsx(ResponseActionButton, { icon: _jsx(DownloadIcon, {}), tooltipContent: "Download", clickedTooltipContent: "Downloaded", isClicked: true }));
|
34
34
|
expect(screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
|
35
35
|
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
36
36
|
yield userEvent.click(screen.getByRole('button', { name: 'Downloaded' }));
|
37
37
|
expect(screen.getByRole('tooltip', { name: 'Downloaded' })).toBeTruthy();
|
38
38
|
}));
|
39
39
|
it('if clicked variant for tooltip is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
|
40
|
-
render(
|
40
|
+
render(_jsx(ResponseActionButton, { icon: _jsx(DownloadIcon, {}), tooltipContent: "Download", isClicked: true }));
|
41
41
|
// clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
|
42
42
|
yield userEvent.click(screen.getByRole('button', { name: 'Download' }));
|
43
43
|
expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
44
44
|
}));
|
45
45
|
it('if clicked variant for aria label is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
|
46
|
-
render(
|
46
|
+
render(_jsx(ResponseActionButton, { icon: _jsx(DownloadIcon, {}), ariaLabel: "Download", isClicked: true }));
|
47
47
|
expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
|
48
48
|
}));
|
49
49
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent, MouseEvent } from 'react';
|
2
2
|
import { ButtonProps, TooltipProps } from '@patternfly/react-core';
|
3
3
|
export interface ActionProps extends Omit<ButtonProps, 'ref'> {
|
4
4
|
/** Aria-label for the button */
|
@@ -26,9 +26,12 @@ export interface ActionProps extends Omit<ButtonProps, 'ref'> {
|
|
26
26
|
/** Id for content controlled by the button, such as the feedback form */
|
27
27
|
'aria-controls'?: string;
|
28
28
|
}
|
29
|
+
type ExtendedActionProps = ActionProps & {
|
30
|
+
[key: string]: any;
|
31
|
+
};
|
29
32
|
export interface ResponseActionProps {
|
30
33
|
/** Props for message actions, such as feedback (positive or negative), copy button, share, and listen */
|
31
|
-
actions: Record<string,
|
34
|
+
actions: Record<string, ExtendedActionProps | undefined> & {
|
32
35
|
positive?: ActionProps;
|
33
36
|
negative?: ActionProps;
|
34
37
|
copy?: ActionProps;
|
@@ -36,5 +39,5 @@ export interface ResponseActionProps {
|
|
36
39
|
listen?: ActionProps;
|
37
40
|
};
|
38
41
|
}
|
39
|
-
export declare const ResponseActions:
|
42
|
+
export declare const ResponseActions: FunctionComponent<ResponseActionProps>;
|
40
43
|
export default ResponseActions;
|
@@ -9,15 +9,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
9
9
|
}
|
10
10
|
return t;
|
11
11
|
};
|
12
|
-
import
|
12
|
+
import { createElement as _createElement } from "react";
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
14
|
+
import { useEffect, useRef, useState } from 'react';
|
13
15
|
import { ExternalLinkAltIcon, VolumeUpIcon, OutlinedThumbsUpIcon, OutlinedThumbsDownIcon, OutlinedCopyIcon } from '@patternfly/react-icons';
|
14
16
|
import ResponseActionButton from './ResponseActionButton';
|
15
17
|
export const ResponseActions = ({ actions }) => {
|
16
18
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
17
|
-
const [activeButton, setActiveButton] =
|
19
|
+
const [activeButton, setActiveButton] = useState();
|
18
20
|
const { positive, negative, copy, share, listen } = actions, additionalActions = __rest(actions, ["positive", "negative", "copy", "share", "listen"]);
|
19
|
-
const responseActions =
|
20
|
-
|
21
|
+
const responseActions = useRef(null);
|
22
|
+
useEffect(() => {
|
21
23
|
const handleClickOutside = (e) => {
|
22
24
|
if (responseActions.current && !responseActions.current.contains(e.target)) {
|
23
25
|
setActiveButton(undefined);
|
@@ -32,15 +34,9 @@ export const ResponseActions = ({ actions }) => {
|
|
32
34
|
setActiveButton(id);
|
33
35
|
onClick && onClick(e);
|
34
36
|
};
|
35
|
-
return (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
share && (React.createElement(ResponseActionButton, { ariaLabel: (_o = share.ariaLabel) !== null && _o !== void 0 ? _o : 'Share', clickedAriaLabel: (_p = share.ariaLabel) !== null && _p !== void 0 ? _p : 'Shared', onClick: (e) => handleClick(e, 'share', share.onClick), className: share.className, isDisabled: share.isDisabled, tooltipContent: (_q = share.tooltipContent) !== null && _q !== void 0 ? _q : 'Share', clickedTooltipContent: (_r = share.clickedTooltipContent) !== null && _r !== void 0 ? _r : 'Shared', tooltipProps: share.tooltipProps, icon: React.createElement(ExternalLinkAltIcon, null), isClicked: activeButton === 'share', ref: share.ref, "aria-expanded": share['aria-expanded'], "aria-controls": share['aria-controls'] })),
|
40
|
-
listen && (React.createElement(ResponseActionButton, { ariaLabel: (_s = listen.ariaLabel) !== null && _s !== void 0 ? _s : 'Listen', clickedAriaLabel: (_t = listen.ariaLabel) !== null && _t !== void 0 ? _t : 'Listening', onClick: (e) => handleClick(e, 'listen', listen.onClick), className: listen.className, isDisabled: listen.isDisabled, tooltipContent: (_u = listen.tooltipContent) !== null && _u !== void 0 ? _u : 'Listen', clickedTooltipContent: (_v = listen.clickedTooltipContent) !== null && _v !== void 0 ? _v : 'Listening', tooltipProps: listen.tooltipProps, icon: React.createElement(VolumeUpIcon, null), isClicked: activeButton === 'listen', ref: listen.ref, "aria-expanded": listen['aria-expanded'], "aria-controls": listen['aria-controls'] })),
|
41
|
-
Object.keys(additionalActions).map((action) => {
|
42
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
43
|
-
return (React.createElement(ResponseActionButton, { key: action, ariaLabel: (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.ariaLabel, clickedAriaLabel: (_b = additionalActions[action]) === null || _b === void 0 ? void 0 : _b.clickedAriaLabel, onClick: (e) => { var _a; return handleClick(e, action, (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.onClick); }, className: (_c = additionalActions[action]) === null || _c === void 0 ? void 0 : _c.className, isDisabled: (_d = additionalActions[action]) === null || _d === void 0 ? void 0 : _d.isDisabled, tooltipContent: (_e = additionalActions[action]) === null || _e === void 0 ? void 0 : _e.tooltipContent, tooltipProps: (_f = additionalActions[action]) === null || _f === void 0 ? void 0 : _f.tooltipProps, clickedTooltipContent: (_g = additionalActions[action]) === null || _g === void 0 ? void 0 : _g.clickedTooltipContent, icon: (_h = additionalActions[action]) === null || _h === void 0 ? void 0 : _h.icon, isClicked: activeButton === action, ref: (_j = additionalActions[action]) === null || _j === void 0 ? void 0 : _j.ref, "aria-expanded": (_k = additionalActions[action]) === null || _k === void 0 ? void 0 : _k['aria-expanded'], "aria-controls": (_l = additionalActions[action]) === null || _l === void 0 ? void 0 : _l['aria-controls'] }));
|
44
|
-
})));
|
37
|
+
return (_jsxs("div", { ref: responseActions, className: "pf-chatbot__response-actions", children: [positive && (_jsx(ResponseActionButton, Object.assign({}, positive, { ariaLabel: (_a = positive.ariaLabel) !== null && _a !== void 0 ? _a : 'Good response', clickedAriaLabel: (_b = positive.ariaLabel) !== null && _b !== void 0 ? _b : 'Response recorded', onClick: (e) => handleClick(e, 'positive', positive.onClick), className: positive.className, isDisabled: positive.isDisabled, tooltipContent: (_c = positive.tooltipContent) !== null && _c !== void 0 ? _c : 'Good response', clickedTooltipContent: (_d = positive.clickedTooltipContent) !== null && _d !== void 0 ? _d : 'Response recorded', tooltipProps: positive.tooltipProps, icon: _jsx(OutlinedThumbsUpIcon, {}), isClicked: activeButton === 'positive', ref: positive.ref, "aria-expanded": positive['aria-expanded'], "aria-controls": positive['aria-controls'] }))), negative && (_jsx(ResponseActionButton, Object.assign({}, negative, { ariaLabel: (_e = negative.ariaLabel) !== null && _e !== void 0 ? _e : 'Bad response', clickedAriaLabel: (_f = negative.ariaLabel) !== null && _f !== void 0 ? _f : 'Response recorded', onClick: (e) => handleClick(e, 'negative', negative.onClick), className: negative.className, isDisabled: negative.isDisabled, tooltipContent: (_g = negative.tooltipContent) !== null && _g !== void 0 ? _g : 'Bad response', clickedTooltipContent: (_h = negative.clickedTooltipContent) !== null && _h !== void 0 ? _h : 'Response recorded', tooltipProps: negative.tooltipProps, icon: _jsx(OutlinedThumbsDownIcon, {}), isClicked: activeButton === 'negative', ref: negative.ref, "aria-expanded": negative['aria-expanded'], "aria-controls": negative['aria-controls'] }))), copy && (_jsx(ResponseActionButton, Object.assign({}, copy, { ariaLabel: (_j = copy.ariaLabel) !== null && _j !== void 0 ? _j : 'Copy', clickedAriaLabel: (_k = copy.ariaLabel) !== null && _k !== void 0 ? _k : 'Copied', onClick: (e) => handleClick(e, 'copy', copy.onClick), className: copy.className, isDisabled: copy.isDisabled, tooltipContent: (_l = copy.tooltipContent) !== null && _l !== void 0 ? _l : 'Copy', clickedTooltipContent: (_m = copy.clickedTooltipContent) !== null && _m !== void 0 ? _m : 'Copied', tooltipProps: copy.tooltipProps, icon: _jsx(OutlinedCopyIcon, {}), isClicked: activeButton === 'copy', ref: copy.ref, "aria-expanded": copy['aria-expanded'], "aria-controls": copy['aria-controls'] }))), share && (_jsx(ResponseActionButton, Object.assign({}, share, { ariaLabel: (_o = share.ariaLabel) !== null && _o !== void 0 ? _o : 'Share', clickedAriaLabel: (_p = share.ariaLabel) !== null && _p !== void 0 ? _p : 'Shared', onClick: (e) => handleClick(e, 'share', share.onClick), className: share.className, isDisabled: share.isDisabled, tooltipContent: (_q = share.tooltipContent) !== null && _q !== void 0 ? _q : 'Share', clickedTooltipContent: (_r = share.clickedTooltipContent) !== null && _r !== void 0 ? _r : 'Shared', tooltipProps: share.tooltipProps, icon: _jsx(ExternalLinkAltIcon, {}), isClicked: activeButton === 'share', ref: share.ref, "aria-expanded": share['aria-expanded'], "aria-controls": share['aria-controls'] }))), listen && (_jsx(ResponseActionButton, Object.assign({}, listen, { ariaLabel: (_s = listen.ariaLabel) !== null && _s !== void 0 ? _s : 'Listen', clickedAriaLabel: (_t = listen.ariaLabel) !== null && _t !== void 0 ? _t : 'Listening', onClick: (e) => handleClick(e, 'listen', listen.onClick), className: listen.className, isDisabled: listen.isDisabled, tooltipContent: (_u = listen.tooltipContent) !== null && _u !== void 0 ? _u : 'Listen', clickedTooltipContent: (_v = listen.clickedTooltipContent) !== null && _v !== void 0 ? _v : 'Listening', tooltipProps: listen.tooltipProps, icon: _jsx(VolumeUpIcon, {}), isClicked: activeButton === 'listen', ref: listen.ref, "aria-expanded": listen['aria-expanded'], "aria-controls": listen['aria-controls'] }))), Object.keys(additionalActions).map((action) => {
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
39
|
+
return (_createElement(ResponseActionButton, Object.assign({}, additionalActions[action], { key: action, ariaLabel: (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.ariaLabel, clickedAriaLabel: (_b = additionalActions[action]) === null || _b === void 0 ? void 0 : _b.clickedAriaLabel, onClick: (e) => { var _a; return handleClick(e, action, (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.onClick); }, className: (_c = additionalActions[action]) === null || _c === void 0 ? void 0 : _c.className, isDisabled: (_d = additionalActions[action]) === null || _d === void 0 ? void 0 : _d.isDisabled, tooltipContent: (_e = additionalActions[action]) === null || _e === void 0 ? void 0 : _e.tooltipContent, tooltipProps: (_f = additionalActions[action]) === null || _f === void 0 ? void 0 : _f.tooltipProps, clickedTooltipContent: (_g = additionalActions[action]) === null || _g === void 0 ? void 0 : _g.clickedTooltipContent, icon: (_h = additionalActions[action]) === null || _h === void 0 ? void 0 : _h.icon, isClicked: activeButton === action, ref: (_j = additionalActions[action]) === null || _j === void 0 ? void 0 : _j.ref, "aria-expanded": (_k = additionalActions[action]) === null || _k === void 0 ? void 0 : _k['aria-expanded'], "aria-controls": (_l = additionalActions[action]) === null || _l === void 0 ? void 0 : _l['aria-controls'] })));
|
40
|
+
})] }));
|
45
41
|
};
|
46
42
|
export default ResponseActions;
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
11
11
|
import { render, screen } from '@testing-library/react';
|
12
12
|
import '@testing-library/jest-dom';
|
13
13
|
import ResponseActions from './ResponseActions';
|
@@ -29,7 +29,7 @@ const CUSTOM_ACTIONS = [
|
|
29
29
|
onClick: jest.fn(),
|
30
30
|
tooltipContent: 'Regenerate',
|
31
31
|
clickedTooltipContent: 'Regenerated',
|
32
|
-
icon:
|
32
|
+
icon: _jsx(RedoIcon, {})
|
33
33
|
},
|
34
34
|
download: {
|
35
35
|
ariaLabel: 'Download',
|
@@ -37,22 +37,29 @@ const CUSTOM_ACTIONS = [
|
|
37
37
|
onClick: jest.fn(),
|
38
38
|
tooltipContent: 'Download',
|
39
39
|
clickedTooltipContent: 'Downloaded',
|
40
|
-
icon:
|
40
|
+
icon: _jsx(DownloadIcon, {})
|
41
41
|
},
|
42
42
|
info: {
|
43
43
|
ariaLabel: 'Info',
|
44
44
|
onClick: jest.fn(),
|
45
45
|
tooltipContent: 'Info',
|
46
|
-
icon:
|
46
|
+
icon: _jsx(InfoCircleIcon, {})
|
47
47
|
}
|
48
48
|
}
|
49
49
|
];
|
50
|
+
const ALL_ACTIONS_DATA_TEST = [
|
51
|
+
{ type: 'positive', label: 'Good response', dataTestId: 'positive' },
|
52
|
+
{ type: 'negative', label: 'Bad response', dataTestId: 'negative' },
|
53
|
+
{ type: 'copy', label: 'Copy', dataTestId: 'copy' },
|
54
|
+
{ type: 'share', label: 'Share', dataTestId: 'share' },
|
55
|
+
{ type: 'listen', label: 'Listen', dataTestId: 'listen' }
|
56
|
+
];
|
50
57
|
describe('ResponseActions', () => {
|
51
58
|
afterEach(() => {
|
52
59
|
jest.clearAllMocks();
|
53
60
|
});
|
54
61
|
it('should handle click within group of buttons correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
55
|
-
render(
|
62
|
+
render(_jsx(ResponseActions, { actions: {
|
56
63
|
positive: { onClick: jest.fn() },
|
57
64
|
negative: { onClick: jest.fn() },
|
58
65
|
copy: { onClick: jest.fn() },
|
@@ -83,7 +90,7 @@ describe('ResponseActions', () => {
|
|
83
90
|
}));
|
84
91
|
it('should handle click outside of group of buttons correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
85
92
|
// using message just so we have something outside the group that's rendered
|
86
|
-
render(
|
93
|
+
render(_jsx(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
94
|
positive: {},
|
88
95
|
negative: {}
|
89
96
|
} }));
|
@@ -103,21 +110,21 @@ describe('ResponseActions', () => {
|
|
103
110
|
}));
|
104
111
|
it('should render buttons correctly', () => {
|
105
112
|
ALL_ACTIONS.forEach(({ type, label }) => {
|
106
|
-
render(
|
113
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn() } } }));
|
107
114
|
expect(screen.getByRole('button', { name: label })).toBeTruthy();
|
108
115
|
});
|
109
116
|
});
|
110
117
|
it('should be able to call onClick correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
111
118
|
ALL_ACTIONS.forEach((_a) => __awaiter(void 0, [_a], void 0, function* ({ type, label }) {
|
112
119
|
const spy = jest.fn();
|
113
|
-
render(
|
120
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: spy } } }));
|
114
121
|
yield userEvent.click(screen.getByRole('button', { name: label }));
|
115
122
|
expect(spy).toHaveBeenCalledTimes(1);
|
116
123
|
}));
|
117
124
|
}));
|
118
125
|
it('should swap clicked and non-clicked aria labels on click', () => __awaiter(void 0, void 0, void 0, function* () {
|
119
126
|
ALL_ACTIONS.forEach((_a) => __awaiter(void 0, [_a], void 0, function* ({ type, label, clickedLabel }) {
|
120
|
-
render(
|
127
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn() } } }));
|
121
128
|
expect(screen.getByRole('button', { name: label })).toBeTruthy();
|
122
129
|
yield userEvent.click(screen.getByRole('button', { name: label }));
|
123
130
|
expect(screen.getByRole('button', { name: clickedLabel })).toBeTruthy();
|
@@ -125,7 +132,7 @@ describe('ResponseActions', () => {
|
|
125
132
|
}));
|
126
133
|
it('should swap clicked and non-clicked tooltips on click', () => __awaiter(void 0, void 0, void 0, function* () {
|
127
134
|
ALL_ACTIONS.forEach((_a) => __awaiter(void 0, [_a], void 0, function* ({ type, label, clickedLabel }) {
|
128
|
-
render(
|
135
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn() } } }));
|
129
136
|
expect(screen.getByRole('button', { name: label })).toBeTruthy();
|
130
137
|
yield userEvent.click(screen.getByRole('button', { name: label }));
|
131
138
|
expect(screen.getByRole('tooltip', { name: clickedLabel })).toBeTruthy();
|
@@ -140,35 +147,43 @@ describe('ResponseActions', () => {
|
|
140
147
|
{ type: 'listen', ariaLabel: 'Listen up' }
|
141
148
|
];
|
142
149
|
actions.forEach(({ type, ariaLabel }) => {
|
143
|
-
render(
|
150
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn(), ariaLabel } } }));
|
144
151
|
expect(screen.getByRole('button', { name: ariaLabel })).toBeTruthy();
|
145
152
|
});
|
146
153
|
});
|
147
154
|
it('should be able to disable buttons', () => {
|
148
155
|
ALL_ACTIONS.forEach(({ type, label }) => {
|
149
|
-
render(
|
156
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn(), isDisabled: true } } }));
|
150
157
|
expect(screen.getByRole('button', { name: label })).toBeDisabled();
|
151
158
|
});
|
152
159
|
});
|
153
160
|
it('should be able to add class to buttons', () => {
|
154
161
|
ALL_ACTIONS.forEach(({ type, label }) => {
|
155
|
-
render(
|
162
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn(), className: 'test' } } }));
|
156
163
|
expect(screen.getByRole('button', { name: label })).toHaveClass('test');
|
157
164
|
});
|
158
165
|
});
|
166
|
+
it('should be able to add custom attributes to buttons', () => {
|
167
|
+
ALL_ACTIONS_DATA_TEST.forEach(({ type, dataTestId }) => {
|
168
|
+
render(_jsx(ResponseActions, { actions: { [type]: { onClick: jest.fn(), 'data-testid': dataTestId } } }));
|
169
|
+
expect(screen.getByTestId(dataTestId)).toBeTruthy();
|
170
|
+
});
|
171
|
+
});
|
159
172
|
it('should be able to add custom actions', () => {
|
160
173
|
CUSTOM_ACTIONS.forEach((action) => {
|
161
174
|
const key = Object.keys(action)[0];
|
162
|
-
render(
|
175
|
+
render(_jsx(ResponseActions, { actions: {
|
163
176
|
[key]: {
|
164
177
|
tooltipContent: action[key].tooltipContent,
|
165
178
|
onClick: action[key].onClick,
|
166
179
|
// doing this just because it's easier to test without a regex for the button name
|
167
180
|
ariaLabel: action[key].ariaLabel.toLowerCase(),
|
168
|
-
icon: action[key].icon
|
181
|
+
icon: action[key].icon,
|
182
|
+
'data-testid': action[key]
|
169
183
|
}
|
170
184
|
} }));
|
171
185
|
expect(screen.getByRole('button', { name: key })).toBeTruthy();
|
186
|
+
expect(screen.getByTestId(action[key])).toBeTruthy();
|
172
187
|
});
|
173
188
|
});
|
174
189
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent } from 'react';
|
2
2
|
export interface SettingsFormProps {
|
3
3
|
/** Class applied to form container */
|
4
4
|
className?: string;
|
@@ -8,6 +8,8 @@ export interface SettingsFormProps {
|
|
8
8
|
label: string;
|
9
9
|
field: React.ReactElement;
|
10
10
|
}[];
|
11
|
+
/** Sets form to compact styling. */
|
12
|
+
isCompact?: boolean;
|
11
13
|
}
|
12
|
-
export declare const SettingsForm:
|
14
|
+
export declare const SettingsForm: FunctionComponent<SettingsFormProps>;
|
13
15
|
export default SettingsForm;
|
@@ -9,12 +9,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
9
9
|
}
|
10
10
|
return t;
|
11
11
|
};
|
12
|
-
import
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
13
|
export const SettingsForm = (_a) => {
|
14
|
-
var { className, fields = [] } = _a, props = __rest(_a, ["className", "fields"]);
|
15
|
-
return (
|
16
|
-
React.createElement("form", { className: "pf-chatbot__settings-form" }, fields.map((field) => (React.createElement("div", { className: "pf-chatbot__settings-form-row", key: field.label },
|
17
|
-
React.createElement("label", { className: "pf-chatbot__settings-label", htmlFor: field.id }, field.label),
|
18
|
-
field.field))))));
|
14
|
+
var { className, fields = [], isCompact } = _a, props = __rest(_a, ["className", "fields", "isCompact"]);
|
15
|
+
return (_jsx("div", Object.assign({ className: `pf-chatbot__settings-form-container ${isCompact ? 'pf-m-compact' : ''} ${className ? ` ${className}` : ''}` }, props, { children: _jsx("form", { className: "pf-chatbot__settings-form", children: fields.map((field) => (_jsxs("div", { className: "pf-chatbot__settings-form-row", children: [_jsx("label", { className: "pf-chatbot__settings-label", htmlFor: field.id, children: field.label }), field.field] }, field.label))) }) })));
|
19
16
|
};
|
20
17
|
export default SettingsForm;
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
import '@testing-library/jest-dom';
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Button } from '@patternfly/react-core';
|
3
3
|
import { render, screen } from '@testing-library/react';
|
4
4
|
import { SettingsForm } from './SettingsForm';
|
5
|
+
import '@testing-library/jest-dom';
|
5
6
|
describe('SettingsForm', () => {
|
6
7
|
it('should render settingsForm with custom classname', () => {
|
7
|
-
const { container } = render(
|
8
|
+
const { container } = render(_jsx(SettingsForm, { className: "custom-settings" }));
|
8
9
|
expect(container.querySelector('.custom-settings')).toBeTruthy();
|
9
10
|
});
|
10
11
|
it('should render settingsForm with fields', () => {
|
@@ -12,10 +13,21 @@ describe('SettingsForm', () => {
|
|
12
13
|
{
|
13
14
|
id: 'archived-chat',
|
14
15
|
label: 'Archive chat',
|
15
|
-
field: (
|
16
|
+
field: (_jsx(Button, { id: "archived-chat", variant: "secondary", children: "Archive chat" }))
|
16
17
|
}
|
17
18
|
];
|
18
|
-
render(
|
19
|
+
render(_jsx(SettingsForm, { fields: fields }));
|
19
20
|
expect(screen.getByRole('button', { name: 'Archive chat' })).toBeTruthy();
|
20
21
|
});
|
22
|
+
it('should render settingsForm with isCompact', () => {
|
23
|
+
const fields = [
|
24
|
+
{
|
25
|
+
id: 'archived-chat',
|
26
|
+
label: 'Archive chat',
|
27
|
+
field: (_jsx(Button, { id: "archived-chat", variant: "secondary", children: "Archive chat" }))
|
28
|
+
}
|
29
|
+
];
|
30
|
+
render(_jsx(SettingsForm, { "data-testid": "settings-form", fields: fields, isCompact: true }));
|
31
|
+
expect(screen.getByTestId('settings-form')).toHaveClass('pf-m-compact');
|
32
|
+
});
|
21
33
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent } from 'react';
|
2
2
|
export interface SourceDetailsMenuItemProps extends React.HTMLProps<HTMLDivElement> {
|
3
3
|
/** Icon */
|
4
4
|
icon: React.ReactNode;
|
@@ -7,5 +7,5 @@ export interface SourceDetailsMenuItemProps extends React.HTMLProps<HTMLDivEleme
|
|
7
7
|
/** Description of source */
|
8
8
|
type?: string;
|
9
9
|
}
|
10
|
-
export declare const SourceDetailsMenuItem:
|
10
|
+
export declare const SourceDetailsMenuItem: FunctionComponent<SourceDetailsMenuItemProps>;
|
11
11
|
export default SourceDetailsMenuItem;
|
@@ -9,16 +9,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
9
9
|
}
|
10
10
|
return t;
|
11
11
|
};
|
12
|
-
import
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
13
|
import { Icon, Flex, Stack, StackItem } from '@patternfly/react-core';
|
14
14
|
export const SourceDetailsMenuItem = (_a) => {
|
15
15
|
var { icon, name, type } = _a, props = __rest(_a, ["icon", "name", "type"]);
|
16
|
-
return (
|
17
|
-
React.createElement(Flex, { justifyContent: { default: 'justifyContentCenter' }, alignItems: { default: 'alignItemsCenter' }, alignSelf: { default: 'alignSelfCenter' } },
|
18
|
-
React.createElement(Icon, { className: "pf-chatbot__source-details-icon" }, icon)),
|
19
|
-
React.createElement(Stack, { className: "pf-chatbot__source-details-text" },
|
20
|
-
React.createElement(StackItem, null,
|
21
|
-
React.createElement("span", { className: "pf-chatbot__source-details-heading" }, name)),
|
22
|
-
type && React.createElement(StackItem, { className: "pf-chatbot__source-details-subhead" }, type))));
|
16
|
+
return (_jsxs(Flex, Object.assign({ className: "pf-chatbot__source-details", gap: { default: 'gapSm' } }, props, { children: [_jsx(Flex, { justifyContent: { default: 'justifyContentCenter' }, alignItems: { default: 'alignItemsCenter' }, alignSelf: { default: 'alignSelfCenter' }, children: _jsx(Icon, { className: "pf-chatbot__source-details-icon", children: icon }) }), _jsxs(Stack, { className: "pf-chatbot__source-details-text", children: [_jsx(StackItem, { children: _jsx("span", { className: "pf-chatbot__source-details-heading", children: name }) }), type && _jsx(StackItem, { className: "pf-chatbot__source-details-subhead", children: type })] })] })));
|
23
17
|
};
|
24
18
|
export default SourceDetailsMenuItem;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent } from 'react';
|
2
2
|
import { CardProps } from '@patternfly/react-core';
|
3
3
|
export interface SourcesCardProps extends CardProps {
|
4
4
|
/** Additional classes for the pagination navigation container. */
|
@@ -36,5 +36,5 @@ export interface SourcesCardProps extends CardProps {
|
|
36
36
|
/** Label for English words "show less" */
|
37
37
|
showLessWords?: string;
|
38
38
|
}
|
39
|
-
declare const SourcesCard:
|
39
|
+
declare const SourcesCard: FunctionComponent<SourcesCardProps>;
|
40
40
|
export default SourcesCard;
|
@@ -9,17 +9,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
9
9
|
}
|
10
10
|
return t;
|
11
11
|
};
|
12
|
-
|
13
|
-
|
14
|
-
// ============================================================================
|
15
|
-
import React from 'react';
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
|
+
import { useState } from 'react';
|
16
14
|
// Import PatternFly components
|
17
15
|
import { Button, ButtonVariant, Card, CardBody, CardFooter, CardTitle, ExpandableSection, ExpandableSectionVariant, Icon, pluralize, Truncate } from '@patternfly/react-core';
|
18
16
|
import { ExternalLinkSquareAltIcon } from '@patternfly/react-icons';
|
19
17
|
const SourcesCard = (_a) => {
|
20
|
-
var { className, isDisabled, paginationAriaLabel = 'Pagination', sources, sourceWord = 'source', sourceWordPlural = 'sources', toNextPageAriaLabel = 'Go to next page', toPreviousPageAriaLabel = 'Go to previous page', onNextClick, onPreviousClick, onSetPage, showMoreWords = 'show more', showLessWords = 'show less' } = _a, props = __rest(_a, ["className", "isDisabled", "paginationAriaLabel", "sources", "sourceWord", "sourceWordPlural", "toNextPageAriaLabel", "toPreviousPageAriaLabel", "onNextClick", "onPreviousClick", "onSetPage", "showMoreWords", "showLessWords"]);
|
21
|
-
const [page, setPage] =
|
22
|
-
const [isExpanded, setIsExpanded] =
|
18
|
+
var { className, isDisabled, paginationAriaLabel = 'Pagination', sources, sourceWord = 'source', sourceWordPlural = 'sources', toNextPageAriaLabel = 'Go to next page', toPreviousPageAriaLabel = 'Go to previous page', onNextClick, onPreviousClick, onSetPage, showMoreWords = 'show more', showLessWords = 'show less', isCompact } = _a, props = __rest(_a, ["className", "isDisabled", "paginationAriaLabel", "sources", "sourceWord", "sourceWordPlural", "toNextPageAriaLabel", "toPreviousPageAriaLabel", "onNextClick", "onPreviousClick", "onSetPage", "showMoreWords", "showLessWords", "isCompact"]);
|
19
|
+
const [page, setPage] = useState(1);
|
20
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
23
21
|
const onToggle = (_event, isExpanded) => {
|
24
22
|
setIsExpanded(isExpanded);
|
25
23
|
};
|
@@ -29,41 +27,20 @@ const SourcesCard = (_a) => {
|
|
29
27
|
};
|
30
28
|
const renderTitle = (title) => {
|
31
29
|
if (title) {
|
32
|
-
return
|
30
|
+
return _jsx(Truncate, { content: title });
|
33
31
|
}
|
34
32
|
return `Source ${page}`;
|
35
33
|
};
|
36
|
-
return (
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
React.createElement("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel },
|
48
|
-
React.createElement(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
49
|
-
const newPage = page >= 1 ? page - 1 : 1;
|
50
|
-
onPreviousClick && onPreviousClick(event, newPage);
|
51
|
-
handleNewPage(event, newPage);
|
52
|
-
}, "aria-label": toPreviousPageAriaLabel },
|
53
|
-
React.createElement(Icon, { iconSize: "lg" },
|
54
|
-
React.createElement("svg", { className: "pf-v6-svg", viewBox: "0 0 280 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em" },
|
55
|
-
React.createElement("path", { d: "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z" })))),
|
56
|
-
React.createElement("span", { "aria-hidden": "true" },
|
57
|
-
page,
|
58
|
-
"/",
|
59
|
-
sources.length),
|
60
|
-
React.createElement(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === sources.length, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
|
61
|
-
const newPage = page + 1 <= sources.length ? page + 1 : sources.length;
|
62
|
-
onNextClick && onNextClick(event, newPage);
|
63
|
-
handleNewPage(event, newPage);
|
64
|
-
} },
|
65
|
-
React.createElement(Icon, { isInline: true, iconSize: "lg" },
|
66
|
-
React.createElement("svg", { className: "pf-v6-svg", viewBox: "0 0 180 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em" },
|
67
|
-
React.createElement("path", { d: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z" })))))))))));
|
34
|
+
return (_jsxs("div", { className: "pf-chatbot__source", children: [_jsx("span", { children: pluralize(sources.length, sourceWord, sourceWordPlural) }), _jsxs(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [_jsx(CardTitle, { className: "pf-chatbot__sources-card-title", children: _jsx(Button, { component: "a", variant: ButtonVariant.link, href: sources[page - 1].link, icon: sources[page - 1].isExternal ? _jsx(ExternalLinkSquareAltIcon, {}) : undefined, iconPosition: "end", isInline: true, rel: sources[page - 1].isExternal ? 'noreferrer' : undefined, target: sources[page - 1].isExternal ? '_blank' : undefined, children: renderTitle(sources[page - 1].title) }) }), sources[page - 1].body && (_jsx(CardBody, { className: `pf-chatbot__sources-card-body`, children: sources[page - 1].hasShowMore ? (
|
35
|
+
// prevents extra VO announcements of button text - parent Message has aria-live
|
36
|
+
_jsx("div", { "aria-live": "off", children: _jsx(ExpandableSection, { variant: ExpandableSectionVariant.truncate, toggleText: isExpanded ? showLessWords : showMoreWords, onToggle: onToggle, isExpanded: isExpanded, truncateMaxLines: 2, children: sources[page - 1].body }) })) : (_jsx("div", { className: "pf-chatbot__sources-card-body-text", children: sources[page - 1].body })) })), sources.length > 1 && (_jsx(CardFooter, { className: "pf-chatbot__sources-card-footer-container", children: _jsx("div", { className: "pf-chatbot__sources-card-footer", children: _jsxs("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel, children: [_jsx(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
37
|
+
const newPage = page >= 1 ? page - 1 : 1;
|
38
|
+
onPreviousClick && onPreviousClick(event, newPage);
|
39
|
+
handleNewPage(event, newPage);
|
40
|
+
}, "aria-label": toPreviousPageAriaLabel, children: _jsx(Icon, { iconSize: "lg", children: _jsx("svg", { className: "pf-v6-svg", viewBox: "0 0 280 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em", children: _jsx("path", { d: "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z" }) }) }) }), _jsxs("span", { "aria-hidden": "true", children: [page, "/", sources.length] }), _jsx(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === sources.length, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
|
41
|
+
const newPage = page + 1 <= sources.length ? page + 1 : sources.length;
|
42
|
+
onNextClick && onNextClick(event, newPage);
|
43
|
+
handleNewPage(event, newPage);
|
44
|
+
}, children: _jsx(Icon, { isInline: true, iconSize: "lg", children: _jsx("svg", { className: "pf-v6-svg", viewBox: "0 0 180 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em", children: _jsx("path", { d: "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z" }) }) }) })] }) }) }))] }))] }));
|
68
45
|
};
|
69
46
|
export default SourcesCard;
|