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:
@@ -32,7 +32,7 @@ export default function ForgotPasswordPage() {
|
||||
<p className="text-sm text-gray-500">
|
||||
If an account exists for <strong>{email}</strong>, a password reset link has been sent.
|
||||
</p>
|
||||
<Link href="/login" className="text-sm text-blue-600 hover:underline">
|
||||
<Link href="/login" className="text-sm text-accent-700 hover:underline">
|
||||
Back to sign in
|
||||
</Link>
|
||||
</div>
|
||||
@@ -57,19 +57,19 @@ export default function ForgotPasswordPage() {
|
||||
onChange={e => setEmail(e.target.value)}
|
||||
required
|
||||
autoComplete="email"
|
||||
className="border border-divider px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="border border-divider px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
/>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 disabled:opacity-50 transition-colors"
|
||||
className="bg-accent hover:bg-accent-600 text-white font-medium py-2 disabled:opacity-50 transition-colors"
|
||||
>
|
||||
{loading ? 'Sending…' : 'Send reset link'}
|
||||
</button>
|
||||
|
||||
<p className="text-center text-sm text-gray-500">
|
||||
<Link href="/login" className="text-blue-600 hover:underline">
|
||||
<Link href="/login" className="text-accent-700 hover:underline">
|
||||
Back to sign in
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
@@ -8,13 +8,13 @@ interface Props {
|
||||
export default async function LoginPage({ searchParams }: Props) {
|
||||
const { message } = await searchParams
|
||||
return (
|
||||
<main className="min-h-screen flex items-center justify-center bg-gray-50 p-4">
|
||||
<main className="min-h-screen flex items-center justify-center bg-ground p-4">
|
||||
{message === 'password_reset' && (
|
||||
<div className="fixed top-4 left-1/2 -translate-x-1/2 bg-green-50 border border-green-200 text-green-700 text-sm px-4 py-2 shadow">
|
||||
<div className="fixed top-4 left-1/2 -translate-x-1/2 bg-neutral-100 border border-divider text-ink text-sm px-4 py-2 shadow">
|
||||
Password updated — sign in with your new password.
|
||||
</div>
|
||||
)}
|
||||
<div className="bg-surface shadow-sm border p-8 w-full max-w-sm">
|
||||
<div className="bg-surface border-2 border-divider p-8 w-full max-w-sm">
|
||||
<LoginForm />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -68,7 +68,7 @@ export default function ResetPasswordPage() {
|
||||
required
|
||||
minLength={8}
|
||||
autoComplete="new-password"
|
||||
className="border border-divider px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="border border-divider px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
@@ -77,13 +77,13 @@ export default function ResetPasswordPage() {
|
||||
onChange={e => setConfirm(e.target.value)}
|
||||
required
|
||||
autoComplete="new-password"
|
||||
className="border border-divider px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="border border-divider px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
/>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 disabled:opacity-50 transition-colors"
|
||||
className="bg-accent hover:bg-accent-600 text-white font-medium py-2 disabled:opacity-50 transition-colors"
|
||||
>
|
||||
{loading ? 'Saving…' : 'Set password'}
|
||||
</button>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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} />
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -71,6 +71,19 @@
|
||||
--color-blue-900: var(--color-accent-900);
|
||||
--color-blue-950: var(--color-accent-900);
|
||||
|
||||
/* Existing red-* utilities (errors, destructive) render on the accent ramp;
|
||||
600 and 700 map to accent-700 so body-size text clears contrast. */
|
||||
--color-red-50: var(--color-accent-100);
|
||||
--color-red-100: var(--color-accent-100);
|
||||
--color-red-200: var(--color-accent-200);
|
||||
--color-red-300: var(--color-accent-300);
|
||||
--color-red-400: var(--color-accent-400);
|
||||
--color-red-500: var(--color-accent-600);
|
||||
--color-red-600: var(--color-accent-700);
|
||||
--color-red-700: var(--color-accent-700);
|
||||
--color-red-800: var(--color-accent-800);
|
||||
--color-red-900: var(--color-accent-900);
|
||||
|
||||
/* Zero corner radius, everywhere. */
|
||||
--radius: 0px;
|
||||
--radius-xs: 0px;
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ export default async function ReportPage({ searchParams }: Props) {
|
||||
{siteName ?? 'Unknown Site'} — {zoneName}
|
||||
</p>
|
||||
) : (
|
||||
<p className="text-sm text-amber-600 mt-1">No zone detected — zone will not be recorded</p>
|
||||
<p className="text-sm text-accent-700 mt-1">No zone detected — zone will not be recorded</p>
|
||||
)}
|
||||
</div>
|
||||
<ReportForm
|
||||
|
||||
@@ -21,7 +21,7 @@ export default async function ReportSuccessPage({ searchParams }: Props) {
|
||||
<p className="text-sm text-gray-500 mb-6">
|
||||
The supervisor and HSE officer have been notified.
|
||||
</p>
|
||||
<Link href="/report" className="text-sm text-blue-600 hover:underline">
|
||||
<Link href="/report" className="text-sm text-accent-700 hover:underline">
|
||||
Submit another report
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user