@universal-tennis/ui-shared 0.1.54 → 0.1.56
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/components.d.ts +3 -0
- package/dist/components.js +3 -0
- package/dist/components.js.map +1 -1
- package/dist/stories/atoms/Icons/AddIcon.js +1 -1
- package/dist/stories/atoms/Icons/ClockIcon.js +1 -1
- package/dist/stories/atoms/Icons/Icons.stories.d.ts +1 -0
- package/dist/stories/atoms/Icons/Icons.stories.js +8 -0
- package/dist/stories/atoms/Icons/Icons.stories.js.map +1 -1
- package/dist/stories/atoms/Icons/VisibilityIcon.js +1 -1
- package/dist/stories/atoms/Icons/VisibilityOffIcon.js +1 -1
- package/dist/stories/atoms/Icons/WinnerIndicatorIcon.d.ts +3 -0
- package/dist/stories/atoms/Icons/WinnerIndicatorIcon.js +32 -0
- package/dist/stories/atoms/Icons/WinnerIndicatorIcon.js.map +1 -0
- package/dist/stories/atoms/Icons/sharedTypes.d.ts +5 -0
- package/dist/stories/molecules/Cards/TeamDrawCard.d.ts +3 -0
- package/dist/stories/molecules/Cards/TeamDrawCard.js +94 -0
- package/dist/stories/molecules/Cards/TeamDrawCard.js.map +1 -0
- package/dist/stories/molecules/Cards/sharedTypes.d.ts +13 -0
- package/dist/stories/organisms/Tables/Tables.stories.d.ts +2 -0
- package/dist/stories/organisms/Tables/Tables.stories.js +32 -1
- package/dist/stories/organisms/Tables/Tables.stories.js.map +1 -1
- package/dist/stories/organisms/Tables/TeamDrawCardTable.d.ts +3 -0
- package/dist/stories/organisms/Tables/TeamDrawCardTable.js +95 -0
- package/dist/stories/organisms/Tables/TeamDrawCardTable.js.map +1 -0
- package/dist/stories/organisms/Tables/mockData.d.ts +20 -0
- package/dist/stories/organisms/Tables/mockData.js +20 -0
- package/dist/stories/organisms/Tables/mockData.js.map +1 -1
- package/package.json +1 -1
- package/src/components.jsx +3 -0
- package/src/stories/atoms/Icons/AddIcon.tsx +1 -1
- package/src/stories/atoms/Icons/ClockIcon.tsx +1 -1
- package/src/stories/atoms/Icons/Icons.stories.tsx +11 -1
- package/src/stories/atoms/Icons/VisibilityIcon.tsx +1 -1
- package/src/stories/atoms/Icons/VisibilityOffIcon.tsx +1 -1
- package/src/stories/atoms/Icons/WinnerIndicatorIcon.tsx +39 -0
- package/src/stories/atoms/Icons/sharedTypes.tsx +6 -0
- package/src/stories/molecules/Cards/TeamDrawCard.tsx +154 -0
- package/src/stories/molecules/Cards/sharedTypes.ts +14 -0
- package/src/stories/organisms/Tables/Tables.stories.tsx +36 -1
- package/src/stories/organisms/Tables/TeamDrawCardTable.tsx +137 -0
- package/src/stories/organisms/Tables/mockData.tsx +21 -0
package/dist/components.d.ts
CHANGED
|
@@ -17,11 +17,14 @@ export { default as SessionIcon } from "./stories/atoms/Icons/SessionIcon";
|
|
|
17
17
|
export { default as SwapIcon } from "./stories/atoms/Icons/SwapIcon";
|
|
18
18
|
export { default as VisibilityIcon } from "./stories/atoms/Icons/VisibilityIcon";
|
|
19
19
|
export { default as VisibilityOffIcon } from "./stories/atoms/Icons/VisibilityOffIcon";
|
|
20
|
+
export { default as WinnerIndicatorIcon } from "./stories/atoms/Icons/WinnerIndicatorIcon";
|
|
20
21
|
export { default as AvatarWithName } from "./stories/molecules/AvatarWithName/AvatarWithName";
|
|
21
22
|
export { default as ContactCard } from "./stories/molecules/Cards/ContactCard";
|
|
22
23
|
export { default as DrawCard } from "./stories/molecules/Cards/DrawCard";
|
|
23
24
|
export { default as SquareAvatarWithName } from "./stories/molecules/SquareAvatarWithName/SquareAvatarWithName";
|
|
24
25
|
export { default as TeamCard } from "./stories/molecules/Cards/TeamCard";
|
|
26
|
+
export { default as TeamDrawCard } from "./stories/molecules/Cards/TeamDrawCard";
|
|
25
27
|
export { default as DrawCardTable } from "./stories/organisms/Tables/DrawCardTable";
|
|
26
28
|
export { default as FullPageModal } from "./stories/organisms/Modals/FullPageModal";
|
|
27
29
|
export { default as SortableTable } from "./stories/organisms/Tables/SortableTable";
|
|
30
|
+
export { default as TeamDrawCardTable } from "./stories/organisms/Tables/TeamDrawCardTable";
|
package/dist/components.js
CHANGED
|
@@ -20,14 +20,17 @@ export { default as SessionIcon } from './stories/atoms/Icons/SessionIcon';
|
|
|
20
20
|
export { default as SwapIcon } from './stories/atoms/Icons/SwapIcon';
|
|
21
21
|
export { default as VisibilityIcon } from './stories/atoms/Icons/VisibilityIcon';
|
|
22
22
|
export { default as VisibilityOffIcon } from './stories/atoms/Icons/VisibilityOffIcon';
|
|
23
|
+
export { default as WinnerIndicatorIcon } from './stories/atoms/Icons/WinnerIndicatorIcon';
|
|
23
24
|
// MOLECULES
|
|
24
25
|
export { default as AvatarWithName } from './stories/molecules/AvatarWithName/AvatarWithName';
|
|
25
26
|
export { default as ContactCard } from './stories/molecules/Cards/ContactCard';
|
|
26
27
|
export { default as DrawCard } from './stories/molecules/Cards/DrawCard';
|
|
27
28
|
export { default as SquareAvatarWithName } from './stories/molecules/SquareAvatarWithName/SquareAvatarWithName';
|
|
28
29
|
export { default as TeamCard } from './stories/molecules/Cards/TeamCard';
|
|
30
|
+
export { default as TeamDrawCard } from './stories/molecules/Cards/TeamDrawCard';
|
|
29
31
|
// ORGANISMS
|
|
30
32
|
export { default as DrawCardTable } from './stories/organisms/Tables/DrawCardTable';
|
|
31
33
|
export { default as FullPageModal } from './stories/organisms/Modals/FullPageModal';
|
|
32
34
|
export { default as SortableTable } from './stories/organisms/Tables/SortableTable';
|
|
35
|
+
export { default as TeamDrawCardTable } from './stories/organisms/Tables/TeamDrawCardTable';
|
|
33
36
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -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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AAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAE3F,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mDAAmD,CAAC;AAC9F,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,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AAChH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEjF,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;AACpF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export default function AddIcon({ size, color }) {
|
|
4
|
-
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0
|
|
4
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: color, xmlns: "http://www.w3.org/2000/svg" },
|
|
5
5
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z" }),
|
|
6
6
|
React.createElement("path", { d: "M7.5 4.5C7.5 4.22386 7.72386 4 8 4V4C8.27614 4 8.5 4.22386 8.5 4.5V11.5C8.5 11.7761 8.27614 12 8 12V12C7.72386 12 7.5 11.7761 7.5 11.5V4.5Z" }),
|
|
7
7
|
React.createElement("path", { d: "M4 8C4 7.72386 4.22386 7.5 4.5 7.5H11.5C11.7761 7.5 12 7.72386 12 8V8C12 8.27614 11.7761 8.5 11.5 8.5H4.5C4.22386 8.5 4 8.27614 4 8V8Z" })));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export default function ClockIcon({ size, color }) {
|
|
4
|
-
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0
|
|
4
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: color, xmlns: "http://www.w3.org/2000/svg" },
|
|
5
5
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z" }),
|
|
6
6
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 3C8.27614 3 8.5 3.22386 8.5 3.5L8.5 8.5C8.5 8.77614 8.27614 9 8 9C7.72386 9 7.5 8.77614 7.5 8.5L7.5 3.5C7.5 3.22386 7.72386 3 8 3Z" }),
|
|
7
7
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.4069 6.94146C11.5365 7.18528 11.4439 7.48803 11.2001 7.61767L8.34821 9.13406C8.10439 9.2637 7.80164 9.17114 7.672 8.92733C7.54236 8.68351 7.63492 8.38076 7.87874 8.25112L10.7307 6.73472C10.9745 6.60508 11.2772 6.69764 11.4069 6.94146Z" })));
|
|
@@ -15,6 +15,7 @@ import SessionIcon from './SessionIcon';
|
|
|
15
15
|
import SwapIcon from './SwapIcon';
|
|
16
16
|
import VisibilityIcon from './VisibilityIcon';
|
|
17
17
|
import VisibilityOffIcon from './VisibilityOffIcon';
|
|
18
|
+
import WinnerIndicatorIcon from './WinnerIndicatorIcon';
|
|
18
19
|
// Default
|
|
19
20
|
export default {
|
|
20
21
|
title: 'Atoms/Icons',
|
|
@@ -68,6 +69,9 @@ function VisibilityIconTemplate(args) {
|
|
|
68
69
|
function VisibilityOffIconTemplate(args) {
|
|
69
70
|
return React.createElement(VisibilityOffIcon, Object.assign({}, args));
|
|
70
71
|
}
|
|
72
|
+
function WinnerIndicatorIconTemplate(args) {
|
|
73
|
+
return React.createElement(WinnerIndicatorIcon, Object.assign({}, args));
|
|
74
|
+
}
|
|
71
75
|
// Stories
|
|
72
76
|
export const Add = AddIconTemplate.bind({});
|
|
73
77
|
Add.args = {
|
|
@@ -149,4 +153,8 @@ VisibilityOff.args = {
|
|
|
149
153
|
size: 150,
|
|
150
154
|
color: 'black'
|
|
151
155
|
};
|
|
156
|
+
export const WinnerIndicator = WinnerIndicatorIconTemplate.bind({});
|
|
157
|
+
WinnerIndicator.args = {
|
|
158
|
+
isBlack: true
|
|
159
|
+
};
|
|
152
160
|
//# sourceMappingURL=Icons.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icons.stories.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Icons/Icons.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,YAAY,MAAM,gBAAgB,CAA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M,CAAC,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpD,OAAO,CAAC,IAAI,GAAG;IACb,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,KAAK;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9C,IAAI,CAAC,IAAI,GAAG;IACV,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1D,UAAU,CAAC,IAAI,GAAG;IAChB,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,aAAa,CAAC,IAAI,GAAG;IACnB,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpE,eAAe,CAAC,IAAI,GAAG;IACrB,OAAO,EAAE,IAAI;CACd,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export default function VisibilityIcon({ size, color }) {
|
|
4
|
-
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0
|
|
4
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: color, xmlns: "http://www.w3.org/2000/svg" },
|
|
5
5
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 8C0 8 3.58172 14 8 14C12.4183 14 16 8 16 8C16 8 12.4183 2 8 2C3.58172 2 0 8 0 8ZM1.19246 8C1.26436 8.10528 1.34719 8.22394 1.44034 8.35336C1.82566 8.88878 2.38093 9.59917 3.06268 10.3055C4.47204 11.7658 6.22099 13 8 13C9.77901 13 11.528 11.7658 12.9373 10.3055C13.6191 9.59917 14.1743 8.88878 14.5597 8.35336C14.6528 8.22394 14.7356 8.10528 14.8075 8C14.7356 7.89472 14.6528 7.77606 14.5597 7.64664C14.1743 7.11122 13.6191 6.40083 12.9373 5.69446C11.528 4.2342 9.77901 3 8 3C6.22099 3 4.47204 4.2342 3.06268 5.69446C2.38093 6.40083 1.82566 7.11122 1.44034 7.64664C1.34719 7.77606 1.26436 7.89472 1.19246 8Z" }),
|
|
6
6
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10ZM8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z" })));
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export default function VisibilityOffIcon({ size, color }) {
|
|
4
|
-
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0
|
|
4
|
+
return (React.createElement("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: color, xmlns: "http://www.w3.org/2000/svg" },
|
|
5
5
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10ZM8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z" }),
|
|
6
6
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.646522 15.6464C0.45126 15.4511 0.45126 15.1346 0.646522 14.9393L14.7887 0.797158C14.9839 0.601896 15.3005 0.601896 15.4958 0.797158C15.691 0.99242 15.691 1.309 15.4958 1.50426L1.35363 15.6464C1.15837 15.8417 0.841784 15.8417 0.646522 15.6464Z" }),
|
|
7
7
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0 8C0 8 3.58172 14 8 14C12.4183 14 16 8 16 8C16 8 12.4183 2 8 2C3.58172 2 0 8 0 8ZM1.19246 8C1.26436 8.10528 1.34719 8.22394 1.44034 8.35336C1.82566 8.88878 2.38093 9.59917 3.06268 10.3055C4.47204 11.7658 6.22099 13 8 13C9.77901 13 11.528 11.7658 12.9373 10.3055C13.6191 9.59917 14.1743 8.88878 14.5597 8.35336C14.6528 8.22394 14.7356 8.10528 14.8075 8C14.7356 7.89472 14.6528 7.77606 14.5597 7.64664C14.1743 7.11122 13.6191 6.40083 12.9373 5.69446C11.528 4.2342 9.77901 3 8 3C6.22099 3 4.47204 4.2342 3.06268 5.69446C2.38093 6.40083 1.82566 7.11122 1.44034 7.64664C1.34719 7.77606 1.26436 7.89472 1.19246 8Z" })));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
const arrowStyles = {
|
|
4
|
+
borderTop: '10px solid transparent',
|
|
5
|
+
borderBottom: '10px solid transparent',
|
|
6
|
+
borderLeft: '10px solid white',
|
|
7
|
+
height: 0,
|
|
8
|
+
width: 0
|
|
9
|
+
};
|
|
10
|
+
const rectangleStyles = {
|
|
11
|
+
background: 'white',
|
|
12
|
+
height: 20,
|
|
13
|
+
width: 3
|
|
14
|
+
};
|
|
15
|
+
const blackArrowStyles = {
|
|
16
|
+
borderTop: '8px solid transparent',
|
|
17
|
+
borderBottom: '8px solid transparent',
|
|
18
|
+
borderLeft: '8px solid black',
|
|
19
|
+
height: 0,
|
|
20
|
+
width: 0
|
|
21
|
+
};
|
|
22
|
+
const blackRectangleStyles = {
|
|
23
|
+
background: 'black',
|
|
24
|
+
height: 16,
|
|
25
|
+
width: 3
|
|
26
|
+
};
|
|
27
|
+
export default function WinnerIndicatorIcon({ sx, isBlack }) {
|
|
28
|
+
return (React.createElement(Box, { sx: sx, display: "flex" },
|
|
29
|
+
React.createElement(Box, { style: isBlack ? blackRectangleStyles : rectangleStyles }),
|
|
30
|
+
React.createElement(Box, { style: isBlack ? blackArrowStyles : arrowStyles })));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=WinnerIndicatorIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WinnerIndicatorIcon.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Icons/WinnerIndicatorIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AAGpC,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,wBAAwB;IACnC,YAAY,EAAE,wBAAwB;IACtC,UAAU,EAAE,kBAAkB;IAC9B,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;CACT,CAAC;AACF,MAAM,eAAe,GAAG;IACtB,UAAU,EAAE,OAAO;IACnB,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACvB,SAAS,EAAE,uBAAuB;IAClC,YAAY,EAAE,uBAAuB;IACrC,UAAU,EAAE,iBAAiB;IAC7B,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,UAAU,EAAE,OAAO;IACnB,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,EAAE,EAAE,OAAO,EAA4B;IACnF,OAAO,CACH,oBAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAC,MAAM;QACvB,oBAAC,GAAG,IAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,GAAI;QAChE,oBAAC,GAAG,IAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WAAW,GAAI,CACtD,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TeamDrawCardProps } from "./sharedTypes";
|
|
3
|
+
export default function TeamDrawCard({ dateLabel, locationLabel, timeLabel, matchInfo, isPosition1Winner, isPosition2Winner, isScorelessMatch, position1Team, position2Team, ...props }: TeamDrawCardProps): JSX.Element;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import WinnerIndicatorIcon from 'stories/atoms/Icons/WinnerIndicatorIcon';
|
|
16
|
+
import Typography, { SECONDARY_SIZES_ENUM, CATEGORY_ENUM } from '../../atoms/Typography/Typography';
|
|
17
|
+
import SquareAvatarWithName from '../SquareAvatarWithName/SquareAvatarWithName';
|
|
18
|
+
const StyledCard = styled(Box)({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flexDirection: 'column',
|
|
21
|
+
borderRadius: '4px',
|
|
22
|
+
padding: '16px 24px',
|
|
23
|
+
width: '100%',
|
|
24
|
+
height: '100px',
|
|
25
|
+
backgroundColor: 'var(--white)',
|
|
26
|
+
border: '1px solid var(--cool-grey-600)',
|
|
27
|
+
marginLeft: '25px',
|
|
28
|
+
marginRight: '25px',
|
|
29
|
+
position: 'relative'
|
|
30
|
+
});
|
|
31
|
+
const BottomGrid = styled(Box)({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'space-between',
|
|
35
|
+
paddingTop: '8px',
|
|
36
|
+
});
|
|
37
|
+
export default function TeamDrawCard(_a) {
|
|
38
|
+
var { dateLabel, locationLabel, timeLabel, matchInfo, isPosition1Winner, isPosition2Winner, isScorelessMatch, position1Team, position2Team } = _a, props = __rest(_a, ["dateLabel", "locationLabel", "timeLabel", "matchInfo", "isPosition1Winner", "isPosition2Winner", "isScorelessMatch", "position1Team", "position2Team"]);
|
|
39
|
+
const { MediumMedium, MediumBook, XSmallBook } = SECONDARY_SIZES_ENUM;
|
|
40
|
+
const { SECONDARY } = CATEGORY_ENUM;
|
|
41
|
+
return (React.createElement(StyledCard, Object.assign({ className: "team-draw-card" }, props),
|
|
42
|
+
React.createElement(Box, { display: "flex", justifyContent: "space-between", mb: 0.5 },
|
|
43
|
+
isPosition1Winner && React.createElement(WinnerIndicatorIcon, { isBlack: true, sx: { position: "absolute", left: 0, top: 20 } }),
|
|
44
|
+
React.createElement(Box, { display: "flex", alignItems: "center", gap: 0.5 },
|
|
45
|
+
React.createElement(SquareAvatarWithName, { name: position1Team === null || position1Team === void 0 ? void 0 : position1Team.name, fontSize: isPosition1Winner ? MediumMedium : MediumBook, href: position1Team.href, isBye: !(position1Team === null || position1Team === void 0 ? void 0 : position1Team.name) }),
|
|
46
|
+
React.createElement(Typography, { category: SECONDARY, size: XSmallBook, color: "var(--cool-grey-600)" },
|
|
47
|
+
"(", position1Team === null || position1Team === void 0 ? void 0 :
|
|
48
|
+
position1Team.record,
|
|
49
|
+
")")),
|
|
50
|
+
React.createElement(Typography, { category: SECONDARY, size: isPosition1Winner ? MediumMedium : MediumBook }, isScorelessMatch ? '-' : position1Team === null || position1Team === void 0 ? void 0 : position1Team.points)),
|
|
51
|
+
React.createElement(Box, { display: "flex", justifyContent: "space-between" },
|
|
52
|
+
isPosition2Winner && React.createElement(WinnerIndicatorIcon, { isBlack: true, sx: { position: "absolute", left: 0, top: 50 } }),
|
|
53
|
+
React.createElement(Box, { display: "flex", alignItems: "center", gap: 0.5 },
|
|
54
|
+
React.createElement(SquareAvatarWithName, { name: position2Team === null || position2Team === void 0 ? void 0 : position2Team.name, fontSize: isPosition2Winner ? MediumMedium : MediumBook, href: position2Team.href, isBye: !(position2Team === null || position2Team === void 0 ? void 0 : position2Team.name) }),
|
|
55
|
+
React.createElement(Typography, { category: SECONDARY, size: XSmallBook, color: "var(--cool-grey-600)" },
|
|
56
|
+
"(", position2Team === null || position2Team === void 0 ? void 0 :
|
|
57
|
+
position2Team.record,
|
|
58
|
+
")")),
|
|
59
|
+
React.createElement(Typography, { category: SECONDARY, size: isPosition2Winner ? MediumMedium : MediumBook }, isScorelessMatch ? '-' : position2Team === null || position2Team === void 0 ? void 0 : position2Team.points)),
|
|
60
|
+
React.createElement(BottomGrid, null,
|
|
61
|
+
React.createElement(Box, null,
|
|
62
|
+
React.createElement(Box, { display: "flex" },
|
|
63
|
+
React.createElement(Typography, { style: {
|
|
64
|
+
overflow: 'hidden',
|
|
65
|
+
textOverflow: 'ellipsis',
|
|
66
|
+
display: '-webkit-box',
|
|
67
|
+
WebkitBoxOrient: 'vertical',
|
|
68
|
+
WebkitLineClamp: 1,
|
|
69
|
+
}, category: SECONDARY, size: XSmallBook }, dateLabel),
|
|
70
|
+
React.createElement(Typography, { category: SECONDARY, size: XSmallBook, pl: 0.5, pr: 0.5 }, "\u2022"),
|
|
71
|
+
React.createElement(Typography, { style: {
|
|
72
|
+
overflow: 'hidden',
|
|
73
|
+
textOverflow: 'ellipsis',
|
|
74
|
+
display: '-webkit-box',
|
|
75
|
+
WebkitBoxOrient: 'vertical',
|
|
76
|
+
WebkitLineClamp: 1,
|
|
77
|
+
}, category: SECONDARY, size: XSmallBook }, timeLabel),
|
|
78
|
+
React.createElement(Typography, { category: SECONDARY, size: XSmallBook, pl: 0.5, pr: 0.5 }, "\u2022"),
|
|
79
|
+
React.createElement(Typography, { style: {
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
textOverflow: 'ellipsis',
|
|
82
|
+
display: '-webkit-box',
|
|
83
|
+
WebkitBoxOrient: 'vertical',
|
|
84
|
+
WebkitLineClamp: 1,
|
|
85
|
+
}, category: SECONDARY, size: XSmallBook }, matchInfo)),
|
|
86
|
+
React.createElement(Typography, { style: {
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
textOverflow: 'ellipsis',
|
|
89
|
+
display: '-webkit-box',
|
|
90
|
+
WebkitBoxOrient: 'vertical',
|
|
91
|
+
WebkitLineClamp: 1,
|
|
92
|
+
}, category: SECONDARY, size: XSmallBook }, locationLabel)))));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=TeamDrawCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamDrawCard.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/TeamDrawCard.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,mBAAmB,MAAM,yCAAyC,CAAC;AAC1E,OAAO,UAAU,EAAE,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACpG,OAAO,oBAAoB,MAAM,8CAA8C,CAAC;AAGhF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,EAA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;4BAClB,YAAY,EAAE,UAAU;4BACxB,OAAO,EAAE,aAAa;4BACtB,eAAe,EAAE,UAAU;4BAC3B,eAAe,EAAE,CAAC;yBACnB,EACD,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,UAAU,IAEf,SAAS,CACD,CACX;gBACN,oBAAC,UAAU,IACP,KAAK,EAAE;wBACL,QAAQ,EAAE,QAAQ;wBAClB,YAAY,EAAE,UAAU;wBACxB,OAAO,EAAE,aAAa;wBACtB,eAAe,EAAE,UAAU;wBAC3B,eAAe,EAAE,CAAC;qBACnB,EACD,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,UAAU,IAEf,aAAa,CACL,CACX,CACG,CACJ,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -13,6 +13,8 @@ type OnChangeArgs = {
|
|
|
13
13
|
type PositionTeam = {
|
|
14
14
|
name: string;
|
|
15
15
|
points: number;
|
|
16
|
+
href?: string;
|
|
17
|
+
record?: number;
|
|
16
18
|
};
|
|
17
19
|
export type DrawCardProps = {
|
|
18
20
|
options: Options;
|
|
@@ -33,6 +35,17 @@ export type DrawCardProps = {
|
|
|
33
35
|
onViewClick?: VoidFunction;
|
|
34
36
|
onChange: ({ position, id }: OnChangeArgs) => void;
|
|
35
37
|
};
|
|
38
|
+
export type TeamDrawCardProps = {
|
|
39
|
+
dateLabel: string;
|
|
40
|
+
locationLabel: string;
|
|
41
|
+
timeLabel: string;
|
|
42
|
+
matchInfo?: string;
|
|
43
|
+
isPosition1Winner?: boolean;
|
|
44
|
+
isPosition2Winner?: boolean;
|
|
45
|
+
isScorelessMatch?: boolean;
|
|
46
|
+
position1Team: PositionTeam;
|
|
47
|
+
position2Team: PositionTeam;
|
|
48
|
+
};
|
|
36
49
|
export interface TeamCardProps {
|
|
37
50
|
title: string;
|
|
38
51
|
description: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import TeamDrawCard from 'stories/molecules/Cards/TeamDrawCard';
|
|
2
3
|
import DrawCard from '../../molecules/Cards/DrawCard';
|
|
3
4
|
import DrawCardTable from './DrawCardTable';
|
|
4
|
-
import
|
|
5
|
+
import TeamDrawCardTable from './TeamDrawCardTable';
|
|
6
|
+
import { MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA, SAMPLE_CARD_DATA, SAMPLE_TEAM_PAGE_CARD_DATA } from './mockData';
|
|
5
7
|
const onOrderPropertyChange = () => { };
|
|
6
8
|
// Default
|
|
7
9
|
export default {
|
|
@@ -11,6 +13,9 @@ export default {
|
|
|
11
13
|
function DrawCardTableTemplate(args) {
|
|
12
14
|
return React.createElement(DrawCardTable, Object.assign({}, args));
|
|
13
15
|
}
|
|
16
|
+
function TeamDrawCardTableTemplate(args) {
|
|
17
|
+
return React.createElement(TeamDrawCardTable, Object.assign({}, args));
|
|
18
|
+
}
|
|
14
19
|
const headerRows = [
|
|
15
20
|
{ name: 'Round 1' },
|
|
16
21
|
{ name: 'Quarterfinal' },
|
|
@@ -41,12 +46,38 @@ const tableRows = [
|
|
|
41
46
|
React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
|
|
42
47
|
],
|
|
43
48
|
];
|
|
49
|
+
const teamTableRows = [
|
|
50
|
+
[
|
|
51
|
+
React.createElement(TeamDrawCard, Object.assign({}, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
52
|
+
React.createElement(TeamDrawCard, Object.assign({}, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
53
|
+
React.createElement(TeamDrawCard, Object.assign({ isScorelessMatch: true }, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
54
|
+
React.createElement(TeamDrawCard, Object.assign({ isScorelessMatch: true }, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
React.createElement(TeamDrawCard, Object.assign({}, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
58
|
+
React.createElement(TeamDrawCard, Object.assign({}, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
React.createElement(TeamDrawCard, Object.assign({}, SAMPLE_TEAM_PAGE_CARD_DATA)),
|
|
62
|
+
],
|
|
63
|
+
];
|
|
44
64
|
// Stories
|
|
45
65
|
export const DrawTable = DrawCardTableTemplate.bind({});
|
|
46
66
|
DrawTable.args = {
|
|
47
67
|
headerRows,
|
|
48
68
|
tableRows,
|
|
49
69
|
};
|
|
70
|
+
export const TeamDrawTable = TeamDrawCardTableTemplate.bind({});
|
|
71
|
+
TeamDrawTable.args = {
|
|
72
|
+
headerRows,
|
|
73
|
+
tableRows: teamTableRows,
|
|
74
|
+
};
|
|
75
|
+
export const MobileTeamDrawTable = TeamDrawCardTableTemplate.bind({});
|
|
76
|
+
MobileTeamDrawTable.args = {
|
|
77
|
+
headerRows,
|
|
78
|
+
tableRows: teamTableRows,
|
|
79
|
+
isMobile: true
|
|
80
|
+
};
|
|
50
81
|
export const SortableTable = DrawCardTableTemplate.bind({});
|
|
51
82
|
SortableTable.args = {
|
|
52
83
|
headCells: MOCK_HEAD_CELLS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tables.stories.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/Tables.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AACtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Tables.stories.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/Tables.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AACtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,iBAAi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E,CAAC,CAAC;AACxD,SAAS,CAAC,IAAI,GAAG;IACf,UAAU;IACV,SAAS;CACV,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,aAAa,CAAC,IAAI,GAAG;IACnB,UAAU;IACV,SAAS,EAAE,aAAa;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtE,mBAAmB,CAAC,IAAI,GAAG;IACzB,UAAU;IACV,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5D,aAAa,CAAC,IAAI,GAAG;IACnB,SAAS,EAAE,eAAe;IAC1B,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,QAAQ;IACxB,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,eAAe;IAC1B,YAAY,EAAE,gBAAgB;IAC9B,qBAAqB;CACtB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
14
|
+
import Button from '@mui/material/Button';
|
|
15
|
+
import { styled } from '@mui/material/styles';
|
|
16
|
+
import Grid from '@mui/material/Grid';
|
|
17
|
+
import ArrowForwardIosOutlinedIcon from '@mui/icons-material/ArrowForwardIosOutlined';
|
|
18
|
+
import ArrowBackIosOutlinedIcon from '@mui/icons-material/ArrowBackIosOutlined';
|
|
19
|
+
import Typography from '../../atoms/Typography/Typography';
|
|
20
|
+
const StyledHeader = styled(Grid)({
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
});
|
|
25
|
+
const StyledGrid = styled(Grid)({
|
|
26
|
+
'&:nth-last-child(-n+2) .team-draw-card': {
|
|
27
|
+
'&:before': {
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
content: '""',
|
|
30
|
+
width: '25px',
|
|
31
|
+
height: '1px',
|
|
32
|
+
left: 0,
|
|
33
|
+
top: '50%',
|
|
34
|
+
backgroundColor: 'var(--cool-grey-600)',
|
|
35
|
+
transform: 'translateX(-100%)',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
'&:nth-child(-n+2) .team-draw-card': {
|
|
39
|
+
'&:after': {
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
content: '""',
|
|
42
|
+
width: '25px',
|
|
43
|
+
height: '1px',
|
|
44
|
+
right: 0,
|
|
45
|
+
top: '50%',
|
|
46
|
+
backgroundColor: 'var(--cool-grey-600)',
|
|
47
|
+
transform: 'translateX(100%)',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const GridSections = styled(Box)({
|
|
52
|
+
display: 'flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
paddingTop: '8px',
|
|
55
|
+
paddingBottom: '8px',
|
|
56
|
+
});
|
|
57
|
+
const TableMobileSection = styled(Grid) `
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
`;
|
|
60
|
+
export default function TeamDrawCardTable(_a) {
|
|
61
|
+
var { headerRows, tableRows, isMobile } = _a, props = __rest(_a, ["headerRows", "tableRows", "isMobile"]);
|
|
62
|
+
const [activeStep, setActiveStep] = React.useState(0);
|
|
63
|
+
const handleNext = () => {
|
|
64
|
+
setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
65
|
+
};
|
|
66
|
+
const handleBack = () => {
|
|
67
|
+
setActiveStep((prevActiveStep) => prevActiveStep - 1);
|
|
68
|
+
};
|
|
69
|
+
if (!headerRows || !tableRows)
|
|
70
|
+
return null;
|
|
71
|
+
const totalColumns = Math.floor(12 / headerRows.length);
|
|
72
|
+
const formatTableRows = tableRows.map((row, index) => {
|
|
73
|
+
if (index > 2)
|
|
74
|
+
return; // Table can only support 3 columns
|
|
75
|
+
const rowSectionsHeight = `${100 / tableRows[index].length}%`;
|
|
76
|
+
const sectionAmount = tableRows[index].length;
|
|
77
|
+
return (React.createElement(StyledGrid, { key: index, xs: totalColumns }, [...Array(sectionAmount)].map((section, idx) => (React.createElement(GridSections, { key: idx, sx: { height: rowSectionsHeight } }, row[idx])))));
|
|
78
|
+
});
|
|
79
|
+
const formatDesktopRows = (React.createElement(React.Fragment, null,
|
|
80
|
+
React.createElement(Grid, { container: true, sx: { height: '60px' } }, headerRows.map((row) => (React.createElement(StyledHeader, { key: row.name, xs: totalColumns },
|
|
81
|
+
React.createElement(Typography, { category: "secondary", size: "small-medium-cap" }, row.name))))),
|
|
82
|
+
React.createElement(Grid, { container: true }, formatTableRows)));
|
|
83
|
+
const formatMobileRows = (React.createElement(Box, null,
|
|
84
|
+
React.createElement(Grid, { container: true, justifyContent: "space-between" },
|
|
85
|
+
React.createElement(Button, { color: "inherit", disabled: activeStep === 0, onClick: handleBack, sx: { mr: 1, alignSelf: 'flex-start' } },
|
|
86
|
+
React.createElement(ArrowBackIosOutlinedIcon, null)),
|
|
87
|
+
React.createElement(StyledHeader, { xs: totalColumns },
|
|
88
|
+
React.createElement(Typography, { category: "secondary", size: "small-medium-cap" }, headerRows[activeStep].name)),
|
|
89
|
+
React.createElement(Button, { onClick: handleNext, disabled: activeStep === tableRows.length - 1 },
|
|
90
|
+
React.createElement(ArrowForwardIosOutlinedIcon, null))),
|
|
91
|
+
React.createElement(TableMobileSection, { container: true },
|
|
92
|
+
React.createElement(GridSections, { sx: { display: 'flex', flexDirection: 'column', gap: '10px' } }, tableRows[activeStep]))));
|
|
93
|
+
return (React.createElement(Box, Object.assign({}, props, { sx: { flexGrow: 1 }, "aria-label": "draw table" }), isMobile ? formatMobileRows : formatDesktopRows));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=TeamDrawCardTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamDrawCardTable.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/TeamDrawCardTable.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,2BAA2B,MAAM,6CAA6C,CAAC;AACtF,OAAO,wBAAwB,MAAM,0CAA0C,CAAC;AAChF,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAG3D,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IACxB,OAAO,EAAE,MAAM;CAChB,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,wCAAwC,EAAE;QACxC,UAAU,EAAE;YACV,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,KAAK;YACV,eAAe,EAAE,sBAAsB;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AAC,EAC1B,OAAO,EAAE,UAAU,EACnB,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE;gBAEtC,oBAAC,wBAAwB,OAAG,CACvB;YACT,oBAAC,YAAY,IAAC,EAAE,EAAE,YAAY;gBAC1B,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,kBAAkB,IAAE,UAAU,CAAC,UAAU,CAAC,CAAC,IAAI,CAAc,CACxF;YACf,oBAAC,MAAM,IAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,KAAK,SAAS,CAAC,MAAM,GAAG,CAAC;gBACtE,oBAAC,2BAA2B,OAAG,CAC1B,CACN;QACP,oBAAC,kBAAkB,IAAC,SAAS;YACzB,oBAAC,YAAY,IAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IACtE,SAAS,CAAC,UAAU,CAAC,CACX,CACE,CACnB,CACT,CAAC;IAEF,OAAO,CACH,oBAAC,GAAG,oBAAK,KAAK,IAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,gBAAa,YAAY,KACvD,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAC9C,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -47,4 +47,24 @@ export declare const SAMPLE_CARD_DATA: {
|
|
|
47
47
|
points: number;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
+
export declare const SAMPLE_TEAM_PAGE_CARD_DATA: {
|
|
51
|
+
dateLabel: string;
|
|
52
|
+
timeLabel: string;
|
|
53
|
+
locationLabel: string;
|
|
54
|
+
matchInfo: string;
|
|
55
|
+
isPosition1Winner: boolean;
|
|
56
|
+
isPosition2Winner: boolean;
|
|
57
|
+
position1Team: {
|
|
58
|
+
name: string;
|
|
59
|
+
points: number;
|
|
60
|
+
href: string;
|
|
61
|
+
record: number;
|
|
62
|
+
};
|
|
63
|
+
position2Team: {
|
|
64
|
+
name: string;
|
|
65
|
+
points: number;
|
|
66
|
+
href: string;
|
|
67
|
+
record: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
50
70
|
export {};
|
|
@@ -76,4 +76,24 @@ export const SAMPLE_CARD_DATA = {
|
|
|
76
76
|
points: 4,
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
+
export const SAMPLE_TEAM_PAGE_CARD_DATA = {
|
|
80
|
+
dateLabel: 'Dec 20',
|
|
81
|
+
timeLabel: '9:00pm',
|
|
82
|
+
locationLabel: 'Taube Tennis Center',
|
|
83
|
+
matchInfo: 'Round 1, Match 2',
|
|
84
|
+
isPosition1Winner: true,
|
|
85
|
+
isPosition2Winner: false,
|
|
86
|
+
position1Team: {
|
|
87
|
+
name: 'Apples',
|
|
88
|
+
points: 10,
|
|
89
|
+
href: 'https://www.reddit.com',
|
|
90
|
+
record: 2
|
|
91
|
+
},
|
|
92
|
+
position2Team: {
|
|
93
|
+
name: 'Pears',
|
|
94
|
+
points: 4,
|
|
95
|
+
href: 'https://www.reddit.com',
|
|
96
|
+
record: 2
|
|
97
|
+
}
|
|
98
|
+
};
|
|
79
99
|
//# sourceMappingURL=mockData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/mockData.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkBhE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAY,EAAE,EAAE;IACjE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC1C,OAAO,CACH,oBAAC,QAAQ;QACL,oBAAC,SAA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7B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE;QACP;YACE,EAAE,EAAE,CAAC;YACL,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,EAAE,EAAE,CAAC;YACL,KAAK,EAAE,QAAQ;SAChB;KACF;IACD,eAAe,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;KACb;IACD,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAgB,EAAE,EAAE,GAAE,CAAC;IAChD,SAAS,EAAE,kBAAkB;IAC7B,aAAa,EAAE,GAAG;IAClB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,KAAK;IACxB,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,EAAE;KACX;IACD,aAAa,EAAE;QACb,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,CAAC;KACV;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/mockData.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkBhE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAY,EAAE,EAAE;IACjE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC1C,OAAO,CACH,oBAAC,QAAQ;QACL,oBAAC,SAAS,IACN,SAAS,EAAC,IAAI,EACd,EAAE,EAAE,OAAO,EACX,KAAK,EAAC,KAAK,EACX,OAAO,EAAC,QAAQ;YAEhB,oBAAC,UAAU,QAAE,MAAM,CAAc,CACzB;QACZ,oBAAC,SAAS,IAAC,KAAK,EAAC,MAAM;YACnB,oBAAC,UAAU,QAAE,IAAI,CAAc,CACv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E,CAAC;QACZ,SAAS,EAAE,CAAC;KACb;IACD,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAgB,EAAE,EAAE,GAAE,CAAC;IAChD,SAAS,EAAE,kBAAkB;IAC7B,aAAa,EAAE,GAAG;IAClB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,KAAK;IACxB,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,EAAE;KACX;IACD,aAAa,EAAE;QACb,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,CAAC;KACV;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,aAAa,EAAE,qBAAqB;IACpC,SAAS,EAAE,kBAAkB;IAC7B,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,KAAK;IACxB,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE,CAAC;KACV;IACD,aAAa,EAAE;QACb,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE,CAAC;KACV;CACF,CAAC"}
|
package/package.json
CHANGED
package/src/components.jsx
CHANGED
|
@@ -22,6 +22,7 @@ export { default as SessionIcon } from './stories/atoms/Icons/SessionIcon';
|
|
|
22
22
|
export { default as SwapIcon } from './stories/atoms/Icons/SwapIcon';
|
|
23
23
|
export { default as VisibilityIcon } from './stories/atoms/Icons/VisibilityIcon';
|
|
24
24
|
export { default as VisibilityOffIcon } from './stories/atoms/Icons/VisibilityOffIcon';
|
|
25
|
+
export { default as WinnerIndicatorIcon } from './stories/atoms/Icons/WinnerIndicatorIcon';
|
|
25
26
|
|
|
26
27
|
// MOLECULES
|
|
27
28
|
export { default as AvatarWithName } from './stories/molecules/AvatarWithName/AvatarWithName';
|
|
@@ -29,8 +30,10 @@ export { default as ContactCard } from './stories/molecules/Cards/ContactCard';
|
|
|
29
30
|
export { default as DrawCard } from './stories/molecules/Cards/DrawCard';
|
|
30
31
|
export { default as SquareAvatarWithName } from './stories/molecules/SquareAvatarWithName/SquareAvatarWithName';
|
|
31
32
|
export { default as TeamCard } from './stories/molecules/Cards/TeamCard';
|
|
33
|
+
export { default as TeamDrawCard } from './stories/molecules/Cards/TeamDrawCard';
|
|
32
34
|
|
|
33
35
|
// ORGANISMS
|
|
34
36
|
export { default as DrawCardTable } from './stories/organisms/Tables/DrawCardTable';
|
|
35
37
|
export { default as FullPageModal } from './stories/organisms/Modals/FullPageModal';
|
|
36
38
|
export { default as SortableTable } from './stories/organisms/Tables/SortableTable';
|
|
39
|
+
export { default as TeamDrawCardTable } from './stories/organisms/Tables/TeamDrawCardTable';
|
|
@@ -4,7 +4,7 @@ import { IconProps } from './sharedTypes';
|
|
|
4
4
|
|
|
5
5
|
export default function AddIcon({ size, color }: IconProps) {
|
|
6
6
|
return (
|
|
7
|
-
<svg width={size} height={size} viewBox="0 0
|
|
7
|
+
<svg width={size} height={size} viewBox="0 0 16 16" fill={color} xmlns="http://www.w3.org/2000/svg">
|
|
8
8
|
<path fillRule="evenodd" clipRule="evenodd" d="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z" />
|
|
9
9
|
<path d="M7.5 4.5C7.5 4.22386 7.72386 4 8 4V4C8.27614 4 8.5 4.22386 8.5 4.5V11.5C8.5 11.7761 8.27614 12 8 12V12C7.72386 12 7.5 11.7761 7.5 11.5V4.5Z" />
|
|
10
10
|
<path d="M4 8C4 7.72386 4.22386 7.5 4.5 7.5H11.5C11.7761 7.5 12 7.72386 12 8V8C12 8.27614 11.7761 8.5 11.5 8.5H4.5C4.22386 8.5 4 8.27614 4 8V8Z" />
|
|
@@ -4,7 +4,7 @@ import { IconProps } from './sharedTypes';
|
|
|
4
4
|
|
|
5
5
|
export default function ClockIcon({ size, color }: IconProps) {
|
|
6
6
|
return (
|
|
7
|
-
<svg width={size} height={size} viewBox="0 0
|
|
7
|
+
<svg width={size} height={size} viewBox="0 0 16 16" fill={color} xmlns="http://www.w3.org/2000/svg">
|
|
8
8
|
<path fillRule="evenodd" clipRule="evenodd" d="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z" />
|
|
9
9
|
<path fillRule="evenodd" clipRule="evenodd" d="M8 3C8.27614 3 8.5 3.22386 8.5 3.5L8.5 8.5C8.5 8.77614 8.27614 9 8 9C7.72386 9 7.5 8.77614 7.5 8.5L7.5 3.5C7.5 3.22386 7.72386 3 8 3Z" />
|
|
10
10
|
<path fillRule="evenodd" clipRule="evenodd" d="M11.4069 6.94146C11.5365 7.18528 11.4439 7.48803 11.2001 7.61767L8.34821 9.13406C8.10439 9.2637 7.80164 9.17114 7.672 8.92733C7.54236 8.68351 7.63492 8.38076 7.87874 8.25112L10.7307 6.73472C10.9745 6.60508 11.2772 6.69764 11.4069 6.94146Z" />
|
|
@@ -16,7 +16,8 @@ import SessionIcon from './SessionIcon';
|
|
|
16
16
|
import SwapIcon from './SwapIcon';
|
|
17
17
|
import VisibilityIcon from './VisibilityIcon';
|
|
18
18
|
import VisibilityOffIcon from './VisibilityOffIcon';
|
|
19
|
-
import
|
|
19
|
+
import WinnerIndicatorIcon from './WinnerIndicatorIcon';
|
|
20
|
+
import { IconProps, WinnerIndicatorIconProps } from './sharedTypes';
|
|
20
21
|
|
|
21
22
|
// Default
|
|
22
23
|
export default {
|
|
@@ -88,6 +89,10 @@ function VisibilityOffIconTemplate(args: IconProps) {
|
|
|
88
89
|
return <VisibilityOffIcon {...args} />;
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
function WinnerIndicatorIconTemplate(args: WinnerIndicatorIconProps) {
|
|
93
|
+
return <WinnerIndicatorIcon {...args} />;
|
|
94
|
+
}
|
|
95
|
+
|
|
91
96
|
// Stories
|
|
92
97
|
export const Add = AddIconTemplate.bind({});
|
|
93
98
|
Add.args = {
|
|
@@ -184,3 +189,8 @@ VisibilityOff.args = {
|
|
|
184
189
|
size: 150,
|
|
185
190
|
color: 'black'
|
|
186
191
|
};
|
|
192
|
+
|
|
193
|
+
export const WinnerIndicator = WinnerIndicatorIconTemplate.bind({});
|
|
194
|
+
WinnerIndicator.args = {
|
|
195
|
+
isBlack: true
|
|
196
|
+
};
|
|
@@ -4,7 +4,7 @@ import { IconProps } from './sharedTypes';
|
|
|
4
4
|
|
|
5
5
|
export default function VisibilityIcon({ size, color }: IconProps) {
|
|
6
6
|
return (
|
|
7
|
-
<svg width={size} height={size} viewBox="0 0
|
|
7
|
+
<svg width={size} height={size} viewBox="0 0 16 16" fill={color} xmlns="http://www.w3.org/2000/svg">
|
|
8
8
|
<path fillRule="evenodd" clipRule="evenodd" d="M0 8C0 8 3.58172 14 8 14C12.4183 14 16 8 16 8C16 8 12.4183 2 8 2C3.58172 2 0 8 0 8ZM1.19246 8C1.26436 8.10528 1.34719 8.22394 1.44034 8.35336C1.82566 8.88878 2.38093 9.59917 3.06268 10.3055C4.47204 11.7658 6.22099 13 8 13C9.77901 13 11.528 11.7658 12.9373 10.3055C13.6191 9.59917 14.1743 8.88878 14.5597 8.35336C14.6528 8.22394 14.7356 8.10528 14.8075 8C14.7356 7.89472 14.6528 7.77606 14.5597 7.64664C14.1743 7.11122 13.6191 6.40083 12.9373 5.69446C11.528 4.2342 9.77901 3 8 3C6.22099 3 4.47204 4.2342 3.06268 5.69446C2.38093 6.40083 1.82566 7.11122 1.44034 7.64664C1.34719 7.77606 1.26436 7.89472 1.19246 8Z" />
|
|
9
9
|
<path fillRule="evenodd" clipRule="evenodd" d="M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10ZM8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z" />
|
|
10
10
|
</svg>
|
|
@@ -4,7 +4,7 @@ import { IconProps } from './sharedTypes';
|
|
|
4
4
|
|
|
5
5
|
export default function VisibilityOffIcon({ size, color }: IconProps) {
|
|
6
6
|
return (
|
|
7
|
-
<svg width={size} height={size} viewBox="0 0
|
|
7
|
+
<svg width={size} height={size} viewBox="0 0 16 16" fill={color} xmlns="http://www.w3.org/2000/svg">
|
|
8
8
|
<path fillRule="evenodd" clipRule="evenodd" d="M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10ZM8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z" />
|
|
9
9
|
<path fillRule="evenodd" clipRule="evenodd" d="M0.646522 15.6464C0.45126 15.4511 0.45126 15.1346 0.646522 14.9393L14.7887 0.797158C14.9839 0.601896 15.3005 0.601896 15.4958 0.797158C15.691 0.99242 15.691 1.309 15.4958 1.50426L1.35363 15.6464C1.15837 15.8417 0.841784 15.8417 0.646522 15.6464Z" />
|
|
10
10
|
<path fillRule="evenodd" clipRule="evenodd" d="M0 8C0 8 3.58172 14 8 14C12.4183 14 16 8 16 8C16 8 12.4183 2 8 2C3.58172 2 0 8 0 8ZM1.19246 8C1.26436 8.10528 1.34719 8.22394 1.44034 8.35336C1.82566 8.88878 2.38093 9.59917 3.06268 10.3055C4.47204 11.7658 6.22099 13 8 13C9.77901 13 11.528 11.7658 12.9373 10.3055C13.6191 9.59917 14.1743 8.88878 14.5597 8.35336C14.6528 8.22394 14.7356 8.10528 14.8075 8C14.7356 7.89472 14.6528 7.77606 14.5597 7.64664C14.1743 7.11122 13.6191 6.40083 12.9373 5.69446C11.528 4.2342 9.77901 3 8 3C6.22099 3 4.47204 4.2342 3.06268 5.69446C2.38093 6.40083 1.82566 7.11122 1.44034 7.64664C1.34719 7.77606 1.26436 7.89472 1.19246 8Z" />
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { WinnerIndicatorIconProps } from './sharedTypes';
|
|
4
|
+
|
|
5
|
+
const arrowStyles = {
|
|
6
|
+
borderTop: '10px solid transparent',
|
|
7
|
+
borderBottom: '10px solid transparent',
|
|
8
|
+
borderLeft: '10px solid white',
|
|
9
|
+
height: 0,
|
|
10
|
+
width: 0
|
|
11
|
+
};
|
|
12
|
+
const rectangleStyles = {
|
|
13
|
+
background: 'white',
|
|
14
|
+
height: 20,
|
|
15
|
+
width: 3
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const blackArrowStyles = {
|
|
19
|
+
borderTop: '8px solid transparent',
|
|
20
|
+
borderBottom: '8px solid transparent',
|
|
21
|
+
borderLeft: '8px solid black',
|
|
22
|
+
height: 0,
|
|
23
|
+
width: 0
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const blackRectangleStyles = {
|
|
27
|
+
background: 'black',
|
|
28
|
+
height: 16,
|
|
29
|
+
width: 3
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default function WinnerIndicatorIcon({ sx, isBlack }: WinnerIndicatorIconProps) {
|
|
33
|
+
return (
|
|
34
|
+
<Box sx={sx} display="flex">
|
|
35
|
+
<Box style={isBlack ? blackRectangleStyles : rectangleStyles} />
|
|
36
|
+
<Box style={isBlack ? blackArrowStyles : arrowStyles} />
|
|
37
|
+
</Box>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import WinnerIndicatorIcon from 'stories/atoms/Icons/WinnerIndicatorIcon';
|
|
5
|
+
import Typography, { SECONDARY_SIZES_ENUM, CATEGORY_ENUM } from '../../atoms/Typography/Typography';
|
|
6
|
+
import SquareAvatarWithName from '../SquareAvatarWithName/SquareAvatarWithName';
|
|
7
|
+
import { TeamDrawCardProps } from "./sharedTypes";
|
|
8
|
+
|
|
9
|
+
const StyledCard = styled(Box)({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
borderRadius: '4px',
|
|
13
|
+
padding: '16px 24px',
|
|
14
|
+
width: '100%',
|
|
15
|
+
height: '100px',
|
|
16
|
+
backgroundColor: 'var(--white)',
|
|
17
|
+
border: '1px solid var(--cool-grey-600)',
|
|
18
|
+
marginLeft: '25px',
|
|
19
|
+
marginRight: '25px',
|
|
20
|
+
position: 'relative'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const BottomGrid = styled(Box)({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'space-between',
|
|
27
|
+
paddingTop: '8px',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default function TeamDrawCard({
|
|
31
|
+
dateLabel, locationLabel, timeLabel, matchInfo,
|
|
32
|
+
isPosition1Winner, isPosition2Winner,
|
|
33
|
+
isScorelessMatch, position1Team, position2Team, ...props
|
|
34
|
+
}: TeamDrawCardProps) {
|
|
35
|
+
const { MediumMedium, MediumBook, XSmallBook } = SECONDARY_SIZES_ENUM;
|
|
36
|
+
const { SECONDARY } = CATEGORY_ENUM;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<StyledCard className="team-draw-card" {...props}>
|
|
40
|
+
<Box display="flex" justifyContent="space-between" mb={0.5}>
|
|
41
|
+
{isPosition1Winner && <WinnerIndicatorIcon isBlack sx={{ position: "absolute", left: 0, top: 20 }} />}
|
|
42
|
+
<Box display="flex" alignItems="center" gap={0.5}>
|
|
43
|
+
<SquareAvatarWithName
|
|
44
|
+
name={position1Team?.name}
|
|
45
|
+
fontSize={isPosition1Winner ? MediumMedium : MediumBook}
|
|
46
|
+
href={position1Team.href}
|
|
47
|
+
isBye={!position1Team?.name}
|
|
48
|
+
/>
|
|
49
|
+
<Typography category={SECONDARY} size={XSmallBook} color="var(--cool-grey-600)">
|
|
50
|
+
(
|
|
51
|
+
{position1Team?.record}
|
|
52
|
+
)
|
|
53
|
+
</Typography>
|
|
54
|
+
</Box>
|
|
55
|
+
<Typography category={SECONDARY} size={isPosition1Winner ? MediumMedium : MediumBook}>
|
|
56
|
+
{isScorelessMatch ? '-' : position1Team?.points}
|
|
57
|
+
</Typography>
|
|
58
|
+
</Box>
|
|
59
|
+
<Box display="flex" justifyContent="space-between">
|
|
60
|
+
{isPosition2Winner && <WinnerIndicatorIcon isBlack sx={{ position: "absolute", left: 0, top: 50 }} />}
|
|
61
|
+
<Box display="flex" alignItems="center" gap={0.5}>
|
|
62
|
+
<SquareAvatarWithName
|
|
63
|
+
name={position2Team?.name}
|
|
64
|
+
fontSize={isPosition2Winner ? MediumMedium : MediumBook}
|
|
65
|
+
href={position2Team.href}
|
|
66
|
+
isBye={!position2Team?.name}
|
|
67
|
+
/>
|
|
68
|
+
<Typography category={SECONDARY} size={XSmallBook} color="var(--cool-grey-600)">
|
|
69
|
+
(
|
|
70
|
+
{position2Team?.record}
|
|
71
|
+
)
|
|
72
|
+
</Typography>
|
|
73
|
+
</Box>
|
|
74
|
+
<Typography category={SECONDARY} size={isPosition2Winner ? MediumMedium : MediumBook}>
|
|
75
|
+
{isScorelessMatch ? '-' : position2Team?.points}
|
|
76
|
+
</Typography>
|
|
77
|
+
</Box>
|
|
78
|
+
<BottomGrid>
|
|
79
|
+
<Box>
|
|
80
|
+
<Box display="flex">
|
|
81
|
+
<Typography
|
|
82
|
+
style={{
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
textOverflow: 'ellipsis',
|
|
85
|
+
display: '-webkit-box',
|
|
86
|
+
WebkitBoxOrient: 'vertical',
|
|
87
|
+
WebkitLineClamp: 1,
|
|
88
|
+
}}
|
|
89
|
+
category={SECONDARY}
|
|
90
|
+
size={XSmallBook}
|
|
91
|
+
>
|
|
92
|
+
{dateLabel}
|
|
93
|
+
</Typography>
|
|
94
|
+
<Typography
|
|
95
|
+
category={SECONDARY}
|
|
96
|
+
size={XSmallBook}
|
|
97
|
+
pl={0.5}
|
|
98
|
+
pr={0.5}
|
|
99
|
+
>
|
|
100
|
+
•
|
|
101
|
+
</Typography>
|
|
102
|
+
<Typography
|
|
103
|
+
style={{
|
|
104
|
+
overflow: 'hidden',
|
|
105
|
+
textOverflow: 'ellipsis',
|
|
106
|
+
display: '-webkit-box',
|
|
107
|
+
WebkitBoxOrient: 'vertical',
|
|
108
|
+
WebkitLineClamp: 1,
|
|
109
|
+
}}
|
|
110
|
+
category={SECONDARY}
|
|
111
|
+
size={XSmallBook}
|
|
112
|
+
>
|
|
113
|
+
{timeLabel}
|
|
114
|
+
</Typography>
|
|
115
|
+
<Typography
|
|
116
|
+
category={SECONDARY}
|
|
117
|
+
size={XSmallBook}
|
|
118
|
+
pl={0.5}
|
|
119
|
+
pr={0.5}
|
|
120
|
+
>
|
|
121
|
+
•
|
|
122
|
+
</Typography>
|
|
123
|
+
<Typography
|
|
124
|
+
style={{
|
|
125
|
+
overflow: 'hidden',
|
|
126
|
+
textOverflow: 'ellipsis',
|
|
127
|
+
display: '-webkit-box',
|
|
128
|
+
WebkitBoxOrient: 'vertical',
|
|
129
|
+
WebkitLineClamp: 1,
|
|
130
|
+
}}
|
|
131
|
+
category={SECONDARY}
|
|
132
|
+
size={XSmallBook}
|
|
133
|
+
>
|
|
134
|
+
{matchInfo}
|
|
135
|
+
</Typography>
|
|
136
|
+
</Box>
|
|
137
|
+
<Typography
|
|
138
|
+
style={{
|
|
139
|
+
overflow: 'hidden',
|
|
140
|
+
textOverflow: 'ellipsis',
|
|
141
|
+
display: '-webkit-box',
|
|
142
|
+
WebkitBoxOrient: 'vertical',
|
|
143
|
+
WebkitLineClamp: 1,
|
|
144
|
+
}}
|
|
145
|
+
category={SECONDARY}
|
|
146
|
+
size={XSmallBook}
|
|
147
|
+
>
|
|
148
|
+
{locationLabel}
|
|
149
|
+
</Typography>
|
|
150
|
+
</Box>
|
|
151
|
+
</BottomGrid>
|
|
152
|
+
</StyledCard>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
@@ -18,6 +18,8 @@ type OnChangeArgs = {
|
|
|
18
18
|
type PositionTeam = {
|
|
19
19
|
name: string;
|
|
20
20
|
points: number;
|
|
21
|
+
href?: string;
|
|
22
|
+
record?: number;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export type DrawCardProps = {
|
|
@@ -40,6 +42,18 @@ export type DrawCardProps = {
|
|
|
40
42
|
onChange: ({ position, id }: OnChangeArgs) => void;
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
export type TeamDrawCardProps = {
|
|
46
|
+
dateLabel: string;
|
|
47
|
+
locationLabel: string;
|
|
48
|
+
timeLabel: string;
|
|
49
|
+
matchInfo?: string;
|
|
50
|
+
isPosition1Winner?: boolean;
|
|
51
|
+
isPosition2Winner?: boolean;
|
|
52
|
+
isScorelessMatch?: boolean;
|
|
53
|
+
position1Team: PositionTeam;
|
|
54
|
+
position2Team: PositionTeam;
|
|
55
|
+
}
|
|
56
|
+
|
|
43
57
|
export interface TeamCardProps {
|
|
44
58
|
title: string;
|
|
45
59
|
description: string;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import TeamDrawCard from 'stories/molecules/Cards/TeamDrawCard';
|
|
2
3
|
import DrawCard from '../../molecules/Cards/DrawCard';
|
|
3
4
|
import DrawCardTable from './DrawCardTable';
|
|
5
|
+
import TeamDrawCardTable from './TeamDrawCardTable';
|
|
4
6
|
import { DrawCardTableProps } from './sharedTypes';
|
|
5
7
|
import {
|
|
6
|
-
MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA, SAMPLE_CARD_DATA
|
|
8
|
+
MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA, SAMPLE_CARD_DATA, SAMPLE_TEAM_PAGE_CARD_DATA
|
|
7
9
|
} from './mockData';
|
|
8
10
|
|
|
9
11
|
const onOrderPropertyChange = () => {};
|
|
@@ -18,6 +20,10 @@ function DrawCardTableTemplate(args: DrawCardTableProps) {
|
|
|
18
20
|
return <DrawCardTable {...args} />;
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
function TeamDrawCardTableTemplate(args: DrawCardTableProps) {
|
|
24
|
+
return <TeamDrawCardTable {...args} />;
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
const headerRows = [
|
|
22
28
|
{ name: 'Round 1' },
|
|
23
29
|
{ name: 'Quarterfinal' },
|
|
@@ -50,6 +56,22 @@ const tableRows = [
|
|
|
50
56
|
],
|
|
51
57
|
];
|
|
52
58
|
|
|
59
|
+
const teamTableRows = [
|
|
60
|
+
[
|
|
61
|
+
<TeamDrawCard {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
62
|
+
<TeamDrawCard {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
63
|
+
<TeamDrawCard isScorelessMatch {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
64
|
+
<TeamDrawCard isScorelessMatch {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
<TeamDrawCard {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
68
|
+
<TeamDrawCard {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
<TeamDrawCard {...SAMPLE_TEAM_PAGE_CARD_DATA} />,
|
|
72
|
+
],
|
|
73
|
+
];
|
|
74
|
+
|
|
53
75
|
// Stories
|
|
54
76
|
export const DrawTable = DrawCardTableTemplate.bind({});
|
|
55
77
|
DrawTable.args = {
|
|
@@ -57,6 +79,19 @@ DrawTable.args = {
|
|
|
57
79
|
tableRows,
|
|
58
80
|
};
|
|
59
81
|
|
|
82
|
+
export const TeamDrawTable = TeamDrawCardTableTemplate.bind({});
|
|
83
|
+
TeamDrawTable.args = {
|
|
84
|
+
headerRows,
|
|
85
|
+
tableRows: teamTableRows,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const MobileTeamDrawTable = TeamDrawCardTableTemplate.bind({});
|
|
89
|
+
MobileTeamDrawTable.args = {
|
|
90
|
+
headerRows,
|
|
91
|
+
tableRows: teamTableRows,
|
|
92
|
+
isMobile: true
|
|
93
|
+
};
|
|
94
|
+
|
|
60
95
|
export const SortableTable = DrawCardTableTemplate.bind({});
|
|
61
96
|
SortableTable.args = {
|
|
62
97
|
headCells: MOCK_HEAD_CELLS,
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import Grid from '@mui/material/Grid';
|
|
6
|
+
import ArrowForwardIosOutlinedIcon from '@mui/icons-material/ArrowForwardIosOutlined';
|
|
7
|
+
import ArrowBackIosOutlinedIcon from '@mui/icons-material/ArrowBackIosOutlined';
|
|
8
|
+
import Typography from '../../atoms/Typography/Typography';
|
|
9
|
+
import { DrawCardTableProps } from './sharedTypes';
|
|
10
|
+
|
|
11
|
+
const StyledHeader = styled(Grid)({
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
justifyContent: 'center',
|
|
14
|
+
display: 'flex',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const StyledGrid = styled(Grid)({
|
|
18
|
+
'&:nth-last-child(-n+2) .team-draw-card': {
|
|
19
|
+
'&:before': {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
content: '""',
|
|
22
|
+
width: '25px',
|
|
23
|
+
height: '1px',
|
|
24
|
+
left: 0,
|
|
25
|
+
top: '50%',
|
|
26
|
+
backgroundColor: 'var(--cool-grey-600)',
|
|
27
|
+
transform: 'translateX(-100%)',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
'&:nth-child(-n+2) .team-draw-card': {
|
|
31
|
+
'&:after': {
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
content: '""',
|
|
34
|
+
width: '25px',
|
|
35
|
+
height: '1px',
|
|
36
|
+
right: 0,
|
|
37
|
+
top: '50%',
|
|
38
|
+
backgroundColor: 'var(--cool-grey-600)',
|
|
39
|
+
transform: 'translateX(100%)',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const GridSections = styled(Box)({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
paddingTop: '8px',
|
|
48
|
+
paddingBottom: '8px',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const TableMobileSection = styled(Grid)`
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export default function TeamDrawCardTable({
|
|
56
|
+
headerRows,
|
|
57
|
+
tableRows,
|
|
58
|
+
isMobile,
|
|
59
|
+
...props
|
|
60
|
+
}: DrawCardTableProps) {
|
|
61
|
+
const [activeStep, setActiveStep] = React.useState(0);
|
|
62
|
+
|
|
63
|
+
const handleNext = () => {
|
|
64
|
+
setActiveStep((prevActiveStep) => prevActiveStep + 1);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const handleBack = () => {
|
|
68
|
+
setActiveStep((prevActiveStep) => prevActiveStep - 1);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
if (!headerRows || !tableRows) return null;
|
|
72
|
+
|
|
73
|
+
const totalColumns = Math.floor(12 / headerRows.length);
|
|
74
|
+
|
|
75
|
+
const formatTableRows = tableRows.map((row, index) => {
|
|
76
|
+
if (index > 2) return; // Table can only support 3 columns
|
|
77
|
+
const rowSectionsHeight = `${100 / tableRows[index].length}%`;
|
|
78
|
+
const sectionAmount = tableRows[index].length;
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<StyledGrid key={index} xs={totalColumns}>
|
|
82
|
+
{[...Array(sectionAmount)].map((section, idx) => (
|
|
83
|
+
<GridSections key={idx} sx={{ height: rowSectionsHeight }}>
|
|
84
|
+
{row[idx]}
|
|
85
|
+
</GridSections>
|
|
86
|
+
))}
|
|
87
|
+
</StyledGrid>
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const formatDesktopRows = (
|
|
92
|
+
<>
|
|
93
|
+
<Grid container sx={{ height: '60px' }}>
|
|
94
|
+
{headerRows.map((row) => (
|
|
95
|
+
<StyledHeader key={row.name} xs={totalColumns}>
|
|
96
|
+
<Typography category="secondary" size="small-medium-cap">{row.name}</Typography>
|
|
97
|
+
</StyledHeader>
|
|
98
|
+
))}
|
|
99
|
+
</Grid>
|
|
100
|
+
<Grid container>
|
|
101
|
+
{formatTableRows}
|
|
102
|
+
</Grid>
|
|
103
|
+
</>
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const formatMobileRows = (
|
|
107
|
+
<Box>
|
|
108
|
+
<Grid container justifyContent="space-between">
|
|
109
|
+
<Button
|
|
110
|
+
color="inherit"
|
|
111
|
+
disabled={activeStep === 0}
|
|
112
|
+
onClick={handleBack}
|
|
113
|
+
sx={{ mr: 1, alignSelf: 'flex-start' }}
|
|
114
|
+
>
|
|
115
|
+
<ArrowBackIosOutlinedIcon />
|
|
116
|
+
</Button>
|
|
117
|
+
<StyledHeader xs={totalColumns}>
|
|
118
|
+
<Typography category="secondary" size="small-medium-cap">{headerRows[activeStep].name}</Typography>
|
|
119
|
+
</StyledHeader>
|
|
120
|
+
<Button onClick={handleNext} disabled={activeStep === tableRows.length - 1}>
|
|
121
|
+
<ArrowForwardIosOutlinedIcon />
|
|
122
|
+
</Button>
|
|
123
|
+
</Grid>
|
|
124
|
+
<TableMobileSection container>
|
|
125
|
+
<GridSections sx={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
|
|
126
|
+
{tableRows[activeStep]}
|
|
127
|
+
</GridSections>
|
|
128
|
+
</TableMobileSection>
|
|
129
|
+
</Box>
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<Box {...props} sx={{ flexGrow: 1 }} aria-label="draw table">
|
|
134
|
+
{isMobile ? formatMobileRows : formatDesktopRows}
|
|
135
|
+
</Box>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
@@ -107,3 +107,24 @@ export const SAMPLE_CARD_DATA = {
|
|
|
107
107
|
points: 4,
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
+
|
|
111
|
+
export const SAMPLE_TEAM_PAGE_CARD_DATA = {
|
|
112
|
+
dateLabel: 'Dec 20',
|
|
113
|
+
timeLabel: '9:00pm',
|
|
114
|
+
locationLabel: 'Taube Tennis Center',
|
|
115
|
+
matchInfo: 'Round 1, Match 2',
|
|
116
|
+
isPosition1Winner: true,
|
|
117
|
+
isPosition2Winner: false,
|
|
118
|
+
position1Team: {
|
|
119
|
+
name: 'Apples',
|
|
120
|
+
points: 10,
|
|
121
|
+
href: 'https://www.reddit.com',
|
|
122
|
+
record: 2
|
|
123
|
+
},
|
|
124
|
+
position2Team: {
|
|
125
|
+
name: 'Pears',
|
|
126
|
+
points: 4,
|
|
127
|
+
href: 'https://www.reddit.com',
|
|
128
|
+
record: 2
|
|
129
|
+
}
|
|
130
|
+
};
|