@shopgate/engage 7.30.0-alpha.9 → 7.30.0-beta.2

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 (559) hide show
  1. package/a11y/components/FocusTrap/index.js +1 -1
  2. package/a11y/components/LiveMessage/index.js +8 -6
  3. package/a11y/components/LiveMessenger/index.js +12 -9
  4. package/a11y/components/Navigation/index.js +18 -14
  5. package/a11y/components/Section/index.js +19 -12
  6. package/account/components/Account/Account.js +49 -38
  7. package/account/components/Profile/Profile.js +10 -7
  8. package/account/components/Profile/Profile.provider.js +5 -3
  9. package/account/components/Profile/ProfileAddressBook.js +25 -19
  10. package/account/components/Profile/ProfileAddressCard.js +70 -50
  11. package/account/components/Profile/ProfileForm.js +27 -22
  12. package/account/components/Profile/ProfileHeader.js +10 -7
  13. package/account/components/ProfileContact/ProfileContact.js +21 -17
  14. package/account/helper/form.js +9 -9
  15. package/back-in-stock/components/BackInStockButton/index.js +28 -21
  16. package/back-in-stock/components/CharacteristicsButton/index.js +2 -1
  17. package/back-in-stock/components/ProductInfoBackInStockButton/index.js +11 -9
  18. package/back-in-stock/components/Subscriptions/components/List/index.js +30 -24
  19. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +75 -64
  20. package/back-in-stock/components/Subscriptions/index.js +4 -1
  21. package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -3
  22. package/cart/cart.helpers.js +3 -3
  23. package/cart/components/CartHeaderWide/CartHeaderWide.js +5 -3
  24. package/cart/components/CartItem/CartItem.js +24 -20
  25. package/cart/components/CartItem/CartItemCoupon.js +59 -45
  26. package/cart/components/CartItem/CartItemCouponCode.js +5 -3
  27. package/cart/components/CartItem/CartItemCouponDelete.js +5 -3
  28. package/cart/components/CartItem/CartItemCouponFreeShipping.js +4 -1
  29. package/cart/components/CartItem/CartItemCouponIcon.js +7 -6
  30. package/cart/components/CartItem/CartItemCouponLayout.js +44 -35
  31. package/cart/components/CartItem/CartItemCouponPrice.js +6 -4
  32. package/cart/components/CartItem/CartItemCouponTitle.js +5 -3
  33. package/cart/components/CartItem/CartItemProduct.js +24 -17
  34. package/cart/components/CartItem/CartItemProductLayout.js +105 -85
  35. package/cart/components/CartItem/CartItemProductLayoutWide.js +100 -87
  36. package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.js +5 -3
  37. package/cart/components/CartItem/CartItemProductLayoutWideOrderDetails.js +18 -12
  38. package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +7 -5
  39. package/cart/components/CartItem/CartItemProductOrderDetails.js +54 -40
  40. package/cart/components/CartItem/CartItemProductPriceCaption.js +7 -5
  41. package/cart/components/CartItem/CartItemProductPriceList.js +30 -27
  42. package/cart/components/CartItem/CartItemProductPriceListPromotion.js +37 -32
  43. package/cart/components/CartItem/CartItemProductProvider.js +7 -3
  44. package/cart/components/CartItem/CartItemProductProviderLegacy.js +22 -14
  45. package/cart/components/CartItem/CartItemProductTitle.js +57 -45
  46. package/cart/components/CartItem/CartItemProvider.js +6 -4
  47. package/cart/components/CartItem/CartItemQuantityPicker.js +49 -55
  48. package/cart/components/CartItem/CartItemSubstitution.js +11 -8
  49. package/cart/components/CartItems/CartItemCard.js +10 -6
  50. package/cart/components/CartItems/CartItemCardReservation.js +28 -22
  51. package/cart/components/CartItems/CartItemCardReservationAccordion.js +20 -15
  52. package/cart/components/CartItems/CartItemCardReservationLabel.js +28 -20
  53. package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +7 -5
  54. package/cart/components/CartItems/CartItemGroup.js +7 -4
  55. package/cart/components/CartItems/CartItemGroupReservation.js +25 -19
  56. package/cart/components/CartItems/CartItemGroupReservationLabel.js +13 -7
  57. package/cart/components/CartItems/CartItemGroupShipping.js +15 -7
  58. package/cart/components/CartItems/CartItems.js +56 -45
  59. package/cart/components/CartItems/CartItemsHeaderWide.js +48 -37
  60. package/cart/components/CartItems/CartItemsSubstitution.js +18 -12
  61. package/cart/components/CartSummaryWide/CartSummaryWide.js +34 -30
  62. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +22 -17
  63. package/cart/components/CartSummaryWide/CartSummaryWideFooter.js +2 -1
  64. package/cart/components/PaymentBar/PaymentBar.js +2 -1
  65. package/cart/components/PaymentBar/PaymentBarAppliedPromotions.js +18 -17
  66. package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +19 -15
  67. package/cart/components/PaymentBar/PaymentBarContent.js +34 -27
  68. package/cart/components/PaymentBar/PaymentBarDiscounts.js +24 -22
  69. package/cart/components/PaymentBar/PaymentBarGrandTotal.js +18 -15
  70. package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +15 -11
  71. package/cart/components/PaymentBar/PaymentBarPromotionCoupons.js +40 -36
  72. package/cart/components/PaymentBar/PaymentBarPromotionalText.js +22 -17
  73. package/cart/components/PaymentBar/PaymentBarReserveButton.js +15 -12
  74. package/cart/components/PaymentBar/PaymentBarShippingCost.js +20 -17
  75. package/cart/components/PaymentBar/PaymentBarSubTotal.js +18 -15
  76. package/cart/components/PaymentBar/PaymentBarTax.js +20 -17
  77. package/cart/components/Substitution/index.js +21 -16
  78. package/cart/components/SupplementalContent/SupplementalContent.js +2 -1
  79. package/category/components/CategoryImage/index.js +4 -4
  80. package/category/components/CategoryList/index.js +60 -57
  81. package/checkout/components/AddressBook/AddressBook.js +6 -1
  82. package/checkout/components/AddressBook/AddressList.js +31 -24
  83. package/checkout/components/AddressBookContact/AddressBookContact.js +13 -6
  84. package/checkout/components/Checkout/Checkout.js +29 -21
  85. package/checkout/components/Checkout/CheckoutActions.js +17 -12
  86. package/checkout/components/Checkout/CheckoutAddress.js +40 -16
  87. package/checkout/components/Checkout/CheckoutHeader.js +17 -12
  88. package/checkout/components/Checkout/CheckoutPickupContactForm.js +19 -15
  89. package/checkout/components/Checkout/CheckoutSection.js +73 -52
  90. package/checkout/components/Checkout/CheckoutSectionInfo.js +6 -4
  91. package/checkout/components/Checkout/CheckoutSectionMessages.js +16 -14
  92. package/checkout/components/Checkout/CheckoutSummary.js +18 -13
  93. package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +95 -79
  94. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +6 -5
  95. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderContact.js +2 -1
  96. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderSummary.js +13 -9
  97. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickUpContact.js +2 -1
  98. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickupNotes.js +2 -1
  99. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationSection.js +59 -44
  100. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationShippedTo.js +4 -3
  101. package/checkout/components/GuestCheckout/GuestCheckout.js +29 -22
  102. package/checkout/components/GuestCheckout/GuestCheckoutOptIn.js +17 -13
  103. package/checkout/components/GuestCheckout/GuestCheckoutPickup.js +16 -7
  104. package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.js +16 -13
  105. package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +5 -3
  106. package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +15 -12
  107. package/checkout/components/ShippingMethods/ShippingMethod.js +22 -15
  108. package/checkout/components/ShippingMethods/ShippingMethods.js +49 -41
  109. package/checkout/components/SupplementalContent/SupplementalContent.js +2 -1
  110. package/checkout/helpers/index.js +2 -2
  111. package/checkout/paymentMethods/index.js +33 -28
  112. package/checkout/paymentMethods/paypal/PaypalButton.js +7 -2
  113. package/checkout/paymentMethods/paypal/PaypalButtonApp.js +9 -5
  114. package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +14 -11
  115. package/checkout/paymentMethods/paypal/PaypalPayButton.js +9 -5
  116. package/checkout/paymentMethods/stripe/StripeButton.js +33 -25
  117. package/checkout/paymentMethods/stripe/StripeCreditCard.js +70 -60
  118. package/checkout/paymentMethods/stripe/StripePayButton.js +5 -3
  119. package/checkout/paymentMethods/stripe/StripeProvider.js +11 -10
  120. package/checkout/providers/AddressBookProvider.js +5 -3
  121. package/checkout/providers/CheckoutProvider.js +14 -15
  122. package/checkout/selectors/guestCheckout.js +1 -1
  123. package/components/BrandingColorBanner/BrandingColorBanner.js +7 -5
  124. package/components/ChipLayout/index.js +64 -49
  125. package/components/ChipLayout/spec.js +16 -8
  126. package/components/ConnectedReactPortal/index.js +19 -21
  127. package/components/Footer/Footer.js +9 -6
  128. package/components/Form/Builder/Builder.js +85 -74
  129. package/components/Form/Builder/ElementCheckbox.js +19 -17
  130. package/components/Form/Builder/ElementMultiSelect.js +42 -38
  131. package/components/Form/Builder/ElementPhoneNumber.js +39 -36
  132. package/components/Form/Builder/ElementRadio.js +25 -23
  133. package/components/Form/Builder/ElementSelect.js +25 -23
  134. package/components/Form/Builder/ElementText.js +22 -20
  135. package/components/Form/Builder/FormHelper.js +18 -15
  136. package/components/Form/Builder/classes/ActionListener.js +400 -401
  137. package/components/Form/Form.js +23 -15
  138. package/components/IntersectionVisibility/index.js +23 -17
  139. package/components/Logo/index.js +9 -7
  140. package/components/Logo/spec.js +2 -1
  141. package/components/Menu/components/Item/index.js +12 -8
  142. package/components/Menu/components/Position/index.js +20 -12
  143. package/components/Menu/index.js +60 -60
  144. package/components/MessageBar/MessageBar.js +35 -31
  145. package/components/NavigationHandler/index.js +14 -8
  146. package/components/NavigationHandler/spec.js +9 -3
  147. package/components/Picker/components/Button/index.js +11 -7
  148. package/components/Picker/components/List/index.js +19 -16
  149. package/components/Picker/components/Modal/index.js +34 -25
  150. package/components/Picker/index.js +44 -33
  151. package/components/Picker/spec.js +4 -1
  152. package/components/PickerUtilize/components/Button/index.js +11 -7
  153. package/components/PickerUtilize/index.js +56 -43
  154. package/components/PickerUtilize/spec.js +2 -1
  155. package/components/QuantityInput/QuantityInput.js +5 -5
  156. package/components/QuantityLabel/QuantityLabel.js +5 -3
  157. package/components/Radio/Radio.js +28 -24
  158. package/components/RadioCard/RadioCard.js +26 -22
  159. package/components/RadioGroup/RadioGroup.js +16 -12
  160. package/components/RangeSlider/components/Handle/index.js +8 -6
  161. package/components/RangeSlider/index.js +108 -114
  162. package/components/RangeSlider/spec.js +9 -6
  163. package/components/ScrollHeader/index.js +5 -3
  164. package/components/SheetDrawer/index.js +4 -3
  165. package/components/SheetList/components/Item/index.js +67 -47
  166. package/components/SheetList/components/Item/spec.js +18 -13
  167. package/components/SheetList/index.js +40 -30
  168. package/components/SheetList/spec.js +20 -14
  169. package/components/SheetList/style.js +1 -1
  170. package/components/SideNavigation/SideNavigation.js +7 -5
  171. package/components/SideNavigation/SideNavigationCategories.js +14 -11
  172. package/components/SideNavigation/SideNavigationCategoriesItem.js +17 -13
  173. package/components/SideNavigation/SideNavigationCategoriesItemChildren.js +7 -5
  174. package/components/SideNavigation/SideNavigationContent.js +13 -8
  175. package/components/SideNavigation/SideNavigationItem.js +24 -19
  176. package/components/SideNavigation/SideNavigationLinks.js +36 -30
  177. package/components/SideNavigation/SideNavigationLinksLegal.js +4 -5
  178. package/components/SideNavigation/SideNavigationLinksQuicklinks.js +3 -3
  179. package/components/SideNavigation/SideNavigationNestedItem.js +11 -8
  180. package/components/SideNavigation/SideNavigationProvider.js +5 -3
  181. package/components/SnackBarContainer/index.js +9 -2
  182. package/components/Switch/index.js +20 -14
  183. package/components/Tabs/TabContext.js +5 -3
  184. package/components/Tabs/components/Tab.js +8 -5
  185. package/components/Tabs/components/TabIndicator.js +5 -4
  186. package/components/Tabs/components/TabPanel.js +5 -3
  187. package/components/Tabs/components/Tabs.js +15 -11
  188. package/components/Tabs/useEventCallback.js +1 -1
  189. package/components/TextLink/TextLink.js +4 -3
  190. package/components/TimeBoundary/index.js +31 -22
  191. package/components/TimeBoundary/spec.js +13 -9
  192. package/components/Toggle/index.js +21 -18
  193. package/components/Typography/Typography.js +5 -5
  194. package/components/VideoPlayer/index.js +45 -35
  195. package/components/View/components/Above/index.js +17 -14
  196. package/components/View/components/Below/index.js +17 -14
  197. package/components/View/components/Content/components/ParallaxProvider/index.js +8 -5
  198. package/components/View/components/Content/index.js +102 -83
  199. package/components/View/index.js +28 -19
  200. package/components/View/provider.js +61 -50
  201. package/core/classes/GeolocationRequest.js +9 -7
  202. package/core/classes/GeolocationRequestApp.js +7 -5
  203. package/core/classes/GeolocationRequestBrowser.js +7 -4
  204. package/core/collections/AppInitialization.js +11 -10
  205. package/core/config/ThemeConfigResolver.js +21 -19
  206. package/core/helpers/errorBehavior.js +4 -4
  207. package/core/hocs/withApp.js +7 -4
  208. package/core/hocs/withCurrentProduct.js +5 -2
  209. package/core/hocs/withForwardedRef.js +5 -2
  210. package/core/hocs/withNavigation.js +5 -2
  211. package/core/hocs/withRoute.js +7 -2
  212. package/core/hocs/withTheme.js +13 -8
  213. package/core/hocs/withThemeResources.js +10 -7
  214. package/core/hocs/withWidgetSettings.js +5 -4
  215. package/core/hocs/withWidgetStyles.js +5 -4
  216. package/core/hooks/events/appEvents.d.ts +83 -0
  217. package/core/hooks/events/appEvents.js +125 -0
  218. package/core/hooks/events/index.js +1 -0
  219. package/core/hooks/index.js +1 -0
  220. package/core/hooks/useLocalStorage.d.ts +8 -0
  221. package/core/hooks/useLocalStorage.js +38 -0
  222. package/core/providers/AppProvider.js +38 -27
  223. package/core/providers/ThemeResourcesProvider.js +8 -5
  224. package/development/components/ClientInformation/ClientInformation.js +18 -13
  225. package/development/components/DevelopmentSettings/DevelopmentSettings.js +18 -14
  226. package/development/components/DevelopmentTools/DevelopmentTools.js +6 -1
  227. package/development/components/SimulatedInsets/SimulatedInsetBottom.js +9 -8
  228. package/development/components/SimulatedInsets/SimulatedInsetTop.js +15 -12
  229. package/development/components/SimulatedInsets/SimulatedInsets.js +12 -8
  230. package/favorites/components/CommentDialog/CommentDialog.js +29 -27
  231. package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +5 -3
  232. package/favorites/components/Item/Item.js +120 -100
  233. package/favorites/components/Item/ItemCharacteristics.js +10 -7
  234. package/favorites/components/Item/ItemNotes.js +33 -22
  235. package/favorites/components/Item/ItemQuantity.js +14 -12
  236. package/favorites/components/ItemFulfillmentMethod/ItemFulfillmentMethod.js +16 -12
  237. package/favorites/components/List/List.js +32 -27
  238. package/favorites/components/List/ListAccordionHeader.js +14 -8
  239. package/favorites/components/List/ListAccordionLabel.js +5 -3
  240. package/favorites/components/List/ListContent.js +45 -40
  241. package/favorites/components/List/ListItemWrapper.js +22 -19
  242. package/favorites/components/ListChooser/ListChooser.js +17 -14
  243. package/favorites/components/ListChooser/ListChooserItem.js +13 -9
  244. package/favorites/components/Lists/Lists.js +39 -35
  245. package/favorites/components/Lists/ListsModal.js +29 -19
  246. package/favorites/components/RemoveButton/RemoveButton.js +8 -5
  247. package/filter/components/FilterItem/index.js +5 -3
  248. package/filter/components/FilterItem/spec.js +6 -1
  249. package/filter/components/FilterPageContent/components/ApplyButton/index.js +21 -17
  250. package/filter/components/FilterPageContent/components/ApplyButton/spec.js +8 -7
  251. package/filter/components/FilterPageContent/components/ResetButton/index.js +17 -13
  252. package/filter/components/FilterPageContent/components/ResetButton/spec.js +4 -3
  253. package/filter/components/FilterPageContent/components/Selector/components/Selected/index.js +25 -13
  254. package/filter/components/FilterPageContent/components/Selector/components/Selected/spec.js +3 -2
  255. package/filter/components/FilterPageContent/components/Selector/components/Toggle/index.js +38 -24
  256. package/filter/components/FilterPageContent/components/Selector/components/Toggle/spec.js +5 -4
  257. package/filter/components/FilterPageContent/components/Selector/components/ValueButton/index.js +31 -19
  258. package/filter/components/FilterPageContent/components/Selector/components/ValueButton/spec.js +4 -3
  259. package/filter/components/FilterPageContent/components/Selector/index.js +58 -43
  260. package/filter/components/FilterPageContent/components/Selector/spec.js +2 -1
  261. package/filter/components/FilterPageContent/index.js +44 -42
  262. package/filter/components/FilterPageContentWithProvider/index.js +7 -5
  263. package/filter/components/PriceSlider/components/Label/index.js +80 -71
  264. package/filter/components/PriceSlider/components/Label/spec.js +2 -1
  265. package/filter/components/PriceSlider/index.js +39 -29
  266. package/filter/components/PriceSlider/spec.js +3 -2
  267. package/filter/hocs/withSort.js +7 -2
  268. package/filter/providers/FilterPageProvider.js +6 -4
  269. package/filter/providers/SortProvider.js +5 -3
  270. package/locations/components/Cart/CartChangeFulfillmentMethod.js +5 -4
  271. package/locations/components/Cart/CartContextMenuChangeFulfillment.js +5 -1
  272. package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +10 -8
  273. package/locations/components/Cart/CartContextMenuItemChangeFulfillment.js +7 -5
  274. package/locations/components/Cart/CartContextMenuItemChangeLocation.js +7 -5
  275. package/locations/components/Cart/CartItemProductChangeLocation.js +2 -1
  276. package/locations/components/ChangeLocationButton/ChangeLocationButton.js +15 -12
  277. package/locations/components/FulfillmentPath/FulfillmentPath.js +38 -34
  278. package/locations/components/FulfillmentPath/FulfillmentPathItem.js +10 -6
  279. package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.js +13 -9
  280. package/locations/components/FulfillmentSelector/FulfillmentSelector.js +33 -26
  281. package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +44 -34
  282. package/locations/components/FulfillmentSelector/FulfillmentSelectorBOPIS.js +5 -3
  283. package/locations/components/FulfillmentSelector/FulfillmentSelectorDirectShip.js +25 -17
  284. package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.js +8 -3
  285. package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.js +2 -1
  286. package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.js +29 -20
  287. package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.js +75 -57
  288. package/locations/components/FulfillmentSelector/FulfillmentSelectorLocationMethodNotAvailable.js +2 -1
  289. package/locations/components/FulfillmentSelector/FulfillmentSelectorROPIS.js +5 -3
  290. package/locations/components/FulfillmentSheet/FulfillmentSheet.js +7 -3
  291. package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +8 -5
  292. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +53 -42
  293. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.js +2 -2
  294. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +12 -10
  295. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +23 -17
  296. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +22 -15
  297. package/locations/components/GlobalLocationSelector/GlobalLocationSelector.js +2 -1
  298. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.js +23 -20
  299. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +27 -20
  300. package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +22 -15
  301. package/locations/components/ReservationResponses/ReservationError.js +11 -7
  302. package/locations/components/ReservationResponses/ReservationSuccess.js +17 -11
  303. package/locations/components/ReserveForm/ReserveForm.js +99 -89
  304. package/locations/components/ReserveForm/ReserveFormPhone.js +21 -19
  305. package/locations/components/StockInfo/StockInfo.js +15 -12
  306. package/locations/components/StockInfo/StockInfoInventory.js +2 -1
  307. package/locations/components/StockInfoLists/index.js +24 -19
  308. package/locations/components/StoreDetails/components/FindMoreStores.js +37 -29
  309. package/locations/components/StoreDetails/components/GetDirectionsButton.js +13 -9
  310. package/locations/components/StoreDetails/components/StoreDetails.js +106 -67
  311. package/locations/components/StoreDetails/components/StoreFinderMap.js +23 -21
  312. package/locations/components/StoreDetails/components/StoreLocationMap.js +11 -7
  313. package/locations/components/StoreDetails/components/StoresNearby.js +16 -8
  314. package/locations/components/StoreDetails/components/StoresNearbyListItem.js +63 -47
  315. package/locations/components/StoreDetails/index.js +7 -3
  316. package/locations/components/StoreFinder/StoreFinder.js +16 -11
  317. package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +9 -6
  318. package/locations/components/StoreFinder/StoreFinderLocation.js +5 -3
  319. package/locations/components/StoreFinder/StoreFinderLocationDetails.js +11 -8
  320. package/locations/components/StoreFinder/StoreFinderLocationHeader.js +45 -32
  321. package/locations/components/StoreFinder/StoreFinderLocationHeaderPhoneNumber.js +12 -8
  322. package/locations/components/StoreFinder/StoreFinderLocations.js +14 -10
  323. package/locations/components/StoreFinder/StoreFinderSearch.js +7 -5
  324. package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +10 -7
  325. package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +10 -7
  326. package/locations/components/StoreList/StoreAddress.js +33 -21
  327. package/locations/components/StoreList/StoreAddressShort.js +31 -21
  328. package/locations/components/StoreList/StoreCard.js +4 -1
  329. package/locations/components/StoreList/StoreDetails.js +13 -11
  330. package/locations/components/StoreList/StoreDetailsLine.js +17 -13
  331. package/locations/components/StoreList/StoreDistance.js +5 -3
  332. package/locations/components/StoreList/StoreHeader.js +46 -33
  333. package/locations/components/StoreList/StoreHoursToday.js +7 -5
  334. package/locations/components/StoreList/StoreList.js +4 -1
  335. package/locations/components/StoreList/StoreListLocations.js +18 -13
  336. package/locations/components/StoreList/StoreListProduct.js +20 -14
  337. package/locations/components/StoreList/StoreListProductInfo.js +17 -13
  338. package/locations/components/StoreList/StoreListProductName.js +11 -7
  339. package/locations/components/StoreList/StoreListSearch.js +66 -55
  340. package/locations/components/StoreList/StoreListSearchRadius.js +19 -16
  341. package/locations/components/StoreList/StoreOpeningHours.js +19 -13
  342. package/locations/components/StoreList/StoreOpeningHoursLine.js +12 -8
  343. package/locations/components/StoreList/StorePhoneNumber.js +17 -13
  344. package/locations/components/StoreList/StoreSelectLocationButton.js +10 -7
  345. package/locations/providers/FulfillmentProvider.connector.js +6 -6
  346. package/locations/providers/FulfillmentProvider.js +24 -23
  347. package/locations/providers/StoreDetailsProvider.js +5 -3
  348. package/locations/providers/StoreFinderProvider.js +5 -3
  349. package/login/components/ForgotPassword/ForgotPassword.js +64 -50
  350. package/orders/components/OrderDetails/OrderDetails.js +9 -6
  351. package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +63 -47
  352. package/orders/components/OrderDetails/OrderDetailsContent.js +9 -5
  353. package/orders/components/OrderDetails/OrderDetailsOrder.js +44 -39
  354. package/orders/components/OrderDetails/OrderDetailsOrderHeader.js +39 -31
  355. package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.js +2 -1
  356. package/orders/components/OrderHistory/OrderHistory.js +27 -22
  357. package/orders/components/OrderHistory/OrderHistoryList.js +47 -35
  358. package/orders/components/OrderHistory/OrderHistoryLoader.js +19 -16
  359. package/orders/components/OrderHistory/OrderHistoryTable.js +57 -34
  360. package/orders/providers/OrderDetailsPrivateProvider.js +5 -3
  361. package/orders/providers/OrderDetailsProvider.js +6 -4
  362. package/orders/providers/OrderHistoryProvider.js +5 -3
  363. package/orders/reducers/orders.js +1 -1
  364. package/package.json +10 -10
  365. package/page/components/NotFound.js +28 -23
  366. package/page/components/ResponsiveWidgetImage/ResponsiveWidgetImage.js +48 -27
  367. package/page/components/WidgetHeadline/WidgetHeadline.js +6 -4
  368. package/page/components/WidgetRichText/WidgetRichText.js +5 -3
  369. package/page/components/WidgetVideo/WidgetVideo.js +159 -0
  370. package/page/components/WidgetVideo/index.js +1 -0
  371. package/page/components/Widgets/Overlay.js +12 -12
  372. package/page/components/Widgets/Tooltip.js +13 -11
  373. package/page/components/Widgets/Widget.js +34 -25
  374. package/page/components/Widgets/WidgetProvider.js +5 -3
  375. package/page/components/Widgets/Widgets.js +22 -19
  376. package/page/components/Widgets/WidgetsPreviewProvider.js +5 -3
  377. package/page/hooks/index.js +7 -14
  378. package/page/selectors/index.js +7 -24
  379. package/page/widgets/Button/Button.js +13 -9
  380. package/page/widgets/CategoryList/CategoryList.js +11 -8
  381. package/page/widgets/CategoryList/hooks.js +1 -1
  382. package/page/widgets/HTML/HTML.js +5 -3
  383. package/page/widgets/Headline/Headline.js +2 -1
  384. package/page/widgets/HeroBanner/HeroBanner.js +51 -23
  385. package/page/widgets/HeroBanner/hooks.js +19 -4
  386. package/page/widgets/Image/Image.js +14 -11
  387. package/page/widgets/ImageRow/ImageRow.js +53 -28
  388. package/page/widgets/ImageRow/hooks.js +14 -2
  389. package/page/widgets/ImageSlider/ImageSlider.js +27 -22
  390. package/page/widgets/NestedCategoryFilter/NestedCategoryFilter.js +164 -0
  391. package/page/widgets/NestedCategoryFilter/components/Picker/components/Sheet/index.js +59 -0
  392. package/page/widgets/NestedCategoryFilter/components/Picker/components/SheetItem/index.js +60 -0
  393. package/page/widgets/NestedCategoryFilter/components/Picker/index.js +124 -0
  394. package/page/widgets/NestedCategoryFilter/hooks.js +35 -0
  395. package/page/widgets/NestedCategoryFilter/index.js +1 -0
  396. package/page/widgets/Placeholder/Placeholder.js +16 -12
  397. package/page/widgets/ProductList/ProductList.js +34 -18
  398. package/page/widgets/ProductList/hooks.js +4 -2
  399. package/page/widgets/ProductSlider/ProductSlider.js +27 -23
  400. package/page/widgets/RichText/RichText.js +2 -1
  401. package/page/widgets/Video/Video.js +14 -55
  402. package/page/widgets/Video/hooks.js +6 -2
  403. package/page/widgets/index.js +2 -1
  404. package/page/widgets/widgets.json +3 -0
  405. package/product/components/Availability/Availability.js +14 -11
  406. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +104 -84
  407. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +41 -27
  408. package/product/components/Characteristics/Characteristic/index.js +83 -64
  409. package/product/components/Characteristics/Swatch/index.js +54 -38
  410. package/product/components/Characteristics/index.js +36 -20
  411. package/product/components/Description/index.js +27 -20
  412. package/product/components/EffectivityDates/index.js +42 -37
  413. package/product/components/FilterBar/FilterBarProvider.js +5 -3
  414. package/product/components/FilterBar/components/Content/components/FilterButton/index.js +24 -17
  415. package/product/components/FilterBar/components/Content/components/FilterChips/index.js +24 -19
  416. package/product/components/FilterBar/components/Content/components/Sort/components/Item/index.js +5 -3
  417. package/product/components/FilterBar/components/Content/components/Sort/index.js +14 -12
  418. package/product/components/FilterBar/components/Content/index.js +15 -11
  419. package/product/components/FilterBar/components/Content/spec.js +7 -6
  420. package/product/components/FilterBar/components/FilterModal/FilterModal.js +21 -16
  421. package/product/components/FilterBar/components/FilterModal/FilterModalContent.js +12 -9
  422. package/product/components/FilterBar/components/FilterModal/FilterModalTitle.js +22 -16
  423. package/product/components/FilterBar/index.js +16 -10
  424. package/product/components/Header/PriceStriked/index.js +32 -23
  425. package/product/components/Header/Shipping/components/Label/index.js +14 -11
  426. package/product/components/Header/Shipping/index.js +19 -14
  427. package/product/components/Header/Shipping/spec.js +7 -5
  428. package/product/components/Header/Tiers/components/Tier/index.js +10 -9
  429. package/product/components/Header/Tiers/components/Tier/spec.js +3 -2
  430. package/product/components/Header/Tiers/index.js +17 -13
  431. package/product/components/Header/Tiers/spec.js +6 -5
  432. package/product/components/MapPriceHint/index.js +14 -11
  433. package/product/components/Media/FeaturedMedia.js +8 -6
  434. package/product/components/Media/MediaImage.js +19 -16
  435. package/product/components/Media/MediaPlaceholder.js +11 -8
  436. package/product/components/MediaSlider/components/MediaImage/index.js +9 -7
  437. package/product/components/MediaSlider/components/MediaVideo/index.js +24 -19
  438. package/product/components/MediaSlider/index.js +29 -23
  439. package/product/components/Options/components/Content/index.js +52 -44
  440. package/product/components/Options/components/Content/spec.js +3 -2
  441. package/product/components/Options/components/Option/index.js +23 -20
  442. package/product/components/Options/components/TextOption/components/OptionInfo/index.js +31 -24
  443. package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +4 -3
  444. package/product/components/Options/components/TextOption/index.js +84 -69
  445. package/product/components/Options/index.js +17 -13
  446. package/product/components/OrderQuantityHint/index.js +29 -24
  447. package/product/components/PriceDifference/index.js +2 -1
  448. package/product/components/PriceInfo/PriceInfo.js +13 -11
  449. package/product/components/ProductBadges/index.js +9 -6
  450. package/product/components/ProductCard/index.js +54 -47
  451. package/product/components/ProductCharacteristics/index.js +65 -57
  452. package/product/components/ProductDiscountBadge/index.js +18 -14
  453. package/product/components/ProductDiscountBadge/spec.js +7 -5
  454. package/product/components/ProductFilters/index.js +25 -21
  455. package/product/components/ProductGrid/components/Item/components/ItemDetails/index.js +29 -25
  456. package/product/components/ProductGrid/components/Item/components/ItemDetails/spec.js +10 -5
  457. package/product/components/ProductGrid/components/Item/components/ItemDiscount/index.js +11 -8
  458. package/product/components/ProductGrid/components/Item/components/ItemFavoritesButton/index.js +14 -11
  459. package/product/components/ProductGrid/components/Item/components/ItemFavoritesButton/spec.js +14 -11
  460. package/product/components/ProductGrid/components/Item/components/ItemImage/index.js +10 -8
  461. package/product/components/ProductGrid/components/Item/components/ItemImage/spec.js +2 -1
  462. package/product/components/ProductGrid/components/Item/components/ItemName/index.js +11 -8
  463. package/product/components/ProductGrid/components/Item/components/ItemName/spec.js +4 -1
  464. package/product/components/ProductGrid/components/Item/components/ItemPrice/index.js +7 -5
  465. package/product/components/ProductGrid/components/Item/components/ItemPrice/spec.js +7 -4
  466. package/product/components/ProductGrid/components/Item/index.js +36 -31
  467. package/product/components/ProductGrid/components/Iterator/index.js +15 -12
  468. package/product/components/ProductGrid/components/Layout/index.js +5 -3
  469. package/product/components/ProductGrid/index.js +34 -30
  470. package/product/components/ProductGrid/spec.js +3 -2
  471. package/product/components/ProductGridPrice/index.js +37 -24
  472. package/product/components/ProductImage/ProductImagePlaceholder.js +7 -5
  473. package/product/components/ProductImage/index.js +57 -45
  474. package/product/components/ProductImage/spec.js +9 -8
  475. package/product/components/ProductList/components/Item/index.js +172 -152
  476. package/product/components/ProductList/components/Iterator/index.js +27 -24
  477. package/product/components/ProductList/components/Layout/index.js +5 -3
  478. package/product/components/ProductList/index.js +33 -27
  479. package/product/components/ProductName/ProductName.js +19 -15
  480. package/product/components/ProductName/ProductNameContent.js +14 -9
  481. package/product/components/ProductProperties/Content.js +12 -8
  482. package/product/components/ProductProperties/Group.js +12 -8
  483. package/product/components/ProductProperties/GroupedProperties.js +18 -15
  484. package/product/components/ProductProperties/Lists.js +12 -9
  485. package/product/components/ProductProperties/ListsHTML.js +11 -9
  486. package/product/components/ProductProperties/ProductProperties.js +7 -5
  487. package/product/components/ProductProperties/Row.js +22 -18
  488. package/product/components/ProductProperties/RowHTML.js +14 -10
  489. package/product/components/ProductProperties/Rows.js +5 -6
  490. package/product/components/ProductProperties/Wrapper.js +9 -3
  491. package/product/components/ProductSlider/index.js +28 -23
  492. package/product/components/ProductSlider/spec.js +5 -2
  493. package/product/components/ProductVariants/VariantAvailability.js +9 -7
  494. package/product/components/QuantityPicker/index.js +11 -8
  495. package/product/components/Rating/index.js +16 -13
  496. package/product/components/Rating/spec.js +7 -5
  497. package/product/components/RelationsSlider/RelationsSheet.js +22 -16
  498. package/product/components/RelationsSlider/RelationsSlider.js +2 -1
  499. package/product/components/RelationsSlider/RelationsSliderContent.js +30 -25
  500. package/product/components/Swatch/Swatch.js +2 -1
  501. package/product/components/Swatch/SwatchContent.js +25 -23
  502. package/product/components/Swatch/VariantSwatch.js +2 -1
  503. package/product/components/Swatches/Swatches.js +10 -8
  504. package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +2 -1
  505. package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +32 -24
  506. package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +70 -62
  507. package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +17 -14
  508. package/product/hocs/withMapPricing.js +30 -18
  509. package/product/hocs/withPriceCalculation.js +7 -2
  510. package/product/hocs/withProductListEntry.js +7 -4
  511. package/product/hocs/withProductListEntryProduct.js +4 -1
  512. package/product/hocs/withProductListType.js +7 -4
  513. package/product/providers/ProductListEntry/index.js +5 -3
  514. package/product/providers/ProductListType/index.js +5 -3
  515. package/product/selectors/helpers/wrapMemoizedSelector.js +2 -2
  516. package/push-opt-in/components/PushOptInModal/index.js +52 -42
  517. package/registration/components/GuestRegistration/GuestRegistration.js +8 -5
  518. package/registration/components/GuestRegistration/GuestRegistrationContent.js +21 -17
  519. package/registration/components/GuestRegistration/GuestRegistrationFormPickup.js +17 -14
  520. package/registration/components/Registration/Registration.js +7 -5
  521. package/registration/components/Registration/RegistrationContent.js +14 -8
  522. package/registration/components/Registration/RegistrationFormActions.js +11 -8
  523. package/registration/components/Registration/RegistrationFormBase.js +12 -10
  524. package/registration/components/Registration/RegistrationFormBilling.js +12 -10
  525. package/registration/components/Registration/RegistrationFormExtra.js +12 -10
  526. package/registration/components/Registration/RegistrationFormShipping.js +12 -10
  527. package/registration/components/Registration/RegistrationFormToggle.js +15 -12
  528. package/registration/providers/GuestRegistrationProvider.actions.js +3 -3
  529. package/registration/providers/GuestRegistrationProvider.js +5 -3
  530. package/registration/providers/RegistrationProvider.actions.js +2 -2
  531. package/registration/providers/RegistrationProvider.js +7 -5
  532. package/reviews/components/Reviews/components/AllReviewsLink/index.js +11 -8
  533. package/reviews/components/Reviews/components/Header/components/AverageRating/index.js +10 -8
  534. package/reviews/components/Reviews/components/Header/components/NoReviews/index.js +16 -11
  535. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +21 -17
  536. package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +12 -9
  537. package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +7 -5
  538. package/reviews/components/Reviews/components/Header/index.js +3 -2
  539. package/reviews/components/Reviews/components/Header/spec.js +7 -3
  540. package/reviews/components/Reviews/components/List/components/Info/components/Author/index.js +2 -1
  541. package/reviews/components/Reviews/components/List/components/Info/components/ReviewDate/index.js +2 -1
  542. package/reviews/components/Reviews/components/List/components/Info/index.js +9 -7
  543. package/reviews/components/Reviews/components/List/components/Rating/index.js +8 -6
  544. package/reviews/components/Reviews/components/List/components/Review/index.js +13 -11
  545. package/reviews/components/Reviews/components/List/components/Text/index.js +5 -3
  546. package/reviews/components/Reviews/components/List/components/Title/index.js +5 -3
  547. package/reviews/components/Reviews/components/List/index.js +34 -24
  548. package/reviews/components/Reviews/components/List/spec.js +2 -1
  549. package/reviews/components/Reviews/components/RatingCount/index.js +2 -1
  550. package/reviews/components/Reviews/components/RatingCount/spec.js +3 -2
  551. package/reviews/components/Reviews/components/ReviewsInfo/index.js +11 -6
  552. package/reviews/components/Reviews/index.js +16 -13
  553. package/reviews/components/Reviews/spec.js +8 -6
  554. package/styles/theme/createTheme/createBreakpoints.js +1 -1
  555. package/styles/theme/hooks/useResponsiveValue.js +1 -1
  556. package/styles/theme/providers/ActiveBreakpointProvider.js +6 -4
  557. package/styles/theme/providers/ThemeProvider.js +7 -3
  558. package/tracking/components/CookieConsentModal/index.js +83 -66
  559. package/tracking/components/PrivacySettings/index.js +104 -78
