@versaur/react 1.0.13 → 1.0.14
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 +0 -111
- package/dist/blocks.js +530 -747
- package/dist/drawer-DRv9k7lp.js +120 -0
- package/dist/forms.d.ts +125 -0
- package/dist/forms.js +618 -321
- package/dist/helpers-DTL6qrTe.js +129 -0
- package/dist/{overlay-parts-Zq9CuT31.js → overlay-parts-CFeD8VN0.js} +3 -3
- package/dist/primitive.d.ts +2 -0
- package/dist/primitive.js +8 -9
- package/dist/tooltip-BMKVL6jz.js +170 -0
- package/dist/utils.d.ts +87 -0
- package/dist/utils.js +62 -5
- package/package.json +2 -2
- package/dist/tooltip-_eEMRSo8.js +0 -268
- package/dist/use-data-attrs-iPFyfiKN.js +0 -16
package/dist/forms.js
CHANGED
|
@@ -1,475 +1,772 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { labelStyles as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { u as
|
|
5
|
-
import { c as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as s, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { labelStyles as Oe, helperTextStyles as Se, errorTextStyles as ke, textInputStyles as G, textAreaStyles as K, selectStyles as _, radioStyles as T, checkboxStyles as j, radioGroupStyles as X, checkboxGroupStyles as J, chipInputStyles as M, comboboxInputStyles as v } from "@versaur/core/forms";
|
|
3
|
+
import { forwardRef as f, useId as A, createContext as P, useContext as Q, useState as D, useEffect as $, useCallback as L, useRef as Be } from "react";
|
|
4
|
+
import { u as N, c as Re } from "./helpers-DTL6qrTe.js";
|
|
5
|
+
import { c as y } from "./cx-B9vmfsc1.js";
|
|
6
|
+
import { ChevronDownIcon as Ae, CheckIcon as Ge, XIcon as De } from "@versaur/icons";
|
|
7
|
+
import { D as U } from "./drawer-DRv9k7lp.js";
|
|
8
|
+
const k = f(
|
|
9
|
+
({ required: e = !1, disabled: c = !1, children: i, className: a, ...n }, t) => {
|
|
10
|
+
const o = N({
|
|
11
|
+
disabled: c,
|
|
10
12
|
required: e
|
|
11
13
|
});
|
|
12
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ s("label", { ref: t, className: y(Oe.label, a), ...o, ...n, children: i });
|
|
13
15
|
}
|
|
14
16
|
);
|
|
15
17
|
k.displayName = "Label";
|
|
16
|
-
const B =
|
|
18
|
+
const B = f(({ children: e, className: c, ...i }, a) => /* @__PURE__ */ s("p", { ref: a, className: y(Se.helper, c), ...i, children: e }));
|
|
17
19
|
B.displayName = "HelperText";
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
20
|
+
const R = f(({ children: e, className: c, ...i }, a) => /* @__PURE__ */ s("p", { ref: a, className: y(ke.error, c), role: "alert", "aria-live": "polite", ...i, children: e }));
|
|
21
|
+
R.displayName = "ErrorText";
|
|
22
|
+
const $e = f(
|
|
21
23
|
({
|
|
22
24
|
label: e,
|
|
23
|
-
helper:
|
|
24
|
-
error:
|
|
25
|
-
required:
|
|
26
|
-
disabled:
|
|
27
|
-
readOnly:
|
|
28
|
-
leftIcon:
|
|
29
|
-
rightIcon:
|
|
25
|
+
helper: c,
|
|
26
|
+
error: i,
|
|
27
|
+
required: a = !1,
|
|
28
|
+
disabled: n = !1,
|
|
29
|
+
readOnly: t = !1,
|
|
30
|
+
leftIcon: o,
|
|
31
|
+
rightIcon: r,
|
|
30
32
|
id: l,
|
|
31
|
-
className:
|
|
32
|
-
...
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
disabled:
|
|
36
|
-
hasLeftIcon: !!
|
|
37
|
-
hasRightIcon: !!
|
|
38
|
-
invalid: !!
|
|
39
|
-
readOnly:
|
|
33
|
+
className: d,
|
|
34
|
+
...u
|
|
35
|
+
}, h) => {
|
|
36
|
+
const b = A(), m = l || b, p = c ? `${m}-helper` : void 0, x = i ? `${m}-error` : void 0, C = [p, x].filter(Boolean).join(" "), I = N({
|
|
37
|
+
disabled: n,
|
|
38
|
+
hasLeftIcon: !!o,
|
|
39
|
+
hasRightIcon: !!r,
|
|
40
|
+
invalid: !!i,
|
|
41
|
+
readOnly: t
|
|
40
42
|
});
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
e && /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ g("div", { className: y(G.field, d), children: [
|
|
44
|
+
e && /* @__PURE__ */ s(k, { htmlFor: m, required: a, disabled: n, children: e }),
|
|
45
|
+
/* @__PURE__ */ g("div", { className: G.wrapper, ...I, children: [
|
|
46
|
+
o && /* @__PURE__ */ s("span", { className: G["left-icon"], children: o }),
|
|
47
|
+
/* @__PURE__ */ s(
|
|
46
48
|
"input",
|
|
47
49
|
{
|
|
48
|
-
ref:
|
|
49
|
-
id:
|
|
50
|
+
ref: h,
|
|
51
|
+
id: m,
|
|
50
52
|
type: "text",
|
|
51
|
-
className:
|
|
52
|
-
disabled:
|
|
53
|
-
readOnly:
|
|
54
|
-
required:
|
|
55
|
-
"aria-invalid":
|
|
56
|
-
"aria-disabled":
|
|
57
|
-
"aria-describedby":
|
|
58
|
-
...
|
|
53
|
+
className: G.input,
|
|
54
|
+
disabled: n,
|
|
55
|
+
readOnly: t,
|
|
56
|
+
required: a,
|
|
57
|
+
"aria-invalid": i ? "true" : void 0,
|
|
58
|
+
"aria-disabled": n ? "true" : void 0,
|
|
59
|
+
"aria-describedby": C || void 0,
|
|
60
|
+
...u
|
|
59
61
|
}
|
|
60
62
|
),
|
|
61
|
-
|
|
63
|
+
r && /* @__PURE__ */ s("span", { className: G["right-icon"], children: r })
|
|
62
64
|
] }),
|
|
63
|
-
|
|
64
|
-
!
|
|
65
|
+
i && /* @__PURE__ */ s(R, { id: x, children: i }),
|
|
66
|
+
!i && c && /* @__PURE__ */ s(B, { id: p, children: c })
|
|
65
67
|
] });
|
|
66
68
|
}
|
|
67
69
|
);
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
+
$e.displayName = "TextInput";
|
|
71
|
+
const Ee = f(
|
|
70
72
|
({
|
|
71
73
|
label: e,
|
|
72
|
-
helper:
|
|
73
|
-
error:
|
|
74
|
-
required:
|
|
75
|
-
disabled:
|
|
76
|
-
readOnly:
|
|
77
|
-
resizable:
|
|
78
|
-
minRows:
|
|
74
|
+
helper: c,
|
|
75
|
+
error: i,
|
|
76
|
+
required: a = !1,
|
|
77
|
+
disabled: n = !1,
|
|
78
|
+
readOnly: t = !1,
|
|
79
|
+
resizable: o = !0,
|
|
80
|
+
minRows: r = 3,
|
|
79
81
|
maxRows: l,
|
|
80
|
-
id:
|
|
81
|
-
className:
|
|
82
|
-
...
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
disabled:
|
|
86
|
-
invalid: !!
|
|
87
|
-
readOnly:
|
|
88
|
-
resizable:
|
|
82
|
+
id: d,
|
|
83
|
+
className: u,
|
|
84
|
+
...h
|
|
85
|
+
}, b) => {
|
|
86
|
+
const m = A(), p = d || m, x = c ? `${p}-helper` : void 0, C = i ? `${p}-error` : void 0, I = [x, C].filter(Boolean).join(" "), w = N({
|
|
87
|
+
disabled: n,
|
|
88
|
+
invalid: !!i,
|
|
89
|
+
readOnly: t,
|
|
90
|
+
resizable: o ? "true" : "false",
|
|
89
91
|
minRows: "true",
|
|
90
92
|
...l && { maxRows: "true" }
|
|
91
|
-
}),
|
|
92
|
-
"--_min-rows-count":
|
|
93
|
+
}), O = {
|
|
94
|
+
"--_min-rows-count": r,
|
|
93
95
|
...l && { "--_max-rows-count": l }
|
|
94
96
|
};
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
-
e && /* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ g("div", { className: y(K.field, u), children: [
|
|
98
|
+
e && /* @__PURE__ */ s(k, { htmlFor: p, required: a, disabled: n, children: e }),
|
|
99
|
+
/* @__PURE__ */ s(
|
|
98
100
|
"textarea",
|
|
99
101
|
{
|
|
100
|
-
ref:
|
|
101
|
-
id:
|
|
102
|
-
className:
|
|
103
|
-
disabled:
|
|
104
|
-
readOnly:
|
|
105
|
-
required:
|
|
106
|
-
style:
|
|
107
|
-
"aria-invalid":
|
|
108
|
-
"aria-disabled":
|
|
109
|
-
"aria-describedby":
|
|
110
|
-
...
|
|
111
|
-
...
|
|
102
|
+
ref: b,
|
|
103
|
+
id: p,
|
|
104
|
+
className: K.textarea,
|
|
105
|
+
disabled: n,
|
|
106
|
+
readOnly: t,
|
|
107
|
+
required: a,
|
|
108
|
+
style: O,
|
|
109
|
+
"aria-invalid": i ? "true" : void 0,
|
|
110
|
+
"aria-disabled": n ? "true" : void 0,
|
|
111
|
+
"aria-describedby": I || void 0,
|
|
112
|
+
...w,
|
|
113
|
+
...h
|
|
112
114
|
}
|
|
113
115
|
),
|
|
114
|
-
|
|
115
|
-
!
|
|
116
|
+
i && /* @__PURE__ */ s(R, { id: C, children: i }),
|
|
117
|
+
!i && c && /* @__PURE__ */ s(B, { id: x, children: c })
|
|
116
118
|
] });
|
|
117
119
|
}
|
|
118
120
|
);
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
({ label: e, children:
|
|
121
|
+
Ee.displayName = "TextArea";
|
|
122
|
+
const W = f(({ children: e, ...c }, i) => /* @__PURE__ */ s("option", { ref: i, ...c, children: e }));
|
|
123
|
+
W.displayName = "Select.Option";
|
|
124
|
+
const Y = f(
|
|
125
|
+
({ label: e, children: c, ...i }, a) => /* @__PURE__ */ s("optgroup", { ref: a, label: e, ...i, children: c })
|
|
124
126
|
);
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
+
Y.displayName = "Select.OptionGroup";
|
|
128
|
+
const Z = f(
|
|
127
129
|
({
|
|
128
130
|
label: e,
|
|
129
|
-
helper:
|
|
130
|
-
error:
|
|
131
|
-
required:
|
|
132
|
-
disabled:
|
|
133
|
-
placeholder:
|
|
134
|
-
children:
|
|
135
|
-
id:
|
|
131
|
+
helper: c,
|
|
132
|
+
error: i,
|
|
133
|
+
required: a = !1,
|
|
134
|
+
disabled: n = !1,
|
|
135
|
+
placeholder: t,
|
|
136
|
+
children: o,
|
|
137
|
+
id: r,
|
|
136
138
|
className: l,
|
|
137
|
-
...
|
|
138
|
-
},
|
|
139
|
-
const
|
|
140
|
-
disabled:
|
|
141
|
-
invalid: !!
|
|
139
|
+
...d
|
|
140
|
+
}, u) => {
|
|
141
|
+
const h = A(), b = r || h, m = c ? `${b}-helper` : void 0, p = i ? `${b}-error` : void 0, x = [m, p].filter(Boolean).join(" "), C = N({
|
|
142
|
+
disabled: n,
|
|
143
|
+
invalid: !!i
|
|
142
144
|
});
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
e && /* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ g("div", { className: y(_.field, l), children: [
|
|
146
|
+
e && /* @__PURE__ */ s(k, { htmlFor: b, required: a, disabled: n, children: e }),
|
|
147
|
+
/* @__PURE__ */ g(
|
|
146
148
|
"select",
|
|
147
149
|
{
|
|
148
|
-
ref:
|
|
149
|
-
id:
|
|
150
|
-
className:
|
|
151
|
-
disabled:
|
|
152
|
-
required:
|
|
153
|
-
"aria-invalid":
|
|
154
|
-
"aria-disabled":
|
|
155
|
-
"aria-describedby":
|
|
156
|
-
...
|
|
157
|
-
...
|
|
150
|
+
ref: u,
|
|
151
|
+
id: b,
|
|
152
|
+
className: _.select,
|
|
153
|
+
disabled: n,
|
|
154
|
+
required: a,
|
|
155
|
+
"aria-invalid": i ? "true" : void 0,
|
|
156
|
+
"aria-disabled": n ? "true" : void 0,
|
|
157
|
+
"aria-describedby": x || void 0,
|
|
158
|
+
...C,
|
|
159
|
+
...d,
|
|
158
160
|
children: [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
t && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: t }),
|
|
162
|
+
o
|
|
161
163
|
]
|
|
162
164
|
}
|
|
163
165
|
),
|
|
164
|
-
|
|
165
|
-
!
|
|
166
|
+
i && /* @__PURE__ */ s(R, { id: p, children: i }),
|
|
167
|
+
!i && c && /* @__PURE__ */ s(B, { id: m, children: c })
|
|
166
168
|
] });
|
|
167
169
|
}
|
|
168
170
|
);
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
({ disabled: e = !1, children:
|
|
175
|
-
const
|
|
171
|
+
Z.displayName = "Select";
|
|
172
|
+
const q = Z;
|
|
173
|
+
q.Option = W;
|
|
174
|
+
q.OptionGroup = Y;
|
|
175
|
+
const ee = f(
|
|
176
|
+
({ disabled: e = !1, children: c, className: i, ...a }, n) => {
|
|
177
|
+
const t = N({
|
|
176
178
|
disabled: e
|
|
177
179
|
});
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
ref: a,
|
|
183
|
-
type: "radio",
|
|
184
|
-
className: R.input,
|
|
185
|
-
disabled: e,
|
|
186
|
-
...d
|
|
187
|
-
}
|
|
188
|
-
),
|
|
189
|
-
/* @__PURE__ */ i("span", { className: R.indicator }),
|
|
190
|
-
n && /* @__PURE__ */ i("span", { className: R.label, children: n })
|
|
180
|
+
return /* @__PURE__ */ g("label", { className: y(T.radio, i), ...t, children: [
|
|
181
|
+
/* @__PURE__ */ s("input", { ref: n, type: "radio", className: T.input, disabled: e, ...a }),
|
|
182
|
+
/* @__PURE__ */ s("span", { className: T.indicator }),
|
|
183
|
+
c && /* @__PURE__ */ s("span", { className: T.label, children: c })
|
|
191
184
|
] });
|
|
192
185
|
}
|
|
193
186
|
);
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
({ disabled: e = !1, required:
|
|
197
|
-
const
|
|
187
|
+
ee.displayName = "Radio";
|
|
188
|
+
const te = f(
|
|
189
|
+
({ disabled: e = !1, required: c = !1, children: i, className: a, ...n }, t) => {
|
|
190
|
+
const o = N({
|
|
198
191
|
disabled: e,
|
|
199
|
-
required:
|
|
192
|
+
required: c
|
|
200
193
|
});
|
|
201
|
-
return /* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ g("label", { className: y(j.checkbox, a), ...o, children: [
|
|
195
|
+
/* @__PURE__ */ s(
|
|
203
196
|
"input",
|
|
204
197
|
{
|
|
205
|
-
ref:
|
|
198
|
+
ref: t,
|
|
206
199
|
type: "checkbox",
|
|
207
|
-
className:
|
|
200
|
+
className: j.input,
|
|
208
201
|
disabled: e,
|
|
209
|
-
required:
|
|
210
|
-
"aria-required":
|
|
211
|
-
...
|
|
202
|
+
required: c,
|
|
203
|
+
"aria-required": c || void 0,
|
|
204
|
+
...n
|
|
212
205
|
}
|
|
213
206
|
),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
|
|
207
|
+
/* @__PURE__ */ s("span", { className: j.indicator }),
|
|
208
|
+
i && /* @__PURE__ */ s("span", { className: j.label, "data-required": c || void 0, children: i })
|
|
216
209
|
] });
|
|
217
210
|
}
|
|
218
211
|
);
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
function
|
|
222
|
-
const e =
|
|
212
|
+
te.displayName = "Checkbox";
|
|
213
|
+
const oe = P(void 0);
|
|
214
|
+
function Te() {
|
|
215
|
+
const e = Q(oe);
|
|
223
216
|
if (!e)
|
|
224
217
|
throw new Error("RadioGroup.Option must be used within RadioGroup");
|
|
225
218
|
return e;
|
|
226
219
|
}
|
|
227
|
-
const
|
|
220
|
+
const ne = f(
|
|
228
221
|
({
|
|
229
222
|
value: e,
|
|
230
|
-
onChange:
|
|
231
|
-
name:
|
|
232
|
-
label:
|
|
233
|
-
helper:
|
|
234
|
-
error:
|
|
235
|
-
required:
|
|
236
|
-
disabled:
|
|
223
|
+
onChange: c,
|
|
224
|
+
name: i,
|
|
225
|
+
label: a,
|
|
226
|
+
helper: n,
|
|
227
|
+
error: t,
|
|
228
|
+
required: o = !1,
|
|
229
|
+
disabled: r = !1,
|
|
237
230
|
direction: l = "column",
|
|
238
|
-
children:
|
|
239
|
-
className:
|
|
240
|
-
...
|
|
241
|
-
},
|
|
242
|
-
const
|
|
243
|
-
!
|
|
244
|
-
},
|
|
245
|
-
disabled:
|
|
231
|
+
children: d,
|
|
232
|
+
className: u,
|
|
233
|
+
...h
|
|
234
|
+
}, b) => {
|
|
235
|
+
const m = A(), p = h.id || m, x = n ? `${p}-helper` : void 0, C = t ? `${p}-error` : void 0, I = [x, C].filter(Boolean).join(" "), w = (S) => {
|
|
236
|
+
!r && c && c(S);
|
|
237
|
+
}, O = N({
|
|
238
|
+
disabled: r
|
|
246
239
|
});
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
|
|
249
|
-
/* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ g("div", { ref: b, className: y(X.field, u), ...O, ...h, children: [
|
|
241
|
+
a && /* @__PURE__ */ s(k, { required: o, disabled: r, children: a }),
|
|
242
|
+
/* @__PURE__ */ s(oe.Provider, { value: { disabled: r, name: i, onChange: w, value: e }, children: /* @__PURE__ */ s(
|
|
250
243
|
"div",
|
|
251
244
|
{
|
|
252
|
-
className:
|
|
245
|
+
className: X.options,
|
|
253
246
|
"data-direction": l,
|
|
254
247
|
role: "radiogroup",
|
|
255
|
-
"aria-describedby":
|
|
256
|
-
"aria-invalid":
|
|
257
|
-
children:
|
|
248
|
+
"aria-describedby": I || void 0,
|
|
249
|
+
"aria-invalid": t ? "true" : void 0,
|
|
250
|
+
children: d
|
|
258
251
|
}
|
|
259
252
|
) }),
|
|
260
|
-
|
|
261
|
-
!
|
|
253
|
+
t && /* @__PURE__ */ s(R, { id: C, children: t }),
|
|
254
|
+
!t && n && /* @__PURE__ */ s(B, { id: x, children: n })
|
|
262
255
|
] });
|
|
263
256
|
}
|
|
264
257
|
);
|
|
265
|
-
|
|
266
|
-
const
|
|
267
|
-
({ value: e, children:
|
|
268
|
-
const
|
|
269
|
-
|
|
258
|
+
ne.displayName = "RadioGroup";
|
|
259
|
+
const ie = f(
|
|
260
|
+
({ value: e, children: c, disabled: i, ...a }, n) => {
|
|
261
|
+
const t = Te(), o = t.value === e, r = t.disabled || i, l = () => {
|
|
262
|
+
r || t.onChange(e);
|
|
270
263
|
};
|
|
271
|
-
return /* @__PURE__ */
|
|
272
|
-
|
|
264
|
+
return /* @__PURE__ */ s(
|
|
265
|
+
ee,
|
|
273
266
|
{
|
|
274
|
-
ref:
|
|
275
|
-
name:
|
|
267
|
+
ref: n,
|
|
268
|
+
name: t.name,
|
|
276
269
|
value: e,
|
|
277
|
-
checked:
|
|
278
|
-
disabled:
|
|
270
|
+
checked: o,
|
|
271
|
+
disabled: r,
|
|
279
272
|
onChange: l,
|
|
280
|
-
...
|
|
281
|
-
children:
|
|
273
|
+
...a,
|
|
274
|
+
children: c
|
|
282
275
|
}
|
|
283
276
|
);
|
|
284
277
|
}
|
|
285
278
|
);
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
Option:
|
|
289
|
-
}),
|
|
290
|
-
function
|
|
291
|
-
const e =
|
|
279
|
+
ie.displayName = "RadioGroup.Option";
|
|
280
|
+
const Xe = Object.assign(ne, {
|
|
281
|
+
Option: ie
|
|
282
|
+
}), se = P(void 0);
|
|
283
|
+
function je() {
|
|
284
|
+
const e = Q(se);
|
|
292
285
|
if (!e)
|
|
293
286
|
throw new Error("CheckboxGroup.Option must be used within CheckboxGroup");
|
|
294
287
|
return e;
|
|
295
288
|
}
|
|
296
|
-
const
|
|
289
|
+
const ae = f(
|
|
297
290
|
({
|
|
298
291
|
value: e,
|
|
299
|
-
onChange:
|
|
300
|
-
name:
|
|
301
|
-
label:
|
|
302
|
-
helper:
|
|
303
|
-
error:
|
|
304
|
-
required:
|
|
305
|
-
disabled:
|
|
292
|
+
onChange: c,
|
|
293
|
+
name: i,
|
|
294
|
+
label: a,
|
|
295
|
+
helper: n,
|
|
296
|
+
error: t,
|
|
297
|
+
required: o = !1,
|
|
298
|
+
disabled: r = !1,
|
|
306
299
|
direction: l = "column",
|
|
307
|
-
children:
|
|
308
|
-
className:
|
|
309
|
-
...
|
|
310
|
-
},
|
|
311
|
-
const
|
|
312
|
-
!
|
|
313
|
-
},
|
|
314
|
-
disabled:
|
|
300
|
+
children: d,
|
|
301
|
+
className: u,
|
|
302
|
+
...h
|
|
303
|
+
}, b) => {
|
|
304
|
+
const m = A(), p = h.id || m, x = n ? `${p}-helper` : void 0, C = t ? `${p}-error` : void 0, I = [x, C].filter(Boolean).join(" "), w = (S) => {
|
|
305
|
+
!r && c && c(S);
|
|
306
|
+
}, O = N({
|
|
307
|
+
disabled: r
|
|
315
308
|
});
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ g("div", { ref: b, className: y(J.field, u), ...O, ...h, children: [
|
|
310
|
+
a && /* @__PURE__ */ s(k, { required: o, disabled: r, children: a }),
|
|
311
|
+
/* @__PURE__ */ s(se.Provider, { value: { disabled: r, name: i, onChange: w, value: e }, children: /* @__PURE__ */ s(
|
|
319
312
|
"div",
|
|
320
313
|
{
|
|
321
|
-
className:
|
|
314
|
+
className: J.options,
|
|
322
315
|
"data-direction": l,
|
|
323
316
|
role: "group",
|
|
324
|
-
"aria-describedby":
|
|
325
|
-
"aria-invalid":
|
|
326
|
-
children:
|
|
317
|
+
"aria-describedby": I || void 0,
|
|
318
|
+
"aria-invalid": t ? "true" : void 0,
|
|
319
|
+
children: d
|
|
327
320
|
}
|
|
328
321
|
) }),
|
|
329
|
-
|
|
330
|
-
!
|
|
322
|
+
t && /* @__PURE__ */ s(R, { id: C, children: t }),
|
|
323
|
+
!t && n && /* @__PURE__ */ s(B, { id: x, children: n })
|
|
331
324
|
] });
|
|
332
325
|
}
|
|
333
326
|
);
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
({ value: e, children:
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
339
|
-
const
|
|
340
|
-
|
|
327
|
+
ae.displayName = "CheckboxGroup";
|
|
328
|
+
const ce = f(
|
|
329
|
+
({ value: e, children: c, disabled: i, ...a }, n) => {
|
|
330
|
+
const t = je(), o = t.value.includes(e), r = t.disabled || i, l = () => {
|
|
331
|
+
if (!r) {
|
|
332
|
+
const d = o ? t.value.filter((u) => u !== e) : [...t.value, e];
|
|
333
|
+
t.onChange(d);
|
|
341
334
|
}
|
|
342
335
|
};
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
|
|
336
|
+
return /* @__PURE__ */ s(
|
|
337
|
+
te,
|
|
345
338
|
{
|
|
346
|
-
ref:
|
|
347
|
-
name:
|
|
339
|
+
ref: n,
|
|
340
|
+
name: t.name,
|
|
348
341
|
value: e,
|
|
349
|
-
checked:
|
|
350
|
-
disabled:
|
|
342
|
+
checked: o,
|
|
343
|
+
disabled: r,
|
|
351
344
|
onChange: l,
|
|
352
|
-
...
|
|
353
|
-
children:
|
|
345
|
+
...a,
|
|
346
|
+
children: c
|
|
354
347
|
}
|
|
355
348
|
);
|
|
356
349
|
}
|
|
357
350
|
);
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
Option:
|
|
361
|
-
}),
|
|
362
|
-
function
|
|
363
|
-
const e =
|
|
351
|
+
ce.displayName = "CheckboxGroup.Option";
|
|
352
|
+
const Je = Object.assign(ae, {
|
|
353
|
+
Option: ce
|
|
354
|
+
}), re = P(void 0);
|
|
355
|
+
function Le() {
|
|
356
|
+
const e = Q(re);
|
|
364
357
|
if (!e)
|
|
365
358
|
throw new Error("ChipInput.Option must be used within ChipInput");
|
|
366
359
|
return e;
|
|
367
360
|
}
|
|
368
|
-
const
|
|
361
|
+
const le = f(
|
|
369
362
|
({
|
|
370
363
|
value: e,
|
|
371
|
-
onChange:
|
|
372
|
-
multiple:
|
|
373
|
-
name:
|
|
374
|
-
label:
|
|
375
|
-
helper:
|
|
376
|
-
error:
|
|
377
|
-
required:
|
|
364
|
+
onChange: c,
|
|
365
|
+
multiple: i = !1,
|
|
366
|
+
name: a,
|
|
367
|
+
label: n,
|
|
368
|
+
helper: t,
|
|
369
|
+
error: o,
|
|
370
|
+
required: r = !1,
|
|
378
371
|
disabled: l = !1,
|
|
379
|
-
gap:
|
|
380
|
-
wrap:
|
|
381
|
-
children:
|
|
382
|
-
className:
|
|
383
|
-
...
|
|
384
|
-
},
|
|
385
|
-
const
|
|
386
|
-
l ||
|
|
387
|
-
},
|
|
388
|
-
invalid: !!
|
|
389
|
-
}),
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
|
|
372
|
+
gap: d = "2",
|
|
373
|
+
wrap: u = !0,
|
|
374
|
+
children: h,
|
|
375
|
+
className: b,
|
|
376
|
+
...m
|
|
377
|
+
}, p) => {
|
|
378
|
+
const x = A(), C = m.id || x, I = t ? `${C}-helper` : void 0, w = o ? `${C}-error` : void 0, O = [I, w].filter(Boolean).join(" "), S = (z) => {
|
|
379
|
+
l || c(z);
|
|
380
|
+
}, V = N({
|
|
381
|
+
invalid: !!o
|
|
382
|
+
}), F = i ? "group" : "radiogroup";
|
|
383
|
+
return /* @__PURE__ */ g("div", { ref: p, className: y(M.field, b), ...V, ...m, children: [
|
|
384
|
+
n && /* @__PURE__ */ s(k, { required: r, disabled: l, children: n }),
|
|
385
|
+
/* @__PURE__ */ s(
|
|
386
|
+
re.Provider,
|
|
394
387
|
{
|
|
395
388
|
value: {
|
|
396
389
|
disabled: l,
|
|
397
|
-
multiple:
|
|
398
|
-
name:
|
|
399
|
-
onChange:
|
|
390
|
+
multiple: i,
|
|
391
|
+
name: a,
|
|
392
|
+
onChange: S,
|
|
400
393
|
value: e
|
|
401
394
|
},
|
|
402
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ s(
|
|
403
396
|
"div",
|
|
404
397
|
{
|
|
405
|
-
className:
|
|
406
|
-
"data-gap":
|
|
407
|
-
"data-wrap":
|
|
408
|
-
role:
|
|
409
|
-
"aria-describedby":
|
|
410
|
-
"aria-invalid":
|
|
411
|
-
children:
|
|
398
|
+
className: M.options,
|
|
399
|
+
"data-gap": d,
|
|
400
|
+
"data-wrap": u,
|
|
401
|
+
role: F,
|
|
402
|
+
"aria-describedby": O || void 0,
|
|
403
|
+
"aria-invalid": o ? "true" : void 0,
|
|
404
|
+
children: h
|
|
412
405
|
}
|
|
413
406
|
)
|
|
414
407
|
}
|
|
415
408
|
),
|
|
416
|
-
|
|
417
|
-
!
|
|
409
|
+
o && /* @__PURE__ */ s(R, { id: w, children: o }),
|
|
410
|
+
!o && t && /* @__PURE__ */ s(B, { id: I, children: t })
|
|
418
411
|
] });
|
|
419
412
|
}
|
|
420
413
|
);
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
({ value: e, children:
|
|
424
|
-
const
|
|
425
|
-
let
|
|
426
|
-
|
|
427
|
-
const
|
|
414
|
+
le.displayName = "ChipInput";
|
|
415
|
+
const de = f(
|
|
416
|
+
({ value: e, children: c, disabled: i, iconLeft: a, iconRight: n, ...t }, o) => {
|
|
417
|
+
const r = Le(), l = r.disabled || i, d = !!(a || n);
|
|
418
|
+
let u = !1;
|
|
419
|
+
r.multiple ? u = Array.isArray(r.value) && r.value.includes(e) : u = r.value === e;
|
|
420
|
+
const h = () => {
|
|
428
421
|
if (!l)
|
|
429
|
-
if (
|
|
430
|
-
const
|
|
431
|
-
|
|
422
|
+
if (r.multiple) {
|
|
423
|
+
const m = Array.isArray(r.value) ? r.value : [], p = u ? m.filter((x) => x !== e) : [...m, e];
|
|
424
|
+
r.onChange(p);
|
|
432
425
|
} else
|
|
433
|
-
|
|
434
|
-
},
|
|
426
|
+
r.onChange(e);
|
|
427
|
+
}, b = N({
|
|
435
428
|
disabled: l,
|
|
436
|
-
selected:
|
|
437
|
-
...
|
|
429
|
+
selected: u,
|
|
430
|
+
...d && { "has-icon": !0 }
|
|
438
431
|
});
|
|
439
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ g(
|
|
440
433
|
"button",
|
|
441
434
|
{
|
|
442
|
-
ref:
|
|
435
|
+
ref: o,
|
|
443
436
|
type: "button",
|
|
444
|
-
className:
|
|
445
|
-
onClick:
|
|
437
|
+
className: M.option,
|
|
438
|
+
onClick: h,
|
|
446
439
|
disabled: l,
|
|
447
|
-
"aria-pressed":
|
|
448
|
-
...
|
|
449
|
-
...
|
|
440
|
+
"aria-pressed": u,
|
|
441
|
+
...b,
|
|
442
|
+
...t,
|
|
443
|
+
children: [
|
|
444
|
+
a,
|
|
445
|
+
c,
|
|
446
|
+
n
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
);
|
|
452
|
+
de.displayName = "ChipInput.Option";
|
|
453
|
+
const Ue = Object.assign(le, {
|
|
454
|
+
Option: de
|
|
455
|
+
}), pe = P(void 0);
|
|
456
|
+
function E() {
|
|
457
|
+
const e = Q(pe);
|
|
458
|
+
if (!e)
|
|
459
|
+
throw new Error("ComboboxInput subcomponents must be used within ComboboxInput");
|
|
460
|
+
return e;
|
|
461
|
+
}
|
|
462
|
+
const ue = f(
|
|
463
|
+
({ children: e, className: c, ...i }, a) => {
|
|
464
|
+
const n = E();
|
|
465
|
+
return /* @__PURE__ */ s(U, { open: n.isOpen, onOpenChange: (t) => !t && n.closeListbox(), placement: "right", children: /* @__PURE__ */ s(U.Body, { children: /* @__PURE__ */ g("div", { className: v["drawer-container"], children: [
|
|
466
|
+
/* @__PURE__ */ s("div", { className: v["drawer-input-wrapper"], children: /* @__PURE__ */ s(
|
|
467
|
+
"input",
|
|
468
|
+
{
|
|
469
|
+
type: "text",
|
|
470
|
+
className: v["drawer-input"],
|
|
471
|
+
placeholder: "Search options...",
|
|
472
|
+
value: n.searchQuery || "",
|
|
473
|
+
onChange: (t) => {
|
|
474
|
+
var o;
|
|
475
|
+
return (o = n.setSearchQuery) == null ? void 0 : o.call(n, t.currentTarget.value);
|
|
476
|
+
},
|
|
477
|
+
"aria-label": "Search options"
|
|
478
|
+
}
|
|
479
|
+
) }),
|
|
480
|
+
/* @__PURE__ */ s(
|
|
481
|
+
"ul",
|
|
482
|
+
{
|
|
483
|
+
ref: a,
|
|
484
|
+
role: "listbox",
|
|
485
|
+
"aria-multiselectable": "true",
|
|
486
|
+
className: y(v["drawer-listbox"], c),
|
|
487
|
+
...i,
|
|
488
|
+
children: e
|
|
489
|
+
}
|
|
490
|
+
)
|
|
491
|
+
] }) }) });
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
ue.displayName = "ComboboxInput.Drawer";
|
|
495
|
+
function Pe(e) {
|
|
496
|
+
const [c, i] = D(e), [a, n] = D(!1), [t, o] = D(() => /* @__PURE__ */ new Map());
|
|
497
|
+
$(() => {
|
|
498
|
+
i(e);
|
|
499
|
+
}, [e]);
|
|
500
|
+
const r = L(() => {
|
|
501
|
+
n((h) => !h);
|
|
502
|
+
}, []), l = L(() => {
|
|
503
|
+
n(!1);
|
|
504
|
+
}, []), d = L((h, b) => {
|
|
505
|
+
o((m) => {
|
|
506
|
+
const p = new Map(m);
|
|
507
|
+
return p.set(h, b), p;
|
|
508
|
+
});
|
|
509
|
+
}, []), u = L((h) => {
|
|
510
|
+
o((b) => {
|
|
511
|
+
const m = new Map(b);
|
|
512
|
+
return m.delete(h), m;
|
|
513
|
+
});
|
|
514
|
+
}, []);
|
|
515
|
+
return {
|
|
516
|
+
internalValue: c,
|
|
517
|
+
setInternalValue: i,
|
|
518
|
+
isOpen: a,
|
|
519
|
+
toggleOpen: r,
|
|
520
|
+
closeListbox: l,
|
|
521
|
+
optionRegistry: t,
|
|
522
|
+
registerOption: d,
|
|
523
|
+
unregisterOption: u
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
function Qe(e, c) {
|
|
527
|
+
const [i, a] = D("bottom"), n = Be(null);
|
|
528
|
+
return $(() => {
|
|
529
|
+
if (c !== "popup" || !e) return;
|
|
530
|
+
const t = n.current;
|
|
531
|
+
if (!t) return;
|
|
532
|
+
t.matches(":popover-open") || t.showPopover(), requestAnimationFrame(() => {
|
|
533
|
+
const r = t.previousElementSibling;
|
|
534
|
+
if (!r) return;
|
|
535
|
+
const l = r.getBoundingClientRect(), d = t.getBoundingClientRect(), u = {
|
|
536
|
+
width: d.width,
|
|
537
|
+
height: d.height
|
|
538
|
+
}, h = Re(
|
|
539
|
+
l,
|
|
540
|
+
u,
|
|
541
|
+
100,
|
|
542
|
+
["top", "bottom"]
|
|
543
|
+
);
|
|
544
|
+
a(h);
|
|
545
|
+
});
|
|
546
|
+
}, [e, c]), { internalRef: n, placement: i };
|
|
547
|
+
}
|
|
548
|
+
const he = f(
|
|
549
|
+
({ children: e, className: c, ...i }, a) => {
|
|
550
|
+
const n = E(), { internalRef: t, placement: o } = Qe(n.isOpen, n.variant);
|
|
551
|
+
$(() => {
|
|
552
|
+
const l = t.current;
|
|
553
|
+
if (!l) return;
|
|
554
|
+
const d = () => {
|
|
555
|
+
l.matches(":popover-open") || n.closeListbox();
|
|
556
|
+
};
|
|
557
|
+
return l.addEventListener("toggle", d), () => l.removeEventListener("toggle", d);
|
|
558
|
+
}, [n, t]);
|
|
559
|
+
const r = N({ placement: o });
|
|
560
|
+
return /* @__PURE__ */ s(
|
|
561
|
+
"ul",
|
|
562
|
+
{
|
|
563
|
+
ref: (l) => {
|
|
564
|
+
t.current = l, typeof a == "function" ? a(l) : a && (a.current = l);
|
|
565
|
+
},
|
|
566
|
+
role: "listbox",
|
|
567
|
+
"aria-multiselectable": "true",
|
|
568
|
+
className: y(v.listbox, c),
|
|
569
|
+
popover: "auto",
|
|
570
|
+
...r,
|
|
571
|
+
style: {
|
|
572
|
+
positionAnchor: n.anchorName
|
|
573
|
+
},
|
|
574
|
+
...i,
|
|
575
|
+
children: /* @__PURE__ */ g("div", { className: v["listbox-inner"], children: [
|
|
576
|
+
/* @__PURE__ */ s("div", { className: v["drawer-input-wrapper"], children: /* @__PURE__ */ s(
|
|
577
|
+
"input",
|
|
578
|
+
{
|
|
579
|
+
type: "text",
|
|
580
|
+
className: v["drawer-input"],
|
|
581
|
+
placeholder: "Search options...",
|
|
582
|
+
value: n.searchQuery || "",
|
|
583
|
+
onChange: (l) => {
|
|
584
|
+
var d;
|
|
585
|
+
return (d = n.setSearchQuery) == null ? void 0 : d.call(n, l.currentTarget.value);
|
|
586
|
+
},
|
|
587
|
+
"aria-label": "Search options"
|
|
588
|
+
}
|
|
589
|
+
) }),
|
|
590
|
+
e
|
|
591
|
+
] })
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
);
|
|
596
|
+
he.displayName = "ComboboxInput.Listbox";
|
|
597
|
+
const me = f(
|
|
598
|
+
({
|
|
599
|
+
value: e,
|
|
600
|
+
onChange: c,
|
|
601
|
+
variant: i = "popup",
|
|
602
|
+
disabled: a = !1,
|
|
603
|
+
invalid: n = !1,
|
|
604
|
+
label: t,
|
|
605
|
+
helper: o,
|
|
606
|
+
error: r,
|
|
607
|
+
required: l = !1,
|
|
608
|
+
children: d,
|
|
609
|
+
className: u,
|
|
610
|
+
...h
|
|
611
|
+
}, b) => {
|
|
612
|
+
const m = A(), p = h.id || m, x = o ? `${p}-helper` : void 0, C = r ? `${p}-error` : void 0, I = [x, C].filter(Boolean).join(" "), w = `--combobox-anchor-${p.replace(/[^a-z0-9-]/gi, "")}`, {
|
|
613
|
+
internalValue: O,
|
|
614
|
+
setInternalValue: S,
|
|
615
|
+
isOpen: V,
|
|
616
|
+
toggleOpen: F,
|
|
617
|
+
closeListbox: z,
|
|
618
|
+
optionRegistry: ve,
|
|
619
|
+
registerOption: Ce,
|
|
620
|
+
unregisterOption: ge
|
|
621
|
+
} = Pe(e), [ye, Ne] = D("");
|
|
622
|
+
$(() => {
|
|
623
|
+
S(e);
|
|
624
|
+
}, [e, S]);
|
|
625
|
+
const Ie = (H) => {
|
|
626
|
+
a || (S(H), c(H));
|
|
627
|
+
}, we = N({
|
|
628
|
+
invalid: !!(r || n),
|
|
629
|
+
disabled: a
|
|
630
|
+
});
|
|
631
|
+
return /* @__PURE__ */ g("div", { ref: b, className: y(v.field, u), ...we, ...h, children: [
|
|
632
|
+
t && /* @__PURE__ */ s(k, { required: l, disabled: a, children: t }),
|
|
633
|
+
/* @__PURE__ */ s(
|
|
634
|
+
pe.Provider,
|
|
635
|
+
{
|
|
636
|
+
value: {
|
|
637
|
+
value: O,
|
|
638
|
+
onChange: Ie,
|
|
639
|
+
isOpen: V,
|
|
640
|
+
toggleOpen: F,
|
|
641
|
+
closeListbox: z,
|
|
642
|
+
variant: i,
|
|
643
|
+
anchorName: w,
|
|
644
|
+
optionRegistry: ve,
|
|
645
|
+
registerOption: Ce,
|
|
646
|
+
unregisterOption: ge,
|
|
647
|
+
disabled: a,
|
|
648
|
+
searchQuery: ye,
|
|
649
|
+
setSearchQuery: Ne
|
|
650
|
+
},
|
|
651
|
+
children: /* @__PURE__ */ s("div", { className: v.root, "aria-describedby": I || void 0, children: d })
|
|
652
|
+
}
|
|
653
|
+
),
|
|
654
|
+
r && /* @__PURE__ */ s(R, { id: C, children: r }),
|
|
655
|
+
!r && o && /* @__PURE__ */ s(B, { id: x, children: o })
|
|
656
|
+
] });
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
me.displayName = "ComboboxInput";
|
|
660
|
+
const be = f(
|
|
661
|
+
({ children: e, className: c, iconLeft: i, iconRight: a, ...n }, t) => {
|
|
662
|
+
const o = E(), r = o.value.length === 0, l = N({
|
|
663
|
+
open: o.isOpen,
|
|
664
|
+
disabled: o.disabled,
|
|
665
|
+
"has-left-icon": !!i,
|
|
666
|
+
"has-right-icon": !0
|
|
667
|
+
}), d = {
|
|
668
|
+
anchorName: o.anchorName
|
|
669
|
+
}, u = e || (r ? "Select" : `${o.value.length} selected`);
|
|
670
|
+
return /* @__PURE__ */ g(
|
|
671
|
+
"button",
|
|
672
|
+
{
|
|
673
|
+
ref: t,
|
|
674
|
+
type: "button",
|
|
675
|
+
className: y(v.button, c),
|
|
676
|
+
onClick: () => !o.disabled && o.toggleOpen(),
|
|
677
|
+
disabled: o.disabled,
|
|
678
|
+
"aria-expanded": o.isOpen,
|
|
679
|
+
"aria-haspopup": "listbox",
|
|
680
|
+
style: d,
|
|
681
|
+
...l,
|
|
682
|
+
...n,
|
|
450
683
|
children: [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
a
|
|
684
|
+
i && /* @__PURE__ */ s("span", { className: v["left-icon"], children: i }),
|
|
685
|
+
/* @__PURE__ */ s("span", { className: v["button-content"], ...r && { "data-placeholder": "" }, children: u }),
|
|
686
|
+
a ? /* @__PURE__ */ s("span", { className: v["right-icon"], children: a }) : /* @__PURE__ */ s("span", { className: v["right-icon"], "data-chevron": !0, children: /* @__PURE__ */ s(Ae, {}) })
|
|
454
687
|
]
|
|
455
688
|
}
|
|
456
689
|
);
|
|
457
690
|
}
|
|
458
691
|
);
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
|
|
692
|
+
be.displayName = "ComboboxInput.Button";
|
|
693
|
+
const xe = f(
|
|
694
|
+
({ value: e, children: c, disabled: i = !1, className: a, ...n }, t) => {
|
|
695
|
+
const o = E(), r = o.disabled || i, l = o.value.includes(e), d = typeof c == "string" ? c : String(e), u = !o.searchQuery || d.toLowerCase().includes(o.searchQuery.toLowerCase()) || e.toLowerCase().includes(o.searchQuery.toLowerCase());
|
|
696
|
+
$(() => (o.registerOption(e, d), () => o.unregisterOption(e)), [e, d, o.registerOption, o.unregisterOption]);
|
|
697
|
+
const h = () => {
|
|
698
|
+
if (r) return;
|
|
699
|
+
const p = l ? o.value.filter((x) => x !== e) : [...o.value, e];
|
|
700
|
+
o.onChange(p);
|
|
701
|
+
}, b = (p) => {
|
|
702
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), h());
|
|
703
|
+
}, m = N({ selected: l, disabled: r });
|
|
704
|
+
return u ? /* @__PURE__ */ g(
|
|
705
|
+
"li",
|
|
706
|
+
{
|
|
707
|
+
ref: t,
|
|
708
|
+
role: "option",
|
|
709
|
+
className: y(v.option, a),
|
|
710
|
+
onClick: h,
|
|
711
|
+
onKeyDown: b,
|
|
712
|
+
"aria-selected": l,
|
|
713
|
+
tabIndex: r ? -1 : 0,
|
|
714
|
+
...m,
|
|
715
|
+
...n,
|
|
716
|
+
children: [
|
|
717
|
+
/* @__PURE__ */ s("span", { className: v["option-check"], children: /* @__PURE__ */ s(Ge, { width: "1em", height: "1em" }) }),
|
|
718
|
+
/* @__PURE__ */ s("span", { children: c })
|
|
719
|
+
]
|
|
720
|
+
}
|
|
721
|
+
) : null;
|
|
722
|
+
}
|
|
723
|
+
);
|
|
724
|
+
xe.displayName = "ComboboxInput.Option";
|
|
725
|
+
const fe = f(
|
|
726
|
+
({ className: e, ...c }, i) => {
|
|
727
|
+
const a = E();
|
|
728
|
+
if (a.value.length === 0) return null;
|
|
729
|
+
const n = (t) => {
|
|
730
|
+
a.onChange(a.value.filter((o) => o !== t));
|
|
731
|
+
};
|
|
732
|
+
return /* @__PURE__ */ s("div", { ref: i, className: y(v.chips, e), role: "group", ...c, children: a.value.map((t) => {
|
|
733
|
+
const o = a.optionRegistry.get(t) ?? t;
|
|
734
|
+
return /* @__PURE__ */ g("div", { className: v.chip, ...N({ disabled: a.disabled }), children: [
|
|
735
|
+
/* @__PURE__ */ s("span", { children: o }),
|
|
736
|
+
/* @__PURE__ */ s(
|
|
737
|
+
"button",
|
|
738
|
+
{
|
|
739
|
+
type: "button",
|
|
740
|
+
className: v["chip-remove"],
|
|
741
|
+
onClick: () => n(t),
|
|
742
|
+
disabled: a.disabled,
|
|
743
|
+
"aria-label": `Remove ${o}`,
|
|
744
|
+
children: /* @__PURE__ */ s(De, { width: "1em", height: "1em" })
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
] }, t);
|
|
748
|
+
}) });
|
|
749
|
+
}
|
|
750
|
+
);
|
|
751
|
+
fe.displayName = "ComboboxInput.SelectionChips";
|
|
752
|
+
const We = Object.assign(me, {
|
|
753
|
+
Button: be,
|
|
754
|
+
Listbox: he,
|
|
755
|
+
Drawer: ue,
|
|
756
|
+
Option: xe,
|
|
757
|
+
SelectionChips: fe
|
|
462
758
|
});
|
|
463
759
|
export {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
760
|
+
te as Checkbox,
|
|
761
|
+
Je as CheckboxGroup,
|
|
762
|
+
Ue as ChipInput,
|
|
763
|
+
We as ComboboxInput,
|
|
764
|
+
R as ErrorText,
|
|
468
765
|
B as HelperText,
|
|
469
766
|
k as Label,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
767
|
+
ee as Radio,
|
|
768
|
+
Xe as RadioGroup,
|
|
769
|
+
q as Select,
|
|
770
|
+
Ee as TextArea,
|
|
771
|
+
$e as TextInput
|
|
475
772
|
};
|