yt-uikit 0.9.1 → 0.9.2

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.
@@ -369,6 +369,16 @@ export type BundlePayload = {
369
369
  description?: string;
370
370
  customizePadding?: string;
371
371
  };
372
+ personalizedForm?: {
373
+ title?: string;
374
+ sections?: {
375
+ title: string;
376
+ type: "text" | "image";
377
+ fields: {
378
+ title: string;
379
+ }[];
380
+ }[];
381
+ };
372
382
  };
373
383
  export type EventNameCustom = "byob_checkout_cta" | "byob_add_to_bundle" | "block_visibility" | "bundle_add_to_cart";
374
384
  export type EventTypeCustom = "clicks" | "views";
@@ -386,8 +396,8 @@ export type BundleProps = {
386
396
  addToCartFunction?: (selectedItemsSubtotal: number, variantIds?: string[], finalBundlePrice?: number, variantIdPriceMap?: {
387
397
  variantId: string;
388
398
  price: number;
389
- }[]) => Promise<void>;
390
- addCustomBundleToCart?: (e: any) => Promise<void>;
399
+ }[], properties?: Record<string, string>) => Promise<void>;
400
+ addCustomBundleToCart?: (e: any, formProperties?: Record<string, any>) => Promise<void>;
391
401
  selectedItems?: {
392
402
  variantId: string;
393
403
  product: ProductDetails;
@@ -28,7 +28,7 @@ type BundleBuilderProps = {
28
28
  isFree?: boolean;
29
29
  tierIndex?: number;
30
30
  }[]>>;
31
- handleAddToCart: (e: any) => Promise<void>;
31
+ handleAddToCart: (e: any, formProperties?: Record<string, any>) => Promise<void>;
32
32
  bundleAddToCartLoading: boolean;
33
33
  renderingOnPage: boolean;
34
34
  selectedItemsQuantity: number;
@@ -48,6 +48,8 @@ type BundleBuilderTrackerProps = {
48
48
  renderingOnPage: boolean;
49
49
  handleRemoveItemProductTier: (variantId: string, currentTier: number) => void;
50
50
  storeCurrencyCode?: string;
51
+ isUploading?: boolean;
52
+ showNextStep?: boolean;
51
53
  };
52
54
  export declare const BundleBuilderTrackerBar: React.FC<BundleBuilderTrackerProps>;
53
55
  export default BundleBuilderTrackerBar;
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ export declare const LoaderSpinner: () => React.JSX.Element;
3
+ interface UploadState {
4
+ url?: string;
5
+ name?: string;
6
+ loading?: boolean;
7
+ error?: boolean;
8
+ }
9
+ interface UploadFieldProps {
10
+ title: string;
11
+ uploadState?: UploadState | string;
12
+ onUpload: () => void;
13
+ onRemove: () => void;
14
+ onRetry: () => void;
15
+ }
16
+ export declare const UploadField: ({ title, uploadState, onUpload, onRemove, onRetry, }: UploadFieldProps) => React.JSX.Element;
17
+ export interface PersonalizationFormProps {
18
+ form: {
19
+ title?: string;
20
+ sections?: {
21
+ title: string;
22
+ type: "text" | "image";
23
+ fields: {
24
+ title: string;
25
+ }[];
26
+ }[];
27
+ };
28
+ formData: Record<string, any>;
29
+ setFormData: React.Dispatch<React.SetStateAction<Record<string, any>>>;
30
+ barHeight?: number;
31
+ isUploading?: boolean;
32
+ setIsUploading?: React.Dispatch<React.SetStateAction<boolean>>;
33
+ }
34
+ declare const PersonalizationForm: React.FC<PersonalizationFormProps>;
35
+ export default PersonalizationForm;
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ interface PersonalizationFormModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ onSkip?: () => void;
6
+ formConfig: {
7
+ title?: string;
8
+ sections?: {
9
+ title: string;
10
+ type: "text" | "image";
11
+ fields: {
12
+ title: string;
13
+ }[];
14
+ }[];
15
+ };
16
+ onCheckout: (properties: Record<string, string>) => void;
17
+ cta: {
18
+ textColor: string;
19
+ backgroundColor: string;
20
+ };
21
+ isMobile: boolean;
22
+ }
23
+ declare const PersonalizationFormModal: React.FC<PersonalizationFormModalProps>;
24
+ export default PersonalizationFormModal;
@@ -66,6 +66,8 @@ export interface RewardCoupon {
66
66
  };
67
67
  resolvedCollectionNames?: string[];
68
68
  isEligible?: boolean;
69
+ applicableSubtotal?: number;
70
+ estimatedSavings?: number;
69
71
  quantityThreshold?: number | null;
70
72
  customCartProgressBarCriteria?: string;
71
73
  }