@@ -0,0 +1,164 @@
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { I18n, ButtonLink } from '@shopgate/engage/components';
3
+ import { bin2hex } from '@shopgate/engage/core/helpers';
4
+ import { CATEGORY_PATH } from '@shopgate/engage/category';
5
+ import { makeStyles } from '@shopgate/engage/styles';
6
+ import { themeConfig } from '@shopgate/engage';
7
+ import { useRoute, usePrevious, useLocalStorage } from '@shopgate/engage/core/hooks';
8
+ import { router } from '@virtuous/conductor';
9
+ import CategoryPicker from "./components/Picker";
10
+ import { useNestedCategoryFilterWidget } from "./hooks";
11
+ import WidgetHeadline from "../../components/WidgetHeadline";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ const {
14
+ colors,
15
+ variables
16
+ } = themeConfig;
17
+ const useStyles = makeStyles()({
18
+ container: {
19
+ background: colors.light,
20
+ display: 'flex',
21
+ flexDirection: 'column',
22
+ paddingBottom: variables.gap.big
23
+ },
24
+ buttonContainer: {
25
+ padding: `0 ${variables.gap.big}px`
26
+ },
27
+ button: {
28
+ width: '100%'
29
+ }
30
+ });
31
+
32
+ /**
33
+ * The NestedCategoryFilter component
34
+ * @returns {JSX.Element}
35
+ */
36
+ const NestedCategoryFilter = () => {
37
+ const {
38
+ classes,
39
+ cx
40
+ } = useStyles();
41
+ const {
42
+ state: routeState,
43
+ id: routeId
44
+ } = useRoute();
45
+ const {
46
+ maxDepth = 3,
47
+ category = '',
48
+ code,
49
+ showHeadline,
50
+ headline,
51
+ rememberSelection,
52
+ ...labels
53
+ } = useNestedCategoryFilterWidget();
54
+ const prevCategory = usePrevious(category);
55
+ const LOCAL_STORAGE_KEY = `nestedCategoryFilterState-${code}`;
56
+ const [localStorageState, setLocalStorageState] = useLocalStorage(LOCAL_STORAGE_KEY);
57
+ const defaultState = useMemo(() => ({
58
+ buttonCategoryId: null,
59
+ pickers: [{
60
+ categoryId: category,
61
+ selectedId: null
62
+ }]
63
+ }), [category]);
64
+ const initialState = useMemo(() => {
65
+ if (rememberSelection && Array.isArray(localStorageState?.pickers) && localStorageState.pickers.length > 0) {
66
+ const [firstPicker] = localStorageState.pickers;
67
+ // Only rehydrate state from local storage if the pickers belong to the current category
68
+ if (firstPicker.categoryId === category) {
69
+ return localStorageState;
70
+ }
71
+ }
72
+ if (routeState[code]) {
73
+ return routeState[code];
74
+ }
75
+ return defaultState;
76
+ }, [category, code, defaultState, localStorageState, rememberSelection, routeState]);
77
+ const [state, setState] = useState(initialState);
78
+ useEffect(() => {
79
+ const stateToPersist = {
80
+ pickers: state.pickers,
81
+ buttonCategoryId: state.buttonCategoryId
82
+ };
83
+ if (rememberSelection) {
84
+ // Store state in local storage when selection should should survive app restarts
85
+ setLocalStorageState(stateToPersist);
86
+ } else {
87
+ // Store state in route otherwise
88
+ router.update(routeId, {
89
+ [code]: stateToPersist
90
+ });
91
+ }
92
+ }, [code, rememberSelection, routeId, setLocalStorageState, state]);
93
+ useEffect(() => {
94
+ if (typeof prevCategory === 'undefined') return;
95
+ if (typeof category === 'undefined') return;
96
+ if (prevCategory !== category) {
97
+ setState(defaultState);
98
+ }
99
+ }, [prevCategory, category, defaultState, rememberSelection, initialState]);
100
+
101
+ /**
102
+ * Handles the selection of a subcategory within a category picker.
103
+ * @param {string} categoryId The categoryId of the picker where a subcategory was selected.
104
+ * @param {Object} subcategory The subcategory entity which was selected.
105
+ */
106
+ const handleSelection = useCallback((categoryId, subcategory) => {
107
+ const {
108
+ id: subcategoryId,
109
+ childrenCount
110
+ } = subcategory;
111
+ const selectedIndex = state.pickers.findIndex(picker => picker.categoryId === categoryId);
112
+
113
+ // Get all pickers up to the selected picker and update its selectedId
114
+ let updatedPickers = state.pickers.slice(0, selectedIndex + 1);
115
+ updatedPickers[updatedPickers.length - 1].selectedId = subcategoryId;
116
+ // Check if a new picker should be added
117
+ const limitReached = updatedPickers?.length === Number(maxDepth);
118
+ const appendNewPicker = !!childrenCount && !limitReached;
119
+ if (appendNewPicker) {
120
+ updatedPickers = updatedPickers.concat([{
121
+ categoryId: subcategoryId,
122
+ selectedId: null
123
+ }]);
124
+ }
125
+ setState({
126
+ pickers: updatedPickers,
127
+ buttonCategoryId: !appendNewPicker ? subcategoryId : null
128
+ });
129
+ }, [maxDepth, state]);
130
+ const categoryPickers = useMemo(() => /*#__PURE__*/_jsx(_Fragment, {
131
+ children: state.pickers.slice(0, maxDepth).map((entry, index) => {
132
+ const {
133
+ categoryId,
134
+ selectedId
135
+ } = entry;
136
+ return /*#__PURE__*/_jsx(CategoryPicker, {
137
+ categoryId: categoryId,
138
+ selectedId: selectedId,
139
+ onSelect: handleSelection,
140
+ label: labels[`level${index + 1}Label`] || ''
141
+ }, `${categoryId}-${code}`);
142
+ })
143
+ }), [code, handleSelection, labels, maxDepth, state.pickers]);
144
+ return /*#__PURE__*/_jsxs("div", {
145
+ className: cx(classes.container, 'widget__nested-category-filter__container'),
146
+ children: [showHeadline && headline ? /*#__PURE__*/_jsx(WidgetHeadline, {
147
+ headline: headline,
148
+ className: "widget__nested-category-filter__headline"
149
+ }) : null, categoryPickers, /*#__PURE__*/_jsx("div", {
150
+ className: cx(classes.buttonContainer, 'widget__nested-category-filter__button-container'),
151
+ children: /*#__PURE__*/_jsx(ButtonLink, {
152
+ className: cx(classes.button, 'widget__nested-category-filter__CTA-button'),
153
+ href: `${CATEGORY_PATH}/${bin2hex(state.buttonCategoryId)}`,
154
+ disabled: !state.buttonCategoryId,
155
+ flat: false,
156
+ children: /*#__PURE__*/_jsx(I18n.Text, {
157
+ string: "common.show_products",
158
+ className: "widget__nested-category-filter__CTA-button__text"
159
+ })
160
+ })
161
+ })]
162
+ });
163
+ };
164
+ export default NestedCategoryFilter;
@@ -0,0 +1,59 @@
1
+ import React, { useCallback } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { SheetDrawer, SheetList } from '@shopgate/engage/components';
4
+ import { makeStyles } from '@shopgate/engage/styles';
5
+ import Item from "../SheetItem";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const useStyles = makeStyles()({
8
+ sheetList: {
9
+ '& li': {
10
+ margin: 0
11
+ }
12
+ }
13
+ });
14
+ /**
15
+ * The CategorySheet component.
16
+ * @param {Object} props The component props.
17
+ * @param {Array} props.items The list of items to display.
18
+ * @param {string} props.label The sheet label.
19
+ * @param {boolean} props.open Whether the sheet is open.
20
+ * @param {Function} props.onClose The close handler.
21
+ * @param {Function} props.onSelect The selection handler.
22
+ * @param {string} props.selectedId The currently selected item id.
23
+ * @return {JSX.Element}
24
+ */
25
+ const CategorySheet = ({
26
+ items,
27
+ label,
28
+ onClose,
29
+ open,
30
+ selectedId,
31
+ onSelect
32
+ }) => {
33
+ const {
34
+ classes
35
+ } = useStyles();
36
+ const handleItemClick = useCallback(event => {
37
+ event.stopPropagation();
38
+ onSelect(event.target.value);
39
+ }, [onSelect]);
40
+ return /*#__PURE__*/_jsx(SheetDrawer, {
41
+ title: label,
42
+ isOpen: open,
43
+ onClose: onClose,
44
+ children: /*#__PURE__*/_jsx(SheetList, {
45
+ className: `widget__nested-category-filter__sheet-list ${classes.sheetList}`,
46
+ children: items.map(item => /*#__PURE__*/_jsx(Item, {
47
+ item: item,
48
+ onClick: handleItemClick,
49
+ isSelected: item.id === selectedId
50
+ }, item.id))
51
+ })
52
+ });
53
+ };
54
+ CategorySheet.defaultProps = {
55
+ onClose: () => {},
56
+ onSelect: () => {},
57
+ selectedId: null
58
+ };
59
+ export default CategorySheet;
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { makeStyles } from '@shopgate/engage/styles';
4
+ import { themeConfig } from '@shopgate/engage';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const {
7
+ colors,
8
+ variables
9
+ } = themeConfig;
10
+ const bgColor = colors.darkGray;
11
+ const boxShadowOffset = variables.gap.bigger;
12
+ const useStyles = makeStyles()({
13
+ button: {
14
+ outline: 0,
15
+ padding: 16,
16
+ textAlign: 'left',
17
+ width: '100%',
18
+ color: 'var(--color-text-high-emphasis)'
19
+ },
20
+ buttonSelected: {
21
+ background: `var(--color-background-accent, ${bgColor})`,
22
+ boxShadow: `-${boxShadowOffset}px 0px 0px var(--color-background-accent, ${bgColor}), ${boxShadowOffset}px 0px 0px var(--color-background-accent,${bgColor})`,
23
+ margin: '-1px 0',
24
+ paddingTop: 17,
25
+ paddingBottom: 17
26
+ }
27
+ });
28
+
29
+ /**
30
+ * The SheetItem component.
31
+ * @param {Object} props The component props.
32
+ * @param {Object} props.item The item data.
33
+ * @param {boolean} props.isSelected Whether the item is selected.
34
+ * @param {Function} props.onClick The click handler.
35
+ * @return {JSX.Element}
36
+ */
37
+ const SheetItem = ({
38
+ item,
39
+ isSelected,
40
+ onClick
41
+ }) => {
42
+ const {
43
+ classes,
44
+ cx
45
+ } = useStyles();
46
+ return /*#__PURE__*/_jsx("button", {
47
+ className: cx(classes.button, {
48
+ [classes.buttonSelected]: isSelected
49
+ }, isSelected ? 'engage__nested-category-filter__sheet-item__selected' : 'engage__nested-category-filter__sheet-item'),
50
+ value: item.id,
51
+ onClick: onClick,
52
+ type: "button",
53
+ children: item.name
54
+ });
55
+ };
56
+ SheetItem.defaultProps = {
57
+ onClick() {},
58
+ isSelected: false
59
+ };
60
+ export default SheetItem;
@@ -0,0 +1,124 @@
1
+ import React, { useCallback, useState, useEffect, useMemo } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { useSelector, useDispatch } from 'react-redux';
4
+ import { fetchCategoryOrRootCategories } from '@shopgate/engage/category';
5
+ import { makeStyles } from '@shopgate/engage/styles';
6
+ import { themeConfig } from '@shopgate/engage';
7
+ import { i18n } from '@shopgate/engage/core/helpers';
8
+ import Sheet from "./components/Sheet";
9
+ import { getCategoriesById } from "../../../CategoryList/selectors";
10
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
+ const {
12
+ colors
13
+ } = themeConfig;
14
+ const useStyles = makeStyles()({
15
+ button: {
16
+ background: `var(--color-background-accent, ${colors.overlay})`,
17
+ color: 'var(--color-text-high-emphasis)',
18
+ display: 'flex',
19
+ flexDirection: 'column',
20
+ justifyContent: 'center',
21
+ minHeight: 56,
22
+ outline: 0,
23
+ padding: '12px 16px',
24
+ marginBottom: 8,
25
+ transition: 'background 250ms ease-in, color 250ms ease-in',
26
+ cursor: 'pointer'
27
+ },
28
+ buttonDisabled: {
29
+ color: colors.shade4,
30
+ cursor: 'not-allowed'
31
+ },
32
+ label: {
33
+ fontSize: 12,
34
+ marginTop: -2,
35
+ marginBottom: 4
36
+ },
37
+ selection: {
38
+ fontWeight: 500,
39
+ lineHeight: 1.125
40
+ }
41
+ });
42
+
43
+ /**
44
+ * The CategoryPicker component.
45
+ * @param {Object} props The component props.
46
+ * @param {Function} props.onSelect The selection handler.
47
+ * @param {string} props.categoryId The categoryId for which to show subcategories.
48
+ * @param {string} props.label The label for the picker.
49
+ * @param {string|null} props.selectedId The currently selected subcategoryId.
50
+ * @return {JSX.Element}
51
+ */
52
+ const CategoryPicker = ({
53
+ onSelect,
54
+ categoryId,
55
+ label,
56
+ selectedId
57
+ }) => {
58
+ const subcategories = useSelector(state => getCategoriesById(state, {
59
+ categoryId
60
+ }));
61
+ const dispatch = useDispatch();
62
+ const {
63
+ classes,
64
+ cx
65
+ } = useStyles();
66
+ const [sheetIsOpen, setSheetIsOpen] = useState(false);
67
+ const hasSubcategories = Array.isArray(subcategories) && subcategories.length > 0;
68
+ const disabled = !hasSubcategories || categoryId === null;
69
+ useEffect(() => {
70
+ if (categoryId !== null && subcategories === null) {
71
+ dispatch(fetchCategoryOrRootCategories(categoryId));
72
+ }
73
+ }, [categoryId, dispatch, subcategories]);
74
+ const buttonLabel = useMemo(() => {
75
+ if (!selectedId) {
76
+ return i18n.text('common.please_choose');
77
+ }
78
+ const subcategory = subcategories?.find(val => val.id === selectedId);
79
+ return subcategory?.name;
80
+ }, [selectedId, subcategories]);
81
+ const closeSheet = useCallback(() => {
82
+ setSheetIsOpen(false);
83
+ }, []);
84
+ const handlePickerClick = useCallback(event => {
85
+ event.preventDefault();
86
+ if (disabled) {
87
+ return;
88
+ }
89
+ setSheetIsOpen(true);
90
+ }, [disabled]);
91
+ const handleSheetSelect = useCallback(subcategoryId => {
92
+ const subcategory = subcategories.find(item => item.id === subcategoryId);
93
+ onSelect(categoryId, subcategory);
94
+ closeSheet();
95
+ }, [categoryId, closeSheet, onSelect, subcategories]);
96
+ return /*#__PURE__*/_jsxs(_Fragment, {
97
+ children: [/*#__PURE__*/_jsxs("div", {
98
+ onClick: handlePickerClick,
99
+ className: cx(classes.button, {
100
+ [classes.buttonDisabled]: disabled
101
+ }, 'widget__nested-category-filter__category-picker'),
102
+ children: [label && /*#__PURE__*/_jsx("div", {
103
+ className: classes.label,
104
+ children: label
105
+ }), /*#__PURE__*/_jsx("div", {
106
+ className: classes.selection,
107
+ children: buttonLabel
108
+ })]
109
+ }), /*#__PURE__*/_jsx(Sheet, {
110
+ items: subcategories || [],
111
+ onSelect: handleSheetSelect,
112
+ onClose: closeSheet,
113
+ open: sheetIsOpen,
114
+ selectedId: selectedId,
115
+ label: label
116
+ })]
117
+ });
118
+ };
119
+ CategoryPicker.defaultProps = {
120
+ categoryId: null,
121
+ label: '',
122
+ selectedId: null
123
+ };
124
+ export default CategoryPicker;
@@ -0,0 +1,35 @@
1
+ import { useWidget } from '@shopgate/engage/page/hooks';
2
+
3
+ /**
4
+ * @typedef {Object} NestedCategoryFilter
5
+ * @property {number} [maxDepth=3] The maximum depth of categories to display.
6
+ * @property {string} category The category ID.
7
+ * @property {string} level1Label The label for level 1 categories.
8
+ * @property {string} level2Label The label for level 2 categories.
9
+ * @property {string} level3Label The label for level 3 categories.
10
+ * @property {boolean} showHeadline Whether to show the headline.
11
+ * @property {Object} headline The headline data including text and styles.
12
+ * @property {boolean} rememberSelection Whether to remember user selection
13
+ * in order to prefill the widget with the shopper’s last chosen path on future visits .
14
+ */
15
+
16
+ /**
17
+ * @typedef {ReturnType< typeof import('@shopgate/engage/page/hooks')
18
+ * .useWidget<NestedCategoryFilter> >} UseWidgetReturnType
19
+ */
20
+
21
+ // eslint-disable-next-line valid-jsdoc
22
+ /**
23
+ * Hook to access the Nested Category Filter widget configuration and data.
24
+ */
25
+ export const useNestedCategoryFilterWidget = () => {
26
+ /** @type {UseWidgetReturnType} */
27
+ const {
28
+ config = {},
29
+ code
30
+ } = useWidget();
31
+ return {
32
+ ...config,
33
+ code
34
+ };
35
+ };
@@ -0,0 +1 @@
1
+ export { default } from "./NestedCategoryFilter";
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { makeStyles } from '@shopgate/engage/styles';
3
3
  import { usePlaceholderWidget } from "./hooks";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
