@dcrackel/hematournamentui 1.0.3 → 1.0.4
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/.eslintrc.js +18 -0
- package/.prettierignore +1 -0
- package/.storybook/main.js +1 -0
- package/.storybook/mockRoutes.js +9 -0
- package/dist/{my-library.es.js → HemaTouranmentUI-lib.es.js} +93 -116
- package/dist/HemaTouranmentUI-lib.umd.js +1 -0
- package/index.html +1 -1
- package/package.json +15 -8
- package/prettier.config.js +10 -0
- package/src/stories/Base/Button/BaseButton.test.js +146 -0
- package/src/stories/Base/Button/BaseButton.vue +26 -40
- package/src/stories/Base/Input/BaseInput.test.js +46 -0
- package/src/stories/Base/Tag/BaseTag.test.js +42 -0
- package/src/stories/Base/Text/BaseText.test.js +153 -0
- package/src/stories/Base/Text/BaseText.vue +4 -7
- package/src/stories/Breadcrumb/Admin/Breadcrumb.stories.js +41 -0
- package/src/stories/Breadcrumb/Admin/Breadcrumb.vue +31 -0
- package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +3 -3
- package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +1 -1
- package/src/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +32 -0
- package/src/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +40 -0
- package/src/stories/Menu/Admin/AdminLeftMenu.stories.js +6 -1
- package/src/stories/Menu/Admin/AdminLeftMenu.vue +3 -3
- package/src/stories/Menu/DropDown/DropDownMenu.vue +2 -5
- package/tailwind/output.css +44 -42
- package/vite.config.js +5 -2
- package/dist/my-library.umd.js +0 -1
- /package/{HemaTournamentUI/.gitattributes → .gitattributes} +0 -0
- /package/{HemaTournamentUI/LICENSE → LICENSE} +0 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true,
|
|
5
|
+
'jest/globals': true
|
|
6
|
+
},
|
|
7
|
+
extends: ['plugin:vue/vue3-recommended', 'eslint:recommended', 'plugin:jest/recommended', 'prettier', 'plugin:storybook/recommended'],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
parser: 'babel-eslint'
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
13
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
|
14
|
+
},
|
|
15
|
+
plugins: [
|
|
16
|
+
'jest'
|
|
17
|
+
]
|
|
18
|
+
}
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node_modules/
|
package/.storybook/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { withDirectives as I, openBlock as s, createElementBlock as c, vModelText as Q, reactive as
|
|
1
|
+
import { withDirectives as I, openBlock as s, createElementBlock as c, vModelText as Q, reactive as p, computed as y, normalizeClass as h, toDisplayString as k, resolveComponent as g, createCommentVNode as w, createVNode as d, createElementVNode as i, normalizeStyle as D, Fragment as B, renderList as x, createBlock as f, resolveDynamicComponent as E } from "vue";
|
|
2
2
|
const A = (e, t) => {
|
|
3
3
|
const r = e.__vccOpts || e;
|
|
4
4
|
for (const [o, u] of t)
|
|
5
5
|
r[o] = u;
|
|
6
6
|
return r;
|
|
7
|
-
},
|
|
7
|
+
}, S = {
|
|
8
8
|
name: "BaseInput",
|
|
9
9
|
props: {
|
|
10
10
|
placeholder: {
|
|
@@ -34,18 +34,18 @@ const A = (e, t) => {
|
|
|
34
34
|
}, 300);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
function
|
|
37
|
+
}, Y = ["placeholder"];
|
|
38
|
+
function v(e, t, r, o, u, n) {
|
|
39
39
|
return I((s(), c("input", {
|
|
40
40
|
class: "appearance-none focus:outline-none w-full text-sm",
|
|
41
41
|
placeholder: r.placeholder,
|
|
42
42
|
"onUpdate:modelValue": t[0] || (t[0] = (a) => u.internalValue = a),
|
|
43
43
|
onInput: t[1] || (t[1] = (...a) => n.onInput && n.onInput(...a))
|
|
44
|
-
}, null, 40,
|
|
44
|
+
}, null, 40, Y)), [
|
|
45
45
|
[Q, u.internalValue]
|
|
46
46
|
]);
|
|
47
47
|
}
|
|
48
|
-
const M = /* @__PURE__ */ A(
|
|
48
|
+
const M = /* @__PURE__ */ A(S, [["render", v]]), G = {
|
|
49
49
|
name: "BaseText",
|
|
50
50
|
props: {
|
|
51
51
|
text: {
|
|
@@ -64,7 +64,7 @@ const M = /* @__PURE__ */ A(v, [["render", Y]]), G = {
|
|
|
64
64
|
type: String,
|
|
65
65
|
default: "small",
|
|
66
66
|
validator: function(e) {
|
|
67
|
-
return ["xs", "
|
|
67
|
+
return ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"].indexOf(e) !== -1;
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
color: {
|
|
@@ -91,8 +91,8 @@ const M = /* @__PURE__ */ A(v, [["render", Y]]), G = {
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
setup(e) {
|
|
94
|
-
return e =
|
|
95
|
-
classes:
|
|
94
|
+
return e = p(e), {
|
|
95
|
+
classes: y(() => {
|
|
96
96
|
let t = "inline-block font-sans";
|
|
97
97
|
switch (e.color) {
|
|
98
98
|
case "neutral":
|
|
@@ -159,21 +159,18 @@ const M = /* @__PURE__ */ A(v, [["render", Y]]), G = {
|
|
|
159
159
|
case "extra-bold":
|
|
160
160
|
t += " font-extrabold";
|
|
161
161
|
break;
|
|
162
|
-
default:
|
|
163
|
-
t += " font-normal";
|
|
164
|
-
break;
|
|
165
162
|
}
|
|
166
163
|
switch (e.size) {
|
|
167
164
|
case "xs":
|
|
168
165
|
t += " text-xs";
|
|
169
166
|
break;
|
|
170
|
-
case "
|
|
167
|
+
case "sm":
|
|
171
168
|
t += " text-sm";
|
|
172
169
|
break;
|
|
173
|
-
case "
|
|
170
|
+
case "md":
|
|
174
171
|
t += " text-md";
|
|
175
172
|
break;
|
|
176
|
-
case "
|
|
173
|
+
case "lg":
|
|
177
174
|
t += " text-lg";
|
|
178
175
|
break;
|
|
179
176
|
case "xl":
|
|
@@ -199,9 +196,9 @@ function q(e, t, r, o, u, n) {
|
|
|
199
196
|
class: h(o.classes)
|
|
200
197
|
}, k(r.text), 3);
|
|
201
198
|
}
|
|
202
|
-
const
|
|
199
|
+
const b = /* @__PURE__ */ A(G, [["render", q]]), U = {
|
|
203
200
|
name: "base-button",
|
|
204
|
-
components: {
|
|
201
|
+
components: { BaseText: b },
|
|
205
202
|
props: {
|
|
206
203
|
label: {
|
|
207
204
|
type: String,
|
|
@@ -214,8 +211,9 @@ const p = /* @__PURE__ */ A(G, [["render", q]]), U = {
|
|
|
214
211
|
size: {
|
|
215
212
|
type: String,
|
|
216
213
|
validator: function(e) {
|
|
217
|
-
return ["xs", "
|
|
218
|
-
}
|
|
214
|
+
return ["xs", "sm", "md", "lg", "xl"].indexOf(e) !== -1;
|
|
215
|
+
},
|
|
216
|
+
default: "sm"
|
|
219
217
|
},
|
|
220
218
|
type: {
|
|
221
219
|
type: String,
|
|
@@ -223,12 +221,16 @@ const p = /* @__PURE__ */ A(G, [["render", q]]), U = {
|
|
|
223
221
|
validator: function(e) {
|
|
224
222
|
return ["primary", "secondary", "tertiary", "bright", "admin", "adminSecondary"].indexOf(e) !== -1;
|
|
225
223
|
}
|
|
224
|
+
},
|
|
225
|
+
selected: {
|
|
226
|
+
type: Boolean,
|
|
227
|
+
default: !1
|
|
226
228
|
}
|
|
227
229
|
},
|
|
228
230
|
emits: ["click"],
|
|
229
231
|
setup(e, { emit: t }) {
|
|
230
|
-
return e =
|
|
231
|
-
textColor:
|
|
232
|
+
return e = p(e), {
|
|
233
|
+
textColor: y(() => {
|
|
232
234
|
switch (e.type) {
|
|
233
235
|
case "primary":
|
|
234
236
|
return "primary";
|
|
@@ -242,71 +244,46 @@ const p = /* @__PURE__ */ A(G, [["render", q]]), U = {
|
|
|
242
244
|
return "neutral";
|
|
243
245
|
case "adminSecondary":
|
|
244
246
|
return "neutral";
|
|
245
|
-
default:
|
|
246
|
-
return "primary";
|
|
247
|
-
}
|
|
248
|
-
}),
|
|
249
|
-
hoverClass: m(() => {
|
|
250
|
-
switch (e.type) {
|
|
251
|
-
case "admin":
|
|
252
|
-
return "hover:text-secondary";
|
|
253
|
-
case "adminSecondary":
|
|
254
|
-
return "hover:text-tertiary";
|
|
255
|
-
default:
|
|
256
|
-
return "";
|
|
257
|
-
}
|
|
258
|
-
}),
|
|
259
|
-
hoverColor: m(() => {
|
|
260
|
-
switch (e.type) {
|
|
261
|
-
case "admin":
|
|
262
|
-
return "text-secondary";
|
|
263
|
-
case "adminSecondary":
|
|
264
|
-
return "text-tertiary";
|
|
265
|
-
default:
|
|
266
|
-
return null;
|
|
267
247
|
}
|
|
268
248
|
}),
|
|
269
|
-
classes:
|
|
270
|
-
let r = "px-2.5 mx-
|
|
249
|
+
classes: y(() => {
|
|
250
|
+
let r = "px-2.5 mx-1 inline-flex ";
|
|
271
251
|
switch (e.type) {
|
|
272
252
|
case "primary":
|
|
273
|
-
r += " py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center bg-
|
|
253
|
+
r += " py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary", e.selected ? r += " bg-dropdownSelect" : r += " bg-neutral";
|
|
274
254
|
break;
|
|
275
255
|
case "secondary":
|
|
276
|
-
r += " py-0.5 items-center gap-2.5 rounded-md text-center shadow
|
|
256
|
+
r += " py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral", e.selected ? r += " bg-dropdownSelect" : r += " bg-secondary";
|
|
277
257
|
break;
|
|
278
258
|
case "tertiary":
|
|
279
|
-
r += " py-0.5 items-center gap-2.5 rounded-md text-center justify-center
|
|
259
|
+
r += " py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary", e.selected ? r += " bg-primary" : r += " bg-tertiary";
|
|
280
260
|
break;
|
|
281
261
|
case "bright":
|
|
282
|
-
r += " py-0.5 items-center gap-2.5 rounded-md text-center justify-center
|
|
262
|
+
r += " py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral", e.selected ? r += " bg-primary" : r += " bg-bright";
|
|
283
263
|
break;
|
|
284
264
|
case "admin":
|
|
285
|
-
r += " py-2 items-center rounded-md gap-2.5 text-center
|
|
265
|
+
r += " py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight", e.selected, r += " bg-primary";
|
|
286
266
|
break;
|
|
287
267
|
case "adminSecondary":
|
|
288
|
-
r += " 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";
|
|
268
|
+
r += " 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", e.selected ? r += " bg-primary" : r += " bg-tertiary";
|
|
289
269
|
break;
|
|
290
270
|
}
|
|
291
271
|
switch (e.size) {
|
|
292
272
|
case "xs":
|
|
293
273
|
r += " text-xs";
|
|
294
274
|
break;
|
|
295
|
-
case "
|
|
275
|
+
case "sm":
|
|
296
276
|
r += " text-sm";
|
|
297
277
|
break;
|
|
298
|
-
case "
|
|
278
|
+
case "md":
|
|
299
279
|
r += " text-md";
|
|
300
280
|
break;
|
|
301
|
-
case "
|
|
281
|
+
case "lg":
|
|
302
282
|
r += " text-lg";
|
|
303
283
|
break;
|
|
304
284
|
case "xl":
|
|
305
285
|
r += " text-xl";
|
|
306
286
|
break;
|
|
307
|
-
default:
|
|
308
|
-
r += "";
|
|
309
|
-
break;
|
|
310
287
|
}
|
|
311
288
|
return r;
|
|
312
289
|
}),
|
|
@@ -317,8 +294,9 @@ const p = /* @__PURE__ */ A(G, [["render", q]]), U = {
|
|
|
317
294
|
}
|
|
318
295
|
};
|
|
319
296
|
function V(e, t, r, o, u, n) {
|
|
320
|
-
const a = g("
|
|
297
|
+
const a = g("BaseText");
|
|
321
298
|
return s(), c("button", {
|
|
299
|
+
"data-testid": "base-button",
|
|
322
300
|
class: h(o.classes),
|
|
323
301
|
type: "button",
|
|
324
302
|
onClick: t[0] || (t[0] = (...l) => o.onClick && o.onClick(...l))
|
|
@@ -328,6 +306,7 @@ function V(e, t, r, o, u, n) {
|
|
|
328
306
|
class: h([r.iconClass, "mr-2 hover:text-highlightedClass"])
|
|
329
307
|
}, null, 2)) : w("", !0),
|
|
330
308
|
d(a, {
|
|
309
|
+
"data-testid": "base-text",
|
|
331
310
|
color: o.textColor,
|
|
332
311
|
size: r.size,
|
|
333
312
|
text: r.label,
|
|
@@ -350,8 +329,8 @@ const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
|
|
|
350
329
|
}
|
|
351
330
|
},
|
|
352
331
|
setup(e) {
|
|
353
|
-
return e =
|
|
354
|
-
classes:
|
|
332
|
+
return e = p(e), {
|
|
333
|
+
classes: y(() => {
|
|
355
334
|
let t = "cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";
|
|
356
335
|
switch (e.backgroundColor) {
|
|
357
336
|
case "primary":
|
|
@@ -413,7 +392,7 @@ function j(e, t, r, o, u, n) {
|
|
|
413
392
|
class: "h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"
|
|
414
393
|
}, [
|
|
415
394
|
i("div", J, [
|
|
416
|
-
(s(!0), c(
|
|
395
|
+
(s(!0), c(B, null, x(r.tags, (l) => (s(), f(a, {
|
|
417
396
|
key: l,
|
|
418
397
|
label: l
|
|
419
398
|
}, null, 8, ["label"]))), 128))
|
|
@@ -425,7 +404,7 @@ const F = /* @__PURE__ */ A(K, [["render", j]]), O = {
|
|
|
425
404
|
name: "tournament-card-details",
|
|
426
405
|
components: {
|
|
427
406
|
BaseButton: _,
|
|
428
|
-
BaseText:
|
|
407
|
+
BaseText: b
|
|
429
408
|
},
|
|
430
409
|
props: {
|
|
431
410
|
detail: {
|
|
@@ -452,20 +431,20 @@ function N(e, t, r, o, u, n) {
|
|
|
452
431
|
d(a, {
|
|
453
432
|
text: r.detail.location,
|
|
454
433
|
color: "primary",
|
|
455
|
-
size: "
|
|
434
|
+
size: "sm",
|
|
456
435
|
weight: "normal"
|
|
457
436
|
}, null, 8, ["text"]),
|
|
458
437
|
i("div", z, [
|
|
459
438
|
d(a, {
|
|
460
439
|
text: `${r.detail.date}`,
|
|
461
440
|
color: "primaryHighlight",
|
|
462
|
-
size: "
|
|
441
|
+
size: "sm",
|
|
463
442
|
weight: "light"
|
|
464
443
|
}, null, 8, ["text"]),
|
|
465
444
|
d(a, {
|
|
466
445
|
text: `${r.detail.closes}`,
|
|
467
446
|
color: "primaryHighlight",
|
|
468
|
-
size: "
|
|
447
|
+
size: "sm",
|
|
469
448
|
weight: "light"
|
|
470
449
|
}, null, 8, ["text"])
|
|
471
450
|
]),
|
|
@@ -512,7 +491,7 @@ function ee(e, t, r, o, u, n) {
|
|
|
512
491
|
}
|
|
513
492
|
const te = /* @__PURE__ */ A(R, [["render", ee]]), re = {
|
|
514
493
|
name: "DropDownMenu",
|
|
515
|
-
components: { BaseText:
|
|
494
|
+
components: { BaseText: b },
|
|
516
495
|
props: {
|
|
517
496
|
label: {
|
|
518
497
|
type: String
|
|
@@ -538,38 +517,36 @@ const te = /* @__PURE__ */ A(R, [["render", ee]]), re = {
|
|
|
538
517
|
this.isDropDownOpen = !this.isDropDownOpen;
|
|
539
518
|
}
|
|
540
519
|
}
|
|
541
|
-
}, ae = { class: "flex flex-row" }, ne =
|
|
520
|
+
}, ae = { class: "flex flex-row" }, ne = /* @__PURE__ */ i("i", { class: "fa-solid fa-chevron-down text-xs" }, null, -1), le = {
|
|
542
521
|
key: 0,
|
|
543
|
-
class: "flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-
|
|
544
|
-
},
|
|
545
|
-
function
|
|
522
|
+
class: "flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"
|
|
523
|
+
}, se = ["onClick"];
|
|
524
|
+
function oe(e, t, r, o, u, n) {
|
|
546
525
|
const a = g("BaseText");
|
|
547
526
|
return s(), c("div", ae, [
|
|
548
|
-
i("span", ne, [
|
|
549
|
-
d(a, {
|
|
550
|
-
text: r.label,
|
|
551
|
-
color: "quaternary",
|
|
552
|
-
size: "small",
|
|
553
|
-
weight: "normal"
|
|
554
|
-
}, null, 8, ["text"])
|
|
555
|
-
]),
|
|
556
527
|
i("span", null, [
|
|
557
528
|
i("div", {
|
|
558
529
|
class: "z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between",
|
|
559
530
|
onClick: t[0] || (t[0] = (l) => n.handleDropDown())
|
|
560
531
|
}, [
|
|
532
|
+
d(a, {
|
|
533
|
+
text: r.label,
|
|
534
|
+
color: "quaternary",
|
|
535
|
+
size: "sm",
|
|
536
|
+
weight: "normal"
|
|
537
|
+
}, null, 8, ["text"]),
|
|
561
538
|
d(a, {
|
|
562
539
|
text: r.selectedItem.text,
|
|
563
540
|
color: "secondary",
|
|
564
541
|
size: "sm",
|
|
565
542
|
weight: "normal"
|
|
566
543
|
}, null, 8, ["text"]),
|
|
567
|
-
|
|
544
|
+
ne
|
|
568
545
|
]),
|
|
569
|
-
e.isDropDownOpen ? (s(), c("div",
|
|
570
|
-
(s(!0), c(
|
|
546
|
+
e.isDropDownOpen ? (s(), c("div", le, [
|
|
547
|
+
(s(!0), c(B, null, x(r.items, (l) => (s(), c("a", {
|
|
571
548
|
key: l.id,
|
|
572
|
-
onClick: (
|
|
549
|
+
onClick: (m) => n.handleClick(l),
|
|
573
550
|
class: "hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"
|
|
574
551
|
}, [
|
|
575
552
|
d(a, {
|
|
@@ -578,15 +555,15 @@ function ie(e, t, r, o, u, n) {
|
|
|
578
555
|
size: "xs",
|
|
579
556
|
weight: "normal"
|
|
580
557
|
}, null, 8, ["text"])
|
|
581
|
-
], 8,
|
|
558
|
+
], 8, se))), 128))
|
|
582
559
|
])) : w("", !0)
|
|
583
560
|
])
|
|
584
561
|
]);
|
|
585
562
|
}
|
|
586
|
-
const
|
|
563
|
+
const ie = /* @__PURE__ */ A(re, [["render", oe]]), ce = {
|
|
587
564
|
name: "FilterAndSortBar",
|
|
588
565
|
components: {
|
|
589
|
-
DropDownMenu:
|
|
566
|
+
DropDownMenu: ie,
|
|
590
567
|
BaseInput: M
|
|
591
568
|
},
|
|
592
569
|
data() {
|
|
@@ -612,12 +589,12 @@ const ce = /* @__PURE__ */ A(re, [["render", ie]]), de = {
|
|
|
612
589
|
this.$emit("sort", e), console.log("handleSelectedItem", e);
|
|
613
590
|
}
|
|
614
591
|
}
|
|
615
|
-
},
|
|
616
|
-
function
|
|
592
|
+
}, de = { class: "flex flex-row w-full justify-between" }, ue = { class: "rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4" }, ge = /* @__PURE__ */ i("i", { class: "fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1" }, null, -1);
|
|
593
|
+
function Ae(e, t, r, o, u, n) {
|
|
617
594
|
const a = g("BaseInput"), l = g("DropDownMenu");
|
|
618
|
-
return s(), c("section",
|
|
619
|
-
i("div",
|
|
620
|
-
|
|
595
|
+
return s(), c("section", de, [
|
|
596
|
+
i("div", ue, [
|
|
597
|
+
ge,
|
|
621
598
|
d(a, {
|
|
622
599
|
placeholder: "Search on Name, Location, or Date",
|
|
623
600
|
class: "text-quaternary",
|
|
@@ -635,11 +612,11 @@ function me(e, t, r, o, u, n) {
|
|
|
635
612
|
])
|
|
636
613
|
]);
|
|
637
614
|
}
|
|
638
|
-
const
|
|
615
|
+
const me = /* @__PURE__ */ A(ce, [["render", Ae]]), ye = {
|
|
639
616
|
name: "GridContainer",
|
|
640
617
|
components: {
|
|
641
|
-
FilterAndSortBar:
|
|
642
|
-
BaseText:
|
|
618
|
+
FilterAndSortBar: me,
|
|
619
|
+
BaseText: b,
|
|
643
620
|
TournamentCard: te
|
|
644
621
|
},
|
|
645
622
|
props: {
|
|
@@ -699,10 +676,10 @@ const ye = /* @__PURE__ */ A(de, [["render", me]]), he = {
|
|
|
699
676
|
this.sortCriteria = e.text;
|
|
700
677
|
}
|
|
701
678
|
}
|
|
702
|
-
},
|
|
703
|
-
function
|
|
679
|
+
}, he = { class: "border border-dropdownSelect rounded-lg p-9 bg-neutral" }, Be = { class: "w-full text-center mb-9" }, xe = { class: "my-4" }, be = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full" };
|
|
680
|
+
function pe(e, t, r, o, u, n) {
|
|
704
681
|
const a = g("BaseText"), l = g("FilterAndSortBar");
|
|
705
|
-
return s(), c("div",
|
|
682
|
+
return s(), c("div", he, [
|
|
706
683
|
i("h1", Be, [
|
|
707
684
|
d(a, {
|
|
708
685
|
color: "primaryHighlight",
|
|
@@ -711,7 +688,7 @@ function fe(e, t, r, o, u, n) {
|
|
|
711
688
|
weight: "normal"
|
|
712
689
|
})
|
|
713
690
|
]),
|
|
714
|
-
i("div",
|
|
691
|
+
i("div", xe, [
|
|
715
692
|
d(l, {
|
|
716
693
|
items: r.dropdownItems,
|
|
717
694
|
label: r.label,
|
|
@@ -721,15 +698,15 @@ function fe(e, t, r, o, u, n) {
|
|
|
721
698
|
}, null, 8, ["items", "label", "selectedItem", "onFilterbar", "onSort"])
|
|
722
699
|
]),
|
|
723
700
|
i("div", be, [
|
|
724
|
-
(s(!0), c(
|
|
725
|
-
key:
|
|
701
|
+
(s(!0), c(B, null, x(n.filteredItems, (m) => (s(), c("div", {
|
|
702
|
+
key: m.id
|
|
726
703
|
}, [
|
|
727
|
-
(s(), f(E(r.component), { detail:
|
|
704
|
+
(s(), f(E(r.component), { detail: m }, null, 8, ["detail"]))
|
|
728
705
|
]))), 128))
|
|
729
706
|
])
|
|
730
707
|
]);
|
|
731
708
|
}
|
|
732
|
-
const
|
|
709
|
+
const Ee = /* @__PURE__ */ A(ye, [["render", pe]]), fe = {
|
|
733
710
|
name: "AdminLeftMenu",
|
|
734
711
|
components: { BaseButton: _ },
|
|
735
712
|
props: {
|
|
@@ -743,7 +720,7 @@ const ve = /* @__PURE__ */ A(he, [["render", fe]]), Ce = {
|
|
|
743
720
|
this.$emit("button-click", e);
|
|
744
721
|
}
|
|
745
722
|
}
|
|
746
|
-
},
|
|
723
|
+
}, Ce = { class: "bg-secondary w-64 h-screen flex flex-col justify-between" }, ke = /* @__PURE__ */ i("section", { class: "h-28 border-b border-neutral" }, [
|
|
747
724
|
/* @__PURE__ */ i("div", { class: "flex flex-col justify-center h-28" }, [
|
|
748
725
|
/* @__PURE__ */ i("div", { class: "ml-8" }, [
|
|
749
726
|
/* @__PURE__ */ i("img", {
|
|
@@ -753,22 +730,22 @@ const ve = /* @__PURE__ */ A(he, [["render", fe]]), Ce = {
|
|
|
753
730
|
})
|
|
754
731
|
])
|
|
755
732
|
])
|
|
756
|
-
], -1),
|
|
757
|
-
function
|
|
733
|
+
], -1), we = { class: "flex flex-col p-2 h-full" }, _e = { class: "flex flex-col justify-end p-2 flex-grow" }, Ie = { class: "border-t border-neutral pt-2" };
|
|
734
|
+
function Qe(e, t, r, o, u, n) {
|
|
758
735
|
const a = g("BaseButton");
|
|
759
|
-
return s(), c("div",
|
|
760
|
-
|
|
761
|
-
i("section",
|
|
762
|
-
(s(!0), c(
|
|
736
|
+
return s(), c("div", Ce, [
|
|
737
|
+
ke,
|
|
738
|
+
i("section", we, [
|
|
739
|
+
(s(!0), c(B, null, x(r.buttons, (l) => (s(), f(a, {
|
|
763
740
|
label: l.label,
|
|
764
741
|
iconClass: "fa-solid fa-trophy text-white",
|
|
765
742
|
type: "admin",
|
|
766
743
|
hover: "admin",
|
|
767
|
-
onClick: (
|
|
744
|
+
onClick: (m) => n.handleButtonClick(l)
|
|
768
745
|
}, null, 8, ["label", "onClick"]))), 256))
|
|
769
746
|
]),
|
|
770
|
-
i("section",
|
|
771
|
-
i("div",
|
|
747
|
+
i("section", _e, [
|
|
748
|
+
i("div", Ie, [
|
|
772
749
|
d(a, {
|
|
773
750
|
iconClass: "fa-solid fa-circle-user text-textSecondary",
|
|
774
751
|
label: "Account",
|
|
@@ -785,16 +762,16 @@ function De(e, t, r, o, u, n) {
|
|
|
785
762
|
])
|
|
786
763
|
]);
|
|
787
764
|
}
|
|
788
|
-
const Se = /* @__PURE__ */ A(
|
|
765
|
+
const Se = /* @__PURE__ */ A(fe, [["render", Qe]]);
|
|
789
766
|
export {
|
|
790
767
|
Se as AdminLeftMenu,
|
|
791
768
|
_ as BaseButton,
|
|
792
769
|
M as BaseInput,
|
|
793
770
|
W as BaseTag,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
771
|
+
b as BaseText,
|
|
772
|
+
ie as DropDownMenu,
|
|
773
|
+
me as FilterAndSortBar,
|
|
774
|
+
Ee as GridContainer,
|
|
798
775
|
te as TournamentCard,
|
|
799
776
|
Z as TournamentCardDetails,
|
|
800
777
|
F as TournamentCardHeader
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.HemaTournamentUI={},c.Vue))})(this,function(c,e){"use strict";const d=(t,r)=>{const a=t.__vccOpts||t;for(const[s,i]of r)a[s]=i;return a},k={name:"BaseInput",props:{placeholder:{type:String,default:""},value:{type:String,default:""}},data(){return{internalValue:this.value,timeout:null}},watch:{value(t){this.internalValue=t}},methods:{onInput(){clearTimeout(this.timeout),this.timeout=setTimeout(()=>{console.log("this.internalValue",this.internalValue),this.$emit("update:value",this.internalValue)},300)}}},C=["placeholder"];function w(t,r,a,s,i,l){return e.withDirectives((e.openBlock(),e.createElementBlock("input",{class:"appearance-none focus:outline-none w-full text-sm",placeholder:a.placeholder,"onUpdate:modelValue":r[0]||(r[0]=n=>i.internalValue=n),onInput:r[1]||(r[1]=(...n)=>l.onInput&&l.onInput(...n))},null,40,C)),[[e.vModelText,i.internalValue]])}const B=d(k,[["render",w]]),_={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(t){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(t)!==-1}},size:{type:String,default:"small",validator:function(t){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(t)!==-1}},color:{type:String,default:"primary",validator:function(t){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight"].indexOf(t)!==-1}},hoverColor:{type:String,default:"none",validator:function(t){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(t)!==-1}}},setup(t){return t=e.reactive(t),{classes:e.computed(()=>{let r="inline-block font-sans";switch(t.color){case"neutral":r+=" text-neutral";break;case"tertiary":r+=" text-tertiary";break;case"secondary":r+=" text-secondary";break;case"quaternary":r+=" text-quaternary";break;case"primary":r+=" text-primary";break;case"primaryHighlight":r+=" text-primaryHighlight";break;case"bright":r+=" text-bright";break}switch(t.hoverColor){case"neutral":r+=" hover:text-neutral";break;case"tertiary":r+=" hover:text-tertiary";break;case"secondary":r+=" hover:text-secondary";break;case"quaternary":r+=" hover:text-quaternary";break;case"primary":r+=" hover:text-primary";break;case"bright":r+=" hover:text-bright";break;case"none":r+="";break}switch(t.weight){case"light":r+=" font-light";break;case"normal":r+=" font-normal";break;case"medium":r+=" font-medium";break;case"semi-bold":r+=" font-semibold";break;case"bold":r+=" font-bold";break;case"extra-bold":r+=" font-extrabold";break}switch(t.size){case"xs":r+=" text-xs";break;case"sm":r+=" text-sm";break;case"md":r+=" text-md";break;case"lg":r+=" text-lg";break;case"xl":r+=" text-xl";break;case"2xl":r+=" text-2xl";break;case"3xl":r+=" text-3xl";break;default:r+=" text-sm";break}return r})}}};function I(t,r,a,s,i,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.classes)},e.toDisplayString(a.text),3)}const m=d(_,[["render",I]]),E={name:"base-button",components:{BaseText:m},props:{label:{type:String,required:!0},iconClass:{type:String,default:null},size:{type:String,validator:function(t){return["xs","sm","md","lg","xl"].indexOf(t)!==-1},default:"sm"},type:{type:String,default:"primary",validator:function(t){return["primary","secondary","tertiary","bright","admin","adminSecondary"].indexOf(t)!==-1}},selected:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:r}){return t=e.reactive(t),{textColor:e.computed(()=>{switch(t.type){case"primary":return"primary";case"secondary":return"secondary";case"tertiary":return"tertiary";case"bright":return"bright";case"admin":return"neutral";case"adminSecondary":return"neutral"}}),classes:e.computed(()=>{let a="px-2.5 mx-1 inline-flex ";switch(t.type){case"primary":a+=" py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary",t.selected?a+=" bg-dropdownSelect":a+=" bg-neutral";break;case"secondary":a+=" py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral",t.selected?a+=" bg-dropdownSelect":a+=" bg-secondary";break;case"tertiary":a+=" py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary",t.selected?a+=" bg-primary":a+=" bg-tertiary";break;case"bright":a+=" py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral",t.selected?a+=" bg-primary":a+=" bg-bright";break;case"admin":a+=" py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight",t.selected,a+=" bg-primary";break;case"adminSecondary":a+=" 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",t.selected?a+=" bg-primary":a+=" bg-tertiary";break}switch(t.size){case"xs":a+=" text-xs";break;case"sm":a+=" text-sm";break;case"md":a+=" text-md";break;case"lg":a+=" text-lg";break;case"xl":a+=" text-xl";break}return a}),onClick(){console.log("Click!"),r("click")}}}};function Q(t,r,a,s,i,l){const n=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("button",{"data-testid":"base-button",class:e.normalizeClass(s.classes),type:"button",onClick:r[0]||(r[0]=(...o)=>s.onClick&&s.onClick(...o))},[a.iconClass?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([a.iconClass,"mr-2 hover:text-highlightedClass"])},null,2)):e.createCommentVNode("",!0),e.createVNode(n,{"data-testid":"base-text",color:s.textColor,size:a.size,text:a.label,weight:"normal"},null,8,["color","size","text"])],2)}const A=d(E,[["render",Q]]),D={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(t){return["primary","secondary","tertiary","neutral","bright"].indexOf(t)!==-1}}},setup(t){return t=e.reactive(t),{classes:e.computed(()=>{let r="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(t.backgroundColor){case"primary":r+=" bg-primary";break;case"secondary":r+=" bg-secondary";break;case"tertiary":r+=" bg-tertiary";break;case"neutral":r+=" bg-neutral";break;case"bright":r+=" bg-bright";break;default:r+=" bg-primary";break}return r})}}};function V(t,r,a,s,i,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(s.classes)},e.toDisplayString(a.label),3)}const y=d(D,[["render",V]]),h="data:image/png;base64,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",S={name:"tournament-card-header",components:{BaseTag:y},props:{artwork:{type:String,required:!0,default:h},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||h}');`}}},Y={class:"rounded-t-xl w-full"},M={class:"flex flex-row"};function G(t,r,a,s,i,l){const n=e.resolveComponent("BaseTag");return e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",{style:e.normalizeStyle(l.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tags,o=>(e.openBlock(),e.createBlock(n,{key:o,label:o},null,8,["label"]))),128))])],4)])}const p=d(S,[["render",G]]),q={name:"tournament-card-details",components:{BaseButton:A,BaseText:m},props:{detail:{type:Object,required:!0,default:()=>({name:"",date:"",closes:"",location:""})}}},U={class:"flex flex-col w-full pt-4 pb-3 px-3"},N={class:"mt-4 flex flex-col"},T={class:"flex flex-row w-full justify-end"};function $(t,r,a,s,i,l){const n=e.resolveComponent("BaseText"),o=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("div",U,[e.createVNode(n,{text:a.detail.name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),e.createVNode(n,{text:a.detail.location,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),e.createElementVNode("div",N,[e.createVNode(n,{text:`${a.detail.date}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),e.createVNode(n,{text:`${a.detail.closes}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),e.createElementVNode("div",T,[e.createVNode(o,{label:"Edit",class:"mt-2",primary:""})])])}const u=d(q,[["render",$]]),W={name:"TournamentCard",components:{TournamentHeader:p,TournamentDetail:u},props:{detail:{type:Object,required:!0,default:()=>({artwork:"",tags:[],name:"",description:"",date:"",closes:"",location:""})}}},K={class:"rounded-xl w-72 shadow"};function H(t,r,a,s,i,l){const n=e.resolveComponent("TournamentHeader"),o=e.resolveComponent("TournamentDetail");return e.openBlock(),e.createElementBlock("div",K,[e.createVNode(n,{artwork:a.detail.artwork,tags:a.detail.tags},null,8,["artwork","tags"]),e.createVNode(o,{detail:a.detail},null,8,["detail"])])}const b=d(W,[["render",H]]),F={name:"DropDownMenu",components:{BaseText:m},props:{label:{type:String},items:{type:Array,validator:t=>t.every(r=>typeof r.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:t=>typeof t.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(t){this.isDropDownOpen=!1,this.$emit("update:selectedItem",t)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},j={class:"flex flex-row"},J=e.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),L={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},O=["onClick"];function P(t,r,a,s,i,l){const n=e.resolveComponent("BaseText");return e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("span",null,[e.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between",onClick:r[0]||(r[0]=o=>l.handleDropDown())},[e.createVNode(n,{text:a.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),e.createVNode(n,{text:a.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),J]),t.isDropDownOpen?(e.openBlock(),e.createElementBlock("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,o=>(e.openBlock(),e.createElementBlock("a",{key:o.id,onClick:g=>l.handleClick(o),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[e.createVNode(n,{text:o.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,O))),128))])):e.createCommentVNode("",!0)])])}const x=d(F,[["render",P]]),z={name:"FilterAndSortBar",components:{DropDownMenu:x,BaseInput:B},data(){return{filterText:""}},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},methods:{handleFilter(t){this.$emit("filterbar",t)},handleSelectedItem(t){this.$emit("sort",t),console.log("handleSelectedItem",t)}}},Z={class:"flex flex-row w-full justify-between"},R={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},X=e.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function v(t,r,a,s,i,l){const n=e.resolveComponent("BaseInput"),o=e.resolveComponent("DropDownMenu");return e.openBlock(),e.createElementBlock("section",Z,[e.createElementVNode("div",R,[X,e.createVNode(n,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary",value:i.filterText,"onUpdate:value":l.handleFilter},null,8,["value","onUpdate:value"])]),e.createElementVNode("div",null,[e.createVNode(o,{label:a.label,items:a.items,selectedItem:a.selectedItem,"onUpdate:selectedItem":l.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const f=d(z,[["render",v]]),ee={name:"GridContainer",components:{FilterAndSortBar:f,BaseText:m,TournamentCard:b},props:{items:{type:Array,default:()=>[]},component:{type:String,required:!0},label:{type:String},dropdownItems:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterOn:"",sortCriteria:"Date"}},computed:{filteredItems(){let t=this.items;if(this.filterOn.trim()){const r=this.filterOn.toLowerCase();t=t.filter(a=>Object.values(a).some(s=>typeof s=="string"&&s.toLowerCase().includes(r)))}switch(this.sortCriteria){case"Date":t=[...t].sort((r,a)=>new Date(r.date)-new Date(a.date));break;case"Name":t=[...t].sort((r,a)=>r.name.localeCompare(a.name));break;case"Location":t=[...t].sort((r,a)=>r.location.localeCompare(a.location));break}return t}},methods:{handleFilter(t){this.filterOn=t},handleSort(t){this.sortCriteria=t.text}}},te={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},re={class:"w-full text-center mb-9"},ae={class:"my-4"},ne={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full"};function le(t,r,a,s,i,l){const n=e.resolveComponent("BaseText"),o=e.resolveComponent("FilterAndSortBar");return e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("h1",re,[e.createVNode(n,{color:"primaryHighlight",size:"2xl",text:"Upcoming Tournaments",weight:"normal"})]),e.createElementVNode("div",ae,[e.createVNode(o,{items:a.dropdownItems,label:a.label,selectedItem:a.selectedItem,onFilterbar:l.handleFilter,onSort:l.handleSort},null,8,["items","label","selectedItem","onFilterbar","onSort"])]),e.createElementVNode("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.filteredItems,g=>(e.openBlock(),e.createElementBlock("div",{key:g.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component),{detail:g},null,8,["detail"]))]))),128))])])}const oe=d(ee,[["render",le]]),se={name:"AdminLeftMenu",components:{BaseButton:A},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(t){this.$emit("button-click",t)}}},ce={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},ie=e.createElementVNode("section",{class:"h-28 border-b border-neutral"},[e.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[e.createElementVNode("div",{class:"ml-8"},[e.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),de={class:"flex flex-col p-2 h-full"},me={class:"flex flex-col justify-end p-2 flex-grow"},ge={class:"border-t border-neutral pt-2"};function Ae(t,r,a,s,i,l){const n=e.resolveComponent("BaseButton");return e.openBlock(),e.createElementBlock("div",ce,[ie,e.createElementVNode("section",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.buttons,o=>(e.openBlock(),e.createBlock(n,{label:o.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:g=>l.handleButtonClick(o)},null,8,["label","onClick"]))),256))]),e.createElementVNode("section",me,[e.createElementVNode("div",ge,[e.createVNode(n,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:r[0]||(r[0]=o=>l.handleButtonClick(t.button))}),e.createVNode(n,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:r[1]||(r[1]=o=>l.handleButtonClick(t.button))})])])])}const Be=d(se,[["render",Ae]]);c.AdminLeftMenu=Be,c.BaseButton=A,c.BaseInput=B,c.BaseTag=y,c.BaseText=m,c.DropDownMenu=x,c.FilterAndSortBar=f,c.GridContainer=oe,c.TournamentCard=b,c.TournamentCardDetails=u,c.TournamentCardHeader=p,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
package/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcrackel/hematournamentui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/my-library.umd.js",
|
|
7
7
|
"module": "dist/my-library.es.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "vite",
|
|
10
10
|
"build": "vite build",
|
|
11
|
+
"publish:package": "npm publish",
|
|
11
12
|
"preview": "vite preview",
|
|
12
13
|
"build-storybook": "npm run build:tailwind && storybook build",
|
|
13
14
|
"build:tailwind": "tailwindcss build ./tailwind/tailwind.css -o ./tailwind/output.css",
|
|
14
15
|
"storybook": "concurrently \"npm run watch:tailwind\" \"npm run watch:storybook\"",
|
|
15
16
|
"watch:storybook": "storybook dev -p 6006",
|
|
16
|
-
"watch:tailwind": "tailwindcss build ./tailwind/tailwind.css -o ./tailwind/output.css --watch"
|
|
17
|
+
"watch:tailwind": "tailwindcss build ./tailwind/tailwind.css -o ./tailwind/output.css --watch",
|
|
18
|
+
"test": "vitest",
|
|
19
|
+
"coverage": "vitest run --coverage"
|
|
17
20
|
},
|
|
18
21
|
"dependencies": {
|
|
22
|
+
"@storybook/addon-actions": "^7.4.5",
|
|
19
23
|
"concurrently": "^8.2.1",
|
|
20
24
|
"font-awesome": "^4.7.0",
|
|
25
|
+
"happy-dom": "^12.8.0",
|
|
21
26
|
"vue": "^3.3.4"
|
|
22
27
|
},
|
|
23
28
|
"devDependencies": {
|
|
@@ -25,18 +30,20 @@
|
|
|
25
30
|
"@storybook/addon-essentials": "^7.4.5",
|
|
26
31
|
"@storybook/addon-interactions": "^7.4.5",
|
|
27
32
|
"@storybook/addon-links": "^7.4.5",
|
|
33
|
+
"@storybook/addon-mdx-gfm": "^7.4.5",
|
|
28
34
|
"@storybook/blocks": "^7.4.5",
|
|
29
|
-
"@storybook/testing-library": "^0.2.
|
|
35
|
+
"@storybook/testing-library": "^0.2.2",
|
|
30
36
|
"@storybook/vue3": "^7.4.5",
|
|
31
37
|
"@storybook/vue3-vite": "^7.4.5",
|
|
32
38
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
39
|
+
"@vitest/coverage-v8": "^0.34.6",
|
|
40
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
41
|
+
"@vue/test-utils": "^2.4.0-alpha.2",
|
|
33
42
|
"autoprefixer": "^10.4.16",
|
|
34
|
-
"postcss": "^8.4.30",
|
|
35
|
-
"postcss-cli": "^10.1.0",
|
|
36
|
-
"react": "^18.2.0",
|
|
37
|
-
"react-dom": "^18.2.0",
|
|
38
43
|
"storybook": "^7.4.5",
|
|
44
|
+
"storybook-vue3-router": "^4.0.1",
|
|
39
45
|
"tailwindcss": "^3.3.3",
|
|
40
|
-
"vite": "^4.4.5"
|
|
46
|
+
"vite": "^4.4.5",
|
|
47
|
+
"vitest": "^0.34.6"
|
|
41
48
|
}
|
|
42
49
|
}
|