Skip to content

Commit 0718319

Browse files
committed
🐛 Fix dyn color propagation (out of tailwind)
1 parent 83a2545 commit 0718319

File tree

12 files changed

+42
-21
lines changed

12 files changed

+42
-21
lines changed

packages/ui-next/src/components/modules/achievements/pin-icon/pin-icon.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export interface AchievementPinIconProps
3333
empty?: boolean;
3434
theme?: boolean;
3535
className?: string;
36+
color?: string;
3637
}
3738

3839
export const AchievementPinIcon = ({
@@ -42,12 +43,14 @@ export const AchievementPinIcon = ({
4243
variant,
4344
size,
4445
className,
46+
color,
4547
}: AchievementPinIconProps) => {
4648
return (
4749
<div
4850
data-theme={theme}
4951
data-empty={empty}
5052
className={cn(achievementPinIconVariants({ variant, size }), className)}
53+
style={{ color: theme ? color : undefined }}
5154
>
5255
{empty ? (
5356
<div className="w-3 h-3 fa-spider-web fa-thin" />

packages/ui-next/src/components/modules/achievements/pin-icons/pin-icons.stories.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,11 @@ export const HighlightTheme: Story = {
5454
theme: true,
5555
},
5656
};
57+
58+
export const Color: Story = {
59+
args: {
60+
variant: "highlight",
61+
theme: true,
62+
color: "#ff00ff",
63+
},
64+
};

packages/ui-next/src/components/modules/achievements/pin-icons/pin-icons.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export interface AchievementPinIconsProps
2626
pins: { id: string; icon: string }[];
2727
theme?: boolean;
2828
className?: string;
29+
color?: string;
2930
}
3031

3132
export const AchievementPinIcons = ({
@@ -34,6 +35,7 @@ export const AchievementPinIcons = ({
3435
variant,
3536
size,
3637
className,
38+
color,
3739
}: AchievementPinIconsProps) => {
3840
return (
3941
<div className={achievementPinsVariants({ variant, size })}>
@@ -45,6 +47,7 @@ export const AchievementPinIcons = ({
4547
size={size}
4648
theme={theme}
4749
className={className}
50+
color={color}
4851
/>
4952
))}
5053
{Array.from({ length: 3 - pins.length }).map((_, index) => (

packages/ui-next/src/components/modules/achievements/progress/progress.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface AchievementProgressProps
88
points: number;
99
completed?: boolean;
1010
className?: string;
11+
color?: string;
1112
}
1213

1314
const achievementProgressVariants = cva("p-3 flex items-center gap-x-3", {
@@ -30,6 +31,7 @@ export function AchievementProgress({
3031
completed,
3132
variant,
3233
className,
34+
color,
3335
}: AchievementProgressProps) {
3436
return (
3537
<div className={cn(achievementProgressVariants({ variant }), className)}>
@@ -44,6 +46,7 @@ export function AchievementProgress({
4446
total={total}
4547
completed={!!completed}
4648
className={className}
49+
color={color}
4750
/>
4851
<div className="flex gap-x-1">
4952
<SparklesIcon

packages/ui-next/src/components/modules/achievements/summary/summary.stories.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,8 @@ export const MultiColors: Story = {
194194
render: (args) => {
195195
return (
196196
<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" />
207199
</div>
208200
);
209201
},

packages/ui-next/src/components/modules/achievements/summary/summary.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface AchievementSummaryProps
2222
socials?: Socials;
2323
active?: boolean;
2424
className?: string;
25+
color?: string;
2526
}
2627

2728
const achievementSummaryVariants = cva("border border-transparent", {
@@ -43,6 +44,7 @@ export const AchievementSummary = ({
4344
socials,
4445
active,
4546
className,
47+
color,
4648
variant,
4749
}: AchievementSummaryProps) => {
4850
const { points, count } = useMemo(() => {
@@ -66,6 +68,7 @@ export const AchievementSummary = ({
6668
variant={variant}
6769
active={active}
6870
className={className}
71+
color={color}
6972
/>
7073
<CardContent className="p-0">
7174
<AchievementProgress
@@ -75,6 +78,7 @@ export const AchievementSummary = ({
7578
variant={variant}
7679
completed
7780
className={className}
81+
color={color}
7882
/>
7983
</CardContent>
8084
</Card>

packages/ui-next/src/components/modules/arcade/discovery-event/discovery-event.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export interface ArcadeDiscoveryEventProps
1313
icon: string;
1414
};
1515
loading?: boolean;
16+
color?: string;
1617
}
1718

1819
export const arcadeDiscoveryEventVariants = cva(
@@ -39,6 +40,7 @@ export const ArcadeDiscoveryEvent = ({
3940
loading,
4041
variant,
4142
className,
43+
color,
4244
}: ArcadeDiscoveryEventProps) => {
4345
const bgColor = useMemo(() => {
4446
switch (variant) {
@@ -71,6 +73,7 @@ export const ArcadeDiscoveryEvent = ({
7173
title={achievement.title}
7274
icon={achievement.icon}
7375
className={className}
76+
color={color}
7477
/>
7578
)}
7679
</div>
@@ -83,10 +86,12 @@ const AchievementEvent = ({
8386
title,
8487
icon,
8588
className,
89+
color,
8690
}: {
8791
title: string;
8892
icon: string;
8993
className?: string;
94+
color?: string;
9095
}) => {
9196
return (
9297
<div
@@ -95,6 +100,7 @@ const AchievementEvent = ({
95100
"flex items-center gap-x-1.5 data-[theme=true]:text-primary",
96101
className,
97102
)}
103+
style={{ color }}
98104
>
99105
<p className="text-xs text-foreground-300">earned</p>
100106
<div className="flex items-center gap-1 p-1 border-background-400 border rounded-sm">

packages/ui-next/src/components/modules/arcade/discovery-group/discovery-group.stories.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,8 @@ export const MultiColors: Story = {
7272
render: (args) => {
7373
return (
7474
<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" />
8577
</div>
8678
);
8779
},

packages/ui-next/src/components/modules/arcade/discovery-group/discovery-group.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const ArcadeDiscoveryGroup = ({
4040
rounded,
4141
variant,
4242
className,
43+
color,
4344
}: ArcadeDiscoveryGroupProps) => {
4445
return (
4546
<div
@@ -53,6 +54,7 @@ export const ArcadeDiscoveryGroup = ({
5354
loading={loading}
5455
className={className}
5556
variant={variant}
57+
color={color}
5658
{...event}
5759
/>
5860
))}

packages/ui-next/src/components/modules/arcade/game-header/game-header.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface ArcadeGameHeaderProps
4040
socials?: Socials;
4141
active?: boolean;
4242
className?: string;
43+
color?: string;
4344
}
4445

4546
export const arcadeGameHeaderVariants = cva(
@@ -67,6 +68,7 @@ export const ArcadeGameHeader = ({
6768
active,
6869
variant,
6970
className,
71+
color,
7072
}: ArcadeGameHeaderProps) => {
7173
const pins = useMemo(() => {
7274
if (!achievements) return [];
@@ -121,6 +123,7 @@ export const ArcadeGameHeader = ({
121123
pins={pins}
122124
variant={variant}
123125
className={className}
126+
color={color}
124127
/>
125128
)}
126129
</div>

0 commit comments

Comments
 (0)