monday-ui-react-core
Version:
Official monday.com UI resources for application development in React.js
125 lines (124 loc) • 4.5 kB
TypeScript
import React from "react";
import { TooltipProps } from "../Tooltip/Tooltip";
import { ElementContent, VibeComponent, VibeComponentProps } from "../../types";
import { MenuButtonComponentPosition, MenuButtonSize } from "./MenuButtonConstants";
import { DialogOffset, DialogPosition } from "../../constants";
import { HideShowEvent } from "../Dialog/consts/dialog-show-hide-event";
import { DialogSize } from "../DialogContentContainer/DialogContentContainerConstants";
export interface MenuButtonProps extends VibeComponentProps {
/**
* @deprecated - use className instead
*/
componentClassName?: string;
/**
* Control the button's selected state
*/
active?: boolean;
/**
*Class name to add to the button when the dialog is open
*/
openDialogComponentClassName?: string;
/**
* Receives React Component
*/
component?: (() => JSX.Element) | React.ElementType;
size?: MenuButtonSize;
open?: boolean;
onClick?: (event: React.MouseEvent) => void;
zIndex?: number;
ariaLabel?: string;
/**
* @deprecated use closeMenuOnItemClick instead
*/
closeDialogOnContentClick?: boolean;
dialogClassName?: string;
/**
* main - `dialogOffset.main` - main axis offset; `dialogOffset.secondary` secondary axis offset
*/
dialogOffset?: DialogOffset;
dialogPaddingSize?: DialogSize;
dialogPosition?: DialogPosition;
dialogShowTriggerIgnoreClass?: string;
dialogHideTriggerIgnoreClass?: string;
/**
* the container selector in which to append the dialog
* for examples: "body" , ".my-class", "#my-id"
*/
dialogContainerSelector?: string;
/**
* Dialog Alignment
*/
startingEdge?: string;
onMenuShow?: () => void;
onMenuHide?: () => void;
/**
* Text to be displayed after the icon
*/
text?: string;
disabled?: boolean;
tooltipContent?: string;
/**
Remove "Tab" key from the hide trigger
*/
removeTabCloseTrigger?: boolean;
/**
is an array with the content of types:
CLICK, CLICK_OUTSIDE, ESCAPE_KEY, TAB_KEY, MOUSE_ENTER, MOUSE_LEAVE,
ENTER, MOUSE_DOWN, FOCUS, BLUR, CONTENT_CLICK
*/
tooltipTriggers?: HideShowEvent | HideShowEvent[];
/**
* the disabled/tooltip position of the menu button - one of the MenuButton.dialogPositions
*/
tooltipPosition?: DialogPosition;
/**
* Tooltip Element Wrapper ClassName
*/
tooltipReferenceClassName?: string;
tooltipProps?: Partial<TooltipProps>;
/**
* When the MenuButton is hidden hide the dialog and tooltip as well
*/
hideWhenReferenceHidden?: boolean;
/**
* @deprecated - use tooltipContent instead
*/
disabledReason?: string;
children?: ElementContent;
/**
* Specifies whether to render the component before or after the text
*/
componentPosition?: (typeof MenuButtonComponentPosition)[keyof typeof MenuButtonComponentPosition];
/**
* Element to be used as the trigger element for the Menu - default is button
*/
triggerElement?: React.ElementType;
/**
* Close the menu when an item is clicked
*/
closeMenuOnItemClick?: boolean;
/**
* Whether tooltip should appear only when the trigger element is hovered and not the menu dialog
*/
showTooltipOnlyOnTriggerElement?: boolean;
}
declare const _default: ((VibeComponent<MenuButtonProps & React.RefAttributes<HTMLElement>, HTMLElement> & Partial<{
sizes: typeof MenuButtonSize;
paddingSizes: typeof DialogSize;
dialogPositions: typeof DialogPosition;
hideTriggers: typeof import("../../constants").HideShowEvent;
componentPositions: typeof MenuButtonComponentPosition;
}>) | (React.FC<MenuButtonProps & React.RefAttributes<HTMLElement>> & Partial<{
sizes: typeof MenuButtonSize;
paddingSizes: typeof DialogSize;
dialogPositions: typeof DialogPosition;
hideTriggers: typeof import("../../constants").HideShowEvent;
componentPositions: typeof MenuButtonComponentPosition;
}>)) & {
sizes: typeof MenuButtonSize;
paddingSizes: typeof DialogSize;
dialogPositions: typeof DialogPosition;
hideTriggers: typeof import("../../constants").HideShowEvent;
componentPositions: typeof MenuButtonComponentPosition;
};
export default _default;