@universal-tennis/ui-shared 0.1.42 → 0.1.44

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.
@@ -13,6 +13,7 @@ export { default as SessionIcon } from './stories/atoms/Icons/SessionIcon';
13
13
  export { default as SwapIcon } from './stories/atoms/Icons/SwapIcon';
14
14
  export { default as Map } from './stories/atoms/Map/Map';
15
15
  // MOLECULES
16
+ export { default as AvatarWithName } from './stories/molecules/AvatarWithName';
16
17
  export { default as ContactCard } from './stories/molecules/Cards/ContactCard';
17
18
  export { default as DrawCard } from './stories/molecules/Cards/DrawCard';
18
19
  export { default as TeamCard } from './stories/molecules/Cards/TeamCard';
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.jsx"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC;AAE5C,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EA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AC;AAC3E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAEzD,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEzE,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0CAA0C,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export interface MapProps {
3
3
  placeId: string;
4
- height: string;
4
+ height: string | number;
5
+ width: string | number;
5
6
  }
6
- export default function Map({ placeId, height }: MapProps): JSX.Element;
7
+ export default function Map({ placeId, height, width }: MapProps): JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- export default function Map({ placeId, height }) {
2
+ export default function Map({ placeId, height, width }) {
3
3
  const placeParam = placeId && `q=place_id:${placeId}`;
4
4
  const placeUrl = `https://www.google.com/maps/embed/v1/place?key=AIzaSyCapzh9VsfXAzC9fAaosZJulONx7H1BFaY&${placeParam}`;
5
- const mapheight = height || `216px`;
6
- return (React.createElement("iframe", { width: "100%", height: mapheight, src: placeUrl, title: "Google Maps" }));
5
+ const mapHeight = height || `216px`;
6
+ const mapWidth = width || `100%`;
7
+ return (React.createElement("iframe", { width: mapWidth, height: mapHeight, src: placeUrl, title: "Google Maps" }));
7
8
  }
8
9
  //# sourceMappingURL=Map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,OAAO,EAAE,MAAM,EACN;IACT,MAAM,UAAU,GAAG,OAAO,IAAI,cAAc,OAAO,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,0FAA0F,UAAU,EAAE,CAAC;IAExH,MAAM,SAAS,GAAG,MAAM,IAAI,OAAO,CAAC;IACpC,OAAO,CACH,gCACI,KAAK,EAAC,MAAM,EACZ,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAC,aAAa,GACrB,CACL,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,EACb;IACT,MAAM,UAAU,GAAG,OAAO,IAAI,cAAc,OAAO,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,0FAA0F,UAAU,EAAE,CAAC;IACxH,MAAM,SAAS,GAAG,MAAM,IAAI,OAAO,CAAC;IACpC,MAAM,QAAQ,GAAG,KAAK,IAAI,MAAM,CAAC;IAEjC,OAAO,CACH,gCACI,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAC,aAAa,GACrB,CACL,CAAC;AACJ,CAAC"}
@@ -3,4 +3,7 @@ declare const _default: {
3
3
  };
4
4
  export default _default;
5
5
  export declare const Default: any;
6
- export declare const WithCustomHeight: any;
6
+ export declare const WithCustomStringHeight: any;
7
+ export declare const WithCustomNumberHeight: any;
8
+ export declare const WithCustomStringWidth: any;
9
+ export declare const WithCustomNumberWidth: any;
@@ -13,9 +13,24 @@ export const Default = MapTemplate.bind({});
13
13
  Default.args = {
14
14
  placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
15
15
  };
16
- export const WithCustomHeight = MapTemplate.bind({});
17
- WithCustomHeight.args = {
16
+ export const WithCustomStringHeight = MapTemplate.bind({});
17
+ WithCustomStringHeight.args = {
18
18
  placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
19
19
  height: '320px'
20
20
  };
21
+ export const WithCustomNumberHeight = MapTemplate.bind({});
22
+ WithCustomNumberHeight.args = {
23
+ placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
24
+ height: 320
25
+ };
26
+ export const WithCustomStringWidth = MapTemplate.bind({});
27
+ WithCustomStringWidth.args = {
28
+ placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
29
+ width: '620px'
30
+ };
31
+ export const WithCustomNumberWidth = MapTemplate.bind({});
32
+ WithCustomNumberWidth.args = {
33
+ placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
34
+ width: 620
35
+ };
21
36
  //# sourceMappingURL=Map.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Map.stories.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,GAAiB,MAAM,OAAO,CAAC;AAEtC,UAAU;AACV,eAAe;IACb,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,YAAY;AACZ,SAAS,WAAW,CAAC,IAAc;IACjC,OAAO,oBAAC,GAAG,oBAAK,IAAI,EAAI,CAAC;AAC3B,CAAC;AAED,UAAU;AACV,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEF,MAAM,C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IAAI,CAAC,EAAE,CAAC,CAAC;AAC1D,qBAAqB,CAAC,IAAI,GAAG;IAC3B,OAAO,EAAE,6BAA6B;IACtC,KAAK,EAAE,GAAG;CACX,CAAC"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export interface AvatarWithNameProps {
3
+ avatarTypographyCategory: string;
4
+ avatarTypographySize: string;
5
+ imgSrc: string;
6
+ playerName: string;
7
+ typographyCategory: string;
8
+ typographySize: string;
9
+ }
10
+ export default function AvatarWithName({ imgSrc, playerName, avatarTypographySize, avatarTypographyCategory, typographySize, typographyCategory }: {
11
+ imgSrc?: string | undefined;
12
+ playerName?: string | undefined;
13
+ avatarTypographySize?: string | undefined;
14
+ avatarTypographyCategory?: string | undefined;
15
+ typographySize?: string | undefined;
16
+ typographyCategory?: string | undefined;
17
+ }): JSX.Element;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import Avatar from '@mui/material/Avatar';
3
+ import Box from '@mui/material/Box';
4
+ import Typography from '../../atoms/Typography/Typography';
5
+ export default function AvatarWithName({ imgSrc = '', playerName = '', avatarTypographySize = '', avatarTypographyCategory = '', typographySize = '', typographyCategory = '' }) {
6
+ const getAcronym = (str) => {
7
+ const acronym = str === null || str === void 0 ? void 0 : str.split(' ').map((word) => word.charAt(0)).join('');
8
+ return acronym;
9
+ };
10
+ return (React.createElement(Box, { display: "flex", alignItems: "center" },
11
+ React.createElement(Avatar, { sx: { bgcolor: 'black', marginRight: '10px' }, src: imgSrc },
12
+ React.createElement(Typography, { size: avatarTypographySize, category: avatarTypographyCategory }, getAcronym(playerName))),
13
+ React.createElement(Typography, { category: typographyCategory, size: typographySize }, playerName)));
14
+ }
15
+ //# sourceMappingURL=AvatarWithName.js.map
@@ -0,0 +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;AAEpC,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAW3D,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,MAAM,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,oBAAoB,GAAG,EAAE,EAAE,wBAAwB,GAAG,EAAE,EAAE,cAAc,GAAG,EAAE,EAAE,kBAAkB,GAAG,EAAE,EACrI;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,CAAC;QACvE,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACH,oBAAC,GAAG,IAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ;QACnC,oBAAC,MAAM,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM;YAC9D,oBAAC,UAAU,IAAC,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,IAAG,UAAU,CAAC,UAAU,CAAC,CAAc,CAC5G;QACT,oBAAC,UAAU,IAAC,QAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,IAAG,UAAU,CAAc,CACvF,CACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const Default: any;
6
+ export declare const WithImageAndCustomTypography: any;
7
+ export declare const WithNoImage: any;
8
+ export declare const WithBrokenImage: any;
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import AvatarWithName from './AvatarWithName';
3
+ // Default
4
+ export default {
5
+ title: 'Molecules/AvatarWithName',
6
+ };
7
+ // Templates
8
+ function AvatarWithNameTemplate(args) {
9
+ return React.createElement(AvatarWithName, Object.assign({}, args));
10
+ }
11
+ // Stories
12
+ export const Default = AvatarWithNameTemplate.bind({});
13
+ Default.args = {
14
+ avatarTypographyCategory: '',
15
+ avatarTypographySize: "",
16
+ imgSrc: '',
17
+ playerName: "Julia Gulia",
18
+ typographyCategory: "",
19
+ typographySize: "",
20
+ };
21
+ export const WithImageAndCustomTypography = AvatarWithNameTemplate.bind({});
22
+ WithImageAndCustomTypography.args = {
23
+ avatarTypographyCategory: '',
24
+ avatarTypographySize: "",
25
+ imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.png',
26
+ playerName: "Julia Gulia",
27
+ typographyCategory: "secondary",
28
+ typographySize: "small-medium",
29
+ };
30
+ export const WithNoImage = AvatarWithNameTemplate.bind({});
31
+ WithNoImage.args = {
32
+ avatarTypographyCategory: 'primary',
33
+ avatarTypographySize: "medium-medium",
34
+ imgSrc: '',
35
+ playerName: "Julia Gulia",
36
+ typographyCategory: "secondary",
37
+ typographySize: "small-medium",
38
+ };
39
+ export const WithBrokenImage = AvatarWithNameTemplate.bind({});
40
+ WithBrokenImage.args = {
41
+ avatarTypographyCategory: 'primary',
42
+ avatarTypographySize: "medium-medium",
43
+ imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.pn',
44
+ playerName: "Julia Gulia",
45
+ typographyCategory: "secondary",
46
+ typographySize: "small-medium",
47
+ };
48
+ //# sourceMappingURL=AvatarWithName.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarWithName.stories.js","sourceRoot":"","sources":["../../../../src/stories/molecules/AvatarWithName/AvatarWithName.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,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,MAAM,EAAE,4GAA4G;IACpH,UAAU,EAAE,aAAa;IACzB,kBAAkB,EAAE,WAAW;IAC/B,cAAc,EAAE,cAAc;CAC/B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-tennis/ui-shared",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "main": "dist/items.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://universaltennis.com",
@@ -15,6 +15,7 @@ export { default as SwapIcon } from './stories/atoms/Icons/SwapIcon';
15
15
  export { default as Map } from './stories/atoms/Map/Map';
16
16
 
17
17
  // MOLECULES
18
+ export { default as AvatarWithName } from './stories/molecules/AvatarWithName';
18
19
  export { default as ContactCard } from './stories/molecules/Cards/ContactCard';
19
20
  export { default as DrawCard } from './stories/molecules/Cards/DrawCard';
20
21
  export { default as TeamCard } from './stories/molecules/Cards/TeamCard';
@@ -18,8 +18,26 @@ Default.args = {
18
18
  placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
19
19
  };
20
20
 
21
- export const WithCustomHeight = MapTemplate.bind({});
22
- WithCustomHeight.args = {
21
+ export const WithCustomStringHeight = MapTemplate.bind({});
22
+ WithCustomStringHeight.args = {
23
23
  placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
24
24
  height: '320px'
25
25
  };
26
+
27
+ export const WithCustomNumberHeight = MapTemplate.bind({});
28
+ WithCustomNumberHeight.args = {
29
+ placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
30
+ height: 320
31
+ };
32
+
33
+ export const WithCustomStringWidth = MapTemplate.bind({});
34
+ WithCustomStringWidth.args = {
35
+ placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
36
+ width: '620px'
37
+ };
38
+
39
+ export const WithCustomNumberWidth = MapTemplate.bind({});
40
+ WithCustomNumberWidth.args = {
41
+ placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
42
+ width: 620
43
+ };
@@ -2,20 +2,22 @@ import React from 'react';
2
2
 
3
3
  export interface MapProps {
4
4
  placeId: string;
5
- height: string;
5
+ height: string | number;
6
+ width: string | number;
6
7
  }
7
8
 
8
9
  export default function Map({
9
- placeId, height
10
+ placeId, height, width
10
11
  }: MapProps) {
11
12
  const placeParam = placeId && `q=place_id:${placeId}`;
12
13
  const placeUrl = `https://www.google.com/maps/embed/v1/place?key=AIzaSyCapzh9VsfXAzC9fAaosZJulONx7H1BFaY&${placeParam}`;
14
+ const mapHeight = height || `216px`;
15
+ const mapWidth = width || `100%`;
13
16
 
14
- const mapheight = height || `216px`;
15
17
  return (
16
18
  <iframe
17
- width="100%"
18
- height={mapheight}
19
+ width={mapWidth}
20
+ height={mapHeight}
19
21
  src={placeUrl}
20
22
  title="Google Maps"
21
23
  />
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+
3
+ import AvatarWithName, { AvatarWithNameProps } from './AvatarWithName';
4
+
5
+ // Default
6
+ export default {
7
+ title: 'Molecules/AvatarWithName',
8
+ };
9
+
10
+ // Templates
11
+ function AvatarWithNameTemplate(args: AvatarWithNameProps) {
12
+ return <AvatarWithName {...args} />;
13
+ }
14
+
15
+ // Stories
16
+ export const Default = AvatarWithNameTemplate.bind({});
17
+ Default.args = {
18
+ avatarTypographyCategory: '',
19
+ avatarTypographySize: "",
20
+ imgSrc: '',
21
+ playerName: "Julia Gulia",
22
+ typographyCategory: "",
23
+ typographySize: "",
24
+ };
25
+
26
+ export const WithImageAndCustomTypography = AvatarWithNameTemplate.bind({});
27
+ WithImageAndCustomTypography.args = {
28
+ avatarTypographyCategory: '',
29
+ avatarTypographySize: "",
30
+ imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.png',
31
+ playerName: "Julia Gulia",
32
+ typographyCategory: "secondary",
33
+ typographySize: "small-medium",
34
+ };
35
+
36
+ export const WithNoImage = AvatarWithNameTemplate.bind({});
37
+ WithNoImage.args = {
38
+ avatarTypographyCategory: 'primary',
39
+ avatarTypographySize: "medium-medium",
40
+ imgSrc: '',
41
+ playerName: "Julia Gulia",
42
+ typographyCategory: "secondary",
43
+ typographySize: "small-medium",
44
+ };
45
+
46
+ export const WithBrokenImage = AvatarWithNameTemplate.bind({});
47
+ WithBrokenImage.args = {
48
+ avatarTypographyCategory: 'primary',
49
+ avatarTypographySize: "medium-medium",
50
+ imgSrc: 'https://ci-cdn.universaltennis.com/v1/player/329903/images/profile/7839bf68-b56f-486a-88ab-a52debbac709.pn',
51
+ playerName: "Julia Gulia",
52
+ typographyCategory: "secondary",
53
+ typographySize: "small-medium",
54
+ };
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+
3
+ import Avatar from '@mui/material/Avatar';
4
+ import Box from '@mui/material/Box';
5
+
6
+ import Typography from '../../atoms/Typography/Typography';
7
+
8
+ export interface AvatarWithNameProps {
9
+ avatarTypographyCategory: string;
10
+ avatarTypographySize: string;
11
+ imgSrc: string;
12
+ playerName: string;
13
+ typographyCategory: string;
14
+ typographySize: string;
15
+ }
16
+
17
+ export default function AvatarWithName({
18
+ imgSrc = '', playerName = '', avatarTypographySize = '', avatarTypographyCategory = '', typographySize = '', typographyCategory = ''
19
+ }) {
20
+ const getAcronym = (str: string) => {
21
+ const acronym = str?.split(' ').map((word) => word.charAt(0)).join('');
22
+ return acronym;
23
+ };
24
+
25
+ return (
26
+ <Box display="flex" alignItems="center">
27
+ <Avatar sx={{ bgcolor: 'black', marginRight: '10px' }} src={imgSrc}>
28
+ <Typography size={avatarTypographySize} category={avatarTypographyCategory}>{getAcronym(playerName)}</Typography>
29
+ </Avatar>
30
+ <Typography category={typographyCategory} size={typographySize}>{playerName}</Typography>
31
+ </Box>
32
+ );
33
+ }