yt-uikit 0.8.15-productTier-freebie-update.7 → 0.8.15

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.
@@ -264,17 +264,6 @@ export type Customizations = {
264
264
  createdAt?: string;
265
265
  updatedAt?: string;
266
266
  };
267
- export type ProductTier = {
268
- tier: number;
269
- title: string;
270
- minimumQuantity: number;
271
- isFixed?: boolean;
272
- isFreebieTier?: boolean;
273
- products: {
274
- productId: string;
275
- variantIds: string[];
276
- }[];
277
- };
278
267
  export type BundlePayload = {
279
268
  showIndividualProductSelector: boolean;
280
269
  title?: string;
@@ -316,7 +305,17 @@ export type BundlePayload = {
316
305
  minimumQuantity: number;
317
306
  discountValue: number;
318
307
  }[];
319
- productTier?: ProductTier[];
308
+ productTier?: {
309
+ tier: number;
310
+ title: string;
311
+ minimumQuantity: number;
312
+ isFixed?: boolean;
313
+ isFreebieTier?: boolean;
314
+ products: {
315
+ productId: string;
316
+ variantIds: string[];
317
+ }[];
318
+ }[];
320
319
  };
321
320
  volumeTiers?: {
322
321
  isDefault: unknown;
@@ -8,9 +8,6 @@ type BundleProductDetailsModalProps = {
8
8
  product: ProductDetails;
9
9
  quantity: number;
10
10
  }[];
11
- selectedProductsByTier?: {
12
- [tier: number]: string[];
13
- };
14
11
  remainingQuantity: number;
15
12
  hideAddToBundle: boolean;
16
13
  disableQuantitySelector: boolean;
@@ -24,13 +21,6 @@ type BundleProductDetailsModalProps = {
24
21
  averageRating: number;
25
22
  ratingCount: number;
26
23
  };
27
- customVariantsQuantity?: {
28
- quantity: number;
29
- variantId: string;
30
- }[];
31
- bundleProductsCustomQuantity?: number | null;
32
- isFreebieTier?: boolean;
33
- showFreebieTierProductPrices?: boolean;
34
24
  };
35
25
  declare const BundleProductDetailsModal: React.ForwardRefExoticComponent<BundleProductDetailsModalProps & React.RefAttributes<HTMLDivElement>>;
36
26
  export default BundleProductDetailsModal;
@@ -1,10 +1,20 @@
1
1
  import React from "react";
2
+ import { RewardCouponWithIcon } from "../CouponFrame/CouponFrame";
2
3
  import { stickyCartCustomizationDataProps } from "./StickyCart";
3
4
  import { CartOffersCarousalProps } from "./CartOffersCarousel";
4
5
  import { freebieMilestoneProps } from "./NextFreebieRow";
5
6
  import { GSTSectionCustomizationProps } from "./GSTSection";
6
7
  import { BundlePayload } from "../BundleBlock/Bundle";
7
8
  import { type FloatingCartDataProps } from "./FloatingCart";
