1 | import * as React from 'react';
|
2 | import { SxProps } from '@mui/system';
|
3 | import { OverridableStringUnion } from '@mui/types';
|
4 | import { Theme } from '../styles';
|
5 | import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
6 | import { AvatarClasses } from './avatarClasses';
|
7 | import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
|
8 |
|
9 | export interface AvatarSlots {
|
10 | |
11 |
|
12 |
|
13 |
|
14 |
|
15 | img: React.JSXElementConstructor<React.ImgHTMLAttributes<HTMLImageElement>>;
|
16 | }
|
17 |
|
18 | export interface AvatarPropsVariantOverrides {}
|
19 |
|
20 | export type AvatarSlotsAndSlotProps = CreateSlotsAndSlotProps<
|
21 | AvatarSlots,
|
22 | {
|
23 | img: SlotProps<
|
24 | React.ElementType<React.ImgHTMLAttributes<HTMLImageElement>>,
|
25 | {},
|
26 | AvatarOwnProps
|
27 | >;
|
28 | }
|
29 | >;
|
30 |
|
31 | export interface AvatarOwnProps {
|
32 | |
33 |
|
34 |
|
35 |
|
36 | alt?: string;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | children?: React.ReactNode;
|
42 | |
43 |
|
44 |
|
45 | classes?: Partial<AvatarClasses>;
|
46 | |
47 |
|
48 |
|
49 |
|
50 | imgProps?: React.ImgHTMLAttributes<HTMLImageElement> & {
|
51 | sx?: SxProps<Theme>;
|
52 | };
|
53 | |
54 |
|
55 |
|
56 | sizes?: string;
|
57 | |
58 |
|
59 |
|
60 | src?: string;
|
61 | |
62 |
|
63 |
|
64 |
|
65 | srcSet?: string;
|
66 | |
67 |
|
68 |
|
69 | sx?: SxProps<Theme>;
|
70 | |
71 |
|
72 |
|
73 |
|
74 | variant?: OverridableStringUnion<'circular' | 'rounded' | 'square', AvatarPropsVariantOverrides>;
|
75 | }
|
76 |
|
77 | export interface AvatarTypeMap<
|
78 | AdditionalProps = {},
|
79 | RootComponent extends React.ElementType = 'div',
|
80 | > {
|
81 | props: AdditionalProps & AvatarOwnProps & AvatarSlotsAndSlotProps;
|
82 | defaultComponent: RootComponent;
|
83 | }
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | declare const Avatar: OverridableComponent<AvatarTypeMap>;
|
96 |
|
97 | export type AvatarProps<
|
98 | RootComponent extends React.ElementType = AvatarTypeMap['defaultComponent'],
|
99 | AdditionalProps = {},
|
100 | > = OverrideProps<AvatarTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
|
101 | component?: React.ElementType;
|
102 | };
|
103 |
|
104 | export default Avatar;
|