@dcrackel/meyersquaredui 1.0.261 → 1.0.266

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/meyersquaredui",
3
3
  "private": false,
4
- "version": "1.0.261",
4
+ "version": "1.0.266",
5
5
  "type": "module",
6
6
  "main": "dist/meyersquaredui.cjs.js",
7
7
  "module": "dist/meyersquaredui.esm.js",
@@ -42,15 +42,15 @@
42
42
  "vue3-google-map": "^0.21.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@chromatic-com/storybook": "^5.0.0",
46
- "@storybook/addon-docs": "^10.1.11",
47
- "@storybook/addon-links": "^10.1.11",
48
- "@storybook/addon-onboarding": "^10.1.11",
49
- "@storybook/vue3-vite": "^10.1.11",
45
+ "@chromatic-com/storybook": "^5.0.1",
46
+ "@storybook/addon-docs": "^10.2.8",
47
+ "@storybook/addon-links": "^10.2.8",
48
+ "@storybook/addon-onboarding": "^10.2.8",
49
+ "@storybook/vue3-vite": "^10.2.8",
50
50
  "@vitejs/plugin-vue": "^5.1.2",
51
51
  "autoprefixer": "^10.4.20",
52
52
  "postcss": "^8.4.45",
53
- "storybook": "^10.1.11",
53
+ "storybook": "^10.2.8",
54
54
  "tailwindcss": "^3.4.11",
55
55
  "vite": "^6.3.5"
56
56
  },
package/src/index.js CHANGED
@@ -55,6 +55,6 @@ export { default as DoubleButtonBanner } from './stories/Organisms/SectionBanner
55
55
  export { default as Footer } from './stories/Organisms/Footer/Footer.vue'
56
56
  export { default as LivePoolsContainer } from './stories/Organisms/ScoreBoardParts/Containers/LivePoolsContainer/LivePoolsContainer.vue'
57
57
  export { default as FinalResultsContainer } from './stories/Organisms/ScoreBoardParts/Containers/FinalResultsContainer/FinalResultsContainer.vue'
58
-
58
+ export { default as ScoreBug} from './stories/Organisms/ScoreBoardParts/Containers/ScoreBug/ScoreBug.vue'
59
59
 
60
60
  export { default as HomePage } from './stories/Templates/HomePage/HomePage.vue'
