@versaur/react 1.0.1 → 1.0.3

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/forms.js CHANGED
@@ -1,567 +1,611 @@
1
- import { jsx as n, jsxs as I } from "react/jsx-runtime";
2
- import { labelStyles as ae, helperTextStyles as se, errorTextStyles as de, textInputStyles as $, textAreaStyles as P, selectStyles as H, radioStyles as M, checkboxStyles as T, radioGroupStyles as A, checkboxGroupStyles as j, chipSingleInputStyles as F, chipMultipleInputStyles as L } from "@versaur/core/forms";
3
- import { forwardRef as b, useId as O, createContext as E, useContext as D } from "react";
1
+ import { jsx as o, jsxs as N } from "react/jsx-runtime";
2
+ import { forwardRef as b, useId as S, createContext as T, useContext as L } from "react";
4
3
  import { c as x } from "./cx-B9vmfsc1.js";
5
- import { u as y } from "./use-data-attrs-iPFyfiKN.js";
6
- const k = b(
7
- ({ required: e = !1, disabled: o = !1, children: t, className: s, ...a }, i) => {
8
- const c = y({
9
- disabled: o,
10
- required: e
4
+ import { u as I } from "./use-data-attrs-iPFyfiKN.js";
5
+ import { c as R } from "./checkbox.module-D4Do_b6S.js";
6
+ const at = "_label_16k0w_6", st = {
7
+ label: at
8
+ }, ct = "_helper_m3vrz_6", dt = {
9
+ helper: ct
10
+ }, lt = "_error_9kiiv_6", rt = {
11
+ error: lt
12
+ }, pt = "_field_1hj6p_7", ut = "_wrapper_1hj6p_14", ht = "_input_1hj6p_34", j = {
13
+ field: pt,
14
+ wrapper: ut,
15
+ input: ht,
16
+ "left-icon": "_left-icon_1hj6p_79",
17
+ "right-icon": "_right-icon_1hj6p_80"
18
+ }, _t = "_field_7fkx1_7", ft = "_textarea_7fkx1_14", z = {
19
+ field: _t,
20
+ textarea: ft
21
+ }, mt = "_field_1wbjc_7", vt = "_select_1wbjc_14", F = {
22
+ field: mt,
23
+ select: vt
24
+ }, bt = "_radio_18cvp_7", Ct = "_input_18cvp_36", xt = "_indicator_18cvp_45", Nt = "_label_18cvp_135", M = {
25
+ radio: bt,
26
+ input: Ct,
27
+ indicator: xt,
28
+ label: Nt
29
+ }, It = "_field_1f11i_7", yt = "_options_1f11i_15", gt = "_option_1f11i_15", $t = "_input_1f11i_57", St = "_indicator_1f11i_66", kt = "_optionLabel_1f11i_156", B = {
30
+ field: It,
31
+ options: yt,
32
+ option: gt,
33
+ input: $t,
34
+ indicator: St,
35
+ optionLabel: kt
36
+ }, wt = "_field_1onfr_7", Ot = "_options_1onfr_15", Bt = "_option_1onfr_15", Gt = "_input_1onfr_57", jt = "_indicator_1onfr_66", A = {
37
+ field: wt,
38
+ options: Ot,
39
+ option: Bt,
40
+ input: Gt,
41
+ indicator: jt
42
+ }, At = "_field_17mmo_7", Rt = "_options_17mmo_15", Mt = "_option_17mmo_15", E = {
43
+ field: At,
44
+ options: Rt,
45
+ option: Mt
46
+ }, Tt = "_field_14sz7_7", Lt = "_options_14sz7_15", Et = "_option_14sz7_15", D = {
47
+ field: Tt,
48
+ options: Lt,
49
+ option: Et
50
+ }, $ = b(
51
+ ({ required: t = !1, disabled: n = !1, children: e, className: s, ...a }, i) => {
52
+ const d = I({
53
+ disabled: n,
54
+ required: t
11
55
  });
12
- return /* @__PURE__ */ n("label", { ref: i, className: x(ae.label, s), ...c, ...a, children: t });
56
+ return /* @__PURE__ */ o("label", { ref: i, className: x(st.label, s), ...d, ...a, children: e });
13
57
  }
14
58
  );
15
- k.displayName = "Label";
16
- const B = b(({ children: e, className: o, ...t }, s) => /* @__PURE__ */ n("p", { ref: s, className: x(se.helper, o), ...t, children: e }));
17
- B.displayName = "HelperText";
18
- const G = b(({ children: e, className: o, ...t }, s) => /* @__PURE__ */ n("p", { ref: s, className: x(de.error, o), role: "alert", "aria-live": "polite", ...t, children: e }));
19
- G.displayName = "ErrorText";
20
- const ce = b(
59
+ $.displayName = "Label";
60
+ const k = b(({ children: t, className: n, ...e }, s) => /* @__PURE__ */ o("p", { ref: s, className: x(dt.helper, n), ...e, children: t }));
61
+ k.displayName = "HelperText";
62
+ const w = b(({ children: t, className: n, ...e }, s) => /* @__PURE__ */ o("p", { ref: s, className: x(rt.error, n), role: "alert", "aria-live": "polite", ...e, children: t }));
63
+ w.displayName = "ErrorText";
64
+ const Dt = b(
21
65
  ({
22
- label: e,
23
- helper: o,
24
- error: t,
66
+ label: t,
67
+ helper: n,
68
+ error: e,
25
69
  required: s = !1,
26
70
  disabled: a = !1,
27
71
  readOnly: i = !1,
28
- leftIcon: c,
29
- rightIcon: d,
72
+ leftIcon: d,
73
+ rightIcon: c,
30
74
  id: l,
31
75
  className: r,
32
76
  ...u
33
- }, v) => {
34
- const h = O(), m = l || h, p = o ? `${m}-helper` : void 0, f = t ? `${m}-error` : void 0, C = [p, f].filter(Boolean).join(" "), N = y({
77
+ }, f) => {
78
+ const h = S(), _ = l || h, p = n ? `${_}-helper` : void 0, m = e ? `${_}-error` : void 0, v = [p, m].filter(Boolean).join(" "), C = I({
35
79
  disabled: a,
36
- hasLeftIcon: !!c,
37
- hasRightIcon: !!d,
38
- invalid: !!t,
80
+ hasLeftIcon: !!d,
81
+ hasRightIcon: !!c,
82
+ invalid: !!e,
39
83
  readOnly: i
40
84
  });
41
- return /* @__PURE__ */ I("div", { className: x($.field, r), children: [
42
- e && /* @__PURE__ */ n(k, { htmlFor: m, required: s, disabled: a, children: e }),
43
- /* @__PURE__ */ I("div", { className: $.wrapper, ...N, children: [
44
- c && /* @__PURE__ */ n("span", { className: $["left-icon"], children: c }),
45
- /* @__PURE__ */ n(
85
+ return /* @__PURE__ */ N("div", { className: x(j.field, r), children: [
86
+ t && /* @__PURE__ */ o($, { htmlFor: _, required: s, disabled: a, children: t }),
87
+ /* @__PURE__ */ N("div", { className: j.wrapper, ...C, children: [
88
+ d && /* @__PURE__ */ o("span", { className: j["left-icon"], children: d }),
89
+ /* @__PURE__ */ o(
46
90
  "input",
47
91
  {
48
- ref: v,
49
- id: m,
92
+ ref: f,
93
+ id: _,
50
94
  type: "text",
51
- className: $.input,
95
+ className: j.input,
52
96
  disabled: a,
53
97
  readOnly: i,
54
98
  required: s,
55
- "aria-invalid": t ? "true" : void 0,
99
+ "aria-invalid": e ? "true" : void 0,
56
100
  "aria-disabled": a ? "true" : void 0,
57
- "aria-describedby": C || void 0,
101
+ "aria-describedby": v || void 0,
58
102
  ...u
59
103
  }
60
104
  ),
61
- d && /* @__PURE__ */ n("span", { className: $["right-icon"], children: d })
105
+ c && /* @__PURE__ */ o("span", { className: j["right-icon"], children: c })
62
106
  ] }),
63
- t && /* @__PURE__ */ n(G, { id: f, children: t }),
64
- !t && o && /* @__PURE__ */ n(B, { id: p, children: o })
107
+ e && /* @__PURE__ */ o(w, { id: m, children: e }),
108
+ !e && n && /* @__PURE__ */ o(k, { id: p, children: n })
65
109
  ] });
66
110
  }
67
111
  );
68
- ce.displayName = "TextInput";
69
- const le = b(
112
+ Dt.displayName = "TextInput";
113
+ const zt = b(
70
114
  ({
71
- label: e,
72
- helper: o,
73
- error: t,
115
+ label: t,
116
+ helper: n,
117
+ error: e,
74
118
  required: s = !1,
75
119
  disabled: a = !1,
76
120
  readOnly: i = !1,
77
- resizable: c = !0,
78
- minRows: d = 3,
121
+ resizable: d = !0,
122
+ minRows: c = 3,
79
123
  maxRows: l,
80
124
  id: r,
81
125
  className: u,
82
- ...v
126
+ ...f
83
127
  }, h) => {
84
- const m = O(), p = r || m, f = o ? `${p}-helper` : void 0, C = t ? `${p}-error` : void 0, N = [f, C].filter(Boolean).join(" "), g = y({
128
+ const _ = S(), p = r || _, m = n ? `${p}-helper` : void 0, v = e ? `${p}-error` : void 0, C = [m, v].filter(Boolean).join(" "), y = I({
85
129
  disabled: a,
86
- invalid: !!t,
130
+ invalid: !!e,
87
131
  readOnly: i,
88
- resizable: c ? "true" : "false",
132
+ resizable: d ? "true" : "false",
89
133
  minRows: "true",
90
134
  ...l && { maxRows: "true" }
91
- }), S = {
92
- "--_min-rows-count": d,
135
+ }), g = {
136
+ "--_min-rows-count": c,
93
137
  ...l && { "--_max-rows-count": l }
94
138
  };
95
- return /* @__PURE__ */ I("div", { className: x(P.field, u), children: [
96
- e && /* @__PURE__ */ n(k, { htmlFor: p, required: s, disabled: a, children: e }),
97
- /* @__PURE__ */ n(
139
+ return /* @__PURE__ */ N("div", { className: x(z.field, u), children: [
140
+ t && /* @__PURE__ */ o($, { htmlFor: p, required: s, disabled: a, children: t }),
141
+ /* @__PURE__ */ o(
98
142
  "textarea",
99
143
  {
100
144
  ref: h,
101
145
  id: p,
102
- className: P.textarea,
146
+ className: z.textarea,
103
147
  disabled: a,
104
148
  readOnly: i,
105
149
  required: s,
106
- style: S,
107
- "aria-invalid": t ? "true" : void 0,
150
+ style: g,
151
+ "aria-invalid": e ? "true" : void 0,
108
152
  "aria-disabled": a ? "true" : void 0,
109
- "aria-describedby": N || void 0,
110
- ...g,
111
- ...v
153
+ "aria-describedby": C || void 0,
154
+ ...y,
155
+ ...f
112
156
  }
113
157
  ),
114
- t && /* @__PURE__ */ n(G, { id: C, children: t }),
115
- !t && o && /* @__PURE__ */ n(B, { id: f, children: o })
158
+ e && /* @__PURE__ */ o(w, { id: v, children: e }),
159
+ !e && n && /* @__PURE__ */ o(k, { id: m, children: n })
116
160
  ] });
117
161
  }
118
162
  );
119
- le.displayName = "TextArea";
120
- const V = b(({ children: e, ...o }, t) => /* @__PURE__ */ n("option", { ref: t, ...o, children: e }));
121
- V.displayName = "Select.Option";
122
- const _ = b(
123
- ({ label: e, children: o, ...t }, s) => /* @__PURE__ */ n("optgroup", { ref: s, label: e, ...t, children: o })
163
+ zt.displayName = "TextArea";
164
+ const P = b(({ children: t, ...n }, e) => /* @__PURE__ */ o("option", { ref: e, ...n, children: t }));
165
+ P.displayName = "Select.Option";
166
+ const H = b(
167
+ ({ label: t, children: n, ...e }, s) => /* @__PURE__ */ o("optgroup", { ref: s, label: t, ...e, children: n })
124
168
  );
125
- _.displayName = "Select.OptionGroup";
126
- const z = b(
127
- ({ label: e, helper: o, error: t, required: s = !1, disabled: a = !1, placeholder: i, children: c, id: d, className: l, ...r }, u) => {
128
- const v = O(), h = d || v, m = o ? `${h}-helper` : void 0, p = t ? `${h}-error` : void 0, f = [m, p].filter(Boolean).join(" "), C = y({
169
+ H.displayName = "Select.OptionGroup";
170
+ const V = b(
171
+ ({ label: t, helper: n, error: e, required: s = !1, disabled: a = !1, placeholder: i, children: d, id: c, className: l, ...r }, u) => {
172
+ const f = S(), h = c || f, _ = n ? `${h}-helper` : void 0, p = e ? `${h}-error` : void 0, m = [_, p].filter(Boolean).join(" "), v = I({
129
173
  disabled: a,
130
- invalid: !!t
174
+ invalid: !!e
131
175
  });
132
- return /* @__PURE__ */ I("div", { className: x(H.field, l), children: [
133
- e && /* @__PURE__ */ n(k, { htmlFor: h, required: s, disabled: a, children: e }),
134
- /* @__PURE__ */ I(
176
+ return /* @__PURE__ */ N("div", { className: x(F.field, l), children: [
177
+ t && /* @__PURE__ */ o($, { htmlFor: h, required: s, disabled: a, children: t }),
178
+ /* @__PURE__ */ N(
135
179
  "select",
136
180
  {
137
181
  ref: u,
138
182
  id: h,
139
- className: H.select,
183
+ className: F.select,
140
184
  disabled: a,
141
185
  required: s,
142
- "aria-invalid": t ? "true" : void 0,
186
+ "aria-invalid": e ? "true" : void 0,
143
187
  "aria-disabled": a ? "true" : void 0,
144
- "aria-describedby": f || void 0,
145
- ...C,
188
+ "aria-describedby": m || void 0,
189
+ ...v,
146
190
  ...r,
147
191
  children: [
148
- i && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: i }),
149
- c
192
+ i && /* @__PURE__ */ o("option", { value: "", disabled: !0, children: i }),
193
+ d
150
194
  ]
151
195
  }
152
196
  ),
153
- t && /* @__PURE__ */ n(G, { id: p, children: t }),
154
- !t && o && /* @__PURE__ */ n(B, { id: m, children: o })
197
+ e && /* @__PURE__ */ o(w, { id: p, children: e }),
198
+ !e && n && /* @__PURE__ */ o(k, { id: _, children: n })
155
199
  ] });
156
200
  }
157
201
  );
158
- z.displayName = "Select";
159
- const J = z;
160
- J.Option = V;
161
- J.OptionGroup = _;
162
- const re = b(
163
- ({ variant: e = "outline", size: o = "medium", invalid: t = !1, disabled: s = !1, children: a, className: i, ...c }, d) => {
164
- const l = y({
202
+ V.displayName = "Select";
203
+ const J = V;
204
+ J.Option = P;
205
+ J.OptionGroup = H;
206
+ const Ft = b(
207
+ ({ variant: t = "outline", size: n = "medium", invalid: e = !1, disabled: s = !1, children: a, className: i, ...d }, c) => {
208
+ const l = I({
165
209
  disabled: s,
166
- invalid: t,
167
- size: o,
168
- variant: e
210
+ invalid: e,
211
+ size: n,
212
+ variant: t
169
213
  });
170
- return /* @__PURE__ */ I("label", { className: x(M.radio, i), ...l, children: [
171
- /* @__PURE__ */ n(
214
+ return /* @__PURE__ */ N("label", { className: x(M.radio, i), ...l, children: [
215
+ /* @__PURE__ */ o(
172
216
  "input",
173
217
  {
174
- ref: d,
218
+ ref: c,
175
219
  type: "radio",
176
220
  className: M.input,
177
221
  disabled: s,
178
- "aria-invalid": t || void 0,
179
- ...c
222
+ "aria-invalid": e || void 0,
223
+ ...d
180
224
  }
181
225
  ),
182
- /* @__PURE__ */ n("span", { className: M.indicator }),
183
- a && /* @__PURE__ */ n("span", { className: M.label, children: a })
226
+ /* @__PURE__ */ o("span", { className: M.indicator }),
227
+ a && /* @__PURE__ */ o("span", { className: M.label, children: a })
184
228
  ] });
185
229
  }
186
230
  );
187
- re.displayName = "Radio";
188
- const pe = b(
189
- ({ invalid: e = !1, disabled: o = !1, required: t = !1, children: s, className: a, ...i }, c) => {
190
- const d = y({
191
- disabled: o,
192
- invalid: e,
193
- required: t
231
+ Ft.displayName = "Radio";
232
+ const Pt = b(
233
+ ({ invalid: t = !1, disabled: n = !1, required: e = !1, children: s, className: a, ...i }, d) => {
234
+ const c = I({
235
+ disabled: n,
236
+ invalid: t,
237
+ required: e
194
238
  });
195
- return /* @__PURE__ */ I("label", { className: x(T.checkbox, a), ...d, children: [
196
- /* @__PURE__ */ n(
239
+ return /* @__PURE__ */ N("label", { className: x(R.checkbox, a), ...c, children: [
240
+ /* @__PURE__ */ o(
197
241
  "input",
198
242
  {
199
- ref: c,
243
+ ref: d,
200
244
  type: "checkbox",
201
- className: T.input,
202
- disabled: o,
203
- required: t,
204
- "aria-invalid": e || void 0,
205
- "aria-required": t || void 0,
245
+ className: R.input,
246
+ disabled: n,
247
+ required: e,
248
+ "aria-invalid": t || void 0,
249
+ "aria-required": e || void 0,
206
250
  ...i
207
251
  }
208
252
  ),
209
- /* @__PURE__ */ n("span", { className: T.indicator }),
210
- s && /* @__PURE__ */ n("span", { className: T.label, "data-required": t || void 0, children: s })
253
+ /* @__PURE__ */ o("span", { className: R.indicator }),
254
+ s && /* @__PURE__ */ o("span", { className: R.label, "data-required": e || void 0, children: s })
211
255
  ] });
212
256
  }
213
257
  );
214
- pe.displayName = "Checkbox";
215
- const K = E(void 0);
216
- function ue() {
217
- const e = D(K);
218
- if (!e)
258
+ Pt.displayName = "Checkbox";
259
+ const K = T(void 0);
260
+ function Ht() {
261
+ const t = L(K);
262
+ if (!t)
219
263
  throw new Error("RadioGroup.Option must be used within RadioGroup");
220
- return e;
264
+ return t;
221
265
  }
222
266
  const Q = b(
223
267
  ({
224
- value: e,
225
- onChange: o,
226
- name: t,
268
+ value: t,
269
+ onChange: n,
270
+ name: e,
227
271
  variant: s = "outline",
228
272
  size: a = "medium",
229
273
  label: i,
230
- helper: c,
231
- error: d,
274
+ helper: d,
275
+ error: c,
232
276
  required: l = !1,
233
277
  disabled: r = !1,
234
278
  direction: u = "column",
235
- children: v,
279
+ children: f,
236
280
  className: h,
237
- ...m
281
+ ..._
238
282
  }, p) => {
239
- const f = O(), C = m.id || f, N = c ? `${C}-helper` : void 0, g = d ? `${C}-error` : void 0, S = [N, g].filter(Boolean).join(" "), w = (oe) => {
240
- !r && o && o(oe);
241
- }, R = y({
283
+ const m = S(), v = _.id || m, C = d ? `${v}-helper` : void 0, y = c ? `${v}-error` : void 0, g = [C, y].filter(Boolean).join(" "), O = (nt) => {
284
+ !r && n && n(nt);
285
+ }, G = I({
242
286
  disabled: r,
243
- invalid: !!d,
287
+ invalid: !!c,
244
288
  size: a === "medium" ? void 0 : a,
245
289
  variant: a === "medium" ? s : void 0
246
290
  });
247
- return /* @__PURE__ */ I("div", { ref: p, className: x(A.field, h), ...R, ...m, children: [
248
- i && /* @__PURE__ */ n(k, { required: l, disabled: r, children: i }),
249
- /* @__PURE__ */ n(K.Provider, { value: { disabled: r, name: t, onChange: w, value: e }, children: /* @__PURE__ */ n(
291
+ return /* @__PURE__ */ N("div", { ref: p, className: x(B.field, h), ...G, ..._, children: [
292
+ i && /* @__PURE__ */ o($, { required: l, disabled: r, children: i }),
293
+ /* @__PURE__ */ o(K.Provider, { value: { disabled: r, name: e, onChange: O, value: t }, children: /* @__PURE__ */ o(
250
294
  "div",
251
295
  {
252
- className: A.options,
296
+ className: B.options,
253
297
  "data-direction": u,
254
298
  role: "radiogroup",
255
- "aria-describedby": S || void 0,
256
- "aria-invalid": d ? "true" : void 0,
257
- children: v
299
+ "aria-describedby": g || void 0,
300
+ "aria-invalid": c ? "true" : void 0,
301
+ children: f
258
302
  }
259
303
  ) }),
260
- d && /* @__PURE__ */ n(G, { id: g, children: d }),
261
- !d && c && /* @__PURE__ */ n(B, { id: N, children: c })
304
+ c && /* @__PURE__ */ o(w, { id: y, children: c }),
305
+ !c && d && /* @__PURE__ */ o(k, { id: C, children: d })
262
306
  ] });
263
307
  }
264
308
  );
265
309
  Q.displayName = "RadioGroup";
266
310
  const U = b(
267
- ({ value: e, children: o, disabled: t, className: s, ...a }, i) => {
268
- const c = ue(), d = c.value === e, l = c.disabled || t, r = () => {
269
- l || c.onChange(e);
311
+ ({ value: t, children: n, disabled: e, className: s, ...a }, i) => {
312
+ const d = Ht(), c = d.value === t, l = d.disabled || e, r = () => {
313
+ l || d.onChange(t);
270
314
  };
271
- return /* @__PURE__ */ I("label", { className: x(A.option, s), children: [
272
- /* @__PURE__ */ n(
315
+ return /* @__PURE__ */ N("label", { className: x(B.option, s), children: [
316
+ /* @__PURE__ */ o(
273
317
  "input",
274
318
  {
275
319
  ref: i,
276
320
  type: "radio",
277
- name: c.name,
278
- value: e,
279
- checked: d,
321
+ name: d.name,
322
+ value: t,
323
+ checked: c,
280
324
  disabled: l,
281
325
  onChange: r,
282
- className: A.input,
326
+ className: B.input,
283
327
  ...a
284
328
  }
285
329
  ),
286
- /* @__PURE__ */ n("span", { className: A.indicator }),
287
- o && /* @__PURE__ */ n("span", { className: A.optionLabel, children: o })
330
+ /* @__PURE__ */ o("span", { className: B.indicator }),
331
+ n && /* @__PURE__ */ o("span", { className: B.optionLabel, children: n })
288
332
  ] });
289
333
  }
290
334
  );
291
335
  U.displayName = "RadioGroup.Option";
292
- const Ie = Object.assign(Q, {
336
+ const Zt = Object.assign(Q, {
293
337
  Option: U
294
- }), W = E(void 0);
295
- function he() {
296
- const e = D(W);
297
- if (!e)
338
+ }), W = T(void 0);
339
+ function Vt() {
340
+ const t = L(W);
341
+ if (!t)
298
342
  throw new Error("CheckboxGroup.Option must be used within CheckboxGroup");
299
- return e;
343
+ return t;
300
344
  }
301
345
  const X = b(
302
346
  ({
303
- value: e,
304
- onChange: o,
305
- name: t,
347
+ value: t,
348
+ onChange: n,
349
+ name: e,
306
350
  label: s,
307
351
  helper: a,
308
352
  error: i,
309
- required: c = !1,
310
- disabled: d = !1,
353
+ required: d = !1,
354
+ disabled: c = !1,
311
355
  direction: l = "column",
312
356
  children: r,
313
357
  className: u,
314
- ...v
358
+ ...f
315
359
  }, h) => {
316
- const m = O(), p = v.id || m, f = a ? `${p}-helper` : void 0, C = i ? `${p}-error` : void 0, N = [f, C].filter(Boolean).join(" "), g = (w) => {
317
- !d && o && o(w);
318
- }, S = y({
319
- disabled: d,
360
+ const _ = S(), p = f.id || _, m = a ? `${p}-helper` : void 0, v = i ? `${p}-error` : void 0, C = [m, v].filter(Boolean).join(" "), y = (O) => {
361
+ !c && n && n(O);
362
+ }, g = I({
363
+ disabled: c,
320
364
  invalid: !!i
321
365
  });
322
- return /* @__PURE__ */ I("div", { ref: h, className: x(j.field, u), ...S, ...v, children: [
323
- s && /* @__PURE__ */ n(k, { required: c, disabled: d, children: s }),
324
- /* @__PURE__ */ n(W.Provider, { value: { disabled: d, name: t, onChange: g, value: e }, children: /* @__PURE__ */ n(
366
+ return /* @__PURE__ */ N("div", { ref: h, className: x(A.field, u), ...g, ...f, children: [
367
+ s && /* @__PURE__ */ o($, { required: d, disabled: c, children: s }),
368
+ /* @__PURE__ */ o(W.Provider, { value: { disabled: c, name: e, onChange: y, value: t }, children: /* @__PURE__ */ o(
325
369
  "div",
326
370
  {
327
- className: j.options,
371
+ className: A.options,
328
372
  "data-direction": l,
329
373
  role: "group",
330
- "aria-describedby": N || void 0,
374
+ "aria-describedby": C || void 0,
331
375
  "aria-invalid": i ? "true" : void 0,
332
376
  children: r
333
377
  }
334
378
  ) }),
335
- i && /* @__PURE__ */ n(G, { id: C, children: i }),
336
- !i && a && /* @__PURE__ */ n(B, { id: f, children: a })
379
+ i && /* @__PURE__ */ o(w, { id: v, children: i }),
380
+ !i && a && /* @__PURE__ */ o(k, { id: m, children: a })
337
381
  ] });
338
382
  }
339
383
  );
340
384
  X.displayName = "CheckboxGroup";
341
385
  const Y = b(
342
- ({ value: e, children: o, disabled: t, required: s = !1, className: a, ...i }, c) => {
343
- const d = O(), l = he(), r = l.value.includes(e), u = l.disabled || t, v = () => {
386
+ ({ value: t, children: n, disabled: e, required: s = !1, className: a, ...i }, d) => {
387
+ const c = S(), l = Vt(), r = l.value.includes(t), u = l.disabled || e, f = () => {
344
388
  if (!u) {
345
- const m = r ? l.value.filter((p) => p !== e) : [...l.value, e];
346
- l.onChange(m);
389
+ const _ = r ? l.value.filter((p) => p !== t) : [...l.value, t];
390
+ l.onChange(_);
347
391
  }
348
- }, h = y({
392
+ }, h = I({
349
393
  disabled: u,
350
394
  required: s
351
395
  });
352
- return /* @__PURE__ */ I("label", { className: x(j.option, a), ...h, children: [
353
- /* @__PURE__ */ n(
396
+ return /* @__PURE__ */ N("label", { className: x(A.option, a), ...h, children: [
397
+ /* @__PURE__ */ o(
354
398
  "input",
355
399
  {
356
- ref: c,
400
+ ref: d,
357
401
  type: "checkbox",
358
402
  name: l.name,
359
- value: e,
403
+ value: t,
360
404
  checked: r,
361
405
  disabled: u,
362
406
  required: s,
363
- onChange: v,
364
- className: j.input,
407
+ onChange: f,
408
+ className: A.input,
365
409
  "aria-required": s || void 0,
366
410
  ...i,
367
- id: d
411
+ id: c
368
412
  }
369
413
  ),
370
- /* @__PURE__ */ n("span", { className: j.indicator }),
371
- o && /* @__PURE__ */ n(k, { required: s, disabled: u, htmlFor: d, children: o })
414
+ /* @__PURE__ */ o("span", { className: A.indicator }),
415
+ n && /* @__PURE__ */ o($, { required: s, disabled: u, htmlFor: c, children: n })
372
416
  ] });
373
417
  }
374
418
  );
375
419
  Y.displayName = "CheckboxGroup.Option";
376
- const ye = Object.assign(X, {
420
+ const qt = Object.assign(X, {
377
421
  Option: Y
378
- }), Z = E(void 0);
379
- function me() {
380
- const e = D(Z);
381
- if (!e)
422
+ }), Z = T(void 0);
423
+ function Jt() {
424
+ const t = L(Z);
425
+ if (!t)
382
426
  throw new Error("ChipSingleInput.Option must be used within ChipSingleInput");
383
- return e;
427
+ return t;
384
428
  }
385
429
  const q = b(
386
430
  ({
387
- value: e,
388
- onChange: o,
389
- name: t,
431
+ value: t,
432
+ onChange: n,
433
+ name: e,
390
434
  label: s,
391
435
  helper: a,
392
436
  error: i,
393
- required: c = !1,
394
- disabled: d = !1,
437
+ required: d = !1,
438
+ disabled: c = !1,
395
439
  gap: l = "2",
396
440
  wrap: r = !0,
397
441
  children: u,
398
- className: v,
442
+ className: f,
399
443
  ...h
400
- }, m) => {
401
- const p = O(), f = h.id || p, C = a ? `${f}-helper` : void 0, N = i ? `${f}-error` : void 0, g = [C, N].filter(Boolean).join(" "), S = (R) => {
402
- !d && o && o(R);
403
- }, w = y({
444
+ }, _) => {
445
+ const p = S(), m = h.id || p, v = a ? `${m}-helper` : void 0, C = i ? `${m}-error` : void 0, y = [v, C].filter(Boolean).join(" "), g = (G) => {
446
+ !c && n && n(G);
447
+ }, O = I({
404
448
  invalid: !!i
405
449
  });
406
- return /* @__PURE__ */ I("div", { ref: m, className: x(F.field, v), ...w, ...h, children: [
407
- s && /* @__PURE__ */ n(k, { required: c, disabled: d, children: s }),
408
- /* @__PURE__ */ n(
450
+ return /* @__PURE__ */ N("div", { ref: _, className: x(E.field, f), ...O, ...h, children: [
451
+ s && /* @__PURE__ */ o($, { required: d, disabled: c, children: s }),
452
+ /* @__PURE__ */ o(
409
453
  Z.Provider,
410
454
  {
411
455
  value: {
412
- disabled: d,
413
- name: t,
414
- onChange: S,
415
- value: e
456
+ disabled: c,
457
+ name: e,
458
+ onChange: g,
459
+ value: t
416
460
  },
417
- children: /* @__PURE__ */ n(
461
+ children: /* @__PURE__ */ o(
418
462
  "div",
419
463
  {
420
- className: F.options,
464
+ className: E.options,
421
465
  "data-gap": l,
422
466
  "data-wrap": r,
423
467
  role: "radiogroup",
424
- "aria-describedby": g || void 0,
468
+ "aria-describedby": y || void 0,
425
469
  "aria-invalid": i ? "true" : void 0,
426
470
  children: u
427
471
  }
428
472
  )
429
473
  }
430
474
  ),
431
- i && /* @__PURE__ */ n(G, { id: N, children: i }),
432
- !i && a && /* @__PURE__ */ n(B, { id: C, children: a })
475
+ i && /* @__PURE__ */ o(w, { id: C, children: i }),
476
+ !i && a && /* @__PURE__ */ o(k, { id: v, children: a })
433
477
  ] });
434
478
  }
435
479
  );
436
480
  q.displayName = "ChipSingleInput";
437
- const ee = b(
438
- ({ value: e, children: o, disabled: t, ...s }, a) => {
439
- const i = me(), c = i.value === e, d = i.disabled || t, l = () => {
440
- !d && i.onChange && i.onChange(e);
441
- }, r = y({
442
- disabled: d,
443
- selected: c
481
+ const tt = b(
482
+ ({ value: t, children: n, disabled: e, ...s }, a) => {
483
+ const i = Jt(), d = i.value === t, c = i.disabled || e, l = () => {
484
+ !c && i.onChange && i.onChange(t);
485
+ }, r = I({
486
+ disabled: c,
487
+ selected: d
444
488
  });
445
- return /* @__PURE__ */ n(
489
+ return /* @__PURE__ */ o(
446
490
  "button",
447
491
  {
448
492
  ref: a,
449
493
  type: "button",
450
- className: F.option,
494
+ className: E.option,
451
495
  onClick: l,
452
- disabled: d,
453
- "aria-pressed": c,
496
+ disabled: c,
497
+ "aria-pressed": d,
454
498
  ...r,
455
499
  ...s,
456
- children: o
500
+ children: n
457
501
  }
458
502
  );
459
503
  }
460
504
  );
461
- ee.displayName = "ChipSingleInput.Option";
462
- const ge = Object.assign(q, {
463
- Option: ee
464
- }), te = E(void 0);
465
- function ve() {
466
- const e = D(te);
467
- if (!e)
505
+ tt.displayName = "ChipSingleInput.Option";
506
+ const te = Object.assign(q, {
507
+ Option: tt
508
+ }), et = T(void 0);
509
+ function Kt() {
510
+ const t = L(et);
511
+ if (!t)
468
512
  throw new Error("ChipMultipleInput.Option must be used within ChipMultipleInput");
469
- return e;
513
+ return t;
470
514
  }
471
- const ie = b(
515
+ const it = b(
472
516
  ({
473
- value: e,
474
- onChange: o,
475
- name: t,
517
+ value: t,
518
+ onChange: n,
519
+ name: e,
476
520
  label: s,
477
521
  helper: a,
478
522
  error: i,
479
- required: c = !1,
480
- disabled: d = !1,
523
+ required: d = !1,
524
+ disabled: c = !1,
481
525
  gap: l = "2",
482
526
  wrap: r = !0,
483
527
  children: u,
484
- className: v,
528
+ className: f,
485
529
  ...h
486
- }, m) => {
487
- const p = O(), f = h.id || p, C = a ? `${f}-helper` : void 0, N = i ? `${f}-error` : void 0, g = [C, N].filter(Boolean).join(" "), S = (R) => {
488
- !d && o && o(R);
489
- }, w = y({
530
+ }, _) => {
531
+ const p = S(), m = h.id || p, v = a ? `${m}-helper` : void 0, C = i ? `${m}-error` : void 0, y = [v, C].filter(Boolean).join(" "), g = (G) => {
532
+ !c && n && n(G);
533
+ }, O = I({
490
534
  invalid: !!i
491
535
  });
492
- return /* @__PURE__ */ I("div", { ref: m, className: x(L.field, v), ...w, ...h, children: [
493
- s && /* @__PURE__ */ n(k, { required: c, disabled: d, children: s }),
494
- /* @__PURE__ */ n(
495
- te.Provider,
536
+ return /* @__PURE__ */ N("div", { ref: _, className: x(D.field, f), ...O, ...h, children: [
537
+ s && /* @__PURE__ */ o($, { required: d, disabled: c, children: s }),
538
+ /* @__PURE__ */ o(
539
+ et.Provider,
496
540
  {
497
541
  value: {
498
- disabled: d,
499
- name: t,
500
- onChange: S,
501
- value: e
542
+ disabled: c,
543
+ name: e,
544
+ onChange: g,
545
+ value: t
502
546
  },
503
- children: /* @__PURE__ */ n(
547
+ children: /* @__PURE__ */ o(
504
548
  "div",
505
549
  {
506
- className: L.options,
550
+ className: D.options,
507
551
  "data-gap": l,
508
552
  "data-wrap": r,
509
553
  role: "group",
510
- "aria-describedby": g || void 0,
554
+ "aria-describedby": y || void 0,
511
555
  "aria-invalid": i ? "true" : void 0,
512
556
  children: u
513
557
  }
514
558
  )
515
559
  }
516
560
  ),
517
- i && /* @__PURE__ */ n(G, { id: N, children: i }),
518
- !i && a && /* @__PURE__ */ n(B, { id: C, children: a })
561
+ i && /* @__PURE__ */ o(w, { id: C, children: i }),
562
+ !i && a && /* @__PURE__ */ o(k, { id: v, children: a })
519
563
  ] });
520
564
  }
521
565
  );
522
- ie.displayName = "ChipMultipleInput";
523
- const ne = b(
524
- ({ value: e, children: o, disabled: t, ...s }, a) => {
525
- const i = ve(), c = i.value.includes(e), d = i.disabled || t, l = () => {
526
- if (!d && i.onChange) {
527
- const u = c ? i.value.filter((v) => v !== e) : [...i.value, e];
566
+ it.displayName = "ChipMultipleInput";
567
+ const ot = b(
568
+ ({ value: t, children: n, disabled: e, ...s }, a) => {
569
+ const i = Kt(), d = i.value.includes(t), c = i.disabled || e, l = () => {
570
+ if (!c && i.onChange) {
571
+ const u = d ? i.value.filter((f) => f !== t) : [...i.value, t];
528
572
  i.onChange(u);
529
573
  }
530
- }, r = y({
531
- disabled: d,
532
- selected: c
574
+ }, r = I({
575
+ disabled: c,
576
+ selected: d
533
577
  });
534
- return /* @__PURE__ */ n(
578
+ return /* @__PURE__ */ o(
535
579
  "button",
536
580
  {
537
581
  ref: a,
538
582
  type: "button",
539
- className: L.option,
583
+ className: D.option,
540
584
  onClick: l,
541
- disabled: d,
542
- "aria-pressed": c,
585
+ disabled: c,
586
+ "aria-pressed": d,
543
587
  ...r,
544
588
  ...s,
545
- children: o
589
+ children: n
546
590
  }
547
591
  );
548
592
  }
549
593
  );
550
- ne.displayName = "ChipMultipleInput.Option";
551
- const Se = Object.assign(ie, {
552
- Option: ne
594
+ ot.displayName = "ChipMultipleInput.Option";
595
+ const ee = Object.assign(it, {
596
+ Option: ot
553
597
  });
554
598
  export {
555
- pe as Checkbox,
556
- ye as CheckboxGroup,
557
- Se as ChipMultipleInput,
558
- ge as ChipSingleInput,
559
- G as ErrorText,
560
- B as HelperText,
561
- k as Label,
562
- re as Radio,
563
- Ie as RadioGroup,
599
+ Pt as Checkbox,
600
+ qt as CheckboxGroup,
601
+ ee as ChipMultipleInput,
602
+ te as ChipSingleInput,
603
+ w as ErrorText,
604
+ k as HelperText,
605
+ $ as Label,
606
+ Ft as Radio,
607
+ Zt as RadioGroup,
564
608
  J as Select,
565
- le as TextArea,
566
- ce as TextInput
609
+ zt as TextArea,
610
+ Dt as TextInput
567
611
  };