@dcrackel/hematournamentui 1.0.22 → 1.0.23

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 (74) hide show
  1. package/.eslintrc.js +18 -18
  2. package/.gitattributes +2 -2
  3. package/.prettierignore +1 -1
  4. package/.storybook/main.js +18 -18
  5. package/.storybook/mockRoutes.js +9 -9
  6. package/.storybook/preview-head.html +3 -3
  7. package/.storybook/preview.js +17 -17
  8. package/LICENSE +21 -21
  9. package/README.md +83 -83
  10. package/dist/HemaTouranmentUI-lib.es.js +7060 -6920
  11. package/dist/HemaTouranmentUI-lib.umd.js +27 -27
  12. package/dist/style.css +1 -1
  13. package/index.html +12 -12
  14. package/package.json +58 -58
  15. package/postcss.config.js +6 -6
  16. package/prettier.config.js +10 -10
  17. package/src/index.js +25 -25
  18. package/src/main.js +2 -2
  19. package/src/mocks/fileMock.js +1 -1
  20. package/src/mocks/tournamentMock.js +34 -34
  21. package/src/stories/Atoms/Icon/BaseIcon.stories.js +54 -54
  22. package/src/stories/Atoms/Icon/BaseIcon.test.js +91 -91
  23. package/src/stories/Atoms/Icon/BaseIcon.vue +48 -48
  24. package/src/stories/Atoms/Input/BaseInput.stories.js +29 -28
  25. package/src/stories/Atoms/Input/BaseInput.test.js +87 -87
  26. package/src/stories/Atoms/Input/BaseInput.vue +85 -73
  27. package/src/stories/Atoms/RadioGroup/BaseRadioGroup.stories.js +31 -31
  28. package/src/stories/Atoms/RadioGroup/BaseRadioGroup.test.js +49 -49
  29. package/src/stories/Atoms/RadioGroup/BaseRadioGroup.vue +49 -49
  30. package/src/stories/Atoms/Tag/BaseTag.stories.js +29 -29
  31. package/src/stories/Atoms/Tag/BaseTag.test.js +42 -42
  32. package/src/stories/Atoms/Tag/BaseTag.vue +57 -57
  33. package/src/stories/Atoms/Text/BaseText.stories.js +77 -77
  34. package/src/stories/Atoms/Text/BaseText.test.js +172 -172
  35. package/src/stories/Atoms/Text/BaseText.vue +170 -170
  36. package/src/stories/Configure.mdx +320 -320
  37. package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.stories.js +41 -41
  38. package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.test.js +80 -80
  39. package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.vue +31 -31
  40. package/src/stories/Molecules/Button/BaseButton.stories.js +93 -76
  41. package/src/stories/Molecules/Button/BaseButton.test.js +147 -147
  42. package/src/stories/Molecules/Button/BaseButton.vue +116 -125
  43. package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.stories.js +33 -33
  44. package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.vue +38 -38
  45. package/src/stories/Molecules/Cards/Header/TournamentCardHeader.stories.js +48 -48
  46. package/src/stories/Molecules/Cards/Header/TournamentCardHeader.vue +40 -40
  47. package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +36 -36
  48. package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +49 -49
  49. package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +32 -32
  50. package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +46 -46
  51. package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.stories.js +25 -25
  52. package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.vue +51 -51
  53. package/src/stories/Organisms/DatePicker/DatePicker.stories.js +25 -25
  54. package/src/stories/Organisms/DatePicker/DatePicker.vue +62 -62
  55. package/src/stories/Organisms/DropDown/DropDownMenu.stories.js +34 -34
  56. package/src/stories/Organisms/DropDown/DropDownMenu.vue +51 -51
  57. package/src/stories/Organisms/Grid/GridContainer.stories.js +47 -47
  58. package/src/stories/Organisms/Grid/GridContainer.vue +108 -108
  59. package/src/stories/Organisms/ImageCropper/ImageCropper.stories.js +28 -28
  60. package/src/stories/Organisms/ImageCropper/ImageCropper.vue +86 -86
  61. package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.stories.js +28 -28
  62. package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.vue +97 -97
  63. package/src/stories/Organisms/TournamentCard/TournamentCard.stories.js +37 -37
  64. package/src/stories/Organisms/TournamentCard/TournamentCard.vue +35 -35
  65. package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.stories.js +25 -25
  66. package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.vue +138 -137
  67. package/src/stories/Templates/Forms/AddTournamentPageTwo/AddTournamentPageTwo.stories.js +35 -0
  68. package/src/stories/Templates/Forms/AddTournamentPageTwo/AddTournamentPageTwo.vue +121 -0
  69. package/src/stories/Templates/Menu/Admin/AdminLeftMenu.stories.js +28 -28
  70. package/src/stories/Templates/Menu/Admin/AdminLeftMenu.vue +57 -57
  71. package/tailwind/output.css +1247 -1212
  72. package/tailwind/tailwind.css +4 -4
  73. package/tailwind.config.js +50 -50
  74. package/vite.config.js +23 -23
