import { InputSize } from '@viasat/beam-shared/components/input'; import { ThemeTypes } from '@viasat/beam-shared/utils'; import { Nullable } from '@viasat/beam-shared/utils/types'; import { default as React, ComponentPropsWithRef, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react'; import { Results } from './Search.Results'; import { IconComponentType } from '../../utils/types'; export interface SearchProps extends Omit, 'size'> { /** * Specify a callback to load or filter results when the query changes */ onSearch: (query: string) => void; /** * Specify the debounce time (in milliseconds) for the search input * @default 200 */ debounce?: number; /** * Specify placeholder text for Search */ placeholder?: string; /** * Specify Label for Search */ label?: Nullable; /** * Specify HelperText for Search */ helperText?: Nullable; /** * Specify if Search is fluid * @default false */ fluid?: boolean; /** * Specify the size of Search. * Passing a number is a deprecated, backward-compatible shorthand for the * native character width — use `htmlSize` instead. * @default 'md' */ size?: InputSize | number; /** * Specify the native input width in average character widths * (the HTML `size` attribute) */ htmlSize?: number; /** * Specify the width of Search */ width?: string; /** * Display a loading state for Search * * @default false */ loading?: boolean; /** * Adds a clear button to the Search input * * @default true */ clearable?: boolean; /** * Specify if the icon displays on the Search */ hideIcon?: boolean; /** * Specify a different icon for the Search */ icon?: IconComponentType; /** * Specify content to display before input */ contentBefore?: React.ReactNode; /** * Specify content to display after input */ contentAfter?: React.ReactNode; /** * Specify error text and display error state of a Search */ error?: boolean | string; /** * Display a message if no results are found */ noResults?: string; /** * Aria label for the clear button * @default Clear search */ clearButtonAriaLabel?: string; /** * Specify if Search displays in a disabled state * @default false */ disabled?: boolean; /** * Specify the theme of the Search. By default it inherits the theme from the parent */ theme?: ThemeTypes; /** * Specify the Search results to display in the Search dropdown * (see Search.Results) */ children?: React.ReactNode; } interface SearchComponent extends ForwardRefExoticComponent & RefAttributes> { Results: typeof Results; } export declare const Search: SearchComponent; export {};