solid-uix 0.3.1 → 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 (41) hide show
  1. package/README.md +22 -2
  2. package/dist/main.css +1 -1
  3. package/dist/main.js +271 -446
  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/{button → types/button}/button.types.d.ts +3 -1
  9. package/dist/types/dialog/dialog.d.ts +11 -0
  10. package/dist/types/dialog/dialog.types.d.ts +17 -0
  11. package/dist/types/dialog/provider/context.d.ts +3 -0
  12. package/dist/types/dialog/provider/context.types.d.ts +14 -0
  13. package/dist/types/dialog/provider/provider.d.ts +2 -0
  14. package/dist/types/dialog/provider/provider.types.d.ts +7 -0
  15. package/dist/{field → types/field}/field.types.d.ts +1 -1
  16. package/dist/types/link/link.d.ts +2 -0
  17. package/dist/types/link/link.stories.d.ts +48 -0
  18. package/dist/types/link/link.types.d.ts +6 -0
  19. package/dist/types/main.d.ts +13 -0
  20. package/dist/types/select/select.d.ts +5 -0
  21. package/dist/types/select/select.types.d.ts +5 -0
  22. package/dist/types/text_area/text_area.d.ts +2 -0
  23. package/dist/types/text_area/text_area.stories.d.ts +38 -0
  24. package/dist/types/text_area/text_area.types.d.ts +4 -0
  25. package/dist/types/text_input/text_input.stories.d.ts +30 -0
  26. package/dist/{utils → types/utils}/noop.d.ts +2 -1
  27. package/package.json +10 -9
  28. package/dist/main.d.ts +0 -4
  29. package/dist/main.umd.cjs +0 -1
  30. /package/dist/{checkbox → types/checkbox}/checkbox.d.ts +0 -0
  31. /package/dist/{checkbox → types/checkbox}/checkbox.stories.d.ts +0 -0
  32. /package/dist/{checkbox → types/checkbox}/checkbox.types.d.ts +0 -0
  33. /package/dist/{field → types/field}/field.context.d.ts +0 -0
  34. /package/dist/{field → types/field}/field.d.ts +0 -0
  35. /package/dist/{list → types/list}/list.d.ts +0 -0
  36. /package/dist/{list → types/list}/list.types.d.ts +0 -0
  37. /package/dist/{text_input → types/text_input}/text_input.d.ts +0 -0
  38. /package/dist/{text_input → types/text_input}/text_input.types.d.ts +0 -0
  39. /package/dist/{utils → types/utils}/cls.d.ts +0 -0
  40. /package/dist/{utils → types/utils}/message.d.ts +0 -0
  41. /package/dist/{utils → types/utils}/string.d.ts +0 -0
