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:
@@ -247,7 +247,7 @@ function SectionHeader({
|
||||
<button type="button"
|
||||
onClick={onToggle}
|
||||
className="flex items-center gap-2 text-base font-bold text-stone-800 hover:text-stone-900"
|
||||
>
|
||||
aria-label=")}">
|
||||
<span className="text-stone-400">{title}</span>
|
||||
{count !== undefined && (
|
||||
<span className="rounded-full bg-stone-100 px-2 py-0.5 text-xs font-semibold text-stone-600">
|
||||
@@ -486,7 +486,7 @@ export default function WaterAdminClient() {
|
||||
<button type="button"
|
||||
onClick={() => setShowAddHg((v) => !v)}
|
||||
className="rounded-lg bg-stone-900 px-3 py-1.5 text-xs font-semibold text-white hover:bg-stone-700 min-h-[36px] min-w-[36px]"
|
||||
>
|
||||
aria-label="+">
|
||||
+
|
||||
</button>
|
||||
}
|
||||
@@ -523,7 +523,7 @@ export default function WaterAdminClient() {
|
||||
type="button"
|
||||
onClick={() => { setShowAddHg(false); setNewHgError(null); }}
|
||||
className="rounded-lg border border-stone-300 px-3 py-2 text-sm text-stone-600 hover:bg-stone-50 min-h-[44px]"
|
||||
>
|
||||
aria-label="×">
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
@@ -587,7 +587,7 @@ export default function WaterAdminClient() {
|
||||
<button type="button"
|
||||
onClick={() => setShowAddUser((v) => !v)}
|
||||
className="rounded-lg bg-stone-900 px-3 py-1.5 text-xs font-semibold text-white hover:bg-stone-700 min-h-[36px] min-w-[36px]"
|
||||
>
|
||||
aria-label="+">
|
||||
+
|
||||
</button>
|
||||
}
|
||||
@@ -623,7 +623,7 @@ export default function WaterAdminClient() {
|
||||
type="button"
|
||||
onClick={() => { setShowAddUser(false); setNewUserError(null); }}
|
||||
className="rounded-lg border border-stone-300 px-3 py-2 text-sm text-stone-600 hover:bg-stone-50 min-h-[44px]"
|
||||
>
|
||||
aria-label="×">
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user