solid-uix 0.5.0 → 0.5.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.
Files changed (41) hide show
  1. package/README.md +1 -7
  2. package/dist/main.css +269 -1
  3. package/dist/main.d.ts +79 -0
  4. package/dist/main.js +348 -246
  5. package/dist/main.jsx +386 -0
  6. package/package.json +9 -8
  7. package/dist/main.js.map +0 -1
  8. package/dist/ssr/main.js +0 -395
  9. package/dist/ssr/main.js.map +0 -1
  10. package/dist/types/button/button.d.ts +0 -4
  11. package/dist/types/button/button.types.d.ts +0 -4
  12. package/dist/types/checkbox/checkbox.d.ts +0 -2
  13. package/dist/types/checkbox/checkbox.stories.d.ts +0 -29
  14. package/dist/types/checkbox/checkbox.types.d.ts +0 -5
  15. package/dist/types/dialog/dialog.d.ts +0 -11
  16. package/dist/types/dialog/dialog.types.d.ts +0 -17
  17. package/dist/types/dialog/provider/context.d.ts +0 -3
  18. package/dist/types/dialog/provider/context.types.d.ts +0 -14
  19. package/dist/types/dialog/provider/provider.d.ts +0 -2
  20. package/dist/types/dialog/provider/provider.types.d.ts +0 -7
  21. package/dist/types/field/field.context.d.ts +0 -3
  22. package/dist/types/field/field.d.ts +0 -6
  23. package/dist/types/field/field.types.d.ts +0 -19
  24. package/dist/types/link/link.d.ts +0 -2
  25. package/dist/types/link/link.stories.d.ts +0 -48
  26. package/dist/types/link/link.types.d.ts +0 -6
  27. package/dist/types/list/list.d.ts +0 -5
  28. package/dist/types/list/list.types.d.ts +0 -3
  29. package/dist/types/main.d.ts +0 -13
  30. package/dist/types/select/select.d.ts +0 -5
  31. package/dist/types/select/select.types.d.ts +0 -5
  32. package/dist/types/text_area/text_area.d.ts +0 -2
  33. package/dist/types/text_area/text_area.stories.d.ts +0 -38
  34. package/dist/types/text_area/text_area.types.d.ts +0 -4
  35. package/dist/types/text_input/text_input.d.ts +0 -2
  36. package/dist/types/text_input/text_input.stories.d.ts +0 -30
  37. package/dist/types/text_input/text_input.types.d.ts +0 -4
  38. package/dist/types/utils/cls.d.ts +0 -3
  39. package/dist/types/utils/message.d.ts +0 -7
  40. package/dist/types/utils/noop.d.ts +0 -4
  41. package/dist/types/utils/string.d.ts +0 -1
package/dist/main.js CHANGED
@@ -1,324 +1,426 @@
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
1
+ import { template, spread, mergeProps as mergeProps$1, insert, memo, setAttribute, effect, className, createComponent, use } from 'solid-js/web';
2
+ import { createContext, mergeProps, splitProps, createUniqueId, useContext, createSignal, createMemo, createEffect, children, Show } from 'solid-js';
3
+ import sx from './button.module.css';
4
+ export { default as buttonSx } from './button.module.css';
5
+ import sx2 from './link.module.css';
6
+ import sx3 from './checkbox.module.css';
7
+ import sx4 from './text_input.module.css';
8
+ import sx5 from './dialog.module.css';
9
+ import sx6 from './field.module.css';
10
+
11
+ // src/main.ts
12
+
13
+ // src/utils/cls.ts
14
+ var cls = (...classes) => {
15
+ return classes.filter(Boolean).join(" ");
8
16
  };
9
- var X = /* @__PURE__ */ i("<button type=button>");
10
- const Y = {
17
+ var _tmpl$ = /* @__PURE__ */ template(`<button type=button>`);
18
+ var defaultProps = {
11
19
  variant: "solid"
12
- }, Ue = (e) => {
13
- const t = z(Y, e), [n, r] = g(t, ["class", "variant"]);
20
+ };
21
+ var Button = (props) => {
22
+ const merged = mergeProps(defaultProps, props);
23
+ const [local, rest] = splitProps(merged, ["class", "variant"]);
14
24
  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);
25
+ var _el$ = _tmpl$();
26
+ spread(_el$, mergeProps$1(rest, {
27
+ get ["class"]() {
28
+ return cls(sx.button, local.class, local.variant === "solid" && sx.solid, local.variant === "outlined" && sx.outlined);
19
29
  }
20
- }), !1, !0), d(s, () => r.children), s;
30
+ }), false, true);
31
+ insert(_el$, () => rest.children);
32
+ return _el$;
21
33
  })();
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
34
  };
