@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
@@ -0,0 +1,173 @@
1
+ import type React from 'react';
2
+ import { type TieredProgressBarFetchedProductData as FetchedProductData, type TieredProgressBar, type TieredProgressBarTier, type TieredProgressBarVariantNode } from '~/smart-cart/components/TieredProgressBar/types';
3
+ import type { StorefrontCartData } from '~/smart-cart/types/rebuy-storefront-cart';
4
+ type FetchedProductMap = Map<number, FetchedProductData>;
5
+ /**
6
+ * Helper to get numeric ID from a Shopify GID string.
7
+ * e.g., "gid://shopify/Product/12345" -> 12345
8
+ *
9
+ * @param {string} gid The Shopify GID string.
10
+ *
11
+ * @returns {number} The numeric ID.
12
+ */
13
+ export declare const getNumericIdFromGid: (gid: string) => number;
14
+ /**
15
+ * Helper to generate a unique key for storing declined gift states.
16
+ * Uses a combination of tier ID and legacy product ID.
17
+ *
18
+ * @param {string} tierId The ID of the tier.
19
+ * @param {number|string} legacyProductId The legacy numeric ID of the product associated with the tier.
20
+ *
21
+ * @returns {string} A string key for the declined gift.
22
+ */
23
+ export declare const getDeclineKey: (tierId: string, legacyProductId: number | string) => string;
24
+ /**
25
+ * Gets the display label for a tier marker.
26
+ *
27
+ * @param {TieredProgressBarTier} tier The tier configuration.
28
+ * @param {FetchedProductMap} fetchedProductMap Optional: A map of fetched product data, used to look up product titles for product tiers.
29
+ *
30
+ * @returns {string} The label string for the tier.
31
+ */
32
+ export declare const getTierLabel: (tier: TieredProgressBarTier, fetchedProductMap?: FetchedProductMap) => string;
33
+ /**
34
+ * Generates the main feedback text displayed below the progress bar.
35
+ * This text guides the user on how much more they need to spend for the next tier or confirms rewards.
36
+ * It respects boolean flags on the tier settings (e.g., `product_amount_reached_label`) to determine
37
+ * if a specific label text should be used.
38
+ *
39
+ * @param {TieredProgressBar|null} barConfig The active progress bar configuration.
40
+ * @param {TieredProgressBarTier|null} currentTier The next tier the user is progressing towards, or null if all tiers are reached.
41
+ * @param {TieredProgressBarTier|null} lastReachedTier The most recent tier the user has successfully reached, or null if no tiers are reached.
42
+ * @param {number} amountToNextTier The monetary amount remaining to reach the `currentTier`.
43
+ * @param {FetchedProductMap} fetchedProductMap A map of fetched product data, used to look up product titles for product tiers.
44
+ *
45
+ * @returns {string} The formatted feedback string, or an empty string if no label should be shown.
46
+ */
47
+ export declare const getTierFeedbackText: (barConfig: TieredProgressBar | null, currentTier: TieredProgressBarTier | null, lastReachedTier: TieredProgressBarTier | null, amountToNextTier: number, fetchedProductMap: FetchedProductMap) => string;
48
+ /**
49
+ * Minimal image object type for tier icons.
50
+ * Represents an image with an optional alt text and type.
51
+ *
52
+ * @property {string} alt - The alternative text for the image.
53
+ * @property {string} src - The source URL of the image.
54
+ * @property {string} type - The type of the icon (always 'image').
55
+ */
56
+ export type TierIconImage = {
57
+ alt: string;
58
+ src: string;
59
+ type: 'image';
60
+ };
61
+ /**
62
+ * Determines the icon component to display for a tier marker.
63
+ *
64
+ * @param {TieredProgressBarTier} tier The tier configuration.
65
+ * @param {boolean} isReached Whether the tier has been reached.
66
+ * @param {FetchedProductMap} fetchedProductMap A map of fetched product data, used for product tier image checks.
67
+ *
68
+ * @returns {TierIconReturnType} A React element or image object representing the icon.
69
+ */
70
+ export type TierIconReturnType = React.ReactElement | TierIconImage;
71
+ export declare const getTierIconComponent: (tier: TieredProgressBarTier, isReached: boolean, fetchedProductMap: FetchedProductMap) => TierIconReturnType;
72
+ /**
73
+ * Gets the minimum spend required to reach a specific tier.
74
+ *
75
+ * @param {TieredProgressBarTier} tier The tier configuration.
76
+ *
77
+ * @returns {number} The minimum amount, or Infinity if tier is invalid.
78
+ */
79
+ export declare const getTierMinimum: (tier: TieredProgressBarTier) => number;
80
+ /**
81
+ * Gets a user-friendly display title for a selected gift variant.
82
+ *
83
+ * @param {TieredProgressBarVariantNode|null} variant The variant node.
84
+ *
85
+ * @returns {string} The display title string.
86
+ */
87
+ export declare const getFreeVariantTitle: (variant: TieredProgressBarVariantNode | null) => string;
88
+ /**
89
+ * Determines if the main gift area container should be rendered.
90
+ * Renders if there's an active bar configuration and items to display within the gift area.
91
+ *
92
+ * @param {TieredProgressBar|null} barConfig The active progress bar configuration.
93
+ * @param {boolean} hasRenderableItems A boolean indicating if there are any gift items to be rendered.
94
+ *
95
+ * @returns {boolean} True if the gift area should be rendered, false otherwise.
96
+ */
97
+ export declare const shouldRenderGiftArea: (barConfig: TieredProgressBar | null, hasRenderableItems: boolean) => boolean;
98
+ /**
99
+ * Determines if the title for the gift area should be shown.
100
+ *
101
+ * @param {TieredProgressBar|null} barConfig The active progress bar configuration.
102
+ *
103
+ * @returns {boolean} True if the gift area title should be rendered, false otherwise.
104
+ */
105
+ export declare const shouldRenderGiftAreaTitle: (barConfig: TieredProgressBar | null) => boolean;
106
+ /**
107
+ * Gets the title text for the gift area.
108
+ *
109
+ * @param {TieredProgressBar|null} barConfig The active progress bar configuration.
110
+ *
111
+ * @returns {string} The gift area title string, or a default if not configured.
112
+ */
113
+ export declare const getGiftAreaTitle: (barConfig: TieredProgressBar | null) => string;
114
+ /**
115
+ * Calculates the current subtotal relevant for the progress bar.
116
+ * It starts with zero and adds the cost of each included cart item.
117
+ *
118
+ * Excluded items are:
119
+ * 1. Tiered Progress Bar gift items.
120
+ * 2. Items tagged with the specific exclusion tag.
121
+ * 3. If `bar.discounted_by === 'functions'`, items listed in `bar.excluded_products`.
122
+ *
123
+ * @param {StorefrontCartData|null} cart The current storefront cart data.
124
+ * @param {TieredProgressBar|null} bar The active progress bar configuration.
125
+ *
126
+ * @returns {number} The calculated subtotal for the progress bar.
127
+ */
128
+ export declare const calculateCurrentProgressBarSubtotal: (cart: StorefrontCartData | null, bar: TieredProgressBar | null) => number;
129
+ /**
130
+ * Checks if the cart qualifies for free shipping due to subscription items,
131
+ * based on the progress bar's settings.
132
+ *
133
+ * @param {StorefrontCartData|null} cart The current storefront cart data.
134
+ * @param {TieredProgressBar|null} bar The active progress bar configuration.
135
+ *
136
+ * @returns {boolean} True if free shipping on subscription is active, false otherwise.
137
+ */
138
+ export declare const checkHasFreeShippingOnSubscription: (cart: StorefrontCartData | null, bar: TieredProgressBar | null) => boolean;
139
+ /**
140
+ * Checks if a specific tier has been reached based on the current subtotal
141
+ * and free shipping on subscription status.
142
+ *
143
+ * @param {TieredProgressBarTier} tier The tier configuration.
144
+ * @param {number} currentSubtotal The current progress bar subtotal.
145
+ * @param {boolean} hasFreeShippingOnSubscription Whether free shipping on subscription is active.
146
+ *
147
+ * @returns {boolean} True if the tier is reached, false otherwise.
148
+ */
149
+ export declare const checkIsTierReached: (tier: TieredProgressBarTier, currentSubtotal: number, hasFreeShippingOnSubscription: boolean) => boolean;
150
+ /**
151
+ * Updates the session storage cache for declined gifts.
152
+ * This cache helps persist user choices across page loads within the same session.
153
+ *
154
+ * @param {Record<string, boolean>} newDeclinedMap A record object where keys are decline keys (from `getDeclineKey`)
155
+ * and values are booleans indicating if the gift is declined.
156
+ *
157
+ * @returns {void}
158
+ */
159
+ export declare const updateDeclinedCache: (newDeclinedMap: Record<string, boolean>) => void;
160
+ /**
161
+ * Calculates the visual progress bar percentage based on legacy logic for visual alignment.
162
+ * This logic often involves adjusting segment calculations (e.g., dividing by 2)
163
+ * to better align the visual progress with tier markers.
164
+ *
165
+ * @param {TieredProgressBar|null} barConfig The active progress bar configuration.
166
+ * @param {number} subtotal The current subtotal for progress calculation.
167
+ * @param {boolean} hasFreeShippingOnSubscription Whether free shipping is achieved via subscription.
168
+ *
169
+ * @returns {number} The calculated visual percentage (0-100).
170
+ */
171
+ export declare const calculateVisualProgressBarPercentage: (barConfig: TieredProgressBar | null, subtotal: number, hasFreeShippingOnSubscription: boolean) => number;
172
+ export {};
173
+ //# sourceMappingURL=progressBarUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progressBarUtils.d.ts","sourceRoot":"","sources":["../../../../src/smart-cart/components/TieredProgressBar/progressBarUtils.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACH,KAAK,mCAAmC,IAAI,kBAAkB,EAC9D,KAAK,iBAAiB,EAGtB,KAAK,qBAAqB,EAG1B,KAAK,4BAA4B,EACpC,MAAM,iDAAiD,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAOnF,KAAK,iBAAiB,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAEjD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,iBAAiB,MAAM,GAAG,MAAM,KAAG,MAEhF,CAAC;AAiBF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,qBAAqB,EAAE,oBAAoB,iBAAiB,KAAG,MA2BjG,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,GAC5B,WAAW,iBAAiB,GAAG,IAAI,EACnC,aAAa,qBAAqB,GAAG,IAAI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eAAO,MAAM,kBAAkB,GAC3B,MAAM,qBAAqB,EAC3B,iBAAiB,MAAM,EACvB,+BAA+B,OAAO,KACvC,OAQF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAc7E,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oCAAoC,GAC7C,WAAW,iBAAiB,GAAG,IAAI,EACnC,UAAU,MAAM,EAChB,+BAA+B,OAAO,KACvC,MAwFF,CAAC"}
@@ -0,0 +1,261 @@
1
+ export type TieredProgressBarVariantNode = {
2
+ availableForSale: boolean;
3
+ compareAtPrice?: {
4
+ amount: string;
5
+ currencyCode: string;
6
+ } | null;
7
+ id: string;
8
+ image?: {
9
+ altText?: string | null;
10
+ height: number;
11
+ url: string;
12
+ width: number;
13
+ } | null;
14
+ price: {
15
+ amount: string;
16
+ currencyCode: string;
17
+ };
18
+ selectedOptions: {
19
+ name: string;
20
+ value: string;
21
+ }[];
22
+ sku?: string;
23
+ title: string;
24
+ };
25
+ export type TieredProgressBarTierProduct = {
26
+ /** The minimum amount to reach the tier and unlock the product. */
27
+ minimum: number;
28
+ /** The ID of the product. */
29
+ product_id: number;
30
+ /** The IDs of the variants of the product to include as gift options. If empty, all variants will be included. */
31
+ variant_ids: number[];
32
+ };
33
+ export declare enum TieredProgressBarGiftStatus {
34
+ /** Represents that the gift (specific variant) IS currently in the cart */
35
+ ADDED = "added",
36
+ /** Represents that the tier is reached, but the gift has been declined */
37
+ DECLINED = "declined",
38
+ /** Represents an error during the last operation related to this gift (persists temporarily) */
39
+ ERROR = "error",
40
+ /**
41
+ * Fallback state or state where tier is reached, single variant available, but not yet added (pending sync)
42
+ * or when the tier is simply not reached yet.
43
+ */
44
+ IDLE = "idle",
45
+ /** Represents that the tier is reached, gift not declined, not in cart, but requires user variant selection */
46
+ NEEDS_SELECTION = "needs_selection",
47
+ /** Represents that the tier is reached, but no variants are available (OOS, filter settings) */
48
+ UNAVAILABLE = "unavailable"
49
+ }
50
+ export type TieredProgressBarQualifiedGiftState = {
51
+ allowedVariantIds: number[];
52
+ availableChoices: TieredProgressBarVariantNode[];
53
+ canReAdd: boolean;
54
+ displayStatus: TieredProgressBarGiftStatus;
55
+ error: string | null;
56
+ filterOOS: boolean;
57
+ handle: string;
58
+ image?: {
59
+ altText?: string | null;
60
+ src: string;
61
+ };
62
+ isDeclined: boolean;
63
+ isInCart: boolean;
64
+ isReached: boolean;
65
+ legacyProductId: number;
66
+ productId: string;
67
+ tierId: string;
68
+ title: string;
69
+ variantInCart: TieredProgressBarVariantNode | null;
70
+ variants: TieredProgressBarVariantNode[];
71
+ };
72
+ type TieredProgressBarPresentmentCurrencies = {
73
+ currencies: any[];
74
+ enabled: boolean;
75
+ };
76
+ /** The type of tier. */
77
+ export declare enum TieredProgressBarTierType {
78
+ DECORATIVE = "decorative",
79
+ DISCOUNT = "discount",
80
+ PRODUCT = "product",
81
+ SHIPPING = "shipping"
82
+ }
83
+ /** The size (width and height) of the tier icon or image in pixels. */
84
+ type TieredProgressBarTierImageSizePixelString = '18px' | '20px' | '24px' | '30px' | '36px';
85
+ export type TieredProgressBarTier = {
86
+ /** Used purely internally as a legacy state-tracking mechanism in the admin. */
87
+ all_products: [];
88
+ /** Used to display a custom label for the tier. */
89
+ custom_tier_label?: boolean;
90
+ /** The text to display for the custom label. */
91
+ custom_tier_label_text?: string;
92
+ /** Used to display a label for the amount reached. */
93
+ decorative_amount_reached_label?: boolean;
94
+ /** The text to display for the amount reached label. */
95
+ decorative_amount_reached_label_text?: string;
96
+ /** Used to display a label for the amount remaining. */
97
+ decorative_amount_remaining_label?: boolean;
98
+ /** The text to display for the amount remaining label. */
99
+ decorative_amount_remaining_label_text?: string;
100
+ /** The amount to discount from the total. */
101
+ discount_amount_from_total?: number;
102
+ /** Used to display a label for the amount reached. */
103
+ discount_amount_reached_label?: boolean;
104
+ /** The text to display for the amount reached label. */
105
+ discount_amount_reached_label_text?: string;
106
+ /** Used to display a label for the amount remaining. */
107
+ discount_amount_remaining_label?: boolean;
108
+ /** The text to display for the amount remaining label. */
109
+ discount_amount_remaining_label_text?: string;
110
+ /**
111
+ * The message to display for the discount.
112
+ * Tracked internally, but applied to Automatic Discount messaging when discount is applied by Shopify Functions.
113
+ *
114
+ * @private
115
+ */
116
+ discount_message?: string;
117
+ /** The type of discount. */
118
+ discount_type?: 'percentage' | 'fixedAmount';
119
+ /** Used to filter out of stock variants. */
120
+ filter_oos_variants?: boolean;
121
+ /** The ID of the tier. */
122
+ id: string;
123
+ /** The minimum amount to reach the tier. */
124
+ minimum: number;
125
+ /**
126
+ * The message to display for the order discount.
127
+ * Tracked internally, but applied to Automatic Discount messaging when discount is applied by Shopify Functions.
128
+ *
129
+ * @private
130
+ */
131
+ order_discount_message?: string;
132
+ /**
133
+ * The presentment currencies supported by the merchant.
134
+ *
135
+ * @deprecated
136
+ */
137
+ presentment_currencies: TieredProgressBarPresentmentCurrencies;
138
+ /** Used to display a label for the amount reached. */
139
+ product_amount_reached_label: boolean;
140
+ /** The text to display for the amount reached label. */
141
+ product_amount_reached_label_text: string;
142
+ /** Used to display a label for the amount remaining. */
143
+ product_amount_remaining_label: boolean;
144
+ /** The text to display for the amount remaining label. */
145
+ product_amount_remaining_label_text: string;
146
+ /** The size of the product tier element. */
147
+ product_tier_element_size?: TieredProgressBarTierImageSizePixelString;
148
+ /** Used to display an image for the product tier. */
149
+ product_tier_image?: boolean;
150
+ /** The products in the tier. */
151
+ products: TieredProgressBarTierProduct[];
152
+ /** The type of tier. */
153
+ type: TieredProgressBarTierType;
154
+ };
155
+ type TieredProgressBarLanguage = {
156
+ /** The message to display when the free shipping is reached. */
157
+ free_shipping_reached: string;
158
+ /** The message to display when the free shipping is not reached and is the next tier. */
159
+ free_shipping_remaining: string;
160
+ /** The title to display above the gift area. If not set, the title element will be hidden. */
161
+ gift_area_title?: string;
162
+ };
163
+ export type TieredProgressBarExcludedProduct = {
164
+ /** The ID of the product. */
165
+ product_id: number;
166
+ /** The IDs of the variants of the product to exclude. If empty, all variants will be excluded. */
167
+ variant_ids: number[];
168
+ };
169
+ export type TieredProgressBar = {
170
+ /** Used purely internally as a legacy state-tracking mechanism in the admin. */
171
+ all_excluded_products?: TieredProgressBarExcludedProduct[];
172
+ /** The country codes to display the progress bar in. If empty/not set, the progress bar will be displayed to all countries. */
173
+ country_codes: string[];
174
+ /** The mechanism by which the cart is discounted. */
175
+ discounted_by: 'functions' | 'scripts';
176
+ /** Used to exclude the discount from the subtotal. */
177
+ exclude_discount_in_subtotal: boolean;
178
+ /** Used purely internally as a legacy state-tracking mechanism in the admin. */
179
+ excluded_products?: TieredProgressBarExcludedProduct[];
180
+ /**
181
+ * Used to determine if free shipping is available on all products.
182
+ *
183
+ * @deprecated Users can set a minimum of $0 to trigger free shipping for all products.
184
+ */
185
+ free_shipping_on_all_products: boolean;
186
+ /** Used to determine if free shipping is available on subscription products. */
187
+ free_shipping_on_subscription: boolean;
188
+ /** Used to determine if geolocation is enabled. If so, the country codes will be used to determine the progress bar's visibility. */
189
+ geolocation_enabled: boolean;
190
+ /** The ID of the progress bar. */
191
+ id: string;
192
+ /** The language of the progress bar. */
193
+ language: TieredProgressBarLanguage;
194
+ /** @deprecated */
195
+ layout: 'above' | 'below';
196
+ /** The name of the progress bar (used in the admin). */
197
+ name: string;
198
+ /** The tiers of the progress bar (max 4 per bar). */
199
+ tiers: TieredProgressBarTier[];
200
+ /** Used to determine if line item mode is enabled. */
201
+ use_line_item_mode?: boolean;
202
+ };
203
+ export type TieredProgressBarSettings = {
204
+ /**
205
+ * The bars configured in the TPB component - maximum of 3. Multiple bars are configurable for geolocation scenarios.
206
+ * Only one bar is used in the cart.
207
+ */
208
+ bars: TieredProgressBar[];
209
+ };
210
+ export type TieredProgressBarFetchedProductData = {
211
+ handle: string;
212
+ id: string;
213
+ images?: {
214
+ edges: {
215
+ node: {
216
+ altText?: string | null;
217
+ height: number;
218
+ url: string;
219
+ width: number;
220
+ };
221
+ }[];
222
+ };
223
+ legacyProductId: number;
224
+ tags: string[];
225
+ title: string;
226
+ variants: {
227
+ edges: {
228
+ node: {
229
+ availableForSale: boolean;
230
+ compareAtPrice?: {
231
+ amount: string;
232
+ currencyCode: string;
233
+ } | null;
234
+ id: string;
235
+ image?: {
236
+ altText?: string | null;
237
+ height: number;
238
+ url: string;
239
+ width: number;
240
+ } | null;
241
+ price: {
242
+ amount: string;
243
+ currencyCode: string;
244
+ };
245
+ selectedOptions: {
246
+ name: string;
247
+ value: string;
248
+ }[];
249
+ sku?: string;
250
+ title: string;
251
+ };
252
+ }[];
253
+ };
254
+ };
255
+ export type TieredProgressBarCachedGiftData = {
256
+ declined?: Record<string, boolean>;
257
+ products: TieredProgressBarFetchedProductData[];
258
+ timestamp: number;
259
+ };
260
+ export {};
261
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/smart-cart/components/TieredProgressBar/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,4BAA4B,GAAG;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,eAAe,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAA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,MAAM,CAAC;oBACf,GAAG,EAAE,MAAM,CAAC;oBACZ,KAAK,EAAE,MAAM,CAAC;iBACjB,GAAG,IAAI,CAAC;gBACT,KAAK,EAAE;oBAAE,MAAM,EAAE,MAAM,CAAC;oBAAC,YAAY,EAAE,MAAM,CAAA;iBAAE,CAAC;gBAChD,eAAe,EAAE;oBAAE,IAAI,EAAE,MAAM,CAAC;oBAAC,KAAK,EAAE,MAAM,CAAA;iBAAE,EAAE,CAAC;gBACnD,GAAG,CAAC,EAAE,MAAM,CAAC;gBACb,KAAK,EAAE,MAAM,CAAC;aACjB,CAAC;SACL,EAAE,CAAC;KACP,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,EAAE,mCAAmC,EAAE,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ import type { ComponentAnchor, SmartCartComponentConfig } from '~/smart-cart/types/smart-cart-component';
3
+ type AnchorSlotProps = {
4
+ anchor: ComponentAnchor;
5
+ components: SmartCartComponentConfig[];
6
+ /** Optional list of component types to *exclude*. If provided, these types are skipped. */
7
+ excludeTypes?: string[];
8
+ /** Optional list of component types to *include*. If provided, only these types are rendered. */
9
+ includeTypes?: string[];
10
+ };
11
+ export declare const AnchorSlot: FC<AnchorSlotProps>;
12
+ export {};
13
+ //# sourceMappingURL=AnchorSlot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnchorSlot.d.ts","sourceRoot":"","sources":["../../../../src/smart-cart/components/_Layouts/AnchorSlot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAIzC,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAGzG,KAAK,eAAe,GAAG;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iGAAiG;IACjG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA0C1C,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { SmartCartComponentConfig } from '~/smart-cart/types/smart-cart-component';
2
+ type DoubleColumnLayoutProps = {
3
+ components: SmartCartComponentConfig[];
4
+ itemCount: number;
5
+ layout: 'double' | 'double-right';
6
+ };
7
+ export declare const DoubleColumnLayout: React.FC<DoubleColumnLayoutProps>;
8
+ export {};
9
+ //# sourceMappingURL=DoubleColumnLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoubleColumnLayout.d.ts","sourceRoot":"","sources":["../../../../src/smart-cart/components/_Layouts/DoubleColumnLayout.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAKxF,KAAK,uBAAuB,GAAG;IAC3B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,QAAQ,GAAG,cAAc,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA8ChE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { SmartCartComponentConfig } from '~/smart-cart/types/smart-cart-component';
2
+ type SingleColumnLayoutProps = {
3
+ components: SmartCartComponentConfig[];
4
+ itemCount: number;
5
+ };
6
+ export declare const SingleColumnLayout: React.FC<SingleColumnLayoutProps>;
7
+ export {};
8
+ //# sourceMappingURL=SingleColumnLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleColumnLayout.d.ts","sourceRoot":"","sources":["../../../../src/smart-cart/components/_Layouts/SingleColumnLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAKxF,KAAK,uBAAuB,GAAG;IAC3B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+BhE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type React from 'react';
2
+ export declare const componentRegistry: Record<string, React.FC<any>>;
3
+ //# sourceMappingURL=componentRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentRegistry.d.ts","sourceRoot":"","sources":["../../../src/smart-cart/components/componentRegistry.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6C/B,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAe3D,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Rebuy-specific attribution of the item (ie. key: '_attribution', value: 'Rebuy Buy More Save More')
3
+ */
4
+ export declare enum RebuyLineItemAttribution {
5
+ BUY_MORE_SAVE_MORE = "Rebuy Buy More Save More",
6
+ GIFT_WITH_PURCHASE = "Rebuy Gift with Purchase",
7
+ SWITCH_TO_ONE_TIME = "Rebuy Switch to One-Time",
8
+ SWITCH_TO_SUBSCRIPTION = "Rebuy Switch to Subscription",
9
+ TIERED_PROGRESS_BAR = "Rebuy Tiered Progress Bar"
10
+ }
11
+ /**
12
+ * Line Item Attribute Keys (for attribution, tracking, safeguarding discounts, etc.)
13
+ */
14
+ export declare enum LineItemAttributeKey {
15
+ /**
16
+ * Rebuy-specific attribution of the item
17
+ */
18
+ ATTRIBUTION = "_attribution",
19
+ /**
20
+ * Quantity before BMSM (not currently used - just an idea if we want to calculate more accurate RGR)
21
+ */
22
+ BMSM_QTY_BEFORE = "_bmsm_qty_before",
23
+ /**
24
+ * Hide quantity selector (ie. for Gift with Purchase items)
25
+ */
26
+ HIDE_QUANTITY_SELECTOR_GWP_ITEM = "_r_gwp_hide_qty",
27
+ /**
28
+ * Source of the item (ie. 'Rebuy')
29
+ */
30
+ SOURCE = "_source"
31
+ }
32
+ export declare enum CartExclusionProductTag {
33
+ /**
34
+ * Exclude items with this tag from cart subtotal used to calculate final display price
35
+ */
36
+ EXCLUDE_FROM_CART_SUBTOTAL = "smart-cart-subtotal-excluded",
37
+ /**
38
+ * Exclude items with this tag from progress bar subtotal used to calculate thresholds
39
+ */
40
+ EXCLUDE_FROM_PROGRESS_BAR_SUBTOTAL = "smart-cart-shipping-excluded",
41
+ /**
42
+ * Hide bundle options in cart
43
+ */
44
+ HIDE_BUNDLE_OPTIONS_IN_CART = "smart-cart-hide-bundle-options",
45
+ /**
46
+ * Hide cart items in the cart display
47
+ */
48
+ HIDE_FROM_CART_ITEMS = "smart-cart-hidden",
49
+ /**
50
+ * Hide quantity selector in cart
51
+ */
52
+ HIDE_QUANTITY_SELECTOR_IN_CART = "smart-cart-hide-qty"
53
+ }
54
+ export declare enum SessionStorageKey {
55
+ TIERED_PROGRESS_BAR_GIFT_DATA = "_r_progress_bar_gift_data"
56
+ }
57
+ export declare const NO_IMAGE_SHOPIFY_PLACEHOLDER = "//cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_large.png?format=webp&v=1530129081";
58
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/smart-cart/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,wBAAwB;IAChC,kBAAkB,6BAA6B;IAC/C,kBAAkB,6BAA6B;IAC/C,kBAAkB,6BAA6B;IAC/C,sBAAsB,iCAAiC;IACvD,mBAAmB,8BAA8B;CACpD;AAED;;GAEG;AACH,oBAAY,oBAAoB;IAC5B;;OAEG;IACH,WAAW,iBAAiB;IAC5B;;OAEG;IACH,eAAe,qBAAqB;IACpC;;OAEG;IACH,+BAA+B,oBAAoB;IAEnD;;OAEG;IACH,MAAM,YAAY;CACrB;AAED,oBAAY,uBAAuB;IAC/B;;OAEG;IACH,0BAA0B,iCAAiC;IAC3D;;OAEG;IACH,kCAAkC,iCAAiC;IACnE;;OAEG;IACH,2BAA2B,mCAAmC;IAC9D;;OAEG;IACH,oBAAoB,sBAAsB;IAC1C;;OAEG;IACH,8BAA8B,wBAAwB;CACzD;AAED,oBAAY,iBAAiB;IACzB,6BAA6B,8BAA8B;CAC9D;AAED,eAAO,MAAM,4BAA4B,4GACoE,CAAC"}
@@ -0,0 +1,62 @@
1
+ import type { Cart as HydrogenStorefrontApiCart } from '@shopify/hydrogen/storefront-api-types';
2
+ import { type ReactNode } from 'react';
3
+ import { type TieredProgressBarStore } from '~/smart-cart/store/tieredProgressBarStore';
4
+ import type { StorefrontAttribute, StorefrontCartData, StorefrontCartItemInput, StorefrontCartLineUpdateInput } from '~/smart-cart/types/rebuy-storefront-cart';
5
+ import type { SmartCartConfig } from '~/smart-cart/types/smart-cart';
6
+ import type { SmartCartComponentConfig } from '~/smart-cart/types/smart-cart-component';
7
+ import type { HydrogenReactCartActions } from '~/types/rebuyCustom';
8
+ export type SmartCartContextValue = {
9
+ addItem: (variantId: string, attributes?: StorefrontAttribute[], quantity?: number) => void | Promise<StorefrontCartData | null>;
10
+ addItems: (items: StorefrontCartItemInput[]) => void | Promise<StorefrontCartData | null>;
11
+ apiKey: string;
12
+ applyDiscountCodes: (codes: string[]) => void | Promise<StorefrontCartData | null>;
13
+ cacheKey: string;
14
+ cartData: StorefrontCartData | null;
15
+ checkout: () => void;
16
+ config: SmartCartConfig;
17
+ error: string | null;
18
+ getCartSubtotal: () => string;
19
+ getComponentConfigById: (id: string) => SmartCartComponentConfig | undefined;
20
+ getComponentConfigByType: <T extends SmartCartComponentConfig['type']>(type: T) => Extract<SmartCartComponentConfig, {
21
+ type: T;
22
+ }> | undefined;
23
+ getItemCount: () => number;
24
+ getTpbStore: () => TieredProgressBarStore;
25
+ hideCart: () => void;
26
+ hydrogenReactCartActions?: HydrogenReactCartActions;
27
+ /** Indicates if the cart is busy (loading, updating, etc.) via H-React ops or TPB sync actions. */
28
+ isCartBusy: boolean;
29
+ /** Indicates if the cart is ready to be used initially. */
30
+ isCartReady: boolean;
31
+ isHydrogenReact: boolean;
32
+ /** Global loading state */
33
+ isLoading: boolean;
34
+ isProgressBarLineItemMode: boolean;
35
+ isVisible: boolean;
36
+ removeItem: (lineId: string) => void | Promise<StorefrontCartData | null>;
37
+ removeItems: (lineIds: string[]) => void | Promise<StorefrontCartData | null>;
38
+ shopifyDomain: string;
39
+ showCart: () => void;
40
+ storefrontAccessToken: string;
41
+ toggleCart: () => void;
42
+ updateCartAttributes: (attributes: StorefrontAttribute[]) => void | Promise<StorefrontCartData | null>;
43
+ updateCartNote: (note: string | null) => void | Promise<StorefrontCartData | null>;
44
+ updateItem: (lineId: string, updates: Partial<Omit<StorefrontCartLineUpdateInput, 'id'> & {
45
+ sellingPlanId?: string | null;
46
+ }>) => void | Promise<StorefrontCartData | null>;
47
+ updateItems: (updates: (StorefrontCartLineUpdateInput & {
48
+ sellingPlanId?: string | null;
49
+ })[]) => void | Promise<StorefrontCartData | null>;
50
+ };
51
+ export type SmartCartProviderProps = {
52
+ apiKey: string;
53
+ cacheKey: string;
54
+ children?: ReactNode;
55
+ config: SmartCartConfig;
56
+ hydrogenCart: HydrogenStorefrontApiCart;
57
+ shopifyDomain: string;
58
+ storefrontAccessToken: string;
59
+ };
60
+ export declare const SmartCartProvider: React.FC<SmartCartProviderProps>;
61
+ export declare const useSmartCart: () => SmartCartContextValue;
62
+ //# sourceMappingURL=SmartCartContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SmartCartContext.d.ts","sourceRoot":"","sources":["../../../src/smart-cart/context/SmartCartContext.tsx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