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