yt-uikit 0.10.29 → 0.10.30

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 (153) hide show
  1. package/README.md +94 -94
  2. package/dist/esm/assets/confetti.d.ts +2 -2
  3. package/dist/esm/atoms/bundleBuilderProductDetailsAtom.d.ts +4 -4
  4. package/dist/esm/atoms/cartDataAtom.d.ts +3 -3
  5. package/dist/esm/atoms/cartLoadingAtom.d.ts +22 -22
  6. package/dist/esm/atoms/cartTimer.d.ts +2 -2
  7. package/dist/esm/atoms/dateAtom.d.ts +1 -1
  8. package/dist/esm/atoms/freebieClaimModalAtom.d.ts +7 -7
  9. package/dist/esm/atoms/giftWrap.d.ts +2 -2
  10. package/dist/esm/atoms/gstCompanyNameAtom.d.ts +1 -1
  11. package/dist/esm/atoms/gstInputAtom.d.ts +1 -1
  12. package/dist/esm/atoms/maxQtyErrorAtom.d.ts +3 -3
  13. package/dist/esm/atoms/multiClaimSelectionAtom.d.ts +25 -25
  14. package/dist/esm/atoms/noteInputAtom.d.ts +3 -3
  15. package/dist/esm/atoms/postalCodeAtom.d.ts +1 -1
  16. package/dist/esm/atoms/shippingAtom.d.ts +8 -8
  17. package/dist/esm/atoms/showGSTInputAtom.d.ts +1 -1
  18. package/dist/esm/atoms/variantSelectionModalAtom.d.ts +33 -33
  19. package/dist/esm/components/BundleBlock/Bundle.d.ts +462 -462
  20. package/dist/esm/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +52 -52
  21. package/dist/esm/components/BundleBlock/BundleBuilder/ResponsiveBgImage.d.ts +9 -9
  22. package/dist/esm/components/BundleBlock/BundleBuilder/SortAndFilter.d.ts +74 -74
  23. package/dist/esm/components/BundleBlock/BundleBuilder/VariantOptionsModal.d.ts +28 -28
  24. package/dist/esm/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +37 -37
  25. package/dist/esm/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +56 -56
  26. package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +77 -77
  27. package/dist/esm/components/BundleBlock/BundleProductDetailsModal/BundleProductDetailsModal.d.ts +37 -37
  28. package/dist/esm/components/BundleBlock/BundleProductDetailsModal/bundleProductDetailsModal.style.d.ts +10 -10
  29. package/dist/esm/components/BundleBlock/CollectionBundle/CategoryFilter.d.ts +10 -10
  30. package/dist/esm/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +133 -133
  31. package/dist/esm/components/BundleBlock/CollectionBundle/ProductDetailsModal.d.ts +16 -16
  32. package/dist/esm/components/BundleBlock/ComboBundle.d.ts +17 -17
  33. package/dist/esm/components/BundleBlock/FixedBundle/FixedBundle.d.ts +4 -4
  34. package/dist/esm/components/BundleBlock/FixedBundle/SeparateVariantOptions.d.ts +46 -46
  35. package/dist/esm/components/BundleBlock/FixedBundle/VariantSelectorModal.d.ts +22 -22
  36. package/dist/esm/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +81 -81
  37. package/dist/esm/components/BundleBlock/Loader.d.ts +5 -5
  38. package/dist/esm/components/BundleBlock/MixAndMatchBundle/MixAndMatchBundle.d.ts +9 -9
  39. package/dist/esm/components/BundleBlock/MixAndMatchBundle/mixAndMatchBundle.style.d.ts +86 -86
  40. package/dist/esm/components/BundleBlock/PersonalizationForm/PersonalizationForm.d.ts +35 -35
  41. package/dist/esm/components/BundleBlock/PersonalizationForm/PersonalizationFormModal.d.ts +24 -24
  42. package/dist/esm/components/BundleBlock/VolumeBundle/VolumeBundle.d.ts +27 -27
  43. package/dist/esm/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +100 -100
  44. package/dist/esm/components/BundleBlock/index.d.ts +1 -1
  45. package/dist/esm/components/Cart/ApplyCoupon.d.ts +13 -13
  46. package/dist/esm/components/Cart/Bundle.d.ts +6 -6
  47. package/dist/esm/components/Cart/Cart.d.ts +259 -259
  48. package/dist/esm/components/Cart/CartDrawer.d.ts +34 -34
  49. package/dist/esm/components/Cart/CartOffersCarousel.d.ts +48 -48
  50. package/dist/esm/components/Cart/CartProductsList.d.ts +47 -47
  51. package/dist/esm/components/Cart/CartTimer.d.ts +8 -8
  52. package/dist/esm/components/Cart/CheckoutSection.d.ts +48 -48
  53. package/dist/esm/components/Cart/CouponSelection.d.ts +18 -18
  54. package/dist/esm/components/Cart/DatePicker.d.ts +10 -10
  55. package/dist/esm/components/Cart/EmptyCart.d.ts +34 -34
  56. package/dist/esm/components/Cart/FloatingCart.d.ts +24 -24
  57. package/dist/esm/components/Cart/FooterSections.d.ts +6 -6
  58. package/dist/esm/components/Cart/FreebieClaimManager.d.ts +18 -18
  59. package/dist/esm/components/Cart/FreebieClaimOverlay.d.ts +17 -17
  60. package/dist/esm/components/Cart/FreebieClaimOverlayCard.d.ts +10 -10
  61. package/dist/esm/components/Cart/FreebieClaimSection.d.ts +18 -18
  62. package/dist/esm/components/Cart/FreebieClaimSectionCard.d.ts +19 -19
  63. package/dist/esm/components/Cart/GSTSection.d.ts +15 -15
  64. package/dist/esm/components/Cart/GiftWrap.d.ts +15 -15
  65. package/dist/esm/components/Cart/InlineCartOfferInfoText.d.ts +10 -10
  66. package/dist/esm/components/Cart/LoyaltyAppliedCTA.d.ts +19 -19
  67. package/dist/esm/components/Cart/LoyaltyApplyCTA.d.ts +18 -18
  68. package/dist/esm/components/Cart/LoyaltyBadge.d.ts +10 -10
  69. package/dist/esm/components/Cart/LoyaltyGuestCTA.d.ts +17 -17
  70. package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointConfetti.d.ts +11 -11
  71. package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointIcon.d.ts +3 -3
  72. package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointTooltip.d.ts +3 -3
  73. package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepIcon.d.ts +9 -9
  74. package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.d.ts +5 -5
  75. package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.styled.d.ts +45 -45
  76. package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepUtils.d.ts +6 -6
  77. package/dist/esm/components/Cart/MultiStepProgressBar/MultiTierProgressBar.d.ts +4 -4
  78. package/dist/esm/components/Cart/MultiStepProgressBar/MutiTierNextRewardMessage.d.ts +3 -3
  79. package/dist/esm/components/Cart/MultiStepProgressBar/NextRewardMessage.d.ts +3 -3
  80. package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.d.ts +4 -4
  81. package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.styled.d.ts +22 -22
  82. package/dist/esm/components/Cart/MultiStepProgressBar/SingletTierNextRewardMessage.d.ts +3 -3
  83. package/dist/esm/components/Cart/MultiStepProgressBar/types.d.ts +55 -55
  84. package/dist/esm/components/Cart/NextFreebieRow.d.ts +21 -21
  85. package/dist/esm/components/Cart/NoteSection.d.ts +8 -8
  86. package/dist/esm/components/Cart/ProductCard.d.ts +30 -30
  87. package/dist/esm/components/Cart/ProductRecCard.d.ts +20 -20
  88. package/dist/esm/components/Cart/ProductRecList.d.ts +23 -23
  89. package/dist/esm/components/Cart/ProgressBarCartLoader.d.ts +7 -7
  90. package/dist/esm/components/Cart/QuantitySelector.d.ts +12 -12
  91. package/dist/esm/components/Cart/RegionSpecificDelivery.d.ts +17 -17
  92. package/dist/esm/components/Cart/RewardPointsPreview.d.ts +10 -10
  93. package/dist/esm/components/Cart/StandardDelivery.d.ts +11 -11
  94. package/dist/esm/components/Cart/StealDealSection.d.ts +15 -15
  95. package/dist/esm/components/Cart/StickyCart.d.ts +64 -64
  96. package/dist/esm/components/Cart/SubtotalSection.d.ts +13 -13
  97. package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.d.ts +20 -20
  98. package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.styled.d.ts +60 -60
  99. package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.d.ts +20 -20
  100. package/dist/esm/components/Cart/index.d.ts +1 -1
  101. package/dist/esm/components/Loyalty/ActiveSessionOverlay.d.ts +8 -8
  102. package/dist/esm/components/Loyalty/BubbleLauncher.d.ts +13 -13
  103. package/dist/esm/components/Loyalty/GuestDesktop.d.ts +5 -5
  104. package/dist/esm/components/Loyalty/GuestDesktopWithoutImage.d.ts +7 -7
  105. package/dist/esm/components/Loyalty/GuestMobile.d.ts +6 -6
  106. package/dist/esm/components/Loyalty/Loader.d.ts +10 -10
  107. package/dist/esm/components/Loyalty/LoyaltyProductCatalog.d.ts +68 -68
  108. package/dist/esm/components/Loyalty/LoyaltyProfile.d.ts +7 -7
  109. package/dist/esm/components/Loyalty/LoyaltyWidget.d.ts +6 -6
  110. package/dist/esm/components/Loyalty/OTPComponent.d.ts +20 -20
  111. package/dist/esm/components/Loyalty/PointEarnBadge.d.ts +15 -15
  112. package/dist/esm/components/Loyalty/RecentTransactions.d.ts +8 -8
  113. package/dist/esm/components/Loyalty/RewardsModal.d.ts +13 -13
  114. package/dist/esm/components/Loyalty/RibbonLauncher.d.ts +11 -11
  115. package/dist/esm/components/Loyalty/StickyLauncher.d.ts +13 -13
  116. package/dist/esm/components/Loyalty/StickyTextLauncher.d.ts +2 -2
  117. package/dist/esm/components/Loyalty/Toast.d.ts +7 -7
  118. package/dist/esm/components/Loyalty/VIPTiersScreen.d.ts +11 -11
  119. package/dist/esm/components/Loyalty/WTRCoupon.d.ts +13 -13
  120. package/dist/esm/components/Loyalty/WaysToEarn.d.ts +32 -32
  121. package/dist/esm/components/Loyalty/WaysToRedeem.d.ts +78 -78
  122. package/dist/esm/components/Loyalty/index.d.ts +7 -7
  123. package/dist/esm/components/Loyalty/loyaltyLauncher.d.ts +16 -16
  124. package/dist/esm/components/Loyalty/styles/ActiveSession.styles.d.ts +3 -3
  125. package/dist/esm/components/Loyalty/styles/DobPopup.styles.d.ts +3 -3
  126. package/dist/esm/components/Loyalty/styles/PointEarnBadge.styles.d.ts +3 -3
  127. package/dist/esm/components/Loyalty/styles/RecentTransactions.styles.d.ts +6 -6
  128. package/dist/esm/components/Loyalty/styles/VIPTiers.styles.d.ts +4 -4
  129. package/dist/esm/components/Loyalty/styles/WaysToRedeem.styles.d.ts +5 -5
  130. package/dist/esm/components/Loyalty/styles/shared.styles.d.ts +3 -3
  131. package/dist/esm/components/Loyalty/types.d.ts +401 -401
  132. package/dist/esm/components/LoyaltyPageBlock/LoyaltyPageBlock.d.ts +153 -153
  133. package/dist/esm/components/Nudge/LeadGenerationNudge.d.ts +15 -15
  134. package/dist/esm/components/Nudge/Nudge.d.ts +40 -40
  135. package/dist/esm/components/Nudge/index.d.ts +1 -1
  136. package/dist/esm/components/ProductOffersBlock/ProductOffersCoupon.d.ts +12 -12
  137. package/dist/esm/components/ProductOffersBlock/ProductOffersList.d.ts +12 -12
  138. package/dist/esm/components/ProductOffersBlock/ProductOffersTermsMobilePopover.d.ts +10 -10
  139. package/dist/esm/components/ProductOffersBlock/ProductOffersTermsPopup.d.ts +10 -10
  140. package/dist/esm/components/ProductOffersBlock/ProductsOffers.d.ts +42 -42
  141. package/dist/esm/components/SpinnerWheel/SpinnerWheel.d.ts +23 -23
  142. package/dist/esm/components/SpinnerWheel/WheelSection.d.ts +9 -9
  143. package/dist/esm/components/SpinnerWheel/index.d.ts +1 -1
  144. package/dist/esm/components/index.d.ts +14 -14
  145. package/dist/esm/index.d.ts +1 -1
  146. package/dist/esm/index.js +111 -111
  147. package/dist/esm/utils/converter.d.ts +2 -2
  148. package/dist/esm/utils/customVariantOptions.d.ts +21 -21
  149. package/dist/esm/utils/freebieProductUtils.d.ts +39 -39
  150. package/dist/esm/utils/freebieUtils.d.ts +11 -11
  151. package/dist/esm/utils/index.d.ts +14 -14
  152. package/package.json +98 -98
  153. /package/dist/esm/{confetti-89678a6f.js → confetti-f3502561.js} +0 -0
