@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,219 @@
|
|
|
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 _ImageCropper = _interopRequireDefault(require("./ImageCropper"));
|
|
28
|
+
|
|
29
|
+
var AvatarIcon = function AvatarIcon(props) {
|
|
30
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
31
|
+
clipRule: "evenodd",
|
|
32
|
+
d: "M26.833 27.833a1 1 0 0 1 1-1h26a1 1 0 0 1 1 1v26a1 1 0 0 1-1 1h-26a1 1 0 0 1-1-1v-26z",
|
|
33
|
+
strokeLinecap: "round",
|
|
34
|
+
strokeLinejoin: "round"
|
|
35
|
+
}), _react["default"].createElement("path", {
|
|
36
|
+
clipRule: "evenodd",
|
|
37
|
+
d: "M36.458 39.667a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",
|
|
38
|
+
strokeLinecap: "round",
|
|
39
|
+
strokeLinejoin: "round"
|
|
40
|
+
}), _react["default"].createElement("path", {
|
|
41
|
+
d: "M54.833 49.584l-5.579-8.37a1.75 1.75 0 0 0-2.89-.033l-4.667 6.653-2.884-2.308a1.752 1.752 0 0 0-2.55.397l-5.93 8.91",
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round"
|
|
44
|
+
}), _react["default"].createElement("path", {
|
|
45
|
+
clipRule: "evenodd",
|
|
46
|
+
d: "M17.5 21c5.477 0 9.917-4.44 9.917-9.917 0-5.476-4.44-9.916-9.917-9.916-5.477 0-9.917 4.44-9.917 9.916C7.583 16.56 12.023 21 17.5 21z",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round"
|
|
49
|
+
}), _react["default"].createElement("path", {
|
|
50
|
+
d: "M19.833 24.666A16.345 16.345 0 0 0 1.167 40.833h18.666",
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeLinejoin: "round"
|
|
53
|
+
}));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
AvatarIcon.defaultProps = {
|
|
57
|
+
width: "56",
|
|
58
|
+
height: "56",
|
|
59
|
+
viewBox: "0 0 56 56",
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var ShopIcon = function ShopIcon(props) {
|
|
64
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
65
|
+
clipRule: "evenodd",
|
|
66
|
+
d: "M8.608 4.667c-.968 0-1.835.598-2.18 1.502L2.74 15.848a4.667 4.667 0 0 0-.032 3.232 6.42 6.42 0 0 0 12.46-2.163 6.417 6.417 0 1 0 12.833 0 6.417 6.417 0 1 0 12.833 0 6.419 6.419 0 0 0 12.46 2.163 4.652 4.652 0 0 0-.035-3.232l-3.686-9.679a2.333 2.333 0 0 0-2.18-1.502H8.608zM11.566 30.833a.5.5 0 0 1 .5-.5H27.4a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-.5.5H12.066a.5.5 0 0 1-.5-.5v-13z",
|
|
67
|
+
strokeLinecap: "round",
|
|
68
|
+
strokeLinejoin: "round"
|
|
69
|
+
}), _react["default"].createElement("path", {
|
|
70
|
+
d: "M32.566 51.333V31.5c0-.644.523-1.167 1.167-1.167h9.333c.645 0 1.167.523 1.167 1.167v19.833",
|
|
71
|
+
strokeLinecap: "round",
|
|
72
|
+
strokeLinejoin: "round"
|
|
73
|
+
}), _react["default"].createElement("path", {
|
|
74
|
+
d: "M48.9 23.118V49a2.333 2.333 0 0 1-2.334 2.333H9.233A2.333 2.333 0 0 1 6.9 49V23.062",
|
|
75
|
+
strokeLinecap: "round",
|
|
76
|
+
strokeLinejoin: "round"
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
ShopIcon.defaultProps = {
|
|
81
|
+
width: "56",
|
|
82
|
+
height: "56",
|
|
83
|
+
viewBox: "0 0 56 56",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
85
|
+
};
|
|
86
|
+
var stories = (0, _react2.storiesOf)('ImageCropper', module);
|
|
87
|
+
|
|
88
|
+
var ImageCropperExample =
|
|
89
|
+
/*#__PURE__*/
|
|
90
|
+
function (_Component) {
|
|
91
|
+
(0, _inherits2["default"])(ImageCropperExample, _Component);
|
|
92
|
+
|
|
93
|
+
function ImageCropperExample() {
|
|
94
|
+
var _getPrototypeOf2;
|
|
95
|
+
|
|
96
|
+
var _this;
|
|
97
|
+
|
|
98
|
+
(0, _classCallCheck2["default"])(this, ImageCropperExample);
|
|
99
|
+
|
|
100
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
101
|
+
args[_key] = arguments[_key];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(ImageCropperExample)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
105
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
106
|
+
image: ''
|
|
107
|
+
});
|
|
108
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleDrop", function (files) {
|
|
109
|
+
files.forEach(function (file) {
|
|
110
|
+
var reader = new FileReader();
|
|
111
|
+
|
|
112
|
+
reader.onload = function () {
|
|
113
|
+
var fileAsDataURL = reader.result;
|
|
114
|
+
|
|
115
|
+
_this.setState({
|
|
116
|
+
image: fileAsDataURL
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
reader.readAsDataURL(file);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
return _this;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
(0, _createClass2["default"])(ImageCropperExample, [{
|
|
127
|
+
key: "render",
|
|
128
|
+
value: function render() {
|
|
129
|
+
var _this$props = this.props,
|
|
130
|
+
isCircular = _this$props.isCircular,
|
|
131
|
+
width = _this$props.width,
|
|
132
|
+
height = _this$props.height;
|
|
133
|
+
return _react["default"].createElement(_ImageCropper["default"], {
|
|
134
|
+
image: (0, _react3.text)('image', 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=5d43ec18ec2cf6ff854513b9e8395c1e&auto=format&fit=crop&w=320&h=320&q=80'),
|
|
135
|
+
width: width,
|
|
136
|
+
height: height,
|
|
137
|
+
isCircular: isCircular,
|
|
138
|
+
dropzoneProps: {
|
|
139
|
+
id: 'dropzone',
|
|
140
|
+
onDrop: function onDrop() {
|
|
141
|
+
return console.log('onDrop');
|
|
142
|
+
},
|
|
143
|
+
onDragEnter: function onDragEnter() {
|
|
144
|
+
return console.log('onDragEnter');
|
|
145
|
+
},
|
|
146
|
+
onDragStart: function onDragStart() {
|
|
147
|
+
return console.log('onDragStart');
|
|
148
|
+
},
|
|
149
|
+
onDragOver: function onDragOver() {
|
|
150
|
+
return console.log('onDragOver');
|
|
151
|
+
},
|
|
152
|
+
onDragLeave: function onDragLeave() {
|
|
153
|
+
return console.log('onDragLeave');
|
|
154
|
+
},
|
|
155
|
+
onDropAccepted: this.handleDrop,
|
|
156
|
+
buttonText: 'Add Image',
|
|
157
|
+
isSmall: true,
|
|
158
|
+
isCircular: isCircular,
|
|
159
|
+
error: 'Upload an image',
|
|
160
|
+
defaultIcon: isCircular ? _react["default"].createElement(AvatarIcon, {
|
|
161
|
+
className: "dropzone__icon"
|
|
162
|
+
}) : _react["default"].createElement(ShopIcon, {
|
|
163
|
+
className: "dropzone__icon"
|
|
164
|
+
})
|
|
165
|
+
},
|
|
166
|
+
color: [249, 250, 252, 1]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}]);
|
|
170
|
+
return ImageCropperExample;
|
|
171
|
+
}(_react.Component);
|
|
172
|
+
|
|
173
|
+
stories.addDecorator(_react3.withKnobs);
|
|
174
|
+
stories.add('Static', function () {
|
|
175
|
+
return _react["default"].createElement(_ImageCropper["default"], {
|
|
176
|
+
image: (0, _react3.text)('image', 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=5d43ec18ec2cf6ff854513b9e8395c1e&auto=format&fit=crop&w=320&h=320&q=80'),
|
|
177
|
+
width: (0, _react3.number)('width', 160),
|
|
178
|
+
height: (0, _react3.number)('height', 160),
|
|
179
|
+
isCircular: (0, _react3["boolean"])('isCircular', true),
|
|
180
|
+
dropzoneProps: {
|
|
181
|
+
id: 'dropzone',
|
|
182
|
+
onDrop: function onDrop() {
|
|
183
|
+
return console.log('onDrop');
|
|
184
|
+
},
|
|
185
|
+
onDragEnter: function onDragEnter() {
|
|
186
|
+
return console.log('onDragEnter');
|
|
187
|
+
},
|
|
188
|
+
onDragStart: function onDragStart() {
|
|
189
|
+
return console.log('onDragStart');
|
|
190
|
+
},
|
|
191
|
+
onDragOver: function onDragOver() {
|
|
192
|
+
return console.log('onDragOver');
|
|
193
|
+
},
|
|
194
|
+
onDragLeave: function onDragLeave() {
|
|
195
|
+
return console.log('onDragLeave');
|
|
196
|
+
},
|
|
197
|
+
onDropAccepted: function onDropAccepted() {
|
|
198
|
+
return console.log('onDropAccepted');
|
|
199
|
+
},
|
|
200
|
+
buttonText: 'Add Image',
|
|
201
|
+
isSmall: true,
|
|
202
|
+
isCircular: (0, _react3["boolean"])('isCircular', true),
|
|
203
|
+
error: 'Upload an image',
|
|
204
|
+
defaultIcon: (0, _react3["boolean"])('isCircular', true) ? _react["default"].createElement(AvatarIcon, {
|
|
205
|
+
className: "dropzone__icon"
|
|
206
|
+
}) : _react["default"].createElement(ShopIcon, {
|
|
207
|
+
className: "dropzone__icon"
|
|
208
|
+
})
|
|
209
|
+
},
|
|
210
|
+
color: [249, 250, 252, 1]
|
|
211
|
+
});
|
|
212
|
+
}).add('Dynamic', function () {
|
|
213
|
+
return _react["default"].createElement(ImageCropperExample, {
|
|
214
|
+
width: (0, _react3.number)('width', 160),
|
|
215
|
+
height: (0, _react3.number)('height', 160),
|
|
216
|
+
isCircular: (0, _react3["boolean"])('isCircular', true)
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=ImageCropper-story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ImageCropper/ImageCropper-story.js"],"names":["AvatarIcon","ShopIcon","stories","module","ImageCropperExample","image","files","forEach","file","reader","FileReader","onload","fileAsDataURL","result","setState","readAsDataURL","props","isCircular","width","height","id","onDrop","console","log","onDragEnter","onDragStart","onDragOver","onDragLeave","onDropAccepted","handleDrop","buttonText","isSmall","error","defaultIcon","Component","addDecorator","withKnobs","add"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;IACOA,U,YAAAA,U;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,U;;;;;;;IACAC,Q,YAAAA,Q;;;;;;;;;;;;;;;;;AAAAA,Q;;;;;;AAEP,IAAMC,OAAO,GAAG,uBAAU,cAAV,EAA0BC,MAA1B,CAAhB;;IAWMC,mB;;;;;;;;;;;;;;;;;8FACG;AACPC,MAAAA,KAAK,EAAE;AADA,K;mGAIK,UAACC,KAAD,EAAgB;AAC5BA,MAAAA,KAAK,CAACC,OAAN,CAAc,UAAAC,IAAI,EAAI;AACrB,YAAMC,MAAM,GAAG,IAAIC,UAAJ,EAAf;;AACAD,QAAAA,MAAM,CAACE,MAAP,GAAgB,YAAM;AACrB,cAAMC,aAAa,GAAGH,MAAM,CAACI,MAA7B;;AACA,gBAAKC,QAAL,CAAc;AACbT,YAAAA,KAAK,EAAEO;AADM,WAAd;AAGA,SALD;;AAMAH,QAAAA,MAAM,CAACM,aAAP,CAAqBP,IAArB;AACA,OATD;AAUA,K;;;;;;6BAEQ;AAAA,wBAC8B,KAAKQ,KADnC;AAAA,UACAC,UADA,eACAA,UADA;AAAA,UACYC,KADZ,eACYA,KADZ;AAAA,UACmBC,MADnB,eACmBA,MADnB;AAGR,aACC,gCAAC,wBAAD;AACC,QAAA,KAAK,EAAE,kBACN,OADM,EAEN,gLAFM,CADR;AAKC,QAAA,KAAK,EAAED,KALR;AAMC,QAAA,MAAM,EAAEC,MANT;AAOC,QAAA,UAAU,EAAEF,UAPb;AAQC,QAAA,aAAa,EAAE;AACdG,UAAAA,EAAE,EAAE,UADU;AAEdC,UAAAA,MAAM,EAAE;AAAA,mBAAMC,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;AAAA,WAFM;AAGdC,UAAAA,WAAW,EAAE;AAAA,mBAAMF,OAAO,CAACC,GAAR,CAAY,aAAZ,CAAN;AAAA,WAHC;AAIdE,UAAAA,WAAW,EAAE;AAAA,mBAAMH,OAAO,CAACC,GAAR,CAAY,aAAZ,CAAN;AAAA,WAJC;AAKdG,UAAAA,UAAU,EAAE;AAAA,mBAAMJ,OAAO,CAACC,GAAR,CAAY,YAAZ,CAAN;AAAA,WALE;AAMdI,UAAAA,WAAW,EAAE;AAAA,mBAAML,OAAO,CAACC,GAAR,CAAY,aAAZ,CAAN;AAAA,WANC;AAOdK,UAAAA,cAAc,EAAE,KAAKC,UAPP;AAQdC,UAAAA,UAAU,EAAE,WARE;AASdC,UAAAA,OAAO,EAAE,IATK;AAUdd,UAAAA,UAAU,EAAVA,UAVc;AAWde,UAAAA,KAAK,EAAE,iBAXO;AAYdC,UAAAA,WAAW,EAAEhB,UAAU,GACtB,gCAAC,UAAD;AAAY,YAAA,SAAS,EAAC;AAAtB,YADsB,GAGtB,gCAAC,QAAD;AAAU,YAAA,SAAS,EAAC;AAApB;AAfa,SARhB;AA0BC,QAAA,KAAK,EAAE,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,CAAhB;AA1BR,QADD;AA8BA;;;EAnDgCiB,gB;;AAsDlChC,OAAO,CAACiC,YAAR,CAAqBC,iBAArB;AAEAlC,OAAO,CACLmC,GADF,CACM,QADN,EACgB;AAAA,SACd,gCAAC,wBAAD;AACC,IAAA,KAAK,EAAE,kBACN,OADM,EAEN,gLAFM,CADR;AAKC,IAAA,KAAK,EAAE,oBAAO,OAAP,EAAgB,GAAhB,CALR;AAMC,IAAA,MAAM,EAAE,oBAAO,QAAP,EAAiB,GAAjB,CANT;AAOC,IAAA,UAAU,EAAE,wBAAQ,YAAR,EAAsB,IAAtB,CAPb;AAQC,IAAA,aAAa,EAAE;AACdjB,MAAAA,EAAE,EAAE,UADU;AAEdC,MAAAA,MAAM,EAAE;AAAA,eAAMC,OAAO,CAACC,GAAR,CAAY,QAAZ,CAAN;AAAA,OAFM;AAGdC,MAAAA,WAAW,EAAE;AAAA,eAAMF,OAAO,CAACC,GAAR,CAAY,aAAZ,CAAN;AAAA,OAHC;AAIdE,MAAAA,WAAW,EAAE;AAAA,eAAMH,OAAO,CAACC,GAAR,CAAY,aAAZ,CAAN;AAAA,OAJC;AAKdG,MAAAA,UAAU,EAAE;AAAA,eAAMJ,OAAO,CAACC,GAAR,CAAY,YAAZ,CAAN;AAAA,OALE;AAMdI,MAAAA,WAAW,EAAE;AAAA,eAAML,OAAO,CAACC,GAAR,CAAY,aAAZ,CAAN;AAAA,OANC;AAOdK,MAAAA,cAAc,EAAE;AAAA,eAAMN,OAAO,CAACC,GAAR,CAAY,gBAAZ,CAAN;AAAA,OAPF;AAQdO,MAAAA,UAAU,EAAE,WARE;AASdC,MAAAA,OAAO,EAAE,IATK;AAUdd,MAAAA,UAAU,EAAE,wBAAQ,YAAR,EAAsB,IAAtB,CAVE;AAWde,MAAAA,KAAK,EAAE,iBAXO;AAYdC,MAAAA,WAAW,EAAE,wBAAQ,YAAR,EAAsB,IAAtB,IACZ,gCAAC,UAAD;AAAY,QAAA,SAAS,EAAC;AAAtB,QADY,GAGZ,gCAAC,QAAD;AAAU,QAAA,SAAS,EAAC;AAApB;AAfa,KARhB;AA0BC,IAAA,KAAK,EAAE,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,EAAgB,CAAhB;AA1BR,IADc;AAAA,CADhB,EA+BEI,GA/BF,CA+BM,SA/BN,EA+BiB;AAAA,SACf,gCAAC,mBAAD;AACC,IAAA,KAAK,EAAE,oBAAO,OAAP,EAAgB,GAAhB,CADR;AAEC,IAAA,MAAM,EAAE,oBAAO,QAAP,EAAiB,GAAjB,CAFT;AAGC,IAAA,UAAU,EAAE,wBAAQ,YAAR,EAAsB,IAAtB;AAHb,IADe;AAAA,CA/BjB","sourcesContent":["// @flow\nimport React, { Component } from 'react'\nimport { storiesOf } from '@storybook/react'\nimport { withKnobs, text, boolean, number } from '@storybook/addon-knobs/react'\nimport ImageCropper from './ImageCropper'\nimport AvatarIcon from '../../../static/assets/icons/Users/Geometric-Close-Up-Single-User-Actions-Neutral/single-neutral-actions-image--56w.svg'\nimport ShopIcon from '../../../static/assets/icons/Shopping-E-Commerce/Shops/shop-1--56w.svg'\n\nconst stories = storiesOf('ImageCropper', module)\n\ntype Props = {\n\tisCircular: boolean,\n\twidth: number,\n\theight: number\n}\ntype State = {\n\timage: string\n}\n\nclass ImageCropperExample extends Component<Props, State> {\n\tstate = {\n\t\timage: ''\n\t}\n\n\thandleDrop = (files: any) => {\n\t\tfiles.forEach(file => {\n\t\t\tconst reader = new FileReader()\n\t\t\treader.onload = () => {\n\t\t\t\tconst fileAsDataURL = reader.result\n\t\t\t\tthis.setState({\n\t\t\t\t\timage: fileAsDataURL\n\t\t\t\t})\n\t\t\t}\n\t\t\treader.readAsDataURL(file)\n\t\t})\n\t}\n\n\trender() {\n\t\tconst { isCircular, width, height } = this.props\n\n\t\treturn (\n\t\t\t<ImageCropper\n\t\t\t\timage={text(\n\t\t\t\t\t'image',\n\t\t\t\t\t'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=5d43ec18ec2cf6ff854513b9e8395c1e&auto=format&fit=crop&w=320&h=320&q=80'\n\t\t\t\t)}\n\t\t\t\twidth={width}\n\t\t\t\theight={height}\n\t\t\t\tisCircular={isCircular}\n\t\t\t\tdropzoneProps={{\n\t\t\t\t\tid: 'dropzone',\n\t\t\t\t\tonDrop: () => console.log('onDrop'),\n\t\t\t\t\tonDragEnter: () => console.log('onDragEnter'),\n\t\t\t\t\tonDragStart: () => console.log('onDragStart'),\n\t\t\t\t\tonDragOver: () => console.log('onDragOver'),\n\t\t\t\t\tonDragLeave: () => console.log('onDragLeave'),\n\t\t\t\t\tonDropAccepted: this.handleDrop,\n\t\t\t\t\tbuttonText: 'Add Image',\n\t\t\t\t\tisSmall: true,\n\t\t\t\t\tisCircular,\n\t\t\t\t\terror: 'Upload an image',\n\t\t\t\t\tdefaultIcon: isCircular ? (\n\t\t\t\t\t\t<AvatarIcon className=\"dropzone__icon\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<ShopIcon className=\"dropzone__icon\" />\n\t\t\t\t\t)\n\t\t\t\t}}\n\t\t\t\tcolor={[249, 250, 252, 1]}\n\t\t\t/>\n\t\t)\n\t}\n}\n\nstories.addDecorator(withKnobs)\n\nstories\n\t.add('Static', () => (\n\t\t<ImageCropper\n\t\t\timage={text(\n\t\t\t\t'image',\n\t\t\t\t'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=5d43ec18ec2cf6ff854513b9e8395c1e&auto=format&fit=crop&w=320&h=320&q=80'\n\t\t\t)}\n\t\t\twidth={number('width', 160)}\n\t\t\theight={number('height', 160)}\n\t\t\tisCircular={boolean('isCircular', true)}\n\t\t\tdropzoneProps={{\n\t\t\t\tid: 'dropzone',\n\t\t\t\tonDrop: () => console.log('onDrop'),\n\t\t\t\tonDragEnter: () => console.log('onDragEnter'),\n\t\t\t\tonDragStart: () => console.log('onDragStart'),\n\t\t\t\tonDragOver: () => console.log('onDragOver'),\n\t\t\t\tonDragLeave: () => console.log('onDragLeave'),\n\t\t\t\tonDropAccepted: () => console.log('onDropAccepted'),\n\t\t\t\tbuttonText: 'Add Image',\n\t\t\t\tisSmall: true,\n\t\t\t\tisCircular: boolean('isCircular', true),\n\t\t\t\terror: 'Upload an image',\n\t\t\t\tdefaultIcon: boolean('isCircular', true) ? (\n\t\t\t\t\t<AvatarIcon className=\"dropzone__icon\" />\n\t\t\t\t) : (\n\t\t\t\t\t<ShopIcon className=\"dropzone__icon\" />\n\t\t\t\t)\n\t\t\t}}\n\t\t\tcolor={[249, 250, 252, 1]}\n\t\t/>\n\t))\n\t.add('Dynamic', () => (\n\t\t<ImageCropperExample\n\t\t\twidth={number('width', 160)}\n\t\t\theight={number('height', 160)}\n\t\t\tisCircular={boolean('isCircular', true)}\n\t\t/>\n\t))\n"],"file":"ImageCropper-story.js"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
17
|
+
|
|
18
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
+
|
|
20
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
+
|
|
22
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
23
|
+
|
|
24
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
+
|
|
26
|
+
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
+
|
|
28
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
29
|
+
|
|
30
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
31
|
+
|
|
32
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
33
|
+
|
|
34
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
35
|
+
|
|
36
|
+
var _reactAvatarEditor = _interopRequireDefault(require("react-avatar-editor"));
|
|
37
|
+
|
|
38
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
39
|
+
|
|
40
|
+
var _Dropzone = _interopRequireDefault(require("../Dropzone/Dropzone"));
|
|
41
|
+
|
|
42
|
+
var _Forms = require("../Forms");
|
|
43
|
+
|
|
44
|
+
// NOTE: Relies on https://github.com/mosch/react-avatar-editor
|
|
45
|
+
var RotateLeftIcon = function RotateLeftIcon(props) {
|
|
46
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
47
|
+
d: "M3.434 10.537a8.78 8.78 0 0 1 .523-1.274M3.069 14.425a9.006 9.006 0 0 1-.028-1.983M4.389 18.111a9 9 0 0 1-.843-1.711M7.163 20.9a9.033 9.033 0 0 1-1.506-1.2M10.98 22.248a8.974 8.974 0 0 1-1.909-.431M10 4.25h2a9.029 9.029 0 0 1 .995 18",
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round"
|
|
50
|
+
}), _react["default"].createElement("path", {
|
|
51
|
+
d: "M13.5 1.75L10 4.25l3.5 2.5",
|
|
52
|
+
strokeLinecap: "round",
|
|
53
|
+
strokeLinejoin: "round"
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
RotateLeftIcon.defaultProps = {
|
|
58
|
+
width: "24",
|
|
59
|
+
height: "24",
|
|
60
|
+
viewBox: "0 0 24 24",
|
|
61
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var RotateRightIcon = function RotateRightIcon(props) {
|
|
65
|
+
return _react["default"].createElement("svg", props, _react["default"].createElement("path", {
|
|
66
|
+
d: "M20.566 10.537a8.782 8.782 0 0 0-.523-1.274M20.931 14.425a8.998 8.998 0 0 0 .028-1.983M19.611 18.111c.341-.54.624-1.114.843-1.713M16.837 20.9a9.03 9.03 0 0 0 1.506-1.2M13.02 22.248a8.972 8.972 0 0 0 1.909-.431M14 4.25h-2a9.029 9.029 0 0 0-.995 18",
|
|
67
|
+
strokeLinecap: "round",
|
|
68
|
+
strokeLinejoin: "round"
|
|
69
|
+
}), _react["default"].createElement("path", {
|
|
70
|
+
d: "M10.5 1.75l3.5 2.5-3.5 2.5",
|
|
71
|
+
strokeLinecap: "round",
|
|
72
|
+
strokeLinejoin: "round"
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
RotateRightIcon.defaultProps = {
|
|
77
|
+
width: "24",
|
|
78
|
+
height: "24",
|
|
79
|
+
viewBox: "0 0 24 24",
|
|
80
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var ImageCropper =
|
|
84
|
+
/*#__PURE__*/
|
|
85
|
+
function (_Component) {
|
|
86
|
+
(0, _inherits2["default"])(ImageCropper, _Component);
|
|
87
|
+
|
|
88
|
+
function ImageCropper() {
|
|
89
|
+
var _getPrototypeOf2;
|
|
90
|
+
|
|
91
|
+
var _this;
|
|
92
|
+
|
|
93
|
+
(0, _classCallCheck2["default"])(this, ImageCropper);
|
|
94
|
+
|
|
95
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
96
|
+
args[_key] = arguments[_key];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(ImageCropper)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
100
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
101
|
+
scale: 1,
|
|
102
|
+
sliderValue: 0,
|
|
103
|
+
rotate: 0,
|
|
104
|
+
isSubmitting: false
|
|
105
|
+
});
|
|
106
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleScale", function (e) {
|
|
107
|
+
var newVal = e.currentTarget.value;
|
|
108
|
+
|
|
109
|
+
_this.setState({
|
|
110
|
+
scale: newVal / 100 + 1,
|
|
111
|
+
sliderValue: newVal
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleRotate", function (dir) {
|
|
115
|
+
_this.setState(function (prevState) {
|
|
116
|
+
var newRotate = dir === 'left' ? prevState.rotate - 90 : prevState.rotate + 90;
|
|
117
|
+
return {
|
|
118
|
+
rotate: newRotate
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleSubmit",
|
|
123
|
+
/*#__PURE__*/
|
|
124
|
+
(0, _asyncToGenerator2["default"])(
|
|
125
|
+
/*#__PURE__*/
|
|
126
|
+
_regenerator["default"].mark(function _callee() {
|
|
127
|
+
var canvasImg;
|
|
128
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
129
|
+
while (1) {
|
|
130
|
+
switch (_context.prev = _context.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
canvasImg = _this.avatarEditor.getImageScaledToCanvas();
|
|
133
|
+
|
|
134
|
+
if (!_this.props.onSubmit) {
|
|
135
|
+
_context.next = 6;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
_this.setState({
|
|
140
|
+
isSubmitting: true
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
_context.next = 5;
|
|
144
|
+
return _this.props.onSubmit(canvasImg);
|
|
145
|
+
|
|
146
|
+
case 5:
|
|
147
|
+
_this.setState({
|
|
148
|
+
isSubmitting: false
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
case 6:
|
|
152
|
+
case "end":
|
|
153
|
+
return _context.stop();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, _callee);
|
|
157
|
+
})));
|
|
158
|
+
return _this;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
(0, _createClass2["default"])(ImageCropper, [{
|
|
162
|
+
key: "render",
|
|
163
|
+
value: function render() {
|
|
164
|
+
var _this2 = this;
|
|
165
|
+
|
|
166
|
+
var _this$props = this.props,
|
|
167
|
+
image = _this$props.image,
|
|
168
|
+
width = _this$props.width,
|
|
169
|
+
height = _this$props.height,
|
|
170
|
+
isCircular = _this$props.isCircular,
|
|
171
|
+
dropzoneProps = _this$props.dropzoneProps,
|
|
172
|
+
onUploadNewImage = _this$props.onUploadNewImage,
|
|
173
|
+
rest = (0, _objectWithoutProperties2["default"])(_this$props, ["image", "width", "height", "isCircular", "dropzoneProps", "onUploadNewImage"]);
|
|
174
|
+
var _this$state = this.state,
|
|
175
|
+
scale = _this$state.scale,
|
|
176
|
+
rotate = _this$state.rotate,
|
|
177
|
+
isSubmitting = _this$state.isSubmitting,
|
|
178
|
+
sliderValue = _this$state.sliderValue;
|
|
179
|
+
return _react["default"].createElement("div", {
|
|
180
|
+
className: "image-cropper"
|
|
181
|
+
}, _react["default"].createElement("div", {
|
|
182
|
+
className: "image-cropper__dropzone-wrapper"
|
|
183
|
+
}, image ? _react["default"].createElement(_reactAvatarEditor["default"], (0, _extends2["default"])({
|
|
184
|
+
image: image,
|
|
185
|
+
width: width,
|
|
186
|
+
height: height,
|
|
187
|
+
scale: scale,
|
|
188
|
+
rotate: rotate,
|
|
189
|
+
border: 0,
|
|
190
|
+
borderRadius: isCircular ? 100 : 0,
|
|
191
|
+
color: [255, 255, 255, 1]
|
|
192
|
+
}, rest, {
|
|
193
|
+
ref: function ref(editor) {
|
|
194
|
+
_this2.avatarEditor = editor;
|
|
195
|
+
}
|
|
196
|
+
})) : _react["default"].createElement(_Dropzone["default"], dropzoneProps)), _react["default"].createElement("div", {
|
|
197
|
+
className: "image-cropper__controls-row"
|
|
198
|
+
}, _react["default"].createElement(_Button["default"], {
|
|
199
|
+
kind: "secondary",
|
|
200
|
+
className: "image-cropper__rotate-btn",
|
|
201
|
+
text: "Rotate Left",
|
|
202
|
+
icon: {
|
|
203
|
+
customIcon: RotateLeftIcon,
|
|
204
|
+
isLineIcon: true
|
|
205
|
+
},
|
|
206
|
+
disabled: !image || isSubmitting,
|
|
207
|
+
onClick: function onClick() {
|
|
208
|
+
return _this2.handleRotate('left');
|
|
209
|
+
}
|
|
210
|
+
}), _react["default"].createElement(_Button["default"], {
|
|
211
|
+
kind: "secondary",
|
|
212
|
+
className: "image-cropper__rotate-btn",
|
|
213
|
+
text: "Rotate Right",
|
|
214
|
+
icon: {
|
|
215
|
+
customIcon: RotateRightIcon,
|
|
216
|
+
isLineIcon: true
|
|
217
|
+
},
|
|
218
|
+
disabled: !image || isSubmitting,
|
|
219
|
+
onClick: function onClick() {
|
|
220
|
+
return _this2.handleRotate('right');
|
|
221
|
+
}
|
|
222
|
+
})), _react["default"].createElement("div", {
|
|
223
|
+
className: "image-cropper__controls-row"
|
|
224
|
+
}, _react["default"].createElement(_Forms.Slider, {
|
|
225
|
+
label: "Scale",
|
|
226
|
+
id: "scale",
|
|
227
|
+
min: 0,
|
|
228
|
+
max: 100,
|
|
229
|
+
value: sliderValue,
|
|
230
|
+
postLabel: "".concat(Math.round(scale * 100), "%"),
|
|
231
|
+
disabled: !image || isSubmitting,
|
|
232
|
+
onChange: this.handleScale
|
|
233
|
+
})), _react["default"].createElement("div", {
|
|
234
|
+
className: "image-cropper__controls-row"
|
|
235
|
+
}, image && _react["default"].createElement(_Button["default"], {
|
|
236
|
+
kind: "simple",
|
|
237
|
+
text: "Upload another image",
|
|
238
|
+
disabled: isSubmitting,
|
|
239
|
+
onClick: onUploadNewImage
|
|
240
|
+
}), _react["default"].createElement(_Button["default"], {
|
|
241
|
+
kind: "primary",
|
|
242
|
+
isFullWidth: image ? false : true,
|
|
243
|
+
text: "Save Image",
|
|
244
|
+
disabled: !image || isSubmitting,
|
|
245
|
+
isLoading: isSubmitting,
|
|
246
|
+
onClick: function onClick() {
|
|
247
|
+
return _this2.handleSubmit();
|
|
248
|
+
}
|
|
249
|
+
})));
|
|
250
|
+
}
|
|
251
|
+
}]);
|
|
252
|
+
return ImageCropper;
|
|
253
|
+
}(_react.Component);
|
|
254
|
+
|
|
255
|
+
exports["default"] = ImageCropper;
|
|
256
|
+
//# sourceMappingURL=ImageCropper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ImageCropper/ImageCropper.js"],"names":["RotateLeftIcon","RotateRightIcon","ImageCropper","scale","sliderValue","rotate","isSubmitting","e","newVal","currentTarget","value","setState","dir","prevState","newRotate","canvasImg","avatarEditor","getImageScaledToCanvas","props","onSubmit","image","width","height","isCircular","dropzoneProps","onUploadNewImage","rest","state","editor","customIcon","isLineIcon","handleRotate","Math","round","handleScale","handleSubmit","Component"],"mappings":"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","sourcesContent":["// @flow\n// NOTE: Relies on https://github.com/mosch/react-avatar-editor\nimport React, { Component } from 'react'\nimport AvatarEditor from 'react-avatar-editor'\nimport Button from '../Button/Button'\nimport Dropzone from '../Dropzone/Dropzone'\nimport type { Props as DropzoneProps } from '../Dropzone/Dropzone'\nimport { Slider } from '../Forms'\nimport RotateLeftIcon from '../../../static/assets/icons/Design/Rotate/rotate-back.svg'\nimport RotateRightIcon from '../../../static/assets/icons/Design/Rotate/rotate-forward.svg'\n\ntype Props = {\n\t/** The image. If null, this will render a Dropzone. */\n\timage?: string,\n\n\t/** Width of the image */\n\twidth: number,\n\n\t/** Height of the image */\n\theight: number,\n\n\t/** Properties for the Dropzone */\n\tdropzoneProps: DropzoneProps,\n\n\t/** Set true for ciruclar image */\n\tisCircular?: boolean,\n\n\t/** Callback when save button is clicked */\n\tonSubmit?: Function,\n\n\t/** Callback when upload new button is clicked */\n\tonUploadNewImage?: Function\n}\ntype State = {\n\tscale: number,\n\trotate: number,\n\tisSubmitting: boolean\n}\n\nexport default class ImageCropper extends Component<Props, State> {\n\tstate = {\n\t\tscale: 1,\n\t\tsliderValue: 0,\n\t\trotate: 0,\n\t\tisSubmitting: false\n\t}\n\n\thandleScale = (e: any) => {\n\t\tconst newVal = e.currentTarget.value\n\n\t\tthis.setState({\n\t\t\tscale: newVal / 100 + 1,\n\t\t\tsliderValue: newVal\n\t\t})\n\t}\n\n\thandleRotate = (dir: 'left' | 'right') => {\n\t\tthis.setState(prevState => {\n\t\t\tconst newRotate =\n\t\t\t\tdir === 'left' ? prevState.rotate - 90 : prevState.rotate + 90\n\t\t\treturn {\n\t\t\t\trotate: newRotate\n\t\t\t}\n\t\t})\n\t}\n\n\thandleSubmit = async () => {\n\t\tconst canvasImg = this.avatarEditor.getImageScaledToCanvas()\n\n\t\tif (this.props.onSubmit) {\n\t\t\tthis.setState({ isSubmitting: true })\n\t\t\tawait this.props.onSubmit(canvasImg)\n\t\t\tthis.setState({ isSubmitting: false })\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\timage,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tisCircular,\n\t\t\tdropzoneProps,\n\t\t\tonUploadNewImage,\n\t\t\t...rest\n\t\t} = this.props\n\t\tconst { scale, rotate, isSubmitting, sliderValue } = this.state\n\t\treturn (\n\t\t\t<div className=\"image-cropper\">\n\t\t\t\t<div className=\"image-cropper__dropzone-wrapper\">\n\t\t\t\t\t{image ? (\n\t\t\t\t\t\t<AvatarEditor\n\t\t\t\t\t\t\timage={image}\n\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\theight={height}\n\t\t\t\t\t\t\tscale={scale}\n\t\t\t\t\t\t\trotate={rotate}\n\t\t\t\t\t\t\tborder={0}\n\t\t\t\t\t\t\tborderRadius={isCircular ? 100 : 0}\n\t\t\t\t\t\t\tcolor={[255, 255, 255, 1]}\n\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\tref={editor => {\n\t\t\t\t\t\t\t\tthis.avatarEditor = editor\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Dropzone {...dropzoneProps} />\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"image-cropper__controls-row\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkind=\"secondary\"\n\t\t\t\t\t\tclassName=\"image-cropper__rotate-btn\"\n\t\t\t\t\t\ttext=\"Rotate Left\"\n\t\t\t\t\t\ticon={{\n\t\t\t\t\t\t\tcustomIcon: RotateLeftIcon,\n\t\t\t\t\t\t\tisLineIcon: true\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={!image || isSubmitting}\n\t\t\t\t\t\tonClick={() => this.handleRotate('left')}\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkind=\"secondary\"\n\t\t\t\t\t\tclassName=\"image-cropper__rotate-btn\"\n\t\t\t\t\t\ttext=\"Rotate Right\"\n\t\t\t\t\t\ticon={{\n\t\t\t\t\t\t\tcustomIcon: RotateRightIcon,\n\t\t\t\t\t\t\tisLineIcon: true\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={!image || isSubmitting}\n\t\t\t\t\t\tonClick={() => this.handleRotate('right')}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"image-cropper__controls-row\">\n\t\t\t\t\t<Slider\n\t\t\t\t\t\tlabel=\"Scale\"\n\t\t\t\t\t\tid=\"scale\"\n\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\tmax={100}\n\t\t\t\t\t\tvalue={sliderValue}\n\t\t\t\t\t\tpostLabel={`${Math.round(scale * 100)}%`}\n\t\t\t\t\t\tdisabled={!image || isSubmitting}\n\t\t\t\t\t\tonChange={this.handleScale}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"image-cropper__controls-row\">\n\t\t\t\t\t{image && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkind=\"simple\"\n\t\t\t\t\t\t\ttext=\"Upload another image\"\n\t\t\t\t\t\t\tdisabled={isSubmitting}\n\t\t\t\t\t\t\tonClick={onUploadNewImage}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkind=\"primary\"\n\t\t\t\t\t\tisFullWidth={image ? false : true}\n\t\t\t\t\t\ttext=\"Save Image\"\n\t\t\t\t\t\tdisabled={!image || isSubmitting}\n\t\t\t\t\t\tisLoading={isSubmitting}\n\t\t\t\t\t\tonClick={() => this.handleSubmit()}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n}\n"],"file":"ImageCropper.js"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
// This component returns a wrapped img element that will handle image sources that fail to load.
|
|
13
|
+
// Regular JSX <img /> tag onError event does not work correclty with SSR so
|
|
14
|
+
// this component is used as a workaround.
|
|
15
|
+
var ImageSSR = function ImageSSR(props) {
|
|
16
|
+
var className = props.className,
|
|
17
|
+
alt = props.alt,
|
|
18
|
+
src = props.src,
|
|
19
|
+
width = props.width,
|
|
20
|
+
height = props.height,
|
|
21
|
+
id = props.id;
|
|
22
|
+
return _react["default"].createElement("div", {
|
|
23
|
+
className: "image-wrapper",
|
|
24
|
+
dangerouslySetInnerHTML: {
|
|
25
|
+
__html: "\n\t\t\t\t\t<img class=".concat(className, " alt=").concat(alt, " id=").concat(id, " src=\"").concat(src, "\"\n\t\t\t\t\tonerror=\"this.onerror=null;this.classList.add('error');\"\n\t\t\t\t\twidth=").concat(width, "\n\t\t\t\t\theight=").concat(height, " \n\t\t\t\t\t/>\n\t\t\t\t")
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var _default = ImageSSR;
|
|
31
|
+
exports["default"] = _default;
|
|
32
|
+
//# sourceMappingURL=ImageSSR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ImageSSR/ImageSSR.js"],"names":["ImageSSR","props","className","alt","src","width","height","id","__html"],"mappings":";;;;;;;;;AAEA;;AAUA;AACA;AACA;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAkB;AAAA,MAC1BC,SAD0B,GACiBD,KADjB,CAC1BC,SAD0B;AAAA,MACfC,GADe,GACiBF,KADjB,CACfE,GADe;AAAA,MACVC,GADU,GACiBH,KADjB,CACVG,GADU;AAAA,MACLC,KADK,GACiBJ,KADjB,CACLI,KADK;AAAA,MACEC,MADF,GACiBL,KADjB,CACEK,MADF;AAAA,MACUC,EADV,GACiBN,KADjB,CACUM,EADV;AAElC,SACC;AACC,IAAA,SAAS,EAAC,eADX;AAEC,IAAA,uBAAuB,EAAE;AACxBC,MAAAA,MAAM,mCACQN,SADR,kBACyBC,GADzB,iBACmCI,EADnC,oBAC8CH,GAD9C,uGAGGC,KAHH,gCAIIC,MAJJ;AADkB;AAF1B,IADD;AAcA,CAhBD;;eAkBeN,Q","sourcesContent":["// @flow\n\nimport React from 'react'\n\ntype Props = {\n\tsrc: string,\n\talt: string,\n\tclassName: string,\n\twidth: string,\n\theight: string\n}\n\n// This component returns a wrapped img element that will handle image sources that fail to load.\n// Regular JSX <img /> tag onError event does not work correclty with SSR so\n// this component is used as a workaround.\n\nconst ImageSSR = (props: Props) => {\n\tconst { className, alt, src, width, height, id } = props\n\treturn (\n\t\t<div\n\t\t\tclassName=\"image-wrapper\"\n\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t__html: `\n\t\t\t\t\t<img class=${className} alt=${alt} id=${id} src=\"${src}\"\n\t\t\t\t\tonerror=\"this.onerror=null;this.classList.add('error');\"\n\t\t\t\t\twidth=${width}\n\t\t\t\t\theight=${height} \n\t\t\t\t\t/>\n\t\t\t\t`\n\t\t\t}}\n\t\t/>\n\t)\n}\n\nexport default ImageSSR\n"],"file":"ImageSSR.js"}
|