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:
@@ -45,7 +45,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
|
||||
<h2 className="text-lg font-bold text-slate-900">Order Details</h2>
|
||||
<p className="text-sm text-slate-500 font-mono">{order.invoice_number ?? order.id.slice(0, 8)}</p>
|
||||
</div>
|
||||
<button type="button" onClick={onClose} className="text-slate-400 hover:text-slate-600">
|
||||
<button type="button" onClick={onClose} className="text-slate-400 hover:text-slate-600" aria-label="Close">
|
||||
<svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
@@ -152,7 +152,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
|
||||
<button type="button"
|
||||
onClick={() => onRecordDeposit(order.id)}
|
||||
className="rounded-xl bg-purple-600 px-4 py-2 text-sm font-semibold text-white hover:bg-purple-700"
|
||||
>
|
||||
aria-label="Record Deposit">
|
||||
Record Deposit
|
||||
</button>
|
||||
)}
|
||||
@@ -167,7 +167,7 @@ export default function OrderDetailsModal({ order, onClose, onFulfill, onRecordD
|
||||
<button type="button"
|
||||
onClick={onClose}
|
||||
className="ml-auto rounded-xl border border-slate-300 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50"
|
||||
>
|
||||
aria-label="Close">
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user