yt-uikit 0.8.7-size-reduce.0 → 0.8.7-size-reduce.1

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 (47) hide show
  1. package/dist/esm/components/BundleBlock/Bundle.d.ts +14 -11
  2. package/dist/esm/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +2 -0
  3. package/dist/esm/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +1 -0
  4. package/dist/esm/components/BundleBlock/BundleProductDetailsModal/BundleProductDetailsModal.d.ts +10 -0
  5. package/dist/esm/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +12 -1
  6. package/dist/esm/components/Cart/Cart.d.ts +3 -20
  7. package/dist/esm/components/Cart/CartProductsList.d.ts +0 -1
  8. package/dist/esm/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
  9. package/dist/esm/components/Cart/FreebieClaimManager.d.ts +0 -1
  10. package/dist/esm/components/Cart/FreebieClaimOverlay.d.ts +0 -1
  11. package/dist/esm/components/Cart/FreebieClaimOverlayCard.d.ts +0 -1
  12. package/dist/esm/components/Cart/FreebieClaimSection.d.ts +0 -1
  13. package/dist/esm/components/Cart/FreebieClaimSectionCard.d.ts +0 -1
  14. package/dist/esm/components/Cart/ProductCard.d.ts +1 -2
  15. package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.d.ts +0 -1
  16. package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.d.ts +0 -1
  17. package/dist/esm/components/index.d.ts +0 -1
  18. package/dist/esm/index.js +404 -408
  19. package/dist/esm/types/components/BundleBlock/Bundle.d.ts +14 -11
  20. package/dist/esm/types/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +2 -0
  21. package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +1 -0
  22. package/dist/esm/types/components/BundleBlock/BundleProductDetailsModal/BundleProductDetailsModal.d.ts +10 -0
  23. package/dist/esm/types/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +12 -1
  24. package/dist/esm/types/components/Cart/Cart.d.ts +3 -20
  25. package/dist/esm/types/components/Cart/CartProductsList.d.ts +0 -1
  26. package/dist/esm/types/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
  27. package/dist/esm/types/components/Cart/FreebieClaimManager.d.ts +0 -1
  28. package/dist/esm/types/components/Cart/FreebieClaimOverlay.d.ts +0 -1
  29. package/dist/esm/types/components/Cart/FreebieClaimOverlayCard.d.ts +0 -1
  30. package/dist/esm/types/components/Cart/FreebieClaimSection.d.ts +0 -1
  31. package/dist/esm/types/components/Cart/FreebieClaimSectionCard.d.ts +0 -1
  32. package/dist/esm/types/components/Cart/ProductCard.d.ts +1 -2
  33. package/dist/esm/types/components/Cart/VariantSelectionPopup/DesktopVariantPopup.d.ts +0 -1
  34. package/dist/esm/types/components/Cart/VariantSelectionPopup/MobileVariantPopover.d.ts +0 -1
  35. package/dist/esm/types/components/index.d.ts +0 -1
  36. package/dist/esm/types/utils/freebieErrorLogger.d.ts +68 -0
  37. package/dist/esm/types/utils/freebieProductUtils.d.ts +2 -1
  38. package/dist/esm/types/utils/freebieValidation.d.ts +45 -0
  39. package/dist/esm/utils/freebieErrorLogger.d.ts +68 -0
  40. package/dist/esm/utils/freebieProductUtils.d.ts +2 -1
  41. package/dist/esm/utils/freebieValidation.d.ts +45 -0
  42. package/dist/index.d.ts +25 -43
  43. package/package.json +1 -1
  44. package/dist/esm/components/Cart/MobileMiniCart.d.ts +0 -21
  45. package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.styled.d.ts +0 -49
  46. package/dist/esm/types/components/Cart/MobileMiniCart.d.ts +0 -21
  47. package/dist/esm/types/components/Cart/VariantSelectionPopup/MobileVariantPopover.styled.d.ts +0 -49
@@ -264,6 +264,17 @@ 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
+ };
267
278
  export type BundlePayload = {
268
279
  showIndividualProductSelector: boolean;
269
280
  title?: string;
@@ -305,16 +316,7 @@ export type BundlePayload = {
305
316
  minimumQuantity: number;
306
317
  discountValue: number;
307
318
  }[];
308
- productTier?: {
309
- tier: number;
310
- title: string;
311
- minimumQuantity: number;
312
- isFixed?: boolean;
313
- products: {
314
- productId: string;
315
- variantIds: string[];
316
- }[];
317
- }[];
319
+ productTier?: ProductTier[];
318
320
  };
