@versaur/react 1.0.5 → 1.0.6

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