@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
58 lines (57 loc) • 2.52 kB
TypeScript
/**
* MSKCC 2021, 2023
*/
import PropTypes from 'prop-types';
import React from 'react';
import { MskIconId } from '../../Icon/MskIcon';
export interface ControlMenuButtonProps {
/** Provide a unique id for the avatar-menu */
id?: string | undefined;
/** Specify custom content for the button */
buttonContent?: React.ReactNode;
/** Provide a custom className */
className?: string;
/** Provide children to be rendered inside of the AvatarMenu */
children?: React.ReactNode | undefined;
icon: MskIconId;
/** A label describing the Menu. */
label?: string | undefined;
/** Used to disable the avatar's button */
disabled?: boolean;
/** Provide a level for the menu */
level?: number | undefined;
/** Provide custom class for menu */
menuClassName?: string;
/** Whether the Menu is open or not. */
open?: boolean | undefined;
/** Specify a DOM node where the Menu should be rendered in. Defaults to document.body. */
target?: Element | undefined;
/** Provide an optional function to be called when the Menu should be closed. */
onClose?(): void;
/** Provide an optional function to be called when the Menu is opened. */
onOpen?(): void;
/** Provide a callback function for when the menu is opened */
onKeyDown?(evt: React.KeyboardEvent<HTMLUListElement>): void;
}
/**
* @component AvatarMenu component creates a menu button that feature's the user's avatar
* @see https://react.carbondesignsystem.com/?path=/story/components-menu--playground
*/
export declare function ControlMenuButton({ icon, buttonContent, children, className, disabled, menuClassName, target, label, onClose, onOpen, onKeyDown, ...rest }: ControlMenuButtonProps): JSX.Element;
export declare namespace ControlMenuButton {
var displayName: string;
var propTypes: {
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
className: PropTypes.Requireable<string>;
disabled: PropTypes.Requireable<boolean>;
id: PropTypes.Requireable<string>;
label: PropTypes.Requireable<string>;
level: PropTypes.Requireable<number>;
onClose: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
open: PropTypes.Requireable<boolean>;
target: PropTypes.Requireable<PropTypes.ReactElementLike>;
url: PropTypes.Requireable<string>;
};
}