@dcrackel/hematournamentui 1.0.21 → 1.0.22

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 (63) hide show
  1. package/dist/HemaTouranmentUI-lib.es.js +8 -4
  2. package/dist/HemaTouranmentUI-lib.umd.js +2 -2
  3. package/package.json +3 -1
  4. package/src/index.js +1 -1
  5. package/src/stories/Atoms/Icon/BaseIcon.test.js +91 -0
  6. package/src/stories/Atoms/Icon/BaseIcon.vue +1 -0
  7. package/src/stories/Atoms/RadioGroup/BaseRadioGroup.test.js +49 -0
  8. package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.test.js +80 -0
  9. package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.vue +2 -2
  10. package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.vue +2 -1
  11. package/package/.eslintrc.js +0 -18
  12. package/package/.gitattributes +0 -2
  13. package/package/.prettierignore +0 -1
  14. package/package/.storybook/main.js +0 -18
  15. package/package/.storybook/mockRoutes.js +0 -9
  16. package/package/.storybook/preview-head.html +0 -1
  17. package/package/.storybook/preview.js +0 -17
  18. package/package/LICENSE +0 -21
  19. package/package/README.md +0 -83
  20. package/package/index.html +0 -12
  21. package/package/package.json +0 -49
  22. package/package/postcss.config.js +0 -6
  23. package/package/prettier.config.js +0 -10
  24. package/package/src/assets/default-tournament.png +0 -0
  25. package/package/src/index.js +0 -15
  26. package/package/src/main.js +0 -2
  27. package/package/src/mocks/fileMock.js +0 -1
  28. package/package/src/mocks/tournamentMock.js +0 -34
  29. package/package/src/stories/Base/Button/BaseButton.stories.js +0 -69
  30. package/package/src/stories/Base/Button/BaseButton.test.js +0 -146
  31. package/package/src/stories/Base/Button/BaseButton.vue +0 -126
  32. package/package/src/stories/Base/Input/BaseInput.stories.js +0 -28
  33. package/package/src/stories/Base/Input/BaseInput.test.js +0 -46
  34. package/package/src/stories/Base/Input/BaseInput.vue +0 -45
  35. package/package/src/stories/Base/Tag/BaseTag.stories.js +0 -29
  36. package/package/src/stories/Base/Tag/BaseTag.test.js +0 -42
  37. package/package/src/stories/Base/Tag/BaseTag.vue +0 -57
  38. package/package/src/stories/Base/Text/BaseText.stories.js +0 -77
  39. package/package/src/stories/Base/Text/BaseText.test.js +0 -153
  40. package/package/src/stories/Base/Text/BaseText.vue +0 -163
  41. package/package/src/stories/Breadcrumb/Admin/Breadcrumb.stories.js +0 -41
  42. package/package/src/stories/Breadcrumb/Admin/Breadcrumb.vue +0 -31
  43. package/package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.stories.js +0 -33
  44. package/package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +0 -38
  45. package/package/src/stories/Cards/TournamentCard/Header/TournamentCardHeader.stories.js +0 -48
  46. package/package/src/stories/Cards/TournamentCard/Header/TournamentCardHeader.vue +0 -40
  47. package/package/src/stories/Cards/TournamentCard/TournamentCard.stories.js +0 -37
  48. package/package/src/stories/Cards/TournamentCard/TournamentCard.vue +0 -35
  49. package/package/src/stories/Configure.mdx +0 -320
  50. package/package/src/stories/Containers/Grid/GridContainer.stories.js +0 -47
  51. package/package/src/stories/Containers/Grid/GridContainer.vue +0 -108
  52. package/package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +0 -36
  53. package/package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +0 -48
  54. package/package/src/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +0 -32
  55. package/package/src/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +0 -46
  56. package/package/src/stories/Menu/Admin/AdminLeftMenu.stories.js +0 -28
  57. package/package/src/stories/Menu/Admin/AdminLeftMenu.vue +0 -57
  58. package/package/src/stories/Menu/DropDown/DropDownMenu.stories.js +0 -34
  59. package/package/src/stories/Menu/DropDown/DropDownMenu.vue +0 -51
  60. package/package/tailwind/output.css +0 -1072
  61. package/package/tailwind/tailwind.css +0 -4
  62. package/package/tailwind.config.js +0 -25
  63. package/package/vite.config.js +0 -23
