|
18 | 18 |
|
19 | 19 | let { icon, label, value, detail, history, tone = 'cpu', loading = false, disabled = false, testId }: Props = $props(); |
20 | 20 |
|
21 | | - const barColorClass = $derived(tone === 'cpu' ? 'bg-sky-400/75' : 'bg-emerald-400/75'); |
22 | | - const iconColorClass = $derived(tone === 'cpu' ? 'text-sky-300' : 'text-emerald-300'); |
| 21 | + const barColorClass = $derived( |
| 22 | + tone === 'cpu' ? 'bg-sky-500/75 dark:bg-sky-400/75' : 'bg-emerald-500/75 dark:bg-emerald-400/75' |
| 23 | + ); |
| 24 | + const iconColorClass = $derived(tone === 'cpu' ? 'text-sky-600 dark:text-sky-300' : 'text-emerald-600 dark:text-emerald-300'); |
23 | 25 | const Icon = $derived(icon); |
24 | 26 | </script> |
25 | 27 |
|
|
32 | 34 | > |
33 | 35 | <div class="grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3"> |
34 | 36 | <div class="flex min-w-0 items-center gap-2"> |
35 | | - <div class="bg-background/70 flex size-7 shrink-0 items-center justify-center rounded-md border border-white/8"> |
| 37 | + <div class="bg-background/70 border-border/60 flex size-7 shrink-0 items-center justify-center rounded-md border"> |
36 | 38 | <Icon class={cn('size-4', disabled ? 'text-muted-foreground' : iconColorClass)} /> |
37 | 39 | </div> |
38 | 40 | <div class="min-w-0"> |
39 | | - <div class="text-[11px] font-medium tracking-normal text-white/70">{label}</div> |
| 41 | + <div class="text-muted-foreground text-[11px] font-medium tracking-normal">{label}</div> |
40 | 42 | {#if loading} |
41 | 43 | <Skeleton class="mt-1 h-5 w-20" /> |
42 | 44 | {:else} |
43 | | - <div class={cn('truncate text-sm font-semibold tabular-nums', disabled ? 'text-muted-foreground' : 'text-white')}> |
| 45 | + <div class={cn('truncate text-sm font-semibold tabular-nums', disabled ? 'text-muted-foreground' : 'text-foreground')}> |
44 | 46 | {value} |
45 | 47 | </div> |
46 | 48 | {/if} |
|
50 | 52 | {#if loading} |
51 | 53 | <Skeleton class="mt-0.5 h-4 w-16 justify-self-end" /> |
52 | 54 | {:else} |
53 | | - <div class="shrink-0 justify-self-end pl-2 text-right text-[11px] text-white/55 tabular-nums">{detail}</div> |
| 55 | + <div class="text-muted-foreground shrink-0 justify-self-end pl-2 text-right text-[11px] tabular-nums">{detail}</div> |
54 | 56 | {/if} |
55 | 57 | </div> |
56 | 58 |
|
57 | 59 | {#if loading} |
58 | 60 | <Skeleton class="h-8 w-full" /> |
59 | 61 | {:else} |
60 | | - <div class="bg-background/60 flex h-8 items-end gap-[3px] overflow-hidden rounded-md border border-white/8 px-1.5 py-1"> |
| 62 | + <div class="bg-background/60 border-border/60 flex h-8 items-end gap-[3px] overflow-hidden rounded-md border px-1.5 py-1"> |
61 | 63 | {#each history as sample, index (`${tone}-${index}`)} |
62 | 64 | <ArcaneTooltip.Root> |
63 | 65 | <ArcaneTooltip.Trigger class="flex h-full min-w-0 flex-1 items-end self-stretch"> |
64 | 66 | <div |
65 | | - class={cn('min-w-0 flex-1 rounded-[2px] transition-opacity', disabled ? 'bg-white/8' : barColorClass)} |
| 67 | + class={cn('min-w-0 flex-1 rounded-[2px] transition-opacity', disabled ? 'bg-muted' : barColorClass)} |
66 | 68 | style={`height: ${Math.max(disabled ? 12 : Math.min(Math.max(sample.percent, 6), 100), 6)}%; opacity: ${disabled ? 0.35 : 0.45 + Math.min(sample.percent, 100) / 180};`} |
67 | 69 | ></div> |
68 | 70 | </ArcaneTooltip.Trigger> |
|
0 commit comments