@@ -1,41 +1,41 @@
1
- // Breadcrumb.stories.js
2
- import Breadcrumb from './Breadcrumb.vue';
3
- import { vueRouter } from 'storybook-vue3-router';
4
- import mockRoutes from '../../../../../.storybook/mockRoutes.js';
5
- import { action } from '@storybook/addon-actions';
6
- export default {
7
- title: 'Molecules/Admin/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
+ // Breadcrumb.stories.js
2
+ import Breadcrumb from './Breadcrumb.vue';
3
+ import { vueRouter } from 'storybook-vue3-router';
4
+ import mockRoutes from '../../../../../.storybook/mockRoutes.js';
5
+ import { action } from '@storybook/addon-actions';
6
+ export default {
7
+ title: 'Molecules/Admin/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,80 +1,80 @@
1
- import { describe, it, expect, vi } from 'vitest';
2
- import { shallowMount } from '@vue/test-utils';
3
- import Breadcrumb from './Breadcrumb.vue';
4
- import BaseText from '../../../Atoms/Text/BaseText.vue';
5
-
6
- // Mocking BaseText and router-link
7
- const mocks = {
8
- components: {
9
- BaseText,
10
- RouterLink: {
11
- template: '<div><slot></slot></div>',
12
- props: ['to'],
13
- methods: { click: vi.fn() }
14
- }
15
- }
16
- };
17
-
18
- describe('Breadcrumb', () => {
19
- it('renders breadcrumbs correctly', () => {
20
- const items = [
21
- { text: 'Home', link: '/' },
22
- { text: 'Category', link: '/category' },
23
- { text: 'Item', link: '/category/item' }
24
- ];
25
-
26
- const wrapper = shallowMount(Breadcrumb, {
27
- props: { items },
28
- global: mocks
29
- });
30
-
31
- const linkElements = wrapper.findAll('[to]');
32
-
33
- // console.log(wrapper.html());
34
-
35
- expect(linkElements.length).toBe(items.filter(item => item.link).length);
36
- });
37
-
38
- // it('calls onLinkClick on link click', async () => {
39
- // const onLinkClick = vi.fn();
40
- // const items = [
41
- // { text: 'Home', link: '/' },
42
- // { text: 'Category' } // No link
43
- // ];
44
- //
45
- // const wrapper = shallowMount(Breadcrumb, {
46
- // props: { items, onLinkClick },
47
- // global: mocks
48
- // });
49
- //
50
- // const link = wrapper.find('[to]');
51
- // await link.trigger('click.native');
52
- // expect(onLinkClick).toHaveBeenCalled();
53
- // });
54
-
55
- it('calls onLinkClick when a link is clicked', async () => {
56
- const onLinkClick = vi.fn();
57
- const items = [
58
- { text: 'Home', link: '/' },
59
- { text: 'Category', link: '/category' }
60
- ];
61
-
62
- const wrapper = shallowMount(Breadcrumb, {
63
- props: { items, onLinkClick},
64
- global: {
65
- stubs: {
66
- BaseText,
67
- RouterLink: true
68
- }
69
- }
70
- });
71
-
72
- const links = wrapper.findAll('[to]');
73
- if (links.length > 0) {
74
- await links[0].trigger('click.native');
75
- expect(onLinkClick).toHaveBeenCalled();
76
- } else {
77
- throw new Error('No links found to test');
78
- }
79
- });
80
- });
1
+ import { describe, it, expect, vi } from 'vitest';
2
+ import { shallowMount } from '@vue/test-utils';
3
+ import Breadcrumb from './Breadcrumb.vue';
4
+ import BaseText from '../../../Atoms/Text/BaseText.vue';
5
+
6
+ // Mocking BaseText and router-link
7
+ const mocks = {
8
+ components: {
9
+ BaseText,
10
+ RouterLink: {
11
+ template: '<div><slot></slot></div>',
12
+ props: ['to'],
13
+ methods: { click: vi.fn() }
14
+ }
15
+ }
16
+ };
17
+
18
+ describe('Breadcrumb', () => {
19
+ it('renders breadcrumbs correctly', () => {
20
+ const items = [
21
+ { text: 'Home', link: '/' },
22
+ { text: 'Category', link: '/category' },
23
+ { text: 'Item', link: '/category/item' }
24
+ ];
25
+
26
+ const wrapper = shallowMount(Breadcrumb, {
27
+ props: { items },
28
+ global: mocks
29
+ });
30
+
31
+ const linkElements = wrapper.findAll('[to]');
32
+
33
+ // console.log(wrapper.html());
34
+
35
+ expect(linkElements.length).toBe(items.filter(item => item.link).length);
36
+ });
37
+
38
+ // it('calls onLinkClick on link click', async () => {
39
+ // const onLinkClick = vi.fn();
40
+ // const items = [
41
+ // { text: 'Home', link: '/' },
42
+ // { text: 'Category' } // No link
43
+ // ];
44
+ //
45
+ // const wrapper = shallowMount(Breadcrumb, {
46
+ // props: { items, onLinkClick },
47
+ // global: mocks
48
+ // });
49
+ //
50
+ // const link = wrapper.find('[to]');
51
+ // await link.trigger('click.native');
52
+ // expect(onLinkClick).toHaveBeenCalled();
53
+ // });
54
+
55
+ it('calls onLinkClick when a link is clicked', async () => {
56
+ const onLinkClick = vi.fn();
57
+ const items = [
58
+ { text: 'Home', link: '/' },
59
+ { text: 'Category', link: '/category' }
60
+ ];
61
+
62
+ const wrapper = shallowMount(Breadcrumb, {
63
+ props: { items, onLinkClick},
64
+ global: {
65
+ stubs: {
66
+ BaseText,
67
+ RouterLink: true
68
+ }
69
+ }
70
+ });
71
+
72
+ const links = wrapper.findAll('[to]');
73
+ if (links.length > 0) {
74
+ await links[0].trigger('click.native');
75
+ expect(onLinkClick).toHaveBeenCalled();
76
+ } else {
77
+ throw new Error('No links found to test');
78
+ }
79
+ });
80
+ });
@@ -1,31 +1,31 @@
1
- <template>
2
- <nav class="flex flex-row w-full">
3
- <div v-for="(item, index) in items" :key="index" class="flex flex-row">
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 "../../../Atoms/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
+ <template>
2
+ <nav class="flex flex-row w-full">
3
+ <div v-for="(item, index) in items" :key="index" class="flex flex-row">
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 "../../../Atoms/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,76 +1,93 @@
1
- import BaseButton from './BaseButton.vue';
2
-
3
- export default {
4
- title: 'Molecules/Button/BaseButton',
5
- component: BaseButton,
6
- tags: ['autodocs'],
7
- argTypes: {
8
- onClick: {},
9
- size: {
10
- control: {
11
- type: 'select'
12
- },
13
- options: ['small', 'medium', 'large']
14
- },
15
- iconName: {
16
- control: {
17
- type: 'text'
18
- },
19
- defaultValue: ''
20
- },
21
- iconStyle: {
22
- control: {
23
- type: 'select'
24
- },
25
- options: ['fa-solid', 'fa-regular', 'fa-solid', 'fa-light', 'fa-thing'],
26
- defaultValue: 'fa-solid'
27
- },
28
- type: {
29
- control: {
30
- type: 'select'
31
- },
32
- options: ['primary', 'secondary', 'tertiary', 'bright', 'admin']
33
- }
34
- }
35
- };
36
- export const Primary = {
37
- args: {
38
- type: 'primary',
39
- label: 'Button'
40
- }
41
- };
42
- export const PrimaryButtonWithIcon = {
43
- args: {
44
- type: 'primary',
45
- label: 'Button',
46
- iconName: 'fa-check'
47
- }
48
- };
49
- export const Secondary = {
50
- args: {
51
- label: 'Button'
52
- }
53
- };
54
- export const HighlightedButtonLarge = {
55
- args: {
56
- type: 'bright',
57
- size: '3xl',
58
- label: 'Button'
59
- }
60
- };
61
- export const SmallTertiary = {
62
- args: {
63
- type: 'tertiary',
64
- size: 'sm',
65
- label: 'Button'
66
- }
67
- };
68
-
69
- export const AdminMunuButton = {
70
- args: {
71
- type: 'admin',
72
- size: 'md',
73
- label: 'Admin Button',
74
- hoverColor: 'highlightPrimary'
75
- }
76
- };
1
+ import BaseButton from './BaseButton.vue';
2
+
3
+ export default {
4
+ title: 'Molecules/Button/BaseButton',
5
+ component: BaseButton,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ onClick: {},
9
+ size: {
10
+ control: {
11
+ type: 'select'
12
+ },
13
+ options: ['small', 'medium', 'large']
14
+ },
15
+ iconName: {
16
+ control: {
17
+ type: 'text'
18
+ },
19
+ defaultValue: ''
20
+ },
21
+ iconStyle: {
22
+ control: {
23
+ type: 'select'
24
+ },
25
+ options: ['fa-solid', 'fa-regular', 'fa-solid', 'fa-light', 'fa-thing'],
26
+ defaultValue: 'fa-solid'
27
+ },
28
+ type: {
29
+ control: {
30
+ type: 'select'
31
+ },
32
+ options: ['primary', 'secondary', 'tertiary', 'bright', 'admin', 'square'],
33
+ defaultValue: 'primary'
34
+ }
35
+ }
36
+ };
37
+ export const Primary = {
38
+ args: {
39
+ type: 'primary',
40
+ label: 'Button'
41
+ }
42
+ };
43
+ export const PrimaryButtonWithIcon = {
44
+ args: {
45
+ type: 'primary',
46
+ label: 'Button',
47
+ iconName: 'fa-check'
48
+ }
49
+ };
50
+ export const Secondary = {
51
+ args: {
52
+ type: 'secondary',
53
+ label: 'Button'
54
+ }
55
+ };
56
+ export const HighlightedButtonLarge = {
57
+ args: {
58
+ type: 'bright',
59
+ size: '3xl',
60
+ label: 'Button'
61
+ }
62
+ };
63
+ export const SmallTertiary = {
64
+ args: {
65
+ type: 'tertiary',
66
+ size: 'sm',
67
+ label: 'Button'
68
+ }
69
+ };
70
+
71
+ export const AdminMenuButton = {
72
+ args: {
73
+ type: 'admin',
74
+ size: 'md',
75
+ label: 'Admin Button',
76
+ hoverColor: 'highlightPrimary'
77
+ }
78
+ };
79
+
80
+ export const SquareButton = {
81
+ args: {
82
+ type: 'square',
83
+ label: 'Button',
84
+ hoverColor: 'highlightPrimary'
85
+ }
86
+ };
87
+
88
+ export const IconButton = {
89
+ args: {
90
+ type: 'iconOnly',
91
+ iconName: 'fa-check',
92
+ }
93
+ };