@pega/cosmos-react-demos 2.1.2 → 3.0.0-dev.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jsx/build/AppHeader/AppHeader.stories.d.ts +2 -1
- package/jsx/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
- package/jsx/build/AppHeader/AppHeader.stories.jsx +46 -13
- package/jsx/build/AppHeader/AppHeader.stories.jsx.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts +2 -1
- package/jsx/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/jsx/build/AppShell/AppShell.stories.jsx +46 -13
- package/jsx/build/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts +7 -0
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.js +50 -0
- package/jsx/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts +9 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx +45 -0
- package/jsx/build/ItemLibrary/LibraryPicker.stories.jsx.map +1 -0
- package/jsx/build/LifeCycle/LifeCycle.mocks.js +1 -1
- package/jsx/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx +52 -34
- package/jsx/build/LifeCycle/LifeCycle.stories.jsx.map +1 -1
- package/jsx/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/build/PageTemplates/PageTemplates.stories.jsx +2 -6
- 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 +10 -12
- package/jsx/build/Workbench/Workbench.stories.jsx.map +1 -1
- package/jsx/core/AppShell/AppShell.stories.d.ts +5 -0
- package/jsx/core/AppShell/AppShell.stories.d.ts.map +1 -1
- package/jsx/core/AppShell/AppShell.stories.jsx +25 -1
- package/jsx/core/AppShell/AppShell.stories.jsx.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.d.ts +5 -0
- package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.jsx +32 -5
- package/jsx/core/Avatar/Avatar.stories.jsx.map +1 -1
- package/jsx/core/Badges/Status.stories.d.ts +5 -0
- package/jsx/core/Badges/Status.stories.d.ts.map +1 -1
- package/jsx/core/Badges/Status.stories.jsx +25 -1
- package/jsx/core/Badges/Status.stories.jsx.map +1 -1
- package/jsx/core/Banner/Banner.mocks.d.ts +18 -0
- package/jsx/core/Banner/Banner.mocks.d.ts.map +1 -0
- package/jsx/core/Banner/Banner.mocks.jsx +41 -0
- package/jsx/core/Banner/Banner.mocks.jsx.map +1 -0
- package/jsx/core/Banner/Banner.stories.d.ts +5 -1
- package/jsx/core/Banner/Banner.stories.d.ts.map +1 -1
- package/jsx/core/Banner/Banner.stories.jsx +22 -39
- package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
- package/jsx/core/Button/Button.stories.d.ts +8 -0
- package/jsx/core/Button/Button.stories.d.ts.map +1 -1
- package/jsx/core/Button/Button.stories.jsx +32 -3
- package/jsx/core/Button/Button.stories.jsx.map +1 -1
- package/jsx/core/Card/Card.stories.d.ts +5 -0
- package/jsx/core/Card/Card.stories.d.ts.map +1 -1
- package/jsx/core/Card/Card.stories.jsx +30 -1
- package/jsx/core/Card/Card.stories.jsx.map +1 -1
- package/jsx/core/Checkbox/Checkbox.stories.d.ts +12 -0
- package/jsx/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/jsx/core/Checkbox/Checkbox.stories.jsx +54 -1
- package/jsx/core/Checkbox/Checkbox.stories.jsx.map +1 -1
- package/jsx/core/Configuration/Configuration.stories.d.ts +17 -0
- package/jsx/core/Configuration/Configuration.stories.d.ts.map +1 -1
- package/jsx/core/Configuration/Configuration.stories.jsx +94 -3
- package/jsx/core/Configuration/Configuration.stories.jsx.map +1 -1
- package/jsx/core/DateTime/DateTimeDisplay.stories.jsx +1 -0
- package/jsx/core/DateTime/DateTimeDisplay.stories.jsx.map +1 -1
- package/jsx/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -1
- package/jsx/core/ExpandCollapse/ExpandCollapse.styles.js +5 -0
- package/jsx/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts +21 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx +36 -0
- package/jsx/core/FieldGroup/FieldGroupList.mocks.jsx.map +1 -0
- package/jsx/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx +1 -34
- package/jsx/core/FieldGroup/FieldGroupList.stories.jsx.map +1 -1
- package/jsx/core/File/FileDisplay.stories.d.ts +8 -1
- package/jsx/core/File/FileDisplay.stories.d.ts.map +1 -1
- package/jsx/core/File/FileDisplay.stories.jsx +37 -2
- package/jsx/core/File/FileDisplay.stories.jsx.map +1 -1
- package/jsx/core/Flex/Flex.styles.d.ts +2 -2
- package/jsx/core/Flex/Flex.styles.d.ts.map +1 -1
- package/jsx/core/Flex/Flex.styles.js +17 -17
- package/jsx/core/Flex/Flex.styles.js.map +1 -1
- package/jsx/core/Flex/FlexContainer.stories.d.ts +2 -0
- package/jsx/core/Flex/FlexContainer.stories.d.ts.map +1 -1
- package/jsx/core/Flex/FlexContainer.stories.jsx +45 -32
- package/jsx/core/Flex/FlexContainer.stories.jsx.map +1 -1
- package/jsx/core/Flex/FlexItem.stories.jsx +13 -13
- package/jsx/core/Flex/FlexItem.stories.jsx.map +1 -1
- package/jsx/core/Form/Form.mocks.d.ts +8 -0
- package/jsx/core/Form/Form.mocks.d.ts.map +1 -0
- package/jsx/core/Form/Form.mocks.jsx +138 -0
- package/jsx/core/Form/Form.mocks.jsx.map +1 -0
- package/jsx/core/Form/Form.stories.d.ts +10 -7
- package/jsx/core/Form/Form.stories.d.ts.map +1 -1
- package/jsx/core/Form/Form.stories.jsx +44 -138
- package/jsx/core/Form/Form.stories.jsx.map +1 -1
- package/jsx/core/Grid/Grid.styles.d.ts +2 -2
- package/jsx/core/Grid/Grid.styles.d.ts.map +1 -1
- package/jsx/core/Grid/Grid.styles.js +4 -4
- package/jsx/core/Grid/Grid.styles.js.map +1 -1
- package/jsx/core/Grid/GridContainer.stories.d.ts +6 -5
- package/jsx/core/Grid/GridContainer.stories.d.ts.map +1 -1
- package/jsx/core/Grid/GridContainer.stories.jsx +51 -44
- package/jsx/core/Grid/GridContainer.stories.jsx.map +1 -1
- package/jsx/core/Grid/GridItem.stories.d.ts +2 -2
- package/jsx/core/Grid/GridItem.stories.d.ts.map +1 -1
- package/jsx/core/Grid/GridItem.stories.jsx +28 -28
- package/jsx/core/Grid/GridItem.stories.jsx.map +1 -1
- package/jsx/core/Icon/Icon.mocks.d.ts +3 -0
- package/jsx/core/Icon/Icon.mocks.d.ts.map +1 -0
- package/jsx/core/Icon/Icon.mocks.jsx +9 -0
- package/jsx/core/Icon/Icon.mocks.jsx.map +1 -0
- package/jsx/core/Icon/Icon.stories.d.ts +1 -0
- package/jsx/core/Icon/Icon.stories.d.ts.map +1 -1
- package/jsx/core/Icon/Icon.stories.jsx +7 -1
- package/jsx/core/Icon/Icon.stories.jsx.map +1 -1
- package/jsx/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
- package/jsx/core/IconPicker/IconPicker.stories.jsx +0 -1
- package/jsx/core/IconPicker/IconPicker.stories.jsx.map +1 -1
- package/jsx/core/Input/Input.stories.d.ts +9 -0
- package/jsx/core/Input/Input.stories.d.ts.map +1 -1
- package/jsx/core/Input/Input.stories.jsx +40 -1
- package/jsx/core/Input/Input.stories.jsx.map +1 -1
- package/jsx/core/Label/Label.stories.d.ts +4 -0
- package/jsx/core/Label/Label.stories.d.ts.map +1 -1
- package/jsx/core/Label/Label.stories.jsx +18 -1
- package/jsx/core/Label/Label.stories.jsx.map +1 -1
- package/jsx/core/Lightbox/Lightbox.mocks.d.ts +15 -0
- package/jsx/core/Lightbox/Lightbox.mocks.d.ts.map +1 -0
- package/jsx/core/Lightbox/Lightbox.mocks.js +59 -0
- package/jsx/core/Lightbox/Lightbox.mocks.js.map +1 -0
- package/jsx/core/Lightbox/Lightbox.stories.d.ts +7 -6
- package/jsx/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
- package/jsx/core/Lightbox/Lightbox.stories.jsx +14 -65
- package/jsx/core/Lightbox/Lightbox.stories.jsx.map +1 -1
- package/jsx/core/Link/Link.stories.d.ts +11 -1
- package/jsx/core/Link/Link.stories.d.ts.map +1 -1
- package/jsx/core/Link/Link.stories.jsx +22 -5
- package/jsx/core/Link/Link.stories.jsx.map +1 -1
- package/jsx/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
- package/jsx/core/List/CommaSeparatedList.stories.jsx +17 -19
- package/jsx/core/List/CommaSeparatedList.stories.jsx.map +1 -1
- package/jsx/core/List/OrderedList.stories.d.ts.map +1 -1
- package/jsx/core/List/OrderedList.stories.jsx +10 -10
- package/jsx/core/List/OrderedList.stories.jsx.map +1 -1
- package/jsx/core/List/UnorderedList.stories.d.ts.map +1 -1
- package/jsx/core/List/UnorderedList.stories.jsx +10 -10
- package/jsx/core/List/UnorderedList.stories.jsx.map +1 -1
- package/jsx/core/Menu/Menu.stories.d.ts +3 -3
- package/jsx/core/Menu/Menu.stories.d.ts.map +1 -1
- package/jsx/core/Menu/Menu.stories.jsx +8 -12
- package/jsx/core/Menu/Menu.stories.jsx.map +1 -1
- package/jsx/core/Modal/Modal.mocks.jsx +1 -1
- package/jsx/core/Modal/Modal.mocks.jsx.map +1 -1
- package/jsx/core/Number/Number.stories.d.ts.map +1 -1
- package/jsx/core/Number/Number.stories.jsx +1 -4
- package/jsx/core/Number/Number.stories.jsx.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts +5 -2
- package/jsx/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx +3 -3
- package/jsx/core/PageTemplates/PageTemplates.stories.jsx.map +1 -1
- package/jsx/core/Paragraph/ParagraphDisplay.stories.jsx +3 -0
- package/jsx/core/Paragraph/ParagraphDisplay.stories.jsx.map +1 -1
- package/jsx/core/Popover/Popover.stories.d.ts +1 -2
- package/jsx/core/Popover/Popover.stories.d.ts.map +1 -1
- package/jsx/core/Popover/Popover.stories.jsx +35 -37
- package/jsx/core/Popover/Popover.stories.jsx.map +1 -1
- package/jsx/core/Progress/Progress.stories.d.ts +4 -0
- package/jsx/core/Progress/Progress.stories.d.ts.map +1 -1
- package/jsx/core/Progress/Progress.stories.jsx +22 -1
- package/jsx/core/Progress/Progress.stories.jsx.map +1 -1
- package/jsx/core/RadioButton/RadioButton.stories.d.ts +12 -0
- package/jsx/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
- package/jsx/core/RadioButton/RadioButton.stories.jsx +53 -1
- package/jsx/core/RadioButton/RadioButton.stories.jsx.map +1 -1
- package/jsx/core/Rating/Rating.stories.d.ts +8 -1
- package/jsx/core/Rating/Rating.stories.d.ts.map +1 -1
- package/jsx/core/Rating/Rating.stories.jsx +21 -4
- package/jsx/core/Rating/Rating.stories.jsx.map +1 -1
- package/jsx/core/SearchInput/SearchInput.stories.d.ts +4 -0
- package/jsx/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
- package/jsx/core/SearchInput/SearchInput.stories.jsx +18 -1
- package/jsx/core/SearchInput/SearchInput.stories.jsx.map +1 -1
- package/jsx/core/Select/Select.stories.d.ts +8 -0
- package/jsx/core/Select/Select.stories.d.ts.map +1 -1
- package/jsx/core/Select/Select.stories.jsx +35 -1
- package/jsx/core/Select/Select.stories.jsx.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.d.ts +6 -0
- package/jsx/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.jsx +37 -6
- package/jsx/core/Sentiment/Sentiment.stories.jsx.map +1 -1
- package/jsx/core/SummaryList/SummaryList.stories.jsx +1 -1
- package/jsx/core/SummaryList/SummaryList.stories.jsx.map +1 -1
- package/jsx/core/Switch/Switch.stories.d.ts +7 -0
- package/jsx/core/Switch/Switch.stories.d.ts.map +1 -1
- package/jsx/core/Switch/Switch.stories.jsx +34 -1
- package/jsx/core/Switch/Switch.stories.jsx.map +1 -1
- package/jsx/core/Table/Table.stories.d.ts +25 -0
- package/jsx/core/Table/Table.stories.d.ts.map +1 -1
- package/jsx/core/Table/Table.stories.jsx +120 -1
- package/jsx/core/Table/Table.stories.jsx.map +1 -1
- package/jsx/core/Tabs/Tabs.stories.d.ts +5 -0
- package/jsx/core/Tabs/Tabs.stories.d.ts.map +1 -1
- package/jsx/core/Tabs/Tabs.stories.jsx +39 -1
- package/jsx/core/Tabs/Tabs.stories.jsx.map +1 -1
- package/jsx/core/Text/Text.stories.d.ts +19 -0
- package/jsx/core/Text/Text.stories.d.ts.map +1 -1
- package/jsx/core/Text/Text.stories.jsx +112 -1
- package/jsx/core/Text/Text.stories.jsx.map +1 -1
- package/jsx/core/TextArea/TextArea.stories.d.ts +5 -0
- package/jsx/core/TextArea/TextArea.stories.d.ts.map +1 -1
- package/jsx/core/TextArea/TextArea.stories.jsx +22 -1
- package/jsx/core/TextArea/TextArea.stories.jsx.map +1 -1
- package/jsx/core/Toaster/Toaster.stories.d.ts.map +1 -1
- package/jsx/core/Toaster/Toaster.stories.jsx +8 -3
- package/jsx/core/Toaster/Toaster.stories.jsx.map +1 -1
- package/jsx/core/Tooltip/Tooltip.stories.d.ts +6 -0
- package/jsx/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/jsx/core/Tooltip/Tooltip.stories.jsx +28 -1
- package/jsx/core/Tooltip/Tooltip.stories.jsx.map +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx +1 -1
- package/jsx/cs/CSCaseView/CSAppShell.stories.jsx.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx +12 -10
- package/jsx/cs/IntelligentGuidance/IntelligentGuidance.stories.jsx.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts +1 -2
- package/jsx/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.mocks.js +5 -10
- package/jsx/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts +8 -3
- package/jsx/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/jsx/cs/TaskManager/TaskManager.stories.jsx +164 -132
- package/jsx/cs/TaskManager/TaskManager.stories.jsx.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx +1 -1
- package/jsx/rte/RichTextEditor/RichTextEditor.stories.jsx.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts +1 -0
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx +19 -2
- package/jsx/rte/RichTextEditor/RichTextViewer.stories.jsx.map +1 -1
- package/jsx/social/Chat/Chat.stories.d.ts +31 -22
- package/jsx/social/Chat/Chat.stories.d.ts.map +1 -1
- package/jsx/social/Chat/Chat.stories.jsx +106 -153
- package/jsx/social/Chat/Chat.stories.jsx.map +1 -1
- package/jsx/social/Email/Email.mocks.d.ts +1 -2
- package/jsx/social/Email/Email.mocks.d.ts.map +1 -1
- package/jsx/social/Email/{Email.mocks.jsx → Email.mocks.js} +2 -3
- package/jsx/social/Email/Email.mocks.js.map +1 -0
- package/jsx/social/Email/Email.stories.d.ts.map +1 -1
- package/jsx/social/Email/Email.stories.jsx +7 -8
- package/jsx/social/Email/Email.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedNewPost.stories.jsx +1 -1
- package/jsx/social/Feed/FeedNewPost.stories.jsx.map +1 -1
- package/jsx/social/Feed/FeedPost.stories.jsx +1 -1
- package/jsx/social/Feed/FeedPost.stories.jsx.map +1 -1
- package/jsx/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
- package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx +6 -7
- package/jsx/work/AppAnnouncement/AppAnnouncement.stories.jsx.map +1 -1
- package/jsx/work/CaseView/FileService.mock.d.ts.map +1 -1
- package/jsx/work/CaseView/FileService.mock.jsx +6 -2
- package/jsx/work/CaseView/FileService.mock.jsx.map +1 -1
- package/jsx/work/Confirmation/Confirmation.stories.d.ts +1 -1
- package/jsx/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
- package/jsx/work/Confirmation/Confirmation.stories.jsx +14 -3
- package/jsx/work/Confirmation/Confirmation.stories.jsx.map +1 -1
- package/jsx/work/Confirmation/Confirmation.styles.d.ts +2 -0
- package/jsx/work/Confirmation/Confirmation.styles.d.ts.map +1 -0
- package/jsx/work/Confirmation/Confirmation.styles.js +7 -0
- package/jsx/work/Confirmation/Confirmation.styles.js.map +1 -0
- package/jsx/work/Details/Details.stories.jsx +3 -3
- package/jsx/work/Details/Details.stories.jsx.map +1 -1
- package/jsx/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
- package/jsx/work/SearchResults/SearchResults.stories.jsx +3 -9
- package/jsx/work/SearchResults/SearchResults.stories.jsx.map +1 -1
- package/jsx/work/SearchResults/SearchResults.styles.d.ts +5 -0
- package/jsx/work/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/jsx/work/SearchResults/SearchResults.styles.js +12 -0
- package/jsx/work/SearchResults/SearchResults.styles.js.map +1 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts +17 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.jsx +32 -0
- package/jsx/work/Stakeholders/Stakeholders.mocks.jsx.map +1 -0
- package/jsx/work/Stakeholders/Stakeholders.stories.d.ts +2 -5
- package/jsx/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
- package/jsx/work/Stakeholders/Stakeholders.stories.jsx +2 -30
- package/jsx/work/Stakeholders/Stakeholders.stories.jsx.map +1 -1
- package/jsx/work/Timeline/Timeline.stories.d.ts.map +1 -1
- package/jsx/work/Timeline/Timeline.stories.jsx +2 -2
- package/jsx/work/Timeline/Timeline.stories.jsx.map +1 -1
- package/lib/build/AppHeader/AppHeader.stories.d.ts +2 -1
- package/lib/build/AppHeader/AppHeader.stories.d.ts.map +1 -1
- package/lib/build/AppHeader/AppHeader.stories.js +46 -13
- package/lib/build/AppHeader/AppHeader.stories.js.map +1 -1
- package/lib/build/AppShell/AppShell.stories.d.ts +2 -1
- package/lib/build/AppShell/AppShell.stories.d.ts.map +1 -1
- package/lib/build/AppShell/AppShell.stories.js +46 -13
- package/lib/build/AppShell/AppShell.stories.js.map +1 -1
- package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts +7 -0
- package/lib/build/ItemLibrary/LibraryPicker.mocks.d.ts.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.mocks.js +50 -0
- package/lib/build/ItemLibrary/LibraryPicker.mocks.js.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts +9 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.d.ts.map +1 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.js +40 -0
- package/lib/build/ItemLibrary/LibraryPicker.stories.js.map +1 -0
- package/lib/build/LifeCycle/LifeCycle.mocks.js +1 -1
- package/lib/build/LifeCycle/LifeCycle.mocks.js.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.d.ts.map +1 -1
- package/lib/build/LifeCycle/LifeCycle.stories.js +52 -48
- package/lib/build/LifeCycle/LifeCycle.stories.js.map +1 -1
- package/lib/build/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/build/PageTemplates/PageTemplates.stories.js +2 -2
- 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 +15 -17
- package/lib/build/Workbench/Workbench.stories.js.map +1 -1
- package/lib/core/AppShell/AppShell.stories.d.ts +5 -0
- package/lib/core/AppShell/AppShell.stories.d.ts.map +1 -1
- package/lib/core/AppShell/AppShell.stories.js +23 -1
- package/lib/core/AppShell/AppShell.stories.js.map +1 -1
- package/lib/core/Avatar/Avatar.stories.d.ts +5 -0
- package/lib/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/lib/core/Avatar/Avatar.stories.js +30 -5
- package/lib/core/Avatar/Avatar.stories.js.map +1 -1
- package/lib/core/Badges/Status.stories.d.ts +5 -0
- package/lib/core/Badges/Status.stories.d.ts.map +1 -1
- package/lib/core/Badges/Status.stories.js +23 -1
- package/lib/core/Badges/Status.stories.js.map +1 -1
- package/lib/core/Banner/Banner.mocks.d.ts +18 -0
- package/lib/core/Banner/Banner.mocks.d.ts.map +1 -0
- package/lib/core/Banner/Banner.mocks.js +36 -0
- package/lib/core/Banner/Banner.mocks.js.map +1 -0
- package/lib/core/Banner/Banner.stories.d.ts +5 -1
- package/lib/core/Banner/Banner.stories.d.ts.map +1 -1
- package/lib/core/Banner/Banner.stories.js +21 -33
- package/lib/core/Banner/Banner.stories.js.map +1 -1
- package/lib/core/Button/Button.stories.d.ts +8 -0
- package/lib/core/Button/Button.stories.d.ts.map +1 -1
- package/lib/core/Button/Button.stories.js +29 -2
- package/lib/core/Button/Button.stories.js.map +1 -1
- package/lib/core/Card/Card.stories.d.ts +5 -0
- package/lib/core/Card/Card.stories.d.ts.map +1 -1
- package/lib/core/Card/Card.stories.js +19 -1
- package/lib/core/Card/Card.stories.js.map +1 -1
- package/lib/core/Checkbox/Checkbox.stories.d.ts +12 -0
- package/lib/core/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/lib/core/Checkbox/Checkbox.stories.js +52 -1
- package/lib/core/Checkbox/Checkbox.stories.js.map +1 -1
- package/lib/core/Configuration/Configuration.stories.d.ts +17 -0
- package/lib/core/Configuration/Configuration.stories.d.ts.map +1 -1
- package/lib/core/Configuration/Configuration.stories.js +62 -3
- package/lib/core/Configuration/Configuration.stories.js.map +1 -1
- package/lib/core/DateTime/DateTimeDisplay.stories.js +1 -0
- package/lib/core/DateTime/DateTimeDisplay.stories.js.map +1 -1
- package/lib/core/ExpandCollapse/ExpandCollapse.styles.d.ts.map +1 -1
- package/lib/core/ExpandCollapse/ExpandCollapse.styles.js +5 -0
- package/lib/core/ExpandCollapse/ExpandCollapse.styles.js.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts +21 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.d.ts.map +1 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.js +38 -0
- package/lib/core/FieldGroup/FieldGroupList.mocks.js.map +1 -0
- package/lib/core/FieldGroup/FieldGroupList.stories.d.ts.map +1 -1
- package/lib/core/FieldGroup/FieldGroupList.stories.js +1 -35
- package/lib/core/FieldGroup/FieldGroupList.stories.js.map +1 -1
- package/lib/core/File/FileDisplay.stories.d.ts +8 -1
- package/lib/core/File/FileDisplay.stories.d.ts.map +1 -1
- package/lib/core/File/FileDisplay.stories.js +32 -2
- package/lib/core/File/FileDisplay.stories.js.map +1 -1
- package/lib/core/Flex/Flex.styles.d.ts +2 -2
- package/lib/core/Flex/Flex.styles.d.ts.map +1 -1
- package/lib/core/Flex/Flex.styles.js +17 -17
- package/lib/core/Flex/Flex.styles.js.map +1 -1
- package/lib/core/Flex/FlexContainer.stories.d.ts +2 -0
- package/lib/core/Flex/FlexContainer.stories.d.ts.map +1 -1
- package/lib/core/Flex/FlexContainer.stories.js +10 -7
- package/lib/core/Flex/FlexContainer.stories.js.map +1 -1
- package/lib/core/Flex/FlexItem.stories.js +4 -4
- package/lib/core/Flex/FlexItem.stories.js.map +1 -1
- package/lib/core/Form/Form.mocks.d.ts +8 -0
- package/lib/core/Form/Form.mocks.d.ts.map +1 -0
- package/lib/core/Form/Form.mocks.js +97 -0
- package/lib/core/Form/Form.mocks.js.map +1 -0
- package/lib/core/Form/Form.stories.d.ts +10 -7
- package/lib/core/Form/Form.stories.d.ts.map +1 -1
- package/lib/core/Form/Form.stories.js +42 -96
- package/lib/core/Form/Form.stories.js.map +1 -1
- package/lib/core/Grid/Grid.styles.d.ts +2 -2
- package/lib/core/Grid/Grid.styles.d.ts.map +1 -1
- package/lib/core/Grid/Grid.styles.js +4 -4
- package/lib/core/Grid/Grid.styles.js.map +1 -1
- package/lib/core/Grid/GridContainer.stories.d.ts +6 -5
- package/lib/core/Grid/GridContainer.stories.d.ts.map +1 -1
- package/lib/core/Grid/GridContainer.stories.js +27 -24
- package/lib/core/Grid/GridContainer.stories.js.map +1 -1
- package/lib/core/Grid/GridItem.stories.d.ts +2 -2
- package/lib/core/Grid/GridItem.stories.d.ts.map +1 -1
- package/lib/core/Grid/GridItem.stories.js +10 -10
- package/lib/core/Grid/GridItem.stories.js.map +1 -1
- package/lib/core/Icon/Icon.mocks.d.ts +3 -0
- package/lib/core/Icon/Icon.mocks.d.ts.map +1 -0
- package/lib/core/Icon/Icon.mocks.js +10 -0
- package/lib/core/Icon/Icon.mocks.js.map +1 -0
- package/lib/core/Icon/Icon.stories.d.ts +1 -0
- package/lib/core/Icon/Icon.stories.d.ts.map +1 -1
- package/lib/core/Icon/Icon.stories.js +7 -1
- package/lib/core/Icon/Icon.stories.js.map +1 -1
- package/lib/core/IconPicker/IconPicker.stories.d.ts.map +1 -1
- package/lib/core/IconPicker/IconPicker.stories.js +0 -1
- package/lib/core/IconPicker/IconPicker.stories.js.map +1 -1
- package/lib/core/Input/Input.stories.d.ts +9 -0
- package/lib/core/Input/Input.stories.d.ts.map +1 -1
- package/lib/core/Input/Input.stories.js +38 -1
- package/lib/core/Input/Input.stories.js.map +1 -1
- package/lib/core/Label/Label.stories.d.ts +4 -0
- package/lib/core/Label/Label.stories.d.ts.map +1 -1
- package/lib/core/Label/Label.stories.js +16 -1
- package/lib/core/Label/Label.stories.js.map +1 -1
- package/lib/core/Lightbox/Lightbox.mocks.d.ts +15 -0
- package/lib/core/Lightbox/Lightbox.mocks.d.ts.map +1 -0
- package/lib/core/Lightbox/Lightbox.mocks.js +67 -0
- package/lib/core/Lightbox/Lightbox.mocks.js.map +1 -0
- package/lib/core/Lightbox/Lightbox.stories.d.ts +7 -6
- package/lib/core/Lightbox/Lightbox.stories.d.ts.map +1 -1
- package/lib/core/Lightbox/Lightbox.stories.js +14 -73
- package/lib/core/Lightbox/Lightbox.stories.js.map +1 -1
- package/lib/core/Link/Link.stories.d.ts +11 -1
- package/lib/core/Link/Link.stories.d.ts.map +1 -1
- package/lib/core/Link/Link.stories.js +7 -4
- package/lib/core/Link/Link.stories.js.map +1 -1
- package/lib/core/List/CommaSeparatedList.stories.d.ts.map +1 -1
- package/lib/core/List/CommaSeparatedList.stories.js +17 -17
- package/lib/core/List/CommaSeparatedList.stories.js.map +1 -1
- package/lib/core/List/OrderedList.stories.d.ts.map +1 -1
- package/lib/core/List/OrderedList.stories.js +10 -10
- package/lib/core/List/OrderedList.stories.js.map +1 -1
- package/lib/core/List/UnorderedList.stories.d.ts.map +1 -1
- package/lib/core/List/UnorderedList.stories.js +10 -10
- package/lib/core/List/UnorderedList.stories.js.map +1 -1
- package/lib/core/Menu/Menu.stories.d.ts +3 -3
- package/lib/core/Menu/Menu.stories.d.ts.map +1 -1
- package/lib/core/Menu/Menu.stories.js +8 -12
- package/lib/core/Menu/Menu.stories.js.map +1 -1
- package/lib/core/Modal/Modal.mocks.js +1 -1
- package/lib/core/Modal/Modal.mocks.js.map +1 -1
- package/lib/core/Number/Number.stories.d.ts.map +1 -1
- package/lib/core/Number/Number.stories.js +1 -4
- package/lib/core/Number/Number.stories.js.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts +5 -2
- package/lib/core/PageTemplates/PageTemplates.stories.d.ts.map +1 -1
- package/lib/core/PageTemplates/PageTemplates.stories.js +3 -3
- package/lib/core/PageTemplates/PageTemplates.stories.js.map +1 -1
- package/lib/core/Paragraph/ParagraphDisplay.stories.js +3 -0
- package/lib/core/Paragraph/ParagraphDisplay.stories.js.map +1 -1
- package/lib/core/Popover/Popover.stories.d.ts +1 -2
- package/lib/core/Popover/Popover.stories.d.ts.map +1 -1
- package/lib/core/Popover/Popover.stories.js +24 -25
- package/lib/core/Popover/Popover.stories.js.map +1 -1
- package/lib/core/Progress/Progress.stories.d.ts +4 -0
- package/lib/core/Progress/Progress.stories.d.ts.map +1 -1
- package/lib/core/Progress/Progress.stories.js +18 -1
- package/lib/core/Progress/Progress.stories.js.map +1 -1
- package/lib/core/RadioButton/RadioButton.stories.d.ts +12 -0
- package/lib/core/RadioButton/RadioButton.stories.d.ts.map +1 -1
- package/lib/core/RadioButton/RadioButton.stories.js +51 -1
- package/lib/core/RadioButton/RadioButton.stories.js.map +1 -1
- package/lib/core/Rating/Rating.stories.d.ts +8 -1
- package/lib/core/Rating/Rating.stories.d.ts.map +1 -1
- package/lib/core/Rating/Rating.stories.js +19 -4
- package/lib/core/Rating/Rating.stories.js.map +1 -1
- package/lib/core/SearchInput/SearchInput.stories.d.ts +4 -0
- package/lib/core/SearchInput/SearchInput.stories.d.ts.map +1 -1
- package/lib/core/SearchInput/SearchInput.stories.js +16 -1
- package/lib/core/SearchInput/SearchInput.stories.js.map +1 -1
- package/lib/core/Select/Select.stories.d.ts +8 -0
- package/lib/core/Select/Select.stories.d.ts.map +1 -1
- package/lib/core/Select/Select.stories.js +28 -1
- package/lib/core/Select/Select.stories.js.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.d.ts +6 -0
- package/lib/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.js +34 -7
- package/lib/core/Sentiment/Sentiment.stories.js.map +1 -1
- package/lib/core/SummaryList/SummaryList.stories.js +1 -1
- package/lib/core/SummaryList/SummaryList.stories.js.map +1 -1
- package/lib/core/Switch/Switch.stories.d.ts +7 -0
- package/lib/core/Switch/Switch.stories.d.ts.map +1 -1
- package/lib/core/Switch/Switch.stories.js +32 -1
- package/lib/core/Switch/Switch.stories.js.map +1 -1
- package/lib/core/Table/Table.stories.d.ts +25 -0
- package/lib/core/Table/Table.stories.d.ts.map +1 -1
- package/lib/core/Table/Table.stories.js +113 -1
- package/lib/core/Table/Table.stories.js.map +1 -1
- package/lib/core/Tabs/Tabs.stories.d.ts +5 -0
- package/lib/core/Tabs/Tabs.stories.d.ts.map +1 -1
- package/lib/core/Tabs/Tabs.stories.js +30 -1
- package/lib/core/Tabs/Tabs.stories.js.map +1 -1
- package/lib/core/Text/Text.stories.d.ts +19 -0
- package/lib/core/Text/Text.stories.d.ts.map +1 -1
- package/lib/core/Text/Text.stories.js +102 -2
- package/lib/core/Text/Text.stories.js.map +1 -1
- package/lib/core/TextArea/TextArea.stories.d.ts +5 -0
- package/lib/core/TextArea/TextArea.stories.d.ts.map +1 -1
- package/lib/core/TextArea/TextArea.stories.js +20 -1
- package/lib/core/TextArea/TextArea.stories.js.map +1 -1
- package/lib/core/Toaster/Toaster.stories.d.ts.map +1 -1
- package/lib/core/Toaster/Toaster.stories.js +8 -3
- package/lib/core/Toaster/Toaster.stories.js.map +1 -1
- package/lib/core/Tooltip/Tooltip.stories.d.ts +6 -0
- package/lib/core/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/lib/core/Tooltip/Tooltip.stories.js +20 -1
- package/lib/core/Tooltip/Tooltip.stories.js.map +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.js +1 -1
- package/lib/cs/CSCaseView/CSAppShell.stories.js.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.d.ts.map +1 -1
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js +12 -10
- package/lib/cs/IntelligentGuidance/IntelligentGuidance.stories.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts +1 -2
- package/lib/cs/TaskManager/TaskManager.mocks.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.mocks.js +5 -10
- package/lib/cs/TaskManager/TaskManager.mocks.js.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.d.ts +8 -3
- package/lib/cs/TaskManager/TaskManager.stories.d.ts.map +1 -1
- package/lib/cs/TaskManager/TaskManager.stories.js +142 -119
- package/lib/cs/TaskManager/TaskManager.stories.js.map +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.js +1 -1
- package/lib/rte/RichTextEditor/RichTextEditor.stories.js.map +1 -1
- package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts +1 -0
- package/lib/rte/RichTextEditor/RichTextViewer.stories.d.ts.map +1 -1
- package/lib/rte/RichTextEditor/RichTextViewer.stories.js +15 -2
- package/lib/rte/RichTextEditor/RichTextViewer.stories.js.map +1 -1
- package/lib/social/Chat/Chat.stories.d.ts +33 -22
- package/lib/social/Chat/Chat.stories.d.ts.map +1 -1
- package/lib/social/Chat/Chat.stories.js +102 -158
- package/lib/social/Chat/Chat.stories.js.map +1 -1
- package/lib/social/Email/Email.mocks.d.ts +1 -2
- package/lib/social/Email/Email.mocks.d.ts.map +1 -1
- package/lib/social/Email/Email.mocks.js +1 -3
- package/lib/social/Email/Email.mocks.js.map +1 -1
- package/lib/social/Email/Email.stories.d.ts.map +1 -1
- package/lib/social/Email/Email.stories.js +7 -8
- package/lib/social/Email/Email.stories.js.map +1 -1
- package/lib/social/Feed/FeedNewPost.stories.js +1 -1
- package/lib/social/Feed/FeedNewPost.stories.js.map +1 -1
- package/lib/social/Feed/FeedPost.stories.js +1 -1
- package/lib/social/Feed/FeedPost.stories.js.map +1 -1
- package/lib/work/AppAnnouncement/AppAnnouncement.stories.d.ts.map +1 -1
- package/lib/work/AppAnnouncement/AppAnnouncement.stories.js +6 -7
- package/lib/work/AppAnnouncement/AppAnnouncement.stories.js.map +1 -1
- package/lib/work/CaseView/FileService.mock.d.ts.map +1 -1
- package/lib/work/CaseView/FileService.mock.js +6 -2
- package/lib/work/CaseView/FileService.mock.js.map +1 -1
- package/lib/work/Confirmation/Confirmation.stories.d.ts +1 -1
- package/lib/work/Confirmation/Confirmation.stories.d.ts.map +1 -1
- package/lib/work/Confirmation/Confirmation.stories.js +12 -4
- package/lib/work/Confirmation/Confirmation.stories.js.map +1 -1
- package/lib/work/Confirmation/Confirmation.styles.d.ts +2 -0
- package/lib/work/Confirmation/Confirmation.styles.d.ts.map +1 -0
- package/lib/work/Confirmation/Confirmation.styles.js +7 -0
- package/lib/work/Confirmation/Confirmation.styles.js.map +1 -0
- package/lib/work/Details/Details.stories.js +3 -3
- package/lib/work/Details/Details.stories.js.map +1 -1
- package/lib/work/SearchResults/SearchResults.stories.d.ts.map +1 -1
- package/lib/work/SearchResults/SearchResults.stories.js +3 -9
- package/lib/work/SearchResults/SearchResults.stories.js.map +1 -1
- package/lib/work/SearchResults/SearchResults.styles.d.ts +5 -0
- package/lib/work/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/lib/work/SearchResults/SearchResults.styles.js +12 -0
- package/lib/work/SearchResults/SearchResults.styles.js.map +1 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.d.ts +22 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.d.ts.map +1 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.js +36 -0
- package/lib/work/Stakeholders/Stakeholders.mocks.js.map +1 -0
- package/lib/work/Stakeholders/Stakeholders.stories.d.ts +2 -5
- package/lib/work/Stakeholders/Stakeholders.stories.d.ts.map +1 -1
- package/lib/work/Stakeholders/Stakeholders.stories.js +3 -34
- package/lib/work/Stakeholders/Stakeholders.stories.js.map +1 -1
- package/lib/work/Timeline/Timeline.stories.d.ts.map +1 -1
- package/lib/work/Timeline/Timeline.stories.js +2 -2
- package/lib/work/Timeline/Timeline.stories.js.map +1 -1
- package/package.json +16 -16
- package/jsx/social/Email/Email.mocks.jsx.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
|
2
|
+
import { BranchButtonProps } from '@pega/cosmos-react-build';
|
|
2
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
3
4
|
export default _default;
|
|
4
|
-
interface AppHeaderStoryProps {
|
|
5
|
+
interface AppHeaderStoryProps extends BranchButtonProps {
|
|
5
6
|
showPreview: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const appHeader: Story<AppHeaderStoryProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.stories.d.ts","sourceRoot":"","sources":["../../../src/build/AppHeader/AppHeader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"AppHeader.stories.d.ts","sourceRoot":"","sources":["../../../src/build/AppHeader/AppHeader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAa,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;;AAExE,wBAMU;AAEV,UAAU,mBAAoB,SAAQ,iBAAiB;IACrD,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,mBAAmB,CA+EhD,CAAC"}
|
|
@@ -15,19 +15,44 @@ export const appHeader = (args) => (<AppHeader brand={{
|
|
|
15
15
|
search: {
|
|
16
16
|
placeholder: 'Search anything, anywhere…'
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
branch: {
|
|
19
|
+
text: args.text,
|
|
20
|
+
count: args.count,
|
|
21
|
+
variant: args.variant,
|
|
22
|
+
compact: args.compact,
|
|
23
|
+
items: [
|
|
24
|
+
{
|
|
25
|
+
primary: 'Commit to branch',
|
|
26
|
+
id: 'commitToBranch',
|
|
27
|
+
onClick: action('Clicked commitToBranch')
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
primary: 'Merge branch',
|
|
31
|
+
id: 'mergeBranch',
|
|
32
|
+
onClick: action('Clicked mergeBranch')
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
primary: 'View branch',
|
|
36
|
+
id: 'viewBranch',
|
|
37
|
+
onClick: action('Clicked viewBranch')
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
primary: 'Switch branch',
|
|
41
|
+
id: 'switchBranch',
|
|
42
|
+
onClick: action('Clicked switchBranch')
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
primary: 'Add branch',
|
|
46
|
+
id: 'addBranch',
|
|
47
|
+
onClick: action('Clicked addBranch')
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
primary: 'View all branches',
|
|
51
|
+
id: 'viewAllBranches',
|
|
52
|
+
onClick: action('Clicked viewAllBranches')
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
31
56
|
onPreviewClick: args.showPreview ? action('Clicked preview button') : undefined
|
|
32
57
|
}} links={[
|
|
33
58
|
{
|
|
@@ -57,9 +82,17 @@ export const appHeader = (args) => (<AppHeader brand={{
|
|
|
57
82
|
}
|
|
58
83
|
]}/>);
|
|
59
84
|
appHeader.args = {
|
|
85
|
+
variant: undefined,
|
|
86
|
+
text: 'Alpha branch',
|
|
87
|
+
count: null,
|
|
88
|
+
compact: false,
|
|
60
89
|
showPreview: true
|
|
61
90
|
};
|
|
62
91
|
appHeader.argTypes = {
|
|
92
|
+
variant: { options: ['success', 'urgent'], control: { type: 'radio' } },
|
|
93
|
+
text: { control: { type: 'text' } },
|
|
94
|
+
count: { control: { type: 'number' } },
|
|
95
|
+
compact: { control: { type: 'boolean' } },
|
|
63
96
|
showPreview: { control: { type: 'boolean' } }
|
|
64
97
|
};
|
|
65
98
|
//# sourceMappingURL=AppHeader.stories.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppHeader.stories.jsx","sourceRoot":"","sources":["../../../src/build/AppHeader/AppHeader.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"AppHeader.stories.jsx","sourceRoot":"","sources":["../../../src/build/AppHeader/AppHeader.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,SAAS,EAAqB,MAAM,0BAA0B,CAAC;AAExE,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACM,CAAC;AAMV,MAAM,CAAC,MAAM,SAAS,GAA+B,CAAC,IAAyB,EAAE,EAAE,CAAC,CAClF,CAAC,SAAS,CACR,KAAK,CAAC,CAAC;QACL,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,MAAM,CAAC,qBAAqB,CAAC;KACvC,CAAC,CACF,KAAK,CAAC,CAAC;QACL,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,MAAM,EAAE;YACN,WAAW,EAAE,4BAA4B;SAC1C;QACD,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EA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E,gBAAgB;YACtB,OAAO,EAAE,MAAM,CAAC,wBAAwB,CAAC;SAC1C;QACD;YACE,EAAE,EAAE,GAAG;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC;SAClC;KACF,CAAC,EACF,CACH,CAAC;AAEF,SAAS,CAAC,IAAI,GAAG;IACf,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,SAAS,CAAC,QAAQ,GAAG;IACnB,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACvE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACnC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACtC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACzC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CAC9C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { action } from '@storybook/addon-actions';\n\nimport { AppHeader, BranchButtonProps } from '@pega/cosmos-react-build';\n\nexport default {\n title: 'Build/AppHeader',\n component: AppHeader,\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\ninterface AppHeaderStoryProps extends BranchButtonProps {\n showPreview: boolean;\n}\n\nexport const appHeader: Story<AppHeaderStoryProps> = (args: AppHeaderStoryProps) => (\n <AppHeader\n brand={{\n name: 'AppStudioX',\n onClick: action('Clicked application')\n }}\n utils={{\n avatar: { name: 'Lee Ram' },\n search: {\n placeholder: 'Search anything, anywhere…'\n },\n branch: {\n text: args.text,\n count: args.count,\n variant: args.variant,\n compact: args.compact,\n items: [\n {\n primary: 'Commit to branch',\n id: 'commitToBranch',\n onClick: action('Clicked commitToBranch')\n },\n {\n primary: 'Merge branch',\n id: 'mergeBranch',\n onClick: action('Clicked mergeBranch')\n },\n {\n primary: 'View branch',\n id: 'viewBranch',\n onClick: action('Clicked viewBranch')\n },\n {\n primary: 'Switch branch',\n id: 'switchBranch',\n onClick: action('Clicked switchBranch')\n },\n {\n primary: 'Add branch',\n id: 'addBranch',\n onClick: action('Clicked addBranch')\n },\n {\n primary: 'View all branches',\n id: 'viewAllBranches',\n onClick: action('Clicked viewAllBranches')\n }\n ]\n },\n onPreviewClick: args.showPreview ? action('Clicked preview button') : undefined\n }}\n links={[\n {\n id: '1',\n name: 'Applications',\n onClick: action('Clicked Applications')\n },\n {\n id: '2',\n name: 'Shared resources',\n onClick: action('Clicked Shared resources')\n },\n {\n id: '3',\n name: 'Teams',\n onClick: action('Clicked Teams')\n },\n {\n id: '4',\n name: 'AI & Analytics',\n onClick: action('Clicked AI & Analytics')\n },\n {\n id: '5',\n name: 'Deploy',\n onClick: action('Clicked Deploy')\n }\n ]}\n />\n);\n\nappHeader.args = {\n variant: undefined,\n text: 'Alpha branch',\n count: null,\n compact: false,\n showPreview: true\n};\n\nappHeader.argTypes = {\n variant: { options: ['success', 'urgent'], control: { type: 'radio' } },\n text: { control: { type: 'text' } },\n count: { control: { type: 'number' } },\n compact: { control: { type: 'boolean' } },\n showPreview: { control: { type: 'boolean' } }\n};\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MouseEvent } from 'react';
|
|
2
2
|
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import { BranchButtonProps } from '@pega/cosmos-react-build';
|
|
3
4
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
5
|
export default _default;
|
|
5
|
-
export interface AppShellStoryProps {
|
|
6
|
+
export interface AppShellStoryProps extends BranchButtonProps {
|
|
6
7
|
hideNavigation: boolean;
|
|
7
8
|
showBreadcrumbs: boolean;
|
|
8
9
|
showPreview: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.stories.d.ts","sourceRoot":"","sources":["../../../src/build/AppShell/AppShell.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"AppShell.stories.d.ts","sourceRoot":"","sources":["../../../src/build/AppShell/AppShell.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAS/C,OAAO,EAAY,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;;AAUvE,wBAMU;AAEV,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC5D;AAoED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,kBAAkB,CAmLlD,CAAC"}
|
|
@@ -74,19 +74,44 @@ export const AppShellDemo = (args) => {
|
|
|
74
74
|
search: {
|
|
75
75
|
placeholder: 'Search anything, anywhere…'
|
|
76
76
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
branch: {
|
|
78
|
+
text: args.text,
|
|
79
|
+
variant: args.variant,
|
|
80
|
+
count: args.count,
|
|
81
|
+
compact: args.compact,
|
|
82
|
+
items: [
|
|
83
|
+
{
|
|
84
|
+
primary: 'Commit to branch',
|
|
85
|
+
id: 'commitToBranch',
|
|
86
|
+
onClick: action('Clicked commitToBranch')
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
primary: 'Merge branch',
|
|
90
|
+
id: 'mergeBranch',
|
|
91
|
+
onClick: action('Clicked mergeBranch')
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
primary: 'View branch',
|
|
95
|
+
id: 'viewBranch',
|
|
96
|
+
onClick: action('Clicked viewBranch')
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
primary: 'Switch branch',
|
|
100
|
+
id: 'switchBranch',
|
|
101
|
+
onClick: action('Clicked switchBranch')
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
primary: 'Add branch',
|
|
105
|
+
id: 'addBranch',
|
|
106
|
+
onClick: action('Clicked addBranch')
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
primary: 'View all branches',
|
|
110
|
+
id: 'viewAllBranches',
|
|
111
|
+
onClick: action('Clicked viewAllBranches')
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
90
115
|
onPreviewClick: args.showPreview ? args.onPreviewClick : undefined
|
|
91
116
|
},
|
|
92
117
|
links: [
|
|
@@ -182,12 +207,20 @@ export const AppShellDemo = (args) => {
|
|
|
182
207
|
AppShellDemo.args = {
|
|
183
208
|
hideNavigation: false,
|
|
184
209
|
showBreadcrumbs: true,
|
|
210
|
+
variant: undefined,
|
|
211
|
+
text: 'Alpha branch',
|
|
212
|
+
count: null,
|
|
213
|
+
compact: false,
|
|
185
214
|
showPreview: true,
|
|
186
215
|
onPreviewClick: action('Clicked preview button')
|
|
187
216
|
};
|
|
188
217
|
AppShellDemo.argTypes = {
|
|
189
218
|
hideNavigation: { control: { type: 'boolean' } },
|
|
190
219
|
showBreadcrumbs: { control: { type: 'boolean' } },
|
|
220
|
+
variant: { options: ['success', 'urgent'], control: { type: 'radio' } },
|
|
221
|
+
text: { control: { type: 'text' } },
|
|
222
|
+
count: { control: { type: 'number' } },
|
|
223
|
+
compact: { control: { type: 'boolean' } },
|
|
191
224
|
showPreview: { control: { type: 'boolean' } },
|
|
192
225
|
onPreviewClick: { table: { disable: true } }
|
|
193
226
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShell.stories.jsx","sourceRoot":"","sources":["../../../src/build/AppShell/AppShell.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EACL,IAAI,EAEJ,WAAW,EACX,UAAU,IAAI,cAAc,EAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAE1B,eAAe;IACb,KAAK,EAAE,gBAAgB;IACvB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE;QACV,MAAM,EAAE,YAAY;KACrB;CACM,CAAC;AAkBV,MAAM,OAAO,GAAG,CACd,IAAqF,EACrF,EAAE;IACF,MAAM,EACJ,eAAe,EACf,WAAW,EAAE,EACX,IAAI,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,EACrC,EACF,GAAG,IAAI,CAAC;IAET,IAAI,eAAe,EAAE;QACnB,MAAM,IAAI,GAAG,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;QACjE,OAAO,IAAI;YACT,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,CAAC,EAAE,EAAE;gBAEvC,OAAO;oBACL,EAAE,EAAE,KAAK;oBACT,OAAO,EAAE,K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cAAc,EAAE,aAAa,CAAC;wBACrD,CAAC,CAAC,cAAc,CAAC;oBACnB,WAAW,CAAC,UAAU,CAAC,CAAC;iBACzB;YACH,CAAC;YACD,aAAa,EAAE,WAAW;YAC1B,KAAK,EAAE;gBACL;oBACE,KAAK,EAAE,cAAc;oBACrB,EAAE,EAAE,UAAU;iBACf;gBACD;oBACE,KAAK,EAAE,UAAU;oBACjB,EAAE,EAAE,UAAU;iBACf;gBACD;oBACE,KAAK,EAAE,SAAS;oBAChB,EAAE,EAAE,SAAS;iBACd;aACF;YACD,MAAM,EAAE;gBACN,aAAa,EAAE,GAAG,EAAE;oBAClB,gBAAgB,CAAC,EAAE,CAAC,CAAC;oBACrB,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBACxF,CAAC;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC,EAEN;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,IAAI,GAAG;IAClB,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,IAAI;IACrB,WAAW,EAAE,IAAI;IACjB,cAAc,EAAE,MAAM,CAAC,wBAAwB,CAAC;CACjD,CAAC;AAEF,YAAY,CAAC,QAAQ,GAAG;IACtB,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAChD,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACjD,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC7C,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC7C,CAAC","sourcesContent":["import { useState, MouseEvent } from 'react';\nimport { Meta, Story } from '@storybook/react';\nimport { action } from '@storybook/addon-actions';\n\nimport {\n Text,\n StandardTreeProps,\n treeHelpers,\n TabbedPage as TabbedPageComp\n} from '@pega/cosmos-react-core';\nimport { AppShell } from '@pega/cosmos-react-build';\n\nimport {\n appExplorerMenuList,\n branchesMenuList,\n contents,\n recordMenuList,\n treeList\n} from './AppShell.mocks';\n\nexport default {\n title: 'Build/AppShell',\n component: AppShell,\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\nexport interface AppShellStoryProps {\n hideNavigation: boolean;\n showBreadcrumbs: boolean;\n showPreview: boolean;\n onPreviewClick: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\ninterface PageContentProps {\n id: string;\n data: {\n pageTitle: string;\n breadcrumbsPath: string;\n tabs: string[];\n };\n}\n\nconst getPath = (\n args: Pick<AppShellStoryProps, 'showBreadcrumbs'> & { pageContent: PageContentProps }\n) => {\n const {\n showBreadcrumbs,\n pageContent: {\n data: { pageTitle, breadcrumbsPath }\n }\n } = args;\n\n if (showBreadcrumbs) {\n const path = pageTitle === 'Overview' ? 'Home' : breadcrumbsPath;\n return path\n ? path.split(',').map((crumb: string, i) => {\n // FIXME: https://stackoverflow.com/questions/63616486/property-replaceall-does-not-exist-on-type-string\n return {\n id: crumb,\n primary: crumb,\n href: i < 3 ? `#${(crumb as any).replace(/\\s/g, '-')}` : undefined\n };\n })\n : [];\n }\n};\n\nconst TabbedPage: Story<AppShellStoryProps & { pageContent: PageContentProps }> = (\n args: AppShellStoryProps & { pageContent: PageContentProps }\n) => {\n const [currentTabId, setCurrentTabId] = useState('1');\n const [content, setContent] = useState('Tab 1 content');\n const { pageContent, showBreadcrumbs } = args;\n\n return (\n <TabbedPageComp\n a={\n <Text variant='h1' as='div'>\n {content}\n </Text>\n }\n path={getPath({ showBreadcrumbs, pageContent })}\n title={pageContent.data.pageTitle}\n tabs={{\n tabs: pageContent.data.tabs.map((name, i) => {\n const id = `${i + 1}`;\n return { id, name };\n }),\n type: 'horizontal',\n currentTabId,\n onTabClick: id => {\n setCurrentTabId(id);\n setContent(`Tab ${id} content`);\n }\n }}\n />\n );\n};\n\nexport const AppShellDemo: Story<AppShellStoryProps> = (args: AppShellStoryProps) => {\n const [currentNodeId, setCurrentNodeId] = useState<string>('60');\n const [allNodes, setAllNodes] = useState<StandardTreeProps['nodes']>(\n treeHelpers.expandTo(appExplorerMenuList, currentNodeId)\n );\n const [currentDrawer, setCurrentDrawer] = useState('explorer');\n const [currentUtil, setCurrentUtil] = useState('explorer');\n const [pageContent, setPageContent] = useState<PageContentProps>(contents[0]);\n\n const onNodeClick = (nodeId: string, activeDrawerId: string) => {\n const clickedNode = treeHelpers.getNode(allNodes, nodeId);\n\n if (!clickedNode?.nodes) {\n setCurrentUtil(activeDrawerId);\n setCurrentNodeId(nodeId);\n setPageContent(contents.find(content => content.id === clickedNode?.id)!);\n return;\n }\n\n setAllNodes(tree =>\n treeHelpers.mapNode(tree, nodeId, node => {\n return {\n ...node,\n expanded: !node.expanded\n };\n })\n );\n };\n\n 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: () => action('Clicked switchbranch')()\n },\n {\n primary: 'Create branch',\n id: 'createbranch',\n onClick: () => action('Clicked createbranch')()\n }\n ],\n onPreviewClick: args.showPreview ? args.onPreviewClick : undefined\n },\n links: [\n {\n id: '1',\n name: 'Applications',\n onClick: () => action('Clicked Applications')()\n },\n {\n id: '2',\n name: 'Shared resources',\n onClick: () => action('Clicked Shared resources')()\n },\n {\n id: '3',\n name: 'Teams',\n onClick: () => action('Clicked Teams')()\n },\n {\n id: '4',\n name: 'AI & Analytics',\n onClick: () => action('Clicked AI & Analytics')()\n },\n {\n id: '5',\n name: 'Deploy',\n onClick: () => action('Clicked Deploy')()\n }\n ]\n };\n\n return (\n <>\n <AppShell\n main={<TabbedPage {...{ ...args, pageContent }} />}\n appHeader={appHeader}\n hideNav={args.hideNavigation}\n appInfo={{\n text: 'U+ Desk',\n visual: {\n icon: {\n name: 'phone-in-solid',\n bgColor: '#0ac7c8'\n }\n }\n }}\n navigation={{\n nodes: allNodes,\n currentNodeId,\n onNodeClick: id => {\n onNodeClick(id, currentDrawer);\n }\n }}\n utils={{\n onItemClick: id => {\n setCurrentDrawer(id);\n if (id === 'explorer') {\n const appExploreTree = currentNodeId\n ? treeHelpers.expandTo(appExplorerMenuList, currentNodeId)\n : appExplorerMenuList;\n setAllNodes(appExploreTree);\n }\n\n if (id === 'branches') {\n const branchTree = currentNodeId\n ? treeHelpers.expandTo(branchesMenuList, currentNodeId)\n : branchesMenuList;\n setAllNodes(branchTree);\n }\n\n if (id === 'records') {\n const recordTree = currentNodeId\n ? treeHelpers.expandTo(recordMenuList, currentNodeId)\n : recordMenuList;\n setAllNodes(recordTree);\n }\n },\n currentItemId: currentUtil,\n items: [\n {\n label: 'App Explorer',\n id: 'explorer'\n },\n {\n label: 'Branches',\n id: 'branches'\n },\n {\n label: 'Records',\n id: 'records'\n }\n ],\n drawer: {\n onBeforeClose: () => {\n setCurrentDrawer('');\n setAllNodes(currentNodeId ? treeHelpers.expandTo(treeList, currentNodeId) : treeList);\n }\n },\n devMode: true\n }}\n />\n </>\n );\n};\n\nAppShellDemo.args = {\n hideNavigation: false,\n showBreadcrumbs: true,\n showPreview: true,\n onPreviewClick: action('Clicked preview button')\n};\n\nAppShellDemo.argTypes = {\n hideNavigation: { control: { type: 'boolean' } },\n showBreadcrumbs: { control: { type: 'boolean' } },\n showPreview: { control: { type: 'boolean' } },\n onPreviewClick: { table: { disable: true } }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"AppShell.stories.jsx","sourceRoot":"","sources":["../../../src/build/AppShell/AppShell.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAA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O,EAAE,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACvE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;IACnC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACtC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IACzC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC7C,cAAc,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC7C,CAAC","sourcesContent":["import { useState, MouseEvent } from 'react';\nimport { Meta, Story } from '@storybook/react';\nimport { action } from '@storybook/addon-actions';\n\nimport {\n Text,\n StandardTreeProps,\n treeHelpers,\n TabbedPage as TabbedPageComp\n} from '@pega/cosmos-react-core';\nimport { AppShell, BranchButtonProps } from '@pega/cosmos-react-build';\n\nimport {\n appExplorerMenuList,\n branchesMenuList,\n contents,\n recordMenuList,\n treeList\n} from './AppShell.mocks';\n\nexport default {\n title: 'Build/AppShell',\n component: AppShell,\n parameters: {\n layout: 'fullscreen'\n }\n} as Meta;\n\nexport interface AppShellStoryProps extends BranchButtonProps {\n hideNavigation: boolean;\n showBreadcrumbs: boolean;\n showPreview: boolean;\n onPreviewClick: (e: MouseEvent<HTMLButtonElement>) => void;\n}\n\ninterface PageContentProps {\n id: string;\n data: {\n pageTitle: string;\n breadcrumbsPath: string;\n tabs: string[];\n };\n}\n\nconst getPath = (\n args: Pick<AppShellStoryProps, 'showBreadcrumbs'> & { pageContent: PageContentProps }\n) => {\n const {\n showBreadcrumbs,\n pageContent: {\n data: { pageTitle, breadcrumbsPath }\n }\n } = args;\n\n if (showBreadcrumbs) {\n const path = pageTitle === 'Overview' ? 'Home' : breadcrumbsPath;\n return path\n ? path.split(',').map((crumb: string, i) => {\n // FIXME: https://stackoverflow.com/questions/63616486/property-replaceall-does-not-exist-on-type-string\n return {\n id: crumb,\n primary: crumb,\n href: i < 3 ? `#${(crumb as any).replace(/\\s/g, '-')}` : undefined\n };\n })\n : [];\n }\n};\n\nconst TabbedPage: Story<AppShellStoryProps & { pageContent: PageContentProps }> = (\n args: AppShellStoryProps & { pageContent: PageContentProps }\n) => {\n const [currentTabId, setCurrentTabId] = useState('1');\n const [content, setContent] = useState('Tab 1 content');\n const { pageContent, showBreadcrumbs } = args;\n\n return (\n <TabbedPageComp\n a={\n <Text variant='h1' as='div'>\n {content}\n </Text>\n }\n path={getPath({ showBreadcrumbs, pageContent })}\n title={pageContent.data.pageTitle}\n tabs={{\n tabs: pageContent.data.tabs.map((name, i) => {\n const id = `${i + 1}`;\n return { id, name };\n }),\n type: 'horizontal',\n currentTabId,\n onTabClick: id => {\n setCurrentTabId(id);\n setContent(`Tab ${id} content`);\n }\n }}\n />\n );\n};\n\nexport const AppShellDemo: Story<AppShellStoryProps> = (args: AppShellStoryProps) => {\n const [currentNodeId, setCurrentNodeId] = useState<string>('60');\n const [allNodes, setAllNodes] = useState<StandardTreeProps['nodes']>(\n treeHelpers.expandTo(appExplorerMenuList, currentNodeId)\n );\n const [currentDrawer, setCurrentDrawer] = useState('explorer');\n const [currentUtil, setCurrentUtil] = useState('explorer');\n const [pageContent, setPageContent] = useState<PageContentProps>(contents[0]);\n\n const onNodeClick = (nodeId: string, activeDrawerId: string) => {\n const clickedNode = treeHelpers.getNode(allNodes, nodeId);\n\n if (!clickedNode?.nodes) {\n setCurrentUtil(activeDrawerId);\n setCurrentNodeId(nodeId);\n setPageContent(contents.find(content => content.id === clickedNode?.id)!);\n return;\n }\n\n setAllNodes(tree =>\n treeHelpers.mapNode(tree, nodeId, node => {\n return {\n ...node,\n expanded: !node.expanded\n };\n })\n );\n };\n\n const appHeader = {\n brand: {\n name: 'AppStudioX'\n },\n utils: {\n avatar: { name: 'Alan' },\n search: {\n placeholder: 'Search anything, anywhere…'\n },\n branch: {\n text: args.text,\n variant: args.variant,\n count: args.count,\n compact: args.compact,\n items: [\n {\n primary: 'Commit to branch',\n id: 'commitToBranch',\n onClick: action('Clicked commitToBranch')\n },\n {\n primary: 'Merge branch',\n id: 'mergeBranch',\n onClick: action('Clicked mergeBranch')\n },\n {\n primary: 'View branch',\n id: 'viewBranch',\n onClick: action('Clicked viewBranch')\n },\n {\n primary: 'Switch branch',\n id: 'switchBranch',\n onClick: action('Clicked switchBranch')\n },\n {\n primary: 'Add branch',\n id: 'addBranch',\n onClick: action('Clicked addBranch')\n },\n {\n primary: 'View all branches',\n id: 'viewAllBranches',\n onClick: action('Clicked viewAllBranches')\n }\n ]\n },\n onPreviewClick: args.showPreview ? args.onPreviewClick : undefined\n },\n links: [\n {\n id: '1',\n name: 'Applications',\n onClick: () => action('Clicked Applications')()\n },\n {\n id: '2',\n name: 'Shared resources',\n onClick: () => action('Clicked Shared resources')()\n },\n {\n id: '3',\n name: 'Teams',\n onClick: () => action('Clicked Teams')()\n },\n {\n id: '4',\n name: 'AI & Analytics',\n onClick: () => action('Clicked AI & Analytics')()\n },\n {\n id: '5',\n name: 'Deploy',\n onClick: () => action('Clicked Deploy')()\n }\n ]\n };\n\n return (\n <>\n <AppShell\n main={<TabbedPage {...{ ...args, pageContent }} />}\n appHeader={appHeader}\n hideNav={args.hideNavigation}\n appInfo={{\n text: 'U+ Desk',\n visual: {\n icon: {\n name: 'phone-in-solid',\n bgColor: '#0ac7c8'\n }\n }\n }}\n navigation={{\n nodes: allNodes,\n currentNodeId,\n onNodeClick: id => {\n onNodeClick(id, currentDrawer);\n }\n }}\n utils={{\n onItemClick: id => {\n setCurrentDrawer(id);\n if (id === 'explorer') {\n const appExploreTree = currentNodeId\n ? treeHelpers.expandTo(appExplorerMenuList, currentNodeId)\n : appExplorerMenuList;\n setAllNodes(appExploreTree);\n }\n\n if (id === 'branches') {\n const branchTree = currentNodeId\n ? treeHelpers.expandTo(branchesMenuList, currentNodeId)\n : branchesMenuList;\n setAllNodes(branchTree);\n }\n\n if (id === 'records') {\n const recordTree = currentNodeId\n ? treeHelpers.expandTo(recordMenuList, currentNodeId)\n : recordMenuList;\n setAllNodes(recordTree);\n }\n },\n currentItemId: currentUtil,\n items: [\n {\n label: 'App Explorer',\n id: 'explorer'\n },\n {\n label: 'Branches',\n id: 'branches'\n },\n {\n label: 'Records',\n id: 'records'\n }\n ],\n drawer: {\n onBeforeClose: () => {\n setCurrentDrawer('');\n setAllNodes(currentNodeId ? treeHelpers.expandTo(treeList, currentNodeId) : treeList);\n }\n },\n devMode: true\n }}\n />\n </>\n );\n};\n\nAppShellDemo.args = {\n hideNavigation: false,\n showBreadcrumbs: true,\n variant: undefined,\n text: 'Alpha branch',\n count: null,\n compact: false,\n showPreview: true,\n onPreviewClick: action('Clicked preview button')\n};\n\nAppShellDemo.argTypes = {\n hideNavigation: { control: { type: 'boolean' } },\n showBreadcrumbs: { control: { type: 'boolean' } },\n variant: { options: ['success', 'urgent'], control: { type: 'radio' } },\n text: { control: { type: 'text' } },\n count: { control: { type: 'number' } },\n compact: { control: { type: 'boolean' } },\n showPreview: { control: { type: 'boolean' } },\n onPreviewClick: { table: { disable: true } }\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryPicker.mocks.d.ts","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,EAAE,WAAW,EAgDpC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const nodeLibrary = [
|
|
2
|
+
{
|
|
3
|
+
id: 'decision',
|
|
4
|
+
primary: 'Decision',
|
|
5
|
+
name: 'Decision',
|
|
6
|
+
type: {
|
|
7
|
+
color: '#ffaa75',
|
|
8
|
+
icon: 'diamond'
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 'assignment',
|
|
13
|
+
primary: 'Assignment',
|
|
14
|
+
name: 'Assignment',
|
|
15
|
+
type: {
|
|
16
|
+
color: '#20aa50',
|
|
17
|
+
icon: 'clipboard-data'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 'automation',
|
|
22
|
+
primary: 'Automation',
|
|
23
|
+
name: 'Automation',
|
|
24
|
+
type: {
|
|
25
|
+
color: '#7ee791',
|
|
26
|
+
icon: 'polaris'
|
|
27
|
+
},
|
|
28
|
+
items: [
|
|
29
|
+
{
|
|
30
|
+
id: 'pdf',
|
|
31
|
+
primary: 'Generate PDF',
|
|
32
|
+
name: 'Generate PDF',
|
|
33
|
+
type: {
|
|
34
|
+
color: '#0076d1',
|
|
35
|
+
icon: 'polaris'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'sendemail',
|
|
40
|
+
primary: 'Send email',
|
|
41
|
+
name: 'Send email',
|
|
42
|
+
type: {
|
|
43
|
+
color: '#ffaa75',
|
|
44
|
+
icon: 'mail'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
//# sourceMappingURL=LibraryPicker.mocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryPicker.mocks.js","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.mocks.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC;QACE,EAAE,EAAE,UAAU;QACd,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;SAChB;KACF;IACD;QACE,EAAE,EAAE,YAAY;QAChB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,gBAAgB;SACvB;KACF;IACD;QACE,EAAE,EAAE,YAAY;QAChB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,SAAS;SAChB;QACD,KAAK,EAAE;YACL;gBACE,EAAE,EAAE,KAAK;gBACT,OAAO,EAAE,cAAc;gBACvB,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE;oBACJ,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,SAAS;iBAChB;aACF;YACD;gBACE,EAAE,EAAE,WAAW;gBACf,OAAO,EAAE,YAAY;gBACrB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE;oBACJ,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,MAAM;iBACb;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { LibraryItem } from '@pega/cosmos-react-build';\n\nexport interface NodeLibrary extends LibraryItem {\n name: string;\n items?: NodeLibrary[];\n}\n\nexport const nodeLibrary: NodeLibrary[] = [\n {\n id: 'decision',\n primary: 'Decision',\n name: 'Decision',\n type: {\n color: '#ffaa75',\n icon: 'diamond'\n }\n },\n {\n id: 'assignment',\n primary: 'Assignment',\n name: 'Assignment',\n type: {\n color: '#20aa50',\n icon: 'clipboard-data'\n }\n },\n {\n id: 'automation',\n primary: 'Automation',\n name: 'Automation',\n type: {\n color: '#7ee791',\n icon: 'polaris'\n },\n items: [\n {\n id: 'pdf',\n primary: 'Generate PDF',\n name: 'Generate PDF',\n type: {\n color: '#0076d1',\n icon: 'polaris'\n }\n },\n {\n id: 'sendemail',\n primary: 'Send email',\n name: 'Send email',\n type: {\n color: '#ffaa75',\n icon: 'mail'\n }\n }\n ]\n }\n];\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LibraryItem } from '@pega/cosmos-react-build';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<import("@pega/cosmos-react-build").ItemLibraryProps<LibraryItem> & import("@pega/cosmos-react-core").ForwardProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const ColorPicker: () => JSX.Element;
|
|
9
|
+
//# sourceMappingURL=LibraryPicker.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryPicker.stories.d.ts","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.stories.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAe,WAAW,EAAE,MAAM,0BAA0B,CAAC;;;;;AAKpE,wBAGE;AAEF,eAAO,MAAM,WAAW,mBAiDvB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useRef } from '@storybook/addons';
|
|
3
|
+
import { ItemLibrary } from '@pega/cosmos-react-build';
|
|
4
|
+
import { Button, useElement, useOuterEvent } from '@pega/cosmos-react-core';
|
|
5
|
+
import { nodeLibrary } from './LibraryPicker.mocks';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Build/LibraryPicker',
|
|
8
|
+
component: ItemLibrary
|
|
9
|
+
};
|
|
10
|
+
export const ColorPicker = () => {
|
|
11
|
+
const [selectedItem, setSelectedItem] = useState();
|
|
12
|
+
const [showPicker, updatePicker] = useState(false);
|
|
13
|
+
const [popoverEl, setPopoverEl] = useElement();
|
|
14
|
+
const targetRef = useRef(null);
|
|
15
|
+
const closeMenu = () => {
|
|
16
|
+
updatePicker(false);
|
|
17
|
+
};
|
|
18
|
+
const btnClick = () => {
|
|
19
|
+
updatePicker(true);
|
|
20
|
+
};
|
|
21
|
+
const onSelect = (item) => {
|
|
22
|
+
setSelectedItem(item);
|
|
23
|
+
closeMenu();
|
|
24
|
+
};
|
|
25
|
+
const onKeydown = (e) => {
|
|
26
|
+
if (e.key === 'Escape') {
|
|
27
|
+
closeMenu();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
document.addEventListener('keydown', onKeydown);
|
|
32
|
+
return () => {
|
|
33
|
+
document.removeEventListener('keydown', onKeydown);
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
useOuterEvent('mousedown', [popoverEl], closeMenu);
|
|
37
|
+
return (<>
|
|
38
|
+
{selectedItem ? <div>Selected: {selectedItem.primary}</div> : ''}
|
|
39
|
+
<Button onClick={btnClick} ref={targetRef}>
|
|
40
|
+
Select from library
|
|
41
|
+
</Button>
|
|
42
|
+
<ItemLibrary items={nodeLibrary} show={showPicker} target={targetRef && targetRef.current} ref={setPopoverEl} onClick={onSelect}/>
|
|
43
|
+
</>);
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=LibraryPicker.stories.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LibraryPicker.stories.jsx","sourceRoot":"","sources":["../../../src/build/ItemLibrary/LibraryPicker.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAe,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,eAAe;IACb,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GA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OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CACxC;;MACF,EAAE,MAAM,CACR;MAAA,CAAC,WAAW,CACV,KAAK,CAAC,CAAC,WAAW,CAAC,CACnB,IAAI,CAAC,CAAC,UAAU,CAAC,CACjB,MAAM,CAAC,CAAC,SAAS,IAAK,SAAS,CAAC,OAAuB,CAAC,CACxD,GAAG,CAAC,CAAC,YAAY,CAAC,CAClB,OAAO,CAAC,CAAC,QAAQ,CAAC,EAEtB;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { useRef } from '@storybook/addons';\n\nimport { ItemLibrary, LibraryItem } from '@pega/cosmos-react-build';\nimport { Button, useElement, useOuterEvent } from '@pega/cosmos-react-core';\n\nimport { nodeLibrary } from './LibraryPicker.mocks';\n\nexport default {\n title: 'Build/LibraryPicker',\n component: ItemLibrary\n};\n\nexport const ColorPicker = () => {\n const [selectedItem, setSelectedItem] = useState<LibraryItem>();\n const [showPicker, updatePicker] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>();\n const targetRef = useRef<HTMLButtonElement | null>(null);\n\n const closeMenu = () => {\n updatePicker(false);\n };\n\n const btnClick = () => {\n updatePicker(true);\n };\n\n const onSelect = (item: LibraryItem) => {\n setSelectedItem(item);\n closeMenu();\n };\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n closeMenu();\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, []);\n\n useOuterEvent('mousedown', [popoverEl], closeMenu);\n\n return (\n <>\n {selectedItem ? <div>Selected: {selectedItem.primary}</div> : ''}\n <Button onClick={btnClick} ref={targetRef}>\n Select from library\n </Button>\n <ItemLibrary\n items={nodeLibrary}\n show={showPicker}\n target={targetRef && (targetRef.current as HTMLElement)}\n ref={setPopoverEl}\n onClick={onSelect}\n />\n </>\n );\n};\n"]}
|