feat(design): colour banners and badges by meaning, document slice 1 and update design notes

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:36:01 +08:00
co-authored by Claude Haiku 4.5
parent a64b951922
commit 582504c24b
12 changed files with 30 additions and 28 deletions
+3 -3
View File
@@ -39,13 +39,13 @@ export function LoginForm() {
return (
<form onSubmit={handleSubmit} className="flex flex-col gap-4 w-full max-w-sm">
<div className="pb-3 border-b border-divider">
<h1 className="text-3xl font-extrabold">IMS</h1>
<div className="pb-3 border-b border-rule">
<h1 className="text-[22px] font-[650]">IMS</h1>
<p className="text-sm text-ink/60 mt-1">HSE Incident Management</p>
</div>
{error && (
<p className="bg-accent-100 border border-accent text-accent-800 text-sm px-3 py-2">
<p className="bg-st-red-bg text-st-red-fg text-[13px] px-3 py-2 rounded-md">
{error}
</p>
)}
+4 -4
View File
@@ -11,9 +11,9 @@ type RiskFlag = {
}
const LEVEL_COLORS: Record<RiskFlag['risk_level'], string> = {
low: 'bg-neutral-100 text-neutral-800 border-divider',
medium: 'bg-ground text-accent-700 border-accent',
high: 'bg-accent-100 text-accent-800 border-accent',
low: 'bg-st-grey-bg text-st-grey-fg border-transparent',
medium: 'bg-st-amber-bg text-st-amber-fg border-transparent',
high: 'bg-st-red-bg text-st-red-fg border-transparent',
}
export function RiskFlagsPanel() {
@@ -71,7 +71,7 @@ export function RiskFlagsPanel() {
<p className="text-sm text-gray-700 mb-3">{summary}</p>
<div className="space-y-2">
{flags.map(f => (
<div key={`${f.site}-${f.zone}`} className={`border p-3 ${LEVEL_COLORS[f.risk_level]}`}>
<div key={`${f.site}-${f.zone}`} className={`border rounded-md p-3 ${LEVEL_COLORS[f.risk_level]}`}>
<div className="flex items-center justify-between mb-1">
<span className="text-sm font-semibold">{f.zone} · {f.site}</span>
<span className="text-xs font-bold uppercase">{f.risk_level}</span>
+2 -2
View File
@@ -42,8 +42,8 @@ export function InvestigationPanel({ investigation: inv }: Props) {
<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 ${
inv.completed_at
? 'bg-neutral-100 text-ink'
: 'bg-accent-100 text-accent-700'
? 'bg-st-green-bg text-st-green-fg'
: 'bg-st-blue-bg text-st-blue-fg'
}`}>
{inv.completed_at ? 'Completed' : 'In Progress'}
</span>
+2 -2
View File
@@ -56,8 +56,8 @@ export function OfflineSync() {
if (pendingCount === 0) return null
return (
<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">
<div className="fixed bottom-4 left-4 right-4 bg-st-amber-bg rounded-xl p-3 flex items-center justify-between shadow-float z-50">
<span className="text-sm text-st-amber-fg font-medium">
{pendingCount} report{pendingCount > 1 ? 's' : ''} saved offline
</span>
<button
+5 -5
View File
@@ -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-accent-100 border border-accent-300 p-3 text-sm text-accent-700">
<div className="bg-st-amber-bg rounded-md p-3 text-sm text-st-amber-fg">
{t.offlineBanner}
</div>
)}
@@ -308,15 +308,15 @@ export function ReportForm({ zoneToken, trucks, initialTruckId }: Props) {
</div>
{qualityCheck && !qualityCheck.passes && (
<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">
<div className="bg-st-amber-bg rounded-md p-3 space-y-2">
<p className="text-xs font-semibold text-st-amber-fg uppercase tracking-wide">
{t.qualityScoreLabel.replace('{score}', String(qualityCheck.score))}
</p>
<p className="text-sm text-accent-700">{qualityCheck.feedback}</p>
<p className="text-sm text-st-amber-fg">{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-accent-700">{s}</li>
<li key={i} className="text-xs text-st-amber-fg">{s}</li>
))}
</ul>
)}
+1 -1
View File
@@ -157,7 +157,7 @@ export function TriageForm({ incidentId, currentSeverity }: Props) {
</div>
{aiRationale && (
<div className="bg-accent-100 border border-accent-300 p-3">
<div className="bg-accent-tint rounded-md 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>
+2 -2
View File
@@ -49,8 +49,8 @@ export function ApiKeyForm({ settings }: Props) {
<label className="text-sm font-semibold text-gray-800">{KEY_LABELS[key]}</label>
<span className={`text-xs font-medium px-2 py-0.5 ${
status?.set
? 'bg-neutral-100 text-ink'
: 'bg-accent-100 text-accent-700'
? 'bg-st-green-bg text-st-green-fg'
: 'bg-st-amber-bg text-st-amber-fg'
}`}>
{status?.set ? 'Configured' : 'Not set'}
</span>