import { EventEmitter } from '../../stencil-public-runtime'; import type { SearchInputRectangularChangeDetail, SearchInputRectangularSearchDetail, SearchInputRectangularSize, SearchInputRectangularVariant } from './mud-search-input-rectangular.types'; /** * Search Input (rectangular) — single-line search-entry control. * * Pattern B (atom-interactive, form-associated): renders its own * `` inside shadow DOM. Adds a leading magnifying-glass * icon and an optional trailing clear `×` button that appears whenever the * control carries a value. Visual primitives (border, focus ring, label, * helper / error, sizes, states) are shared with `mud-input`; specific * affordances (icon-start, icon-end-clear, submit-button) live in the * `--search-input-rectangular-*` token namespace. * * Rectangular shape is the default sibling of `mud-search-input-circular` * (pill). The two ship as distinct components per the Figma component-set * separation in the Republic of Moldova Unified Design System library. * * Optional axes per Figma master `933:29099`: * - `loading` — async query is in flight; a trailing spinner appears next to * the value/placeholder and the control is announced as `aria-busy`. * - `with-button` — adds a trailing brand-blue submit button that fires * `mudSearch` on click. Coexists with the clear button and the loading * spinner. * * @element mud-search-input-rectangular * * @slot label - Rich label content, replaces the `label` prop when present. * @slot helper - Rich helper / hint content, replaces the `helper-text` prop. Hidden when invalid + error-text is shown. * @slot icon-start - Leading icon override. Defaults to `mud-icon[name="search"]`. * @slot icon-end - Trailing slot. Suppresses the built-in clear `×` button when content is assigned here. */ export declare class MudSearchInputRectangular { /** * Color treatment. `destructive` is forced when `invalid` is set. * @default 'default' */ variant: SearchInputRectangularVariant; /** * Visual size rung. * @default 'md' */ size: SearchInputRectangularSize; /** * Disables interactivity. The internal control receives `aria-disabled` and * the native `disabled` attribute. * @default false */ disabled: boolean; /** * Marks the field as mandatory. Adds a red asterisk to the label and sets * `aria-required` on the internal control. * @default false */ required: boolean; /** * Renders the field read-only. The control remains focusable; the clear * affordance is suppressed. * @default false */ readonly: boolean; /** * Forces destructive visuals regardless of `variant`. Sets `aria-invalid`. * Use together with `errorText` to surface the message. * @default false */ invalid: boolean; /** * Shows the trailing clear `×` button when a value is present. Set to * `false` to suppress the affordance entirely (useful for read-only or * always-on filters). * @default true */ clearable: boolean; /** * Indicates an in-flight query. Keeps the leading magnifying-glass icon as * the role indicator and reveals a trailing brand-coloured `mud-spinner` * next to the value; the clear `×` is suppressed while the query is in * flight and the control is announced as `aria-busy`. The field stays * focusable; emitting `mudSearch` while loading is the consumer's * responsibility (typically debounced). * @default false */ loading: boolean; /** * Renders a trailing brand-blue submit button (the Figma "Button=True" * axis). Clicking the button — or pressing Enter inside the input — * dispatches `mudSearch` with the current value. When the field is empty * or disabled, the button enters a disabled visual state and does not * fire the event. * @default false */ withButton: boolean; /** * Accessible label for the trailing submit button. Defaults to Romanian * "Caută" per the institutional voice. * @default 'Caută' */ submitLabel: string; /** * Current value of the control. Reflects to the host attribute. * @default '' */ value: string; /** Form-control `name`. Used during form submission. */ name?: string; /** Placeholder shown when the control is empty. */ placeholder?: string; /** Plain-text label. Use the `label` slot for richer content. */ label?: string; /** Plain-text helper / hint shown below the control. */ helperText?: string; /** * Plain-text error message shown below the control when `invalid` is set. * When present it replaces `helperText` and pairs with the error icon. */ errorText?: string; /** * Icon name for the leading icon (rendered via the local SVG library). * Override by providing an element to the `icon-start` slot. * @default 'search' */ iconName: string; /** * Accessible label for the trailing clear button. Defaults to Romanian * "Șterge" per the institutional voice. * @default 'Șterge' */ clearLabel: string; /** Native `autocomplete` attribute forwarded to the internal control. */ autocomplete?: string; /** Native `maxlength` constraint. */ maxLength?: number; /** Native `minlength` constraint. */ minLength?: number; /** * Accessible name. Mirrors to the internal control's `aria-label` when no * visible label is present. Captured into `resolvedAriaLabel` on mount and * the host attribute is stripped to avoid Stencil's auto-reflection loop. */ ariaLabel?: string; private hasLabelSlot; private hasHelperSlot; private hasIconStartSlot; private hasIconEndSlot; private isFocused; private fieldsetDisabled; private resolvedAriaLabel?; host: HTMLMudSearchInputRectangularElement; internals: ElementInternals; /** Fires on every keystroke. `detail.value` is the current control value. */ mudInput: EventEmitter; /** Fires when the value is committed (typically on `blur`). `detail.value` is the committed value. */ mudChange: EventEmitter; /** Fires when the user submits the query (Enter key). `detail.value` is the submitted query. */ mudSearch: EventEmitter; /** Fires when the value is cleared by the user (clear button or Escape key). */ mudClear: EventEmitter; /** Fires when the internal control gains focus. */ mudFocus: EventEmitter; /** Fires when the internal control loses focus. */ mudBlur: EventEmitter; private readonly instanceId; private readonly labelId; private readonly helperId; private readonly errorId; private initialValue; private nativeEl?; componentWillLoad(): void; /** * Stencil auto-reflects `@Prop()` values back onto the host attribute. For * `aria-label` that creates an observer loop (host attr → prop → host attr). * Capture the consumer-provided value into a state field, then strip the * attribute so the loop never fires. */ private captureAriaLabel; /** * Reflects required + value into `ElementInternals` so the host participates * in native form validation. Anchored on the native input so a11y focus * lands on the visible control. */ private syncValidity; validateVariant(next: SearchInputRectangularVariant): void; validateSize(next: SearchInputRectangularSize): void; handleValueChange(next: string): void; handleRequiredChange(): void; handleAriaLabelChange(next: string | undefined): void; formDisabledCallback(disabled: boolean): void; formResetCallback(): void; formStateRestoreCallback(state: string | File | FormData | null): void; private onLabelSlotChange; private onHelperSlotChange; private onIconStartSlotChange; private onIconEndSlotChange; private slotHasContent; private handleInput; private handleChange; private handleFocus; private handleBlur; private handleKeyDown; private handleClearClick; private handleSubmitClick; private clearValue; private isInert; private resolvedVariant; private hasVisibleLabel; private hasErrorMessage; private hasHelperMessage; private describedBy; private showClearButton; render(): any; }