spicykatsu 0.0.55 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +79 -3
  2. package/dist/lib/SpicyAccordion/SpicyAccordion.css +1 -1
  3. package/dist/lib/SpicyAccordion/SpicyAccordion.js +46 -63
  4. package/dist/lib/SpicyAlert/SpicyAlert.css +1 -1
  5. package/dist/lib/SpicyAlert/SpicyAlert.js +98 -88
  6. package/dist/lib/SpicyBtn/SpicyBtn.css +1 -1
  7. package/dist/lib/SpicyBtn/SpicyBtn.js +80 -76
  8. package/dist/lib/SpicyCarousel/SpicyCarousel.css +1 -1
  9. package/dist/lib/SpicyCarousel/SpicyCarousel.js +120 -130
  10. package/dist/lib/SpicyDialog/SpicyDialog.css +1 -1
  11. package/dist/lib/SpicyDialog/SpicyDialog.js +43 -55
  12. package/dist/lib/SpicyDivider/SpicyDivider.js +31 -29
  13. package/dist/lib/SpicyDropdown/SpicyDropdown.css +1 -1
  14. package/dist/lib/SpicyDropdown/SpicyDropdown.js +62 -67
  15. package/dist/lib/SpicyFileInput/SpicyFileInput.css +1 -1
  16. package/dist/lib/SpicyFileInput/SpicyFileInput.js +125 -109
  17. package/dist/lib/SpicyModal/SpicyModal.css +1 -1
  18. package/dist/lib/SpicyModal/SpicyModal.js +95 -88
  19. package/dist/lib/SpicyProgress/SpicyProgress.css +1 -1
  20. package/dist/lib/SpicyProgress/SpicyProgress.js +75 -73
  21. package/dist/lib/SpicySheet/SpicySheet.css +1 -1
  22. package/dist/lib/SpicySheet/SpicySheet.js +31 -24
  23. package/dist/lib/SpicySlider/SpicySlider.css +1 -1
  24. package/dist/lib/SpicySlider/SpicySlider.js +60 -51
  25. package/dist/lib/SpicyTabs/SpicyTabs.css +1 -1
  26. package/dist/lib/SpicyTabs/SpicyTabs.js +70 -82
  27. package/dist/lib/SpicyTextArea/SpicyTextArea.css +1 -1
  28. package/dist/lib/SpicyTextArea/SpicyTextArea.js +35 -35
  29. package/dist/lib/SpicyTextField/SpicyTextField.css +1 -1
  30. package/dist/lib/SpicyTextField/SpicyTextField.js +96 -83
  31. package/dist/lib/SpicyToggle/SpicyToggle.css +1 -1
  32. package/dist/lib/SpicyToggle/SpicyToggle.js +54 -46
  33. package/dist/lib/SpicyTooltip/SpicyTooltip.css +1 -1
  34. package/dist/lib/SpicyTooltip/SpicyTooltip.js +74 -77
  35. package/dist/lib/SpicyTree/SpicyTree.css +1 -1
  36. package/dist/lib/SpicyTree/SpicyTree.js +53 -21
  37. package/dist/spicykatsu.es.js +145 -146
  38. package/package.json +19 -12
  39. package/dist/lib/SpicyTreeNode/SpicyTreeNode.css +0 -1
  40. package/dist/lib/SpicyTreeNode/SpicyTreeNode.js +0 -55
  41. package/dist/lib/main/main.js +0 -4
  42. package/dist/lib/ripple/ripple.js +0 -4
  43. package/dist/spicykatsu.umd.js +0 -1
  44. package/dist/style.css +0 -1
  45. package/dist/types/components/SpicyAccordion.vue.d.ts +0 -25
  46. package/dist/types/components/SpicyAlert.vue.d.ts +0 -34
  47. package/dist/types/components/SpicyBtn.vue.d.ts +0 -40
  48. package/dist/types/components/SpicyCarousel.vue.d.ts +0 -51
  49. package/dist/types/components/SpicyDialog.vue.d.ts +0 -47
  50. package/dist/types/components/SpicyDivider.vue.d.ts +0 -29
  51. package/dist/types/components/SpicyDropdown.vue.d.ts +0 -28
  52. package/dist/types/components/SpicyFileInput.vue.d.ts +0 -47
  53. package/dist/types/components/SpicyModal.vue.d.ts +0 -53
  54. package/dist/types/components/SpicyProgress.vue.d.ts +0 -34
  55. package/dist/types/components/SpicySheet.vue.d.ts +0 -27
  56. package/dist/types/components/SpicySlider.vue.d.ts +0 -37
  57. package/dist/types/components/SpicyTabs.vue.d.ts +0 -27
  58. package/dist/types/components/SpicyTextArea.vue.d.ts +0 -35
  59. package/dist/types/components/SpicyTextField.vue.d.ts +0 -47
  60. package/dist/types/components/SpicyToggle.vue.d.ts +0 -21
  61. package/dist/types/components/SpicyTooltip.vue.d.ts +0 -29
  62. package/dist/types/components/SpicyTree.vue.d.ts +0 -11
  63. package/dist/types/components/SpicyTreeNode.vue.d.ts +0 -18
  64. package/dist/types/directives/spicyDrag.d.ts +0 -6
  65. package/dist/types/directives/spicyRipple.d.ts +0 -2
  66. package/dist/types/index.d.ts +0 -33
