@sandlada/mdc
Version:
@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.
82 lines • 3.38 kB
TypeScript
/**
* @license
* Copyright 2026 Kai-Orion & Sandlada
* SPDX-License-Identifier: MIT
*/
import { LitElement, type TemplateResult } from 'lit';
import { type FieldVariant, type FloatingLabelBehavior, type IField } from '../field.interface';
declare const BaseField_base: Omit<typeof LitElement, "prototype"> & (new () => LitElement & object & import("../../../utils/behaviors/element-internals").WithElementInternals & import("../../focus-ring/focus-ring-options.mixin").IMixinFocusRingOption);
/**
* Abstract base for `mdc-field`. Owns the chrome rendering, label/state,
* slot detection, and click-to-label wiring. Subclasses define the public tag
* and the default variant.
*
* Mixin composition (per CLAUDE.md rules, abstract → concrete):
* - `mixinDelegatesAria` — passes ARIA attributes from host to inner label / input
* - `mixinElementInternals` — exposes `[internals]` for future textfield integration
* - `mixinFocusRingOptions` — provides the outer focus ring via `renderFocusRing()`
*
* State is **manual** — the consumer (e.g. `mdc-textfield`) sets `focused`,
* `populated`, `invalid`, and `disabled` in response to events from the input
* child. `mdc-field` deliberately does not listen to focus / input / invalid
* events itself, so it remains agnostic to the input child type.
*
* @version
* Material Design 3
*
* @link
* https://m3.material.io/components/text-fields/overview
*/
export declare abstract class BaseField extends BaseField_base implements IField {
static styles: import("lit").CSSResult[];
variant: FieldVariant;
label: string;
supportingText: string;
errorText: string;
prefixText: string;
suffixText: string;
counterText: string;
disabled: boolean;
required: boolean;
noAsterisk: boolean;
populated: boolean;
focused: boolean;
invalid: boolean;
floatingLabelBehavior: FloatingLabelBehavior;
alignEnd: boolean;
multiline: boolean;
resizable: boolean;
protected hasLeadingIcon: boolean;
protected hasTrailingIcon: boolean;
protected hasPrefix: boolean;
protected hasSuffix: boolean;
protected hasSupportingText: boolean;
protected hasErrorText: boolean;
protected hasCounter: boolean;
private readonly assignedLeadingIcons;
private readonly assignedTrailingIcons;
private readonly assignedPrefixElements;
private readonly assignedSuffixElements;
private readonly assignedSupportingTextElements;
private readonly assignedErrorTextElements;
private readonly assignedCounterElements;
/**
* Whether the label should float to the top resting position.
*/
get shouldLabelFloat(): boolean;
protected getRenderClasses(): Record<string, boolean | string>;
protected render(): TemplateResult;
private readonly handleLeadingIconSlotChange;
private readonly handleTrailingIconSlotChange;
private readonly handlePrefixSlotChange;
private readonly handleSuffixSlotChange;
private readonly handleDefaultSlotChange;
private readonly handleSupportingTextSlotChange;
private readonly handleErrorTextSlotChange;
private readonly handleCounterSlotChange;
private readonly handleContainerClick;
private readonly handleLabelClick;
getDefaultSlotFocusable(): HTMLElement | null;
}
export {};
//# sourceMappingURL=base-field.d.ts.map