@evenicanpm/storefront-core 1.1.0 → 1.2.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/EvenicaTheme.ts +9 -0
- package/.storybook/main.ts +42 -24
- package/.storybook/manager.ts +6 -0
- package/.storybook/preview.tsx +42 -0
- package/__mocks__/countries.ts +11 -0
- package/__mocks__/create-mutation.ts +60 -0
- package/__mocks__/create-query.ts +93 -0
- package/__mocks__/data/categories.json +795 -0
- package/__mocks__/get-product-by-id.ts +7 -0
- package/__mocks__/next-auth-react.ts +9 -0
- package/__mocks__/next-font.js +2 -2
- package/__mocks__/next-headers.js +13 -0
- package/__mocks__/next-image.tsx +7 -0
- package/__mocks__/next-link.js +19 -0
- package/__mocks__/next-navigation.ts +29 -0
- package/__mocks__/product-dimensions.ts +635 -0
- package/__mocks__/products.ts +533 -0
- package/__mocks__/query-client.ts +3 -0
- package/__mocks__/wishlists.json +408 -0
- package/docs.tsconfig.json +33 -33
- package/package.json +43 -42
- package/src/api-manager/datasources/d365/d365-address.datasource.ts +127 -127
- package/src/api-manager/datasources/d365/d365-base.datasource.ts +4 -4
- package/src/api-manager/datasources/d365/d365-cart.datasource.ts +428 -428
- package/src/api-manager/datasources/d365/d365-categories.datasource.ts +30 -30
- package/src/api-manager/datasources/d365/d365-order.datasource.ts +54 -54
- package/src/api-manager/datasources/d365/d365-organization.datasource.ts +74 -74
- package/src/api-manager/datasources/d365/d365-product.datasource.ts +253 -253
- package/src/api-manager/datasources/d365/d365-session.datasource.ts +15 -15
- package/src/api-manager/datasources/d365/d365-user.datasource.ts +248 -248
- package/src/api-manager/datasources/d365/d365.datasource.ts +37 -37
- package/src/api-manager/datasources/d365/index.ts +2 -2
- package/src/api-manager/datasources/d365/test-context.ts +22 -22
- package/src/api-manager/datasources/d365/utils/create-search-criteria.ts +8 -8
- package/src/api-manager/datasources/d365/utils/decode-jwt.ts +5 -5
- package/src/api-manager/datasources/d365/utils/get-context-cookie.ts +15 -15
- package/src/api-manager/datasources/d365/utils/parse-object.ts +5 -5
- package/src/api-manager/datasources/d365/utils/product-images-utils.ts +28 -28
- package/src/api-manager/datasources/d365/utils/product-inventory-utils.ts +24 -24
- package/src/api-manager/datasources/e4/address/e4-address.datasource.ts +91 -91
- package/src/api-manager/datasources/e4/address/e4-address.remaps.ts +45 -45
- package/src/api-manager/datasources/e4/address/e4-address.translator.ts +64 -64
- package/src/api-manager/datasources/e4/cart/e4-cart.datasource.ts +247 -247
- package/src/api-manager/datasources/e4/cart/e4-cart.remaps.ts +74 -74
- package/src/api-manager/datasources/e4/cart/e4-cart.translator.ts +14 -11
- package/src/api-manager/datasources/e4/categories/e4-categories.datasource.ts +29 -29
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +140 -140
- package/src/api-manager/datasources/e4/e4.datasource.ts +18 -18
- package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +39793 -7866
- package/src/api-manager/datasources/e4/order/e4-order.datasource.ts +38 -38
- package/src/api-manager/datasources/e4/order/e4-order.remaps.ts +76 -76
- package/src/api-manager/datasources/e4/organization/e4-organization.datasource.ts +11 -11
- package/src/api-manager/datasources/e4/product/e4-product.datasource.ts +169 -169
- package/src/api-manager/datasources/e4/product/e4-product.remaps.ts +66 -66
- package/src/api-manager/datasources/e4/product/e4-product.translator.ts +288 -288
- package/src/api-manager/datasources/e4/session/e4-session.datasource.ts +33 -33
- package/src/api-manager/datasources/e4/session/e4-session.translator.ts +13 -13
- package/src/api-manager/datasources/e4/user/e4-user.datasource.ts +138 -138
- package/src/api-manager/datasources/e4/user/e4-user.remaps.ts +37 -37
- package/src/api-manager/datasources/e4/user/e4-user.translator.ts +23 -23
- package/src/api-manager/datasources/e4/utils/unwrap-e4-variants.ts +44 -44
- package/src/api-manager/index.ts +108 -105
- package/src/api-manager/lib/category-helpers.ts +81 -81
- package/src/api-manager/lib/get-dynamics-context.ts +25 -25
- package/src/api-manager/lib/get-graphql-client.ts +33 -33
- package/src/api-manager/schemas/address.schema.ts +12 -12
- package/src/api-manager/schemas/cart.schema.ts +47 -47
- package/src/api-manager/schemas/d365.schema.ts +5430 -5430
- package/src/api-manager/schemas/order.schema.ts +12 -12
- package/src/api-manager/schemas/organization.schema.ts +16 -16
- package/src/api-manager/schemas/product.schema.ts +77 -77
- package/src/api-manager/schemas/session.schema.ts +7 -7
- package/src/api-manager/schemas/user.schema.ts +24 -24
- package/src/api-manager/services/address/mutations/create-address.ts +13 -13
- package/src/api-manager/services/address/mutations/delete-address.ts +12 -12
- package/src/api-manager/services/address/mutations/get-delivery-options.ts +12 -12
- package/src/api-manager/services/address/mutations/update-address.ts +12 -12
- package/src/api-manager/services/address/queries/get-countries.ts +6 -6
- package/src/api-manager/services/address/queries/get-states.ts +8 -8
- package/src/api-manager/services/cart/mutations/add-discount-code.ts +21 -21
- package/src/api-manager/services/cart/mutations/add-to-cart.ts +42 -39
- package/src/api-manager/services/cart/mutations/checkout.ts +19 -16
- package/src/api-manager/services/cart/mutations/delete-cart-line.ts +13 -10
- package/src/api-manager/services/cart/mutations/get-payment-accept-result.ts +12 -12
- package/src/api-manager/services/cart/mutations/remove-cart-line-delivery-mode.ts +15 -15
- package/src/api-manager/services/cart/mutations/remove-discount-code.ts +12 -12
- package/src/api-manager/services/cart/mutations/update-cart-line-delivery-mode.ts +15 -15
- package/src/api-manager/services/cart/mutations/update-cart-lines.ts +16 -13
- package/src/api-manager/services/cart/mutations/update-cart.ts +16 -13
- package/src/api-manager/services/cart/queries/get-cart-lines-inventory.ts +8 -8
- package/src/api-manager/services/cart/queries/get-cart.ts +5 -5
- package/src/api-manager/services/cart/queries/get-payment-accept-point.ts +10 -10
- package/src/api-manager/services/categories/queries/get-categories.ts +4 -4
- package/src/api-manager/services/create-extension-query.ts +4 -4
- package/src/api-manager/services/create-mutation.ts +50 -50
- package/src/api-manager/services/create-query.ts +249 -248
- package/src/api-manager/services/get-query-client.ts +30 -30
- package/src/api-manager/services/order/queries/get-order-details.ts +9 -9
- package/src/api-manager/services/order/queries/get-orders.ts +7 -7
- package/src/api-manager/services/organization/queries/get-channel-configuration.ts +7 -7
- package/src/api-manager/services/organization/queries/get-stores.ts +9 -9
- package/src/api-manager/services/product/mutations/search-products.ts +10 -10
- package/src/api-manager/services/product/queries/get-product-availability.ts +7 -9
- package/src/api-manager/services/product/queries/get-product-by-id.ts +11 -11
- package/src/api-manager/services/product/queries/get-product-by-ids.ts +8 -8
- package/src/api-manager/services/product/queries/get-product-list.ts +9 -9
- package/src/api-manager/services/product/queries/get-product-prices.ts +10 -10
- package/src/api-manager/services/product/queries/get-related-products.ts +7 -7
- package/src/api-manager/services/product/queries/search-products.ts +6 -6
- package/src/api-manager/services/product/server/product.server.ts +9 -9
- package/src/api-manager/services/session/mutations/session-init.ts +12 -12
- package/src/api-manager/services/session/mutations/session-logout.ts +9 -9
- package/src/api-manager/services/session/queries/get-session.ts +5 -5
- package/src/api-manager/services/user/mutations/add-to-wishlist.ts +35 -35
- package/src/api-manager/services/user/mutations/copy-cart-to-wishlist.ts +14 -14
- package/src/api-manager/services/user/mutations/create-wishlist.ts +11 -11
- package/src/api-manager/services/user/mutations/delete-wishlist.ts +10 -10
- package/src/api-manager/services/user/mutations/remove-from-wishlist.ts +36 -36
- package/src/api-manager/services/user/mutations/update-user.ts +9 -9
- package/src/api-manager/services/user/mutations/update-wishlist.ts +14 -14
- package/src/api-manager/services/user/queries/get-user-counts.ts +5 -5
- package/src/api-manager/services/user/queries/get-user.ts +5 -5
- package/src/api-manager/services/user/queries/get-wishlist-details.ts +10 -10
- package/src/api-manager/services/user/queries/get-wishlists.ts +5 -5
- package/src/api-manager/types/Datasource.ts +152 -149
- package/src/auth/auth-options.test.ts +97 -97
- package/src/auth/auth-options.ts +47 -46
- package/src/auth/msal.ts +43 -43
- package/src/auth/next-auth-cookie-manager.ts +46 -46
- package/src/auth/providers/aadb2c-provider.ts +21 -21
- package/src/auth/providers/authentik-provider.ts +14 -14
- package/src/auth/providers/index.ts +3 -3
- package/src/auth/providers/keycloak-provider.ts +13 -13
- package/src/auth/refresh-token-url-keys.ts +3 -3
- package/src/auth/refresh-token.ts +100 -100
- package/src/auth/signout.ts +31 -31
- package/src/auth/types/next-auth.d.ts +22 -22
- package/src/cms/blocks/block-manager.tsx +47 -47
- package/src/cms/blocks/components/brand-logos-scroller.tsx +45 -45
- package/src/cms/blocks/components/category-card.tsx +34 -34
- package/src/cms/blocks/components/category-carousel/index.tsx +37 -37
- package/src/cms/blocks/components/feature-pill.tsx +89 -89
- package/src/cms/blocks/components/featured-categories.tsx +29 -29
- package/src/cms/blocks/components/featured-products.tsx +29 -29
- package/src/cms/blocks/components/footer/data/index.ts +15 -15
- package/src/cms/blocks/components/footer/index.tsx +58 -58
- package/src/cms/blocks/components/footer/interfaces.ts +20 -20
- package/src/cms/blocks/components/footer/sections/footer-app-store.tsx +32 -32
- package/src/cms/blocks/components/footer/sections/footer-contact.tsx +18 -18
- package/src/cms/blocks/components/footer/sections/footer-links.tsx +19 -19
- package/src/cms/blocks/components/footer/sections/footer-logo.tsx +11 -11
- package/src/cms/blocks/components/footer/sections/footer-social-links.tsx +42 -42
- package/src/cms/blocks/components/footer/styles/index.ts +20 -20
- package/src/cms/blocks/components/footer.tsx +58 -58
- package/src/cms/blocks/components/hero-carousel/index.tsx +33 -33
- package/src/cms/blocks/components/hero.tsx +53 -53
- package/src/cms/blocks/components/image.tsx +24 -24
- package/src/cms/blocks/components/media-card.tsx +27 -27
- package/src/cms/blocks/components/product-carousel/index.tsx +69 -69
- package/src/cms/blocks/components/product-section-fullwidth/index.tsx +70 -70
- package/src/cms/blocks/components/rich-text.tsx +6 -6
- package/src/cms/blocks/components/seo/index.tsx +37 -37
- package/src/cms/blocks/components/services/index.tsx +11 -11
- package/src/cms/blocks/components/services/service-card.tsx +37 -37
- package/src/cms/blocks/components/shared/featured-product-card.tsx +16 -16
- package/src/cms/blocks/components/shared/product-category-item.tsx +28 -28
- package/src/cms/blocks/components/shared/product-grid.tsx +51 -51
- package/src/cms/blocks/components/shared/top-categories-card.tsx +43 -43
- package/src/cms/blocks/components/shared/top-rating-product-card.tsx +45 -45
- package/src/cms/blocks/icons/components/category.tsx +4 -4
- package/src/cms/blocks/icons/components/dotted-star.tsx +31 -31
- package/src/cms/blocks/icons/components/fallback-icon.tsx +24 -24
- package/src/cms/blocks/icons/components/gift-box.tsx +9 -9
- package/src/cms/blocks/icons/components/light.tsx +4 -4
- package/src/cms/blocks/icons/components/new-arrival.tsx +9 -9
- package/src/cms/blocks/icons/components/rank-badge.tsx +31 -31
- package/src/cms/blocks/icons/index.ts +6 -6
- package/src/cms/blocks/interfaces.ts +146 -146
- package/src/cms/blog.ts +198 -198
- package/src/cms/endpoints.ts +39 -39
- package/src/cms/interfaces/navigation.ts +35 -35
- package/src/cms/interfaces/product-data.ts +65 -65
- package/src/cms/pages.ts +119 -119
- package/src/components-v2/BazaarCard.stories.tsx +29 -0
- package/src/components-v2/BazaarCard.tsx +6 -6
- package/src/components-v2/BazaarImage.tsx +3 -3
- package/src/components-v2/BazaarMenu.stories.tsx +31 -0
- package/src/components-v2/BazaarMenu.tsx +32 -32
- package/src/components-v2/BazaarSwitch.stories.tsx +18 -0
- package/src/components-v2/BazaarSwitch.tsx +28 -28
- package/src/components-v2/BazaarTextField.stories.tsx +20 -0
- package/src/components-v2/BazaarTextField.tsx +59 -55
- package/src/components-v2/BorderShadowCard.stories.tsx +25 -0
- package/src/components-v2/BoxShadowCard.tsx +7 -7
- package/src/components-v2/CountryInput.stories.tsx +34 -0
- package/src/components-v2/DropZone.stories.tsx +31 -0
- package/src/components-v2/DropZone.tsx +63 -63
- package/src/components-v2/HoverBox.stories.tsx +31 -0
- package/src/components-v2/HoverBox.tsx +15 -15
- package/src/components-v2/Image.tsx +1 -1
- package/src/components-v2/ImageWithFallback.tsx +36 -36
- package/src/components-v2/LazyImage.tsx +2 -2
- package/src/components-v2/Loading.stories.tsx +18 -0
- package/src/components-v2/Loading.tsx +20 -20
- package/src/components-v2/NoRecords.stories.tsx +18 -0
- package/src/components-v2/SearchInput.stories.tsx +29 -0
- package/src/components-v2/SearchInput.tsx +17 -17
- package/src/components-v2/SiteLogo.stories.tsx +18 -0
- package/src/components-v2/SnackbarProvider.tsx +21 -21
- package/src/components-v2/T/index.tsx +3 -3
- package/src/components-v2/Typography.stories.tsx +47 -0
- package/src/components-v2/Typography.tsx +175 -175
- package/src/components-v2/WhiteButton.stories.tsx +19 -0
- package/src/components-v2/WhiteButton.tsx +10 -10
- package/src/components-v2/accordion/AccordionHeader.stories.tsx +28 -0
- package/src/components-v2/accordion/accordion-header.tsx +22 -22
- package/src/components-v2/carousel/Carousel.stories.tsx +418 -0
- package/src/components-v2/carousel/carousel.tsx +71 -71
- package/src/components-v2/carousel/components/carousel-arrows.tsx +29 -29
- package/src/components-v2/carousel/components/carousel-dots.tsx +11 -11
- package/src/components-v2/carousel/styles/index.ts +70 -70
- package/src/components-v2/carousel-cards/carousel-card-1/CarouselCard1.stories.tsx +64 -0
- package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +50 -50
- package/src/components-v2/carousel-cards/carousel-card-1/styles.ts +28 -28
- package/src/components-v2/categories/Categories.stories.tsx +35 -0
- package/src/components-v2/categories/category-list/category-list.tsx +62 -62
- package/src/components-v2/categories/category-list/styles.ts +18 -18
- package/src/components-v2/categories/category-list/types.ts +2 -2
- package/src/components-v2/categories/category-list-item/category-menu-item.tsx +20 -20
- package/src/components-v2/categories/category-list-item/styles.ts +29 -29
- package/src/components-v2/categories/category-menu.tsx +28 -30
- package/src/components-v2/categories/mega-menu/banner.tsx +63 -63
- package/src/components-v2/categories/mega-menu/column-list.tsx +40 -40
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +37 -37
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +50 -50
- package/src/components-v2/categories/mega-menu/styles.ts +19 -19
- package/src/components-v2/categories/types.ts +9 -9
- package/src/components-v2/countries-input.tsx +58 -58
- package/src/components-v2/flex-box/Flex.stories.tsx +62 -0
- package/src/components-v2/flex-box/flex-between.tsx +10 -10
- package/src/components-v2/flex-box/flex-box.tsx +9 -5
- package/src/components-v2/flex-box/flex-row-center.tsx +5 -5
- package/src/components-v2/header/Header.stories.tsx +18 -0
- package/src/components-v2/header/__tests__/user.test.tsx +189 -189
- package/src/components-v2/header/components/categories-menu.tsx +12 -12
- package/src/components-v2/header/components/mobile-header.tsx +85 -85
- package/src/components-v2/header/components/user.tsx +194 -194
- package/src/components-v2/header/header.tsx +42 -42
- package/src/components-v2/header/hooks/use-header.ts +6 -6
- package/src/components-v2/header/sticky-header.tsx +37 -33
- package/src/components-v2/header/styles/index.ts +14 -14
- package/src/components-v2/icons/cart-bag.tsx +7 -7
- package/src/components-v2/icons/category-outline.tsx +23 -23
- package/src/components-v2/icons/category.tsx +4 -4
- package/src/components-v2/icons/home.tsx +13 -13
- package/src/components-v2/icons/search.tsx +7 -7
- package/src/components-v2/icons/shopping-bag-outlined.tsx +7 -7
- package/src/components-v2/icons/up-down.tsx +15 -15
- package/src/components-v2/icons/user.tsx +7 -7
- package/src/components-v2/icons/user2.tsx +8 -8
- package/src/components-v2/mini-cart/__tests__/cart-item.test.tsx +132 -132
- package/src/components-v2/mini-cart/__tests__/mini-cart.test.tsx +78 -78
- package/src/components-v2/mini-cart/__tests__/test-cart-empty.json +82 -82
- package/src/components-v2/mini-cart/__tests__/test-cart-with-item.json +242 -242
- package/src/components-v2/mini-cart/components/bottom-actions.tsx +50 -50
- package/src/components-v2/mini-cart/components/cart-item.tsx +158 -158
- package/src/components-v2/mini-cart/components/empty-view.tsx +39 -39
- package/src/components-v2/mini-cart/components/top-header.tsx +39 -39
- package/src/components-v2/mini-cart/mini-cart-trigger.tsx +59 -59
- package/src/components-v2/mini-cart/mini-cart.tsx +125 -125
- package/src/components-v2/mobile-navigation/MobileNavigationBar.stories.tsx +39 -0
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +65 -65
- package/src/components-v2/mobile-navigation/styles/index.ts +41 -41
- package/src/components-v2/nav-link/NavLink.stories.tsx +33 -0
- package/src/components-v2/nav-link/NavLink2.stories.tsx +38 -0
- package/src/components-v2/nav-link/NavLink3.stories.tsx +36 -0
- package/src/components-v2/nav-link/nav-link-2.tsx +20 -20
- package/src/components-v2/nav-link/nav-link-3.tsx +51 -51
- package/src/components-v2/nav-link/nav-link.tsx +30 -30
- package/src/components-v2/navbar/categories.tsx +40 -40
- package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +97 -97
- package/src/components-v2/navbar/category-based-menu/styles.ts +51 -51
- package/src/components-v2/navbar/category-based-menu/types.ts +8 -8
- package/src/components-v2/navbar/mega-menu/mega-menu.tsx +90 -90
- package/src/components-v2/navbar/mega-menu/styles.ts +24 -24
- package/src/components-v2/navbar/mobile-menu/mobile-menu.test.tsx +81 -81
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +91 -91
- package/src/components-v2/navbar/nav-list/cms-nav.test.tsx +74 -74
- package/src/components-v2/navbar/nav-list/nav-item-child.tsx +38 -38
- package/src/components-v2/navbar/nav-list/nav-list.tsx +109 -109
- package/src/components-v2/navbar/navbar.tsx +38 -38
- package/src/components-v2/navbar/styles.ts +54 -54
- package/src/components-v2/navbar/utils/transform-nav.test.ts +194 -194
- package/src/components-v2/navbar/utils/transform-nav.ts +29 -29
- package/src/components-v2/no-records.tsx +11 -11
- package/src/components-v2/product-cards/discount-chip.tsx +25 -25
- package/src/components-v2/product-cards/favorite-button.tsx +38 -38
- package/src/components-v2/product-cards/product-card/ProductCard.stories.tsx +62 -0
- package/src/components-v2/product-cards/product-card/product-card.tsx +345 -345
- package/src/components-v2/product-cards/product-card/styles/index.ts +32 -32
- package/src/components-v2/product-cards/product-card-plp/ProductCardPlp.stories.tsx +62 -0
- package/src/components-v2/product-cards/product-card-plp/product-card.tsx +176 -173
- package/src/components-v2/product-cards/product-card-plp/styles/index.ts +25 -25
- package/src/components-v2/product-cards/product-card-plp-list/ProductCardPlpList.stories.tsx +53 -0
- package/src/components-v2/product-cards/product-card-plp-list/components/tags.tsx +19 -19
- package/src/components-v2/product-cards/product-card-plp-list/product-card.tsx +169 -169
- package/src/components-v2/product-cards/product-card-search/ProductCardSearch.stories.tsx +60 -0
- package/src/components-v2/product-cards/product-card-search/product-card.tsx +134 -134
- package/src/components-v2/product-cards/product-card-search/styles/index.ts +33 -33
- package/src/components-v2/product-cards/product-price.tsx +16 -13
- package/src/components-v2/product-cards/product-rating.tsx +14 -14
- package/src/components-v2/product-cards/product-title.tsx +15 -15
- package/src/components-v2/product-cards/quantity-buttons.tsx +45 -45
- package/src/components-v2/product-dialog/ProductDialog.stories.tsx +39 -0
- package/src/components-v2/product-dialog/compound/product-dialog.tsx +127 -127
- package/src/components-v2/product-dialog/index.tsx +17 -17
- package/src/components-v2/product-dimensions/Dimensions.stories.tsx +34 -0
- package/src/components-v2/product-dimensions/__mocks__/data.ts +669 -0
- package/src/components-v2/product-dimensions/compound/dimensions-group-error.tsx +22 -22
- package/src/components-v2/product-dimensions/compound/dimensions-group-label.tsx +11 -11
- package/src/components-v2/product-dimensions/compound/dimensions-group-list-chip.tsx +54 -54
- package/src/components-v2/product-dimensions/compound/dimensions-group-list.tsx +9 -9
- package/src/components-v2/product-dimensions/compound/dimensions-group.tsx +10 -10
- package/src/components-v2/product-dimensions/compound/dimensions.tsx +35 -34
- package/src/components-v2/product-dimensions/index.tsx +26 -26
- package/src/components-v2/product-dimensions/utils/has-selected-dimension.ts +9 -9
- package/src/components-v2/product-quantity-buttons/ProductQuantity.stories.tsx +23 -0
- package/src/components-v2/product-quantity-buttons/compound/quantity-buttons-root.tsx +119 -119
- package/src/components-v2/product-quantity-buttons/index.tsx +7 -7
- package/src/components-v2/product-quantity-variants/ProductQuantity.stories.tsx +18 -0
- package/src/components-v2/product-quantity-variants/index.tsx +74 -69
- package/src/components-v2/products-view/ProductsGrid.stories.tsx +18 -0
- package/src/components-v2/products-view/ProductsList.stories.tsx +20 -0
- package/src/components-v2/products-view/compound/context.ts +23 -23
- package/src/components-v2/products-view/compound/products-grid-view.tsx +73 -64
- package/src/components-v2/products-view/compound/products-list-view.tsx +64 -64
- package/src/components-v2/products-view/compound/types.ts +3 -3
- package/src/components-v2/products-view/index.tsx +22 -21
- package/src/components-v2/progress/ProgressBar.stories.tsx +110 -0
- package/src/components-v2/progress/progress.tsx +56 -56
- package/src/components-v2/scrollbar/Scrollbar.stories.tsx +29 -0
- package/src/components-v2/scrollbar/scrollbar.tsx +12 -12
- package/src/components-v2/scrollbar/styles.ts +8 -8
- package/src/components-v2/search-bar/SearchBarLarge.stories.tsx +16 -0
- package/src/components-v2/search-bar/compound/context.ts +31 -31
- package/src/components-v2/search-bar/compound/results-item-lg.tsx +32 -32
- package/src/components-v2/search-bar/compound/results-item-sm.tsx +31 -31
- package/src/components-v2/search-bar/compound/results-suspense.tsx +19 -19
- package/src/components-v2/search-bar/compound/results.tsx +25 -24
- package/src/components-v2/search-bar/compound/search-bar-root.tsx +23 -23
- package/src/components-v2/search-bar/compound/textfield-adornment-button.tsx +11 -11
- package/src/components-v2/search-bar/compound/textfield-adornment-category.tsx +46 -46
- package/src/components-v2/search-bar/compound/textfield-adornment-search-icon.tsx +16 -16
- package/src/components-v2/search-bar/compound/textfield.tsx +31 -31
- package/src/components-v2/search-bar/hooks/use-click-outside.ts +11 -11
- package/src/components-v2/search-bar/hooks/use-search.ts +53 -52
- package/src/components-v2/search-bar/index.tsx +17 -17
- package/src/components-v2/search-bar/styles/index.ts +29 -29
- package/src/components-v2/search-bar/utils/findCategoryNameById.ts +10 -10
- package/src/components-v2/section/Section.stories.tsx +86 -0
- package/src/components-v2/section/compound/section-header.tsx +24 -24
- package/src/components-v2/section/compound/section.tsx +7 -7
- package/src/components-v2/side-nav/SideNav.stories.tsx +116 -0
- package/src/components-v2/side-nav/side-nav.tsx +36 -34
- package/src/components-v2/site-logo.tsx +6 -6
- package/src/components-v2/sticky/Sticky.stories.tsx +88 -0
- package/src/components-v2/sticky/sticky.tsx +49 -49
- package/src/components-v2/sticky/styles.ts +21 -21
- package/src/components-v2/utils/constants.ts +6 -6
- package/src/components-v2/wishlist-dialogs/__tests__/create-new-list.test.tsx +54 -54
- package/src/components-v2/wishlist-dialogs/__tests__/wishlistDetailData.json +278 -278
- package/src/components-v2/wishlist-dialogs/__tests__/wishlistsData.json +36 -36
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/AddToWishlist.stories.tsx +37 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/add-to-wishlist-button.tsx +47 -47
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +31 -31
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +39 -39
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +19 -19
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/context.ts +8 -8
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-header.tsx +41 -41
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +65 -65
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +73 -73
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/index.tsx +19 -19
- package/src/components-v2/wishlist-dialogs/create-wishlist/CreateWishlistButton.stories.tsx +15 -0
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +37 -37
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +60 -60
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +78 -78
- package/src/components-v2/wishlist-dialogs/create-wishlist/create-wishlist-button.tsx +24 -24
- package/src/components-v2/wishlist-dialogs/create-wishlist/index.tsx +13 -13
- package/src/components-v2/wishlist-dialogs/styles.ts +43 -43
- package/src/hooks/use-cart.ts +58 -58
- package/src/hooks/use-favorite.ts +7 -7
- package/src/hooks/use-overflow-detect.ts +21 -21
- package/src/hooks/use-settings.ts +6 -6
- package/src/hooks/use-variants.ts +78 -83
- package/src/lib/build-detail-url.ts +3 -3
- package/src/lib/build-product-detail-url.ts +6 -6
- package/src/lib/cart-cookie-client-handler.ts +4 -4
- package/src/lib/cart-cookie-handler-constants.ts +3 -3
- package/src/lib/cart-cookie-handler.ts +19 -19
- package/src/lib/category-helpers.ts +81 -81
- package/src/lib/create-graphql-client.ts +12 -12
- package/src/lib/currency-formatter.ts +20 -20
- package/src/lib/get-palette-color.ts +39 -39
- package/src/lib/graphqlRequestSdk.ts +37239 -37239
- package/src/lib/hexToLuma.ts +30 -30
- package/src/lib/lib.ts +15 -15
- package/src/lib/map-helper.ts +50 -50
- package/src/lib/page-slugs.ts +6 -6
- package/src/lib/product-list-types.ts +24 -24
- package/src/lib/refiner-utils.ts +21 -21
- package/src/lib/store-hours-helper.ts +210 -210
- package/src/lib/test-media.ts +14 -14
- package/src/pages-v2/account/account-navigation.tsx +104 -104
- package/src/pages-v2/account/addresses/address-form.tsx +229 -229
- package/src/pages-v2/account/addresses/address-item.tsx +119 -119
- package/src/pages-v2/account/dashboard-header.tsx +105 -105
- package/src/pages-v2/account/orders/icons/delivery.tsx +8 -8
- package/src/pages-v2/account/orders/icons/package-box.tsx +7 -7
- package/src/pages-v2/account/orders/icons/truck-filled.tsx +8 -8
- package/src/pages-v2/account/orders/order-progress.tsx +109 -109
- package/src/pages-v2/account/orders/order-row.tsx +60 -60
- package/src/pages-v2/account/orders/order-summary.tsx +75 -75
- package/src/pages-v2/account/orders/ordered-products.tsx +103 -100
- package/src/pages-v2/account/profile/profile-button.test.tsx +46 -46
- package/src/pages-v2/account/profile/profile-button.tsx +32 -32
- package/src/pages-v2/account/profile/user-info.tsx +52 -52
- package/src/pages-v2/account/styles.ts +22 -22
- package/src/pages-v2/account/table-row.tsx +12 -12
- package/src/pages-v2/account/wishlist/create-new-list.tsx +167 -167
- package/src/pages-v2/account/wishlist/create-wishlist-button.tsx +39 -39
- package/src/pages-v2/account/wishlist/wishlist-item.tsx +88 -88
- package/src/pages-v2/blog/pagination.tsx +26 -26
- package/src/pages-v2/cart/__tests__/cart-item.test.tsx +193 -193
- package/src/pages-v2/cart/__tests__/cart-with-items.json +809 -809
- package/src/pages-v2/cart/__tests__/checkout-form.test.tsx +114 -114
- package/src/pages-v2/cart/__tests__/conutries.json +19405 -19405
- package/src/pages-v2/cart/__tests__/estimate-shipping.test.tsx +64 -64
- package/src/pages-v2/cart/cart-item.tsx +356 -356
- package/src/pages-v2/cart/checkout-form.tsx +168 -168
- package/src/pages-v2/cart/coupon-entry.tsx +110 -110
- package/src/pages-v2/cart/estimate-shipping.tsx +201 -201
- package/src/pages-v2/cart/wrapper.tsx +23 -23
- package/src/pages-v2/checkout/checkout-alt-form/checkout-form.tsx +165 -165
- package/src/pages-v2/checkout/checkout-alt-form/checkout-step.tsx +127 -127
- package/src/pages-v2/checkout/checkout-alt-form/node.tsx +4 -4
- package/src/pages-v2/checkout/checkout-alt-form/step-heading.tsx +34 -34
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/address-card.tsx +97 -97
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/delivery-address.tsx +394 -394
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/new-address-form.tsx +280 -277
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/styles.ts +19 -19
- package/src/pages-v2/checkout/checkout-alt-form/steps/customer-info/customer-information.tsx +127 -127
- package/src/pages-v2/checkout/checkout-alt-form/steps/payment/payment-details.tsx +274 -274
- package/src/pages-v2/checkout/checkout-alt-form/steps/payment/safe-card-preview-data.tsx +26 -26
- package/src/pages-v2/checkout/checkout-alt-form/steps/shipping/delivery-date.tsx +87 -87
- package/src/pages-v2/checkout/checkout-alt-form/steps/shipping/delivery-options.tsx +211 -211
- package/src/pages-v2/checkout/checkout-alt-form/types.ts +15 -15
- package/src/pages-v2/checkout/checkout-alt-summary/cart-item.tsx +49 -49
- package/src/pages-v2/checkout/checkout-alt-summary/checkout-alt-summary.tsx +53 -50
- package/src/pages-v2/checkout/checkout-alt-summary/list-item.tsx +48 -48
- package/src/pages-v2/confirmation/address.tsx +24 -24
- package/src/pages-v2/confirmation/confirmation-summary.tsx +58 -58
- package/src/pages-v2/confirmation/ordered-products.tsx +98 -95
- package/src/pages-v2/product-details/available-shops.tsx +33 -33
- package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +38 -38
- package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +197 -197
- package/src/pages-v2/product-details/bopis/pickup-option-select.tsx +84 -84
- package/src/pages-v2/product-details/bopis/search-header.tsx +40 -40
- package/src/pages-v2/product-details/bopis/store-card/shop-card.tsx +94 -91
- package/src/pages-v2/product-details/bopis/store-card/styles.ts +15 -15
- package/src/pages-v2/product-details/bopis/store-card/utils/convertSecondsToTime.ts +6 -6
- package/src/pages-v2/product-details/bopis/store-card/utils/getDaysResources.ts +21 -21
- package/src/pages-v2/product-details/checkbox-label.tsx +8 -8
- package/src/pages-v2/product-details/currency.ts +15 -15
- package/src/pages-v2/product-details/frequently-bought.tsx +63 -63
- package/src/pages-v2/product-details/frequently-product-card.tsx +44 -41
- package/src/pages-v2/product-details/product-comment.tsx +27 -27
- package/src/pages-v2/product-details/product-description.tsx +13 -13
- package/src/pages-v2/product-details/product-filter-card.tsx +199 -199
- package/src/pages-v2/product-details/product-intro/compound/context.ts +59 -59
- package/src/pages-v2/product-details/product-intro/compound/product-info.tsx +187 -187
- package/src/pages-v2/product-details/product-intro/compound/product-intro-images.tsx +98 -98
- package/src/pages-v2/product-details/product-intro/compound/product-intro.tsx +28 -28
- package/src/pages-v2/product-details/product-intro/compound/thumbnail-with-skeleton.tsx +16 -16
- package/src/pages-v2/product-details/product-intro/utils.ts +26 -26
- package/src/pages-v2/product-details/product-review.tsx +105 -105
- package/src/pages-v2/product-details/product-tabs.tsx +70 -70
- package/src/pages-v2/product-details/related-products.tsx +37 -37
- package/src/pages-v2/product-details/types.ts +6 -6
- package/src/pages-v2/product-list/breadcrumbs.tsx +27 -27
- package/src/pages-v2/product-list/checkbox-label.tsx +8 -8
- package/src/pages-v2/product-list/facet-group.tsx +101 -101
- package/src/pages-v2/product-list/facet.tsx +59 -31
- package/src/pages-v2/product-list/list-filter.tsx +27 -27
- package/src/pages-v2/product-list/pagination.tsx +60 -60
- package/src/pages-v2/product-list/product-list-context.tsx +265 -265
- package/src/pages-v2/product-list/product-list-state.ts +169 -168
- package/src/pages-v2/product-list/product-list-view.tsx +185 -0
- package/src/pages-v2/product-list/product-rating.tsx +7 -7
- package/src/pages-v2/product-list/quick-view-dialog-content.tsx +172 -172
- package/src/pages-v2/product-list/quick-view-dialog.tsx +43 -43
- package/src/pages-v2/product-list/range-filter.tsx +103 -103
- package/src/pages-v2/product-list/scrollbar.tsx +20 -20
- package/src/pages-v2/product-list/search-bar.tsx +190 -138
- package/src/pages-v2/product-list/selected-facets.tsx +61 -61
- package/src/pages-v2/product-list/side-nav.tsx +32 -32
- package/src/pages-v2/product-list/swatch.tsx +61 -61
- package/src/pages-v2/product-list/types.ts +10 -10
- package/src/pages-v2/product-list/use-product-list.ts +5 -5
- package/src/pages-v2/product-list/useCategoryFilter.tsx +18 -18
- package/src/pages-v2/product-list/utils/facet-helpers.ts +1 -1
- package/src/pages-v2/product-list/utils/generate-breadcrumbs.ts +23 -23
- package/src/pages-v2/product-list/utils/getCategoryFilterFromSlug.ts +130 -130
- package/src/pages-v2/product-list/utils/product-list-helper.ts +84 -84
- package/src/pages-v2/product-list/utils/product-list-types.ts +24 -24
- package/src/pages-v2/product-list/utils/search-for-category.ts +59 -59
- package/src/pages-v2/product-list/utils/sort-options.ts +36 -36
- package/src/pages-v2/product-list/utils/use-previous-refiners.ts +9 -9
- package/src/pages-v2/quickorder/context.ts +23 -23
- package/src/pages-v2/quickorder/order-upload.tsx +121 -129
- package/src/pages-v2/quickorder/provider.tsx +192 -192
- package/src/pages-v2/quickorder/quick-order-header.tsx +13 -13
- package/src/pages-v2/quickorder/quick-order-row.tsx +106 -106
- package/src/pages-v2/quickorder/quick-order-table.tsx +55 -55
- package/src/pages-v2/quickorder/quick-order.tsx +521 -0
- package/src/providers/nav-provider/index.tsx +38 -38
- package/src/providers/nav-provider/utils/createLink.ts +11 -11
- package/src/providers/notifications/notification-context.tsx +54 -54
- package/src/providers/notifications/use-notification.ts +7 -7
- package/src/theme/build-mui-theme.ts +88 -88
- package/src/theme/components.ts +141 -141
- package/src/theme/emotion-cache.tsx +74 -74
- package/src/theme/theme-colors.ts +154 -154
- package/src/theme/theme-options-sample.ts +46 -46
- package/src/theme/theme-options.ts +141 -141
- package/src/theme/theme-provider.tsx +22 -22
- package/src/theme/typography.ts +8 -8
- package/src/theme/utils.ts +12 -12
- package/tsconfig.json +32 -30
- package/typedoc.js +10 -10
- package/.storybook/preview.ts +0 -14
- package/src/components/Blocks/BlockManager.tsx +0 -67
- package/src/components/Blocks/Components/BrandLogosScroller.tsx +0 -72
- package/src/components/Blocks/Components/CategoryCard.tsx +0 -47
- package/src/components/Blocks/Components/CategoryCarousel/index.tsx +0 -60
- package/src/components/Blocks/Components/FeaturePill.tsx +0 -99
- package/src/components/Blocks/Components/FeaturedCategories.tsx +0 -41
- package/src/components/Blocks/Components/FeaturedProducts.tsx +0 -41
- package/src/components/Blocks/Components/Footer.tsx +0 -77
- package/src/components/Blocks/Components/Hero.tsx +0 -73
- package/src/components/Blocks/Components/HeroCarousel/index.tsx +0 -42
- package/src/components/Blocks/Components/Image.tsx +0 -39
- package/src/components/Blocks/Components/MediaCard.tsx +0 -41
- package/src/components/Blocks/Components/ProductCarousel/index.tsx +0 -82
- package/src/components/Blocks/Components/ProductSectionFullWidth/index.tsx +0 -103
- package/src/components/Blocks/Components/RichText.tsx +0 -19
- package/src/components/Blocks/Components/Seo/index.tsx +0 -48
- package/src/components/Blocks/Components/Services/index.tsx +0 -21
- package/src/components/Blocks/Components/Services/service-card.tsx +0 -73
- package/src/components/Blocks/Components/shared/featured-product-card.tsx +0 -29
- package/src/components/Blocks/Components/shared/product-category-item.tsx +0 -49
- package/src/components/Blocks/Components/shared/product-grid.tsx +0 -48
- package/src/components/Blocks/Components/shared/top-categories-card.tsx +0 -66
- package/src/components/Blocks/Components/shared/top-rating-product-card.tsx +0 -66
- package/src/components/Blocks/Icons/Components/Category.tsx +0 -14
- package/src/components/Blocks/Icons/Components/DottedStar.tsx +0 -40
- package/src/components/Blocks/Icons/Components/FallbackIcon.tsx +0 -33
- package/src/components/Blocks/Icons/Components/GiftBox.tsx +0 -18
- package/src/components/Blocks/Icons/Components/Light.tsx +0 -13
- package/src/components/Blocks/Icons/Components/NewArrival.tsx +0 -18
- package/src/components/Blocks/Icons/Components/RankBadge.tsx +0 -39
- package/src/components/Blocks/Icons/index.ts +0 -32
- package/src/components/Blocks/index.tsx +0 -16
- package/src/components/Blocks/interfaces.ts +0 -240
- package/src/components/BoxShadowCard.tsx +0 -16
- package/src/components/Footer/data/index.ts +0 -32
- package/src/components/Footer/index.tsx +0 -88
- package/src/components/Footer/interfaces.ts +0 -37
- package/src/components/Footer/sections/FooterAppStore.tsx +0 -45
- package/src/components/Footer/sections/FooterContact.tsx +0 -36
- package/src/components/Footer/sections/FooterLinks.tsx +0 -30
- package/src/components/Footer/sections/FooterLogo.tsx +0 -26
- package/src/components/Footer/sections/FooterSocialLinks.tsx +0 -70
- package/src/components/Footer/styles/index.ts +0 -39
- package/src/components/GlobalLoading/index.tsx +0 -102
- package/src/components/ImageWithFallback.tsx +0 -51
- package/src/components/Loading/index.tsx +0 -36
- package/src/components/NavProvider/index.tsx +0 -59
- package/src/components/NavProvider/utils/createLink.ts +0 -15
- package/src/components/Notifications/README.md +0 -15
- package/src/components/Notifications/notification-context.tsx +0 -82
- package/src/components/Notifications/use-notification.ts +0 -12
- package/src/components/README.md +0 -4
- package/src/components/ReactQueryProvider/index.tsx +0 -12
- package/src/components/Shared/Image.tsx +0 -5
- package/src/components/T/index.tsx +0 -15
- package/src/components/_components/BazaarCard.tsx +0 -21
- package/src/components/_components/BazaarImage.tsx +0 -12
- package/src/components/_components/BazaarMenu.tsx +0 -47
- package/src/components/_components/BazaarSwitch.tsx +0 -37
- package/src/components/_components/BazaarTextField.tsx +0 -73
- package/src/components/_components/DropZone.tsx +0 -86
- package/src/components/_components/HoverBox.tsx +0 -22
- package/src/components/_components/LazyImage.tsx +0 -12
- package/src/components/_components/MiniCartClient.tsx +0 -65
- package/src/components/_components/SearchInput.tsx +0 -28
- package/src/components/_components/SnackbarProvider.tsx +0 -32
- package/src/components/_components/Typography.tsx +0 -227
- package/src/components/_components/WhiteButton.tsx +0 -20
- package/src/components/_components/accordion/accordion-header.tsx +0 -43
- package/src/components/_components/accordion/index.ts +0 -1
- package/src/components/_components/bazaar-types.ts +0 -84
- package/src/components/_components/carousel/carousel.tsx +0 -72
- package/src/components/_components/carousel/components/carousel-arrows.tsx +0 -60
- package/src/components/_components/carousel/components/carousel-dots.tsx +0 -21
- package/src/components/_components/carousel/index.ts +0 -3
- package/src/components/_components/carousel/styles/index.ts +0 -93
- package/src/components/_components/carousel-cards/carousel-card-1/carousel-card-1.tsx +0 -64
- package/src/components/_components/carousel-cards/carousel-card-1/index.ts +0 -1
- package/src/components/_components/carousel-cards/carousel-card-1/styles.ts +0 -34
- package/src/components/_components/carousel-cards/carousel-card-2/carousel-card-2.tsx +0 -78
- package/src/components/_components/carousel-cards/carousel-card-2/index.ts +0 -1
- package/src/components/_components/carousel-cards/carousel-card-2/styles.ts +0 -26
- package/src/components/_components/carousel-cards/carousel-card-3/carousel-card-3.tsx +0 -37
- package/src/components/_components/carousel-cards/carousel-card-3/index.ts +0 -1
- package/src/components/_components/carousel-cards/carousel-card-3/styles.ts +0 -28
- package/src/components/_components/carousel-cards/carousel-card-4/carousel-card-4.tsx +0 -81
- package/src/components/_components/carousel-cards/carousel-card-4/index.ts +0 -1
- package/src/components/_components/carousel-cards/carousel-card-4/styles.ts +0 -27
- package/src/components/_components/categories/category-list/category-list.tsx +0 -59
- package/src/components/_components/categories/category-list/index.ts +0 -1
- package/src/components/_components/categories/category-list/styles.ts +0 -29
- package/src/components/_components/categories/category-list/types.ts +0 -4
- package/src/components/_components/categories/category-list-item/category-menu-item.tsx +0 -37
- package/src/components/_components/categories/category-list-item/index.ts +0 -1
- package/src/components/_components/categories/category-list-item/styles.ts +0 -35
- package/src/components/_components/categories/category-menu.tsx +0 -51
- package/src/components/_components/categories/mega-menu/banner.tsx +0 -60
- package/src/components/_components/categories/mega-menu/column-list.tsx +0 -70
- package/src/components/_components/categories/mega-menu/mega-menu-1.tsx +0 -37
- package/src/components/_components/categories/mega-menu/mega-menu-2.tsx +0 -37
- package/src/components/_components/categories/mega-menu/styles.ts +0 -25
- package/src/components/_components/categories/types.ts +0 -16
- package/src/components/_components/category-cards/category-card-1/category-card-1.tsx +0 -21
- package/src/components/_components/category-cards/category-card-1/index.ts +0 -1
- package/src/components/_components/category-cards/category-card-1/styles.ts +0 -37
- package/src/components/_components/countdown/count-box.tsx +0 -19
- package/src/components/_components/countdown/count-down.tsx +0 -24
- package/src/components/_components/countdown/index.tsx +0 -2
- package/src/components/_components/countdown/useCountDown.ts +0 -41
- package/src/components/_components/data-table/index.ts +0 -2
- package/src/components/_components/data-table/table-header.tsx +0 -91
- package/src/components/_components/data-table/table-pagination.tsx +0 -36
- package/src/components/_components/flex-box/flex-between.tsx +0 -14
- package/src/components/_components/flex-box/flex-box.tsx +0 -9
- package/src/components/_components/flex-box/flex-row-center.tsx +0 -9
- package/src/components/_components/flex-box/index.ts +0 -5
- package/src/components/_components/footer/components/about-links.tsx +0 -23
- package/src/components/_components/footer/components/app-store.tsx +0 -38
- package/src/components/_components/footer/components/customer-care-links.tsx +0 -21
- package/src/components/_components/footer/components/logo.tsx +0 -23
- package/src/components/_components/footer/components/social-links.tsx +0 -43
- package/src/components/_components/footer/data/index.ts +0 -54
- package/src/components/_components/footer/footer-1.tsx +0 -62
- package/src/components/_components/footer/footer-2.tsx +0 -57
- package/src/components/_components/footer/footer-3.tsx +0 -53
- package/src/components/_components/footer/footer-4.tsx +0 -71
- package/src/components/_components/footer/index.ts +0 -4
- package/src/components/_components/footer/styles/index.ts +0 -42
- package/src/components/_components/header/components/categories-menu.tsx +0 -23
- package/src/components/_components/header/components/mobile-header.tsx +0 -75
- package/src/components/_components/header/components/user.tsx +0 -204
- package/src/components/_components/header/header.tsx +0 -63
- package/src/components/_components/header/hooks/use-header.ts +0 -13
- package/src/components/_components/header/index.ts +0 -1
- package/src/components/_components/header/sticky-header.tsx +0 -17
- package/src/components/_components/header/styles/index.ts +0 -24
- package/src/components/_components/icons/cart-bag.tsx +0 -13
- package/src/components/_components/icons/category-outline.tsx +0 -29
- package/src/components/_components/icons/category.tsx +0 -12
- package/src/components/_components/icons/home.tsx +0 -19
- package/src/components/_components/icons/search.tsx +0 -13
- package/src/components/_components/icons/shopping-bag-outlined.tsx +0 -13
- package/src/components/_components/icons/up-down.tsx +0 -21
- package/src/components/_components/icons/user.tsx +0 -13
- package/src/components/_components/icons/user2.tsx +0 -14
- package/src/components/_components/mini-cart/components/bottom-actions.tsx +0 -27
- package/src/components/_components/mini-cart/components/cart-item.tsx +0 -147
- package/src/components/_components/mini-cart/components/empty-view.tsx +0 -29
- package/src/components/_components/mini-cart/components/top-header.tsx +0 -37
- package/src/components/_components/mini-cart/index.ts +0 -1
- package/src/components/_components/mini-cart/mini-cart.tsx +0 -107
- package/src/components/_components/mobile-navigation/index.ts +0 -3
- package/src/components/_components/mobile-navigation/mobile-navigation-bar.tsx +0 -73
- package/src/components/_components/mobile-navigation/styles/index.ts +0 -63
- package/src/components/_components/nav-link/index.ts +0 -5
- package/src/components/_components/nav-link/nav-link-2.tsx +0 -32
- package/src/components/_components/nav-link/nav-link-3.tsx +0 -67
- package/src/components/_components/nav-link/nav-link.tsx +0 -53
- package/src/components/_components/navbar/categories.tsx +0 -27
- package/src/components/_components/navbar/category-based-menu/category-based-menu.tsx +0 -52
- package/src/components/_components/navbar/category-based-menu/components/categories.tsx +0 -44
- package/src/components/_components/navbar/category-based-menu/components/category-item.tsx +0 -31
- package/src/components/_components/navbar/category-based-menu/components/child-categories.tsx +0 -38
- package/src/components/_components/navbar/category-based-menu/index.ts +0 -1
- package/src/components/_components/navbar/category-based-menu/styles.ts +0 -81
- package/src/components/_components/navbar/category-based-menu/types.ts +0 -18
- package/src/components/_components/navbar/index.ts +0 -1
- package/src/components/_components/navbar/mega-menu/category-list.tsx +0 -29
- package/src/components/_components/navbar/mega-menu/index.ts +0 -1
- package/src/components/_components/navbar/mega-menu/mega-menu.tsx +0 -71
- package/src/components/_components/navbar/mega-menu/styles.ts +0 -43
- package/src/components/_components/navbar/mobile-menu/index.ts +0 -1
- package/src/components/_components/navbar/mobile-menu/mobile-menu.tsx +0 -70
- package/src/components/_components/navbar/mobile-menu/render-levels.tsx +0 -62
- package/src/components/_components/navbar/nav-list/index.ts +0 -1
- package/src/components/_components/navbar/nav-list/nav-item-child.tsx +0 -66
- package/src/components/_components/navbar/nav-list/nav-list.tsx +0 -119
- package/src/components/_components/navbar/navbar.tsx +0 -43
- package/src/components/_components/navbar/styles.ts +0 -90
- package/src/components/_components/navbar/utils/transform-nav.ts +0 -43
- package/src/components/_components/newsletter/index.ts +0 -1
- package/src/components/_components/newsletter/newsletter.tsx +0 -112
- package/src/components/_components/newsletter/social-icons.tsx +0 -35
- package/src/components/_components/newsletter/styles.ts +0 -65
- package/src/components/_components/page-sidenav/grocery-side-nav/components/link-item.tsx +0 -21
- package/src/components/_components/page-sidenav/grocery-side-nav/components/list-item.tsx +0 -27
- package/src/components/_components/page-sidenav/grocery-side-nav/components/nav-accordion.tsx +0 -36
- package/src/components/_components/page-sidenav/grocery-side-nav/components/render-child.tsx +0 -26
- package/src/components/_components/page-sidenav/grocery-side-nav/grocery-side-nav.tsx +0 -32
- package/src/components/_components/page-sidenav/grocery-side-nav/index.ts +0 -1
- package/src/components/_components/page-sidenav/grocery-side-nav/styles/index.ts +0 -11
- package/src/components/_components/page-sidenav/health-beauty-side-nav/components/list-item.tsx +0 -27
- package/src/components/_components/page-sidenav/health-beauty-side-nav/components/nav-accordion.tsx +0 -44
- package/src/components/_components/page-sidenav/health-beauty-side-nav/components/render-child.tsx +0 -20
- package/src/components/_components/page-sidenav/health-beauty-side-nav/health-beauty-side-nav.tsx +0 -43
- package/src/components/_components/page-sidenav/health-beauty-side-nav/index.ts +0 -1
- package/src/components/_components/page-sidenav/health-beauty-side-nav/styles/index.ts +0 -27
- package/src/components/_components/page-sidenav/side-navbar/components/list-item.tsx +0 -25
- package/src/components/_components/page-sidenav/side-navbar/components/nav-accordion.tsx +0 -46
- package/src/components/_components/page-sidenav/side-navbar/components/render-child.tsx +0 -20
- package/src/components/_components/page-sidenav/side-navbar/index.ts +0 -1
- package/src/components/_components/page-sidenav/side-navbar/side-nav-bar.tsx +0 -77
- package/src/components/_components/page-sidenav/side-navbar/styles/index.ts +0 -73
- package/src/components/_components/page-sidenav/side-navbar-2/components/button-content.tsx +0 -32
- package/src/components/_components/page-sidenav/side-navbar-2/components/sidebar-accordion.tsx +0 -66
- package/src/components/_components/page-sidenav/side-navbar-2/index.ts +0 -1
- package/src/components/_components/page-sidenav/side-navbar-2/side-navbar-2.tsx +0 -63
- package/src/components/_components/page-sidenav/side-navbar-2/styles/index.ts +0 -68
- package/src/components/_components/product-cards/discount-chip.tsx +0 -43
- package/src/components/_components/product-cards/product-card-1/components/hover-actions.tsx +0 -37
- package/src/components/_components/product-cards/product-card-1/components/quantity-buttons.tsx +0 -65
- package/src/components/_components/product-cards/product-card-1/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-1/product-card-1-wrapper.tsx +0 -304
- package/src/components/_components/product-cards/product-card-1/product-card.tsx +0 -107
- package/src/components/_components/product-cards/product-card-1/styles/index.ts +0 -46
- package/src/components/_components/product-cards/product-card-10/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-10/product-card.tsx +0 -128
- package/src/components/_components/product-cards/product-card-10/styles/index.ts +0 -38
- package/src/components/_components/product-cards/product-card-11/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-11/product-card.tsx +0 -66
- package/src/components/_components/product-cards/product-card-11/styles/index.ts +0 -16
- package/src/components/_components/product-cards/product-card-12/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-12/product-card.tsx +0 -42
- package/src/components/_components/product-cards/product-card-12/styles/index.ts +0 -16
- package/src/components/_components/product-cards/product-card-13/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-13/product-card.tsx +0 -48
- package/src/components/_components/product-cards/product-card-13/styles/index.ts +0 -25
- package/src/components/_components/product-cards/product-card-14/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-14/product-card.tsx +0 -125
- package/src/components/_components/product-cards/product-card-14/styles/index.ts +0 -40
- package/src/components/_components/product-cards/product-card-15/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-15/product-card.tsx +0 -121
- package/src/components/_components/product-cards/product-card-15/styles/index.ts +0 -57
- package/src/components/_components/product-cards/product-card-16/components/quantity-buttons.tsx +0 -56
- package/src/components/_components/product-cards/product-card-16/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-16/product-card.tsx +0 -117
- package/src/components/_components/product-cards/product-card-16/styles/index.ts +0 -18
- package/src/components/_components/product-cards/product-card-2/components/favorite-button.tsx +0 -29
- package/src/components/_components/product-cards/product-card-2/components/product-price.tsx +0 -26
- package/src/components/_components/product-cards/product-card-2/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-2/product-card.tsx +0 -70
- package/src/components/_components/product-cards/product-card-3/components/hover-actions.tsx +0 -83
- package/src/components/_components/product-cards/product-card-3/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-3/product-card.tsx +0 -110
- package/src/components/_components/product-cards/product-card-3/styles/index.ts +0 -89
- package/src/components/_components/product-cards/product-card-4/components/hover-actions.tsx +0 -50
- package/src/components/_components/product-cards/product-card-4/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-4/product-card.tsx +0 -128
- package/src/components/_components/product-cards/product-card-4/styles/index.ts +0 -66
- package/src/components/_components/product-cards/product-card-5/components/button-actions.tsx +0 -49
- package/src/components/_components/product-cards/product-card-5/components/hover-actions.tsx +0 -50
- package/src/components/_components/product-cards/product-card-5/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-5/product-card.tsx +0 -137
- package/src/components/_components/product-cards/product-card-5/styles/index.ts +0 -94
- package/src/components/_components/product-cards/product-card-6/components/hover-actions.tsx +0 -50
- package/src/components/_components/product-cards/product-card-6/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-6/product-card.tsx +0 -121
- package/src/components/_components/product-cards/product-card-6/styles/index.ts +0 -63
- package/src/components/_components/product-cards/product-card-7/components/product-status.tsx +0 -18
- package/src/components/_components/product-cards/product-card-7/components/quantity-buttons.tsx +0 -47
- package/src/components/_components/product-cards/product-card-7/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-7/product-card.tsx +0 -139
- package/src/components/_components/product-cards/product-card-7/styles/index.ts +0 -98
- package/src/components/_components/product-cards/product-card-8/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-8/product-card.tsx +0 -157
- package/src/components/_components/product-cards/product-card-8/styles/index.ts +0 -61
- package/src/components/_components/product-cards/product-card-9/components/add-to-cart.tsx +0 -63
- package/src/components/_components/product-cards/product-card-9/components/favorite-button.tsx +0 -27
- package/src/components/_components/product-cards/product-card-9/components/tags.tsx +0 -33
- package/src/components/_components/product-cards/product-card-9/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-9/product-card.tsx +0 -169
- package/src/components/_components/product-cards/product-card-wishlist/components/hover-actions.tsx +0 -37
- package/src/components/_components/product-cards/product-card-wishlist/index.ts +0 -1
- package/src/components/_components/product-cards/product-card-wishlist/product-card.tsx +0 -118
- package/src/components/_components/product-cards/product-card-wishlist/styles/index.ts +0 -51
- package/src/components/_components/product-cards/product-price.tsx +0 -26
- package/src/components/_components/product-cards/product-rating.tsx +0 -28
- package/src/components/_components/product-cards/product-title.tsx +0 -24
- package/src/components/_components/product-cards/use-product.ts +0 -35
- package/src/components/_components/product-dimensions/product-dimensions.tsx +0 -114
- package/src/components/_components/product-quantity-buttons/product-quantity-buttons.tsx +0 -88
- package/src/components/_components/products-view/product-view-dialog.tsx +0 -218
- package/src/components/_components/products-view/products-grid-view.tsx +0 -53
- package/src/components/_components/products-view/products-list-view.tsx +0 -49
- package/src/components/_components/progress/index.ts +0 -1
- package/src/components/_components/progress/progress.tsx +0 -77
- package/src/components/_components/scrollbar/index.ts +0 -1
- package/src/components/_components/scrollbar/scrollbar.tsx +0 -27
- package/src/components/_components/scrollbar/styles.ts +0 -15
- package/src/components/_components/search-box/components/category-dropdown.tsx +0 -61
- package/src/components/_components/search-box/components/search-result.tsx +0 -83
- package/src/components/_components/search-box/hooks/use-search.ts +0 -63
- package/src/components/_components/search-box/index.ts +0 -2
- package/src/components/_components/search-box/search-input-category.tsx +0 -207
- package/src/components/_components/search-box/search-input.tsx +0 -64
- package/src/components/_components/search-box/styles/index.ts +0 -47
- package/src/components/_components/section-header/index.ts +0 -2
- package/src/components/_components/section-header/section-creator.tsx +0 -29
- package/src/components/_components/section-header/section-header.tsx +0 -44
- package/src/components/_components/service-cards/icon-component.tsx +0 -18
- package/src/components/_components/service-cards/service-card-1/index.ts +0 -1
- package/src/components/_components/service-cards/service-card-1/service-card-1.tsx +0 -42
- package/src/components/_components/service-cards/service-card-2/index.ts +0 -1
- package/src/components/_components/service-cards/service-card-2/service-card-2.tsx +0 -37
- package/src/components/_components/service-cards/service-card-3/index.ts +0 -1
- package/src/components/_components/service-cards/service-card-3/service-card-3.tsx +0 -28
- package/src/components/_components/service-cards/service-card-3/styles.ts +0 -23
- package/src/components/_components/settings/index.ts +0 -1
- package/src/components/_components/settings/setting.tsx +0 -141
- package/src/components/_components/settings/styles.ts +0 -57
- package/src/components/_components/shop-card/index.ts +0 -1
- package/src/components/_components/shop-card/shop-card.tsx +0 -152
- package/src/components/_components/shop-card/styles.ts +0 -33
- package/src/components/_components/side-nav/index.ts +0 -1
- package/src/components/_components/side-nav/side-nav.tsx +0 -49
- package/src/components/_components/site-logo.tsx +0 -17
- package/src/components/_components/sticky/Sticky.tsx +0 -62
- package/src/components/_components/sticky/index.ts +0 -1
- package/src/components/_components/sticky/styles.ts +0 -38
- package/src/components/_components/sticky-wrapper/index.ts +0 -1
- package/src/components/_components/sticky-wrapper/sticky-wrapper.tsx +0 -21
- package/src/components/_components/sticky-wrapper/styles.ts +0 -25
- package/src/components/_components/stories/story-content/index.ts +0 -1
- package/src/components/_components/stories/story-content/story-content.tsx +0 -28
- package/src/components/_components/stories/story-content/styles.ts +0 -22
- package/src/components/_components/stories/story-item/index.ts +0 -1
- package/src/components/_components/stories/story-item/story-item.tsx +0 -24
- package/src/components/_components/stories/story-item/styles.ts +0 -11
- package/src/components/_components/stories/story-viewer/index.ts +0 -1
- package/src/components/_components/stories/story-viewer/story-viewer.tsx +0 -44
- package/src/components/_components/stories/story-viewer/styles.ts +0 -15
- package/src/components/_components/subscribe-input/index.ts +0 -1
- package/src/components/_components/subscribe-input/styles.ts +0 -14
- package/src/components/_components/subscribe-input/subscribe-input.tsx +0 -43
- package/src/components/_components/topbar/index.ts +0 -1
- package/src/components/_components/topbar/styles.ts +0 -55
- package/src/components/_components/topbar/top-bar.tsx +0 -115
- package/src/components/_components/utils/constants.ts +0 -8
- package/src/components/_components/wishlist/add-to-wishlist-dialog.tsx +0 -161
- package/src/components/_components/wishlist/components/create-new-list.tsx +0 -167
- package/src/components/_components/wishlist/components/create-wishlist-button.tsx +0 -40
- package/src/components/_components/wishlist/components/dashboard-header.tsx +0 -123
- package/src/components/_components/wishlist/components/navigation.tsx +0 -87
- package/src/components/_components/wishlist/components/no-records.tsx +0 -20
- package/src/components/_components/wishlist/components/wishlist-modal-item.tsx +0 -66
- package/src/components/_components/wishlist/remove-from-wishlist-dialog.tsx +0 -174
- package/src/components/_components/wishlist/styles.ts +0 -61
- package/src/components/_components/wishlist-modal/TODO.md +0 -10
- package/src/components/_components/wishlist-modal/add-to-wishlist-button.tsx +0 -68
- package/src/components/_components/wishlist-modal/add-to-wishlist-dialog.tsx +0 -161
- package/src/components/_components/wishlist-modal/remove-from-wishlist-dialog.tsx +0 -174
- package/src/components/_components/wishlist-modal/wishlist-modal-item.tsx +0 -65
- package/src/components/countries-input.tsx +0 -72
- package/src/components-v2/accordion/accordion-header.stories.tsx +0 -28
- package/src/pages/README.md +0 -4
- package/src/pages/account/addresses/address-form.tsx +0 -289
- package/src/pages/account/addresses/address-item.tsx +0 -104
- package/src/pages/account/dashboard-header.tsx +0 -123
- package/src/pages/account/navigation.tsx +0 -87
- package/src/pages/account/no-records.tsx +0 -20
- package/src/pages/account/orders/icons/delivery.tsx +0 -14
- package/src/pages/account/orders/icons/package-box.tsx +0 -13
- package/src/pages/account/orders/icons/truck-filled.tsx +0 -14
- package/src/pages/account/orders/order-progress.tsx +0 -114
- package/src/pages/account/orders/order-row.tsx +0 -64
- package/src/pages/account/orders/order-summary.tsx +0 -87
- package/src/pages/account/orders/ordered-products.tsx +0 -121
- package/src/pages/account/profile/profile-button.test.tsx +0 -59
- package/src/pages/account/profile/profile-button.tsx +0 -50
- package/src/pages/account/profile/user-info.tsx +0 -62
- package/src/pages/account/styles.ts +0 -32
- package/src/pages/account/table-row.tsx +0 -19
- package/src/pages/account/wishlist/create-new-list.tsx +0 -167
- package/src/pages/account/wishlist/create-wishlist-button.tsx +0 -40
- package/src/pages/account/wishlist/wishlist-item.tsx +0 -82
- package/src/pages/blog/pagination.tsx +0 -38
- package/src/pages/cart/cart-item.tsx +0 -312
- package/src/pages/cart/checkout-form.tsx +0 -122
- package/src/pages/cart/coupon-entry.tsx +0 -90
- package/src/pages/cart/estimate-shipping.tsx +0 -183
- package/src/pages/cart/wrapper.tsx +0 -30
- package/src/pages/checkout/checkout-alt-form/address-card.tsx +0 -76
- package/src/pages/checkout/checkout-alt-form/checkout-form.tsx +0 -133
- package/src/pages/checkout/checkout-alt-form/checkout-step.tsx +0 -120
- package/src/pages/checkout/checkout-alt-form/customer-information.tsx +0 -94
- package/src/pages/checkout/checkout-alt-form/delivery-address.tsx +0 -174
- package/src/pages/checkout/checkout-alt-form/delivery-date.tsx +0 -114
- package/src/pages/checkout/checkout-alt-form/delivery-options.tsx +0 -190
- package/src/pages/checkout/checkout-alt-form/edit-address-form.tsx +0 -130
- package/src/pages/checkout/checkout-alt-form/heading.tsx +0 -50
- package/src/pages/checkout/checkout-alt-form/index.ts +0 -1
- package/src/pages/checkout/checkout-alt-form/new-address-form.tsx +0 -299
- package/src/pages/checkout/checkout-alt-form/node.tsx +0 -9
- package/src/pages/checkout/checkout-alt-form/payment-details.tsx +0 -347
- package/src/pages/checkout/checkout-alt-form/safe-card-preview-data.tsx +0 -36
- package/src/pages/checkout/checkout-alt-form/types.ts +0 -20
- package/src/pages/checkout/checkout-alt-summary/cart-item.tsx +0 -42
- package/src/pages/checkout/checkout-alt-summary/checkout-alt-summary.tsx +0 -42
- package/src/pages/checkout/checkout-alt-summary/index.ts +0 -1
- package/src/pages/checkout/checkout-alt-summary/list-item.tsx +0 -31
- package/src/pages/confirmation/address.tsx +0 -25
- package/src/pages/confirmation/confirmation-summary.tsx +0 -55
- package/src/pages/confirmation/ordered-products.tsx +0 -115
- package/src/pages/product-details/available-shops.tsx +0 -51
- package/src/pages/product-details/bopis/find-in-store-button.tsx +0 -63
- package/src/pages/product-details/bopis/find-in-store-modal.tsx +0 -257
- package/src/pages/product-details/bopis/pickup-option-select.tsx +0 -127
- package/src/pages/product-details/bopis/search-header.tsx +0 -69
- package/src/pages/product-details/checkbox-label.tsx +0 -20
- package/src/pages/product-details/currency.ts +0 -64
- package/src/pages/product-details/frequently-bought.tsx +0 -97
- package/src/pages/product-details/frequently-product-card.tsx +0 -63
- package/src/pages/product-details/product-comment.tsx +0 -49
- package/src/pages/product-details/product-description.tsx +0 -22
- package/src/pages/product-details/product-filter-card.tsx +0 -265
- package/src/pages/product-details/product-intro/product-intro-images.tsx +0 -90
- package/src/pages/product-details/product-intro/product-intro.tsx +0 -258
- package/src/pages/product-details/product-review.tsx +0 -134
- package/src/pages/product-details/product-tabs.tsx +0 -51
- package/src/pages/product-details/related-products.tsx +0 -42
- package/src/pages/product-details/types.ts +0 -11
- package/src/pages/product-list/breadcrumbs.tsx +0 -39
- package/src/pages/product-list/checkbox-label.tsx +0 -20
- package/src/pages/product-list/facet-group.tsx +0 -125
- package/src/pages/product-list/facet.tsx +0 -36
- package/src/pages/product-list/list-filter.tsx +0 -43
- package/src/pages/product-list/pagination.tsx +0 -80
- package/src/pages/product-list/product-list-context.tsx +0 -302
- package/src/pages/product-list/product-list-state.ts +0 -187
- package/src/pages/product-list/product-rating.tsx +0 -16
- package/src/pages/product-list/quick-view-dialog-content.tsx +0 -216
- package/src/pages/product-list/quick-view-dialog.tsx +0 -54
- package/src/pages/product-list/range-filter.tsx +0 -125
- package/src/pages/product-list/scrollbar.tsx +0 -38
- package/src/pages/product-list/search-bar.tsx +0 -162
- package/src/pages/product-list/selected-facets.tsx +0 -80
- package/src/pages/product-list/side-nav.tsx +0 -49
- package/src/pages/product-list/swatch.tsx +0 -80
- package/src/pages/product-list/types.ts +0 -18
- package/src/pages/product-list/use-product-list.ts +0 -12
- package/src/pages/product-list/useCategoryFilter.tsx +0 -26
- package/src/pages/product-list/utils/facet-helpers.ts +0 -5
- package/src/pages/product-list/utils/generate-breadcrumbs.ts +0 -30
- package/src/pages/product-list/utils/getCategoryFilterFromSlug.ts +0 -153
- package/src/pages/product-list/utils/product-list-helper.ts +0 -111
- package/src/pages/product-list/utils/product-list-types.ts +0 -41
- package/src/pages/product-list/utils/search-for-category.ts +0 -76
- package/src/pages/product-list/utils/sort-options.ts +0 -44
- package/src/pages/product-list/utils/use-previous-refiners.ts +0 -14
- package/src/pages/quickorder/order-upload.tsx +0 -150
- package/src/pages/quickorder/quick-order-form.tsx +0 -346
- package/src/pages/quickorder/quick-order-row.tsx +0 -144
- package/src/pages-v2/quickorder/index.tsx +0 -31
- package/src/pages-v2/quickorder/quick-order-actions.tsx +0 -30
- package/src/pages-v2/quickorder/quick-order-upload.tsx +0 -20
- package/src/stories/Button.stories.ts +0 -54
- package/src/stories/Button.tsx +0 -35
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -34
- package/src/stories/Header.tsx +0 -54
- package/src/stories/Page.stories.ts +0 -33
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -68
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import Link from "next/link";
|
|
2
|
-
// MUI
|
|
3
|
-
import Card from "@mui/material/Card";
|
|
4
|
-
import Button from "@mui/material/Button";
|
|
5
|
-
import Divider from "@mui/material/Divider";
|
|
6
|
-
import TextField from "@mui/material/TextField";
|
|
7
|
-
// GLOBAL CUSTOM COMPONENTS
|
|
8
|
-
import { Span } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
9
|
-
import {
|
|
10
|
-
FlexBetween,
|
|
11
|
-
FlexBox,
|
|
12
|
-
} from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
13
|
-
import { useFormatter, useTranslations } from "next-intl";
|
|
14
|
-
import { CountryRegionInfo, Coupon } from "@msdyn365-commerce/retail-proxy";
|
|
15
|
-
import getStates from "@evenicanpm/storefront-core/src/api-manager/services/address/queries/get-states";
|
|
16
|
-
import { debounce } from "lodash";
|
|
17
|
-
import EstimateShipping from "./estimate-shipping";
|
|
18
|
-
import CouponEntry from "./coupon-entry";
|
|
19
|
-
import React from "react";
|
|
20
|
-
|
|
21
|
-
interface CheckoutFormProps {
|
|
22
|
-
cartId: string;
|
|
23
|
-
cartLineIds: string[];
|
|
24
|
-
cartTotal: number;
|
|
25
|
-
countries: CountryRegionInfo[];
|
|
26
|
-
updateCartComment: (comment: string) => void;
|
|
27
|
-
appliedCoupons: Coupon[];
|
|
28
|
-
commentFromData: string;
|
|
29
|
-
checkoutDisabled?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default function CheckoutForm({
|
|
33
|
-
cartTotal,
|
|
34
|
-
countries,
|
|
35
|
-
updateCartComment,
|
|
36
|
-
commentFromData,
|
|
37
|
-
appliedCoupons,
|
|
38
|
-
cartId,
|
|
39
|
-
cartLineIds,
|
|
40
|
-
checkoutDisabled,
|
|
41
|
-
}: CheckoutFormProps) {
|
|
42
|
-
const { number } = useFormatter();
|
|
43
|
-
const t = useTranslations("Cart.Sidebar");
|
|
44
|
-
const textRef = React.useRef<HTMLTextAreaElement>();
|
|
45
|
-
const [selectedCountry, setSelectedCountry] = React.useState<
|
|
46
|
-
CountryRegionInfo | undefined
|
|
47
|
-
>(undefined);
|
|
48
|
-
const { data: states } = getStates.useData({
|
|
49
|
-
countryId: selectedCountry?.CountryRegionId,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const handleCommentUpdate = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
53
|
-
updateCartComment(e.target.value);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
React.useEffect(() => {
|
|
57
|
-
if (textRef.current) {
|
|
58
|
-
textRef.current.value = commentFromData;
|
|
59
|
-
}
|
|
60
|
-
}, [commentFromData]);
|
|
61
|
-
|
|
62
|
-
const debounceCommentUpdate = debounce(handleCommentUpdate, 2500);
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<Card sx={{ padding: 3 }}>
|
|
66
|
-
<FlexBetween mb={2}>
|
|
67
|
-
<Span color="grey.600">{t("total")}:</Span>
|
|
68
|
-
|
|
69
|
-
<Span fontSize={18} fontWeight={600} lineHeight="1">
|
|
70
|
-
{number(cartTotal, { style: "currency", currency: "USD" })}
|
|
71
|
-
</Span>
|
|
72
|
-
</FlexBetween>
|
|
73
|
-
|
|
74
|
-
<Divider sx={{ mb: 2 }} />
|
|
75
|
-
|
|
76
|
-
<FlexBox alignItems="center" columnGap={1} mb={2}>
|
|
77
|
-
<Span fontWeight="600">{t("notes")}</Span>
|
|
78
|
-
</FlexBox>
|
|
79
|
-
|
|
80
|
-
{/* COMMENTS TEXT FIELD */}
|
|
81
|
-
<TextField
|
|
82
|
-
variant="outlined"
|
|
83
|
-
rows={6}
|
|
84
|
-
fullWidth
|
|
85
|
-
multiline
|
|
86
|
-
onChange={debounceCommentUpdate}
|
|
87
|
-
inputRef={textRef}
|
|
88
|
-
inputProps={{
|
|
89
|
-
["data-testid"]: "cart-comment",
|
|
90
|
-
}}
|
|
91
|
-
/>
|
|
92
|
-
|
|
93
|
-
<Divider sx={{ mb: 2 }} />
|
|
94
|
-
|
|
95
|
-
{/* APPLY VOUCHER TEXT FIELD */}
|
|
96
|
-
<CouponEntry appliedCoupons={appliedCoupons} cartId={cartId} />
|
|
97
|
-
|
|
98
|
-
<Divider sx={{ mb: 2 }} />
|
|
99
|
-
{/* COUNTRY TEXT FIELD */}
|
|
100
|
-
<EstimateShipping
|
|
101
|
-
countries={countries}
|
|
102
|
-
states={states || []}
|
|
103
|
-
setCountry={setSelectedCountry}
|
|
104
|
-
cartId={cartId}
|
|
105
|
-
cartLineIds={cartLineIds}
|
|
106
|
-
/>
|
|
107
|
-
|
|
108
|
-
<Divider sx={{ mb: 2 }} />
|
|
109
|
-
|
|
110
|
-
<Button
|
|
111
|
-
fullWidth
|
|
112
|
-
color="primary"
|
|
113
|
-
href="/checkout"
|
|
114
|
-
variant="contained"
|
|
115
|
-
LinkComponent={Link}
|
|
116
|
-
disabled={checkoutDisabled}
|
|
117
|
-
>
|
|
118
|
-
{t("checkoutButton")}
|
|
119
|
-
</Button>
|
|
120
|
-
</Card>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import useAddDiscountCode from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/add-discount-code";
|
|
2
|
-
import { Coupon } from "@msdyn365-commerce/retail-proxy";
|
|
3
|
-
import {
|
|
4
|
-
Box,
|
|
5
|
-
Button,
|
|
6
|
-
IconButton,
|
|
7
|
-
List,
|
|
8
|
-
ListItem,
|
|
9
|
-
ListItemText,
|
|
10
|
-
TextField,
|
|
11
|
-
} from "@mui/material";
|
|
12
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
13
|
-
import { Span } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
14
|
-
import { useTranslations } from "next-intl";
|
|
15
|
-
import Close from "@mui/icons-material/Close";
|
|
16
|
-
import React from "react";
|
|
17
|
-
import useRemoveDiscountcode from "@evenicanpm/storefront-core/src/api-manager/services/cart/mutations/remove-discount-code";
|
|
18
|
-
|
|
19
|
-
interface CouponEntryProps {
|
|
20
|
-
appliedCoupons: Coupon[];
|
|
21
|
-
cartId: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default function CouponEntry(props: CouponEntryProps) {
|
|
25
|
-
const { appliedCoupons, cartId } = props;
|
|
26
|
-
const [textValue, setTextValue] = React.useState<string>("");
|
|
27
|
-
const { mutate: updateCoupon } = useAddDiscountCode();
|
|
28
|
-
const { mutate: removeCoupon } = useRemoveDiscountcode();
|
|
29
|
-
const t = useTranslations("Cart.Coupons");
|
|
30
|
-
|
|
31
|
-
const handleUpdateTextValue = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
32
|
-
setTextValue(e.target.value);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const handleApplyCoupon = () => {
|
|
36
|
-
updateCoupon({ discountCode: textValue, cartId });
|
|
37
|
-
setTextValue("");
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const handleRemoveCoupon = (coupon: string) => {
|
|
41
|
-
removeCoupon({ discountCode: coupon, cartId });
|
|
42
|
-
};
|
|
43
|
-
return (
|
|
44
|
-
<Box>
|
|
45
|
-
<TextField
|
|
46
|
-
fullWidth
|
|
47
|
-
size="small"
|
|
48
|
-
label={t("coupon")}
|
|
49
|
-
variant="outlined"
|
|
50
|
-
placeholder={t("coupon")}
|
|
51
|
-
value={textValue}
|
|
52
|
-
onChange={handleUpdateTextValue}
|
|
53
|
-
/>
|
|
54
|
-
<Button
|
|
55
|
-
variant="outlined"
|
|
56
|
-
color="primary"
|
|
57
|
-
fullWidth
|
|
58
|
-
sx={{ mt: 2, mb: 4 }}
|
|
59
|
-
onClick={handleApplyCoupon}
|
|
60
|
-
>
|
|
61
|
-
{t("applyCouponButton")}
|
|
62
|
-
</Button>
|
|
63
|
-
{appliedCoupons.length > 0 && (
|
|
64
|
-
<>
|
|
65
|
-
<FlexBox alignItems="center" columnGap={1} mb={2}>
|
|
66
|
-
<Span fontWeight="600">{t("appliedCoupons")}</Span>
|
|
67
|
-
</FlexBox>
|
|
68
|
-
{appliedCoupons.map((coupon) => (
|
|
69
|
-
<List key={coupon.Code}>
|
|
70
|
-
<ListItem
|
|
71
|
-
secondaryAction={
|
|
72
|
-
<IconButton
|
|
73
|
-
edge="end"
|
|
74
|
-
aria-label="delete"
|
|
75
|
-
onClick={() => handleRemoveCoupon(coupon.Code ?? "")}
|
|
76
|
-
title={"Remove Coupon"}
|
|
77
|
-
>
|
|
78
|
-
<Close />
|
|
79
|
-
</IconButton>
|
|
80
|
-
}
|
|
81
|
-
>
|
|
82
|
-
<ListItemText primary={coupon.Code} />
|
|
83
|
-
</ListItem>
|
|
84
|
-
</List>
|
|
85
|
-
))}
|
|
86
|
-
</>
|
|
87
|
-
)}
|
|
88
|
-
</Box>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import useGetDeliveryOptions from "@evenicanpm/storefront-core/src/api-manager/services/address/mutations/get-delivery-options";
|
|
2
|
-
import { Span } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
3
|
-
import CountryInput from "@evenicanpm/storefront-core/src/components/countries-input";
|
|
4
|
-
import useCurrencyFormatter from "@evenicanpm/storefront-core/src/lib/currency-formatter";
|
|
5
|
-
import {
|
|
6
|
-
CountryRegionInfo,
|
|
7
|
-
DeliveryOption,
|
|
8
|
-
StateProvinceInfo,
|
|
9
|
-
} from "@msdyn365-commerce/retail-proxy";
|
|
10
|
-
import {
|
|
11
|
-
Box,
|
|
12
|
-
Button,
|
|
13
|
-
Divider,
|
|
14
|
-
List,
|
|
15
|
-
ListItem,
|
|
16
|
-
ListItemText,
|
|
17
|
-
MenuItem,
|
|
18
|
-
TextField,
|
|
19
|
-
} from "@mui/material";
|
|
20
|
-
import { Address } from "@evenicanpm/storefront-core/src/api-manager/schemas/address.schema";
|
|
21
|
-
import { useTranslations } from "next-intl";
|
|
22
|
-
import React from "react";
|
|
23
|
-
|
|
24
|
-
export interface EstimateShippingProps {
|
|
25
|
-
countries: CountryRegionInfo[];
|
|
26
|
-
states: StateProvinceInfo[];
|
|
27
|
-
setCountry: (country: CountryRegionInfo) => void;
|
|
28
|
-
cartId: string;
|
|
29
|
-
cartLineIds: string[];
|
|
30
|
-
defaultCountryCode?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default function EstimateShipping(props: EstimateShippingProps) {
|
|
34
|
-
const {
|
|
35
|
-
countries,
|
|
36
|
-
states,
|
|
37
|
-
setCountry,
|
|
38
|
-
cartId,
|
|
39
|
-
cartLineIds,
|
|
40
|
-
defaultCountryCode,
|
|
41
|
-
} = props;
|
|
42
|
-
const t = useTranslations("Cart.Sidebar");
|
|
43
|
-
const defaultCountry = countries.find(
|
|
44
|
-
(c) => c.CountryRegionId === (defaultCountryCode ?? "USA"),
|
|
45
|
-
);
|
|
46
|
-
const [selectedCountry, setSelectedCountry] =
|
|
47
|
-
React.useState<CountryRegionInfo | null>(defaultCountry ?? null);
|
|
48
|
-
const [selectedState, setSelectedState] = React.useState<string | undefined>(
|
|
49
|
-
undefined,
|
|
50
|
-
);
|
|
51
|
-
const [zipCode, setZipCode] = React.useState<string>("");
|
|
52
|
-
const [deliveryOptions, setDeliveryOptions] = React.useState<
|
|
53
|
-
DeliveryOption[]
|
|
54
|
-
>([]);
|
|
55
|
-
const [noOptionsFound, setNoOptionsFound] = React.useState<boolean>(false);
|
|
56
|
-
const { formatCurrency } = useCurrencyFormatter();
|
|
57
|
-
const { mutateAsync: getDeliveryOptions } = useGetDeliveryOptions();
|
|
58
|
-
|
|
59
|
-
React.useEffect(() => {
|
|
60
|
-
if (selectedCountry) {
|
|
61
|
-
setCountry(selectedCountry);
|
|
62
|
-
}
|
|
63
|
-
}, [selectedCountry, setCountry]);
|
|
64
|
-
|
|
65
|
-
const handleStateChange = (event: React.ChangeEvent<HTMLInputElement>) =>
|
|
66
|
-
setSelectedState(event.target.value);
|
|
67
|
-
|
|
68
|
-
const handleZipCodeChange = (event: React.ChangeEvent<HTMLInputElement>) =>
|
|
69
|
-
setZipCode(event.target.value);
|
|
70
|
-
|
|
71
|
-
const createAddressFromInput = (): Address => ({
|
|
72
|
-
ZipCode: zipCode,
|
|
73
|
-
State: selectedState,
|
|
74
|
-
TwoLetterISORegionName: selectedCountry?.ISOCode,
|
|
75
|
-
ThreeLetterISORegionName: selectedCountry?.CountryRegionId,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const doDeliveryMethodLookup = async () => {
|
|
79
|
-
if (!zipCode || !selectedState || !selectedCountry) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
setNoOptionsFound(false);
|
|
83
|
-
const data = await getDeliveryOptions({
|
|
84
|
-
cartId,
|
|
85
|
-
cartLineIds,
|
|
86
|
-
shippingAddress: createAddressFromInput(),
|
|
87
|
-
});
|
|
88
|
-
if (data.length) {
|
|
89
|
-
setDeliveryOptions(data);
|
|
90
|
-
} else {
|
|
91
|
-
setNoOptionsFound(true);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const renderOptionsSection = () => {
|
|
96
|
-
if (noOptionsFound) {
|
|
97
|
-
return <Span color="error.main">{t("noDeliveryOptionsFound")}</Span>;
|
|
98
|
-
} else if (deliveryOptions.length) {
|
|
99
|
-
return (
|
|
100
|
-
<Box>
|
|
101
|
-
<Span fontWeight={600} mb={2} display="block">
|
|
102
|
-
{t("deliveryOptionsLabel")}
|
|
103
|
-
</Span>
|
|
104
|
-
<Divider sx={{ mb: 2 }} />
|
|
105
|
-
<List>
|
|
106
|
-
{deliveryOptions.map((dl) => (
|
|
107
|
-
<ListItem
|
|
108
|
-
key={dl.RecordId}
|
|
109
|
-
secondaryAction={
|
|
110
|
-
<Span>{formatCurrency(dl.TotalChargeAmount || 0)}</Span>
|
|
111
|
-
}
|
|
112
|
-
>
|
|
113
|
-
<ListItemText primary={dl.Description} />
|
|
114
|
-
</ListItem>
|
|
115
|
-
))}
|
|
116
|
-
</List>
|
|
117
|
-
</Box>
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
return (
|
|
122
|
-
<Box>
|
|
123
|
-
<Span fontWeight={600} mb={2} display="block">
|
|
124
|
-
{t("estimatesLabel")}
|
|
125
|
-
</Span>
|
|
126
|
-
|
|
127
|
-
{/* COUNTRY TEXT FIELD */}
|
|
128
|
-
<Box sx={{ mb: 2 }}>
|
|
129
|
-
<CountryInput
|
|
130
|
-
selectedCountry={selectedCountry}
|
|
131
|
-
setSelectedCountry={setSelectedCountry}
|
|
132
|
-
countries={countries}
|
|
133
|
-
label={t("countryLabel")}
|
|
134
|
-
/>
|
|
135
|
-
</Box>
|
|
136
|
-
|
|
137
|
-
{/* STATE/CITY TEXT FIELD */}
|
|
138
|
-
<TextField
|
|
139
|
-
select
|
|
140
|
-
fullWidth
|
|
141
|
-
size="small"
|
|
142
|
-
label={t("stateLabel")}
|
|
143
|
-
value={selectedState || 0}
|
|
144
|
-
onChange={handleStateChange}
|
|
145
|
-
variant="outlined"
|
|
146
|
-
placeholder="Select State"
|
|
147
|
-
>
|
|
148
|
-
<MenuItem value={0}>Select a state</MenuItem>
|
|
149
|
-
{states &&
|
|
150
|
-
states.length > 0 &&
|
|
151
|
-
states.map(({ StateName, StateId }) => (
|
|
152
|
-
<MenuItem value={StateId} key={StateName}>
|
|
153
|
-
{StateName}
|
|
154
|
-
</MenuItem>
|
|
155
|
-
))}
|
|
156
|
-
</TextField>
|
|
157
|
-
|
|
158
|
-
{/* ZIP-CODE TEXT FIELD */}
|
|
159
|
-
<TextField
|
|
160
|
-
fullWidth
|
|
161
|
-
size="small"
|
|
162
|
-
label={t("zipCodeLabel")}
|
|
163
|
-
placeholder="3100"
|
|
164
|
-
variant="outlined"
|
|
165
|
-
value={zipCode}
|
|
166
|
-
onChange={handleZipCodeChange}
|
|
167
|
-
sx={{ mt: 2 }}
|
|
168
|
-
/>
|
|
169
|
-
|
|
170
|
-
<Button
|
|
171
|
-
variant="outlined"
|
|
172
|
-
color="primary"
|
|
173
|
-
fullWidth
|
|
174
|
-
sx={{ my: 2 }}
|
|
175
|
-
onClick={doDeliveryMethodLookup}
|
|
176
|
-
>
|
|
177
|
-
{t("calculateShippingLabel")}
|
|
178
|
-
</Button>
|
|
179
|
-
|
|
180
|
-
{renderOptionsSection()}
|
|
181
|
-
</Box>
|
|
182
|
-
);
|
|
183
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import Card from "@mui/material/Card";
|
|
2
|
-
import styled from "@mui/material/styles/styled";
|
|
3
|
-
|
|
4
|
-
export const Wrapper = styled(Card)(({ theme }) => ({
|
|
5
|
-
display: "flex",
|
|
6
|
-
overflow: "hidden",
|
|
7
|
-
alignItems: "center",
|
|
8
|
-
position: "relative",
|
|
9
|
-
borderRadius: "10px",
|
|
10
|
-
marginBottom: "1.5rem",
|
|
11
|
-
boxShadow: theme.shadows[2],
|
|
12
|
-
backgroundColor: theme.palette.background.paper,
|
|
13
|
-
|
|
14
|
-
"@media only screen and (max-width: 425px)": {
|
|
15
|
-
flexWrap: "wrap",
|
|
16
|
-
img: { height: "auto", minWidth: "100%" },
|
|
17
|
-
},
|
|
18
|
-
"& .img-wrapper": {
|
|
19
|
-
width: 150,
|
|
20
|
-
height: 150,
|
|
21
|
-
flexShrink: 0,
|
|
22
|
-
position: "relative",
|
|
23
|
-
backgroundColor: theme.palette.grey[200],
|
|
24
|
-
|
|
25
|
-
"@media only screen and (max-width: 425px)": {
|
|
26
|
-
width: "100%",
|
|
27
|
-
height: "auto",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
}));
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ModeEditOutline, DeleteOutline } from "@mui/icons-material";
|
|
2
|
-
import { Card, IconButton } from "@mui/material";
|
|
3
|
-
import Grid from "@mui/material/Grid2";
|
|
4
|
-
import { Address } from "@/api-manager/schemas/address.schema";
|
|
5
|
-
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
6
|
-
import {
|
|
7
|
-
H6,
|
|
8
|
-
Paragraph,
|
|
9
|
-
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
address: Address;
|
|
13
|
-
isCartAddress: boolean;
|
|
14
|
-
hideControls?: boolean;
|
|
15
|
-
onEdit?: () => void;
|
|
16
|
-
onSelect?: () => void;
|
|
17
|
-
onDelete?: () => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default function AddressCard({
|
|
21
|
-
address,
|
|
22
|
-
isCartAddress,
|
|
23
|
-
hideControls,
|
|
24
|
-
onEdit,
|
|
25
|
-
onSelect,
|
|
26
|
-
onDelete,
|
|
27
|
-
}: Props) {
|
|
28
|
-
return (
|
|
29
|
-
<Grid onClick={() => onSelect?.()}>
|
|
30
|
-
<Card
|
|
31
|
-
sx={{
|
|
32
|
-
padding: 2,
|
|
33
|
-
boxShadow: "none",
|
|
34
|
-
cursor: onSelect ? "pointer" : "default",
|
|
35
|
-
border: "1px solid",
|
|
36
|
-
position: "relative",
|
|
37
|
-
backgroundColor: "grey.100",
|
|
38
|
-
borderColor: isCartAddress ? "secondary.main" : "transparent",
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
{!hideControls && (
|
|
42
|
-
<FlexBox position="absolute" top={5} right={5}>
|
|
43
|
-
<IconButton
|
|
44
|
-
size="small"
|
|
45
|
-
onClick={(e) => {
|
|
46
|
-
e.stopPropagation();
|
|
47
|
-
onEdit?.();
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
<ModeEditOutline fontSize="inherit" />
|
|
51
|
-
</IconButton>
|
|
52
|
-
<IconButton
|
|
53
|
-
size="small"
|
|
54
|
-
color="error"
|
|
55
|
-
onClick={(e) => {
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
onDelete?.();
|
|
58
|
-
}}
|
|
59
|
-
disabled={isCartAddress}
|
|
60
|
-
>
|
|
61
|
-
<DeleteOutline fontSize="inherit" />
|
|
62
|
-
</IconButton>
|
|
63
|
-
</FlexBox>
|
|
64
|
-
)}
|
|
65
|
-
<H6 mb={0.5}>{address.Name}</H6>
|
|
66
|
-
<Paragraph color="grey.700">{address.Street}</Paragraph>
|
|
67
|
-
<Paragraph color="grey.700">{address.City}</Paragraph>
|
|
68
|
-
<Paragraph color="grey.700">
|
|
69
|
-
{address.State}, {address.ThreeLetterISORegionName}
|
|
70
|
-
</Paragraph>
|
|
71
|
-
<Paragraph color="grey.700">{address.ZipCode}</Paragraph>
|
|
72
|
-
<Paragraph color="grey.700">{address.Phone}</Paragraph>
|
|
73
|
-
</Card>
|
|
74
|
-
</Grid>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
// LOCAL CUSTOM COMPONENTS
|
|
3
|
-
import DeliveryAddress from "./delivery-address";
|
|
4
|
-
|
|
5
|
-
import { Cart } from "@/api-manager/schemas/cart.schema";
|
|
6
|
-
import CustomerInformation from "./customer-information";
|
|
7
|
-
import { Box, Button } from "@mui/material";
|
|
8
|
-
import Grid from "@mui/material/Grid2";
|
|
9
|
-
import DeliveryOptions from "./delivery-options";
|
|
10
|
-
import React from "react";
|
|
11
|
-
import CheckoutStep from "./checkout-step";
|
|
12
|
-
import PaymentDetails from "./payment-details";
|
|
13
|
-
import useCheckout from "@/api-manager/services/cart/mutations/checkout";
|
|
14
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
15
|
-
import { CardPaymentAcceptResult } from "@msdyn365-commerce/retail-proxy";
|
|
16
|
-
import { useRouter } from "next/navigation";
|
|
17
|
-
import { PageSlug } from "@/lib/page-slugs";
|
|
18
|
-
import { deleteCartCookie, setCartCookie } from "@/lib/cart-cookie-handler";
|
|
19
|
-
import getChannelConfiguration from "@/api-manager/services/organization/queries/get-channel-configuration";
|
|
20
|
-
import { useTranslations } from "next-intl";
|
|
21
|
-
import getCart from "@/api-manager/services/cart/queries/get-cart";
|
|
22
|
-
import { useNotification } from "@/components/Notifications/use-notification";
|
|
23
|
-
interface Props {
|
|
24
|
-
cart: Cart;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default function CheckoutForm({ cart }: Props) {
|
|
28
|
-
const t = useTranslations("Checkout");
|
|
29
|
-
const [activeStep, setActiveStep] = React.useState<number>(1);
|
|
30
|
-
const { mutateAsync: placeOrder } = useCheckout();
|
|
31
|
-
const { setNotification } = useNotification();
|
|
32
|
-
const router = useRouter();
|
|
33
|
-
const queryClient = useQueryClient();
|
|
34
|
-
const { data: channelConfigurationData } = getChannelConfiguration.useData();
|
|
35
|
-
const isFormComplete = () => activeStep > steps.length;
|
|
36
|
-
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
37
|
-
const steps = [
|
|
38
|
-
{
|
|
39
|
-
title: t("Steps.customerInformation"),
|
|
40
|
-
component: CustomerInformation,
|
|
41
|
-
},
|
|
42
|
-
{ title: t("Steps.deliveryAddress"), component: DeliveryAddress },
|
|
43
|
-
{ title: t("Steps.deliveryOptions"), component: DeliveryOptions },
|
|
44
|
-
{ title: t("Steps.payment"), component: PaymentDetails },
|
|
45
|
-
];
|
|
46
|
-
const handleStepChange = (step: number) => {
|
|
47
|
-
setActiveStep(step);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const handlePlaceOrder = async () => {
|
|
51
|
-
setIsSubmitting(true);
|
|
52
|
-
const cache = queryClient.getQueryCache();
|
|
53
|
-
const acceptResultCache = cache.get(
|
|
54
|
-
JSON.stringify(["paymentAcceptResult", cart.Id]),
|
|
55
|
-
);
|
|
56
|
-
const paymentAcceptResult = acceptResultCache?.state
|
|
57
|
-
.data as CardPaymentAcceptResult;
|
|
58
|
-
if (!paymentAcceptResult) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (!paymentAcceptResult.TokenizedPaymentCard) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
const data = await placeOrder({
|
|
67
|
-
id: cart.Id,
|
|
68
|
-
receiptEmail: cart.ReceiptEmail ?? "",
|
|
69
|
-
tokenizedPaymentCard: paymentAcceptResult.TokenizedPaymentCard,
|
|
70
|
-
currency: channelConfigurationData?.Currency ?? "",
|
|
71
|
-
amount: cart.TotalAmount || 0,
|
|
72
|
-
});
|
|
73
|
-
await cleanupCart(data.Id);
|
|
74
|
-
setNotification({
|
|
75
|
-
message: t("placeOrderSuccessMessage"),
|
|
76
|
-
severity: "success",
|
|
77
|
-
});
|
|
78
|
-
} catch (error) {
|
|
79
|
-
console.error(error);
|
|
80
|
-
setNotification({
|
|
81
|
-
message: t("placeOrderErrorMessage"),
|
|
82
|
-
severity: "error",
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
setIsSubmitting(false);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const cleanupCart = async (transactionId: string) => {
|
|
89
|
-
// Clear cached cart data
|
|
90
|
-
// await deleteCartCookie();
|
|
91
|
-
// Fetch a new cart
|
|
92
|
-
// const newCart = await getCart.fetchData(queryClient);
|
|
93
|
-
// Set new cookie
|
|
94
|
-
// setCartCookie(newCart.Id);
|
|
95
|
-
//Go to confirmation page
|
|
96
|
-
router.push(`${PageSlug.Confirmation}?transactionId=${transactionId}`);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const renderFormFooter = () => {
|
|
100
|
-
return (
|
|
101
|
-
<Grid container justifyContent="flex-end">
|
|
102
|
-
<Button
|
|
103
|
-
disabled={!isFormComplete() || isSubmitting}
|
|
104
|
-
variant="contained"
|
|
105
|
-
color="primary"
|
|
106
|
-
onClick={() => handlePlaceOrder()}
|
|
107
|
-
>
|
|
108
|
-
{t("placeOrderButton")}
|
|
109
|
-
</Button>
|
|
110
|
-
</Grid>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
return (
|
|
114
|
-
<Box>
|
|
115
|
-
{steps.map((step, index) => {
|
|
116
|
-
const stepNumber = index + 1;
|
|
117
|
-
return (
|
|
118
|
-
<CheckoutStep
|
|
119
|
-
title={step.title}
|
|
120
|
-
stepNumber={stepNumber}
|
|
121
|
-
activeStep={activeStep}
|
|
122
|
-
setActiveStep={handleStepChange}
|
|
123
|
-
isLastStep={stepNumber === steps.length}
|
|
124
|
-
key={stepNumber}
|
|
125
|
-
cart={cart}
|
|
126
|
-
component={step.component}
|
|
127
|
-
/>
|
|
128
|
-
);
|
|
129
|
-
})}
|
|
130
|
-
{renderFormFooter()}
|
|
131
|
-
</Box>
|
|
132
|
-
);
|
|
133
|
-
}
|