yt-uikit 0.8.16 → 0.8.17-drawer-layout.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.
Files changed (29) hide show
  1. package/dist/esm/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +1 -3
  2. package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +1 -3
  3. package/dist/esm/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +3 -9
  4. package/dist/esm/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +1 -3
  5. package/dist/esm/components/Cart/Cart.d.ts +2 -0
  6. package/dist/esm/components/Cart/CartDrawer.d.ts +9 -0
  7. package/dist/esm/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
  8. package/dist/esm/index.js +71 -71
  9. package/dist/esm/types/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +1 -3
  10. package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +1 -3
  11. package/dist/esm/types/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +3 -9
  12. package/dist/esm/types/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +1 -3
  13. package/dist/esm/types/components/Cart/Cart.d.ts +2 -0
  14. package/dist/esm/types/components/Cart/CartDrawer.d.ts +9 -0
  15. package/dist/esm/types/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
  16. package/dist/esm/types/utils/freebieErrorLogger.d.ts +68 -0
  17. package/dist/esm/types/utils/freebieValidation.d.ts +45 -0
  18. package/dist/esm/utils/freebieErrorLogger.d.ts +68 -0
  19. package/dist/esm/utils/freebieValidation.d.ts +45 -0
  20. package/dist/index.d.ts +10 -0
  21. package/package.json +1 -1
  22. package/dist/esm/components/Cart/MobileMiniCart.d.ts +0 -21
  23. package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.styled.d.ts +0 -49
  24. package/dist/esm/components/shared/Spinner.d.ts +0 -23
  25. package/dist/esm/components/shared/index.d.ts +0 -2
  26. package/dist/esm/types/components/Cart/MobileMiniCart.d.ts +0 -21
  27. package/dist/esm/types/components/Cart/VariantSelectionPopup/MobileVariantPopover.styled.d.ts +0 -49
  28. package/dist/esm/types/components/shared/Spinner.d.ts +0 -23
  29. package/dist/esm/types/components/shared/index.d.ts +0 -2
@@ -28,9 +28,7 @@ export declare const PriceContainer: import("styled-components/dist/types").ISty
28
28
  export declare const AddToBundleWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
29
29
  borderRadius: string;
30
30
  }>> & string;
31
- export declare const AddedButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>, "ref"> & {
32
- ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
33
- }, {
31
+ export declare const AddedButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>, {
34
32
  borderRadius: string;
35
33
  }>> & string;
36
34
  export declare const AddedButtonText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -30,9 +30,7 @@ export declare const ItemImageBox: import("styled-components/dist/types").IStyle
30
30
  export declare const QuantityBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
31
31
  borderRadius: string;
32
32
  }>> & string;
33
- export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
35
- }>, never>, never>> & string;
33
+ export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
36
34
  export declare const DetailedItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
37
35
  borderRadius: string;
38
36
  }>> & string;
@@ -48,9 +48,7 @@ export declare const PriceLine: import("styled-components/dist/types").IStyledCo
48
48
  export declare const SummaryBlock: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
49
49
  export declare const AddBundleButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
50
50
  export declare const PlusWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
51
- export declare const PlusWrapperWithHiding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
52
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
53
- }, never>> & string;
51
+ export declare const PlusWrapperWithHiding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
54
52
  export declare const PlusSeparator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
55
53
  export declare const DropdownContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
56
54
  export declare const DropdownHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -74,17 +72,13 @@ export declare const OptionRow: import("styled-components/dist/types").IStyledCo
74
72
  export declare const OptionLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
75
73
  export declare const CheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
76
74
  export declare const HiddenCheckbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
77
- export declare const StyledCheckboxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
78
- ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
79
- }>, never>, {
75
+ export declare const StyledCheckboxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>, never>, {
80
76
  isChecked: boolean;
81
77
  borderColor?: string | undefined;
82
78
  borderRadius?: string | undefined;
83
79
  backgroundColor?: string | undefined;
84
80
  }>> & string;
85
81
  export declare const HorizontalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
86
- export declare const VerticalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
87
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
88
- }, {
82
+ export declare const VerticalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, {
89
83
  isImage?: boolean | undefined;
90
84
  }>> & string;
@@ -61,9 +61,7 @@ export declare const RadioWrapper: import("styled-components/dist/types").IStyle
61
61
  isActive?: boolean | undefined;
62
62
  accentColor?: string | undefined;
63
63
  }>> & string;
64
- export declare const HiddenRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
65
- ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
66
- }>, never>, never>> & string;
64
+ export declare const HiddenRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, never>, never>> & string;
67
65
  export declare const CustomRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
