@dcrackel/hematournamentui 1.0.7 → 1.0.8
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/.storybook/preview-head.html +3 -1
- package/dist/HemaTouranmentUI-lib.es.js +307 -253
- package/dist/HemaTouranmentUI-lib.umd.js +1 -1
- package/package/.eslintrc.js +18 -0
- package/package/.gitattributes +2 -0
- package/package/.prettierignore +1 -0
- package/package/.storybook/main.js +18 -0
- package/package/.storybook/mockRoutes.js +9 -0
- package/package/.storybook/preview-head.html +1 -0
- package/package/.storybook/preview.js +17 -0
- package/package/LICENSE +21 -0
- package/package/README.md +83 -0
- package/package/index.html +12 -0
- package/package/package.json +49 -0
- package/package/postcss.config.js +6 -0
- package/package/prettier.config.js +10 -0
- package/package/src/assets/default-tournament.png +0 -0
- package/package/src/index.js +15 -0
- package/package/src/main.js +2 -0
- package/package/src/mocks/fileMock.js +1 -0
- package/package/src/mocks/tournamentMock.js +34 -0
- package/package/src/stories/Configure.mdx +320 -0
- package/package/tailwind/output.css +1072 -0
- package/package/tailwind/tailwind.css +4 -0
- package/package/tailwind.config.js +25 -0
- package/package/vite.config.js +23 -0
- package/package.json +9 -2
- package/src/assets/select-tournament.png +0 -0
- package/src/stories/Atoms/Icon/BaseIcon.stories.js +54 -0
- package/src/stories/Atoms/Icon/BaseIcon.vue +47 -0
- package/src/stories/Atoms/Input/BaseInput.stories.js +28 -0
- package/src/stories/Atoms/Input/BaseInput.test.js +87 -0
- package/src/stories/Atoms/Input/BaseInput.vue +73 -0
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.stories.js +31 -0
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.vue +49 -0
- package/src/stories/Atoms/Tag/BaseTag.stories.js +29 -0
- package/src/stories/Atoms/Tag/BaseTag.test.js +42 -0
- package/src/stories/Atoms/Tag/BaseTag.vue +57 -0
- package/src/stories/Atoms/Text/BaseText.stories.js +77 -0
- package/src/stories/Atoms/Text/BaseText.test.js +172 -0
- package/src/stories/Atoms/Text/BaseText.vue +170 -0
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.stories.js +41 -0
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.vue +31 -0
- package/src/stories/Molecules/Button/BaseButton.stories.js +76 -0
- package/src/stories/Molecules/Button/BaseButton.test.js +147 -0
- package/src/stories/Molecules/Button/BaseButton.vue +125 -0
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.stories.js +33 -0
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.vue +38 -0
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.stories.js +48 -0
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.vue +40 -0
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +36 -0
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +49 -0
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +32 -0
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +46 -0
- package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.stories.js +25 -0
- package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.vue +51 -0
- package/src/stories/Organisms/DatePicker/DatePicker.stories.js +25 -0
- package/src/stories/Organisms/DatePicker/DatePicker.vue +62 -0
- package/src/stories/Organisms/DropDown/DropDownMenu.stories.js +34 -0
- package/src/stories/Organisms/DropDown/DropDownMenu.vue +51 -0
- package/src/stories/Organisms/Grid/GridContainer.stories.js +47 -0
- package/src/stories/Organisms/Grid/GridContainer.vue +108 -0
- package/src/stories/Organisms/ImageCropper/ImageCropper.stories.js +28 -0
- package/src/stories/Organisms/ImageCropper/ImageCropper.vue +86 -0
- package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.stories.js +28 -0
- package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.vue +97 -0
- package/src/stories/Organisms/TournamentCard/TournamentCard.stories.js +37 -0
- package/src/stories/Organisms/TournamentCard/TournamentCard.vue +35 -0
- package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.stories.js +25 -0
- package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.vue +136 -0
- package/src/stories/Templates/Menu/Admin/AdminLeftMenu.stories.js +28 -0
- package/src/stories/Templates/Menu/Admin/AdminLeftMenu.vue +57 -0
- package/tailwind/output.css +147 -7
- package/tailwind.config.js +28 -3
- /package/{src → package/src}/stories/Base/Button/BaseButton.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Button/BaseButton.test.js +0 -0
- /package/{src → package/src}/stories/Base/Button/BaseButton.vue +0 -0
- /package/{src → package/src}/stories/Base/Input/BaseInput.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Input/BaseInput.test.js +0 -0
- /package/{src → package/src}/stories/Base/Input/BaseInput.vue +0 -0
- /package/{src → package/src}/stories/Base/Tag/BaseTag.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Tag/BaseTag.test.js +0 -0
- /package/{src → package/src}/stories/Base/Tag/BaseTag.vue +0 -0
- /package/{src → package/src}/stories/Base/Text/BaseText.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Text/BaseText.test.js +0 -0
- /package/{src → package/src}/stories/Base/Text/BaseText.vue +0 -0
- /package/{src → package/src}/stories/Breadcrumb/Admin/Breadcrumb.stories.js +0 -0
- /package/{src → package/src}/stories/Breadcrumb/Admin/Breadcrumb.vue +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Detail/TournamentCardDetail.stories.js +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Header/TournamentCardHeader.stories.js +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Header/TournamentCardHeader.vue +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/TournamentCard.stories.js +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/TournamentCard.vue +0 -0
- /package/{src → package/src}/stories/Containers/Grid/GridContainer.stories.js +0 -0
- /package/{src → package/src}/stories/Containers/Grid/GridContainer.vue +0 -0
- /package/{src → package/src}/stories/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +0 -0
- /package/{src → package/src}/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +0 -0
- /package/{src → package/src}/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +0 -0
- /package/{src → package/src}/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +0 -0
- /package/{src → package/src}/stories/Menu/Admin/AdminLeftMenu.stories.js +0 -0
- /package/{src → package/src}/stories/Menu/Admin/AdminLeftMenu.vue +0 -0
- /package/{src → package/src}/stories/Menu/DropDown/DropDownMenu.stories.js +0 -0
- /package/{src → package/src}/stories/Menu/DropDown/DropDownMenu.vue +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button data-testid="base-button" :class="classes" type="button" @click="onClick">
|
|
3
|
+
<BaseIcon v-if="iconName" data-testid="base-icon" :icon-name="iconName" :style="iconStyle" :color="textColor" :size="size" />
|
|
4
|
+
<BaseText data-testid="base-text" :color="textColor" :size="size" :text="label" weight="normal" />
|
|
5
|
+
</button>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { computed } from 'vue';
|
|
10
|
+
import BaseText from '../../Atoms/Text/BaseText.vue';
|
|
11
|
+
import BaseIcon from '../../Atoms/Icon/BaseIcon.vue';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'base-button',
|
|
15
|
+
components: { BaseText, BaseIcon },
|
|
16
|
+
props: {
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
iconName: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
iconStyle: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'fa-solid',
|
|
28
|
+
validator: value => ['fa-solid', 'fa-regular', 'fa-light', 'fa-thing'].includes(value)
|
|
29
|
+
},
|
|
30
|
+
size: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'sm',
|
|
33
|
+
validator: value => ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl'].includes(value)
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'primary',
|
|
38
|
+
validator: value => ['primary', 'secondary', 'tertiary', 'bright', 'admin', 'adminSecondary','continue', 'iconOnly', 'editor'].includes(value)
|
|
39
|
+
},
|
|
40
|
+
selected: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
emits: ['click'],
|
|
46
|
+
|
|
47
|
+
setup(props, { emit }) {
|
|
48
|
+
const typeClasses = {
|
|
49
|
+
primary: 'px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary ' +
|
|
50
|
+
(props.selected ? 'bg-dropdownSelect' : 'bg-neutral'),
|
|
51
|
+
|
|
52
|
+
secondary: 'px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral ' +
|
|
53
|
+
(props.selected ? 'bg-dropdownSelect' : 'bg-secondary'),
|
|
54
|
+
|
|
55
|
+
tertiary: 'px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary ' +
|
|
56
|
+
(props.selected ? 'bg-primary' : 'bg-tertiary'),
|
|
57
|
+
|
|
58
|
+
bright: 'px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral ' +
|
|
59
|
+
(props.selected ? 'bg-primary' : 'bg-bright'),
|
|
60
|
+
|
|
61
|
+
admin: 'px-2.5 mx-1 py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight ' +
|
|
62
|
+
(props.selected ? 'bg-primary' : 'bg-primary'),
|
|
63
|
+
|
|
64
|
+
adminSecondary: 'px-2.5 mx-1 py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral ' +
|
|
65
|
+
(props.selected ? 'bg-primary' : 'bg-primary'),
|
|
66
|
+
|
|
67
|
+
continue: 'px-2.5 mx-1 items-center gap-2.5 text-center my-1 p-3 border-b border-secondary hover:border-b hover:border-neutral w-full rounded-lg flex flex-row justify-center ' +
|
|
68
|
+
(props.selected ? 'bg-secondary' : 'bg-primary'),
|
|
69
|
+
|
|
70
|
+
iconOnly: 'py-0.5 items-center rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary',
|
|
71
|
+
|
|
72
|
+
editor: 'px-1 items-center rounded-md text-center justify-center hover:bg-tertiary'
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const sizeClasses = {
|
|
76
|
+
xs: 'text-xs',
|
|
77
|
+
sm: 'text-sm',
|
|
78
|
+
md: 'text-md',
|
|
79
|
+
lg: 'text-lg',
|
|
80
|
+
xl: 'text-xl',
|
|
81
|
+
'2xl': 'text-2xl',
|
|
82
|
+
'3xl': 'text-3xl',
|
|
83
|
+
'4xl': 'text-4xl',
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
textColor: computed(() => {
|
|
88
|
+
const colorMap = {
|
|
89
|
+
primary: 'primary',
|
|
90
|
+
secondary: 'secondary',
|
|
91
|
+
tertiary: 'tertiary',
|
|
92
|
+
bright: 'bright',
|
|
93
|
+
admin: 'neutral',
|
|
94
|
+
adminSecondary: 'neutral',
|
|
95
|
+
continue: 'neutral',
|
|
96
|
+
editor: props.selected ? 'bright' : 'quaternary'
|
|
97
|
+
};
|
|
98
|
+
return colorMap[props.type];
|
|
99
|
+
}),
|
|
100
|
+
classes: computed(() => {
|
|
101
|
+
let baseClasses = 'inline-flex';
|
|
102
|
+
|
|
103
|
+
let typeClass = typeClasses[props.type];
|
|
104
|
+
|
|
105
|
+
if (props.selected) {
|
|
106
|
+
switch (props.type) {
|
|
107
|
+
case 'primary':
|
|
108
|
+
typeClass = typeClass.replace('bg-neutral', 'bg-dropdownSelect');
|
|
109
|
+
break;
|
|
110
|
+
case 'secondary':
|
|
111
|
+
typeClass = typeClass.replace('bg-secondary', 'bg-dropdownSelect');
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
let sizeClass = sizeClasses[props.size];
|
|
117
|
+
return `${baseClasses} ${typeClass} ${sizeClass}`;
|
|
118
|
+
}),
|
|
119
|
+
onClick() {
|
|
120
|
+
emit('click');
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import TournamentCardDetail from './TournamentCardDetail.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/Cards/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="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 '../../../Atoms/Text/BaseText.vue';
|
|
17
|
+
import BaseButton from '../../../Molecules/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: 'Molecules/Cards/TournamentCardHeader',
|
|
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 '../../../Atoms/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,36 @@
|
|
|
1
|
+
import FilterAndSortBar from './FilterAndSortBar.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/Filter/FilterAndSortBar',
|
|
5
|
+
component: FilterAndSortBar,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
label: {
|
|
9
|
+
type: 'text',
|
|
10
|
+
defaultValue: 'Default Text'
|
|
11
|
+
},
|
|
12
|
+
items: { control: 'object' }
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// const Template = args => ({
|
|
17
|
+
// components: { FilterAndSortBar },
|
|
18
|
+
// props: Object.keys(args),
|
|
19
|
+
// methods: {
|
|
20
|
+
// onButtonClick(button) {
|
|
21
|
+
// console.log('Button clicked:', button);
|
|
22
|
+
// }
|
|
23
|
+
// }
|
|
24
|
+
// });
|
|
25
|
+
|
|
26
|
+
export const Default = {
|
|
27
|
+
args: {
|
|
28
|
+
label: 'Sort by',
|
|
29
|
+
items: [
|
|
30
|
+
{text: 'Name', link: '/sort/name'},
|
|
31
|
+
{text: 'Location', link: '/sort/location'},
|
|
32
|
+
{text: 'Date', link: '/sort/date'}
|
|
33
|
+
],
|
|
34
|
+
selectedItem: {text: 'Name', link: '/sort/name'}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="flex flex-row w-full justify-between">
|
|
3
|
+
<div class="rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4">
|
|
4
|
+
<i class="fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1" />
|
|
5
|
+
<BaseInput placeholder="Search on Name, Location, or Date" class="text-quaternary" :value="filterText" @update:value="handleFilter" />
|
|
6
|
+
</div>
|
|
7
|
+
<div>
|
|
8
|
+
<DropDownMenu :label="label" :items="items" :selectedItem="localSelectedItem" @update:selectedItem="handleSelectedItem" />
|
|
9
|
+
</div>
|
|
10
|
+
</section>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import BaseInput from "../../../Atoms/Input/BaseInput.vue";
|
|
15
|
+
import DropDownMenu from "../../../Organisms/DropDown/DropDownMenu.vue";
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'FilterAndSortBar',
|
|
19
|
+
components: {
|
|
20
|
+
DropDownMenu,
|
|
21
|
+
BaseInput
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
label: {
|
|
25
|
+
type: String,
|
|
26
|
+
},
|
|
27
|
+
items: {
|
|
28
|
+
type: Array,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
31
|
+
selectedItem: null
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
filterText: '',
|
|
36
|
+
localSelectedItem: this.selectedItem
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
handleFilter(filterText) {
|
|
41
|
+
this.$emit('filterbar', filterText);
|
|
42
|
+
},
|
|
43
|
+
handleSelectedItem(item) {
|
|
44
|
+
this.$emit('sort', item)
|
|
45
|
+
this.localSelectedItem = item;
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import FilterUpcomingPast from './FilterUpcomingPast.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/Filter/FilterUpcomingPast',
|
|
5
|
+
component: FilterUpcomingPast,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
},
|
|
9
|
+
methods: {
|
|
10
|
+
handleTimeFrame: {
|
|
11
|
+
action: 'handleTimeFrame',
|
|
12
|
+
description: 'Emitted when a time frame is selected'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const Default = {
|
|
18
|
+
args: {
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const UpcomingSelected = {
|
|
23
|
+
args: {
|
|
24
|
+
selected: 'Upcoming'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const PastSelected = {
|
|
29
|
+
args: {
|
|
30
|
+
selected: 'Past'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="flex flex-row w-full justify-between">
|
|
3
|
+
<div class="rounded-lg w-3/4">
|
|
4
|
+
<BaseText text="Tournament" color="primary" size="2xl" weight="normal" />
|
|
5
|
+
</div>
|
|
6
|
+
<div class="flex flex-row h-8 w-1/4 justify-end">
|
|
7
|
+
<BaseButton label="All" color="primary" size="sm" :selected="localSelected === 'All'" @click="handleTimeFrame('ALL')" />
|
|
8
|
+
<BaseButton label="Upcoming" color="primary" size="sm" :selected="localSelected === 'Upcoming'" @click="handleTimeFrame('Upcoming')" />
|
|
9
|
+
<BaseButton label="Past" color="primary" size="sm" :selected="localSelected === 'Past'" @click="handleTimeFrame('Past')" />
|
|
10
|
+
</div>
|
|
11
|
+
</section>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import BaseInput from "../../../Atoms/Input/BaseInput.vue";
|
|
16
|
+
import DropDownMenu from "../../../Organisms/DropDown/DropDownMenu.vue";
|
|
17
|
+
import BaseButton from "../../../Molecules/Button/BaseButton.vue";
|
|
18
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: 'FilterUpcomingPast',
|
|
22
|
+
components: {
|
|
23
|
+
BaseText,
|
|
24
|
+
BaseButton,
|
|
25
|
+
DropDownMenu,
|
|
26
|
+
BaseInput
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
selected : {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'All'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
localSelected: this.selected
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
handleTimeFrame(timeFrame) {
|
|
41
|
+
this.$emit('timeFrame', timeFrame)
|
|
42
|
+
this.localSelected = timeFrame
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AddressAutocomplete from './AddressAutocomplete.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/AddressAutocomplete',
|
|
5
|
+
component: AddressAutocomplete,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = args => ({
|
|
11
|
+
components: { AddressAutocomplete },
|
|
12
|
+
setup() {
|
|
13
|
+
return {
|
|
14
|
+
args: {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<vue-google-autocomplete
|
|
4
|
+
class="border rounded-lg text-secondary text-xs p-2 w-full appearance-none focus:outline-none"
|
|
5
|
+
:class="invalid ? 'border-alarm' : 'border-dropdownSelect'"
|
|
6
|
+
id="map"
|
|
7
|
+
ref="address"
|
|
8
|
+
v-model="address"
|
|
9
|
+
placeholder="Venue Address"
|
|
10
|
+
@placechanged="getAddressData"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import VueGoogleAutocomplete from "vue-google-autocomplete";
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: { VueGoogleAutocomplete },
|
|
20
|
+
props: {
|
|
21
|
+
invalid: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
address: "",
|
|
29
|
+
coordinates: ""
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
getAddressData(addressData) {
|
|
34
|
+
const street = `${addressData.street_number} ${addressData.route}`;
|
|
35
|
+
const city = addressData.locality;
|
|
36
|
+
const state = addressData.administrative_area_level_1;
|
|
37
|
+
|
|
38
|
+
this.address = `${street}, ${city}, ${state}`;
|
|
39
|
+
this.coordinates = `${addressData.latitude},${addressData.longitude}`
|
|
40
|
+
|
|
41
|
+
const updatedAddress = {
|
|
42
|
+
address: this.address,
|
|
43
|
+
coordinates: this.coordinates
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.$emit("update:address", updatedAddress);
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import DatePicker from './DatePicker.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/DatePicker',
|
|
5
|
+
component: DatePicker,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = args => ({
|
|
11
|
+
components: { DatePicker },
|
|
12
|
+
setup() {
|
|
13
|
+
return {
|
|
14
|
+
args: {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div >
|
|
3
|
+
<VueDatePicker
|
|
4
|
+
v-model="selectedDate"
|
|
5
|
+
placeholder="Select Start Date"
|
|
6
|
+
mode="date"
|
|
7
|
+
:format="'MM/dd/yyyy'"
|
|
8
|
+
:enable-time-picker="false"
|
|
9
|
+
:min-date="minDate"
|
|
10
|
+
:state="invalid"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import VueDatePicker from '@vuepic/vue-datepicker';
|
|
17
|
+
import '@vuepic/vue-datepicker/dist/main.css';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
components: { VueDatePicker },
|
|
21
|
+
props: {
|
|
22
|
+
setDate: {
|
|
23
|
+
type: [Date, String],
|
|
24
|
+
default: () => new Date(),
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
invalid: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
selectedDate: this.setDate ? new Date(this.setDate) : null,
|
|
35
|
+
minDate: new Date()
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
watch: {
|
|
39
|
+
selectedDate(newDate) {
|
|
40
|
+
this.$emit("update:selectedDate", newDate);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style scoped>
|
|
47
|
+
::v-deep .dp__pointer.dp__input_readonly.dp__input.dp__input_icon_pad.dp__input_reg {
|
|
48
|
+
color: rgb(43,50,75);
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
border-radius: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
::v-deep .dp__input_invalid {
|
|
54
|
+
box-shadow: 0 0;
|
|
55
|
+
border: 1px solid rgb(213,228,238);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
::v-deep .dp__input_valid {
|
|
59
|
+
box-shadow: 0 0;
|
|
60
|
+
border: 1px solid rgb(255,0,0);
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import DropDownMenu from './DropDownMenu.vue';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Organisms/DropDownMenu',
|
|
4
|
+
component: DropDownMenu,
|
|
5
|
+
tags: ['autodocs']
|
|
6
|
+
};
|
|
7
|
+
const Template = args => ({
|
|
8
|
+
components: { DropDownMenu },
|
|
9
|
+
setup() {
|
|
10
|
+
return {
|
|
11
|
+
args: {
|
|
12
|
+
label: 'default',
|
|
13
|
+
items: []
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
onMenuClick(index) {
|
|
19
|
+
alert(`Button ${index + 1} clicked!`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {
|
|
26
|
+
label: 'Sort By',
|
|
27
|
+
items: [
|
|
28
|
+
{text: 'Text1', link: '/link1'},
|
|
29
|
+
{text: 'Text2', link: '/link2'},
|
|
30
|
+
{text: 'Text3', link: '/link3'}
|
|
31
|
+
],
|
|
32
|
+
selectedItem: {text: 'Text1', link: '/link1'}
|
|
33
|
+
}
|
|
34
|
+
};
|