@pega/cosmos-react-demos 5.0.0-dev.2.1 → 5.0.0-dev.3.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/core/AppShell/AppShell.mocks.d.ts +2 -2
- package/jsx/core/AppShell/AppShell.mocks.d.ts.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.jsx +1 -2
- package/jsx/core/Avatar/Avatar.stories.jsx.map +1 -1
- package/jsx/core/Banner/Banner.mocks.d.ts +1 -1
- package/jsx/core/Banner/Banner.mocks.d.ts.map +1 -1
- package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.d.ts +2 -0
- package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.d.ts.map +1 -0
- package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.js +8 -0
- package/jsx/core/Breadcrumbs/Breadcrumbs.mocks.js.map +1 -0
- package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -0
- package/jsx/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/jsx/core/Breadcrumbs/Breadcrumbs.stories.jsx +39 -11
- package/jsx/core/Breadcrumbs/Breadcrumbs.stories.jsx.map +1 -1
- package/jsx/core/ComboBox/ComboBox.mocks.d.ts +2 -0
- package/jsx/core/ComboBox/ComboBox.mocks.d.ts.map +1 -1
- package/jsx/core/ComboBox/{ComboBox.mocks.js → ComboBox.mocks.jsx} +5 -1
- package/jsx/core/ComboBox/ComboBox.mocks.jsx.map +1 -0
- package/jsx/core/ComboBox/ComboBox.stories.d.ts +1 -0
- package/jsx/core/ComboBox/ComboBox.stories.d.ts.map +1 -1
- package/jsx/core/ComboBox/ComboBox.stories.jsx +15 -7
- package/jsx/core/ComboBox/ComboBox.stories.jsx.map +1 -1
- package/jsx/core/CompositeInput/CompositeInput.mocks.d.ts +1 -1
- package/jsx/core/CompositeInput/CompositeInput.mocks.d.ts.map +1 -1
- package/jsx/core/Configuration/Configuration.mocks.d.ts +1 -1
- package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -1
- package/jsx/core/Dialog/FormDialog.mocks.d.ts +2 -2
- package/jsx/core/Dialog/FormDialog.mocks.d.ts.map +1 -1
- package/jsx/core/Dialog/InfoDialog.mocks.d.ts +2 -2
- package/jsx/core/Dialog/InfoDialog.mocks.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +3 -3
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/jsx/core/FieldValueList/FieldValueList.mocks.d.ts +1 -1
- package/jsx/core/Form/Form.mocks.d.ts +2 -2
- package/jsx/core/Form/Form.mocks.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.mocks.d.ts +23 -0
- package/jsx/core/Icon/Icon.mocks.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.mocks.jsx +23 -0
- package/jsx/core/Icon/Icon.mocks.jsx.map +1 -1
- package/jsx/core/Icon/Icon.stories.d.ts +11 -1
- package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.stories.jsx +41 -7
- package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
- package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts +2 -2
- package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -1
- package/jsx/core/LiveLog/LiveLog.mocks.d.ts +1 -1
- package/jsx/core/LiveLog/LiveLog.mocks.d.ts.map +1 -1
- package/jsx/core/Modal/Modal.mocks.d.ts +1 -1
- package/jsx/core/Modal/Modal.mocks.d.ts.map +1 -1
- package/jsx/core/MultiStepForm/MultiStepForm.mocks.d.ts +5 -5
- package/jsx/core/MultiStepForm/MultiStepForm.mocks.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/core/Popover/Popover.mocks.d.ts +1 -1
- package/jsx/core/Popover/Popover.mocks.d.ts.map +1 -1
- package/jsx/core/Table/Table.mocks.d.ts +1 -1
- package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +2 -2
- package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -1
- package/jsx/dnd/StandardDragDropList/GroupConfig.d.ts +1 -1
- package/jsx/dnd/StandardDragDropList/GroupConfig.d.ts.map +1 -1
- package/jsx/dnd/StandardDragDropList/ItemConfig.d.ts +1 -1
- package/jsx/dnd/StandardDragDropList/ItemConfig.d.ts.map +1 -1
- package/jsx/dnd/StandardDragDropList/Popover.d.ts +1 -1
- package/jsx/dnd/StandardDragDropList/Popover.d.ts.map +1 -1
- package/jsx/dnd/StandardDragDropList/SelectionMenu.d.ts +1 -1
- package/jsx/dnd/StandardDragDropList/SelectionMenu.d.ts.map +1 -1
- package/jsx/rte/Editor/Editor.mocks.d.ts +7 -0
- package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -1
- package/jsx/social/Email/Email.mocks.d.ts +1 -1
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Feed/Feed.mocks.d.ts +2 -2
- package/jsx/social/Feed/FeedNewPost.mocks.d.ts +1 -1
- package/jsx/social/Feed/FeedNewPost.mocks.d.ts.map +1 -1
- package/jsx/social/Feed/FeedPost.mocks.d.ts +1 -1
- package/jsx/social/Feed/FeedPost.mocks.d.ts.map +1 -1
- package/jsx/social/Feed/FeedReply.mocks.d.ts +1 -1
- package/jsx/social/Feed/FeedReply.mocks.d.ts.map +1 -1
- package/jsx/work/CaseView/Attachments.mocks.d.ts +1 -1
- package/jsx/work/CaseView/Attachments.mocks.d.ts.map +1 -1
- package/jsx/work/CaseView/CaseView.mocks.d.ts +9 -9
- package/jsx/work/CaseView/CaseView.mocks.d.ts.map +1 -1
- package/jsx/work/CaseView/CaseView.mocks.jsx +3 -3
- package/jsx/work/CaseView/CaseView.mocks.jsx.map +1 -1
- package/jsx/work/CaseView/Details.mocks.d.ts +1 -1
- package/jsx/work/CaseView/Details.mocks.d.ts.map +1 -1
- package/jsx/work/CaseView/Pulse.mocks.d.ts +1 -1
- package/jsx/work/CaseView/Pulse.mocks.d.ts.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +6 -6
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -1
- package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts +0 -1
- package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.jsx +2 -252
- package/jsx/work/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
- package/jsx/work/Predictions/Predictions.mocks.d.ts +1 -1
- package/jsx/work/Predictions/Predictions.mocks.d.ts.map +1 -1
- package/jsx/work/Stages/Stages.mocks.d.ts +1 -1
- package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts +1 -1
- package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -1
- package/jsx/wss/AppShell/AppShell.mocks.d.ts +3 -3
- package/jsx/wss/AppShell/AppShell.mocks.d.ts.map +1 -1
- package/jsx/wss/CaseView/CaseView.mocks.d.ts +1 -1
- package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/lib/core/Avatar/Avatar.stories.js +1 -2
- package/lib/core/Avatar/Avatar.stories.js.map +1 -1
- package/lib/core/Breadcrumbs/Breadcrumbs.mocks.d.ts +2 -0
- package/lib/core/Breadcrumbs/Breadcrumbs.mocks.d.ts.map +1 -0
- package/lib/core/Breadcrumbs/Breadcrumbs.mocks.js +8 -0
- package/lib/core/Breadcrumbs/Breadcrumbs.mocks.js.map +1 -0
- package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -0
- package/lib/core/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/lib/core/Breadcrumbs/Breadcrumbs.stories.js +39 -11
- package/lib/core/Breadcrumbs/Breadcrumbs.stories.js.map +1 -1
- package/lib/core/ComboBox/ComboBox.mocks.d.ts +2 -0
- package/lib/core/ComboBox/ComboBox.mocks.d.ts.map +1 -1
- package/lib/core/ComboBox/ComboBox.mocks.js +3 -0
- package/lib/core/ComboBox/ComboBox.mocks.js.map +1 -1
- package/lib/core/ComboBox/ComboBox.stories.d.ts +1 -0
- package/lib/core/ComboBox/ComboBox.stories.d.ts.map +1 -1
- package/lib/core/ComboBox/ComboBox.stories.js +15 -7
- package/lib/core/ComboBox/ComboBox.stories.js.map +1 -1
- package/lib/core/Icon/Icon.mocks.d.ts +23 -0
- package/lib/core/Icon/Icon.mocks.d.ts.map +1 -1
- package/lib/core/Icon/Icon.mocks.js +23 -0
- package/lib/core/Icon/Icon.mocks.js.map +1 -1
- package/lib/core/Icon/Icon.stories.d.ts +11 -1
- package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
- package/lib/core/Icon/Icon.stories.js +41 -7
- package/lib/core/Icon/Icon.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/rte/Editor/Editor.mocks.d.ts +7 -0
- package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -1
- package/lib/work/CaseView/CaseView.mocks.d.ts.map +1 -1
- package/lib/work/CaseView/CaseView.mocks.js +3 -3
- package/lib/work/CaseView/CaseView.mocks.js.map +1 -1
- package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts +0 -1
- package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.js +3 -235
- package/lib/work/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
- package/package.json +12 -14
- package/jsx/build/AppShell/AppShell.mocks.d.ts +0 -44
- package/jsx/build/AppShell/AppShell.mocks.d.ts.map +0 -1
- package/jsx/build/AppShell/AppShell.mocks.jsx +0 -419
- package/jsx/build/AppShell/AppShell.mocks.jsx.map +0 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts +0 -20
- package/jsx/build/AppShell/AppShell.stories.d.ts.map +0 -1
- package/jsx/build/AppShell/AppShell.stories.jsx +0 -201
- package/jsx/build/AppShell/AppShell.stories.jsx.map +0 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +0 -8
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +0 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +0 -101
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +0 -1
- package/jsx/build/DynamicContentEditor/FieldSelector.d.ts +0 -11
- package/jsx/build/DynamicContentEditor/FieldSelector.d.ts.map +0 -1
- package/jsx/build/DynamicContentEditor/FieldSelector.jsx +0 -80
- package/jsx/build/DynamicContentEditor/FieldSelector.jsx.map +0 -1
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +0 -64
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +0 -1
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js +0 -599
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +0 -1
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts +0 -29
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +0 -1
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx +0 -344
- package/jsx/build/ExpressionBuilder/ExpressionBuilder.stories.jsx.map +0 -1
- package/jsx/build/FlowModeller/AddNodeUtils.mocks.d.ts +0 -45
- package/jsx/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +0 -1
- package/jsx/build/FlowModeller/AddNodeUtils.mocks.js +0 -291
- package/jsx/build/FlowModeller/AddNodeUtils.mocks.js.map +0 -1
- package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +0 -28
- package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +0 -1
- package/jsx/build/FlowModeller/FlowModeller.mocks.jsx +0 -559
- package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +0 -1
- package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +0 -11
- package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +0 -1
- package/jsx/build/FlowModeller/FlowModeller.stories.jsx +0 -501
- package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +0 -1
- package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +0 -2
- package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +0 -1
- package/jsx/build/FlowModeller/FlowModeller.styles.js +0 -8
- package/jsx/build/FlowModeller/FlowModeller.styles.js.map +0 -1
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +0 -3
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +0 -1
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +0 -45
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +0 -1
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +0 -5
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +0 -1
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx +0 -44
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +0 -1
- package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts +0 -204
- package/jsx/build/LifeCycle/LifeCycle.mocks.d.ts.map +0 -1
- package/jsx/build/LifeCycle/LifeCycle.mocks.js +0 -1256
- package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +0 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +0 -11
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +0 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx +0 -873
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +0 -1
- package/jsx/build/LifeCycle/utils.d.ts +0 -123
- package/jsx/build/LifeCycle/utils.d.ts.map +0 -1
- package/jsx/build/LifeCycle/utils.js +0 -302
- package/jsx/build/LifeCycle/utils.js.map +0 -1
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts +0 -10
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts.map +0 -1
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.js +0 -20
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.mocks.js.map +0 -1
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts +0 -8
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts.map +0 -1
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.jsx +0 -38
- package/jsx/build/MobileBuildSummary/MobileBuildSummary.stories.jsx.map +0 -1
- package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -7
- package/jsx/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
- package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx +0 -78
- package/jsx/build/ObjectPreview/ObjectPreview.mocks.jsx.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +0 -64
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +0 -397
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +0 -8
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +0 -258
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts +0 -4
- package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.styles.js +0 -27
- package/jsx/build/ObjectSelect/ObjectSelect.styles.js.map +0 -1
- package/jsx/build/PageBanner/PageBanner.stories.d.ts +0 -15
- package/jsx/build/PageBanner/PageBanner.stories.d.ts.map +0 -1
- package/jsx/build/PageBanner/PageBanner.stories.jsx +0 -41
- package/jsx/build/PageBanner/PageBanner.stories.jsx.map +0 -1
- package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +0 -21
- package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +0 -1
- package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +0 -24
- package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +0 -1
- package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +0 -16
- package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +0 -1
- package/jsx/build/PageTemplates/GalleryPage.stories.jsx +0 -49
- package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +0 -1
- package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +0 -17
- package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +0 -1
- package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +0 -144
- package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +0 -1
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +0 -21
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +0 -1
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx +0 -255
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +0 -1
- package/jsx/build/PageTemplates/ShowcasePage.stories.d.ts +0 -17
- package/jsx/build/PageTemplates/ShowcasePage.stories.d.ts.map +0 -1
- package/jsx/build/PageTemplates/ShowcasePage.stories.jsx +0 -42
- package/jsx/build/PageTemplates/ShowcasePage.stories.jsx.map +0 -1
- package/jsx/build/Workbench/Workbench.mocks.d.ts +0 -9
- package/jsx/build/Workbench/Workbench.mocks.d.ts.map +0 -1
- package/jsx/build/Workbench/Workbench.mocks.js +0 -67
- package/jsx/build/Workbench/Workbench.mocks.js.map +0 -1
- package/jsx/build/Workbench/Workbench.stories.d.ts +0 -11
- package/jsx/build/Workbench/Workbench.stories.d.ts.map +0 -1
- package/jsx/build/Workbench/Workbench.stories.jsx +0 -288
- package/jsx/build/Workbench/Workbench.stories.jsx.map +0 -1
- package/jsx/core/ComboBox/ComboBox.mocks.js.map +0 -1
- package/jsx/cs/CSAppShell/CSAppShell.mocks.d.ts +0 -90
- package/jsx/cs/CSAppShell/CSAppShell.mocks.d.ts.map +0 -1
- package/jsx/cs/CSAppShell/CSAppShell.mocks.jsx +0 -432
- package/jsx/cs/CSAppShell/CSAppShell.mocks.jsx.map +0 -1
- package/jsx/cs/CSAppShell/CSAppShell.stories.d.ts +0 -13
- package/jsx/cs/CSAppShell/CSAppShell.stories.d.ts.map +0 -1
- package/jsx/cs/CSAppShell/CSAppShell.stories.jsx +0 -173
- package/jsx/cs/CSAppShell/CSAppShell.stories.jsx.map +0 -1
- package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts +0 -21
- package/jsx/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +0 -1
- package/jsx/cs/CallControlPanel/CallControlPanel.mocks.js +0 -252
- package/jsx/cs/CallControlPanel/CallControlPanel.mocks.js.map +0 -1
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +0 -17
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +0 -1
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +0 -330
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +0 -1
- package/jsx/cs/DialPad/DialPad.stories.d.ts +0 -9
- package/jsx/cs/DialPad/DialPad.stories.d.ts.map +0 -1
- package/jsx/cs/DialPad/DialPad.stories.jsx +0 -20
- package/jsx/cs/DialPad/DialPad.stories.jsx.map +0 -1
- package/jsx/cs/DialPad/DialPadKeyboardData.mock.d.ts +0 -11
- package/jsx/cs/DialPad/DialPadKeyboardData.mock.d.ts.map +0 -1
- package/jsx/cs/DialPad/DialPadKeyboardData.mock.js +0 -20
- package/jsx/cs/DialPad/DialPadKeyboardData.mock.js.map +0 -1
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +0 -12
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +0 -1
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +0 -54
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +0 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +0 -11
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +0 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +0 -29
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +0 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +0 -11
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +0 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +0 -87
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +0 -1
- package/jsx/cs/Picker/Picker.stories.d.ts +0 -11
- package/jsx/cs/Picker/Picker.stories.d.ts.map +0 -1
- package/jsx/cs/Picker/Picker.stories.jsx +0 -64
- package/jsx/cs/Picker/Picker.stories.jsx.map +0 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +0 -30
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +0 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.js +0 -228
- package/jsx/cs/TaskManager/TaskManager.mocks.js.map +0 -1
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts +0 -15
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +0 -1
- package/jsx/cs/TaskManager/TaskManager.stories.jsx +0 -419
- package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +0 -1
- package/jsx/cs/TaskManager/TaskManager.styles.d.ts +0 -3
- package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +0 -1
- package/jsx/cs/TaskManager/TaskManager.styles.js +0 -9
- package/jsx/cs/TaskManager/TaskManager.styles.js.map +0 -1
- package/jsx/tools/Clipboard/Clipboard.mocks.d.ts +0 -6
- package/jsx/tools/Clipboard/Clipboard.mocks.d.ts.map +0 -1
- package/jsx/tools/Clipboard/Clipboard.mocks.jsx +0 -81
- package/jsx/tools/Clipboard/Clipboard.mocks.jsx.map +0 -1
- package/jsx/tools/Clipboard/Clipboard.stories.d.ts +0 -6
- package/jsx/tools/Clipboard/Clipboard.stories.d.ts.map +0 -1
- package/jsx/tools/Clipboard/Clipboard.stories.jsx +0 -67
- package/jsx/tools/Clipboard/Clipboard.stories.jsx.map +0 -1
- package/jsx/tools/DevTools/DevTools.mocks.d.ts +0 -3
- package/jsx/tools/DevTools/DevTools.mocks.d.ts.map +0 -1
- package/jsx/tools/DevTools/DevTools.mocks.js +0 -3
- package/jsx/tools/DevTools/DevTools.mocks.js.map +0 -1
- package/jsx/tools/DevTools/DevTools.stories.d.ts +0 -10
- package/jsx/tools/DevTools/DevTools.stories.d.ts.map +0 -1
- package/jsx/tools/DevTools/DevTools.stories.jsx +0 -33
- package/jsx/tools/DevTools/DevTools.stories.jsx.map +0 -1
- package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts +0 -20
- package/jsx/tools/PreviewShell/PreviewShell.mocks.d.ts.map +0 -1
- package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx +0 -80
- package/jsx/tools/PreviewShell/PreviewShell.mocks.jsx.map +0 -1
- package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts +0 -20
- package/jsx/tools/PreviewShell/PreviewShell.stories.d.ts.map +0 -1
- package/jsx/tools/PreviewShell/PreviewShell.stories.jsx +0 -184
- package/jsx/tools/PreviewShell/PreviewShell.stories.jsx.map +0 -1
- package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts +0 -2
- package/jsx/tools/PreviewShell/PreviewShell.styles.d.ts.map +0 -1
- package/jsx/tools/PreviewShell/PreviewShell.styles.js +0 -6
- package/jsx/tools/PreviewShell/PreviewShell.styles.js.map +0 -1
- package/lib/build/AppShell/AppShell.mocks.d.ts +0 -44
- package/lib/build/AppShell/AppShell.mocks.d.ts.map +0 -1
- package/lib/build/AppShell/AppShell.mocks.js +0 -419
- package/lib/build/AppShell/AppShell.mocks.js.map +0 -1
- package/lib/build/AppShell/AppShell.stories.d.ts +0 -20
- package/lib/build/AppShell/AppShell.stories.d.ts.map +0 -1
- package/lib/build/AppShell/AppShell.stories.js +0 -200
- package/lib/build/AppShell/AppShell.stories.js.map +0 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +0 -8
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +0 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +0 -85
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +0 -1
- package/lib/build/DynamicContentEditor/FieldSelector.d.ts +0 -14
- package/lib/build/DynamicContentEditor/FieldSelector.d.ts.map +0 -1
- package/lib/build/DynamicContentEditor/FieldSelector.js +0 -81
- package/lib/build/DynamicContentEditor/FieldSelector.js.map +0 -1
- package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts +0 -64
- package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.d.ts.map +0 -1
- package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js +0 -599
- package/lib/build/ExpressionBuilder/ExpressionBuilder.mocks.js.map +0 -1
- package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts +0 -29
- package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.d.ts.map +0 -1
- package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js +0 -339
- package/lib/build/ExpressionBuilder/ExpressionBuilder.stories.js.map +0 -1
- package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts +0 -45
- package/lib/build/FlowModeller/AddNodeUtils.mocks.d.ts.map +0 -1
- package/lib/build/FlowModeller/AddNodeUtils.mocks.js +0 -291
- package/lib/build/FlowModeller/AddNodeUtils.mocks.js.map +0 -1
- package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +0 -28
- package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +0 -1
- package/lib/build/FlowModeller/FlowModeller.mocks.js +0 -536
- package/lib/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
- package/lib/build/FlowModeller/FlowModeller.stories.d.ts +0 -11
- package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +0 -1
- package/lib/build/FlowModeller/FlowModeller.stories.js +0 -481
- package/lib/build/FlowModeller/FlowModeller.stories.js.map +0 -1
- package/lib/build/FlowModeller/FlowModeller.styles.d.ts +0 -2
- package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +0 -1
- package/lib/build/FlowModeller/FlowModeller.styles.js +0 -8
- package/lib/build/FlowModeller/FlowModeller.styles.js.map +0 -1
- package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +0 -3
- package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +0 -1
- package/lib/build/ItemLibrary/LibraryPicker.mocks.js +0 -45
- package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +0 -1
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +0 -5
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +0 -1
- package/lib/build/ItemLibrary/LibraryPicker.stories.js +0 -39
- package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +0 -1
- package/lib/build/LifeCycle/LifeCycle.mocks.d.ts +0 -204
- package/lib/build/LifeCycle/LifeCycle.mocks.d.ts.map +0 -1
- package/lib/build/LifeCycle/LifeCycle.mocks.js +0 -1256
- package/lib/build/LifeCycle/LifeCycle.mocks.js.map +0 -1
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts +0 -11
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +0 -1
- package/lib/build/LifeCycle/LifeCycle.stories.js +0 -870
- package/lib/build/LifeCycle/LifeCycle.stories.js.map +0 -1
- package/lib/build/LifeCycle/utils.d.ts +0 -123
- package/lib/build/LifeCycle/utils.d.ts.map +0 -1
- package/lib/build/LifeCycle/utils.js +0 -302
- package/lib/build/LifeCycle/utils.js.map +0 -1
- package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts +0 -10
- package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.d.ts.map +0 -1
- package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.js +0 -20
- package/lib/build/MobileBuildSummary/MobileBuildSummary.mocks.js.map +0 -1
- package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts +0 -8
- package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.d.ts.map +0 -1
- package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.js +0 -39
- package/lib/build/MobileBuildSummary/MobileBuildSummary.stories.js.map +0 -1
- package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts +0 -7
- package/lib/build/ObjectPreview/ObjectPreview.mocks.d.ts.map +0 -1
- package/lib/build/ObjectPreview/ObjectPreview.mocks.js +0 -74
- package/lib/build/ObjectPreview/ObjectPreview.mocks.js.map +0 -1
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +0 -64
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +0 -1
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js +0 -370
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +0 -1
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +0 -8
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +0 -1
- package/lib/build/ObjectSelect/ObjectSelect.stories.js +0 -240
- package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +0 -1
- package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts +0 -4
- package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts.map +0 -1
- package/lib/build/ObjectSelect/ObjectSelect.styles.js +0 -27
- package/lib/build/ObjectSelect/ObjectSelect.styles.js.map +0 -1
- package/lib/build/PageBanner/PageBanner.stories.d.ts +0 -15
- package/lib/build/PageBanner/PageBanner.stories.d.ts.map +0 -1
- package/lib/build/PageBanner/PageBanner.stories.js +0 -42
- package/lib/build/PageBanner/PageBanner.stories.js.map +0 -1
- package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +0 -21
- package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +0 -1
- package/lib/build/PageTemplates/GalleryPage.mocks.js +0 -25
- package/lib/build/PageTemplates/GalleryPage.mocks.js.map +0 -1
- package/lib/build/PageTemplates/GalleryPage.stories.d.ts +0 -16
- package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +0 -1
- package/lib/build/PageTemplates/GalleryPage.stories.js +0 -50
- package/lib/build/PageTemplates/GalleryPage.stories.js.map +0 -1
- package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +0 -17
- package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +0 -1
- package/lib/build/PageTemplates/PageTemplates.mocks.js +0 -107
- package/lib/build/PageTemplates/PageTemplates.mocks.js.map +0 -1
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts +0 -21
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +0 -1
- package/lib/build/PageTemplates/PageTemplates.stories.js +0 -246
- package/lib/build/PageTemplates/PageTemplates.stories.js.map +0 -1
- package/lib/build/PageTemplates/ShowcasePage.stories.d.ts +0 -17
- package/lib/build/PageTemplates/ShowcasePage.stories.d.ts.map +0 -1
- package/lib/build/PageTemplates/ShowcasePage.stories.js +0 -43
- package/lib/build/PageTemplates/ShowcasePage.stories.js.map +0 -1
- package/lib/build/Workbench/Workbench.mocks.d.ts +0 -9
- package/lib/build/Workbench/Workbench.mocks.d.ts.map +0 -1
- package/lib/build/Workbench/Workbench.mocks.js +0 -67
- package/lib/build/Workbench/Workbench.mocks.js.map +0 -1
- package/lib/build/Workbench/Workbench.stories.d.ts +0 -11
- package/lib/build/Workbench/Workbench.stories.d.ts.map +0 -1
- package/lib/build/Workbench/Workbench.stories.js +0 -273
- package/lib/build/Workbench/Workbench.stories.js.map +0 -1
- package/lib/cs/CSAppShell/CSAppShell.mocks.d.ts +0 -90
- package/lib/cs/CSAppShell/CSAppShell.mocks.d.ts.map +0 -1
- package/lib/cs/CSAppShell/CSAppShell.mocks.js +0 -385
- package/lib/cs/CSAppShell/CSAppShell.mocks.js.map +0 -1
- package/lib/cs/CSAppShell/CSAppShell.stories.d.ts +0 -13
- package/lib/cs/CSAppShell/CSAppShell.stories.d.ts.map +0 -1
- package/lib/cs/CSAppShell/CSAppShell.stories.js +0 -172
- package/lib/cs/CSAppShell/CSAppShell.stories.js.map +0 -1
- package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts +0 -21
- package/lib/cs/CallControlPanel/CallControlPanel.mocks.d.ts.map +0 -1
- package/lib/cs/CallControlPanel/CallControlPanel.mocks.js +0 -252
- package/lib/cs/CallControlPanel/CallControlPanel.mocks.js.map +0 -1
- package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +0 -17
- package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +0 -1
- package/lib/cs/CallControlPanel/CallControlPanel.stories.js +0 -331
- package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +0 -1
- package/lib/cs/DialPad/DialPad.stories.d.ts +0 -9
- package/lib/cs/DialPad/DialPad.stories.d.ts.map +0 -1
- package/lib/cs/DialPad/DialPad.stories.js +0 -19
- package/lib/cs/DialPad/DialPad.stories.js.map +0 -1
- package/lib/cs/DialPad/DialPadKeyboardData.mock.d.ts +0 -11
- package/lib/cs/DialPad/DialPadKeyboardData.mock.d.ts.map +0 -1
- package/lib/cs/DialPad/DialPadKeyboardData.mock.js +0 -20
- package/lib/cs/DialPad/DialPadKeyboardData.mock.js.map +0 -1
- package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +0 -12
- package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +0 -1
- package/lib/cs/InteractionNotification/InteractionNotification.stories.js +0 -55
- package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +0 -1
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +0 -11
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +0 -1
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +0 -29
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +0 -1
- package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +0 -11
- package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +0 -1
- package/lib/cs/InteractionTimer/InteractionTimer.stories.js +0 -88
- package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +0 -1
- package/lib/cs/Picker/Picker.stories.d.ts +0 -11
- package/lib/cs/Picker/Picker.stories.d.ts.map +0 -1
- package/lib/cs/Picker/Picker.stories.js +0 -56
- package/lib/cs/Picker/Picker.stories.js.map +0 -1
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts +0 -30
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +0 -1
- package/lib/cs/TaskManager/TaskManager.mocks.js +0 -228
- package/lib/cs/TaskManager/TaskManager.mocks.js.map +0 -1
- package/lib/cs/TaskManager/TaskManager.stories.d.ts +0 -15
- package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +0 -1
- package/lib/cs/TaskManager/TaskManager.stories.js +0 -395
- package/lib/cs/TaskManager/TaskManager.stories.js.map +0 -1
- package/lib/cs/TaskManager/TaskManager.styles.d.ts +0 -3
- package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +0 -1
- package/lib/cs/TaskManager/TaskManager.styles.js +0 -9
- package/lib/cs/TaskManager/TaskManager.styles.js.map +0 -1
- package/lib/tools/Clipboard/Clipboard.mocks.d.ts +0 -6
- package/lib/tools/Clipboard/Clipboard.mocks.d.ts.map +0 -1
- package/lib/tools/Clipboard/Clipboard.mocks.js +0 -74
- package/lib/tools/Clipboard/Clipboard.mocks.js.map +0 -1
- package/lib/tools/Clipboard/Clipboard.stories.d.ts +0 -6
- package/lib/tools/Clipboard/Clipboard.stories.d.ts.map +0 -1
- package/lib/tools/Clipboard/Clipboard.stories.js +0 -74
- package/lib/tools/Clipboard/Clipboard.stories.js.map +0 -1
- package/lib/tools/DevTools/DevTools.mocks.d.ts +0 -3
- package/lib/tools/DevTools/DevTools.mocks.d.ts.map +0 -1
- package/lib/tools/DevTools/DevTools.mocks.js +0 -3
- package/lib/tools/DevTools/DevTools.mocks.js.map +0 -1
- package/lib/tools/DevTools/DevTools.stories.d.ts +0 -10
- package/lib/tools/DevTools/DevTools.stories.d.ts.map +0 -1
- package/lib/tools/DevTools/DevTools.stories.js +0 -29
- package/lib/tools/DevTools/DevTools.stories.js.map +0 -1
- package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts +0 -20
- package/lib/tools/PreviewShell/PreviewShell.mocks.d.ts.map +0 -1
- package/lib/tools/PreviewShell/PreviewShell.mocks.js +0 -77
- package/lib/tools/PreviewShell/PreviewShell.mocks.js.map +0 -1
- package/lib/tools/PreviewShell/PreviewShell.stories.d.ts +0 -20
- package/lib/tools/PreviewShell/PreviewShell.stories.d.ts.map +0 -1
- package/lib/tools/PreviewShell/PreviewShell.stories.js +0 -181
- package/lib/tools/PreviewShell/PreviewShell.stories.js.map +0 -1
- package/lib/tools/PreviewShell/PreviewShell.styles.d.ts +0 -2
- package/lib/tools/PreviewShell/PreviewShell.styles.d.ts.map +0 -1
- package/lib/tools/PreviewShell/PreviewShell.styles.js +0 -6
- package/lib/tools/PreviewShell/PreviewShell.styles.js.map +0 -1
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { lighten, readableColor } from 'polished';
|
|
5
|
-
import { createUID, tryCatch, useTheme } from '@pega/cosmos-react-core';
|
|
6
|
-
import { CallControlPanel, ExternalCTI } from '@pega/cosmos-react-cs';
|
|
7
|
-
import { contactsList, createExternalIframeContent, interactionOptions, transferReasons, userStatusOptions } from './CallControlPanel.mocks';
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Customer Service/CallControlPanel',
|
|
10
|
-
component: CallControlPanel,
|
|
11
|
-
args: {
|
|
12
|
-
heading: 'Agent',
|
|
13
|
-
isDraggable: true,
|
|
14
|
-
showStatus: true
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
heading: { control: { type: 'text' } },
|
|
18
|
-
isDraggable: { control: { type: 'boolean' } },
|
|
19
|
-
showStatus: { control: { type: 'boolean' } }
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export const CallControlPanelDemo = (args) => {
|
|
23
|
-
const [currentStatus, setCurrentStatus] = useState(args.status || 'available');
|
|
24
|
-
const inStatusSince = useRef(Date.now());
|
|
25
|
-
const [calls, setCalls] = useState([]);
|
|
26
|
-
const [contacts, setContacts] = useState(contactsList);
|
|
27
|
-
const callsList = useRef(calls);
|
|
28
|
-
callsList.current = calls;
|
|
29
|
-
const [showInteractionTransfer, setShowInteractionTransfer] = useState(false);
|
|
30
|
-
const onMuteToggle = (id) => {
|
|
31
|
-
const thisCallIndex = callsList.current.findIndex(call => call.id === id);
|
|
32
|
-
if (thisCallIndex < 0)
|
|
33
|
-
return;
|
|
34
|
-
const thisCall = callsList.current[thisCallIndex];
|
|
35
|
-
callsList.current.splice(thisCallIndex, 1, {
|
|
36
|
-
...thisCall,
|
|
37
|
-
muted: !thisCall.muted
|
|
38
|
-
});
|
|
39
|
-
setCalls([...callsList.current]);
|
|
40
|
-
};
|
|
41
|
-
const onMergeCall = (id) => {
|
|
42
|
-
const thisCall = callsList.current.find(call => call.id === id);
|
|
43
|
-
const activeCallIndex = callsList.current.findIndex(call => !call.onHoldSince);
|
|
44
|
-
const currentCall = callsList.current[activeCallIndex];
|
|
45
|
-
if (!thisCall || !activeCallIndex)
|
|
46
|
-
return;
|
|
47
|
-
callsList.current.splice(activeCallIndex, 1, {
|
|
48
|
-
...currentCall,
|
|
49
|
-
participants: [...currentCall.participants, ...thisCall.participants],
|
|
50
|
-
onHoldSince: undefined
|
|
51
|
-
});
|
|
52
|
-
setCalls([...callsList.current.filter(call => call.id !== id)]);
|
|
53
|
-
};
|
|
54
|
-
const onHandOffCall = (id) => {
|
|
55
|
-
setCalls([
|
|
56
|
-
...callsList.current.filter(call => call.id !== id && call.onHoldSince)
|
|
57
|
-
]);
|
|
58
|
-
};
|
|
59
|
-
const onPauseToggle = (id) => {
|
|
60
|
-
const thisCall = callsList.current.find(call => call.id === id);
|
|
61
|
-
if (!thisCall)
|
|
62
|
-
return;
|
|
63
|
-
const wasPaused = !!thisCall.onHoldSince;
|
|
64
|
-
callsList.current = callsList.current.map(call => {
|
|
65
|
-
if (thisCall.id === call.id)
|
|
66
|
-
return {
|
|
67
|
-
...call,
|
|
68
|
-
onHoldSince: wasPaused ? undefined : Date.now(),
|
|
69
|
-
onMergeCall: wasPaused ? onMergeCall : undefined,
|
|
70
|
-
onHandOffCall: wasPaused ? onHandOffCall : undefined
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
...call,
|
|
74
|
-
onPauseToggle: wasPaused ? undefined : onPauseToggle,
|
|
75
|
-
onMergeCall: wasPaused ? onMergeCall : undefined,
|
|
76
|
-
onHandOffCall: wasPaused ? onHandOffCall : undefined
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
setCalls([...callsList.current]);
|
|
80
|
-
};
|
|
81
|
-
const onEndCall = (id) => {
|
|
82
|
-
setCalls(callsList.current.filter(item => item.id !== id));
|
|
83
|
-
setCurrentStatus('available');
|
|
84
|
-
};
|
|
85
|
-
const onHangUp = (callId, participantId) => {
|
|
86
|
-
const currentCallIndex = callsList.current.findIndex(call => call.id === callId);
|
|
87
|
-
if (currentCallIndex < 0)
|
|
88
|
-
return;
|
|
89
|
-
const currentCall = callsList.current[currentCallIndex];
|
|
90
|
-
callsList.current.splice(currentCallIndex, 1, {
|
|
91
|
-
...currentCall,
|
|
92
|
-
participants: [
|
|
93
|
-
...currentCall.participants.filter(participant => participant.id !== participantId)
|
|
94
|
-
]
|
|
95
|
-
});
|
|
96
|
-
setCalls([...callsList.current]);
|
|
97
|
-
};
|
|
98
|
-
const onConferenceAction = (id, data) => {
|
|
99
|
-
const caller = contactsList.find(person => person.phoneNumber === data.phoneNumber);
|
|
100
|
-
const conferenceCall = {
|
|
101
|
-
id: createUID(),
|
|
102
|
-
startedAt: Date.now(),
|
|
103
|
-
onMergeCall,
|
|
104
|
-
transferOptions: transferReasons,
|
|
105
|
-
interactionOptions,
|
|
106
|
-
muted: false,
|
|
107
|
-
onMuteToggle,
|
|
108
|
-
onPauseToggle,
|
|
109
|
-
onHandOffCall,
|
|
110
|
-
onEndCall,
|
|
111
|
-
participants: [
|
|
112
|
-
{
|
|
113
|
-
name: caller?.primary || '',
|
|
114
|
-
info: caller?.secondary || '',
|
|
115
|
-
id: caller?.primary || '',
|
|
116
|
-
onHangUp
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
};
|
|
120
|
-
const currentCall = callsList.current[0];
|
|
121
|
-
callsList.current.splice(0, 1, {
|
|
122
|
-
...callsList.current[0],
|
|
123
|
-
participants: [...currentCall.participants, ...conferenceCall.participants],
|
|
124
|
-
onHoldSince: undefined
|
|
125
|
-
});
|
|
126
|
-
setCalls([...callsList.current.filter(call => call.id !== conferenceCall.id)]);
|
|
127
|
-
};
|
|
128
|
-
const onConsultAction = (id, data) => {
|
|
129
|
-
const caller = contactsList.find(person => person.phoneNumber === data.phoneNumber);
|
|
130
|
-
const consultCall = {
|
|
131
|
-
id: createUID(),
|
|
132
|
-
startedAt: Date.now(),
|
|
133
|
-
transferOptions: transferReasons,
|
|
134
|
-
muted: false,
|
|
135
|
-
onMuteToggle,
|
|
136
|
-
onPauseToggle,
|
|
137
|
-
onMergeCall,
|
|
138
|
-
onHandOffCall,
|
|
139
|
-
onDTMFPress: action('onDTMFPress'),
|
|
140
|
-
onTransferAction: (callId, transferData) => {
|
|
141
|
-
action('onTransferAction')(callId, transferData);
|
|
142
|
-
if (transferData.interaction)
|
|
143
|
-
setShowInteractionTransfer(true);
|
|
144
|
-
onEndCall(id);
|
|
145
|
-
},
|
|
146
|
-
onConsultAction,
|
|
147
|
-
onConferenceAction,
|
|
148
|
-
onEndCall,
|
|
149
|
-
participants: [
|
|
150
|
-
{
|
|
151
|
-
name: caller?.primary || '',
|
|
152
|
-
info: caller?.secondary || '',
|
|
153
|
-
id: caller?.primary || '',
|
|
154
|
-
onHangUp
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
};
|
|
158
|
-
const updatedCalls = callsList.current.map(call => {
|
|
159
|
-
return { ...call, onHoldSince: Date.now(), onMergeCall, onPauseToggle: undefined };
|
|
160
|
-
});
|
|
161
|
-
updatedCalls.push(consultCall);
|
|
162
|
-
setCalls(updatedCalls);
|
|
163
|
-
};
|
|
164
|
-
useEffect(() => {
|
|
165
|
-
const timeoutId = setTimeout(() => {
|
|
166
|
-
const caller = contactsList[0];
|
|
167
|
-
const consultCall = {
|
|
168
|
-
id: createUID(),
|
|
169
|
-
startedAt: Date.now(),
|
|
170
|
-
transferOptions: transferReasons,
|
|
171
|
-
muted: false,
|
|
172
|
-
onMuteToggle,
|
|
173
|
-
onPauseToggle,
|
|
174
|
-
onMergeCall,
|
|
175
|
-
onHandOffCall,
|
|
176
|
-
onDTMFPress: action('onDTMFPress'),
|
|
177
|
-
onTransferAction: (callId, transferData) => {
|
|
178
|
-
action('onTransferAction')(callId, transferData);
|
|
179
|
-
if (transferData.interaction)
|
|
180
|
-
setShowInteractionTransfer(true);
|
|
181
|
-
onEndCall(callId);
|
|
182
|
-
},
|
|
183
|
-
onConsultAction,
|
|
184
|
-
onConferenceAction,
|
|
185
|
-
onEndCall,
|
|
186
|
-
participants: [
|
|
187
|
-
{
|
|
188
|
-
name: caller?.primary || '',
|
|
189
|
-
info: caller?.secondary || '',
|
|
190
|
-
id: caller?.primary || '',
|
|
191
|
-
onHangUp
|
|
192
|
-
}
|
|
193
|
-
]
|
|
194
|
-
};
|
|
195
|
-
const incomingCall = {
|
|
196
|
-
id: createUID(),
|
|
197
|
-
onAcceptCall: () => {
|
|
198
|
-
setCalls([consultCall]);
|
|
199
|
-
},
|
|
200
|
-
participant: {
|
|
201
|
-
name: contactsList[0].primary,
|
|
202
|
-
info: contactsList[0].secondary,
|
|
203
|
-
id: contactsList[0].primary
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
setCalls([incomingCall, ...callsList.current]);
|
|
207
|
-
}, 4000);
|
|
208
|
-
return () => clearTimeout(timeoutId);
|
|
209
|
-
}, []);
|
|
210
|
-
return (_jsx(CallControlPanel, { visible: args.visible ?? true, heading: args.heading, userStatus: args.showStatus
|
|
211
|
-
? {
|
|
212
|
-
statusOptions: userStatusOptions,
|
|
213
|
-
status: currentStatus,
|
|
214
|
-
inStatusSince: inStatusSince.current,
|
|
215
|
-
onChange: value => {
|
|
216
|
-
setCurrentStatus(value);
|
|
217
|
-
args.onStatusChange?.(userStatusOptions.find(s => s.id === value) ?? userStatusOptions[0]);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
: undefined, interactionTransfer: showInteractionTransfer
|
|
221
|
-
? {
|
|
222
|
-
onCancel: () => setShowInteractionTransfer(false),
|
|
223
|
-
onComplete: () => setShowInteractionTransfer(false)
|
|
224
|
-
}
|
|
225
|
-
: undefined, calls: calls, draggable: args.isDraggable, onAddCall: (phoneNumber) => {
|
|
226
|
-
const call = {
|
|
227
|
-
id: createUID(),
|
|
228
|
-
startedAt: Date.now(),
|
|
229
|
-
slaConfig: [30, 50],
|
|
230
|
-
onConsultAction,
|
|
231
|
-
onConferenceAction,
|
|
232
|
-
transferOptions: transferReasons,
|
|
233
|
-
defaultTransfer: transferReasons[1].id,
|
|
234
|
-
interactionOptions,
|
|
235
|
-
onTransferAction: (id, data) => {
|
|
236
|
-
action('onTransferAction')(id, data);
|
|
237
|
-
if (data.interaction)
|
|
238
|
-
setShowInteractionTransfer(true);
|
|
239
|
-
onEndCall(id);
|
|
240
|
-
},
|
|
241
|
-
muted: false,
|
|
242
|
-
onMuteToggle,
|
|
243
|
-
onPauseToggle,
|
|
244
|
-
onMergeCall,
|
|
245
|
-
onDTMFPress: action('onDTMFPress'),
|
|
246
|
-
onEndCall: () => onEndCall(call.id),
|
|
247
|
-
participants: [
|
|
248
|
-
{
|
|
249
|
-
id: contactsList.find(person => person.phoneNumber === phoneNumber)?.primary || '',
|
|
250
|
-
name: contactsList.find(person => person.phoneNumber === phoneNumber)?.primary ||
|
|
251
|
-
'Unknown',
|
|
252
|
-
onHangUp
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
};
|
|
256
|
-
setCalls([call]);
|
|
257
|
-
setCurrentStatus('not_available');
|
|
258
|
-
}, contactsList: contacts, onFavoriteToggle: (phoneNumber, favorite) => {
|
|
259
|
-
const element = contacts.find(item => item.phoneNumber === phoneNumber);
|
|
260
|
-
element.favorite = !favorite;
|
|
261
|
-
setContacts([...contacts]);
|
|
262
|
-
} }));
|
|
263
|
-
};
|
|
264
|
-
export const ExternalCTIDemo = (args) => {
|
|
265
|
-
const containerRef = useRef(null);
|
|
266
|
-
const [error, setError] = useState('');
|
|
267
|
-
const { base, components } = useTheme();
|
|
268
|
-
const styling = args.applyAppStyling
|
|
269
|
-
? {
|
|
270
|
-
'--app-bg-color': base.palette['app-background'],
|
|
271
|
-
'--header-border-color': base.palette['secondary-background'],
|
|
272
|
-
'--text-color': base.palette['foreground-color'],
|
|
273
|
-
'--msg-me-bg-color': base.palette.interactive,
|
|
274
|
-
'--msg-me-text-color': tryCatch(() => readableColor(base.palette.interactive)),
|
|
275
|
-
'--msg-you-bg-color': base.palette['primary-background'],
|
|
276
|
-
'--msg-you-text-color': tryCatch(() => readableColor(base.palette['primary-background'])),
|
|
277
|
-
'--msg-border-radius': '16px',
|
|
278
|
-
'--button-text-color': tryCatch(() => readableColor(components.button.color)),
|
|
279
|
-
'--button-bg-color': components.button.color,
|
|
280
|
-
'--button-border-color': 'transparent',
|
|
281
|
-
'--button-border-radius': `calc(${components.button['border-radius']} * ${base['border-radius']})`,
|
|
282
|
-
'--button-hover-bg-color': tryCatch(() => lighten(0.1, components.button.color)),
|
|
283
|
-
'--button-height': components.input.height,
|
|
284
|
-
'--input-height': components.input.height,
|
|
285
|
-
'--input-background-color': components.input['background-color'],
|
|
286
|
-
'--input-text-color': base.palette['foreground-color'],
|
|
287
|
-
'--input-border-radius': `calc(0.5 * ${base['border-radius']})`,
|
|
288
|
-
'--input-focus-border-color': 'transparent',
|
|
289
|
-
'--input-focus-box-shadow': components.button['focus-shadow'],
|
|
290
|
-
'--footer-bg-color': base.palette['app-background']
|
|
291
|
-
}
|
|
292
|
-
: undefined;
|
|
293
|
-
useEffect(() => {
|
|
294
|
-
if (containerRef.current) {
|
|
295
|
-
containerRef.current.innerHTML = `
|
|
296
|
-
<iframe id='external-cti' srcdoc='${createExternalIframeContent(styling)}' width='100%' height='500px'></iframe>
|
|
297
|
-
`;
|
|
298
|
-
}
|
|
299
|
-
}, [containerRef.current, styling]);
|
|
300
|
-
return (_jsx(ExternalCTI, { heading: args.heading, draggable: args.isDraggable, visible: args.visible, ref: containerRef, attachInteractionProps: {
|
|
301
|
-
onAddInteraction: ({ comments }, { close }) => {
|
|
302
|
-
if (comments === 'error') {
|
|
303
|
-
setError('The service is currently unavailable');
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
close();
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
reasonOptions: transferReasons,
|
|
310
|
-
defaultInteraction: interactionOptions.find(({ id }) => id === '23254324')?.id,
|
|
311
|
-
interactionOptions,
|
|
312
|
-
heading: 'Attach interaction to call',
|
|
313
|
-
...(error && {
|
|
314
|
-
message: {
|
|
315
|
-
variant: 'urgent',
|
|
316
|
-
messages: [error]
|
|
317
|
-
}
|
|
318
|
-
})
|
|
319
|
-
} }));
|
|
320
|
-
};
|
|
321
|
-
ExternalCTIDemo.args = {
|
|
322
|
-
heading: 'External CTI',
|
|
323
|
-
isDraggable: true,
|
|
324
|
-
applyAppStyling: false
|
|
325
|
-
};
|
|
326
|
-
ExternalCTIDemo.argTypes = {
|
|
327
|
-
heading: { control: { type: 'text' } },
|
|
328
|
-
isDraggable: { control: { type: 'boolean' } },
|
|
329
|
-
applyAppStyling: { control: { type: 'boolean' } }
|
|
330
|
-
};
|
|
331
|
-
//# sourceMappingURL=CallControlPanel.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CallControlPanel.stories.js","sourceRoot":"","sources":["../../../src/cs/CallControlPanel/CallControlPanel.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUtE,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAGlC,eAAe;IACb,KAAK,EAAE,mCAAmC;IAC1C,SAAS,EAAE,gBAAgB;IAC3B,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,IAAI;KACjB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,EAAE,OAA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AC,CAAC,CAAC;IAEpC,OAAO,CACL,KAAC,WAAW,IACV,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,SAAS,EAAE,IAAI,CAAC,WAAW,EAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,GAAG,EAAE,YAAY,EACjB,sBAAsB,EAAE;YACtB,gBAAgB,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;gBAC5C,IAAI,QAAQ,KAAK,OAAO,EAAE;oBACxB,QAAQ,CAAC,sCAAsC,CAAC,CAAC;iBAClD;qBAAM;oBACL,KAAK,EAAE,CAAC;iBACT;YACH,CAAC;YACD,aAAa,EAAE,eAAe;YAC9B,kBAAkB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,EAAE;YAC9E,kBAAkB;YAClB,OAAO,EAAE,4BAA4B;YACrC,GAAG,CAAC,KAAK,IAAI;gBACX,OAAO,EAAE;oBACP,OAAO,EAAE,QAAQ;oBACjB,QAAQ,EAAE,CAAC,KAAK,CAAC;iBAClB;aACF,CAAC;SACH,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,IAAI,GAAG;IACrB,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,eAAe,CAAC,QAAQ,GAAG;IACzB,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACtC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC7C,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CAClD,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport { useEffect, useRef, useState } from 'react';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport { lighten, readableColor } from 'polished';\n\nimport { createUID, tryCatch, useTheme } from '@pega/cosmos-react-core';\nimport { CallControlPanel, ExternalCTI } from '@pega/cosmos-react-cs';\nimport type {\n CallProps,\n IncomingCallProps,\n CallParticipant,\n TransferData,\n UserAvailabilityStatusOption,\n CallControlPanelProps\n} from '@pega/cosmos-react-cs';\n\nimport {\n contactsList,\n createExternalIframeContent,\n interactionOptions,\n transferReasons,\n userStatusOptions\n} from './CallControlPanel.mocks';\nimport type { ExternalStyles } from './CallControlPanel.mocks';\n\nexport default {\n title: 'Customer Service/CallControlPanel',\n component: CallControlPanel,\n args: {\n heading: 'Agent',\n isDraggable: true,\n showStatus: true\n },\n argTypes: {\n heading: { control: { type: 'text' } },\n isDraggable: { control: { type: 'boolean' } },\n showStatus: { control: { type: 'boolean' } }\n }\n} as Meta;\n\ninterface CallControlPanelStoryProps {\n heading: string;\n isDraggable?: boolean;\n showStatus: boolean;\n status?: UserAvailabilityStatusOption['id'];\n onStatusChange?: (newStatus: UserAvailabilityStatusOption) => void;\n visible?: CallControlPanelProps['visible'];\n}\n\nexport const CallControlPanelDemo: StoryFn<CallControlPanelStoryProps> = (\n args: CallControlPanelStoryProps\n) => {\n const [currentStatus, setCurrentStatus] = useState<UserAvailabilityStatusOption['id']>(\n args.status || 'available'\n );\n const inStatusSince = useRef(Date.now());\n const [calls, setCalls] = useState<(CallProps | IncomingCallProps)[]>([]);\n\n const [contacts, setContacts] = useState(contactsList);\n const callsList = useRef(calls);\n callsList.current = calls;\n\n const [showInteractionTransfer, setShowInteractionTransfer] = useState(false);\n\n const onMuteToggle = (id: CallProps['id']) => {\n const thisCallIndex = callsList.current.findIndex(call => call.id === id);\n if (thisCallIndex < 0) return;\n const thisCall = callsList.current[thisCallIndex];\n callsList.current.splice(thisCallIndex, 1, {\n ...thisCall,\n muted: !(thisCall as CallProps).muted\n });\n setCalls([...callsList.current]);\n };\n\n const onMergeCall = (id: CallProps['id']) => {\n const thisCall = callsList.current.find(call => call.id === id) as CallProps;\n const activeCallIndex = callsList.current.findIndex(call => !(call as CallProps).onHoldSince);\n const currentCall = callsList.current[activeCallIndex] as CallProps;\n\n if (!thisCall || !activeCallIndex) return;\n callsList.current.splice(activeCallIndex, 1, {\n ...currentCall,\n participants: [...currentCall.participants, ...thisCall.participants],\n onHoldSince: undefined\n });\n setCalls([...callsList.current.filter(call => call.id !== id)]);\n };\n\n const onHandOffCall = (id: CallProps['id']) => {\n setCalls([\n ...callsList.current.filter(call => call.id !== id && (call as CallProps).onHoldSince)\n ]);\n };\n\n const onPauseToggle = (id: CallProps['id']) => {\n const thisCall = callsList.current.find(call => call.id === id);\n if (!thisCall) return;\n const wasPaused = !!(thisCall as CallProps).onHoldSince;\n callsList.current = callsList.current.map(call => {\n if (thisCall.id === call.id)\n return {\n ...call,\n onHoldSince: wasPaused ? undefined : Date.now(),\n onMergeCall: wasPaused ? onMergeCall : undefined,\n onHandOffCall: wasPaused ? onHandOffCall : undefined\n };\n return {\n ...call,\n onPauseToggle: wasPaused ? undefined : onPauseToggle,\n onMergeCall: wasPaused ? onMergeCall : undefined,\n onHandOffCall: wasPaused ? onHandOffCall : undefined\n };\n });\n setCalls([...callsList.current]);\n };\n\n const onEndCall = (id: CallProps['id']) => {\n setCalls(callsList.current.filter(item => item.id !== id));\n setCurrentStatus('available');\n };\n\n const onHangUp = (callId: CallProps['id'], participantId: CallParticipant['id']) => {\n const currentCallIndex = callsList.current.findIndex(call => call.id === callId);\n if (currentCallIndex < 0) return;\n const currentCall = callsList.current[currentCallIndex] as CallProps;\n callsList.current.splice(currentCallIndex, 1, {\n ...currentCall,\n participants: [\n ...currentCall.participants.filter(participant => participant.id !== participantId)\n ]\n });\n setCalls([...callsList.current]);\n };\n\n const onConferenceAction = (id: CallProps['id'], data: TransferData) => {\n const caller = contactsList.find(person => person.phoneNumber === data.phoneNumber);\n const conferenceCall: CallProps = {\n id: createUID(),\n startedAt: Date.now(),\n onMergeCall,\n transferOptions: transferReasons,\n interactionOptions,\n muted: false,\n onMuteToggle,\n onPauseToggle,\n onHandOffCall,\n onEndCall,\n participants: [\n {\n name: caller?.primary || '',\n info: caller?.secondary || '',\n id: caller?.primary || '',\n onHangUp\n }\n ]\n };\n\n const currentCall = callsList.current[0] as CallProps;\n callsList.current.splice(0, 1, {\n ...callsList.current[0],\n participants: [...currentCall.participants, ...conferenceCall.participants],\n onHoldSince: undefined\n });\n setCalls([...callsList.current.filter(call => call.id !== conferenceCall.id)]);\n };\n\n const onConsultAction = (id: CallProps['id'], data: TransferData) => {\n const caller = contactsList.find(person => person.phoneNumber === data.phoneNumber);\n const consultCall: CallProps = {\n id: createUID(),\n startedAt: Date.now(),\n transferOptions: transferReasons,\n muted: false,\n onMuteToggle,\n onPauseToggle,\n onMergeCall,\n onHandOffCall,\n onDTMFPress: action('onDTMFPress'),\n onTransferAction: (callId, transferData) => {\n action('onTransferAction')(callId, transferData);\n if (transferData.interaction) setShowInteractionTransfer(true);\n onEndCall(id);\n },\n onConsultAction,\n onConferenceAction,\n onEndCall,\n participants: [\n {\n name: caller?.primary || '',\n info: caller?.secondary || '',\n id: caller?.primary || '',\n onHangUp\n }\n ]\n };\n\n const updatedCalls: (CallProps | IncomingCallProps)[] = callsList.current.map(call => {\n return { ...call, onHoldSince: Date.now(), onMergeCall, onPauseToggle: undefined };\n });\n updatedCalls.push(consultCall);\n setCalls(updatedCalls);\n };\n\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n const caller = contactsList[0];\n const consultCall: CallProps = {\n id: createUID(),\n startedAt: Date.now(),\n transferOptions: transferReasons,\n muted: false,\n onMuteToggle,\n onPauseToggle,\n onMergeCall,\n onHandOffCall,\n onDTMFPress: action('onDTMFPress'),\n onTransferAction: (callId, transferData) => {\n action('onTransferAction')(callId, transferData);\n if (transferData.interaction) setShowInteractionTransfer(true);\n onEndCall(callId);\n },\n onConsultAction,\n onConferenceAction,\n onEndCall,\n participants: [\n {\n name: caller?.primary || '',\n info: caller?.secondary || '',\n id: caller?.primary || '',\n onHangUp\n }\n ]\n };\n\n const incomingCall: IncomingCallProps = {\n id: createUID(),\n onAcceptCall: () => {\n setCalls([consultCall]);\n },\n participant: {\n name: contactsList[0].primary,\n info: contactsList[0].secondary,\n id: contactsList[0].primary\n }\n };\n setCalls([incomingCall, ...callsList.current]);\n }, 4000);\n return () => clearTimeout(timeoutId);\n }, []);\n\n return (\n <CallControlPanel\n visible={args.visible ?? true}\n heading={args.heading}\n userStatus={\n args.showStatus\n ? {\n statusOptions: userStatusOptions,\n status: currentStatus,\n inStatusSince: inStatusSince.current,\n onChange: value => {\n setCurrentStatus(value);\n args.onStatusChange?.(\n userStatusOptions.find(s => s.id === value) ?? userStatusOptions[0]\n );\n }\n }\n : undefined\n }\n interactionTransfer={\n showInteractionTransfer\n ? {\n onCancel: () => setShowInteractionTransfer(false),\n onComplete: () => setShowInteractionTransfer(false)\n }\n : undefined\n }\n calls={calls}\n draggable={args.isDraggable}\n onAddCall={(phoneNumber: string) => {\n const call: CallProps = {\n id: createUID(),\n startedAt: Date.now(),\n slaConfig: [30, 50],\n onConsultAction,\n onConferenceAction,\n transferOptions: transferReasons,\n defaultTransfer: transferReasons[1].id,\n interactionOptions,\n onTransferAction: (id, data) => {\n action('onTransferAction')(id, data);\n if (data.interaction) setShowInteractionTransfer(true);\n onEndCall(id);\n },\n muted: false,\n onMuteToggle,\n onPauseToggle,\n onMergeCall,\n onDTMFPress: action('onDTMFPress'),\n onEndCall: () => onEndCall(call.id),\n participants: [\n {\n id: contactsList.find(person => person.phoneNumber === phoneNumber)?.primary || '',\n name:\n contactsList.find(person => person.phoneNumber === phoneNumber)?.primary ||\n 'Unknown',\n onHangUp\n }\n ]\n };\n\n setCalls([call]);\n setCurrentStatus('not_available');\n }}\n contactsList={contacts}\n onFavoriteToggle={(phoneNumber: string, favorite: boolean) => {\n const element = contacts.find(item => item.phoneNumber === phoneNumber);\n element!.favorite = !favorite;\n setContacts([...contacts]);\n }}\n />\n );\n};\n\nexport const ExternalCTIDemo: StoryFn<CallControlPanelStoryProps & { applyAppStyling: boolean }> = (\n args: CallControlPanelStoryProps & { applyAppStyling: boolean }\n) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [error, setError] = useState('');\n\n const { base, components } = useTheme();\n\n const styling: ExternalStyles | undefined = args.applyAppStyling\n ? {\n '--app-bg-color': base.palette['app-background'],\n '--header-border-color': base.palette['secondary-background'],\n '--text-color': base.palette['foreground-color'],\n '--msg-me-bg-color': base.palette.interactive,\n '--msg-me-text-color': tryCatch(() => readableColor(base.palette.interactive)),\n '--msg-you-bg-color': base.palette['primary-background'],\n '--msg-you-text-color': tryCatch(() => readableColor(base.palette['primary-background'])),\n '--msg-border-radius': '16px',\n '--button-text-color': tryCatch(() => readableColor(components.button.color)),\n '--button-bg-color': components.button.color,\n '--button-border-color': 'transparent',\n '--button-border-radius': `calc(${components.button['border-radius']} * ${base['border-radius']})`,\n '--button-hover-bg-color': tryCatch(() => lighten(0.1, components.button.color)),\n '--button-height': components.input.height,\n '--input-height': components.input.height,\n '--input-background-color': components.input['background-color'],\n '--input-text-color': base.palette['foreground-color'],\n '--input-border-radius': `calc(0.5 * ${base['border-radius']})`,\n '--input-focus-border-color': 'transparent',\n '--input-focus-box-shadow': components.button['focus-shadow'],\n '--footer-bg-color': base.palette['app-background']\n }\n : undefined;\n\n useEffect(() => {\n if (containerRef.current) {\n containerRef.current.innerHTML = `\n <iframe id='external-cti' srcdoc='${createExternalIframeContent(\n styling\n )}' width='100%' height='500px'></iframe>\n `;\n }\n }, [containerRef.current, styling]);\n\n return (\n <ExternalCTI\n heading={args.heading}\n draggable={args.isDraggable}\n visible={args.visible}\n ref={containerRef}\n attachInteractionProps={{\n onAddInteraction: ({ comments }, { close }) => {\n if (comments === 'error') {\n setError('The service is currently unavailable');\n } else {\n close();\n }\n },\n reasonOptions: transferReasons,\n defaultInteraction: interactionOptions.find(({ id }) => id === '23254324')?.id,\n interactionOptions,\n heading: 'Attach interaction to call',\n ...(error && {\n message: {\n variant: 'urgent',\n messages: [error]\n }\n })\n }}\n />\n );\n};\n\nExternalCTIDemo.args = {\n heading: 'External CTI',\n isDraggable: true,\n applyAppStyling: false\n};\n\nExternalCTIDemo.argTypes = {\n heading: { control: { type: 'text' } },\n isDraggable: { control: { type: 'boolean' } },\n applyAppStyling: { control: { type: 'boolean' } }\n};\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { StoryFn } from '@storybook/react';
|
|
2
|
-
import type { DialPadKeyboardProps } from '@pega/cosmos-react-cs';
|
|
3
|
-
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
4
|
-
export default _default;
|
|
5
|
-
interface DialPadDemoProps {
|
|
6
|
-
mode: DialPadKeyboardProps['mode'];
|
|
7
|
-
}
|
|
8
|
-
export declare const DialPadDemo: StoryFn<DialPadDemoProps>;
|
|
9
|
-
//# sourceMappingURL=DialPad.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialPad.stories.d.ts","sourceRoot":"","sources":["../../../src/cs/DialPad/DialPad.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAItD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;;AAElE,wBAGU;AAEV,UAAU,gBAAgB;IACxB,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,gBAAgB,CAajD,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { DialPad } from '@pega/cosmos-react-cs';
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Customer Service/DialPad',
|
|
7
|
-
component: DialPad
|
|
8
|
-
};
|
|
9
|
-
export const DialPadDemo = (args) => {
|
|
10
|
-
const [phoneNumber, setPhoneNumber] = useState('');
|
|
11
|
-
return (_jsx("div", { style: { maxWidth: '25rem' }, children: _jsx(DialPad, { value: phoneNumber, onCallClick: action('Call button clicked'), onChange: setPhoneNumber, mode: args.mode }) }));
|
|
12
|
-
};
|
|
13
|
-
DialPadDemo.args = {
|
|
14
|
-
mode: 'default'
|
|
15
|
-
};
|
|
16
|
-
DialPadDemo.argTypes = {
|
|
17
|
-
mode: { options: ['default', 'DTMF'], control: { type: 'inline-radio' } }
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=DialPad.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialPad.stories.js","sourceRoot":"","sources":["../../../src/cs/DialPad/DialPad.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,eAAe;IACb,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,OAAO;CACX,CAAC;AAMV,MAAM,CAAC,MAAM,WAAW,GAA8B,CAAC,IAAsB,EAAE,EAAE;IAC/E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEnD,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAC/B,KAAC,OAAO,IACN,KAAK,EAAE,WAAW,EAClB,WAAW,EAAE,MAAM,CAAC,qBAAqB,CAAC,EAC1C,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,IAAI,CAAC,IAAI,GACf,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG;IACjB,IAAI,EAAE,SAAS;CAChB,CAAC;AAEF,WAAW,CAAC,QAAQ,GAAG;IACrB,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;CAC1E,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport { useState } from 'react';\n\nimport { DialPad } from '@pega/cosmos-react-cs';\nimport type { DialPadKeyboardProps } from '@pega/cosmos-react-cs';\n\nexport default {\n title: 'Customer Service/DialPad',\n component: DialPad\n} as Meta;\n\ninterface DialPadDemoProps {\n mode: DialPadKeyboardProps['mode'];\n}\n\nexport const DialPadDemo: StoryFn<DialPadDemoProps> = (args: DialPadDemoProps) => {\n const [phoneNumber, setPhoneNumber] = useState('');\n\n return (\n <div style={{ maxWidth: '25rem' }}>\n <DialPad\n value={phoneNumber}\n onCallClick={action('Call button clicked')}\n onChange={setPhoneNumber}\n mode={args.mode}\n />\n </div>\n );\n};\n\nDialPadDemo.args = {\n mode: 'default'\n};\n\nDialPadDemo.argTypes = {\n mode: { options: ['default', 'DTMF'], control: { type: 'inline-radio' } }\n};\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const dialPadKeysMock: {
|
|
2
|
-
key: string;
|
|
3
|
-
charCode: number;
|
|
4
|
-
buttonIndex: number;
|
|
5
|
-
}[];
|
|
6
|
-
export declare const defaultDialPadKeysMock: {
|
|
7
|
-
key: string;
|
|
8
|
-
charCode: number;
|
|
9
|
-
buttonIndex: number;
|
|
10
|
-
}[];
|
|
11
|
-
//# sourceMappingURL=DialPadKeyboardData.mock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialPadKeyboardData.mock.d.ts","sourceRoot":"","sources":["../../../src/cs/DialPad/DialPadKeyboardData.mock.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;GAc3B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;GAGlC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export const dialPadKeysMock = [
|
|
2
|
-
{ key: '1', charCode: 49, buttonIndex: 0 },
|
|
3
|
-
{ key: '2', charCode: 50, buttonIndex: 1 },
|
|
4
|
-
{ key: '3', charCode: 51, buttonIndex: 2 },
|
|
5
|
-
{ key: '4', charCode: 52, buttonIndex: 3 },
|
|
6
|
-
{ key: '5', charCode: 53, buttonIndex: 4 },
|
|
7
|
-
{ key: '6', charCode: 54, buttonIndex: 5 },
|
|
8
|
-
{ key: '7', charCode: 55, buttonIndex: 6 },
|
|
9
|
-
{ key: '8', charCode: 56, buttonIndex: 7 },
|
|
10
|
-
{ key: '9', charCode: 57, buttonIndex: 8 },
|
|
11
|
-
{ key: '*', charCode: 42, buttonIndex: 9 },
|
|
12
|
-
{ key: '0', charCode: 48, buttonIndex: 10 },
|
|
13
|
-
{ key: '#', charCode: 35, buttonIndex: 11 },
|
|
14
|
-
{ key: '+', charCode: 43, buttonIndex: 10 }
|
|
15
|
-
];
|
|
16
|
-
export const defaultDialPadKeysMock = [
|
|
17
|
-
...dialPadKeysMock,
|
|
18
|
-
{ key: 'Backspace', charCode: 127, buttonIndex: 12 }
|
|
19
|
-
];
|
|
20
|
-
//# sourceMappingURL=DialPadKeyboardData.mock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DialPadKeyboardData.mock.js","sourceRoot":"","sources":["../../../src/cs/DialPad/DialPadKeyboardData.mock.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;IAC1C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;IAC3C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;IAC3C,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,eAAe;IAClB,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE;CACrD,CAAC","sourcesContent":["export const dialPadKeysMock = [\n { key: '1', charCode: 49, buttonIndex: 0 },\n { key: '2', charCode: 50, buttonIndex: 1 },\n { key: '3', charCode: 51, buttonIndex: 2 },\n { key: '4', charCode: 52, buttonIndex: 3 },\n { key: '5', charCode: 53, buttonIndex: 4 },\n { key: '6', charCode: 54, buttonIndex: 5 },\n { key: '7', charCode: 55, buttonIndex: 6 },\n { key: '8', charCode: 56, buttonIndex: 7 },\n { key: '9', charCode: 57, buttonIndex: 8 },\n { key: '*', charCode: 42, buttonIndex: 9 },\n { key: '0', charCode: 48, buttonIndex: 10 },\n { key: '#', charCode: 35, buttonIndex: 11 },\n { key: '+', charCode: 43, buttonIndex: 10 }\n];\n\nexport const defaultDialPadKeysMock = [\n ...dialPadKeysMock,\n { key: 'Backspace', charCode: 127, buttonIndex: 12 }\n];\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StoryFn } from '@storybook/react';
|
|
2
|
-
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
3
|
-
export default _default;
|
|
4
|
-
interface InteractionNotificationDemoProps {
|
|
5
|
-
icon: string;
|
|
6
|
-
secondaryText: string;
|
|
7
|
-
declineAvailable: boolean;
|
|
8
|
-
timerAvailable: boolean;
|
|
9
|
-
answerTimeout: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const InteractionNotificationDemo: StoryFn<InteractionNotificationDemoProps>;
|
|
12
|
-
//# sourceMappingURL=InteractionNotification.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionNotification.stories.d.ts","sourceRoot":"","sources":["../../../src/cs/InteractionNotification/InteractionNotification.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;;AAMtD,wBAGU;AAEV,UAAU,gCAAgC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC,gCAAgC,CA+CjF,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { InteractionNotification } from '@pega/cosmos-react-cs';
|
|
5
|
-
import { icons, useI18n, useToaster } from '@pega/cosmos-react-core';
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Customer Service/InteractionNotification',
|
|
8
|
-
component: InteractionNotification
|
|
9
|
-
};
|
|
10
|
-
export const InteractionNotificationDemo = (args) => {
|
|
11
|
-
const incomingNotificationTimeout = useRef(Date.now());
|
|
12
|
-
const { push } = useToaster();
|
|
13
|
-
const t = useI18n();
|
|
14
|
-
return (_jsx(InteractionNotification, { icon: args.icon, title: 'Incoming call', primaryText: 'John Brown', secondaryText: args.secondaryText, status: {
|
|
15
|
-
variant: 'success',
|
|
16
|
-
text: 'VERIFIED PLATINUM CUSTOMER'
|
|
17
|
-
}, fields: [
|
|
18
|
-
{
|
|
19
|
-
id: 'reason',
|
|
20
|
-
name: 'Reason for calling',
|
|
21
|
-
value: 'Billing question'
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'openCases',
|
|
25
|
-
name: 'Open cases',
|
|
26
|
-
value: '1'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'lastInteraction',
|
|
30
|
-
name: 'Last interaction',
|
|
31
|
-
value: new Date().toLocaleDateString()
|
|
32
|
-
}
|
|
33
|
-
], incomingNotificationTimeout: args.timerAvailable
|
|
34
|
-
? {
|
|
35
|
-
startTime: incomingNotificationTimeout.current,
|
|
36
|
-
answerTimeout: args.answerTimeout,
|
|
37
|
-
onTimerEnd: () => push({ content: t('interaction_time_expired') })
|
|
38
|
-
}
|
|
39
|
-
: undefined, onAccept: action('accept'), onDecline: args.declineAvailable ? action('decline') : undefined }));
|
|
40
|
-
};
|
|
41
|
-
InteractionNotificationDemo.args = {
|
|
42
|
-
icon: 'phone-in-solid',
|
|
43
|
-
secondaryText: '(123) 456-7890',
|
|
44
|
-
declineAvailable: true,
|
|
45
|
-
timerAvailable: true,
|
|
46
|
-
answerTimeout: 30
|
|
47
|
-
};
|
|
48
|
-
InteractionNotificationDemo.argTypes = {
|
|
49
|
-
icon: { options: icons, control: { type: 'select', icons: true } },
|
|
50
|
-
secondaryText: { options: { type: 'text' } },
|
|
51
|
-
declineAvailable: { options: { type: 'boolean' } },
|
|
52
|
-
timerAvailable: { options: { type: 'boolean' } },
|
|
53
|
-
answerTimeout: { options: { type: 'number' } }
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=InteractionNotification.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionNotification.stories.js","sourceRoot":"","sources":["../../../src/cs/InteractionNotification/InteractionNotification.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAe;IACb,KAAK,EAAE,0CAA0C;IACjD,SAAS,EAAE,uBAAuB;CAC3B,CAAC;AAUV,MAAM,CAAC,MAAM,2BAA2B,GAA8C,CACpF,IAAsC,EACtC,EAAE;IACF,MAAM,2BAA2B,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,CAAC;IAC9B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,OAAO,CACL,KAAC,uBAAuB,IACtB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAC,eAAe,EACrB,WAAW,EAAC,YAAY,EACxB,aAAa,EA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,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC5C,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAClD,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAChD,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CAC/C,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport type { Meta, StoryFn } from '@storybook/react';\nimport { useRef } from 'react';\n\nimport { InteractionNotification } from '@pega/cosmos-react-cs';\nimport { icons, useI18n, useToaster } from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Customer Service/InteractionNotification',\n component: InteractionNotification\n} as Meta;\n\ninterface InteractionNotificationDemoProps {\n icon: string;\n secondaryText: string;\n declineAvailable: boolean;\n timerAvailable: boolean;\n answerTimeout: number;\n}\n\nexport const InteractionNotificationDemo: StoryFn<InteractionNotificationDemoProps> = (\n args: InteractionNotificationDemoProps\n) => {\n const incomingNotificationTimeout = useRef(Date.now());\n const { push } = useToaster();\n const t = useI18n();\n\n return (\n <InteractionNotification\n icon={args.icon}\n title='Incoming call'\n primaryText='John Brown'\n secondaryText={args.secondaryText}\n status={{\n variant: 'success',\n text: 'VERIFIED PLATINUM CUSTOMER'\n }}\n fields={[\n {\n id: 'reason',\n name: 'Reason for calling',\n value: 'Billing question'\n },\n {\n id: 'openCases',\n name: 'Open cases',\n value: '1'\n },\n {\n id: 'lastInteraction',\n name: 'Last interaction',\n value: new Date().toLocaleDateString()\n }\n ]}\n incomingNotificationTimeout={\n args.timerAvailable\n ? {\n startTime: incomingNotificationTimeout.current,\n answerTimeout: args.answerTimeout,\n onTimerEnd: () => push({ content: t('interaction_time_expired') })\n }\n : undefined\n }\n onAccept={action('accept')}\n onDecline={args.declineAvailable ? action('decline') : undefined}\n />\n );\n};\n\nInteractionNotificationDemo.args = {\n icon: 'phone-in-solid',\n secondaryText: '(123) 456-7890',\n declineAvailable: true,\n timerAvailable: true,\n answerTimeout: 30\n};\n\nInteractionNotificationDemo.argTypes = {\n icon: { options: icons, control: { type: 'select', icons: true } },\n secondaryText: { options: { type: 'text' } },\n declineAvailable: { options: { type: 'boolean' } },\n timerAvailable: { options: { type: 'boolean' } },\n answerTimeout: { options: { type: 'number' } }\n};\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InteractionTimerProps } from '@pega/cosmos-react-cs';
|
|
2
|
-
export declare const formatDuration: (duration: number) => {
|
|
3
|
-
visual: string;
|
|
4
|
-
ariaLabel: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const InteractionTimerSLAMileStones: {
|
|
7
|
-
from: number;
|
|
8
|
-
to: number;
|
|
9
|
-
}[];
|
|
10
|
-
export declare const InteractionTimerStages: InteractionTimerProps['sla'][];
|
|
11
|
-
//# sourceMappingURL=InteractionTimer.mocks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionTimer.mocks.d.ts","sourceRoot":"","sources":["../../../src/cs/InteractionTimer/InteractionTimer.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,eAAO,MAAM,cAAc,aAAc,MAAM;;;CAY9C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;GAazC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,qBAAqB,CAAC,KAAK,CAAC,EAIhE,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const formatDuration = (duration) => {
|
|
2
|
-
const hours = Math.floor(duration / 3600);
|
|
3
|
-
const minutes = Math.floor((duration - hours * 3600) / 60);
|
|
4
|
-
const seconds = Math.floor(duration - hours * 3600 - minutes * 60);
|
|
5
|
-
return {
|
|
6
|
-
visual: `${hours > 0 ? `${hours}:` : ''}${hours > 0 && minutes < 10 ? `0${minutes}` : minutes}:${seconds < 10 ? '0' : ''}${seconds}`,
|
|
7
|
-
ariaLabel: `${hours > 0 ? `${hours} hours ` : ''}${minutes > 0 ? `${minutes} minutes ` : ''}${seconds > 0 ? `${seconds} seconds ` : ''}`
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export const InteractionTimerSLAMileStones = [
|
|
11
|
-
{
|
|
12
|
-
from: 0,
|
|
13
|
-
to: 60
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
from: 60,
|
|
17
|
-
to: 120
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
from: 120,
|
|
21
|
-
to: 180
|
|
22
|
-
}
|
|
23
|
-
];
|
|
24
|
-
export const InteractionTimerStages = [
|
|
25
|
-
'goal',
|
|
26
|
-
'deadline',
|
|
27
|
-
'past-deadline'
|
|
28
|
-
];
|
|
29
|
-
//# sourceMappingURL=InteractionTimer.mocks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionTimer.mocks.js","sourceRoot":"","sources":["../../../src/cs/InteractionTimer/InteractionTimer.mocks.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;IACnE,OAAO;QACL,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GACrC,KAAK,GAAG,CAAC,IAAI,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,OAC9C,IAAI,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE;QACvC,SAAS,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,WAAW,CAAC,CAAC,CAAC,EAAE,GACzF,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,WAAW,CAAC,CAAC,CAAC,EACxC,EAAE;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C;QACE,IAAI,EAAE,CAAC;QACP,EAAE,EAAE,EAAE;KACP;IACD;QACE,IAAI,EAAE,EAAE;QACR,EAAE,EAAE,GAAG;KACR;IACD;QACE,IAAI,EAAE,GAAG;QACT,EAAE,EAAE,GAAG;KACR;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAmC;IACpE,MAAM;IACN,UAAU;IACV,eAAe;CAChB,CAAC","sourcesContent":["import { InteractionTimerProps } from '@pega/cosmos-react-cs';\n\nexport const formatDuration = (duration: number) => {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor((duration - hours * 3600) / 60);\n const seconds = Math.floor(duration - hours * 3600 - minutes * 60);\n return {\n visual: `${hours > 0 ? `${hours}:` : ''}${\n hours > 0 && minutes < 10 ? `0${minutes}` : minutes\n }:${seconds < 10 ? '0' : ''}${seconds}`,\n ariaLabel: `${hours > 0 ? `${hours} hours ` : ''}${minutes > 0 ? `${minutes} minutes ` : ''}${\n seconds > 0 ? `${seconds} seconds ` : ''\n }`\n };\n};\n\nexport const InteractionTimerSLAMileStones = [\n {\n from: 0,\n to: 60\n },\n {\n from: 60,\n to: 120\n },\n {\n from: 120,\n to: 180\n }\n];\n\nexport const InteractionTimerStages: InteractionTimerProps['sla'][] = [\n 'goal',\n 'deadline',\n 'past-deadline'\n];\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { StoryFn } from '@storybook/react';
|
|
2
|
-
import type { InteractionTimerProps } from '@pega/cosmos-react-cs';
|
|
3
|
-
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
|
4
|
-
export default _default;
|
|
5
|
-
export interface InteractionTimerStoryProps extends InteractionTimerProps {
|
|
6
|
-
id?: string;
|
|
7
|
-
showTimer?: boolean;
|
|
8
|
-
interactionType?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const InteractionTimerDemo: StoryFn<InteractionTimerStoryProps>;
|
|
11
|
-
//# sourceMappingURL=InteractionTimer.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionTimer.stories.d.ts","sourceRoot":"","sources":["../../../src/cs/InteractionTimer/InteractionTimer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAItD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;;AASnE,wBAGU;AAEV,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,0BAA0B,CAsGpE,CAAC"}
|