@snapdragonsnursery/react-components 1.26.0 → 1.27.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapdragonsnursery/react-components",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -72,18 +72,27 @@ export function StatCard({ title, value, caption, icon: Icon, tone = 'default',
72
72
  return (
73
73
  <Card className={cn('shadow-sm hover:shadow transition-shadow', className)}>
74
74
  <CardHeader className="pb-3">
75
- <div className="flex items-center justify-between">
76
- <CardTitle className="text-sm font-medium text-muted-foreground">
75
+ {/* Fixed [title | icon] grid so every card shares the same title inset and column widths */}
76
+ <div className="grid min-h-10 grid-cols-[minmax(0,1fr)_2.5rem] items-start gap-x-3 gap-y-0">
77
+ <CardTitle className="min-w-0 text-left text-sm font-medium leading-snug text-muted-foreground">
77
78
  {loading ? <Skeleton className="h-4 w-24" /> : title}
78
79
  </CardTitle>
79
- {Icon ? (
80
- <div className={cn('inline-flex h-10 w-10 items-center justify-center rounded-full ring-1', styles.badge, styles.ring)}>
81
- {loading ? <Skeleton className="h-5 w-5 rounded-full" /> : <Icon className="h-5 w-5" />}
82
- </div>
83
- ) : null}
80
+ <div
81
+ className={cn(
82
+ 'flex h-10 w-10 shrink-0 items-center justify-center',
83
+ Icon && cn('rounded-full ring-1', styles.badge, styles.ring)
84
+ )}
85
+ aria-hidden={!Icon}
86
+ >
87
+ {loading && Icon ? (
88
+ <Skeleton className="h-5 w-5 rounded-full" />
89
+ ) : Icon ? (
90
+ <Icon className="h-5 w-5" />
91
+ ) : null}
92
+ </div>
84
93
  </div>
85
94
  </CardHeader>
86
- <CardContent>
95
+ <CardContent className="text-left">
87
96
  <div className={cn('text-3xl font-extrabold tracking-tight', styles.value)}>
88
97
  {loading ? <Skeleton className="h-8 w-20" /> : value}
89
98
  </div>