@dcrackel/hematournamentui 1.0.0

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 (43) hide show
  1. package/.storybook/main.js +17 -0
  2. package/.storybook/preview-head.html +1 -0
  3. package/.storybook/preview.js +17 -0
  4. package/HemaTournamentUI/.gitattributes +2 -0
  5. package/HemaTournamentUI/LICENSE +21 -0
  6. package/README.md +83 -0
  7. package/dist/my-library.es.js +723 -0
  8. package/dist/my-library.umd.js +1 -0
  9. package/index.html +12 -0
  10. package/package.json +42 -0
  11. package/postcss.config.js +6 -0
  12. package/src/assets/default-tournament.png +0 -0
  13. package/src/index.js +15 -0
  14. package/src/main.js +2 -0
  15. package/src/mocks/fileMock.js +1 -0
  16. package/src/mocks/tournamentMock.js +34 -0
  17. package/src/stories/Base/Button/BaseButton.stories.js +69 -0
  18. package/src/stories/Base/Button/BaseButton.vue +141 -0
  19. package/src/stories/Base/Input/BaseInput.stories.js +28 -0
  20. package/src/stories/Base/Input/BaseInput.vue +44 -0
  21. package/src/stories/Base/Tag/BaseTag.stories.js +29 -0
  22. package/src/stories/Base/Tag/BaseTag.vue +57 -0
  23. package/src/stories/Base/Text/BaseText.stories.js +77 -0
  24. package/src/stories/Base/Text/BaseText.vue +162 -0
  25. package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.stories.js +33 -0
  26. package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +38 -0
  27. package/src/stories/Cards/TournamentCard/Header/TournamentCardHeader.stories.js +48 -0
  28. package/src/stories/Cards/TournamentCard/Header/TournamentCardHeader.vue +40 -0
  29. package/src/stories/Cards/TournamentCard/TournamentCard.stories.js +37 -0
  30. package/src/stories/Cards/TournamentCard/TournamentCard.vue +35 -0
  31. package/src/stories/Configure.mdx +320 -0
  32. package/src/stories/Containers/Grid/GridContainer.stories.js +27 -0
  33. package/src/stories/Containers/Grid/GridContainer.vue +36 -0
  34. package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +36 -0
  35. package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +39 -0
  36. package/src/stories/Menu/Admin/AdminLeftMenu.stories.js +23 -0
  37. package/src/stories/Menu/Admin/AdminLeftMenu.vue +57 -0
  38. package/src/stories/Menu/DropDown/DropDownMenu.stories.js +34 -0
  39. package/src/stories/Menu/DropDown/DropDownMenu.vue +49 -0
  40. package/tailwind/output.css +1047 -0
  41. package/tailwind/tailwind.css +4 -0
  42. package/tailwind.config.js +25 -0
  43. package/vite.config.js +20 -0
