@rebuy/rebuy-hydrogen 3.0.0-beta.2 → 3.0.0-beta.20

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 (307) hide show
  1. package/README.md +988 -16
  2. package/dist/assets/Close.d.ts +2 -0
  3. package/dist/assets/Close.d.ts.map +1 -0
  4. package/dist/components/AddToCartBtn/AddToCartBtn.d.ts +1 -1
  5. package/dist/components/AddToCartBtn/AddToCartBtn.d.ts.map +1 -1
  6. package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts +1 -1
  7. package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts.map +1 -1
  8. package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts +1 -1
  9. package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts.map +1 -1
  10. package/dist/components/AddToCartBtn/types.d.ts +5 -0
  11. package/dist/components/AddToCartBtn/types.d.ts.map +1 -1
  12. package/dist/components/ProductCard/ProductCard.d.ts +1 -1
  13. package/dist/components/ProductCard/ProductCard.d.ts.map +1 -1
  14. package/dist/components/ProductCard/defaultSettings.d.ts +3 -0
  15. package/dist/components/ProductCard/defaultSettings.d.ts.map +1 -0
  16. package/dist/components/ProductCard/index.d.ts +1 -0
  17. package/dist/components/ProductCard/index.d.ts.map +1 -1
  18. package/dist/components/ProductCard/types.d.ts +46 -0
  19. package/dist/components/ProductCard/types.d.ts.map +1 -1
  20. package/dist/components/ProductCarousel/ProductCarousel.d.ts +3 -0
  21. package/dist/components/ProductCarousel/ProductCarousel.d.ts.map +1 -0
  22. package/dist/components/ProductCarousel/index.d.ts +2 -0
  23. package/dist/components/ProductCarousel/index.d.ts.map +1 -0
  24. package/dist/components/ProductCarousel/types.d.ts +18 -0
  25. package/dist/components/ProductCarousel/types.d.ts.map +1 -0
  26. package/dist/components/ProductPrice/ProductPrice.d.ts +2 -4
  27. package/dist/components/ProductPrice/ProductPrice.d.ts.map +1 -1
  28. package/dist/components/ProductPrice/types.d.ts +23 -0
  29. package/dist/components/ProductPrice/types.d.ts.map +1 -0
  30. package/dist/components/QuantityInput/QuantityInput.d.ts +3 -0
  31. package/dist/components/QuantityInput/QuantityInput.d.ts.map +1 -0
  32. package/dist/components/QuantityInput/index.d.ts +3 -0
  33. package/dist/components/QuantityInput/index.d.ts.map +1 -0
  34. package/dist/components/QuantityInput/types.d.ts +7 -0
  35. package/dist/components/QuantityInput/types.d.ts.map +1 -0
  36. package/dist/components/RebuyLink/RebuyLink.d.ts +3 -0
  37. package/dist/components/RebuyLink/RebuyLink.d.ts.map +1 -0
  38. package/dist/components/RebuyLink/index.d.ts +2 -0
  39. package/dist/components/RebuyLink/index.d.ts.map +1 -0
  40. package/dist/components/RebuyLink/types.d.ts +10 -0
  41. package/dist/components/RebuyLink/types.d.ts.map +1 -0
  42. package/dist/components/Timer/Timer.d.ts +3 -0
  43. package/dist/components/Timer/Timer.d.ts.map +1 -0
  44. package/dist/components/Timer/index.d.ts +3 -0
  45. package/dist/components/Timer/index.d.ts.map +1 -0
  46. package/dist/components/Timer/types.d.ts +20 -0
  47. package/dist/components/Timer/types.d.ts.map +1 -0
  48. package/dist/components/Title/Title.d.ts +1 -1
  49. package/dist/components/Title/Title.d.ts.map +1 -1
  50. package/dist/components/Title/types.d.ts +1 -0
  51. package/dist/components/Title/types.d.ts.map +1 -1
  52. package/dist/components/VariantSelect/VariantSelect.d.ts +1 -1
  53. package/dist/components/VariantSelect/VariantSelect.d.ts.map +1 -1
  54. package/dist/components/VariantSelect/types.d.ts +2 -0
  55. package/dist/components/VariantSelect/types.d.ts.map +1 -1
  56. package/dist/constants/api.d.ts +2 -0
  57. package/dist/constants/api.d.ts.map +1 -0
  58. package/dist/constants/debug.d.ts +28 -0
  59. package/dist/constants/debug.d.ts.map +1 -0
  60. package/dist/context/RebuyConfigContext.d.ts +23 -0
  61. package/dist/context/RebuyConfigContext.d.ts.map +1 -0
  62. package/dist/context/RebuyWidgetContext.d.ts +7 -0
  63. package/dist/context/RebuyWidgetContext.d.ts.map +1 -0
  64. package/dist/hooks/titleLevel.d.ts.map +1 -1
  65. package/dist/hooks/useBFCacheReset.d.ts +7 -0
  66. package/dist/hooks/useBFCacheReset.d.ts.map +1 -0
  67. package/dist/hooks/useBreakpoint.d.ts +5 -0
  68. package/dist/hooks/useBreakpoint.d.ts.map +1 -0
  69. package/dist/hooks/usePopupTrigger.d.ts +3 -0
  70. package/dist/hooks/usePopupTrigger.d.ts.map +1 -0
  71. package/dist/index.css +2680 -99
  72. package/dist/index.css.map +4 -4
  73. package/dist/index.d.ts +9 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +9756 -1461
  76. package/dist/index.js.map +4 -4
  77. package/dist/index.mjs +9768 -1482
  78. package/dist/index.mjs.map +4 -4
  79. package/dist/providers/RebuyHydrogenContextProvider.d.ts +1 -1
  80. package/dist/providers/RebuyHydrogenContextProvider.d.ts.map +1 -1
  81. package/dist/providers/RebuyHydrogenReactContextProvider.d.ts +6 -1
  82. package/dist/providers/RebuyHydrogenReactContextProvider.d.ts.map +1 -1
  83. package/dist/providers/types.d.ts +29 -14
  84. package/dist/providers/types.d.ts.map +1 -1
  85. package/dist/queries/cart.queries.d.ts +4 -4
  86. package/dist/queries/cart.queries.d.ts.map +1 -1
  87. package/dist/smart-cart/RebuySmartCart.d.ts +10 -0
  88. package/dist/smart-cart/RebuySmartCart.d.ts.map +1 -0
  89. package/dist/smart-cart/components/AnnouncementBar/AnnouncementBar.d.ts +10 -0
  90. package/dist/smart-cart/components/AnnouncementBar/AnnouncementBar.d.ts.map +1 -0
  91. package/dist/smart-cart/components/CartItem/CartItem.d.ts +7 -0
  92. package/dist/smart-cart/components/CartItem/CartItem.d.ts.map +1 -0
  93. package/dist/smart-cart/components/CartItemList/CartItemList.d.ts +10 -0
  94. package/dist/smart-cart/components/CartItemList/CartItemList.d.ts.map +1 -0
  95. package/dist/smart-cart/components/CartNoteInput/CartNoteInput.d.ts +10 -0
  96. package/dist/smart-cart/components/CartNoteInput/CartNoteInput.d.ts.map +1 -0
  97. package/dist/smart-cart/components/CartSubtotal/CartSubtotal.d.ts +11 -0
  98. package/dist/smart-cart/components/CartSubtotal/CartSubtotal.d.ts.map +1 -0
  99. package/dist/smart-cart/components/CartTitleBar/CartTitleBar.d.ts +7 -0
  100. package/dist/smart-cart/components/CartTitleBar/CartTitleBar.d.ts.map +1 -0
  101. package/dist/smart-cart/components/CheckoutArea/CheckoutArea.d.ts +10 -0
  102. package/dist/smart-cart/components/CheckoutArea/CheckoutArea.d.ts.map +1 -0
  103. package/dist/smart-cart/components/CrossSell/CrossSell.d.ts +10 -0
  104. package/dist/smart-cart/components/CrossSell/CrossSell.d.ts.map +1 -0
  105. package/dist/smart-cart/components/CustomCode/CustomCodeBlock.d.ts +21 -0
  106. package/dist/smart-cart/components/CustomCode/CustomCodeBlock.d.ts.map +1 -0
  107. package/dist/smart-cart/components/DebugPanel/DebugPanel.d.ts +13 -0
  108. package/dist/smart-cart/components/DebugPanel/DebugPanel.d.ts.map +1 -0
  109. package/dist/smart-cart/components/DebugPanel/index.d.ts +11 -0
  110. package/dist/smart-cart/components/DebugPanel/index.d.ts.map +1 -0
  111. package/dist/smart-cart/components/DiscountCodeInput/DiscountCodeInput.d.ts +10 -0
  112. package/dist/smart-cart/components/DiscountCodeInput/DiscountCodeInput.d.ts.map +1 -0
  113. package/dist/smart-cart/components/EmptyCart/EmptyCart.d.ts +3 -0
  114. package/dist/smart-cart/components/EmptyCart/EmptyCart.d.ts.map +1 -0
  115. package/dist/smart-cart/components/LoginButton/LoginButton.d.ts +3 -0
  116. package/dist/smart-cart/components/LoginButton/LoginButton.d.ts.map +1 -0
  117. package/dist/smart-cart/components/ScreenReaderText/ScreenReaderText.d.ts +8 -0
  118. package/dist/smart-cart/components/ScreenReaderText/ScreenReaderText.d.ts.map +1 -0
  119. package/dist/smart-cart/components/SmartCartApp/SmartCartApp.d.ts +20 -0
  120. package/dist/smart-cart/components/SmartCartApp/SmartCartApp.d.ts.map +1 -0
  121. package/dist/smart-cart/components/SmartCartContainer/SmartCartContainer.d.ts +8 -0
  122. package/dist/smart-cart/components/SmartCartContainer/SmartCartContainer.d.ts.map +1 -0
  123. package/dist/smart-cart/components/TieredProgressBar/Icons.d.ts +5 -0
  124. package/dist/smart-cart/components/TieredProgressBar/Icons.d.ts.map +1 -0
  125. package/dist/smart-cart/components/TieredProgressBar/TPBGiftItem.d.ts +21 -0
  126. package/dist/smart-cart/components/TieredProgressBar/TPBGiftItem.d.ts.map +1 -0
  127. package/dist/smart-cart/components/TieredProgressBar/TieredProgressBar.d.ts +11 -0
  128. package/dist/smart-cart/components/TieredProgressBar/TieredProgressBar.d.ts.map +1 -0
  129. package/dist/smart-cart/components/TieredProgressBar/progressBarUtils.d.ts +173 -0
  130. package/dist/smart-cart/components/TieredProgressBar/progressBarUtils.d.ts.map +1 -0
  131. package/dist/smart-cart/components/TieredProgressBar/types.d.ts +261 -0
  132. package/dist/smart-cart/components/TieredProgressBar/types.d.ts.map +1 -0
  133. package/dist/smart-cart/components/_Layouts/AnchorSlot.d.ts +13 -0
  134. package/dist/smart-cart/components/_Layouts/AnchorSlot.d.ts.map +1 -0
  135. package/dist/smart-cart/components/_Layouts/DoubleColumnLayout.d.ts +9 -0
  136. package/dist/smart-cart/components/_Layouts/DoubleColumnLayout.d.ts.map +1 -0
  137. package/dist/smart-cart/components/_Layouts/SingleColumnLayout.d.ts +8 -0
  138. package/dist/smart-cart/components/_Layouts/SingleColumnLayout.d.ts.map +1 -0
  139. package/dist/smart-cart/components/componentRegistry.d.ts +3 -0
  140. package/dist/smart-cart/components/componentRegistry.d.ts.map +1 -0
  141. package/dist/smart-cart/constants.d.ts +58 -0
  142. package/dist/smart-cart/constants.d.ts.map +1 -0
  143. package/dist/smart-cart/context/SmartCartContext.d.ts +62 -0
  144. package/dist/smart-cart/context/SmartCartContext.d.ts.map +1 -0
  145. package/dist/smart-cart/context/StorefrontCartContext.d.ts +32 -0
  146. package/dist/smart-cart/context/StorefrontCartContext.d.ts.map +1 -0
  147. package/dist/smart-cart/hooks/useCartItemFeatures.d.ts +84 -0
  148. package/dist/smart-cart/hooks/useCartItemFeatures.d.ts.map +1 -0
  149. package/dist/smart-cart/hooks/useDiscountManager.d.ts +28 -0
  150. package/dist/smart-cart/hooks/useDiscountManager.d.ts.map +1 -0
  151. package/dist/smart-cart/hooks/useGeolocation.d.ts +12 -0
  152. package/dist/smart-cart/hooks/useGeolocation.d.ts.map +1 -0
  153. package/dist/smart-cart/hooks/useIsScrolled.d.ts +14 -0
  154. package/dist/smart-cart/hooks/useIsScrolled.d.ts.map +1 -0
  155. package/dist/smart-cart/hooks/useSmartCartApps.d.ts +17 -0
  156. package/dist/smart-cart/hooks/useSmartCartApps.d.ts.map +1 -0
  157. package/dist/smart-cart/store/tieredProgressBarStore.d.ts +76 -0
  158. package/dist/smart-cart/store/tieredProgressBarStore.d.ts.map +1 -0
  159. package/dist/smart-cart/types/rebuy-storefront-cart.d.ts +142 -0
  160. package/dist/smart-cart/types/rebuy-storefront-cart.d.ts.map +1 -0
  161. package/dist/smart-cart/types/rebuy.d.ts +15 -0
  162. package/dist/smart-cart/types/rebuy.d.ts.map +1 -0
  163. package/dist/smart-cart/types/shop.d.ts +26 -0
  164. package/dist/smart-cart/types/shop.d.ts.map +1 -0
  165. package/dist/smart-cart/types/smart-cart-app.d.ts +103 -0
  166. package/dist/smart-cart/types/smart-cart-app.d.ts.map +1 -0
  167. package/dist/smart-cart/types/smart-cart-component.d.ts +1350 -0
  168. package/dist/smart-cart/types/smart-cart-component.d.ts.map +1 -0
  169. package/dist/smart-cart/types/smart-cart.d.ts +82 -0
  170. package/dist/smart-cart/types/smart-cart.d.ts.map +1 -0
  171. package/dist/smart-cart/utils/cartItemUtils.d.ts +292 -0
  172. package/dist/smart-cart/utils/cartItemUtils.d.ts.map +1 -0
  173. package/dist/smart-cart/utils/debugLog.d.ts +77 -0
  174. package/dist/smart-cart/utils/debugLog.d.ts.map +1 -0
  175. package/dist/smart-cart/utils/debugStyles.d.ts +3342 -0
  176. package/dist/smart-cart/utils/debugStyles.d.ts.map +1 -0
  177. package/dist/smart-cart/utils/executeScriptsInContainer.d.ts +14 -0
  178. package/dist/smart-cart/utils/executeScriptsInContainer.d.ts.map +1 -0
  179. package/dist/smart-cart/utils/imageUtils.d.ts +2 -0
  180. package/dist/smart-cart/utils/imageUtils.d.ts.map +1 -0
  181. package/dist/smart-cart/utils/mapHydrogenCartToStorefrontCartData.d.ts +14 -0
  182. package/dist/smart-cart/utils/mapHydrogenCartToStorefrontCartData.d.ts.map +1 -0
  183. package/dist/smart-cart/utils/moneyUtils.d.ts +24 -0
  184. package/dist/smart-cart/utils/moneyUtils.d.ts.map +1 -0
  185. package/dist/smart-cart/utils/safeJsonParse.d.ts +2 -0
  186. package/dist/smart-cart/utils/safeJsonParse.d.ts.map +1 -0
  187. package/dist/types/common.d.ts +16 -0
  188. package/dist/types/common.d.ts.map +1 -1
  189. package/dist/types/rebuyCustom.d.ts +133 -17
  190. package/dist/types/rebuyCustom.d.ts.map +1 -1
  191. package/dist/types/shopify.d.ts +1 -2
  192. package/dist/types/shopify.d.ts.map +1 -1
  193. package/dist/types/widgets.d.ts +20078 -7
  194. package/dist/types/widgets.d.ts.map +1 -1
  195. package/dist/utils/convertToRebuyProduct.d.ts.map +1 -1
  196. package/dist/utils/createContextParameters.d.ts +1 -1
  197. package/dist/utils/createContextParameters.d.ts.map +1 -1
  198. package/dist/utils/filterContextUtils.d.ts +3 -0
  199. package/dist/utils/filterContextUtils.d.ts.map +1 -0
  200. package/dist/utils/getEncodedAttributes.d.ts.map +1 -1
  201. package/dist/utils/getRebuyConfig.d.ts +1 -1
  202. package/dist/utils/getRebuyConfig.d.ts.map +1 -1
  203. package/dist/utils/nonceManager.d.ts +10 -0
  204. package/dist/utils/nonceManager.d.ts.map +1 -0
  205. package/dist/utils/theme.d.ts +20 -0
  206. package/dist/utils/theme.d.ts.map +1 -0
  207. package/dist/widgetContainer/RebuyWidgetContainer.d.ts +1 -1
  208. package/dist/widgetContainer/RebuyWidgetContainer.d.ts.map +1 -1
  209. package/dist/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.d.ts.map +1 -1
  210. package/dist/widgets/RebuyDynamicBundleProducts/BundleImages.d.ts.map +1 -1
  211. package/dist/widgets/RebuyDynamicBundleProducts/BundlePrice.d.ts.map +1 -1
  212. package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts +1 -1
  213. package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts.map +1 -1
  214. package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts.map +1 -1
  215. package/dist/widgets/RebuyDynamicBundleProducts/Select.d.ts.map +1 -1
  216. package/dist/widgets/RebuyGiftWithPurchase/RebuyGiftWithPurchase.d.ts +11 -0
  217. package/dist/widgets/RebuyGiftWithPurchase/RebuyGiftWithPurchase.d.ts.map +1 -0
  218. package/dist/widgets/RebuyGiftWithPurchase/index.d.ts +3 -0
  219. package/dist/widgets/RebuyGiftWithPurchase/index.d.ts.map +1 -0
  220. package/dist/widgets/RebuyGiftWithPurchase/store/giftWithPurchaseStore.d.ts +31 -0
  221. package/dist/widgets/RebuyGiftWithPurchase/store/giftWithPurchaseStore.d.ts.map +1 -0
  222. package/dist/widgets/RebuyGiftWithPurchase/types.d.ts +12 -0
  223. package/dist/widgets/RebuyGiftWithPurchase/types.d.ts.map +1 -0
  224. package/dist/widgets/RebuyGiftWithPurchase/utils.d.ts +35 -0
  225. package/dist/widgets/RebuyGiftWithPurchase/utils.d.ts.map +1 -0
  226. package/dist/widgets/RebuyProductAddOns/RebuyProductAddOnCard.d.ts.map +1 -1
  227. package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts.map +1 -1
  228. package/dist/widgets/RebuyProductAddOns/types.d.ts.map +1 -1
  229. package/dist/widgets/RebuyProductRecommendations/RebuyProductRecommendations.d.ts.map +1 -1
  230. package/dist/widgets/RebuyProductViewed/RebuyProductViewed.d.ts +3 -0
  231. package/dist/widgets/RebuyProductViewed/RebuyProductViewed.d.ts.map +1 -0
  232. package/dist/widgets/RebuyProductViewed/index.d.ts +2 -0
  233. package/dist/widgets/RebuyProductViewed/index.d.ts.map +1 -0
  234. package/dist/widgets/RebuyProductViewed/types.d.ts +8 -0
  235. package/dist/widgets/RebuyProductViewed/types.d.ts.map +1 -0
  236. package/dist/widgets/RebuyRecentlyViewedProducts/RebuyRecentlyViewedProducts.d.ts +3 -0
  237. package/dist/widgets/RebuyRecentlyViewedProducts/RebuyRecentlyViewedProducts.d.ts.map +1 -0
  238. package/dist/widgets/RebuyRecentlyViewedProducts/index.d.ts +2 -0
  239. package/dist/widgets/RebuyRecentlyViewedProducts/index.d.ts.map +1 -0
  240. package/dist/widgets/RebuyRecentlyViewedProducts/types.d.ts +11 -0
  241. package/dist/widgets/RebuyRecentlyViewedProducts/types.d.ts.map +1 -0
  242. package/dist/widgets/RebuyWidget/RebuyWidget.d.ts +3 -0
  243. package/dist/widgets/RebuyWidget/RebuyWidget.d.ts.map +1 -0
  244. package/dist/widgets/RebuyWidget/WidgetContent.d.ts +3 -0
  245. package/dist/widgets/RebuyWidget/WidgetContent.d.ts.map +1 -0
  246. package/dist/widgets/RebuyWidget/index.d.ts +2 -0
  247. package/dist/widgets/RebuyWidget/index.d.ts.map +1 -0
  248. package/dist/widgets/RebuyWidget/types.d.ts +28 -0
  249. package/dist/widgets/RebuyWidget/types.d.ts.map +1 -0
  250. package/dist/zustandStores/productViewed.d.ts +9 -0
  251. package/dist/zustandStores/productViewed.d.ts.map +1 -0
  252. package/package.json +57 -41
  253. package/dist/types/rebuySmartCart.d.ts +0 -184
  254. package/dist/types/rebuySmartCart.d.ts.map +0 -1
  255. package/src/components/AddToCartBtn/AddToCartBtn.tsx +0 -45
  256. package/src/components/AddToCartBtn/HydrogenAddToCartBtn.tsx +0 -43
  257. package/src/components/AddToCartBtn/HydrogenReactAddToCartBtn.tsx +0 -35
  258. package/src/components/AddToCartBtn/index.ts +0 -1
  259. package/src/components/AddToCartBtn/types.ts +0 -27
  260. package/src/components/ProductCard/ProductCard.tsx +0 -70
  261. package/src/components/ProductCard/index.ts +0 -1
  262. package/src/components/ProductCard/types.ts +0 -10
  263. package/src/components/ProductPrice/ProductPrice.tsx +0 -49
  264. package/src/components/ProductPrice/index.ts +0 -1
  265. package/src/components/Title/Title.tsx +0 -19
  266. package/src/components/Title/index.ts +0 -1
  267. package/src/components/Title/types.ts +0 -7
  268. package/src/components/VariantSelect/VariantSelect.tsx +0 -45
  269. package/src/components/VariantSelect/index.ts +0 -1
  270. package/src/components/VariantSelect/types.ts +0 -6
  271. package/src/context/RebuyContext.tsx +0 -9
  272. package/src/hooks/titleLevel.tsx +0 -42
  273. package/src/index.ts +0 -7
  274. package/src/providers/RebuyHydrogenContextProvider.tsx +0 -112
  275. package/src/providers/RebuyHydrogenReactContextProvider.tsx +0 -192
  276. package/src/providers/types.ts +0 -58
  277. package/src/queries/cart.queries.ts +0 -467
  278. package/src/types/common.ts +0 -8
  279. package/src/types/css.d.ts +0 -11
  280. package/src/types/env.d.ts +0 -12
  281. package/src/types/rebuy.d.ts +0 -31
  282. package/src/types/rebuyCustom.ts +0 -263
  283. package/src/types/rebuySmartCart.ts +0 -188
  284. package/src/types/shopify.ts +0 -142
  285. package/src/types/widgets.ts +0 -29
  286. package/src/utils/convertToRebuyProduct.tsx +0 -319
  287. package/src/utils/createContextParameters.ts +0 -142
  288. package/src/utils/getEncodedAttributes.ts +0 -11
  289. package/src/utils/getRebuyConfig.ts +0 -31
  290. package/src/widgetContainer/RebuyWidgetContainer.tsx +0 -183
  291. package/src/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.tsx +0 -50
  292. package/src/widgets/RebuyCompleteTheLook/index.ts +0 -1
  293. package/src/widgets/RebuyCompleteTheLook/types.ts +0 -5
  294. package/src/widgets/RebuyDynamicBundleProducts/BundleImages.tsx +0 -62
  295. package/src/widgets/RebuyDynamicBundleProducts/BundlePrice.tsx +0 -93
  296. package/src/widgets/RebuyDynamicBundleProducts/BundleSelection.tsx +0 -65
  297. package/src/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.tsx +0 -118
  298. package/src/widgets/RebuyDynamicBundleProducts/Select.tsx +0 -41
  299. package/src/widgets/RebuyDynamicBundleProducts/index.ts +0 -1
  300. package/src/widgets/RebuyDynamicBundleProducts/types.ts +0 -23
  301. package/src/widgets/RebuyProductAddOns/RebuyProductAddOnCard.tsx +0 -66
  302. package/src/widgets/RebuyProductAddOns/RebuyProductAddOns.tsx +0 -218
  303. package/src/widgets/RebuyProductAddOns/index.ts +0 -1
  304. package/src/widgets/RebuyProductAddOns/types.ts +0 -24
  305. package/src/widgets/RebuyProductRecommendations/RebuyProductRecommendations.tsx +0 -50
  306. package/src/widgets/RebuyProductRecommendations/index.ts +0 -1
  307. package/src/widgets/RebuyProductRecommendations/types.ts +0 -5
