import { IBox } from "../../core/types"; import { StyleProps } from '@chakra-ui/react'; import { IPopover } from '../Popover/types'; import { IButton } from '../Button/types'; import { ISearchInput } from '../Input/types'; import { IMenu } from '../Menu/types'; import React from 'react'; /** * Defines the context for the DropdownV2 component. */ export interface IDropdownContext { /** * Indicates if the dropdown is open. */ isOpen: boolean; /** * Indicates if the dropdown is disabled. */ isDisabled: boolean; /** * Handler to close the dropdown. */ onClose: () => void; /** * Handler to open the dropdown. */ onOpen: () => void; } /** * Props for the Dropdown component. */ export interface IDropdown extends IPopover { /** * Trigger area for Popover. */ children: React.ReactNode; /** * Render prop - renders popover content. */ render?: (props: RenderContentProp) => React.ReactNode; /** * Controlled open state. */ isOpen?: boolean; /** * Disabled popover. */ isDisabled?: boolean; /** * Event handler for when popover is opened or closed. */ onChangeVisibility?: (isOpen: boolean) => void; /** * Show Arrow on the popover. */ showArrow?: boolean; /** * Close dropdown when clicking inside items. * @default true */ closeOnClickInside?: boolean; } /** * DropdownV2 component used as a templating solution when no ready-made components (like Menu and Select) fit the requirements. * */ export interface IDropdownComponent extends React.FC { /** * The Trigger sub-component for DropdownV2. */ Trigger: React.FC; /** * The Content sub-component for DropdownV2. */ Content: React.FC; /** * The Button sub-component for DropdownV2. */ Button: React.FC; /** * The Search sub-component for DropdownV2. */ Search: React.FC; } /** * Props for the DropdownV2 Menu sub-component. */ export interface IDropdownMenu extends IMenu { } /** * Props for rendering custom content within DropdownV2. */ export declare type RenderContentProp = { onClose: () => void; }; /** * Props for the DropdownV2 Button sub-component. */ export interface IDropdownButton extends Omit { /** * Optional tooltip for the button. */ tooltip?: string | React.ReactNode; /** * Shows the arrow icon on the button. */ showArrow?: boolean; } /** * Props for the PopoverContent sub-component of DropdownV2. */ export interface IDropdownContent extends IBox { /** * Content inside the popover. */ children?: React.ReactNode; /** * Shows the arrow on the popover. */ showArrow?: boolean; /** * Handler for clicks outside the popover. */ onClickOutside?: () => void; /** * Custom styles for the popover wrapper. */ wrapperStyles?: StyleProps; } /** * Props for the DropdownV2 Search sub-component. * * Note: The search does not have inherent functionality; it is just for styling. Input handling and filtering should be managed externally. */ export interface IDropdownSearch extends ISearchInput { } export interface IDropdownTrigger extends IBox { }