yt-uikit 0.7.404-manual-recs.2 → 0.7.404-scrap-code.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 (55) hide show
  1. package/dist/esm/components/BundleBlock/BundleBuilder/ResponsiveBgImage.d.ts +9 -0
  2. package/dist/esm/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +22 -2776
  3. package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +47 -5740
  4. package/dist/esm/components/BundleBlock/BundleProductDetailsModal/bundleProductDetailsModal.style.d.ts +7 -830
  5. package/dist/esm/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +103 -0
  6. package/dist/esm/components/BundleBlock/CollectionBundle/FileUpload.d.ts +15 -0
  7. package/dist/esm/components/BundleBlock/CollectionBundle/LoadingSpinner.d.ts +2 -0
  8. package/dist/esm/components/BundleBlock/CollectionBundle/ProductDetailsModal.d.ts +15 -0
  9. package/dist/esm/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +68 -15003
  10. package/dist/esm/components/BundleBlock/MixAndMatchBundle/mixAndMatchBundle.style.d.ts +50 -6336
  11. package/dist/esm/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +44 -4977
  12. package/dist/esm/components/Cart/Cart.d.ts +0 -19
  13. package/dist/esm/components/Cart/CartProductsList.d.ts +0 -1
  14. package/dist/esm/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
  15. package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.styled.d.ts +20 -564
  16. package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.styled.d.ts +12 -1098
  17. package/dist/esm/components/Cart/ProductCard.d.ts +1 -2
  18. package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.styled.d.ts +39 -6295
  19. package/dist/esm/components/index.d.ts +0 -1
  20. package/dist/esm/index.js +400 -423
  21. package/dist/esm/types/components/BundleBlock/BundleBuilder/ResponsiveBgImage.d.ts +9 -0
  22. package/dist/esm/types/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +22 -2776
  23. package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +47 -5740
  24. package/dist/esm/types/components/BundleBlock/BundleProductDetailsModal/bundleProductDetailsModal.style.d.ts +7 -830
  25. package/dist/esm/types/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +103 -0
  26. package/dist/esm/types/components/BundleBlock/CollectionBundle/FileUpload.d.ts +15 -0
  27. package/dist/esm/types/components/BundleBlock/CollectionBundle/LoadingSpinner.d.ts +2 -0
  28. package/dist/esm/types/components/BundleBlock/CollectionBundle/ProductDetailsModal.d.ts +15 -0
  29. package/dist/esm/types/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +68 -15003
  30. package/dist/esm/types/components/BundleBlock/MixAndMatchBundle/mixAndMatchBundle.style.d.ts +50 -6336
  31. package/dist/esm/types/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +44 -4977
  32. package/dist/esm/types/components/Cart/Cart.d.ts +0 -19
  33. package/dist/esm/types/components/Cart/CartProductsList.d.ts +0 -1
  34. package/dist/esm/types/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
  35. package/dist/esm/types/components/Cart/MultiStepProgressBar/MultiStepProgressBar.styled.d.ts +20 -564
  36. package/dist/esm/types/components/Cart/MultiStepProgressBar/SingleTierProgressBar.styled.d.ts +12 -1098
  37. package/dist/esm/types/components/Cart/ProductCard.d.ts +1 -2
  38. package/dist/esm/types/components/Cart/VariantSelectionPopup/DesktopVariantPopup.styled.d.ts +39 -6295
  39. package/dist/esm/types/components/index.d.ts +0 -1
  40. package/dist/esm/types/utils/freebieErrorLogger.d.ts +68 -0
  41. package/dist/esm/types/utils/freebieValidation.d.ts +45 -0
  42. package/dist/esm/utils/freebieErrorLogger.d.ts +68 -0
  43. package/dist/esm/utils/freebieValidation.d.ts +45 -0
  44. package/dist/index.d.ts +1 -32
  45. package/package.json +1 -1
  46. package/dist/esm/atoms/comboBundleAtom.d.ts +0 -12
  47. package/dist/esm/components/Cart/LoyaltyCTA.styled.d.ts +0 -822
  48. package/dist/esm/components/Cart/NoteSection.styled.d.ts +0 -832
  49. package/dist/esm/components/Cart/StandardDelivery.styled.d.ts +0 -3282
  50. package/dist/esm/types/atoms/comboBundleAtom.d.ts +0 -12
  51. package/dist/esm/types/components/Cart/LoyaltyCTA.styled.d.ts +0 -822
  52. package/dist/esm/types/components/Cart/NoteSection.styled.d.ts +0 -832
  53. package/dist/esm/types/components/Cart/StandardDelivery.styled.d.ts +0 -3282
  54. package/dist/esm/types/utils/comboBundleStorage.d.ts +0 -36
  55. package/dist/esm/utils/comboBundleStorage.d.ts +0 -36
