@evenicanpm/storefront-core 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +1 -1
- package/.storybook/preview.tsx +5 -4
- package/__mocks__/countries.ts +1 -1
- package/__mocks__/create-query.ts +3 -2
- package/package.json +10 -2
- package/src/api-manager/datasources/d365/d365-address.datasource.ts +13 -11
- package/src/api-manager/datasources/d365/d365-base.datasource.ts +1 -1
- package/src/api-manager/datasources/d365/d365-cart.datasource.ts +37 -37
- package/src/api-manager/datasources/d365/d365-categories.datasource.ts +3 -3
- package/src/api-manager/datasources/d365/d365-order.datasource.ts +10 -9
- package/src/api-manager/datasources/d365/d365-organization.datasource.ts +10 -10
- package/src/api-manager/datasources/d365/d365-product.datasource.ts +28 -29
- package/src/api-manager/datasources/d365/d365-session.datasource.ts +4 -4
- package/src/api-manager/datasources/d365/d365-user.datasource.ts +22 -20
- package/src/api-manager/datasources/d365/d365.datasource.ts +15 -15
- package/src/api-manager/datasources/d365/index.ts +1 -1
- package/src/api-manager/datasources/d365/test-context.ts +1 -1
- package/src/api-manager/datasources/d365/utils/create-search-criteria.ts +1 -1
- package/src/api-manager/datasources/d365/utils/decode-jwt.ts +1 -1
- package/src/api-manager/datasources/d365/utils/get-context-cookie.ts +3 -3
- package/src/api-manager/datasources/d365/utils/product-images-utils.ts +29 -10
- package/src/api-manager/datasources/d365/utils/product-inventory-utils.ts +1 -1
- package/src/api-manager/datasources/e4/address/e4-address.datasource.ts +5 -5
- package/src/api-manager/datasources/e4/address/e4-address.remaps.ts +2 -2
- package/src/api-manager/datasources/e4/address/e4-address.translator.ts +8 -8
- package/src/api-manager/datasources/e4/cart/e4-cart.datasource.ts +10 -11
- package/src/api-manager/datasources/e4/cart/e4-cart.remaps.ts +9 -8
- package/src/api-manager/datasources/e4/cart/e4-cart.translator.ts +3 -3
- package/src/api-manager/datasources/e4/categories/e4-categories.datasource.ts +4 -4
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +4 -4
- package/src/api-manager/datasources/e4/e4.datasource.ts +7 -7
- package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +7639 -41393
- package/src/api-manager/datasources/e4/order/e4-order.datasource.ts +7 -7
- package/src/api-manager/datasources/e4/order/e4-order.remaps.ts +6 -5
- package/src/api-manager/datasources/e4/organization/e4-organization.datasource.ts +5 -4
- package/src/api-manager/datasources/e4/product/e4-product.datasource.ts +12 -11
- package/src/api-manager/datasources/e4/product/e4-product.remaps.ts +1 -1
- package/src/api-manager/datasources/e4/product/e4-product.translator.ts +14 -14
- package/src/api-manager/datasources/e4/session/e4-session.datasource.ts +2 -2
- package/src/api-manager/datasources/e4/session/e4-session.translator.ts +2 -2
- package/src/api-manager/datasources/e4/user/e4-user.datasource.ts +10 -10
- package/src/api-manager/datasources/e4/user/e4-user.remaps.ts +4 -4
- package/src/api-manager/datasources/e4/user/e4-user.translator.ts +6 -4
- package/src/api-manager/datasources/e4/utils/unwrap-e4-variants.ts +2 -2
- package/src/api-manager/index.ts +7 -7
- package/src/api-manager/lib/category-helpers.ts +1 -1
- package/src/api-manager/lib/get-dynamics-context.ts +1 -1
- package/src/api-manager/lib/get-graphql-client.ts +3 -4
- package/src/api-manager/schemas/address.schema.ts +1 -1
- package/src/api-manager/schemas/cart.schema.ts +1 -1
- package/src/api-manager/schemas/d365.schema.ts +207 -206
- package/src/api-manager/schemas/order.schema.ts +1 -1
- package/src/api-manager/schemas/organization.schema.ts +1 -1
- package/src/api-manager/schemas/product.schema.ts +4 -4
- package/src/api-manager/schemas/session.schema.ts +1 -1
- package/src/api-manager/schemas/user.schema.ts +1 -1
- package/src/api-manager/services/address/mutations/create-address.ts +3 -3
- package/src/api-manager/services/address/mutations/delete-address.ts +2 -2
- package/src/api-manager/services/address/mutations/get-delivery-options.ts +4 -4
- package/src/api-manager/services/address/mutations/update-address.ts +3 -3
- package/src/api-manager/services/address/queries/get-countries.ts +6 -4
- package/src/api-manager/services/address/queries/get-states.ts +3 -3
- package/src/api-manager/services/cart/mutations/add-discount-code.ts +4 -4
- package/src/api-manager/services/cart/mutations/add-to-cart.ts +4 -4
- package/src/api-manager/services/cart/mutations/checkout.ts +2 -2
- package/src/api-manager/services/cart/mutations/delete-cart-line.ts +2 -2
- package/src/api-manager/services/cart/mutations/get-payment-accept-result.ts +4 -4
- package/src/api-manager/services/cart/mutations/remove-cart-line-delivery-mode.ts +3 -3
- package/src/api-manager/services/cart/mutations/remove-discount-code.ts +2 -2
- package/src/api-manager/services/cart/mutations/update-cart-line-delivery-mode.ts +2 -2
- package/src/api-manager/services/cart/mutations/update-cart-lines.ts +3 -3
- package/src/api-manager/services/cart/mutations/update-cart.ts +2 -2
- package/src/api-manager/services/cart/queries/get-cart-lines-inventory.ts +2 -2
- package/src/api-manager/services/cart/queries/get-cart.ts +5 -3
- package/src/api-manager/services/cart/queries/get-payment-accept-point.ts +3 -3
- package/src/api-manager/services/categories/queries/get-categories.ts +1 -1
- package/src/api-manager/services/create-extension-query.ts +1 -1
- package/src/api-manager/services/create-mutation.ts +2 -2
- package/src/api-manager/services/create-query.ts +6 -6
- package/src/api-manager/services/get-query-client.ts +2 -2
- package/src/api-manager/services/order/queries/get-order-details.ts +2 -2
- package/src/api-manager/services/order/queries/get-orders.ts +1 -1
- package/src/api-manager/services/organization/queries/get-channel-configuration.ts +1 -1
- package/src/api-manager/services/organization/queries/get-stores.ts +1 -1
- package/src/api-manager/services/product/mutations/search-products.ts +3 -4
- package/src/api-manager/services/product/queries/get-product-availability.ts +2 -2
- package/src/api-manager/services/product/queries/get-product-by-id.ts +1 -1
- package/src/api-manager/services/product/queries/get-product-by-ids.ts +2 -2
- package/src/api-manager/services/product/queries/get-product-list.ts +1 -1
- package/src/api-manager/services/product/queries/get-product-prices.ts +2 -2
- package/src/api-manager/services/product/queries/get-related-products.ts +2 -2
- package/src/api-manager/services/product/queries/search-products.ts +2 -2
- package/src/api-manager/services/product/server/product.server.ts +3 -3
- package/src/api-manager/services/session/mutations/session-init.ts +2 -2
- package/src/api-manager/services/session/mutations/session-logout.ts +1 -1
- package/src/api-manager/services/session/queries/get-session.ts +1 -1
- package/src/api-manager/services/user/mutations/add-to-wishlist.ts +3 -3
- package/src/api-manager/services/user/mutations/copy-cart-to-wishlist.ts +3 -3
- package/src/api-manager/services/user/mutations/create-wishlist.ts +4 -4
- package/src/api-manager/services/user/mutations/delete-wishlist.ts +3 -3
- package/src/api-manager/services/user/mutations/remove-from-wishlist.ts +3 -3
- package/src/api-manager/services/user/mutations/update-user.ts +2 -2
- package/src/api-manager/services/user/mutations/update-wishlist.ts +2 -2
- package/src/api-manager/services/user/queries/get-user-counts.ts +1 -1
- package/src/api-manager/services/user/queries/get-user.ts +1 -1
- package/src/api-manager/services/user/queries/get-wishlist-details.ts +1 -1
- package/src/api-manager/services/user/queries/get-wishlists.ts +1 -1
- package/src/api-manager/types/Datasource.ts +23 -23
- package/src/auth/auth-options.test.ts +4 -5
- package/src/auth/auth-options.ts +7 -7
- package/src/auth/msal.ts +4 -1
- package/src/auth/next-auth-cookie-manager.ts +8 -7
- package/src/auth/refresh-token.ts +7 -4
- package/src/cms/blocks/block-manager.tsx +10 -10
- package/src/cms/blocks/components/brand-logos-scroller.tsx +4 -4
- package/src/cms/blocks/components/category-card.tsx +2 -2
- package/src/cms/blocks/components/category-carousel/index.tsx +5 -9
- package/src/cms/blocks/components/feature-pill.tsx +5 -4
- package/src/cms/blocks/components/featured-categories.tsx +5 -2
- package/src/cms/blocks/components/featured-products.tsx +2 -2
- package/src/cms/blocks/components/footer/data/index.ts +6 -3
- package/src/cms/blocks/components/footer/index.tsx +7 -11
- package/src/cms/blocks/components/footer/sections/footer-app-store.tsx +2 -2
- package/src/cms/blocks/components/footer/sections/footer-contact.tsx +3 -3
- package/src/cms/blocks/components/footer/sections/footer-links.tsx +3 -3
- package/src/cms/blocks/components/footer/sections/footer-logo.tsx +3 -3
- package/src/cms/blocks/components/footer/sections/footer-social-links.tsx +9 -9
- package/src/cms/blocks/components/footer/styles/index.ts +1 -1
- package/src/cms/blocks/components/footer.tsx +4 -4
- package/src/cms/blocks/components/hero-carousel/index.tsx +3 -4
- package/src/cms/blocks/components/hero.tsx +4 -5
- package/src/cms/blocks/components/image.tsx +4 -5
- package/src/cms/blocks/components/media-card.tsx +2 -2
- package/src/cms/blocks/components/product-carousel/index.tsx +7 -8
- package/src/cms/blocks/components/product-section-fullwidth/index.tsx +16 -20
- package/src/cms/blocks/components/rich-text.tsx +2 -2
- package/src/cms/blocks/components/seo/index.tsx +2 -2
- package/src/cms/blocks/components/services/index.tsx +4 -4
- package/src/cms/blocks/components/services/service-card.tsx +7 -9
- package/src/cms/blocks/components/shared/featured-product-card.tsx +2 -2
- package/src/cms/blocks/components/shared/product-category-item.tsx +4 -5
- package/src/cms/blocks/components/shared/product-grid.tsx +5 -4
- package/src/cms/blocks/components/shared/top-categories-card.tsx +5 -6
- package/src/cms/blocks/components/shared/top-rating-product-card.tsx +3 -3
- package/src/cms/blocks/icons/components/category.tsx +3 -3
- package/src/cms/blocks/icons/components/dotted-star.tsx +1 -1
- package/src/cms/blocks/icons/components/fallback-icon.tsx +1 -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 +3 -3
- package/src/cms/blocks/index.tsx +6 -6
- package/src/cms/blog.ts +2 -2
- package/src/cms/endpoints.ts +1 -1
- package/src/components-v2/BazaarCard.stories.tsx +1 -1
- package/src/components-v2/BazaarCard.tsx +1 -1
- package/src/components-v2/BazaarImage.tsx +1 -1
- package/src/components-v2/BazaarMenu.stories.tsx +1 -1
- package/src/components-v2/BazaarMenu.tsx +2 -2
- package/src/components-v2/BazaarSwitch.tsx +1 -1
- package/src/components-v2/BazaarTextField.tsx +2 -2
- package/src/components-v2/BorderShadowCard.stories.tsx +2 -2
- package/src/components-v2/CountryInput.stories.tsx +2 -2
- package/src/components-v2/DropZone.stories.tsx +1 -1
- package/src/components-v2/DropZone.tsx +7 -7
- package/src/components-v2/HoverBox.stories.tsx +1 -1
- package/src/components-v2/ImageWithFallback.tsx +3 -2
- package/src/components-v2/LazyImage.tsx +10 -2
- package/src/components-v2/Loading.tsx +1 -2
- package/src/components-v2/SearchInput.stories.tsx +1 -1
- package/src/components-v2/SearchInput.tsx +2 -2
- package/src/components-v2/SnackbarProvider.tsx +1 -1
- package/src/components-v2/T/index.tsx +1 -1
- package/src/components-v2/Typography.stories.tsx +2 -2
- package/src/components-v2/Typography.tsx +1 -1
- package/src/components-v2/WhiteButton.tsx +2 -2
- package/src/components-v2/accordion/accordion-header.tsx +5 -5
- package/src/components-v2/carousel/Carousel.stories.tsx +1 -1
- package/src/components-v2/carousel/carousel.tsx +4 -4
- package/src/components-v2/carousel/components/carousel-arrows.tsx +4 -4
- package/src/components-v2/carousel/components/carousel-dots.tsx +2 -2
- package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +4 -4
- package/src/components-v2/categories/Categories.stories.tsx +6 -5
- package/src/components-v2/categories/category-list/category-list.tsx +4 -5
- package/src/components-v2/categories/category-list/styles.ts +2 -2
- package/src/components-v2/categories/category-list-item/category-menu-item.tsx +5 -5
- package/src/components-v2/categories/category-menu.tsx +2 -2
- package/src/components-v2/categories/mega-menu/banner.tsx +4 -4
- package/src/components-v2/categories/mega-menu/column-list.tsx +6 -6
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +7 -7
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +3 -2
- package/src/components-v2/categories/types.ts +1 -1
- package/src/components-v2/countries-input.tsx +2 -2
- package/src/components-v2/flex-box/Flex.stories.tsx +1 -1
- package/src/components-v2/flex-box/flex-between.tsx +1 -1
- package/src/components-v2/flex-box/flex-box.tsx +1 -1
- package/src/components-v2/flex-box/flex-row-center.tsx +1 -1
- package/src/components-v2/flex-box/index.ts +1 -1
- package/src/components-v2/header/__tests__/user.test.tsx +3 -3
- package/src/components-v2/header/components/categories-menu.tsx +6 -6
- package/src/components-v2/header/components/mobile-header.tsx +17 -18
- package/src/components-v2/header/components/user.tsx +24 -23
- package/src/components-v2/header/header.tsx +9 -10
- package/src/components-v2/header/sticky-header.tsx +3 -3
- package/src/components-v2/header/styles/index.ts +3 -2
- package/src/components-v2/mini-cart/__tests__/cart-item.test.tsx +6 -6
- package/src/components-v2/mini-cart/__tests__/mini-cart.test.tsx +7 -7
- package/src/components-v2/mini-cart/components/bottom-actions.tsx +3 -2
- package/src/components-v2/mini-cart/components/cart-item.tsx +13 -12
- package/src/components-v2/mini-cart/components/empty-view.tsx +2 -1
- package/src/components-v2/mini-cart/components/top-header.tsx +6 -5
- package/src/components-v2/mini-cart/mini-cart-trigger.tsx +4 -4
- package/src/components-v2/mini-cart/mini-cart.tsx +11 -12
- package/src/components-v2/mobile-navigation/MobileNavigationBar.stories.tsx +2 -2
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +14 -14
- package/src/components-v2/mobile-navigation/styles/index.ts +2 -2
- package/src/components-v2/nav-link/nav-link-2.tsx +1 -1
- package/src/components-v2/nav-link/nav-link-3.tsx +3 -3
- package/src/components-v2/nav-link/nav-link.tsx +3 -3
- package/src/components-v2/navbar/categories.tsx +5 -5
- package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +15 -14
- package/src/components-v2/navbar/category-based-menu/styles.ts +3 -3
- package/src/components-v2/navbar/category-based-menu/types.ts +1 -1
- package/src/components-v2/navbar/mega-menu/mega-menu.tsx +11 -10
- package/src/components-v2/navbar/mega-menu/styles.ts +2 -2
- package/src/components-v2/navbar/mobile-menu/mobile-menu.test.tsx +3 -3
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +10 -10
- package/src/components-v2/navbar/nav-list/cms-nav.test.tsx +4 -4
- package/src/components-v2/navbar/nav-list/nav-item-child.tsx +12 -13
- package/src/components-v2/navbar/nav-list/nav-list.tsx +11 -11
- package/src/components-v2/navbar/navbar.tsx +3 -4
- package/src/components-v2/navbar/styles.ts +4 -4
- package/src/components-v2/navbar/utils/transform-nav.test.ts +3 -3
- package/src/components-v2/navbar/utils/transform-nav.ts +3 -3
- package/src/components-v2/no-records.tsx +2 -2
- package/src/components-v2/product-cards/discount-chip.tsx +1 -1
- package/src/components-v2/product-cards/favorite-button.tsx +2 -2
- package/src/components-v2/product-cards/product-card/ProductCard.stories.tsx +2 -2
- package/src/components-v2/product-cards/product-card/product-card.tsx +38 -38
- package/src/components-v2/product-cards/product-card/styles/index.ts +2 -2
- package/src/components-v2/product-cards/product-card-plp/ProductCardPlp.stories.tsx +2 -2
- package/src/components-v2/product-cards/product-card-plp/product-card.tsx +18 -18
- package/src/components-v2/product-cards/product-card-plp-list/ProductCardPlpList.stories.tsx +1 -1
- package/src/components-v2/product-cards/product-card-plp-list/product-card.tsx +15 -15
- package/src/components-v2/product-cards/product-card-search/ProductCardSearch.stories.tsx +2 -2
- package/src/components-v2/product-cards/product-card-search/product-card.tsx +16 -16
- package/src/components-v2/product-cards/product-price.tsx +1 -1
- package/src/components-v2/product-cards/product-rating.tsx +3 -3
- package/src/components-v2/product-cards/product-title.tsx +1 -1
- package/src/components-v2/product-cards/quantity-buttons.tsx +5 -5
- package/src/components-v2/product-dialog/ProductDialog.stories.tsx +2 -2
- package/src/components-v2/product-dialog/compound/product-dialog.tsx +14 -14
- package/src/components-v2/product-dimensions/Dimensions.stories.tsx +3 -2
- package/src/components-v2/product-dimensions/compound/dimensions-group-error.tsx +3 -3
- package/src/components-v2/product-dimensions/compound/dimensions-group-label.tsx +1 -1
- package/src/components-v2/product-dimensions/compound/dimensions-group-list-chip.tsx +5 -4
- package/src/components-v2/product-dimensions/compound/dimensions-group-list.tsx +1 -1
- package/src/components-v2/product-dimensions/compound/dimensions-group.tsx +3 -4
- package/src/components-v2/product-dimensions/compound/dimensions.tsx +6 -2
- package/src/components-v2/product-dimensions/index.tsx +1 -1
- package/src/components-v2/product-dimensions/utils/has-selected-dimension.ts +1 -1
- package/src/components-v2/product-quantity-buttons/ProductQuantity.stories.tsx +2 -1
- package/src/components-v2/product-quantity-buttons/compound/quantity-buttons-root.tsx +7 -7
- package/src/components-v2/product-quantity-buttons/index.tsx +5 -2
- package/src/components-v2/product-quantity-variants/ProductQuantity.stories.tsx +3 -2
- package/src/components-v2/product-quantity-variants/index.tsx +13 -13
- package/src/components-v2/products-view/ProductsGrid.stories.tsx +3 -2
- package/src/components-v2/products-view/ProductsList.stories.tsx +4 -3
- package/src/components-v2/products-view/compound/context.ts +4 -3
- package/src/components-v2/products-view/compound/products-grid-view.tsx +7 -6
- package/src/components-v2/products-view/compound/products-list-view.tsx +6 -5
- package/src/components-v2/products-view/compound/types.ts +2 -2
- package/src/components-v2/products-view/index.tsx +3 -3
- package/src/components-v2/progress/ProgressBar.stories.tsx +2 -2
- package/src/components-v2/progress/progress.tsx +3 -3
- package/src/components-v2/scrollbar/Scrollbar.stories.tsx +2 -1
- package/src/components-v2/scrollbar/scrollbar.tsx +3 -3
- package/src/components-v2/search-bar/SearchBarLarge.stories.tsx +2 -1
- package/src/components-v2/search-bar/compound/context.ts +2 -3
- package/src/components-v2/search-bar/compound/results-item-lg.tsx +3 -2
- package/src/components-v2/search-bar/compound/results-item-sm.tsx +10 -9
- package/src/components-v2/search-bar/compound/results-suspense.tsx +4 -4
- package/src/components-v2/search-bar/compound/results.tsx +5 -4
- package/src/components-v2/search-bar/compound/search-bar-root.tsx +6 -8
- package/src/components-v2/search-bar/compound/textfield-adornment-category.tsx +7 -6
- package/src/components-v2/search-bar/compound/textfield-adornment-search-icon.tsx +3 -2
- package/src/components-v2/search-bar/compound/textfield.tsx +5 -7
- package/src/components-v2/search-bar/hooks/use-search.ts +1 -2
- package/src/components-v2/search-bar/styles/index.ts +2 -2
- package/src/components-v2/search-bar/utils/findCategoryNameById.ts +1 -1
- package/src/components-v2/section/Section.stories.tsx +3 -3
- package/src/components-v2/section/compound/section-header.tsx +7 -7
- package/src/components-v2/section/compound/section.tsx +4 -3
- package/src/components-v2/side-nav/SideNav.stories.tsx +4 -4
- package/src/components-v2/side-nav/side-nav.tsx +2 -2
- package/src/components-v2/wishlist-dialogs/__tests__/create-new-list.test.tsx +5 -7
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/AddToWishlist.stories.tsx +2 -2
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/add-to-wishlist-button.tsx +2 -2
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +3 -3
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +7 -8
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +4 -5
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/context.ts +2 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-header.tsx +8 -10
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +6 -6
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +4 -6
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +3 -3
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +9 -8
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +6 -4
- package/src/components-v2/wishlist-dialogs/create-wishlist/create-wishlist-button.tsx +2 -2
- package/src/components-v2/wishlist-dialogs/styles.ts +4 -4
- package/src/hooks/use-cart.ts +1 -1
- package/src/hooks/use-nextauth-session.ts +65 -0
- package/src/hooks/use-overflow-detect.ts +1 -1
- package/src/hooks/use-settings.ts +1 -1
- package/src/hooks/use-variants.ts +6 -6
- package/src/lib/build-product-detail-url.ts +1 -1
- package/src/lib/cart-cookie-handler.ts +1 -1
- package/src/lib/category-helpers.ts +1 -1
- package/src/lib/create-graphql-client.ts +1 -2
- package/src/lib/get-palette-color.ts +1 -1
- package/src/lib/graphqlRequestSdk.ts +2 -3
- package/src/lib/hexToLuma.ts +2 -2
- package/src/lib/product-list-types.ts +1 -1
- package/src/lib/refiner-utils.ts +1 -1
- package/src/lib/store-hours-helper.ts +1 -1
- package/src/pages-v2/account/account-navigation.tsx +13 -13
- package/src/pages-v2/account/addresses/address-form.tsx +16 -15
- package/src/pages-v2/account/addresses/address-item.tsx +13 -14
- package/src/pages-v2/account/dashboard-header.tsx +9 -9
- package/src/pages-v2/account/orders/order-progress.tsx +13 -13
- package/src/pages-v2/account/orders/order-row.tsx +11 -10
- package/src/pages-v2/account/orders/order-summary.tsx +7 -6
- package/src/pages-v2/account/orders/ordered-products.tsx +18 -17
- package/src/pages-v2/account/profile/profile-button.test.tsx +3 -3
- package/src/pages-v2/account/profile/profile-button.tsx +5 -4
- package/src/pages-v2/account/profile/user-info.tsx +8 -9
- package/src/pages-v2/account/styles.ts +1 -1
- package/src/pages-v2/account/wishlist/create-new-list.tsx +10 -9
- package/src/pages-v2/account/wishlist/create-wishlist-button.tsx +2 -2
- package/src/pages-v2/account/wishlist/wishlist-item.tsx +13 -13
- package/src/pages-v2/blog/blog-card.tsx +58 -0
- package/src/pages-v2/blog/pagination.tsx +1 -2
- package/src/pages-v2/cart/__tests__/cart-item.test.tsx +8 -9
- package/src/pages-v2/cart/__tests__/checkout-form.test.tsx +8 -8
- package/src/pages-v2/cart/__tests__/countries.json +19407 -0
- package/src/pages-v2/cart/__tests__/estimate-shipping.test.tsx +11 -11
- package/src/pages-v2/cart/cart-item.tsx +24 -23
- package/src/pages-v2/cart/checkout-form.tsx +16 -18
- package/src/pages-v2/cart/coupon-entry.tsx +9 -7
- package/src/pages-v2/cart/estimate-shipping.tsx +5 -4
- package/src/pages-v2/checkout/checkout-alt-form/checkout-form.tsx +17 -16
- package/src/pages-v2/checkout/checkout-alt-form/checkout-step.tsx +5 -5
- package/src/pages-v2/checkout/checkout-alt-form/step-heading.tsx +3 -3
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/address-card.tsx +4 -4
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/delivery-address.tsx +21 -21
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/new-address-form.tsx +14 -15
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/styles.ts +1 -1
- package/src/pages-v2/checkout/checkout-alt-form/steps/customer-info/customer-information.tsx +8 -8
- package/src/pages-v2/checkout/checkout-alt-form/steps/payment/payment-details.tsx +8 -8
- package/src/pages-v2/checkout/checkout-alt-form/steps/payment/safe-card-preview-data.tsx +2 -2
- package/src/pages-v2/checkout/checkout-alt-form/steps/shipping/delivery-date.tsx +4 -4
- package/src/pages-v2/checkout/checkout-alt-form/steps/shipping/delivery-options.tsx +19 -19
- package/src/pages-v2/checkout/checkout-alt-summary/cart-item.tsx +2 -2
- package/src/pages-v2/checkout/checkout-alt-summary/checkout-alt-summary.tsx +9 -9
- package/src/pages-v2/checkout/checkout-alt-summary/list-item.tsx +2 -2
- package/src/pages-v2/confirmation/address.tsx +4 -4
- package/src/pages-v2/confirmation/confirmation-summary.tsx +3 -3
- package/src/pages-v2/confirmation/ordered-products.tsx +9 -8
- package/src/pages-v2/product-details/available-shops.tsx +6 -6
- package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +3 -3
- package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +16 -17
- package/src/pages-v2/product-details/bopis/pickup-option-select.tsx +4 -4
- package/src/pages-v2/product-details/bopis/search-header.tsx +3 -2
- package/src/pages-v2/product-details/bopis/store-card/shop-card.tsx +14 -15
- package/src/pages-v2/product-details/bopis/store-card/utils/getDaysResources.ts +1 -1
- package/src/pages-v2/product-details/checkbox-label.tsx +2 -2
- package/src/pages-v2/product-details/currency.ts +1 -0
- package/src/pages-v2/product-details/frequently-bought.tsx +11 -11
- package/src/pages-v2/product-details/frequently-product-card.tsx +4 -4
- package/src/pages-v2/product-details/product-comment.tsx +3 -3
- package/src/pages-v2/product-details/product-description.tsx +1 -1
- package/src/pages-v2/product-details/product-filter-card.tsx +13 -13
- package/src/pages-v2/product-details/product-intro/compound/context.ts +10 -5
- package/src/pages-v2/product-details/product-intro/compound/product-info.tsx +19 -19
- package/src/pages-v2/product-details/product-intro/compound/product-intro-images.tsx +3 -2
- package/src/pages-v2/product-details/product-intro/compound/product-intro.tsx +6 -6
- package/src/pages-v2/product-details/product-intro/compound/thumbnail-with-skeleton.tsx +1 -1
- package/src/pages-v2/product-details/product-intro/utils.ts +1 -1
- package/src/pages-v2/product-details/product-review.tsx +8 -8
- package/src/pages-v2/product-details/product-tabs.tsx +6 -6
- package/src/pages-v2/product-details/related-products.tsx +5 -5
- package/src/pages-v2/product-list/breadcrumbs.tsx +2 -2
- package/src/pages-v2/product-list/checkbox-label.tsx +2 -2
- package/src/pages-v2/product-list/facet-group.tsx +7 -7
- package/src/pages-v2/product-list/facet.tsx +4 -3
- package/src/pages-v2/product-list/list-filter.tsx +4 -4
- package/src/pages-v2/product-list/pagination.tsx +2 -2
- package/src/pages-v2/product-list/product-list-context.tsx +17 -17
- package/src/pages-v2/product-list/product-list-state.ts +14 -14
- package/src/pages-v2/product-list/product-list-view.tsx +14 -16
- package/src/pages-v2/product-list/product-rating.tsx +2 -2
- package/src/pages-v2/product-list/quick-view-dialog-content.tsx +20 -20
- package/src/pages-v2/product-list/quick-view-dialog.tsx +2 -2
- package/src/pages-v2/product-list/range-filter.tsx +5 -5
- package/src/pages-v2/product-list/scrollbar.tsx +3 -3
- package/src/pages-v2/product-list/search-bar.tsx +12 -12
- package/src/pages-v2/product-list/selected-facets.tsx +4 -4
- package/src/pages-v2/product-list/side-nav.tsx +1 -1
- package/src/pages-v2/product-list/swatch.tsx +3 -4
- package/src/pages-v2/product-list/utils/generate-breadcrumbs.ts +1 -1
- package/src/pages-v2/product-list/utils/product-list-helper.ts +4 -4
- package/src/pages-v2/product-list/utils/product-list-types.ts +1 -1
- package/src/pages-v2/product-list/utils/search-for-category.ts +2 -2
- package/src/pages-v2/product-list/utils/sort-options.ts +1 -1
- package/src/pages-v2/quickorder/order-upload.tsx +2 -2
- package/src/pages-v2/quickorder/provider.tsx +8 -7
- package/src/pages-v2/quickorder/quick-order-header.tsx +1 -1
- package/src/pages-v2/quickorder/quick-order-row.tsx +8 -7
- package/src/pages-v2/quickorder/quick-order-table.tsx +3 -3
- package/src/pages-v2/quickorder/quick-order.tsx +20 -22
- package/src/providers/nav-provider/index.tsx +3 -3
- package/src/providers/nav-provider/utils/createLink.ts +1 -1
- package/src/providers/notifications/notification-context.tsx +3 -3
- package/src/providers/notifications/use-notification.ts +1 -1
- package/tsconfig.json +1 -1
- package/src/components-v2/sticky/Sticky.stories.tsx +0 -88
- package/src/components-v2/sticky/index.ts +0 -1
- package/src/components-v2/sticky/sticky.tsx +0 -62
- package/src/components-v2/sticky/styles.ts +0 -38
- package/src/components-v2/utils/constants.ts +0 -8
- package/src/theme/build-mui-theme.ts +0 -104
- package/src/theme/components.ts +0 -163
- package/src/theme/emotion-cache.tsx +0 -101
- package/src/theme/theme-colors.ts +0 -205
- package/src/theme/theme-options-sample.ts +0 -69
- package/src/theme/theme-options.ts +0 -172
- package/src/theme/theme-provider.tsx +0 -44
- package/src/theme/typography.ts +0 -22
- package/src/theme/utils.ts +0 -17
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
// =================================================================
|
|
2
|
-
interface CustomPaletteColor {
|
|
3
|
-
50: string;
|
|
4
|
-
100: string;
|
|
5
|
-
200: string;
|
|
6
|
-
300: string;
|
|
7
|
-
400: string;
|
|
8
|
-
600: string;
|
|
9
|
-
700: string;
|
|
10
|
-
800: string;
|
|
11
|
-
900: string;
|
|
12
|
-
main: string;
|
|
13
|
-
contrastText: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module "@mui/material/styles" {
|
|
17
|
-
interface Palette {
|
|
18
|
-
dark: CustomPaletteColor;
|
|
19
|
-
paste: CustomPaletteColor;
|
|
20
|
-
marron: CustomPaletteColor;
|
|
21
|
-
orange: CustomPaletteColor;
|
|
22
|
-
bluish: CustomPaletteColor;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface PaletteOptions {
|
|
26
|
-
gold: CustomPaletteColor;
|
|
27
|
-
dark: CustomPaletteColor;
|
|
28
|
-
paste: CustomPaletteColor;
|
|
29
|
-
marron: CustomPaletteColor;
|
|
30
|
-
orange: CustomPaletteColor;
|
|
31
|
-
bluish: CustomPaletteColor;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// =================================================================
|
|
35
|
-
|
|
36
|
-
export const grey = {
|
|
37
|
-
900: "#2B3445", // Main Text
|
|
38
|
-
800: "#373F50", // Paragraph
|
|
39
|
-
700: "#4B566B",
|
|
40
|
-
600: "#7D879C", // Low Priority form Title/Text
|
|
41
|
-
500: "#AEB4BE",
|
|
42
|
-
400: "#DAE1E7", // Border
|
|
43
|
-
300: "#E3E9EF",
|
|
44
|
-
200: "#F3F5F9", // Line Stroke
|
|
45
|
-
100: "#FFFFFF",
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const primary = {
|
|
49
|
-
100: "#FCE9EC",
|
|
50
|
-
200: "#F8C7CF",
|
|
51
|
-
300: "#F07D90",
|
|
52
|
-
400: "#EC6178",
|
|
53
|
-
500: "#D23F57",
|
|
54
|
-
600: "#E63E58",
|
|
55
|
-
700: "#E3364E",
|
|
56
|
-
800: "#DF2E44",
|
|
57
|
-
900: "#D91F33",
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const secondary = {
|
|
61
|
-
100: "#e8e8ee",
|
|
62
|
-
200: "#b9bacb",
|
|
63
|
-
300: "#8a8ca8",
|
|
64
|
-
400: "#5b5d85",
|
|
65
|
-
500: "#141850",
|
|
66
|
-
600: "#0F3460",
|
|
67
|
-
700: "#101340",
|
|
68
|
-
800: "#0e1138",
|
|
69
|
-
900: "#0c0e30",
|
|
70
|
-
main: "#0F3460",
|
|
71
|
-
dark: "#0c0e30",
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const error = {
|
|
75
|
-
100: "#FFEAEA",
|
|
76
|
-
200: "#FFCBCB",
|
|
77
|
-
300: "#FFA9A9",
|
|
78
|
-
400: "#FF6D6D",
|
|
79
|
-
500: "#FF5353",
|
|
80
|
-
600: "#FF4C4C",
|
|
81
|
-
700: "#FF4242",
|
|
82
|
-
800: "#FF3939",
|
|
83
|
-
900: "#FF2929",
|
|
84
|
-
main: "#E94560",
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const success = {
|
|
88
|
-
100: "#E7F9ED",
|
|
89
|
-
200: "#C2F1D1",
|
|
90
|
-
300: "#99E8B3",
|
|
91
|
-
400: "#52D77E",
|
|
92
|
-
500: "#33D067",
|
|
93
|
-
600: "#2ECB5F",
|
|
94
|
-
700: "#27C454",
|
|
95
|
-
800: "#20BE4A",
|
|
96
|
-
900: "#0b7724",
|
|
97
|
-
main: "rgb(51, 208, 103)",
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const blue = {
|
|
101
|
-
50: "#f3f5f9",
|
|
102
|
-
100: "#DBF0FE",
|
|
103
|
-
200: "#B8DEFE",
|
|
104
|
-
300: "#94C9FE",
|
|
105
|
-
400: "#7AB6FD",
|
|
106
|
-
500: "#4E97FD",
|
|
107
|
-
600: "#3975D9",
|
|
108
|
-
700: "#2756B6",
|
|
109
|
-
800: "#183C92",
|
|
110
|
-
900: "#0E2979",
|
|
111
|
-
main: "#4E97FD",
|
|
112
|
-
contrastText: "#FFFFFF",
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export const marron = {
|
|
116
|
-
50: "#f3f5f9",
|
|
117
|
-
100: "#F6F2ED",
|
|
118
|
-
200: "#F8DBD1",
|
|
119
|
-
300: "#EBBCB3",
|
|
120
|
-
400: "#D89C98",
|
|
121
|
-
600: "#A3545C",
|
|
122
|
-
700: "#883948",
|
|
123
|
-
800: "#6E2438",
|
|
124
|
-
900: "#5B162F",
|
|
125
|
-
main: "#BE7374",
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const paste = {
|
|
129
|
-
50: "#F5F5F5",
|
|
130
|
-
100: "#DDFBF1",
|
|
131
|
-
200: "#BDF7E8",
|
|
132
|
-
300: "#97E8DA",
|
|
133
|
-
400: "#76D2CA",
|
|
134
|
-
600: "#36929A",
|
|
135
|
-
700: "#257181",
|
|
136
|
-
800: "#175368",
|
|
137
|
-
900: "#0E3D56",
|
|
138
|
-
main: "#4BB4B4",
|
|
139
|
-
contrastText: "#FFFFFF",
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const orange = {
|
|
143
|
-
50: "#FEE9D2",
|
|
144
|
-
100: "#FDD8AF",
|
|
145
|
-
200: "#FCC487",
|
|
146
|
-
300: "#FCB05F",
|
|
147
|
-
400: "#FB9C37",
|
|
148
|
-
500: "#FA8C16",
|
|
149
|
-
600: "#C86904",
|
|
150
|
-
700: "#A05403",
|
|
151
|
-
800: "#783F03",
|
|
152
|
-
900: "#502A02",
|
|
153
|
-
main: "#FA8C16",
|
|
154
|
-
dark: "#C86904",
|
|
155
|
-
light: "#FDD8AF",
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export const bluish = {
|
|
159
|
-
100: "#DDFBF1",
|
|
160
|
-
200: "#BDF7E8",
|
|
161
|
-
300: "#97E8DA",
|
|
162
|
-
400: "#76D2CA",
|
|
163
|
-
500: "#4BB4B4",
|
|
164
|
-
600: "#36929A",
|
|
165
|
-
700: "#257181",
|
|
166
|
-
800: "#175368",
|
|
167
|
-
900: "#0E3D56",
|
|
168
|
-
main: "#4BB4B4",
|
|
169
|
-
dark: "#36929A",
|
|
170
|
-
light: "#BDF7E8",
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export const warning = {
|
|
174
|
-
100: "#FFF8E5",
|
|
175
|
-
main: "#FFCD4E",
|
|
176
|
-
dark: "#FA8C16",
|
|
177
|
-
contrastText: "#FFFFFF",
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export const gold = {
|
|
181
|
-
main: "#BB9C36",
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
export const bluishBackground = "#F6F9FC";
|
|
185
|
-
|
|
186
|
-
export const dark = { main: "#1F2937" };
|
|
187
|
-
export const white = { main: "#fff" };
|
|
188
|
-
|
|
189
|
-
export const themeColors = {
|
|
190
|
-
dark,
|
|
191
|
-
grey,
|
|
192
|
-
gold,
|
|
193
|
-
paste,
|
|
194
|
-
error,
|
|
195
|
-
orange,
|
|
196
|
-
marron,
|
|
197
|
-
bluish,
|
|
198
|
-
warning,
|
|
199
|
-
success,
|
|
200
|
-
secondary,
|
|
201
|
-
info: blue,
|
|
202
|
-
divider: grey[200],
|
|
203
|
-
background: { default: grey[100] },
|
|
204
|
-
text: { primary: grey[900], secondary: grey[800], disabled: grey[400] },
|
|
205
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { components } from "./components";
|
|
2
|
-
import { typography } from "./typography";
|
|
3
|
-
import { primary, themeColors } from "./theme-colors";
|
|
4
|
-
|
|
5
|
-
/********************************************
|
|
6
|
-
* You can delete themeOptions.ts file and
|
|
7
|
-
* rename this file to `themeOptions.ts`
|
|
8
|
-
* Follow the documentation for more details
|
|
9
|
-
*********************************************/
|
|
10
|
-
|
|
11
|
-
const THEMES = {
|
|
12
|
-
GIFT: "GIFT",
|
|
13
|
-
HEALTH: "HEALTH",
|
|
14
|
-
DEFAULT: "DEFAULT",
|
|
15
|
-
GROCERY: "GROCERY",
|
|
16
|
-
FURNITURE: "FURNITURE",
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const breakpoints = {
|
|
20
|
-
values: {
|
|
21
|
-
xs: 0,
|
|
22
|
-
sm: 600,
|
|
23
|
-
md: 960,
|
|
24
|
-
lg: 1280,
|
|
25
|
-
xl: 1600,
|
|
26
|
-
xxl: 1920,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const themesOptionList = {
|
|
31
|
-
[THEMES.DEFAULT]: {
|
|
32
|
-
typography,
|
|
33
|
-
breakpoints,
|
|
34
|
-
components: { ...components },
|
|
35
|
-
palette: { primary: { ...primary, light: primary[100] }, ...themeColors },
|
|
36
|
-
},
|
|
37
|
-
// [THEMES.GROCERY]: {
|
|
38
|
-
// typography,
|
|
39
|
-
// breakpoints,
|
|
40
|
-
// components: { ...components },
|
|
41
|
-
// palette: { primary: { ...primary, light: primary[100] }, ...themeColors },
|
|
42
|
-
// },
|
|
43
|
-
// [THEMES.FURNITURE]: {
|
|
44
|
-
// typography,
|
|
45
|
-
// breakpoints,
|
|
46
|
-
// components: { ...components },
|
|
47
|
-
// palette: { primary: { ...paste, light: paste[100] }, ...themeColors },
|
|
48
|
-
// },
|
|
49
|
-
// [THEMES.HEALTH]: {
|
|
50
|
-
// typography,
|
|
51
|
-
// breakpoints,
|
|
52
|
-
// components: { ...components },
|
|
53
|
-
// palette: { primary: { ...blue, light: blue[100] }, ...themeColors },
|
|
54
|
-
// },
|
|
55
|
-
// [THEMES.GIFT]: {
|
|
56
|
-
// typography,
|
|
57
|
-
// breakpoints,
|
|
58
|
-
// components: { ...components },
|
|
59
|
-
// palette: { primary: { ...marron, light: marron[100] }, ...themeColors },
|
|
60
|
-
// },
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const themeOptions = () => {
|
|
64
|
-
// YOU CAN SET ANOTHER THEME HERE E.G. [THEMES.GROCERY] OR [THEMES.FURNITURE] ETC.
|
|
65
|
-
const themeOption = themesOptionList[THEMES.DEFAULT];
|
|
66
|
-
return themeOption;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export default themeOptions;
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { components } from "./components";
|
|
2
|
-
import { typography } from "./typography";
|
|
3
|
-
import {
|
|
4
|
-
blue,
|
|
5
|
-
marron,
|
|
6
|
-
paste,
|
|
7
|
-
primary,
|
|
8
|
-
themeColors,
|
|
9
|
-
orange,
|
|
10
|
-
bluish,
|
|
11
|
-
success,
|
|
12
|
-
warning,
|
|
13
|
-
gold,
|
|
14
|
-
} from "./theme-colors";
|
|
15
|
-
|
|
16
|
-
const THEMES = {
|
|
17
|
-
GIFT: "GIFT",
|
|
18
|
-
HEALTH: "HEALTH",
|
|
19
|
-
DEFAULT: "DEFAULT",
|
|
20
|
-
GROCERY: "GROCERY",
|
|
21
|
-
PASTE: "PASTE",
|
|
22
|
-
ORANGE: "ORANGE",
|
|
23
|
-
GOLD: "GOLD",
|
|
24
|
-
BLUISH: "BLUISH",
|
|
25
|
-
GREEN: "GREEN",
|
|
26
|
-
YELLOW: "YELLOW",
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const breakpoints = {
|
|
30
|
-
values: {
|
|
31
|
-
xs: 0,
|
|
32
|
-
sm: 600,
|
|
33
|
-
md: 960,
|
|
34
|
-
lg: 1280,
|
|
35
|
-
xl: 1600,
|
|
36
|
-
xxl: 1920,
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/*
|
|
41
|
-
WE CREATED MULTIPLE THEME OPTIONS FOR DIFFERENT SHOP VARIATION.
|
|
42
|
-
|
|
43
|
-
YOU CAN JUST KEEP [THEMES.DEFAULT] AND REMOVE OTHER THEME OPTIONS.
|
|
44
|
-
*/
|
|
45
|
-
const themesOptionList = {
|
|
46
|
-
[THEMES.DEFAULT]: {
|
|
47
|
-
typography,
|
|
48
|
-
components,
|
|
49
|
-
breakpoints,
|
|
50
|
-
palette: { primary: { ...primary, light: primary[100] }, ...themeColors },
|
|
51
|
-
},
|
|
52
|
-
[THEMES.GROCERY]: {
|
|
53
|
-
typography,
|
|
54
|
-
components,
|
|
55
|
-
breakpoints,
|
|
56
|
-
palette: { primary: { ...primary, light: primary[100] }, ...themeColors },
|
|
57
|
-
},
|
|
58
|
-
[THEMES.PASTE]: {
|
|
59
|
-
typography,
|
|
60
|
-
components,
|
|
61
|
-
breakpoints,
|
|
62
|
-
palette: { primary: { ...paste, light: paste[100] }, ...themeColors },
|
|
63
|
-
},
|
|
64
|
-
[THEMES.HEALTH]: {
|
|
65
|
-
typography,
|
|
66
|
-
components,
|
|
67
|
-
breakpoints,
|
|
68
|
-
palette: { primary: { ...blue, light: blue[100] }, ...themeColors },
|
|
69
|
-
},
|
|
70
|
-
[THEMES.GIFT]: {
|
|
71
|
-
typography,
|
|
72
|
-
components,
|
|
73
|
-
breakpoints,
|
|
74
|
-
palette: { primary: { ...marron, light: marron[100] }, ...themeColors },
|
|
75
|
-
},
|
|
76
|
-
[THEMES.ORANGE]: {
|
|
77
|
-
typography,
|
|
78
|
-
components,
|
|
79
|
-
breakpoints,
|
|
80
|
-
palette: { primary: { ...orange }, ...themeColors },
|
|
81
|
-
},
|
|
82
|
-
[THEMES.GOLD]: {
|
|
83
|
-
typography,
|
|
84
|
-
components,
|
|
85
|
-
breakpoints,
|
|
86
|
-
palette: { primary: { ...gold }, ...themeColors },
|
|
87
|
-
},
|
|
88
|
-
[THEMES.BLUISH]: {
|
|
89
|
-
typography,
|
|
90
|
-
components,
|
|
91
|
-
breakpoints,
|
|
92
|
-
palette: { primary: { ...bluish }, ...themeColors },
|
|
93
|
-
},
|
|
94
|
-
[THEMES.GREEN]: {
|
|
95
|
-
typography,
|
|
96
|
-
components,
|
|
97
|
-
breakpoints,
|
|
98
|
-
palette: { primary: { ...success }, ...themeColors },
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
[THEMES.YELLOW]: {
|
|
102
|
-
typography,
|
|
103
|
-
components,
|
|
104
|
-
breakpoints,
|
|
105
|
-
palette: { primary: { ...warning }, ...themeColors },
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const themeOptions = (pathname: string) => {
|
|
110
|
-
let themeOption;
|
|
111
|
-
|
|
112
|
-
const path = pathname || "/"; // Fallback to root if null
|
|
113
|
-
/*
|
|
114
|
-
YOU CAN ALSO REMOVE updateTheme function
|
|
115
|
-
AND FOLLOWING ENTIRE switch case BLOCK.
|
|
116
|
-
*/
|
|
117
|
-
const updateTheme = (themeName: string) => {
|
|
118
|
-
themeOption = themesOptionList[themeName];
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
switch (path) {
|
|
122
|
-
case "/":
|
|
123
|
-
updateTheme(THEMES.DEFAULT);
|
|
124
|
-
break;
|
|
125
|
-
|
|
126
|
-
case "/furniture-1":
|
|
127
|
-
updateTheme(THEMES.PASTE);
|
|
128
|
-
break;
|
|
129
|
-
|
|
130
|
-
case "/medical":
|
|
131
|
-
updateTheme(THEMES.PASTE);
|
|
132
|
-
break;
|
|
133
|
-
|
|
134
|
-
case "/furniture-2":
|
|
135
|
-
updateTheme(THEMES.ORANGE);
|
|
136
|
-
break;
|
|
137
|
-
|
|
138
|
-
case "/furniture-3":
|
|
139
|
-
updateTheme(THEMES.GOLD);
|
|
140
|
-
break;
|
|
141
|
-
|
|
142
|
-
case "/health-beauty":
|
|
143
|
-
updateTheme(THEMES.HEALTH);
|
|
144
|
-
break;
|
|
145
|
-
|
|
146
|
-
case "/gift-shop":
|
|
147
|
-
updateTheme(THEMES.GIFT);
|
|
148
|
-
break;
|
|
149
|
-
|
|
150
|
-
default:
|
|
151
|
-
if (path.startsWith("/grocery-4")) {
|
|
152
|
-
themeOption = themesOptionList[THEMES.GREEN];
|
|
153
|
-
} else if (path.startsWith("/gadget-3")) {
|
|
154
|
-
themeOption = themesOptionList[THEMES.HEALTH];
|
|
155
|
-
} else if (path.startsWith("/admin") || path.startsWith("/vendor")) {
|
|
156
|
-
themeOption = themesOptionList[THEMES.HEALTH];
|
|
157
|
-
} else {
|
|
158
|
-
themeOption = themesOptionList[THEMES.DEFAULT];
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
/*
|
|
164
|
-
IF YOU REMOVE THE switch case, YOU NEED TO ASSIGN VALUE TO themeOptions
|
|
165
|
-
E.G. themeOption = themesOptions[THEMES.DEFAULT];
|
|
166
|
-
*/
|
|
167
|
-
// themeOption = themesOptions[THEMES.DEFAULT];
|
|
168
|
-
|
|
169
|
-
return themeOption;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export default themeOptions;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
import { usePathname } from "next/navigation";
|
|
5
|
-
import CssBaseline from "@mui/material/CssBaseline";
|
|
6
|
-
import MuiThemeProvider from "@mui/material/styles/ThemeProvider";
|
|
7
|
-
import responsiveFontSizes from "@mui/material/styles/responsiveFontSizes";
|
|
8
|
-
import createTheme, { ThemeOptions } from "@mui/material/styles/createTheme";
|
|
9
|
-
import merge from "lodash/merge";
|
|
10
|
-
import customThemeOptions from "./theme-options";
|
|
11
|
-
import NextAppDirEmotionCacheProvider from "./emotion-cache";
|
|
12
|
-
import { ThemeItem } from "@evenicanpm/storefront-core/src/api-manager/datasources/e4/graphqlRequestSdk";
|
|
13
|
-
|
|
14
|
-
const ThemeProvider = ({
|
|
15
|
-
children,
|
|
16
|
-
baseTheme,
|
|
17
|
-
}: {
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
baseTheme: ThemeItem | null | undefined;
|
|
20
|
-
}) => {
|
|
21
|
-
const pathname = usePathname();
|
|
22
|
-
const themeOptions = customThemeOptions(pathname);
|
|
23
|
-
const mergedThemeOptions = merge({}, { ...themeOptions, ...baseTheme });
|
|
24
|
-
let theme = createTheme(mergedThemeOptions as ThemeOptions);
|
|
25
|
-
|
|
26
|
-
theme = responsiveFontSizes(theme);
|
|
27
|
-
|
|
28
|
-
// theme shadows
|
|
29
|
-
theme.shadows[1] = "0px 1px 3px rgba(3, 0, 71, 0.09)";
|
|
30
|
-
theme.shadows[2] = "0px 4px 16px rgba(43, 52, 69, 0.1)";
|
|
31
|
-
theme.shadows[3] = "0px 8px 45px rgba(3, 0, 71, 0.09)";
|
|
32
|
-
theme.shadows[4] = "0px 0px 28px rgba(3, 0, 71, 0.01)";
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<NextAppDirEmotionCacheProvider options={{ key: "css" }}>
|
|
36
|
-
<MuiThemeProvider theme={theme}>
|
|
37
|
-
<CssBaseline />
|
|
38
|
-
{children}
|
|
39
|
-
</MuiThemeProvider>
|
|
40
|
-
</NextAppDirEmotionCacheProvider>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default ThemeProvider;
|
package/src/theme/typography.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Open_Sans } from "next/font/google";
|
|
2
|
-
export const fontSize = 14;
|
|
3
|
-
|
|
4
|
-
// const roboto = Roboto({
|
|
5
|
-
// weight: ["400", "500", "700", "900"],
|
|
6
|
-
// subsets: ["latin-ext"],
|
|
7
|
-
// variable: "--font-roboto",
|
|
8
|
-
// });
|
|
9
|
-
|
|
10
|
-
const open_sans = Open_Sans({
|
|
11
|
-
weight: ["400", "500", "700"],
|
|
12
|
-
subsets: ["latin-ext"],
|
|
13
|
-
variable: "--font-open_sans",
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export const typography = {
|
|
17
|
-
fontSize,
|
|
18
|
-
htmlFontSize: 16,
|
|
19
|
-
fontFamily: open_sans.style.fontFamily,
|
|
20
|
-
body1: { fontSize },
|
|
21
|
-
body2: { fontSize },
|
|
22
|
-
};
|
package/src/theme/utils.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const classes = () => {
|
|
2
|
-
const obj: Record<string, unknown> = {};
|
|
3
|
-
|
|
4
|
-
for (let i = 1; i < 11; i++) {
|
|
5
|
-
// PADDING
|
|
6
|
-
obj[`.p-${i}`] = { padding: i + "rem" };
|
|
7
|
-
obj[`.pt-${i}`] = { paddingTop: i + "rem" };
|
|
8
|
-
obj[`.pb-${i}`] = { paddingBottom: i + "rem" };
|
|
9
|
-
|
|
10
|
-
// MARGIN
|
|
11
|
-
obj[`.m-${i}`] = { margin: i + "rem" };
|
|
12
|
-
obj[`.mt-${i}`] = { marginTop: i + "rem" };
|
|
13
|
-
obj[`.mb-${i}`] = { marginBottom: i + "rem" };
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return obj;
|
|
17
|
-
};
|