9
+ export interface RewardCoupon {
10
+ couponTemplateId: number;
11
+ name: string;
12
+ couponType: string;
13
+ discountPercentage: number | null;
14
+ discountValue: number | null;
15
+ minimumOrderValue: number | null;
16
+ pointsRequired: number | null;
17
+ }
8
18
  export interface Checkpoint {
9
19
  couponTemplateId: number;
10
20
  couponType: string;
@@ -78,6 +88,7 @@ export interface CartProps {
78
88
  handleDecrement: (productId: number, newQuantity?: number) => Promise<any>;
79
89
  bundleProducts?: any;
80
90
  showBundle?: boolean;
91
+ showCouponOptions?: boolean;
81
92
  isUserSignedIn?: boolean;
82
93
  loyaltyIcon?: string;
83
94
  discountAmountOff?: number;
@@ -87,6 +98,8 @@ export interface CartProps {
87
98
  removeDiscount?: () => Promise<any>;
88
99
  applyDiscount?: () => Promise<any>;
89
100
  discountApplied?: boolean;
101
+ rewardCoupons?: RewardCoupon[];
102
+ userTotalPoints?: number;
90
103
  joinNowFunction?: () => void;
91
104
  checkoutFunction: (templateId?: number) => Promise<any>;
92
105
  guestLoyaltyPercentage?: number;
@@ -98,11 +111,16 @@ export interface CartProps {
98
111
  showCartLevelAltPay?: boolean;
99
112
  redemptionRate: number;
100
113
  pointsRewardRate: number;
114
+ showGuestDiscountCoupon?: boolean;
115
+ guestRewardCoupon?: RewardCouponWithIcon;
116
+ applyTemplateDiscount?: (templateId?: number) => Promise<any>;
101
117
  exploreCtaRedirectLink?: string;
102
118
  discountAmountApplied?: number;
103
119
  minimumCartValue?: number;
104
120
  discountInCheckoutButton?: boolean | string;
105
121
  isStickyCheckout?: boolean;
122
+ showDiscountsListToGuestUsers?: boolean;
123
+ showApplyCouponsButtonToGuestUsers?: boolean;
106
124
  handleCheckpointCrossed?: (checkpoint: Checkpoint, cartAmount: number) => Promise<any>;
107
125
  customCartProgressBarCriteria?: string;
108
126
  primaryTextColor?: string;
@@ -147,6 +165,7 @@ export interface CartProps {
147
165
  productPercentageOffMapping: {
148
166
  [variantId: string]: number;
149
167
  };
168
+ productTagsMapping?: Map<string, string[]>;
150
169
  removeFreebieFromCart?: (lineItemKey: string) => Promise<void>;
151
170
  postalCodeList?: number[];
152
171
  enableGeoLocationDeliveryRestriction?: boolean;
@@ -18,6 +18,7 @@ type CartProductsListProps = {
18
18
  productPercentageOffMapping: {
19
19
  [variantId: string]: number;
20
20
  };
21
+ productTagsMapping?: Map<string, string[]>;
21
22
  removeFreebieFromCart?: (lineItemKey: string) => Promise<void>;
22
23
  showDeleteOnFreebies?: boolean;
23
24
  freebieCouponTemplates: Checkpoint[];
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- declare const ProductCard: ({ product: variant, handleDecrement, handleIncrement, removeCartItem, addCartItem, isDev, themeColor, primaryTextColor, secondaryTextColor, tertiaryColor, tertiaryTextColor, showQtySelector, themeTextColor, showEditOptionOnProducts, percentageOff, removeFreebieFromCart, showDeleteOnFreebies, imageAspectSelector, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, backgroundColor, showDiscountOnMRP, }: {
2
+ declare const ProductCard: ({ product: variant, handleDecrement, handleIncrement, removeCartItem, addCartItem, isDev, themeColor, primaryTextColor, secondaryTextColor, tertiaryColor, tertiaryTextColor, showQtySelector, themeTextColor, showEditOptionOnProducts, percentageOff, tags, removeFreebieFromCart, showDeleteOnFreebies, imageAspectSelector, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, backgroundColor, showDiscountOnMRP, }: {
3
3
  product: any;
4
4
  addCartItem?: ((product: any) => Promise<any>) | undefined;
5
5
  removeCartItem?: ((product: any) => Promise<any>) | undefined;
@@ -17,6 +17,7 @@ declare const ProductCard: ({ product: variant, handleDecrement, handleIncrement
17
17
  themeTextColor?: string | undefined;
18
18
  showEditOptionOnProducts?: boolean | undefined;
19
19
  percentageOff?: number | undefined;
20
+ tags?: any;
20
21
  removeFreebieFromCart?: ((lineItemKey: string) => Promise<void>) | undefined;
21
22
  showDeleteOnFreebies?: boolean | undefined;
22
23
  imageAspectSelector?: "square" | "portrait" | undefined;
@@ -1,6 +1,7 @@
1
1
  export { default as Nudge } from "./Nudge";
2
2
  export { default as SpinnerWheel } from "./SpinnerWheel";
3
3
  export { default as Cart } from "./Cart";
4
+ export { default as CouponFrame } from "./CouponFrame";
4
5
  export { default as Bundle } from "./BundleBlock";
5
6
  export { default as BundleLoader } from "./BundleBlock/Loader";
6
7
  export { default as ProductOffers, ProductsOffersConfigType, CartCheckpoint, } from "./ProductOffersBlock/ProductsOffers";
package/dist/index.d.ts CHANGED
@@ -60,6 +60,19 @@ interface WheelProps {
60
60
  }
61
61
  declare const SpinnerWheel: React.FC<WheelProps>;
62
62
 
63
+ interface RewardCouponWithIcon extends RewardCoupon {
64
+ icon?: React.ReactElement | null;
65
+ }
66
+ type CouponFrameProps = {
67
+ couponActive: boolean;
68
+ rewardCoupon: RewardCouponWithIcon;
69
+ currency: string;
70
+ handleApply: (templateId?: number) => Promise<any>;
71
+ pointsCoupon?: boolean;
72
+ pointsToBeUsed?: number;
73
+ };
74
+ declare const CouponFrame: React.FC<CouponFrameProps>;
75
+
63
76
  interface ShopifyCurrency {
64
77
  rate: number;
65
78
  active: string;
@@ -324,17 +337,6 @@ type Customizations = {
324
337
  createdAt?: string;
325
338
  updatedAt?: string;
326
339
  };
327
- type ProductTier = {
328
- tier: number;
329
- title: string;
330
- minimumQuantity: number;
331
- isFixed?: boolean;
332
- isFreebieTier?: boolean;
333
- products: {
334
- productId: string;
335
- variantIds: string[];
336
- }[];
337
- };
338
340
  type BundlePayload = {
339
341
  showIndividualProductSelector: boolean;
340
342
  title?: string;
@@ -376,7 +378,17 @@ type BundlePayload = {
376
378
  minimumQuantity: number;
377
379
  discountValue: number;
378
380
  }[];
379
- productTier?: ProductTier[];
381
+ productTier?: {
382
+ tier: number;
383
+ title: string;
384
+ minimumQuantity: number;
385
+ isFixed?: boolean;
386
+ isFreebieTier?: boolean;
387
+ products: {
388
+ productId: string;
389
+ variantIds: string[];
390
+ }[];
391
+ }[];
380
392
  };
381
393
  volumeTiers?: {
382
394
  isDefault: unknown;
@@ -518,6 +530,15 @@ type FloatingCartDataProps = {
518
530
  showOnPages: string[];
519
531
  };
520
532
 
533
+ interface RewardCoupon {
534
+ couponTemplateId: number;
535
+ name: string;
536
+ couponType: string;
537
+ discountPercentage: number | null;
538
+ discountValue: number | null;
539
+ minimumOrderValue: number | null;
540
+ pointsRequired: number | null;
541
+ }
521
542
  interface Checkpoint {
522
543
  couponTemplateId: number;
523
544
  couponType: string;
@@ -578,6 +599,7 @@ interface CartProps {
578
599
  handleDecrement: (productId: number, newQuantity?: number) => Promise<any>;
579
600
  bundleProducts?: any;
580
601
  showBundle?: boolean;
602
+ showCouponOptions?: boolean;
581
603
  isUserSignedIn?: boolean;
582
604
  loyaltyIcon?: string;
583
605
  discountAmountOff?: number;
@@ -587,6 +609,8 @@ interface CartProps {
587
609
  removeDiscount?: () => Promise<any>;
588
610
  applyDiscount?: () => Promise<any>;
589
611
  discountApplied?: boolean;
612
+ rewardCoupons?: RewardCoupon[];
613
+ userTotalPoints?: number;
590
614
  joinNowFunction?: () => void;
591
615
  checkoutFunction: (templateId?: number) => Promise<any>;
592
616
  guestLoyaltyPercentage?: number;
@@ -598,11 +622,16 @@ interface CartProps {
598
622
  showCartLevelAltPay?: boolean;
599
623
  redemptionRate: number;
600
624
  pointsRewardRate: number;
625
+ showGuestDiscountCoupon?: boolean;
626
+ guestRewardCoupon?: RewardCouponWithIcon;
627
+ applyTemplateDiscount?: (templateId?: number) => Promise<any>;
601
628
  exploreCtaRedirectLink?: string;
602
629
  discountAmountApplied?: number;
603
630
  minimumCartValue?: number;
604
631
  discountInCheckoutButton?: boolean | string;
605
632
  isStickyCheckout?: boolean;
633
+ showDiscountsListToGuestUsers?: boolean;
634
+ showApplyCouponsButtonToGuestUsers?: boolean;
606
635
  handleCheckpointCrossed?: (checkpoint: Checkpoint, cartAmount: number) => Promise<any>;
607
636
  customCartProgressBarCriteria?: string;
608
637
  primaryTextColor?: string;
@@ -647,6 +676,7 @@ interface CartProps {
647
676
  productPercentageOffMapping: {
648
677
  [variantId: string]: number;
649
678
  };
679
+ productTagsMapping?: Map<string, string[]>;
650
680
  removeFreebieFromCart?: (lineItemKey: string) => Promise<void>;
651
681
  postalCodeList?: number[];
652
682
  enableGeoLocationDeliveryRestriction?: boolean;
@@ -745,4 +775,4 @@ declare const ProductsOffers: ({ offersConfig, offers, }: {
745
775
  offers: CartCheckpoint[];
746
776
  }) => React.JSX.Element;
747
777
 
748
- export { Bundle, BundleLoader, Cart, CartCheckpoint, Nudge, ProductsOffers as ProductOffers, ProductsOffersConfigType, SpinnerWheel };
778
+ export { Bundle, BundleLoader, Cart, CartCheckpoint, CouponFrame, Nudge, ProductsOffers as ProductOffers, ProductsOffersConfigType, SpinnerWheel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.8.15-productTier-freebie-update.7",
3
+ "version": "0.8.15",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",