/** * Type definitions for the Popover component. * * Provides all prop interfaces, slot types, context types, and configuration * for the animated popover system built on Base UI and Motion. * * @module @mks2508/mks-ui/react/ui/Popover/Popover.types */ import type * as React from 'react'; import type { Popover as PopoverPrimitive } from '@base-ui/react/popover'; import type { HTMLMotionProps } from 'motion/react'; import type { SlotOverrides, IBaseConfig } from '../../../core/types'; /** * Visual regions available for class-name overrides via the `slots` prop. * * @example * ```tsx * * ``` */ export type PopoverSlot = 'root' | 'popup' | 'trigger' | 'positioner' | 'backdrop' | 'arrow' | 'title' | 'description' | 'close'; /** * Extended configuration for the Popover component. * Inherits base animation settings and adds popover-specific options. * * @example * ```typescript * const config: IPopoverConfig = { * animation: { duration: 0.25, easing: 'ease-out' }, * }; * ``` */ export interface IPopoverConfig extends IBaseConfig { } /** * Internal context type shared between Popover sub-components. * Tracks open state so AnimatePresence can coordinate enter/exit animations. * * @example * ```tsx * const { isOpen, setIsOpen } = usePopover(); * ``` */ export type PopoverContextType = { /** Whether the popover is currently open. */ isOpen: boolean; /** Callback to change the open state. */ setIsOpen: IPopoverProps['onOpenChange']; }; /** * Props for the root `Popover` component. * Wraps Base UI Popover.Root with controlled-state support and context provider. * * @example * ```tsx * * Toggle * * * Content here * * * * ``` */ export interface IPopoverProps extends React.ComponentProps { /** Style slot overrides for the root wrapper. */ slots?: SlotOverrides; /** Component configuration. */ config?: IPopoverConfig; } /** * Props for the `PopoverTrigger` component. * Renders the element that toggles the popover on interaction. * * @example * ```tsx * * * * ``` */ export interface IPopoverTriggerProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverPortal` component. * Renders children into a React portal with AnimatePresence for exit animations. * The `keepMounted` prop is handled internally and cannot be overridden. * * @example * ```tsx * * * ... * * * ``` */ export interface IPopoverPortalProps extends Omit, 'keepMounted'> { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverPositioner` component. * Handles automatic positioning relative to the trigger. * * @example * ```tsx * * Content * * ``` */ export interface IPopoverPositionerProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverPopup` component. * The main content container with scale entrance animation. * Accepts all HTMLMotionProps for full animation control. * * @example * ```tsx * * Info * Details here. * * ``` */ export interface IPopoverPopupProps extends Omit, 'render'>, keyof HTMLMotionProps<'div'>>, HTMLMotionProps<'div'> { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverBackdrop` component. * Optional overlay rendered behind the popover. * * @example * ```tsx * * ``` */ export interface IPopoverBackdropProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverArrow` component. * Renders a directional arrow pointing toward the trigger. * * @example * ```tsx * * ``` */ export interface IPopoverArrowProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverTitle` component. * Renders the accessible title for the popover. * * @example * ```tsx * Quick Info * ``` */ export interface IPopoverTitleProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverDescription` component. * Renders the accessible description for the popover. * * @example * ```tsx * Additional details about this item. * ``` */ export interface IPopoverDescriptionProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } /** * Props for the `PopoverClose` component. * Renders a button that closes the popover when clicked. * * @example * ```tsx * * * * ``` */ export interface IPopoverCloseProps extends React.ComponentProps { /** Style slot overrides. */ slots?: SlotOverrides; } //# sourceMappingURL=Popover.types.d.ts.map