import * as i0 from '@angular/core'; import { InputSignal, TemplateRef, Type, InputSignalWithTransform, ModelSignal, OutputEmitterRef, Signal, InjectionToken } from '@angular/core'; import { VariantProps, cva } from 'class-variance-authority'; import { ConnectedPosition, ConnectionPositionPair } from '@angular/cdk/overlay'; type PopoverPosition = 'above' | 'below' | 'left' | 'right' | 'auto'; type PopoverAlignment = 'start' | 'center' | 'end'; type PopoverTriggerOn = 'click' | 'focus' | 'manual'; type PopoverVariant = 'default' | 'compact' | 'wide' | 'flush'; type PopoverBackdrop = 'transparent' | 'dimmed' | 'none'; type PopoverSide = 'top' | 'bottom' | 'left' | 'right'; /** * Popover panel styling variants. * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--radius-popover`, `--radius-overlay` */ declare const popoverPanelVariants: ReturnType; }>>; type PopoverPanelVariants = VariantProps; /** * Popover arrow positioning variants. * The arrow is positioned on the edge of the popover pointing toward the trigger. * * @tokens `--color-popover`, `--color-border` */ declare const popoverArrowVariants: ReturnType; }>>; type PopoverArrowVariants = VariantProps; /** * Popover trigger directive — manages the popover overlay lifecycle. * Applied to the trigger element, it handles opening, closing, positioning, * and accessibility for floating popover content. * * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--color-ring` * * @example Basic usage with template * ```html * * *

This is help content.

*
* ``` * * @example With positioning * ```html * * ``` * * @example With component content * ```html * * ``` * * @example Manual control * ```html * * ``` */ declare class ComPopoverTrigger { private readonly overlay; private readonly elementRef; private readonly viewContainerRef; private readonly injector; private readonly destroyRef; private readonly focusTrapFactory; private readonly document; private overlayRef; private focusTrap; private scrollCleanup; private closeTimeoutId; private destroyed; private readonly popoverId; /** Content to render: TemplateRef or Component class. */ readonly comPopoverTrigger: InputSignal | Type>; /** Preferred position direction. */ readonly popoverPosition: InputSignal; /** Alignment along the cross-axis. */ readonly popoverAlignment: InputSignal; /** What interaction opens the popover. */ readonly popoverTriggerOn: InputSignal; /** Gap in px between trigger and popover edge. */ readonly popoverOffset: InputSignal; /** Whether to render the connecting arrow. */ readonly popoverShowArrow: InputSignalWithTransform; /** Size/padding preset for the content panel. */ readonly popoverVariant: InputSignal; /** Backdrop behavior. */ readonly popoverBackdrop: InputSignal; /** Close when clicking outside the popover. */ readonly popoverCloseOnOutside: InputSignalWithTransform; /** Close on Escape key. */ readonly popoverCloseOnEscape: InputSignalWithTransform; /** Close when ancestor scrollable container scrolls. */ readonly popoverCloseOnScroll: InputSignalWithTransform; /** Prevents opening when true. */ readonly popoverDisabled: InputSignalWithTransform; /** Two-way bindable open state. */ readonly popoverOpen: ModelSignal; /** Arbitrary data passed to the content component/template. */ readonly popoverData: InputSignal; /** Custom CSS class(es) on the overlay panel. */ readonly popoverPanelClass: InputSignal; /** Trap focus inside popover. */ readonly popoverTrapFocus: InputSignalWithTransform; /** Optional accessibility label for the popover dialog. */ readonly popoverAriaLabel: InputSignal; /** Emitted after popup opens and is visible. */ readonly popoverOpened: OutputEmitterRef; /** Emitted after popup closes and is detached. */ readonly popoverClosed: OutputEmitterRef; private readonly activeSide; private readonly activeAlignment; private readonly animationState; private contentComponentRef; private readonly hasBackdrop; private readonly backdropClass; protected readonly ariaControls: Signal; private readonly panelClassArray; constructor(); /** Programmatically open the popover. */ open(): void; /** Programmatically close the popover. */ close(): void; /** Toggle the popover open/close state. */ toggle(): void; /** Force recalculation of position. */ reposition(): void; protected onTriggerClick(event: MouseEvent): void; protected onTriggerFocus(): void; protected onTriggerBlur(): void; protected onEscapeKey(event: Event): void; private openPopover; private closePopover; private cancelPendingClose; private subscribeToScrollEvents; private unsubscribeFromScrollEvents; private createOverlay; private attachContent; private updateContentComponentInputs; private detachContent; private subscribeToCloseEvents; private setupFocusTrap; private destroyFocusTrap; private disposeOverlay; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Convenience directive that closes the parent popover when clicked. * Applied to elements inside the popover that should dismiss it. * * @tokens none * * @example * ```html * *
*

Are you sure?

*
* * *
*
*
* ``` * * @example With a result value * ```html * * * ``` */ declare class ComPopoverClose { private readonly popoverRef; /** * Optional result value to pass when closing. * This value is emitted via the trigger's close event. */ readonly comPopoverClose: InputSignal; protected closePopover(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Marker directive for lazy popover content templates. * Applied to `` to indicate content that should be * lazily instantiated when the popover opens. * * This directive is primarily semantic — it marks the template as popover content * and provides access to the TemplateRef for potential content queries. * * @tokens none * * @example * ```html * * *

This is help content.

*
* ``` * * Note: You can also pass a template reference directly without this directive: * ```html * * *

This also works.

*
* ``` */ declare class ComPopoverTemplate { /** Reference to the template for rendering. */ readonly templateRef: TemplateRef; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Interface for the popover reference injected into content. * Provides methods to control the popover from within content. */ interface PopoverRef { /** Programmatically open the popover. */ open(): void; /** Programmatically close the popover. */ close(): void; /** Toggle the popover open/close state. */ toggle(): void; /** Force recalculation of position. */ reposition(): void; } /** * Data passed to a component rendered inside the popover. * Inject this token to access the data provided via `popoverData` input. * * @example * ```ts * @Component({ ... }) * export class UserProfilePopover { * readonly data = inject(POPOVER_DATA); // { userId: '123' } * } * ``` */ declare const POPOVER_DATA: InjectionToken; /** * Reference to the popover trigger directive for closing from inside the popover. * Inject this token to programmatically close the popover from within content. * * @example * ```ts * @Component({ ... }) * export class UserProfilePopover { * readonly popoverRef = inject(POPOVER_REF); * * save(): void { * // ... save logic * this.popoverRef.close(); * } * } * ``` */ declare const POPOVER_REF: InjectionToken; /** * Build an ordered list of position pairs for the CDK overlay. * The first position is the preferred position; remaining positions are fallbacks. * * @param position - Preferred position direction ('above', 'below', 'left', 'right', 'auto') * @param alignment - Alignment along the cross-axis ('start', 'center', 'end') * @param offset - Gap in pixels between trigger and popover edge (default: 8) * @returns Array of ConnectedPosition for FlexibleConnectedPositionStrategy */ declare function buildPopoverPositions(position: PopoverPosition, alignment: PopoverAlignment, offset?: number): ConnectedPosition[]; /** * Derive which side of the trigger the popover is on from a connection pair. * Used to position the arrow correctly. * * The returned side indicates where the popover sits relative to the trigger: * - 'bottom': popover is below trigger, arrow at top pointing up * - 'top': popover is above trigger, arrow at bottom pointing down * - 'right': popover is right of trigger, arrow at left pointing left * - 'left': popover is left of trigger, arrow at right pointing right */ declare function deriveSideFromPosition(pair: ConnectionPositionPair): PopoverSide; /** * Derive alignment from a connection pair. */ declare function deriveAlignmentFromPosition(pair: ConnectionPositionPair): PopoverAlignment; export { ComPopoverClose, ComPopoverTemplate, ComPopoverTrigger, POPOVER_DATA, POPOVER_REF, buildPopoverPositions, deriveAlignmentFromPosition, deriveSideFromPosition, popoverArrowVariants, popoverPanelVariants }; export type { PopoverAlignment, PopoverArrowVariants, PopoverBackdrop, PopoverPanelVariants, PopoverPosition, PopoverRef, PopoverSide, PopoverTriggerOn, PopoverVariant };