import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraAppearance,LyraSize}from'../../../internal/variants.js'; /** The library's one size ladder, in either spelling. */ export type LyraDetailsSize=LyraSize; /** Web Awesome's disclosure appearances. */ export type LyraDetailsAppearance=Exclude; /** Logical position of the disclosure icon. */ export type LyraDetailsIconPlacement='start'|'end'; /** How an accepted disclosure transition began. */ export type LyraDetailsToggleSource='user'|'programmatic'|'peer'; /** Payload emitted with `lr-toggle` after an accepted disclosure transition renders. */ export interface LyraDetailsToggleDetail{open:boolean;source:LyraDetailsToggleSource;}export interface LyraDetailsEventMap{'lr-show':CustomEvent;'lr-after-show':CustomEvent;'lr-hide':CustomEvent;'lr-after-hide':CustomEvent;'lr-toggle':CustomEvent;} /** * `` — an accessible disclosure panel. * * Lifecycle: opening emits `lr-show` (cancelable), then `lr-toggle`, then `lr-after-show`; * closing emits `lr-hide` (cancelable), then `lr-toggle`, then `lr-after-hide`. `show()`, * `hide()` and assigning `open` all run the same sequence, as does clicking (or activating with * the keyboard) the summary — the native `
` toggle is intercepted so a vetoed `lr-show` * cannot leave the panel visually expanded. Markup that renders open from the start emits * nothing. * * A present host `aria-label`, including an explicitly empty value, names the native summary * trigger. When absent, the summary retains its native name-from-content behavior. * * @customElement lr-details * @slot summary - Summary content. Takes priority over `summary` when any light-DOM child * carries `slot="summary"` — the fallback localized "Details" text only appears when neither * is set. * @slot header-actions - Extra controls rendered as a sibling of the native summary in the * complete header row (e.g. a trailing "add" button). They remain enabled and do not toggle * the panel, including while the disclosure itself is disabled. * @slot expand-icon - Icon shown while the panel is closed. * @slot collapse-icon - Icon shown while the panel is open. * @slot - Panel content. * @event lr-show - The panel is about to open. Cancelable. Nested disclosures emit the same name; * handle it as this panel's event only when `event.target === event.currentTarget` (see * `lr-toggle`). * @event lr-after-show - The panel is open and its marker transition has finished. Nested * disclosures emit the same name; handle it as this panel's event only when * `event.target === event.currentTarget` (see `lr-toggle`). * @event lr-hide - The panel is about to close. Cancelable. Nested disclosures emit the same name; * handle it as this panel's event only when `event.target === event.currentTarget` (see * `lr-toggle`). * @event lr-after-hide - The panel is closed and its marker transition has finished. Nested * disclosures emit the same name; handle it as this panel's event only when * `event.target === event.currentTarget` (see `lr-toggle`). * @event lr-toggle - The disclosure state changed. `detail: { open, source }`, where `source` is * `user` for summary activation, `programmatic` for `show()`/`hide()`/`open`, or `peer` when a * named disclosure closes this panel. Reports the direction and source of an accepted state * change. `` coordinates its direct `` children; Details * disclosures manage their own state and optional named-peer grouping. * * **A nested disclosure's events are not scoped to it, so filter by target.** Every Details * event bubbles and is composed, with no exception for this component. A `` nested * inside another one — as ordinary slotted content, in the default panel or in * `header-actions` — sends its own `lr-show`, `lr-hide`, `lr-toggle`, `lr-after-show` and * `lr-after-hide` straight through the outer panel, so a listener bound directly on the outer * `` also receives the inner one's, and an inner disclosure opening or closing looks * identical to the outer one doing the same. It is the failure mode ``'s `lr-close` * carries and documents too. This is deliberate rather than a bug to fix: non-bubbling * disclosure events would be a breaking change, and `event.target`/`event.currentTarget` * already give every listener what it needs to tell the two apart. Guard on the target: * * ```html * * Some outer content. * Inner content. * * * ``` * @csspart base - Compatibility name for the outer disclosure container; use `details`. * @csspart details - The outer disclosure container. It is the same node as `base`. * @csspart header - The complete row containing the native summary and any header actions. * @csspart summary - The summary control. * @csspart icon - The expand/collapse icon wrapper. * @csspart summary-icon - Shoelace-compatible alias for `icon`; both names are on the same node. * @csspart header-actions - The wrapper around the `header-actions` slot, following the private * native details element in `header`. * @csspart content - The panel content inside a private findable closed-state gate. * @cssprop [--lr-details-font-size=var(--lr-form-control-font-size)] - Text size of the summary * and the panel. Its private default follows the library's shared size ladder; an inherited or * direct public value remains authoritative. * @cssprop [--lr-details-spacing=var(--lr-form-control-padding-inline)] - Block rhythm: the * summary's block padding and the panel's trailing padding, kept equal so a stack of * disclosures reads evenly. Its private default follows the shared ladder's inline-padding * knob, whose values suit a stacked panel; the ladder's own block padding exists to fit text * inside a fixed control height and would collapse the summary row. An inherited or direct * public value remains authoritative. * @cssprop [--lr-details-summary-padding-block=var(--lr-details-spacing)] - Summary block padding * (top/bottom), independently tunable from the panel content's own padding. Falls through to * `--lr-details-spacing` (and its private ladder default) when unset, so an un-set disclosure * renders unchanged, mirroring how `--lr-details-gap`/`--lr-details-radius` are already * independent of each other. * @cssprop [--lr-details-summary-padding-inline=var(--lr-details-spacing)] - Summary inline padding * (start/end), independently tunable from the panel content's own padding. Same fallback chain as * `--lr-details-summary-padding-block`. * @cssprop [--lr-details-content-padding-block-end=var(--lr-details-spacing)] - Panel content's * trailing block padding, independently tunable from the summary's own padding. Same fallback * chain as `--lr-details-summary-padding-block`. * @cssprop [--lr-details-content-padding-inline=var(--lr-details-spacing)] - Panel content's inline * padding, independently tunable from the summary's own padding. Same fallback chain as * `--lr-details-summary-padding-block`. * @cssprop [--lr-details-gap=var(--lr-space-s)] - Gap between summary content and its icon. * @cssprop [--lr-details-radius=var(--lr-radius)] - Disclosure surface corner radius. * @cssprop [--lr-details-outlined-bg=var(--lr-color-surface)] - Outlined surface background. * @cssprop [--lr-details-outlined-border-color=var(--lr-color-border)] - Outlined border color. * @cssprop [--lr-details-filled-bg=var(--lr-color-brand-quiet)] - Filled surface background. * @cssprop [--lr-details-filled-border-color=transparent] - Filled border color. * @cssprop [--lr-details-filled-outlined-bg=var(--lr-color-brand-quiet)] - Filled-outlined * surface background. * @cssprop [--lr-details-filled-outlined-border-color=var(--lr-color-border)] - Filled-outlined * border color. * @cssprop [--lr-details-summary-hover-bg=var(--lr-color-brand-quiet)] - Summary hover background. * @cssprop [--lr-details-summary-active-bg=color-mix(...)] - Summary pressed background. * @cssprop --spacing - Upstream-compatible spacing override for the summary and content. * @cssprop [--show-duration=var(--lr-duration-base)] - Expand-icon transition duration. * @cssprop [--hide-duration=var(--lr-duration-base)] - Collapse-icon transition duration. * @cssstate animating - Present while an expand/collapse transition is settling. * @status stable * @since 4.0.0 */ export declare class LyraDetails extends LyraElement{static styles:import("lit").CSSResultGroup[];private readonly detailsInternals;private readonly disclosureMotion;private _open;private readonly contentId;private contentGateMode;private contentGateGeneration;private fragmentListenerWindow?;private fragmentNavigationGeneration; /** Whether the panel is expanded. Assigning it runs the full `lr-show`/`lr-hide` lifecycle and * can be vetoed the same way, so the property, the reflected attribute and `show()`/`hide()` * can never disagree. */ get open():boolean;set open(next:boolean); /** Disables activation and removes the native summary from sequential keyboard navigation, * matching the disabled trigger behavior of `lr-accordion-item`. Programmatic focus remains a * native `` capability. */ disabled:boolean; /** Groups disclosures in the same document or shadow root. Opening one closes its open peers. */ name:string; /** Visual surface treatment. */ appearance:LyraDetailsAppearance; /** Logical side of the expand/collapse icon. */ iconPlacement:LyraDetailsIconPlacement; /** Visual density, on the library's shared ladder. Both spellings of every tier are accepted * (`s`/`small`, `m`/`medium`, `l`/`large`), so markup migrated from Web Awesome or Shoelace * needs no attribute rewrite. `m` reproduces the disclosure this component had before `size` * existed. */ size:LyraDetailsSize;summary:string;private hasSummarySlot; /** Same `:empty`-can't-match reasoning as `hasSummarySlot` above -- the `header-actions` wrapper * always contains a literal `` child, so its own emptiness has to be tracked in JS instead * to keep an unused wrapper from claiming layout space. */ private hasHeaderActionsSlot;protected willUpdate(changed:PropertyValues):void;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;firstUpdated(changed:PropertyValues):void; /** Expand the panel. The promise resolves after `lr-after-show`; vetoed or disabled requests * resolve without changing state. */ show():Promise;protected showWithSource(source:LyraDetailsToggleSource):Promise;private beginShow; /** Collapse the panel. The promise resolves after `lr-after-hide`; vetoed requests resolve * without changing state. */ hide():Promise;protected hideWithSource(source:LyraDetailsToggleSource):Promise; /** Close open peers that share this non-empty name. A custom element's internal native * `
` lives in its own shadow root, so the platform's native `name` grouping cannot * coordinate separate hosts; the hosts do that work here. */ private closeNamedPeers;private applyOpenState; /** A vetoed transition must leave the reflected attribute agreeing with the property; Lit only * reflects properties it saw change. */ private syncOpenAttribute;private get nativeDetails();private get summaryElement();private get contentGate();private setContentGateMode;private syncNativeDetailsState;private syncSummaryState;private rearmContentGate;private onBeforeMatch;private armFragmentNavigation;private disarmFragmentNavigation;private onHashChange;private queueFragmentReveal;private revealFragmentTarget;private isDefaultContentTarget;private settleTransition;private onClick;private onToggle;private onSummarySlotChange;private onHeaderActionsSlotChange;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-details':LyraDetails;}}