28
- var ne = /* @__PURE__ */ i("<a>");
29
- const ze = (e) => {
30
- const [t, n] = g(e, ["class", "disabled", "color", "underline"]);
35
+ var _tmpl$2 = /* @__PURE__ */ template(`<a>`);
36
+ var Link = (props) => {
37
+ const [local, rest] = splitProps(props, ["class", "reset", "disabled", "color", "underline"]);
31
38
  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);
39
+ var _el$ = _tmpl$2();
40
+ spread(_el$, mergeProps$1(rest, {
41
+ get ["class"]() {
42
+ return cls(!local.reset && sx2.link, local.class, local.disabled && sx2.disabled, local.color === "secondary" && sx2.secondary, local.underline === "always" && sx2.underline);
36
43
  },
37
- get "aria-disabled"() {
38
- return t.disabled;
44
+ get ["aria-disabled"]() {
45
+ return local.disabled;
39
46
  }
40
- }), !1, !0), d(r, () => n.children), r;
47
+ }), false, true);
48
+ insert(_el$, () => rest.children);
49
+ return _el$;
41
50
  })();
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 = {
51
+ };
52
+
53
+ // src/utils/message.ts
54
+ var isError = (message) => {
55
+ return message.level === "error";
56
+ };
57
+ var getMessageIds = (messages) => {
58
+ if (!messages.length) {
59
+ return void 0;
60
+ }
61
+ return messages.map((message) => message.id).join(" ");
62
+ };
63
+
64
+ // src/utils/noop.ts
65
+ var noop = () => {
66
+ };
67
+ var noopAccessor = (value) => {
68
+ return () => value;
69
+ };
70
+ var noopSetter = () => {
71
+ return () => {
72
+ };
73
+ };
74
+
75
+ // src/field/field.context.tsx
76
+ var defaultValue = {
54
77
  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]);
