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
+15 -15
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 SiteWithZones = {
id: string
@@ -16,7 +17,6 @@ interface Props {
sites: SiteWithZones[]
}
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'
type DeleteTarget = { kind: 'site'; id: string; name: string } | { kind: 'zone'; id: string; name: string }
@@ -96,7 +96,7 @@ export function SiteZoneManager({ sites }: Props) {
Add Zone
</button>
<button onClick={() => { setShowAddSite(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>
@@ -118,11 +118,11 @@ export function SiteZoneManager({ sites }: Props) {
<div className="flex items-center gap-2">
<button disabled={busyId === site.id}
onClick={() => send('PATCH', { kind: 'site', id: site.id, active: !site.active })}
className={`text-xs font-medium px-2.5 py-1 rounded-full border transition-colors cursor-pointer disabled:opacity-50 ${
site.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 ${
site.active
? 'bg-neutral-100 text-ink border-divider hover:bg-neutral-200'
: 'bg-gray-50 text-gray-500 border-divider hover:bg-gray-100'
}`}>
{site.active ? 'Active' : 'Inactive'}
</button>
<button disabled={busyId === site.id}
@@ -140,16 +140,16 @@ export function SiteZoneManager({ sites }: Props) {
<span className="text-xs text-gray-700 font-medium">{z.name}</span>
<div className="flex items-center gap-3">
<a href={`/report?zone=${z.qr_code_token}`} 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 === z.id}
onClick={() => send('PATCH', { kind: 'zone', id: z.id, active: !z.active })}
className={`text-xs font-medium px-2 py-0.5 rounded-full border transition-colors cursor-pointer disabled:opacity-50 ${
z.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 py-0.5 border transition-colors cursor-pointer disabled:opacity-50 ${
z.active
? 'bg-neutral-100 text-ink border-divider hover:bg-neutral-200'
: 'bg-gray-50 text-gray-500 border-divider hover:bg-gray-100'
}`}>
{z.active ? 'Active' : 'Inactive'}
</button>
<button disabled={busyId === z.id}
@@ -183,7 +183,7 @@ export function SiteZoneManager({ sites }: Props) {
</button>
<button disabled={busy || !siteName.trim()}
onClick={async () => { if (await post({ kind: 'site', name: siteName })) { setSiteName(''); setShowAddSite(false) } }}
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">
{busy ? 'Adding…' : 'Add Site'}
</button>
</>
@@ -214,7 +214,7 @@ export function SiteZoneManager({ sites }: Props) {
setZoneName(''); setZoneSiteId(''); setShowAddZone(false)
}
}}
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">
{busy ? 'Adding…' : 'Add Zone'}
</button>
</>