import { DropdownButtonWidth, closeOutsideEvents } from "./types"; import { FC, HTMLAttributes, PropsWithChildren } from "react"; export interface NvDropdownProps extends Omit, "onToggle"> { /** Event type for useOutsideClick. */ closeOutsideClickEventType?: closeOutsideEvents; /** If true, the component is disabled. */ disabled?: boolean; /** If true, the dropdown will take up the full width of its container. */ full?: boolean; /** Set position: static CSS style for the dropdown container. */ isContainerStatic?: boolean; /** Allows to control whether the dropdown is open. */ isOpen?: boolean; /** If true, the dropdown container is rendered on top if it does not fit on the screen. */ useAutoPosition?: boolean; /** If true, toggles the dropdown after dropdown button click. */ useButtonClick?: boolean; /** If true, closes the dropdown after an outside click. */ useOutsideClick?: boolean; /** Applies CSS style for the dropdown button: if flexible, sets width: 100%; if max-content, sets width: max-content.*/ width?: DropdownButtonWidth; /** Callback fired when the dropdown is toggled. */ onToggle?: (value: boolean) => void; /** Callback fired when the dropdown is closed by outside click. */ onOutsideClick?: (args?: unknown) => unknown; } export type Coords = { left: number; top: number; marginTop: number; width: number; }; /** * Functional component for a dropdown menu with customizable options and behavior. * * @param {boolean} disabled Indicates if the dropdown is disabled. * @param {boolean} full Indicates if the dropdown should take full width. * @param {boolean} isContainerStatic Indicates if the dropdown container is positioned statically. * @param {boolean} isOpen Indicates if the dropdown is open (controlled version). * @param {boolean} useAutoPosition Indicates if the dropdown should position itself automatically. * @param {boolean} useButtonClick Indicates if the dropdown should open/close on button click. * @param {boolean} useOutsideClick Indicates if the dropdown should close on an outside click. * @param {number} width The width of the dropdown button. * @param {closeOutsideEvents} closeOutsideClickEventType The type of event to close the dropdown on an outside click. * @param {func} onToggle Function to handle dropdown open/close. * @param {func} onOutsideClick Function to handle actions on an outside click. * @param {ReactNode} children The content to be displayed within the dropdown. */ declare const NvDropdown: FC>; export default NvDropdown;