@transferwise/components 0.0.0-experimental-8d248e3 → 0.0.0-experimental-0b6896b

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.js"],"names":[],"mappings":"AA8EA;;;;;;;;;;;;;;;;;;;;;;gCAieC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/select/Select.js"],"names":[],"mappings":"AA8EA;;;;;;;;;;;;;;;;;;;;;;gCAmeC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../src/select/searchBox/SearchBox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAUxD,QAAA,MAAM,SAAS;;;;oJAwCd,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SearchBox.d.ts","sourceRoot":"","sources":["../../../../src/select/searchBox/SearchBox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAUxD,QAAA,MAAM,SAAS;;;;oJA0Cd,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-8d248e3",
3
+ "version": "0.0.0-experimental-0b6896b",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -78,8 +78,8 @@
78
78
  "rollup": "^3.28.1",
79
79
  "storybook": "^7.4.5",
80
80
  "@transferwise/less-config": "3.0.6",
81
- "@wise/components-theming": "0.8.4",
82
- "@transferwise/neptune-css": "14.6.1"
81
+ "@transferwise/neptune-css": "14.6.1",
82
+ "@wise/components-theming": "0.8.4"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@transferwise/icons": "^3.7.0",
@@ -16,9 +16,6 @@ export default {
16
16
  buttonProps: {
17
17
  'aria-label': 'Select month',
18
18
  },
19
- dropdownProps: {
20
- 'aria-label': 'Month options',
21
- },
22
19
  },
23
20
  },
24
21
  tags: ['autodocs'],
@@ -19,9 +19,6 @@ export default {
19
19
  buttonProps: {
20
20
  'aria-label': 'Select currency',
21
21
  },
22
- dropdownProps: {
23
- 'aria-label': 'Currency options',
24
- },
25
22
  },
26
23
  },
27
24
  tags: ['autodocs'],
@@ -15,9 +15,6 @@ export const Basic = () => {
15
15
  buttonProps: {
16
16
  'aria-label': 'Select country code',
17
17
  },
18
- dropdownProps: {
19
- 'aria-label': 'Country code options',
20
- },
21
18
  });
22
19
 
23
20
  return (
@@ -333,6 +333,8 @@ export default function Select({
333
333
  ref={optionsListReference}
334
334
  id={listboxId}
335
335
  role="listbox"
336
+ aria-orientation="vertical"
337
+ aria-activedescendant={getUniqueIdForOption(id, selected)}
336
338
  tabIndex="-1"
337
339
  className={dropdownClass}
338
340
  {...dropdownProps}
@@ -41,12 +41,6 @@ export const Basic = () => {
41
41
  return (
42
42
  <Select
43
43
  id={id}
44
- buttonProps={{
45
- 'aria-label': 'Basic button',
46
- }}
47
- dropdownProps={{
48
- 'aria-label': 'Options for basic button',
49
- }}
50
44
  size={size}
51
45
  classNames={`${hasError ? 'has-error' : ''}`}
52
46
  placeholder={placeholder}
@@ -1,11 +1,7 @@
1
- import '@testing-library/jest-dom';
2
-
3
- import { render } from '../../test-utils';
1
+ import { render, screen } from '../../test-utils';
4
2
 
5
3
  import SearchBox from '.';
6
4
 
7
- jest.mock('react-transition-group/Transition', () => jest.fn('placeholder'));
8
-
9
5
  describe('SearchBox', () => {
10
6
  const props = {
11
7
  classNames: {},
@@ -17,8 +13,8 @@ describe('SearchBox', () => {
17
13
  };
18
14
 
19
15
  it('renders', () => {
20
- const { container } = render(<SearchBox {...props} />);
16
+ render(<SearchBox {...props} />);
21
17
 
22
- expect(container).toMatchSnapshot();
18
+ expect(screen.getByRole('searchbox')).toBeInTheDocument();
23
19
  });
24
20
  });
@@ -37,6 +37,8 @@ const SearchBox = forwardRef<HTMLInputElement, Props>(
37
37
  <Input
38
38
  ref={reference}
39
39
  id={id}
40
+ role="searchbox"
41
+ inputMode="search"
40
42
  className={classnames(style('np-select-filter'))}
41
43
  placeholder={placeholder}
42
44
  value={value}
@@ -1,46 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`SearchBox renders 1`] = `
4
- <div>
5
- <li
6
- class="border-bottom"
7
- >
8
- <a
9
- class="np-select-filter-link p-a-0"
10
- >
11
- <div
12
- class="input-group"
13
- >
14
- <span
15
- class="input-group-addon input-group-addon--search"
16
- >
17
- <span
18
- aria-hidden="true"
19
- class="tw-icon tw-icon-search tw-icon tw-icon-search"
20
- data-testid="search-icon"
21
- role="presentation"
22
- >
23
- <svg
24
- fill="currentColor"
25
- focusable="false"
26
- height="24"
27
- viewBox="0 0 24 24"
28
- width="24"
29
- >
30
- <path
31
- d="m20.786 19.543-4.029-4.029c1.072-1.328 1.672-3 1.672-4.8C18.429 6.471 14.957 3 10.714 3S3 6.471 3 10.714s3.471 7.715 7.714 7.715c1.8 0 3.472-.643 4.8-1.672l4.029 4.029 1.243-1.243Zm-10.029-2.829c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6Z"
32
- />
33
- </svg>
34
- </span>
35
- </span>
36
- <input
37
- class="np-select-filter form-control np-form-control np-form-control--size-auto np-text-body-large np-input np-input--shape-rectangle"
38
- placeholder="placeholder"
39
- spellcheck="false"
40
- value="value"
41
- />
42
- </div>
43
- </a>
44
- </li>
45
- </div>
46
- `;