fix(a11y): label associations for AdminNewsCreate fields

- htmlFor/id pairs for title, slug, read-time, excerpt and featured-image inputs
- add an ariaLabel prop to ColoredItemCombobox (applied to the trigger button) and
  pass the category/tag labels so the comboboxes have an accessible name (WCAG 1.3.1/4.1.2)
This commit is contained in:
c0mrade
2026-05-26 00:20:30 +03:00
parent 1b40c3856d
commit fefc52fb20
2 changed files with 25 additions and 5 deletions

View File

@@ -27,6 +27,7 @@ interface ColoredItemComboboxProps {
onCreateNew: (name: string, color: string) => Promise<ColoredItem>;
onDelete?: (item: ColoredItem) => Promise<void>;
placeholder?: string;
ariaLabel?: string;
isLoading?: boolean;
colors?: string[];
className?: string;
@@ -39,6 +40,7 @@ export function ColoredItemCombobox({
onCreateNew,
onDelete,
placeholder,
ariaLabel,
isLoading = false,
colors = DEFAULT_COLORS,
className,
@@ -190,6 +192,7 @@ export function ColoredItemCombobox({
isOpen ? 'border-accent-500/50' : 'border-dark-700 hover:border-dark-600',
isLoading && 'animate-pulse',
)}
aria-label={ariaLabel}
aria-expanded={isOpen}
aria-haspopup="listbox"
>