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
+1 -1
View File
@@ -57,7 +57,7 @@ export default async function AdminHome() {
<p className="text-sm text-gray-500 mt-0.5">Manage users, sites, zones, and trucks</p>
</div>
<div className="mb-6 flex gap-3">
<Link href="/bulk-import" className="px-4 py-2 bg-green-600 text-white text-sm font-medium hover:bg-green-700">
<Link href="/bulk-import" className="px-4 py-2 bg-accent text-white text-sm font-medium hover:bg-accent-600">
Bulk Import Incidents
</Link>
</div>
+1 -1
View File
@@ -86,7 +86,7 @@ export default async function CapaOwnerPage() {
<div className="flex-1 min-w-0">
<p className="text-sm text-gray-800">{capa.description}</p>
{capa.incidentRefNo && (
<Link href={`/hse/incidents/${capa.incidentId}`} className="text-xs text-blue-600 hover:underline mt-0.5 inline-block">
<Link href={`/hse/incidents/${capa.incidentId}`} className="text-xs text-accent-700 hover:underline mt-0.5 inline-block">
{capa.incidentRefNo}
</Link>
)}
+1 -1
View File
@@ -53,7 +53,7 @@ export default async function CapaDetailPage({ params }: Props) {
return (
<main className="max-w-2xl mx-auto px-4 py-6">
<Link href="/hse/capa" className="text-sm text-blue-600 hover:underline mb-4 inline-block">
<Link href="/hse/capa" className="text-sm text-accent-700 hover:underline mb-4 inline-block">
← CAPA Board
</Link>
+1 -1
View File
@@ -52,7 +52,7 @@ export default async function CapaListPage() {
<main className="max-w-6xl mx-auto px-4 py-6">
<div className="flex items-center justify-between mb-6">
<h1 className="text-2xl font-bold text-gray-900">CAPA Board</h1>
<Link href="/hse/incidents" className="text-sm text-blue-600 hover:underline">
<Link href="/hse/incidents" className="text-sm text-accent-700 hover:underline">
← Incidents
</Link>
</div>
+14 -14
View File
@@ -175,7 +175,7 @@ export default async function HseDashboardPage({
>
JKKP 8
</a>
<Link href="/hse/incidents" className="text-sm text-blue-600 hover:underline">
<Link href="/hse/incidents" className="text-sm text-accent-700 hover:underline">
All incidents →
</Link>
</div>
@@ -187,8 +187,8 @@ export default async function HseDashboardPage({
{(tab === 'overview') && (
<>
{now.getMonth() === 0 && (
<div className="bg-amber-50 border border-amber-200 p-4 mb-6">
<p className="text-sm text-amber-800">
<div className="bg-accent-100 border border-accent-300 p-4 mb-6">
<p className="text-sm text-accent-700">
<strong>JKKP 8 annual register due:</strong> the {now.getFullYear() - 1} register must be
submitted to DOSH before 31 January {now.getFullYear()}.{' '}
<a href={`/api/reports/jkkp8?year=${now.getFullYear() - 1}`} className="underline font-medium">
@@ -218,18 +218,18 @@ export default async function HseDashboardPage({
Leading: hazard + near-miss reports (predict risk) · Lagging: injuries (past harm)
</p>
<div className="flex gap-4">
<div className="flex-1 text-center bg-blue-50 p-4">
<p className="text-3xl font-bold text-blue-600">{leadingCount}</p>
<p className="text-xs text-blue-700 mt-1">Leading (Hazards + Near Misses)</p>
<div className="flex-1 text-center bg-neutral-100 p-4">
<p className="text-3xl font-bold text-accent-700">{leadingCount}</p>
<p className="text-xs text-accent-700 mt-1">Leading (Hazards + Near Misses)</p>
</div>
<div className="flex-1 text-center bg-red-50 p-4">
<p className="text-3xl font-bold text-red-600">{laggingCount}</p>
<p className="text-xs text-red-700 mt-1">Lagging (Injuries)</p>
</div>
{capaOnTimeRate !== null && (
<div className="flex-1 text-center bg-green-50 p-4">
<p className="text-3xl font-bold text-green-600">{capaOnTimeRate}%</p>
<p className="text-xs text-green-700 mt-1">CAPA On-Time Rate</p>
<div className="flex-1 text-center bg-neutral-100 p-4">
<p className="text-3xl font-bold text-ink">{capaOnTimeRate}%</p>
<p className="text-xs text-ink mt-1">CAPA On-Time Rate</p>
</div>
)}
</div>
@@ -253,7 +253,7 @@ export default async function HseDashboardPage({
return (
<div key={m.month} className="flex-1 flex flex-col items-center gap-1">
<div className="w-full flex flex-col-reverse" style={{ height: '192px' }}>
<div className="w-full bg-blue-400" style={{ height: `${(m.leading / monthlyMax) * 192}px` }} />
<div className="w-full bg-accent-400" style={{ height: `${(m.leading / monthlyMax) * 192}px` }} />
<div className="w-full bg-red-400" style={{ height: `${(m.lagging / monthlyMax) * 192}px` }} />
<div className="w-full bg-gray-300" style={{ height: `${(Math.max(0, other) / monthlyMax) * 192}px` }} />
</div>
@@ -296,9 +296,9 @@ export default async function HseDashboardPage({
{by_zone.map(({ name, count }) => (
<div key={name} className="flex items-center gap-3">
<span className="text-sm text-gray-600 w-36 shrink-0 truncate">{name}</span>
<div className="flex-1 bg-gray-100 rounded-full h-3">
<div className="flex-1 bg-gray-100 h-3">
<div
className="h-3 rounded-full"
className="h-3"
style={{
width: `${(count / zoneMax) * 100}%`,
backgroundColor: `hsl(220, 70%, ${Math.max(30, 80 - Math.round((count / zoneMax) * 50))}%)`,
@@ -318,9 +318,9 @@ export default async function HseDashboardPage({
{Object.entries(by_type).sort((a, b) => b[1] - a[1]).map(([type, count]) => (
<div key={type} className="flex items-center gap-3">
<span className="text-sm text-gray-600 w-32 shrink-0">{TYPE_LABELS[type] ?? type}</span>
<div className="flex-1 bg-gray-100 rounded-full h-2">
<div className="flex-1 bg-gray-100 h-2">
<div
className="bg-blue-500 h-2 rounded-full"
className="bg-accent h-2"
style={{ width: total > 0 ? `${(count / total) * 100}%` : '0%' }}
/>
</div>
@@ -31,7 +31,7 @@ export default async function NewCapaPage({ params }: Props) {
return (
<main className="max-w-lg mx-auto px-4 py-6">
<Link href={`/hse/incidents/${id}`} className="text-sm text-blue-600 hover:underline mb-4 inline-block">
<Link href={`/hse/incidents/${id}`} className="text-sm text-accent-700 hover:underline mb-4 inline-block">
← Back to incident
</Link>
<h1 className="text-xl font-bold text-gray-900 mb-1">Add CAPA Action</h1>
@@ -43,7 +43,7 @@ export default async function InvestigationPage({ params }: Props) {
return (
<main className="max-w-2xl mx-auto px-4 py-6">
<Link href={`/hse/incidents/${id}`} className="text-sm text-blue-600 hover:underline mb-4 inline-block">
<Link href={`/hse/incidents/${id}`} className="text-sm text-accent-700 hover:underline mb-4 inline-block">
← Back to incident
</Link>
<h1 className="text-xl font-bold text-gray-900 mb-1">Investigation Workspace</h1>
+1 -1
View File
@@ -194,7 +194,7 @@ export default async function HseIncidentDetailPage({ params }: Props) {
href={`/api/incidents/${id}/report-pdf`}
target="_blank"
rel="noopener noreferrer"
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"
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"
>
<svg className="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
@@ -35,7 +35,7 @@ export default async function TriagePage({ params }: Props) {
return (
<main className="max-w-lg mx-auto px-4 py-6">
<Link href={`/hse/incidents/${id}`} className="text-sm text-blue-600 hover:underline mb-4 inline-block">
<Link href={`/hse/incidents/${id}`} className="text-sm text-accent-700 hover:underline mb-4 inline-block">
← Back to incident
</Link>
<h1 className="text-xl font-bold text-gray-900 mb-1">Triage Incident</h1>
+3 -3
View File
@@ -123,9 +123,9 @@ export default async function ManagementPage() {
<h2 className="text-sm font-semibold text-gray-700 uppercase tracking-wide mb-1">Leading vs Lagging — Last 30 Days</h2>
<p className="text-xs text-gray-400 mb-4">Leading: hazard + near-miss · Lagging: injuries</p>
<div className="flex gap-6">
<div className="flex-1 text-center bg-blue-50 p-4">
<p className="text-3xl font-bold text-blue-600">{leadingCount}</p>
<p className="text-xs text-blue-700 mt-1">Leading (Hazards + Near Misses)</p>
<div className="flex-1 text-center bg-neutral-100 p-4">
<p className="text-3xl font-bold text-accent-700">{leadingCount}</p>
<p className="text-xs text-accent-700 mt-1">Leading (Hazards + Near Misses)</p>
</div>
<div className="flex-1 text-center bg-red-50 p-4">
<p className="text-3xl font-bold text-red-600">{laggingCount}</p>
@@ -60,7 +60,7 @@ export default async function ReporterIncidentDetail({
return (
<main className="max-w-2xl mx-auto px-4 py-6 space-y-4">
<div className="flex items-center gap-2 mb-2">
<Link href="/reporter" className="text-sm text-blue-600 hover:underline">← My Reports</Link>
<Link href="/reporter" className="text-sm text-accent-700 hover:underline">← My Reports</Link>
</div>
<div className="bg-surface shadow-sm p-5">
@@ -105,11 +105,11 @@ export default async function ReporterIncidentDetail({
{capas.map(c => (
<div key={c.id} className="flex items-start justify-between gap-3 text-sm">
<p className="text-gray-700 flex-1">{c.description}</p>
<span className={`text-xs rounded-full px-2 py-0.5 shrink-0 ${
c.status === 'verified' ? 'bg-green-100 text-green-700' :
c.status === 'pending_verification' ? 'bg-purple-100 text-purple-700' :
'bg-gray-100 text-gray-600'
}`}>{c.status.replace(/_/g, ' ')}</span>
<span className={`text-xs px-2 py-0.5 shrink-0 ${
c.status === 'verified' ? 'bg-neutral-100 text-ink' :
c.status === 'pending_verification' ? 'bg-accent-100 text-accent-700' :
'bg-gray-100 text-gray-600'
}`}>{c.status.replace(/_/g, ' ')}</span>
</div>
))}
</div>
+4 -4
View File
@@ -54,7 +54,7 @@ export default async function ReporterPage() {
</div>
<Link
href="/report"
className="bg-blue-600 text-white px-4 py-2 text-sm font-semibold hover:bg-blue-700"
className="bg-accent text-white px-4 py-2 text-sm font-semibold hover:bg-accent-600"
>
+ New Report
</Link>
@@ -66,11 +66,11 @@ export default async function ReporterPage() {
<p className="text-xs text-gray-500 mt-1">Total Submitted</p>
</div>
<div className="bg-surface shadow-sm p-4 flex-1 text-center">
<p className="text-2xl font-bold text-yellow-600">{openCount}</p>
<p className="text-2xl font-bold text-accent-700">{openCount}</p>
<p className="text-xs text-gray-500 mt-1">In Progress</p>
</div>
<div className="bg-surface shadow-sm p-4 flex-1 text-center">
<p className="text-2xl font-bold text-green-600">{closedCount}</p>
<p className="text-2xl font-bold text-ink">{closedCount}</p>
<p className="text-xs text-gray-500 mt-1">Closed</p>
</div>
</div>
@@ -78,7 +78,7 @@ export default async function ReporterPage() {
{rows.length === 0 ? (
<div className="bg-surface shadow-sm p-8 text-center">
<p className="text-gray-400 text-sm mb-4">No incidents reported yet.</p>
<Link href="/report" className="text-blue-600 text-sm hover:underline">Submit your first report →</Link>
<Link href="/report" className="text-accent-700 text-sm hover:underline">Submit your first report →</Link>
</div>
) : (
<div className="bg-surface shadow-sm divide-y divide-gray-50">
@@ -136,7 +136,7 @@ export default async function SupervisorIncidentDetailPage({ params }: Props) {
return (
<main className="max-w-3xl mx-auto px-4 py-6">
<Link href="/supervisor/incidents" className="text-sm text-blue-600 hover:underline mb-4 inline-block">
<Link href="/supervisor/incidents" className="text-sm text-accent-700 hover:underline mb-4 inline-block">
← Back to inbox
</Link>
<IncidentDetail incident={incidentProp} />
+1 -1
View File
@@ -111,7 +111,7 @@ export default async function SupervisorPage() {
<h1 className="text-2xl font-bold text-gray-900">Supervisor Portal</h1>
<p className="text-sm text-gray-500 mt-1">{siteName}</p>
</div>
<Link href="/supervisor/incidents" className="text-sm text-blue-600 hover:underline">
<Link href="/supervisor/incidents" className="text-sm text-accent-700 hover:underline">
All incidents →
</Link>
</div>