@@ -0,0 +1,162 @@
1
+ <template>
2
+ <div :class="classes">{{ text }}</div>
3
+ </template>
4
+
5
+ <script>
6
+ import { computed, reactive } from 'vue';
7
+
8
+ export default {
9
+ name: 'BaseText',
10
+
11
+ props: {
12
+ text: {
13
+ type: String,
14
+ required: true
15
+ },
16
+ weight: {
17
+ type: String,
18
+ default: 'normal',
19
+ validator: function (value) {
20
+ return ['light', 'normal', 'medium', 'semi-bold', 'bold', 'extra-bold'].indexOf(value) !== -1;
21
+ }
22
+ },
23
+ size: {
24
+ type: String,
25
+ default: 'small',
26
+ validator: function (value) {
27
+ return ['xs', 'small', 'medium', 'large', 'xl', '2xl', '3xl'].indexOf(value) !== -1;
28
+ }
29
+ },
30
+ color: {
31
+ type: String,
32
+ default: 'primary',
33
+ validator: function (value) {
34
+ return ['neutral', 'quaternary', 'tertiary', 'secondary', 'primary', 'bright'].indexOf(value) !== -1;
35
+ }
36
+ },
37
+ hoverColor: {
38
+ type: String,
39
+ default: 'none',
40
+ validator: function (value) {
41
+ return (
42
+ [
43
+ 'primary',
44
+ 'secondary',
45
+ 'tertiary',
46
+ 'quaternary',
47
+ 'neutral',
48
+ 'bright',
49
+ 'none'
50
+ ].indexOf(value) !== -1
51
+ );
52
+ }
53
+ }
54
+ },
55
+ setup(props) {
56
+ props = reactive(props);
57
+ return {
58
+ classes: computed(() => {
59
+ let baseClasses = 'inline-block font-sans';
60
+
61
+ switch (props.color) {
62
+ case 'neutral':
63
+ baseClasses += ' text-neutral';
64
+ break;
65
+ case `tertiary`:
66
+ baseClasses += ' text-tertiary';
67
+ break;
68
+ case 'secondary':
69
+ baseClasses += ' text-secondary';
70
+ break;
71
+ case 'quaternary':
72
+ baseClasses += ' text-quaternary';
73
+ break;
74
+ case 'primary':
75
+ baseClasses += ' text-primary';
76
+ break;
77
+ case 'bright':
78
+ baseClasses += ' text-bright';
79
+ break;
80
+ }
81
+
82
+ switch (props.hoverColor) {
83
+ case 'neutral':
84
+ baseClasses += ' hover:text-neutral';
85
+ break;
86
+ case `tertiary`:
87
+ baseClasses += ' hover:text-tertiary';
88
+ break;
89
+ case 'secondary':
90
+ baseClasses += ' hover:text-secondary';
91
+ break;
92
+ case 'quaternary':
93
+ baseClasses += ' hover:text-quaternary';
94
+ break;
95
+ case 'primary':
96
+ baseClasses += ' hover:text-primary';
97
+ break;
98
+ case 'bright':
99
+ baseClasses += ' hover:text-bright';
100
+ break;
101
+ case 'none':
102
+ baseClasses += '';
103
+ break;
104
+ }
105
+
106
+ switch (props.weight) {
107
+ case 'light':
108
+ baseClasses += ' font-light';
109
+ break;
110
+ case 'normal':
111
+ baseClasses += ' font-normal';
112
+ break;
113
+ case 'medium':
114
+ baseClasses += ' font-medium';
115
+ break;
116
+ case 'semi-bold':
117
+ baseClasses += ' font-semibold';
118
+ break;
119
+ case 'bold':
120
+ baseClasses += ' font-bold';
121
+ break;
122
+ case 'extra-bold':
123
+ baseClasses += ' font-extrabold';
124
+ break;
125
+ default:
126
+ baseClasses += ' font-normal';
127
+ break;
128
+ }
129
+
130
+ switch (props.size) {
131
+ case 'xs':
132
+ baseClasses += ' text-xs';
133
+ break;
134
+ case 'small':
135
+ baseClasses += ' text-sm';
136
+ break;
137
+ case 'medium':
138
+ baseClasses += ' text-md';
139
+ break;
140
+ case 'large':
141
+ baseClasses += ' text-lg';
142
+ break;
143
+ case 'xl':
144
+ baseClasses += ' text-xl';
145
+ break;
146
+ case '2xl':
147
+ baseClasses += ' text-2xl';
148
+ break;
149
+ case '3xl':
150
+ baseClasses += ' text-3xl';
151
+ break;
152
+ default:
153
+ baseClasses += ' text-sm';
154
+ break;
155
+ }
156
+ return baseClasses;
157
+ })
158
+ };
159
+ }
160
+ };
161
+
162
+ </script>
@@ -0,0 +1,33 @@
1
+ import TournamentCardDetail from './TournamentCardDetail.vue';
2
+
3
+ export default {
4
+ title: 'Cards/TournamentCard/TournamentCardDetail',
5
+ component: TournamentCardDetail,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ tournament: {
9
+ control: {
10
+ type: 'object'
11
+ },
12
+ defaultValue: {
13
+ name: 'Tournament Name',
14
+ description: 'Tournament Description',
15
+ date: '07 October, 2023',
16
+ closes: 'Registration closes 06 October, 2023',
17
+ location: 'Tournament Location - City, State'
18
+ }
19
+ }
20
+ }
21
+ };
22
+
23
+ export const Default = {
24
+ args: {
25
+ tournament: {
26
+ name: 'Tournament Name',
27
+ description: 'Tournament Description',
28
+ date: '07 October, 2023',
29
+ closes: 'Registration closes 06 October, 2023',
30
+ location: 'Tournament Location - City, State'
31
+ }
32
+ }
33
+ };
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <div class="flex flex-col w-full pt-4 pb-3 px-3">
3
+ <BaseText :text="detail.name" color="textPrimary" size="xl" weight="semi-bold" />
4
+ <BaseText :text="detail.location" color="textPrimary" size="small" weight="normal" />
5
+ <div class="mt-4 flex flex-col">
6
+ <BaseText :text="`${detail.date}`" color="textPrimary" size="small" weight="light" />
7
+ <BaseText :text="`${detail.closes}`" color="textPrimary" size="small" weight="light" />
8
+ </div>
9
+ <div class="flex flex-row w-full justify-end">
10
+ <BaseButton :label="`Edit`" class="mt-2" primary />
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ import BaseText from '../../../Base/Text/BaseText.vue';
17
+ import BaseButton from '../../../Base/Button/BaseButton.vue';
18
+
19
+ export default {
20
+ name: 'tournament-card-details',
21
+ components: {
22
+ BaseButton,
23
+ BaseText
24
+ },
25
+ props: {
26
+ detail: {
27
+ type: Object,
28
+ required: true,
29
+ default: () => ({
30
+ name: '',
31
+ date: '',
32
+ closes: '',
33
+ location: ''
34
+ })
35
+ }
36
+ }
37
+ };
38
+ </script>
@@ -0,0 +1,48 @@
1
+ import TournamentCardHeader from './TournamentCardHeader.vue';
2
+
3
+ export default {
4
+ title: 'Cards/TournamentCard/TournamentHeader',
5
+ component: TournamentCardHeader,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ artwork: {
9
+ control: {
10
+ type: 'text',
11
+ defaultValue: 'Default Artwork URL'
12
+ }
13
+ },
14
+ tags: {
15
+ control: {
16
+ type: 'array',
17
+ defaultValue: ['1 Fencer', '2 Events']
18
+ }
19
+ }
20
+ }
21
+ };
22
+
23
+ export const Default = {
24
+ args: {
25
+ tags: ['1 Fencer', '2 Events']
26
+ }
27
+ };
28
+
29
+ export const WithCustomArtwork = {
30
+ args: {
31
+ artwork: 'Custom Artwork URL',
32
+ tags: ['1 Fencer', '2 Events']
33
+ }
34
+ };
35
+
36
+ export const WithCustomTags = {
37
+ args: {
38
+ artwork: 'Default Artwork URL',
39
+ tags: ['CustomTag1', 'CustomTag2']
40
+ }
41
+ };
42
+
43
+ export const NoTags = {
44
+ args: {
45
+ artwork: 'Default Artwork URL',
46
+ tags: []
47
+ }
48
+ };
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div class="rounded-t-xl w-full">
3
+ <div
4
+ :style="backgroundStyle"
5
+ class="h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center">
6
+ <div class="flex flex-row">
7
+ <BaseTag v-for="tag in tags" :key="tag" :label="tag" />
8
+ </div>
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ import BaseTag from '../../../Base/Tag/BaseTag.vue';
15
+ import defaultArtwork from '../../../../assets/default-tournament.png';
16
+
17
+ export default {
18
+ name: 'tournament-card-header',
19
+ components: {
20
+ BaseTag
21
+ },
22
+ props: {
23
+ artwork: {
24
+ type: String,
25
+ required: true,
26
+ default: defaultArtwork
27
+ },
28
+ tags: {
29
+ type: Array,
30
+ default: () => []
31
+ }
32
+ },
33
+ computed: {
34
+ backgroundStyle() {
35
+ const artworkToUse = this.artwork || defaultArtwork;
36
+ return `background-image: url('${artworkToUse}');`;
37
+ }
38
+ }
39
+ };
40
+ </script>
@@ -0,0 +1,37 @@
1
+ import TournamentCard from './TournamentCard.vue';
2
+
3
+ export default {
4
+ title: 'Cards/TournamentCard',
5
+ component: TournamentCard,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ detail: {
9
+ control: {
10
+ type: 'object',
11
+ defaultValue: {
12
+ artwork: '',
13
+ tags: ['tag1', 'tag2'],
14
+ name: 'Tournament Name',
15
+ description: 'Tournament Description',
16
+ date: '2023-09-20',
17
+ closes: '2023-09-21',
18
+ location: 'Tournament Location - City, State'
19
+ }
20
+ }
21
+ }
22
+ }
23
+ };
24
+
25
+ export const Default = {
26
+ args: {
27
+ detail: {
28
+ artwork: '',
29
+ tags: ['tag1', 'tag2'],
30
+ name: 'Tournament Name',
31
+ description: 'Tournament Description',
32
+ date: '2023-09-20',
33
+ closes: '2023-09-21',
34
+ location: 'Tournament Location - City, State'
35
+ }
36
+ }
37
+ };
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <div class="rounded-xl w-72 shadow">
3
+ <TournamentHeader :artwork="detail.artwork" :tags="detail.tags" />
4
+ <TournamentDetail :detail="detail" />
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ import TournamentHeader from './Header/TournamentCardHeader.vue';
10
+ import TournamentDetail from './Detail/TournamentCardDetail.vue';
11
+
12
+ export default {
13
+ name: 'TournamentCard',
14
+ components: {
15
+ TournamentHeader,
16
+ TournamentDetail
17
+ },
18
+ props: {
19
+ detail: {
20
+ type: Object,
21
+ required: true,
22
+ default: () => ({
23
+ artwork: '',
24
+ tags: [],
25
+ name: '',
26
+ description: '',
27
+ date: '',
28
+ closes: '',
29
+ location: ''
30
+ })
31
+ }
32
+ },
33
+ };
34
+
35
+ </script>