Archived
Accessibility pass, WCAG 2.2 AA (1.50.0)
Public pages, auth, registration, payment, My Events and the kiosk: skip link, focus ring, labels tied to fields, named quantity buttons, announced errors, ModalOverlay popups (focus trap, Escape, focus return), contrast and underlined in-text links, reduced motion. Branding warns about a primary colour too light for white text and offers a darker shade. axe-core and keyboard checks in e2e/accessibility.spec.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,29 +129,33 @@ function StockBadge({ stockLimit, availableCount }: { stockLimit?: number; avail
|
||||
}
|
||||
|
||||
function QtyControl({
|
||||
label,
|
||||
value,
|
||||
onChange,
|
||||
disabled,
|
||||
max,
|
||||
}: {
|
||||
label: string;
|
||||
value: number;
|
||||
onChange: (v: number) => void;
|
||||
disabled?: boolean;
|
||||
max?: number;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="flex items-center gap-1.5" role="group" aria-label={`${label} quantity`}>
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`Remove one ${label}`}
|
||||
className="w-7 h-7 flex items-center justify-center border rounded text-gray-600 hover:bg-gray-50 disabled:opacity-40"
|
||||
onClick={() => onChange(Math.max(0, value - 1))}
|
||||
disabled={disabled || value <= 0}
|
||||
>
|
||||
−
|
||||
</button>
|
||||
<span className="w-6 text-center text-sm font-medium">{value}</span>
|
||||
<span className="w-6 text-center text-sm font-medium" aria-live="polite">{value}</span>
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`Add one ${label}`}
|
||||
className="w-7 h-7 flex items-center justify-center border rounded text-gray-600 hover:bg-gray-50 disabled:opacity-40"
|
||||
onClick={() => onChange(value + 1)}
|
||||
disabled={disabled || (max !== undefined && max > 0 && value >= max)}
|
||||
@@ -245,6 +249,7 @@ function OptionCard({
|
||||
)}
|
||||
</div>
|
||||
<QtyControl
|
||||
label={`${opt.name} (${variant.name})`}
|
||||
value={qty}
|
||||
onChange={(v) => onQtyChange(key, v)}
|
||||
disabled={!!(isSoldOut || variantSoldOut)}
|
||||
@@ -292,6 +297,7 @@ function OptionCard({
|
||||
</div>
|
||||
</div>
|
||||
<QtyControl
|
||||
label={opt.name}
|
||||
value={qty}
|
||||
onChange={(v) => onQtyChange(key, v)}
|
||||
disabled={!!(isSoldOut)}
|
||||
|
||||
Reference in New Issue
Block a user