@evenicanpm/storefront-core 1.8.1 → 2.0.0
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 +5 -5
- package/package.json +3 -3
- package/src/api-manager/datasources/d365/d365-cart.datasource.ts +13 -8
- package/src/api-manager/datasources/d365/d365-product.datasource.ts +7 -4
- package/src/api-manager/datasources/e4/cart/e4-cart.datasource.ts +7 -5
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +3 -3
- package/src/api-manager/datasources/e4/product/e4-product.translator.ts +3 -1
- package/src/api-manager/index.ts +3 -4
- package/src/api-manager/lib/category-helpers.ts +1 -1
- package/src/auth/auth-options.test.ts +1 -1
- package/src/auth/msal.ts +1 -1
- package/src/auth/providers/entra-external-id-provider.ts +1 -1
- package/src/auth/providers/index.ts +1 -1
- package/src/cms/blocks/components/category-carousel/index.tsx +3 -3
- package/src/cms/blocks/components/footer/index.tsx +1 -1
- package/src/cms/blocks/components/footer/sections/footer-app-store.tsx +1 -1
- package/src/cms/blocks/components/footer/sections/footer-contact.tsx +1 -1
- package/src/cms/blocks/components/footer/sections/footer-logo.tsx +2 -2
- package/src/cms/blocks/components/footer/sections/footer-social-links.tsx +7 -2
- package/src/cms/blocks/components/hero-carousel/index.tsx +2 -2
- package/src/cms/blocks/components/product-carousel/index.tsx +3 -3
- package/src/cms/blocks/components/product-section-fullwidth/index.tsx +4 -4
- package/src/cms/blocks/components/services/service-card.tsx +1 -1
- package/src/cms/blocks/components/shared/featured-product-card.tsx +3 -3
- package/src/cms/blocks/components/shared/product-category-item.tsx +3 -3
- package/src/cms/blocks/components/shared/product-grid.tsx +2 -2
- package/src/cms/blocks/components/shared/top-categories-card.tsx +2 -2
- package/src/cms/blocks/components/shared/top-rating-product-card.tsx +4 -4
- package/src/cms/blocks/icons/components/category.tsx +1 -0
- package/src/cms/blocks/icons/components/dotted-star.tsx +1 -0
- package/src/cms/blocks/icons/components/gift-box.tsx +1 -0
- package/src/cms/blocks/icons/components/light.tsx +1 -0
- package/src/cms/blocks/icons/components/new-arrival.tsx +1 -0
- package/src/cms/blocks/icons/components/rank-badge.tsx +1 -0
- package/src/cms/blocks/icons/index.ts +1 -6
- package/src/{components-v2 → components}/BazaarTextField.tsx +1 -1
- package/src/{components-v2 → components}/DropZone.tsx +2 -1
- package/src/{components-v2 → components}/ImageWithFallback.tsx +1 -1
- package/src/components/_tests_/BazaarCard.test.tsx +16 -0
- package/src/components/_tests_/BazaarImage.test.tsx +18 -0
- package/src/components/_tests_/BazaarMenu.test.tsx +46 -0
- package/src/components/_tests_/BazaarSwitch.test.tsx +17 -0
- package/src/components/_tests_/BazaarTextField.test.tsx +22 -0
- package/src/components/_tests_/BoxShadowCard.test.tsx +14 -0
- package/src/components/_tests_/DropZone.test.tsx +51 -0
- package/src/components/_tests_/HoverBox.test.tsx +9 -0
- package/src/components/_tests_/Image.test.tsx +12 -0
- package/src/components/_tests_/ImageWithFallback.test.tsx +76 -0
- package/src/components/_tests_/LazyImage.test.tsx +32 -0
- package/src/components/_tests_/Loading.test.tsx +15 -0
- package/src/components/_tests_/SearchInput.test.tsx +14 -0
- package/src/components/_tests_/SnackbarProvider.test.tsx +22 -0
- package/src/components/_tests_/Typography.test.tsx +53 -0
- package/src/components/_tests_/WhiteButton.test.tsx +20 -0
- package/src/components/_tests_/countries-input.test.tsx +39 -0
- package/src/components/_tests_/no-records.test.tsx +14 -0
- package/src/components/_tests_/site-logo.test.tsx +29 -0
- package/src/{components-v2 → components}/accordion/accordion-header.tsx +1 -1
- package/src/{components-v2 → components}/accordion/index.ts +1 -1
- package/src/{components-v2 → components}/carousel/carousel.tsx +3 -3
- package/src/{components-v2 → components}/carousel/components/carousel-arrows.tsx +1 -1
- package/src/{components-v2 → components}/carousel/components/carousel-dots.tsx +1 -1
- package/src/{components-v2 → components}/carousel/index.ts +1 -1
- package/src/{components-v2 → components}/carousel-cards/carousel-card-1/carousel-card-1.tsx +3 -3
- package/src/components/carousel-cards/carousel-card-1/index.ts +1 -0
- package/src/{components-v2 → components}/categories/Categories.stories.tsx +1 -1
- package/src/{components-v2 → components}/categories/__tests__/category-menu.test.tsx +1 -1
- package/src/{components-v2 → components}/categories/category-list/category-list.tsx +4 -4
- package/src/{components-v2/navbar/mega-menu → components/categories/category-list}/index.ts +1 -1
- package/src/{components-v2 → components}/categories/category-list/styles.ts +1 -1
- package/src/{components-v2 → components}/categories/category-list-item/category-menu-item.tsx +1 -1
- package/src/components/categories/category-list-item/index.ts +1 -0
- package/src/{components-v2 → components}/categories/category-menu.tsx +1 -1
- package/src/{components-v2 → components}/categories/mega-menu/banner.tsx +3 -3
- package/src/{components-v2 → components}/categories/mega-menu/column-list.tsx +4 -4
- package/src/{components-v2 → components}/categories/mega-menu/mega-menu-1.tsx +3 -3
- package/src/{components-v2 → components}/categories/mega-menu/mega-menu-2.tsx +4 -4
- package/src/{components-v2 → components}/flex-box/__tests__/flex-box.test.tsx +6 -8
- package/src/components/flex-box/index.ts +5 -0
- package/src/{components-v2 → components}/header/__tests__/header.test.tsx +8 -4
- package/src/{components-v2 → components}/header/__tests__/user.test.tsx +1 -1
- package/src/{components-v2 → components}/header/components/categories-menu.tsx +3 -3
- package/src/{components-v2 → components}/header/components/mobile-header.tsx +11 -11
- package/src/{components-v2 → components}/header/components/user.tsx +3 -3
- package/src/{components-v2 → components}/header/header.tsx +6 -6
- package/src/{components-v2 → components}/header/index.ts +1 -1
- package/src/{components-v2 → components}/header/sticky-header.tsx +3 -3
- package/src/{components-v2 → components}/icons/cart-bag.tsx +1 -0
- package/src/{components-v2 → components}/icons/category-outline.tsx +1 -0
- package/src/{components-v2 → components}/icons/category.tsx +1 -0
- package/src/{components-v2 → components}/icons/home.tsx +1 -0
- package/src/{components-v2 → components}/icons/search.tsx +1 -0
- package/src/{components-v2 → components}/icons/shopping-bag-outlined.tsx +1 -0
- package/src/{components-v2 → components}/icons/up-down.tsx +1 -0
- package/src/{components-v2 → components}/icons/user.tsx +1 -0
- package/src/{components-v2 → components}/icons/user2.tsx +1 -0
- package/src/{components-v2 → components}/mini-cart/components/cart-item.tsx +2 -2
- package/src/{components-v2 → components}/mini-cart/components/empty-view.tsx +2 -2
- package/src/{components-v2 → components}/mini-cart/components/top-header.tsx +2 -2
- package/src/{components-v2 → components}/mini-cart/index.ts +1 -1
- package/src/{components-v2 → components}/mini-cart/mini-cart-trigger.tsx +3 -5
- package/src/{components-v2 → components}/mini-cart/mini-cart.tsx +5 -5
- package/src/{components-v2 → components}/mobile-navigation/MobileNavigationBar.stories.tsx +2 -2
- package/src/{components-v2 → components}/mobile-navigation/index.ts +1 -1
- package/src/{components-v2 → components}/mobile-navigation/mobile-navigation-bar.tsx +5 -5
- package/src/{components-v2 → components}/mobile-navigation/styles/index.ts +2 -2
- package/src/{components-v2 → components}/nav-link/__tests__/nav-link.test.tsx +2 -1
- package/src/{components-v2 → components}/nav-link/index.ts +3 -3
- package/src/{components-v2 → components}/nav-link/nav-link-2.tsx +1 -1
- package/src/{components-v2 → components}/nav-link/nav-link-3.tsx +1 -1
- package/src/{components-v2 → components}/nav-link/nav-link.tsx +26 -10
- package/src/{components-v2 → components}/navbar/__tests__/navbar.test.tsx +4 -7
- package/src/{components-v2 → components}/navbar/categories.tsx +4 -4
- package/src/{components-v2 → components}/navbar/category-based-menu/category-based-menu.tsx +5 -5
- package/src/components/navbar/category-based-menu/index.ts +1 -0
- package/src/{components-v2 → components}/navbar/category-based-menu/styles.ts +4 -4
- package/src/{components-v2 → components}/navbar/index.ts +1 -1
- package/src/components/navbar/mega-menu/index.ts +1 -0
- package/src/{components-v2 → components}/navbar/mega-menu/mega-menu.tsx +3 -3
- package/src/{components-v2 → components}/navbar/mega-menu/styles.ts +1 -1
- package/src/{components-v2 → components}/navbar/mobile-menu/index.ts +1 -1
- package/src/{components-v2 → components}/navbar/mobile-menu/mobile-menu.test.tsx +2 -2
- package/src/{components-v2 → components}/navbar/mobile-menu/mobile-menu.tsx +4 -4
- package/src/{components-v2 → components}/navbar/nav-list/cms-nav.test.tsx +1 -1
- package/src/components/navbar/nav-list/index.ts +1 -0
- package/src/{components-v2 → components}/navbar/nav-list/nav-item-child.tsx +4 -4
- package/src/{components-v2 → components}/navbar/nav-list/nav-list.tsx +8 -8
- package/src/{components-v2 → components}/navbar/navbar.tsx +3 -3
- package/src/{components-v2 → components}/navbar/styles.ts +2 -2
- package/src/{components-v2 → components}/navbar/utils/transform-nav.test.ts +1 -1
- package/src/{components-v2 → components}/no-records.tsx +1 -1
- package/src/{components-v2/navbar/nav-list → components/product-cards/product-card}/index.ts +1 -1
- package/src/{components-v2 → components}/product-cards/product-card/product-card.tsx +11 -11
- package/src/{components-v2 → components}/product-cards/product-card/styles/index.ts +1 -1
- package/src/{components-v2/categories/category-list → components/product-cards/product-card-plp}/index.ts +1 -1
- package/src/{components-v2 → components}/product-cards/product-card-plp/product-card.tsx +9 -9
- package/src/components/product-cards/product-card-plp-list/index.ts +1 -0
- package/src/{components-v2 → components}/product-cards/product-card-plp-list/product-card.tsx +9 -9
- package/src/components/product-cards/product-card-search/index.ts +1 -0
- package/src/{components-v2 → components}/product-cards/product-card-search/product-card.tsx +7 -7
- package/src/{components-v2 → components}/product-cards/product-price.tsx +2 -2
- package/src/{components-v2 → components}/product-cards/product-rating.tsx +2 -2
- package/src/{components-v2 → components}/product-cards/product-title.tsx +1 -1
- package/src/{components-v2 → components}/product-cards/quantity-buttons.tsx +2 -2
- package/src/{components-v2 → components}/product-dialog/__tests__/product-dialog.test.tsx +1 -1
- package/src/{components-v2 → components}/product-dialog/compound/product-dialog.tsx +5 -5
- package/src/{components-v2 → components}/product-dialog/index.tsx +1 -1
- package/src/{components-v2 → components}/product-dimensions/__tests__/product-dimensions.test.tsx +2 -2
- package/src/{components-v2 → components}/product-dimensions/compound/dimensions-group-error.tsx +4 -4
- package/src/{components-v2 → components}/product-dimensions/compound/dimensions-group-label.tsx +2 -2
- package/src/{components-v2 → components}/product-dimensions/compound/dimensions-group-list-chip.tsx +1 -1
- package/src/{components-v2 → components}/product-dimensions/compound/dimensions-group-list.tsx +2 -2
- package/src/{components-v2 → components}/product-dimensions/compound/dimensions-group.tsx +3 -3
- package/src/{components-v2 → components}/product-dimensions/compound/dimensions.tsx +1 -1
- package/src/{components-v2 → components}/product-dimensions/index.tsx +1 -1
- package/src/{components-v2 → components}/product-quantity-buttons/__tests__/product-quantity-buttons.test.tsx +10 -1
- package/src/{components-v2 → components}/product-quantity-buttons/compound/quantity-buttons-root.tsx +2 -2
- package/src/{components-v2 → components}/product-quantity-buttons/index.tsx +1 -1
- package/src/{components-v2 → components}/product-quantity-variants/__tests__/product-quantity-variants.test.tsx +6 -4
- package/src/{components-v2 → components}/product-quantity-variants/index.tsx +2 -2
- package/src/{components-v2 → components}/products-view/__tests__/products-view.test.tsx +11 -3
- package/src/{components-v2 → components}/products-view/compound/products-grid-view.tsx +7 -7
- package/src/{components-v2 → components}/products-view/compound/products-list-view.tsx +4 -4
- package/src/{components-v2 → components}/products-view/compound/types.ts +1 -1
- package/src/{components-v2 → components}/products-view/index.tsx +2 -2
- package/src/{components-v2/side-nav → components/progress}/index.ts +1 -1
- package/src/{components-v2 → components}/progress/progress.tsx +3 -3
- package/src/{components-v2/progress → components/scrollbar}/index.ts +1 -1
- package/src/{components-v2 → components}/scrollbar/scrollbar.tsx +1 -1
- package/src/{components-v2 → components}/search-bar/__tests__/search-bar.test.tsx +7 -1
- package/src/{components-v2 → components}/search-bar/compound/results-item-lg.tsx +2 -2
- package/src/{components-v2 → components}/search-bar/compound/results-item-sm.tsx +4 -4
- package/src/{components-v2 → components}/search-bar/compound/results-suspense.tsx +5 -5
- package/src/{components-v2 → components}/search-bar/compound/results.tsx +2 -2
- package/src/{components-v2 → components}/search-bar/compound/search-bar-root.tsx +5 -5
- package/src/{components-v2 → components}/search-bar/compound/textfield-adornment-category.tsx +3 -3
- package/src/{components-v2 → components}/search-bar/compound/textfield-adornment-search-icon.tsx +1 -1
- package/src/{components-v2 → components}/search-bar/compound/textfield.tsx +5 -5
- package/src/{components-v2 → components}/search-bar/index.tsx +1 -1
- package/src/{components-v2 → components}/section/compound/section-header.tsx +2 -2
- package/src/{components-v2 → components}/section/compound/section.tsx +1 -1
- package/src/{components-v2 → components}/section/index.ts +1 -1
- package/src/{components-v2 → components}/side-nav/__tests__/side-nav.test.tsx +17 -14
- package/src/{components-v2/scrollbar → components/side-nav}/index.ts +1 -1
- package/src/{components-v2 → components}/side-nav/side-nav.tsx +1 -1
- package/src/{components-v2 → components}/wishlist-dialogs/__tests__/create-new-list.test.tsx +1 -1
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/add-to-wishlist-button.tsx +2 -2
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +1 -1
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +4 -4
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +3 -3
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-header.tsx +3 -3
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +4 -4
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/index.tsx +1 -1
- package/src/{components-v2 → components}/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +1 -1
- package/src/{components-v2 → components}/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +2 -2
- package/src/{components-v2 → components}/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +2 -2
- package/src/{components-v2 → components}/wishlist-dialogs/create-wishlist/create-wishlist-button.tsx +2 -2
- package/src/{components-v2 → components}/wishlist-dialogs/create-wishlist/index.tsx +1 -1
- package/src/{components-v2 → components}/wishlist-dialogs/styles.ts +1 -1
- package/src/hooks/use-overflow-detect.ts +4 -4
- package/src/lib/cart-cookie-handler.ts +2 -2
- package/src/lib/category-helpers.ts +1 -1
- package/src/lib/lib.ts +1 -1
- package/src/lib/refiner-utils.ts +2 -2
- package/src/{pages-v2 → pages}/account/account-navigation.tsx +4 -4
- package/src/{pages-v2 → pages}/account/addresses/address-item.tsx +2 -2
- package/src/{pages-v2 → pages}/account/dashboard-header.tsx +4 -4
- package/src/{pages-v2 → pages}/account/orders/icons/delivery.tsx +1 -0
- package/src/{pages-v2 → pages}/account/orders/icons/package-box.tsx +1 -0
- package/src/{pages-v2 → pages}/account/orders/icons/truck-filled.tsx +1 -0
- package/src/{pages-v2 → pages}/account/orders/order-progress.tsx +5 -5
- package/src/{pages-v2 → pages}/account/orders/order-row.tsx +2 -2
- package/src/{pages-v2 → pages}/account/orders/order-summary.tsx +4 -4
- package/src/{pages-v2 → pages}/account/orders/ordered-products.tsx +2 -2
- package/src/{pages-v2 → pages}/account/profile/profile-button.test.tsx +2 -2
- package/src/{pages-v2 → pages}/account/profile/profile-button.tsx +1 -1
- package/src/{pages-v2 → pages}/account/profile/user-info.tsx +2 -2
- package/src/{pages-v2 → pages}/account/styles.ts +1 -1
- package/src/{pages-v2 → pages}/account/wishlist/create-new-list.tsx +2 -2
- package/src/{pages-v2 → pages}/account/wishlist/create-wishlist-button.tsx +2 -2
- package/src/{pages-v2 → pages}/account/wishlist/wishlist-item.tsx +3 -3
- package/src/{pages-v2 → pages}/blog/blog-card.tsx +4 -4
- package/src/{pages-v2 → pages}/cart/__tests__/cart-item.test.tsx +1 -1
- package/src/{pages-v2 → pages}/cart/__tests__/checkout-form.test.tsx +1 -1
- package/src/{pages-v2 → pages}/cart/__tests__/estimate-shipping.test.tsx +11 -11
- package/src/{pages-v2 → pages}/cart/cart-item.tsx +50 -22
- package/src/{pages-v2 → pages}/cart/checkout-form.tsx +4 -4
- package/src/{pages-v2 → pages}/cart/coupon-entry.tsx +2 -2
- package/src/{pages-v2 → pages}/cart/estimate-shipping.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/checkout-form.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/checkout-step.tsx +4 -4
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/index.ts +1 -1
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/step-heading.tsx +4 -4
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/address/address-card.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/address/delivery-address.tsx +25 -21
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/address/new-address-form.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/customer-info/customer-information.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/payment/payment-details.tsx +31 -14
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/shipping/delivery-date.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/shipping/delivery-options.tsx +3 -3
- package/src/{pages-v2 → pages}/checkout/checkout-alt-summary/cart-item.tsx +2 -2
- package/src/{pages-v2 → pages}/checkout/checkout-alt-summary/checkout-alt-summary.tsx +3 -3
- package/src/pages/checkout/checkout-alt-summary/index.ts +1 -0
- package/src/{pages-v2 → pages}/checkout/checkout-alt-summary/list-item.tsx +2 -2
- package/src/{pages-v2 → pages}/confirmation/address.tsx +1 -1
- package/src/{pages-v2 → pages}/confirmation/confirmation-summary.tsx +2 -2
- package/src/{pages-v2 → pages}/confirmation/ordered-products.tsx +2 -2
- package/src/{pages-v2 → pages}/product-details/available-shops.tsx +2 -5
- package/src/{pages-v2 → pages}/product-details/bopis/find-in-store-button.tsx +1 -2
- package/src/{pages-v2 → pages}/product-details/bopis/find-in-store-modal.tsx +4 -8
- package/src/{pages-v2 → pages}/product-details/bopis/pickup-option-select.tsx +1 -1
- package/src/pages/product-details/bopis/store-card/index.ts +1 -0
- package/src/{pages-v2 → pages}/product-details/bopis/store-card/shop-card.tsx +5 -5
- package/src/{pages-v2 → pages}/product-details/currency.ts +1 -1
- package/src/{pages-v2 → pages}/product-details/frequently-bought.tsx +3 -3
- package/src/{pages-v2 → pages}/product-details/frequently-product-card.tsx +5 -5
- package/src/{pages-v2 → pages}/product-details/product-comment.tsx +2 -2
- package/src/{pages-v2 → pages}/product-details/product-description.tsx +4 -2
- package/src/{pages-v2 → pages}/product-details/product-filter-card.tsx +5 -5
- package/src/{pages-v2 → pages}/product-details/product-intro/compound/product-info.tsx +8 -9
- package/src/{pages-v2 → pages}/product-details/product-intro/compound/product-intro-images.tsx +4 -4
- package/src/{pages-v2 → pages}/product-details/product-intro/compound/product-intro.tsx +3 -3
- package/src/{pages-v2 → pages}/product-details/product-review.tsx +3 -6
- package/src/{pages-v2 → pages}/product-details/product-tabs.tsx +1 -1
- package/src/{pages-v2 → pages}/product-details/related-products.tsx +2 -2
- package/src/{pages-v2 → pages}/product-list/facet-group.tsx +1 -1
- package/src/{pages-v2 → pages}/product-list/list-filter.tsx +2 -2
- package/src/{pages-v2 → pages}/product-list/pagination.tsx +1 -1
- package/src/{pages-v2 → pages}/product-list/product-list-context.tsx +3 -3
- package/src/{pages-v2 → pages}/product-list/product-list-view.tsx +4 -4
- package/src/{pages-v2 → pages}/product-list/quick-view-dialog-content.tsx +6 -11
- package/src/{pages-v2 → pages}/product-list/selected-facets.tsx +1 -1
- package/src/{pages-v2 → pages}/product-list/utils/search-for-category.ts +3 -3
- package/src/{pages-v2 → pages}/quickorder/order-upload.tsx +5 -2
- package/src/{pages-v2 → pages}/quickorder/provider.tsx +8 -8
- package/src/{pages-v2 → pages}/quickorder/quick-order-header.tsx +3 -3
- package/src/{pages-v2 → pages}/quickorder/quick-order-row.tsx +1 -1
- package/src/{pages-v2 → pages}/quickorder/quick-order-table.tsx +1 -1
- package/src/{pages-v2 → pages}/quickorder/quick-order.tsx +10 -10
- package/src/providers/notifications/README.md +1 -1
- package/src/providers/notifications/notification-context.tsx +10 -4
- package/tsconfig.json +1 -1
- package/typedoc.js +1 -1
- package/src/components-v2/carousel-cards/carousel-card-1/index.ts +0 -1
- package/src/components-v2/categories/category-list-item/index.ts +0 -1
- package/src/components-v2/flex-box/index.ts +0 -5
- package/src/components-v2/navbar/category-based-menu/index.ts +0 -1
- package/src/components-v2/product-cards/product-card/index.ts +0 -1
- package/src/components-v2/product-cards/product-card-plp/index.ts +0 -1
- package/src/components-v2/product-cards/product-card-plp-list/index.ts +0 -1
- package/src/components-v2/product-cards/product-card-search/index.ts +0 -1
- package/src/pages-v2/checkout/checkout-alt-summary/index.ts +0 -1
- package/src/pages-v2/product-details/bopis/store-card/index.ts +0 -1
- package/src/{components-v2 → components}/BazaarCard.stories.tsx +0 -0
- package/src/{components-v2 → components}/BazaarCard.tsx +0 -0
- package/src/{components-v2 → components}/BazaarImage.tsx +0 -0
- package/src/{components-v2 → components}/BazaarMenu.stories.tsx +0 -0
- package/src/{components-v2 → components}/BazaarMenu.tsx +0 -0
- package/src/{components-v2 → components}/BazaarSwitch.stories.tsx +0 -0
- package/src/{components-v2 → components}/BazaarSwitch.tsx +0 -0
- package/src/{components-v2 → components}/BazaarTextField.stories.tsx +0 -0
- package/src/{components-v2 → components}/BorderShadowCard.stories.tsx +0 -0
- package/src/{components-v2 → components}/BoxShadowCard.tsx +0 -0
- package/src/{components-v2 → components}/CountryInput.stories.tsx +0 -0
- package/src/{components-v2 → components}/DropZone.stories.tsx +0 -0
- package/src/{components-v2 → components}/HoverBox.stories.tsx +0 -0
- package/src/{components-v2 → components}/HoverBox.tsx +0 -0
- package/src/{components-v2 → components}/Image.tsx +0 -0
- package/src/{components-v2 → components}/LazyImage.tsx +0 -0
- package/src/{components-v2 → components}/Loading.stories.tsx +0 -0
- package/src/{components-v2 → components}/Loading.tsx +0 -0
- package/src/{components-v2 → components}/NoRecords.stories.tsx +0 -0
- package/src/{components-v2 → components}/README.md +0 -0
- package/src/{components-v2 → components}/SearchInput.stories.tsx +0 -0
- package/src/{components-v2 → components}/SearchInput.tsx +0 -0
- package/src/{components-v2 → components}/SiteLogo.stories.tsx +0 -0
- package/src/{components-v2 → components}/SnackbarProvider.tsx +0 -0
- package/src/{components-v2 → components}/T/__tests__/T.test.tsx +0 -0
- package/src/{components-v2 → components}/T/index.tsx +0 -0
- package/src/{components-v2 → components}/Typography.stories.tsx +0 -0
- package/src/{components-v2 → components}/Typography.tsx +0 -0
- package/src/{components-v2 → components}/WhiteButton.stories.tsx +0 -0
- package/src/{components-v2 → components}/WhiteButton.tsx +0 -0
- package/src/{components-v2 → components}/accordion/AccordionHeader.stories.tsx +0 -0
- package/src/{components-v2 → components}/accordion/__tests__/accordion-header.test.tsx +0 -0
- package/src/{components-v2 → components}/carousel/Carousel.stories.tsx +0 -0
- package/src/{components-v2 → components}/carousel/__tests__/carousel.test.tsx +0 -0
- package/src/{components-v2 → components}/carousel/styles/index.ts +0 -0
- package/src/{components-v2 → components}/carousel-cards/carousel-card-1/CarouselCard1.stories.tsx +0 -0
- package/src/{components-v2 → components}/carousel-cards/carousel-card-1/__tests__/carousel-card-1.test.tsx +0 -0
- package/src/{components-v2 → components}/carousel-cards/carousel-card-1/styles.ts +0 -0
- package/src/{components-v2 → components}/categories/category-list/types.ts +0 -0
- package/src/{components-v2 → components}/categories/category-list-item/styles.ts +0 -0
- package/src/{components-v2 → components}/categories/mega-menu/styles.ts +0 -0
- package/src/{components-v2 → components}/categories/types.ts +0 -0
- package/src/{components-v2 → components}/countries-input.tsx +0 -0
- package/src/{components-v2 → components}/flex-box/Flex.stories.tsx +0 -0
- package/src/{components-v2 → components}/flex-box/flex-between.tsx +0 -0
- package/src/{components-v2 → components}/flex-box/flex-box.tsx +0 -0
- package/src/{components-v2 → components}/flex-box/flex-row-center.tsx +0 -0
- package/src/{components-v2 → components}/header/Header.stories.tsx +0 -0
- package/src/{components-v2 → components}/header/hooks/use-header.ts +0 -0
- package/src/{components-v2 → components}/header/styles/index.ts +0 -0
- package/src/{components-v2 → components}/icons/__tests__/icons.test.tsx +1 -1
- package/src/{components-v2 → components}/mini-cart/__tests__/cart-item.test.tsx +0 -0
- package/src/{components-v2 → components}/mini-cart/__tests__/mini-cart.test.tsx +0 -0
- package/src/{components-v2 → components}/mini-cart/__tests__/test-cart-empty.json +0 -0
- package/src/{components-v2 → components}/mini-cart/__tests__/test-cart-with-item.json +0 -0
- package/src/{components-v2 → components}/mini-cart/components/bottom-actions.tsx +0 -0
- package/src/{components-v2 → components}/mobile-navigation/__tests__/mobile-navigation-bar.test.tsx +2 -2
- package/src/{components-v2 → components}/nav-link/NavLink.stories.tsx +0 -0
- package/src/{components-v2 → components}/nav-link/NavLink2.stories.tsx +0 -0
- package/src/{components-v2 → components}/nav-link/NavLink3.stories.tsx +0 -0
- package/src/{components-v2 → components}/navbar/category-based-menu/types.ts +0 -0
- package/src/{components-v2 → components}/navbar/utils/transform-nav.ts +0 -0
- package/src/{components-v2 → components}/product-cards/__tests__/product-cards.test.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/discount-chip.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/favorite-button.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/product-card/ProductCard.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/product-card-plp/ProductCardPlp.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/product-card-plp/styles/index.ts +0 -0
- package/src/{components-v2 → components}/product-cards/product-card-plp-list/ProductCardPlpList.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/product-card-plp-list/components/tags.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/product-card-search/ProductCardSearch.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-cards/product-card-search/styles/index.ts +0 -0
- package/src/{components-v2 → components}/product-dialog/ProductDialog.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-dimensions/Dimensions.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-dimensions/__mocks__/data.ts +0 -0
- package/src/{components-v2 → components}/product-dimensions/utils/has-selected-dimension.ts +0 -0
- package/src/{components-v2 → components}/product-quantity-buttons/ProductQuantity.stories.tsx +0 -0
- package/src/{components-v2 → components}/product-quantity-variants/ProductQuantity.stories.tsx +0 -0
- package/src/{components-v2 → components}/products-view/ProductsGrid.stories.tsx +0 -0
- package/src/{components-v2 → components}/products-view/ProductsList.stories.tsx +0 -0
- package/src/{components-v2 → components}/products-view/compound/context.ts +0 -0
- package/src/{components-v2 → components}/progress/ProgressBar.stories.tsx +0 -0
- package/src/{components-v2 → components}/progress/__tests__/progress.test.tsx +0 -0
- package/src/{components-v2 → components}/scrollbar/Scrollbar.stories.tsx +0 -0
- package/src/{components-v2 → components}/scrollbar/__tests__/scrollbar.test.tsx +0 -0
- package/src/{components-v2 → components}/scrollbar/styles.ts +0 -0
- package/src/{components-v2 → components}/search-bar/SearchBarLarge.stories.tsx +0 -0
- package/src/{components-v2 → components}/search-bar/compound/context.ts +0 -0
- package/src/{components-v2 → components}/search-bar/compound/textfield-adornment-button.tsx +0 -0
- package/src/{components-v2 → components}/search-bar/hooks/use-click-outside.ts +0 -0
- package/src/{components-v2 → components}/search-bar/hooks/use-search.ts +0 -0
- package/src/{components-v2 → components}/search-bar/styles/index.ts +0 -0
- package/src/{components-v2 → components}/search-bar/utils/findCategoryNameById.ts +0 -0
- package/src/{components-v2 → components}/section/Section.stories.tsx +0 -0
- package/src/{components-v2 → components}/section/__tests__/section.test.tsx +0 -0
- package/src/{components-v2 → components}/side-nav/SideNav.stories.tsx +0 -0
- package/src/{components-v2 → components}/site-logo.tsx +0 -0
- package/src/{components-v2 → components}/wishlist-dialogs/__tests__/wishlistDetailData.json +0 -0
- package/src/{components-v2 → components}/wishlist-dialogs/__tests__/wishlistsData.json +0 -0
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/AddToWishlist.stories.tsx +0 -0
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/context.ts +0 -0
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +0 -0
- package/src/{components-v2 → components}/wishlist-dialogs/create-wishlist/CreateWishlistButton.stories.tsx +0 -0
- package/src/{pages-v2 → pages}/README.md +0 -0
- package/src/{pages-v2 → pages}/account/addresses/address-form.tsx +0 -0
- package/src/{pages-v2 → pages}/account/table-row.tsx +0 -0
- package/src/{pages-v2 → pages}/blog/pagination.tsx +0 -0
- package/src/{pages-v2 → pages}/cart/__tests__/cart-with-items.json +0 -0
- package/src/{pages-v2 → pages}/cart/__tests__/conutries.json +0 -0
- package/src/{pages-v2 → pages}/cart/__tests__/countries.json +0 -0
- package/src/{pages-v2 → pages}/cart/wrapper.tsx +0 -0
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/node.tsx +0 -0
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/address/styles.ts +0 -0
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/payment/safe-card-preview-data.tsx +0 -0
- package/src/{pages-v2 → pages}/checkout/checkout-alt-form/types.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/bopis/search-header.tsx +0 -0
- package/src/{pages-v2 → pages}/product-details/bopis/store-card/styles.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/bopis/store-card/utils/convertSecondsToTime.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/bopis/store-card/utils/getDaysResources.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/checkbox-label.tsx +0 -0
- package/src/{pages-v2 → pages}/product-details/product-intro/compound/context.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/product-intro/compound/thumbnail-with-skeleton.tsx +0 -0
- package/src/{pages-v2 → pages}/product-details/product-intro/utils.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/types.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/breadcrumbs.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/checkbox-label.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/facet.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/product-list-state.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/product-rating.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/quick-view-dialog.tsx +4 -4
- package/src/{pages-v2 → pages}/product-list/range-filter.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/scrollbar.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/search-bar.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/side-nav.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/swatch.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/types.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/use-product-list.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/useCategoryFilter.tsx +0 -0
- package/src/{pages-v2 → pages}/product-list/utils/facet-helpers.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/utils/generate-breadcrumbs.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/utils/getCategoryFilterFromSlug.ts +0 -0
- package/src/{pages-v2 → pages}/product-list/utils/product-list-helper.ts +4 -4
- /package/src/{pages-v2 → pages}/product-list/utils/product-list-types.ts +0 -0
- /package/src/{pages-v2 → pages}/product-list/utils/sort-options.ts +0 -0
- /package/src/{pages-v2 → pages}/product-list/utils/use-previous-refiners.ts +0 -0
- /package/src/{pages-v2 → pages}/quickorder/context.ts +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// LOCAL CUSTOM COMPONENTS
|
|
2
2
|
|
|
3
|
-
import CategoryMenuItem from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import OfferBanner from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import ColumnList from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import CategoryMenuItem from "@evenicanpm/storefront-core/src/components/categories/category-list-item/index";
|
|
4
|
+
import OfferBanner from "@evenicanpm/storefront-core/src/components/categories/mega-menu/banner";
|
|
5
|
+
import ColumnList from "@evenicanpm/storefront-core/src/components/categories/mega-menu/column-list";
|
|
6
6
|
// STYLED COMPONENT
|
|
7
|
-
import { StyledRoot } from "@evenicanpm/storefront-core/src/components
|
|
7
|
+
import { StyledRoot } from "@evenicanpm/storefront-core/src/components/categories/mega-menu/styles";
|
|
8
8
|
// DATA TYPE
|
|
9
9
|
import type { CategoryHierarchy } from "@evenicanpm/storefront-core/src/lib/category-helpers";
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { render, screen } from "@testing-library/react";
|
|
2
|
-
import FlexBox from "../flex-box";
|
|
3
2
|
import FlexBetween from "../flex-between";
|
|
3
|
+
import FlexBox from "../flex-box";
|
|
4
4
|
import FlexRowCenter from "../flex-row-center";
|
|
5
5
|
|
|
6
6
|
describe("FlexBox components", () => {
|
|
@@ -27,7 +27,7 @@ describe("FlexBox components", () => {
|
|
|
27
27
|
|
|
28
28
|
const box = screen.getByTestId("flex-box");
|
|
29
29
|
expect(box).toBeInTheDocument();
|
|
30
|
-
expect(box).
|
|
30
|
+
expect(box.className).toContain("MuiBox-root");
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -44,9 +44,8 @@ describe("FlexBox components", () => {
|
|
|
44
44
|
expect(screen.getByText("Right")).toBeInTheDocument();
|
|
45
45
|
|
|
46
46
|
const box = screen.getByTestId("flex-between");
|
|
47
|
-
expect(box).
|
|
48
|
-
expect(box).
|
|
49
|
-
expect(box).toHaveStyle("align-items: center");
|
|
47
|
+
expect(box).toBeInTheDocument();
|
|
48
|
+
expect(box.className).toContain("MuiBox-root");
|
|
50
49
|
});
|
|
51
50
|
|
|
52
51
|
it("accepts custom props", () => {
|
|
@@ -70,9 +69,8 @@ describe("FlexBox components", () => {
|
|
|
70
69
|
|
|
71
70
|
const box = screen.getByTestId("flex-row-center");
|
|
72
71
|
expect(screen.getByText("Centered")).toBeInTheDocument();
|
|
73
|
-
expect(box).
|
|
74
|
-
expect(box).
|
|
75
|
-
expect(box).toHaveStyle("align-items: center");
|
|
72
|
+
expect(box).toBeInTheDocument();
|
|
73
|
+
expect(box.className).toContain("MuiBox-root");
|
|
76
74
|
});
|
|
77
75
|
|
|
78
76
|
it("applies custom styles", () => {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import FlexBetween from "@evenicanpm/storefront-core/src/components/flex-box/flex-between";
|
|
2
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/flex-box/flex-box";
|
|
3
|
+
import FlexRowCenter from "@evenicanpm/storefront-core/src/components/flex-box/flex-row-center";
|
|
4
|
+
|
|
5
|
+
export { FlexBetween, FlexBox, FlexRowCenter };
|
|
@@ -7,6 +7,10 @@ vi.mock("@evenicanpm/storefront-core/src/hooks/use-nextauth-session", () => ({
|
|
|
7
7
|
useAppSession: vi.fn(() => ({ session: null })),
|
|
8
8
|
}));
|
|
9
9
|
|
|
10
|
+
vi.mock("next-auth/react", () => ({
|
|
11
|
+
useSession: () => ({ data: null, status: "unauthenticated" }),
|
|
12
|
+
}));
|
|
13
|
+
|
|
10
14
|
vi.mock(
|
|
11
15
|
"@evenicanpm/storefront-core/src/api-manager/services/cart/queries/get-cart",
|
|
12
16
|
() => ({
|
|
@@ -17,7 +21,7 @@ vi.mock(
|
|
|
17
21
|
);
|
|
18
22
|
|
|
19
23
|
vi.mock(
|
|
20
|
-
"@evenicanpm/storefront-core/src/components
|
|
24
|
+
"@evenicanpm/storefront-core/src/components/mini-cart/mini-cart-trigger",
|
|
21
25
|
() => ({
|
|
22
26
|
default: ({ children }: { children: React.ReactNode }) => (
|
|
23
27
|
<div data-testid="mini-cart-trigger">{children}</div>
|
|
@@ -25,19 +29,19 @@ vi.mock(
|
|
|
25
29
|
}),
|
|
26
30
|
);
|
|
27
31
|
|
|
28
|
-
vi.mock("@evenicanpm/storefront-core/src/components
|
|
32
|
+
vi.mock("@evenicanpm/storefront-core/src/components/site-logo", () => ({
|
|
29
33
|
default: () => <div data-testid="site-logo">Logo</div>,
|
|
30
34
|
}));
|
|
31
35
|
|
|
32
36
|
vi.mock(
|
|
33
|
-
"@evenicanpm/storefront-core/src/components
|
|
37
|
+
"@evenicanpm/storefront-core/src/components/header/components/categories-menu",
|
|
34
38
|
() => ({
|
|
35
39
|
default: () => <div data-testid="categories-menu">Categories</div>,
|
|
36
40
|
}),
|
|
37
41
|
);
|
|
38
42
|
|
|
39
43
|
vi.mock(
|
|
40
|
-
"@evenicanpm/storefront-core/src/components
|
|
44
|
+
"@evenicanpm/storefront-core/src/components/header/components/user",
|
|
41
45
|
() => {
|
|
42
46
|
const User = ({ children }: { children?: ReactNode }) => (
|
|
43
47
|
<div data-testid="user-component">User: {children}</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import signOut from "@evenicanpm/storefront-core/src/auth/signout";
|
|
2
|
-
import Header from "@evenicanpm/storefront-core/src/components
|
|
2
|
+
import Header from "@evenicanpm/storefront-core/src/components/header/header";
|
|
3
3
|
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
4
4
|
import { NextIntlClientProvider } from "next-intl";
|
|
5
5
|
import { vi } from "vitest";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import CategoryMenu from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import CategoryMenu from "@evenicanpm/storefront-core/src/components/categories/category-menu";
|
|
2
2
|
// GLOBAL CUSTOM COMPONENTS
|
|
3
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
4
4
|
// CUSTOM ICON COMPONENTS
|
|
5
|
-
import Category from "@evenicanpm/storefront-core/src/components
|
|
5
|
+
import Category from "@evenicanpm/storefront-core/src/components/icons/category";
|
|
6
6
|
// MUI ICON COMPONENT
|
|
7
7
|
import KeyboardArrowDown from "@mui/icons-material/KeyboardArrowDown";
|
|
8
8
|
import Button from "@mui/material/Button";
|
|
@@ -3,21 +3,21 @@ import getCart from "@evenicanpm/storefront-core/src/api-manager/services/cart/q
|
|
|
3
3
|
import {
|
|
4
4
|
FlexBetween,
|
|
5
5
|
FlexBox,
|
|
6
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
7
|
-
import User from "@evenicanpm/storefront-core/src/components
|
|
8
|
-
import useHeader from "@evenicanpm/storefront-core/src/components
|
|
9
|
-
import MobileCartBag from "@evenicanpm/storefront-core/src/components
|
|
10
|
-
import Search from "@evenicanpm/storefront-core/src/components
|
|
11
|
-
import MiniCartTrigger from "@evenicanpm/storefront-core/src/components
|
|
12
|
-
import { MobileMenu } from "@evenicanpm/storefront-core/src/components
|
|
6
|
+
} from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
7
|
+
import User from "@evenicanpm/storefront-core/src/components/header/components/user";
|
|
8
|
+
import useHeader from "@evenicanpm/storefront-core/src/components/header/hooks/use-header";
|
|
9
|
+
import MobileCartBag from "@evenicanpm/storefront-core/src/components/icons/cart-bag";
|
|
10
|
+
import Search from "@evenicanpm/storefront-core/src/components/icons/search";
|
|
11
|
+
import MiniCartTrigger from "@evenicanpm/storefront-core/src/components/mini-cart/mini-cart-trigger";
|
|
12
|
+
import { MobileMenu } from "@evenicanpm/storefront-core/src/components/navbar/mobile-menu/index";
|
|
13
13
|
import {
|
|
14
14
|
transformCategoryNav,
|
|
15
15
|
transformCmsNav,
|
|
16
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
17
|
-
import { SearchBarViewSm as SearchBar } from "@evenicanpm/storefront-core/src/components
|
|
18
|
-
import SiteLogo from "@evenicanpm/storefront-core/src/components
|
|
16
|
+
} from "@evenicanpm/storefront-core/src/components/navbar/utils/transform-nav";
|
|
17
|
+
import { SearchBarViewSm as SearchBar } from "@evenicanpm/storefront-core/src/components/search-bar";
|
|
18
|
+
import SiteLogo from "@evenicanpm/storefront-core/src/components/site-logo";
|
|
19
19
|
// CUSTOM COMPONENTS
|
|
20
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
20
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
21
21
|
import { NavContext } from "@evenicanpm/storefront-core/src/providers/nav-provider";
|
|
22
22
|
import Box from "@mui/material/Box";
|
|
23
23
|
import Drawer from "@mui/material/Drawer";
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
initializeMsal,
|
|
10
10
|
} from "@evenicanpm/storefront-core/src/auth/msal";
|
|
11
11
|
import signOutCustom from "@evenicanpm/storefront-core/src/auth/signout";
|
|
12
|
-
import MobileUserIcon from "@evenicanpm/storefront-core/src/components
|
|
13
|
-
import { NavLink } from "@evenicanpm/storefront-core/src/components
|
|
14
|
-
import T from "@evenicanpm/storefront-core/src/components
|
|
12
|
+
import MobileUserIcon from "@evenicanpm/storefront-core/src/components/icons/user";
|
|
13
|
+
import { NavLink } from "@evenicanpm/storefront-core/src/components/nav-link";
|
|
14
|
+
import T from "@evenicanpm/storefront-core/src/components/T";
|
|
15
15
|
// UI Components
|
|
16
16
|
import {
|
|
17
17
|
Box,
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
// API
|
|
4
4
|
import getCart from "@evenicanpm/storefront-core/src/api-manager/services/cart/queries/get-cart";
|
|
5
5
|
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
-
import FlexBox from "@evenicanpm/storefront-core/src/components
|
|
6
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/flex-box/flex-box";
|
|
7
7
|
// LOCAL CUSTOM COMPONENTS
|
|
8
|
-
import CategoriesMenu from "@evenicanpm/storefront-core/src/components
|
|
9
|
-
import User from "@evenicanpm/storefront-core/src/components
|
|
8
|
+
import CategoriesMenu from "@evenicanpm/storefront-core/src/components/header/components/categories-menu";
|
|
9
|
+
import User from "@evenicanpm/storefront-core/src/components/header/components/user";
|
|
10
10
|
// STYLED COMPONENTS
|
|
11
11
|
import {
|
|
12
12
|
HeaderWrapper,
|
|
13
13
|
StyledContainer,
|
|
14
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
15
|
-
import MiniCartTrigger from "@evenicanpm/storefront-core/src/components
|
|
16
|
-
import SiteLogo from "@evenicanpm/storefront-core/src/components
|
|
14
|
+
} from "@evenicanpm/storefront-core/src/components/header/styles/index";
|
|
15
|
+
import MiniCartTrigger from "@evenicanpm/storefront-core/src/components/mini-cart/mini-cart-trigger";
|
|
16
|
+
import SiteLogo from "@evenicanpm/storefront-core/src/components/site-logo";
|
|
17
17
|
import { useAppSession } from "@evenicanpm/storefront-core/src/hooks/use-nextauth-session";
|
|
18
18
|
import clsx from "clsx";
|
|
19
19
|
import type { ReactNode } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
export { default } from "@evenicanpm/storefront-core/src/components/header/header";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import MobileHeader from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import Header from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import { SearchBarViewLg as SearchBar } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import MobileHeader from "@evenicanpm/storefront-core/src/components/header/components/mobile-header";
|
|
4
|
+
import Header from "@evenicanpm/storefront-core/src/components/header/index";
|
|
5
|
+
import { SearchBarViewLg as SearchBar } from "@evenicanpm/storefront-core/src/components/search-bar";
|
|
6
6
|
import { Sticky } from "@evenicanpm/ui";
|
|
7
7
|
|
|
8
8
|
import useTheme from "@mui/material/styles/useTheme";
|
|
@@ -2,6 +2,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
2
2
|
|
|
3
3
|
const CartBag = createSvgIcon(
|
|
4
4
|
<svg viewBox="0 0 20 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<title>Cart Bag</title>
|
|
5
6
|
<path
|
|
6
7
|
d="M5.33329 7.37181V5.37181C5.33329 2.79431 7.42079 0.705139 9.99996 0.705139C12.5791 0.705139 14.6666 2.79431 14.6666 5.37181V7.37181H17.3333C18.4375 7.37181 19.3333 8.26764 19.3333 9.37181V18.0385C19.3333 20.2468 17.5416 22.0385 15.3333 22.0385H4.66663C2.45746 22.0385 0.666626 20.2468 0.666626 18.0385V9.37181C0.666626 8.26764 1.56204 7.37181 2.66663 7.37181H5.33329ZM7.33329 7.37181H12.6666V5.37181C12.6666 3.89889 11.4708 2.70514 9.99996 2.70514C8.52913 2.70514 7.33329 3.89889 7.33329 5.37181V7.37181ZM2.66663 9.37181V18.0385C2.66663 19.1426 3.56204 20.0385 4.66663 20.0385H15.3333C16.4375 20.0385 17.3333 19.1426 17.3333 18.0385V9.37181H14.6666V11.7051C14.6666 12.2593 14.2208 12.7051 13.6666 12.7051C13.1125 12.7051 12.6666 12.2593 12.6666 11.7051V9.37181H7.33329V11.7051C7.33329 12.2593 6.88746 12.7051 6.33329 12.7051C5.77913 12.7051 5.33329 12.2593 5.33329 11.7051V9.37181H2.66663Z"
|
|
7
8
|
fill="currentColor"
|
|
@@ -4,6 +4,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
4
4
|
|
|
5
5
|
const Category = createSvgIcon(
|
|
6
6
|
<svg fill="currentColor" viewBox="0 0 64 64">
|
|
7
|
+
<title>Category</title>
|
|
7
8
|
<path d="m29 11v14a4 4 0 0 1 -4 4h-14a4 4 0 0 1 -4-4v-14a4 4 0 0 1 4-4h14a4 4 0 0 1 4 4zm24-4h-14a4 4 0 0 0 -4 4v14a4 4 0 0 0 4 4h14a4 4 0 0 0 4-4v-14a4 4 0 0 0 -4-4zm-28 28h-14a4 4 0 0 0 -4 4v14a4 4 0 0 0 4 4h14a4 4 0 0 0 4-4v-14a4 4 0 0 0 -4-4zm21 0a11 11 0 1 0 11 11 11 11 0 0 0 -11-11z" />
|
|
8
9
|
</svg>,
|
|
9
10
|
"Category",
|
|
@@ -2,6 +2,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
2
2
|
|
|
3
3
|
const Search = createSvgIcon(
|
|
4
4
|
<svg viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<title>Search</title>
|
|
5
6
|
<path
|
|
6
7
|
d="M21.3162 20.0056L17.2879 15.9891C18.5876 14.3333 19.2928 12.2886 19.2902 10.1836C19.2902 8.30891 18.7343 6.47636 17.6928 4.91764C16.6513 3.35892 15.1709 2.14405 13.439 1.42665C11.707 0.709246 9.80123 0.521542 7.96259 0.887269C6.12396 1.253 4.43507 2.15573 3.10948 3.48131C1.7839 4.80689 0.88117 6.49579 0.515443 8.33442C0.149715 10.1731 0.33742 12.0788 1.05482 13.8108C1.77222 15.5428 2.98709 17.0231 4.54581 18.0646C6.10453 19.1061 7.93709 19.662 9.81174 19.662C11.9167 19.6646 13.9615 18.9594 15.6173 17.6597L19.6338 21.688C19.7439 21.7991 19.8749 21.8872 20.0193 21.9474C20.1637 22.0075 20.3186 22.0385 20.475 22.0385C20.6314 22.0385 20.7862 22.0075 20.9306 21.9474C21.075 21.8872 21.206 21.7991 21.3162 21.688C21.4272 21.5779 21.5154 21.4468 21.5755 21.3024C21.6357 21.1581 21.6666 21.0032 21.6666 20.8468C21.6666 20.6904 21.6357 20.5355 21.5755 20.3912C21.5154 20.2468 21.4272 20.1157 21.3162 20.0056ZM2.70292 10.1836C2.70292 8.77758 3.11985 7.40316 3.90098 6.23412C4.6821 5.06508 5.79235 4.15393 7.09132 3.61588C8.39028 3.07783 9.81963 2.93705 11.1986 3.21134C12.5776 3.48564 13.8443 4.16269 14.8384 5.15688C15.8326 6.15106 16.5097 7.41773 16.784 8.79671C17.0583 10.1757 16.9175 11.605 16.3794 12.904C15.8414 14.203 14.9302 15.3132 13.7612 16.0943C12.5922 16.8755 11.2177 17.2924 9.81174 17.2924C7.92637 17.2924 6.11821 16.5434 4.78505 15.2103C3.45189 13.8771 2.70292 12.0689 2.70292 10.1836Z"
|
|
7
8
|
fill="currentColor"
|
|
@@ -2,6 +2,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
2
2
|
|
|
3
3
|
const ShoppingBagOutlined = createSvgIcon(
|
|
4
4
|
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<title>Shopping Bag</title>
|
|
5
6
|
<g>
|
|
6
7
|
<rect fill="none" height="24" width="24" />
|
|
7
8
|
<path d="M18,6h-2c0-2.21-1.79-4-4-4S8,3.79,8,6H6C4.9,6,4,6.9,4,8v12c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8C20,6.9,19.1,6,18,6z M12,4c1.1,0,2,0.9,2,2h-4C10,4.9,10.9,4,12,4z M18,20H6V8h2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V8h4v2c0,0.55,0.45,1,1,1s1-0.45,1-1V8 h2V20z" />
|
|
@@ -2,6 +2,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
2
2
|
|
|
3
3
|
const UpDown = createSvgIcon(
|
|
4
4
|
<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<title>Sort</title>
|
|
5
6
|
<path
|
|
6
7
|
d="M8.64847 6.88354H3.35158C3.04454 6.88354 2.86173 7.2269 3.03517 7.4812L5.68362 11.3824C5.83596 11.6062 6.16526 11.6062 6.3176 11.3824L8.96605 7.4812C9.13714 7.2269 8.9555 6.88354 8.64847 6.88354Z"
|
|
7
8
|
fill="currentColor"
|
|
@@ -2,6 +2,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
2
2
|
|
|
3
3
|
const User = createSvgIcon(
|
|
4
4
|
<svg viewBox="0 0 20 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<title>User</title>
|
|
5
6
|
<path
|
|
6
7
|
d="M12 13.3718H8.00002C3.95002 13.3718 0.666687 16.6551 0.666687 20.7051C0.666687 21.4414 1.26377 22.0385 2.00002 22.0385H18C18.7363 22.0385 19.3334 21.4414 19.3334 20.7051C19.3334 16.6551 16.05 13.3718 12 13.3718ZM2.70794 20.0385C3.0371 17.4093 5.28335 15.3718 8.00002 15.3718H12C14.715 15.3718 16.9625 17.4114 17.2917 20.0385H2.70794ZM10 11.3718C12.9454 11.3718 15.3334 8.98389 15.3334 6.03847C15.3334 3.09306 12.9454 0.705139 10 0.705139C7.0546 0.705139 4.66669 3.09306 4.66669 6.03847C4.66669 8.98431 7.05419 11.3718 10 11.3718ZM10 2.70514C11.8379 2.70514 13.3334 4.20056 13.3334 6.03847C13.3334 7.87639 11.8379 9.37181 10 9.37181C8.1621 9.37181 6.66669 7.87597 6.66669 6.03847C6.66669 4.20056 8.16252 2.70514 10 2.70514Z"
|
|
7
8
|
fill="currentColor"
|
|
@@ -2,6 +2,7 @@ import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
|
2
2
|
|
|
3
3
|
const User2 = createSvgIcon(
|
|
4
4
|
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<title>User</title>
|
|
5
6
|
<path
|
|
6
7
|
d="M6.65 7.5C6.65 9.21452 7.46395 10.7392 8.72162 11.7184C4.89924 13.0726 2.15 16.7186 2.15 21C2.15 21.47 2.53084 21.85 3 21.85H21C21.4692 21.85 21.85 21.47 21.85 21C21.85 16.7186 19.1008 13.0726 15.2784 11.7184C16.536 10.7392 17.35 9.21452 17.35 7.5C17.35 4.55053 14.9502 2.15 12 2.15C9.04976 2.15 6.65 4.55053 6.65 7.5ZM8.35 7.5C8.35 5.48748 9.98748 3.85 12 3.85C14.0125 3.85 15.65 5.48748 15.65 7.5C15.65 9.51252 14.0125 11.15 12 11.15C9.98748 11.15 8.35 9.51252 8.35 7.5ZM20.106 20.15H3.89395C4.32041 16.0538 7.79275 12.85 12 12.85C16.2072 12.85 19.6796 16.0538 20.106 20.15Z"
|
|
7
8
|
stroke="#395589"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @refresh reset
|
|
2
2
|
"use client";
|
|
3
3
|
|
|
4
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
5
5
|
import {
|
|
6
6
|
H6,
|
|
7
7
|
Tiny,
|
|
8
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
8
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
9
9
|
import { getProductDetailUrl } from "@evenicanpm/storefront-core/src/lib/build-product-detail-url";
|
|
10
10
|
import Add from "@mui/icons-material/Add";
|
|
11
11
|
import Close from "@mui/icons-material/Close";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
4
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
5
5
|
import { useTranslations } from "next-intl";
|
|
6
6
|
import type React from "react";
|
|
7
7
|
import { createContext, useContext } from "react";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import {
|
|
4
4
|
FlexBetween,
|
|
5
5
|
FlexBox,
|
|
6
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
7
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
6
|
+
} from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
7
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
8
8
|
import ClearIcon from "@mui/icons-material/Clear";
|
|
9
9
|
import IconButton from "@mui/material/IconButton";
|
|
10
10
|
import { useTranslations } from "next-intl";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as MiniCart } from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
export { default as MiniCart } from "@evenicanpm/storefront-core/src/components/mini-cart/mini-cart";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { Cart } from "@evenicanpm/storefront-core/src/api-manager/schemas/cart.schema";
|
|
4
|
-
import { MiniCart } from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import { MiniCart } from "@evenicanpm/storefront-core/src/components/mini-cart/index";
|
|
5
5
|
import { useNotification } from "@evenicanpm/storefront-core/src/providers/notifications/use-notification";
|
|
6
6
|
import { Badge, Drawer, IconButton } from "@mui/material";
|
|
7
7
|
import React, { createContext, useContext, useState } from "react";
|
|
@@ -37,13 +37,11 @@ const MiniCartTrigger = ({ cart, children }: MiniCartTriggerProps) => {
|
|
|
37
37
|
const [open, setOpen] = useState(false);
|
|
38
38
|
const { alert } = useNotification();
|
|
39
39
|
|
|
40
|
-
const SHOULD_OPEN_MINICART_ON_ADD = true; // Move to config
|
|
41
|
-
|
|
42
40
|
React.useEffect(() => {
|
|
43
|
-
if (alert?.type === "cart"
|
|
41
|
+
if (alert?.type === "cart") {
|
|
44
42
|
setOpen(true);
|
|
45
43
|
}
|
|
46
|
-
}, [alert
|
|
44
|
+
}, [alert]);
|
|
47
45
|
|
|
48
46
|
return (
|
|
49
47
|
<MiniCartTriggerContext.Provider value={{ cart, open, setOpen }}>
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import useDeleteCartLine from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/delete-cart-line";
|
|
4
4
|
import useUpdateCartLines from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/update-cart-lines";
|
|
5
|
-
import BottomActions from "@evenicanpm/storefront-core/src/components
|
|
6
|
-
import MiniCartItem from "@evenicanpm/storefront-core/src/components
|
|
7
|
-
import EmptyCart from "@evenicanpm/storefront-core/src/components
|
|
8
|
-
import TopHeader from "@evenicanpm/storefront-core/src/components
|
|
9
|
-
import Scrollbar from "@evenicanpm/storefront-core/src/components
|
|
5
|
+
import BottomActions from "@evenicanpm/storefront-core/src/components/mini-cart/components/bottom-actions";
|
|
6
|
+
import MiniCartItem from "@evenicanpm/storefront-core/src/components/mini-cart/components/cart-item";
|
|
7
|
+
import EmptyCart from "@evenicanpm/storefront-core/src/components/mini-cart/components/empty-view";
|
|
8
|
+
import TopHeader from "@evenicanpm/storefront-core/src/components/mini-cart/components/top-header";
|
|
9
|
+
import Scrollbar from "@evenicanpm/storefront-core/src/components/scrollbar/index";
|
|
10
10
|
import Box from "@mui/material/Box";
|
|
11
11
|
import Divider from "@mui/material/Divider";
|
|
12
12
|
import { useRouter } from "next/navigation";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Home from "@evenicanpm/storefront-core/src/components
|
|
2
|
-
import User2 from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import Home from "@evenicanpm/storefront-core/src/components/icons/home";
|
|
2
|
+
import User2 from "@evenicanpm/storefront-core/src/components/icons/user2";
|
|
3
3
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
4
|
import { MobileNavigationBar } from "./index";
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import MobileNavigationBar from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import MobileNavigationBar from "@evenicanpm/storefront-core/src/components/mobile-navigation/mobile-navigation-bar";
|
|
2
2
|
|
|
3
3
|
export { MobileNavigationBar };
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
// API and Context
|
|
4
4
|
import getCart from "@evenicanpm/storefront-core/src/api-manager/services/cart/queries/get-cart";
|
|
5
|
-
import CategoryOutlined from "@evenicanpm/storefront-core/src/components
|
|
5
|
+
import CategoryOutlined from "@evenicanpm/storefront-core/src/components/icons/category-outline";
|
|
6
6
|
// ICON COMPONENTS
|
|
7
|
-
import Home from "@evenicanpm/storefront-core/src/components
|
|
8
|
-
import ShoppingBagOutlined from "@evenicanpm/storefront-core/src/components
|
|
9
|
-
import User2 from "@evenicanpm/storefront-core/src/components
|
|
7
|
+
import Home from "@evenicanpm/storefront-core/src/components/icons/home";
|
|
8
|
+
import ShoppingBagOutlined from "@evenicanpm/storefront-core/src/components/icons/shopping-bag-outlined";
|
|
9
|
+
import User2 from "@evenicanpm/storefront-core/src/components/icons/user2";
|
|
10
10
|
// STYLED COMPONENTS
|
|
11
11
|
import {
|
|
12
12
|
iconStyle,
|
|
13
13
|
StyledBox,
|
|
14
14
|
StyledNavLink,
|
|
15
15
|
Wrapper,
|
|
16
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
16
|
+
} from "@evenicanpm/storefront-core/src/components/mobile-navigation/styles/index";
|
|
17
17
|
import { NavContext } from "@evenicanpm/storefront-core/src/providers/nav-provider";
|
|
18
18
|
import type { SvgIconComponent } from "@mui/icons-material";
|
|
19
19
|
import Badge from "@mui/material/Badge";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavLink } from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import { NavLink } from "@evenicanpm/storefront-core/src/components/nav-link/index";
|
|
2
2
|
import { layoutConstant } from "@evenicanpm/ui";
|
|
3
3
|
import Drawer from "@mui/material/Drawer";
|
|
4
4
|
import styled from "@mui/material/styles/styled";
|
|
@@ -60,4 +60,4 @@ const iconStyle = {
|
|
|
60
60
|
justifyContent: "center",
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
export {
|
|
63
|
+
export { iconStyle, StyledBox, StyledDrawer, StyledNavLink, Wrapper };
|
|
@@ -60,7 +60,8 @@ describe("nav-link", () => {
|
|
|
60
60
|
);
|
|
61
61
|
|
|
62
62
|
const link = screen.getByRole("link", { name: "Products" });
|
|
63
|
-
expect(link).
|
|
63
|
+
expect(link).toBeInTheDocument();
|
|
64
|
+
expect(link.getAttribute("style")).toContain("text-decoration");
|
|
64
65
|
});
|
|
65
66
|
|
|
66
67
|
it("renders children correctly", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import NavLink from "@evenicanpm/storefront-core/src/components
|
|
2
|
-
import NavLink2 from "@evenicanpm/storefront-core/src/components
|
|
3
|
-
import NavLink3 from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import NavLink from "@evenicanpm/storefront-core/src/components/nav-link/nav-link";
|
|
2
|
+
import NavLink2 from "@evenicanpm/storefront-core/src/components/nav-link/nav-link-2";
|
|
3
|
+
import NavLink3 from "@evenicanpm/storefront-core/src/components/nav-link/nav-link-3";
|
|
4
4
|
|
|
5
5
|
export { NavLink, NavLink2, NavLink3 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENT
|
|
2
|
-
import { Small } from "@evenicanpm/storefront-core/src/components
|
|
2
|
+
import { Small } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
3
3
|
import Link from "next/link";
|
|
4
4
|
|
|
5
5
|
// ==============================================================
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
-
import { Span } from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
5
5
|
// MUI ICON COMPONENT
|
|
6
6
|
import ArrowForward from "@mui/icons-material/ArrowForward";
|
|
7
7
|
import Link from "next/link";
|
|
@@ -12,8 +12,15 @@ const StyledLink = styled(Link, {
|
|
|
12
12
|
})<{ active: number }>(({ theme, active }) => ({
|
|
13
13
|
position: "relative",
|
|
14
14
|
transition: "color 150ms ease-in-out",
|
|
15
|
-
color:
|
|
16
|
-
|
|
15
|
+
color:
|
|
16
|
+
active && theme?.palette?.primary?.main
|
|
17
|
+
? theme.palette.primary.main
|
|
18
|
+
: "inherit",
|
|
19
|
+
"&:hover": {
|
|
20
|
+
color: theme?.palette?.primary?.main
|
|
21
|
+
? `${theme.palette.primary.main} !important`
|
|
22
|
+
: undefined,
|
|
23
|
+
},
|
|
17
24
|
}));
|
|
18
25
|
|
|
19
26
|
// ==============================================================
|
|
@@ -21,30 +28,39 @@ export interface NavLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
21
28
|
href: string;
|
|
22
29
|
style?: CSSProperties;
|
|
23
30
|
className?: string;
|
|
31
|
+
pathname?: string;
|
|
24
32
|
}
|
|
25
33
|
// ==============================================================
|
|
26
34
|
|
|
35
|
+
function checkRouteMatch(pathname: string | undefined, href: string): boolean {
|
|
36
|
+
if (!pathname) return false;
|
|
37
|
+
if (href === "/") return pathname === href;
|
|
38
|
+
return pathname.includes(href);
|
|
39
|
+
}
|
|
40
|
+
|
|
27
41
|
export default function NavLink({
|
|
28
42
|
href,
|
|
29
43
|
children,
|
|
30
44
|
style,
|
|
31
45
|
className,
|
|
46
|
+
pathname,
|
|
32
47
|
...props
|
|
33
48
|
}: Readonly<NavLinkProps>) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
let resolvedPathname = pathname;
|
|
50
|
+
if (resolvedPathname === undefined) {
|
|
51
|
+
try {
|
|
52
|
+
resolvedPathname = usePathname() ?? "";
|
|
53
|
+
} catch {
|
|
54
|
+
resolvedPathname = "";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
41
57
|
|
|
42
58
|
return (
|
|
43
59
|
<StyledLink
|
|
44
60
|
href={href}
|
|
45
61
|
style={style}
|
|
46
62
|
className={clsx(className)}
|
|
47
|
-
active={checkRouteMatch() ? 1 : 0}
|
|
63
|
+
active={checkRouteMatch(resolvedPathname, href) ? 1 : 0}
|
|
48
64
|
{...props}
|
|
49
65
|
>
|
|
50
66
|
{children}
|
|
@@ -5,15 +5,12 @@ vi.mock("next-intl", () => ({
|
|
|
5
5
|
useTranslations: () => (key: string) => key,
|
|
6
6
|
}));
|
|
7
7
|
|
|
8
|
-
vi.mock(
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
default: () => <div data-testid="navbar-categories">Categories</div>,
|
|
12
|
-
}),
|
|
13
|
-
);
|
|
8
|
+
vi.mock("@evenicanpm/storefront-core/src/components/navbar/categories", () => ({
|
|
9
|
+
default: () => <div data-testid="navbar-categories">Categories</div>,
|
|
10
|
+
}));
|
|
14
11
|
|
|
15
12
|
vi.mock(
|
|
16
|
-
"@evenicanpm/storefront-core/src/components
|
|
13
|
+
"@evenicanpm/storefront-core/src/components/navbar/nav-list/nav-list",
|
|
17
14
|
() => ({
|
|
18
15
|
default: () => <div data-testid="navbar-nav-list">Navigation List</div>,
|
|
19
16
|
}),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import CategoryMenu from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import Category from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import { CategoryMenuButton } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import CategoryMenu from "@evenicanpm/storefront-core/src/components/categories/category-menu";
|
|
4
|
+
import Category from "@evenicanpm/storefront-core/src/components/icons/category";
|
|
5
|
+
import { CategoryMenuButton } from "@evenicanpm/storefront-core/src/components/navbar/styles";
|
|
6
6
|
|
|
7
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
7
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
8
8
|
import { useTranslations } from "next-intl";
|
|
9
9
|
import React, { createContext, type ReactNode, useContext } from "react";
|
|
10
10
|
import { MdChevronRight as ChevronRight } from "react-icons/md";
|