solid-uix 0.4.0 → 0.5.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.
Files changed (40) hide show
  1. package/README.md +22 -2
  2. package/dist/main.css +1 -1
  3. package/dist/main.js +233 -538
  4. package/dist/main.js.map +1 -0
  5. package/dist/ssr/main.js +395 -0
  6. package/dist/ssr/main.js.map +1 -0
  7. package/dist/{button → types/button}/button.d.ts +2 -0
  8. package/dist/{field → types/field}/field.types.d.ts +1 -1
  9. package/dist/types/link/link.d.ts +2 -0
  10. package/dist/types/link/link.stories.d.ts +48 -0
  11. package/dist/types/link/link.types.d.ts +6 -0
  12. package/dist/{main.d.ts → types/main.d.ts} +3 -1
  13. package/dist/types/text_area/text_area.d.ts +2 -0
  14. package/dist/types/text_area/text_area.stories.d.ts +38 -0
  15. package/dist/types/text_area/text_area.types.d.ts +4 -0
  16. package/dist/types/text_input/text_input.stories.d.ts +30 -0
  17. package/package.json +10 -9
  18. package/dist/main.umd.cjs +0 -1
  19. /package/dist/{button → types/button}/button.types.d.ts +0 -0
  20. /package/dist/{checkbox → types/checkbox}/checkbox.d.ts +0 -0
  21. /package/dist/{checkbox → types/checkbox}/checkbox.stories.d.ts +0 -0
  22. /package/dist/{checkbox → types/checkbox}/checkbox.types.d.ts +0 -0
  23. /package/dist/{dialog → types/dialog}/dialog.d.ts +0 -0
  24. /package/dist/{dialog → types/dialog}/dialog.types.d.ts +0 -0
  25. /package/dist/{dialog → types/dialog}/provider/context.d.ts +0 -0
  26. /package/dist/{dialog → types/dialog}/provider/context.types.d.ts +0 -0
  27. /package/dist/{dialog → types/dialog}/provider/provider.d.ts +0 -0
  28. /package/dist/{dialog → types/dialog}/provider/provider.types.d.ts +0 -0
  29. /package/dist/{field → types/field}/field.context.d.ts +0 -0
  30. /package/dist/{field → types/field}/field.d.ts +0 -0
  31. /package/dist/{list → types/list}/list.d.ts +0 -0
  32. /package/dist/{list → types/list}/list.types.d.ts +0 -0
  33. /package/dist/{select → types/select}/select.d.ts +0 -0
  34. /package/dist/{select → types/select}/select.types.d.ts +0 -0
  35. /package/dist/{text_input → types/text_input}/text_input.d.ts +0 -0
  36. /package/dist/{text_input → types/text_input}/text_input.types.d.ts +0 -0
  37. /package/dist/{utils → types/utils}/cls.d.ts +0 -0
  38. /package/dist/{utils → types/utils}/message.d.ts +0 -0
  39. /package/dist/{utils → types/utils}/noop.d.ts +0 -0
  40. /package/dist/{utils → types/utils}/string.d.ts +0 -0