package/README.md CHANGED
@@ -1,7 +1,83 @@
1
1
  # SpicyKatsuLib
2
2
 
3
- Fun, simple library for Vue3. Something for me to play around with in my projects.
3
+ Fun, simple component library for Vue 3. Built as a personal playground — feel free to use it in your own projects.
4
4
 
5
- Feel free to clone the repo and run the `dev` script. The playground has an example of every component and directive.
5
+ 📖 **[Docs](https://satoru8.gitlab.io/spicykatsuvlib/)**  |  📦 **[npm](https://www.npmjs.com/package/spicykatsu)**
6
6
 
7
- Docs: [SpicyKatsu Docs](https://satoru8.gitlab.io/spicykatsuvlib/)
7
+ ---
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install spicykatsu
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import { createApp } from 'vue'
19
+ import App from './App.vue'
20
+ import { SpicyKatsu } from 'spicykatsu'
21
+ import 'spicykatsu/dist/style.css'
22
+
23
+ const app = createApp(App)
24
+ app.use(SpicyKatsu)
25
+ app.mount('#app')
26
+ ```
27
+
28
+ You can also import components individually for tree shaking:
29
+
30
+ ```ts
31
+ import { SpicyBtn, SpicyModal } from 'spicykatsu'
32
+ ```
33
+
34
+ ## Options
35
+
36
+ ```ts
37
+ app.use(SpicyKatsu, {
38
+ useComponents: true, // Register all components globally (default: true)
39
+ useStyles: true, // Inject CSS variables (default: true)
40
+ useDirectives: true // Register v-spicyDrag and v-spicyRipple (default: true)
41
+ })
42
+ ```
43
+
44
+ ## Components
45
+
46
+ | Component | Description |
47
+ |-----------|-------------|
48
+ | `SpicyAccordion` | Collapsible sections, single or multi-open |
49
+ | `SpicyAlert` | Dismissible alerts with variants and auto-close |
50
+ | `SpicyBtn` | Button with MDI icon support and ripple effect |
51
+ | `SpicyCarousel` | Image carousel with autoplay, touch, and pagination |
52
+ | `SpicyDialog` | Teleported overlay dialog |
53
+ | `SpicyDivider` | Horizontal or vertical divider |
54
+ | `SpicyDropdown` | Dropdown menu with click-outside close |
55
+ | `SpicyFileInput` | File input with drag-and-drop and multi-file preview |
56
+ | `SpicyModal` | Modal dialog with title, actions, and Escape-to-close |
57
+ | `SpicyProgress` | Linear and circular progress indicators |
58
+ | `SpicySheet` | Styled container/card |
59
+ | `SpicySlider` | Range slider input |
60
+ | `SpicyTabs` | Tabbed interface with scrollable tab bar |
61
+ | `SpicyTextArea` | Styled textarea |
62
+ | `SpicyTextField` | Text input with floating label, prefix, and validation |
63
+ | `SpicyToggle` | Toggle switch |
64
+ | `SpicyTooltip` | Hover tooltip with position control |
65
+ | `SpicyTree` | Recursive tree view |
66
+
67
+ ## Directives
68
+
69
+ | Directive | Description |
70
+ |-----------|-------------|
71
+ | `v-spicyDrag` | Makes any element draggable (mouse + touch). Accepts `{ axis: 'x' | 'y' }` |
72
+ | `v-spicyRipple` | Adds a Material-style ripple on click/touch |
73
+
74
+ ## Dev / Playground
75
+
76
+ Clone the repo and run:
77
+
78
+ ```bash
79
+ bun install
80
+ bun run dev
81
+ ```
82
+
83
+ The playground (`src/playground/Playground.vue`) has a live example of every component and directive.
@@ -1 +1 @@
1
- .spicyAccordion{border:1px solid #ddd;border-radius:4px;overflow:hidden}.spicyAccordionItem{border-bottom:1px solid #ddd}.spicyAccordionItem:last-child{border-bottom:none}.spicyAccordionHeader{background-color:#f5f5f5;border:none;padding:10px;text-align:left;width:100%;cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background-color .2s ease}.spicyAccordionHeader.open{background-color:#e0e0e0}.spicyAccordionHeader.open .accordionArrow{transform:rotate(180deg)}.spicyAccordionContent{padding:10px;background-color:#fff}.accordionToggle{display:flex;align-items:center;transition:transform .2s ease}.accordionArrow{width:20px;height:20px;transition:transform .2s}.fade-enter-active,.fade-leave-active{transition:opacity .2s ease}.fade-enter,.fade-leave-to{opacity:0}
1
+ .spicyAccordion{border:1px solid var(--skBorderColor,#ddd);border-radius:4px;overflow:hidden}.spicyAccordionItem{border-bottom:1px solid var(--skBorderColor,#ddd)}.spicyAccordionItem:last-child{border-bottom:none}.spicyAccordionHeader{background-color:var(--skBgSecondaryColor,#f5f5f5);color:var(--skTextColor,#333);text-align:left;cursor:pointer;border:none;justify-content:space-between;align-items:center;width:100%;padding:10px;transition:background-color .2s;display:flex}.spicyAccordionHeader.open{background-color:var(--skBgColor,#e0e0e0)}.spicyAccordionHeader.open .accordionArrow{transform:rotate(180deg)}.spicyAccordionContent{background-color:var(--skBgColor,#fff);color:var(--skTextColor,#333);padding:10px}.accordionToggle{align-items:center;transition:transform .2s;display:flex}.accordionArrow{width:20px;height:20px;transition:transform .2s}.fade-enter-active,.fade-leave-active{transition:opacity .2s}.fade-enter-from,.fade-leave-to{opacity:0}
@@ -1,64 +1,47 @@
1
- import { defineComponent as u, ref as v, openBlock as c, createElementBlock as i, Fragment as m, renderList as _, createElementVNode as o, normalizeClass as f, toDisplayString as g, createCommentVNode as h, createVNode as w, Transition as y, withCtx as C, withDirectives as k, renderSlot as A, vShow as O } from "vue";
2
- const S = { class: "spicyAccordion" }, B = ["onClick", "aria-expanded"], I = {
3
- key: 0,
4
- class: "accordionIcon",
5
- viewBox: "0 0 24 24",
6
- xmlns: "http://www.w3.org/2000/svg"
7
- }, N = ["d"], V = { class: "spicyAccordionContent" }, D = /* @__PURE__ */ u({
8
- __name: "SpicyAccordion",
9
- props: {
10
- sections: {},
11
- singleOpen: { type: Boolean, default: !1 },
12
- defaultOpen: {}
13
- },
14
- setup(p) {
15
- const r = p, s = v(r.defaultOpen || []), d = (e) => {
16
- if (r.singleOpen)
17
- s.value = s.value.includes(e) ? [] : [e];
18
- else {
19
- const t = s.value.indexOf(e);
20
- t === -1 ? s.value.push(e) : s.value.splice(t, 1);
21
- }
22
- }, l = (e) => s.value.includes(e);
23
- return (e, t) => (c(), i("div", S, [
24
- (c(!0), i(m, null, _(e.sections, (a, n) => (c(), i("div", {
25
- key: n,
26
- class: "spicyAccordionItem"
27
- }, [
28
- o("button", {
29
- class: f(["spicyAccordionHeader", { open: l(n) }]),
30
- onClick: ($) => d(n),
31
- "aria-expanded": l(n)
32
- }, [
33
- o("span", null, g(a.title), 1),
34
- a.icon ? (c(), i("svg", I, [
35
- o("path", {
36
- d: a.icon
37
- }, null, 8, N)
38
- ])) : h("", !0),
39
- t[0] || (t[0] = o("span", { class: "accordionToggle" }, [
40
- o("svg", {
41
- class: "accordionArrow",
42
- viewBox: "0 0 24 24"
43
- }, [
44
- o("path", { d: "M7 10l5 5 5-5H7z" })
45
- ])
46
- ], -1))
47
- ], 10, B),
48
- w(y, { name: "fade" }, {
49
- default: C(() => [
50
- k(o("div", V, [
51
- A(e.$slots, `section-${n}`)
52
- ], 512), [
53
- [O, l(n)]
54
- ])
55
- ]),
56
- _: 2
57
- }, 1024)
58
- ]))), 128))
59
- ]));
60
- }
1
+ import { Fragment as e, Transition as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, renderList as u, renderSlot as d, toDisplayString as f, vShow as p, withCtx as m, withDirectives as h } from "vue";
2
+ //#region src/components/SpicyAccordion/SpicyAccordion.css?inline
3
+ var g = ".spicyAccordion{border:1px solid var(--skBorderColor,#ddd);border-radius:4px;overflow:hidden}.spicyAccordionItem{border-bottom:1px solid var(--skBorderColor,#ddd)}.spicyAccordionItem:last-child{border-bottom:none}.spicyAccordionHeader{background-color:var(--skBgSecondaryColor,#f5f5f5);color:var(--skTextColor,#333);text-align:left;cursor:pointer;border:none;justify-content:space-between;align-items:center;width:100%;padding:10px;transition:background-color .2s;display:flex}.spicyAccordionHeader.open{background-color:var(--skBgColor,#e0e0e0)}.spicyAccordionHeader.open .accordionArrow{transform:rotate(180deg)}.spicyAccordionContent{background-color:var(--skBgColor,#fff);color:var(--skTextColor,#333);padding:10px}.accordionToggle{align-items:center;transition:transform .2s;display:flex}.accordionArrow{width:20px;height:20px;transition:transform .2s}.fade-enter-active,.fade-leave-active{transition:opacity .2s}.fade-enter-from,.fade-leave-to{opacity:0}", _ = { class: "spicyAccordion" }, v = ["onClick", "aria-expanded"], y = {
4
+ key: 0,
5
+ class: "accordionIcon",
6
+ viewBox: "0 0 24 24",
7
+ xmlns: "http://www.w3.org/2000/svg"
8
+ }, b = ["d"], x = { class: "spicyAccordionContent" }, S = /* @__PURE__ */ o({
9
+ __name: "SpicyAccordion",
10
+ props: {
11
+ sections: {},
12
+ singleOpen: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ defaultOpen: {}
17
+ },
18
+ setup(o) {
19
+ let g = o, S = l(g.defaultOpen || []), C = (e) => {
20
+ if (g.singleOpen) S.value = S.value.includes(e) ? [] : [e];
21
+ else {
22
+ let t = S.value.indexOf(e);
23
+ t === -1 ? S.value.push(e) : S.value.splice(t, 1);
24
+ }
25
+ }, w = (e) => S.value.includes(e);
26
+ return (l, g) => (c(), r("div", _, [(c(!0), r(e, null, u(o.sections, (e, o) => (c(), r("div", {
27
+ key: o,
28
+ class: "spicyAccordionItem"
29
+ }, [i("button", {
30
+ class: s(["spicyAccordionHeader", { open: w(o) }]),
31
+ onClick: (e) => C(o),
32
+ "aria-expanded": w(o)
33
+ }, [
34
+ i("span", null, f(e.title), 1),
35
+ e.icon ? (c(), r("svg", y, [i("path", { d: e.icon }, null, 8, b)])) : n("", !0),
36
+ g[0] ||= i("span", { class: "accordionToggle" }, [i("svg", {
37
+ class: "accordionArrow",
38
+ viewBox: "0 0 24 24"
39
+ }, [i("path", { d: "M7 10l5 5 5-5H7z" })])], -1)
40
+ ], 10, v), a(t, { name: "fade" }, {
41
+ default: m(() => [h(i("div", x, [d(l.$slots, `section-${o}`)], 512), [[p, w(o)]])]),
42
+ _: 2
43
+ }, 1024)]))), 128))]));
44
+ }
61
45
  });
62
- export {
63
- D as _
64
- };
46
+ //#endregion
47
+ export { g as n, S as t };
@@ -1 +1 @@
1
- .spicyAlert{display:flex;align-items:center;gap:10px;padding:12px}.spicyAlert.info{background-color:#e0e0e0;color:#333}.spicyAlert.success{background-color:#a3ffb7;color:#155724}.spicyAlert.warning{background-color:#ffecaf;color:#856404}.spicyAlert.error{background-color:#ffbdc2;color:#911f2a}.spicyAlert.spicyAlertRound{border-radius:8px}.spicyAlertIcon{width:24px;height:24px}.spicyAlertContainer{display:flex;flex-direction:column}.spicyAlertCloseBtn{margin-left:auto;background:none;border:none;cursor:pointer;width:20px;height:20px}.spicyAlertCloseBtn svg{width:20px;height:20px}.fade-enter-active,.fade-leave-active{transition:opacity .35s}.fade-enter,.fade-leave-to{opacity:0}
1
+ .spicyAlert{align-items:center;gap:10px;padding:12px;display:flex}.spicyAlert.info{color:#333;background-color:#e0e0e0}.spicyAlert.success{color:#155724;background-color:#a3ffb7}.spicyAlert.warning{color:#856404;background-color:#ffecaf}.spicyAlert.error{color:#911f2a;background-color:#ffbdc2}.spicyAlert.spicyAlertRound{border-radius:8px}.spicyAlertIcon{width:24px;height:24px}.spicyAlertContainer{flex-direction:column;display:flex}.spicyAlertCloseBtn{cursor:pointer;background:0 0;border:none;width:20px;height:20px;margin-left:auto}.spicyAlertCloseBtn svg{width:20px;height:20px}.fade-enter-active,.fade-leave-active{transition:opacity .35s}.fade-enter-from,.fade-leave-to{opacity:0}
@@ -1,89 +1,99 @@
1
- import { defineComponent as d, ref as p, watch as u, openBlock as t, createBlock as y, Transition as f, withCtx as h, createElementBlock as s, normalizeClass as m, withKeys as k, toDisplayString as n, createCommentVNode as o, createElementVNode as a, renderSlot as v } from "vue";
2
- const w = ["aria-label"], A = {
3
- key: 0,
4
- class: "spicyAlertIcon"
5
- }, _ = {
6
- key: 1,
7
- class: "spicyAlertIcon",
8
- viewBox: "0 0 24 24",
9
- xmlns: "http://www.w3.org/2000/svg"
10
- }, B = ["d"], C = { class: "spicyAlertContainer" }, b = {
11
- key: 0,
12
- class: "spicyAlertTitle"
13
- }, g = {
14
- key: 1,
15
- class: "spicyAlertText"
16
- }, I = {
17
- key: 0,
18
- viewBox: "0 0 24 24",
19
- xmlns: "http://www.w3.org/2000/svg"
20
- }, T = ["d"], O = { key: 1 }, V = /* @__PURE__ */ d({
21
- __name: "SpicyAlert",
22
- props: {
23
- variant: { default: "info" },
24
- title: {},
25
- text: {},
26
- icon: {},
27
- mdi: {},
28
- iconOnly: { type: Boolean, default: !1 },
29
- closable: { type: Boolean, default: !1 },
30
- autoClose: { default: 0 },
31
- closeIcon: {},
32
- isRound: { type: Boolean, default: !1 }
33
- },
34
- setup(r) {
35
- const c = r, i = p(!0), l = () => {
36
- i.value = !1;
37
- };
38
- return u(
39
- () => c.autoClose,
40
- (e) => {
41
- e && e > 0 && setTimeout(() => {
42
- l();
43
- }, e);
44
- }
45
- ), (e, R) => (t(), y(f, { name: "fade" }, {
46
- default: h(() => [
47
- i.value ? (t(), s("div", {
48
- key: 0,
49
- class: m(["spicyAlert", [e.variant, { spicyAlertRound: e.isRound }]]),
50
- "aria-atomic": "true",
51
- "aria-label": e.text || "Alert",
52
- role: "alert",
53
- onKeydown: k(l, ["enter"])
54
- }, [
55
- e.iconOnly && e.icon ? (t(), s("span", A, n(e.icon), 1)) : o("", !0),
56
- e.mdi ? (t(), s("svg", _, [
57
- a("path", {
58
- fill: "currentColor",
59
- class: "spicyAlertMDI",
60
- d: e.mdi
61
- }, null, 8, B)
62
- ])) : o("", !0),
63
- a("div", C, [
64
- e.title ? (t(), s("span", b, n(e.title), 1)) : o("", !0),
65
- !e.iconOnly && e.text ? (t(), s("span", g, n(e.text), 1)) : o("", !0)
66
- ]),
67
- e.closable ? (t(), s("button", {
68
- key: 2,
69
- class: "spicyAlertCloseBtn",
70
- onClick: l,
71
- "aria-label": "Close alert"
72
- }, [
73
- e.closeIcon ? (t(), s("svg", I, [
74
- a("path", {
75
- fill: "#000",
76
- d: e.closeIcon
77
- }, null, 8, T)
78
- ])) : (t(), s("span", O, "X"))
79
- ])) : o("", !0),
80
- e.text ? o("", !0) : v(e.$slots, "default", { key: 3 })
81
- ], 42, w)) : o("", !0)
82
- ]),
83
- _: 3
84
- }));
85
- }
1
+ import { Transition as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, onBeforeUnmount as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, watch as f, withCtx as p, withKeys as m } from "vue";
2
+ //#region src/components/SpicyAlert/SpicyAlert.css?inline
3
+ var h = ".spicyAlert{align-items:center;gap:10px;padding:12px;display:flex}.spicyAlert.info{color:#333;background-color:#e0e0e0}.spicyAlert.success{color:#155724;background-color:#a3ffb7}.spicyAlert.warning{color:#856404;background-color:#ffecaf}.spicyAlert.error{color:#911f2a;background-color:#ffbdc2}.spicyAlert.spicyAlertRound{border-radius:8px}.spicyAlertIcon{width:24px;height:24px}.spicyAlertContainer{flex-direction:column;display:flex}.spicyAlertCloseBtn{cursor:pointer;background:0 0;border:none;width:20px;height:20px;margin-left:auto}.spicyAlertCloseBtn svg{width:20px;height:20px}.fade-enter-active,.fade-leave-active{transition:opacity .35s}.fade-enter-from,.fade-leave-to{opacity:0}", g = ["aria-label"], _ = {
4
+ key: 0,
5
+ class: "spicyAlertIcon"
6
+ }, v = {
7
+ key: 1,
8
+ class: "spicyAlertIcon",
9
+ viewBox: "0 0 24 24",
10
+ xmlns: "http://www.w3.org/2000/svg"
11
+ }, y = ["d"], b = { class: "spicyAlertContainer" }, x = {
12
+ key: 0,
13
+ class: "spicyAlertTitle"
14
+ }, S = {
15
+ key: 1,
16
+ class: "spicyAlertText"
17
+ }, C = {
18
+ key: 0,
19
+ viewBox: "0 0 24 24",
20
+ xmlns: "http://www.w3.org/2000/svg"
21
+ }, w = ["d"], T = { key: 1 }, E = /* @__PURE__ */ a({
22
+ __name: "SpicyAlert",
23
+ props: {
24
+ variant: { default: "info" },
25
+ title: {},
26
+ text: {},
27
+ icon: {},
28
+ mdi: {},
29
+ iconOnly: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ closable: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ autoClose: { default: 0 },
38
+ closeIcon: {},
39
+ isRound: {
40
+ type: Boolean,
41
+ default: !1
42
+ }
43
+ },
44
+ setup(a) {
45
+ let h = a, E = l(!0), D = null, O = l(h.autoClose), k = null, A = () => {
46
+ E.value = !1;
47
+ }, j = () => {
48
+ O.value > 0 && (k = Date.now(), D = setTimeout(() => {
49
+ A();
50
+ }, O.value));
51
+ }, M = () => {
52
+ D &&= (clearTimeout(D), null);
53
+ }, N = () => {
54
+ if (D && k !== null) {
55
+ let e = Date.now() - k;
56
+ O.value = Math.max(0, O.value - e), M(), k = null;
57
+ }
58
+ }, P = () => {
59
+ j();
60
+ };
61
+ return f(() => h.autoClose, (e) => {
62
+ O.value = e, M(), j();
63
+ }), s(() => {
64
+ M();
65
+ }), j(), (s, l) => (c(), t(e, { name: "fade" }, {
66
+ default: p(() => [E.value ? (c(), r("div", {
67
+ key: 0,
68
+ class: o(["spicyAlert", [a.variant, { spicyAlertRound: a.isRound }]]),
69
+ "aria-atomic": "true",
70
+ "aria-label": a.text || "Alert",
71
+ role: "alert",
72
+ onKeydown: m(A, ["enter"]),
73
+ onMouseenter: N,
74
+ onMouseleave: P
75
+ }, [
76
+ a.iconOnly && a.icon ? (c(), r("span", _, d(a.icon), 1)) : n("", !0),
77
+ a.mdi ? (c(), r("svg", v, [i("path", {
78
+ fill: "currentColor",
79
+ class: "spicyAlertMDI",
80
+ d: a.mdi
81
+ }, null, 8, y)])) : n("", !0),
82
+ i("div", b, [a.title ? (c(), r("span", x, d(a.title), 1)) : n("", !0), !a.iconOnly && a.text ? (c(), r("span", S, d(a.text), 1)) : n("", !0)]),
83
+ a.closable ? (c(), r("button", {
84
+ key: 2,
85
+ class: "spicyAlertCloseBtn",
86
+ onClick: A,
87
+ "aria-label": "Close alert"
88
+ }, [a.closeIcon ? (c(), r("svg", C, [i("path", {
89
+ fill: "#000",
90
+ d: a.closeIcon
91
+ }, null, 8, w)])) : (c(), r("span", T, "X"))])) : n("", !0),
92
+ a.text ? n("", !0) : u(s.$slots, "default", { key: 3 })
93
+ ], 42, g)) : n("", !0)]),
94
+ _: 3
95
+ }));
96
+ }
86
97
  });
87
- export {
88
- V as _
89
- };
98
+ //#endregion
99
+ export { h as n, E as t };
@@ -1 +1 @@
1
- .spicyBtn{display:flex;align-items:center;justify-content:center;text-align:center;padding:8px 16px;gap:4px;border:none;border-radius:4px;cursor:pointer;color:var(--skTextColor, #ddd);background-color:var(--skBgColor, #28292a);font-size:var(--skFontSize, 16px);font-weight:var(--skFontWeight, 500);transition:background-color .25s}.spicyBtn.outlined{background-color:transparent;border:2px solid var(--skBorderColor, #515353)}.spicyBtn.disabled{opacity:.3;cursor:not-allowed}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor, grey)}.spicyBtn.isRound{border-radius:50px;padding:12px}.spicyBtn.large{padding:12px 24px;font-size:22px}.spicyBtn.large.isRound{padding:16px}.spicyBtn.large .spicyBtnIcon{width:40px}.spicyBtn .spicyBtnIcon{width:30px}
1
+ .spicyBtn{text-align:center;cursor:pointer;color:var(--skTextColor,#ddd);background-color:var(--skBgColor,#28292a);font-size:var(--skFontSize,16px);font-weight:var(--skFontWeight,500);-webkit-user-select:none;user-select:none;border:none;border-radius:4px;justify-content:center;align-items:center;gap:4px;padding:8px 16px;display:flex}.spicyBtn.outlined{border:2px solid var(--skBorderColor,#515353);background-color:#0000}.spicyBtn.disabled{opacity:.3;cursor:not-allowed;pointer-events:none}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor,grey)}.spicyBtn:focus-visible{outline:2px solid var(--skTextColor,#ddd);outline-offset:2px}.spicyBtn.isRound{border-radius:50px;padding:12px}.spicyBtn.large{font-size:calc(var(--skFontSize,16px) * 1.2);padding:12px 24px}.spicyBtn.large.isRound{padding:16px}.spicyBtn.large .spicyBtnIcon{width:32px;height:32px}.spicyBtn.small{font-size:calc(var(--skFontSize,16px) * .85);padding:4px 12px}.spicyBtn.small.isRound{padding:8px}.spicyBtn.small .spicyBtnIcon{width:18px;height:18px}.spicyBtn .spicyBtnIcon{justify-content:center;align-items:center;width:22px;height:22px;display:flex}
@@ -1,77 +1,81 @@
1
- import { defineComponent as f, computed as s, resolveDirective as C, withDirectives as y, openBlock as t, createElementBlock as i, normalizeClass as h, normalizeStyle as v, createElementVNode as k, createCommentVNode as l, toDisplayString as n, renderSlot as g } from "vue";
2
- const B = ["disabled", "aria-label", "aria-disabled", "tabindex"], S = {
3
- key: 0,
4
- class: "spicyBtnIcon",
5
- viewBox: "0 0 24 24",
6
- xmlns: "http://www.w3.org/2000/svg"
7
- }, z = ["d"], _ = {
8
- key: 1,
9
- class: "spicyBtnIcon"
10
- }, w = {
11
- key: 2,
12
- class: "spicyBtnText"
13
- }, R = /* @__PURE__ */ f({
14
- __name: "SpicyBtn",
15
- props: {
16
- variant: { default: "filled" },
17
- disabled: { type: Boolean, default: !1 },
18
- text: {},
19
- icon: {},
20
- mdi: {},
21
- size: {},
22
- bgColor: {},
23
- textColor: { default: "#ddd" },
24
- hoverColor: {},
25
- borderColor: {},
26
- fontSize: { default: 16 },
27
- fontWeight: { default: 500 }
28
- },
29
- emits: ["click"],
30
- setup(a, { emit: d }) {
31
- const r = d, c = () => {
32
- e.disabled || r("click");
33
- }, e = a, p = s(() => ({
34
- "--skFontSize": typeof e.fontSize == "number" ? `${e.fontSize}px` : e.fontSize,
35
- "--skFontWeight": e.fontWeight,
36
- "--skBgColor": e.bgColor,
37
- "--skTextColor": e.textColor,
38
- "--skBorderColor": e.borderColor,
39
- "--hoverColor": e.hoverColor
40
- })), u = s(() => !e.text && (e.icon || e.mdi)), b = s(() => ({
41
- spicyBtn: !0,
42
- outlined: e.variant === "outlined",
43
- disabled: e.disabled,
44
- isRound: u.value,
45
- large: e.size === "large"
46
- }));
47
- return (o, x) => {
48
- const m = C("spicyRipple");
49
- return y((t(), i("button", {
50
- class: h(b.value),
51
- style: v(p.value),
52
- disabled: o.disabled,
53
- onClick: c,
54
- role: "button",
55
- "aria-label": o.text,
56
- "aria-disabled": o.disabled,
57
- tabindex: o.disabled ? -1 : 0
58
- }, [
59
- o.mdi ? (t(), i("svg", S, [
60
- k("path", {
61
- fill: "currentColor",
62
- class: "spicyBtnMDI",
63
- d: o.mdi
64
- }, null, 8, z)
65
- ])) : l("", !0),
66
- o.icon && !o.mdi ? (t(), i("span", _, n(o.icon), 1)) : l("", !0),
67
- o.text ? (t(), i("span", w, n(o.text), 1)) : l("", !0),
68
- g(o.$slots, "default")
69
- ], 14, B)), [
70
- [m]
71
- ]);
72
- };
73
- }
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderSlot as c, resolveDirective as l, toDisplayString as u, withDirectives as d } from "vue";
2
+ //#region src/components/SpicyBtn/SpicyBtn.css?inline
3
+ var f = ".spicyBtn{text-align:center;cursor:pointer;color:var(--skTextColor,#ddd);background-color:var(--skBgColor,#28292a);font-size:var(--skFontSize,16px);font-weight:var(--skFontWeight,500);-webkit-user-select:none;user-select:none;border:none;border-radius:4px;justify-content:center;align-items:center;gap:4px;padding:8px 16px;display:flex}.spicyBtn.outlined{border:2px solid var(--skBorderColor,#515353);background-color:#0000}.spicyBtn.disabled{opacity:.3;cursor:not-allowed;pointer-events:none}.spicyBtn:hover:not(.disabled){background-color:var(--hoverColor,grey)}.spicyBtn:focus-visible{outline:2px solid var(--skTextColor,#ddd);outline-offset:2px}.spicyBtn.isRound{border-radius:50px;padding:12px}.spicyBtn.large{font-size:calc(var(--skFontSize,16px) * 1.2);padding:12px 24px}.spicyBtn.large.isRound{padding:16px}.spicyBtn.large .spicyBtnIcon{width:32px;height:32px}.spicyBtn.small{font-size:calc(var(--skFontSize,16px) * .85);padding:4px 12px}.spicyBtn.small.isRound{padding:8px}.spicyBtn.small .spicyBtnIcon{width:18px;height:18px}.spicyBtn .spicyBtnIcon{justify-content:center;align-items:center;width:22px;height:22px;display:flex}", p = [
4
+ "disabled",
5
+ "aria-label",
6
+ "aria-disabled",
7
+ "tabindex"
8
+ ], m = {
9
+ key: 0,
10
+ class: "spicyBtnIcon",
11
+ viewBox: "0 0 24 24",
12
+ xmlns: "http://www.w3.org/2000/svg"
13
+ }, h = ["d"], g = {
14
+ key: 1,
15
+ class: "spicyBtnIcon"
16
+ }, _ = {
17
+ key: 2,
18
+ class: "spicyBtnText"
19
+ }, v = /* @__PURE__ */ i({
20
+ __name: "SpicyBtn",
21
+ props: {
22
+ variant: { default: "filled" },
23
+ disabled: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ text: {},
28
+ icon: {},
29
+ mdi: {},
30
+ size: { default: "default" },
31
+ bgColor: {},
32
+ textColor: { default: "#ddd" },
33
+ hoverColor: {},
34
+ borderColor: {},
35
+ fontSize: { default: 16 },
36
+ fontWeight: { default: 500 },
37
+ ariaLabel: {}
38
+ },
39
+ emits: ["click"],
40
+ setup(i, { emit: f }) {
41
+ let v = f, y = (e) => {
42
+ b.disabled || v("click", e);
43
+ }, b = i, x = e(() => b.ariaLabel || b.text || "Button"), S = e(() => ({
44
+ "--skFontSize": typeof b.fontSize == "number" ? `${b.fontSize}px` : b.fontSize,
45
+ "--skFontWeight": b.fontWeight,
46
+ "--skBgColor": b.bgColor,
47
+ "--skTextColor": b.textColor,
48
+ "--skBorderColor": b.borderColor,
49
+ "--hoverColor": b.hoverColor
50
+ })), C = e(() => !b.text && (b.icon || b.mdi)), w = e(() => ({
51
+ spicyBtn: !0,
52
+ outlined: b.variant === "outlined",
53
+ disabled: b.disabled,
54
+ isRound: C.value,
55
+ [b.size]: b.size !== "default"
56
+ }));
57
+ return (e, f) => {
58
+ let v = l("spicyRipple");
59
+ return d((s(), n("button", {
60
+ class: a(w.value),
61
+ style: o(S.value),
62
+ disabled: i.disabled,
63
+ onClick: y,
64
+ role: "button",
65
+ "aria-label": x.value,
66
+ "aria-disabled": i.disabled,
67
+ tabindex: i.disabled ? -1 : 0
68
+ }, [
69
+ i.mdi ? (s(), n("svg", m, [r("path", {
70
+ fill: "currentColor",
71
+ class: "spicyBtnMDI",
72
+ d: i.mdi
73
+ }, null, 8, h)])) : i.icon ? (s(), n("span", g, u(i.icon), 1)) : t("", !0),
74
+ i.text ? (s(), n("span", _, u(i.text), 1)) : t("", !0),
75
+ c(e.$slots, "default")
76
+ ], 14, p)), [[v]]);
77
+ };
78
+ }
74
79
  });
75
- export {
76
- R as _
77
- };
80
+ //#endregion
81
+ export { f as n, v as t };
@@ -1 +1 @@
1
- .spicyCarouselWrapper{position:relative;width:var(--width, 580px);height:var(--height, 360px);padding:30px;display:flex;align-items:center;justify-content:center}.spicyCarouselWrapper .spicyCarouselTitle{position:absolute;top:0;width:var(--width, 580px);background-color:#0009;height:30px;color:#ccc;font-size:18px;font-weight:700}.spicyCarouselWrapper .spicyCarouselContainer{position:relative;overflow:hidden;width:100%;height:100%;border-radius:var(--borderRadius);background-color:#0009}.spicyCarouselWrapper .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}.spicyCarouselWrapper .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}.spicyCarouselWrapper .spicyCarouselTextOverlay.fullScreen{top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;text-align:center;background-color:#0000004d}.spicyCarouselWrapper .spicyCarouselNavControls{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:space-between;align-items:center;pointer-events:none}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselPrevBtn,.spicyCarouselWrapper .spicyCarouselNavControls .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}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselPrevBtn:hover,.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselNextBtn:hover{background:var(--skPrimaryColor)}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselPrevBtn{border-radius:6px 0 0 6px}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselNextBtn{border-radius:0 6px 6px 0}.spicyCarouselWrapper .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}.spicyCarouselWrapper .spicyCarouselPagination .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}.spicyCarouselWrapper .spicyCarouselPagination .spicyCarouselPageBtn.active{background:var(--activeColor, var(--skPrimaryColor))}.spicyCarouselWrapper .spicyCarouselPagination .spicyCarouselPageBtn:hover{background:var(--skPrimaryColor)}.spicyCarouselWrapper .pointCursor{cursor:pointer}.spicyCarouselWrapper .slide-enter-active,.spicyCarouselWrapper .slide-leave-active{transition:opacity .3s}.spicyCarouselWrapper .slide-enter,.spicyCarouselWrapper .slide-leave-to{opacity:0}
1
+ .spicyCarouselWrapper{width:var(--width,580px);height:var(--height,360px);justify-content:center;align-items:center;padding:30px;display:flex;position:relative}.spicyCarouselWrapper .spicyCarouselTitle{width:var(--width,580px);color:#ccc;background-color:#0009;height:30px;font-size:18px;font-weight:700;position:absolute;top:0}.spicyCarouselWrapper .spicyCarouselContainer{border-radius:var(--borderRadius);background-color:#0009;width:100%;height:100%;position:relative;overflow:hidden}.spicyCarouselWrapper .spicyCarouselSlide{background-position:50%;background-repeat:no-repeat;background-size:cover;width:100%;height:100%;transition:opacity .3s;position:absolute;top:0;left:0}.spicyCarouselWrapper .spicyCarouselTextOverlay{color:#ccc;text-shadow:2px 2px 4px #00000080;background-color:#000000bf;border-radius:4px;padding:10px;font-size:18px;font-weight:700;position:absolute;bottom:10px;left:10px}.spicyCarouselWrapper .spicyCarouselTextOverlay.fullScreen{text-align:center;background-color:#0000004d;justify-content:center;align-items:center;display:flex;inset:0}.spicyCarouselWrapper .spicyCarouselNavControls{pointer-events:none;justify-content:space-between;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselPrevBtn,.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselNextBtn{color:#ccc;cursor:pointer;pointer-events:auto;z-index:2;background:#0009;border:none;justify-content:center;align-items:center;width:30px;height:100%;font-size:24px;transition:transform .3s;display:flex}:is(.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselPrevBtn,.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselNextBtn):hover{background:var(--skPrimaryColor)}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselPrevBtn{border-radius:6px 0 0 6px}.spicyCarouselWrapper .spicyCarouselNavControls .spicyCarouselNextBtn{border-radius:0 6px 6px 0}.spicyCarouselWrapper .spicyCarouselPagination{height:30px;width:var(--width,580px);z-index:2;pointer-events:auto;background:#0009;justify-content:center;align-items:center;gap:8px;display:flex;position:absolute;bottom:0;left:50%;transform:translate(-50%)}.spicyCarouselWrapper .spicyCarouselPagination .spicyCarouselPageBtn{color:#fff;cursor:pointer;background:#00b7ff80;border:none;border-radius:50%;justify-content:center;align-items:center;width:26px;height:26px;transition:transform .3s;display:flex}.spicyCarouselWrapper .spicyCarouselPagination .spicyCarouselPageBtn.active{background:var(--activeColor,var(--skPrimaryColor))}.spicyCarouselWrapper .spicyCarouselPagination .spicyCarouselPageBtn:hover{background:var(--skPrimaryColor)}.spicyCarouselWrapper .pointCursor{cursor:pointer}.spicyCarouselWrapper .slide-enter-active,.spicyCarouselWrapper .slide-leave-active{transition:opacity .3s}.spicyCarouselWrapper .slide-enter-from,.spicyCarouselWrapper .slide-leave-to{opacity:0}