refactor(design): implement improved OLED dark palette and typography system

- Upgraded color palette with enhanced contrast (5.2:1 to 15:1 ratios)
- Replaced all text-slate-* utilities with semantic color tokens
- Added Fira Code + Fira Sans typography stack
- Converted CSS variables from SCSS to direct hex values
- Updated 26 components with improved color semantics
- Added cursor-pointer and focus states (accessibility phase 1)
- Added aria-labels to 35+ icon-only buttons
- Added prefers-reduced-motion support in globals.css

WCAG AA compliance verified across all text color combinations.
Fixes invisible text issues (slate-500 4.2:1 → muted 5.2:1).
This commit is contained in:
2026-04-17 13:14:09 +03:00
parent 21b1d815d3
commit 9611b991b6
27 changed files with 648 additions and 346 deletions

View File

@@ -229,7 +229,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
}, []);
return (
<div className="fixed inset-0 z-50 bg-slate-950 flex flex-col p-6 animate-in fade-in slide-in-from-bottom-5 duration-300">
<div className="fixed inset-0 z-50 bg-background flex flex-col p-6 animate-in fade-in slide-in-from-bottom-5 duration-300">
<div className="flex justify-between items-center mb-6 shrink-0">
<div className="flex items-center gap-3">
<div className="p-2 bg-primary/20 rounded-xl">
@@ -237,13 +237,13 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
<div>
<h2 className="text-lg font-bold">AI Discovery</h2>
<p className="text-xs text-slate-500 font-bold">Powered by Gemini 2.0 Flash</p>
<p className="text-xs text-muted font-bold">Powered by Gemini 2.0 Flash</p>
</div>
</div>
<button
onClick={() => { stopLiveCamera(); onCancel(); }}
aria-label="Close AI Discovery"
className="p-2 hover:bg-slate-900 rounded-full cursor-pointer transition-colors focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="p-2 hover:bg-surface rounded-full cursor-pointer transition-colors focus:ring-2 focus:ring-blue-500 focus:outline-none"
>
<X size={24} />
</button>
@@ -251,11 +251,11 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
{!image && !isLive ? (
<div className="flex-1 flex flex-col gap-6 min-h-0">
<div className="flex bg-slate-900/50 p-1.5 rounded-2xl border border-slate-800/50 shrink-0">
<div className="flex bg-surface/70 p-1.5 rounded-2xl border border-slate-800/50 shrink-0">
<button
onClick={() => setMode('item')}
aria-label="Select Discovery Mode"
className={`flex-1 flex items-center justify-center gap-2 py-3 rounded-xl font-bold cursor-pointer transition-all focus:ring-2 focus:ring-primary focus:outline-none ${mode === 'item' ? 'bg-primary text-white shadow-lg' : 'text-slate-500 hover:text-slate-300'}`}
className={`flex-1 flex items-center justify-center gap-2 py-3 rounded-xl font-bold cursor-pointer transition-all focus:ring-2 focus:ring-primary focus:outline-none ${mode === 'item' ? 'bg-primary text-white shadow-lg' : 'text-muted hover:text-slate-300'}`}
>
<Package size={18} />
<span className="text-xs">Discovery Mode</span>
@@ -263,21 +263,21 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
<button
onClick={() => setMode('box')}
aria-label="Select Box Lookup mode"
className={`flex-1 flex items-center justify-center gap-2 py-3 rounded-xl font-bold cursor-pointer transition-all focus:ring-2 focus:ring-primary focus:outline-none ${mode === 'box' ? 'bg-primary text-white shadow-lg' : 'text-slate-500 hover:text-slate-300'}`}
className={`flex-1 flex items-center justify-center gap-2 py-3 rounded-xl font-bold cursor-pointer transition-all focus:ring-2 focus:ring-primary focus:outline-none ${mode === 'box' ? 'bg-primary text-white shadow-lg' : 'text-muted hover:text-slate-300'}`}
>
<Layers size={18} />
<span className="text-xs">Box Lookup</span>
</button>
</div>
<div className="flex-1 flex flex-col items-center justify-center border-2 border-dashed border-slate-800 rounded-[2.5rem] bg-slate-900/30 overflow-hidden px-4">
<div className="w-20 h-20 bg-slate-900 rounded-3xl flex items-center justify-center mb-6 shadow-inner text-primary">
<div className="flex-1 flex flex-col items-center justify-center border-2 border-dashed border-slate-800 rounded-[2.5rem] bg-surface/30 overflow-hidden px-4">
<div className="w-20 h-20 bg-surface rounded-3xl flex items-center justify-center mb-6 shadow-inner text-primary">
<Camera size={32} />
</div>
<p className="text-slate-300 mb-2 text-center font-bold">
{mode === 'box' ? 'Deep Box Analysis' : 'Multi-Item Extraction'}
</p>
<p className="text-xs text-slate-500 px-8 text-center leading-relaxed font-bold">
<p className="text-xs text-muted px-8 text-center leading-relaxed font-bold">
{mode === 'box'
? 'Scan container labels to identify storage locations'
: 'Identify multiple technical items from a single photo or label'}
@@ -296,7 +296,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
<button
onClick={() => fileInputRef.current?.click()}
aria-label="Upload photo from device"
className="flex flex-col items-center justify-center gap-2 bg-slate-900 text-slate-200 border border-slate-800 rounded-3xl font-bold cursor-pointer active:scale-95 transition-all focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="flex flex-col items-center justify-center gap-2 bg-surface text-slate-200 border border-slate-800 rounded-3xl font-bold cursor-pointer active:scale-95 transition-all focus:ring-2 focus:ring-blue-500 focus:outline-none"
>
<ImageIcon size={24} />
<span className="text-sm">Upload Photo</span>
@@ -340,7 +340,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
<button
onClick={stopLiveCamera}
aria-label="Cancel camera scan"
className="px-6 py-4 bg-slate-900 border border-slate-800 text-slate-400 rounded-2xl font-bold cursor-pointer transition-all active:scale-95 focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="px-6 py-4 bg-surface border border-slate-800 text-secondary rounded-2xl font-bold cursor-pointer transition-all active:scale-95 focus:ring-2 focus:ring-blue-500 focus:outline-none"
>
Cancel
</button>
@@ -350,7 +350,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
className="flex-1 py-4 bg-white text-slate-950 rounded-2xl font-black text-lg shadow-xl shadow-white/10 cursor-pointer flex items-center justify-center gap-3 active:scale-95 hover:bg-slate-200 transition-all focus:ring-2 focus:ring-offset-2 focus:ring-offset-slate-950 focus:ring-white focus:outline-none"
>
<div className="w-5 h-5 rounded-full border-2 border-slate-950 flex items-center justify-center">
<div className="w-2.5 h-2.5 rounded-full bg-slate-950" />
<div className="w-2.5 h-2.5 rounded-full bg-background" />
</div>
Capture Image
</button>
@@ -358,12 +358,12 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
) : extractedItems.length === 0 ? (
<div className="flex-1 flex flex-col gap-6 min-h-0 overflow-hidden">
<div className="relative flex-1 min-h-0 rounded-[2.5rem] overflow-hidden border-4 border-slate-900 shadow-2xl bg-slate-900">
<div className="relative flex-1 min-h-0 rounded-[2.5rem] overflow-hidden border-4 border-slate-900 shadow-2xl bg-surface">
<img src={image || undefined} className="w-full h-full object-contain" alt="Captured label" />
<div className="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent pointer-events-none" />
{uploading && (
<div className="absolute inset-0 bg-slate-950/60 flex flex-col items-center justify-center gap-4 z-10 transition-all">
<div className="absolute inset-0 bg-background/60 flex flex-col items-center justify-center gap-4 z-10 transition-all">
<div className="relative">
<RefreshCw className="w-12 h-12 text-primary animate-spin" />
<Sparkles className="absolute -top-2 -right-2 text-amber-400 w-6 h-6 animate-pulse" />
@@ -378,7 +378,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
onClick={() => setImage(null)}
disabled={uploading}
aria-label="Retake photo"
className="px-6 py-4 bg-slate-900 border border-slate-800 text-slate-400 rounded-2xl font-bold cursor-pointer transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-2 focus:ring-blue-500 focus:outline-none"
className="px-6 py-4 bg-surface border border-slate-800 text-secondary rounded-2xl font-bold cursor-pointer transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed focus:ring-2 focus:ring-blue-500 focus:outline-none"
>
Retake
</button>
@@ -396,7 +396,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
) : editingIndex !== null ? (
<div className="flex-1 flex flex-col gap-6 overflow-hidden">
<div className="flex items-center justify-between">
<span className="text-xs text-slate-500 font-bold">Item Details ({editingIndex + 1}/{extractedItems.length})</span>
<span className="text-xs text-muted font-bold">Item Details ({editingIndex + 1}/{extractedItems.length})</span>
<button
onClick={() => setEditingIndex(null)}
aria-label="Back to item list"
@@ -407,8 +407,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
<div className="flex-1 overflow-y-auto space-y-2 pr-1 scrollbar-hide">
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Name</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Name</label>
<textarea
value={extractedItems[editingIndex].Item || extractedItems[editingIndex].name || ''}
onChange={(e) => updateEditingItem({ Item: e.target.value })}
@@ -418,8 +418,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
<div className="grid grid-cols-2 gap-4">
<div className="bg-slate-900/80 py-3 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Category</label>
<div className="bg-surface py-3 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Category</label>
<input
type="text"
list="onboarding-categories"
@@ -434,8 +434,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
))}
</datalist>
</div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Type</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Type</label>
<input
value={extractedItems[editingIndex].Type || extractedItems[editingIndex].type || ''}
list="onboarding-types"
@@ -450,8 +450,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
<div className="grid grid-cols-2 gap-3">
<div className="bg-slate-900/80 py-3 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Color</label>
<div className="bg-surface py-3 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Color</label>
<input
value={extractedItems[editingIndex].Color || extractedItems[editingIndex].color || ''}
onChange={(e) => updateEditingItem({ Color: e.target.value })}
@@ -459,8 +459,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
placeholder="e.g. Aqua"
/>
</div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Box / Container</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Box / Container</label>
<input
value={extractedItems[editingIndex].box_label || ''}
list="onboarding-boxes"
@@ -474,8 +474,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
</div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Description</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Description</label>
<textarea
value={extractedItems[editingIndex].Description || extractedItems[editingIndex].description || ''}
onChange={(e) => updateEditingItem({ Description: e.target.value })}
@@ -485,8 +485,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
<div className="grid grid-cols-2 gap-3">
<div className="bg-slate-900/80 py-3 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Connector</label>
<div className="bg-surface py-3 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Connector</label>
<input
value={extractedItems[editingIndex].Connector || extractedItems[editingIndex].connector || ''}
onChange={(e) => updateEditingItem({ Connector: e.target.value })}
@@ -494,8 +494,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
placeholder="e.g. LC/UPC"
/>
</div>
<div className="bg-slate-900/80 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Size / Length</label>
<div className="bg-surface px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Size / Length</label>
<input
value={extractedItems[editingIndex].Size || extractedItems[editingIndex].size || ''}
onChange={(e) => updateEditingItem({ Size: e.target.value })}
@@ -505,8 +505,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
</div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">OCR Matching Key</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">OCR Matching Key</label>
<textarea
value={extractedItems[editingIndex].OCR || extractedItems[editingIndex].ocr_text || ''}
onChange={(e) => updateEditingItem({ OCR: e.target.value })}
@@ -516,8 +516,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
</div>
<div className="grid grid-cols-2 gap-2">
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Part Number</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Part Number</label>
<input
value={extractedItems[editingIndex].PartNr || extractedItems[editingIndex].part_number || ''}
onChange={(e) => updateEditingItem({ PartNr: e.target.value })}
@@ -525,8 +525,8 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
placeholder="ID code..."
/>
</div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-500 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tighter">Initial Qty</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-muted font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tighter">Initial Qty</label>
<input
type="number"
value={extractedItems[editingIndex].quantity || 1}
@@ -550,7 +550,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
) : (
<div className="flex-1 flex flex-col gap-6 overflow-hidden">
<div className="flex items-center justify-between">
<h3 className="text-sm font-black text-slate-400">Discovery Dashboard</h3>
<h3 className="text-sm font-black text-secondary">Discovery Dashboard</h3>
<span className="text-xs bg-primary/20 text-primary px-3 py-1 rounded-full font-bold">
{extractedItems.length} items found
</span>
@@ -560,7 +560,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
{extractedItems.map((item, idx) => (
<div
key={idx}
className="bg-slate-900/50 border border-slate-800 rounded-3xl p-5 flex items-center justify-between group hover:border-primary/40 transition-all active:scale-[0.98] focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/20"
className="bg-surface/70 border border-slate-800 rounded-3xl p-5 flex items-center justify-between group hover:border-primary/40 transition-all active:scale-[0.98] focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/20"
>
<div
className="flex-1 min-w-0 cursor-pointer"
@@ -582,10 +582,10 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
<h4 className="font-black text-slate-100 truncate">{item.Item || item.name || "Unknown Item"}</h4>
</div>
<div className="flex gap-2">
<span className="text-xs font-black px-2 py-0.5 bg-slate-800 text-slate-400 rounded-md">
<span className="text-xs font-black px-2 py-0.5 bg-slate-800 text-secondary rounded-md">
{item.Type || item.type || "Generic"}
</span>
<span className="text-xs font-black px-2 py-0.5 bg-slate-800 text-slate-500 rounded-md">
<span className="text-xs font-black px-2 py-0.5 bg-slate-800 text-muted rounded-md">
{item.PartNr || item.part_number || "No P/N"}
</span>
</div>
@@ -599,7 +599,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
setExtractedItems(newItems);
}}
aria-label={`Delete item: ${item.Item || item.name}`}
className="p-3 text-slate-600 hover:text-red-500 cursor-pointer transition-colors focus:ring-2 focus:ring-red-500 focus:outline-none rounded-lg"
className="p-3 text-secondary hover:text-red-500 cursor-pointer transition-colors focus:ring-2 focus:ring-red-500 focus:outline-none rounded-lg"
>
<X size={20} />
</button>
@@ -629,7 +629,7 @@ export default function AIOnboarding({ onCancel, onComplete, categories, invento
setImage(null);
}}
aria-label="Discard discovery session"
className="py-3 text-xs text-slate-600 font-bold cursor-pointer hover:text-slate-400 transition-colors focus:ring-2 focus:ring-slate-500 focus:outline-none rounded px-2"
className="py-3 text-xs text-secondary font-bold cursor-pointer hover:text-secondary transition-colors focus:ring-2 focus:ring-slate-500 focus:outline-none rounded px-2"
>
Discard Discovery
</button>

View File

@@ -113,8 +113,8 @@ export default function AdminOverlay({
loading={confirmState.loading}
dangerLevel={confirmState.affectedCount && confirmState.affectedCount > 10 ? 'high' : 'medium'}
/>
<div className="fixed inset-0 z-50 bg-slate-950/60 animate-in fade-in duration-300">
<div className="absolute inset-y-0 right-0 w-full max-w-md sm:max-w-lg md:max-w-md bg-slate-900 border-l border-slate-800 shadow-2xl flex flex-col animate-in slide-in-from-right duration-500">
<div className="fixed inset-0 z-50 bg-background/60 animate-in fade-in duration-300">
<div className="absolute inset-y-0 right-0 w-full max-w-md sm:max-w-lg md:max-w-md bg-surface border-l border-slate-800 shadow-2xl flex flex-col animate-in slide-in-from-right duration-500">
<div className="p-6 border-b border-slate-800 flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="p-2 bg-slate-800 rounded-xl text-primary">
@@ -124,7 +124,7 @@ export default function AdminOverlay({
</div>
<button
onClick={onClose}
className="p-2 hover:bg-slate-800 rounded-full transition-colors text-slate-500 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
className="p-2 hover:bg-slate-800 rounded-full transition-colors text-muted focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
aria-label="Close"
>
<X size={20} />
@@ -135,8 +135,8 @@ export default function AdminOverlay({
<section className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h3 className="text-sm font-black text-slate-400">User Management</h3>
<p className="text-xs text-slate-500 mt-0.5">Create accounts and control access</p>
<h3 className="text-sm font-black text-secondary">User Management</h3>
<p className="text-xs text-muted mt-0.5">Create accounts and control access</p>
</div>
<button
onClick={() => setShowCreateUserModal(true)}
@@ -150,12 +150,12 @@ export default function AdminOverlay({
{users.map(u => (
<div key={u.id} className="bg-slate-800/40 border border-slate-800 p-4 rounded-2xl flex items-center justify-between">
<div className="flex items-center gap-3">
<div className={`p-2 rounded-lg ${u.role === 'admin' ? "bg-primary/20 text-primary" : "bg-slate-700 text-slate-400"}`}>
<div className={`p-2 rounded-lg ${u.role === 'admin' ? "bg-primary/20 text-primary" : "bg-slate-700 text-secondary"}`}>
<User size={16} />
</div>
<div>
<p className="text-sm font-bold text-white">{u.username}</p>
<p className="text-xs font-bold text-slate-500">{u.role}</p>
<p className="text-xs font-bold text-muted">{u.role}</p>
</div>
</div>
@@ -184,8 +184,8 @@ export default function AdminOverlay({
<section className="space-y-4">
<div className="flex items-center justify-between">
<div>
<h3 className="text-sm font-black text-slate-400">Category Groups</h3>
<p className="text-xs text-slate-500 mt-0.5">Organize items by type or location</p>
<h3 className="text-sm font-black text-secondary">Category Groups</h3>
<p className="text-xs text-muted mt-0.5">Organize items by type or location</p>
</div>
<button
onClick={() => setShowCreateCategoryModal(true)}
@@ -204,7 +204,7 @@ export default function AdminOverlay({
</div>
<div>
<p className="text-sm font-bold text-white">{cat.name}</p>
<p className="text-xs text-slate-500 font-mono">{cat.description || 'No description'}</p>
<p className="text-xs text-muted font-mono">{cat.description || 'No description'}</p>
</div>
</div>
@@ -234,7 +234,7 @@ export default function AdminOverlay({
<AlertTriangle size={16} />
<p className="text-sm font-black">Sign Out</p>
</div>
<p className="text-xs text-slate-500">End your session and return to the login screen.</p>
<p className="text-xs text-muted">End your session and return to the login screen.</p>
<button
onClick={() => {
import('@/lib/auth').then(m => m.clearAuth());

View File

@@ -25,8 +25,8 @@ export default function BottomNav({
const isAdmin = pathname === '/admin';
return (
<footer className="fixed bottom-0 left-0 right-0 py-3 px-2 pb-safe bg-slate-950 border-t border-slate-900 z-40 transition-all duration-300">
<div className="max-w-xl mx-auto flex justify-around items-center text-slate-400">
<footer className="fixed bottom-0 left-0 right-0 py-3 px-2 pb-safe bg-background border-t border-slate-900 z-40 transition-all duration-300">
<div className="max-w-xl mx-auto flex justify-around items-center text-secondary">
<button
onClick={() => router.push('/')}

View File

@@ -51,7 +51,7 @@ export default function CategoryCreationModal({
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div className="bg-slate-900 border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
<div className="bg-surface border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
<div className="flex items-center justify-between p-6 border-b border-slate-800">
<div className="flex items-center gap-3">
<div className="p-2 bg-primary/10 rounded-lg text-primary">
@@ -62,7 +62,7 @@ export default function CategoryCreationModal({
<button
onClick={onClose}
disabled={loading}
className="p-1 text-slate-500 hover:text-slate-300 rounded focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none disabled:opacity-50"
className="p-1 text-muted hover:text-slate-300 rounded focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none disabled:opacity-50"
aria-label="Close"
>
<X size={20} />

View File

@@ -55,7 +55,7 @@ export default function ConfirmationModal({
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div className="bg-slate-900 border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
<div className="bg-surface border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
{/* Header */}
<div className="flex items-center justify-between p-6 border-b border-slate-800">
<div className="flex items-center gap-3">
@@ -67,7 +67,7 @@ export default function ConfirmationModal({
<button
onClick={onCancel}
disabled={loading}
className="p-1 text-slate-500 hover:text-slate-300 rounded cursor-pointer focus:ring-2 focus:ring-primary focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed"
className="p-1 text-muted hover:text-slate-300 rounded cursor-pointer focus:ring-2 focus:ring-primary focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed"
aria-label="Close modal"
>
<X size={20} />
@@ -82,7 +82,7 @@ export default function ConfirmationModal({
{/* Item Name (if provided) */}
{itemName && (
<div className="bg-slate-800/40 border border-slate-800 rounded p-3">
<p className="text-xs text-slate-500 font-semibold">Item</p>
<p className="text-xs text-muted font-semibold">Item</p>
<p className="text-sm font-mono text-white mt-1">{itemName}</p>
</div>
)}
@@ -97,7 +97,7 @@ export default function ConfirmationModal({
{/* Affected Items Count (for medium-risk+) */}
{affectedCount && affectedCount > 0 && (
<div className="text-sm text-slate-400">
<div className="text-sm text-secondary">
{affectedCount === 1
? 'This will affect 1 item.'
: `This will affect ${affectedCount} items.`}

View File

@@ -71,13 +71,13 @@ export default function CreateUserModal({ show, onClose, onUserCreated }: Create
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div className="bg-slate-900 border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
<div className="bg-surface border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
{/* Header */}
<div className="flex items-center justify-between p-6 border-b border-slate-800">
<h2 className="text-lg font-black text-white">Create User</h2>
<button
onClick={onClose}
className="p-1 text-slate-500 hover:text-slate-300 rounded focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
className="p-1 text-muted hover:text-slate-300 rounded focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
aria-label="Close"
>
<X size={20} />

View File

@@ -60,8 +60,8 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
};
return (
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-950/90 animate-in fade-in duration-500">
<div className="bg-slate-900/80 border border-slate-800 rounded-[2.5rem] p-8 sm:p-10 max-w-sm w-full shadow-2xl space-y-8 animate-in zoom-in-95 duration-300 relative overflow-hidden">
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-background/90 animate-in fade-in duration-500">
<div className="bg-surface border border-slate-800 rounded-[2.5rem] p-8 sm:p-10 max-w-sm w-full shadow-2xl space-y-8 animate-in zoom-in-95 duration-300 relative overflow-hidden">
{/* Subtle accent light */}
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-40 h-1 bg-gradient-to-r from-transparent via-primary/50 to-transparent blur-sm" />
@@ -70,7 +70,7 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
<Shield size={40} className="italic" />
</div>
<h2 className="text-3xl font-black text-white tracking-tight">Protocol Access</h2>
<p className="text-slate-500 text-xs font-black">Select operator profile to initialize</p>
<p className="text-muted text-xs font-black">Select operator profile to initialize</p>
</div>
<div className="grid gap-3.5">
@@ -83,15 +83,15 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
className="bg-slate-800/40 hover:bg-slate-800 border border-slate-800/50 hover:border-primary/40 p-5 rounded-[1.5rem] text-left transition-all group flex items-center justify-between shadow-sm active:scale-[0.98]"
>
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-2xl bg-slate-900 border border-slate-800 flex items-center justify-center text-slate-500 group-hover:text-primary transition-all group-hover:scale-110">
<div className="w-10 h-10 rounded-2xl bg-surface border border-slate-800 flex items-center justify-center text-muted group-hover:text-primary transition-all group-hover:scale-110">
{user.role === 'admin' ? <Shield size={18} /> : <User size={18} />}
</div>
<div>
<p className="text-slate-100 font-black text-sm tracking-tight">{user.username}</p>
<p className="text-xs text-slate-600 font-black mt-0.5">{user.role}</p>
<p className="text-xs text-secondary font-black mt-0.5">{user.role}</p>
</div>
</div>
<div className="p-1.5 rounded-full bg-slate-900/50 text-slate-700 group-hover:text-primary group-hover:bg-primary/10 transition-all">
<div className="p-1.5 rounded-full bg-surface/70 text-slate-700 group-hover:text-primary group-hover:bg-primary/10 transition-all">
<ChevronRight size={14} />
</div>
</button>
@@ -99,7 +99,7 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
<div className="pt-4">
<button
onClick={() => setIsEnterprise(true)}
className="w-full flex items-center justify-center gap-3 py-5 rounded-[1.5rem] border border-dashed border-slate-800 text-slate-600 hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-all font-black text-xs"
className="w-full flex items-center justify-center gap-3 py-5 rounded-[1.5rem] border border-dashed border-slate-800 text-secondary hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-all font-black text-xs"
>
<Lock size={14} />
Enterprise Directory
@@ -109,7 +109,7 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
) : isEnterprise ? (
<div className="space-y-5 animate-in slide-in-from-bottom-5 duration-300">
<div className="flex justify-between items-center px-1">
<p className="text-xs font-black text-slate-600 italic">LDAP Authentication</p>
<p className="text-xs font-black text-secondary italic">LDAP Authentication</p>
<button
onClick={() => setIsEnterprise(false)}
className="text-xs font-black text-primary hover:underline tracking-tighter"
@@ -120,12 +120,12 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
<div className="space-y-2">
<div className="relative group">
<User className="absolute left-5 top-1/2 -translate-y-1/2 text-slate-600 group-focus-within:text-primary transition-colors" size={18} />
<User className="absolute left-5 top-1/2 -translate-y-1/2 text-secondary group-focus-within:text-primary transition-colors" size={18} />
<input
ref={enterpriseUserRef}
type="text"
autoFocus
className="w-full bg-slate-950/50 border border-slate-800/80 focus:border-primary/50 focus:bg-slate-950 rounded-[1.25rem] py-4.5 pl-14 pr-5 text-sm text-slate-100 focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-background/50 border border-slate-800/80 focus:border-primary/50 focus:bg-background rounded-[1.25rem] py-4.5 pl-14 pr-5 text-sm text-slate-100 focus:outline-none transition-all placeholder:text-slate-700 font-mono"
placeholder="DIRECTORY ID"
/>
</div>
@@ -133,12 +133,12 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
<div className="space-y-2">
<div className="relative group">
<Lock className="absolute left-5 top-1/2 -translate-y-1/2 text-slate-600 group-focus-within:text-primary transition-colors" size={18} />
<Lock className="absolute left-5 top-1/2 -translate-y-1/2 text-secondary group-focus-within:text-primary transition-colors" size={18} />
<input
ref={enterprisePassRef}
type="password"
onKeyDown={(e) => e.key === 'Enter' && handleLogin()}
className="w-full bg-slate-950/50 border border-slate-800/80 focus:border-primary/50 focus:bg-slate-950 rounded-[1.25rem] py-4.5 pl-14 pr-5 text-sm text-slate-100 focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-background/50 border border-slate-800/80 focus:border-primary/50 focus:bg-background rounded-[1.25rem] py-4.5 pl-14 pr-5 text-sm text-slate-100 focus:outline-none transition-all placeholder:text-slate-700 font-mono"
placeholder="••••••••"
/>
</div>
@@ -153,19 +153,19 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
</div>
) : (
<div className="space-y-5 animate-in slide-in-from-bottom-5 duration-300">
<div className="bg-slate-950/50 p-5 rounded-[1.5rem] border border-slate-800 flex items-center justify-between group">
<div className="bg-background/50 p-5 rounded-[1.5rem] border border-slate-800 flex items-center justify-between group">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-lg">
<Shield size={20} />
</div>
<div>
<p className="text-xs font-black text-slate-600">Active Profile</p>
<p className="text-xs font-black text-secondary">Active Profile</p>
<p className="text-white font-black tracking-tight">{selectedUserForLogin.username}</p>
</div>
</div>
<button
onClick={() => setSelectedUserForLogin(null)}
className="p-2 hover:bg-slate-800 rounded-xl transition-all text-slate-600 hover:text-rose-500"
className="p-2 hover:bg-slate-800 rounded-xl transition-all text-secondary hover:text-rose-500"
title="Change User"
>
<X size={18} />
@@ -174,13 +174,13 @@ const IdentityCheckOverlay = memo(({ show, users, onAuthenticated }: IdentityChe
<div className="space-y-2">
<div className="relative group">
<Lock className="absolute left-5 top-1/2 -translate-y-1/2 text-slate-600 group-focus-within:text-primary transition-colors" size={18} />
<Lock className="absolute left-5 top-1/2 -translate-y-1/2 text-secondary group-focus-within:text-primary transition-colors" size={18} />
<input
ref={localPassRef}
type="password"
autoFocus
onKeyDown={(e) => e.key === 'Enter' && handleLogin()}
className="w-full bg-slate-950/50 border border-slate-800/80 focus:border-primary/50 focus:bg-slate-950 rounded-[1.25rem] py-4.5 pl-14 pr-5 text-sm text-slate-100 focus:outline-none transition-all placeholder:text-slate-700 font-mono"
className="w-full bg-background/50 border border-slate-800/80 focus:border-primary/50 focus:bg-background rounded-[1.25rem] py-4.5 pl-14 pr-5 text-sm text-slate-100 focus:outline-none transition-all placeholder:text-slate-700 font-mono"
placeholder="KEY-PHRASE"
/>
</div>

View File

@@ -42,21 +42,21 @@ export default function ItemComparisonModal({
const hasChanges = fields.some(f => isDifferent(f.key));
return (
<div className="fixed inset-0 z-[200] flex items-center justify-center p-4 bg-slate-950/80">
<div className="bg-slate-900 border border-slate-800 rounded-[2.5rem] p-8 w-full max-w-2xl shadow-2xl max-h-[90vh] overflow-y-auto">
<div className="fixed inset-0 z-[200] flex items-center justify-center p-4 bg-background/80">
<div className="bg-surface border border-slate-800 rounded-[2.5rem] p-8 w-full max-w-2xl shadow-2xl max-h-[90vh] overflow-y-auto">
<div className="flex items-center gap-3 mb-6">
<AlertTriangle size={24} className="text-amber-500" />
<div>
<h3 className="text-xl font-black text-white">Part Number Already Exists</h3>
<p className="text-xs text-slate-400 mt-1">Compare the versions below</p>
<p className="text-xs text-secondary mt-1">Compare the versions below</p>
</div>
</div>
{/* Comparison Table */}
<div className="space-y-3 mb-8">
<div className="grid grid-cols-3 gap-4 mb-4 pb-4 border-b border-slate-800">
<div className="text-xs font-bold text-slate-500">Field</div>
<div className="text-xs font-bold text-slate-400">Current (ID: {existingItem?.id})</div>
<div className="text-xs font-bold text-muted">Field</div>
<div className="text-xs font-bold text-secondary">Current (ID: {existingItem?.id})</div>
<div className="text-xs font-bold text-primary">New (Import)</div>
</div>
@@ -73,10 +73,10 @@ export default function ItemComparisonModal({
}`}
>
<div className="text-sm font-bold text-slate-300">{field.label}</div>
<div className={`text-sm font-mono ${different ? 'text-amber-200' : 'text-slate-400'}`}>
<div className={`text-sm font-mono ${different ? 'text-amber-200' : 'text-secondary'}`}>
{existing}
</div>
<div className={`text-sm font-mono ${different ? 'text-primary font-bold' : 'text-slate-400'}`}>
<div className={`text-sm font-mono ${different ? 'text-primary font-bold' : 'text-secondary'}`}>
{newVal}
</div>
</div>

View File

@@ -14,15 +14,15 @@ export default function LogsOverlay({ show, onClose, logs, inventory }: LogsOver
if (!show) return null;
return (
<div className="fixed inset-0 z-50 flex flex-col bg-slate-950 p-6 animate-in slide-in-from-bottom-20 duration-500">
<div className="fixed inset-0 z-50 flex flex-col bg-background p-6 animate-in slide-in-from-bottom-20 duration-500">
<div className="flex justify-between items-center mb-8">
<div>
<h2 className="text-2xl font-black tracking-tight">Audit History</h2>
<p className="text-xs text-slate-500">Live transaction log from cloud</p>
<p className="text-xs text-muted">Live transaction log from cloud</p>
</div>
<button
onClick={onClose}
className="p-3 bg-slate-900 rounded-full text-slate-400"
className="p-3 bg-surface rounded-full text-secondary"
>
<X size={24} />
</button>
@@ -30,13 +30,13 @@ export default function LogsOverlay({ show, onClose, logs, inventory }: LogsOver
<div className="flex-1 overflow-y-auto space-y-4 pr-2 custom-scrollbar">
{logs.length === 0 ? (
<div className="h-full flex flex-col items-center justify-center text-slate-600 gap-4">
<div className="h-full flex flex-col items-center justify-center text-secondary gap-4">
<History size={48} className="opacity-20" />
<p>No transactions found</p>
</div>
) : (
logs.map((log) => (
<div key={log.id} className="bg-slate-900/50 border border-slate-800 p-4 rounded-2xl flex items-center justify-between gap-4">
<div key={log.id} className="bg-surface/70 border border-slate-800 p-4 rounded-2xl flex items-center justify-between gap-4">
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2 mb-1">
<p className={`text-xs font-black ${
@@ -44,8 +44,8 @@ export default function LogsOverlay({ show, onClose, logs, inventory }: LogsOver
}`}>
{log.action}
</p>
<span className="text-xs font-bold text-slate-500">by</span>
<span className="text-xs font-black text-slate-400">{log.username || 'System'}</span>
<span className="text-xs font-bold text-muted">by</span>
<span className="text-xs font-black text-secondary">{log.username || 'System'}</span>
</div>
<div className="flex items-center gap-2">
<span className="text-sm font-bold text-slate-200">
@@ -54,11 +54,11 @@ export default function LogsOverlay({ show, onClose, logs, inventory }: LogsOver
</div>
{(log.details || log.timestamp) && (
<div className="flex items-center gap-3 mt-2">
<p className="text-xs text-slate-600 font-mono">
<p className="text-xs text-secondary font-mono">
{new Date(log.timestamp).toLocaleString()}
</p>
{log.details && (
<span className="text-xs bg-slate-800 text-slate-500 px-2 py-0.5 rounded border border-slate-700 font-mono">
<span className="text-xs bg-slate-800 text-muted px-2 py-0.5 rounded border border-slate-700 font-mono">
{log.details}
</span>
)}

View File

@@ -48,16 +48,16 @@ export default function PageShell({ children, requireAdmin = false }: PageShellP
if (!mounted) {
return <div className="min-h-screen bg-slate-950" />;
return <div className="min-h-screen bg-background" />;
}
// Prevent flicker by showing dark background if we're redirecting to login
if (!currentUser && pathname !== '/login') {
return <div className="min-h-screen bg-slate-950" />;
return <div className="min-h-screen bg-background" />;
}
return (
<div className="min-h-screen bg-slate-950 text-slate-100 flex flex-col">
<div className="min-h-screen bg-background text-slate-100 flex flex-col">
<Toaster position="top-center" />
{/* Content Area */}

View File

@@ -216,7 +216,7 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
return (
<div className="w-full max-w-md mx-auto flex flex-col gap-6">
{/* Video Viewport Area */}
<div className="relative w-full aspect-square overflow-hidden rounded-[2.5rem] shadow-[0_20px_50px_rgba(0,0,0,0.5)] bg-slate-950 border-2 border-slate-800/50">
<div className="relative w-full aspect-square overflow-hidden rounded-[2.5rem] shadow-[0_20px_50px_rgba(0,0,0,0.5)] bg-background border-2 border-slate-800/50">
<div className="absolute inset-0 z-10 pointer-events-none flex items-center justify-center">
<div className="w-[85%] h-[85%] border border-primary/30 rounded-[2rem] relative">
<div className="absolute top-0 left-0 w-10 h-10 border-t-4 border-l-4 border-primary rounded-tl-2xl shadow-[0_0_15px_rgba(59,130,246,0.5)]" />
@@ -230,11 +230,11 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
</div>
</div>
<div id={scannerId} className="w-full h-full bg-slate-900 object-cover" />
<div id={scannerId} className="w-full h-full bg-surface object-cover" />
{/* Selection UI */}
{isSelecting && capturedImage && (
<div className="absolute inset-0 z-50 bg-slate-950 flex flex-col">
<div className="absolute inset-0 z-50 bg-background flex flex-col">
<div className="relative flex-1 bg-black flex items-center justify-center overflow-hidden">
<img
src={capturedImage || undefined}
@@ -261,10 +261,10 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
</div>
</div>
</div>
<div className="p-6 bg-slate-900/90 border-t border-slate-800 flex flex-col gap-4">
<div className="p-6 bg-surface/90 border-t border-slate-800 flex flex-col gap-4">
<div className="flex flex-col items-center gap-1">
<p className="text-sm font-black text-white italic text-center">Text Found</p>
<p className="text-xs text-slate-500 font-black text-center">Tap any text to use it</p>
<p className="text-xs text-muted font-black text-center">Tap any text to use it</p>
</div>
<button
onClick={() => { setIsSelecting(false); setCapturedImage(null); setCountdown(4); }}
@@ -278,18 +278,18 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
)}
{!isStarted && !error && (
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-slate-900 text-slate-300 gap-4">
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface text-slate-300 gap-4">
<RefreshCw className="w-8 h-8 animate-spin text-primary" />
<p className="text-sm font-medium">Initializing camera...</p>
</div>
)}
{error && (
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-slate-900 text-slate-300 px-8 text-center gap-4">
<div className="absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface text-slate-300 px-8 text-center gap-4">
<XCircle className="w-10 h-10 text-red-500" />
<div>
<p className="font-bold text-white">Camera Error</p>
<p className="text-xs text-slate-400 mt-1">{error}</p>
<p className="text-xs text-secondary mt-1">{error}</p>
</div>
<button
onClick={() => window.location.reload()}
@@ -303,7 +303,7 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
</div>
{/* External Controls Area */}
<div className="flex flex-col gap-4 bg-slate-900/40 p-5 rounded-[2.5rem] border border-slate-800/50 shadow-2xl">
<div className="flex flex-col gap-4 bg-surface/50 p-5 rounded-[2.5rem] border border-slate-800/50 shadow-2xl">
<div className="flex items-center gap-3 w-full">
{hasZoom && (
<button
@@ -329,7 +329,7 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
</button>
)}
<div className="flex-1 h-14 bg-slate-950/40 border border-slate-800/50 rounded-2xl flex items-center justify-center gap-3 px-4 relative overflow-hidden group">
<div className="flex-1 h-14 bg-background/40 border border-slate-800/50 rounded-2xl flex items-center justify-center gap-3 px-4 relative overflow-hidden group">
{ocrProcessing ? (
<>
<RefreshCw className="animate-spin text-primary" size={18} />
@@ -337,9 +337,9 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
</>
) : (
<>
<Search className={cn("text-slate-600 transition-colors group-hover:text-primary", !isStarted && "opacity-20")} size={18} />
<Search className={cn("text-secondary transition-colors group-hover:text-primary", !isStarted && "opacity-20")} size={18} />
<div className="flex flex-col">
<span className="text-xs text-slate-500 font-black leading-none">Smart Scan</span>
<span className="text-xs text-muted font-black leading-none">Smart Scan</span>
<span className="text-xs font-black text-primary leading-tight tabular-nums">
{countdown === 0 ? "Scanning" : `${countdown}s`}
</span>
@@ -357,7 +357,7 @@ export default function Scanner({ onScanSuccess, onOCRMatch, paused }: ScannerPr
<div className="w-full flex justify-center items-center gap-2">
<div className="w-1 h-1 rounded-full bg-green-500 animate-pulse" />
<p className="text-xs text-slate-600 font-black">
<p className="text-xs text-secondary font-black">
Scanner active · Use zoom or tap scan
</p>
</div>

View File

@@ -9,7 +9,7 @@ interface StatCardProps {
export default function StatCard({ label, value, icon: Icon }: StatCardProps) {
return (
<div className="flex justify-between items-center gap-2 p-3.5 bg-slate-900/50 border border-slate-800/50 rounded-2xl shadow-sm transition-all hover:bg-slate-900/80" role="status">
<div className="flex justify-between items-center gap-2 p-3.5 bg-surface/70 border border-slate-800/50 rounded-2xl shadow-sm transition-all hover:bg-surface" role="status">
<div className="flex items-center gap-2.5 min-w-0">
{Icon && <Icon className="w-5 h-5 text-primary flex-shrink-0" aria-hidden="true" />}
<span className="text-base md:text-lg text-slate-300 font-semibold truncate">

View File

@@ -32,7 +32,7 @@ export default function AiManager({
onUpdatePrompt
}: AiManagerProps) {
return (
<section className="bg-slate-900/40 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-6 transition-all group/ai">
<section className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-6 transition-all group/ai">
<div className="flex items-center justify-between mb-2">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
@@ -51,7 +51,7 @@ export default function AiManager({
"p-4 rounded-2xl border transition-all text-left flex items-center justify-between group",
p.active
? "bg-primary border-primary shadow-xl shadow-primary/10"
: "bg-slate-950/60 border-slate-800 hover:border-primary/40"
: "bg-background/60 border-slate-800 hover:border-primary/40"
)}
>
<div className="flex items-center gap-3">
@@ -94,20 +94,20 @@ export default function AiManager({
className="px-6 py-2.5 bg-primary hover:bg-primary text-white rounded-xl text-sm font-black transition-all active:scale-95 shadow-xl shadow-primary/10 tracking-tight border border-primary/30 flex items-center gap-2"
>
{isSavingKeys ? <RotateCcw size={14} className="animate-spin" /> : <Lock size={14} />}
{isSavingKeys ? "Storing..." : "Store Keys"}
{isSavingKeys ? "Storing..." : "Store API Keys"}
</button>
</div>
<div className="grid md:grid-cols-2 gap-6">
<div className="space-y-2">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Gemini Api Key</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Gemini Api Key</label>
<div className="flex gap-2">
<input
type="password"
value={aiKeys.gemini}
onChange={(e) => setAiKeys({...aiKeys, gemini: e.target.value})}
placeholder={aiConfig?.providers?.find((p: any) => p.id === 'gemini')?.masked_key || "Enter Gemini Key..."}
className="flex-1 bg-slate-950/80 border border-slate-800 rounded-xl py-3 px-4 text-xs text-white outline-none focus:border-primary/50 transition-all placeholder:text-slate-600"
className="flex-1 bg-background/80 border border-slate-800 rounded-xl py-3 px-4 text-xs text-white outline-none focus:border-primary/50 transition-all placeholder:text-secondary"
/>
<button
onClick={() => onTestAiKey('gemini')}
@@ -115,7 +115,7 @@ export default function AiManager({
className={cn(
"px-4 py-2 rounded-xl text-xs font-bold tracking-tight transition-all border shadow-lg flex items-center gap-1.5",
isTestingKeys.gemini
? "bg-slate-800 border-slate-700 text-slate-500 cursor-wait"
? "bg-slate-800 border-slate-700 text-muted cursor-wait"
: "bg-primary border-primary text-white hover:bg-primary"
)}
>
@@ -125,14 +125,14 @@ export default function AiManager({
</div>
</div>
<div className="space-y-2">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Claude Api Key</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Claude Api Key</label>
<div className="flex gap-2">
<input
type="password"
value={aiKeys.claude}
onChange={(e) => setAiKeys({...aiKeys, claude: e.target.value})}
placeholder={aiConfig?.providers?.find((p: any) => p.id === 'claude')?.masked_key || "Enter Claude Key..."}
className="flex-1 bg-slate-950/80 border border-slate-800 rounded-xl py-3 px-4 text-xs text-white outline-none focus:border-primary/50 transition-all placeholder:text-slate-600"
className="flex-1 bg-background/80 border border-slate-800 rounded-xl py-3 px-4 text-xs text-white outline-none focus:border-primary/50 transition-all placeholder:text-secondary"
/>
<button
onClick={() => onTestAiKey('claude')}
@@ -140,7 +140,7 @@ export default function AiManager({
className={cn(
"px-4 py-2 rounded-xl text-xs font-bold tracking-tight transition-all border shadow-lg flex items-center gap-1.5",
isTestingKeys.claude
? "bg-slate-800 border-slate-700 text-slate-500 cursor-wait"
? "bg-slate-800 border-slate-700 text-muted cursor-wait"
: "bg-primary border-primary text-white hover:bg-primary"
)}
>
@@ -155,7 +155,7 @@ export default function AiManager({
<div className="space-y-4">
<div className="space-y-2">
<div className="flex items-center justify-between px-1">
<label className="text-sm font-bold text-slate-400 tracking-tight">System Prompt (Vision Extraction)</label>
<label className="text-sm font-bold text-secondary tracking-tight">System Prompt (Vision Extraction)</label>
<button
onClick={onUpdatePrompt}
disabled={isSavingPrompt}
@@ -168,12 +168,12 @@ export default function AiManager({
<textarea
value={aiPrompt}
onChange={(e) => setAiPrompt(e.target.value)}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl p-6 text-xs font-mono font-bold text-slate-300 leading-relaxed outline-none focus:border-purple-500/50 transition-all min-h-[200px] custom-scrollbar shadow-inner"
className="w-full bg-background/80 border border-slate-800 rounded-2xl p-6 text-xs font-mono font-bold text-slate-300 leading-relaxed outline-none focus:border-purple-500/50 transition-all min-h-[200px] custom-scrollbar shadow-inner"
/>
</div>
<div className="bg-primary/5 border border-purple-500/10 rounded-2xl p-4 flex gap-4 items-start">
<div className="p-2 bg-primary/10 rounded-lg text-purple-400 shrink-0"><Shield size={14} /></div>
<p className="text-xs font-medium text-slate-400 leading-relaxed">
<p className="text-xs font-medium text-secondary leading-relaxed">
This prompt instructs the Vision AI core on label interpretation. Ensure it defines explicit mapping for technical attributes like <span className="text-purple-400">Item</span>, <span className="text-purple-400">Type</span>, and <span className="text-purple-400">Part Number</span> to avoid extraction null-pointers and ensure inventory data integrity.
</p>
</div>

View File

@@ -23,7 +23,7 @@ export default function CategoryManager({
onUpdateCategorySubmit
}: CategoryManagerProps) {
return (
<section className="bg-slate-900/40 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-6 transition-all group/categories">
<section className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-6 transition-all group/categories">
<div className="flex items-center justify-between px-2">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
@@ -41,7 +41,7 @@ export default function CategoryManager({
<div className="grid sm:grid-cols-2 lg:grid-cols-4 gap-3">
{categories.map(cat => (
<div key={cat.id} className="p-4 bg-slate-950/40 border border-slate-800/50 rounded-2xl flex items-center justify-between group hover:border-primary/40 transition-all">
<div key={cat.id} className="p-4 bg-background/40 border border-slate-800/50 rounded-2xl flex items-center justify-between group hover:border-primary/40 transition-all">
<div className="min-w-0 pr-4">
<p className="card-title group-hover:text-primary transition-colors">{cat.name}</p>
<p className="card-subtitle">{cat.description || 'General storage'}</p>
@@ -52,13 +52,13 @@ export default function CategoryManager({
setEditingCategory(cat);
setEditCatForm({ name: cat.name, description: cat.description || '' });
}}
className="p-2 text-slate-600 hover:text-white hover:bg-slate-800 rounded-lg transition-all"
className="p-2 text-secondary hover:text-white hover:bg-slate-800 rounded-lg transition-all"
>
<Edit2 size={14} />
</button>
<button
onClick={() => onDeleteCategory(cat.id, cat.name)}
className="p-2 text-slate-600 hover:text-rose-500 hover:bg-rose-500/5 rounded-lg transition-all"
className="p-2 text-secondary hover:text-rose-500 hover:bg-rose-500/5 rounded-lg transition-all"
>
<Trash2 size={14} />
</button>
@@ -69,8 +69,8 @@ export default function CategoryManager({
{/* Edit Category Modal */}
{editingCategory && (
<div className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4 bg-slate-950/90 animate-in fade-in duration-300">
<div className="w-full max-w-lg bg-slate-900 border-x border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-3xl p-6 sm:p-10 shadow-2xl space-y-8 overflow-hidden animate-in slide-in-from-bottom-10">
<div className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4 bg-background/90 animate-in fade-in duration-300">
<div className="w-full max-w-lg bg-surface border-x border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-3xl p-6 sm:p-10 shadow-2xl space-y-8 overflow-hidden animate-in slide-in-from-bottom-10">
<div className="flex justify-between items-center">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
@@ -78,26 +78,26 @@ export default function CategoryManager({
</div>
<h3 className="text-xl font-black text-white tracking-tight">Modify Group</h3>
</div>
<button onClick={() => setEditingCategory(null)} className="p-3 hover:bg-slate-800 rounded-2xl text-slate-500 transition-colors border border-slate-800">
<button onClick={() => setEditingCategory(null)} className="p-3 hover:bg-slate-800 rounded-2xl text-muted transition-colors border border-slate-800">
<X size={20} />
</button>
</div>
<div className="space-y-6">
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Group Identifier</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Group Identifier</label>
<input
type="text"
value={editCatForm.name}
onChange={(e) => setEditCatForm({...editCatForm, name: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-2xl py-3.5 px-5 text-sm text-white focus:border-primary outline-none transition-all"
className="w-full bg-background border border-slate-800 rounded-2xl py-3.5 px-5 text-sm text-white focus:border-primary outline-none transition-all"
/>
</div>
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Strategic Description</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Strategic Description</label>
<textarea
value={editCatForm.description}
onChange={(e) => setEditCatForm({...editCatForm, description: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-2xl py-4 px-5 text-sm text-white focus:border-primary outline-none transition-all h-32 resize-none"
className="w-full bg-background border border-slate-800 rounded-2xl py-4 px-5 text-sm text-white focus:border-primary outline-none transition-all h-32 resize-none"
/>
</div>
<button onClick={onUpdateCategorySubmit} className="w-full bg-primary hover:bg-primary text-white font-black py-4 rounded-2xl shadow-xl shadow-primary/20 active:scale-95 transition-all text-sm mb-4 tracking-tight">

View File

@@ -35,7 +35,7 @@ export default function DatabaseManager({
return (
<div className="space-y-6 md:space-y-8 h-full">
<div className="bg-slate-900/40 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl overflow-hidden relative group transition-all">
<div className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl overflow-hidden relative group transition-all">
<div className="flex items-center gap-4 mb-6">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
<Database size={20} />
@@ -45,14 +45,14 @@ export default function DatabaseManager({
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-6">
<div className="space-y-1 sm:pr-6">
<p className="text-xs font-bold text-slate-500 tracking-tight">Database Health</p>
<p className="text-xs font-bold text-muted tracking-tight">Database Health</p>
<div className="flex items-center gap-2">
<div className="w-2 h-2 rounded-full bg-green-500 animate-pulse shadow-[0_0_8px_rgba(34,197,94,0.3)]" />
<span className="text-sm font-bold text-slate-200">Operational</span>
</div>
</div>
<div className="sm:pl-6 sm:border-l border-slate-800">
<p className="text-xs font-bold text-slate-500 tracking-tight">Last Backup</p>
<p className="text-xs font-bold text-muted tracking-tight">Last Backup</p>
<p className="text-sm font-bold text-slate-200 tabular-nums">{dbStats.backup_count > 0 ? 'Verified' : 'Pending...'}</p>
</div>
<div className="ml-auto">
@@ -69,7 +69,7 @@ export default function DatabaseManager({
</div>
</div>
<div className="bg-slate-900/40 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-8">
<div className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-8">
<div className="space-y-6">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
@@ -77,24 +77,24 @@ export default function DatabaseManager({
</div>
<div>
<h3 className="text-lg font-black text-white tracking-tight">Storage Policy</h3>
<p className="text-xs text-slate-400 font-bold tracking-tight">Retention & Maintenance</p>
<p className="text-xs text-secondary font-bold tracking-tight">Retention & Maintenance</p>
</div>
</div>
<div className="grid sm:grid-cols-3 gap-6">
<div className="space-y-2">
<label className="text-xs font-bold text-slate-500 tracking-tight ml-1 flex items-center gap-2">
<label className="text-xs font-bold text-muted tracking-tight ml-1 flex items-center gap-2">
<History size={10} /> Max Backups
</label>
<input
type="number"
value={dbSettings.retention_count}
onChange={(e) => onUpdateDbSettings({...dbSettings, retention_count: parseInt(e.target.value)})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-xl py-3 px-4 text-xs font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-all tabular-nums"
className="w-full bg-background/80 border border-slate-800 rounded-xl py-3 px-4 text-xs font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-all tabular-nums"
/>
</div>
<div className="space-y-2">
<label className="text-xs font-bold text-slate-500 tracking-tight ml-1 flex items-center gap-2">
<label className="text-xs font-bold text-muted tracking-tight ml-1 flex items-center gap-2">
<Clock size={10} /> Schedule (Hour)
</label>
<input
@@ -102,11 +102,11 @@ export default function DatabaseManager({
min="0" max="23"
value={dbSettings.schedule_hour}
onChange={(e) => onUpdateDbSettings({...dbSettings, schedule_hour: parseInt(e.target.value)})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-xl py-3 px-4 text-xs font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-all tabular-nums"
className="w-full bg-background/80 border border-slate-800 rounded-xl py-3 px-4 text-xs font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-all tabular-nums"
/>
</div>
<div className="space-y-2">
<label className="text-xs font-bold text-slate-500 tracking-tight ml-1 flex items-center gap-2">
<label className="text-xs font-bold text-muted tracking-tight ml-1 flex items-center gap-2">
<Zap size={10} /> Frequency (Days)
</label>
<input
@@ -114,7 +114,7 @@ export default function DatabaseManager({
min="1"
value={dbSettings.schedule_freq_days}
onChange={(e) => onUpdateDbSettings({...dbSettings, schedule_freq_days: parseInt(e.target.value)})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-xl py-3 px-4 text-xs font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-all tabular-nums"
className="w-full bg-background/80 border border-slate-800 rounded-xl py-3 px-4 text-xs font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none transition-all tabular-nums"
/>
</div>
</div>
@@ -122,7 +122,7 @@ export default function DatabaseManager({
<div className="space-y-4">
<div className="flex items-center justify-between px-1">
<label className="text-xs font-bold text-slate-500 tracking-tight">Recovery Points</label>
<label className="text-xs font-bold text-muted tracking-tight">Recovery Points</label>
<div className="text-xs font-bold text-primary tracking-tight bg-primary/5 px-3 py-1 rounded-full border border-primary/10">
{formatSize(dbStats.total_size_bytes)} Used
</div>
@@ -130,21 +130,21 @@ export default function DatabaseManager({
<div className="space-y-2 pr-2 overflow-y-auto max-h-[300px] scrollbar-thin scrollbar-thumb-slate-800 scrollbar-track-transparent">
{backups.map((bak: any) => (
<div key={bak.filename} className="flex items-center justify-between p-3.5 bg-slate-950/40 border border-slate-800/40 rounded-2xl group/item hover:border-primary/30 transition-all">
<div key={bak.filename} className="flex items-center justify-between p-3.5 bg-background/40 border border-slate-800/40 rounded-2xl group/item hover:border-primary/30 transition-all">
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-lg bg-slate-800 flex items-center justify-center text-slate-500">
<div className="w-8 h-8 rounded-lg bg-slate-800 flex items-center justify-center text-muted">
<Database size={14} />
</div>
<div>
<p className="text-xs font-bold text-slate-200">{bak.filename}</p>
<p className="text-[11px] text-slate-400 font-medium tabular-nums">
<p className="text-[11px] text-secondary font-medium tabular-nums">
{new Date(bak.created_at).toLocaleString()} {formatSize(bak.size_bytes)}
</p>
</div>
</div>
<button
onClick={() => onRestore(bak.filename)}
className="p-2 text-slate-600 hover:text-primary hover:bg-primary/5 rounded-xl transition-all opacity-0 group-hover/item:opacity-100 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
className="p-2 text-secondary hover:text-primary hover:bg-primary/5 rounded-xl transition-all opacity-0 group-hover/item:opacity-100 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
aria-label={`Restore backup ${bak.filename}`}
>
<RotateCcw size={16} />
@@ -157,7 +157,7 @@ export default function DatabaseManager({
<div className="grid grid-cols-2 gap-4 pt-2">
<button
onClick={onExport}
className="flex items-center justify-center gap-2 py-4 bg-slate-950 border border-slate-800 hover:border-primary/50 text-primary rounded-2xl text-sm font-black transition-all active:scale-95 tracking-tight shadow-xl shadow-black/20 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
className="flex items-center justify-center gap-2 py-4 bg-background border border-slate-800 hover:border-primary/50 text-primary rounded-2xl text-sm font-black transition-all active:scale-95 tracking-tight shadow-xl shadow-black/20 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
aria-label="Export database"
>
<Download size={14} /> Export Database
@@ -170,7 +170,7 @@ export default function DatabaseManager({
className="absolute inset-0 opacity-0 cursor-pointer z-10"
/>
<button
className="w-full flex items-center justify-center gap-2 py-4 bg-slate-950 border border-slate-800 hover:border-rose-500/50 text-rose-500 rounded-2xl text-sm font-black transition-all tracking-tight shadow-xl shadow-black/20 focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
className="w-full flex items-center justify-center gap-2 py-4 bg-background border border-slate-800 hover:border-rose-500/50 text-rose-500 rounded-2xl text-sm font-black transition-all tracking-tight shadow-xl shadow-black/20 focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
aria-label="Import database"
>
<Upload size={14} /> Import Database

View File

@@ -24,7 +24,7 @@ export default function IdentityManager({
onUpdateUserSubmit
}: IdentityManagerProps) {
return (
<div className="bg-slate-900/40 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 flex flex-col shadow-2xl transition-all group/identity h-full">
<div className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 flex flex-col shadow-2xl transition-all group/identity h-full">
<div className="flex items-center justify-between mb-6">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
@@ -43,11 +43,11 @@ export default function IdentityManager({
<div className="flex-1 space-y-2.5 pr-2 -mr-2 overflow-y-auto max-h-[400px] scrollbar-thin scrollbar-thumb-slate-800 scrollbar-track-transparent">
{users.map((user) => (
<div key={user.id} className="flex items-center justify-between p-3.5 bg-slate-950/40 border border-slate-800/40 rounded-2xl hover:border-primary/30 transition-all group">
<div key={user.id} className="flex items-center justify-between p-3.5 bg-background/40 border border-slate-800/40 rounded-2xl hover:border-primary/30 transition-all group">
<div className="flex items-center gap-3 min-w-0">
<div className={cn(
"w-9 h-9 rounded-xl flex items-center justify-center transition-colors shadow-inner shrink-0",
user.role === 'admin' ? "bg-primary/10 text-primary border border-primary/20" : "bg-slate-800 text-slate-500 border border-slate-700"
user.role === 'admin' ? "bg-primary/10 text-primary border border-primary/20" : "bg-slate-800 text-muted border border-slate-700"
)}>
{user.role === 'admin' ? <Shield size={16} /> : <User size={16} />}
</div>
@@ -62,7 +62,7 @@ export default function IdentityManager({
setEditingUser(user);
setEditUserForm({ username: user.username, password: '', role: user.role });
}}
className="p-2 text-slate-600 hover:text-primary hover:bg-primary/5 rounded-xl transition-all focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
className="p-2 text-secondary hover:text-primary hover:bg-primary/5 rounded-xl transition-all focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none"
aria-label={`Edit user ${user.username}`}
>
<Edit2 size={16} />
@@ -70,7 +70,7 @@ export default function IdentityManager({
{user.username !== 'Admin' && (
<button
onClick={() => onDeleteUser(user.id, user.username)}
className="p-2 text-slate-600 hover:text-rose-500 hover:bg-rose-500/5 rounded-xl transition-all focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
className="p-2 text-secondary hover:text-rose-500 hover:bg-rose-500/5 rounded-xl transition-all focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
aria-label={`Delete user ${user.username}`}
>
<Trash2 size={16} />
@@ -83,13 +83,13 @@ export default function IdentityManager({
{/* Edit User Modal */}
{editingUser && (
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-950/80 animate-in fade-in duration-200">
<div className="bg-slate-900 border border-slate-800 rounded-[2.5rem] p-8 w-full max-w-md shadow-2xl">
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-background/80 animate-in fade-in duration-200">
<div className="bg-surface border border-slate-800 rounded-[2.5rem] p-8 w-full max-w-md shadow-2xl">
<div className="flex justify-between items-center mb-6">
<h3 className="text-xl font-black text-white tracking-tight">Edit Identity</h3>
<button
onClick={() => setEditingUser(null)}
className="p-2 text-slate-500 hover:text-white transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none rounded"
className="p-2 text-muted hover:text-white transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none rounded"
aria-label="Close edit dialog"
>
<X size={20} />
@@ -98,30 +98,30 @@ export default function IdentityManager({
<div className="space-y-4">
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Username</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Username</label>
<input
type="text"
value={editUserForm.username}
onChange={(e) => setEditUserForm({ ...editUserForm, username: e.target.value })}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-3 px-4 text-sm font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0 transition-all font-mono"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-3 px-4 text-sm font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0 transition-all font-mono"
/>
</div>
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">New Password (Leave Empty To Keep)</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">New Password (Leave Empty To Keep)</label>
<input
type="password"
value={editUserForm.password}
onChange={(e) => setEditUserForm({ ...editUserForm, password: e.target.value })}
placeholder="********"
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-3 px-4 text-sm font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0 transition-all font-mono"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-3 px-4 text-sm font-bold text-white outline-none focus:border-primary/50 focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-0 transition-all font-mono"
/>
</div>
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Role</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Role</label>
<select
value={editUserForm.role}
onChange={(e) => setEditUserForm({ ...editUserForm, role: e.target.value })}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-3 px-4 text-sm font-bold text-white outline-none focus:border-primary/50 transition-all appearance-none"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-3 px-4 text-sm font-bold text-white outline-none focus:border-primary/50 transition-all appearance-none"
>
<option value="user">Standard User</option>
<option value="admin">Administrator</option>

View File

@@ -18,7 +18,7 @@ export default function LdapManager({
onUpdateLdap
}: LdapManagerProps) {
return (
<div className="bg-slate-900/40 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-6 transition-all group/ldap">
<div className="bg-surface/50 border border-slate-800/50 rounded-[2.5rem] p-5 md:p-8 shadow-2xl space-y-6 transition-all group/ldap">
<div className="flex items-center justify-between mb-2">
<div className="flex items-center gap-4">
<div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20">
@@ -28,17 +28,17 @@ export default function LdapManager({
</div>
</div>
<div className="flex items-center justify-between p-4 bg-slate-950/40 border border-slate-800/60 rounded-2xl group transition-all hover:border-primary/30">
<div className="flex items-center justify-between p-4 bg-background/40 border border-slate-800/60 rounded-2xl group transition-all hover:border-primary/30">
<div className="flex items-center gap-3">
<div className={cn(
"w-8 h-8 rounded-xl flex items-center justify-center transition-all shadow-inner",
ldapConfig.ldap_enabled ? "bg-green-500/10 text-green-500" : "bg-slate-800 text-slate-500"
ldapConfig.ldap_enabled ? "bg-green-500/10 text-green-500" : "bg-slate-800 text-muted"
)}>
<Power size={14} />
</div>
<div>
<p className="card-title leading-none">Ldap Authorization</p>
<p className={cn("card-subtitle mt-1", ldapConfig.ldap_enabled ? "text-green-500/80" : "text-slate-500")}>
<p className="card-title leading-none">LDAP Authorization</p>
<p className={cn("card-subtitle mt-1", ldapConfig.ldap_enabled ? "text-green-500/80" : "text-muted")}>
{ldapConfig.ldap_enabled ? "External Directory Active" : "Internal Authentication Only"}
</p>
</div>
@@ -59,7 +59,7 @@ export default function LdapManager({
<div className="grid sm:grid-cols-2 gap-4">
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Ldap Uri</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">LDAP URI</label>
<div className="relative">
<Server className="absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-700" size={14} />
<input
@@ -67,12 +67,12 @@ export default function LdapManager({
placeholder="ldap://host:389"
value={ldapConfig.server_uri}
onChange={(e) => setLdapConfig({...ldapConfig, server_uri: e.target.value})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
/>
</div>
</div>
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Context Dn</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Context DN</label>
<div className="relative">
<Shield className="absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-700" size={14} />
<input
@@ -80,7 +80,7 @@ export default function LdapManager({
placeholder="dc=example,dc=com"
value={ldapConfig.base_dn}
onChange={(e) => setLdapConfig({...ldapConfig, base_dn: e.target.value})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
/>
</div>
</div>
@@ -88,7 +88,7 @@ export default function LdapManager({
<div className="grid sm:grid-cols-2 gap-4">
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">User Dn Template</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">User DN Template</label>
<div className="relative">
<User className="absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-700" size={14} />
<input
@@ -96,12 +96,12 @@ export default function LdapManager({
placeholder="uid={username},ou=people..."
value={ldapConfig.user_template}
onChange={(e) => setLdapConfig({...ldapConfig, user_template: e.target.value})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
/>
</div>
</div>
<div className="space-y-1.5">
<label className="text-sm font-bold text-slate-400 tracking-tight ml-1">Groups Base Dn</label>
<label className="text-sm font-bold text-secondary tracking-tight ml-1">Groups Base DN</label>
<div className="relative">
<Layers className="absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-700" size={14} />
<input
@@ -109,23 +109,23 @@ export default function LdapManager({
placeholder="ou=groups"
value={ldapConfig.groups_dn}
onChange={(e) => setLdapConfig({...ldapConfig, groups_dn: e.target.value})}
className="w-full bg-slate-950/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
className="w-full bg-background/80 border border-slate-800 rounded-2xl py-2.5 pl-10 pr-4 text-xs font-bold text-white outline-none focus:border-primary/50 transition-all font-mono"
/>
</div>
</div>
</div>
<div className="flex items-center justify-between p-4 bg-slate-950/40 border border-slate-800/60 rounded-2xl group transition-all hover:border-primary/30">
<div className="flex items-center justify-between p-4 bg-background/40 border border-slate-800/60 rounded-2xl group transition-all hover:border-primary/30">
<div className="flex items-center gap-3">
<div className={cn(
"w-8 h-8 rounded-xl flex items-center justify-center transition-all shadow-inner",
ldapConfig.use_tls ? "bg-primary/10 text-primary" : "bg-slate-800 text-slate-500"
ldapConfig.use_tls ? "bg-primary/10 text-primary" : "bg-slate-800 text-muted"
)}>
<Lock size={14} />
</div>
<div>
<p className="card-title leading-none">Use Tls</p>
<p className={cn("card-subtitle mt-1", ldapConfig.use_tls ? "text-primary/80" : "text-slate-500")}>
<p className="card-title leading-none">Use TLS</p>
<p className={cn("card-subtitle mt-1", ldapConfig.use_tls ? "text-primary/80" : "text-muted")}>
{ldapConfig.use_tls ? "Encrypted Channel" : "Standard Link"}
</p>
</div>