@@ -0,0 +1,86 @@
1
+ import ScoreBug from './ScoreBug.vue';
2
+
3
+ const mockBout = {
4
+ Person1: { DisplayName: 'Alice McSword', Club: { Name: 'Iron Oak HEMA' } },
5
+ Person2: { DisplayName: 'Bryn “The Wall” Kincaid', Club: { Name: 'River City Blades' } },
6
+
7
+ Score1: 3,
8
+ Score2: 2,
9
+
10
+ // counting behavior
11
+ IsCountingUp: true,
12
+ MaxPoints: 10,
13
+
14
+ // timer behavior
15
+ TimeLeft: 125, // seconds
16
+ TimerStatus: 'stopped', // 'running' | 'stopped'
17
+ };
18
+
19
+ const mockHostingClubColors = {
20
+ Color1: 'red',
21
+ Color2: 'blue',
22
+ };
23
+
24
+ export default {
25
+ title: 'Organisms/Streaming/ScoreBug',
26
+ component: ScoreBug,
27
+ tags: ['autodocs'],
28
+ parameters: {
29
+ backgrounds: { default: 'light' },
30
+ },
31
+ argTypes: {
32
+ bout: { control: 'object' },
33
+ hostingClubColors: { control: 'object' },
34
+ },
35
+ };
36
+
37
+ export const Default = {
38
+ args: {
39
+ bout: mockBout,
40
+ hostingClubColors: mockHostingClubColors,
41
+ },
42
+ };
43
+
44
+ export const TimerRunning = {
45
+ args: {
46
+ bout: { ...mockBout, TimerStatus: 'running' },
47
+ hostingClubColors: mockHostingClubColors,
48
+ },
49
+ };
50
+
51
+ export const LongNames = {
52
+ args: {
53
+ bout: {
54
+ ...mockBout,
55
+ Person1: {
56
+ DisplayName: 'Sir Alexandrius Maximillian von Oberhau the Third',
57
+ Club: { Name: 'The Extremely Long Club Name Historical Fencing Society' },
58
+ },
59
+ Person2: {
60
+ DisplayName: 'Nephthys “The Meteor” Kurozawa-Santangelo',
61
+ Club: { Name: 'International League of Very Serious Sword People' },
62
+ },
63
+ },
64
+ hostingClubColors: mockHostingClubColors,
65
+ },
66
+ };
67
+
68
+ export const CountingDown = {
69
+ args: {
70
+ bout: {
71
+ ...mockBout,
72
+ IsCountingUp: false,
73
+ MaxPoints: 10,
74
+ Score1: 7, // displayed becomes 3
75
+ Score2: 9, // displayed becomes 1
76
+ },
77
+ hostingClubColors: mockHostingClubColors,
78
+ },
79
+ };
80
+
81
+ export const SilverVsBlue = {
82
+ args: {
83
+ bout: mockBout,
84
+ hostingClubColors: { Color1: 'silver', Color2: 'blue' },
85
+ },
86
+ };
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <section class="w-full">
3
+ <!-- Transparent outer wrapper -->
4
+ <div
5
+ class="flex items-center w-full rounded-2xl overflow-hidden border border-dropdownSelect h-[56px] bg-transparent">
6
+ <!-- LEFT: name + club -->
7
+ <div :class="[leftBg]" class="h-full flex items-center gap-3 px-4 flex-1 min-w-0">
8
+ <BaseText :color="leftText" size="xl" weight="bold" class="truncate leading-none">
9
+ {{ bout.Person1.DisplayName }}
10
+ </BaseText>
11
+
12
+ <span class="inline-block w-2 flex-none"></span>
13
+
14
+ <BaseText :color="leftText" size="lg" class="truncate opacity-90 leading-none">
15
+ {{ bout.Person1?.Club?.Name || '' }}
16
+ </BaseText>
17
+ </div>
18
+
19
+ <!-- SCORE 1 -->
20
+ <div
21
+ class="h-full bg-lineGrey px-4 border-l border-r border-dropdownSelect flex items-center justify-center w-[72px] flex-none">
22
+ <BaseText size="3xl" color="secondary" weight="bold" font="mono" class="leading-none">
23
+ {{ score1 }}
24
+ </BaseText>
25
+ </div>
26
+
27
+ <!-- TIMER -->
28
+ <div
29
+ class="h-full px-4 bg-black border-r border-dropdownSelect flex items-center justify-center w-[120px] flex-none">
30
+ <BaseText size="2xl" color="secondary" weight="bold" font="mono" class="leading-none">
31
+ {{ formattedTime }}
32
+ </BaseText>
33
+ </div>
34
+
35
+ <!-- SCORE 2 -->
36
+ <div
37
+ class="h-full px-4 bg-lineGrey border-r border-dropdownSelect flex items-center justify-center w-[72px] flex-none">
38
+ <BaseText size="3xl" color="secondary" weight="bold" font="mono" class="leading-none">
39
+ {{ score2 }}
40
+ </BaseText>
41
+ </div>
42
+
43
+ <!-- RIGHT: club + name -->
44
+ <div :class="[rightBg]" class="h-full flex items-center justify-end gap-3 px-4 flex-1 min-w-0">
45
+ <BaseText :color="rightText" size="lg" class="truncate opacity-90 leading-none">
46
+ {{ bout.Person2?.Club?.Name || '' }}
47
+ </BaseText>
48
+
49
+ <span class="inline-block w-2 flex-none"></span>
50
+
51
+ <BaseText :color="rightText" size="xl" weight="bold" class="truncate text-right leading-none">
52
+ {{ bout.Person2.DisplayName }}
53
+ </BaseText>
54
+ </div>
55
+ </div>
56
+ </section>
57
+ </template>
58
+
59
+
60
+ <script>
61
+ import BaseText from "../../../../Atoms/BaseText/BaseText.vue";
62
+
63
+ export default {
64
+ name: "ScoreBug",
65
+ components: {BaseText},
66
+ props: {
67
+ bout: {type: Object, required: true},
68
+ hostingClubColors: {type: Object, required: true},
69
+ },
70
+ data() {
71
+ return {
72
+ time: 0,
73
+ timerInterval: null,
74
+ };
75
+ },
76
+ computed: {
77
+ color1() {
78
+ return (this.hostingClubColors?.Color1 || "red").toLowerCase();
79
+ },
80
+ color2() {
81
+ return (this.hostingClubColors?.Color2 || "blue").toLowerCase();
82
+ },
83
+ leftBg() {
84
+ return "bg-" + this.color1;
85
+ },
86
+ rightBg() {
87
+ return "bg-" + this.color2;
88
+ },
89
+ leftText() {
90
+ return this.color1 === "silver" ? "primary" : "white";
91
+ },
92
+ rightText() {
93
+ return this.color2 === "silver" ? "primary" : "white";
94
+ },
95
+ score1() {
96
+ if (!this.bout.IsCountingUp) return this.bout.MaxPoints - this.bout.Score1;
97
+ return this.bout.Score1;
98
+ },
99
+ score2() {
100
+ if (!this.bout.IsCountingUp) return this.bout.MaxPoints - this.bout.Score2;
101
+ return this.bout.Score2;
102
+ },
103
+ formattedTime() {
104
+ const minutes = Math.floor(this.time / 60);
105
+ const seconds = this.time % 60;
106
+ return `${minutes}:${seconds < 10 ? "0" : ""}${seconds}`;
107
+ },
108
+ timerStatus() {
109
+ return this.bout.TimerStatus || "stopped";
110
+ },
111
+ initialTime() {
112
+ return parseInt(this.bout.TimeLeft ?? 120);
113
+ },
114
+ },
115
+ watch: {
116
+ timerStatus(newStatus) {
117
+ if (newStatus === "running") this.startTimer();
118
+ else this.stopTimer();
119
+ },
120
+ initialTime(newTime) {
121
+ this.time = parseInt(newTime);
122
+ },
123
+ },
124
+ methods: {
125
+ startTimer() {
126
+ this.stopTimer();
127
+ this.timerInterval = setInterval(() => {
128
+ if (this.time > 0) this.time--;
129
+ else this.stopTimer();
130
+ }, 1000);
131
+ },
132
+ stopTimer() {
133
+ clearInterval(this.timerInterval);
134
+ this.timerInterval = null;
135
+ },
136
+ },
137
+ mounted() {
138
+ this.time = this.initialTime;
139
+ if (this.timerStatus === "running") this.startTimer();
140
+ },
141
+ beforeDestroy() {
142
+ this.stopTimer();
143
+ },
144
+ };
145
+ </script>
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  <div :class="getBackgroundColor(hostingClubColors.Color2)">
25
25
  <BaseText
26
- size="4xl"
26
+ size="6xl"
27
27
  weight="bold"
28
28
  :color="getTextColor(hostingClubColors.Color2)"
29
29
  class="p-2 pr-4"
@@ -6,7 +6,7 @@ export const TableauLayoutTuning = {
6
6
  padByDepthPx: [0, 32, 96, 224, 480, 992, 2016],
7
7
  gapByDepthPx: [20, 84, 212, 468, 980, 2004, 0],
8
8
 
9
- padByDepthPxCompact: [0, 26, 76, 176, 376, 777, 0],
9
+ padByDepthPxCompact: [0, 26, 76, 176, 376, 365, 0],
10
10
  gapByDepthPxCompact: [10, 60, 160, 360, 760, 1000, 0],
11
11
 
12
12
  finalPadBiasPx: 0,