// Generated by scripts/generate-standalone-types.mjs. Do not edit. // // Declarations for the standalone bundle, with no imports, so both files can be copied // into a project that has no package manager access. The class is declared as an // HTMLElement subclass: at runtime it is a LitElement, which is an HTMLElement, so this // is a narrower view of the same object rather than a different one. export type ShimmerDirection = "ltr" | "rtl" | "ttb" | "btt"; export type Animation = "shimmer" | "pulse" | "breathe" | "solid"; export type Mode = "skeleton" | "overlay"; export interface PhantomUiAttributes { /** Show the shimmer overlay (`true`) or the real content (`false`). Treats the string `"false"` as falsy. */ loading?: boolean; /** Direction of the shimmer sweep: `"ltr"`, `"rtl"`, `"ttb"`, or `"btt"`. Only used in `animation="shimmer"` mode. */ "shimmer-direction"?: ShimmerDirection; /** Color of the animated gradient wave. Only used in `animation="shimmer"` mode. */ "shimmer-color"?: string; /** Background color of each shimmer block. Applies to all animation modes. */ "background-color"?: string; /** Animation cycle duration in seconds. */ duration?: number; /** Border radius (px) applied to elements that have none (like text). */ "fallback-radius"?: number; /** Animation mode: `"shimmer"` (gradient sweep), `"pulse"` (opacity), `"breathe"` (scale + fade), or `"solid"` (static). */ animation?: Animation; /** Loading style: `"skeleton"` (default, measures content and shows placeholder blocks) or `"overlay"` (keeps the existing content visible and dimmed with a light sweep over it, for refresh / stale-while-revalidate). */ 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 repeated rows (only used when `count > 1`). */ "count-gap"?: number; /** Debug mode: outlines each measured block with an index for inspection. */ debug?: boolean; /** Accessible label announced by screen readers while loading. Default `"Loading"`. */ "loading-label"?: string; /** Slotted content (React/Solid/Qwik). */ children?: unknown; /** Standard HTML `class` attribute. */ class?: string; /** Standard HTML `id` attribute. */ id?: string; /** Inline styles — string or object (React). */ style?: string | Record; /** Named slot assignment. */ slot?: string; /** React/Solid reconciliation key. Not passed to the DOM. */ key?: string | number; /** Element ref (React/Solid). Not passed to the DOM. */ ref?: unknown; /** Any `data-*` attribute. */ [key: `data-${string}`]: string | undefined; } /** * Solid's `attr:` prefix writes an HTML attribute rather than a property, so the value * is stringified and `null` removes the attribute. Booleans are set by presence, which * in that form means `""` or `null`. */ type AttrValue = T extends boolean ? boolean | "" | null : T | null; /** Solid uses `attr:` prefix to set HTML attributes. This maps all PhantomUiAttributes to their `attr:` equivalents. */ export type SolidPhantomUiAttributes = PhantomUiAttributes & { [K in keyof PhantomUiAttributes as `attr:${K & string}`]?: AttrValue; }; declare global { interface HTMLElementTagNameMap { "phantom-ui": PhantomUi; } namespace JSX { interface IntrinsicElements { "phantom-ui": PhantomUiAttributes; } } } export {}; /** * `` -- 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 HTMLElement { /** Resolves once the element has finished its pending render. */ readonly updateComplete: Promise; /** 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; private _scheduleMeasure; private _measure; private _setupObservers; private _teardownObservers; private _clearRevealTimeout; }