zabi-components 2.0.4 → 2.2.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.
- package/README.md +163 -176
- package/dist/Checkbox-Dzsjjsfr.js +307 -0
- package/dist/Navigation-BxP-osMQ.js +78 -0
- package/dist/OptimizedImage-D-eQavox.js +593 -0
- package/dist/ThemeToggle-Cm25ThjX.js +42 -0
- package/dist/atoms/index.js +3 -3
- package/dist/index/index.js +31 -31
- package/dist/molecules/index.js +517 -10
- package/dist/organisms/index.js +1 -1
- package/dist/props-B4BdFk2B.js +2339 -0
- package/package.json +3 -2
- package/dist/Checkbox-cOmcN4_d.js +0 -276
- package/dist/ContactForm-DKoAOLWp.js +0 -523
- package/dist/Navigation-BCY_oTq9.js +0 -79
- package/dist/OptimizedImage-AlFTGrwF.js +0 -584
- package/dist/ThemeToggle-Dgb0rEn7.js +0 -35
- package/dist/props-D1U_TNgY.js +0 -2026
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zabi-components",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A modern SvelteKit component library with TypeScript and Tailwind CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index/index.js",
|
|
@@ -95,5 +95,6 @@
|
|
|
95
95
|
"optional": true
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
"svelte": "./dist/index/index.js"
|
|
98
|
+
"svelte": "./dist/index/index.js",
|
|
99
|
+
"ssr": true
|
|
99
100
|
}
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { w as X, x as L, y as Y, u as O, z as P, A as B, B as Z, j as n, C as u, D as A, i as D, f as M, k as $, t as k, b as p, p as T, c as q, v as S, g as i, m as f, d as z, h as x, n as j, E as I, s as v, a as H, l as J, o as K } from "./props-D1U_TNgY.js";
|
|
2
|
-
function de(a, e) {
|
|
3
|
-
X(() => {
|
|
4
|
-
var t = a.getRootNode(), s = (
|
|
5
|
-
/** @type {ShadowRoot} */
|
|
6
|
-
t.host ? (
|
|
7
|
-
/** @type {ShadowRoot} */
|
|
8
|
-
t
|
|
9
|
-
) : (
|
|
10
|
-
/** @type {Document} */
|
|
11
|
-
t.head ?? /** @type {Document} */
|
|
12
|
-
t.ownerDocument.head
|
|
13
|
-
)
|
|
14
|
-
);
|
|
15
|
-
if (!s.querySelector("#" + e.hash)) {
|
|
16
|
-
const r = document.createElement("style");
|
|
17
|
-
r.id = e.hash, r.textContent = e.code, s.appendChild(r);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function Q(a, e, t = e) {
|
|
22
|
-
var s = /* @__PURE__ */ new WeakSet();
|
|
23
|
-
L(a, "input", async (r) => {
|
|
24
|
-
var l = r ? a.defaultValue : a.value;
|
|
25
|
-
if (l = W(a) ? F(l) : l, t(l), B !== null && s.add(B), await Y(), l !== (l = e())) {
|
|
26
|
-
var b = a.selectionStart, d = a.selectionEnd;
|
|
27
|
-
a.value = l ?? "", d !== null && (a.selectionStart = b, a.selectionEnd = Math.min(d, a.value.length));
|
|
28
|
-
}
|
|
29
|
-
}), // If we are hydrating and the value has since changed,
|
|
30
|
-
// then use the updated value from the input instead.
|
|
31
|
-
// If defaultValue is set, then value == defaultValue
|
|
32
|
-
// TODO Svelte 6: remove input.value check and set to empty string?
|
|
33
|
-
O(e) == null && a.value && (t(W(a) ? F(a.value) : a.value), B !== null && s.add(B)), P(() => {
|
|
34
|
-
var r = e();
|
|
35
|
-
if (a === document.activeElement) {
|
|
36
|
-
var l = (
|
|
37
|
-
/** @type {Batch} */
|
|
38
|
-
Z ?? B
|
|
39
|
-
);
|
|
40
|
-
if (s.has(l))
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
W(a) && r === F(a.value) || a.type === "date" && !r && !a.value || r !== a.value && (a.value = r ?? "");
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function ee(a, e, t = e) {
|
|
47
|
-
L(a, "change", (s) => {
|
|
48
|
-
var r = s ? a.defaultChecked : a.checked;
|
|
49
|
-
t(r);
|
|
50
|
-
}), // If we are hydrating and the value has since changed,
|
|
51
|
-
// then use the update value from the input instead.
|
|
52
|
-
// If defaultChecked is set, then checked == defaultChecked
|
|
53
|
-
O(e) == null && t(a.checked), P(() => {
|
|
54
|
-
var s = e();
|
|
55
|
-
a.checked = !!s;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function W(a) {
|
|
59
|
-
var e = a.type;
|
|
60
|
-
return e === "number" || e === "range";
|
|
61
|
-
}
|
|
62
|
-
function F(a) {
|
|
63
|
-
return a === "" ? null : +a;
|
|
64
|
-
}
|
|
65
|
-
var ae = M("<button><!></button>");
|
|
66
|
-
function ce(a, e) {
|
|
67
|
-
q(e, !1);
|
|
68
|
-
const t = f(), s = f(), r = f();
|
|
69
|
-
let l = n(e, "variant", 8, "primary"), b = n(e, "size", 8, "md"), d = n(e, "disabled", 8, !1), c = n(e, "type", 8, "button");
|
|
70
|
-
u(() => {
|
|
71
|
-
}, () => {
|
|
72
|
-
v(t, {
|
|
73
|
-
sm: "px-3 py-1.5 text-sm",
|
|
74
|
-
md: "px-4 py-2 text-sm",
|
|
75
|
-
lg: "px-5 py-3 text-base"
|
|
76
|
-
});
|
|
77
|
-
}), u(() => {
|
|
78
|
-
}, () => {
|
|
79
|
-
v(s, {
|
|
80
|
-
primary: "bg-blue-600 text-white hover:bg-blue-700",
|
|
81
|
-
secondary: "bg-gray-600 text-white hover:bg-gray-700",
|
|
82
|
-
danger: "bg-red-600 text-white hover:bg-red-700"
|
|
83
|
-
});
|
|
84
|
-
}), u(
|
|
85
|
-
() => (i(t), S(b()), i(s), S(l())),
|
|
86
|
-
() => {
|
|
87
|
-
v(r, [
|
|
88
|
-
"inline-flex items-center justify-center font-medium rounded-md",
|
|
89
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
90
|
-
i(t)[b()],
|
|
91
|
-
i(s)[l()]
|
|
92
|
-
].join(" "));
|
|
93
|
-
}
|
|
94
|
-
), A(), D();
|
|
95
|
-
var m = ae(), _ = z(m);
|
|
96
|
-
$(_, e, "default", {}), k(() => {
|
|
97
|
-
x(m, "type", c()), j(m, 1, I(i(r))), m.disabled = d();
|
|
98
|
-
}), p(a, m), T();
|
|
99
|
-
}
|
|
100
|
-
function U(a) {
|
|
101
|
-
const e = {
|
|
102
|
-
default: "input-variant-default",
|
|
103
|
-
success: "input-variant-success",
|
|
104
|
-
warning: "input-variant-warning",
|
|
105
|
-
error: "input-variant-error",
|
|
106
|
-
info: "input-variant-info"
|
|
107
|
-
};
|
|
108
|
-
return e[a] || e.default;
|
|
109
|
-
}
|
|
110
|
-
function ue(a) {
|
|
111
|
-
const e = {
|
|
112
|
-
default: "card-variant-default",
|
|
113
|
-
success: "card-variant-success",
|
|
114
|
-
warning: "card-variant-warning",
|
|
115
|
-
error: "card-variant-error",
|
|
116
|
-
info: "card-variant-info"
|
|
117
|
-
};
|
|
118
|
-
return e[a] || e.default;
|
|
119
|
-
}
|
|
120
|
-
function G(a, e) {
|
|
121
|
-
const t = {
|
|
122
|
-
default: `variant-${e}-default`,
|
|
123
|
-
success: `variant-${e}-success`,
|
|
124
|
-
warning: `variant-${e}-warning`,
|
|
125
|
-
error: `variant-${e}-error`,
|
|
126
|
-
info: `variant-${e}-info`
|
|
127
|
-
};
|
|
128
|
-
return t[a] || t.default;
|
|
129
|
-
}
|
|
130
|
-
function fe(a) {
|
|
131
|
-
return {
|
|
132
|
-
border: G(a, "border"),
|
|
133
|
-
text: G(a, "text"),
|
|
134
|
-
bg: G(a, "bg")
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function ve(a, e) {
|
|
138
|
-
return a.reduce((t, s) => (t[s] = `${e}-${s}`, t), {});
|
|
139
|
-
}
|
|
140
|
-
var te = M("<label> </label>"), se = M("<div><!> <input/></div>");
|
|
141
|
-
function be(a, e) {
|
|
142
|
-
q(e, !1);
|
|
143
|
-
const t = f(), s = f(), r = f(), l = f();
|
|
144
|
-
let b = n(e, "value", 12, ""), d = n(e, "type", 8, "text"), c = n(e, "label", 8, ""), m = n(e, "placeholder", 8, ""), _ = n(e, "disabled", 8, !1), g = n(e, "size", 8, "md"), h = n(e, "variant", 8, "default");
|
|
145
|
-
const C = `input-${Math.random().toString(36).substr(2, 9)}`;
|
|
146
|
-
u(() => {
|
|
147
|
-
}, () => {
|
|
148
|
-
v(t, {
|
|
149
|
-
sm: "px-3 py-1.5 text-sm",
|
|
150
|
-
md: "px-4 py-2 text-sm",
|
|
151
|
-
lg: "px-5 py-3 text-base"
|
|
152
|
-
});
|
|
153
|
-
}), u(() => S(h()), () => {
|
|
154
|
-
v(s, U(h()));
|
|
155
|
-
}), u(
|
|
156
|
-
() => (i(t), S(g()), i(s)),
|
|
157
|
-
() => {
|
|
158
|
-
v(r, [
|
|
159
|
-
"w-full rounded-md transition-colors duration-200",
|
|
160
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",
|
|
161
|
-
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-disabled",
|
|
162
|
-
i(t)[g()],
|
|
163
|
-
i(s)
|
|
164
|
-
].join(" "));
|
|
165
|
-
}
|
|
166
|
-
), u(() => {
|
|
167
|
-
}, () => {
|
|
168
|
-
v(l, "block text-sm font-medium text-primary mb-1");
|
|
169
|
-
}), A(), D();
|
|
170
|
-
var V = se(), E = z(V);
|
|
171
|
-
{
|
|
172
|
-
var N = (w) => {
|
|
173
|
-
var y = te(), R = z(y);
|
|
174
|
-
k(() => {
|
|
175
|
-
x(y, "for", C), j(y, 1, I(i(l))), K(R, c());
|
|
176
|
-
}), p(w, y);
|
|
177
|
-
};
|
|
178
|
-
H(E, (w) => {
|
|
179
|
-
c() && w(N);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
var o = J(E, 2);
|
|
183
|
-
k(() => {
|
|
184
|
-
x(o, "id", C), x(o, "type", d()), x(o, "placeholder", m()), o.disabled = _(), j(o, 1, I(i(r)));
|
|
185
|
-
}), Q(o, b), p(a, V), T();
|
|
186
|
-
}
|
|
187
|
-
var re = M("<label> </label>"), le = M("<div><!> <textarea></textarea></div>");
|
|
188
|
-
function me(a, e) {
|
|
189
|
-
q(e, !1);
|
|
190
|
-
const t = f(), s = f(), r = f(), l = f();
|
|
191
|
-
let b = n(e, "value", 12, ""), d = n(e, "label", 8, ""), c = n(e, "placeholder", 8, ""), m = n(e, "disabled", 8, !1), _ = n(e, "rows", 8, 4), g = n(e, "size", 8, "md"), h = n(e, "variant", 8, "default");
|
|
192
|
-
const C = `textarea-${Math.random().toString(36).substr(2, 9)}`;
|
|
193
|
-
u(() => {
|
|
194
|
-
}, () => {
|
|
195
|
-
v(t, {
|
|
196
|
-
sm: "px-3 py-1.5 text-sm",
|
|
197
|
-
md: "px-4 py-2 text-sm",
|
|
198
|
-
lg: "px-5 py-3 text-base"
|
|
199
|
-
});
|
|
200
|
-
}), u(() => S(h()), () => {
|
|
201
|
-
v(s, U(h()));
|
|
202
|
-
}), u(
|
|
203
|
-
() => (i(t), S(g()), i(s)),
|
|
204
|
-
() => {
|
|
205
|
-
v(r, [
|
|
206
|
-
"w-full rounded-md transition-colors duration-200",
|
|
207
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",
|
|
208
|
-
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-disabled",
|
|
209
|
-
"resize-y",
|
|
210
|
-
i(t)[g()],
|
|
211
|
-
i(s)
|
|
212
|
-
].join(" "));
|
|
213
|
-
}
|
|
214
|
-
), u(() => {
|
|
215
|
-
}, () => {
|
|
216
|
-
v(l, "block text-sm font-medium text-primary mb-1");
|
|
217
|
-
}), A(), D();
|
|
218
|
-
var V = le(), E = z(V);
|
|
219
|
-
{
|
|
220
|
-
var N = (w) => {
|
|
221
|
-
var y = re(), R = z(y);
|
|
222
|
-
k(() => {
|
|
223
|
-
x(y, "for", C), j(y, 1, I(i(l))), K(R, d());
|
|
224
|
-
}), p(w, y);
|
|
225
|
-
};
|
|
226
|
-
H(E, (w) => {
|
|
227
|
-
d() && w(N);
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
var o = J(E, 2);
|
|
231
|
-
k(() => {
|
|
232
|
-
x(o, "id", C), x(o, "placeholder", c()), o.disabled = m(), x(o, "rows", _()), j(o, 1, I(i(r)));
|
|
233
|
-
}), Q(o, b), p(a, V), T();
|
|
234
|
-
}
|
|
235
|
-
var ne = M('<label class="text-sm font-medium cursor-pointer"> </label>'), ie = M('<div class="flex items-center gap-2"><input type="checkbox"/> <!></div>');
|
|
236
|
-
function xe(a, e) {
|
|
237
|
-
q(e, !1);
|
|
238
|
-
const t = f();
|
|
239
|
-
let s = n(e, "checked", 12, !1), r = n(e, "disabled", 8, !1), l = n(e, "label", 8, "");
|
|
240
|
-
const b = `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
241
|
-
u(() => {
|
|
242
|
-
}, () => {
|
|
243
|
-
v(t, [
|
|
244
|
-
"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded",
|
|
245
|
-
"focus:ring-blue-500 focus:ring-2",
|
|
246
|
-
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
247
|
-
].join(" "));
|
|
248
|
-
}), A(), D();
|
|
249
|
-
var d = ie(), c = z(d), m = J(c, 2);
|
|
250
|
-
{
|
|
251
|
-
var _ = (g) => {
|
|
252
|
-
var h = ne(), C = z(h);
|
|
253
|
-
k(() => {
|
|
254
|
-
x(h, "for", b), K(C, l());
|
|
255
|
-
}), p(g, h);
|
|
256
|
-
};
|
|
257
|
-
H(m, (g) => {
|
|
258
|
-
l() && g(_);
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
k(() => {
|
|
262
|
-
x(c, "id", b), c.disabled = r(), j(c, 1, I(i(t)));
|
|
263
|
-
}), ee(c, s), p(a, d), T();
|
|
264
|
-
}
|
|
265
|
-
export {
|
|
266
|
-
ce as B,
|
|
267
|
-
xe as C,
|
|
268
|
-
be as I,
|
|
269
|
-
me as T,
|
|
270
|
-
ue as a,
|
|
271
|
-
G as b,
|
|
272
|
-
fe as c,
|
|
273
|
-
ve as d,
|
|
274
|
-
de as e,
|
|
275
|
-
U as g
|
|
276
|
-
};
|