@evenicanpm/storefront-core 1.0.1 → 1.0.3
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/package.json +1 -1
- package/src/api-manager/README.md +30 -22
- package/src/api-manager/datasources/e4/{e4-address.datasource.ts → address/e4-address.datasource.ts} +10 -10
- package/src/api-manager/datasources/e4/address/e4-address.remaps.ts +70 -0
- package/src/api-manager/datasources/e4/address/e4-address.translator.ts +98 -0
- package/src/api-manager/datasources/e4/{e4-cart.datasource.ts → cart/e4-cart.datasource.ts} +17 -16
- package/src/api-manager/datasources/e4/cart/e4-cart.remaps.ts +94 -0
- package/src/api-manager/datasources/e4/cart/e4-cart.translator.ts +23 -0
- package/src/api-manager/datasources/e4/categories/e4-categories.datasource.ts +38 -0
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +161 -0
- package/src/api-manager/datasources/e4/e4.datasource.ts +8 -39
- package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +8427 -0
- package/src/api-manager/datasources/e4/{e4-order.datasource.ts → order/e4-order.datasource.ts} +3 -3
- package/src/api-manager/datasources/e4/order/e4-order.remaps.ts +101 -0
- package/src/api-manager/datasources/e4/{e4-organization.datasource.ts → organization/e4-organization.datasource.ts} +1 -1
- package/src/api-manager/datasources/e4/{e4-product.datasource.ts → product/e4-product.datasource.ts} +13 -11
- package/src/api-manager/datasources/e4/product/e4-product.remaps.ts +88 -0
- package/src/api-manager/datasources/e4/{e4.translator.ts → product/e4-product.translator.ts} +9 -329
- package/src/api-manager/datasources/e4/{e4-session.datasource.ts → session/e4-session.datasource.ts} +3 -3
- package/src/api-manager/datasources/e4/session/e4-session.translator.ts +18 -0
- package/src/api-manager/datasources/e4/user/e4-user.datasource.ts +13 -6
- package/src/api-manager/datasources/e4/user/e4-user.remaps.ts +49 -0
- package/src/api-manager/datasources/e4/user/e4-user.translator.ts +23 -2
- package/src/api-manager/datasources/e4/utils/unwrap-e4-variants.ts +1 -1
- package/src/api-manager/index.ts +11 -6
- package/src/api-manager/schemas/user.schema.ts +3 -1
- package/src/api-manager/services/cart/mutations/add-to-cart.ts +1 -1
- package/src/api-manager/services/cart/mutations/checkout.ts +1 -2
- package/src/api-manager/services/product/server/product.server.ts +4 -1
- package/src/api-manager/types/Datasource.ts +1 -5
- package/src/cms/blocks/BlockManager.tsx +67 -0
- package/src/cms/blocks/Components/BrandLogosScroller.tsx +72 -0
- package/src/cms/blocks/Components/CategoryCard.tsx +47 -0
- package/src/cms/blocks/Components/CategoryCarousel/index.tsx +60 -0
- package/src/cms/blocks/Components/FeaturePill.tsx +99 -0
- package/src/cms/blocks/Components/FeaturedCategories.tsx +41 -0
- package/src/cms/blocks/Components/FeaturedProducts.tsx +41 -0
- package/src/cms/blocks/Components/Footer/data/index.ts +32 -0
- package/src/cms/blocks/Components/Footer/index.tsx +88 -0
- package/src/cms/blocks/Components/Footer/interfaces.ts +37 -0
- package/src/cms/blocks/Components/Footer/sections/FooterAppStore.tsx +45 -0
- package/src/cms/blocks/Components/Footer/sections/FooterContact.tsx +36 -0
- package/src/cms/blocks/Components/Footer/sections/FooterLinks.tsx +30 -0
- package/src/cms/blocks/Components/Footer/sections/FooterLogo.tsx +26 -0
- package/src/cms/blocks/Components/Footer/sections/FooterSocialLinks.tsx +70 -0
- package/src/cms/blocks/Components/Footer/styles/index.ts +39 -0
- package/src/cms/blocks/Components/Footer.tsx +77 -0
- package/src/cms/blocks/Components/Hero.tsx +73 -0
- package/src/cms/blocks/Components/HeroCarousel/index.tsx +42 -0
- package/src/cms/blocks/Components/Image.tsx +39 -0
- package/src/cms/blocks/Components/MediaCard.tsx +41 -0
- package/src/cms/blocks/Components/ProductCarousel/index.tsx +82 -0
- package/src/cms/blocks/Components/ProductSectionFullWidth/index.tsx +103 -0
- package/src/cms/blocks/Components/RichText.tsx +19 -0
- package/src/cms/blocks/Components/Seo/index.tsx +48 -0
- package/src/cms/blocks/Components/Services/index.tsx +21 -0
- package/src/cms/blocks/Components/Services/service-card.tsx +73 -0
- package/src/cms/blocks/Components/shared/featured-product-card.tsx +29 -0
- package/src/cms/blocks/Components/shared/product-category-item.tsx +49 -0
- package/src/cms/blocks/Components/shared/product-grid.tsx +48 -0
- package/src/cms/blocks/Components/shared/top-categories-card.tsx +66 -0
- package/src/cms/blocks/Components/shared/top-rating-product-card.tsx +66 -0
- package/src/cms/blocks/Icons/Components/Category.tsx +14 -0
- package/src/cms/blocks/Icons/Components/DottedStar.tsx +40 -0
- package/src/cms/blocks/Icons/Components/FallbackIcon.tsx +33 -0
- package/src/cms/blocks/Icons/Components/GiftBox.tsx +18 -0
- package/src/cms/blocks/Icons/Components/Light.tsx +13 -0
- package/src/cms/blocks/Icons/Components/NewArrival.tsx +18 -0
- package/src/cms/blocks/Icons/Components/RankBadge.tsx +39 -0
- package/src/cms/blocks/Icons/index.ts +32 -0
- package/src/cms/blocks/index.tsx +16 -0
- package/src/cms/blocks/interfaces.ts +240 -0
- package/src/components/Notifications/README.md +1 -1
- package/src/components/Notifications/notification-context.tsx +1 -1
- package/src/components/README.md +3 -8
- package/src/components/_components/MiniCartClient.tsx +1 -1
- package/src/components/_components/navbar/category-based-menu/components/categories.tsx +1 -1
- package/src/components/_components/navbar/mega-menu/mega-menu.tsx +1 -1
- package/src/components/_components/navbar/nav-list/nav-item-child.tsx +2 -2
- package/src/components/_components/product-cards/product-card-1/product-card-1-wrapper.tsx +1 -1
- package/src/components/_components/products-view/product-view-dialog.tsx +1 -1
- package/src/components/_components/settings/setting.tsx +1 -1
- package/src/components/_components/wishlist/add-to-wishlist-dialog.tsx +1 -1
- package/src/components/_components/wishlist/components/create-new-list.tsx +1 -1
- package/src/components/_components/wishlist/remove-from-wishlist-dialog.tsx +1 -1
- package/src/components/_components/wishlist-modal/add-to-wishlist-dialog.tsx +1 -1
- package/src/components/_components/wishlist-modal/remove-from-wishlist-dialog.tsx +1 -1
- package/src/components/countries-input.tsx +0 -1
- package/src/components-v2/BazaarCard.tsx +21 -0
- package/src/components-v2/BazaarImage.tsx +12 -0
- package/src/components-v2/BazaarMenu.tsx +47 -0
- package/src/components-v2/BazaarSwitch.tsx +37 -0
- package/src/components-v2/BazaarTextField.tsx +73 -0
- package/src/components-v2/BoxShadowCard.tsx +16 -0
- package/src/components-v2/DropZone.tsx +86 -0
- package/src/components-v2/HoverBox.tsx +22 -0
- package/src/components-v2/Image.tsx +5 -0
- package/src/components-v2/ImageWithFallback.tsx +51 -0
- package/src/components-v2/LazyImage.tsx +12 -0
- package/src/components-v2/Loading.tsx +36 -0
- package/src/components-v2/MiniCartClient.tsx +65 -0
- package/src/components-v2/README.md +4 -0
- package/src/components-v2/SearchInput.tsx +28 -0
- package/src/components-v2/SnackbarProvider.tsx +32 -0
- package/src/components-v2/T/index.tsx +15 -0
- package/src/components-v2/Typography.tsx +227 -0
- package/src/components-v2/WhiteButton.tsx +20 -0
- package/src/components-v2/accordion/accordion-header.tsx +43 -0
- package/src/components-v2/accordion/index.ts +1 -0
- package/src/components-v2/bazaar-types.ts +84 -0
- package/src/components-v2/carousel/carousel.tsx +72 -0
- package/src/components-v2/carousel/components/carousel-arrows.tsx +60 -0
- package/src/components-v2/carousel/components/carousel-dots.tsx +21 -0
- package/src/components-v2/carousel/index.ts +3 -0
- package/src/components-v2/carousel/styles/index.ts +93 -0
- package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +64 -0
- package/src/components-v2/carousel-cards/carousel-card-1/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-1/styles.ts +34 -0
- package/src/components-v2/carousel-cards/carousel-card-2/carousel-card-2.tsx +78 -0
- package/src/components-v2/carousel-cards/carousel-card-2/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-2/styles.ts +26 -0
- package/src/components-v2/carousel-cards/carousel-card-3/carousel-card-3.tsx +37 -0
- package/src/components-v2/carousel-cards/carousel-card-3/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-3/styles.ts +28 -0
- package/src/components-v2/carousel-cards/carousel-card-4/carousel-card-4.tsx +81 -0
- package/src/components-v2/carousel-cards/carousel-card-4/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-4/styles.ts +27 -0
- package/src/components-v2/categories/category-list/category-list.tsx +59 -0
- package/src/components-v2/categories/category-list/index.ts +1 -0
- package/src/components-v2/categories/category-list/styles.ts +29 -0
- package/src/components-v2/categories/category-list/types.ts +4 -0
- package/src/components-v2/categories/category-list-item/category-menu-item.tsx +37 -0
- package/src/components-v2/categories/category-list-item/index.ts +1 -0
- package/src/components-v2/categories/category-list-item/styles.ts +35 -0
- package/src/components-v2/categories/category-menu.tsx +51 -0
- package/src/components-v2/categories/mega-menu/banner.tsx +60 -0
- package/src/components-v2/categories/mega-menu/column-list.tsx +70 -0
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +37 -0
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +37 -0
- package/src/components-v2/categories/mega-menu/styles.ts +25 -0
- package/src/components-v2/categories/types.ts +16 -0
- package/src/components-v2/category-cards/category-card-1/category-card-1.tsx +21 -0
- package/src/components-v2/category-cards/category-card-1/index.ts +1 -0
- package/src/components-v2/category-cards/category-card-1/styles.ts +37 -0
- package/src/components-v2/countdown/count-box.tsx +19 -0
- package/src/components-v2/countdown/count-down.tsx +24 -0
- package/src/components-v2/countdown/index.tsx +2 -0
- package/src/components-v2/countdown/useCountDown.ts +41 -0
- package/src/components-v2/countries-input.tsx +73 -0
- package/src/components-v2/data-table/index.ts +2 -0
- package/src/components-v2/data-table/table-header.tsx +91 -0
- package/src/components-v2/data-table/table-pagination.tsx +36 -0
- package/src/components-v2/flex-box/flex-between.tsx +14 -0
- package/src/components-v2/flex-box/flex-box.tsx +9 -0
- package/src/components-v2/flex-box/flex-row-center.tsx +9 -0
- package/src/components-v2/flex-box/index.ts +5 -0
- package/src/components-v2/footer/components/about-links.tsx +23 -0
- package/src/components-v2/footer/components/app-store.tsx +38 -0
- package/src/components-v2/footer/components/customer-care-links.tsx +21 -0
- package/src/components-v2/footer/components/logo.tsx +23 -0
- package/src/components-v2/footer/components/social-links.tsx +43 -0
- package/src/components-v2/footer/data/index.ts +54 -0
- package/src/components-v2/footer/footer-1.tsx +62 -0
- package/src/components-v2/footer/footer-2.tsx +57 -0
- package/src/components-v2/footer/footer-3.tsx +53 -0
- package/src/components-v2/footer/footer-4.tsx +71 -0
- package/src/components-v2/footer/index.ts +4 -0
- package/src/components-v2/footer/styles/index.ts +42 -0
- package/src/components-v2/header/components/categories-menu.tsx +23 -0
- package/src/components-v2/header/components/mobile-header.tsx +75 -0
- package/src/components-v2/header/components/user.test.tsx +200 -0
- package/src/components-v2/header/components/user.tsx +204 -0
- package/src/components-v2/header/header.tsx +63 -0
- package/src/components-v2/header/hooks/use-header.ts +13 -0
- package/src/components-v2/header/index.ts +1 -0
- package/src/components-v2/header/sticky-header.tsx +17 -0
- package/src/components-v2/header/styles/index.ts +24 -0
- package/src/components-v2/icons/cart-bag.tsx +13 -0
- package/src/components-v2/icons/category-outline.tsx +29 -0
- package/src/components-v2/icons/category.tsx +12 -0
- package/src/components-v2/icons/home.tsx +19 -0
- package/src/components-v2/icons/search.tsx +13 -0
- package/src/components-v2/icons/shopping-bag-outlined.tsx +13 -0
- package/src/components-v2/icons/up-down.tsx +21 -0
- package/src/components-v2/icons/user.tsx +13 -0
- package/src/components-v2/icons/user2.tsx +14 -0
- package/src/components-v2/mini-cart/__tests__/cart-item.test.tsx +174 -0
- package/src/components-v2/mini-cart/__tests__/mini-cart.test.tsx +121 -0
- package/src/components-v2/mini-cart/__tests__/test-cart-empty.json +84 -0
- package/src/components-v2/mini-cart/__tests__/test-cart-with-item.json +244 -0
- package/src/components-v2/mini-cart/components/bottom-actions.tsx +27 -0
- package/src/components-v2/mini-cart/components/cart-item.tsx +147 -0
- package/src/components-v2/mini-cart/components/empty-view.tsx +29 -0
- package/src/components-v2/mini-cart/components/top-header.tsx +37 -0
- package/src/components-v2/mini-cart/index.ts +1 -0
- package/src/components-v2/mini-cart/mini-cart.tsx +107 -0
- package/src/components-v2/mobile-navigation/index.ts +3 -0
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +73 -0
- package/src/components-v2/mobile-navigation/styles/index.ts +63 -0
- package/src/components-v2/nav-link/index.ts +5 -0
- package/src/components-v2/nav-link/nav-link-2.tsx +32 -0
- package/src/components-v2/nav-link/nav-link-3.tsx +67 -0
- package/src/components-v2/nav-link/nav-link.tsx +53 -0
- package/src/components-v2/navbar/categories.tsx +27 -0
- package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +52 -0
- package/src/components-v2/navbar/category-based-menu/components/categories.tsx +44 -0
- package/src/components-v2/navbar/category-based-menu/components/category-item.tsx +31 -0
- package/src/components-v2/navbar/category-based-menu/components/child-categories.tsx +38 -0
- package/src/components-v2/navbar/category-based-menu/index.ts +1 -0
- package/src/components-v2/navbar/category-based-menu/styles.ts +81 -0
- package/src/components-v2/navbar/category-based-menu/types.ts +18 -0
- package/src/components-v2/navbar/index.ts +1 -0
- package/src/components-v2/navbar/mega-menu/category-list.tsx +29 -0
- package/src/components-v2/navbar/mega-menu/index.ts +1 -0
- package/src/components-v2/navbar/mega-menu/mega-menu.tsx +71 -0
- package/src/components-v2/navbar/mega-menu/styles.ts +43 -0
- package/src/components-v2/navbar/mobile-menu/index.ts +1 -0
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +70 -0
- package/src/components-v2/navbar/mobile-menu/render-levels.test.tsx +71 -0
- package/src/components-v2/navbar/mobile-menu/render-levels.tsx +62 -0
- package/src/components-v2/navbar/nav-list/cms-nav.test.tsx +84 -0
- package/src/components-v2/navbar/nav-list/index.ts +1 -0
- package/src/components-v2/navbar/nav-list/nav-item-child.tsx +66 -0
- package/src/components-v2/navbar/nav-list/nav-list.tsx +119 -0
- package/src/components-v2/navbar/navbar.tsx +43 -0
- package/src/components-v2/navbar/styles.ts +90 -0
- package/src/components-v2/navbar/utils/transform-nav.test.ts +209 -0
- package/src/components-v2/navbar/utils/transform-nav.ts +43 -0
- package/src/components-v2/newsletter/index.ts +1 -0
- package/src/components-v2/newsletter/newsletter.tsx +112 -0
- package/src/components-v2/newsletter/social-icons.tsx +35 -0
- package/src/components-v2/newsletter/styles.ts +65 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/link-item.tsx +21 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/list-item.tsx +27 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/nav-accordion.tsx +36 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/render-child.tsx +26 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/grocery-side-nav.tsx +32 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/index.ts +1 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/styles/index.ts +11 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/components/list-item.tsx +27 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/components/nav-accordion.tsx +44 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/components/render-child.tsx +20 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/health-beauty-side-nav.tsx +43 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/index.ts +1 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/styles/index.ts +27 -0
- package/src/components-v2/page-sidenav/side-navbar/components/list-item.tsx +25 -0
- package/src/components-v2/page-sidenav/side-navbar/components/nav-accordion.tsx +46 -0
- package/src/components-v2/page-sidenav/side-navbar/components/render-child.tsx +20 -0
- package/src/components-v2/page-sidenav/side-navbar/index.ts +1 -0
- package/src/components-v2/page-sidenav/side-navbar/side-nav-bar.tsx +77 -0
- package/src/components-v2/page-sidenav/side-navbar/styles/index.ts +73 -0
- package/src/components-v2/page-sidenav/side-navbar-2/components/button-content.tsx +32 -0
- package/src/components-v2/page-sidenav/side-navbar-2/components/sidebar-accordion.tsx +66 -0
- package/src/components-v2/page-sidenav/side-navbar-2/index.ts +1 -0
- package/src/components-v2/page-sidenav/side-navbar-2/side-navbar-2.tsx +63 -0
- package/src/components-v2/page-sidenav/side-navbar-2/styles/index.ts +68 -0
- package/src/components-v2/product-cards/discount-chip.tsx +43 -0
- package/src/components-v2/product-cards/product-card-1/components/hover-actions.tsx +37 -0
- package/src/components-v2/product-cards/product-card-1/components/quantity-buttons.tsx +65 -0
- package/src/components-v2/product-cards/product-card-1/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-1/product-card-1-wrapper.tsx +304 -0
- package/src/components-v2/product-cards/product-card-1/product-card.tsx +107 -0
- package/src/components-v2/product-cards/product-card-1/styles/index.ts +46 -0
- package/src/components-v2/product-cards/product-card-10/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-10/product-card.tsx +128 -0
- package/src/components-v2/product-cards/product-card-10/styles/index.ts +38 -0
- package/src/components-v2/product-cards/product-card-11/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-11/product-card.tsx +66 -0
- package/src/components-v2/product-cards/product-card-11/styles/index.ts +16 -0
- package/src/components-v2/product-cards/product-card-12/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-12/product-card.tsx +42 -0
- package/src/components-v2/product-cards/product-card-12/styles/index.ts +16 -0
- package/src/components-v2/product-cards/product-card-13/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-13/product-card.tsx +48 -0
- package/src/components-v2/product-cards/product-card-13/styles/index.ts +25 -0
- package/src/components-v2/product-cards/product-card-14/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-14/product-card.tsx +125 -0
- package/src/components-v2/product-cards/product-card-14/styles/index.ts +40 -0
- package/src/components-v2/product-cards/product-card-15/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-15/product-card.tsx +121 -0
- package/src/components-v2/product-cards/product-card-15/styles/index.ts +57 -0
- package/src/components-v2/product-cards/product-card-16/components/quantity-buttons.tsx +54 -0
- package/src/components-v2/product-cards/product-card-16/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-16/product-card.tsx +116 -0
- package/src/components-v2/product-cards/product-card-16/styles/index.ts +18 -0
- package/src/components-v2/product-cards/product-card-2/components/favorite-button.tsx +29 -0
- package/src/components-v2/product-cards/product-card-2/components/product-price.tsx +26 -0
- package/src/components-v2/product-cards/product-card-2/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-2/product-card.tsx +70 -0
- package/src/components-v2/product-cards/product-card-3/components/hover-actions.tsx +83 -0
- package/src/components-v2/product-cards/product-card-3/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-3/product-card.tsx +110 -0
- package/src/components-v2/product-cards/product-card-3/styles/index.ts +89 -0
- package/src/components-v2/product-cards/product-card-4/components/hover-actions.tsx +50 -0
- package/src/components-v2/product-cards/product-card-4/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-4/product-card.tsx +128 -0
- package/src/components-v2/product-cards/product-card-4/styles/index.ts +66 -0
- package/src/components-v2/product-cards/product-card-5/components/button-actions.tsx +49 -0
- package/src/components-v2/product-cards/product-card-5/components/hover-actions.tsx +50 -0
- package/src/components-v2/product-cards/product-card-5/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-5/product-card.tsx +137 -0
- package/src/components-v2/product-cards/product-card-5/styles/index.ts +94 -0
- package/src/components-v2/product-cards/product-card-6/components/hover-actions.tsx +50 -0
- package/src/components-v2/product-cards/product-card-6/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-6/product-card.tsx +121 -0
- package/src/components-v2/product-cards/product-card-6/styles/index.ts +63 -0
- package/src/components-v2/product-cards/product-card-7/components/product-status.tsx +18 -0
- package/src/components-v2/product-cards/product-card-7/components/quantity-buttons.tsx +47 -0
- package/src/components-v2/product-cards/product-card-7/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-7/product-card.tsx +139 -0
- package/src/components-v2/product-cards/product-card-7/styles/index.ts +98 -0
- package/src/components-v2/product-cards/product-card-8/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-8/product-card.tsx +151 -0
- package/src/components-v2/product-cards/product-card-8/styles/index.ts +61 -0
- package/src/components-v2/product-cards/product-card-9/components/add-to-cart.tsx +63 -0
- package/src/components-v2/product-cards/product-card-9/components/favorite-button.tsx +27 -0
- package/src/components-v2/product-cards/product-card-9/components/tags.tsx +33 -0
- package/src/components-v2/product-cards/product-card-9/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-9/product-card.tsx +169 -0
- package/src/components-v2/product-cards/product-card-wishlist/components/hover-actions.tsx +37 -0
- package/src/components-v2/product-cards/product-card-wishlist/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-wishlist/product-card.tsx +118 -0
- package/src/components-v2/product-cards/product-card-wishlist/styles/index.ts +53 -0
- package/src/components-v2/product-cards/product-price.tsx +26 -0
- package/src/components-v2/product-cards/product-rating.tsx +28 -0
- package/src/components-v2/product-cards/product-title.tsx +24 -0
- package/src/components-v2/product-cards/use-product.ts +35 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-error.tsx +46 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-label.tsx +27 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-list-chip.tsx +78 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-list.tsx +24 -0
- package/src/components-v2/product-dimensions/components/dimensions-group.tsx +55 -0
- package/src/components-v2/product-dimensions/components/dimensions.tsx +84 -0
- package/src/components-v2/product-dimensions/index.tsx +38 -0
- package/src/components-v2/product-dimensions/utils/has-selected-dimension.ts +20 -0
- package/src/components-v2/product-quantity-buttons/product-quantity-buttons.tsx +88 -0
- package/src/components-v2/products-view/product-view-dialog.tsx +218 -0
- package/src/components-v2/products-view/products-grid-view.tsx +52 -0
- package/src/components-v2/products-view/products-list-view.tsx +49 -0
- package/src/components-v2/progress/index.ts +1 -0
- package/src/components-v2/progress/progress.tsx +77 -0
- package/src/components-v2/scrollbar/index.ts +1 -0
- package/src/components-v2/scrollbar/scrollbar.tsx +27 -0
- package/src/components-v2/scrollbar/styles.ts +15 -0
- package/src/components-v2/search-box/__test__/search-input-category.test.tsx +110 -0
- package/src/components-v2/search-box/__test__/search-input.test.tsx +137 -0
- package/src/components-v2/search-box/__test__/search-results.json +165 -0
- package/src/components-v2/search-box/components/category-dropdown.tsx +61 -0
- package/src/components-v2/search-box/components/search-result.tsx +86 -0
- package/src/components-v2/search-box/hooks/use-search.ts +63 -0
- package/src/components-v2/search-box/index.ts +2 -0
- package/src/components-v2/search-box/search-input-category.test.tsx +110 -0
- package/src/components-v2/search-box/search-input-category.tsx +203 -0
- package/src/components-v2/search-box/search-input.test.tsx +41 -0
- package/src/components-v2/search-box/search-input.tsx +66 -0
- package/src/components-v2/search-box/styles/index.ts +47 -0
- package/src/components-v2/section-header/index.ts +2 -0
- package/src/components-v2/section-header/section-creator.tsx +29 -0
- package/src/components-v2/section-header/section-header.tsx +44 -0
- package/src/components-v2/service-cards/icon-component.tsx +18 -0
- package/src/components-v2/service-cards/service-card-1/index.ts +1 -0
- package/src/components-v2/service-cards/service-card-1/service-card-1.tsx +42 -0
- package/src/components-v2/service-cards/service-card-2/index.ts +1 -0
- package/src/components-v2/service-cards/service-card-2/service-card-2.tsx +37 -0
- package/src/components-v2/service-cards/service-card-3/index.ts +1 -0
- package/src/components-v2/service-cards/service-card-3/service-card-3.tsx +28 -0
- package/src/components-v2/service-cards/service-card-3/styles.ts +23 -0
- package/src/components-v2/settings/index.ts +1 -0
- package/src/components-v2/settings/setting.tsx +141 -0
- package/src/components-v2/settings/styles.ts +57 -0
- package/src/components-v2/shop-card/index.ts +1 -0
- package/src/components-v2/shop-card/shop-card.tsx +152 -0
- package/src/components-v2/shop-card/styles.ts +33 -0
- package/src/components-v2/side-nav/index.ts +1 -0
- package/src/components-v2/side-nav/side-nav.tsx +49 -0
- package/src/components-v2/site-logo.tsx +17 -0
- package/src/components-v2/sticky/Sticky.tsx +62 -0
- package/src/components-v2/sticky/index.ts +1 -0
- package/src/components-v2/sticky/styles.ts +38 -0
- package/src/components-v2/sticky-wrapper/index.ts +1 -0
- package/src/components-v2/sticky-wrapper/sticky-wrapper.tsx +21 -0
- package/src/components-v2/sticky-wrapper/styles.ts +25 -0
- package/src/components-v2/stories/story-content/index.ts +1 -0
- package/src/components-v2/stories/story-content/story-content.tsx +28 -0
- package/src/components-v2/stories/story-content/styles.ts +22 -0
- package/src/components-v2/stories/story-item/index.ts +1 -0
- package/src/components-v2/stories/story-item/story-item.tsx +24 -0
- package/src/components-v2/stories/story-item/styles.ts +11 -0
- package/src/components-v2/stories/story-viewer/index.ts +1 -0
- package/src/components-v2/stories/story-viewer/story-viewer.tsx +44 -0
- package/src/components-v2/stories/story-viewer/styles.ts +15 -0
- package/src/components-v2/subscribe-input/index.ts +1 -0
- package/src/components-v2/subscribe-input/styles.ts +14 -0
- package/src/components-v2/subscribe-input/subscribe-input.tsx +43 -0
- package/src/components-v2/topbar/index.ts +1 -0
- package/src/components-v2/topbar/styles.ts +55 -0
- package/src/components-v2/topbar/top-bar.tsx +115 -0
- package/src/components-v2/utils/constants.ts +8 -0
- package/src/components-v2/wishlist/add-to-wishlist-dialog.tsx +161 -0
- package/src/components-v2/wishlist/components/create-new-list.tsx +167 -0
- package/src/components-v2/wishlist/components/create-wishlist-button.tsx +40 -0
- package/src/components-v2/wishlist/components/dashboard-header.tsx +123 -0
- package/src/components-v2/wishlist/components/navigation.tsx +87 -0
- package/src/components-v2/wishlist/components/no-records.tsx +20 -0
- package/src/components-v2/wishlist/components/wishlist-modal-item.tsx +66 -0
- package/src/components-v2/wishlist/remove-from-wishlist-dialog.tsx +175 -0
- package/src/components-v2/wishlist/styles.ts +61 -0
- package/src/components-v2/wishlist-modal/TODO.md +10 -0
- package/src/components-v2/wishlist-modal/add-to-wishlist-button.tsx +69 -0
- package/src/components-v2/wishlist-modal/add-to-wishlist-dialog.tsx +161 -0
- package/src/components-v2/wishlist-modal/remove-from-wishlist-dialog.tsx +174 -0
- package/src/components-v2/wishlist-modal/wishlist-modal-item.tsx +65 -0
- package/src/pages/README.md +4 -0
- package/src/pages/product-details/product-intro/product-intro.tsx +3 -1
- package/src/pages/product-list/quick-view-dialog-content.tsx +4 -2
- package/src/pages-v2/README.md +4 -0
- package/src/pages-v2/account/addresses/address-form.tsx +289 -0
- package/src/pages-v2/account/addresses/address-item.tsx +104 -0
- package/src/pages-v2/account/dashboard-header.tsx +123 -0
- package/src/pages-v2/account/navigation.tsx +87 -0
- package/src/pages-v2/account/no-records.tsx +20 -0
- package/src/pages-v2/account/orders/icons/delivery.tsx +14 -0
- package/src/pages-v2/account/orders/icons/package-box.tsx +13 -0
- package/src/pages-v2/account/orders/icons/truck-filled.tsx +14 -0
- package/src/pages-v2/account/orders/order-progress.tsx +114 -0
- package/src/pages-v2/account/orders/order-row.tsx +64 -0
- package/src/pages-v2/account/orders/order-summary.tsx +87 -0
- package/src/pages-v2/account/orders/ordered-products.tsx +121 -0
- package/src/pages-v2/account/profile/profile-button.test.tsx +59 -0
- package/src/pages-v2/account/profile/profile-button.tsx +50 -0
- package/src/pages-v2/account/profile/user-info.tsx +62 -0
- package/src/pages-v2/account/styles.ts +32 -0
- package/src/pages-v2/account/table-row.tsx +19 -0
- package/src/pages-v2/account/wishlist/create-new-list.tsx +167 -0
- package/src/pages-v2/account/wishlist/create-wishlist-button.tsx +40 -0
- package/src/pages-v2/account/wishlist/wishlist-item.tsx +82 -0
- package/src/pages-v2/blog/pagination.tsx +38 -0
- package/src/pages-v2/cart/cart-item.tsx +312 -0
- package/src/pages-v2/cart/checkout-form.tsx +122 -0
- package/src/pages-v2/cart/coupon-entry.tsx +90 -0
- package/src/pages-v2/cart/estimate-shipping.tsx +183 -0
- package/src/pages-v2/cart/wrapper.tsx +30 -0
- package/src/pages-v2/checkout/checkout-alt-form/address-card.tsx +76 -0
- package/src/pages-v2/checkout/checkout-alt-form/checkout-form.tsx +131 -0
- package/src/pages-v2/checkout/checkout-alt-form/checkout-step.tsx +120 -0
- package/src/pages-v2/checkout/checkout-alt-form/customer-information.tsx +94 -0
- package/src/pages-v2/checkout/checkout-alt-form/delivery-address.tsx +174 -0
- package/src/pages-v2/checkout/checkout-alt-form/delivery-date.tsx +114 -0
- package/src/pages-v2/checkout/checkout-alt-form/delivery-options.tsx +190 -0
- package/src/pages-v2/checkout/checkout-alt-form/edit-address-form.tsx +130 -0
- package/src/pages-v2/checkout/checkout-alt-form/heading.tsx +50 -0
- package/src/pages-v2/checkout/checkout-alt-form/index.ts +1 -0
- package/src/pages-v2/checkout/checkout-alt-form/new-address-form.tsx +299 -0
- package/src/pages-v2/checkout/checkout-alt-form/node.tsx +9 -0
- package/src/pages-v2/checkout/checkout-alt-form/payment-details.tsx +347 -0
- package/src/pages-v2/checkout/checkout-alt-form/safe-card-preview-data.tsx +36 -0
- package/src/pages-v2/checkout/checkout-alt-form/types.ts +20 -0
- package/src/pages-v2/checkout/checkout-alt-summary/cart-item.tsx +42 -0
- package/src/pages-v2/checkout/checkout-alt-summary/checkout-alt-summary.tsx +42 -0
- package/src/pages-v2/checkout/checkout-alt-summary/index.ts +1 -0
- package/src/pages-v2/checkout/checkout-alt-summary/list-item.tsx +31 -0
- package/src/pages-v2/confirmation/address.tsx +25 -0
- package/src/pages-v2/confirmation/confirmation-summary.tsx +55 -0
- package/src/pages-v2/confirmation/ordered-products.tsx +115 -0
- package/src/pages-v2/product-details/available-shops.tsx +48 -0
- package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +63 -0
- package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +257 -0
- package/src/pages-v2/product-details/bopis/pickup-option-select.tsx +127 -0
- package/src/pages-v2/product-details/bopis/search-header.tsx +69 -0
- package/src/pages-v2/product-details/checkbox-label.tsx +20 -0
- package/src/pages-v2/product-details/currency.ts +64 -0
- package/src/pages-v2/product-details/frequently-bought.tsx +97 -0
- package/src/pages-v2/product-details/frequently-product-card.tsx +63 -0
- package/src/pages-v2/product-details/product-comment.tsx +49 -0
- package/src/pages-v2/product-details/product-description.tsx +22 -0
- package/src/pages-v2/product-details/product-filter-card.tsx +265 -0
- package/src/pages-v2/product-details/product-intro/product-intro-images.tsx +90 -0
- package/src/pages-v2/product-details/product-intro/product-intro.tsx +256 -0
- package/src/pages-v2/product-details/product-review.tsx +131 -0
- package/src/pages-v2/product-details/product-tabs.tsx +51 -0
- package/src/pages-v2/product-details/related-products.tsx +42 -0
- package/src/pages-v2/product-details/types.ts +11 -0
- package/src/pages-v2/product-list/breadcrumbs.tsx +39 -0
- package/src/pages-v2/product-list/checkbox-label.tsx +20 -0
- package/src/pages-v2/product-list/facet-group.tsx +125 -0
- package/src/pages-v2/product-list/facet.tsx +36 -0
- package/src/pages-v2/product-list/list-filter.tsx +43 -0
- package/src/pages-v2/product-list/pagination.tsx +80 -0
- package/src/pages-v2/product-list/product-list-context.tsx +302 -0
- package/src/pages-v2/product-list/product-list-state.ts +187 -0
- package/src/pages-v2/product-list/product-rating.tsx +16 -0
- package/src/pages-v2/product-list/quick-view-dialog-content.tsx +207 -0
- package/src/pages-v2/product-list/quick-view-dialog.tsx +54 -0
- package/src/pages-v2/product-list/range-filter.tsx +125 -0
- package/src/pages-v2/product-list/scrollbar.tsx +38 -0
- package/src/pages-v2/product-list/search-bar.tsx +162 -0
- package/src/pages-v2/product-list/selected-facets.tsx +80 -0
- package/src/pages-v2/product-list/side-nav.tsx +49 -0
- package/src/pages-v2/product-list/swatch.tsx +80 -0
- package/src/pages-v2/product-list/types.ts +18 -0
- package/src/pages-v2/product-list/use-product-list.ts +12 -0
- package/src/pages-v2/product-list/useCategoryFilter.tsx +26 -0
- package/src/pages-v2/product-list/utils/facet-helpers.ts +5 -0
- package/src/pages-v2/product-list/utils/generate-breadcrumbs.ts +30 -0
- package/src/pages-v2/product-list/utils/getCategoryFilterFromSlug.ts +153 -0
- package/src/pages-v2/product-list/utils/product-list-helper.ts +111 -0
- package/src/pages-v2/product-list/utils/product-list-types.ts +41 -0
- package/src/pages-v2/product-list/utils/search-for-category.ts +76 -0
- package/src/pages-v2/product-list/utils/sort-options.ts +44 -0
- package/src/pages-v2/product-list/utils/use-previous-refiners.ts +14 -0
- package/src/pages-v2/quickorder/order-upload.tsx +150 -0
- package/src/pages-v2/quickorder/quick-order-form.tsx +346 -0
- package/src/pages-v2/quickorder/quick-order-row.tsx +144 -0
- package/src/providers/nav-provider/index.tsx +59 -0
- package/src/providers/nav-provider/utils/createLink.ts +15 -0
- package/src/providers/notifications/README.md +15 -0
- package/src/providers/notifications/notification-context.tsx +82 -0
- package/src/providers/notifications/use-notification.ts +12 -0
- package/tsconfig.json +3 -2
- package/typedoc.js +10 -0
- package/src/api-manager/api-manager.config.json +0 -12
- package/src/api-manager/datasources/e4/e4.remaps.ts +0 -355
- package/src/api-manager/datasources/e4/e4.translator.test.ts +0 -202
- /package/src/hooks/{use-cart.tsx → use-cart.ts} +0 -0
- /package/src/hooks/{use-variants.tsx → use-variants.ts} +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { SxProps, Theme } from "@mui/material/styles";
|
|
5
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components-v2/LazyImage";
|
|
7
|
+
import {
|
|
8
|
+
H3,
|
|
9
|
+
Span,
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
11
|
+
// LOCAL CUSTOM HOOK
|
|
12
|
+
import useProduct from "../use-product";
|
|
13
|
+
// LOCAL CUSTOM COMPONENTS
|
|
14
|
+
import ProductPrice from "../product-price";
|
|
15
|
+
import DiscountChip from "../discount-chip";
|
|
16
|
+
import ProductStatus from "./components/product-status";
|
|
17
|
+
import ProductRating from "../product-rating";
|
|
18
|
+
import QuantityButtons from "./components/quantity-buttons";
|
|
19
|
+
// STYLED COMPONENTS
|
|
20
|
+
import { StyledCard, ContentWrapper, ColorBox, ImgBox } from "./styles/index";
|
|
21
|
+
|
|
22
|
+
// =======================================================
|
|
23
|
+
interface Props {
|
|
24
|
+
off: number;
|
|
25
|
+
slug: string;
|
|
26
|
+
price: number;
|
|
27
|
+
title: string;
|
|
28
|
+
imgUrl: string;
|
|
29
|
+
status: string;
|
|
30
|
+
rating?: number;
|
|
31
|
+
id: string | number;
|
|
32
|
+
sx?: SxProps<Theme>;
|
|
33
|
+
hideRating?: boolean;
|
|
34
|
+
productColors: string[];
|
|
35
|
+
}
|
|
36
|
+
// =======================================================
|
|
37
|
+
|
|
38
|
+
export default function ProductCard7(props: Props) {
|
|
39
|
+
const {
|
|
40
|
+
sx,
|
|
41
|
+
off,
|
|
42
|
+
status,
|
|
43
|
+
id,
|
|
44
|
+
title,
|
|
45
|
+
price,
|
|
46
|
+
imgUrl,
|
|
47
|
+
rating,
|
|
48
|
+
hideRating,
|
|
49
|
+
productColors,
|
|
50
|
+
slug,
|
|
51
|
+
} = props;
|
|
52
|
+
|
|
53
|
+
const { cartItem, handleCartAmountChange } = useProduct(slug);
|
|
54
|
+
|
|
55
|
+
const handleIncrementQuantity = () => {
|
|
56
|
+
const product = {
|
|
57
|
+
id,
|
|
58
|
+
slug,
|
|
59
|
+
price,
|
|
60
|
+
imgUrl,
|
|
61
|
+
name: title,
|
|
62
|
+
qty: (cartItem?.Quantity || 0) + 1,
|
|
63
|
+
};
|
|
64
|
+
product;
|
|
65
|
+
handleCartAmountChange();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const handleDecrementQuantity = () => {
|
|
69
|
+
const product = {
|
|
70
|
+
id,
|
|
71
|
+
slug,
|
|
72
|
+
price,
|
|
73
|
+
imgUrl,
|
|
74
|
+
name: title,
|
|
75
|
+
qty: (cartItem?.Quantity || 0) - 1,
|
|
76
|
+
};
|
|
77
|
+
product;
|
|
78
|
+
handleCartAmountChange("remove");
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<StyledCard sx={sx}>
|
|
83
|
+
<Link href={`/products/${slug}`}>
|
|
84
|
+
<ImgBox>
|
|
85
|
+
{/* PRODUCT BADGE STATUS IF STATUS AVAILABLE */}
|
|
86
|
+
<ProductStatus status={status} />
|
|
87
|
+
|
|
88
|
+
{/* DISCOUNT PERCENT CHIP IF AVAILABLE */}
|
|
89
|
+
<DiscountChip discount={off} sx={{ borderRadius: 0 }} />
|
|
90
|
+
|
|
91
|
+
{/* PRODUCT IMAGE / THUMBNAIL */}
|
|
92
|
+
<div className="img-wrapper">
|
|
93
|
+
<LazyImage alt={title} width={300} height={273} src={imgUrl} />
|
|
94
|
+
</div>
|
|
95
|
+
</ImgBox>
|
|
96
|
+
</Link>
|
|
97
|
+
|
|
98
|
+
<ContentWrapper>
|
|
99
|
+
<div className="content">
|
|
100
|
+
{/* PRODUCT TITLE / NAME */}
|
|
101
|
+
<Link href={`/products/${slug}`}>
|
|
102
|
+
<H3
|
|
103
|
+
mb={1}
|
|
104
|
+
ellipsis
|
|
105
|
+
title={title}
|
|
106
|
+
fontSize={24}
|
|
107
|
+
fontWeight={700}
|
|
108
|
+
color="text.secondary"
|
|
109
|
+
>
|
|
110
|
+
{title}
|
|
111
|
+
</H3>
|
|
112
|
+
</Link>
|
|
113
|
+
|
|
114
|
+
{/* PRODUCT RATING / REVIEW */}
|
|
115
|
+
<ProductRating showRating={!hideRating} rating={rating ?? 0} />
|
|
116
|
+
|
|
117
|
+
{/* PRODUCT COLORS */}
|
|
118
|
+
{productColors.length ? (
|
|
119
|
+
<ColorBox>
|
|
120
|
+
{productColors.map((color, ind) => (
|
|
121
|
+
<Span key={ind} bgcolor={color} />
|
|
122
|
+
))}
|
|
123
|
+
</ColorBox>
|
|
124
|
+
) : null}
|
|
125
|
+
|
|
126
|
+
{/* PRODUCT PRICE WITH DISCOUNT */}
|
|
127
|
+
<ProductPrice discount={off} price={price} />
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
{/* PRODUCT QUANTITY HANDLER BUTTONS */}
|
|
131
|
+
<QuantityButtons
|
|
132
|
+
quantity={cartItem?.Quantity || 0}
|
|
133
|
+
handleIncrement={handleIncrementQuantity}
|
|
134
|
+
handleDecrement={handleDecrementQuantity}
|
|
135
|
+
/>
|
|
136
|
+
</ContentWrapper>
|
|
137
|
+
</StyledCard>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import styled from "@mui/material/styles/styled";
|
|
4
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
5
|
+
import { Span } from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
6
|
+
|
|
7
|
+
export const StyledCard = styled(Box)(({ theme }) => ({
|
|
8
|
+
height: "100%",
|
|
9
|
+
margin: "auto",
|
|
10
|
+
borderRadius: 0,
|
|
11
|
+
overflow: "hidden",
|
|
12
|
+
position: "relative",
|
|
13
|
+
transition: "all 250ms ease-in-out",
|
|
14
|
+
outline: `2px solid ${theme.palette.grey[50]}`,
|
|
15
|
+
":hover": { boxShadow: theme.shadows[2] },
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
export const ImgBox = styled("div")(({ theme }) => ({
|
|
19
|
+
height: 230,
|
|
20
|
+
marginBottom: "5rem",
|
|
21
|
+
padding: "60px 40px 20px 40px",
|
|
22
|
+
background: theme.palette.grey[100],
|
|
23
|
+
".img-wrapper": { maxWidth: 300, margin: "auto" },
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
export const ContentWrapper = styled("div")({
|
|
27
|
+
gap: 8,
|
|
28
|
+
display: "flex",
|
|
29
|
+
padding: "1rem",
|
|
30
|
+
".content": { flex: "1 1 0" },
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const StatusChipBox = styled("div")(({ theme }) => ({
|
|
34
|
+
width: 40,
|
|
35
|
+
height: 42,
|
|
36
|
+
zIndex: 11,
|
|
37
|
+
top: "0px",
|
|
38
|
+
right: "30px",
|
|
39
|
+
fontSize: "12px",
|
|
40
|
+
position: "absolute",
|
|
41
|
+
background: theme.palette.primary.main,
|
|
42
|
+
|
|
43
|
+
".triangle": {
|
|
44
|
+
width: "100%",
|
|
45
|
+
display: "flex",
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
".triangle-left": {
|
|
49
|
+
width: 0,
|
|
50
|
+
height: 0,
|
|
51
|
+
borderTop: "0px solid transparent",
|
|
52
|
+
borderBottom: "10px solid transparent",
|
|
53
|
+
borderLeft: `20px solid ${theme.palette.primary.main}`,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
".triangle-right": {
|
|
57
|
+
width: 0,
|
|
58
|
+
height: 0,
|
|
59
|
+
borderTop: "0px solid transparent",
|
|
60
|
+
borderBottom: "10px solid transparent",
|
|
61
|
+
borderRight: `20px solid ${theme.palette.primary.main}`,
|
|
62
|
+
},
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
export const StatusChip = styled(Span)({
|
|
66
|
+
color: "#fff",
|
|
67
|
+
height: "100%",
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
justifyContent: "center",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const ColorBox = styled("div")(({ theme }) => ({
|
|
74
|
+
gap: 8,
|
|
75
|
+
display: "flex",
|
|
76
|
+
padding: "10px 5px",
|
|
77
|
+
"& span": {
|
|
78
|
+
width: 12,
|
|
79
|
+
height: 12,
|
|
80
|
+
borderRadius: 8,
|
|
81
|
+
"&:hover": {
|
|
82
|
+
cursor: "pointer",
|
|
83
|
+
outline: `2px solid ${theme.palette.grey[200]}`,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
}));
|
|
87
|
+
|
|
88
|
+
export const StyledButton = styled(Button)(({ theme }) => ({
|
|
89
|
+
padding: "4px",
|
|
90
|
+
borderRadius: 0,
|
|
91
|
+
transition: "all 0.3s",
|
|
92
|
+
color: theme.palette.primary.main,
|
|
93
|
+
":hover": {
|
|
94
|
+
color: "#fff",
|
|
95
|
+
background: theme.palette.primary.main,
|
|
96
|
+
border: `1px solid ${theme.palette.primary.main}`,
|
|
97
|
+
},
|
|
98
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./product-card";
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import Box from "@mui/material/Box";
|
|
5
|
+
import Rating from "@mui/material/Rating";
|
|
6
|
+
// MUI ICON COMPONENTS
|
|
7
|
+
import Favorite from "@mui/icons-material/Favorite";
|
|
8
|
+
import FavoriteBorder from "@mui/icons-material/FavoriteBorder";
|
|
9
|
+
// LOCAL CUSTOM HOOK
|
|
10
|
+
import useProduct from "../use-product";
|
|
11
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
12
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components-v2/LazyImage";
|
|
13
|
+
import { FlexRowCenter } from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
14
|
+
import {
|
|
15
|
+
H4,
|
|
16
|
+
Paragraph,
|
|
17
|
+
Small,
|
|
18
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
19
|
+
import { ProductInfo } from "@evenicanpm/storefront-core/src/components-v2/products-view/product-view-dialog";
|
|
20
|
+
// CUSTOM UTILS LIBRARY FUNCTION
|
|
21
|
+
import { currency } from "@/lib/lib";
|
|
22
|
+
// CUSTOM COMPONENTS
|
|
23
|
+
import {
|
|
24
|
+
Card,
|
|
25
|
+
CardMedia,
|
|
26
|
+
FavoriteButton,
|
|
27
|
+
QuickViewSmallButton,
|
|
28
|
+
} from "./styles/index";
|
|
29
|
+
// CUSTOM DATA MODEL
|
|
30
|
+
import { DialogType } from "@evenicanpm/storefront-core/src/components-v2/search-box/search-input-category";
|
|
31
|
+
import { RemoveRedEye } from "@mui/icons-material";
|
|
32
|
+
import buildDetailUrl from "@/lib/build-detail-url";
|
|
33
|
+
|
|
34
|
+
// ==============================================================
|
|
35
|
+
type Props = {
|
|
36
|
+
slug: string;
|
|
37
|
+
id: string | number;
|
|
38
|
+
title: string;
|
|
39
|
+
price: number;
|
|
40
|
+
thumbnail: string;
|
|
41
|
+
categories: string[];
|
|
42
|
+
reviews: number;
|
|
43
|
+
rating: number;
|
|
44
|
+
enableWishlistDialog?: boolean;
|
|
45
|
+
enableQuickViewDialog?: boolean;
|
|
46
|
+
openDialog: (
|
|
47
|
+
type: DialogType,
|
|
48
|
+
productId: number,
|
|
49
|
+
productInfo?: ProductInfo,
|
|
50
|
+
) => void;
|
|
51
|
+
};
|
|
52
|
+
// ==============================================================
|
|
53
|
+
export default function ProductCard8(props: Props) {
|
|
54
|
+
const {
|
|
55
|
+
slug,
|
|
56
|
+
id,
|
|
57
|
+
title,
|
|
58
|
+
price,
|
|
59
|
+
thumbnail,
|
|
60
|
+
categories,
|
|
61
|
+
reviews,
|
|
62
|
+
rating,
|
|
63
|
+
openDialog,
|
|
64
|
+
enableWishlistDialog = true,
|
|
65
|
+
enableQuickViewDialog = true,
|
|
66
|
+
} = props;
|
|
67
|
+
|
|
68
|
+
const {
|
|
69
|
+
isFavorite, // TODO: always false; need to check if product exists in any of the wishlists?
|
|
70
|
+
} = useProduct(slug);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Card>
|
|
74
|
+
<CardMedia>
|
|
75
|
+
<Link href={buildDetailUrl(title, Number(id))}>
|
|
76
|
+
<LazyImage
|
|
77
|
+
width={300}
|
|
78
|
+
height={300}
|
|
79
|
+
alt="category"
|
|
80
|
+
className="product-img"
|
|
81
|
+
src={thumbnail}
|
|
82
|
+
/>
|
|
83
|
+
</Link>
|
|
84
|
+
{/* */}
|
|
85
|
+
{/* QUICK VIEW BUTTON */}
|
|
86
|
+
{enableQuickViewDialog && (
|
|
87
|
+
<QuickViewSmallButton
|
|
88
|
+
className="product-actions"
|
|
89
|
+
onClick={() =>
|
|
90
|
+
openDialog(DialogType.QuickView, Number(id), {
|
|
91
|
+
id: Number(id),
|
|
92
|
+
title,
|
|
93
|
+
imgGroup: [thumbnail],
|
|
94
|
+
price,
|
|
95
|
+
slug,
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
>
|
|
99
|
+
<RemoveRedEye className="icon" fontSize="small" />
|
|
100
|
+
</QuickViewSmallButton>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{/* PRODUCT FAVORITE BUTTON */}
|
|
104
|
+
{enableWishlistDialog && (
|
|
105
|
+
<FavoriteButton
|
|
106
|
+
className="product-actions"
|
|
107
|
+
onClick={() =>
|
|
108
|
+
isFavorite
|
|
109
|
+
? openDialog(DialogType.RemoveFromWishlist, Number(id))
|
|
110
|
+
: openDialog(DialogType.AddToWishlist, Number(id))
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
{isFavorite ? (
|
|
114
|
+
<Favorite className="icon" fontSize="small" color="primary" />
|
|
115
|
+
) : (
|
|
116
|
+
<FavoriteBorder className="icon" fontSize="small" />
|
|
117
|
+
)}
|
|
118
|
+
</FavoriteButton>
|
|
119
|
+
)}
|
|
120
|
+
</CardMedia>
|
|
121
|
+
|
|
122
|
+
<Box p={1} textAlign="center">
|
|
123
|
+
{/* PRODUCT CATEGORY */}
|
|
124
|
+
{categories.length > 0 ? (
|
|
125
|
+
<Small color="grey.500">{categories[0]}</Small>
|
|
126
|
+
) : null}
|
|
127
|
+
|
|
128
|
+
{/* PRODUCT TITLE / NAME */}
|
|
129
|
+
<Paragraph fontWeight="bold">{title}</Paragraph>
|
|
130
|
+
|
|
131
|
+
{/* PRODUCT PRICE */}
|
|
132
|
+
<H4 fontWeight={700} py={0.5}>
|
|
133
|
+
{currency(price)}
|
|
134
|
+
</H4>
|
|
135
|
+
|
|
136
|
+
{/* PRODUCT RATING / REVIEW */}
|
|
137
|
+
<FlexRowCenter gap={1}>
|
|
138
|
+
<Rating
|
|
139
|
+
name="read-only"
|
|
140
|
+
value={rating}
|
|
141
|
+
readOnly
|
|
142
|
+
sx={{ fontSize: 16 }}
|
|
143
|
+
/>
|
|
144
|
+
<Small fontWeight={600} color="grey.500">
|
|
145
|
+
({reviews} Reviews)
|
|
146
|
+
</Small>
|
|
147
|
+
</FlexRowCenter>
|
|
148
|
+
</Box>
|
|
149
|
+
</Card>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Button from "@mui/material/Button";
|
|
2
|
+
import IconButton from "@mui/material/IconButton";
|
|
3
|
+
import styled from "@mui/material/styles/styled";
|
|
4
|
+
|
|
5
|
+
export const Card = styled("div")({
|
|
6
|
+
":hover": {
|
|
7
|
+
img: { transform: "scale(1.1)" },
|
|
8
|
+
".product-actions": { right: 15 },
|
|
9
|
+
".product-view-action": { opacity: 1 },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const CardMedia = styled("div")(({ theme }) => ({
|
|
14
|
+
aspectRatio: "1/1",
|
|
15
|
+
// maxHeight: 300,
|
|
16
|
+
borderRadius: 4,
|
|
17
|
+
cursor: "pointer",
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
position: "relative",
|
|
20
|
+
backgroundColor: theme.palette.grey[300],
|
|
21
|
+
img: { transition: "0.3s" },
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
export const AddToCartButton = styled(IconButton)(({ theme }) => ({
|
|
25
|
+
top: 15,
|
|
26
|
+
right: -40,
|
|
27
|
+
position: "absolute",
|
|
28
|
+
backgroundColor: "white",
|
|
29
|
+
transition: "right 0.3s .1s",
|
|
30
|
+
color: theme.palette.text.primary,
|
|
31
|
+
".icon": { fontSize: 16 },
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
export const FavoriteButton = styled(IconButton)(({ theme }) => ({
|
|
35
|
+
top: 55,
|
|
36
|
+
right: -40,
|
|
37
|
+
position: "absolute",
|
|
38
|
+
backgroundColor: "white",
|
|
39
|
+
transition: "right 0.3s .2s",
|
|
40
|
+
color: theme.palette.text.primary,
|
|
41
|
+
".icon": { fontSize: 16 },
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
export const QuickViewButton = styled(Button)({
|
|
45
|
+
left: 0,
|
|
46
|
+
bottom: 12,
|
|
47
|
+
opacity: 0,
|
|
48
|
+
borderRadius: 4,
|
|
49
|
+
position: "absolute",
|
|
50
|
+
transition: "all 0.3s",
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const QuickViewSmallButton = styled(IconButton)(({ theme }) => ({
|
|
54
|
+
top: 15,
|
|
55
|
+
right: -40,
|
|
56
|
+
position: "absolute",
|
|
57
|
+
backgroundColor: "white",
|
|
58
|
+
transition: "right 0.3s .1s",
|
|
59
|
+
color: theme.palette.text.primary,
|
|
60
|
+
".icon": { fontSize: 16 },
|
|
61
|
+
}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Button from "@mui/material/Button";
|
|
2
|
+
// MUI ICON COMPONENTS
|
|
3
|
+
import Add from "@mui/icons-material/Add";
|
|
4
|
+
import Remove from "@mui/icons-material/Remove";
|
|
5
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
+
import { H5 } from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
7
|
+
import {
|
|
8
|
+
FlexBetween,
|
|
9
|
+
FlexBox,
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
11
|
+
|
|
12
|
+
// ==============================================================
|
|
13
|
+
interface Props {
|
|
14
|
+
quantity: number;
|
|
15
|
+
handleDecrement: () => void;
|
|
16
|
+
handleIncrement: () => void;
|
|
17
|
+
}
|
|
18
|
+
// ==============================================================
|
|
19
|
+
|
|
20
|
+
export default function AddToCartButton({
|
|
21
|
+
quantity,
|
|
22
|
+
handleDecrement,
|
|
23
|
+
handleIncrement,
|
|
24
|
+
}: Props) {
|
|
25
|
+
return (
|
|
26
|
+
<FlexBox mt={1} flexShrink={0}>
|
|
27
|
+
{quantity ? (
|
|
28
|
+
<FlexBetween>
|
|
29
|
+
<Button
|
|
30
|
+
color="primary"
|
|
31
|
+
variant="contained"
|
|
32
|
+
sx={{ padding: 0.5, minHeight: 0 }}
|
|
33
|
+
onClick={handleIncrement}
|
|
34
|
+
>
|
|
35
|
+
<Add fontSize="small" />
|
|
36
|
+
</Button>
|
|
37
|
+
|
|
38
|
+
<H5 fontWeight="600" fontSize="15px" mx={1.5}>
|
|
39
|
+
{quantity}
|
|
40
|
+
</H5>
|
|
41
|
+
|
|
42
|
+
<Button
|
|
43
|
+
color="primary"
|
|
44
|
+
variant="contained"
|
|
45
|
+
sx={{ padding: 0.5, minHeight: 0 }}
|
|
46
|
+
onClick={handleDecrement}
|
|
47
|
+
>
|
|
48
|
+
<Remove fontSize="small" />
|
|
49
|
+
</Button>
|
|
50
|
+
</FlexBetween>
|
|
51
|
+
) : (
|
|
52
|
+
<Button
|
|
53
|
+
color="primary"
|
|
54
|
+
variant="contained"
|
|
55
|
+
onClick={handleIncrement}
|
|
56
|
+
sx={{ padding: 0.5, minHeight: 0 }}
|
|
57
|
+
>
|
|
58
|
+
<Add fontSize="small" />
|
|
59
|
+
</Button>
|
|
60
|
+
)}
|
|
61
|
+
</FlexBox>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import IconButton from "@mui/material/IconButton";
|
|
2
|
+
// MUI ICON COMPONENTS
|
|
3
|
+
import Favorite from "@mui/icons-material/Favorite";
|
|
4
|
+
import FavoriteBorder from "@mui/icons-material/FavoriteBorder";
|
|
5
|
+
|
|
6
|
+
// ==============================================================
|
|
7
|
+
interface Props {
|
|
8
|
+
isFavorite: boolean;
|
|
9
|
+
toggleFavorite: () => void;
|
|
10
|
+
}
|
|
11
|
+
// ==============================================================
|
|
12
|
+
|
|
13
|
+
export default function FavoriteButton({ isFavorite, toggleFavorite }: Props) {
|
|
14
|
+
return (
|
|
15
|
+
<IconButton
|
|
16
|
+
size="small"
|
|
17
|
+
onClick={toggleFavorite}
|
|
18
|
+
sx={{ position: "absolute", top: 15, right: 15, zIndex: 1 }}
|
|
19
|
+
>
|
|
20
|
+
{isFavorite ? (
|
|
21
|
+
<Favorite color="primary" fontSize="small" />
|
|
22
|
+
) : (
|
|
23
|
+
<FavoriteBorder fontSize="small" />
|
|
24
|
+
)}
|
|
25
|
+
</IconButton>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import styled from "@mui/material/styles/styled";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
|
|
4
|
+
// STYLED COMPONENTS
|
|
5
|
+
const StyledRoot = styled("div")(({ theme }) => ({
|
|
6
|
+
display: "flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
gap: theme.spacing(1),
|
|
9
|
+
"& p": {
|
|
10
|
+
fontSize: 11,
|
|
11
|
+
fontWeight: 700,
|
|
12
|
+
display: "inline-block",
|
|
13
|
+
textDecoration: "underline",
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
// ==============================================================
|
|
18
|
+
interface Props {
|
|
19
|
+
tags: string[];
|
|
20
|
+
}
|
|
21
|
+
// ==============================================================
|
|
22
|
+
|
|
23
|
+
export default function ProductTags({ tags }: Props) {
|
|
24
|
+
return (
|
|
25
|
+
<StyledRoot>
|
|
26
|
+
{tags.map((item) => (
|
|
27
|
+
<Link href="#" key={item}>
|
|
28
|
+
<p>{item}</p>
|
|
29
|
+
</Link>
|
|
30
|
+
))}
|
|
31
|
+
</StyledRoot>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProductCard9 } from "./product-card";
|