import { IEventDetail, IEventEmitter } from '@breadstone/mosaik-elements'; import { type IAttachable } from '../../../Behaviors/Attachable'; import { CustomElement } from '../../Abstracts/CustomElement'; /** * Represents the event emitters for the BackTop component. * * @public */ export interface IBackTopEvents { restored: IEventEmitter; } /** * Represents the properties for the BackTop component. * * @public */ export interface IBackTopElementProps { offset: number; } declare const BackTopElement_base: (abstract new (...args: Array) => import("../../../Behaviors/Themeable").IThemeableProps) & (abstract new (...args: Array) => IAttachable) & typeof CustomElement & import("../../../Behaviors/Themeable").IThemeableCtor; /** * BackTop - A scrollable page navigation element that provides quick access to return to the top or bottom. * * @description * The BackTop component creates an interactive floating action button that appears when a user scrolls * beyond a specified offset threshold. It provides smooth scroll-to-position functionality for returning * to either the top or bottom of scrollable containers. The component monitors scroll position in real-time, * automatically showing or hiding itself based on the configured offset, and offers smooth animated scrolling * behavior when activated. It includes attachment positioning capabilities for flexible placement within * scrollable regions, making it ideal for long-form content pages, infinite scroll interfaces, or any * scenario requiring convenient navigation across extensive vertical content. * * @name BackTop * @element mosaik-back-top * @category Misc * * @slot - Default slot for custom content (overrides default floating action button) * * @csspart root - The root container element wrapping the component * @csspart button - The floating action button element that triggers scroll navigation * * @cssprop {String} --back-top-position - The positioning context for the back-to-top button * @cssprop {String} --back-top-bottom - The distance from the bottom edge of the viewport * @cssprop {String} --back-top-right - The distance from the right edge of the viewport * @cssprop {String} --back-top-z-index - The stacking order above other page content * @cssprop {String} --back-top-opacity - The base opacity when visible * @cssprop {String} --back-top-visibility - The visibility state control * @cssprop {String} --back-top-transition-property - The CSS properties to animate during state changes * @cssprop {String} --back-top-transition-duration - The duration of show/hide transitions * @cssprop {String} --back-top-transition-timing-function - The easing function for animations * * @dependency {FloatingActionButtonElement} - Floating action button for scroll trigger * * @fires restored {RestoredEvent} - Fired when scroll position has been restored to target (top or bottom) * * @example * Basic back-to-top button (default): * ```html * * ``` * * @example * Configured for scrolling to bottom with custom offset: * ```html * * ``` * * @example * Attached to a specific scrollable container: * ```html *
* * *
* ``` * * @public */ export declare class BackTopElement extends BackTopElement_base implements IBackTopElementProps, IAttachable, IBackTopEvents { private readonly _restored; private _offset; private _visible; private _position; private _to; /** * @public */ constructor(); /** * Returns the `is` property. * The `is` property represents natural name of this element. * * @public * @static * @readonly */ static get is(): string; /** * Gets or sets the `offset` property. * The scroll offset threshold (in pixels) after which the back-to-top button becomes visible. * The default value is 120 pixels. * * @public * @attr */ get offset(): number; set offset(value: number); /** * Gets or sets the `to` property. * Specifies the scroll destination: 'top' scrolls to the beginning, 'bottom' scrolls to the end. * The default value is 'top'. * * @public * @attr */ get to(): 'top' | 'bottom'; set to(value: 'top' | 'bottom'); /** * Returns the `position` property. * The current scroll position as a percentage (0-100) of the total scrollable height. * * @public * @readonly */ get position(): number; /** * Called when the scroll position has been restored to the target location. * Provides reference to `IEventDetail` as event detail. * * @public * @readonly * @eventProperty */ get restored(): IEventEmitter; /** * Emits the `restored` event. * * @protected */ protected onRestored(args: any): void; /** * @public */ protected onApplyTemplate(): void; /** * @public */ onClick(): void; /** * @private */ private scrollToPostion; /** * @private */ private getPosition; /** * Measures the scroll offset relative to the specified edge of the viewport. This method can be * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent * about what scrollLeft means in RTL. The values returned by this method are normalized such that * left and right always refer to the left and right side of the scrolling container irrespective * of the layout direction. start and end refer to left and right in an LTR context and vice-versa * in an RTL context. * * @private * @param from The edge to measure from. */ private measureScrollOffset; } /** * @public */ export declare namespace BackTopElement { type Props = IBackTopElementProps; } /** * @public */ declare global { interface HTMLElementTagNameMap { 'mosaik-back-top': BackTopElement; } } export {}; //# sourceMappingURL=BackTopElement.d.ts.map