@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,123 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer, useContext, useState } from 'react';
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
4
|
+
import { Form, Button, Flex, Input, ToasterContext, TextArea, Card, CardContent, registerIcon, menuHelpers, StyledRegion } from '@pega/cosmos-react-core';
|
|
5
|
+
import { ObjectSelect } from '@pega/cosmos-react-build';
|
|
6
|
+
import * as times from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';
|
|
7
|
+
import { StyledConfigurationContent } from './ObjectSelect.styles';
|
|
8
|
+
import { skeletonData, fieldReducer, initFields, ObjectSelectComp } from './ObjectSelect.mocks';
|
|
9
|
+
registerIcon(times);
|
|
10
|
+
export default {
|
|
11
|
+
title: 'Build/ObjectSelect',
|
|
12
|
+
component: ObjectSelect
|
|
13
|
+
};
|
|
14
|
+
export const ObjectSelectSkeleton = (args) => {
|
|
15
|
+
const [value, setValue] = useState(args.value);
|
|
16
|
+
return (_jsx(ObjectSelect, { ...args, items: skeletonData, value: value, onChange: id => {
|
|
17
|
+
const data = menuHelpers.getItem(skeletonData, id);
|
|
18
|
+
if (data) {
|
|
19
|
+
setValue({
|
|
20
|
+
id: data.id,
|
|
21
|
+
primary: data.primary,
|
|
22
|
+
href: data.href ?? '#',
|
|
23
|
+
meta: data.id !== '01-4' ? data.secondary?.join(' ') : ''
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
else
|
|
27
|
+
setValue(undefined);
|
|
28
|
+
}, configuration: {
|
|
29
|
+
label: 'Gear button label',
|
|
30
|
+
heading: 'Popover heading',
|
|
31
|
+
primaryAction: {
|
|
32
|
+
id: 'primaryAction',
|
|
33
|
+
text: 'Primary action text',
|
|
34
|
+
onClick: args.onSubmit
|
|
35
|
+
},
|
|
36
|
+
secondaryAction: {
|
|
37
|
+
id: 'secondaryAction',
|
|
38
|
+
text: 'Secondary action text',
|
|
39
|
+
onClick: args.onCancel
|
|
40
|
+
},
|
|
41
|
+
content: (_jsx(StyledConfigurationContent, { children: _jsx(StyledRegion, { style: { minHeight: '20vh' } }, void 0) }, void 0))
|
|
42
|
+
}, onPreview: args.onPreview }, void 0));
|
|
43
|
+
};
|
|
44
|
+
ObjectSelectSkeleton.args = {
|
|
45
|
+
label: 'Object select label',
|
|
46
|
+
labelHidden: false,
|
|
47
|
+
info: 'Object select info text',
|
|
48
|
+
placeholder: '',
|
|
49
|
+
status: undefined,
|
|
50
|
+
required: false,
|
|
51
|
+
disabled: false,
|
|
52
|
+
readOnly: false,
|
|
53
|
+
// eslint-disable-next-line demo-patterns/literal-args
|
|
54
|
+
onPreview: action('Clicked preview link'),
|
|
55
|
+
// eslint-disable-next-line demo-patterns/literal-args
|
|
56
|
+
onSubmit: action('Clicked submit button'),
|
|
57
|
+
// eslint-disable-next-line demo-patterns/literal-args
|
|
58
|
+
onCancel: action('Clicked cancel button')
|
|
59
|
+
};
|
|
60
|
+
ObjectSelectSkeleton.argTypes = {
|
|
61
|
+
label: { control: { type: 'text' } },
|
|
62
|
+
labelHidden: { control: { type: 'boolean' } },
|
|
63
|
+
info: { control: { type: 'text' } },
|
|
64
|
+
placeholder: { control: { type: 'text' } },
|
|
65
|
+
status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },
|
|
66
|
+
required: { control: { type: 'boolean' } },
|
|
67
|
+
disabled: { control: { type: 'boolean' } },
|
|
68
|
+
readOnly: { control: { type: 'boolean' } },
|
|
69
|
+
onPreview: { table: { disable: true } },
|
|
70
|
+
onSubmit: { table: { disable: true } },
|
|
71
|
+
onCancel: { table: { disable: true } }
|
|
72
|
+
};
|
|
73
|
+
export const ObjectSelectDemo = (args) => {
|
|
74
|
+
return _jsx(ObjectSelectComp, { ...args, popoverContent: args.popoverContent }, void 0);
|
|
75
|
+
};
|
|
76
|
+
ObjectSelectDemo.args = {
|
|
77
|
+
label: 'Data source',
|
|
78
|
+
labelHidden: false,
|
|
79
|
+
info: 'Select an appropriate data source',
|
|
80
|
+
placeholder: '',
|
|
81
|
+
status: undefined,
|
|
82
|
+
required: false,
|
|
83
|
+
disabled: false,
|
|
84
|
+
readOnly: false,
|
|
85
|
+
popoverContent: 'simple',
|
|
86
|
+
// eslint-disable-next-line demo-patterns/literal-args
|
|
87
|
+
onPreview: () => { },
|
|
88
|
+
// eslint-disable-next-line demo-patterns/literal-args
|
|
89
|
+
onSubmit: action('Clicked submit button'),
|
|
90
|
+
// eslint-disable-next-line demo-patterns/literal-args
|
|
91
|
+
onCancel: action('Clicked cancel button')
|
|
92
|
+
};
|
|
93
|
+
ObjectSelectDemo.argTypes = {
|
|
94
|
+
label: { control: { type: 'text' } },
|
|
95
|
+
labelHidden: { control: { type: 'boolean' } },
|
|
96
|
+
info: { control: { type: 'text' } },
|
|
97
|
+
placeholder: { control: { type: 'text' } },
|
|
98
|
+
status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },
|
|
99
|
+
required: { control: { type: 'boolean' } },
|
|
100
|
+
disabled: { control: { type: 'boolean' } },
|
|
101
|
+
readOnly: { control: { type: 'boolean' } },
|
|
102
|
+
popoverContent: { options: ['simple', 'advanced'], control: { type: 'radio' } },
|
|
103
|
+
onPreview: { table: { disable: true } },
|
|
104
|
+
onSubmit: { table: { disable: true } },
|
|
105
|
+
onCancel: { table: { disable: true } }
|
|
106
|
+
};
|
|
107
|
+
export const ObjectSelectDemoInForm = () => {
|
|
108
|
+
const [fields, setField] = useReducer(fieldReducer, undefined, initFields);
|
|
109
|
+
const { push } = useContext(ToasterContext);
|
|
110
|
+
const name = fields.find(field => field.name === 'name');
|
|
111
|
+
const description = fields.find(field => field.name === 'description');
|
|
112
|
+
if (!name || !description)
|
|
113
|
+
return null;
|
|
114
|
+
const canSubmit = fields.every(field => field.value && field.validator());
|
|
115
|
+
const actions = (_jsxs(_Fragment, { children: [_jsx(Button, { name: 'Cancel', variant: 'secondary', onClick: () => {
|
|
116
|
+
push({ content: 'Form cancelled!' });
|
|
117
|
+
}, children: "Cancel" }, void 0), _jsx(Button, { name: 'Submit', type: 'submit', variant: 'primary', disabled: !canSubmit, children: "Submit" }, void 0)] }, void 0));
|
|
118
|
+
return (_jsx(Card, { style: { margin: 'auto', maxWidth: '37.5rem' }, children: _jsx(CardContent, { children: _jsx(Form, { actions: actions, onSubmit: (e) => {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
push({ content: 'Form submitted!' });
|
|
121
|
+
}, heading: 'Configure Table', children: _jsxs(Flex, { container: { direction: 'column', gap: 2 }, item: { grow: 1 }, children: [_jsx(Input, { name: 'name', label: 'Table name', value: name.value, required: name.required, status: name.status, info: 'Enter a valid table name', onChange: (e) => setField({ ...e }), onBlur: (e) => setField({ ...e }), autoComplete: 'off' }, void 0), _jsx(TextArea, { name: 'description', required: description.required, label: 'Table description', status: description.status, info: description.info || description.help, onChange: (e) => setField({ ...e }), onBlur: (e) => setField({ ...e }) }, void 0), _jsx(ObjectSelectComp, { label: 'Data page', info: 'Select an appropriate data page', items: [], onChange: () => { } }, void 0), _jsx(ObjectSelectComp, { label: 'Visibility condition', info: 'Choose a when condition from list', items: [], onChange: () => { } }, void 0)] }, void 0) }, void 0) }, void 0) }, void 0));
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=ObjectSelect.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSelect.stories.js","sourceRoot":"","sources":["../../../src/build/ObjectSelect/ObjectSelect.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAa,UAAU,EAAE,UAAU,EAA2B,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,cAAc,EACd,QAAQ,EACR,IAA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angeEvent, FocusEvent, useState } from 'react';\nimport { action } from '@storybook/addon-actions';\n\nimport {\n Form,\n Button,\n Flex,\n Input,\n ToasterContext,\n TextArea,\n Card,\n CardContent,\n registerIcon,\n menuHelpers,\n StyledRegion\n} from '@pega/cosmos-react-core';\nimport { ObjectSelect, ObjectSelectProps } from '@pega/cosmos-react-build';\nimport * as times from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport { StyledConfigurationContent } from './ObjectSelect.styles';\nimport {\n skeletonData,\n fieldReducer,\n initFields,\n ObjectSelectStoryProps,\n ObjectSelectComp\n} from './ObjectSelect.mocks';\n\nregisterIcon(times);\n\nexport default {\n title: 'Build/ObjectSelect',\n component: ObjectSelect\n} as Meta;\n\nexport const ObjectSelectSkeleton: Story<ObjectSelectStoryProps> = (\n args: ObjectSelectStoryProps\n) => {\n const [value, setValue] = useState<ObjectSelectProps['value']>(args.value);\n\n return (\n <ObjectSelect\n {...args}\n items={skeletonData}\n value={value}\n onChange={id => {\n const data = menuHelpers.getItem(skeletonData, id);\n if (data) {\n setValue({\n id: data.id,\n primary: data.primary,\n href: data.href ?? '#',\n meta: data.id !== '01-4' ? data.secondary?.join(' ') : ''\n });\n } else setValue(undefined);\n }}\n configuration={{\n label: 'Gear button label',\n heading: 'Popover heading',\n primaryAction: {\n id: 'primaryAction',\n text: 'Primary action text',\n onClick: args.onSubmit\n },\n secondaryAction: {\n id: 'secondaryAction',\n text: 'Secondary action text',\n onClick: args.onCancel\n },\n content: (\n <StyledConfigurationContent>\n <StyledRegion style={{ minHeight: '20vh' }} />\n </StyledConfigurationContent>\n )\n }}\n onPreview={args.onPreview}\n />\n );\n};\n\nObjectSelectSkeleton.args = {\n label: 'Object select label',\n labelHidden: false,\n info: 'Object select info text',\n placeholder: '',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false,\n // eslint-disable-next-line demo-patterns/literal-args\n onPreview: action('Clicked preview link'),\n // eslint-disable-next-line demo-patterns/literal-args\n onSubmit: action('Clicked submit button'),\n // eslint-disable-next-line demo-patterns/literal-args\n onCancel: action('Clicked cancel button')\n};\n\nObjectSelectSkeleton.argTypes = {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n placeholder: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } },\n onPreview: { table: { disable: true } },\n onSubmit: { table: { disable: true } },\n onCancel: { table: { disable: true } }\n};\n\nexport const ObjectSelectDemo: Story<ObjectSelectStoryProps> = (args: ObjectSelectStoryProps) => {\n return <ObjectSelectComp {...args} popoverContent={args.popoverContent} />;\n};\n\nObjectSelectDemo.args = {\n label: 'Data source',\n labelHidden: false,\n info: 'Select an appropriate data source',\n placeholder: '',\n status: undefined,\n required: false,\n disabled: false,\n readOnly: false,\n popoverContent: 'simple',\n // eslint-disable-next-line demo-patterns/literal-args\n onPreview: () => {},\n // eslint-disable-next-line demo-patterns/literal-args\n onSubmit: action('Clicked submit button'),\n // eslint-disable-next-line demo-patterns/literal-args\n onCancel: action('Clicked cancel button')\n};\n\nObjectSelectDemo.argTypes = {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n placeholder: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } },\n popoverContent: { options: ['simple', 'advanced'], control: { type: 'radio' } },\n onPreview: { table: { disable: true } },\n onSubmit: { table: { disable: true } },\n onCancel: { table: { disable: true } }\n};\n\nexport const ObjectSelectDemoInForm = () => {\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 description = fields.find(field => field.name === 'description');\n\n if (!name || !description) 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 return (\n <Card style={{ margin: 'auto', maxWidth: '37.5rem' }}>\n <CardContent>\n <Form\n actions={actions}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n push({ content: 'Form submitted!' });\n }}\n heading='Configure Table'\n >\n <Flex container={{ direction: 'column', gap: 2 }} item={{ grow: 1 }}>\n <Input\n name='name'\n label='Table name'\n value={name.value}\n required={name.required}\n status={name.status}\n info='Enter a valid table name'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <TextArea\n name='description'\n required={description.required}\n label='Table description'\n status={description.status}\n info={description.info || description.help}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n />\n <ObjectSelectComp\n label='Data page'\n info='Select an appropriate data page'\n items={[]}\n onChange={() => {}}\n />\n <ObjectSelectComp\n label='Visibility condition'\n info='Choose a when condition from list'\n items={[]}\n onChange={() => {}}\n />\n </Flex>\n </Form>\n </CardContent>\n </Card>\n );\n};\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const StyledDrawerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledCodeBlock: import("styled-components").StyledComponent<"pre", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledConfigurationContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
//# sourceMappingURL=ObjectSelect.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSelect.styles.d.ts","sourceRoot":"","sources":["../../../src/build/ObjectSelect/ObjectSelect.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,yGAS9B,CAAC;AAIH,eAAO,MAAM,eAAe,yGAK1B,CAAC;AAIH,eAAO,MAAM,0BAA0B,yGAOrC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { defaultThemeProp, StyledRegion } from '@pega/cosmos-react-core';
|
|
3
|
+
export const StyledDrawerContent = styled.div(props => {
|
|
4
|
+
const { theme: { base } } = props;
|
|
5
|
+
return css `
|
|
6
|
+
height: 100%;
|
|
7
|
+
background-color: ${base.palette['primary-background']};
|
|
8
|
+
`;
|
|
9
|
+
});
|
|
10
|
+
StyledDrawerContent.defaultProps = defaultThemeProp;
|
|
11
|
+
export const StyledCodeBlock = styled.pre(({ theme }) => {
|
|
12
|
+
return css `
|
|
13
|
+
padding: ${theme.base.spacing};
|
|
14
|
+
margin-bottom: ${theme.base.spacing};
|
|
15
|
+
`;
|
|
16
|
+
});
|
|
17
|
+
StyledCodeBlock.defaultProps = defaultThemeProp;
|
|
18
|
+
export const StyledConfigurationContent = styled.div(({ theme }) => {
|
|
19
|
+
return css `
|
|
20
|
+
${StyledRegion} {
|
|
21
|
+
border: 0.0625rem dashed ${theme.base.palette['border-line']};
|
|
22
|
+
background-color: ${theme.base.palette['secondary-background']};
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
});
|
|
26
|
+
StyledConfigurationContent.defaultProps = defaultThemeProp;
|
|
27
|
+
//# sourceMappingURL=ObjectSelect.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectSelect.styles.js","sourceRoot":"","sources":["../../../src/build/ObjectSelect/ObjectSelect.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IACpD,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,EAChB,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,CAAA;;wBAEY,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;GACvD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,OAAO;qBACZ,KAAK,CAAC,IAAI,CAAC,OAAO;GACpC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjE,OAAO,GAAG,CAAA;MACN,YAAY;iCACe,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;0BACxC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;;GAEjE,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, StyledRegion } from '@pega/cosmos-react-core';\n\nexport const StyledDrawerContent = styled.div(props => {\n const {\n theme: { base }\n } = props;\n\n return css`\n height: 100%;\n background-color: ${base.palette['primary-background']};\n `;\n});\n\nStyledDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledCodeBlock = styled.pre(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n margin-bottom: ${theme.base.spacing};\n `;\n});\n\nStyledCodeBlock.defaultProps = defaultThemeProp;\n\nexport const StyledConfigurationContent = styled.div(({ theme }) => {\n return css`\n ${StyledRegion} {\n border: 0.0625rem dashed ${theme.base.palette['border-line']};\n background-color: ${theme.base.palette['secondary-background']};\n }\n `;\n});\n\nStyledConfigurationContent.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const appHeader: {
|
|
3
|
+
brand: {
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
utils: {
|
|
7
|
+
avatar: {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
search: {
|
|
11
|
+
placeholder: string;
|
|
12
|
+
};
|
|
13
|
+
branchName: string;
|
|
14
|
+
actions: {
|
|
15
|
+
primary: string;
|
|
16
|
+
id: string;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
links: {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
export declare const getOverviewCardData: () => {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
meta: (string | JSX.Element)[];
|
|
31
|
+
visual: {
|
|
32
|
+
icon: {
|
|
33
|
+
name: string;
|
|
34
|
+
bgColor: string;
|
|
35
|
+
};
|
|
36
|
+
image?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
image: {
|
|
39
|
+
src: string;
|
|
40
|
+
alt: string;
|
|
41
|
+
};
|
|
42
|
+
icon?: undefined;
|
|
43
|
+
};
|
|
44
|
+
}[];
|
|
45
|
+
//# sourceMappingURL=GalleryPage.mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryPage.mocks.d.ts","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.mocks.tsx"],"names":[],"mappings":";AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;CAkDrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;GA2B/B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createUID, range, Status } from '@pega/cosmos-react-core';
|
|
3
|
+
export const appHeader = {
|
|
4
|
+
brand: {
|
|
5
|
+
name: 'AppStudioX'
|
|
6
|
+
},
|
|
7
|
+
utils: {
|
|
8
|
+
avatar: { name: 'Alan' },
|
|
9
|
+
search: {
|
|
10
|
+
placeholder: 'Search anything, anywhere…'
|
|
11
|
+
},
|
|
12
|
+
branchName: 'test',
|
|
13
|
+
actions: [
|
|
14
|
+
{
|
|
15
|
+
primary: 'Switch branch',
|
|
16
|
+
id: 'switchbranch',
|
|
17
|
+
onClick: () => { }
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
primary: 'Create branch',
|
|
21
|
+
id: 'createbranch',
|
|
22
|
+
onClick: () => { }
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
links: [
|
|
27
|
+
{
|
|
28
|
+
id: '1',
|
|
29
|
+
name: 'Applications',
|
|
30
|
+
onClick: () => { }
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: '2',
|
|
34
|
+
name: 'Shared resources',
|
|
35
|
+
onClick: () => { }
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: '3',
|
|
39
|
+
name: 'Teams',
|
|
40
|
+
onClick: () => { }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: '4',
|
|
44
|
+
name: 'AI & Analytics',
|
|
45
|
+
onClick: () => { }
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: '5',
|
|
49
|
+
name: 'Deploy',
|
|
50
|
+
onClick: () => { }
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
export const getOverviewCardData = () => {
|
|
55
|
+
return range(1, 14).map(num => ({
|
|
56
|
+
id: createUID(),
|
|
57
|
+
title: num % 2 !== 0
|
|
58
|
+
? `Application ${num}`
|
|
59
|
+
: `Application ${num} with long name to simulate ellipsis`,
|
|
60
|
+
description: num % 2 !== 0
|
|
61
|
+
? `Description for application with id ${num}`
|
|
62
|
+
: `Long Description for application with id ${num} to simulate ellipsis in the application description in stories`,
|
|
63
|
+
meta: [_jsx(Status, { variant: 'success', children: "in production" }, void 0), '1.0.0'],
|
|
64
|
+
visual: num % 2 !== 0
|
|
65
|
+
? {
|
|
66
|
+
icon: {
|
|
67
|
+
name: 'phone-in-solid',
|
|
68
|
+
bgColor: '#0ac7c8'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
: {
|
|
72
|
+
image: {
|
|
73
|
+
src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',
|
|
74
|
+
alt: 'Image for the card summary'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=GalleryPage.mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryPage.mocks.js","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,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AAC,SAAS,sCAAuB,EAAE,OAAO,CAAC;QACjE,MAAM,EACJ,GAAG,GAAG,CAAC,KAAK,CAAC;YACX,CAAC,CAAC;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,gBAAgB;oBACtB,OAAO,EAAE,SAAS;iBACnB;aACF;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,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { createUID, range, Status } from '@pega/cosmos-react-core';
|
|
4
3
|
import { AppShell, GalleryPage } from '@pega/cosmos-react-build';
|
|
4
|
+
import { appHeader, getOverviewCardData } from './GalleryPage.mocks';
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Build/GalleryPage',
|
|
7
7
|
component: GalleryPage,
|
|
@@ -9,83 +9,7 @@ export default {
|
|
|
9
9
|
layout: 'fullscreen'
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
brand: {
|
|
14
|
-
name: 'AppStudioX'
|
|
15
|
-
},
|
|
16
|
-
utils: {
|
|
17
|
-
avatar: { name: 'Alan' },
|
|
18
|
-
search: {
|
|
19
|
-
placeholder: 'Search anything, anywhere…'
|
|
20
|
-
},
|
|
21
|
-
branchName: 'test',
|
|
22
|
-
actions: [
|
|
23
|
-
{
|
|
24
|
-
primary: 'Switch branch',
|
|
25
|
-
id: 'switchbranch',
|
|
26
|
-
onClick: () => { }
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
primary: 'Create branch',
|
|
30
|
-
id: 'createbranch',
|
|
31
|
-
onClick: () => { }
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
links: [
|
|
36
|
-
{
|
|
37
|
-
id: '1',
|
|
38
|
-
name: 'Applications',
|
|
39
|
-
onClick: () => { }
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: '2',
|
|
43
|
-
name: 'Shared resources',
|
|
44
|
-
onClick: () => { }
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: '3',
|
|
48
|
-
name: 'Teams',
|
|
49
|
-
onClick: () => { }
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: '4',
|
|
53
|
-
name: 'AI & Analytics',
|
|
54
|
-
onClick: () => { }
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: '5',
|
|
58
|
-
name: 'Deploy',
|
|
59
|
-
onClick: () => { }
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
};
|
|
63
|
-
const getOverviewCardData = () => {
|
|
64
|
-
return range(1, 14).map(num => ({
|
|
65
|
-
id: createUID(),
|
|
66
|
-
title: num % 2 !== 0
|
|
67
|
-
? `Application ${num}`
|
|
68
|
-
: `Application ${num} with long name to simulate ellipsis`,
|
|
69
|
-
description: num % 2 !== 0
|
|
70
|
-
? `Description for application with id ${num}`
|
|
71
|
-
: `Long Description for application with id ${num} to simulate ellipsis in the application description in stories`,
|
|
72
|
-
meta: [_jsx(Status, { variant: 'success', children: "in production" }, void 0), '1.0.0'],
|
|
73
|
-
visual: num % 2 !== 0
|
|
74
|
-
? {
|
|
75
|
-
icon: {
|
|
76
|
-
name: 'phone-in-solid',
|
|
77
|
-
bgColor: '#0ac7c8'
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
: {
|
|
81
|
-
image: {
|
|
82
|
-
src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',
|
|
83
|
-
alt: 'Image for the card summary'
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}));
|
|
87
|
-
};
|
|
88
|
-
const GalleryPageDemo = ({ args }) => (_jsx(GalleryPage, { heading: args.bannerHeading, description: args.bannerDescription, image: {
|
|
12
|
+
export const GalleryPageDemo = (args) => (_jsx(GalleryPage, { heading: args.bannerHeading, description: args.bannerDescription, image: {
|
|
89
13
|
src: 'https://www.pega.com/sites/default/files/styles/2560/public/media/images/2019-01/pega-logo_0.png',
|
|
90
14
|
alt: 'Image for the banner'
|
|
91
15
|
}, items: args.showEmptyState ? [] : getOverviewCardData(), emptyState: {
|
|
@@ -108,7 +32,7 @@ export const AppShellWithGalleryPage = (args) => {
|
|
|
108
32
|
bgColor: '#0ac7c8'
|
|
109
33
|
}
|
|
110
34
|
}
|
|
111
|
-
}, appHeader: appHeader, main: _jsx(GalleryPageDemo, { args
|
|
35
|
+
}, appHeader: appHeader, main: _jsx(GalleryPageDemo, { ...args }, void 0), hideNav: true }, void 0));
|
|
112
36
|
};
|
|
113
37
|
AppShellWithGalleryPage.args = {
|
|
114
38
|
bannerHeading: 'Applications',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryPage.stories.js","sourceRoot":"","sources":["../../../src/build/PageTemplates/GalleryPage.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryPage.stories.js","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,KAAC,WAAW,IACV,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,WAAW,EAAE,IAAI,CAAC,iBAAiB,EACnC,KAAK,EAAE;QACL,GAAG,EAAE,kGAAkG;QACvG,GAAG,EAAE,sBAAsB;KAC5B,EACD,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAmB,EAAE,EACvD,UAAU,EAAE;QACV,OAAO,EAAE,IAAI,CAAC,iBAAiB;QAC/B,WAAW,EAAE,IAAI,CAAC,qBAAqB;KACxC,EACD,MAAM,EAAE;QACN,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,MAAM,CAAC,gCAAgC,CAAC;KAClD,EACD,WAAW,EAAE,MAAM,CAAC,0BAA0B,CAAC,WAC/C,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAA2B,CAAC,IAAqB,EAAE,EAAE;IACvF,OAAO,CACL,KAAC,QAAQ,IACP,UAAU,EAAE;YACV,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,GAAG;YAClB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;SACtB,EACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,IAAI,EAAE,gBAAgB;oBACtB,OAAO,EAAE,SAAS;iBACnB;aACF;SACF,EACD,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,KAAC,eAAe,OAAK,IAAI,WAAI,EACnC,OAAO,iBACP,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,96 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer, useRef, useContext } from 'react';
|
|
3
|
+
import { Button, Flex, Form, Input, CheckboxGroup, RadioButtonGroup, RadioButton, Checkbox, Select, Option, TextArea, ToasterContext, Text } from '@pega/cosmos-react-core';
|
|
4
|
+
import { RichTextEditor } from '@pega/cosmos-react-rte';
|
|
5
|
+
import { FileInputDemo } from '../../core/File/FileInput.stories';
|
|
6
|
+
// Get initial field properties
|
|
7
|
+
export const initFields = () => {
|
|
8
|
+
const common = { value: undefined, status: undefined };
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
...common,
|
|
12
|
+
name: 'name',
|
|
13
|
+
required: true,
|
|
14
|
+
error: 'Please enter first and last name',
|
|
15
|
+
validator() {
|
|
16
|
+
if (!this.value)
|
|
17
|
+
return false;
|
|
18
|
+
return /^[a-z]+\s[a-z]+$/i.test(this.value);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
...common,
|
|
23
|
+
name: 'email',
|
|
24
|
+
required: true,
|
|
25
|
+
error: 'Enter a @pega.com address',
|
|
26
|
+
validator() {
|
|
27
|
+
if (!this.value)
|
|
28
|
+
return false;
|
|
29
|
+
return /^\S+@pega\.com$/.test(this.value);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
...common,
|
|
34
|
+
name: 'notes',
|
|
35
|
+
required: true,
|
|
36
|
+
help: 'See how fast you can type 20 characters go',
|
|
37
|
+
error: 'You need to tell us more than 20 characters',
|
|
38
|
+
validator() {
|
|
39
|
+
if (!this.value)
|
|
40
|
+
return false;
|
|
41
|
+
return this.value.length >= 20;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
};
|
|
46
|
+
// Handles setting of state for all fields
|
|
47
|
+
const fieldReducer = (fields, { target, type }) => {
|
|
48
|
+
return fields.map(field => {
|
|
49
|
+
if (field.name === target.name) {
|
|
50
|
+
field.value = target.value;
|
|
51
|
+
if (type === 'blur' || field.status === 'error') {
|
|
52
|
+
if ((field.required || field.value) && !field.validator()) {
|
|
53
|
+
field.status = 'error';
|
|
54
|
+
field.info = field.error;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
field.status = undefined;
|
|
58
|
+
field.info = field.help;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return field;
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export const OneColumnForm = () => {
|
|
66
|
+
const editorRef = useRef(null);
|
|
67
|
+
const [fields, setField] = useReducer(fieldReducer, undefined, initFields);
|
|
68
|
+
const { push } = useContext(ToasterContext);
|
|
69
|
+
const name = fields.find(field => field.name === 'name');
|
|
70
|
+
const email = fields.find(field => field.name === 'email');
|
|
71
|
+
const notes = fields.find(field => field.name === 'notes');
|
|
72
|
+
if (!name || !email || !notes)
|
|
73
|
+
return null;
|
|
74
|
+
const canSubmit = fields.every(field => field.value && field.validator());
|
|
75
|
+
const actions = (_jsxs(_Fragment, { children: [_jsx(Button, { name: 'Cancel', variant: 'secondary', onClick: () => {
|
|
76
|
+
push({ content: 'Form cancelled!' });
|
|
77
|
+
}, children: "Cancel" }, void 0), _jsx(Button, { name: 'Submit', type: 'submit', variant: 'primary', disabled: !canSubmit, children: "Submit" }, void 0)] }, void 0));
|
|
78
|
+
const onImageAdded = (image, id) => {
|
|
79
|
+
const src = URL.createObjectURL(image);
|
|
80
|
+
editorRef.current?.appendImage({ src, alt: image.name }, id);
|
|
81
|
+
};
|
|
82
|
+
return (_jsxs(Form, { actions: actions, onSubmit: (e) => {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
push({ content: 'Form submitted!' });
|
|
85
|
+
}, style: { maxWidth: '37.5rem' }, children: [_jsx(Text, { variant: 'h4', as: 'h4', children: "Demo Form" }, void 0), _jsxs(Flex, { container: { direction: 'column', gap: 2 }, item: { grow: 1 }, children: [_jsx(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' }, void 0), _jsx(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' }, void 0), _jsx(CheckboxGroup, { name: 'visited', label: 'Places you have worked', children: ['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (_jsx(Checkbox, { label: office, onChange: (e) => setField({ ...e }) }, office))) }, void 0), _jsx(RadioButtonGroup, { name: 'meetings', label: 'Do you enjoy early morning meetings?', children: ['Yes', "No...no I don't"].map(option => (_jsx(RadioButton, { label: option, onChange: (e) => setField({ ...e }) }, option))) }, void 0), _jsxs(Select, { label: 'What would you like to eat?', info: 'FYI: options are limited', children: [_jsx(Option, { children: "choose meal..." }, void 0), _jsx(Option, { children: "Pizza" }, void 0), _jsx(Option, { children: "Sandwich" }, void 0), _jsx(Option, { children: "Salad" }, void 0)] }, void 0), _jsx(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 }) }, void 0), _jsx(RichTextEditor, { label: 'Detailed meeting notes', info: 'The rich text editor can be used in forms, comments, and documents', toolbar: [
|
|
86
|
+
'inline-styling',
|
|
87
|
+
'headers',
|
|
88
|
+
'tables',
|
|
89
|
+
'links',
|
|
90
|
+
'images',
|
|
91
|
+
'lists',
|
|
92
|
+
'cut-copy-paste',
|
|
93
|
+
'indentation'
|
|
94
|
+
], onImageAdded: onImageAdded, ref: editorRef }, void 0), _jsx(FileInputDemo, {}, void 0)] }, void 0)] }, void 0));
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=PageTemplates.mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageTemplates.mocks.js","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;AAQlE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAY,EAAE;IACtC,M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C,EAAE,CAAC,CACxC,KAAC,WAAW,IAEV,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,IAF7D,MAAM,CAGX,CACH,CAAC,WACe,EAEnB,MAAC,MAAM,IAAC,KAAK,EAAC,6BAA6B,EAAC,IAAI,EAAC,0BAA0B,aACzE,KAAC,MAAM,yCAAwB,EAC/B,KAAC,MAAM,gCAAe,EACtB,KAAC,MAAM,mCAAkB,EACzB,KAAC,MAAM,gCAAe,YACf,EAET,KAAC,QAAQ,IACP,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAC,eAAe,EACrB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAC9B,QAAQ,EAAE,CAAC,CAAmC,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EACrE,MAAM,EAAE,CAAC,CAA+B,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,WAC/D,EACF,KAAC,cAAc,IACb,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,oEAAoE,EACzE,OAAO,EAAE;4BACP,gBAAgB;4BAChB,SAAS;4BACT,QAAQ;4BACR,OAAO;4BACP,QAAQ;4BACR,OAAO;4BACP,gBAAgB;4BAChB,aAAa;yBACd,EACD,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,SAAS,WACd,EAEF,KAAC,aAAa,aAAG,YACZ,YACF,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"]}
|