@xsolla/xui-avatar 0.64.0-pr56.1768440195
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/index.d.mts +45 -0
- package/native/index.d.ts +45 -0
- package/native/index.js +680 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +646 -0
- package/native/index.mjs.map +1 -0
- package/package.json +47 -0
- package/web/index.d.mts +45 -0
- package/web/index.d.ts +45 -0
- package/web/index.js +652 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +614 -0
- package/web/index.mjs.map +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AvatarProps {
|
|
4
|
+
/** Image source URL */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Icon component to display when no image is provided */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Text/Initials to display when no image or icon is provided */
|
|
9
|
+
text?: string;
|
|
10
|
+
/** Size of the avatar */
|
|
11
|
+
size?: "xl" | "l" | "m" | "s" | "xs";
|
|
12
|
+
/** If true, the avatar will be square with small border radius. If false, it will be a circle. */
|
|
13
|
+
square?: boolean;
|
|
14
|
+
/** Whether to show an alert badge */
|
|
15
|
+
badge?: boolean;
|
|
16
|
+
/** Number or text to display in the badge notification */
|
|
17
|
+
badgeCount?: React.ReactNode;
|
|
18
|
+
/** If true, the avatar will have a border to separate it from other avatars in a group */
|
|
19
|
+
stroke?: boolean;
|
|
20
|
+
/** Background color for the avatar. Defaults to theme background secondary. */
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
/** Disable hover effect. Used internally by AvatarGroup. */
|
|
23
|
+
disableHover?: boolean;
|
|
24
|
+
/** Accessible label for the avatar. Recommended for screen readers. */
|
|
25
|
+
"aria-label"?: string;
|
|
26
|
+
/** Alternative text for the avatar image */
|
|
27
|
+
alt?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
30
|
+
|
|
31
|
+
interface AvatarGroupProps {
|
|
32
|
+
/** Avatars to display in the group */
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
/** Size of the avatars in the group */
|
|
35
|
+
size?: "xl" | "l" | "m" | "s" | "xs";
|
|
36
|
+
/** Maximum number of avatars to show before showing the "+N" indicator */
|
|
37
|
+
max?: number;
|
|
38
|
+
/** Whether to show a stroke/border around each avatar */
|
|
39
|
+
stroke?: boolean;
|
|
40
|
+
/** Accessible label for the avatar group. Defaults to "Group of X users". */
|
|
41
|
+
"aria-label"?: string;
|
|
42
|
+
}
|
|
43
|
+
declare const AvatarGroup: React.FC<AvatarGroupProps>;
|
|
44
|
+
|
|
45
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AvatarProps {
|
|
4
|
+
/** Image source URL */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Icon component to display when no image is provided */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Text/Initials to display when no image or icon is provided */
|
|
9
|
+
text?: string;
|
|
10
|
+
/** Size of the avatar */
|
|
11
|
+
size?: "xl" | "l" | "m" | "s" | "xs";
|
|
12
|
+
/** If true, the avatar will be square with small border radius. If false, it will be a circle. */
|
|
13
|
+
square?: boolean;
|
|
14
|
+
/** Whether to show an alert badge */
|
|
15
|
+
badge?: boolean;
|
|
16
|
+
/** Number or text to display in the badge notification */
|
|
17
|
+
badgeCount?: React.ReactNode;
|
|
18
|
+
/** If true, the avatar will have a border to separate it from other avatars in a group */
|
|
19
|
+
stroke?: boolean;
|
|
20
|
+
/** Background color for the avatar. Defaults to theme background secondary. */
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
/** Disable hover effect. Used internally by AvatarGroup. */
|
|
23
|
+
disableHover?: boolean;
|
|
24
|
+
/** Accessible label for the avatar. Recommended for screen readers. */
|
|
25
|
+
"aria-label"?: string;
|
|
26
|
+
/** Alternative text for the avatar image */
|
|
27
|
+
alt?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
30
|
+
|
|
31
|
+
interface AvatarGroupProps {
|
|
32
|
+
/** Avatars to display in the group */
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
/** Size of the avatars in the group */
|
|
35
|
+
size?: "xl" | "l" | "m" | "s" | "xs";
|
|
36
|
+
/** Maximum number of avatars to show before showing the "+N" indicator */
|
|
37
|
+
max?: number;
|
|
38
|
+
/** Whether to show a stroke/border around each avatar */
|
|
39
|
+
stroke?: boolean;
|
|
40
|
+
/** Accessible label for the avatar group. Defaults to "Group of X users". */
|
|
41
|
+
"aria-label"?: string;
|
|
42
|
+
}
|
|
43
|
+
declare const AvatarGroup: React.FC<AvatarGroupProps>;
|
|
44
|
+
|
|
45
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps };
|