zabi-components 1.0.0 → 1.0.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.
@@ -0,0 +1,417 @@
1
+ import { j as I, I as G, H as Q, w as B, b as H, J as U, K as W, g as n, L as Z, h as N, p as c, k as D, l as g, i as $, f as x, c as p, t as w, e as E, m as ee, n as d, q as P, u as _, r as k, v as V, x as te, a as xe, o as T, s as be, y as we, z as _e, M as ke, N as je, O as Me, B as X, X as Te, P as ze } from "./x-DaAXsWcz.js";
2
+ import { onMount as ae, createEventDispatcher as Ce } from "svelte";
3
+ function Ee(f, e) {
4
+ I(e, !0);
5
+ /**
6
+ * @license @lucide/svelte v0.544.0 - ISC
7
+ *
8
+ * ISC License
9
+ *
10
+ * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
11
+ *
12
+ * Permission to use, copy, modify, and/or distribute this software for any
13
+ * purpose with or without fee is hereby granted, provided that the above
14
+ * copyright notice and this permission notice appear in all copies.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
17
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
18
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
19
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
21
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
22
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
+ *
24
+ * ---
25
+ *
26
+ * The MIT License (MIT) (for portions derived from Feather)
27
+ *
28
+ * Copyright (c) 2013-2023 Cole Bemis
29
+ *
30
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ * of this software and associated documentation files (the "Software"), to deal
32
+ * in the Software without restriction, including without limitation the rights
33
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ * copies of the Software, and to permit persons to whom the Software is
35
+ * furnished to do so, subject to the following conditions:
36
+ *
37
+ * The above copyright notice and this permission notice shall be included in all
38
+ * copies or substantial portions of the Software.
39
+ *
40
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
+ * SOFTWARE.
47
+ *
48
+ */
49
+ let u = Z(e, ["$$slots", "$$events", "$$legacy"]);
50
+ const v = [
51
+ ["circle", { cx: "12", cy: "12", r: "10" }],
52
+ ["path", { d: "M12 16v-4" }],
53
+ ["path", { d: "M12 8h.01" }]
54
+ ];
55
+ G(f, Q(
56
+ { name: "info" },
57
+ () => u,
58
+ {
59
+ get iconNode() {
60
+ return v;
61
+ },
62
+ children: (r, i) => {
63
+ var o = B(), l = H(o);
64
+ U(l, () => e.children ?? W), n(r, o);
65
+ },
66
+ $$slots: { default: !0 }
67
+ }
68
+ )), N();
69
+ }
70
+ function Ie(f, e) {
71
+ I(e, !0);
72
+ /**
73
+ * @license @lucide/svelte v0.544.0 - ISC
74
+ *
75
+ * ISC License
76
+ *
77
+ * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.
78
+ *
79
+ * Permission to use, copy, modify, and/or distribute this software for any
80
+ * purpose with or without fee is hereby granted, provided that the above
81
+ * copyright notice and this permission notice appear in all copies.
82
+ *
83
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
84
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
85
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
86
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
87
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
88
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
89
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
90
+ *
91
+ * ---
92
+ *
93
+ * The MIT License (MIT) (for portions derived from Feather)
94
+ *
95
+ * Copyright (c) 2013-2023 Cole Bemis
96
+ *
97
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
98
+ * of this software and associated documentation files (the "Software"), to deal
99
+ * in the Software without restriction, including without limitation the rights
100
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
101
+ * copies of the Software, and to permit persons to whom the Software is
102
+ * furnished to do so, subject to the following conditions:
103
+ *
104
+ * The above copyright notice and this permission notice shall be included in all
105
+ * copies or substantial portions of the Software.
106
+ *
107
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
108
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
109
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
110
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
111
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
112
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
113
+ * SOFTWARE.
114
+ *
115
+ */
116
+ let u = Z(e, ["$$slots", "$$events", "$$legacy"]);
117
+ const v = [
118
+ [
119
+ "path",
120
+ {
121
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
122
+ }
123
+ ],
124
+ ["path", { d: "M12 9v4" }],
125
+ ["path", { d: "M12 17h.01" }]
126
+ ];
127
+ G(f, Q(
128
+ { name: "triangle-alert" },
129
+ () => u,
130
+ {
131
+ get iconNode() {
132
+ return v;
133
+ },
134
+ children: (r, i) => {
135
+ var o = B(), l = H(o);
136
+ U(l, () => e.children ?? W), n(r, o);
137
+ },
138
+ $$slots: { default: !0 }
139
+ }
140
+ )), N();
141
+ }
142
+ var Ne = te('<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path></svg>'), Le = te('<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path></svg>'), Se = x("<button><!></button>");
143
+ function Je(f, e) {
144
+ I(e, !1);
145
+ let u = c(e, "size", 8, "md"), v = c(e, "variant", 8, "default"), r = ee(!1);
146
+ const i = {
147
+ sm: "w-8 h-8 text-sm",
148
+ md: "w-10 h-10 text-base",
149
+ lg: "w-12 h-12 text-lg"
150
+ }, o = {
151
+ default: "bg-surface-primary hover:bg-surface-secondary border border-primary shadow-adaptive-sm",
152
+ minimal: "bg-transparent hover:bg-surface-secondary",
153
+ outline: "bg-transparent border border-primary hover:bg-surface-secondary"
154
+ };
155
+ ae(() => {
156
+ const a = localStorage.getItem("theme"), y = window.matchMedia("(prefers-color-scheme: dark)").matches;
157
+ D(r, a === "dark" || !a && y), j();
158
+ });
159
+ function l() {
160
+ D(r, !g(r)), j(), localStorage.setItem("theme", g(r) ? "dark" : "light");
161
+ }
162
+ function j() {
163
+ g(r) ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
164
+ }
165
+ $();
166
+ var h = Se(), L = d(h);
167
+ {
168
+ var S = (a) => {
169
+ var y = Ne();
170
+ n(a, y);
171
+ }, z = (a) => {
172
+ var y = Le();
173
+ n(a, y);
174
+ };
175
+ p(L, (a) => {
176
+ g(r) ? a(S) : a(z, !1);
177
+ });
178
+ }
179
+ w(() => {
180
+ P(h, 1, `
181
+ ${k(u()), _(() => i[u()]) ?? ""}
182
+ ${k(v()), _(() => o[v()]) ?? ""}
183
+ rounded-lg
184
+ transition-all
185
+ duration-200
186
+ flex
187
+ items-center
188
+ justify-center
189
+ text-primary
190
+ hover:text-primary-600
191
+ focus:outline-none
192
+ focus:ring-2
193
+ focus:ring-primary-500
194
+ focus:ring-offset-2
195
+ focus:ring-offset-surface-primary
196
+ `), V(h, "aria-label", g(r) ? "Switch to light mode" : "Switch to dark mode"), V(h, "title", g(r) ? "Switch to light mode" : "Switch to dark mode");
197
+ }), E("click", h, l), n(f, h), N();
198
+ }
199
+ var Ye = x('<div class="flex-shrink-0 mr-3 svelte-ayjeya"><!></div>'), De = x('<h4 class="text-sm font-semibold mb-1 svelte-ayjeya"> </h4>'), Pe = x('<p class="text-sm opacity-90 svelte-ayjeya"> </p>'), Be = x('<button type="button" aria-label="Close notification"><!></button>'), He = x('<div class="absolute bottom-0 left-0 right-0 h-1 bg-current opacity-20 rounded-b-lg overflow-hidden svelte-ayjeya"><div class="h-full bg-current opacity-50 animate-progress-bar svelte-ayjeya"></div></div>'), Ae = x('<div role="alert" aria-live="polite"><div class="p-4 svelte-ayjeya"><div class="flex items-start svelte-ayjeya"><!> <div class="flex-1 min-w-0 svelte-ayjeya"><!> <!> <!></div> <!></div></div> <!></div>');
200
+ const Ke = {
201
+ hash: "svelte-ayjeya",
202
+ code: `
203
+ /* Progress bar animation */
204
+ @keyframes svelte-ayjeya-progress-bar {
205
+ 0% {
206
+ width: 100%;
207
+ }
208
+ 100% {
209
+ width: 0%;
210
+ }
211
+ }.animate-progress-bar.svelte-ayjeya {
212
+ animation: svelte-ayjeya-progress-bar linear forwards;}
213
+
214
+ /* Toast animations */.toast-enter.svelte-ayjeya {
215
+ animation: svelte-ayjeya-toast-enter 0.3s ease-out;}.toast-exit.svelte-ayjeya {
216
+ animation: svelte-ayjeya-toast-exit 0.2s ease-in;}
217
+
218
+ @keyframes svelte-ayjeya-toast-enter {
219
+ 0% {
220
+ opacity: 0;
221
+ transform: scale(0.95) translateY(-10px);
222
+ }
223
+ 100% {
224
+ opacity: 1;
225
+ transform: scale(1) translateY(0);
226
+ }
227
+ }
228
+
229
+ @keyframes svelte-ayjeya-toast-exit {
230
+ 0% {
231
+ opacity: 1;
232
+ transform: scale(1) translateY(0);
233
+ }
234
+ 100% {
235
+ opacity: 0;
236
+ transform: scale(0.95) translateY(-10px);
237
+ }
238
+ }
239
+
240
+ /* Hover effects */.toast-container.svelte-ayjeya:hover {transform:translateY(-1px);box-shadow:0 10px 25px -5px rgba(0, 0, 0, 0.1),
241
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);}
242
+
243
+ /* Focus styles for accessibility */.toast-container.svelte-ayjeya:focus {outline:2px solid var(--color-primary-500);outline-offset:2px;}
244
+
245
+ /* Responsive adjustments */
246
+ @media (max-width: 640px) {.toast-container.svelte-ayjeya {max-width:calc(100vw - 2rem);margin:0 1rem;}
247
+ }`
248
+ };
249
+ function Oe(f, e) {
250
+ I(e, !1), xe(f, Ke);
251
+ let u = c(e, "id", 8, ""), v = c(e, "title", 8, ""), r = c(e, "message", 8, ""), i = c(e, "type", 8, "info"), o = c(
252
+ e,
253
+ "duration",
254
+ 8,
255
+ 5e3
256
+ // Auto-dismiss duration (0 = no auto-dismiss)
257
+ ), l = c(e, "position", 8, "top-right"), j = c(e, "closable", 8, !0), h = c(e, "showIcon", 8, !0), L = c(e, "className", 8, "");
258
+ const S = Ce();
259
+ let z = ee(!0), a;
260
+ const y = {
261
+ success: Me,
262
+ error: je,
263
+ warning: Ie,
264
+ info: Ee
265
+ }, Y = {
266
+ success: {
267
+ container: "bg-success-surface border-success text-success-text",
268
+ icon: "text-success",
269
+ close: "text-success hover:text-success-hover"
270
+ },
271
+ error: {
272
+ container: "bg-error-surface border-error text-error-text",
273
+ icon: "text-error",
274
+ close: "text-error hover:text-error-hover"
275
+ },
276
+ warning: {
277
+ container: "bg-warning-surface border-warning text-warning-text",
278
+ icon: "text-warning",
279
+ close: "text-warning hover:text-warning-hover"
280
+ },
281
+ info: {
282
+ container: "bg-info-surface border-info text-info-text",
283
+ icon: "text-info",
284
+ close: "text-info hover:text-info-hover"
285
+ }
286
+ }, se = {
287
+ "top-right": "top-4 right-4",
288
+ "top-left": "top-4 left-4",
289
+ "bottom-right": "bottom-4 right-4",
290
+ "bottom-left": "bottom-4 left-4",
291
+ "top-center": "top-4 left-1/2 transform -translate-x-1/2",
292
+ "bottom-center": "bottom-4 left-1/2 transform -translate-x-1/2"
293
+ };
294
+ function C() {
295
+ D(z, !1), S("close", { id: u() });
296
+ }
297
+ function A(M) {
298
+ M.key === "Escape" && j() && C();
299
+ }
300
+ ae(() => (o() > 0 && (a = setTimeout(
301
+ () => {
302
+ C();
303
+ },
304
+ o()
305
+ )), document.addEventListener("keydown", A), () => {
306
+ a && clearTimeout(a), document.removeEventListener("keydown", A);
307
+ }));
308
+ function re() {
309
+ a && clearTimeout(a);
310
+ }
311
+ function oe() {
312
+ o() > 0 && (a = setTimeout(
313
+ () => {
314
+ C();
315
+ },
316
+ o()
317
+ ));
318
+ }
319
+ $();
320
+ var K = B(), ne = H(K);
321
+ {
322
+ var ie = (M) => {
323
+ var b = Ae(), q = d(b), le = d(q), F = d(le);
324
+ {
325
+ var ce = (t) => {
326
+ var s = Ye(), m = d(s);
327
+ ke(m, () => y[i()], (ge, pe) => {
328
+ pe(ge, {
329
+ size: 20,
330
+ get class() {
331
+ return k(i()), _(() => Y[i()].icon);
332
+ }
333
+ });
334
+ }), n(t, s);
335
+ };
336
+ p(F, (t) => {
337
+ h() && t(ce);
338
+ });
339
+ }
340
+ var J = T(F, 2), O = d(J);
341
+ {
342
+ var de = (t) => {
343
+ var s = De(), m = d(s);
344
+ w(() => X(m, v())), n(t, s);
345
+ };
346
+ p(O, (t) => {
347
+ v() && t(de);
348
+ });
349
+ }
350
+ var R = T(O, 2);
351
+ {
352
+ var ve = (t) => {
353
+ var s = Pe(), m = d(s);
354
+ w(() => X(m, r())), n(t, s);
355
+ };
356
+ p(R, (t) => {
357
+ r() && t(ve);
358
+ });
359
+ }
360
+ var me = T(R, 2);
361
+ be(me, e, "default", {}, null);
362
+ var fe = T(J, 2);
363
+ {
364
+ var ue = (t) => {
365
+ var s = Be(), m = d(s);
366
+ Te(m, { size: 16 }), w(() => P(
367
+ s,
368
+ 1,
369
+ `
370
+ flex-shrink-0 ml-3 p-1 rounded-full
371
+ ${k(i()), _(() => Y[i()].close) ?? ""}
372
+ transition-colors duration-200
373
+ `,
374
+ "svelte-ayjeya"
375
+ )), E("click", s, C), n(t, s);
376
+ };
377
+ p(fe, (t) => {
378
+ j() && t(ue);
379
+ });
380
+ }
381
+ var he = T(q, 2);
382
+ {
383
+ var ye = (t) => {
384
+ var s = He(), m = d(s);
385
+ w(() => ze(m, `animation-duration: ${o() ?? ""}ms;`)), n(t, s);
386
+ };
387
+ p(he, (t) => {
388
+ o() > 0 && t(ye);
389
+ });
390
+ }
391
+ w(() => P(
392
+ b,
393
+ 1,
394
+ `
395
+ fixed z-notification max-w-sm w-full
396
+ ${k(l()), _(() => se[l()]) ?? ""}
397
+ ${k(i()), _(() => Y[i()].container) ?? ""}
398
+ border rounded-lg shadow-adaptive-lg
399
+ ${L() ?? ""}
400
+ `,
401
+ "svelte-ayjeya"
402
+ )), E("mouseenter", b, re), E("mouseleave", b, oe), we(3, b, () => _e, () => ({
403
+ x: l().includes("right") ? 300 : l().includes("left") ? -300 : 0,
404
+ y: l().includes("top") ? -50 : 50,
405
+ duration: 300
406
+ })), n(M, b);
407
+ };
408
+ p(ne, (M) => {
409
+ g(z) && M(ie);
410
+ });
411
+ }
412
+ n(f, K), N();
413
+ }
414
+ export {
415
+ Je as T,
416
+ Oe as a
417
+ };