/** * Copyright IBM Corp. 2016, 2026 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { type ChangeEvent, type ElementType, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react'; type InputPropsBase = Omit, 'onChange'>; export interface SearchProps extends InputPropsBase { /** * Specify an optional value for the `autocomplete` property on the underlying * ``, defaults to "off" */ autoComplete?: string; /** * Specify an optional className to be applied to the container node */ className?: string; /** * Specify a label to be read by screen readers on the "close" button */ closeButtonLabelText?: string; /** * Optionally provide the default value of the `` */ defaultValue?: string | number; /** * Specify whether the `` should be disabled */ disabled?: boolean; /** * Specify whether or not ExpandableSearch should render expanded or not */ isExpanded?: boolean; /** * Specify a custom `id` for the input */ id?: string; /** * Provide the label text for the Search icon */ labelText: ReactNode; /** * Optional callback called when the search value changes. */ onChange?: (event: ChangeEvent) => void; /** * Optional callback called when the search value is cleared. */ onClear?(): void; /** * Optional callback called when the magnifier icon is clicked in ExpandableSearch. */ onExpand?(e: MouseEvent | KeyboardEvent): void; /** * Provide an optional placeholder text for the Search. * Note: if the label and placeholder differ, * VoiceOver on Mac will read both */ placeholder?: string; /** * A component used to render an icon. */ renderIcon?: ElementType; /** * @deprecated Specify the role for the underlying ``. * No longer needed since `` already provides the correct semantics. * This prop will be removed in the next major release of Carbon. */ role?: string; /** * Specify the size of the Search */ size?: 'sm' | 'md' | 'lg'; /** * Specify the type of the `` */ type?: string; /** * Specify the value of the `` */ value?: string | number; } declare const Search: React.ForwardRefExoticComponent>; export default Search;