@pega/cosmos-react-demos 3.0.0-dev.4.1 → 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.map +1 -1
- package/jsx/build/DynamicContentEditor/DynamicContentEditor.stories.jsx +2 -1
- 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 +24 -0
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
- 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 +2 -7
- package/jsx/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx +5 -180
- package/jsx/build/ObjectSelect/ObjectSelect.stories.jsx.map +1 -1
- 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 +1 -9
- 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/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/FieldGroupList.mocks.d.ts +4 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +69 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +2 -70
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
- package/jsx/core/HTML/HTML.stories.d.ts.map +1 -1
- package/jsx/core/HTML/HTML.stories.jsx +1 -1
- package/jsx/core/HTML/HTML.stories.jsx.map +1 -1
- 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/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.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 +1 -19
- 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 +97 -411
- 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/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.map +1 -1
- package/lib/build/DynamicContentEditor/DynamicContentEditor.stories.js +2 -1
- 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 +24 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.d.ts.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js +136 -0
- package/lib/build/ObjectSelect/ObjectSelect.mocks.js.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts +2 -7
- package/lib/build/ObjectSelect/ObjectSelect.stories.d.ts.map +1 -1
- package/lib/build/ObjectSelect/ObjectSelect.stories.js +12 -136
- package/lib/build/ObjectSelect/ObjectSelect.stories.js.map +1 -1
- 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 +1 -9
- 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/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/FieldGroupList.mocks.d.ts +4 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.js +46 -2
- package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.js +3 -47
- package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
- package/lib/core/HTML/HTML.stories.d.ts.map +1 -1
- package/lib/core/HTML/HTML.stories.js +1 -1
- package/lib/core/HTML/HTML.stories.js.map +1 -1
- 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/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.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 +1 -21
- 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 +99 -427
- 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/package.json +9 -10
- package/jsx/build/FlowModeller/FlowModeller.mocks.js.map +0 -1
- package/jsx/build/ObjectSelect/ObjectSelect.mocks.js +0 -136
- package/jsx/build/ObjectSelect/ObjectSelect.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
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
import { useRef, useState } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { boolean, select } from '@storybook/addon-knobs';
|
|
4
|
-
import { Card, CardContent, Text, Grid, Button, defaultThemeProp, Popover, useElement, useOuterEvent, Flex, useI18n } from '@pega/cosmos-react-core';
|
|
2
|
+
import { Card, CardContent, Text, Button, Popover, useElement, useOuterEvent, Flex, useI18n } from '@pega/cosmos-react-core';
|
|
5
3
|
import { ConditionBuilder, FieldCondition, AtomicCondition, getInitConditionForLhs, isValidCondition, formatCondition } from '@pega/cosmos-react-condition-builder';
|
|
6
4
|
import { demoFields, demoCondition, demoComparators, demoDateFunctions } from './props.mock';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`;
|
|
10
|
-
const StyledCodeBlock = styled.pre `
|
|
11
|
-
padding: ${props => props.theme.base.spacing};
|
|
12
|
-
margin-bottom: ${props => props.theme.base.spacing};
|
|
13
|
-
`;
|
|
14
|
-
StyledCodeBlock.defaultProps = defaultThemeProp;
|
|
15
|
-
const StyledList = styled.ul `
|
|
16
|
-
padding-left: calc(4 * ${props => props.theme.base.spacing});
|
|
17
|
-
`;
|
|
18
|
-
StyledList.defaultProps = defaultThemeProp;
|
|
5
|
+
import { StyledCodeBlock, StyledGrid, StyledList } from './ConditionBuilder.styles';
|
|
6
|
+
import { convertRhsTypes } from './ConditionBuilder.mocks';
|
|
19
7
|
export default {
|
|
20
8
|
title: 'Condition Builder/ConditionBuilder',
|
|
21
9
|
component: ConditionBuilder
|
|
22
10
|
};
|
|
23
|
-
export const DefaultBuilder = () => {
|
|
11
|
+
export const DefaultBuilder = (args) => {
|
|
24
12
|
const translate = useI18n();
|
|
25
13
|
const [condition, setCondition] = useState(() => {
|
|
26
14
|
const prevCondition = sessionStorage.getItem('CBDemoCondition');
|
|
@@ -32,10 +20,6 @@ export const DefaultBuilder = () => {
|
|
|
32
20
|
}
|
|
33
21
|
return demoCondition;
|
|
34
22
|
});
|
|
35
|
-
const validComparators = boolean('Limit Comparators', false) ? demoComparators : undefined;
|
|
36
|
-
const disallowNOT = boolean('Disallow NOT operator', false);
|
|
37
|
-
const renderInPopover = boolean('Render inside Popover', false);
|
|
38
|
-
const dateFunctions = boolean('Enable Date functions', true) ? demoDateFunctions : undefined;
|
|
39
23
|
const buttonRef = useRef(null);
|
|
40
24
|
const [isOpen, setIsOpen] = useState(false);
|
|
41
25
|
const [popoverEl, setPopoverEl] = useElement(null);
|
|
@@ -49,7 +33,7 @@ export const DefaultBuilder = () => {
|
|
|
49
33
|
if (e.key === 'Escape')
|
|
50
34
|
hidePopover();
|
|
51
35
|
};
|
|
52
|
-
const builderJsx = (<ConditionBuilder fields={demoFields} condition={condition} validComparators={validComparators} validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])} dateFunctions={dateFunctions} disallowNOT={disallowNOT} onConditionSubmit={(c) => {
|
|
36
|
+
const builderJsx = (<ConditionBuilder fields={demoFields} condition={condition} validComparators={args.validComparators ? demoComparators : undefined} validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])} dateFunctions={args.dateFunctions ? demoDateFunctions : undefined} disallowNOT={args.disallowNOT} onConditionSubmit={(c) => {
|
|
53
37
|
setCondition(c);
|
|
54
38
|
hidePopover();
|
|
55
39
|
sessionStorage.setItem('CBDemoCondition', JSON.stringify(c));
|
|
@@ -58,9 +42,9 @@ export const DefaultBuilder = () => {
|
|
|
58
42
|
cols: '1fr',
|
|
59
43
|
rowGap: 3
|
|
60
44
|
}}>
|
|
61
|
-
{!renderInPopover && builderJsx}
|
|
45
|
+
{!args.renderInPopover && builderJsx}
|
|
62
46
|
|
|
63
|
-
{renderInPopover && (<>
|
|
47
|
+
{args.renderInPopover && (<>
|
|
64
48
|
<Button ref={buttonRef} aria-haspopup aria-expanded={isOpen} onClick={() => setIsOpen(!isOpen)} onKeyDown={hideOnEscape}>
|
|
65
49
|
Open Condition builder
|
|
66
50
|
</Button>
|
|
@@ -85,12 +69,21 @@ export const DefaultBuilder = () => {
|
|
|
85
69
|
</div>
|
|
86
70
|
</StyledGrid>);
|
|
87
71
|
};
|
|
88
|
-
|
|
72
|
+
DefaultBuilder.args = {
|
|
73
|
+
validComparators: false,
|
|
74
|
+
disallowNOT: false,
|
|
75
|
+
renderInPopover: false,
|
|
76
|
+
dateFunctions: true
|
|
77
|
+
};
|
|
78
|
+
DefaultBuilder.argTypes = {
|
|
79
|
+
validComparators: { control: { type: 'boolean' } },
|
|
80
|
+
disallowNOT: { control: { type: 'boolean' } },
|
|
81
|
+
renderInPopover: { control: { type: 'boolean' } },
|
|
82
|
+
dateFunctions: { control: { type: 'boolean' } }
|
|
83
|
+
};
|
|
84
|
+
export const FieldConditionDemo = (args) => {
|
|
89
85
|
const translate = useI18n();
|
|
90
86
|
const [condition, setCondition] = useState(undefined);
|
|
91
|
-
const validComparators = boolean('Limit Comparators', false) ? demoComparators : undefined;
|
|
92
|
-
const renderInPopover = boolean('Render inside Popover', false);
|
|
93
|
-
const dateFunctions = boolean('Enable Date functions', true) ? demoDateFunctions : undefined;
|
|
94
87
|
const buttonRef = useRef(null);
|
|
95
88
|
const [isOpen, setIsOpen] = useState(false);
|
|
96
89
|
const [popoverEl, setPopoverEl] = useElement(null);
|
|
@@ -104,7 +97,7 @@ export const FieldConditionDemo = () => {
|
|
|
104
97
|
if (e.key === 'Escape')
|
|
105
98
|
hidePopover();
|
|
106
99
|
};
|
|
107
|
-
const builderJsx = (<FieldCondition targetField='lastActivityAt' fields={demoFields} condition={condition} validComparators={validComparators} validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])} dateFunctions={dateFunctions} onSubmit={c => {
|
|
100
|
+
const builderJsx = (<FieldCondition targetField='lastActivityAt' fields={demoFields} condition={condition} validComparators={args.validComparators ? demoComparators : undefined} validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])} dateFunctions={args.dateFunctions ? demoDateFunctions : undefined} onSubmit={c => {
|
|
108
101
|
hidePopover();
|
|
109
102
|
setCondition(c);
|
|
110
103
|
}}/>);
|
|
@@ -114,9 +107,9 @@ export const FieldConditionDemo = () => {
|
|
|
114
107
|
alignItems: 'start',
|
|
115
108
|
colGap: 4
|
|
116
109
|
}}>
|
|
117
|
-
{!renderInPopover && builderJsx}
|
|
110
|
+
{!args.renderInPopover && builderJsx}
|
|
118
111
|
|
|
119
|
-
{renderInPopover && (<>
|
|
112
|
+
{args.renderInPopover && (<>
|
|
120
113
|
<Button ref={buttonRef} aria-haspopup aria-expanded={isOpen} onClick={() => setIsOpen(!isOpen)} onKeyDown={hideOnEscape}>
|
|
121
114
|
Open Condition builder
|
|
122
115
|
</Button>
|
|
@@ -139,29 +132,19 @@ export const FieldConditionDemo = () => {
|
|
|
139
132
|
</div>
|
|
140
133
|
</StyledGrid>);
|
|
141
134
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
setRhsTypes.add('RELATIVE_DATE');
|
|
152
|
-
return setRhsTypes;
|
|
135
|
+
FieldConditionDemo.args = {
|
|
136
|
+
validComparators: false,
|
|
137
|
+
renderInPopover: false,
|
|
138
|
+
dateFunctions: true
|
|
139
|
+
};
|
|
140
|
+
FieldConditionDemo.argTypes = {
|
|
141
|
+
validComparators: { control: { type: 'boolean' } },
|
|
142
|
+
renderInPopover: { control: { type: 'boolean' } },
|
|
143
|
+
dateFunctions: { control: { type: 'boolean' } }
|
|
153
144
|
};
|
|
154
|
-
export const AtomicConditionDemo = () => {
|
|
145
|
+
export const AtomicConditionDemo = (args) => {
|
|
155
146
|
const translate = useI18n();
|
|
156
|
-
const
|
|
157
|
-
const itemDirection = select('Item Direction', { Column: 'column', Row: 'row' }, 'column');
|
|
158
|
-
const validComparators = boolean('Limit Comparators', false) ? demoComparators : undefined;
|
|
159
|
-
const useLiteralRHSType = boolean('Enable Literal RHS Type', true);
|
|
160
|
-
const useFieldRHSType = boolean('Enable Field RHS Type', true);
|
|
161
|
-
const useRelativeDatesRHSType = boolean('Enable Relative Dates RHS Type', true);
|
|
162
|
-
const dateFunctions = boolean('Enable Date functions', true) ? demoDateFunctions : undefined;
|
|
163
|
-
const validRHSTypes = convertRhsTypes(useLiteralRHSType, useFieldRHSType, useRelativeDatesRHSType, dateFunctions);
|
|
164
|
-
const showLhsAsLabel = boolean('Show LHS as Label', false);
|
|
147
|
+
const validRHSTypes = convertRhsTypes(!!args.useLiteralRHSType, !!args.useFieldRHSType, !!args.useRelativeDatesRHSType, args.dateFunctions ? demoDateFunctions : undefined);
|
|
165
148
|
const [submitCondition, setSubmitCondition] = useState(undefined);
|
|
166
149
|
const buttonRef = useRef(null);
|
|
167
150
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -178,11 +161,11 @@ export const AtomicConditionDemo = () => {
|
|
|
178
161
|
};
|
|
179
162
|
const [showErrorIndicators, setShowErrorIndicators] = useState(false);
|
|
180
163
|
const [condition, setCondition] = useState(() => submitCondition ||
|
|
181
|
-
getInitConditionForLhs({ field: 'age' }, demoFields, validRHSTypes, validComparators, dateFunctions));
|
|
164
|
+
getInitConditionForLhs({ field: 'age' }, demoFields, validRHSTypes, args.validComparators ? demoComparators : undefined, args.dateFunctions ? demoDateFunctions : undefined));
|
|
182
165
|
const handleSubmission = () => {
|
|
183
166
|
setShowErrorIndicators(false);
|
|
184
167
|
if (isValidCondition(condition, demoFields, true)) {
|
|
185
|
-
if (renderInPopover)
|
|
168
|
+
if (args.renderInPopover)
|
|
186
169
|
setIsOpen(false);
|
|
187
170
|
setSubmitCondition(condition);
|
|
188
171
|
}
|
|
@@ -191,7 +174,7 @@ export const AtomicConditionDemo = () => {
|
|
|
191
174
|
}
|
|
192
175
|
};
|
|
193
176
|
const atomicConditionJSX = (<Flex container={{ direction: 'column', gap: 2 }}>
|
|
194
|
-
<AtomicCondition condition={condition} fields={demoFields} indicateErrors={showErrorIndicators} validComparators={validComparators} dateFunctions={dateFunctions} onChange={c => setCondition(c)} itemDirection={itemDirection} showLhsAsLabel={showLhsAsLabel} validRhsTypes={validRHSTypes}/>
|
|
177
|
+
<AtomicCondition condition={condition} fields={demoFields} indicateErrors={showErrorIndicators} validComparators={args.validComparators ? demoComparators : undefined} dateFunctions={args.dateFunctions ? demoDateFunctions : undefined} onChange={c => setCondition(c)} itemDirection={args.itemDirection} showLhsAsLabel={args.showLhsAsLabel} validRhsTypes={validRHSTypes}/>
|
|
195
178
|
<Button variant='primary' onClick={handleSubmission}>
|
|
196
179
|
Submit Condition
|
|
197
180
|
</Button>
|
|
@@ -202,9 +185,9 @@ export const AtomicConditionDemo = () => {
|
|
|
202
185
|
alignItems: 'start',
|
|
203
186
|
colGap: 4
|
|
204
187
|
}}>
|
|
205
|
-
{!renderInPopover && atomicConditionJSX}
|
|
188
|
+
{!args.renderInPopover && atomicConditionJSX}
|
|
206
189
|
|
|
207
|
-
{renderInPopover && (<>
|
|
190
|
+
{args.renderInPopover && (<>
|
|
208
191
|
<Button ref={buttonRef} aria-haspopup aria-expanded={isOpen} onClick={() => setIsOpen(!isOpen)} onKeyDown={hideOnEscape}>
|
|
209
192
|
{`${isOpen ? 'Close' : 'Open'} Atomic Condition`}
|
|
210
193
|
</Button>
|
|
@@ -260,4 +243,24 @@ export const AtomicConditionDemo = () => {
|
|
|
260
243
|
</Card>
|
|
261
244
|
</StyledGrid>);
|
|
262
245
|
};
|
|
246
|
+
AtomicConditionDemo.args = {
|
|
247
|
+
validComparators: false,
|
|
248
|
+
renderInPopover: false,
|
|
249
|
+
dateFunctions: true,
|
|
250
|
+
itemDirection: 'column',
|
|
251
|
+
useLiteralRHSType: true,
|
|
252
|
+
useFieldRHSType: true,
|
|
253
|
+
useRelativeDatesRHSType: true,
|
|
254
|
+
showLhsAsLabel: false
|
|
255
|
+
};
|
|
256
|
+
AtomicConditionDemo.argTypes = {
|
|
257
|
+
validComparators: { control: { type: 'boolean' } },
|
|
258
|
+
renderInPopover: { control: { type: 'boolean' } },
|
|
259
|
+
dateFunctions: { control: { type: 'boolean' } },
|
|
260
|
+
itemDirection: { options: ['column', 'row'], control: { type: 'select' } },
|
|
261
|
+
useLiteralRHSType: { control: { type: 'boolean' } },
|
|
262
|
+
useFieldRHSType: { control: { type: 'boolean' } },
|
|
263
|
+
useRelativeDatesRHSType: { control: { type: 'boolean' } },
|
|
264
|
+
showLhsAsLabel: { control: { type: 'boolean' } }
|
|
265
|
+
};
|
|
263
266
|
//# sourceMappingURL=ConditionBuilder.stories.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionBuilder.stories.jsx","sourceRoot":"","sources":["../../../src/condition-builder/ConditionBuilder/ConditionBuilder.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EACL,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,aAAa,EACb,IAAI,EACJ,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAIhB,eAAe,EAEhB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7F,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE9B,CAAC;AAEF,MAAM,eAAe,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,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CACvC;cAAA,CAAC,IAAI,CACH;;iEACiD,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAE;cAC3E,EAAE,IAAI,CACR;YAAA,EAAE,IAAI,CACR;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,WAAW,CACf;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/* eslint-disable react/no-unescaped-entities */\nimport { useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { boolean, select } from '@storybook/addon-knobs';\n\nimport {\n Card,\n CardContent,\n Text,\n Grid,\n Button,\n defaultThemeProp,\n Popover,\n useElement,\n useOuterEvent,\n Flex,\n useI18n\n} from '@pega/cosmos-react-core';\nimport {\n ConditionBuilder,\n FieldCondition,\n AtomicCondition,\n getInitConditionForLhs,\n isValidCondition,\n Condition,\n DateFunctionsByType,\n LeafCondition,\n formatCondition,\n RHSType\n} from '@pega/cosmos-react-condition-builder';\n\nimport { demoFields, demoCondition, demoComparators, demoDateFunctions } from './props.mock';\n\nconst StyledGrid = styled(Grid)`\n max-width: 60rem;\n`;\n\nconst StyledCodeBlock = styled.pre`\n padding: ${props => props.theme.base.spacing};\n margin-bottom: ${props => props.theme.base.spacing};\n`;\nStyledCodeBlock.defaultProps = defaultThemeProp;\n\nconst StyledList = styled.ul`\n padding-left: calc(4 * ${props => props.theme.base.spacing});\n`;\nStyledList.defaultProps = defaultThemeProp;\n\nexport default {\n title: 'Condition Builder/ConditionBuilder',\n component: ConditionBuilder\n};\n\nexport const DefaultBuilder = () => {\n const translate = useI18n();\n const [condition, setCondition] = useState<Condition | undefined>(() => {\n // If a previous condition exists on the session, use it\n const prevCondition = sessionStorage.getItem('CBDemoCondition');\n if (prevCondition !== null) {\n // If an empty condition was submitted previously, start with an empty one\n if (prevCondition === 'undefined') {\n return undefined;\n }\n return JSON.parse(prevCondition);\n }\n return demoCondition;\n });\n\n const validComparators = boolean('Limit Comparators', false) ? demoComparators : undefined;\n const disallowNOT = boolean('Disallow NOT operator', false);\n const renderInPopover = boolean('Render inside Popover', false);\n const dateFunctions = boolean('Enable Date functions', true) ? demoDateFunctions : undefined;\n\n // Set up content for rendering inside a Popover\n const buttonRef = useRef(null); // Ref for the opener button\n const [isOpen, setIsOpen] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const hidePopover = () => {\n if (isOpen) {\n setIsOpen(false);\n }\n };\n useOuterEvent('mousedown', [popoverEl, buttonRef.current], hidePopover); // Call the method on clicking outside these elements\n const hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed\n };\n\n const builderJsx = (\n <ConditionBuilder\n fields={demoFields}\n condition={condition}\n validComparators={validComparators}\n validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])}\n dateFunctions={dateFunctions}\n disallowNOT={disallowNOT}\n onConditionSubmit={(c: Condition | undefined) => {\n setCondition(c);\n hidePopover();\n sessionStorage.setItem('CBDemoCondition', JSON.stringify(c)); // Persist on sessionStorage for the next time\n }}\n />\n );\n\n return (\n <StyledGrid\n container={{\n cols: '1fr',\n rowGap: 3\n }}\n >\n {!renderInPopover && builderJsx}\n\n {renderInPopover && (\n <>\n <Button\n ref={buttonRef}\n aria-haspopup\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n onKeyDown={hideOnEscape}\n >\n Open Condition builder\n </Button>\n\n <Popover\n show={isOpen}\n ref={setPopoverEl}\n target={buttonRef.current}\n placement='bottom-start'\n >\n <Flex container={{ pad: 1 }}>{builderJsx}</Flex>\n </Popover>\n </>\n )}\n\n <div>\n <Text variant='h4'>Output:</Text>\n <StyledCodeBlock>\n {condition ? JSON.stringify(condition, null, 2) : '(No condition)'}\n </StyledCodeBlock>\n </div>\n\n <div>\n <Text variant='h4'>Formatted Output:</Text>\n <StyledCodeBlock>\n {condition ? formatCondition(condition, demoFields, translate) : '(No condition)'}\n </StyledCodeBlock>\n </div>\n </StyledGrid>\n );\n};\n\nexport const FieldConditionDemo = () => {\n const translate = useI18n();\n const [condition, setCondition] = useState<LeafCondition | undefined>(undefined);\n\n const validComparators = boolean('Limit Comparators', false) ? demoComparators : undefined;\n const renderInPopover = boolean('Render inside Popover', false);\n const dateFunctions = boolean('Enable Date functions', true) ? demoDateFunctions : undefined;\n\n // Set up content for rendering inside a Popover\n const buttonRef = useRef(null); // Ref for the opener button\n const [isOpen, setIsOpen] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const hidePopover = () => {\n if (isOpen) {\n setIsOpen(false);\n }\n };\n useOuterEvent('mousedown', [popoverEl, buttonRef.current], hidePopover); // Call the method on clicking outside these elements\n const hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed\n };\n\n const builderJsx = (\n <FieldCondition\n targetField='lastActivityAt'\n fields={demoFields}\n condition={condition}\n validComparators={validComparators}\n validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])}\n dateFunctions={dateFunctions}\n onSubmit={c => {\n hidePopover();\n setCondition(c);\n }}\n />\n );\n\n return (\n <StyledGrid\n container={{\n cols: 'repeat(2, minmax(0, 1fr))',\n justifyItems: 'stretch',\n alignItems: 'start',\n colGap: 4\n }}\n >\n {!renderInPopover && builderJsx}\n\n {renderInPopover && (\n <>\n <Button\n ref={buttonRef}\n aria-haspopup\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n onKeyDown={hideOnEscape}\n >\n Open Condition builder\n </Button>\n\n <Popover\n show={isOpen}\n ref={setPopoverEl}\n target={buttonRef.current}\n placement='bottom-start'\n >\n <Flex container={{ pad: 1 }}>{builderJsx}</Flex>\n </Popover>\n </>\n )}\n\n <div>\n <Text variant='h4'>Output:</Text>\n <StyledCodeBlock>\n {condition ? JSON.stringify(condition, null, 2) : '(No condition)'}\n </StyledCodeBlock>\n\n <Text variant='h4'>Formatted Output:</Text>\n <StyledCodeBlock>\n {condition ? formatCondition({ condition }, demoFields, translate) : '(No condition)'}\n </StyledCodeBlock>\n </div>\n </StyledGrid>\n );\n};\n\nconst convertRhsTypes = (\n useLiteralRHSType: boolean,\n useFieldRHSType: boolean,\n useRelativeDatesType: boolean,\n dateFunctions?: DateFunctionsByType\n) => {\n const setRhsTypes: Set<RHSType> = new Set<RHSType>();\n if (useLiteralRHSType) setRhsTypes.add('LITERAL');\n if (useFieldRHSType) setRhsTypes.add('FIELD');\n if (dateFunctions) setRhsTypes.add('DATE_FUNCTION');\n if (useRelativeDatesType) setRhsTypes.add('RELATIVE_DATE');\n return setRhsTypes;\n};\n\nexport const AtomicConditionDemo = () => {\n const translate = useI18n();\n // Storybook knobs for configuration\n const renderInPopover = boolean('Render inside Popover', false);\n const itemDirection = select('Item Direction', { Column: 'column', Row: 'row' }, 'column');\n const validComparators = boolean('Limit Comparators', false) ? demoComparators : undefined;\n const useLiteralRHSType = boolean('Enable Literal RHS Type', true);\n const useFieldRHSType = boolean('Enable Field RHS Type', true);\n const useRelativeDatesRHSType = boolean('Enable Relative Dates RHS Type', true);\n const dateFunctions = boolean('Enable Date functions', true) ? demoDateFunctions : undefined;\n const validRHSTypes: Set<RHSType> = convertRhsTypes(\n useLiteralRHSType,\n useFieldRHSType,\n useRelativeDatesRHSType,\n dateFunctions\n );\n const showLhsAsLabel = boolean('Show LHS as Label', false);\n\n // Story State object to simulate \"submitting\"\n const [submitCondition, setSubmitCondition] = useState<LeafCondition | undefined>(undefined);\n // State needed to use Popover in Story\n const buttonRef = useRef(null); // Ref for the opener button\n const [isOpen, setIsOpen] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const hidePopover = () => {\n if (isOpen) {\n setIsOpen(false);\n }\n };\n useOuterEvent('mousedown', [popoverEl, buttonRef.current], hidePopover); // Call the method on clicking outside these elements\n const hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed\n };\n\n // State handling needed to manage/use the AtomicCondition component\n const [showErrorIndicators, setShowErrorIndicators] = useState(false);\n const [condition, setCondition] = useState(\n // If editing use the seedCondition, otherwise, determine an initial condition based on the targetField\n () =>\n submitCondition ||\n getInitConditionForLhs(\n { field: 'age' },\n demoFields,\n validRHSTypes,\n validComparators,\n dateFunctions\n )\n );\n\n const handleSubmission = () => {\n setShowErrorIndicators(false);\n if (isValidCondition(condition, demoFields, true)) {\n // Insert all \"submit\" logic to use the valid condition that you've created.\n if (renderInPopover) setIsOpen(false);\n setSubmitCondition(condition);\n } else {\n setShowErrorIndicators(true);\n }\n };\n\n const atomicConditionJSX = (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <AtomicCondition\n condition={condition}\n fields={demoFields}\n indicateErrors={showErrorIndicators}\n validComparators={validComparators}\n dateFunctions={dateFunctions}\n onChange={c => setCondition(c)}\n itemDirection={itemDirection}\n showLhsAsLabel={showLhsAsLabel}\n validRhsTypes={validRHSTypes}\n />\n <Button variant='primary' onClick={handleSubmission}>\n Submit Condition\n </Button>\n </Flex>\n );\n\n return (\n <StyledGrid\n container={{\n cols: 'repeat(2, minmax(0, 1fr))',\n justifyItems: 'stretch',\n alignItems: 'start',\n colGap: 4\n }}\n >\n {!renderInPopover && atomicConditionJSX}\n\n {renderInPopover && (\n <>\n <Button\n ref={buttonRef}\n aria-haspopup\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n onKeyDown={hideOnEscape}\n >\n {`${isOpen ? 'Close' : 'Open'} Atomic Condition`}\n </Button>\n\n <Popover\n show={isOpen}\n ref={setPopoverEl}\n target={buttonRef.current}\n placement='bottom-start'\n >\n <Flex container={{ pad: 1 }}>{atomicConditionJSX}</Flex>\n </Popover>\n </>\n )}\n <Card>\n <CardContent>\n <Text variant='h4'>Output:</Text>\n <StyledCodeBlock>\n {submitCondition ? JSON.stringify(submitCondition, null, 2) : '(No condition)'}\n </StyledCodeBlock>\n\n <Text variant='h4'>Formatted Output:</Text>\n <StyledCodeBlock>\n {submitCondition\n ? formatCondition({ condition: submitCondition }, demoFields, translate)\n : '(No condition)'}\n </StyledCodeBlock>\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h2' status='error'>\n validRhsTypes Prop Warning\n </Text>\n <Text>\n There are LHS(Left Hand Side Field)/Comparator pairings that <u>require</u> specific\n RHS(Right Hand Side Value) types. Please be mindful of these incompatibilities when\n limiting RHS value types using this prop. We <b>do not</b> support limiting RHS\n field types to incompatible types and it will result in a validation error if you do\n so. The pairings referred to here are as follows:\n </Text>\n </Flex>\n <StyledList>\n <li>\n BOOLEAN LHS Fields coupled with \"EQ\" or \"NEQ\" comparators, will <u>always yield</u>{' '}\n a Field RHS\n </li>\n <li>\n Any LHS Fields coupled with \"IN\" or \"NOT_IN\" comparators, will <u>always yield</u> a\n Literal RHS (Comma separated list)\n </li>\n </StyledList>\n <Flex container={{ direction: 'column' }}>\n <Text>\n If you would like to limit RHS value types and avoid these incompatibilities, you\n will need to exclude these comparators using the <b>validComparators</b> prop.\n </Text>\n </Flex>\n </Flex>\n </CardContent>\n </Card>\n </StyledGrid>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ConditionBuilder.stories.jsx","sourceRoot":"","sources":["../../../src/condition-builder/ConditionBuilder/ConditionBuilder.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EACL,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,aAAa,EACb,IAAI,EACJ,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,sBAAsB,E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zB,gBAAgB,EAAE,KAAK;IACvB,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,QAAQ;IACvB,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,uBAAuB,EAAE,IAAI;IAC7B,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,gBAAgB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAClD,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACjD,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC/C,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC1E,iBAAiB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACnD,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACjD,uBAAuB,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACzD,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CACjD,CAAC","sourcesContent":["/* eslint-disable react/no-unescaped-entities */\nimport { useRef, useState } from 'react';\nimport { Meta, Story } from '@storybook/react';\n\nimport {\n Card,\n CardContent,\n Text,\n Button,\n Popover,\n useElement,\n useOuterEvent,\n Flex,\n useI18n\n} from '@pega/cosmos-react-core';\nimport {\n ConditionBuilder,\n FieldCondition,\n AtomicCondition,\n getInitConditionForLhs,\n isValidCondition,\n Condition,\n LeafCondition,\n formatCondition,\n RHSType\n} from '@pega/cosmos-react-condition-builder';\n\nimport { demoFields, demoCondition, demoComparators, demoDateFunctions } from './props.mock';\nimport { StyledCodeBlock, StyledGrid, StyledList } from './ConditionBuilder.styles';\nimport { convertRhsTypes } from './ConditionBuilder.mocks';\n\nexport default {\n title: 'Condition Builder/ConditionBuilder',\n component: ConditionBuilder\n} as Meta;\n\ninterface ConditionBuilderStoryProps {\n validComparators?: boolean;\n disallowNOT?: boolean;\n renderInPopover?: boolean;\n dateFunctions?: boolean;\n itemDirection?: 'column' | 'row';\n useLiteralRHSType?: boolean;\n useFieldRHSType?: boolean;\n useRelativeDatesRHSType?: boolean;\n showLhsAsLabel?: boolean;\n}\n\nexport const DefaultBuilder: Story<ConditionBuilderStoryProps> = (\n args: ConditionBuilderStoryProps\n) => {\n const translate = useI18n();\n const [condition, setCondition] = useState<Condition | undefined>(() => {\n // If a previous condition exists on the session, use it\n const prevCondition = sessionStorage.getItem('CBDemoCondition');\n if (prevCondition !== null) {\n // If an empty condition was submitted previously, start with an empty one\n if (prevCondition === 'undefined') {\n return undefined;\n }\n return JSON.parse(prevCondition);\n }\n return demoCondition;\n });\n\n // Set up content for rendering inside a Popover\n const buttonRef = useRef(null); // Ref for the opener button\n const [isOpen, setIsOpen] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const hidePopover = () => {\n if (isOpen) {\n setIsOpen(false);\n }\n };\n useOuterEvent('mousedown', [popoverEl, buttonRef.current], hidePopover); // Call the method on clicking outside these elements\n const hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed\n };\n\n const builderJsx = (\n <ConditionBuilder\n fields={demoFields}\n condition={condition}\n validComparators={args.validComparators ? demoComparators : undefined}\n validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])}\n dateFunctions={args.dateFunctions ? demoDateFunctions : undefined}\n disallowNOT={args.disallowNOT}\n onConditionSubmit={(c: Condition | undefined) => {\n setCondition(c);\n hidePopover();\n sessionStorage.setItem('CBDemoCondition', JSON.stringify(c)); // Persist on sessionStorage for the next time\n }}\n />\n );\n\n return (\n <StyledGrid\n container={{\n cols: '1fr',\n rowGap: 3\n }}\n >\n {!args.renderInPopover && builderJsx}\n\n {args.renderInPopover && (\n <>\n <Button\n ref={buttonRef}\n aria-haspopup\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n onKeyDown={hideOnEscape}\n >\n Open Condition builder\n </Button>\n\n <Popover\n show={isOpen}\n ref={setPopoverEl}\n target={buttonRef.current}\n placement='bottom-start'\n >\n <Flex container={{ pad: 1 }}>{builderJsx}</Flex>\n </Popover>\n </>\n )}\n\n <div>\n <Text variant='h4'>Output:</Text>\n <StyledCodeBlock>\n {condition ? JSON.stringify(condition, null, 2) : '(No condition)'}\n </StyledCodeBlock>\n </div>\n\n <div>\n <Text variant='h4'>Formatted Output:</Text>\n <StyledCodeBlock>\n {condition ? formatCondition(condition, demoFields, translate) : '(No condition)'}\n </StyledCodeBlock>\n </div>\n </StyledGrid>\n );\n};\n\nDefaultBuilder.args = {\n validComparators: false,\n disallowNOT: false,\n renderInPopover: false,\n dateFunctions: true\n};\n\nDefaultBuilder.argTypes = {\n validComparators: { control: { type: 'boolean' } },\n disallowNOT: { control: { type: 'boolean' } },\n renderInPopover: { control: { type: 'boolean' } },\n dateFunctions: { control: { type: 'boolean' } }\n};\n\nexport const FieldConditionDemo: Story<ConditionBuilderStoryProps> = (\n args: ConditionBuilderStoryProps\n) => {\n const translate = useI18n();\n const [condition, setCondition] = useState<LeafCondition | undefined>(undefined);\n\n // Set up content for rendering inside a Popover\n const buttonRef = useRef(null); // Ref for the opener button\n const [isOpen, setIsOpen] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const hidePopover = () => {\n if (isOpen) {\n setIsOpen(false);\n }\n };\n useOuterEvent('mousedown', [popoverEl, buttonRef.current], hidePopover); // Call the method on clicking outside these elements\n const hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed\n };\n\n const builderJsx = (\n <FieldCondition\n targetField='lastActivityAt'\n fields={demoFields}\n condition={condition}\n validComparators={args.validComparators ? demoComparators : undefined}\n validRhsTypes={new Set(['LITERAL', 'FIELD', 'DATE_FUNCTION', 'RELATIVE_DATE'])}\n dateFunctions={args.dateFunctions ? demoDateFunctions : undefined}\n onSubmit={c => {\n hidePopover();\n setCondition(c);\n }}\n />\n );\n\n return (\n <StyledGrid\n container={{\n cols: 'repeat(2, minmax(0, 1fr))',\n justifyItems: 'stretch',\n alignItems: 'start',\n colGap: 4\n }}\n >\n {!args.renderInPopover && builderJsx}\n\n {args.renderInPopover && (\n <>\n <Button\n ref={buttonRef}\n aria-haspopup\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n onKeyDown={hideOnEscape}\n >\n Open Condition builder\n </Button>\n\n <Popover\n show={isOpen}\n ref={setPopoverEl}\n target={buttonRef.current}\n placement='bottom-start'\n >\n <Flex container={{ pad: 1 }}>{builderJsx}</Flex>\n </Popover>\n </>\n )}\n\n <div>\n <Text variant='h4'>Output:</Text>\n <StyledCodeBlock>\n {condition ? JSON.stringify(condition, null, 2) : '(No condition)'}\n </StyledCodeBlock>\n\n <Text variant='h4'>Formatted Output:</Text>\n <StyledCodeBlock>\n {condition ? formatCondition({ condition }, demoFields, translate) : '(No condition)'}\n </StyledCodeBlock>\n </div>\n </StyledGrid>\n );\n};\n\nFieldConditionDemo.args = {\n validComparators: false,\n renderInPopover: false,\n dateFunctions: true\n};\n\nFieldConditionDemo.argTypes = {\n validComparators: { control: { type: 'boolean' } },\n renderInPopover: { control: { type: 'boolean' } },\n dateFunctions: { control: { type: 'boolean' } }\n};\n\nexport const AtomicConditionDemo: Story<ConditionBuilderStoryProps> = (\n args: ConditionBuilderStoryProps\n) => {\n const translate = useI18n();\n\n const validRHSTypes: Set<RHSType> = convertRhsTypes(\n !!args.useLiteralRHSType,\n !!args.useFieldRHSType,\n !!args.useRelativeDatesRHSType,\n args.dateFunctions ? demoDateFunctions : undefined\n );\n\n // Story State object to simulate \"submitting\"\n const [submitCondition, setSubmitCondition] = useState<LeafCondition | undefined>(undefined);\n // State needed to use Popover in Story\n const buttonRef = useRef(null); // Ref for the opener button\n const [isOpen, setIsOpen] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const hidePopover = () => {\n if (isOpen) {\n setIsOpen(false);\n }\n };\n useOuterEvent('mousedown', [popoverEl, buttonRef.current], hidePopover); // Call the method on clicking outside these elements\n const hideOnEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed\n };\n\n // State handling needed to manage/use the AtomicCondition component\n const [showErrorIndicators, setShowErrorIndicators] = useState(false);\n const [condition, setCondition] = useState(\n // If editing use the seedCondition, otherwise, determine an initial condition based on the targetField\n () =>\n submitCondition ||\n getInitConditionForLhs(\n { field: 'age' },\n demoFields,\n validRHSTypes,\n args.validComparators ? demoComparators : undefined,\n args.dateFunctions ? demoDateFunctions : undefined\n )\n );\n\n const handleSubmission = () => {\n setShowErrorIndicators(false);\n if (isValidCondition(condition, demoFields, true)) {\n // Insert all \"submit\" logic to use the valid condition that you've created.\n if (args.renderInPopover) setIsOpen(false);\n setSubmitCondition(condition);\n } else {\n setShowErrorIndicators(true);\n }\n };\n\n const atomicConditionJSX = (\n <Flex container={{ direction: 'column', gap: 2 }}>\n <AtomicCondition\n condition={condition}\n fields={demoFields}\n indicateErrors={showErrorIndicators}\n validComparators={args.validComparators ? demoComparators : undefined}\n dateFunctions={args.dateFunctions ? demoDateFunctions : undefined}\n onChange={c => setCondition(c)}\n itemDirection={args.itemDirection}\n showLhsAsLabel={args.showLhsAsLabel}\n validRhsTypes={validRHSTypes}\n />\n <Button variant='primary' onClick={handleSubmission}>\n Submit Condition\n </Button>\n </Flex>\n );\n\n return (\n <StyledGrid\n container={{\n cols: 'repeat(2, minmax(0, 1fr))',\n justifyItems: 'stretch',\n alignItems: 'start',\n colGap: 4\n }}\n >\n {!args.renderInPopover && atomicConditionJSX}\n\n {args.renderInPopover && (\n <>\n <Button\n ref={buttonRef}\n aria-haspopup\n aria-expanded={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n onKeyDown={hideOnEscape}\n >\n {`${isOpen ? 'Close' : 'Open'} Atomic Condition`}\n </Button>\n\n <Popover\n show={isOpen}\n ref={setPopoverEl}\n target={buttonRef.current}\n placement='bottom-start'\n >\n <Flex container={{ pad: 1 }}>{atomicConditionJSX}</Flex>\n </Popover>\n </>\n )}\n <Card>\n <CardContent>\n <Text variant='h4'>Output:</Text>\n <StyledCodeBlock>\n {submitCondition ? JSON.stringify(submitCondition, null, 2) : '(No condition)'}\n </StyledCodeBlock>\n\n <Text variant='h4'>Formatted Output:</Text>\n <StyledCodeBlock>\n {submitCondition\n ? formatCondition({ condition: submitCondition }, demoFields, translate)\n : '(No condition)'}\n </StyledCodeBlock>\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Flex container={{ gap: 1, direction: 'column' }}>\n <Text variant='h2' status='error'>\n validRhsTypes Prop Warning\n </Text>\n <Text>\n There are LHS(Left Hand Side Field)/Comparator pairings that <u>require</u> specific\n RHS(Right Hand Side Value) types. Please be mindful of these incompatibilities when\n limiting RHS value types using this prop. We <b>do not</b> support limiting RHS\n field types to incompatible types and it will result in a validation error if you do\n so. The pairings referred to here are as follows:\n </Text>\n </Flex>\n <StyledList>\n <li>\n BOOLEAN LHS Fields coupled with \"EQ\" or \"NEQ\" comparators, will <u>always yield</u>{' '}\n a Field RHS\n </li>\n <li>\n Any LHS Fields coupled with \"IN\" or \"NOT_IN\" comparators, will <u>always yield</u> a\n Literal RHS (Comma separated list)\n </li>\n </StyledList>\n <Flex container={{ direction: 'column' }}>\n <Text>\n If you would like to limit RHS value types and avoid these incompatibilities, you\n will need to exclude these comparators using the <b>validComparators</b> prop.\n </Text>\n </Flex>\n </Flex>\n </CardContent>\n </Card>\n </StyledGrid>\n );\n};\n\nAtomicConditionDemo.args = {\n validComparators: false,\n renderInPopover: false,\n dateFunctions: true,\n itemDirection: 'column',\n useLiteralRHSType: true,\n useFieldRHSType: true,\n useRelativeDatesRHSType: true,\n showLhsAsLabel: false\n};\n\nAtomicConditionDemo.argTypes = {\n validComparators: { control: { type: 'boolean' } },\n renderInPopover: { control: { type: 'boolean' } },\n dateFunctions: { control: { type: 'boolean' } },\n itemDirection: { options: ['column', 'row'], control: { type: 'select' } },\n useLiteralRHSType: { control: { type: 'boolean' } },\n useFieldRHSType: { control: { type: 'boolean' } },\n useRelativeDatesRHSType: { control: { type: 'boolean' } },\n showLhsAsLabel: { control: { type: 'boolean' } }\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledGrid: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").GridProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledCodeBlock: import("styled-components").StyledComponent<"pre", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
//# sourceMappingURL=ConditionBuilder.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionBuilder.styles.d.ts","sourceRoot":"","sources":["../../../src/condition-builder/ConditionBuilder/ConditionBuilder.styles.ts"],"names":[],"mappings":";AAIA,eAAO,MAAM,UAAU,mOAEtB,CAAC;AAEF,eAAO,MAAM,eAAe,yGAG3B,CAAC;AAGF,eAAO,MAAM,UAAU,wGAEtB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Grid, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
|
+
export const StyledGrid = styled(Grid) `
|
|
4
|
+
max-width: 60rem;
|
|
5
|
+
`;
|
|
6
|
+
export const StyledCodeBlock = styled.pre `
|
|
7
|
+
padding: ${props => props.theme.base.spacing};
|
|
8
|
+
margin-bottom: ${props => props.theme.base.spacing};
|
|
9
|
+
`;
|
|
10
|
+
StyledCodeBlock.defaultProps = defaultThemeProp;
|
|
11
|
+
export const StyledList = styled.ul `
|
|
12
|
+
padding-left: calc(4 * ${props => props.theme.base.spacing});
|
|
13
|
+
`;
|
|
14
|
+
StyledList.defaultProps = defaultThemeProp;
|
|
15
|
+
//# sourceMappingURL=ConditionBuilder.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionBuilder.styles.js","sourceRoot":"","sources":["../../../src/condition-builder/ConditionBuilder/ConditionBuilder.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAErC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;aAC5B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO;mBAC3B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO;CACnD,CAAC;AACF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CAAA;2BACR,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO;CAC3D,CAAC;AACF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled from 'styled-components';\n\nimport { Grid, defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledGrid = styled(Grid)`\n max-width: 60rem;\n`;\n\nexport const StyledCodeBlock = styled.pre`\n padding: ${props => props.theme.base.spacing};\n margin-bottom: ${props => props.theme.base.spacing};\n`;\nStyledCodeBlock.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.ul`\n padding-left: calc(4 * ${props => props.theme.base.spacing});\n`;\nStyledList.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -44,21 +44,21 @@ export const DisabledButtons = () => {
|
|
|
44
44
|
</Button>
|
|
45
45
|
</>);
|
|
46
46
|
};
|
|
47
|
-
export const IconButtons = (
|
|
47
|
+
export const IconButtons = (args) => {
|
|
48
48
|
return (<Flex container={{ alignItems: 'center' }}>
|
|
49
|
-
<Button variant='primary' label='Icon button primary' icon compact={compact}>
|
|
49
|
+
<Button variant='primary' label='Icon button primary' icon compact={args.compact}>
|
|
50
50
|
<Icon name='plus'/>
|
|
51
51
|
</Button>
|
|
52
|
-
<Button variant='secondary' label='Icon button secondary' icon compact={compact}>
|
|
52
|
+
<Button variant='secondary' label='Icon button secondary' icon compact={args.compact}>
|
|
53
53
|
<Icon name='plus'/>
|
|
54
54
|
</Button>
|
|
55
|
-
<Button variant='simple' label='Icon button simple' icon compact={compact}>
|
|
55
|
+
<Button variant='simple' label='Icon button simple' icon compact={args.compact}>
|
|
56
56
|
<Icon name='plus'/>
|
|
57
57
|
</Button>
|
|
58
|
-
<Button variant='link' label='Icon button link' icon compact={compact}>
|
|
58
|
+
<Button variant='link' label='Icon button link' icon compact={args.compact}>
|
|
59
59
|
<Icon name='plus'/>
|
|
60
60
|
</Button>
|
|
61
|
-
<Button variant='text' label='Icon button text' icon compact={compact}>
|
|
61
|
+
<Button variant='text' label='Icon button text' icon compact={args.compact}>
|
|
62
62
|
<Icon name='plus'/>
|
|
63
63
|
</Button>
|
|
64
64
|
</Flex>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.jsx","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EAEN,aAA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AC,WAAW;oBAChC,eAAe,EAAE,IAAI,CAAC,YAAY;oBAClC,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,iBAAiB,EAAE,IAAI,CAAC,cAAc;oBACtC,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB;aACF;SACF,CAAC,CAEF;MAAA,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CACrC;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAkB,CAAC,IAAI,GAAG;IACxB,WAAW,EAAE,WAAW;IACxB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,SAAS;IACzB,OAAO,EAAE,WAAW;CACrB,CAAC;AAEF,kBAAkB,CAAC,QAAQ,GAAG;IAC5B,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IAC1C,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC7C,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACrC,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAC9C,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;CACvC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport {\n Button,\n ButtonProps,\n Configuration,\n Flex,\n Icon,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport * as plusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\n\nregisterIcon(plusIcon);\n\nexport default {\n title: 'Core/Button',\n component: Button,\n parameters: {\n layout: 'centered'\n }\n} as Meta;\n\nexport const ButtonVariants: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Button variant={args.variant} compact={args.compact}>\n Click me\n </Button>\n );\n};\n\nButtonVariants.args = {\n variant: 'primary',\n compact: false\n};\n\nButtonVariants.argTypes = {\n variant: {\n options: ['primary', 'secondary', 'simple', 'link', 'text'],\n control: { type: 'select' }\n },\n compact: { control: { type: 'boolean' } }\n};\n\nexport const DisabledButtons = () => {\n return (\n <>\n <Button variant='primary' disabled>\n Primary disabled\n </Button>\n <Button variant='secondary' disabled>\n Secondary disabled\n </Button>\n <Button variant='simple' disabled>\n Simple disabled\n </Button>\n <Button variant='link' disabled>\n Link disabled\n </Button>\n <Button variant='text' disabled>\n Text disabled\n </Button>\n </>\n );\n};\n\nexport const IconButtons: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Flex container={{ alignItems: 'center' }}>\n <Button variant='primary' label='Icon button primary' icon compact={args.compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='secondary' label='Icon button secondary' icon compact={args.compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='simple' label='Icon button simple' icon compact={args.compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='link' label='Icon button link' icon compact={args.compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='text' label='Icon button text' icon compact={args.compact}>\n <Icon name='plus' />\n </Button>\n </Flex>\n );\n};\n\nIconButtons.args = {\n compact: false\n};\n\nIconButtons.argTypes = {\n compact: { control: { type: 'boolean' } }\n};\n\nexport const LoadingButtons: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <Button variant={args.variant} icon={args.icon} label='Loading' loading>\n {args.icon ? <Icon name='plus' /> : 'Loading'}\n </Button>\n );\n};\n\nLoadingButtons.args = {\n variant: 'primary',\n icon: false\n};\n\nLoadingButtons.argTypes = {\n variant: { options: ['primary', 'secondary'], control: { type: 'select' } },\n icon: { control: { type: 'boolean' } }\n};\n\nexport const ButtonAsLink = () => {\n return (\n <Button variant='primary' href='https://www.pega.com' target='_blank'>\n Go to pega.com\n </Button>\n );\n};\n\nexport const BareButtonDemo: Story<ButtonProps> = (args: ButtonProps) => {\n return (\n <BareButton disabled={args.disabled} href={args.href || undefined}>\n Click me\n </BareButton>\n );\n};\n\nBareButtonDemo.args = {\n disabled: false,\n href: ''\n};\n\nBareButtonDemo.argTypes = {\n disabled: { control: { type: 'boolean' } },\n href: { control: { type: 'text' } }\n};\n\ninterface ConfigurableButtonProps {\n borderWidth?: string;\n borderRadius?: number;\n color?: string;\n secondaryColor?: string;\n padding?: string;\n}\n\nexport const ConfigurableButton: Story<ConfigurableButtonProps> = (\n args: ConfigurableButtonProps\n) => {\n return (\n <Configuration\n theme={{\n components: {\n button: {\n 'border-width': args.borderWidth,\n 'border-radius': args.borderRadius,\n color: args.color,\n 'secondary-color': args.secondaryColor,\n padding: args.padding\n }\n }\n }}\n >\n <Button>Configurable Button</Button>\n </Configuration>\n );\n};\n\nConfigurableButton.args = {\n borderWidth: '0.0625rem',\n borderRadius: 9999,\n color: '#076bc9',\n secondaryColor: '#ffffff',\n padding: '0rem 1rem'\n};\n\nConfigurableButton.argTypes = {\n borderWidth: { control: { type: 'text' } },\n borderRadius: { control: { type: 'number' } },\n color: { control: { type: 'color' } },\n secondaryColor: { control: { type: 'color' } },\n padding: { control: { type: 'text' } }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.stories.d.ts","sourceRoot":"","sources":["../../../src/core/ColorPicker/ColorPicker.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.stories.d.ts","sourceRoot":"","sources":["../../../src/core/ColorPicker/ColorPicker.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAe,gBAAgB,EAA8B,MAAM,yBAAyB,CAAC;;AAIpG,wBAGU;AAEV,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAoBnD,CAAC;AA0BF,eAAO,MAAM,UAAU,mBA2EtB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { ColorPicker, Flex, Grid, Text, tryCatch, useTheme } from '@pega/cosmos-react-core';
|
|
2
|
+
import { ColorPicker, Flex, Grid, Text, useTheme } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StyledColorPane } from './ColorPicker.styles';
|
|
5
4
|
export default {
|
|
6
5
|
title: 'Core/ColorPicker',
|
|
7
6
|
component: ColorPicker
|
|
@@ -35,13 +34,6 @@ ColorPickerDemo.argTypes = {
|
|
|
35
34
|
readOnly: { control: { type: 'boolean' } }
|
|
36
35
|
};
|
|
37
36
|
export const MultiColor = () => {
|
|
38
|
-
const StyledColorPane = styled.div(({ color }) => {
|
|
39
|
-
const c = tryCatch(() => readableColor(color));
|
|
40
|
-
return css `
|
|
41
|
-
color: ${c};
|
|
42
|
-
background: ${color};
|
|
43
|
-
`;
|
|
44
|
-
});
|
|
45
37
|
const { base: { palette } } = useTheme();
|
|
46
38
|
const opaqueColors = useMemo(() => Object.entries(palette).filter(([, color]) => {
|
|
47
39
|
return /^#[0-9A-F]{6}$/i.test(color);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.stories.jsx","sourceRoot":"","sources":["../../../src/core/ColorPicker/ColorPicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.stories.jsx","sourceRoot":"","sources":["../../../src/core/ColorPicker/ColorPicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAoB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAA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AAI,CAEN;;MAAA,CAAC,IAAI,CACH,SAAS,CAAC,CAAC;YACT,IAAI,EAAE,iBAAiB;YACvB,GAAG,EAAE,KAAK;SACX,CAAC,CAEF;QAAA,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;YACvB,MAAM,GAAG,GAAG,SAAS,CAAC,EAAE,CAAC;YACzB,OAAO,CACL,CAAC,IAAI,CACH,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CACvD,EAAE,CAAC,CAAC,eAAe,CAAC,CACpB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,GAAG,CAAC,CAAC,GAAG,CAAC,CAET;cAAA,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAC1B;gBAAA,CAAC,KAAK,CACR;cAAA,EAAE,IAAI,CACR;YAAA,EAAE,IAAI,CAAC,CACR,CAAC;QACJ,CAAC,CAAC,CACJ;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useMemo, useState } from 'react';\n\nimport { ColorPicker, ColorPickerProps, Flex, Grid, Text, useTheme } from '@pega/cosmos-react-core';\n\nimport { StyledColorPane } from './ColorPicker.styles';\n\nexport default {\n title: 'Core/ColorPicker',\n component: ColorPicker\n} as Meta;\n\nexport const ColorPickerDemo: Story<ColorPickerProps> = (args: ColorPickerProps) => {\n const [value, setValue] = useState('#10a5ac');\n\n return (\n <ColorPicker\n label={args.label}\n labelHidden={args.labelHidden}\n info={args.info}\n status={args.status}\n swatchOnly={args.swatchOnly}\n inline={args.inline}\n required={args.required}\n disabled={args.disabled}\n readOnly={args.readOnly}\n value={value}\n onChange={e => {\n setValue(e.hex);\n }}\n />\n );\n};\n\nColorPickerDemo.args = {\n label: 'ColorPicker label',\n labelHidden: false,\n info: 'Pick a color',\n status: undefined,\n swatchOnly: false,\n inline: false,\n required: false,\n disabled: false,\n readOnly: false\n};\n\nColorPickerDemo.argTypes = {\n label: { control: { type: 'text' } },\n labelHidden: { control: { type: 'boolean' } },\n info: { control: { type: 'text' } },\n status: { options: [undefined, 'success', 'warning', 'error'], control: { type: 'select' } },\n swatchOnly: { control: { type: 'boolean' } },\n inline: { control: { type: 'boolean' } },\n required: { control: { type: 'boolean' } },\n disabled: { control: { type: 'boolean' } },\n readOnly: { control: { type: 'boolean' } }\n};\n\nexport const MultiColor = () => {\n const {\n base: { palette }\n } = useTheme();\n\n const opaqueColors = useMemo(\n () =>\n Object.entries(palette).filter(([, color]) => {\n return /^#[0-9A-F]{6}$/i.test(color);\n }),\n [palette]\n );\n\n const [values, setValues] = useState(() => opaqueColors.map(([, color]) => color));\n\n return (\n <Grid container={{ rows: '1fr 2fr' }} style={{ height: '100vh' }}>\n <Grid\n container={{\n cols: '1fr 1fr 1fr 1fr',\n alignItems: 'center',\n colGap: 4,\n rowGap: 1\n }}\n style={{ padding: '1rem' }}\n >\n <>\n {values.map((color, i) => {\n const key = `color-${i}`;\n return (\n <div key={key}>\n <ColorPicker\n inline\n label={opaqueColors[i][0]}\n value={color}\n onChange={e => {\n const newColor = e.hex;\n setValues(cur => {\n return cur.map((c, j) => {\n if (i === j) return newColor;\n return c;\n });\n });\n }}\n />\n </div>\n );\n })}\n </>\n </Grid>\n\n <Grid\n container={{\n cols: '1fr 1fr 1fr 1fr',\n gap: 0.125\n }}\n >\n {values.map((color, i) => {\n const key = `color-${i}`;\n return (\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n as={StyledColorPane}\n color={color}\n key={key}\n >\n <Text variant='h1' as='span'>\n {color}\n </Text>\n </Flex>\n );\n })}\n </Grid>\n </Grid>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.styles.d.ts","sourceRoot":"","sources":["../../../src/core/ColorPicker/ColorPicker.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;WAAuB,MAAM;SAMvD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { readableColor } from 'polished';
|
|
3
|
+
import { tryCatch } from '@pega/cosmos-react-core';
|
|
4
|
+
export const StyledColorPane = styled.div(({ color }) => {
|
|
5
|
+
const c = tryCatch(() => readableColor(color));
|
|
6
|
+
return css `
|
|
7
|
+
color: ${c};
|
|
8
|
+
background: ${color};
|
|
9
|
+
`;
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=ColorPicker.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.styles.js","sourceRoot":"","sources":["../../../src/core/ColorPicker/ColorPicker.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzE,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,OAAO,GAAG,CAAA;aACC,CAAC;kBACI,KAAK;GACpB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { tryCatch } from '@pega/cosmos-react-core';\n\nexport const StyledColorPane = styled.div<{ color: string }>(({ color }) => {\n const c = tryCatch(() => readableColor(color));\n return css`\n color: ${c};\n background: ${color};\n `;\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configuration.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.mocks.tsx"],"names":[],"mappings":";AAEA,eAAO,MAAM,QAAQ;cAKT,OAAO;WACV,MAAM;YACL,MAAM;iBAWf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BoldSpan } from './Configuration.styles';
|
|
2
|
+
export const FlipFlop = ({ flipFlop, first, second }) => {
|
|
3
|
+
return flipFlop ? (<>
|
|
4
|
+
<BoldSpan>{first}</BoldSpan> → {second}
|
|
5
|
+
</>) : (<>
|
|
6
|
+
{first} ← <BoldSpan>{second}</BoldSpan>
|
|
7
|
+
</>);
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Configuration.mocks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configuration.mocks.jsx","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,MAAM,EAKP,EAAE,EAAE;IACH,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,EACE;MAAA,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAC7C;IAAA,GAAG,CACJ,CAAC,CAAC,CAAC,CACF,EACE;MAAA,CAAC,KAAK,CAAE,QAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,CAC7C;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BoldSpan } from './Configuration.styles';\n\nexport const FlipFlop = ({\n flipFlop,\n first,\n second\n}: {\n flipFlop: boolean;\n first: string;\n second: string;\n}) => {\n return flipFlop ? (\n <>\n <BoldSpan>{first}</BoldSpan> → {second}\n </>\n ) : (\n <>\n {first} ← <BoldSpan>{second}</BoldSpan>\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;
|
|
1
|
+
{"version":3,"file":"Configuration.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAsB/C,wBAIU;AAEV,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CA+B7D,CAAC;AAUF,eAAO,MAAM,gBAAgB,mBAyE5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAWjC,CAAC;AAEF,UAAU,0BAA0B;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,0BAA0B,CAsBnE,CAAC;AAUF,UAAU,+BAA+B;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,+BAA+B,CA2B7E,CAAC;AAYF,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,uBAAuB,CAU7D,CAAC;AAUF,UAAU,6BAA6B;IACrC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,6BAA6B,CAsBzE,CAAC"}
|