import * as i0 from '@angular/core';
import { WritableSignal, InputSignal, InputSignalWithTransform, TemplateRef, OutputEmitterRef } from '@angular/core';
/**
* Color variant for the confirm button styling.
*/
type ConfirmColor = 'primary' | 'warn';
/**
* Context provided to custom confirmation templates.
*/
interface ConfirmTemplateContext {
/** The confirmation message. */
$implicit: string;
/** The dialog title, if provided. */
title: string | undefined;
/** Function to confirm the action. */
confirm: () => void;
/** Function to cancel the action. */
cancel: () => void;
/** Whether an async operation is in progress. */
loading: boolean;
/** Function to set the loading state. */
setLoading: (value: boolean) => void;
}
/**
* Confirmation directive — intercepts clicks and displays a confirmation panel
* before allowing the action to proceed.
*
* The directive acts as an output gate: it captures clicks, shows confirmation UI,
* and emits `true` (confirmed) or `false` (cancelled) through its output.
*
* @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,
* `--color-foreground`, `--color-muted-foreground`, `--color-backdrop`,
* `--shadow-overlay`, `--radius-popover`
*
* @example Basic confirmation
* ```html
*
* ```
*
* @example Destructive action with warn styling
* ```html
*
* ```
*
* @example Custom template
* ```html
*
*
*
*
*
{{ message }}
*
*
*
*
*
*
* ```
*/
declare class ComConfirm {
private readonly overlay;
private readonly elementRef;
private readonly viewContainerRef;
private readonly injector;
private readonly destroyRef;
private readonly platformId;
private overlayRef;
private panelInstance;
private readonly titleId;
private readonly descriptionId;
/** Whether the confirmation panel is currently open. */
protected readonly isOpen: WritableSignal;
/** The confirmation message to display. */
readonly confirmMessage: InputSignal;
/** Optional title for the confirmation dialog. */
readonly confirmTitle: InputSignal;
/** Label for the confirm button. */
readonly confirmLabel: InputSignal;
/** Label for the cancel button. */
readonly cancelLabel: InputSignal;
/** Color variant for the confirm button. */
readonly confirmColor: InputSignal;
/** When true, clicks pass through without showing confirmation. */
readonly confirmDisabled: InputSignalWithTransform;
/** Whether to show a backdrop behind the panel. */
readonly confirmBackdrop: InputSignalWithTransform;
/** Custom template for the panel content. */
readonly confirmTpl: InputSignal | undefined>;
/**
* Emits `true` when confirmed, `false` when cancelled or navigated away.
* This is the main directive output — acts as an output gate for the action.
*/
readonly comConfirm: OutputEmitterRef;
private readonly panelConfig;
constructor();
/** Programmatically open the confirmation dialog. */
open(): void;
/** Programmatically close the confirmation dialog (emits false). */
close(): void;
protected onTriggerClick(event: Event): void;
private createOverlay;
private attachPanel;
private handleConfirm;
private handleCancel;
private closePanel;
private handleDetachment;
private disposeOverlay;
private returnFocusToTrigger;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* CVA variants for the confirmation panel backdrop.
*
* @tokens `--color-backdrop`
*/
declare const confirmBackdropVariants: (props?: {
visible?: boolean;
}) => string;
/**
* CVA variants for the confirmation panel container.
*
* @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-overlay`, `--radius-popover`
*/
declare const confirmPanelVariants: (props?: {
visible?: boolean;
}) => string;
/**
* CVA variants for the confirmation panel title.
*
* @tokens `--color-foreground`
*/
declare const confirmTitleVariants: () => string;
/**
* CVA variants for the confirmation panel message.
*
* @tokens `--color-muted-foreground`
*/
declare const confirmMessageVariants: () => string;
/**
* CVA variants for the confirmation panel footer.
*/
declare const confirmFooterVariants: () => string;
export { ComConfirm, confirmBackdropVariants, confirmFooterVariants, confirmMessageVariants, confirmPanelVariants, confirmTitleVariants };
export type { ConfirmColor, ConfirmTemplateContext };