1 | import * as React from 'react';
|
2 | import { EventHandlers } from '../utils/types';
|
3 | import { MuiCancellableEventHandler } from '../utils/muiCancellableEvent';
|
4 | export interface UseButtonRootSlotOwnProps {
|
5 | 'aria-disabled'?: React.AriaAttributes['aria-disabled'];
|
6 | disabled?: boolean;
|
7 | tabIndex?: number;
|
8 | type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
9 | role?: React.AriaRole;
|
10 | onBlur: React.FocusEventHandler;
|
11 | onFocus: React.FocusEventHandler;
|
12 | onKeyDown: MuiCancellableEventHandler<React.KeyboardEvent>;
|
13 | onKeyUp: MuiCancellableEventHandler<React.KeyboardEvent>;
|
14 | onMouseDown: React.MouseEventHandler;
|
15 | onMouseLeave: React.MouseEventHandler;
|
16 | ref: React.RefCallback<Element> | null;
|
17 | }
|
18 | export type UseButtonRootSlotProps<TOther = {}> = TOther & UseButtonRootSlotOwnProps;
|
19 | export interface UseButtonParameters {
|
20 | |
21 |
|
22 |
|
23 |
|
24 | disabled?: boolean;
|
25 | |
26 |
|
27 |
|
28 |
|
29 | focusableWhenDisabled?: boolean;
|
30 | href?: string;
|
31 | onFocusVisible?: React.FocusEventHandler;
|
32 | rootRef?: React.Ref<Element>;
|
33 | tabIndex?: NonNullable<React.HTMLAttributes<any>['tabIndex']>;
|
34 | to?: string;
|
35 | |
36 |
|
37 |
|
38 |
|
39 | type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
40 | }
|
41 | export interface UseButtonReturnValue {
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 | getRootProps: <TOther extends EventHandlers = {}>(otherHandlers?: TOther) => UseButtonRootSlotProps<TOther>;
|
48 | |
49 |
|
50 |
|
51 | focusVisible: boolean;
|
52 | |
53 |
|
54 |
|
55 | setFocusVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
56 | |
57 |
|
58 |
|
59 | active: boolean;
|
60 | |
61 |
|
62 |
|
63 | rootRef: React.RefCallback<Element> | null;
|
64 | }
|