@@ -1,6 +1,5 @@
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";
@@ -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,19 +60,6 @@ interface WheelProps {
60
60
  }
61
61
  declare const SpinnerWheel: React.FC<WheelProps>;
62
62
 
63
- interface RewardCouponWithIcon extends RewardCoupon {
64
- icon?: React.ReactElement | null;
65
- }
66
- type CouponFrameProps = {
67
- couponActive: boolean;
68
- rewardCoupon: RewardCouponWithIcon;
69
- currency: string;
70
- handleApply: (templateId?: number) => Promise<any>;
71
- pointsCoupon?: boolean;
72
- pointsToBeUsed?: number;
73
- };
74
- declare const CouponFrame: React.FC<CouponFrameProps>;
75
-
76
63
  interface ShopifyCurrency {
77
64
  rate: number;
78
65
  active: string;
@@ -513,15 +500,6 @@ interface GSTSectionCustomizationProps {
513
500
  textColor?: string;
514
501
  }
515
502
 
516
- interface RewardCoupon {
517
- couponTemplateId: number;
518
- name: string;
519
- couponType: string;
520
- discountPercentage: number | null;
521
- discountValue: number | null;
522
- minimumOrderValue: number | null;
523
- pointsRequired: number | null;
524
- }
525
503
  interface Checkpoint {
526
504
  couponTemplateId: number;
527
505
  couponType: string;
@@ -582,7 +560,6 @@ interface CartProps {
582
560
  handleDecrement: (productId: number, newQuantity?: number) => Promise<any>;
583
561
  bundleProducts?: any;
584
562
  showBundle?: boolean;
585
- showCouponOptions?: boolean;
586
563
  isUserSignedIn?: boolean;
587
564
  loyaltyIcon?: string;
588
565
  discountAmountOff?: number;
@@ -592,8 +569,6 @@ interface CartProps {
592
569
  removeDiscount?: () => Promise<any>;
593
570
  applyDiscount?: () => Promise<any>;
594
571
  discountApplied?: boolean;
595
- rewardCoupons?: RewardCoupon[];
596
- userTotalPoints?: number;
597
572
  joinNowFunction?: () => void;
598
573
  checkoutFunction: (templateId?: number) => Promise<any>;
599
574
  guestLoyaltyPercentage?: number;
@@ -605,16 +580,11 @@ interface CartProps {
605
580
  showCartLevelAltPay?: boolean;
606
581
  redemptionRate: number;
607
582
  pointsRewardRate: number;
608
- showGuestDiscountCoupon?: boolean;
609
- guestRewardCoupon?: RewardCouponWithIcon;
610
- applyTemplateDiscount?: (templateId?: number) => Promise<any>;
611
583
  exploreCtaRedirectLink?: string;
612
584
  discountAmountApplied?: number;
613
585
  minimumCartValue?: number;
614
586
  discountInCheckoutButton?: boolean | string;
615
587
  isStickyCheckout?: boolean;
616
- showDiscountsListToGuestUsers?: boolean;
617
- showApplyCouponsButtonToGuestUsers?: boolean;
618
588
  handleCheckpointCrossed?: (checkpoint: Checkpoint, cartAmount: number) => Promise<any>;
619
589
  customCartProgressBarCriteria?: string;
620
590
  primaryTextColor?: string;
@@ -659,7 +629,6 @@ interface CartProps {
659
629
  productPercentageOffMapping: {
660
630
  [variantId: string]: number;
661
631
  };
662
- productTagsMapping?: Map<string, string[]>;
663
632
  removeFreebieFromCart?: (lineItemKey: string) => Promise<void>;
664
633
  postalCodeList?: number[];
665
634
  enableGeoLocationDeliveryRestriction?: boolean;
@@ -731,4 +700,4 @@ declare const Cart: React.FC<CartProps>;
731
700
  type BundleLoaderProps = {};
732
701
  declare const BundleLoader: React.FC<BundleLoaderProps>;
733
702
 
734
- export { Bundle, BundleLoader, Cart, CouponFrame, Nudge, SpinnerWheel };
703
+ export { Bundle, BundleLoader, Cart, Nudge, SpinnerWheel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.7.404-manual-recs.2",
3
+ "version": "0.7.404-scrap-code.0",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",
@@ -1,12 +0,0 @@
1
- import { BundlePayload } from "../components/BundleBlock/Bundle";
2
- interface ComboBundleState {
3
- comboBundleData: BundlePayload | null;
4
- comboBundleAddToCartFunction: ((selectedItemsSubtotal: number, variantIds?: string[], finalBundlePrice?: number, variantIdPriceMap?: {
5
- variantId: string;
6
- price: number;
7
- }[]) => Promise<void>) | null;
8
- }
9
- export declare const comboBundleState: import("jotai").PrimitiveAtom<ComboBundleState> & {
10
- init: ComboBundleState;
11
- };
12
- export {};