zabi-components 1.0.6 → 1.0.7

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.
@@ -1,7 +1,7 @@
1
- import { a as ue, p as h, i as oe, f as _, b as ne, c as N, s as te, d as Be, t as I, e as A, g as f, h as ie, j as le, k as g, l as e, m as U, n as d, o as w, q as K, u as o, r as m, v as G, w as fe, x as me, y as re, z as be, A as Ye, B as ae, C as ve, D as Ie, E as ge, F as Oe, G as L } from "./x-DpVwziig.js";
2
- import { createEventDispatcher as he, onMount as se } from "svelte";
1
+ import { a as fe, p as h, i as ie, f as _, b as re, c as N, s as ne, d as Be, t as I, e as A, g as f, h as le, j as de, k as g, l as e, m as V, n as d, o as w, q as K, u as o, r as m, v as G, w as me, x as be, y as ae, z as ge, A as Ye, B as se, C as ue, D as Ie, E as he, F as Oe, G as L } from "./x-DpVwziig.js";
2
+ import { createEventDispatcher as pe, onMount as oe } from "svelte";
3
3
  import { T as Se, a as Ae } from "./Toast-DXZ9gllw.js";
4
- var De = _('<button type="button" class="text-xl font-bold text-primary hover:text-primary-hover transition-colors svelte-1r8bk40"> </button>'), Fe = _('<img class="h-8 w-8 svelte-1r8bk40"/>'), Re = _('<a class="flex items-center space-x-2 text-xl font-bold text-primary hover:text-primary-hover transition-colors svelte-1r8bk40"><!> <span class="svelte-1r8bk40"> </span></a>'), qe = me('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" class="svelte-1r8bk40"></path>'), Ge = me('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" class="svelte-1r8bk40"></path>'), Ke = _('<div id="mobile-menu" class="md:hidden border-t border-primary bg-surface svelte-1r8bk40"><div class="px-4 py-2 space-y-1 svelte-1r8bk40"><!></div></div>'), Pe = _('<div class="fixed inset-0 bg-black/50 backdrop-blur-sm z-30 md:hidden svelte-1r8bk40" role="button" tabindex="0" aria-label="Close menu"></div>'), He = _('<nav aria-label="Main navigation"><div class="max-w-7xl mx-auto svelte-1r8bk40"><div><div class="flex items-center svelte-1r8bk40"><!></div> <div class="hidden md:flex items-center space-x-8 svelte-1r8bk40"><!></div> <div class="flex items-center space-x-4 svelte-1r8bk40"><!> <!> <button type="button" class="md:hidden p-2 rounded-lg text-primary hover:bg-surface-secondary focus:outline-none focus:ring-2 focus:ring-primary svelte-1r8bk40" aria-controls="mobile-menu" aria-label="Toggle navigation menu"><svg class="w-6 h-6 svelte-1r8bk40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><!></svg></button></div></div> <!></div></nav> <!>', 1);
4
+ var De = _('<button type="button" class="text-xl font-bold text-primary hover:text-primary-hover transition-colors svelte-1r8bk40"> </button>'), Fe = _('<img class="h-8 w-8 svelte-1r8bk40"/>'), Re = _('<a class="flex items-center space-x-2 text-xl font-bold text-primary hover:text-primary-hover transition-colors svelte-1r8bk40"><!> <span class="svelte-1r8bk40"> </span></a>'), qe = be('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" class="svelte-1r8bk40"></path>'), Ge = be('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" class="svelte-1r8bk40"></path>'), Ke = _('<div id="mobile-menu" class="md:hidden border-t border-primary bg-surface svelte-1r8bk40"><div class="px-4 py-2 space-y-1 svelte-1r8bk40"><!></div></div>'), Pe = _('<div class="fixed inset-0 bg-black/50 backdrop-blur-sm z-30 md:hidden svelte-1r8bk40" role="button" tabindex="0" aria-label="Close menu"></div>'), He = _('<nav aria-label="Main navigation"><div class="max-w-7xl mx-auto svelte-1r8bk40"><div><div class="flex items-center svelte-1r8bk40"><!></div> <div class="hidden md:flex items-center space-x-8 svelte-1r8bk40"><!></div> <div class="flex items-center space-x-4 svelte-1r8bk40"><!> <!> <button type="button" class="md:hidden p-2 rounded-lg text-primary hover:bg-surface-secondary focus:outline-none focus:ring-2 focus:ring-primary svelte-1r8bk40" aria-controls="mobile-menu" aria-label="Toggle navigation menu"><svg class="w-6 h-6 svelte-1r8bk40" fill="none" stroke="currentColor" viewBox="0 0 24 24"><!></svg></button></div></div> <!></div></nav> <!>', 1);
5
5
  const Je = {
6
6
  hash: "svelte-1r8bk40",
7
7
  code: `
@@ -45,10 +45,10 @@ const Je = {
45
45
  }`
46
46
  };