68
66
  accentColor?: string | undefined;
69
67
  }>> & string;
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { DrawerLayout } from "./CartDrawer";
2
3
  import { stickyCartCustomizationDataProps } from "./StickyCart";
3
4
  import { CartOffersCarousalProps } from "./CartOffersCarousel";
4
5
  import { freebieMilestoneProps } from "./NextFreebieRow";
@@ -213,6 +214,7 @@ export interface CartProps {
213
214
  variantId: string;
214
215
  price: number;
215
216
  }[]) => Promise<void>;
217
+ drawerLayout?: DrawerLayout;
216
218
  }
217
219
  declare const Cart: React.FC<CartProps>;
218
220
  export default Cart;
@@ -16,6 +16,15 @@ interface CartDrawerProps extends CartProps {
16
16
  enableConfetti?: boolean;
17
17
  checkoutSectionMessageRedirectLink?: string;
18
18
  showCheckoutButtonPaymentIcons?: boolean;
19
+ drawerLayout?: DrawerLayout;
20
+ }
21
+ export interface DrawerLayout {
22
+ headerIds?: string[];
23
+ scroll?: {
24
+ topIds?: string[];
25
+ bottomIds?: string[];
26
+ };
27
+ footerIds?: string[];
19
28
  }
20
29
  declare const CartDrawer: React.FC<CartDrawerProps>;
21
30
  export default CartDrawer;
