import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraAppearance,LyraSize}from'../../../internal/variants.js';import{type LyraFormValidator}from'../../forms/form-validator.js';export type LyraKnownDateField='day'|'month'|'year';export type LyraKnownDateAppearance=Extract; /** The three raw field strings exposed by ``. */ export interface LyraKnownDateParts{day:string;month:string;year:string;}export interface LyraKnownDateEventDetail{ /** Canonical ISO 8601 date (`YYYY-MM-DD`), or `''` while incomplete/invalid. Mirrors `value`. */ value:string; /** Per-field raw text as currently typed, always present even while incomplete. */ day:string;month:string;year:string; /** Which field the user was last editing when this event fired. */ field:LyraKnownDateField;}export interface LyraKnownDateEventMap{'lr-invalid':CustomEvent;input:InputEvent&{readonly detail:LyraKnownDateEventDetail;};change:Event&{readonly detail:LyraKnownDateEventDetail;};focus:CustomEvent;blur:CustomEvent;}declare class LyraKnownDateBase extends LyraElement{}declare const LyraKnownDate_base:typeof LyraKnownDateBase&(new(...args:any[])=>import("../../../lyra.js").FormAssociatedInterface &import("../../../internal/form-associated.js").FormAssociatedSubclassInterface); /** * `` — a date a user already knows (a birthdate, a passport * issue/expiry date) collected as three plain, labeled day/month/year number * fields in the locale's natural field order, rather than a calendar popup. * Form-associated; the submitted form value is always canonical ISO 8601 * (`YYYY-MM-DD`), or `''` while any field is blank or the combination isn't a * real calendar date. Mirrors Web Awesome's `wa-known-date` API surface under * `lr-`. `appearance` and `pill` mirror its field treatments, while `size` uses this library's * shared `2xs`–`xl` ladder and also accepts the upstream `small`/`medium`/`large` spellings — the * same ladder every other Lyra form control sits on. The shared `FormAssociated` surface supplies * the upstream `form` owner contract. * * A field's own `` shows exactly what was typed (never reformatted or * reverted) -- only the composite `value` is zero-padded. Auto-advance * (typing a field's last digit moves focus to the next field) and * backspace-to-previous-field-when-empty are this library's own additions on * top of Web Awesome's bare typing model, which documents no auto-advance; * don't remove them to "restore" WA parity. Arrow-key field-to-field * navigation at a field's text boundary is RTL-aware: the *physical* key that * means "toward the next field" flips under an inherited `dir="rtl"`, while * the field order itself (locale-derived) does not. Locale digits such as * Arabic-Indic and Persian numerals are accepted and normalized to the * canonical ASCII digits used by the ISO form value. * * Pressing Enter in any of the three fields performs the implicit form submission a native * `` would (see `internal/submit-on-enter.ts` — the fields live in a shadow root and have no * form owner, so the platform can never do it here), flushing any pending `change` first. * * No resizable text-editing surface exists (three fixed-width digit fields), * so resize forwarding doesn't apply, and `spellcheck`/`autocapitalize`/ * `autocorrect`/`wrap` don't meaningfully apply to 2–4-digit numeric fields * either -- the same carve-out `lr-input[type="number"]` already documents. * Visible validation-message changes are appended to a pre-mounted light-DOM assertive live * region. Hidden, inert, CSS-hidden, and `aria-hidden` slotted error content is excluded from the * announcement text, and no error is announced while the control or a composed ancestor is * hidden. Initial and reconnected validation state remains silent. * * Host `aria-describedby` resolves external guidance onto the aggregate date fieldset; * each native field retains its local hint/error guidance. Removed label/hint attributes * render as absent. Disabled native fields retain their resting border on hover or press. * * @customElement lr-known-date * @event {InputEvent & { readonly detail: LyraKnownDateEventDetail }} input - A bubbling, composed * native input event fired on every keystroke in * any field, retaining the originating edit's `inputType`. Its compatibility `detail.value` is * the canonical ISO date * only once all three fields resolve to a real calendar date, otherwise `''`; `detail.day`/ * `month`/`year` always carry the live raw typed text. * @event {Event & { readonly detail: LyraKnownDateEventDetail }} change - A bubbling, composed * native change event fired when a field loses focus * (including a Tab/auto-advance move away from it) * and the composite value has newly transitioned to a different complete date, or from complete * back to incomplete/blank. Programmatic `value`/`valueAsDate` assignment stays silent. * @event focus - Re-dispatched, bubbling and composed, when any of the three internal fields * receives focus (native `focus` doesn't bubble or cross a shadow boundary). * @event blur - Re-dispatched, bubbling and composed, once when focus leaves all three internal * fields for something outside the control -- not once per internal field-to-field Tab. * @event lr-invalid - The composite date failed a validity check; cancelable. Calling * `preventDefault()` also cancels the native `invalid` event it aliases, suppressing the * browser's own validation bubble and `reportValidity()`'s focus/scroll. * @slot label - Custom label/legend content, alongside the `label` attribute. * @slot hint - Custom hint content, alongside the `hint` attribute. * @slot error - Custom error content, alongside the `errorText` attribute. * @csspart base - Compatibility name for the outer wrapper; use `known-date`. * @csspart known-date - The outer wrapper around legend, fieldset, hint, and error. It is the same * node as `base` and `form-control`. * @csspart form-control - The outer wrapper. It is the same node as `base` and `known-date`. * @csspart fieldset - The `
` grouping the three fields. * @csspart legend - The `` element. * @csspart form-control-label - The visible label wrapper inside the legend. * @csspart label - Deprecated in 8.0.0; compatibility alias for `form-control-label`. Web Awesome * still publishes its own deprecated `label` part on ``, so this alias stays on * the same node until upstream drops it. * @csspart fields - The row wrapping the three field blocks. * @csspart form-control-input - Alias on the fields row matching other form controls. * @csspart field - Each field block (label + input), repeated three times; distinguished by * `data-field="day"|"month"|"year"`. * @csspart field-day - Added to the day field block. * @csspart field-month - Added to the month field block. * @csspart field-year - Added to the year field block. * @csspart field-input - The native per-field ``, repeated * three times; distinguished by `data-field="day"|"month"|"year"`. * @csspart field-label - The small visible per-field text label ("Day"/"Month"/"Year"). * @csspart hint - The hint message. * @csspart error - The validation message. * @cssprop [--lr-known-date-field-padding-block=var(--lr-form-control-padding-block)] - Block * padding of each `field-input`; its private default follows `size` through the shared ladder. * @cssprop [--lr-known-date-field-padding-inline=var(--lr-form-control-padding-inline)] - Inline * padding of each `field-input`; its private default follows `size` through the shared ladder. * @cssprop [--lr-known-date-field-font-size=var(--lr-form-control-font-size)] - Font size of each * `field-input`; its private default follows `size` through the shared ladder. * @cssprop [--lr-known-date-field-min-height=max(var(--lr-form-control-height),var(--lr-size-24px))] * - Minimum block size of each `field-input`; its private default follows `size` * (`2xs`/`xs`→`24px`, * `s`→`1.875rem`, `m`→`2.5rem`, `l`→`3rem`, `xl`→`3.5rem`) -- the same shared control-height * ladder `lr-input`/`lr-date-input` sit on, so a birthdate field in a form row beside those * controls renders at the same height. The `max()` floors the two smallest tiers at WCAG 2.2 * SC 2.5.8's 24px pointer-target minimum. At the small tiers the floor exceeds the field's own * content height and actively pins the rendered box; at `l`/`xl` the content height stays under * it, so those two tiers are unaffected. An inherited or direct public value wins in every tier. * @cssprop --lr-known-date-field-height - Exact block size of each `field-input`. Undeclared by * default, so the field grows to fit its content, floored by `--lr-known-date-field-min-height`. * Set it to pin a fixed height. * @cssprop [--lr-known-date-field-gap=var(--lr-space-s)] - Gap between the three field blocks. * @cssprop [--lr-known-date-day-field-width=var(--lr-size-3-5em)] - Inline size of the day field. * @cssprop [--lr-known-date-month-field-width=var(--lr-size-3-5em)] - Inline size of the month * field. * @cssprop [--lr-known-date-year-field-width=var(--lr-size-5em)] - Inline size of the year field. * @cssprop [--lr-known-date-invalid-border-color=var(--lr-color-danger)] - Border color of each * `field-input` while `:host([data-invalid])` is set. * @cssprop [--lr-form-control-required-content=' *'] - The required-field marker, rendered after * the `legend` box. Set it to `''` to suppress the marker, or to any other quoted * string (`' (required)'`, a localized word) to replace it. Caller-supplied content, so it is never * localized here. * @cssprop [--lr-form-control-required-color=var(--lr-color-danger)] - Color of that marker, * retunable without touching any other danger-coloured surface. * @cssprop [--lr-form-control-required-offset=0] - Inline space between the label text and the * marker. * @cssstate blank - The composite value is empty or incomplete. * @cssstate disabled - The control is disabled directly or through an ancestor fieldset. * @status stable * @since 4.0.0 */ export declare class LyraKnownDate extends LyraKnownDate_base{ /** Public WA-compatible intrinsic validator catalog. */ static get validators():LyraFormValidator[];static styles:import("lit").CSSResultGroup[];static properties:{min:{reflect:boolean;noAccessor:boolean;};max:{reflect:boolean;noAccessor:boolean;};readonly:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};parts:{attribute:boolean;noAccessor:boolean;};}; /** Control density, on the library's shared six-step ladder — `'m'` by default. Scales each * field's height floor, padding, font size and corner radius together, so a birthdate field * lines up with the `lr-input`/`lr-date-input` beside it at the same declared size. * `'small'`/`'medium'`/`'large'` are accepted as synonyms of `'s'`/`'m'`/`'l'`. Every tier * resolves to at least the 24px pointer-target floor, so even `'2xs'` stays usable. */ size:LyraSize; /** The field fill treatment. */ appearance:LyraKnownDateAppearance; /** Draws each field with fully rounded corners. */ pill:boolean;label:string;hint:string;errorText:string; /** BCP-47 override for field order and field-label localization sampling. Empty string falls * back to `this.effectiveLocale` (inherited `lang`/ancestor), exactly like `lr-date-input`'s * `locale`. Redeclared (non-reflecting) over `LyraElement`'s own reflecting `locale` for the * same reason `lr-date-input` does. */ locale:string; /** Browser autofill family. `'bday'` expands into the three field-specific birthday tokens; * `'on'`/`'off'` apply to every field, and any other non-empty token is forwarded only to the * year field, matching the mirrored control. */ autocomplete:string; /** SSR slot-presence hint for a slotted label. Runtime slot detection remains automatic. */ withLabel:boolean; /** SSR slot-presence hint for slotted hint content. Runtime slot detection remains automatic. */ withHint:boolean; /** Overrides the fieldset's computed accessible name (normally the ``'s content). Applied * as `aria-label` on the `part="fieldset"` element, which owns the role -- not just the host. */ accessibleLabel:string|null; /** Visible + accessible day label. Omission or attribute removal localizes the default; supplied empty text stays empty. */ dayLabel?:string; /** Visible + accessible month label. Omission or attribute removal localizes the default; supplied empty text stays empty. */ monthLabel?:string; /** Visible + accessible year label. Omission or attribute removal localizes the default; supplied empty text stays empty. */ yearLabel?:string;private _parts;private touched;private hasLabelSlot;private hasHintSlot;private hasErrorSlot;private _min;private _max;private _readonly; /** The last value a `change` event was fired for (or the constructed initial value) -- lets * `commitChangeIfNeeded()` fire `change` only on a real transition, matching `lr-date-input`'s * own "input fires more often than change" contract. */ private lastCommittedValue;private lastEditedField;private errorAnnouncementSink?;private errorObserver?;private externalDescriptionLease?;private errorAnnouncementsArmed;private lastVisibleError;private connectionGeneration;private readonly onForwardedSlotChange;private readonly hintId;private readonly errorId;private readonly dayId;private readonly monthId;private readonly yearId; /** Hidden native date mirror used by integrations that inspect native constraints directly. * Stays a writable `@query` field rather than a readonly `get`: `wa-known-date` declares it * writable, and check-pinned-upstream-manifests treats a readonly-vs-writable difference on a * mirrored member as an `unsupported` surface drift -- a release blocker. */ valueInput:HTMLInputElement;private validationTargetOverride?;constructor();connectedCallback():void;private observeErrorNode;private bindErrorObserverTargets;disconnectedCallback():void;adoptedCallback():void;private syncExternalDescription;private releaseExternalDescription;get min():string;set min(next:string);get max():string;set max(next:string);get readonly():boolean;set readonly(next:boolean); /** The three raw day/month/year field strings. Assigning a complete valid set updates `value`. */ get parts():LyraKnownDateParts;set parts(next:LyraKnownDateParts);private setParts;get value():string; /** Normalizes an assignment to the canonical ISO date or `''`, and repopulates the three raw * field texts to match -- a declarative `value="2007-3-27"` (non-padded) or a calendar-invalid * literal (`"2007-02-30"`) sanitizes to `''`, same strict-ISO gate as `lr-date-input`'s * `parseStrictISO()`. Programmatic assignment stays silent (no `input`/`change`), matching every * `FormAssociated` sibling's documented contract. */ set value(next:string); /** The composite value as a local-midnight `Date`, or `null` while incomplete/invalid. */ get valueAsDate():Date|null;set valueAsDate(next:Date|null);private parseStrictISO;private get fieldOrder();private textFor;private setFieldText;private idFor;private get effectiveDayLabel();private get effectiveMonthLabel();private get effectiveYearLabel();private labelFor; /** Resolves the public autocomplete family for one internal field. */ private autocompleteFor; /** Computes the canonical zero-padded ISO date from the three raw typed field texts, or `''` * when any field is empty or the combination isn't a real calendar date. */ private computeCanonicalValue; /** Recomputes the composite value from the three field texts and pushes it through the base * `FormAssociated` setter directly (bypassing this class's own `value` setter above, which * would otherwise re-derive and clobber the raw per-field text this method is reading from). */ private commitFromFields;private get eventDetail();private detailFor; /** Fires `change` only on a real transition of the composite value -- called on every field * blur (whether that blur stays inside the control or leaves it), which also covers an * auto-advance move since focusing another field synchronously blurs the current one first. */ private commitChangeIfNeeded;private fieldInputElement;private isRenderedFieldTarget; /** Moves focus to the field `delta` steps away from `field` in locale field order; a no-op past * either end (e.g. Backspace-empty on the first field, or auto-advance past the last field). */ private focusAdjacentField;protected updateValidity():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;formResetCallback():void;formStateRestoreCallback(state:string|File|FormData|null):void; /** Sets consumer validity and schedules the validation message surface to refresh. */ setCustomValidity(message:string):void; /** The browser validation bubble's focus anchor -- the first visible day/month/year field in * locale order by default, never the hidden native `type="date"` mirror (`valueInput`), which * sits first in DOM order but must never receive focus or a validation popup. */ get validationTarget():HTMLElement|undefined;set validationTarget(next:HTMLElement|undefined); /** Clears consumer-supplied validity and republishes the intrinsic date constraints. */ resetValidity():void;private onLabelSlotChange;private onHintSlotChange;private onErrorSlotChange;private visibleErrorText;private accessibleVisibleText;private announceVisibleError;private normalizeFieldDigits;private onFieldInput;private onFieldKeydown;private onFieldFocus;private onFieldBlur; /** Focuses the first field in locale order. */ focus(options?:FocusOptions):void; /** Blurs whichever internal field currently has focus, if any. */ blur():void; /** Activates the first native field in locale order. */ click():void;private renderField;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-known-date':LyraKnownDate;}}export{};