@dcrackel/hematournamentui 1.0.3 → 1.0.5

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 (30) hide show
  1. package/.eslintrc.js +18 -0
  2. package/.prettierignore +1 -0
  3. package/.storybook/main.js +1 -0
  4. package/.storybook/mockRoutes.js +9 -0
  5. package/dist/{my-library.es.js → HemaTouranmentUI-lib.es.js} +273 -223
  6. package/dist/HemaTouranmentUI-lib.umd.js +1 -0
  7. package/index.html +1 -1
  8. package/package.json +16 -9
  9. package/prettier.config.js +10 -0
  10. package/src/stories/Base/Button/BaseButton.test.js +146 -0
  11. package/src/stories/Base/Button/BaseButton.vue +26 -41
  12. package/src/stories/Base/Input/BaseInput.test.js +46 -0
  13. package/src/stories/Base/Tag/BaseTag.test.js +42 -0
  14. package/src/stories/Base/Text/BaseText.test.js +153 -0
  15. package/src/stories/Base/Text/BaseText.vue +4 -7
  16. package/src/stories/Breadcrumb/Admin/Breadcrumb.stories.js +41 -0
  17. package/src/stories/Breadcrumb/Admin/Breadcrumb.vue +31 -0
  18. package/src/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +3 -3
  19. package/src/stories/Containers/Grid/GridContainer.vue +22 -5
  20. package/src/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +1 -1
  21. package/src/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +32 -0
  22. package/src/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +46 -0
  23. package/src/stories/Menu/Admin/AdminLeftMenu.stories.js +6 -1
  24. package/src/stories/Menu/Admin/AdminLeftMenu.vue +3 -3
  25. package/src/stories/Menu/DropDown/DropDownMenu.vue +2 -5
  26. package/tailwind/output.css +44 -42
  27. package/vite.config.js +5 -2
  28. package/dist/my-library.umd.js +0 -1
  29. /package/{HemaTournamentUI/.gitattributes → .gitattributes} +0 -0
  30. /package/{HemaTournamentUI/LICENSE → LICENSE} +0 -0
