@universal-tennis/ui-shared 0.1.12 → 0.1.13

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.
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const FullPage: any;
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import InputLabel from '@mui/material/InputLabel';
3
+ import FormControl from '@mui/material/FormControl';
4
+ import Checkbox from '@mui/material/Checkbox';
5
+ import Select from '@mui/material/Select';
6
+ import MenuItem from '@mui/material/MenuItem';
7
+ import Typography from 'stories/atoms/Typography/Typography';
8
+ import Button from 'stories/atoms/Button/Button';
9
+ import Box from '@mui/material/Box';
10
+ import Grid from '@mui/material/Grid';
11
+ import Paper from '@mui/material/Paper';
12
+ import Pagination from '@mui/material/Pagination';
13
+ import FullPageModal from '../../organisms/Modals/FullPageModal';
14
+ import SortableTable from '../../organisms/Tables/SortableTable';
15
+ import { MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA } from '../../organisms/Tables/mockData';
16
+ // Fake data for rendering sections
17
+ const conferences = [{ id: 1, name: 'philly' }, { id: 2, name: 'NJ' }, { id: 3, name: 'PA' }];
18
+ const sessions = [{ sessionId: 1, sessionName: 'philly' }, { sessionId: 2, sessionName: 'NJ' }, { sessionId: 3, sessionName: 'PA' }];
19
+ const selectedSessionIds = [1];
20
+ const teamsToAdd = [{ id: 1, name: 'test', sessionName: 'test' }];
21
+ const selectedTeamIds = [1];
22
+ const InputSelections = [
23
+ React.createElement(FormControl, { sx: { width: 300, mr: 3 } },
24
+ React.createElement(InputLabel, { id: "conference-select" }, "Select Conference"),
25
+ React.createElement(Select, { value: 1 || '', label: "Select Conference", labelId: "conference-select" }, conferences === null || conferences === void 0 ? void 0 : conferences.map((option) => (React.createElement(MenuItem, { key: option.id, value: option.id }, option.name))))),
26
+ React.createElement(FormControl, { sx: { width: 300 } },
27
+ React.createElement(InputLabel, { id: "session-select" }, "test"),
28
+ React.createElement(Select, { value: selectedSessionIds, label: "sample", multiple: true, labelId: "session-select" }, sessions === null || sessions === void 0 ? void 0 :
29
+ sessions.map((option) => (React.createElement(MenuItem, { key: option.sessionId, value: option.sessionId },
30
+ React.createElement(Checkbox, { checked: (selectedSessionIds === null || selectedSessionIds === void 0 ? void 0 : selectedSessionIds.indexOf(option.sessionId)) > -1 }),
31
+ React.createElement(Typography, null, option.sessionName)))),
32
+ React.createElement(Box, { mt: 1, boxShadow: "0px -3px 3px #00000024", display: "flex", justifyContent: "center", pt: 1, px: 1 },
33
+ React.createElement(Button, { category: "primary-extended" }, "Apply"))))
34
+ ];
35
+ const MainComponent = (React.createElement(Grid, { container: true },
36
+ React.createElement(Grid, { item: true, borderRight: 1, lg: 10 },
37
+ React.createElement(Box, { p: 6 },
38
+ React.createElement(Box, { display: "flex", alignItems: "center" }, InputSelections && InputSelections.map((select) => (select)))),
39
+ React.createElement(Box, { p: 6 },
40
+ React.createElement(SortableTable, { headCells: MOCK_HEAD_CELLS, sortOrder: "asc", sortByProperty: "player", title: "Player Table", tableData: MOCK_TABLE_DATA,
41
+ // @ts-ignore
42
+ rowComponent: mockRowComponent }),
43
+ React.createElement(Pagination, { variant: "text", color: "primary", page: 1, count: 10 }))),
44
+ React.createElement(Grid, { item: true, lg: 2 },
45
+ React.createElement(Box, { p: 6 },
46
+ React.createElement(Typography, { variant: "h5" }, `${teamsToAdd.length} selected teams`),
47
+ React.createElement(Typography, null, `This session allows a max of ${1} teams`),
48
+ teamsToAdd.map((team) => (React.createElement(Paper, { key: team.id, sx: { my: 1 } },
49
+ React.createElement(Box, { p: 2, display: "flex" },
50
+ React.createElement(Checkbox, { color: "primary", checked: selectedTeamIds.indexOf(team.id) !== -1 }),
51
+ React.createElement(Box, { ml: 1 },
52
+ React.createElement(Typography, null, team.name),
53
+ React.createElement(Typography, null, team.sessionName))))))))));
54
+ // Default
55
+ export default {
56
+ title: 'Organisms/Modals',
57
+ };
58
+ // Templates
59
+ function FullPageModalTemplate(args) {
60
+ return (React.createElement(FullPageModal, Object.assign({}, args), MainComponent));
61
+ }
62
+ // Stories
63
+ export const FullPage = FullPageModalTemplate.bind({});
64
+ FullPage.args = {
65
+ isOpen: true,
66
+ onClose: () => { },
67
+ pageTitle: 'Sample Page',
68
+ bottomCTAText: 'Add here!',
69
+ handleBottomCTAClick: () => { },
70
+ isBottomCTAdisabled: false,
71
+ // PagePopupModal,
72
+ };
73
+ //# sourceMappingURL=Modals.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modals.stories.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/Modals.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,UAAU,MAAM,qCAAqC,CAAC;AAC7D,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,aAAa,MAAM,sCAAsC,CAAC;AACjE,OAAO,EACL,eAAe,EAAE,gBAAgB,EAAE,eAAe,EACnD,MAAM,iCAAiC,CAAC;AAIzC,mCAAmC;AACnC,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,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AAI,GAAG;IACd,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,SAAS,EAAE,aAAa;IACxB,aAAa,EAAE,WAAW;IAC1B,oBAAoB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC9B,mBAAmB,EAAE,KAAK;IAC1B,kBAAkB;CACnB,CAAC"}
@@ -10,9 +10,9 @@ import Box from '@mui/material/Box';
10
10
  import Grid from '@mui/material/Grid';
