@ludo.ninja/components 2.0.9 → 2.0.11
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/build/api/graphql/index.js +3 -7
- package/build/api/server-assets/mutations/useDislikeAsset/index.js +7 -9
- package/build/api/server-assets/mutations/useLikeAsset/index.js +7 -9
- package/build/api/server-assets/queries/useFetchAssetByBlockchain/index.js +14 -21
- package/build/api/server-assets/queries/useFetchAssets/index.js +11 -14
- package/build/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +13 -15
- package/build/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +11 -13
- package/build/api/server-collection/mutations/useDislikeCollection/index.js +7 -9
- package/build/api/server-collection/mutations/useLikeCollection/index.js +7 -9
- package/build/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +19 -21
- package/build/api/server-experiences/queries/useFetchMyTasks/index.js +15 -20
- package/build/api/server-galleries/mutations/useAddAssetsToGallery/index.js +9 -12
- package/build/api/server-galleries/mutations/useAddChangeGalleryBanner/index.js +9 -13
- package/build/api/server-galleries/mutations/useAddCollectionsToGallery/index.js +9 -12
- package/build/api/server-galleries/mutations/useAddCreationsToGallery/index.js +13 -16
- package/build/api/server-galleries/mutations/useCreateFavorites/index.js +5 -8
- package/build/api/server-galleries/mutations/useCreateGallery/index.js +5 -8
- package/build/api/server-galleries/mutations/useDeleteGallery/index.js +10 -12
- package/build/api/server-galleries/mutations/useDeleteGalleryBanner/index.js +9 -13
- package/build/api/server-galleries/mutations/useEditGallery/index.js +5 -7
- package/build/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +13 -16
- package/build/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.js +12 -15
- package/build/api/server-galleries/queries/useFetchGallery/index.js +11 -18
- package/build/api/server-galleries/queries/useFetchGalleryAssets/index.js +9 -12
- package/build/api/server-galleries/queries/useFetchMyFavorites/index.js +11 -17
- package/build/api/server-galleries/queries/useFetchMyGalleries/index.js +13 -19
- package/build/api/server-galleries/queries/useFetchSubscribedGalleries/index.js +9 -11
- package/build/api/server-galleries/queries/useFetchUserFavorites/index.js +10 -16
- package/build/api/server-identities/mutations/useAddWalletElrond/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletFlow/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletMetamask/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletSolana/index.js +10 -12
- package/build/api/server-identities/mutations/useAddWalletTezos/index.js +10 -12
- package/build/api/server-identities/mutations/useFollowProfile/index.js +13 -15
- package/build/api/server-identities/mutations/useGenerateNewInviteCodes/index.js +7 -9
- package/build/api/server-identities/mutations/useInviteCode/index.js +9 -11
- package/build/api/server-identities/mutations/useRemoveWallet/index.js +10 -12
- package/build/api/server-identities/mutations/useRevokeToken/index.js +5 -7
- package/build/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +9 -11
- package/build/api/server-identities/mutations/useUnfollowProfile/index.js +13 -15
- package/build/api/server-identities/queries/useFetchProfile/index.js +19 -23
- package/build/api/server-identities/queries/useFetchUserWallets/index.js +4 -6
- package/build/api/server-medias/mutations/useDeleteUserpic/index.js +7 -9
- package/build/api/server-medias/mutations/useUploadUserpic/index.js +7 -9
- package/build/api/server-medias/queries/useFetchUserPic/index.js +8 -10
- package/build/api/server-opportunities/mutations/useDislikeOpportunity.js +8 -12
- package/build/api/server-opportunities/mutations/useLikeOpportunity.js +8 -12
- package/build/api/server-opportunities/mutations/useOpenOpportunity/index.js +8 -10
- package/build/api/server-opportunities/queries/useGetOpportunities.js +9 -13
- package/build/api/server-preferences/queries/fetchSearchResultSelections/index.js +6 -11
- package/build/api/server-preferences/queries/fetchSearchResultSelections/queryData.js +9 -13
- package/build/api/server-search/queries/useFetchAllCreations/index.js +15 -23
- package/build/api/server-search/queries/useFetchAssetsCount/index.js +2 -4
- package/build/api/server-search/queries/useFetchCollection/index.js +16 -23
- package/build/api/server-search/queries/useFetchCollections/index.js +16 -23
- package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +18 -24
- package/build/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.js +16 -24
- package/build/api/server-search/queries/useFetchNetWorth/index.js +7 -9
- package/build/api/server-search/queries/useFindCreations/index.js +20 -28
- package/build/api/server-search/queries/useFindProfilesByName/index.js +14 -19
- package/build/api/server-search/queries/useFindShowcaseItems/index.js +1 -3
- package/build/api/server-search/queries/useFindUserCreations/index.js +16 -21
- package/build/api/server-search/queries/useFindUserShowcaseItems/index.js +1 -3
- package/build/api/subscriptions/SubscriberInviteNotification.js +18 -22
- package/build/components/assetPage/assetLikes/index.js +25 -30
- package/build/components/assetPage/assetNft/index.js +14 -21
- package/build/components/assetPage/audioVideoPlayer/Duration.js +5 -8
- package/build/components/assetPage/audioVideoPlayer/index.js +51 -81
- package/build/components/assetPage/category/index.js +18 -25
- package/build/components/assetPage/description/index.js +17 -24
- package/build/components/assetPage/index.js +11 -25
- package/build/components/assetPage/information/index.js +43 -50
- package/build/components/assetPage/marketPlaces/index.js +26 -33
- package/build/components/assetPage/media/AssetImage/index.js +52 -80
- package/build/components/assetPage/moreDropDown/index.js +47 -77
- package/build/components/assetPage/participants/index.js +64 -71
- package/build/components/assetPage/priceRank/index.js +38 -45
- package/build/components/assetPage/properties/index.js +19 -26
- package/build/components/assetPage/slider/index.js +44 -51
- package/build/components/assetPage/slider/slideItem.js +14 -21
- package/build/components/assetPage/slider/store.js +2 -5
- package/build/components/assetPage/tittle/index.js +32 -39
- package/build/components/assetPage/viewer3D/index.js +50 -58
- package/build/components/base/Meta/index.js +6 -11
- package/build/components/base/NoSSR/index.js +4 -9
- package/build/components/favoriteList/add/addCreationToFavoriteList/index.js +14 -19
- package/build/components/gallery/add/addCreationToGallery/index.js +20 -25
- package/build/components/headers/components/headerExperienceLabel/index.js +12 -17
- package/build/components/headers/components/headerUserPic/index.js +11 -16
- package/build/components/headers/header/index.js +17 -22
- package/build/components/headers/headerSearch/index.js +21 -26
- package/build/components/headers/headerSimple/index.js +14 -19
- package/build/components/linkTabs/index.js +14 -19
- package/build/components/linkTabs/linkTab/index.js +22 -27
- package/build/components/profile/profileSkeleton/index.js +10 -18
- package/build/components/search/SearchInputContainer.js +61 -91
- package/build/components/search/searchCloseMoreButtons/index.js +20 -25
- package/build/components/search/searchSimpleInput/index.js +37 -65
- package/build/components/search/searchSuggestions/index.js +32 -37
- package/build/components/search/searchSuggestions/searchSuggestionsCaption/index.js +17 -22
- package/build/components/search/searchSuggestions/searchSuggestionsFooter/index.js +20 -25
- package/build/components/search/searchSuggestions/searchSuggestionsItem/index.js +29 -34
- package/build/components/search/searchSuggestions/searchSuggestionsItem/searchSuggestionsItemSkeleton/index.js +28 -58
- package/build/components/search/searchSuggestions/searchSuggestionsNotFound/index.js +19 -24
- package/build/components/searchFiltersConnector/filters/applyResetBtns/index.js +11 -16
- package/build/components/searchFiltersConnector/filters/galleriesFiltersForm/index.js +13 -18
- package/build/components/searchFiltersConnector/filters/index.js +38 -43
- package/build/components/searchFiltersConnector/filters/mobileFilters/index.js +5 -10
- package/build/components/searchFiltersConnector/filters/setsFiltersForm/index.js +12 -17
- package/build/components/searchFiltersConnector/index.js +12 -19
- package/build/components/sidebar/data.js +18 -26
- package/build/components/sidebar/index.js +59 -87
- package/build/components/sidebar/initializer.js +4 -34
- package/build/components/sidebar/sidebarFilters/index.js +8 -13
- package/build/components/sidebar/sidebarInviteCodeLabel/index.js +14 -19
- package/build/components/toTopBtn/index.js +32 -39
- package/build/dto/AssetEntity/index.js +19 -24
- package/build/dto/AssetEntity/interface.js +1 -2
- package/build/dto/AssetEntity/views/AssetAudio/index.js +11 -16
- package/build/dto/AssetEntity/views/AssetImage/index.js +12 -17
- package/build/dto/AssetEntity/views/AssetObject/index.js +13 -18
- package/build/dto/AssetEntity/views/AssetOther/index.js +13 -18
- package/build/dto/AssetEntity/views/AssetScreenshot/index.js +12 -17
- package/build/dto/AssetEntity/views/AssetVideo/index.js +11 -16
- package/build/dto/AssetEntity/views/index.js +6 -16
- package/build/dto/Collection/CollectionCreationEntity/index.js +22 -27
- package/build/dto/Collection/CollectionCreationEntity/interface.js +1 -2
- package/build/dto/Collection/CollectionEntity/index.js +5 -7
- package/build/dto/Collection/CollectionEntity/interface.js +1 -2
- package/build/dto/CreationEntity/index.js +19 -24
- package/build/dto/CreationEntity/interface.js +1 -2
- package/build/dto/GalleryEntityV2/index.js +5 -10
- package/build/dto/GalleryEntityV2/interface.js +1 -2
- package/build/dto/Theme/interface.js +1 -5
- package/build/dto/common/ItemType/data.js +26 -28
- package/build/dto/common/ItemType/index.js +5 -7
- package/build/dto/common/ItemViews/CreationAudio/index.js +11 -16
- package/build/dto/common/ItemViews/CreationImage/index.js +12 -17
- package/build/dto/common/ItemViews/CreationObject/index.js +10 -15
- package/build/dto/common/ItemViews/CreationOther/index.js +11 -16
- package/build/dto/common/ItemViews/CreationVideo/index.js +11 -16
- package/build/dto/common/Media/Audio/index.js +9 -14
- package/build/dto/common/Media/Image/index.js +10 -15
- package/build/dto/common/Media/Object/index.js +9 -14
- package/build/dto/common/Media/Other/index.js +14 -19
- package/build/dto/common/Media/Screenshot/index.js +10 -15
- package/build/dto/common/Media/Urls/index.js +23 -38
- package/build/dto/common/Media/Video/index.js +9 -14
- package/build/dto/common/Media/index.js +3 -5
- package/build/dto/common/Media/interface.js +1 -2
- package/build/entities/user/type.js +1 -2
- package/build/fonts/FontsInitializeLayout.js +13 -16
- package/build/fonts/vars.js +1 -6
- package/build/hooks/apollo/index.js +8 -11
- package/build/hooks/audio/useMultiAudio/index.js +10 -12
- package/build/hooks/extension/useExtension/index.js +8 -10
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +33 -39
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +32 -39
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +32 -39
- package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +27 -34
- package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +26 -32
- package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +23 -29
- package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +27 -34
- package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +30 -36
- package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.js +11 -13
- package/build/hooks/likes/dynamic/useGetTableLikes.js +24 -30
- package/build/hooks/likes/index.js +27 -32
- package/build/hooks/likes/useGetLikesAsset.js +20 -24
- package/build/layouts/GlobalLayout.js +24 -31
- package/build/layouts/base/LWithRegularHeader/index.js +7 -12
- package/build/layouts/base/LWithRegularHeader/type.js +1 -2
- package/build/layouts/base/LWithSearchHeader/index.js +5 -10
- package/build/layouts/base/LWithSearchHeader/type.js +1 -2
- package/build/layouts/custom/mainLayout/index.js +8 -13
- package/build/layouts/custom/styles.js +15 -21
- package/build/layouts/pageTransitionLayout.js +6 -8
- package/build/layouts/pageWithLayout.js +1 -2
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +35 -42
- package/build/modules/gallery/api/useGetFavoriteGallery.js +11 -15
- package/build/modules/gallery/store.js +10 -16
- package/build/modules/gallery/ui/AllResults.js +7 -11
- package/build/modules/gallery/ui/Description.js +24 -31
- package/build/modules/gallery/ui/EditGallery.js +15 -22
- package/build/modules/gallery/ui/GalleryDeleteIcon.js +12 -19
- package/build/modules/gallery/ui/PlaceholderItemsGallery.js +21 -28
- package/build/modules/gallery/ui/STopSections.js +10 -16
- package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +25 -30
- package/build/modules/gallery/ui/chooseGalleryItems/index.js +47 -52
- package/build/modules/gallery/ui/createGalleryForm/index.js +31 -36
- package/build/modules/gallery/ui/editGalleryForm/index.js +40 -45
- package/build/modules/gallery/ui/itemsPreview/index.js +54 -61
- package/build/modules/gallery/useToGalleryAsset.js +15 -23
- package/build/modules/notifications/CreatorNotifications.js +10 -40
- package/build/modules/notifications/index.js +3 -6
- package/build/modules/opportunity/OpportunityCard.js +81 -88
- package/build/modules/opportunity/OpportunityDropDown.js +11 -18
- package/build/modules/opportunity/ShareIcon.js +2 -6
- package/build/modules/opportunity/encodeQuery.js +4 -10
- package/build/modules/opportunity/popup/CopyIcon.js +3 -5
- package/build/modules/opportunity/popup/FacebookIcon.js +3 -5
- package/build/modules/opportunity/popup/LinkedInIcon.js +3 -5
- package/build/modules/opportunity/popup/LogoXIcon.js +3 -5
- package/build/modules/opportunity/popup/OpportunityMenu.js +44 -51
- package/build/modules/opportunity/type.js +1 -2
- package/build/modules/sessionScroll/globalTabs.js +1 -4
- package/build/modules/sessionScroll/index.js +16 -23
- package/build/modules/sessionScroll/type.js +1 -2
- package/build/modules/sessionScroll/useVirtuosoInitialScroll.js +12 -16
- package/build/modules/user/auth/useAuthVerification.js +10 -37
- package/build/modules/user/auth/useSignIn.js +7 -11
- package/build/modules/user/auth/useSignOut.js +11 -18
- package/build/modules/user/profileData/profileDataInitialization.js +14 -18
- package/build/modules/user/store.js +9 -12
- package/build/modules/virtuoso/VirtuosoPageBuilder.js +36 -43
- package/build/modules/virtuoso/VirtuosoToTopBtn.js +8 -13
- package/build/modules/virtuoso/types.js +1 -2
- package/build/modules/virtuoso/useSubscribeVirtuosoScrollToHeader.js +4 -8
- package/build/modules/virtuoso/useVirtuosoData.js +6 -10
- package/build/store/env/index.js +4 -7
- package/build/store/index.js +4 -7
- package/build/store/media/index.js +4 -7
- package/build/store/media/types.js +1 -2
- package/build/store/ui/index.js +21 -24
- package/build/store/ui/types.js +1 -2
- package/build/store/ui/utils.js +4 -8
- package/build/styles/ScreenWidth.js +3 -6
- package/build/styles/animations/index.js +3 -6
- package/build/styles/colors/index.js +1 -38
- package/build/styles/globalStyles.js +5 -7
- package/build/styles/mixins/boxShadow.js +3 -5
- package/build/styles/mixins/boxTransform.js +3 -5
- package/build/styles/mixins/z-indexes.js +10 -13
- package/build/styles/typography/index.js +1 -13
- package/build/system/ActiveLink/ActiveLink.test.js +14 -19
- package/build/system/ActiveLink/index.js +10 -38
- package/build/system/Alert/index.js +6 -11
- package/build/system/Alert/type.js +1 -8
- package/build/system/BasicOverlay/index.js +5 -10
- package/build/system/Buttons/IconButton/index.js +2 -7
- package/build/system/Buttons/IconWithButton/index.js +2 -7
- package/build/system/Buttons/MainButton/index.js +2 -7
- package/build/system/Buttons/SecondaryButton/index.js +2 -7
- package/build/system/Cards/CardCheckbox/CardCheckbox.test.js +8 -13
- package/build/system/Cards/CardCheckbox/index.js +19 -24
- package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +11 -16
- package/build/system/Cards/CardContent/CardCategory/index.js +13 -18
- package/build/system/Cards/CardContent/CardContent.test.js +31 -36
- package/build/system/Cards/CardContent/CardLikes/CardLikes.test.js +11 -16
- package/build/system/Cards/CardContent/CardLikes/index.js +11 -16
- package/build/system/Cards/CardContent/CardShowMore/CardShowMore.test.js +20 -25
- package/build/system/Cards/CardContent/CardShowMore/index.js +34 -40
- package/build/system/Cards/CardContent/index.js +32 -37
- package/build/system/Cards/CardMedia/CardAudio/CardAudio.test.js +35 -40
- package/build/system/Cards/CardMedia/CardAudio/index.js +18 -23
- package/build/system/Cards/CardMedia/CardImage/CardImage.test.js +14 -19
- package/build/system/Cards/CardMedia/CardImage/index.js +8 -13
- package/build/system/Cards/CardMedia/CardVideo/index.js +17 -22
- package/build/system/Cards/CardRank/index.js +32 -37
- package/build/system/Cards/CreationCard/CardHead.js +35 -42
- package/build/system/Cards/CreationCard/index.js +45 -76
- package/build/system/Cards/MultiMediaCard/index.js +30 -35
- package/build/system/Cards/Styles/Content.js +9 -14
- package/build/system/Cards/Styles/Head.js +8 -13
- package/build/system/Cards/Styles/Headicons.js +23 -28
- package/build/system/Cards/Styles/Image.js +8 -13
- package/build/system/Cards/Styles/Likes.js +14 -19
- package/build/system/Cards/Styles/MultiHead.js +11 -16
- package/build/system/Cards/Styles/Video.js +3 -8
- package/build/system/CardsHolderWithSkeleton/CardsHolder/CardsError/index.js +14 -19
- package/build/system/CardsHolderWithSkeleton/CardsHolder/CardsNoResults/index.js +10 -15
- package/build/system/CardsHolderWithSkeleton/CardsHolder/CardsSkeleton/index.js +17 -24
- package/build/system/CardsHolderWithSkeleton/CardsHolderLoader/index.js +15 -20
- package/build/system/DropDown/DropDown.test.js +14 -19
- package/build/system/DropDown/index.js +12 -17
- package/build/system/Filters/helpers.js +1 -5
- package/build/system/Filters/type.js +2 -5
- package/build/system/Forms/Checkbox/Checkbox.test.js +13 -18
- package/build/system/Forms/Checkbox/index.js +16 -21
- package/build/system/Forms/DatePicker/index.js +46 -51
- package/build/system/Forms/ErrorLabel/ErrorLabel.test.js +11 -16
- package/build/system/Forms/ErrorLabel/index.js +10 -15
- package/build/system/Forms/Input/Input.test.js +13 -18
- package/build/system/Forms/Input/index.js +29 -35
- package/build/system/Forms/Input/type.js +1 -2
- package/build/system/Forms/Messages/index.js +1 -3
- package/build/system/Forms/RadioInput/index.js +12 -17
- package/build/system/Forms/Selects/DesktopSelect/index.js +41 -69
- package/build/system/Forms/Selects/DesktopSelect/type.js +1 -2
- package/build/system/Forms/Selects/MobileSelect/index.js +10 -15
- package/build/system/Forms/TextArea/TextArea.test.js +13 -18
- package/build/system/Forms/TextArea/index.js +26 -31
- package/build/system/Forms/index.js +5 -14
- package/build/system/Img/ExternalImage/index.js +11 -17
- package/build/system/Img/ImageInterceptor/ImageInterceptor.test.js +18 -23
- package/build/system/Img/ImageInterceptor/index.js +10 -40
- package/build/system/Img/Profilepic/index.js +12 -19
- package/build/system/Img/Userpic/UserPic.test.js +15 -20
- package/build/system/Img/Userpic/index.js +28 -33
- package/build/system/Img/index.js +3 -19
- package/build/system/Labels/ExperienceLabel/ExperienceLabel.test.js +12 -17
- package/build/system/Labels/ExperienceLabel/index.js +27 -32
- package/build/system/Labels/InviteLabel/InviteLabel.test.js +10 -15
- package/build/system/Labels/InviteLabel/index.js +14 -19
- package/build/system/Labels/SkeletonLabel/index.js +2 -7
- package/build/system/Modals/Modal/Modal.test.js +11 -16
- package/build/system/Modals/Modal/index.js +24 -29
- package/build/system/Modals/ModalSidebar/CreatorModalSidebarPortal.js +7 -37
- package/build/system/Modals/ModalSidebar/ModalSidebar.test.js +11 -16
- package/build/system/Modals/ModalSidebar/ModalSidebarPortal.js +5 -9
- package/build/system/Modals/ModalSidebar/index.js +23 -29
- package/build/system/Overlay/Overlay.test.js +11 -16
- package/build/system/Overlay/index.js +11 -16
- package/build/system/PageLoader/index.js +2 -7
- package/build/system/Palete/index.js +2 -7
- package/build/system/ShareIconResize.js +14 -21
- package/build/system/Tabs/TabNavLink/TabNavLink.test.js +15 -20
- package/build/system/Tabs/TabNavLink/index.js +17 -23
- package/build/system/Tabs/TabsNav/TabsNav.test.js +18 -23
- package/build/system/Tabs/TabsNav/index.js +7 -13
- package/build/system/Tabs/TabsNav/type.js +1 -2
- package/build/system/Tabs/TabsPanel/TabsPanel.test.js +13 -18
- package/build/system/Tabs/TabsPanel/index.js +5 -10
- package/build/system/index.js +6 -22
- package/build/system/theme.js +1 -7
- package/build/utils/3d.js +1 -5
- package/build/utils/adaptive/check4k.js +5 -9
- package/build/utils/adaptive/scale.js +5 -9
- package/build/utils/auth/index.js +3 -7
- package/build/utils/copyBtn/index.js +23 -30
- package/build/utils/env/index.js +1 -5
- package/build/utils/extractItemIds.js +3 -9
- package/build/utils/getDimensionsImage.js +1 -5
- package/build/utils/getPageSizeAssets.js +4 -8
- package/build/utils/imageProportionsSize/index.js +1 -5
- package/build/utils/screen/index.js +24 -30
- package/build/utils/seacrhTabs.js +1 -4
- package/build/utils/ssrFunctions/index.js +9 -15
- package/build/utils/ui/index.js +1 -5
- package/package.json +2 -3
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.CreatorModalSidebarPortal = void 0;
|
|
30
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
-
const dynamic_1 = __importDefault(require("next/dynamic"));
|
|
32
|
-
const ui_1 = require("../../../store/ui");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import dynamic from 'next/dynamic';
|
|
3
|
+
import { useUiStore } from "../../../store/ui";
|
|
33
4
|
// add first load chunk when component needed
|
|
34
|
-
const ModalSidebarPortal = (
|
|
5
|
+
const ModalSidebarPortal = dynamic(() => import('./ModalSidebarPortal').then((_) => _.ModalSidebarPortal));
|
|
35
6
|
// minimize dom tree for optimize virtualization
|
|
36
|
-
const CreatorModalSidebarPortal = () => {
|
|
37
|
-
const { isOpenModalSidebarPortal, closeModalSidebarPortal, contentModals } =
|
|
7
|
+
export const CreatorModalSidebarPortal = () => {
|
|
8
|
+
const { isOpenModalSidebarPortal, closeModalSidebarPortal, contentModals } = useUiStore((state) => ({
|
|
38
9
|
isOpenModalSidebarPortal: state.isOpenModalSidebarPortal,
|
|
39
10
|
closeModalSidebarPortal: state.closeModalSidebarPortal,
|
|
40
11
|
contentModals: state.contentModals,
|
|
@@ -42,6 +13,5 @@ const CreatorModalSidebarPortal = () => {
|
|
|
42
13
|
if (!isOpenModalSidebarPortal) {
|
|
43
14
|
return null;
|
|
44
15
|
}
|
|
45
|
-
return ((
|
|
16
|
+
return (_jsx(ModalSidebarPortal, { closeModal: closeModalSidebarPortal, component: contentModals }));
|
|
46
17
|
};
|
|
47
|
-
exports.CreatorModalSidebarPortal = CreatorModalSidebarPortal;
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
require("@testing-library/jest-dom");
|
|
8
|
-
const react_1 = require("@testing-library/react");
|
|
9
|
-
const ui_1 = require("../../../store/ui");
|
|
10
|
-
const index_1 = __importDefault(require("./index"));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import { cleanup, render, screen } from '@testing-library/react';
|
|
4
|
+
import { useUiStore } from "../../../store/ui";
|
|
5
|
+
import ModalSidebar from './index';
|
|
11
6
|
jest.mock('@/store/ui');
|
|
12
7
|
describe('Modal Component', () => {
|
|
13
|
-
afterEach(
|
|
8
|
+
afterEach(cleanup);
|
|
14
9
|
test('open modal', () => {
|
|
15
10
|
const closeModalMock = jest.fn();
|
|
16
11
|
// Mock the useUiStore hook
|
|
17
|
-
|
|
18
|
-
contentModals: (
|
|
12
|
+
useUiStore.mockReturnValue({
|
|
13
|
+
contentModals: _jsx("div", { children: "test open" }),
|
|
19
14
|
isModalSidebarOpen: true,
|
|
20
15
|
closeModalSidebar: closeModalMock,
|
|
21
16
|
});
|
|
22
17
|
// Render the Modal component
|
|
23
|
-
|
|
18
|
+
render(_jsx(ModalSidebar, {}));
|
|
24
19
|
// Check if the modal content is in the document
|
|
25
|
-
const labelElement =
|
|
20
|
+
const labelElement = screen.getByText('test open');
|
|
26
21
|
expect(labelElement).toBeInTheDocument();
|
|
27
22
|
// Check if the close icon is in the document
|
|
28
|
-
const closeIcon =
|
|
23
|
+
const closeIcon = screen.getByAltText('close');
|
|
29
24
|
expect(closeIcon).toBeInTheDocument();
|
|
30
25
|
// Simulate click on the close icon
|
|
31
26
|
closeIcon.click();
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const utils_1 = require("@ludo.ninja/utils");
|
|
6
|
-
const index_1 = require("./index");
|
|
7
|
-
// import ModalCloseIcon from '@/public/modal/close.svg';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PortalCreator } from '@ludo.ninja/utils';
|
|
3
|
+
import { StyledModalSidebar } from "./index";
|
|
4
|
+
// import ModalCloseIcon from "../../../public/modal/close";
|
|
8
5
|
// minimize dom tree for optimize virtualization
|
|
9
|
-
const ModalSidebarPortal = ({ component, closeModal, }) => ((
|
|
10
|
-
exports.ModalSidebarPortal = ModalSidebarPortal;
|
|
6
|
+
export const ModalSidebarPortal = ({ component, closeModal, }) => (_jsx(PortalCreator, { children: _jsxs(StyledModalSidebar, { children: [_jsx("img", { src: "/modal/close.svg", alt: "close", width: 24, height: 24, className: 'modalCloseIcon', onClick: closeModal }), _jsx("div", { className: "modalContent", children: component })] }) }));
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const ui_1 = require("../../../store/ui");
|
|
11
|
-
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
12
|
-
const colors_1 = require("../../../styles/colors");
|
|
13
|
-
const z_indexes_1 = require("../../../styles/mixins/z-indexes");
|
|
14
|
-
// import ModalCloseIcon from '@/public/modal/close.svg';
|
|
15
|
-
exports.StyledModalSidebar = styled_components_1.default.div `
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
4
|
+
import { useUiStore } from "../../../store/ui";
|
|
5
|
+
import { mediaQuery } from "../../../styles/ScreenWidth";
|
|
6
|
+
import { WhiteColor } from "../../../styles/colors";
|
|
7
|
+
import { zIndexModal } from "../../../styles/mixins/z-indexes";
|
|
8
|
+
// import ModalCloseIcon from "../../../public/modal/close";
|
|
9
|
+
export const StyledModalSidebar = styled.div `
|
|
16
10
|
min-height: 300px;
|
|
17
11
|
//max-width: 536px;
|
|
18
|
-
z-index: ${
|
|
12
|
+
z-index: ${zIndexModal.toString()};
|
|
19
13
|
padding: 24px;
|
|
20
|
-
background-color: ${
|
|
14
|
+
background-color: ${WhiteColor};
|
|
21
15
|
position: fixed;
|
|
22
16
|
left: 50%;
|
|
23
17
|
top: 50%;
|
|
@@ -48,31 +42,31 @@ exports.StyledModalSidebar = styled_components_1.default.div `
|
|
|
48
42
|
margin-top: 24px;
|
|
49
43
|
}
|
|
50
44
|
|
|
51
|
-
${
|
|
52
|
-
min-height: ${
|
|
53
|
-
padding: ${
|
|
54
|
-
border-radius: ${
|
|
45
|
+
${mediaQuery.minWidthFourK} {
|
|
46
|
+
min-height: ${adaptiveValueCalc(300)};
|
|
47
|
+
padding: ${adaptiveValueCalc(24)};
|
|
48
|
+
border-radius: ${adaptiveValueCalc(8)};
|
|
55
49
|
|
|
56
50
|
.modalCloseIcon {
|
|
57
|
-
width: ${
|
|
58
|
-
height: ${
|
|
59
|
-
top: ${
|
|
60
|
-
right: ${
|
|
51
|
+
width: ${adaptiveValueCalc(24)};
|
|
52
|
+
height: ${adaptiveValueCalc(24)};
|
|
53
|
+
top: ${adaptiveValueCalc(16)};
|
|
54
|
+
right: ${adaptiveValueCalc(16)};
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
.modalContent {
|
|
64
|
-
margin-top: ${
|
|
58
|
+
margin-top: ${adaptiveValueCalc(24)};
|
|
65
59
|
}
|
|
66
60
|
}
|
|
67
61
|
`;
|
|
68
62
|
const ModalSidebar = () => {
|
|
69
|
-
const { contentModals, isModalSidebarOpen, closeModalSidebar } =
|
|
63
|
+
const { contentModals, isModalSidebarOpen, closeModalSidebar } = useUiStore((state) => ({
|
|
70
64
|
contentModals: state.contentModals,
|
|
71
65
|
isModalSidebarOpen: state.isModalSidebarOpen,
|
|
72
66
|
closeModalSidebar: state.closeModalSidebar,
|
|
73
67
|
}));
|
|
74
68
|
if (!isModalSidebarOpen)
|
|
75
69
|
return null;
|
|
76
|
-
return ((
|
|
70
|
+
return (_jsxs(StyledModalSidebar, { children: [_jsx("img", { src: "/modal/close.svg", alt: "close", width: 24, height: 24, className: 'modalCloseIcon', onClick: closeModalSidebar }), _jsx("div", { className: "modalContent", children: contentModals })] }));
|
|
77
71
|
};
|
|
78
|
-
|
|
72
|
+
export default ModalSidebar;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
8
|
-
const react_1 = require("@testing-library/react");
|
|
9
|
-
const ui_1 = require("../../store/ui");
|
|
10
|
-
const index_1 = __importDefault(require("./index"));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
3
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
4
|
+
import { useUiStore } from "../../store/ui";
|
|
5
|
+
import Overlay from './index';
|
|
11
6
|
// Mocking dependencies
|
|
12
7
|
jest.mock('@/store/ui');
|
|
13
8
|
describe('Overlay Component', () => {
|
|
@@ -16,13 +11,13 @@ describe('Overlay Component', () => {
|
|
|
16
11
|
closeOverlay: mockCloseOverlay,
|
|
17
12
|
isOverlayActive: false,
|
|
18
13
|
};
|
|
19
|
-
const renderComponent = () =>
|
|
14
|
+
const renderComponent = () => render(_jsx("div", { "data-testid": 'dialog', children: _jsx(Overlay, {}) }));
|
|
20
15
|
beforeEach(() => {
|
|
21
|
-
|
|
16
|
+
useUiStore.mockReturnValue(mockUseUiStore);
|
|
22
17
|
});
|
|
23
18
|
test('renders overlay with hidden visibility by default', () => {
|
|
24
19
|
renderComponent();
|
|
25
|
-
const overlay =
|
|
20
|
+
const overlay = screen.getByTestId('dialog').children[0];
|
|
26
21
|
expect(overlay).toHaveStyle('visibility: hidden');
|
|
27
22
|
const blurDiv = overlay.querySelector('.blur');
|
|
28
23
|
expect(blurDiv).toHaveStyle('visibility: hidden');
|
|
@@ -30,15 +25,15 @@ describe('Overlay Component', () => {
|
|
|
30
25
|
test('renders overlay with visible visibility when active', () => {
|
|
31
26
|
mockUseUiStore.isOverlayActive = true;
|
|
32
27
|
renderComponent();
|
|
33
|
-
const overlay =
|
|
28
|
+
const overlay = screen.getByTestId('dialog').children[0];
|
|
34
29
|
expect(overlay).toHaveStyle('visibility: visible');
|
|
35
30
|
const blurDiv = overlay.querySelector('.blur');
|
|
36
31
|
expect(blurDiv).toHaveStyle('visibility: visible');
|
|
37
32
|
});
|
|
38
33
|
test('calls closeOverlay when clicked', () => {
|
|
39
34
|
renderComponent();
|
|
40
|
-
const overlay =
|
|
41
|
-
|
|
35
|
+
const overlay = screen.getByTestId('dialog').children[0];
|
|
36
|
+
fireEvent.click(overlay);
|
|
42
37
|
expect(mockCloseOverlay).toHaveBeenCalled();
|
|
43
38
|
});
|
|
44
39
|
});
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
const ui_1 = require("../../store/ui");
|
|
9
|
-
const colors_1 = require("../../styles/colors");
|
|
10
|
-
const z_indexes_1 = require("../../styles/mixins/z-indexes");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { useUiStore } from "../../store/ui";
|
|
4
|
+
import { BlackColor } from "../../styles/colors";
|
|
5
|
+
import { zIndexOverlay } from "../../styles/mixins/z-indexes";
|
|
11
6
|
// Styles
|
|
12
|
-
const StyledOverlay =
|
|
7
|
+
const StyledOverlay = styled.div `
|
|
13
8
|
position: fixed;
|
|
14
9
|
top: 0;
|
|
15
10
|
left: 0;
|
|
16
|
-
z-index: ${
|
|
11
|
+
z-index: ${zIndexOverlay.toString()};
|
|
17
12
|
backdrop-filter: blur(10px);
|
|
18
13
|
height: var(--app-height);
|
|
19
14
|
width: 100%;
|
|
@@ -23,7 +18,7 @@ const StyledOverlay = styled_components_1.default.div `
|
|
|
23
18
|
.blur {
|
|
24
19
|
height: 100%;
|
|
25
20
|
width: 100%;
|
|
26
|
-
background-color: ${
|
|
21
|
+
background-color: ${BlackColor};
|
|
27
22
|
opacity: ${(props) => (props.isActive ? 0.6 : 0)};
|
|
28
23
|
visibility: ${(props) => (props.isActive ? 'visible' : 'hidden')};
|
|
29
24
|
transition: 0.2s all;
|
|
@@ -31,11 +26,11 @@ const StyledOverlay = styled_components_1.default.div `
|
|
|
31
26
|
`;
|
|
32
27
|
// Component
|
|
33
28
|
const Overlay = () => {
|
|
34
|
-
const { closeOverlay, isOverlayActive } =
|
|
29
|
+
const { closeOverlay, isOverlayActive } = useUiStore((state) => ({
|
|
35
30
|
closeOverlay: state.closeOverlay,
|
|
36
31
|
isOverlayActive: state.isOverlayActive,
|
|
37
32
|
}));
|
|
38
|
-
return ((
|
|
33
|
+
return (_jsx(StyledOverlay, { isActive: isOverlayActive, onClick: closeOverlay, children: _jsx("div", { className: 'blur' }) }));
|
|
39
34
|
};
|
|
40
35
|
// Export
|
|
41
|
-
|
|
36
|
+
export default Overlay;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const PageLoader_1 = __importDefault(require("@ludo.ninja/ui/build/system/PageLoader"));
|
|
7
|
-
exports.default = PageLoader_1.default;
|
|
1
|
+
import PageLoader from '@ludo.ninja/ui/build/system/PageLoader';
|
|
2
|
+
export default PageLoader;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const Palete_1 = __importDefault(require("@ludo.ninja/ui/build/system/Palete"));
|
|
7
|
-
exports.default = Palete_1.default;
|
|
1
|
+
import Palete from '@ludo.ninja/ui/build/system/Palete';
|
|
2
|
+
export default Palete;
|
|
@@ -1,31 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const scale_1 = require("../utils/adaptive/scale");
|
|
10
|
-
const screen_1 = require("../utils/screen");
|
|
11
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
13
|
-
const share_svg_1 = __importDefault(require("../public/iconButton/share"));
|
|
14
|
-
const SIcon = styled_components_1.default.div `
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { mediaQuery } from "../styles/ScreenWidth";
|
|
3
|
+
import { getAdaptiveScale } from "../utils/adaptive/scale";
|
|
4
|
+
import { useWindowDimensionsWithServerInitial } from "../utils/screen";
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
7
|
+
import ShareIcon from "../public/iconButton/share";
|
|
8
|
+
const SIcon = styled.div `
|
|
15
9
|
display: flex;
|
|
16
10
|
align-items: center;
|
|
17
11
|
justify-content: center;
|
|
18
12
|
|
|
19
|
-
${
|
|
20
|
-
width: ${
|
|
21
|
-
height: ${
|
|
13
|
+
${mediaQuery.minWidthFourK} {
|
|
14
|
+
width: ${adaptiveValueCalc(19)};
|
|
15
|
+
height: ${adaptiveValueCalc(20)};
|
|
22
16
|
}
|
|
23
17
|
`;
|
|
24
|
-
const ShareIconResize = () => {
|
|
25
|
-
const { windowDimensions } =
|
|
26
|
-
return ((
|
|
18
|
+
export const ShareIconResize = () => {
|
|
19
|
+
const { windowDimensions } = useWindowDimensionsWithServerInitial();
|
|
20
|
+
return (_jsx(SIcon, { children: _jsx(ShareIcon, { style: getAdaptiveScale({
|
|
27
21
|
windowDimensions,
|
|
28
22
|
currentSize: 1,
|
|
29
23
|
}) }) }));
|
|
30
24
|
};
|
|
31
|
-
exports.ShareIconResize = ShareIconResize;
|
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
8
|
-
const react_1 = require("@testing-library/react");
|
|
9
|
-
require("jest-styled-components");
|
|
10
|
-
const colors_1 = require("../../../styles/colors");
|
|
11
|
-
const index_1 = __importDefault(require("./index"));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
3
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
4
|
+
import 'jest-styled-components';
|
|
5
|
+
import { BlackColor, TextDarkGrayColor } from "../../../styles/colors";
|
|
6
|
+
import TabsNavLink from './index';
|
|
12
7
|
// Mock data
|
|
13
8
|
const tabNavLink = { label: 'Tab 1', value: 'tab1', id: 1 };
|
|
14
9
|
const setActiveTab = jest.fn();
|
|
15
10
|
describe('TabsNavLink Component', () => {
|
|
16
11
|
test('renders tab link with correct label', () => {
|
|
17
|
-
|
|
18
|
-
const tabLink =
|
|
12
|
+
render(_jsx(TabsNavLink, { tabNavLink: tabNavLink, activeNavLink: false }));
|
|
13
|
+
const tabLink = screen.getByText('Tab 1');
|
|
19
14
|
expect(tabLink).toBeInTheDocument();
|
|
20
|
-
expect(tabLink).toHaveStyleRule('color',
|
|
15
|
+
expect(tabLink).toHaveStyleRule('color', TextDarkGrayColor);
|
|
21
16
|
expect(tabLink).toHaveStyleRule('transform', 'scaleX(0)', {
|
|
22
17
|
modifier: '&:before',
|
|
23
18
|
});
|
|
24
19
|
});
|
|
25
20
|
test('renders tab link with active style', () => {
|
|
26
|
-
|
|
27
|
-
const tabLink =
|
|
21
|
+
render(_jsx(TabsNavLink, { tabNavLink: tabNavLink, activeNavLink: true }));
|
|
22
|
+
const tabLink = screen.getByText('Tab 1');
|
|
28
23
|
expect(tabLink).toBeInTheDocument();
|
|
29
|
-
expect(tabLink).toHaveStyleRule('color',
|
|
24
|
+
expect(tabLink).toHaveStyleRule('color', BlackColor);
|
|
30
25
|
expect(tabLink).toHaveStyleRule('transform', 'scaleX(1)', {
|
|
31
26
|
modifier: '&:before',
|
|
32
27
|
});
|
|
33
28
|
});
|
|
34
29
|
test('calls setActiveTab when clicked', () => {
|
|
35
|
-
|
|
36
|
-
const tabLink =
|
|
37
|
-
|
|
30
|
+
render(_jsx(TabsNavLink, { tabNavLink: tabNavLink, activeNavLink: false, setActiveTab: setActiveTab }));
|
|
31
|
+
const tabLink = screen.getByText('Tab 1');
|
|
32
|
+
fireEvent.click(tabLink);
|
|
38
33
|
expect(setActiveTab).toHaveBeenCalledWith(tabNavLink);
|
|
39
34
|
});
|
|
40
35
|
});
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
10
|
-
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
11
|
-
const colors_1 = require("../../../styles/colors");
|
|
12
|
-
const typography_1 = require("../../../styles/typography");
|
|
13
|
-
const vars_1 = require("../../../fonts/vars");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { adaptiveValueCalc } from '@ludo.ninja/ui/build/utils/4k';
|
|
4
|
+
import { mediaQuery } from "../../../styles/ScreenWidth";
|
|
5
|
+
import { BlackColor, TextDarkGrayColor } from "../../../styles/colors";
|
|
6
|
+
import { FH5 } from "../../../styles/typography";
|
|
7
|
+
import { poppinsFontVarCss } from "../../../fonts/vars";
|
|
14
8
|
// Styles
|
|
15
|
-
|
|
16
|
-
font-family: ${
|
|
9
|
+
export const StyledTabsNavLink = styled.div `
|
|
10
|
+
font-family: ${poppinsFontVarCss.css};
|
|
17
11
|
|
|
18
|
-
${
|
|
12
|
+
${FH5};
|
|
19
13
|
position: relative;
|
|
20
|
-
color: ${(props) => (props.isActive ?
|
|
14
|
+
color: ${(props) => (props.isActive ? BlackColor : TextDarkGrayColor)};
|
|
21
15
|
text-decoration: none;
|
|
22
16
|
cursor: pointer;
|
|
23
17
|
text-align: left;
|
|
@@ -36,14 +30,14 @@ exports.StyledTabsNavLink = styled_components_1.default.div `
|
|
|
36
30
|
transform: ${(props) => (props.isActive ? 'scaleX(1)' : 'scaleX(0)')};
|
|
37
31
|
transition: transform 0.3s ease;
|
|
38
32
|
|
|
39
|
-
${
|
|
40
|
-
height: ${
|
|
41
|
-
bottom: ${
|
|
33
|
+
${mediaQuery.minWidthFourK} {
|
|
34
|
+
height: ${adaptiveValueCalc(2)};
|
|
35
|
+
bottom: ${adaptiveValueCalc(-2)};
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
38
|
|
|
45
39
|
:hover {
|
|
46
|
-
color: ${
|
|
40
|
+
color: ${BlackColor};
|
|
47
41
|
}
|
|
48
42
|
|
|
49
43
|
:hover::before {
|
|
@@ -52,7 +46,7 @@ exports.StyledTabsNavLink = styled_components_1.default.div `
|
|
|
52
46
|
`;
|
|
53
47
|
// Component
|
|
54
48
|
const TabsNavLink = ({ tabNavLink, activeNavLink, setActiveTab, }) => {
|
|
55
|
-
return ((
|
|
49
|
+
return (_jsx(StyledTabsNavLink, { isActive: activeNavLink, onClick: () => (setActiveTab ? setActiveTab(tabNavLink) : null), children: tabNavLink.label }));
|
|
56
50
|
};
|
|
57
51
|
// Export
|
|
58
|
-
|
|
52
|
+
export default TabsNavLink;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
8
|
-
const react_1 = require("@testing-library/react");
|
|
9
|
-
require("jest-styled-components");
|
|
10
|
-
const colors_1 = require("../../../styles/colors");
|
|
11
|
-
const index_1 = __importDefault(require("./index"));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
3
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
4
|
+
import 'jest-styled-components';
|
|
5
|
+
import { BlackColor, TextDarkGrayColor } from "../../../styles/colors";
|
|
6
|
+
import TabsNav from './index';
|
|
12
7
|
// Mock data
|
|
13
8
|
const tabsData = [
|
|
14
9
|
{ id: 1, label: 'Tab 1' },
|
|
@@ -18,26 +13,26 @@ const activeTab = { id: 1, label: 'Tab 1' };
|
|
|
18
13
|
const setActiveTab = jest.fn();
|
|
19
14
|
describe('TabsNav Component', () => {
|
|
20
15
|
test('renders all tabs correctly', () => {
|
|
21
|
-
|
|
22
|
-
const tab1 =
|
|
23
|
-
const tab2 =
|
|
16
|
+
render(_jsx(TabsNav, { tabsData: tabsData, activeTab: activeTab }));
|
|
17
|
+
const tab1 = screen.getByText('Tab 1');
|
|
18
|
+
const tab2 = screen.getByText('Tab 2');
|
|
24
19
|
expect(tab1).toBeInTheDocument();
|
|
25
20
|
expect(tab2).toBeInTheDocument();
|
|
26
21
|
});
|
|
27
22
|
test('applies active styles to the active tab', () => {
|
|
28
|
-
|
|
29
|
-
const activeTabElement =
|
|
30
|
-
expect(activeTabElement).toHaveStyleRule('color',
|
|
23
|
+
render(_jsx(TabsNav, { tabsData: tabsData, activeTab: activeTab, setActiveTab: setActiveTab }));
|
|
24
|
+
const activeTabElement = screen.getByText('Tab 1');
|
|
25
|
+
expect(activeTabElement).toHaveStyleRule('color', BlackColor);
|
|
31
26
|
});
|
|
32
27
|
test('applies inactive styles to inactive tabs', () => {
|
|
33
|
-
|
|
34
|
-
const inactiveTabElement =
|
|
35
|
-
expect(inactiveTabElement).toHaveStyleRule('color',
|
|
28
|
+
render(_jsx(TabsNav, { tabsData: tabsData, activeTab: activeTab, setActiveTab: setActiveTab }));
|
|
29
|
+
const inactiveTabElement = screen.getByText('Tab 2');
|
|
30
|
+
expect(inactiveTabElement).toHaveStyleRule('color', TextDarkGrayColor);
|
|
36
31
|
});
|
|
37
32
|
test('calls setActiveTab when a tab is clicked', () => {
|
|
38
|
-
|
|
39
|
-
const tab2 =
|
|
40
|
-
|
|
33
|
+
render(_jsx(TabsNav, { tabsData: tabsData, activeTab: activeTab, setActiveTab: setActiveTab }));
|
|
34
|
+
const tab2 = screen.getByText('Tab 2');
|
|
35
|
+
fireEvent.click(tab2);
|
|
41
36
|
expect(setActiveTab).toHaveBeenCalledWith(tabsData[1]);
|
|
42
37
|
});
|
|
43
38
|
});
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StyledTabsNav = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const TabNavLink_1 = __importDefault(require("../TabNavLink"));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import TabsNavLink from "../TabNavLink";
|
|
10
4
|
// Styles
|
|
11
|
-
|
|
5
|
+
export const StyledTabsNav = styled.div `
|
|
12
6
|
position: relative;
|
|
13
7
|
display: flex;
|
|
14
8
|
|
|
@@ -22,10 +16,10 @@ exports.StyledTabsNav = styled_components_1.default.div `
|
|
|
22
16
|
const TabsNav = ({ tabsData, activeTab, setActiveTab }) => {
|
|
23
17
|
const renderSortItems = () => {
|
|
24
18
|
return tabsData.map((data) => {
|
|
25
|
-
return ((
|
|
19
|
+
return (_jsx(TabsNavLink, { activeNavLink: activeTab?.id === data.id, tabNavLink: data, setActiveTab: setActiveTab }, data.id));
|
|
26
20
|
});
|
|
27
21
|
};
|
|
28
|
-
return (
|
|
22
|
+
return _jsx(StyledTabsNav, { children: renderSortItems() });
|
|
29
23
|
};
|
|
30
24
|
// Export
|
|
31
|
-
|
|
25
|
+
export default TabsNav;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|