@ludo.ninja/components 1.7.5 → 1.7.6
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/dist/api/graphql/index.js +7 -3
- package/dist/components/CreationCard/{CardHead.jsx → CardHead.js} +51 -51
- package/dist/components/CreationCard/index.js +106 -0
- package/dist/components/addWalletsRedirectPage/index.js +38 -0
- package/dist/components/{assetJSONLD.jsx → assetJSONLD.js} +5 -1
- package/dist/components/banner/index.js +71 -0
- package/dist/components/base/Meta/index.js +60 -0
- package/dist/components/base/NoSSR/index.js +10 -0
- package/dist/components/collectionPage/collectionLike/index.js +41 -0
- package/dist/components/deleteDialog/index.js +111 -0
- package/dist/components/editProfile/Cropper/{index.jsx → index.js} +44 -19
- package/dist/components/editProfile/UserPicProfile/index.js +282 -0
- package/dist/components/favoriteList/add/addAssetToFavoriteList/{index.jsx → index.js} +41 -15
- package/dist/components/favoriteList/add/addCollectionToFavoriteList/{index.jsx → index.js} +40 -14
- package/dist/components/favoriteList/add/addCreationToFavoriteList/{index.jsx → index.js} +41 -15
- package/dist/components/filters/applyResetBtns/index.js +28 -0
- package/dist/components/filters/galleriesFiltersForm/index.js +90 -0
- package/dist/components/filters/index.js +112 -0
- package/dist/components/filters/mobileFilters/index.js +21 -0
- package/dist/components/filters/setsFiltersForm/index.js +82 -0
- package/dist/components/forms/form/index.js +136 -0
- package/dist/components/forms/formsNavigation/index.js +74 -0
- package/dist/components/forms/formsTemplate/{index.jsx → index.js} +88 -59
- package/dist/components/forms/types/index.js +5 -2
- package/dist/components/gallery/add/addAssetToGallery/{index.jsx → index.js} +41 -15
- package/dist/components/gallery/add/addCreationToGallery/{index.jsx → index.js} +51 -24
- package/dist/components/gradientLabel/index.js +24 -0
- package/dist/components/headers/components/headerExperienceLabel/index.js +32 -0
- package/dist/components/headers/components/headerUserPic/index.js +27 -0
- package/dist/components/headers/header/index.js +32 -0
- package/dist/components/headers/headerSearch/index.js +40 -0
- package/dist/components/headers/headerSimple/index.js +33 -0
- package/dist/components/index.js +8 -1
- package/dist/components/inviteCodesForms/getEarlyAccessForm/{index.jsx → index.js} +50 -55
- package/dist/components/inviteCodesForms/joinWaitListForm/{index.jsx → index.js} +32 -38
- package/dist/components/inviteCodesForms/styles/index.js +13 -7
- package/dist/components/inviteCodesPage/components/index.js +14 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/index.js +24 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCode/index.js +30 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCode/loader/index.js +26 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/index.js +28 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/loader/index.js +21 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCopy/index.js +27 -0
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeDate/index.js +23 -0
- package/dist/components/inviteCodesPage/wrappers/index.js +12 -0
- package/dist/components/inviteCodesPage/wrappers/resumeCodes/index.js +54 -0
- package/dist/components/inviteCodesPage/wrappers/resumeCodes/loader/index.js +17 -0
- package/dist/components/inviteCodesPage/wrappers/unusedCodes/index.js +31 -0
- package/dist/components/inviteCodesPage/wrappers/usedCodes/index.js +37 -0
- package/dist/components/linkTabs/index.js +24 -0
- package/dist/components/linkTabs/linkTab/index.js +30 -0
- package/dist/components/myWallets/index.js +33 -0
- package/dist/components/myWallets/myWalletItem/index.js +137 -0
- package/dist/components/navigation/index.js +75 -0
- package/dist/components/profile/MultiversXAudit/MultiversXAudit.js +136 -0
- package/dist/components/profile/ProfileTabs.js +46 -0
- package/dist/components/profile/aboutText/index.js +110 -0
- package/dist/components/profile/addToGalleryBtns/index.js +45 -0
- package/dist/components/profile/followersSocial/followers/index.js +28 -0
- package/dist/components/profile/followersSocial/index.js +28 -0
- package/dist/components/profile/followersSocial/social/index.js +40 -0
- package/dist/components/profile/index.js +25 -11
- package/dist/components/profile/info/index.js +43 -0
- package/dist/components/profile/interests/data.js +5 -3
- package/dist/components/profile/interests/index.js +56 -0
- package/dist/components/profile/interests/type.js +2 -1
- package/dist/components/profile/jsonLd/{index.jsx → index.js} +5 -1
- package/dist/components/profile/pageHead/index.js +51 -0
- package/dist/components/profile/profileSkeleton/index.js +35 -0
- package/dist/components/profile/profileUserCards/index.js +19 -0
- package/dist/components/profile/profileUserCards/profileUserCard/index.js +157 -0
- package/dist/components/profile/rank/index.js +33 -0
- package/dist/components/profile/stats/index.js +28 -0
- package/dist/components/profile/wallets/index.js +73 -0
- package/dist/components/profile/wrapper/index.js +17 -0
- package/dist/components/registrationPage/index.js +10 -0
- package/dist/components/registrationPage/registrationSelectBox/index.js +24 -0
- package/dist/components/registrationPage/registrationSelection/index.js +43 -0
- package/dist/components/rewards/FAQ/index.js +132 -0
- package/dist/components/rewards/clarifications/index.js +54 -0
- package/dist/components/rewards/logoBottom/index.js +29 -0
- package/dist/components/rewards/prograssBar/index.js +32 -0
- package/dist/components/rewards/rewardsButton/index.js +17 -0
- package/dist/components/rewards/seasonBanner/index.js +29 -0
- package/dist/components/rewards/taskExpTab/index.js +64 -0
- package/dist/components/rewards/tasksGrid/{index.jsx → index.js} +32 -30
- package/dist/components/rewards/userExp/index.js +72 -0
- package/dist/components/search/SearchInputContainer.js +244 -0
- package/dist/components/search/index.js +86 -0
- package/dist/components/search/searchCategories/index.js +79 -0
- package/dist/components/search/searchCategories/type.js +2 -1
- package/dist/components/search/searchCloseMoreButtons/index.js +54 -0
- package/dist/components/search/searchResultCaption/index.js +31 -0
- package/dist/components/search/searchSelectsGalleries/index.js +70 -0
- package/dist/components/search/searchSelectsSets/index.js +69 -0
- package/dist/components/search/searchSimpleInput/index.js +85 -0
- package/dist/components/search/searchSuggestions/index.js +117 -0
- package/dist/components/search/searchSuggestions/searchSuggestionsCaption/index.js +27 -0
- package/dist/components/search/searchSuggestions/searchSuggestionsFooter/index.js +30 -0
- package/dist/components/search/searchSuggestions/searchSuggestionsItem/index.js +40 -0
- package/dist/components/search/searchSuggestions/searchSuggestionsItem/searchSuggestionsItemSkeleton/index.js +56 -0
- package/dist/components/search/searchSuggestions/searchSuggestionsNotFound/index.js +29 -0
- package/dist/components/shareDialog/index.js +72 -0
- package/dist/components/showcaseAssets/showcaseSort/data.js +4 -1
- package/dist/components/showcaseAssets/showcaseSort/index.js +28 -0
- package/dist/components/sidebar/data.js +89 -0
- package/dist/components/sidebar/index.js +133 -0
- package/dist/components/sidebar/initializer.js +38 -0
- package/dist/components/sidebar/sidebarFilters/index.js +30 -0
- package/dist/components/sidebar/sidebarInviteCodeLabel/index.js +67 -0
- package/dist/components/socialButtons/data.js +52 -0
- package/dist/components/socialButtons/icons/discord.js +7 -0
- package/dist/components/socialButtons/icons/facebook.js +8 -0
- package/dist/components/socialButtons/icons/instagram.js +9 -0
- package/dist/components/socialButtons/icons/medium.js +7 -0
- package/dist/components/socialButtons/icons/telegram.js +7 -0
- package/dist/components/socialButtons/icons/twitter.js +7 -0
- package/dist/components/socialButtons/index.js +32 -0
- package/dist/components/socialButtons/type.js +2 -1
- package/dist/components/tabs/icons/bell.js +9 -0
- package/dist/components/tabs/icons/profile.js +9 -0
- package/dist/components/tabs/icons/secure.js +8 -0
- package/dist/components/tabs/index.js +55 -0
- package/dist/components/toTopBtn/index.js +89 -0
- package/dist/dto/AssetEntity/index.js +24 -19
- package/dist/dto/AssetEntity/interface.js +2 -1
- package/dist/dto/AssetEntity/views/AssetAudio/{index.jsx → index.js} +13 -8
- package/dist/dto/AssetEntity/views/AssetImage/{index.jsx → index.js} +14 -9
- package/dist/dto/AssetEntity/views/AssetObject/{index.jsx → index.js} +15 -10
- package/dist/dto/AssetEntity/views/AssetOther/{index.jsx → index.js} +15 -10
- package/dist/dto/AssetEntity/views/AssetScreenshot/{index.jsx → index.js} +14 -9
- package/dist/dto/AssetEntity/views/AssetVideo/{index.jsx → index.js} +13 -8
- package/dist/dto/AssetEntity/views/index.js +16 -6
- package/dist/dto/Collection/CollectionCreationEntity/index.js +27 -22
- package/dist/dto/Collection/CollectionCreationEntity/interface.js +2 -1
- package/dist/dto/Collection/CollectionEntity/index.js +7 -5
- package/dist/dto/Collection/CollectionEntity/interface.js +2 -1
- package/dist/dto/CreationEntity/index.js +24 -19
- package/dist/dto/CreationEntity/interface.js +2 -1
- package/dist/dto/GalleryEntityV2/index.js +10 -5
- package/dist/dto/GalleryEntityV2/interface.js +2 -1
- package/dist/dto/common/ItemType/data.js +28 -26
- package/dist/dto/common/ItemType/{index.jsx → index.js} +7 -5
- package/dist/dto/common/ItemViews/CreationAudio/{index.jsx → index.js} +13 -8
- package/dist/dto/common/ItemViews/CreationImage/{index.jsx → index.js} +14 -9
- package/dist/dto/common/ItemViews/CreationObject/{index.jsx → index.js} +11 -6
- package/dist/dto/common/ItemViews/CreationOther/{index.jsx → index.js} +13 -8
- package/dist/dto/common/ItemViews/CreationVideo/{index.jsx → index.js} +13 -8
- package/dist/dto/common/ItemViews/index.js +21 -5
- package/dist/dto/common/Media/Audio/{index.jsx → index.js} +13 -8
- package/dist/dto/common/Media/Image/{index.jsx → index.js} +14 -9
- package/dist/dto/common/Media/Object/{index.jsx → index.js} +13 -8
- package/dist/dto/common/Media/Other/{index.jsx → index.js} +18 -13
- package/dist/dto/common/Media/Screenshot/{index.jsx → index.js} +14 -9
- package/dist/dto/common/Media/Urls/index.js +52 -34
- package/dist/dto/common/Media/Video/{index.jsx → index.js} +13 -8
- package/dist/dto/common/Media/{index.jsx → index.js} +5 -3
- package/dist/dto/common/Media/interface.js +2 -1
- package/dist/dto/index.js +33 -8
- package/dist/entities/user/type.js +2 -1
- package/dist/fonts/FontsInitializeLayout.js +67 -0
- package/dist/fonts/index.js +25 -3
- package/dist/fonts/vars.js +6 -1
- package/dist/hooks/apollo/index.js +11 -0
- package/dist/hooks/audio/useMultiAudio/{index.jsx → index.js} +12 -10
- package/dist/hooks/extension/useExtension/index.js +10 -8
- package/dist/hooks/favorites/index.js +18 -2
- package/dist/hooks/favorites/useGetFavoriteGallaryCreations/index.js +37 -31
- package/dist/hooks/favorites/useGetUserFevoritesCreations/index.js +37 -30
- package/dist/hooks/galleries/index.js +17 -1
- package/dist/hooks/galleries/useGetUserGalleriesCreations/index.js +38 -32
- package/dist/hooks/index.js +21 -5
- package/dist/hooks/likes/dynamic/{useFindCollectionsAndLikes.jsx → useFindCollectionsAndLikes.js} +33 -26
- package/dist/hooks/likes/dynamic/{useFindCreationsAndLikes.jsx → useFindCreationsAndLikes.js} +32 -26
- package/dist/hooks/likes/dynamic/{useGetCollectionInfoAndLikes.jsx → useGetCollectionInfoAndLikes.js} +29 -23
- package/dist/hooks/likes/dynamic/{useGetCreationsAndLikes.jsx → useGetCreationsAndLikes.js} +34 -27
- package/dist/hooks/likes/dynamic/{useGetCreationsAndLikesByType.jsx → useGetCreationsAndLikesByType.js} +36 -30
- package/dist/hooks/likes/dynamic/{useGetMixedLikesFavoriteList.jsx → useGetMixedLikesFavoriteList.js} +13 -11
- package/dist/hooks/likes/dynamic/{useGetTableLikes.jsx → useGetTableLikes.js} +30 -24
- package/dist/hooks/likes/index.js +32 -27
- package/dist/hooks/likes/useGetLikesAsset.js +23 -19
- package/dist/hooks/searchFiltersConnector/{index.jsx → index.js} +72 -44
- package/dist/hooks/useToGalleryAsset/{index.jsx → index.js} +22 -14
- package/dist/index.js +25 -9
- package/dist/layouts/{GlobalLayout.jsx → GlobalLayout.js} +10 -18
- package/dist/layouts/base/LWithRegularHeader/index.js +25 -0
- package/dist/layouts/base/LWithRegularHeader/type.js +2 -1
- package/dist/layouts/base/LWithSearchHeader/index.js +18 -0
- package/dist/layouts/base/LWithSearchHeader/type.js +2 -1
- package/dist/layouts/base/LWithSimpleHeader/index.js +21 -0
- package/dist/layouts/base/LWithSimpleHeader/type.js +2 -1
- package/dist/layouts/base/LWithoutHeader/index.js +23 -0
- package/dist/layouts/base/index.js +14 -4
- package/dist/layouts/custom/accountLayout/index.js +22 -0
- package/dist/layouts/custom/formsLayout/index.js +18 -0
- package/dist/layouts/custom/index.js +16 -5
- package/dist/layouts/custom/mainLayout/index.js +22 -0
- package/dist/layouts/custom/searchLayout/index.js +25 -0
- package/dist/layouts/custom/simpleLayout/index.js +22 -0
- package/dist/layouts/custom/styles.js +11 -5
- package/dist/layouts/index.js +21 -5
- package/dist/layouts/pageTransitionLayout.js +24 -0
- package/dist/layouts/pageWithLayout.js +2 -1
- package/dist/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +42 -35
- package/dist/modules/gallery/api/useGetFavoriteGallery.js +15 -11
- package/dist/modules/gallery/store.js +16 -10
- package/dist/modules/gallery/ui/AllResults.js +19 -0
- package/dist/modules/gallery/ui/Description.js +70 -0
- package/dist/modules/gallery/ui/{EditGallery.jsx → EditGallery.js} +24 -18
- package/dist/modules/gallery/ui/GalleryDeleteIcon.js +51 -0
- package/dist/modules/gallery/ui/PlaceholderItemsGallery.js +24 -0
- package/dist/modules/gallery/ui/STopSections.js +10 -4
- package/dist/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +37 -0
- package/dist/modules/gallery/ui/chooseGalleryItems/index.js +146 -0
- package/dist/modules/gallery/ui/createGalleryForm/{index.jsx → index.js} +40 -42
- package/dist/modules/gallery/ui/editGalleryForm/index.js +187 -0
- package/dist/modules/gallery/ui/itemsPreview/index.js +203 -0
- package/dist/modules/index.js +20 -4
- package/dist/modules/notifications/CreatorNotifications.js +42 -0
- package/dist/modules/notifications/index.js +6 -0
- package/dist/modules/sessionScroll/globalTabs.js +4 -1
- package/dist/modules/sessionScroll/index.js +39 -18
- package/dist/modules/sessionScroll/type.js +2 -1
- package/dist/modules/sessionScroll/useVirtuosoInitialScroll.js +16 -12
- package/dist/modules/user/auth/index.js +17 -1
- package/dist/modules/user/auth/useAuthVerification.js +37 -10
- package/dist/modules/user/auth/useSignIn.js +9 -5
- package/dist/modules/user/auth/useSignOut.js +19 -12
- package/dist/modules/user/index.js +19 -3
- package/dist/modules/user/profileData/index.js +17 -1
- package/dist/modules/user/profileData/{profileDataInitialization.jsx → profileDataInitialization.js} +17 -13
- package/dist/modules/user/{store.jsx → store.js} +12 -9
- package/dist/modules/virtuoso/VirtuosoPageBuilder.js +152 -0
- package/dist/modules/virtuoso/{VirtuosoToTopBtn.jsx → VirtuosoToTopBtn.js} +12 -7
- package/dist/modules/virtuoso/index.js +21 -5
- package/dist/modules/virtuoso/types.js +2 -1
- package/dist/modules/virtuoso/useSubscribeVirtuosoScrollToHeader.js +8 -4
- package/dist/modules/virtuoso/useVirtuosoData.js +10 -6
- package/dist/pages/index.js +16 -0
- package/dist/store/index.js +23 -6
- package/dist/store/media/index.js +7 -4
- package/dist/store/media/types.js +2 -1
- package/dist/store/ui/index.js +24 -21
- package/dist/store/ui/types.js +2 -1
- package/dist/store/ui/utils.js +8 -4
- package/dist/styles/ScreenWidth.js +6 -3
- package/dist/styles/animations/index.js +11 -0
- package/dist/styles/colors/index.js +38 -1
- package/dist/styles/globalStyles.js +23 -0
- package/dist/styles/index.js +26 -5
- package/dist/styles/mixins/boxShadow.js +10 -0
- package/dist/styles/mixins/boxTransform.js +10 -0
- package/dist/styles/mixins/index.js +25 -3
- package/dist/styles/mixins/z-indexes.js +13 -0
- package/dist/styles/typography/index.js +12 -0
- package/dist/system/ActiveLink/index.js +71 -0
- package/dist/system/Alert/index.js +20 -0
- package/dist/system/Alert/type.js +8 -1
- package/dist/system/BasicOverlay/index.js +20 -0
- package/dist/system/Buttons/IconButton/index.js +7 -0
- package/dist/system/Buttons/IconWithButton/index.js +7 -0
- package/dist/system/Buttons/MainButton/index.js +7 -0
- package/dist/system/Buttons/SecondaryButton/index.js +7 -0
- package/dist/system/Buttons/index.js +14 -4
- package/dist/system/Cards/CardCheckbox/index.js +51 -0
- package/dist/system/Cards/CardContent/CardCategory/index.js +28 -0
- package/dist/system/Cards/CardContent/CardLikes/index.js +32 -0
- package/dist/system/Cards/CardContent/CardShowMore/index.js +42 -0
- package/dist/system/Cards/CardContent/index.js +52 -0
- package/dist/system/Cards/CardHeadIcons/{index.jsx → index.js} +49 -51
- package/dist/system/Cards/CardMedia/CardAudio/index.js +93 -0
- package/dist/system/Cards/CardMedia/CardImage/index.js +44 -0
- package/dist/system/Cards/CardMedia/CardVideo/index.js +83 -0
- package/dist/system/Cards/CardMedia/index.js +12 -3
- package/dist/system/Cards/CardRank/index.js +33 -0
- package/dist/system/Cards/CardsGrid/index.js +80 -0
- package/dist/system/Cards/HideLink/index.js +27 -0
- package/dist/system/Cards/MultiMediaCard/index.js +81 -0
- package/dist/system/Cards/RegularCard/index.js +56 -0
- package/dist/system/Cards/Styles/Content.js +10 -5
- package/dist/system/Cards/Styles/Head.js +10 -5
- package/dist/system/Cards/Styles/Headicons.js +11 -6
- package/dist/system/Cards/Styles/Image.js +10 -5
- package/dist/system/Cards/Styles/Likes.js +12 -7
- package/dist/system/Cards/Styles/MultiHead.js +10 -5
- package/dist/system/Cards/Styles/Video.js +8 -3
- package/dist/system/Cards/Styles/index.js +20 -7
- package/dist/system/Cards/index.js +46 -14
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsError/{index.jsx → index.js} +40 -15
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults/index.js +26 -0
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton/index.js +38 -0
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/index.js +38 -0
- package/dist/system/CardsHolderWithSkeleton/CardsHolderLoader/index.js +28 -0
- package/dist/system/CardsHolderWithSkeleton/index.js +19 -0
- package/dist/system/DropDown/DropDown.test.js +42 -0
- package/dist/system/DropDown/index.js +63 -0
- package/dist/system/Filters/helpers.js +5 -1
- package/dist/system/Filters/index.js +18 -2
- package/dist/system/Filters/type.js +5 -2
- package/dist/system/Forms/Checkbox/{Checkbox.test.jsx → Checkbox.test.js} +29 -13
- package/dist/system/Forms/Checkbox/index.js +71 -0
- package/dist/system/Forms/DatePicker/index.js +43 -0
- package/dist/system/Forms/ErrorLabel/ErrorLabel.test.js +27 -0
- package/dist/system/Forms/ErrorLabel/index.js +20 -0
- package/dist/system/Forms/Input/{Input.test.jsx → Input.test.js} +18 -13
- package/dist/system/Forms/Input/index.js +45 -0
- package/dist/system/Forms/Input/type.js +2 -1
- package/dist/system/Forms/Messages/index.js +3 -1
- package/dist/system/Forms/RadioInput/index.js +42 -0
- package/dist/system/Forms/Selects/DesktopSelect/index.js +153 -0
- package/dist/system/Forms/Selects/DesktopSelect/type.js +2 -1
- package/dist/system/Forms/Selects/MobileSelect/index.js +55 -0
- package/dist/system/Forms/TextArea/index.js +44 -0
- package/dist/system/Forms/index.js +16 -6
- package/dist/system/Img/ExternalImage/index.js +53 -0
- package/dist/system/Img/ImageInterceptor/ImageInterceptor.test.js +53 -0
- package/dist/system/Img/ImageInterceptor/index.js +56 -0
- package/dist/system/Img/Profilepic/index.js +39 -0
- package/dist/system/Img/Userpic/{UserPic.test.jsx → UserPic.test.js} +24 -21
- package/dist/system/Img/Userpic/index.js +99 -0
- package/dist/system/Img/index.js +20 -4
- package/dist/system/Labels/ExperienceLabel/ExperienceLabel.test.js +64 -0
- package/dist/system/Labels/ExperienceLabel/index.js +44 -0
- package/dist/system/Labels/InviteLabel/InviteLabel.test.js +56 -0
- package/dist/system/Labels/InviteLabel/index.js +38 -0
- package/dist/system/Labels/SkeletonLabel/index.js +7 -0
- package/dist/system/Modals/Modal/Modal.test.js +36 -0
- package/dist/system/Modals/Modal/index.js +33 -0
- package/dist/system/Modals/ModalSidebar/CreatorModalSidebarPortal.js +48 -0
- package/dist/system/Modals/ModalSidebar/ModalSidebar.test.js +35 -0
- package/dist/system/Modals/ModalSidebar/ModalSidebarPortal.js +19 -0
- package/dist/system/Modals/ModalSidebar/index.js +33 -0
- package/dist/system/Modals/index.js +10 -2
- package/dist/system/Overlay/{Overlay.test.jsx → Overlay.test.js} +17 -13
- package/dist/system/Overlay/index.js +28 -0
- package/dist/system/PageLoader/index.js +7 -0
- package/dist/system/Palete/index.js +7 -0
- package/dist/system/ShareIconResize.js +27 -0
- package/dist/system/Tabs/TabNavLink/TabNavLink.test.js +40 -0
- package/dist/system/Tabs/TabNavLink/index.js +27 -0
- package/dist/system/Tabs/TabsNav/TabsNav.test.js +43 -0
- package/dist/system/Tabs/TabsNav/index.js +28 -0
- package/dist/system/Tabs/TabsNav/type.js +2 -1
- package/dist/system/Tabs/TabsPanel/TabsPanel.test.js +37 -0
- package/dist/system/Tabs/TabsPanel/index.js +21 -0
- package/dist/system/Tabs/index.js +27 -4
- package/dist/system/index.js +49 -21
- package/dist/system/theme.js +7 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/3d.js +5 -1
- package/dist/utils/adaptive/check4k.js +9 -5
- package/dist/utils/adaptive/index.js +18 -2
- package/dist/utils/adaptive/scale.js +9 -5
- package/dist/utils/auth/index.js +10 -3
- package/dist/utils/copyBtn/index.js +107 -0
- package/dist/utils/env/index.js +26 -15
- package/dist/utils/env/isProd/index.js +7 -3
- package/dist/utils/env/type.js +5 -2
- package/dist/utils/extractItemIds/index.js +12 -0
- package/dist/utils/getDimensionsImage.js +5 -1
- package/dist/utils/getPageSizeAssets.js +9 -5
- package/dist/utils/healzHandler/index.js +5 -1
- package/dist/utils/imageProportionsSize/{index.jsx → index.js} +5 -1
- package/dist/utils/index.js +22 -6
- package/dist/utils/screen/index.js +31 -24
- package/dist/utils/ssrFunctions/index.js +13 -7
- package/dist/utils/ui/index.js +8 -0
- package/package.json +1 -1
- package/dist/components/CreationCard/index.jsx +0 -70
- package/dist/components/addWalletsRedirectPage/index.jsx +0 -40
- package/dist/components/banner/index.jsx +0 -49
- package/dist/components/base/Meta/index.jsx +0 -59
- package/dist/components/base/NoSSR/index.jsx +0 -5
- package/dist/components/collectionPage/collectionLike/index.jsx +0 -40
- package/dist/components/deleteDialog/index.jsx +0 -111
- package/dist/components/editProfile/UserPicProfile/index.jsx +0 -254
- package/dist/components/filters/applyResetBtns/index.jsx +0 -26
- package/dist/components/filters/galleriesFiltersForm/index.jsx +0 -71
- package/dist/components/filters/index.jsx +0 -92
- package/dist/components/filters/mobileFilters/index.jsx +0 -16
- package/dist/components/filters/setsFiltersForm/index.jsx +0 -61
- package/dist/components/forms/form/index.jsx +0 -118
- package/dist/components/forms/formsNavigation/index.jsx +0 -54
- package/dist/components/gradientLabel/index.jsx +0 -19
- package/dist/components/headers/components/headerExperienceLabel/index.jsx +0 -28
- package/dist/components/headers/components/headerUserPic/index.jsx +0 -23
- package/dist/components/headers/header/index.jsx +0 -27
- package/dist/components/headers/headerSearch/index.jsx +0 -35
- package/dist/components/headers/headerSimple/index.jsx +0 -30
- package/dist/components/inviteCodesPage/components/index.jsx +0 -5
- package/dist/components/inviteCodesPage/components/inviteCodes/index.jsx +0 -19
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCode/index.jsx +0 -26
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCode/loader/index.jsx +0 -22
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/index.jsx +0 -23
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCaption/loader/index.jsx +0 -16
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeCopy/index.jsx +0 -27
- package/dist/components/inviteCodesPage/components/inviteCodes/inviteCodeDate/index.jsx +0 -20
- package/dist/components/inviteCodesPage/wrappers/index.jsx +0 -4
- package/dist/components/inviteCodesPage/wrappers/resumeCodes/index.jsx +0 -59
- package/dist/components/inviteCodesPage/wrappers/resumeCodes/loader/index.jsx +0 -13
- package/dist/components/inviteCodesPage/wrappers/unusedCodes/index.jsx +0 -28
- package/dist/components/inviteCodesPage/wrappers/usedCodes/index.jsx +0 -35
- package/dist/components/linkTabs/index.jsx +0 -21
- package/dist/components/linkTabs/linkTab/index.jsx +0 -27
- package/dist/components/myWallets/index.jsx +0 -29
- package/dist/components/myWallets/myWalletItem/index.jsx +0 -116
- package/dist/components/navigation/index.jsx +0 -65
- package/dist/components/profile/MultiversXAudit/MultiversXAudit.jsx +0 -134
- package/dist/components/profile/ProfileTabs.jsx +0 -41
- package/dist/components/profile/aboutText/index.jsx +0 -89
- package/dist/components/profile/addToGalleryBtns/index.jsx +0 -43
- package/dist/components/profile/followersSocial/followers/index.jsx +0 -22
- package/dist/components/profile/followersSocial/index.jsx +0 -22
- package/dist/components/profile/followersSocial/social/index.jsx +0 -35
- package/dist/components/profile/info/index.jsx +0 -39
- package/dist/components/profile/interests/index.jsx +0 -64
- package/dist/components/profile/pageHead/index.jsx +0 -45
- package/dist/components/profile/profileSkeleton/index.jsx +0 -33
- package/dist/components/profile/profileUserCards/index.jsx +0 -12
- package/dist/components/profile/profileUserCards/profileUserCard/index.jsx +0 -132
- package/dist/components/profile/rank/index.jsx +0 -34
- package/dist/components/profile/stats/index.jsx +0 -29
- package/dist/components/profile/wallets/index.jsx +0 -74
- package/dist/components/profile/wrapper/index.jsx +0 -20
- package/dist/components/registrationPage/index.jsx +0 -3
- package/dist/components/registrationPage/registrationSelectBox/index.jsx +0 -20
- package/dist/components/registrationPage/registrationSelection/index.jsx +0 -52
- package/dist/components/rewards/FAQ/index.jsx +0 -112
- package/dist/components/rewards/clarifications/index.jsx +0 -59
- package/dist/components/rewards/logoBottom/index.jsx +0 -25
- package/dist/components/rewards/prograssBar/index.jsx +0 -29
- package/dist/components/rewards/rewardsButton/index.jsx +0 -12
- package/dist/components/rewards/seasonBanner/index.jsx +0 -25
- package/dist/components/rewards/taskExpTab/index.jsx +0 -71
- package/dist/components/rewards/userExp/index.jsx +0 -73
- package/dist/components/search/SearchInputContainer.jsx +0 -216
- package/dist/components/search/index.jsx +0 -60
- package/dist/components/search/searchCategories/index.jsx +0 -55
- package/dist/components/search/searchCloseMoreButtons/index.jsx +0 -52
- package/dist/components/search/searchResultCaption/index.jsx +0 -29
- package/dist/components/search/searchSelectsGalleries/index.jsx +0 -58
- package/dist/components/search/searchSelectsSets/index.jsx +0 -54
- package/dist/components/search/searchSimpleInput/index.jsx +0 -59
- package/dist/components/search/searchSuggestions/index.jsx +0 -119
- package/dist/components/search/searchSuggestions/searchSuggestionsCaption/index.jsx +0 -23
- package/dist/components/search/searchSuggestions/searchSuggestionsFooter/index.jsx +0 -26
- package/dist/components/search/searchSuggestions/searchSuggestionsItem/index.jsx +0 -42
- package/dist/components/search/searchSuggestions/searchSuggestionsItem/searchSuggestionsItemSkeleton/index.jsx +0 -33
- package/dist/components/search/searchSuggestions/searchSuggestionsNotFound/index.jsx +0 -22
- package/dist/components/shareDialog/index.jsx +0 -86
- package/dist/components/showcaseAssets/showcaseSort/index.jsx +0 -25
- package/dist/components/sidebar/data.jsx +0 -81
- package/dist/components/sidebar/index.jsx +0 -112
- package/dist/components/sidebar/initializer.jsx +0 -8
- package/dist/components/sidebar/sidebarFilters/index.jsx +0 -28
- package/dist/components/sidebar/sidebarInviteCodeLabel/index.jsx +0 -40
- package/dist/components/socialButtons/data.jsx +0 -47
- package/dist/components/socialButtons/icons/discord.jsx +0 -6
- package/dist/components/socialButtons/icons/facebook.jsx +0 -7
- package/dist/components/socialButtons/icons/instagram.jsx +0 -8
- package/dist/components/socialButtons/icons/medium.jsx +0 -6
- package/dist/components/socialButtons/icons/telegram.jsx +0 -6
- package/dist/components/socialButtons/icons/twitter.jsx +0 -6
- package/dist/components/socialButtons/index.jsx +0 -30
- package/dist/components/tabs/icons/bell.jsx +0 -8
- package/dist/components/tabs/icons/profile.jsx +0 -8
- package/dist/components/tabs/icons/secure.jsx +0 -7
- package/dist/components/tabs/index.jsx +0 -53
- package/dist/components/toTopBtn/index.jsx +0 -61
- package/dist/fonts/FontsInitializeLayout.jsx +0 -44
- package/dist/hooks/apollo/index.jsx +0 -7
- package/dist/layouts/base/LWithRegularHeader/index.jsx +0 -21
- package/dist/layouts/base/LWithSearchHeader/index.jsx +0 -14
- package/dist/layouts/base/LWithSimpleHeader/index.jsx +0 -17
- package/dist/layouts/base/LWithoutHeader/index.jsx +0 -19
- package/dist/layouts/custom/accountLayout/index.jsx +0 -22
- package/dist/layouts/custom/formsLayout/index.jsx +0 -15
- package/dist/layouts/custom/mainLayout/index.jsx +0 -20
- package/dist/layouts/custom/searchLayout/index.jsx +0 -23
- package/dist/layouts/custom/simpleLayout/index.jsx +0 -20
- package/dist/layouts/pageTransitionLayout.jsx +0 -25
- package/dist/modules/gallery/ui/AllResults.jsx +0 -11
- package/dist/modules/gallery/ui/Description.jsx +0 -50
- package/dist/modules/gallery/ui/GalleryDeleteIcon.jsx +0 -21
- package/dist/modules/gallery/ui/PlaceholderItemsGallery.jsx +0 -19
- package/dist/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.jsx +0 -38
- package/dist/modules/gallery/ui/chooseGalleryItems/index.jsx +0 -117
- package/dist/modules/gallery/ui/editGalleryForm/index.jsx +0 -168
- package/dist/modules/gallery/ui/itemsPreview/index.jsx +0 -180
- package/dist/modules/notifications/CreatorNotifications.jsx +0 -14
- package/dist/modules/notifications/index.jsx +0 -3
- package/dist/modules/virtuoso/VirtuosoPageBuilder.jsx +0 -127
- package/dist/pages/index.jsx +0 -12
- package/dist/styles/animations/index.jsx +0 -8
- package/dist/styles/globalStyles.jsx +0 -21
- package/dist/styles/mixins/boxShadow.jsx +0 -8
- package/dist/styles/mixins/boxTransform.jsx +0 -8
- package/dist/styles/mixins/z-indexes.jsx +0 -10
- package/dist/styles/typography/index.jsx +0 -1
- package/dist/system/ActiveLink/index.jsx +0 -34
- package/dist/system/Alert/index.jsx +0 -15
- package/dist/system/BasicOverlay/index.jsx +0 -15
- package/dist/system/Buttons/IconButton/index.jsx +0 -2
- package/dist/system/Buttons/IconWithButton/index.jsx +0 -2
- package/dist/system/Buttons/MainButton/index.jsx +0 -2
- package/dist/system/Buttons/SecondaryButton/index.jsx +0 -2
- package/dist/system/Cards/CardCheckbox/index.jsx +0 -25
- package/dist/system/Cards/CardContent/CardCategory/index.jsx +0 -25
- package/dist/system/Cards/CardContent/CardLikes/index.jsx +0 -31
- package/dist/system/Cards/CardContent/CardShowMore/index.jsx +0 -39
- package/dist/system/Cards/CardContent/index.jsx +0 -61
- package/dist/system/Cards/CardMedia/CardAudio/index.jsx +0 -66
- package/dist/system/Cards/CardMedia/CardImage/index.jsx +0 -17
- package/dist/system/Cards/CardMedia/CardVideo/index.jsx +0 -57
- package/dist/system/Cards/CardRank/index.jsx +0 -34
- package/dist/system/Cards/CardsGrid/index.jsx +0 -59
- package/dist/system/Cards/HideLink/index.jsx +0 -17
- package/dist/system/Cards/MultiMediaCard/index.jsx +0 -82
- package/dist/system/Cards/RegularCard/index.jsx +0 -57
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults/index.jsx +0 -22
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton/index.jsx +0 -37
- package/dist/system/CardsHolderWithSkeleton/CardsHolder/index.jsx +0 -37
- package/dist/system/CardsHolderWithSkeleton/CardsHolderLoader/index.jsx +0 -24
- package/dist/system/CardsHolderWithSkeleton/index.jsx +0 -17
- package/dist/system/DropDown/DropDown.test.jsx +0 -41
- package/dist/system/DropDown/index.jsx +0 -38
- package/dist/system/Forms/Checkbox/index.jsx +0 -35
- package/dist/system/Forms/DatePicker/index.jsx +0 -39
- package/dist/system/Forms/ErrorLabel/ErrorLabel.test.jsx +0 -22
- package/dist/system/Forms/ErrorLabel/index.jsx +0 -15
- package/dist/system/Forms/Input/index.jsx +0 -29
- package/dist/system/Forms/RadioInput/index.jsx +0 -27
- package/dist/system/Forms/Selects/DesktopSelect/index.jsx +0 -115
- package/dist/system/Forms/Selects/MobileSelect/index.jsx +0 -29
- package/dist/system/Forms/TextArea/index.jsx +0 -29
- package/dist/system/Img/ExternalImage/index.jsx +0 -13
- package/dist/system/Img/ImageInterceptor/ImageInterceptor.test.jsx +0 -52
- package/dist/system/Img/ImageInterceptor/index.jsx +0 -27
- package/dist/system/Img/Profilepic/index.jsx +0 -33
- package/dist/system/Img/Userpic/index.jsx +0 -74
- package/dist/system/Labels/ExperienceLabel/ExperienceLabel.test.jsx +0 -49
- package/dist/system/Labels/ExperienceLabel/index.jsx +0 -38
- package/dist/system/Labels/InviteLabel/InviteLabel.test.jsx +0 -41
- package/dist/system/Labels/InviteLabel/index.jsx +0 -34
- package/dist/system/Labels/SkeletonLabel/index.jsx +0 -2
- package/dist/system/Modals/Modal/Modal.test.jsx +0 -31
- package/dist/system/Modals/Modal/index.jsx +0 -29
- package/dist/system/Modals/ModalSidebar/CreatorModalSidebarPortal.jsx +0 -18
- package/dist/system/Modals/ModalSidebar/ModalSidebar.test.jsx +0 -30
- package/dist/system/Modals/ModalSidebar/ModalSidebarPortal.jsx +0 -14
- package/dist/system/Modals/ModalSidebar/index.jsx +0 -28
- package/dist/system/Overlay/index.jsx +0 -24
- package/dist/system/PageLoader/index.jsx +0 -2
- package/dist/system/Palete/index.jsx +0 -2
- package/dist/system/ShareIconResize.jsx +0 -21
- package/dist/system/Tabs/TabNavLink/TabNavLink.test.jsx +0 -35
- package/dist/system/Tabs/TabNavLink/index.jsx +0 -23
- package/dist/system/Tabs/TabsNav/TabsNav.test.jsx +0 -38
- package/dist/system/Tabs/TabsNav/index.jsx +0 -22
- package/dist/system/Tabs/TabsPanel/TabsPanel.test.jsx +0 -36
- package/dist/system/Tabs/TabsPanel/index.jsx +0 -16
- package/dist/utils/copyBtn/index.jsx +0 -80
- package/dist/utils/extractItemIds/index.jsx +0 -8
- package/dist/utils/ui/index.jsx +0 -4
- /package/dist/components/headers/components/MobileToggle/{index.jsx → index.js} +0 -0
- /package/dist/system/Flex/{index.jsx → index.js} +0 -0
- /package/dist/system/Text/{index.jsx → index.js} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
8
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
9
|
-
import { rotate } from '@/styles/animations';
|
|
10
|
-
import { getAdaptiveScale } from '@/utils/adaptive/scale';
|
|
11
|
-
import { useWindowDimensionsWithServerInitial } from '@/utils/screen';
|
|
12
|
-
import LoaderIcon from '@/public/cardsHolderLoader/loader.svg';
|
|
13
|
-
// Styles
|
|
14
|
-
var StyledCardsHolderLoader = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 24px;\n\n .loader {\n animation: ", " 1s ease-in-out infinite;\n }\n\n ", " {\n padding-top: ", ";\n }\n\n /* &.virtual {\n position: fixed;\n bottom: 90px;\n right: 30px;\n } */\n"], ["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 24px;\n\n .loader {\n animation: ", " 1s ease-in-out infinite;\n }\n\n ", " {\n padding-top: ", ";\n }\n\n /* &.virtual {\n position: fixed;\n bottom: 90px;\n right: 30px;\n } */\n"])), rotate, mediaQuery.minWidthFourK, adaptiveValueCalc(24));
|
|
15
|
-
// Component
|
|
16
|
-
var CardsHolderLoader = function () {
|
|
17
|
-
var windowDimensions = useWindowDimensionsWithServerInitial().windowDimensions;
|
|
18
|
-
return (<StyledCardsHolderLoader style={getAdaptiveScale({ windowDimensions: windowDimensions, currentSize: 1 })}>
|
|
19
|
-
<LoaderIcon className={'loader'}/>
|
|
20
|
-
</StyledCardsHolderLoader>);
|
|
21
|
-
};
|
|
22
|
-
// Export
|
|
23
|
-
export default CardsHolderLoader;
|
|
24
|
-
var templateObject_1;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import CardsGrid from '@/system/Cards/CardsGrid';
|
|
3
|
-
import CardsHolder from '@/system/CardsHolderWithSkeleton/CardsHolder';
|
|
4
|
-
import CardSkeletonWrapper from '@/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton';
|
|
5
|
-
// Component
|
|
6
|
-
var CardsHolderWithSkeleton = function (_a) {
|
|
7
|
-
var loading = _a.loading, error = _a.error, items = _a.items, refetchQuery = _a.refetchQuery, children = _a.children, notFoundText = _a.notFoundText, isOneColumn = _a.isOneColumn, isTwoColumnLayout = _a.isTwoColumnLayout, isNeedShowNetWorth = _a.isNeedShowNetWorth, isForVirtualize = _a.isForVirtualize, likesArray = _a.likesArray, tabsSlot = _a.tabsSlot, isProdENV = _a.isProdENV;
|
|
8
|
-
if (loading && (!likesArray || (likesArray === null || likesArray === void 0 ? void 0 : likesArray.length) === 0))
|
|
9
|
-
return (<CardsGrid isTwoColumnLayout={isTwoColumnLayout} isNeedShowNetWorth={isNeedShowNetWorth} isEmptyGallery={false} tabsSlot={tabsSlot} isProdENV={isProdENV}>
|
|
10
|
-
<CardSkeletonWrapper cardCount={40}/>
|
|
11
|
-
</CardsGrid>);
|
|
12
|
-
return (<CardsHolder items={items} refetchQuery={refetchQuery} error={error} loading={loading} notFoundText={notFoundText} isOneColumn={isOneColumn} isTwoColumnLayout={isTwoColumnLayout} isNeedShowNetWorth={isNeedShowNetWorth} isForVirtualize={isForVirtualize} likesArray={likesArray} tabsSlot={tabsSlot} isProdENV={isProdENV}>
|
|
13
|
-
{children}
|
|
14
|
-
</CardsHolder>);
|
|
15
|
-
};
|
|
16
|
-
// Export
|
|
17
|
-
export default CardsHolderWithSkeleton;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
3
|
-
import 'jest-styled-components';
|
|
4
|
-
import DropDown from '../DropDown';
|
|
5
|
-
jest.mock('@/public/dropDown/arrow_down.svg', function () { return 'div'; });
|
|
6
|
-
describe('DropDown Component', function () {
|
|
7
|
-
test('renders with caption and closed by default', function () {
|
|
8
|
-
var _a;
|
|
9
|
-
var mockFallback = jest.fn();
|
|
10
|
-
render(<div data-testid={'test_container'}>
|
|
11
|
-
<DropDown caption="Test Dropdown" fallBackOnClose={mockFallback}>
|
|
12
|
-
<div>Dropdown Content</div>
|
|
13
|
-
</DropDown>
|
|
14
|
-
</div>);
|
|
15
|
-
var captionElement = screen.getByText('Test Dropdown');
|
|
16
|
-
expect(captionElement).toBeInTheDocument();
|
|
17
|
-
var contentElement = (_a = screen
|
|
18
|
-
.queryByTestId('test_container')) === null || _a === void 0 ? void 0 : _a.querySelector('.dropDownContent');
|
|
19
|
-
expect(contentElement).toHaveStyle('grid-template-rows:0fr');
|
|
20
|
-
fireEvent.click(captionElement);
|
|
21
|
-
expect(contentElement).toHaveStyle('grid-template-rows:1fr');
|
|
22
|
-
});
|
|
23
|
-
test('calls fallback function when closed', function () {
|
|
24
|
-
var mockFallback = jest.fn();
|
|
25
|
-
render(<DropDown caption="Test Dropdown" fallBackOnClose={mockFallback}>
|
|
26
|
-
<div>Dropdown Content</div>
|
|
27
|
-
</DropDown>);
|
|
28
|
-
var captionElement = screen.getByText('Test Dropdown');
|
|
29
|
-
fireEvent.click(captionElement);
|
|
30
|
-
fireEvent.click(captionElement);
|
|
31
|
-
expect(mockFallback).toHaveBeenCalledWith(null);
|
|
32
|
-
});
|
|
33
|
-
test('renders with active prop', function () {
|
|
34
|
-
var mockFallback = jest.fn();
|
|
35
|
-
render(<DropDown caption="Test Dropdown" fallBackOnClose={mockFallback} active>
|
|
36
|
-
<div>Dropdown Content</div>
|
|
37
|
-
</DropDown>);
|
|
38
|
-
var openedContentElement = screen.getByText('Dropdown Content');
|
|
39
|
-
expect(openedContentElement).toBeInTheDocument();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React, { useEffect, useState } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { InactiveButtonColor } from '@/styles/colors';
|
|
8
|
-
import ArrowDownIcon from '@/public/dropDown/arrow_down.svg';
|
|
9
|
-
// Styles
|
|
10
|
-
var StyledDropDown = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-bottom: 1px solid ", ";\n\n .dropDownTab {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 18px 0;\n text-transform: capitalize;\n width: 100%;\n\n &Caption {\n font-size: 1.4em;\n font-weight: 500;\n color: #000000;\n }\n\n &Icon {\n transform: ", ";\n transition: transform 0.3s;\n }\n }\n\n .dropDownContent {\n display: grid;\n grid-template-rows: ", ";\n\n overflow: hidden;\n transition: grid-template-rows 300ms ease-in-out;\n .gridDown {\n min-height: 0;\n & > *:last-child {\n margin-bottom: 24px;\n }\n }\n }\n"], ["\n border-bottom: 1px solid ", ";\n\n .dropDownTab {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 18px 0;\n text-transform: capitalize;\n width: 100%;\n\n &Caption {\n font-size: 1.4em;\n font-weight: 500;\n color: #000000;\n }\n\n &Icon {\n transform: ", ";\n transition: transform 0.3s;\n }\n }\n\n .dropDownContent {\n display: grid;\n grid-template-rows: ", ";\n\n overflow: hidden;\n transition: grid-template-rows 300ms ease-in-out;\n .gridDown {\n min-height: 0;\n & > *:last-child {\n margin-bottom: 24px;\n }\n }\n }\n"])), InactiveButtonColor, function (props) {
|
|
11
|
-
return props.isActive ? 'rotate(180deg)' : 'rotate(0deg)';
|
|
12
|
-
}, function (props) { return (props.isActive ? '1fr' : '0fr'); });
|
|
13
|
-
// Component
|
|
14
|
-
var DropDown = function (_a) {
|
|
15
|
-
var caption = _a.caption, children = _a.children, fallBackOnClose = _a.fallBackOnClose, active = _a.active;
|
|
16
|
-
var _b = useState(false), isActive = _b[0], setActive = _b[1];
|
|
17
|
-
useEffect(function () {
|
|
18
|
-
if (active) {
|
|
19
|
-
setActive(true);
|
|
20
|
-
}
|
|
21
|
-
}, []);
|
|
22
|
-
return (<StyledDropDown isActive={isActive}>
|
|
23
|
-
<div className={'dropDownTab'} onClick={function () {
|
|
24
|
-
setActive(!isActive);
|
|
25
|
-
if (!isActive)
|
|
26
|
-
fallBackOnClose(null);
|
|
27
|
-
}}>
|
|
28
|
-
<span className={'dropDownTabCaption'}>{caption}</span>
|
|
29
|
-
<ArrowDownIcon className={'dropDownTabIcon'}/>
|
|
30
|
-
</div>
|
|
31
|
-
<div className={'dropDownContent'}>
|
|
32
|
-
<div className={'gridDown'}>{children}</div>
|
|
33
|
-
</div>
|
|
34
|
-
</StyledDropDown>);
|
|
35
|
-
};
|
|
36
|
-
// Export
|
|
37
|
-
export default DropDown;
|
|
38
|
-
var templateObject_1;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { AccentColor, BorderColorLight, TextGrayColor, WhiteColor, } from '@/styles/colors';
|
|
8
|
-
import BasicErrorLabel from '@/system/Forms/ErrorLabel';
|
|
9
|
-
import { StyledInput } from '@/system/Forms/Input';
|
|
10
|
-
var BasicCheckbox = styled.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 6px;\n padding-left: 25px;\n padding-bottom: 2px;\n margin: 14px 0;\n font-size: 15px;\n font-weight: 400;\n color: ", ";\n width: 100%;\n position: relative;\n cursor: pointer;\n\n .input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n\n &:checked ~ .checkmark {\n background-color: ", ";\n background-image: url('/checkboxArrow.svg');\n background-position: center;\n background-repeat: no-repeat;\n border-color: transparent;\n }\n }\n\n .checkmark {\n position: absolute;\n left: 0;\n height: 18px;\n width: 18px;\n background-color: ", ";\n border: 2px solid ", ";\n border-radius: 6px;\n }\n"], ["\n display: flex;\n align-items: center;\n gap: 6px;\n padding-left: 25px;\n padding-bottom: 2px;\n margin: 14px 0;\n font-size: 15px;\n font-weight: 400;\n color: ", ";\n width: 100%;\n position: relative;\n cursor: pointer;\n\n .input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n\n &:checked ~ .checkmark {\n background-color: ", ";\n background-image: url('/checkboxArrow.svg');\n background-position: center;\n background-repeat: no-repeat;\n border-color: transparent;\n }\n }\n\n .checkmark {\n position: absolute;\n left: 0;\n height: 18px;\n width: 18px;\n background-color: ", ";\n border: 2px solid ", ";\n border-radius: 6px;\n }\n"])), TextGrayColor, AccentColor, WhiteColor, BorderColorLight);
|
|
11
|
-
var CheckboxInput = function (_a) {
|
|
12
|
-
var data = _a.data, label = _a.label, register = _a.register, error = _a.error, className = _a.className, value = _a.value, withInput = _a.withInput, innerTextInputRef = _a.innerTextInputRef;
|
|
13
|
-
var _b = useState(true), textInputDisabled = _b[0], setTextInputDisables = _b[1];
|
|
14
|
-
var renderError = function () {
|
|
15
|
-
if (error === null || error === void 0 ? void 0 : error.isNeedShowError) {
|
|
16
|
-
return <BasicErrorLabel>{error === null || error === void 0 ? void 0 : error.message}</BasicErrorLabel>;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return (<>
|
|
20
|
-
<>
|
|
21
|
-
<BasicCheckbox className={className} status={error === null || error === void 0 ? void 0 : error.isNeedShowError}>
|
|
22
|
-
<input {...register} onChange={function (e) {
|
|
23
|
-
setTextInputDisables(!e.target.checked);
|
|
24
|
-
register.onChange(e);
|
|
25
|
-
}} className="input" type="checkbox" name={data.name} value={value}/>
|
|
26
|
-
<p className="checkmark"/>
|
|
27
|
-
{label}
|
|
28
|
-
{withInput && (<StyledInput status={false} {...innerTextInputRef} disabled={textInputDisabled}/>)}
|
|
29
|
-
</BasicCheckbox>
|
|
30
|
-
</>
|
|
31
|
-
{renderError()}
|
|
32
|
-
</>);
|
|
33
|
-
};
|
|
34
|
-
export default CheckboxInput;
|
|
35
|
-
var templateObject_1;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import 'react-calendar/dist/Calendar.css';
|
|
7
|
-
import ReactDatePicker from 'react-date-picker';
|
|
8
|
-
import 'react-date-picker/dist/DatePicker.css';
|
|
9
|
-
import { Controller } from 'react-hook-form';
|
|
10
|
-
import styled from 'styled-components';
|
|
11
|
-
import { AccentColor, InactiveButtonColor, ProgressColorMedium, TextDarkGrayColor, } from '@ludo.ninja/ui/build/styles/colors';
|
|
12
|
-
import BoxShadow from '@ludo.ninja/ui/build/styles/mixins/boxShadow';
|
|
13
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
14
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
15
|
-
import { BlackColor, BorderColorLight, ProgressColorMinimum, TextGrayColor, WhiteColor, } from '@/styles/colors';
|
|
16
|
-
import { MainText } from '@/styles/typography';
|
|
17
|
-
import { dmsansFontVarCss } from '@/fonts/vars';
|
|
18
|
-
import CalendarIcon from '@/public/calendar.svg';
|
|
19
|
-
import CloseIcon from '@/public/close20.svg';
|
|
20
|
-
import BasicErrorLabel from '../ErrorLabel';
|
|
21
|
-
// Styles
|
|
22
|
-
var StyledReactDatePicker = styled(ReactDatePicker)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n ", ";\n width: 100%;\n height: 46px;\n border-radius: 6px;\n border: 1px solid\n ", ";\n background: ", ";\n color: ", ";\n outline: none;\n padding: 8px 12px;\n\n .react-date-picker__wrapper {\n border: none;\n\n .react-date-picker__inputGroup {\n padding: 0;\n }\n\n .react-date-picker__inputGroup__input:focus-visible {\n outline: none;\n }\n\n .react-date-picker__button {\n padding: 4px;\n border-radius: 50%;\n\n &:hover {\n background: ", ";\n }\n }\n\n .react-date-picker__clear-button {\n svg path {\n stroke: ", ";\n }\n }\n }\n\n .react-calendar {\n padding: 4px;\n width: 280px;\n border-radius: 6px;\n border: 1px solid ", ";\n box-shadow: 0 10px 32px -16px rgba(0, 0, 0, 0.6);\n font-family: ", ";\n\n button {\n border-radius: 30px;\n border: 1px solid white;\n }\n\n .react-calendar__tile--hasActive {\n background: #76baff;\n }\n\n .react-calendar__tile--now {\n ", ";\n background: ", ";\n\n &:hover {\n background: ", ";\n }\n }\n\n .react-calendar__tile--active,\n .react-calendar__tile--hasActive {\n ", ";\n background: ", ";\n color: ", ";\n\n &:hover {\n background: ", ";\n color: ", ";\n }\n }\n\n .react-calendar__year-view .react-calendar__tile,\n .react-calendar__decade-view .react-calendar__tile,\n .react-calendar__century-view .react-calendar__tile {\n padding: 8px 0;\n }\n }\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n :-ms-input-placeholder {\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n color: ", ";\n }\n\n ", " {\n height: ", ";\n border-radius: ", ";\n border: ", " solid\n ", ";\n padding: ", ";\n }\n"], ["\n font-family: ", ";\n ", ";\n width: 100%;\n height: 46px;\n border-radius: 6px;\n border: 1px solid\n ", ";\n background: ", ";\n color: ", ";\n outline: none;\n padding: 8px 12px;\n\n .react-date-picker__wrapper {\n border: none;\n\n .react-date-picker__inputGroup {\n padding: 0;\n }\n\n .react-date-picker__inputGroup__input:focus-visible {\n outline: none;\n }\n\n .react-date-picker__button {\n padding: 4px;\n border-radius: 50%;\n\n &:hover {\n background: ", ";\n }\n }\n\n .react-date-picker__clear-button {\n svg path {\n stroke: ", ";\n }\n }\n }\n\n .react-calendar {\n padding: 4px;\n width: 280px;\n border-radius: 6px;\n border: 1px solid ", ";\n box-shadow: 0 10px 32px -16px rgba(0, 0, 0, 0.6);\n font-family: ", ";\n\n button {\n border-radius: 30px;\n border: 1px solid white;\n }\n\n .react-calendar__tile--hasActive {\n background: #76baff;\n }\n\n .react-calendar__tile--now {\n ", ";\n background: ", ";\n\n &:hover {\n background: ", ";\n }\n }\n\n .react-calendar__tile--active,\n .react-calendar__tile--hasActive {\n ", ";\n background: ", ";\n color: ", ";\n\n &:hover {\n background: ", ";\n color: ", ";\n }\n }\n\n .react-calendar__year-view .react-calendar__tile,\n .react-calendar__decade-view .react-calendar__tile,\n .react-calendar__century-view .react-calendar__tile {\n padding: 8px 0;\n }\n }\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n :-ms-input-placeholder {\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n color: ", ";\n }\n\n ", " {\n height: ", ";\n border-radius: ", ";\n border: ", " solid\n ", ";\n padding: ", ";\n }\n"])), dmsansFontVarCss.css, MainText, function (props) { return (props.status ? ProgressColorMinimum : BorderColorLight); }, WhiteColor, BlackColor, InactiveButtonColor, TextDarkGrayColor, BorderColorLight, dmsansFontVarCss.css, BoxShadow, ProgressColorMedium, ProgressColorMedium, BoxShadow, AccentColor, WhiteColor, AccentColor, WhiteColor, TextGrayColor, TextGrayColor, TextGrayColor, mediaQuery.minWidthFourK, adaptiveValueCalc(46), adaptiveValueCalc(6), adaptiveValueCalc(1), function (props) { return (props.status ? ProgressColorMinimum : BorderColorLight); }, adaptiveValueCalc(12));
|
|
23
|
-
var DatePicker = function (_a) {
|
|
24
|
-
var name = _a.name, control = _a.control, error = _a.error;
|
|
25
|
-
var renderError = function () {
|
|
26
|
-
if (error.isNeedShowError) {
|
|
27
|
-
return <BasicErrorLabel>{error.message}</BasicErrorLabel>;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return (<Controller name={name} control={control} render={function (_a) {
|
|
31
|
-
var field = _a.field;
|
|
32
|
-
return (<>
|
|
33
|
-
<StyledReactDatePicker onChange={field.onChange} onBlur={field.onBlur} value={field.value} disableCalendar={field.disabled} name={field.name} status={error.isNeedShowError} dayPlaceholder={'dd'} monthPlaceholder={'mm'} yearPlaceholder={'yy'} format={'dd.MM.yyyy'} locale={'en'} clearIcon={field.value ? <CloseIcon /> : null} calendarIcon={<CalendarIcon />}/>
|
|
34
|
-
{renderError()}
|
|
35
|
-
</>);
|
|
36
|
-
}}/>);
|
|
37
|
-
};
|
|
38
|
-
export default DatePicker;
|
|
39
|
-
var templateObject_1;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '@testing-library/jest-dom';
|
|
3
|
-
import { render, screen } from '@testing-library/react';
|
|
4
|
-
import ErrorLabel from '@/system/Forms/ErrorLabel';
|
|
5
|
-
describe('ErrorLabel Component', function () {
|
|
6
|
-
test('renders correctly with given children and id', function () {
|
|
7
|
-
React.act(function () {
|
|
8
|
-
render(<ErrorLabel id="test-id">Test Label</ErrorLabel>);
|
|
9
|
-
});
|
|
10
|
-
var labelElement = screen.getByText('Test Label');
|
|
11
|
-
expect(labelElement).toBeInTheDocument();
|
|
12
|
-
expect(labelElement).toHaveAttribute('for', 'test-id');
|
|
13
|
-
});
|
|
14
|
-
test('renders correctly without id', function () {
|
|
15
|
-
React.act(function () {
|
|
16
|
-
render(<ErrorLabel>Test Label Without ID</ErrorLabel>);
|
|
17
|
-
});
|
|
18
|
-
var labelElement = screen.getByText('Test Label Without ID');
|
|
19
|
-
expect(labelElement).toBeInTheDocument();
|
|
20
|
-
expect(labelElement).not.toHaveAttribute('for');
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
8
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
9
|
-
var StyledLabel = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n user-select: none;\n padding-top: 8px;\n color: #f4205f;\n font-size: 13px;\n font-weight: 400;\n\n ", " {\n padding-top: ", ";\n font-size: ", ";\n }\n"], ["\n user-select: none;\n padding-top: 8px;\n color: #f4205f;\n font-size: 13px;\n font-weight: 400;\n\n ", " {\n padding-top: ", ";\n font-size: ", ";\n }\n"])), mediaQuery.minWidthFourK, adaptiveValueCalc(8), adaptiveValueCalc(13));
|
|
10
|
-
var BasicErrorLabel = function (_a) {
|
|
11
|
-
var children = _a.children, id = _a.id;
|
|
12
|
-
return <StyledLabel htmlFor={id}>{children}</StyledLabel>;
|
|
13
|
-
};
|
|
14
|
-
export default BasicErrorLabel;
|
|
15
|
-
var templateObject_1;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { DisabledGrayColor, DisabledLightGrayColor, } from '@ludo.ninja/ui/build/styles/colors';
|
|
8
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
9
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
10
|
-
import { BlackColor, BorderColorLight, ProgressColorMinimum, TextGrayColor, WhiteColor, } from '@/styles/colors';
|
|
11
|
-
import { MainText } from '@/styles/typography';
|
|
12
|
-
import BasicErrorLabel from '@/system/Forms/ErrorLabel';
|
|
13
|
-
import { dmsansFontVarCss } from '@/fonts/vars';
|
|
14
|
-
// Styles
|
|
15
|
-
export var StyledInput = styled.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n ", ";\n width: 100%;\n height: 46px;\n border-radius: 6px;\n border: 1px solid\n ", ";\n background: ", ";\n color: ", ";\n outline: none;\n padding: 12px;\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n :-ms-input-placeholder {\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n color: ", ";\n }\n\n :disabled {\n background: ", ";\n color: ", ";\n }\n\n // :focus {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n // :hover {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n ", " {\n height: ", ";\n border-radius: ", ";\n border: ", " solid\n ", ";\n padding: ", ";\n }\n"], ["\n font-family: ", ";\n ", ";\n width: 100%;\n height: 46px;\n border-radius: 6px;\n border: 1px solid\n ", ";\n background: ", ";\n color: ", ";\n outline: none;\n padding: 12px;\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n :-ms-input-placeholder {\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n color: ", ";\n }\n\n :disabled {\n background: ", ";\n color: ", ";\n }\n\n // :focus {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n // :hover {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n ", " {\n height: ", ";\n border-radius: ", ";\n border: ", " solid\n ", ";\n padding: ", ";\n }\n"])), dmsansFontVarCss.css, MainText, function (props) { return (props.status ? ProgressColorMinimum : BorderColorLight); }, WhiteColor, BlackColor, TextGrayColor, TextGrayColor, TextGrayColor, DisabledLightGrayColor, DisabledGrayColor, function (props) { return (props.status ? '#F4205F' : '#C1C8DE'); }, function (props) { return (props.status ? '#F4205F' : '#C1C8DE'); }, mediaQuery.minWidthFourK, adaptiveValueCalc(46), adaptiveValueCalc(6), adaptiveValueCalc(1), function (props) { return (props.status ? ProgressColorMinimum : BorderColorLight); }, adaptiveValueCalc(12));
|
|
16
|
-
var Input = function (_a) {
|
|
17
|
-
var data = _a.data, register = _a.register, error = _a.error;
|
|
18
|
-
var renderError = function () {
|
|
19
|
-
if (error.isNeedShowError) {
|
|
20
|
-
return <BasicErrorLabel>{error.message}</BasicErrorLabel>;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
return (<>
|
|
24
|
-
<StyledInput {...register} status={error.isNeedShowError} id={data.name} name={data.name} autoComplete={'off'} placeholder={data.placeHolder}/>
|
|
25
|
-
{renderError()}
|
|
26
|
-
</>);
|
|
27
|
-
};
|
|
28
|
-
export default Input;
|
|
29
|
-
var templateObject_1;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { BorderColorLight } from '@ludo.ninja/ui/build/styles/colors';
|
|
8
|
-
import { AccentColor, BlackColor, WhiteColor } from '@/styles/colors';
|
|
9
|
-
import { StyledInput } from '@/system/Forms/Input';
|
|
10
|
-
var StyledLabel = styled.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n padding: 8px 0 8px 27px;\n cursor: pointer;\n font-size: 1.4em;\n color: ", ";\n font-weight: 500;\n user-select: none;\n\n display: flex;\n align-items: center;\n gap: 10px;\n\n input[type='radio'] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n\n .checkmark {\n position: absolute;\n left: 0;\n height: 18px;\n width: 18px;\n background-color: ", ";\n border-radius: 50%;\n transition: background-color 200ms;\n }\n\n .checkmark:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: ", ";\n transition: width 200ms, height 200ms;\n }\n\n input:checked ~ .checkmark,\n .checked {\n background-color: ", ";\n }\n\n input:checked ~ .checkmark:after,\n .checked:after {\n width: 8px;\n height: 8px;\n }\n"], ["\n position: relative;\n padding: 8px 0 8px 27px;\n cursor: pointer;\n font-size: 1.4em;\n color: ", ";\n font-weight: 500;\n user-select: none;\n\n display: flex;\n align-items: center;\n gap: 10px;\n\n input[type='radio'] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n\n .checkmark {\n position: absolute;\n left: 0;\n height: 18px;\n width: 18px;\n background-color: ", ";\n border-radius: 50%;\n transition: background-color 200ms;\n }\n\n .checkmark:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background: ", ";\n transition: width 200ms, height 200ms;\n }\n\n input:checked ~ .checkmark,\n .checked {\n background-color: ", ";\n }\n\n input:checked ~ .checkmark:after,\n .checked:after {\n width: 8px;\n height: 8px;\n }\n"])), BlackColor, BorderColorLight, WhiteColor, AccentColor);
|
|
11
|
-
var BasicRadioInput = function (_a) {
|
|
12
|
-
var radioLabel = _a.radioLabel, radioValue = _a.radioValue, radioChecked = _a.radioChecked, handleChange = _a.handleChange, className = _a.className, withInput = _a.withInput, innerTextInputRef = _a.innerTextInputRef, setFocus = _a.setFocus;
|
|
13
|
-
var handleChangeRadioInput = function (e) {
|
|
14
|
-
if (withInput) {
|
|
15
|
-
setTimeout(function () { return setFocus && innerTextInputRef && setFocus(innerTextInputRef.name); }, 0);
|
|
16
|
-
}
|
|
17
|
-
handleChange(e.target.value);
|
|
18
|
-
};
|
|
19
|
-
return (<StyledLabel className={className}>
|
|
20
|
-
{radioLabel}
|
|
21
|
-
<input type="radio" checked={radioChecked} value={radioValue} id={"".concat(radioValue, "_").concat(radioLabel)} onChange={function (e) { return handleChangeRadioInput(e); }}/>
|
|
22
|
-
{withInput && (<StyledInput status={false} {...innerTextInputRef} disabled={!radioChecked}/>)}
|
|
23
|
-
<span className={"checkmark"}></span>
|
|
24
|
-
</StyledLabel>);
|
|
25
|
-
};
|
|
26
|
-
export default BasicRadioInput;
|
|
27
|
-
var templateObject_1;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
|
-
function step(op) {
|
|
19
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
20
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
21
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
22
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23
|
-
switch (op[0]) {
|
|
24
|
-
case 0: case 1: t = op; break;
|
|
25
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
26
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
27
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
28
|
-
default:
|
|
29
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
30
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
31
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
32
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33
|
-
if (t[2]) _.ops.pop();
|
|
34
|
-
_.trys.pop(); continue;
|
|
35
|
-
}
|
|
36
|
-
op = body.call(thisArg, _);
|
|
37
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
38
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
42
|
-
var t = {};
|
|
43
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
44
|
-
t[p] = s[p];
|
|
45
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
46
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
47
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
48
|
-
t[p[i]] = s[p[i]];
|
|
49
|
-
}
|
|
50
|
-
return t;
|
|
51
|
-
};
|
|
52
|
-
import React, { useEffect, useState } from 'react';
|
|
53
|
-
import Skeleton from 'react-loading-skeleton';
|
|
54
|
-
import Select, { components, } from 'react-select';
|
|
55
|
-
import styled from 'styled-components';
|
|
56
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
57
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
58
|
-
import { BlackColor, TextGrayColor, WhiteColor } from '@/styles/colors';
|
|
59
|
-
import { MainText } from '@/styles/typography';
|
|
60
|
-
import { getAdaptiveScale } from '@/utils/adaptive/scale';
|
|
61
|
-
import { useWindowDimensionsWithServerInitial } from '@/utils/screen';
|
|
62
|
-
import { dmsansFontVarCss } from '@/fonts/vars';
|
|
63
|
-
import ArrowDownIcon from '@/public/selects/arrow_down.svg';
|
|
64
|
-
var SelectElement = styled(Select)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n\n .react-select__value-container {\n padding: 0 0 0 20px;\n }\n\n .react-select__control {\n border: none;\n background-color: white;\n border-radius: 6px;\n box-shadow: none;\n min-height: ", ";\n cursor: pointer;\n\n &:hover,\n &:focus,\n &:active {\n box-shadow: none;\n border-color: transparent;\n }\n }\n\n .react-select__indicator {\n padding: 0;\n }\n\n .react-select__indicators {\n padding-right: 12px;\n }\n\n .react-select__menu {\n ", ";\n color: ", ";\n margin: 4px 0;\n background: ", ";\n box-shadow: 0 8px 16px -16px rgba(33, 21, 95, 0.1);\n border-radius: 6px;\n z-index: 9999;\n }\n\n .react-select__single-value {\n ", ";\n margin: 0;\n color: ", ";\n }\n\n .react-select__menu-list {\n padding: 8px 0;\n }\n\n .react-select__option {\n padding: 8.5px 20px;\n font-weight: 400;\n }\n\n .react-select__option--is-selected {\n background-color: transparent;\n color: ", ";\n font-weight: 500;\n }\n\n .react-select__option--is-focused {\n background-color: transparent;\n color: ", ";\n font-weight: 500;\n transition: font-weight 0.3s ease-in-out;\n cursor: pointer;\n }\n\n ", " {\n .react-select__value-container {\n padding: 0 0 0 ", ";\n }\n\n .react-select__control {\n border-radius: ", ";\n min-height: ", ";\n }\n\n .react-select__indicator {\n transform: ", ";\n }\n\n .react-select__indicators {\n padding-right: ", ";\n }\n\n .react-select__menu {\n margin: ", " 0;\n box-shadow: 0 ", " ", "\n ", " rgba(33, 21, 95, 0.1);\n border-radius: ", ";\n }\n\n .react-select__menu-list {\n padding: ", " 0;\n max-height: ", ";\n }\n\n .react-select__option {\n padding: ", " ", ";\n }\n }\n"], ["\n font-family: ", ";\n\n .react-select__value-container {\n padding: 0 0 0 20px;\n }\n\n .react-select__control {\n border: none;\n background-color: white;\n border-radius: 6px;\n box-shadow: none;\n min-height: ", ";\n cursor: pointer;\n\n &:hover,\n &:focus,\n &:active {\n box-shadow: none;\n border-color: transparent;\n }\n }\n\n .react-select__indicator {\n padding: 0;\n }\n\n .react-select__indicators {\n padding-right: 12px;\n }\n\n .react-select__menu {\n ", ";\n color: ", ";\n margin: 4px 0;\n background: ", ";\n box-shadow: 0 8px 16px -16px rgba(33, 21, 95, 0.1);\n border-radius: 6px;\n z-index: 9999;\n }\n\n .react-select__single-value {\n ", ";\n margin: 0;\n color: ", ";\n }\n\n .react-select__menu-list {\n padding: 8px 0;\n }\n\n .react-select__option {\n padding: 8.5px 20px;\n font-weight: 400;\n }\n\n .react-select__option--is-selected {\n background-color: transparent;\n color: ", ";\n font-weight: 500;\n }\n\n .react-select__option--is-focused {\n background-color: transparent;\n color: ", ";\n font-weight: 500;\n transition: font-weight 0.3s ease-in-out;\n cursor: pointer;\n }\n\n ", " {\n .react-select__value-container {\n padding: 0 0 0 ", ";\n }\n\n .react-select__control {\n border-radius: ", ";\n min-height: ", ";\n }\n\n .react-select__indicator {\n transform: ", ";\n }\n\n .react-select__indicators {\n padding-right: ", ";\n }\n\n .react-select__menu {\n margin: ", " 0;\n box-shadow: 0 ", " ", "\n ", " rgba(33, 21, 95, 0.1);\n border-radius: ", ";\n }\n\n .react-select__menu-list {\n padding: ", " 0;\n max-height: ", ";\n }\n\n .react-select__option {\n padding: ", " ", ";\n }\n }\n"])), dmsansFontVarCss.css, function (props) { return "".concat(props.minHeight, "px"); }, MainText, TextGrayColor, WhiteColor, MainText, BlackColor, BlackColor, BlackColor, mediaQuery.minWidthFourK, adaptiveValueCalc(20), adaptiveValueCalc(6), function (props) { return adaptiveValueCalc(props.minHeight); }, function (props) {
|
|
65
|
-
return 'transform' in props.scale && props.scale.transform;
|
|
66
|
-
}, adaptiveValueCalc(12), adaptiveValueCalc(4), adaptiveValueCalc(8), adaptiveValueCalc(16), adaptiveValueCalc(-16), adaptiveValueCalc(6), adaptiveValueCalc(8), adaptiveValueCalc(300), adaptiveValueCalc(8.5), adaptiveValueCalc(20));
|
|
67
|
-
var minHeight = 40;
|
|
68
|
-
var DropdownIndicator = function (props) {
|
|
69
|
-
return (<components.DropdownIndicator {...props}>
|
|
70
|
-
<ArrowDownIcon style={{
|
|
71
|
-
transition: 'transform 200ms',
|
|
72
|
-
transform: props.selectProps.menuIsOpen
|
|
73
|
-
? 'rotate(180deg)'
|
|
74
|
-
: 'rotate(0)',
|
|
75
|
-
}}/>
|
|
76
|
-
</components.DropdownIndicator>);
|
|
77
|
-
};
|
|
78
|
-
var DesktopSelect = function (_a) {
|
|
79
|
-
var options = _a.options, isLoading = _a.isLoading, onChangeHandler = _a.onChangeHandler, defaultOptionValue = _a.defaultOptionValue, name = _a.name, props = __rest(_a, ["options", "isLoading", "onChangeHandler", "defaultOptionValue", "name"]);
|
|
80
|
-
var _b = useState(options.find(function (option) {
|
|
81
|
-
return defaultOptionValue === option.id;
|
|
82
|
-
}) || options[0]), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
83
|
-
useEffect(function () {
|
|
84
|
-
var findOption = options.find(function (option) {
|
|
85
|
-
return defaultOptionValue === option.id;
|
|
86
|
-
});
|
|
87
|
-
setSelectedOption(findOption || options[0]);
|
|
88
|
-
}, [defaultOptionValue]);
|
|
89
|
-
var handleChangeOption = function (option) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
-
return __generator(this, function (_a) {
|
|
91
|
-
switch (_a.label) {
|
|
92
|
-
case 0: return [4 /*yield*/, onChangeHandler(name, option.id)];
|
|
93
|
-
case 1:
|
|
94
|
-
_a.sent();
|
|
95
|
-
setSelectedOption(option);
|
|
96
|
-
return [2 /*return*/];
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}); };
|
|
100
|
-
var getOptionLabel = function (option) {
|
|
101
|
-
return option.label;
|
|
102
|
-
};
|
|
103
|
-
var getOptionValue = function (option) {
|
|
104
|
-
return option.id;
|
|
105
|
-
};
|
|
106
|
-
var windowDimensions = useWindowDimensionsWithServerInitial().windowDimensions;
|
|
107
|
-
if (isLoading)
|
|
108
|
-
return <Skeleton height={"".concat(minHeight, "px")} width="154px"/>;
|
|
109
|
-
return (<SelectElement id={String(Math.random())} minHeight={minHeight} scale={getAdaptiveScale({ windowDimensions: windowDimensions, currentSize: 1 })} classNamePrefix="react-select" name={name} getOptionLabel={function (option) { return getOptionLabel(option); }} getOptionValue={function (option) { return getOptionValue(option); }} options={options} value={selectedOption} defaultValue={selectedOption} onChange={function (option) { return handleChangeOption(option); }} isSearchable={false} components={{
|
|
110
|
-
DropdownIndicator: DropdownIndicator,
|
|
111
|
-
IndicatorSeparator: function () { return null; },
|
|
112
|
-
}} {...props}/>);
|
|
113
|
-
};
|
|
114
|
-
export default DesktopSelect;
|
|
115
|
-
var templateObject_1;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { useRouter } from 'next/router';
|
|
3
|
-
import DropDown from '@/system/DropDown';
|
|
4
|
-
import BasicRadioInput from '@/system/Forms/RadioInput';
|
|
5
|
-
// Component
|
|
6
|
-
var MobileSelect = function (_a) {
|
|
7
|
-
var options = _a.options, onChangeHandler = _a.onChangeHandler, name = _a.name, defaultOptionValue = _a.defaultOptionValue;
|
|
8
|
-
var _b = useState(options[0]), selectedOption = _b[0], setSelectedOption = _b[1];
|
|
9
|
-
var router = useRouter();
|
|
10
|
-
useEffect(function () {
|
|
11
|
-
var findOption = options.find(function (option) {
|
|
12
|
-
return defaultOptionValue === option.id;
|
|
13
|
-
});
|
|
14
|
-
setSelectedOption(findOption || options[0]);
|
|
15
|
-
}, [defaultOptionValue]);
|
|
16
|
-
var handleChangeOption = function (value) {
|
|
17
|
-
var _a;
|
|
18
|
-
var findOption = options.find(function (option) {
|
|
19
|
-
return value === option.id;
|
|
20
|
-
});
|
|
21
|
-
setSelectedOption(findOption || options[0]);
|
|
22
|
-
onChangeHandler(name, (findOption === null || findOption === void 0 ? void 0 : findOption.id) || ((_a = options[0]) === null || _a === void 0 ? void 0 : _a.id));
|
|
23
|
-
};
|
|
24
|
-
return (<DropDown caption={name} fallBackOnClose={function () { return null; }} active={Boolean(router.query[name])}>
|
|
25
|
-
{options.map(function (select) { return (<BasicRadioInput key={"".concat(select.id, "_").concat(select.label)} radioLabel={select.label} radioValue={select.id} handleChange={handleChangeOption} radioChecked={selectedOption.id === select.id}/>); })}
|
|
26
|
-
</DropDown>);
|
|
27
|
-
};
|
|
28
|
-
// Export
|
|
29
|
-
export default MobileSelect;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
8
|
-
import { mediaQuery } from '@/styles/ScreenWidth';
|
|
9
|
-
import { BlackColor, BorderColorLight, ProgressColorMinimum, TextGrayColor, WhiteColor, } from '@/styles/colors';
|
|
10
|
-
import { MainText } from '@/styles/typography';
|
|
11
|
-
import { dmsansFontVarCss } from '@/fonts/vars';
|
|
12
|
-
import BasicErrorLabel from '../ErrorLabel';
|
|
13
|
-
// Styles
|
|
14
|
-
var StyledTextArea = styled.textarea(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n ", ";\n width: 100%;\n min-height: 92px;\n border-radius: 6px;\n border: 1px solid\n ", ";\n background: ", ";\n color: ", ";\n outline: none;\n resize: none;\n padding: 12px;\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n :-ms-input-placeholder {\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n color: ", ";\n }\n\n // :focus {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n // :hover {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n\n ", " {\n min-height: ", ";\n border-radius: ", ";\n border: ", " solid\n ", ";\n padding: ", ";\n }\n"], ["\n font-family: ", ";\n ", ";\n width: 100%;\n min-height: 92px;\n border-radius: 6px;\n border: 1px solid\n ", ";\n background: ", ";\n color: ", ";\n outline: none;\n resize: none;\n padding: 12px;\n\n ::placeholder {\n color: ", ";\n opacity: 1;\n }\n\n :-ms-input-placeholder {\n color: ", ";\n }\n\n ::-ms-input-placeholder {\n color: ", ";\n }\n\n // :focus {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n // :hover {\n // transition: border-color 0.3s ease-in-out;\n // border: 2px solid ", ";\n // }\n\n ", " {\n min-height: ", ";\n border-radius: ", ";\n border: ", " solid\n ", ";\n padding: ", ";\n }\n"])), dmsansFontVarCss.css, MainText, function (props) { return (props.status ? ProgressColorMinimum : BorderColorLight); }, WhiteColor, BlackColor, TextGrayColor, TextGrayColor, TextGrayColor, function (props) { return (props.status ? '#F4205F' : '#C1C8DE'); }, function (props) { return (props.status ? '#F4205F' : '#C1C8DE'); }, mediaQuery.minWidthFourK, adaptiveValueCalc(92), adaptiveValueCalc(6), adaptiveValueCalc(1), function (props) { return (props.status ? ProgressColorMinimum : BorderColorLight); }, adaptiveValueCalc(12));
|
|
15
|
-
// const maxCountLength = 400;
|
|
16
|
-
var BasicTextArea = function (_a) {
|
|
17
|
-
var data = _a.data, register = _a.register, isNeedBiggerArea = _a.isNeedBiggerArea, error = _a.error;
|
|
18
|
-
var renderError = function () {
|
|
19
|
-
if (error.isNeedShowError) {
|
|
20
|
-
return <BasicErrorLabel>{error.message}</BasicErrorLabel>;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
return (<>
|
|
24
|
-
<StyledTextArea {...register} rows={isNeedBiggerArea ? 8 : 4} status={error.isNeedShowError} id={data.name} name={data.name} autoComplete={'off'} placeholder={data.placeHolder}/>
|
|
25
|
-
{renderError()}
|
|
26
|
-
</>);
|
|
27
|
-
};
|
|
28
|
-
export default BasicTextArea;
|
|
29
|
-
var templateObject_1;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React, { forwardRef } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { border, layout, space, } from 'styled-system';
|
|
8
|
-
var StyledImage = styled.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: block;\n max-width: 100%;\n height: ", ";\n ", "\n ", "\n ", "\n"], ["\n display: block;\n max-width: 100%;\n height: ", ";\n ", "\n ", "\n ", "\n"])), function (props) { return (props.height ? props.height : 'auto'); }, space, layout, border);
|
|
9
|
-
export var ExternalImage = forwardRef(function (props, ref) {
|
|
10
|
-
return <StyledImage ref={ref} {...props}/>;
|
|
11
|
-
});
|
|
12
|
-
ExternalImage.displayName = 'ExternalImage';
|
|
13
|
-
var templateObject_1;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import { ImageInterceptor } from '../ImageInterceptor';
|
|
9
|
-
jest.mock('react-loading-skeleton', function () {
|
|
10
|
-
return function TestSkeleton(props) {
|
|
11
|
-
return (<div data-testid="skeleton" style={{
|
|
12
|
-
borderRadius: props.borderRadius,
|
|
13
|
-
}}/>);
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
var TestImage = styled.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100px;\n height: 100px;\n"], ["\n width: 100px;\n height: 100px;\n"])));
|
|
17
|
-
var validSrc = '/tests/test_1.svg';
|
|
18
|
-
describe('ImageInterceptor Component', function () {
|
|
19
|
-
test('renders the skeleton while the image is loading', function () {
|
|
20
|
-
render(<ImageInterceptor>
|
|
21
|
-
<TestImage src={validSrc}/>
|
|
22
|
-
</ImageInterceptor>);
|
|
23
|
-
expect(screen.getByTestId('skeleton')).toBeInTheDocument();
|
|
24
|
-
});
|
|
25
|
-
test('renders the image after it has loaded', function () {
|
|
26
|
-
render(<ImageInterceptor>
|
|
27
|
-
<TestImage src={validSrc}/>
|
|
28
|
-
</ImageInterceptor>);
|
|
29
|
-
var image = screen.getByRole('img');
|
|
30
|
-
fireEvent.load(image);
|
|
31
|
-
expect(screen.queryByTestId('skeleton')).not.toBeInTheDocument();
|
|
32
|
-
expect(image).toHaveAttribute('src', validSrc);
|
|
33
|
-
});
|
|
34
|
-
test('renders the fallback image if an error occurs', function () {
|
|
35
|
-
render(<ImageInterceptor>
|
|
36
|
-
<TestImage src="invalid-image.jpg"/>
|
|
37
|
-
</ImageInterceptor>);
|
|
38
|
-
var image = screen.getByRole('img');
|
|
39
|
-
fireEvent.error(image);
|
|
40
|
-
expect(screen.queryByTestId('skeleton')).not.toBeInTheDocument();
|
|
41
|
-
expect(image).toHaveAttribute('src', '/noContent/noContent.svg');
|
|
42
|
-
});
|
|
43
|
-
test('applies the correct styles to the skeleton', function () {
|
|
44
|
-
render(<ImageInterceptor borderRadiusSkeleton={10}>
|
|
45
|
-
<TestImage src={validSrc}/>
|
|
46
|
-
</ImageInterceptor>);
|
|
47
|
-
expect(screen.getByTestId('skeleton')).toHaveStyle({
|
|
48
|
-
borderRadius: '10px',
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
var templateObject_1;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
import Skeleton from 'react-loading-skeleton';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
var SImage = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n & *:not(img) {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 10;\n width: 100%;\n height: 100%;\n }\n"], ["\n position: relative;\n\n & *:not(img) {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 10;\n width: 100%;\n height: 100%;\n }\n"])));
|
|
9
|
-
export var ImageInterceptor = function (_a) {
|
|
10
|
-
var children = _a.children, _b = _a.fallback, fallback = _b === void 0 ? '/noContent/noContent.svg' : _b, _c = _a.isShowSkeleton, isShowSkeleton = _c === void 0 ? true : _c, borderRadiusSkeleton = _a.borderRadiusSkeleton, className = _a.className;
|
|
11
|
-
var _d = useState(children.props.src !== fallback), isLoading = _d[0], setIsLoading = _d[1];
|
|
12
|
-
var _e = useState(false), isError = _e[0], setIsError = _e[1];
|
|
13
|
-
return (<SImage className={className}>
|
|
14
|
-
{React.cloneElement(children, {
|
|
15
|
-
src: isError ? fallback : children.props.src,
|
|
16
|
-
onLoad: function () {
|
|
17
|
-
setIsLoading(false);
|
|
18
|
-
},
|
|
19
|
-
onError: function () {
|
|
20
|
-
setIsError(true);
|
|
21
|
-
setIsLoading(false);
|
|
22
|
-
},
|
|
23
|
-
})}
|
|
24
|
-
{isShowSkeleton && isLoading && (<Skeleton className={'skeleton'} width={children.props.width || '100%'} height={children.props.height || '100%'} borderRadius={borderRadiusSkeleton || children.props.borderRadius || 2}/>)}
|
|
25
|
-
</SImage>);
|
|
26
|
-
};
|
|
27
|
-
var templateObject_1;
|