import { NgpOverlayContent, NgpOffset, NgpFlip, NgpShift, NgpOffsetInput, NgpFlipInput, NgpShiftInput, NgpOverlayArrowState, NgpOverlayArrowProps } from 'ng-primitives/portal'; export { NgpOverlayArrowProps as NgpPreviewCardArrowProps, NgpOverlayArrowState as NgpPreviewCardArrowState, injectOverlayContext as injectPreviewCardContext } from 'ng-primitives/portal'; import * as ng_primitives_preview_card from 'ng-primitives/preview-card'; import * as _angular_core from '@angular/core'; import { Signal, Provider } from '@angular/core'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import * as ng_primitives_state from 'ng-primitives/state'; import { StateInjectionOptions } from 'ng-primitives/state'; interface NgpPreviewCardTriggerState { /** * The content rendered inside the preview card. Readonly so that the content has a * single mutation path - use `setPreviewCard`. */ readonly previewCard: Signal | undefined>; /** * The container the preview card is attached to. Readonly - use `setContainer`. * @default document.body */ readonly container: Signal; /** Whether the preview card is currently open. */ readonly open: Signal; /** * Set the content rendered inside the preview card. This is how a reusable component * wires its own card component into the trigger. Takes effect the next time the card * is shown; it does not swap the content of a card that is already visible. * @param content - The template or component to render */ setPreviewCard: (content: NgpOverlayContent | undefined) => void; /** * Set the container the preview card is attached to. Takes effect the next time the * card is shown; it does not move a card that is already visible. * @param container - The new container */ setContainer: (container: HTMLElement | string | null) => void; /** Show the preview card. */ show: () => void; /** Hide the preview card. */ hide: () => void; /** * Called by the preview card as the pointer enters and leaves it, so the trigger can * keep the card open while the pointer is inside it. * @internal */ setPointerOverCard: (isOver: boolean) => void; /** * Called by the preview card when focus leaves it. * @internal */ onCardFocusOut: (next: EventTarget | null) => void; } interface NgpPreviewCardTriggerProps { /** Access the preview card template ref. */ readonly previewCard?: Signal | undefined>; /** * Whether the preview card is disabled. This allows the preview card to be enabled or disabled dynamically. * @default false */ readonly disabled?: Signal; /** * Define the placement of the preview card relative to the trigger. * @default 'bottom' */ readonly placement?: Signal; /** * Define the offset of the preview card relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 4 */ readonly offset?: Signal; /** * Define the delay before the preview card is displayed. * @default 600 */ readonly showDelay?: Signal; /** * Define the delay before the preview card is hidden. * @default 300 */ readonly hideDelay?: Signal; /** * Define whether the preview card should flip when there is not enough space. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ readonly flip?: Signal; /** * Configure shift behavior to keep the preview card in view. * Can be a boolean to enable/disable, or an object with padding and limiter options. * @default undefined (enabled by default in overlay) */ readonly shift?: Signal; /** * Define the container in which the preview card should be attached. * @default document.body */ readonly container?: Signal; /** * Define an anchor element for positioning the preview card. * If provided, the preview card will be positioned relative to this element instead of the trigger. */ readonly anchor?: Signal; /** * Provide context to the preview card. This can be used to pass data to the preview card content. */ readonly context?: Signal; /** * Defines how the preview card behaves when the window is scrolled. * @default 'reposition' */ readonly scrollBehavior?: Signal<'reposition' | 'close'>; /** * Define the cooldown duration in milliseconds. * When moving from one preview card to another within this duration, * the showDelay is skipped for the new card. * @default 300 */ readonly cooldown?: Signal; /** Callback fired when the open state changes. */ readonly onOpenChange?: (value: boolean) => void; } declare const NgpPreviewCardTriggerStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>>; declare const ngpPreviewCardTrigger: ({ previewCard: _previewCard, disabled, placement, offset, showDelay, hideDelay, flip, shift, container: _container, anchor, context, scrollBehavior, cooldown, onOpenChange, }: NgpPreviewCardTriggerProps) => NgpPreviewCardTriggerState; declare const providePreviewCardTriggerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; declare function injectPreviewCardTriggerState(options?: StateInjectionOptions): Signal>; type NgpPreviewCardPlacement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end'; /** * Apply the `ngpPreviewCardTrigger` directive to the element that reveals the preview card. * * This should be an element that is independently useful without the card - typically a * link to the content the card previews - because the card itself is not exposed to * assistive technology. */ declare class NgpPreviewCardTrigger { /** * Access the global preview card configuration. */ private readonly config; /** * Access the preview card template ref. */ readonly previewCard: _angular_core.InputSignal | undefined>; /** * Whether the preview card is disabled. This allows the preview card to be enabled or disabled dynamically. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Define the placement of the preview card relative to the trigger. * @default 'bottom' */ readonly placement: _angular_core.InputSignal; /** * Define the offset of the preview card relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 4 */ readonly offset: _angular_core.InputSignalWithTransform; /** * Define the delay before the preview card is displayed. * @default 600 */ readonly showDelay: _angular_core.InputSignalWithTransform; /** * Define the delay before the preview card is hidden. * @default 300 */ readonly hideDelay: _angular_core.InputSignalWithTransform; /** * Define whether the preview card should flip when there is not enough space. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ readonly flip: _angular_core.InputSignalWithTransform; /** * Configure shift behavior to keep the preview card in view. * Can be a boolean to enable/disable, or an object with padding and limiter options. * @default undefined (enabled by default in overlay) */ readonly shift: _angular_core.InputSignalWithTransform; /** * Define the container in which the preview card should be attached. * @default document.body */ readonly container: _angular_core.InputSignal; /** * Define an anchor element for positioning the preview card. * If provided, the preview card will be positioned relative to this element instead of the trigger. */ readonly anchor: _angular_core.InputSignal; /** * Provide context to the preview card. This can be used to pass data to the preview card content. */ readonly context: _angular_core.InputSignal; /** * Defines how the preview card behaves when the window is scrolled. * @default 'reposition' */ readonly scrollBehavior: _angular_core.InputSignal<"reposition" | "close">; /** * Define the cooldown duration in milliseconds. * When moving from one preview card to another within this duration, * the showDelay is skipped for the new card. * @default 300 */ readonly cooldown: _angular_core.InputSignalWithTransform; /** * Emits when the open state of the preview card changes. */ readonly openChange: _angular_core.OutputEmitterRef; protected readonly state: ng_primitives_preview_card.NgpPreviewCardTriggerState; /** * Show the preview card. */ show(): void; /** * Hide the preview card. */ hide(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[ngpPreviewCardTrigger]", ["ngpPreviewCardTrigger"], { "previewCard": { "alias": "ngpPreviewCardTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpPreviewCardTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpPreviewCardTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpPreviewCardTriggerOffset"; "required": false; "isSignal": true; }; "showDelay": { "alias": "ngpPreviewCardTriggerShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "ngpPreviewCardTriggerHideDelay"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpPreviewCardTriggerFlip"; "required": false; "isSignal": true; }; "shift": { "alias": "ngpPreviewCardTriggerShift"; "required": false; "isSignal": true; }; "container": { "alias": "ngpPreviewCardTriggerContainer"; "required": false; "isSignal": true; }; "anchor": { "alias": "ngpPreviewCardTriggerAnchor"; "required": false; "isSignal": true; }; "context": { "alias": "ngpPreviewCardTriggerContext"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpPreviewCardTriggerScrollBehavior"; "required": false; "isSignal": true; }; "cooldown": { "alias": "ngpPreviewCardTriggerCooldown"; "required": false; "isSignal": true; }; }, { "openChange": "ngpPreviewCardTriggerOpenChange"; }, never, never, true, never>; } interface NgpPreviewCardConfig { /** * Define the placement of the preview card relative to the trigger. * @default 'bottom' */ placement: NgpPreviewCardPlacement; /** * Define the offset of the preview card relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 4 */ offset: NgpOffset; /** * Define the delay before the preview card is shown. This is deliberately long so * that cards do not appear while the pointer travels across a page full of links. * @default 600 */ showDelay: number; /** * Define the delay before the preview card is hidden. * @default 300 */ hideDelay: number; /** * Define whether the preview card should flip when there is not enough space. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ flip: NgpFlip; /** * Configure shift behavior to keep the preview card in view. * Can be a boolean to enable/disable, or an object with padding and limiter options. * @default undefined (enabled by default in overlay) */ shift: NgpShift; /** * Define the container element or selector into which the preview card should be attached. * @default 'body' */ container: HTMLElement | string | null; /** * Defines how the preview card behaves when the window is scrolled. * @default 'reposition' */ scrollBehavior: 'reposition' | 'close'; /** * Cooldown duration in milliseconds. * When moving from one preview card to another within this duration, * the showDelay is skipped for the new card. * @default 300 */ cooldown: number; } /** * Provide the default PreviewCard configuration * @param config The PreviewCard configuration * @returns The provider */ declare function providePreviewCardConfig(config: Partial): Provider[]; /** * Apply the `ngpPreviewCard` directive to an element that represents the preview card. * This typically would be a `div` inside an `ng-template`. */ declare class NgpPreviewCard { /** * The unique id of the preview card. */ readonly id: _angular_core.InputSignal; protected readonly state: { id: _angular_core.WritableSignal; }; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpPreviewCardState { /** The unique id of the preview card. */ readonly id: Signal; } interface NgpPreviewCardProps { /** The unique id of the preview card. */ readonly id?: Signal; } declare const NgpPreviewCardStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ id: _angular_core.WritableSignal; }>>; declare const ngpPreviewCard: ({ id: _id }: NgpPreviewCardProps) => { id: _angular_core.WritableSignal; }; declare const injectPreviewCardState: { (): Signal<{ id: _angular_core.WritableSignal; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ id: _angular_core.WritableSignal; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ id: _angular_core.WritableSignal; }> | Signal<{ id: _angular_core.WritableSignal; } | null>; }; declare const providePreviewCardState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpPreviewCardArrow` directive to an element inside the preview card to * render an arrow pointing at the trigger. */ declare class NgpPreviewCardArrow { /** * Padding between the arrow and the edges of the preview card. * This prevents the arrow from overflowing the rounded corners. */ readonly padding: _angular_core.InputSignalWithTransform; private readonly state; /** * Set the padding between the arrow and the edges of the preview card. * @param value The padding value in pixels */ setPadding(value: number | undefined): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } declare const NgpPreviewCardArrowStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpPreviewCardArrow: ({ padding }: NgpOverlayArrowProps) => NgpOverlayArrowState; declare const injectPreviewCardArrowState: { (): _angular_core.Signal; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal | _angular_core.Signal; }; declare const providePreviewCardArrowState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; export { NgpPreviewCard, NgpPreviewCardArrow, NgpPreviewCardArrowStateToken, NgpPreviewCardStateToken, NgpPreviewCardTrigger, NgpPreviewCardTriggerStateToken, injectPreviewCardArrowState, injectPreviewCardState, injectPreviewCardTriggerState, ngpPreviewCard, ngpPreviewCardArrow, ngpPreviewCardTrigger, providePreviewCardArrowState, providePreviewCardConfig, providePreviewCardState, providePreviewCardTriggerState }; export type { NgpPreviewCardConfig, NgpPreviewCardPlacement, NgpPreviewCardProps, NgpPreviewCardState, NgpPreviewCardTriggerProps, NgpPreviewCardTriggerState };