12
12
13
13
import { AriaButtonProps } from '@react-types/button' ;
14
14
import { AriaListBoxOptions } from '@react-aria/listbox' ;
15
+ import { AriaSearchAutocompleteProps } from '@react-types/autocomplete' ;
15
16
import { ComboBoxState } from '@react-stately/combobox' ;
16
- import { DOMAttributes } from '@react-types/shared' ;
17
+ import { DOMAttributes , KeyboardDelegate } from '@react-types/shared' ;
17
18
import { InputHTMLAttributes , RefObject } from 'react' ;
18
- import { KeyboardDelegate } from '@react-types/shared' ;
19
19
import { mergeProps } from '@react-aria/utils' ;
20
- import { SearchAutocompleteProps } from '@react-types/autocomplete' ;
21
20
import { useComboBox } from '@react-aria/combobox' ;
22
21
import { useSearchField } from '@react-aria/searchfield' ;
23
22
24
- export interface AriaSearchAutocompleteProps < T > extends SearchAutocompleteProps < T > {
25
- /** The ref for the input element. */
26
- inputRef : RefObject < HTMLInputElement > ,
27
- /** The ref for the list box popover. */
28
- popoverRef : RefObject < HTMLDivElement > ,
29
- /** The ref for the list box. */
30
- listBoxRef : RefObject < HTMLElement > ,
31
- /** An optional keyboard delegate implementation, to override the default. */
32
- keyboardDelegate ?: KeyboardDelegate
33
- }
34
-
35
23
export interface SearchAutocompleteAria < T > {
36
24
/** Props for the label element. */
37
25
labelProps : DOMAttributes ,
@@ -43,13 +31,24 @@ export interface SearchAutocompleteAria<T> {
43
31
clearButtonProps : AriaButtonProps
44
32
}
45
33
34
+ export interface AriaSearchAutocompleteOptions < T > extends AriaSearchAutocompleteProps < T > {
35
+ /** The ref for the input element. */
36
+ inputRef : RefObject < HTMLInputElement > ,
37
+ /** The ref for the list box popover. */
38
+ popoverRef : RefObject < HTMLDivElement > ,
39
+ /** The ref for the list box. */
40
+ listBoxRef : RefObject < HTMLElement > ,
41
+ /** An optional keyboard delegate implementation, to override the default. */
42
+ keyboardDelegate ?: KeyboardDelegate
43
+ }
44
+
46
45
/**
47
46
* Provides the behavior and accessibility implementation for a search autocomplete component.
48
47
* A search autocomplete combines a combobox with a searchfield, allowing users to filter a list of options to items matching a query.
49
48
* @param props - Props for the search autocomplete.
50
49
* @param state - State for the search autocomplete, as returned by `useSearchAutocomplete`.
51
50
*/
52
- export function useSearchAutocomplete < T > ( props : AriaSearchAutocompleteProps < T > , state : ComboBoxState < T > ) : SearchAutocompleteAria < T > {
51
+ export function useSearchAutocomplete < T > ( props : AriaSearchAutocompleteOptions < T > , state : ComboBoxState < T > ) : SearchAutocompleteAria < T > {
53
52
let {
54
53
popoverRef,
55
54
inputRef,
0 commit comments