@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,114 @@
|
|
|
1
|
+
import { Fragment } from "react";
|
|
2
|
+
import { useTranslations } from "next-intl";
|
|
3
|
+
// MUI
|
|
4
|
+
import Box from "@mui/material/Box";
|
|
5
|
+
import Card from "@mui/material/Card";
|
|
6
|
+
import Avatar from "@mui/material/Avatar";
|
|
7
|
+
import styled from "@mui/material/styles/styled";
|
|
8
|
+
import { MdDone as Done } from "react-icons/md";
|
|
9
|
+
// CUSTOM ICON COMPONENTS
|
|
10
|
+
import Delivery from "./icons/delivery";
|
|
11
|
+
import PackageBox from "./icons/package-box";
|
|
12
|
+
import TruckFilled from "./icons/truck-filled";
|
|
13
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
14
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
15
|
+
import {
|
|
16
|
+
FlexBetween,
|
|
17
|
+
FlexBox,
|
|
18
|
+
} from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
19
|
+
|
|
20
|
+
// STYLED COMPONENTS
|
|
21
|
+
const StyledFlexbox = styled(FlexBetween)(({ theme }) => ({
|
|
22
|
+
flexWrap: "wrap",
|
|
23
|
+
marginTop: "2rem",
|
|
24
|
+
marginBottom: "2rem",
|
|
25
|
+
[theme.breakpoints.down("sm")]: { flexDirection: "column" },
|
|
26
|
+
"& .line": {
|
|
27
|
+
height: 4,
|
|
28
|
+
minWidth: 50,
|
|
29
|
+
flex: "1 1 0",
|
|
30
|
+
[theme.breakpoints.down("sm")]: { flex: "unset", height: 50, minWidth: 4 },
|
|
31
|
+
},
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
const StyledAvatar = styled(Avatar)(({ theme }) => ({
|
|
35
|
+
top: -5,
|
|
36
|
+
right: -5,
|
|
37
|
+
width: 22,
|
|
38
|
+
height: 22,
|
|
39
|
+
position: "absolute",
|
|
40
|
+
bgcolor: theme.palette.grey[200],
|
|
41
|
+
color: theme.palette.success.main,
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
type Props = {
|
|
45
|
+
status: number;
|
|
46
|
+
};
|
|
47
|
+
export default function OrderProgress({ status }: Props) {
|
|
48
|
+
const t = useTranslations("Account.OrderDetails");
|
|
49
|
+
|
|
50
|
+
let ORDER_STATUS = "";
|
|
51
|
+
|
|
52
|
+
// Map API statuses to ORDER_STATUS_LIST values
|
|
53
|
+
if ([1, 2, 4, 5].includes(status)) ORDER_STATUS = "Packaging";
|
|
54
|
+
if ([3].includes(status)) ORDER_STATUS = "Complete";
|
|
55
|
+
|
|
56
|
+
const hideDeliveryDate = !![4, 5].includes(status);
|
|
57
|
+
|
|
58
|
+
const STEP_ICONS = [PackageBox, TruckFilled, Delivery];
|
|
59
|
+
const ORDER_STATUS_LIST = ["Packaging", "Shipping", "Delivering", "Complete"];
|
|
60
|
+
|
|
61
|
+
const statusIndex = ORDER_STATUS_LIST.indexOf(ORDER_STATUS);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Card sx={{ p: "2rem 1.5rem", mb: 4 }}>
|
|
65
|
+
<StyledFlexbox>
|
|
66
|
+
{STEP_ICONS.map((Icon, index) => (
|
|
67
|
+
<Fragment key={index}>
|
|
68
|
+
<Box position="relative">
|
|
69
|
+
<Avatar
|
|
70
|
+
alt="shipping"
|
|
71
|
+
sx={{
|
|
72
|
+
width: 64,
|
|
73
|
+
height: 64,
|
|
74
|
+
color: index <= statusIndex ? "white" : "primary.main",
|
|
75
|
+
bgcolor: index <= statusIndex ? "primary.main" : "grey.300",
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<Icon color="inherit" fontSize="large" />
|
|
79
|
+
</Avatar>
|
|
80
|
+
|
|
81
|
+
{index < statusIndex ? (
|
|
82
|
+
<StyledAvatar alt="done">
|
|
83
|
+
<Done color="inherit" size={16} />
|
|
84
|
+
</StyledAvatar>
|
|
85
|
+
) : null}
|
|
86
|
+
</Box>
|
|
87
|
+
|
|
88
|
+
{index < STEP_ICONS.length - 1 ? (
|
|
89
|
+
<Box
|
|
90
|
+
className="line"
|
|
91
|
+
bgcolor={index < statusIndex ? "primary.main" : "grey.300"}
|
|
92
|
+
/>
|
|
93
|
+
) : null}
|
|
94
|
+
</Fragment>
|
|
95
|
+
))}
|
|
96
|
+
</StyledFlexbox>
|
|
97
|
+
|
|
98
|
+
{!hideDeliveryDate && (
|
|
99
|
+
<FlexBox justifyContent={{ xs: "center", sm: "flex-end" }}>
|
|
100
|
+
<Paragraph
|
|
101
|
+
p="0.5rem 1rem"
|
|
102
|
+
textAlign="center"
|
|
103
|
+
borderRadius="300px"
|
|
104
|
+
color="primary.main"
|
|
105
|
+
bgcolor="primary.light"
|
|
106
|
+
>
|
|
107
|
+
{t(statusIndex === 3 ? "deliveredDate" : "estimatedDeliveryDate")}
|
|
108
|
+
<b> 4th October</b>
|
|
109
|
+
</Paragraph>
|
|
110
|
+
</FlexBox>
|
|
111
|
+
)}
|
|
112
|
+
</Card>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import Box from "@mui/material/Box";
|
|
3
|
+
import Chip from "@mui/material/Chip";
|
|
4
|
+
import IconButton from "@mui/material/IconButton";
|
|
5
|
+
import { MdEast as East } from "react-icons/md";
|
|
6
|
+
import { ChipProps } from "@mui/material";
|
|
7
|
+
import { format } from "date-fns";
|
|
8
|
+
// GLOBAL CUSTOM COMPONENT
|
|
9
|
+
import {
|
|
10
|
+
H6,
|
|
11
|
+
Paragraph,
|
|
12
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
13
|
+
// Local CUSTOM COMPONENT
|
|
14
|
+
import TableRow from "../table-row";
|
|
15
|
+
// CUSTOM UTILS LIBRARY FUNCTION
|
|
16
|
+
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
17
|
+
import { SalesOrder } from "@/api-manager/schemas/order.schema";
|
|
18
|
+
|
|
19
|
+
// =================================================
|
|
20
|
+
type Props = { order: SalesOrder };
|
|
21
|
+
// =================================================
|
|
22
|
+
const STATUS_MAP: Record<number, { label: string; color: ChipProps["color"] }> =
|
|
23
|
+
{
|
|
24
|
+
1: { label: "Open", color: "secondary" },
|
|
25
|
+
2: { label: "Processing", color: "secondary" },
|
|
26
|
+
3: { label: "Complete", color: "success" },
|
|
27
|
+
4: { label: "On Hold", color: "primary" },
|
|
28
|
+
5: { label: "Cancelled", color: "primary" },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const getStatusInfo = (status: number) => {
|
|
32
|
+
return STATUS_MAP[status] ?? { label: "Unknown", color: "default" };
|
|
33
|
+
};
|
|
34
|
+
export default function OrderRow({ order }: Props) {
|
|
35
|
+
const { formatCurrency } = useCurrencyFormatter();
|
|
36
|
+
|
|
37
|
+
const { label, color } = getStatusInfo(order.StatusValue ?? 0);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Link href={`/account/orders/${order.Id}`}>
|
|
41
|
+
<TableRow sx={{ gridTemplateColumns: "2fr 1fr 1fr 1fr 1fr" }}>
|
|
42
|
+
<H6 ellipsis>{order?.ChannelReferenceId}</H6>
|
|
43
|
+
|
|
44
|
+
<Box textAlign="center">
|
|
45
|
+
<Chip size="small" label={label} color={color} />
|
|
46
|
+
</Box>
|
|
47
|
+
|
|
48
|
+
<Paragraph textAlign={{ sm: "center", xs: "left" }}>
|
|
49
|
+
{format(new Date(order.TransactionDate ?? ""), "MMM dd, yyyy")}
|
|
50
|
+
</Paragraph>
|
|
51
|
+
|
|
52
|
+
<Paragraph textAlign="center">
|
|
53
|
+
{formatCurrency(order.TotalAmount ?? 0)}
|
|
54
|
+
</Paragraph>
|
|
55
|
+
|
|
56
|
+
<Box display={{ sm: "inline-flex", xs: "none" }} justifyContent="end">
|
|
57
|
+
<IconButton sx={{ color: "grey.500" }}>
|
|
58
|
+
<East fontSize="large" />
|
|
59
|
+
</IconButton>
|
|
60
|
+
</Box>
|
|
61
|
+
</TableRow>
|
|
62
|
+
</Link>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import Grid from "@mui/material/Grid2";
|
|
2
|
+
import Card from "@mui/material/Card";
|
|
3
|
+
import Divider from "@mui/material/Divider";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
+
import { FlexBetween } from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
7
|
+
import {
|
|
8
|
+
H5,
|
|
9
|
+
H6,
|
|
10
|
+
Paragraph,
|
|
11
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
12
|
+
// CUSTOM UTILS LIBRARY FUNCTION
|
|
13
|
+
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
14
|
+
import { SalesOrder } from "@/api-manager/schemas/order.schema";
|
|
15
|
+
|
|
16
|
+
// ==============================================================
|
|
17
|
+
type Props = { order: SalesOrder };
|
|
18
|
+
// ==============================================================
|
|
19
|
+
|
|
20
|
+
function ListItem({ title, value }: { title: string; value: string }) {
|
|
21
|
+
const t = useTranslations("Account.OrderDetails");
|
|
22
|
+
return (
|
|
23
|
+
<FlexBetween mb={1}>
|
|
24
|
+
<Paragraph color="grey.600">{t(title)}</Paragraph>
|
|
25
|
+
<H6>{value}</H6>
|
|
26
|
+
</FlexBetween>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default function OrderSummary({ order }: Props) {
|
|
31
|
+
const t = useTranslations("Account.OrderDetails");
|
|
32
|
+
const { formatCurrency } = useCurrencyFormatter();
|
|
33
|
+
const shippingAddress = order.ShippingAddress;
|
|
34
|
+
return (
|
|
35
|
+
<Grid container spacing={3}>
|
|
36
|
+
{/* SHIPMENT ADDRESS SECTION */}
|
|
37
|
+
<Grid size={{ lg: 6, md: 6, xs: 12 }}>
|
|
38
|
+
<Card sx={{ p: 3 }}>
|
|
39
|
+
<H5 mt={0} mb={2}>
|
|
40
|
+
{t("addressHeading")}
|
|
41
|
+
</H5>
|
|
42
|
+
|
|
43
|
+
{shippingAddress && (
|
|
44
|
+
<Paragraph fontSize={14} my={0}>
|
|
45
|
+
{`${shippingAddress.Name}, ${shippingAddress.Street}, ${shippingAddress.City} ${shippingAddress.State} ${shippingAddress.ThreeLetterISORegionName} ${shippingAddress.ZipCode}`}
|
|
46
|
+
</Paragraph>
|
|
47
|
+
)}
|
|
48
|
+
</Card>
|
|
49
|
+
</Grid>
|
|
50
|
+
|
|
51
|
+
{/* TOTAL SUMMERY SECTION */}
|
|
52
|
+
<Grid size={{ lg: 6, md: 6, xs: 12 }}>
|
|
53
|
+
<Card sx={{ p: 3 }}>
|
|
54
|
+
<H5 mt={0} mb={2}>
|
|
55
|
+
{t("headingSummary")}
|
|
56
|
+
</H5>
|
|
57
|
+
|
|
58
|
+
<ListItem
|
|
59
|
+
title="subTotal"
|
|
60
|
+
value={formatCurrency(order.SubtotalAmount ?? 0)}
|
|
61
|
+
/>
|
|
62
|
+
<ListItem
|
|
63
|
+
title="shippingTotal"
|
|
64
|
+
value={formatCurrency(order.ShippingChargeAmount ?? 0)}
|
|
65
|
+
/>
|
|
66
|
+
<ListItem
|
|
67
|
+
title="taxTotal"
|
|
68
|
+
value={formatCurrency(order.TaxAmount ?? 0)}
|
|
69
|
+
/>
|
|
70
|
+
<ListItem
|
|
71
|
+
title="discountTotal"
|
|
72
|
+
value={formatCurrency(order.DiscountAmount ?? 0)}
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
<Divider sx={{ mb: 1 }} />
|
|
76
|
+
|
|
77
|
+
<FlexBetween mb={2}>
|
|
78
|
+
<H6>{t("total")}</H6>
|
|
79
|
+
<H6>{formatCurrency(order.TotalAmount ?? 0)}</H6>
|
|
80
|
+
</FlexBetween>
|
|
81
|
+
|
|
82
|
+
<Paragraph>{t("paidBy")}</Paragraph>
|
|
83
|
+
</Card>
|
|
84
|
+
</Grid>
|
|
85
|
+
</Grid>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import Card from "@mui/material/Card";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import Avatar from "@mui/material/Avatar";
|
|
4
|
+
import Box from "@mui/material/Box";
|
|
5
|
+
import Grid from "@mui/material/Grid2";
|
|
6
|
+
import { format } from "date-fns";
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { useTranslations } from "next-intl";
|
|
9
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
10
|
+
import {
|
|
11
|
+
H6,
|
|
12
|
+
Paragraph,
|
|
13
|
+
Span,
|
|
14
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
15
|
+
import {
|
|
16
|
+
FlexBetween,
|
|
17
|
+
FlexBox,
|
|
18
|
+
} from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
19
|
+
// CUSTOM UTILS LIBRARY FUNCTION
|
|
20
|
+
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
21
|
+
import { SalesLine, SalesOrder } from "@/api-manager/schemas/order.schema";
|
|
22
|
+
import { ProductDimensionType } from "@msdyn365-commerce/retail-proxy";
|
|
23
|
+
import buildDetailUrl from "@/lib/build-detail-url";
|
|
24
|
+
|
|
25
|
+
// ==============================================================
|
|
26
|
+
type Props = { order: SalesOrder };
|
|
27
|
+
// ==============================================================
|
|
28
|
+
|
|
29
|
+
export default function OrderedProducts({ order }: Props) {
|
|
30
|
+
const t = useTranslations("Account.OrderDetails");
|
|
31
|
+
const { formatCurrency } = useCurrencyFormatter();
|
|
32
|
+
|
|
33
|
+
const deliveredDate = "";
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Card sx={{ p: 0, mb: "30px" }}>
|
|
37
|
+
<FlexBetween px={3} py={2} flexWrap="wrap" bgcolor="grey.200">
|
|
38
|
+
<Item title="orderId" value={order?.ChannelReferenceId ?? ""} />
|
|
39
|
+
<Item
|
|
40
|
+
title="orderDate"
|
|
41
|
+
value={format(new Date(order?.TransactionDate ?? ""), "dd MMM, yyyy")}
|
|
42
|
+
/>
|
|
43
|
+
<Item
|
|
44
|
+
title="deliveredOn"
|
|
45
|
+
value={
|
|
46
|
+
deliveredDate
|
|
47
|
+
? format(new Date(deliveredDate), "dd MMM, yyyy")
|
|
48
|
+
: t("deliveredOnValue")
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
</FlexBetween>
|
|
52
|
+
|
|
53
|
+
<Grid
|
|
54
|
+
container
|
|
55
|
+
spacing={2}
|
|
56
|
+
padding={"20px 15px 10px"}
|
|
57
|
+
alignItems={"center"}
|
|
58
|
+
>
|
|
59
|
+
{order?.SalesLines?.map((item: SalesLine, index: number) => (
|
|
60
|
+
<Link
|
|
61
|
+
href={buildDetailUrl(
|
|
62
|
+
item?.Product?.Name ?? "",
|
|
63
|
+
item?.Product?.RecordId ?? 0,
|
|
64
|
+
)}
|
|
65
|
+
key={index}
|
|
66
|
+
style={{ display: "contents" }}
|
|
67
|
+
>
|
|
68
|
+
<Grid size={{ xs: 12, sm: 5 }}>
|
|
69
|
+
<FlexBox gap={2.5} alignItems="center" padding={"12px 15px"}>
|
|
70
|
+
<Avatar
|
|
71
|
+
alt={item?.Product?.Name}
|
|
72
|
+
src={item?.Product?.PrimaryImageUrl}
|
|
73
|
+
sx={{ height: 64, width: 64 }}
|
|
74
|
+
/>
|
|
75
|
+
<div>
|
|
76
|
+
<H6>{item?.Product?.Name}</H6>
|
|
77
|
+
<Paragraph color="grey.600">
|
|
78
|
+
{formatCurrency(item?.Price ?? 0)} x {item?.Quantity || 1}
|
|
79
|
+
</Paragraph>
|
|
80
|
+
</div>
|
|
81
|
+
</FlexBox>
|
|
82
|
+
</Grid>
|
|
83
|
+
|
|
84
|
+
<Grid size={{ xs: 8, sm: 4 }}>
|
|
85
|
+
{item.Product?.Dimensions?.length ? (
|
|
86
|
+
item.Product.Dimensions.map((dim, dimInd) => (
|
|
87
|
+
<Paragraph key={dimInd} paddingLeft={"15px"}>
|
|
88
|
+
<Span>
|
|
89
|
+
{ProductDimensionType[dim.DimensionTypeValue || 0]}:
|
|
90
|
+
</Span>
|
|
91
|
+
<Span sx={{ ml: 1 }}>{dim.DimensionValue?.Value}</Span>
|
|
92
|
+
</Paragraph>
|
|
93
|
+
))
|
|
94
|
+
) : (
|
|
95
|
+
<Box />
|
|
96
|
+
)}
|
|
97
|
+
</Grid>
|
|
98
|
+
|
|
99
|
+
<Grid size={{ xs: 4, sm: 3 }}>
|
|
100
|
+
<Box justifySelf={"end"}>
|
|
101
|
+
<Button variant="text" color="primary">
|
|
102
|
+
{t("writeReview")}
|
|
103
|
+
</Button>
|
|
104
|
+
</Box>
|
|
105
|
+
</Grid>
|
|
106
|
+
</Link>
|
|
107
|
+
))}
|
|
108
|
+
</Grid>
|
|
109
|
+
</Card>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function Item({ title, value }: { title: string; value: string }) {
|
|
114
|
+
const t = useTranslations("Account.OrderDetails");
|
|
115
|
+
return (
|
|
116
|
+
<FlexBox gap={1} alignItems="center">
|
|
117
|
+
<Paragraph color="grey.600">{t(title)}</Paragraph>
|
|
118
|
+
<Paragraph>{value}</Paragraph>
|
|
119
|
+
</FlexBox>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
|
2
|
+
import { vi } from "vitest";
|
|
3
|
+
import ProfileButton from "./profile-button";
|
|
4
|
+
import { getMsalInstance, initializeMsal, getRequestConfig } from "@/auth/msal";
|
|
5
|
+
|
|
6
|
+
vi.mock("@/auth/msal", () => ({
|
|
7
|
+
initializeMsal: vi.fn(),
|
|
8
|
+
getMsalInstance: vi.fn(),
|
|
9
|
+
getRequestConfig: vi.fn(),
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
vi.mock("@evenicanpm/storefront-core/src/components-v2/T/index", () => ({
|
|
13
|
+
default: ({ path }: { path: string }) => <span>{path}</span>,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
describe("ProfileButton Component", () => {
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
vi.restoreAllMocks();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("renders disabled button initially (MSAL not ready)", () => {
|
|
22
|
+
render(<ProfileButton type="edit" path="Account.Profile.btnEditProfile" />);
|
|
23
|
+
const button = screen.getByRole("button");
|
|
24
|
+
expect(button).toBeDisabled();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("initializes MSAL on mount", async () => {
|
|
28
|
+
render(<ProfileButton type="edit" path="Account.Profile.btnEditProfile" />);
|
|
29
|
+
await waitFor(() => {
|
|
30
|
+
expect(initializeMsal).toHaveBeenCalled();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("calls MSAL loginRedirect when clicked", async () => {
|
|
35
|
+
(initializeMsal as ReturnType<typeof vi.fn>).mockImplementation(() =>
|
|
36
|
+
Promise.resolve(),
|
|
37
|
+
);
|
|
38
|
+
(getRequestConfig as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
39
|
+
scopes: ["user.read"],
|
|
40
|
+
});
|
|
41
|
+
(getMsalInstance as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
42
|
+
loginRedirect: vi.fn(),
|
|
43
|
+
});
|
|
44
|
+
render(<ProfileButton type="edit" path="Account.Profile.btnEditProfile" />);
|
|
45
|
+
|
|
46
|
+
await waitFor(() => {
|
|
47
|
+
expect(initializeMsal).toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const button = screen.getByRole("button");
|
|
51
|
+
fireEvent.click(button);
|
|
52
|
+
|
|
53
|
+
await waitFor(() => {
|
|
54
|
+
expect(getMsalInstance().loginRedirect).toHaveBeenCalledWith({
|
|
55
|
+
scopes: ["user.read"],
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { getMsalInstance, initializeMsal, getRequestConfig } from "@/auth/msal";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Button } from "@mui/material";
|
|
6
|
+
import T from "@evenicanpm/storefront-core/src/components-v2/T/index";
|
|
7
|
+
import { RedirectRequest } from "@azure/msal-browser";
|
|
8
|
+
interface Props {
|
|
9
|
+
type: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ProfileButton = ({ type, path }: Props) => {
|
|
14
|
+
const [isMsalReady, setIsMsalReady] = useState(false);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const initMsal = async () => {
|
|
18
|
+
await initializeMsal();
|
|
19
|
+
setIsMsalReady(true);
|
|
20
|
+
};
|
|
21
|
+
initMsal();
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
const handleProfile = async () => {
|
|
25
|
+
if (!isMsalReady) {
|
|
26
|
+
console.error("MSAL is not initialized yet.");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const req = getRequestConfig(type);
|
|
32
|
+
await getMsalInstance().loginRedirect(req as RedirectRequest); // "handleRedirectPromise" is in user component.
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("Profile update through MSAL failed", error);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Button
|
|
40
|
+
onClick={() => handleProfile()}
|
|
41
|
+
disabled={!isMsalReady}
|
|
42
|
+
color="primary"
|
|
43
|
+
sx={{ bgcolor: "primary.light", px: 4 }}
|
|
44
|
+
>
|
|
45
|
+
<T path={path} />
|
|
46
|
+
</Button>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default ProfileButton;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
3
|
+
import { Theme } from "@mui/material/styles";
|
|
4
|
+
import Card from "@mui/material/Card";
|
|
5
|
+
import { useTranslations } from "next-intl";
|
|
6
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
7
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-box";
|
|
8
|
+
import {
|
|
9
|
+
Small,
|
|
10
|
+
Span,
|
|
11
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
12
|
+
// API
|
|
13
|
+
import { User } from "@/api-manager/schemas/user.schema";
|
|
14
|
+
type Props = {
|
|
15
|
+
user: User;
|
|
16
|
+
};
|
|
17
|
+
export default function UserInfo({ user }: Props) {
|
|
18
|
+
const downMd = useMediaQuery((theme: Theme) => theme.breakpoints.down("sm"));
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Card
|
|
22
|
+
sx={{
|
|
23
|
+
mt: 3,
|
|
24
|
+
display: "flex",
|
|
25
|
+
flexWrap: "wrap",
|
|
26
|
+
gap: "5rem",
|
|
27
|
+
p: "0.75rem 1.5rem",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "flex-start",
|
|
30
|
+
...(downMd && {
|
|
31
|
+
gap: "1rem",
|
|
32
|
+
alignItems: "start",
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
justifyContent: "flex-start",
|
|
35
|
+
}),
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<TableRowItem
|
|
39
|
+
title="labelFirstName"
|
|
40
|
+
value={_.capitalize(user?.FirstName)}
|
|
41
|
+
/>
|
|
42
|
+
<TableRowItem
|
|
43
|
+
title="labelLastName"
|
|
44
|
+
value={_.capitalize(user?.LastName)}
|
|
45
|
+
/>
|
|
46
|
+
<TableRowItem title="labelEmail" value={user?.Email ?? ""} />
|
|
47
|
+
</Card>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function TableRowItem({ title, value = "" }: { title: string; value: string }) {
|
|
52
|
+
const t = useTranslations("Account.Profile");
|
|
53
|
+
return (
|
|
54
|
+
<FlexBox flexDirection="column" p={1}>
|
|
55
|
+
<Small color="grey.600" mb={0.5}>
|
|
56
|
+
{t(title)}
|
|
57
|
+
</Small>
|
|
58
|
+
|
|
59
|
+
<Span>{value}</Span>
|
|
60
|
+
</FlexBox>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Card from "@mui/material/Card";
|
|
2
|
+
import styled from "@mui/material/styles/styled";
|
|
3
|
+
import NavLink from "@evenicanpm/storefront-core/src/components-v2/nav-link/nav-link";
|
|
4
|
+
|
|
5
|
+
export const MainContainer = styled(Card)(({ theme }) => ({
|
|
6
|
+
paddingBottom: "1.5rem",
|
|
7
|
+
[theme.breakpoints.down("md")]: {
|
|
8
|
+
boxShadow: "none",
|
|
9
|
+
overflowY: "auto",
|
|
10
|
+
height: "calc(100vh - 64px)",
|
|
11
|
+
},
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
export const StyledNavLink = styled(NavLink, {
|
|
15
|
+
shouldForwardProp: (prop) => prop !== "isCurrentPath",
|
|
16
|
+
})<{ isCurrentPath: boolean }>(({ theme, isCurrentPath }) => ({
|
|
17
|
+
display: "flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
borderLeft: "4px solid",
|
|
20
|
+
paddingLeft: "1.5rem",
|
|
21
|
+
paddingRight: "1.5rem",
|
|
22
|
+
marginBottom: "1.25rem",
|
|
23
|
+
justifyContent: "space-between",
|
|
24
|
+
borderColor: isCurrentPath ? theme.palette.primary.main : "transparent",
|
|
25
|
+
"& .nav-icon": {
|
|
26
|
+
color: isCurrentPath ? theme.palette.primary.main : theme.palette.grey[600],
|
|
27
|
+
},
|
|
28
|
+
"&:hover": {
|
|
29
|
+
borderColor: theme.palette.primary.main,
|
|
30
|
+
"& .nav-icon": { color: theme.palette.primary.main },
|
|
31
|
+
},
|
|
32
|
+
}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Card from "@mui/material/Card";
|
|
2
|
+
import styled from "@mui/material/styles/styled";
|
|
3
|
+
|
|
4
|
+
const TableRow = styled(Card)(({ theme }) => ({
|
|
5
|
+
gap: 16,
|
|
6
|
+
marginBlock: 16,
|
|
7
|
+
display: "grid",
|
|
8
|
+
borderRadius: 10,
|
|
9
|
+
cursor: "pointer",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
padding: ".6rem 1.2rem",
|
|
12
|
+
gridTemplateColumns: "1.5fr 2fr 1.5fr auto",
|
|
13
|
+
[theme.breakpoints.down("sm")]: {
|
|
14
|
+
gap: 8,
|
|
15
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
export default TableRow;
|