@patternfly/chatbot 6.3.0-prerelease.13 → 6.3.0-prerelease.14
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 +12 -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 +1 -2
- package/dist/cjs/Chatbot/Chatbot.js +4 -9
- package/dist/cjs/Chatbot/Chatbot.test.js +11 -11
- 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 +2 -2
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +16 -33
- package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +56 -64
- 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 +3 -3
- package/dist/cjs/ChatbotFooter/ChatbotFooter.js +2 -15
- package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +7 -7
- 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 +1 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +5 -10
- package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +7 -10
- 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 +2 -2
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +5 -7
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +7 -10
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +6 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +19 -21
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +6 -3
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +9 -12
- package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +17 -19
- 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 +2 -2
- package/dist/cjs/ChatbotModal/ChatbotModal.js +3 -9
- package/dist/cjs/ChatbotModal/ChatbotModal.test.js +4 -16
- 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 +2 -2
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +6 -20
- package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +16 -16
- package/dist/cjs/CodeModal/CodeModal.d.ts +8 -2
- package/dist/cjs/CodeModal/CodeModal.js +8 -20
- package/dist/cjs/CodeModal/CodeModal.test.js +23 -4
- 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 +2 -2
- package/dist/cjs/FileDropZone/FileDropZone.js +5 -8
- package/dist/cjs/FileDropZone/FileDropZone.test.js +5 -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 +1 -2
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +10 -15
- 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 +8 -7
- package/dist/cjs/Message/Message.js +47 -70
- package/dist/cjs/Message/Message.test.js +75 -79
- 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/QuickResponse/QuickResponse.d.ts +2 -2
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +7 -9
- 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 +2 -2
- package/dist/cjs/Message/QuickStarts/QuickStartTile.js +7 -43
- 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 +12 -23
- package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +53 -53
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +20 -44
- package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +81 -91
- package/dist/cjs/MessageBar/AttachButton.d.ts +1 -2
- package/dist/cjs/MessageBar/AttachButton.js +6 -15
- package/dist/cjs/MessageBar/AttachButton.test.js +24 -24
- package/dist/cjs/MessageBar/MessageBar.d.ts +2 -2
- package/dist/cjs/MessageBar/MessageBar.js +21 -27
- package/dist/cjs/MessageBar/MessageBar.test.js +101 -115
- package/dist/cjs/MessageBar/MicrophoneButton.d.ts +2 -2
- package/dist/cjs/MessageBar/MicrophoneButton.js +7 -14
- package/dist/cjs/MessageBar/SendButton.d.ts +3 -2
- package/dist/cjs/MessageBar/SendButton.js +3 -11
- package/dist/cjs/MessageBar/SendButton.test.js +15 -15
- package/dist/cjs/MessageBar/StopButton.d.ts +3 -2
- package/dist/cjs/MessageBar/StopButton.js +3 -12
- package/dist/cjs/MessageBar/StopButton.test.js +15 -15
- 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 +3 -3
- package/dist/cjs/MessageBox/MessageBox.js +13 -20
- package/dist/cjs/MessageBox/MessageBox.test.js +7 -10
- package/dist/cjs/PreviewAttachment/PreviewAttachment.d.ts +12 -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 +3 -3
- package/dist/cjs/ResponseActions/ResponseActionButton.js +5 -8
- package/dist/cjs/ResponseActions/ResponseActionButton.test.js +19 -19
- package/dist/cjs/ResponseActions/ResponseActions.d.ts +2 -2
- package/dist/cjs/ResponseActions/ResponseActions.js +10 -14
- package/dist/cjs/ResponseActions/ResponseActions.test.js +42 -42
- package/dist/cjs/Settings/SettingsForm.d.ts +2 -2
- package/dist/cjs/Settings/SettingsForm.js +2 -8
- package/dist/cjs/Settings/SettingsForm.test.js +9 -12
- 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 +16 -42
- package/dist/cjs/SourcesCard/SourcesCard.test.js +60 -60
- package/dist/cjs/TermsOfUse/TermsOfUse.d.ts +3 -3
- package/dist/cjs/TermsOfUse/TermsOfUse.js +4 -16
- package/dist/cjs/TermsOfUse/TermsOfUse.test.js +31 -33
- package/dist/esm/AttachMenu/AttachMenu.d.ts +2 -2
- package/dist/esm/AttachMenu/AttachMenu.js +2 -9
- package/dist/esm/AttachmentEdit/AttachmentEdit.d.ts +12 -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 +1 -2
- package/dist/esm/Chatbot/Chatbot.js +4 -6
- package/dist/esm/Chatbot/Chatbot.test.js +6 -6
- 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 +2 -2
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +16 -33
- package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +26 -34
- 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 +3 -3
- package/dist/esm/ChatbotFooter/ChatbotFooter.js +2 -12
- package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +4 -4
- 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 +1 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +5 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +4 -4
- 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 +2 -2
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +5 -7
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +4 -4
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.d.ts +6 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +8 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +9 -8
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.d.ts +6 -3
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +9 -9
- package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +9 -8
- 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 +2 -2
- package/dist/esm/ChatbotModal/ChatbotModal.js +3 -6
- package/dist/esm/ChatbotModal/ChatbotModal.test.js +2 -14
- 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 +2 -2
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.js +6 -17
- package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +8 -8
- package/dist/esm/CodeModal/CodeModal.d.ts +8 -2
- package/dist/esm/CodeModal/CodeModal.js +8 -20
- package/dist/esm/CodeModal/CodeModal.test.js +22 -3
- 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 +2 -2
- package/dist/esm/FileDropZone/FileDropZone.js +5 -5
- package/dist/esm/FileDropZone/FileDropZone.test.js +3 -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 +1 -2
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +10 -15
- 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 +8 -7
- package/dist/esm/Message/Message.js +47 -70
- package/dist/esm/Message/Message.test.js +75 -79
- 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/QuickResponse/QuickResponse.d.ts +2 -2
- package/dist/esm/Message/QuickResponse/QuickResponse.js +7 -6
- 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 +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTile.js +7 -20
- 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 +12 -23
- package/dist/esm/Message/UserFeedback/UserFeedback.test.js +21 -21
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +2 -2
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +20 -44
- package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +26 -36
- package/dist/esm/MessageBar/AttachButton.d.ts +1 -2
- package/dist/esm/MessageBar/AttachButton.js +6 -12
- package/dist/esm/MessageBar/AttachButton.test.js +10 -10
- package/dist/esm/MessageBar/MessageBar.d.ts +2 -2
- package/dist/esm/MessageBar/MessageBar.js +21 -27
- package/dist/esm/MessageBar/MessageBar.test.js +34 -48
- package/dist/esm/MessageBar/MicrophoneButton.d.ts +2 -2
- package/dist/esm/MessageBar/MicrophoneButton.js +7 -11
- package/dist/esm/MessageBar/SendButton.d.ts +3 -2
- package/dist/esm/MessageBar/SendButton.js +3 -8
- package/dist/esm/MessageBar/SendButton.test.js +4 -4
- package/dist/esm/MessageBar/StopButton.d.ts +3 -2
- package/dist/esm/MessageBar/StopButton.js +3 -9
- package/dist/esm/MessageBar/StopButton.test.js +4 -4
- package/dist/esm/MessageBox/JumpButton.d.ts +2 -2
- package/dist/esm/MessageBox/JumpButton.js +2 -7
- package/dist/esm/MessageBox/JumpButton.test.js +5 -5
- package/dist/esm/MessageBox/MessageBox.d.ts +3 -3
- package/dist/esm/MessageBox/MessageBox.js +13 -20
- package/dist/esm/MessageBox/MessageBox.test.js +7 -10
- package/dist/esm/PreviewAttachment/PreviewAttachment.d.ts +12 -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 +3 -3
- package/dist/esm/ResponseActions/ResponseActionButton.js +5 -5
- package/dist/esm/ResponseActions/ResponseActionButton.test.js +7 -7
- package/dist/esm/ResponseActions/ResponseActions.d.ts +2 -2
- package/dist/esm/ResponseActions/ResponseActions.js +10 -14
- package/dist/esm/ResponseActions/ResponseActions.test.js +15 -15
- package/dist/esm/Settings/SettingsForm.d.ts +2 -2
- package/dist/esm/Settings/SettingsForm.js +2 -5
- package/dist/esm/Settings/SettingsForm.test.js +6 -6
- 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 +16 -39
- package/dist/esm/SourcesCard/SourcesCard.test.js +19 -19
- package/dist/esm/TermsOfUse/TermsOfUse.d.ts +3 -3
- package/dist/esm/TermsOfUse/TermsOfUse.js +4 -16
- package/dist/esm/TermsOfUse/TermsOfUse.test.js +10 -12
- package/package.json +3 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachMenu.tsx +9 -9
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentEdit.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +10 -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 +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/PreviewAttachment.tsx +5 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +11 -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 +10 -10
- 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 +4 -4
- package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithSelection.tsx +5 -5
- 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 +16 -23
- 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 +82 -39
- package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +3 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +1 -0
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +17 -23
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +13 -13
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +14 -14
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotCompact.tsx +17 -23
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +15 -20
- 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/src/AttachMenu/AttachMenu.tsx +2 -2
- package/src/AttachmentEdit/AttachmentEdit.test.tsx +46 -2
- package/src/AttachmentEdit/AttachmentEdit.tsx +25 -7
- package/src/Chatbot/Chatbot.test.tsx +0 -1
- package/src/Chatbot/Chatbot.tsx +5 -3
- 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.test.tsx +3 -3
- package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +8 -6
- package/src/ChatbotConversationHistoryNav/EmptyState.tsx +2 -2
- package/src/ChatbotConversationHistoryNav/LoadingState.tsx +2 -2
- package/src/ChatbotFooter/ChatbotFooter.test.tsx +0 -1
- package/src/ChatbotFooter/ChatbotFooter.tsx +3 -3
- package/src/ChatbotFooter/ChatbotFooternote.test.tsx +0 -1
- package/src/ChatbotFooter/ChatbotFootnote.tsx +6 -4
- package/src/ChatbotHeader/ChatbotHeader.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeader.tsx +3 -6
- package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderActions.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +5 -4
- package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderMain.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +7 -7
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +9 -1
- package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +12 -5
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +9 -1
- package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +20 -6
- package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +0 -1
- package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +2 -2
- package/src/ChatbotModal/ChatbotModal.test.tsx +0 -1
- package/src/ChatbotModal/ChatbotModal.tsx +2 -2
- package/src/ChatbotPopover/ChatbotPopover.tsx +3 -3
- package/src/ChatbotToggle/ChatbotToggle.test.tsx +0 -1
- package/src/ChatbotToggle/ChatbotToggle.tsx +5 -3
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +0 -1
- package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx +2 -2
- package/src/CodeModal/CodeModal.test.tsx +29 -2
- package/src/CodeModal/CodeModal.tsx +18 -8
- 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 +1 -1
- package/src/FileDetailsLabel/FileDetailsLabel.test.tsx +0 -1
- package/src/FileDetailsLabel/FileDetailsLabel.tsx +1 -1
- package/src/FileDropZone/FileDropZone.test.tsx +0 -1
- package/src/FileDropZone/FileDropZone.tsx +4 -3
- package/src/LoadingMessage/LoadingMessage.test.tsx +0 -1
- package/src/LoadingMessage/LoadingMessage.tsx +2 -2
- package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +7 -7
- 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.test.tsx +3 -3
- package/src/Message/Message.tsx +12 -13
- package/src/Message/MessageInput.tsx +5 -5
- package/src/Message/MessageLoading.tsx +0 -2
- package/src/Message/QuickResponse/QuickResponse.tsx +4 -3
- package/src/Message/QuickStarts/FallbackImg.tsx +4 -3
- package/src/Message/QuickStarts/QuickStartTile.tsx +3 -3
- 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.tsx +1 -2
- package/src/Message/UserFeedback/CloseButton.tsx +2 -2
- package/src/Message/UserFeedback/UserFeedback.test.tsx +0 -1
- package/src/Message/UserFeedback/UserFeedback.tsx +8 -6
- package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +0 -1
- package/src/Message/UserFeedback/UserFeedbackComplete.tsx +16 -14
- package/src/MessageBar/AttachButton.test.tsx +0 -1
- package/src/MessageBar/AttachButton.tsx +5 -3
- package/src/MessageBar/MessageBar.test.tsx +0 -1
- package/src/MessageBar/MessageBar.tsx +19 -18
- package/src/MessageBar/MicrophoneButton.tsx +8 -6
- package/src/MessageBar/SendButton.test.tsx +0 -1
- package/src/MessageBar/SendButton.tsx +3 -2
- package/src/MessageBar/StopButton.test.tsx +0 -1
- package/src/MessageBar/StopButton.tsx +3 -2
- package/src/MessageBox/JumpButton.test.tsx +0 -1
- package/src/MessageBox/JumpButton.tsx +2 -2
- package/src/MessageBox/MessageBox.test.tsx +2 -2
- package/src/MessageBox/MessageBox.tsx +15 -13
- package/src/PreviewAttachment/PreviewAttachment.test.tsx +44 -2
- package/src/PreviewAttachment/PreviewAttachment.tsx +24 -6
- package/src/ResponseActions/ResponseActionButton.test.tsx +0 -1
- package/src/ResponseActions/ResponseActionButton.tsx +4 -3
- package/src/ResponseActions/ResponseActions.test.tsx +0 -1
- package/src/ResponseActions/ResponseActions.tsx +8 -7
- package/src/Settings/SettingsForm.test.tsx +0 -1
- package/src/Settings/SettingsForm.tsx +2 -7
- package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx +2 -2
- package/src/SourcesCard/SourcesCard.test.tsx +0 -1
- package/src/SourcesCard/SourcesCard.tsx +7 -7
- package/src/TermsOfUse/TermsOfUse.test.tsx +0 -1
- package/src/TermsOfUse/TermsOfUse.tsx +6 -5
- package/tsconfig.cjs.json +0 -1
- package/tsconfig.json +3 -3
@@ -10,21 +10,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
}
|
11
11
|
return t;
|
12
12
|
};
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
-
};
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
|
18
|
-
|
19
|
-
// ============================================================================
|
20
|
-
const react_1 = __importDefault(require("react"));
|
14
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
15
|
+
const react_1 = require("react");
|
21
16
|
// Import PatternFly components
|
22
17
|
const react_core_1 = require("@patternfly/react-core");
|
23
18
|
const react_icons_1 = require("@patternfly/react-icons");
|
24
19
|
const SourcesCard = (_a) => {
|
25
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', isCompact } = _a, props = __rest(_a, ["className", "isDisabled", "paginationAriaLabel", "sources", "sourceWord", "sourceWordPlural", "toNextPageAriaLabel", "toPreviousPageAriaLabel", "onNextClick", "onPreviousClick", "onSetPage", "showMoreWords", "showLessWords", "isCompact"]);
|
26
|
-
const [page, setPage] = react_1.
|
27
|
-
const [isExpanded, setIsExpanded] = react_1.
|
21
|
+
const [page, setPage] = (0, react_1.useState)(1);
|
22
|
+
const [isExpanded, setIsExpanded] = (0, react_1.useState)(false);
|
28
23
|
const onToggle = (_event, isExpanded) => {
|
29
24
|
setIsExpanded(isExpanded);
|
30
25
|
};
|
@@ -34,41 +29,20 @@ const SourcesCard = (_a) => {
|
|
34
29
|
};
|
35
30
|
const renderTitle = (title) => {
|
36
31
|
if (title) {
|
37
|
-
return
|
32
|
+
return (0, jsx_runtime_1.jsx)(react_core_1.Truncate, { content: title });
|
38
33
|
}
|
39
34
|
return `Source ${page}`;
|
40
35
|
};
|
41
|
-
return (
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
react_1.default.createElement("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel },
|
53
|
-
react_1.default.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.plain, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
54
|
-
const newPage = page >= 1 ? page - 1 : 1;
|
55
|
-
onPreviousClick && onPreviousClick(event, newPage);
|
56
|
-
handleNewPage(event, newPage);
|
57
|
-
}, "aria-label": toPreviousPageAriaLabel },
|
58
|
-
react_1.default.createElement(react_core_1.Icon, { iconSize: "lg" },
|
59
|
-
react_1.default.createElement("svg", { className: "pf-v6-svg", viewBox: "0 0 280 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em" },
|
60
|
-
react_1.default.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" })))),
|
61
|
-
react_1.default.createElement("span", { "aria-hidden": "true" },
|
62
|
-
page,
|
63
|
-
"/",
|
64
|
-
sources.length),
|
65
|
-
react_1.default.createElement(react_core_1.Button, { variant: react_core_1.ButtonVariant.plain, isDisabled: isDisabled || page === sources.length, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
|
66
|
-
const newPage = page + 1 <= sources.length ? page + 1 : sources.length;
|
67
|
-
onNextClick && onNextClick(event, newPage);
|
68
|
-
handleNewPage(event, newPage);
|
69
|
-
} },
|
70
|
-
react_1.default.createElement(react_core_1.Icon, { isInline: true, iconSize: "lg" },
|
71
|
-
react_1.default.createElement("svg", { className: "pf-v6-svg", viewBox: "0 0 180 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em" },
|
72
|
-
react_1.default.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" })))))))))));
|
36
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "pf-chatbot__source", children: [(0, jsx_runtime_1.jsx)("span", { children: (0, react_core_1.pluralize)(sources.length, sourceWord, sourceWordPlural) }), (0, jsx_runtime_1.jsxs)(react_core_1.Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [(0, jsx_runtime_1.jsx)(react_core_1.CardTitle, { className: "pf-chatbot__sources-card-title", children: (0, jsx_runtime_1.jsx)(react_core_1.Button, { component: "a", variant: react_core_1.ButtonVariant.link, href: sources[page - 1].link, icon: sources[page - 1].isExternal ? (0, jsx_runtime_1.jsx)(react_icons_1.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 && ((0, jsx_runtime_1.jsx)(react_core_1.CardBody, { className: `pf-chatbot__sources-card-body`, children: sources[page - 1].hasShowMore ? (
|
37
|
+
// prevents extra VO announcements of button text - parent Message has aria-live
|
38
|
+
(0, jsx_runtime_1.jsx)("div", { "aria-live": "off", children: (0, jsx_runtime_1.jsx)(react_core_1.ExpandableSection, { variant: react_core_1.ExpandableSectionVariant.truncate, toggleText: isExpanded ? showLessWords : showMoreWords, onToggle: onToggle, isExpanded: isExpanded, truncateMaxLines: 2, children: sources[page - 1].body }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "pf-chatbot__sources-card-body-text", children: sources[page - 1].body })) })), sources.length > 1 && ((0, jsx_runtime_1.jsx)(react_core_1.CardFooter, { className: "pf-chatbot__sources-card-footer-container", children: (0, jsx_runtime_1.jsx)("div", { className: "pf-chatbot__sources-card-footer", children: (0, jsx_runtime_1.jsxs)("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel, children: [(0, jsx_runtime_1.jsx)(react_core_1.Button, { variant: react_core_1.ButtonVariant.plain, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
39
|
+
const newPage = page >= 1 ? page - 1 : 1;
|
40
|
+
onPreviousClick && onPreviousClick(event, newPage);
|
41
|
+
handleNewPage(event, newPage);
|
42
|
+
}, "aria-label": toPreviousPageAriaLabel, children: (0, jsx_runtime_1.jsx)(react_core_1.Icon, { iconSize: "lg", children: (0, jsx_runtime_1.jsx)("svg", { className: "pf-v6-svg", viewBox: "0 0 280 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em", children: (0, jsx_runtime_1.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" }) }) }) }), (0, jsx_runtime_1.jsxs)("span", { "aria-hidden": "true", children: [page, "/", sources.length] }), (0, jsx_runtime_1.jsx)(react_core_1.Button, { variant: react_core_1.ButtonVariant.plain, isDisabled: isDisabled || page === sources.length, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
|
43
|
+
const newPage = page + 1 <= sources.length ? page + 1 : sources.length;
|
44
|
+
onNextClick && onNextClick(event, newPage);
|
45
|
+
handleNewPage(event, newPage);
|
46
|
+
}, children: (0, jsx_runtime_1.jsx)(react_core_1.Icon, { isInline: true, iconSize: "lg", children: (0, jsx_runtime_1.jsx)("svg", { className: "pf-v6-svg", viewBox: "0 0 180 500", fill: "currentColor", "aria-hidden": "true", role: "img", width: "1em", height: "1em", children: (0, jsx_runtime_1.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" }) }) }) })] }) }) }))] }))] }));
|
73
47
|
};
|
74
48
|
exports.default = SourcesCard;
|
@@ -12,149 +12,149 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
const
|
16
|
-
const
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
16
|
+
const react_1 = require("@testing-library/react");
|
17
17
|
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
18
18
|
require("@testing-library/jest-dom");
|
19
19
|
const SourcesCard_1 = __importDefault(require("./SourcesCard"));
|
20
20
|
describe('SourcesCard', () => {
|
21
21
|
it('should render card correctly if one source with only a link is passed in', () => {
|
22
|
-
(0,
|
23
|
-
expect(
|
24
|
-
expect(
|
22
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [{ link: '' }] }));
|
23
|
+
expect(react_1.screen.getByText('1 source')).toBeTruthy();
|
24
|
+
expect(react_1.screen.getByText('Source 1')).toBeTruthy();
|
25
25
|
// no buttons or navigation when there is only 1 source
|
26
|
-
expect(
|
27
|
-
expect(
|
26
|
+
expect(react_1.screen.queryByRole('button')).toBeFalsy();
|
27
|
+
expect(react_1.screen.queryByText('1/1')).toBeFalsy();
|
28
28
|
});
|
29
29
|
it('should render card correctly if one source with a title is passed in', () => {
|
30
|
-
(0,
|
31
|
-
expect(
|
32
|
-
expect(
|
30
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [{ title: 'How to make an apple pie', link: '' }] }));
|
31
|
+
expect(react_1.screen.getByText('1 source')).toBeTruthy();
|
32
|
+
expect(react_1.screen.getByText('How to make an apple pie')).toBeTruthy();
|
33
33
|
});
|
34
34
|
it('should render card correctly if one source with a body is passed in', () => {
|
35
|
-
(0,
|
36
|
-
expect(
|
37
|
-
expect(
|
35
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [{ link: '', body: 'To make an apple pie, you must first...' }] }));
|
36
|
+
expect(react_1.screen.getByText('1 source')).toBeTruthy();
|
37
|
+
expect(react_1.screen.getByText('To make an apple pie, you must first...')).toBeTruthy();
|
38
38
|
});
|
39
39
|
it('should render card correctly if one source with a title and body is passed in', () => {
|
40
|
-
(0,
|
41
|
-
expect(
|
42
|
-
expect(
|
43
|
-
expect(
|
40
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [{ title: 'How to make an apple pie', link: '', body: 'To make an apple pie, you must first...' }] }));
|
41
|
+
expect(react_1.screen.getByText('1 source')).toBeTruthy();
|
42
|
+
expect(react_1.screen.getByText('How to make an apple pie')).toBeTruthy();
|
43
|
+
expect(react_1.screen.getByText('To make an apple pie, you must first...')).toBeTruthy();
|
44
44
|
});
|
45
45
|
it('should render multiple cards correctly', () => {
|
46
|
-
(0,
|
46
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
47
47
|
{ title: 'How to make an apple pie', link: '' },
|
48
48
|
{ title: 'How to make cookies', link: '' }
|
49
49
|
] }));
|
50
|
-
expect(
|
51
|
-
expect(
|
52
|
-
expect(
|
53
|
-
|
54
|
-
|
50
|
+
expect(react_1.screen.getByText('2 sources')).toBeTruthy();
|
51
|
+
expect(react_1.screen.getByText('How to make an apple pie')).toBeTruthy();
|
52
|
+
expect(react_1.screen.getByText('1/2')).toBeTruthy();
|
53
|
+
react_1.screen.getByRole('button', { name: /Go to previous page/i });
|
54
|
+
react_1.screen.getByRole('button', { name: /Go to next page/i });
|
55
55
|
});
|
56
56
|
it('should navigate between cards correctly', () => __awaiter(void 0, void 0, void 0, function* () {
|
57
|
-
(0,
|
57
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
58
58
|
{ title: 'How to make an apple pie', link: '' },
|
59
59
|
{ title: 'How to make cookies', link: '' }
|
60
60
|
] }));
|
61
|
-
expect(
|
62
|
-
expect(
|
63
|
-
expect(
|
64
|
-
yield user_event_1.default.click(
|
65
|
-
expect(
|
66
|
-
expect(
|
67
|
-
expect(
|
68
|
-
expect(
|
69
|
-
expect(
|
61
|
+
expect(react_1.screen.getByText('How to make an apple pie')).toBeTruthy();
|
62
|
+
expect(react_1.screen.getByText('1/2')).toBeTruthy();
|
63
|
+
expect(react_1.screen.getByRole('button', { name: /Go to previous page/i })).toBeDisabled();
|
64
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Go to next page/i }));
|
65
|
+
expect(react_1.screen.queryByText('How to make an apple pie')).toBeFalsy();
|
66
|
+
expect(react_1.screen.getByText('How to make cookies')).toBeTruthy();
|
67
|
+
expect(react_1.screen.getByText('2/2')).toBeTruthy();
|
68
|
+
expect(react_1.screen.getByRole('button', { name: /Go to previous page/i })).toBeEnabled();
|
69
|
+
expect(react_1.screen.getByRole('button', { name: /Go to next page/i })).toBeDisabled();
|
70
70
|
}));
|
71
71
|
it('should apply className appropriately', () => {
|
72
|
-
(0,
|
72
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
73
73
|
{ title: 'How to make an apple pie', link: '' },
|
74
74
|
{ title: 'How to make cookies', link: '' }
|
75
75
|
], className: "test" }));
|
76
|
-
const element =
|
76
|
+
const element = react_1.screen.getByRole('navigation');
|
77
77
|
expect(element).toHaveClass('test');
|
78
78
|
});
|
79
79
|
it('should disable pagination appropriately', () => {
|
80
|
-
(0,
|
80
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
81
81
|
{ title: 'How to make an apple pie', link: '' },
|
82
82
|
{ title: 'How to make cookies', link: '' }
|
83
83
|
], isDisabled: true }));
|
84
|
-
expect(
|
85
|
-
expect(
|
84
|
+
expect(react_1.screen.getByRole('button', { name: /Go to previous page/i })).toBeDisabled();
|
85
|
+
expect(react_1.screen.getByRole('button', { name: /Go to next page/i })).toBeDisabled();
|
86
86
|
});
|
87
87
|
it('should render navigation aria label appropriately', () => {
|
88
|
-
(0,
|
88
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
89
89
|
{ title: 'How to make an apple pie', link: '' },
|
90
90
|
{ title: 'How to make cookies', link: '' }
|
91
91
|
] }));
|
92
|
-
expect(
|
92
|
+
expect(react_1.screen.getByRole('navigation', { name: /Pagination/i })).toBeTruthy();
|
93
93
|
});
|
94
94
|
it('should change paginationAriaLabel appropriately', () => {
|
95
|
-
(0,
|
95
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
96
96
|
{ title: 'How to make an apple pie', link: '' },
|
97
97
|
{ title: 'How to make cookies', link: '' }
|
98
98
|
], paginationAriaLabel: "Navegaci\u00F3n" }));
|
99
|
-
expect(
|
99
|
+
expect(react_1.screen.getByRole('navigation', { name: /Navegación/i })).toBeTruthy();
|
100
100
|
});
|
101
101
|
it('should change sourceWord appropriately', () => {
|
102
|
-
(0,
|
103
|
-
expect(
|
102
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [{ title: 'How to make an apple pie', link: '' }], sourceWord: 'fuente' }));
|
103
|
+
expect(react_1.screen.getByText('1 fuente')).toBeTruthy();
|
104
104
|
});
|
105
105
|
it('should sourceWordPlural appropriately', () => {
|
106
|
-
(0,
|
106
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
107
107
|
{ title: 'How to make an apple pie', link: '' },
|
108
108
|
{ title: 'How to make cookies', link: '' }
|
109
109
|
], sourceWordPlural: 'fuentes' }));
|
110
|
-
expect(
|
110
|
+
expect(react_1.screen.getByText('2 fuentes')).toBeTruthy();
|
111
111
|
});
|
112
112
|
it('should change toNextPageAriaLabel appropriately', () => {
|
113
|
-
(0,
|
113
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
114
114
|
{ title: 'How to make an apple pie', link: '' },
|
115
115
|
{ title: 'How to make cookies', link: '' }
|
116
116
|
], toNextPageAriaLabel: "Pase a la siguiente p\u00E1gina" }));
|
117
|
-
expect(
|
117
|
+
expect(react_1.screen.getByRole('button', { name: /Pase a la siguiente página/i })).toBeTruthy();
|
118
118
|
});
|
119
119
|
it('should change toPreviousPageAriaLabel appropriately', () => {
|
120
|
-
(0,
|
120
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
121
121
|
{ title: 'How to make an apple pie', link: '' },
|
122
122
|
{ title: 'How to make cookies', link: '' }
|
123
123
|
], toPreviousPageAriaLabel: "Presione para regresar a la p\u00E1gina anterior" }));
|
124
|
-
expect(
|
124
|
+
expect(react_1.screen.getByRole('button', { name: /Presione para regresar a la página anterior/i })).toBeTruthy();
|
125
125
|
});
|
126
126
|
it('should call onNextClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
127
127
|
const spy = jest.fn();
|
128
|
-
(0,
|
128
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
129
129
|
{ title: 'How to make an apple pie', link: '' },
|
130
130
|
{ title: 'How to make cookies', link: '' }
|
131
131
|
], onNextClick: spy }));
|
132
|
-
yield user_event_1.default.click(
|
132
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Go to next page/i }));
|
133
133
|
expect(spy).toHaveBeenCalled();
|
134
134
|
}));
|
135
135
|
it('should call onPreviousClick appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
136
136
|
const spy = jest.fn();
|
137
|
-
(0,
|
137
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
138
138
|
{ title: 'How to make an apple pie', link: '' },
|
139
139
|
{ title: 'How to make cookies', link: '' }
|
140
140
|
], onPreviousClick: spy }));
|
141
|
-
yield user_event_1.default.click(
|
142
|
-
yield user_event_1.default.click(
|
141
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Go to next page/i }));
|
142
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Go to previous page/i }));
|
143
143
|
expect(spy).toHaveBeenCalled();
|
144
144
|
}));
|
145
145
|
it('should call onSetPage appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
146
146
|
const spy = jest.fn();
|
147
|
-
(0,
|
147
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
148
148
|
{ title: 'How to make an apple pie', link: '' },
|
149
149
|
{ title: 'How to make cookies', link: '' }
|
150
150
|
], onSetPage: spy }));
|
151
|
-
yield user_event_1.default.click(
|
151
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Go to next page/i }));
|
152
152
|
expect(spy).toHaveBeenCalledTimes(1);
|
153
|
-
yield user_event_1.default.click(
|
153
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Go to previous page/i }));
|
154
154
|
expect(spy).toHaveBeenCalledTimes(2);
|
155
155
|
}));
|
156
156
|
it('should handle showMore appropriately', () => __awaiter(void 0, void 0, void 0, function* () {
|
157
|
-
(0,
|
157
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(SourcesCard_1.default, { sources: [
|
158
158
|
{
|
159
159
|
title: 'Getting started with Red Hat OpenShift',
|
160
160
|
link: '#',
|
@@ -172,6 +172,6 @@ describe('SourcesCard', () => {
|
|
172
172
|
body: 'OKD is a distribution of Kubernetes optimized for continuous application development and multi-tenant deployment. OKD also serves as the upstream code base upon ...'
|
173
173
|
}
|
174
174
|
] }));
|
175
|
-
expect(
|
175
|
+
expect(react_1.screen.getByRole('region')).toHaveAttribute('class', 'pf-v6-c-expandable-section__content');
|
176
176
|
}));
|
177
177
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent } from 'react';
|
2
2
|
import { ModalProps } from '@patternfly/react-core';
|
3
3
|
import { ChatbotDisplayMode } from '../Chatbot';
|
4
4
|
export interface TermsOfUseProps extends ModalProps {
|
@@ -31,6 +31,6 @@ export interface TermsOfUseProps extends ModalProps {
|
|
31
31
|
/** Sets modal to compact styling. */
|
32
32
|
isCompact?: boolean;
|
33
33
|
}
|
34
|
-
export declare const TermsOfUseBase:
|
35
|
-
declare const TermsOfUse:
|
34
|
+
export declare const TermsOfUseBase: FunctionComponent<TermsOfUseProps>;
|
35
|
+
declare const TermsOfUse: import("react").ForwardRefExoticComponent<Omit<TermsOfUseProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
36
36
|
export default TermsOfUse;
|
@@ -15,10 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
exports.TermsOfUseBase = void 0;
|
18
|
-
|
19
|
-
|
20
|
-
// ============================================================================
|
21
|
-
const react_1 = __importDefault(require("react"));
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
19
|
+
const react_1 = require("react");
|
22
20
|
const react_core_1 = require("@patternfly/react-core");
|
23
21
|
const Chatbot_1 = require("../Chatbot");
|
24
22
|
const ChatbotModal_1 = __importDefault(require("../ChatbotModal/ChatbotModal"));
|
@@ -31,19 +29,9 @@ const TermsOfUseBase = (_a) => {
|
|
31
29
|
const handleSecondaryAction = (_event) => {
|
32
30
|
onSecondaryAction(_event);
|
33
31
|
};
|
34
|
-
const modal = (
|
35
|
-
react_1.default.createElement("section", { className: `pf-chatbot__terms-of-use--section`, "aria-label": title, tabIndex: -1, ref: innerRef },
|
36
|
-
react_1.default.createElement(react_core_1.ModalHeader, { className: "pf-chatbot__terms-of-use--modal-header" },
|
37
|
-
react_1.default.createElement("div", { className: "pf-chatbot__terms-of-use--header" },
|
38
|
-
!isCompact && image && altText && (react_1.default.createElement("img", { src: image, className: "pf-chatbot__terms-of-use--image", alt: altText })),
|
39
|
-
react_1.default.createElement("h1", { className: "pf-chatbot__terms-of-use--title" }, title))),
|
40
|
-
react_1.default.createElement(react_core_1.ModalBody, { className: "pf-chatbot__terms-of-use--modal-body" },
|
41
|
-
react_1.default.createElement(react_core_1.Content, null, children)),
|
42
|
-
react_1.default.createElement(react_core_1.ModalFooter, { className: "pf-chatbot__terms-of-use--footer" },
|
43
|
-
react_1.default.createElement(react_core_1.Button, { isBlock: true, key: "terms-of-use-modal-primary", variant: "primary", onClick: handlePrimaryAction, form: "terms-of-use-form", size: "lg" }, primaryActionBtn),
|
44
|
-
react_1.default.createElement(react_core_1.Button, { isBlock: true, key: "terms-of-use-modal-secondary", variant: "secondary", onClick: handleSecondaryAction, size: "lg" }, secondaryActionBtn)))));
|
32
|
+
const modal = ((0, jsx_runtime_1.jsx)(ChatbotModal_1.default, Object.assign({ isOpen: isModalOpen, ouiaId: ouiaId, "aria-labelledby": "terms-of-use-title", "aria-describedby": "terms-of-use-modal", className: `pf-chatbot__terms-of-use-modal pf-chatbot__terms-of-use-modal--${displayMode} ${isCompact ? 'pf-m-compact' : ''} ${className ? className : ''}`, displayMode: displayMode }, props, { children: (0, jsx_runtime_1.jsxs)("section", { className: `pf-chatbot__terms-of-use--section`, "aria-label": title, tabIndex: -1, ref: innerRef, children: [(0, jsx_runtime_1.jsx)(react_core_1.ModalHeader, { className: "pf-chatbot__terms-of-use--modal-header", children: (0, jsx_runtime_1.jsxs)("div", { className: "pf-chatbot__terms-of-use--header", children: [!isCompact && image && altText && ((0, jsx_runtime_1.jsx)("img", { src: image, className: "pf-chatbot__terms-of-use--image", alt: altText })), (0, jsx_runtime_1.jsx)("h1", { className: "pf-chatbot__terms-of-use--title", children: title })] }) }), (0, jsx_runtime_1.jsx)(react_core_1.ModalBody, { className: "pf-chatbot__terms-of-use--modal-body", children: (0, jsx_runtime_1.jsx)(react_core_1.Content, { children: children }) }), (0, jsx_runtime_1.jsxs)(react_core_1.ModalFooter, { className: "pf-chatbot__terms-of-use--footer", children: [(0, jsx_runtime_1.jsx)(react_core_1.Button, { isBlock: true, variant: "primary", onClick: handlePrimaryAction, form: "terms-of-use-form", size: "lg", children: primaryActionBtn }, "terms-of-use-modal-primary"), (0, jsx_runtime_1.jsx)(react_core_1.Button, { isBlock: true, variant: "secondary", onClick: handleSecondaryAction, size: "lg", children: secondaryActionBtn }, "terms-of-use-modal-secondary")] })] }) })));
|
45
33
|
return modal;
|
46
34
|
};
|
47
35
|
exports.TermsOfUseBase = TermsOfUseBase;
|
48
|
-
const TermsOfUse = react_1.
|
36
|
+
const TermsOfUse = (0, react_1.forwardRef)((props, ref) => ((0, jsx_runtime_1.jsx)(exports.TermsOfUseBase, Object.assign({ innerRef: ref }, props))));
|
49
37
|
exports.default = TermsOfUse;
|
@@ -12,8 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
const
|
16
|
-
const
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
16
|
+
const react_1 = require("@testing-library/react");
|
17
17
|
require("@testing-library/jest-dom");
|
18
18
|
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
19
19
|
const TermsOfUse_1 = __importDefault(require("./TermsOfUse"));
|
@@ -21,58 +21,56 @@ const react_core_1 = require("@patternfly/react-core");
|
|
21
21
|
const handleModalToggle = jest.fn();
|
22
22
|
const onPrimaryAction = jest.fn();
|
23
23
|
const onSecondaryAction = jest.fn();
|
24
|
-
const body = (
|
25
|
-
react_1.default.createElement("h1", null, "Heading 1"),
|
26
|
-
react_1.default.createElement("p", null, "Legal text")));
|
24
|
+
const body = ((0, jsx_runtime_1.jsxs)(react_core_1.Content, { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Heading 1" }), (0, jsx_runtime_1.jsx)("p", { children: "Legal text" })] }));
|
27
25
|
describe('TermsOfUse', () => {
|
28
26
|
afterEach(() => {
|
29
27
|
jest.clearAllMocks();
|
30
28
|
});
|
31
29
|
it('should render modal correctly', () => {
|
32
|
-
(0,
|
33
|
-
expect(
|
34
|
-
expect(
|
35
|
-
expect(
|
36
|
-
expect(
|
37
|
-
expect(
|
38
|
-
expect(
|
39
|
-
expect(
|
30
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, ouiaId: "Terms", children: body }));
|
31
|
+
expect(react_1.screen.getByRole('heading', { name: /Terms of use/i })).toBeTruthy();
|
32
|
+
expect(react_1.screen.getByRole('button', { name: /Accept/i })).toBeTruthy();
|
33
|
+
expect(react_1.screen.getByRole('button', { name: /Decline/i })).toBeTruthy();
|
34
|
+
expect(react_1.screen.getByRole('heading', { name: /Heading 1/i })).toBeTruthy();
|
35
|
+
expect(react_1.screen.getByText(/Legal text/i)).toBeTruthy();
|
36
|
+
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__terms-of-use-modal');
|
37
|
+
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__terms-of-use-modal--default');
|
40
38
|
});
|
41
39
|
it('should handle image and altText props', () => {
|
42
|
-
(0,
|
43
|
-
expect(
|
44
|
-
expect(
|
40
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, image: "./image.png", altText: "Test image", children: body }));
|
41
|
+
expect(react_1.screen.getByRole('img')).toBeTruthy();
|
42
|
+
expect(react_1.screen.getByRole('img')).toHaveAttribute('alt', 'Test image');
|
45
43
|
});
|
46
44
|
it('should handle className prop', () => {
|
47
|
-
(0,
|
48
|
-
expect(
|
49
|
-
expect(
|
50
|
-
expect(
|
45
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, className: "test", children: body }));
|
46
|
+
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__terms-of-use-modal');
|
47
|
+
expect(react_1.screen.getByRole('dialog')).toHaveClass('pf-chatbot__terms-of-use-modal--default');
|
48
|
+
expect(react_1.screen.getByRole('dialog')).toHaveClass('test');
|
51
49
|
});
|
52
50
|
it('should handle title prop', () => {
|
53
|
-
(0,
|
54
|
-
expect(
|
55
|
-
expect(
|
51
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, title: "Updated title", children: body }));
|
52
|
+
expect(react_1.screen.getByRole('heading', { name: /Updated title/i })).toBeTruthy();
|
53
|
+
expect(react_1.screen.queryByRole('heading', { name: /Terms of use/i })).toBeFalsy();
|
56
54
|
});
|
57
55
|
it('should handle primary button prop', () => {
|
58
|
-
(0,
|
59
|
-
expect(
|
60
|
-
expect(
|
56
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, primaryActionBtn: "First", children: body }));
|
57
|
+
expect(react_1.screen.getByRole('button', { name: /First/i })).toBeTruthy();
|
58
|
+
expect(react_1.screen.queryByRole('button', { name: /Accept/i })).toBeFalsy();
|
61
59
|
});
|
62
60
|
it('should handle secondary button prop', () => {
|
63
|
-
(0,
|
64
|
-
expect(
|
65
|
-
expect(
|
61
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, secondaryActionBtn: "Second", children: body }));
|
62
|
+
expect(react_1.screen.getByRole('button', { name: /Second/i })).toBeTruthy();
|
63
|
+
expect(react_1.screen.queryByRole('button', { name: /Deny/i })).toBeFalsy();
|
66
64
|
});
|
67
65
|
it('should handle primary button click', () => __awaiter(void 0, void 0, void 0, function* () {
|
68
|
-
(0,
|
69
|
-
yield user_event_1.default.click(
|
66
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onPrimaryAction: onPrimaryAction, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, children: body }));
|
67
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Accept/i }));
|
70
68
|
expect(onPrimaryAction).toHaveBeenCalledTimes(1);
|
71
69
|
expect(handleModalToggle).toHaveBeenCalledTimes(1);
|
72
70
|
}));
|
73
71
|
it('should handle secondary button click', () => __awaiter(void 0, void 0, void 0, function* () {
|
74
|
-
(0,
|
75
|
-
yield user_event_1.default.click(
|
72
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(TermsOfUse_1.default, { isModalOpen: true, onSecondaryAction: onSecondaryAction, handleModalToggle: handleModalToggle, children: body }));
|
73
|
+
yield user_event_1.default.click(react_1.screen.getByRole('button', { name: /Decline/i }));
|
76
74
|
expect(onSecondaryAction).toHaveBeenCalledTimes(1);
|
77
75
|
expect(handleModalToggle).not.toHaveBeenCalled();
|
78
76
|
}));
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent } from 'react';
|
2
2
|
import { DropdownProps, DropdownToggleProps, DropdownPopperProps } from '@patternfly/react-core';
|
3
3
|
export interface ExtendedDropdownPopperProps extends DropdownPopperProps {
|
4
4
|
distance: string;
|
@@ -25,5 +25,5 @@ export interface AttachMenuProps extends DropdownProps {
|
|
25
25
|
/** Toggle to be rendered */
|
26
26
|
toggle: DropdownToggleProps | ((toggleRef: React.RefObject<any>) => React.ReactNode);
|
27
27
|
}
|
28
|
-
export declare const AttachMenu:
|
28
|
+
export declare const AttachMenu: FunctionComponent<AttachMenuProps>;
|
29
29
|
export default AttachMenu;
|
@@ -9,18 +9,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
9
9
|
}
|
10
10
|
return t;
|
11
11
|
};
|
12
|
-
|
13
|
-
// Chatbot Attachment Menu
|
14
|
-
// ============================================================================
|
15
|
-
import React from 'react';
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
16
13
|
// Import PatternFly components
|
17
14
|
import { MenuSearch, MenuSearchInput, SearchInput, Dropdown } from '@patternfly/react-core';
|
18
15
|
export const AttachMenu = (_a) => {
|
19
16
|
var { className, filteredItems, handleTextInputChange, isOpen, popperProps = undefined, onOpenChange, onOpenChangeKeys, onSelect, searchInputPlaceholder, searchInputAriaLabel = 'Filter menu items', toggle } = _a, props = __rest(_a, ["className", "filteredItems", "handleTextInputChange", "isOpen", "popperProps", "onOpenChange", "onOpenChangeKeys", "onSelect", "searchInputPlaceholder", "searchInputAriaLabel", "toggle"]);
|
20
|
-
return (
|
21
|
-
React.createElement(MenuSearch, null,
|
22
|
-
React.createElement(MenuSearchInput, null,
|
23
|
-
React.createElement(SearchInput, { "aria-label": searchInputAriaLabel, onChange: (_event, value) => handleTextInputChange(value), placeholder: searchInputPlaceholder }))),
|
24
|
-
filteredItems));
|
17
|
+
return (_jsxs(Dropdown, Object.assign({ className: `pf-chatbot__menu ${className !== null && className !== void 0 ? className : ''}`, isOpen: isOpen, onOpenChange: (isOpen) => onOpenChange(isOpen), onOpenChangeKeys: onOpenChangeKeys !== null && onOpenChangeKeys !== void 0 ? onOpenChangeKeys : ['Esc'], toggle: toggle, popperProps: popperProps, onSelect: onSelect }, props, { children: [_jsx(MenuSearch, { children: _jsx(MenuSearchInput, { children: _jsx(SearchInput, { "aria-label": searchInputAriaLabel, onChange: (_event, value) => handleTextInputChange(value), placeholder: searchInputPlaceholder }) }) }), filteredItems] })));
|
25
18
|
};
|
26
19
|
export default AttachMenu;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import type { FunctionComponent } from 'react';
|
2
2
|
import { ChatbotDisplayMode } from '../Chatbot';
|
3
3
|
export interface AttachmentEditProps {
|
4
4
|
/** Text shown in code editor */
|
@@ -19,6 +19,16 @@ export interface AttachmentEditProps {
|
|
19
19
|
displayMode?: ChatbotDisplayMode;
|
20
20
|
/** Sets modal to compact styling. */
|
21
21
|
isCompact?: boolean;
|
22
|
+
/** Primary action button text */
|
23
|
+
primaryActionButtonText?: string;
|
24
|
+
/** Secondary action button text */
|
25
|
+
secondaryActionButtonText?: string;
|
26
|
+
/** Class applied to modal header */
|
27
|
+
modalHeaderClassName?: string;
|
28
|
+
/** Class applied to modal body */
|
29
|
+
modalBodyClassName?: string;
|
30
|
+
/** Class applied to modal footer */
|
31
|
+
modalFooterClassName?: string;
|
22
32
|
}
|
23
|
-
export declare const AttachmentEdit:
|
33
|
+
export declare const AttachmentEdit: FunctionComponent<AttachmentEditProps>;
|
24
34
|
export default AttachmentEdit;
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
// Attachment Edit - Chatbot Code Snippet Editor
|
3
|
-
// ============================================================================
|
4
|
-
import React from 'react';
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
2
|
import CodeModal from '../CodeModal';
|
6
3
|
import { ChatbotDisplayMode } from '../Chatbot';
|
7
|
-
export const AttachmentEdit = ({ fileName, code, handleModalToggle, isModalOpen, onCancel, onSave, title = 'Edit attachment', displayMode = ChatbotDisplayMode.default, isCompact }) => {
|
4
|
+
export const AttachmentEdit = ({ fileName, code, handleModalToggle, isModalOpen, onCancel, onSave, title = 'Edit attachment', displayMode = ChatbotDisplayMode.default, isCompact, modalHeaderClassName, modalBodyClassName, modalFooterClassName, primaryActionButtonText = 'Save', secondaryActionButtonText = 'Cancel' }) => {
|
8
5
|
const handleSave = (_event, code) => {
|
9
6
|
handleModalToggle(_event);
|
10
7
|
onSave(_event, code);
|
@@ -13,6 +10,6 @@ export const AttachmentEdit = ({ fileName, code, handleModalToggle, isModalOpen,
|
|
13
10
|
handleModalToggle(_event);
|
14
11
|
onCancel(_event);
|
15
12
|
};
|
16
|
-
return (
|
13
|
+
return (_jsx(CodeModal, { code: code, fileName: fileName, handleModalToggle: handleModalToggle, isModalOpen: isModalOpen, onPrimaryAction: handleSave, onSecondaryAction: handleCancel, primaryActionBtn: primaryActionButtonText, secondaryActionBtn: secondaryActionButtonText, title: title, displayMode: displayMode, isCompact: isCompact, modalHeaderClassName: modalHeaderClassName, modalBodyClassName: modalBodyClassName, modalFooterClassName: modalFooterClassName }));
|
17
14
|
};
|
18
15
|
export default AttachmentEdit;
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
import '@testing-library/jest-dom';
|