import type { CSSResult } from "lit"; import { LitElement } from "lit"; export type { PhantomUiAttributes, SolidPhantomUiAttributes } from "./types.js"; import "./types.js"; import type { Animation, Mode, ShimmerDirection } from "./types.js"; /** * `` -- A structure-aware shimmer skeleton loader. * * Wraps real content and, when `loading` is true, measures the DOM structure * of the slotted children to generate perfectly-aligned shimmer overlay blocks. * * @slot - The real content to show (or measure for skeleton generation) * * @attr {boolean} loading - Whether to show the shimmer overlay or the real content. The string `"false"` is treated as falsy. * @attr {ShimmerDirection} shimmer-direction - Direction of the shimmer sweep. Only used in `animation="shimmer"` mode. * @attr {string} shimmer-color - Color of the animated gradient wave. Only used in `animation="shimmer"` mode. * @attr {string} background-color - Background color of each shimmer block. Applies to all animation modes. * @attr {number} duration - Animation cycle duration in seconds * @attr {number} fallback-radius - Border radius applied to elements with border-radius: 0 (like text) * @attr {Animation} animation - Animation mode: "shimmer" (gradient sweep), "pulse" (opacity), "breathe" (scale + fade), or "solid" (static) * @attr {Mode} mode - Loading style. "skeleton" (default) measures the slotted content and shows placeholder blocks. "overlay" keeps the existing content visible and dimmed, sweeping a light band over it, for refresh / stale-while-revalidate states. * @attr {number} stagger - Delay in seconds between each block's animation start (0 = no stagger) * @attr {number} reveal - Fade-out duration in seconds when loading ends (0 = instant) * @attr {number} count - Number of skeleton rows to generate from a single template element * @attr {number} count-gap - Gap in pixels between each repeated skeleton row (only used when count > 1) * @attr {boolean} debug - Debug mode: outlines each measured block with an index. Useful for inspecting how phantom-ui interprets your DOM. * @attr {string} loading-label - Accessible label announced by screen readers while loading. Set as `aria-label` on the host when `loading` is true. * @attr {boolean} pierce-shadow - Measure inside open shadow roots of slotted custom elements (design systems built with Stencil, Lit, FAST). Resolves slots to their projected content. * * @example * ```tsx * *
* *

{user?.name ?? "x"}

*

{user?.bio ?? "x"}

*
*
* ``` */ export declare class PhantomUi extends LitElement { static styles: CSSResult; /** Whether to show the shimmer overlay or the real content */ loading: boolean; /** Direction of the shimmer sweep. Only used in `animation="shimmer"` mode. */ shimmerDirection: ShimmerDirection; /** Color of the animated gradient wave. Only used in `animation="shimmer"` mode. */ shimmerColor: string; /** Background color of each shimmer block. Applies to all animation modes. */ backgroundColor: string; /** Animation cycle duration in seconds */ duration: number; /** Border radius applied to elements with border-radius: 0 (like text) */ fallbackRadius: number; /** Animation mode: "shimmer" (gradient sweep), "pulse" (opacity), "breathe" (scale + fade), or "solid" (static) */ animation: Animation; /** * Loading style. "skeleton" (default) measures the slotted content and shows * placeholder blocks. "overlay" keeps the existing content visible and dimmed, * sweeping a light band over it, for refresh / stale-while-revalidate states. */ mode: Mode; /** Delay in seconds between each block's animation start (0 = no stagger) */ stagger: number; /** Fade-out duration in seconds when loading ends (0 = instant) */ reveal: number; /** Number of skeleton rows to generate from a single template element */ count: number; /** Gap in pixels between each repeated skeleton row (only used when count > 1) */ countGap: number; /** Debug mode: outlines each measured block with an index. Useful for inspecting how phantom-ui interprets your DOM. */ debug: boolean; /** Accessible label announced by screen readers while loading. Set as `aria-label` on the host when `loading` is true. */ loadingLabel: string; /** Measure inside open shadow roots of slotted custom elements (design systems built with Stencil, Lit, FAST). Resolves slots to their projected content. */ pierceShadow: boolean; private _blocks; private _revealing; private _resizeObserver; private _mutationObserver; private _loadHandler; private _measureScheduled; private _revealTimeout; private _visibility; connectedCallback(): void; disconnectedCallback(): void; willUpdate(changedProperties: Map): void; updated(changedProperties: Map): void; render(): import("lit-html").TemplateResult<1>; private _scheduleMeasure; private _measure; private _setupObservers; private _teardownObservers; private _clearRevealTimeout; }