spicykatsu 0.0.32 → 0.0.34

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/README.md CHANGED
@@ -3,4 +3,6 @@
3
3
  Fun, simple library for Vue3. Something for me to play around with in my projects.
4
4
  The idea is to make things simple and lightweight. While keeping functionality.
5
5
 
6
- Included will be componenets and utilites. Maybe more in the future.
6
+ Included will be componenets and utilites. Maybe more in the future.
7
+
8
+ Docs: [SpicyKatsu Docs](https://satoru8.gitlab.io/spicykatsuvlib/)
@@ -1,8 +1,8 @@
1
- import { ref as p, openBlock as a, createBlock as x, Transition as k, withCtx as T, createElementBlock as l, normalizeClass as g, toDisplayString as d, createCommentVNode as u, normalizeStyle as Y, createElementVNode as m, renderSlot as w, withDirectives as B, vModelText as I, mergeProps as $, withKeys as S, withModifiers as b } from "vue";
2
- const V = {
1
+ import { ref as C, watch as H, openBlock as s, createBlock as j, Transition as V, withCtx as E, createElementBlock as i, normalizeClass as S, toDisplayString as f, createCommentVNode as p, computed as x, normalizeStyle as I, createElementVNode as y, renderSlot as B, onMounted as X, onUnmounted as R, createVNode as q, Fragment as M, renderList as F, withDirectives as N, vModelCheckbox as G, createTextVNode as U, vModelText as J, mergeProps as Q, withKeys as P, withModifiers as Y, reactive as Z, nextTick as ee } from "vue";
2
+ const te = {
3
3
  key: 0,
4
4
  class: "spicyAlertIcon"
5
- }, A = { key: 1 }, F = {
5
+ }, oe = { key: 1 }, le = {
6
6
  __name: "SpicyAlert",
7
7
  props: {
8
8
  variant: {
@@ -10,49 +10,45 @@ const V = {
10
10
  default: "info",
11
11
  validator: (e) => ["info", "success", "warning", "error", "custom"].includes(e)
12
12
  },
13
- text: {
14
- type: String,
15
- default: "Button"
16
- },
13
+ text: { type: String, default: "Button" },
17
14
  icon: String,
18
15
  iconOnly: Boolean,
19
- closable: {
20
- type: Boolean,
21
- default: !1
22
- },
23
- autoClose: {
24
- type: Number,
25
- default: 0
26
- }
16
+ closable: { type: Boolean, default: !1 },
17
+ autoClose: { type: Number, default: 0 }
27
18
  },
28
19
  setup(e) {
29
- const t = e, n = p(!0), r = () => {
30
- n.value = !1;
20
+ const t = e, o = C(!0), n = () => {
21
+ o.value = !1;
31
22
  };
32
- return t.autoClose > 0 && setTimeout(() => {
33
- n.value = !1;
34
- }, t.autoClose), (o, i) => (a(), x(k, { name: "fade" }, {
35
- default: T(() => [
36
- n.value ? (a(), l("div", {
23
+ return H(
24
+ () => t.autoClose,
25
+ (l) => {
26
+ l > 0 && setTimeout(() => {
27
+ o.value = !1;
28
+ }, l);
29
+ }
30
+ ), (l, c) => (s(), j(V, { name: "fade" }, {
31
+ default: E(() => [
32
+ o.value ? (s(), i("div", {
37
33
  key: 0,
38
- class: g(["spicyAlert", e.variant])
34
+ class: S(["spicyAlert", e.variant])
39
35
  }, [
40
- e.iconOnly || e.text ? (a(), l("span", V, d(e.icon), 1)) : u("", !0),
41
- !e.iconOnly && e.text ? (a(), l("span", A, d(e.text), 1)) : u("", !0),
42
- e.closable ? (a(), l("button", {
36
+ e.iconOnly || e.text ? (s(), i("span", te, f(e.icon), 1)) : p("", !0),
37
+ !e.iconOnly && e.text ? (s(), i("span", oe, f(e.text), 1)) : p("", !0),
38
+ e.closable ? (s(), i("button", {
43
39
  key: 2,
44
40
  class: "closeBtn",
45
- onClick: r
46
- }, "×")) : u("", !0)
47
- ], 2)) : u("", !0)
41
+ onClick: n
42
+ }, "×")) : p("", !0)
43
+ ], 2)) : p("", !0)
48
44
  ]),
49
45
  _: 1
50
46
  }));
51
47
  }
52
- }, z = ["disabled"], E = {
48
+ }, ne = ["disabled"], ae = {
53
49
  key: 0,
54
50
  class: "spicyBtnIcon"
55
- }, P = {
51
+ }, se = {
56
52
  __name: "SpicyBtn",
57
53
  props: {
58
54
  variant: {
@@ -60,64 +56,301 @@ const V = {
60
56
  default: "filled",
61
57
  validator: (e) => ["outlined", "filled"].includes(e)
62
58
  },
63
- disabled: {
64
- type: Boolean,
65
- default: !1
66
- },
67
- text: {
68
- type: String,
69
- default: "Button"
70
- },
59
+ disabled: { type: Boolean, default: !1 },
60
+ text: { type: String, default: "Button" },
71
61
  icon: String,
72
- color: String,
62
+ bgColor: String,
73
63
  textColor: String,
74
64
  hoverColor: String,
75
65
  borderColor: String,
76
- // Custom color for the button border (if outlined variant)
77
- fontSize: {
78
- type: [Number, String],
79
- default: 14
80
- },
81
- fontWeight: {
82
- type: [Number, String],
83
- default: 500
84
- }
66
+ // Custom color (if outlined variant)
67
+ fontSize: { type: [Number, String], default: 14 },
68
+ fontWeight: { type: [Number, String], default: 500 }
85
69
  },
86
70
  emits: ["click"],
87
71
  setup(e, { emit: t }) {
88
- return (n, r) => (a(), l("button", {
89
- class: g(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
90
- style: Y({ "--color": e.color, "--textColor": e.textColor, "--hoverColor": e.hoverColor }),
72
+ const o = e, n = x(() => ({
73
+ "--skFontSize": o.fontSize,
74
+ "--skFontWeight": o.fontWeight,
75
+ "--skBgColor": o.bgColor,
76
+ "--skTextColor": o.textColor,
77
+ "--skBorderColor": o.borderColor,
78
+ "--hoverColor": o.hoverColor
79
+ }));
80
+ return (l, c) => (s(), i("button", {
81
+ class: S(["spicyBtn", { outlined: e.variant === "outlined", disabled: e.disabled }]),
82
+ style: I({ ...n.value }),
91
83
  disabled: e.disabled,
92
- onClick: r[0] || (r[0] = (...o) => n.onClick && n.onClick(...o))
84
+ onClick: c[0] || (c[0] = (v) => l.$emit("click"))
93
85
  }, [
94
- e.icon ? (a(), l("span", E, d(e.icon), 1)) : u("", !0),
95
- m("span", null, d(e.text), 1),
96
- w(n.$slots, "default")
97
- ], 14, z));
86
+ e.icon ? (s(), i("span", ae, f(e.icon), 1)) : p("", !0),
87
+ y("span", null, f(e.text), 1),
88
+ B(l.$slots, "default")
89
+ ], 14, ne));
98
90
  }
99
- }, L = ["placeholder"], U = {
91
+ }, ie = ["aria-label"], re = { class: "infoText" }, ce = {
92
+ key: 0,
93
+ class: "navControls"
94
+ }, ue = /* @__PURE__ */ y("span", { class: "prevBtnIcon" }, "<", -1), de = [
95
+ ue
96
+ ], ye = /* @__PURE__ */ y("span", { class: "nextBtnIcon" }, ">", -1), pe = [
97
+ ye
98
+ ], fe = {
99
+ key: 1,
100
+ class: "pagination"
101
+ }, ve = ["onClick"], ge = { class: "page" }, he = {
102
+ __name: "SpicyCarousel",
103
+ props: {
104
+ autoplay: { type: Boolean, default: !1 },
105
+ autoplaySpeed: { type: Number, default: 5e3 },
106
+ showNavigation: { type: Boolean, default: !0 },
107
+ showPagination: { type: Boolean, default: !0 },
108
+ activeColor: { type: String, default: "rgba(0, 255, 234, 0.5)" },
109
+ loop: { type: Boolean, default: !0 },
110
+ initialSlide: { type: Number, default: 0 },
111
+ slides: { type: Array, required: !0 },
112
+ width: { type: String, default: "540px" },
113
+ height: { type: String, default: "300px" },
114
+ fullScreen: { type: Boolean, default: !1 },
115
+ enableImageClick: { type: Boolean, default: !1 }
116
+ },
117
+ setup(e) {
118
+ let t, o, n = !1;
119
+ const l = e, c = x(() => ({
120
+ "--width": l.width,
121
+ "--height": l.height,
122
+ "--activeColor": l.activeColor
123
+ })), v = x(() => g.value.fullScreen === !1 ? !1 : l.fullScreen), r = C(l.initialSlide), g = x(() => l.slides[r.value]);
124
+ let a;
125
+ const d = () => {
126
+ r.value = (r.value - 1 + l.slides.length) % l.slides.length;
127
+ }, u = () => {
128
+ r.value = (r.value + 1) % l.slides.length;
129
+ }, D = (b) => {
130
+ r.value = b;
131
+ }, h = () => {
132
+ clearInterval(a);
133
+ }, w = () => {
134
+ l.autoplay && (a = setInterval(u, l.autoplaySpeed));
135
+ }, $ = () => {
136
+ window.open(g.value.img);
137
+ }, k = () => {
138
+ l.enableImageClick && $();
139
+ }, m = (b) => {
140
+ t = b.touches[0].clientX, o = b.touches[0].clientY, n = !1;
141
+ }, O = (b) => {
142
+ if (!n) {
143
+ const _ = b.touches[0].clientX - t, L = b.touches[0].clientY - o;
144
+ Math.abs(_) > Math.abs(L) && (_ > 40 ? (d(), n = !0) : _ < -40 && (u(), n = !0));
145
+ }
146
+ };
147
+ return X(() => {
148
+ l.autoplay && (a = setInterval(u, l.autoplaySpeed));
149
+ }), R(() => {
150
+ clearInterval(a);
151
+ }), (b, _) => (s(), i("div", {
152
+ class: "carouselContainer",
153
+ style: I({ ...c.value }),
154
+ onMouseenter: h,
155
+ onMouseleave: w,
156
+ onTouchstart: m,
157
+ onTouchmove: O
158
+ }, [
159
+ q(V, {
160
+ name: "slide",
161
+ mode: "out-in"
162
+ }, {
163
+ default: E(() => [
164
+ (s(), i("div", {
165
+ class: S(["slide", { pointCursor: l.enableImageClick }]),
166
+ key: r.value,
167
+ style: I({ backgroundImage: `url(${g.value.img})` }),
168
+ "aria-label": g.value.text,
169
+ onClick: k
170
+ }, [
171
+ e.slides[r.value].text ? (s(), i("div", {
172
+ key: 0,
173
+ class: S(["textOverlay", { fullScreen: v.value }])
174
+ }, [
175
+ y("span", re, f(e.slides[r.value].text), 1)
176
+ ], 2)) : p("", !0),
177
+ B(b.$slots, "default")
178
+ ], 14, ie))
179
+ ]),
180
+ _: 3
181
+ }),
182
+ e.showNavigation ? (s(), i("div", ce, [
183
+ y("div", { class: "prevNav" }, [
184
+ y("button", {
185
+ class: "prevBtn",
186
+ onClick: d
187
+ }, de)
188
+ ]),
189
+ y("div", { class: "nextNav" }, [
190
+ y("button", {
191
+ class: "nextBtn",
192
+ onClick: u
193
+ }, pe)
194
+ ])
195
+ ])) : p("", !0),
196
+ e.showPagination ? (s(), i("div", fe, [
197
+ (s(!0), i(M, null, F(e.slides, (L, K) => (s(), i("button", {
198
+ key: K,
199
+ onClick: (at) => D(K),
200
+ class: S(["pageBtn", { active: K === r.value }])
201
+ }, [
202
+ y("span", ge, f(K + 1), 1)
203
+ ], 10, ve))), 128))
204
+ ])) : p("", !0)
205
+ ], 36));
206
+ }
207
+ }, me = { class: "kbContainer" }, be = { class: "kbSidebar" }, Se = ["onUpdate:modelValue"], ke = { class: "spicyKB" }, Ce = ["onMousedown", "onTouchstart", "onClick"], we = { class: "keyText" }, $e = {
208
+ __name: "SpicyKeyboard",
209
+ emits: ["input"],
210
+ setup(e, { emit: t }) {
211
+ const o = C(null), n = C([
212
+ {
213
+ label: "Function Keys",
214
+ visible: !1,
215
+ layout: [
216
+ [
217
+ "Esc",
218
+ "F1",
219
+ "F2",
220
+ "F3",
221
+ "F4",
222
+ "F5",
223
+ "F6",
224
+ "F7",
225
+ "F8",
226
+ "F9",
227
+ "F10",
228
+ "F11",
229
+ "F12",
230
+ "PrtScr",
231
+ "ScrLk",
232
+ "Pause"
233
+ ]
234
+ // ['PrtScr', 'ScrLk', 'Pause'],
235
+ ]
236
+ },
237
+ {
238
+ label: "Main Keys",
239
+ visible: !0,
240
+ layout: [
241
+ ["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "Backspace"],
242
+ ["Tab", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]", "\\"],
243
+ ["Caps", "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", "'", "Enter"],
244
+ ["Shift", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "Shift"],
245
+ ["Ctrl", "Win", "Alt", "Space", "Alt", "Fn", "Ctrl"]
246
+ ]
247
+ },
248
+ {
249
+ label: "Arrow Keys",
250
+ visible: !0,
251
+ layout: [
252
+ ["Ins", "Home", "PgUp"],
253
+ ["Del", "End", "PgDn"],
254
+ ["&uarr;", "&larr;", "&darr;", "&rarr;"]
255
+ ]
256
+ },
257
+ {
258
+ label: "Numpad",
259
+ visible: !0,
260
+ layout: [
261
+ ["NumLock", "/", "*", "-"],
262
+ ["7", "8", "9", "+"],
263
+ ["4", "5", "6"],
264
+ ["1", "2", "3", "Enter"],
265
+ ["0", "."]
266
+ ]
267
+ }
268
+ ]), l = x(
269
+ () => n.value.filter((u) => u.visible).map((u) => u)
270
+ ), c = t, v = (u) => {
271
+ o.value = u;
272
+ }, r = () => {
273
+ o.value = null;
274
+ }, g = (u) => {
275
+ c("input", u);
276
+ }, a = (u) => [
277
+ "Backspace",
278
+ "Tab",
279
+ "Caps",
280
+ "Enter",
281
+ "Shift",
282
+ "Ctrl",
283
+ "Win",
284
+ "Alt",
285
+ "Space",
286
+ "Fn",
287
+ "Ins",
288
+ "Del",
289
+ "Home",
290
+ "End",
291
+ "PgUp",
292
+ "PgDn",
293
+ "NumLock"
294
+ ].includes(u) ? `key-${u.toLowerCase()}` : "", d = (u, D, h) => {
295
+ const w = (k) => ["Backspace", "Tab", "Caps", "Enter", "Shift", "Space"].includes(k), $ = (k) => ["Ctrl", "Win", "Alt", "Fn"].includes(k);
296
+ return w(u) ? "key-wide" : $(u) ? "key-small" : D[h].length === 1 ? "key-fullwidth" : "";
297
+ };
298
+ return (u, D) => (s(), i("div", me, [
299
+ y("div", be, [
300
+ (s(!0), i(M, null, F(n.value, (h, w) => (s(), i("div", {
301
+ class: "sidebar",
302
+ key: w
303
+ }, [
304
+ y("label", null, [
305
+ N(y("input", {
306
+ type: "checkbox",
307
+ "onUpdate:modelValue": ($) => h.visible = $
308
+ }, null, 8, Se), [
309
+ [G, h.visible]
310
+ ]),
311
+ U(" " + f(h.label), 1)
312
+ ])
313
+ ]))), 128))
314
+ ]),
315
+ y("div", ke, [
316
+ (s(!0), i(M, null, F(l.value, (h, w) => (s(), i("div", {
317
+ class: S(["kbSection", { [h.label.toLowerCase().replace(/\s+/g, "")]: !0 }]),
318
+ key: w
319
+ }, [
320
+ (s(!0), i(M, null, F(h.layout, ($, k) => (s(), i("div", {
321
+ class: "spicyKBRow",
322
+ key: k
323
+ }, [
324
+ (s(!0), i(M, null, F($, (m) => (s(), i("button", {
325
+ key: m,
326
+ class: S(["spicyKBKey", [
327
+ { "is-active": o.value === m },
328
+ a(m),
329
+ d(m, h.layout, k)
330
+ ]]),
331
+ onMousedown: (O) => v(m),
332
+ onMouseup: r,
333
+ onTouchstart: (O) => v(m),
334
+ onTouchend: r,
335
+ onClick: (O) => g(m)
336
+ }, [
337
+ y("span", we, f(m), 1)
338
+ ], 42, Ce))), 128))
339
+ ]))), 128))
340
+ ], 2))), 128))
341
+ ])
342
+ ]));
343
+ }
344
+ }, xe = { class: "spicyInputLabel" }, Be = ["placeholder"], Te = {
100
345
  key: 0,
101
346
  class: "spicyInputError"
102
- }, N = {
347
+ }, Me = {
103
348
  __name: "SpicyLabel",
104
349
  props: {
105
- value: {
106
- type: String,
107
- default: ""
108
- },
109
- placeholder: {
110
- type: String,
111
- default: ""
112
- },
113
- label: {
114
- type: String,
115
- default: "Label"
116
- },
117
- error: {
118
- type: String,
119
- default: ""
120
- },
350
+ value: { type: String, default: "" },
351
+ placeholder: { type: String, default: "" },
352
+ label: { type: String, default: "" },
353
+ error: { type: String, default: "" },
121
354
  variant: {
122
355
  type: String,
123
356
  default: "filled",
@@ -125,260 +358,385 @@ const V = {
125
358
  }
126
359
  },
127
360
  setup(e) {
128
- const t = e, n = `spicyInput-${i()}`, r = p(t.value), o = p(!1);
129
- function i() {
130
- const c = "0123456789abcdefghijklmnopqrstuvwxyz";
131
- let f = "";
132
- for (let y = 0; y < 6; y++)
133
- f += c.charAt(Math.floor(Math.random() * c.length));
134
- return f;
135
- }
136
- const v = (c) => {
137
- r.value = c.target.value;
138
- }, O = () => {
139
- o.value = !1;
140
- }, M = () => {
141
- o.value = !0;
361
+ const o = C(e.value), n = C(!1), l = (r) => {
362
+ o.value = r.target.value;
363
+ }, c = () => {
364
+ n.value = !1;
365
+ }, v = () => {
366
+ n.value = !0;
142
367
  };
143
- return (c, f) => (a(), l("div", {
144
- class: g(["spicyInputWrapper", [e.variant, { hasValue: r.value || e.value, hasFocus: o.value, hasError: e.error }]])
368
+ return (r, g) => (s(), i("div", {
369
+ class: S(["spicyInputWrapper", [e.variant, { hasValue: o.value || e.value, hasFocus: n.value, hasError: e.error }]])
145
370
  }, [
146
- m("label", {
147
- class: "spicyInputLabel",
148
- for: n
149
- }, d(e.label), 1),
150
- B(m("input", {
151
- id: n,
152
- class: g(["spicyInput", e.variant]),
153
- "onUpdate:modelValue": f[0] || (f[0] = (y) => r.value = y),
371
+ y("label", xe, f(e.label), 1),
372
+ N(y("input", {
373
+ class: S(["spicyInput", e.variant]),
374
+ "onUpdate:modelValue": g[0] || (g[0] = (a) => o.value = a),
154
375
  placeholder: e.placeholder,
155
- onInput: v,
156
- onBlur: O,
157
- onFocus: M
158
- }, null, 42, L), [
159
- [I, r.value]
376
+ onInput: l,
377
+ onBlur: c,
378
+ onFocus: v
379
+ }, null, 42, Be), [
380
+ [J, o.value]
160
381
  ]),
161
- w(c.$slots, "default"),
162
- e.error ? (a(), l("span", U, d(e.error), 1)) : u("", !0)
382
+ B(r.$slots, "default"),
383
+ e.error ? (s(), i("span", Te, f(e.error), 1)) : p("", !0)
163
384
  ], 2));
164
385
  }
165
- }, W = ["aria-checked", "onKeydown", "aria-label"], j = /* @__PURE__ */ m("div", { class: "spicyToggleKnob" }, null, -1), K = [
166
- j
167
- ], H = {
386
+ }, Fe = { class: "spicyModalHeader" }, De = { class: "spicyModalActions" }, Ie = ["onClick"], Oe = {
387
+ __name: "SpicyModal",
388
+ props: {
389
+ width: { type: String, default: "50%" },
390
+ height: { type: String, default: "auto" },
391
+ borderRadius: { type: String, default: "8px" },
392
+ bgColor: { type: String, default: "#2b2b2b" },
393
+ visible: { type: Boolean, default: !1 },
394
+ closeBtn: { type: Boolean, default: !1 },
395
+ actions: { type: Array, default: () => [] },
396
+ closeOnClick: { type: Boolean, default: !0 },
397
+ modalTitle: { type: String, default: "" }
398
+ },
399
+ emits: ["update:visible"],
400
+ setup(e, { emit: t }) {
401
+ const o = e, n = x(() => ({
402
+ "--width": o.width,
403
+ "--height": o.height,
404
+ "--skBorderRadius": o.borderRadius,
405
+ "--skBgColor": o.bgColor
406
+ })), l = t, c = () => {
407
+ l("update:visible", !1);
408
+ }, v = (r) => {
409
+ o.closeOnClick && r.target.classList.contains("spicyModalOverlay") && c();
410
+ };
411
+ return (r, g) => e.visible ? (s(), i("div", {
412
+ key: 0,
413
+ class: "spicyModalOverlay",
414
+ onClick: v
415
+ }, [
416
+ y("div", {
417
+ class: "spicyModal",
418
+ style: I({ ...n.value })
419
+ }, [
420
+ y("header", Fe, [
421
+ B(r.$slots, "spicyModalHeader", { title: e.modalTitle }, () => [
422
+ U(f(e.modalTitle), 1)
423
+ ])
424
+ ]),
425
+ B(r.$slots, "default"),
426
+ y("div", De, [
427
+ B(r.$slots, "spicyModalActions"),
428
+ e.actions.length === 0 && e.closeBtn ? (s(), i("button", {
429
+ key: 0,
430
+ class: "closeBtn actionBtn",
431
+ onClick: c
432
+ }, "Close")) : p("", !0),
433
+ (s(!0), i(M, null, F(e.actions, (a) => (s(), i("button", {
434
+ class: "extraBtn actionBtn",
435
+ key: a.label,
436
+ onClick: a.handler
437
+ }, f(a.label), 9, Ie))), 128))
438
+ ])
439
+ ], 4)
440
+ ])) : p("", !0);
441
+ }
442
+ }, _e = ["aria-checked", "onKeydown", "aria-label"], Ke = /* @__PURE__ */ y("div", { class: "spicyToggleKnob" }, null, -1), Ae = [
443
+ Ke
444
+ ], Le = {
168
445
  __name: "SpicyToggle",
169
446
  props: {
170
447
  modelValue: Boolean,
171
- label: String,
448
+ label: {
449
+ type: String,
450
+ default: "Toggle"
451
+ },
172
452
  variant: {
173
453
  type: String,
174
454
  default: "filled",
175
455
  validator: (e) => ["outlined", "filled"].includes(e)
176
456
  },
177
457
  borderColor: String,
178
- activeColor: String,
179
- focusShadow: String
458
+ activeColor: {
459
+ type: String,
460
+ default: "var(--skPrimaryColor)"
461
+ }
180
462
  },
181
463
  emits: ["update:modelValue"],
182
464
  setup(e, { emit: t }) {
183
- const n = e, r = t, o = () => {
184
- r("update:modelValue", !n.modelValue);
465
+ const o = e, n = x(() => ({
466
+ "--skBorderColor": o.borderColor,
467
+ "--activeColor": o.activeColor
468
+ })), l = t, c = () => {
469
+ l("update:modelValue", !o.modelValue);
185
470
  };
186
- return (i, v) => (a(), l("div", $({
471
+ return (v, r) => (s(), i("div", Q({
187
472
  class: ["spicyToggle", { outlined: e.variant === "outlined", "is-active": e.modelValue }],
188
- style: {
189
- "--borderColor": e.borderColor,
190
- "--activeColor": e.activeColor,
191
- "--focusShadow": e.focusShadow
192
- },
193
- onClick: o,
473
+ tabindex: "0",
194
474
  role: "switch",
475
+ style: { ...n.value },
476
+ onClick: c,
195
477
  "aria-checked": e.modelValue.toString(),
196
- tabindex: "0",
197
478
  onKeydown: [
198
- S(b(o, ["prevent"]), ["space"]),
199
- S(b(o, ["prevent"]), ["enter"])
479
+ P(Y(c, ["prevent"]), ["space"]),
480
+ P(Y(c, ["prevent"]), ["enter"])
200
481
  ],
201
482
  "aria-label": e.label
202
- }, i.$attrs), K, 16, W));
483
+ }, v.$attrs), Ae, 16, _e));
484
+ }
485
+ }, Pe = ["aria-hidden"], Ye = {
486
+ key: 0,
487
+ class: "spicyTooltipIcon"
488
+ }, Ve = {
489
+ key: 1,
490
+ class: "spicyTooltipText"
491
+ }, Ee = {
492
+ key: 2,
493
+ class: "spicyTooltipIcon"
494
+ }, Ne = {
495
+ __name: "SpicyTooltip",
496
+ props: {
497
+ text: String,
498
+ prependIcon: String,
499
+ appendIcon: String,
500
+ position: {
501
+ type: String,
502
+ default: "top",
503
+ validator: (e) => ["top", "bottom", "left", "right"].includes(e)
504
+ }
505
+ },
506
+ setup(e) {
507
+ const t = e, o = C(!1), n = C(null), l = Z({
508
+ position: "absolute",
509
+ top: "0px",
510
+ left: "0px",
511
+ maxWidth: "175px"
512
+ }), c = (a) => {
513
+ const d = a.right - window.innerWidth;
514
+ d > 0 && (l.left = `${parseInt(l.left) - d - 5}px`), a.left < 0 && (l.left = "5px");
515
+ }, v = {
516
+ top: (a, d) => {
517
+ l.left = `${a.left + (a.width - d.width) / 2}px`, l.top = `${a.top - d.height - 5}px`;
518
+ },
519
+ bottom: (a, d) => {
520
+ l.left = `${a.left + (a.width - d.width) / 2}px`, l.top = `${a.bottom + 5}px`;
521
+ },
522
+ left: (a, d) => {
523
+ l.left = `${a.left - d.width - 5}px`, l.top = `${a.top + (a.height - d.height) / 2}px`;
524
+ },
525
+ right: (a, d) => {
526
+ l.left = `${a.right + 5}px`, l.top = `${a.top + (a.height - d.height) / 2}px`;
527
+ }
528
+ }, r = () => {
529
+ o.value = !0, ee(() => {
530
+ if (n.value && o.value) {
531
+ const a = n.value.getBoundingClientRect(), d = n.value.querySelector(".spicyTooltip").getBoundingClientRect(), u = v[t.position];
532
+ u(a, d), c(d);
533
+ }
534
+ });
535
+ }, g = () => {
536
+ o.value = !1;
537
+ };
538
+ return (a, d) => (s(), i("div", {
539
+ onMouseover: r,
540
+ onMouseleave: g,
541
+ ref_key: "host",
542
+ ref: n
543
+ }, [
544
+ B(a.$slots, "default"),
545
+ o.value ? (s(), i("div", {
546
+ key: 0,
547
+ class: "spicyTooltip",
548
+ style: I(l),
549
+ role: "tooltip",
550
+ "aria-hidden": !o.value
551
+ }, [
552
+ e.prependIcon ? (s(), i("span", Ye, f(e.prependIcon), 1)) : p("", !0),
553
+ e.text ? (s(), i("span", Ve, f(e.text), 1)) : p("", !0),
554
+ e.appendIcon ? (s(), i("span", Ee, f(e.appendIcon), 1)) : p("", !0)
555
+ ], 12, Pe)) : p("", !0)
556
+ ], 544));
203
557
  }
204
558
  };
205
- function C(e, t) {
206
- const n = {
559
+ function W(e, t) {
560
+ const o = {
207
561
  YYYY: () => e.getFullYear().toString(),
208
562
  MM: () => (e.getMonth() + 1).toString().padStart(2, "0"),
209
563
  DD: () => e.getDate().toString().padStart(2, "0")
210
564
  };
211
- return t.replace(/YYYY|MM|DD/g, (r) => n[r]());
565
+ return t.replace(/YYYY|MM|DD/g, (n) => o[n]());
212
566
  }
213
- function R(e) {
214
- const [t, n, r] = e.split("-");
215
- return new Date(Number(t), Number(n) - 1, Number(r));
567
+ function Ue(e) {
568
+ const [t, o, n] = e.split("-");
569
+ return new Date(Number(t), Number(o) - 1, Number(n));
216
570
  }
217
- function q(e, t) {
218
- const n = Math.abs(t.getTime() - e.getTime());
219
- return Math.ceil(n / (1e3 * 60 * 60 * 24));
571
+ function We(e, t) {
572
+ const o = Math.abs(t.getTime() - e.getTime());
573
+ return Math.ceil(o / (1e3 * 60 * 60 * 24));
220
574
  }
221
- function G(e, t) {
222
- const n = new Date(e);
223
- return n.setDate(e.getDate() + t), n;
575
+ function ze(e, t) {
576
+ const o = new Date(e);
577
+ return o.setDate(e.getDate() + t), o;
224
578
  }
225
- function J(e, t) {
226
- const n = new Date(e);
227
- return n.setDate(e.getDate() - t), n;
579
+ function He(e, t) {
580
+ const o = new Date(e);
581
+ return o.setDate(e.getDate() - t), o;
228
582
  }
229
- function Q(e) {
583
+ function je(e) {
230
584
  const t = /* @__PURE__ */ new Date();
231
585
  return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
232
586
  }
233
- function X(e) {
587
+ function Xe(e) {
234
588
  const t = /* @__PURE__ */ new Date();
235
589
  return t.setDate(t.getDate() - 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
236
590
  }
237
- function Z(e) {
591
+ function Re(e) {
238
592
  const t = /* @__PURE__ */ new Date();
239
593
  return t.setDate(t.getDate() + 1), e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
240
594
  }
241
- function _(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
595
+ function qe(e = "YYYY-MM-DD", t = { show: !0, separator: "-" }) {
242
596
  if (typeof e != "string" || typeof t != "object" || !t.hasOwnProperty("show") || typeof t.show != "boolean")
243
597
  throw new Error(
244
598
  'Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.'
245
599
  );
246
- let r = C(/* @__PURE__ */ new Date(), e);
247
- return t.separator && t.separator !== "-" && (r = r.replace(/-/g, t.separator)), t.show ? { value: r, isVisible: !0 } : { value: r, isVisible: !1 };
600
+ let n = W(/* @__PURE__ */ new Date(), e);
601
+ return t.separator && t.separator !== "-" && (n = n.replace(/-/g, t.separator)), t.show ? { value: n, isVisible: !0 } : { value: n, isVisible: !1 };
248
602
  }
249
- const ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
603
+ const it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
250
604
  __proto__: null,
251
- currentDate: _,
252
- dateAdd: G,
253
- dateDiff: q,
254
- dateIsToday: Q,
255
- dateIsTomorrow: Z,
256
- dateIsYesterday: X,
257
- dateSubtract: J,
258
- formatDate: C,
259
- parseDate: R
605
+ currentDate: qe,
606
+ dateAdd: ze,
607
+ dateDiff: We,
608
+ dateIsToday: je,
609
+ dateIsTomorrow: Re,
610
+ dateIsYesterday: Xe,
611
+ dateSubtract: He,
612
+ formatDate: W,
613
+ parseDate: Ue
260
614
  }, Symbol.toStringTag, { value: "Module" }));
261
- function ee(e) {
615
+ function Ge(e) {
262
616
  const t = /* @__PURE__ */ new WeakMap();
263
- function n(r) {
264
- if (s(r) || typeof r != "object")
265
- return r;
266
- if (t.has(r))
267
- return t.get(r);
268
- const o = Array.isArray(r) ? [] : {};
269
- t.set(r, o);
270
- for (const i in r)
271
- Object.prototype.hasOwnProperty.call(r, i) && (o[i] = n(r[i]));
272
- return o;
617
+ function o(n) {
618
+ if (T(n) || typeof n != "object")
619
+ return n;
620
+ if (t.has(n))
621
+ return t.get(n);
622
+ const l = Array.isArray(n) ? [] : {};
623
+ t.set(n, l);
624
+ for (const c in n)
625
+ Object.prototype.hasOwnProperty.call(n, c) && (l[c] = o(n[c]));
626
+ return l;
273
627
  }
274
- return n(e);
628
+ return o(e);
275
629
  }
276
- function D(...e) {
630
+ function z(...e) {
277
631
  const t = {};
278
- return e.forEach((n) => {
279
- if (!s(n)) {
280
- for (const r in n)
281
- if (Object.prototype.hasOwnProperty.call(n, r)) {
282
- const o = n[r];
283
- o !== void 0 && (typeof o == "object" && o !== null && !Array.isArray(o) ? t[r] = D(
284
- t[r] || {},
285
- o
286
- ) : t[r] = o);
632
+ return e.forEach((o) => {
633
+ if (!T(o)) {
634
+ for (const n in o)
635
+ if (Object.prototype.hasOwnProperty.call(o, n)) {
636
+ const l = o[n];
637
+ l !== void 0 && (typeof l == "object" && l !== null && !Array.isArray(l) ? t[n] = z(
638
+ t[n] || {},
639
+ l
640
+ ) : t[n] = l);
287
641
  }
288
642
  }
289
643
  }), t;
290
644
  }
291
- function te(...e) {
292
- return s(e[0]) ? e[0] : Object.assign({}, ...e);
645
+ function Je(...e) {
646
+ return T(e[0]) ? e[0] : Object.assign({}, ...e);
293
647
  }
294
- function re(e) {
295
- return s(e) ? [] : Object.keys(e);
648
+ function Qe(e) {
649
+ return T(e) ? [] : Object.keys(e);
296
650
  }
297
- function ne(e) {
298
- return s(e) ? [] : Object.values(e);
651
+ function Ze(e) {
652
+ return T(e) ? [] : Object.values(e);
299
653
  }
300
- function oe(e) {
301
- return s(e) ? [] : Object.entries(e);
654
+ function et(e) {
655
+ return T(e) ? [] : Object.entries(e);
302
656
  }
303
- function s(e) {
657
+ function T(e) {
304
658
  return e === null || typeof e != "object" ? !1 : Array.isArray(e) ? e.length === 0 : Object.keys(e).length === 0;
305
659
  }
306
- const de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
660
+ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
307
661
  __proto__: null,
308
- deepClone: ee,
309
- deepMerge: D,
310
- getObjectEntries: oe,
311
- getObjectKeys: re,
312
- getObjectValues: ne,
313
- isObjectEmpty: s,
314
- mergeObjects: te
662
+ deepClone: Ge,
663
+ deepMerge: z,
664
+ getObjectEntries: et,
665
+ getObjectKeys: Qe,
666
+ getObjectValues: Ze,
667
+ isObjectEmpty: T,
668
+ mergeObjects: Je
315
669
  }, Symbol.toStringTag, { value: "Module" }));
316
- function h(e) {
670
+ function A(e) {
317
671
  try {
318
672
  return new URL(e), !0;
319
673
  } catch (t) {
320
674
  return console.error("Invalid URL:", t), !1;
321
675
  }
322
676
  }
323
- function ae(e) {
324
- return h(e) ? new URL(e).hostname : null;
677
+ function tt(e) {
678
+ return A(e) ? new URL(e).hostname : null;
325
679
  }
326
- function le(e, t) {
327
- if (!h(e))
680
+ function ot(e, t) {
681
+ if (!A(e))
328
682
  return e;
329
- const n = new URL(e);
330
- return Object.keys(t).forEach((r) => n.searchParams.append(r, t[r])), n.toString();
683
+ const o = new URL(e);
684
+ return Object.keys(t).forEach((n) => o.searchParams.append(n, t[n])), o.toString();
331
685
  }
332
- function ie(e, t, n = "https") {
333
- if (!["http", "https", "ftp", "sftp", "ftps", "ssh"].includes(n.toLowerCase()))
334
- throw new Error("Invalid protocol: " + n);
686
+ function lt(e, t, o = "https") {
687
+ if (!["http", "https", "ftp", "sftp", "ftps", "ssh"].includes(o.toLowerCase()))
688
+ throw new Error("Invalid protocol: " + o);
335
689
  if (!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(e))
336
690
  throw new Error("Invalid hostname: " + e);
337
- return t.startsWith("/") || (t = "/" + t), t.endsWith("/") && t.length > 1 && (t = t.slice(0, -1)), t === "/" && (t = ""), `${n.toLowerCase()}://${e}${t}`;
691
+ return t.startsWith("/") || (t = "/" + t), t.endsWith("/") && t.length > 1 && (t = t.slice(0, -1)), t === "/" && (t = ""), `${o.toLowerCase()}://${e}${t}`;
338
692
  }
339
- const fe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
693
+ const ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
340
694
  __proto__: null,
341
- appendParamsToUrl: le,
342
- generateUrl: ie,
343
- getHostname: ae,
344
- isUrlValid: h
345
- }, Symbol.toStringTag, { value: "Module" })), se = ':root{--primaryColor: #5e1381;--primaryColorHover: #811faf;--secondaryColor: #2757f7;--errorColor: #ff0000;--primaryBorderColor: #ccc;--primaryTextColor: #ddd;--disabledOpacity: .5;--labelFocus: var(--primaryColor);--fontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--fontSize: 14px;--fontWeight: 500;--borderWidth: 2px;--borderRadius: 4px}.spicyText{color:var(--primaryTextColor);font-family:var(--fontFamily);font-size:var(--fontSize);font-weight:var(--fontWeight)}.spicyHeader{color:var(--primaryTextColor);font-family:var(--fontFamily);font-size:24px;font-weight:700}', ye = {
695
+ appendParamsToUrl: ot,
696
+ generateUrl: lt,
697
+ getHostname: tt,
698
+ isUrlValid: A
699
+ }, Symbol.toStringTag, { value: "Module" })), nt = ':root{--skBgColor: #28292a;--skBgSecondaryColor: #424344;--skBorderColor: #515353;--skPrimaryColor: #811faf;--skSecondaryColor: #0066b3;--skAccentColor: #004a77;--skHoverColor: #656769;--skTextColor: #ddd;--disabledOpacity: .5;--skLabelFocus: var(--skPrimaryColor);--skFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--skFontSize: 14px;--skFontWeight: 500;--skBorderWidth: 2px;--skBorderRadius: 4px}.spicyText{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:var(--skFontSize)}.spicyHeader{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:24px;font-weight:700}.spicyLink:hover{color:var(--skHoverColor)}.spicyLink:active{color:var(--skPrimaryColor)}.spicyLink:focus{color:var(--skLabelFocus)}.spicyLink:disabled{opacity:var(--disabledOpacity)}', ut = {
346
700
  install(e, t = {}) {
347
- const { useComponents: n = !0, useStyles: r = !0 } = t;
348
- if (n && (e.component("SpicyAlert", F), e.component("SpicyBtn", P), e.component("SpicyLabel", N), e.component("SpicyToggle", H)), r) {
349
- const o = document.createElement("style");
350
- o.textContent = se, document.head.appendChild(o);
701
+ const { useComponents: o = !0, useStyles: n = !0 } = t;
702
+ if (o && (e.component("SpicyAlert", le), e.component("SpicyBtn", se), e.component("SpicyCarousel", he), e.component("SpicyKeyboard", $e), e.component("SpicyLabel", Me), e.component("SpicyModal", Oe), e.component("SpicyToggle", Le), e.component("SpicyTooltip", Ne)), n) {
703
+ const l = document.createElement("style");
704
+ l.textContent = nt, document.head.appendChild(l);
351
705
  }
352
706
  }
353
707
  };
354
708
  export {
355
- F as SpicyAlert,
356
- P as SpicyBtn,
357
- N as SpicyLabel,
358
- H as SpicyToggle,
359
- le as appendParamsToUrl,
360
- _ as currentDate,
361
- G as dateAdd,
362
- q as dateDiff,
363
- Q as dateIsToday,
364
- Z as dateIsTomorrow,
365
- X as dateIsYesterday,
366
- J as dateSubtract,
367
- ue as dateUtils,
368
- ee as deepClone,
369
- D as deepMerge,
370
- ye as default,
371
- C as formatDate,
372
- ie as generateUrl,
373
- ae as getHostname,
374
- oe as getObjectEntries,
375
- re as getObjectKeys,
376
- ne as getObjectValues,
377
- s as isObjectEmpty,
378
- h as isUrlValid,
379
- te as mergeObjects,
380
- de as objUtils,
381
- R as parseDate,
382
- se as spicyStyles,
383
- fe as urlUtils
709
+ le as SpicyAlert,
710
+ se as SpicyBtn,
711
+ he as SpicyCarousel,
712
+ $e as SpicyKeyboard,
713
+ Me as SpicyLabel,
714
+ Oe as SpicyModal,
715
+ Le as SpicyToggle,
716
+ Ne as SpicyTooltip,
717
+ ot as appendParamsToUrl,
718
+ qe as currentDate,
719
+ ze as dateAdd,
720
+ We as dateDiff,
721
+ je as dateIsToday,
722
+ Re as dateIsTomorrow,
723
+ Xe as dateIsYesterday,
724
+ He as dateSubtract,
725
+ it as dateUtils,
726
+ Ge as deepClone,
727
+ z as deepMerge,
728
+ ut as default,
729
+ W as formatDate,
730
+ lt as generateUrl,
731
+ tt as getHostname,
732
+ et as getObjectEntries,
733
+ Qe as getObjectKeys,
734
+ Ze as getObjectValues,
735
+ T as isObjectEmpty,
736
+ A as isUrlValid,
737
+ Je as mergeObjects,
738
+ rt as objUtils,
739
+ Ue as parseDate,
740
+ nt as spicyStyles,
741
+ ct as urlUtils
384
742
  };
@@ -1 +1 @@
1
- (function(l,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(l=typeof globalThis<"u"?globalThis:l||self,n(l.SpicyKatsu={},l.Vue))})(this,function(l,n){"use strict";const A={key:0,class:"spicyAlertIcon"},j={key:1},m={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:e=>["info","success","warning","error","custom"].includes(e)},text:{type:String,default:"Button"},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(e){const t=e,o=n.ref(!0),r=()=>{o.value=!1};return t.autoClose>0&&setTimeout(()=>{o.value=!1},t.autoClose),(a,c)=>(n.openBlock(),n.createBlock(n.Transition,{name:"fade"},{default:n.withCtx(()=>[o.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["spicyAlert",e.variant])},[e.iconOnly||e.text?(n.openBlock(),n.createElementBlock("span",A,n.toDisplayString(e.icon),1)):n.createCommentVNode("",!0),!e.iconOnly&&e.text?(n.openBlock(),n.createElementBlock("span",j,n.toDisplayString(e.text),1)):n.createCommentVNode("",!0),e.closable?(n.openBlock(),n.createElementBlock("button",{key:2,class:"closeBtn",onClick:r},"×")):n.createCommentVNode("",!0)],2)):n.createCommentVNode("",!0)]),_:1}))}},F=["disabled"],P={key:0,class:"spicyBtnIcon"},h={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,color:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(e,{emit:t}){return(o,r)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass(["spicyBtn",{outlined:e.variant==="outlined",disabled:e.disabled}]),style:n.normalizeStyle({"--color":e.color,"--textColor":e.textColor,"--hoverColor":e.hoverColor}),disabled:e.disabled,onClick:r[0]||(r[0]=(...a)=>o.onClick&&o.onClick(...a))},[e.icon?(n.openBlock(),n.createElementBlock("span",P,n.toDisplayString(e.icon),1)):n.createCommentVNode("",!0),n.createElementVNode("span",null,n.toDisplayString(e.text),1),n.renderSlot(o.$slots,"default")],14,F))}},L=["placeholder"],K={key:0,class:"spicyInputError"},p={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:"Label"},error:{type:String,default:""},variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)}},setup(e){const t=e,o=`spicyInput-${c()}`,r=n.ref(t.value),a=n.ref(!1);function c(){const s="0123456789abcdefghijklmnopqrstuvwxyz";let d="";for(let f=0;f<6;f++)d+=s.charAt(Math.floor(Math.random()*s.length));return d}const z=s=>{r.value=s.target.value},Q=()=>{a.value=!1},X=()=>{a.value=!0};return(s,d)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["spicyInputWrapper",[e.variant,{hasValue:r.value||e.value,hasFocus:a.value,hasError:e.error}]])},[n.createElementVNode("label",{class:"spicyInputLabel",for:o},n.toDisplayString(e.label),1),n.withDirectives(n.createElementVNode("input",{id:o,class:n.normalizeClass(["spicyInput",e.variant]),"onUpdate:modelValue":d[0]||(d[0]=f=>r.value=f),placeholder:e.placeholder,onInput:z,onBlur:Q,onFocus:X},null,42,L),[[n.vModelText,r.value]]),n.renderSlot(s.$slots,"default"),e.error?(n.openBlock(),n.createElementBlock("span",K,n.toDisplayString(e.error),1)):n.createCommentVNode("",!0)],2))}},W=["aria-checked","onKeydown","aria-label"],H=[n.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],S={__name:"SpicyToggle",props:{modelValue:Boolean,label:String,variant:{type:String,default:"filled",validator:e=>["outlined","filled"].includes(e)},borderColor:String,activeColor:String,focusShadow:String},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,r=t,a=()=>{r("update:modelValue",!o.modelValue)};return(c,z)=>(n.openBlock(),n.createElementBlock("div",n.mergeProps({class:["spicyToggle",{outlined:e.variant==="outlined","is-active":e.modelValue}],style:{"--borderColor":e.borderColor,"--activeColor":e.activeColor,"--focusShadow":e.focusShadow},onClick:a,role:"switch","aria-checked":e.modelValue.toString(),tabindex:"0",onKeydown:[n.withKeys(n.withModifiers(a,["prevent"]),["space"]),n.withKeys(n.withModifiers(a,["prevent"]),["enter"])],"aria-label":e.label},c.$attrs),H,16,W))}};function y(e,t){const o={YYYY:()=>e.getFullYear().toString(),MM:()=>(e.getMonth()+1).toString().padStart(2,"0"),DD:()=>e.getDate().toString().padStart(2,"0")};return t.replace(/YYYY|MM|DD/g,r=>o[r]())}function b(e){const[t,o,r]=e.split("-");return new Date(Number(t),Number(o)-1,Number(r))}function w(e,t){const o=Math.abs(t.getTime()-e.getTime());return Math.ceil(o/(1e3*60*60*24))}function C(e,t){const o=new Date(e);return o.setDate(e.getDate()+t),o}function D(e,t){const o=new Date(e);return o.setDate(e.getDate()-t),o}function k(e){const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function B(e){const t=new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function O(e){const t=new Date;return t.setDate(t.getDate()+1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function M(e="YYYY-MM-DD",t={show:!0,separator:"-"}){if(typeof e!="string"||typeof t!="object"||!t.hasOwnProperty("show")||typeof t.show!="boolean")throw new Error('Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.');let r=y(new Date,e);return t.separator&&t.separator!=="-"&&(r=r.replace(/-/g,t.separator)),t.show?{value:r,isVisible:!0}:{value:r,isVisible:!1}}const R=Object.freeze(Object.defineProperty({__proto__:null,currentDate:M,dateAdd:C,dateDiff:w,dateIsToday:k,dateIsTomorrow:O,dateIsYesterday:B,dateSubtract:D,formatDate:y,parseDate:b},Symbol.toStringTag,{value:"Module"}));function T(e){const t=new WeakMap;function o(r){if(i(r)||typeof r!="object")return r;if(t.has(r))return t.get(r);const a=Array.isArray(r)?[]:{};t.set(r,a);for(const c in r)Object.prototype.hasOwnProperty.call(r,c)&&(a[c]=o(r[c]));return a}return o(e)}function g(...e){const t={};return e.forEach(o=>{if(!i(o)){for(const r in o)if(Object.prototype.hasOwnProperty.call(o,r)){const a=o[r];a!==void 0&&(typeof a=="object"&&a!==null&&!Array.isArray(a)?t[r]=g(t[r]||{},a):t[r]=a)}}}),t}function V(...e){return i(e[0])?e[0]:Object.assign({},...e)}function E(e){return i(e)?[]:Object.keys(e)}function Y(e){return i(e)?[]:Object.values(e)}function I(e){return i(e)?[]:Object.entries(e)}function i(e){return e===null||typeof e!="object"?!1:Array.isArray(e)?e.length===0:Object.keys(e).length===0}const q=Object.freeze(Object.defineProperty({__proto__:null,deepClone:T,deepMerge:g,getObjectEntries:I,getObjectKeys:E,getObjectValues:Y,isObjectEmpty:i,mergeObjects:V},Symbol.toStringTag,{value:"Module"}));function u(e){try{return new URL(e),!0}catch(t){return console.error("Invalid URL:",t),!1}}function v(e){return u(e)?new URL(e).hostname:null}function N(e,t){if(!u(e))return e;const o=new URL(e);return Object.keys(t).forEach(r=>o.searchParams.append(r,t[r])),o.toString()}function U(e,t,o="https"){if(!["http","https","ftp","sftp","ftps","ssh"].includes(o.toLowerCase()))throw new Error("Invalid protocol: "+o);if(!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(e))throw new Error("Invalid hostname: "+e);return t.startsWith("/")||(t="/"+t),t.endsWith("/")&&t.length>1&&(t=t.slice(0,-1)),t==="/"&&(t=""),`${o.toLowerCase()}://${e}${t}`}const G=Object.freeze(Object.defineProperty({__proto__:null,appendParamsToUrl:N,generateUrl:U,getHostname:v,isUrlValid:u},Symbol.toStringTag,{value:"Module"})),$=':root{--primaryColor: #5e1381;--primaryColorHover: #811faf;--secondaryColor: #2757f7;--errorColor: #ff0000;--primaryBorderColor: #ccc;--primaryTextColor: #ddd;--disabledOpacity: .5;--labelFocus: var(--primaryColor);--fontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--fontSize: 14px;--fontWeight: 500;--borderWidth: 2px;--borderRadius: 4px}.spicyText{color:var(--primaryTextColor);font-family:var(--fontFamily);font-size:var(--fontSize);font-weight:var(--fontWeight)}.spicyHeader{color:var(--primaryTextColor);font-family:var(--fontFamily);font-size:24px;font-weight:700}',J={install(e,t={}){const{useComponents:o=!0,useStyles:r=!0}=t;if(o&&(e.component("SpicyAlert",m),e.component("SpicyBtn",h),e.component("SpicyLabel",p),e.component("SpicyToggle",S)),r){const a=document.createElement("style");a.textContent=$,document.head.appendChild(a)}}};l.SpicyAlert=m,l.SpicyBtn=h,l.SpicyLabel=p,l.SpicyToggle=S,l.appendParamsToUrl=N,l.currentDate=M,l.dateAdd=C,l.dateDiff=w,l.dateIsToday=k,l.dateIsTomorrow=O,l.dateIsYesterday=B,l.dateSubtract=D,l.dateUtils=R,l.deepClone=T,l.deepMerge=g,l.default=J,l.formatDate=y,l.generateUrl=U,l.getHostname=v,l.getObjectEntries=I,l.getObjectKeys=E,l.getObjectValues=Y,l.isObjectEmpty=i,l.isUrlValid=u,l.mergeObjects=V,l.objUtils=q,l.parseDate=b,l.spicyStyles=$,l.urlUtils=G,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.SpicyKatsu={},r.Vue))})(this,function(r,e){"use strict";const ee={key:0,class:"spicyAlertIcon"},te={key:1},V={__name:"SpicyAlert",props:{variant:{type:String,default:"info",validator:t=>["info","success","warning","error","custom"].includes(t)},text:{type:String,default:"Button"},icon:String,iconOnly:Boolean,closable:{type:Boolean,default:!1},autoClose:{type:Number,default:0}},setup(t){const o=t,l=e.ref(!0),a=()=>{l.value=!1};return e.watch(()=>o.autoClose,n=>{n>0&&setTimeout(()=>{l.value=!1},n)}),(n,c)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["spicyAlert",t.variant])},[t.iconOnly||t.text?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),!t.iconOnly&&t.text?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,class:"closeBtn",onClick:a},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}))}},oe=["disabled"],le={key:0,class:"spicyBtnIcon"},N={__name:"SpicyBtn",props:{variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},disabled:{type:Boolean,default:!1},text:{type:String,default:"Button"},icon:String,bgColor:String,textColor:String,hoverColor:String,borderColor:String,fontSize:{type:[Number,String],default:14},fontWeight:{type:[Number,String],default:500}},emits:["click"],setup(t,{emit:o}){const l=t,a=e.computed(()=>({"--skFontSize":l.fontSize,"--skFontWeight":l.fontWeight,"--skBgColor":l.bgColor,"--skTextColor":l.textColor,"--skBorderColor":l.borderColor,"--hoverColor":l.hoverColor}));return(n,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["spicyBtn",{outlined:t.variant==="outlined",disabled:t.disabled}]),style:e.normalizeStyle({...a.value}),disabled:t.disabled,onClick:c[0]||(c[0]=y=>n.$emit("click"))},[t.icon?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(t.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.text),1),e.renderSlot(n.$slots,"default")],14,oe))}},ne=["aria-label"],ae={class:"infoText"},re={key:0,class:"navControls"},ie=[e.createElementVNode("span",{class:"prevBtnIcon"},"<",-1)],se=[e.createElementVNode("span",{class:"nextBtnIcon"},">",-1)],ce={key:1,class:"pagination"},de=["onClick"],pe={class:"page"},M={__name:"SpicyCarousel",props:{autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:5e3},showNavigation:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},activeColor:{type:String,default:"rgba(0, 255, 234, 0.5)"},loop:{type:Boolean,default:!0},initialSlide:{type:Number,default:0},slides:{type:Array,required:!0},width:{type:String,default:"540px"},height:{type:String,default:"300px"},fullScreen:{type:Boolean,default:!1},enableImageClick:{type:Boolean,default:!1}},setup(t){let o,l,a=!1;const n=t,c=e.computed(()=>({"--width":n.width,"--height":n.height,"--activeColor":n.activeColor})),y=e.computed(()=>u.value.fullScreen===!1?!1:n.fullScreen),s=e.ref(n.initialSlide),u=e.computed(()=>n.slides[s.value]);let i;const p=()=>{s.value=(s.value-1+n.slides.length)%n.slides.length},d=()=>{s.value=(s.value+1)%n.slides.length},B=g=>{s.value=g},f=()=>{clearInterval(i)},S=()=>{n.autoplay&&(i=setInterval(d,n.autoplaySpeed))},b=()=>{window.open(u.value.img)},k=()=>{n.enableImageClick&&b()},m=g=>{o=g.touches[0].clientX,l=g.touches[0].clientY,a=!1},w=g=>{if(!a){const E=g.touches[0].clientX-o,v=g.touches[0].clientY-l;Math.abs(E)>Math.abs(v)&&(E>40?(p(),a=!0):E<-40&&(d(),a=!0))}};return e.onMounted(()=>{n.autoplay&&(i=setInterval(d,n.autoplaySpeed))}),e.onUnmounted(()=>{clearInterval(i)}),(g,E)=>(e.openBlock(),e.createElementBlock("div",{class:"carouselContainer",style:e.normalizeStyle({...c.value}),onMouseenter:f,onMouseleave:S,onTouchstart:m,onTouchmove:w},[e.createVNode(e.Transition,{name:"slide",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["slide",{pointCursor:n.enableImageClick}]),key:s.value,style:e.normalizeStyle({backgroundImage:`url(${u.value.img})`}),"aria-label":u.value.text,onClick:k},[t.slides[s.value].text?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["textOverlay",{fullScreen:y.value}])},[e.createElementVNode("span",ae,e.toDisplayString(t.slides[s.value].text),1)],2)):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default")],14,ne))]),_:3}),t.showNavigation?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",{class:"prevNav"},[e.createElementVNode("button",{class:"prevBtn",onClick:p},ie)]),e.createElementVNode("div",{class:"nextNav"},[e.createElementVNode("button",{class:"nextBtn",onClick:d},se)])])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.slides,(v,$)=>(e.openBlock(),e.createElementBlock("button",{key:$,onClick:Pe=>B($),class:e.normalizeClass(["pageBtn",{active:$===s.value}])},[e.createElementVNode("span",pe,e.toDisplayString($+1),1)],10,de))),128))])):e.createCommentVNode("",!0)],36))}},ye={class:"kbContainer"},ue={class:"kbSidebar"},fe=["onUpdate:modelValue"],me={class:"spicyKB"},ge=["onMousedown","onTouchstart","onClick"],he={class:"keyText"},F={__name:"SpicyKeyboard",emits:["input"],setup(t,{emit:o}){const l=e.ref(null),a=e.ref([{label:"Function Keys",visible:!1,layout:[["Esc","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","PrtScr","ScrLk","Pause"]]},{label:"Main Keys",visible:!0,layout:[["`","1","2","3","4","5","6","7","8","9","0","-","=","Backspace"],["Tab","Q","W","E","R","T","Y","U","I","O","P","[","]","\\"],["Caps","A","S","D","F","G","H","J","K","L",";","'","Enter"],["Shift","Z","X","C","V","B","N","M",",",".","/","Shift"],["Ctrl","Win","Alt","Space","Alt","Fn","Ctrl"]]},{label:"Arrow Keys",visible:!0,layout:[["Ins","Home","PgUp"],["Del","End","PgDn"],["&uarr;","&larr;","&darr;","&rarr;"]]},{label:"Numpad",visible:!0,layout:[["NumLock","/","*","-"],["7","8","9","+"],["4","5","6"],["1","2","3","Enter"],["0","."]]}]),n=e.computed(()=>a.value.filter(d=>d.visible).map(d=>d)),c=o,y=d=>{l.value=d},s=()=>{l.value=null},u=d=>{c("input",d)},i=d=>["Backspace","Tab","Caps","Enter","Shift","Ctrl","Win","Alt","Space","Fn","Ins","Del","Home","End","PgUp","PgDn","NumLock"].includes(d)?`key-${d.toLowerCase()}`:"",p=(d,B,f)=>{const S=k=>["Backspace","Tab","Caps","Enter","Shift","Space"].includes(k),b=k=>["Ctrl","Win","Alt","Fn"].includes(k);return S(d)?"key-wide":b(d)?"key-small":B[f].length===1?"key-fullwidth":""};return(d,B)=>(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(f,S)=>(e.openBlock(),e.createElementBlock("div",{class:"sidebar",key:S},[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":b=>f.visible=b},null,8,fe),[[e.vModelCheckbox,f.visible]]),e.createTextVNode(" "+e.toDisplayString(f.label),1)])]))),128))]),e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(f,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kbSection",{[f.label.toLowerCase().replace(/\s+/g,"")]:!0}]),key:S},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.layout,(b,k)=>(e.openBlock(),e.createElementBlock("div",{class:"spicyKBRow",key:k},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b,m=>(e.openBlock(),e.createElementBlock("button",{key:m,class:e.normalizeClass(["spicyKBKey",[{"is-active":l.value===m},i(m),p(m,f.layout,k)]]),onMousedown:w=>y(m),onMouseup:s,onTouchstart:w=>y(m),onTouchend:s,onClick:w=>u(m)},[e.createElementVNode("span",he,e.toDisplayString(m),1)],42,ge))),128))]))),128))],2))),128))])]))}},ke={class:"spicyInputLabel"},Se=["placeholder"],be={key:0,class:"spicyInputError"},I={__name:"SpicyLabel",props:{value:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:""},error:{type:String,default:""},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)}},setup(t){const o=t,l=e.ref(o.value),a=e.ref(!1),n=s=>{l.value=s.target.value},c=()=>{a.value=!1},y=()=>{a.value=!0};return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["spicyInputWrapper",[t.variant,{hasValue:l.value||t.value,hasFocus:a.value,hasError:t.error}]])},[e.createElementVNode("label",ke,e.toDisplayString(t.label),1),e.withDirectives(e.createElementVNode("input",{class:e.normalizeClass(["spicyInput",t.variant]),"onUpdate:modelValue":u[0]||(u[0]=i=>l.value=i),placeholder:t.placeholder,onInput:n,onBlur:c,onFocus:y},null,42,Se),[[e.vModelText,l.value]]),e.renderSlot(s.$slots,"default"),t.error?(e.openBlock(),e.createElementBlock("span",be,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)],2))}},Be={class:"spicyModalHeader"},Ce={class:"spicyModalActions"},we=["onClick"],O={__name:"SpicyModal",props:{width:{type:String,default:"50%"},height:{type:String,default:"auto"},borderRadius:{type:String,default:"8px"},bgColor:{type:String,default:"#2b2b2b"},visible:{type:Boolean,default:!1},closeBtn:{type:Boolean,default:!1},actions:{type:Array,default:()=>[]},closeOnClick:{type:Boolean,default:!0},modalTitle:{type:String,default:""}},emits:["update:visible"],setup(t,{emit:o}){const l=t,a=e.computed(()=>({"--width":l.width,"--height":l.height,"--skBorderRadius":l.borderRadius,"--skBgColor":l.bgColor})),n=o,c=()=>{n("update:visible",!1)},y=s=>{l.closeOnClick&&s.target.classList.contains("spicyModalOverlay")&&c()};return(s,u)=>t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyModalOverlay",onClick:y},[e.createElementVNode("div",{class:"spicyModal",style:e.normalizeStyle({...a.value})},[e.createElementVNode("header",Be,[e.renderSlot(s.$slots,"spicyModalHeader",{title:t.modalTitle},()=>[e.createTextVNode(e.toDisplayString(t.modalTitle),1)])]),e.renderSlot(s.$slots,"default"),e.createElementVNode("div",Ce,[e.renderSlot(s.$slots,"spicyModalActions"),t.actions.length===0&&t.closeBtn?(e.openBlock(),e.createElementBlock("button",{key:0,class:"closeBtn actionBtn",onClick:c},"Close")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,i=>(e.openBlock(),e.createElementBlock("button",{class:"extraBtn actionBtn",key:i.label,onClick:i.handler},e.toDisplayString(i.label),9,we))),128))])],4)])):e.createCommentVNode("",!0)}},Ee=["aria-checked","onKeydown","aria-label"],$e=[e.createElementVNode("div",{class:"spicyToggleKnob"},null,-1)],_={__name:"SpicyToggle",props:{modelValue:Boolean,label:{type:String,default:"Toggle"},variant:{type:String,default:"filled",validator:t=>["outlined","filled"].includes(t)},borderColor:String,activeColor:{type:String,default:"var(--skPrimaryColor)"}},emits:["update:modelValue"],setup(t,{emit:o}){const l=t,a=e.computed(()=>({"--skBorderColor":l.borderColor,"--activeColor":l.activeColor})),n=o,c=()=>{n("update:modelValue",!l.modelValue)};return(y,s)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:["spicyToggle",{outlined:t.variant==="outlined","is-active":t.modelValue}],tabindex:"0",role:"switch",style:{...a.value},onClick:c,"aria-checked":t.modelValue.toString(),onKeydown:[e.withKeys(e.withModifiers(c,["prevent"]),["space"]),e.withKeys(e.withModifiers(c,["prevent"]),["enter"])],"aria-label":t.label},y.$attrs),$e,16,Ee))}},De=["aria-hidden"],Te={key:0,class:"spicyTooltipIcon"},Ve={key:1,class:"spicyTooltipText"},Ne={key:2,class:"spicyTooltipIcon"},L={__name:"SpicyTooltip",props:{text:String,prependIcon:String,appendIcon:String,position:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)}},setup(t){const o=t,l=e.ref(!1),a=e.ref(null),n=e.reactive({position:"absolute",top:"0px",left:"0px",maxWidth:"175px"}),c=i=>{const p=i.right-window.innerWidth;p>0&&(n.left=`${parseInt(n.left)-p-5}px`),i.left<0&&(n.left="5px")},y={top:(i,p)=>{n.left=`${i.left+(i.width-p.width)/2}px`,n.top=`${i.top-p.height-5}px`},bottom:(i,p)=>{n.left=`${i.left+(i.width-p.width)/2}px`,n.top=`${i.bottom+5}px`},left:(i,p)=>{n.left=`${i.left-p.width-5}px`,n.top=`${i.top+(i.height-p.height)/2}px`},right:(i,p)=>{n.left=`${i.right+5}px`,n.top=`${i.top+(i.height-p.height)/2}px`}},s=()=>{l.value=!0,e.nextTick(()=>{if(a.value&&l.value){const i=a.value.getBoundingClientRect(),p=a.value.querySelector(".spicyTooltip").getBoundingClientRect(),d=y[o.position];d(i,p),c(p)}})},u=()=>{l.value=!1};return(i,p)=>(e.openBlock(),e.createElementBlock("div",{onMouseover:s,onMouseleave:u,ref_key:"host",ref:a},[e.renderSlot(i.$slots,"default"),l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spicyTooltip",style:e.normalizeStyle(n),role:"tooltip","aria-hidden":!l.value},[t.prependIcon?(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(t.prependIcon),1)):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("span",Ve,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.appendIcon?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(t.appendIcon),1)):e.createCommentVNode("",!0)],12,De)):e.createCommentVNode("",!0)],544))}};function D(t,o){const l={YYYY:()=>t.getFullYear().toString(),MM:()=>(t.getMonth()+1).toString().padStart(2,"0"),DD:()=>t.getDate().toString().padStart(2,"0")};return o.replace(/YYYY|MM|DD/g,a=>l[a]())}function K(t){const[o,l,a]=t.split("-");return new Date(Number(o),Number(l)-1,Number(a))}function P(t,o){const l=Math.abs(o.getTime()-t.getTime());return Math.ceil(l/(1e3*60*60*24))}function x(t,o){const l=new Date(t);return l.setDate(t.getDate()+o),l}function z(t,o){const l=new Date(t);return l.setDate(t.getDate()-o),l}function A(t){const o=new Date;return t.getDate()===o.getDate()&&t.getMonth()===o.getMonth()&&t.getFullYear()===o.getFullYear()}function Y(t){const o=new Date;return o.setDate(o.getDate()-1),t.getDate()===o.getDate()&&t.getMonth()===o.getMonth()&&t.getFullYear()===o.getFullYear()}function U(t){const o=new Date;return o.setDate(o.getDate()+1),t.getDate()===o.getDate()&&t.getMonth()===o.getMonth()&&t.getFullYear()===o.getFullYear()}function W(t="YYYY-MM-DD",o={show:!0,separator:"-"}){if(typeof t!="string"||typeof o!="object"||!o.hasOwnProperty("show")||typeof o.show!="boolean")throw new Error('Invalid parameters: Please provide a valid format string and options object with a boolean "show" property.');let a=D(new Date,t);return o.separator&&o.separator!=="-"&&(a=a.replace(/-/g,o.separator)),o.show?{value:a,isVisible:!0}:{value:a,isVisible:!1}}const Me=Object.freeze(Object.defineProperty({__proto__:null,currentDate:W,dateAdd:x,dateDiff:P,dateIsToday:A,dateIsTomorrow:U,dateIsYesterday:Y,dateSubtract:z,formatDate:D,parseDate:K},Symbol.toStringTag,{value:"Module"}));function j(t){const o=new WeakMap;function l(a){if(h(a)||typeof a!="object")return a;if(o.has(a))return o.get(a);const n=Array.isArray(a)?[]:{};o.set(a,n);for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(n[c]=l(a[c]));return n}return l(t)}function T(...t){const o={};return t.forEach(l=>{if(!h(l)){for(const a in l)if(Object.prototype.hasOwnProperty.call(l,a)){const n=l[a];n!==void 0&&(typeof n=="object"&&n!==null&&!Array.isArray(n)?o[a]=T(o[a]||{},n):o[a]=n)}}}),o}function H(...t){return h(t[0])?t[0]:Object.assign({},...t)}function X(t){return h(t)?[]:Object.keys(t)}function R(t){return h(t)?[]:Object.values(t)}function q(t){return h(t)?[]:Object.entries(t)}function h(t){return t===null||typeof t!="object"?!1:Array.isArray(t)?t.length===0:Object.keys(t).length===0}const Fe=Object.freeze(Object.defineProperty({__proto__:null,deepClone:j,deepMerge:T,getObjectEntries:q,getObjectKeys:X,getObjectValues:R,isObjectEmpty:h,mergeObjects:H},Symbol.toStringTag,{value:"Module"}));function C(t){try{return new URL(t),!0}catch(o){return console.error("Invalid URL:",o),!1}}function G(t){return C(t)?new URL(t).hostname:null}function J(t,o){if(!C(t))return t;const l=new URL(t);return Object.keys(o).forEach(a=>l.searchParams.append(a,o[a])),l.toString()}function Q(t,o,l="https"){if(!["http","https","ftp","sftp","ftps","ssh"].includes(l.toLowerCase()))throw new Error("Invalid protocol: "+l);if(!/^(?!:\/\/)([a-z0-9-]+\.)*[a-z0-9-]+$/i.test(t))throw new Error("Invalid hostname: "+t);return o.startsWith("/")||(o="/"+o),o.endsWith("/")&&o.length>1&&(o=o.slice(0,-1)),o==="/"&&(o=""),`${l.toLowerCase()}://${t}${o}`}const Ie=Object.freeze(Object.defineProperty({__proto__:null,appendParamsToUrl:J,generateUrl:Q,getHostname:G,isUrlValid:C},Symbol.toStringTag,{value:"Module"})),Z=':root{--skBgColor: #28292a;--skBgSecondaryColor: #424344;--skBorderColor: #515353;--skPrimaryColor: #811faf;--skSecondaryColor: #0066b3;--skAccentColor: #004a77;--skHoverColor: #656769;--skTextColor: #ddd;--disabledOpacity: .5;--skLabelFocus: var(--skPrimaryColor);--skFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;--skFontSize: 14px;--skFontWeight: 500;--skBorderWidth: 2px;--skBorderRadius: 4px}.spicyText{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:var(--skFontSize)}.spicyHeader{color:var(--skTextColor);font-family:var(--skFontFamily);font-size:24px;font-weight:700}.spicyLink:hover{color:var(--skHoverColor)}.spicyLink:active{color:var(--skPrimaryColor)}.spicyLink:focus{color:var(--skLabelFocus)}.spicyLink:disabled{opacity:var(--disabledOpacity)}',Oe={install(t,o={}){const{useComponents:l=!0,useStyles:a=!0}=o;if(l&&(t.component("SpicyAlert",V),t.component("SpicyBtn",N),t.component("SpicyCarousel",M),t.component("SpicyKeyboard",F),t.component("SpicyLabel",I),t.component("SpicyModal",O),t.component("SpicyToggle",_),t.component("SpicyTooltip",L)),a){const n=document.createElement("style");n.textContent=Z,document.head.appendChild(n)}}};r.SpicyAlert=V,r.SpicyBtn=N,r.SpicyCarousel=M,r.SpicyKeyboard=F,r.SpicyLabel=I,r.SpicyModal=O,r.SpicyToggle=_,r.SpicyTooltip=L,r.appendParamsToUrl=J,r.currentDate=W,r.dateAdd=x,r.dateDiff=P,r.dateIsToday=A,r.dateIsTomorrow=U,r.dateIsYesterday=Y,r.dateSubtract=z,r.dateUtils=Me,r.deepClone=j,r.deepMerge=T,r.default=Oe,r.formatDate=D,r.generateUrl=Q,r.getHostname=G,r.getObjectEntries=q,r.getObjectKeys=X,r.getObjectValues=R,r.isObjectEmpty=h,r.isUrlValid=C,r.mergeObjects=H,r.objUtils=Fe,r.parseDate=K,r.spicyStyles=Z,r.urlUtils=Ie,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .fade-enter-active,.fade-leave-active{transition:opacity .5s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.info{background-color:#e0e0e0;color:#333}.success{background-color:#d4edda;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyAlertIcon{margin-right:8px}.closeBtn{margin-left:auto;background:none;border:none;cursor:pointer}.spicyBtn{padding:8px 16px;background-color:var(--color, var(--primaryColor));border:none;border-radius:4px;color:var(--textColor, var(--primaryTextColor));cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--borderColor, var(--primaryBorderColor));color:#424242}.spicyBtn.disabled{opacity:.5;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor, grey)}.spicyBtn.outlined:hover:not(.disabled){background-color:var(--hoverColor, grey);color:var(--textColor, var(--primaryTextColor))}.spicyBtnIcon{margin-right:6px}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor, var(--primaryTextColor));transition:top .25s,font-size .25s,color .25s;pointer-events:none;font-size:18px;background-color:transparent}.spicyInput{padding:20px 16px 8px;border:none;border-bottom:1px solid var(--borderColor, var(--primaryBorderColor));font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor, var(--primaryTextColor))}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--labelFocus)}.outlined .spicyInput{border:1px solid var(--borderColor, var(--primaryBorderColor));border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--borderColor, var(--primaryBorderColor))}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-16px;font-size:16px;color:var(--labelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px;margin-top:4px}.spicyToggle{width:50px;height:24px;background-color:var(--borderColor, var(--primaryBorderColor));border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--activeColor, var(--primaryColor))}.spicyToggleKnob{width:20px;height:20px;background-color:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 2px 4px #0003}.spicyToggle.is-active .spicyToggleKnob{transform:translate(26px)}.spicyToggle:focus{outline:none;box-shadow:0 0 0 2px var(--foucsShadow, var(--primaryColor))}.spicyToggle.outlined{background-color:transparent;border:2px solid var(--borderColor, var(--primaryBorderColor))}.spicyToggle.outlined.is-active{background-color:var(--activeColor, var(--primaryColor))}
1
+ .fade-enter-active,.fade-leave-active{transition:opacity .35s}.fade-enter,.fade-leave-to{opacity:0}.spicyAlert{display:flex;align-items:center;padding:12px;border-radius:4px;margin-bottom:12px}.info{background-color:#e0e0e0;color:#333}.success{background-color:#bcf7c9;color:#155724}.warning{background-color:#fff3cd;color:#856404}.error{background-color:#ffbdc2;color:#911f2a}.spicyAlertIcon{margin-right:8px}.closeBtn{margin-left:auto;background:none;border:none;cursor:pointer}.spicyBtn{padding:8px 16px;background-color:var(--skBgColor, #28292a);border:none;border-radius:4px;color:var(--skTextColor, #ddd);cursor:pointer;font-size:14px;font-weight:500;text-transform:uppercase;transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--skBorderColor, #515353);color:var(--skTextColor, #ddd)}.spicyBtn.disabled{opacity:.5;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor, grey)}.spicyBtn.outlined:hover:not(.disabled){background-color:var(--hoverColor, grey);color:var(--skTextColor, #ddd)}.spicyBtnIcon{margin-right:6px}.carouselContainer{position:relative;overflow:hidden;width:var(--width, 540px);height:var(--height, 300px);border-radius:var(--borderRadius)}.slide{position:absolute;top:0;left:0;width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat;transition:transform .3s ease}.textOverlay{position:absolute;bottom:10px;left:10px;background-color:#000000bf;padding:10px;color:#ccc;font-size:18px;font-weight:700;text-shadow:2px 2px 4px rgba(0,0,0,.5);border-radius:4px}.textOverlay.fullScreen{top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;text-align:center;background-color:#00000059}.slide-enter-active,.slide-leave-active{transition:opacity .3s}.slide-enter,.slide-leave-to{opacity:0}.prevNav,.nextNav{width:100%;display:flex;align-items:center}.navControls{height:100%;display:flex}.prevBtn,.nextBtn{position:absolute;border:none;font-size:24px;color:#ccc;cursor:pointer;z-index:1;text-shadow:0 0 5px black;background:#00000080;height:35px;width:35px;border-radius:50%}.prevBtnIcon,.nextBtnIcon{display:flex;align-items:center;justify-content:center}.prevBtn{left:6px}.nextBtn{right:6px}.pagination{position:absolute;bottom:4px;left:50%;transform:translate(-50%);text-shadow:0 0 5px black}.pageBtn{border:none;color:#ccc;cursor:pointer;margin:0 4px;background:#00000080;height:25px;width:25px;border-radius:50%;font-weight:700}.pageBtn.active{background:var(--activeColor);font-weight:700}.pointCursor{cursor:pointer}.kbContainer{display:flex;gap:10px;padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f0f0f0}.kbSidebar{display:flex;flex-direction:column;gap:5px}.sidebar label{display:flex;align-items:center;gap:5px}.spicyKB{display:flex;flex-direction:row;gap:5px;background-color:#333;border-radius:5px;padding:10px}.kbSection{display:flex;flex-direction:column;gap:5px}.spicyKBRow{display:flex;gap:5px}.spicyKBKey{padding:10px;border:1px solid #ccc;border-radius:5px;background-color:#f0f0f0;cursor:pointer;transition:background-color .2s ease;font-family:Courier New,Courier,monospace;font-weight:700;text-transform:uppercase}.spicyKBKey:hover,.spicyKBKey.is-active{background-color:#e0e0e0}.key-backspace{width:100px}.key-tab,.key-caps,.key-enter,.key-shift{width:120px}.key-ctrl,.key-win,.key-alt,.key-fn{width:70px}.key-space{width:400px}.key-fullwidth{width:100%}.key-small{width:60px}.key-wide{width:80px}.keyText{-webkit-user-select:none;user-select:none}.spicyInputWrapper{display:flex;flex-direction:column;position:relative}.spicyInputLabel{position:absolute;top:12px;left:16px;color:var(--textColor, var(--skTextColor));transition:top .25s,font-size .25s,color .25s;pointer-events:none;font-size:18px;background-color:transparent}.spicyInput{padding:20px 16px 8px;border:none;border-bottom:1px solid var(--skBorderColor, #515353);font-size:16px;width:100%;box-sizing:border-box;transition:border-color .25s;background-color:transparent;color:var(--textColor, var(--skTextColor, #ddd))}.spicyInputWrapper .spicyInput:focus{outline:none;border-color:var(--skLabelFocus)}.outlined .spicyInput{border:1px solid var(--skBorderColor, #515353);border-radius:4px}.filled .spicyInput{border:none;border-bottom:1px solid var(--skBorderColor, #515353)}.hasValue .spicyInputLabel,.hasFocus .spicyInputLabel{top:-18px;font-size:16px;color:var(--skLabelFocus);font-weight:700}.hasError .spicyInput{border-color:red}.spicyInputError{color:red;font-size:12px}.spicyModalOverlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#0009;display:flex;justify-content:center;align-items:center;z-index:1000}.spicyModal{padding:20px;box-shadow:0 0 6px 2px #0003;transition:transform .3s ease-out;font-size:15px;border-radius:var(--skBorderRadius);background-color:var(--skBgColor);z-index:1001}.spicyModalHeader{text-align:center;font-size:20px;font-weight:700}.spicyModalActions{margin-top:20px;text-align:right}.actionBtn{background-color:transparent;border:none;color:var(--skTextColor, #ddd);cursor:pointer}.actionBtn:hover{text-decoration:underline}.spicyToggle{width:50px;height:24px;background-color:var(--skBgSecondaryColor, #424344);border-radius:30px;cursor:pointer;padding:2px;transition:background-color .2s;display:inline-flex;align-items:center}.spicyToggle.is-active{background-color:var(--activeColor, var(--skPrimaryColor))}.spicyToggleKnob{width:20px;height:20px;background-color:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 2px 4px #0003}.spicyToggle.is-active .spicyToggleKnob{transform:translate(26px)}.spicyToggle.outlined{background-color:transparent;border:2px solid var(--skBorderColor, #515353)}.spicyToggle.outlined.is-active{background-color:var(--activeColor, var(--skPrimaryColor));border-color:var(--activeColor, var(--skPrimaryColor))}.spicyTooltip{z-index:9999;background-color:var(--skBgColor);color:var(--skTextColor);padding:8px;border-radius:4px;font-size:15px;border:1px solid var(--skBorderColor);display:flex;align-items:center;justify-content:center}.spicyTooltipIcon{font-size:18px}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "license": "MIT",
5
5
  "author": "Sato",
6
6
  "private": false,
7
- "version": "0.0.32",
7
+ "version": "0.0.34",
8
8
  "files": [
9
9
  "dist/",
10
10
  "package.json",
@@ -16,8 +16,9 @@
16
16
  "dev": "vite",
17
17
  "build": "vue-tsc && vite build",
18
18
  "publish": "npm publish",
19
- "docs:dev": "vitepress dev docs",
20
- "test": "jest"
19
+ "docsdev": "vitepress dev docs",
20
+ "docsbuild": "vitepress build docs",
21
+ "docspreview": "vitepress preview docs"
21
22
  },
22
23
  "dependencies": {
23
24
  "vue": "^3.4.23"
@@ -26,6 +27,7 @@
26
27
  "@vitejs/plugin-vue": "^5.0.4",
27
28
  "typescript": "^5.4.5",
28
29
  "vite": "^5.2.9",
30
+ "vitepress": "^1.1.3",
29
31
  "vue-tsc": "^2.0.13"
30
32
  }
31
33
  }