@universal-tennis/ui-shared 0.1.45 → 0.1.47
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/dist/stories/molecules/AvatarWithName/AvatarWithName.d.ts +9 -1
- package/dist/stories/molecules/AvatarWithName/AvatarWithName.js +14 -5
- package/dist/stories/molecules/AvatarWithName/AvatarWithName.js.map +1 -1
- package/dist/stories/molecules/AvatarWithName/AvatarWithName.stories.d.ts +4 -0
- package/dist/stories/molecules/AvatarWithName/AvatarWithName.stories.js +24 -0
- package/dist/stories/molecules/AvatarWithName/AvatarWithName.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/molecules/AvatarWithName/AvatarWithName.stories.tsx +28 -0
- package/src/stories/molecules/AvatarWithName/AvatarWithName.tsx +37 -8
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface AvatarWithNameProps {
|
|
3
|
+
avatarOnly: boolean;
|
|
3
4
|
avatarFontCategory: string;
|
|
4
5
|
avatarFontSize: string;
|
|
6
|
+
avatarWidth: string;
|
|
7
|
+
avatarHeight: string;
|
|
8
|
+
href: string;
|
|
5
9
|
imgSrc: string;
|
|
6
10
|
playerName: string;
|
|
7
11
|
fontCategory: string;
|
|
8
12
|
fontSize: string;
|
|
9
13
|
}
|
|
10
|
-
export default function AvatarWithName({ imgSrc, playerName, avatarFontSize, avatarFontCategory, fontSize, fontCategory }: {
|
|
14
|
+
export default function AvatarWithName({ avatarOnly, imgSrc, playerName, avatarFontSize, href, avatarFontCategory, avatarWidth, avatarHeight, fontSize, fontCategory }: {
|
|
15
|
+
avatarOnly?: boolean | undefined;
|
|
11
16
|
imgSrc?: string | undefined;
|
|
12
17
|
playerName?: string | undefined;
|
|
13
18
|
avatarFontSize?: string | undefined;
|
|
19
|
+
href?: string | undefined;
|
|
14
20
|
avatarFontCategory?: string | undefined;
|
|
21
|
+
avatarWidth?: string | undefined;
|
|
22
|
+
avatarHeight?: string | undefined;
|
|
15
23
|
fontSize?: string | undefined;
|
|
16
24
|
fontCategory?: string | undefined;
|
|
17
25
|
}): JSX.Element;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Avatar from '@mui/material/Avatar';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
|
+
import Link from '@mui/material/Link';
|
|
4
5
|
import Typography from '../../atoms/Typography/Typography';
|
|
5
|
-
export default function AvatarWithName({ imgSrc = '', playerName = '', avatarFontSize = 'medium-medium', avatarFontCategory = 'primary', fontSize = 'small-medium', fontCategory = 'secondary' }) {
|
|
6
|
+
export default function AvatarWithName({ avatarOnly = false, imgSrc = '', playerName = '', avatarFontSize = 'medium-medium', href = '', avatarFontCategory = 'primary', avatarWidth = '40px', avatarHeight = '40px', fontSize = 'small-medium', fontCategory = 'secondary' }) {
|
|
6
7
|
const getAcronym = (str) => {
|
|
7
8
|
const acronym = str === null || str === void 0 ? void 0 : str.split(' ').map((word) => word.charAt(0)).join('');
|
|
8
9
|
return acronym;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const getTruncatedName = (name) => {
|
|
12
|
+
const maxCharacterLimit = 24;
|
|
13
|
+
return (name.length > maxCharacterLimit ? `${name.slice(0, maxCharacterLimit)}...` : name);
|
|
14
|
+
};
|
|
15
|
+
const AvatarComponent = (React.createElement(Avatar, { sx: {
|
|
16
|
+
backgroundColor: 'var(--black)', marginRight: '10px', width: `${avatarWidth}`, height: `${avatarHeight}`
|
|
17
|
+
}, src: imgSrc },
|
|
18
|
+
React.createElement(Typography, { size: avatarFontSize, category: avatarFontCategory }, getAcronym(playerName))));
|
|
19
|
+
return (avatarOnly ? (AvatarComponent) : (React.createElement(Box, { display: "flex", alignItems: "center" },
|
|
20
|
+
AvatarComponent,
|
|
21
|
+
href ? (React.createElement(Link, { href: href, sx: { textDecoration: 'none' } },
|
|
22
|
+
React.createElement(Typography, { category: fontCategory, size: fontSize }, getTruncatedName(playerName)))) : React.createElement(Typography, { category: fontCategory, size: fontSize }, getTruncatedName(playerName)))));
|
|
14
23
|
}
|
|
15
24
|
//# sourceMappingURL=AvatarWithName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarWithName.js","sourceRoot":"","sources":["../../../../src/stories/molecules/AvatarWithName/AvatarWithName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,GAAG,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AvatarWithName.js","sourceRoot":"","sources":["../../../../src/stories/molecules/AvatarWithName/AvatarWithName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAe3D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,UAAU,GAAG,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,cAAc,GAAG,eAAe,EAAE,IAAI,GAAG,EAAE,EAC7F,kBAAkB,GAAG,SAAS,EAAE,WAAW,GAAG,MAAM,EAAE,YAAY,GAAG,MAAM,EAAE,QAAQ,GAAG,cAAc,EAAE,YAAY,GAAG,WAAW,EACnI;IACC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;QACjC,MAAM,OAAO,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CA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default _default;
|
|
|
5
5
|
export declare const Default: any;
|
|
6
6
|
export declare const WithImage: any;
|
|
7
7
|
export declare const WithCustomTypography: any;
|
|
8
|
+
export declare const WithCustomAvatarSize: any;
|
|
9
|
+
export declare const WithAvatarOnly: any;
|
|
8
10
|
export declare const WithNoImage: any;
|
|
9
11
|
export declare const WithBrokenImage: any;
|
|
12
|
+
export declare const WithLink: any;
|
|
13
|
+
export declare const WithLongName: any;
|
|
@@ -26,6 +26,19 @@ WithCustomTypography.args = {
|
|
|
26
26
|
fontCategory: "primary",
|
|
27
27
|
fontSize: "medium-book"
|
|
28
28
|
};
|
|
29
|
+
export const WithCustomAvatarSize = AvatarWithNameTemplate.bind({});
|
|
30
|
+
WithCustomAvatarSize.args = {
|
|
31
|
+
playerName: "Julia Gulia",
|
|
32
|
+
avatarWidth: '26px',
|
|
33
|
+
avatarHeight: '26px',
|
|
34
|
+
avatarFontCategory: "primary",
|
|
35
|
+
avatarFontSize: "small-book",
|
|
36
|
+
};
|
|
37
|
+
export const WithAvatarOnly = AvatarWithNameTemplate.bind({});
|
|
38
|
+
WithAvatarOnly.args = {
|
|
39
|
+
avatarOnly: true,
|
|
40
|
+
playerName: "Julia Gulia",
|
|
41
|
+
};
|
|
29
42
|
export const WithNoImage = AvatarWithNameTemplate.bind({});
|
|
30
43
|
WithNoImage.args = {
|
|
31
44
|
imgSrc: '',
|
|
@@ -36,4 +49,15 @@ WithBrokenImage.args = {
|
|
|
36
49
|
imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.pn',
|
|
37
50
|
playerName: "Julia Gulia",
|
|
38
51
|
};
|
|
52
|
+
export const WithLink = AvatarWithNameTemplate.bind({});
|
|
53
|
+
WithLink.args = {
|
|
54
|
+
imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.png',
|
|
55
|
+
href: "https://www.reddit.com",
|
|
56
|
+
playerName: "Julia Gulia",
|
|
57
|
+
};
|
|
58
|
+
export const WithLongName = AvatarWithNameTemplate.bind({});
|
|
59
|
+
WithLongName.args = {
|
|
60
|
+
imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.png',
|
|
61
|
+
playerName: "Julia Guliauliauliauliauliauliauliauliauliaulia",
|
|
62
|
+
};
|
|
39
63
|
//# sourceMappingURL=AvatarWithName.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarWithName.stories.js","sourceRoot":"","sources":["../../../../src/stories/molecules/AvatarWithName/AvatarWithName.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAuC,MAAM,kBAAkB,CAAC;AAEvE,UAAU;AACV,eAAe;IACb,KAAK,EAAE,0BAA0B;CAClC,CAAC;AAEF,YAAY;AACZ,SAAS,sBAAsB,CAAC,IAAyB;IACvD,OAAO,oBAAC,cAAc,oBAAK,IAAI,EAAI,CAAC;AACtC,CAAC;AAED,UAAU;AACV,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,OAAO,CAAC,IAAI,GAAG;IACb,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzD,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,EAAE,6GAA6G;IACrH,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpE,oBAAoB,CAAC,IAAI,GAAG;IAC1B,UAAU,EAAE,aAAa;IACzB,kBAAkB,EAAE,WAAW;IAC/B,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,SAAS;IACvB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,WAAW,CAAC,IAAI,GAAG;IACjB,MAAM,EAAE,EAAE;IACV,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/D,eAAe,CAAC,IAAI,GAAG;IACrB,MAAM,EAAE,4GAA4G;IACpH,UAAU,EAAE,aAAa;CAC1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"AvatarWithName.stories.js","sourceRoot":"","sources":["../../../../src/stories/molecules/AvatarWithName/AvatarWithName.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAuC,MAAM,kBAAkB,CAAC;AAEvE,UAAU;AACV,eAAe;IACb,KAAK,EAAE,0BAA0B;CAClC,CAAC;AAEF,YAAY;AACZ,SAAS,sBAAsB,CAAC,IAAyB;IACvD,OAAO,oBAAC,cAAc,oBAAK,IAAI,EAAI,CAAC;AACtC,CAAC;AAED,UAAU;AACV,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvD,OAAO,CAAC,IAAI,GAAG;IACb,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzD,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,EAAE,6GAA6G;IACrH,UAAU,EAAE,aAAa;CAC1B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpE,oBAAoB,CAAC,IAAI,GAAG;IAC1B,UAAU,EAAE,aAAa;IACzB,kBAAkB,EAAE,WAAW;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AC9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -33,6 +33,21 @@ WithCustomTypography.args = {
|
|
|
33
33
|
fontSize: "medium-book"
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
export const WithCustomAvatarSize = AvatarWithNameTemplate.bind({});
|
|
37
|
+
WithCustomAvatarSize.args = {
|
|
38
|
+
playerName: "Julia Gulia",
|
|
39
|
+
avatarWidth: '26px',
|
|
40
|
+
avatarHeight: '26px',
|
|
41
|
+
avatarFontCategory: "primary",
|
|
42
|
+
avatarFontSize: "small-book",
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WithAvatarOnly = AvatarWithNameTemplate.bind({});
|
|
46
|
+
WithAvatarOnly.args = {
|
|
47
|
+
avatarOnly: true,
|
|
48
|
+
playerName: "Julia Gulia",
|
|
49
|
+
};
|
|
50
|
+
|
|
36
51
|
export const WithNoImage = AvatarWithNameTemplate.bind({});
|
|
37
52
|
WithNoImage.args = {
|
|
38
53
|
imgSrc: '',
|
|
@@ -44,3 +59,16 @@ WithBrokenImage.args = {
|
|
|
44
59
|
imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.pn',
|
|
45
60
|
playerName: "Julia Gulia",
|
|
46
61
|
};
|
|
62
|
+
|
|
63
|
+
export const WithLink = AvatarWithNameTemplate.bind({});
|
|
64
|
+
WithLink.args = {
|
|
65
|
+
imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.png',
|
|
66
|
+
href: "https://www.reddit.com",
|
|
67
|
+
playerName: "Julia Gulia",
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const WithLongName = AvatarWithNameTemplate.bind({});
|
|
71
|
+
WithLongName.args = {
|
|
72
|
+
imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.png',
|
|
73
|
+
playerName: "Julia Guliauliauliauliauliauliauliauliauliaulia",
|
|
74
|
+
};
|
|
@@ -2,12 +2,17 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import Avatar from '@mui/material/Avatar';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
|
+
import Link from '@mui/material/Link';
|
|
5
6
|
|
|
6
7
|
import Typography from '../../atoms/Typography/Typography';
|
|
7
8
|
|
|
8
9
|
export interface AvatarWithNameProps {
|
|
10
|
+
avatarOnly: boolean;
|
|
9
11
|
avatarFontCategory: string;
|
|
10
12
|
avatarFontSize: string;
|
|
13
|
+
avatarWidth: string;
|
|
14
|
+
avatarHeight: string;
|
|
15
|
+
href: string,
|
|
11
16
|
imgSrc: string;
|
|
12
17
|
playerName: string;
|
|
13
18
|
fontCategory: string;
|
|
@@ -15,20 +20,44 @@ export interface AvatarWithNameProps {
|
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export default function AvatarWithName({
|
|
18
|
-
imgSrc = '', playerName = '', avatarFontSize = 'medium-medium',
|
|
19
|
-
avatarFontCategory = 'primary', fontSize = 'small-medium', fontCategory = 'secondary'
|
|
23
|
+
avatarOnly = false, imgSrc = '', playerName = '', avatarFontSize = 'medium-medium', href = '',
|
|
24
|
+
avatarFontCategory = 'primary', avatarWidth = '40px', avatarHeight = '40px', fontSize = 'small-medium', fontCategory = 'secondary'
|
|
20
25
|
}) {
|
|
21
26
|
const getAcronym = (str: string) => {
|
|
22
27
|
const acronym = str?.split(' ').map((word) => word.charAt(0)).join('');
|
|
23
28
|
return acronym;
|
|
24
29
|
};
|
|
25
30
|
|
|
31
|
+
const getTruncatedName = (name:string) => {
|
|
32
|
+
const maxCharacterLimit = 24;
|
|
33
|
+
return (
|
|
34
|
+
name.length > maxCharacterLimit ? `${name.slice(0, maxCharacterLimit)}...` : name
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const AvatarComponent = (
|
|
39
|
+
<Avatar
|
|
40
|
+
sx={{
|
|
41
|
+
backgroundColor: 'var(--black)', marginRight: '10px', width: `${avatarWidth}`, height: `${avatarHeight}`
|
|
42
|
+
}}
|
|
43
|
+
src={imgSrc}
|
|
44
|
+
>
|
|
45
|
+
<Typography size={avatarFontSize} category={avatarFontCategory}>{getAcronym(playerName)}</Typography>
|
|
46
|
+
</Avatar>
|
|
47
|
+
);
|
|
48
|
+
|
|
26
49
|
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
avatarOnly ? (
|
|
51
|
+
AvatarComponent
|
|
52
|
+
) : (
|
|
53
|
+
<Box display="flex" alignItems="center">
|
|
54
|
+
{AvatarComponent}
|
|
55
|
+
{href ? (
|
|
56
|
+
<Link href={href} sx={{ textDecoration: 'none' }}>
|
|
57
|
+
<Typography category={fontCategory} size={fontSize}>{getTruncatedName(playerName)}</Typography>
|
|
58
|
+
</Link>
|
|
59
|
+
) : <Typography category={fontCategory} size={fontSize}>{getTruncatedName(playerName)}</Typography>}
|
|
60
|
+
</Box>
|
|
61
|
+
)
|
|
33
62
|
);
|
|
34
63
|
}
|