@evenicanpm/storefront-core 1.0.3 → 1.0.4

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.
Files changed (319) hide show
  1. package/docs.tsconfig.json +35 -0
  2. package/package.json +6 -3
  3. package/src/api-manager/schemas/product.schema.ts +0 -1
  4. package/src/api-manager/services/create-query.ts +10 -0
  5. package/src/api-manager/services/product/queries/get-product-availability.ts +1 -1
  6. package/src/api-manager/services/user/mutations/add-to-wishlist.ts +23 -3
  7. package/src/api-manager/services/user/mutations/remove-from-wishlist.ts +23 -0
  8. package/src/cms/blocks/Components/CategoryCarousel/index.tsx +6 -7
  9. package/src/cms/blocks/Components/HeroCarousel/index.tsx +25 -19
  10. package/src/cms/blocks/Components/ProductCarousel/index.tsx +44 -38
  11. package/src/cms/blocks/Components/ProductSectionFullWidth/index.tsx +7 -3
  12. package/src/cms/blocks/Components/shared/product-grid.tsx +38 -23
  13. package/src/components/_components/wishlist/add-to-wishlist-dialog.tsx +1 -1
  14. package/src/components/_components/wishlist/remove-from-wishlist-dialog.tsx +1 -1
  15. package/src/components/_components/wishlist-modal/add-to-wishlist-dialog.tsx +1 -1
  16. package/src/components/_components/wishlist-modal/remove-from-wishlist-dialog.tsx +1 -1
  17. package/src/components-v2/carousel/carousel.tsx +69 -35
  18. package/src/components-v2/carousel/components/carousel-arrows.tsx +40 -46
  19. package/src/components-v2/carousel/components/carousel-dots.tsx +10 -13
  20. package/src/components-v2/carousel/index.ts +0 -2
  21. package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +68 -49
  22. package/src/components-v2/categories/category-list/category-list.tsx +83 -41
  23. package/src/components-v2/categories/category-list/styles.ts +7 -1
  24. package/src/components-v2/categories/category-menu.tsx +2 -0
  25. package/src/components-v2/categories/mega-menu/banner.tsx +68 -37
  26. package/src/components-v2/categories/mega-menu/column-list.tsx +59 -52
  27. package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +19 -1
  28. package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +32 -2
  29. package/src/components-v2/header/components/mobile-header.tsx +119 -46
  30. package/src/components-v2/header/components/user.tsx +163 -117
  31. package/src/components-v2/header/header.tsx +62 -42
  32. package/src/components-v2/header/sticky-header.tsx +34 -2
  33. package/src/components-v2/mini-cart/components/bottom-actions.tsx +71 -17
  34. package/src/components-v2/mini-cart/components/cart-item.tsx +159 -101
  35. package/src/components-v2/mini-cart/components/empty-view.tsx +59 -19
  36. package/src/components-v2/mini-cart/components/top-header.tsx +61 -22
  37. package/src/components-v2/mini-cart/mini-cart-trigger.tsx +99 -0
  38. package/src/components-v2/mini-cart/mini-cart.tsx +111 -43
  39. package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +93 -48
  40. package/src/components-v2/navbar/categories.tsx +70 -16
  41. package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +135 -41
  42. package/src/components-v2/navbar/mega-menu/mega-menu.tsx +115 -48
  43. package/src/components-v2/navbar/mobile-menu/mobile-menu.test.tsx +111 -0
  44. package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +127 -56
  45. package/src/components-v2/navbar/nav-list/nav-list.tsx +125 -103
  46. package/src/components-v2/navbar/navbar.tsx +72 -20
  47. package/src/components-v2/product-cards/{product-card-1 → product-card}/components/quantity-buttons.tsx +1 -1
  48. package/src/components-v2/product-cards/product-card/product-card.tsx +410 -0
  49. package/src/components-v2/product-cards/{product-card-1 → product-card}/styles/index.ts +6 -0
  50. package/src/components-v2/product-cards/product-card-plp/product-card.tsx +161 -0
  51. package/src/components-v2/product-cards/product-card-plp-list/index.ts +1 -0
  52. package/src/components-v2/product-cards/product-card-plp-list/product-card.tsx +219 -0
  53. package/src/components-v2/product-cards/product-card-search/product-card.tsx +166 -0
  54. package/src/components-v2/product-dialog/compound/product-dialog.tsx +225 -0
  55. package/src/components-v2/product-dialog/index.tsx +29 -0
  56. package/src/components-v2/product-dimensions/{components → compound}/dimensions-group-error.tsx +1 -1
  57. package/src/components-v2/product-dimensions/{components → compound}/dimensions-group-label.tsx +1 -1
  58. package/src/components-v2/product-dimensions/{components → compound}/dimensions-group-list-chip.tsx +1 -1
  59. package/src/components-v2/product-dimensions/{components → compound}/dimensions-group-list.tsx +1 -1
  60. package/src/components-v2/product-dimensions/{components → compound}/dimensions-group.tsx +1 -1
  61. package/src/components-v2/product-dimensions/{components → compound}/dimensions.tsx +0 -3
  62. package/src/components-v2/product-dimensions/index.tsx +1 -1
  63. package/src/components-v2/product-quantity-buttons/compound/quantity-buttons-root.tsx +181 -0
  64. package/src/components-v2/product-quantity-buttons/index.tsx +22 -0
  65. package/src/components-v2/product-quantity-variants/index.tsx +90 -0
  66. package/src/components-v2/products-view/compound/context.ts +25 -0
  67. package/src/components-v2/products-view/compound/products-grid-view.tsx +109 -0
  68. package/src/components-v2/products-view/compound/products-list-view.tsx +98 -0
  69. package/src/components-v2/products-view/compound/types.ts +12 -0
  70. package/src/components-v2/products-view/index.tsx +45 -0
  71. package/src/components-v2/products-view/products-grid-view.tsx +24 -11
  72. package/src/components-v2/products-view/products-list-view.tsx +29 -12
  73. package/src/components-v2/search-bar/compound/context.ts +31 -0
  74. package/src/components-v2/search-bar/compound/results-item-lg.tsx +43 -0
  75. package/src/components-v2/search-bar/compound/results-item-sm.tsx +48 -0
  76. package/src/components-v2/search-bar/compound/results-suspense.tsx +49 -0
  77. package/src/components-v2/search-bar/compound/results.tsx +42 -0
  78. package/src/components-v2/search-bar/compound/search-bar-root.tsx +64 -0
  79. package/src/components-v2/search-bar/compound/textfield-adornment-button.tsx +22 -0
  80. package/src/components-v2/{search-box/components/category-dropdown.tsx → search-bar/compound/textfield-adornment-category.tsx} +29 -7
  81. package/src/components-v2/search-bar/compound/textfield-adornment-search-icon.tsx +34 -0
  82. package/src/components-v2/search-bar/compound/textfield.tsx +58 -0
  83. package/src/components-v2/search-bar/hooks/use-click-outside.ts +20 -0
  84. package/src/components-v2/search-bar/hooks/use-search.ts +63 -0
  85. package/src/components-v2/search-bar/index.tsx +36 -0
  86. package/src/components-v2/{search-box → search-bar}/styles/index.ts +5 -3
  87. package/src/components-v2/search-bar/utils/findCategoryNameById.ts +18 -0
  88. package/src/components-v2/section/compound/section-header.tsx +63 -0
  89. package/src/components-v2/section/compound/section.tsx +26 -0
  90. package/src/components-v2/section/index.ts +1 -0
  91. package/src/components-v2/side-nav/side-nav.tsx +4 -5
  92. package/src/components-v2/sticky/index.ts +1 -1
  93. package/src/components-v2/{wishlist-modal → wishlist-dialogs/add-to-wishlist}/add-to-wishlist-button.tsx +1 -1
  94. package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +35 -0
  95. package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +79 -0
  96. package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +41 -0
  97. package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/context.ts +29 -0
  98. package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-header.tsx +74 -0
  99. package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +82 -0
  100. package/src/components-v2/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +152 -0
  101. package/src/components-v2/wishlist-dialogs/add-to-wishlist/index.tsx +39 -0
  102. package/src/components-v2/wishlist-dialogs/create-wishlist/compound/context.ts +2 -0
  103. package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +42 -0
  104. package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +92 -0
  105. package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +96 -0
  106. package/src/components-v2/{wishlist/components → wishlist-dialogs/create-wishlist}/create-wishlist-button.tsx +5 -3
  107. package/src/components-v2/wishlist-dialogs/create-wishlist/index.tsx +22 -0
  108. package/src/hooks/use-cart.ts +29 -23
  109. package/src/hooks/use-variants.ts +106 -53
  110. package/src/lib/build-detail-url.ts +2 -1
  111. package/src/pages/product-details/product-intro/product-intro.tsx +26 -23
  112. package/src/pages/product-list/quick-view-dialog-content.tsx +18 -9
  113. package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +9 -8
  114. package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +2 -2
  115. package/src/{components-v2/shop-card → pages-v2/product-details/bopis/store-card}/shop-card.tsx +17 -48
  116. package/src/pages-v2/product-details/bopis/store-card/utils/convertSecondsToTime.ts +8 -0
  117. package/src/pages-v2/product-details/bopis/store-card/utils/getDaysResources.ts +25 -0
  118. package/src/pages-v2/product-details/product-intro/compound/context.ts +52 -0
  119. package/src/pages-v2/product-details/product-intro/compound/product-info.tsx +231 -0
  120. package/src/pages-v2/product-details/product-intro/compound/product-intro-images.tsx +124 -0
  121. package/src/pages-v2/product-details/product-intro/compound/product-intro.tsx +49 -0
  122. package/src/pages-v2/product-details/product-intro/compound/thumbnail-with-skeleton.tsx +28 -0
  123. package/src/pages-v2/product-details/product-intro/utils.ts +42 -0
  124. package/src/pages-v2/product-details/product-tabs.tsx +87 -21
  125. package/src/pages-v2/product-details/related-products.tsx +26 -12
  126. package/src/pages-v2/product-list/quick-view-dialog-content.tsx +17 -10
  127. package/typedoc.js +3 -1
  128. package/src/components-v2/MiniCartClient.tsx +0 -65
  129. package/src/components-v2/carousel-cards/carousel-card-2/carousel-card-2.tsx +0 -78
  130. package/src/components-v2/carousel-cards/carousel-card-2/index.ts +0 -1
  131. package/src/components-v2/carousel-cards/carousel-card-2/styles.ts +0 -26
  132. package/src/components-v2/carousel-cards/carousel-card-3/carousel-card-3.tsx +0 -37
  133. package/src/components-v2/carousel-cards/carousel-card-3/index.ts +0 -1
  134. package/src/components-v2/carousel-cards/carousel-card-3/styles.ts +0 -28
  135. package/src/components-v2/carousel-cards/carousel-card-4/carousel-card-4.tsx +0 -81
  136. package/src/components-v2/carousel-cards/carousel-card-4/index.ts +0 -1
  137. package/src/components-v2/carousel-cards/carousel-card-4/styles.ts +0 -27
  138. package/src/components-v2/category-cards/category-card-1/category-card-1.tsx +0 -21
  139. package/src/components-v2/category-cards/category-card-1/index.ts +0 -1
  140. package/src/components-v2/category-cards/category-card-1/styles.ts +0 -37
  141. package/src/components-v2/countdown/count-box.tsx +0 -19
  142. package/src/components-v2/countdown/count-down.tsx +0 -24
  143. package/src/components-v2/countdown/index.tsx +0 -2
  144. package/src/components-v2/countdown/useCountDown.ts +0 -41
  145. package/src/components-v2/data-table/index.ts +0 -2
  146. package/src/components-v2/data-table/table-header.tsx +0 -91
  147. package/src/components-v2/data-table/table-pagination.tsx +0 -36
  148. package/src/components-v2/footer/components/about-links.tsx +0 -23
  149. package/src/components-v2/footer/components/app-store.tsx +0 -38
  150. package/src/components-v2/footer/components/customer-care-links.tsx +0 -21
  151. package/src/components-v2/footer/components/logo.tsx +0 -23
  152. package/src/components-v2/footer/components/social-links.tsx +0 -43
  153. package/src/components-v2/footer/data/index.ts +0 -54
  154. package/src/components-v2/footer/footer-1.tsx +0 -62
  155. package/src/components-v2/footer/footer-2.tsx +0 -57
  156. package/src/components-v2/footer/footer-3.tsx +0 -53
  157. package/src/components-v2/footer/footer-4.tsx +0 -71
  158. package/src/components-v2/footer/index.ts +0 -4
  159. package/src/components-v2/footer/styles/index.ts +0 -42
  160. package/src/components-v2/navbar/category-based-menu/components/categories.tsx +0 -44
  161. package/src/components-v2/navbar/category-based-menu/components/category-item.tsx +0 -31
  162. package/src/components-v2/navbar/category-based-menu/components/child-categories.tsx +0 -38
  163. package/src/components-v2/navbar/mega-menu/category-list.tsx +0 -29
  164. package/src/components-v2/navbar/mobile-menu/render-levels.test.tsx +0 -71
  165. package/src/components-v2/navbar/mobile-menu/render-levels.tsx +0 -62
  166. package/src/components-v2/newsletter/index.ts +0 -1
  167. package/src/components-v2/newsletter/newsletter.tsx +0 -112
  168. package/src/components-v2/newsletter/social-icons.tsx +0 -35
  169. package/src/components-v2/newsletter/styles.ts +0 -65
  170. package/src/components-v2/page-sidenav/grocery-side-nav/components/link-item.tsx +0 -21
  171. package/src/components-v2/page-sidenav/grocery-side-nav/components/list-item.tsx +0 -27
  172. package/src/components-v2/page-sidenav/grocery-side-nav/components/nav-accordion.tsx +0 -36
  173. package/src/components-v2/page-sidenav/grocery-side-nav/components/render-child.tsx +0 -26
  174. package/src/components-v2/page-sidenav/grocery-side-nav/grocery-side-nav.tsx +0 -32
  175. package/src/components-v2/page-sidenav/grocery-side-nav/index.ts +0 -1
  176. package/src/components-v2/page-sidenav/grocery-side-nav/styles/index.ts +0 -11
  177. package/src/components-v2/page-sidenav/health-beauty-side-nav/components/list-item.tsx +0 -27
  178. package/src/components-v2/page-sidenav/health-beauty-side-nav/components/nav-accordion.tsx +0 -44
  179. package/src/components-v2/page-sidenav/health-beauty-side-nav/components/render-child.tsx +0 -20
  180. package/src/components-v2/page-sidenav/health-beauty-side-nav/health-beauty-side-nav.tsx +0 -43
  181. package/src/components-v2/page-sidenav/health-beauty-side-nav/index.ts +0 -1
  182. package/src/components-v2/page-sidenav/health-beauty-side-nav/styles/index.ts +0 -27
  183. package/src/components-v2/page-sidenav/side-navbar/components/list-item.tsx +0 -25
  184. package/src/components-v2/page-sidenav/side-navbar/components/nav-accordion.tsx +0 -46
  185. package/src/components-v2/page-sidenav/side-navbar/components/render-child.tsx +0 -20
  186. package/src/components-v2/page-sidenav/side-navbar/index.ts +0 -1
  187. package/src/components-v2/page-sidenav/side-navbar/side-nav-bar.tsx +0 -77
  188. package/src/components-v2/page-sidenav/side-navbar/styles/index.ts +0 -73
  189. package/src/components-v2/page-sidenav/side-navbar-2/components/button-content.tsx +0 -32
  190. package/src/components-v2/page-sidenav/side-navbar-2/components/sidebar-accordion.tsx +0 -66
  191. package/src/components-v2/page-sidenav/side-navbar-2/index.ts +0 -1
  192. package/src/components-v2/page-sidenav/side-navbar-2/side-navbar-2.tsx +0 -63
  193. package/src/components-v2/page-sidenav/side-navbar-2/styles/index.ts +0 -68
  194. package/src/components-v2/product-cards/product-card-1/index.ts +0 -1
  195. package/src/components-v2/product-cards/product-card-1/product-card-1-wrapper.tsx +0 -304
  196. package/src/components-v2/product-cards/product-card-1/product-card.tsx +0 -107
  197. package/src/components-v2/product-cards/product-card-10/index.ts +0 -1
  198. package/src/components-v2/product-cards/product-card-10/product-card.tsx +0 -128
  199. package/src/components-v2/product-cards/product-card-10/styles/index.ts +0 -38
  200. package/src/components-v2/product-cards/product-card-11/index.ts +0 -1
  201. package/src/components-v2/product-cards/product-card-11/product-card.tsx +0 -66
  202. package/src/components-v2/product-cards/product-card-11/styles/index.ts +0 -16
  203. package/src/components-v2/product-cards/product-card-12/index.ts +0 -1
  204. package/src/components-v2/product-cards/product-card-12/product-card.tsx +0 -42
  205. package/src/components-v2/product-cards/product-card-12/styles/index.ts +0 -16
  206. package/src/components-v2/product-cards/product-card-13/index.ts +0 -1
  207. package/src/components-v2/product-cards/product-card-13/product-card.tsx +0 -48
  208. package/src/components-v2/product-cards/product-card-13/styles/index.ts +0 -25
  209. package/src/components-v2/product-cards/product-card-14/index.ts +0 -1
  210. package/src/components-v2/product-cards/product-card-14/product-card.tsx +0 -125
  211. package/src/components-v2/product-cards/product-card-14/styles/index.ts +0 -40
  212. package/src/components-v2/product-cards/product-card-15/index.ts +0 -1
  213. package/src/components-v2/product-cards/product-card-15/product-card.tsx +0 -121
  214. package/src/components-v2/product-cards/product-card-15/styles/index.ts +0 -57
  215. package/src/components-v2/product-cards/product-card-16/product-card.tsx +0 -116
  216. package/src/components-v2/product-cards/product-card-2/components/favorite-button.tsx +0 -29
  217. package/src/components-v2/product-cards/product-card-2/components/product-price.tsx +0 -26
  218. package/src/components-v2/product-cards/product-card-2/index.ts +0 -1
  219. package/src/components-v2/product-cards/product-card-2/product-card.tsx +0 -70
  220. package/src/components-v2/product-cards/product-card-3/components/hover-actions.tsx +0 -83
  221. package/src/components-v2/product-cards/product-card-3/index.ts +0 -1
  222. package/src/components-v2/product-cards/product-card-3/product-card.tsx +0 -110
  223. package/src/components-v2/product-cards/product-card-3/styles/index.ts +0 -89
  224. package/src/components-v2/product-cards/product-card-4/components/hover-actions.tsx +0 -50
  225. package/src/components-v2/product-cards/product-card-4/index.ts +0 -1
  226. package/src/components-v2/product-cards/product-card-4/product-card.tsx +0 -128
  227. package/src/components-v2/product-cards/product-card-4/styles/index.ts +0 -66
  228. package/src/components-v2/product-cards/product-card-5/components/button-actions.tsx +0 -49
  229. package/src/components-v2/product-cards/product-card-5/components/hover-actions.tsx +0 -50
  230. package/src/components-v2/product-cards/product-card-5/index.ts +0 -1
  231. package/src/components-v2/product-cards/product-card-5/product-card.tsx +0 -137
  232. package/src/components-v2/product-cards/product-card-5/styles/index.ts +0 -94
  233. package/src/components-v2/product-cards/product-card-6/components/hover-actions.tsx +0 -50
  234. package/src/components-v2/product-cards/product-card-6/index.ts +0 -1
  235. package/src/components-v2/product-cards/product-card-6/product-card.tsx +0 -121
  236. package/src/components-v2/product-cards/product-card-6/styles/index.ts +0 -63
  237. package/src/components-v2/product-cards/product-card-7/components/product-status.tsx +0 -18
  238. package/src/components-v2/product-cards/product-card-7/components/quantity-buttons.tsx +0 -47
  239. package/src/components-v2/product-cards/product-card-7/index.ts +0 -1
  240. package/src/components-v2/product-cards/product-card-7/product-card.tsx +0 -139
  241. package/src/components-v2/product-cards/product-card-7/styles/index.ts +0 -98
  242. package/src/components-v2/product-cards/product-card-8/product-card.tsx +0 -151
  243. package/src/components-v2/product-cards/product-card-9/index.ts +0 -1
  244. package/src/components-v2/product-cards/product-card-9/product-card.tsx +0 -169
  245. package/src/components-v2/product-cards/product-card-wishlist/components/hover-actions.tsx +0 -37
  246. package/src/components-v2/product-cards/product-card-wishlist/product-card.tsx +0 -118
  247. package/src/components-v2/product-cards/product-card-wishlist/styles/index.ts +0 -53
  248. package/src/components-v2/product-quantity-buttons/product-quantity-buttons.tsx +0 -88
  249. package/src/components-v2/products-view/product-view-dialog.tsx +0 -218
  250. package/src/components-v2/search-box/__test__/search-input-category.test.tsx +0 -110
  251. package/src/components-v2/search-box/__test__/search-input.test.tsx +0 -137
  252. package/src/components-v2/search-box/__test__/search-results.json +0 -165
  253. package/src/components-v2/search-box/components/search-result.tsx +0 -86
  254. package/src/components-v2/search-box/hooks/use-search.ts +0 -63
  255. package/src/components-v2/search-box/index.ts +0 -2
  256. package/src/components-v2/search-box/search-input-category.test.tsx +0 -110
  257. package/src/components-v2/search-box/search-input-category.tsx +0 -203
  258. package/src/components-v2/search-box/search-input.test.tsx +0 -41
  259. package/src/components-v2/search-box/search-input.tsx +0 -66
  260. package/src/components-v2/section-header/index.ts +0 -2
  261. package/src/components-v2/section-header/section-creator.tsx +0 -29
  262. package/src/components-v2/section-header/section-header.tsx +0 -44
  263. package/src/components-v2/service-cards/icon-component.tsx +0 -18
  264. package/src/components-v2/service-cards/service-card-1/index.ts +0 -1
  265. package/src/components-v2/service-cards/service-card-1/service-card-1.tsx +0 -42
  266. package/src/components-v2/service-cards/service-card-2/index.ts +0 -1
  267. package/src/components-v2/service-cards/service-card-2/service-card-2.tsx +0 -37
  268. package/src/components-v2/service-cards/service-card-3/index.ts +0 -1
  269. package/src/components-v2/service-cards/service-card-3/service-card-3.tsx +0 -28
  270. package/src/components-v2/service-cards/service-card-3/styles.ts +0 -23
  271. package/src/components-v2/settings/index.ts +0 -1
  272. package/src/components-v2/settings/setting.tsx +0 -141
  273. package/src/components-v2/settings/styles.ts +0 -57
  274. package/src/components-v2/sticky-wrapper/index.ts +0 -1
  275. package/src/components-v2/sticky-wrapper/sticky-wrapper.tsx +0 -21
  276. package/src/components-v2/sticky-wrapper/styles.ts +0 -25
  277. package/src/components-v2/stories/story-content/index.ts +0 -1
  278. package/src/components-v2/stories/story-content/story-content.tsx +0 -28
  279. package/src/components-v2/stories/story-content/styles.ts +0 -22
  280. package/src/components-v2/stories/story-item/index.ts +0 -1
  281. package/src/components-v2/stories/story-item/story-item.tsx +0 -24
  282. package/src/components-v2/stories/story-item/styles.ts +0 -11
  283. package/src/components-v2/stories/story-viewer/index.ts +0 -1
  284. package/src/components-v2/stories/story-viewer/story-viewer.tsx +0 -44
  285. package/src/components-v2/stories/story-viewer/styles.ts +0 -15
  286. package/src/components-v2/subscribe-input/index.ts +0 -1
  287. package/src/components-v2/subscribe-input/styles.ts +0 -14
  288. package/src/components-v2/subscribe-input/subscribe-input.tsx +0 -43
  289. package/src/components-v2/topbar/index.ts +0 -1
  290. package/src/components-v2/topbar/styles.ts +0 -55
  291. package/src/components-v2/topbar/top-bar.tsx +0 -115
  292. package/src/components-v2/wishlist/add-to-wishlist-dialog.tsx +0 -161
  293. package/src/components-v2/wishlist/components/create-new-list.tsx +0 -167
  294. package/src/components-v2/wishlist/components/dashboard-header.tsx +0 -123
  295. package/src/components-v2/wishlist/components/navigation.tsx +0 -87
  296. package/src/components-v2/wishlist/components/no-records.tsx +0 -20
  297. package/src/components-v2/wishlist/components/wishlist-modal-item.tsx +0 -66
  298. package/src/components-v2/wishlist/remove-from-wishlist-dialog.tsx +0 -175
  299. package/src/components-v2/wishlist-modal/TODO.md +0 -10
  300. package/src/components-v2/wishlist-modal/add-to-wishlist-dialog.tsx +0 -161
  301. package/src/components-v2/wishlist-modal/remove-from-wishlist-dialog.tsx +0 -174
  302. package/src/components-v2/wishlist-modal/wishlist-modal-item.tsx +0 -65
  303. package/src/pages-v2/product-details/product-intro/product-intro-images.tsx +0 -90
  304. package/src/pages-v2/product-details/product-intro/product-intro.tsx +0 -256
  305. /package/src/{pages-v2/account → components-v2}/no-records.tsx +0 -0
  306. /package/src/components-v2/product-cards/{product-card-1 → product-card}/components/hover-actions.tsx +0 -0
  307. /package/src/components-v2/product-cards/{product-card-16 → product-card}/index.ts +0 -0
  308. /package/src/components-v2/product-cards/{product-card-16 → product-card-plp}/components/quantity-buttons.tsx +0 -0
  309. /package/src/components-v2/product-cards/{product-card-wishlist → product-card-plp}/index.ts +0 -0
  310. /package/src/components-v2/product-cards/{product-card-16 → product-card-plp}/styles/index.ts +0 -0
  311. /package/src/components-v2/product-cards/{product-card-9 → product-card-plp-list}/components/add-to-cart.tsx +0 -0
  312. /package/src/components-v2/product-cards/{product-card-9 → product-card-plp-list}/components/favorite-button.tsx +0 -0
  313. /package/src/components-v2/product-cards/{product-card-9 → product-card-plp-list}/components/tags.tsx +0 -0
  314. /package/src/components-v2/product-cards/{product-card-8 → product-card-search}/index.ts +0 -0
  315. /package/src/components-v2/product-cards/{product-card-8 → product-card-search}/styles/index.ts +0 -0
  316. /package/src/components-v2/sticky/{Sticky.tsx → sticky.tsx} +0 -0
  317. /package/src/components-v2/{wishlist → wishlist-dialogs}/styles.ts +0 -0
  318. /package/src/{components-v2/shop-card → pages-v2/product-details/bopis/store-card}/index.ts +0 -0
  319. /package/src/{components-v2/shop-card → pages-v2/product-details/bopis/store-card}/styles.ts +0 -0
