/** * Copyright 2025, SumUp Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { Locale } from '../../util/i18n.js'; import { type ResultsProps } from './components/Results/Results.js'; import { type ComboboxInputProps } from './components/ComboboxInput/ComboboxInput.js'; import type { AutocompleteInputOption } from './components/Option/Option.js'; export type AutocompleteInputProps = Omit & Pick & { /** * the selected item(s) */ value: AutocompleteInputOption | AutocompleteInputOption[] | undefined; /** * A callback function fired when the search text value changes. * Use this callback to update the `options` prop based on the user's input. */ onSearch: (value: string) => void; /** * A callback function fired when an option is selected. */ onChange: (option: AutocompleteInputOption) => void; /** * The minimum length of the search query that would trigger an `onChange` event. * @default 0 */ minQueryLength?: number; /** * Use the `immersive` to open the list in a modal view on mobile, for an immersive, focused experience. * @default 'contextual' * */ variant?: 'contextual' | 'immersive'; /** * One or more [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) * locale identifiers such as `'de-DE'` or `['GB', 'en-US']`. * When passing an array, the first supported locale is used. * Defaults to `navigator.language` in supported environments. */ locale?: Locale; /** * A custom label for the "Load more" button. */ loadMoreLabel?: ResultsProps['loadMoreLabel']; }; export declare const AutocompleteInput: import("react").ForwardRefExoticComponent & Pick & { /** * the selected item(s) */ value: AutocompleteInputOption | AutocompleteInputOption[] | undefined; /** * A callback function fired when the search text value changes. * Use this callback to update the `options` prop based on the user's input. */ onSearch: (value: string) => void; /** * A callback function fired when an option is selected. */ onChange: (option: AutocompleteInputOption) => void; /** * The minimum length of the search query that would trigger an `onChange` event. * @default 0 */ minQueryLength?: number; /** * Use the `immersive` to open the list in a modal view on mobile, for an immersive, focused experience. * @default 'contextual' * */ variant?: "contextual" | "immersive"; /** * One or more [IETF BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) * locale identifiers such as `'de-DE'` or `['GB', 'en-US']`. * When passing an array, the first supported locale is used. * Defaults to `navigator.language` in supported environments. */ locale?: Locale; /** * A custom label for the "Load more" button. */ loadMoreLabel?: ResultsProps["loadMoreLabel"]; } & import("react").RefAttributes>;