@moda/om 21.6.7 → 21.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda/om",
3
- "version": "21.6.7",
3
+ "version": "21.6.8",
4
4
  "description": "Moda Operandi design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -8,11 +8,11 @@ describe('SearchInput', () => {
8
8
  it('clears the input when the button is clicked', async () => {
9
9
  render(<SearchInput value='Hello' />);
10
10
 
11
- expect(screen.getByRole('textbox')).toHaveValue('Hello');
11
+ expect(screen.getByRole('searchbox')).toHaveValue('Hello');
12
12
 
13
13
  await userEvent.click(screen.getByRole('button'));
14
14
 
15
- expect(screen.getByRole('textbox')).toHaveValue('');
15
+ expect(screen.getByRole('searchbox')).toHaveValue('');
16
16
  });
17
17
 
18
18
  it('calls onChange when typing', async () => {
@@ -20,7 +20,7 @@ describe('SearchInput', () => {
20
20
 
21
21
  render(<SearchInput value='' onChange={onChange} />);
22
22
 
23
- await userEvent.type(screen.getByRole('textbox'), 'Greetings');
23
+ await userEvent.type(screen.getByRole('searchbox'), 'Greetings');
24
24
 
25
25
  expect(onChange).toHaveBeenCalledWith('Greetings');
26
26
 
@@ -52,11 +52,12 @@ export const SearchInput: React.FC<SearchInputProps> = ({
52
52
 
53
53
  return (
54
54
  <div className={classNames('SearchInput', className)}>
55
- <div className='SearchInput__icon'>
55
+ <div className='SearchInput__icon' aria-hidden='true'>
56
56
  <SearchIcon height={`${searchIconSize}px`} width={`${searchIconSize}px`} />
57
57
  </div>
58
58
 
59
59
  <TextInput
60
+ type='search'
60
61
  className={classNames('SearchInput__input', {
61
62
  'SearchInput__input--round-borders': roundBorders,
62
63
  'SearchInput__input--no-borders': noBorders
@@ -68,8 +69,13 @@ export const SearchInput: React.FC<SearchInputProps> = ({
68
69
  />
69
70
 
70
71
  {controlledValue && (
71
- <Clickable className='SearchInput__clear' onClick={handleClear} type='reset'>
72
- <ExitIcon />
72
+ <Clickable
73
+ className='SearchInput__clear'
74
+ onClick={handleClear}
75
+ type='reset'
76
+ aria-label='Clear search'
77
+ >
78
+ <ExitIcon aria-hidden='true' />
73
79
  </Clickable>
74
80
  )}
75
81
  </div>