@@ -90,10 +92,10 @@ export interface CartProps {
90
92
  switchWidthVariant?: boolean;
91
93
  addCartItem?: (product: any, quantity?: number, triggeredFrom?: string, freebieReplace?: boolean, productHandle?: string) => Promise<any>;
92
94
  removeCartItem: (lineItemKey: string, triggeredFrom?: string, ytRequest?: boolean) => Promise<any>;
93
- handleIncrement: (lineItemKey: string | number, newQuantity: number, properties?: {
95
+ handleIncrement: (productId: number, newQuantity: number, properties?: {
94
96
  [key: string]: string;
95
97
  }) => Promise<any>;
96
- handleDecrement: (lineItemKey: string | number, newQuantity?: number) => Promise<any>;
98
+ handleDecrement: (productId: number, newQuantity?: number) => Promise<any>;
97
99
  bundleProducts?: any;
98
100
  showBundle?: boolean;
99
101
  isUserSignedIn?: boolean;
@@ -3,11 +3,11 @@ import { Checkpoint } from "./Cart";
3
3
  import { freebieMilestoneProps } from "./NextFreebieRow";
4
4
  type CartProductsListProps = {
5
5
  addCartItem?: (product: any, quantity?: number, triggeredFrom?: string) => Promise<any>;
6
- removeCartItem: (lineItemKey: string) => Promise<any>;
7
- handleIncrement: (lineItemKey: string | number, newQuantity: number, properties?: {
6
+ removeCartItem: (product: any) => Promise<any>;
7
+ handleIncrement: (productId: number, newQuantity: number, properties?: {
8
8
  [key: string]: string;
9
9
  }) => Promise<any>;
10
- handleDecrement: (lineItemKey: string | number, newQuantity?: number) => Promise<any>;
10
+ handleDecrement: (productId: number) => Promise<any>;
11
11
  isDev?: boolean;
12
12
  themeColor?: string;
13
13
  primaryTextColor?: string;
@@ -40,7 +40,6 @@ type CartProductsListProps = {
40
40
  showFreebieMilestone?: boolean;
41
41
  freebieMilestoneData?: freebieMilestoneProps;
42
42
  freeLabelText?: string;
43
- isLargeScreen?: boolean;
44
43
  };
45
44
  declare const CartProductsList: React.FC<CartProductsListProps>;
46
45
  export default CartProductsList;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { RewardCoupon } from './Cart';
1
+ import React from "react";
2
+ import { RewardCoupon } from "./Cart";
3
3
  interface CouponSelectionProps {
4
4
  rewardCoupons: RewardCoupon[];
5
5
  applyCouponCode?: (code: string) => Promise<void>;
@@ -9,6 +9,8 @@ interface CouponSelectionProps {
9
9
  themeColor?: string;
10
10
  themeTextColor?: string;
11
11
  primaryTextColor?: string;
12
+ ctaButtonBackgroundColor?: string;
13
+ ctaButtonTextColor?: string;
12
14
  cartComponentsCornerRadius?: number;
13
15
  }
14
16
  declare const CouponSelection: React.FC<CouponSelectionProps>;
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
- declare const ProductCard: ({ product: variant, handleDecrement, handleIncrement, removeCartItem, addCartItem, isDev, isLargeScreen, themeColor, primaryTextColor, secondaryTextColor, tertiaryColor, tertiaryTextColor, showQtySelector, themeTextColor, showEditOptionOnProducts, percentageOff, removeFreebieFromCart, showDeleteOnFreebies, imageAspectSelector, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, backgroundColor, showDiscountOnMRP, freeLabelText, }: {
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, freeLabelText, }: {
3
3
  product: any;
4
4
  addCartItem?: ((product: any) => Promise<any>) | undefined;
5
- removeCartItem?: ((lineItemKey: string) => Promise<any>) | undefined;
6
- handleIncrement?: ((lineItemKey: string | number, newQuantity: number, properties?: {
5
+ removeCartItem?: ((product: any) => Promise<any>) | undefined;
6
+ handleIncrement?: ((productId: number, newQuantity: number, properties?: {
7
7
  [key: string]: string;
8
8
  } | undefined) => Promise<any>) | undefined;
9
- handleDecrement?: ((lineItemKey: string | number, newQuantity?: number) => Promise<any>) | undefined;
9
+ handleDecrement?: ((productId: number, newQuantity?: number) => Promise<any>) | undefined;
10
10
  isDev?: boolean | undefined;
11
11
  themeColor?: string | undefined;
12
12
  primaryTextColor?: string | undefined;
@@ -26,6 +26,5 @@ declare const ProductCard: ({ product: variant, handleDecrement, handleIncrement
26
26
  backgroundColor?: string | undefined;
27
27
  showDiscountOnMRP?: boolean | undefined;
28
28
  freeLabelText?: string | undefined;
29
- isLargeScreen?: boolean | undefined;
30
29
  }) => React.JSX.Element;
31
30
  export default ProductCard;
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
2
  import "./shared.scss";
3
- export declare const QuantitySelector: ({ value, handleItemQuantityDecrement, handleItemQuantityIncrement, disabled, isDev, themeColor, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, }: {
3
+ export declare const QuantitySelector: ({ value, handleItemQuantityDecrement, handleItemQuantityIncrement, isDev, themeColor, cartComponentsCornerType, cartComponentsCornerRadius, backgroundSubdued, }: {
4
4
  value: number;
5
5
  handleItemQuantityIncrement: () => Promise<void>;
6
6
  handleItemQuantityDecrement: () => Promise<void>;
7
- disabled?: boolean | undefined;
8
7
  isDev?: boolean | undefined;
9
8
  themeColor?: string | undefined;
10
9
  cartComponentsCornerType?: "rounded" | "sharp" | undefined;