File tree Expand file tree Collapse file tree 12 files changed +42
-21
lines changed
packages/ui-next/src/components Expand file tree Collapse file tree 12 files changed +42
-21
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export interface AchievementPinIconProps
33
33
empty ?: boolean ;
34
34
theme ?: boolean ;
35
35
className ?: string ;
36
+ color ?: string ;
36
37
}
37
38
38
39
export const AchievementPinIcon = ( {
@@ -42,12 +43,14 @@ export const AchievementPinIcon = ({
42
43
variant,
43
44
size,
44
45
className,
46
+ color,
45
47
} : AchievementPinIconProps ) => {
46
48
return (
47
49
< div
48
50
data-theme = { theme }
49
51
data-empty = { empty }
50
52
className = { cn ( achievementPinIconVariants ( { variant, size } ) , className ) }
53
+ style = { { color : theme ? color : undefined } }
51
54
>
52
55
{ empty ? (
53
56
< div className = "w-3 h-3 fa-spider-web fa-thin" />
Original file line number Diff line number Diff line change @@ -54,3 +54,11 @@ export const HighlightTheme: Story = {
54
54
theme : true ,
55
55
} ,
56
56
} ;
57
+
58
+ export const Color : Story = {
59
+ args : {
60
+ variant : "highlight" ,
61
+ theme : true ,
62
+ color : "#ff00ff" ,
63
+ } ,
64
+ } ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface AchievementPinIconsProps
26
26
pins : { id : string ; icon : string } [ ] ;
27
27
theme ?: boolean ;
28
28
className ?: string ;
29
+ color ?: string ;
29
30
}
30
31
31
32
export const AchievementPinIcons = ( {
@@ -34,6 +35,7 @@ export const AchievementPinIcons = ({
34
35
variant,
35
36
size,
36
37
className,
38
+ color,
37
39
} : AchievementPinIconsProps ) => {
38
40
return (
39
41
< div className = { achievementPinsVariants ( { variant, size } ) } >
@@ -45,6 +47,7 @@ export const AchievementPinIcons = ({
45
47
size = { size }
46
48
theme = { theme }
47
49
className = { className }
50
+ color = { color }
48
51
/>
49
52
) ) }
50
53
{ Array . from ( { length : 3 - pins . length } ) . map ( ( _ , index ) => (
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export interface AchievementProgressProps
8
8
points : number ;
9
9
completed ?: boolean ;
10
10
className ?: string ;
11
+ color ?: string ;
11
12
}
12
13
13
14
const achievementProgressVariants = cva ( "p-3 flex items-center gap-x-3" , {
@@ -30,6 +31,7 @@ export function AchievementProgress({
30
31
completed,
31
32
variant,
32
33
className,
34
+ color,
33
35
} : AchievementProgressProps ) {
34
36
return (
35
37
< div className = { cn ( achievementProgressVariants ( { variant } ) , className ) } >
@@ -44,6 +46,7 @@ export function AchievementProgress({
44
46
total = { total }
45
47
completed = { ! ! completed }
46
48
className = { className }
49
+ color = { color }
47
50
/>
48
51
< div className = "flex gap-x-1" >
49
52
< SparklesIcon
Original file line number Diff line number Diff line change @@ -194,16 +194,8 @@ export const MultiColors: Story = {
194
194
render : ( args ) => {
195
195
return (
196
196
< div className = "flex flex-col gap-4" >
197
- < AchievementSummary
198
- { ...args }
199
- active
200
- className = "data-[theme=true]:text-[#ff00ff] data-[completed=true]:bg-[#ff00ff]"
201
- />
202
- < AchievementSummary
203
- { ...args }
204
- active
205
- className = "data-[theme=true]:text-[#00ff00] data-[completed=true]:bg-[#00ff00]"
206
- />
197
+ < AchievementSummary { ...args } active color = "#ff00ff" />
198
+ < AchievementSummary { ...args } active color = "#00ff00" />
207
199
</ div >
208
200
) ;
209
201
} ,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export interface AchievementSummaryProps
22
22
socials ?: Socials ;
23
23
active ?: boolean ;
24
24
className ?: string ;
25
+ color ?: string ;
25
26
}
26
27
27
28
const achievementSummaryVariants = cva ( "border border-transparent" , {
@@ -43,6 +44,7 @@ export const AchievementSummary = ({
43
44
socials,
44
45
active,
45
46
className,
47
+ color,
46
48
variant,
47
49
} : AchievementSummaryProps ) => {
48
50
const { points, count } = useMemo ( ( ) => {
@@ -66,6 +68,7 @@ export const AchievementSummary = ({
66
68
variant = { variant }
67
69
active = { active }
68
70
className = { className }
71
+ color = { color }
69
72
/>
70
73
< CardContent className = "p-0" >
71
74
< AchievementProgress
@@ -75,6 +78,7 @@ export const AchievementSummary = ({
75
78
variant = { variant }
76
79
completed
77
80
className = { className }
81
+ color = { color }
78
82
/>
79
83
</ CardContent >
80
84
</ Card >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export interface ArcadeDiscoveryEventProps
13
13
icon : string ;
14
14
} ;
15
15
loading ?: boolean ;
16
+ color ?: string ;
16
17
}
17
18
18
19
export const arcadeDiscoveryEventVariants = cva (
@@ -39,6 +40,7 @@ export const ArcadeDiscoveryEvent = ({
39
40
loading,
40
41
variant,
41
42
className,
43
+ color,
42
44
} : ArcadeDiscoveryEventProps ) => {
43
45
const bgColor = useMemo ( ( ) => {
44
46
switch ( variant ) {
@@ -71,6 +73,7 @@ export const ArcadeDiscoveryEvent = ({
71
73
title = { achievement . title }
72
74
icon = { achievement . icon }
73
75
className = { className }
76
+ color = { color }
74
77
/>
75
78
) }
76
79
</ div >
@@ -83,10 +86,12 @@ const AchievementEvent = ({
83
86
title,
84
87
icon,
85
88
className,
89
+ color,
86
90
} : {
87
91
title : string ;
88
92
icon : string ;
89
93
className ?: string ;
94
+ color ?: string ;
90
95
} ) => {
91
96
return (
92
97
< div
@@ -95,6 +100,7 @@ const AchievementEvent = ({
95
100
"flex items-center gap-x-1.5 data-[theme=true]:text-primary" ,
96
101
className ,
97
102
) }
103
+ style = { { color } }
98
104
>
99
105
< p className = "text-xs text-foreground-300" > earned</ p >
100
106
< div className = "flex items-center gap-1 p-1 border-background-400 border rounded-sm" >
Original file line number Diff line number Diff line change @@ -72,16 +72,8 @@ export const MultiColors: Story = {
72
72
render : ( args ) => {
73
73
return (
74
74
< div className = "flex flex-col gap-4" >
75
- < ArcadeDiscoveryGroup
76
- { ...args }
77
- rounded
78
- className = "data-[theme=true]:text-[#ff00ff]"
79
- />
80
- < ArcadeDiscoveryGroup
81
- { ...args }
82
- rounded
83
- className = "data-[theme=true]:text-[#00ff00]"
84
- />
75
+ < ArcadeDiscoveryGroup { ...args } rounded color = "#ff00ff" />
76
+ < ArcadeDiscoveryGroup { ...args } rounded color = "#00ff00" />
85
77
</ div >
86
78
) ;
87
79
} ,
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export const ArcadeDiscoveryGroup = ({
40
40
rounded,
41
41
variant,
42
42
className,
43
+ color,
43
44
} : ArcadeDiscoveryGroupProps ) => {
44
45
return (
45
46
< div
@@ -53,6 +54,7 @@ export const ArcadeDiscoveryGroup = ({
53
54
loading = { loading }
54
55
className = { className }
55
56
variant = { variant }
57
+ color = { color }
56
58
{ ...event }
57
59
/>
58
60
) ) }
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export interface ArcadeGameHeaderProps
40
40
socials ?: Socials ;
41
41
active ?: boolean ;
42
42
className ?: string ;
43
+ color ?: string ;
43
44
}
44
45
45
46
export const arcadeGameHeaderVariants = cva (
@@ -67,6 +68,7 @@ export const ArcadeGameHeader = ({
67
68
active,
68
69
variant,
69
70
className,
71
+ color,
70
72
} : ArcadeGameHeaderProps ) => {
71
73
const pins = useMemo ( ( ) => {
72
74
if ( ! achievements ) return [ ] ;
@@ -121,6 +123,7 @@ export const ArcadeGameHeader = ({
121
123
pins = { pins }
122
124
variant = { variant }
123
125
className = { className }
126
+ color = { color }
124
127
/>
125
128
) }
126
129
</ div >
You can’t perform that action at this time.
0 commit comments