refactor(design): drop rounded classes, swap bg-white and gray borders for tokens

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 19:02:28 +08:00
co-authored by Claude Haiku 4.5
parent 8701d24c6c
commit 3a941a357b
51 changed files with 394 additions and 285 deletions
+18 -18
View File
@@ -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 rounded-lg px-3 py-1.5 text-xs font-semibold disabled:opacity-50 hover:bg-purple-100"
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"
>
{aiDraftLoading ? 'Drafting…' : 'Get AI Draft'}
</button>
@@ -148,11 +148,11 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
<button
key={m} type="button"
onClick={() => setMethod(m)}
className={`px-3 py-1.5 rounded-lg text-sm font-medium border ${
method === m
? 'bg-blue-600 text-white border-blue-600'
: 'bg-white text-gray-700 border-gray-300 hover:border-blue-400'
}`}
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'
}`}
>
{m === 'five_why' ? '5-Why' : m === 'fishbone' ? 'Fishbone' : 'Other'}
</button>
@@ -164,19 +164,19 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
<div className="space-y-3">
<p className="text-sm font-medium text-gray-700">5-Why Analysis</p>
{fiveWhy.map((step, i) => (
<div key={i} className="border border-gray-200 rounded-lg p-3 space-y-2">
<div key={i} className="border border-divider p-3 space-y-2">
<label className="block text-xs text-gray-500">Why #{i + 1}</label>
<input
type="text" value={step.why}
onChange={e => updateWhyStep(i, 'why', e.target.value)}
placeholder="Why did this happen?"
className="w-full rounded border border-gray-300 px-2 py-1.5 text-sm"
className="w-full border border-divider px-2 py-1.5 text-sm"
/>
<textarea
value={step.answer}
onChange={e => updateWhyStep(i, 'answer', e.target.value)}
rows={2} placeholder="Answer / finding…"
className="w-full rounded border border-gray-300 px-2 py-1.5 text-sm"
className="w-full border border-divider px-2 py-1.5 text-sm"
/>
</div>
))}
@@ -193,7 +193,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
<div className="space-y-3">
<p className="text-sm font-medium text-gray-700">Fishbone (Ishikawa) Analysis</p>
{fishbone.map((cat, catIdx) => (
<div key={cat.category} className="border border-gray-200 rounded-lg p-3">
<div key={cat.category} className="border border-divider p-3">
<p className="text-xs font-semibold text-gray-600 mb-2">{CATEGORY_LABELS[cat.category]}</p>
{cat.causes.map((cause, causeIdx) => (
<input
@@ -201,7 +201,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
type="text" value={cause}
onChange={e => updateFishboneCause(catIdx, causeIdx, e.target.value)}
placeholder="Contributing cause…"
className="w-full rounded border border-gray-300 px-2 py-1.5 text-sm mb-1.5"
className="w-full border border-divider px-2 py-1.5 text-sm mb-1.5"
/>
))}
<button type="button" onClick={() => addFishboneCause(catIdx)}
@@ -219,7 +219,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
<select
value={alcoholTest}
onChange={e => setAlcoholTest(e.target.value)}
className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"
className="w-full border border-divider px-3 py-2 text-sm"
>
<option value="">Not conducted</option>
<option value="negative">Negative</option>
@@ -233,7 +233,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
<select
value={urineTest}
onChange={e => setUrineTest(e.target.value)}
className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"
className="w-full border border-divider px-3 py-2 text-sm"
>
<option value="">Not conducted</option>
<option value="negative">Negative</option>
@@ -256,7 +256,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
value={ref}
onChange={e => setWitnessRefs(witnessRefs.map((w, j) => (j === i ? e.target.value : w)))}
placeholder="e.g. Ali bin Ahmad — statement dated 12/07/2026"
className="w-full rounded border border-gray-300 px-2 py-1.5 text-sm mb-1.5"
className="w-full border border-divider px-2 py-1.5 text-sm mb-1.5"
/>
))}
<button
@@ -274,7 +274,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
value={findingsText}
onChange={e => setFindingsText(e.target.value)}
rows={3}
className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"
className="w-full border border-divider px-3 py-2 text-sm"
placeholder="Describe the sequence of events and contributing factors…"
/>
</div>
@@ -285,7 +285,7 @@ export function InvestigationForm({ incidentId, existingInvestigationId }: Props
value={rootCause}
onChange={e => setRootCause(e.target.value)}
rows={2}
className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm"
className="w-full border border-divider px-3 py-2 text-sm"
placeholder="One-sentence root cause statement…"
/>
</div>
@@ -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="rounded border-gray-300 text-blue-600" />
className="border-divider text-blue-600" />
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 rounded-lg py-2 text-sm font-semibold disabled:opacity-50">
className="w-full bg-indigo-600 text-white py-2 text-sm font-semibold disabled:opacity-50">
{saving ? 'Saving…' : existingInvestigationId ? 'Update Investigation' : 'Start Investigation'}
</button>
</form>