@@ -1,153 +0,0 @@
1
- import {mount} from "@vue/test-utils";
2
- import {describe, expect, test, it} from "vitest";
3
- import BaseText from './BaseText.vue';
4
-
5
- describe('BaseText.vue', () => {
6
- it('renders correctly with default props', () => {
7
- const wrapper = mount(BaseText, {
8
- props: {text: 'Test Text'}
9
- });
10
- expect(wrapper.text()).toBe('Test Text');
11
- expect(wrapper.classes()).toContain('font-sans');
12
- expect(wrapper.classes()).toContain('text-sm');
13
- expect(wrapper.classes()).toContain('font-normal');
14
- expect(wrapper.classes()).toContain('text-primary');
15
- });
16
-
17
- it('renders text, size, weight, and color based on props', () => {
18
- const wrapper = mount(BaseText, {
19
- props: {
20
- text: 'Styled Text',
21
- size: 'xl',
22
- weight: 'bold',
23
- color: 'secondary'
24
- }
25
- });
26
- expect(wrapper.text()).toBe('Styled Text');
27
- expect(wrapper.classes()).toContain('text-xl');
28
- expect(wrapper.classes()).toContain('font-bold');
29
- expect(wrapper.classes()).toContain('text-secondary');
30
- });
31
-
32
- it('computes classes based on multiple props', () => {
33
- const wrapper = mount(BaseText, {
34
- props: {
35
- text: 'Complex Styled Text',
36
- size: '2xl',
37
- weight: 'extra-bold',
38
- color: 'bright',
39
- hoverColor: 'tertiary'
40
- }
41
- });
42
- expect(wrapper.classes()).toContain('text-2xl');
43
- expect(wrapper.classes()).toContain('font-extrabold');
44
- expect(wrapper.classes()).toContain('text-bright');
45
- expect(wrapper.classes()).toContain('hover:text-tertiary');
46
- });
47
-
48
- it('computes classes for hover primary', () => {
49
- const wrapper = mount(BaseText, {
50
- props: {
51
- text: 'Complex Styled Text',
52
- size: 'xs',
53
- hoverColor: 'primary',
54
- weight: 'light',
55
- color: 'neutral'
56
- }
57
- });
58
-
59
- expect(wrapper.classes()).toContain('text-xs');
60
- expect(wrapper.classes()).toContain('font-light');
61
- expect(wrapper.classes()).toContain('text-neutral');
62
- expect(wrapper.classes()).toContain('hover:text-primary');
63
- });
64
-
65
- it('computes classes for hover secondary', () => {
66
- const wrapper = mount(BaseText, {
67
- props: {
68
- text: 'Complex Styled Text',
69
- size: 'md',
70
- hoverColor: 'secondary',
71
- weight: 'medium',
72
- color: 'tertiary'
73
- }
74
- });
75
-
76
- expect(wrapper.classes()).toContain('text-tertiary');
77
- expect(wrapper.classes()).toContain('text-md');
78
- expect(wrapper.classes()).toContain('font-medium');
79
- expect(wrapper.classes()).toContain('hover:text-secondary');
80
- });
81
-
82
- it('computes classes for hover tertiary', () => {
83
- const wrapper = mount(BaseText, {
84
- props: {
85
- text: 'Complex Styled Text',
86
- size: 'lg',
87
- hoverColor: 'tertiary',
88
- weight: 'light',
89
- color: 'tertiary'
90
- }
91
- });
92
- expect(wrapper.classes()).toContain('text-tertiary');
93
- expect(wrapper.classes()).toContain('text-lg');
94
- expect(wrapper.classes()).toContain('font-light');
95
- expect(wrapper.classes()).toContain('hover:text-tertiary');
96
- });
97
-
98
- it('computes classes for hover quaternary', () => {
99
- const wrapper = mount(BaseText, {
100
- props: {
101
- text: 'Complex Styled Text',
102
- weight: 'semi-bold',
103
- size: '3xl',
104
- hoverColor: 'quaternary',
105
- color: 'quaternary'
106
- }
107
- });
108
- expect(wrapper.classes()).toContain('text-quaternary');
109
- expect(wrapper.classes()).toContain('text-3xl');
110
- expect(wrapper.classes()).toContain('font-semibold');
111
- expect(wrapper.classes()).toContain('hover:text-quaternary');
112
- });
113
-
114
- it('computes classes for hover neutral', () => {
115
- const wrapper = mount(BaseText, {
116
- props: {
117
- text: 'Complex Styled Text',
118
- hoverColor: 'neutral',
119
- size: 'xs',
120
- color: 'primary'
121
- }
122
- });
123
- expect(wrapper.classes()).toContain('text-primary');
124
- expect(wrapper.classes()).toContain('text-xs');
125
- expect(wrapper.classes()).toContain('font-normal');
126
- expect(wrapper.classes()).toContain('hover:text-neutral');
127
- });
128
-
129
- it('computes classes for hover neutral', () => {
130
- const wrapper = mount(BaseText, {
131
- props: {
132
- text: 'Complex Styled Text',
133
- hoverColor: 'bright',
134
- color: 'primaryHighlight'
135
- }
136
- });
137
- expect(wrapper.classes()).toContain('hover:text-bright');
138
- expect(wrapper.classes()).toContain('text-primaryHighlight');
139
- });
140
-
141
- it('computes classes for hover neutral', () => {
142
- const wrapper = mount(BaseText, {
143
- props: {
144
- text: 'Complex Styled Text',
145
- hoverColor: 'none'
146
- }
147
- });
148
- const hasHoverClass = wrapper.classes().some(className => className.startsWith('hover:'));
149
- expect(hasHoverClass).toBeFalsy();
150
- });
151
-
152
- });
153
-
@@ -1,163 +0,0 @@
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
- default: ''
16
- },
17
- weight: {
18
- type: String,
19
- default: 'normal',
20
- validator: function (value) {
21
- return ['light', 'normal', 'medium', 'semi-bold', 'bold', 'extra-bold'].indexOf(value) !== -1;
22
- }
23
- },
24
- size: {
25
- type: String,
26
- default: 'small',
27
- validator: function (value) {
28
- return ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'].indexOf(value) !== -1;
29
- }
30
- },
31
- color: {
32
- type: String,
33
- default: 'primary',
34
- validator: function (value) {
35
- return ['neutral', 'quaternary', 'tertiary', 'secondary', 'primary', 'bright', 'primaryHighlight'].indexOf(value) !== -1;
36
- }
37
- },
38
- hoverColor: {
39
- type: String,
40
- default: 'none',
41
- validator: function (value) {
42
- return (
43
- [
44
- 'primary',
45
- 'secondary',
46
- 'tertiary',
47
- 'quaternary',
48
- 'neutral',
49
- 'bright',
50
- 'none'
51
- ].indexOf(value) !== -1
52
- );
53
- }
54
- }
55
- },
56
- setup(props) {
57
- props = reactive(props);
58
- return {
59
- classes: computed(() => {
60
- let baseClasses = 'inline-block font-sans';
61
-
62
- switch (props.color) {
63
- case 'neutral':
64
- baseClasses += ' text-neutral';
65
- break;
66
- case `tertiary`:
67
- baseClasses += ' text-tertiary';
68
- break;
69
- case 'secondary':
70
- baseClasses += ' text-secondary';
71
- break;
72
- case 'quaternary':
73
- baseClasses += ' text-quaternary';
74
- break;
75
- case 'primary':
76
- baseClasses += ' text-primary';
77
- break;
78
- case 'primaryHighlight':
79
- baseClasses += ' text-primaryHighlight';
80
- break;
81
- case 'bright':
82
- baseClasses += ' text-bright';
83
- break;
84
- }
85
-
86
- switch (props.hoverColor) {
87
- case 'neutral':
88
- baseClasses += ' hover:text-neutral';
89
- break;
90
- case `tertiary`:
91
- baseClasses += ' hover:text-tertiary';
92
- break;
93
- case 'secondary':
94
- baseClasses += ' hover:text-secondary';
95
- break;
96
- case 'quaternary':
97
- baseClasses += ' hover:text-quaternary';
98
- break;
99
- case 'primary':
100
- baseClasses += ' hover:text-primary';
101
- break;
102
- case 'bright':
103
- baseClasses += ' hover:text-bright';
104
- break;
105
- case 'none':
106
- baseClasses += '';
107
- break;
108
- }
109
-
110
- switch (props.weight) {
111
- case 'light':
112
- baseClasses += ' font-light';
113
- break;
114
- case 'normal':
115
- baseClasses += ' font-normal';
116
- break;
117
- case 'medium':
118
- baseClasses += ' font-medium';
119
- break;
120
- case 'semi-bold':
121
- baseClasses += ' font-semibold';
122
- break;
123
- case 'bold':
124
- baseClasses += ' font-bold';
125
- break;
126
- case 'extra-bold':
127
- baseClasses += ' font-extrabold';
128
- break;
129
- }
130
-
131
- switch (props.size) {
132
- case 'xs':
133
- baseClasses += ' text-xs';
134
- break;
135
- case 'sm':
136
- baseClasses += ' text-sm';
137
- break;
138
- case 'md':
139
- baseClasses += ' text-md';
140
- break;
141
- case 'lg':
142
- baseClasses += ' text-lg';
143
- break;
144
- case 'xl':
145
- baseClasses += ' text-xl';
146
- break;
147
- case '2xl':
148
- baseClasses += ' text-2xl';
149
- break;
150
- case '3xl':
151
- baseClasses += ' text-3xl';
152
- break;
153
- default:
154
- baseClasses += ' text-sm';
155
- break;
156
- }
157
- return baseClasses;
158
- })
159
- };
160
- }
161
- };
162
-
163
- </script>
@@ -1,41 +0,0 @@
1
- // Breadcrumb.stories.js
2
- import Breadcrumb from './Breadcrumb.vue';
3
- import { vueRouter } from 'storybook-vue3-router';
4
- import mockRoutes from '../../../../.storybook/mockRoutes';
5
- import { action } from '@storybook/addon-actions';
6
- export default {
7
- title: 'Navigation/Breadcrumb',
8
- component: Breadcrumb,
9
- tags: ['autodocs'],
10
- argTypes: {
11
- items: {
12
- control: 'object',
13
- description: 'Array of breadcrumb items'
14
- },
15
- },
16
- };
17
-
18
- export const Default = {
19
- args: {
20
- label: 'Sort By',
21
- items: [
22
- { text: 'Tournament', link: '/' },
23
- { text: 'Event', link: '/event' },
24
- { text: 'Pool', link: '' }
25
- ],
26
- selectedItem: {text: 'Text1', link: '/link1'},
27
- props: {
28
- onLinkClick: {
29
- default: () => action('link-clicked')
30
- }
31
- },
32
- }
33
- };
34
-
35
- Default.decorators = [vueRouter(mockRoutes)];
36
-
37
- Default.parameters = {
38
- actions: {
39
- handles: ['click .breadcrumb-item router-link'],
40
- },
41
- };
@@ -1,31 +0,0 @@
1
- <template>
2
- <nav class="flex flex-row">
3
- <div v-for="(item, index) in items" :key="index">
4
- <BaseText v-if="index > 0" :text="' > '" size="lg" color="quaternary" class="mr-2" />
5
- <BaseText v-if="!item.link" class="mr-2" :text="item.text" size="lg" color="quaternary" />
6
- <router-link v-if="item.link" :to="item.link" @click.native="onLinkClick" class="mr-2">
7
- <BaseText :text="item.text" size="lg" color="quaternary" hover-color="bright" class="underline" />
8
- </router-link>
9
- </div>
10
- </nav>
11
- </template>
12
-
13
- <script>
14
- import BaseText from "../../Base/Text/BaseText.vue";
15
-
16
- export default {
17
- name: 'Breadcrumb',
18
- components: {BaseText},
19
- props: {
20
- items: {
21
- type: Array,
22
- required: true,
23
- default: () => []
24
- },
25
- onLinkClick: {
26
- type: Function,
27
- default: () => {}
28
- }
29
- }
30
- };
31
- </script>
@@ -1,33 +0,0 @@
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
- };
@@ -1,38 +0,0 @@
1
- <template>
2
- <div class="flex flex-col w-full pt-4 pb-3 px-3">
3
- <BaseText :text="detail.name" color="primary" size="xl" weight="semi-bold" />
4
- <BaseText :text="detail.location" color="primary" size="sm" weight="normal" />
5
- <div class="mt-4 flex flex-col">
6
- <BaseText :text="`${detail.date}`" color="primaryHighlight" size="sm" weight="light" />
7
- <BaseText :text="`${detail.closes}`" color="primaryHighlight" size="sm" 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>
@@ -1,48 +0,0 @@
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
- };
@@ -1,40 +0,0 @@
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>
@@ -1,37 +0,0 @@
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
- };
@@ -1,35 +0,0 @@
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>