fix(a11y): add sr-only DialogTitle/Description to record/export/timetravel modals
Radix Dialog warns when DialogContent отсутствует accessible name/description. RecordDrawer (Sheet) уже имел Title, добавили sr-only Description. ConflictDiffModal/ExportModal/TimeTravelModal — кастомные visible headers, теперь имеют sr-only Title + Description для screen readers + чтобы заглушить dev warnings.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { ClockCounterClockwiseIcon, CaretLeftIcon, CaretRightIcon, XIcon } from '@phosphor-icons/react'
|
||||
import { Dialog, DialogContent } from '@/ui'
|
||||
import { Dialog, DialogContent, DialogTitle, DialogDescription } from '@/ui'
|
||||
import type { DictionaryDetail } from '@/api/client'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
@@ -127,6 +127,16 @@ export function TimeTravelModal({
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(v) => !v && onClose()}>
|
||||
<DialogContent size="full" className="!p-0 gap-0 max-h-[95vh]" hideClose>
|
||||
{/* Radix a11y: sr-only Title + Description. Visible header — custom layout ниже. */}
|
||||
<DialogTitle className="sr-only">
|
||||
{t('timeTravel.title', { defaultValue: 'Состояние справочника на момент времени' })}
|
||||
</DialogTitle>
|
||||
<DialogDescription className="sr-only">
|
||||
{t('timeTravel.description', {
|
||||
defaultValue:
|
||||
'Сравнение текущего состояния справочника с выбранной точкой во времени.',
|
||||
})}
|
||||
</DialogDescription>
|
||||
{/* Header */}
|
||||
<div className="flex items-start gap-3 px-6 py-4 border-b border-line">
|
||||
<div className="size-8 rounded-md bg-surface-2 inline-flex items-center justify-center shrink-0">
|
||||
|
||||
Reference in New Issue
Block a user