@gamifyio/react 0.1.2 → 0.1.4
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.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -118
- package/dist/index.d.ts +41 -118
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +9 -2
package/dist/index.d.cts
CHANGED
|
@@ -569,28 +569,18 @@ interface AffiliateStatsProps {
|
|
|
569
569
|
};
|
|
570
570
|
/** Auto-refresh stats on mount */
|
|
571
571
|
autoRefresh?: boolean;
|
|
572
|
+
/** Show tier badge with commission rate (default: true) */
|
|
573
|
+
showTierBadge?: boolean;
|
|
574
|
+
/** Show referral code with copy button (default: true) */
|
|
575
|
+
showReferralCode?: boolean;
|
|
576
|
+
/** Show earnings breakdown section (default: true) */
|
|
577
|
+
showEarningsBreakdown?: boolean;
|
|
572
578
|
/** Custom render for loading state */
|
|
573
579
|
renderLoading?: () => React.ReactNode;
|
|
574
580
|
/** Custom render for error state */
|
|
575
581
|
renderError?: (error: string) => React.ReactNode;
|
|
576
582
|
}
|
|
577
|
-
|
|
578
|
-
* AffiliateStats - Display grid with affiliate statistics
|
|
579
|
-
*
|
|
580
|
-
* Shows referral count, clicks, and earnings in a card layout.
|
|
581
|
-
* Headless-first: unstyled by default but includes sensible defaults.
|
|
582
|
-
*
|
|
583
|
-
* @example
|
|
584
|
-
* ```tsx
|
|
585
|
-
* <AffiliateStats autoRefresh />
|
|
586
|
-
*
|
|
587
|
-
* // With custom theme
|
|
588
|
-
* <AffiliateStats
|
|
589
|
-
* theme={{ cardBackground: '#1a1a1a', valueColor: '#fff' }}
|
|
590
|
-
* />
|
|
591
|
-
* ```
|
|
592
|
-
*/
|
|
593
|
-
declare function AffiliateStats({ className, style, theme, autoRefresh, renderLoading, renderError, }: AffiliateStatsProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
583
|
+
declare const AffiliateStats: React.FC<AffiliateStatsProps>;
|
|
594
584
|
/**
|
|
595
585
|
* Props for Leaderboard component
|
|
596
586
|
*/
|
|
@@ -605,6 +595,12 @@ interface LeaderboardProps {
|
|
|
605
595
|
currentUserId?: string;
|
|
606
596
|
/** Custom empty state message */
|
|
607
597
|
emptyMessage?: string;
|
|
598
|
+
/** Show medal icons for top 3 positions (default: true) */
|
|
599
|
+
showMedals?: boolean;
|
|
600
|
+
/** Show tier info with percentage (default: true) */
|
|
601
|
+
showTierInfo?: boolean;
|
|
602
|
+
/** Show earnings column (default: true) */
|
|
603
|
+
showEarnings?: boolean;
|
|
608
604
|
/** Theme customization */
|
|
609
605
|
theme?: {
|
|
610
606
|
rowBackground?: string;
|
|
@@ -619,27 +615,7 @@ interface LeaderboardProps {
|
|
|
619
615
|
/** Custom render for error state */
|
|
620
616
|
renderError?: (error: string) => React.ReactNode;
|
|
621
617
|
}
|
|
622
|
-
|
|
623
|
-
* Leaderboard - Ranked affiliate leaderboard display
|
|
624
|
-
*
|
|
625
|
-
* Shows ranked list of top affiliates with referral counts.
|
|
626
|
-
* Highlights the current user if their ID is provided.
|
|
627
|
-
*
|
|
628
|
-
* @example
|
|
629
|
-
* ```tsx
|
|
630
|
-
* <Leaderboard limit={10} currentUserId={userId} />
|
|
631
|
-
*
|
|
632
|
-
* // With custom render
|
|
633
|
-
* <Leaderboard
|
|
634
|
-
* renderRow={(entry, isCurrent) => (
|
|
635
|
-
* <div className={isCurrent ? 'highlight' : ''}>
|
|
636
|
-
* #{entry.rank} - {entry.displayName}
|
|
637
|
-
* </div>
|
|
638
|
-
* )}
|
|
639
|
-
* />
|
|
640
|
-
* ```
|
|
641
|
-
*/
|
|
642
|
-
declare function Leaderboard({ limit, className, style, currentUserId, emptyMessage, theme, renderRow, renderLoading, renderError, }: LeaderboardProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
618
|
+
declare const Leaderboard: React.FC<LeaderboardProps>;
|
|
643
619
|
/**
|
|
644
620
|
* Props for ReferralLink component
|
|
645
621
|
*/
|
|
@@ -662,6 +638,16 @@ interface ReferralLinkProps {
|
|
|
662
638
|
shareText?: string;
|
|
663
639
|
/** Show share button on mobile */
|
|
664
640
|
showShareButton?: boolean;
|
|
641
|
+
/** Show referrer attribution section (default: true) */
|
|
642
|
+
showReferrerAttribution?: boolean;
|
|
643
|
+
/** Current referrer code (who referred this user) */
|
|
644
|
+
referrerCode?: string | null;
|
|
645
|
+
/** Callback when referrer is set */
|
|
646
|
+
onSetReferrer?: (code: string) => void;
|
|
647
|
+
/** Callback to detect referrer from URL */
|
|
648
|
+
onDetectFromUrl?: () => void;
|
|
649
|
+
/** Callback when referrer is cleared */
|
|
650
|
+
onClearReferrer?: () => void;
|
|
665
651
|
/** Theme customization */
|
|
666
652
|
theme?: {
|
|
667
653
|
inputBackground?: string;
|
|
@@ -675,25 +661,7 @@ interface ReferralLinkProps {
|
|
|
675
661
|
/** Callback when link is shared */
|
|
676
662
|
onShare?: (link: string) => void;
|
|
677
663
|
}
|
|
678
|
-
|
|
679
|
-
* ReferralLink - Input field with user's referral code and copy/share buttons
|
|
680
|
-
*
|
|
681
|
-
* Displays the user's unique referral link with easy copy functionality.
|
|
682
|
-
* Includes native share button for mobile devices.
|
|
683
|
-
*
|
|
684
|
-
* @example
|
|
685
|
-
* ```tsx
|
|
686
|
-
* <ReferralLink />
|
|
687
|
-
*
|
|
688
|
-
* // With custom base URL
|
|
689
|
-
* <ReferralLink
|
|
690
|
-
* baseUrl="https://myapp.com/signup"
|
|
691
|
-
* shareTitle="Join my app!"
|
|
692
|
-
* shareText="Sign up using my referral link"
|
|
693
|
-
* />
|
|
694
|
-
* ```
|
|
695
|
-
*/
|
|
696
|
-
declare function ReferralLink({ baseUrl, className, style, copyButtonText, copiedText, shareButtonText, shareTitle, shareText, showShareButton, theme, onCopy, onShare, }: ReferralLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
664
|
+
declare const ReferralLink: React.FC<ReferralLinkProps>;
|
|
697
665
|
/**
|
|
698
666
|
* Props for QuestProgress component
|
|
699
667
|
*/
|
|
@@ -706,6 +674,12 @@ interface QuestProgressProps {
|
|
|
706
674
|
className?: string;
|
|
707
675
|
/** Custom styles override */
|
|
708
676
|
style?: React.CSSProperties;
|
|
677
|
+
/** Enable expandable accordion mode (default: true) */
|
|
678
|
+
expandable?: boolean;
|
|
679
|
+
/** Default expanded quest ID (defaults to first in-progress) */
|
|
680
|
+
defaultExpandedId?: string;
|
|
681
|
+
/** Show XP reward in header (default: true) */
|
|
682
|
+
showXpReward?: boolean;
|
|
709
683
|
/** Callback when a quest is completed */
|
|
710
684
|
onComplete?: (quest: QuestWithProgress) => void;
|
|
711
685
|
/** Theme customization */
|
|
@@ -722,17 +696,7 @@ interface QuestProgressProps {
|
|
|
722
696
|
/** Custom render for each quest */
|
|
723
697
|
renderQuest?: (quest: QuestWithProgress) => React.ReactNode;
|
|
724
698
|
}
|
|
725
|
-
|
|
726
|
-
* QuestProgress - Display quest progress with step checklist
|
|
727
|
-
*
|
|
728
|
-
* Shows quest name, description, progress bar, and step completion status.
|
|
729
|
-
*
|
|
730
|
-
* @example
|
|
731
|
-
* ```tsx
|
|
732
|
-
* <QuestProgress hideCompleted onComplete={(quest) => console.log('Completed:', quest.name)} />
|
|
733
|
-
* ```
|
|
734
|
-
*/
|
|
735
|
-
declare function QuestProgress({ questId, hideCompleted, className, style, onComplete, theme, renderLoading, renderError, renderQuest, }: QuestProgressProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
699
|
+
declare const QuestProgress: React.FC<QuestProgressProps>;
|
|
736
700
|
/**
|
|
737
701
|
* Props for StreakFlame component
|
|
738
702
|
*/
|
|
@@ -760,17 +724,7 @@ interface StreakFlameProps {
|
|
|
760
724
|
/** Custom render for error state */
|
|
761
725
|
renderError?: (error: string) => React.ReactNode;
|
|
762
726
|
}
|
|
763
|
-
|
|
764
|
-
* StreakFlame - Display streak counter with flame icon
|
|
765
|
-
*
|
|
766
|
-
* Shows current streak count with status indicator and optional freeze button.
|
|
767
|
-
*
|
|
768
|
-
* @example
|
|
769
|
-
* ```tsx
|
|
770
|
-
* <StreakFlame showFreezeButton onFreeze={(id, remaining) => console.log('Freeze used')} />
|
|
771
|
-
* ```
|
|
772
|
-
*/
|
|
773
|
-
declare function StreakFlame({ ruleId, size, showFreezeButton, className, style, onFreeze, theme, renderLoading, renderError, }: StreakFlameProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
727
|
+
declare const StreakFlame: React.FC<StreakFlameProps>;
|
|
774
728
|
/**
|
|
775
729
|
* Props for BadgeGrid component
|
|
776
730
|
*/
|
|
@@ -785,7 +739,11 @@ interface BadgeGridProps {
|
|
|
785
739
|
className?: string;
|
|
786
740
|
/** Custom styles override */
|
|
787
741
|
style?: React.CSSProperties;
|
|
788
|
-
/** Show
|
|
742
|
+
/** Show progress summary header (default: true) */
|
|
743
|
+
showProgressSummary?: boolean;
|
|
744
|
+
/** Show filter tabs (All/Earned/Locked) (default: true) */
|
|
745
|
+
showFilterTabs?: boolean;
|
|
746
|
+
/** @deprecated Use showProgressSummary instead */
|
|
789
747
|
showStats?: boolean;
|
|
790
748
|
/** Callback when a badge is clicked */
|
|
791
749
|
onBadgeClick?: (badge: BadgeWithStatus) => void;
|
|
@@ -801,17 +759,7 @@ interface BadgeGridProps {
|
|
|
801
759
|
/** Custom render for each badge */
|
|
802
760
|
renderBadge?: (badge: BadgeWithStatus) => React.ReactNode;
|
|
803
761
|
}
|
|
804
|
-
|
|
805
|
-
* BadgeGrid - Display badge collection in a grid
|
|
806
|
-
*
|
|
807
|
-
* Shows badges with unlock status, rarity indicators, and optional filtering.
|
|
808
|
-
*
|
|
809
|
-
* @example
|
|
810
|
-
* ```tsx
|
|
811
|
-
* <BadgeGrid showLocked showStats onBadgeClick={(badge) => showBadgeModal(badge)} />
|
|
812
|
-
* ```
|
|
813
|
-
*/
|
|
814
|
-
declare function BadgeGrid({ showLocked, category, columns, className, style, showStats, onBadgeClick, theme, renderLoading, renderError, renderBadge, }: BadgeGridProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
762
|
+
declare const BadgeGrid: React.FC<BadgeGridProps>;
|
|
815
763
|
/**
|
|
816
764
|
* Props for LevelProgress component
|
|
817
765
|
*/
|
|
@@ -835,17 +783,7 @@ interface LevelProgressProps {
|
|
|
835
783
|
/** Custom render for error state */
|
|
836
784
|
renderError?: (error: string) => React.ReactNode;
|
|
837
785
|
}
|
|
838
|
-
|
|
839
|
-
* LevelProgress - Display tier/level progress
|
|
840
|
-
*
|
|
841
|
-
* Shows current tier, XP/points, and progress to next tier.
|
|
842
|
-
*
|
|
843
|
-
* @example
|
|
844
|
-
* ```tsx
|
|
845
|
-
* <LevelProgress showNextTier showBenefits />
|
|
846
|
-
* ```
|
|
847
|
-
*/
|
|
848
|
-
declare function LevelProgress({ showNextTier, showBenefits, className, style, theme, renderLoading, renderError, }: LevelProgressProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
786
|
+
declare const LevelProgress: React.FC<LevelProgressProps>;
|
|
849
787
|
/**
|
|
850
788
|
* Props for RewardStore component
|
|
851
789
|
*/
|
|
@@ -872,21 +810,6 @@ interface RewardStoreProps {
|
|
|
872
810
|
/** Custom render for each item */
|
|
873
811
|
renderItem?: (item: RewardItem, onRedeem: () => void) => React.ReactNode;
|
|
874
812
|
}
|
|
875
|
-
|
|
876
|
-
* RewardStore - Display reward catalog with redeem functionality
|
|
877
|
-
*
|
|
878
|
-
* Shows available rewards with point costs and redeem buttons.
|
|
879
|
-
*
|
|
880
|
-
* @example
|
|
881
|
-
* ```tsx
|
|
882
|
-
* <RewardStore
|
|
883
|
-
* showPointsHeader
|
|
884
|
-
* onRedeem={(item, result) => {
|
|
885
|
-
* if (result.success) toast.success(`Redeemed ${item.name}!`);
|
|
886
|
-
* }}
|
|
887
|
-
* />
|
|
888
|
-
* ```
|
|
889
|
-
*/
|
|
890
|
-
declare function RewardStore({ showUnavailable, className, style, showPointsHeader, onRedeem, theme, renderLoading, renderError, renderItem, }: RewardStoreProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
813
|
+
declare const RewardStore: React.FC<RewardStoreProps>;
|
|
891
814
|
|
|
892
815
|
export { AffiliateStats, type AffiliateStatsProps, BadgeGrid, type BadgeGridProps, type GamifyContextValue, GamifyPageView, type GamifyPageViewProps, GamifyProvider, type GamifyProviderProps, GamifyTrackClick, type GamifyTrackClickProps, Leaderboard, type LeaderboardProps, LevelProgress, type LevelProgressProps, QuestProgress, type QuestProgressProps, ReferralLink, type ReferralLinkProps, RewardStore, type RewardStoreProps, StreakFlame, type StreakFlameProps, useAffiliateStats, useBadges, useGamify, useIdentify, useLeaderboard, useLoyalty, useQuests, useReferral, useRewards, useSession, useStreaks, useTrack };
|
package/dist/index.d.ts
CHANGED
|
@@ -569,28 +569,18 @@ interface AffiliateStatsProps {
|
|
|
569
569
|
};
|
|
570
570
|
/** Auto-refresh stats on mount */
|
|
571
571
|
autoRefresh?: boolean;
|
|
572
|
+
/** Show tier badge with commission rate (default: true) */
|
|
573
|
+
showTierBadge?: boolean;
|
|
574
|
+
/** Show referral code with copy button (default: true) */
|
|
575
|
+
showReferralCode?: boolean;
|
|
576
|
+
/** Show earnings breakdown section (default: true) */
|
|
577
|
+
showEarningsBreakdown?: boolean;
|
|
572
578
|
/** Custom render for loading state */
|
|
573
579
|
renderLoading?: () => React.ReactNode;
|
|
574
580
|
/** Custom render for error state */
|
|
575
581
|
renderError?: (error: string) => React.ReactNode;
|
|
576
582
|
}
|
|
577
|
-
|
|
578
|
-
* AffiliateStats - Display grid with affiliate statistics
|
|
579
|
-
*
|
|
580
|
-
* Shows referral count, clicks, and earnings in a card layout.
|
|
581
|
-
* Headless-first: unstyled by default but includes sensible defaults.
|
|
582
|
-
*
|
|
583
|
-
* @example
|
|
584
|
-
* ```tsx
|
|
585
|
-
* <AffiliateStats autoRefresh />
|
|
586
|
-
*
|
|
587
|
-
* // With custom theme
|
|
588
|
-
* <AffiliateStats
|
|
589
|
-
* theme={{ cardBackground: '#1a1a1a', valueColor: '#fff' }}
|
|
590
|
-
* />
|
|
591
|
-
* ```
|
|
592
|
-
*/
|
|
593
|
-
declare function AffiliateStats({ className, style, theme, autoRefresh, renderLoading, renderError, }: AffiliateStatsProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
583
|
+
declare const AffiliateStats: React.FC<AffiliateStatsProps>;
|
|
594
584
|
/**
|
|
595
585
|
* Props for Leaderboard component
|
|
596
586
|
*/
|
|
@@ -605,6 +595,12 @@ interface LeaderboardProps {
|
|
|
605
595
|
currentUserId?: string;
|
|
606
596
|
/** Custom empty state message */
|
|
607
597
|
emptyMessage?: string;
|
|
598
|
+
/** Show medal icons for top 3 positions (default: true) */
|
|
599
|
+
showMedals?: boolean;
|
|
600
|
+
/** Show tier info with percentage (default: true) */
|
|
601
|
+
showTierInfo?: boolean;
|
|
602
|
+
/** Show earnings column (default: true) */
|
|
603
|
+
showEarnings?: boolean;
|
|
608
604
|
/** Theme customization */
|
|
609
605
|
theme?: {
|
|
610
606
|
rowBackground?: string;
|
|
@@ -619,27 +615,7 @@ interface LeaderboardProps {
|
|
|
619
615
|
/** Custom render for error state */
|
|
620
616
|
renderError?: (error: string) => React.ReactNode;
|
|
621
617
|
}
|
|
622
|
-
|
|
623
|
-
* Leaderboard - Ranked affiliate leaderboard display
|
|
624
|
-
*
|
|
625
|
-
* Shows ranked list of top affiliates with referral counts.
|
|
626
|
-
* Highlights the current user if their ID is provided.
|
|
627
|
-
*
|
|
628
|
-
* @example
|
|
629
|
-
* ```tsx
|
|
630
|
-
* <Leaderboard limit={10} currentUserId={userId} />
|
|
631
|
-
*
|
|
632
|
-
* // With custom render
|
|
633
|
-
* <Leaderboard
|
|
634
|
-
* renderRow={(entry, isCurrent) => (
|
|
635
|
-
* <div className={isCurrent ? 'highlight' : ''}>
|
|
636
|
-
* #{entry.rank} - {entry.displayName}
|
|
637
|
-
* </div>
|
|
638
|
-
* )}
|
|
639
|
-
* />
|
|
640
|
-
* ```
|
|
641
|
-
*/
|
|
642
|
-
declare function Leaderboard({ limit, className, style, currentUserId, emptyMessage, theme, renderRow, renderLoading, renderError, }: LeaderboardProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
618
|
+
declare const Leaderboard: React.FC<LeaderboardProps>;
|
|
643
619
|
/**
|
|
644
620
|
* Props for ReferralLink component
|
|
645
621
|
*/
|
|
@@ -662,6 +638,16 @@ interface ReferralLinkProps {
|
|
|
662
638
|
shareText?: string;
|
|
663
639
|
/** Show share button on mobile */
|
|
664
640
|
showShareButton?: boolean;
|
|
641
|
+
/** Show referrer attribution section (default: true) */
|
|
642
|
+
showReferrerAttribution?: boolean;
|
|
643
|
+
/** Current referrer code (who referred this user) */
|
|
644
|
+
referrerCode?: string | null;
|
|
645
|
+
/** Callback when referrer is set */
|
|
646
|
+
onSetReferrer?: (code: string) => void;
|
|
647
|
+
/** Callback to detect referrer from URL */
|
|
648
|
+
onDetectFromUrl?: () => void;
|
|
649
|
+
/** Callback when referrer is cleared */
|
|
650
|
+
onClearReferrer?: () => void;
|
|
665
651
|
/** Theme customization */
|
|
666
652
|
theme?: {
|
|
667
653
|
inputBackground?: string;
|
|
@@ -675,25 +661,7 @@ interface ReferralLinkProps {
|
|
|
675
661
|
/** Callback when link is shared */
|
|
676
662
|
onShare?: (link: string) => void;
|
|
677
663
|
}
|
|
678
|
-
|
|
679
|
-
* ReferralLink - Input field with user's referral code and copy/share buttons
|
|
680
|
-
*
|
|
681
|
-
* Displays the user's unique referral link with easy copy functionality.
|
|
682
|
-
* Includes native share button for mobile devices.
|
|
683
|
-
*
|
|
684
|
-
* @example
|
|
685
|
-
* ```tsx
|
|
686
|
-
* <ReferralLink />
|
|
687
|
-
*
|
|
688
|
-
* // With custom base URL
|
|
689
|
-
* <ReferralLink
|
|
690
|
-
* baseUrl="https://myapp.com/signup"
|
|
691
|
-
* shareTitle="Join my app!"
|
|
692
|
-
* shareText="Sign up using my referral link"
|
|
693
|
-
* />
|
|
694
|
-
* ```
|
|
695
|
-
*/
|
|
696
|
-
declare function ReferralLink({ baseUrl, className, style, copyButtonText, copiedText, shareButtonText, shareTitle, shareText, showShareButton, theme, onCopy, onShare, }: ReferralLinkProps): react_jsx_runtime.JSX.Element | null;
|
|
664
|
+
declare const ReferralLink: React.FC<ReferralLinkProps>;
|
|
697
665
|
/**
|
|
698
666
|
* Props for QuestProgress component
|
|
699
667
|
*/
|
|
@@ -706,6 +674,12 @@ interface QuestProgressProps {
|
|
|
706
674
|
className?: string;
|
|
707
675
|
/** Custom styles override */
|
|
708
676
|
style?: React.CSSProperties;
|
|
677
|
+
/** Enable expandable accordion mode (default: true) */
|
|
678
|
+
expandable?: boolean;
|
|
679
|
+
/** Default expanded quest ID (defaults to first in-progress) */
|
|
680
|
+
defaultExpandedId?: string;
|
|
681
|
+
/** Show XP reward in header (default: true) */
|
|
682
|
+
showXpReward?: boolean;
|
|
709
683
|
/** Callback when a quest is completed */
|
|
710
684
|
onComplete?: (quest: QuestWithProgress) => void;
|
|
711
685
|
/** Theme customization */
|
|
@@ -722,17 +696,7 @@ interface QuestProgressProps {
|
|
|
722
696
|
/** Custom render for each quest */
|
|
723
697
|
renderQuest?: (quest: QuestWithProgress) => React.ReactNode;
|
|
724
698
|
}
|
|
725
|
-
|
|
726
|
-
* QuestProgress - Display quest progress with step checklist
|
|
727
|
-
*
|
|
728
|
-
* Shows quest name, description, progress bar, and step completion status.
|
|
729
|
-
*
|
|
730
|
-
* @example
|
|
731
|
-
* ```tsx
|
|
732
|
-
* <QuestProgress hideCompleted onComplete={(quest) => console.log('Completed:', quest.name)} />
|
|
733
|
-
* ```
|
|
734
|
-
*/
|
|
735
|
-
declare function QuestProgress({ questId, hideCompleted, className, style, onComplete, theme, renderLoading, renderError, renderQuest, }: QuestProgressProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
699
|
+
declare const QuestProgress: React.FC<QuestProgressProps>;
|
|
736
700
|
/**
|
|
737
701
|
* Props for StreakFlame component
|
|
738
702
|
*/
|
|
@@ -760,17 +724,7 @@ interface StreakFlameProps {
|
|
|
760
724
|
/** Custom render for error state */
|
|
761
725
|
renderError?: (error: string) => React.ReactNode;
|
|
762
726
|
}
|
|
763
|
-
|
|
764
|
-
* StreakFlame - Display streak counter with flame icon
|
|
765
|
-
*
|
|
766
|
-
* Shows current streak count with status indicator and optional freeze button.
|
|
767
|
-
*
|
|
768
|
-
* @example
|
|
769
|
-
* ```tsx
|
|
770
|
-
* <StreakFlame showFreezeButton onFreeze={(id, remaining) => console.log('Freeze used')} />
|
|
771
|
-
* ```
|
|
772
|
-
*/
|
|
773
|
-
declare function StreakFlame({ ruleId, size, showFreezeButton, className, style, onFreeze, theme, renderLoading, renderError, }: StreakFlameProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
727
|
+
declare const StreakFlame: React.FC<StreakFlameProps>;
|
|
774
728
|
/**
|
|
775
729
|
* Props for BadgeGrid component
|
|
776
730
|
*/
|
|
@@ -785,7 +739,11 @@ interface BadgeGridProps {
|
|
|
785
739
|
className?: string;
|
|
786
740
|
/** Custom styles override */
|
|
787
741
|
style?: React.CSSProperties;
|
|
788
|
-
/** Show
|
|
742
|
+
/** Show progress summary header (default: true) */
|
|
743
|
+
showProgressSummary?: boolean;
|
|
744
|
+
/** Show filter tabs (All/Earned/Locked) (default: true) */
|
|
745
|
+
showFilterTabs?: boolean;
|
|
746
|
+
/** @deprecated Use showProgressSummary instead */
|
|
789
747
|
showStats?: boolean;
|
|
790
748
|
/** Callback when a badge is clicked */
|
|
791
749
|
onBadgeClick?: (badge: BadgeWithStatus) => void;
|
|
@@ -801,17 +759,7 @@ interface BadgeGridProps {
|
|
|
801
759
|
/** Custom render for each badge */
|
|
802
760
|
renderBadge?: (badge: BadgeWithStatus) => React.ReactNode;
|
|
803
761
|
}
|
|
804
|
-
|
|
805
|
-
* BadgeGrid - Display badge collection in a grid
|
|
806
|
-
*
|
|
807
|
-
* Shows badges with unlock status, rarity indicators, and optional filtering.
|
|
808
|
-
*
|
|
809
|
-
* @example
|
|
810
|
-
* ```tsx
|
|
811
|
-
* <BadgeGrid showLocked showStats onBadgeClick={(badge) => showBadgeModal(badge)} />
|
|
812
|
-
* ```
|
|
813
|
-
*/
|
|
814
|
-
declare function BadgeGrid({ showLocked, category, columns, className, style, showStats, onBadgeClick, theme, renderLoading, renderError, renderBadge, }: BadgeGridProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
762
|
+
declare const BadgeGrid: React.FC<BadgeGridProps>;
|
|
815
763
|
/**
|
|
816
764
|
* Props for LevelProgress component
|
|
817
765
|
*/
|
|
@@ -835,17 +783,7 @@ interface LevelProgressProps {
|
|
|
835
783
|
/** Custom render for error state */
|
|
836
784
|
renderError?: (error: string) => React.ReactNode;
|
|
837
785
|
}
|
|
838
|
-
|
|
839
|
-
* LevelProgress - Display tier/level progress
|
|
840
|
-
*
|
|
841
|
-
* Shows current tier, XP/points, and progress to next tier.
|
|
842
|
-
*
|
|
843
|
-
* @example
|
|
844
|
-
* ```tsx
|
|
845
|
-
* <LevelProgress showNextTier showBenefits />
|
|
846
|
-
* ```
|
|
847
|
-
*/
|
|
848
|
-
declare function LevelProgress({ showNextTier, showBenefits, className, style, theme, renderLoading, renderError, }: LevelProgressProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
786
|
+
declare const LevelProgress: React.FC<LevelProgressProps>;
|
|
849
787
|
/**
|
|
850
788
|
* Props for RewardStore component
|
|
851
789
|
*/
|
|
@@ -872,21 +810,6 @@ interface RewardStoreProps {
|
|
|
872
810
|
/** Custom render for each item */
|
|
873
811
|
renderItem?: (item: RewardItem, onRedeem: () => void) => React.ReactNode;
|
|
874
812
|
}
|
|
875
|
-
|
|
876
|
-
* RewardStore - Display reward catalog with redeem functionality
|
|
877
|
-
*
|
|
878
|
-
* Shows available rewards with point costs and redeem buttons.
|
|
879
|
-
*
|
|
880
|
-
* @example
|
|
881
|
-
* ```tsx
|
|
882
|
-
* <RewardStore
|
|
883
|
-
* showPointsHeader
|
|
884
|
-
* onRedeem={(item, result) => {
|
|
885
|
-
* if (result.success) toast.success(`Redeemed ${item.name}!`);
|
|
886
|
-
* }}
|
|
887
|
-
* />
|
|
888
|
-
* ```
|
|
889
|
-
*/
|
|
890
|
-
declare function RewardStore({ showUnavailable, className, style, showPointsHeader, onRedeem, theme, renderLoading, renderError, renderItem, }: RewardStoreProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
813
|
+
declare const RewardStore: React.FC<RewardStoreProps>;
|
|
891
814
|
|
|
892
815
|
export { AffiliateStats, type AffiliateStatsProps, BadgeGrid, type BadgeGridProps, type GamifyContextValue, GamifyPageView, type GamifyPageViewProps, GamifyProvider, type GamifyProviderProps, GamifyTrackClick, type GamifyTrackClickProps, Leaderboard, type LeaderboardProps, LevelProgress, type LevelProgressProps, QuestProgress, type QuestProgressProps, ReferralLink, type ReferralLinkProps, RewardStore, type RewardStoreProps, StreakFlame, type StreakFlameProps, useAffiliateStats, useBadges, useGamify, useIdentify, useLeaderboard, useLoyalty, useQuests, useReferral, useRewards, useSession, useStreaks, useTrack };
|