@@ -56,37 +56,40 @@ export default function ProductIntro({ product, cart }: Props) {
56
56
 
57
57
  // HOOKS
58
58
  const {
59
- productVariant,
60
- selectVariantId,
59
+ selectedVariant,
61
60
  selectDimensions,
62
61
  handleChangeVariant,
63
62
  allDimensionsSelected,
64
- } = useVariants({ product });
63
+ } = useVariants(product);
65
64
 
66
- const { handleCartAmountChange, handleAddToCart, loading } = useCart({
67
- cart,
68
- selectVariantId,
69
- recordId: RecordId,
70
- });
65
+ const { handleCartAmountChange, handleAddToCart, loading } = useCart(
66
+ selectedVariant.RecordId,
67
+ RecordId,
68
+ );
71
69
 
72
70
  const { formatCurrency } = useCurrencyFormatter();
73
71
 
74
72
  const searchCriteria = useMemo<InventorySearchCriteriaInput>(
75
73
  () => ({
76
- allDimensionsSelected: allDimensionsSelected(selectDimensions),
74
+ allDimensionsSelected: allDimensionsSelected,
77
75
  searchCriteria: {
78
76
  defaultWarehouseOnly: true,
79
- productIds: [selectVariantId || RecordId],
77
+ productIds: [selectedVariant?.RecordId || RecordId],
80
78
  },
81
79
  }),
82
- [allDimensionsSelected, selectDimensions, selectVariantId, RecordId],
80
+ [
81
+ allDimensionsSelected,
82
+ selectDimensions,
83
+ selectedVariant?.RecordId,
84
+ RecordId,
85
+ ],
83
86
  );