@@ -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>;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Centralized error logging utility for Freebie Claim components
3
+ * Provides detailed error logging with context to help debug issues across stores
4
+ */
5
+ export declare enum FreebieErrorSeverity {
6
+ WARNING = "WARNING",
7
+ ERROR = "ERROR",
8
+ CRITICAL = "CRITICAL"
9
+ }
10
+ export interface FreebieErrorContext {
11
+ component?: string;
12
+ productId?: string;
13
+ productTitle?: string;
14
+ variantId?: string;
15
+ checkpointId?: number;
16
+ storeData?: any;
17
+ additionalData?: any;
18
+ }
19
+ export interface FreebieError {
20
+ severity: FreebieErrorSeverity;
21
+ message: string;
22
+ context: FreebieErrorContext;
23
+ timestamp: string;
24
+ }
25
+ declare class FreebieErrorLogger {
26
+ private errors;
27
+ private maxErrors;
28
+ /**
29
+ * Log an error with context
30
+ */
31
+ log(severity: FreebieErrorSeverity, message: string, context?: FreebieErrorContext): void;
32
+ /**
33
+ * Log a warning
34
+ */
35
+ warn(message: string, context?: FreebieErrorContext): void;
36
+ /**
37
+ * Log an error
38
+ */
39
+ error(message: string, context?: FreebieErrorContext): void;
40
+ /**
41
+ * Log a critical error
42
+ */
43
+ critical(message: string, context?: FreebieErrorContext): void;
44
+ /**
45
+ * Get all logged errors
46
+ */
47
+ getErrors(): FreebieError[];
48
+ /**
49
+ * Get errors by severity
50
+ */
51
+ getErrorsBySeverity(severity: FreebieErrorSeverity): FreebieError[];
52
+ /**
53
+ * Clear all errors
54
+ */
55
+ clearErrors(): void;
56
+ /**
57
+ * Export errors as JSON for debugging
58
+ */
59
+ exportErrors(): string;
60
+ }
61
+ export declare const freebieErrorLogger: FreebieErrorLogger;
62
+ export declare const logMissingProp: (component: string, propName: string, additionalContext?: any) => void;
63
+ export declare const logInvalidData: (component: string, dataType: string, issue: string, data?: any) => void;
64
+ export declare const logProductError: (component: string, message: string, productId?: string, productTitle?: string, additionalData?: any) => void;
65
+ export declare const logVariantError: (component: string, message: string, productId?: string, variantId?: string, additionalData?: any) => void;
66
+ export declare const logCheckpointError: (component: string, message: string, checkpointId?: number, additionalData?: any) => void;
67
+ export declare const logWarning: (component: string, message: string, context?: FreebieErrorContext) => void;
68
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Validation utilities for Freebie Claim components
3
+ * Validates product data, configuration, and required props
4
+ */
5
+ export interface ValidationResult {
6
+ isValid: boolean;
7
+ errors: string[];
8
+ warnings: string[];
9
+ }
10
+ /**
11
+ * Validate that required props are present
12
+ */
13
+ export declare const validateRequiredProps: (component: string, props: {
14
+ freebieProductsInCart?: any[];
15
+ addFreebieToCart?: Function;
16
+ freebiesInCart?: string[];
17
+ }) => ValidationResult;
18
+ /**
19
+ * Validate product data structure
20
+ */
21
+ export declare const validateProductData: (component: string, product: any, index?: number) => ValidationResult;
22
+ /**
23
+ * Validate all products in cart
24
+ */
25
+ export declare const validateAllProducts: (component: string, products: any[]) => ValidationResult;
26
+ /**
27
+ * Validate variant data
28
+ */
29
+ export declare const validateVariantData: (component: string, variant: any, productId?: string) => ValidationResult;
30
+ /**
31
+ * Validate checkpoint data
32
+ */
33
+ export declare const validateCheckpoint: (component: string, checkpoint: any) => ValidationResult;
34
+ /**
35
+ * Validate freebie claim configuration
36
+ */
37
+ export declare const validateFreebieClaimData: (component: string, freebieClaimData: any) => ValidationResult;
38
+ /**
39
+ * Validate that products match inventory requirements
40
+ */
41
+ export declare const validateInventoryQuantity: (component: string, product: any, shouldCheckInventoryQuantity: boolean) => ValidationResult;
42
+ /**
43
+ * Log validation summary
44
+ */
45
+ export declare const logValidationSummary: (component: string, validationResults: ValidationResult[]) => void;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Centralized error logging utility for Freebie Claim components
3
+ * Provides detailed error logging with context to help debug issues across stores
4
+ */
5
+ export declare enum FreebieErrorSeverity {
6
+ WARNING = "WARNING",
7
+ ERROR = "ERROR",
8
+ CRITICAL = "CRITICAL"
9
+ }
10
+ export interface FreebieErrorContext {
11
+ component?: string;
12
+ productId?: string;
13
+ productTitle?: string;
14
+ variantId?: string;
15
+ checkpointId?: number;
16
+ storeData?: any;
17
+ additionalData?: any;
18
+ }
19
+ export interface FreebieError {
20
+ severity: FreebieErrorSeverity;
21
+ message: string;
22
+ context: FreebieErrorContext;
23
+ timestamp: string;
24
+ }
25
+ declare class FreebieErrorLogger {
26
+ private errors;
27
+ private maxErrors;
28
+ /**
29
+ * Log an error with context
30
+ */
31
+ log(severity: FreebieErrorSeverity, message: string, context?: FreebieErrorContext): void;
32
+ /**
33
+ * Log a warning
34
+ */
35
+ warn(message: string, context?: FreebieErrorContext): void;
36
+ /**
37
+ * Log an error
38
+ */
39
+ error(message: string, context?: FreebieErrorContext): void;
40
+ /**
41
+ * Log a critical error
42
+ */
43
+ critical(message: string, context?: FreebieErrorContext): void;
44
+ /**
45
+ * Get all logged errors
46
+ */
47
+ getErrors(): FreebieError[];
48
+ /**
49
+ * Get errors by severity
50
+ */
51
+ getErrorsBySeverity(severity: FreebieErrorSeverity): FreebieError[];
52
+ /**
53
+ * Clear all errors
54
+ */
55
+ clearErrors(): void;
56
+ /**
57
+ * Export errors as JSON for debugging
58
+ */
59
+ exportErrors(): string;
60
+ }
61
+ export declare const freebieErrorLogger: FreebieErrorLogger;
62
+ export declare const logMissingProp: (component: string, propName: string, additionalContext?: any) => void;
63
+ export declare const logInvalidData: (component: string, dataType: string, issue: string, data?: any) => void;
64
+ export declare const logProductError: (component: string, message: string, productId?: string, productTitle?: string, additionalData?: any) => void;
65
+ export declare const logVariantError: (component: string, message: string, productId?: string, variantId?: string, additionalData?: any) => void;
66
+ export declare const logCheckpointError: (component: string, message: string, checkpointId?: number, additionalData?: any) => void;
67
+ export declare const logWarning: (component: string, message: string, context?: FreebieErrorContext) => void;
68
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Validation utilities for Freebie Claim components
3
+ * Validates product data, configuration, and required props
4
+ */
5
+ export interface ValidationResult {
6
+ isValid: boolean;
7
+ errors: string[];
8
+ warnings: string[];
9
+ }
10
+ /**
11
+ * Validate that required props are present
12
+ */
13
+ export declare const validateRequiredProps: (component: string, props: {
14
+ freebieProductsInCart?: any[];
15
+ addFreebieToCart?: Function;
16
+ freebiesInCart?: string[];
17
+ }) => ValidationResult;
18
+ /**
19
+ * Validate product data structure
20
+ */
21
+ export declare const validateProductData: (component: string, product: any, index?: number) => ValidationResult;
22
+ /**
23
+ * Validate all products in cart
24
+ */
25
+ export declare const validateAllProducts: (component: string, products: any[]) => ValidationResult;
26
+ /**
27
+ * Validate variant data
28
+ */
29
+ export declare const validateVariantData: (component: string, variant: any, productId?: string) => ValidationResult;
30
+ /**
31
+ * Validate checkpoint data
32
+ */
33
+ export declare const validateCheckpoint: (component: string, checkpoint: any) => ValidationResult;
34
+ /**
35
+ * Validate freebie claim configuration
36
+ */
37
+ export declare const validateFreebieClaimData: (component: string, freebieClaimData: any) => ValidationResult;
38
+ /**
39
+ * Validate that products match inventory requirements
40
+ */
41
+ export declare const validateInventoryQuantity: (component: string, product: any, shouldCheckInventoryQuantity: boolean) => ValidationResult;
42
+ /**
43
+ * Log validation summary
44
+ */
45
+ export declare const logValidationSummary: (component: string, validationResults: ValidationResult[]) => void;
package/dist/index.d.ts CHANGED
@@ -60,6 +60,15 @@ interface WheelProps {
60
60
  }
