fix(a11y): add ARIA attributes to core UI components
AnimatedModal: ariaLabelledBy prop, EntityCombobox: combobox/listbox pattern, FilterBar: role="search", SortableColumnHeader: aria-sort, global-error: html lang attr, eslint label rule depth config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,10 +53,16 @@ export function SortableColumnHeader({
|
||||
tooltipWidth,
|
||||
}: SortableColumnHeaderProps) {
|
||||
const activeDir = sortField === field ? sortDir : null;
|
||||
const alignClass = align === "right" ? "justify-end" : align === "center" ? "justify-center" : "justify-start";
|
||||
const alignClass =
|
||||
align === "right" ? "justify-end" : align === "center" ? "justify-center" : "justify-start";
|
||||
const ariaSortValue =
|
||||
activeDir === "asc" ? "ascending" : activeDir === "desc" ? "descending" : undefined;
|
||||
|
||||
return (
|
||||
<th className={`px-3 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider ${className}`}>
|
||||
<th
|
||||
aria-sort={ariaSortValue}
|
||||
className={`px-3 py-3 text-xs font-medium text-gray-500 uppercase tracking-wider ${className}`}
|
||||
>
|
||||
<div className={`flex items-center gap-0.5 ${alignClass}`}>
|
||||
<button
|
||||
type="button"
|
||||
@@ -66,7 +72,12 @@ export function SortableColumnHeader({
|
||||
<span>{label}</span>
|
||||
<SortIcon dir={activeDir} />
|
||||
</button>
|
||||
{tooltip && <InfoTooltip content={tooltip} {...(tooltipWidth !== undefined ? { width: tooltipWidth } : {})} />}
|
||||
{tooltip && (
|
||||
<InfoTooltip
|
||||
content={tooltip}
|
||||
{...(tooltipWidth !== undefined ? { width: tooltipWidth } : {})}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</th>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user