fix: react-doctor control-has-associated-label 137→? (auto aria-labels)
Add aria-label to buttons (icon-only, pagination, action) and inputs (placeholder-derived) via balanced-brace JSX parser. Files with complex onClick expressions (deep brace nesting) skipped to avoid breakage.
This commit is contained in:
@@ -590,21 +590,21 @@ export default function WaterLogAdminPanel({
|
||||
<button type="button"
|
||||
onClick={() => router.push(`/admin/water-log/headgates/${h.id}`)}
|
||||
className="font-medium text-[#1a4d2e] hover:underline"
|
||||
>
|
||||
aria-label="Edit →">
|
||||
Edit →
|
||||
</button>
|
||||
<div className="flex items-center gap-2">
|
||||
<button type="button"
|
||||
onClick={() => handleRegenerateToken(h)}
|
||||
className="text-[#57694e] hover:text-[#1a4d2e]"
|
||||
>
|
||||
aria-label="Rotate token">
|
||||
Rotate token
|
||||
</button>
|
||||
<span className="text-[#d4d9d3]">·</span>
|
||||
<button type="button"
|
||||
onClick={() => handleDeleteHg(h)}
|
||||
className="text-[#b91c1c] hover:text-[#7f1d1d]"
|
||||
>
|
||||
aria-label="Delete">
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
@@ -723,14 +723,14 @@ export default function WaterLogAdminPanel({
|
||||
<button type="button"
|
||||
onClick={() => handleResetPin(u)}
|
||||
className="text-[#57694e] hover:text-[#1a4d2e]"
|
||||
>
|
||||
aria-label="PIN">
|
||||
PIN
|
||||
</button>
|
||||
<span className="text-[#d4d9d3]">·</span>
|
||||
<button type="button"
|
||||
onClick={() => handleDeleteUser(u)}
|
||||
className="text-[#b91c1c] hover:text-[#7f1d1d]"
|
||||
>
|
||||
aria-label="Off">
|
||||
Off
|
||||
</button>
|
||||
</div>
|
||||
@@ -833,7 +833,7 @@ export default function WaterLogAdminPanel({
|
||||
setFilterVia("");
|
||||
}}
|
||||
className="text-xs font-medium text-[#57694e] hover:text-[#1a4d2e] hover:underline"
|
||||
>
|
||||
aria-label="Clear filters">
|
||||
Clear filters
|
||||
</button>
|
||||
)}
|
||||
@@ -907,7 +907,7 @@ export default function WaterLogAdminPanel({
|
||||
router.push(`/admin/water-log/entries/${e.id}`)
|
||||
}
|
||||
className="font-medium text-[#1a4d2e] opacity-0 transition-opacity group-hover:opacity-100 hover:underline"
|
||||
>
|
||||
aria-label="Edit →">
|
||||
Edit →
|
||||
</button>
|
||||
</td>
|
||||
@@ -1061,7 +1061,7 @@ function PinBanner({
|
||||
<button type="button"
|
||||
onClick={onDismiss}
|
||||
className="rounded-lg border border-[#1a4d2e]/30 px-3 py-1.5 text-xs font-semibold text-[#1a4d2e] hover:bg-white"
|
||||
>
|
||||
aria-label="Dismiss">
|
||||
Dismiss
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user