1 | import * as React from 'react';
|
2 | import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
3 |
|
4 | export interface BadgeOrigin {
|
5 | vertical: 'top' | 'bottom';
|
6 | horizontal: 'left' | 'right';
|
7 | }
|
8 |
|
9 | export interface BadgeTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
10 | props: P & {
|
11 | |
12 |
|
13 |
|
14 | anchorOrigin?: BadgeOrigin;
|
15 | |
16 |
|
17 |
|
18 | overlap?: 'rectangle' | 'circle' | 'rectangular' | 'circular';
|
19 | |
20 |
|
21 |
|
22 | badgeContent?: React.ReactNode;
|
23 | |
24 |
|
25 |
|
26 | children?: React.ReactNode;
|
27 | |
28 |
|
29 |
|
30 | color?: 'primary' | 'secondary' | 'default' | 'error';
|
31 | |
32 |
|
33 |
|
34 | invisible?: boolean;
|
35 | |
36 |
|
37 |
|
38 | max?: number;
|
39 | |
40 |
|
41 |
|
42 | showZero?: boolean;
|
43 | |
44 |
|
45 |
|
46 | variant?: 'standard' | 'dot';
|
47 | };
|
48 | defaultComponent: D;
|
49 | classKey: BadgeClassKey;
|
50 | }
|
51 |
|
52 | export type BadgeClassKey =
|
53 | | 'root'
|
54 | | 'badge'
|
55 | | 'colorPrimary'
|
56 | | 'colorSecondary'
|
57 | | 'colorError'
|
58 | | 'dot'
|
59 | | 'anchorOriginTopRightRectangle'
|
60 | | 'anchorOriginBottomRightRectangle'
|
61 | | 'anchorOriginTopLeftRectangle'
|
62 | | 'anchorOriginBottomLeftRectangle'
|
63 | | 'anchorOriginTopRightCircle'
|
64 | | 'anchorOriginBottomRightCircle'
|
65 | | 'anchorOriginTopLeftCircle'
|
66 | | 'anchorOriginTopRightRectangular'
|
67 | | 'anchorOriginBottomRightRectangular'
|
68 | | 'anchorOriginTopLeftRectangular'
|
69 | | 'anchorOriginBottomLeftRectangular'
|
70 | | 'anchorOriginTopRightCircular'
|
71 | | 'anchorOriginBottomRightCircular'
|
72 | | 'anchorOriginTopLeftCircular'
|
73 | | 'invisible';
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | declare const Badge: OverridableComponent<BadgeTypeMap>;
|
86 |
|
87 | export type BadgeProps<
|
88 | D extends React.ElementType = BadgeTypeMap['defaultComponent'],
|
89 | P = {}
|
90 | > = OverrideProps<BadgeTypeMap<P, D>, D>;
|
91 |
|
92 | export default Badge;
|