import { UiElement } from '../shared/element.js'; import '../tooltip/tooltip.js'; export type SearchSize = 'sm' | 'md' | 'lg'; /** * Carbon-style search field (`Search`): a `role="search"` landmark holding a visually hidden label, * a magnifier, an `` and a clear button that appears once there is text. * Esc clears the text (and keeps focus), as in Carbon. The clear button is reachable with Tab. * * Geometry follows Carbon `_search.scss`: the field is as tall as its size (sm 32 / md 40 / lg 48), * icons are 16px, the input is padded by one field height on each side, the clear button is a * square of the field height at the end. * * Form-associated: submits `value` under `name`, resets with the form. * * `expandable` (Carbon `ExpandableSearch`): collapsed to its magnifier — a button named by a tooltip above it that shows * `label` (else the translation's "Search") — until clicked or Enter / Space, then it widens to the full width with the text box focused. Esc * clears the text, then collapses it and focuses the magnifier (as Carbon's web components); leaving it empty * collapses it too. `expanded` is the state (set it to open it yourself). * * State on the host for styling: `data-has-value` while there is text (read-only too). * * @cssstate has-value - While it holds a value (also `[data-has-value]`) * @fires input - On every keystroke * @fires change - When the value is committed (blur / Enter) or cleared * @fires ui-clear - After the clear button or Esc emptied the field * @fires ui-toggle - detail: { expanded } when an expandable search opens or collapses * @csspart base - The role=search wrapper * @csspart input - The native search input * @csspart label - The label (visually hidden, as in Carbon; shown inside the box when `fluid`) * @csspart magnifier - The search icon * @csspart clear-button - The clear button * @csspart magnifier-button - The magnifier of an expandable search * @cssprop --ui-field-border - Border on every side of the box (default none: Carbon's underline only; Kanok: a 1px outline) * @cssprop --ui-field-disabled-border-color - Border colour when disabled (default: the underline transparent) * @cssprop --ui-field-readonly-border-color - Border colour when read-only (default: a hairline underline) * @cssprop --ui-field-radius - Corner radius of the box (default 0; Kanok: 6px) * @cssprop --ui-field-background - Fill of the box (default `--ui-surface-1`; Kanok: transparent) * @cssprop --ui-label-font - Font of the label (default `--ui-font-caption`; Kanok: 14px semibold) * @cssprop --ui-label-color - Colour of the label (default `--ui-ink-muted`; Kanok: `--ui-ink`) * @cssprop --ui-icon-control-radius - Corners of its small icon buttons, their hover fill and ring (default 0; Kanok: round) */ export declare class UiSearch extends UiElement { static hostStates: readonly string[]; static readonly formAssociated = true; static readonly shadowRootOptions: ShadowRootInit; static readonly styles: import("lit").CSSResult[]; /** Accessible name of the field (visually hidden, as in Carbon). */ label: string; private readonly localize; placeholder: string; value: string; /** Reflected: form-associated elements submit under the `name` attribute. */ name: string; /** Field height: sm 32px, md 40px, lg 48px (tokens `--ui-field-height-*`). */ size: SearchSize; /** Disables the control; a disabled `
` ancestor does the same. */ disabled: boolean; autocomplete: string; /** Passed to the text box: the virtual keyboard to show (`numeric`, `decimal`, `email`, `tel`, `url`, `search`…). */ inputmode: string; /** Passed to the text box: the label of the virtual keyboard's Enter key (`search`, `send`, `next`, `done`…). */ enterkeyhint: string; /** Accessible name of the clear button. */ clearLabel: string; /** Constraint validation like ``: blocks submit and reports in the browser's bubble (Carbon Search has no error line). */ required: boolean; pattern: string; minlength?: number; maxlength?: number; /** Value can be selected and submitted but not changed; no clear button. */ readonly: boolean; /** Carbon `FluidSearch`: the label inside a 64px box. `` sets it for every field inside. */ fluid: boolean; /** Carbon `ExpandableSearch`: collapsed to its magnifier until opened. */ expandable: boolean; /** Whether an expandable search is open. */ expanded: boolean; /** Disabled, reset defaults, validation on submit and the name given from outside (shared by the form fields). */ private readonly formControl; private readonly input; /** Message from `setCustomValidity()`; '' = none. */ private customValidityMessage; /** Like `.setCustomValidity()`: a non-empty message makes the field invalid until cleared with ''. */ setCustomValidity(message: string): void; private readonly ids; private defaultValue; /** Enter in the text box submits the form, like a native input. */ private readonly onEnterKey; protected willUpdate(): void; connectedCallback(): void; disconnectedCallback(): void; get form(): HTMLFormElement | null; get validity(): ValidityState; get validationMessage(): string; /** Whether the field takes part in constraint validation (not while disabled), as natively. */ get willValidate(): boolean; /** The `