spicykatsu 0.0.37 → 0.0.39

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