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:
@@ -67,7 +67,7 @@ export default function ChangePasswordForm() {
|
||||
onChange={e => setCurrent(e.target.value)}
|
||||
disabled={loading}
|
||||
autoComplete="current-password"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-accent focus:border-transparent disabled:opacity-50"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -80,7 +80,7 @@ export default function ChangePasswordForm() {
|
||||
onChange={e => setNewPass(e.target.value)}
|
||||
disabled={loading}
|
||||
autoComplete="new-password"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-accent focus:border-transparent disabled:opacity-50"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -93,17 +93,17 @@ export default function ChangePasswordForm() {
|
||||
onChange={e => setConfirm(e.target.value)}
|
||||
disabled={loading}
|
||||
autoComplete="new-password"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-accent focus:border-transparent disabled:opacity-50"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{error && <p className="text-xs text-red-600 mt-1">{error}</p>}
|
||||
{success && <p className="text-xs text-green-600 mt-1">Password changed successfully.</p>}
|
||||
{success && <p className="text-xs text-ink mt-1">Password changed successfully.</p>}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="bg-blue-600 text-white px-4 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-blue-700"
|
||||
className="bg-accent text-white px-4 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-accent-600"
|
||||
>
|
||||
{loading ? 'Saving…' : 'Update Password'}
|
||||
</button>
|
||||
|
||||
@@ -31,15 +31,15 @@ export function AdminPanel({ users, sites, siteOptions, trucks }: Props) {
|
||||
key={t.id}
|
||||
onClick={() => setTab(t.id)}
|
||||
className={`px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer ${
|
||||
tab === t.id
|
||||
? 'border-green-600 text-green-700'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700'
|
||||
}`}
|
||||
tab === t.id
|
||||
? 'border-accent text-ink'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700'
|
||||
}`}
|
||||
>
|
||||
{t.label}
|
||||
<span className={`ml-1.5 text-xs px-1.5 py-0.5 rounded-full ${
|
||||
tab === t.id ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'
|
||||
}`}>{t.count}</span>
|
||||
<span className={`ml-1.5 text-xs px-1.5 py-0.5 ${
|
||||
tab === t.id ? 'bg-neutral-100 text-ink' : 'bg-gray-100 text-gray-500'
|
||||
}`}>{t.count}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -208,7 +208,7 @@ export function BulkImportForm() {
|
||||
<button
|
||||
onClick={handleImport}
|
||||
disabled={!canImport || loading}
|
||||
className="px-4 py-2 bg-blue-600 text-white disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
className="px-4 py-2 bg-accent text-white disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
{loading ? 'Importing...' : 'Import All'}
|
||||
</button>
|
||||
@@ -220,9 +220,9 @@ export function BulkImportForm() {
|
||||
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<h3 className="font-bold text-green-600">✓ Import Complete</h3>
|
||||
<h3 className="font-bold text-ink">✓ Import Complete</h3>
|
||||
<p>{folders.length} incidents created</p>
|
||||
{message && <p className="text-green-600 text-sm">{message}</p>}
|
||||
{message && <p className="text-ink text-sm">{message}</p>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
|
||||
@@ -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 Truck = {
|
||||
id: string
|
||||
@@ -15,7 +16,6 @@ interface Props {
|
||||
trucks: Truck[]
|
||||
}
|
||||
|
||||
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'
|
||||
|
||||
export function TruckManager({ trucks }: Props) {
|
||||
@@ -90,7 +90,7 @@ export function TruckManager({ trucks }: Props) {
|
||||
<p className="text-xs text-gray-400 mt-0.5">{trucks.length} vehicle{trucks.length !== 1 ? 's' : ''}</p>
|
||||
</div>
|
||||
<button onClick={() => { setShowAdd(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>
|
||||
@@ -109,16 +109,16 @@ export function TruckManager({ trucks }: Props) {
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<a href={`/report?truck_id=${tk.id}`} 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 === tk.id}
|
||||
onClick={() => send('PATCH', { id: tk.id, active: !tk.active })}
|
||||
className={`text-xs font-medium px-2.5 py-1 rounded-full border transition-colors cursor-pointer disabled:opacity-50 ${
|
||||
tk.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 ${
|
||||
tk.active
|
||||
? 'bg-neutral-100 text-ink border-divider hover:bg-neutral-200'
|
||||
: 'bg-gray-50 text-gray-500 border-divider hover:bg-gray-100'
|
||||
}`}>
|
||||
{tk.active ? 'Active' : 'Inactive'}
|
||||
</button>
|
||||
<button disabled={busyId === tk.id} onClick={() => setConfirmDelete(tk)}
|
||||
@@ -143,7 +143,7 @@ export function TruckManager({ trucks }: Props) {
|
||||
Cancel
|
||||
</button>
|
||||
<button disabled={submitting || !truckNo.trim()} onClick={handleAdd}
|
||||
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">
|
||||
{submitting ? 'Adding…' : 'Add Truck'}
|
||||
</button>
|
||||
</>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useState } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { ALL_ROLES, type UserRole } from '@/lib/auth/roles'
|
||||
import { Modal } from '@/components/ui/modal'
|
||||
import { INPUT_CLASS as inp } from '@/components/ui/field'
|
||||
|
||||
export type AdminUser = {
|
||||
id: string
|
||||
@@ -24,7 +25,6 @@ interface Props {
|
||||
|
||||
const EMPTY = { email: '', name: '', phone: '', role: 'reporter' as UserRole, site_id: '', password: '' }
|
||||
|
||||
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'
|
||||
|
||||
export function UserManager({ users, sites }: Props) {
|
||||
@@ -103,7 +103,7 @@ export function UserManager({ users, sites }: Props) {
|
||||
</div>
|
||||
<button
|
||||
onClick={() => { setShowAdd(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" />
|
||||
@@ -134,14 +134,14 @@ export function UserManager({ users, sites }: Props) {
|
||||
<td className="px-5 py-3">
|
||||
<select value={u.role} disabled={busyId === u.id}
|
||||
onChange={e => patchUser(u.id, { role: e.target.value })}
|
||||
className="border border-divider px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-green-500 cursor-pointer">
|
||||
className="border border-divider px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer">
|
||||
{ALL_ROLES.map(r => <option key={r} value={r}>{r.replace(/_/g, ' ')}</option>)}
|
||||
</select>
|
||||
</td>
|
||||
<td className="px-5 py-3">
|
||||
<select value={u.site_id ?? ''} disabled={busyId === u.id}
|
||||
onChange={e => patchUser(u.id, { site_id: e.target.value || null })}
|
||||
className="border border-divider px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-green-500 cursor-pointer">
|
||||
className="border border-divider px-2 py-1 text-xs focus:outline-none focus:ring-1 focus:ring-accent cursor-pointer">
|
||||
<option value="">No site</option>
|
||||
{sites.map(s => <option key={s.id} value={s.id}>{s.name}</option>)}
|
||||
</select>
|
||||
@@ -149,11 +149,11 @@ export function UserManager({ users, sites }: Props) {
|
||||
<td className="px-5 py-3">
|
||||
<button disabled={busyId === u.id}
|
||||
onClick={() => patchUser(u.id, { active: !u.active })}
|
||||
className={`text-xs px-2.5 py-1 rounded-full font-medium border transition-colors cursor-pointer ${
|
||||
u.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 px-2.5 py-1 font-medium border transition-colors cursor-pointer ${
|
||||
u.active
|
||||
? 'bg-neutral-100 text-ink border-divider hover:bg-neutral-200'
|
||||
: 'bg-gray-50 text-gray-500 border-divider hover:bg-gray-100'
|
||||
}`}>
|
||||
{u.active ? 'Active' : 'Inactive'}
|
||||
</button>
|
||||
</td>
|
||||
@@ -182,7 +182,7 @@ export function UserManager({ users, sites }: Props) {
|
||||
Cancel
|
||||
</button>
|
||||
<button form="add-user-form" type="submit" disabled={submitting}
|
||||
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">
|
||||
{submitting ? 'Adding…' : 'Add User'}
|
||||
</button>
|
||||
</>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
import { useState } from 'react'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import Link from 'next/link'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/field'
|
||||
|
||||
export function LoginForm() {
|
||||
const [email, setEmail] = useState('')
|
||||
@@ -37,44 +39,38 @@ export function LoginForm() {
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="flex flex-col gap-4 w-full max-w-sm">
|
||||
<div className="text-center">
|
||||
<h1 className="text-2xl font-bold">IMS</h1>
|
||||
<p className="text-sm text-gray-500 mt-1">HSE Incident Management</p>
|
||||
<div className="pb-3 border-b-2 border-divider">
|
||||
<h1 className="text-3xl font-extrabold">IMS</h1>
|
||||
<p className="text-sm text-ink/60 mt-1">HSE Incident Management</p>
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
<p className="bg-red-50 border border-red-200 text-red-700 text-sm px-3 py-2">
|
||||
<p className="bg-accent-100 border border-accent text-accent-800 text-sm px-3 py-2">
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<input
|
||||
<Input
|
||||
type="email"
|
||||
placeholder="Email"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
required
|
||||
autoComplete="email"
|
||||
className="border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
<input
|
||||
<Input
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
required
|
||||
autoComplete="current-password"
|
||||
className="border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 disabled:opacity-50 transition-colors"
|
||||
>
|
||||
<Button type="submit" variant="primary" block disabled={loading}>
|
||||
{loading ? 'Signing in…' : 'Sign in'}
|
||||
</button>
|
||||
<p className="text-center text-sm text-gray-500">
|
||||
<Link href="/forgot-password" className="text-blue-600 hover:underline">
|
||||
</Button>
|
||||
<p className="text-sm text-ink/60">
|
||||
<Link href="/forgot-password" className="text-accent-700 hover:underline">
|
||||
Forgot password?
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
@@ -54,7 +54,7 @@ export function CapaBoard({ capas }: Props) {
|
||||
return (
|
||||
<div>
|
||||
<div className="flex justify-end mb-3">
|
||||
<button onClick={() => setView('board')} className="text-sm text-blue-600 hover:underline">Board view</button>
|
||||
<button onClick={() => setView('board')} className="text-sm text-accent-700 hover:underline">Board view</button>
|
||||
</div>
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-sm">
|
||||
@@ -75,7 +75,7 @@ export function CapaBoard({ capas }: Props) {
|
||||
{(c.incidents as { reference_no: string | null } | null)?.reference_no ?? '—'}
|
||||
</td>
|
||||
<td className="py-2 pr-4">
|
||||
<Link href={`/hse/capa/${c.id}`} className="text-blue-600 hover:underline line-clamp-2">
|
||||
<Link href={`/hse/capa/${c.id}`} className="text-accent-700 hover:underline line-clamp-2">
|
||||
{c.description}
|
||||
</Link>
|
||||
</td>
|
||||
|
||||
@@ -121,7 +121,7 @@ export function CapaForm({ incidentId }: Props) {
|
||||
{error && <p className="text-sm text-red-600">{error}</p>}
|
||||
|
||||
<button type="submit" disabled={saving}
|
||||
className="w-full bg-amber-600 text-white py-2 text-sm font-semibold disabled:opacity-50">
|
||||
className="w-full bg-accent text-white py-2 text-sm font-semibold disabled:opacity-50">
|
||||
{saving ? 'Creating…' : 'Create CAPA Action'}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -48,7 +48,7 @@ export function CapaOwnerActions({ capaId, currentStatus }: Props) {
|
||||
<button
|
||||
onClick={() => updateStatus('pending_verification')}
|
||||
disabled={loading}
|
||||
className="text-sm px-3 py-1.5 bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50"
|
||||
className="text-sm px-3 py-1.5 bg-accent text-white hover:bg-accent-600 disabled:opacity-50"
|
||||
>
|
||||
{loading ? '…' : 'Submit for Verification'}
|
||||
</button>
|
||||
|
||||
@@ -39,7 +39,7 @@ export function CapaOwnerNotesForm({ capaId, initialNotes }: Props) {
|
||||
onChange={e => { setNotes(e.target.value); setSaved(false) }}
|
||||
rows={2}
|
||||
placeholder="Add any notes or updates for this action…"
|
||||
className="w-full border border-divider px-3 py-2 text-sm text-gray-800 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full border border-divider px-3 py-2 text-sm text-gray-800 resize-none focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
/>
|
||||
{error && <p className="text-xs text-red-600">{error}</p>}
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -50,7 +50,7 @@ export function CapaOwnerNotesForm({ capaId, initialNotes }: Props) {
|
||||
>
|
||||
{saving ? 'Saving…' : 'Save Notes'}
|
||||
</button>
|
||||
{saved && <span className="text-xs text-green-600">Saved</span>}
|
||||
{saved && <span className="text-xs text-ink">Saved</span>}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@ export function CloseCapaButton({ capaId }: Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="border border-divider p-5 space-y-3 bg-green-50">
|
||||
<div className="border border-divider p-5 space-y-3 bg-neutral-100">
|
||||
<h3 className="text-sm font-semibold text-gray-800">Close CAPA</h3>
|
||||
<p className="text-sm text-gray-600">
|
||||
This CAPA has been verified as effective. Close it to mark it fully resolved.
|
||||
@@ -40,7 +40,7 @@ export function CloseCapaButton({ capaId }: Props) {
|
||||
<button
|
||||
onClick={handleClose}
|
||||
disabled={loading}
|
||||
className="w-full bg-green-700 text-white py-2 text-sm font-semibold hover:bg-green-800 disabled:opacity-50"
|
||||
className="w-full bg-accent text-white py-2 text-sm font-semibold hover:bg-accent-700 disabled:opacity-50"
|
||||
>
|
||||
{loading ? 'Closing…' : 'Close CAPA'}
|
||||
</button>
|
||||
|
||||
@@ -39,17 +39,17 @@ export function VerifyForm({ capaId }: Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="border border-divider p-5 space-y-4 bg-purple-50">
|
||||
<form onSubmit={handleSubmit} className="border border-divider p-5 space-y-4 bg-accent-100">
|
||||
<h3 className="text-sm font-semibold text-gray-800">HSE Verification</h3>
|
||||
<div className="flex gap-3">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setVerdict('verified')}
|
||||
className={`flex-1 py-2 text-sm font-medium border ${
|
||||
verdict === 'verified'
|
||||
? 'bg-green-600 text-white border-green-600'
|
||||
: 'bg-surface text-gray-700 border-divider hover:border-green-500'
|
||||
}`}
|
||||
verdict === 'verified'
|
||||
? 'bg-accent text-white border-accent'
|
||||
: 'bg-surface text-gray-700 border-divider hover:border-accent'
|
||||
}`}
|
||||
>
|
||||
Verified — Effective
|
||||
</button>
|
||||
@@ -57,10 +57,10 @@ export function VerifyForm({ capaId }: Props) {
|
||||
type="button"
|
||||
onClick={() => setVerdict('reopened')}
|
||||
className={`flex-1 py-2 text-sm font-medium border ${
|
||||
verdict === 'reopened'
|
||||
? 'bg-orange-600 text-white border-orange-600'
|
||||
: 'bg-surface text-gray-700 border-divider hover:border-orange-500'
|
||||
}`}
|
||||
verdict === 'reopened'
|
||||
? 'bg-accent text-white border-accent'
|
||||
: 'bg-surface text-gray-700 border-divider hover:border-accent'
|
||||
}`}
|
||||
>
|
||||
Reopen — Ineffective
|
||||
</button>
|
||||
|
||||
@@ -21,10 +21,10 @@ function TabsInner({ activeTab }: { activeTab: string }) {
|
||||
key={tab.key}
|
||||
onClick={() => router.replace(`${pathname}?tab=${tab.key}`)}
|
||||
className={`px-4 py-2.5 text-sm font-medium whitespace-nowrap border-b-2 transition-colors ${
|
||||
activeTab === tab.key
|
||||
? 'border-blue-600 text-blue-600'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-divider'
|
||||
}`}
|
||||
activeTab === tab.key
|
||||
? 'border-accent text-accent-700'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-divider'
|
||||
}`}
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
|
||||
@@ -51,7 +51,7 @@ export function RiskFlagsPanel() {
|
||||
<button
|
||||
onClick={analyze}
|
||||
disabled={loading}
|
||||
className="bg-purple-50 text-purple-700 border border-purple-300 px-3 py-1.5 text-xs font-semibold disabled:opacity-50 hover:bg-purple-100"
|
||||
className="bg-accent-100 text-accent-700 border border-accent-300 px-3 py-1.5 text-xs font-semibold disabled:opacity-50 hover:bg-accent-200"
|
||||
>
|
||||
{loading ? 'Analyzing…' : flags ? 'Re-analyze' : 'Analyze 90-Day Risk'}
|
||||
</button>
|
||||
|
||||
@@ -7,8 +7,8 @@ interface Props {
|
||||
|
||||
const ACCENT = {
|
||||
default: 'border-gray-200',
|
||||
green: 'border-green-400',
|
||||
yellow: 'border-yellow-400',
|
||||
green: 'border-divider',
|
||||
yellow: 'border-accent-300',
|
||||
red: 'border-red-400',
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ export function ClosurePanel({ incidentId, status, canClose, canAddAddenda }: Pr
|
||||
<button
|
||||
onClick={closeIncident}
|
||||
disabled={busy}
|
||||
className="bg-green-700 text-white px-4 py-2 text-sm font-semibold hover:bg-green-800 disabled:opacity-50"
|
||||
className="bg-accent text-white px-4 py-2 text-sm font-semibold hover:bg-accent-700 disabled:opacity-50"
|
||||
>
|
||||
{busy ? 'Closing…' : 'Close Incident'}
|
||||
</button>
|
||||
|
||||
@@ -58,8 +58,8 @@ export function FileUpload({ onFilesChange, disabled = false }: Props) {
|
||||
<div className="space-y-2">
|
||||
<div
|
||||
className={`border-2 border-dashed p-6 text-center cursor-pointer transition-colors
|
||||
${dragging ? 'border-blue-500 bg-blue-50' : 'border-divider hover:border-gray-400'}
|
||||
${disabled ? 'opacity-50 pointer-events-none' : ''}`}
|
||||
${dragging ? 'border-accent bg-accent-100' : 'border-divider hover:border-gray-400'}
|
||||
${disabled ? 'opacity-50 pointer-events-none' : ''}`}
|
||||
onClick={() => inputRef.current?.click()}
|
||||
onDragOver={e => { e.preventDefault(); setDragging(true) }}
|
||||
onDragLeave={() => setDragging(false)}
|
||||
|
||||
@@ -77,20 +77,20 @@ function FiltersInner({ sites, trucks }: FiltersProps) {
|
||||
placeholder="Search reference or description..."
|
||||
value={search}
|
||||
onChange={e => handleSearch(e.target.value)}
|
||||
className="w-full pl-8 pr-3 py-1.5 text-sm border border-divider focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full pl-8 pr-3 py-1.5 text-sm border border-divider focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
/>
|
||||
</div>
|
||||
<select
|
||||
value={searchParams.get('status') ?? ''}
|
||||
onChange={e => updateParam('status', e.target.value)}
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-surface"
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent bg-surface"
|
||||
>
|
||||
{STATUS_OPTIONS.map(o => <option key={o.value} value={o.value}>{o.label}</option>)}
|
||||
</select>
|
||||
<select
|
||||
value={searchParams.get('type') ?? ''}
|
||||
onChange={e => updateParam('type', e.target.value)}
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-surface"
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent bg-surface"
|
||||
>
|
||||
{TYPE_OPTIONS.map(o => <option key={o.value} value={o.value}>{o.label}</option>)}
|
||||
</select>
|
||||
@@ -98,7 +98,7 @@ function FiltersInner({ sites, trucks }: FiltersProps) {
|
||||
<select
|
||||
value={searchParams.get('site_id') ?? ''}
|
||||
onChange={e => updateParam('site_id', e.target.value)}
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-surface"
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent bg-surface"
|
||||
>
|
||||
<option value="">All Sites</option>
|
||||
{sites.map(s => <option key={s.id} value={s.id}>{s.name}</option>)}
|
||||
@@ -108,7 +108,7 @@ function FiltersInner({ sites, trucks }: FiltersProps) {
|
||||
<select
|
||||
value={searchParams.get('truck_id') ?? ''}
|
||||
onChange={e => updateParam('truck_id', e.target.value)}
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-surface"
|
||||
className="text-sm border border-divider px-2 py-1.5 focus:outline-none focus:ring-2 focus:ring-accent bg-surface"
|
||||
>
|
||||
<option value="">All Trucks</option>
|
||||
{trucks.map(tk => <option key={tk.id} value={tk.id}>{tk.truck_no}</option>)}
|
||||
|
||||
@@ -43,7 +43,7 @@ export function IncidentHeader({
|
||||
{canTriage && (
|
||||
<Link
|
||||
href={`/hse/incidents/${incidentId}/triage`}
|
||||
className="text-xs px-3 py-1.5 bg-blue-600 text-white font-medium hover:bg-blue-700"
|
||||
className="text-xs px-3 py-1.5 bg-accent text-white font-medium hover:bg-accent-600"
|
||||
>
|
||||
Triage
|
||||
</Link>
|
||||
@@ -51,7 +51,7 @@ export function IncidentHeader({
|
||||
{canInvestigate && (
|
||||
<Link
|
||||
href={`/hse/incidents/${incidentId}/investigation`}
|
||||
className="text-xs px-3 py-1.5 bg-indigo-600 text-white font-medium hover:bg-indigo-700"
|
||||
className="text-xs px-3 py-1.5 bg-accent text-white font-medium hover:bg-accent-600"
|
||||
>
|
||||
Investigate
|
||||
</Link>
|
||||
@@ -59,7 +59,7 @@ export function IncidentHeader({
|
||||
{canAddCapa && (
|
||||
<Link
|
||||
href={`/hse/incidents/${incidentId}/capa/new`}
|
||||
className="text-xs px-3 py-1.5 bg-amber-600 text-white font-medium hover:bg-amber-700"
|
||||
className="text-xs px-3 py-1.5 bg-accent text-white font-medium hover:bg-accent-600"
|
||||
>
|
||||
Add CAPA
|
||||
</Link>
|
||||
|
||||
@@ -60,12 +60,12 @@ export function IncidentList({ incidents, basePath }: Props) {
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Search ref, type, site…"
|
||||
className="border border-divider px-3 py-2 text-sm w-48 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="border border-divider px-3 py-2 text-sm w-48 focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
value={search}
|
||||
onChange={e => setSearch(e.target.value)}
|
||||
/>
|
||||
<select
|
||||
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"
|
||||
value={typeFilter}
|
||||
onChange={e => setTypeFilter(e.target.value)}
|
||||
>
|
||||
@@ -75,7 +75,7 @@ export function IncidentList({ incidents, basePath }: Props) {
|
||||
))}
|
||||
</select>
|
||||
<select
|
||||
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"
|
||||
value={statusFilter}
|
||||
onChange={e => setStatusFilter(e.target.value)}
|
||||
>
|
||||
|
||||
@@ -136,7 +136,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
type="button"
|
||||
onClick={getAiDraft}
|
||||
disabled={aiDraftLoading}
|
||||
className="bg-purple-50 text-purple-700 border border-purple-300 px-3 py-1.5 text-xs font-semibold disabled:opacity-50 hover:bg-purple-100"
|
||||
className="bg-accent-100 text-accent-700 border border-accent-300 px-3 py-1.5 text-xs font-semibold disabled:opacity-50 hover:bg-accent-200"
|
||||
>
|
||||
{aiDraftLoading ? 'Drafting…' : 'Get AI Draft'}
|
||||
</button>
|
||||
@@ -149,10 +149,10 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
key={m} type="button"
|
||||
onClick={() => setMethod(m)}
|
||||
className={`px-3 py-1.5 text-sm font-medium border ${
|
||||
method === m
|
||||
? 'bg-blue-600 text-white border-blue-600'
|
||||
: 'bg-surface text-gray-700 border-divider hover:border-blue-400'
|
||||
}`}
|
||||
method === m
|
||||
? 'bg-accent text-white border-accent'
|
||||
: 'bg-surface text-gray-700 border-divider hover:border-accent'
|
||||
}`}
|
||||
>
|
||||
{m === 'five_why' ? '5-Why' : m === 'fishbone' ? 'Fishbone' : 'Other'}
|
||||
</button>
|
||||
@@ -182,7 +182,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
))}
|
||||
{fiveWhy.length < 5 && (
|
||||
<button type="button" onClick={addWhyStep}
|
||||
className="text-sm text-blue-600 hover:underline">
|
||||
className="text-sm text-accent-700 hover:underline">
|
||||
+ Add another Why
|
||||
</button>
|
||||
)}
|
||||
@@ -205,7 +205,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
/>
|
||||
))}
|
||||
<button type="button" onClick={() => addFishboneCause(catIdx)}
|
||||
className="text-xs text-blue-600 hover:underline">
|
||||
className="text-xs text-accent-700 hover:underline">
|
||||
+ Add cause
|
||||
</button>
|
||||
</div>
|
||||
@@ -262,7 +262,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setWitnessRefs([...witnessRefs, ''])}
|
||||
className="text-xs text-blue-600 hover:underline"
|
||||
className="text-xs text-accent-700 hover:underline"
|
||||
>
|
||||
+ Add witness statement
|
||||
</button>
|
||||
@@ -293,7 +293,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
{!existingInvestigationId && (
|
||||
<label className="flex items-center gap-2 text-sm text-gray-700">
|
||||
<input type="checkbox" checked={complete} onChange={e => setComplete(e.target.checked)}
|
||||
className="border-divider text-blue-600" />
|
||||
className="border-divider text-accent-700" />
|
||||
Mark investigation complete (transitions incident to CAPA Pending)
|
||||
</label>
|
||||
)}
|
||||
@@ -301,7 +301,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
|
||||
{error && <p className="text-sm text-red-600">{error}</p>}
|
||||
|
||||
<button type="submit" disabled={saving}
|
||||
className="w-full bg-indigo-600 text-white py-2 text-sm font-semibold disabled:opacity-50">
|
||||
className="w-full bg-accent text-white py-2 text-sm font-semibold disabled:opacity-50">
|
||||
{saving ? 'Saving…' : existingInvestigationId ? 'Update Investigation' : 'Start Investigation'}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -40,11 +40,11 @@ export function InvestigationPanel({ investigation: inv }: Props) {
|
||||
<h2 className="text-sm font-semibold text-gray-900">Investigation</h2>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs text-gray-500">{METHOD_LABELS[inv.method] ?? inv.method}</span>
|
||||
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${
|
||||
inv.completed_at
|
||||
? 'bg-green-100 text-green-700'
|
||||
: 'bg-yellow-100 text-yellow-700'
|
||||
}`}>
|
||||
<span className={`text-xs font-medium px-2 py-0.5 ${
|
||||
inv.completed_at
|
||||
? 'bg-neutral-100 text-ink'
|
||||
: 'bg-accent-100 text-accent-700'
|
||||
}`}>
|
||||
{inv.completed_at ? 'Completed' : 'In Progress'}
|
||||
</span>
|
||||
</div>
|
||||
@@ -67,7 +67,7 @@ export function InvestigationPanel({ investigation: inv }: Props) {
|
||||
<ol className="space-y-3">
|
||||
{inv.five_why_steps.map((step, i) => (
|
||||
<li key={i} className="flex gap-3">
|
||||
<span className="flex-shrink-0 w-6 h-6 rounded-full bg-blue-100 text-blue-700 text-xs font-bold flex items-center justify-center">
|
||||
<span className="flex-shrink-0 w-6 h-6 bg-accent-100 text-accent-700 text-xs font-bold flex items-center justify-center">
|
||||
{i + 1}
|
||||
</span>
|
||||
<div className="flex-1 min-w-0">
|
||||
|
||||
@@ -56,15 +56,15 @@ export function OfflineSync() {
|
||||
if (pendingCount === 0) return null
|
||||
|
||||
return (
|
||||
<div className="fixed bottom-4 left-4 right-4 bg-yellow-50 border border-yellow-300 p-3 flex items-center justify-between shadow-md z-50">
|
||||
<span className="text-sm text-yellow-800 font-medium">
|
||||
<div className="fixed bottom-4 left-4 right-4 bg-accent-100 border border-accent-300 p-3 flex items-center justify-between shadow-md z-50">
|
||||
<span className="text-sm text-accent-700 font-medium">
|
||||
{pendingCount} report{pendingCount > 1 ? 's' : ''} saved offline
|
||||
</span>
|
||||
<button
|
||||
onClick={syncNow}
|
||||
disabled={syncing || !navigator.onLine}
|
||||
className="text-xs bg-yellow-600 text-white px-3 py-1.5 font-medium
|
||||
hover:bg-yellow-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
className="text-xs bg-accent text-white px-3 py-1.5 font-medium
|
||||
hover:bg-accent-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{syncing ? 'Syncing…' : 'Sync now'}
|
||||
</button>
|
||||
|
||||
@@ -15,7 +15,7 @@ export function Pagination({ page, pageSize, total, href }: Props) {
|
||||
disabled ? (
|
||||
<span className="px-3 py-1.5 text-sm text-gray-300">{label}</span>
|
||||
) : (
|
||||
<Link href={`${href}?page=${p}`} className="px-3 py-1.5 text-sm text-blue-600 hover:underline">
|
||||
<Link href={`${href}?page=${p}`} className="px-3 py-1.5 text-sm text-accent-700 hover:underline">
|
||||
{label}
|
||||
</Link>
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
value={(typeDetails[key] as string) ?? ''}
|
||||
onChange={e => setDetail(key, e.target.value)}
|
||||
placeholder={placeholder}
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
@@ -82,7 +82,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
<label className="flex items-center gap-3 cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="w-4 h-4 text-blue-600"
|
||||
className="w-4 h-4 text-accent-700"
|
||||
checked={Boolean(typeDetails[key])}
|
||||
onChange={e => setDetail(key, e.target.checked)}
|
||||
/>
|
||||
@@ -205,7 +205,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
|
||||
if (savedOffline) {
|
||||
return (
|
||||
<div className="bg-green-50 border border-green-200 p-5 text-sm text-green-700">
|
||||
<div className="bg-neutral-100 border border-divider p-5 text-sm text-ink">
|
||||
{t.savedOffline}
|
||||
</div>
|
||||
)
|
||||
@@ -214,7 +214,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="space-y-5 bg-surface shadow-sm p-5">
|
||||
{!isOnline && (
|
||||
<div className="bg-yellow-50 border border-yellow-200 p-3 text-sm text-yellow-700">
|
||||
<div className="bg-accent-100 border border-accent-300 p-3 text-sm text-accent-700">
|
||||
{t.offlineBanner}
|
||||
</div>
|
||||
)}
|
||||
@@ -231,7 +231,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
</label>
|
||||
<select
|
||||
required
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
value={form.incident_type}
|
||||
onChange={e => {
|
||||
setForm(f => ({ ...f, incident_type: e.target.value as IncidentType, truck_id: '' }))
|
||||
@@ -278,7 +278,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
</label>
|
||||
<select
|
||||
required
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
value={form.truck_id}
|
||||
onChange={e => setForm(f => ({ ...f, truck_id: e.target.value }))}
|
||||
>
|
||||
@@ -301,31 +301,31 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
minLength={10}
|
||||
rows={4}
|
||||
placeholder={t.descriptionPlaceholder}
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-accent resize-none"
|
||||
value={form.description}
|
||||
onChange={e => setForm(f => ({ ...f, description: e.target.value }))}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{qualityCheck && !qualityCheck.passes && (
|
||||
<div className="bg-amber-50 border border-amber-200 p-3 space-y-2">
|
||||
<p className="text-xs font-semibold text-amber-700 uppercase tracking-wide">
|
||||
<div className="bg-accent-100 border border-accent-300 p-3 space-y-2">
|
||||
<p className="text-xs font-semibold text-accent-700 uppercase tracking-wide">
|
||||
{t.qualityScoreLabel.replace('{score}', String(qualityCheck.score))}
|
||||
</p>
|
||||
<p className="text-sm text-amber-800">{qualityCheck.feedback}</p>
|
||||
<p className="text-sm text-accent-700">{qualityCheck.feedback}</p>
|
||||
{qualityCheck.suggestions.length > 0 && (
|
||||
<ul className="list-disc list-inside space-y-1">
|
||||
{qualityCheck.suggestions.map((s, i) => (
|
||||
<li key={i} className="text-xs text-amber-700">{s}</li>
|
||||
<li key={i} className="text-xs text-accent-700">{s}</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<label className="flex items-center gap-2 text-xs text-amber-700 cursor-pointer mt-1">
|
||||
<label className="flex items-center gap-2 text-xs text-accent-700 cursor-pointer mt-1">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={overrideQuality}
|
||||
onChange={e => setOverrideQuality(e.target.checked)}
|
||||
className="border-amber-300 text-amber-600"
|
||||
className="border-accent-300 text-accent-700"
|
||||
/>
|
||||
{t.submitAnyway}
|
||||
</label>
|
||||
@@ -336,7 +336,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
<label className="flex items-center gap-3 cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="w-4 h-4 text-blue-600"
|
||||
className="w-4 h-4 text-accent-700"
|
||||
checked={form.injury_involved}
|
||||
onChange={e => setForm(f => ({ ...f, injury_involved: e.target.checked, medical_status: '' }))}
|
||||
/>
|
||||
@@ -350,7 +350,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
</label>
|
||||
<select
|
||||
required={form.injury_involved}
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full border border-divider px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-accent"
|
||||
value={form.medical_status}
|
||||
onChange={e => setForm(f => ({ ...f, medical_status: e.target.value as MedicalStatus }))}
|
||||
>
|
||||
@@ -365,7 +365,7 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
<label className="flex items-center gap-3 cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="w-4 h-4 text-blue-600"
|
||||
className="w-4 h-4 text-accent-700"
|
||||
checked={form.asset_involved}
|
||||
onChange={e => setForm(f => ({ ...f, asset_involved: e.target.checked }))}
|
||||
/>
|
||||
@@ -383,8 +383,8 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
|
||||
<button
|
||||
type="submit"
|
||||
disabled={submitting || !form.incident_type || (form.incident_type === 'transport' && !form.truck_id)}
|
||||
className="w-full bg-blue-600 text-white py-3 font-medium text-sm
|
||||
hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
className="w-full bg-accent text-white py-3 font-medium text-sm
|
||||
hover:bg-accent-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{submitting ? t.submitting : t.submitButton}
|
||||
</button>
|
||||
|
||||
@@ -60,7 +60,7 @@ export function SimilarIncidentsPanel({ incidentId }: Props) {
|
||||
<a
|
||||
key={inc.id}
|
||||
href={`/hse/incidents/${inc.id}`}
|
||||
className="block border border-divider p-3 hover:border-blue-300 hover:bg-blue-50 transition-colors"
|
||||
className="block border border-divider p-3 hover:border-accent hover:bg-neutral-100 transition-colors"
|
||||
>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<span className="text-xs font-medium text-gray-500">
|
||||
|
||||
@@ -102,10 +102,10 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
|
||||
type="button"
|
||||
onClick={() => setSeverity(v)}
|
||||
className={`flex-1 py-2 text-xs font-medium transition-colors ${
|
||||
severity === v
|
||||
? 'bg-blue-600 text-white border-blue-600'
|
||||
: 'bg-surface text-gray-700 hover:bg-gray-50'
|
||||
}`}
|
||||
severity === v
|
||||
? 'bg-accent text-white border-accent'
|
||||
: 'bg-surface text-gray-700 hover:bg-gray-50'
|
||||
}`}
|
||||
>
|
||||
<span className="block font-bold">{v}</span>
|
||||
<span className="block">{SEVERITY_LABELS[v].split(' / ')[0]}</span>
|
||||
@@ -126,7 +126,7 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
|
||||
<input
|
||||
type="checkbox" checked={value}
|
||||
onChange={e => set(e.target.checked)}
|
||||
className="border-divider text-blue-600"
|
||||
className="border-divider text-accent-700"
|
||||
/>
|
||||
{label}
|
||||
</label>
|
||||
@@ -151,16 +151,16 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
|
||||
value={triageNotes}
|
||||
onChange={e => setTriageNotes(e.target.value)}
|
||||
rows={3}
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
className="w-full border border-divider px-3 py-2 text-sm focus:ring-2 focus:ring-accent focus:border-transparent"
|
||||
placeholder="Initial assessment, immediate actions taken..."
|
||||
/>
|
||||
</div>
|
||||
|
||||
{aiRationale && (
|
||||
<div className="bg-purple-50 border border-purple-200 p-3">
|
||||
<p className="text-xs font-semibold text-purple-700 mb-1">AI Suggestion Rationale</p>
|
||||
<p className="text-xs text-purple-600">{aiRationale}</p>
|
||||
<p className="text-xs text-purple-400 mt-1">Fields pre-filled — review before submitting.</p>
|
||||
<div className="bg-accent-100 border border-accent-300 p-3">
|
||||
<p className="text-xs font-semibold text-accent-700 mb-1">AI Suggestion Rationale</p>
|
||||
<p className="text-xs text-accent-700">{aiRationale}</p>
|
||||
<p className="text-xs text-accent-400 mt-1">Fields pre-filled — review before submitting.</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -171,14 +171,14 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
|
||||
type="button"
|
||||
onClick={getAiSuggestion}
|
||||
disabled={aiLoading || saving}
|
||||
className="flex-1 bg-purple-50 text-purple-700 border border-purple-300 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-purple-100"
|
||||
className="flex-1 bg-accent-100 text-accent-700 border border-accent-300 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-accent-200"
|
||||
>
|
||||
{aiLoading ? 'Getting suggestion…' : 'Get AI Suggestion'}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={saving}
|
||||
className="flex-1 bg-blue-600 text-white py-2 text-sm font-semibold disabled:opacity-50"
|
||||
className="flex-1 bg-accent text-white py-2 text-sm font-semibold disabled:opacity-50"
|
||||
>
|
||||
{saving ? 'Saving…' : 'Complete Triage'}
|
||||
</button>
|
||||
|
||||
@@ -33,7 +33,7 @@ export function LanguageSwitcher() {
|
||||
value={current}
|
||||
onChange={e => handleChange(e.target.value)}
|
||||
aria-label="Select language"
|
||||
className="text-xs border border-divider px-2 py-1 bg-surface text-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-500"
|
||||
className="text-xs border border-divider px-2 py-1 bg-surface text-gray-700 focus:outline-none focus:ring-1 focus:ring-accent"
|
||||
>
|
||||
{Object.entries(LOCALES).map(([code, label]) => (
|
||||
<option key={code} value={code}>{label}</option>
|
||||
|
||||
@@ -47,11 +47,11 @@ export function ApiKeyForm({ settings }: Props) {
|
||||
<div key={key} className="bg-surface shadow-sm p-5">
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<label className="text-sm font-semibold text-gray-800">{KEY_LABELS[key]}</label>
|
||||
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${
|
||||
status?.set
|
||||
? 'bg-green-100 text-green-700'
|
||||
: 'bg-yellow-100 text-yellow-700'
|
||||
}`}>
|
||||
<span className={`text-xs font-medium px-2 py-0.5 ${
|
||||
status?.set
|
||||
? 'bg-neutral-100 text-ink'
|
||||
: 'bg-accent-100 text-accent-700'
|
||||
}`}>
|
||||
{status?.set ? 'Configured' : 'Not set'}
|
||||
</span>
|
||||
</div>
|
||||
@@ -66,18 +66,18 @@ export function ApiKeyForm({ settings }: Props) {
|
||||
value={values[key]}
|
||||
onChange={e => setValues(v => ({ ...v, [key]: e.target.value }))}
|
||||
placeholder={status?.set ? 'Enter new key to replace…' : 'Enter API key…'}
|
||||
className="flex-1 border border-divider px-3 py-2 text-sm text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono"
|
||||
className="flex-1 border border-divider px-3 py-2 text-sm text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-accent focus:border-transparent font-mono"
|
||||
/>
|
||||
<button
|
||||
onClick={() => save(key)}
|
||||
disabled={saving[key] || !values[key]}
|
||||
className="bg-blue-600 text-white px-4 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-blue-700"
|
||||
className="bg-accent text-white px-4 py-2 text-sm font-semibold disabled:opacity-50 hover:bg-accent-600"
|
||||
>
|
||||
{saving[key] ? 'Saving…' : 'Save'}
|
||||
</button>
|
||||
</div>
|
||||
{results[key] === 'ok' && (
|
||||
<p className="text-xs text-green-600 mt-2">Saved. Reload the page to confirm.</p>
|
||||
<p className="text-xs text-ink mt-2">Saved. Reload the page to confirm.</p>
|
||||
)}
|
||||
{results[key] === 'error' && (
|
||||
<p className="text-xs text-red-600 mt-2">Save failed. Check your permissions.</p>
|
||||
|
||||
Reference in New Issue
Block a user