zabi-components 1.0.5 → 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 D, 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 G, u as o, r as m, v as q, 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 Se, G as L } from "./x-DpVwziig.js";
2
- import { createEventDispatcher as he, onMount as se } from "svelte";
3
- import { T as Ae, a as De } from "./Toast-DXZ9gllw.js";
4
- var Fe = _('<button type="button" class="text-xl font-bold text-primary hover:text-primary-hover transition-colors svelte-1r8bk40"> </button>'), Oe = _('<img class="h-8 w-8 svelte-1r8bk40"/>'), Pe = _('<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>'), Re = me('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" class="svelte-1r8bk40"></path>'), qe = me('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" class="svelte-1r8bk40"></path>'), Ge = _('<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>'), Ke = _('<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);
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
+ 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 = 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);
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"), F = h(a, "showThemeToggle", 8, !0), b = h(a, "className", 8, "");
50
- const p = he();
51
- let i = U(!1), C = U(!1), k = U();
48
+ de(a, !1), fe(B, Je);
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 = 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",
@@ -59,110 +59,112 @@ function et(B, a) {
59
59
  sticky: "sticky top-0 z-40",
60
60
  fixed: "fixed top-0 left-0 right-0 z-40"
61
61
  };
62
- function S(r) {
63
- p("brandClick", r);
62
+ function O(r) {
63
+ p("brandClick", { event: r });
64
64
  }
65
65
  function l() {
66
- g(i, !e(i)), p("menuToggle", e(i));
66
+ g(i, !e(i)), p("menuToggle", { isOpen: e(i) });
67
67
  }
68
- function j() {
68
+ function E() {
69
69
  g(C, window.scrollY > 10);
70
70
  }
71
- se(() => (window.addEventListener("scroll", j), () => window.removeEventListener("scroll", j)));
71
+ oe(() => (window.addEventListener("scroll", E), () => window.removeEventListener("scroll", E)));
72
72
  function x(r) {
73
- r.key === "Escape" && e(i) && (g(i, !1), p("menuToggle", !1));
73
+ r.key === "Escape" && e(i) && (g(i, !1), p("menuToggle", { isOpen: !1 }));
74
74
  }
75
75
  function n(r) {
76
- e(i) && e(k) && !e(k).contains(r.target) && (g(i, !1), p("menuToggle", !1));
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), K = d(u), O = d(K), H = d(O), 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(), P = ne(v);
83
+ var X = (r) => {
84
+ var v = me(), R = re(v);
85
85
  {
86
- var $ = (A) => {
87
- var E = Fe(), Q = d(E);
88
- I(() => ae(Q, s())), D("click", E, S), f(A, E);
89
- }, je = (A) => {
90
- var E = Pe(), Q = d(E);
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 Ee = (R) => {
93
- var ee = Oe();
92
+ var ee = (q) => {
93
+ var te = Fe();
94
94
  I(() => {
95
- q(ee, "src", (m(s()), o(() => s().logo))), q(ee, "alt", (m(s()), o(() => s().text)));
96
- }), f(R, 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, (R) => {
99
- m(s()), o(() => s().logo) && R(Ee);
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
- q(E, "href", (m(s()), o(() => s().href || "#"))), ae(Ne, (m(s()), o(() => s().text)));
105
- }), D("click", E, (R) => S(R)), f(A, E);
104
+ G(j, "href", (m(s()), o(() => s().href || "#"))), se(Ne, (m(s()), o(() => s().text)));
105
+ }), A("click", j, (q) => O(q)), f(S, j);
106
106
  };
107
- N(P, (A) => {
108
- typeof s() == "string" ? A($) : A(je, !1);
107
+ N(R, (S) => {
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) => {
122
- Ae(r, { size: "md", variant: "outline" });
121
+ var xe = (r) => {
122
+ Se(r, { size: "md", variant: "outline" });
123
123
  };
124
- N(de, (r) => {
125
- F() && 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) => {
133
- var v = Re();
134
- f(r, v);
135
- }, _e = (r) => {
132
+ var _e = (r) => {
136
133
  var v = qe();
137
134
  f(r, v);
135
+ }, Me = (r) => {
136
+ var v = Ge();
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(O, 2);
143
+ var Te = w(F, 2);
144
144
  {
145
- var Te = (r) => {
146
- var v = Ge(), P = d(v), $ = d(P);
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) => {
157
- var v = Ke();
158
- D("click", v, () => g(i, !1)), D("keydown", v, (P) => P.key === "Escape" && g(i, !1)), re(3, v, () => Ye, () => ({ duration: 200 })), f(r, v);
156
+ var Ee = (r) => {
157
+ var v = Pe();
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(() => {
165
- G(
167
+ K(
166
168
  u,
167
169
  1,
168
170
  `
@@ -174,19 +176,19 @@ function et(B, a) {
174
176
  ${b() ?? ""}
175
177
  `,
176
178
  "svelte-1r8bk40"
177
- ), G(
178
- O,
179
+ ), K(
180
+ F,
179
181
  1,
180
182
  `flex items-center justify-between ${m(T()), o(() => y[T()]) ?? ""}`,
181
183
  "svelte-1r8bk40"
182
- ), q(Z, "aria-expanded", e(i));
183
- }), D("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(), F = "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",
@@ -205,7 +207,7 @@ function tt(B, a) {
205
207
  "bottom-left": "fixed bottom-4 left-4"
206
208
  };
207
209
  function C(l) {
208
- return `${F} ${b[l] || b.default}`;
210
+ return `${D} ${b[l] || b.default}`;
209
211
  }
210
212
  function k(l) {
211
213
  return p[l] || p.default;
@@ -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
- var S = (l) => {
234
- var j = Ue();
235
- ge(j, 5, s, (x) => x.id, (x, n) => {
236
- var t = Qe(), u = d(t), K = d(u), O = d(K), H = w(K, 2), V = d(H), W = w(u, 2);
235
+ var O = (l) => {
236
+ var E = Ue();
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
- G(t, 1, J), q(O, "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
- () => Se((e(n), o(() => C(e(n).type)))),
244
+ () => Oe((e(n), o(() => C(e(n).type)))),
243
245
  () => (e(n), o(() => k(e(n).type)))
244
246
  ]
245
- ), D("click", W, () => y(e(n).id)), re(3, t, () => be, () => ({ x: M().includes("right") ? 300 : -300, duration: 300 })), f(x, t);
246
- }), I(() => G(j, 1, `${m(M()), o(() => i[M()]) ?? ""} z-50 max-w-sm w-full space-y-2`)), f(l, j);
247
+ ), A("click", X, () => y(e(n).id)), ae(3, t, () => ge, () => ({ x: M().includes("right") ? 300 : -300, duration: 300 })), f(x, t);
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
- m(s()), o(() => s().length > 0) && l(S);
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 = {
@@ -259,15 +261,13 @@ const We = {
259
261
 
260
262
  /* Re-enable pointer events for individual toasts */.toast-manager > * {pointer-events:auto;}
261
263
 
262
- /* Stack toasts with proper spacing */.toast-manager.svelte-1hjxuh0 {display:flex;flex-direction:column;gap:0.5rem;}
263
-
264
- /* Position-specific adjustments */`
264
+ /* Stack toasts with proper spacing */.toast-manager.svelte-1hjxuh0 {display:flex;flex-direction:column;gap:0.5rem;}`
265
265
  };
266
266
  function nt(B, a) {
267
- le(a, !1), ue(B, We);
268
- let s = h(a, "position", 8, "top-right"), M = h(a, "maxToasts", 8, 5), T = h(a, "className", 8, ""), c = U([]), F = 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;
269
269
  function b(n) {
270
- const t = `toast-${++F}`, u = {
270
+ const t = `toast-${++D}`, u = {
271
271
  id: t,
272
272
  title: "",
273
273
  message: "",
@@ -306,19 +306,19 @@ function nt(B, a) {
306
306
  function Y(n, t) {
307
307
  g(c, e(c).map((u) => u.id === n ? { ...u, ...t } : u));
308
308
  }
309
- function S(n) {
309
+ function O(n) {
310
310
  y(n.detail.id);
311
311
  }
312
312
  function l(n) {
313
313
  }
314
- 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 }), () => {
315
315
  typeof window < "u" && delete window.toast;
316
316
  }));
317
- var j = { show: b, success: p, error: i, warning: C, info: k, close: y, closeAll: z, update: Y };
318
- oe();
317
+ var E = { show: b, success: p, error: i, warning: C, info: k, close: y, closeAll: z, update: Y };
318
+ ie();
319
319
  var x = Ve();
320
- return ge(x, 5, () => e(c), (n) => n.id, (n, t) => {
321
- De(n, {
320
+ return he(x, 5, () => e(c), (n) => n.id, (n, t) => {
321
+ Ae(n, {
322
322
  get id() {
323
323
  return e(t), o(() => e(t).id);
324
324
  },
@@ -343,9 +343,9 @@ function nt(B, a) {
343
343
  get position() {
344
344
  return s();
345
345
  },
346
- $$events: { close: S, click: l }
346
+ $$events: { close: O, click: l }
347
347
  });
348
- }), I(() => G(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(j);
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);
349
349
  }
350
350
  export {
351
351
  et as N,