import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export type LyraRandomContentAnimation='none'|'fade'|'fade-up'|'fade-down'|'fade-left'|'fade-right';export type LyraRandomContentMode='unique'|'random'|'sequence';export interface LyraRandomContentEventMap{'lr-content-change':CustomEvent<{readonly items:readonly Element[];}>;'lr-pause-change':CustomEvent<{readonly paused:boolean;}>;} /** * `` — displays a randomly (or sequentially) chosen * subset of its slotted children and hides the rest, for A/B copy testing, * testimonial/quote rotation, or varying marketing copy on each render or * interval without any custom JS beyond slotting the candidates. * * Not a form-associated control: it is a content-rotation primitive over * caller-supplied children, so the label/hint/error frame doesn't apply. * Its only built-in action is the autoplay pause/resume control. * * The host renders `display: block` by default, like the rest of this * family. A consumer needing an inline text-fragment swap inside a sentence * can override `lr-random-content { display: inline; }` from outside — * that isn't baked in here, since `display: contents` on the host risks * accessibility-tree inconsistencies across engines. * * Selection is driven by `autoplay`/`autoplayInterval` and the public * `randomize()` method. When autoplay is enabled, a built-in localized * pause/resume action exposes the reflected `paused` state. Rotation also * suspends while focus is anywhere inside the component and never hides a * subtree that currently owns focus. * Selection changes after mount are announced through a pre-mounted light-DOM live region, * except for timer-driven autoplay ticks. In particular, an explicit `randomize()` call is * announced even while autoplay is enabled. Announcement text omits subtree-pruned content; a * visibility-hidden wrapper omits its own text but can contain a visible override descendant. * A nested forwarding slot contributes flattened assigned text rather than fallback content; * later assigned-content and assignment changes are announced when they change the exposed * selection, while initial distribution stays silent. * Changes while the host or a composed ancestor is accessibility-hidden, as well as initial * connection and reconnection, stay silent. * Reactive selection changes written while detached and rendered during reconnection are part of * that silent baseline; a later explicit `randomize()` is still announced. * * **Before script runs, the first candidate is the one that shows.** Selection happens in * `firstUpdated()`, which a server renderer never executes, and it works by setting * `hidden`/`aria-hidden` on light-DOM siblings — something Lit's hydration diffing never inspects, * so no amount of first-render seeding can make the server agree. The shadow stylesheet therefore * hides every candidate after the first until a selection has actually been applied: a * server-rendered page (and a page whose script never runs at all) paints one candidate rather * than the entire pool, and hydration swaps that one for the chosen one instead of collapsing N * down to one. Randomness itself is genuinely unavailable server-side — there is no seed to share * — so authors who need a *specific* pre-hydration candidate order the pool accordingly. * * `fade-left`/`fade-right` are physical-direction transforms (matching the * upstream naming this component mirrors), not "previous/next" navigational * semantics like a carousel chevron, so they are deliberately **not** * mirrored under `:host(:dir(rtl))`. * * @customElement lr-random-content * @slot - The pool of candidate children. Direct element children are eligible; a direct * forwarding slot is flattened to its projected element candidates. * @event lr-content-change - The displayed selection changed (first render, `randomize()`, * a slot-change-triggered reselection, or an autoplay tick). `detail: { items }` is the exact * frozen snapshot of the elements now shown, in display order. Not emitted when the eligible * pool is empty. * @event lr-pause-change - Fired when `paused` changes via the built-in pause/resume button, so a * host mirroring or persisting that state stays in sync. Never fired for a host's own `paused` * write. `detail: { paused: boolean }` (the new `paused` value). Same name and shape as * ``'s identical affordance. * @csspart base - The wrapping element around the default slot. * @csspart pause-button - The autoplay pause/resume action. * @cssprop [--lr-animation-duration=300ms] - Mapped duration of the entrance animation. * @cssprop [--lr-animation-easing=ease] - Mapped easing function for the entrance animation. * @cssprop [--lr-animation-translate=var(--lr-size-0-5em)] - Mapped travel distance for directional animations. * @cssprop [--animation-duration=300ms] - Web Awesome duration alias. * @cssprop [--animation-easing=ease] - Web Awesome easing alias. * @cssprop [--animation-translate=var(--lr-size-0-5em)] - Web Awesome travel-distance alias. * @cssprop [--lr-random-content-animation-duration=300ms] - Duration of the entrance animation. * @cssprop [--lr-random-content-animation-easing=ease] - Easing function for the entrance animation. * @cssprop [--lr-random-content-animation-translate=var(--lr-size-0-5em)] - Translation distance for directional animations. * @cssprop [--lr-random-content-item-gap=var(--lr-space-s)] - Gap between simultaneously selected items. * @cssprop [--lr-random-content-item-alignment=flex-start] - Cross-axis alignment of selected items. * @status stable * @since 4.0.0 */ export declare class LyraRandomContent extends LyraElement{protected static readonly immutableEventDetails:readonly string[];protected static readonly identityEventDetailProperties:Readonly<{'lr-content-change':readonly string[];}>;static styles:import("lit").CSSResultGroup[]; /** Entrance effect applied to a child the instant it becomes shown. */ animation:LyraRandomContentAnimation; /** Whether the displayed selection automatically re-rolls on an interval. */ autoplay:boolean; /** Whether autoplay is user-paused. Reflected for external state styling. */ paused:boolean; /** Milliseconds between autoplay ticks. Clamped to a 1000ms floor. */ autoplayInterval:number; /** How many children are shown simultaneously -- a count, not the pool itself. NaN/negative/ * fractional/oversized all normalize through `finiteInteger`, clamped to at least 1 and at * most the pool size -- see `clampedCount()`. */ items:number; /** Selection algorithm — see `randomize()`. */ private _mode;get mode():LyraRandomContentMode;set mode(next:LyraRandomContentMode);private slotEl?;private baseEl?; /** * Whether a selection has ever been applied to the pool. Drives `[part='base']`'s * `data-unselected` marker, which is what keeps a server-rendered page from painting the whole * candidate pool (see the class doc's SSR note). * * Deliberately NOT a reactive `@state`: it flips inside `applySelection()`, reached from * `firstUpdated()`, and a reactive write there schedules a second update purely to drop one * attribute -- Lit's change-in-update warning, for no rendered difference. The attribute is * removed imperatively instead; every later render commits the same `false` and leaves it off. */ private hasAppliedSelection;private timer?;private timerWindow?;private reduceMotion;private mediaQuery?;private sequenceCursor;private previousSelection?;private lastPool;private managedPool;private readonly authorState;private authorStateObserver?;private announcementContentObserver?;private authorStateObserverPauseDepth;private focusWithin;private announcementSink?;private connectionGeneration;private selectionAnnouncementsArmed;private lastAnnouncementText;private hasUpdatedOnce;connectedCallback():void;disconnectedCallback():void;protected firstUpdated(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private onMotionPreferenceChange;private eligible;private clampedCount;private poolsEqual;private shuffledPick;private sameAsPrevious;private selectUnique;private selectSequence;private computeSelectionForMode;private preserveFocusedSubtree;private reconcileManagedPool;private restoreAuthorState;private restoreManagedPool;private applyManagedSelection;private applySelection;private captureAuthorStateMutations;private observeAuthorState;private startAuthorStateObserver;private stopAuthorStateObserver;private withAuthorStateObserverPaused;private selectionAnnouncementSnapshot;private selectionAnnouncement;private announcementObservationOptions;private observeAnnouncementNode;private observeLabelReferenceRoot;private observeAnnouncementContent;private startAnnouncementContentObserver;private stopAnnouncementContentObserver;private announceCurrentSelectionIfChanged;private onForwardedSlotChange;private reselect;private onSlotChange; /** * Selects a new set of children using the current mode. Applies * `hidden`/`aria-hidden`, emits `lr-content-change`, and returns the * elements now shown. The selection is announced even when `autoplay` is enabled; only the * timer's own selections stay silent. Does not reset or restart the autoplay timer. */ randomize():readonly Element[];private stopAutoplay;private restartAutoplay;private onFocusIn;private onFocusOut;private togglePaused;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-random-content':LyraRandomContent;}}