@pega/cosmos-react-demos 3.0.0-dev.3.0 → 3.0.0-dev.4.2
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/AppShell/AppShell.mocks.d.ts +17 -0
- package/jsx/build/AppShell/AppShell.mocks.d.ts.map +1 -1
- package/jsx/build/AppShell/AppShell.mocks.js +15 -0
- package/jsx/build/AppShell/AppShell.mocks.js.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts +2 -0
- package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.jsx +2 -17
- package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +4 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +18 -2
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx.map +1 -1
- package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
- package/jsx/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
- package/jsx/build/FlowModeller/{FlowModeller.mocks.js → FlowModeller.mocks.jsx} +71 -7
- package/jsx/build/FlowModeller/FlowModeller.mocks.jsx.map +1 -0
- package/jsx/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
- package/jsx/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
- package/jsx/build/FlowModeller/FlowModeller.stories.jsx +14 -100
- package/jsx/build/FlowModeller/FlowModeller.stories.jsx.map +1 -1
- package/jsx/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
- package/jsx/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
- package/jsx/build/FlowModeller/FlowModeller.styles.js +8 -0
- package/jsx/build/FlowModeller/FlowModeller.styles.js.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts +40 -0
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -0
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx +315 -0
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.jsx.map +1 -0
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts +9 -0
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -0
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +137 -0
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -0
- package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts +4 -0
- package/jsx/build/ObjectSelect/ObjectSelect.styles.d.ts.map +1 -0
- package/jsx/build/ObjectSelect/ObjectSelect.styles.js +27 -0
- package/jsx/build/ObjectSelect/ObjectSelect.styles.js.map +1 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.jsx +78 -0
- package/jsx/build/PageTemplates/GalleryPage.mocks.jsx.map +1 -0
- package/jsx/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
- package/jsx/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
- package/jsx/build/PageTemplates/GalleryPage.stories.jsx +3 -79
- package/jsx/build/PageTemplates/GalleryPage.stories.jsx.map +1 -1
- package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
- package/jsx/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
- package/jsx/build/PageTemplates/PageTemplates.mocks.jsx +129 -0
- package/jsx/build/PageTemplates/PageTemplates.mocks.jsx.map +1 -0
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx +4 -129
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/build/Workbench/Workbench.stories.d.ts.map +1 -1
- package/jsx/build/Workbench/Workbench.stories.jsx +3 -14
- package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx +59 -56
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.stories.jsx.map +1 -1
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
- package/jsx/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
- package/jsx/core/AppShell/AppShell.stories.d.ts +1 -0
- package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
- package/jsx/core/AppShell/AppShell.stories.jsx +3 -1
- package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/core/Button/Button.stories.jsx +6 -6
- package/jsx/core/Button/Button.stories.jsx.map +1 -1
- package/jsx/core/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
- package/jsx/core/ColorPicker/ColorPicker.stories.jsx +2 -10
- package/jsx/core/ColorPicker/ColorPicker.stories.jsx.map +1 -1
- package/jsx/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
- package/jsx/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
- package/jsx/core/ColorPicker/ColorPicker.styles.js +11 -0
- package/jsx/core/ColorPicker/ColorPicker.styles.js.map +1 -0
- package/jsx/core/Configuration/Configuration.mocks.d.ts +7 -0
- package/jsx/core/Configuration/Configuration.mocks.d.ts.map +1 -0
- package/jsx/core/Configuration/Configuration.mocks.jsx +9 -0
- package/jsx/core/Configuration/Configuration.mocks.jsx.map +1 -0
- package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
- package/jsx/core/Configuration/Configuration.stories.jsx +2 -18
- package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
- package/jsx/core/Configuration/Configuration.styles.d.ts +6 -0
- package/jsx/core/Configuration/Configuration.styles.d.ts.map +1 -0
- package/jsx/core/Configuration/Configuration.styles.js +12 -0
- package/jsx/core/Configuration/Configuration.styles.js.map +1 -0
- package/jsx/core/DateTime/DateTime.stories.d.ts.map +1 -1
- package/jsx/core/DateTime/DateTime.stories.jsx +1 -0
- package/jsx/core/DateTime/DateTime.stories.jsx.map +1 -1
- package/jsx/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
- package/jsx/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroup.stories.jsx +8 -4
- package/jsx/core/FieldGroup/FieldGroup.stories.jsx.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +70 -2
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts +9 -8
- package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +51 -88
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
- package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
- package/jsx/core/File/FileDisplay.stories.jsx +16 -38
- package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
- package/jsx/core/HTML/HTML.stories.d.ts +6 -0
- package/jsx/core/HTML/HTML.stories.d.ts.map +1 -0
- package/jsx/core/HTML/HTML.stories.jsx +13 -0
- package/jsx/core/HTML/HTML.stories.jsx.map +1 -0
- package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.stories.jsx +5 -27
- package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
- package/jsx/core/Icon/Icon.styles.d.ts +4 -0
- package/jsx/core/Icon/Icon.styles.d.ts.map +1 -0
- package/jsx/core/Icon/Icon.styles.js +25 -0
- package/jsx/core/Icon/Icon.styles.js.map +1 -0
- package/jsx/core/IconPicker/IconPicker.stories.jsx +1 -1
- package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
- package/jsx/core/Link/Link.stories.d.ts +1 -11
- package/jsx/core/Link/Link.stories.d.ts.map +1 -1
- package/jsx/core/Link/Link.stories.jsx.map +1 -1
- package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts +9 -0
- package/jsx/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -0
- package/jsx/core/ListToolbar/ListToolbar.mocks.jsx +71 -0
- package/jsx/core/ListToolbar/ListToolbar.mocks.jsx.map +1 -0
- package/jsx/core/ListToolbar/ListToolbar.stories.d.ts +7 -0
- package/jsx/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -0
- package/jsx/core/ListToolbar/ListToolbar.stories.jsx +87 -0
- package/jsx/core/ListToolbar/ListToolbar.stories.jsx.map +1 -0
- package/jsx/core/Number/Number.stories.d.ts.map +1 -1
- package/jsx/core/Number/Number.stories.jsx +2 -0
- package/jsx/core/Number/Number.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx +1 -11
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
- package/jsx/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.styles.js +9 -0
- package/jsx/core/PageTemplates/PageTemplates.styles.js.map +1 -1
- package/jsx/core/Tooltip/Tooltip.stories.d.ts +2 -5
- package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
- package/jsx/core/Tree/Tree.stories.d.ts.map +1 -1
- package/jsx/core/Tree/Tree.stories.jsx +2 -2
- package/jsx/core/Tree/Tree.stories.jsx.map +1 -1
- package/jsx/cs/Article/Article.stories.d.ts +2 -10
- package/jsx/cs/Article/Article.stories.d.ts.map +1 -1
- package/jsx/cs/Article/Article.stories.jsx.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.stories.d.ts +2 -11
- package/jsx/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
- package/jsx/cs/ArticleList/ArticleList.stories.jsx +2 -1
- package/jsx/cs/ArticleList/ArticleList.stories.jsx.map +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
- package/jsx/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +6 -33
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
- package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
- package/jsx/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
- package/jsx/cs/CSCaseView/{CSCaseView.mocks.js → CSCaseView.mocks.jsx} +30 -1
- package/jsx/cs/CSCaseView/CSCaseView.mocks.jsx.map +1 -0
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx +4 -4
- package/jsx/cs/CallControlPanel/CallControlPanel.stories.jsx.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +3 -3
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx +13 -5
- package/jsx/cs/InteractionNotification/InteractionNotification.stories.jsx.map +1 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx +6 -30
- package/jsx/cs/InteractionTimer/InteractionTimer.stories.jsx.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.js +7 -0
- package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts +6 -5
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.jsx +25 -29
- package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.styles.d.ts +3 -0
- package/jsx/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
- package/jsx/cs/TaskManager/TaskManager.styles.js +8 -0
- package/jsx/cs/TaskManager/TaskManager.styles.js.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.jsx +33 -0
- package/jsx/dnd/DragDropList/DragDropList.mocks.jsx.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
- package/jsx/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
- package/jsx/dnd/DragDropList/DragDropList.stories.jsx +14 -78
- package/jsx/dnd/DragDropList/DragDropList.stories.jsx.map +1 -1
- package/jsx/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
- package/jsx/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
- package/jsx/dnd/DragDropList/DragDropList.styles.js +32 -0
- package/jsx/dnd/DragDropList/DragDropList.styles.js.map +1 -0
- package/jsx/rte/Editor/Editor.mocks.d.ts +6 -0
- package/jsx/rte/Editor/Editor.mocks.d.ts.map +1 -0
- package/jsx/rte/Editor/Editor.mocks.jsx +20 -0
- package/jsx/rte/Editor/Editor.mocks.jsx.map +1 -0
- package/jsx/rte/Editor/Editor.stories.d.ts.map +1 -1
- package/jsx/rte/Editor/Editor.stories.jsx +2 -20
- package/jsx/rte/Editor/Editor.stories.jsx.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
- package/jsx/social/Chat/RepeatingView.mocks.d.ts +14 -0
- package/jsx/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
- package/jsx/social/Chat/RepeatingView.mocks.js +11 -0
- package/jsx/social/Chat/RepeatingView.mocks.js.map +1 -0
- package/jsx/social/Chat/RepeatingView.stories.d.ts +6 -17
- package/jsx/social/Chat/RepeatingView.stories.d.ts.map +1 -1
- package/jsx/social/Chat/RepeatingView.stories.jsx +16 -46
- package/jsx/social/Chat/RepeatingView.stories.jsx.map +1 -1
- package/jsx/social/Chat/RepeatingView.styles.d.ts +2 -0
- package/jsx/social/Chat/RepeatingView.styles.d.ts.map +1 -0
- package/jsx/social/Chat/RepeatingView.styles.js +22 -0
- package/jsx/social/Chat/RepeatingView.styles.js.map +1 -0
- package/jsx/social/Email/Email.mocks.d.ts +155 -2
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Email/Email.mocks.jsx +756 -0
- package/jsx/social/Email/Email.mocks.jsx.map +1 -0
- package/jsx/social/Email/Email.stories.d.ts +14 -14
- package/jsx/social/Email/Email.stories.d.ts.map +1 -1
- package/jsx/social/Email/Email.stories.jsx +115 -407
- package/jsx/social/Email/Email.stories.jsx.map +1 -1
- package/jsx/social/Email/Email.styles.d.ts +4 -0
- package/jsx/social/Email/Email.styles.d.ts.map +1 -0
- package/jsx/social/Email/Email.styles.js +14 -0
- package/jsx/social/Email/Email.styles.js.map +1 -0
- package/jsx/social/Feed/Feed.stories.d.ts.map +1 -1
- package/jsx/social/Feed/Feed.stories.jsx +23 -18
- package/jsx/social/Feed/Feed.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedPost.stories.d.ts.map +1 -1
- package/jsx/social/Feed/FeedPost.stories.jsx +30 -20
- package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedReply.stories.d.ts.map +1 -1
- package/jsx/social/Feed/FeedReply.stories.jsx +21 -16
- package/jsx/social/Feed/FeedReply.stories.jsx.map +1 -1
- package/jsx/work/CaseView/MobileCaseView.stories.d.ts +2 -7
- package/jsx/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
- package/jsx/work/CaseView/MobileCaseView.stories.jsx.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx +166 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.mocks.jsx.map +1 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx +2 -174
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.stories.jsx.map +1 -1
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
- package/jsx/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
- package/jsx/work/Timeline/Timeline.stories.d.ts +2 -0
- package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
- package/jsx/work/Timeline/Timeline.stories.jsx +28 -1
- package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
- package/lib/build/AppShell/AppShell.mocks.d.ts +17 -0
- package/lib/build/AppShell/AppShell.mocks.d.ts.map +1 -1
- package/lib/build/AppShell/AppShell.mocks.js +16 -0
- package/lib/build/AppShell/AppShell.mocks.js.map +1 -1
- package/lib/build/AppShell/AppShell.stories.d.ts +2 -0
- package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/lib/build/AppShell/AppShell.stories.js +3 -18
- package/lib/build/AppShell/AppShell.stories.js.map +1 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts +4 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.d.ts.map +1 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +18 -2
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.mocks.d.ts +19 -2
- package/lib/build/FlowModeller/FlowModeller.mocks.d.ts.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.mocks.js +58 -6
- package/lib/build/FlowModeller/FlowModeller.mocks.js.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.stories.d.ts +2 -7
- package/lib/build/FlowModeller/FlowModeller.stories.d.ts.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.stories.js +15 -90
- package/lib/build/FlowModeller/FlowModeller.stories.js.map +1 -1
- package/lib/build/FlowModeller/FlowModeller.styles.d.ts +2 -0
- package/lib/build/FlowModeller/FlowModeller.styles.d.ts.map +1 -0
- package/lib/build/FlowModeller/FlowModeller.styles.js +8 -0
- package/lib/build/FlowModeller/FlowModeller.styles.js.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +2 -5
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -1
- package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts +2 -4
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts +40 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js +272 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -0
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +9 -0
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -0
- package/lib/build/ObjectSelect/ObjectSelect.stories.js +123 -0
- package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -0
- package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts +4 -0
- package/lib/build/ObjectSelect/ObjectSelect.styles.d.ts.map +1 -0
- package/lib/build/ObjectSelect/ObjectSelect.styles.js +27 -0
- package/lib/build/ObjectSelect/ObjectSelect.styles.js.map +1 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.d.ts +45 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.d.ts.map +1 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.js +79 -0
- package/lib/build/PageTemplates/GalleryPage.mocks.js.map +1 -0
- package/lib/build/PageTemplates/GalleryPage.stories.d.ts +1 -0
- package/lib/build/PageTemplates/GalleryPage.stories.d.ts.map +1 -1
- package/lib/build/PageTemplates/GalleryPage.stories.js +3 -79
- package/lib/build/PageTemplates/GalleryPage.stories.js.map +1 -1
- package/lib/build/PageTemplates/PageTemplates.mocks.d.ts +11 -0
- package/lib/build/PageTemplates/PageTemplates.mocks.d.ts.map +1 -0
- package/lib/build/PageTemplates/PageTemplates.mocks.js +96 -0
- package/lib/build/PageTemplates/PageTemplates.mocks.js.map +1 -0
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts +1 -0
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/build/PageTemplates/PageTemplates.stories.js +5 -95
- package/lib/build/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/build/Workbench/Workbench.stories.d.ts.map +1 -1
- package/lib/build/Workbench/Workbench.stories.js +3 -14
- package/lib/build/Workbench/Workbench.stories.js.map +1 -1
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts +3 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.d.ts.map +1 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js +13 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.mocks.js.map +1 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts +16 -8
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.d.ts.map +1 -1
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js +56 -54
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.stories.js.map +1 -1
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts +5 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js +15 -0
- package/lib/condition-builder/ConditionBuilder/ConditionBuilder.styles.js.map +1 -0
- package/lib/core/AppShell/AppShell.stories.d.ts +1 -0
- package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
- package/lib/core/AppShell/AppShell.stories.js +3 -1
- package/lib/core/AppShell/AppShell.stories.js.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/ColorPicker/ColorPicker.stories.d.ts.map +1 -1
- package/lib/core/ColorPicker/ColorPicker.stories.js +2 -10
- package/lib/core/ColorPicker/ColorPicker.stories.js.map +1 -1
- package/lib/core/ColorPicker/ColorPicker.styles.d.ts +4 -0
- package/lib/core/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
- package/lib/core/ColorPicker/ColorPicker.styles.js +11 -0
- package/lib/core/ColorPicker/ColorPicker.styles.js.map +1 -0
- package/lib/core/Configuration/Configuration.mocks.d.ts +7 -0
- package/lib/core/Configuration/Configuration.mocks.d.ts.map +1 -0
- package/lib/core/Configuration/Configuration.mocks.js +6 -0
- package/lib/core/Configuration/Configuration.mocks.js.map +1 -0
- package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
- package/lib/core/Configuration/Configuration.stories.js +3 -15
- package/lib/core/Configuration/Configuration.stories.js.map +1 -1
- package/lib/core/Configuration/Configuration.styles.d.ts +6 -0
- package/lib/core/Configuration/Configuration.styles.d.ts.map +1 -0
- package/lib/core/Configuration/Configuration.styles.js +12 -0
- package/lib/core/Configuration/Configuration.styles.js.map +1 -0
- package/lib/core/DateTime/DateTime.stories.d.ts.map +1 -1
- package/lib/core/DateTime/DateTime.stories.js +2 -0
- package/lib/core/DateTime/DateTime.stories.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroup.stories.d.ts +2 -0
- package/lib/core/FieldGroup/FieldGroup.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroup.stories.js +7 -3
- package/lib/core/FieldGroup/FieldGroup.stories.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +4 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.js +47 -3
- package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.d.ts +9 -8
- package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.js +52 -65
- package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
- package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
- package/lib/core/File/FileDisplay.stories.js +17 -29
- package/lib/core/File/FileDisplay.stories.js.map +1 -1
- package/lib/core/HTML/HTML.stories.d.ts +6 -0
- package/lib/core/HTML/HTML.stories.d.ts.map +1 -0
- package/lib/core/HTML/HTML.stories.js +14 -0
- package/lib/core/HTML/HTML.stories.js.map +1 -0
- package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
- package/lib/core/Icon/Icon.stories.js +6 -29
- package/lib/core/Icon/Icon.stories.js.map +1 -1
- package/lib/core/Icon/Icon.styles.d.ts +4 -0
- package/lib/core/Icon/Icon.styles.d.ts.map +1 -0
- package/lib/core/Icon/Icon.styles.js +25 -0
- package/lib/core/Icon/Icon.styles.js.map +1 -0
- package/lib/core/IconPicker/IconPicker.stories.js +1 -1
- package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
- package/lib/core/Link/Link.stories.d.ts +1 -11
- package/lib/core/Link/Link.stories.d.ts.map +1 -1
- package/lib/core/Link/Link.stories.js.map +1 -1
- package/lib/core/ListToolbar/ListToolbar.mocks.d.ts +9 -0
- package/lib/core/ListToolbar/ListToolbar.mocks.d.ts.map +1 -0
- package/lib/core/ListToolbar/ListToolbar.mocks.js +50 -0
- package/lib/core/ListToolbar/ListToolbar.mocks.js.map +1 -0
- package/lib/core/ListToolbar/ListToolbar.stories.d.ts +7 -0
- package/lib/core/ListToolbar/ListToolbar.stories.d.ts.map +1 -0
- package/lib/core/ListToolbar/ListToolbar.stories.js +79 -0
- package/lib/core/ListToolbar/ListToolbar.stories.js.map +1 -0
- package/lib/core/Number/Number.stories.d.ts.map +1 -1
- package/lib/core/Number/Number.stories.js +2 -0
- package/lib/core/Number/Number.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js +1 -11
- package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.styles.d.ts +1 -0
- package/lib/core/PageTemplates/PageTemplates.styles.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.styles.js +9 -0
- package/lib/core/PageTemplates/PageTemplates.styles.js.map +1 -1
- package/lib/core/Tooltip/Tooltip.stories.d.ts +2 -5
- package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
- package/lib/core/Tree/Tree.stories.d.ts.map +1 -1
- package/lib/core/Tree/Tree.stories.js +2 -2
- package/lib/core/Tree/Tree.stories.js.map +1 -1
- package/lib/cs/Article/Article.stories.d.ts +2 -10
- package/lib/cs/Article/Article.stories.d.ts.map +1 -1
- package/lib/cs/Article/Article.stories.js.map +1 -1
- package/lib/cs/ArticleList/ArticleList.stories.d.ts +2 -11
- package/lib/cs/ArticleList/ArticleList.stories.d.ts.map +1 -1
- package/lib/cs/ArticleList/ArticleList.stories.js +2 -1
- package/lib/cs/ArticleList/ArticleList.stories.js.map +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.d.ts +2 -36
- package/lib/cs/CSCaseView/CSAppShell.stories.d.ts.map +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.js +6 -19
- package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
- package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts +9 -0
- package/lib/cs/CSCaseView/CSCaseView.mocks.d.ts.map +1 -1
- package/lib/cs/CSCaseView/CSCaseView.mocks.js +16 -0
- package/lib/cs/CSCaseView/CSCaseView.mocks.js.map +1 -1
- package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts +2 -2
- package/lib/cs/CallControlPanel/CallControlPanel.stories.d.ts.map +1 -1
- package/lib/cs/CallControlPanel/CallControlPanel.stories.js +4 -4
- package/lib/cs/CallControlPanel/CallControlPanel.stories.js.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts +2 -8
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +3 -3
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
- package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts +7 -6
- package/lib/cs/InteractionNotification/InteractionNotification.stories.d.ts.map +1 -1
- package/lib/cs/InteractionNotification/InteractionNotification.stories.js +13 -5
- package/lib/cs/InteractionNotification/InteractionNotification.stories.js.map +1 -1
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts +11 -0
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.d.ts.map +1 -0
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.js +29 -0
- package/lib/cs/InteractionTimer/InteractionTimer.mocks.js.map +1 -0
- package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts +2 -7
- package/lib/cs/InteractionTimer/InteractionTimer.stories.d.ts.map +1 -1
- package/lib/cs/InteractionTimer/InteractionTimer.stories.js +6 -30
- package/lib/cs/InteractionTimer/InteractionTimer.stories.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts +6 -0
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.js +7 -0
- package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.d.ts +6 -5
- package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.js +25 -29
- package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.styles.d.ts +3 -0
- package/lib/cs/TaskManager/TaskManager.styles.d.ts.map +1 -0
- package/lib/cs/TaskManager/TaskManager.styles.js +8 -0
- package/lib/cs/TaskManager/TaskManager.styles.js.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.d.ts +15 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.d.ts.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.js +32 -0
- package/lib/dnd/DragDropList/DragDropList.mocks.js.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.stories.d.ts +8 -9
- package/lib/dnd/DragDropList/DragDropList.stories.d.ts.map +1 -1
- package/lib/dnd/DragDropList/DragDropList.stories.js +14 -85
- package/lib/dnd/DragDropList/DragDropList.stories.js.map +1 -1
- package/lib/dnd/DragDropList/DragDropList.styles.d.ts +6 -0
- package/lib/dnd/DragDropList/DragDropList.styles.d.ts.map +1 -0
- package/lib/dnd/DragDropList/DragDropList.styles.js +32 -0
- package/lib/dnd/DragDropList/DragDropList.styles.js.map +1 -0
- package/lib/rte/Editor/Editor.mocks.d.ts +6 -0
- package/lib/rte/Editor/Editor.mocks.d.ts.map +1 -0
- package/lib/rte/Editor/Editor.mocks.js +23 -0
- package/lib/rte/Editor/Editor.mocks.js.map +1 -0
- package/lib/rte/Editor/Editor.stories.d.ts.map +1 -1
- package/lib/rte/Editor/Editor.stories.js +2 -22
- package/lib/rte/Editor/Editor.stories.js.map +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts +2 -3
- package/lib/rte/RichTextEditor/RichTextEditor.stories.d.ts.map +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
- package/lib/social/Chat/RepeatingView.mocks.d.ts +14 -0
- package/lib/social/Chat/RepeatingView.mocks.d.ts.map +1 -0
- package/lib/social/Chat/RepeatingView.mocks.js +11 -0
- package/lib/social/Chat/RepeatingView.mocks.js.map +1 -0
- package/lib/social/Chat/RepeatingView.stories.d.ts +6 -17
- package/lib/social/Chat/RepeatingView.stories.d.ts.map +1 -1
- package/lib/social/Chat/RepeatingView.stories.js +16 -46
- package/lib/social/Chat/RepeatingView.stories.js.map +1 -1
- package/lib/social/Chat/RepeatingView.styles.d.ts +2 -0
- package/lib/social/Chat/RepeatingView.styles.d.ts.map +1 -0
- package/lib/social/Chat/RepeatingView.styles.js +22 -0
- package/lib/social/Chat/RepeatingView.styles.js.map +1 -0
- package/lib/social/Email/Email.mocks.d.ts +155 -2
- package/lib/social/Email/Email.mocks.d.ts.map +1 -1
- package/lib/social/Email/Email.mocks.js +361 -0
- package/lib/social/Email/Email.mocks.js.map +1 -1
- package/lib/social/Email/Email.stories.d.ts +14 -14
- package/lib/social/Email/Email.stories.d.ts.map +1 -1
- package/lib/social/Email/Email.stories.js +117 -423
- package/lib/social/Email/Email.stories.js.map +1 -1
- package/lib/social/Email/Email.styles.d.ts +4 -0
- package/lib/social/Email/Email.styles.d.ts.map +1 -0
- package/lib/social/Email/Email.styles.js +14 -0
- package/lib/social/Email/Email.styles.js.map +1 -0
- package/lib/social/Feed/Feed.stories.d.ts.map +1 -1
- package/lib/social/Feed/Feed.stories.js +23 -18
- package/lib/social/Feed/Feed.stories.js.map +1 -1
- package/lib/social/Feed/FeedPost.stories.d.ts.map +1 -1
- package/lib/social/Feed/FeedPost.stories.js +30 -20
- package/lib/social/Feed/FeedPost.stories.js.map +1 -1
- package/lib/social/Feed/FeedReply.stories.d.ts.map +1 -1
- package/lib/social/Feed/FeedReply.stories.js +21 -16
- package/lib/social/Feed/FeedReply.stories.js.map +1 -1
- package/lib/work/CaseView/MobileCaseView.stories.d.ts +2 -7
- package/lib/work/CaseView/MobileCaseView.stories.d.ts.map +1 -1
- package/lib/work/CaseView/MobileCaseView.stories.js.map +1 -1
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts +45 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.d.ts.map +1 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js +165 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.mocks.js.map +1 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts +2 -6
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.d.ts.map +1 -1
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js +2 -172
- package/lib/work/ConfigurableLayout/ConfigurableLayout.stories.js.map +1 -1
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts +4 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.d.ts.map +1 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js +11 -0
- package/lib/work/ConfigurableLayout/ConfigurableLayout.styles.js.map +1 -0
- package/lib/work/Timeline/Timeline.stories.d.ts +2 -0
- package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
- package/lib/work/Timeline/Timeline.stories.js +22 -2
- package/lib/work/Timeline/Timeline.stories.js.map +1 -1
- package/package.json +16 -17
- package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
- package/jsx/cs/CSCaseView/CSCaseView.mocks.js.map +0 -1
- package/jsx/social/Email/Email.mocks.js +0 -395
- package/jsx/social/Email/Email.mocks.js.map +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createUID, range, Status } from '@pega/cosmos-react-core';
|
|
2
|
+
export const appHeader = {
|
|
3
|
+
brand: {
|
|
4
|
+
name: 'AppStudioX'
|
|
5
|
+
},
|
|
6
|
+
utils: {
|
|
7
|
+
avatar: { name: 'Alan' },
|
|
8
|
+
search: {
|
|
9
|
+
placeholder: 'Search anything, anywhere…'
|
|
10
|
+
},
|
|
11
|
+
branchName: 'test',
|
|
12
|
+
actions: [
|
|
13
|
+
{
|
|
14
|
+
primary: 'Switch branch',
|
|
15
|
+
id: 'switchbranch',
|
|
16
|
+
onClick: () => { }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
primary: 'Create branch',
|
|
20
|
+
id: 'createbranch',
|
|
21
|
+
onClick: () => { }
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
links: [
|
|
26
|
+
{
|
|
27
|
+
id: '1',
|
|
28
|
+
name: 'Applications',
|
|
29
|
+
onClick: () => { }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: '2',
|
|
33
|
+
name: 'Shared resources',
|
|
34
|
+
onClick: () => { }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: '3',
|
|
38
|
+
name: 'Teams',
|
|
39
|
+
onClick: () => { }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: '4',
|
|
43
|
+
name: 'AI & Analytics',
|
|
44
|
+
onClick: () => { }
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: '5',
|
|
48
|
+
name: 'Deploy',
|
|
49
|
+
onClick: () => { }
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
export const getOverviewCardData = () => {
|
|
54
|
+
return range(1, 14).map(num => ({
|
|
55
|
+
id: createUID(),
|
|
56
|
+
title: num % 2 !== 0
|
|
57
|
+
? `Application ${num}`
|
|
58
|
+
: `Application ${num} with long name to simulate ellipsis`,
|
|
59
|
+
description: num % 2 !== 0
|
|
60
|
+
? `Description for application with id ${num}`
|
|
61
|
+
: `Long Description for application with id ${num} to simulate ellipsis in the application description in stories`,
|
|
62
|
+
meta: [<Status variant='success'>in production</Status>, '1.0.0'],
|
|
63
|
+
visual: num % 2 !== 0
|
|
64
|
+
? {
|
|
65
|
+
icon: {
|
|
66
|
+
name: 'phone-in-solid',
|
|
67
|
+
bgColor: '#0ac7c8'
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
: {
|
|
71
|
+
image: {
|
|
72
|
+
src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',
|
|
73
|
+
alt: 'Image for the card summary'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=GalleryPage.mocks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryPage.mocks.jsx","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,YAAY;KACnB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACxB,MAAM,EAAE;YACN,WAAW,EAAE,4BAA4B;SAC1C;QACD,UAAU,EAAE,MAAM;QAClB,OAAO,EAAE;YACP;gBACE,OAAO,EAAE,eAAe;gBACxB,EAAE,EAAE,cAAc;gBAClB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;aAClB;YACD;gBACE,OAAO,EAAE,eAAe;gBACxB,EAAE,EAAE,cAAc;gBAClB,OAAO,EAAE,GAAG,EAAE,GA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ACF;YACH,CAAC,CAAC;gBACE,KAAK,EAAE;oBACL,GAAG,EAAE,kGAAkG;oBACvG,GAAG,EAAE,4BAA4B;iBAClC;aACF;KACR,CAAC,CAAC,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { createUID, range, Status } from '@pega/cosmos-react-core';\n\nexport const appHeader = {\n brand: {\n name: 'AppStudioX'\n },\n utils: {\n avatar: { name: 'Alan' },\n search: {\n placeholder: 'Search anything, anywhere…'\n },\n branchName: 'test',\n actions: [\n {\n primary: 'Switch branch',\n id: 'switchbranch',\n onClick: () => {}\n },\n {\n primary: 'Create branch',\n id: 'createbranch',\n onClick: () => {}\n }\n ]\n },\n links: [\n {\n id: '1',\n name: 'Applications',\n onClick: () => {}\n },\n {\n id: '2',\n name: 'Shared resources',\n onClick: () => {}\n },\n {\n id: '3',\n name: 'Teams',\n onClick: () => {}\n },\n {\n id: '4',\n name: 'AI & Analytics',\n onClick: () => {}\n },\n {\n id: '5',\n name: 'Deploy',\n onClick: () => {}\n }\n ]\n};\n\nexport const getOverviewCardData = () => {\n return range(1, 14).map(num => ({\n id: createUID(),\n title:\n num % 2 !== 0\n ? `Application ${num}`\n : `Application ${num} with long name to simulate ellipsis`,\n description:\n num % 2 !== 0\n ? `Description for application with id ${num}`\n : `Long Description for application with id ${num} to simulate ellipsis in the application description in stories`,\n meta: [<Status variant='success'>in production</Status>, '1.0.0'],\n visual:\n num % 2 !== 0\n ? {\n icon: {\n name: 'phone-in-solid',\n bgColor: '#0ac7c8'\n }\n }\n : {\n image: {\n src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',\n alt: 'Image for the card summary'\n }\n }\n }));\n};\n"]}
|
|
@@ -8,5 +8,6 @@ interface GalleryPageArgs {
|
|
|
8
8
|
emptyStateHeading: string;
|
|
9
9
|
emptyStateDescription: string;
|
|
10
10
|
}
|
|
11
|
+
export declare const GalleryPageDemo: Story<GalleryPageArgs>;
|
|
11
12
|
export declare const AppShellWithGalleryPage: Story<GalleryPageArgs>;
|
|
12
13
|
//# sourceMappingURL=GalleryPage.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryPage.stories.d.ts","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAO/C,wBAMU;AAEV,UAAU,eAAe;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"GalleryPage.stories.d.ts","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAO/C,wBAMU;AAEV,UAAU,eAAe;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,eAAe,CAmBlD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,eAAe,CAsB1D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { createUID, range, Status } from '@pega/cosmos-react-core';
|
|
3
2
|
import { AppShell, GalleryPage } from '@pega/cosmos-react-build';
|
|
3
|
+
import { appHeader, getOverviewCardData } from './GalleryPage.mocks';
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Build/GalleryPage',
|
|
6
6
|
component: GalleryPage,
|
|
@@ -8,83 +8,7 @@ export default {
|
|
|
8
8
|
layout: 'fullscreen'
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
const
|
|
12
|
-
brand: {
|
|
13
|
-
name: 'AppStudioX'
|
|
14
|
-
},
|
|
15
|
-
utils: {
|
|
16
|
-
avatar: { name: 'Alan' },
|
|
17
|
-
search: {
|
|
18
|
-
placeholder: 'Search anything, anywhere…'
|
|
19
|
-
},
|
|
20
|
-
branchName: 'test',
|
|
21
|
-
actions: [
|
|
22
|
-
{
|
|
23
|
-
primary: 'Switch branch',
|
|
24
|
-
id: 'switchbranch',
|
|
25
|
-
onClick: () => { }
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
primary: 'Create branch',
|
|
29
|
-
id: 'createbranch',
|
|
30
|
-
onClick: () => { }
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
links: [
|
|
35
|
-
{
|
|
36
|
-
id: '1',
|
|
37
|
-
name: 'Applications',
|
|
38
|
-
onClick: () => { }
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: '2',
|
|
42
|
-
name: 'Shared resources',
|
|
43
|
-
onClick: () => { }
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: '3',
|
|
47
|
-
name: 'Teams',
|
|
48
|
-
onClick: () => { }
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: '4',
|
|
52
|
-
name: 'AI & Analytics',
|
|
53
|
-
onClick: () => { }
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: '5',
|
|
57
|
-
name: 'Deploy',
|
|
58
|
-
onClick: () => { }
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
};
|
|
62
|
-
const getOverviewCardData = () => {
|
|
63
|
-
return range(1, 14).map(num => ({
|
|
64
|
-
id: createUID(),
|
|
65
|
-
title: num % 2 !== 0
|
|
66
|
-
? `Application ${num}`
|
|
67
|
-
: `Application ${num} with long name to simulate ellipsis`,
|
|
68
|
-
description: num % 2 !== 0
|
|
69
|
-
? `Description for application with id ${num}`
|
|
70
|
-
: `Long Description for application with id ${num} to simulate ellipsis in the application description in stories`,
|
|
71
|
-
meta: [<Status variant='success'>in production</Status>, '1.0.0'],
|
|
72
|
-
visual: num % 2 !== 0
|
|
73
|
-
? {
|
|
74
|
-
icon: {
|
|
75
|
-
name: 'phone-in-solid',
|
|
76
|
-
bgColor: '#0ac7c8'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
: {
|
|
80
|
-
image: {
|
|
81
|
-
src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',
|
|
82
|
-
alt: 'Image for the card summary'
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}));
|
|
86
|
-
};
|
|
87
|
-
const GalleryPageDemo = ({ args }) => (<GalleryPage heading={args.bannerHeading} description={args.bannerDescription} image={{
|
|
11
|
+
export const GalleryPageDemo = (args) => (<GalleryPage heading={args.bannerHeading} description={args.bannerDescription} image={{
|
|
88
12
|
src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',
|
|
89
13
|
alt: 'Image for the banner'
|
|
90
14
|
}} items={args.showEmptyState ? [] : getOverviewCardData()} emptyState={{
|
|
@@ -107,7 +31,7 @@ export const AppShellWithGalleryPage = (args) => {
|
|
|
107
31
|
bgColor: '#0ac7c8'
|
|
108
32
|
}
|
|
109
33
|
}
|
|
110
|
-
}} appHeader={appHeader} main={<GalleryPageDemo
|
|
34
|
+
}} appHeader={appHeader} main={<GalleryPageDemo {...args}/>} hideNav/>);
|
|
111
35
|
};
|
|
112
36
|
AppShellWithGalleryPage.args = {
|
|
113
37
|
bannerHeading: 'Applications',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryPage.stories.jsx","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryPage.stories.jsx","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAErE,eAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACM,CAAC;AAUV,MAAM,CAAC,MAAM,eAAe,GAA2B,CAAC,IAAqB,EAAE,EAAE,CAAC,CAChF,CAAC,WAAW,CACV,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAC5B,WAAW,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CACpC,KAAK,CAAC,CAAC;QACL,GAAG,EAAE,kGAAkG;QACvG,GAAG,EAAE,sBAAsB;KAC5B,CAAC,CACF,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC,CACxD,UAAU,CAAC,CAAC;QACV,OAAO,EAAE,IAAI,CAAC,iBAAiB;QAC/B,WAAW,EAAE,IAAI,CAAC,qBAAqB;KACxC,CAAC,CACF,MAAM,CAAC,CAAC;QACN,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,MAAM,CAAC,gCAAgC,CAAC;KAClD,CAAC,CACF,WAAW,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAChD,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAA2B,CAAC,IAAqB,EAAE,EAAE;IACvF,OAAO,CACL,CAAC,QAAQ,CACP,UAAU,CAAC,CAAC;YACV,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,GAAG;YAClB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;SACtB,CAAC,CACF,OAAO,CAAC,CAAC;YACP,IAAI,EAAE,SAAS;YACf,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,gBAAgB;oBACtB,OAAO,EAAE,SAAS;iBACnB;aACF;SACF,CAAC,CACF,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,EAAG,CAAC,CACpC,OAAO,EACP,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,uBAAuB,CAAC,IAAI,GAAG;IAC7B,aAAa,EAAE,cAAc;IAC7B,iBAAiB,EAAE,iCAAiC;IACpD,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,+BAA+B;IAClD,qBAAqB,EAAE,qEAAqE;CAC7F,CAAC;AAEF,uBAAuB,CAAC,QAAQ,GAAG;IACjC,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC5C,iBAAiB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAChD,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAChD,iBAAiB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAChD,qBAAqB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;CACrD,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { action } from '@storybook/addon-actions';\n\nimport { AppShell, GalleryPage } from '@pega/cosmos-react-build';\n\nimport { appHeader, getOverviewCardData } from './GalleryPage.mocks';\n\nexport default {\n title: 'Build/GalleryPage',\n component: GalleryPage,\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\ninterface GalleryPageArgs {\n bannerHeading: string;\n bannerDescription: string;\n showEmptyState: boolean;\n emptyStateHeading: string;\n emptyStateDescription: string;\n}\n\nexport const GalleryPageDemo: Story<GalleryPageArgs> = (args: GalleryPageArgs) => (\n <GalleryPage\n heading={args.bannerHeading}\n description={args.bannerDescription}\n image={{\n src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',\n alt: 'Image for the banner'\n }}\n items={args.showEmptyState ? [] : getOverviewCardData()}\n emptyState={{\n heading: args.emptyStateHeading,\n description: args.emptyStateDescription\n }}\n action={{\n text: 'New application',\n onClick: action('Clicked New application button')\n }}\n onItemClick={action('Clicked interactive card')}\n />\n);\n\nexport const AppShellWithGalleryPage: Story<GalleryPageArgs> = (args: GalleryPageArgs) => {\n return (\n <AppShell\n navigation={{\n nodes: [],\n currentNodeId: '1',\n onNodeClick: () => {}\n }}\n appInfo={{\n text: 'U+ Desk',\n visual: {\n icon: {\n name: 'phone-in-solid',\n bgColor: '#0ac7c8'\n }\n }\n }}\n appHeader={appHeader}\n main={<GalleryPageDemo {...args} />}\n hideNav\n />\n );\n};\n\nAppShellWithGalleryPage.args = {\n bannerHeading: 'Applications',\n bannerDescription: 'Edit or create new applications',\n showEmptyState: false,\n emptyStateHeading: 'Create your first application',\n emptyStateDescription: \"You're on your way to creating your first professional application.\"\n};\n\nAppShellWithGalleryPage.argTypes = {\n bannerHeading: { control: { type: 'text' } },\n bannerDescription: { control: { type: 'text' } },\n showEmptyState: { control: { type: 'boolean' } },\n emptyStateHeading: { control: { type: 'text' } },\n emptyStateDescription: { control: { type: 'text' } }\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormControlProps } from '@pega/cosmos-react-core';
|
|
3
|
+
interface Field extends FormControlProps {
|
|
4
|
+
help?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
validator: (this: Field) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const initFields: () => Field[];
|
|
9
|
+
export declare const OneColumnForm: () => JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=PageTemplates.mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplates.mocks.d.ts","sourceRoot":"","sources":["../../../src/build/PageTemplates/PageTemplates.mocks.tsx"],"names":[],"mappings":";AAEA,OAAO,EAcL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAKjC,UAAU,KAAM,SAAQ,gBAAgB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC;CACrC;AAGD,eAAO,MAAM,UAAU,QAAO,KAAK,EAmClC,CAAC;AA6BF,eAAO,MAAM,aAAa,0BAkIzB,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { useReducer, useRef, useContext } from 'react';
|
|
2
|
+
import { Button, Flex, Form, Input, CheckboxGroup, RadioButtonGroup, RadioButton, Checkbox, Select, Option, TextArea, ToasterContext, Text } from '@pega/cosmos-react-core';
|
|
3
|
+
import { RichTextEditor } from '@pega/cosmos-react-rte';
|
|
4
|
+
import { FileInputDemo } from '../../core/File/FileInput.stories';
|
|
5
|
+
export const initFields = () => {
|
|
6
|
+
const common = { value: undefined, status: undefined };
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
...common,
|
|
10
|
+
name: 'name',
|
|
11
|
+
required: true,
|
|
12
|
+
error: 'Please enter first and last name',
|
|
13
|
+
validator() {
|
|
14
|
+
if (!this.value)
|
|
15
|
+
return false;
|
|
16
|
+
return /^[a-z]+\s[a-z]+$/i.test(this.value);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
...common,
|
|
21
|
+
name: 'email',
|
|
22
|
+
required: true,
|
|
23
|
+
error: 'Enter a @pega.com address',
|
|
24
|
+
validator() {
|
|
25
|
+
if (!this.value)
|
|
26
|
+
return false;
|
|
27
|
+
return /^\S+@pega\.com$/.test(this.value);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
...common,
|
|
32
|
+
name: 'notes',
|
|
33
|
+
required: true,
|
|
34
|
+
help: 'See how fast you can type 20 characters go',
|
|
35
|
+
error: 'You need to tell us more than 20 characters',
|
|
36
|
+
validator() {
|
|
37
|
+
if (!this.value)
|
|
38
|
+
return false;
|
|
39
|
+
return this.value.length >= 20;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
const fieldReducer = (fields, { target, type }) => {
|
|
45
|
+
return fields.map(field => {
|
|
46
|
+
if (field.name === target.name) {
|
|
47
|
+
field.value = target.value;
|
|
48
|
+
if (type === 'blur' || field.status === 'error') {
|
|
49
|
+
if ((field.required || field.value) && !field.validator()) {
|
|
50
|
+
field.status = 'error';
|
|
51
|
+
field.info = field.error;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
field.status = undefined;
|
|
55
|
+
field.info = field.help;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return field;
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
export const OneColumnForm = () => {
|
|
63
|
+
const editorRef = useRef(null);
|
|
64
|
+
const [fields, setField] = useReducer(fieldReducer, undefined, initFields);
|
|
65
|
+
const { push } = useContext(ToasterContext);
|
|
66
|
+
const name = fields.find(field => field.name === 'name');
|
|
67
|
+
const email = fields.find(field => field.name === 'email');
|
|
68
|
+
const notes = fields.find(field => field.name === 'notes');
|
|
69
|
+
if (!name || !email || !notes)
|
|
70
|
+
return null;
|
|
71
|
+
const canSubmit = fields.every(field => field.value && field.validator());
|
|
72
|
+
const actions = (<>
|
|
73
|
+
<Button name='Cancel' variant='secondary' onClick={() => {
|
|
74
|
+
push({ content: 'Form cancelled!' });
|
|
75
|
+
}}>
|
|
76
|
+
Cancel
|
|
77
|
+
</Button>
|
|
78
|
+
<Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>
|
|
79
|
+
Submit
|
|
80
|
+
</Button>
|
|
81
|
+
</>);
|
|
82
|
+
const onImageAdded = (image, id) => {
|
|
83
|
+
const src = URL.createObjectURL(image);
|
|
84
|
+
editorRef.current?.appendImage({ src, alt: image.name }, id);
|
|
85
|
+
};
|
|
86
|
+
return (<Form actions={actions} onSubmit={(e) => {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
push({ content: 'Form submitted!' });
|
|
89
|
+
}} style={{ maxWidth: '37.5rem' }}>
|
|
90
|
+
<Text variant='h4' as='h4'>
|
|
91
|
+
Demo Form
|
|
92
|
+
</Text>
|
|
93
|
+
<Flex container={{ direction: 'column', gap: 2 }} item={{ grow: 1 }}>
|
|
94
|
+
<Input name='name' label='Name' value={name.value} required={name.required} status={name.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
|
|
95
|
+
|
|
96
|
+
<Input name='email' value={email.value} type='email' label='Email' required={email.required} status={email.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
|
|
97
|
+
|
|
98
|
+
<CheckboxGroup name='visited' label='Places you have worked'>
|
|
99
|
+
{['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (<Checkbox key={office} label={office} onChange={(e) => setField({ ...e })}/>))}
|
|
100
|
+
</CheckboxGroup>
|
|
101
|
+
|
|
102
|
+
<RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>
|
|
103
|
+
{['Yes', "No...no I don't"].map(option => (<RadioButton key={option} label={option} onChange={(e) => setField({ ...e })}/>))}
|
|
104
|
+
</RadioButtonGroup>
|
|
105
|
+
|
|
106
|
+
<Select label='What would you like to eat?' info='FYI: options are limited'>
|
|
107
|
+
<Option>choose meal...</Option>
|
|
108
|
+
<Option>Pizza</Option>
|
|
109
|
+
<Option>Sandwich</Option>
|
|
110
|
+
<Option>Salad</Option>
|
|
111
|
+
</Select>
|
|
112
|
+
|
|
113
|
+
<TextArea name='notes' required={notes.required} label='Meeting Notes' status={notes.status} info={notes.info || notes.help} onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })}/>
|
|
114
|
+
<RichTextEditor label='Detailed meeting notes' info='The rich text editor can be used in forms, comments, and documents' toolbar={[
|
|
115
|
+
'inline-styling',
|
|
116
|
+
'headers',
|
|
117
|
+
'tables',
|
|
118
|
+
'links',
|
|
119
|
+
'images',
|
|
120
|
+
'lists',
|
|
121
|
+
'cut-copy-paste',
|
|
122
|
+
'indentation'
|
|
123
|
+
]} onImageAdded={onImageAdded} ref={editorRef}/>
|
|
124
|
+
|
|
125
|
+
<FileInputDemo />
|
|
126
|
+
</Flex>
|
|
127
|
+
</Form>);
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=PageTemplates.mocks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplates.mocks.jsx","sourceRoot":"","sources":["../../../src/build/PageTemplates/PageTemplates.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE3F,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,cAAc,EACd,IAAI,EAEL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAuB,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AASlE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE;IACtC,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC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B,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAElE;QAAA,CAAC,cAAc,CACb,KAAK,CAAC,wBAAwB,CAC9B,IAAI,CAAC,oEAAoE,CACzE,OAAO,CAAC,CAAC;YACP,gBAAgB;YAChB,SAAS;YACT,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,OAAO;YACP,gBAAgB;YAChB,aAAa;SACd,CAAC,CACF,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,GAAG,CAAC,CAAC,SAAS,CAAC,EAGjB;;QAAA,CAAC,aAAa,CAAC,AAAD,EAChB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FormEvent, ChangeEvent, FocusEvent, useReducer, useRef, useContext } from 'react';\n\nimport {\n Button,\n Flex,\n Form,\n Input,\n CheckboxGroup,\n RadioButtonGroup,\n RadioButton,\n Checkbox,\n Select,\n Option,\n TextArea,\n ToasterContext,\n Text,\n FormControlProps\n} from '@pega/cosmos-react-core';\nimport { RichTextEditor, RichTextEditorState } from '@pega/cosmos-react-rte';\n\nimport { FileInputDemo } from '../../core/File/FileInput.stories';\n\ninterface Field extends FormControlProps {\n help?: string;\n error?: string;\n validator: (this: Field) => boolean;\n}\n\n// Get initial field properties\nexport const initFields = (): Field[] => {\n const common = { value: undefined, status: undefined };\n return [\n {\n ...common,\n name: 'name',\n required: true,\n error: 'Please enter first and last name',\n validator() {\n if (!this.value) return false;\n return /^[a-z]+\\s[a-z]+$/i.test(this.value);\n }\n },\n {\n ...common,\n name: 'email',\n required: true,\n error: 'Enter a @pega.com address',\n validator() {\n if (!this.value) return false;\n return /^\\S+@pega\\.com$/.test(this.value);\n }\n },\n {\n ...common,\n name: 'notes',\n required: true,\n help: 'See how fast you can type 20 characters go',\n error: 'You need to tell us more than 20 characters',\n validator() {\n if (!this.value) return false;\n return this.value.length >= 20;\n }\n }\n ];\n};\n\n// Handles setting of state for all fields\nconst fieldReducer = (\n fields: Field[],\n {\n target,\n type\n }:\n | ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n | FocusEvent<HTMLInputElement | HTMLTextAreaElement>\n) => {\n return fields.map(field => {\n if (field.name === target.name) {\n field.value = target.value;\n if (type === 'blur' || field.status === 'error') {\n if ((field.required || field.value) && !field.validator()) {\n field.status = 'error';\n field.info = field.error;\n } else {\n field.status = undefined;\n field.info = field.help;\n }\n }\n }\n return field;\n });\n};\n\nexport const OneColumnForm = () => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [fields, setField] = useReducer(fieldReducer, undefined, initFields);\n const { push } = useContext(ToasterContext);\n\n const name = fields.find(field => field.name === 'name');\n const email = fields.find(field => field.name === 'email');\n const notes = fields.find(field => field.name === 'notes');\n\n if (!name || !email || !notes) return null;\n\n const canSubmit = fields.every(field => field.value && field.validator());\n\n const actions = (\n <>\n <Button\n name='Cancel'\n variant='secondary'\n onClick={() => {\n push({ content: 'Form cancelled!' });\n }}\n >\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>\n Submit\n </Button>\n </>\n );\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n\n return (\n <Form\n actions={actions}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n push({ content: 'Form submitted!' });\n }}\n style={{ maxWidth: '37.5rem' }}\n >\n <Text variant='h4' as='h4'>\n Demo Form\n </Text>\n <Flex container={{ direction: 'column', gap: 2 }} item={{ grow: 1 }}>\n <Input\n name='name'\n label='Name'\n value={name.value}\n required={name.required}\n status={name.status}\n info='some help text here'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <Input\n name='email'\n value={email.value}\n type='email'\n label='Email'\n required={email.required}\n status={email.status}\n info='some help text here'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <CheckboxGroup name='visited' label='Places you have worked'>\n {['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (\n <Checkbox\n key={office}\n label={office}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n />\n ))}\n </CheckboxGroup>\n\n <RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>\n {['Yes', \"No...no I don't\"].map(option => (\n <RadioButton\n key={option}\n label={option}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n />\n ))}\n </RadioButtonGroup>\n\n <Select label='What would you like to eat?' info='FYI: options are limited'>\n <Option>choose meal...</Option>\n <Option>Pizza</Option>\n <Option>Sandwich</Option>\n <Option>Salad</Option>\n </Select>\n\n <TextArea\n name='notes'\n required={notes.required}\n label='Meeting Notes'\n status={notes.status}\n info={notes.info || notes.help}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n />\n <RichTextEditor\n label='Detailed meeting notes'\n info='The rich text editor can be used in forms, comments, and documents'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n ref={editorRef}\n />\n\n <FileInputDemo />\n </Flex>\n </Form>\n );\n};\n"]}
|
|
@@ -22,5 +22,6 @@ interface AppShellStory {
|
|
|
22
22
|
main: AppShellProps['main'];
|
|
23
23
|
hideNavigation?: boolean;
|
|
24
24
|
}
|
|
25
|
+
export declare const AppShellWithMenuNavigation: (args: AppShellStory) => JSX.Element;
|
|
25
26
|
export declare const PageTemplatesDemo: Story<PageTemplatesStoryProps & AppShellStory>;
|
|
26
27
|
//# sourceMappingURL=PageTemplates.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageTemplates.stories.d.ts","sourceRoot":"","sources":["../../../src/build/PageTemplates/PageTemplates.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"PageTemplates.stories.d.ts","sourceRoot":"","sources":["../../../src/build/PageTemplates/PageTemplates.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAiC,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,EAaL,WAAW,EACX,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAY,aAAa,EAA6B,MAAM,0BAA0B,CAAC;;AAa9F,wBAKU;AAEV,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,QAAQ,EACJ,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,aAAa,GACb,aAAa,GACb,aAAa,GACb,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,QAAQ,CAAC;IACb,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACrD;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,0BAA0B,SAAU,aAAa,gBAyI7D,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,uBAAuB,GAAG,aAAa,CAkL5E,CAAC"}
|
|
@@ -1,143 +1,18 @@
|
|
|
1
|
-
import { useState, useMemo,
|
|
1
|
+
import { useState, useMemo, useContext } from 'react';
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { Button, Banner, treeHelpers, StandardTree, Configuration, Modal, ModalManagerContext, BuildTheme, Flex,
|
|
4
|
-
import { RichTextEditor } from '@pega/cosmos-react-rte';
|
|
3
|
+
import { Button, Banner, treeHelpers, StandardTree, Configuration, Modal, ModalManagerContext, BuildTheme, Flex, Text, Actions } from '@pega/cosmos-react-core';
|
|
5
4
|
import { AppShell, TabbedPage, OneColumnPage } from '@pega/cosmos-react-build';
|
|
6
|
-
import { FileInputDemo } from '../../core/File/FileInput.stories';
|
|
7
5
|
import { TableDemo } from '../../core/Table/Table.stories';
|
|
8
6
|
import { WorkbenchDemo } from '../Workbench/Workbench.stories';
|
|
9
7
|
import { appExplorerMenuList, branchesMenuList, recordMenuList, treeList } from '../AppShell/AppShell.mocks';
|
|
8
|
+
import { OneColumnForm } from './PageTemplates.mocks';
|
|
10
9
|
export default {
|
|
11
10
|
title: 'Build/PageTemplates',
|
|
12
11
|
parameters: {
|
|
13
12
|
layout: 'fullscreen'
|
|
14
13
|
}
|
|
15
14
|
};
|
|
16
|
-
const
|
|
17
|
-
const common = { value: undefined, status: undefined };
|
|
18
|
-
return [
|
|
19
|
-
{
|
|
20
|
-
...common,
|
|
21
|
-
name: 'name',
|
|
22
|
-
required: true,
|
|
23
|
-
error: 'Please enter first and last name',
|
|
24
|
-
validator() {
|
|
25
|
-
if (!this.value)
|
|
26
|
-
return false;
|
|
27
|
-
return /^[a-z]+\s[a-z]+$/i.test(this.value);
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
...common,
|
|
32
|
-
name: 'email',
|
|
33
|
-
required: true,
|
|
34
|
-
error: 'Enter a @pega.com address',
|
|
35
|
-
validator() {
|
|
36
|
-
if (!this.value)
|
|
37
|
-
return false;
|
|
38
|
-
return /^\S+@pega\.com$/.test(this.value);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
...common,
|
|
43
|
-
name: 'notes',
|
|
44
|
-
required: true,
|
|
45
|
-
help: 'See how fast you can type 20 characters go',
|
|
46
|
-
error: 'You need to tell us more than 20 characters',
|
|
47
|
-
validator() {
|
|
48
|
-
if (!this.value)
|
|
49
|
-
return false;
|
|
50
|
-
return this.value.length >= 20;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
];
|
|
54
|
-
};
|
|
55
|
-
const fieldReducer = (fields, { target, type }) => {
|
|
56
|
-
return fields.map(field => {
|
|
57
|
-
if (field.name === target.name) {
|
|
58
|
-
field.value = target.value;
|
|
59
|
-
if (type === 'blur' || field.status === 'error') {
|
|
60
|
-
if ((field.required || field.value) && !field.validator()) {
|
|
61
|
-
field.status = 'error';
|
|
62
|
-
field.info = field.error;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
field.status = undefined;
|
|
66
|
-
field.info = field.help;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return field;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
const OneColumnForm = () => {
|
|
74
|
-
const editorRef = useRef(null);
|
|
75
|
-
const [fields, setField] = useReducer(fieldReducer, undefined, initFields);
|
|
76
|
-
const { push } = useContext(ToasterContext);
|
|
77
|
-
const name = fields.find(field => field.name === 'name');
|
|
78
|
-
const email = fields.find(field => field.name === 'email');
|
|
79
|
-
const notes = fields.find(field => field.name === 'notes');
|
|
80
|
-
if (!name || !email || !notes)
|
|
81
|
-
return null;
|
|
82
|
-
const canSubmit = fields.every(field => field.value && field.validator());
|
|
83
|
-
const actions = (<>
|
|
84
|
-
<Button name='Cancel' variant='secondary' onClick={() => {
|
|
85
|
-
push({ content: 'Form cancelled!' });
|
|
86
|
-
}}>
|
|
87
|
-
Cancel
|
|
88
|
-
</Button>
|
|
89
|
-
<Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>
|
|
90
|
-
Submit
|
|
91
|
-
</Button>
|
|
92
|
-
</>);
|
|
93
|
-
const onImageAdded = (image, id) => {
|
|
94
|
-
const src = URL.createObjectURL(image);
|
|
95
|
-
editorRef.current?.appendImage({ src, alt: image.name }, id);
|
|
96
|
-
};
|
|
97
|
-
return (<Form actions={actions} onSubmit={(e) => {
|
|
98
|
-
e.preventDefault();
|
|
99
|
-
push({ content: 'Form submitted!' });
|
|
100
|
-
}} style={{ maxWidth: '37.5rem' }}>
|
|
101
|
-
<Text variant='h4' as='h4'>
|
|
102
|
-
Demo Form
|
|
103
|
-
</Text>
|
|
104
|
-
<Flex container={{ direction: 'column', gap: 2 }} item={{ grow: 1 }}>
|
|
105
|
-
<Input name='name' label='Name' value={name.value} required={name.required} status={name.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
|
|
106
|
-
|
|
107
|
-
<Input name='email' value={email.value} type='email' label='Email' required={email.required} status={email.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
|
|
108
|
-
|
|
109
|
-
<CheckboxGroup name='visited' label='Places you have worked'>
|
|
110
|
-
{['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (<Checkbox key={office} label={office} onChange={(e) => setField({ ...e })}/>))}
|
|
111
|
-
</CheckboxGroup>
|
|
112
|
-
|
|
113
|
-
<RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>
|
|
114
|
-
{['Yes', "No...no I don't"].map(option => (<RadioButton key={option} label={option} onChange={(e) => setField({ ...e })}/>))}
|
|
115
|
-
</RadioButtonGroup>
|
|
116
|
-
|
|
117
|
-
<Select label='What would you like to eat?' info='FYI: options are limited'>
|
|
118
|
-
<Option>choose meal...</Option>
|
|
119
|
-
<Option>Pizza</Option>
|
|
120
|
-
<Option>Sandwich</Option>
|
|
121
|
-
<Option>Salad</Option>
|
|
122
|
-
</Select>
|
|
123
|
-
|
|
124
|
-
<TextArea name='notes' required={notes.required} label='Meeting Notes' status={notes.status} info={notes.info || notes.help} onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })}/>
|
|
125
|
-
<RichTextEditor label='Detailed meeting notes' info='The rich text editor can be used in forms, comments, and documents' toolbar={[
|
|
126
|
-
'inline-styling',
|
|
127
|
-
'headers',
|
|
128
|
-
'tables',
|
|
129
|
-
'links',
|
|
130
|
-
'images',
|
|
131
|
-
'lists',
|
|
132
|
-
'cut-copy-paste',
|
|
133
|
-
'indentation'
|
|
134
|
-
]} onImageAdded={onImageAdded} ref={editorRef}/>
|
|
135
|
-
|
|
136
|
-
<FileInputDemo />
|
|
137
|
-
</Flex>
|
|
138
|
-
</Form>);
|
|
139
|
-
};
|
|
140
|
-
const AppShellWithMenuNavigation = (args) => {
|
|
15
|
+
export const AppShellWithMenuNavigation = (args) => {
|
|
141
16
|
const [currentNodeId, setCurrentNodeId] = useState();
|
|
142
17
|
const [allNodes, setAllNodes] = useState(treeList);
|
|
143
18
|
const onNodeClick = (id) => {
|