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
+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>