zabi-components 2.1.1 → 2.2.1
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/Checkbox-D2PLqgxA.js +307 -0
- package/dist/OptimizedImage-B5NMIuac.js +593 -0
- package/dist/atoms/index.js +2 -2
- package/dist/index/index.js +30 -30
- package/dist/molecules/index.js +1 -1
- package/package.json +4 -3
- package/dist/Checkbox-Dwvh3lCd.js +0 -302
- package/dist/OptimizedImage-8a380fXi.js +0 -593
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { y as U, l as C, p as a, z as b, A as N, i as P, f as M, a as S, s as W, c as k, d as $, g as A, x as z, k as t, m as o, h as I, o as l, b as R, e as F, j as G, t as H, v as J, u as L, B as O, n as K } from "./props-B4BdFk2B.js";
|
|
2
|
+
function ne(s, e) {
|
|
3
|
+
U(() => {
|
|
4
|
+
var r = s.getRootNode(), c = (
|
|
5
|
+
/** @type {ShadowRoot} */
|
|
6
|
+
r.host ? (
|
|
7
|
+
/** @type {ShadowRoot} */
|
|
8
|
+
r
|
|
9
|
+
) : (
|
|
10
|
+
/** @type {Document} */
|
|
11
|
+
r.head ?? /** @type {Document} */
|
|
12
|
+
r.ownerDocument.head
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
if (!c.querySelector("#" + e.hash)) {
|
|
16
|
+
const n = document.createElement("style");
|
|
17
|
+
n.id = e.hash, n.textContent = e.code, c.appendChild(n);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
var X = M("<button><!></button>");
|
|
22
|
+
function le(s, e) {
|
|
23
|
+
const r = C(e, ["children", "$$slots", "$$events", "$$legacy"]), c = C(r, ["variant", "size", "disabled", "type", "className"]);
|
|
24
|
+
A(e, !1);
|
|
25
|
+
const n = o(), d = o(), h = o();
|
|
26
|
+
let g = a(e, "variant", 8, "primary"), u = a(e, "size", 8, "md"), _ = a(e, "disabled", 8, !1), p = a(e, "type", 8, "button"), m = a(e, "className", 8, "");
|
|
27
|
+
b(() => {
|
|
28
|
+
}, () => {
|
|
29
|
+
l(n, {
|
|
30
|
+
sm: "px-3 py-1.5 text-sm",
|
|
31
|
+
md: "px-4 py-2 text-sm",
|
|
32
|
+
lg: "px-5 py-3 text-base"
|
|
33
|
+
});
|
|
34
|
+
}), b(() => {
|
|
35
|
+
}, () => {
|
|
36
|
+
l(d, {
|
|
37
|
+
primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",
|
|
38
|
+
secondary: "bg-gray-600 text-white hover:bg-gray-700 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2",
|
|
39
|
+
danger: "bg-red-600 text-white hover:bg-red-700 focus:ring-2 focus:ring-red-500 focus:ring-offset-2",
|
|
40
|
+
success: "bg-green-600 text-white hover:bg-green-700 focus:ring-2 focus:ring-green-500 focus:ring-offset-2",
|
|
41
|
+
ghost: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2",
|
|
42
|
+
brand: "bg-purple-600 text-white hover:bg-purple-700 focus:ring-2 focus:ring-purple-500 focus:ring-offset-2"
|
|
43
|
+
});
|
|
44
|
+
}), b(
|
|
45
|
+
() => (t(n), z(u()), t(d), z(g()), z(m())),
|
|
46
|
+
() => {
|
|
47
|
+
l(h, [
|
|
48
|
+
"inline-flex items-center justify-center font-medium rounded-md transition-colors duration-200",
|
|
49
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
50
|
+
"focus:outline-none",
|
|
51
|
+
t(n)[u()],
|
|
52
|
+
t(d)[g()],
|
|
53
|
+
m()
|
|
54
|
+
].filter(Boolean).join(" "));
|
|
55
|
+
}
|
|
56
|
+
), N(), P();
|
|
57
|
+
var y = X();
|
|
58
|
+
S(y, () => ({
|
|
59
|
+
type: p(),
|
|
60
|
+
class: t(h),
|
|
61
|
+
disabled: _(),
|
|
62
|
+
...c
|
|
63
|
+
}));
|
|
64
|
+
var w = I(y);
|
|
65
|
+
W(w, e, "default", {}), k(s, y), $();
|
|
66
|
+
}
|
|
67
|
+
function Q(s) {
|
|
68
|
+
const e = {
|
|
69
|
+
default: "input-variant-default",
|
|
70
|
+
success: "input-variant-success",
|
|
71
|
+
warning: "input-variant-warning",
|
|
72
|
+
error: "input-variant-error",
|
|
73
|
+
info: "input-variant-info"
|
|
74
|
+
};
|
|
75
|
+
return e[s] || e.default;
|
|
76
|
+
}
|
|
77
|
+
function ie(s) {
|
|
78
|
+
const e = {
|
|
79
|
+
default: "card-variant-default",
|
|
80
|
+
success: "card-variant-success",
|
|
81
|
+
warning: "card-variant-warning",
|
|
82
|
+
error: "card-variant-error",
|
|
83
|
+
info: "card-variant-info"
|
|
84
|
+
};
|
|
85
|
+
return e[s] || e.default;
|
|
86
|
+
}
|
|
87
|
+
function E(s, e) {
|
|
88
|
+
const r = {
|
|
89
|
+
default: `variant-${e}-default`,
|
|
90
|
+
success: `variant-${e}-success`,
|
|
91
|
+
warning: `variant-${e}-warning`,
|
|
92
|
+
error: `variant-${e}-error`,
|
|
93
|
+
info: `variant-${e}-info`
|
|
94
|
+
};
|
|
95
|
+
return r[s] || r.default;
|
|
96
|
+
}
|
|
97
|
+
function oe(s) {
|
|
98
|
+
return {
|
|
99
|
+
border: E(s, "border"),
|
|
100
|
+
text: E(s, "text"),
|
|
101
|
+
bg: E(s, "bg")
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function de(s, e) {
|
|
105
|
+
return s.reduce((r, c) => (r[c] = `${e}-${c}`, r), {});
|
|
106
|
+
}
|
|
107
|
+
var Y = M("<label> </label>"), Z = M("<div><!> <input/></div>");
|
|
108
|
+
function ce(s, e) {
|
|
109
|
+
const r = C(e, ["children", "$$slots", "$$events", "$$legacy"]), c = C(r, [
|
|
110
|
+
"value",
|
|
111
|
+
"type",
|
|
112
|
+
"label",
|
|
113
|
+
"placeholder",
|
|
114
|
+
"disabled",
|
|
115
|
+
"size",
|
|
116
|
+
"variant"
|
|
117
|
+
]);
|
|
118
|
+
A(e, !1);
|
|
119
|
+
const n = o(), d = o(), h = o(), g = o();
|
|
120
|
+
let u = a(e, "value", 12, ""), _ = a(e, "type", 8, "text"), p = a(e, "label", 8, ""), m = a(e, "placeholder", 8, ""), y = a(e, "disabled", 8, !1), w = a(e, "size", 8, "md"), v = a(e, "variant", 8, "default"), i = o();
|
|
121
|
+
typeof window < "u" ? l(i, `input-${Math.random().toString(36).substr(2, 9)}`) : l(i, `input-ssr-${Date.now()}`);
|
|
122
|
+
function j(x) {
|
|
123
|
+
const f = x.target;
|
|
124
|
+
u(f.value);
|
|
125
|
+
}
|
|
126
|
+
b(() => {
|
|
127
|
+
}, () => {
|
|
128
|
+
l(n, {
|
|
129
|
+
sm: "px-3 py-1.5 text-sm",
|
|
130
|
+
md: "px-4 py-2 text-sm",
|
|
131
|
+
lg: "px-5 py-3 text-base"
|
|
132
|
+
});
|
|
133
|
+
}), b(() => z(v()), () => {
|
|
134
|
+
l(d, Q(v()));
|
|
135
|
+
}), b(
|
|
136
|
+
() => (t(n), z(w()), t(d)),
|
|
137
|
+
() => {
|
|
138
|
+
l(h, [
|
|
139
|
+
"w-full rounded-md transition-colors duration-200",
|
|
140
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",
|
|
141
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-disabled",
|
|
142
|
+
t(n)[w()],
|
|
143
|
+
t(d)
|
|
144
|
+
].join(" "));
|
|
145
|
+
}
|
|
146
|
+
), b(() => {
|
|
147
|
+
}, () => {
|
|
148
|
+
l(g, "block text-sm font-medium text-primary mb-1");
|
|
149
|
+
}), N(), P();
|
|
150
|
+
var V = Z(), B = I(V);
|
|
151
|
+
{
|
|
152
|
+
var T = (x) => {
|
|
153
|
+
var f = Y(), q = I(f);
|
|
154
|
+
H(() => {
|
|
155
|
+
J(f, "for", t(i)), L(f, 1, O(t(g))), K(q, p());
|
|
156
|
+
}), k(x, f);
|
|
157
|
+
};
|
|
158
|
+
R(B, (x) => {
|
|
159
|
+
p() && x(T);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
var D = G(B, 2);
|
|
163
|
+
S(
|
|
164
|
+
D,
|
|
165
|
+
() => ({
|
|
166
|
+
id: t(i),
|
|
167
|
+
type: _(),
|
|
168
|
+
value: u(),
|
|
169
|
+
placeholder: m(),
|
|
170
|
+
disabled: y(),
|
|
171
|
+
class: t(h),
|
|
172
|
+
...c
|
|
173
|
+
}),
|
|
174
|
+
void 0,
|
|
175
|
+
void 0,
|
|
176
|
+
void 0,
|
|
177
|
+
!0
|
|
178
|
+
), F("input", D, j), k(s, V), $();
|
|
179
|
+
}
|
|
180
|
+
var ee = M("<label> </label>"), te = M("<div><!> <textarea></textarea></div>");
|
|
181
|
+
function ue(s, e) {
|
|
182
|
+
const r = C(e, ["children", "$$slots", "$$events", "$$legacy"]), c = C(r, [
|
|
183
|
+
"value",
|
|
184
|
+
"label",
|
|
185
|
+
"placeholder",
|
|
186
|
+
"disabled",
|
|
187
|
+
"rows",
|
|
188
|
+
"size",
|
|
189
|
+
"variant"
|
|
190
|
+
]);
|
|
191
|
+
A(e, !1);
|
|
192
|
+
const n = o(), d = o(), h = o(), g = o();
|
|
193
|
+
let u = a(e, "value", 12, ""), _ = a(e, "label", 8, ""), p = a(e, "placeholder", 8, ""), m = a(e, "disabled", 8, !1), y = a(e, "rows", 8, 4), w = a(e, "size", 8, "md"), v = a(e, "variant", 8, "default"), i = o();
|
|
194
|
+
typeof window < "u" ? l(i, `textarea-${Math.random().toString(36).substr(2, 9)}`) : l(i, `textarea-ssr-${Date.now()}`);
|
|
195
|
+
function j(x) {
|
|
196
|
+
const f = x.target;
|
|
197
|
+
u(f.value);
|
|
198
|
+
}
|
|
199
|
+
b(() => {
|
|
200
|
+
}, () => {
|
|
201
|
+
l(n, {
|
|
202
|
+
sm: "px-3 py-1.5 text-sm",
|
|
203
|
+
md: "px-4 py-2 text-sm",
|
|
204
|
+
lg: "px-5 py-3 text-base"
|
|
205
|
+
});
|
|
206
|
+
}), b(() => z(v()), () => {
|
|
207
|
+
l(d, Q(v()));
|
|
208
|
+
}), b(
|
|
209
|
+
() => (t(n), z(w()), t(d)),
|
|
210
|
+
() => {
|
|
211
|
+
l(h, [
|
|
212
|
+
"w-full rounded-md transition-colors duration-200",
|
|
213
|
+
"focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-surface",
|
|
214
|
+
"disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-disabled",
|
|
215
|
+
"resize-y",
|
|
216
|
+
t(n)[w()],
|
|
217
|
+
t(d)
|
|
218
|
+
].join(" "));
|
|
219
|
+
}
|
|
220
|
+
), b(() => {
|
|
221
|
+
}, () => {
|
|
222
|
+
l(g, "block text-sm font-medium text-primary mb-1");
|
|
223
|
+
}), N(), P();
|
|
224
|
+
var V = te(), B = I(V);
|
|
225
|
+
{
|
|
226
|
+
var T = (x) => {
|
|
227
|
+
var f = ee(), q = I(f);
|
|
228
|
+
H(() => {
|
|
229
|
+
J(f, "for", t(i)), L(f, 1, O(t(g))), K(q, _());
|
|
230
|
+
}), k(x, f);
|
|
231
|
+
};
|
|
232
|
+
R(B, (x) => {
|
|
233
|
+
_() && x(T);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
var D = G(B, 2);
|
|
237
|
+
S(D, () => ({
|
|
238
|
+
id: t(i),
|
|
239
|
+
value: u(),
|
|
240
|
+
placeholder: p(),
|
|
241
|
+
disabled: m(),
|
|
242
|
+
rows: y(),
|
|
243
|
+
class: t(h),
|
|
244
|
+
...c
|
|
245
|
+
})), F("input", D, j), k(s, V), $();
|
|
246
|
+
}
|
|
247
|
+
var ae = M('<label class="text-sm font-medium cursor-pointer"> </label>'), se = M('<div class="flex items-center gap-2"><input/> <!></div>');
|
|
248
|
+
function fe(s, e) {
|
|
249
|
+
const r = C(e, ["children", "$$slots", "$$events", "$$legacy"]), c = C(r, ["checked", "disabled", "label"]);
|
|
250
|
+
A(e, !1);
|
|
251
|
+
const n = o();
|
|
252
|
+
let d = a(e, "checked", 12, !1), h = a(e, "disabled", 8, !1), g = a(e, "label", 8, ""), u = o();
|
|
253
|
+
typeof window < "u" ? l(u, `checkbox-${Math.random().toString(36).substr(2, 9)}`) : l(u, `checkbox-ssr-${Date.now()}`);
|
|
254
|
+
function _(v) {
|
|
255
|
+
const i = v.target;
|
|
256
|
+
d(i.checked);
|
|
257
|
+
}
|
|
258
|
+
b(() => {
|
|
259
|
+
}, () => {
|
|
260
|
+
l(n, [
|
|
261
|
+
"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded",
|
|
262
|
+
"focus:ring-blue-500 focus:ring-2",
|
|
263
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
264
|
+
].join(" "));
|
|
265
|
+
}), N(), P();
|
|
266
|
+
var p = se(), m = I(p);
|
|
267
|
+
S(
|
|
268
|
+
m,
|
|
269
|
+
() => ({
|
|
270
|
+
type: "checkbox",
|
|
271
|
+
id: t(u),
|
|
272
|
+
checked: d(),
|
|
273
|
+
disabled: h(),
|
|
274
|
+
class: t(n),
|
|
275
|
+
...c
|
|
276
|
+
}),
|
|
277
|
+
void 0,
|
|
278
|
+
void 0,
|
|
279
|
+
void 0,
|
|
280
|
+
!0
|
|
281
|
+
);
|
|
282
|
+
var y = G(m, 2);
|
|
283
|
+
{
|
|
284
|
+
var w = (v) => {
|
|
285
|
+
var i = ae(), j = I(i);
|
|
286
|
+
H(() => {
|
|
287
|
+
J(i, "for", t(u)), K(j, g());
|
|
288
|
+
}), k(v, i);
|
|
289
|
+
};
|
|
290
|
+
R(y, (v) => {
|
|
291
|
+
g() && v(w);
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
F("change", m, _), k(s, p), $();
|
|
295
|
+
}
|
|
296
|
+
export {
|
|
297
|
+
le as B,
|
|
298
|
+
fe as C,
|
|
299
|
+
ce as I,
|
|
300
|
+
ue as T,
|
|
301
|
+
ie as a,
|
|
302
|
+
E as b,
|
|
303
|
+
oe as c,
|
|
304
|
+
de as d,
|
|
305
|
+
ne as e,
|
|
306
|
+
Q as g
|
|
307
|
+
};
|