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