package/dist/main.js CHANGED
@@ -1,499 +1,324 @@
1
- import { createMemo as N, createRenderEffect as h, untrack as K, sharedConfig as g, mergeProps as $, createContext as R, useContext as X, createUniqueId as B, createSignal as Y, createComponent as O, splitProps as E, Show as p } from "solid-js";
2
- const J = ["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"], Q = /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...J]), W = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]), Z = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
3
- className: "class",
4
- htmlFor: "for"
5
- }), z = /* @__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 v(s, e) {
35
- const t = z[s];
36
- return typeof t == "object" ? t[e] ? t.$ : void 0 : t;
37
- }
38
- const ee = /* @__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"]), te = (s) => N(() => s());
39
- function se(s, e, t) {
40
- let n = t.length, i = e.length, l = n, c = 0, o = 0, r = e[i - 1].nextSibling, f = 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 a = l < n ? o ? t[o - 1].nextSibling : t[l - o] : r;
50
- for (; o < l; ) s.insertBefore(t[o++], a);
51
- } else if (l === o)
52
- for (; c < i; )
53
- (!f || !f.has(e[c])) && e[c].remove(), c++;
54
- else if (e[c] === t[l - 1] && t[o] === e[i - 1]) {
55
- const a = e[--i].nextSibling;
56
- s.insertBefore(t[o++], e[c++].nextSibling), s.insertBefore(t[--l], a), e[i] = t[l];
57
- } else {
58
- if (!f) {
59
- f = /* @__PURE__ */ new Map();
60
- let u = o;
61
- for (; u < l; ) f.set(t[u], u++);
62
- }
63
- const a = f.get(e[c]);
64
- if (a != null)
65
- if (o < a && a < l) {
66
- let u = c, d = 1, y;
67
- for (; ++u < i && u < l && !((y = f.get(e[u])) == null || y !== a + d); )
68
- d++;
69
- if (d > a - o) {
70
- const P = e[c];
71
- for (; o < a; ) s.insertBefore(t[o++], P);
72
- } else s.replaceChild(t[o++], e[c++]);
73
- } else c++;
74
- else e[c++].remove();
75
- }
76
- }
77
- }
78
- const D = "_$DX_DELEGATE";
79
- function b(s, e, t, n) {
80
- let i;
81
- const l = () => {
82
- const o = document.createElement("template");
83
- return o.innerHTML = s, o.content.firstChild;
84
- }, c = () => (i || (i = l())).cloneNode(!0);
85
- return c.cloneNode = c, c;
86
- }
87
- function ne(s, e = window.document) {
88
- const t = e[D] || (e[D] = /* @__PURE__ */ new Set());
89
- for (let n = 0, i = s.length; n < i; n++) {
90
- const l = s[n];
91
- t.has(l) || (t.add(l), e.addEventListener(l, de));
92
- }
93
- }
94
- function M(s, e, t) {
95
- w(s) || (t == null ? s.removeAttribute(e) : s.setAttribute(e, t));
96
- }
97
- function ie(s, e, t) {
98
- w(s) || (t ? s.setAttribute(e, "") : s.removeAttribute(e));
99
- }
100
- function L(s, e) {
101
- w(s) || (e == null ? s.removeAttribute("class") : s.className = e);
102
- }
103
- function oe(s, e, t, n) {
104
- if (n)
105
- Array.isArray(t) ? (s[`$$${e}`] = t[0], s[`$$${e}Data`] = t[1]) : s[`$$${e}`] = t;
106
- else if (Array.isArray(t)) {
107
- const i = t[0];
108
- s.addEventListener(e, t[0] = (l) => i.call(s, t[1], l));
109
- } else s.addEventListener(e, t, typeof t != "function" && t);
110
- }
111
- function le(s, e, t = {}) {
112
- const n = 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] || (F(s, o, !1), delete t[o]);
117
- }
118
- for (l = 0, c = n.length; l < c; l++) {
119
- const o = n[l], r = !!e[o];
120
- !o || o === "undefined" || t[o] === r || !r || (F(s, o, !0), t[o] = r);
121
- }
122
- return t;
123
- }
124
- function re(s, e, t) {
125
- if (!e) return t ? M(s, "style") : e;
126
- const n = s.style;
127
- if (typeof e == "string") return n.cssText = e;
128
- typeof t == "string" && (n.cssText = t = void 0), t || (t = {}), e || (e = {});
129
- let i, l;
130
- for (l in t)
131
- e[l] == null && n.removeProperty(l), delete t[l];
132
- for (l in e)
133
- i = e[l], i !== t[l] && (n.setProperty(l, i), t[l] = i);
134
- return t;
135
- }
136
- function x(s, e = {}, t, n) {
137
- const i = {};
138
- return n || h(() => i.children = C(s, e.children, i.children)), h(() => typeof e.ref == "function" && ce(e.ref, s)), h(() => fe(s, e, t, !0, i, !0)), i;
139
- }
140
- function ce(s, e, t) {
141
- return K(() => s(e, t));
142
- }
143
- function _(s, e, t, n) {
144
- if (t !== void 0 && !n && (n = []), typeof e != "function") return C(s, e, n, t);
145
- h((i) => C(s, e(), i, t), n);
146
- }
147
- function fe(s, e, t, n, 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] = V(s, 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] = V(s, c, o, i[c], t, l, e);
159
- }
160
- }
161
- function w(s) {
162
- return !!g.context && !g.done && (!s || s.isConnected);
163
- }
164
- function ae(s) {
165
- return s.toLowerCase().replace(/-([a-z])/g, (e, t) => t.toUpperCase());
166
- }
167
- function F(s, e, t) {
168
- const n = e.trim().split(/\s+/);
169
- for (let i = 0, l = n.length; i < l; i++) s.classList.toggle(n[i], t);
170
- }
171
- function V(s, e, t, n, i, l, c) {
172
- let o, r, f, a, u;
173
- if (e === "style") return re(s, t, n);
174
- if (e === "classList") return le(s, t, n);
175
- if (t === n) return n;
176
- if (e === "ref")
177
- l || t(s);
178
- else if (e.slice(0, 3) === "on:") {
179
- const d = e.slice(3);
180
- n && s.removeEventListener(d, n, typeof n != "function" && n), t && s.addEventListener(d, t, typeof t != "function" && t);
181
- } else if (e.slice(0, 10) === "oncapture:") {
182
- const d = e.slice(10);
183
- n && s.removeEventListener(d, n, !0), t && s.addEventListener(d, t, !0);
184
- } else if (e.slice(0, 2) === "on") {
185
- const d = e.slice(2).toLowerCase(), y = ee.has(d);
186
- if (!y && n) {
187
- const P = Array.isArray(n) ? n[0] : n;
188
- s.removeEventListener(d, P);
189
- }
190
- (y || t) && (oe(s, d, t, y), y && ne([d]));
191
- } else if (e.slice(0, 5) === "attr:")
192
- M(s, e.slice(5), t);
193
- else if (e.slice(0, 5) === "bool:")
194
- ie(s, e.slice(5), t);
195
- else if ((u = e.slice(0, 5) === "prop:") || (f = W.has(e)) || (a = v(e, s.tagName)) || (r = Q.has(e)) || (o = s.nodeName.includes("-") || "is" in c)) {
196
- if (u)
197
- e = e.slice(5), r = !0;
198
- else if (w(s)) return t;
199
- e === "class" || e === "className" ? L(s, t) : o && !r && !f ? s[ae(e)] = t : s[a || e] = t;
200
- } else
201
- M(s, Z[e] || e, t);
202
- return t;
203
- }
204
- function de(s) {
205
- if (g.registry && g.events && g.events.find(([r, f]) => f === s))
206
- return;
207
- let e = s.target;
208
- const t = `$$${s.type}`, n = s.target, i = s.currentTarget, l = (r) => Object.defineProperty(s, "target", {
209
- configurable: !0,
210
- value: r
211
- }), c = () => {
212
- const r = e[t];
213
- if (r && !e.disabled) {
214
- const f = e[`${t}Data`];
215
- if (f !== void 0 ? r.call(e, f, s) : r.call(e, s), s.cancelBubble) return;
216
- }
217
- return e.host && typeof e.host != "string" && !e.host._$host && e.contains(s.target) && l(e.host), !0;
218
- }, o = () => {
219
- for (; c() && (e = e._$host || e.parentNode || e.host); ) ;
220
- };
221
- if (Object.defineProperty(s, "currentTarget", {
222
- configurable: !0,
223
- get() {
224
- return e || document;
225
- }
226
- }), g.registry && !g.done && (g.done = _$HY.done = !0), s.composedPath) {
227
- const r = s.composedPath();
228
- l(r[0]);
229
- for (let f = 0; f < r.length - 2 && (e = r[f], !!c()); f++) {
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(n);
239
- }
240
- function C(s, e, t, n, i) {
241
- const l = w(s);
242
- if (l) {
243
- !t && (t = [...s.childNodes]);
244
- let r = [];
245
- for (let f = 0; f < t.length; f++) {
246
- const a = t[f];
247
- a.nodeType === 8 && a.data.slice(0, 2) === "!$" ? a.remove() : r.push(a);
248
- }
249
- t = r;
250
- }
251
- for (; typeof t == "function"; ) t = t();
252
- if (e === t) return t;
253
- const c = typeof e, o = n !== void 0;
254
- if (s = o && t[0] && t[0].parentNode || s, 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 = m(s, t, n, r);
260
- } else
261
- t !== "" && typeof t == "string" ? t = s.firstChild.data = e : t = s.textContent = e;
262
- } else if (e == null || c === "boolean") {
263
- if (l) return t;
264
- t = m(s, t, n);
265
- } else {
266
- if (c === "function")
267
- return h(() => {
268
- let r = e();
269
- for (; typeof r == "function"; ) r = r();
270
- t = C(s, r, t, n);
271
- }), () => t;
272
- if (Array.isArray(e)) {
273
- const r = [], f = t && Array.isArray(t);
274
- if (I(r, e, t, i))
275
- return h(() => t = C(s, r, t, n, !0)), () => t;
276
- if (l) {
277
- if (!r.length) return t;
278
- if (n === void 0) return t = [...s.childNodes];
279
- let a = r[0];
280
- if (a.parentNode !== s) return t;
281
- const u = [a];
282
- for (; (a = a.nextSibling) !== n; ) u.push(a);
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 = m(s, t, n), o) return t;
287
- } else f ? t.length === 0 ? U(s, r, n) : se(s, t, r) : (t && m(s), U(s, 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 = m(s, t, n, e);
293
- m(s, t, null, e);
294
- } else t == null || t === "" || !s.firstChild ? s.appendChild(e) : s.replaceChild(e, s.firstChild);
295
- t = e;
296
- }
297
- }
298
- return t;
299
- }
300
- function I(s, e, t, n) {
301
- let i = !1;
302
- for (let l = 0, c = e.length; l < c; l++) {
303
- let o = e[l], r = t && t[s.length], f;
304
- if (!(o == null || o === !0 || o === !1)) if ((f = typeof o) == "object" && o.nodeType)
305
- s.push(o);
306
- else if (Array.isArray(o))
307
- i = I(s, o, r) || i;
308
- else if (f === "function")
309
- if (n) {
310
- for (; typeof o == "function"; ) o = o();
311
- i = I(s, Array.isArray(o) ? o : [o], Array.isArray(r) ? r : [r]) || i;
312
- } else
313
- s.push(o), i = !0;
314
- else {
315
- const a = String(o);
316
- r && r.nodeType === 3 && r.data === a ? s.push(r) : s.push(document.createTextNode(a));
317
- }
318
- }
319
- return i;
320
- }
321
- function U(s, e, t = null) {
322
- for (let n = 0, i = e.length; n < i; n++) s.insertBefore(e[n], t);
323
- }
324
- function m(s, e, t, n) {
325
- if (t === void 0) return s.textContent = "";
326
- const i = n || 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 === s;
333
- !l && !c ? r ? s.replaceChild(i, o) : s.insertBefore(i, t) : r && o.remove();
334
- } else l = !0;
335
- }
336
- } else s.insertBefore(i, t);
337
- return [i];
338
- }
339
- const ue = "_button_1xfap_1", ge = {
340
- button: ue
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
341
27
  };
