fix(a11y): switch semantics for admin form toggles

Add role=switch + aria-checked + aria-label to 12 ad-hoc toggle buttons across admin
create/edit forms (AdminCampaignCreate/Edit, AdminPromocodeCreate, AdminPromoGroupCreate,
AdminPromoOfferTemplateEdit, AdminPaymentMethodEdit, AdminTariffCreate) so screen readers
announce on/off state (WCAG 4.1.2).
This commit is contained in:
c0mrade
2026-05-26 00:03:17 +03:00
parent 491f48a331
commit 7b0a72db5b
7 changed files with 35 additions and 0 deletions

View File

@@ -378,6 +378,9 @@ export default function AdminPromoGroupCreate() {
<button
type="button"
onClick={() => setApplyToAddons(!applyToAddons)}
role="switch"
aria-checked={applyToAddons}
aria-label={t('admin.promoGroups.form.applyToAddons')}
className={`relative h-6 w-11 rounded-full transition-colors ${
applyToAddons ? 'bg-accent-500' : 'bg-dark-600'
}`}
@@ -396,6 +399,9 @@ export default function AdminPromoGroupCreate() {
<button
type="button"
onClick={() => setIsDefault(!isDefault)}
role="switch"
aria-checked={isDefault}
aria-label={t('admin.promoGroups.form.isDefault')}
className={`relative h-6 w-11 rounded-full transition-colors ${
isDefault ? 'bg-accent-500' : 'bg-dark-600'
}`}