@dcrackel/meyersquaredui 1.0.191 → 1.0.195

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.
Files changed (22) hide show
  1. package/dist/meyersquaredui.es.js +6 -1
  2. package/dist/meyersquaredui.umd.js +1 -1
  3. package/package.json +13 -13
  4. package/src/assets/fonts/RobotoMono-Regular.ttf +0 -0
  5. package/src/assets/fonts/RobotoMono-SemiBold.ttf +0 -0
  6. package/src/mocks/getPoolsWithBouts.js +394 -787
  7. package/src/mocks/getPoolsWithBoutsByPoolId.js +401 -1168
  8. package/src/stories/Atoms/BaseText/BaseText.vue +5 -0
  9. package/src/stories/Molecules/ScoreBoardSections/FencerName/FencerName.stories.js +40 -0
  10. package/src/stories/Molecules/ScoreBoardSections/FencerName/FencerName.vue +49 -0
  11. package/src/stories/Molecules/ScoreBoardSections/FencerScore/FencerScore.stories.js +40 -0
  12. package/src/stories/Molecules/ScoreBoardSections/FencerScore/FencerScore.vue +28 -0
  13. package/src/stories/Molecules/ScoreBoardSections/ScoreBoardPasses/ScoreBoardPasses.stories.js +45 -0
  14. package/src/stories/Molecules/ScoreBoardSections/ScoreBoardPasses/ScoreBoardPasses.vue +39 -0
  15. package/src/stories/Molecules/ScoreBoardSections/ScoreBoardTimer/ScoreBoardTimer.stories.js +43 -0
  16. package/src/stories/Molecules/ScoreBoardSections/ScoreBoardTimer/ScoreBoardTimer.vue +88 -0
  17. package/src/stories/Organisms/ScoreBoardParts/FencerNameBar/FencerNameBar.stories.js +43 -0
  18. package/src/stories/Organisms/ScoreBoardParts/FencerNameBar/FencerNameBar.vue +37 -0
  19. package/src/stories/Organisms/ScoreBoardParts/FencerPit/FencerPit.stories.js +52 -0
  20. package/src/stories/Organisms/ScoreBoardParts/FencerPit/FencerPit.vue +65 -0
  21. package/src/stories/Organisms/ScoreBoardParts/ScoreBar/ScoreBar.stories.js +58 -0
  22. package/src/stories/Organisms/ScoreBoardParts/ScoreBar/ScoreBar.vue +61 -0
@@ -44,6 +44,11 @@ export default {
44
44
  '3xl': 'text-3xl',
45
45
  '4xl': 'text-4xl',
46
46
  '5xl': 'text-5xl',
47
+ '6xl': 'text-6xl',
48
+ '7xl': 'text-7xl',
49
+ '8xl': 'text-8xl',
50
+ '9xl': 'text-[12rem]',
51
+ '10xl': 'text-[20rem]',
47
52
  };
48
53
 
