@evenicanpm/storefront-core 1.0.2 → 1.0.4
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/docs.tsconfig.json +35 -0
- package/package.json +6 -3
- 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/{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/product.schema.ts +0 -1
- 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/create-query.ts +10 -0
- package/src/api-manager/services/product/queries/get-product-availability.ts +1 -1
- package/src/api-manager/services/product/server/product.server.ts +4 -1
- package/src/api-manager/services/user/mutations/add-to-wishlist.ts +23 -3
- package/src/api-manager/services/user/mutations/remove-from-wishlist.ts +23 -0
- 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 +59 -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 +48 -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 +88 -0
- package/src/cms/blocks/Components/ProductSectionFullWidth/index.tsx +107 -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 +63 -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 +2 -2
- package/src/components/_components/wishlist/components/create-new-list.tsx +1 -1
- package/src/components/_components/wishlist/remove-from-wishlist-dialog.tsx +2 -2
- package/src/components/_components/wishlist-modal/add-to-wishlist-dialog.tsx +2 -2
- package/src/components/_components/wishlist-modal/remove-from-wishlist-dialog.tsx +2 -2
- 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/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 +106 -0
- package/src/components-v2/carousel/components/carousel-arrows.tsx +54 -0
- package/src/components-v2/carousel/components/carousel-dots.tsx +18 -0
- package/src/components-v2/carousel/index.ts +1 -0
- package/src/components-v2/carousel/styles/index.ts +93 -0
- package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +83 -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/categories/category-list/category-list.tsx +101 -0
- package/src/components-v2/categories/category-list/index.ts +1 -0
- package/src/components-v2/categories/category-list/styles.ts +35 -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 +53 -0
- package/src/components-v2/categories/mega-menu/banner.tsx +91 -0
- package/src/components-v2/categories/mega-menu/column-list.tsx +77 -0
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +55 -0
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +67 -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/countries-input.tsx +73 -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/header/components/categories-menu.tsx +23 -0
- package/src/components-v2/header/components/mobile-header.tsx +148 -0
- package/src/components-v2/header/components/user.test.tsx +200 -0
- package/src/components-v2/header/components/user.tsx +250 -0
- package/src/components-v2/header/header.tsx +83 -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 +49 -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 +81 -0
- package/src/components-v2/mini-cart/components/cart-item.tsx +205 -0
- package/src/components-v2/mini-cart/components/empty-view.tsx +69 -0
- package/src/components-v2/mini-cart/components/top-header.tsx +76 -0
- package/src/components-v2/mini-cart/index.ts +1 -0
- package/src/components-v2/mini-cart/mini-cart-trigger.tsx +99 -0
- package/src/components-v2/mini-cart/mini-cart.tsx +175 -0
- package/src/components-v2/mobile-navigation/index.ts +3 -0
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +118 -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 +81 -0
- package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +146 -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/index.ts +1 -0
- package/src/components-v2/navbar/mega-menu/mega-menu.tsx +138 -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.test.tsx +111 -0
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +141 -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 +141 -0
- package/src/components-v2/navbar/navbar.tsx +95 -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/no-records.tsx +20 -0
- package/src/components-v2/product-cards/discount-chip.tsx +43 -0
- package/src/components-v2/product-cards/product-card/components/hover-actions.tsx +37 -0
- package/src/components-v2/product-cards/product-card/components/quantity-buttons.tsx +65 -0
- package/src/components-v2/product-cards/product-card/index.ts +1 -0
- package/src/components-v2/product-cards/product-card/product-card.tsx +410 -0
- package/src/components-v2/product-cards/product-card/styles/index.ts +52 -0
- package/src/components-v2/product-cards/product-card-plp/components/quantity-buttons.tsx +54 -0
- package/src/components-v2/product-cards/product-card-plp/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-plp/product-card.tsx +161 -0
- package/src/components-v2/product-cards/product-card-plp/styles/index.ts +18 -0
- package/src/components-v2/product-cards/product-card-plp-list/components/add-to-cart.tsx +63 -0
- package/src/components-v2/product-cards/product-card-plp-list/components/favorite-button.tsx +27 -0
- package/src/components-v2/product-cards/product-card-plp-list/components/tags.tsx +33 -0
- package/src/components-v2/product-cards/product-card-plp-list/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-plp-list/product-card.tsx +219 -0
- package/src/components-v2/product-cards/product-card-search/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-search/product-card.tsx +166 -0
- package/src/components-v2/product-cards/product-card-search/styles/index.ts +61 -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-dialog/compound/product-dialog.tsx +225 -0
- package/src/components-v2/product-dialog/index.tsx +29 -0
- package/src/components-v2/product-dimensions/compound/dimensions-group-error.tsx +46 -0
- package/src/components-v2/product-dimensions/compound/dimensions-group-label.tsx +27 -0
- package/src/components-v2/product-dimensions/compound/dimensions-group-list-chip.tsx +78 -0
- package/src/components-v2/product-dimensions/compound/dimensions-group-list.tsx +24 -0
- package/src/components-v2/product-dimensions/compound/dimensions-group.tsx +55 -0
- package/src/components-v2/product-dimensions/compound/dimensions.tsx +81 -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/compound/quantity-buttons-root.tsx +181 -0
- package/src/components-v2/product-quantity-buttons/index.tsx +22 -0
- package/src/components-v2/product-quantity-variants/index.tsx +90 -0
- package/src/components-v2/products-view/compound/context.ts +25 -0
- package/src/components-v2/products-view/compound/products-grid-view.tsx +109 -0
- package/src/components-v2/products-view/compound/products-list-view.tsx +98 -0
- package/src/components-v2/products-view/compound/types.ts +12 -0
- package/src/components-v2/products-view/index.tsx +45 -0
- package/src/components-v2/products-view/products-grid-view.tsx +65 -0
- package/src/components-v2/products-view/products-list-view.tsx +66 -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-bar/compound/context.ts +31 -0
- package/src/components-v2/search-bar/compound/results-item-lg.tsx +43 -0
- package/src/components-v2/search-bar/compound/results-item-sm.tsx +48 -0
- package/src/components-v2/search-bar/compound/results-suspense.tsx +49 -0
- package/src/components-v2/search-bar/compound/results.tsx +42 -0
- package/src/components-v2/search-bar/compound/search-bar-root.tsx +64 -0
- package/src/components-v2/search-bar/compound/textfield-adornment-button.tsx +22 -0
- package/src/components-v2/search-bar/compound/textfield-adornment-category.tsx +83 -0
- package/src/components-v2/search-bar/compound/textfield-adornment-search-icon.tsx +34 -0
- package/src/components-v2/search-bar/compound/textfield.tsx +58 -0
- package/src/components-v2/search-bar/hooks/use-click-outside.ts +20 -0
- package/src/components-v2/search-bar/hooks/use-search.ts +63 -0
- package/src/components-v2/search-bar/index.tsx +36 -0
- package/src/components-v2/search-bar/styles/index.ts +49 -0
- package/src/components-v2/search-bar/utils/findCategoryNameById.ts +18 -0
- package/src/components-v2/section/compound/section-header.tsx +63 -0
- package/src/components-v2/section/compound/section.tsx +26 -0
- package/src/components-v2/section/index.ts +1 -0
- package/src/components-v2/side-nav/index.ts +1 -0
- package/src/components-v2/side-nav/side-nav.tsx +48 -0
- package/src/components-v2/site-logo.tsx +17 -0
- package/src/components-v2/sticky/index.ts +1 -0
- package/src/components-v2/sticky/sticky.tsx +62 -0
- package/src/components-v2/sticky/styles.ts +38 -0
- package/src/components-v2/utils/constants.ts +8 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/add-to-wishlist-button.tsx +69 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +35 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +79 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +41 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/context.ts +29 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-header.tsx +74 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +82 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +152 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/index.tsx +39 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/context.ts +2 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +42 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +92 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +96 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/create-wishlist-button.tsx +42 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/index.tsx +22 -0
- package/src/components-v2/wishlist-dialogs/styles.ts +61 -0
- package/src/hooks/{use-cart.tsx → use-cart.ts} +29 -23
- package/src/hooks/use-variants.ts +138 -0
- package/src/lib/build-detail-url.ts +2 -1
- package/src/pages/README.md +4 -0
- package/src/pages/product-details/product-intro/product-intro.tsx +29 -24
- package/src/pages/product-list/quick-view-dialog-content.tsx +22 -11
- 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/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 +64 -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/bopis/store-card/index.ts +1 -0
- package/src/pages-v2/product-details/bopis/store-card/shop-card.tsx +121 -0
- package/src/pages-v2/product-details/bopis/store-card/styles.ts +33 -0
- package/src/pages-v2/product-details/bopis/store-card/utils/convertSecondsToTime.ts +8 -0
- package/src/pages-v2/product-details/bopis/store-card/utils/getDaysResources.ts +25 -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/compound/context.ts +52 -0
- package/src/pages-v2/product-details/product-intro/compound/product-info.tsx +231 -0
- package/src/pages-v2/product-details/product-intro/compound/product-intro-images.tsx +124 -0
- package/src/pages-v2/product-details/product-intro/compound/product-intro.tsx +49 -0
- package/src/pages-v2/product-details/product-intro/compound/thumbnail-with-skeleton.tsx +28 -0
- package/src/pages-v2/product-details/product-intro/utils.ts +42 -0
- package/src/pages-v2/product-details/product-review.tsx +131 -0
- package/src/pages-v2/product-details/product-tabs.tsx +117 -0
- package/src/pages-v2/product-details/related-products.tsx +56 -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 +214 -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 +12 -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-variants.tsx +0 -85
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import Card from "@mui/material/Card";
|
|
2
|
+
|
|
3
|
+
import AccessTimeFilledIcon from "@mui/icons-material/AccessTimeFilled";
|
|
4
|
+
import Place from "@mui/icons-material/Place";
|
|
5
|
+
import InventoryIcon from "@mui/icons-material/Inventory";
|
|
6
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
7
|
+
import {
|
|
8
|
+
H3,
|
|
9
|
+
Span,
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
11
|
+
import {
|
|
12
|
+
FlexBetween,
|
|
13
|
+
FlexBox,
|
|
14
|
+
} from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
15
|
+
// STYLED COMPONENT
|
|
16
|
+
import { ContentWrapper } from "./styles";
|
|
17
|
+
import {
|
|
18
|
+
ProductWarehouseInventoryAvailability,
|
|
19
|
+
StoreHours,
|
|
20
|
+
} from "@msdyn365-commerce/retail-proxy";
|
|
21
|
+
import { buildStoreHours, IHoursDisplayInfo } from "@/lib/store-hours-helper";
|
|
22
|
+
import { Box } from "@mui/system";
|
|
23
|
+
import { convertSecondsToTime } from "./utils/convertSecondsToTime";
|
|
24
|
+
import { getDaysResources } from "./utils/getDaysResources";
|
|
25
|
+
|
|
26
|
+
type Props = {
|
|
27
|
+
name: string;
|
|
28
|
+
address: string;
|
|
29
|
+
actionArea: React.ReactNode;
|
|
30
|
+
openFrom: number;
|
|
31
|
+
openTo: number;
|
|
32
|
+
storeHours: StoreHours;
|
|
33
|
+
inventoryRecord: ProductWarehouseInventoryAvailability | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default function ShopCard(props: Props) {
|
|
37
|
+
const { name, address, actionArea, openFrom, openTo, storeHours } =
|
|
38
|
+
props || {};
|
|
39
|
+
|
|
40
|
+
const resources = getDaysResources();
|
|
41
|
+
|
|
42
|
+
const renderStoreHours = () => {
|
|
43
|
+
if (storeHours?.RegularStoreHours) {
|
|
44
|
+
const storeHoursList: IHoursDisplayInfo[] = buildStoreHours(
|
|
45
|
+
storeHours.RegularStoreHours,
|
|
46
|
+
resources,
|
|
47
|
+
);
|
|
48
|
+
return (
|
|
49
|
+
<Box>
|
|
50
|
+
{storeHoursList.map((displayTime) => (
|
|
51
|
+
<Box key={JSON.stringify(displayTime)}>
|
|
52
|
+
{displayTime.endDayShort ? (
|
|
53
|
+
<Box>
|
|
54
|
+
<Span>
|
|
55
|
+
<abbr title={displayTime.startDayFull}>
|
|
56
|
+
{displayTime.startDayShort}
|
|
57
|
+
</abbr>
|
|
58
|
+
</Span>
|
|
59
|
+
–
|
|
60
|
+
<Span>
|
|
61
|
+
<abbr title={displayTime.endDayFull}>
|
|
62
|
+
{displayTime.endDayShort}
|
|
63
|
+
</abbr>
|
|
64
|
+
</Span>
|
|
65
|
+
</Box>
|
|
66
|
+
) : (
|
|
67
|
+
<Box>
|
|
68
|
+
<Span>
|
|
69
|
+
<abbr title={displayTime.startDayFull}>
|
|
70
|
+
{displayTime.startDayShort}
|
|
71
|
+
</abbr>
|
|
72
|
+
</Span>
|
|
73
|
+
</Box>
|
|
74
|
+
)}
|
|
75
|
+
<Box>{displayTime.timeRange}</Box>
|
|
76
|
+
</Box>
|
|
77
|
+
))}
|
|
78
|
+
</Box>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
return (
|
|
82
|
+
<Span color="white">
|
|
83
|
+
{convertSecondsToTime(openFrom)} - {convertSecondsToTime(openTo)}
|
|
84
|
+
</Span>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Card sx={{ marginBottom: 2 }}>
|
|
90
|
+
<ContentWrapper img={""}>
|
|
91
|
+
<H3 fontWeight="600" mb={1}>
|
|
92
|
+
{name}
|
|
93
|
+
</H3>
|
|
94
|
+
|
|
95
|
+
<FlexBox mb={1} gap={1}>
|
|
96
|
+
<Place fontSize="small" sx={{ fontSize: 17, mt: "3px" }} />
|
|
97
|
+
<Span color="white">{address}</Span>
|
|
98
|
+
</FlexBox>
|
|
99
|
+
|
|
100
|
+
<FlexBox alignItems="center" gap={1}>
|
|
101
|
+
<AccessTimeFilledIcon
|
|
102
|
+
fontSize="small"
|
|
103
|
+
sx={{ fontSize: 17, mt: "3px" }}
|
|
104
|
+
/>
|
|
105
|
+
{renderStoreHours()}
|
|
106
|
+
</FlexBox>
|
|
107
|
+
|
|
108
|
+
<FlexBox my={1} gap={1}>
|
|
109
|
+
<InventoryIcon fontSize="small" sx={{ fontSize: 17, mt: "3px" }} />
|
|
110
|
+
<Span color="white">
|
|
111
|
+
{props.inventoryRecord?.TotalAvailableInventoryLevelLabel}
|
|
112
|
+
</Span>
|
|
113
|
+
</FlexBox>
|
|
114
|
+
</ContentWrapper>
|
|
115
|
+
|
|
116
|
+
<FlexBetween pl={3} pr={1} justifyContent={"flex-end"}>
|
|
117
|
+
{actionArea}
|
|
118
|
+
</FlexBetween>
|
|
119
|
+
</Card>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Avatar from "@mui/material/Avatar";
|
|
4
|
+
import IconButton from "@mui/material/IconButton";
|
|
5
|
+
import { alpha, styled } from "@mui/material/styles";
|
|
6
|
+
|
|
7
|
+
// STYLED COMPONENT
|
|
8
|
+
export const ContentWrapper = styled("div", {
|
|
9
|
+
shouldForwardProp: (prop) => prop !== "img",
|
|
10
|
+
})<{ img: string }>(({ theme, img }) => ({
|
|
11
|
+
color: "white",
|
|
12
|
+
backgroundSize: "cover",
|
|
13
|
+
padding: "17px 30px 56px",
|
|
14
|
+
backgroundPosition: "center",
|
|
15
|
+
backgroundImage: `linear-gradient(to bottom,
|
|
16
|
+
${alpha(theme.palette.grey[900], 0.8)}, ${alpha(theme.palette.grey[900], 0.8)}),
|
|
17
|
+
url(${img})`,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const StyledAvatar = styled(Avatar)(({ theme }) => ({
|
|
21
|
+
width: 64,
|
|
22
|
+
height: 64,
|
|
23
|
+
marginTop: "-32px",
|
|
24
|
+
border: `3px solid ${theme.palette.grey[100]}`,
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
export const StyledIconButton = styled(IconButton)(({ theme }) => ({
|
|
28
|
+
marginBlock: 4,
|
|
29
|
+
".icon": {
|
|
30
|
+
fontSize: 19,
|
|
31
|
+
transform: theme.direction === "rtl" ? "180deg" : "0deg",
|
|
32
|
+
},
|
|
33
|
+
}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IStoreSelectorLocationLineItemResources } from "@/lib/store-hours-helper";
|
|
2
|
+
import { useTranslations } from "next-intl";
|
|
3
|
+
|
|
4
|
+
export const getDaysResources = (): IStoreSelectorLocationLineItemResources => {
|
|
5
|
+
const daysTrans = useTranslations("StoreHours");
|
|
6
|
+
return {
|
|
7
|
+
days: {
|
|
8
|
+
monday: daysTrans("mon"),
|
|
9
|
+
tuesday: daysTrans("tue"),
|
|
10
|
+
wednesday: daysTrans("wed"),
|
|
11
|
+
thursday: daysTrans("thu"),
|
|
12
|
+
friday: daysTrans("fri"),
|
|
13
|
+
saturday: daysTrans("sat"),
|
|
14
|
+
sunday: daysTrans("sun"),
|
|
15
|
+
mondayFull: daysTrans("monday"),
|
|
16
|
+
tuesdayFull: daysTrans("tuesday"),
|
|
17
|
+
wednesdayFull: daysTrans("wednesday"),
|
|
18
|
+
thursdayFull: daysTrans("thursday"),
|
|
19
|
+
fridayFull: daysTrans("friday"),
|
|
20
|
+
saturdayFull: daysTrans("saturday"),
|
|
21
|
+
sundayFull: daysTrans("sunday"),
|
|
22
|
+
},
|
|
23
|
+
closedText: daysTrans("closed"),
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
// MUI
|
|
3
|
+
import FormControlLabel from "@mui/material/FormControlLabel";
|
|
4
|
+
import Checkbox, { CheckboxProps } from "@mui/material/Checkbox";
|
|
5
|
+
|
|
6
|
+
// ==============================================================
|
|
7
|
+
interface Props extends CheckboxProps {
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
// ==============================================================
|
|
11
|
+
|
|
12
|
+
export default function CheckboxLabel({ label, ...props }: Props) {
|
|
13
|
+
return (
|
|
14
|
+
<FormControlLabel
|
|
15
|
+
label={label}
|
|
16
|
+
control={<Checkbox size="small" color="primary" {...props} />}
|
|
17
|
+
slotProps={{ typography: { fontSize: 14, lineHeight: 1 } }}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import currencyJs from "currency.js";
|
|
2
|
+
import { formatDistanceStrict } from "date-fns";
|
|
3
|
+
/**
|
|
4
|
+
* NOTE: We can move this to a more appropriate location if needed.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* GET THE DIFFERENCE DATE FORMAT
|
|
9
|
+
* @param DATE | NUMBER | STRING
|
|
10
|
+
* @returns FORMATTED DATE STRING
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function getDateDifference(date: string | number | Date) {
|
|
14
|
+
const distance = formatDistanceStrict(new Date(), new Date(date));
|
|
15
|
+
return distance + " ago";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* RENDER THE PRODUCT PAGINATION INFO
|
|
20
|
+
* @param page - CURRENT PAGE NUMBER
|
|
21
|
+
* @param perPageProduct - PER PAGE PRODUCT LIST
|
|
22
|
+
* @param totalProduct - TOTAL PRODUCT NUMBER
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
function renderProductCount(
|
|
27
|
+
page: number,
|
|
28
|
+
perPageProduct: number,
|
|
29
|
+
totalProduct: number,
|
|
30
|
+
) {
|
|
31
|
+
const startNumber = (page - 1) * perPageProduct;
|
|
32
|
+
let endNumber = page * perPageProduct;
|
|
33
|
+
|
|
34
|
+
if (endNumber > totalProduct) {
|
|
35
|
+
endNumber = totalProduct;
|
|
36
|
+
}
|
|
37
|
+
return `Showing ${startNumber - 1}-${endNumber} of ${totalProduct} products`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* CALCULATE PRICE WITH PRODUCT DISCOUNT THEN RETURN NEW PRODUCT PRICES
|
|
42
|
+
* @param price - PRODUCT PRICE
|
|
43
|
+
* @param discount - DISCOUNT PERCENT
|
|
44
|
+
* @returns - RETURN NEW PRICE
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
function calculateDiscount(price: number, discount: number) {
|
|
48
|
+
const afterDiscount = Number((price - price * (discount / 100)).toFixed(2));
|
|
49
|
+
return currency(afterDiscount);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* CHANGE THE CURRENCY FORMAT
|
|
54
|
+
* @param price - PRODUCT PRICE
|
|
55
|
+
* @param fraction - HOW MANY FRACTION WANT TO SHOW
|
|
56
|
+
* @returns - RETURN PRICE WITH CURRENCY
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
function currency(price: number, fraction = 2) {
|
|
60
|
+
const formatCurrency = currencyJs(price).format({ precision: fraction });
|
|
61
|
+
return formatCurrency;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { currency, getDateDifference, calculateDiscount, renderProductCount };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Fragment } from "react";
|
|
4
|
+
import Box from "@mui/material/Box";
|
|
5
|
+
import Button from "@mui/material/Button";
|
|
6
|
+
import styled from "@mui/material/styles/styled";
|
|
7
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
8
|
+
import {
|
|
9
|
+
H2,
|
|
10
|
+
H3,
|
|
11
|
+
Span,
|
|
12
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
13
|
+
import {
|
|
14
|
+
FlexBox,
|
|
15
|
+
FlexRowCenter,
|
|
16
|
+
} from "@evenicanpm/storefront-core/src/components-v2/flex-box";
|
|
17
|
+
// LOCAL CUSTOM COMPONENT
|
|
18
|
+
import FrequentlyProductCard from "./frequently-product-card";
|
|
19
|
+
// CUSTOM UTILS LIBRARY FUNCTION
|
|
20
|
+
import { currency } from "@/lib/lib";
|
|
21
|
+
// CUSTOM DATA MODEL
|
|
22
|
+
import { ProductSearchResult as Product } from "@msdyn365-commerce/retail-proxy";
|
|
23
|
+
|
|
24
|
+
// STYLED COMPONENTS
|
|
25
|
+
const WrapperBox = styled(Box)(({ theme }) => ({
|
|
26
|
+
[theme.breakpoints.down("sm")]: {
|
|
27
|
+
"& .card-holder": { flexDirection: "column" },
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
// ============================================================
|
|
32
|
+
type Props = { products: Product[] };
|
|
33
|
+
// ============================================================
|
|
34
|
+
|
|
35
|
+
export default function FrequentlyBought({ products }: Props) {
|
|
36
|
+
return (
|
|
37
|
+
<WrapperBox mb={7.5}>
|
|
38
|
+
<H3 mb={3}>Frequently Bought Together</H3>
|
|
39
|
+
|
|
40
|
+
<FlexBox className="card-holder" flexWrap="wrap" m={-1}>
|
|
41
|
+
{products.map((item, ind) => (
|
|
42
|
+
<Fragment key={item.RecordId}>
|
|
43
|
+
<FrequentlyProductCard
|
|
44
|
+
id={item.RecordId}
|
|
45
|
+
key={item.RecordId}
|
|
46
|
+
slug={item.ItemId ?? ""}
|
|
47
|
+
price={item.Price}
|
|
48
|
+
title={item.Name ?? ""}
|
|
49
|
+
imgUrl={item.PrimaryImageUrl ?? ""}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
{ind < products.length - 1 && (
|
|
53
|
+
<FlexRowCenter>
|
|
54
|
+
<H2 color="grey.600" mx={1}>
|
|
55
|
+
+
|
|
56
|
+
</H2>
|
|
57
|
+
</FlexRowCenter>
|
|
58
|
+
)}
|
|
59
|
+
</Fragment>
|
|
60
|
+
))}
|
|
61
|
+
|
|
62
|
+
<FlexRowCenter>
|
|
63
|
+
<H2 color="grey.600" mx={3}>
|
|
64
|
+
=
|
|
65
|
+
</H2>
|
|
66
|
+
</FlexRowCenter>
|
|
67
|
+
|
|
68
|
+
<FlexRowCenter
|
|
69
|
+
m={1}
|
|
70
|
+
minWidth={300}
|
|
71
|
+
minHeight={200}
|
|
72
|
+
border="1px solid"
|
|
73
|
+
borderRadius="8px"
|
|
74
|
+
className="gray-box"
|
|
75
|
+
borderColor="grey.400"
|
|
76
|
+
flexDirection="column"
|
|
77
|
+
>
|
|
78
|
+
<H3 color="primary.main">{currency(2500)}</H3>
|
|
79
|
+
|
|
80
|
+
<Span mb={2} fontWeight="600" color="grey.600">
|
|
81
|
+
Save {currency(500)}
|
|
82
|
+
</Span>
|
|
83
|
+
|
|
84
|
+
<FlexBox gap={1.5}>
|
|
85
|
+
<Button variant="contained" color="primary">
|
|
86
|
+
Add to Cart
|
|
87
|
+
</Button>
|
|
88
|
+
|
|
89
|
+
<Button variant="outlined" color="primary">
|
|
90
|
+
Add to List
|
|
91
|
+
</Button>
|
|
92
|
+
</FlexBox>
|
|
93
|
+
</FlexRowCenter>
|
|
94
|
+
</FlexBox>
|
|
95
|
+
</WrapperBox>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Link from "next/link";
|
|
2
|
+
import Box from "@mui/material/Box";
|
|
3
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components-v2/HoverBox";
|
|
5
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components-v2/LazyImage";
|
|
6
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components-v2/BazaarCard";
|
|
7
|
+
import {
|
|
8
|
+
H6,
|
|
9
|
+
Span,
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
11
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-box";
|
|
12
|
+
// CUSTOM UTILS LIBRARY FUNCTIONS
|
|
13
|
+
import { calculateDiscount, currency } from "@/lib/lib";
|
|
14
|
+
|
|
15
|
+
// =======================================================
|
|
16
|
+
interface Props {
|
|
17
|
+
slug: string;
|
|
18
|
+
price: number;
|
|
19
|
+
title: string;
|
|
20
|
+
imgUrl: string;
|
|
21
|
+
id: string | number;
|
|
22
|
+
}
|
|
23
|
+
// =======================================================
|
|
24
|
+
|
|
25
|
+
export default function FrequentlyProductCard(props: Props) {
|
|
26
|
+
const {
|
|
27
|
+
imgUrl = "/assets/images/products/Rectangle 116.png",
|
|
28
|
+
price,
|
|
29
|
+
title,
|
|
30
|
+
slug,
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<BazaarCard
|
|
35
|
+
sx={{
|
|
36
|
+
p: 2,
|
|
37
|
+
width: "100%",
|
|
38
|
+
flex: "1 1 0",
|
|
39
|
+
minWidth: "160px",
|
|
40
|
+
margin: { xs: 0, sm: 1 },
|
|
41
|
+
maxWidth: { xs: "100%", sm: "220px" },
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<Link href={`/products/${slug}`}>
|
|
45
|
+
<HoverBox mb={1.5} borderRadius="8px">
|
|
46
|
+
<LazyImage alt={title} width={500} height={500} src={imgUrl} />
|
|
47
|
+
</HoverBox>
|
|
48
|
+
|
|
49
|
+
<Span title={title} mb={0.5} color="inherit" ellipsis display="block">
|
|
50
|
+
{title}
|
|
51
|
+
</Span>
|
|
52
|
+
|
|
53
|
+
<FlexBox alignItems="center" gap={1}>
|
|
54
|
+
<H6 color="primary.main">{currency(price)}</H6>
|
|
55
|
+
|
|
56
|
+
<Box component="del" fontWeight={600} color="grey.600">
|
|
57
|
+
{calculateDiscount(price, 35)}
|
|
58
|
+
</Box>
|
|
59
|
+
</FlexBox>
|
|
60
|
+
</Link>
|
|
61
|
+
</BazaarCard>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import Avatar from "@mui/material/Avatar";
|
|
5
|
+
import Rating from "@mui/material/Rating";
|
|
6
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
7
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components-v2/flex-box";
|
|
8
|
+
import {
|
|
9
|
+
H5,
|
|
10
|
+
H6,
|
|
11
|
+
Paragraph,
|
|
12
|
+
Span,
|
|
13
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
14
|
+
// CUSTOM UTILS LIBRARY FUNCTION
|
|
15
|
+
import { getDateDifference } from "@/lib/lib";
|
|
16
|
+
|
|
17
|
+
// ===========================================================
|
|
18
|
+
interface Props {
|
|
19
|
+
name: string;
|
|
20
|
+
date: string;
|
|
21
|
+
imgUrl: string;
|
|
22
|
+
rating: number;
|
|
23
|
+
comment: string;
|
|
24
|
+
}
|
|
25
|
+
// ===========================================================
|
|
26
|
+
|
|
27
|
+
export default function ProductComment(props: Props) {
|
|
28
|
+
const { name, imgUrl, rating, date, comment } = props || {};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Box mb={4} maxWidth={600}>
|
|
32
|
+
<FlexBox alignItems="center" mb={2} gap={2}>
|
|
33
|
+
<Avatar alt={name} src={imgUrl} sx={{ width: 48, height: 48 }} />
|
|
34
|
+
|
|
35
|
+
<div>
|
|
36
|
+
<H5 mb={1}>{name}</H5>
|
|
37
|
+
|
|
38
|
+
<FlexBox alignItems="center" gap={1.25}>
|
|
39
|
+
<Rating size="small" value={rating} color="warn" readOnly />
|
|
40
|
+
<H6>{rating}</H6>
|
|
41
|
+
<Span>{getDateDifference(date)}</Span>
|
|
42
|
+
</FlexBox>
|
|
43
|
+
</div>
|
|
44
|
+
</FlexBox>
|
|
45
|
+
|
|
46
|
+
<Paragraph color="grey.700">{comment}</Paragraph>
|
|
47
|
+
</Box>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { H3 } from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
4
|
+
import { AttributeValue } from "@msdyn365-commerce/retail-proxy";
|
|
5
|
+
|
|
6
|
+
type Props = { attributes: AttributeValue[] };
|
|
7
|
+
|
|
8
|
+
export default function ProductDescription({ attributes }: Props) {
|
|
9
|
+
return (
|
|
10
|
+
<div>
|
|
11
|
+
<H3 mb={2}>Specifications:</H3>
|
|
12
|
+
{attributes?.map((attr, index) => {
|
|
13
|
+
if (attr?.TextValue && attr?.Name)
|
|
14
|
+
return (
|
|
15
|
+
<div key={index}>
|
|
16
|
+
{attr.Name}: {attr.TextValue}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
})}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|