import React from "react"; import "../Loyalty/fonts.css"; type LoyaltyVisibility = "show" | "hide"; type LoyaltyAlignment = "left" | "center" | "right"; type LoyaltyImagePosition = "left" | "right"; type LoyaltyActionHandler = (...args: TArgs) => Promise | void; declare const loyaltyDefaultSectionOrder: readonly ["banner", "referrals", "gettingStarted", "waysToEarn", "customImage", "customHtml", "vipTiers", "rewards", "waysToRedeem"]; type LoyaltySectionId = (typeof loyaltyDefaultSectionOrder)[number]; export interface LoyaltySectionBadgeConfig { enabled?: boolean; title?: string; } export interface LoyaltySectionConfig { visibility?: LoyaltyVisibility; backgroundColor?: string; fontColor?: string; badge?: LoyaltySectionBadgeConfig; } export interface LoyaltyTextContentConfig { title?: string; subtitle?: string; } export interface LoyaltyButtonContentConfig extends LoyaltyTextContentConfig { buttonText?: string; } export interface LoyaltyBalanceContentConfig extends LoyaltyTextContentConfig { balanceCoins?: string | number; currentTier?: string | null; nextTier?: string | null; currentLtv?: number | string | null; nextTierLtv?: number | string | null; tierIcon?: string; memberSince?: string; rewardTierCriteria?: "ltv" | "loyalty_points" | "payment" | null; purchaseValueMethod?: "order_count" | "purchase_value" | null; currencyCode?: string; } export interface LoyaltyBannerConfig extends LoyaltySectionConfig { alignment?: LoyaltyAlignment; imageUrl?: string; showTierProgress?: boolean; guestView?: LoyaltyButtonContentConfig; signedInView?: LoyaltyBalanceContentConfig; } export interface LoyaltyReferralContentConfig extends LoyaltyTextContentConfig { referralLinkValue?: string; } export interface LoyaltyImageSectionConfig extends LoyaltySectionConfig { imageUrl?: string; imagePosition?: LoyaltyImagePosition; } export interface LoyaltyReferralsConfig extends LoyaltyImageSectionConfig { guestVisibility?: boolean; guestView?: LoyaltyButtonContentConfig; signedInView?: LoyaltyReferralContentConfig; } export interface LoyaltyGettingStartedStepConfig { title?: string; description?: string; } export interface LoyaltyGettingStartedConfig extends LoyaltySectionConfig { title?: string; subtitle?: string; steps?: LoyaltyGettingStartedStepConfig[]; } export type LoyaltyWaysToEarnIconType = "signup" | "birthday" | "feedback" | "wallet" | "referral" | "instagram" | "facebook" | "twitter" | "youtube"; export type LoyaltyWaysToEarnIcon = LoyaltyWaysToEarnIconType | React.ReactNode; export interface LoyaltyWaysToEarnItemConfig { icon?: LoyaltyWaysToEarnIcon; title?: string; description?: string; ctaTitle?: string; ctaVisible?: boolean; ctaDisabled?: boolean; signedInActionLabel?: string; onClick?: LoyaltyActionHandler; } export interface LoyaltyWaysToEarnConfig extends LoyaltySectionConfig { title?: string; subtitle?: string; guestVisibility?: boolean; showIcons?: boolean; ctaBg?: string; ctaFontColor?: string; items?: LoyaltyWaysToEarnItemConfig[]; } export type LoyaltyWaysToRedeemIconType = "percent" | "coupon"; export type LoyaltyWaysToRedeemIcon = LoyaltyWaysToRedeemIconType | React.ReactNode; export interface LoyaltyWaysToRedeemItemConfig { icon?: LoyaltyWaysToRedeemIcon; title?: string; subtitle?: string; pointsLabel?: string; pointsRequired?: number; /** > 0 => percentage coupon (percent icon). */ discountPercentage?: number; /** > 0 => flat/fixed-amount coupon (coupon icon). */ discountValue?: number; minimumOrderValue?: number; ctaTitle?: string; ctaDisabled?: boolean; onClick?: LoyaltyActionHandler; } export type LoyaltyWaysToRedeemFreebieState = "locked" | "eligible" | "claimed"; export type LoyaltyWaysToRedeemFreebieGating = "points" | "tier"; export interface LoyaltyWaysToRedeemFreebieConfig { title?: string; subtitle?: string; state?: LoyaltyWaysToRedeemFreebieState; gating?: LoyaltyWaysToRedeemFreebieGating; current?: number; target?: number; /** * Explicit progress unit ("orders" / "points" / ...). Optional override — * when `rewardTierCriteria` is provided the unit (and currency) are derived * from it, mirroring the widget's `getFreebieProgress`. */ unit?: string; /** Tier qualification criteria — drives the unit + currency of the progress. */ rewardTierCriteria?: "ltv" | "loyalty_points" | "payment" | null; purchaseValueMethod?: "order_count" | "purchase_value" | null; tierName?: string; code?: string; ctaTitle?: string; /** * true = the freebie's product is already in the cart -> the add-to-cart * button shows a check and is disabled. The host owns this flag. */ inCart?: boolean; onClaim?: LoyaltyActionHandler; onCopy?: LoyaltyActionHandler<[code: string]>; onAddToCart?: LoyaltyActionHandler; } export interface LoyaltyWaysToRedeemConfig extends LoyaltySectionConfig { title?: string; subtitle?: string; balanceLabel?: string; balanceValue?: string | number; balanceCtaText?: string; ctaText?: string; currencyCode?: string; /** Single currently-active coupon code (shown as a pill above the grid). */ activeCoupon?: string; activeCouponLabel?: string; freebies?: LoyaltyWaysToRedeemFreebieConfig[]; items?: LoyaltyWaysToRedeemItemConfig[]; } export interface LoyaltyRewardsConfig extends LoyaltyImageSectionConfig { title?: string; description?: string; disclaimerText?: string; bottomCtaTitle?: string; bottomCtaSubtitle?: string; buttonText?: string; } export interface LoyaltyCustomImageConfig { visibility?: LoyaltyVisibility; imageUrl?: string; } export interface LoyaltyCustomHtmlConfig { visibility?: LoyaltyVisibility; htmlText?: string; } export interface LoyaltyVipTierColumnConfig { id: string; title: string; pointsLabel?: string; headerBackgroundColor?: string; indicatorColor?: string; } export interface LoyaltyVipTierBenefitRowConfig { title: string; description?: string; tierIds: string[]; } export interface LoyaltyVipTierSignedInStatusConfig { tierId: string; text: string; } export interface LoyaltyVipTiersSignedInViewConfig { benefitHeaderLabel?: string; statusLabel?: string; statuses?: LoyaltyVipTierSignedInStatusConfig[]; } export interface LoyaltyVipTiersConfig extends LoyaltySectionConfig { title?: string; subtitle?: string; benefitHeaderLabel?: string; tiers?: LoyaltyVipTierColumnConfig[]; rows?: LoyaltyVipTierBenefitRowConfig[]; signedInView?: LoyaltyVipTiersSignedInViewConfig; } export interface LoyaltyPageConfigType { sectionOrder?: LoyaltySectionId[]; banner?: LoyaltyBannerConfig; referrals?: LoyaltyReferralsConfig; gettingStarted?: LoyaltyGettingStartedConfig; waysToEarn?: LoyaltyWaysToEarnConfig; vipTiers?: LoyaltyVipTiersConfig; rewards?: LoyaltyRewardsConfig; waysToRedeem?: LoyaltyWaysToRedeemConfig; customImage?: LoyaltyCustomImageConfig; customHtml?: LoyaltyCustomHtmlConfig; primaryColor?: string; primaryContrastColor?: string; secondaryColor?: string; secondaryContrastColor?: string; customCss?: string; enableCustomCss?: boolean; } export interface LoyaltyPageProps { config: LoyaltyPageConfigType; signedIn?: boolean; referralLocked?: boolean; userData?: any; onBannerButtonClick?: LoyaltyActionHandler; onReferralButtonClick?: LoyaltyActionHandler; onReferralCopyClick?: LoyaltyActionHandler<[referralLink: string]>; onRewardsButtonClick?: LoyaltyActionHandler; onRedeemClick?: LoyaltyActionHandler<[item: LoyaltyWaysToRedeemItemConfig]>; onEarnMoreClick?: LoyaltyActionHandler; onActiveCouponCopy?: LoyaltyActionHandler<[code: string]>; onFreebieAddToCart?: LoyaltyActionHandler<[ freebie: LoyaltyWaysToRedeemFreebieConfig ]>; } export declare const LoyaltyPageBlock: ({ config, signedIn, referralLocked, userData, onBannerButtonClick, onReferralButtonClick, onReferralCopyClick, onRewardsButtonClick, onRedeemClick, onEarnMoreClick, onActiveCouponCopy, onFreebieAddToCart, }: LoyaltyPageProps) => React.JSX.Element; export default LoyaltyPageBlock;