@dcrackel/meyersquaredui 1.0.98 → 1.0.100
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/meyersquaredui.es.js +694 -596
- package/dist/meyersquaredui.umd.js +4 -4
- package/package.json +1 -1
- package/src/index.js +1 -0
- package/src/stories/Molecules/ProgressTracker/ProgressTracker.stories.js +26 -0
- package/src/stories/Molecules/ProgressTracker/ProgressTracker.vue +103 -0
- package/src/stories/Organisms/Cards/FencerListCard/FencerListCard.vue +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { default as InputField } from './stories/Atoms/InputField/InputField.vue
|
|
|
6
6
|
export { default as SearchBox } from './stories/Molecules/Searchbox/SearchBox.vue';
|
|
7
7
|
export { default as Calendar } from './stories/Molecules/Calendar/Calendar.vue';
|
|
8
8
|
export { default as Mapbox } from './stories/Molecules/Mapbox/Mapbox.vue';
|
|
9
|
+
export { default as ProgressTracker } from './stories/Molecules/ProgressTracker/ProgressTracker.vue';
|
|
9
10
|
|
|
10
11
|
export { default as PageHeader } from './stories/Organisms/Headers/PageHeader/PageHeader.vue'
|
|
11
12
|
export { default as HostColumn } from './stories/Organisms/Column/HostColumn.vue'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import ProgressTracker from './ProgressTracker.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/ProgressTracker/ProgressTracker',
|
|
5
|
+
component: ProgressTracker,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => ({
|
|
9
|
+
components: { ProgressTracker },
|
|
10
|
+
setup() {
|
|
11
|
+
return { args };
|
|
12
|
+
},
|
|
13
|
+
template: '<ProgressTracker v-bind="args" />',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const ActiveEvent = Template.bind({});
|
|
17
|
+
ActiveEvent.args = {
|
|
18
|
+
currentPhase: 2, // Example: "Bracket" phase
|
|
19
|
+
isEventComplete: false,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const CompletedEvent = Template.bind({});
|
|
23
|
+
CompletedEvent.args = {
|
|
24
|
+
currentPhase: 3, // All phases are complete
|
|
25
|
+
isEventComplete: true,
|
|
26
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex items-center justify-between">
|
|
3
|
+
<div
|
|
4
|
+
v-for="(phase, index) in phases"
|
|
5
|
+
:key="index"
|
|
6
|
+
class="flex items-center flex-grow"
|
|
7
|
+
@mouseover="handleMouseOver(index)"
|
|
8
|
+
@mouseout="handleMouseOut"
|
|
9
|
+
@click="handlePhaseClick(index)"
|
|
10
|
+
>
|
|
11
|
+
<!-- Clickable Icon and Label -->
|
|
12
|
+
<div class="flex flex-col items-center hover:cursor-pointer">
|
|
13
|
+
<div
|
|
14
|
+
class="w-8 h-8 flex items-center justify-center rounded-full transition-all duration-300 border-2 border-accent"
|
|
15
|
+
:class="{
|
|
16
|
+
'border-accent': isPhaseActive(index),
|
|
17
|
+
'border-gray-300': !isPhaseActive(index),
|
|
18
|
+
'hover:bg-accent': hoveredPhase === index,
|
|
19
|
+
'hover:bg-gray-200': hoveredPhase === index && !isPhaseActive(index),
|
|
20
|
+
}"
|
|
21
|
+
>
|
|
22
|
+
<i :class="phase.icon"></i>
|
|
23
|
+
</div>
|
|
24
|
+
<BaseText
|
|
25
|
+
tag="p"
|
|
26
|
+
size="sm"
|
|
27
|
+
weight="normal"
|
|
28
|
+
class="mt-2 transition-all duration-300"
|
|
29
|
+
:class="{
|
|
30
|
+
'font-bold text-accent': isPhaseActive(index),
|
|
31
|
+
'text-gray-600': !isPhaseActive(index),
|
|
32
|
+
'hover:text-accent': hoveredPhase === index,
|
|
33
|
+
}"
|
|
34
|
+
>
|
|
35
|
+
{{ phase.label }}
|
|
36
|
+
</BaseText>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<!-- Dynamic Line between icons -->
|
|
40
|
+
<div
|
|
41
|
+
v-if="index < phases.length - 1"
|
|
42
|
+
class="flex-grow h-1 mx-2"
|
|
43
|
+
:class="{
|
|
44
|
+
'bg-accent': isPhaseActive(index + 1),
|
|
45
|
+
'bg-gray-300': !isPhaseActive(index + 1),
|
|
46
|
+
}"
|
|
47
|
+
></div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import BaseText from "../../Atoms/BaseText/BaseText.vue";
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
name: 'ProgressTracker',
|
|
57
|
+
components: {
|
|
58
|
+
BaseText
|
|
59
|
+
},
|
|
60
|
+
props: {
|
|
61
|
+
currentPhase: {
|
|
62
|
+
type: Number,
|
|
63
|
+
required: true,
|
|
64
|
+
default: 0,
|
|
65
|
+
},
|
|
66
|
+
isEventComplete: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
data() {
|
|
72
|
+
return {
|
|
73
|
+
hoveredPhase: null, // Variable to store which phase is hovered over
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
computed: {
|
|
77
|
+
phases() {
|
|
78
|
+
return [
|
|
79
|
+
{ label: 'Registration', icon: 'fa-solid fa-file-alt' },
|
|
80
|
+
{ label: 'Pools', icon: 'fa-kit fa-longsword' },
|
|
81
|
+
{ label: 'Pool Results', icon: 'fa-solid fa-clipboard-check' },
|
|
82
|
+
{ label: 'Bracket', icon: 'fa-solid fa-sitemap' },
|
|
83
|
+
{ label: 'Final Result', icon: 'fa-solid fa-trophy' },
|
|
84
|
+
];
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
isPhaseActive(index) {
|
|
89
|
+
return this.isEventComplete || index <= this.currentPhase;
|
|
90
|
+
},
|
|
91
|
+
handleMouseOver(index) {
|
|
92
|
+
this.hoveredPhase = index;
|
|
93
|
+
},
|
|
94
|
+
handleMouseOut() {
|
|
95
|
+
this.hoveredPhase = null;
|
|
96
|
+
},
|
|
97
|
+
handlePhaseClick(index) {
|
|
98
|
+
// Emit the clicked phase to the parent
|
|
99
|
+
this.$emit('phase-clicked', index);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
</script>
|