/** * Root component for the ConsentDialogTrigger compound component. * Provides context and handles portal rendering. * * @packageDocumentation */ import { type ReactNode } from 'react'; import type { CornerPosition, TriggerVisibility } from '../types'; import { type UseDraggableReturn } from '../use-draggable'; /** * Context value for the ConsentDialogTrigger compound component. */ export interface TriggerContextValue { /** Current corner position */ corner: CornerPosition; /** Whether currently dragging */ isDragging: boolean; /** Whether transitioning to a new corner */ isSnapping: boolean; /** Whether the last interaction was a drag */ wasDragged: () => boolean; /** Drag event handlers */ handlers: UseDraggableReturn['handlers']; /** Current transform style for drag offset */ dragStyle: React.CSSProperties; /** Branding from consent manager */ branding: string; /** Open the consent dialog */ openDialog: () => void; /** Whether the trigger should be visible */ isVisible: boolean; } declare const TriggerContext: import("react").Context; /** * Hook to access the trigger context. * Must be used within a ConsentDialogTrigger.Root component. */ export declare function useTriggerContext(): TriggerContextValue; /** * Props for the Root component. */ export interface TriggerRootProps { children: ReactNode; /** * Default corner position for the trigger. * @default 'bottom-right' */ defaultPosition?: CornerPosition; /** * Whether to persist position in localStorage. * @default true */ persistPosition?: boolean; /** * Controls when the trigger is visible. * @default 'after-consent' */ showWhen?: TriggerVisibility; /** * Callback when position changes. */ onPositionChange?: (position: CornerPosition) => void; /** * Callback when trigger is clicked. */ onClick?: () => void; } /** * Root component that provides context and handles positioning. * * @example * ```tsx * * * * * * ``` */ export declare function TriggerRoot({ children, defaultPosition, persistPosition: shouldPersist, showWhen, onPositionChange, onClick, }: TriggerRootProps): ReactNode; export declare namespace TriggerRoot { var displayName: string; } export { TriggerContext };