@gkucmierz/nano-ui 1.2.1 → 1.2.2

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/dist/nano-ui.css CHANGED
@@ -1,2 +1,2 @@
1
- .global-tooltip[data-v-37c91a21]{--nu-tooltip-bg:#0f172af2;--nu-tooltip-color:#f8fafc;--nu-tooltip-radius:8px;--nu-tooltip-padding:8px 14px;--nu-tooltip-shadow:0 8px 24px #0000004d;--nu-tooltip-border:1px solid #ffffff1a;--nu-tooltip-arrow-border:#ffffff1a;z-index:99999;background:var(--nu-tooltip-bg);-webkit-backdrop-filter:blur(8px);color:var(--nu-tooltip-color);padding:var(--nu-tooltip-padding);border-radius:var(--nu-tooltip-radius);text-align:center;white-space:normal;word-wrap:break-word;pointer-events:none;width:max-content;max-width:min(350px,100vw - 32px);box-shadow:var(--nu-tooltip-shadow);border:var(--nu-tooltip-border);opacity:0;visibility:hidden;font-size:.85rem;font-weight:500;line-height:1.4;transition:opacity .2s cubic-bezier(.16,1,.3,1),transform .2s cubic-bezier(.16,1,.3,1);position:fixed;top:0;left:0;transform:translateY(4px)scale(.95)}.global-tooltip[data-v-37c91a21]:after{content:"";left:calc(50% + var(--arrow-offset,0px));background:var(--nu-tooltip-bg);-webkit-backdrop-filter:blur(8px);border-right:1px solid var(--nu-tooltip-arrow-border);border-bottom:1px solid var(--nu-tooltip-arrow-border);clip-path:polygon(100% 0,100% 100%,0 100%);border-radius:0 0 2px;width:10px;height:10px;margin-left:-5px;position:absolute;bottom:-5px;transform:rotate(45deg)}.global-tooltip.tooltip-bottom[data-v-37c91a21]:after{border-bottom:none;border-right:none;border-left:1px solid var(--nu-tooltip-arrow-border);border-top:1px solid var(--nu-tooltip-arrow-border);clip-path:polygon(0 0,100% 0,0 100%);border-radius:2px 0 0;top:-5px;bottom:auto}.global-tooltip.visible[data-v-37c91a21]{opacity:1;visibility:visible}span.ripple{background-color:var(--nano-ripple-color,#fff6);pointer-events:none;border-radius:50%;animation:.6s linear nano-ripple-anim;position:absolute;transform:scale(0)}@keyframes nano-ripple-anim{to{opacity:0;transform:scale(4)}}
1
+ .global-tooltip[data-v-37c91a21]{--nu-tooltip-bg:#0f172af2;--nu-tooltip-color:#f8fafc;--nu-tooltip-radius:8px;--nu-tooltip-padding:8px 14px;--nu-tooltip-shadow:0 8px 24px #0000004d;--nu-tooltip-border:1px solid #ffffff1a;--nu-tooltip-arrow-border:#ffffff1a;z-index:99999;background:var(--nu-tooltip-bg);-webkit-backdrop-filter:blur(8px);color:var(--nu-tooltip-color);padding:var(--nu-tooltip-padding);border-radius:var(--nu-tooltip-radius);text-align:center;white-space:normal;word-wrap:break-word;pointer-events:none;width:max-content;max-width:min(350px,100vw - 32px);box-shadow:var(--nu-tooltip-shadow);border:var(--nu-tooltip-border);opacity:0;visibility:hidden;font-size:.85rem;font-weight:500;line-height:1.4;transition:opacity .2s cubic-bezier(.16,1,.3,1),transform .2s cubic-bezier(.16,1,.3,1);position:fixed;top:0;left:0;transform:translateY(4px)scale(.95)}.global-tooltip[data-v-37c91a21]:after{content:"";left:calc(50% + var(--arrow-offset,0px));background:var(--nu-tooltip-bg);-webkit-backdrop-filter:blur(8px);border-right:1px solid var(--nu-tooltip-arrow-border);border-bottom:1px solid var(--nu-tooltip-arrow-border);clip-path:polygon(100% 0,100% 100%,0 100%);border-radius:0 0 2px;width:10px;height:10px;margin-left:-5px;position:absolute;bottom:-5px;transform:rotate(45deg)}.global-tooltip.tooltip-bottom[data-v-37c91a21]:after{border-bottom:none;border-right:none;border-left:1px solid var(--nu-tooltip-arrow-border);border-top:1px solid var(--nu-tooltip-arrow-border);clip-path:polygon(0 0,100% 0,0 100%);border-radius:2px 0 0;top:-5px;bottom:auto}.global-tooltip.visible[data-v-37c91a21]{opacity:1;visibility:visible}:root{--nano-modal-bg:#1e1e24;--nano-modal-glass-bg:#1e1e24d9;--nano-modal-border:#ffffff1a;--nano-modal-text:#fff;--nano-modal-text-muted:#a0a0a0;--nano-modal-backdrop:#0009;--nano-modal-radius:12px;--nano-btn-primary:#3498db;--nano-btn-primary-hover:#2980b9;--nano-btn-secondary:#34495e;--nano-btn-secondary-hover:#2c3e50}.nano-modal-overlay{z-index:99999;background:var(--nano-modal-backdrop);box-sizing:border-box;outline:none;justify-content:center;align-items:center;width:100vw;height:100vh;padding:20px;display:flex;position:fixed;top:0;left:0}.nano-modal-overlay.nano-glass{-webkit-backdrop-filter:blur(8px)}.nano-modal-window{background:var(--nano-modal-bg);border:1px solid var(--nano-modal-border);border-radius:var(--nano-modal-radius);max-height:90vh;color:var(--nano-modal-text);flex-direction:column;display:flex;position:relative;box-shadow:0 24px 48px #00000080}.nano-modal-window:not([style*="position: absolute"]){margin:auto}.nano-glass .nano-modal-window{background:var(--nano-modal-glass-bg);-webkit-backdrop-filter:blur(16px)}.nano-modal-header{border-bottom:1px solid var(--nano-modal-border);-webkit-user-select:none;user-select:none;background:#0003;justify-content:space-between;align-items:center;padding:16px 24px;display:flex}.nano-modal-header.is-draggable{cursor:grab}.nano-modal-header.is-draggable:active{cursor:grabbing}.nano-modal-title{margin:0;font-size:1.25rem;font-weight:600;line-height:1.4}.nano-modal-close-btn{color:var(--nano-modal-text-muted);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:4px;transition:all .2s;display:flex}.nano-modal-close-btn:hover{color:var(--nano-modal-text);background:#ffffff1a}.nano-modal-body{flex:1;padding:24px;overflow-y:auto}.nano-modal-footer{border-top:1px solid var(--nano-modal-border);background:#00000026;justify-content:flex-end;padding:16px 24px;display:flex}.nano-modal-actions{gap:12px;display:flex}.nano-btn{cursor:pointer;color:#fff;border:none;border-radius:6px;padding:8px 16px;font-size:.95rem;font-weight:600;transition:all .2s}.nano-btn-primary{background:var(--nano-btn-primary)}.nano-btn-primary:hover{background:var(--nano-btn-primary-hover)}.nano-btn-secondary{background:var(--nano-btn-secondary)}.nano-btn-secondary:hover{background:var(--nano-btn-secondary-hover)}.nano-modal-resizer{cursor:se-resize;width:16px;height:16px;color:var(--nano-modal-text-muted);z-index:10;justify-content:center;align-items:center;transition:color .2s;display:flex;position:absolute;bottom:4px;right:4px}.nano-modal-resizer:hover{color:var(--nano-modal-text)}.nano-modal-fade-enter-active,.nano-modal-fade-leave-active{transition:opacity .25s}.nano-modal-fade-enter-active .nano-modal-window{transition:transform .3s cubic-bezier(.175,.885,.32,1.275)}.nano-modal-fade-leave-active .nano-modal-window{transition:transform .2s ease-in}.nano-modal-fade-enter-from,.nano-modal-fade-leave-to{opacity:0}.nano-modal-fade-enter-from .nano-modal-window{transform:scale(.9)translateY(10px)}.nano-modal-fade-leave-to .nano-modal-window{transform:scale(.95)translateY(-10px)}span.ripple{background-color:var(--nano-ripple-color,#fff6);pointer-events:none;border-radius:50%;animation:.6s linear nano-ripple-anim;position:absolute;transform:scale(0)}@keyframes nano-ripple-anim{to{opacity:0;transform:scale(4)}}
2
2
  /*$vite$:1*/
package/dist/nano-ui.js CHANGED
@@ -1,115 +1,328 @@
1
- import { createElementBlock as e, nextTick as t, normalizeClass as n, normalizeStyle as r, openBlock as i, reactive as a, ref as o, toDisplayString as s, unref as c, watch as l } from "vue";
1
+ import { Teleport as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onUnmounted as f, openBlock as p, reactive as m, ref as h, renderSlot as g, resolveDirective as _, toDisplayString as v, unref as y, watch as b, withCtx as x, withDirectives as S, withKeys as C, withModifiers as w } from "vue";
2
2
  //#region src/directives/ripple.js
3
- var u = { mounted(e, t) {
3
+ var T = { mounted(e, t) {
4
4
  e.style.position = "relative", e.style.overflow = "hidden", e.addEventListener("click", function(n) {
5
5
  let r = e.getBoundingClientRect(), i = n.clientX - r.left, a = n.clientY - r.top, o = document.createElement("span"), s = Math.max(r.width, r.height), c = s / 2;
6
6
  o.style.width = o.style.height = `${s}px`, o.style.left = `${i - c}px`, o.style.top = `${a - c}px`, o.classList.add("ripple"), t.value && typeof t.value == "string" && (o.style.backgroundColor = t.value), e.appendChild(o), setTimeout(() => {
7
7
  o.remove();
8
8
  }, 600);
9
9
  });
10
- } }, d = a({
10
+ } }, E = m({
11
11
  isVisible: !1,
12
12
  text: "",
13
13
  customClass: "",
14
14
  targetRect: null
15
15
  });
16
- function f(e, t) {
16
+ function D(e, t) {
17
17
  if (!t) return;
18
18
  let n = typeof t == "object" ? t.text : t, r = typeof t == "object" && t.class || "";
19
19
  if (!n) return;
20
20
  e.hasAttribute("aria-label") || e.setAttribute("aria-label", n);
21
21
  let i = e.getBoundingClientRect();
22
- d.targetRect = {
22
+ E.targetRect = {
23
23
  top: i.top,
24
24
  left: i.left,
25
25
  width: i.width,
26
26
  bottom: i.bottom,
27
27
  right: i.right
28
- }, d.text = n, d.customClass = r, d.isVisible = !0;
28
+ }, E.text = n, E.customClass = r, E.isVisible = !0;
29
29
  }
30
- typeof window < "u" && window.addEventListener("scroll", p, {
30
+ typeof window < "u" && window.addEventListener("scroll", O, {
31
31
  passive: !0,
32
32
  capture: !0
33
33
  });
34
- function p() {
35
- d.isVisible = !1;
34
+ function O() {
35
+ E.isVisible = !1;
36
36
  }
37
37
  //#endregion
38
38
  //#region src/directives/tooltip.js
39
- var m = {
39
+ var k = {
40
40
  mounted(e, t) {
41
41
  e._tooltipOptions = t.value;
42
42
  let n = null, r = !1;
43
43
  e._handleMouseEnter = () => {
44
- r || f(e, e._tooltipOptions);
44
+ r || D(e, e._tooltipOptions);
45
45
  }, e._handleMouseLeave = () => {
46
- r || p();
46
+ r || O();
47
47
  }, e._handleFocus = () => {
48
- r || f(e, e._tooltipOptions);
48
+ r || D(e, e._tooltipOptions);
49
49
  }, e._handleBlur = () => {
50
- r || p();
50
+ r || O();
51
51
  }, e._handleTouchStart = () => {
52
52
  r = !0, n && clearTimeout(n), n = setTimeout(() => {
53
- f(e, e._tooltipOptions);
53
+ D(e, e._tooltipOptions);
54
54
  }, 400);
55
55
  }, e._handleTouchEnd = () => {
56
- n && clearTimeout(n), p(), setTimeout(() => {
56
+ n && clearTimeout(n), O(), setTimeout(() => {
57
57
  r = !1;
58
58
  }, 500);
59
59
  }, e._handleTouchCancel = () => {
60
- n && clearTimeout(n), p(), setTimeout(() => {
60
+ n && clearTimeout(n), O(), setTimeout(() => {
61
61
  r = !1;
62
62
  }, 500);
63
63
  }, e._handleContextMenu = (t) => {
64
64
  let n = typeof e._tooltipOptions == "object" ? e._tooltipOptions.text : e._tooltipOptions;
65
- r && d.isVisible && d.text === n && t.preventDefault();
65
+ r && E.isVisible && E.text === n && t.preventDefault();
66
66
  }, e.addEventListener("mouseenter", e._handleMouseEnter), e.addEventListener("mouseleave", e._handleMouseLeave), e.addEventListener("focus", e._handleFocus), e.addEventListener("blur", e._handleBlur), e.addEventListener("touchstart", e._handleTouchStart, { passive: !0 }), e.addEventListener("touchend", e._handleTouchEnd), e.addEventListener("touchmove", e._handleTouchCancel, { passive: !0 }), e.addEventListener("touchcancel", e._handleTouchCancel), e.addEventListener("contextmenu", e._handleContextMenu);
67
67
  },
68
68
  updated(e, t) {
69
69
  e._tooltipOptions = t.value;
70
70
  let n = typeof t.value == "object" ? t.value.text : t.value;
71
- d.isVisible && d.text !== n && (e.matches(":hover") || document.activeElement === e) && f(e, t.value);
71
+ E.isVisible && E.text !== n && (e.matches(":hover") || document.activeElement === e) && D(e, t.value);
72
72
  },
73
73
  unmounted(e) {
74
- e._handleMouseEnter && (e.removeEventListener("mouseenter", e._handleMouseEnter), e.removeEventListener("mouseleave", e._handleMouseLeave), e.removeEventListener("focus", e._handleFocus), e.removeEventListener("blur", e._handleBlur), e.removeEventListener("touchstart", e._handleTouchStart), e.removeEventListener("touchend", e._handleTouchEnd), e.removeEventListener("touchmove", e._handleTouchCancel), e.removeEventListener("touchcancel", e._handleTouchCancel), e.removeEventListener("contextmenu", e._handleContextMenu)), p();
74
+ e._handleMouseEnter && (e.removeEventListener("mouseenter", e._handleMouseEnter), e.removeEventListener("mouseleave", e._handleMouseLeave), e.removeEventListener("focus", e._handleFocus), e.removeEventListener("blur", e._handleBlur), e.removeEventListener("touchstart", e._handleTouchStart), e.removeEventListener("touchend", e._handleTouchEnd), e.removeEventListener("touchmove", e._handleTouchCancel), e.removeEventListener("touchcancel", e._handleTouchCancel), e.removeEventListener("contextmenu", e._handleContextMenu)), O();
75
75
  }
76
- }, h = /* @__PURE__ */ ((e, t) => {
76
+ }, A = /* @__PURE__ */ ((e, t) => {
77
77
  let n = e.__vccOpts || e;
78
78
  for (let [e, r] of t) n[e] = r;
79
79
  return n;
80
80
  })({
81
81
  __name: "GlobalTooltip",
82
- setup(a) {
83
- let u = o(null), f = o(0), p = o(0), m = o(0), h = o(!1);
84
- return l(() => d.isVisible, async (e) => {
82
+ setup(e) {
83
+ let t = h(null), n = h(0), r = h(0), i = h(0), o = h(!1);
84
+ return b(() => E.isVisible, async (e) => {
85
85
  if (e) {
86
- if (await t(), !u.value || !d.targetRect) return;
87
- let e = d.targetRect, n = u.value.getBoundingClientRect(), r = window.innerWidth, i = window.innerHeight, a = e.top, o = i - e.bottom, s = e.top - n.height - 8;
88
- h.value = !1, (s < 8 || a < n.height + 8 && o > a) && (s = e.bottom + 8, h.value = !0), s + n.height > i - 8 && (s = i - n.height - 8), s < 8 && (s = 8);
89
- let c = e.left + e.width / 2, l = c - n.width / 2;
90
- l < 8 ? l = 8 : l + n.width > r - 8 && (l = r - n.width - 8);
91
- let g = c - (l + n.width / 2), _ = n.width / 2 - 12;
92
- g > _ && (g = _), g < -_ && (g = -_), m.value = g, f.value = l, p.value = s;
86
+ if (await l(), !t.value || !E.targetRect) return;
87
+ let e = E.targetRect, a = t.value.getBoundingClientRect(), s = window.innerWidth, c = window.innerHeight, u = e.top, d = c - e.bottom, f = e.top - a.height - 8;
88
+ o.value = !1, (f < 8 || u < a.height + 8 && d > u) && (f = e.bottom + 8, o.value = !0), f + a.height > c - 8 && (f = c - a.height - 8), f < 8 && (f = 8);
89
+ let p = e.left + e.width / 2, m = p - a.width / 2;
90
+ m < 8 ? m = 8 : m + a.width > s - 8 && (m = s - a.width - 8);
91
+ let h = p - (m + a.width / 2), g = a.width / 2 - 12;
92
+ h > g && (h = g), h < -g && (h = -g), i.value = h, n.value = m, r.value = f;
93
93
  }
94
- }), (t, a) => (i(), e("div", {
94
+ }), (e, s) => (p(), a("div", {
95
95
  ref_key: "tooltipRef",
96
- ref: u,
97
- class: n([
96
+ ref: t,
97
+ class: u([
98
98
  "global-tooltip",
99
99
  {
100
- visible: c(d).isVisible,
101
- "tooltip-bottom": h.value
100
+ visible: y(E).isVisible,
101
+ "tooltip-bottom": o.value
102
102
  },
103
- c(d).customClass
103
+ y(E).customClass
104
104
  ]),
105
- style: r({
106
- transform: `translate(${f.value}px, ${p.value}px)`,
107
- "--arrow-offset": `${m.value}px`
105
+ style: d({
106
+ transform: `translate(${n.value}px, ${r.value}px)`,
107
+ "--arrow-offset": `${i.value}px`
108
108
  })
109
- }, s(c(d).text), 7));
109
+ }, v(y(E).text), 7));
110
110
  }
111
- }, [["__scopeId", "data-v-37c91a21"]]), g = { install(e) {
112
- e.directive("ripple", u), e.directive("tooltip", m), e.component("GlobalTooltip", h);
111
+ }, [["__scopeId", "data-v-37c91a21"]]), ee = { class: "nano-modal-title" }, te = {
112
+ key: 1,
113
+ class: "nano-modal-body"
114
+ }, j = {
115
+ key: 2,
116
+ class: "nano-modal-footer"
117
+ }, M = { class: "nano-modal-actions" }, N = {
118
+ __name: "NanoModal",
119
+ props: {
120
+ visible: {
121
+ type: Boolean,
122
+ default: !0
123
+ },
124
+ title: {
125
+ type: String,
126
+ default: ""
127
+ },
128
+ width: {
129
+ type: [String, Number],
130
+ default: 600
131
+ },
132
+ height: {
133
+ type: [String, Number],
134
+ default: "auto"
135
+ },
136
+ showHeader: {
137
+ type: Boolean,
138
+ default: !0
139
+ },
140
+ showBody: {
141
+ type: Boolean,
142
+ default: !0
143
+ },
144
+ showFooter: {
145
+ type: Boolean,
146
+ default: !0
147
+ },
148
+ showOk: {
149
+ type: Boolean,
150
+ default: !0
151
+ },
152
+ showCancel: {
153
+ type: Boolean,
154
+ default: !0
155
+ },
156
+ okText: {
157
+ type: String,
158
+ default: "OK"
159
+ },
160
+ cancelText: {
161
+ type: String,
162
+ default: "Cancel"
163
+ },
164
+ okVariant: {
165
+ type: String,
166
+ default: "primary"
167
+ },
168
+ closeOnBackdrop: {
169
+ type: Boolean,
170
+ default: !0
171
+ },
172
+ glassmorphism: {
173
+ type: Boolean,
174
+ default: !0
175
+ },
176
+ draggable: {
177
+ type: Boolean,
178
+ default: !1
179
+ },
180
+ resizable: {
181
+ type: Boolean,
182
+ default: !1
183
+ },
184
+ minWidth: {
185
+ type: Number,
186
+ default: 300
187
+ },
188
+ minHeight: {
189
+ type: Number,
190
+ default: 200
191
+ }
192
+ },
193
+ emits: [
194
+ "close",
195
+ "ok",
196
+ "cancel"
197
+ ],
198
+ setup(m, { emit: y }) {
199
+ let T = m, E = y, D = h(null), O = h(null), k = h(null), A = h(null), N = h(null), P = h(null), F = h(!1), I = h(!1), L = 0, R = 0, z = 0, B = 0, V = 0, H = 0, U = 0, W = 0, G = n(() => {
200
+ let e = {};
201
+ return N.value === null ? (e.maxWidth = typeof T.width == "number" ? `${T.width}px` : T.width, e.width = "100%") : (e.width = `${N.value}px`, e.maxWidth = "none"), P.value === null ? T.height !== "auto" && (e.height = typeof T.height == "number" ? `${T.height}px` : T.height) : (e.height = `${P.value}px`, e.maxHeight = "none"), k.value !== null && A.value !== null && (e.position = "absolute", e.left = `${k.value}px`, e.top = `${A.value}px`, e.transform = "none", e.margin = "0"), e;
202
+ }), K = (e) => {
203
+ if (T.draggable && !(e.target.tagName === "BUTTON" || e.target.closest("button"))) {
204
+ if (F.value = !0, L = e.clientX, R = e.clientY, k.value === null) {
205
+ let e = O.value.getBoundingClientRect();
206
+ k.value = e.left, A.value = e.top, N.value === null && (N.value = e.width), P.value === null && (P.value = e.height);
207
+ }
208
+ z = k.value, B = A.value, window.addEventListener("mousemove", q), window.addEventListener("mouseup", J);
209
+ }
210
+ }, q = (e) => {
211
+ if (!F.value) return;
212
+ let t = z + (e.clientX - L), n = B + (e.clientY - R), r = window.innerWidth, i = window.innerHeight, a = O.value.getBoundingClientRect();
213
+ t < 0 && (t = 0), n < 0 && (n = 0), t + a.width > r && (t = r - a.width), n + a.height > i && (n = i - a.height), k.value = t, A.value = n;
214
+ }, J = () => {
215
+ F.value = !1, window.removeEventListener("mousemove", q), window.removeEventListener("mouseup", J);
216
+ }, Y = (e) => {
217
+ if (!T.resizable) return;
218
+ e.preventDefault(), e.stopPropagation(), I.value = !0, V = e.clientX, H = e.clientY;
219
+ let t = O.value.getBoundingClientRect();
220
+ k.value === null && (k.value = t.left, A.value = t.top), U = t.width, W = t.height, window.addEventListener("mousemove", X), window.addEventListener("mouseup", Z);
221
+ }, X = (e) => {
222
+ if (!I.value) return;
223
+ let t = U + (e.clientX - V), n = W + (e.clientY - H);
224
+ t < T.minWidth && (t = T.minWidth), n < T.minHeight && (n = T.minHeight);
225
+ let r = window.innerWidth - k.value, i = window.innerHeight - A.value;
226
+ t > r && (t = r), n > i && (n = i), N.value = t, P.value = n;
227
+ }, Z = () => {
228
+ I.value = !1, window.removeEventListener("mousemove", X), window.removeEventListener("mouseup", Z);
229
+ }, Q = (e) => {
230
+ T.visible && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), $());
231
+ };
232
+ b(() => T.visible, async (e) => {
233
+ e ? (k.value = null, A.value = null, N.value = null, P.value = null, document.body.style.overflow = "hidden", window.addEventListener("keydown", Q, { capture: !0 }), await l(), D.value && D.value.focus()) : (document.body.style.overflow = "", window.removeEventListener("keydown", Q, { capture: !0 }), J(), Z());
234
+ }), f(() => {
235
+ document.body.style.overflow = "", window.removeEventListener("keydown", Q, { capture: !0 }), J(), Z();
236
+ });
237
+ let $ = () => E("close"), ne = () => {
238
+ T.closeOnBackdrop && $();
239
+ }, re = () => E("ok"), ie = () => {
240
+ E("cancel"), $();
241
+ };
242
+ return (n, l) => {
243
+ let f = _("ripple");
244
+ return p(), r(e, { to: "body" }, [c(t, { name: "nano-modal-fade" }, {
245
+ default: x(() => [m.visible ? (p(), a("div", {
246
+ key: 0,
247
+ class: u(["nano-modal-overlay", { "nano-glass": m.glassmorphism }]),
248
+ onClick: w(ne, ["self"]),
249
+ onKeydown: l[1] ||= C(w((...e) => n.handleEsc && n.handleEsc(...e), ["stop"]), ["esc"]),
250
+ tabindex: "-1",
251
+ ref_key: "modalOverlay",
252
+ ref: D
253
+ }, [o("div", {
254
+ class: u(["nano-modal-window", {
255
+ "is-dragging": F.value,
256
+ "is-resizing": I.value
257
+ }]),
258
+ style: d(G.value),
259
+ ref_key: "modalWindow",
260
+ ref: O
261
+ }, [
262
+ m.showHeader ? (p(), a("div", {
263
+ key: 0,
264
+ class: u(["nano-modal-header", { "is-draggable": m.draggable }]),
265
+ onMousedown: K
266
+ }, [g(n.$slots, "header", {}, () => [o("h2", ee, v(m.title), 1)]), o("button", {
267
+ class: "nano-modal-close-btn",
268
+ onClick: w($, ["stop"]),
269
+ "aria-label": "Close",
270
+ onMousedown: l[0] ||= w(() => {}, ["stop"])
271
+ }, [...l[2] ||= [o("svg", {
272
+ xmlns: "http://www.w3.org/2000/svg",
273
+ width: "24",
274
+ height: "24",
275
+ viewBox: "0 0 24 24",
276
+ fill: "none",
277
+ stroke: "currentColor",
278
+ "stroke-width": "2",
279
+ "stroke-linecap": "round",
280
+ "stroke-linejoin": "round"
281
+ }, [o("line", {
282
+ x1: "18",
283
+ y1: "6",
284
+ x2: "6",
285
+ y2: "18"
286
+ }), o("line", {
287
+ x1: "6",
288
+ y1: "6",
289
+ x2: "18",
290
+ y2: "18"
291
+ })], -1)]], 32)], 34)) : i("", !0),
292
+ m.showBody ? (p(), a("div", te, [g(n.$slots, "body")])) : i("", !0),
293
+ m.showFooter ? (p(), a("div", j, [g(n.$slots, "footer", {}, () => [o("div", M, [m.showCancel ? S((p(), a("button", {
294
+ key: 0,
295
+ class: "nano-btn nano-btn-secondary",
296
+ onClick: ie
297
+ }, [s(v(m.cancelText), 1)])), [[f]]) : i("", !0), m.showOk ? S((p(), a("button", {
298
+ key: 1,
299
+ class: u(["nano-btn", "nano-btn-" + m.okVariant]),
300
+ onClick: re
301
+ }, [s(v(m.okText), 1)], 2)), [[f]]) : i("", !0)])])])) : i("", !0),
302
+ m.resizable ? (p(), a("div", {
303
+ key: 3,
304
+ class: "nano-modal-resizer",
305
+ onMousedown: Y
306
+ }, [...l[3] ||= [o("svg", {
307
+ width: "10",
308
+ height: "10",
309
+ viewBox: "0 0 10 10",
310
+ fill: "none",
311
+ xmlns: "http://www.w3.org/2000/svg"
312
+ }, [o("path", {
313
+ d: "M9 1V9H1",
314
+ stroke: "currentColor",
315
+ "stroke-width": "2",
316
+ "stroke-linecap": "round",
317
+ "stroke-linejoin": "round"
318
+ })], -1)]], 32)) : i("", !0)
319
+ ], 6)], 34)) : i("", !0)]),
320
+ _: 3
321
+ })]);
322
+ };
323
+ }
324
+ }, P = { install(e) {
325
+ e.directive("ripple", T), e.directive("tooltip", k), e.component("GlobalTooltip", A), e.component("NanoModal", N);
113
326
  } };
114
327
  //#endregion
115
- export { h as GlobalTooltip, u as Ripple, g as default, p as hideTooltip, f as showTooltip, m as tooltipDirective, d as tooltipState };
328
+ export { A as GlobalTooltip, N as NanoModal, T as Ripple, P as default, O as hideTooltip, D as showTooltip, k as tooltipDirective, E as tooltipState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gkucmierz/nano-ui",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "license": "ISC",
5
5
  "description": "High-performance, minimal footprint Vue 3 UI library and directives.",
6
6
  "type": "module",