import type React from 'react'; import type { ClearDetail, FocusDetail, InputDetail, KeyboardDetail } from './types.js'; export interface SearchBarRef extends HTMLElement { /** Focuses the search input. */ focus(): void; /** Clears the search input value. */ clear(): void; /** Returns the current search query. */ getValue(): string; /** Sets the search query programmatically. */ setValue(value: string): void; } /** * In React, reach the imperative methods through a ref: * `const api = useRef(null)`, pass `ref={api}`, then `api.current?.focus()`. * Available: focus(), clear(), getValue(), +1 more. * * @csspart base */ export interface SearchBarOwnProps { /** * Unique identifier for the element. * @example 'example-id' */ id?: string; /** * Placeholder text shown when empty. * @example 'Enter a value' */ placeholder?: string; /** * Visible label text. * @example 'Example label' */ label: string; /** * Visual style variant. Allowed values: `outline`, `filled`, `ghost`. * @example 'outline' */ variant?: 'outline' | 'filled' | 'ghost'; /** * Corner radius style. Allowed values: `sharp`, `rounded`, `pill`. * @example 'sharp' */ shape?: 'sharp' | 'rounded' | 'pill'; /** * Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. * @example 'xs' */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Form field name for submission. * @example 'fieldName' */ name?: string; /** * Current value of the component. * @example 'example' */ value?: string; /** * Whether the component is in a loading state. * @defaultValue false * @example true */ loading?: boolean; /** * Keyboard shortcut hint displayed in the search bar (e.g. "Ctrl+K"). * @example 'example' */ shortcut?: string; /** * Collapses to an icon button and expands on click/focus. * @defaultValue false * @example true */ expandable?: boolean; /** * Disables the component, preventing interaction. * @defaultValue false * @example true */ disabled?: boolean; /** * Makes the component read-only. * @defaultValue false * @example true */ readonly?: boolean; /** * ID of the element this search bar controls (aria-controls). * @example 'example' */ controls?: string; /** * Enables a one-shot gradient sweep animation on the placeholder text when focused. 10-second cooldown between triggers. * @defaultValue false * @example true */ shimmer?: boolean; /** * Debounce delay in milliseconds before emitting search events. * @example 1 */ debounceMs?: number; /** * Fires when the committed component value or state changes. Detail: `InputDetail`. * @example (event) => console.log(event.detail.value) */ onChange?: (event: CustomEvent) => void; /** * Fires when focus enters the component. Detail: `FocusDetail`. * @example (event) => console.log(event.detail.relatedTarget) */ onFocus?: (event: CustomEvent) => void; /** * Fires when focus leaves the component. Detail: `FocusDetail`. * @example (event) => console.log(event.detail.relatedTarget) */ onBlur?: (event: CustomEvent) => void; /** * Fires when a key is pressed inside the component. Detail: `KeyboardDetail`. * @example (event) => console.log(event.detail.key) */ onKeydown?: (event: CustomEvent) => void; /** * Fires when a key is released inside the component. Detail: `KeyboardDetail`. * @example (event) => console.log(event.detail.key) */ onKeyup?: (event: CustomEvent) => void; /** * Fires when the user submits the current value. Detail: `InputDetail`. * @example (event) => console.log(event.detail.value) */ onSubmit?: (event: CustomEvent) => void; /** * Fires on each user edit before the value is committed. Detail: `InputDetail`. * @example (event) => console.log(event.detail.value) */ onInput?: (event: CustomEvent) => void; /** * Fires after the current value is cleared. Detail: `ClearDetail`. * @example (event) => console.log(event.detail.previousValue) */ onClear?: (event: CustomEvent) => void; /** CSS class applied to the Custom Element host. * @example 'my-component' */ className?: string; /** Inline styles applied to the Custom Element host. * @example { marginTop: 8 } */ style?: React.CSSProperties; } /** * Props for ``: the component's own API plus every standard DOM * attribute and native React event handler, forwarded verbatim to the * `` host — `id`, `data-*`, `aria-*`, `title`, `tabIndex`, * `slot`, `onMouseEnter`, and the rest. Own props always win over a * same-named DOM attribute. */ export type SearchBarProps = SearchBarOwnProps & Omit, keyof SearchBarOwnProps | 'children' | 'dangerouslySetInnerHTML'>; export declare const SearchBar: React.ForwardRefExoticComponent, "children" | "dangerouslySetInnerHTML" | keyof SearchBarOwnProps> & React.RefAttributes>;