342
- var he = /* @__PURE__ */ b("<button type=button>");
343
- const Ue = (s) => (() => {
344
- var e = he();
345
- return x(e, $(s, {
346
- get class() {
347
- return ge.button;
348
- }
349
- }), !1, !0), _(e, () => s.children), e;
350
- })(), T = (...s) => s.filter(Boolean).join(" "), ye = (s) => s.level === "error", H = (s) => {
351
- if (s.length)
352
- return s.map((e) => e.id).join(" ");
353
- }, be = () => {
354
- }, S = (s) => () => s, me = {
355
- fieldId: "",
356
- error: S(!1),
357
- ariaDescribedBy: S(void 0),
358
- ariaErrorMessage: S(void 0),
359
- setMessage: be
360
- }, q = R(me, {}), k = () => X(q), _e = (s) => {
361
- const e = B(), [t, n] = Y([]), i = N(() => s.error), l = N(() => H(t())), c = N(() => H(t().filter(ye))), o = (r) => {
362
- n((f) => [...f, r]);
28
+ var ne = /* @__PURE__ */ i("<a>");
29
+ const ze = (e) => {
30
+ const [t, n] = g(e, ["class", "disabled", "color", "underline"]);
31
+ return (() => {
32
+ var r = ne();
33
+ return u(r, c(n, {
34
+ get class() {
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;
39
+ }
40
+ }), !1, !0), d(r, () => n.children), r;
41
+ })();
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]);
363
62
  };
