Skip to content

Commit dc43285

Browse files
devsimzecursoragent
andcommitted
standardize empty-state illustration sizing
Add shared empty-state illustration sizing tokens and apply them across existing empty-state surfaces to keep sizing consistent across breakpoints without changing assets. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 18d4a39 commit dc43285

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

‎src/components/common/CompactEmptyWalletState.tsx‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { WalletMinimal } from 'lucide-react';
22
import { cn } from '@/lib/utils';
3+
import { EMPTY_STATE_ILLUSTRATION_SIZES } from './emptyStateIllustration.config';
34

45
interface CompactEmptyWalletStateProps {
56
title?: string;
@@ -19,8 +20,18 @@ const CompactEmptyWalletState: React.FC<CompactEmptyWalletStateProps> = ({
1920
className
2021
)}
2122
>
22-
<div className="mt-0.5 rounded-lg bg-amber-300/20 p-1.5">
23-
<WalletMinimal className="size-4 text-amber-200" />
23+
<div
24+
className={cn(
25+
'mt-0.5 flex items-center justify-center rounded-lg bg-amber-300/20',
26+
EMPTY_STATE_ILLUSTRATION_SIZES.compactBadgeFrame
27+
)}
28+
>
29+
<WalletMinimal
30+
className={cn(
31+
'text-amber-200',
32+
EMPTY_STATE_ILLUSTRATION_SIZES.compactBadgeIcon
33+
)}
34+
/>
2435
</div>
2536
<div>
2637
<p className="text-sm font-semibold text-amber-100">{title}</p>

‎src/components/common/EmptyState.tsx‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { cn } from '@/lib/utils';
22
import { Button } from '@/components/ui/button';
33
import { RotateCcw } from 'lucide-react';
4+
import { EMPTY_STATE_ILLUSTRATION_SIZES } from './emptyStateIllustration.config';
45

56
interface EmptyStateProps {
67
image: string;
@@ -26,11 +27,19 @@ const EmptyState: React.FC<EmptyStateProps> = ({
2627
role="status"
2728
aria-label={title}
2829
>
29-
<div className="relative mb-6">
30+
<div
31+
className={cn(
32+
'relative mb-6 flex items-center justify-center',
33+
EMPTY_STATE_ILLUSTRATION_SIZES.heroFrame
34+
)}
35+
>
3036
<div className="absolute inset-0 size-full rounded-full bg-amber-500/10 blur-2xl" />
3137
<img
3238
src={image}
33-
className="relative z-10 size-[180px] object-contain opacity-60 grayscale transition-all duration-500 hover:opacity-80 hover:grayscale-0"
39+
className={cn(
40+
'relative z-10 opacity-60 grayscale transition-all duration-500 hover:opacity-80 hover:grayscale-0',
41+
EMPTY_STATE_ILLUSTRATION_SIZES.heroVisual
42+
)}
3443
alt=""
3544
aria-hidden="true"
3645
/>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const EMPTY_STATE_ILLUSTRATION_SIZES = {
2+
heroFrame: 'size-36 sm:size-40 md:size-44',
3+
heroVisual: 'size-full object-contain',
4+
compactBadgeFrame: 'size-8 shrink-0',
5+
compactBadgeIcon: 'size-4',
6+
panelBadgeFrame: 'size-11 shrink-0',
7+
panelBadgeIcon: 'size-5',
8+
} as const;

0 commit comments

Comments
 (0)