@pega/cosmos-react-demos 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jsx/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/jsx/core/Avatar/Avatar.stories.jsx +2 -2
- package/jsx/core/Avatar/Avatar.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.map +1 -1
- package/jsx/core/Banner/Banner.stories.jsx +1 -39
- package/jsx/core/Banner/Banner.stories.jsx.map +1 -1
- package/jsx/core/Button/Button.stories.d.ts.map +1 -1
- package/jsx/core/Button/Button.stories.jsx +3 -3
- package/jsx/core/Button/Button.stories.jsx.map +1 -1
- package/jsx/core/Configuration/Configuration.stories.jsx +1 -1
- 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 +0 -7
- package/jsx/core/Form/Form.stories.d.ts.map +1 -1
- package/jsx/core/Form/Form.stories.jsx +3 -137
- 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/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 +0 -1
- package/jsx/core/Menu/Menu.stories.d.ts.map +1 -1
- package/jsx/core/Menu/Menu.stories.jsx +2 -4
- 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.jsx +1 -1
- 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/Rating/Rating.stories.d.ts +4 -1
- package/jsx/core/Rating/Rating.stories.d.ts.map +1 -1
- package/jsx/core/Rating/Rating.stories.jsx +3 -3
- package/jsx/core/Rating/Rating.stories.jsx.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
- package/jsx/core/Sentiment/Sentiment.stories.jsx +6 -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/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/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/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/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/core/Avatar/Avatar.stories.d.ts.map +1 -1
- package/lib/core/Avatar/Avatar.stories.js +2 -2
- package/lib/core/Avatar/Avatar.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.map +1 -1
- package/lib/core/Banner/Banner.stories.js +4 -33
- package/lib/core/Banner/Banner.stories.js.map +1 -1
- package/lib/core/Button/Button.stories.d.ts.map +1 -1
- package/lib/core/Button/Button.stories.js +2 -2
- package/lib/core/Button/Button.stories.js.map +1 -1
- package/lib/core/Configuration/Configuration.stories.js +1 -1
- 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 +0 -7
- package/lib/core/Form/Form.stories.d.ts.map +1 -1
- package/lib/core/Form/Form.stories.js +3 -95
- 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/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 +0 -1
- package/lib/core/Menu/Menu.stories.d.ts.map +1 -1
- package/lib/core/Menu/Menu.stories.js +2 -4
- 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.js +1 -1
- 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/Rating/Rating.stories.d.ts +4 -1
- package/lib/core/Rating/Rating.stories.d.ts.map +1 -1
- package/lib/core/Rating/Rating.stories.js +3 -3
- package/lib/core/Rating/Rating.stories.js.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.d.ts.map +1 -1
- package/lib/core/Sentiment/Sentiment.stories.js +6 -6
- 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/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/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/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/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 +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAU,WAAW,EAAS,MAAM,yBAAyB,CAAC;;AAErE,wBAaU;AAEV,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,WAAW,CAE5C,CAAC;AAWF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAE7C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,WAAW,CAShD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,WAAW,CAEzC,CAAC;AAUF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,WAAW,CAE3C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Avatar } from '@pega/cosmos-react-core';
|
|
1
|
+
import { Avatar, icons } from '@pega/cosmos-react-core';
|
|
2
2
|
export default {
|
|
3
3
|
title: 'Core/Avatar',
|
|
4
4
|
component: Avatar,
|
|
@@ -36,7 +36,7 @@ IconAvatar.args = {
|
|
|
36
36
|
icon: 'headset'
|
|
37
37
|
};
|
|
38
38
|
IconAvatar.argTypes = {
|
|
39
|
-
icon: { control: { type: '
|
|
39
|
+
icon: { options: icons, control: { type: 'select', icons: true } }
|
|
40
40
|
};
|
|
41
41
|
export const StatusAvatar = (args) => {
|
|
42
42
|
return <Avatar shape={args.shape} size={args.size} name={args.name} status={args.status}/>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.stories.jsx","sourceRoot":"","sources":["../../../src/core/Avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.stories.jsx","sourceRoot":"","sources":["../../../src/core/Avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErE,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE;QACJ,KAAK,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IACtB,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CACxE,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Avatar, AvatarProps, icons } from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/Avatar',\n component: Avatar,\n args: {\n shape: 'circle',\n size: 'm',\n name: 'John Doe'\n },\n argTypes: {\n shape: { options: ['circle', 'squircle'], control: { type: 'select' } },\n size: { options: ['s', 'm', 'l'], control: { type: 'select' } },\n name: { control: { type: 'text' } }\n }\n} as Meta;\n\nexport const DefaultAvatar: Story<AvatarProps> = (args: AvatarProps) => {\n return <Avatar shape={args.shape} size={args.size} name={args.name} imageSrc={args.imageSrc} />;\n};\n\nDefaultAvatar.args = {\n name: 'Pegasystems',\n imageSrc: 'https://www.pega.com/sites/default/files/media/images/2018-12/Pega.com-og.png'\n};\n\nDefaultAvatar.argTypes = {\n imageSrc: { control: { type: 'text' } }\n};\n\nexport const TextOnlyAvatar: Story<AvatarProps> = (args: AvatarProps) => {\n return <Avatar shape={args.shape} size={args.size} name={args.name} />;\n};\n\nexport const TransparentAvatar: Story<AvatarProps> = (args: AvatarProps) => {\n return (\n <Avatar\n shape={args.shape}\n size={args.size}\n name={args.name}\n imageSrc='https://socialistmodernism.com/wp-content/uploads/2017/07/placeholder-image.png'\n />\n );\n};\n\nexport const IconAvatar: Story<AvatarProps> = (args: AvatarProps) => {\n return <Avatar shape={args.shape} size={args.size} name={args.name} icon={args.icon} />;\n};\n\nIconAvatar.args = {\n icon: 'headset'\n};\n\nIconAvatar.argTypes = {\n icon: { options: icons, control: { type: 'select', icons: true } }\n};\n\nexport const StatusAvatar: Story<AvatarProps> = (args: AvatarProps) => {\n return <Avatar shape={args.shape} size={args.size} name={args.name} status={args.status} />;\n};\n\nStatusAvatar.args = {\n status: 'active'\n};\n\nStatusAvatar.argTypes = {\n status: { options: ['active', undefined], control: { type: 'select' } }\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DemoFormField {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
info: string;
|
|
6
|
+
value: string;
|
|
7
|
+
validator: (value: string) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const demoFields: {
|
|
10
|
+
name: string;
|
|
11
|
+
label: string;
|
|
12
|
+
info: string;
|
|
13
|
+
value: string;
|
|
14
|
+
validator: (value: string) => boolean;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const formActions: JSX.Element;
|
|
17
|
+
export declare const fieldReducer: (fields: DemoFormField[], inputEl: any) => DemoFormField[];
|
|
18
|
+
//# sourceMappingURL=Banner.mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/Banner/Banner.mocks.tsx"],"names":[],"mappings":";AAEA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC;AAED,eAAO,MAAM,UAAU;;;;;uBAMA,MAAM;GAgB5B,CAAC;AAEF,eAAO,MAAM,WAAW,aASvB,CAAC;AAGF,eAAO,MAAM,YAAY,WAAY,aAAa,EAAE,WAAW,GAAG,oBAOjE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Button } from '@pega/cosmos-react-core';
|
|
2
|
+
export const demoFields = [
|
|
3
|
+
{
|
|
4
|
+
name: 'field-1',
|
|
5
|
+
label: 'Field 1',
|
|
6
|
+
info: 'Hint: type exact label text above',
|
|
7
|
+
value: '',
|
|
8
|
+
validator: (value) => value === 'Field 1'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'field-2',
|
|
12
|
+
label: 'Field 2',
|
|
13
|
+
info: 'Hint: type exact label text above',
|
|
14
|
+
value: '',
|
|
15
|
+
validator: (value) => value === 'Field 2'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'field-3',
|
|
19
|
+
label: 'Field 3',
|
|
20
|
+
info: 'Hint: type exact label text above',
|
|
21
|
+
value: '',
|
|
22
|
+
validator: (value) => value === 'Field 3'
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
export const formActions = (<>
|
|
26
|
+
<Button name='Cancel' variant='secondary'>
|
|
27
|
+
Cancel
|
|
28
|
+
</Button>
|
|
29
|
+
<Button name='Submit' type='submit' variant='primary'>
|
|
30
|
+
Submit
|
|
31
|
+
</Button>
|
|
32
|
+
</>);
|
|
33
|
+
export const fieldReducer = (fields, inputEl) => {
|
|
34
|
+
return fields.map(field => {
|
|
35
|
+
if (inputEl.name === field.name) {
|
|
36
|
+
field.value = inputEl.value;
|
|
37
|
+
}
|
|
38
|
+
return field;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Banner.mocks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.mocks.jsx","sourceRoot":"","sources":["../../../src/core/Banner/Banner.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAUjD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,mCAAmC;QACzC,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS;KAClD;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,mCAAmC;QACzC,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS;KAClD;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,mCAAmC;QACzC,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS;KAClD;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,EACE;IAAA,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CACvC;;IACF,EAAE,MAAM,CACR;IAAA,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CACnD;;IACF,EAAE,MAAM,CACV;EAAA,GAAG,CACJ,CAAC;AAGF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAuB,EAAE,OAAY,EAAE,EAAE;IACpE,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACxB,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE;YAC/B,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;SAC7B;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Button } from '@pega/cosmos-react-core';\n\nexport interface DemoFormField {\n name: string;\n label: string;\n info: string;\n value: string;\n validator: (value: string) => boolean;\n}\n\nexport const demoFields = [\n {\n name: 'field-1',\n label: 'Field 1',\n info: 'Hint: type exact label text above',\n value: '',\n validator: (value: string) => value === 'Field 1'\n },\n {\n name: 'field-2',\n label: 'Field 2',\n info: 'Hint: type exact label text above',\n value: '',\n validator: (value: string) => value === 'Field 2'\n },\n {\n name: 'field-3',\n label: 'Field 3',\n info: 'Hint: type exact label text above',\n value: '',\n validator: (value: string) => value === 'Field 3'\n }\n];\n\nexport const formActions = (\n <>\n <Button name='Cancel' variant='secondary'>\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary'>\n Submit\n </Button>\n </>\n);\n\n// Handles setting of state for all fields\nexport const fieldReducer = (fields: DemoFormField[], inputEl: any) => {\n return fields.map(field => {\n if (inputEl.name === field.name) {\n field.value = inputEl.value;\n }\n return field;\n });\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;
|
|
1
|
+
{"version":3,"file":"Banner.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;;AASxC,wBAGU;AAEV,eAAO,MAAM,aAAa,mBAiBzB,CAAC;AAEF,eAAO,MAAM,WAAW,mBAcvB,CAAC;AAEF,eAAO,MAAM,aAAa,mBAazB,CAAC;AAEF,eAAO,MAAM,UAAU,mBAkBtB,CAAC;AAMF,eAAO,MAAM,WAAW,mBA6DvB,CAAC;AAKF,eAAO,MAAM,eAAe;;;;;CAiB3B,CAAC;AASF,eAAO,MAAM,eAAe;;;;;CAsB3B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { useState, useCallback, useReducer } from 'react';
|
|
|
2
2
|
import { Banner, Button, Form, Input, Link } from '@pega/cosmos-react-core';
|
|
3
3
|
import { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';
|
|
4
4
|
import { CaseViewDemo } from '@pega/cosmos-react-demos/lib/work/CaseView/CaseView.stories';
|
|
5
|
+
import { demoFields, fieldReducer, formActions } from './Banner.mocks';
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Core/Banner',
|
|
7
8
|
component: Banner
|
|
@@ -32,45 +33,6 @@ export const InfoBanner = () => {
|
|
|
32
33
|
]}/>)}
|
|
33
34
|
</>);
|
|
34
35
|
};
|
|
35
|
-
const demoFields = [
|
|
36
|
-
{
|
|
37
|
-
name: 'field-1',
|
|
38
|
-
label: 'Field 1',
|
|
39
|
-
info: 'Hint: type exact label text above',
|
|
40
|
-
value: '',
|
|
41
|
-
validator: (value) => value === 'Field 1'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'field-2',
|
|
45
|
-
label: 'Field 2',
|
|
46
|
-
info: 'Hint: type exact label text above',
|
|
47
|
-
value: '',
|
|
48
|
-
validator: (value) => value === 'Field 2'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'field-3',
|
|
52
|
-
label: 'Field 3',
|
|
53
|
-
info: 'Hint: type exact label text above',
|
|
54
|
-
value: '',
|
|
55
|
-
validator: (value) => value === 'Field 3'
|
|
56
|
-
}
|
|
57
|
-
];
|
|
58
|
-
const formActions = (<>
|
|
59
|
-
<Button name='Cancel' variant='secondary'>
|
|
60
|
-
Cancel
|
|
61
|
-
</Button>
|
|
62
|
-
<Button name='Submit' type='submit' variant='primary'>
|
|
63
|
-
Submit
|
|
64
|
-
</Button>
|
|
65
|
-
</>);
|
|
66
|
-
const fieldReducer = (fields, inputEl) => {
|
|
67
|
-
return fields.map(field => {
|
|
68
|
-
if (inputEl.name === field.name) {
|
|
69
|
-
field.value = inputEl.value;
|
|
70
|
-
}
|
|
71
|
-
return field;
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
36
|
export const ShownInForm = () => {
|
|
75
37
|
const [fields, setField] = useReducer(fieldReducer, demoFields);
|
|
76
38
|
const [banner, setBanner] = useState();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.stories.jsx","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,M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B,CACvC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAClC,OAAO,CAAC,SAAS,CACjB,QAAQ,CAAC,CAAC,CAAC,gBAAgB,EAAE,wBAAwB,CAAC,CAAC,CACvD,MAAM,CAAC,CACL,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAC/C;;cACF,EAAE,IAAI,CAAC,CACR,EACD,CACH,CACF,EACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,UAAU,GAAG;IAC3B,MAAM,EAAE,YAAY;CACrB,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useCallback, FormEvent, useReducer } from 'react';\n\nimport { Banner, Button, Form, Input, Link } from '@pega/cosmos-react-core';\nimport { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';\nimport { CaseViewDemo } from '@pega/cosmos-react-demos/lib/work/CaseView/CaseView.stories';\n\nexport default {\n title: 'Core/Banner',\n component: Banner\n} as Meta;\n\nexport const SuccessBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='success'\n variant='success'\n onDismiss={() => setShowBanner(false)}\n heading='2 items uploaded successfully'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n />\n )}\n </>\n );\n};\n\nexport const ErrorBanner = () => {\n return (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n action={\n <div>\n <Button variant='link'>Try again</Button>\n </div>\n }\n messages={['Your request failed to send!', 'Please review your request and try again']}\n />\n );\n};\n\nexport const WarningBanner = () => {\n return (\n <Banner\n id='warning'\n variant='warning'\n action={\n <div>\n <Button variant='link'>Why this matters</Button>\n </div>\n }\n messages={['Your submission is missing some important documents.']}\n />\n );\n};\n\nexport const InfoBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='info'\n variant='info'\n onDismiss={() => setShowBanner(false)}\n messages={[\n 'US-123456 is currently being modified by Jane Smith and may not be edited simultaneously.'\n ]}\n />\n )}\n </>\n );\n};\n\n// -----------------------------------------------------------------------------\n// Form story\n// -----------------------------------------------------------------------------\ninterface DemoFormField {\n name: string;\n label: string;\n info: string;\n value: string;\n validator: (value: string) => boolean;\n}\n\nconst demoFields = [\n {\n name: 'field-1',\n label: 'Field 1',\n info: 'Hint: type exact label text above',\n value: '',\n validator: (value: string) => value === 'Field 1'\n },\n {\n name: 'field-2',\n label: 'Field 2',\n info: 'Hint: type exact label text above',\n value: '',\n validator: (value: string) => value === 'Field 2'\n },\n {\n name: 'field-3',\n label: 'Field 3',\n info: 'Hint: type exact label text above',\n value: '',\n validator: (value: string) => value === 'Field 3'\n }\n];\n\nconst formActions = (\n <>\n <Button name='Cancel' variant='secondary'>\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary'>\n Submit\n </Button>\n </>\n);\n\n// Handles setting of state for all fields\nconst fieldReducer = (fields: DemoFormField[], inputEl: any) => {\n return fields.map(field => {\n if (inputEl.name === field.name) {\n field.value = inputEl.value;\n }\n return field;\n });\n};\n\nexport const ShownInForm = () => {\n const [fields, setField] = useReducer(fieldReducer, demoFields);\n const [banner, setBanner] = useState<any>();\n\n const onSubmit = useCallback((e: FormEvent) => {\n e.preventDefault();\n const errorFields = fields.filter(field => !field.validator(field.value));\n let heading = 'Wow, great job!';\n let variant: 'success' | 'urgent' = 'success';\n let messages = fields.map(f => `${f.name} was typed perfectly`);\n let bannerAction;\n\n if (errorFields.length > 0) {\n heading = \"I'm sorry you're having trouble\";\n variant = 'urgent';\n messages = errorFields.map(f => `${f.name} was not typed correctly`);\n bannerAction = (\n <Link href='https://community.pega.com/support' target='_blank'>\n Visit Pega support for assistance\n </Link>\n );\n }\n\n setBanner(\n <Banner\n {...{\n heading,\n variant,\n messages,\n id: 'formBanner',\n action: bannerAction,\n onDismiss() {\n setBanner(false);\n }\n }}\n />\n );\n }, []);\n\n return (\n <Form\n banners={banner}\n actions={formActions}\n onSubmit={onSubmit}\n style={{ margin: 'auto', padding: '2.5rem', maxWidth: '37.5rem' }}\n >\n {fields.map((field: DemoFormField) => {\n return (\n <Input\n key={field.name}\n autoComplete='off'\n name={field.name}\n label={field.label}\n info={field.info}\n value={field.value}\n onChange={(e: InputEvent) => setField(e.target as any)}\n />\n );\n })}\n </Form>\n );\n};\n\n// -----------------------------------------------------------------------------\n// CaseView story\n// -----------------------------------------------------------------------------\nexport const ShownInCaseView = () => {\n const [hasBanner, setHasBanner] = useState(true);\n return (\n <CaseViewDemo\n banners={\n hasBanner && (\n <Banner\n id='case-view-error'\n heading='Waring'\n onDismiss={() => setHasBanner(false)}\n variant='warning'\n messages={['Your submission is missing some important documents.']}\n />\n )\n }\n />\n );\n};\n\nShownInCaseView.parameters = {\n layout: 'fullscreen'\n};\n\n// -----------------------------------------------------------------------------\n// AppShell story\n// -----------------------------------------------------------------------------\nexport const ShownInAppShell = () => {\n const [hasBanner, setHasBanner] = useState([]);\n return (\n <AppShellDemo\n banners={\n hasBanner && (\n <Banner\n id='app-shell-banner-success'\n heading='2 items uploaded successfully'\n onDismiss={() => setHasBanner([])}\n variant='success'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n action={\n <Link target='_blank' href='https://www.pega.com'>\n Link Here!\n </Link>\n }\n />\n )\n }\n />\n );\n};\n\nShownInAppShell.parameters = {\n layout: 'fullscreen'\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Banner.stories.jsx","sourceRoot":"","sources":["../../../src/core/Banner/Banner.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE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O,CACL,CAAC,YAAY,CACX,OAAO,CAAC,CACN,SAAS,IAAI,CACX,CAAC,MAAM,CACL,EAAE,CAAC,0BAA0B,CAC7B,OAAO,CAAC,+BAA+B,CACvC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAClC,OAAO,CAAC,SAAS,CACjB,QAAQ,CAAC,CAAC,CAAC,gBAAgB,EAAE,wBAAwB,CAAC,CAAC,CACvD,MAAM,CAAC,CACL,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAC/C;;cACF,EAAE,IAAI,CAAC,CACR,EACD,CACH,CACF,EACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,UAAU,GAAG;IAC3B,MAAM,EAAE,YAAY;CACrB,CAAC","sourcesContent":["import { Meta } from '@storybook/react';\nimport { useState, useCallback, FormEvent, useReducer } from 'react';\n\nimport { Banner, Button, Form, Input, Link } from '@pega/cosmos-react-core';\nimport { AppShellDemo } from '@pega/cosmos-react-demos/lib/core/AppShell/AppShell.stories';\nimport { CaseViewDemo } from '@pega/cosmos-react-demos/lib/work/CaseView/CaseView.stories';\n\nimport { demoFields, DemoFormField, fieldReducer, formActions } from './Banner.mocks';\n\nexport default {\n title: 'Core/Banner',\n component: Banner\n} as Meta;\n\nexport const SuccessBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='success'\n variant='success'\n onDismiss={() => setShowBanner(false)}\n heading='2 items uploaded successfully'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n />\n )}\n </>\n );\n};\n\nexport const ErrorBanner = () => {\n return (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n action={\n <div>\n <Button variant='link'>Try again</Button>\n </div>\n }\n messages={['Your request failed to send!', 'Please review your request and try again']}\n />\n );\n};\n\nexport const WarningBanner = () => {\n return (\n <Banner\n id='warning'\n variant='warning'\n action={\n <div>\n <Button variant='link'>Why this matters</Button>\n </div>\n }\n messages={['Your submission is missing some important documents.']}\n />\n );\n};\n\nexport const InfoBanner = () => {\n const [showBanner, setShowBanner] = useState(true);\n\n return (\n <>\n {!showBanner && <Button onClick={() => setShowBanner(true)}>Open banner</Button>}\n {showBanner && (\n <Banner\n id='info'\n variant='info'\n onDismiss={() => setShowBanner(false)}\n messages={[\n 'US-123456 is currently being modified by Jane Smith and may not be edited simultaneously.'\n ]}\n />\n )}\n </>\n );\n};\n\n// -----------------------------------------------------------------------------\n// Form story\n// -----------------------------------------------------------------------------\n\nexport const ShownInForm = () => {\n const [fields, setField] = useReducer(fieldReducer, demoFields);\n const [banner, setBanner] = useState<any>();\n\n const onSubmit = useCallback((e: FormEvent) => {\n e.preventDefault();\n const errorFields = fields.filter(field => !field.validator(field.value));\n let heading = 'Wow, great job!';\n let variant: 'success' | 'urgent' = 'success';\n let messages = fields.map(f => `${f.name} was typed perfectly`);\n let bannerAction;\n\n if (errorFields.length > 0) {\n heading = \"I'm sorry you're having trouble\";\n variant = 'urgent';\n messages = errorFields.map(f => `${f.name} was not typed correctly`);\n bannerAction = (\n <Link href='https://community.pega.com/support' target='_blank'>\n Visit Pega support for assistance\n </Link>\n );\n }\n\n setBanner(\n <Banner\n {...{\n heading,\n variant,\n messages,\n id: 'formBanner',\n action: bannerAction,\n onDismiss() {\n setBanner(false);\n }\n }}\n />\n );\n }, []);\n\n return (\n <Form\n banners={banner}\n actions={formActions}\n onSubmit={onSubmit}\n style={{ margin: 'auto', padding: '2.5rem', maxWidth: '37.5rem' }}\n >\n {fields.map((field: DemoFormField) => {\n return (\n <Input\n key={field.name}\n autoComplete='off'\n name={field.name}\n label={field.label}\n info={field.info}\n value={field.value}\n onChange={(e: InputEvent) => setField(e.target as any)}\n />\n );\n })}\n </Form>\n );\n};\n\n// -----------------------------------------------------------------------------\n// CaseView story\n// -----------------------------------------------------------------------------\nexport const ShownInCaseView = () => {\n const [hasBanner, setHasBanner] = useState(true);\n return (\n <CaseViewDemo\n banners={\n hasBanner && (\n <Banner\n id='case-view-error'\n heading='Waring'\n onDismiss={() => setHasBanner(false)}\n variant='warning'\n messages={['Your submission is missing some important documents.']}\n />\n )\n }\n />\n );\n};\n\nShownInCaseView.parameters = {\n layout: 'fullscreen'\n};\n\n// -----------------------------------------------------------------------------\n// AppShell story\n// -----------------------------------------------------------------------------\nexport const ShownInAppShell = () => {\n const [hasBanner, setHasBanner] = useState([]);\n return (\n <AppShellDemo\n banners={\n hasBanner && (\n <Banner\n id='app-shell-banner-success'\n heading='2 items uploaded successfully'\n onDismiss={() => setHasBanner([])}\n variant='success'\n messages={['pega_data.json', 'business-earnings.xlsx']}\n action={\n <Link target='_blank' href='https://www.pega.com'>\n Link Here!\n </Link>\n }\n />\n )\n }\n />\n );\n};\n\nShownInAppShell.parameters = {\n layout: 'fullscreen'\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAU,WAAW,
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAU,WAAW,EAA4B,MAAM,yBAAyB,CAAC;;AAMxF,wBAMU;AAEV,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAeF,eAAO,MAAM,eAAe,mBAoB3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,WAAW,CAoB1C,CAAC;AAUF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC;AAYF,eAAO,MAAM,YAAY,mBAMxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,WAAW,CAM7C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Icon, registerIcon } from '@pega/cosmos-react-core';
|
|
1
|
+
import { Button, Flex, Icon, registerIcon } from '@pega/cosmos-react-core';
|
|
2
2
|
import * as plusIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/plus.icon';
|
|
3
3
|
import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
|
|
4
4
|
registerIcon(plusIcon);
|
|
@@ -45,7 +45,7 @@ export const DisabledButtons = () => {
|
|
|
45
45
|
</>);
|
|
46
46
|
};
|
|
47
47
|
export const IconButtons = ({ compact }) => {
|
|
48
|
-
return (
|
|
48
|
+
return (<Flex container={{ alignItems: 'center' }}>
|
|
49
49
|
<Button variant='primary' label='Icon button primary' icon compact={compact}>
|
|
50
50
|
<Icon name='plus'/>
|
|
51
51
|
</Button>
|
|
@@ -61,7 +61,7 @@ export const IconButtons = ({ compact }) => {
|
|
|
61
61
|
<Button variant='text' label='Icon button text' icon compact={compact}>
|
|
62
62
|
<Icon name='plus'/>
|
|
63
63
|
</Button>
|
|
64
|
-
|
|
64
|
+
</Flex>);
|
|
65
65
|
};
|
|
66
66
|
IconButtons.args = {
|
|
67
67
|
compact: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.jsx","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.stories.jsx","sourceRoot":"","sources":["../../../src/core/Button/Button.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC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,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,IAAiB,EAAE,EAAE;IACtE,OAAO,CACL,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,CAChE;;IACF,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;CACpC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport { Button, ButtonProps, Flex, Icon, registerIcon } 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> = ({ compact }: ButtonProps) => {\n return (\n <Flex container={{ alignItems: 'center' }}>\n <Button variant='primary' label='Icon button primary' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='secondary' label='Icon button secondary' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='simple' label='Icon button simple' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='link' label='Icon button link' icon compact={compact}>\n <Icon name='plus' />\n </Button>\n <Button variant='text' label='Icon button text' icon compact={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"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Button, Configuration, MenuButton, resetToInitial } from '@pega/cosmos-react-core';
|
|
4
|
-
import { FormContent } from '@pega/cosmos-react-demos/lib/core/Form/Form.
|
|
4
|
+
import { FormContent } from '@pega/cosmos-react-demos/lib/core/Form/Form.mocks';
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Core/Configuration',
|
|
7
7
|
component: Configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.stories.jsx","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,cAAc,EAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Configuration.stories.jsx","sourceRoot":"","sources":["../../../src/core/Configuration/Configuration.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,cAAc,EAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAEhF,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,aAAa;CACjB,CAAC;AAEV,MAAM,CAAC,MAAM,UAAU,GAA2C,CAAC,IAElE,EAAE,EAAE;IACH,MAAM,MAAM,GAAyC;QACnD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,WAAW,EAAE,SAAS;iBACvB;aACF;YACD,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,eAAe,EAAE,CAAC;iBACnB;gBACD,cAAc,EAAE;oBACd,kBAAkB,EAAE,WAAW;oBAC/B,cAAc,EAAE,QAAQ;iBACzB;gBACD,KAAK,E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,CAClB;QAAA,EAAE,aAAa,CACjB;MAAA,EAAE,cAAc,CAClB;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC,CAAC;IAE5E,OAAO,CACL,EACE;MAAA,CAAC,UAAU,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,EACpE;MAAA,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAC7B;QAAA,CAAC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,EACzE;MAAA,EAAE,aAAa,CACjB;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport { useState } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Button,\n Configuration,\n MenuButton,\n resetToInitial,\n DefaultSettableTheme\n} from '@pega/cosmos-react-core';\nimport { FormContent } from '@pega/cosmos-react-demos/lib/core/Form/Form.mocks';\n\nexport default {\n title: 'Core/Configuration',\n component: Configuration\n} as Meta;\n\nexport const ThemedForm: Story<{ theme: 'default' | 'theme1' }> = (args: {\n theme: 'default' | 'theme1';\n}) => {\n const themes: Record<string, DefaultSettableTheme> = {\n default: {},\n theme1: {\n base: {\n palette: {\n interactive: '#AC75F0'\n }\n },\n components: {\n button: {\n 'border-radius': 1\n },\n 'form-control': {\n 'background-color': '#80008033',\n 'border-color': 'purple'\n },\n input: {\n height: '50px'\n }\n }\n }\n };\n\n return (\n <Configuration theme={themes[args.theme]}>\n <FormContent cols={1} showActions={false} />\n </Configuration>\n );\n};\n\nThemedForm.args = {\n theme: 'default'\n};\n\nThemedForm.argTypes = {\n theme: { options: ['default', 'theme1'], control: { type: 'select' } }\n};\n\nconst buttonStyles = {\n width: '100%'\n};\n\nconst StyledFieldset = styled.fieldset`\n padding: 1rem 5%;\n margin: 1rem 0;\n`;\n\nconst BoldSpan = styled.span`\n font-weight: bold;\n`;\n\nconst 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\nexport const ThemingHierarchy = () => {\n const [redOrOrange, setRedOrOrange] = useState(true);\n const [greenOrPurple, setGreenOrPurple] = useState(true);\n\n return (\n <StyledFieldset style={{ margin: 0, textAlign: 'center' }}>\n <legend>Initial Theme</legend>\n <Button style={buttonStyles} variant='primary'>\n Base interactive\n </Button>\n <StyledFieldset>\n <legend>Override Interactive to</legend>\n <Configuration\n theme={{\n base: {\n palette: {\n interactive: redOrOrange ? 'red' : 'darkorange'\n }\n }\n }}\n >\n <Button\n style={buttonStyles}\n variant='primary'\n onClick={() => setRedOrOrange(val => !val)}\n >\n <FlipFlop flipFlop={redOrOrange} first='Red' second='Orange' />\n </Button>\n <StyledFieldset>\n <legend>Override Button Primary BG to</legend>\n <Configuration\n theme={{\n components: {\n button: { color: greenOrPurple ? 'green' : 'purple' }\n }\n }}\n >\n <Button\n style={buttonStyles}\n variant='primary'\n onClick={() => setGreenOrPurple(val => !val)}\n >\n <FlipFlop flipFlop={greenOrPurple} first='Green' second='Purple' />\n </Button>\n <Button style={{ ...buttonStyles, marginTop: '1rem' }} variant='secondary'>\n Secondary still inherits interactive\n </Button>\n <StyledFieldset>\n <legend>Reset Button BG</legend>\n <Configuration\n theme={{\n components: { button: { color: resetToInitial } }\n }}\n >\n <Button style={buttonStyles} variant='primary'>\n Inherited from interactive\n </Button>\n <StyledFieldset>\n <legend>Reset Interactive</legend>\n <Configuration theme={{ base: { palette: { interactive: resetToInitial } } }}>\n <Button style={buttonStyles} variant='primary'>\n Inherited from base\n </Button>\n </Configuration>\n </StyledFieldset>\n </Configuration>\n </StyledFieldset>\n </Configuration>\n </StyledFieldset>\n </Configuration>\n </StyledFieldset>\n </StyledFieldset>\n );\n};\n\nexport const OverridableActionMenu = () => {\n const sharedActions = [{ id: '1', primary: 'Action 1', onClick: () => {} }];\n\n return (\n <>\n <MenuButton text='Cosmos MenuButton' menu={{ items: sharedActions }} />\n <Configuration overrideMap={{}}>\n <MenuButton text='Mock PIMC MenuButton' menu={{ items: sharedActions }} />\n </Configuration>\n </>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeDisplay.stories.jsx","sourceRoot":"","sources":["../../../src/core/DateTime/DateTimeDisplay.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAEf,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAEjC,eAAe;IACb,KAAK,EAAE,eAAe;CACf,CAAC;AAEV,MAAM,CAAC,MAAM,mBAAmB,GAAgC,CAAC,IAA0B,EAAE,EAAE;IAC7F,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAG,CAAC;AACzF,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IACtC,gBAAgB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;CACzE,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAgC,CAAC,IAA0B,EAAE,EAAE;IAC7F,OAAO,CACL,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAClB,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACtB,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CACpB,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE,IAAI,IAAI,EAAE;IACjB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,OAAO;IACf,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,OAAO,EAAE;QACP,OAAO,EAAE;YACP,MAAM;YACN,UAAU;YACV,MAAM;YACN,MAAM;YACN,OAAO;YACP,MAAM;YACN,WAAW;YACX,aAAa;YACb,UAAU;SACX;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC5B;IACD,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAC9E,WAAW,EAAE;QACX,OAAO,EAAE,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC;QAC5B,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;KAClC;CACF,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport {\n DateTimeDisplay,\n DateTimeDisplayProps,\n DurationDisplay,\n DurationDisplayProps\n} from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/DateTime'\n} as Meta;\n\nexport const DurationDisplayDemo: Story<DurationDisplayProps> = (args: DurationDisplayProps) => {\n return <DurationDisplay value={args.value} significantUnits={args.significantUnits} />;\n};\n\nDurationDisplayDemo.args = {\n value: 462553844,\n significantUnits: 4\n};\n\nDurationDisplayDemo.argTypes = {\n value: { control: { type: 'number' } },\n significantUnits: { options: [1, 2, 3, 4], control: { type: 'select' } }\n};\n\nexport const DateTimeDisplayDemo: Story<DateTimeDisplayProps> = (args: DateTimeDisplayProps) => {\n return (\n <DateTimeDisplay\n value={args.value}\n variant={args.variant}\n format={args.format}\n clockFormat={args.clockFormat}\n />\n );\n};\n\nDateTimeDisplayDemo.args = {\n value: new Date(),\n variant: 'date',\n format: 'short',\n clockFormat: undefined\n};\n\nDateTimeDisplayDemo.argTypes = {\n variant: {\n options: [\n 'date',\n 'datetime',\n 'time',\n 'week',\n 'month',\n 'year',\n 'monthyear',\n 'quarteryear',\n 'relative'\n ],\n control: { type: 'select' }\n },\n format: { options: ['short', 'long', 'numeric'], control: { type: 'select' } },\n clockFormat: {\n options: [undefined, 12, 24],\n control: { type: 'inline-radio' }\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"DateTimeDisplay.stories.jsx","sourceRoot":"","sources":["../../../src/core/DateTime/DateTimeDisplay.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EAEf,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAEjC,eAAe;IACb,KAAK,EAAE,eAAe;CACf,CAAC;AAEV,MAAM,CAAC,MAAM,mBAAmB,GAAgC,CAAC,IAA0B,EAAE,EAAE;IAC7F,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAG,CAAC;AACzF,CAAC,CAAC;AAEF,mBAAmB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,CAAC;CACpB,CAAC;AAEF,mBAAmB,CAAC,QAAQ,GAAG;IAC7B,KAAK,EAAE,EAAE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AAc,EAAE;KAClC;CACF,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\n\nimport {\n DateTimeDisplay,\n DateTimeDisplayProps,\n DurationDisplay,\n DurationDisplayProps\n} from '@pega/cosmos-react-core';\n\nexport default {\n title: 'Core/DateTime'\n} as Meta;\n\nexport const DurationDisplayDemo: Story<DurationDisplayProps> = (args: DurationDisplayProps) => {\n return <DurationDisplay value={args.value} significantUnits={args.significantUnits} />;\n};\n\nDurationDisplayDemo.args = {\n value: 462553844,\n significantUnits: 4\n};\n\nDurationDisplayDemo.argTypes = {\n value: { control: { type: 'number' } },\n significantUnits: { options: [1, 2, 3, 4], control: { type: 'select' } }\n};\n\nexport const DateTimeDisplayDemo: Story<DateTimeDisplayProps> = (args: DateTimeDisplayProps) => {\n return (\n <DateTimeDisplay\n value={args.value}\n variant={args.variant}\n format={args.format}\n clockFormat={args.clockFormat}\n />\n );\n};\n\nDateTimeDisplayDemo.args = {\n value: new Date(),\n variant: 'date',\n format: 'short',\n clockFormat: undefined\n};\n\nDateTimeDisplayDemo.argTypes = {\n value: { control: { type: 'date' } },\n variant: {\n options: [\n 'date',\n 'datetime',\n 'time',\n 'week',\n 'month',\n 'year',\n 'monthyear',\n 'quarteryear',\n 'relative'\n ],\n control: { type: 'select' }\n },\n format: { options: ['short', 'long', 'numeric'], control: { type: 'select' } },\n clockFormat: {\n options: [undefined, 12, 24],\n control: { type: 'inline-radio' }\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandCollapse.styles.d.ts","sourceRoot":"","sources":["../../../src/core/ExpandCollapse/ExpandCollapse.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;
|
|
1
|
+
{"version":3,"file":"ExpandCollapse.styles.d.ts","sourceRoot":"","sources":["../../../src/core/ExpandCollapse/ExpandCollapse.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;SAcvB,CAAC"}
|
|
@@ -6,6 +6,11 @@ export const StyledRegion = styled.div(({ innerRegion, theme }) => {
|
|
|
6
6
|
padding: calc(4 * ${theme.base.spacing});
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: center;
|
|
9
|
+
|
|
10
|
+
button {
|
|
11
|
+
height: max-content;
|
|
12
|
+
align-self: center;
|
|
13
|
+
}
|
|
9
14
|
`;
|
|
10
15
|
});
|
|
11
16
|
StyledRegion.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandCollapse.styles.js","sourceRoot":"","sources":["../../../src/core/ExpandCollapse/ExpandCollapse.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA4B,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3F,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CACpC,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAC5D;wBACmB,KAAK,CAAC,IAAI,CAAC,OAAO
|
|
1
|
+
{"version":3,"file":"ExpandCollapse.styles.js","sourceRoot":"","sources":["../../../src/core/ExpandCollapse/ExpandCollapse.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA4B,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3F,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CACpC,WAAW,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAC5D;wBACmB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;GAQvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledRegion = styled.div<{ innerRegion?: boolean }>(({ innerRegion, theme }) => {\n return css`\n background-color: ${theme.base.palette[\n innerRegion ? 'primary-background' : 'secondary-background'\n ]};\n padding: calc(4 * ${theme.base.spacing});\n display: flex;\n justify-content: center;\n\n button {\n height: max-content;\n align-self: center;\n }\n `;\n});\n\nStyledRegion.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldGroupListItemProps } from '@pega/cosmos-react-core';
|
|
3
|
+
declare type FieldGroupReducerPayload = {
|
|
4
|
+
action: 'add';
|
|
5
|
+
} | {
|
|
6
|
+
action: 'delete';
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
export interface FieldMeta {
|
|
10
|
+
label: string;
|
|
11
|
+
type: 'text' | 'date' | 'file' | 'select' | 'textarea';
|
|
12
|
+
}
|
|
13
|
+
export interface GroupMeta {
|
|
14
|
+
label: string;
|
|
15
|
+
fields: FieldMeta[];
|
|
16
|
+
}
|
|
17
|
+
export declare const fieldGroupReducer: (groupMeta: GroupMeta, FieldRenderer: (props: FieldMeta) => JSX.Element | null) => (items: FieldGroupListItemProps[], payload: FieldGroupReducerPayload) => FieldGroupListItemProps[];
|
|
18
|
+
export declare const DemoFieldRenderer: ({ label, type }: FieldMeta) => JSX.Element | null;
|
|
19
|
+
export declare const demoGroupMeta: GroupMeta;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=FieldGroupList.mocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldGroupList.mocks.d.ts","sourceRoot":"","sources":["../../../src/core/FieldGroup/FieldGroupList.mocks.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,uBAAuB,EAAS,MAAM,yBAAyB,CAAC;AAEpF,aAAK,wBAAwB,GACzB;IACE,MAAM,EAAE,KAAK,CAAC;CACf,GACD;IACE,MAAM,EAAE,QAAQ,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEN,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;CACxD;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,cAChB,SAAS,yBAAyB,SAAS,KAAK,WAAW,GAAG,IAAI,aAErE,uBAAuB,EAAE,WACvB,wBAAwB,KAChC,uBAAuB,EAoBzB,CAAC;AAEJ,eAAO,MAAM,iBAAiB,oBAAqB,SAAS,uBAM3D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAQ3B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createUID, Input } from '@pega/cosmos-react-core';
|
|
2
|
+
export const fieldGroupReducer = (groupMeta, FieldRenderer) => (items, payload) => {
|
|
3
|
+
switch (payload.action) {
|
|
4
|
+
case 'add':
|
|
5
|
+
return [
|
|
6
|
+
...items,
|
|
7
|
+
{
|
|
8
|
+
name: `${groupMeta.label} ${items.length + 1}`,
|
|
9
|
+
id: createUID(),
|
|
10
|
+
children: groupMeta.fields.map(props => <FieldRenderer {...props} key={props.label}/>)
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
case 'delete':
|
|
14
|
+
return items
|
|
15
|
+
.filter(group => group.id !== payload.id)
|
|
16
|
+
.map((group, i) => ({ ...group, name: `${groupMeta.label} ${i + 1}` }));
|
|
17
|
+
default:
|
|
18
|
+
return items;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export const DemoFieldRenderer = ({ label, type }) => {
|
|
22
|
+
if (type === 'text') {
|
|
23
|
+
return <Input label={label}/>;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
export const demoGroupMeta = {
|
|
28
|
+
label: 'Applicant',
|
|
29
|
+
fields: [
|
|
30
|
+
{
|
|
31
|
+
type: 'text',
|
|
32
|
+
label: 'Applicant name'
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=FieldGroupList.mocks.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldGroupList.mocks.jsx","sourceRoot":"","sources":["../../../src/core/FieldGroup/FieldGroupList.mocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA2B,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAqBpF,MAAM,CAAC,MAAM,iBAAiB,GAC5B,CAAC,SAAoB,EAAE,aAAuD,EAAE,EAAE,CAClF,CACE,KAAgC,EAChC,OAAiC,EACN,EAAE;IAC7B,QAAQ,OAAO,CAAC,MAAM,EAAE;QACtB,KAAK,KAAK;YACR,OAAO;gBACL,GAAG,KAAK;gBACR;oBACE,IAAI,EAAE,GAAG,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC9C,EAAE,EAAE,SAAS,EAAE;oBACf,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAG,CAAC;iBACxF;aACF,CAAC;QAEJ,KAAK,QAAQ;YACX,OAAO,KAAK;iBACT,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC;iBACxC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAE5E;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAa,EAAE,EAAE;IAC9D,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC;KAChC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,gBAAgB;SACxB;KACF;CACF,CAAC","sourcesContent":["import { createUID, FieldGroupListItemProps, Input } from '@pega/cosmos-react-core';\n\ntype FieldGroupReducerPayload =\n | {\n action: 'add';\n }\n | {\n action: 'delete';\n id: string;\n };\n\nexport interface FieldMeta {\n label: string;\n type: 'text' | 'date' | 'file' | 'select' | 'textarea';\n}\n\nexport interface GroupMeta {\n label: string;\n fields: FieldMeta[];\n}\n\nexport const fieldGroupReducer =\n (groupMeta: GroupMeta, FieldRenderer: (props: FieldMeta) => JSX.Element | null) =>\n (\n items: FieldGroupListItemProps[],\n payload: FieldGroupReducerPayload\n ): FieldGroupListItemProps[] => {\n switch (payload.action) {\n case 'add':\n return [\n ...items,\n {\n name: `${groupMeta.label} ${items.length + 1}`,\n id: createUID(),\n children: groupMeta.fields.map(props => <FieldRenderer {...props} key={props.label} />)\n }\n ];\n\n case 'delete':\n return items\n .filter(group => group.id !== payload.id)\n .map((group, i) => ({ ...group, name: `${groupMeta.label} ${i + 1}` }));\n\n default:\n return items;\n }\n };\n\nexport const DemoFieldRenderer = ({ label, type }: FieldMeta) => {\n if (type === 'text') {\n return <Input label={label} />;\n }\n\n return null;\n};\n\nexport const demoGroupMeta: GroupMeta = {\n label: 'Applicant',\n fields: [\n {\n type: 'text',\n label: 'Applicant name'\n }\n ]\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroupList.stories.d.ts","sourceRoot":"","sources":["../../../src/core/FieldGroup/FieldGroupList.stories.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"FieldGroupList.stories.d.ts","sourceRoot":"","sources":["../../../src/core/FieldGroup/FieldGroupList.stories.tsx"],"names":[],"mappings":";;;;;AAyBA,wBAGE;AAiDF,eAAO,MAAM,YAAY,mBAiDxB,CAAC;AAiCF,eAAO,MAAM,aAAa,mBAkDzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mBAwB9B,CAAC"}
|
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
import { useReducer } from 'react';
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
|
3
3
|
import { Button, createUID, DateInput, FieldGroupList, FileInput, Form, Input, Select, Option, Text, TextArea } from '@pega/cosmos-react-core';
|
|
4
|
+
import { DemoFieldRenderer, demoGroupMeta, fieldGroupReducer } from './FieldGroupList.mocks';
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Core/FieldGroupList',
|
|
6
7
|
component: FieldGroupList
|
|
7
8
|
};
|
|
8
|
-
const fieldGroupReducer = (groupMeta, FieldRenderer) => (items, payload) => {
|
|
9
|
-
switch (payload.action) {
|
|
10
|
-
case 'add':
|
|
11
|
-
return [
|
|
12
|
-
...items,
|
|
13
|
-
{
|
|
14
|
-
name: `${groupMeta.label} ${items.length + 1}`,
|
|
15
|
-
id: createUID(),
|
|
16
|
-
children: groupMeta.fields.map(props => <FieldRenderer {...props} key={props.label}/>)
|
|
17
|
-
}
|
|
18
|
-
];
|
|
19
|
-
case 'delete':
|
|
20
|
-
return items
|
|
21
|
-
.filter(group => group.id !== payload.id)
|
|
22
|
-
.map((group, i) => ({ ...group, name: `${groupMeta.label} ${i + 1}` }));
|
|
23
|
-
default:
|
|
24
|
-
return items;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
9
|
const ExpensesFieldRenderer = ({ label, type }) => {
|
|
28
10
|
if (type === 'text') {
|
|
29
11
|
return <Input label={label}/>;
|
|
@@ -151,21 +133,6 @@ export const InsuranceDemo = () => {
|
|
|
151
133
|
}}/>
|
|
152
134
|
</Form>);
|
|
153
135
|
};
|
|
154
|
-
const DemoFieldRenderer = ({ label, type }) => {
|
|
155
|
-
if (type === 'text') {
|
|
156
|
-
return <Input label={label}/>;
|
|
157
|
-
}
|
|
158
|
-
return null;
|
|
159
|
-
};
|
|
160
|
-
const demoGroupMeta = {
|
|
161
|
-
label: 'Applicant',
|
|
162
|
-
fields: [
|
|
163
|
-
{
|
|
164
|
-
type: 'text',
|
|
165
|
-
label: 'Applicant name'
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
};
|
|
169
136
|
export const FieldGroupListDemo = () => {
|
|
170
137
|
const [state, dispatch] = useReducer(fieldGroupReducer(demoGroupMeta, DemoFieldRenderer), undefined, () => [
|
|
171
138
|
{
|