feat(design): sweep off-system styles and add the check:design gate

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 20:39:44 +08:00
co-authored by Claude Haiku 4.5
parent ba9eeefe47
commit c5a98eed06
56 changed files with 335 additions and 216 deletions
+9 -9
View File
@@ -3,6 +3,7 @@
import { useState } from 'react'
import { useRouter } from 'next/navigation'
import { Modal } from '@/components/ui/modal'
import { INPUT_CLASS as inp } from '@/components/ui/field'
export type Truck = {
id: string
@@ -15,7 +16,6 @@ interface Props {
trucks: Truck[]
}
const inp = 'w-full border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-green-500'
const lbl = 'block text-xs font-medium text-gray-600 mb-1'
export function TruckManager({ trucks }: Props) {
@@ -90,7 +90,7 @@ export function TruckManager({ trucks }: Props) {
<p className="text-xs text-gray-400 mt-0.5">{trucks.length} vehicle{trucks.length !== 1 ? 's' : ''}</p>
</div>
<button onClick={() => { setShowAdd(true); setError(null) }}
className="flex items-center gap-1.5 px-3 py-1.5 bg-green-600 text-white text-xs font-semibold hover:bg-green-700 transition-colors cursor-pointer">
className="flex items-center gap-1.5 px-3 py-1.5 bg-accent text-white text-xs font-semibold hover:bg-accent-600 transition-colors cursor-pointer">
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2.5}>
<path strokeLinecap="round" strokeLinejoin="round" d="M12 4v16m8-8H4" />
</svg>
@@ -109,16 +109,16 @@ export function TruckManager({ trucks }: Props) {
</div>
<div className="flex items-center gap-3">
<a href={`/report?truck_id=${tk.id}`} target="_blank"
className="text-xs text-blue-600 hover:underline cursor-pointer">
className="text-xs text-accent-700 hover:underline cursor-pointer">
Report link
</a>
<button disabled={busyId === tk.id}
onClick={() => send('PATCH', { id: tk.id, active: !tk.active })}
className={`text-xs font-medium px-2.5 py-1 rounded-full border transition-colors cursor-pointer disabled:opacity-50 ${
tk.active
? 'bg-green-50 text-green-700 border-green-200 hover:bg-green-100'
: 'bg-gray-50 text-gray-500 border-divider hover:bg-gray-100'
}`}>
className={`text-xs font-medium px-2.5 py-1 border transition-colors cursor-pointer disabled:opacity-50 ${
tk.active
? 'bg-neutral-100 text-ink border-divider hover:bg-neutral-200'
: 'bg-gray-50 text-gray-500 border-divider hover:bg-gray-100'
}`}>
{tk.active ? 'Active' : 'Inactive'}
</button>
<button disabled={busyId === tk.id} onClick={() => setConfirmDelete(tk)}
@@ -143,7 +143,7 @@ export function TruckManager({ trucks }: Props) {
Cancel
</button>
<button disabled={submitting || !truckNo.trim()} onClick={handleAdd}
className="px-4 py-2 bg-green-600 text-white text-sm font-semibold hover:bg-green-700 disabled:opacity-50 cursor-pointer transition-colors">
className="px-4 py-2 bg-accent text-white text-sm font-semibold hover:bg-accent-600 disabled:opacity-50 cursor-pointer transition-colors">
{submitting ? 'Adding…' : 'Add Truck'}
</button>
</>