package/dist/main.js CHANGED
@@ -1,629 +1,324 @@
1
- import { createMemo as w, createRenderEffect as $, untrack as ne, sharedConfig as m, splitProps as A, mergeProps as g, createUniqueId as B, createContext as Q, useContext as W, createSignal as F, createComponent as I, createEffect as U, children as Z, Show as se } from "solid-js";
2
- const ie = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"], oe = /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...ie]), le = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]), re = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
3
- className: "class",
4
- htmlFor: "for"
5
- }), ce = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
6
- class: "className",
7
- novalidate: {
8
- $: "noValidate",
9
- FORM: 1
10
- },
11
- formnovalidate: {
12
- $: "formNoValidate",
13
- BUTTON: 1,
14
- INPUT: 1
15
- },
16
- ismap: {
17
- $: "isMap",
18
- IMG: 1
19
- },
20
- nomodule: {
21
- $: "noModule",
22
- SCRIPT: 1
23
- },
24
- playsinline: {
25
- $: "playsInline",
26
- VIDEO: 1
27
- },
28
- readonly: {
29
- $: "readOnly",
30
- INPUT: 1,
31
- TEXTAREA: 1
32
- }
33
- });
34
- function ae(n, e) {
35
- const t = ce[n];
36
- return typeof t == "object" ? t[e] ? t.$ : void 0 : t;
37
- }
38
- const fe = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]), q = (n) => w(() => n());
39
- function de(n, e, t) {
40
- let s = t.length, i = e.length, l = s, c = 0, o = 0, r = e[i - 1].nextSibling, a = null;
41
- for (; c < i || o < l; ) {
42
- if (e[c] === t[o]) {
43
- c++, o++;
44
- continue;
45
- }
46
- for (; e[i - 1] === t[l - 1]; )
47
- i--, l--;
48
- if (i === c) {
49
- const f = l < s ? o ? t[o - 1].nextSibling : t[l - o] : r;
50
- for (; o < l; ) n.insertBefore(t[o++], f);
51
- } else if (l === o)
52
- for (; c < i; )
53
- (!a || !a.has(e[c])) && e[c].remove(), c++;
54
- else if (e[c] === t[l - 1] && t[o] === e[i - 1]) {
55
- const f = e[--i].nextSibling;
56
- n.insertBefore(t[o++], e[c++].nextSibling), n.insertBefore(t[--l], f), e[i] = t[l];
57
- } else {
58
- if (!a) {
59
- a = /* @__PURE__ */ new Map();
60
- let u = o;
61
- for (; u < l; ) a.set(t[u], u++);
62
- }
63
- const f = a.get(e[c]);
64
- if (f != null)
65
- if (o < f && f < l) {
66
- let u = c, d = 1, C;
67
- for (; ++u < i && u < l && !((C = a.get(e[u])) == null || C !== f + d); )
68
- d++;
69
- if (d > f - o) {
70
- const V = e[c];
71
- for (; o < f; ) n.insertBefore(t[o++], V);
72
- } else n.replaceChild(t[o++], e[c++]);
73
- } else c++;
74
- else e[c++].remove();
75
- }
76
- }
77
- }
78
- const G = "_$DX_DELEGATE";
79
- function h(n, e, t, s) {
80
- let i;
81
- const l = () => {
82
- const o = document.createElement("template");
83
- return o.innerHTML = n, o.content.firstChild;
84
- }, c = () => (i || (i = l())).cloneNode(!0);
85
- return c.cloneNode = c, c;
86
- }
87
- function ue(n, e = window.document) {
88
- const t = e[G] || (e[G] = /* @__PURE__ */ new Set());
89
- for (let s = 0, i = n.length; s < i; s++) {
90
- const l = n[s];
91
- t.has(l) || (t.add(l), e.addEventListener(l, $e));
92
- }
93
- }
94
- function S(n, e, t) {
95
- M(n) || (t == null ? n.removeAttribute(e) : n.setAttribute(e, t));
96
- }
97
- function ge(n, e, t) {
98
- M(n) || (t ? n.setAttribute(e, "") : n.removeAttribute(e));
99
- }
100
- function P(n, e) {
101
- M(n) || (e == null ? n.removeAttribute("class") : n.className = e);
102
- }
103
- function he(n, e, t, s) {
104
- if (s)
105
- Array.isArray(t) ? (n[`$$${e}`] = t[0], n[`$$${e}Data`] = t[1]) : n[`$$${e}`] = t;
106
- else if (Array.isArray(t)) {
107
- const i = t[0];
108
- n.addEventListener(e, t[0] = (l) => i.call(n, t[1], l));
109
- } else n.addEventListener(e, t, typeof t != "function" && t);
110
- }
111
- function ye(n, e, t = {}) {
112
- const s = Object.keys(e || {}), i = Object.keys(t);
113
- let l, c;
114
- for (l = 0, c = i.length; l < c; l++) {
115
- const o = i[l];
116
- !o || o === "undefined" || e[o] || (K(n, o, !1), delete t[o]);
117
- }
118
- for (l = 0, c = s.length; l < c; l++) {
119
- const o = s[l], r = !!e[o];
120
- !o || o === "undefined" || t[o] === r || !r || (K(n, o, !0), t[o] = r);
121
- }
122
- return t;
123
- }
124
- function be(n, e, t) {
125
- if (!e) return t ? S(n, "style") : e;
126
- const s = n.style;
127
- if (typeof e == "string") return s.cssText = e;
128
- typeof t == "string" && (s.cssText = t = void 0), t || (t = {}), e || (e = {});
129
- let i, l;
130
- for (l in t)
131
- e[l] == null && s.removeProperty(l), delete t[l];
132
- for (l in e)
133
- i = e[l], i !== t[l] && (s.setProperty(l, i), t[l] = i);
134
- return t;
135
- }
136
- function b(n, e = {}, t, s) {
137
- const i = {};
138
- return s || $(() => i.children = N(n, e.children, i.children)), $(() => typeof e.ref == "function" && z(e.ref, n)), $(() => _e(n, e, t, !0, i, !0)), i;
139
- }
140
- function z(n, e, t) {
141
- return ne(() => n(e, t));
142
- }
143
- function y(n, e, t, s) {
144
- if (t !== void 0 && !s && (s = []), typeof e != "function") return N(n, e, s, t);
145
- $((i) => N(n, e(), i, t), s);
146
- }
147
- function _e(n, e, t, s, i = {}, l = !1) {
148
- e || (e = {});
149
- for (const c in i)
150
- if (!(c in e)) {
151
- if (c === "children") continue;
152
- i[c] = R(n, c, null, i[c], t, l, e);
153
- }
154
- for (const c in e) {
155
- if (c === "children")
156
- continue;
157
- const o = e[c];
158
- i[c] = R(n, c, o, i[c], t, l, e);
159
- }
160
- }
161
- function M(n) {
162
- return !!m.context && !m.done && (!n || n.isConnected);
163
- }
164
- function me(n) {
165
- return n.toLowerCase().replace(/-([a-z])/g, (e, t) => t.toUpperCase());
166
- }
167
- function K(n, e, t) {
168
- const s = e.trim().split(/\s+/);
169
- for (let i = 0, l = s.length; i < l; i++) n.classList.toggle(s[i], t);
170
- }
171
- function R(n, e, t, s, i, l, c) {
172
- let o, r, a, f, u;
173
- if (e === "style") return be(n, t, s);
174
- if (e === "classList") return ye(n, t, s);
175
- if (t === s) return s;
176
- if (e === "ref")
177
- l || t(n);
178
- else if (e.slice(0, 3) === "on:") {
179
- const d = e.slice(3);
180
- s && n.removeEventListener(d, s, typeof s != "function" && s), t && n.addEventListener(d, t, typeof t != "function" && t);
181
- } else if (e.slice(0, 10) === "oncapture:") {
182
- const d = e.slice(10);
183
- s && n.removeEventListener(d, s, !0), t && n.addEventListener(d, t, !0);
184
- } else if (e.slice(0, 2) === "on") {
185
- const d = e.slice(2).toLowerCase(), C = fe.has(d);
186
- if (!C && s) {
187
- const V = Array.isArray(s) ? s[0] : s;
188
- n.removeEventListener(d, V);
189
- }
190
- (C || t) && (he(n, d, t, C), C && ue([d]));
191
- } else if (e.slice(0, 5) === "attr:")
192
- S(n, e.slice(5), t);
193
- else if (e.slice(0, 5) === "bool:")
194
- ge(n, e.slice(5), t);
195
- else if ((u = e.slice(0, 5) === "prop:") || (a = le.has(e)) || (f = ae(e, n.tagName)) || (r = oe.has(e)) || (o = n.nodeName.includes("-") || "is" in c)) {
196
- if (u)
197
- e = e.slice(5), r = !0;
198
- else if (M(n)) return t;
199
- e === "class" || e === "className" ? P(n, t) : o && !r && !a ? n[me(e)] = t : n[f || e] = t;
200
- } else
201
- S(n, re[e] || e, t);
202
- return t;
203
- }
204
- function $e(n) {
205
- if (m.registry && m.events && m.events.find(([r, a]) => a === n))
206
- return;
207
- let e = n.target;
208
- const t = `$$${n.type}`, s = n.target, i = n.currentTarget, l = (r) => Object.defineProperty(n, "target", {
209
- configurable: !0,
210
- value: r
211
- }), c = () => {
212
- const r = e[t];
213
- if (r && !e.disabled) {
214
- const a = e[`${t}Data`];
215
- if (a !== void 0 ? r.call(e, a, n) : r.call(e, n), n.cancelBubble) return;
216
- }
217
- return e.host && typeof e.host != "string" && !e.host._$host && e.contains(n.target) && l(e.host), !0;
218
- }, o = () => {
219
- for (; c() && (e = e._$host || e.parentNode || e.host); ) ;
220
- };
221
- if (Object.defineProperty(n, "currentTarget", {
222
- configurable: !0,
223
- get() {
224
- return e || document;
225
- }
226
- }), m.registry && !m.done && (m.done = _$HY.done = !0), n.composedPath) {
227
- const r = n.composedPath();
228
- l(r[0]);
229
- for (let a = 0; a < r.length - 2 && (e = r[a], !!c()); a++) {
230
- if (e._$host) {
231
- e = e._$host, o();
232
- break;
233
- }
234
- if (e.parentNode === i)
235
- break;
236
- }
237
- } else o();
238
- l(s);
239
- }
240
- function N(n, e, t, s, i) {
241
- const l = M(n);
242
- if (l) {
243
- !t && (t = [...n.childNodes]);
244
- let r = [];
245
- for (let a = 0; a < t.length; a++) {
246
- const f = t[a];
247
- f.nodeType === 8 && f.data.slice(0, 2) === "!$" ? f.remove() : r.push(f);
248
- }
249
- t = r;
250
- }
251
- for (; typeof t == "function"; ) t = t();
252
- if (e === t) return t;
253
- const c = typeof e, o = s !== void 0;
254
- if (n = o && t[0] && t[0].parentNode || n, c === "string" || c === "number") {
255
- if (l || c === "number" && (e = e.toString(), e === t))
256
- return t;
257
- if (o) {
258
- let r = t[0];
259
- r && r.nodeType === 3 ? r.data !== e && (r.data = e) : r = document.createTextNode(e), t = x(n, t, s, r);
260
- } else
261
- t !== "" && typeof t == "string" ? t = n.firstChild.data = e : t = n.textContent = e;
262
- } else if (e == null || c === "boolean") {
263
- if (l) return t;
264
- t = x(n, t, s);
265
- } else {
266
- if (c === "function")
267
- return $(() => {
268
- let r = e();
269
- for (; typeof r == "function"; ) r = r();
270
- t = N(n, r, t, s);
271
- }), () => t;
272
- if (Array.isArray(e)) {
273
- const r = [], a = t && Array.isArray(t);
274
- if (H(r, e, t, i))
275
- return $(() => t = N(n, r, t, s, !0)), () => t;
276
- if (l) {
277
- if (!r.length) return t;
278
- if (s === void 0) return t = [...n.childNodes];
279
- let f = r[0];
280
- if (f.parentNode !== n) return t;
281
- const u = [f];
282
- for (; (f = f.nextSibling) !== s; ) u.push(f);
283
- return t = u;
1
+ import { template as i, spread as u, mergeProps as c, insert as d, createComponent as x, memo as E, setAttribute as N, effect as O, className as M, use as U } from "solid-js/web";
2
+ import { mergeProps as z, splitProps as g, createContext as S, useContext as w, createUniqueId as p, createSignal as P, createMemo as k, createEffect as L, children as A, Show as G } from "solid-js";
3
+ const _ = (...e) => e.filter(Boolean).join(" "), J = "_button_1x3l8_1", K = "_solid_1x3l8_29", Q = "_outlined_1x3l8_44", W = "_link_1x3l8_60", T = {
4
+ button: J,
5
+ solid: K,
6
+ outlined: Q,
7
+ link: W
8
+ };
9
+ var X = /* @__PURE__ */ i("<button type=button>");
10
+ const Y = {
11
+ variant: "solid"
12
+ }, Ue = (e) => {
13
+ const t = z(Y, e), [n, r] = g(t, ["class", "variant"]);
14
+ return (() => {
15
+ var s = X();
16
+ return u(s, c(r, {
17
+ get class() {
18
+ return _(T.button, n.class, n.variant === "solid" && T.solid, n.variant === "outlined" && T.outlined);
284
19
  }
285
- if (r.length === 0) {
286
- if (t = x(n, t, s), o) return t;
287
- } else a ? t.length === 0 ? X(n, r, s) : de(n, t, r) : (t && x(n), X(n, r));
288
- t = r;
289
- } else if (e.nodeType) {
290
- if (l && e.parentNode) return t = o ? [e] : e;
291
- if (Array.isArray(t)) {
292
- if (o) return t = x(n, t, s, e);
293
- x(n, t, null, e);
294
- } else t == null || t === "" || !n.firstChild ? n.appendChild(e) : n.replaceChild(e, n.firstChild);
295
- t = e;
296
- }
297
- }
298
- return t;
299
- }
300
- function H(n, e, t, s) {
301
- let i = !1;
302
- for (let l = 0, c = e.length; l < c; l++) {
303
- let o = e[l], r = t && t[n.length], a;
304
- if (!(o == null || o === !0 || o === !1)) if ((a = typeof o) == "object" && o.nodeType)
305
- n.push(o);
306
- else if (Array.isArray(o))
307
- i = H(n, o, r) || i;
308
- else if (a === "function")
309
- if (s) {
310
- for (; typeof o == "function"; ) o = o();
311
- i = H(n, Array.isArray(o) ? o : [o], Array.isArray(r) ? r : [r]) || i;
312
- } else
313
- n.push(o), i = !0;
314
- else {
315
- const f = String(o);
316
- r && r.nodeType === 3 && r.data === f ? n.push(r) : n.push(document.createTextNode(f));
317
- }
318
- }
319
- return i;
320
- }
321
- function X(n, e, t = null) {
322
- for (let s = 0, i = e.length; s < i; s++) n.insertBefore(e[s], t);
323
- }
324
- function x(n, e, t, s) {
325
- if (t === void 0) return n.textContent = "";
326
- const i = s || document.createTextNode("");
327
- if (e.length) {
328
- let l = !1;
329
- for (let c = e.length - 1; c >= 0; c--) {
330
- const o = e[c];
331
- if (i !== o) {
332
- const r = o.parentNode === n;
333
- !l && !c ? r ? n.replaceChild(i, o) : n.insertBefore(i, t) : r && o.remove();
334
- } else l = !0;
335
- }
336
- } else n.insertBefore(i, t);
337
- return [i];
338
- }
339
- const Ce = "_button_12jrf_1", xe = {
340
- button: Ce
341
- }, _ = (...n) => n.filter(Boolean).join(" ");
342
- var Ae = /* @__PURE__ */ h("<button type=button>");
343
- const ct = (n) => {
344
- const [e, t] = A(n, ["variant"]);
20
+ }), !1, !0), d(s, () => r.children), s;
21
+ })();
22
+ }, Z = "_link_yqbjv_1", ee = "_underline_yqbjv_14", te = "_secondary_yqbjv_18", re = "_disabled_yqbjv_22", D = {
23
+ link: Z,
24
+ underline: ee,
25
+ secondary: te,
26
+ disabled: re
27
+ };
28
+ var ne = /* @__PURE__ */ i("<a>");
29
+ const ze = (e) => {
30
+ const [t, n] = g(e, ["class", "disabled", "color", "underline"]);
345
31
  return (() => {
346
- var s = Ae();
347
- return b(s, g(t, {
32
+ var r = ne();
33
+ return u(r, c(n, {
348
34
  get class() {
349
- return _(xe.button, t.class, e.variant || "solid");
35
+ return _(D.link, t.class, t.disabled && D.disabled, t.color === "secondary" && D.secondary, t.underline === "always" && D.underline);
36
+ },
37
+ get "aria-disabled"() {
38
+ return t.disabled;
350
39
  }
351
- }), !1, !0), y(s, () => n.children), s;
40
+ }), !1, !0), d(r, () => n.children), r;
352
41
  })();
353
- }, Te = "_checkbox_1npj4_1", Ee = "_input_1npj4_8", De = "_indicator_1npj4_18", we = "_label_1npj4_37", Le = "_disabled_1npj4_46", E = {
354
- checkbox: Te,
355
- input: Ee,
356
- indicator: De,
357
- label: we,
358
- disabled: Le
42
+ }, se = "_checkbox_1npj4_1", le = "_input_1npj4_8", oe = "_indicator_1npj4_18", ae = "_label_1npj4_37", ie = "_disabled_1npj4_46", $ = {
43
+ checkbox: se,
44
+ input: le,
45
+ indicator: oe,
46
+ label: ae,
47
+ disabled: ie
48
+ }, ce = (e) => e.level === "error", q = (e) => {
49
+ if (e.length)
50
+ return e.map((t) => t.id).join(" ");
51
+ }, m = () => {
52
+ }, h = (e) => () => e, F = () => () => {
53
+ }, de = {
54
+ fieldId: void 0,
55
+ error: h(!1),
56
+ ariaDescribedBy: h(void 0),
57
+ ariaErrorMessage: h(void 0),
58
+ setMessage: m
59
+ }, R = S(de, {}), B = () => w(R), ue = (e) => {
60
+ const t = p(), [n, r] = P([]), s = k(() => e.error), l = k(() => q(n())), b = k(() => q(n().filter(ce))), f = (o) => {
61
+ r((a) => [...a, o]);
62
+ };
63
+ return x(R.Provider, {
64
+ value: {
65
+ fieldId: t,
66
+ error: s,
67
+ setMessage: f,
68
+ ariaDescribedBy: l,
69
+ ariaErrorMessage: b
70
+ },
71
+ get children() {
72
+ return e.children;
73
+ }
74
+ });
359
75
  };
360
- var Ne = /* @__PURE__ */ h("<span><input><span>"), Be = /* @__PURE__ */ h("<label>");
361
- const at = (n) => {
362
- const [e, t] = A(n, ["label", "error", "class"]), s = B();
76
+ var _e = /* @__PURE__ */ i("<span><input><span>"), ge = /* @__PURE__ */ i("<label>");
77
+ const Ge = (e) => {
78
+ const [t, n] = g(e, ["label", "error", "class"]), r = B(), s = p();
363
79
  return (() => {
364
- var i = Ne(), l = i.firstChild, c = l.nextSibling;
365
- return b(l, g(t, {
80
+ var l = _e(), b = l.firstChild, f = b.nextSibling;
81
+ return u(b, c(n, {
366
82
  id: s,
367
83
  type: "checkbox",
368
84
  get class() {
369
- return E.input;
85
+ return $.input;
86
+ },
87
+ get "aria-describedby"() {
88
+ return r.ariaDescribedBy();
370
89
  },
371
90
  get "aria-invalid"() {
372
- return !!e.error;
91
+ return r.error() || !!t.error;
92
+ },
93
+ get "aria-errormessage"() {
94
+ return r.ariaErrorMessage();
373
95
  }
374
- }), !1, !1), y(i, (() => {
375
- var o = q(() => !!e.label);
96
+ }), !1, !1), d(l, (() => {
97
+ var o = E(() => !!t.label);
376
98
  return () => o() && (() => {
377
- var r = Be();
378
- return S(r, "for", s), y(r, () => e.label), $(() => P(r, E.label)), r;
99
+ var a = ge();
100
+ return N(a, "for", s), d(a, () => t.label), O(() => M(a, $.label)), a;
379
101
  })();
380
- })(), null), $((o) => {
381
- var r = _(E.checkbox, e.class, t.disabled && E.disabled), a = E.indicator;
382
- return r !== o.e && P(i, o.e = r), a !== o.t && P(c, o.t = a), o;
102
+ })(), null), O((o) => {
103
+ var a = _($.checkbox, t.class, n.disabled && $.disabled), C = $.indicator;
104
+ return a !== o.e && M(l, o.e = a), C !== o.t && M(f, o.t = C), o;
383
105
  }, {
384
106
  e: void 0,
385
107
  t: void 0
386
- }), i;
108
+ }), l;
387
109
  })();
388
- }, Ie = (n) => n.level === "error", Y = (n) => {
389
- if (n.length)
390
- return n.map((e) => e.id).join(" ");
391
- }, D = () => {
392
- }, L = (n) => () => n, J = () => () => {
393
- }, Me = {
394
- fieldId: "",
395
- error: L(!1),
396
- ariaDescribedBy: L(void 0),
397
- ariaErrorMessage: L(void 0),
398
- setMessage: D
399
- }, p = Q(Me, {}), v = () => W(p), je = (n) => {
400
- const e = B(), [t, s] = F([]), i = w(() => n.error), l = w(() => Y(t())), c = w(() => Y(t().filter(Ie))), o = (r) => {
401
- s((a) => [...a, r]);
402
- };
403
- return I(p.Provider, {
404
- value: {
405
- fieldId: e,
406
- error: i,
407
- setMessage: o,
408
- ariaDescribedBy: l,
409
- ariaErrorMessage: c
410
- },
411
- get children() {
412
- return n.children;
413
- }
414
- });
415
- }, Pe = "_input_1nlce_1", Se = {
416
- input: Pe
110
+ }, be = "_input_vvaje_1", ve = {
111
+ input: be
417
112
  };
418
- var Oe = /* @__PURE__ */ h("<input>");
419
- const ft = (n) => {
420
- const [e, t] = A(n, ["error", "class"]), s = v();
113
+ var fe = /* @__PURE__ */ i("<input>");
114
+ const Je = (e) => {
115
+ const [t, n] = g(e, ["error", "class"]), r = B();
421
116
  return (() => {
422
- var i = Oe();
423
- return b(i, g(t, {
117
+ var s = fe();
118
+ return u(s, c(n, {
424
119
  get class() {
425
- return _(Se.input, e.class);
120
+ return _(ve.input, t.class);
426
121
  },
427
122
  get id() {
428
- return s.fieldId;
123
+ return r.fieldId;
429
124
  },
430
125
  get "aria-describedby"() {
431
- return s.ariaDescribedBy();
126
+ return r.ariaDescribedBy();
432
127
  },
433
128
  get "aria-invalid"() {
434
- return s.error() || !!e.error;
129
+ return r.error() || !!t.error;
435
130
  },
436
131
  get "aria-errormessage"() {
437
- return s.ariaErrorMessage();
132
+ return r.ariaErrorMessage();
438
133
  }
439
- }), !1, !1), i;
134
+ }), !1, !1), s;
440
135
  })();
441
- }, ke = {
136
+ }, $e = {
442
137
  setDialogRef() {
443
138
  },
444
- ariaLabelledBy: L(void 0),
445
- ariaDescribedBy: L(void 0),
446
- setTitleId: J(),
447
- setDescriptionId: J(),
448
- openDialog: D,
449
- closeDialog: D,
450
- onOpenChange: D,
451
- onBeforeClose: D
452
- }, ee = Q(ke), j = () => W(ee), Ve = (n) => {
453
- let e;
454
- const t = (f) => {
455
- e = f;
456
- }, [s, i] = F(), [l, c] = F(), o = w(() => n.isOpen), r = () => {
457
- var f;
458
- e == null || e.showModal(), (f = n.onOpenChange) == null || f.call(n, !0);
139
+ ariaLabelledBy: h(void 0),
140
+ ariaDescribedBy: h(void 0),
141
+ setTitleId: F(),
142
+ setDescriptionId: F(),
143
+ openDialog: m,
144
+ closeDialog: m,
145
+ onOpenChange: m,
146
+ onBeforeClose: m
147
+ }, H = S($e), y = () => w(H), me = (e) => {
148
+ let t;
149
+ const n = (C) => {
150
+ t = C;
151
+ }, [r, s] = P(), [l, b] = P(), f = k(() => e.isOpen), o = () => {
152
+ t?.showModal(), e.onOpenChange?.(!0);
459
153
  }, a = () => {
460
- e == null || e.requestClose();
154
+ t?.requestClose();
461
155
  };
462
- return U(() => {
463
- o() ? r() : a();
464
- }), I(ee.Provider, {
156
+ return L(() => {
157
+ f() ? o() : a();
158
+ }), x(H.Provider, {
465
159
  get value() {
466
160
  return {
467
- ariaLabelledBy: s,
161
+ ariaLabelledBy: r,
468
162
  ariaDescribedBy: l,
469
- setDialogRef: t,
470
- setTitleId: i,
471
- setDescriptionId: c,
472
- openDialog: r,
163
+ setDialogRef: n,
164
+ setTitleId: s,
165
+ setDescriptionId: b,
166
+ openDialog: o,
473
167
  closeDialog: a,
474
- onOpenChange: n.onOpenChange,
475
- onBeforeClose: n.onBeforeClose
168
+ onOpenChange: e.onOpenChange,
169
+ onBeforeClose: e.onBeforeClose
476
170
  };
477
171
  },
478
172
  get children() {
479
- return n.children;
173
+ return e.children;
480
174
  }
481
175
  });
482
- }, Fe = "_dialog_1klsa_1", He = "_title_1klsa_16", Ue = "_description_1klsa_26", qe = "_actions_1klsa_37", k = {
483
- dialog: Fe,
484
- title: He,
485
- description: Ue,
486
- actions: qe
176
+ }, he = "_dialog_1klsa_1", xe = "_title_1klsa_16", pe = "_description_1klsa_26", ye = "_actions_1klsa_37", I = {
177
+ dialog: he,
178
+ title: xe,
179
+ description: pe,
180
+ actions: ye
487
181
  };
488
- var ve = /* @__PURE__ */ h("<dialog>"), Ge = /* @__PURE__ */ h("<h2>"), Ke = /* @__PURE__ */ h("<p>"), Re = /* @__PURE__ */ h("<div>");
489
- const T = (n) => I(Ve, g(n, {
182
+ var Ce = /* @__PURE__ */ i("<dialog>"), De = /* @__PURE__ */ i("<h2>"), ke = /* @__PURE__ */ i("<p>"), je = /* @__PURE__ */ i("<div>");
183
+ const v = (e) => x(me, c(e, {
490
184
  get children() {
491
- return n.children;
185
+ return e.children;
492
186
  }
493
- })), Xe = (n) => {
494
- const e = j(), t = Z(() => n.children);
495
- return U(() => {
496
- const s = t();
497
- s instanceof HTMLElement && (s.onclick = e.openDialog);
498
- }), q(t);
499
- }, Ye = (n) => {
500
- const e = j();
187
+ })), Be = (e) => {
188
+ const t = y(), n = A(() => e.children);
189
+ return L(() => {
190
+ const r = n();
191
+ r instanceof HTMLElement && (r.onclick = t.openDialog);
192
+ }), E(n);
193
+ }, Ie = (e) => {
194
+ const t = y();
501
195
  return (() => {
502
- var t = ve();
503
- return z((s) => {
504
- n.ref = s, e.setDialogRef(s);
505
- }, t), b(t, g(n, {
196
+ var n = Ce();
197
+ return U((r) => {
198
+ e.ref = r, t.setDialogRef(r);
199
+ }, n), u(n, c(e, {
506
200
  get class() {
507
- return _(k.dialog, n.class);
201
+ return _(I.dialog, e.class);
508
202
  },
509
203
  get "aria-labelledby"() {
510
- return e.ariaLabelledBy();
204
+ return t.ariaLabelledBy();
511
205
  },
512
206
  get "aria-describedby"() {
513
- return e.ariaDescribedBy();
514
- },
515
- onClose: () => {
516
- var s;
517
- return (s = e.onOpenChange) == null ? void 0 : s.call(e, !1);
207
+ return t.ariaDescribedBy();
518
208
  },
209
+ onClose: () => t.onOpenChange?.(!1),
519
210
  get onCancel() {
520
- return e.onBeforeClose;
211
+ return t.onBeforeClose;
521
212
  }
522
- }), !1, !0), y(t, () => n.children), t;
213
+ }), !1, !0), d(n, () => e.children), n;
523
214
  })();
524
- }, Je = (n) => {
525
- const e = j(), t = B();
526
- return e.setTitleId(t), (() => {
527
- var s = Ge();
528
- return b(s, g(n, {
529
- id: t,
215
+ }, Me = (e) => {
216
+ const t = y(), n = p();
217
+ return t.setTitleId(n), (() => {
218
+ var r = De();
219
+ return u(r, c(e, {
220
+ id: n,
530
221
  get class() {
531
- return _(k.title, n.class);
222
+ return _(I.title, e.class);
532
223
  }
533
- }), !1, !0), y(s, () => n.children), s;
224
+ }), !1, !0), d(r, () => e.children), r;
534
225
  })();
535
- }, Qe = (n) => {
536
- const e = j(), t = B();
537
- return e.setDescriptionId(t), (() => {
538
- var s = Ke();
539
- return b(s, g(n, {
540
- id: t,
226
+ }, Te = (e) => {
227
+ const t = y(), n = p();
228
+ return t.setDescriptionId(n), (() => {
229
+ var r = ke();
230
+ return u(r, c(e, {
231
+ id: n,
541
232
  get class() {
542
- return _(k.description, n.class);
233
+ return _(I.description, e.class);
543
234
  }
544
- }), !1, !0), y(s, () => n.children), s;
235
+ }), !1, !0), d(r, () => e.children), r;
545
236
  })();
546
- }, We = (n) => {
547
- const e = j(), t = Z(() => n.children);
548
- return U(() => {
549
- const s = t();
550
- s instanceof HTMLElement && (s.onclick = e.closeDialog);
551
- }), q(t);
552
- }, Ze = (n) => (() => {
553
- var e = Re();
554
- return b(e, g(n, {
237
+ }, Pe = (e) => {
238
+ const t = y(), n = A(() => e.children);
239
+ return L(() => {
240
+ const r = n();
241
+ r instanceof HTMLElement && (r.onclick = t.closeDialog);
242
+ }), E(n);
243
+ }, Ee = (e) => (() => {
244
+ var t = je();
245
+ return u(t, c(e, {
555
246
  get class() {
556
- return _(k.actions, n.class);
247
+ return _(I.actions, e.class);
557
248
  }
558
- }), !1, !0), y(e, () => n.children), e;
249
+ }), !1, !0), d(t, () => e.children), t;
559
250
  })();
560
- T.Trigger = Xe;
561
- T.Content = Ye;
562
- T.Title = Je;
563
- T.Description = Qe;
564
- T.Close = We;
565
- T.Actions = Ze;
566
- const ze = "_field_1ijme_1", pe = "_label_1ijme_7", et = "_message_1ijme_19", tt = "_error_1ijme_31", O = {
567
- field: ze,
568
- label: pe,
569
- message: et,
570
- error: tt
251
+ v.Trigger = Be;
252
+ v.Content = Ie;
253
+ v.Title = Me;
254
+ v.Description = Te;
255
+ v.Close = Pe;
256
+ v.Actions = Ee;
257
+ const Le = "_field_1ijme_1", Oe = "_label_1ijme_7", qe = "_message_1ijme_19", Fe = "_error_1ijme_31", j = {
258
+ field: Le,
259
+ label: Oe,
260
+ message: qe,
261
+ error: Fe
571
262
  };
572
- var nt = /* @__PURE__ */ h("<div>"), st = /* @__PURE__ */ h("<label>"), it = /* @__PURE__ */ h("<p>");
573
- const te = (n) => {
574
- const [e, t] = A(n, ["class", "error"]);
575
- return I(je, {
263
+ var Se = /* @__PURE__ */ i("<div>"), we = /* @__PURE__ */ i("<label>"), Ae = /* @__PURE__ */ i("<p>");
264
+ const V = (e) => {
265
+ const [t, n] = g(e, ["class", "error"]);
266
+ return x(ue, {
576
267
  get error() {
577
- return !!e.error;
268
+ return !!t.error;
578
269
  },
579
270
  get children() {
580
- var s = nt();
581
- return b(s, g(t, {
271
+ var r = Se();
272
+ return u(r, c(n, {
582
273
  get class() {
583
- return _(O.field, e.class);
274
+ return _(j.field, t.class);
584
275
  }
585
- }), !1, !0), y(s, () => n.children), s;
276
+ }), !1, !0), d(r, () => e.children), r;
586
277
  }
587
278
  });
588
- }, ot = (n) => {
589
- const [e, t] = A(n, ["class"]), s = v();
279
+ }, Re = (e) => {
280
+ const [t, n] = g(e, ["class"]), r = B();
590
281
  return (() => {
591
- var i = st();
592
- return b(i, g(t, {
282
+ var s = we();
283
+ return u(s, c(n, {
593
284
  get for() {
594
- return s.fieldId;
285
+ return r.fieldId;
595
286
  },
596
287
  get class() {
597
- return _(O.label, e.class);
288
+ return _(j.label, t.class);
598
289
  }
599
- }), !1, !0), y(i, () => t.children), i;
290
+ }), !1, !0), d(s, () => n.children), s;
600
291
  })();
601
- }, lt = (n) => {
602
- const [e, t] = A(n, ["class", "level"]), s = v(), i = B();
603
- return s.setMessage({
604
- level: e.level || "info",
605
- id: i
606
- }), I(se, {
292
+ }, He = (e) => {
293
+ const [t, n] = g(e, ["class", "level"]), r = B(), s = p();
294
+ return r.setMessage({
295
+ level: t.level || "info",
296
+ id: s
297
+ }), x(G, {
607
298
  get when() {
608
- return t.children;
299
+ return n.children;
609
300
  },
610
301
  get children() {
611
- var l = it();
612
- return b(l, g(t, {
613
- id: i,
302
+ var l = Ae();
303
+ return u(l, c(n, {
304
+ id: s,
614
305
  get class() {
615
- return _(O.message, e.class, e.level === "error" && O.error);
306
+ return _(j.message, t.class, t.level === "error" && j.error);
616
307
  }
617
- }), !1, !0), y(l, () => t.children), l;
308
+ }), !1, !0), d(l, () => n.children), l;
618
309
  }
619
310
  });
620
311
  };
621
- te.Label = ot;
622
- te.Message = lt;
312
+ V.Label = Re;
313
+ V.Message = He;
623
314
  export {
624
- ct as Button,
625
- at as Checkbox,
626
- T as Dialog,
627
- te as Field,
628
- ft as TextInput
315
+ Ue as Button,
316
+ Ge as Checkbox,
317
+ v as Dialog,
318
+ V as Field,
319
+ ze as Link,
320
+ Je as TextInput,
321
+ T as buttonSx,
322
+ _ as cls
629
323
  };
324
+ //# sourceMappingURL=main.js.map