@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.
- package/.storybook/main.js +17 -0
- package/.storybook/preview-head.html +1 -0
- package/.storybook/preview.js +17 -0
- package/HemaTournamentUI/.gitattributes +2 -0
- package/HemaTournamentUI/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/my-library.es.js +723 -0
- package/dist/my-library.umd.js +1 -0
- package/index.html +12 -0
- package/package.json +42 -0
- package/postcss.config.js +6 -0
- package/src/assets/default-tournament.png +0 -0
- package/src/index.js +15 -0
- package/src/main.js +2 -0
- package/src/mocks/fileMock.js +1 -0
- package/src/mocks/tournamentMock.js +34 -0
- package/src/stories/Base/Button/BaseButton.stories.js +69 -0
- package/src/stories/Base/Button/BaseButton.vue +141 -0
- package/src/stories/Base/Input/BaseInput.stories.js +28 -0
- package/src/stories/Base/Input/BaseInput.vue +44 -0
- package/src/stories/Base/Tag/BaseTag.stories.js +29 -0
- package/src/stories/Base/Tag/BaseTag.vue +57 -0
- package/src/stories/Base/Text/BaseText.stories.js +77 -0
- package/src/stories/Base/Text/BaseText.vue +162 -0
- package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.stories.js +33 -0
- package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +38 -0
- package/src/stories/Cards/TournamentCard/Header/TournamentCardHeader.stories.js +48 -0
- package/src/stories/Cards/TournamentCard/Header/TournamentCardHeader.vue +40 -0
- package/src/stories/Cards/TournamentCard/TournamentCard.stories.js +37 -0
- package/src/stories/Cards/TournamentCard/TournamentCard.vue +35 -0
- package/src/stories/Configure.mdx +320 -0
- package/src/stories/Containers/Grid/GridContainer.stories.js +27 -0
- package/src/stories/Containers/Grid/GridContainer.vue +36 -0
- package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +36 -0
- package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +39 -0
- package/src/stories/Menu/Admin/AdminLeftMenu.stories.js +23 -0
- package/src/stories/Menu/Admin/AdminLeftMenu.vue +57 -0
- package/src/stories/Menu/DropDown/DropDownMenu.stories.js +34 -0
- package/src/stories/Menu/DropDown/DropDownMenu.vue +49 -0
- package/tailwind/output.css +1047 -0
- package/tailwind/tailwind.css +4 -0
- package/tailwind.config.js +25 -0
- package/vite.config.js +20 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { Meta } from "@storybook/blocks";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<Meta title="Configure your project" />
|
|
6
|
+
|
|
7
|
+
<div className="sb-container">
|
|
8
|
+
<div className='sb-section-title'>
|
|
9
|
+
# Configure your project
|
|
10
|
+
|
|
11
|
+
Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
|
|
12
|
+
</div>
|
|
13
|
+
<div className="sb-section">
|
|
14
|
+
<div className="sb-section-item">
|
|
15
|
+
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
|
|
16
|
+
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
|
|
17
|
+
<a
|
|
18
|
+
href="https://storybook.js.org/docs/vue/configure/styling-and-css"
|
|
19
|
+
target="_blank"
|
|
20
|
+
>Learn more</a>
|
|
21
|
+
</div>
|
|
22
|
+
<div className="sb-section-item">
|
|
23
|
+
|
|
24
|
+
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
|
|
25
|
+
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
|
|
26
|
+
<a
|
|
27
|
+
href="https://storybook.js.org/docs/vue/writing-stories/decorators#context-for-mocking"
|
|
28
|
+
target="_blank"
|
|
29
|
+
>Learn more</a>
|
|
30
|
+
</div>
|
|
31
|
+
<div className="sb-section-item">
|
|
32
|
+
|
|
33
|
+
<div>
|
|
34
|
+
<h4 className="sb-section-item-heading">Load assets and resources</h4>
|
|
35
|
+
<p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
|
|
36
|
+
`staticDirs` configuration option to specify folders to load when
|
|
37
|
+
starting Storybook.</p>
|
|
38
|
+
<a
|
|
39
|
+
href="https://storybook.js.org/docs/vue/configure/images-and-assets"
|
|
40
|
+
target="_blank"
|
|
41
|
+
>Learn more</a>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div className="sb-container">
|
|
47
|
+
<div className='sb-section-title'>
|
|
48
|
+
# Do more with Storybook
|
|
49
|
+
|
|
50
|
+
Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div className="sb-section">
|
|
54
|
+
<div className="sb-features-grid">
|
|
55
|
+
<div className="sb-grid-item">
|
|
56
|
+
<h4 className="sb-section-item-heading">Autodocs</h4>
|
|
57
|
+
<p className="sb-section-item-paragraph">Auto-generate living,
|
|
58
|
+
interactive reference documentation from your components and stories.</p>
|
|
59
|
+
<a
|
|
60
|
+
href="https://storybook.js.org/docs/vue/writing-docs/autodocs"
|
|
61
|
+
target="_blank"
|
|
62
|
+
>Learn more</a>
|
|
63
|
+
</div>
|
|
64
|
+
<div className="sb-grid-item">
|
|
65
|
+
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
|
|
66
|
+
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
|
|
67
|
+
<a
|
|
68
|
+
href="https://storybook.js.org/docs/vue/sharing/publish-storybook#publish-storybook-with-chromatic"
|
|
69
|
+
target="_blank"
|
|
70
|
+
>Learn more</a>
|
|
71
|
+
</div>
|
|
72
|
+
<div className="sb-grid-item">
|
|
73
|
+
<h4 className="sb-section-item-heading">Figma Plugin</h4>
|
|
74
|
+
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
|
|
75
|
+
implementation in one place.</p>
|
|
76
|
+
<a
|
|
77
|
+
href="https://storybook.js.org/docs/vue/sharing/design-integrations#embed-storybook-in-figma-with-the-plugin"
|
|
78
|
+
target="_blank"
|
|
79
|
+
>Learn more</a>
|
|
80
|
+
</div>
|
|
81
|
+
<div className="sb-grid-item">
|
|
82
|
+
<h4 className="sb-section-item-heading">Testing</h4>
|
|
83
|
+
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
|
|
84
|
+
complex.</p>
|
|
85
|
+
<a
|
|
86
|
+
href="https://storybook.js.org/docs/vue/writing-tests/introduction"
|
|
87
|
+
target="_blank"
|
|
88
|
+
>Learn more</a>
|
|
89
|
+
</div>
|
|
90
|
+
<div className="sb-grid-item">
|
|
91
|
+
<h4 className="sb-section-item-heading">Accessibility</h4>
|
|
92
|
+
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
|
|
93
|
+
<a
|
|
94
|
+
href="https://storybook.js.org/docs/vue/writing-tests/accessibility-testing"
|
|
95
|
+
target="_blank"
|
|
96
|
+
>Learn more</a>
|
|
97
|
+
</div>
|
|
98
|
+
<div className="sb-grid-item">
|
|
99
|
+
<h4 className="sb-section-item-heading">Theming</h4>
|
|
100
|
+
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
|
|
101
|
+
<a
|
|
102
|
+
href="https://storybook.js.org/docs/vue/configure/theming"
|
|
103
|
+
target="_blank"
|
|
104
|
+
>Learn more</a>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div className='sb-addon'>
|
|
110
|
+
<div className='sb-addon-text'>
|
|
111
|
+
<h4>Addons</h4>
|
|
112
|
+
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
|
|
113
|
+
<a
|
|
114
|
+
href="https://storybook.js.org/integrations/"
|
|
115
|
+
target="_blank"
|
|
116
|
+
>Discover all addons</a>
|
|
117
|
+
</div>
|
|
118
|
+
<div className='sb-addon-img'></div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div className="sb-section sb-socials">
|
|
122
|
+
<div className="sb-section-item">
|
|
123
|
+
|
|
124
|
+
Join our contributors building the future of UI development.
|
|
125
|
+
|
|
126
|
+
<a
|
|
127
|
+
href="https://github.com/storybookjs/storybook"
|
|
128
|
+
target="_blank"
|
|
129
|
+
>Star on GitHub</a>
|
|
130
|
+
</div>
|
|
131
|
+
<div className="sb-section-item">
|
|
132
|
+
|
|
133
|
+
<div>
|
|
134
|
+
Get support and chat with frontend developers.
|
|
135
|
+
|
|
136
|
+
<a
|
|
137
|
+
href="https://discord.gg/storybook"
|
|
138
|
+
target="_blank"
|
|
139
|
+
>Join Discord server</a>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div className="sb-section-item">
|
|
143
|
+
|
|
144
|
+
<div>
|
|
145
|
+
Watch tutorials, feature previews and interviews.
|
|
146
|
+
|
|
147
|
+
<a
|
|
148
|
+
href="https://www.youtube.com/@chromaticui"
|
|
149
|
+
target="_blank"
|
|
150
|
+
>Watch on YouTube</a>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
<div className="sb-section-item">
|
|
154
|
+
|
|
155
|
+
<p>Follow guided walkthroughs on for key workflows.</p>
|
|
156
|
+
|
|
157
|
+
<a
|
|
158
|
+
href="https://storybook.js.org/tutorials/"
|
|
159
|
+
target="_blank"
|
|
160
|
+
>Discover tutorials</a>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<style>
|
|
165
|
+
{`
|
|
166
|
+
.sb-container {
|
|
167
|
+
margin-bottom: 48px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.sb-section {
|
|
171
|
+
width: 100%;
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: row;
|
|
174
|
+
gap: 20px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
img {
|
|
178
|
+
object-fit: cover;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.sb-section-title {
|
|
182
|
+
margin-bottom: 32px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.sb-section a:not(h1 a, h2 a, h3 a) {
|
|
186
|
+
font-size: 14px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.sb-section-item, .sb-grid-item {
|
|
190
|
+
flex: 1;
|
|
191
|
+
display: flex;
|
|
192
|
+
flex-direction: column;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.sb-section-item-heading {
|
|
196
|
+
padding-top: 20px !important;
|
|
197
|
+
padding-bottom: 5px !important;
|
|
198
|
+
margin: 0 !important;
|
|
199
|
+
}
|
|
200
|
+
.sb-section-item-paragraph {
|
|
201
|
+
margin: 0;
|
|
202
|
+
padding-bottom: 10px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.sb-chevron {
|
|
206
|
+
margin-left: 5px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.sb-features-grid {
|
|
210
|
+
display: grid;
|
|
211
|
+
grid-template-columns: repeat(2, 1fr);
|
|
212
|
+
grid-gap: 32px 20px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.sb-socials {
|
|
216
|
+
display: grid;
|
|
217
|
+
grid-template-columns: repeat(4, 1fr);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.sb-socials p {
|
|
221
|
+
margin-bottom: 10px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.sb-explore-image {
|
|
225
|
+
max-height: 32px;
|
|
226
|
+
align-self: flex-start;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.sb-addon {
|
|
230
|
+
width: 100%;
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
233
|
+
position: relative;
|
|
234
|
+
background-color: #EEF3F8;
|
|
235
|
+
border-radius: 5px;
|
|
236
|
+
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
237
|
+
background: #EEF3F8;
|
|
238
|
+
height: 180px;
|
|
239
|
+
margin-bottom: 48px;
|
|
240
|
+
overflow: hidden;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.sb-addon-text {
|
|
244
|
+
padding-left: 48px;
|
|
245
|
+
max-width: 240px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.sb-addon-text h4 {
|
|
249
|
+
padding-top: 0px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.sb-addon-img {
|
|
253
|
+
position: absolute;
|
|
254
|
+
left: 345px;
|
|
255
|
+
top: 0;
|
|
256
|
+
height: 100%;
|
|
257
|
+
width: 200%;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.sb-addon-img img {
|
|
262
|
+
width: 650px;
|
|
263
|
+
transform: rotate(-15deg);
|
|
264
|
+
margin-left: 40px;
|
|
265
|
+
margin-top: -72px;
|
|
266
|
+
box-shadow: 0 0 1px rgba(255, 255, 255, 0);
|
|
267
|
+
backface-visibility: hidden;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@media screen and (max-width: 800px) {
|
|
271
|
+
.sb-addon-img {
|
|
272
|
+
left: 300px;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@media screen and (max-width: 600px) {
|
|
277
|
+
.sb-section {
|
|
278
|
+
flex-direction: column;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.sb-features-grid {
|
|
282
|
+
grid-template-columns: repeat(1, 1fr);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.sb-socials {
|
|
286
|
+
grid-template-columns: repeat(2, 1fr);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.sb-addon {
|
|
290
|
+
height: 280px;
|
|
291
|
+
align-items: flex-start;
|
|
292
|
+
padding-top: 32px;
|
|
293
|
+
overflow: hidden;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.sb-addon-text {
|
|
297
|
+
padding-left: 24px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.sb-addon-img {
|
|
301
|
+
right: 0;
|
|
302
|
+
left: 0;
|
|
303
|
+
top: 130px;
|
|
304
|
+
bottom: 0;
|
|
305
|
+
overflow: hidden;
|
|
306
|
+
height: auto;
|
|
307
|
+
width: 124%;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.sb-addon-img img {
|
|
311
|
+
width: 1200px;
|
|
312
|
+
transform: rotate(-12deg);
|
|
313
|
+
margin-left: 0;
|
|
314
|
+
margin-top: 48px;
|
|
315
|
+
margin-bottom: -40px;
|
|
316
|
+
margin-left: -24px;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
`}
|
|
320
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import GridContainer from './GridContainer.vue';
|
|
2
|
+
import TournamentCard from "../../Cards/TournamentCard/TournamentCard.vue";
|
|
3
|
+
import MockTournaments from '../../../mocks/tournamentMock.js';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Containers/GridContainer',
|
|
6
|
+
component: GridContainer,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {}
|
|
9
|
+
};
|
|
10
|
+
export const Default = {
|
|
11
|
+
args: {
|
|
12
|
+
items: MockTournaments,
|
|
13
|
+
component: 'TournamentCard'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export const EmptyBoard = {
|
|
17
|
+
args: {
|
|
18
|
+
tournaments: [],
|
|
19
|
+
component: 'TournamentCard'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export const WithTournaments = {
|
|
23
|
+
args: {
|
|
24
|
+
items: MockTournaments,
|
|
25
|
+
component: 'TournamentCard'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="border border-cloudy rounded-lg p-9 bg-white">
|
|
3
|
+
<h1 class="w-full text-center mb-9">
|
|
4
|
+
<BaseText color="primary" size="2xl" text="Upcoming Tournaments" weight="normal" />
|
|
5
|
+
</h1>
|
|
6
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 gap-6 w-full">
|
|
7
|
+
<div v-for="item in items" :key="item.id">
|
|
8
|
+
<component :is="component" :detail="item" />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import BaseText from "../../Base/Text/BaseText.vue";
|
|
17
|
+
import TournamentCard from "../../Cards/TournamentCard/TournamentCard.vue";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'GridContainer',
|
|
21
|
+
components: {
|
|
22
|
+
BaseText,
|
|
23
|
+
TournamentCard
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
items: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: () => []
|
|
29
|
+
},
|
|
30
|
+
component: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import FilterAndSortBar from './FilterAndSortBar.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: '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,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="flex flex-row w-full justify-between">
|
|
3
|
+
<div class="rounded-lg shadow px-2 py-1 w-1/2 flex flex-row mt-0.5">
|
|
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" />
|
|
6
|
+
</div>
|
|
7
|
+
<div>
|
|
8
|
+
<DropDownMenu :label="label" :items="items" :selectedItem="selectedItem" />
|
|
9
|
+
</div>
|
|
10
|
+
</section>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import BaseInput from "../../Base/Input/BaseInput.vue";
|
|
15
|
+
import DropDownMenu from "../../Menu/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
|
+
methods: {
|
|
34
|
+
handleButtonClick(button) {
|
|
35
|
+
this.$emit('button-click', button);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import AdminLeftMenu from './AdminLeftMenu.vue';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Menu/Admin/AdminLeftMenu',
|
|
4
|
+
component: AdminLeftMenu,
|
|
5
|
+
tags: ['autodocs']
|
|
6
|
+
};
|
|
7
|
+
const Template = args => ({
|
|
8
|
+
components: { AdminLeftMenu },
|
|
9
|
+
setup() {
|
|
10
|
+
return { args };
|
|
11
|
+
},
|
|
12
|
+
methods: {
|
|
13
|
+
onMenuClick(index) {
|
|
14
|
+
alert(`Button ${index + 1} clicked!`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const Default = {
|
|
20
|
+
args: {
|
|
21
|
+
buttons: [{ label: 'Button 1' }, { label: 'Button 2' }, { label: 'Button 3' }]
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bg-backgroundSecondary w-64 h-screen flex flex-col justify-between bg-secondary">
|
|
3
|
+
<section class="h-28 border-b-2 border-borderPrimary">
|
|
4
|
+
<div class="flex flex-col justify-center h-28">
|
|
5
|
+
<div class="ml-8">
|
|
6
|
+
<img class="w-32" src="https://ferrotas.com/assets/ferrotas-white-small-720502db.png" />
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</section>
|
|
10
|
+
<section class="flex flex-col p-2 h-full">
|
|
11
|
+
<BaseButton
|
|
12
|
+
v-for="button in buttons"
|
|
13
|
+
:label="button.label"
|
|
14
|
+
iconClass="fa-solid fa-trophy text-white"
|
|
15
|
+
type="admin"
|
|
16
|
+
hover="admin"
|
|
17
|
+
@click="handleButtonClick(button)"
|
|
18
|
+
/>
|
|
19
|
+
</section>
|
|
20
|
+
<section class="flex flex-col justify-end p-2 h-full">
|
|
21
|
+
<div class="border-t-2 border-borderPrimary pt-2">
|
|
22
|
+
<BaseButton
|
|
23
|
+
iconClass="fa-solid fa-circle-user text-textSecondary"
|
|
24
|
+
label="Account"
|
|
25
|
+
type="adminSecondary"
|
|
26
|
+
@click="handleButtonClick(button)"
|
|
27
|
+
/>
|
|
28
|
+
<BaseButton
|
|
29
|
+
iconClass="fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary"
|
|
30
|
+
label="Log Out"
|
|
31
|
+
type="adminSecondary"
|
|
32
|
+
@click="handleButtonClick(button)"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</section>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import BaseButton from "../../Base/Button/BaseButton.vue";
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
name: 'AdminLeftMenu',
|
|
44
|
+
components: { BaseButton },
|
|
45
|
+
props: {
|
|
46
|
+
buttons: {
|
|
47
|
+
type: Array,
|
|
48
|
+
default: () => []
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
handleButtonClick(button) {
|
|
53
|
+
this.$emit('button-click', button);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import DropDownMenu from './DropDownMenu.vue';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Menu/DropDown/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
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-row">
|
|
3
|
+
<span class="mr-2 pt-1">
|
|
4
|
+
<BaseText :text="label" color="quaternary" size="small" weight="normal" />
|
|
5
|
+
</span>
|
|
6
|
+
|
|
7
|
+
<span>
|
|
8
|
+
<div class="z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between" @click="handleDropDown()">
|
|
9
|
+
<BaseText :text="selectedItem.text" color="secondary" size="xs" weight="normal" />
|
|
10
|
+
<i class="fa-solid fa-chevron-down text-xs" />
|
|
11
|
+
</div>
|
|
12
|
+
<div v-if="isDropDownOpen" class="flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute">
|
|
13
|
+
<a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0">
|
|
14
|
+
<BaseText :text="item.text" color="primary" size="xs" weight="normal" />
|
|
15
|
+
</a>
|
|
16
|
+
</div>
|
|
17
|
+
</span>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import BaseText from "../../Base/Text/BaseText.vue";
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'DropDownMenu',
|
|
26
|
+
components: {BaseText},
|
|
27
|
+
props: {
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
},
|
|
31
|
+
items: {
|
|
32
|
+
type: Array
|
|
33
|
+
},
|
|
34
|
+
selectedItem: null
|
|
35
|
+
},
|
|
36
|
+
data: () => ({
|
|
37
|
+
isDropDownOpen: false
|
|
38
|
+
}),
|
|
39
|
+
methods: {
|
|
40
|
+
handleClick(item) {
|
|
41
|
+
this.isDropDownOpen = false;
|
|
42
|
+
console.log(`menu item clicked ${item}`);
|
|
43
|
+
},
|
|
44
|
+
handleDropDown() {
|
|
45
|
+
this.isDropDownOpen = !this.isDropDownOpen;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|