@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,12 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import getProductByIds from "@evenicanpm/storefront-core/src/api-manager/services/product/queries/get-product-by-ids";
|
|
3
|
-
import { Carousel } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import { Carousel } from "@evenicanpm/storefront-core/src/components/carousel/index";
|
|
4
4
|
// CMS
|
|
5
|
-
import ProductCard from "@evenicanpm/storefront-core/src/components
|
|
6
|
-
import { Section } from "@evenicanpm/storefront-core/src/components
|
|
5
|
+
import ProductCard from "@evenicanpm/storefront-core/src/components/product-cards/product-card/product-card";
|
|
6
|
+
import { Section } from "@evenicanpm/storefront-core/src/components/section";
|
|
7
7
|
import type { SimpleProduct } from "@msdyn365-commerce/retail-proxy";
|
|
8
8
|
import { Box } from "@mui/system";
|
|
9
|
-
import React from "react";
|
|
10
9
|
import { Light } from "@/cms/blocks/icons/index";
|
|
11
10
|
import type { Product, ProductCarouselBlock } from "@/cms/blocks/interfaces";
|
|
12
11
|
import { getImageUrl } from "@/cms/endpoints";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getQueryClient } from "@evenicanpm/storefront-core/src/api-manager/services/get-query-client";
|
|
2
2
|
// API
|
|
3
3
|
import getProductByIds from "@evenicanpm/storefront-core/src/api-manager/services/product/queries/get-product-by-ids";
|
|
4
|
-
import BazaarCard from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import HoverBox from "@evenicanpm/storefront-core/src/components
|
|
6
|
-
import { Section } from "@evenicanpm/storefront-core/src/components
|
|
7
|
-
import { H4 } from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components/BazaarCard";
|
|
5
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/HoverBox";
|
|
6
|
+
import { Section } from "@evenicanpm/storefront-core/src/components/section";
|
|
7
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
8
8
|
import buildDetailUrl from "@evenicanpm/storefront-core/src/lib/build-detail-url";
|
|
9
9
|
// Utils
|
|
10
10
|
import { currency } from "@evenicanpm/storefront-core/src/lib/lib";
|
|
@@ -13,7 +13,6 @@ import type { SimpleProduct } from "@msdyn365-commerce/retail-proxy";
|
|
|
13
13
|
import Grid from "@mui/material/Grid2";
|
|
14
14
|
import Image from "next/image";
|
|
15
15
|
import NextLink from "next/link";
|
|
16
|
-
import React from "react";
|
|
17
16
|
// Icons
|
|
18
17
|
import { getIcon } from "@/cms/blocks/icons/index";
|
|
19
18
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Helmet } from "react-helmet-async";
|
|
3
2
|
import type { MetaItem, SeoPageData } from "@/cms/blocks/interfaces";
|
|
4
3
|
import cmsEndPoints from "@/cms/endpoints";
|
|
@@ -35,7 +34,7 @@ const Seo = (pageData: SeoPageData) => {
|
|
|
35
34
|
<meta name="googlebot" content="noindex"></meta>
|
|
36
35
|
</>
|
|
37
36
|
)}
|
|
38
|
-
{pageData?.seo?.meta?.map((metaItem: MetaItem,
|
|
37
|
+
{pageData?.seo?.meta?.map((metaItem: MetaItem, _i: number) => (
|
|
39
38
|
<meta
|
|
40
39
|
name={metaItem.name}
|
|
41
40
|
key={metaItem.id}
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
import {
|
|
5
5
|
H4,
|
|
6
6
|
Span,
|
|
7
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
8
8
|
import Card from "@mui/material/Card";
|
|
9
9
|
import Fab from "@mui/material/Fab";
|
|
10
10
|
import Grid from "@mui/material/Grid2";
|
|
11
11
|
import styled from "@mui/material/styles/styled";
|
|
12
|
-
import React from "react";
|
|
13
12
|
// CUSTOM ICON COMPONENTS
|
|
14
13
|
import { getIcon } from "@/cms/blocks/icons/index";
|
|
15
14
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENTS
|
|
2
|
-
import HoverBox from "@evenicanpm/storefront-core/src/components
|
|
3
|
-
import Image from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import { H4 } from "@evenicanpm/storefront-core/src/components
|
|
5
|
-
import React from "react";
|
|
2
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/HoverBox";
|
|
3
|
+
import Image from "@evenicanpm/storefront-core/src/components/Image";
|
|
4
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
6
5
|
|
|
7
6
|
// ==========================================================
|
|
8
7
|
type Props = { title: string; imgUrl: string };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import BazaarCard from "@evenicanpm/storefront-core/src/components
|
|
2
|
-
import BazaarImage from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components/BazaarCard";
|
|
2
|
+
import BazaarImage from "@evenicanpm/storefront-core/src/components/BazaarImage";
|
|
3
3
|
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
-
import { H4 } from "@evenicanpm/storefront-core/src/components
|
|
4
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
5
5
|
import { type SxProps, styled, type Theme } from "@mui/material/styles";
|
|
6
|
-
import
|
|
6
|
+
import type HtmlHTMLAttributes from "react";
|
|
7
7
|
|
|
8
8
|
// STYLED COMPONENT
|
|
9
9
|
const StyledBazaarCard = styled(BazaarCard)(({ theme }) => ({
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import ProductCard from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import ProductCard from "@evenicanpm/storefront-core/src/components/product-cards/product-card/index";
|
|
2
2
|
// GLOBAL CUSTOM COMPONENTS
|
|
3
|
-
import { Section } from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import { Section } from "@evenicanpm/storefront-core/src/components/section";
|
|
4
4
|
import Box from "@mui/material/Box";
|
|
5
5
|
import Grid from "@mui/material/Grid2";
|
|
6
|
-
import React from "react";
|
|
7
6
|
|
|
8
7
|
// CUSTOM DATA MODEL
|
|
9
8
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENTS
|
|
2
|
-
import HoverBox from "@evenicanpm/storefront-core/src/components
|
|
3
|
-
import Image from "@evenicanpm/storefront-core/src/components
|
|
2
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/HoverBox";
|
|
3
|
+
import Image from "@evenicanpm/storefront-core/src/components/Image";
|
|
4
4
|
import { lightOrDarkText } from "@evenicanpm/storefront-core/src/lib/hexToLuma";
|
|
5
5
|
import Card from "@mui/material/Card";
|
|
6
6
|
import Chip from "@mui/material/Chip";
|
|
7
7
|
import { useTheme } from "@mui/material/styles";
|
|
8
8
|
import styled from "@mui/material/styles/styled";
|
|
9
|
-
import React from "react";
|
|
10
9
|
|
|
11
10
|
// STYLED COMPONENT
|
|
12
11
|
const StyledChip = styled(Chip)({
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { FlexRowCenter } from "@evenicanpm/storefront-core/src/components
|
|
1
|
+
import { FlexRowCenter } from "@evenicanpm/storefront-core/src/components/flex-box/index";
|
|
2
2
|
// GLOBAL CUSTOM COMPONENTS
|
|
3
|
-
import HoverBox from "@evenicanpm/storefront-core/src/components
|
|
4
|
-
import Image from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/HoverBox";
|
|
4
|
+
import Image from "@evenicanpm/storefront-core/src/components/Image";
|
|
5
5
|
import {
|
|
6
6
|
H4,
|
|
7
7
|
Small,
|
|
8
|
-
} from "@evenicanpm/storefront-core/src/components
|
|
8
|
+
} from "@evenicanpm/storefront-core/src/components/Typography";
|
|
9
9
|
// CUSTOM UTILS LIBRARY FUNCTION
|
|
10
10
|
import { currency } from "@evenicanpm/storefront-core/src/lib/lib";
|
|
11
11
|
import Rating from "@mui/material/Rating";
|
|
12
|
-
import React from "react";
|
|
13
12
|
|
|
14
13
|
// ======================================================
|
|
15
14
|
interface Props {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import type { OverridableComponent } from "@mui/material/OverridableComponent";
|
|
3
3
|
import type { SvgIconTypeMap } from "@mui/material/SvgIcon";
|
|
4
4
|
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
5
|
-
import React from "react";
|
|
6
5
|
|
|
7
6
|
const Category: OverridableComponent<SvgIconTypeMap> = createSvgIcon(
|
|
8
7
|
<svg fill="currentColor" viewBox="0 0 64 64">
|
|
8
|
+
<title>Category</title>
|
|
9
9
|
<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" />
|
|
10
10
|
</svg>,
|
|
11
11
|
"Category",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
4
|
-
import React from "react";
|
|
5
4
|
|
|
6
5
|
const DottedStar = createSvgIcon(
|
|
7
6
|
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
7
|
+
<title>Dotted Star</title>
|
|
8
8
|
<path
|
|
9
9
|
d="M12.431 11.7264L11.9772 10.5867L11.5233 11.7264C11.4231 11.9784 11.1869 12.15 10.9157 12.1679L9.69147 12.2469L10.6349 13.031C10.8436 13.2047 10.9342 13.4828 10.8669 13.7457L10.5641 14.9342L11.6016 14.2785C11.8309 14.1344 12.1234 14.1344 12.3527 14.2785L13.3895 14.9336L13.0867 13.7457C13.0194 13.4828 13.11 13.2047 13.3188 13.031L14.2621 12.2469L13.0386 12.1679C12.7675 12.15 12.5313 11.9784 12.431 11.7264Z"
|
|
10
10
|
fill="#FF9101"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
4
|
-
import React from "react";
|
|
5
4
|
|
|
6
5
|
const GiftBox = createSvgIcon(
|
|
7
6
|
<svg fill="currentColor" viewBox="0 0 22 20">
|
|
7
|
+
<title>Gift Box</title>
|
|
8
8
|
<path
|
|
9
9
|
fillRule="evenodd"
|
|
10
10
|
clipRule="evenodd"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
4
|
-
import React from "react";
|
|
5
4
|
|
|
6
5
|
const Light = createSvgIcon(
|
|
7
6
|
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
7
|
+
<title>Light</title>
|
|
8
8
|
<path d="M19.0765 9.48063H12.1242L15.5905 0L5 14.5194H11.9522L8.48592 24L19.0765 9.48063Z" />
|
|
9
9
|
</svg>,
|
|
10
10
|
"Light",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
4
|
-
import React from "react";
|
|
5
4
|
|
|
6
5
|
const NewArrival = createSvgIcon(
|
|
7
6
|
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
7
|
+
<title>New Arrival</title>
|
|
8
8
|
<g>
|
|
9
9
|
<path
|
|
10
10
|
d="M22.9347 12.001L24 10.1003L22.3995 8.62199L22.8254 6.48519L20.8463 5.57376L20.5911 3.40991L18.4273 3.15468L17.5158 1.17562L15.379 1.60157L13.9006 0.000976562L12 1.0663L10.0994 0.000976562L8.62106 1.60152L6.48427 1.17557L5.57283 3.15463L3.40898 3.40987L3.15375 5.57371L1.17469 6.48515L1.60064 8.62194L0 10.1003L1.06533 12.0009L0 13.9016L1.60055 15.3799L1.17459 17.5167L3.15366 18.4281L3.40889 20.592L5.57273 20.8472L6.48417 22.8263L8.62097 22.4003L10.0993 24.0009L11.9999 22.9356L13.9005 24.0009L15.3788 22.4003L17.5156 22.8263L18.4271 20.8472L20.5909 20.592L20.8462 18.4281L22.8252 17.5167L22.3993 15.3799L23.9998 13.9016L22.9347 12.001ZM8.62936 14.0641H7.61878L5.78016 11.7887V14.0641H4.50881V9.43504H5.49984L7.35802 11.7887V9.43504H8.62936V14.0641ZM12.7238 14.0641H9.42483V9.43504H12.6652V10.5434H10.6962V11.1954H12.3783V12.2255H10.6962V12.9557H12.7239V14.0641H12.7238ZM18.0765 14.0641H17.0203L16.3618 12.408L15.7098 14.0641H14.6536L12.8411 9.43504H14.2168L15.2209 12.6102L15.5403 11.6453L14.7905 9.43504H15.9576L16.3618 10.8629L16.7726 9.43504H17.9397L17.1768 11.6453L17.5094 12.6102L18.507 9.43504H19.8891L18.0765 14.0641Z"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
3
|
-
import React from "react";
|
|
4
3
|
|
|
5
4
|
const RankBadge = createSvgIcon(
|
|
6
5
|
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
6
|
+
<title>Rank Badge</title>
|
|
7
7
|
<path
|
|
8
8
|
d="M1.99309 16.5377L1.49359 17.0365L5.70897 18.0092C5.77746 18.025 5.84014 18.0597 5.88987 18.1093C5.93959 18.159 5.97437 18.2216 5.99022 18.2901L6.96297 22.5062L7.46247 22.0063L6.43722 17.5622L1.99309 16.5377Z"
|
|
9
9
|
fill="#FAB400"
|
|
@@ -11,12 +11,7 @@ import Light from "@/cms/blocks/icons/components/light";
|
|
|
11
11
|
import NewArrival from "@/cms/blocks/icons/components/new-arrival";
|
|
12
12
|
import RankBadge from "@/cms/blocks/icons/components/rank-badge";
|
|
13
13
|
|
|
14
|
-
export { Category };
|
|
15
|
-
export { DottedStar };
|
|
16
|
-
export { GiftBox };
|
|
17
|
-
export { Light };
|
|
18
|
-
export { NewArrival };
|
|
19
|
-
export { RankBadge };
|
|
14
|
+
export { Category, DottedStar, GiftBox, Light, NewArrival, RankBadge };
|
|
20
15
|
|
|
21
16
|
const iconMapping: Record<string, IconComponent> = {
|
|
22
17
|
DottedStar, // Add more icons here as needed
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// CUSTOM COMPONENT
|
|
2
|
-
import { H6 } from "@evenicanpm/storefront-core/src/components
|
|
2
|
+
import { H6 } from "@evenicanpm/storefront-core/src/components/Typography";
|
|
3
3
|
import Box, { type BoxProps } from "@mui/material/Box";
|
|
4
4
|
import TextField, { type TextFieldProps } from "@mui/material/TextField";
|
|
5
5
|
|
|
@@ -12,20 +12,20 @@ export default function BazaarTextField({
|
|
|
12
12
|
InputProps,
|
|
13
13
|
...props
|
|
14
14
|
}: Props) {
|
|
15
|
-
const boxProps:
|
|
16
|
-
const textFieldProps:
|
|
15
|
+
const boxProps: Record<string, unknown> = {};
|
|
16
|
+
const textFieldProps: Record<string, unknown> = {};
|
|
17
17
|
|
|
18
18
|
// Splits props into Box and TextField props. Bracket notation allows dynamic names like "mt" or "mb".
|
|
19
|
-
for (const key
|
|
19
|
+
for (const [key, value] of Object.entries(props)) {
|
|
20
20
|
if (SPACE_PROPS_LIST.has(key)) {
|
|
21
|
-
|
|
21
|
+
boxProps[key] = value;
|
|
22
22
|
} else {
|
|
23
|
-
|
|
23
|
+
textFieldProps[key] = value;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
|
-
<Box {...boxProps}>
|
|
28
|
+
<Box {...(boxProps as BoxProps)}>
|
|
29
29
|
{/* INPUT LEVEL TEXT */}
|
|
30
30
|
{label ? (
|
|
31
31
|
<H6 mb={1} fontSize={13} color="grey.700">
|
|
@@ -39,7 +39,7 @@ export default function BazaarTextField({
|
|
|
39
39
|
...InputProps,
|
|
40
40
|
style: { ...InputProps?.style, height: 44 },
|
|
41
41
|
}}
|
|
42
|
-
{...textFieldProps}
|
|
42
|
+
{...(textFieldProps as TextFieldProps)}
|
|
43
43
|
/>
|
|
44
44
|
</Box>
|
|
45
45
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CountryRegionInfo } from "@msdyn365-commerce/retail-proxy";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
import { countries } from "../../__mocks__/countries";
|
|
@@ -12,8 +13,9 @@ const meta = {
|
|
|
12
13
|
export default meta;
|
|
13
14
|
type Story = StoryObj<typeof CountryInput>;
|
|
14
15
|
|
|
15
|
-
const Template = (args:
|
|
16
|
-
const [selectedCountry, setSelectedCountry] =
|
|
16
|
+
const Template = (args: React.ComponentProps<typeof CountryInput>) => {
|
|
17
|
+
const [selectedCountry, setSelectedCountry] =
|
|
18
|
+
useState<CountryRegionInfo | null>(null);
|
|
17
19
|
console.log(selectedCountry);
|
|
18
20
|
|
|
19
21
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import LazyImage from "@evenicanpm/storefront-core/src/components
|
|
3
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components/LazyImage";
|
|
4
4
|
import type { ImageProps } from "next/image";
|
|
5
5
|
import type React from "react";
|
|
6
6
|
import { useEffect, useState } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render, screen } from "@testing-library/react";
|
|
2
|
-
import { vi } from "vitest";
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
import T from "../index";
|
|
4
4
|
|
|
5
5
|
vi.mock("next-intl", () => ({
|
|
@@ -19,7 +19,7 @@ vi.mock("next-intl", () => ({
|
|
|
19
19
|
describe("T (Translation Component)", () => {
|
|
20
20
|
it("renders translation for given path", () => {
|
|
21
21
|
render(<T path="HomePage.welcome" />);
|
|
22
|
-
expect(screen.getByText("Welcome to our store")).
|
|
22
|
+
expect(screen.getByText("Welcome to our store")).toBeTruthy();
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
it("renders multiple translations", () => {
|
|
@@ -36,17 +36,17 @@ describe("T (Translation Component)", () => {
|
|
|
36
36
|
|
|
37
37
|
it("renders fallback path when translation not found", () => {
|
|
38
38
|
render(<T path="Unknown.path" />);
|
|
39
|
-
expect(screen.getByText("Unknown.path")).
|
|
39
|
+
expect(screen.getByText("Unknown.path")).toBeTruthy();
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
it("handles nested translation paths", () => {
|
|
43
43
|
render(<T path="Navigation.home" />);
|
|
44
|
-
expect(screen.getByText("Home")).
|
|
44
|
+
expect(screen.getByText("Home")).toBeTruthy();
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
it("renders common translations", () => {
|
|
48
48
|
render(<T path="Common.loading" />);
|
|
49
|
-
expect(screen.getByText("Loading...")).
|
|
49
|
+
expect(screen.getByText("Loading...")).toBeTruthy();
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
it("renders multiple different paths together", () => {
|
|
@@ -63,17 +63,13 @@ describe("T (Translation Component)", () => {
|
|
|
63
63
|
|
|
64
64
|
it("renders translation with special characters", () => {
|
|
65
65
|
render(<T path="Common.error" />);
|
|
66
|
-
expect(screen.getByText("An error occurred")).
|
|
66
|
+
expect(screen.getByText("An error occurred")).toBeTruthy();
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
it("accepts dynamic paths", () => {
|
|
70
70
|
const paths = ["HomePage.welcome", "Navigation.home", "Common.loading"];
|
|
71
71
|
const { container } = render(
|
|
72
|
-
|
|
73
|
-
{paths.map((path) => (
|
|
74
|
-
<T key={path} path={path} />
|
|
75
|
-
))}
|
|
76
|
-
</>,
|
|
72
|
+
paths.map((path) => <T key={path} path={path} />),
|
|
77
73
|
);
|
|
78
74
|
const text = container.textContent || "";
|
|
79
75
|
expect(text).toContain("Welcome to our store");
|
|
@@ -83,9 +79,9 @@ describe("T (Translation Component)", () => {
|
|
|
83
79
|
|
|
84
80
|
it("re-renders when path changes", () => {
|
|
85
81
|
const { rerender } = render(<T path="HomePage.welcome" />);
|
|
86
|
-
expect(screen.getByText("Welcome to our store")).
|
|
82
|
+
expect(screen.getByText("Welcome to our store")).toBeTruthy();
|
|
87
83
|
|
|
88
84
|
rerender(<T path="Navigation.home" />);
|
|
89
|
-
expect(screen.getByText("Home")).
|
|
85
|
+
expect(screen.getByText("Home")).toBeTruthy();
|
|
90
86
|
});
|
|
91
87
|
});
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import Box, { type BoxProps } from "@mui/material/Box";
|
|
4
4
|
import styled from "@mui/material/styles/styled";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import React from "react";
|
|
7
6
|
|
|
8
7
|
// ==============================================================
|
|
9
8
|
type Ellipsis = { ellipsis: number };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import BazaarCard from "../BazaarCard";
|
|
3
|
+
|
|
4
|
+
describe("BazaarCard", () => {
|
|
5
|
+
it("renders children", () => {
|
|
6
|
+
render(<BazaarCard>Card Content</BazaarCard>);
|
|
7
|
+
expect(screen.getByText("Card Content")).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("accepts hoverEffect prop", () => {
|
|
11
|
+
const { container } = render(
|
|
12
|
+
<BazaarCard hoverEffect>Hover Card</BazaarCard>,
|
|
13
|
+
);
|
|
14
|
+
expect(container.firstChild).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import BazaarImage from "../BazaarImage";
|
|
3
|
+
|
|
4
|
+
describe("BazaarImage", () => {
|
|
5
|
+
it("renders image with src and alt", () => {
|
|
6
|
+
render(
|
|
7
|
+
<BazaarImage
|
|
8
|
+
src="/test.png"
|
|
9
|
+
alt="Test Image"
|
|
10
|
+
data-testid="bazaar-image"
|
|
11
|
+
/>,
|
|
12
|
+
);
|
|
13
|
+
const image = screen.getByTestId("bazaar-image");
|
|
14
|
+
expect(image).toBeInTheDocument();
|
|
15
|
+
expect(image).toHaveAttribute("src", "/test.png");
|
|
16
|
+
expect(image).toHaveAttribute("alt", "Test Image");
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import { vi } from "vitest";
|
|
3
|
+
import BazaarMenu from "../BazaarMenu";
|
|
4
|
+
|
|
5
|
+
vi.mock("@mui/material/Menu", () => ({
|
|
6
|
+
default: ({
|
|
7
|
+
children,
|
|
8
|
+
open,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
open: boolean;
|
|
12
|
+
}) => (open ? <div data-testid="bazaar-menu">{children}</div> : null),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
describe("BazaarMenu", () => {
|
|
16
|
+
it("renders menu options when open is true", () => {
|
|
17
|
+
render(
|
|
18
|
+
<BazaarMenu
|
|
19
|
+
open
|
|
20
|
+
direction="right"
|
|
21
|
+
handler={() => <button type="button">Trigger</button>}
|
|
22
|
+
options={() => <div>Menu Option</div>}
|
|
23
|
+
/>,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
expect(screen.getByTestId("bazaar-menu")).toBeInTheDocument();
|
|
27
|
+
expect(screen.getByText("Menu Option")).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("opens menu using handler click", () => {
|
|
31
|
+
render(
|
|
32
|
+
<BazaarMenu
|
|
33
|
+
handler={(onClick) => (
|
|
34
|
+
<button type="button" onClick={onClick}>
|
|
35
|
+
Open
|
|
36
|
+
</button>
|
|
37
|
+
)}
|
|
38
|
+
options={() => <div>Dynamic Option</div>}
|
|
39
|
+
/>,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
fireEvent.click(screen.getByRole("button", { name: "Open" }));
|
|
43
|
+
expect(screen.getByTestId("bazaar-menu")).toBeInTheDocument();
|
|
44
|
+
expect(screen.getByText("Dynamic Option")).toBeInTheDocument();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import { vi } from "vitest";
|
|
3
|
+
import BazaarSwitch from "../BazaarSwitch";
|
|
4
|
+
|
|
5
|
+
describe("BazaarSwitch", () => {
|
|
6
|
+
it("renders switch", () => {
|
|
7
|
+
render(<BazaarSwitch />);
|
|
8
|
+
expect(screen.getByRole("checkbox")).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("calls onChange when toggled", () => {
|
|
12
|
+
const handleChange = vi.fn();
|
|
13
|
+
render(<BazaarSwitch onChange={handleChange} />);
|
|
14
|
+
fireEvent.click(screen.getByRole("checkbox"));
|
|
15
|
+
expect(handleChange).toHaveBeenCalled();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import BazaarTextField from "../BazaarTextField";
|
|
3
|
+
|
|
4
|
+
describe("BazaarTextField", () => {
|
|
5
|
+
it("renders label and input", () => {
|
|
6
|
+
render(
|
|
7
|
+
<BazaarTextField
|
|
8
|
+
label="Email"
|
|
9
|
+
placeholder="Enter email"
|
|
10
|
+
data-testid="bazaar-text-field"
|
|
11
|
+
/>,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
expect(screen.getByText("Email")).toBeInTheDocument();
|
|
15
|
+
expect(screen.getByPlaceholderText("Enter email")).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("renders without label", () => {
|
|
19
|
+
render(<BazaarTextField placeholder="No Label" />);
|
|
20
|
+
expect(screen.getByPlaceholderText("No Label")).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { BorderShadowCard, lightBorder, lightShadow } from "../BoxShadowCard";
|
|
3
|
+
|
|
4
|
+
describe("BoxShadowCard", () => {
|
|
5
|
+
it("renders BorderShadowCard children", () => {
|
|
6
|
+
render(<BorderShadowCard>Border Card</BorderShadowCard>);
|
|
7
|
+
expect(screen.getByText("Border Card")).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("exports light style objects", () => {
|
|
11
|
+
expect(lightShadow).toEqual({ boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)" });
|
|
12
|
+
expect(lightBorder).toEqual({ border: "1px solid rgba(0, 0, 0, 0.1)" });
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import type { Accept, FileRejection } from "react-dropzone";
|
|
3
|
+
import { vi } from "vitest";
|
|
4
|
+
import DropZone from "../DropZone";
|
|
5
|
+
|
|
6
|
+
vi.mock("next-intl", () => ({
|
|
7
|
+
useTranslations: () => (key: string) => key,
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
vi.mock("react-dropzone", () => ({
|
|
11
|
+
useDropzone: () => ({
|
|
12
|
+
getRootProps: () => ({ "data-testid": "dropzone-root" }),
|
|
13
|
+
getInputProps: () => ({ "data-testid": "dropzone-input" }),
|
|
14
|
+
isDragActive: false,
|
|
15
|
+
}),
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
describe("DropZone", () => {
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
vi.stubGlobal("accept", { "image/*": [] });
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
vi.unstubAllGlobals();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("renders title and input", () => {
|
|
28
|
+
render(
|
|
29
|
+
<DropZone
|
|
30
|
+
onChange={vi.fn()}
|
|
31
|
+
handleReject={vi.fn()}
|
|
32
|
+
accept={{ "image/*": [] } as Accept}
|
|
33
|
+
/>,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
expect(screen.getByText("Drag & drop files here")).toBeInTheDocument();
|
|
37
|
+
expect(screen.getByTestId("file-upload-input")).toBeInTheDocument();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("renders translated button text key", () => {
|
|
41
|
+
render(
|
|
42
|
+
<DropZone
|
|
43
|
+
onChange={vi.fn()}
|
|
44
|
+
handleReject={(files: FileRejection[]) => files}
|
|
45
|
+
accept={{ "image/*": [] } as Accept}
|
|
46
|
+
/>,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
expect(screen.getByText("selectFilesBtn")).toBeInTheDocument();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import HoverBox from "../HoverBox";
|
|
3
|
+
|
|
4
|
+
describe("HoverBox", () => {
|
|
5
|
+
it("renders children", () => {
|
|
6
|
+
render(<HoverBox>Hover Content</HoverBox>);
|
|
7
|
+
expect(screen.getByText("Hover Content")).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
});
|