84
87
 
85
88
  const { data: shippingInventoryData, isLoading: inventoryLoading } =
86
89
  getProductAvailability.useData(searchCriteria);
87
90
  // HELPERS
88
91
  const currentCartLine = cart?.CartLines?.find((item) => {
89
- return item?.ProductId === (Number(selectVariantId) || RecordId);
92
+ return item?.ProductId === (Number(selectedVariant?.RecordId) || RecordId);
90
93
  });
91
94
 
92
95
  const getInventoryLabel = (): string | null => {
@@ -102,7 +105,7 @@ export default function ProductIntro({ product, cart }: Props) {
102
105
 
103
106
  const shouldDisableAddToCart = () => {
104
107
  //TODO: Incorporate global inventory enabled flag.
105
- if (!allDimensionsSelected(selectDimensions)) {
108
+ if (!allDimensionsSelected) {
106
109
  return false; // Don't disable add to cart if dimensions are not selected, so clicking the button will provide an error message showing the user what to do.
107
110
  }
108
111
  const OOSCode = "OOS"; // Always means out of stock
@@ -122,8 +125,8 @@ export default function ProductIntro({ product, cart }: Props) {
122
125
  };
123
126
 
124
127
  const images =
125
- Array.isArray(productVariant?.Images) && productVariant.Images.length > 0
126
- ? productVariant.Images
128
+ Array.isArray(selectedVariant?.Images) && selectedVariant.Images.length > 0
129
+ ? selectedVariant.Images
127
130
  : Array.isArray(Images) && Images.length > 0
128
131
  ? Images
129
132
  : [];
@@ -138,7 +141,7 @@ export default function ProductIntro({ product, cart }: Props) {
138
141
  };
139
142
 
140
143
  const onAddToCart = (bopisInput?: AddToCartBopisInput) => {
141
- if (!allDimensionsSelected(selectDimensions)) {
144
+ if (!allDimensionsSelected) {
142
145
  setShowDimensionError(true);
143
146
  return;
144
147
  }
@@ -147,7 +150,7 @@ export default function ProductIntro({ product, cart }: Props) {
147
150
  };
148
151
 
149
152
  const shouldOpenHelperModal = () => {
150
- if (!allDimensionsSelected(selectDimensions)) {
153
+ if (!allDimensionsSelected) {
151
154
  setShowDimensionError(true);
152
155
  return false;
153
156
  }
@@ -162,9 +165,9 @@ export default function ProductIntro({ product, cart }: Props) {
162
165
  name={Name}
163
166
  selectedImageIndex={selectedImageIndex}
164
167
  primaryImageUrl={
165
- Array.isArray(productVariant?.Images) &&
166
- productVariant.Images.length > 0
167
- ? productVariant.Images[0]
168
+ Array.isArray(selectedVariant?.Images) &&
169
+ selectedVariant.Images.length > 0
170
+ ? selectedVariant.Images[0]
168
171
  : Array.isArray(Images) && Images.length > 0
169
172
  ? Images[0]
170
173
  : ""
@@ -180,7 +183,7 @@ export default function ProductIntro({ product, cart }: Props) {
180
183
 
181
184
  {/* PRODUCT BRAND */}
182
185
  <FlexBox alignItems="center" mb={1}>
183
- <H6>SKU: {productVariant?.ItemId || ItemId}</H6>
186
+ <H6>SKU: {selectedVariant?.ItemId || ItemId}</H6>
184
187
  </FlexBox>
185
188
 
186
189
  {/* PRODUCT RATING */}
@@ -234,10 +237,10 @@ export default function ProductIntro({ product, cart }: Props) {
234
237
  isOOS={shouldDisableAddToCart()}
235
238
  />
236
239
  <FindInStoreButton
237
- productId={selectVariantId || RecordId}
240
+ productId={selectedVariant?.RecordId || RecordId}
238
241
  canOpenModal={shouldOpenHelperModal}
239
242
  handleAddToCart={handleAddToCart}
240
- allDimensionsSelected={allDimensionsSelected(selectDimensions)}
243
+ allDimensionsSelected={allDimensionsSelected}
241
244
  />
242
245
  <AddToWishlistButton
243
246
  path="Account.Wishlists.btnAddToWishlist"
@@ -49,11 +49,12 @@ export default function QuickViewContent({
49
49
  }: Props) {
50
50
  const [showDimensionError, setShowDimensionError] = useState(false);
51
51
  const {
52
- selectVariantId,
52
+ selectedVariant,
53
53
  selectDimensions,
54
54
  handleChangeVariant,
55
55
  allDimensionsSelected,
56
- } = useVariants({ product: productDetails });
56
+ } = useVariants(productDetails);
57
+
57
58
  const t = useTranslations("ProductList.QuickView");
58
59
  const { formatCurrency } = useCurrencyFormatter();
59
60
  const { handleCartAmountChange, handleAddToCart, loading } = useCart(
@@ -61,35 +62,43 @@ export default function QuickViewContent({
61
62
  ? {
62
63
  cart,
63
64
  recordId: product.RecordId,
64
- selectVariantId: selectVariantId,
65
+ selectVariantId: selectedVariant?.RecordId,
65
66
  }
66
67
  : {
67
68
  cart: { Id: "", CartLines: [] },
68
69
  recordId: product.RecordId,
69
- selectVariantId: selectVariantId,
70
+ selectVariantId: selectedVariant?.RecordId,
70
71
  },
71
72
  );
72
73
 
73
74
  const searchCriteria = useMemo<InventorySearchCriteriaInput>(
74
75
  () => ({
75
- allDimensionsSelected: allDimensionsSelected(selectDimensions),
76
+ allDimensionsSelected: allDimensionsSelected,
76
77
  searchCriteria: {
77
78
  defaultWarehouseOnly: true,
78
- productIds: [selectVariantId || product.RecordId],
79
+ productIds: [selectedVariant?.RecordId || product.RecordId],
79
80
  },
80
81
  }),
81
- [allDimensionsSelected, selectDimensions, product, selectVariantId],
82
+ [
83
+ allDimensionsSelected,
84
+ selectDimensions,
85
+ product,
86
+ selectedVariant?.RecordId,
87
+ ],
82
88
  );
83
89
 
84
90
  const { data: shippingInventoryData, isLoading: inventoryLoading } =
85
91
  getProductAvailability.useData(searchCriteria);
86
92
 
87
93
  const currentCartLine = cart?.CartLines?.find((item) => {
88
- return item?.ProductId === (Number(selectVariantId) || product.RecordId);
94
+ return (
95
+ item?.ProductId ===
96
+ (Number(selectedVariant?.RecordId) || product.RecordId)
97
+ );
89
98
  });
90
99
 
91
100
  const onAddToCart = (bopisInput?: AddToCartBopisInput) => {
92
- if (!allDimensionsSelected(selectDimensions)) {
101
+ if (!allDimensionsSelected) {
93
102
  setShowDimensionError(true);
94
103
  return;
95
104
  }
@@ -6,9 +6,9 @@ import { useTranslations } from "next-intl";
6
6
 
7
7
  type Props = {
8
8
  productId: number;
9
- canOpenModal(): boolean;
10
- handleAddToCart: (bopisInput: AddToCartBopisInput) => void;
11
9
  allDimensionsSelected: boolean;
10
+ handleAddToCart: (bopisInput: AddToCartBopisInput) => void;
11
+ setDimensionsError: (state: boolean) => void;
12
12
  };
13
13
 
14
14
  /**
@@ -16,7 +16,6 @@ type Props = {
16
16
  *
17
17
  * @param props - The component props
18
18
  * @param props.productId - The ID of the product to find in stores
19
- * @param props.canOpenModal - Optional function that determines if the modal can be opened; if undefined, modal can always open
20
19
  * @param props.handleAddToCart - Function to call when adding the item to cart with BOPIS information
21
20
  * @param props.allDimensionsSelected - Flag indicating if all product dimensions/variations have been selected
22
21
  *
@@ -24,17 +23,18 @@ type Props = {
24
23
  */
25
24
  const FindInStoreButton = ({
26
25
  productId,
27
- canOpenModal,
28
- handleAddToCart,
29
26
  allDimensionsSelected,
27
+ handleAddToCart,
28
+ setDimensionsError,
30
29
  }: Props) => {
31
30
  const [open, setOpen] = React.useState(false);
32
31
  const t = useTranslations("productDetail.Bopis");
33
- const modalShouldOpen = () => canOpenModal === undefined || canOpenModal();
34
32
  const handleOpen = () => {
35
- if (modalShouldOpen()) {
36
- setOpen(true);
33
+ if (!allDimensionsSelected) {
34
+ setDimensionsError(true);
35
+ return;
37
36
  }
37
+ setOpen(true);
38
38
  };
39
39
  const handleClose = () => {
40
40
  setOpen(false);
@@ -44,6 +44,7 @@ const FindInStoreButton = ({
44
44
  handleAddToCart(bopisInput);
45
45
  handleClose();
46
46
  };
47
+
47
48
  return (
48
49
  <React.Fragment>
49
50
  <Button onClick={handleOpen} variant={"contained"} color={"secondary"}>
@@ -10,7 +10,7 @@ import {
10
10
  import { Box } from "@mui/system";
11
11
  import React from "react";
12
12
  import SearchHeader from "./search-header";
13
- import ShopCard from "@evenicanpm/storefront-core/src/components-v2/shop-card";
13
+ import ShopCard from "./store-card";
14
14
  import {
15
15
  DeliveryOption,
16
16
  ProductWarehouseInventoryAvailability,
@@ -200,7 +200,7 @@ const FindInStoreModal = ({
200
200
 
201
201
  const renderShopCard = (store: OrgUnitLocationReturnType) => {
202
202
  const { location, storeHours, pickupOptions } = store;
203
- if (!location.OrgUnitNumber) {
203
+ if (!location?.OrgUnitNumber) {
204
204
  return null;
205
205
  }
206
206
  const inventoryRecord = getInventoryRecordByStoreId(location.OrgUnitNumber);
@@ -4,21 +4,24 @@ import AccessTimeFilledIcon from "@mui/icons-material/AccessTimeFilled";
4
4
  import Place from "@mui/icons-material/Place";
5
5
  import InventoryIcon from "@mui/icons-material/Inventory";
6
6
  // GLOBAL CUSTOM COMPONENTS
7
- import { H3, Span } from "../Typography";
8
- import { FlexBetween, FlexBox } from "../flex-box/index";
7
+ import {
8
+ H3,
9
+ Span,
10
+ } from "@evenicanpm/storefront-core/src/components-v2/Typography";
11
+ import {
12
+ FlexBetween,
13
+ FlexBox,
14
+ } from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
9
15
  // STYLED COMPONENT
10
16
  import { ContentWrapper } from "./styles";
11
17
  import {
12
18
  ProductWarehouseInventoryAvailability,
13
19
  StoreHours,
14
20
  } from "@msdyn365-commerce/retail-proxy";
15
- import {
16
- buildStoreHours,
17
- IHoursDisplayInfo,
18
- IStoreSelectorLocationLineItemResources,
19
- } from "@/lib/store-hours-helper";
21
+ import { buildStoreHours, IHoursDisplayInfo } from "@/lib/store-hours-helper";
20
22
  import { Box } from "@mui/system";
21
- import { useTranslations } from "next-intl";
23
+ import { convertSecondsToTime } from "./utils/convertSecondsToTime";
24
+ import { getDaysResources } from "./utils/getDaysResources";
22
25
 
23
26
  type Props = {
24
27
  name: string;
@@ -33,37 +36,8 @@ type Props = {
33
36
  export default function ShopCard(props: Props) {
34
37
  const { name, address, actionArea, openFrom, openTo, storeHours } =
35
38
  props || {};
36
- const daysTrans = useTranslations("StoreHours");
37
39
 
38
- const convertNumberToTime = (numberinSeconds: number) => {
39
- const date = new Date(numberinSeconds * 1000);
40
- const hours = date.getUTCHours();
41
- const minutes = date.getUTCMinutes();
42
- const ampm = hours >= 12 ? "PM" : "AM";
43
- const formattedHours = hours % 12 || 12; // Convert to 12-hour format
44
- const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;
45
- return `${formattedHours}:${formattedMinutes} ${ampm}`;
46
- };
47
-
48
- const resources: IStoreSelectorLocationLineItemResources = {
49
- days: {
50
- monday: daysTrans("mon"),
51
- tuesday: daysTrans("tue"),
52
- wednesday: daysTrans("wed"),
53
- thursday: daysTrans("thu"),
54
- friday: daysTrans("fri"),
55
- saturday: daysTrans("sat"),
56
- sunday: daysTrans("sun"),
57
- mondayFull: daysTrans("monday"),
58
- tuesdayFull: daysTrans("tuesday"),
59
- wednesdayFull: daysTrans("wednesday"),
60
- thursdayFull: daysTrans("thursday"),
61
- fridayFull: daysTrans("friday"),
62
- saturdayFull: daysTrans("saturday"),
63
- sundayFull: daysTrans("sunday"),
64
- },
65
- closedText: daysTrans("closed"),
66
- };
40
+ const resources = getDaysResources();
67
41
 
68
42
  const renderStoreHours = () => {
69
43
  if (storeHours?.RegularStoreHours) {
@@ -72,12 +46,9 @@ export default function ShopCard(props: Props) {
72
46
  resources,
73
47
  );
74
48
  return (
75
- <div className="ms-store-select__store-hours-details-group">
49
+ <Box>
76
50
  {storeHoursList.map((displayTime) => (
77
- <div
78
- className="ms-store-select__store-hours-details"
79
- key={JSON.stringify(displayTime)}
80
- >
51
+ <Box key={JSON.stringify(displayTime)}>
81
52
  {displayTime.endDayShort ? (
82
53
  <Box>
83
54
  <Span>
@@ -102,14 +73,14 @@ export default function ShopCard(props: Props) {
102
73
  </Box>
103
74
  )}
104
75
  <Box>{displayTime.timeRange}</Box>
105
- </div>
76
+ </Box>
106
77
  ))}
107
- </div>
78
+ </Box>
108
79
  );
109
80
  }
110
81
  return (
111
82
  <Span color="white">
112
- {convertNumberToTime(openFrom)} - {convertNumberToTime(openTo)}
83
+ {convertSecondsToTime(openFrom)} - {convertSecondsToTime(openTo)}
113
84
  </Span>
114
85
  );
115
86
  };
@@ -121,8 +92,6 @@ export default function ShopCard(props: Props) {
121
92
  {name}
122
93
  </H3>
123
94
 
124
- {/* <Rating value={rating || 0} color="warn" size="small" readOnly className="mb-1" /> */}
125
-
126
95
  <FlexBox mb={1} gap={1}>
127
96
  <Place fontSize="small" sx={{ fontSize: 17, mt: "3px" }} />
128
97
  <Span color="white">{address}</Span>
@@ -0,0 +1,8 @@
1
+ export const convertSecondsToTime = (numberinSeconds: number) => {
2
+ return new Date(numberinSeconds * 1000).toLocaleTimeString("en-US", {
3
+ hour12: true,
4
+ hour: "2-digit",
5
+ minute: "2-digit",
6
+ timeZone: "UTC",
7
+ });
8
+ };
@@ -0,0 +1,25 @@
1
+ import { IStoreSelectorLocationLineItemResources } from "@/lib/store-hours-helper";
2
+ import { useTranslations } from "next-intl";
3
+
4
+ export const getDaysResources = (): IStoreSelectorLocationLineItemResources => {
5
+ const daysTrans = useTranslations("StoreHours");
6
+ return {
7
+ days: {
8
+ monday: daysTrans("mon"),
9
+ tuesday: daysTrans("tue"),
10
+ wednesday: daysTrans("wed"),
11
+ thursday: daysTrans("thu"),
12
+ friday: daysTrans("fri"),
13
+ saturday: daysTrans("sat"),
14
+ sunday: daysTrans("sun"),
15
+ mondayFull: daysTrans("monday"),
16
+ tuesdayFull: daysTrans("tuesday"),
17
+ wednesdayFull: daysTrans("wednesday"),
18
+ thursdayFull: daysTrans("thursday"),
19
+ fridayFull: daysTrans("friday"),
20
+ saturdayFull: daysTrans("saturday"),
21
+ sundayFull: daysTrans("sunday"),
22
+ },
23
+ closedText: daysTrans("closed"),
24
+ };
25
+ };
@@ -0,0 +1,52 @@
1
+ import { createContext } from "react";
2
+ import { ProductDetails } from "@/api-manager/schemas/product.schema";
3
+ import { SelectedDimensions } from "@evenicanpm/storefront-core/src/hooks/use-variants";
4
+ import {
5
+ ProductWarehouseInventoryAvailability,
6
+ ProductWarehouseInventoryInformation,
7
+ } from "@msdyn365-commerce/retail-proxy";
8
+
9
+ export interface ProductIntroContext {
10
+ /** The current master product of the PDP */
11
+ masterProduct: ProductDetails;
12
+ /** The currently selected variant that is deduced from dimensions */
13
+ selectedVariant: ProductDetails;
14
+ /** Is the data for variant loading? */
15
+ variantPending: boolean;
16
+ /** State that tracks which dimensions are currently selected */
17
+ selectDimensions: SelectedDimensions;
18
+ /** Handler for when dimensions are selected **/
19
+ handleChangeVariant: () => void;
20
+ /** Calculated value are all dimensions selected? **/
21
+ allDimensionsSelected: boolean;
22
+ }
23
+
24
+ export interface ProductImagesContext {
25
+ /** Currently selected index from images array of product details */
26
+ selectedImageIndex?: number;
27
+ /** The default image to show on PDP */
28
+ primaryImageUrl: string;
29
+ /* Handler when thumbnails are clicked */
30
+ handleImageClick: (ind: number) => () => void;
31
+ /* The array of images to display, comes from */
32
+ images: string[];
33
+ /* Name */
34
+ name: string | undefined;
35
+ }
36
+
37
+ export interface ProductInfoContext {
38
+ /** Currently selected index from images array of product details */
39
+ isOOS: boolean;
40
+ /** **/
41
+ inventoryPending: boolean;
42
+ /** */
43
+ shippingInventoryData: ProductWarehouseInventoryInformation;
44
+ /** */
45
+ showDimensionError: boolean;
46
+ /** */
47
+ setShowDimensionError: () => void;
48
+ }
49
+
50
+ export const ProductImagesContext = createContext(null);
51
+ export const ProductIntroContext = createContext(null);
52
+ export const ProductInfoContext = createContext(null);