319
321
  volumeTiers?: {
320
322
  isDefault: unknown;
@@ -388,6 +390,7 @@ export declare const handleAddToBundle: (variantId: string, product: ProductDeta
388
390
  variantId: string;
389
391
  product: ProductDetails;
390
392
  quantity: number;
391
- }[]>>) => void;
393
+ isFree?: boolean | undefined;
394
+ }[]>>, isFreebie?: boolean) => void;
392
395
  declare const Bundle: React.FC<BundleProps>;
393
396
  export default Bundle;
@@ -18,11 +18,13 @@ type BundleBuilderProps = {
18
18
  variantId: string;
19
19
  product: ProductDetails;
20
20
  quantity: number;
21
+ isFree?: boolean;
21
22
  }[];
22
23
  setSelectedItems: React.Dispatch<React.SetStateAction<{
23
24
  variantId: string;
24
25
  product: ProductDetails;
25
26
  quantity: number;
27
+ isFree?: boolean;
26
28
  }[]>>;
27
29
  handleAddToCart: (e: any) => Promise<void>;
28
30
  bundleAddToCartLoading: boolean;
@@ -20,6 +20,7 @@ type BundleBuilderTrackerProps = {
20
20
  variantId: string;
21
21
  product: ProductDetails;
22
22
  quantity: number;
23
+ isFree?: boolean;
23
24
  }[];
24
25
  minimumQuantity: number;
25
26
  handleAddToCart: (e: any) => Promise<void>;
@@ -8,6 +8,9 @@ type BundleProductDetailsModalProps = {
8
8
  product: ProductDetails;
9
9
  quantity: number;
10
10
  }[];
11
+ selectedProductsByTier?: {
12
+ [tier: number]: string[];
13
+ };
11
14
  remainingQuantity: number;
12
15
  hideAddToBundle: boolean;
13
16
  disableQuantitySelector: boolean;
@@ -21,6 +24,13 @@ type BundleProductDetailsModalProps = {
21
24
  averageRating: number;
22
25
  ratingCount: number;
23
26
  };
27
+ customVariantsQuantity?: {
28
+ quantity: number;
29
+ variantId: string;
30
+ }[];
31
+ bundleProductsCustomQuantity?: number | null;
32
+ isFreebieTier?: boolean;
33
+ showFreebieTierProductPrices?: boolean;
24
34
  };
25
35
  declare const BundleProductDetailsModal: React.ForwardRefExoticComponent<BundleProductDetailsModalProps & React.RefAttributes<HTMLDivElement>>;
26
36
  export default BundleProductDetailsModal;
@@ -49,6 +49,13 @@ export type Product = {
49
49
  image?: string;
50
50
  options?: string[];
51
51
  };