49
54
  const weightClasses = {
@@ -0,0 +1,40 @@
1
+ import FencerName from './FencerName.vue';
2
+
3
+ export default {
4
+ title: 'Molecules/ScoreBoardSections/FencerName',
5
+ component: FencerName,
6
+ tags: ['autodocs'],
7
+ args: {
8
+ fullName: 'Dave Smith',
9
+ assignedColor: 'blue',
10
+ },
11
+ argTypes: {
12
+ fullName: {
13
+ control: 'text',
14
+ },
15
+ assignedColor: {
16
+ control: 'color',
17
+ },
18
+ },
19
+ };
20
+
21
+ export const Default = {
22
+ args: {
23
+ fullName: 'Dave Smith',
24
+ assignedColor: 'blue',
25
+ },
26
+ };
27
+
28
+ export const RedBackground = {
29
+ args: {
30
+ fullName: 'Melissa Jones',
31
+ assignedColor: 'red',
32
+ },
33
+ };
34
+
35
+ export const GreenBackground = {
36
+ args: {
37
+ fullName: 'Sarah Connor',
38
+ assignedColor: 'green',
39
+ },
40
+ };
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div :class="[getBackground, textAlignment]" class="px-5 py-3 w-1/2">
3
+ <BaseText color="secondary" size="7xl" weight="bold" class="whitespace-nowrap overflow-hidden">{{formattedName}}</BaseText>
4
+ <BaseText size="2xl" weight="" color="secondary" class="">{{club}}</BaseText>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import BaseText from "../../../Atoms/BaseText/BaseText.vue";
10
+
11
+ export default {
12
+ name: 'FencerName',
13
+ components: {BaseText},
14
+ props: {
15
+ fullName: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ club: {
20
+ type: String,
21
+ required: false,
22
+ },
23
+ assignedColor: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ fencer1: {
28
+ type: Boolean,
29
+ default: true,
30
+ }
31
+ },
32
+ computed: {
33
+ formattedName() {
34
+ return this.fullName;
35
+ // const nameParts = this.fullName.split(' ');
36
+ // const lastName = nameParts[1];
37
+ // const firstInitial = nameParts[0].charAt(0) + '.';
38
+ // return `${lastName} ${firstInitial}`;
39
+ },
40
+ getBackground() {
41
+ return 'bg-' + this.assignedColor;
42
+ },
43
+ textAlignment() {
44
+ return this.fencer1 ? 'text-left' : 'text-right';
45
+ }
46
+ },
47
+ };
48
+ </script>
49
+
@@ -0,0 +1,40 @@
1
+ import FencerScore from './FencerScore.vue';
2
+
3
+ export default {
4
+ title: 'Molecules/ScoreBoardSections/FencerScore',
5
+ component: FencerScore,
6
+ tags: ['autodocs'],
7
+ args: {
8
+ score: 5,
9
+ assignedColor: 'blue',
10
+ },
11
+ argTypes: {
12
+ score: {
13
+ control: 'number',
14
+ },
15
+ assignedColor: {
16
+ control: 'color',
17
+ },
18
+ },
19
+ };
20
+
21
+ export const Default = {
22
+ args: {
23
+ score: 5,
24
+ assignedColor: 'blue',
25
+ },
26
+ };
27
+
28
+ export const RedBackground = {
29
+ args: {
30
+ score: 7,
31
+ assignedColor: 'red',
32
+ },
33
+ };
34
+
35
+ export const GreenBackground = {
36
+ args: {
37
+ score: 3,
38
+ assignedColor: 'green',
39
+ },
40
+ };
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div class="w-1/2 flex justify-center" >
3
+ <div class="border border-neutral p-4 w-[22rem] h-[24rem] text-center rounded-xl">
4
+ <BaseText size="10xl" color="secondary" class="font-sourceCodePro -mt-[4rem]">{{ score }}</BaseText>
5
+ </div>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import BaseText from "../../../Atoms/BaseText/BaseText.vue";
11
+
12
+ export default {
13
+ name: 'FencerScore',
14
+ components: { BaseText },
15
+ props: {
16
+ score: {
17
+ type: Number,
18
+ required: true,
19
+ },
20
+ assignedColor: {
21
+ type: String,
22
+ required: false,
23
+ }
24
+ },
25
+ computed: {
26
+ },
27
+ };
28
+ </script>
@@ -0,0 +1,45 @@
1
+ import ScoreBoardPasses from './ScoreBoardPasses.vue';
2
+
3
+ export default {
4
+ title: 'Molecules/ScoreBoardSections/ScoreBoardPasses',
5
+ component: ScoreBoardPasses,
6
+ tags: ['autodocs'],
7
+ args: {
8
+ ringName: 'Ring 1',
9
+ currentPass: 3,
10
+ totalPasses: 5,
11
+ directorName: 'Dave Smith'
12
+ },
13
+ argTypes: {
14
+ ringName: {
15
+ control: 'text',
16
+ },
17
+ currentPass: {
18
+ control: 'number',
19
+ },
20
+ totalPasses: {
21
+ control: 'number',
22
+ },
23
+ directorName: {
24
+ control: 'text',
25
+ },
26
+ },
27
+ };
28
+
29
+ export const Default = {
30
+ args: {
31
+ ringName: 'Ring 1',
32
+ currentPass: 3,
33
+ totalPasses: 5,
34
+ directorName: 'Dave Smith'
35
+ },
36
+ };
37
+
38
+ export const DifferentPasses = {
39
+ args: {
40
+ ringName: 'Ring 2',
41
+ currentPass: 2,
42
+ totalPasses: 7,
43
+ directorName: 'John Doe'
44
+ },
45
+ };
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="border rounded-lg px-10 text-center flex flex-col w-[50rem]">
3
+ <BaseText :text="ringName" size="5xl" weight="bold" color="neutral" class="mt-5" />
4
+ <BaseText :text="formattedPasses" weight="bold" color="neutral" class="-mt-4" size="9xl" />
5
+ <BaseText :text="directorName" size="2xl" weight="" color="neutral" class="-mt-4" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import BaseText from "../../../Atoms/BaseText/BaseText.vue";
11
+
12
+ export default {
13
+ name: 'ScoreBoardPasses',
14
+ components: { BaseText },
15
+ props: {
16
+ ringName: {
17
+ type: String,
18
+ required: true
19
+ },
20
+ currentPass: {
21
+ type: Number,
22
+ required: true
23
+ },
24
+ totalPasses: {
25
+ type: Number,
26
+ required: true
27
+ },
28
+ directorName: {
29
+ type: String,
30
+ required: true
31
+ }
32
+ },
33
+ computed: {
34
+ formattedPasses() {
35
+ return `${this.currentPass+1}:${this.totalPasses}`;
36
+ }
37
+ }
38
+ };
39
+ </script>
@@ -0,0 +1,43 @@
1
+ import ScoreBoardTimer from './ScoreBoardTimer.vue';
2
+
3
+ export default {
4
+ title: 'Molecules/ScoreBoardSections/ScoreBoardTimer',
5
+ component: ScoreBoardTimer,
6
+ tags: ['autodocs'],
7
+ args: {
8
+ initialTime: 120,
9
+ timerStatus: 'stopped',
10
+ },
11
+ argTypes: {
12
+ initialTime: {
13
+ control: 'number',
14
+ },
15
+ timerStatus: {
16
+ control: 'text',
17
+ options: ['running', 'stopped'],
18
+ },
19
+ },
20
+ };
21
+
22
+ export const Default = {
23
+ args: {
24
+ initialTime: 120,
25
+ ringName: "Ring1",
26
+ timerStatus: 'stopped',
27
+ },
28
+ };
29
+
30
+ export const Running = {
31
+ args: {
32
+ initialTime: 60,
33
+ ringName: "Ring1",
34
+ timerStatus: 'running',
35
+ },
36
+ };
37
+
38
+ export const Stopped = {
39
+ args: {
40
+ initialTime: 30,
41
+ timerStatus: 'stopped',
42
+ },
43
+ };
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <div class="border rounded-lg px-10 text-center flex flex-col justify-between w-[50rem]">
3
+ <BaseText size="5xl" weight="bold" color="secondary" class="pt-6 font-sourceCodePro">{{ringName}}</BaseText>
4
+ <BaseText v-if="showClock" weight="simi-bold" color="secondary" class="-mt-4 font-sourceCodePro" size="9xl">{{formattedTime}}</BaseText>
5
+ <BaseText size="2xl" weight="" color="secondary" class="-mt-4 pb-2">{{directorName}}</BaseText>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import BaseText from "../../../Atoms/BaseText/BaseText.vue";
11
+
12
+ export default {
13
+ name: 'ScoreBoard',
14
+ components: { BaseText },
15
+ props: {
16
+ initialTime: {
17
+ type: Number,
18
+ default: 120
19
+ },
20
+ timerStatus: {
21
+ type: String,
22
+ default: 'stopped'
23
+ },
24
+ ringName: {
25
+ type: String,
26
+ required: true,
27
+ default: ''
28
+ },
29
+ directorName: {
30
+ type: String,
31
+ required: true
32
+ },
33
+ showClock: {
34
+ type: Boolean,
35
+ default: true
36
+ }
37
+ },
38
+ data() {
39
+ return {
40
+ time: parseInt(this.initialTime),
41
+ timerInterval: null
42
+ };
43
+ },
44
+ watch: {
45
+ timerStatus(newStatus) {
46
+ if (newStatus === 'running') {
47
+ this.startTimer();
48
+ } else {
49
+ this.stopTimer();
50
+ }
51
+ },
52
+ initialTime(newTime) {
53
+ this.time = parseInt(newTime);
54
+ }
55
+ },
56
+ computed: {
57
+ formattedTime() {
58
+ const minutes = Math.floor(this.time / 60);
59
+ const seconds = this.time % 60;
60
+ return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
61
+ }
62
+ },
63
+ methods: {
64
+ startTimer() {
65
+ this.stopTimer(); // Ensure no duplicate timers
66
+ this.timerInterval = setInterval(() => {
67
+ if (this.time > 0) {
68
+ this.time--;
69
+ } else {
70
+ this.stopTimer();
71
+ }
72
+ }, 1000);
73
+ },
74
+ stopTimer() {
75
+ clearInterval(this.timerInterval);
76
+ this.timerInterval = null;
77
+ }
78
+ },
79
+ mounted() {
80
+ if (this.timerStatus === 'running') {
81
+ this.startTimer();
82
+ }
83
+ },
84
+ beforeDestroy() {
85
+ this.stopTimer();
86
+ }
87
+ };
88
+ </script>
@@ -0,0 +1,43 @@
1
+ import FencerNameBar from './FencerNameBar.vue';
2
+ import getPoolsWithBouts from '../../../../mocks/getPoolsWithBouts.js';
3
+
4
+ export default {
5
+ title: 'Organisms/ScoreBoardParts/FencerNameBar',
6
+ component: FencerNameBar,
7
+ tags: ['autodocs'],
8
+ args: {
9
+ bout: getPoolsWithBouts[0],
10
+ hostingClubColors: {
11
+ Color1: 'red',
12
+ Color2: 'blue'
13
+ },
14
+ },
15
+ argTypes: {
16
+ bout: {
17
+ control: 'object'
18
+ },
19
+ hostingClubColors: {
20
+ control: 'object'
21
+ },
22
+ }
23
+ };
24
+
25
+ export const Default = {
26
+ args: {
27
+ bout: getPoolsWithBouts[1],
28
+ hostingClubColors: {
29
+ Color1: 'red',
30
+ Color2: 'blue'
31
+ }
32
+ }
33
+ };
34
+
35
+ export const BlueAndGreen = {
36
+ args: {
37
+ bout: { "updateBout": { "TimerStatus": "stopped", "BoutId": 1944, "PoolId": 139, "EventId": 6, "Person1Id": 1, "Person2Id": 10, "Status": "Active", "Score1": 2, "Score2": 0, "Started": "2024-07-16T15:50:26.000Z", "Ended": null, "TimeLeft": 90, "CurrentPass": 3, "RoundLabel": null, "DEBoutId": null, "DENextBoutId": null, "RefereeId": null, "createdAt": "2024-07-16T15:49:16.000Z", "updatedAt": "2024-07-16T23:20:19.000Z", "Person1": { "PersonId": 1, "DisplayName": "Dave Smith", "ClubId": 4, "Images": [ { "ImageId": 7, "URL": "https://randomuser.me/api/portraits/men/22.jpg" } ], "Club": { "Name": "Guardians of the Guard", "Color1": "purple", "Color2": "orange" }, "EventPersons": [ { "DEPosition": null } ] }, "Person2": { "PersonId": 10, "DisplayName": "Melissa Jones", "ClubId": 4, "Images": [ { "ImageId": 21, "URL": "https://randomuser.me/api/portraits/women/9.jpg" } ], "Club": { "Name": "Guardians of the Guard" }, "EventPersons": [ { "DEPosition": null } ] } } },
38
+ hostingClubColors: {
39
+ Color1: 'blue',
40
+ Color2: 'green'
41
+ }
42
+ }
43
+ };
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <div class="flex w-full">
3
+ <FencerName
4
+ :fullName="bout.Person1.DisplayName"
5
+ :club="bout.Person1.Club.Name"
6
+ :assignedColor="hostingClubColors.Color1"
7
+ :fencer1="true"
8
+ />
9
+ <FencerName
10
+ :fullName="bout.Person2.DisplayName"
11
+ :club="bout.Person2.Club.Name"
12
+ :assignedColor="hostingClubColors.Color2"
13
+ :fencer1="false"
14
+ />
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import FencerName from '../../../Molecules/ScoreBoardSections/FencerName/FencerName.vue';
20
+
21
+ export default {
22
+ name: 'FencerNameBar',
23
+ components: {
24
+ FencerName
25
+ },
26
+ props: {
27
+ bout: {
28
+ type: Object,
29
+ required: true
30
+ },
31
+ hostingClubColors: {
32
+ type: Object,
33
+ required: true
34
+ }
35
+ }
36
+ };
37
+ </script>
@@ -0,0 +1,52 @@
1
+ import FencerPit from './FencerPit.vue';
2
+ import getPoolsWithBoutsByPoolId from '../../../../mocks/getPoolsWithBoutsByPoolId.js';
3
+
4
+ export default {
5
+ title: 'Organisms/ScoreBoardParts/FencerPit',
6
+ component: FencerPit,
7
+ tags: ['autodocs'],
8
+ args: {
9
+ nextBouts: getPoolsWithBoutsByPoolId,
10
+ hostingClubColors: {
11
+ Color1: 'red',
12
+ Color2: 'blue'
13
+ }
14
+ },
15
+ argTypes: {
16
+ fencer1FullName: {
17
+ control: 'text',
18
+ },
19
+ fencer2FullName: {
20
+ control: 'text',
21
+ },
22
+ hostingClubColors: {
23
+ Color1: 'red',
24
+ Color2: 'blue'
25
+ }
26
+ }
27
+ };
28
+
29
+ export const Default = {
30
+ args: {
31
+ nextBouts: getPoolsWithBoutsByPoolId,
32
+ hostingClubColors: {
33
+ Color1: 'red',
34
+ Color2: 'blue'
35
+ }
36
+ },
37
+ parameters: {
38
+ backgrounds: {
39
+ default: 'dark'
40
+ }
41
+ }
42
+ };
43
+
44
+ // export const GreenAndOrange = {
45
+ // args: {
46
+ // bout: getPoolsWithBoutsByPoolId[0],
47
+ // hostingClubColors: {
48
+ // Color1: 'red',
49
+ // Color2: 'blue'
50
+ // }
51
+ // },
52
+ // };
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <div class="fencer-pit flex flex-col gap-4">
3
+ <div v-for="(bout, index) in limitedBouts" :key="index" class="flex justify-between">
4
+ <div class="flex flex-col w-1/2">
5
+ <div class="pl-2 -mt-4">
6
+ <BaseText size="md" color="secondary">{{pitText(index)}}</BaseText>
7
+ </div>
8
+ <div :class="getBackgroundColor(hostingClubColors.Color1)">
9
+ <BaseText size="4xl" weight="bold" color="secondary" class="p-2">{{bout.Person1?.DisplayName}}</BaseText>
10
+ </div>
11
+ </div>
12
+
13
+ <div class="flex flex-col w-1/2 text-right">
14
+ <div class="pr-2 -mt-4">
15
+ <BaseText size="md" color="secondary">{{pitText(index)}}</BaseText>
16
+ </div>
17
+ <div :class="getBackgroundColor(hostingClubColors.Color2)">
18
+ <BaseText size="4xl" weight="bold" color="secondary" class="p-2">{{bout.Person2?.DisplayName}}</BaseText>
19
+ </div>
20
+ </div>
21
+
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import BaseText from "../../../Atoms/BaseText/BaseText.vue";
28
+
29
+ export default {
30
+ name: 'FencerPit',
31
+ components: {BaseText},
32
+ props: {
33
+ nextBouts: {
34
+ type: Array,
35
+ required: true,
36
+ },
37
+ hostingClubColors: {
38
+ type: Object,
39
+ required: true,
40
+ }
41
+ },
42
+ computed: {
43
+ limitedBouts() {
44
+ return this.nextBouts.slice(0, 3);
45
+ },
46
+ },
47
+ methods: {
48
+ pitText(index) {
49
+ switch(index) {
50
+ case 0:
51
+ return 'On Deck';
52
+ case 1:
53
+ return 'In the Hole';
54
+ case 2:
55
+ return 'Preparing';
56
+ default:
57
+ return '';
58
+ }
59
+ },
60
+ getBackgroundColor(color) {
61
+ return `bg-${color}`;
62
+ },
63
+ },
64
+ };
65
+ </script>
@@ -0,0 +1,58 @@
1
+ import ScoreBar from './ScoreBar.vue';
2
+ import getPoolsWithBoutsByPoolId from "../../../../mocks/getPoolsWithBoutsByPoolId.js";
3
+
4
+ export default {
5
+ title: 'Organisms/ScoreBoardParts/ScoreBar',
6
+ component: ScoreBar,
7
+ tags: ['autodocs'],
8
+ args: {
9
+ bout: getPoolsWithBoutsByPoolId.pools[0].Bouts[0],
10
+ hostingClubColors: {
11
+ Color1: 'red',
12
+ Color2: 'blue'
13
+ },
14
+ },
15
+ argTypes: {
16
+ bout: {
17
+ control: 'object'
18
+ },
19
+ hostingClubColors: {
20
+ control: 'object'
21
+ },
22
+ },
23
+ parameters: {
24
+ backgrounds: {
25
+ default: 'dark'
26
+ }
27
+ }
28
+ };
29
+
30
+ export const Default = {
31
+ args: {
32
+ bout: getPoolsWithBoutsByPoolId.pools[0].Bouts[0],
33
+ hostingClubColors: {
34
+ Color1: 'red',
35
+ Color2: 'blue'
36
+ },
37
+ },
38
+ parameters: {
39
+ backgrounds: {
40
+ default: 'dark'
41
+ }
42
+ }
43
+ };
44
+
45
+ export const SecondCase = {
46
+ args: {
47
+ bout: getPoolsWithBoutsByPoolId.pools[0].Bouts[1],
48
+ hostingClubColors: {
49
+ Color1: 'blue',
50
+ Color2: 'green'
51
+ },
52
+ },
53
+ parameters: {
54
+ backgrounds: {
55
+ default: 'black'
56
+ }
57
+ }
58
+ };