@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Form.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;AAe/C,wBAcU;AACV,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAE/C,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,cAAc,CAE/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,cAAc,CAEjD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CA+D5E,CAAC;AAUF,UAAU,qBAAsB,SAAQ,cAAc;IACpD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,qBAAqB,CAwBzD,CAAC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FileInputDemo } from '@pega/cosmos-react-demos/lib/core/File/FileInput.stories';
|
|
5
|
-
import { FilterableSingleSelect as ComboboxFilterableStory } from '@pega/cosmos-react-demos/lib/core/ComboBox/ComboBox.stories';
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Banner, Button, Configuration, Flex, Form, FormField, Input } from '@pega/cosmos-react-core';
|
|
3
|
+
import { FormContent } from './Form.mocks';
|
|
6
4
|
export default {
|
|
7
5
|
title: 'Core/Form',
|
|
8
6
|
component: Form,
|
|
9
7
|
subcomponents: {
|
|
10
8
|
FormField
|
|
11
9
|
},
|
|
12
|
-
includeStories: ['OneColumnForm', 'TwoColumnForm', 'ThreeColumnForm', 'SimpleFormDemo'],
|
|
13
10
|
args: {
|
|
14
11
|
heading: 'Form demo',
|
|
15
12
|
description: ''
|
|
@@ -19,138 +16,6 @@ export default {
|
|
|
19
16
|
description: { control: { type: 'text' } }
|
|
20
17
|
}
|
|
21
18
|
};
|
|
22
|
-
const initFields = () => {
|
|
23
|
-
const common = { value: undefined, status: undefined };
|
|
24
|
-
return [
|
|
25
|
-
{
|
|
26
|
-
...common,
|
|
27
|
-
name: 'name',
|
|
28
|
-
required: true,
|
|
29
|
-
error: 'Please enter first and last name',
|
|
30
|
-
validator() {
|
|
31
|
-
if (!this.value)
|
|
32
|
-
return false;
|
|
33
|
-
return /^[a-z]+\s[a-z]+$/i.test(this.value);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
...common,
|
|
38
|
-
name: 'email',
|
|
39
|
-
required: true,
|
|
40
|
-
error: 'Enter a @pega.com address',
|
|
41
|
-
validator() {
|
|
42
|
-
if (!this.value)
|
|
43
|
-
return false;
|
|
44
|
-
return /^\S+@pega\.com$/.test(this.value);
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
...common,
|
|
49
|
-
name: 'notes',
|
|
50
|
-
required: true,
|
|
51
|
-
help: 'See how fast you can type 20 characters…go',
|
|
52
|
-
error: 'You need to tell us more than 20 characters',
|
|
53
|
-
validator() {
|
|
54
|
-
if (!this.value)
|
|
55
|
-
return false;
|
|
56
|
-
return this.value.length >= 20;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
];
|
|
60
|
-
};
|
|
61
|
-
const fieldReducer = (fields, { target, type }) => {
|
|
62
|
-
return fields.map(field => {
|
|
63
|
-
if (field.name === target.name) {
|
|
64
|
-
field.value = target.value;
|
|
65
|
-
if (type === 'blur' || field.status === 'error') {
|
|
66
|
-
if ((field.required || field.value) && !field.validator()) {
|
|
67
|
-
field.status = 'error';
|
|
68
|
-
field.info = field.error;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
field.status = undefined;
|
|
72
|
-
field.info = field.help;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return field;
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
export const FormContent = ({ cols, heading, description, showActions }) => {
|
|
80
|
-
const editorRef = useRef(null);
|
|
81
|
-
const [fields, setField] = useReducer(fieldReducer, undefined, initFields);
|
|
82
|
-
const { push } = useContext(ToasterContext);
|
|
83
|
-
const name = fields.find(field => field.name === 'name');
|
|
84
|
-
const email = fields.find(field => field.name === 'email');
|
|
85
|
-
const notes = fields.find(field => field.name === 'notes');
|
|
86
|
-
if (!name || !email || !notes)
|
|
87
|
-
return null;
|
|
88
|
-
const canSubmit = fields.every(field => field.value && field.validator());
|
|
89
|
-
const actions = (<>
|
|
90
|
-
<Button name='Cancel' variant='secondary' onClick={() => {
|
|
91
|
-
push({ content: 'Form cancelled!' });
|
|
92
|
-
}}>
|
|
93
|
-
Cancel
|
|
94
|
-
</Button>
|
|
95
|
-
<Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>
|
|
96
|
-
Submit
|
|
97
|
-
</Button>
|
|
98
|
-
</>);
|
|
99
|
-
const onImageAdded = (image, id) => {
|
|
100
|
-
const src = URL.createObjectURL(image);
|
|
101
|
-
editorRef.current?.appendImage({ src, alt: image.name }, id);
|
|
102
|
-
};
|
|
103
|
-
return (<Form actions={showActions ? actions : undefined} description={description} heading={heading} onSubmit={(e) => {
|
|
104
|
-
e.preventDefault();
|
|
105
|
-
push({ content: 'Form submitted!' });
|
|
106
|
-
}} style={{ margin: 'auto', maxWidth: '37.5rem' }}>
|
|
107
|
-
<Grid container={{ gap: 1, cols: `repeat(${cols}, minmax(0, 1fr))` }}>
|
|
108
|
-
<Input name='name' label='Name' value={name.value} required={name.required} status={name.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
|
|
109
|
-
|
|
110
|
-
<Input name='email' value={email.value} type='email' label='Email' required={email.required} status={email.status} info='some help text here' onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })} autoComplete='off'/>
|
|
111
|
-
|
|
112
|
-
<Grid item={{ colStartEnd: '1/-1' }}>
|
|
113
|
-
<CheckboxGroup name='visited' label='Places you have worked'>
|
|
114
|
-
{['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (<Checkbox key={office} label={office} onChange={(e) => setField({ ...e })}/>))}
|
|
115
|
-
</CheckboxGroup>
|
|
116
|
-
</Grid>
|
|
117
|
-
|
|
118
|
-
<Grid item={{ colStartEnd: '1/-1' }}>
|
|
119
|
-
<RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>
|
|
120
|
-
{['Yes', "No… no I don't"].map(option => (<RadioButton key={option} label={option} onChange={(e) => setField({ ...e })}/>))}
|
|
121
|
-
</RadioButtonGroup>
|
|
122
|
-
</Grid>
|
|
123
|
-
|
|
124
|
-
<Select label='What would you like to eat?' info='FYI: options are limited'>
|
|
125
|
-
<Option>choose meal…</Option>
|
|
126
|
-
<Option>Pizza</Option>
|
|
127
|
-
<Option>Sandwich</Option>
|
|
128
|
-
<Option>Salad</Option>
|
|
129
|
-
</Select>
|
|
130
|
-
|
|
131
|
-
<Grid item={{ colStartEnd: '1/-1' }}>
|
|
132
|
-
<TextArea name='notes' required={notes.required} label='Meeting Notes' status={notes.status} info={notes.info || notes.help} onChange={(e) => setField({ ...e })} onBlur={(e) => setField({ ...e })}/>
|
|
133
|
-
</Grid>
|
|
134
|
-
|
|
135
|
-
<Grid item={{ colStartEnd: '1/-1' }}>
|
|
136
|
-
<RichTextEditor label='Detailed meeting notes' info='The rich text editor can be used in forms, comments, and documents' toolbar={[
|
|
137
|
-
'inline-styling',
|
|
138
|
-
'headers',
|
|
139
|
-
'tables',
|
|
140
|
-
'links',
|
|
141
|
-
'images',
|
|
142
|
-
'lists',
|
|
143
|
-
'cut-copy-paste',
|
|
144
|
-
'indentation'
|
|
145
|
-
]} onImageAdded={onImageAdded} ref={editorRef}/>
|
|
146
|
-
</Grid>
|
|
147
|
-
<Grid item={{ colStartEnd: '1/-1' }}>
|
|
148
|
-
<FileInputDemo />
|
|
149
|
-
</Grid>
|
|
150
|
-
<ComboboxFilterableStory />
|
|
151
|
-
</Grid>
|
|
152
|
-
</Form>);
|
|
153
|
-
};
|
|
154
19
|
export const OneColumnForm = (args) => {
|
|
155
20
|
return <FormContent cols={1} heading={args.heading} description={args.description} showActions/>;
|
|
156
21
|
};
|
|
@@ -193,4 +58,45 @@ SimpleFormDemo.args = {
|
|
|
193
58
|
SimpleFormDemo.argTypes = {
|
|
194
59
|
withBanners: { control: { type: 'boolean' } }
|
|
195
60
|
};
|
|
61
|
+
export const ConfigurableForm = (args) => {
|
|
62
|
+
return (<Configuration theme={{
|
|
63
|
+
components: {
|
|
64
|
+
'form-control': {
|
|
65
|
+
'foreground-color': args.foregroundColor,
|
|
66
|
+
'background-color': args.backgroundColor,
|
|
67
|
+
'border-color': args.borderColor,
|
|
68
|
+
'border-width': args.borderWidth,
|
|
69
|
+
'border-radius': args.borderRadius,
|
|
70
|
+
':hover': {
|
|
71
|
+
'border-color': args.hoverBorderColor
|
|
72
|
+
},
|
|
73
|
+
':focus': {
|
|
74
|
+
'border-color': args.focusBorderColor
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}}>
|
|
79
|
+
<FormContent cols={2} showActions/>
|
|
80
|
+
</Configuration>);
|
|
81
|
+
};
|
|
82
|
+
ConfigurableForm.args = {
|
|
83
|
+
foregroundColor: '#000000',
|
|
84
|
+
backgroundColor: '#ffffff',
|
|
85
|
+
borderColor: '#939393',
|
|
86
|
+
borderWidth: '0.0625rem',
|
|
87
|
+
borderRadius: 0.5,
|
|
88
|
+
hoverBorderColor: '#3f3f3f',
|
|
89
|
+
focusBorderColor: 'transparent'
|
|
90
|
+
};
|
|
91
|
+
ConfigurableForm.argTypes = {
|
|
92
|
+
foregroundColor: { control: { type: 'color' } },
|
|
93
|
+
backgroundColor: { control: { type: 'color' } },
|
|
94
|
+
borderColor: { control: { type: 'color' } },
|
|
95
|
+
borderWidth: { control: { type: 'text' } },
|
|
96
|
+
borderRadius: { control: { type: 'number' } },
|
|
97
|
+
hoverBorderColor: { control: { type: 'color' } },
|
|
98
|
+
focusBorderColor: { control: { type: 'color' } },
|
|
99
|
+
heading: { table: { disable: true } },
|
|
100
|
+
description: { table: { disable: true } }
|
|
101
|
+
};
|
|
196
102
|
//# sourceMappingURL=Form.stories.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.stories.jsx","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAIV,MAAM,EACN,UAAU,EACV,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,IAAI,cAAc,EAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,IAAI,EAEJ,SAAS,EACT,IAAI,EACJ,K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C;IAErD,OAAO,CACL,CAAC,IAAI,CACH,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAC/C,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CACtB,WAAW,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAC9B,QAAQ,CAAC,CAAC,CAAC,CAAY,EAAE,EAAE;YACzB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,UAAU,CAAC,UAAU,CAAC,CAAC;YACvB,aAAa,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC,CAAC,CAEF;MAAA,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CACnD;QAAA,CAAC,KAAK,CACJ,KAAK,CAAC,MAAM,CACZ,IAAI,CAAC,uBAAuB,CAC5B,QAAQ,CACR,KAAK,CAAC,CAAC,UAAU,CAAC,CAClB,QAAQ,CAAC,CAAC,CAAC,CAAgC,EAAE,EAAE;YAC7C,UAAU,CAAC,EAAE,CAAC,CAAC;YACf,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,EAEN;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,IAAI,GAAG;IACpB,WAAW,EAAE,KAAK;CACnB,CAAC;AAEF,cAAc,CAAC,QAAQ,GAAG;IACxB,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;CAC9C,CAAC","sourcesContent":["import { Meta, Story } from '@storybook/react';\nimport {\n useReducer,\n ChangeEvent,\n FocusEvent,\n FormEvent,\n useRef,\n useContext,\n useState\n} from 'react';\n\nimport {\n Editor as RichTextEditor,\n EditorState as RichTextEditorState\n} from '@pega/cosmos-react-rte';\nimport {\n Banner,\n Button,\n Checkbox,\n CheckboxGroup,\n Flex,\n Form,\n FormControlProps,\n FormField,\n Grid,\n Input,\n RadioButton,\n RadioButtonGroup,\n Select,\n Option,\n TextArea,\n ToasterContext\n} from '@pega/cosmos-react-core';\nimport { FileInputDemo } from '@pega/cosmos-react-demos/lib/core/File/FileInput.stories';\nimport { FilterableSingleSelect as ComboboxFilterableStory } from '@pega/cosmos-react-demos/lib/core/ComboBox/ComboBox.stories';\n\nexport default {\n title: 'Core/Form',\n component: Form,\n subcomponents: {\n FormField\n },\n includeStories: ['OneColumnForm', 'TwoColumnForm', 'ThreeColumnForm', 'SimpleFormDemo'],\n args: {\n heading: 'Form demo',\n description: ''\n },\n argTypes: {\n heading: { control: { type: 'text' } },\n description: { control: { type: 'text' } }\n }\n} as Meta;\n\ninterface Field extends FormControlProps {\n help?: string;\n error?: string;\n validator: (this: Field) => boolean;\n}\n\n// Get initial field properties\nconst initFields = (): Field[] => {\n const common = { value: undefined, status: undefined };\n return [\n {\n ...common,\n name: 'name',\n required: true,\n error: 'Please enter first and last name',\n validator() {\n if (!this.value) return false;\n return /^[a-z]+\\s[a-z]+$/i.test(this.value);\n }\n },\n {\n ...common,\n name: 'email',\n required: true,\n error: 'Enter a @pega.com address',\n validator() {\n if (!this.value) return false;\n return /^\\S+@pega\\.com$/.test(this.value);\n }\n },\n {\n ...common,\n name: 'notes',\n required: true,\n help: 'See how fast you can type 20 characters…go',\n error: 'You need to tell us more than 20 characters',\n validator() {\n if (!this.value) return false;\n return this.value.length >= 20;\n }\n }\n ];\n};\n\n// Handles setting of state for all fields\nconst fieldReducer = (\n fields: Field[],\n {\n target,\n type\n }:\n | ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n | FocusEvent<HTMLInputElement | HTMLTextAreaElement>\n) => {\n return fields.map(field => {\n if (field.name === target.name) {\n field.value = target.value;\n if (type === 'blur' || field.status === 'error') {\n if ((field.required || field.value) && !field.validator()) {\n field.status = 'error';\n field.info = field.error;\n } else {\n field.status = undefined;\n field.info = field.help;\n }\n }\n }\n return field;\n });\n};\n\nexport const FormContent = ({\n cols,\n heading,\n description,\n showActions\n}: {\n cols: number;\n showActions: boolean;\n heading?: string;\n description?: string;\n}) => {\n const editorRef = useRef<RichTextEditorState>(null);\n const [fields, setField] = useReducer(fieldReducer, undefined, initFields);\n const { push } = useContext(ToasterContext);\n\n const name = fields.find(field => field.name === 'name');\n const email = fields.find(field => field.name === 'email');\n const notes = fields.find(field => field.name === 'notes');\n\n if (!name || !email || !notes) return null;\n\n const canSubmit = fields.every(field => field.value && field.validator());\n\n const actions = (\n <>\n <Button\n name='Cancel'\n variant='secondary'\n onClick={() => {\n push({ content: 'Form cancelled!' });\n }}\n >\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary' disabled={!canSubmit}>\n Submit\n </Button>\n </>\n );\n\n const onImageAdded = (image: File, id: string) => {\n const src = URL.createObjectURL(image);\n editorRef.current?.appendImage({ src, alt: image.name }, id);\n };\n return (\n <Form\n actions={showActions ? actions : undefined}\n description={description}\n heading={heading}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n push({ content: 'Form submitted!' });\n }}\n style={{ margin: 'auto', maxWidth: '37.5rem' }}\n >\n <Grid container={{ gap: 1, cols: `repeat(${cols}, minmax(0, 1fr))` }}>\n <Input\n name='name'\n label='Name'\n value={name.value}\n required={name.required}\n status={name.status}\n info='some help text here'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <Input\n name='email'\n value={email.value}\n type='email'\n label='Email'\n required={email.required}\n status={email.status}\n info='some help text here'\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n autoComplete='off'\n />\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <CheckboxGroup name='visited' label='Places you have worked'>\n {['Cambridge', 'Krakow', 'Hyderabad', 'Bangalore'].map(office => (\n <Checkbox\n key={office}\n label={office}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n />\n ))}\n </CheckboxGroup>\n </Grid>\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <RadioButtonGroup name='meetings' label='Do you enjoy early morning meetings?'>\n {['Yes', \"No… no I don't\"].map(option => (\n <RadioButton\n key={option}\n label={option}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setField({ ...e })}\n />\n ))}\n </RadioButtonGroup>\n </Grid>\n\n <Select label='What would you like to eat?' info='FYI: options are limited'>\n <Option>choose meal…</Option>\n <Option>Pizza</Option>\n <Option>Sandwich</Option>\n <Option>Salad</Option>\n </Select>\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <TextArea\n name='notes'\n required={notes.required}\n label='Meeting Notes'\n status={notes.status}\n info={notes.info || notes.help}\n onChange={(e: ChangeEvent<HTMLTextAreaElement>) => setField({ ...e })}\n onBlur={(e: FocusEvent<HTMLInputElement>) => setField({ ...e })}\n />\n </Grid>\n\n <Grid item={{ colStartEnd: '1/-1' }}>\n <RichTextEditor\n label='Detailed meeting notes'\n info='The rich text editor can be used in forms, comments, and documents'\n toolbar={[\n 'inline-styling',\n 'headers',\n 'tables',\n 'links',\n 'images',\n 'lists',\n 'cut-copy-paste',\n 'indentation'\n ]}\n onImageAdded={onImageAdded}\n ref={editorRef}\n />\n </Grid>\n <Grid item={{ colStartEnd: '1/-1' }}>\n <FileInputDemo />\n </Grid>\n <ComboboxFilterableStory />\n </Grid>\n </Form>\n );\n};\n\ninterface FormStoryProps {\n heading?: string;\n description?: string;\n}\n\nexport const OneColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={1} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const TwoColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={2} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const ThreeColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={3} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const SimpleFormDemo: Story<FormStoryProps & { withBanners?: boolean }> = (\n args: FormStoryProps & { withBanners?: boolean }\n) => {\n const [inputValue, setInputValue] = useState('');\n const [success, setSuccess] = useState('');\n\n const actions = (\n <>\n <Button name='Cancel' variant='secondary' onClick={() => setInputValue('')}>\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary'>\n Submit\n </Button>\n </>\n );\n\n const successBanner = (\n <Banner\n id='success'\n variant='success'\n heading='Success'\n messages={['Form submitted', `Input value: ${success}`]}\n />\n );\n\n const errorBanner = (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n messages={['All required fields in the form must be completed.']}\n />\n );\n\n const banner = success ? successBanner : errorBanner;\n\n return (\n <Form\n banners={args.withBanners ? banner : undefined}\n actions={actions}\n heading={args.heading}\n description={args.description}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n setSuccess(inputValue);\n setInputValue('');\n }}\n >\n <Flex container={{ direction: 'column', itemGap: 2 }}>\n <Input\n label='Name'\n info='Enter your first name'\n required\n value={inputValue}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n setSuccess('');\n setInputValue(e.target.value);\n }}\n />\n </Flex>\n </Form>\n );\n};\n\nSimpleFormDemo.args = {\n withBanners: false\n};\n\nSimpleFormDemo.argTypes = {\n withBanners: { control: { type: 'boolean' } }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Form.stories.jsx","sourceRoot":"","sources":["../../../src/core/Form/Form.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAA0B,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EACL,MAAM,EACN,MAAM,EACN,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACN,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,E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Banner,\n Button,\n Configuration,\n Flex,\n Form,\n FormField,\n Input\n} from '@pega/cosmos-react-core';\n\nimport { FormContent } from './Form.mocks';\n\nexport default {\n title: 'Core/Form',\n component: Form,\n subcomponents: {\n FormField\n },\n args: {\n heading: 'Form demo',\n description: ''\n },\n argTypes: {\n heading: { control: { type: 'text' } },\n description: { control: { type: 'text' } }\n }\n} as Meta;\ninterface FormStoryProps {\n heading?: string;\n description?: string;\n}\n\nexport const OneColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={1} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const TwoColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={2} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const ThreeColumnForm: Story<FormStoryProps> = (args: FormStoryProps) => {\n return <FormContent cols={3} heading={args.heading} description={args.description} showActions />;\n};\n\nexport const SimpleFormDemo: Story<FormStoryProps & { withBanners?: boolean }> = (\n args: FormStoryProps & { withBanners?: boolean }\n) => {\n const [inputValue, setInputValue] = useState('');\n const [success, setSuccess] = useState('');\n\n const actions = (\n <>\n <Button name='Cancel' variant='secondary' onClick={() => setInputValue('')}>\n Cancel\n </Button>\n <Button name='Submit' type='submit' variant='primary'>\n Submit\n </Button>\n </>\n );\n\n const successBanner = (\n <Banner\n id='success'\n variant='success'\n heading='Success'\n messages={['Form submitted', `Input value: ${success}`]}\n />\n );\n\n const errorBanner = (\n <Banner\n id='error'\n variant='urgent'\n heading='Error'\n messages={['All required fields in the form must be completed.']}\n />\n );\n\n const banner = success ? successBanner : errorBanner;\n\n return (\n <Form\n banners={args.withBanners ? banner : undefined}\n actions={actions}\n heading={args.heading}\n description={args.description}\n onSubmit={(e: FormEvent) => {\n e.preventDefault();\n setSuccess(inputValue);\n setInputValue('');\n }}\n >\n <Flex container={{ direction: 'column', itemGap: 2 }}>\n <Input\n label='Name'\n info='Enter your first name'\n required\n value={inputValue}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n setSuccess('');\n setInputValue(e.target.value);\n }}\n />\n </Flex>\n </Form>\n );\n};\n\nSimpleFormDemo.args = {\n withBanners: false\n};\n\nSimpleFormDemo.argTypes = {\n withBanners: { control: { type: 'boolean' } }\n};\n\ninterface ConfigurableFormProps extends FormStoryProps {\n foregroundColor?: string;\n backgroundColor?: string;\n borderColor?: string;\n borderWidth?: string;\n borderRadius?: number;\n hoverBorderColor?: string;\n focusBorderColor?: string;\n}\n\nexport const ConfigurableForm: Story<ConfigurableFormProps> = (args: ConfigurableFormProps) => {\n return (\n <Configuration\n theme={{\n components: {\n 'form-control': {\n 'foreground-color': args.foregroundColor,\n 'background-color': args.backgroundColor,\n 'border-color': args.borderColor,\n 'border-width': args.borderWidth,\n 'border-radius': args.borderRadius,\n ':hover': {\n 'border-color': args.hoverBorderColor\n },\n ':focus': {\n 'border-color': args.focusBorderColor\n }\n }\n }\n }}\n >\n <FormContent cols={2} showActions />\n </Configuration>\n );\n};\n\nConfigurableForm.args = {\n foregroundColor: '#000000',\n backgroundColor: '#ffffff',\n borderColor: '#939393',\n borderWidth: '0.0625rem',\n borderRadius: 0.5,\n hoverBorderColor: '#3f3f3f',\n focusBorderColor: 'transparent'\n};\n\nConfigurableForm.argTypes = {\n foregroundColor: { control: { type: 'color' } },\n backgroundColor: { control: { type: 'color' } },\n borderColor: { control: { type: 'color' } },\n borderWidth: { control: { type: 'text' } },\n borderRadius: { control: { type: 'number' } },\n hoverBorderColor: { control: { type: 'color' } },\n focusBorderColor: { control: { type: 'color' } },\n heading: { table: { disable: true } },\n description: { table: { disable: true } }\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const StyledGridContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
2
|
fitContent?: boolean | undefined;
|
|
3
3
|
height?: number | undefined;
|
|
4
4
|
}, never>;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const StyledGridItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
6
|
//# sourceMappingURL=Grid.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"Grid.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;SAiB/B,CAAC;AAIF,eAAO,MAAM,cAAc,yGAezB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
3
|
-
export const
|
|
3
|
+
export const StyledGridContainer = styled.div(({ fitContent, height, theme }) => {
|
|
4
4
|
return css `
|
|
5
5
|
border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};
|
|
6
6
|
background-color: ${theme.base.colors.blue.light};
|
|
@@ -16,8 +16,8 @@ export const StyledContainer = styled.div(({ fitContent, height, theme }) => {
|
|
|
16
16
|
`}
|
|
17
17
|
`;
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
export const
|
|
19
|
+
StyledGridContainer.defaultProps = defaultThemeProp;
|
|
20
|
+
export const StyledGridItem = styled.div(({ theme }) => {
|
|
21
21
|
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
22
22
|
return css `
|
|
23
23
|
border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};
|
|
@@ -32,5 +32,5 @@ export const StyledItem = styled.div(({ theme }) => {
|
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
StyledGridItem.defaultProps = defaultThemeProp;
|
|
36
36
|
//# sourceMappingURL=Grid.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.styles.js","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Grid.styles.js","sourceRoot":"","sources":["../../../src/core/Grid/Grid.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAC3C,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;IAChC,OAAO,GAAG,CAAA;2BACa,KAAK,CAAC,IAAI,CAAC,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;0BACrD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;;QAE9C,MAAM;QACR,GAAG,CAAA;kBACS,MAAM;OACjB;;QAEC,UAAU;QACZ,GAAG,CAAA;;OAEF;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,GAAG,CAAA;yBACa,KAAK,CAAC,IAAI,CAAC,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;eAC9D,KAAK,CAAC,IAAI,CAAC,OAAO;;wBAET,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK;aACzC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;mBAGjB,QAAQ,CAAC,EAAE;qBACT,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI;;GAEhD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledGridContainer = styled.div<{ fitContent?: boolean; height?: number }>(\n ({ fitContent, height, theme }) => {\n return css`\n border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};\n background-color: ${theme.base.colors.blue.light};\n\n ${height &&\n css`\n height: ${height}rem;\n `}\n\n ${fitContent &&\n css`\n width: fit-content;\n `}\n `;\n }\n);\n\nStyledGridContainer.defaultProps = defaultThemeProp;\n\nexport const StyledGridItem = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n border: calc(0.5 * ${theme.base.spacing}) solid ${theme.base.colors.black};\n padding: ${theme.base.spacing};\n text-align: center;\n background-color: ${theme.base.colors.orange.light};\n color: ${theme.base.colors.black};\n\n span {\n font-size: ${fontSize.xl};\n font-weight: ${theme.base['font-weight'].bold};\n }\n `;\n});\n\nStyledGridItem.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -15,9 +15,10 @@ interface GridStoryProps {
|
|
|
15
15
|
export declare const ColumnsAndRows: () => JSX.Element;
|
|
16
16
|
export declare const Areas: () => JSX.Element;
|
|
17
17
|
export declare const Template: () => JSX.Element;
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
18
|
+
export declare const GapsAndPadding: Story<GridStoryProps>;
|
|
19
|
+
export declare const JustifyGridItems: Story<GridStoryProps>;
|
|
20
|
+
export declare const JustifyGridContent: Story<GridStoryProps>;
|
|
21
|
+
export declare const AlignGridItems: Story<GridStoryProps>;
|
|
22
|
+
export declare const AlignGridContent: Story<GridStoryProps>;
|
|
23
|
+
export declare const ResponsiveGrid: () => JSX.Element;
|
|
23
24
|
//# sourceMappingURL=GridContainer.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridContainer.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/GridContainer.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAQ,kBAAkB,EAAQ,MAAM,yBAAyB,CAAC;;AAIzE,wBAMU;AAEV,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,cAAc,mBAkB1B,CAAC;AAEF,eAAO,MAAM,KAAK,mBA0BjB,CAAC;AAEF,eAAO,MAAM,QAAQ,mBAyBpB,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"GridContainer.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Grid/GridContainer.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAQ,kBAAkB,EAAQ,MAAM,yBAAyB,CAAC;;AAIzE,wBAMU;AAEV,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,cAAc,mBAkB1B,CAAC;AAEF,eAAO,MAAM,KAAK,mBA0BjB,CAAC;AAEF,eAAO,MAAM,QAAQ,mBAyBpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,CAoBhD,CAAC;AAcF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAmBlD,CAAC;AAUF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,cAAc,CAkBpD,CAAC;AAaF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,cAAc,CAmBhD,CAAC;AAUF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAoBlD,CAAC;AAaF,eAAO,MAAM,cAAc,mBAkB1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Grid, Text } from '@pega/cosmos-react-core';
|
|
2
|
-
import {
|
|
2
|
+
import { StyledGridContainer, StyledGridItem } from './Grid.styles';
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Core/Grid/Container',
|
|
5
5
|
component: Grid,
|
|
@@ -12,10 +12,10 @@ export const ColumnsAndRows = () => {
|
|
|
12
12
|
cols: '7rem [line1] 1fr [line2] 3fr [line3]',
|
|
13
13
|
rows: 'repeat(3, 3rem) auto',
|
|
14
14
|
pad: 2
|
|
15
|
-
}} as={
|
|
16
|
-
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<
|
|
15
|
+
}} as={StyledGridContainer} height={20}>
|
|
16
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`colRows-${index}`}>
|
|
17
17
|
<Text>Item {index}</Text>
|
|
18
|
-
</
|
|
18
|
+
</StyledGridItem>))}
|
|
19
19
|
</Grid>);
|
|
20
20
|
};
|
|
21
21
|
export const Areas = () => {
|
|
@@ -24,17 +24,17 @@ export const Areas = () => {
|
|
|
24
24
|
rows: 'repeat(3, 3rem) auto',
|
|
25
25
|
areas: '"sidebar header header" "sidebar . main" "sidebar . main" "sidebar footer footer"',
|
|
26
26
|
pad: 2
|
|
27
|
-
}} as={
|
|
28
|
-
<Grid item={{ area: 'header' }} as={
|
|
27
|
+
}} as={StyledGridContainer} height={20}>
|
|
28
|
+
<Grid item={{ area: 'header' }} as={StyledGridItem}>
|
|
29
29
|
<Text>Header</Text>
|
|
30
30
|
</Grid>
|
|
31
|
-
<Grid item={{ area: 'sidebar' }} as={
|
|
31
|
+
<Grid item={{ area: 'sidebar' }} as={StyledGridItem}>
|
|
32
32
|
<Text>Side</Text>
|
|
33
33
|
</Grid>
|
|
34
|
-
<Grid item={{ area: 'main' }} as={
|
|
34
|
+
<Grid item={{ area: 'main' }} as={StyledGridItem}>
|
|
35
35
|
<Text>Main</Text>
|
|
36
36
|
</Grid>
|
|
37
|
-
<Grid item={{ area: 'footer' }} as={
|
|
37
|
+
<Grid item={{ area: 'footer' }} as={StyledGridItem}>
|
|
38
38
|
<Text>Footer</Text>
|
|
39
39
|
</Grid>
|
|
40
40
|
</Grid>);
|
|
@@ -42,120 +42,127 @@ export const Areas = () => {
|
|
|
42
42
|
export const Template = () => {
|
|
43
43
|
const rowsAndAreas = '"sidebar header header" 3rem "sidebar . main" 3rem "sidebar . main" 3rem "sidebar footer footer" auto';
|
|
44
44
|
const columns = '5rem 1fr 3fr';
|
|
45
|
-
return (<Grid container={{ template: `${rowsAndAreas} / ${columns}`, pad: 2 }} as={
|
|
46
|
-
<Grid item={{ area: 'header' }} as={
|
|
45
|
+
return (<Grid container={{ template: `${rowsAndAreas} / ${columns}`, pad: 2 }} as={StyledGridContainer} height={20}>
|
|
46
|
+
<Grid item={{ area: 'header' }} as={StyledGridItem}>
|
|
47
47
|
<Text>Header</Text>
|
|
48
48
|
</Grid>
|
|
49
|
-
<Grid item={{ area: 'sidebar' }} as={
|
|
49
|
+
<Grid item={{ area: 'sidebar' }} as={StyledGridItem}>
|
|
50
50
|
<Text>Side</Text>
|
|
51
51
|
</Grid>
|
|
52
|
-
<Grid item={{ area: 'main' }} as={
|
|
52
|
+
<Grid item={{ area: 'main' }} as={StyledGridItem}>
|
|
53
53
|
<Text>Main</Text>
|
|
54
54
|
</Grid>
|
|
55
|
-
<Grid item={{ area: 'footer' }} as={
|
|
55
|
+
<Grid item={{ area: 'footer' }} as={StyledGridItem}>
|
|
56
56
|
<Text>Footer</Text>
|
|
57
57
|
</Grid>
|
|
58
58
|
</Grid>);
|
|
59
59
|
};
|
|
60
|
-
export const
|
|
60
|
+
export const GapsAndPadding = (args) => {
|
|
61
61
|
return (<Grid container={{
|
|
62
62
|
cols: '7rem 1fr 3fr',
|
|
63
63
|
colGap: args.colGap,
|
|
64
64
|
rows: 'repeat(3, 3rem) auto',
|
|
65
65
|
rowGap: args.rowGap,
|
|
66
66
|
pad: args.pad
|
|
67
|
-
}} as={
|
|
68
|
-
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<
|
|
67
|
+
}} as={StyledGridContainer} height={20}>
|
|
68
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`colRowGap-${index}`}>
|
|
69
69
|
<Text>Item {index}</Text>
|
|
70
|
-
</
|
|
70
|
+
</StyledGridItem>))}
|
|
71
71
|
</Grid>);
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
GapsAndPadding.args = {
|
|
74
74
|
pad: 1,
|
|
75
75
|
colGap: 1,
|
|
76
76
|
rowGap: 1
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
GapsAndPadding.argTypes = {
|
|
79
79
|
pad: { control: { type: 'number' } },
|
|
80
80
|
colGap: { control: { type: 'number' } },
|
|
81
81
|
rowGap: { control: { type: 'number' } }
|
|
82
82
|
};
|
|
83
|
-
export const
|
|
83
|
+
export const JustifyGridItems = (args) => {
|
|
84
84
|
return (<Grid container={{
|
|
85
85
|
cols: '7rem 1fr 3fr',
|
|
86
86
|
rows: 'repeat(3, 3rem) auto',
|
|
87
87
|
justifyItems: args.justifyItems,
|
|
88
88
|
pad: 2
|
|
89
|
-
}} as={
|
|
90
|
-
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<
|
|
89
|
+
}} as={StyledGridContainer} height={20}>
|
|
90
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`justifyItems-${index}`}>
|
|
91
91
|
<Text>Item {index}</Text>
|
|
92
|
-
</
|
|
92
|
+
</StyledGridItem>))}
|
|
93
93
|
</Grid>);
|
|
94
94
|
};
|
|
95
|
-
|
|
95
|
+
JustifyGridItems.args = {
|
|
96
96
|
justifyItems: 'stretch'
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
JustifyGridItems.argTypes = {
|
|
99
99
|
justifyItems: { options: ['stretch', 'start', 'center', 'end'], control: { type: 'select' } }
|
|
100
100
|
};
|
|
101
|
-
export const
|
|
101
|
+
export const JustifyGridContent = (args) => {
|
|
102
102
|
return (<Grid container={{
|
|
103
103
|
cols: 'repeat(3, 7rem)',
|
|
104
104
|
rows: 'repeat(4, 3rem)',
|
|
105
105
|
justifyContent: args.justifyContent,
|
|
106
106
|
pad: 2
|
|
107
|
-
}} as={
|
|
108
|
-
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<
|
|
107
|
+
}} as={StyledGridContainer}>
|
|
108
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`justifyContent-${index}`}>
|
|
109
109
|
<Text>Item {index}</Text>
|
|
110
|
-
</
|
|
110
|
+
</StyledGridItem>))}
|
|
111
111
|
</Grid>);
|
|
112
112
|
};
|
|
113
|
-
|
|
113
|
+
JustifyGridContent.args = {
|
|
114
114
|
justifyContent: 'start'
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
JustifyGridContent.argTypes = {
|
|
117
117
|
justifyContent: {
|
|
118
118
|
options: ['start', 'end', 'center', 'around', 'between', 'evenly'],
|
|
119
119
|
control: { type: 'select' }
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
|
-
export const
|
|
122
|
+
export const AlignGridItems = (args) => {
|
|
123
123
|
return (<Grid container={{
|
|
124
124
|
cols: '7rem 1fr 3fr',
|
|
125
125
|
rows: 'repeat(3, 5rem) auto',
|
|
126
126
|
alignItems: args.alignItems,
|
|
127
127
|
pad: 2
|
|
128
|
-
}} as={
|
|
129
|
-
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<
|
|
128
|
+
}} as={StyledGridContainer} height={20}>
|
|
129
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`alignItems-${index}`}>
|
|
130
130
|
<Text>Item {index}</Text>
|
|
131
|
-
</
|
|
131
|
+
</StyledGridItem>))}
|
|
132
132
|
</Grid>);
|
|
133
133
|
};
|
|
134
|
-
|
|
134
|
+
AlignGridItems.args = {
|
|
135
135
|
alignItems: 'stretch'
|
|
136
136
|
};
|
|
137
|
-
|
|
137
|
+
AlignGridItems.argTypes = {
|
|
138
138
|
alignItems: { options: ['stretch', 'start', 'center', 'end'], control: { type: 'select' } }
|
|
139
139
|
};
|
|
140
|
-
export const
|
|
140
|
+
export const AlignGridContent = (args) => {
|
|
141
141
|
return (<Grid container={{
|
|
142
142
|
cols: 'repeat(3, 7rem)',
|
|
143
143
|
rows: 'repeat(4, 3rem)',
|
|
144
144
|
alignContent: args.alignContent,
|
|
145
145
|
pad: 2
|
|
146
|
-
}} as={
|
|
147
|
-
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<
|
|
146
|
+
}} as={StyledGridContainer} height={30} fitContent>
|
|
147
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`alignContent-${index}`}>
|
|
148
148
|
<Text>Item {index}</Text>
|
|
149
|
-
</
|
|
149
|
+
</StyledGridItem>))}
|
|
150
150
|
</Grid>);
|
|
151
151
|
};
|
|
152
|
-
|
|
152
|
+
AlignGridContent.args = {
|
|
153
153
|
alignContent: 'start'
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
AlignGridContent.argTypes = {
|
|
156
156
|
alignContent: {
|
|
157
157
|
options: ['start', 'end', 'center', 'around', 'between', 'evenly'],
|
|
158
158
|
control: { type: 'select' }
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
+
export const ResponsiveGrid = () => {
|
|
162
|
+
return (<Grid container={{ pad: 1, cols: 'repeat(3, 7rem)', rows: 'repeat(4, 3rem)' }} xl={{ container: { cols: 'repeat(12, 1fr)', rows: 'repeat(1, 3rem)' } }} lg={{ container: { cols: 'repeat(6, 1fr)', rows: 'repeat(2, 3rem)' } }} md={{ container: { cols: 'repeat(4, 1fr)', rows: 'repeat(3, 3rem)' } }} sm={{ container: { cols: 'repeat(3, 1fr)', rows: 'repeat(4, 3rem)' } }} xs={{ container: { cols: 'repeat(2, 1fr)', rows: 'repeat(6, 3rem)' } }} as={StyledGridContainer}>
|
|
163
|
+
{[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => (<StyledGridItem key={`colRows-${index}`}>
|
|
164
|
+
<Text>Item {index}</Text>
|
|
165
|
+
</StyledGridItem>))}
|
|
166
|
+
</Grid>);
|
|
167
|
+
};
|
|
161
168
|
//# sourceMappingURL=GridContainer.stories.jsx.map
|