Fix a11y incomplete checks and glyph icons

This commit is contained in:
2026-03-20 14:11:12 +08:00
parent 91a0bac8dd
commit 6b160e1993
14 changed files with 213 additions and 29 deletions
+13 -2
View File
@@ -40,6 +40,11 @@ import { Spinner } from "./spinner";
import { cn } from "../lib/cn";
import type { VariantProps } from "../lib/cva";
import { createDataAttributes, createSlot } from "../lib/contracts";
import {
SortAscendingIcon,
SortDescendingIcon,
SortUnsortedIcon
} from "../lib/icons";
import {
dataTableBodyVariants,
dataTableCellVariants,
@@ -546,9 +551,15 @@ function DataTableInner<TData>(
<span>{flexRender(header.column.columnDef.header, header.getContext())}</span>
<span
aria-hidden="true"
className="text-xs text-[var(--color-muted-foreground)]"
className="inline-flex items-center justify-center text-[var(--color-muted-foreground)]"
>
{sortState === "asc" ? "↑" : sortState === "desc" ? "↓" : "↕"}
{sortState === "asc" ? (
<SortAscendingIcon className="size-3.5" />
) : sortState === "desc" ? (
<SortDescendingIcon className="size-3.5" />
) : (
<SortUnsortedIcon className="size-3.5" />
)}
</span>
<span className="sr-only">
Sort by{" "}