UNPKG

aura-glass

Version:

A comprehensive glassmorphism design system for React applications with 142+ production-ready components

146 lines 4.73 kB
/** * AuraGlass Achievement System * Gamified user engagement with progressive rewards and glass-themed achievements */ import React from "react"; interface Achievement { id: string; title: string; description: string; icon: string; category: "interaction" | "exploration" | "mastery" | "social" | "creative" | "performance"; rarity: "common" | "rare" | "epic" | "legendary"; xp: number; requirements: AchievementRequirement[]; rewards?: AchievementReward[]; unlocked: boolean; unlockedAt?: number; progress: number; hidden: boolean; } interface AchievementRequirement { type: "action_count" | "streak" | "time_spent" | "score_reached" | "items_collected" | "combo" | "challenge"; action?: string; count?: number; duration?: number; score?: number; items?: string[]; combo?: string[]; challenge?: string; } interface AchievementReward { type: "xp" | "badge" | "theme" | "effect" | "sound" | "animation"; value: string | number; description: string; } interface UserProgress { userId: string; level: number; totalXP: number; currentXP: number; xpToNextLevel: number; achievements: Achievement[]; stats: UserStats; streak: number; lastActiveDate: string; } interface UserStats { totalInteractions: number; sessionsCompleted: number; timeSpent: number; componentsExplored: string[]; highestStreak: number; perfectSessions: number; customizationsUnlocked: number; socialInteractions: number; } interface AchievementNotification { achievement: Achievement; timestamp: number; shown: boolean; } declare class GlassAchievementEngine { private progress; private achievements; private actionHistory; private sessionStart; private notifications; private listeners; private checkInterval; constructor(userId?: string); private loadProgress; private mergeAchievements; private saveProgress; private updateStreak; private startPeriodicChecks; recordAction(action: string, context?: any): void; private checkAchievements; private calculateAchievementProgress; private checkChallenge; private checkCombo; private checkTimeBasedAchievements; private unlockAchievement; private addXP; private calculateXPForNextLevel; private applyAchievementRewards; getProgress(): UserProgress; getUnlockedAchievements(): Achievement[]; getAvailableAchievements(): Achievement[]; getNotifications(): AchievementNotification[]; markNotificationShown(notificationIndex: number): void; addListener(listener: (notification: AchievementNotification) => void): () => void; cleanup(): void; } export declare function GlassAchievementProvider({ children, userId, }: { children: React.ReactNode; userId?: string; }): import("react/jsx-runtime").JSX.Element; export declare function useAchievements(): { engine: GlassAchievementEngine | null; progress: UserProgress | null; recordAction: (action: string, context?: any) => void; notifications: AchievementNotification[]; }; export declare function GlassAchievementNotifications({ className, position, }: { className?: string; position?: "top-right" | "top-left" | "bottom-right" | "bottom-left"; }): import("react/jsx-runtime").JSX.Element; export declare function GlassAchievementDashboard({ className, show, }: { className?: string; show?: boolean; }): import("react/jsx-runtime").JSX.Element | null; export declare function useAchievementTracker(): { trackClick: (component?: string) => void; trackHover: (component?: string) => void; trackCustomization: (type: string, value: any) => void; trackCollaboration: (action: string, users: string[]) => void; recordAction: (action: string, context?: any) => void; }; export declare const achievementPresets: { casual: { xpMultiplier: number; notificationDuration: number; showProgress: boolean; }; hardcore: { xpMultiplier: number; notificationDuration: number; showProgress: boolean; hiddenAchievements: boolean; }; minimal: { xpMultiplier: number; notificationDuration: number; showProgress: boolean; quietMode: boolean; }; }; interface GlassAchievementSystemProps extends React.HTMLAttributes<HTMLDivElement> { userId?: string; showDashboard?: boolean; showNotifications?: boolean; children?: React.ReactNode; } export declare const GlassAchievementSystem: React.FC<GlassAchievementSystemProps>; export default GlassAchievementSystem; //# sourceMappingURL=GlassAchievementSystem.d.ts.map