diff --git a/src/components/DataDisplay/Stats/Stats.stories.tsx b/src/components/DataDisplay/Stats/Stats.stories.tsx
index 4b3894a49..3161b1ebe 100644
--- a/src/components/DataDisplay/Stats/Stats.stories.tsx
+++ b/src/components/DataDisplay/Stats/Stats.stories.tsx
@@ -1,5 +1,13 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
-import { CursorArrowRaysIcon, EnvelopeOpenIcon, UsersIcon } from '@heroicons/react/24/outline';
+import {
+ CursorArrowRaysIcon,
+ EnvelopeOpenIcon,
+ UsersIcon,
+ FireIcon,
+ BoltIcon,
+ ArrowsRightLeftIcon,
+ ExclamationTriangleIcon,
+} from '@heroicons/react/24/outline';
import { Stats } from './Stats';
const meta = {
@@ -10,7 +18,7 @@ const meta = {
},
decorators: [
Story => (
-
+
),
@@ -242,3 +250,88 @@ export const SingleStat: Story = {
],
},
};
+
+/** Enhanced style with iconColor, valueClassName, subtitle, and accentColor */
+export const EnhancedStyle: Story = {
+ args: {
+ gridClassName: 'grid grid-cols-2 gap-3 lg:grid-cols-4',
+ stats: [
+ {
+ id: 'gas-impact',
+ name: 'Gas Impact',
+ value: '+59.8%',
+ icon: FireIcon,
+ iconColor: '#ef4444',
+ valueClassName: 'text-red-500',
+ subtitle: '111.4M → 178.0M',
+ accentColor: '#ef44444D',
+ },
+ {
+ id: 'transactions',
+ name: 'Transactions',
+ value: '1,357',
+ icon: BoltIcon,
+ iconColor: '#3b82f6',
+ subtitle: 'across 5 blocks',
+ accentColor: '#3b82f633',
+ },
+ {
+ id: 'diverged',
+ name: 'Diverged',
+ value: '641',
+ icon: ArrowsRightLeftIcon,
+ iconColor: '#f59e0b',
+ valueClassName: 'text-amber-500',
+ subtitle: '47.2% of txs',
+ accentColor: '#f59e0b33',
+ },
+ {
+ id: 'status',
+ name: 'Status Changes',
+ value: '633',
+ icon: ExclamationTriangleIcon,
+ iconColor: '#ef4444',
+ valueClassName: 'text-red-500',
+ subtitle: 'transactions changed outcome',
+ accentColor: '#ef444433',
+ },
+ ],
+ },
+};
+
+/** Enhanced style with all-green healthy state */
+export const EnhancedHealthy: Story = {
+ args: {
+ gridClassName: 'grid grid-cols-3 gap-3',
+ stats: [
+ {
+ id: 'diverged',
+ name: 'Diverged',
+ value: '0',
+ icon: ArrowsRightLeftIcon,
+ iconColor: '#22c55e',
+ subtitle: '0% of txs',
+ accentColor: '#22c55e33',
+ },
+ {
+ id: 'status',
+ name: 'Status Changes',
+ value: '0',
+ icon: ExclamationTriangleIcon,
+ iconColor: '#22c55e',
+ subtitle: 'all outcomes preserved',
+ accentColor: '#22c55e33',
+ },
+ {
+ id: 'reverts',
+ name: 'Internal Reverts',
+ value: '-12',
+ icon: CursorArrowRaysIcon,
+ iconColor: '#22c55e',
+ valueClassName: 'text-green-500',
+ subtitle: '24 → 12 total',
+ accentColor: '#22c55e33',
+ },
+ ],
+ },
+};
diff --git a/src/components/DataDisplay/Stats/Stats.tsx b/src/components/DataDisplay/Stats/Stats.tsx
index 243f9ec7d..6589f49da 100644
--- a/src/components/DataDisplay/Stats/Stats.tsx
+++ b/src/components/DataDisplay/Stats/Stats.tsx
@@ -5,74 +5,117 @@ import clsx from 'clsx';
import { Card } from '@/components/Layout/Card';
import type { StatsProps } from './Stats.types';
-export function Stats({ stats, title, className }: StatsProps): JSX.Element {
+export function Stats({ stats, title, className, gridClassName }: StatsProps): JSX.Element {
return (
{title &&
{title}
}
- {stats.map(item => (
-
-
- {item.link.label}
- {item.name} stats
-
-
- ) : undefined
- }
- >
-
- {item.icon && (
-
-
-
- )}
- {item.name}
-
-
- {item.value}
- {item.delta && (
+ {stats.map(item => {
+ const Icon = item.icon;
+ const hasCustomIcon = Icon && item.iconColor;
+ const hasLegacyIcon = Icon && !item.iconColor;
+
+ return (
+
+
+ {item.link.label}
+ {item.name} stats
+
+
+ ) : undefined
+ }
+ >
+