yt-uikit 0.10.74-variants-split.0 → 0.10.75-line-items.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.
@@ -0,0 +1,3 @@
1
+ export declare const variantChangeErrorState: import("jotai").PrimitiveAtom<string | undefined> & {
2
+ init: string | undefined;
3
+ };
@@ -29,7 +29,6 @@ export interface freebieClaimInterface {
29
29
  type: "section" | "overlay";
30
30
  allowOverlayClose: boolean;
31
31
  freeLabelText?: string;
32
- showVariantsInClaimSection: boolean;
33
32
  }
34
33
  export type CartLevelDiscountApplication = {
35
34
  type: string;
@@ -84,6 +83,15 @@ export interface CouponSelectionData {
84
83
  couponTextSuffix?: string;
85
84
  applyButtonText?: string;
86
85
  }
86
+ export interface uploadImageAddonInterface {
87
+ showUploadImageAddon: boolean;
88
+ state: "optional" | "required";
89
+ showUI: "always" | "required_item_atc";
90
+ tagName: string;
91
+ title: string;
92
+ subtitle: string;
93
+ uploadedText: string;
94
+ }
87
95
  export interface CartProps {
88
96
  isOpen: boolean;
89
97
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
@@ -257,6 +265,7 @@ export interface CartProps {
257
265
  showTrustedBadge?: boolean;
258
266
  trustedBadgeData?: trustedBadgeInterface;
259
267
  drawerLayoutData?: DrawerLayout;
268
+ uploadImageAddonData?: uploadImageAddonInterface;
260
269
  }
261
270
  declare const _default: React.NamedExoticComponent<CartProps>;
262
271
  export default _default;
@@ -2,12 +2,15 @@ import React from "react";
2
2
  import { Checkpoint } from "./Cart";
3
3
  import { freebieMilestoneProps } from "./NextFreebieRow";
4
4
  type CartProductsListProps = {
5
- addCartItem?: (product: any, quantity?: number, triggeredFrom?: string) => Promise<any>;
6
- removeCartItem: (product: any) => Promise<any>;
5
+ addCartItem?: (product: any, quantity?: number, triggeredFrom?: string, freebieReplace?: boolean, productHandle?: string) => Promise<any>;
6
+ removeCartItem: (lineItemKey: string, triggeredFrom?: string, ytRequest?: boolean) => Promise<any>;
7
7
  handleIncrement: (lineItemKey: string | number, newQuantity: number, properties?: {
8
8
  [key: string]: string;
9
9
  }) => Promise<any>;
10
10
  handleDecrement: (lineItemKey: string | number, newQuantity?: number) => Promise<any>;
11
+ getProductDetailsByVariantId?: (handle: string, variantId?: string) => Promise<any>;
12
+ freebieClaimAddToCart?: (variantId: string, allowedVariantIds?: string[]) => Promise<void>;
13
+ stealDealAddToCart?: (variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>;
11
14
  isDev?: boolean;
12
15
  themeColor?: string;
13
16
  primaryTextColor?: string;
@@ -42,7 +45,7 @@ type CartProductsListProps = {
42
45
  freeLabelText?: string;
43
46
  customCartProgressBarCriteria?: string;
44
47
  effectiveQuantityForProgressBar?: number;
45
- isLargeScreen?: boolean;
48
+ isLargeScreen: boolean;
46
49
  };
47
50
  declare const CartProductsList: React.FC<CartProductsListProps>;
48
51
  export default CartProductsList;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import "./shared.scss";
3
3
  import { Checkpoint } from "./Cart";
4
+ import type { UploadImageState } from "./UploadImageSection";
4
5
  export interface trustedBadgeInterface {
5
6
  enableTrustedBadge: boolean;
6
7
  badgeImage: {
@@ -44,6 +45,9 @@ interface CheckoutSectionProps {
44
45
  showTrustedBadge?: boolean;
45
46
  trustedBadgeData?: trustedBadgeInterface;
46
47
  isLargeScreen?: boolean;
48
+ uploadImageStatus?: UploadImageState["status"];
49
+ uploadImageRequired?: boolean;
50
+ onUploadImageRequired?: () => void;
47
51
  }
48
- declare function CheckoutSection({ isCartPageEnabled, checkoutButtonColor, checkoutFontSize, checkoutFunction, discountApplied, discountInCheckoutButton, discountAmountApplied, minimumCartValue, themeTextColor, applyGSTToCart, showGSTOption, applyNoteToCart, showNoteOption, enableGeoLocationDeliveryRestriction, applyPostalCodeAndDeliverySlotToCart, enableSlotPicker, isStickyCheckout, cartComponentsCornerType, cartComponentsCornerRadius, checkoutSectionMessage, checkoutSectionMessageDisplay, checkoutSectionMessageRedirectLink, showDiscountOnMRP, tertiaryColor, tertiaryTextColor, cartCheckpoints, toggleDecimal, disableCheckoutButton, checkoutButtonBottomSpacing, showCheckoutButtonPaymentIcons, primaryTextColor, hideSubtotalAndBadge, showTrustedBadge, trustedBadgeData, isLargeScreen, }: CheckoutSectionProps): React.JSX.Element;
52
+ declare function CheckoutSection({ isCartPageEnabled, checkoutButtonColor, checkoutFontSize, checkoutFunction, discountApplied, discountInCheckoutButton, discountAmountApplied, minimumCartValue, themeTextColor, applyGSTToCart, showGSTOption, applyNoteToCart, showNoteOption, enableGeoLocationDeliveryRestriction, applyPostalCodeAndDeliverySlotToCart, enableSlotPicker, isStickyCheckout, cartComponentsCornerType, cartComponentsCornerRadius, checkoutSectionMessage, checkoutSectionMessageDisplay, checkoutSectionMessageRedirectLink, showDiscountOnMRP, tertiaryColor, tertiaryTextColor, cartCheckpoints, toggleDecimal, disableCheckoutButton, checkoutButtonBottomSpacing, showCheckoutButtonPaymentIcons, primaryTextColor, hideSubtotalAndBadge, showTrustedBadge, trustedBadgeData, isLargeScreen, uploadImageStatus, uploadImageRequired, onUploadImageRequired, }: CheckoutSectionProps): React.JSX.Element;
49
53
  export default CheckoutSection;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ export type SelectOption = {
3
+ label: string;
4
+ value: string | number;
5
+ disabled?: boolean;
6
+ };
7
+ export type CustomSelectProps = {
8
+ options: SelectOption[];
9
+ value: string | number;
10
+ onChange: (value: string | number) => void;
11
+ prefix?: string;
12
+ className?: string;
13
+ cartComponentsCornerType?: "rounded" | "sharp";
14
+ cartComponentsCornerRadius?: number;
15
+ backgroundSubdued?: string;
16
+ };
17
+ declare const CustomSelect: React.FC<CustomSelectProps>;
18
+ export default CustomSelect;
@@ -1,12 +1,16 @@
1
1
  import React from "react";
2
- declare const _default: React.MemoExoticComponent<({ product: variant, handleDecrement, handleIncrement, removeCartItem, addCartItem, isDev, themeColor, primaryTextColor, secondaryTextColor, tertiaryColor, tertiaryTextColor, showQtySelector, themeTextColor, showEditOptionOnProducts, percentageOff, removeFreebieFromCart, showDeleteOnFreebies, imageAspectSelector, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, backgroundColor, showDiscountOnMRP, freeLabelText, isLargeScreen, }: {
2
+ import { FreebieRewardContext } from "@/src/utils/freebieUtils";
3
+ import "./shared.scss";
4
+ declare const _default: React.MemoExoticComponent<({ product: variant, handleDecrement, handleIncrement, removeCartItem, addCartItem, freebieClaimAddToCart, stealDealAddToCart, isDev, themeColor, primaryTextColor, secondaryTextColor, tertiaryColor, tertiaryTextColor, showQtySelector, themeTextColor, showEditOptionOnProducts, percentageOff, removeFreebieFromCart, showDeleteOnFreebies, imageAspectSelector, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, backgroundColor, showDiscountOnMRP, freeLabelText, productOptions, productVariants, isLargeScreen, }: {
3
5
  product: any;
4
- addCartItem?: ((product: any) => Promise<any>) | undefined;
5
- removeCartItem?: ((product: any) => Promise<any>) | undefined;
6
+ addCartItem?: ((product: any, quantity?: number | undefined, triggeredFrom?: string | undefined, freebieReplace?: boolean | undefined, productHandle?: string | undefined) => Promise<any>) | undefined;
7
+ removeCartItem?: ((lineItemKey: string, triggeredFrom?: string | undefined, ytRequest?: boolean | undefined) => Promise<any>) | undefined;
6
8
  handleIncrement?: ((lineItemKey: string | number, newQuantity: number, properties?: {
7
9
  [key: string]: string;
8
10
  } | undefined) => Promise<any>) | undefined;
9
11
  handleDecrement?: ((lineItemKey: string | number, newQuantity?: number | undefined) => Promise<any>) | undefined;
12
+ freebieClaimAddToCart?: ((variantId: string, allowedVariantIds?: string[] | undefined, rewardContext?: FreebieRewardContext | undefined) => Promise<void>) | undefined;
13
+ stealDealAddToCart?: ((variantId: string, originalAllowedVariantIds?: string[] | undefined, rewardContext?: FreebieRewardContext | undefined) => Promise<void>) | undefined;
10
14
  isDev?: boolean | undefined;
11
15
  themeColor?: string | undefined;
12
16
  primaryTextColor?: string | undefined;
@@ -26,6 +30,17 @@ declare const _default: React.MemoExoticComponent<({ product: variant, handleDec
26
30
  backgroundColor?: string | undefined;
27
31
  showDiscountOnMRP?: boolean | undefined;
28
32
  freeLabelText?: string | undefined;
29
- isLargeScreen?: boolean | undefined;
33
+ productOptions?: {
34
+ name: string;
35
+ values: string[];
36
+ }[] | undefined;
37
+ productVariants?: {
38
+ id: string | number;
39
+ available: boolean;
40
+ option1?: string | undefined;
41
+ option2?: string | undefined;
42
+ option3?: string | undefined;
43
+ }[] | undefined;
44
+ isLargeScreen: boolean;
30
45
  }) => React.JSX.Element>;
31
46
  export default _default;
@@ -10,7 +10,6 @@ interface StealDealSectionProps {
10
10
  themeColor?: string;
11
11
  primaryTextColor?: string;
12
12
  secondaryTextColor?: string;
13
- showVariantsInClaimSection: boolean;
14
13
  }
15
14
  declare const StealDealSection: React.FC<StealDealSectionProps>;
16
15
  export default StealDealSection;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import type { uploadImageAddonInterface } from "./Cart";
3
+ export type UploadImageState = {
4
+ file?: UploadedImageFile;
5
+ items: Array<{
6
+ image?: string;
7
+ key: string;
8
+ quantity: number;
9
+ title: string;
10
+ variantId: string;
11
+ }>;
12
+ status: "checking" | "error" | "not-required" | "optional" | "required" | "uploaded";
13
+ };
14
+ type UploadImageSectionProps = {
15
+ ctaButtonBackgroundColor?: string;
16
+ highlighted?: boolean;
17
+ onFileSelected: (file: File | null) => void;
18
+ onRemove: () => void;
19
+ primaryTextColor?: string;
20
+ required?: boolean;
21
+ tertiaryColor?: string;
22
+ tertiaryTextColor?: string;
23
+ uploadImageAddonData?: uploadImageAddonInterface;
24
+ uploadedFile: UploadedImageFile | null;
25
+ };
26
+ export type UploadedImageFile = {
27
+ name: string;
28
+ url: string;
29
+ };
30
+ declare const UploadImageSection: React.ForwardRefExoticComponent<UploadImageSectionProps & React.RefAttributes<HTMLButtonElement>>;
31
+ export default UploadImageSection;