react-achievements 1.3.7 → 2.0.5
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/README.md +282 -146
- package/coverage/clover.xml +1 -1
- package/coverage/lcov-report/src/context/AchievementContext.tsx.html +6 -6
- package/coverage/lcov-report/src/context/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov.info +1 -1
- package/dist/assets/defaultIcons.d.ts +81 -0
- package/dist/components/AchievementModal.d.ts +3 -2
- package/dist/components/BadgesButton.d.ts +6 -1
- package/dist/components/BadgesModal.d.ts +3 -2
- package/dist/hooks/useAchievement.d.ts +8 -0
- package/dist/index.cjs.js +2100 -103
- package/dist/index.d.ts +5 -3
- package/dist/index.esm.js +2097 -120
- package/dist/providers/AchievementProvider.d.ts +11 -0
- package/dist/redux/achievementSlice.d.ts +25 -0
- package/dist/redux/notificationSlice.d.ts +7 -0
- package/dist/redux/store.d.ts +15 -0
- package/dist/types.d.ts +22 -13
- package/package.json +26 -18
- package/src/assets/defaultIcons.ts +100 -0
- package/src/components/AchievementModal.tsx +37 -8
- package/src/components/BadgesButton.tsx +33 -7
- package/src/components/BadgesModal.tsx +23 -9
- package/src/hooks/useAchievement.ts +20 -0
- package/src/index.ts +11 -7
- package/src/providers/AchievementProvider.tsx +185 -0
- package/src/redux/achievementSlice.ts +71 -0
- package/src/redux/notificationSlice.ts +26 -0
- package/src/redux/store.ts +20 -0
- package/src/types.ts +24 -13
- package/demo/src/stories/Button.jsx +0 -50
- package/demo/src/stories/Button.stories.js +0 -48
- package/demo/src/stories/Configure.mdx +0 -364
- package/demo/src/stories/Header.jsx +0 -59
- package/demo/src/stories/Header.stories.js +0 -28
- package/demo/src/stories/Page.jsx +0 -69
- package/demo/src/stories/Page.stories.js +0 -28
- package/demo/src/stories/assets/accessibility.png +0 -0
- package/demo/src/stories/assets/accessibility.svg +0 -1
- package/demo/src/stories/assets/addon-library.png +0 -0
- package/demo/src/stories/assets/assets.png +0 -0
- package/demo/src/stories/assets/avif-test-image.avif +0 -0
- package/demo/src/stories/assets/context.png +0 -0
- package/demo/src/stories/assets/discord.svg +0 -1
- package/demo/src/stories/assets/docs.png +0 -0
- package/demo/src/stories/assets/figma-plugin.png +0 -0
- package/demo/src/stories/assets/github.svg +0 -1
- package/demo/src/stories/assets/share.png +0 -0
- package/demo/src/stories/assets/styling.png +0 -0
- package/demo/src/stories/assets/testing.png +0 -0
- package/demo/src/stories/assets/theming.png +0 -0
- package/demo/src/stories/assets/tutorials.svg +0 -1
- package/demo/src/stories/assets/youtube.svg +0 -1
- package/demo/src/stories/button.css +0 -30
- package/demo/src/stories/header.css +0 -32
- package/demo/src/stories/page.css +0 -69
- package/dist/stories/Button.d.ts +0 -28
- package/dist/stories/Button.stories.d.ts +0 -23
- package/dist/stories/Header.d.ts +0 -13
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.stories.d.ts +0 -12
- package/src/context/AchievementContext.tsx +0 -185
- package/src/stories/Button.stories.ts +0 -52
- package/src/stories/Button.tsx +0 -48
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -1
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -1
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -1
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -1
- package/src/stories/assets/youtube.svg +0 -1
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -69
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const defaultAchievementIcons: {
|
|
2
|
+
levelUp: string;
|
|
3
|
+
questComplete: string;
|
|
4
|
+
monsterDefeated: string;
|
|
5
|
+
itemCollected: string;
|
|
6
|
+
challengeCompleted: string;
|
|
7
|
+
milestoneReached: string;
|
|
8
|
+
firstStep: string;
|
|
9
|
+
newBeginnings: string;
|
|
10
|
+
breakthrough: string;
|
|
11
|
+
growth: string;
|
|
12
|
+
shared: string;
|
|
13
|
+
liked: string;
|
|
14
|
+
commented: string;
|
|
15
|
+
followed: string;
|
|
16
|
+
invited: string;
|
|
17
|
+
communityMember: string;
|
|
18
|
+
supporter: string;
|
|
19
|
+
connected: string;
|
|
20
|
+
participant: string;
|
|
21
|
+
influencer: string;
|
|
22
|
+
activeDay: string;
|
|
23
|
+
activeWeek: string;
|
|
24
|
+
activeMonth: string;
|
|
25
|
+
earlyBird: string;
|
|
26
|
+
nightOwl: string;
|
|
27
|
+
streak: string;
|
|
28
|
+
dedicated: string;
|
|
29
|
+
punctual: string;
|
|
30
|
+
consistent: string;
|
|
31
|
+
marathon: string;
|
|
32
|
+
artist: string;
|
|
33
|
+
writer: string;
|
|
34
|
+
innovator: string;
|
|
35
|
+
creator: string;
|
|
36
|
+
expert: string;
|
|
37
|
+
master: string;
|
|
38
|
+
pioneer: string;
|
|
39
|
+
performer: string;
|
|
40
|
+
thinker: string;
|
|
41
|
+
explorer: string;
|
|
42
|
+
bronze: string;
|
|
43
|
+
silver: string;
|
|
44
|
+
gold: string;
|
|
45
|
+
diamond: string;
|
|
46
|
+
legendary: string;
|
|
47
|
+
epic: string;
|
|
48
|
+
rare: string;
|
|
49
|
+
common: string;
|
|
50
|
+
special: string;
|
|
51
|
+
hidden: string;
|
|
52
|
+
one: string;
|
|
53
|
+
ten: string;
|
|
54
|
+
hundred: string;
|
|
55
|
+
thousand: string;
|
|
56
|
+
clicked: string;
|
|
57
|
+
used: string;
|
|
58
|
+
found: string;
|
|
59
|
+
built: string;
|
|
60
|
+
solved: string;
|
|
61
|
+
discovered: string;
|
|
62
|
+
unlocked: string;
|
|
63
|
+
upgraded: string;
|
|
64
|
+
repaired: string;
|
|
65
|
+
defended: string;
|
|
66
|
+
default: string;
|
|
67
|
+
loading: string;
|
|
68
|
+
error: string;
|
|
69
|
+
success: string;
|
|
70
|
+
failure: string;
|
|
71
|
+
trophy: string;
|
|
72
|
+
star: string;
|
|
73
|
+
flag: string;
|
|
74
|
+
puzzle: string;
|
|
75
|
+
gem: string;
|
|
76
|
+
crown: string;
|
|
77
|
+
medal: string;
|
|
78
|
+
ribbon: string;
|
|
79
|
+
badge: string;
|
|
80
|
+
shield: string;
|
|
81
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AchievementDetails } from '../types';
|
|
3
3
|
import { Styles } from '../defaultStyles';
|
|
4
4
|
interface AchievementModalProps {
|
|
5
5
|
isOpen: boolean;
|
|
6
|
-
achievement:
|
|
6
|
+
achievement: AchievementDetails | null;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
styles: Styles['achievementModal'];
|
|
9
|
+
icons?: Record<string, string>;
|
|
9
10
|
}
|
|
10
11
|
declare const _default: React.NamedExoticComponent<AchievementModalProps>;
|
|
11
12
|
export default _default;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Styles } from '../defaultStyles';
|
|
3
|
+
import { AchievementDetails } from '../types';
|
|
3
4
|
interface BadgesButtonProps {
|
|
4
5
|
onClick: () => void;
|
|
5
|
-
position
|
|
6
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
6
7
|
styles: Styles['badgesButton'];
|
|
8
|
+
unlockedAchievements: AchievementDetails[];
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
drawer?: boolean;
|
|
11
|
+
customStyles?: React.CSSProperties;
|
|
7
12
|
}
|
|
8
13
|
declare const _default: React.NamedExoticComponent<BadgesButtonProps>;
|
|
9
14
|
export default _default;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { AchievementDetails } from '../types';
|
|
3
3
|
import { Styles } from '../defaultStyles';
|
|
4
4
|
interface BadgesModalProps {
|
|
5
5
|
isOpen: boolean;
|
|
6
|
-
achievements:
|
|
6
|
+
achievements: AchievementDetails[];
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
styles: Styles['badgesModal'];
|
|
9
|
+
icons?: Record<string, string>;
|
|
9
10
|
}
|
|
10
11
|
declare const _default: React.NamedExoticComponent<BadgesModalProps>;
|
|
11
12
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const useAchievement: () => {
|
|
2
|
+
metrics: import("..").AchievementMetrics;
|
|
3
|
+
unlockedAchievements: string[];
|
|
4
|
+
notifications: import("..").AchievementDetails[];
|
|
5
|
+
config: import("..").AchievementConfiguration;
|
|
6
|
+
updateMetrics: (newMetrics: import("..").AchievementMetrics | ((prevMetrics: import("..").AchievementMetrics) => import("..").AchievementMetrics)) => void;
|
|
7
|
+
resetStorage: () => void;
|
|
8
|
+
};
|