Create source implementations for packages imported by NomGap: - @bytelyst/accessibility — ARIA helper functions (alertLabel, progressLabel, etc.) - @bytelyst/celebrations — celebration engine for milestones - @bytelyst/gentle-notifications — guilt-free notification filtering - @bytelyst/time-references — human-friendly fasting time references - @bytelyst/subscription-client — billing/subscription HTTP client - @bytelyst/quick-actions — progressive disclosure UI helpers - @bytelyst/referral-client — referral program client - @bytelyst/marketplace-client — influencer marketplace client - @bytelyst/org-client — B2B org management client Made-with: Cursor
26 lines
691 B
TypeScript
26 lines
691 B
TypeScript
export interface Celebration {
|
|
emoji: string;
|
|
title: string;
|
|
}
|
|
|
|
const DEFAULT_CELEBRATION: Celebration = {
|
|
emoji: '👏',
|
|
title: 'Great Job!',
|
|
};
|
|
|
|
const BY_TYPE: Record<string, Celebration> = {
|
|
session_completed: { emoji: '🎉', title: 'Fast Complete!' },
|
|
task_completed: { emoji: '✅', title: 'Well Done!' },
|
|
streak_milestone: { emoji: '🔥', title: 'Streak Milestone!' },
|
|
achievement_unlocked: { emoji: '🏆', title: 'Achievement Unlocked!' },
|
|
level_up: { emoji: '⬆️', title: 'Level Up!' },
|
|
};
|
|
|
|
export function createCelebrationEngine() {
|
|
return {
|
|
getCelebration(type: string): Celebration {
|
|
return BY_TYPE[type] ?? DEFAULT_CELEBRATION;
|
|
},
|
|
};
|
|
}
|