import type { OpenDetail } from '../shared/events.js'; import { UiElement } from '../shared/element.js'; /** * Carbon-style dropdown: a custom list box, the counterpart of ui-select (native ``. * - State on the host for app styles: `data-open` while the list is open, `data-show-error` / * `data-show-warn` while the error / warning line shows, `data-placeholder` while the placeholder * is the shown choice (e.g. `ui-dropdown[data-open]::part(base)`). * * @cssstate open - While its list or calendar is open (also `[data-open]`) * @cssstate show-error - While its error message shows (also `[data-show-error]`) * @cssstate show-warn - While its warning message shows (also `[data-show-warn]`) * @cssstate placeholder - While the placeholder is the shown choice (also `[data-placeholder]`) * @fires change - When the user picks a different option * @fires input - Whenever `value` changes, just before `change` (as ui-combobox and ui-multi-select) * @fires ui-toggle - detail: { open } after the list opens or closes (Carbon `cds-dropdown-toggled`) * @slot label - Label content with markup; the `label` attribute is the plain-text fallback * @slot helper-text - Helper text with markup (links, bold); overrides `helper-text` * @slot warn-text - Warning text shown while `warn`; overrides `warn-text` * @slot invalid-text - Error text shown while invalid; overrides `invalid-text` * @csspart option-description - Second line of an option (`` heading * @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-inline-border-color - Border colour of the `inline` variant (default: no 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-menu-radius - Corner radius of the open list (default 0; Kanok: 8px) * @cssprop --ui-menu-border - Border around the list (default none; Kanok: a hairline) * @cssprop --ui-menu-shadow - `box-shadow` of the list (default Carbon's 0 2px 6px) * @cssprop --ui-menu-padding - Padding of the open list (default 0; Kanok: 4px, rows inset) * @cssprop --ui-menu-item-radius - Corner radius of a row (default 0; Kanok: 6px) * @cssprop --ui-menu-item-ink - Text of a row at rest (default `--ui-ink-muted`; Kanok: `--ui-ink`) * @cssprop --ui-menu-divider - Rule between rows (default `--ui-row-divider`; Kanok: none) * @cssprop --ui-menu-item-selected - Fill of the chosen row (default `--ui-surface-2`; Kanok: `--ui-highlight`) * @cssprop --ui-menu-item-selected-hover - The chosen row under the pointer (default `--ui-layer-selected-hover`; Kanok: the highlight a shade deeper) * @cssprop --ui-field-readonly-background - The box's fill when read-only (default transparent; Kanok: a faint ink tint, so read-only reads as set and never weaker than disabled) * @cssprop --ui-field-open-background - The box's fill while its list is open (default the field's hover fill; Kanok: transparent) * @cssprop --ui-fluid-background / --ui-fluid-gap - A fluid box's fill and the space under it (default the layer's fill, 0: boxes that touch; Kanok: transparent, 8px) * @cssprop --ui-menu-item-active-outline / --ui-menu-item-active-background - The keyboard-highlighted row: its ring and its fill (default focus, transparent) * @cssprop --ui-menu-item-pressed - Fill of a pressed option (default `--ui-surface-2`; Kanok: the 20% pressed tint) */ export declare class UiDropdown extends UiElement { static hostStates: readonly string[]; static readonly formAssociated = true; static readonly shadowRootOptions: ShadowRootInit; static readonly styles: import("lit").CSSResult[]; /** Visible label text; the `label` slot replaces it when markup is needed. */ label: string; /** Keep the label for screen readers but don't show it. */ hideLabel: boolean; /** Helper text under the field, shown while there is no error or warning. */ helperText: string; /** Error text shown while `invalid` or while the field fails validation. */ invalidText: string; /** Forces the error state, e.g. after server-side validation. */ invalid: boolean; /** Non-blocking warning; shown when there is no error. */ warn: boolean; /** Text of the warning shown while `warn`. */ warnText: string; /** Text shown in the field while nothing is selected (Carbon's `label`). */ 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: 'sm' | 'md' | 'lg'; /** Preferred side for the list; it flips when there is no room. */ direction: 'bottom' | 'top'; /** Disables the control; a disabled `
` ancestor does the same. */ disabled: boolean; /** Blocks form submission while the field is empty. */ required: boolean; /** Shows and submits the value but blocks changes. */ readonly: boolean; /** The options are on their way: the list shows "Loading…" and the keys pick nothing (no Carbon counterpart). */ loading: boolean; /** Carbon `FluidDropdown`: the label inside a 64px box, an error / warning inside it. `` sets it for every field inside. */ fluid: boolean; /** Label beside a compact, borderless field. */ inline: boolean; private groups; private options; private open; /** Option that holds the visual focus while the list is open; -1 = none. */ private activeIndex; private touched; /** Disabled, reset defaults, validation on submit and the name given from outside (shared by the form fields). */ private readonly formControl; private readonly trigger; private readonly menu; /** Message from `setCustomValidity()`; '' = none. */ private customValidityMessage; /** Like `.setCustomValidity()`: a non-empty message makes the field invalid (and is shown as its error once touched) until cleared with ''. */ setCustomValidity(message: string): void; private readonly localize; private readonly fieldId; /** Created on connect: there is no MutationObserver when Lit renders on the server. */ private observer?; private defaultValue; private readonly typed; connectedCallback(): void; disconnectedCallback(): void; get form(): HTMLFormElement | null; get validationMessage(): string; /** Whether the field takes part in constraint validation (not while disabled), as natively. */ get willValidate(): boolean; /** The `