78
+ error: noopAccessor(false),
79
+ ariaDescribedBy: noopAccessor(void 0),
80
+ ariaErrorMessage: noopAccessor(void 0),
81
+ setMessage: noop
82
+ };
83
+ var FieldContext = createContext(defaultValue, {});
84
+ var useFieldContext = () => {
85
+ return useContext(FieldContext);
86
+ };
87
+ var FieldProvider = (props) => {
88
+ const fieldId = createUniqueId();
89
+ const [messages, setMessages] = createSignal([]);
90
+ const error = createMemo(() => {
91
+ return props.error;
92
+ });
93
+ const ariaDescribedBy = createMemo(() => {
94
+ return getMessageIds(messages());
95
+ });
96
+ const ariaErrorMessage = createMemo(() => {
97
+ return getMessageIds(messages().filter(isError));
98
+ });
99
+ const setMessage = (message) => {
100
+ setMessages((prev) => [...prev, message]);
62
101
  };
63
- return x(R.Provider, {
102
+ return createComponent(FieldContext.Provider, {
64
103
  value: {
65
- fieldId: t,
66
- error: s,
67
- setMessage: f,
68
- ariaDescribedBy: l,
69
- ariaErrorMessage: b
104
+ fieldId,
105
+ error,
106
+ setMessage,
107
+ ariaDescribedBy,
108
+ ariaErrorMessage
70
109
  },
71
110
  get children() {
72
- return e.children;
111
+ return props.children;
73
112
  }
74
113
  });
75
114
  };
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();
115
+
116
+ // src/checkbox/checkbox.tsx
117
+ var _tmpl$3 = /* @__PURE__ */ template(`<span><input><span>`);
118
+ var _tmpl$22 = /* @__PURE__ */ template(`<label>`);
119
+ var Checkbox = (props) => {
120
+ const [local, rest] = splitProps(props, ["label", "error", "class"]);
121
+ const context = useFieldContext();
122
+ const id = createUniqueId();
79
123
  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;
124
+ var _el$ = _tmpl$3(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
125
+ spread(_el$2, mergeProps$1(rest, {
126
+ "id": id,
127
+ "type": "checkbox",
128
+ get ["class"]() {
129
+ return sx3.input;
86
130
  },
87
- get "aria-describedby"() {
88
- return r.ariaDescribedBy();
131
+ get ["aria-describedby"]() {
132
+ return context.ariaDescribedBy();
89
133
  },
90
- get "aria-invalid"() {
91
- return r.error() || !!t.error;
134
+ get ["aria-invalid"]() {
135
+ return context.error() || !!local.error;
92
136
  },
93
- get "aria-errormessage"() {
94
- return r.ariaErrorMessage();
137
+ get ["aria-errormessage"]() {
138
+ return context.ariaErrorMessage();
95
139
  }
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;
140
+ }), false, false);
141
+ insert(_el$, (() => {
142
+ var _c$ = memo(() => !!local.label);
143
+ return () => _c$() && (() => {
144
+ var _el$4 = _tmpl$22();
145
+ setAttribute(_el$4, "for", id);
146
+ insert(_el$4, () => local.label);
147
+ effect(() => className(_el$4, sx3.label));
148
+ return _el$4;
101
149
  })();
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;
150
+ })(), null);
151
+ effect((_p$) => {
152
+ var _v$ = cls(sx3.checkbox, local.class, rest.disabled && sx3.disabled), _v$2 = sx3.indicator;
153
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
154
+ _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
155
+ return _p$;
105
156
  }, {
106
157
  e: void 0,
107
158
  t: void 0
108
- }), l;
159
+ });
160
+ return _el$;
109
161
  })();
110
- }, be = "_input_vvaje_1", ve = {
111
- input: be
112
162
  };
113
- var fe = /* @__PURE__ */ i("<input>");
114
- const Je = (e) => {
115
- const [t, n] = g(e, ["error", "class"]), r = B();
163
+ var _tmpl$4 = /* @__PURE__ */ template(`<input>`);
164
+ var TextInput = (props) => {
165
+ const [local, rest] = splitProps(props, ["error", "class"]);
166
+ const context = useFieldContext();
116
167
  return (() => {
117
- var s = fe();
118
- return u(s, c(n, {
119
- get class() {
120
- return _(ve.input, t.class);
168
+ var _el$ = _tmpl$4();
169
+ spread(_el$, mergeProps$1(rest, {
170
+ get ["class"]() {
171
+ return cls(sx4.input, local.class);
121
172
  },
122
173
  get id() {
123
- return r.fieldId;
174
+ return context.fieldId;
124
175
  },
125
- get "aria-describedby"() {
126
- return r.ariaDescribedBy();
176
+ get ["aria-describedby"]() {
177
+ return context.ariaDescribedBy();
127
178
  },
128
- get "aria-invalid"() {
129
- return r.error() || !!t.error;
179
+ get ["aria-invalid"]() {
180
+ return context.error() || !!local.error;
130
181
  },
131
- get "aria-errormessage"() {
132
- return r.ariaErrorMessage();
182
+ get ["aria-errormessage"]() {
183
+ return context.ariaErrorMessage();
133
184
  }
134
- }), !1, !1), s;
185
+ }), false, false);
186
+ return _el$;
135
187
  })();
136
- }, $e = {
188
+ };
189
+ var defaultValue2 = {
137
190
  setDialogRef() {
138
191
  },
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();
192
+ ariaLabelledBy: noopAccessor(void 0),
193
+ ariaDescribedBy: noopAccessor(void 0),
194
+ setTitleId: noopSetter(),
195
+ setDescriptionId: noopSetter(),
196
+ openDialog: noop,
197
+ closeDialog: noop,
198
+ onOpenChange: noop,
199
+ onBeforeClose: noop
200
+ };
201
+ var DialogContext = createContext(defaultValue2);
202
+ var useDialogContext = () => {
203
+ return useContext(DialogContext);
204
+ };
205
+
206
+ // src/dialog/provider/provider.tsx
207
+ var DialogProvider = (props) => {
208
+ let dialogRef;
209
+ const setDialogRef = (element) => {
210
+ dialogRef = element;
155
211
  };
156
- return L(() => {
157
- f() ? o() : a();
158
- }), x(H.Provider, {
212
+ const [ariaLabelledBy, setTitleId] = createSignal();
213
+ const [ariaDescribedBy, setDescriptionId] = createSignal();
214
+ const isOpen = createMemo(() => {
215
+ return props.isOpen;
216
+ });
217
+ const openDialog = () => {
218
+ dialogRef?.showModal();
219
+ props.onOpenChange?.(true);
220
+ };
221
+ const closeDialog = () => {
222
+ dialogRef?.requestClose();
223
+ };
224
+ createEffect(() => {
225
+ if (isOpen()) {
226
+ openDialog();
227
+ } else {
228
+ closeDialog();
229
+ }
230
+ });
231
+ return createComponent(DialogContext.Provider, {
159
232
  get value() {
160
233
  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
234
+ ariaLabelledBy,
235
+ ariaDescribedBy,
236
+ setDialogRef,
237
+ setTitleId,
238
+ setDescriptionId,
239
+ openDialog,
240
+ closeDialog,
241
+ onOpenChange: props.onOpenChange,
242
+ onBeforeClose: props.onBeforeClose
170
243
  };
171
244
  },
172
245
  get children() {
173
- return e.children;
246
+ return props.children;
174
247
  }
175
248
  });
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
181
249
  };
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();
250
+ var _tmpl$5 = /* @__PURE__ */ template(`<dialog>`);
251
+ var _tmpl$23 = /* @__PURE__ */ template(`<h2>`);
252
+ var _tmpl$32 = /* @__PURE__ */ template(`<p>`);
253
+ var _tmpl$42 = /* @__PURE__ */ template(`<div>`);
254
+ var Dialog = (props) => {
255
+ return createComponent(DialogProvider, mergeProps$1(props, {
256
+ get children() {
257
+ return props.children;
258
+ }
259
+ }));
260
+ };
261
+ var Trigger = (props) => {
262
+ const context = useDialogContext();
263
+ const child = children(() => props.children);
264
+ createEffect(() => {
265
+ const element = child();
266
+ if (element instanceof HTMLElement) {
267
+ element.onclick = context.openDialog;
268
+ }
269
+ });
270
+ return memo(child);
271
+ };
272
+ var Content = (props) => {
273
+ const context = useDialogContext();
195
274
  return (() => {
196
- var n = Ce();
197
- return U((r) => {
198
- e.ref = r, t.setDialogRef(r);
199
- }, n), u(n, c(e, {
200
- get class() {
201
- return _(I.dialog, e.class);
275
+ var _el$ = _tmpl$5();
276
+ use((element) => {
277
+ props.ref = element;
278
+ context.setDialogRef(element);
279
+ }, _el$);
280
+ spread(_el$, mergeProps$1(props, {
281
+ get ["class"]() {
282
+ return cls(sx5.dialog, props.class);
202
283
  },
203
- get "aria-labelledby"() {
204
- return t.ariaLabelledBy();
284
+ get ["aria-labelledby"]() {
285
+ return context.ariaLabelledBy();
205
286
  },
206
- get "aria-describedby"() {
207
- return t.ariaDescribedBy();
287
+ get ["aria-describedby"]() {
288
+ return context.ariaDescribedBy();
208
289
  },
209
- onClose: () => t.onOpenChange?.(!1),
290
+ "onClose": () => context.onOpenChange?.(false),
210
291
  get onCancel() {
211
- return t.onBeforeClose;
292
+ return context.onBeforeClose;
212
293
  }
213
- }), !1, !0), d(n, () => e.children), n;
294
+ }), false, true);
295
+ insert(_el$, () => props.children);
296
+ return _el$;
214
297
  })();
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);
298
+ };
299
+ var Title = (props) => {
300
+ const context = useDialogContext();
301
+ const titleId = createUniqueId();
302
+ context.setTitleId(titleId);
303
+ return (() => {
304
+ var _el$2 = _tmpl$23();
305
+ spread(_el$2, mergeProps$1(props, {
306
+ "id": titleId,
307
+ get ["class"]() {
308
+ return cls(sx5.title, props.class);
223
309
  }
224
- }), !1, !0), d(r, () => e.children), r;
310
+ }), false, true);
311
+ insert(_el$2, () => props.children);
312
+ return _el$2;
225
313
  })();
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);
314
+ };
315
+ var Description = (props) => {
316
+ const context = useDialogContext();
317
+ const descriptionId = createUniqueId();
318
+ context.setDescriptionId(descriptionId);
319
+ return (() => {
320
+ var _el$3 = _tmpl$32();
321
+ spread(_el$3, mergeProps$1(props, {
322
+ "id": descriptionId,
323
+ get ["class"]() {
324
+ return cls(sx5.description, props.class);
234
325
  }
235
- }), !1, !0), d(r, () => e.children), r;
326
+ }), false, true);
327
+ insert(_el$3, () => props.children);
328
+ return _el$3;
236
329
  })();
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);
330
+ };
331
+ var Close = (props) => {
332
+ const context = useDialogContext();
333
+ const child = children(() => props.children);
334
+ createEffect(() => {
335
+ const element = child();
336
+ if (element instanceof HTMLElement) {
337
+ element.onclick = context.closeDialog;
248
338
  }
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
339
+ });
340
+ return memo(child);
341
+ };
342
+ var Actions = (props) => {
343
+ return (() => {
344
+ var _el$4 = _tmpl$42();
345
+ spread(_el$4, mergeProps$1(props, {
346
+ get ["class"]() {
347
+ return cls(sx5.actions, props.class);
348
+ }
349
+ }), false, true);
350
+ insert(_el$4, () => props.children);
351
+ return _el$4;
352
+ })();
262
353
  };
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, {
354
+ Dialog.Trigger = Trigger;
355
+ Dialog.Content = Content;
356
+ Dialog.Title = Title;
357
+ Dialog.Description = Description;
358
+ Dialog.Close = Close;
359
+ Dialog.Actions = Actions;
360
+ var _tmpl$6 = /* @__PURE__ */ template(`<div>`);
361
+ var _tmpl$24 = /* @__PURE__ */ template(`<label>`);
362
+ var _tmpl$33 = /* @__PURE__ */ template(`<p>`);
363
+ var Field = (props) => {
364
+ const [local, rest] = splitProps(props, ["class", "error"]);
365
+ return createComponent(FieldProvider, {
267
366
  get error() {
268
- return !!t.error;
367
+ return !!local.error;
269
368
  },
270
369
  get children() {
271
- var r = Se();
272
- return u(r, c(n, {
273
- get class() {
274
- return _(j.field, t.class);
370
+ var _el$ = _tmpl$6();
371
+ spread(_el$, mergeProps$1(rest, {
372
+ get ["class"]() {
373
+ return cls(sx6.field, local.class);
275
374
  }
276
- }), !1, !0), d(r, () => e.children), r;
375
+ }), false, true);
376
+ insert(_el$, () => props.children);
377
+ return _el$;
277
378
  }
278
379
  });
279
- }, Re = (e) => {
280
- const [t, n] = g(e, ["class"]), r = B();
380
+ };
381
+ var FieldLabel = (props) => {
382
+ const [local, rest] = splitProps(props, ["class"]);
383
+ const context = useFieldContext();
281
384
  return (() => {
282
- var s = we();
283
- return u(s, c(n, {
284
- get for() {
285
- return r.fieldId;
385
+ var _el$2 = _tmpl$24();
386
+ spread(_el$2, mergeProps$1(rest, {
387
+ get ["for"]() {
388
+ return context.fieldId;
286
389
  },
287
- get class() {
288
- return _(j.label, t.class);
390
+ get ["class"]() {
391
+ return cls(sx6.label, local.class);
289
392
  }
290
- }), !1, !0), d(s, () => n.children), s;
393
+ }), false, true);
394
+ insert(_el$2, () => rest.children);
395
+ return _el$2;
291
396
  })();
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, {
397
+ };
398
+ var FieldMessage = (props) => {
399
+ const [local, rest] = splitProps(props, ["class", "level"]);
400
+ const context = useFieldContext();
401
+ const messageId = createUniqueId();
402
+ context.setMessage({
403
+ level: local.level || "info",
404
+ id: messageId
405
+ });
406
+ return createComponent(Show, {
298
407
  get when() {
299
- return n.children;
408
+ return rest.children;
300
409
  },
301
410
  get children() {
302
- var l = Ae();
303
- return u(l, c(n, {
304
- id: s,
305
- get class() {
306
- return _(j.message, t.class, t.level === "error" && j.error);
411
+ var _el$3 = _tmpl$33();
412
+ spread(_el$3, mergeProps$1(rest, {
413
+ "id": messageId,
414
+ get ["class"]() {
415
+ return cls(sx6.message, local.class, local.level === "error" && sx6.error);
307
416
  }
308
- }), !1, !0), d(l, () => n.children), l;
417
+ }), false, true);
418
+ insert(_el$3, () => rest.children);
419
+ return _el$3;
309
420
  }
310
421
  });
311
422
  };
312
- V.Label = Re;
313
- V.Message = He;
314
- export {
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
323
- };
324
- //# sourceMappingURL=main.js.map
423
+ Field.Label = FieldLabel;
424
+ Field.Message = FieldMessage;
425
+
426
+ export { Button, Checkbox, Dialog, Field, Link, TextInput, cls };