feat(ui): migrate components and pages to system colors

Update folder card, file card, dual sidebar, notifications, upload tasks, and team settings components to remove all hardcoded slate, blue, and red colors. They now fully leverage standard semantic system/theme tokens, providing polished, consistent dark mode support.
This commit is contained in:
yiling
2026-06-01 10:34:22 +08:00
parent 87707d7708
commit 42f78016dd
15 changed files with 237 additions and 228 deletions
@@ -194,7 +194,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
if (isLoading) {
return (
<div className="flex h-64 items-center justify-center">
<Loader2 className="h-8 w-8 animate-spin text-blue-600" />
<Loader2 className="h-8 w-8 animate-spin text-primary" />
</div>
)
}
@@ -203,13 +203,13 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
<div className="h-full flex flex-col space-y-0">
<div className="flex-none space-y-4 pb-4">
<div className="flex items-center justify-between">
<h3 className="text-lg font-semibold text-slate-900 dark:text-white flex items-center gap-2">
<Cpu className="w-5 h-5 text-blue-600" />
<h3 className="text-lg font-semibold text-foreground flex items-center gap-2">
<Cpu className="w-5 h-5 text-primary" />
Configured AI Providers
</h3>
<Button
onClick={() => setIsCreateDialogOpen(true)}
className="bg-blue-600 hover:bg-blue-700 text-white gap-2"
className="bg-primary hover:bg-primary/90 text-primary-foreground gap-2"
>
<Plus className="w-4 h-4" />
Add Provider
@@ -217,12 +217,12 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
</div>
<div className="relative px-0.5">
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" />
<Search className="absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground" />
<Input
placeholder="Search providers..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="pl-10 bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-800 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-0"
className="pl-10 bg-card border-border focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0"
/>
</div>
</div>
@@ -232,19 +232,17 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
{filteredProviders.map((provider) => (
<Card
key={provider.id}
className="group cursor-pointer hover:border-blue-300 dark:hover:border-blue-700 transition-all hover:shadow-md overflow-hidden"
className="group cursor-pointer hover:border-primary/50 transition-all hover:shadow-md overflow-hidden"
onClick={() => setEditingProviderId(provider.id)}
>
<CardContent className="p-5 flex items-center justify-between gap-4">
<div className="flex items-center gap-4 min-w-0 flex-1">
<div className="flex-none p-3 bg-slate-100 dark:bg-slate-800 rounded-xl group-hover:bg-blue-50 dark:group-hover:bg-blue-900/20 transition-colors">
<Globe className="w-6 h-6 text-slate-600 dark:text-slate-400 group-hover:text-blue-600 dark:group-hover:text-blue-400" />
<div className="flex-none p-3 bg-muted rounded-xl group-hover:bg-primary/10 transition-colors">
<Globe className="w-6 h-6 text-muted-foreground group-hover:text-primary" />
</div>
<div className="min-w-0 flex-1">
<div className="flex items-center gap-2">
<span className="font-bold text-slate-900 dark:text-white truncate">
{provider.name}
</span>
<span className="font-bold text-foreground truncate">{provider.name}</span>
{provider.isBuiltin && (
<Badge
variant="secondary"
@@ -254,14 +252,14 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
</Badge>
)}
</div>
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-slate-500 mt-1">
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-muted-foreground mt-1">
<span className="flex items-center gap-1 flex-none">
<Zap className="w-3 h-3" />
{provider.config.api}
</span>
{provider.config.baseUrl && (
<span className="flex items-center gap-1 min-w-0">
<span className="h-1 w-1 rounded-full bg-slate-300 dark:bg-slate-700 flex-none" />
<span className="h-1 w-1 rounded-full bg-muted-foreground/30 flex-none" />
<Info className="w-3 h-3 flex-none" />
<span className="truncate max-w-[200px] md:max-w-[300px]">
{provider.config.baseUrl}
@@ -269,7 +267,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
</span>
)}
<span className="flex items-center gap-1 flex-none">
<span className="h-1 w-1 rounded-full bg-slate-300 dark:bg-slate-700 flex-none" />
<span className="h-1 w-1 rounded-full bg-muted-foreground/30 flex-none" />
<Maximize2 className="w-3 h-3" />
{provider.modelsCount} Models
{editingProviderId === provider.id && isModelsLoading && (
@@ -286,7 +284,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
<Button
variant="ghost"
size="icon"
className="h-8 w-8 text-slate-400 hover:text-slate-600 dark:hover:text-slate-300"
className="h-8 w-8 text-muted-foreground hover:text-foreground"
>
<MoreVertical className="w-4 h-4" />
</Button>
@@ -299,25 +297,23 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
setProviderToDelete(provider)
setIsDeleteDialogOpen(true)
}}
className="text-red-500 focus:text-red-500 gap-2 cursor-pointer"
className="text-destructive focus:text-destructive gap-2 cursor-pointer"
>
<Trash2 className="w-4 h-4" /> Delete
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<ChevronRight className="flex-none w-5 h-5 text-slate-300 group-hover:text-blue-500 transition-colors" />
<ChevronRight className="flex-none w-5 h-5 text-muted-foreground/50 group-hover:text-primary transition-colors" />
</div>
</CardContent>
</Card>
))}
{providers?.length === 0 && (
<div className="text-center py-12 bg-slate-50 dark:bg-slate-900/50 rounded-2xl border-2 border-dashed border-slate-200 dark:border-slate-800">
<Cpu className="w-12 h-12 text-slate-300 mx-auto mb-4" />
<h4 className="text-slate-900 dark:text-white font-medium">
No Providers Configured
</h4>
<p className="text-sm text-slate-500 mt-1">
<div className="text-center py-12 bg-muted/30 rounded-2xl border-2 border-dashed border-border">
<Cpu className="w-12 h-12 text-muted-foreground/50 mx-auto mb-4" />
<h4 className="text-foreground font-medium">No Providers Configured</h4>
<p className="text-sm text-muted-foreground mt-1">
Add your first AI provider to get started.
</p>
</div>
@@ -325,16 +321,16 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
{providers && providers.length > 0 && filteredProviders.length === 0 && (
<div className="text-center py-12">
<Search className="w-12 h-12 text-slate-300 mx-auto mb-4" />
<h4 className="text-slate-900 dark:text-white font-medium">No matches found</h4>
<p className="text-sm text-slate-500 mt-1">
<Search className="w-12 h-12 text-muted-foreground/50 mx-auto mb-4" />
<h4 className="text-foreground font-medium">No matches found</h4>
<p className="text-sm text-muted-foreground mt-1">
Try adjusting your search for "{searchQuery}"
</p>
<Button
variant="ghost"
size="sm"
onClick={() => setSearchQuery('')}
className="mt-4 text-blue-600 hover:text-blue-700 hover:bg-blue-50 dark:hover:bg-blue-900/20"
className="mt-4 text-primary hover:text-primary/90 hover:bg-primary/10"
>
Clear search
</Button>
@@ -383,7 +379,7 @@ export function ProvidersSettings({ teamId }: ProvidersSettingsProps) {
<AlertDialogFooter>
<AlertDialogCancel onClick={() => setProviderToDelete(null)}>Cancel</AlertDialogCancel>
<AlertDialogAction
className="bg-red-600 hover:bg-red-700 text-white"
className="bg-destructive hover:bg-destructive/90 text-white"
onClick={() => {
if (providerToDelete) {
deleteMutation.mutate(providerToDelete.id)