1 | import * as React from "react";
|
2 | import PopperJS from "popper.js";
|
3 | import { BoxProps } from "../Box";
|
4 | import { PopperProps } from "../Popper";
|
5 | import { PseudoBoxProps } from "../PseudoBox";
|
6 |
|
7 | interface InternalState {
|
8 | isOpen?: boolean;
|
9 | onClose?: () => void;
|
10 | }
|
11 |
|
12 | type MenuChildren =
|
13 | | {
|
14 | children: React.ReactNode;
|
15 | }
|
16 | | { children: (props: InternalState) => React.ReactNode };
|
17 |
|
18 | export interface IMenu {
|
19 | isOpen?: boolean;
|
20 | autoSelect?: boolean;
|
21 | closeOnBlur?: boolean;
|
22 | closeOnSelect?: boolean;
|
23 | }
|
24 |
|
25 | export type MenuProps = IMenu & MenuChildren;
|
26 | declare const Menu: React.FC<MenuProps>;
|
27 | export default Menu;
|
28 |
|
29 | export interface IMenuButton {
|
30 | onClick?: React.MouseEventHandler<HTMLElement>;
|
31 | onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
32 | }
|
33 | export type MenuButtonProps = PseudoBoxProps & IMenuButton;
|
34 | export const MenuButton: React.FC<MenuButtonProps>;
|
35 |
|
36 | export interface IMenuList {
|
37 | onKeydown?: React.KeyboardEventHandler<HTMLElement>;
|
38 | onBlur?: React.FocusEventHandler<HTMLElement>;
|
39 | }
|
40 | export type MenuListProps = IMenuList & PopperProps;
|
41 | export const MenuList: React.FC<MenuListProps>;
|
42 |
|
43 | interface IMenuItem {
|
44 | isDisabled?: boolean;
|
45 | role?: "menuitem" | "menuitemradio" | "menuitemcheckbox";
|
46 | onClick?: React.KeyboardEventHandler<HTMLElement>;
|
47 | onMouseLeave?: React.MouseEventHandler<HTMLElement>;
|
48 | onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
49 | onMouseEnter?: React.MouseEventHandler<HTMLElement>;
|
50 | }
|
51 | export type MenuItemProps = IMenuItem & PseudoBoxProps;
|
52 |
|
53 | export const MenuItem: React.FC<MenuItemProps>;
|
54 |
|
55 | interface IMenuGroup {
|
56 | title?: string;
|
57 | children: React.ReactNode;
|
58 | }
|
59 | export type MenuGroupProps = IMenuGroup & BoxProps;
|
60 | export const MenuGroup: React.FC<MenuGroupProps>;
|
61 |
|
62 | export const MenuDivider: React.FC<BoxProps>;
|
63 | export * from "./MenuOption";
|