sl-design-system / components

SL Design System
https://sanomalearning.design/
Apache License 2.0
35 stars 3 forks source link

[V1] Search field #240

Open DanielleRameau opened 1 year ago

DanielleRameau commented 1 year ago

User Story

As a Sanoma Learning Design System user, I want a user-friendly Search Field Component that can effectively handle various use cases across our educational products. This Search Field Component should be adaptable to convey:

Definition

The search Field consists of a variation of an input field specific to filtering content in a UI close to it.

Key Points

Acceptance Criteria

search_input-elements
Elements Name Optional
Search icon (Icon) No
Placeholder No
Clear Button Yes
Search Button Yes

States

Accessibility

Behaviours

A11y - Keyboard Navigation:

Figma Links

Reference Links

### Tasks
- [ ] https://github.com/sl-design-system/components/issues/1140
- [ ] https://github.com/sl-design-system/components/issues/1144
- [ ] https://github.com/sl-design-system/components/issues/1146
- [ ] https://github.com/sl-design-system/components/issues/1147
- [ ] https://github.com/sl-design-system/components/issues/1148
### CFA Interest
- [ ] TEAS
- [ ] This component is needed for data grid (data grid has a CFA interest of 10)
anna-lach commented 2 months ago

Accessibility:

As Anna Karoń suggests the best way would be to use <search> HTML element (https://www.scottohara.me/blog/2023/03/24/search-element.html, https://html.spec.whatwg.org/multipage/grouping-content.html#the-search-element). aria-label is also necessary, optionally we can hide <label> visually, but the effect should be the same. We need to remember about translations in aria-label/label as well. 😊