From a2ba418ebc8395051f7a0a0e6af15e7655a1ef25 Mon Sep 17 00:00:00 2001 From: Ly Tempel Date: Thu, 6 Aug 2026 10:21:25 +0300 Subject: [PATCH 1/2] fix(search): fix a11y violations in Storybook stories #599 --- skills/tedi-angular/references/forms.md | 20 +++++++++-- tedi/components/form/search/search.stories.ts | 34 ++++++++++++++----- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/skills/tedi-angular/references/forms.md b/skills/tedi-angular/references/forms.md index 97dd2a07c..d3c58a1ca 100644 --- a/skills/tedi-angular/references/forms.md +++ b/skills/tedi-angular/references/forms.md @@ -8,7 +8,8 @@ TEDI form controls implement Angular's `ControlValueAccessor` interface, integra |-----------|----------|------------| | TextFieldComponent | `input[tedi-text-field]` | `string` | | NumberFieldComponent | `tedi-number-field` | `number` | -| CheckboxComponent | `input[tedi-checkbox]` | `boolean` | +| SearchComponent | `tedi-search` | `string` | +| SliderComponent | `tedi-slider` | `number` | | CheckboxGroupComponent | `tedi-checkbox-group` | `string[]` | | RadioGroupComponent | `tedi-radio-group` | `string \| null` | | ToggleComponent | `tedi-toggle` | `boolean` | @@ -16,9 +17,10 @@ TEDI form controls implement Angular's `ControlValueAccessor` interface, integra | DatePickerComponent | `tedi-date-picker` | `Date \| null` — **deprecated**, use `DateFieldComponent` | | TimeFieldComponent | `tedi-time-field` | `string \| null` (HH:mm) | | TimePickerComponent | `tedi-time-picker` | `string \| null` (HH:mm) | -| DropdownComponent | `tedi-dropdown` | `string` | | SelectComponent | `tedi-select` | `T \| T[]` | +`CheckboxComponent` (`input[type=checkbox][tedi-checkbox]`) is **not** a TEDI value accessor — it styles a native checkbox, so `[formControl]` on it is handled by Angular's built-in `CheckboxControlValueAccessor` and yields a `boolean`. Inside a managed ``, its `value` input is a `string` identity instead. `DropdownComponent` (`tedi-dropdown`) lives in `overlay/` and is not a form control — it exposes `[(value)]` but implements no `ControlValueAccessor`. + ## Basic Usage with Reactive Forms ```typescript @@ -56,7 +58,7 @@ import { - + `, }) @@ -143,6 +145,18 @@ this.control.disable(); The component combines native disabled state with form-disabled state internally. +## Search + +`SearchComponent` (`tedi-search`) is a `string` value accessor that renders its own `tedi-form-field` — do not wrap it in one. It requires `inputId`, and takes an optional trailing `button` (`{ text?, icon?, variant?, ariaLabel? }`); `searchEvent` fires on Enter or button click. + +```html + +``` + +The host is a `role="search"` landmark whose accessible name falls back to `ariaLabel` → `label` → `placeholder` → the translated "search". **When a page renders more than one `tedi-search`, give each a distinct `ariaLabel`** — identically named landmarks of the same type fail axe's `landmark-unique` rule. The visible `