364
- return O(q.Provider, {
63
+ return x(R.Provider, {
365
64
  value: {
366
- fieldId: e,
367
- error: i,
368
- setMessage: o,
65
+ fieldId: t,
66
+ error: s,
67
+ setMessage: f,
369
68
  ariaDescribedBy: l,
370
- ariaErrorMessage: c
69
+ ariaErrorMessage: b
371
70
  },
372
71
  get children() {
373
- return s.children;
72
+ return e.children;
374
73
  }
375
74
  });
376
- }, $e = "_input_1nlce_1", xe = {
377
- input: $e
378
75
  };
379
- var Ae = /* @__PURE__ */ b("<input>");
380
- const He = (s) => {
381
- const [e, t] = E(s, ["error", "class"]), n = k();
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();
79
+ return (() => {
80
+ var l = _e(), b = l.firstChild, f = b.nextSibling;
81
+ return u(b, c(n, {
82
+ id: s,
83
+ type: "checkbox",
84
+ get class() {
85
+ return $.input;
86
+ },
87
+ get "aria-describedby"() {
88
+ return r.ariaDescribedBy();
89
+ },
90
+ get "aria-invalid"() {
91
+ return r.error() || !!t.error;
92
+ },
93
+ get "aria-errormessage"() {
94
+ return r.ariaErrorMessage();
95
+ }
96
+ }), !1, !1), d(l, (() => {
97
+ var o = E(() => !!t.label);
98
+ return () => o() && (() => {
99
+ var a = ge();
100
+ return N(a, "for", s), d(a, () => t.label), O(() => M(a, $.label)), a;
101
+ })();
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;
105
+ }, {
106
+ e: void 0,
107
+ t: void 0
108
+ }), l;
109
+ })();
110
+ }, be = "_input_vvaje_1", ve = {
111
+ input: be
112
+ };
113
+ var fe = /* @__PURE__ */ i("<input>");
114
+ const Je = (e) => {
115
+ const [t, n] = g(e, ["error", "class"]), r = B();
382
116
  return (() => {
383
- var i = Ae();
384
- return x(i, $(t, {
117
+ var s = fe();
118
+ return u(s, c(n, {
385
119
  get class() {
386
- return T(xe.input, e.class);
120
+ return _(ve.input, t.class);
387
121
  },
388
122
  get id() {
389
- return n.fieldId;
123
+ return r.fieldId;
390
124
  },
391
125
  get "aria-describedby"() {
392
- return n.ariaDescribedBy();
126
+ return r.ariaDescribedBy();
393
127
  },
394
128
  get "aria-invalid"() {
395
- return n.error() || !!e.error;
129
+ return r.error() || !!t.error;
396
130
  },
397
131
  get "aria-errormessage"() {
398
- return n.ariaErrorMessage();
132
+ return r.ariaErrorMessage();
399
133
  }
400
- }), !1, !1), i;
134
+ }), !1, !1), s;
401
135
  })();
402
- }, Ce = "_checkbox_1npj4_1", Ee = "_input_1npj4_8", we = "_indicator_1npj4_18", Te = "_label_1npj4_37", Ne = "_disabled_1npj4_46", A = {
403
- checkbox: Ce,
404
- input: Ee,
405
- indicator: we,
406
- label: Te,
407
- disabled: Ne
136
+ }, $e = {
137
+ setDialogRef() {
138
+ },
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);
153
+ }, a = () => {
154
+ t?.requestClose();
155
+ };
156
+ return L(() => {
157
+ f() ? o() : a();
158
+ }), x(H.Provider, {
159
+ get value() {
160
+ return {
161
+ ariaLabelledBy: r,
162
+ ariaDescribedBy: l,
163
+ setDialogRef: n,
164
+ setTitleId: s,
165
+ setDescriptionId: b,
166
+ openDialog: o,
167
+ closeDialog: a,
168
+ onOpenChange: e.onOpenChange,
169
+ onBeforeClose: e.onBeforeClose
170
+ };
171
+ },
172
+ get children() {
173
+ return e.children;
174
+ }
175
+ });
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
408
181
  };
