yt-uikit 0.8.71 → 0.8.72-optimistic.0

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