@ohos-ports/sprucelabs-react-heartwood-components 9.1.0-beta.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/LICENSE +21 -0
- package/README.md +59 -0
- package/lib/__mocks__/stubs/events.js +166 -0
- package/lib/__mocks__/stubs/events.js.map +1 -0
- package/lib/__mocks__/stubs/location.js +34 -0
- package/lib/__mocks__/stubs/location.js.map +1 -0
- package/lib/__mocks__/stubs/users.js +225 -0
- package/lib/__mocks__/stubs/users.js.map +1 -0
- package/lib/__tests__/components/Pagination/Pagination.test.js +127 -0
- package/lib/__tests__/components/Pagination/Pagination.test.js.map +1 -0
- package/lib/components/Avatar/Avatar-story.js +34 -0
- package/lib/components/Avatar/Avatar-story.js.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts +40 -0
- package/lib/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/components/Avatar/Avatar.js +91 -0
- package/lib/components/Avatar/Avatar.js.map +1 -0
- package/lib/components/Avatar/UserAvatar.js +45 -0
- package/lib/components/Avatar/UserAvatar.js.map +1 -0
- package/lib/components/BotText/BotText-story.d.ts +2 -0
- package/lib/components/BotText/BotText-story.d.ts.map +1 -0
- package/lib/components/BotText/BotText-story.js +21 -0
- package/lib/components/BotText/BotText-story.js.map +1 -0
- package/lib/components/BotText/BotText.d.ts +12 -0
- package/lib/components/BotText/BotText.d.ts.map +1 -0
- package/lib/components/BotText/BotText.js +52 -0
- package/lib/components/BotText/BotText.js.map +1 -0
- package/lib/components/Button/Button-story.js +109 -0
- package/lib/components/Button/Button-story.js.map +1 -0
- package/lib/components/Button/Button.d.ts +47 -0
- package/lib/components/Button/Button.d.ts.map +1 -0
- package/lib/components/Button/Button.js +155 -0
- package/lib/components/Button/Button.js.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup-story.js +27 -0
- package/lib/components/ButtonGroup/ButtonGroup-story.js.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts +19 -0
- package/lib/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/lib/components/ButtonGroup/ButtonGroup.js +64 -0
- package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/lib/components/Card/Card-story.d.ts +2 -0
- package/lib/components/Card/Card-story.d.ts.map +1 -0
- package/lib/components/Card/Card-story.js +389 -0
- package/lib/components/Card/Card-story.js.map +1 -0
- package/lib/components/Card/Card.d.ts +69 -0
- package/lib/components/Card/Card.d.ts.map +1 -0
- package/lib/components/Card/Card.js +113 -0
- package/lib/components/Card/Card.js.map +1 -0
- package/lib/components/Card/components/CardBody.d.ts +27 -0
- package/lib/components/Card/components/CardBody.d.ts.map +1 -0
- package/lib/components/Card/components/CardBody.js +45 -0
- package/lib/components/Card/components/CardBody.js.map +1 -0
- package/lib/components/Card/components/CardBuilder.d.ts +50 -0
- package/lib/components/Card/components/CardBuilder.d.ts.map +1 -0
- package/lib/components/Card/components/CardBuilder.js +139 -0
- package/lib/components/Card/components/CardBuilder.js.map +1 -0
- package/lib/components/Card/components/CardFooter.d.ts +11 -0
- package/lib/components/Card/components/CardFooter.d.ts.map +1 -0
- package/lib/components/Card/components/CardFooter.js +22 -0
- package/lib/components/Card/components/CardFooter.js.map +1 -0
- package/lib/components/Card/components/CardHeader.d.ts +28 -0
- package/lib/components/Card/components/CardHeader.d.ts.map +1 -0
- package/lib/components/Card/components/CardHeader.js +70 -0
- package/lib/components/Card/components/CardHeader.js.map +1 -0
- package/lib/components/Card/components/CardSection.d.ts +10 -0
- package/lib/components/Card/components/CardSection.d.ts.map +1 -0
- package/lib/components/Card/components/CardSection.js +27 -0
- package/lib/components/Card/components/CardSection.js.map +1 -0
- package/lib/components/Card/components/OnboardingCard.d.ts +27 -0
- package/lib/components/Card/components/OnboardingCard.d.ts.map +1 -0
- package/lib/components/Card/components/OnboardingCard.js +129 -0
- package/lib/components/Card/components/OnboardingCard.js.map +1 -0
- package/lib/components/Card/components/Scores.d.ts +15 -0
- package/lib/components/Card/components/Scores.d.ts.map +1 -0
- package/lib/components/Card/components/Scores.js +39 -0
- package/lib/components/Card/components/Scores.js.map +1 -0
- package/lib/components/Card/index.d.ts +11 -0
- package/lib/components/Card/index.d.ts.map +1 -0
- package/lib/components/Card/index.js +120 -0
- package/lib/components/Card/index.js.map +1 -0
- package/lib/components/CircleLoader/CircleLoader-story.d.ts +2 -0
- package/lib/components/CircleLoader/CircleLoader-story.d.ts.map +1 -0
- package/lib/components/CircleLoader/CircleLoader-story.js +20 -0
- package/lib/components/CircleLoader/CircleLoader-story.js.map +1 -0
- package/lib/components/CircleLoader/CircleLoader.d.ts +13 -0
- package/lib/components/CircleLoader/CircleLoader.d.ts.map +1 -0
- package/lib/components/CircleLoader/CircleLoader.js +28 -0
- package/lib/components/CircleLoader/CircleLoader.js.map +1 -0
- package/lib/components/ContextMenu/ContextMenu-story.js +31 -0
- package/lib/components/ContextMenu/ContextMenu-story.js.map +1 -0
- package/lib/components/ContextMenu/ContextMenu.d.ts +70 -0
- package/lib/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/lib/components/ContextMenu/ContextMenu.js +315 -0
- package/lib/components/ContextMenu/ContextMenu.js.map +1 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder-story.js +101 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder-story.js.map +1 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder.js +290 -0
- package/lib/components/Core/components/FeedBuilder/FeedBuilder.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/FooterPrimary.js +20 -0
- package/lib/components/Core/components/FooterPrimary/FooterPrimary.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/components/HelpButton/HelpButton.js +52 -0
- package/lib/components/Core/components/FooterPrimary/components/HelpButton/HelpButton.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/components/Legal/Legal.js +38 -0
- package/lib/components/Core/components/FooterPrimary/components/Legal/Legal.js.map +1 -0
- package/lib/components/Core/components/FooterPrimary/index.js +30 -0
- package/lib/components/Core/components/FooterPrimary/index.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary-story.js +134 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary-story.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary.js +238 -0
- package/lib/components/Core/components/HeaderPrimary/HeaderPrimary.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/DefaultLockup/DefaultLockup.js +32 -0
- package/lib/components/Core/components/HeaderPrimary/components/DefaultLockup/DefaultLockup.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/Hamburger/Hamburger.js +58 -0
- package/lib/components/Core/components/HeaderPrimary/components/Hamburger/Hamburger.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/LocationMenu/LocationMenu.js +169 -0
- package/lib/components/Core/components/HeaderPrimary/components/LocationMenu/LocationMenu.js.map +1 -0
- package/lib/components/Core/components/HeaderPrimary/components/UserMenu/UserMenu.js +56 -0
- package/lib/components/Core/components/HeaderPrimary/components/UserMenu/UserMenu.js.map +1 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary-story.js +26 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary-story.js.map +1 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary.js +46 -0
- package/lib/components/Core/components/ProfileSummary/ProfileSummary.js.map +1 -0
- package/lib/components/Core/components/SaveBar/SaveBar-story.js +68 -0
- package/lib/components/Core/components/SaveBar/SaveBar-story.js.map +1 -0
- package/lib/components/Core/components/SaveBar/SaveBar.js +127 -0
- package/lib/components/Core/components/SaveBar/SaveBar.js.map +1 -0
- package/lib/components/Core/components/Sidebar/Sidebar-story.js +204 -0
- package/lib/components/Core/components/Sidebar/Sidebar-story.js.map +1 -0
- package/lib/components/Core/components/Sidebar/Sidebar.js +87 -0
- package/lib/components/Core/components/Sidebar/Sidebar.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarExpander/SidebarExpander.js +48 -0
- package/lib/components/Core/components/Sidebar/components/SidebarExpander/SidebarExpander.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarFooter/SidebarFooter.js +25 -0
- package/lib/components/Core/components/Sidebar/components/SidebarFooter/SidebarFooter.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.d.ts +12 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.d.ts.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.js +47 -0
- package/lib/components/Core/components/Sidebar/components/SidebarHeader/SidebarHeader.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarItem/SidebarItem.js +115 -0
- package/lib/components/Core/components/Sidebar/components/SidebarItem/SidebarItem.js.map +1 -0
- package/lib/components/Core/components/Sidebar/components/SidebarSection/SidebarSection.js +38 -0
- package/lib/components/Core/components/Sidebar/components/SidebarSection/SidebarSection.js.map +1 -0
- package/lib/components/Core/index.js +80 -0
- package/lib/components/Core/index.js.map +1 -0
- package/lib/components/Dropzone/Dropzone-story.js +119 -0
- package/lib/components/Dropzone/Dropzone-story.js.map +1 -0
- package/lib/components/Dropzone/Dropzone.js +317 -0
- package/lib/components/Dropzone/Dropzone.js.map +1 -0
- package/lib/components/EmptyState/EmptyState-story.d.ts +2 -0
- package/lib/components/EmptyState/EmptyState-story.d.ts.map +1 -0
- package/lib/components/EmptyState/EmptyState-story.js +60 -0
- package/lib/components/EmptyState/EmptyState-story.js.map +1 -0
- package/lib/components/EmptyState/EmptyState.d.ts +28 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/EmptyState/EmptyState.js +54 -0
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EventDetails/EventDetails-story.d.ts +2 -0
- package/lib/components/EventDetails/EventDetails-story.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetails-story.js +112 -0
- package/lib/components/EventDetails/EventDetails-story.js.map +1 -0
- package/lib/components/EventDetails/EventDetails.d.ts +18 -0
- package/lib/components/EventDetails/EventDetails.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetails.js +75 -0
- package/lib/components/EventDetails/EventDetails.js.map +1 -0
- package/lib/components/EventDetails/EventDetailsUtilities.d.ts +11 -0
- package/lib/components/EventDetails/EventDetailsUtilities.d.ts.map +1 -0
- package/lib/components/EventDetails/EventDetailsUtilities.js +56 -0
- package/lib/components/EventDetails/EventDetailsUtilities.js.map +1 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.d.ts +18 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.d.ts.map +1 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.js +111 -0
- package/lib/components/EventDetails/components/EventDetailsItem/EventDetailsItem.js.map +1 -0
- package/lib/components/EventDetails/eventDetailsMock.d.ts +10 -0
- package/lib/components/EventDetails/eventDetailsMock.d.ts.map +1 -0
- package/lib/components/EventDetails/eventDetailsMock.js +840 -0
- package/lib/components/EventDetails/eventDetailsMock.js.map +1 -0
- package/lib/components/FontLoader/FontLoader-story.js +16 -0
- package/lib/components/FontLoader/FontLoader-story.js.map +1 -0
- package/lib/components/FontLoader/FontLoader.js +148 -0
- package/lib/components/FontLoader/FontLoader.js.map +1 -0
- package/lib/components/Forms/FormPartials.js +70 -0
- package/lib/components/Forms/FormPartials.js.map +1 -0
- package/lib/components/Forms/Forms-story.js +297 -0
- package/lib/components/Forms/Forms-story.js.map +1 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.d.ts +71 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.d.ts.map +1 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.js +372 -0
- package/lib/components/Forms/components/Autosuggest/Autosuggest.js.map +1 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.d.ts +23 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.js +162 -0
- package/lib/components/Forms/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/components/Forms/components/DatePicker/DatePicker.js +236 -0
- package/lib/components/Forms/components/DatePicker/DatePicker.js.map +1 -0
- package/lib/components/Forms/components/DomainInput/DomainInput.js +29 -0
- package/lib/components/Forms/components/DomainInput/DomainInput.js.map +1 -0
- package/lib/components/Forms/components/DurationInput/DurationInput.js +270 -0
- package/lib/components/Forms/components/DurationInput/DurationInput.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder-story.js +357 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder-story.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder.js +121 -0
- package/lib/components/Forms/components/FormBuilder/FormBuilder.js.map +1 -0
- package/lib/components/Forms/components/FormBuilder/components/FormInner/FormInner.js +201 -0
- package/lib/components/Forms/components/FormBuilder/components/FormInner/FormInner.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/FormLayout.js +35 -0
- package/lib/components/Forms/components/FormLayout/FormLayout.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js +30 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutGroup/FormLayoutGroup.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js +32 -0
- package/lib/components/Forms/components/FormLayout/components/FormLayoutItem/FormLayoutItem.js.map +1 -0
- package/lib/components/Forms/components/FormLayout/index.js +32 -0
- package/lib/components/Forms/components/FormLayout/index.js.map +1 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.d.ts +30 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.d.ts.map +1 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.js +119 -0
- package/lib/components/Forms/components/PhoneInput/PhoneInput.js.map +1 -0
- package/lib/components/Forms/components/Radio/Radio.d.ts +15 -0
- package/lib/components/Forms/components/Radio/Radio.d.ts.map +1 -0
- package/lib/components/Forms/components/Radio/Radio.js +92 -0
- package/lib/components/Forms/components/Radio/Radio.js.map +1 -0
- package/lib/components/Forms/components/Search/Search.js +96 -0
- package/lib/components/Forms/components/Search/Search.js.map +1 -0
- package/lib/components/Forms/components/Select/Select.js +95 -0
- package/lib/components/Forms/components/Select/Select.js.map +1 -0
- package/lib/components/Forms/components/Slider/Slider.js +100 -0
- package/lib/components/Forms/components/Slider/Slider.js.map +1 -0
- package/lib/components/Forms/components/Stars/Stars.js +101 -0
- package/lib/components/Forms/components/Stars/Stars.js.map +1 -0
- package/lib/components/Forms/components/Tag/Tag.js +60 -0
- package/lib/components/Forms/components/Tag/Tag.js.map +1 -0
- package/lib/components/Forms/components/TextArea/TextArea.js +55 -0
- package/lib/components/Forms/components/TextArea/TextArea.js.map +1 -0
- package/lib/components/Forms/components/TextInput/TextInput.d.ts +28 -0
- package/lib/components/Forms/components/TextInput/TextInput.d.ts.map +1 -0
- package/lib/components/Forms/components/TextInput/TextInput.js +57 -0
- package/lib/components/Forms/components/TextInput/TextInput.js.map +1 -0
- package/lib/components/Forms/components/Toggle/Toggle.d.ts +9 -0
- package/lib/components/Forms/components/Toggle/Toggle.d.ts.map +1 -0
- package/lib/components/Forms/components/Toggle/Toggle.js +43 -0
- package/lib/components/Forms/components/Toggle/Toggle.js.map +1 -0
- package/lib/components/Forms/index.d.ts +18 -0
- package/lib/components/Forms/index.d.ts.map +1 -0
- package/lib/components/Forms/index.js +182 -0
- package/lib/components/Forms/index.js.map +1 -0
- package/lib/components/Heading/Heading-story.js +18 -0
- package/lib/components/Heading/Heading-story.js.map +1 -0
- package/lib/components/Heading/Heading.d.ts +13 -0
- package/lib/components/Heading/Heading.d.ts.map +1 -0
- package/lib/components/Heading/Heading.js +32 -0
- package/lib/components/Heading/Heading.js.map +1 -0
- package/lib/components/Icon/Icon-story.d.ts +2 -0
- package/lib/components/Icon/Icon-story.d.ts.map +1 -0
- package/lib/components/Icon/Icon-story.js +44 -0
- package/lib/components/Icon/Icon-story.js.map +1 -0
- package/lib/components/Icon/Icon.d.ts +13 -0
- package/lib/components/Icon/Icon.d.ts.map +1 -0
- package/lib/components/Icon/Icon.js +52 -0
- package/lib/components/Icon/Icon.js.map +1 -0
- package/lib/components/Image/Image.d.ts +11 -0
- package/lib/components/Image/Image.d.ts.map +1 -0
- package/lib/components/Image/Image.js +32 -0
- package/lib/components/Image/Image.js.map +1 -0
- package/lib/components/ImageCropper/ImageCropper-story.js +219 -0
- package/lib/components/ImageCropper/ImageCropper-story.js.map +1 -0
- package/lib/components/ImageCropper/ImageCropper.js +256 -0
- package/lib/components/ImageCropper/ImageCropper.js.map +1 -0
- package/lib/components/ImageSSR/ImageSSR.js +32 -0
- package/lib/components/ImageSSR/ImageSSR.js.map +1 -0
- package/lib/components/Layout/Layout-story.js +128 -0
- package/lib/components/Layout/Layout-story.js.map +1 -0
- package/lib/components/Layout/Layout.js +43 -0
- package/lib/components/Layout/Layout.js.map +1 -0
- package/lib/components/Layout/components/LayoutSection/LayoutSection.js +38 -0
- package/lib/components/Layout/components/LayoutSection/LayoutSection.js.map +1 -0
- package/lib/components/Layout/index.js +24 -0
- package/lib/components/Layout/index.js.map +1 -0
- package/lib/components/List/List-story.d.ts +2 -0
- package/lib/components/List/List-story.d.ts.map +1 -0
- package/lib/components/List/List-story.js +241 -0
- package/lib/components/List/List-story.js.map +1 -0
- package/lib/components/List/List.d.ts +34 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +83 -0
- package/lib/components/List/List.js.map +1 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.d.ts +27 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.d.ts.map +1 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.js +93 -0
- package/lib/components/List/components/ExpandableListItem/ExpandableListItem.js.map +1 -0
- package/lib/components/List/components/ListHeader/ListHeader.d.ts +16 -0
- package/lib/components/List/components/ListHeader/ListHeader.d.ts.map +1 -0
- package/lib/components/List/components/ListHeader/ListHeader.js +51 -0
- package/lib/components/List/components/ListHeader/ListHeader.js.map +1 -0
- package/lib/components/List/components/ListItem/ListItem.d.ts +67 -0
- package/lib/components/List/components/ListItem/ListItem.d.ts.map +1 -0
- package/lib/components/List/components/ListItem/ListItem.js +206 -0
- package/lib/components/List/components/ListItem/ListItem.js.map +1 -0
- package/lib/components/List/components/SortableList/SortableList.d.ts +35 -0
- package/lib/components/List/components/SortableList/SortableList.d.ts.map +1 -0
- package/lib/components/List/components/SortableList/SortableList.js +180 -0
- package/lib/components/List/components/SortableList/SortableList.js.map +1 -0
- package/lib/components/List/index.d.ts +6 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +74 -0
- package/lib/components/List/index.js.map +1 -0
- package/lib/components/Loader/Loader-story.js +30 -0
- package/lib/components/Loader/Loader-story.js.map +1 -0
- package/lib/components/Loader/Loader.js +36 -0
- package/lib/components/Loader/Loader.js.map +1 -0
- package/lib/components/Loader/Loader.test.js +17 -0
- package/lib/components/Loader/Loader.test.js.map +1 -0
- package/lib/components/MarkdownText/MarkdownText.d.ts +8 -0
- package/lib/components/MarkdownText/MarkdownText.d.ts.map +1 -0
- package/lib/components/MarkdownText/MarkdownText.js +26 -0
- package/lib/components/MarkdownText/MarkdownText.js.map +1 -0
- package/lib/components/Message/Message-story.js +135 -0
- package/lib/components/Message/Message-story.js.map +1 -0
- package/lib/components/Message/Message.js +147 -0
- package/lib/components/Message/Message.js.map +1 -0
- package/lib/components/Message/components/MessageBuilder.js +132 -0
- package/lib/components/Message/components/MessageBuilder.js.map +1 -0
- package/lib/components/Message/index.js +24 -0
- package/lib/components/Message/index.js.map +1 -0
- package/lib/components/Modal/Modal-story.js +239 -0
- package/lib/components/Modal/Modal-story.js.map +1 -0
- package/lib/components/Modal/Modal.js +86 -0
- package/lib/components/Modal/Modal.js.map +1 -0
- package/lib/components/Modal/components/ModalBody/ModalBody.js +30 -0
- package/lib/components/Modal/components/ModalBody/ModalBody.js.map +1 -0
- package/lib/components/Modal/components/ModalFooter/ModalFooter.js +31 -0
- package/lib/components/Modal/components/ModalFooter/ModalFooter.js.map +1 -0
- package/lib/components/Modal/components/ModalHeader/ModalHeader.js +84 -0
- package/lib/components/Modal/components/ModalHeader/ModalHeader.js.map +1 -0
- package/lib/components/Page/Page-story.js +115 -0
- package/lib/components/Page/Page-story.js.map +1 -0
- package/lib/components/Page/Page.js +55 -0
- package/lib/components/Page/Page.js.map +1 -0
- package/lib/components/Page/components/PageContent/PageContent.js +22 -0
- package/lib/components/Page/components/PageContent/PageContent.js.map +1 -0
- package/lib/components/Page/components/PageHeader/PageHeader.js +127 -0
- package/lib/components/Page/components/PageHeader/PageHeader.js.map +1 -0
- package/lib/components/Page/index.js +32 -0
- package/lib/components/Page/index.js.map +1 -0
- package/lib/components/PagedModal/PagedModal-story.js +121 -0
- package/lib/components/PagedModal/PagedModal-story.js.map +1 -0
- package/lib/components/PagedModal/PagedModal.js +84 -0
- package/lib/components/PagedModal/PagedModal.js.map +1 -0
- package/lib/components/Pagination/Pagination-story.js +35 -0
- package/lib/components/Pagination/Pagination-story.js.map +1 -0
- package/lib/components/Pagination/Pagination.js +157 -0
- package/lib/components/Pagination/Pagination.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectList-story.js +491 -0
- package/lib/components/RecordSelectionList/RecordSelectList-story.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.d.ts +112 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.d.ts.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.js +702 -0
- package/lib/components/RecordSelectionList/RecordSelectionList.js.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.d.ts +5 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.d.ts.map +1 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.js +20 -0
- package/lib/components/RecordSelectionList/RecordSelectionListItem.js.map +1 -0
- package/lib/components/RecordTable/RecordTable-story.d.ts +2 -0
- package/lib/components/RecordTable/RecordTable-story.d.ts.map +1 -0
- package/lib/components/RecordTable/RecordTable-story.js +242 -0
- package/lib/components/RecordTable/RecordTable-story.js.map +1 -0
- package/lib/components/RecordTable/RecordTable.d.ts +133 -0
- package/lib/components/RecordTable/RecordTable.d.ts.map +1 -0
- package/lib/components/RecordTable/RecordTable.js +523 -0
- package/lib/components/RecordTable/RecordTable.js.map +1 -0
- package/lib/components/SplitButton/SplitButton-story.js +60 -0
- package/lib/components/SplitButton/SplitButton-story.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.d.ts +47 -0
- package/lib/components/SplitButton/SplitButton.d.ts.map +1 -0
- package/lib/components/SplitButton/SplitButton.js +296 -0
- package/lib/components/SplitButton/SplitButton.js.map +1 -0
- package/lib/components/Subheading/Subheading-story.js +18 -0
- package/lib/components/Subheading/Subheading-story.js.map +1 -0
- package/lib/components/Subheading/Subheading.js +40 -0
- package/lib/components/Subheading/Subheading.js.map +1 -0
- package/lib/components/Table/Table-story.js +428 -0
- package/lib/components/Table/Table-story.js.map +1 -0
- package/lib/components/Table/Table.d.ts +63 -0
- package/lib/components/Table/Table.d.ts.map +1 -0
- package/lib/components/Table/Table.js +395 -0
- package/lib/components/Table/Table.js.map +1 -0
- package/lib/components/Table/components/TableFilters/TableFilters.js +31 -0
- package/lib/components/Table/components/TableFilters/TableFilters.js.map +1 -0
- package/lib/components/Table/components/TableSearch/TableSearch.d.ts +7 -0
- package/lib/components/Table/components/TableSearch/TableSearch.d.ts.map +1 -0
- package/lib/components/Table/components/TableSearch/TableSearch.js +30 -0
- package/lib/components/Table/components/TableSearch/TableSearch.js.map +1 -0
- package/lib/components/Table/index.d.ts +4 -0
- package/lib/components/Table/index.d.ts.map +1 -0
- package/lib/components/Table/index.js +40 -0
- package/lib/components/Table/index.js.map +1 -0
- package/lib/components/Tabs/Tabs-story.d.ts +2 -0
- package/lib/components/Tabs/Tabs-story.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs-story.js +36 -0
- package/lib/components/Tabs/Tabs-story.js.map +1 -0
- package/lib/components/Tabs/Tabs.d.ts +40 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.js +244 -0
- package/lib/components/Tabs/Tabs.js.map +1 -0
- package/lib/components/Tabs/components/Tab/Tab.d.ts +26 -0
- package/lib/components/Tabs/components/Tab/Tab.d.ts.map +1 -0
- package/lib/components/Tabs/components/Tab/Tab.js +46 -0
- package/lib/components/Tabs/components/Tab/Tab.js.map +1 -0
- package/lib/components/Text/Text-story.d.ts +2 -0
- package/lib/components/Text/Text-story.d.ts.map +1 -0
- package/lib/components/Text/Text-story.js +51 -0
- package/lib/components/Text/Text-story.js.map +1 -0
- package/lib/components/Text/Text.d.ts +18 -0
- package/lib/components/Text/Text.d.ts.map +1 -0
- package/lib/components/Text/Text.js +123 -0
- package/lib/components/Text/Text.js.map +1 -0
- package/lib/components/TextContainer/TextContainer-story.js +32 -0
- package/lib/components/TextContainer/TextContainer-story.js.map +1 -0
- package/lib/components/TextContainer/TextContainer.js +33 -0
- package/lib/components/TextContainer/TextContainer.js.map +1 -0
- package/lib/components/TextStyle/TextStyle-story.js +28 -0
- package/lib/components/TextStyle/TextStyle-story.js.map +1 -0
- package/lib/components/TextStyle/TextStyle.js +41 -0
- package/lib/components/TextStyle/TextStyle.js.map +1 -0
- package/lib/components/Toast/Toast-story.d.ts +2 -0
- package/lib/components/Toast/Toast-story.d.ts.map +1 -0
- package/lib/components/Toast/Toast-story.js +210 -0
- package/lib/components/Toast/Toast-story.js.map +1 -0
- package/lib/components/Toast/Toast.d.ts +24 -0
- package/lib/components/Toast/Toast.d.ts.map +1 -0
- package/lib/components/Toast/Toast.js +76 -0
- package/lib/components/Toast/Toast.js.map +1 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.d.ts +24 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.d.ts.map +1 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.js +131 -0
- package/lib/components/Toast/components/ToastWrapper/ToastWrapper.js.map +1 -0
- package/lib/components/TruncatedList/TruncatedList-story.js +222 -0
- package/lib/components/TruncatedList/TruncatedList-story.js.map +1 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts +49 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts.map +1 -0
- package/lib/components/TruncatedList/TruncatedList.js +188 -0
- package/lib/components/TruncatedList/TruncatedList.js.map +1 -0
- package/lib/components/View/View-story.js +485 -0
- package/lib/components/View/View-story.js.map +1 -0
- package/lib/components/View/View.d.ts +26 -0
- package/lib/components/View/View.d.ts.map +1 -0
- package/lib/components/View/View.js +91 -0
- package/lib/components/View/View.js.map +1 -0
- package/lib/components/_utilities/Anchor.js +28 -0
- package/lib/components/_utilities/Anchor.js.map +1 -0
- package/lib/custom-types.d.js +2 -0
- package/lib/custom-types.d.js.map +1 -0
- package/lib/icons.js +3328 -0
- package/lib/icons.js.map +1 -0
- package/lib/index.d.ts +46 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +707 -0
- package/lib/index.js.map +1 -0
- package/lib/stubs/events.js +166 -0
- package/lib/stubs/events.js.map +1 -0
- package/lib/stubs/location.js +34 -0
- package/lib/stubs/location.js.map +1 -0
- package/lib/stubs/users.js +225 -0
- package/lib/stubs/users.js.map +1 -0
- package/lib/utilities.js +23 -0
- package/lib/utilities.js.map +1 -0
- package/package.json +174 -0
- package/static/android-chrome-192x192.png +0 -0
- package/static/android-chrome-256x256.png +0 -0
- package/static/apple-touch-icon.png +0 -0
- package/static/assets/bg.jpeg +0 -0
- package/static/assets/icons/Design/Rotate/rotate-back.svg +9 -0
- package/static/assets/icons/Design/Rotate/rotate-forward.svg +9 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle--16w.svg +3 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle--56w.svg +5 -0
- package/static/assets/icons/Interface-Essential/Alerts/alert-triangle.svg +3 -0
- package/static/assets/icons/Interface-Essential/Dashboard/gauge-dashboard-1.svg +11 -0
- package/static/assets/icons/Interface-Essential/Date/Calendar/calendar-3.svg +12 -0
- package/static/assets/icons/Interface-Essential/Date/Calendar/calendar-date.svg +9 -0
- package/static/assets/icons/Interface-Essential/Delete/bin.svg +7 -0
- package/static/assets/icons/Interface-Essential/Edit/pencil-write.svg +5 -0
- package/static/assets/icons/Interface-Essential/Form-Edition/paper-write.svg +8 -0
- package/static/assets/icons/Interface-Essential/Form-Validation/check-circle-1.svg +4 -0
- package/static/assets/icons/Interface-Essential/Help/question-help-square--16w.svg +5 -0
- package/static/assets/icons/Interface-Essential/Help/question-help-square.svg +5 -0
- package/static/assets/icons/Interface-Essential/Home/house-1--16w.svg +4 -0
- package/static/assets/icons/Interface-Essential/Home/house-1.svg +4 -0
- package/static/assets/icons/Interface-Essential/Lists/list-bullets-1.svg +8 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/Lock/Unlock-4.svg +5 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/lock-6--16w.svg +3 -0
- package/static/assets/icons/Interface-Essential/Lock/Unlock/lock-6.svg +5 -0
- package/static/assets/icons/Interface-Essential/Login/Logout/logout.svg +5 -0
- package/static/assets/icons/Interface-Essential/Menu/navigation-menu-horizontal.svg +5 -0
- package/static/assets/icons/Interface-Essential/Select/cursor-select-4.svg +14 -0
- package/static/assets/icons/Interface-Essential/Time/stopwatch.svg +8 -0
- package/static/assets/icons/Interface-Essential/Time-Files/time-clock-file-check.svg +7 -0
- package/static/assets/icons/Interface-Essential/Time-Files/time-clock-file-upload.svg +9 -0
- package/static/assets/icons/Maps-Navigation/Pins/pin-2.svg +4 -0
- package/static/assets/icons/Maps-Navigation/Pins/pin.svg +4 -0
- package/static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text--16w.svg +8 -0
- package/static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text.svg +8 -0
- package/static/assets/icons/Messages-Chat-Smileys/Messages-Speech-Bubbles/messages-bubble-square-text.svg +5 -0
- package/static/assets/icons/Phones-Mobile-Devices/Phone/phone-retro-1.svg +7 -0
- package/static/assets/icons/Programming-Apps-Websites/Plugins/Modules/module-puzzle.svg +3 -0
- package/static/assets/icons/Shopping-E-Commerce/Shops/shop-1--56w.svg +6 -0
- package/static/assets/icons/Shopping-E-Commerce/Shops/shop-1.svg +7 -0
- package/static/assets/icons/Social-Medias-Rewards-Rating/Rating/rating-star-1-1.svg +3 -0
- package/static/assets/icons/Social-Medias-Rewards-Rating/Rating/rating-star-1.svg +3 -0
- package/static/assets/icons/Transportation/Aircraft/aircraft-military-plane.svg +18 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-image--56w.svg +7 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-up-down.svg +8 -0
- package/static/assets/icons/Users/Geometric-Close-Up-Single-User-Neutral/single-neutral-id-card-3.svg +8 -0
- package/static/assets/icons/Users/Geometric-Full-Body-Multiple-Users/multiple-users-1.svg +8 -0
- package/static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team--16w.svg +8 -0
- package/static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team.svg +8 -0
- package/static/assets/icons/ic_add.svg +5 -0
- package/static/assets/icons/ic_add_circle_outline.svg +3 -0
- package/static/assets/icons/ic_arrow_back.svg +3 -0
- package/static/assets/icons/ic_arrow_drop_down.svg +3 -0
- package/static/assets/icons/ic_arrow_forward.svg +3 -0
- package/static/assets/icons/ic_button.svg +3 -0
- package/static/assets/icons/ic_calendar.svg +12 -0
- package/static/assets/icons/ic_cancel.svg +8 -0
- package/static/assets/icons/ic_caution.svg +3 -0
- package/static/assets/icons/ic_caution_light_large.svg +5 -0
- package/static/assets/icons/ic_check_box.svg +3 -0
- package/static/assets/icons/ic_check_box_outline_blank.svg +3 -0
- package/static/assets/icons/ic_check_circle.svg +3 -0
- package/static/assets/icons/ic_close.svg +3 -0
- package/static/assets/icons/ic_colors.svg +8 -0
- package/static/assets/icons/ic_complete.svg +4 -0
- package/static/assets/icons/ic_css.svg +7 -0
- package/static/assets/icons/ic_dashboard.svg +11 -0
- package/static/assets/icons/ic_date.svg +9 -0
- package/static/assets/icons/ic_date_disable.svg +8 -0
- package/static/assets/icons/ic_delete.svg +7 -0
- package/static/assets/icons/ic_disable.svg +3 -0
- package/static/assets/icons/ic_drag_handle.svg +3 -0
- package/static/assets/icons/ic_drop_light_large.svg +14 -0
- package/static/assets/icons/ic_edit.svg +5 -0
- package/static/assets/icons/ic_email.svg +6 -0
- package/static/assets/icons/ic_fonts.svg +6 -0
- package/static/assets/icons/ic_fullscreen.svg +3 -0
- package/static/assets/icons/ic_fullscreen_exit.svg +3 -0
- package/static/assets/icons/ic_guests.svg +8 -0
- package/static/assets/icons/ic_help.svg +5 -0
- package/static/assets/icons/ic_home.svg +4 -0
- package/static/assets/icons/ic_indeterminate_check_box.svg +3 -0
- package/static/assets/icons/ic_keyboard_arrow_left.svg +3 -0
- package/static/assets/icons/ic_keyboard_arrow_right.svg +3 -0
- package/static/assets/icons/ic_late.svg +5 -0
- package/static/assets/icons/ic_launch.svg +18 -0
- package/static/assets/icons/ic_location.svg +4 -0
- package/static/assets/icons/ic_logout.svg +5 -0
- package/static/assets/icons/ic_menu.svg +3 -0
- package/static/assets/icons/ic_message.svg +5 -0
- package/static/assets/icons/ic_message_failed.svg +7 -0
- package/static/assets/icons/ic_messages.svg +8 -0
- package/static/assets/icons/ic_more.svg +5 -0
- package/static/assets/icons/ic_new_tab.svg +3 -0
- package/static/assets/icons/ic_note.svg +8 -0
- package/static/assets/icons/ic_payment_failed_solid.svg +5 -0
- package/static/assets/icons/ic_payment_success_solid.svg +5 -0
- package/static/assets/icons/ic_phone.svg +7 -0
- package/static/assets/icons/ic_pin.svg +4 -0
- package/static/assets/icons/ic_pin_outline.svg +4 -0
- package/static/assets/icons/ic_power.svg +4 -0
- package/static/assets/icons/ic_private.svg +5 -0
- package/static/assets/icons/ic_profile_image_light_large.svg +7 -0
- package/static/assets/icons/ic_public.svg +5 -0
- package/static/assets/icons/ic_radio_button_checked.svg +3 -0
- package/static/assets/icons/ic_radio_button_unchecked.svg +3 -0
- package/static/assets/icons/ic_rotate_left.svg +9 -0
- package/static/assets/icons/ic_rotate_right.svg +9 -0
- package/static/assets/icons/ic_search.svg +3 -0
- package/static/assets/icons/ic_settings.svg +4 -0
- package/static/assets/icons/ic_shop_light_large.svg +6 -0
- package/static/assets/icons/ic_show.svg +4 -0
- package/static/assets/icons/ic_skill.svg +3 -0
- package/static/assets/icons/ic_star_outline.svg +3 -0
- package/static/assets/icons/ic_star_solid.svg +3 -0
- package/static/assets/icons/ic_status.svg +8 -0
- package/static/assets/icons/ic_store.svg +7 -0
- package/static/assets/icons/ic_switch_users.svg +8 -0
- package/static/assets/icons/ic_team.svg +8 -0
- package/static/assets/icons/ic_teammates.svg +8 -0
- package/static/assets/icons/ic_unordered_list.svg +8 -0
- package/static/assets/icons/ic_upload.svg +8 -0
- package/static/assets/icons/ic_upload_file_light_large.svg +9 -0
- package/static/assets/icons/ic_upload_file_success_light_large.svg +7 -0
- package/static/assets/icons/ic_user_avatar.svg +3 -0
- package/static/assets/icons/ic_wifi.svg +9 -0
- package/static/assets/icons/s-ic_spruce-logo-02.svg +3 -0
- package/static/assets/icons/s-ic_spruce-logo.svg +3 -0
- package/static/assets/logo.png +0 -0
- package/static/assets/users/user-01--96w.png +0 -0
- package/static/assets/users/user-01.png +0 -0
- package/static/assets/users/user-02--96w.png +0 -0
- package/static/assets/users/user-03--96w.png +0 -0
- package/static/assets/users/user-04--96w.png +0 -0
- package/static/assets/users/user-04.png +0 -0
- package/static/assets/users/user-05--96w.png +0 -0
- package/static/assets/users/user-05.png +0 -0
- package/static/assets/users/user-06--96w.png +0 -0
- package/static/assets/users/user-06.png +0 -0
- package/static/assets/users/user-07--96w.png +0 -0
- package/static/assets/users/user-07.png +0 -0
- package/static/assets/users/user-08--96w.png +0 -0
- package/static/assets/users/user-08.png +0 -0
- package/static/assets/users/user-09--96w.png +0 -0
- package/static/assets/users/user-09.png +0 -0
- package/static/assets/users/user-placeholder--96w.png +0 -0
- package/static/assets/users/user-placeholder.png +0 -0
- package/static/browserconfig.xml +9 -0
- package/static/favicon-16x16.png +0 -0
- package/static/favicon-32x32.png +0 -0
- package/static/favicon.ico +0 -0
- package/static/mstile-150x150.png +0 -0
- package/static/safari-pinned-tab.svg +26 -0
- package/static/site.webmanifest +19 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@storybook/react");
|
|
8
|
+
|
|
9
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
10
|
+
|
|
11
|
+
var _ProfileSummary = _interopRequireDefault(require("./ProfileSummary"));
|
|
12
|
+
|
|
13
|
+
var _userPlaceholder96w = _interopRequireDefault(require("../../../../../static/assets/users/user-placeholder--96w.png"));
|
|
14
|
+
|
|
15
|
+
var stories = (0, _react2.storiesOf)('Profile Summary', module);
|
|
16
|
+
stories.addDecorator(_react3.withKnobs);
|
|
17
|
+
stories.add('Basic', function () {
|
|
18
|
+
return _react["default"].createElement(_ProfileSummary["default"], {
|
|
19
|
+
image: (0, _react3.text)('image', _userPlaceholder96w["default"]),
|
|
20
|
+
name: (0, _react3.text)('name', 'Dorian Feeney'),
|
|
21
|
+
onButtonClick: function onButtonClick() {
|
|
22
|
+
return console.log('onButtonClick');
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=ProfileSummary-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Core/components/ProfileSummary/ProfileSummary-story.js"],"names":["stories","module","addDecorator","withKnobs","add","defaultImageLg","console","log"],"mappings":";;;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,OAAO,GAAG,uBAAU,iBAAV,EAA6BC,MAA7B,CAAhB;AAEAD,OAAO,CAACE,YAAR,CAAqBC,iBAArB;AAEAH,OAAO,CAACI,GAAR,CAAY,OAAZ,EAAqB;AAAA,SACpB,gCAAC,0BAAD;AACC,IAAA,KAAK,EAAE,kBAAK,OAAL,EAAcC,8BAAd,CADR;AAEC,IAAA,IAAI,EAAE,kBAAK,MAAL,EAAa,eAAb,CAFP;AAGC,IAAA,aAAa,EAAE;AAAA,aAAMC,OAAO,CAACC,GAAR,CAAY,eAAZ,CAAN;AAAA;AAHhB,IADoB;AAAA,CAArB","sourcesContent":["// @flow\nimport React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, text } from '@storybook/addon-knobs/react'\nimport ProfileSummary from './ProfileSummary'\nimport defaultImageLg from '../../../../../static/assets/users/user-placeholder--96w.png'\n\nconst stories = storiesOf('Profile Summary', module)\n\nstories.addDecorator(withKnobs)\n\nstories.add('Basic', () => (\n\t<ProfileSummary\n\t\timage={text('image', defaultImageLg)}\n\t\tname={text('name', 'Dorian Feeney')}\n\t\tonButtonClick={() => console.log('onButtonClick')}\n\t/>\n))\n"],"file":"ProfileSummary-story.js"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Avatar = _interopRequireDefault(require("../../../Avatar/Avatar"));
|
|
13
|
+
|
|
14
|
+
var _Button = _interopRequireDefault(require("../../../Button/Button"));
|
|
15
|
+
|
|
16
|
+
var _Text = _interopRequireDefault(require("../../../Text/Text"));
|
|
17
|
+
|
|
18
|
+
var ProfileSummary = function ProfileSummary(props) {
|
|
19
|
+
var image = props.image,
|
|
20
|
+
name = props.name,
|
|
21
|
+
onButtonClick = props.onButtonClick;
|
|
22
|
+
return _react["default"].createElement("div", {
|
|
23
|
+
className: "profile-summary"
|
|
24
|
+
}, _react["default"].createElement(_Avatar["default"], {
|
|
25
|
+
image: image,
|
|
26
|
+
alt: name,
|
|
27
|
+
className: "profile-summary__avatar"
|
|
28
|
+
}), _react["default"].createElement(_Text["default"], {
|
|
29
|
+
className: "profile-summary__name"
|
|
30
|
+
}, name), _react["default"].createElement(_Button["default"], {
|
|
31
|
+
onClick: onButtonClick,
|
|
32
|
+
className: "profile-summary__btn",
|
|
33
|
+
icon: {
|
|
34
|
+
name: 'more_vertical',
|
|
35
|
+
isLineIcon: true
|
|
36
|
+
},
|
|
37
|
+
text: "More options",
|
|
38
|
+
isIconOnly: true,
|
|
39
|
+
isSmall: true
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
ProfileSummary.defaultProps = {};
|
|
44
|
+
var _default = ProfileSummary;
|
|
45
|
+
exports["default"] = _default;
|
|
46
|
+
//# sourceMappingURL=ProfileSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Core/components/ProfileSummary/ProfileSummary.js"],"names":["ProfileSummary","props","image","name","onButtonClick","isLineIcon","defaultProps"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAaA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAAkB;AAAA,MAChCC,KADgC,GACDD,KADC,CAChCC,KADgC;AAAA,MACzBC,IADyB,GACDF,KADC,CACzBE,IADyB;AAAA,MACnBC,aADmB,GACDH,KADC,CACnBG,aADmB;AAExC,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,gCAAC,kBAAD;AAAQ,IAAA,KAAK,EAAEF,KAAf;AAAsB,IAAA,GAAG,EAAEC,IAA3B;AAAiC,IAAA,SAAS,EAAC;AAA3C,IADD,EAEC,gCAAC,gBAAD;AAAM,IAAA,SAAS,EAAC;AAAhB,KAAyCA,IAAzC,CAFD,EAGC,gCAAC,kBAAD;AACC,IAAA,OAAO,EAAEC,aADV;AAEC,IAAA,SAAS,EAAC,sBAFX;AAGC,IAAA,IAAI,EAAE;AAAED,MAAAA,IAAI,EAAE,eAAR;AAAyBE,MAAAA,UAAU,EAAE;AAArC,KAHP;AAIC,IAAA,IAAI,EAAC,cAJN;AAKC,IAAA,UAAU,MALX;AAMC,IAAA,OAAO;AANR,IAHD,CADD;AAcA,CAhBD;;AAkBAL,cAAc,CAACM,YAAf,GAA8B,EAA9B;eAEeN,c","sourcesContent":["// @flow\nimport React from 'react'\nimport Avatar from '../../../Avatar/Avatar'\nimport Button from '../../../Button/Button'\nimport Text from '../../../Text/Text'\n\ntype Props = {\n\t/** User profile image */\n\timage: string,\n\n\t/** Use name */\n\tname: string,\n\n\t/** Function for the button */\n\tonButtonClick: Function\n}\n\nconst ProfileSummary = (props: Props) => {\n\tconst { image, name, onButtonClick } = props\n\treturn (\n\t\t<div className=\"profile-summary\">\n\t\t\t<Avatar image={image} alt={name} className=\"profile-summary__avatar\" />\n\t\t\t<Text className=\"profile-summary__name\">{name}</Text>\n\t\t\t<Button\n\t\t\t\tonClick={onButtonClick}\n\t\t\t\tclassName=\"profile-summary__btn\"\n\t\t\t\ticon={{ name: 'more_vertical', isLineIcon: true }}\n\t\t\t\ttext=\"More options\"\n\t\t\t\tisIconOnly\n\t\t\t\tisSmall\n\t\t\t/>\n\t\t</div>\n\t)\n}\n\nProfileSummary.defaultProps = {}\n\nexport default ProfileSummary\n"],"file":"ProfileSummary.js"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@storybook/react");
|
|
8
|
+
|
|
9
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
10
|
+
|
|
11
|
+
var _StylesProvider = _interopRequireDefault(require("../../../../../.storybook/StylesProvider"));
|
|
12
|
+
|
|
13
|
+
var _SaveBar = _interopRequireDefault(require("./SaveBar"));
|
|
14
|
+
|
|
15
|
+
var ProvideStyles = function ProvideStyles(storyFn) {
|
|
16
|
+
return _react["default"].createElement(_StylesProvider["default"], null, storyFn());
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var stories = (0, _react2.storiesOf)('Save Bar', module);
|
|
20
|
+
stories.addDecorator(ProvideStyles);
|
|
21
|
+
stories.addDecorator(_react3.withKnobs);
|
|
22
|
+
stories.add('Default', function () {
|
|
23
|
+
return _react["default"].createElement(_SaveBar["default"], {
|
|
24
|
+
isVisible: (0, _react3["boolean"])('isVisible', true),
|
|
25
|
+
isSaving: (0, _react3["boolean"])('isSaving', false),
|
|
26
|
+
isDiscarding: (0, _react3["boolean"])('isDiscarding', false),
|
|
27
|
+
isSaveDisabled: (0, _react3["boolean"])('isSaveDisabled', false),
|
|
28
|
+
isDiscardDisabled: (0, _react3["boolean"])('isDiscardDisabled', false),
|
|
29
|
+
onDiscard: function onDiscard() {
|
|
30
|
+
return console.log('DISCARD');
|
|
31
|
+
},
|
|
32
|
+
onSave: function onSave() {
|
|
33
|
+
return console.log('SAVE');
|
|
34
|
+
},
|
|
35
|
+
STORYBOOKdoNotWrap: true
|
|
36
|
+
});
|
|
37
|
+
}).add('Saving', function () {
|
|
38
|
+
return _react["default"].createElement(_SaveBar["default"], {
|
|
39
|
+
isVisible: (0, _react3["boolean"])('isVisible', true),
|
|
40
|
+
isSaving: (0, _react3["boolean"])('isSaving', false),
|
|
41
|
+
isDiscarding: (0, _react3["boolean"])('isDiscarding', false),
|
|
42
|
+
isSaveDisabled: (0, _react3["boolean"])('isSaveDisabled', false),
|
|
43
|
+
isDiscardDisabled: (0, _react3["boolean"])('isDiscardDisabled', false),
|
|
44
|
+
onDiscard: function onDiscard() {
|
|
45
|
+
return console.log('DISCARD');
|
|
46
|
+
},
|
|
47
|
+
onSave: function onSave() {
|
|
48
|
+
return console.log('SAVE');
|
|
49
|
+
},
|
|
50
|
+
STORYBOOKdoNotWrap: true
|
|
51
|
+
});
|
|
52
|
+
}).add('Discarding', function () {
|
|
53
|
+
return _react["default"].createElement(_SaveBar["default"], {
|
|
54
|
+
isVisible: (0, _react3["boolean"])('isVisible', true),
|
|
55
|
+
isSaving: (0, _react3["boolean"])('isSaving', false),
|
|
56
|
+
isDiscarding: (0, _react3["boolean"])('isDiscarding', false),
|
|
57
|
+
isSaveDisabled: (0, _react3["boolean"])('isSaveDisabled', false),
|
|
58
|
+
isDiscardDisabled: (0, _react3["boolean"])('isDiscardDisabled', false),
|
|
59
|
+
onDiscard: function onDiscard() {
|
|
60
|
+
return console.log('DISCARD');
|
|
61
|
+
},
|
|
62
|
+
onSave: function onSave() {
|
|
63
|
+
return console.log('SAVE');
|
|
64
|
+
},
|
|
65
|
+
STORYBOOKdoNotWrap: true
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=SaveBar-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Core/components/SaveBar/SaveBar-story.js"],"names":["ProvideStyles","storyFn","stories","module","addDecorator","withKnobs","add","console","log"],"mappings":";;;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAAAC,OAAO;AAAA,SAAI,gCAAC,0BAAD,QAAiBA,OAAO,EAAxB,CAAJ;AAAA,CAA7B;;AAEA,IAAMC,OAAO,GAAG,uBAAU,UAAV,EAAsBC,MAAtB,CAAhB;AAEAD,OAAO,CAACE,YAAR,CAAqBJ,aAArB;AACAE,OAAO,CAACE,YAAR,CAAqBC,iBAArB;AAEAH,OAAO,CACLI,GADF,CACM,SADN,EACiB;AAAA,SACf,gCAAC,mBAAD;AACC,IAAA,SAAS,EAAE,wBAAQ,WAAR,EAAqB,IAArB,CADZ;AAEC,IAAA,QAAQ,EAAE,wBAAQ,UAAR,EAAoB,KAApB,CAFX;AAGC,IAAA,YAAY,EAAE,wBAAQ,cAAR,EAAwB,KAAxB,CAHf;AAIC,IAAA,cAAc,EAAE,wBAAQ,gBAAR,EAA0B,KAA1B,CAJjB;AAKC,IAAA,iBAAiB,EAAE,wBAAQ,mBAAR,EAA6B,KAA7B,CALpB;AAMC,IAAA,SAAS,EAAE;AAAA,aAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAAN;AAAA,KANZ;AAOC,IAAA,MAAM,EAAE;AAAA,aAAMD,OAAO,CAACC,GAAR,CAAY,MAAZ,CAAN;AAAA,KAPT;AAQC,IAAA,kBAAkB;AARnB,IADe;AAAA,CADjB,EAaEF,GAbF,CAaM,QAbN,EAagB;AAAA,SACd,gCAAC,mBAAD;AACC,IAAA,SAAS,EAAE,wBAAQ,WAAR,EAAqB,IAArB,CADZ;AAEC,IAAA,QAAQ,EAAE,wBAAQ,UAAR,EAAoB,KAApB,CAFX;AAGC,IAAA,YAAY,EAAE,wBAAQ,cAAR,EAAwB,KAAxB,CAHf;AAIC,IAAA,cAAc,EAAE,wBAAQ,gBAAR,EAA0B,KAA1B,CAJjB;AAKC,IAAA,iBAAiB,EAAE,wBAAQ,mBAAR,EAA6B,KAA7B,CALpB;AAMC,IAAA,SAAS,EAAE;AAAA,aAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAAN;AAAA,KANZ;AAOC,IAAA,MAAM,EAAE;AAAA,aAAMD,OAAO,CAACC,GAAR,CAAY,MAAZ,CAAN;AAAA,KAPT;AAQC,IAAA,kBAAkB;AARnB,IADc;AAAA,CAbhB,EAyBEF,GAzBF,CAyBM,YAzBN,EAyBoB;AAAA,SAClB,gCAAC,mBAAD;AACC,IAAA,SAAS,EAAE,wBAAQ,WAAR,EAAqB,IAArB,CADZ;AAEC,IAAA,QAAQ,EAAE,wBAAQ,UAAR,EAAoB,KAApB,CAFX;AAGC,IAAA,YAAY,EAAE,wBAAQ,cAAR,EAAwB,KAAxB,CAHf;AAIC,IAAA,cAAc,EAAE,wBAAQ,gBAAR,EAA0B,KAA1B,CAJjB;AAKC,IAAA,iBAAiB,EAAE,wBAAQ,mBAAR,EAA6B,KAA7B,CALpB;AAMC,IAAA,SAAS,EAAE;AAAA,aAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAAN;AAAA,KANZ;AAOC,IAAA,MAAM,EAAE;AAAA,aAAMD,OAAO,CAACC,GAAR,CAAY,MAAZ,CAAN;AAAA,KAPT;AAQC,IAAA,kBAAkB;AARnB,IADkB;AAAA,CAzBpB","sourcesContent":["// @flow\nimport React from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, boolean } from '@storybook/addon-knobs/react'\nimport StylesProvider from '../../../../../.storybook/StylesProvider'\nimport SaveBar from './SaveBar'\n\nconst ProvideStyles = storyFn => <StylesProvider>{storyFn()}</StylesProvider>\n\nconst stories = storiesOf('Save Bar', module)\n\nstories.addDecorator(ProvideStyles)\nstories.addDecorator(withKnobs)\n\nstories\n\t.add('Default', () => (\n\t\t<SaveBar\n\t\t\tisVisible={boolean('isVisible', true)}\n\t\t\tisSaving={boolean('isSaving', false)}\n\t\t\tisDiscarding={boolean('isDiscarding', false)}\n\t\t\tisSaveDisabled={boolean('isSaveDisabled', false)}\n\t\t\tisDiscardDisabled={boolean('isDiscardDisabled', false)}\n\t\t\tonDiscard={() => console.log('DISCARD')}\n\t\t\tonSave={() => console.log('SAVE')}\n\t\t\tSTORYBOOKdoNotWrap\n\t\t/>\n\t))\n\t.add('Saving', () => (\n\t\t<SaveBar\n\t\t\tisVisible={boolean('isVisible', true)}\n\t\t\tisSaving={boolean('isSaving', false)}\n\t\t\tisDiscarding={boolean('isDiscarding', false)}\n\t\t\tisSaveDisabled={boolean('isSaveDisabled', false)}\n\t\t\tisDiscardDisabled={boolean('isDiscardDisabled', false)}\n\t\t\tonDiscard={() => console.log('DISCARD')}\n\t\t\tonSave={() => console.log('SAVE')}\n\t\t\tSTORYBOOKdoNotWrap\n\t\t/>\n\t))\n\t.add('Discarding', () => (\n\t\t<SaveBar\n\t\t\tisVisible={boolean('isVisible', true)}\n\t\t\tisSaving={boolean('isSaving', false)}\n\t\t\tisDiscarding={boolean('isDiscarding', false)}\n\t\t\tisSaveDisabled={boolean('isSaveDisabled', false)}\n\t\t\tisDiscardDisabled={boolean('isDiscardDisabled', false)}\n\t\t\tonDiscard={() => console.log('DISCARD')}\n\t\t\tonSave={() => console.log('SAVE')}\n\t\t\tSTORYBOOKdoNotWrap\n\t\t/>\n\t))\n"],"file":"SaveBar-story.js"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
|
+
|
|
16
|
+
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
+
|
|
18
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
+
|
|
20
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
+
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
25
|
+
|
|
26
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
27
|
+
|
|
28
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
+
|
|
30
|
+
var _Button = _interopRequireDefault(require("../../../Button/Button"));
|
|
31
|
+
|
|
32
|
+
var _reactTransitionGroup = require("react-transition-group");
|
|
33
|
+
|
|
34
|
+
var SaveBar =
|
|
35
|
+
/*#__PURE__*/
|
|
36
|
+
function (_React$PureComponent) {
|
|
37
|
+
(0, _inherits2["default"])(SaveBar, _React$PureComponent);
|
|
38
|
+
|
|
39
|
+
function SaveBar() {
|
|
40
|
+
var _getPrototypeOf2;
|
|
41
|
+
|
|
42
|
+
var _this;
|
|
43
|
+
|
|
44
|
+
(0, _classCallCheck2["default"])(this, SaveBar);
|
|
45
|
+
|
|
46
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
+
args[_key] = arguments[_key];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(SaveBar)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
51
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_element", null);
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
(0, _createClass2["default"])(SaveBar, [{
|
|
56
|
+
key: "componentDidMount",
|
|
57
|
+
value: function componentDidMount() {
|
|
58
|
+
this._element = document.body;
|
|
59
|
+
this.forceUpdate();
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
key: "render",
|
|
63
|
+
value: function render() {
|
|
64
|
+
var _this$props = this.props,
|
|
65
|
+
location = _this$props.location,
|
|
66
|
+
message = _this$props.message,
|
|
67
|
+
isVisible = _this$props.isVisible,
|
|
68
|
+
isDiscarding = _this$props.isDiscarding,
|
|
69
|
+
isSaving = _this$props.isSaving,
|
|
70
|
+
isDiscardDisabled = _this$props.isDiscardDisabled,
|
|
71
|
+
isSaveDisabled = _this$props.isSaveDisabled,
|
|
72
|
+
onDiscard = _this$props.onDiscard,
|
|
73
|
+
onSave = _this$props.onSave;
|
|
74
|
+
|
|
75
|
+
if (!this._element) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return _reactDom["default"].createPortal(_react["default"].createElement(_reactTransitionGroup.CSSTransition, {
|
|
80
|
+
"in": isVisible,
|
|
81
|
+
appear: true,
|
|
82
|
+
classNames: "save-bar",
|
|
83
|
+
timeout: 100
|
|
84
|
+
}, _react["default"].createElement("div", {
|
|
85
|
+
className: (0, _classnames["default"])('save-bar', {
|
|
86
|
+
'save-bar--visible': isVisible
|
|
87
|
+
})
|
|
88
|
+
}, _react["default"].createElement("div", {
|
|
89
|
+
className: "save-bar__left"
|
|
90
|
+
}, location && location.name ? _react["default"].createElement("p", {
|
|
91
|
+
className: "save-bar__text"
|
|
92
|
+
}, location.name) : _react["default"].createElement("p", {
|
|
93
|
+
className: "save-bar__text"
|
|
94
|
+
}, "Spruce")), _react["default"].createElement("div", {
|
|
95
|
+
className: "save-bar__right"
|
|
96
|
+
}, _react["default"].createElement("p", {
|
|
97
|
+
className: "save-bar__title"
|
|
98
|
+
}, message), onDiscard && _react["default"].createElement(_Button["default"], {
|
|
99
|
+
kind: "simple",
|
|
100
|
+
text: "Discard",
|
|
101
|
+
onClick: onDiscard,
|
|
102
|
+
disabled: isDiscardDisabled || isDiscarding || isSaving,
|
|
103
|
+
isLoading: isDiscarding,
|
|
104
|
+
isSmall: true
|
|
105
|
+
}), _react["default"].createElement(_Button["default"], {
|
|
106
|
+
kind: "primary",
|
|
107
|
+
text: "Save",
|
|
108
|
+
onClick: onSave,
|
|
109
|
+
disabled: isSaveDisabled || isDiscarding || isSaving,
|
|
110
|
+
isLoading: isSaving,
|
|
111
|
+
isSmall: true
|
|
112
|
+
})))), this._element);
|
|
113
|
+
}
|
|
114
|
+
}]);
|
|
115
|
+
return SaveBar;
|
|
116
|
+
}(_react["default"].PureComponent);
|
|
117
|
+
|
|
118
|
+
exports["default"] = SaveBar;
|
|
119
|
+
(0, _defineProperty2["default"])(SaveBar, "defaultProps", {
|
|
120
|
+
message: 'Unsaved changes',
|
|
121
|
+
isVisible: false,
|
|
122
|
+
isDiscarding: false,
|
|
123
|
+
isSaving: false,
|
|
124
|
+
isDiscardDisabled: false,
|
|
125
|
+
isSaveDisabled: false
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=SaveBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Core/components/SaveBar/SaveBar.js"],"names":["SaveBar","_element","document","body","forceUpdate","props","location","message","isVisible","isDiscarding","isSaving","isDiscardDisabled","isSaveDisabled","onDiscard","onSave","ReactDOM","createPortal","name","React","PureComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;IAiCqBA,O;;;;;;;;;;;;;;;;;iGACT,I;;;;;;wCAWS;AACnB,WAAKC,QAAL,GAAgBC,QAAQ,CAACC,IAAzB;AACA,WAAKC,WAAL;AACA;;;6BAEQ;AAAA,wBAWJ,KAAKC,KAXD;AAAA,UAEPC,QAFO,eAEPA,QAFO;AAAA,UAGPC,OAHO,eAGPA,OAHO;AAAA,UAIPC,SAJO,eAIPA,SAJO;AAAA,UAKPC,YALO,eAKPA,YALO;AAAA,UAMPC,QANO,eAMPA,QANO;AAAA,UAOPC,iBAPO,eAOPA,iBAPO;AAAA,UAQPC,cARO,eAQPA,cARO;AAAA,UASPC,SATO,eASPA,SATO;AAAA,UAUPC,MAVO,eAUPA,MAVO;;AAaR,UAAI,CAAC,KAAKb,QAAV,EAAoB;AACnB,eAAO,IAAP;AACA;;AAED,aAAOc,qBAASC,YAAT,CACN,gCAAC,mCAAD;AACC,cAAIR,SADL;AAEC,QAAA,MAAM,EAAE,IAFT;AAGC,QAAA,UAAU,EAAC,UAHZ;AAIC,QAAA,OAAO,EAAE;AAJV,SAMC;AAAK,QAAA,SAAS,EAAE,4BAAG,UAAH,EAAe;AAAE,+BAAqBA;AAAvB,SAAf;AAAhB,SACC;AAAK,QAAA,SAAS,EAAC;AAAf,SACEF,QAAQ,IAAIA,QAAQ,CAACW,IAArB,GACA;AAAG,QAAA,SAAS,EAAC;AAAb,SAA+BX,QAAQ,CAACW,IAAxC,CADA,GAGA;AAAG,QAAA,SAAS,EAAC;AAAb,kBAJF,CADD,EASC;AAAK,QAAA,SAAS,EAAC;AAAf,SACC;AAAG,QAAA,SAAS,EAAC;AAAb,SAAgCV,OAAhC,CADD,EAEEM,SAAS,IACT,gCAAC,kBAAD;AACC,QAAA,IAAI,EAAC,QADN;AAEC,QAAA,IAAI,EAAC,SAFN;AAGC,QAAA,OAAO,EAAEA,SAHV;AAIC,QAAA,QAAQ,EAAEF,iBAAiB,IAAKF,YAAY,IAAIC,QAJjD;AAKC,QAAA,SAAS,EAAED,YALZ;AAMC,QAAA,OAAO;AANR,QAHF,EAYC,gCAAC,kBAAD;AACC,QAAA,IAAI,EAAC,SADN;AAEC,QAAA,IAAI,EAAC,MAFN;AAGC,QAAA,OAAO,EAAEK,MAHV;AAIC,QAAA,QAAQ,EAAEF,cAAc,IAAKH,YAAY,IAAIC,QAJ9C;AAKC,QAAA,SAAS,EAAEA,QALZ;AAMC,QAAA,OAAO;AANR,QAZD,CATD,CAND,CADM,EAuCN,KAAKT,QAvCC,CAAP;AAyCA;;;EA3EmCiB,kBAAMC,a;;;iCAAtBnB,O,kBAGE;AACrBO,EAAAA,OAAO,EAAE,iBADY;AAErBC,EAAAA,SAAS,EAAE,KAFU;AAGrBC,EAAAA,YAAY,EAAE,KAHO;AAIrBC,EAAAA,QAAQ,EAAE,KAJW;AAKrBC,EAAAA,iBAAiB,EAAE,KALE;AAMrBC,EAAAA,cAAc,EAAE;AANK,C","sourcesContent":["// @flow\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport cx from 'classnames'\nimport Button from '../../../Button/Button'\nimport { CSSTransition } from 'react-transition-group'\n\nexport type Props = {\n\t/** The current location */\n\tlocation?: Object,\n\n\t/** The message to display in the Save Bar */\n\tmessage?: string,\n\n\t/** Set to true to show the save bar */\n\tisVisible: boolean,\n\n\t/** Set to true to disable the discard button */\n\tisDiscardDisabled: Boolean,\n\n\t/** Set to true to disable the save button */\n\tisSaveDisabled: boolean,\n\n\t/** Set to true while the discard action is being executed */\n\tisDiscarding: boolean,\n\n\t/** Set to true while the save action is being executed */\n\tisSaving: boolean,\n\n\t/** The function to execute when user selects discard */\n\tonDiscard?: Function,\n\n\t/** The function to execute when user selects save */\n\tonSave: Function\n}\n\ntype State = {}\n\nexport default class SaveBar extends React.PureComponent<Props, State> {\n\t_element = null\n\n\tstatic defaultProps = {\n\t\tmessage: 'Unsaved changes',\n\t\tisVisible: false,\n\t\tisDiscarding: false,\n\t\tisSaving: false,\n\t\tisDiscardDisabled: false,\n\t\tisSaveDisabled: false\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._element = document.body\n\t\tthis.forceUpdate()\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tlocation,\n\t\t\tmessage,\n\t\t\tisVisible,\n\t\t\tisDiscarding,\n\t\t\tisSaving,\n\t\t\tisDiscardDisabled,\n\t\t\tisSaveDisabled,\n\t\t\tonDiscard,\n\t\t\tonSave\n\t\t} = this.props\n\n\t\tif (!this._element) {\n\t\t\treturn null\n\t\t}\n\n\t\treturn ReactDOM.createPortal(\n\t\t\t<CSSTransition\n\t\t\t\tin={isVisible}\n\t\t\t\tappear={true}\n\t\t\t\tclassNames=\"save-bar\"\n\t\t\t\ttimeout={100}\n\t\t\t>\n\t\t\t\t<div className={cx('save-bar', { 'save-bar--visible': isVisible })}>\n\t\t\t\t\t<div className=\"save-bar__left\">\n\t\t\t\t\t\t{location && location.name ? (\n\t\t\t\t\t\t\t<p className=\"save-bar__text\">{location.name}</p>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<p className=\"save-bar__text\">Spruce</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"save-bar__right\">\n\t\t\t\t\t\t<p className=\"save-bar__title\">{message}</p>\n\t\t\t\t\t\t{onDiscard && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tkind=\"simple\"\n\t\t\t\t\t\t\t\ttext=\"Discard\"\n\t\t\t\t\t\t\t\tonClick={onDiscard}\n\t\t\t\t\t\t\t\tdisabled={isDiscardDisabled || (isDiscarding || isSaving)}\n\t\t\t\t\t\t\t\tisLoading={isDiscarding}\n\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkind=\"primary\"\n\t\t\t\t\t\t\ttext=\"Save\"\n\t\t\t\t\t\t\tonClick={onSave}\n\t\t\t\t\t\t\tdisabled={isSaveDisabled || (isDiscarding || isSaving)}\n\t\t\t\t\t\t\tisLoading={isSaving}\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</CSSTransition>,\n\t\t\tthis._element\n\t\t)\n\t}\n}\n"],"file":"SaveBar.js"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
8
|
+
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
|
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
+
|
|
13
|
+
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
|
|
15
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
16
|
+
|
|
17
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
|
+
|
|
19
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
|
+
|
|
21
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
22
|
+
|
|
23
|
+
var _react2 = require("@storybook/react");
|
|
24
|
+
|
|
25
|
+
var _react3 = require("@storybook/addon-knobs/react");
|
|
26
|
+
|
|
27
|
+
var _StylesProvider = _interopRequireDefault(require("../../../../../.storybook/StylesProvider"));
|
|
28
|
+
|
|
29
|
+
var _Sidebar = _interopRequireDefault(require("./Sidebar"));
|
|
30
|
+
|
|
31
|
+
var HomeIcon = function HomeIcon(props) {
|
|
32
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
33
|
+
d: "M3.502 9.297v5.5h4v-4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v4h4v-5.5M1.502 8.297l6.793-6.793a1 1 0 0 1 1.414 0l6.793 6.793",
|
|
34
|
+
strokeWidth: "1.5",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round"
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
HomeIcon.defaultProps = {
|
|
41
|
+
width: "18",
|
|
42
|
+
height: "16",
|
|
43
|
+
viewBox: "0 0 18 16",
|
|
44
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var TeamsIcon = function TeamsIcon(props) {
|
|
48
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
49
|
+
d: "M4.133 6.854a4.567 4.567 0 0 0 5.095 1.024",
|
|
50
|
+
strokeWidth: "1.5",
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeLinejoin: "round"
|
|
53
|
+
}), _react["default"].createElement("path", {
|
|
54
|
+
clipRule: "evenodd",
|
|
55
|
+
d: "M6.5 11a2.75 2.75 0 1 0 0-5.5 2.75 2.75 0 0 0 0 5.5z",
|
|
56
|
+
strokeWidth: "1.5",
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round"
|
|
59
|
+
}), _react["default"].createElement("path", {
|
|
60
|
+
clipRule: "evenodd",
|
|
61
|
+
d: "M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15z",
|
|
62
|
+
strokeWidth: "1.5",
|
|
63
|
+
strokeLinecap: "round",
|
|
64
|
+
strokeLinejoin: "round"
|
|
65
|
+
}), _react["default"].createElement("path", {
|
|
66
|
+
d: "M10.991 16.232a4.5 4.5 0 0 0-7.924-2.643",
|
|
67
|
+
strokeWidth: "1.5",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round"
|
|
70
|
+
}), _react["default"].createElement("path", {
|
|
71
|
+
clipRule: "evenodd",
|
|
72
|
+
d: "M12.75 11.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5z",
|
|
73
|
+
strokeWidth: "1.5",
|
|
74
|
+
strokeLinecap: "round",
|
|
75
|
+
strokeLinejoin: "round"
|
|
76
|
+
}), _react["default"].createElement("path", {
|
|
77
|
+
d: "M15.183 13.246a3 3 0 0 0-5.146.472",
|
|
78
|
+
strokeWidth: "1.5",
|
|
79
|
+
strokeLinecap: "round",
|
|
80
|
+
strokeLinejoin: "round"
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
TeamsIcon.defaultProps = {
|
|
85
|
+
width: "18",
|
|
86
|
+
height: "18",
|
|
87
|
+
viewBox: "0 0 18 18",
|
|
88
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var NotificationsIcon = function NotificationsIcon(props) {
|
|
92
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
93
|
+
d: "M14.138 5.497a6.067 6.067 0 1 0-10.857 5.261L1.5 14.5l3.741-1.782c.69.43 1.457.716 2.259.842M5.5 5.5h5M5.5 8.5h2",
|
|
94
|
+
strokeWidth: "1.5",
|
|
95
|
+
strokeLinecap: "round",
|
|
96
|
+
strokeLinejoin: "round"
|
|
97
|
+
}), _react["default"].createElement("path", {
|
|
98
|
+
clipRule: "evenodd",
|
|
99
|
+
d: "M12.921 8a3.563 3.563 0 0 1 2.684 5.924l.448 2.576-2.334-1.439A3.576 3.576 0 1 1 12.92 8h.002z",
|
|
100
|
+
strokeWidth: "1.5",
|
|
101
|
+
strokeLinecap: "round",
|
|
102
|
+
strokeLinejoin: "round"
|
|
103
|
+
}), _react["default"].createElement("path", {
|
|
104
|
+
d: "M14 10.5h-2M14 12.5h-2",
|
|
105
|
+
strokeWidth: "1.5",
|
|
106
|
+
strokeLinecap: "round",
|
|
107
|
+
strokeLinejoin: "round"
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
NotificationsIcon.defaultProps = {
|
|
112
|
+
width: "18",
|
|
113
|
+
height: "18",
|
|
114
|
+
viewBox: "0 0 18 18",
|
|
115
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var ProvideStyles = function ProvideStyles(storyFn) {
|
|
119
|
+
return _react["default"].createElement(_StylesProvider["default"], null, storyFn());
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var stories = (0, _react2.storiesOf)('Sidebar', module);
|
|
123
|
+
stories.addDecorator(ProvideStyles);
|
|
124
|
+
stories.addDecorator(_react3.withKnobs);
|
|
125
|
+
var personalItems = [{
|
|
126
|
+
text: 'Home',
|
|
127
|
+
icon: _react["default"].createElement(HomeIcon, {
|
|
128
|
+
className: "sidebar-item__line-icon"
|
|
129
|
+
}),
|
|
130
|
+
isCurrent: true,
|
|
131
|
+
href: '#'
|
|
132
|
+
}, {
|
|
133
|
+
text: 'Teams',
|
|
134
|
+
icon: _react["default"].createElement(TeamsIcon, {
|
|
135
|
+
className: "sidebar-item__line-icon"
|
|
136
|
+
}),
|
|
137
|
+
isCurrent: false,
|
|
138
|
+
href: '#'
|
|
139
|
+
}, {
|
|
140
|
+
text: 'Notification Preferences',
|
|
141
|
+
icon: _react["default"].createElement(NotificationsIcon, {
|
|
142
|
+
className: "sidebar-item__line-icon"
|
|
143
|
+
}),
|
|
144
|
+
isCurrent: false,
|
|
145
|
+
href: '#'
|
|
146
|
+
}];
|
|
147
|
+
var backLink = {
|
|
148
|
+
text: 'Organization Dashboard',
|
|
149
|
+
href: '#'
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var Example =
|
|
153
|
+
/*#__PURE__*/
|
|
154
|
+
function (_Component) {
|
|
155
|
+
(0, _inherits2["default"])(Example, _Component);
|
|
156
|
+
|
|
157
|
+
function Example() {
|
|
158
|
+
var _getPrototypeOf2;
|
|
159
|
+
|
|
160
|
+
var _this;
|
|
161
|
+
|
|
162
|
+
(0, _classCallCheck2["default"])(this, Example);
|
|
163
|
+
|
|
164
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
165
|
+
args[_key] = arguments[_key];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(Example)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
169
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
170
|
+
showSidebar: true
|
|
171
|
+
});
|
|
172
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleToggleSidebar", function () {
|
|
173
|
+
_this.setState(function (prevState) {
|
|
174
|
+
return {
|
|
175
|
+
showSidebar: !prevState.showSidebar
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
return _this;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
(0, _createClass2["default"])(Example, [{
|
|
183
|
+
key: "render",
|
|
184
|
+
value: function render() {
|
|
185
|
+
var showSidebar = this.state.showSidebar;
|
|
186
|
+
return _react["default"].createElement(_Sidebar["default"], {
|
|
187
|
+
items: personalItems,
|
|
188
|
+
backLink: backLink,
|
|
189
|
+
isExpanded: showSidebar,
|
|
190
|
+
toggleExpanded: this.handleToggleSidebar,
|
|
191
|
+
forceCloseSidebar: function forceCloseSidebar() {
|
|
192
|
+
return null;
|
|
193
|
+
},
|
|
194
|
+
STORYBOOKdoNotWrap: true
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}]);
|
|
198
|
+
return Example;
|
|
199
|
+
}(_react.Component);
|
|
200
|
+
|
|
201
|
+
stories.add('Default', function () {
|
|
202
|
+
return _react["default"].createElement(Example, null);
|
|
203
|
+
});
|
|
204
|
+
//# sourceMappingURL=Sidebar-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Core/components/Sidebar/Sidebar-story.js"],"names":["HomeIcon","TeamsIcon","NotificationsIcon","ProvideStyles","storyFn","stories","module","addDecorator","withKnobs","personalItems","text","icon","isCurrent","href","backLink","Example","showSidebar","setState","prevState","state","handleToggleSidebar","Component","add"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;IACOA,Q,YAAAA,Q;;;;;;;;;AAAAA,Q;;;;;;;IACAC,S,YAAAA,S;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,S;;;;;;;IACAC,iB,YAAAA,iB;;;;;;;;;;;;;;;;;;;;AAAAA,iB;;;;;;;AAEP,IAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAAAC,OAAO;AAAA,SAAI,gCAAC,0BAAD,QAAiBA,OAAO,EAAxB,CAAJ;AAAA,CAA7B;;AAEA,IAAMC,OAAO,GAAG,uBAAU,SAAV,EAAqBC,MAArB,CAAhB;AAEAD,OAAO,CAACE,YAAR,CAAqBJ,aAArB;AACAE,OAAO,CAACE,YAAR,CAAqBC,iBAArB;AAEA,IAAMC,aAAa,GAAG,CACrB;AACCC,EAAAA,IAAI,EAAE,MADP;AAECC,EAAAA,IAAI,EAAE,gCAAC,QAAD;AAAU,IAAA,SAAS,EAAC;AAApB,IAFP;AAGCC,EAAAA,SAAS,EAAE,IAHZ;AAICC,EAAAA,IAAI,EAAE;AAJP,CADqB,EAOrB;AACCH,EAAAA,IAAI,EAAE,OADP;AAECC,EAAAA,IAAI,EAAE,gCAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,IAFP;AAGCC,EAAAA,SAAS,EAAE,KAHZ;AAICC,EAAAA,IAAI,EAAE;AAJP,CAPqB,EAarB;AACCH,EAAAA,IAAI,EAAE,0BADP;AAECC,EAAAA,IAAI,EAAE,gCAAC,iBAAD;AAAmB,IAAA,SAAS,EAAC;AAA7B,IAFP;AAGCC,EAAAA,SAAS,EAAE,KAHZ;AAICC,EAAAA,IAAI,EAAE;AAJP,CAbqB,CAAtB;AAqBA,IAAMC,QAAQ,GAAG;AAChBJ,EAAAA,IAAI,EAAE,wBADU;AAEhBG,EAAAA,IAAI,EAAE;AAFU,CAAjB;;IAKME,O;;;;;;;;;;;;;;;;;8FACG;AACPC,MAAAA,WAAW,EAAE;AADN,K;4GAIc,YAAM;AAC3B,YAAKC,QAAL,CAAc,UAAAC,SAAS;AAAA,eAAK;AAC3BF,UAAAA,WAAW,EAAE,CAACE,SAAS,CAACF;AADG,SAAL;AAAA,OAAvB;AAGA,K;;;;;;6BAEQ;AAAA,UACAA,WADA,GACgB,KAAKG,KADrB,CACAH,WADA;AAGR,aACC,gCAAC,mBAAD;AACC,QAAA,KAAK,EAAEP,aADR;AAEC,QAAA,QAAQ,EAAEK,QAFX;AAGC,QAAA,UAAU,EAAEE,WAHb;AAIC,QAAA,cAAc,EAAE,KAAKI,mBAJtB;AAKC,QAAA,iBAAiB,EAAE;AAAA,iBAAM,IAAN;AAAA,SALpB;AAMC,QAAA,kBAAkB;AANnB,QADD;AAUA;;;EAxBoBC,gB;;AA2BtBhB,OAAO,CAACiB,GAAR,CAAY,SAAZ,EAAuB;AAAA,SAAM,gCAAC,OAAD,OAAN;AAAA,CAAvB","sourcesContent":["// @flow\nimport React, { Component } from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs } from '@storybook/addon-knobs/react'\nimport StylesProvider from '../../../../../.storybook/StylesProvider'\nimport Sidebar from './Sidebar'\nimport HomeIcon from '../../../../../static/assets/icons/Interface-Essential/Home/house-1--16w.svg'\nimport TeamsIcon from '../../../../../static/assets/icons/Work-Office-Companies/Human-Resources/human-resources-search-team--16w.svg'\nimport NotificationsIcon from '../../../../../static/assets/icons/Messages-Chat-Smileys/Conversation/conversation-text--16w.svg'\n\nconst ProvideStyles = storyFn => <StylesProvider>{storyFn()}</StylesProvider>\n\nconst stories = storiesOf('Sidebar', module)\n\nstories.addDecorator(ProvideStyles)\nstories.addDecorator(withKnobs)\n\nconst personalItems = [\n\t{\n\t\ttext: 'Home',\n\t\ticon: <HomeIcon className=\"sidebar-item__line-icon\" />,\n\t\tisCurrent: true,\n\t\thref: '#'\n\t},\n\t{\n\t\ttext: 'Teams',\n\t\ticon: <TeamsIcon className=\"sidebar-item__line-icon\" />,\n\t\tisCurrent: false,\n\t\thref: '#'\n\t},\n\t{\n\t\ttext: 'Notification Preferences',\n\t\ticon: <NotificationsIcon className=\"sidebar-item__line-icon\" />,\n\t\tisCurrent: false,\n\t\thref: '#'\n\t}\n]\n\nconst backLink = {\n\ttext: 'Organization Dashboard',\n\thref: '#'\n}\n\nclass Example extends Component {\n\tstate = {\n\t\tshowSidebar: true\n\t}\n\n\thandleToggleSidebar = () => {\n\t\tthis.setState(prevState => ({\n\t\t\tshowSidebar: !prevState.showSidebar\n\t\t}))\n\t}\n\n\trender() {\n\t\tconst { showSidebar } = this.state\n\n\t\treturn (\n\t\t\t<Sidebar\n\t\t\t\titems={personalItems}\n\t\t\t\tbackLink={backLink}\n\t\t\t\tisExpanded={showSidebar}\n\t\t\t\ttoggleExpanded={this.handleToggleSidebar}\n\t\t\t\tforceCloseSidebar={() => null}\n\t\t\t\tSTORYBOOKdoNotWrap\n\t\t\t/>\n\t\t)\n\t}\n}\n\nstories.add('Default', () => <Example />)\n"],"file":"Sidebar-story.js"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _SidebarExpander = _interopRequireDefault(require("./components/SidebarExpander/SidebarExpander"));
|
|
17
|
+
|
|
18
|
+
var _SidebarItem = _interopRequireDefault(require("./components/SidebarItem/SidebarItem"));
|
|
19
|
+
|
|
20
|
+
var _SidebarSection = _interopRequireDefault(require("./components/SidebarSection/SidebarSection"));
|
|
21
|
+
|
|
22
|
+
var _Button = _interopRequireDefault(require("../../../Button/Button"));
|
|
23
|
+
|
|
24
|
+
var _Text = _interopRequireDefault(require("../../../Text/Text"));
|
|
25
|
+
|
|
26
|
+
var Sidebar = function Sidebar(props) {
|
|
27
|
+
var items = props.items,
|
|
28
|
+
backLink = props.backLink,
|
|
29
|
+
children = props.children,
|
|
30
|
+
footer = props.footer,
|
|
31
|
+
forceCloseSidebar = props.forceCloseSidebar,
|
|
32
|
+
toggleExpanded = props.toggleExpanded,
|
|
33
|
+
isExpanded = props.isExpanded,
|
|
34
|
+
isLarge = props.isLarge,
|
|
35
|
+
isCollapsible = props.isCollapsible,
|
|
36
|
+
isMobileExpanded = props.isMobileExpanded,
|
|
37
|
+
side = props.side,
|
|
38
|
+
mobileHeader = props.mobileHeader;
|
|
39
|
+
return _react["default"].createElement("aside", {
|
|
40
|
+
className: (0, _classnames["default"])('sidebar', {
|
|
41
|
+
'sidebar--left': side === 'left',
|
|
42
|
+
'sidebar--right': side === 'right',
|
|
43
|
+
'sidebar--large': isLarge,
|
|
44
|
+
'sidebar--is-collapsed': !isExpanded,
|
|
45
|
+
'sidebar--is-mobile-expanded': isMobileExpanded
|
|
46
|
+
})
|
|
47
|
+
}, mobileHeader && _react["default"].createElement(_SidebarSection["default"], {
|
|
48
|
+
className: "sidebar-header sidebar-header--mobile"
|
|
49
|
+
}, _react["default"].createElement(_Text["default"], {
|
|
50
|
+
className: "sidebar-header__title"
|
|
51
|
+
}, mobileHeader.title), mobileHeader.action && _react["default"].createElement(_Button["default"], mobileHeader.action)), _react["default"].createElement("div", {
|
|
52
|
+
className: "sidebar__inner"
|
|
53
|
+
}, items && items.length > 0 && _react["default"].createElement("ul", {
|
|
54
|
+
className: "sidebar__items"
|
|
55
|
+
}, items.map(function (item, idx) {
|
|
56
|
+
return _react["default"].createElement(_SidebarItem["default"], (0, _extends2["default"])({
|
|
57
|
+
key: idx
|
|
58
|
+
}, item));
|
|
59
|
+
}), backLink && _react["default"].createElement(_SidebarItem["default"], (0, _extends2["default"])({
|
|
60
|
+
key: "sidebar-back-link",
|
|
61
|
+
className: "sidebar-item__back-link",
|
|
62
|
+
icon: backLink.icon || {
|
|
63
|
+
name: 'arrow_back',
|
|
64
|
+
className: 'sidebar-item__icon--fill'
|
|
65
|
+
}
|
|
66
|
+
}, backLink))), _react["default"].createElement("div", {
|
|
67
|
+
className: "sidebar__content"
|
|
68
|
+
}, children && children)), footer && footer, isCollapsible && _react["default"].createElement(_SidebarExpander["default"], {
|
|
69
|
+
toggleExpanded: toggleExpanded,
|
|
70
|
+
isExpanded: isExpanded,
|
|
71
|
+
forceCloseSidebar: forceCloseSidebar
|
|
72
|
+
}));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
Sidebar.defaultProps = {
|
|
76
|
+
isExpanded: true,
|
|
77
|
+
isLarge: false,
|
|
78
|
+
isCollapsible: true,
|
|
79
|
+
items: [],
|
|
80
|
+
children: null,
|
|
81
|
+
footer: null,
|
|
82
|
+
isMobileExpanded: false,
|
|
83
|
+
mobileHeader: null
|
|
84
|
+
};
|
|
85
|
+
var _default = Sidebar;
|
|
86
|
+
exports["default"] = _default;
|
|
87
|
+
//# sourceMappingURL=Sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Core/components/Sidebar/Sidebar.js"],"names":["Sidebar","props","items","backLink","children","footer","forceCloseSidebar","toggleExpanded","isExpanded","isLarge","isCollapsible","isMobileExpanded","side","mobileHeader","title","action","length","map","item","idx","icon","name","className","defaultProps"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AA6CA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAkB;AAAA,MAEhCC,KAFgC,GAc7BD,KAd6B,CAEhCC,KAFgC;AAAA,MAGhCC,QAHgC,GAc7BF,KAd6B,CAGhCE,QAHgC;AAAA,MAIhCC,QAJgC,GAc7BH,KAd6B,CAIhCG,QAJgC;AAAA,MAKhCC,MALgC,GAc7BJ,KAd6B,CAKhCI,MALgC;AAAA,MAMhCC,iBANgC,GAc7BL,KAd6B,CAMhCK,iBANgC;AAAA,MAOhCC,cAPgC,GAc7BN,KAd6B,CAOhCM,cAPgC;AAAA,MAQhCC,UARgC,GAc7BP,KAd6B,CAQhCO,UARgC;AAAA,MAShCC,OATgC,GAc7BR,KAd6B,CAShCQ,OATgC;AAAA,MAUhCC,aAVgC,GAc7BT,KAd6B,CAUhCS,aAVgC;AAAA,MAWhCC,gBAXgC,GAc7BV,KAd6B,CAWhCU,gBAXgC;AAAA,MAYhCC,IAZgC,GAc7BX,KAd6B,CAYhCW,IAZgC;AAAA,MAahCC,YAbgC,GAc7BZ,KAd6B,CAahCY,YAbgC;AAgBjC,SACC;AACC,IAAA,SAAS,EAAE,4BAAG,SAAH,EAAc;AACxB,uBAAiBD,IAAI,KAAK,MADF;AAExB,wBAAkBA,IAAI,KAAK,OAFH;AAGxB,wBAAkBH,OAHM;AAIxB,+BAAyB,CAACD,UAJF;AAKxB,qCAA+BG;AALP,KAAd;AADZ,KASEE,YAAY,IACZ,gCAAC,0BAAD;AAAgB,IAAA,SAAS,EAAC;AAA1B,KACC,gCAAC,gBAAD;AAAM,IAAA,SAAS,EAAC;AAAhB,KAAyCA,YAAY,CAACC,KAAtD,CADD,EAEED,YAAY,CAACE,MAAb,IAAuB,gCAAC,kBAAD,EAAYF,YAAY,CAACE,MAAzB,CAFzB,CAVF,EAeC;AAAK,IAAA,SAAS,EAAC;AAAf,KACEb,KAAK,IAAIA,KAAK,CAACc,MAAN,GAAe,CAAxB,IACA;AAAI,IAAA,SAAS,EAAC;AAAd,KACEd,KAAK,CAACe,GAAN,CAAU,UAACC,IAAD,EAAOC,GAAP;AAAA,WACV,gCAAC,uBAAD;AAAa,MAAA,GAAG,EAAEA;AAAlB,OAA2BD,IAA3B,EADU;AAAA,GAAV,CADF,EAIEf,QAAQ,IACR,gCAAC,uBAAD;AACC,IAAA,GAAG,EAAC,mBADL;AAEC,IAAA,SAAS,EAAC,yBAFX;AAGC,IAAA,IAAI,EACHA,QAAQ,CAACiB,IAAT,IAAiB;AAChBC,MAAAA,IAAI,EAAE,YADU;AAEhBC,MAAAA,SAAS,EAAE;AAFK;AAJnB,KASKnB,QATL,EALF,CAFF,EAqBC;AAAK,IAAA,SAAS,EAAC;AAAf,KAAmCC,QAAQ,IAAIA,QAA/C,CArBD,CAfD,EAsCEC,MAAM,IAAIA,MAtCZ,EAuCEK,aAAa,IACb,gCAAC,2BAAD;AACC,IAAA,cAAc,EAAEH,cADjB;AAEC,IAAA,UAAU,EAAEC,UAFb;AAGC,IAAA,iBAAiB,EAAEF;AAHpB,IAxCF,CADD;AAiDA,CAjED;;AAmEAN,OAAO,CAACuB,YAAR,GAAuB;AACtBf,EAAAA,UAAU,EAAE,IADU;AAEtBC,EAAAA,OAAO,EAAE,KAFa;AAGtBC,EAAAA,aAAa,EAAE,IAHO;AAItBR,EAAAA,KAAK,EAAE,EAJe;AAKtBE,EAAAA,QAAQ,EAAE,IALY;AAMtBC,EAAAA,MAAM,EAAE,IANc;AAOtBM,EAAAA,gBAAgB,EAAE,KAPI;AAQtBE,EAAAA,YAAY,EAAE;AARQ,CAAvB;eAWeb,O","sourcesContent":["// @flow\nimport React from 'react'\nimport cx from 'classnames'\nimport SidebarExpander from './components/SidebarExpander/SidebarExpander'\nimport SidebarItem from './components/SidebarItem/SidebarItem'\nimport SidebarSection from './components/SidebarSection/SidebarSection'\nimport type { Props as ItemProps } from './components/SidebarItem/SidebarItem'\nimport Button from '../../../Button/Button'\nimport type { Props as ButtonProps } from '../../../Button/Button'\nimport Text from '../../../Text/Text'\n\ntype SidebarHeader = {\n\ttitle: string,\n\taction: ButtonProps\n}\n\ntype Props = {\n\t/** Optional header that will only appear on mobile */\n\tmobileHeader?: SidebarHeader,\n\n\t/** Items to display in the sidebar */\n\titems?: Array<ItemProps>,\n\n\t/** Back link item to handle navigation back to previous location */\n\tbackLink?: ItemProps,\n\n\t/** Children to add to the sidebar */\n\tchildren?: Node,\n\n\t/** Include a footer in the sidebar */\n\tfooter?: Node,\n\n\t/** Set which side the sidebar is on. Must be either 'left' or 'right */\n\tside: 'left' | 'right',\n\n\t/** Set true to make the sidebar larger. Defaults to false. */\n\tisLarge?: boolean,\n\n\t/** Enables the user to collapse the sidebar on desktop. Defaults to true. */\n\tisCollapsible?: boolean,\n\n\t/** Set true to expand the sidebar (large screens only) */\n\tisExpanded?: boolean,\n\n\t/** Set true to expand the sidebar on small screens */\n\tisMobileExpanded?: boolean,\n\n\t/** Handler to force the sidebar to collapse */\n\tforceCloseSidebar: Function,\n\n\t/** Handler to toggle the visibility of the sidebar */\n\ttoggleExpanded: Function\n}\n\nconst Sidebar = (props: Props) => {\n\tconst {\n\t\titems,\n\t\tbackLink,\n\t\tchildren,\n\t\tfooter,\n\t\tforceCloseSidebar,\n\t\ttoggleExpanded,\n\t\tisExpanded,\n\t\tisLarge,\n\t\tisCollapsible,\n\t\tisMobileExpanded,\n\t\tside,\n\t\tmobileHeader\n\t} = props\n\n\treturn (\n\t\t<aside\n\t\t\tclassName={cx('sidebar', {\n\t\t\t\t'sidebar--left': side === 'left',\n\t\t\t\t'sidebar--right': side === 'right',\n\t\t\t\t'sidebar--large': isLarge,\n\t\t\t\t'sidebar--is-collapsed': !isExpanded,\n\t\t\t\t'sidebar--is-mobile-expanded': isMobileExpanded\n\t\t\t})}\n\t\t>\n\t\t\t{mobileHeader && (\n\t\t\t\t<SidebarSection className=\"sidebar-header sidebar-header--mobile\">\n\t\t\t\t\t<Text className=\"sidebar-header__title\">{mobileHeader.title}</Text>\n\t\t\t\t\t{mobileHeader.action && <Button {...mobileHeader.action} />}\n\t\t\t\t</SidebarSection>\n\t\t\t)}\n\t\t\t<div className=\"sidebar__inner\">\n\t\t\t\t{items && items.length > 0 && (\n\t\t\t\t\t<ul className=\"sidebar__items\">\n\t\t\t\t\t\t{items.map((item, idx) => (\n\t\t\t\t\t\t\t<SidebarItem key={idx} {...item} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{backLink && (\n\t\t\t\t\t\t\t<SidebarItem\n\t\t\t\t\t\t\t\tkey=\"sidebar-back-link\"\n\t\t\t\t\t\t\t\tclassName=\"sidebar-item__back-link\"\n\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\tbackLink.icon || {\n\t\t\t\t\t\t\t\t\t\tname: 'arrow_back',\n\t\t\t\t\t\t\t\t\t\tclassName: 'sidebar-item__icon--fill'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t{...backLink}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ul>\n\t\t\t\t)}\n\t\t\t\t<div className=\"sidebar__content\">{children && children}</div>\n\t\t\t</div>\n\t\t\t{footer && footer}\n\t\t\t{isCollapsible && (\n\t\t\t\t<SidebarExpander\n\t\t\t\t\ttoggleExpanded={toggleExpanded}\n\t\t\t\t\tisExpanded={isExpanded}\n\t\t\t\t\tforceCloseSidebar={forceCloseSidebar}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</aside>\n\t)\n}\n\nSidebar.defaultProps = {\n\tisExpanded: true,\n\tisLarge: false,\n\tisCollapsible: true,\n\titems: [],\n\tchildren: null,\n\tfooter: null,\n\tisMobileExpanded: false,\n\tmobileHeader: null\n}\n\nexport default Sidebar\n"],"file":"Sidebar.js"}
|