409
- var Le = /* @__PURE__ */ b("<span><input><span>"), Me = /* @__PURE__ */ b("<label>");
410
- const qe = (s) => {
411
- const [e, t] = E(s, ["label", "error", "class"]), n = B();
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, {
184
+ get children() {
185
+ return e.children;
186
+ }
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();
412
195
  return (() => {
413
- var i = Le(), l = i.firstChild, c = l.nextSibling;
414
- return x(l, $(t, {
415
- id: n,
416
- type: "checkbox",
196
+ var n = Ce();
197
+ return U((r) => {
198
+ e.ref = r, t.setDialogRef(r);
199
+ }, n), u(n, c(e, {
417
200
  get class() {
418
- return A.input;
201
+ return _(I.dialog, e.class);
419
202
  },
420
- get "aria-invalid"() {
421
- return !!e.error;
203
+ get "aria-labelledby"() {
204
+ return t.ariaLabelledBy();
205
+ },
206
+ get "aria-describedby"() {
207
+ return t.ariaDescribedBy();
208
+ },
209
+ onClose: () => t.onOpenChange?.(!1),
210
+ get onCancel() {
211
+ return t.onBeforeClose;
422
212
  }
423
- }), !1, !1), _(i, (() => {
424
- var o = te(() => !!e.label);
425
- return () => o() && (() => {
426
- var r = Me();
427
- return M(r, "for", n), _(r, () => e.label), h(() => L(r, A.label)), r;
428
- })();
429
- })(), null), h((o) => {
430
- var r = T(A.checkbox, e.class, t.disabled && A.disabled), f = A.indicator;
431
- return r !== o.e && L(i, o.e = r), f !== o.t && L(c, o.t = f), o;
432
- }, {
433
- e: void 0,
434
- t: void 0
435
- }), i;
213
+ }), !1, !0), d(n, () => e.children), n;
436
214
  })();
437
- }, je = "_field_1ijme_1", Pe = "_label_1ijme_7", Se = "_message_1ijme_19", Ie = "_error_1ijme_31", j = {
438
- field: je,
439
- label: Pe,
440
- message: Se,
441
- error: Ie
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,
221
+ get class() {
222
+ return _(I.title, e.class);
223
+ }
224
+ }), !1, !0), d(r, () => e.children), r;
225
+ })();
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,
232
+ get class() {
233
+ return _(I.description, e.class);
234
+ }
235
+ }), !1, !0), d(r, () => e.children), r;
236
+ })();
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, {
246
+ get class() {
247
+ return _(I.actions, e.class);
248
+ }
249
+ }), !1, !0), d(t, () => e.children), t;
250
+ })();
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
442
262
  };
