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:
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user