52
+ type DiscountData = {
53
+ type: "dummy_coupon" | "percentage_discount_coupon" | "amount_discount_coupon" | "fixed_price_collection";
54
+ tiers: {
55
+ minimumQuantity: number;
56
+ discountValue: number;
57
+ };
58
+ } | null;
52
59
  export type BundleConfig = {
53
60
  config: {
54
61
  shop: string;
@@ -59,10 +66,11 @@ export type BundleConfig = {
59
66
  collectionTier: {
60
67
  title: string;
61
68
  tier: number;
62
- minimumQuantity: number;
69
+ maximumQuantity: number;
63
70
  collectionId: string;
64
71
  handle: string;
65
72
  products: Product[];
73
+ discountData: DiscountData;
66
74
  }[];
67
75
  };
68
76
  form?: {
@@ -94,6 +102,9 @@ export type BundleConfig = {
94
102
  hideOutOfStockProducts: boolean;
95
103
  bundleRedirection: "cart-drawer" | "checkout";
96
104
  checkoutPartner: "shopify" | "razorpay" | "shiprocket" | "gokwik" | "breeze" | "zecpay" | "shopflo";
105
+ showTierSteps: boolean;
106
+ headerImage: string;
107
+ stickyBarWidth: "compact" | "full-width";
97
108
  };
98
109
  };
99
110
  interface CollectionBundleProps {
@@ -1,19 +1,10 @@
1
1
  import React from "react";
2
- import { RewardCouponWithIcon } from "../CouponFrame/CouponFrame";
3
2
  import { stickyCartCustomizationDataProps } from "./StickyCart";
4
3
  import { CartOffersCarousalProps } from "./CartOffersCarousel";
5
4
  import { freebieMilestoneProps } from "./NextFreebieRow";
6
5
  import { GSTSectionCustomizationProps } from "./GSTSection";
7
6
  import { BundlePayload } from "../BundleBlock/Bundle";
8
- export interface RewardCoupon {
9
- couponTemplateId: number;
10
- name: string;
11
- couponType: string;
12
- discountPercentage: number | null;
13
- discountValue: number | null;
14
- minimumOrderValue: number | null;
15
- pointsRequired: number | null;
16
- }
7
+ import { type FloatingCartDataProps } from "./FloatingCart";
17
8
  export interface Checkpoint {
18
9
  couponTemplateId: number;
19
10
  couponType: string;
@@ -87,7 +78,6 @@ export interface CartProps {
87
78
  handleDecrement: (productId: number, newQuantity?: number) => Promise<any>;
88
79
  bundleProducts?: any;
89
80
  showBundle?: boolean;
90
- showCouponOptions?: boolean;
91
81
  isUserSignedIn?: boolean;
92
82
  loyaltyIcon?: string;
93
83
  discountAmountOff?: number;
@@ -97,8 +87,6 @@ export interface CartProps {
97
87
  removeDiscount?: () => Promise<any>;
98
88
  applyDiscount?: () => Promise<any>;
99
89
  discountApplied?: boolean;
100
- rewardCoupons?: RewardCoupon[];
101
- userTotalPoints?: number;
102
90
  joinNowFunction?: () => void;
103
91
  checkoutFunction: (templateId?: number) => Promise<any>;
104
92
  guestLoyaltyPercentage?: number;
@@ -110,16 +98,11 @@ export interface CartProps {
110
98
  showCartLevelAltPay?: boolean;
111
99
  redemptionRate: number;
112
100
  pointsRewardRate: number;
113
- showGuestDiscountCoupon?: boolean;
114
- guestRewardCoupon?: RewardCouponWithIcon;
115
- applyTemplateDiscount?: (templateId?: number) => Promise<any>;
116
101
  exploreCtaRedirectLink?: string;
117
102
  discountAmountApplied?: number;
118
103
  minimumCartValue?: number;
119
104
  discountInCheckoutButton?: boolean | string;
120
105
  isStickyCheckout?: boolean;
121
- showDiscountsListToGuestUsers?: boolean;
122
- showApplyCouponsButtonToGuestUsers?: boolean;
123
106
  handleCheckpointCrossed?: (checkpoint: Checkpoint, cartAmount: number) => Promise<any>;
124
107
  customCartProgressBarCriteria?: string;
125
108
  primaryTextColor?: string;
@@ -164,7 +147,6 @@ export interface CartProps {
164
147
  productPercentageOffMapping: {
165
148
  [variantId: string]: number;
166
149
  };
167
- productTagsMapping?: Map<string, string[]>;
168
150
  removeFreebieFromCart?: (lineItemKey: string) => Promise<void>;
169
151
  postalCodeList?: number[];
170
152
  enableGeoLocationDeliveryRestriction?: boolean;
@@ -192,6 +174,8 @@ export interface CartProps {
192
174
  productRecsCardListVariant: "scroll" | "carousel" | "vertical";
193
175
  showCartTimer?: boolean;
194
176
  showFreebieMilestone?: boolean;
177
+ showFloatingCart?: boolean;
178
+ floatingCartData?: FloatingCartDataProps;
195
179
  cartTimerInMinutes?: number;
196
180
  cartTimerCustomText?: string;
197
181
  imageAspectSelector?: "square" | "portrait";
@@ -224,7 +208,6 @@ export interface CartProps {
224
208
  showApplyCoupon?: boolean;
225
209
  enableConfetti?: boolean;
226
210
  showCheckoutButtonPaymentIcons?: boolean;
227
- shouldCheckInventoryQuantity?: boolean;
228
211
  comboBundleData?: BundlePayload;
229
212
  comboBundleAddToCartFunction?: (selectedItemsSubtotal: number, variantIds?: string[], finalBundlePrice?: number, variantIdPriceMap?: {
230
213
  variantId: string;
@@ -18,7 +18,6 @@ type CartProductsListProps = {
18
18
  productPercentageOffMapping: {
19
19
  [variantId: string]: number;
20
20
  };
21
- productTagsMapping?: Map<string, string[]>;
22
21
  removeFreebieFromCart?: (lineItemKey: string) => Promise<void>;
23
22
  showDeleteOnFreebies?: boolean;
24
23
  freebieCouponTemplates: Checkpoint[];
@@ -0,0 +1,28 @@
1
+ import React, { Component, ReactNode } from 'react';
2
+ interface FreebieClaimErrorBoundaryProps {
3
+ children: ReactNode;
4
+ fallback?: ReactNode;
5
+ showErrorUI?: boolean;
6
+ }
7
+ interface FreebieClaimErrorBoundaryState {
8
+ hasError: boolean;
9
+ error: Error | null;
10
+ errorInfo: React.ErrorInfo | null;
11
+ }
12
+ /**
13
+ * Error Boundary for Freebie Claim components
14
+ * Catches React rendering errors and logs them with detailed context
15
+ * Prevents entire cart from crashing when freebie component has errors
16
+ */
17
+ declare class FreebieClaimErrorBoundary extends Component<FreebieClaimErrorBoundaryProps, FreebieClaimErrorBoundaryState> {
18
+ constructor(props: FreebieClaimErrorBoundaryProps);
19
+ static getDerivedStateFromError(error: Error): Partial<FreebieClaimErrorBoundaryState>;
20
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
21
+ render(): ReactNode;
22
+ }
23
+ export default FreebieClaimErrorBoundary;
24
+ /**
25
+ * HOC to wrap a component with FreebieClaimErrorBoundary
26
+ * Usage: const SafeComponent = withFreebieErrorBoundary(MyComponent);
27
+ */
28
+ export declare function withFreebieErrorBoundary<P extends object>(Component: React.ComponentType<P>, showErrorUI?: boolean): React.FC<P>;
@@ -12,7 +12,6 @@ interface FreebieClaimManagerProps {
12
12
  imageAspectSelector?: "square" | "portrait";
13
13
  freebieCouponTemplates?: Checkpoint[];
14
14
  isCartDrawerOpen?: boolean;
15
- shouldCheckInventoryQuantity?: boolean;
16
15
  }
17
16
  declare const FreebieClaimManager: React.FC<FreebieClaimManagerProps>;
18
17
  export default FreebieClaimManager;
@@ -12,7 +12,6 @@ interface FreebieClaimOverlayProps {
12
12
  freebieCouponTemplates?: Checkpoint[];
13
13
  freebieClaimData?: any;
14
14
  isCartDrawerOpen?: boolean;
15
- shouldCheckInventoryQuantity?: boolean;
16
15
  }
17
16
  declare const FreebieClaimOverlay: React.FC<FreebieClaimOverlayProps>;
18
17
  export default FreebieClaimOverlay;
@@ -4,7 +4,6 @@ interface FreebieClaimOverlayCardProps {
4
4
  imageAspectSelector?: "square" | "portrait";
5
5
  freebieCouponTemplates?: any[];
6
6
  accentColor?: string;
7
- shouldCheckInventoryQuantity?: boolean;
8
7
  }
9
8
  declare const FreebieClaimOverlayCard: React.FC<FreebieClaimOverlayCardProps>;
10
9
  export default FreebieClaimOverlayCard;
@@ -12,7 +12,6 @@ interface FreebieClaimSectionProps {
12
12
  maxFreebiesInTier?: number;
13
13
  tierName?: string;
14
14
  freebieClaimData?: any;
15
- shouldCheckInventoryQuantity?: boolean;
16
15
  }
17
16
  declare const FreebieClaimSection: React.FC<FreebieClaimSectionProps>;
18
17
  export default FreebieClaimSection;
@@ -11,7 +11,6 @@ interface FreebieClaimSectionCardProps {
11
11
  isSelected?: boolean;
12
12
  isDisabled?: boolean;
13
13
  onToggleSelection?: (productId: string) => void;
14
- shouldCheckInventoryQuantity?: boolean;
15
14
  }
16
15
  declare const FreebieClaimSectionCard: React.FC<FreebieClaimSectionCardProps>;
17
16
  export default FreebieClaimSectionCard;
@@ -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, tags, 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, 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,7 +17,6 @@ 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;
21
20
  removeFreebieFromCart?: ((lineItemKey: string) => Promise<void>) | undefined;
22
21
  showDeleteOnFreebies?: boolean | undefined;
23
22
  imageAspectSelector?: "square" | "portrait" | undefined;
@@ -13,7 +13,6 @@ type DesktopVariantPopupProps = {
13
13
  productClaimCtaButtonText?: string;
14
14
  backgroundSubdued?: string;
15
15
  primaryTextColor?: string;
16
- shouldCheckInventoryQuantity?: boolean;
17
16
  };
18
17
  declare const DesktopVariantPopup: React.ForwardRefExoticComponent<DesktopVariantPopupProps & React.RefAttributes<HTMLDivElement>>;
19
18
  export default DesktopVariantPopup;
@@ -13,7 +13,6 @@ type MobileVariantPopupProps = {
13
13
  productClaimCtaButtonText?: string;
14
14
  backgroundSubdued?: string;
15
15
  primaryTextColor?: string;
16
- shouldCheckInventoryQuantity?: boolean;
17
16
  };
18
17
  declare const MobileVariantPopup: React.ForwardRefExoticComponent<MobileVariantPopupProps & React.RefAttributes<HTMLDivElement>>;
19
18
  export default MobileVariantPopup;
@@ -1,7 +1,6 @@
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";
5
4
  export { default as Bundle } from "./BundleBlock";
6
5
  export { default as BundleLoader } from "./BundleBlock/Loader";
7
6
  export { default as ProductOffers, ProductsOffersConfigType, CartCheckpoint, } from "./ProductOffersBlock/ProductsOffers";