@@ -1,10 +1,10 @@
1
- import { withDirectives as I, openBlock as s, createElementBlock as c, vModelText as Q, reactive as b, computed as m, normalizeClass as h, toDisplayString as k, resolveComponent as g, createCommentVNode as w, createVNode as d, createElementVNode as i, normalizeStyle as D, Fragment as x, renderList as B, createBlock as f, resolveDynamicComponent as E } from "vue";
2
- const A = (e, t) => {
1
+ import { withDirectives as D, openBlock as i, createElementBlock as u, vModelText as S, reactive as b, computed as h, normalizeClass as B, toDisplayString as k, resolveComponent as m, createCommentVNode as _, createVNode as d, createElementVNode as c, normalizeStyle as E, Fragment as x, renderList as p, createBlock as f, resolveDynamicComponent as v } from "vue";
2
+ const g = (e, t) => {
3
3
  const r = e.__vccOpts || e;
4
- for (const [o, u] of t)
5
- r[o] = u;
4
+ for (const [l, o] of t)
5
+ r[l] = o;
6
6
  return r;
7
- }, v = {
7
+ }, Y = {
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
- }, S = ["placeholder"];
38
- function Y(e, t, r, o, u, n) {
39
- return I((s(), c("input", {
37
+ }, M = ["placeholder"];
38
+ function G(e, t, r, l, o, a) {
39
+ return D((i(), u("input", {
40
40
  class: "appearance-none focus:outline-none w-full text-sm",
41
41
  placeholder: r.placeholder,
42
- "onUpdate:modelValue": t[0] || (t[0] = (a) => u.internalValue = a),
43
- onInput: t[1] || (t[1] = (...a) => n.onInput && n.onInput(...a))
44
- }, null, 40, S)), [
45
- [Q, u.internalValue]
42
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => o.internalValue = n),
43
+ onInput: t[1] || (t[1] = (...n) => a.onInput && a.onInput(...n))
44
+ }, null, 40, M)), [
45
+ [S, o.internalValue]
46
46
  ]);
47
47
  }
48
- const M = /* @__PURE__ */ A(v, [["render", Y]]), G = {
48
+ const I = /* @__PURE__ */ g(Y, [["render", G]]), U = {
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", "small", "medium", "large", "xl", "2xl", "3xl"].indexOf(e) !== -1;
67
+ return ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"].indexOf(e) !== -1;
68
68
  }
69
69
  },
70
70
  color: {
@@ -92,7 +92,7 @@ const M = /* @__PURE__ */ A(v, [["render", Y]]), G = {
92
92
  },
93
93
  setup(e) {
94
94
  return e = b(e), {
95
- classes: m(() => {
95
+ classes: h(() => {
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 "small":
167
+ case "sm":
171
168
  t += " text-sm";
172
169
  break;
173
- case "medium":
170
+ case "md":
174
171
  t += " text-md";
175
172
  break;
176
- case "large":
173
+ case "lg":
177
174
  t += " text-lg";
178
175
  break;
179
176
  case "xl":
@@ -194,14 +191,14 @@ const M = /* @__PURE__ */ A(v, [["render", Y]]), G = {
194
191
  };
195
192
  }
196
193
  };
197
- function q(e, t, r, o, u, n) {
198
- return s(), c("div", {
199
- class: h(o.classes)
194
+ function q(e, t, r, l, o, a) {
195
+ return i(), u("div", {
196
+ class: B(l.classes)
200
197
  }, k(r.text), 3);
201
198
  }
202
- const p = /* @__PURE__ */ A(G, [["render", q]]), U = {
199
+ const y = /* @__PURE__ */ g(U, [["render", q]]), T = {
203
200
  name: "base-button",
204
- components: { DefaultText: p },
201
+ components: { BaseText: y },
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", "small", "medium", "large", "xl"].indexOf(e) !== -1;
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
232
  return e = b(e), {
231
- textColor: m(() => {
233
+ textColor: h(() => {
232
234
  switch (e.type) {
233
235
  case "primary":
234
236
  return "primary";
@@ -242,100 +244,77 @@ 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
247
  }
248
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
- }
268
- }),
269
- classes: m(() => {
270
- let r = "px-2.5 mx-2 inline-flex ";
249
+ classes: h(() => {
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-neutral hover:bg-tertiary";
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 bg-secondary justify-center hover:bg-primary text-neutral";
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 bg-tertiary hover:bg-primary text-primary";
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 bg-bright hover:bg-primary text-neutral";
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 bg-primary hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight";
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 "small":
275
+ case "sm":
296
276
  r += " text-sm";
297
277
  break;
298
- case "medium":
278
+ case "md":
299
279
  r += " text-md";
300
280
  break;
301
- case "large":
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
  }),
313
290
  onClick() {
314
- console.log("Click!"), t("click");
291
+ t("click");
315
292
  }
316
293
  };
317
294
  }
318
295
  };
319
- function V(e, t, r, o, u, n) {
320
- const a = g("DefaultText");
321
- return s(), c("button", {
322
- class: h(o.classes),
296
+ function $(e, t, r, l, o, a) {
297
+ const n = m("BaseText");
298
+ return i(), u("button", {
299
+ "data-testid": "base-button",
300
+ class: B(l.classes),
323
301
  type: "button",
324
- onClick: t[0] || (t[0] = (...l) => o.onClick && o.onClick(...l))
302
+ onClick: t[0] || (t[0] = (...s) => l.onClick && l.onClick(...s))
325
303
  }, [
326
- r.iconClass ? (s(), c("i", {
304
+ r.iconClass ? (i(), u("i", {
327
305
  key: 0,
328
- class: h([r.iconClass, "mr-2 hover:text-highlightedClass"])
329
- }, null, 2)) : w("", !0),
330
- d(a, {
331
- color: o.textColor,
306
+ class: B([r.iconClass, "mr-2 hover:text-highlightedClass"])
307
+ }, null, 2)) : _("", !0),
308
+ d(n, {
309
+ "data-testid": "base-text",
310
+ color: l.textColor,
332
311
  size: r.size,
333
312
  text: r.label,
334
313
  weight: "normal"
335
314
  }, null, 8, ["color", "size", "text"])
336
315
  ], 2);
337
316
  }
338
- const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
317
+ const C = /* @__PURE__ */ g(T, [["render", $]]), V = {
339
318
  name: "base-tag",
340
319
  props: {
341
320
  label: {
@@ -351,7 +330,7 @@ const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
351
330
  },
352
331
  setup(e) {
353
332
  return e = b(e), {
354
- classes: m(() => {
333
+ classes: h(() => {
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":
@@ -378,12 +357,12 @@ const _ = /* @__PURE__ */ A(U, [["render", V]]), $ = {
378
357
  };
379
358
  }
380
359
  };
381
- function T(e, t, r, o, u, n) {
382
- return s(), c("div", {
383
- class: h(o.classes)
360
+ function F(e, t, r, l, o, a) {
361
+ return i(), u("div", {
362
+ class: B(l.classes)
384
363
  }, k(r.label), 3);
385
364
  }
386
- const W = /* @__PURE__ */ A($, [["render", T]]), C = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlAC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4p/0F3nyMcxwAAAABJRU5ErkJggg==", K = {
365
+ const W = /* @__PURE__ */ g(V, [["render", F]]), w = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjID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388
367
  components: {
389
368
  BaseTag: W
@@ -392,7 +371,7 @@ const W = /* @__PURE__ */ A($, [["render", T]]), C = "data:image/png;base64,iVBO
392
371
  artwork: {
393
372
  type: String,
394
373
  required: !0,
395
- default: C
374
+ default: w
396
375
  },
397
376
  tags: {
398
377
  type: Array,
@@ -401,31 +380,31 @@ const W = /* @__PURE__ */ A($, [["render", T]]), C = "data:image/png;base64,iVBO
401
380
  },
402
381
  computed: {
403
382
  backgroundStyle() {
404
- return `background-image: url('${this.artwork || C}');`;
383
+ return `background-image: url('${this.artwork || w}');`;
405
384
  }
406
385
  }
407
- }, H = { class: "rounded-t-xl w-full" }, J = { class: "flex flex-row" };
408
- function j(e, t, r, o, u, n) {
409
- const a = g("BaseTag");
410
- return s(), c("div", H, [
411
- i("div", {
412
- style: D(n.backgroundStyle),
386
+ }, H = { class: "rounded-t-xl w-full" }, P = { class: "flex flex-row" };
387
+ function j(e, t, r, l, o, a) {
388
+ const n = m("BaseTag");
389
+ return i(), u("div", H, [
390
+ c("div", {
391
+ style: E(a.backgroundStyle),
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
- i("div", J, [
416
- (s(!0), c(x, null, B(r.tags, (l) => (s(), f(a, {
417
- key: l,
418
- label: l
394
+ c("div", P, [
395
+ (i(!0), u(x, null, p(r.tags, (s) => (i(), f(n, {
396
+ key: s,
397
+ label: s
419
398
  }, null, 8, ["label"]))), 128))
420
399
  ])
421
400
  ], 4)
422
401
  ]);
423
402
  }
424
- const F = /* @__PURE__ */ A(K, [["render", j]]), O = {
403
+ const J = /* @__PURE__ */ g(K, [["render", j]]), z = {
425
404
  name: "tournament-card-details",
426
405
  components: {
427
- BaseButton: _,
428
- BaseText: p
406
+ BaseButton: C,
407
+ BaseText: y
429
408
  },
430
409
  props: {
431
410
  detail: {
@@ -439,38 +418,38 @@ const F = /* @__PURE__ */ A(K, [["render", j]]), O = {
439
418
  })
440
419
  }
441
420
  }
442
- }, P = { class: "flex flex-col w-full pt-4 pb-3 px-3" }, z = { class: "mt-4 flex flex-col" }, L = { class: "flex flex-row w-full justify-end" };
443
- function N(e, t, r, o, u, n) {
444
- const a = g("BaseText"), l = g("BaseButton");
445
- return s(), c("div", P, [
446
- d(a, {
421
+ }, O = { class: "flex flex-col w-full pt-4 pb-3 px-3" }, L = { class: "mt-4 flex flex-col" }, N = { class: "flex flex-row w-full justify-end" };
422
+ function Z(e, t, r, l, o, a) {
423
+ const n = m("BaseText"), s = m("BaseButton");
424
+ return i(), u("div", O, [
425
+ d(n, {
447
426
  text: r.detail.name,
448
427
  color: "primary",
449
428
  size: "xl",
450
429
  weight: "semi-bold"
451
430
  }, null, 8, ["text"]),
452
- d(a, {
431
+ d(n, {
453
432
  text: r.detail.location,
454
433
  color: "primary",
455
- size: "small",
434
+ size: "sm",
456
435
  weight: "normal"
457
436
  }, null, 8, ["text"]),
458
- i("div", z, [
459
- d(a, {
437
+ c("div", L, [
438
+ d(n, {
460
439
  text: `${r.detail.date}`,
461
440
  color: "primaryHighlight",
462
- size: "small",
441
+ size: "sm",
463
442
  weight: "light"
464
443
  }, null, 8, ["text"]),
465
- d(a, {
444
+ d(n, {
466
445
  text: `${r.detail.closes}`,
467
446
  color: "primaryHighlight",
468
- size: "small",
447
+ size: "sm",
469
448
  weight: "light"
470
449
  }, null, 8, ["text"])
471
450
  ]),
472
- i("div", L, [
473
- d(l, {
451
+ c("div", N, [
452
+ d(s, {
474
453
  label: "Edit",
475
454
  class: "mt-2",
476
455
  primary: ""
@@ -478,11 +457,11 @@ function N(e, t, r, o, u, n) {
478
457
  ])
479
458
  ]);
480
459
  }
481
- const Z = /* @__PURE__ */ A(O, [["render", N]]), R = {
460
+ const R = /* @__PURE__ */ g(z, [["render", Z]]), X = {
482
461
  name: "TournamentCard",
483
462
  components: {
484
- TournamentHeader: F,
485
- TournamentDetail: Z
463
+ TournamentHeader: J,
464
+ TournamentDetail: R
486
465
  },
487
466
  props: {
488
467
  detail: {
@@ -499,20 +478,20 @@ const Z = /* @__PURE__ */ A(O, [["render", N]]), R = {
499
478
  })
500
479
  }
501
480
  }
502
- }, X = { class: "rounded-xl w-72 shadow" };
503
- function ee(e, t, r, o, u, n) {
504
- const a = g("TournamentHeader"), l = g("TournamentDetail");
505
- return s(), c("div", X, [
506
- d(a, {
481
+ }, ee = { class: "rounded-xl w-72 shadow" };
482
+ function te(e, t, r, l, o, a) {
483
+ const n = m("TournamentHeader"), s = m("TournamentDetail");
484
+ return i(), u("div", ee, [
485
+ d(n, {
507
486
  artwork: r.detail.artwork,
508
487
  tags: r.detail.tags
509
488
  }, null, 8, ["artwork", "tags"]),
510
- d(l, { detail: r.detail }, null, 8, ["detail"])
489
+ d(s, { detail: r.detail }, null, 8, ["detail"])
511
490
  ]);
512
491
  }
513
- const te = /* @__PURE__ */ A(R, [["render", ee]]), re = {
492
+ const re = /* @__PURE__ */ g(X, [["render", te]]), ae = {
514
493
  name: "DropDownMenu",
515
- components: { BaseText: p },
494
+ components: { BaseText: y },
516
495
  props: {
517
496
  label: {
518
497
  type: String
@@ -538,27 +517,25 @@ 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 = { class: "mr-2 pt-1" }, le = /* @__PURE__ */ i("i", { class: "fa-solid fa-chevron-down text-xs" }, null, -1), se = {
520
+ }, ne = { class: "flex flex-row" }, le = /* @__PURE__ */ c("i", { class: "fa-solid fa-chevron-down text-xs" }, null, -1), se = {
542
521
  key: 0,
543
- class: "flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-white"
522
+ class: "flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"
544
523
  }, oe = ["onClick"];
545
- function ie(e, t, r, o, u, n) {
546
- const a = g("BaseText");
547
- 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
- i("span", null, [
557
- i("div", {
524
+ function ie(e, t, r, l, o, a) {
525
+ const n = m("BaseText");
526
+ return i(), u("div", ne, [
527
+ c("span", null, [
528
+ c("div", {
558
529
  class: "z-10 rounded-lg shadow px-2 py-2 w-32 flex flex-row justify-between",
559
- onClick: t[0] || (t[0] = (l) => n.handleDropDown())
530
+ onClick: t[0] || (t[0] = (s) => a.handleDropDown())
560
531
  }, [
561
- d(a, {
532
+ d(n, {
533
+ text: r.label,
534
+ color: "quaternary",
535
+ size: "sm",
536
+ weight: "normal"
537
+ }, null, 8, ["text"]),
538
+ d(n, {
562
539
  text: r.selectedItem.text,
563
540
  color: "secondary",
564
541
  size: "sm",
@@ -566,28 +543,28 @@ function ie(e, t, r, o, u, n) {
566
543
  }, null, 8, ["text"]),
567
544
  le
568
545
  ]),
569
- e.isDropDownOpen ? (s(), c("div", se, [
570
- (s(!0), c(x, null, B(r.items, (l) => (s(), c("a", {
571
- key: l.id,
572
- onClick: (y) => n.handleClick(l),
546
+ e.isDropDownOpen ? (i(), u("div", se, [
547
+ (i(!0), u(x, null, p(r.items, (s) => (i(), u("a", {
548
+ key: s.id,
549
+ onClick: (A) => a.handleClick(s),
573
550
  class: "hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"
574
551
  }, [
575
- d(a, {
576
- text: l.text,
552
+ d(n, {
553
+ text: s.text,
577
554
  color: "primary",
578
555
  size: "xs",
579
556
  weight: "normal"
580
557
  }, null, 8, ["text"])
581
558
  ], 8, oe))), 128))
582
- ])) : w("", !0)
559
+ ])) : _("", !0)
583
560
  ])
584
561
  ]);
585
562
  }
586
- const ce = /* @__PURE__ */ A(re, [["render", ie]]), de = {
563
+ const Q = /* @__PURE__ */ g(ae, [["render", ie]]), ce = {
587
564
  name: "FilterAndSortBar",
588
565
  components: {
589
- DropDownMenu: ce,
590
- BaseInput: M
566
+ DropDownMenu: Q,
567
+ BaseInput: I
591
568
  },
592
569
  data() {
593
570
  return {
@@ -612,35 +589,97 @@ const ce = /* @__PURE__ */ A(re, [["render", ie]]), de = {
612
589
  this.$emit("sort", e), console.log("handleSelectedItem", e);
613
590
  }
614
591
  }
615
- }, ue = { class: "flex flex-row w-full justify-between" }, ge = { class: "rounded-lg shadow px-2 py-1 w-1/2 flex flex-row mt-0.5" }, Ae = /* @__PURE__ */ i("i", { class: "fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1" }, null, -1);
616
- function me(e, t, r, o, u, n) {
617
- const a = g("BaseInput"), l = g("DropDownMenu");
618
- return s(), c("section", ue, [
619
- i("div", ge, [
620
- Ae,
621
- d(a, {
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" }, me = /* @__PURE__ */ c("i", { class: "fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1" }, null, -1);
593
+ function ge(e, t, r, l, o, a) {
594
+ const n = m("BaseInput"), s = m("DropDownMenu");
595
+ return i(), u("section", de, [
596
+ c("div", ue, [
597
+ me,
598
+ d(n, {
622
599
  placeholder: "Search on Name, Location, or Date",
623
600
  class: "text-quaternary",
624
- value: u.filterText,
625
- "onUpdate:value": n.handleFilter
601
+ value: o.filterText,
602
+ "onUpdate:value": a.handleFilter
626
603
  }, null, 8, ["value", "onUpdate:value"])
627
604
  ]),
628
- i("div", null, [
629
- d(l, {
605
+ c("div", null, [
606
+ d(s, {
630
607
  label: r.label,
631
608
  items: r.items,
632
609
  selectedItem: r.selectedItem,
633
- "onUpdate:selectedItem": n.handleSelectedItem
610
+ "onUpdate:selectedItem": a.handleSelectedItem
634
611
  }, null, 8, ["label", "items", "selectedItem", "onUpdate:selectedItem"])
635
612
  ])
636
613
  ]);
637
614
  }
638
- const ye = /* @__PURE__ */ A(de, [["render", me]]), he = {
615
+ const Ae = /* @__PURE__ */ g(ce, [["render", ge]]), ye = {
616
+ name: "FilterUpcomingPast",
617
+ components: {
618
+ BaseText: y,
619
+ BaseButton: C,
620
+ DropDownMenu: Q,
621
+ BaseInput: I
622
+ },
623
+ props: {
624
+ selected: {
625
+ type: String,
626
+ default: "All"
627
+ }
628
+ },
629
+ data() {
630
+ return {
631
+ localSelected: this.selected
632
+ };
633
+ },
634
+ methods: {
635
+ handleTimeFrame(e) {
636
+ this.$emit("timeFrame", e), this.localSelected = e;
637
+ }
638
+ }
639
+ }, he = { class: "flex flex-row w-full justify-between" }, Be = { class: "rounded-lg w-3/4" }, xe = { class: "flex flex-row h-8 w-1/4 justify-end" };
640
+ function pe(e, t, r, l, o, a) {
641
+ const n = m("BaseText"), s = m("BaseButton");
642
+ return i(), u("section", he, [
643
+ c("div", Be, [
644
+ d(n, {
645
+ text: "Tournament",
646
+ color: "primary",
647
+ size: "2xl",
648
+ weight: "normal"
649
+ })
650
+ ]),
651
+ c("div", xe, [
652
+ d(s, {
653
+ label: "All",
654
+ color: "primary",
655
+ size: "sm",
656
+ selected: o.localSelected === "All",
657
+ onClick: t[0] || (t[0] = (A) => a.handleTimeFrame("ALL"))
658
+ }, null, 8, ["selected"]),
659
+ d(s, {
660
+ label: "Upcoming",
661
+ color: "primary",
662
+ size: "sm",
663
+ selected: o.localSelected === "Upcoming",
664
+ onClick: t[1] || (t[1] = (A) => a.handleTimeFrame("Upcoming"))
665
+ }, null, 8, ["selected"]),
666
+ d(s, {
667
+ label: "Past",
668
+ color: "primary",
669
+ size: "sm",
670
+ selected: o.localSelected === "Past",
671
+ onClick: t[2] || (t[2] = (A) => a.handleTimeFrame("Past"))
672
+ }, null, 8, ["selected"])
673
+ ])
674
+ ]);
675
+ }
676
+ const be = /* @__PURE__ */ g(ye, [["render", pe]]), fe = {
639
677
  name: "GridContainer",
640
678
  components: {
641
- FilterAndSortBar: ye,
642
- BaseText: p,
643
- TournamentCard: te
679
+ FilterAndSortBar: Ae,
680
+ BaseText: y,
681
+ TournamentCard: re,
682
+ FilterUpcomingPast: be
644
683
  },
645
684
  props: {
646
685
  items: {
@@ -663,29 +702,39 @@ const ye = /* @__PURE__ */ A(de, [["render", me]]), he = {
663
702
  data() {
664
703
  return {
665
704
  filterOn: "",
666
- sortCriteria: "Date"
705
+ sortCriteria: "Date",
706
+ selectedTimeFrame: "All"
667
707
  };
668
708
  },
669
709
  computed: {
670
710
  filteredItems() {
671
711
  let e = this.items;
672
712
  if (this.filterOn.trim()) {
673
- const t = this.filterOn.toLowerCase();
713
+ const r = this.filterOn.toLowerCase();
674
714
  e = e.filter(
675
- (r) => Object.values(r).some(
676
- (o) => typeof o == "string" && o.toLowerCase().includes(t)
715
+ (l) => Object.values(l).some(
716
+ (o) => typeof o == "string" && o.toLowerCase().includes(r)
677
717
  )
678
718
  );
679
719
  }
720
+ const t = /* @__PURE__ */ new Date();
721
+ switch (t.setHours(0, 0, 0, 0), this.selectedTimeFrame) {
722
+ case "Upcoming":
723
+ e = e.filter((r) => new Date(r.date) >= t);
724
+ break;
725
+ case "Past":
726
+ e = e.filter((r) => new Date(r.date) < t);
727
+ break;
728
+ }
680
729
  switch (this.sortCriteria) {
681
730
  case "Date":
682
- e = [...e].sort((t, r) => new Date(t.date) - new Date(r.date));
731
+ e = [...e].sort((r, l) => new Date(r.date) - new Date(l.date));
683
732
  break;
684
733
  case "Name":
685
- e = [...e].sort((t, r) => t.name.localeCompare(r.name));
734
+ e = [...e].sort((r, l) => r.name.localeCompare(l.name));
686
735
  break;
687
736
  case "Location":
688
- e = [...e].sort((t, r) => t.location.localeCompare(r.location));
737
+ e = [...e].sort((r, l) => r.location.localeCompare(l.location));
689
738
  break;
690
739
  }
691
740
  return e;
@@ -697,41 +746,42 @@ const ye = /* @__PURE__ */ A(de, [["render", me]]), he = {
697
746
  },
698
747
  handleSort(e) {
699
748
  this.sortCriteria = e.text;
749
+ },
750
+ handleTimeFrameChange(e) {
751
+ this.selectedTimeFrame = e;
700
752
  }
701
753
  }
702
- }, xe = { class: "border border-dropdownSelect rounded-lg p-9 bg-neutral" }, Be = { class: "w-full text-center mb-9" }, pe = { 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" };
703
- function fe(e, t, r, o, u, n) {
704
- const a = g("BaseText"), l = g("FilterAndSortBar");
705
- return s(), c("div", xe, [
706
- i("h1", Be, [
707
- d(a, {
708
- color: "primaryHighlight",
709
- size: "2xl",
710
- text: "Upcoming Tournaments",
711
- weight: "normal"
712
- })
754
+ }, Ce = { class: "border border-dropdownSelect rounded-lg p-9 bg-neutral" }, we = { class: "my-4" }, ke = { class: "my-4" }, _e = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full" };
755
+ function Ie(e, t, r, l, o, a) {
756
+ const n = m("FilterUpcomingPast"), s = m("FilterAndSortBar");
757
+ return i(), u("div", Ce, [
758
+ c("div", we, [
759
+ d(n, {
760
+ selected: o.selectedTimeFrame,
761
+ onTimeFrame: a.handleTimeFrameChange
762
+ }, null, 8, ["selected", "onTimeFrame"])
713
763
  ]),
714
- i("div", pe, [
715
- d(l, {
764
+ c("div", ke, [
765
+ d(s, {
716
766
  items: r.dropdownItems,
717
767
  label: r.label,
718
768
  selectedItem: r.selectedItem,
719
- onFilterbar: n.handleFilter,
720
- onSort: n.handleSort
769
+ onFilterbar: a.handleFilter,
770
+ onSort: a.handleSort
721
771
  }, null, 8, ["items", "label", "selectedItem", "onFilterbar", "onSort"])
722
772
  ]),
723
- i("div", be, [
724
- (s(!0), c(x, null, B(n.filteredItems, (y) => (s(), c("div", {
725
- key: y.id
773
+ c("div", _e, [
774
+ (i(!0), u(x, null, p(a.filteredItems, (A) => (i(), u("div", {
775
+ key: A.id
726
776
  }, [
727
- (s(), f(E(r.component), { detail: y }, null, 8, ["detail"]))
777
+ (i(), f(v(r.component), { detail: A }, null, 8, ["detail"]))
728
778
  ]))), 128))
729
779
  ])
730
780
  ]);
731
781
  }
732
- const ve = /* @__PURE__ */ A(he, [["render", fe]]), Ce = {
782
+ const Ue = /* @__PURE__ */ g(fe, [["render", Ie]]), Qe = {
733
783
  name: "AdminLeftMenu",
734
- components: { BaseButton: _ },
784
+ components: { BaseButton: C },
735
785
  props: {
736
786
  buttons: {
737
787
  type: Array,
@@ -743,59 +793,59 @@ const ve = /* @__PURE__ */ A(he, [["render", fe]]), Ce = {
743
793
  this.$emit("button-click", e);
744
794
  }
745
795
  }
746
- }, ke = { class: "bg-secondary w-64 h-screen flex flex-col justify-between" }, we = /* @__PURE__ */ i("section", { class: "h-28 border-b-2 border-neutral" }, [
747
- /* @__PURE__ */ i("div", { class: "flex flex-col justify-center h-28" }, [
748
- /* @__PURE__ */ i("div", { class: "ml-8" }, [
749
- /* @__PURE__ */ i("img", {
796
+ }, De = { class: "bg-secondary w-64 h-screen flex flex-col justify-between" }, Se = /* @__PURE__ */ c("section", { class: "h-28 border-b border-neutral" }, [
797
+ /* @__PURE__ */ c("div", { class: "flex flex-col justify-center h-28" }, [
798
+ /* @__PURE__ */ c("div", { class: "ml-8" }, [
799
+ /* @__PURE__ */ c("img", {
750
800
  class: "w-32",
751
801
  src: "https://ferrotas.com/assets/ferrotas-white-small-720502db.png",
752
802
  alt: "logo"
753
803
  })
754
804
  ])
755
805
  ])
756
- ], -1), _e = { class: "flex flex-col p-2 h-full" }, Ie = { class: "flex flex-col justify-end p-2 h-full" }, Qe = { class: "border-t-2 border-neutral pt-2" };
757
- function De(e, t, r, o, u, n) {
758
- const a = g("BaseButton");
759
- return s(), c("div", ke, [
760
- we,
761
- i("section", _e, [
762
- (s(!0), c(x, null, B(r.buttons, (l) => (s(), f(a, {
763
- label: l.label,
806
+ ], -1), Ee = { class: "flex flex-col p-2 h-full" }, ve = { class: "flex flex-col justify-end p-2 flex-grow" }, Ye = { class: "border-t border-neutral pt-2" };
807
+ function Me(e, t, r, l, o, a) {
808
+ const n = m("BaseButton");
809
+ return i(), u("div", De, [
810
+ Se,
811
+ c("section", Ee, [
812
+ (i(!0), u(x, null, p(r.buttons, (s) => (i(), f(n, {
813
+ label: s.label,
764
814
  iconClass: "fa-solid fa-trophy text-white",
765
815
  type: "admin",
766
816
  hover: "admin",
767
- onClick: (y) => n.handleButtonClick(l)
817
+ onClick: (A) => a.handleButtonClick(s)
768
818
  }, null, 8, ["label", "onClick"]))), 256))
769
819
  ]),
770
- i("section", Ie, [
771
- i("div", Qe, [
772
- d(a, {
820
+ c("section", ve, [
821
+ c("div", Ye, [
822
+ d(n, {
773
823
  iconClass: "fa-solid fa-circle-user text-textSecondary",
774
824
  label: "Account",
775
825
  type: "adminSecondary",
776
- onClick: t[0] || (t[0] = (l) => n.handleButtonClick(e.button))
826
+ onClick: t[0] || (t[0] = (s) => a.handleButtonClick(e.button))
777
827
  }),
778
- d(a, {
828
+ d(n, {
779
829
  iconClass: "fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",
780
830
  label: "Log Out",
781
831
  type: "adminSecondary",
782
- onClick: t[1] || (t[1] = (l) => n.handleButtonClick(e.button))
832
+ onClick: t[1] || (t[1] = (s) => a.handleButtonClick(e.button))
783
833
  })
784
834
  ])
785
835
  ])
786
836
  ]);
787
837
  }
788
- const Se = /* @__PURE__ */ A(Ce, [["render", De]]);
838
+ const qe = /* @__PURE__ */ g(Qe, [["render", Me]]);
789
839
  export {
790
- Se as AdminLeftMenu,
791
- _ as BaseButton,
792
- M as BaseInput,
840
+ qe as AdminLeftMenu,
841
+ C as BaseButton,
842
+ I as BaseInput,
793
843
  W as BaseTag,
794
- p as BaseText,
795
- ce as DropDownMenu,
796
- ye as FilterAndSortBar,
797
- ve as GridContainer,
798
- te as TournamentCard,
799
- Z as TournamentCardDetails,
800
- F as TournamentCardHeader
844
+ y as BaseText,
845
+ Q as DropDownMenu,
846
+ Ae as FilterAndSortBar,
847
+ Ue as GridContainer,
848
+ re as TournamentCard,
849
+ R as TournamentCardDetails,
850
+ J as TournamentCardHeader
801
851
  };