@@ -38,23 +38,49 @@ function getBarWidth(value: FacetValue | null | undefined): number {
3838 return (value .raw / maxValue .value ) * 100
3939}
4040
41- function getStatusClass(status ? : FacetValue [' status' ]): string {
41+ function getStatusClass(status ? : FacetValue [' status' ], hasBar = false ): string {
42+ // When there's a bar, only apply text color, not background
43+ if (hasBar ) {
44+ switch (status ) {
45+ case ' muted' :
46+ return ' text-fg-subtle'
47+ default :
48+ return ' text-fg'
49+ }
50+ }
51+
52+ // Original behavior when no bar
4253 switch (status ) {
4354 case ' good' :
44- return ' text -emerald-400'
55+ return ' bg -emerald-400/20 px-3 py-0.5 rounded-xl '
4556 case ' info' :
46- return ' text -blue-400'
57+ return ' bg -blue-400/20 px-3 py-0.5 rounded-xl '
4758 case ' warning' :
48- return ' text -amber-400'
59+ return ' bg -amber-400/20 px-3 py-0.5 rounded-xl '
4960 case ' bad' :
50- return ' text -red-400'
61+ return ' bg -red-400/20 px-3 py-0.5 rounded-xl '
5162 case ' muted' :
5263 return ' text-fg-subtle'
5364 default :
5465 return ' text-fg'
5566 }
5667}
5768
69+ function getStatusBarClass(status ? : FacetValue [' status' ]): string {
70+ switch (status ) {
71+ case ' good' :
72+ return ' bg-emerald-500/20'
73+ case ' info' :
74+ return ' bg-blue-500/20'
75+ case ' warning' :
76+ return ' bg-amber-500/20'
77+ case ' bad' :
78+ return ' bg-red-500/20'
79+ default :
80+ return ' bg-fg/5'
81+ }
82+ }
83+
5884// Check if a specific cell is loading
5985function isCellLoading(index : number ): boolean {
6086 return props .facetLoading || (props .columnLoading ?.[index ] ?? false )
@@ -80,7 +106,8 @@ function isCellLoading(index: number): boolean {
80106 <!-- Background bar for numeric values -->
81107 <div
82108 v-if =" showBar && value && getBarWidth(value) > 0"
83- class =" absolute inset-y-1 inset-is-1 bg-fg/5 rounded-sm transition-all duration-300"
109+ class =" absolute inset-y-1 inset-is-1 rounded-sm transition-all duration-300"
110+ :class =" getStatusBarClass(value.status)"
84111 :style =" { width: `calc(${getBarWidth(value)}% - 8px)` }"
85112 aria-hidden =" true"
86113 />
@@ -103,7 +130,8 @@ function isCellLoading(index: number): boolean {
103130 <TooltipApp v-if =" value.tooltip" :text =" value.tooltip" position =" top" >
104131 <span
105132 class =" relative font-mono text-sm text-center tabular-nums cursor-help"
106- :class =" getStatusClass(value.status)"
133+ :class =" getStatusClass(value.status, showBar && getBarWidth(value) > 0)"
134+ :data-status =" value.status"
107135 >
108136 <!-- Date values use DateTime component for i18n and user settings -->
109137 <DateTime v-if =" value.type === 'date'" :datetime =" value.display" date-style =" medium" />
@@ -113,7 +141,8 @@ function isCellLoading(index: number): boolean {
113141 <span
114142 v-else
115143 class =" relative font-mono text-sm text-center tabular-nums"
116- :class =" getStatusClass(value.status)"
144+ :class =" getStatusClass(value.status, showBar && getBarWidth(value) > 0)"
145+ :data-status =" value.status"
117146 >
118147 <!-- Date values use DateTime component for i18n and user settings -->
119148 <DateTime v-if =" value.type === 'date'" :datetime =" value.display" date-style =" medium" />
0 commit comments