@evenicanpm/storefront-core 1.8.4 → 2.0.1
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/.storybook/main.ts +2 -3
- package/.storybook/preview.tsx +0 -2
- package/__mocks__/create-mutation.ts +16 -8
- package/__mocks__/next-image.tsx +12 -3
- 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-categories.datasource.ts +2 -3
- package/src/api-manager/datasources/d365/d365-order.datasource.ts +4 -4
- package/src/api-manager/datasources/d365/d365-organization.datasource.ts +15 -8
- package/src/api-manager/datasources/d365/d365-product.datasource.ts +34 -19
- package/src/api-manager/datasources/d365/d365-user.datasource.ts +47 -19
- package/src/api-manager/datasources/e4/address/e4-address.remaps.ts +2 -2
- package/src/api-manager/datasources/e4/cart/e4-cart.datasource.ts +7 -5
- package/src/api-manager/datasources/e4/cart/e4-cart.remaps.ts +1 -1
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +3 -3
- package/src/api-manager/datasources/e4/product/e4-product.remaps.ts +3 -3
- package/src/api-manager/datasources/e4/product/e4-product.translator.ts +3 -1
- package/src/api-manager/datasources/e4/user/e4-user.datasource.ts +4 -8
- package/src/api-manager/index.ts +10 -128
- package/src/api-manager/lib/category-helpers.ts +1 -1
- package/src/api-manager/lib/get-graphql-client.ts +2 -2
- package/src/api-manager/schemas/product.schema.ts +9 -0
- package/src/api-manager/services/create-extension-query.ts +1 -1
- package/src/api-manager/services/create-query.ts +106 -266
- package/src/api-manager/types/Datasource.ts +0 -3
- 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-card.tsx +0 -1
- package/src/cms/blocks/components/category-carousel/index.tsx +3 -4
- package/src/cms/blocks/components/featured-categories.tsx +1 -2
- package/src/cms/blocks/components/featured-products.tsx +1 -2
- package/src/cms/blocks/components/footer/index.tsx +1 -2
- package/src/cms/blocks/components/footer/sections/footer-app-store.tsx +2 -2
- package/src/cms/blocks/components/footer/sections/footer-contact.tsx +1 -2
- package/src/cms/blocks/components/footer/sections/footer-links.tsx +1 -1
- package/src/cms/blocks/components/footer/sections/footer-logo.tsx +2 -3
- package/src/cms/blocks/components/footer/sections/footer-social-links.tsx +7 -3
- package/src/cms/blocks/components/footer.tsx +0 -1
- package/src/cms/blocks/components/hero-carousel/index.tsx +2 -3
- package/src/cms/blocks/components/hero.tsx +0 -1
- package/src/cms/blocks/components/image.tsx +0 -1
- package/src/cms/blocks/components/media-card.tsx +0 -1
- package/src/cms/blocks/components/product-carousel/index.tsx +3 -4
- package/src/cms/blocks/components/product-section-fullwidth/index.tsx +4 -5
- package/src/cms/blocks/components/rich-text.tsx +0 -1
- package/src/cms/blocks/components/seo/index.tsx +1 -2
- package/src/cms/blocks/components/services/index.tsx +0 -1
- package/src/cms/blocks/components/services/service-card.tsx +1 -2
- package/src/cms/blocks/components/shared/featured-product-card.tsx +3 -4
- package/src/cms/blocks/components/shared/product-category-item.tsx +4 -4
- package/src/cms/blocks/components/shared/product-grid.tsx +2 -3
- package/src/cms/blocks/components/shared/top-categories-card.tsx +2 -3
- package/src/cms/blocks/components/shared/top-rating-product-card.tsx +4 -5
- package/src/cms/blocks/icons/components/category.tsx +1 -1
- package/src/cms/blocks/icons/components/dotted-star.tsx +1 -1
- package/src/cms/blocks/icons/components/fallback-icon.tsx +0 -1
- package/src/cms/blocks/icons/components/gift-box.tsx +1 -1
- package/src/cms/blocks/icons/components/light.tsx +1 -1
- package/src/cms/blocks/icons/components/new-arrival.tsx +1 -1
- package/src/cms/blocks/icons/components/rank-badge.tsx +1 -1
- package/src/cms/blocks/icons/index.ts +1 -6
- package/src/{components-v2 → components}/BazaarTextField.tsx +8 -8
- package/src/{components-v2 → components}/CountryInput.stories.tsx +4 -2
- package/src/{components-v2 → components}/DropZone.tsx +1 -1
- package/src/{components-v2 → components}/ImageWithFallback.tsx +1 -1
- package/src/{components-v2 → components}/T/__tests__/T.test.tsx +9 -13
- package/src/{components-v2 → components}/T/index.tsx +0 -1
- package/src/{components-v2 → components}/Typography.tsx +0 -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 +28 -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 +5 -5
- 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}/countries-input.tsx +1 -1
- 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 +20 -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 +10 -4
- 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 +4 -3
- 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 -2
- 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 -2
- package/src/{components-v2 → components}/product-cards/favorite-button.tsx +0 -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 +3 -3
- 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-v2 → components}/product-cards/product-card-plp-list/ProductCardPlpList.stories.tsx +0 -1
- 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-v2 → components}/product-cards/product-card-search/ProductCardSearch.stories.tsx +0 -1
- 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/Dimensions.stories.tsx +2 -4
- 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 +2 -2
- 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 +2 -2
- package/src/{components-v2 → components}/product-dimensions/index.tsx +1 -1
- package/src/{components-v2 → components}/product-quantity-buttons/ProductQuantity.stories.tsx +1 -3
- package/src/{components-v2 → components}/product-quantity-buttons/__tests__/product-quantity-buttons.test.tsx +12 -2
- package/src/{components-v2 → components}/product-quantity-buttons/compound/quantity-buttons-root.tsx +3 -3
- package/src/{components-v2 → components}/product-quantity-buttons/index.tsx +1 -2
- package/src/{components-v2 → components}/product-quantity-variants/ProductQuantity.stories.tsx +1 -3
- 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/ProductsGrid.stories.tsx +1 -3
- package/src/{components-v2 → components}/products-view/ProductsList.stories.tsx +1 -3
- package/src/{components-v2 → components}/products-view/__tests__/products-view.test.tsx +31 -12
- 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 +3 -3
- 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 → components}/scrollbar/Scrollbar.stories.tsx +1 -3
- package/src/{components-v2 → components}/scrollbar/__tests__/scrollbar.test.tsx +7 -1
- 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/SearchBarLarge.stories.tsx +1 -3
- 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 -3
- package/src/{components-v2 → components}/search-bar/compound/results-item-sm.tsx +4 -5
- 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 -4
- 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 -6
- package/src/{components-v2 → components}/search-bar/index.tsx +1 -1
- package/src/{components-v2 → components}/search-bar/utils/findCategoryNameById.ts +3 -3
- package/src/{components-v2 → components}/section/__tests__/section.test.tsx +14 -7
- 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/SideNav.stories.tsx +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}/site-logo.tsx +8 -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 +3 -3
- package/src/{components-v2 → components}/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +2 -2
- 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 -4
- 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 +2 -2
- 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-nextauth-session.ts +4 -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 +2 -2
- package/src/lib/page-slugs.ts +0 -2
- package/src/lib/refiner-utils.ts +5 -5
- package/src/{pages-v2 → pages}/account/account-navigation.tsx +20 -23
- package/src/{pages-v2 → pages}/account/addresses/address-form.tsx +15 -7
- package/src/{pages-v2 → pages}/account/addresses/address-item.tsx +2 -2
- package/src/{pages-v2 → pages}/account/dashboard-header.tsx +5 -5
- 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 +5 -5
- 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 +5 -5
- 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 +3 -3
- 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 +36 -16
- 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 +3 -3
- package/src/{pages-v2 → pages}/checkout/checkout-alt-summary/checkout-alt-summary.tsx +4 -4
- 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 +2 -2
- package/src/{pages-v2 → pages}/confirmation/confirmation-summary.tsx +3 -3
- 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 +2 -2
- 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-intro/compound/thumbnail-with-skeleton.tsx +4 -1
- 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/breadcrumbs.tsx +0 -1
- package/src/{pages-v2 → pages}/product-list/facet-group.tsx +1 -1
- package/src/{pages-v2 → pages}/product-list/list-filter.tsx +2 -3
- package/src/{pages-v2 → pages}/product-list/pagination.tsx +1 -1
- package/src/{pages-v2 → pages}/product-list/product-list-context.tsx +4 -4
- package/src/{pages-v2 → pages}/product-list/product-list-view.tsx +6 -6
- package/src/{pages-v2 → pages}/product-list/quick-view-dialog-content.tsx +6 -11
- package/src/{pages-v2 → pages}/product-list/selected-facets.tsx +2 -2
- package/src/{pages-v2 → pages}/product-list/utils/search-for-category.ts +3 -3
- package/src/{pages-v2 → pages}/quickorder/context.ts +8 -2
- package/src/{pages-v2 → pages}/quickorder/order-upload.tsx +31 -10
- package/src/{pages-v2 → pages}/quickorder/provider.tsx +16 -17
- 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 +27 -21
- package/src/providers/nav-provider/index.tsx +1 -1
- package/src/providers/notifications/README.md +1 -1
- package/src/providers/notifications/notification-context.tsx +10 -4
- package/tsconfig.json +1 -2
- 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}/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}/Typography.stories.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}/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/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/components/tags.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/__mocks__/data.ts +0 -0
- package/src/{components-v2 → components}/product-dimensions/utils/has-selected-dimension.ts +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/styles.ts +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}/section/Section.stories.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/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/utils.ts +0 -0
- package/src/{pages-v2 → pages}/product-details/types.ts +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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { SalesOrder } from "@evenicanpm/storefront-core/src/api-manager/schemas/order.schema";
|
|
2
|
-
import { FlexBetween } from "@evenicanpm/storefront-core/src/components
|
|
2
|
+
import { FlexBetween } from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
3
3
|
import {
|
|
4
4
|
H5,
|
|
5
5
|
H6,
|
|
6
6
|
Paragraph,
|
|
7
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
8
8
|
import useCurrencyFormatter from "@evenicanpm/storefront-core/src/lib/currency-formatter";
|
|
9
9
|
import Card from "@mui/material/Card";
|
|
10
10
|
import Divider from "@mui/material/Divider";
|
|
@@ -86,9 +86,9 @@ OrderSummary.ListItem = ({
|
|
|
86
86
|
title: string;
|
|
87
87
|
property: keyof SalesOrder;
|
|
88
88
|
}) => {
|
|
89
|
+
const t = useTranslations("Account.OrderDetails");
|
|
89
90
|
const context = useContext(OrderSummaryContext);
|
|
90
91
|
if (!context) return null;
|
|
91
|
-
const t = useTranslations("Account.OrderDetails");
|
|
92
92
|
const { order, formatCurrency } = context;
|
|
93
93
|
|
|
94
94
|
const value = order[property];
|
|
@@ -104,10 +104,10 @@ OrderSummary.ListItem = ({
|
|
|
104
104
|
OrderSummary.Divider = Divider;
|
|
105
105
|
|
|
106
106
|
OrderSummary.Total = () => {
|
|
107
|
+
const t = useTranslations("Account.OrderDetails");
|
|
107
108
|
const context = useContext(OrderSummaryContext);
|
|
108
109
|
if (!context) return null;
|
|
109
110
|
const { order, formatCurrency } = context;
|
|
110
|
-
const t = useTranslations("Account.OrderDetails");
|
|
111
111
|
|
|
112
112
|
return (
|
|
113
113
|
<FlexBetween mb={2}>
|
|
@@ -5,12 +5,12 @@ import type {
|
|
|
5
5
|
import {
|
|
6
6
|
FlexBetween,
|
|
7
7
|
FlexBox,
|
|
8
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
8
|
+
} from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
9
9
|
import {
|
|
10
10
|
H6,
|
|
11
11
|
Paragraph,
|
|
12
12
|
Span,
|
|
13
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
13
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
14
14
|
import buildDetailUrl from "@evenicanpm/storefront-core/src/lib/build-detail-url";
|
|
15
15
|
import useCurrencyFormatter from "@evenicanpm/storefront-core/src/lib/currency-formatter";
|
|
16
16
|
import { ProductDimensionType } from "@msdyn365-commerce/retail-proxy";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ProfileButton from "@evenicanpm/storefront-core/src/pages
|
|
1
|
+
import ProfileButton from "@evenicanpm/storefront-core/src/pages/account/profile/profile-button";
|
|
2
2
|
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
3
3
|
import { vi } from "vitest";
|
|
4
4
|
import { getMsalInstance, getRequestConfig, initializeMsal } from "@/auth/msal";
|
|
@@ -9,7 +9,7 @@ vi.mock("@/auth/msal", () => ({
|
|
|
9
9
|
getRequestConfig: vi.fn(),
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
vi.mock("@evenicanpm/storefront-core/src/components
|
|
12
|
+
vi.mock("@evenicanpm/storefront-core/src/components/T/index", () => ({
|
|
13
13
|
default: ({ path }: { path: string }) => <span>{path}</span>,
|
|
14
14
|
}));
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { RedirectRequest } from "@azure/msal-browser";
|
|
4
|
-
import T from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import T from "@evenicanpm/storefront-core/src/components/T/index";
|
|
5
5
|
import { Button } from "@mui/material";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
7
7
|
import { getMsalInstance, getRequestConfig, initializeMsal } from "@/auth/msal";
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// API
|
|
4
4
|
import type { User } from "@evenicanpm/storefront-core/src/api-manager/schemas/user.schema";
|
|
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
|
import {
|
|
8
8
|
Small,
|
|
9
9
|
Span,
|
|
10
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
11
11
|
import Card from "@mui/material/Card";
|
|
12
12
|
import type { Theme } from "@mui/material/styles";
|
|
13
13
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import useCreateWishlist from "@evenicanpm/storefront-core/src/api-manager/services/user/mutations/create-wishlist";
|
|
4
|
-
import { H5 } from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import { H5 } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
5
5
|
import { useNotification } from "@evenicanpm/storefront-core/src/providers/notifications/use-notification";
|
|
6
6
|
import {
|
|
7
7
|
Box,
|
|
@@ -69,7 +69,7 @@ const CreateNewList = ({
|
|
|
69
69
|
|
|
70
70
|
useEffect(() => {
|
|
71
71
|
if (open) formik.resetForm();
|
|
72
|
-
}, [open]);
|
|
72
|
+
}, [open, formik.resetForm]);
|
|
73
73
|
|
|
74
74
|
const handleClose = () => {
|
|
75
75
|
if (isFunction(onClose)) onClose();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import T from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import CreateNewList from "@evenicanpm/storefront-core/src/pages
|
|
3
|
+
import T from "@evenicanpm/storefront-core/src/components/T";
|
|
4
|
+
import CreateNewList from "@evenicanpm/storefront-core/src/pages/account/wishlist/create-new-list";
|
|
5
5
|
import { Button } from "@mui/material";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
|
|
@@ -6,9 +6,9 @@ import type {
|
|
|
6
6
|
} from "@evenicanpm/storefront-core/src/api-manager/schemas/user.schema";
|
|
7
7
|
// API
|
|
8
8
|
import useDeleteWishlist from "@evenicanpm/storefront-core/src/api-manager/services/user/mutations/delete-wishlist";
|
|
9
|
-
import { NavLink3 } from "@evenicanpm/storefront-core/src/components
|
|
10
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
11
|
-
import TableRow from "@evenicanpm/storefront-core/src/pages
|
|
9
|
+
import { NavLink3 } from "@evenicanpm/storefront-core/src/components/nav-link";
|
|
10
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
11
|
+
import TableRow from "@evenicanpm/storefront-core/src/pages/account/table-row";
|
|
12
12
|
import { useNotification } from "@evenicanpm/storefront-core/src/providers/notifications/use-notification";
|
|
13
13
|
import { Box, IconButton } from "@mui/material";
|
|
14
14
|
import type { SxProps } from "@mui/material/styles";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENTS
|
|
2
2
|
|
|
3
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import { ZoomLazyImage } from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import { NavLink2 } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
4
|
+
import { ZoomLazyImage } from "@evenicanpm/storefront-core/src/components/LazyImage";
|
|
5
|
+
import { NavLink2 } from "@evenicanpm/storefront-core/src/components/nav-link";
|
|
6
6
|
import {
|
|
7
7
|
H3,
|
|
8
8
|
Paragraph,
|
|
9
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
10
10
|
// MUI ICON COMPONENTS
|
|
11
11
|
import AccessTime from "@mui/icons-material/AccessTime";
|
|
12
12
|
import Box from "@mui/material/Box";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Cart } from "@evenicanpm/storefront-core/src/api-manager/schemas/cart.schema";
|
|
2
|
+
import cartData from "@evenicanpm/storefront-core/src/pages/cart/__tests__/cart-with-items.json";
|
|
2
3
|
import CartItem from "@evenicanpm/storefront-core/src/pages/cart/cart-item";
|
|
3
|
-
import cartData from "@evenicanpm/storefront-core/src/pages-v2/cart/__tests__/cart-with-items.json";
|
|
4
4
|
import { NotificationProvider } from "@evenicanpm/storefront-core/src/providers/notifications/notification-context";
|
|
5
5
|
import ENUS from "@messages/en-US.json";
|
|
6
6
|
import fr from "@messages/fr.json";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Cart } from "@evenicanpm/storefront-core/src/api-manager/schemas/cart.schema";
|
|
2
|
+
import cartData from "@evenicanpm/storefront-core/src/pages/cart/__tests__/cart-with-items.json";
|
|
2
3
|
import CheckoutForm from "@evenicanpm/storefront-core/src/pages/cart/checkout-form";
|
|
3
|
-
import cartData from "@evenicanpm/storefront-core/src/pages-v2/cart/__tests__/cart-with-items.json";
|
|
4
4
|
import { NotificationProvider } from "@evenicanpm/storefront-core/src/providers/notifications/notification-context";
|
|
5
5
|
import ENUS from "@messages/en-US.json";
|
|
6
6
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Cart } from "@evenicanpm/storefront-core/src/api-manager/schemas/cart.schema";
|
|
2
|
-
import cartData from "@evenicanpm/storefront-core/src/pages
|
|
3
|
-
import countries from "@evenicanpm/storefront-core/src/pages
|
|
4
|
-
import EstimateShipping from "@evenicanpm/storefront-core/src/pages
|
|
2
|
+
import cartData from "@evenicanpm/storefront-core/src/pages/cart/__tests__/cart-with-items.json";
|
|
3
|
+
import countries from "@evenicanpm/storefront-core/src/pages/cart/__tests__/countries.json";
|
|
4
|
+
import EstimateShipping from "@evenicanpm/storefront-core/src/pages/cart/estimate-shipping";
|
|
5
5
|
import { NotificationProvider } from "@evenicanpm/storefront-core/src/providers/notifications/notification-context";
|
|
6
6
|
import ENUS from "@messages/en-US.json";
|
|
7
7
|
import type { CountryRegionInfo } from "@msdyn365-commerce/retail-proxy";
|
|
@@ -27,10 +27,10 @@ describe("Estimate Shipping", () => {
|
|
|
27
27
|
it("Should Default Country to USA", async () => {
|
|
28
28
|
const _countries = countries as CountryRegionInfo[];
|
|
29
29
|
const america = _countries.find((c) => c.ISOCode === "US");
|
|
30
|
-
let selectedCountry;
|
|
31
|
-
const setCountryFn = vi.fn(
|
|
32
|
-
|
|
33
|
-
);
|
|
30
|
+
let selectedCountry: string | undefined;
|
|
31
|
+
const setCountryFn = vi.fn((c: CountryRegionInfo) => {
|
|
32
|
+
selectedCountry = c.ISOCode;
|
|
33
|
+
});
|
|
34
34
|
render(
|
|
35
35
|
<Wrapper>
|
|
36
36
|
<EstimateShipping
|
|
@@ -56,10 +56,10 @@ describe("Estimate Shipping", () => {
|
|
|
56
56
|
it("Should Default Country to Canada", async () => {
|
|
57
57
|
const _countries = countries as CountryRegionInfo[];
|
|
58
58
|
const canada = _countries.find((c) => c.ISOCode === "CA");
|
|
59
|
-
let selectedCountry;
|
|
60
|
-
const setCountryFn = vi.fn(
|
|
61
|
-
|
|
62
|
-
);
|
|
59
|
+
let selectedCountry: string | undefined;
|
|
60
|
+
const setCountryFn = vi.fn((c: CountryRegionInfo) => {
|
|
61
|
+
selectedCountry = c.ISOCode;
|
|
62
|
+
});
|
|
63
63
|
render(
|
|
64
64
|
<Wrapper>
|
|
65
65
|
<EstimateShipping
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import type { CartLine } from "@evenicanpm/storefront-core/src/api-manager/schemas/cart.schema";
|
|
4
4
|
import useDeleteCartLine from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/delete-cart-line";
|
|
5
5
|
import useUpdateCartLines from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/update-cart-lines";
|
|
6
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
7
|
-
import Image from "@evenicanpm/storefront-core/src/components
|
|
6
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
7
|
+
import Image from "@evenicanpm/storefront-core/src/components/ImageWithFallback";
|
|
8
8
|
// Local components
|
|
9
9
|
import {
|
|
10
10
|
H6,
|
|
11
11
|
Span,
|
|
12
12
|
Tiny,
|
|
13
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
13
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
14
14
|
import { getProductDetailUrl } from "@evenicanpm/storefront-core/src/lib/build-product-detail-url";
|
|
15
15
|
// Utils
|
|
16
16
|
import useCurrencyFormatter from "@evenicanpm/storefront-core/src/lib/currency-formatter";
|
|
17
|
-
import { Wrapper } from "@evenicanpm/storefront-core/src/pages
|
|
17
|
+
import { Wrapper } from "@evenicanpm/storefront-core/src/pages/cart/wrapper";
|
|
18
18
|
// API
|
|
19
19
|
import { ProductDimensionType } from "@msdyn365-commerce/retail-proxy";
|
|
20
20
|
// MUI Icons
|
|
@@ -32,7 +32,13 @@ import {
|
|
|
32
32
|
import Link from "next/link";
|
|
33
33
|
import { useTranslations } from "next-intl";
|
|
34
34
|
import type React from "react";
|
|
35
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
createContext,
|
|
37
|
+
useCallback,
|
|
38
|
+
useContext,
|
|
39
|
+
useMemo,
|
|
40
|
+
useState,
|
|
41
|
+
} from "react";
|
|
36
42
|
|
|
37
43
|
type CartItemContextValue = {
|
|
38
44
|
cartLine: CartLine;
|
|
@@ -84,30 +90,39 @@ function CartItemRoot({
|
|
|
84
90
|
const qty = cartLine.Quantity || 1;
|
|
85
91
|
const isLoading = updatePending || deletePending;
|
|
86
92
|
|
|
87
|
-
const performUpdate = (
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
const performUpdate = useCallback(
|
|
94
|
+
(updated: CartLine) => {
|
|
95
|
+
updateCartLine({ cartLine: [updated], cartId, version: cartVersion });
|
|
96
|
+
},
|
|
97
|
+
[cartId, cartVersion, updateCartLine],
|
|
98
|
+
);
|
|
90
99
|
|
|
91
|
-
const increase = (
|
|
92
|
-
|
|
100
|
+
const increase = useCallback(
|
|
101
|
+
() => performUpdate({ ...cartLine, Quantity: qty + 1 }),
|
|
102
|
+
[cartLine, qty, performUpdate],
|
|
103
|
+
);
|
|
104
|
+
const decrease = useCallback(() => {
|
|
93
105
|
if (qty === 1) return;
|
|
94
106
|
performUpdate({ ...cartLine, Quantity: qty - 1 });
|
|
95
|
-
};
|
|
96
|
-
const remove = (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
}, [cartLine, qty, performUpdate]);
|
|
108
|
+
const remove = useCallback(
|
|
109
|
+
() =>
|
|
110
|
+
deleteCartLine({
|
|
111
|
+
cartLine: [{ ...cartLine, Quantity: 0 }],
|
|
112
|
+
cartId,
|
|
113
|
+
version: cartVersion,
|
|
114
|
+
}),
|
|
115
|
+
[cartLine, cartId, cartVersion, deleteCartLine],
|
|
116
|
+
);
|
|
102
117
|
|
|
103
|
-
const saveComment = () => {
|
|
118
|
+
const saveComment = useCallback(() => {
|
|
104
119
|
performUpdate({ ...cartLine, Comment: comment });
|
|
105
120
|
setIsWritingComment(false);
|
|
106
|
-
};
|
|
107
|
-
const cancelComment = () => {
|
|
121
|
+
}, [cartLine, comment, performUpdate]);
|
|
122
|
+
const cancelComment = useCallback(() => {
|
|
108
123
|
setComment(cartLine.Comment || "");
|
|
109
124
|
setIsWritingComment(false);
|
|
110
|
-
};
|
|
125
|
+
}, [cartLine.Comment]);
|
|
111
126
|
|
|
112
127
|
const value = useMemo<CartItemContextValue>(
|
|
113
128
|
() => ({
|
|
@@ -126,7 +141,20 @@ function CartItemRoot({
|
|
|
126
141
|
saveComment,
|
|
127
142
|
cancelComment,
|
|
128
143
|
}),
|
|
129
|
-
[
|
|
144
|
+
[
|
|
145
|
+
cartLine,
|
|
146
|
+
cartId,
|
|
147
|
+
cartVersion,
|
|
148
|
+
qty,
|
|
149
|
+
isLoading,
|
|
150
|
+
isWritingComment,
|
|
151
|
+
comment,
|
|
152
|
+
increase,
|
|
153
|
+
decrease,
|
|
154
|
+
remove,
|
|
155
|
+
saveComment,
|
|
156
|
+
cancelComment,
|
|
157
|
+
],
|
|
130
158
|
);
|
|
131
159
|
|
|
132
160
|
return (
|
|
@@ -4,10 +4,10 @@ import getStates from "@evenicanpm/storefront-core/src/api-manager/services/addr
|
|
|
4
4
|
import {
|
|
5
5
|
FlexBetween,
|
|
6
6
|
FlexBox,
|
|
7
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
8
|
-
import { Span } from "@evenicanpm/storefront-core/src/components
|
|
9
|
-
import CouponEntry from "@evenicanpm/storefront-core/src/pages
|
|
10
|
-
import EstimateShipping from "@evenicanpm/storefront-core/src/pages
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
8
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
9
|
+
import CouponEntry from "@evenicanpm/storefront-core/src/pages/cart/coupon-entry";
|
|
10
|
+
import EstimateShipping from "@evenicanpm/storefront-core/src/pages/cart/estimate-shipping";
|
|
11
11
|
import type {
|
|
12
12
|
CountryRegionInfo,
|
|
13
13
|
Coupon,
|
|
@@ -141,7 +141,7 @@ CheckoutForm.Notes = () => {
|
|
|
141
141
|
multiline
|
|
142
142
|
onChange={debounceCommentUpdate}
|
|
143
143
|
inputRef={textRef}
|
|
144
|
-
inputProps={{
|
|
144
|
+
inputProps={{ "data-testid": "cart-comment" }}
|
|
145
145
|
/>
|
|
146
146
|
<Divider sx={{ mb: 2 }} />
|
|
147
147
|
</>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import useAddDiscountCode from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/add-discount-code";
|
|
4
4
|
import useRemoveDiscountcode from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/remove-discount-code";
|
|
5
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
6
|
-
import { Span } from "@evenicanpm/storefront-core/src/components
|
|
5
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
6
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
7
7
|
import type { Coupon } from "@msdyn365-commerce/retail-proxy";
|
|
8
8
|
import Close from "@mui/icons-material/Close";
|
|
9
9
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Address } from "@evenicanpm/storefront-core/src/api-manager/schemas/address.schema";
|
|
2
2
|
import useGetDeliveryOptions from "@evenicanpm/storefront-core/src/api-manager/services/address/mutations/get-delivery-options";
|
|
3
|
-
import CountryInput from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import { Span } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import CountryInput from "@evenicanpm/storefront-core/src/components/countries-input";
|
|
4
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
5
5
|
import useCurrencyFormatter from "@evenicanpm/storefront-core/src/lib/currency-formatter";
|
|
6
6
|
import type {
|
|
7
7
|
CountryRegionInfo,
|
|
@@ -4,7 +4,7 @@ import type { Cart } from "@evenicanpm/storefront-core/src/api-manager/schemas/c
|
|
|
4
4
|
import useCheckout from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/checkout";
|
|
5
5
|
import getChannelConfiguration from "@evenicanpm/storefront-core/src/api-manager/services/organization/queries/get-channel-configuration";
|
|
6
6
|
import { PageSlug } from "@evenicanpm/storefront-core/src/lib/page-slugs";
|
|
7
|
-
import CheckoutStep from "@evenicanpm/storefront-core/src/pages
|
|
7
|
+
import CheckoutStep from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/checkout-step";
|
|
8
8
|
import { useNotification } from "@evenicanpm/storefront-core/src/providers/notifications/use-notification";
|
|
9
9
|
import type { CardPaymentAcceptResult } from "@msdyn365-commerce/retail-proxy";
|
|
10
10
|
import { Box, Button } from "@mui/material";
|
|
@@ -43,7 +43,7 @@ interface InjectedStepProps {
|
|
|
43
43
|
isLastStep: boolean;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
import type { CheckoutStepComponentProps } from "@evenicanpm/storefront-core/src/pages
|
|
46
|
+
import type { CheckoutStepComponentProps } from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/checkout-step";
|
|
47
47
|
|
|
48
48
|
interface StepProps<T extends object> {
|
|
49
49
|
title: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Cart } from "@evenicanpm/storefront-core/src/api-manager/schemas/cart.schema";
|
|
2
|
-
import Card from "@evenicanpm/storefront-core/src/components
|
|
3
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import { Span } from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import StepHeading from "@evenicanpm/storefront-core/src/pages
|
|
2
|
+
import Card from "@evenicanpm/storefront-core/src/components/BazaarCard";
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
4
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
5
|
+
import StepHeading from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/step-heading";
|
|
6
6
|
import { Button, useTheme } from "@mui/material";
|
|
7
7
|
import Grid from "@mui/material/Grid2";
|
|
8
8
|
import { useTranslations } from "next-intl";
|
|
@@ -117,7 +117,7 @@ CheckoutStep.Header = () => {
|
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
CheckoutStep.Body = <P extends object =
|
|
120
|
+
CheckoutStep.Body = <P extends object = object>({
|
|
121
121
|
component: Component,
|
|
122
122
|
componentProps,
|
|
123
123
|
}: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CheckoutForm } from "@evenicanpm/storefront-core/src/pages
|
|
1
|
+
export { default as CheckoutForm } from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/checkout-form";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
2
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
3
|
-
import type { StepViewState } from "@evenicanpm/storefront-core/src/pages
|
|
1
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
2
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
3
|
+
import type { StepViewState } from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/checkout-step";
|
|
4
4
|
import Avatar from "@mui/material/Avatar";
|
|
5
5
|
import type { BoxProps } from "@mui/material/Box";
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ export default function Heading({
|
|
|
18
18
|
stepViewState,
|
|
19
19
|
...props
|
|
20
20
|
}: Readonly<Props>) {
|
|
21
|
-
let viewStateColor;
|
|
21
|
+
let viewStateColor: string;
|
|
22
22
|
|
|
23
23
|
switch (stepViewState) {
|
|
24
24
|
case "active":
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Address } from "@evenicanpm/storefront-core/src/api-manager/schemas/address.schema";
|
|
2
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
2
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
3
3
|
import {
|
|
4
4
|
H6,
|
|
5
5
|
Paragraph,
|
|
6
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
6
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
7
7
|
import { DeleteOutline, ModeEditOutline } from "@mui/icons-material";
|
|
8
8
|
import { Card, IconButton } from "@mui/material";
|
|
9
9
|
import Grid from "@mui/material/Grid2";
|
package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/address/delivery-address.tsx
RENAMED
|
@@ -9,12 +9,12 @@ import useUpdateCart from "@evenicanpm/storefront-core/src/api-manager/services/
|
|
|
9
9
|
import useUpdateCartLines from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/update-cart-lines";
|
|
10
10
|
// API
|
|
11
11
|
import getUser from "@evenicanpm/storefront-core/src/api-manager/services/user/queries/get-user";
|
|
12
|
-
import Menu from "@evenicanpm/storefront-core/src/components
|
|
13
|
-
import type { CheckoutStepComponentProps } from "@evenicanpm/storefront-core/src/pages
|
|
14
|
-
import AddressCard from "@evenicanpm/storefront-core/src/pages
|
|
12
|
+
import Menu from "@evenicanpm/storefront-core/src/components/BazaarMenu";
|
|
13
|
+
import type { CheckoutStepComponentProps } from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/checkout-step";
|
|
14
|
+
import AddressCard from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/steps/address/address-card";
|
|
15
15
|
// Local components
|
|
16
|
-
import NewAddressForm from "@evenicanpm/storefront-core/src/pages
|
|
17
|
-
import { AddressDropDownHandler } from "@evenicanpm/storefront-core/src/pages
|
|
16
|
+
import NewAddressForm from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/steps/address/new-address-form";
|
|
17
|
+
import { AddressDropDownHandler } from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/steps/address/styles";
|
|
18
18
|
import type { CountryRegionInfo } from "@msdyn365-commerce/retail-proxy";
|
|
19
19
|
import { KeyboardArrowDownOutlined } from "@mui/icons-material";
|
|
20
20
|
import { Box, MenuItem } from "@mui/material";
|
|
@@ -24,6 +24,7 @@ import { useLocale, useTranslations } from "next-intl";
|
|
|
24
24
|
import React, {
|
|
25
25
|
createContext,
|
|
26
26
|
type ReactNode,
|
|
27
|
+
useCallback,
|
|
27
28
|
useContext,
|
|
28
29
|
useEffect,
|
|
29
30
|
useState,
|
|
@@ -195,21 +196,24 @@ const DeliveryAddress: DeliveryAddressCompound = ({
|
|
|
195
196
|
};
|
|
196
197
|
|
|
197
198
|
// helper to pick and set selected address + title
|
|
198
|
-
const pickAddress = (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
199
|
+
const pickAddress = useCallback(
|
|
200
|
+
(id?: number | null) => {
|
|
201
|
+
if (!id || id < 0) {
|
|
202
|
+
setSelectedAddressID(null);
|
|
203
|
+
setTitle("Select Address");
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const picked = addressList.find((a) => a.RecordId === id);
|
|
208
|
+
if (picked) {
|
|
209
|
+
setSelectedAddressID(picked.RecordId as number);
|
|
210
|
+
setTitle(`${picked.Name}, ${picked.City}`);
|
|
211
|
+
} else {
|
|
212
|
+
pickAddress(addressList[0].RecordId);
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
[addressList],
|
|
216
|
+
);
|
|
213
217
|
|
|
214
218
|
// keep dropdown title in sync
|
|
215
219
|
useEffect(() => {
|
|
@@ -218,7 +222,7 @@ const DeliveryAddress: DeliveryAddressCompound = ({
|
|
|
218
222
|
return;
|
|
219
223
|
}
|
|
220
224
|
pickAddress(cart.ShippingAddress?.RecordId ?? selectedAddressID);
|
|
221
|
-
}, [addressList, cart.ShippingAddress]);
|
|
225
|
+
}, [addressList, cart.ShippingAddress, selectedAddressID, pickAddress]);
|
|
222
226
|
|
|
223
227
|
// step submission -> completion
|
|
224
228
|
useEffect(() => {
|
package/src/{pages-v2 → pages}/checkout/checkout-alt-form/steps/address/new-address-form.tsx
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Address } from "@evenicanpm/storefront-core/src/api-manager/schemas/address.schema";
|
|
2
2
|
import getStates from "@evenicanpm/storefront-core/src/api-manager/services/address/queries/get-states";
|
|
3
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/flex-box";
|
|
4
4
|
import {
|
|
5
5
|
H5,
|
|
6
6
|
Paragraph,
|
|
7
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
8
8
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
9
9
|
import type { CountryRegionInfo } from "@msdyn365-commerce/retail-proxy";
|
|
10
10
|
import { Box, FormControl, InputLabel, MenuItem, Select } from "@mui/material";
|
|
@@ -44,7 +44,7 @@ interface NewAddressFormCtx {
|
|
|
44
44
|
states: { StateName: string; StateId: string }[] | undefined;
|
|
45
45
|
selectedCountry: CountryRegionInfo | null;
|
|
46
46
|
setSelectedCountry: (c: CountryRegionInfo | null) => void;
|
|
47
|
-
errors: Record<
|
|
47
|
+
errors: Partial<Record<keyof AddressFormInput, { message?: string }>>;
|
|
48
48
|
t: ReturnType<typeof useTranslations>;
|
|
49
49
|
onCancel: () => void;
|
|
50
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import useUpdateCart from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/update-cart";
|
|
2
2
|
import getUser from "@evenicanpm/storefront-core/src/api-manager/services/user/queries/get-user";
|
|
3
|
-
import { Paragraph } from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import type { CheckoutStepComponentProps } from "@evenicanpm/storefront-core/src/pages
|
|
3
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
4
|
+
import type { CheckoutStepComponentProps } from "@evenicanpm/storefront-core/src/pages/checkout/checkout-alt-form/checkout-step";
|
|
5
5
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
6
6
|
import Box from "@mui/material/Box";
|
|
7
7
|
import Grid from "@mui/material/Grid2";
|