@@ -1,263 +0,0 @@
1
- import type {
2
- Attribute,
3
- CartLine,
4
- Collection,
5
- ComponentizableCartLine,
6
- MoneyV2,
7
- Product,
8
- ProductVariant,
9
- SelectedOption,
10
- } from '@shopify/hydrogen-react/storefront-api-types';
11
- import type { SmartCart } from '~/types/rebuySmartCart';
12
- import type {
13
- HydrogenCollection,
14
- HydrogenProduct,
15
- HydrogenProductVariant,
16
- } from '~/types/shopify';
17
-
18
- export type RebuyContextProps = {
19
- cacheKey?: string;
20
- cartAttributes?: Attribute[];
21
- cartId?: string;
22
- // Depending on where the cart is coming from hydrogen or hydrogen-react the objects are very differetn and this is the only way to account for that
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- cartLines?: (CartLine | ComponentizableCartLine)[] | any;
25
- cartLinesLength?: number;
26
- cartNote?: string;
27
- cartSubtotal?: string;
28
- cartTotalQuantity?: number;
29
- isHydrogenReact: boolean;
30
- queryObject: Record<string, string>;
31
- windowUrl: string;
32
- };
33
-
34
- export type RebuyConfig = {
35
- shop: RebuyShop | null;
36
- smart_cart: SmartCart | null;
37
- smart_flows: unknown[]; // TODO: Define type for smart_flows still in beta development
38
- };
39
-
40
- export type RebuyResponse = {
41
- data: RebuyConfig;
42
- response: unknown;
43
- };
44
-
45
- export type ContextParameters = {
46
- cache_key?: string;
47
- cart?: CartContext;
48
- cart_count: number;
49
- cart_item_count: number;
50
- cart_line_count: number;
51
- cart_subtotal: number;
52
- cart_token?: string;
53
- isHydrogenReact: boolean; // This detemines if a user is using just Hydrogen or Hydrogen-React. It will determine how we get the cart info
54
- time: string;
55
- url: string;
56
- };
57
-
58
- type RebuyShopIntegrations = {
59
- attentive: boolean;
60
- judgeme: boolean;
61
- junip: boolean;
62
- klaviyo: boolean;
63
- loox: boolean;
64
- okendo: boolean;
65
- opinew: boolean;
66
- recharge: boolean;
67
- reviewsio: boolean;
68
- stamped: boolean;
69
- yotpo: boolean;
70
- };
71
-
72
- type RebuyShop = {
73
- active_experiments: unknown[];
74
- api_key: string;
75
- cache_key: string;
76
- carousel: string;
77
- currency: string;
78
- currency_symbol: string;
79
- domain: string;
80
- enabled_presentment_currencies: string[];
81
- has_smart_collections_enabled: boolean;
82
- has_smart_search_enabled: boolean;
83
- id: string;
84
- integrations: RebuyShopIntegrations;
85
- money_format: string;
86
- myshopify_domain: string;
87
- primary_locale: string;
88
- product_groups_enabled: string;
89
- rebuy_assistant: boolean;
90
- recharge_custom_domain: string | null;
91
- selling_plans_enabled: boolean;
92
- shop_id: number;
93
- shop_name: string;
94
- shopify_selling_plans_enabled: boolean;
95
- storefront_access_token: string | null;
96
- };
97
-
98
- export type CartContext = {
99
- attributes: string;
100
- item_count: number;
101
- items: CartItem[];
102
- line_count: number;
103
- note: string;
104
- subtotal: number;
105
- token: string;
106
- };
107
-
108
- export type CartItem = {
109
- attributes: Attribute[];
110
- product_id: string;
111
- properties: string;
112
- quantity: number;
113
- variant_id: string;
114
- };
115
-
116
- export type RebuyWidgetContainerProps = {
117
- children?: React.ReactNode;
118
- collection?: Collection | HydrogenCollection;
119
- collectionId?: string;
120
- dataSource?: string;
121
- limit?: number;
122
- // wasn't to sure of how we wanted to handle this type. It's my understanding that clients could create their own endpoints so I'm not sure we want to lock down the type
123
- options?: object;
124
- product?: Product | HydrogenProduct;
125
- productId?: string;
126
- variant?: ProductVariant | HydrogenProductVariant;
127
- variantId?: string;
128
- };
129
-
130
- export type RebuyProduct = {
131
- collections: { nodes: { handle: string }[] };
132
- compareAtPriceRange: {
133
- maxVariantCompareAtPrice: MoneyV2 | null;
134
- minVariantCompareAtPrice: MoneyV2 | null;
135
- };
136
- description: string;
137
- descriptionHtml: string;
138
- featuredImage: {
139
- altText: string | null;
140
- height: number;
141
- id: string;
142
- url: string;
143
- width: number;
144
- };
145
- handle: string;
146
- id: string;
147
- images: {
148
- altText: string | null;
149
- height: number;
150
- id: string;
151
- url: string;
152
- width: number;
153
- }[];
154
- media: unknown[];
155
- metafields: unknown[];
156
- options: {
157
- name: string;
158
- values: string[];
159
- }[];
160
- priceRange: {
161
- maxVariantPrice: MoneyV2;
162
- minVariantPrice: MoneyV2;
163
- };
164
- selected: boolean;
165
- selectedOptions: Record<string, string>;
166
- selectedSellingPlan: unknown;
167
- selectedSellingPlanAllocation: unknown;
168
- selectedVariant: RebuyProductVariant;
169
- sellingPlanGroups: unknown[];
170
- seo: {
171
- description: string | null;
172
- title: string | null;
173
- };
174
- title: string;
175
- variants: {
176
- nodes: RebuyProductVariant[];
177
- };
178
- vendor: string;
179
- };
180
-
181
- export type RebuyProductVariant = {
182
- availableForSale: boolean;
183
- compareAtPriceV2: MoneyV2 | null;
184
- id: string;
185
- image?: {
186
- altText: string | null;
187
- height: number;
188
- id: string;
189
- url: string;
190
- width: number;
191
- };
192
- priceV2: MoneyV2;
193
- product: {
194
- handle: string;
195
- id: string;
196
- title: string;
197
- vendor: string;
198
- };
199
- selectedOptions: Pick<SelectedOption, 'name' | 'value'>[];
200
- sku: string;
201
- title: string;
202
- };
203
-
204
- export type RebuyWidgetMetadata = {
205
- also_bot_tracking_ids?: number[];
206
- cache_info?: {
207
- cache_key: string;
208
- cache_key_readable: string;
209
- cached_at_time: number | string;
210
- };
211
- purchased_quantity?: string;
212
- shopify_customer: Customer;
213
- top_sellers_filled?: boolean;
214
- trending_products_filled?: boolean;
215
- };
216
-
217
- export type Customer = {
218
- accepts_marketing: boolean;
219
- accepts_marketing_updated_at: string;
220
- addresses: Address[];
221
- admin_graphql_api_id: string;
222
- created_at: string;
223
- currency: string;
224
- default_address: Address;
225
- email: string;
226
- first_name: string;
227
- id: number;
228
- last_name: string;
229
- last_order_id: string;
230
- last_order_name: string;
231
- marketing_opt_in_level: string;
232
- multipass_identifier: string;
233
- note: string;
234
- orders_count: number;
235
- phone: string;
236
- state: string;
237
- tags: string;
238
- tax_exempt: boolean;
239
- tax_exemptions: unknown[];
240
- total_spent: string;
241
- updated_at: string;
242
- verified_email: boolean;
243
- };
244
-
245
- export type Address = {
246
- address1: string;
247
- address2: string;
248
- city: string;
249
- company: string;
250
- country: string;
251
- country_code: string;
252
- country_name: string;
253
- customer_id: number;
254
- default: boolean;
255
- first_name: string;
256
- id: number;
257
- last_name: string;
258
- name: string;
259
- phone: string;
260
- province: string;
261
- province_code: string;
262
- zip: string;
263
- };
@@ -1,188 +0,0 @@
1
- export type ProgressBarTier = {
2
- id: number;
3
- minimum: number | null;
4
- presentment_currencies: {
5
- enabled: boolean;
6
- };
7
- product_amount_reached_label: boolean;
8
- product_amount_reached_label_text: string;
9
- product_amount_remaining_label: boolean;
10
- product_amount_remaining_label_text: string;
11
- products: unknown[];
12
- type: string;
13
- };
14
-
15
- export type ProgressBar = {
16
- country_codes: string[];
17
- exclude_discount: boolean;
18
- free_shipping_enabled: boolean;
19
- free_shipping_on_all_products: boolean;
20
- free_shipping_on_subscription: boolean;
21
- geolocation_enabled: boolean;
22
- id: number;
23
- layout: string;
24
- name: string;
25
- tiers: ProgressBarTier[];
26
- };
27
-
28
- export type SmartCartLanguage = {
29
- bmsm_discount_message: string;
30
- bmsm_discount_success: string;
31
- cart_title: string;
32
- checking_out_label: string;
33
- checkout_label: string;
34
- continue_shopping_label: string;
35
- discount_button_label: string;
36
- discount_code_label: string;
37
- discount_invalid_message: string;
38
- discount_label: string;
39
- empty_cart: string;
40
- free_shipping_helper: string;
41
- free_shipping_reached: string;
42
- free_shipping_remaining: string;
43
- notes_label: string;
44
- notes_placeholder: string;
45
- notes_remaining_characters: string;
46
- subtotal_plural_text: string;
47
- subtotal_singular_text: string;
48
- view_cart_label: string;
49
- view_cart_working_label: string;
50
- };
51
-
52
- export type SmartCartComponent = {
53
- always_visible?: boolean;
54
- hidden?: boolean;
55
- id: string;
56
- settings?: unknown;
57
- static?: boolean;
58
- title: string;
59
- type: string;
60
- };
61
-
62
- export type SmartCartAnchor = {
63
- components: string[];
64
- id: string;
65
- title: string;
66
- };
67
-
68
- export type SmartCart = {
69
- accelerated_checkout: {
70
- enabled: boolean;
71
- };
72
- accessibility: {
73
- heading: string;
74
- };
75
- anchorData: {
76
- anchorOrder: string[];
77
- anchors: {
78
- [key: string]: SmartCartAnchor;
79
- };
80
- components: {
81
- [key: string]: SmartCartComponent;
82
- };
83
- };
84
- announcement_bar: {
85
- enabled: boolean;
86
- messages: string[];
87
- };
88
- apps: unknown[];
89
- attribution_tracking_disabled: boolean;
90
- buy_more_save_more: {
91
- discount_products: unknown[];
92
- discount_type: string;
93
- display_type: string;
94
- enabled: boolean;
95
- language: {
96
- bmsm_discount_message: string;
97
- bmsm_discount_success: string;
98
- };
99
- tiers: {
100
- discount: number;
101
- quantity: number;
102
- }[];
103
- };
104
- callbacks: {
105
- [key: string]: {
106
- enabled: boolean;
107
- function: string;
108
- };
109
- };
110
- cart_page_checkout_override: {
111
- enabled: boolean;
112
- };
113
- checkout_button: {
114
- enabled: boolean;
115
- routing: string;
116
- routing_link: string;
117
- };
118
- continue_shopping_button: {
119
- enabled: boolean;
120
- };
121
- cross_sells: string[];
122
- custom_css: string;
123
- disable_cart_page: boolean;
124
- discount: {
125
- enabled: boolean;
126
- use_message_only: boolean;
127
- };
128
- enable_product_metafields: boolean;
129
- has_legacy_shipping: boolean;
130
- installments: {
131
- enabled: boolean;
132
- payment_count: number;
133
- provider: string;
134
- terms_url: string;
135
- };
136
- integrations: {
137
- code: string;
138
- enabled: boolean;
139
- };
140
- language: SmartCartLanguage;
141
- layout: string;
142
- name: string;
143
- notes: {
144
- enabled: boolean;
145
- limit_characters: boolean;
146
- max_length: number;
147
- };
148
- pre_purchase: {
149
- enabled: boolean;
150
- id: string;
151
- };
152
- preview_mode: boolean;
153
- product_form_redirect: string;
154
- progress_bar: {
155
- bars: ProgressBar[];
156
- enabled: boolean;
157
- };
158
- selectors: {
159
- cart_subtotal: string;
160
- item_count: string;
161
- };
162
- shop_pay: {
163
- enabled: boolean;
164
- };
165
- switch_to_subscription: {
166
- disable_downgrade: boolean;
167
- enabled: boolean;
168
- language: {
169
- downgrading_label: string;
170
- onetime_option_group_label: string;
171
- onetime_option_label: string;
172
- subscription_option_group_label: string;
173
- subscription_option_label: string;
174
- upgrade_to_subscription_default_frequency: string;
175
- upgrade_to_subscription_label: string;
176
- upgrade_to_subscription_without_discount_label: string;
177
- upgrading_label: string;
178
- };
179
- };
180
- terms: {
181
- disclaimer: string;
182
- enabled: boolean;
183
- };
184
- version: number;
185
- view_cart_button: {
186
- enabled: boolean;
187
- };
188
- };
@@ -1,142 +0,0 @@
1
- import type {
2
- Collection,
3
- Image,
4
- Maybe,
5
- MoneyV2,
6
- PageInfo,
7
- Product,
8
- ProductOption,
9
- ProductOptionValue,
10
- ProductOptionValueSwatch,
11
- ProductVariant,
12
- SelectedOption,
13
- Seo,
14
- } from '@shopify/hydrogen-react/storefront-api-types';
15
- import type { RebuyProductVariant } from './rebuyCustom';
16
-
17
- export type HydrogenProduct = Pick<
18
- Product,
19
- | 'id'
20
- | 'title'
21
- | 'vendor'
22
- | 'handle'
23
- | 'descriptionHtml'
24
- | 'description'
25
- | 'encodedVariantExistence'
26
- | 'encodedVariantAvailability'
27
- > & {
28
- adjacentVariants: (Pick<
29
- ProductVariant,
30
- 'availableForSale' | 'id' | 'sku' | 'title'
31
- > & {
32
- compareAtPrice?: Maybe<Pick<MoneyV2, 'amount' | 'currencyCode'>>;
33
- image?: Maybe<
34
- { __typename: 'Image' } & Pick<
35
- Image,
36
- 'id' | 'url' | 'altText' | 'width' | 'height'
37
- >
38
- >;
39
- price: Pick<MoneyV2, 'amount' | 'currencyCode'>;
40
- product: Pick<Product, 'title' | 'handle'>;
41
- selectedOptions: Pick<SelectedOption, 'name' | 'value'>[];
42
- unitPrice?: Maybe<Pick<MoneyV2, 'amount' | 'currencyCode'>>;
43
- })[];
44
- collections: {
45
- nodes: {
46
- handle: string;
47
- }[];
48
- };
49
- featuredImage?: {
50
- altText: string | null;
51
- height: number;
52
- id: string;
53
- url: string;
54
- width: number;
55
- };
56
- images: {
57
- altText: string | null;
58
- height: number;
59
- id: string;
60
- url: string;
61
- width: number;
62
- }[];
63
- options: (Pick<ProductOption, 'name'> & {
64
- optionValues: (Pick<ProductOptionValue, 'name'> & {
65
- firstSelectableVariant?: Maybe<
66
- Pick<
67
- ProductVariant,
68
- 'availableForSale' | 'id' | 'sku' | 'title'
69
- > & {
70
- compareAtPrice?: Maybe<
71
- Pick<MoneyV2, 'amount' | 'currencyCode'>
72
- >;
73
- image?: Maybe<
74
- { __typename: 'Image' } & Pick<
75
- Image,
76
- 'id' | 'url' | 'altText' | 'width' | 'height'
77
- >
78
- >;
79
- price: Pick<MoneyV2, 'amount' | 'currencyCode'>;
80
- product: Pick<Product, 'title' | 'handle'>;
81
- selectedOptions: Pick<SelectedOption, 'name' | 'value'>[];
82
- unitPrice?: Maybe<Pick<MoneyV2, 'amount' | 'currencyCode'>>;
83
- }
84
- >;
85
- swatch?: Maybe<
86
- Pick<ProductOptionValueSwatch, 'color'> & {
87
- image?: Maybe<{
88
- previewImage?: Maybe<Pick<Image, 'url'>>;
89
- }>;
90
- }
91
- >;
92
- })[];
93
- })[];
94
- priceRange: {
95
- maxVariantPrice: MoneyV2;
96
- minVariantPrice: MoneyV2;
97
- };
98
- selectedOrFirstAvailableVariant?: HydrogenProductVariant;
99
- selectedVariant?: HydrogenProductVariant;
100
- seo: Pick<Seo, 'description' | 'title'>;
101
- variants?: {
102
- nodes: RebuyProductVariant[];
103
- };
104
- };
105
-
106
- export type HydrogenProductVariant = Pick<
107
- ProductVariant,
108
- 'availableForSale' | 'id' | 'sku' | 'title'
109
- > & {
110
- compareAtPrice?: Maybe<Pick<MoneyV2, 'amount' | 'currencyCode'>>;
111
- image?: Maybe<
112
- { __typename: 'Image' } & Pick<
113
- Image,
114
- 'id' | 'url' | 'altText' | 'width' | 'height'
115
- >
116
- >;
117
- price: Pick<MoneyV2, 'amount' | 'currencyCode'>;
118
- product: Pick<Product, 'title' | 'handle'>;
119
- selectedOptions: Pick<SelectedOption, 'name' | 'value'>[];
120
- unitPrice?: Maybe<Pick<MoneyV2, 'amount' | 'currencyCode'>>;
121
- };
122
-
123
- export type HydrogenCollection = Pick<
124
- Collection,
125
- 'id' | 'handle' | 'title' | 'description'
126
- > & {
127
- products: {
128
- nodes: (Pick<Product, 'id' | 'handle' | 'title'> & {
129
- featuredImage?: Maybe<
130
- Pick<Image, 'id' | 'altText' | 'url' | 'width' | 'height'>
131
- >;
132
- priceRange: {
133
- maxVariantPrice: Pick<MoneyV2, 'amount' | 'currencyCode'>;
134
- minVariantPrice: Pick<MoneyV2, 'amount' | 'currencyCode'>;
135
- };
136
- })[];
137
- pageInfo: Pick<
138
- PageInfo,
139
- 'hasPreviousPage' | 'hasNextPage' | 'endCursor' | 'startCursor'
140
- >;
141
- };
142
- };
@@ -1,29 +0,0 @@
1
- import type { HydrogenProduct } from '~/types/shopify';
2
-
3
- import {
4
- RebuyProduct,
5
- RebuyProductVariant,
6
- RebuyWidgetMetadata,
7
- } from '~/types/rebuyCustom';
8
-
9
- // Internal type with all props from container
10
- export type WidgetContainerProvidedProps = {
11
- dataSource: string;
12
- isHydrogenReact: boolean;
13
- key: string;
14
- limit: number;
15
- metadata: RebuyWidgetMetadata;
16
- options: Record<string, unknown>;
17
- product: HydrogenProduct;
18
- productId: string;
19
- products: RebuyProduct[];
20
- variant: RebuyProductVariant;
21
- variantId: string;
22
- };
23
-
24
- export type WidgetChildProps = {
25
- addToCartCallback?: () => void;
26
- customTitle?: string;
27
- customTitleLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
28
- customTitleStyle?: React.CSSProperties;
29
- } & Partial<WidgetContainerProvidedProps>;