yt-uikit 0.9.39 → 0.10.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,396 @@
1
+ import { CouponTemplate } from "./WaysToRedeem";
2
+ export interface LoyaltyProfileProps {
3
+ isMobile?: boolean;
4
+ previewMode?: boolean;
5
+ bannerBackground?: string;
6
+ bannerBackgroundType?: 'shape' | 'static';
7
+ bannerImage?: string;
8
+ bannerTextColor?: string;
9
+ bannerTextAlignment?: 'start' | 'center' | 'end';
10
+ showWatermark?: boolean;
11
+ watermarkColor?: string;
12
+ themePrimaryColor?: string;
13
+ themeContrastColor?: string;
14
+ themeSecondaryColor?: string;
15
+ themeSecondaryContrastColor?: string;
16
+ themeBackgroundColor?: string;
17
+ themeTextColor?: string;
18
+ themeAccentColor?: string;
19
+ widgetOpen?: boolean;
20
+ widgetPosition?: 'start' | 'center' | 'end';
21
+ widgetRoundedCorners?: boolean;
22
+ ctaPrimaryColor?: string;
23
+ ctaPrimaryContrastColor?: string;
24
+ ctaBorderColor?: string;
25
+ ctaSecondaryColor?: string;
26
+ ctaSecondaryContrastColor?: string;
27
+ ctaShowIcon?: boolean;
28
+ ctaBorderRadius?: string;
29
+ showWaysToEarn?: boolean;
30
+ showWCoinValue?: boolean;
31
+ showReferral?: boolean;
32
+ showTransactions?: boolean;
33
+ showVipSection?: boolean;
34
+ showLogo?: boolean;
35
+ brandName?: string;
36
+ headingEyebrow?: string;
37
+ userGreeting?: string;
38
+ balanceCoins?: number | string;
39
+ maxRedeemableCoins?: number | string;
40
+ coinValInr?: number | string;
41
+ currencyCode?: string;
42
+ tokenName?: string;
43
+ brandLogoUrl?: string;
44
+ rateTitle?: string;
45
+ rateSub?: string;
46
+ couponHeading?: string;
47
+ couponCode?: string;
48
+ couponImage?: string;
49
+ onCouponAvail: (couponTemplateId: number) => Promise<CouponAvailResponse>;
50
+ couponList?: CouponTemplate[];
51
+ referralLink?: string;
52
+ userRewardTier?: UserRewardTier;
53
+ brandRewardTiers?: RewardTier[];
54
+ userData?: UserData;
55
+ activityRewards?: BrandActivityRewardSettings;
56
+ brandRewardProgram: BrandRewardProgram;
57
+ onBirthdayUpdate: (date: string) => Promise<boolean>;
58
+ onSocialClick: (url: string, type: string) => Promise<boolean>;
59
+ isLoading: boolean;
60
+ onWaysToRedeem?: () => void;
61
+ onClose?: () => void;
62
+ onLogout?: () => void;
63
+ }
64
+ export interface RewardsModalProps {
65
+ isLoading?: boolean;
66
+ themeBackgroundColor?: string;
67
+ themeTextColor?: string;
68
+ themeAccentColor?: string;
69
+ bannerBackground?: string;
70
+ bannerBackgroundType?: 'shape' | 'static';
71
+ bannerImage?: string;
72
+ bannerTextColor?: string;
73
+ watermarkColor?: string;
74
+ widgetRoundedCorners?: boolean;
75
+ guestWidgetImage?: string;
76
+ bannerTextAlignment?: 'start' | 'center' | 'end';
77
+ showWatermark?: boolean;
78
+ showLogo?: boolean;
79
+ logourl?: string;
80
+ guestGreeting?: string;
81
+ existingUserGreeting?: string;
82
+ phone?: string;
83
+ email?: string;
84
+ emailRequired?: boolean;
85
+ validatePhone?: (newVal: boolean) => void;
86
+ setEmailRequired?: (newVal: boolean) => void;
87
+ onPhoneChange?: (newVal: string) => void;
88
+ onEmailChange?: (newVal: string) => void;
89
+ onClose?: () => void;
90
+ onRegister?: (val?: string) => Promise<boolean>;
91
+ handleChangeNumber?: () => void;
92
+ handleResendOtp?: () => void;
93
+ handleSessionDetected?: () => void;
94
+ onSendOTP?: () => Promise<boolean>;
95
+ isSessionDetected?: boolean;
96
+ authType?: 'default' | 'phone' | 'ytAuth' | 'email';
97
+ formFilled?: boolean;
98
+ rediectUrl?: string;
99
+ ctaTitle?: string;
100
+ ctaMainColor?: string;
101
+ ctaMainContrastColor?: string;
102
+ ctaPrimaryColor?: string;
103
+ ctaPrimaryContrastColor?: string;
104
+ registerLink?: string;
105
+ brandTitle?: string;
106
+ brandLogoUrl?: string;
107
+ widgetOpen?: boolean;
108
+ heading?: string;
109
+ subcopy?: string;
110
+ termsHref?: string;
111
+ privacyHref?: string;
112
+ styleVars?: Record<string, string>;
113
+ countryCode?: string;
114
+ isMobilePreview?: boolean;
115
+ viewportMode?: "auto" | "mobile" | "desktop";
116
+ }
117
+ export interface AvailableDiscount {
118
+ discountCode: string;
119
+ discountValueInInr: string;
120
+ __entity?: 'Discount' | string;
121
+ }
122
+ export interface CatalogDealsProductsPayload {
123
+ productGid: string;
124
+ variantGid: string;
125
+ }
126
+ export interface CustomBenefitPayload {
127
+ title: string;
128
+ value?: string;
129
+ description?: string;
130
+ icon?: string;
131
+ }
132
+ export interface RewardTier {
133
+ id: number;
134
+ name: string;
135
+ brandId: number;
136
+ rewardMultiplier: number;
137
+ redemptionMultiplier: number;
138
+ rewardTierCriteria: "ltv" | "loyalty_points" | "payment" | null;
139
+ minimumLtvRequired: number | null;
140
+ minimumLoyaltyPointsRequired: number | null;
141
+ loyaltyRewardMultiplier: number | null;
142
+ birthdayRewardMultiplier: number | null;
143
+ socialTwitterRewardMultiplier: number | null;
144
+ socialInstagramRewardMultiplier: number | null;
145
+ socialFacebookRewardMultiplier: number | null;
146
+ socialYoutubeRewardMultiplier: number | null;
147
+ referrerOrderRewardMultiplier: number | null;
148
+ icon: string | null;
149
+ benefits: Record<string, unknown>;
150
+ createdAt: string;
151
+ updatedAt: string;
152
+ expiresInDays: number | null;
153
+ membershipEligibilityProductId: string | null;
154
+ shopifyCustomerTags: {
155
+ tags: string[];
156
+ };
157
+ isActive: boolean;
158
+ couponTemplateId: number | null;
159
+ purchaseValueMethod?: "order_count" | "purchase_value" | null;
160
+ paidMethod?: "purchase_in_cash" | "purchase_in_points" | null;
161
+ period?: "lifetime" | "annual" | "custom" | null;
162
+ periodDurationInMonths?: number | null;
163
+ continuationCriteria?: number | null;
164
+ minimumOrderCountRequired?: number | null;
165
+ minimumOrderValueRequired?: number | null;
166
+ minimumCashRequired?: number | null;
167
+ minimumPointsRequired?: number | null;
168
+ tierThemeColor?: string | null;
169
+ widgetVisibility?: boolean | null;
170
+ membershipTierProductTitle?: string | null;
171
+ membershipTierProductDescription?: string | null;
172
+ membershipTierProductMedia?: string | null;
173
+ customBenefits?: CustomBenefitPayload[] | null;
174
+ catalogDealsProducts?: CatalogDealsProductsPayload[];
175
+ }
176
+ export type UserRewardTier = {
177
+ currentPoints?: number;
178
+ totalOrders?: number;
179
+ currentLtv?: number;
180
+ currentTier: RewardTier | null;
181
+ nextTier: RewardTier | null;
182
+ };
183
+ export interface UserData {
184
+ id: number;
185
+ points: number;
186
+ aggregatedPoints: number;
187
+ previouslyOrdered: boolean;
188
+ __entity?: 'UserBrandLink' | string;
189
+ availableDiscount?: AvailableDiscount | null;
190
+ hasSetBirthday: boolean;
191
+ hasFollowedOnInstagram: boolean;
192
+ hasLikedOnFacebook: boolean;
193
+ hasSharedOnFacebook: boolean;
194
+ hasFollowedOnTwitter: boolean;
195
+ hasSubscribedOnYoutube: boolean;
196
+ hasClickedOnCustomLink: boolean;
197
+ hasAvailedFirstOrderReward: boolean;
198
+ hasAvailedSecondOrderReward: boolean;
199
+ }
200
+ export interface BrandRewardProgram {
201
+ id: number;
202
+ brandId: number;
203
+ programStatus: boolean;
204
+ programIcon: string;
205
+ programAuthType: string;
206
+ programTitle: string;
207
+ programVisibility: boolean;
208
+ pointsValueInInr: number;
209
+ coinName: string;
210
+ organizationIdSync: boolean;
211
+ orderCreditCriteria: string;
212
+ orderCreditStatus: boolean;
213
+ orderCreditType: string;
214
+ orderCreditValue: number;
215
+ orderCreditMethodRestriction: string;
216
+ orderCreditProductRestriction: any[];
217
+ coinExpirationPeriod: number;
218
+ redemptionMethod: string;
219
+ redemptionValue: number;
220
+ redemptionStatus: boolean;
221
+ redemptionIcon: string;
222
+ redemptionMaxPoints: number;
223
+ redemptionMovRequired: number;
224
+ redemptionCodeCombination: boolean;
225
+ orderRewardCreditReversal: boolean;
226
+ orderRewardRedemtionReversal: boolean;
227
+ createdAt: string;
228
+ updatedAt: string;
229
+ deletedAt: string | null;
230
+ __entity: string;
231
+ }
232
+ export interface BrandActivityRewardSettings {
233
+ id: number;
234
+ brandId: number;
235
+ programId: number;
236
+ creditOnActivitiesProperties: CreditOnActivitiesProperties;
237
+ creditOnSignupValue: number | null;
238
+ creditOnFirstOrderValue: number | null;
239
+ creditOnFeedbackValue: number | null;
240
+ creditOnBirthdayValue: number | null;
241
+ creditOnInstagramFollowValue: number | null;
242
+ creditOnInstagramShareValue: number | null;
243
+ creditOnInstagramLikeValue: number | null;
244
+ creditOnFacebookFollowValue: number | null;
245
+ creditOnFacebookShareValue: number | null;
246
+ creditOnFacebookLikeValue: number | null;
247
+ creditOnTwitterFollowValue: number | null;
248
+ creditOnTwitterShareValue: number | null;
249
+ creditOnTwitterLikeValue: number | null;
250
+ creditOnYouTubeSubscriptionValue: number | null;
251
+ creditOnYouTubeLikeValue: number | null;
252
+ creditOnYouTubeShareValue: number | null;
253
+ creditOnCustomLinkValue: number | null;
254
+ createdAt: string;
255
+ updatedAt: string;
256
+ deletedAt: string | null;
257
+ __entity: string;
258
+ }
259
+ export interface CreditOnActivitiesProperties {
260
+ customLink: ActivityProperty;
261
+ twitterLike: ActivityProperty;
262
+ youtubeLike: ActivityProperty;
263
+ facebookLike: ActivityProperty;
264
+ referralRewardConfig?: ReferralRewardConfig;
265
+ signUpReward: SignUpRewardProperty;
266
+ twitterShare: ActivityProperty;
267
+ youtubeShare: ActivityProperty;
268
+ facebookShare: ActivityProperty;
269
+ instagramLike: ActivityProperty;
270
+ twitterFollow: ActivityProperty;
271
+ birthdayReward: BirthdayRewardProperty;
272
+ facebookFollow: ActivityProperty;
273
+ feedbackReward: FeedbackRewardProperty;
274
+ instagramFollow: ActivityProperty;
275
+ firstOrderReward: FirstOrderRewardProperty;
276
+ secondOrderReward: SecondOrderRewardProperty;
277
+ youtubeSubscription: ActivityProperty;
278
+ }
279
+ export interface SignUpRewardProperty extends WidgetActivityProperty {
280
+ restrictOnReferralReward?: boolean;
281
+ }
282
+ export interface FeedbackRewardProperty extends WidgetActivityProperty {
283
+ creditCriteria?: string;
284
+ url?: string;
285
+ limitToOneTimePerOrder?: boolean;
286
+ }
287
+ export interface FirstOrderRewardProperty extends WidgetActivityProperty {
288
+ type?: string;
289
+ restrictFirstOrderReward?: boolean;
290
+ restrictOnReferralReward?: boolean;
291
+ }
292
+ export interface SecondOrderRewardProperty extends WidgetActivityProperty {
293
+ type?: string;
294
+ restrictPurchaseReward?: boolean;
295
+ }
296
+ export interface BrandActivityRewardSettings {
297
+ id: number;
298
+ brandId: number;
299
+ programId: number;
300
+ creditOnActivitiesProperties: CreditOnActivitiesProperties;
301
+ creditOnSignupValue: number | null;
302
+ creditOnFirstOrderValue: number | null;
303
+ creditOnSecondOrderValue: number | null;
304
+ creditOnFeedbackValue: number | null;
305
+ creditOnBirthdayValue: number | null;
306
+ creditOnInstagramFollowValue: number | null;
307
+ creditOnInstagramShareValue: number | null;
308
+ creditOnInstagramLikeValue: number | null;
309
+ creditOnFacebookFollowValue: number | null;
310
+ creditOnFacebookShareValue: number | null;
311
+ creditOnFacebookLikeValue: number | null;
312
+ creditOnTwitterFollowValue: number | null;
313
+ creditOnTwitterShareValue: number | null;
314
+ creditOnTwitterLikeValue: number | null;
315
+ creditOnYouTubeSubscriptionValue: number | null;
316
+ creditOnYouTubeLikeValue: number | null;
317
+ creditOnYouTubeShareValue: number | null;
318
+ creditOnCustomLinkValue: number | null;
319
+ createdAt: string;
320
+ updatedAt: string;
321
+ deletedAt: string | null;
322
+ __entity: string;
323
+ }
324
+ export interface ActivityProperty {
325
+ url?: string;
326
+ icon?: string;
327
+ status?: boolean;
328
+ enabled?: boolean;
329
+ offerTitle?: string;
330
+ }
331
+ export interface WidgetActivityProperty {
332
+ icon?: string;
333
+ status?: boolean;
334
+ enabled?: boolean;
335
+ offerTitle?: string;
336
+ widgetVisibility?: boolean;
337
+ }
338
+ export interface BirthdayRewardProperty extends WidgetActivityProperty {
339
+ type?: string;
340
+ }
341
+ export interface ReferralRewardConfig {
342
+ enabled?: boolean;
343
+ shareMethod?: "referral_code" | "referral_url";
344
+ codePrefix?: string;
345
+ campaignVisibility?: "ways_to_earn" | "details" | "both";
346
+ offerTitle?: string;
347
+ offerIcon?: string;
348
+ customizeReferralSectionContent?: boolean;
349
+ referrerReward?: ReferralRewardDetails;
350
+ refereeReward?: ReferralRewardDetails;
351
+ }
352
+ export interface ReferralRewardDetails {
353
+ enabled?: boolean;
354
+ method?: "points" | "discount_code" | "freebie";
355
+ completionCriteria?: "signup" | "purchase" | "first_order";
356
+ pointsConfig?: {
357
+ points: number;
358
+ } | null;
359
+ discountConfig?: {
360
+ type: "percentage_off" | "fixed_amount" | "referee_order_value";
361
+ value: number;
362
+ expiresInDays?: number | null;
363
+ appliesTo: {
364
+ type: "all_products" | "collections";
365
+ collectionIds?: string[];
366
+ };
367
+ } | null;
368
+ freebieConfig?: {
369
+ freebieType?: string;
370
+ } | null;
371
+ }
372
+ export interface CouponAvailResponse {
373
+ discountCode: string;
374
+ discountValueInInr: number;
375
+ expiresAt: string;
376
+ shopifyStoreId: string;
377
+ brandId: number;
378
+ userId: number;
379
+ couponTemplateId: number;
380
+ discountType: string;
381
+ shopifyDiscountCodeId: string;
382
+ creationMethod: string;
383
+ discountPercentage: number | null;
384
+ expiredAt: string | null;
385
+ discountUsageCount: number | null;
386
+ isUsed: boolean;
387
+ minPurchaseAmount: number | null;
388
+ freeProductId: number | null;
389
+ metafieldId: number | null;
390
+ metafieldJsonValue: any | null;
391
+ discountId: number;
392
+ isActive: boolean;
393
+ deletedAt: string | null;
394
+ createdAt: string;
395
+ updatedAt: string;
396
+ }
@@ -3,7 +3,12 @@ export { default as SpinnerWheel } from "./SpinnerWheel";
3
3
  export { default as Cart } from "./Cart";
4
4
  export { default as Bundle } from "./BundleBlock";
5
5
  export { default as BundleLoader } from "./BundleBlock/Loader";
6
+ export { LoyaltyProfile as LoyaltyScreen } from "./Loyalty";
7
+ export { LoyaltyLauncher as LoyaltyLauncher } from "./Loyalty";
8
+ export { RewardsModal as RewardsModal } from "./Loyalty";
9
+ export { LoyaltyWidget as LoyaltyWidget } from "./Loyalty";
6
10
  export { LoyaltyProductCatalog as LoyaltyProductCatalog } from "./Loyalty";
11
+ export { PointEarnBadge as PointEarnBadge } from "./Loyalty";
7
12
  export type { LoyaltyProductCatalogConfig, LoyaltyCatalogProduct, LoyaltyCatalogTier, LoyaltyCatalogFilter, CatalogDisplayMode, CatalogTextAlignment, } from "./Loyalty";
8
13
  export { default as LoyaltyPageBlock, LoyaltyPageConfigType, LoyaltyPageProps, } from "./LoyaltyPageBlock/LoyaltyPageBlock";
9
14
  export { default as ProductOffers, ProductsOffersConfigType, CartCheckpoint, } from "./ProductOffersBlock/ProductsOffers";