import type { ControlSize } from "../../Theme/tokens/primitives/controlSizes"; /** Fully controlled search input: the caller owns `query` and clears it in `onClear`. */ export type SearchProps = { /** Defaults to `"Search..."`. */ placeholder?: string; /** Fires on every keystroke with the raw change event; no debounce. */ onSearch: (event: React.ChangeEvent) => void; /** Page-global hotkey that focuses this input; `false` removes both the listener and the hint. */ shortcut?: "Ctrl+K" | false; /** Hides the shortcut hint while keeping the hotkey. Defaults to true. */ showShortcutHint?: boolean; /** Controlled value; the clear button only shows while it is non-empty. */ query?: string; /** Enables the clear button; the caller must reset `query` itself. */ onClear?: () => void; /** @deprecated Use `onClear` — same behaviour, consistent casing. */ onclose?: () => void; /** Height on the field control scale (xs 32 · sm 38 · md 40 · lg 48px). Defaults to `sm`. */ size?: ControlSize; name?: string; /** Disables the input and hides the clear button; the hotkey still focuses it. */ isDisabled?: boolean; /** Marks the input invalid (error border + `aria-invalid`) and swaps `helperText` for `errorMessage`. */ error?: boolean; /** Shown while `error` is true. Omitting it renders no message and still hides `helperText`. */ errorMessage?: string; /** Shown under the field when there is no error; linked via `aria-describedby`. */ helperText?: string; label?: string; id?: string; /** Accessible name when there's no `label`. Defaults to `placeholder` — a Search must always have one; pass this to override or to name it over an explicit `label`. */ "aria-label"?: string; /** Shows an info icon beside the label; needs both `label` and `informationMessage` to render. */ isInformation?: boolean; /** Tooltip text for the info icon; ignored unless `isInformation` is true. */ informationMessage?: string; /** Shows the label asterisk and sets native `required` on the input. */ isRequired?: boolean; };