61
61
  declare const SpinnerWheel: React.FC<WheelProps>;
62
62
 
63
+ interface DrawerLayout {
64
+ headerIds?: string[];
65
+ scroll?: {
66
+ topIds?: string[];
67
+ bottomIds?: string[];
68
+ };
69
+ footerIds?: string[];
70
+ }
71
+
63
72
  interface ShopifyCurrency {
64
73
  rate: number;
65
74
  active: string;
@@ -712,6 +721,7 @@ interface CartProps {
712
721
  variantId: string;
713
722
  price: number;
714
723
  }[]) => Promise<void>;
724
+ drawerLayout?: DrawerLayout;
715
725
  }
716
726
  declare const Cart: React.FC<CartProps>;
717
727
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.8.16",
3
+ "version": "0.8.17-drawer-layout.0",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",
@@ -1,21 +0,0 @@
1
- import React from "react";
2
- import { Checkpoint } from "./Cart";
3
- export interface MobileMiniCartProps {
4
- setIsCartOpen: (isOpen: boolean) => void;
5
- isCartOpen?: boolean;
6
- cartCheckpoints?: Checkpoint[];
7
- customCartProgressBarCriteria?: string;
8
- checkoutSectionMessage?: string;
9
- effectiveQuantityForProgressBar?: number;
10
- themeColor?: string;
11
- themeTextColor?: string;
12
- primaryTextColor?: string;
13
- ctaButtonBackgroundColor?: string;
14
- ctaButtonTextColor?: string;
15
- cartComponentsCornerType?: "rounded" | "sharp";
16
- cartComponentsCornerRadius?: number;
17
- enable?: boolean;
18
- forceShowOnNonHome?: boolean;
19
- }
20
- declare const MobileMiniCart: React.FC<MobileMiniCartProps>;
21
- export default MobileMiniCart;
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const VariantSelectionPopupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const ModalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $themeColor?: string | undefined;
5
- $cornerRadius?: number | undefined;
6
- $backgroundColor?: string | undefined;
7
- }>> & string;
8
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const ProductDetails: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const ProductImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
11
- export declare const ProductInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
- export declare const ProductTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
13
- $themeColor?: string | undefined;
14
- }>> & string;
15
- export declare const ProductPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
- primaryTextColor?: string | undefined;
17
- }>> & string;
18
- export declare const OriginalPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
- export declare const ViewDetailsLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
20
- export declare const OptionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- export declare const OptionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
- export declare const OptionsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
23
- export declare const VariantOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
- $isSelected?: boolean | undefined;
25
- $isDisabled?: boolean | undefined;
26
- $themeColor?: string | undefined;
27
- backgroundColor?: string | undefined;
28
- }>> & string;
29
- export declare const CartButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
- $themeColor: string;
31
- }>> & string;
32
- export declare const LoaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
- export declare const QuantitySelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const MainSelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
- $backgroundColor: string;
36
- }>> & string;
37
- export declare const FlexContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
38
- export declare const DetailsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
39
- export declare const PriceSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
40
- export declare const LinkSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
41
- export declare const ActionsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
42
- export declare const ReplaceButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
43
- export declare const ReplaceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
44
- $themeColor?: string | undefined;
45
- $cornerRadius?: number | undefined;
46
- $cornerType?: string | undefined;
47
- $disabled?: boolean | undefined;
48
- }>> & string;
49
- export declare const ReplaceButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- export interface SpinnerProps {
3
- color?: string;
4
- size?: number;
5
- loading?: boolean;
6
- }
7
- /**
8
- * A lightweight CSS-only spinner component to replace ClipLoader from react-spinners.
9
- * Uses CSS animations for the spinning effect.
10
- */
11
- export declare const Spinner: React.FC<SpinnerProps>;
12
- export interface ScaleLoaderProps {
13
- color?: string;
14
- loading?: boolean;
15
- height?: number;
16
- width?: number;
17
- }
18
- /**
19
- * A lightweight CSS-only scale loader component to replace ScaleLoader from react-spinners.
20
- * Displays animated bars that pulse in sequence.
21
- */
22
- export declare const ScaleLoader: React.FC<ScaleLoaderProps>;
23
- export default Spinner;
@@ -1,2 +0,0 @@
1
- export { Spinner, ScaleLoader } from "./Spinner";
2
- export type { SpinnerProps, ScaleLoaderProps } from "./Spinner";
@@ -1,21 +0,0 @@
1
- import React from "react";
2
- import { Checkpoint } from "./Cart";
3
- export interface MobileMiniCartProps {
4
- setIsCartOpen: (isOpen: boolean) => void;
5
- isCartOpen?: boolean;
6
- cartCheckpoints?: Checkpoint[];
7
- customCartProgressBarCriteria?: string;
8
- checkoutSectionMessage?: string;
9
- effectiveQuantityForProgressBar?: number;
10
- themeColor?: string;
11
- themeTextColor?: string;
12
- primaryTextColor?: string;
13
- ctaButtonBackgroundColor?: string;
14
- ctaButtonTextColor?: string;
15
- cartComponentsCornerType?: "rounded" | "sharp";
16
- cartComponentsCornerRadius?: number;
17
- enable?: boolean;
18
- forceShowOnNonHome?: boolean;
19
- }
20
- declare const MobileMiniCart: React.FC<MobileMiniCartProps>;
21
- export default MobileMiniCart;
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const VariantSelectionPopupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const ModalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $themeColor?: string | undefined;
5
- $cornerRadius?: number | undefined;
6
- $backgroundColor?: string | undefined;
7
- }>> & string;
8
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const ProductDetails: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const ProductImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
11
- export declare const ProductInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
- export declare const ProductTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
13
- $themeColor?: string | undefined;
14
- }>> & string;
15
- export declare const ProductPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
- primaryTextColor?: string | undefined;
17
- }>> & string;
18
- export declare const OriginalPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
- export declare const ViewDetailsLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
20
- export declare const OptionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- export declare const OptionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
- export declare const OptionsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
23
- export declare const VariantOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
- $isSelected?: boolean | undefined;
25
- $isDisabled?: boolean | undefined;
26
- $themeColor?: string | undefined;
27
- backgroundColor?: string | undefined;
28
- }>> & string;
29
- export declare const CartButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
- $themeColor: string;
31
- }>> & string;
32
- export declare const LoaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
- export declare const QuantitySelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const MainSelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
- $backgroundColor: string;
36
- }>> & string;
37
- export declare const FlexContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
38
- export declare const DetailsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
39
- export declare const PriceSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
40
- export declare const LinkSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
41
- export declare const ActionsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
42
- export declare const ReplaceButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
43
- export declare const ReplaceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
44
- $themeColor?: string | undefined;
45
- $cornerRadius?: number | undefined;
46
- $cornerType?: string | undefined;
47
- $disabled?: boolean | undefined;
48
- }>> & string;
49
- export declare const ReplaceButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- export interface SpinnerProps {
3
- color?: string;
4
- size?: number;
5
- loading?: boolean;
6
- }
7
- /**
8
- * A lightweight CSS-only spinner component to replace ClipLoader from react-spinners.
9
- * Uses CSS animations for the spinning effect.
10
- */
11
- export declare const Spinner: React.FC<SpinnerProps>;
12
- export interface ScaleLoaderProps {
13
- color?: string;
14
- loading?: boolean;
15
- height?: number;
16
- width?: number;
17
- }
18
- /**
19
- * A lightweight CSS-only scale loader component to replace ScaleLoader from react-spinners.
20
- * Displays animated bars that pulse in sequence.
21
- */
22
- export declare const ScaleLoader: React.FC<ScaleLoaderProps>;
23
- export default Spinner;
@@ -1,2 +0,0 @@
1
- export { Spinner, ScaleLoader } from "./Spinner";
2
- export type { SpinnerProps, ScaleLoaderProps } from "./Spinner";