/**
* Type definitions for the AlertDialog component.
*
* All interfaces follow the IPrefix convention. Type aliases do not.
* Slot types define the visual regions available for style overrides.
*
* @module @mks2508/mks-ui/react/ui/AlertDialog/AlertDialog.types
*/
import type { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
import type { HTMLMotionProps } from 'motion/react';
import type { IBaseConfig, SlotOverrides } from '../../../core/types';
/**
* Named visual regions of the AlertDialog that can be styled via the `slots` prop.
*
* | Slot | Element |
* |---------------|------------------------------------------------|
* | `root` | Logical root (no DOM element by default) |
* | `backdrop` | Semi-transparent overlay behind the dialog |
* | `popup` | Main dialog container with flip animation |
* | `header` | Header area containing title and description |
* | `footer` | Footer area for action buttons |
* | `title` | Dialog title text |
* | `description` | Descriptive text below the title |
* | `close` | Close/cancel button |
*
* @example
* ```tsx
*
* ...
*
* ```
*/
export type AlertDialogSlot = 'root' | 'backdrop' | 'popup' | 'header' | 'footer' | 'title' | 'description' | 'close';
/**
* Direction from which the AlertDialog flips into view.
* Controls the 3D perspective rotation axis and initial angle.
*
* @example
* ```tsx
* ...
* ```
*/
export type AlertDialogFlipDirection = 'top' | 'bottom' | 'left' | 'right';
/**
* Internal context for the AlertDialog root, tracks open state.
*/
export type AlertDialogContextType = {
/** Whether the dialog is currently open. */
isOpen: boolean;
/** Callback to update open state. */
setIsOpen: IAlertDialogProps['onOpenChange'];
};
/**
* Behavioral configuration for the AlertDialog component.
* Extends {@link IBaseConfig} with alert-dialog-specific options.
*
* @example
* ```tsx
*
* ```
*/
export interface IAlertDialogConfig extends IBaseConfig {
/**
* Direction from which the dialog popup flips into view.
* Passed down to AlertDialogPopup if not set directly on the popup.
*
* @default 'top'
*/
from?: AlertDialogFlipDirection;
}
/**
* Props for the root AlertDialog component.
*
* @example
* ```tsx
* console.log(open)}>
* Open
*
*
* ...
*
*
* ```
*/
export interface IAlertDialogProps extends React.ComponentProps {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
/** Behavioral configuration. */
config?: IAlertDialogConfig;
}
/**
* Props for the AlertDialogTrigger button.
*
* @example
* ```tsx
*
* Delete Account
*
* ```
*/
export interface IAlertDialogTriggerProps extends React.ComponentProps {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogPortal.
* The `keepMounted` prop is omitted because it is managed internally
* by the AnimatePresence animation logic.
*
* @example
* ```tsx
*
*
* ...
*
* ```
*/
export interface IAlertDialogPortalProps extends Omit, 'keepMounted'> {
}
/**
* Props for the AlertDialogBackdrop overlay.
*
* Extends Motion's HTMLMotionProps for full animation control.
* The `render` prop from the base primitive is omitted because
* it is managed internally by the motion wrapper.
*
* @example
* ```tsx
*
* ```
*/
export interface IAlertDialogBackdropProps extends Omit, 'render'>, keyof HTMLMotionProps<'div'>>, HTMLMotionProps<'div'> {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogPopup container.
*
* Extends Motion's HTMLMotionProps for full animation control.
* The `render` prop from the base primitive is omitted because
* it is managed internally by the motion wrapper.
*
* @example
* ```tsx
*
* ...
* ...
*
* ```
*/
export interface IAlertDialogPopupProps extends Omit, 'render'>, keyof HTMLMotionProps<'div'>>, HTMLMotionProps<'div'> {
/**
* Direction from which the popup flips into view.
* Controls 3D perspective rotation.
*
* @default 'top'
*/
from?: AlertDialogFlipDirection;
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogClose button.
*
* @example
* ```tsx
* Cancel
* ```
*/
export interface IAlertDialogCloseProps extends React.ComponentProps {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogHeader layout wrapper.
*
* @example
* ```tsx
*
* Are you sure?
* This cannot be undone.
*
* ```
*/
export interface IAlertDialogHeaderProps extends React.ComponentProps<'div'> {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogFooter layout wrapper.
*
* @example
* ```tsx
*
* Cancel
*
*
* ```
*/
export interface IAlertDialogFooterProps extends React.ComponentProps<'div'> {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogTitle text element.
*
* @example
* ```tsx
*
* Confirm Deletion
*
* ```
*/
export interface IAlertDialogTitleProps extends React.ComponentProps {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
/**
* Props for the AlertDialogDescription text element.
*
* @example
* ```tsx
*
* This action is permanent and cannot be reversed.
*
* ```
*/
export interface IAlertDialogDescriptionProps extends React.ComponentProps {
/** Style overrides for individual visual regions. */
slots?: SlotOverrides;
}
//# sourceMappingURL=AlertDialog.types.d.ts.map