@pega/cosmos-react-demos 2.1.1 → 3.0.0-dev.1.0
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/jsx/build/AppHeader/AppHeader.stories.d.ts +2 -1
- package/jsx/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
- package/jsx/build/AppHeader/AppHeader.stories.jsx +46 -13
- package/jsx/build/AppHeader/AppHeader.stories.jsx.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts +2 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.jsx +50 -17
- package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +7 -0
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +50 -0
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +9 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx +45 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -0
- package/jsx/build/LifeCycle/LifeCycle.mocks.js +1 -1
- package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx +52 -34
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.jsx +6 -4
- package/jsx/core/Avatar/Avatar.stories.jsx.map +1 -1
- package/jsx/core/Banner/Banner.mocks.d.ts +18 -0
- package/jsx/core/Banner/Banner.mocks.d.ts.map +1 -0
- package/jsx/core/Banner/Banner.mocks.jsx +41 -0
- package/jsx/core/Banner/Banner.mocks.jsx.map +1 -0
- package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
- package/jsx/core/Banner/Banner.stories.jsx +1 -39
- package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
- package/jsx/core/Button/Button.stories.d.ts.map +1 -1
- package/jsx/core/Button/Button.stories.jsx +3 -3
- package/jsx/core/Button/Button.stories.jsx.map +1 -1
- package/jsx/core/Configuration/Configuration.stories.jsx +1 -1
- package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
- package/jsx/core/DateTime/DateTimeDisplay.stories.jsx +1 -0
- package/jsx/core/DateTime/DateTimeDisplay.stories.jsx.map +1 -1
- package/jsx/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -1
- package/jsx/core/ExpandCollapse/ExpandCollapse.styles.js +5 -0
- package/jsx/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +21 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +36 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -0
- package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +1 -34
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
- package/jsx/core/File/FileDisplay.stories.d.ts +8 -1
- package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
- package/jsx/core/File/FileDisplay.stories.jsx +37 -2
- package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
- package/jsx/core/Flex/Flex.styles.d.ts +2 -2
- package/jsx/core/Flex/Flex.styles.d.ts.map +1 -1
- package/jsx/core/Flex/Flex.styles.js +17 -17
- package/jsx/core/Flex/Flex.styles.js.map +1 -1
- package/jsx/core/Flex/FlexContainer.stories.d.ts +2 -0
- package/jsx/core/Flex/FlexContainer.stories.d.ts.map +1 -1
- package/jsx/core/Flex/FlexContainer.stories.jsx +45 -32
- package/jsx/core/Flex/FlexContainer.stories.jsx.map +1 -1
- package/jsx/core/Flex/FlexItem.stories.jsx +13 -13
- package/jsx/core/Flex/FlexItem.stories.jsx.map +1 -1
- package/jsx/core/Form/Form.mocks.d.ts +8 -0
- package/jsx/core/Form/Form.mocks.d.ts.map +1 -0
- package/jsx/core/Form/Form.mocks.jsx +138 -0
- package/jsx/core/Form/Form.mocks.jsx.map +1 -0
- package/jsx/core/Form/Form.stories.d.ts +0 -7
- package/jsx/core/Form/Form.stories.d.ts.map +1 -1
- package/jsx/core/Form/Form.stories.jsx +3 -137
- package/jsx/core/Form/Form.stories.jsx.map +1 -1
- package/jsx/core/Grid/Grid.styles.d.ts +2 -2
- package/jsx/core/Grid/Grid.styles.d.ts.map +1 -1
- package/jsx/core/Grid/Grid.styles.js +4 -4
- package/jsx/core/Grid/Grid.styles.js.map +1 -1
- package/jsx/core/Grid/GridContainer.stories.d.ts +6 -5
- package/jsx/core/Grid/GridContainer.stories.d.ts.map +1 -1
- package/jsx/core/Grid/GridContainer.stories.jsx +51 -44
- package/jsx/core/Grid/GridContainer.stories.jsx.map +1 -1
- package/jsx/core/Grid/GridItem.stories.d.ts +2 -2
- package/jsx/core/Grid/GridItem.stories.d.ts.map +1 -1
- package/jsx/core/Grid/GridItem.stories.jsx +28 -28
- package/jsx/core/Grid/GridItem.stories.jsx.map +1 -1
- package/jsx/core/Icon/Icon.mocks.d.ts +3 -0
- package/jsx/core/Icon/Icon.mocks.d.ts.map +1 -0
- package/jsx/core/Icon/Icon.mocks.jsx +9 -0
- package/jsx/core/Icon/Icon.mocks.jsx.map +1 -0
- package/jsx/core/Icon/Icon.stories.d.ts +1 -0
- package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.stories.jsx +7 -1
- package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
- package/jsx/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
- package/jsx/core/IconPicker/IconPicker.stories.jsx +0 -1
- package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
- package/jsx/core/Lightbox/Lightbox.mocks.d.ts +15 -0
- package/jsx/core/Lightbox/Lightbox.mocks.d.ts.map +1 -0
- package/jsx/core/Lightbox/Lightbox.mocks.js +59 -0
- package/jsx/core/Lightbox/Lightbox.mocks.js.map +1 -0
- package/jsx/core/Lightbox/Lightbox.stories.d.ts +7 -6
- package/jsx/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
- package/jsx/core/Lightbox/Lightbox.stories.jsx +14 -65
- package/jsx/core/Lightbox/Lightbox.stories.jsx.map +1 -1
- package/jsx/core/Link/Link.stories.d.ts +11 -1
- package/jsx/core/Link/Link.stories.d.ts.map +1 -1
- package/jsx/core/Link/Link.stories.jsx +22 -5
- package/jsx/core/Link/Link.stories.jsx.map +1 -1
- package/jsx/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
- package/jsx/core/List/CommaSeparatedList.stories.jsx +17 -19
- package/jsx/core/List/CommaSeparatedList.stories.jsx.map +1 -1
- package/jsx/core/List/OrderedList.stories.d.ts.map +1 -1
- package/jsx/core/List/OrderedList.stories.jsx +10 -10
- package/jsx/core/List/OrderedList.stories.jsx.map +1 -1
- package/jsx/core/List/UnorderedList.stories.d.ts.map +1 -1
- package/jsx/core/List/UnorderedList.stories.jsx +10 -10
- package/jsx/core/List/UnorderedList.stories.jsx.map +1 -1
- package/jsx/core/Menu/Menu.stories.d.ts +3 -3
- package/jsx/core/Menu/Menu.stories.d.ts.map +1 -1
- package/jsx/core/Menu/Menu.stories.jsx +8 -12
- package/jsx/core/Menu/Menu.stories.jsx.map +1 -1
- package/jsx/core/Modal/Modal.mocks.jsx +1 -1
- package/jsx/core/Modal/Modal.mocks.jsx.map +1 -1
- package/jsx/core/Number/Number.stories.jsx +1 -1
- package/jsx/core/Number/Number.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts +5 -2
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx +3 -3
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/core/Paragraph/ParagraphDisplay.stories.jsx +3 -0
- package/jsx/core/Paragraph/ParagraphDisplay.stories.jsx.map +1 -1
- package/jsx/core/Popover/Popover.stories.d.ts +1 -2
- package/jsx/core/Popover/Popover.stories.d.ts.map +1 -1
- package/jsx/core/Popover/Popover.stories.jsx +35 -37
- package/jsx/core/Popover/Popover.stories.jsx.map +1 -1
- package/jsx/core/Rating/Rating.stories.d.ts +4 -1
- package/jsx/core/Rating/Rating.stories.d.ts.map +1 -1
- package/jsx/core/Rating/Rating.stories.jsx +3 -3
- package/jsx/core/Rating/Rating.stories.jsx.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.jsx +6 -6
- package/jsx/core/Sentiment/Sentiment.stories.jsx.map +1 -1
- package/jsx/core/SummaryList/SummaryList.stories.jsx +1 -1
- package/jsx/core/SummaryList/SummaryList.stories.jsx.map +1 -1
- package/jsx/core/Toaster/Toaster.stories.d.ts.map +1 -1
- package/jsx/core/Toaster/Toaster.stories.jsx +8 -3
- package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +12 -10
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +1 -2
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.js +5 -10
- package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts +8 -3
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.jsx +164 -132
- package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
- package/jsx/rte/Editor/Editor.stories.d.ts +1 -0
- package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
- package/jsx/rte/Editor/Editor.stories.jsx +9 -1
- package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts +1 -0
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +19 -2
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
- package/jsx/social/Chat/Chat.stories.d.ts +31 -22
- package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
- package/jsx/social/Chat/Chat.stories.jsx +106 -153
- package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
- package/jsx/social/Email/Email.mocks.d.ts +1 -2
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Email/{Email.mocks.jsx → Email.mocks.js} +2 -3
- package/jsx/social/Email/Email.mocks.js.map +1 -0
- package/jsx/social/Email/Email.stories.d.ts.map +1 -1
- package/jsx/social/Email/Email.stories.jsx +7 -8
- package/jsx/social/Email/Email.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedNewPost.stories.jsx +1 -1
- package/jsx/social/Feed/FeedNewPost.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedPost.stories.jsx +1 -1
- package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
- package/jsx/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
- package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx +6 -7
- package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx.map +1 -1
- package/jsx/work/CaseView/FileService.mock.d.ts.map +1 -1
- package/jsx/work/CaseView/FileService.mock.jsx +6 -2
- package/jsx/work/CaseView/FileService.mock.jsx.map +1 -1
- package/jsx/work/Confirmation/Confirmation.stories.d.ts +1 -1
- package/jsx/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
- package/jsx/work/Confirmation/Confirmation.stories.jsx +14 -3
- package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
- package/jsx/work/Confirmation/Confirmation.styles.d.ts +2 -0
- package/jsx/work/Confirmation/Confirmation.styles.d.ts.map +1 -0
- package/jsx/work/Confirmation/Confirmation.styles.js +7 -0
- package/jsx/work/Confirmation/Confirmation.styles.js.map +1 -0
- package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
- package/jsx/work/SearchResults/SearchResults.stories.jsx +3 -9
- package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
- package/jsx/work/SearchResults/SearchResults.styles.d.ts +5 -0
- package/jsx/work/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/jsx/work/SearchResults/SearchResults.styles.js +12 -0
- package/jsx/work/SearchResults/SearchResults.styles.js.map +1 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts +17 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.jsx +32 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.jsx.map +1 -0
- package/jsx/work/Stakeholders/Stakeholders.stories.d.ts +2 -5
- package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
- package/jsx/work/Stakeholders/Stakeholders.stories.jsx +2 -30
- package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
- package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
- package/jsx/work/Timeline/Timeline.stories.jsx +2 -2
- package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
- package/lib/build/AppHeader/AppHeader.stories.d.ts +2 -1
- package/lib/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
- package/lib/build/AppHeader/AppHeader.stories.js +46 -13
- package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
- package/lib/build/AppShell/AppShell.stories.d.ts +2 -1
- package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/lib/build/AppShell/AppShell.stories.js +50 -17
- package/lib/build/AppShell/AppShell.stories.js.map +1 -1
- package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +7 -0
- package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.mocks.js +50 -0
- package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +9 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.js +40 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -0
- package/lib/build/LifeCycle/LifeCycle.mocks.js +1 -1
- package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.js +52 -48
- package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
- package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/lib/core/Avatar/Avatar.stories.js +6 -4
- package/lib/core/Avatar/Avatar.stories.js.map +1 -1
- package/lib/core/Banner/Banner.mocks.d.ts +18 -0
- package/lib/core/Banner/Banner.mocks.d.ts.map +1 -0
- package/lib/core/Banner/Banner.mocks.js +36 -0
- package/lib/core/Banner/Banner.mocks.js.map +1 -0
- package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
- package/lib/core/Banner/Banner.stories.js +4 -33
- package/lib/core/Banner/Banner.stories.js.map +1 -1
- package/lib/core/Button/Button.stories.d.ts.map +1 -1
- package/lib/core/Button/Button.stories.js +2 -2
- package/lib/core/Button/Button.stories.js.map +1 -1
- package/lib/core/Configuration/Configuration.stories.js +1 -1
- package/lib/core/Configuration/Configuration.stories.js.map +1 -1
- package/lib/core/DateTime/DateTimeDisplay.stories.js +1 -0
- package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
- package/lib/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -1
- package/lib/core/ExpandCollapse/ExpandCollapse.styles.js +5 -0
- package/lib/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +21 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.js +38 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -0
- package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.js +1 -35
- package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
- package/lib/core/File/FileDisplay.stories.d.ts +8 -1
- package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
- package/lib/core/File/FileDisplay.stories.js +32 -2
- package/lib/core/File/FileDisplay.stories.js.map +1 -1
- package/lib/core/Flex/Flex.styles.d.ts +2 -2
- package/lib/core/Flex/Flex.styles.d.ts.map +1 -1
- package/lib/core/Flex/Flex.styles.js +17 -17
- package/lib/core/Flex/Flex.styles.js.map +1 -1
- package/lib/core/Flex/FlexContainer.stories.d.ts +2 -0
- package/lib/core/Flex/FlexContainer.stories.d.ts.map +1 -1
- package/lib/core/Flex/FlexContainer.stories.js +10 -7
- package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
- package/lib/core/Flex/FlexItem.stories.js +4 -4
- package/lib/core/Flex/FlexItem.stories.js.map +1 -1
- package/lib/core/Form/Form.mocks.d.ts +8 -0
- package/lib/core/Form/Form.mocks.d.ts.map +1 -0
- package/lib/core/Form/Form.mocks.js +97 -0
- package/lib/core/Form/Form.mocks.js.map +1 -0
- package/lib/core/Form/Form.stories.d.ts +0 -7
- package/lib/core/Form/Form.stories.d.ts.map +1 -1
- package/lib/core/Form/Form.stories.js +3 -95
- package/lib/core/Form/Form.stories.js.map +1 -1
- package/lib/core/Grid/Grid.styles.d.ts +2 -2
- package/lib/core/Grid/Grid.styles.d.ts.map +1 -1
- package/lib/core/Grid/Grid.styles.js +4 -4
- package/lib/core/Grid/Grid.styles.js.map +1 -1
- package/lib/core/Grid/GridContainer.stories.d.ts +6 -5
- package/lib/core/Grid/GridContainer.stories.d.ts.map +1 -1
- package/lib/core/Grid/GridContainer.stories.js +27 -24
- package/lib/core/Grid/GridContainer.stories.js.map +1 -1
- package/lib/core/Grid/GridItem.stories.d.ts +2 -2
- package/lib/core/Grid/GridItem.stories.d.ts.map +1 -1
- package/lib/core/Grid/GridItem.stories.js +10 -10
- package/lib/core/Grid/GridItem.stories.js.map +1 -1
- package/lib/core/Icon/Icon.mocks.d.ts +3 -0
- package/lib/core/Icon/Icon.mocks.d.ts.map +1 -0
- package/lib/core/Icon/Icon.mocks.js +10 -0
- package/lib/core/Icon/Icon.mocks.js.map +1 -0
- package/lib/core/Icon/Icon.stories.d.ts +1 -0
- package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
- package/lib/core/Icon/Icon.stories.js +7 -1
- package/lib/core/Icon/Icon.stories.js.map +1 -1
- package/lib/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
- package/lib/core/IconPicker/IconPicker.stories.js +0 -1
- package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
- package/lib/core/Lightbox/Lightbox.mocks.d.ts +15 -0
- package/lib/core/Lightbox/Lightbox.mocks.d.ts.map +1 -0
- package/lib/core/Lightbox/Lightbox.mocks.js +67 -0
- package/lib/core/Lightbox/Lightbox.mocks.js.map +1 -0
- package/lib/core/Lightbox/Lightbox.stories.d.ts +7 -6
- package/lib/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
- package/lib/core/Lightbox/Lightbox.stories.js +14 -73
- package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
- package/lib/core/Link/Link.stories.d.ts +11 -1
- package/lib/core/Link/Link.stories.d.ts.map +1 -1
- package/lib/core/Link/Link.stories.js +7 -4
- package/lib/core/Link/Link.stories.js.map +1 -1
- package/lib/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
- package/lib/core/List/CommaSeparatedList.stories.js +17 -17
- package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
- package/lib/core/List/OrderedList.stories.d.ts.map +1 -1
- package/lib/core/List/OrderedList.stories.js +10 -10
- package/lib/core/List/OrderedList.stories.js.map +1 -1
- package/lib/core/List/UnorderedList.stories.d.ts.map +1 -1
- package/lib/core/List/UnorderedList.stories.js +10 -10
- package/lib/core/List/UnorderedList.stories.js.map +1 -1
- package/lib/core/Menu/Menu.stories.d.ts +3 -3
- package/lib/core/Menu/Menu.stories.d.ts.map +1 -1
- package/lib/core/Menu/Menu.stories.js +8 -12
- package/lib/core/Menu/Menu.stories.js.map +1 -1
- package/lib/core/Modal/Modal.mocks.js +1 -1
- package/lib/core/Modal/Modal.mocks.js.map +1 -1
- package/lib/core/Number/Number.stories.js +1 -1
- package/lib/core/Number/Number.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts +5 -2
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js +3 -3
- package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/core/Paragraph/ParagraphDisplay.stories.js +3 -0
- package/lib/core/Paragraph/ParagraphDisplay.stories.js.map +1 -1
- package/lib/core/Popover/Popover.stories.d.ts +1 -2
- package/lib/core/Popover/Popover.stories.d.ts.map +1 -1
- package/lib/core/Popover/Popover.stories.js +24 -25
- package/lib/core/Popover/Popover.stories.js.map +1 -1
- package/lib/core/Rating/Rating.stories.d.ts +4 -1
- package/lib/core/Rating/Rating.stories.d.ts.map +1 -1
- package/lib/core/Rating/Rating.stories.js +3 -3
- package/lib/core/Rating/Rating.stories.js.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.js +6 -6
- package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
- package/lib/core/SummaryList/SummaryList.stories.js +1 -1
- package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
- package/lib/core/Toaster/Toaster.stories.d.ts.map +1 -1
- package/lib/core/Toaster/Toaster.stories.js +8 -3
- package/lib/core/Toaster/Toaster.stories.js.map +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.js +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +12 -10
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts +1 -2
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.js +5 -10
- package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.d.ts +8 -3
- package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.js +142 -119
- package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
- package/lib/rte/Editor/Editor.stories.d.ts +1 -0
- package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
- package/lib/rte/Editor/Editor.stories.js +9 -1
- package/lib/rte/Editor/Editor.stories.js.map +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.js +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
- package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +1 -0
- package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
- package/lib/rte/RichTextEditor/RichTextViewer.stories.js +15 -2
- package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
- package/lib/social/Chat/Chat.stories.d.ts +33 -22
- package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
- package/lib/social/Chat/Chat.stories.js +102 -158
- package/lib/social/Chat/Chat.stories.js.map +1 -1
- package/lib/social/Email/Email.mocks.d.ts +1 -2
- package/lib/social/Email/Email.mocks.d.ts.map +1 -1
- package/lib/social/Email/Email.mocks.js +1 -3
- package/lib/social/Email/Email.mocks.js.map +1 -1
- package/lib/social/Email/Email.stories.d.ts.map +1 -1
- package/lib/social/Email/Email.stories.js +7 -8
- package/lib/social/Email/Email.stories.js.map +1 -1
- package/lib/social/Feed/FeedNewPost.stories.js +1 -1
- package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
- package/lib/social/Feed/FeedPost.stories.js +1 -1
- package/lib/social/Feed/FeedPost.stories.js.map +1 -1
- package/lib/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
- package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +6 -7
- package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
- package/lib/work/CaseView/FileService.mock.d.ts.map +1 -1
- package/lib/work/CaseView/FileService.mock.js +6 -2
- package/lib/work/CaseView/FileService.mock.js.map +1 -1
- package/lib/work/Confirmation/Confirmation.stories.d.ts +1 -1
- package/lib/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
- package/lib/work/Confirmation/Confirmation.stories.js +12 -4
- package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
- package/lib/work/Confirmation/Confirmation.styles.d.ts +2 -0
- package/lib/work/Confirmation/Confirmation.styles.d.ts.map +1 -0
- package/lib/work/Confirmation/Confirmation.styles.js +7 -0
- package/lib/work/Confirmation/Confirmation.styles.js.map +1 -0
- package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
- package/lib/work/SearchResults/SearchResults.stories.js +3 -9
- package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
- package/lib/work/SearchResults/SearchResults.styles.d.ts +5 -0
- package/lib/work/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/lib/work/SearchResults/SearchResults.styles.js +12 -0
- package/lib/work/SearchResults/SearchResults.styles.js.map +1 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.d.ts +22 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.js +36 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -0
- package/lib/work/Stakeholders/Stakeholders.stories.d.ts +2 -5
- package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
- package/lib/work/Stakeholders/Stakeholders.stories.js +3 -34
- package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
- package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
- package/lib/work/Timeline/Timeline.stories.js +2 -2
- package/lib/work/Timeline/Timeline.stories.js.map +1 -1
- package/package.json +16 -16
- package/jsx/social/Email/Email.mocks.jsx.map +0 -1
|
@@ -1,38 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
3
3
|
import { action } from '@storybook/addon-actions';
|
|
4
|
-
import { radios, array, boolean, text, number, optionsKnob, button } from '@storybook/addon-knobs';
|
|
5
4
|
import { Button, Icon, registerIcon, Text, MenuButton, Flex, Popover, Link, Status, EmojiContext, createUID, useOuterEvent, TextArea, Select, Option, Menu, useElement, FieldValueList } from '@pega/cosmos-react-core';
|
|
6
5
|
import * as arrowMicroDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-down.icon';
|
|
7
6
|
import * as replyIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/reply.icon';
|
|
8
7
|
import * as replyAllIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/reply-all.icon';
|
|
9
8
|
import * as forwardIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/forward.icon';
|
|
10
|
-
import { Chat, ChatHeader, ChatBody, ChatComposer, ChatTranscript, Message, MessageList
|
|
9
|
+
import { Chat, ChatHeader, ChatBody, ChatComposer, ChatTranscript, Message, MessageList, NewMessageSeparatorId, SuggestedReplyPicker, SystemMessage, TranscriptMessage, TypeIndicator } from '@pega/cosmos-react-social';
|
|
11
10
|
import { ChatMockData } from './Chat.mocks';
|
|
12
11
|
registerIcon(forwardIcon, replyIcon, replyAllIcon, arrowMicroDownIcon);
|
|
13
12
|
export default {
|
|
14
13
|
title: 'Social/Chat',
|
|
15
14
|
component: Chat
|
|
16
15
|
};
|
|
17
|
-
const Channels = {
|
|
18
|
-
label: 'Channel',
|
|
19
|
-
options: {
|
|
20
|
-
LiveChat: {
|
|
21
|
-
title: 'Live chat',
|
|
22
|
-
icon: 'chat-solid'
|
|
23
|
-
},
|
|
24
|
-
Twitter: {
|
|
25
|
-
title: 'Twitter chat',
|
|
26
|
-
icon: 'twitter'
|
|
27
|
-
},
|
|
28
|
-
Facebook: {
|
|
29
|
-
title: 'Facebook messenger',
|
|
30
|
-
icon: 'facebook'
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
16
|
/** *********************** ChatHeader component - START *********************** */
|
|
35
|
-
export const
|
|
17
|
+
export const ChatHeaderDemo = () => {
|
|
36
18
|
const actionsConfig = (_jsxs(Flex, { children: [_jsx(Button, { variant: 'simple', "aria-label": 'Show transcripts', children: _jsxs(Flex, { container: {
|
|
37
19
|
gap: 1,
|
|
38
20
|
alignItems: 'center'
|
|
@@ -41,29 +23,16 @@ export const chatHeader = () => {
|
|
|
41
23
|
};
|
|
42
24
|
/** ***************************** ChatHeader component - END ******************* */
|
|
43
25
|
/** **************************** MessageList component - START ************************* */
|
|
44
|
-
export const
|
|
26
|
+
export const MessageListDemo = () => {
|
|
45
27
|
const messages = ChatMockData.chatMessages;
|
|
46
28
|
const [unReadMessageCount, setUnReadMessagesCount] = useState(1);
|
|
47
|
-
return (_jsx(Flex, { container: true, style: { height: '80vh' }, children: _jsx(
|
|
29
|
+
return (_jsx(Flex, { container: true, style: { height: '80vh' }, children: _jsx(MessageList, { tabIndex: 0, messages: messages, unReadMessageCount: unReadMessageCount, onScrollToButtonClick: () => {
|
|
48
30
|
setUnReadMessagesCount(0);
|
|
49
31
|
} }, void 0) }, void 0));
|
|
50
32
|
};
|
|
51
33
|
/** **************************** MessageList component - END **************************** */
|
|
52
34
|
/** ***************************** Message component - START ********************** */
|
|
53
|
-
export const
|
|
54
|
-
/** Storybook knobs are used here to simulate the behavior of variant and direction prop in real time - start */
|
|
55
|
-
const MessageVariantPropValues = {
|
|
56
|
-
sender: 'sender',
|
|
57
|
-
receiver: 'receiver',
|
|
58
|
-
other: 'other'
|
|
59
|
-
};
|
|
60
|
-
const MessageDirectionPropValues = {
|
|
61
|
-
in: 'in',
|
|
62
|
-
out: 'out'
|
|
63
|
-
};
|
|
64
|
-
const variantProp = radios('Variant', MessageVariantPropValues, 'receiver');
|
|
65
|
-
const directionProp = radios('Direction', MessageDirectionPropValues, 'in');
|
|
66
|
-
/** Storybook knobs are used here to simulate the behavior of variant and direction prop in real time - end */
|
|
35
|
+
export const MessageDemo = (args) => {
|
|
67
36
|
const attachments = [
|
|
68
37
|
{
|
|
69
38
|
id: '2499167340',
|
|
@@ -87,31 +56,41 @@ export const messageComponent = () => {
|
|
|
87
56
|
title: 'Ask the expert'
|
|
88
57
|
}
|
|
89
58
|
];
|
|
90
|
-
return (_jsxs(_Fragment, { children: [_jsx(Message, { type: 'message', attachments: attachments, avatarInfo: { name: 'John Brown' }, status: 'Opened', timeStamp: '1:44 PM', message: 'Hi, Welcome to u-plus. How can I help you ?', variant:
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsx(Message, { type: 'message', attachments: attachments, avatarInfo: { name: 'John Brown' }, status: 'Opened', timeStamp: '1:44 PM', message: 'Hi, Welcome to u-plus. How can I help you ?', variant: args.variant, direction: args.direction }, void 0), _jsx("br", {}, void 0), _jsx(Message, { type: 'message', message: 'Hi, Welcome to u-plus. How can I help you ?', avatarInfo: { name: 'John Brown' }, pagePushLinks: pagePushLinks, variant: args.variant, direction: args.direction }, void 0), _jsx("br", {}, void 0), _jsx(Message, { type: 'message', message: 'Hi, Welcome to u-plus. How can I help you ?', avatarInfo: { name: 'John Brown' }, variant: args.variant, direction: args.direction }, void 0)] }, void 0));
|
|
60
|
+
};
|
|
61
|
+
MessageDemo.args = {
|
|
62
|
+
variant: 'receiver',
|
|
63
|
+
direction: 'in'
|
|
64
|
+
};
|
|
65
|
+
MessageDemo.argTypes = {
|
|
66
|
+
variant: { options: ['receiver', 'sender', 'other'], control: { type: 'select' } },
|
|
67
|
+
direction: { options: ['in', 'out'], control: { type: 'select' } }
|
|
91
68
|
};
|
|
92
69
|
/** ***************************** Message component - END *********************** */
|
|
93
70
|
/** **************************** SystemMessage component - START ***************** */
|
|
94
|
-
export const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
71
|
+
export const SystemMessageDemo = () => (_jsx(SystemMessage, { message: 'John Brown has joined', timeStamp: '10:00 AM' }, void 0));
|
|
72
|
+
export const TypeIndicatorDemo = (args) => {
|
|
73
|
+
return _jsx(TypeIndicator, { avatarInfo: { name: 'John Brown' }, message: args.message }, void 0);
|
|
74
|
+
};
|
|
75
|
+
TypeIndicatorDemo.args = {
|
|
76
|
+
message: ''
|
|
77
|
+
};
|
|
78
|
+
TypeIndicatorDemo.argTypes = {
|
|
79
|
+
message: { control: { type: 'text' } }
|
|
101
80
|
};
|
|
102
81
|
/** *************************** TypeIndicator component - END *********************** */
|
|
103
82
|
/** ************************** ChatTranscripts component - START ********************* */
|
|
104
|
-
export const
|
|
83
|
+
export const ChatTranscriptsDemo = () => {
|
|
105
84
|
return ChatMockData.transcripts.map((transcript) => {
|
|
106
85
|
return (_jsx(ChatTranscript, { tabIndex: 0, title: transcript.title, transcript: transcript.data }, transcript.id));
|
|
107
86
|
});
|
|
108
87
|
};
|
|
109
88
|
/** **************************** ChatTranscripts component - END ************************ */
|
|
110
89
|
/** *************************** TranscriptMessage component - START ****************** */
|
|
111
|
-
export const
|
|
90
|
+
export const TranscriptMessageDemo = () => (_jsx(TranscriptMessage, { timeStamp: '01:20 PM', variant: 'bot', message: 'Hello\u2026 This is bot. How can I help you? Please select your category.' }, void 0));
|
|
112
91
|
/** *************************** TranscriptMessage component - END ******************** */
|
|
113
92
|
/** *************************** SuggestedReplyPicker component - START ****************** */
|
|
114
|
-
export const
|
|
93
|
+
export const SuggestedReplyPickerDemo = () => {
|
|
115
94
|
const suggestedReplies = [
|
|
116
95
|
{
|
|
117
96
|
id: createUID(),
|
|
@@ -128,28 +107,34 @@ export const suggestedReplyPickerComponent = () => {
|
|
|
128
107
|
action(`Suggested reply picked ${suggestedReply.message}`)();
|
|
129
108
|
}, onDismiss: action('Suggested reply dismissed') }, void 0));
|
|
130
109
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return obj;
|
|
140
|
-
}
|
|
141
|
-
const name = allParticipants[key].avatarInfo.name;
|
|
142
|
-
obj[name] = name;
|
|
143
|
-
return obj;
|
|
144
|
-
}, {});
|
|
145
|
-
const channelOptions = Object.keys(Channels.options).reduce((obj, key) => {
|
|
146
|
-
obj[key] = key;
|
|
147
|
-
return obj;
|
|
148
|
-
}, {});
|
|
149
|
-
export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
110
|
+
export const ChatComposerDemo = (args) => (_jsxs(ChatComposer, { maxAttachments: args.maxAttachments, attachments: ChatMockData.defaultAttachments, maxLength: 256, placeholder: 'Type here to send message', onSend: () => { }, children: [_jsx(MenuButton, { text: 'Phrases', menu: { items: [] } }, void 0), _jsx(MenuButton, { text: 'Page Push', menu: { items: [] } }, void 0)] }, void 0));
|
|
111
|
+
ChatComposerDemo.args = {
|
|
112
|
+
maxAttachments: 2
|
|
113
|
+
};
|
|
114
|
+
ChatComposerDemo.argTypes = {
|
|
115
|
+
maxAttachments: { control: { type: 'number' } }
|
|
116
|
+
};
|
|
117
|
+
export const StandardChat = (args) => {
|
|
150
118
|
const ChatMockDataClone = useMemo(() => {
|
|
151
119
|
return JSON.parse(JSON.stringify(ChatMockData));
|
|
152
120
|
}, [ChatMockData]);
|
|
121
|
+
const Channels = {
|
|
122
|
+
label: 'Channel',
|
|
123
|
+
options: {
|
|
124
|
+
LiveChat: {
|
|
125
|
+
title: 'Live chat',
|
|
126
|
+
icon: 'chat-solid'
|
|
127
|
+
},
|
|
128
|
+
Twitter: {
|
|
129
|
+
title: 'Twitter chat',
|
|
130
|
+
icon: 'twitter'
|
|
131
|
+
},
|
|
132
|
+
Facebook: {
|
|
133
|
+
title: 'Facebook messenger',
|
|
134
|
+
icon: 'facebook'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
153
138
|
const { participants, chatMessages: mockChatMessagesJson, transcripts, defaultAttachments, suggestedReplies } = ChatMockDataClone;
|
|
154
139
|
const conversationRatingMessage = {
|
|
155
140
|
id: createUID(),
|
|
@@ -185,25 +170,11 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
185
170
|
timers.current.forEach(clearTimeout);
|
|
186
171
|
};
|
|
187
172
|
}, []);
|
|
188
|
-
const selectedChannel = radios(Channels.label, channelOptions, Object.keys(channelOptions)[0]);
|
|
189
|
-
const actions = array('Actions', ['Transfer', 'End chat']).map(name => ({
|
|
190
|
-
primary: name,
|
|
191
|
-
id: name,
|
|
192
|
-
onClick: action(`Clicked ${name}`)
|
|
193
|
-
}));
|
|
194
173
|
const [showSuggestedReplies, setShowSuggestedReplies] = useState(true);
|
|
195
|
-
const disableChat = boolean('Disable chat', false);
|
|
196
|
-
const simulateConversation = boolean('Simulate conversation', false);
|
|
197
|
-
const placeHolder = text('Placeholder', 'Enter message');
|
|
198
|
-
const defaultMessage = text('Default message', 'Greetings! Hope you are having a great time, Please reach out to us for any help, Thanks!');
|
|
199
|
-
const maxLength = number('Max characters', 280);
|
|
200
|
-
const typers = optionsKnob('Participants typing', chatParticipants, '', {
|
|
201
|
-
display: 'multi-select'
|
|
202
|
-
});
|
|
203
174
|
const [showTranscripts, setShowTranscripts] = useState(false);
|
|
204
175
|
const [attachments, setAttachments] = useState(defaultAttachments);
|
|
205
176
|
const [unreadMessagesCount, setUnreadMessagesCount] = useState(0);
|
|
206
|
-
const [chatMessages, setChatMessages] = useState(simulateConversation ? mockChatMessages.slice(0, 0) : mockChatMessages);
|
|
177
|
+
const [chatMessages, setChatMessages] = useState(args.simulateConversation ? mockChatMessages.slice(0, 0) : mockChatMessages);
|
|
207
178
|
const onDeleteAttachment = useCallback((name) => {
|
|
208
179
|
setAttachments(prevAttachments => prevAttachments.filter(item => item.name !== name));
|
|
209
180
|
}, [setAttachments]);
|
|
@@ -242,7 +213,7 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
242
213
|
}
|
|
243
214
|
};
|
|
244
215
|
useEffect(() => {
|
|
245
|
-
if (simulateConversation) {
|
|
216
|
+
if (args.simulateConversation) {
|
|
246
217
|
const timeOutId = setTimeout(() => {
|
|
247
218
|
if (mockChatMessages.length) {
|
|
248
219
|
appendMessage(mockChatMessages.shift());
|
|
@@ -252,49 +223,7 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
252
223
|
clearTimeout(timeOutId);
|
|
253
224
|
};
|
|
254
225
|
}
|
|
255
|
-
}, [chatMessages, simulateConversation]);
|
|
256
|
-
const customerMessage = text('Customer message', '');
|
|
257
|
-
button('Send customer message', () => {
|
|
258
|
-
appendMessage({
|
|
259
|
-
type: 'message',
|
|
260
|
-
...participants.receiver,
|
|
261
|
-
message: customerMessage,
|
|
262
|
-
timeStamp: '1:45 PM'
|
|
263
|
-
});
|
|
264
|
-
return false;
|
|
265
|
-
});
|
|
266
|
-
const managerMessage = text('Manager message', '');
|
|
267
|
-
button('Send manager message', () => {
|
|
268
|
-
appendMessage({
|
|
269
|
-
type: 'message',
|
|
270
|
-
...participants.other,
|
|
271
|
-
message: managerMessage,
|
|
272
|
-
timeStamp: '1:45 PM'
|
|
273
|
-
});
|
|
274
|
-
return false;
|
|
275
|
-
});
|
|
276
|
-
const typingIndicators = typers
|
|
277
|
-
.toString()
|
|
278
|
-
.split(',')
|
|
279
|
-
.filter(person => person !== '')
|
|
280
|
-
.map(name => {
|
|
281
|
-
let message = '';
|
|
282
|
-
if (name === participants.receiver.avatarInfo.name) {
|
|
283
|
-
message = customerMessage;
|
|
284
|
-
}
|
|
285
|
-
else if (name === participants.other.avatarInfo.name) {
|
|
286
|
-
message = managerMessage;
|
|
287
|
-
}
|
|
288
|
-
return {
|
|
289
|
-
id: name,
|
|
290
|
-
type: 'typing',
|
|
291
|
-
avatarInfo: {
|
|
292
|
-
name
|
|
293
|
-
},
|
|
294
|
-
message,
|
|
295
|
-
ariaLabel: `${name} is typing`
|
|
296
|
-
};
|
|
297
|
-
});
|
|
226
|
+
}, [chatMessages, args.simulateConversation]);
|
|
298
227
|
const [openPopover, setOpenPopover] = useState(false);
|
|
299
228
|
const [popoverRef, setPopoverRef] = useElement();
|
|
300
229
|
const [buttonRef, setButtonRef] = useElement();
|
|
@@ -348,10 +277,15 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
348
277
|
if (openPopover)
|
|
349
278
|
setOpenPopover(false);
|
|
350
279
|
});
|
|
351
|
-
const header = (_jsx(ChatHeader, { title: Channels.options[selectedChannel].title, icon: Channels.options[selectedChannel].icon, "aria-label": 'Chat header', actions: _jsxs(Flex, { children: [_jsx(Button, { variant: 'simple', onClick: () => setShowTranscripts(!showTranscripts), "aria-label": 'Show transcripts', children: _jsxs(Flex, { container: {
|
|
280
|
+
const header = (_jsx(ChatHeader, { title: Channels.options[args.selectedChannel || 'LiveChat'].title, icon: Channels.options[args.selectedChannel || 'LiveChat'].icon, "aria-label": 'Chat header', actions: _jsxs(Flex, { children: [_jsx(Button, { variant: 'simple', onClick: () => setShowTranscripts(!showTranscripts), "aria-label": 'Show transcripts', children: _jsxs(Flex, { container: {
|
|
352
281
|
gap: 1,
|
|
353
282
|
alignItems: 'center'
|
|
354
|
-
}, children: [_jsx(Icon, { name: 'chats' }, void 0), _jsx(Text, { children: "Transcripts" }, void 0)] }, void 0) }, void 0), _jsx(Button, { variant: 'simple', icon: true, "aria-label": 'chat info', ref: setButtonRef, onClick: () => setOpenPopover(current => !current), children: _jsx(Icon, { name: 'information' }, void 0) }, void 0), _jsx(Popover, { show: openPopover, target: buttonRef, ref: setPopoverRef, arrow: true, placement: 'bottom-end', children: _jsxs(Flex, { container: { direction: 'column', gap: 1, pad: 2 }, children: [_jsx(Text, { variant: 'h4', children: additionalInfo.title }, void 0), _jsx(FieldValueList, { variant: 'inline', fields: additionalInfo.options[selectedChannel] }, void 0)] }, void 0) }, void 0), _jsx(MenuButton, { text: 'More actions', icon: 'more', iconOnly: true, variant: 'simple', portal: true, menu: {
|
|
283
|
+
}, children: [_jsx(Icon, { name: 'chats' }, void 0), _jsx(Text, { children: "Transcripts" }, void 0)] }, void 0) }, void 0), _jsx(Button, { variant: 'simple', icon: true, "aria-label": 'chat info', ref: setButtonRef, onClick: () => setOpenPopover(current => !current), children: _jsx(Icon, { name: 'information' }, void 0) }, void 0), _jsx(Popover, { show: openPopover, target: buttonRef, ref: setPopoverRef, arrow: true, placement: 'bottom-end', children: _jsxs(Flex, { container: { direction: 'column', gap: 1, pad: 2 }, children: [_jsx(Text, { variant: 'h4', children: additionalInfo.title }, void 0), _jsx(FieldValueList, { variant: 'inline', fields: additionalInfo.options[args.selectedChannel || 'LiveChat'] }, void 0)] }, void 0) }, void 0), _jsx(MenuButton, { text: 'More actions', icon: 'more', iconOnly: true, variant: 'simple', portal: true, menu: {
|
|
284
|
+
items: [
|
|
285
|
+
{ primary: 'Transfer', id: 'transcript', onClick: action('Clicked Transfer') },
|
|
286
|
+
{ primary: 'End chat', id: 'endChat', onClick: action('Clicked End chat') }
|
|
287
|
+
]
|
|
288
|
+
} }, void 0)] }, void 0) }, void 0));
|
|
355
289
|
const [showEarlierTranscripts, setShowEarlierTranscripts] = useState(false);
|
|
356
290
|
const transcriptsContainerRef = useRef(null);
|
|
357
291
|
useOuterEvent('mousedown', [transcriptsContainerRef], () => {
|
|
@@ -380,14 +314,13 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
380
314
|
return (_jsx(ChatTranscript, { tabIndex: 0, title: transcript.title, transcript: transcriptData }, transcript.id));
|
|
381
315
|
})] }, void 0)) : undefined;
|
|
382
316
|
}, [showTranscripts, setShowTranscripts, showEarlierTranscripts, setShowEarlierTranscripts]);
|
|
383
|
-
const showChatBanner = boolean('Show banner', true);
|
|
384
317
|
const chatBanner = {
|
|
385
318
|
id: 'warning',
|
|
386
319
|
messages: ['This is a public interaction and any responses will be public and visible'],
|
|
387
320
|
heading: 'Warning',
|
|
388
321
|
variant: 'warning'
|
|
389
322
|
};
|
|
390
|
-
const body = (_jsx(ChatBody, { children: _jsx(
|
|
323
|
+
const body = (_jsx(ChatBody, { children: _jsx(MessageList, { unReadMessageCount: unreadMessagesCount, onScrollToButtonClick: () => {
|
|
391
324
|
const newRandomMessageId = Math.random().toString(36).substr(2, 9);
|
|
392
325
|
setChatMessages(prevChatMessages => prevChatMessages.map(message => {
|
|
393
326
|
if (message.id === NewMessageSeparatorId) {
|
|
@@ -401,27 +334,20 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
401
334
|
}, 5000);
|
|
402
335
|
timers.current.push(timeOutId);
|
|
403
336
|
setUnreadMessagesCount(0);
|
|
404
|
-
}, tabIndex: 0, ref: conversationRef, messages: [
|
|
337
|
+
}, tabIndex: 0, ref: conversationRef, messages: [
|
|
338
|
+
...chatMessages,
|
|
339
|
+
{
|
|
340
|
+
id: 'Pegasystems',
|
|
341
|
+
type: 'typing',
|
|
342
|
+
avatarInfo: {
|
|
343
|
+
name: 'Pegasystems',
|
|
344
|
+
imageSrc: 'https://www.pega.com/sites/default/files/media/images/2018-12/Pega.com-og.png'
|
|
345
|
+
},
|
|
346
|
+
message: args.message,
|
|
347
|
+
ariaLabel: 'Pegasystems is typing'
|
|
348
|
+
}
|
|
349
|
+
] }, void 0) }, void 0));
|
|
405
350
|
const chatComposerImperativeHandleRef = useRef(null);
|
|
406
|
-
const phrase = text('Phrase', 'How can I help you?');
|
|
407
|
-
button('Push prase at start', () => {
|
|
408
|
-
if (chatComposerImperativeHandleRef.current) {
|
|
409
|
-
chatComposerImperativeHandleRef.current.appendToMessage(phrase, 'start');
|
|
410
|
-
}
|
|
411
|
-
return false;
|
|
412
|
-
});
|
|
413
|
-
button('Push prase at end', () => {
|
|
414
|
-
if (chatComposerImperativeHandleRef.current) {
|
|
415
|
-
chatComposerImperativeHandleRef.current.appendToMessage(phrase, 'end');
|
|
416
|
-
}
|
|
417
|
-
return false;
|
|
418
|
-
});
|
|
419
|
-
button('Push prase at cursor', () => {
|
|
420
|
-
if (chatComposerImperativeHandleRef.current) {
|
|
421
|
-
chatComposerImperativeHandleRef.current.appendToMessage(phrase, 'cursor');
|
|
422
|
-
}
|
|
423
|
-
return false;
|
|
424
|
-
});
|
|
425
351
|
const [mountPopover, setMountPopover] = useState(false);
|
|
426
352
|
const specialKeysConfig = {
|
|
427
353
|
keys: ['//'],
|
|
@@ -442,7 +368,7 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
442
368
|
useOuterEvent('mousedown', [chatComposerImperativeHandleRef?.current?.chatComposerRef?.current], () => {
|
|
443
369
|
setMountPopover(false);
|
|
444
370
|
});
|
|
445
|
-
const footer = (_jsxs(ChatComposer, { ref: chatComposerImperativeHandleRef, maxAttachments:
|
|
371
|
+
const footer = (_jsxs(ChatComposer, { ref: chatComposerImperativeHandleRef, maxAttachments: args.maxAttachments, attachments: attachments, specialKeysConfig: specialKeysConfig, showEmoji: true, disabled: args.disableChat, onAddAttachment: () => {
|
|
446
372
|
setAttachments([
|
|
447
373
|
...attachments,
|
|
448
374
|
{
|
|
@@ -451,7 +377,7 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
451
377
|
onDelete: onDeleteAttachment
|
|
452
378
|
}
|
|
453
379
|
]);
|
|
454
|
-
}, maxLength: maxLength, placeholder:
|
|
380
|
+
}, maxLength: args.maxLength, placeholder: args.placeholder, defaultMessage: args.defaultMessage, onSend: message => {
|
|
455
381
|
action(`onAppendMessage: ${message}`)();
|
|
456
382
|
appendMessage({
|
|
457
383
|
...participants.sender,
|
|
@@ -459,15 +385,11 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
459
385
|
message,
|
|
460
386
|
timeStamp: '1:45 PM'
|
|
461
387
|
});
|
|
462
|
-
}, children: [_jsx(MenuButton, { text: 'Phrases', actions: [], disabled: disableChat }, void 0), _jsx(MenuButton, { text: 'Page push', actions: [], disabled: disableChat }, void 0), _jsx(Popover, { show: mountPopover, target: chatComposerImperativeHandleRef?.current?.textAreaRef?.current, placement: 'top-start', children: _jsx(Menu, { scrollAt: 20, items: ChatMockData.phrasesDisplayNames.map((name, idx) => ({
|
|
388
|
+
}, children: [_jsx(MenuButton, { text: 'Phrases', actions: [], disabled: args.disableChat }, void 0), _jsx(MenuButton, { text: 'Page push', actions: [], disabled: args.disableChat }, void 0), _jsx(Popover, { show: mountPopover, target: chatComposerImperativeHandleRef?.current?.textAreaRef?.current, placement: 'top-start', children: _jsx(Menu, { scrollAt: 20, items: ChatMockData.phrasesDisplayNames.map((name, idx) => ({
|
|
463
389
|
primary: name,
|
|
464
390
|
id: idx.toString(),
|
|
465
391
|
onClick: () => insertPhrasesMessage(ChatMockData.phrasesMessages[idx])
|
|
466
392
|
})) }, void 0) }, void 0)] }, void 0));
|
|
467
|
-
button('Toggle suggested replies', () => {
|
|
468
|
-
setShowSuggestedReplies(show => !show);
|
|
469
|
-
return false;
|
|
470
|
-
});
|
|
471
393
|
const suggestedReplyPicker = suggestedReplies.length > 0 && showSuggestedReplies ? (_jsx(SuggestedReplyPicker, { replies: suggestedReplies, onSelect: (suggestedReply) => {
|
|
472
394
|
chatComposerImperativeHandleRef.current?.appendToMessage(suggestedReply.message, 'cursor');
|
|
473
395
|
setShowSuggestedReplies(false);
|
|
@@ -481,9 +403,31 @@ export const StandardChat = ({ chatWidth = '30rem' }) => {
|
|
|
481
403
|
justify: 'center'
|
|
482
404
|
}, style: {
|
|
483
405
|
height: 'calc(100vh)',
|
|
484
|
-
width: chatWidth,
|
|
406
|
+
width: args.chatWidth || '30rem',
|
|
485
407
|
margin: 'auto'
|
|
486
|
-
}, children: _jsx(Chat, { utility: utilityComp, header: header, banner: showChatBanner ? chatBanner : undefined, body: body, footer: footer, suggestedReplyPicker: suggestedReplyPicker }, void 0) }, void 0) }, void 0));
|
|
408
|
+
}, children: _jsx(Chat, { utility: utilityComp, header: header, banner: args.showChatBanner ? chatBanner : undefined, body: body, footer: footer, suggestedReplyPicker: suggestedReplyPicker }, void 0) }, void 0) }, void 0));
|
|
409
|
+
};
|
|
410
|
+
StandardChat.args = {
|
|
411
|
+
maxAttachments: 2,
|
|
412
|
+
selectedChannel: 'LiveChat',
|
|
413
|
+
showChatBanner: true,
|
|
414
|
+
disableChat: false,
|
|
415
|
+
simulateConversation: false,
|
|
416
|
+
message: '',
|
|
417
|
+
placeholder: 'Enter message',
|
|
418
|
+
defaultMessage: 'Greetings! Hope you are having a great time, Please reach out to us for any help, Thanks!',
|
|
419
|
+
maxLength: 280
|
|
420
|
+
};
|
|
421
|
+
StandardChat.argTypes = {
|
|
422
|
+
maxAttachments: { control: { type: 'number' } },
|
|
423
|
+
selectedChannel: { options: ['LiveChat', 'Twitter', 'Facebook'], control: { type: 'select' } },
|
|
424
|
+
showChatBanner: { control: { type: 'boolean' } },
|
|
425
|
+
disableChat: { control: { type: 'boolean' } },
|
|
426
|
+
simulateConversation: { control: { type: 'boolean' } },
|
|
427
|
+
message: { control: { type: 'text' } },
|
|
428
|
+
placeholder: { control: { type: 'text' } },
|
|
429
|
+
defaultMessage: { control: { type: 'text' } },
|
|
430
|
+
maxLength: { control: { type: 'number' } }
|
|
487
431
|
};
|
|
488
432
|
StandardChat.parameters = {
|
|
489
433
|
layout: 'fullscreen'
|