yt-uikit 0.10.73 → 0.10.74-image-upload-addon.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.
@@ -83,6 +83,15 @@ export interface CouponSelectionData {
83
83
  couponTextSuffix?: string;
84
84
  applyButtonText?: string;
85
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
+ }
86
95
  export interface CartProps {
87
96
  isOpen: boolean;
88
97
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
@@ -256,6 +265,7 @@ export interface CartProps {
256
265
  showTrustedBadge?: boolean;
257
266
  trustedBadgeData?: trustedBadgeInterface;
258
267
  drawerLayoutData?: DrawerLayout;
268
+ uploadImageAddonData?: uploadImageAddonInterface;
259
269
  }
260
270
  declare const _default: React.NamedExoticComponent<CartProps>;
261
271
  export default _default;
@@ -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,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;