import React from "react"; import { MarginProps } from "styled-system"; import { TagProps } from "../../__internal__/utils/helpers/tags"; import { CommonTextboxProps } from "../textbox"; import { ValidationProps } from "../../__internal__/validations"; export interface SearchEvent { target: { name?: string; id?: string; value: string; }; } export type SearchTextboxProps = Pick; export interface SearchProps extends ValidationProps, MarginProps, TagProps, SearchTextboxProps { /** Prop to specify the accessible name of the Search input. To be used when no visible label is provided */ "aria-label"?: string; /** Prop to specify the accessible name of the Search button */ searchButtonAriaLabel?: string; /** Prop for `onChange` events on the Search input */ onChange: (ev: SearchEvent) => void; /** Prop for `onClick` events on the Search button. * `onClick` events are triggered when the Search button is clicked * or when the Search input's cross icon is clicked if the `triggerOnClear` prop is set to `true`. */ onClick?: (ev: SearchEvent) => void; /** Sets whether the `onClick` action should be triggered when the Search cross icon is clicked. */ triggerOnClear?: boolean; /** * @deprecated This prop no longer has any effect. This prop will eventually be removed. * Pass a boolean to render a search Button with default text. * Pass a string to override the text in the search Button * */ searchButton?: boolean | string; /** Data tag prop bag for searchButton */ searchButtonDataProps?: TagProps; /** * @deprecated This prop no longer has any effect. This prop will eventually be removed. Use `inputWidth` instead. * Prop for specifying the width of the Search container. This value is mapped to `inputWidth`. * Leaving the `searchWidth` prop with no value will default the width to '100%' */ searchWidth?: string; /** * Prop for specifying the max-width of the Search input. * Leaving the `maxWidth` prop with no value will default the width to '100%' */ maxWidth?: string; /** @deprecated This prop no longer has any effect. This prop will eventually be removed. */ placeholder?: CommonTextboxProps["placeholder"]; /** Current value */ value: string; /** @deprecated This prop no longer has any effect. This prop will eventually be removed. `variant="dark"` is mapped to `inverse={true}` to preserve legacy behavior. */ variant?: "default" | "dark"; /** @deprecated This prop no longer has any effect. This prop will eventually be removed. Input tabindex */ tabIndex?: number; /** When set to `true`, inverts the Search input and button styling for use on darker backgrounds. */ inverse?: boolean; /** @deprecated This prop no longer has any effect. This prop will eventually be removed. */ warning?: CommonTextboxProps["warning"]; } export type SearchHandle = { /** Programmatically focus the search input. */ focus: () => void; /** Programmatically focus the search button. */ focusButton: () => void; } | null; export declare const Search: React.ForwardRefExoticComponent>; export default Search;