@@ -1,462 +1,462 @@
1
- import React from "react";
2
- import "./bundle.scss";
3
- import { FilterGroup } from "./BundleBuilder/SortAndFilter";
4
- interface ShopifyCurrency {
5
- rate: number;
6
- active: string;
7
- }
8
- declare global {
9
- interface Window {
10
- Shopify?: {
11
- currency?: ShopifyCurrency;
12
- shop?: string;
13
- };
14
- }
15
- }
16
- type ProductImage = {
17
- url: string;
18
- height: number;
19
- width: number;
20
- altText?: string;
21
- };
22
- type ProductFeaturedMedia = {
23
- alt: string;
24
- preview: {
25
- image: {
26
- url: string;
27
- height?: number;
28
- width?: number;
29
- altText: string;
30
- };
31
- };
32
- };
33
- type ProductOption = {
34
- id: string;
35
- name: string;
36
- values: string[];
37
- };
38
- type CollectionNode = {
39
- node: {
40
- id: string;
41
- title: string;
42
- handle: string;
43
- };
44
- };
45
- export type VariantNode = {
46
- node: {
47
- id: string;
48
- price: string;
49
- compareAtPrice: string;
50
- title: string;
51
- displayName: string;
52
- image: ProductImage;
53
- availableForSale: boolean;
54
- inventoryQuantity: number;
55
- inventoryItem?: {
56
- tracked?: boolean;
57
- };
58
- inventoryPolicy?: "deny" | "continue";
59
- };
60
- };
61
- type SelectedVariantDetails = {
62
- id: string;
63
- price: string;
64
- compareAtPrice: string;
65
- title: string;
66
- displayName: string;
67
- image: ProductImage;
68
- availableForSale: boolean;
69
- inventoryQuantity: number;
70
- };
71
- export type VariantOptions = {
72
- shop: string;
73
- options: {
74
- name: string;
75
- type: "text" | "image" | "color";
76
- values: {
77
- name: string;
78
- value: string;
79
- }[];
80
- }[];
81
- createdAt: string;
82
- updatedAt: string;
83
- };
84
- export type ProductDetails = {
85
- id: string;
86
- title: string;
87
- handle: string;
88
- featuredMedia: ProductFeaturedMedia;
89
- status: "active" | "archived" | "draft" | "unlisted" | "";
90
- options: ProductOption[];
91
- onlineStoreUrl: string;
92
- tracksInventory?: boolean;
93
- publishedAt?: string | null;
94
- collections: {
95
- edges: CollectionNode[];
96
- };
97
- variants: {
98
- edges: VariantNode[];
99
- };
100
- shop: string;
101
- metafield?: {
102
- key: string;
103
- namespace: string;
104
- ownerType: string;
105
- value: string;
106
- id: string;
107
- jsonValue: string[];
108
- type: string;
109
- };
110
- descriptionHtml: string;
111
- media: {
112
- edges: {
113
- node: {
114
- alt: string;
115
- preview: {
116
- image: {
117
- altText: string;
118
- width?: number;
119
- height?: number;
120
- url: string;
121
- };
122
- };
123
- image: {
124
- altText: string;
125
- height: number;
126
- width: number;
127
- url: string;
128
- };
129
- };
130
- }[];
131
- };
132
- selectedVariant?: SelectedVariantDetails;
133
- rating?: {
134
- averageRating: number;
135
- ratingCount: number;
136
- };
137
- };
138
- export type ProductData = {
139
- productId: string;
140
- variantIds: string[];
141
- productDetails: ProductDetails;
142
- };
143
- type GeneralStyle = {
144
- primaryColor: string;
145
- primaryContrastColor: string;
146
- secondaryColor: string;
147
- secondaryContrastColor: string;
148
- imageAspectRatio: string;
149
- ctaBackgroundColor: string;
150
- ctaTextColor: string;
151
- ctaBorderColor: string;
152
- ctaShadowType: string;
153
- ctaPadding: string;
154
- ctaWidth: string;
155
- ctaBorderRadius: string;
156
- ctaHoverBackgroundColor: string;
157
- ctaHoverTextColor: string;
158
- customizeHoverState: boolean;
159
- checkoutPartner: string;
160
- redirectToPDP: boolean;
161
- restrictCOD: boolean;
162
- trackInventory: boolean;
163
- showOutOfStockProducts: boolean;
164
- outOfStockLabel: string;
165
- disabledButtonColor: string;
166
- storeCurrency: string;
167
- currencySymbol: string;
168
- discountPrefix: string;
169
- discountSuffix: string;
170
- addOrderTags: boolean;
171
- addOrderNotes: boolean;
172
- variantTitleSuffix: boolean;
173
- titleLength: string;
174
- showDecimalsInBundlePricing?: boolean;
175
- showPaymentIcons?: boolean;
176
- };
177
- type VolumeStyle = {
178
- addtoCartMethod: string;
179
- titleFontSize: string;
180
- subtitleFontSize: string;
181
- titleBackgroundColor: string;
182
- titleTextColor: string;
183
- verticalMargin: string;
184
- sectionBackgroundColor: string;
185
- cardStyle: string;
186
- discountBadgeVisibility: string;
187
- tierPriceType: "none" | "unit-price" | "tier-price";
188
- allowVariantSelection: string;
189
- variantSelectorType: string;
190
- ctaTitle: string;
191
- bundleRedirection: string;
192
- discountBadgeDisplay: string;
193
- discountDisplayType: string;
194
- freebieDisplayType?: "compact" | "detailed";
195
- showVariantOptionsLabel: boolean;
196
- };
197
- type ComboStyle = {
198
- productTitleFontSize: string;
199
- productDescriptionFontSize: string;
200
- descriptionTextColor: string;
201
- titleTextColor: string;
202
- verticalMargin: string;
203
- infoAlignment: string;
204
- ctaTitle: string;
205
- bundleRedirection: string;
206
- embedContentVisibility: boolean;
207
- mixAndMatchCardStyle: string;
208
- mixAndMatchVariantTypeSelector: string;
209
- comboCardStyle: string;
210
- comboVariantTypeSelector: string;
211
- selectedEmbedContentVisibilityOptions: string[];
212
- subProductsSectionVisibility: boolean;
213
- subProductsImageVisibility: boolean;
214
- subProductsProductTitleVisibility: boolean;
215
- subProductsProductPriceVisibility: boolean;
216
- discountBadgeVisibility?: boolean;
217
- discountBadgeDisplay?: "discount-on-compare" | "discount-on-price";
218
- discountDisplayType?: "percentage" | "amount";
219
- comboProductRatingsDisplay?: string;
220
- mixAndMatchProductRatingsDisplay?: string;
221
- };
222
- type ByobStyle = {
223
- titleFontSize: string;
224
- subtitleFontSize: string;
225
- titleBackgroundColor: string;
226
- titleTextColor: string;
227
- productTitleFontSize: string;
228
- showVariantTitleInCard: boolean;
229
- productVariantTitleType: "product-title" | "variant-title" | "variant-display-name";
230
- productTitleWrapLines: string;
231
- productCardDetailsAlignment: "left" | "center" | "right";
232
- sectionBackgroundColor: string;
233
- lazyLoadWidget: string;
234
- listingsGap: string;
235
- footerMargin: string;
236
- borderRadius: string;
237
- borderColor: string;
238
- cardBackgroundColor: string;
239
- shadowType: string;
240
- addToBundleCTAText: string;
241
- checkoutCTAText: string;
242
- variantSelectorType: string;
243
- primaryVariant: string;
244
- productsPriceVisibility: boolean;
245
- compareAtPriceVisibility: boolean;
246
- selectedProductsVisibility: boolean;
247
- bundleRedirection: string;
248
- enableConfetti: boolean;
249
- selectedItemVisibility: boolean;
250
- productTiersVisibility: boolean;
251
- tierNavigation: boolean;
252
- enableProductCategories: boolean;
253
- productCardCategoryVisibility: string;
254
- categoryFilterOnPage: string;
255
- productFiltersDisplay: "none" | "drawer" | "sidebar";
256
- filtersProvider: "based-on-products-data" | "search-and-discovery-app-sync";
257
- selectedFilterOptions: string[];
258
- productRatingsDisplay?: string;
259
- discountBadgeVisibility?: boolean;
260
- discountBadgeDisplay?: "discount-on-compare" | "discount-on-price";
261
- discountDisplayType?: string;
262
- fetchAllProductsAtOnce?: boolean;
263
- };
264
- type FixedStyle = {
265
- titleFontSize: string;
266
- subtitleFontSize: string;
267
- titleBackgroundColor: string;
268
- titleTextColor: string;
269
- verticalMargin: string;
270
- sectionBackgroundColor: string;
271
- borderRadius: string;
272
- borderColor: string;
273
- cardBackgroundColor: string;
274
- shadowType: string;
275
- infoAlignment: string;
276
- ctaTitle: string;
277
- bundleRedirection: string;
278
- cardLayoutStyle: string;
279
- variantSelectorType: string;
280
- productsPriceVisibility: boolean;
281
- compareAtPriceVisibility: boolean;
282
- discountBadgeVisibility?: boolean;
283
- discountDisplayType?: string;
284
- discountBadgeDisplay?: "discount-on-compare" | "discount-on-price";
285
- productRatingsDisplay?: string;
286
- };
287
- export type Customizations = {
288
- shop?: string;
289
- general: GeneralStyle;
290
- byob: ByobStyle;
291
- fixedBundle: FixedStyle;
292
- volumeBundle: VolumeStyle;
293
- comboBundle: ComboStyle;
294
- createdAt?: string;
295
- updatedAt?: string;
296
- };
297
- export type ProductTier = {
298
- tier: number;
299
- title: string;
300
- minimumQuantity: number;
301
- isFixed?: boolean;
302
- isFreebieTier?: boolean;
303
- products: {
304
- productId: string;
305
- variantIds: string[];
306
- }[];
307
- };
308
- export type BundlePayload = {
309
- _id: string;
310
- showIndividualProductSelector: boolean;
311
- title?: string;
312
- subtitle?: string;
313
- products: ProductData[];
314
- freebieProducts?: ProductData[];
315
- percentageOff?: number;
316
- dealAmount?: number;
317
- amountOff?: number;
318
- type: "fixed" | "builder" | "volume" | "mixAndMatch" | "" | "combo" | "collection";
319
- minimumQuantity: number;
320
- showProductDetailsInTracker: boolean;
321
- coverImageUrl?: string;
322
- mobileCoverImageUrl?: string;
323
- titleSectionTextColor?: string;
324
- titleSectionBackgroundColor?: string;
325
- dealTextColor?: string;
326
- showBorder?: boolean;
327
- hideProductDetails?: boolean;
328
- cornerRadiusType?: "medium" | "high" | "";
329
- primaryBackgroundColorCta?: string;
330
- enableProgressBar?: boolean;
331
- enableSortAndFilter?: boolean;
332
- disableQuantitySelector?: boolean;
333
- disableInventoryTracking?: boolean;
334
- alignFixedBundleContent?: "left" | "right" | "center" | "";
335
- imageAspectType?: "portrait" | "square" | "";
336
- backgroundColorFixedBundleDiv?: string;
337
- canCustomizeFixedBundle?: boolean;
338
- primaryTextColorCta?: string;
339
- showVariants?: boolean;
340
- discountType?: string;
341
- showCta?: boolean;
342
- productCardBadgeText?: string;
343
- coverImageVerticalMargin?: string;
344
- builderTiers?: {
345
- type: string;
346
- offerTier?: {
347
- tier: number;
348
- minimumQuantity: number;
349
- discountValue: number;
350
- }[];
351
- productTier?: ProductTier[];
352
- };
353
- volumeTiers?: {
354
- isDefault: unknown;
355
- tier: number;
356
- minimumQuantity: number;
357
- title: string;
358
- subtitle: string;
359
- badgeTitle: string;
360
- discountValue: number;
361
- imageUrl?: string;
362
- freebieProductIds?: string[];
363
- }[];
364
- mixAndMatchTiers?: {
365
- tier: number;
366
- title: string;
367
- products: {
368
- productId: string;
369
- variantIds: string[];
370
- }[];
371
- }[];
372
- customizations: Customizations;
373
- variantOptions?: VariantOptions;
374
- storeCurrencyCode?: string;
375
- customStoreDetails?: {
376
- [key: string]: any;
377
- };
378
- customProductsQuantity?: number | null;
379
- reviewRatingType?: "none" | "ratingOnly" | "ratingAndReviewCount";
380
- appName?: string;
381
- workWithoutPagination?: boolean;
382
- pageHeader?: {
383
- title?: string;
384
- description?: string;
385
- customizePadding?: string;
386
- };
387
- personalizedForm?: {
388
- title?: string;
389
- sections?: {
390
- title: string;
391
- type: "text" | "image";
392
- fields: {
393
- title: string;
394
- }[];
395
- }[];
396
- };
397
- };
398
- export type EventNameCustom = "byob_checkout_cta" | "byob_add_to_bundle" | "block_visibility" | "bundle_add_to_cart";
399
- export type EventTypeCustom = "clicks" | "views";
400
- export type AnalyticsEventParams = {
401
- eventNameCustom: EventNameCustom;
402
- eventTypeCustom: EventTypeCustom;
403
- data: any;
404
- };
405
- export type CursorData = Record<number, {
406
- cursor: string;
407
- hasNext: boolean;
408
- }>;
409
- export type BundleProps = {
410
- bundle: BundlePayload;
411
- addToCartFunction?: (selectedItemsSubtotal: number, variantIds?: string[], finalBundlePrice?: number, variantIdPriceMap?: {
412
- variantId: string;
413
- price: number;
414
- }[], properties?: Record<string, string>, freebieProduct?: string[]) => Promise<void>;
415
- addCustomBundleToCart?: (e: any, formProperties?: Record<string, any>) => Promise<void>;
416
- selectedItems?: {
417
- variantId: string;
418
- product: ProductDetails;
419
- quantity: number;
420
- }[];
421
- setSelectedItems?: React.Dispatch<React.SetStateAction<{
422
- variantId: string;
423
- product: ProductDetails;
424
- quantity: number;
425
- }[]>>;
426
- bundleAddToCartLoading?: boolean;
427
- handleRemoveItem?: (variantId: string) => void;
428
- selectedItemsQuantity?: number;
429
- renderingOnPage?: boolean;
430
- bundleSubtotal?: {
431
- price: number;
432
- compareAtPrice: number;
433
- };
434
- bundleHeaderBackgroundColor?: string;
435
- currentProductId?: string;
436
- dispatchAnalyticsEvent?: (params: AnalyticsEventParams) => void;
437
- fetchStoreDetails?: () => Promise<any>;
438
- productsPagination?: {
439
- initialCursorData: CursorData;
440
- cursorData: CursorData;
441
- fetchFn: (filters?: any, bundleTier?: number, cursor?: string | null) => Promise<ProductData[]>;
442
- setCursorData: (cursorData: CursorData) => void;
443
- };
444
- categoryFilters?: Record<number, FilterGroup | FilterGroup[]>;
445
- };
446
- export declare const currencyPrice: (price: number | string | undefined) => string | undefined;
447
- export declare const getCurrencySymbol: (genSymbol: string, _storeCurrencyCode?: string) => string;
448
- export declare const optimiseImage: (url: string, width?: number) => string;
449
- export declare const handleAddToBundle: (variantId: string, product: ProductDetails, quantity: number, selectedItems: {
450
- variantId: string;
451
- product: ProductDetails;
452
- quantity: number;
453
- tierIndex?: number | undefined;
454
- }[], setSelectedItems: React.Dispatch<React.SetStateAction<{
455
- variantId: string;
456
- product: ProductDetails;
457
- quantity: number;
458
- isFree?: boolean | undefined;
459
- tierIndex?: number | undefined;
460
- }[]>>, isFreebie?: boolean, tierIndex?: number) => void;
461
- declare const Bundle: React.FC<BundleProps>;
462
- export default Bundle;
1
+ import React from "react";
2
+ import "./bundle.scss";
3
+ import { FilterGroup } from "./BundleBuilder/SortAndFilter";
4
+ interface ShopifyCurrency {
5
+ rate: number;
6
+ active: string;
7
+ }
8
+ declare global {
9
+ interface Window {
10
+ Shopify?: {
11
+ currency?: ShopifyCurrency;
12
+ shop?: string;
13
+ };
14
+ }
15
+ }
16
+ type ProductImage = {
17
+ url: string;
18
+ height: number;
19
+ width: number;
20
+ altText?: string;
21
+ };
22
+ type ProductFeaturedMedia = {
23
+ alt: string;
24
+ preview: {
25
+ image: {
26
+ url: string;
27
+ height?: number;
28
+ width?: number;
29
+ altText: string;
30
+ };
31
+ };
32
+ };
33
+ type ProductOption = {
34
+ id: string;
35
+ name: string;
36
+ values: string[];
37
+ };
38
+ type CollectionNode = {
39
+ node: {
40
+ id: string;
41
+ title: string;
42
+ handle: string;
43
+ };
44
+ };
45
+ export type VariantNode = {
46
+ node: {
47
+ id: string;
48
+ price: string;
49
+ compareAtPrice: string;
50
+ title: string;
51
+ displayName: string;
52
+ image: ProductImage;
53
+ availableForSale: boolean;
54
+ inventoryQuantity: number;
55
+ inventoryItem?: {
56
+ tracked?: boolean;
57
+ };
58
+ inventoryPolicy?: "deny" | "continue";
59
+ };
60
+ };
61
+ type SelectedVariantDetails = {
62
+ id: string;
63
+ price: string;
64
+ compareAtPrice: string;
65
+ title: string;
66
+ displayName: string;
67
+ image: ProductImage;
68
+ availableForSale: boolean;
69
+ inventoryQuantity: number;
70
+ };
71
+ export type VariantOptions = {
72
+ shop: string;
73
+ options: {
74
+ name: string;
75
+ type: "text" | "image" | "color";
76
+ values: {
77
+ name: string;
78
+ value: string;
79
+ }[];
80
+ }[];
81
+ createdAt: string;
82
+ updatedAt: string;
83
+ };
84
+ export type ProductDetails = {
85
+ id: string;
86
+ title: string;
87
+ handle: string;
88
+ featuredMedia: ProductFeaturedMedia;
89
+ status: "active" | "archived" | "draft" | "unlisted" | "";
90
+ options: ProductOption[];
91
+ onlineStoreUrl: string;
92
+ tracksInventory?: boolean;
93
+ publishedAt?: string | null;
94
+ collections: {
95
+ edges: CollectionNode[];
96
+ };
97
+ variants: {
98
+ edges: VariantNode[];
99
+ };
100
+ shop: string;
101
+ metafield?: {
102
+ key: string;
103
+ namespace: string;
104
+ ownerType: string;
105
+ value: string;
106
+ id: string;
107
+ jsonValue: string[];
108
+ type: string;
109
+ };
110
+ descriptionHtml: string;
111
+ media: {
112
+ edges: {
113
+ node: {
114
+ alt: string;
115
+ preview: {
116
+ image: {
117
+ altText: string;
118
+ width?: number;
119
+ height?: number;
120
+ url: string;
121
+ };
122
+ };
123
+ image: {
124
+ altText: string;
125
+ height: number;
126
+ width: number;
127
+ url: string;
128
+ };
129
+ };
130
+ }[];
131
+ };
132
+ selectedVariant?: SelectedVariantDetails;
133
+ rating?: {
134
+ averageRating: number;
135
+ ratingCount: number;
136
+ };
137
+ };
138
+ export type ProductData = {
139
+ productId: string;
140
+ variantIds: string[];
141
+ productDetails: ProductDetails;
142
+ };
143
+ type GeneralStyle = {
144
+ primaryColor: string;
145
+ primaryContrastColor: string;
146
+ secondaryColor: string;
147
+ secondaryContrastColor: string;
148
+ imageAspectRatio: string;
149
+ ctaBackgroundColor: string;
150
+ ctaTextColor: string;
151
+ ctaBorderColor: string;
152
+ ctaShadowType: string;
153
+ ctaPadding: string;
154
+ ctaWidth: string;
155
+ ctaBorderRadius: string;
156
+ ctaHoverBackgroundColor: string;
157
+ ctaHoverTextColor: string;
158
+ customizeHoverState: boolean;
159
+ checkoutPartner: string;
160
+ redirectToPDP: boolean;
161
+ restrictCOD: boolean;
162
+ trackInventory: boolean;
163
+ showOutOfStockProducts: boolean;
164
+ outOfStockLabel: string;
165
+ disabledButtonColor: string;
166
+ storeCurrency: string;
167
+ currencySymbol: string;
168
+ discountPrefix: string;
169
+ discountSuffix: string;
170
+ addOrderTags: boolean;
171
+ addOrderNotes: boolean;
172
+ variantTitleSuffix: boolean;
173
+ titleLength: string;
174
+ showDecimalsInBundlePricing?: boolean;
175
+ showPaymentIcons?: boolean;
176
+ };
177
+ type VolumeStyle = {
178
+ addtoCartMethod: string;
179
+ titleFontSize: string;
180
+ subtitleFontSize: string;
181
+ titleBackgroundColor: string;
182
+ titleTextColor: string;
183
+ verticalMargin: string;
184
+ sectionBackgroundColor: string;
185
+ cardStyle: string;
186
+ discountBadgeVisibility: string;
187
+ tierPriceType: "none" | "unit-price" | "tier-price";
188
+ allowVariantSelection: string;
189
+ variantSelectorType: string;
190
+ ctaTitle: string;
191
+ bundleRedirection: string;
192
+ discountBadgeDisplay: string;
193
+ discountDisplayType: string;
194
+ freebieDisplayType?: "compact" | "detailed";
195
+ showVariantOptionsLabel: boolean;
196
+ };
197
+ type ComboStyle = {
198
+ productTitleFontSize: string;
199
+ productDescriptionFontSize: string;
200
+ descriptionTextColor: string;
201
+ titleTextColor: string;
202
+ verticalMargin: string;
203
+ infoAlignment: string;
204
+ ctaTitle: string;
205
+ bundleRedirection: string;
206
+ embedContentVisibility: boolean;
207
+ mixAndMatchCardStyle: string;
208
+ mixAndMatchVariantTypeSelector: string;
209
+ comboCardStyle: string;
210
+ comboVariantTypeSelector: string;
211
+ selectedEmbedContentVisibilityOptions: string[];
212
+ subProductsSectionVisibility: boolean;
213
+ subProductsImageVisibility: boolean;
214
+ subProductsProductTitleVisibility: boolean;
215
+ subProductsProductPriceVisibility: boolean;
216
+ discountBadgeVisibility?: boolean;
217
+ discountBadgeDisplay?: "discount-on-compare" | "discount-on-price";
218
+ discountDisplayType?: "percentage" | "amount";
219
+ comboProductRatingsDisplay?: string;
220
+ mixAndMatchProductRatingsDisplay?: string;
221
+ };
222
+ type ByobStyle = {
223
+ titleFontSize: string;
224
+ subtitleFontSize: string;
225
+ titleBackgroundColor: string;
226
+ titleTextColor: string;
227
+ productTitleFontSize: string;
228
+ showVariantTitleInCard: boolean;
229
+ productVariantTitleType: "product-title" | "variant-title" | "variant-display-name";
230
+ productTitleWrapLines: string;
231
+ productCardDetailsAlignment: "left" | "center" | "right";
232
+ sectionBackgroundColor: string;
233
+ lazyLoadWidget: string;
234
+ listingsGap: string;
235
+ footerMargin: string;
236
+ borderRadius: string;
237
+ borderColor: string;
238
+ cardBackgroundColor: string;
239
+ shadowType: string;
240
+ addToBundleCTAText: string;
241
+ checkoutCTAText: string;
242
+ variantSelectorType: string;
243
+ primaryVariant: string;
244
+ productsPriceVisibility: boolean;
245
+ compareAtPriceVisibility: boolean;
246
+ selectedProductsVisibility: boolean;
247
+ bundleRedirection: string;
248
+ enableConfetti: boolean;
249
+ selectedItemVisibility: boolean;
250
+ productTiersVisibility: boolean;
251
+ tierNavigation: boolean;
252
+ enableProductCategories: boolean;
253
+ productCardCategoryVisibility: string;
254
+ categoryFilterOnPage: string;
255
+ productFiltersDisplay: "none" | "drawer" | "sidebar";
256
+ filtersProvider: "based-on-products-data" | "search-and-discovery-app-sync";
257
+ selectedFilterOptions: string[];
258
+ productRatingsDisplay?: string;
259
+ discountBadgeVisibility?: boolean;
260
+ discountBadgeDisplay?: "discount-on-compare" | "discount-on-price";
261
+ discountDisplayType?: string;
262
+ fetchAllProductsAtOnce?: boolean;
263
+ };
264
+ type FixedStyle = {
265
+ titleFontSize: string;
266
+ subtitleFontSize: string;
267
+ titleBackgroundColor: string;
268
+ titleTextColor: string;
269
+ verticalMargin: string;
270
+ sectionBackgroundColor: string;
271
+ borderRadius: string;
272
+ borderColor: string;
273
+ cardBackgroundColor: string;
274
+ shadowType: string;
275
+ infoAlignment: string;
276
+ ctaTitle: string;
277
+ bundleRedirection: string;
278
+ cardLayoutStyle: string;
279
+ variantSelectorType: string;
280
+ productsPriceVisibility: boolean;
281
+ compareAtPriceVisibility: boolean;
282
+ discountBadgeVisibility?: boolean;
283
+ discountDisplayType?: string;
284
+ discountBadgeDisplay?: "discount-on-compare" | "discount-on-price";
285
+ productRatingsDisplay?: string;
286
+ };
287
+ export type Customizations = {
288
+ shop?: string;
289
+ general: GeneralStyle;
290
+ byob: ByobStyle;
291
+ fixedBundle: FixedStyle;
292
+ volumeBundle: VolumeStyle;
293
+ comboBundle: ComboStyle;
294
+ createdAt?: string;
295
+ updatedAt?: string;
296
+ };
297
+ export type ProductTier = {
298
+ tier: number;
299
+ title: string;
300
+ minimumQuantity: number;
301
+ isFixed?: boolean;
302
+ isFreebieTier?: boolean;
303
+ products: {
304
+ productId: string;
305
+ variantIds: string[];
306
+ }[];
307
+ };
308
+ export type BundlePayload = {
309
+ _id: string;
310
+ showIndividualProductSelector: boolean;
311
+ title?: string;
312
+ subtitle?: string;
313
+ products: ProductData[];
314
+ freebieProducts?: ProductData[];
315
+ percentageOff?: number;
316
+ dealAmount?: number;
317
+ amountOff?: number;
318
+ type: "fixed" | "builder" | "volume" | "mixAndMatch" | "" | "combo" | "collection";
319
+ minimumQuantity: number;
320
+ showProductDetailsInTracker: boolean;
321
+ coverImageUrl?: string;
322
+ mobileCoverImageUrl?: string;
323
+ titleSectionTextColor?: string;
324
+ titleSectionBackgroundColor?: string;
325
+ dealTextColor?: string;
326
+ showBorder?: boolean;
327
+ hideProductDetails?: boolean;
328
+ cornerRadiusType?: "medium" | "high" | "";
329
+ primaryBackgroundColorCta?: string;
330
+ enableProgressBar?: boolean;
331
+ enableSortAndFilter?: boolean;
332
+ disableQuantitySelector?: boolean;
333
+ disableInventoryTracking?: boolean;
334
+ alignFixedBundleContent?: "left" | "right" | "center" | "";
335
+ imageAspectType?: "portrait" | "square" | "";
336
+ backgroundColorFixedBundleDiv?: string;
337
+ canCustomizeFixedBundle?: boolean;
338
+ primaryTextColorCta?: string;
339
+ showVariants?: boolean;
340
+ discountType?: string;
341
+ showCta?: boolean;
342
+ productCardBadgeText?: string;
343
+ coverImageVerticalMargin?: string;
344
+ builderTiers?: {
345
+ type: string;
346
+ offerTier?: {
347
+ tier: number;
348
+ minimumQuantity: number;
349
+ discountValue: number;
350
+ }[];
351
+ productTier?: ProductTier[];
352
+ };
353
+ volumeTiers?: {
354
+ isDefault: unknown;
355
+ tier: number;
356
+ minimumQuantity: number;
357
+ title: string;
358
+ subtitle: string;
359
+ badgeTitle: string;
360
+ discountValue: number;
361
+ imageUrl?: string;
362
+ freebieProductIds?: string[];
363
+ }[];
364
+ mixAndMatchTiers?: {
365
+ tier: number;
366
+ title: string;
367
+ products: {
368
+ productId: string;
369
+ variantIds: string[];
370
+ }[];
371
+ }[];
372
+ customizations: Customizations;
373
+ variantOptions?: VariantOptions;
374
+ storeCurrencyCode?: string;
375
+ customStoreDetails?: {
376
+ [key: string]: any;
377
+ };
378
+ customProductsQuantity?: number | null;
379
+ reviewRatingType?: "none" | "ratingOnly" | "ratingAndReviewCount";
380
+ appName?: string;
381
+ workWithoutPagination?: boolean;
382
+ pageHeader?: {
383
+ title?: string;
384
+ description?: string;
385
+ customizePadding?: string;
386
+ };
387
+ personalizedForm?: {
388
+ title?: string;
389
+ sections?: {
390
+ title: string;
391
+ type: "text" | "image";
392
+ fields: {
393
+ title: string;
394
+ }[];
395
+ }[];
396
+ };
397
+ };
398
+ export type EventNameCustom = "byob_checkout_cta" | "byob_add_to_bundle" | "block_visibility" | "bundle_add_to_cart";
399
+ export type EventTypeCustom = "clicks" | "views";
400
+ export type AnalyticsEventParams = {
401
+ eventNameCustom: EventNameCustom;
402
+ eventTypeCustom: EventTypeCustom;
403
+ data: any;
404
+ };
405
+ export type CursorData = Record<number, {
406
+ cursor: string;
407
+ hasNext: boolean;
408
+ }>;
409
+ export type BundleProps = {
410
+ bundle: BundlePayload;
411
+ addToCartFunction?: (selectedItemsSubtotal: number, variantIds?: string[], finalBundlePrice?: number, variantIdPriceMap?: {
412
+ variantId: string;
413
+ price: number;
414
+ }[], properties?: Record<string, string>, freebieProduct?: string[]) => Promise<void>;
415
+ addCustomBundleToCart?: (e: any, formProperties?: Record<string, any>) => Promise<void>;
416
+ selectedItems?: {
417
+ variantId: string;
418
+ product: ProductDetails;
419
+ quantity: number;
420
+ }[];
421
+ setSelectedItems?: React.Dispatch<React.SetStateAction<{
422
+ variantId: string;
423
+ product: ProductDetails;
424
+ quantity: number;
425
+ }[]>>;
426
+ bundleAddToCartLoading?: boolean;
427
+ handleRemoveItem?: (variantId: string) => void;
428
+ selectedItemsQuantity?: number;
429
+ renderingOnPage?: boolean;
430
+ bundleSubtotal?: {
431
+ price: number;
432
+ compareAtPrice: number;
433
+ };
434
+ bundleHeaderBackgroundColor?: string;
435
+ currentProductId?: string;
436
+ dispatchAnalyticsEvent?: (params: AnalyticsEventParams) => void;
437
+ fetchStoreDetails?: () => Promise<any>;
438
+ productsPagination?: {
439
+ initialCursorData: CursorData;
440
+ cursorData: CursorData;
441
+ fetchFn: (filters?: any, bundleTier?: number, cursor?: string | null) => Promise<ProductData[]>;
442
+ setCursorData: (cursorData: CursorData) => void;
443
+ };
444
+ categoryFilters?: Record<number, FilterGroup | FilterGroup[]>;
445
+ };
446
+ export declare const currencyPrice: (price: number | string | undefined) => string | undefined;
447
+ export declare const getCurrencySymbol: (genSymbol: string, _storeCurrencyCode?: string) => string;
448
+ export declare const optimiseImage: (url: string, width?: number) => string;
449
+ export declare const handleAddToBundle: (variantId: string, product: ProductDetails, quantity: number, selectedItems: {
450
+ variantId: string;
451
+ product: ProductDetails;
452
+ quantity: number;
453
+ tierIndex?: number | undefined;
454
+ }[], setSelectedItems: React.Dispatch<React.SetStateAction<{
455
+ variantId: string;
456
+ product: ProductDetails;
457
+ quantity: number;
458
+ isFree?: boolean | undefined;
459
+ tierIndex?: number | undefined;
460
+ }[]>>, isFreebie?: boolean, tierIndex?: number) => void;
461
+ declare const Bundle: React.FC<BundleProps>;
462
+ export default Bundle;