11
11
  import Paper from '@mui/material/Paper';
12
12
  import Pagination from '@mui/material/Pagination';
13
- import FullPageModal from './FullPageModal';
14
- import SortableTable from '../Tables/SortableTable';
15
- import { MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA } from '../Tables/mockData';
13
+ import FullPageModal from "./FullPageModal";
14
+ import SortableTable from "../Tables/SortableTable";
15
+ import { MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA } from "../Tables/mockData";
16
16
  // Fake data for rendering sections
17
17
  const conferences = [{ id: 1, name: 'philly' }, { id: 2, name: 'NJ' }, { id: 3, name: 'PA' }];
18
18
  const sessions = [{ sessionId: 1, sessionName: 'philly' }, { sessionId: 2, sessionName: 'NJ' }, { sessionId: 3, sessionName: 'PA' }];
@@ -28,6 +28,8 @@ export default function DrawCardTable(_a) {
28
28
  var { headerRows, tableRows } = _a, props = __rest(_a, ["headerRows", "tableRows"]);
29
29
  const totalColumns = Math.floor(12 / headerRows.length);
30
30
  const formatTableRows = tableRows.map((row, index) => {
31
+ if (index > 2)
32
+ return; // Table can only support 3 columns
31
33
  const rowSectionsWidth = `${100 / tableRows[index].length}%`;
32
34
  const sectionAmount = tableRows[index].length;
33
35
  return (React.createElement(Grid, { key: index, xs: totalColumns }, [...Array(sectionAmount)].map((section, idx) => (React.createElement(GridSections, { key: idx, sx: { height: rowSectionsWidth } }, row[idx])))));
@@ -1 +1 @@
1
- {"version":3,"file":"DrawCardTable.js","sourceRoot":"","sources":["../../../../src/stories/organisms/Tables/Dr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BAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,kBAAkB,IAAE,GAAG,CAAC,IAAI,CAAc,CACrE,CAClB,CAAC,CACC;QACP,oBAAC,IAAI,IAAC,SAAS,UACV,eAAe,CACb,CACL,CACT,CAAC;AACJ,CAAC"}
@@ -37,6 +37,9 @@ const tableRows = [
37
37
  React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
38
38
  React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
39
39
  ],
40
+ [
41
+ React.createElement(DrawCard, Object.assign({ emptyLabel: "Select a team" }, SAMPLE_CARD_DATA)),
42
+ ],
40
43
  ];
41
44
  // Stories
42
45
  export const DrawTable = DrawCardTableTemplate.bind({});
@@ -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;AAE5C,OAAO,EACL,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EACrE,MAAM,YAAY,CAAC;AAEpB,MAAM,qBAAqB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEvC,UAAU;AACV,eAAe;IACb,KAAK,EAAE,kBAAkB;CAC1B,CAAC;AAEF,YAAY;AACZ,SAAS,qBAAqB,CAAC,IAAwB;IACrD,OAAO,oBAAC,aAAa,oBAAK,IAAI,EAAI,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,IAAI,EAAE,SAAS,EAAE;IACnB,EAAE,IAAI,EAAE,cAAc,EAAE;IACxB,EAAE,IAAI,EAAE,WAAW,EAAE;CACtB,CAAC;AAEF,MAAM,SAAS,GAAG;IAChB;QACI,oBAAC,QAA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0.1.13",
4
4
  "main": "dist/items.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://universaltennis.com",
@@ -0,0 +1,137 @@
1
+ import React from 'react';
2
+ import InputLabel from '@mui/material/InputLabel';
3
+ import FormControl from '@mui/material/FormControl';
4
+ import Checkbox from '@mui/material/Checkbox';
5
+ import Select from '@mui/material/Select';
6
+ import MenuItem from '@mui/material/MenuItem';
7
+ import Typography from 'stories/atoms/Typography/Typography';
8
+ import Button from 'stories/atoms/Button/Button';
9
+ import Box from '@mui/material/Box';
10
+ import Grid from '@mui/material/Grid';
11
+ import Paper from '@mui/material/Paper';
12
+ import Pagination from '@mui/material/Pagination';
13
+ import FullPageModal from '../../organisms/Modals/FullPageModal';
14
+ import SortableTable from '../../organisms/Tables/SortableTable';
15
+ import {
16
+ MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA
17
+ } from '../../organisms/Tables/mockData';
18
+
19
+ import { FullPageModalType } from '../../organisms/Modals/sharedTypes';
20
+
21
+ // Fake data for rendering sections
22
+ const conferences = [{ id: 1, name: 'philly' }, { id: 2, name: 'NJ' }, { id: 3, name: 'PA' }];
23
+ const sessions = [{ sessionId: 1, sessionName: 'philly' }, { sessionId: 2, sessionName: 'NJ' }, { sessionId: 3, sessionName: 'PA' }];
24
+ const selectedSessionIds = [1];
25
+ const teamsToAdd = [{ id: 1, name: 'test', sessionName: 'test' }];
26
+ const selectedTeamIds = [1];
27
+
28
+ const InputSelections = [
29
+ <FormControl sx={{ width: 300, mr: 3 }}>
30
+ <InputLabel id="conference-select">Select Conference</InputLabel>
31
+ <Select
32
+ value={1 || ''}
33
+ label="Select Conference"
34
+ labelId="conference-select"
35
+ >
36
+ {conferences?.map((option) => (
37
+ <MenuItem key={option.id} value={option.id}>
38
+ {option.name}
39
+ </MenuItem>
40
+ ))}
41
+ </Select>
42
+ </FormControl>,
43
+ <FormControl sx={{ width: 300 }}>
44
+ <InputLabel id="session-select">test</InputLabel>
45
+ <Select
46
+ value={selectedSessionIds}
47
+ label="sample"
48
+ multiple
49
+ labelId="session-select"
50
+ >
51
+ {sessions?.map((option) => (
52
+ <MenuItem key={option.sessionId} value={option.sessionId}>
53
+ <Checkbox checked={selectedSessionIds?.indexOf(option.sessionId) > -1} />
54
+ <Typography>{option.sessionName}</Typography>
55
+ </MenuItem>
56
+ ))}
57
+ <Box mt={1} boxShadow="0px -3px 3px #00000024" display="flex" justifyContent="center" pt={1} px={1}>
58
+ <Button category="primary-extended">
59
+ Apply
60
+ </Button>
61
+ </Box>
62
+ </Select>
63
+ </FormControl>
64
+ ];
65
+
66
+ const MainComponent = (
67
+ <Grid container>
68
+ <Grid item borderRight={1} lg={10}>
69
+ <Box p={6}>
70
+ <Box display="flex" alignItems="center">
71
+ {InputSelections && InputSelections.map((select) => (
72
+ select
73
+ ))}
74
+ </Box>
75
+ </Box>
76
+ <Box p={6}>
77
+ <SortableTable
78
+ headCells={MOCK_HEAD_CELLS}
79
+ sortOrder="asc"
80
+ sortByProperty="player"
81
+ title="Player Table"
82
+ tableData={MOCK_TABLE_DATA}
83
+ // @ts-ignore
84
+ rowComponent={mockRowComponent}
85
+ />
86
+ <Pagination variant="text" color="primary" page={1} count={10} />
87
+ </Box>
88
+ </Grid>
89
+
90
+ <Grid item lg={2}>
91
+ <Box p={6}>
92
+ <Typography variant="h5">{`${teamsToAdd.length} selected teams`}</Typography>
93
+ <Typography>{`This session allows a max of ${1} teams`}</Typography>
94
+ {teamsToAdd.map((team) => (
95
+ <Paper key={team.id} sx={{ my: 1 }}>
96
+ <Box p={2} display="flex">
97
+ <Checkbox
98
+ color="primary"
99
+ checked={selectedTeamIds.indexOf(team.id) !== -1}
100
+ />
101
+ <Box ml={1}>
102
+ <Typography>{team.name}</Typography>
103
+ <Typography>{team.sessionName}</Typography>
104
+ </Box>
105
+ </Box>
106
+ </Paper>
107
+ ))}
108
+ </Box>
109
+ </Grid>
110
+ </Grid>
111
+ );
112
+
113
+ // Default
114
+ export default {
115
+ title: 'Organisms/Modals',
116
+ };
117
+
118
+ // Templates
119
+ function FullPageModalTemplate(args: FullPageModalType) {
120
+ return (
121
+ <FullPageModal {...args}>
122
+ {MainComponent}
123
+ </FullPageModal>
124
+ );
125
+ }
126
+
127
+ // Stories
128
+ export const FullPage = FullPageModalTemplate.bind({});
129
+ FullPage.args = {
130
+ isOpen: true,
131
+ onClose: () => {},
132
+ pageTitle: 'Sample Page',
133
+ bottomCTAText: 'Add here!',
134
+ handleBottomCTAClick: () => {},
135
+ isBottomCTAdisabled: false,
136
+ // PagePopupModal,
137
+ };
@@ -10,13 +10,13 @@ import Box from '@mui/material/Box';
10
10
  import Grid from '@mui/material/Grid';
11
11
  import Paper from '@mui/material/Paper';
12
12
  import Pagination from '@mui/material/Pagination';
13
- import FullPageModal from './FullPageModal';
14
- import SortableTable from '../Tables/SortableTable';
13
+ import FullPageModal from "./FullPageModal";
14
+ import SortableTable from "../Tables/SortableTable";
15
15
  import {
16
16
  MOCK_HEAD_CELLS, mockRowComponent, MOCK_TABLE_DATA
17
- } from '../Tables/mockData';
17
+ } from "../Tables/mockData";
18
18
 
19
- import { FullPageModalType } from './sharedTypes';
19
+ import { FullPageModalType } from "./sharedTypes";
20
20
 
21
21
  // Fake data for rendering sections
22
22
  const conferences = [{ id: 1, name: 'philly' }, { id: 2, name: 'NJ' }, { id: 3, name: 'PA' }];
@@ -25,6 +25,7 @@ export default function DrawCardTable({
25
25
  const totalColumns = Math.floor(12 / headerRows.length);
26
26
 
27
27
  const formatTableRows = tableRows.map((row, index) => {
28
+ if (index > 2) return; // Table can only support 3 columns
28
29
  const rowSectionsWidth = `${100 / tableRows[index].length}%`;
29
30
  const sectionAmount = tableRows[index].length;
30
31
 
@@ -45,6 +45,9 @@ const tableRows = [
45
45
  <DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
46
46
  <DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
47
47
  ],
48
+ [
49
+ <DrawCard emptyLabel="Select a team" {...SAMPLE_CARD_DATA} />,
50
+ ],
48
51
  ];
49
52
 
50
53
  // Stories