-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
/
Copy pathLoadingButton.d.ts
80 lines (75 loc) · 2.97 KB
/
LoadingButton.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { ExtendButton, ExtendButtonTypeMap, ButtonClasses } from '@mui/material/Button';
import { OverrideProps } from '@mui/material/OverridableComponent';
import { Theme } from '@mui/material/styles';
import { SxProps } from '@mui/system';
export interface LoadingButtonOwnProps {
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<ButtonClasses> & {
/** Styles applied to the root element. */
root?: string;
/** Styles applied to the span element that wraps the children. */
label?: string;
/** Styles applied to the root element if `loading={true}`. */
loading?: string;
/** Styles applied to the loadingIndicator element. */
loadingIndicator?: string;
/** Styles applied to the loadingIndicator element if `loadingPosition="center"`. */
loadingIndicatorCenter?: string;
/** Styles applied to the loadingIndicator element if `loadingPosition="start"`. */
loadingIndicatorStart?: string;
/** Styles applied to the loadingIndicator element if `loadingPosition="end"`. */
loadingIndicatorEnd?: string;
/** Styles applied to the endIcon element if `loading={true}` and `loadingPosition="end"`. */
endIconLoadingEnd?: string;
/** Styles applied to the startIcon element if `loading={true}` and `loadingPosition="start"`. */
startIconLoadingStart?: string;
};
/**
* If `true`, the loading indicator is shown and the button becomes disabled.
* @default false
*/
loading?: boolean;
/**
* Element placed before the children if the button is in loading state.
* The node should contain an element with `role="progressbar"` with an accessible name.
* By default we render a `CircularProgress` that is labelled by the button itself.
* @default <CircularProgress color="inherit" size={16} />
*/
loadingIndicator?: React.ReactNode;
/**
* The loading indicator can be positioned on the start, end, or the center of the button.
* @default 'center'
*/
loadingPosition?: 'start' | 'end' | 'center';
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
}
export type LoadingButtonTypeMap<
AdditionalProps = {},
RootComponent extends React.ElementType = 'button',
> = ExtendButtonTypeMap<{
props: AdditionalProps & LoadingButtonOwnProps;
defaultComponent: RootComponent;
}>;
/**
*
* Demos:
*
* - [Button Group](https://mui.com/material-ui/react-button-group/)
* - [Button](https://mui.com/material-ui/react-button/)
*
* API:
*
* - [LoadingButton API](https://mui.com/material-ui/api/loading-button/)
* - inherits [Button API](https://mui.com/material-ui/api/button/)
*/
declare const LoadingButton: ExtendButton<LoadingButtonTypeMap>;
export type LoadingButtonProps<
RootComponent extends React.ElementType = LoadingButtonTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<LoadingButtonTypeMap<AdditionalProps, RootComponent>, RootComponent>;
export default LoadingButton;