47
47
  function et(B, a) {
48
- le(a, !1), ue(B, Je);
48
+ de(a, !1), fe(B, Je);
49
49
  let s = h(a, "brand", 8, ""), M = h(a, "variant", 8, "default"), T = h(a, "size", 8, "md"), c = h(a, "position", 8, "sticky"), D = h(a, "showThemeToggle", 8, !0), b = h(a, "className", 8, "");
50
- const p = he();
51
- let i = U(!1), C = U(!1), k = U();
50
+ const p = pe();
51
+ let i = V(!1), C = V(!1), k = V();
52
52
  const y = { sm: "py-2 px-4", md: "py-3 px-6", lg: "py-4 px-8" }, z = {
53
53
  default: "bg-surface border-b border-primary shadow-adaptive-sm",
54
54
  transparent: "bg-transparent",
@@ -68,97 +68,99 @@ function et(B, a) {
68
68
  function E() {
69
69
  g(C, window.scrollY > 10);
70
70
  }
71
- se(() => (window.addEventListener("scroll", E), () => window.removeEventListener("scroll", E)));
71
+ oe(() => (window.addEventListener("scroll", E), () => window.removeEventListener("scroll", E)));
72
72
  function x(r) {
73
73
  r.key === "Escape" && e(i) && (g(i, !1), p("menuToggle", { isOpen: !1 }));
74
74
  }
75
75
  function n(r) {
76
76
  e(i) && e(k) && !e(k).contains(r.target) && (g(i, !1), p("menuToggle", { isOpen: !1 }));
77
77
  }
78
- se(() => (document.addEventListener("keydown", x), document.addEventListener("click", n), () => {
78
+ oe(() => (document.addEventListener("keydown", x), document.addEventListener("click", n), () => {
79
79
  document.removeEventListener("keydown", x), document.removeEventListener("click", n);
80
- })), oe();
81
- var t = He(), u = ne(t), P = d(u), F = d(P), H = d(F), V = d(H);
80
+ })), ie();
81
+ var t = He(), u = re(t), P = d(u), F = d(P), H = d(F), W = d(H);
82
82
  {
83
- var W = (r) => {
84
- var v = fe(), R = ne(v);
83
+ var X = (r) => {
84
+ var v = me(), R = re(v);
85
85
  {
86
- var $ = (S) => {
87
- var j = De(), Q = d(j);
88
- I(() => ae(Q, s())), A("click", j, O), f(S, j);
89
- }, Ee = (S) => {
90
- var j = Re(), Q = d(j);
86
+ var Q = (S) => {
87
+ var j = De(), U = d(j);
88
+ I(() => se(U, s())), A("click", j, (ee) => O(ee)), f(S, j);
89
+ }, je = (S) => {
90
+ var j = Re(), U = d(j);
91
91
  {
92
- var je = (q) => {
93
- var ee = Fe();
92
+ var ee = (q) => {
93
+ var te = Fe();
94
94
  I(() => {
95
- G(ee, "src", (m(s()), o(() => s().logo))), G(ee, "alt", (m(s()), o(() => s().text)));
96
- }), f(q, ee);
95
+ G(te, "src", (m(s()), o(() => s().logo))), G(te, "alt", (m(s()), o(() => s().text)));
96
+ }), f(q, te);
97
97
  };
98
- N(Q, (q) => {
99
- m(s()), o(() => s().logo) && q(je);
98
+ N(U, (q) => {
99
+ m(s()), o(() => s().logo) && q(ee);
100
100
  });
101
101
  }
102
- var Le = w(Q, 2), Ne = d(Le);
102
+ var Le = w(U, 2), Ne = d(Le);
103
103
  I(() => {
104
- G(j, "href", (m(s()), o(() => s().href || "#"))), ae(Ne, (m(s()), o(() => s().text)));
104
+ G(j, "href", (m(s()), o(() => s().href || "#"))), se(Ne, (m(s()), o(() => s().text)));
105
105
  }), A("click", j, (q) => O(q)), f(S, j);
106
106
  };
107
107
  N(R, (S) => {
108
- typeof s() == "string" ? S($) : S(Ee, !1);
108
+ typeof s() == "string" ? S(Q) : S(je, !1);
109
109
  });
110
110
  }
111
111
  f(r, v);
112
112
  };
113
- N(V, (r) => {
114
- s() && r(W);
113
+ N(W, (r) => {
114
+ s() && r(X);
115
115
  });
116
116
  }
117
- var J = w(H, 2), X = d(J);
118
- te(X, a, "nav", {}, null);
119
- var pe = w(J, 2), de = d(pe);
117
+ var J = w(H, 2), Z = d(J);
118
+ ne(Z, a, "nav", {}, null);
119
+ var ke = w(J, 2), ce = d(ke);
120
120
  {
121
- var ke = (r) => {
121
+ var xe = (r) => {
122
122
  Se(r, { size: "md", variant: "outline" });
123
123
  };
124
- N(de, (r) => {
125
- D() && r(ke);
124
+ N(ce, (r) => {
125
+ D() && r(xe);
126
126
  });
127
127
  }
128
- var ce = w(de, 2);
129
- te(ce, a, "actions", {}, null);
130
- var Z = w(ce, 2), xe = d(Z), ye = d(xe);
128
+ var ve = w(ce, 2);
129
+ ne(ve, a, "actions", {}, null);
130
+ var $ = w(ve, 2), ye = d($), we = d(ye);
131
131
  {
132
- var we = (r) => {
132
+ var _e = (r) => {
133
133
  var v = qe();
134
134
  f(r, v);
135
- }, _e = (r) => {
135
+ }, Me = (r) => {
136
136
  var v = Ge();
137
137
  f(r, v);
138
138
  };
139
- N(ye, (r) => {
140
- e(i) ? r(we) : r(_e, !1);
139
+ N(we, (r) => {
140
+ e(i) ? r(_e) : r(Me, !1);
141
141
  });
142
142
  }
143
- var Me = w(F, 2);
143
+ var Te = w(F, 2);
144
144
  {
145
- var Te = (r) => {
146
- var v = Ke(), R = d(v), $ = d(R);
147
- te($, a, "mobile-nav", {}, null), re(3, v, () => be, () => ({ y: -20, duration: 200 })), f(r, v);
145
+ var Ce = (r) => {
146
+ var v = Ke(), R = d(v), Q = d(R);
147
+ ne(Q, a, "mobile-nav", {}, null), ae(3, v, () => ge, () => ({ y: -20, duration: 200 })), f(r, v);
148
148
  };
149
- N(Me, (r) => {
150
- e(i) && r(Te);
149
+ N(Te, (r) => {
150
+ e(i) && r(Ce);
151
151
  });
152
152
  }
153
153
  Be(u, (r) => g(k, r), () => e(k));
154
- var Ce = w(u, 2);
154
+ var ze = w(u, 2);
155
155
  {
156
- var ze = (r) => {
156
+ var Ee = (r) => {
157
157
  var v = Pe();
158
- A("click", v, () => g(i, !1)), A("keydown", v, (R) => R.key === "Escape" && g(i, !1)), re(3, v, () => Ye, () => ({ duration: 200 })), f(r, v);
158
+ A("click", v, () => g(i, !1)), A("keydown", v, (R) => {
159
+ R.key === "Escape" && g(i, !1);
160
+ }), ae(3, v, () => Ye, () => ({ duration: 200 })), f(r, v);
159
161
  };
160
- N(Ce, (r) => {
161
- e(i) && r(ze);
162
+ N(ze, (r) => {
163
+ e(i) && r(Ee);
162
164
  });
163
165
  }
164
166
  I(() => {
@@ -179,14 +181,14 @@ function et(B, a) {
179
181
  1,
180
182
  `flex items-center justify-between ${m(T()), o(() => y[T()]) ?? ""}`,
181
183
  "svelte-1r8bk40"
182
- ), G(Z, "aria-expanded", e(i));
183
- }), A("click", Z, l), f(B, t), ie();
184
+ ), G($, "aria-expanded", e(i));
185
+ }), A("click", $, l), f(B, t), le();
184
186
  }
185
187
  var Qe = _('<div><div class="flex items-center"><svg class="w-5 h-5 mr-3 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg> <span class="text-sm font-medium flex-1"> </span></div> <button class="ml-3 flex-shrink-0 opacity-70 hover:opacity-100 transition-opacity" aria-label="Close notification"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div>'), Ue = _("<div></div>");
186
188
  function tt(B, a) {
187
- le(a, !1);
189
+ de(a, !1);
188
190
  let s = h(a, "notifications", 28, () => []), M = h(a, "position", 8, "top-right"), T = h(a, "maxNotifications", 8, 5);
189
- const c = he(), D = "px-4 py-3 rounded-md border flex items-center justify-between mb-3 shadow-lg", b = {
191
+ const c = pe(), D = "px-4 py-3 rounded-md border flex items-center justify-between mb-3 shadow-lg", b = {
190
192
  success: "bg-green-100 border-green-400 text-green-700",
191
193
  error: "bg-red-100 border-red-400 text-red-700",
192
194
  warning: "bg-yellow-100 border-yellow-400 text-yellow-700",
@@ -213,12 +215,12 @@ function tt(B, a) {
213
215
  function y(l) {
214
216
  c("close");
215
217
  }
216
- ve(
218
+ ue(
217
219
  () => (m(s()), m(T())),
218
220
  () => {
219
221
  s().length > T() && s(s().slice(-T()));
220
222
  }
221
- ), ve(() => m(s()), () => {
223
+ ), ue(() => m(s()), () => {
222
224
  s().length > 0 && s().forEach((l) => {
223
225
  l.duration && l.duration > 0 && setTimeout(
224
226
  () => {
@@ -227,29 +229,29 @@ function tt(B, a) {
227
229
  l.duration
228
230
  );
229
231
  });
230
- }), Ie(), oe();
231
- var z = fe(), Y = ne(z);
232
+ }), Ie(), ie();
233
+ var z = me(), Y = re(z);
232
234
  {
233
235
  var O = (l) => {
234
236
  var E = Ue();
235
- ge(E, 5, s, (x) => x.id, (x, n) => {
236
- var t = Qe(), u = d(t), P = d(u), F = d(P), H = w(P, 2), V = d(H), W = w(u, 2);
237
+ he(E, 5, s, (x) => x.id, (x, n) => {
238
+ var t = Qe(), u = d(t), P = d(u), F = d(P), H = w(P, 2), W = d(H), X = w(u, 2);
237
239
  I(
238
- (J, X) => {
239
- K(t, 1, J), G(F, "d", X), ae(V, (e(n), o(() => e(n).message)));
240
+ (J, Z) => {
241
+ K(t, 1, J), G(F, "d", Z), se(W, (e(n), o(() => e(n).message)));
240
242
  },
241
243
  [
242
244
  () => Oe((e(n), o(() => C(e(n).type)))),
243
245
  () => (e(n), o(() => k(e(n).type)))
244
246
  ]
245
- ), A("click", W, () => y(e(n).id)), re(3, t, () => be, () => ({ x: M().includes("right") ? 300 : -300, duration: 300 })), f(x, t);
247
+ ), A("click", X, () => y(e(n).id)), ae(3, t, () => ge, () => ({ x: M().includes("right") ? 300 : -300, duration: 300 })), f(x, t);
246
248
  }), I(() => K(E, 1, `${m(M()), o(() => i[M()]) ?? ""} z-50 max-w-sm w-full space-y-2`)), f(l, E);
247
249
  };
248
250
  N(Y, (l) => {
249
251
  m(s()), o(() => s().length > 0) && l(O);
250
252
  });
251
253
  }
252
- f(B, z), ie();
254
+ f(B, z), le();
253
255
  }
254
256
  var Ve = _("<div></div>");
255
257
  const We = {
@@ -262,8 +264,8 @@ const We = {
262
264
  /* Stack toasts with proper spacing */.toast-manager.svelte-1hjxuh0 {display:flex;flex-direction:column;gap:0.5rem;}`
263
265
  };
264
266
  function nt(B, a) {
265
- le(a, !1), ue(B, We);
266
- let s = h(a, "position", 8, "top-right"), M = h(a, "maxToasts", 8, 5), T = h(a, "className", 8, ""), c = U([]), D = 0;
267
+ de(a, !1), fe(B, We);
268
+ let s = h(a, "position", 8, "top-right"), M = h(a, "maxToasts", 8, 5), T = h(a, "className", 8, ""), c = V([]), D = 0;
267
269
  function b(n) {
268
270
  const t = `toast-${++D}`, u = {
269
271
  id: t,
@@ -309,13 +311,13 @@ function nt(B, a) {
309
311
  }
310
312
  function l(n) {
311
313
  }
312
- se(() => (typeof window < "u" && (window.toast = { show: b, success: p, error: i, warning: C, info: k, close: y, closeAll: z, update: Y }), () => {
314
+ oe(() => (typeof window < "u" && (window.toast = { show: b, success: p, error: i, warning: C, info: k, close: y, closeAll: z, update: Y }), () => {
313
315
  typeof window < "u" && delete window.toast;
314
316
  }));
315
317
  var E = { show: b, success: p, error: i, warning: C, info: k, close: y, closeAll: z, update: Y };
316
- oe();
318
+ ie();
317
319
  var x = Ve();
318
- return ge(x, 5, () => e(c), (n) => n.id, (n, t) => {
320
+ return he(x, 5, () => e(c), (n) => n.id, (n, t) => {
319
321
  Ae(n, {
320
322
  get id() {
321
323
  return e(t), o(() => e(t).id);
@@ -343,7 +345,7 @@ function nt(B, a) {
343
345
  },
344
346
  $$events: { close: O, click: l }
345
347
  });
346
- }), I(() => K(x, 1, `toast-manager fixed inset-0 pointer-events-none z-notification ${T() ?? ""}`, "svelte-1hjxuh0")), f(B, x), L(a, "show", b), L(a, "success", p), L(a, "error", i), L(a, "warning", C), L(a, "info", k), L(a, "close", y), L(a, "closeAll", z), L(a, "update", Y), ie(E);
348
+ }), I(() => K(x, 1, `toast-manager fixed inset-0 pointer-events-none z-notification ${T() ?? ""}`, "svelte-1hjxuh0")), f(B, x), L(a, "show", b), L(a, "success", p), L(a, "error", i), L(a, "warning", C), L(a, "info", k), L(a, "close", y), L(a, "closeAll", z), L(a, "update", Y), le(E);
347
349
  }
348
350
  export {
349
351
  et as N,