@mohamed-karawia/library 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/chromatic.yml +26 -0
- package/.storybook/main.js +21 -0
- package/.storybook/middleware.js +28 -0
- package/.storybook/preview.js +9 -0
- package/CHANGELOG.md +66 -0
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/README.old.md +3 -0
- package/build-storybook.log +2704 -0
- package/dist/index.js +311 -0
- package/dist/stories/API/API.js +48 -0
- package/dist/stories/API/API.stories.js +24 -0
- package/dist/stories/Agora/Call/Call.js +316 -0
- package/dist/stories/Agora/Chat/Chat.js +107 -0
- package/dist/stories/Agora/Chat/Chat.stories.js +24 -0
- package/dist/stories/Agora/Chat/Components/ChatItem/ChatItem.js +34 -0
- package/dist/stories/Agora/Chat/Components/ChatRoom/ChatRoom.js +199 -0
- package/dist/stories/Agora/Controls/Controls.js +80 -0
- package/dist/stories/Agora/Preview/PreviewCamera.js +247 -0
- package/dist/stories/Agora/Preview/ShareScreen.js +119 -0
- package/dist/stories/Agora/Room/Room.js +114 -0
- package/dist/stories/Agora/Room/Room.stories.js +24 -0
- package/dist/stories/Buttons/Buttons/Buttons.js +59 -0
- package/dist/stories/Buttons/Buttons/Buttons.stories.js +39 -0
- package/dist/stories/Buttons/ReactModal/ReactModal.js +94 -0
- package/dist/stories/Buttons/ReactModal/ReactModal.stories.js +30 -0
- package/dist/stories/Buttons/ReactModal/ReactModalDemo.js +17 -0
- package/dist/stories/Chat/Chat.js +76 -0
- package/dist/stories/Chat/Chat.stories.js +76 -0
- package/dist/stories/Common Inputs/CheckboxGroup/CheckboxGroup.js +59 -0
- package/dist/stories/Common Inputs/CheckboxGroup/CheckboxGroup.stories.js +58 -0
- package/dist/stories/Common Inputs/CustomAutoComplete/CustomAutoComplete.js +93 -0
- package/dist/stories/Common Inputs/CustomAutoComplete/CustomAutoComplete.stories.js +56 -0
- package/dist/stories/Common Inputs/CustomDropzone/CustomDropZone.js +88 -0
- package/dist/stories/Common Inputs/CustomDropzone/CustomDropzone.stories.js +47 -0
- package/dist/stories/Common Inputs/CustomSelect/CustomSelect.js +92 -0
- package/dist/stories/Common Inputs/CustomSelect/CustomSelect.stories.js +61 -0
- package/dist/stories/Common Inputs/CustomTextarea/CustomTextarea.js +65 -0
- package/dist/stories/Common Inputs/CustomTextarea/CustomTextarea.stories.js +48 -0
- package/dist/stories/Common Inputs/DatePicker/DatePicker.js +104 -0
- package/dist/stories/Common Inputs/DatePicker/DatePicker.stories.js +60 -0
- package/dist/stories/Common Inputs/DatePicker/SingleDatePicker.js +97 -0
- package/dist/stories/Common Inputs/DropZone.js +148 -0
- package/dist/stories/Common Inputs/EditorComponent/EditorComponent.js +84 -0
- package/dist/stories/Common Inputs/EditorComponent/EditorComponent.stories.js +62 -0
- package/dist/stories/Common Inputs/EditorComponent/constants.js +41 -0
- package/dist/stories/Common Inputs/Formik/InputField/InputField.js +35 -0
- package/dist/stories/Common Inputs/Formik/InputField/InputField.stories.js +43 -0
- package/dist/stories/Common Inputs/Formik/RadioField/RadioField.js +54 -0
- package/dist/stories/Common Inputs/Formik/RadioField/RadioField.stories.js +60 -0
- package/dist/stories/Common Inputs/RadioInput/RadioInput.js +115 -0
- package/dist/stories/Common Inputs/RadioInput/RadioInput.stories.js +50 -0
- package/dist/stories/Common Inputs/RichTextInput/Components/Emoji/Emoji.js +31 -0
- package/dist/stories/Common Inputs/RichTextInput/Components/Gif/Gif.js +88 -0
- package/dist/stories/Common Inputs/RichTextInput/RichTextInput.js +278 -0
- package/dist/stories/Common Inputs/RichTextInput/RichTextInput.stories.js +51 -0
- package/dist/stories/Common Inputs/TextField/TextField.js +65 -0
- package/dist/stories/Common Inputs/TextField/TextField.stories.js +48 -0
- package/dist/stories/Containers/BaseMaterial.js +65 -0
- package/dist/stories/Containers/BaseMaterial.stories.js +24 -0
- package/dist/stories/Containers/WidgetExample/WidgetBody.js +17 -0
- package/dist/stories/Containers/WidgetExample/WidgetBody.stories.js +24 -0
- package/dist/stories/Containers/WidgetExample/WidgetExample.js +23 -0
- package/dist/stories/Containers/WidgetExample/WidgetExample.stories.js +24 -0
- package/dist/stories/Containers/WidgetExample/WidgetHead.js +17 -0
- package/dist/stories/Containers/WidgetExample/WidgetHead.stories.js +24 -0
- package/dist/stories/Enrollment/Admin/CreateForm/CreateForm.js +83 -0
- package/dist/stories/Enrollment/Admin/CreateForm/CreateForm.stories.js +22 -0
- package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.js +81 -0
- package/dist/stories/Enrollment/Admin/DetailedForm/DetailedForm.stories.js +42 -0
- package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.js +46 -0
- package/dist/stories/Enrollment/Admin/ViewForms/ViewForms.stories.js +65 -0
- package/dist/stories/Enrollment/Guest/FillForm/FillForm.js +64 -0
- package/dist/stories/Enrollment/Guest/FillForm/FillForm.stories.js +48 -0
- package/dist/stories/Events/CreateEvent/CreateEvent.js +110 -0
- package/dist/stories/Events/CreateEvent/CreateEvent.stories.js +30 -0
- package/dist/stories/Events/Event/Event.js +94 -0
- package/dist/stories/Events/Event/Event.stories.js +33 -0
- package/dist/stories/Events/EventsList/EventsList.js +135 -0
- package/dist/stories/Events/EventsList/EventsList.stories.js +44 -0
- package/dist/stories/Forms/AddPhoto/AddPhoto.js +101 -0
- package/dist/stories/Forms/AddPhoto/AddPhoto.stories.js +47 -0
- package/dist/stories/Forms/AddSong/AddSong.js +98 -0
- package/dist/stories/Forms/AddSong/AddSong.stories.js +37 -0
- package/dist/stories/Forms/AddVideo/AddVideo.js +103 -0
- package/dist/stories/Forms/AddVideo/AddVideo.stories.js +33 -0
- package/dist/stories/Forms/Create-Profile/CreateProfile.js +229 -0
- package/dist/stories/Forms/Create-Profile/CreateProfile.stories.js +49 -0
- package/dist/stories/Forms/Create-Profile/subcomponents/LogoUploader.js +54 -0
- package/dist/stories/Forms/Create-Profile/subcomponents/LogoUploader.stories.js +42 -0
- package/dist/stories/Forms/Create-Profile/subcomponents/ProfilePhoto.js +49 -0
- package/dist/stories/Forms/Create-Profile/subcomponents/ProfilePhoto.stories.js +41 -0
- package/dist/stories/Forms/Create-Profile/subcomponents/ResetBtn.js +41 -0
- package/dist/stories/Forms/Create-Profile/subcomponents/ResetBtn.stories.js +32 -0
- package/dist/stories/Forms/CreateAlbum/CreateAlbum.js +95 -0
- package/dist/stories/Forms/CreateAlbum/CreateAlbum.stories.js +47 -0
- package/dist/stories/Forms/CreateAnnouncementForm/CreateAnnouncementForm.js +84 -0
- package/dist/stories/Forms/CreateAnnouncementForm/CreateAnnouncementForm.stories.js +58 -0
- package/dist/stories/Forms/CreateMusicAlbum/CreateMusicAlbum.js +100 -0
- package/dist/stories/Forms/CreateMusicAlbum/CreateMusicAlbum.stories.js +47 -0
- package/dist/stories/Forms/CreateProfile/CreateProfile.js +383 -0
- package/dist/stories/Forms/CreateProfile/CreateProfile.stories.js +24 -0
- package/dist/stories/Forms/CreateProfile-3/CreateProfile.js +324 -0
- package/dist/stories/Forms/CreateProfile-3/CreateProfile.stories.js +24 -0
- package/dist/stories/Forms/CreateUser/CreateUser.js +27 -0
- package/dist/stories/Forms/CreateUser/CreateUser.stories.js +26 -0
- package/dist/stories/Forms/CreateVideoAlbum/CreateVideoAlbum.js +84 -0
- package/dist/stories/Forms/CreateVideoAlbum/CreateVideoAlbum.stories.js +37 -0
- package/dist/stories/Forms/Form/Form.js +35 -0
- package/dist/stories/Forms/Form/Form.stories.js +24 -0
- package/dist/stories/Forms/NewProfile/NewProfile.js +450 -0
- package/dist/stories/Forms/NewProfile/NewProfile.stories.js +24 -0
- package/dist/stories/Layout/Body/Body.js +30 -0
- package/dist/stories/Layout/Body/Body.stories.js +30 -0
- package/dist/stories/Layout/Center/Center.js +26 -0
- package/dist/stories/Layout/Center/Center.stories.js +24 -0
- package/dist/stories/Layout/Head/Head.js +24 -0
- package/dist/stories/Layout/Head/Head.stories.js +24 -0
- package/dist/stories/Layout/Left/Left.js +28 -0
- package/dist/stories/Layout/Left/Left.stories.js +24 -0
- package/dist/stories/Layout/Right/Right.js +27 -0
- package/dist/stories/Layout/Right/Right.stories.js +24 -0
- package/dist/stories/Library/CreateFolder/CreateFolder.js +87 -0
- package/dist/stories/Library/CreateFolder/CreateFolder.stories.js +45 -0
- package/dist/stories/Library/Folders/Folders.js +126 -0
- package/dist/stories/Library/Folders/Folders.stories.js +55 -0
- package/dist/stories/Library/Notes/Notes.js +135 -0
- package/dist/stories/Library/Notes/Notes.stories.js +42 -0
- package/dist/stories/Library/ViewNote/ViewNote.js +30 -0
- package/dist/stories/Library/ViewNote/ViewNote.stories.js +24 -0
- package/dist/stories/Misc/Thumbnail/Thumbnail.js +118 -0
- package/dist/stories/Music Album/ViewAlbum/ViewAlbum.js +131 -0
- package/dist/stories/Music Album/ViewAlbum/ViewAlbum.stories.js +115 -0
- package/dist/stories/Music Album/ViewAlbums/ViewAlbums.js +149 -0
- package/dist/stories/Music Album/ViewAlbums/ViewAlbums.stories.js +107 -0
- package/dist/stories/Navbar/Navbar.js +346 -0
- package/dist/stories/Navbar/Navbar.stories.js +41 -0
- package/dist/stories/Pages/Blank/Blank.js +36 -0
- package/dist/stories/Pages/Blank/Blank.stories.js +24 -0
- package/dist/stories/Pages/Centered/Centered.js +34 -0
- package/dist/stories/Pages/Centered/Centered.stories.js +24 -0
- package/dist/stories/Pages/Chat/Chat.js +86 -0
- package/dist/stories/Pages/Chat/Chat.stories.js +74 -0
- package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.js +96 -0
- package/dist/stories/Pages/Enrollment/DetailedForm/DetailedForm.stories.js +22 -0
- package/dist/stories/Pages/Enrollment/FillForm/FillForm.js +102 -0
- package/dist/stories/Pages/Enrollment/FillForm/FillForm.stories.js +22 -0
- package/dist/stories/Pages/Enrollment/Forms/Forms.js +125 -0
- package/dist/stories/Pages/Enrollment/Forms/Forms.stories.js +22 -0
- package/dist/stories/Pages/Events/Event/Event.js +89 -0
- package/dist/stories/Pages/Events/Event/Event.stories.js +22 -0
- package/dist/stories/Pages/Events/Events/Events.js +125 -0
- package/dist/stories/Pages/Events/Events/Events.stories.js +22 -0
- package/dist/stories/Pages/Library/Folders/Library.js +136 -0
- package/dist/stories/Pages/Library/Folders/Library.stories.js +22 -0
- package/dist/stories/Pages/Library/Notes/Notes.js +123 -0
- package/dist/stories/Pages/Library/Notes/Notes.stories.js +22 -0
- package/dist/stories/Pages/Music/MusicAlbum/Music.js +211 -0
- package/dist/stories/Pages/Music/MusicAlbum/Music.stories.js +22 -0
- package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.js +155 -0
- package/dist/stories/Pages/Music/MusicAlbums/MusicAlbums.stories.js +22 -0
- package/dist/stories/Pages/Photos/Album/Album.js +164 -0
- package/dist/stories/Pages/Photos/Album/Album.stories.js +22 -0
- package/dist/stories/Pages/Photos/Albums/Albums.js +151 -0
- package/dist/stories/Pages/Photos/Albums/Albums.stories.js +22 -0
- package/dist/stories/Pages/Video/DetailedVideo/DetailedVideo.js +112 -0
- package/dist/stories/Pages/Video/DetailedVideo/DetailedVideo.stories.js +22 -0
- package/dist/stories/Pages/Video/VideoAlbum/Video.js +216 -0
- package/dist/stories/Pages/Video/VideoAlbum/Video.stories.js +22 -0
- package/dist/stories/Pages/ViewWorld/ViewWorld.js +244 -0
- package/dist/stories/Pages/ViewWorld/ViewWorld.stories.js +264 -0
- package/dist/stories/Pages/ViewWorld/constatnts.js +172 -0
- package/dist/stories/Photo Album/DetailedPhoto/DetailedPhoto.js +24 -0
- package/dist/stories/Photo Album/DetailedPhoto/DetailedPhoto.stories.js +32 -0
- package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.js +236 -0
- package/dist/stories/Photo Album/ViewAlbum/ViewAlbum.stories.js +115 -0
- package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.js +156 -0
- package/dist/stories/Photo Album/ViewAlbums/ViewAlbums.stories.js +102 -0
- package/dist/stories/Reusable Components/Cards/Card-style-1/CardStyle1.js +67 -0
- package/dist/stories/Reusable Components/Cards/Card-style-1/CardStyle1.stories.js +35 -0
- package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.js +81 -0
- package/dist/stories/Reusable Components/Cards/Card-style-10/CardStyle10.stories.js +37 -0
- package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.js +67 -0
- package/dist/stories/Reusable Components/Cards/Card-style-11/CardStyle11.stories.js +40 -0
- package/dist/stories/Reusable Components/Cards/Card-style-2/CardStyle2.js +67 -0
- package/dist/stories/Reusable Components/Cards/Card-style-2/CardStyle2.stories.js +37 -0
- package/dist/stories/Reusable Components/Cards/Card-style-3/CardStyle3.js +65 -0
- package/dist/stories/Reusable Components/Cards/Card-style-3/CardStyle3.stories.js +34 -0
- package/dist/stories/Reusable Components/Cards/Card-style-4/CardStyle4.js +66 -0
- package/dist/stories/Reusable Components/Cards/Card-style-4/CardStyle4.stories.js +39 -0
- package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.js +93 -0
- package/dist/stories/Reusable Components/Cards/Card-style-6/CardStyle6.stories.js +27 -0
- package/dist/stories/Reusable Components/Cards/Card-style-7/CardStyle7.js +88 -0
- package/dist/stories/Reusable Components/Cards/Card-style-7/CardStyle7.stories.js +37 -0
- package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.js +86 -0
- package/dist/stories/Reusable Components/Cards/Card-style-8/CardStyle8.stories.js +44 -0
- package/dist/stories/Reusable Components/Cards/Card-style-9/CardStyle9.js +67 -0
- package/dist/stories/Reusable Components/Cards/Card-style-9/CardStyle9.stories.js +27 -0
- package/dist/stories/Reusable Components/Cards/Card.js +102 -0
- package/dist/stories/Reusable Components/Cards/Card.stories.js +132 -0
- package/dist/stories/Reusable Components/Cards/globalCardStyles.js +70 -0
- package/dist/stories/Reusable Components/Controls/Controls.js +128 -0
- package/dist/stories/Reusable Components/Controls/Controls.stories.js +49 -0
- package/dist/stories/Reusable Components/Gallery/Gallery.js +120 -0
- package/dist/stories/Reusable Components/Gallery/Gallery.stories.js +56 -0
- package/dist/stories/Reusable Components/Lists/Cards/ListCard-1.js +1 -0
- package/dist/stories/Reusable Components/Lists/Cards/ListCard-1.stories.js +1 -0
- package/dist/stories/Reusable Components/Lists/List.js +1 -0
- package/dist/stories/Reusable Components/Lists/List.stories.js +1 -0
- package/dist/stories/Reusable Components/Mention/Mention.js +72 -0
- package/dist/stories/Reusable Components/Mention/Mention.stories.js +66 -0
- package/dist/stories/Reusable Components/ReactModal/ReactModal.js +83 -0
- package/dist/stories/Reusable Components/ReusableForm/ReusableForm.js +100 -0
- package/dist/stories/Reusable Components/ReusableForm/ReusableForm.stories.js +207 -0
- package/dist/stories/Reusable Components/ReusableHeader/ReusableHeader.js +64 -0
- package/dist/stories/Reusable Components/ReusableHeader/ReusableHeader.stories.js +35 -0
- package/dist/stories/Reusable Components/ReusableList/ReusableList.js +92 -0
- package/dist/stories/Reusable Components/ReusableList/ReusableList.stories.js +84 -0
- package/dist/stories/Reusable Components/SearchCard/SearchCard.js +81 -0
- package/dist/stories/Reusable Components/SearchCard/SearchCard.stories.js +24 -0
- package/dist/stories/Reusable Components/SpaceContainer/SpaceContainer.js +48 -0
- package/dist/stories/Reusable Components/SpaceContainer/SpaceContainer.stories.js +80 -0
- package/dist/stories/Reusable Components/Spinner/Spinner.js +28 -0
- package/dist/stories/Reusable Components/Spinner/Spinner.stories.js +22 -0
- package/dist/stories/Reusable Components/WidgetContainer/WidgetContainer.js +51 -0
- package/dist/stories/Reusable Components/WidgetContainer/WidgetContainer.stories.js +80 -0
- package/dist/stories/Reusable Components/commonStyles.js +54 -0
- package/dist/stories/Reusable Components/fakeData.js +112 -0
- package/dist/stories/Spaces/WelcomeSpace/WelcomeSpace.js +74 -0
- package/dist/stories/Spaces/WelcomeSpace/WelcomeSpace.stories.js +24 -0
- package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.js +151 -0
- package/dist/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.stories.js +101 -0
- package/dist/stories/VideoAlbum/Comments/Comments.js +58 -0
- package/dist/stories/VideoAlbum/Comments/Comments.stories.js +45 -0
- package/dist/stories/VideoAlbum/VideoPlayer/VideoPlayer.js +235 -0
- package/dist/stories/VideoAlbum/VideoPlayer/VideoPlayer.stories.js +149 -0
- package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.js +110 -0
- package/dist/stories/VideoAlbum/VideoSpace/VideoSpace.stories.js +49 -0
- package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.js +150 -0
- package/dist/stories/VideoAlbum/ViewAlbum/ViewAlbum.stories.js +113 -0
- package/dist/stories/Widgets/LogoWidget/LogoWidget.js +32 -0
- package/dist/stories/Widgets/LogoWidget/LogoWidget.stories.js +26 -0
- package/dist/stories/Widgets/MusicPlayer/MusicPlayer.js +49 -0
- package/dist/stories/Widgets/MusicPlayer/MusicPlayer.stories.js +44 -0
- package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.js +93 -0
- package/dist/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.stories.js +52 -0
- package/dist/stories/Widgets/SpacesList/SpacesList.js +28 -0
- package/dist/stories/Widgets/SpacesList/SpacesList.stories.js +52 -0
- package/dist/stories/Widgets/SpacesList/SpacesListItem.js +50 -0
- package/dist/stories/Widgets/SpacesList/SpacesListItem.stories.js +24 -0
- package/dist/stories/helpers/util.js +178 -0
- package/package.json +131 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/src/assets/add-svgrepo-com.svg +36 -0
- package/src/assets/basket-svgrepo-com.svg +42 -0
- package/src/assets/bell-svgrepo-com.svg +44 -0
- package/src/assets/compass-svgrepo-com.svg +54 -0
- package/src/assets/home-svgrepo-com.svg +42 -0
- package/src/assets/medal-svgrepo-com.svg +53 -0
- package/src/assets/search-svgrepo-com.svg +42 -0
- package/src/assets/settings-svgrepo-com.svg +47 -0
- package/src/index.js +95 -0
- package/src/stories/API/API.jsx +47 -0
- package/src/stories/API/API.stories.js +10 -0
- package/src/stories/Agora/Call/Call.jsx +213 -0
- package/src/stories/Agora/Chat/Chat.jsx +130 -0
- package/src/stories/Agora/Chat/Chat.stories.jsx +10 -0
- package/src/stories/Agora/Chat/Components/ChatItem/ChatItem.jsx +38 -0
- package/src/stories/Agora/Chat/Components/ChatRoom/ChatRoom.jsx +167 -0
- package/src/stories/Agora/Controls/Controls.jsx +56 -0
- package/src/stories/Agora/Preview/PreviewCamera.jsx +259 -0
- package/src/stories/Agora/Preview/ShareScreen.jsx +58 -0
- package/src/stories/Agora/Room/Room.jsx +85 -0
- package/src/stories/Agora/Room/Room.stories.jsx +10 -0
- package/src/stories/Buttons/Buttons/Buttons.jsx +57 -0
- package/src/stories/Buttons/Buttons/Buttons.stories.jsx +24 -0
- package/src/stories/Buttons/ReactModal/ReactModal.jsx +81 -0
- package/src/stories/Buttons/ReactModal/ReactModal.stories.jsx +18 -0
- package/src/stories/Buttons/ReactModal/ReactModalDemo.jsx +12 -0
- package/src/stories/Chat/Chat.jsx +74 -0
- package/src/stories/Chat/Chat.stories.jsx +59 -0
- package/src/stories/Common Inputs/CheckboxGroup/CheckboxGroup.jsx +70 -0
- package/src/stories/Common Inputs/CheckboxGroup/CheckboxGroup.stories.jsx +32 -0
- package/src/stories/Common Inputs/CustomAutoComplete/CustomAutoComplete.jsx +98 -0
- package/src/stories/Common Inputs/CustomAutoComplete/CustomAutoComplete.stories.jsx +35 -0
- package/src/stories/Common Inputs/CustomDropzone/CustomDropZone.jsx +115 -0
- package/src/stories/Common Inputs/CustomDropzone/CustomDropzone.stories.jsx +26 -0
- package/src/stories/Common Inputs/CustomSelect/CustomSelect.jsx +89 -0
- package/src/stories/Common Inputs/CustomSelect/CustomSelect.stories.jsx +36 -0
- package/src/stories/Common Inputs/CustomTextarea/CustomTextarea.jsx +66 -0
- package/src/stories/Common Inputs/CustomTextarea/CustomTextarea.stories.jsx +31 -0
- package/src/stories/Common Inputs/DatePicker/DatePicker.jsx +105 -0
- package/src/stories/Common Inputs/DatePicker/DatePicker.stories.jsx +47 -0
- package/src/stories/Common Inputs/DatePicker/SingleDatePicker.jsx +91 -0
- package/src/stories/Common Inputs/DropZone.jsx +79 -0
- package/src/stories/Common Inputs/EditorComponent/EditorComponent.jsx +54 -0
- package/src/stories/Common Inputs/EditorComponent/EditorComponent.stories.jsx +60 -0
- package/src/stories/Common Inputs/EditorComponent/constants.js +26 -0
- package/src/stories/Common Inputs/Formik/InputField/InputField.jsx +24 -0
- package/src/stories/Common Inputs/Formik/InputField/InputField.stories.jsx +27 -0
- package/src/stories/Common Inputs/Formik/RadioField/RadioField.jsx +55 -0
- package/src/stories/Common Inputs/Formik/RadioField/RadioField.stories.jsx +41 -0
- package/src/stories/Common Inputs/RadioInput/RadioInput.jsx +108 -0
- package/src/stories/Common Inputs/RadioInput/RadioInput.stories.js +30 -0
- package/src/stories/Common Inputs/RichTextInput/Components/Emoji/Emoji.jsx +16 -0
- package/src/stories/Common Inputs/RichTextInput/Components/Gif/Gif.jsx +64 -0
- package/src/stories/Common Inputs/RichTextInput/RichTextInput.jsx +331 -0
- package/src/stories/Common Inputs/RichTextInput/RichTextInput.stories.js +45 -0
- package/src/stories/Common Inputs/TextField/TextField.jsx +66 -0
- package/src/stories/Common Inputs/TextField/TextField.stories.jsx +31 -0
- package/src/stories/Containers/BaseMaterial.jsx +58 -0
- package/src/stories/Containers/BaseMaterial.stories.js +10 -0
- package/src/stories/Containers/WidgetExample/WidgetBody.jsx +9 -0
- package/src/stories/Containers/WidgetExample/WidgetBody.stories.js +10 -0
- package/src/stories/Containers/WidgetExample/WidgetExample.jsx +19 -0
- package/src/stories/Containers/WidgetExample/WidgetExample.stories.js +10 -0
- package/src/stories/Containers/WidgetExample/WidgetHead.jsx +9 -0
- package/src/stories/Containers/WidgetExample/WidgetHead.stories.js +10 -0
- package/src/stories/Enrollment/Admin/CreateForm/CreateForm.jsx +62 -0
- package/src/stories/Enrollment/Admin/CreateForm/CreateForm.stories.jsx +8 -0
- package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.jsx +98 -0
- package/src/stories/Enrollment/Admin/DetailedForm/DetailedForm.stories.jsx +36 -0
- package/src/stories/Enrollment/Admin/ViewForms/ViewForms.jsx +40 -0
- package/src/stories/Enrollment/Admin/ViewForms/ViewForms.stories.jsx +66 -0
- package/src/stories/Enrollment/Guest/FillForm/FillForm.jsx +61 -0
- package/src/stories/Enrollment/Guest/FillForm/FillForm.stories.jsx +27 -0
- package/src/stories/Events/CreateEvent/CreateEvent.jsx +96 -0
- package/src/stories/Events/CreateEvent/CreateEvent.stories.jsx +19 -0
- package/src/stories/Events/Event/Event.jsx +113 -0
- package/src/stories/Events/Event/Event.stories.jsx +21 -0
- package/src/stories/Events/EventsList/EventsList.jsx +117 -0
- package/src/stories/Events/EventsList/EventsList.stories.jsx +25 -0
- package/src/stories/Forms/AddPhoto/AddPhoto.jsx +85 -0
- package/src/stories/Forms/AddPhoto/AddPhoto.stories.jsx +37 -0
- package/src/stories/Forms/AddSong/AddSong.jsx +86 -0
- package/src/stories/Forms/AddSong/AddSong.stories.jsx +26 -0
- package/src/stories/Forms/AddVideo/AddVideo.jsx +78 -0
- package/src/stories/Forms/AddVideo/AddVideo.stories.jsx +20 -0
- package/src/stories/Forms/Create-Profile/CreateProfile.jsx +278 -0
- package/src/stories/Forms/Create-Profile/CreateProfile.stories.jsx +36 -0
- package/src/stories/Forms/Create-Profile/subcomponents/LogoUploader.jsx +63 -0
- package/src/stories/Forms/Create-Profile/subcomponents/LogoUploader.stories.jsx +27 -0
- package/src/stories/Forms/Create-Profile/subcomponents/ProfilePhoto.jsx +58 -0
- package/src/stories/Forms/Create-Profile/subcomponents/ProfilePhoto.stories.jsx +26 -0
- package/src/stories/Forms/Create-Profile/subcomponents/ResetBtn.jsx +21 -0
- package/src/stories/Forms/Create-Profile/subcomponents/ResetBtn.stories.jsx +18 -0
- package/src/stories/Forms/CreateAlbum/CreateAlbum.jsx +82 -0
- package/src/stories/Forms/CreateAlbum/CreateAlbum.stories.jsx +37 -0
- package/src/stories/Forms/CreateAnnouncementForm/CreateAnnouncementForm.jsx +63 -0
- package/src/stories/Forms/CreateAnnouncementForm/CreateAnnouncementForm.stories.jsx +44 -0
- package/src/stories/Forms/CreateMusicAlbum/CreateMusicAlbum.jsx +87 -0
- package/src/stories/Forms/CreateMusicAlbum/CreateMusicAlbum.stories.jsx +38 -0
- package/src/stories/Forms/CreateProfile/CreateProfile.jsx +556 -0
- package/src/stories/Forms/CreateProfile/CreateProfile.stories.js +10 -0
- package/src/stories/Forms/CreateProfile-3/CreateProfile.jsx +488 -0
- package/src/stories/Forms/CreateProfile-3/CreateProfile.stories.js +10 -0
- package/src/stories/Forms/CreateUser/CreateUser.jsx +13 -0
- package/src/stories/Forms/CreateUser/CreateUser.stories.js +10 -0
- package/src/stories/Forms/CreateVideoAlbum/CreateVideoAlbum.jsx +78 -0
- package/src/stories/Forms/CreateVideoAlbum/CreateVideoAlbum.stories.jsx +23 -0
- package/src/stories/Forms/Form/Form.jsx +34 -0
- package/src/stories/Forms/Form/Form.stories.js +10 -0
- package/src/stories/Forms/NewProfile/NewProfile.jsx +464 -0
- package/src/stories/Forms/NewProfile/NewProfile.stories.jsx +10 -0
- package/src/stories/Forms/NewProfile/presets.json +9 -0
- package/src/stories/Layout/Body/Body.jsx +24 -0
- package/src/stories/Layout/Body/Body.stories.js +26 -0
- package/src/stories/Layout/Center/Center.jsx +16 -0
- package/src/stories/Layout/Center/Center.stories.js +14 -0
- package/src/stories/Layout/Head/Head.jsx +15 -0
- package/src/stories/Layout/Head/Head.stories.js +10 -0
- package/src/stories/Layout/Left/Left.jsx +21 -0
- package/src/stories/Layout/Left/Left.stories.js +14 -0
- package/src/stories/Layout/Right/Right.jsx +17 -0
- package/src/stories/Layout/Right/Right.stories.js +14 -0
- package/src/stories/Library/CreateFolder/CreateFolder.jsx +78 -0
- package/src/stories/Library/CreateFolder/CreateFolder.stories.jsx +32 -0
- package/src/stories/Library/Folders/Folders.jsx +117 -0
- package/src/stories/Library/Folders/Folders.stories.jsx +34 -0
- package/src/stories/Library/Notes/Notes.jsx +117 -0
- package/src/stories/Library/Notes/Notes.stories.jsx +24 -0
- package/src/stories/Library/ViewNote/ViewNote.jsx +25 -0
- package/src/stories/Library/ViewNote/ViewNote.stories.jsx +16 -0
- package/src/stories/Misc/Thumbnail/Thumbnail.jsx +79 -0
- package/src/stories/Music Album/ViewAlbum/ViewAlbum.jsx +111 -0
- package/src/stories/Music Album/ViewAlbum/ViewAlbum.stories.jsx +60 -0
- package/src/stories/Music Album/ViewAlbums/ViewAlbums.jsx +134 -0
- package/src/stories/Music Album/ViewAlbums/ViewAlbums.stories.jsx +57 -0
- package/src/stories/Navbar/Navbar.jsx +350 -0
- package/src/stories/Navbar/Navbar.stories.js +25 -0
- package/src/stories/Pages/Blank/Blank.jsx +32 -0
- package/src/stories/Pages/Blank/Blank.stories.js +10 -0
- package/src/stories/Pages/Centered/Centered.jsx +31 -0
- package/src/stories/Pages/Centered/Centered.stories.js +14 -0
- package/src/stories/Pages/Chat/Chat.jsx +82 -0
- package/src/stories/Pages/Chat/Chat.stories.jsx +53 -0
- package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.jsx +102 -0
- package/src/stories/Pages/Enrollment/DetailedForm/DetailedForm.stories.jsx +8 -0
- package/src/stories/Pages/Enrollment/FillForm/FillForm.jsx +96 -0
- package/src/stories/Pages/Enrollment/FillForm/FillForm.stories.jsx +8 -0
- package/src/stories/Pages/Enrollment/Forms/Forms.jsx +129 -0
- package/src/stories/Pages/Enrollment/Forms/Forms.stories.jsx +8 -0
- package/src/stories/Pages/Events/Event/Event.jsx +88 -0
- package/src/stories/Pages/Events/Event/Event.stories.jsx +8 -0
- package/src/stories/Pages/Events/Events/Events.jsx +110 -0
- package/src/stories/Pages/Events/Events/Events.stories.jsx +8 -0
- package/src/stories/Pages/Library/Folders/Library.jsx +118 -0
- package/src/stories/Pages/Library/Folders/Library.stories.jsx +8 -0
- package/src/stories/Pages/Library/Notes/Notes.jsx +109 -0
- package/src/stories/Pages/Library/Notes/Notes.stories.jsx +8 -0
- package/src/stories/Pages/Music/MusicAlbum/Music.jsx +159 -0
- package/src/stories/Pages/Music/MusicAlbum/Music.stories.jsx +8 -0
- package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.jsx +138 -0
- package/src/stories/Pages/Music/MusicAlbums/MusicAlbums.stories.jsx +8 -0
- package/src/stories/Pages/Photos/Album/Album.jsx +120 -0
- package/src/stories/Pages/Photos/Album/Album.stories.jsx +8 -0
- package/src/stories/Pages/Photos/Albums/Albums.jsx +144 -0
- package/src/stories/Pages/Photos/Albums/Albums.stories.jsx +8 -0
- package/src/stories/Pages/Video/DetailedVideo/DetailedVideo.jsx +91 -0
- package/src/stories/Pages/Video/DetailedVideo/DetailedVideo.stories.jsx +8 -0
- package/src/stories/Pages/Video/VideoAlbum/Video.jsx +166 -0
- package/src/stories/Pages/Video/VideoAlbum/Video.stories.jsx +8 -0
- package/src/stories/Pages/ViewWorld/ViewWorld.jsx +193 -0
- package/src/stories/Pages/ViewWorld/ViewWorld.stories.js +270 -0
- package/src/stories/Pages/ViewWorld/constatnts.js +158 -0
- package/src/stories/Pages/ViewWorld/styles.json +18 -0
- package/src/stories/Photo Album/DetailedPhoto/DetailedPhoto.jsx +17 -0
- package/src/stories/Photo Album/DetailedPhoto/DetailedPhoto.stories.jsx +20 -0
- package/src/stories/Photo Album/ViewAlbum/ViewAlbum.jsx +250 -0
- package/src/stories/Photo Album/ViewAlbum/ViewAlbum.stories.jsx +60 -0
- package/src/stories/Photo Album/ViewAlbums/ViewAlbums.jsx +146 -0
- package/src/stories/Photo Album/ViewAlbums/ViewAlbums.stories.jsx +59 -0
- package/src/stories/Reusable Components/Cards/Card-style-1/CardStyle1.jsx +74 -0
- package/src/stories/Reusable Components/Cards/Card-style-1/CardStyle1.stories.jsx +22 -0
- package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.jsx +94 -0
- package/src/stories/Reusable Components/Cards/Card-style-10/CardStyle10.stories.jsx +21 -0
- package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.jsx +79 -0
- package/src/stories/Reusable Components/Cards/Card-style-11/CardStyle11.stories.jsx +21 -0
- package/src/stories/Reusable Components/Cards/Card-style-2/CardStyle2.jsx +75 -0
- package/src/stories/Reusable Components/Cards/Card-style-2/CardStyle2.stories.jsx +24 -0
- package/src/stories/Reusable Components/Cards/Card-style-3/CardStyle3.jsx +61 -0
- package/src/stories/Reusable Components/Cards/Card-style-3/CardStyle3.stories.jsx +22 -0
- package/src/stories/Reusable Components/Cards/Card-style-4/CardStyle4.jsx +67 -0
- package/src/stories/Reusable Components/Cards/Card-style-4/CardStyle4.stories.jsx +25 -0
- package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.jsx +117 -0
- package/src/stories/Reusable Components/Cards/Card-style-6/CardStyle6.stories.jsx +9 -0
- package/src/stories/Reusable Components/Cards/Card-style-7/CardStyle7.jsx +126 -0
- package/src/stories/Reusable Components/Cards/Card-style-7/CardStyle7.stories.jsx +23 -0
- package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.jsx +113 -0
- package/src/stories/Reusable Components/Cards/Card-style-8/CardStyle8.stories.jsx +29 -0
- package/src/stories/Reusable Components/Cards/Card-style-9/CardStyle9.jsx +86 -0
- package/src/stories/Reusable Components/Cards/Card-style-9/CardStyle9.stories.jsx +14 -0
- package/src/stories/Reusable Components/Cards/Card.jsx +119 -0
- package/src/stories/Reusable Components/Cards/Card.stories.jsx +118 -0
- package/src/stories/Reusable Components/Cards/globalCardStyles.js +54 -0
- package/src/stories/Reusable Components/Controls/Controls.jsx +137 -0
- package/src/stories/Reusable Components/Controls/Controls.stories.jsx +24 -0
- package/src/stories/Reusable Components/Gallery/Gallery.jsx +110 -0
- package/src/stories/Reusable Components/Gallery/Gallery.stories.jsx +43 -0
- package/src/stories/Reusable Components/Lists/Cards/ListCard-1.jsx +0 -0
- package/src/stories/Reusable Components/Lists/Cards/ListCard-1.stories.js +0 -0
- package/src/stories/Reusable Components/Lists/List.jsx +0 -0
- package/src/stories/Reusable Components/Lists/List.stories.js +0 -0
- package/src/stories/Reusable Components/Mention/Mention.jsx +69 -0
- package/src/stories/Reusable Components/Mention/Mention.stories.jsx +55 -0
- package/src/stories/Reusable Components/ReactModal/ReactModal.jsx +76 -0
- package/src/stories/Reusable Components/ReusableForm/ReusableForm.jsx +121 -0
- package/src/stories/Reusable Components/ReusableForm/ReusableForm.stories.jsx +167 -0
- package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.jsx +76 -0
- package/src/stories/Reusable Components/ReusableHeader/ReusableHeader.stories.jsx +22 -0
- package/src/stories/Reusable Components/ReusableList/ReusableList.jsx +103 -0
- package/src/stories/Reusable Components/ReusableList/ReusableList.stories.jsx +70 -0
- package/src/stories/Reusable Components/SearchCard/SearchCard.jsx +89 -0
- package/src/stories/Reusable Components/SearchCard/SearchCard.stories.js +10 -0
- package/src/stories/Reusable Components/SpaceContainer/SpaceContainer.jsx +48 -0
- package/src/stories/Reusable Components/SpaceContainer/SpaceContainer.stories.jsx +78 -0
- package/src/stories/Reusable Components/Spinner/Spinner.jsx +82 -0
- package/src/stories/Reusable Components/Spinner/Spinner.stories.jsx +8 -0
- package/src/stories/Reusable Components/WidgetContainer/WidgetContainer.jsx +59 -0
- package/src/stories/Reusable Components/WidgetContainer/WidgetContainer.stories.jsx +61 -0
- package/src/stories/Reusable Components/commonStyles.js +47 -0
- package/src/stories/Reusable Components/fakeData.js +95 -0
- package/src/stories/Spaces/WelcomeSpace/WelcomeSpace.jsx +102 -0
- package/src/stories/Spaces/WelcomeSpace/WelcomeSpace.stories.js +10 -0
- package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.jsx +130 -0
- package/src/stories/VideoAlbum/AlbumsGallery/AlbumsGallery.stories.jsx +59 -0
- package/src/stories/VideoAlbum/Comments/Comments.jsx +58 -0
- package/src/stories/VideoAlbum/Comments/Comments.stories.jsx +18 -0
- package/src/stories/VideoAlbum/VideoPlayer/VideoPlayer.jsx +214 -0
- package/src/stories/VideoAlbum/VideoPlayer/VideoPlayer.stories.jsx +82 -0
- package/src/stories/VideoAlbum/VideoSpace/VideoSpace.jsx +101 -0
- package/src/stories/VideoAlbum/VideoSpace/VideoSpace.stories.jsx +23 -0
- package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.jsx +131 -0
- package/src/stories/VideoAlbum/ViewAlbum/ViewAlbum.stories.jsx +57 -0
- package/src/stories/Widgets/LogoWidget/LogoWidget.jsx +21 -0
- package/src/stories/Widgets/LogoWidget/LogoWidget.stories.js +12 -0
- package/src/stories/Widgets/MusicPlayer/MusicPlayer.jsx +64 -0
- package/src/stories/Widgets/MusicPlayer/MusicPlayer.stories.jsx +23 -0
- package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.jsx +107 -0
- package/src/stories/Widgets/MusicPlayerWidget/MusicPlayerWidget.stories.jsx +33 -0
- package/src/stories/Widgets/SpacesList/SpacesList.jsx +16 -0
- package/src/stories/Widgets/SpacesList/SpacesList.stories.jsx +27 -0
- package/src/stories/Widgets/SpacesList/SpacesListItem.jsx +75 -0
- package/src/stories/Widgets/SpacesList/SpacesListItem.stories.jsx +10 -0
- package/src/stories/assets/camera.svg +1 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/images/album1.jpg +0 -0
- package/src/stories/assets/images/album2.jpg +0 -0
- package/src/stories/assets/images/album3.jpg +0 -0
- package/src/stories/assets/images/album4.jpg +0 -0
- package/src/stories/assets/images/album5.jpg +0 -0
- package/src/stories/assets/images/album6.jpg +0 -0
- package/src/stories/assets/images/art.jpg +0 -0
- package/src/stories/assets/images/dance.jpg +0 -0
- package/src/stories/assets/images/football.jpg +0 -0
- package/src/stories/assets/images/music.jpg +0 -0
- package/src/stories/assets/images/music1.jpg +0 -0
- package/src/stories/assets/images/music2.jpg +0 -0
- package/src/stories/assets/images/music3.jpg +0 -0
- package/src/stories/assets/images/music4.jpg +0 -0
- package/src/stories/assets/images/music5.jpg +0 -0
- package/src/stories/assets/images/music6.jpg +0 -0
- package/src/stories/assets/images/reset.png +0 -0
- package/src/stories/assets/images/robotics.jpg +0 -0
- package/src/stories/assets/images/tennis.jpg +0 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/reset.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/helpers/util.js +66 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.Dropzone = exports.default = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _storybookFormik = _interopRequireDefault(require("storybook-formik"));
|
13
|
+
|
14
|
+
var Yup = _interopRequireWildcard(require("yup"));
|
15
|
+
|
16
|
+
var _CustomDropZone = _interopRequireDefault(require("./CustomDropZone"));
|
17
|
+
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
+
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
+
|
22
|
+
var formSchema = Yup.object().shape({
|
23
|
+
file: Yup.object().required("Required")
|
24
|
+
});
|
25
|
+
var _default = {
|
26
|
+
title: 'Common Inputs/Custom Dropzone',
|
27
|
+
component: _CustomDropZone.default,
|
28
|
+
decorators: [_storybookFormik.default],
|
29
|
+
parameters: {
|
30
|
+
formik: {
|
31
|
+
initialValues: {
|
32
|
+
file: ''
|
33
|
+
},
|
34
|
+
validationSchema: formSchema
|
35
|
+
}
|
36
|
+
}
|
37
|
+
};
|
38
|
+
exports.default = _default;
|
39
|
+
|
40
|
+
var Dropzone = function Dropzone(args) {
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDropZone.default, Object.assign({
|
42
|
+
label: "Image",
|
43
|
+
name: "file"
|
44
|
+
}, args));
|
45
|
+
};
|
46
|
+
|
47
|
+
exports.Dropzone = Dropzone;
|
@@ -0,0 +1,92 @@
|
|
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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
11
|
+
|
12
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
13
|
+
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
15
|
+
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
17
|
+
|
18
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
19
|
+
|
20
|
+
var _reactSelect = _interopRequireDefault(require("react-select"));
|
21
|
+
|
22
|
+
var _formik = require("formik");
|
23
|
+
|
24
|
+
var _templateObject, _templateObject2, _templateObject3;
|
25
|
+
|
26
|
+
var CustomSelect = function CustomSelect(props) {
|
27
|
+
var _useField = (0, _formik.useField)(props),
|
28
|
+
_useField2 = (0, _slicedToArray2.default)(_useField, 3),
|
29
|
+
field = _useField2[0],
|
30
|
+
meta = _useField2[1],
|
31
|
+
helpers = _useField2[2];
|
32
|
+
|
33
|
+
var colourStyles = {
|
34
|
+
control: function control(styles) {
|
35
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
36
|
+
backgroundColor: props.selectBackground || 'white'
|
37
|
+
});
|
38
|
+
},
|
39
|
+
option: function option(styles, _ref) {
|
40
|
+
var isDisabled = _ref.isDisabled,
|
41
|
+
isFocused = _ref.isFocused,
|
42
|
+
isSelected = _ref.isSelected;
|
43
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
44
|
+
backgroundColor: isDisabled ? null : isSelected ? props.selectedBackground || 'white' : isFocused ? props.hoverBackground || '#aaaaaa' : props.background || null,
|
45
|
+
color: isDisabled ? '#ccc' : isSelected ? props.optionSelectedColor || 'black' : isFocused ? props.optionHoverColor : props.optionColor || 'gray',
|
46
|
+
cursor: isDisabled ? 'not-allowed' : 'default'
|
47
|
+
});
|
48
|
+
},
|
49
|
+
input: function input(styles) {
|
50
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
51
|
+
padding: "".concat(props.padding, "px")
|
52
|
+
});
|
53
|
+
},
|
54
|
+
placeholder: function placeholder(styles) {
|
55
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, styles), {}, {
|
56
|
+
fontFamily: 'sans-serif'
|
57
|
+
});
|
58
|
+
},
|
59
|
+
singleValue: function singleValue(styles, _ref2) {
|
60
|
+
var data = _ref2.data;
|
61
|
+
return (0, _objectSpread2.default)({}, styles);
|
62
|
+
}
|
63
|
+
};
|
64
|
+
return /*#__PURE__*/_react.default.createElement(Container, null, /*#__PURE__*/_react.default.createElement(Label, Object.assign({
|
65
|
+
htmlFor: props.name
|
66
|
+
}, props), props.label), /*#__PURE__*/_react.default.createElement(_reactSelect.default, {
|
67
|
+
name: props.name,
|
68
|
+
options: props.options,
|
69
|
+
value: field.value.value,
|
70
|
+
onChange: function onChange(value) {
|
71
|
+
return helpers.setValue(value.value);
|
72
|
+
},
|
73
|
+
onBlur: function onBlur() {
|
74
|
+
return helpers.setTouched(true);
|
75
|
+
},
|
76
|
+
styles: colourStyles
|
77
|
+
}), meta.touched && meta.error ? /*#__PURE__*/_react.default.createElement(Error, null, meta.error) : null);
|
78
|
+
};
|
79
|
+
|
80
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n"])));
|
81
|
+
|
82
|
+
var Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 5px;\n text-transform: capitalize;\n color: ", ";\n font-size: ", "px;\n"])), function (props) {
|
83
|
+
return props.labelColor;
|
84
|
+
}, function (props) {
|
85
|
+
return props.labelFontSize;
|
86
|
+
});
|
87
|
+
|
88
|
+
var Error = _styledComponents.default.p(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-top: 3px;\n"])));
|
89
|
+
|
90
|
+
CustomSelect.defaultProps = {};
|
91
|
+
var _default = CustomSelect;
|
92
|
+
exports.default = _default;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.Select = exports.default = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _storybookFormik = _interopRequireDefault(require("storybook-formik"));
|
13
|
+
|
14
|
+
var Yup = _interopRequireWildcard(require("yup"));
|
15
|
+
|
16
|
+
var _CustomSelect = _interopRequireDefault(require("./CustomSelect"));
|
17
|
+
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
+
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
+
|
22
|
+
var formSchema = Yup.object().shape({
|
23
|
+
name: Yup.string().required("Required")
|
24
|
+
});
|
25
|
+
var options = [{
|
26
|
+
label: 'select an option',
|
27
|
+
value: ''
|
28
|
+
}, {
|
29
|
+
label: 'option 1',
|
30
|
+
value: '1'
|
31
|
+
}, {
|
32
|
+
label: 'option 2',
|
33
|
+
value: '2'
|
34
|
+
}, {
|
35
|
+
label: 'option 3',
|
36
|
+
value: '3'
|
37
|
+
}];
|
38
|
+
var _default = {
|
39
|
+
title: 'Common Inputs/Custom Select',
|
40
|
+
component: _CustomSelect.default,
|
41
|
+
decorators: [_storybookFormik.default],
|
42
|
+
parameters: {
|
43
|
+
formik: {
|
44
|
+
initialValues: {
|
45
|
+
name: ''
|
46
|
+
},
|
47
|
+
validationSchema: formSchema
|
48
|
+
}
|
49
|
+
}
|
50
|
+
};
|
51
|
+
exports.default = _default;
|
52
|
+
|
53
|
+
var Select = function Select(args) {
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_CustomSelect.default, Object.assign({
|
55
|
+
label: "options",
|
56
|
+
options: options,
|
57
|
+
name: "name"
|
58
|
+
}, args));
|
59
|
+
};
|
60
|
+
|
61
|
+
exports.Select = Select;
|
@@ -0,0 +1,65 @@
|
|
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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
11
|
+
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
13
|
+
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
15
|
+
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
17
|
+
|
18
|
+
var _formik = require("formik");
|
19
|
+
|
20
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
21
|
+
|
22
|
+
var CustomTextarea = function CustomTextarea(props) {
|
23
|
+
var _useField = (0, _formik.useField)(props),
|
24
|
+
_useField2 = (0, _slicedToArray2.default)(_useField, 2),
|
25
|
+
field = _useField2[0],
|
26
|
+
meta = _useField2[1];
|
27
|
+
|
28
|
+
return /*#__PURE__*/_react.default.createElement(TextFieldWrapper, null, /*#__PURE__*/_react.default.createElement(Label, Object.assign({
|
29
|
+
htmlFor: field.name
|
30
|
+
}, props), props.label), /*#__PURE__*/_react.default.createElement(Input, Object.assign({}, field, props)), meta.error && meta.touched && /*#__PURE__*/_react.default.createElement(Error, null, meta.error));
|
31
|
+
};
|
32
|
+
|
33
|
+
var TextFieldWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n"])));
|
34
|
+
|
35
|
+
var Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 5px;\n // Customized Styles\n text-transform: capitalize;\n font-size: ", "px;\n color: ", ";\n"])), function (props) {
|
36
|
+
return props.labelFontSize || 15;
|
37
|
+
}, function (props) {
|
38
|
+
return props.labelColor || 'black';
|
39
|
+
});
|
40
|
+
|
41
|
+
var Input = _styledComponents.default.textarea(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px;\n border: ", "px solid;\n border-top-color: ", ";\n border-bottom-color: ", ";\n border-right-color: ", ";\n border-left-color: ", ";\n border-radius: ", "px;\n font-size: ", "px;\n color: ", ";\n"])), function (props) {
|
42
|
+
return props.padding || 5;
|
43
|
+
}, function (props) {
|
44
|
+
return props.borderSize || 1;
|
45
|
+
}, function (props) {
|
46
|
+
return props.borderTopColor || '#9e9e9e';
|
47
|
+
}, function (props) {
|
48
|
+
return props.borderBottomColor || '#9e9e9e';
|
49
|
+
}, function (props) {
|
50
|
+
return props.borderRightColor || '#9e9e9e';
|
51
|
+
}, function (props) {
|
52
|
+
return props.borderLeftColor || '#9e9e9e';
|
53
|
+
}, function (props) {
|
54
|
+
return props.borderRadius || 0;
|
55
|
+
}, function (props) {
|
56
|
+
return props.inputFontSize || 15;
|
57
|
+
}, function (props) {
|
58
|
+
return props.inputFontColor || 'black';
|
59
|
+
});
|
60
|
+
|
61
|
+
var Error = _styledComponents.default.p(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-top: 3px;\n"])));
|
62
|
+
|
63
|
+
CustomTextarea.defaultProps = {};
|
64
|
+
var _default = CustomTextarea;
|
65
|
+
exports.default = _default;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.TextArea = exports.default = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _storybookFormik = _interopRequireDefault(require("storybook-formik"));
|
13
|
+
|
14
|
+
var Yup = _interopRequireWildcard(require("yup"));
|
15
|
+
|
16
|
+
var _CustomTextarea = _interopRequireDefault(require("./CustomTextarea"));
|
17
|
+
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
+
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
|
+
|
22
|
+
var formSchema = Yup.object().shape({
|
23
|
+
text: Yup.string().required("Required")
|
24
|
+
});
|
25
|
+
var _default = {
|
26
|
+
title: 'Common Inputs/Custom Textarea',
|
27
|
+
component: _CustomTextarea.default,
|
28
|
+
decorators: [_storybookFormik.default],
|
29
|
+
parameters: {
|
30
|
+
formik: {
|
31
|
+
initialValues: {
|
32
|
+
text: '',
|
33
|
+
validationSchema: formSchema
|
34
|
+
},
|
35
|
+
validationSchema: formSchema
|
36
|
+
}
|
37
|
+
}
|
38
|
+
};
|
39
|
+
exports.default = _default;
|
40
|
+
|
41
|
+
var TextArea = function TextArea(args) {
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_CustomTextarea.default, Object.assign({
|
43
|
+
name: "text",
|
44
|
+
label: "text"
|
45
|
+
}, args));
|
46
|
+
};
|
47
|
+
|
48
|
+
exports.TextArea = TextArea;
|
@@ -0,0 +1,104 @@
|
|
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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
11
|
+
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
13
|
+
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
15
|
+
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
17
|
+
|
18
|
+
var _formik = require("formik");
|
19
|
+
|
20
|
+
require("react-dates/initialize");
|
21
|
+
|
22
|
+
require("react-dates/lib/css/_datepicker.css");
|
23
|
+
|
24
|
+
var _reactDates = require("react-dates");
|
25
|
+
|
26
|
+
var _templateObject, _templateObject2, _templateObject3;
|
27
|
+
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
29
|
+
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
31
|
+
|
32
|
+
var DatePicker = function DatePicker(props) {
|
33
|
+
var _useField = (0, _formik.useField)(props),
|
34
|
+
_useField2 = (0, _slicedToArray2.default)(_useField, 3),
|
35
|
+
field = _useField2[0],
|
36
|
+
meta = _useField2[1],
|
37
|
+
helpers = _useField2[2];
|
38
|
+
|
39
|
+
var _useState = (0, _react.useState)(),
|
40
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
41
|
+
focused = _useState2[0],
|
42
|
+
setFocused = _useState2[1];
|
43
|
+
|
44
|
+
return /*#__PURE__*/_react.default.createElement(Container, props, /*#__PURE__*/_react.default.createElement(Label, Object.assign({
|
45
|
+
htmlFor: props.name
|
46
|
+
}, props), props.label), /*#__PURE__*/_react.default.createElement(_reactDates.DateRangePicker, {
|
47
|
+
startDate: field.value.startDate,
|
48
|
+
startDateId: "your_unique_start_date_id",
|
49
|
+
endDate: field.value.endDate,
|
50
|
+
endDateId: "your_unique_end_date_id",
|
51
|
+
onDatesChange: function onDatesChange(date) {
|
52
|
+
return helpers.setValue(date);
|
53
|
+
},
|
54
|
+
focusedInput: focused,
|
55
|
+
onFocusChange: function onFocusChange(focusedInput) {
|
56
|
+
return setFocused(focusedInput);
|
57
|
+
},
|
58
|
+
onClose: function onClose() {
|
59
|
+
return helpers.setTouched(true);
|
60
|
+
}
|
61
|
+
}), meta.touched && meta.error && (!field.value.startDate || !field.value.endDate) ? /*#__PURE__*/_react.default.createElement(Error, null, meta.error.startDate || meta.error.endDate) : null);
|
62
|
+
};
|
63
|
+
|
64
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n\n & .CalendarDay {\n border: none;\n background-color: ", ";\n color: ", ";\n font-size: ", "px;\n border-radius: ", "px;\n padding: ", "px;\n\n &:hover{\n background-color: ", ";\n color: ", ";;\n }\n }\n \n & .CalendarDay__selected_span {\n background-color: ", ";\n color: ", ";\n}\n\n & .CalendarDay__selected {\n color: ", ";\n}\n\n & .CalendarDay__selected:hover {\n color: ", ";\n background: ", ";\n}\n \n & .CalendarDay__hovered_span:hover,\n & .CalendarDay__hovered_span {\n background: ", ";\n color: ", "\n }\n"])), function (props) {
|
65
|
+
return props.background;
|
66
|
+
}, function (props) {
|
67
|
+
return props.color;
|
68
|
+
}, function (props) {
|
69
|
+
return props.fontSize;
|
70
|
+
}, function (props) {
|
71
|
+
return props.borderRadius;
|
72
|
+
}, function (props) {
|
73
|
+
return props.padding;
|
74
|
+
}, function (props) {
|
75
|
+
return props.mouseHoverBackground;
|
76
|
+
}, function (props) {
|
77
|
+
return props.mouseHoverColor;
|
78
|
+
}, function (props) {
|
79
|
+
return props.selectedRangeColor;
|
80
|
+
}, function (props) {
|
81
|
+
return props.selectedRangeFontColor;
|
82
|
+
}, function (props) {
|
83
|
+
return props.selectedColor;
|
84
|
+
}, function (props) {
|
85
|
+
return props.selectedOnHoverColor;
|
86
|
+
}, function (props) {
|
87
|
+
return props.selectedOnHoverBackground;
|
88
|
+
}, function (props) {
|
89
|
+
return props.rangeHoverBackground;
|
90
|
+
}, function (props) {
|
91
|
+
return props.rangeHoverColor;
|
92
|
+
});
|
93
|
+
|
94
|
+
var Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 5px;\n text-transform: capitalize;\n color: ", ";\n font-size: ", "px;\n"])), function (props) {
|
95
|
+
return props.labelColor;
|
96
|
+
}, function (props) {
|
97
|
+
return props.labelFontSize;
|
98
|
+
});
|
99
|
+
|
100
|
+
var Error = _styledComponents.default.p(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-top: 3px;\n"])));
|
101
|
+
|
102
|
+
DatePicker.defaultProps = {};
|
103
|
+
var _default = DatePicker;
|
104
|
+
exports.default = _default;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.date = exports.default = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _storybookFormik = _interopRequireDefault(require("storybook-formik"));
|
13
|
+
|
14
|
+
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
15
|
+
|
16
|
+
var _SingleDatePicker = _interopRequireDefault(require("./SingleDatePicker"));
|
17
|
+
|
18
|
+
var Yup = _interopRequireWildcard(require("yup"));
|
19
|
+
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
+
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
23
|
+
|
24
|
+
var datePickerSchema = Yup.object().shape({
|
25
|
+
date: Yup.object().shape({
|
26
|
+
startDate: Yup.object().required("Required").typeError('Invalid Start Date'),
|
27
|
+
endDate: Yup.object().required("Required").typeError('Invalid End Date')
|
28
|
+
}),
|
29
|
+
singleDate: Yup.object().required("Required").typeError('Invalid Date')
|
30
|
+
});
|
31
|
+
var _default = {
|
32
|
+
title: 'Common Inputs/Date Picker',
|
33
|
+
component: _DatePicker.default,
|
34
|
+
decorators: [_storybookFormik.default],
|
35
|
+
parameters: {
|
36
|
+
formik: {
|
37
|
+
initialValues: {
|
38
|
+
date: {
|
39
|
+
startDate: null,
|
40
|
+
endDate: null
|
41
|
+
},
|
42
|
+
singleDate: null
|
43
|
+
},
|
44
|
+
validationSchema: datePickerSchema
|
45
|
+
}
|
46
|
+
}
|
47
|
+
};
|
48
|
+
exports.default = _default;
|
49
|
+
|
50
|
+
var date = function date(args) {
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DatePicker.default, Object.assign({
|
52
|
+
label: "Double Date Picker",
|
53
|
+
name: "date"
|
54
|
+
}, args)), /*#__PURE__*/_react.default.createElement(_SingleDatePicker.default, Object.assign({
|
55
|
+
label: "Single Date Picker",
|
56
|
+
name: "singleDate"
|
57
|
+
}, args)));
|
58
|
+
};
|
59
|
+
|
60
|
+
exports.date = date;
|
@@ -0,0 +1,97 @@
|
|
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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
11
|
+
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
13
|
+
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
15
|
+
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
17
|
+
|
18
|
+
var _formik = require("formik");
|
19
|
+
|
20
|
+
require("react-dates/initialize");
|
21
|
+
|
22
|
+
require("react-dates/lib/css/_datepicker.css");
|
23
|
+
|
24
|
+
var _reactDates = require("react-dates");
|
25
|
+
|
26
|
+
var _templateObject, _templateObject2, _templateObject3;
|
27
|
+
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
29
|
+
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
31
|
+
|
32
|
+
var SingleCustomizedDatePicker = function SingleCustomizedDatePicker(props) {
|
33
|
+
var _useState = (0, _react.useState)(),
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
35
|
+
focused = _useState2[0],
|
36
|
+
setFocused = _useState2[1];
|
37
|
+
|
38
|
+
var _useField = (0, _formik.useField)(props),
|
39
|
+
_useField2 = (0, _slicedToArray2.default)(_useField, 3),
|
40
|
+
field = _useField2[0],
|
41
|
+
meta = _useField2[1],
|
42
|
+
helpers = _useField2[2];
|
43
|
+
|
44
|
+
console.log(field);
|
45
|
+
return /*#__PURE__*/_react.default.createElement(Container, props, /*#__PURE__*/_react.default.createElement(Label, Object.assign({
|
46
|
+
htmlFor: props.name
|
47
|
+
}, props), props.label), /*#__PURE__*/_react.default.createElement(_reactDates.SingleDatePicker, {
|
48
|
+
date: field.value,
|
49
|
+
onDateChange: function onDateChange(date) {
|
50
|
+
return helpers.setValue(date);
|
51
|
+
},
|
52
|
+
focused: focused,
|
53
|
+
onFocusChange: function onFocusChange(_ref) {
|
54
|
+
var focused = _ref.focused;
|
55
|
+
return setFocused(focused);
|
56
|
+
},
|
57
|
+
id: "your_unique_id",
|
58
|
+
numberOfMonths: 1,
|
59
|
+
onClose: function onClose() {
|
60
|
+
return helpers.setTouched(true);
|
61
|
+
}
|
62
|
+
}), meta.touched && meta.error && !field.value ? /*#__PURE__*/_react.default.createElement(Error, null, meta.error) : null);
|
63
|
+
};
|
64
|
+
|
65
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n\n & .CalendarDay {\n border: none;\n background-color: ", ";\n color: ", ";\n font-size: ", "px;\n border-radius: ", "px;\n padding: ", "px;\n\n &:hover{\n background-color: ", ";\n color: ", ";\n }\n }\n\n & .CalendarDay__selected {\n color: ", ";\n}\n\n & .CalendarDay__selected:hover {\n color: ", ";\n background: ", ";\n}\n"])), function (props) {
|
66
|
+
return props.background;
|
67
|
+
}, function (props) {
|
68
|
+
return props.color;
|
69
|
+
}, function (props) {
|
70
|
+
return props.fontSize;
|
71
|
+
}, function (props) {
|
72
|
+
return props.borderRadius;
|
73
|
+
}, function (props) {
|
74
|
+
return props.padding;
|
75
|
+
}, function (props) {
|
76
|
+
return props.mouseHoverBackground;
|
77
|
+
}, function (props) {
|
78
|
+
return props.mouseHoverColor;
|
79
|
+
}, function (props) {
|
80
|
+
return props.selectedColor;
|
81
|
+
}, function (props) {
|
82
|
+
return props.selectedOnHoverColor;
|
83
|
+
}, function (props) {
|
84
|
+
return props.selectedOnHoverBackground;
|
85
|
+
});
|
86
|
+
|
87
|
+
var Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: 5px;\n text-transform: capitalize;\n color: ", ";\n font-size: ", "px;\n"])), function (props) {
|
88
|
+
return props.labelColor;
|
89
|
+
}, function (props) {
|
90
|
+
return props.labelFontSize;
|
91
|
+
});
|
92
|
+
|
93
|
+
var Error = _styledComponents.default.p(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n color: red;\n margin-top: 3px;\n"])));
|
94
|
+
|
95
|
+
SingleCustomizedDatePicker.defaultProps = {};
|
96
|
+
var _default = SingleCustomizedDatePicker;
|
97
|
+
exports.default = _default;
|