@@ -27,7 +27,7 @@ export function AutocompleteRoot<ItemValue>(
2727 * The items to be displayed in the list.
2828 * Can be either a flat array of items or an array of groups with items.
2929 */
30- items ?: readonly ItemValue [ ] ;
30+ items ?: readonly ItemValue [ ] | undefined ;
3131 } ,
3232) : React . JSX . Element ;
3333export function AutocompleteRoot < ItemValue > (
@@ -181,64 +181,69 @@ export interface AutocompleteRootProps<ItemValue>
181181 * - `none`: items are static (not filtered), and the input value will not change based on the active item.
182182 * @default 'list'
183183 */
184- mode ?: 'list' | 'both' | 'inline' | 'none' ;
184+ mode ?: ( 'list' | 'both' | 'inline' | 'none' ) | undefined ;
185185 /**
186186 * Whether the first matching item is highlighted automatically.
187187 * - `true`: highlight after the user types and keep the highlight while the query changes.
188188 * - `'always'`: always highlight the first item.
189189 * @default false
190190 */
191- autoHighlight ?: boolean | 'always' ;
191+ autoHighlight ?: ( boolean | 'always' ) | undefined ;
192192 /**
193193 * Whether the highlighted item should be preserved when the pointer leaves the list.
194194 * @default false
195195 */
196- keepHighlight ?: boolean ;
196+ keepHighlight ?: boolean | undefined ;
197197 /**
198198 * Whether moving the pointer over items should highlight them.
199199 * @default true
200200 */
201- highlightItemOnHover ?: boolean ;
201+ highlightItemOnHover ?: boolean | undefined ;
202202 /**
203203 * The uncontrolled input value of the autocomplete when it's initially rendered.
204204 *
205205 * To render a controlled autocomplete, use the `value` prop instead.
206206 */
207- defaultValue ?: AriaCombobox . Props <
208- React . ComponentProps < 'input' > [ 'defaultValue' ] ,
209- 'none'
210- > [ 'defaultInputValue' ] ;
207+ defaultValue ?:
208+ | AriaCombobox . Props < React . ComponentProps < 'input' > [ 'defaultValue' ] , 'none' > [ 'defaultInputValue' ]
209+ | undefined ;
211210 /**
212211 * The input value of the autocomplete. Use when controlled.
213212 */
214- value ?: AriaCombobox . Props < React . ComponentProps < 'input' > [ 'value' ] , 'none' > [ 'inputValue' ] ;
213+ value ?:
214+ | AriaCombobox . Props < React . ComponentProps < 'input' > [ 'value' ] , 'none' > [ 'inputValue' ]
215+ | undefined ;
215216 /**
216217 * Event handler called when the input value of the autocomplete changes.
217218 */
218- onValueChange ?: ( value : string , eventDetails : AutocompleteRootChangeEventDetails ) => void ;
219+ onValueChange ?:
220+ | ( ( value : string , eventDetails : AutocompleteRootChangeEventDetails ) => void )
221+ | undefined ;
219222 /**
220223 * Whether clicking an item should submit the autocomplete's owning form.
221224 * By default, clicking an item via a pointer or <kbd>Enter</kbd> key does not submit the owning form.
222225 * Useful when the autocomplete is used as a single-field form search input.
223226 * @default false
224227 */
225- submitOnItemClick ?: AriaCombobox . Props < ItemValue , 'none' > [ 'submitOnItemClick' ] ;
228+ submitOnItemClick ?: AriaCombobox . Props < ItemValue , 'none' > [ 'submitOnItemClick' ] | undefined ;
226229 /**
227230 * When the item values are objects (`<Autocomplete.Item value={object}>`), this function converts the object value to a string representation for both display in the input and form submission.
228231 * If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
229232 */
230- itemToStringValue ?: ( itemValue : ItemValue ) => string ;
233+ itemToStringValue ?: ( ( itemValue : ItemValue ) => string ) | undefined ;
231234 /**
232235 * A ref to imperative actions.
233236 * - `unmount`: When specified, the autocomplete will not be unmounted when closed.
234237 * Instead, the `unmount` function must be called to unmount the autocomplete manually.
235238 * Useful when the autocomplete's animation is controlled by an external library.
236239 */
237- actionsRef ?: React . RefObject < AutocompleteRootActions > ;
240+ actionsRef ?: React . RefObject < AutocompleteRootActions > | undefined ;
238241 /**
239242 * Event handler called when the popup is opened or closed.
240243 */
241- onOpenChange ?: ( open : boolean , eventDetails : AutocompleteRootChangeEventDetails ) => void ;
244+ onOpenChange ?:
245+ | ( ( open : boolean , eventDetails : AutocompleteRootChangeEventDetails ) => void )
246+ | undefined ;
242247 /**
243248 * Callback fired when an item is highlighted or unhighlighted.
244249 * Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
@@ -247,10 +252,12 @@ export interface AutocompleteRootProps<ItemValue>
247252 * - `'pointer'`: the highlight changed due to pointer hovering.
248253 * - `'none'`: the highlight changed programmatically.
249254 */
250- onItemHighlighted ?: (
251- highlightedValue : ItemValue | undefined ,
252- eventDetails : AutocompleteRootHighlightEventDetails ,
253- ) => void ;
255+ onItemHighlighted ?:
256+ | ( (
257+ highlightedValue : ItemValue | undefined ,
258+ eventDetails : AutocompleteRootHighlightEventDetails ,
259+ ) => void )
260+ | undefined ;
254261}
255262
256263export namespace AutocompleteRoot {
0 commit comments