import React from 'react'; import { Size } from '../types'; import { DropdownItem } from '../Dropdown'; export type SearchBarProps = { /** * Required. The ID of the search bar. */ id: string; /** * Optional. The current search term in the search bar. */ searchTerm?: string; /** * Required. A function to be called when the search term changes. * It should take a string representing the new search term. */ setSearchTerm: (term: string) => void; /** * Required. A function to be called when the enter key is pressed in the search bar. * It should take an event object as a parameter. */ enterSearch: (e: any) => void; /** * Required. A function to be called when the search term is removed. * It should take an event object as a parameter. */ removeSearch: (e: any) => void; /** * Optional. The placeholder text to be displayed in the search bar when it is empty. */ placeholder?: string; /** * Optional. The label for the search button in the search bar. */ performSearchLabel?: string; /** * Optional. A boolean indicating whether the search bar is disabled. */ disabled?: boolean; /** * Optional. The validation message to be displayed when the search bar is in an error state. */ validationMessage?: string; /** * Optional. A function to be called when a keydown event occurs in the search bar. */ onKeyDown?: (e: React.KeyboardEvent) => void; /** * Optional. The size of the search bar. Can be 'Small' or 'Medium'. */ size?: Size.Small | Size.Medium; /** * Optional. The margin of the search bar. Can be any valid CSS margin value. */ margin?: string; /** * Optional. A boolean indicating whether the dropdown in the search bar should be shown. */ showDropdown?: boolean; /** * Optional. The icon for the dropdown button in the search bar. */ dropdownButtonIcon?: React.ReactNode; /** * Optional. The label for the dropdown button in the search bar. */ dropdownButtonLabel?: string; /** * Optional. The variant of the dropdown button in the search bar. Can be 'primary', 'secondary', or 'tertiary'. */ dropdownButtonVariant?: 'primary' | 'secondary' | 'tertiary'; /** * Optional. A function to be called when the dropdown button in the search bar is clicked. */ dropdownButtonAction?: () => boolean | void | undefined; /** * Optional. An array of DropdownItem objects representing the items in the dropdown. */ searchList?: DropdownItem[]; /** * Optional. A function to be called when an item is added to the dropdown. * It should take a DropdownItem object as a parameter. */ addToSearchList?: (e: DropdownItem) => void; /** * Optional. A boolean indicating whether the dropdown in the search bar is scrollable. */ dropdownScrollable?: boolean; }; declare const SearchBar: React.FunctionComponent; export default SearchBar;