@rebuy/rebuy-hydrogen 2.3.1 → 3.0.0-alpha.3

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 (162) hide show
  1. package/README.md +195 -17
  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 +3 -0
  5. package/dist/components/AddToCartBtn/AddToCartBtn.d.ts.map +1 -0
  6. package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts +3 -0
  7. package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts.map +1 -0
  8. package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts +3 -0
  9. package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts.map +1 -0
  10. package/dist/components/AddToCartBtn/index.d.ts +2 -0
  11. package/dist/components/AddToCartBtn/index.d.ts.map +1 -0
  12. package/dist/components/AddToCartBtn/types.d.ts +27 -0
  13. package/dist/components/AddToCartBtn/types.d.ts.map +1 -0
  14. package/dist/components/ProductCard/ProductCard.d.ts +3 -0
  15. package/dist/components/ProductCard/ProductCard.d.ts.map +1 -0
  16. package/dist/components/ProductCard/defaultSettings.d.ts +3 -0
  17. package/dist/components/ProductCard/defaultSettings.d.ts.map +1 -0
  18. package/dist/components/ProductCard/index.d.ts +3 -0
  19. package/dist/components/ProductCard/index.d.ts.map +1 -0
  20. package/dist/components/ProductCard/types.d.ts +52 -0
  21. package/dist/components/ProductCard/types.d.ts.map +1 -0
  22. package/dist/components/ProductCarousel/ProductCarousel.d.ts +16 -0
  23. package/dist/components/ProductCarousel/ProductCarousel.d.ts.map +1 -0
  24. package/dist/components/ProductCarousel/index.d.ts +2 -0
  25. package/dist/components/ProductCarousel/index.d.ts.map +1 -0
  26. package/dist/components/ProductPrice/ProductPrice.d.ts +3 -0
  27. package/dist/components/ProductPrice/ProductPrice.d.ts.map +1 -0
  28. package/dist/components/ProductPrice/index.d.ts +2 -0
  29. package/dist/components/ProductPrice/index.d.ts.map +1 -0
  30. package/dist/components/ProductPrice/types.d.ts +23 -0
  31. package/dist/components/ProductPrice/types.d.ts.map +1 -0
  32. package/dist/components/QuantityInput/QuantityInput.d.ts +3 -0
  33. package/dist/components/QuantityInput/QuantityInput.d.ts.map +1 -0
  34. package/dist/components/QuantityInput/index.d.ts +3 -0
  35. package/dist/components/QuantityInput/index.d.ts.map +1 -0
  36. package/dist/components/QuantityInput/types.d.ts +7 -0
  37. package/dist/components/QuantityInput/types.d.ts.map +1 -0
  38. package/dist/components/Timer/Timer.d.ts +3 -0
  39. package/dist/components/Timer/Timer.d.ts.map +1 -0
  40. package/dist/components/Timer/index.d.ts +3 -0
  41. package/dist/components/Timer/index.d.ts.map +1 -0
  42. package/dist/components/Timer/types.d.ts +16 -0
  43. package/dist/components/Timer/types.d.ts.map +1 -0
  44. package/dist/components/Title/Title.d.ts +3 -0
  45. package/dist/components/Title/Title.d.ts.map +1 -0
  46. package/dist/components/Title/index.d.ts +2 -0
  47. package/dist/components/Title/index.d.ts.map +1 -0
  48. package/dist/components/Title/types.d.ts +8 -0
  49. package/dist/components/Title/types.d.ts.map +1 -0
  50. package/dist/components/VariantSelect/VariantSelect.d.ts +3 -0
  51. package/dist/components/VariantSelect/VariantSelect.d.ts.map +1 -0
  52. package/dist/components/VariantSelect/index.d.ts +2 -0
  53. package/dist/components/VariantSelect/index.d.ts.map +1 -0
  54. package/dist/components/VariantSelect/types.d.ts +8 -0
  55. package/dist/components/VariantSelect/types.d.ts.map +1 -0
  56. package/dist/constants/api.d.ts +2 -0
  57. package/dist/constants/api.d.ts.map +1 -0
  58. package/dist/context/RebuyConfigContext.d.ts +21 -0
  59. package/dist/context/RebuyConfigContext.d.ts.map +1 -0
  60. package/dist/context/RebuyContext.d.ts +6 -0
  61. package/dist/context/RebuyContext.d.ts.map +1 -0
  62. package/dist/hooks/titleLevel.d.ts +3 -0
  63. package/dist/hooks/titleLevel.d.ts.map +1 -0
  64. package/dist/hooks/useBreakpoint.d.ts +5 -0
  65. package/dist/hooks/useBreakpoint.d.ts.map +1 -0
  66. package/dist/hooks/usePopupTrigger.d.ts +3 -0
  67. package/dist/hooks/usePopupTrigger.d.ts.map +1 -0
  68. package/dist/hooks/useRebuyTheme.d.ts +21 -0
  69. package/dist/hooks/useRebuyTheme.d.ts.map +1 -0
  70. package/dist/index.css +853 -0
  71. package/dist/index.css.map +7 -0
  72. package/dist/index.d.ts +14 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +3211 -0
  75. package/dist/index.js.map +7 -0
  76. package/dist/index.mjs +3178 -0
  77. package/dist/index.mjs.map +7 -0
  78. package/dist/providers/RebuyHydrogenContextProvider.d.ts +3 -0
  79. package/dist/providers/RebuyHydrogenContextProvider.d.ts.map +1 -0
  80. package/dist/providers/RebuyHydrogenReactContextProvider.d.ts +8 -0
  81. package/dist/providers/RebuyHydrogenReactContextProvider.d.ts.map +1 -0
  82. package/dist/providers/types.d.ts +71 -0
  83. package/dist/providers/types.d.ts.map +1 -0
  84. package/dist/queries/cart.queries.d.ts +5 -0
  85. package/dist/queries/cart.queries.d.ts.map +1 -0
  86. package/dist/types/common.d.ts +9 -0
  87. package/dist/types/common.d.ts.map +1 -0
  88. package/dist/types/rebuyCustom.d.ts +275 -0
  89. package/dist/types/rebuyCustom.d.ts.map +1 -0
  90. package/dist/types/rebuySmartCart.d.ts +184 -0
  91. package/dist/types/rebuySmartCart.d.ts.map +1 -0
  92. package/dist/types/shopify.d.ts +85 -0
  93. package/dist/types/shopify.d.ts.map +1 -0
  94. package/dist/types/widgets.d.ts +23 -0
  95. package/dist/types/widgets.d.ts.map +1 -0
  96. package/dist/utils/convertToRebuyProduct.d.ts +156 -0
  97. package/dist/utils/convertToRebuyProduct.d.ts.map +1 -0
  98. package/dist/utils/createContextParameters.d.ts +3 -0
  99. package/dist/utils/createContextParameters.d.ts.map +1 -0
  100. package/dist/utils/csp.d.ts +16 -0
  101. package/dist/utils/csp.d.ts.map +1 -0
  102. package/dist/utils/getEncodedAttributes.d.ts +3 -0
  103. package/dist/utils/getEncodedAttributes.d.ts.map +1 -0
  104. package/dist/utils/getRebuyConfig.d.ts +3 -0
  105. package/dist/utils/getRebuyConfig.d.ts.map +1 -0
  106. package/dist/utils/theme.d.ts +20 -0
  107. package/dist/utils/theme.d.ts.map +1 -0
  108. package/dist/widgetContainer/RebuyWidgetContainer.d.ts +8 -0
  109. package/dist/widgetContainer/RebuyWidgetContainer.d.ts.map +1 -0
  110. package/dist/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.d.ts +3 -0
  111. package/dist/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.d.ts.map +1 -0
  112. package/dist/widgets/RebuyCompleteTheLook/index.d.ts +2 -0
  113. package/dist/widgets/RebuyCompleteTheLook/index.d.ts.map +1 -0
  114. package/dist/widgets/RebuyCompleteTheLook/types.d.ts +5 -0
  115. package/dist/widgets/RebuyCompleteTheLook/types.d.ts.map +1 -0
  116. package/dist/widgets/RebuyDynamicBundleProducts/BundleImages.d.ts +5 -0
  117. package/dist/widgets/RebuyDynamicBundleProducts/BundleImages.d.ts.map +1 -0
  118. package/dist/widgets/RebuyDynamicBundleProducts/BundlePrice.d.ts +5 -0
  119. package/dist/widgets/RebuyDynamicBundleProducts/BundlePrice.d.ts.map +1 -0
  120. package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts +3 -0
  121. package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts.map +1 -0
  122. package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts +3 -0
  123. package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts.map +1 -0
  124. package/dist/widgets/RebuyDynamicBundleProducts/Select.d.ts +3 -0
  125. package/dist/widgets/RebuyDynamicBundleProducts/Select.d.ts.map +1 -0
  126. package/dist/widgets/RebuyDynamicBundleProducts/index.d.ts +2 -0
  127. package/dist/widgets/RebuyDynamicBundleProducts/index.d.ts.map +1 -0
  128. package/dist/widgets/RebuyDynamicBundleProducts/types.d.ts +19 -0
  129. package/dist/widgets/RebuyDynamicBundleProducts/types.d.ts.map +1 -0
  130. package/dist/widgets/RebuyProductAddOns/RebuyProductAddOnCard.d.ts +3 -0
  131. package/dist/widgets/RebuyProductAddOns/RebuyProductAddOnCard.d.ts.map +1 -0
  132. package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts +3 -0
  133. package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts.map +1 -0
  134. package/dist/widgets/RebuyProductAddOns/index.d.ts +2 -0
  135. package/dist/widgets/RebuyProductAddOns/index.d.ts.map +1 -0
  136. package/dist/widgets/RebuyProductAddOns/types.d.ts +19 -0
  137. package/dist/widgets/RebuyProductAddOns/types.d.ts.map +1 -0
  138. package/dist/widgets/RebuyProductRecommendations/RebuyProductRecommendations.d.ts +3 -0
  139. package/dist/widgets/RebuyProductRecommendations/RebuyProductRecommendations.d.ts.map +1 -0
  140. package/dist/widgets/RebuyProductRecommendations/index.d.ts +2 -0
  141. package/dist/widgets/RebuyProductRecommendations/index.d.ts.map +1 -0
  142. package/dist/widgets/RebuyProductRecommendations/types.d.ts +5 -0
  143. package/dist/widgets/RebuyProductRecommendations/types.d.ts.map +1 -0
  144. package/dist/widgets/RebuyWidget/RebuyWidget.d.ts +3 -0
  145. package/dist/widgets/RebuyWidget/RebuyWidget.d.ts.map +1 -0
  146. package/dist/widgets/RebuyWidget/WidgetContent.d.ts +3 -0
  147. package/dist/widgets/RebuyWidget/WidgetContent.d.ts.map +1 -0
  148. package/dist/widgets/RebuyWidget/index.d.ts +2 -0
  149. package/dist/widgets/RebuyWidget/index.d.ts.map +1 -0
  150. package/dist/widgets/RebuyWidget/types.d.ts +335 -0
  151. package/dist/widgets/RebuyWidget/types.d.ts.map +1 -0
  152. package/package.json +85 -47
  153. package/RebuyCompleteTheLook.client.jsx +0 -188
  154. package/RebuyContextProvider.client.jsx +0 -222
  155. package/RebuyContexts.client.jsx +0 -3
  156. package/RebuyDynamicBundleProducts.client.jsx +0 -415
  157. package/RebuyProductAddOnCard.client.jsx +0 -89
  158. package/RebuyProductAddOns.client.jsx +0 -227
  159. package/RebuyProductRecommendations.client.jsx +0 -68
  160. package/RebuyProductViewed.client.jsx +0 -62
  161. package/RebuyRecentlyViewedProducts.client.jsx +0 -68
  162. package/RebuyWidgetContainer.client.jsx +0 -136
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { RebuyConfig } from '~/types/rebuyCustom';
3
+ export type RebuyConfigLoadingStatus = 'idle' | 'loading' | 'success' | 'error';
4
+ export type RebuyConfigContextType = {
5
+ apiKey: string | null;
6
+ fetchError: Error | string | null;
7
+ fetchRebuyConfig: (domain: string) => Promise<void>;
8
+ loadingStatus: RebuyConfigLoadingStatus;
9
+ rebuyConfig: RebuyConfig | null;
10
+ shopDomain: string | null;
11
+ };
12
+ export type RebuyConfigProviderProps = {
13
+ children: ReactNode;
14
+ /** The Shopify store domain (e.g., example-brand.myshopify.com) used to fetch the config. */
15
+ initialShopDomain?: string;
16
+ /** Optional API key to override environment variable or config-derived one. */
17
+ overrideApiKey?: string;
18
+ };
19
+ export declare const RebuyConfigProvider: ({ children, initialShopDomain, overrideApiKey }: RebuyConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const useRebuyConfig: () => RebuyConfigContextType;
21
+ //# sourceMappingURL=RebuyConfigContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RebuyConfigContext.d.ts","sourceRoot":"","sources":["../../src/context/RebuyConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACjC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,aAAa,EAAE,wBAAwB,CAAC;IACxC,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAIF,MAAM,MAAM,wBAAwB,GAAG;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,iDAAiD,wBAAwB,4CAyE5G,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,sBAQjC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type ContextParameters } from '~/types/rebuyCustom';
2
+ export type RebuyContextType = {
3
+ contextParameters: ContextParameters;
4
+ };
5
+ export declare const RebuyContext: import("react").Context<RebuyContextType | null>;
6
+ //# sourceMappingURL=RebuyContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RebuyContext.d.ts","sourceRoot":"","sources":["../../src/context/RebuyContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,YAAY,kDAA+C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ProductCardTitleLevel } from '~/types/common';
2
+ export declare const getTitleLevel: (level: string, decreaseLevel?: boolean) => ProductCardTitleLevel;
3
+ //# sourceMappingURL=titleLevel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"titleLevel.d.ts","sourceRoot":"","sources":["../../src/hooks/titleLevel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,gBAAe,OAAe,KAAG,qBAyC7E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { WidgetSettings } from '~/widgets/RebuyWidget/types';
2
+ type Breakpoint = 'small' | 'medium' | 'large';
3
+ export declare const useBreakpoint: (settings: WidgetSettings | null) => Breakpoint;
4
+ export {};
5
+ //# sourceMappingURL=useBreakpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBreakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/useBreakpoint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,eAAO,MAAM,aAAa,GAAI,UAAU,cAAc,GAAG,IAAI,KAAG,UA4C/D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { WidgetSettings } from '~/widgets/RebuyWidget/types';
2
+ export declare const usePopupTrigger: (settings: WidgetSettings | null, popupTriggerId: string | undefined, widgetId: string, popupShownOnce: boolean, showPopup: boolean, setShowPopup: (show: boolean) => void, setPopupShownOnce: (shown: boolean) => void) => void;
3
+ //# sourceMappingURL=usePopupTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePopupTrigger.d.ts","sourceRoot":"","sources":["../../src/hooks/usePopupTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,eAAO,MAAM,eAAe,GACxB,UAAU,cAAc,GAAG,IAAI,EAC/B,gBAAgB,MAAM,GAAG,SAAS,EAClC,UAAU,MAAM,EAChB,gBAAgB,OAAO,EACvB,WAAW,OAAO,EAClB,cAAc,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EACrC,mBAAmB,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,SAoI9C,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type RebuyThemeLinkOptions = {
2
+ /**
3
+ * Override the API key from the RebuyConfigContext.
4
+ * Useful if you need to specify a different key for styles
5
+ * than the one used for general API calls.
6
+ */
7
+ overrideApiKey?: string;
8
+ };
9
+ /**
10
+ * A hook that returns an array of link objects for the Rebuy theme stylesheet,
11
+ * suitable for Remix's links function. It attempts to use the API key from
12
+ * the RebuyConfigContext.
13
+ *
14
+ * @param {RebuyThemeLinkOptions} options - Optional override for apiKey.
15
+ * @returns {Array<{ href: string; rel: string }>} An array containing the link object, or an empty array if prerequisites are not met.
16
+ */
17
+ export declare const useRebuyTheme: (options?: RebuyThemeLinkOptions) => {
18
+ href: string;
19
+ rel: string;
20
+ }[];
21
+ //# sourceMappingURL=useRebuyTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRebuyTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useRebuyTheme.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,qBAAqB,GAAG;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,UAAS,qBAA0B;;;GAsChE,CAAC"}