UNPKG

1.45 kBTypeScriptView Raw
1import { PropTypes } from '..';
2import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
3import { OverrideProps } from '../OverridableComponent';
4
5export type ButtonTypeMap<
6 P = {},
7 D extends React.ElementType = 'button'
8> = ExtendButtonBaseTypeMap<{
9 props: P & {
10 color?: PropTypes.Color;
11 disableElevation?: boolean;
12 disableFocusRipple?: boolean;
13 endIcon?: React.ReactNode;
14 fullWidth?: boolean;
15 href?: string;
16 size?: 'small' | 'medium' | 'large';
17 startIcon?: React.ReactNode;
18 variant?: 'text' | 'outlined' | 'contained';
19 };
20 defaultComponent: D;
21 classKey: ButtonClassKey;
22}>;
23
24declare const Button: ExtendButtonBase<ButtonTypeMap>;
25
26export type ButtonProps<
27 D extends React.ElementType = ButtonTypeMap['defaultComponent'],
28 P = {}
29> = OverrideProps<ButtonTypeMap<P, D>, D>;
30
31export type ButtonClassKey =
32 | 'root'
33 | 'label'
34 | 'text'
35 | 'textPrimary'
36 | 'textSecondary'
37 | 'outlined'
38 | 'outlinedPrimary'
39 | 'outlinedSecondary'
40 | 'contained'
41 | 'containedPrimary'
42 | 'containedSecondary'
43 | 'disableElevation'
44 | 'focusVisible'
45 | 'disabled'
46 | 'colorInherit'
47 | 'textSizeSmall'
48 | 'textSizeLarge'
49 | 'outlinedSizeSmall'
50 | 'outlinedSizeLarge'
51 | 'containedSizeSmall'
52 | 'containedSizeLarge'
53 | 'sizeSmall'
54 | 'sizeLarge'
55 | 'fullWidth'
56 | 'startIcon'
57 | 'endIcon'
58 | 'iconSizeSmall'
59 | 'iconSizeMedium'
60 | 'iconSizeLarge';
61
62export default Button;