5
  const useStyles = makeStyles()(theme => ({
5
6
  root: {
6
7
  padding: theme.spacing(2),
@@ -36,17 +37,20 @@ const PlaceholderWidget = () => {
36
37
  layout,
37
38
  visibility
38
39
  } = usePlaceholderWidget();
39
- return /*#__PURE__*/React.createElement("div", {
40
- className: classes.root
41
- }, /*#__PURE__*/React.createElement("div", {
42
- className: classes.name
43
- }, name), /*#__PURE__*/React.createElement("pre", {
44
- className: classes.pre
45
- }, JSON.stringify({
46
- code,
47
- config,
48
- layout,
49
- visibility
50
- }, null, 2)));
40
+ return /*#__PURE__*/_jsxs("div", {
41
+ className: classes.root,
42
+ children: [/*#__PURE__*/_jsx("div", {
43
+ className: classes.name,
44
+ children: name
45
+ }), /*#__PURE__*/_jsx("pre", {
46
+ className: classes.pre,
47
+ children: JSON.stringify({
48
+ code,
49
+ config,
50
+ layout,
51
+ visibility
52
+ }, null, 2)
53
+ })]
54
+ });
51
55
  };
52
56
  export default PlaceholderWidget;
@@ -1,11 +1,12 @@
1
1
  import "core-js/modules/es.regexp.flags.js";
2
- import React from 'react';
2
+ import React, { useCallback } from 'react';
3
3
  import { ActionButton, I18n } from '@shopgate/engage/components';
4
4
  import { ProductGrid } from '@shopgate/engage/product/components';
5
5
  import { useWidgetProducts } from '@shopgate/engage/page/hooks';
6
6
  import { makeStyles } from '@shopgate/engage/styles';
7
7
  import { useProductListWidget } from "./hooks";
8
8
  import WidgetHeadline from "../../components/WidgetHeadline";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const useStyles = makeStyles()({
10
11
  root: {
11
12
  // Prevent that the ActionButton margin messes with the layout of the sibling widgets
@@ -34,7 +35,8 @@ const ProductListWidget = () => {
34
35
  showLoadMore,
35
36
  flags,
36
37
  showHeadline,
37
- headline
38
+ headline,
39
+ isPreview
38
40
  } = useProductListWidget();
39
41
  const {
40
42
  fetchNext,
@@ -47,21 +49,35 @@ const ProductListWidget = () => {
47
49
  limit: productCount,
48
50
  sort
49
51
  });
50
- return /*#__PURE__*/React.createElement("div", {
51
- className: classes.root
52
- }, showHeadline && headline && results.length ? /*#__PURE__*/React.createElement(WidgetHeadline, {
53
- headline: headline
54
- }) : null, /*#__PURE__*/React.createElement(ProductGrid, {
55
- products: results,
56
- flags: flags,
57
- scope: "widgets",
58
- infiniteLoad: false,
59
- className: classes.grid
60
- }), hasNext && showLoadMore && /*#__PURE__*/React.createElement(ActionButton, {
61
- loading: isFetching,
62
- onClick: fetchNext
63
- }, /*#__PURE__*/React.createElement(I18n.Text, {
64
- string: "common.load_more"
65
- })));
52
+ const handleFetchNext = useCallback(e => {
53
+ if (isPreview) {
54
+ // Prevent unintended scroll effects when load more is clicked in preview.
55
+ e.stopPropagation();
56
+ }
57
+ fetchNext();
58
+ }, [fetchNext, isPreview]);
59
+ return /*#__PURE__*/_jsxs("div", {
60
+ className: classes.root,
61
+ children: [showHeadline && headline && results.length ? /*#__PURE__*/_jsx(WidgetHeadline, {
62
+ headline: headline
63
+ }) : null, /*#__PURE__*/_jsx(ProductGrid, {
64
+ products: results,
65
+ flags: flags,
66
+ scope: "widgets",
67
+ infiniteLoad: false,
68
+ className: classes.grid
69
+ }), hasNext && showLoadMore && /*#__PURE__*/_jsx(ActionButton, {
70
+ loading: isFetching,
71
+ onClick: handleFetchNext
72
+ // Disable click delay in preview mode to enable stopping of propagation.
73
+ ,
74
+ ...(isPreview && {
75
+ disableClickDelay: true
76
+ }),
77
+ children: /*#__PURE__*/_jsx(I18n.Text, {
78
+ string: "common.load_more"
79
+ })
80
+ })]
81
+ });
66
82
  };
67
83
  export default ProductListWidget;
@@ -33,7 +33,8 @@ import { getProductSearchParamsFromProductsInputConfig } from '@shopgate/engage/
33
33
  export const useProductListWidget = () => {
34
34
  /** @type {UseWidgetReturnType} */
35
35
  const {
36
- config
36
+ config,
37
+ isPreview
37
38
  } = useWidget();
38
39
  const {
39
40
  products,
@@ -59,6 +60,7 @@ export const useProductListWidget = () => {
59
60
  showLoadMore: loadMoreButton,
60
61
  flags,
61
62
  showHeadline,
62
- headline
63
+ headline,
64
+ isPreview
63
65
  };
64
66
  };
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import React, { useMemo } from 'react';
3
2
  import { ProductSlider } from '@shopgate/engage/product/components';
4
3
  import { useWidgetProducts } from '@shopgate/engage/page/hooks';
@@ -10,6 +9,7 @@ import WidgetHeadline from "../../components/WidgetHeadline";
10
9
  * The ProductSliderWidget is used to display a product slider.
11
10
  * @returns {JSX.Element}
12
11
  */
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  const ProductSliderWidget = () => {
14
14
  const {
15
15
  productsSearchType,
@@ -35,28 +35,32 @@ const ProductSliderWidget = () => {
35
35
  if (!productIds || !productIds.length) {
36
36
  return null;
37
37
  }
38
- return /*#__PURE__*/React.createElement(React.Fragment, null, showHeadline && headline && productIds.length ? /*#__PURE__*/React.createElement(WidgetHeadline, {
39
- headline: headline
40
- }) : null, /*#__PURE__*/React.createElement(ProductSlider, _extends({
41
- productIds: productIds,
42
- scope: "widgets",
43
- productItemProps: productItemProps,
44
- slidesPerView: 2.3
45
- // Improves interaction with the slider in the CMS preview iframe
46
- }, isPreview ? {
47
- touchStartPreventDefault: true
48
- } : {}, {
49
- breakpoints: {
50
- [theme.breakpoints.values.sm]: {
51
- slidesPerView: 3.3
38
+ return /*#__PURE__*/_jsxs(_Fragment, {
39
+ children: [showHeadline && headline && productIds.length ? /*#__PURE__*/_jsx(WidgetHeadline, {
40
+ headline: headline
41
+ }) : null, /*#__PURE__*/_jsx(ProductSlider, {
42
+ productIds: productIds,
43
+ scope: "widgets",
44
+ productItemProps: productItemProps,
45
+ slidesPerView: 2.3
46
+ // Improves interaction with the slider in the CMS preview iframe
47
+ ,
48
+ ...(isPreview ? {
49
+ touchStartPreventDefault: true
50
+ } : {}),
51
+ breakpoints: {
52
+ [theme.breakpoints.values.sm]: {
53
+ slidesPerView: 3.3
54
+ },
55
+ [theme.breakpoints.values.md]: {
56
+ slidesPerView: 4.3
57
+ },
58
+ [theme.breakpoints.values.lg]: {
59
+ slidesPerView: 5.3
60
+ }
52
61
  },
53
- [theme.breakpoints.values.md]: {
54
- slidesPerView: 4.3
55
- },
56
- [theme.breakpoints.values.lg]: {
57
- slidesPerView: 5.3
58
- }
59
- }
60
- }, swiperProps)));
62
+ ...swiperProps
63
+ })]
64
+ });
61
65
  };
62
66
  export default ProductSliderWidget;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { makeStyles } from '@shopgate/engage/styles';
3
3
  import { WidgetRichText } from '@shopgate/engage/page/components';
4
4
  import { useRichTextWidget } from "./hooks";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
5
6
  const useStyles = makeStyles()(theme => ({
6
7
  root: {
7
8
  padding: theme.spacing(1)
@@ -20,7 +21,7 @@ const RichText = () => {
20
21
  classes
21
22
  } = useStyles();
22
23
  if (!richText) return null;
23
- return /*#__PURE__*/React.createElement(WidgetRichText, {
24
+ return /*#__PURE__*/_jsx(WidgetRichText, {
24
25
  content: richText,
25
26
  className: cx(classes.root)
26
27
  });