-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Expand file tree
/
Copy pathAvatarGroup.d.ts
More file actions
132 lines (122 loc) · 3.94 KB
/
AvatarGroup.d.ts
File metadata and controls
132 lines (122 loc) · 3.94 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import * as React from 'react';
import {
OverridableComponent,
OverridableStringUnion,
OverrideProps,
PartiallyRequired,
} from '@mui/types';
import { SxProps } from '@mui/system';
import { CreateThemeComponent, Theme } from '../stylesOptimized';
import { AvatarGroupClasses, AvatarGroupClassKey } from './avatarGroupClasses';
import Avatar from '../Avatar';
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
export interface AvatarGroupPropsVariantOverrides {}
export interface AvatarGroupComponentsPropsOverrides {}
export interface AvatarGroupSlots {
surplus: React.ElementType;
}
export type AvatarGroupSlotsAndSlotProps = CreateSlotsAndSlotProps<
AvatarGroupSlots,
{
/**
* @deprecated use `slotProps.surplus` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
* */
additionalAvatar: React.ComponentPropsWithRef<typeof Avatar> &
AvatarGroupComponentsPropsOverrides;
surplus: SlotProps<
React.ElementType<React.ComponentPropsWithRef<typeof Avatar>>,
AvatarGroupComponentsPropsOverrides,
AvatarGroupOwnerState
>;
}
>;
export interface AvatarGroupOwnProps extends AvatarGroupSlotsAndSlotProps {
/**
* The avatars to stack.
*/
children?: React.ReactNode;
/**
* Override or extend the styles applied to the component.
*/
classes?: Partial<AvatarGroupClasses>;
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component?: React.ElementType;
/**
* The extra props for the slot components.
* You can override the existing props or add new ones.
*
* This prop is an alias for the `slotProps` prop.
*
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
componentsProps?: {
additionalAvatar?: React.ComponentPropsWithRef<typeof Avatar> &
AvatarGroupComponentsPropsOverrides;
};
/**
* Max avatars to show before +x.
* @default 5
*/
max?: number;
/**
* custom renderer of extraAvatars
* @param {number} surplus number of extra avatars
* @returns {React.ReactNode} custom element to display
*/
renderSurplus?: (surplus: number) => React.ReactNode;
/**
* Spacing between avatars.
* @default 'medium'
*/
spacing?: 'small' | 'medium' | number;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
/**
* The total number of avatars. Used for calculating the number of extra avatars.
* @default children.length
*/
total?: number;
/**
* The variant to use.
* @default 'circular'
*/
variant?: OverridableStringUnion<
'circular' | 'rounded' | 'square',
AvatarGroupPropsVariantOverrides
>;
}
export interface AvatarGroupTypeMap<
AdditionalProps = {},
RootComponent extends React.ElementType = 'div',
> {
props: AdditionalProps & AvatarGroupOwnProps;
defaultComponent: RootComponent;
}
/**
*
* Demos:
*
* - [Avatar](https://mui.com/material-ui/react-avatar/)
*
* API:
*
* - [AvatarGroup API](https://mui.com/material-ui/api/avatar-group/)
*/
declare const AvatarGroup: OverridableComponent<AvatarGroupTypeMap>;
export type AvatarGroupProps<
RootComponent extends React.ElementType = AvatarGroupTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<AvatarGroupTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
component?: React.ElementType;
};
export interface AvatarGroupOwnerState
extends PartiallyRequired<AvatarGroupProps, 'max' | 'spacing' | 'component' | 'variant'> {}
export type AvatarGroupTheme = {
MuiAvatarGroup?: CreateThemeComponent<AvatarGroupClassKey, AvatarGroupProps>;
};
export default AvatarGroup;