443
- var Be = /* @__PURE__ */ b("<div>"), Oe = /* @__PURE__ */ b("<label>"), ke = /* @__PURE__ */ b("<p>");
444
- const G = (s) => {
445
- const [e, t] = E(s, ["class", "error"]);
446
- return O(_e, {
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, {
447
267
  get error() {
448
- return !!e.error;
268
+ return !!t.error;
449
269
  },
450
270
  get children() {
451
- var n = Be();
452
- return x(n, $(t, {
271
+ var r = Se();
272
+ return u(r, c(n, {
453
273
  get class() {
454
- return T(j.field, e.class);
274
+ return _(j.field, t.class);
455
275
  }
456
- }), !1, !0), _(n, () => s.children), n;
276
+ }), !1, !0), d(r, () => e.children), r;
457
277
  }
458
278
  });
459
- }, De = (s) => {
460
- const [e, t] = E(s, ["class"]), n = k();
279
+ }, Re = (e) => {
280
+ const [t, n] = g(e, ["class"]), r = B();
461
281
  return (() => {
462
- var i = Oe();
463
- return x(i, $(t, {
282
+ var s = we();
283
+ return u(s, c(n, {
464
284
  get for() {
465
- return n.fieldId;
285
+ return r.fieldId;
466
286
  },
467
287
  get class() {
468
- return T(j.label, e.class);
288
+ return _(j.label, t.class);
469
289
  }
470
- }), !1, !0), _(i, () => t.children), i;
290
+ }), !1, !0), d(s, () => n.children), s;
471
291
  })();
472
- }, Fe = (s) => {
473
- const [e, t] = E(s, ["class", "level"]), n = k(), i = B();
474
- return n.setMessage({
475
- level: e.level || "info",
476
- id: i
477
- }), O(p, {
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, {
478
298
  get when() {
479
- return t.children;
299
+ return n.children;
480
300
  },
481
301
  get children() {
482
- var l = ke();
483
- return x(l, $(t, {
484
- id: i,
302
+ var l = Ae();
303
+ return u(l, c(n, {
304
+ id: s,
485
305
  get class() {
486
- return T(j.message, e.class, e.level === "error" && j.error);
306
+ return _(j.message, t.class, t.level === "error" && j.error);
487
307
  }
488
- }), !1, !0), _(l, () => t.children), l;
308
+ }), !1, !0), d(l, () => n.children), l;
489
309
  }
490
310
  });
491
311
  };
492
- G.Label = De;
493
- G.Message = Fe;
312
+ V.Label = Re;
313
+ V.Message = He;
494
314
  export {
495
315
  Ue as Button,
496
- qe as Checkbox,
497
- G as Field,
498
- He as TextInput
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
499
323
  };
324
+ //# sourceMappingURL=main.js.map