@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/blocks.d.ts +26 -26
- package/dist/blocks.js +556 -640
- package/dist/forms.d.ts +2 -2
- package/dist/forms.js +303 -336
- package/dist/overlay-parts-Zq9CuT31.js +24 -0
- package/dist/primitive.d.ts +35 -36
- package/dist/primitive.js +115 -127
- package/dist/tooltip-M8EGI3lZ.js +200 -0
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/checkbox.module-D4Do_b6S.js +0 -9
- package/dist/overlay-parts-YglazEA-.js +0 -29
- package/dist/tokens.d.ts +0 -1
- package/dist/tokens.js +0 -1
- package/dist/tooltip-CmKPCktA.js +0 -212
- package/dist/versaur-react.css +0 -1
package/dist/forms.js
CHANGED
|
@@ -1,611 +1,578 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
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__ */
|
|
12
|
+
return /* @__PURE__ */ n("label", { ref: i, className: x(ae.label, s), ...c, ...a, children: t });
|
|
57
13
|
}
|
|
58
14
|
);
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const
|
|
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:
|
|
67
|
-
helper:
|
|
68
|
-
error:
|
|
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:
|
|
73
|
-
rightIcon:
|
|
28
|
+
leftIcon: c,
|
|
29
|
+
rightIcon: d,
|
|
74
30
|
id: l,
|
|
75
31
|
className: r,
|
|
76
32
|
...u
|
|
77
|
-
},
|
|
78
|
-
const h =
|
|
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: !!
|
|
81
|
-
hasRightIcon: !!
|
|
82
|
-
invalid: !!
|
|
36
|
+
hasLeftIcon: !!c,
|
|
37
|
+
hasRightIcon: !!d,
|
|
38
|
+
invalid: !!t,
|
|
83
39
|
readOnly: i
|
|
84
40
|
});
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
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:
|
|
93
|
-
id:
|
|
48
|
+
ref: v,
|
|
49
|
+
id: m,
|
|
94
50
|
type: "text",
|
|
95
|
-
className:
|
|
51
|
+
className: $.input,
|
|
96
52
|
disabled: a,
|
|
97
53
|
readOnly: i,
|
|
98
54
|
required: s,
|
|
99
|
-
"aria-invalid":
|
|
55
|
+
"aria-invalid": t ? "true" : void 0,
|
|
100
56
|
"aria-disabled": a ? "true" : void 0,
|
|
101
|
-
"aria-describedby":
|
|
57
|
+
"aria-describedby": C || void 0,
|
|
102
58
|
...u
|
|
103
59
|
}
|
|
104
60
|
),
|
|
105
|
-
|
|
61
|
+
d && /* @__PURE__ */ n("span", { className: $["right-icon"], children: d })
|
|
106
62
|
] }),
|
|
107
|
-
|
|
108
|
-
!
|
|
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
|
-
|
|
113
|
-
const
|
|
68
|
+
ce.displayName = "TextInput";
|
|
69
|
+
const le = b(
|
|
114
70
|
({
|
|
115
|
-
label:
|
|
116
|
-
helper:
|
|
117
|
-
error:
|
|
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:
|
|
122
|
-
minRows:
|
|
77
|
+
resizable: c = !0,
|
|
78
|
+
minRows: d = 3,
|
|
123
79
|
maxRows: l,
|
|
124
80
|
id: r,
|
|
125
81
|
className: u,
|
|
126
|
-
...
|
|
82
|
+
...v
|
|
127
83
|
}, h) => {
|
|
128
|
-
const
|
|
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: !!
|
|
86
|
+
invalid: !!t,
|
|
131
87
|
readOnly: i,
|
|
132
|
-
resizable:
|
|
88
|
+
resizable: c ? "true" : "false",
|
|
133
89
|
minRows: "true",
|
|
134
90
|
...l && { maxRows: "true" }
|
|
135
|
-
}),
|
|
136
|
-
"--_min-rows-count":
|
|
91
|
+
}), S = {
|
|
92
|
+
"--_min-rows-count": d,
|
|
137
93
|
...l && { "--_max-rows-count": l }
|
|
138
94
|
};
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
|
|
141
|
-
/* @__PURE__ */
|
|
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:
|
|
102
|
+
className: P.textarea,
|
|
147
103
|
disabled: a,
|
|
148
104
|
readOnly: i,
|
|
149
105
|
required: s,
|
|
150
|
-
style:
|
|
151
|
-
"aria-invalid":
|
|
106
|
+
style: S,
|
|
107
|
+
"aria-invalid": t ? "true" : void 0,
|
|
152
108
|
"aria-disabled": a ? "true" : void 0,
|
|
153
|
-
"aria-describedby":
|
|
154
|
-
...
|
|
155
|
-
...
|
|
109
|
+
"aria-describedby": N || void 0,
|
|
110
|
+
...g,
|
|
111
|
+
...v
|
|
156
112
|
}
|
|
157
113
|
),
|
|
158
|
-
|
|
159
|
-
!
|
|
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
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
({ label:
|
|
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
|
-
|
|
170
|
-
const
|
|
171
|
-
({
|
|
172
|
-
|
|
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: !!
|
|
141
|
+
invalid: !!t
|
|
175
142
|
});
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
|
|
178
|
-
/* @__PURE__ */
|
|
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:
|
|
150
|
+
className: H.select,
|
|
184
151
|
disabled: a,
|
|
185
152
|
required: s,
|
|
186
|
-
"aria-invalid":
|
|
153
|
+
"aria-invalid": t ? "true" : void 0,
|
|
187
154
|
"aria-disabled": a ? "true" : void 0,
|
|
188
|
-
"aria-describedby":
|
|
189
|
-
...
|
|
155
|
+
"aria-describedby": f || void 0,
|
|
156
|
+
...C,
|
|
190
157
|
...r,
|
|
191
158
|
children: [
|
|
192
|
-
i && /* @__PURE__ */
|
|
193
|
-
|
|
159
|
+
i && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: i }),
|
|
160
|
+
c
|
|
194
161
|
]
|
|
195
162
|
}
|
|
196
163
|
),
|
|
197
|
-
|
|
198
|
-
!
|
|
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
|
-
|
|
203
|
-
const J =
|
|
204
|
-
J.Option =
|
|
205
|
-
J.OptionGroup =
|
|
206
|
-
const
|
|
207
|
-
({ variant:
|
|
208
|
-
const l =
|
|
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:
|
|
211
|
-
size:
|
|
212
|
-
variant:
|
|
177
|
+
invalid: t,
|
|
178
|
+
size: o,
|
|
179
|
+
variant: e
|
|
213
180
|
});
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ I("label", { className: x(M.radio, i), ...l, children: [
|
|
182
|
+
/* @__PURE__ */ n(
|
|
216
183
|
"input",
|
|
217
184
|
{
|
|
218
|
-
ref:
|
|
185
|
+
ref: d,
|
|
219
186
|
type: "radio",
|
|
220
187
|
className: M.input,
|
|
221
188
|
disabled: s,
|
|
222
|
-
"aria-invalid":
|
|
223
|
-
...
|
|
189
|
+
"aria-invalid": t || void 0,
|
|
190
|
+
...c
|
|
224
191
|
}
|
|
225
192
|
),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
a && /* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ n("span", { className: M.indicator }),
|
|
194
|
+
a && /* @__PURE__ */ n("span", { className: M.label, children: a })
|
|
228
195
|
] });
|
|
229
196
|
}
|
|
230
197
|
);
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
({ invalid:
|
|
234
|
-
const
|
|
235
|
-
disabled:
|
|
236
|
-
invalid:
|
|
237
|
-
required:
|
|
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__ */
|
|
240
|
-
/* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ I("label", { className: x(T.checkbox, a), ...d, children: [
|
|
207
|
+
/* @__PURE__ */ n(
|
|
241
208
|
"input",
|
|
242
209
|
{
|
|
243
|
-
ref:
|
|
210
|
+
ref: c,
|
|
244
211
|
type: "checkbox",
|
|
245
|
-
className:
|
|
246
|
-
disabled:
|
|
247
|
-
required:
|
|
248
|
-
"aria-invalid":
|
|
249
|
-
"aria-required":
|
|
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__ */
|
|
254
|
-
s && /* @__PURE__ */
|
|
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
|
-
|
|
259
|
-
const K =
|
|
260
|
-
function
|
|
261
|
-
const
|
|
262
|
-
if (!
|
|
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
|
|
231
|
+
return e;
|
|
265
232
|
}
|
|
266
233
|
const Q = b(
|
|
267
234
|
({
|
|
268
|
-
value:
|
|
269
|
-
onChange:
|
|
270
|
-
name:
|
|
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:
|
|
275
|
-
error:
|
|
241
|
+
helper: c,
|
|
242
|
+
error: d,
|
|
276
243
|
required: l = !1,
|
|
277
244
|
disabled: r = !1,
|
|
278
245
|
direction: u = "column",
|
|
279
|
-
children:
|
|
246
|
+
children: v,
|
|
280
247
|
className: h,
|
|
281
|
-
...
|
|
248
|
+
...m
|
|
282
249
|
}, p) => {
|
|
283
|
-
const
|
|
284
|
-
!r &&
|
|
285
|
-
},
|
|
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: !!
|
|
254
|
+
invalid: !!d,
|
|
288
255
|
size: a === "medium" ? void 0 : a,
|
|
289
256
|
variant: a === "medium" ? s : void 0
|
|
290
257
|
});
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
i && /* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */
|
|
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:
|
|
263
|
+
className: A.options,
|
|
297
264
|
"data-direction": u,
|
|
298
265
|
role: "radiogroup",
|
|
299
|
-
"aria-describedby":
|
|
300
|
-
"aria-invalid":
|
|
301
|
-
children:
|
|
266
|
+
"aria-describedby": S || void 0,
|
|
267
|
+
"aria-invalid": d ? "true" : void 0,
|
|
268
|
+
children: v
|
|
302
269
|
}
|
|
303
270
|
) }),
|
|
304
|
-
|
|
305
|
-
!
|
|
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:
|
|
312
|
-
const
|
|
313
|
-
l ||
|
|
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__ */
|
|
316
|
-
/* @__PURE__ */
|
|
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:
|
|
322
|
-
value:
|
|
323
|
-
checked:
|
|
288
|
+
name: c.name,
|
|
289
|
+
value: e,
|
|
290
|
+
checked: d,
|
|
324
291
|
disabled: l,
|
|
325
292
|
onChange: r,
|
|
326
|
-
className:
|
|
293
|
+
className: A.input,
|
|
327
294
|
...a
|
|
328
295
|
}
|
|
329
296
|
),
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
|
|
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
|
|
303
|
+
const Ie = Object.assign(Q, {
|
|
337
304
|
Option: U
|
|
338
|
-
}), W =
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
if (!
|
|
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
|
|
310
|
+
return e;
|
|
344
311
|
}
|
|
345
312
|
const X = b(
|
|
346
313
|
({
|
|
347
|
-
value:
|
|
348
|
-
onChange:
|
|
349
|
-
name:
|
|
314
|
+
value: e,
|
|
315
|
+
onChange: o,
|
|
316
|
+
name: t,
|
|
350
317
|
label: s,
|
|
351
318
|
helper: a,
|
|
352
319
|
error: i,
|
|
353
|
-
required:
|
|
354
|
-
disabled:
|
|
320
|
+
required: c = !1,
|
|
321
|
+
disabled: d = !1,
|
|
355
322
|
direction: l = "column",
|
|
356
323
|
children: r,
|
|
357
324
|
className: u,
|
|
358
|
-
...
|
|
325
|
+
...v
|
|
359
326
|
}, h) => {
|
|
360
|
-
const
|
|
361
|
-
!
|
|
362
|
-
},
|
|
363
|
-
disabled:
|
|
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__ */
|
|
367
|
-
s && /* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
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:
|
|
338
|
+
className: j.options,
|
|
372
339
|
"data-direction": l,
|
|
373
340
|
role: "group",
|
|
374
|
-
"aria-describedby":
|
|
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__ */
|
|
380
|
-
!i && a && /* @__PURE__ */
|
|
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:
|
|
387
|
-
const
|
|
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
|
|
390
|
-
l.onChange(
|
|
356
|
+
const m = r ? l.value.filter((p) => p !== e) : [...l.value, e];
|
|
357
|
+
l.onChange(m);
|
|
391
358
|
}
|
|
392
|
-
}, h =
|
|
359
|
+
}, h = y({
|
|
393
360
|
disabled: u,
|
|
394
361
|
required: s
|
|
395
362
|
});
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ I("label", { className: x(j.option, a), ...h, children: [
|
|
364
|
+
/* @__PURE__ */ n(
|
|
398
365
|
"input",
|
|
399
366
|
{
|
|
400
|
-
ref:
|
|
367
|
+
ref: c,
|
|
401
368
|
type: "checkbox",
|
|
402
369
|
name: l.name,
|
|
403
|
-
value:
|
|
370
|
+
value: e,
|
|
404
371
|
checked: r,
|
|
405
372
|
disabled: u,
|
|
406
373
|
required: s,
|
|
407
|
-
onChange:
|
|
408
|
-
className:
|
|
374
|
+
onChange: v,
|
|
375
|
+
className: j.input,
|
|
409
376
|
"aria-required": s || void 0,
|
|
410
377
|
...i,
|
|
411
|
-
id:
|
|
378
|
+
id: d
|
|
412
379
|
}
|
|
413
380
|
),
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
|
|
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
|
|
387
|
+
const ye = Object.assign(X, {
|
|
421
388
|
Option: Y
|
|
422
|
-
}), Z =
|
|
423
|
-
function
|
|
424
|
-
const
|
|
425
|
-
if (!
|
|
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
|
|
394
|
+
return e;
|
|
428
395
|
}
|
|
429
396
|
const q = b(
|
|
430
397
|
({
|
|
431
|
-
value:
|
|
432
|
-
onChange:
|
|
433
|
-
name:
|
|
398
|
+
value: e,
|
|
399
|
+
onChange: o,
|
|
400
|
+
name: t,
|
|
434
401
|
label: s,
|
|
435
402
|
helper: a,
|
|
436
403
|
error: i,
|
|
437
|
-
required:
|
|
438
|
-
disabled:
|
|
404
|
+
required: c = !1,
|
|
405
|
+
disabled: d = !1,
|
|
439
406
|
gap: l = "2",
|
|
440
407
|
wrap: r = !0,
|
|
441
408
|
children: u,
|
|
442
|
-
className:
|
|
409
|
+
className: v,
|
|
443
410
|
...h
|
|
444
|
-
},
|
|
445
|
-
const p =
|
|
446
|
-
!
|
|
447
|
-
},
|
|
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__ */
|
|
451
|
-
s && /* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
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:
|
|
457
|
-
name:
|
|
458
|
-
onChange:
|
|
459
|
-
value:
|
|
423
|
+
disabled: d,
|
|
424
|
+
name: t,
|
|
425
|
+
onChange: S,
|
|
426
|
+
value: e
|
|
460
427
|
},
|
|
461
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ n(
|
|
462
429
|
"div",
|
|
463
430
|
{
|
|
464
|
-
className:
|
|
431
|
+
className: F.options,
|
|
465
432
|
"data-gap": l,
|
|
466
433
|
"data-wrap": r,
|
|
467
434
|
role: "radiogroup",
|
|
468
|
-
"aria-describedby":
|
|
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__ */
|
|
476
|
-
!i && a && /* @__PURE__ */
|
|
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
|
|
482
|
-
({ value:
|
|
483
|
-
const i =
|
|
484
|
-
!
|
|
485
|
-
}, r =
|
|
486
|
-
disabled:
|
|
487
|
-
selected:
|
|
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__ */
|
|
456
|
+
return /* @__PURE__ */ n(
|
|
490
457
|
"button",
|
|
491
458
|
{
|
|
492
459
|
ref: a,
|
|
493
460
|
type: "button",
|
|
494
|
-
className:
|
|
461
|
+
className: F.option,
|
|
495
462
|
onClick: l,
|
|
496
|
-
disabled:
|
|
497
|
-
"aria-pressed":
|
|
463
|
+
disabled: d,
|
|
464
|
+
"aria-pressed": c,
|
|
498
465
|
...r,
|
|
499
466
|
...s,
|
|
500
|
-
children:
|
|
467
|
+
children: o
|
|
501
468
|
}
|
|
502
469
|
);
|
|
503
470
|
}
|
|
504
471
|
);
|
|
505
|
-
|
|
506
|
-
const
|
|
507
|
-
Option:
|
|
508
|
-
}),
|
|
509
|
-
function
|
|
510
|
-
const
|
|
511
|
-
if (!
|
|
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
|
|
480
|
+
return e;
|
|
514
481
|
}
|
|
515
|
-
const
|
|
482
|
+
const ie = b(
|
|
516
483
|
({
|
|
517
|
-
value:
|
|
518
|
-
onChange:
|
|
519
|
-
name:
|
|
484
|
+
value: e,
|
|
485
|
+
onChange: o,
|
|
486
|
+
name: t,
|
|
520
487
|
label: s,
|
|
521
488
|
helper: a,
|
|
522
489
|
error: i,
|
|
523
|
-
required:
|
|
524
|
-
disabled:
|
|
490
|
+
required: c = !1,
|
|
491
|
+
disabled: d = !1,
|
|
525
492
|
gap: l = "2",
|
|
526
493
|
wrap: r = !0,
|
|
527
494
|
children: u,
|
|
528
|
-
className:
|
|
495
|
+
className: v,
|
|
529
496
|
...h
|
|
530
|
-
},
|
|
531
|
-
const p =
|
|
532
|
-
!
|
|
533
|
-
},
|
|
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__ */
|
|
537
|
-
s && /* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
|
|
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:
|
|
543
|
-
name:
|
|
544
|
-
onChange:
|
|
545
|
-
value:
|
|
509
|
+
disabled: d,
|
|
510
|
+
name: t,
|
|
511
|
+
onChange: S,
|
|
512
|
+
value: e
|
|
546
513
|
},
|
|
547
|
-
children: /* @__PURE__ */
|
|
514
|
+
children: /* @__PURE__ */ n(
|
|
548
515
|
"div",
|
|
549
516
|
{
|
|
550
|
-
className:
|
|
517
|
+
className: L.options,
|
|
551
518
|
"data-gap": l,
|
|
552
519
|
"data-wrap": r,
|
|
553
520
|
role: "group",
|
|
554
|
-
"aria-describedby":
|
|
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__ */
|
|
562
|
-
!i && a && /* @__PURE__ */
|
|
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
|
-
|
|
567
|
-
const
|
|
568
|
-
({ value:
|
|
569
|
-
const i =
|
|
570
|
-
if (!
|
|
571
|
-
const u =
|
|
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 =
|
|
575
|
-
disabled:
|
|
576
|
-
selected:
|
|
541
|
+
}, r = y({
|
|
542
|
+
disabled: d,
|
|
543
|
+
selected: c
|
|
577
544
|
});
|
|
578
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ n(
|
|
579
546
|
"button",
|
|
580
547
|
{
|
|
581
548
|
ref: a,
|
|
582
549
|
type: "button",
|
|
583
|
-
className:
|
|
550
|
+
className: L.option,
|
|
584
551
|
onClick: l,
|
|
585
|
-
disabled:
|
|
586
|
-
"aria-pressed":
|
|
552
|
+
disabled: d,
|
|
553
|
+
"aria-pressed": c,
|
|
587
554
|
...r,
|
|
588
555
|
...s,
|
|
589
|
-
children:
|
|
556
|
+
children: o
|
|
590
557
|
}
|
|
591
558
|
);
|
|
592
559
|
}
|
|
593
560
|
);
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
Option:
|
|
561
|
+
ne.displayName = "ChipMultipleInput.Option";
|
|
562
|
+
const Se = Object.assign(ie, {
|
|
563
|
+
Option: ne
|
|
597
564
|
});
|
|
598
565
|
export {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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
|
-
|
|
610
|
-
|
|
576
|
+
le as TextArea,
|
|
577
|
+
ce as TextInput
|
|
611
578
|
};
|