@still-forest/canopy 0.41.0 → 0.41.2
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/chunks/{Switch-CPNkbAg3.js → Switch-BoWnMtmg.js} +776 -759
- package/dist/forms.d.ts +2 -1
- package/dist/forms.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-B0GD0xBr.js";
|
|
2
|
-
import { e as Q, J as ve, aa as dt, K as te, M as
|
|
2
|
+
import { e as Q, J as ve, aa as dt, K as te, M as j, U as P, ab as V, G as Me, H as de, ac as yt, B as Ae, Q as Ct, ad as De, L as ue, ae as It, af as Rt, ag as kt, ah as ar, b as Oe, c as Pe, ai as Et, aj as sr, ak as ir, al as re, am as cr, an as lr, ao as dr, ap as ur, aq as pr, ar as fr, as as mr, at as hr, au as vr, av as gr, aw as _t, R as xr, P as br, O as Sr, w as wr, ax as Re, ay as yr } from "./sidebar-5TOTH-eb.js";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { useState as ke, useEffect as jt, useRef as
|
|
5
|
-
import { F as pe, G as
|
|
6
|
-
import { T as
|
|
7
|
-
import { L as
|
|
8
|
-
import { c as
|
|
9
|
-
import * as
|
|
4
|
+
import { useState as ke, useEffect as jt, useRef as Cr, useMemo as Ir, useId as Rr } from "react";
|
|
5
|
+
import { F as pe, G as kr } from "./Layout-CvVv48kM.js";
|
|
6
|
+
import { T as Pt } from "./Heading-DjVutKs1.js";
|
|
7
|
+
import { L as Er } from "./Loader-DW_x9PM7.js";
|
|
8
|
+
import { c as L } from "./index-CRiPKpXj.js";
|
|
9
|
+
import * as Nt from "react-dom";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.544.0 - ISC
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the ISC license.
|
|
14
14
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
const
|
|
16
|
+
const _r = [
|
|
17
17
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
18
18
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
19
19
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
20
20
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
21
|
-
],
|
|
21
|
+
], jr = Q("calendar", _r);
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.544.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const Pr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], ut = Q("check", Pr);
|
|
29
29
|
/**
|
|
30
30
|
* @license lucide-react v0.544.0 - ISC
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const Nr = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], Tr = Q("chevron-up", Nr);
|
|
36
36
|
/**
|
|
37
37
|
* @license lucide-react v0.544.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
const
|
|
42
|
+
const Mr = [
|
|
43
43
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
44
44
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
45
|
-
],
|
|
45
|
+
], Ar = Q("chevrons-up-down", Mr);
|
|
46
46
|
/**
|
|
47
47
|
* @license lucide-react v0.544.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
51
|
*/
|
|
52
|
-
const
|
|
52
|
+
const Dr = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], Or = Q("circle", Dr);
|
|
53
53
|
/**
|
|
54
54
|
* @license lucide-react v0.544.0 - ISC
|
|
55
55
|
*
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
58
|
*/
|
|
59
|
-
const
|
|
59
|
+
const Lr = [
|
|
60
60
|
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
|
|
61
61
|
[
|
|
62
62
|
"path",
|
|
@@ -66,14 +66,14 @@ const Dr = [
|
|
|
66
66
|
}
|
|
67
67
|
],
|
|
68
68
|
["path", { d: "m9 14 2 2 4-4", key: "df797q" }]
|
|
69
|
-
],
|
|
69
|
+
], Fr = Q("clipboard-check", Lr);
|
|
70
70
|
/**
|
|
71
71
|
* @license lucide-react v0.544.0 - ISC
|
|
72
72
|
*
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
75
|
*/
|
|
76
|
-
const
|
|
76
|
+
const Br = [
|
|
77
77
|
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
|
|
78
78
|
[
|
|
79
79
|
"path",
|
|
@@ -82,14 +82,14 @@ const Lr = [
|
|
|
82
82
|
key: "116196"
|
|
83
83
|
}
|
|
84
84
|
]
|
|
85
|
-
],
|
|
85
|
+
], $r = Q("clipboard", Br);
|
|
86
86
|
/**
|
|
87
87
|
* @license lucide-react v0.544.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
91
|
*/
|
|
92
|
-
const
|
|
92
|
+
const Vr = [
|
|
93
93
|
[
|
|
94
94
|
"path",
|
|
95
95
|
{
|
|
@@ -106,14 +106,14 @@ const Fr = [
|
|
|
106
106
|
}
|
|
107
107
|
],
|
|
108
108
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
109
|
-
],
|
|
109
|
+
], Kr = Q("eye-off", Vr);
|
|
110
110
|
/**
|
|
111
111
|
* @license lucide-react v0.544.0 - ISC
|
|
112
112
|
*
|
|
113
113
|
* This source code is licensed under the ISC license.
|
|
114
114
|
* See the LICENSE file in the root directory of this source tree.
|
|
115
115
|
*/
|
|
116
|
-
const
|
|
116
|
+
const Hr = [
|
|
117
117
|
[
|
|
118
118
|
"path",
|
|
119
119
|
{
|
|
@@ -122,14 +122,14 @@ const Vr = [
|
|
|
122
122
|
}
|
|
123
123
|
],
|
|
124
124
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
125
|
-
],
|
|
125
|
+
], Ur = Q("eye", Hr);
|
|
126
126
|
/**
|
|
127
127
|
* @license lucide-react v0.544.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
131
|
*/
|
|
132
|
-
const
|
|
132
|
+
const Gr = [
|
|
133
133
|
[
|
|
134
134
|
"path",
|
|
135
135
|
{
|
|
@@ -139,24 +139,24 @@ const Hr = [
|
|
|
139
139
|
],
|
|
140
140
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
141
141
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
142
|
-
],
|
|
142
|
+
], zr = Q("save", Gr);
|
|
143
143
|
/**
|
|
144
144
|
* @license lucide-react v0.544.0 - ISC
|
|
145
145
|
*
|
|
146
146
|
* This source code is licensed under the ISC license.
|
|
147
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
148
148
|
*/
|
|
149
|
-
const
|
|
149
|
+
const Wr = [
|
|
150
150
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
151
151
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
152
|
-
],
|
|
152
|
+
], qr = Q("search", Wr);
|
|
153
153
|
/**
|
|
154
154
|
* @license lucide-react v0.544.0 - ISC
|
|
155
155
|
*
|
|
156
156
|
* This source code is licensed under the ISC license.
|
|
157
157
|
* See the LICENSE file in the root directory of this source tree.
|
|
158
158
|
*/
|
|
159
|
-
const
|
|
159
|
+
const Yr = [
|
|
160
160
|
[
|
|
161
161
|
"path",
|
|
162
162
|
{
|
|
@@ -165,28 +165,28 @@ const Wr = [
|
|
|
165
165
|
}
|
|
166
166
|
],
|
|
167
167
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
168
|
-
], qe = Q("send",
|
|
168
|
+
], qe = Q("send", Yr);
|
|
169
169
|
/**
|
|
170
170
|
* @license lucide-react v0.544.0 - ISC
|
|
171
171
|
*
|
|
172
172
|
* This source code is licensed under the ISC license.
|
|
173
173
|
* See the LICENSE file in the root directory of this source tree.
|
|
174
174
|
*/
|
|
175
|
-
const
|
|
175
|
+
const Xr = [
|
|
176
176
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
177
177
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
178
178
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
179
179
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
180
180
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
181
|
-
],
|
|
182
|
-
var Ye = "rovingFocusGroup.onEntryFocus",
|
|
181
|
+
], Zr = Q("trash-2", Xr);
|
|
182
|
+
var Ye = "rovingFocusGroup.onEntryFocus", Jr = { bubbles: !1, cancelable: !0 }, Ee = "RovingFocusGroup", [Qe, Tt, Qr] = dt(Ee), [eo, Mt] = ve(
|
|
183
183
|
Ee,
|
|
184
|
-
[
|
|
185
|
-
), [
|
|
186
|
-
(e, n) => /* @__PURE__ */ a.jsx(Qe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a.jsx(Qe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a.jsx(
|
|
184
|
+
[Qr]
|
|
185
|
+
), [to, no] = eo(Ee), At = c.forwardRef(
|
|
186
|
+
(e, n) => /* @__PURE__ */ a.jsx(Qe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a.jsx(Qe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ a.jsx(ro, { ...e, ref: n }) }) })
|
|
187
187
|
);
|
|
188
|
-
|
|
189
|
-
var
|
|
188
|
+
At.displayName = Ee;
|
|
189
|
+
var ro = c.forwardRef((e, n) => {
|
|
190
190
|
const {
|
|
191
191
|
__scopeRovingFocusGroup: t,
|
|
192
192
|
orientation: o,
|
|
@@ -196,20 +196,20 @@ var to = c.forwardRef((e, n) => {
|
|
|
196
196
|
defaultCurrentTabStopId: l,
|
|
197
197
|
onCurrentTabStopIdChange: d,
|
|
198
198
|
onEntryFocus: u,
|
|
199
|
-
preventScrollOnEntryFocus:
|
|
200
|
-
...
|
|
201
|
-
} = e, g = c.useRef(null), x = V(n, g), S = Me(i), [m,
|
|
199
|
+
preventScrollOnEntryFocus: f = !1,
|
|
200
|
+
...p
|
|
201
|
+
} = e, g = c.useRef(null), x = V(n, g), S = Me(i), [m, h] = de({
|
|
202
202
|
prop: s,
|
|
203
203
|
defaultProp: l ?? null,
|
|
204
204
|
onChange: d,
|
|
205
205
|
caller: Ee
|
|
206
|
-
}), [b, w] = c.useState(!1), y =
|
|
206
|
+
}), [b, w] = c.useState(!1), y = yt(u), R = Tt(t), A = c.useRef(!1), [N, _] = c.useState(0);
|
|
207
207
|
return c.useEffect(() => {
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
return
|
|
208
|
+
const F = g.current;
|
|
209
|
+
if (F)
|
|
210
|
+
return F.addEventListener(Ye, y), () => F.removeEventListener(Ye, y);
|
|
211
211
|
}, [y]), /* @__PURE__ */ a.jsx(
|
|
212
|
-
|
|
212
|
+
to,
|
|
213
213
|
{
|
|
214
214
|
scope: t,
|
|
215
215
|
orientation: o,
|
|
@@ -217,38 +217,38 @@ var to = c.forwardRef((e, n) => {
|
|
|
217
217
|
loop: r,
|
|
218
218
|
currentTabStopId: m,
|
|
219
219
|
onItemFocus: c.useCallback(
|
|
220
|
-
(
|
|
221
|
-
[
|
|
220
|
+
(F) => h(F),
|
|
221
|
+
[h]
|
|
222
222
|
),
|
|
223
223
|
onItemShiftTab: c.useCallback(() => w(!0), []),
|
|
224
224
|
onFocusableItemAdd: c.useCallback(
|
|
225
|
-
() =>
|
|
225
|
+
() => _((F) => F + 1),
|
|
226
226
|
[]
|
|
227
227
|
),
|
|
228
228
|
onFocusableItemRemove: c.useCallback(
|
|
229
|
-
() =>
|
|
229
|
+
() => _((F) => F - 1),
|
|
230
230
|
[]
|
|
231
231
|
),
|
|
232
232
|
children: /* @__PURE__ */ a.jsx(
|
|
233
|
-
|
|
233
|
+
j.div,
|
|
234
234
|
{
|
|
235
235
|
tabIndex: b || N === 0 ? -1 : 0,
|
|
236
236
|
"data-orientation": o,
|
|
237
|
-
...
|
|
237
|
+
...p,
|
|
238
238
|
ref: x,
|
|
239
239
|
style: { outline: "none", ...e.style },
|
|
240
240
|
onMouseDown: P(e.onMouseDown, () => {
|
|
241
241
|
A.current = !0;
|
|
242
242
|
}),
|
|
243
|
-
onFocus: P(e.onFocus, (
|
|
243
|
+
onFocus: P(e.onFocus, (F) => {
|
|
244
244
|
const Z = !A.current;
|
|
245
|
-
if (
|
|
246
|
-
const z = new CustomEvent(Ye,
|
|
247
|
-
if (
|
|
245
|
+
if (F.target === F.currentTarget && Z && !b) {
|
|
246
|
+
const z = new CustomEvent(Ye, Jr);
|
|
247
|
+
if (F.currentTarget.dispatchEvent(z), !z.defaultPrevented) {
|
|
248
248
|
const D = R().filter((O) => O.focusable), K = D.find((O) => O.active), X = D.find((O) => O.id === m), U = [K, X, ...D].filter(
|
|
249
249
|
Boolean
|
|
250
250
|
).map((O) => O.ref.current);
|
|
251
|
-
|
|
251
|
+
Lt(U, f);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
A.current = !1;
|
|
@@ -258,7 +258,7 @@ var to = c.forwardRef((e, n) => {
|
|
|
258
258
|
)
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
}),
|
|
261
|
+
}), Dt = "RovingFocusGroupItem", Ot = c.forwardRef(
|
|
262
262
|
(e, n) => {
|
|
263
263
|
const {
|
|
264
264
|
__scopeRovingFocusGroup: t,
|
|
@@ -267,7 +267,7 @@ var to = c.forwardRef((e, n) => {
|
|
|
267
267
|
tabStopId: i,
|
|
268
268
|
children: s,
|
|
269
269
|
...l
|
|
270
|
-
} = e, d = te(), u = i || d,
|
|
270
|
+
} = e, d = te(), u = i || d, f = no(Dt, t), p = f.currentTabStopId === u, g = Tt(t), { onFocusableItemAdd: x, onFocusableItemRemove: S, currentTabStopId: m } = f;
|
|
271
271
|
return c.useEffect(() => {
|
|
272
272
|
if (o)
|
|
273
273
|
return x(), () => S();
|
|
@@ -279,45 +279,45 @@ var to = c.forwardRef((e, n) => {
|
|
|
279
279
|
focusable: o,
|
|
280
280
|
active: r,
|
|
281
281
|
children: /* @__PURE__ */ a.jsx(
|
|
282
|
-
|
|
282
|
+
j.span,
|
|
283
283
|
{
|
|
284
|
-
tabIndex:
|
|
285
|
-
"data-orientation":
|
|
284
|
+
tabIndex: p ? 0 : -1,
|
|
285
|
+
"data-orientation": f.orientation,
|
|
286
286
|
...l,
|
|
287
287
|
ref: n,
|
|
288
|
-
onMouseDown: P(e.onMouseDown, (
|
|
289
|
-
o ?
|
|
288
|
+
onMouseDown: P(e.onMouseDown, (h) => {
|
|
289
|
+
o ? f.onItemFocus(u) : h.preventDefault();
|
|
290
290
|
}),
|
|
291
|
-
onFocus: P(e.onFocus, () =>
|
|
292
|
-
onKeyDown: P(e.onKeyDown, (
|
|
293
|
-
if (
|
|
294
|
-
|
|
291
|
+
onFocus: P(e.onFocus, () => f.onItemFocus(u)),
|
|
292
|
+
onKeyDown: P(e.onKeyDown, (h) => {
|
|
293
|
+
if (h.key === "Tab" && h.shiftKey) {
|
|
294
|
+
f.onItemShiftTab();
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
if (
|
|
298
|
-
const b =
|
|
297
|
+
if (h.target !== h.currentTarget) return;
|
|
298
|
+
const b = so(h, f.orientation, f.dir);
|
|
299
299
|
if (b !== void 0) {
|
|
300
|
-
if (
|
|
301
|
-
|
|
300
|
+
if (h.metaKey || h.ctrlKey || h.altKey || h.shiftKey) return;
|
|
301
|
+
h.preventDefault();
|
|
302
302
|
let y = g().filter((R) => R.focusable).map((R) => R.ref.current);
|
|
303
303
|
if (b === "last") y.reverse();
|
|
304
304
|
else if (b === "prev" || b === "next") {
|
|
305
305
|
b === "prev" && y.reverse();
|
|
306
|
-
const R = y.indexOf(
|
|
307
|
-
y =
|
|
306
|
+
const R = y.indexOf(h.currentTarget);
|
|
307
|
+
y = f.loop ? io(y, R + 1) : y.slice(R + 1);
|
|
308
308
|
}
|
|
309
|
-
setTimeout(() =>
|
|
309
|
+
setTimeout(() => Lt(y));
|
|
310
310
|
}
|
|
311
311
|
}),
|
|
312
|
-
children: typeof s == "function" ? s({ isCurrentTabStop:
|
|
312
|
+
children: typeof s == "function" ? s({ isCurrentTabStop: p, hasTabStop: m != null }) : s
|
|
313
313
|
}
|
|
314
314
|
)
|
|
315
315
|
}
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
318
|
);
|
|
319
|
-
|
|
320
|
-
var
|
|
319
|
+
Ot.displayName = Dt;
|
|
320
|
+
var oo = {
|
|
321
321
|
ArrowLeft: "prev",
|
|
322
322
|
ArrowUp: "prev",
|
|
323
323
|
ArrowRight: "next",
|
|
@@ -327,28 +327,28 @@ var no = {
|
|
|
327
327
|
PageDown: "last",
|
|
328
328
|
End: "last"
|
|
329
329
|
};
|
|
330
|
-
function
|
|
330
|
+
function ao(e, n) {
|
|
331
331
|
return n !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const o =
|
|
333
|
+
function so(e, n, t) {
|
|
334
|
+
const o = ao(e.key, t);
|
|
335
335
|
if (!(n === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(n === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
336
|
-
return
|
|
336
|
+
return oo[o];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Lt(e, n = !1) {
|
|
339
339
|
const t = document.activeElement;
|
|
340
340
|
for (const o of e)
|
|
341
341
|
if (o === t || (o.focus({ preventScroll: n }), document.activeElement !== t)) return;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function io(e, n) {
|
|
344
344
|
return e.map((t, o) => e[(n + o) % e.length]);
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
const
|
|
346
|
+
var co = At, lo = Ot;
|
|
347
|
+
const Ps = ({ disabled: e = !1, handleDelete: n, ...t }) => /* @__PURE__ */ a.jsx(
|
|
348
348
|
Ae,
|
|
349
349
|
{
|
|
350
350
|
disabled: e,
|
|
351
|
-
icon: /* @__PURE__ */ a.jsx(
|
|
351
|
+
icon: /* @__PURE__ */ a.jsx(Zr, {}),
|
|
352
352
|
onClick: n,
|
|
353
353
|
variant: "outline",
|
|
354
354
|
...t,
|
|
@@ -358,9 +358,9 @@ const js = ({ disabled: e = !1, handleDelete: n, ...t }) => /* @__PURE__ */ a.js
|
|
|
358
358
|
), gt = {
|
|
359
359
|
default: { label: "Submit", submittingLabel: "Submitting", IconComponent: qe },
|
|
360
360
|
submit: { label: "Submit", submittingLabel: "Submitting", IconComponent: qe },
|
|
361
|
-
save: { label: "Save", submittingLabel: "Saving", IconComponent:
|
|
361
|
+
save: { label: "Save", submittingLabel: "Saving", IconComponent: zr },
|
|
362
362
|
send: { label: "Send", submittingLabel: "Sending", IconComponent: qe }
|
|
363
|
-
},
|
|
363
|
+
}, Ns = ({
|
|
364
364
|
submitting: e = !1,
|
|
365
365
|
disabled: n = !1,
|
|
366
366
|
submittingIcon: t,
|
|
@@ -373,7 +373,7 @@ const js = ({ disabled: e = !1, handleDelete: n, ...t }) => /* @__PURE__ */ a.js
|
|
|
373
373
|
}) => {
|
|
374
374
|
if (!gt[o])
|
|
375
375
|
throw new Error(`Invalid action: ${o}`);
|
|
376
|
-
const u = gt[o],
|
|
376
|
+
const u = gt[o], f = r || u.label, p = i || u.submittingLabel, g = s || u.IconComponent, x = e ? /* @__PURE__ */ a.jsx(Er, { icon: t }) : /* @__PURE__ */ a.jsx(g, {});
|
|
377
377
|
return /* @__PURE__ */ a.jsx(
|
|
378
378
|
Ae,
|
|
379
379
|
{
|
|
@@ -382,16 +382,16 @@ const js = ({ disabled: e = !1, handleDelete: n, ...t }) => /* @__PURE__ */ a.js
|
|
|
382
382
|
type: "submit",
|
|
383
383
|
variant: "primary",
|
|
384
384
|
...d,
|
|
385
|
-
children: e ?
|
|
385
|
+
children: e ? p : f
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
388
|
};
|
|
389
|
-
function
|
|
389
|
+
function _e(e) {
|
|
390
390
|
const n = c.useRef({ value: e, previous: e });
|
|
391
391
|
return c.useMemo(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [e]);
|
|
392
392
|
}
|
|
393
|
-
var Le = "Checkbox", [
|
|
394
|
-
function
|
|
393
|
+
var Le = "Checkbox", [uo, Ts] = ve(Le), [po, pt] = uo(Le);
|
|
394
|
+
function fo(e) {
|
|
395
395
|
const {
|
|
396
396
|
__scopeCheckbox: n,
|
|
397
397
|
checked: t,
|
|
@@ -402,15 +402,15 @@ function uo(e) {
|
|
|
402
402
|
name: l,
|
|
403
403
|
onCheckedChange: d,
|
|
404
404
|
required: u,
|
|
405
|
-
value:
|
|
405
|
+
value: f = "on",
|
|
406
406
|
// @ts-expect-error
|
|
407
|
-
internal_do_not_use_render:
|
|
407
|
+
internal_do_not_use_render: p
|
|
408
408
|
} = e, [g, x] = de({
|
|
409
409
|
prop: t,
|
|
410
410
|
defaultProp: r ?? !1,
|
|
411
411
|
onChange: d,
|
|
412
412
|
caller: Le
|
|
413
|
-
}), [S, m] = c.useState(null), [
|
|
413
|
+
}), [S, m] = c.useState(null), [h, b] = c.useState(null), w = c.useRef(!1), y = S ? !!s || !!S.closest("form") : (
|
|
414
414
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
415
415
|
!0
|
|
416
416
|
), R = {
|
|
@@ -421,24 +421,24 @@ function uo(e) {
|
|
|
421
421
|
setControl: m,
|
|
422
422
|
name: l,
|
|
423
423
|
form: s,
|
|
424
|
-
value:
|
|
424
|
+
value: f,
|
|
425
425
|
hasConsumerStoppedPropagationRef: w,
|
|
426
426
|
required: u,
|
|
427
427
|
defaultChecked: ne(r) ? !1 : r,
|
|
428
428
|
isFormControl: y,
|
|
429
|
-
bubbleInput:
|
|
429
|
+
bubbleInput: h,
|
|
430
430
|
setBubbleInput: b
|
|
431
431
|
};
|
|
432
432
|
return /* @__PURE__ */ a.jsx(
|
|
433
|
-
|
|
433
|
+
po,
|
|
434
434
|
{
|
|
435
435
|
scope: n,
|
|
436
436
|
...R,
|
|
437
|
-
children:
|
|
437
|
+
children: mo(p) ? p(R) : o
|
|
438
438
|
}
|
|
439
439
|
);
|
|
440
440
|
}
|
|
441
|
-
var
|
|
441
|
+
var Ft = "CheckboxTrigger", Bt = c.forwardRef(
|
|
442
442
|
({ __scopeCheckbox: e, onKeyDown: n, onClick: t, ...o }, r) => {
|
|
443
443
|
const {
|
|
444
444
|
control: i,
|
|
@@ -446,26 +446,26 @@ var Lt = "CheckboxTrigger", Bt = c.forwardRef(
|
|
|
446
446
|
disabled: l,
|
|
447
447
|
checked: d,
|
|
448
448
|
required: u,
|
|
449
|
-
setControl:
|
|
450
|
-
setChecked:
|
|
449
|
+
setControl: f,
|
|
450
|
+
setChecked: p,
|
|
451
451
|
hasConsumerStoppedPropagationRef: g,
|
|
452
452
|
isFormControl: x,
|
|
453
453
|
bubbleInput: S
|
|
454
|
-
} = pt(
|
|
454
|
+
} = pt(Ft, e), m = V(r, f), h = c.useRef(d);
|
|
455
455
|
return c.useEffect(() => {
|
|
456
456
|
const b = i?.form;
|
|
457
457
|
if (b) {
|
|
458
|
-
const w = () =>
|
|
458
|
+
const w = () => p(h.current);
|
|
459
459
|
return b.addEventListener("reset", w), () => b.removeEventListener("reset", w);
|
|
460
460
|
}
|
|
461
|
-
}, [i,
|
|
462
|
-
|
|
461
|
+
}, [i, p]), /* @__PURE__ */ a.jsx(
|
|
462
|
+
j.button,
|
|
463
463
|
{
|
|
464
464
|
type: "button",
|
|
465
465
|
role: "checkbox",
|
|
466
466
|
"aria-checked": ne(d) ? "mixed" : d,
|
|
467
467
|
"aria-required": u,
|
|
468
|
-
"data-state":
|
|
468
|
+
"data-state": Gt(d),
|
|
469
469
|
"data-disabled": l ? "" : void 0,
|
|
470
470
|
disabled: l,
|
|
471
471
|
value: s,
|
|
@@ -475,14 +475,14 @@ var Lt = "CheckboxTrigger", Bt = c.forwardRef(
|
|
|
475
475
|
b.key === "Enter" && b.preventDefault();
|
|
476
476
|
}),
|
|
477
477
|
onClick: P(t, (b) => {
|
|
478
|
-
|
|
478
|
+
p((w) => ne(w) ? !0 : !w), S && x && (g.current = b.isPropagationStopped(), g.current || b.stopPropagation());
|
|
479
479
|
})
|
|
480
480
|
}
|
|
481
481
|
);
|
|
482
482
|
}
|
|
483
483
|
);
|
|
484
|
-
Bt.displayName =
|
|
485
|
-
var
|
|
484
|
+
Bt.displayName = Ft;
|
|
485
|
+
var $t = c.forwardRef(
|
|
486
486
|
(e, n) => {
|
|
487
487
|
const {
|
|
488
488
|
__scopeCheckbox: t,
|
|
@@ -493,11 +493,11 @@ var Ft = c.forwardRef(
|
|
|
493
493
|
disabled: l,
|
|
494
494
|
value: d,
|
|
495
495
|
onCheckedChange: u,
|
|
496
|
-
form:
|
|
497
|
-
...
|
|
496
|
+
form: f,
|
|
497
|
+
...p
|
|
498
498
|
} = e;
|
|
499
499
|
return /* @__PURE__ */ a.jsx(
|
|
500
|
-
|
|
500
|
+
fo,
|
|
501
501
|
{
|
|
502
502
|
__scopeCheckbox: t,
|
|
503
503
|
checked: r,
|
|
@@ -506,19 +506,19 @@ var Ft = c.forwardRef(
|
|
|
506
506
|
required: s,
|
|
507
507
|
onCheckedChange: u,
|
|
508
508
|
name: o,
|
|
509
|
-
form:
|
|
509
|
+
form: f,
|
|
510
510
|
value: d,
|
|
511
511
|
internal_do_not_use_render: ({ isFormControl: g }) => /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
512
512
|
/* @__PURE__ */ a.jsx(
|
|
513
513
|
Bt,
|
|
514
514
|
{
|
|
515
|
-
...
|
|
515
|
+
...p,
|
|
516
516
|
ref: n,
|
|
517
517
|
__scopeCheckbox: t
|
|
518
518
|
}
|
|
519
519
|
),
|
|
520
520
|
g && /* @__PURE__ */ a.jsx(
|
|
521
|
-
|
|
521
|
+
Ut,
|
|
522
522
|
{
|
|
523
523
|
__scopeCheckbox: t
|
|
524
524
|
}
|
|
@@ -528,18 +528,18 @@ var Ft = c.forwardRef(
|
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
530
|
);
|
|
531
|
-
|
|
532
|
-
var
|
|
531
|
+
$t.displayName = Le;
|
|
532
|
+
var Vt = "CheckboxIndicator", Kt = c.forwardRef(
|
|
533
533
|
(e, n) => {
|
|
534
|
-
const { __scopeCheckbox: t, forceMount: o, ...r } = e, i = pt(
|
|
534
|
+
const { __scopeCheckbox: t, forceMount: o, ...r } = e, i = pt(Vt, t);
|
|
535
535
|
return /* @__PURE__ */ a.jsx(
|
|
536
|
-
|
|
536
|
+
Ct,
|
|
537
537
|
{
|
|
538
538
|
present: o || ne(i.checked) || i.checked === !0,
|
|
539
539
|
children: /* @__PURE__ */ a.jsx(
|
|
540
|
-
|
|
540
|
+
j.span,
|
|
541
541
|
{
|
|
542
|
-
"data-state":
|
|
542
|
+
"data-state": Gt(i.checked),
|
|
543
543
|
"data-disabled": i.disabled ? "" : void 0,
|
|
544
544
|
...r,
|
|
545
545
|
ref: n,
|
|
@@ -550,8 +550,8 @@ var $t = "CheckboxIndicator", Vt = c.forwardRef(
|
|
|
550
550
|
);
|
|
551
551
|
}
|
|
552
552
|
);
|
|
553
|
-
|
|
554
|
-
var
|
|
553
|
+
Kt.displayName = Vt;
|
|
554
|
+
var Ht = "CheckboxBubbleInput", Ut = c.forwardRef(
|
|
555
555
|
({ __scopeCheckbox: e, ...n }, t) => {
|
|
556
556
|
const {
|
|
557
557
|
control: o,
|
|
@@ -561,11 +561,11 @@ var Kt = "CheckboxBubbleInput", Ht = c.forwardRef(
|
|
|
561
561
|
required: l,
|
|
562
562
|
disabled: d,
|
|
563
563
|
name: u,
|
|
564
|
-
value:
|
|
565
|
-
form:
|
|
564
|
+
value: f,
|
|
565
|
+
form: p,
|
|
566
566
|
bubbleInput: g,
|
|
567
567
|
setBubbleInput: x
|
|
568
|
-
} = pt(
|
|
568
|
+
} = pt(Ht, e), S = V(t, x), m = _e(i), h = De(o);
|
|
569
569
|
c.useEffect(() => {
|
|
570
570
|
const w = g;
|
|
571
571
|
if (!w) return;
|
|
@@ -574,13 +574,13 @@ var Kt = "CheckboxBubbleInput", Ht = c.forwardRef(
|
|
|
574
574
|
"checked"
|
|
575
575
|
).set, N = !r.current;
|
|
576
576
|
if (m !== i && A) {
|
|
577
|
-
const
|
|
578
|
-
w.indeterminate = ne(i), A.call(w, ne(i) ? !1 : i), w.dispatchEvent(
|
|
577
|
+
const _ = new Event("click", { bubbles: N });
|
|
578
|
+
w.indeterminate = ne(i), A.call(w, ne(i) ? !1 : i), w.dispatchEvent(_);
|
|
579
579
|
}
|
|
580
580
|
}, [g, m, i, r]);
|
|
581
581
|
const b = c.useRef(ne(i) ? !1 : i);
|
|
582
582
|
return /* @__PURE__ */ a.jsx(
|
|
583
|
-
|
|
583
|
+
j.input,
|
|
584
584
|
{
|
|
585
585
|
type: "checkbox",
|
|
586
586
|
"aria-hidden": !0,
|
|
@@ -588,14 +588,14 @@ var Kt = "CheckboxBubbleInput", Ht = c.forwardRef(
|
|
|
588
588
|
required: l,
|
|
589
589
|
disabled: d,
|
|
590
590
|
name: u,
|
|
591
|
-
value:
|
|
592
|
-
form:
|
|
591
|
+
value: f,
|
|
592
|
+
form: p,
|
|
593
593
|
...n,
|
|
594
594
|
tabIndex: -1,
|
|
595
595
|
ref: S,
|
|
596
596
|
style: {
|
|
597
597
|
...n.style,
|
|
598
|
-
...
|
|
598
|
+
...h,
|
|
599
599
|
position: "absolute",
|
|
600
600
|
pointerEvents: "none",
|
|
601
601
|
opacity: 0,
|
|
@@ -609,28 +609,28 @@ var Kt = "CheckboxBubbleInput", Ht = c.forwardRef(
|
|
|
609
609
|
);
|
|
610
610
|
}
|
|
611
611
|
);
|
|
612
|
-
|
|
613
|
-
function
|
|
612
|
+
Ut.displayName = Ht;
|
|
613
|
+
function mo(e) {
|
|
614
614
|
return typeof e == "function";
|
|
615
615
|
}
|
|
616
616
|
function ne(e) {
|
|
617
617
|
return e === "indeterminate";
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Gt(e) {
|
|
620
620
|
return ne(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function ho({ className: e, ...n }) {
|
|
623
623
|
return /* @__PURE__ */ a.jsx(
|
|
624
|
-
|
|
624
|
+
$t,
|
|
625
625
|
{
|
|
626
|
-
className:
|
|
626
|
+
className: L(
|
|
627
627
|
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
628
628
|
e
|
|
629
629
|
),
|
|
630
630
|
"data-slot": "checkbox",
|
|
631
631
|
...n,
|
|
632
632
|
children: /* @__PURE__ */ a.jsx(
|
|
633
|
-
|
|
633
|
+
Kt,
|
|
634
634
|
{
|
|
635
635
|
className: "flex items-center justify-center text-current transition-none",
|
|
636
636
|
"data-slot": "checkbox-indicator",
|
|
@@ -640,7 +640,7 @@ function fo({ className: e, ...n }) {
|
|
|
640
640
|
}
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
|
-
const
|
|
643
|
+
const Ms = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) => {
|
|
644
644
|
const [i, s] = ke(o);
|
|
645
645
|
jt(() => {
|
|
646
646
|
s(o);
|
|
@@ -648,12 +648,12 @@ const Ns = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) =>
|
|
|
648
648
|
let l = n;
|
|
649
649
|
const d = t || n;
|
|
650
650
|
t && (l += `[${t}]`);
|
|
651
|
-
const u = (
|
|
652
|
-
s(
|
|
651
|
+
const u = (f) => {
|
|
652
|
+
s(f), r?.(f);
|
|
653
653
|
};
|
|
654
654
|
return /* @__PURE__ */ a.jsxs(pe, { align: "center", gap: "2", children: [
|
|
655
655
|
/* @__PURE__ */ a.jsx(
|
|
656
|
-
|
|
656
|
+
ho,
|
|
657
657
|
{
|
|
658
658
|
checked: i,
|
|
659
659
|
id: l,
|
|
@@ -664,8 +664,8 @@ const Ns = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) =>
|
|
|
664
664
|
),
|
|
665
665
|
/* @__PURE__ */ a.jsx(ue, { className: "cursor-pointer", htmlFor: l, children: e })
|
|
666
666
|
] });
|
|
667
|
-
},
|
|
668
|
-
const [r, i] = ke(!1), s =
|
|
667
|
+
}, As = ({ content: e, className: n, size: t = "md", ...o }) => {
|
|
668
|
+
const [r, i] = ke(!1), s = Cr(null);
|
|
669
669
|
jt(() => () => {
|
|
670
670
|
s.current && clearTimeout(s.current);
|
|
671
671
|
}, []);
|
|
@@ -682,7 +682,7 @@ const Ns = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) =>
|
|
|
682
682
|
return /* @__PURE__ */ a.jsx(
|
|
683
683
|
Ae,
|
|
684
684
|
{
|
|
685
|
-
className:
|
|
685
|
+
className: L(
|
|
686
686
|
{
|
|
687
687
|
"w-[88px]": t === "xs",
|
|
688
688
|
"w-[96px]": t === "sm",
|
|
@@ -694,36 +694,36 @@ const Ns = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) =>
|
|
|
694
694
|
n
|
|
695
695
|
),
|
|
696
696
|
disabled: r,
|
|
697
|
-
icon: r ? /* @__PURE__ */ a.jsx(
|
|
697
|
+
icon: r ? /* @__PURE__ */ a.jsx(Fr, {}) : /* @__PURE__ */ a.jsx($r, {}),
|
|
698
698
|
label: r ? "Copied" : "Copy",
|
|
699
699
|
onClick: l,
|
|
700
700
|
size: t,
|
|
701
701
|
...o
|
|
702
702
|
}
|
|
703
703
|
);
|
|
704
|
-
},
|
|
704
|
+
}, Ds = ({ onDateSelection: e, initialValue: n, className: t, size: o = "default", error: r }) => {
|
|
705
705
|
const [i, s] = ke(n), l = (d) => {
|
|
706
706
|
s(d), d && e(d);
|
|
707
707
|
};
|
|
708
708
|
return /* @__PURE__ */ a.jsxs(pe, { direction: "col", gap: "2", children: [
|
|
709
|
-
/* @__PURE__ */ a.jsxs(
|
|
710
|
-
/* @__PURE__ */ a.jsx(
|
|
709
|
+
/* @__PURE__ */ a.jsxs(It, { children: [
|
|
710
|
+
/* @__PURE__ */ a.jsx(Rt, { asChild: !0, children: /* @__PURE__ */ a.jsxs(
|
|
711
711
|
Ae,
|
|
712
712
|
{
|
|
713
|
-
className:
|
|
713
|
+
className: L("w-[280px] justify-start text-left font-normal", !i && "text-muted-foreground", t),
|
|
714
714
|
size: o,
|
|
715
715
|
variant: "outline",
|
|
716
716
|
children: [
|
|
717
|
-
/* @__PURE__ */ a.jsx(
|
|
717
|
+
/* @__PURE__ */ a.jsx(jr, { className: "mr-2 h-4 w-4" }),
|
|
718
718
|
i ? i.toISOString().split("T")[0] : /* @__PURE__ */ a.jsx("span", { children: "Select a date" })
|
|
719
719
|
]
|
|
720
720
|
}
|
|
721
721
|
) }),
|
|
722
|
-
/* @__PURE__ */ a.jsx(
|
|
722
|
+
/* @__PURE__ */ a.jsx(kt, { className: "w-auto p-0", children: /* @__PURE__ */ a.jsx(ar, { autoFocus: !0, mode: "single", onSelect: l, selected: i }) })
|
|
723
723
|
] }),
|
|
724
724
|
r && /* @__PURE__ */ a.jsx(Oe, { message: r })
|
|
725
725
|
] });
|
|
726
|
-
},
|
|
726
|
+
}, vo = ({
|
|
727
727
|
label: e,
|
|
728
728
|
labelFor: n,
|
|
729
729
|
className: t = "",
|
|
@@ -732,7 +732,7 @@ const Ns = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) =>
|
|
|
732
732
|
}) => /* @__PURE__ */ a.jsxs(pe, { direction: "col", gap: "2", children: [
|
|
733
733
|
e && /* @__PURE__ */ a.jsx(ue, { className: o, htmlFor: n, children: e }),
|
|
734
734
|
/* @__PURE__ */ a.jsx(pe, { className: `rounded-md border border-input bg-card p-2 shadow-xs ${t}`, gapY: "1", children: r })
|
|
735
|
-
] }),
|
|
735
|
+
] }), Os = ({
|
|
736
736
|
name: e,
|
|
737
737
|
size: n = "md",
|
|
738
738
|
label: t,
|
|
@@ -756,15 +756,15 @@ const Ns = ({ label: e, name: n, value: t, checked: o, onCheckedChange: r }) =>
|
|
|
756
756
|
onClick: u,
|
|
757
757
|
size: "xs",
|
|
758
758
|
variant: "ghost",
|
|
759
|
-
children: l ? /* @__PURE__ */ a.jsx(
|
|
759
|
+
children: l ? /* @__PURE__ */ a.jsx(Ur, {}) : /* @__PURE__ */ a.jsx(Kr, {})
|
|
760
760
|
}
|
|
761
761
|
) })
|
|
762
762
|
] }),
|
|
763
|
-
r && /* @__PURE__ */ a.jsx(
|
|
763
|
+
r && /* @__PURE__ */ a.jsx(Pt, { size: "sm", variant: "muted", children: r }),
|
|
764
764
|
i && /* @__PURE__ */ a.jsx(Oe, { message: i })
|
|
765
765
|
] });
|
|
766
766
|
};
|
|
767
|
-
var ft = "Radio", [
|
|
767
|
+
var ft = "Radio", [go, zt] = ve(ft), [xo, bo] = go(ft), Wt = c.forwardRef(
|
|
768
768
|
(e, n) => {
|
|
769
769
|
const {
|
|
770
770
|
__scopeRadio: t,
|
|
@@ -775,30 +775,30 @@ var ft = "Radio", [ho, Gt] = ve(ft), [vo, go] = ho(ft), zt = c.forwardRef(
|
|
|
775
775
|
value: l = "on",
|
|
776
776
|
onCheck: d,
|
|
777
777
|
form: u,
|
|
778
|
-
...
|
|
779
|
-
} = e, [
|
|
780
|
-
return /* @__PURE__ */ a.jsxs(
|
|
778
|
+
...f
|
|
779
|
+
} = e, [p, g] = c.useState(null), x = V(n, (h) => g(h)), S = c.useRef(!1), m = p ? u || !!p.closest("form") : !0;
|
|
780
|
+
return /* @__PURE__ */ a.jsxs(xo, { scope: t, checked: r, disabled: s, children: [
|
|
781
781
|
/* @__PURE__ */ a.jsx(
|
|
782
|
-
|
|
782
|
+
j.button,
|
|
783
783
|
{
|
|
784
784
|
type: "button",
|
|
785
785
|
role: "radio",
|
|
786
786
|
"aria-checked": r,
|
|
787
|
-
"data-state":
|
|
787
|
+
"data-state": Zt(r),
|
|
788
788
|
"data-disabled": s ? "" : void 0,
|
|
789
789
|
disabled: s,
|
|
790
790
|
value: l,
|
|
791
|
-
...
|
|
791
|
+
...f,
|
|
792
792
|
ref: x,
|
|
793
|
-
onClick: P(e.onClick, (
|
|
794
|
-
r || d?.(), m && (S.current =
|
|
793
|
+
onClick: P(e.onClick, (h) => {
|
|
794
|
+
r || d?.(), m && (S.current = h.isPropagationStopped(), S.current || h.stopPropagation());
|
|
795
795
|
})
|
|
796
796
|
}
|
|
797
797
|
),
|
|
798
798
|
m && /* @__PURE__ */ a.jsx(
|
|
799
|
-
|
|
799
|
+
Xt,
|
|
800
800
|
{
|
|
801
|
-
control:
|
|
801
|
+
control: p,
|
|
802
802
|
bubbles: !S.current,
|
|
803
803
|
name: o,
|
|
804
804
|
value: l,
|
|
@@ -812,14 +812,14 @@ var ft = "Radio", [ho, Gt] = ve(ft), [vo, go] = ho(ft), zt = c.forwardRef(
|
|
|
812
812
|
] });
|
|
813
813
|
}
|
|
814
814
|
);
|
|
815
|
-
|
|
816
|
-
var
|
|
815
|
+
Wt.displayName = ft;
|
|
816
|
+
var qt = "RadioIndicator", Yt = c.forwardRef(
|
|
817
817
|
(e, n) => {
|
|
818
|
-
const { __scopeRadio: t, forceMount: o, ...r } = e, i =
|
|
819
|
-
return /* @__PURE__ */ a.jsx(
|
|
820
|
-
|
|
818
|
+
const { __scopeRadio: t, forceMount: o, ...r } = e, i = bo(qt, t);
|
|
819
|
+
return /* @__PURE__ */ a.jsx(Ct, { present: o || i.checked, children: /* @__PURE__ */ a.jsx(
|
|
820
|
+
j.span,
|
|
821
821
|
{
|
|
822
|
-
"data-state":
|
|
822
|
+
"data-state": Zt(i.checked),
|
|
823
823
|
"data-disabled": i.disabled ? "" : void 0,
|
|
824
824
|
...r,
|
|
825
825
|
ref: n
|
|
@@ -827,8 +827,8 @@ var Wt = "RadioIndicator", qt = c.forwardRef(
|
|
|
827
827
|
) });
|
|
828
828
|
}
|
|
829
829
|
);
|
|
830
|
-
|
|
831
|
-
var
|
|
830
|
+
Yt.displayName = qt;
|
|
831
|
+
var So = "RadioBubbleInput", Xt = c.forwardRef(
|
|
832
832
|
({
|
|
833
833
|
__scopeRadio: e,
|
|
834
834
|
control: n,
|
|
@@ -836,20 +836,20 @@ var xo = "RadioBubbleInput", Yt = c.forwardRef(
|
|
|
836
836
|
bubbles: o = !0,
|
|
837
837
|
...r
|
|
838
838
|
}, i) => {
|
|
839
|
-
const s = c.useRef(null), l = V(s, i), d =
|
|
839
|
+
const s = c.useRef(null), l = V(s, i), d = _e(t), u = De(n);
|
|
840
840
|
return c.useEffect(() => {
|
|
841
|
-
const
|
|
842
|
-
if (!
|
|
843
|
-
const
|
|
844
|
-
|
|
841
|
+
const f = s.current;
|
|
842
|
+
if (!f) return;
|
|
843
|
+
const p = window.HTMLInputElement.prototype, x = Object.getOwnPropertyDescriptor(
|
|
844
|
+
p,
|
|
845
845
|
"checked"
|
|
846
846
|
).set;
|
|
847
847
|
if (d !== t && x) {
|
|
848
848
|
const S = new Event("click", { bubbles: o });
|
|
849
|
-
x.call(
|
|
849
|
+
x.call(f, t), f.dispatchEvent(S);
|
|
850
850
|
}
|
|
851
851
|
}, [d, t, o]), /* @__PURE__ */ a.jsx(
|
|
852
|
-
|
|
852
|
+
j.input,
|
|
853
853
|
{
|
|
854
854
|
type: "radio",
|
|
855
855
|
"aria-hidden": !0,
|
|
@@ -869,14 +869,14 @@ var xo = "RadioBubbleInput", Yt = c.forwardRef(
|
|
|
869
869
|
);
|
|
870
870
|
}
|
|
871
871
|
);
|
|
872
|
-
|
|
873
|
-
function
|
|
872
|
+
Xt.displayName = So;
|
|
873
|
+
function Zt(e) {
|
|
874
874
|
return e ? "checked" : "unchecked";
|
|
875
875
|
}
|
|
876
|
-
var
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
]),
|
|
876
|
+
var wo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Fe = "RadioGroup", [yo, Ls] = ve(Fe, [
|
|
877
|
+
Mt,
|
|
878
|
+
zt
|
|
879
|
+
]), Jt = Mt(), Qt = zt(), [Co, Io] = yo(Fe), en = c.forwardRef(
|
|
880
880
|
(e, n) => {
|
|
881
881
|
const {
|
|
882
882
|
__scopeRadioGroup: t,
|
|
@@ -887,34 +887,34 @@ var bo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Be = "RadioGroup",
|
|
|
887
887
|
disabled: l = !1,
|
|
888
888
|
orientation: d,
|
|
889
889
|
dir: u,
|
|
890
|
-
loop:
|
|
891
|
-
onValueChange:
|
|
890
|
+
loop: f = !0,
|
|
891
|
+
onValueChange: p,
|
|
892
892
|
...g
|
|
893
|
-
} = e, x =
|
|
893
|
+
} = e, x = Jt(t), S = Me(u), [m, h] = de({
|
|
894
894
|
prop: i,
|
|
895
895
|
defaultProp: r ?? null,
|
|
896
|
-
onChange:
|
|
897
|
-
caller:
|
|
896
|
+
onChange: p,
|
|
897
|
+
caller: Fe
|
|
898
898
|
});
|
|
899
899
|
return /* @__PURE__ */ a.jsx(
|
|
900
|
-
|
|
900
|
+
Co,
|
|
901
901
|
{
|
|
902
902
|
scope: t,
|
|
903
903
|
name: o,
|
|
904
904
|
required: s,
|
|
905
905
|
disabled: l,
|
|
906
906
|
value: m,
|
|
907
|
-
onValueChange:
|
|
907
|
+
onValueChange: h,
|
|
908
908
|
children: /* @__PURE__ */ a.jsx(
|
|
909
|
-
|
|
909
|
+
co,
|
|
910
910
|
{
|
|
911
911
|
asChild: !0,
|
|
912
912
|
...x,
|
|
913
913
|
orientation: d,
|
|
914
914
|
dir: S,
|
|
915
|
-
loop:
|
|
915
|
+
loop: f,
|
|
916
916
|
children: /* @__PURE__ */ a.jsx(
|
|
917
|
-
|
|
917
|
+
j.div,
|
|
918
918
|
{
|
|
919
919
|
role: "radiogroup",
|
|
920
920
|
"aria-required": s,
|
|
@@ -931,34 +931,34 @@ var bo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Be = "RadioGroup",
|
|
|
931
931
|
);
|
|
932
932
|
}
|
|
933
933
|
);
|
|
934
|
-
|
|
935
|
-
var
|
|
934
|
+
en.displayName = Fe;
|
|
935
|
+
var tn = "RadioGroupItem", nn = c.forwardRef(
|
|
936
936
|
(e, n) => {
|
|
937
|
-
const { __scopeRadioGroup: t, disabled: o, ...r } = e, i =
|
|
937
|
+
const { __scopeRadioGroup: t, disabled: o, ...r } = e, i = Io(tn, t), s = i.disabled || o, l = Jt(t), d = Qt(t), u = c.useRef(null), f = V(n, u), p = i.value === r.value, g = c.useRef(!1);
|
|
938
938
|
return c.useEffect(() => {
|
|
939
939
|
const x = (m) => {
|
|
940
|
-
|
|
940
|
+
wo.includes(m.key) && (g.current = !0);
|
|
941
941
|
}, S = () => g.current = !1;
|
|
942
942
|
return document.addEventListener("keydown", x), document.addEventListener("keyup", S), () => {
|
|
943
943
|
document.removeEventListener("keydown", x), document.removeEventListener("keyup", S);
|
|
944
944
|
};
|
|
945
945
|
}, []), /* @__PURE__ */ a.jsx(
|
|
946
|
-
|
|
946
|
+
lo,
|
|
947
947
|
{
|
|
948
948
|
asChild: !0,
|
|
949
949
|
...l,
|
|
950
950
|
focusable: !s,
|
|
951
|
-
active:
|
|
951
|
+
active: p,
|
|
952
952
|
children: /* @__PURE__ */ a.jsx(
|
|
953
|
-
|
|
953
|
+
Wt,
|
|
954
954
|
{
|
|
955
955
|
disabled: s,
|
|
956
956
|
required: i.required,
|
|
957
|
-
checked:
|
|
957
|
+
checked: p,
|
|
958
958
|
...d,
|
|
959
959
|
...r,
|
|
960
960
|
name: i.name,
|
|
961
|
-
ref:
|
|
961
|
+
ref: f,
|
|
962
962
|
onCheck: () => i.onValueChange(r.value),
|
|
963
963
|
onKeyDown: P((x) => {
|
|
964
964
|
x.key === "Enter" && x.preventDefault();
|
|
@@ -972,42 +972,42 @@ var en = "RadioGroupItem", tn = c.forwardRef(
|
|
|
972
972
|
);
|
|
973
973
|
}
|
|
974
974
|
);
|
|
975
|
-
|
|
976
|
-
var
|
|
975
|
+
nn.displayName = tn;
|
|
976
|
+
var Ro = "RadioGroupIndicator", rn = c.forwardRef(
|
|
977
977
|
(e, n) => {
|
|
978
|
-
const { __scopeRadioGroup: t, ...o } = e, r =
|
|
979
|
-
return /* @__PURE__ */ a.jsx(
|
|
978
|
+
const { __scopeRadioGroup: t, ...o } = e, r = Qt(t);
|
|
979
|
+
return /* @__PURE__ */ a.jsx(Yt, { ...r, ...o, ref: n });
|
|
980
980
|
}
|
|
981
981
|
);
|
|
982
|
-
|
|
983
|
-
var
|
|
984
|
-
function Eo({ className: e, ...n }) {
|
|
985
|
-
return /* @__PURE__ */ a.jsx(Io, { className: B("grid gap-3", e), "data-slot": "radio-group", ...n });
|
|
986
|
-
}
|
|
982
|
+
rn.displayName = Ro;
|
|
983
|
+
var ko = en, Eo = nn, _o = rn;
|
|
987
984
|
function jo({ className: e, ...n }) {
|
|
985
|
+
return /* @__PURE__ */ a.jsx(ko, { className: L("grid gap-3", e), "data-slot": "radio-group", ...n });
|
|
986
|
+
}
|
|
987
|
+
function Po({ className: e, ...n }) {
|
|
988
988
|
return /* @__PURE__ */ a.jsx(
|
|
989
|
-
|
|
989
|
+
Eo,
|
|
990
990
|
{
|
|
991
|
-
className:
|
|
991
|
+
className: L(
|
|
992
992
|
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
993
993
|
e
|
|
994
994
|
),
|
|
995
995
|
"data-slot": "radio-group-item",
|
|
996
996
|
...n,
|
|
997
997
|
children: /* @__PURE__ */ a.jsx(
|
|
998
|
-
|
|
998
|
+
_o,
|
|
999
999
|
{
|
|
1000
1000
|
className: "relative flex items-center justify-center",
|
|
1001
1001
|
"data-slot": "radio-group-indicator",
|
|
1002
|
-
children: /* @__PURE__ */ a.jsx(
|
|
1002
|
+
children: /* @__PURE__ */ a.jsx(Or, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
1003
1003
|
}
|
|
1004
1004
|
)
|
|
1005
1005
|
}
|
|
1006
1006
|
);
|
|
1007
1007
|
}
|
|
1008
|
-
const
|
|
1009
|
-
/* @__PURE__ */ a.jsx(
|
|
1010
|
-
/* @__PURE__ */ a.jsx(
|
|
1008
|
+
const Fs = ({ label: e, name: n, options: t, value: o, onChange: r, error: i }) => /* @__PURE__ */ a.jsxs(vo, { className: "flex flex-col gap-4 px-2 py-1", label: e, labelFor: n, children: [
|
|
1009
|
+
/* @__PURE__ */ a.jsx(jo, { className: "w-full", name: n, onValueChange: r, value: o, children: /* @__PURE__ */ a.jsx(kr, { cols: "2", children: t.map((s, l) => /* @__PURE__ */ a.jsxs(pe, { align: "center", gap: "2", justify: "start", children: [
|
|
1010
|
+
/* @__PURE__ */ a.jsx(Po, { id: s.value, value: s.value }),
|
|
1011
1011
|
/* @__PURE__ */ a.jsx(ue, { htmlFor: s.value, children: s.label })
|
|
1012
1012
|
] }, l)) }) }),
|
|
1013
1013
|
i && /* @__PURE__ */ a.jsx(Oe, { message: i })
|
|
@@ -1015,10 +1015,10 @@ const Os = ({ label: e, name: n, options: t, value: o, onChange: r, error: i })
|
|
|
1015
1015
|
function Ne(e, [n, t]) {
|
|
1016
1016
|
return Math.min(t, Math.max(n, e));
|
|
1017
1017
|
}
|
|
1018
|
-
var
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
]), Ve =
|
|
1018
|
+
var No = [" ", "Enter", "ArrowUp", "ArrowDown"], To = [" ", "Enter"], fe = "Select", [Be, $e, Mo] = dt(fe), [Se, Bs] = ve(fe, [
|
|
1019
|
+
Mo,
|
|
1020
|
+
Et
|
|
1021
|
+
]), Ve = Et(), [Ao, ae] = Se(fe), [Do, Oo] = Se(fe), on = (e) => {
|
|
1022
1022
|
const {
|
|
1023
1023
|
__scopeSelect: n,
|
|
1024
1024
|
children: t,
|
|
@@ -1029,12 +1029,12 @@ var _o = [" ", "Enter", "ArrowUp", "ArrowDown"], Po = [" ", "Enter"], fe = "Sele
|
|
|
1029
1029
|
defaultValue: l,
|
|
1030
1030
|
onValueChange: d,
|
|
1031
1031
|
dir: u,
|
|
1032
|
-
name:
|
|
1033
|
-
autoComplete:
|
|
1032
|
+
name: f,
|
|
1033
|
+
autoComplete: p,
|
|
1034
1034
|
disabled: g,
|
|
1035
1035
|
required: x,
|
|
1036
1036
|
form: S
|
|
1037
|
-
} = e, m = Ve(n), [
|
|
1037
|
+
} = e, m = Ve(n), [h, b] = c.useState(null), [w, y] = c.useState(null), [R, A] = c.useState(!1), N = Me(u), [_, F] = de({
|
|
1038
1038
|
prop: o,
|
|
1039
1039
|
defaultProp: r ?? !1,
|
|
1040
1040
|
onChange: i,
|
|
@@ -1044,13 +1044,13 @@ var _o = [" ", "Enter", "ArrowUp", "ArrowDown"], Po = [" ", "Enter"], fe = "Sele
|
|
|
1044
1044
|
defaultProp: l,
|
|
1045
1045
|
onChange: d,
|
|
1046
1046
|
caller: fe
|
|
1047
|
-
}), D = c.useRef(null), K =
|
|
1048
|
-
return /* @__PURE__ */ a.jsx(
|
|
1049
|
-
|
|
1047
|
+
}), D = c.useRef(null), K = h ? S || !!h.closest("form") : !0, [X, W] = c.useState(/* @__PURE__ */ new Set()), U = Array.from(X).map((O) => O.props.value).join(";");
|
|
1048
|
+
return /* @__PURE__ */ a.jsx(sr, { ...m, children: /* @__PURE__ */ a.jsxs(
|
|
1049
|
+
Ao,
|
|
1050
1050
|
{
|
|
1051
1051
|
required: x,
|
|
1052
1052
|
scope: n,
|
|
1053
|
-
trigger:
|
|
1053
|
+
trigger: h,
|
|
1054
1054
|
onTriggerChange: b,
|
|
1055
1055
|
valueNode: w,
|
|
1056
1056
|
onValueNodeChange: y,
|
|
@@ -1059,14 +1059,14 @@ var _o = [" ", "Enter", "ArrowUp", "ArrowDown"], Po = [" ", "Enter"], fe = "Sele
|
|
|
1059
1059
|
contentId: te(),
|
|
1060
1060
|
value: Z,
|
|
1061
1061
|
onValueChange: z,
|
|
1062
|
-
open:
|
|
1063
|
-
onOpenChange:
|
|
1062
|
+
open: _,
|
|
1063
|
+
onOpenChange: F,
|
|
1064
1064
|
dir: N,
|
|
1065
1065
|
triggerPointerDownPosRef: D,
|
|
1066
1066
|
disabled: g,
|
|
1067
1067
|
children: [
|
|
1068
|
-
/* @__PURE__ */ a.jsx(
|
|
1069
|
-
|
|
1068
|
+
/* @__PURE__ */ a.jsx(Be.Provider, { scope: n, children: /* @__PURE__ */ a.jsx(
|
|
1069
|
+
Do,
|
|
1070
1070
|
{
|
|
1071
1071
|
scope: e.__scopeSelect,
|
|
1072
1072
|
onNativeOptionAdd: c.useCallback((O) => {
|
|
@@ -1082,13 +1082,13 @@ var _o = [" ", "Enter", "ArrowUp", "ArrowDown"], Po = [" ", "Enter"], fe = "Sele
|
|
|
1082
1082
|
}
|
|
1083
1083
|
) }),
|
|
1084
1084
|
K ? /* @__PURE__ */ a.jsxs(
|
|
1085
|
-
|
|
1085
|
+
_n,
|
|
1086
1086
|
{
|
|
1087
1087
|
"aria-hidden": !0,
|
|
1088
1088
|
required: x,
|
|
1089
1089
|
tabIndex: -1,
|
|
1090
|
-
name:
|
|
1091
|
-
autoComplete:
|
|
1090
|
+
name: f,
|
|
1091
|
+
autoComplete: p,
|
|
1092
1092
|
value: Z,
|
|
1093
1093
|
onChange: (O) => z(O.target.value),
|
|
1094
1094
|
disabled: g,
|
|
@@ -1104,11 +1104,11 @@ var _o = [" ", "Enter", "ArrowUp", "ArrowDown"], Po = [" ", "Enter"], fe = "Sele
|
|
|
1104
1104
|
}
|
|
1105
1105
|
) });
|
|
1106
1106
|
};
|
|
1107
|
-
|
|
1108
|
-
var
|
|
1107
|
+
on.displayName = fe;
|
|
1108
|
+
var an = "SelectTrigger", sn = c.forwardRef(
|
|
1109
1109
|
(e, n) => {
|
|
1110
|
-
const { __scopeSelect: t, disabled: o = !1, ...r } = e, i = Ve(t), s = ae(
|
|
1111
|
-
const
|
|
1110
|
+
const { __scopeSelect: t, disabled: o = !1, ...r } = e, i = Ve(t), s = ae(an, t), l = s.disabled || o, d = V(n, s.onTriggerChange), u = $e(t), f = c.useRef("touch"), [p, g, x] = Pn((m) => {
|
|
1111
|
+
const h = u().filter((y) => !y.disabled), b = h.find((y) => y.value === s.value), w = Nn(h, m, b);
|
|
1112
1112
|
w !== void 0 && s.onValueChange(w.value);
|
|
1113
1113
|
}), S = (m) => {
|
|
1114
1114
|
l || (s.onOpenChange(!0), x()), m && (s.triggerPointerDownPosRef.current = {
|
|
@@ -1116,8 +1116,8 @@ var on = "SelectTrigger", an = c.forwardRef(
|
|
|
1116
1116
|
y: Math.round(m.pageY)
|
|
1117
1117
|
});
|
|
1118
1118
|
};
|
|
1119
|
-
return /* @__PURE__ */ a.jsx(
|
|
1120
|
-
|
|
1119
|
+
return /* @__PURE__ */ a.jsx(ir, { asChild: !0, ...i, children: /* @__PURE__ */ a.jsx(
|
|
1120
|
+
j.button,
|
|
1121
1121
|
{
|
|
1122
1122
|
type: "button",
|
|
1123
1123
|
role: "combobox",
|
|
@@ -1129,69 +1129,69 @@ var on = "SelectTrigger", an = c.forwardRef(
|
|
|
1129
1129
|
"data-state": s.open ? "open" : "closed",
|
|
1130
1130
|
disabled: l,
|
|
1131
1131
|
"data-disabled": l ? "" : void 0,
|
|
1132
|
-
"data-placeholder":
|
|
1132
|
+
"data-placeholder": jn(s.value) ? "" : void 0,
|
|
1133
1133
|
...r,
|
|
1134
1134
|
ref: d,
|
|
1135
1135
|
onClick: P(r.onClick, (m) => {
|
|
1136
|
-
m.currentTarget.focus(),
|
|
1136
|
+
m.currentTarget.focus(), f.current !== "mouse" && S(m);
|
|
1137
1137
|
}),
|
|
1138
1138
|
onPointerDown: P(r.onPointerDown, (m) => {
|
|
1139
|
-
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1139
|
+
f.current = m.pointerType;
|
|
1140
|
+
const h = m.target;
|
|
1141
|
+
h.hasPointerCapture(m.pointerId) && h.releasePointerCapture(m.pointerId), m.button === 0 && m.ctrlKey === !1 && m.pointerType === "mouse" && (S(m), m.preventDefault());
|
|
1142
1142
|
}),
|
|
1143
1143
|
onKeyDown: P(r.onKeyDown, (m) => {
|
|
1144
|
-
const
|
|
1145
|
-
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 && g(m.key), !(
|
|
1144
|
+
const h = p.current !== "";
|
|
1145
|
+
!(m.ctrlKey || m.altKey || m.metaKey) && m.key.length === 1 && g(m.key), !(h && m.key === " ") && No.includes(m.key) && (S(), m.preventDefault());
|
|
1146
1146
|
})
|
|
1147
1147
|
}
|
|
1148
1148
|
) });
|
|
1149
1149
|
}
|
|
1150
1150
|
);
|
|
1151
|
-
|
|
1152
|
-
var
|
|
1151
|
+
sn.displayName = an;
|
|
1152
|
+
var cn = "SelectValue", ln = c.forwardRef(
|
|
1153
1153
|
(e, n) => {
|
|
1154
|
-
const { __scopeSelect: t, className: o, style: r, children: i, placeholder: s = "", ...l } = e, d = ae(
|
|
1154
|
+
const { __scopeSelect: t, className: o, style: r, children: i, placeholder: s = "", ...l } = e, d = ae(cn, t), { onValueNodeHasChildrenChange: u } = d, f = i !== void 0, p = V(n, d.onValueNodeChange);
|
|
1155
1155
|
return re(() => {
|
|
1156
|
-
u(
|
|
1157
|
-
}, [u,
|
|
1158
|
-
|
|
1156
|
+
u(f);
|
|
1157
|
+
}, [u, f]), /* @__PURE__ */ a.jsx(
|
|
1158
|
+
j.span,
|
|
1159
1159
|
{
|
|
1160
1160
|
...l,
|
|
1161
|
-
ref:
|
|
1161
|
+
ref: p,
|
|
1162
1162
|
style: { pointerEvents: "none" },
|
|
1163
|
-
children:
|
|
1163
|
+
children: jn(d.value) ? /* @__PURE__ */ a.jsx(a.Fragment, { children: s }) : i
|
|
1164
1164
|
}
|
|
1165
1165
|
);
|
|
1166
1166
|
}
|
|
1167
1167
|
);
|
|
1168
|
-
|
|
1169
|
-
var
|
|
1168
|
+
ln.displayName = cn;
|
|
1169
|
+
var Lo = "SelectIcon", dn = c.forwardRef(
|
|
1170
1170
|
(e, n) => {
|
|
1171
1171
|
const { __scopeSelect: t, children: o, ...r } = e;
|
|
1172
|
-
return /* @__PURE__ */ a.jsx(
|
|
1172
|
+
return /* @__PURE__ */ a.jsx(j.span, { "aria-hidden": !0, ...r, ref: n, children: o || "▼" });
|
|
1173
1173
|
}
|
|
1174
1174
|
);
|
|
1175
|
-
|
|
1176
|
-
var
|
|
1177
|
-
|
|
1178
|
-
var me = "SelectContent",
|
|
1175
|
+
dn.displayName = Lo;
|
|
1176
|
+
var Fo = "SelectPortal", un = (e) => /* @__PURE__ */ a.jsx(cr, { asChild: !0, ...e });
|
|
1177
|
+
un.displayName = Fo;
|
|
1178
|
+
var me = "SelectContent", pn = c.forwardRef(
|
|
1179
1179
|
(e, n) => {
|
|
1180
1180
|
const t = ae(me, e.__scopeSelect), [o, r] = c.useState();
|
|
1181
1181
|
if (re(() => {
|
|
1182
1182
|
r(new DocumentFragment());
|
|
1183
1183
|
}, []), !t.open) {
|
|
1184
1184
|
const i = o;
|
|
1185
|
-
return i ?
|
|
1186
|
-
/* @__PURE__ */ a.jsx(
|
|
1185
|
+
return i ? Nt.createPortal(
|
|
1186
|
+
/* @__PURE__ */ a.jsx(fn, { scope: e.__scopeSelect, children: /* @__PURE__ */ a.jsx(Be.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ a.jsx("div", { children: e.children }) }) }),
|
|
1187
1187
|
i
|
|
1188
1188
|
) : null;
|
|
1189
1189
|
}
|
|
1190
|
-
return /* @__PURE__ */ a.jsx(
|
|
1190
|
+
return /* @__PURE__ */ a.jsx(mn, { ...e, ref: n });
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
|
|
1194
|
-
var ee = 10, [
|
|
1193
|
+
pn.displayName = me;
|
|
1194
|
+
var ee = 10, [fn, se] = Se(me), Bo = "SelectContentImpl", $o = fr("SelectContent.RemoveScroll"), mn = c.forwardRef(
|
|
1195
1195
|
(e, n) => {
|
|
1196
1196
|
const {
|
|
1197
1197
|
__scopeSelect: t,
|
|
@@ -1204,31 +1204,31 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1204
1204
|
side: l,
|
|
1205
1205
|
sideOffset: d,
|
|
1206
1206
|
align: u,
|
|
1207
|
-
alignOffset:
|
|
1208
|
-
arrowPadding:
|
|
1207
|
+
alignOffset: f,
|
|
1208
|
+
arrowPadding: p,
|
|
1209
1209
|
collisionBoundary: g,
|
|
1210
1210
|
collisionPadding: x,
|
|
1211
1211
|
sticky: S,
|
|
1212
1212
|
hideWhenDetached: m,
|
|
1213
|
-
avoidCollisions:
|
|
1213
|
+
avoidCollisions: h,
|
|
1214
1214
|
//
|
|
1215
1215
|
...b
|
|
1216
|
-
} = e, w = ae(me, t), [y, R] = c.useState(null), [A, N] = c.useState(null),
|
|
1216
|
+
} = e, w = ae(me, t), [y, R] = c.useState(null), [A, N] = c.useState(null), _ = V(n, (C) => R(C)), [F, Z] = c.useState(null), [z, D] = c.useState(
|
|
1217
1217
|
null
|
|
1218
1218
|
), K = $e(t), [X, W] = c.useState(!1), U = c.useRef(!1);
|
|
1219
1219
|
c.useEffect(() => {
|
|
1220
|
-
if (y) return
|
|
1221
|
-
}, [y]),
|
|
1220
|
+
if (y) return dr(y);
|
|
1221
|
+
}, [y]), ur();
|
|
1222
1222
|
const O = c.useCallback(
|
|
1223
1223
|
(C) => {
|
|
1224
|
-
const [M, ...
|
|
1224
|
+
const [M, ...B] = K().map((Y) => Y.ref.current), [$] = B.slice(-1), H = document.activeElement;
|
|
1225
1225
|
for (const Y of C)
|
|
1226
1226
|
if (Y === H || (Y?.scrollIntoView({ block: "nearest" }), Y === M && A && (A.scrollTop = 0), Y === $ && A && (A.scrollTop = A.scrollHeight), Y?.focus(), document.activeElement !== H)) return;
|
|
1227
1227
|
},
|
|
1228
1228
|
[K, A]
|
|
1229
1229
|
), G = c.useCallback(
|
|
1230
|
-
() => O([
|
|
1231
|
-
[O,
|
|
1230
|
+
() => O([F, y]),
|
|
1231
|
+
[O, F, y]
|
|
1232
1232
|
);
|
|
1233
1233
|
c.useEffect(() => {
|
|
1234
1234
|
X && G();
|
|
@@ -1242,11 +1242,11 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1242
1242
|
x: Math.abs(Math.round($.pageX) - (J.current?.x ?? 0)),
|
|
1243
1243
|
y: Math.abs(Math.round($.pageY) - (J.current?.y ?? 0))
|
|
1244
1244
|
};
|
|
1245
|
-
},
|
|
1245
|
+
}, B = ($) => {
|
|
1246
1246
|
C.x <= 10 && C.y <= 10 ? $.preventDefault() : y.contains($.target) || q(!1), document.removeEventListener("pointermove", M), J.current = null;
|
|
1247
1247
|
};
|
|
1248
|
-
return J.current !== null && (document.addEventListener("pointermove", M), document.addEventListener("pointerup",
|
|
1249
|
-
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup",
|
|
1248
|
+
return J.current !== null && (document.addEventListener("pointermove", M), document.addEventListener("pointerup", B, { capture: !0, once: !0 })), () => {
|
|
1249
|
+
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", B, { capture: !0 });
|
|
1250
1250
|
};
|
|
1251
1251
|
}
|
|
1252
1252
|
}, [y, q, J]), c.useEffect(() => {
|
|
@@ -1255,42 +1255,42 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1255
1255
|
window.removeEventListener("blur", C), window.removeEventListener("resize", C);
|
|
1256
1256
|
};
|
|
1257
1257
|
}, [q]);
|
|
1258
|
-
const [ge, ie] =
|
|
1259
|
-
const M = K().filter((H) => !H.disabled),
|
|
1258
|
+
const [ge, ie] = Pn((C) => {
|
|
1259
|
+
const M = K().filter((H) => !H.disabled), B = M.find((H) => H.ref.current === document.activeElement), $ = Nn(M, C, B);
|
|
1260
1260
|
$ && setTimeout(() => $.ref.current.focus());
|
|
1261
|
-
}),
|
|
1262
|
-
(C, M,
|
|
1263
|
-
const $ = !U.current && !
|
|
1261
|
+
}), v = c.useCallback(
|
|
1262
|
+
(C, M, B) => {
|
|
1263
|
+
const $ = !U.current && !B;
|
|
1264
1264
|
(w.value !== void 0 && w.value === M || $) && (Z(C), $ && (U.current = !0));
|
|
1265
1265
|
},
|
|
1266
1266
|
[w.value]
|
|
1267
1267
|
), k = c.useCallback(() => y?.focus(), [y]), E = c.useCallback(
|
|
1268
|
-
(C, M,
|
|
1269
|
-
const $ = !U.current && !
|
|
1268
|
+
(C, M, B) => {
|
|
1269
|
+
const $ = !U.current && !B;
|
|
1270
1270
|
(w.value !== void 0 && w.value === M || $) && D(C);
|
|
1271
1271
|
},
|
|
1272
1272
|
[w.value]
|
|
1273
|
-
), I = o === "popper" ? et :
|
|
1273
|
+
), I = o === "popper" ? et : hn, T = I === et ? {
|
|
1274
1274
|
side: l,
|
|
1275
1275
|
sideOffset: d,
|
|
1276
1276
|
align: u,
|
|
1277
|
-
alignOffset:
|
|
1278
|
-
arrowPadding:
|
|
1277
|
+
alignOffset: f,
|
|
1278
|
+
arrowPadding: p,
|
|
1279
1279
|
collisionBoundary: g,
|
|
1280
1280
|
collisionPadding: x,
|
|
1281
1281
|
sticky: S,
|
|
1282
1282
|
hideWhenDetached: m,
|
|
1283
|
-
avoidCollisions:
|
|
1283
|
+
avoidCollisions: h
|
|
1284
1284
|
} : {};
|
|
1285
1285
|
return /* @__PURE__ */ a.jsx(
|
|
1286
|
-
|
|
1286
|
+
fn,
|
|
1287
1287
|
{
|
|
1288
1288
|
scope: t,
|
|
1289
1289
|
content: y,
|
|
1290
1290
|
viewport: A,
|
|
1291
1291
|
onViewportChange: N,
|
|
1292
|
-
itemRefCallback:
|
|
1293
|
-
selectedItem:
|
|
1292
|
+
itemRefCallback: v,
|
|
1293
|
+
selectedItem: F,
|
|
1294
1294
|
onItemLeave: k,
|
|
1295
1295
|
itemTextRefCallback: E,
|
|
1296
1296
|
focusSelectedItem: G,
|
|
@@ -1298,8 +1298,8 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1298
1298
|
position: o,
|
|
1299
1299
|
isPositioned: X,
|
|
1300
1300
|
searchRef: ge,
|
|
1301
|
-
children: /* @__PURE__ */ a.jsx(
|
|
1302
|
-
|
|
1301
|
+
children: /* @__PURE__ */ a.jsx(pr, { as: $o, allowPinchZoom: !0, children: /* @__PURE__ */ a.jsx(
|
|
1302
|
+
mr,
|
|
1303
1303
|
{
|
|
1304
1304
|
asChild: !0,
|
|
1305
1305
|
trapped: w.open,
|
|
@@ -1310,7 +1310,7 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1310
1310
|
w.trigger?.focus({ preventScroll: !0 }), C.preventDefault();
|
|
1311
1311
|
}),
|
|
1312
1312
|
children: /* @__PURE__ */ a.jsx(
|
|
1313
|
-
|
|
1313
|
+
hr,
|
|
1314
1314
|
{
|
|
1315
1315
|
asChild: !0,
|
|
1316
1316
|
disableOutsidePointerEvents: !0,
|
|
@@ -1329,7 +1329,7 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1329
1329
|
...b,
|
|
1330
1330
|
...T,
|
|
1331
1331
|
onPlaced: () => W(!0),
|
|
1332
|
-
ref:
|
|
1332
|
+
ref: _,
|
|
1333
1333
|
style: {
|
|
1334
1334
|
// flex layout so we can place the scroll buttons properly
|
|
1335
1335
|
display: "flex",
|
|
@@ -1359,13 +1359,13 @@ var ee = 10, [pn, se] = Se(me), Lo = "SelectContentImpl", Bo = ur("SelectContent
|
|
|
1359
1359
|
);
|
|
1360
1360
|
}
|
|
1361
1361
|
);
|
|
1362
|
-
|
|
1363
|
-
var
|
|
1364
|
-
const { __scopeSelect: t, onPlaced: o, ...r } = e, i = ae(me, t), s = se(me, t), [l, d] = c.useState(null), [u,
|
|
1365
|
-
if (i.trigger && i.valueNode && l && u && m &&
|
|
1366
|
-
const
|
|
1362
|
+
mn.displayName = Bo;
|
|
1363
|
+
var Vo = "SelectItemAlignedPosition", hn = c.forwardRef((e, n) => {
|
|
1364
|
+
const { __scopeSelect: t, onPlaced: o, ...r } = e, i = ae(me, t), s = se(me, t), [l, d] = c.useState(null), [u, f] = c.useState(null), p = V(n, (_) => f(_)), g = $e(t), x = c.useRef(!1), S = c.useRef(!0), { viewport: m, selectedItem: h, selectedItemText: b, focusSelectedItem: w } = s, y = c.useCallback(() => {
|
|
1365
|
+
if (i.trigger && i.valueNode && l && u && m && h && b) {
|
|
1366
|
+
const _ = i.trigger.getBoundingClientRect(), F = u.getBoundingClientRect(), Z = i.valueNode.getBoundingClientRect(), z = b.getBoundingClientRect();
|
|
1367
1367
|
if (i.dir !== "rtl") {
|
|
1368
|
-
const H = z.left -
|
|
1368
|
+
const H = z.left - F.left, Y = Z.left - H, ce = _.left - Y, le = _.width + ce, Ge = Math.max(le, F.width), ze = window.innerWidth - ee, We = Ne(Y, [
|
|
1369
1369
|
ee,
|
|
1370
1370
|
// Prevents the content from going off the starting edge of the
|
|
1371
1371
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -1376,15 +1376,15 @@ var Fo = "SelectItemAlignedPosition", mn = c.forwardRef((e, n) => {
|
|
|
1376
1376
|
]);
|
|
1377
1377
|
l.style.minWidth = le + "px", l.style.left = We + "px";
|
|
1378
1378
|
} else {
|
|
1379
|
-
const H =
|
|
1379
|
+
const H = F.right - z.right, Y = window.innerWidth - Z.right - H, ce = window.innerWidth - _.right - Y, le = _.width + ce, Ge = Math.max(le, F.width), ze = window.innerWidth - ee, We = Ne(Y, [
|
|
1380
1380
|
ee,
|
|
1381
1381
|
Math.max(ee, ze - Ge)
|
|
1382
1382
|
]);
|
|
1383
1383
|
l.style.minWidth = le + "px", l.style.right = We + "px";
|
|
1384
1384
|
}
|
|
1385
|
-
const D = g(), K = window.innerHeight - ee * 2, X = m.scrollHeight, W = window.getComputedStyle(u), U = parseInt(W.borderTopWidth, 10), O = parseInt(W.paddingTop, 10), G = parseInt(W.borderBottomWidth, 10), q = parseInt(W.paddingBottom, 10), J = U + O + X + q + G, ge = Math.min(
|
|
1385
|
+
const D = g(), K = window.innerHeight - ee * 2, X = m.scrollHeight, W = window.getComputedStyle(u), U = parseInt(W.borderTopWidth, 10), O = parseInt(W.paddingTop, 10), G = parseInt(W.borderBottomWidth, 10), q = parseInt(W.paddingBottom, 10), J = U + O + X + q + G, ge = Math.min(h.offsetHeight * 5, J), ie = window.getComputedStyle(m), v = parseInt(ie.paddingTop, 10), k = parseInt(ie.paddingBottom, 10), E = _.top + _.height / 2 - ee, I = K - E, T = h.offsetHeight / 2, C = h.offsetTop + T, M = U + O + C, B = J - M;
|
|
1386
1386
|
if (M <= E) {
|
|
1387
|
-
const H = D.length > 0 &&
|
|
1387
|
+
const H = D.length > 0 && h === D[D.length - 1].ref.current;
|
|
1388
1388
|
l.style.bottom = "0px";
|
|
1389
1389
|
const Y = u.clientHeight - m.offsetTop - m.offsetHeight, ce = Math.max(
|
|
1390
1390
|
I,
|
|
@@ -1393,13 +1393,13 @@ var Fo = "SelectItemAlignedPosition", mn = c.forwardRef((e, n) => {
|
|
|
1393
1393
|
), le = M + ce;
|
|
1394
1394
|
l.style.height = le + "px";
|
|
1395
1395
|
} else {
|
|
1396
|
-
const H = D.length > 0 &&
|
|
1396
|
+
const H = D.length > 0 && h === D[0].ref.current;
|
|
1397
1397
|
l.style.top = "0px";
|
|
1398
1398
|
const ce = Math.max(
|
|
1399
1399
|
E,
|
|
1400
1400
|
U + m.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
1401
|
-
(H ?
|
|
1402
|
-
) +
|
|
1401
|
+
(H ? v : 0) + T
|
|
1402
|
+
) + B;
|
|
1403
1403
|
l.style.height = ce + "px", m.scrollTop = M - E + m.offsetTop;
|
|
1404
1404
|
}
|
|
1405
1405
|
l.style.margin = `${ee}px 0`, l.style.minHeight = ge + "px", l.style.maxHeight = K + "px", o?.(), requestAnimationFrame(() => x.current = !0);
|
|
@@ -1411,7 +1411,7 @@ var Fo = "SelectItemAlignedPosition", mn = c.forwardRef((e, n) => {
|
|
|
1411
1411
|
l,
|
|
1412
1412
|
u,
|
|
1413
1413
|
m,
|
|
1414
|
-
|
|
1414
|
+
h,
|
|
1415
1415
|
b,
|
|
1416
1416
|
i.dir,
|
|
1417
1417
|
o
|
|
@@ -1422,13 +1422,13 @@ var Fo = "SelectItemAlignedPosition", mn = c.forwardRef((e, n) => {
|
|
|
1422
1422
|
u && A(window.getComputedStyle(u).zIndex);
|
|
1423
1423
|
}, [u]);
|
|
1424
1424
|
const N = c.useCallback(
|
|
1425
|
-
(
|
|
1426
|
-
|
|
1425
|
+
(_) => {
|
|
1426
|
+
_ && S.current === !0 && (y(), w?.(), S.current = !1);
|
|
1427
1427
|
},
|
|
1428
1428
|
[y, w]
|
|
1429
1429
|
);
|
|
1430
1430
|
return /* @__PURE__ */ a.jsx(
|
|
1431
|
-
|
|
1431
|
+
Ho,
|
|
1432
1432
|
{
|
|
1433
1433
|
scope: t,
|
|
1434
1434
|
contentWrapper: l,
|
|
@@ -1445,10 +1445,10 @@ var Fo = "SelectItemAlignedPosition", mn = c.forwardRef((e, n) => {
|
|
|
1445
1445
|
zIndex: R
|
|
1446
1446
|
},
|
|
1447
1447
|
children: /* @__PURE__ */ a.jsx(
|
|
1448
|
-
|
|
1448
|
+
j.div,
|
|
1449
1449
|
{
|
|
1450
1450
|
...r,
|
|
1451
|
-
ref:
|
|
1451
|
+
ref: p,
|
|
1452
1452
|
style: {
|
|
1453
1453
|
// When we get the height of the content, it includes borders. If we were to set
|
|
1454
1454
|
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
@@ -1464,8 +1464,8 @@ var Fo = "SelectItemAlignedPosition", mn = c.forwardRef((e, n) => {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
);
|
|
1466
1466
|
});
|
|
1467
|
-
|
|
1468
|
-
var
|
|
1467
|
+
hn.displayName = Vo;
|
|
1468
|
+
var Ko = "SelectPopperPosition", et = c.forwardRef((e, n) => {
|
|
1469
1469
|
const {
|
|
1470
1470
|
__scopeSelect: t,
|
|
1471
1471
|
align: o = "start",
|
|
@@ -1473,7 +1473,7 @@ var $o = "SelectPopperPosition", et = c.forwardRef((e, n) => {
|
|
|
1473
1473
|
...i
|
|
1474
1474
|
} = e, s = Ve(t);
|
|
1475
1475
|
return /* @__PURE__ */ a.jsx(
|
|
1476
|
-
|
|
1476
|
+
vr,
|
|
1477
1477
|
{
|
|
1478
1478
|
...s,
|
|
1479
1479
|
...i,
|
|
@@ -1493,8 +1493,8 @@ var $o = "SelectPopperPosition", et = c.forwardRef((e, n) => {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
);
|
|
1495
1495
|
});
|
|
1496
|
-
et.displayName =
|
|
1497
|
-
var [
|
|
1496
|
+
et.displayName = Ko;
|
|
1497
|
+
var [Ho, mt] = Se(me, {}), tt = "SelectViewport", vn = c.forwardRef(
|
|
1498
1498
|
(e, n) => {
|
|
1499
1499
|
const { __scopeSelect: t, nonce: o, ...r } = e, i = se(tt, t), s = mt(tt, t), l = V(n, i.onViewportChange), d = c.useRef(0);
|
|
1500
1500
|
return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
@@ -1507,8 +1507,8 @@ var [Vo, mt] = Se(me, {}), tt = "SelectViewport", hn = c.forwardRef(
|
|
|
1507
1507
|
nonce: o
|
|
1508
1508
|
}
|
|
1509
1509
|
),
|
|
1510
|
-
/* @__PURE__ */ a.jsx(
|
|
1511
|
-
|
|
1510
|
+
/* @__PURE__ */ a.jsx(Be.Slot, { scope: t, children: /* @__PURE__ */ a.jsx(
|
|
1511
|
+
j.div,
|
|
1512
1512
|
{
|
|
1513
1513
|
"data-radix-select-viewport": "",
|
|
1514
1514
|
role: "presentation",
|
|
@@ -1528,40 +1528,40 @@ var [Vo, mt] = Se(me, {}), tt = "SelectViewport", hn = c.forwardRef(
|
|
|
1528
1528
|
...r.style
|
|
1529
1529
|
},
|
|
1530
1530
|
onScroll: P(r.onScroll, (u) => {
|
|
1531
|
-
const
|
|
1532
|
-
if (g?.current &&
|
|
1533
|
-
const x = Math.abs(d.current -
|
|
1531
|
+
const f = u.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef: g } = s;
|
|
1532
|
+
if (g?.current && p) {
|
|
1533
|
+
const x = Math.abs(d.current - f.scrollTop);
|
|
1534
1534
|
if (x > 0) {
|
|
1535
|
-
const S = window.innerHeight - ee * 2, m = parseFloat(
|
|
1535
|
+
const S = window.innerHeight - ee * 2, m = parseFloat(p.style.minHeight), h = parseFloat(p.style.height), b = Math.max(m, h);
|
|
1536
1536
|
if (b < S) {
|
|
1537
1537
|
const w = b + x, y = Math.min(S, w), R = w - y;
|
|
1538
|
-
|
|
1538
|
+
p.style.height = y + "px", p.style.bottom === "0px" && (f.scrollTop = R > 0 ? R : 0, p.style.justifyContent = "flex-end");
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
|
-
d.current =
|
|
1542
|
+
d.current = f.scrollTop;
|
|
1543
1543
|
})
|
|
1544
1544
|
}
|
|
1545
1545
|
) })
|
|
1546
1546
|
] });
|
|
1547
1547
|
}
|
|
1548
1548
|
);
|
|
1549
|
-
|
|
1550
|
-
var
|
|
1549
|
+
vn.displayName = tt;
|
|
1550
|
+
var gn = "SelectGroup", [Uo, Go] = Se(gn), zo = c.forwardRef(
|
|
1551
1551
|
(e, n) => {
|
|
1552
1552
|
const { __scopeSelect: t, ...o } = e, r = te();
|
|
1553
|
-
return /* @__PURE__ */ a.jsx(
|
|
1553
|
+
return /* @__PURE__ */ a.jsx(Uo, { scope: t, id: r, children: /* @__PURE__ */ a.jsx(j.div, { role: "group", "aria-labelledby": r, ...o, ref: n }) });
|
|
1554
1554
|
}
|
|
1555
1555
|
);
|
|
1556
|
-
|
|
1557
|
-
var
|
|
1556
|
+
zo.displayName = gn;
|
|
1557
|
+
var xn = "SelectLabel", Wo = c.forwardRef(
|
|
1558
1558
|
(e, n) => {
|
|
1559
|
-
const { __scopeSelect: t, ...o } = e, r =
|
|
1560
|
-
return /* @__PURE__ */ a.jsx(
|
|
1559
|
+
const { __scopeSelect: t, ...o } = e, r = Go(xn, t);
|
|
1560
|
+
return /* @__PURE__ */ a.jsx(j.div, { id: r.id, ...o, ref: n });
|
|
1561
1561
|
}
|
|
1562
1562
|
);
|
|
1563
|
-
|
|
1564
|
-
var Te = "SelectItem", [
|
|
1563
|
+
Wo.displayName = xn;
|
|
1564
|
+
var Te = "SelectItem", [qo, bn] = Se(Te), Sn = c.forwardRef(
|
|
1565
1565
|
(e, n) => {
|
|
1566
1566
|
const {
|
|
1567
1567
|
__scopeSelect: t,
|
|
@@ -1569,10 +1569,10 @@ var Te = "SelectItem", [zo, xn] = Se(Te), bn = c.forwardRef(
|
|
|
1569
1569
|
disabled: r = !1,
|
|
1570
1570
|
textValue: i,
|
|
1571
1571
|
...s
|
|
1572
|
-
} = e, l = ae(Te, t), d = se(Te, t), u = l.value === o, [
|
|
1572
|
+
} = e, l = ae(Te, t), d = se(Te, t), u = l.value === o, [f, p] = c.useState(i ?? ""), [g, x] = c.useState(!1), S = V(
|
|
1573
1573
|
n,
|
|
1574
1574
|
(w) => d.itemRefCallback?.(w, o, r)
|
|
1575
|
-
), m = te(),
|
|
1575
|
+
), m = te(), h = c.useRef("touch"), b = () => {
|
|
1576
1576
|
r || (l.onValueChange(o), l.onOpenChange(!1));
|
|
1577
1577
|
};
|
|
1578
1578
|
if (o === "")
|
|
@@ -1580,7 +1580,7 @@ var Te = "SelectItem", [zo, xn] = Se(Te), bn = c.forwardRef(
|
|
|
1580
1580
|
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
1581
1581
|
);
|
|
1582
1582
|
return /* @__PURE__ */ a.jsx(
|
|
1583
|
-
|
|
1583
|
+
qo,
|
|
1584
1584
|
{
|
|
1585
1585
|
scope: t,
|
|
1586
1586
|
value: o,
|
|
@@ -1588,17 +1588,17 @@ var Te = "SelectItem", [zo, xn] = Se(Te), bn = c.forwardRef(
|
|
|
1588
1588
|
textId: m,
|
|
1589
1589
|
isSelected: u,
|
|
1590
1590
|
onItemTextChange: c.useCallback((w) => {
|
|
1591
|
-
|
|
1591
|
+
p((y) => y || (w?.textContent ?? "").trim());
|
|
1592
1592
|
}, []),
|
|
1593
1593
|
children: /* @__PURE__ */ a.jsx(
|
|
1594
|
-
|
|
1594
|
+
Be.ItemSlot,
|
|
1595
1595
|
{
|
|
1596
1596
|
scope: t,
|
|
1597
1597
|
value: o,
|
|
1598
1598
|
disabled: r,
|
|
1599
|
-
textValue:
|
|
1599
|
+
textValue: f,
|
|
1600
1600
|
children: /* @__PURE__ */ a.jsx(
|
|
1601
|
-
|
|
1601
|
+
j.div,
|
|
1602
1602
|
{
|
|
1603
1603
|
role: "option",
|
|
1604
1604
|
"aria-labelledby": m,
|
|
@@ -1613,22 +1613,22 @@ var Te = "SelectItem", [zo, xn] = Se(Te), bn = c.forwardRef(
|
|
|
1613
1613
|
onFocus: P(s.onFocus, () => x(!0)),
|
|
1614
1614
|
onBlur: P(s.onBlur, () => x(!1)),
|
|
1615
1615
|
onClick: P(s.onClick, () => {
|
|
1616
|
-
|
|
1616
|
+
h.current !== "mouse" && b();
|
|
1617
1617
|
}),
|
|
1618
1618
|
onPointerUp: P(s.onPointerUp, () => {
|
|
1619
|
-
|
|
1619
|
+
h.current === "mouse" && b();
|
|
1620
1620
|
}),
|
|
1621
1621
|
onPointerDown: P(s.onPointerDown, (w) => {
|
|
1622
|
-
|
|
1622
|
+
h.current = w.pointerType;
|
|
1623
1623
|
}),
|
|
1624
1624
|
onPointerMove: P(s.onPointerMove, (w) => {
|
|
1625
|
-
|
|
1625
|
+
h.current = w.pointerType, r ? d.onItemLeave?.() : h.current === "mouse" && w.currentTarget.focus({ preventScroll: !0 });
|
|
1626
1626
|
}),
|
|
1627
1627
|
onPointerLeave: P(s.onPointerLeave, (w) => {
|
|
1628
1628
|
w.currentTarget === document.activeElement && d.onItemLeave?.();
|
|
1629
1629
|
}),
|
|
1630
1630
|
onKeyDown: P(s.onKeyDown, (w) => {
|
|
1631
|
-
d.searchRef?.current !== "" && w.key === " " || (
|
|
1631
|
+
d.searchRef?.current !== "" && w.key === " " || (To.includes(w.key) && b(), w.key === " " && w.preventDefault());
|
|
1632
1632
|
})
|
|
1633
1633
|
}
|
|
1634
1634
|
)
|
|
@@ -1638,33 +1638,33 @@ var Te = "SelectItem", [zo, xn] = Se(Te), bn = c.forwardRef(
|
|
|
1638
1638
|
);
|
|
1639
1639
|
}
|
|
1640
1640
|
);
|
|
1641
|
-
|
|
1642
|
-
var Ie = "SelectItemText",
|
|
1641
|
+
Sn.displayName = Te;
|
|
1642
|
+
var Ie = "SelectItemText", wn = c.forwardRef(
|
|
1643
1643
|
(e, n) => {
|
|
1644
|
-
const { __scopeSelect: t, className: o, style: r, ...i } = e, s = ae(Ie, t), l = se(Ie, t), d =
|
|
1644
|
+
const { __scopeSelect: t, className: o, style: r, ...i } = e, s = ae(Ie, t), l = se(Ie, t), d = bn(Ie, t), u = Oo(Ie, t), [f, p] = c.useState(null), g = V(
|
|
1645
1645
|
n,
|
|
1646
|
-
(b) =>
|
|
1646
|
+
(b) => p(b),
|
|
1647
1647
|
d.onItemTextChange,
|
|
1648
1648
|
(b) => l.itemTextRefCallback?.(b, d.value, d.disabled)
|
|
1649
|
-
), x =
|
|
1649
|
+
), x = f?.textContent, S = c.useMemo(
|
|
1650
1650
|
() => /* @__PURE__ */ a.jsx("option", { value: d.value, disabled: d.disabled, children: x }, d.value),
|
|
1651
1651
|
[d.disabled, d.value, x]
|
|
1652
|
-
), { onNativeOptionAdd: m, onNativeOptionRemove:
|
|
1653
|
-
return re(() => (m(S), () =>
|
|
1654
|
-
/* @__PURE__ */ a.jsx(
|
|
1655
|
-
d.isSelected && s.valueNode && !s.valueNodeHasChildren ?
|
|
1652
|
+
), { onNativeOptionAdd: m, onNativeOptionRemove: h } = u;
|
|
1653
|
+
return re(() => (m(S), () => h(S)), [m, h, S]), /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1654
|
+
/* @__PURE__ */ a.jsx(j.span, { id: d.textId, ...i, ref: g }),
|
|
1655
|
+
d.isSelected && s.valueNode && !s.valueNodeHasChildren ? Nt.createPortal(i.children, s.valueNode) : null
|
|
1656
1656
|
] });
|
|
1657
1657
|
}
|
|
1658
1658
|
);
|
|
1659
|
-
|
|
1660
|
-
var
|
|
1659
|
+
wn.displayName = Ie;
|
|
1660
|
+
var yn = "SelectItemIndicator", Cn = c.forwardRef(
|
|
1661
1661
|
(e, n) => {
|
|
1662
1662
|
const { __scopeSelect: t, ...o } = e;
|
|
1663
|
-
return
|
|
1663
|
+
return bn(yn, t).isSelected ? /* @__PURE__ */ a.jsx(j.span, { "aria-hidden": !0, ...o, ref: n }) : null;
|
|
1664
1664
|
}
|
|
1665
1665
|
);
|
|
1666
|
-
|
|
1667
|
-
var nt = "SelectScrollUpButton",
|
|
1666
|
+
Cn.displayName = yn;
|
|
1667
|
+
var nt = "SelectScrollUpButton", In = c.forwardRef((e, n) => {
|
|
1668
1668
|
const t = se(nt, e.__scopeSelect), o = mt(nt, e.__scopeSelect), [r, i] = c.useState(!1), s = V(n, o.onScrollButtonChange);
|
|
1669
1669
|
return re(() => {
|
|
1670
1670
|
if (t.viewport && t.isPositioned) {
|
|
@@ -1676,7 +1676,7 @@ var nt = "SelectScrollUpButton", Cn = c.forwardRef((e, n) => {
|
|
|
1676
1676
|
return l(), d.addEventListener("scroll", l), () => d.removeEventListener("scroll", l);
|
|
1677
1677
|
}
|
|
1678
1678
|
}, [t.viewport, t.isPositioned]), r ? /* @__PURE__ */ a.jsx(
|
|
1679
|
-
|
|
1679
|
+
kn,
|
|
1680
1680
|
{
|
|
1681
1681
|
...e,
|
|
1682
1682
|
ref: s,
|
|
@@ -1687,20 +1687,20 @@ var nt = "SelectScrollUpButton", Cn = c.forwardRef((e, n) => {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
) : null;
|
|
1689
1689
|
});
|
|
1690
|
-
|
|
1691
|
-
var rt = "SelectScrollDownButton",
|
|
1690
|
+
In.displayName = nt;
|
|
1691
|
+
var rt = "SelectScrollDownButton", Rn = c.forwardRef((e, n) => {
|
|
1692
1692
|
const t = se(rt, e.__scopeSelect), o = mt(rt, e.__scopeSelect), [r, i] = c.useState(!1), s = V(n, o.onScrollButtonChange);
|
|
1693
1693
|
return re(() => {
|
|
1694
1694
|
if (t.viewport && t.isPositioned) {
|
|
1695
1695
|
let l = function() {
|
|
1696
|
-
const u = d.scrollHeight - d.clientHeight,
|
|
1697
|
-
i(
|
|
1696
|
+
const u = d.scrollHeight - d.clientHeight, f = Math.ceil(d.scrollTop) < u;
|
|
1697
|
+
i(f);
|
|
1698
1698
|
};
|
|
1699
1699
|
const d = t.viewport;
|
|
1700
1700
|
return l(), d.addEventListener("scroll", l), () => d.removeEventListener("scroll", l);
|
|
1701
1701
|
}
|
|
1702
1702
|
}, [t.viewport, t.isPositioned]), r ? /* @__PURE__ */ a.jsx(
|
|
1703
|
-
|
|
1703
|
+
kn,
|
|
1704
1704
|
{
|
|
1705
1705
|
...e,
|
|
1706
1706
|
ref: s,
|
|
@@ -1711,15 +1711,15 @@ var rt = "SelectScrollDownButton", In = c.forwardRef((e, n) => {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
) : null;
|
|
1713
1713
|
});
|
|
1714
|
-
|
|
1715
|
-
var
|
|
1714
|
+
Rn.displayName = rt;
|
|
1715
|
+
var kn = c.forwardRef((e, n) => {
|
|
1716
1716
|
const { __scopeSelect: t, onAutoScroll: o, ...r } = e, i = se("SelectScrollButton", t), s = c.useRef(null), l = $e(t), d = c.useCallback(() => {
|
|
1717
1717
|
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
1718
1718
|
}, []);
|
|
1719
1719
|
return c.useEffect(() => () => d(), [d]), re(() => {
|
|
1720
|
-
l().find((
|
|
1720
|
+
l().find((f) => f.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1721
1721
|
}, [l]), /* @__PURE__ */ a.jsx(
|
|
1722
|
-
|
|
1722
|
+
j.div,
|
|
1723
1723
|
{
|
|
1724
1724
|
"aria-hidden": !0,
|
|
1725
1725
|
...r,
|
|
@@ -1736,51 +1736,51 @@ var Rn = c.forwardRef((e, n) => {
|
|
|
1736
1736
|
})
|
|
1737
1737
|
}
|
|
1738
1738
|
);
|
|
1739
|
-
}),
|
|
1739
|
+
}), Yo = "SelectSeparator", En = c.forwardRef(
|
|
1740
1740
|
(e, n) => {
|
|
1741
1741
|
const { __scopeSelect: t, ...o } = e;
|
|
1742
|
-
return /* @__PURE__ */ a.jsx(
|
|
1742
|
+
return /* @__PURE__ */ a.jsx(j.div, { "aria-hidden": !0, ...o, ref: n });
|
|
1743
1743
|
}
|
|
1744
1744
|
);
|
|
1745
|
-
|
|
1746
|
-
var ot = "SelectArrow",
|
|
1745
|
+
En.displayName = Yo;
|
|
1746
|
+
var ot = "SelectArrow", Xo = c.forwardRef(
|
|
1747
1747
|
(e, n) => {
|
|
1748
1748
|
const { __scopeSelect: t, ...o } = e, r = Ve(t), i = ae(ot, t), s = se(ot, t);
|
|
1749
|
-
return i.open && s.position === "popper" ? /* @__PURE__ */ a.jsx(
|
|
1749
|
+
return i.open && s.position === "popper" ? /* @__PURE__ */ a.jsx(gr, { ...r, ...o, ref: n }) : null;
|
|
1750
1750
|
}
|
|
1751
1751
|
);
|
|
1752
|
-
|
|
1753
|
-
var
|
|
1752
|
+
Xo.displayName = ot;
|
|
1753
|
+
var Zo = "SelectBubbleInput", _n = c.forwardRef(
|
|
1754
1754
|
({ __scopeSelect: e, value: n, ...t }, o) => {
|
|
1755
|
-
const r = c.useRef(null), i = V(o, r), s =
|
|
1755
|
+
const r = c.useRef(null), i = V(o, r), s = _e(n);
|
|
1756
1756
|
return c.useEffect(() => {
|
|
1757
1757
|
const l = r.current;
|
|
1758
1758
|
if (!l) return;
|
|
1759
|
-
const d = window.HTMLSelectElement.prototype,
|
|
1759
|
+
const d = window.HTMLSelectElement.prototype, f = Object.getOwnPropertyDescriptor(
|
|
1760
1760
|
d,
|
|
1761
1761
|
"value"
|
|
1762
1762
|
).set;
|
|
1763
|
-
if (s !== n &&
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1763
|
+
if (s !== n && f) {
|
|
1764
|
+
const p = new Event("change", { bubbles: !0 });
|
|
1765
|
+
f.call(l, n), l.dispatchEvent(p);
|
|
1766
1766
|
}
|
|
1767
1767
|
}, [s, n]), /* @__PURE__ */ a.jsx(
|
|
1768
|
-
|
|
1768
|
+
j.select,
|
|
1769
1769
|
{
|
|
1770
1770
|
...t,
|
|
1771
|
-
style: { ...
|
|
1771
|
+
style: { ...lr, ...t.style },
|
|
1772
1772
|
ref: i,
|
|
1773
1773
|
defaultValue: n
|
|
1774
1774
|
}
|
|
1775
1775
|
);
|
|
1776
1776
|
}
|
|
1777
1777
|
);
|
|
1778
|
-
|
|
1779
|
-
function
|
|
1778
|
+
_n.displayName = Zo;
|
|
1779
|
+
function jn(e) {
|
|
1780
1780
|
return e === "" || e === void 0;
|
|
1781
1781
|
}
|
|
1782
|
-
function
|
|
1783
|
-
const n =
|
|
1782
|
+
function Pn(e) {
|
|
1783
|
+
const n = yt(e), t = c.useRef(""), o = c.useRef(0), r = c.useCallback(
|
|
1784
1784
|
(s) => {
|
|
1785
1785
|
const l = t.current + s;
|
|
1786
1786
|
n(l), function d(u) {
|
|
@@ -1793,35 +1793,35 @@ function jn(e) {
|
|
|
1793
1793
|
}, []);
|
|
1794
1794
|
return c.useEffect(() => () => window.clearTimeout(o.current), []), [t, r, i];
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function Nn(e, n, t) {
|
|
1797
1797
|
const r = n.length > 1 && Array.from(n).every((u) => u === n[0]) ? n[0] : n, i = t ? e.indexOf(t) : -1;
|
|
1798
|
-
let s =
|
|
1798
|
+
let s = Jo(e, Math.max(i, 0));
|
|
1799
1799
|
r.length === 1 && (s = s.filter((u) => u !== t));
|
|
1800
1800
|
const d = s.find(
|
|
1801
1801
|
(u) => u.textValue.toLowerCase().startsWith(r.toLowerCase())
|
|
1802
1802
|
);
|
|
1803
1803
|
return d !== t ? d : void 0;
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1805
|
+
function Jo(e, n) {
|
|
1806
1806
|
return e.map((t, o) => e[(n + o) % e.length]);
|
|
1807
1807
|
}
|
|
1808
|
-
var
|
|
1809
|
-
function
|
|
1810
|
-
return /* @__PURE__ */ a.jsx(
|
|
1808
|
+
var Qo = on, ea = sn, ta = ln, na = dn, ra = un, oa = pn, aa = vn, sa = Sn, ia = wn, ca = Cn, la = In, da = Rn, ua = En;
|
|
1809
|
+
function pa({ ...e }) {
|
|
1810
|
+
return /* @__PURE__ */ a.jsx(Qo, { "data-slot": "select", ...e });
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1813
|
-
return /* @__PURE__ */ a.jsx(
|
|
1812
|
+
function fa({ ...e }) {
|
|
1813
|
+
return /* @__PURE__ */ a.jsx(ta, { "data-slot": "select-value", ...e });
|
|
1814
1814
|
}
|
|
1815
|
-
function
|
|
1815
|
+
function ma({
|
|
1816
1816
|
className: e,
|
|
1817
1817
|
size: n = "default",
|
|
1818
1818
|
children: t,
|
|
1819
1819
|
...o
|
|
1820
1820
|
}) {
|
|
1821
1821
|
return /* @__PURE__ */ a.jsxs(
|
|
1822
|
-
|
|
1822
|
+
ea,
|
|
1823
1823
|
{
|
|
1824
|
-
className:
|
|
1824
|
+
className: L(
|
|
1825
1825
|
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1826
1826
|
e
|
|
1827
1827
|
),
|
|
@@ -1830,23 +1830,23 @@ function pa({
|
|
|
1830
1830
|
...o,
|
|
1831
1831
|
children: [
|
|
1832
1832
|
t,
|
|
1833
|
-
/* @__PURE__ */ a.jsx(
|
|
1833
|
+
/* @__PURE__ */ a.jsx(na, { asChild: !0, children: /* @__PURE__ */ a.jsx(_t, { className: "size-4 opacity-50" }) })
|
|
1834
1834
|
]
|
|
1835
1835
|
}
|
|
1836
1836
|
);
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1838
|
+
function ha({
|
|
1839
1839
|
className: e,
|
|
1840
1840
|
children: n,
|
|
1841
1841
|
position: t = "popper",
|
|
1842
1842
|
align: o = "center",
|
|
1843
1843
|
...r
|
|
1844
1844
|
}) {
|
|
1845
|
-
return /* @__PURE__ */ a.jsx(
|
|
1846
|
-
|
|
1845
|
+
return /* @__PURE__ */ a.jsx(ra, { children: /* @__PURE__ */ a.jsxs(
|
|
1846
|
+
oa,
|
|
1847
1847
|
{
|
|
1848
1848
|
align: o,
|
|
1849
|
-
className:
|
|
1849
|
+
className: L(
|
|
1850
1850
|
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
1851
1851
|
t === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
1852
1852
|
e
|
|
@@ -1855,65 +1855,75 @@ function fa({
|
|
|
1855
1855
|
position: t,
|
|
1856
1856
|
...r,
|
|
1857
1857
|
children: [
|
|
1858
|
-
/* @__PURE__ */ a.jsx(
|
|
1858
|
+
/* @__PURE__ */ a.jsx(ga, {}),
|
|
1859
1859
|
/* @__PURE__ */ a.jsx(
|
|
1860
|
-
|
|
1860
|
+
aa,
|
|
1861
1861
|
{
|
|
1862
|
-
className:
|
|
1862
|
+
className: L(
|
|
1863
1863
|
"p-1",
|
|
1864
1864
|
t === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
1865
1865
|
),
|
|
1866
1866
|
children: n
|
|
1867
1867
|
}
|
|
1868
1868
|
),
|
|
1869
|
-
/* @__PURE__ */ a.jsx(
|
|
1869
|
+
/* @__PURE__ */ a.jsx(xa, {})
|
|
1870
1870
|
]
|
|
1871
1871
|
}
|
|
1872
1872
|
) });
|
|
1873
1873
|
}
|
|
1874
|
-
function
|
|
1874
|
+
function xt({ className: e, children: n, ...t }) {
|
|
1875
1875
|
return /* @__PURE__ */ a.jsxs(
|
|
1876
|
-
|
|
1876
|
+
sa,
|
|
1877
1877
|
{
|
|
1878
|
-
className:
|
|
1878
|
+
className: L(
|
|
1879
1879
|
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
1880
1880
|
e
|
|
1881
1881
|
),
|
|
1882
1882
|
"data-slot": "select-item",
|
|
1883
1883
|
...t,
|
|
1884
1884
|
children: [
|
|
1885
|
-
/* @__PURE__ */ a.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(
|
|
1886
|
-
/* @__PURE__ */ a.jsx(
|
|
1885
|
+
/* @__PURE__ */ a.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(ca, { children: /* @__PURE__ */ a.jsx(ut, { className: "size-4" }) }) }),
|
|
1886
|
+
/* @__PURE__ */ a.jsx(ia, { children: n })
|
|
1887
1887
|
]
|
|
1888
1888
|
}
|
|
1889
1889
|
);
|
|
1890
1890
|
}
|
|
1891
|
-
function
|
|
1891
|
+
function va({ className: e, ...n }) {
|
|
1892
1892
|
return /* @__PURE__ */ a.jsx(
|
|
1893
|
-
|
|
1893
|
+
ua,
|
|
1894
1894
|
{
|
|
1895
|
-
className:
|
|
1895
|
+
className: L("bg-border pointer-events-none -mx-1 my-1 h-px", e),
|
|
1896
|
+
"data-slot": "select-separator",
|
|
1897
|
+
...n
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
}
|
|
1901
|
+
function ga({ className: e, ...n }) {
|
|
1902
|
+
return /* @__PURE__ */ a.jsx(
|
|
1903
|
+
la,
|
|
1904
|
+
{
|
|
1905
|
+
className: L("flex cursor-default items-center justify-center py-1", e),
|
|
1896
1906
|
"data-slot": "select-scroll-up-button",
|
|
1897
1907
|
...n,
|
|
1898
|
-
children: /* @__PURE__ */ a.jsx(
|
|
1908
|
+
children: /* @__PURE__ */ a.jsx(Tr, { className: "size-4" })
|
|
1899
1909
|
}
|
|
1900
1910
|
);
|
|
1901
1911
|
}
|
|
1902
|
-
function
|
|
1912
|
+
function xa({
|
|
1903
1913
|
className: e,
|
|
1904
1914
|
...n
|
|
1905
1915
|
}) {
|
|
1906
1916
|
return /* @__PURE__ */ a.jsx(
|
|
1907
|
-
|
|
1917
|
+
da,
|
|
1908
1918
|
{
|
|
1909
|
-
className:
|
|
1919
|
+
className: L("flex cursor-default items-center justify-center py-1", e),
|
|
1910
1920
|
"data-slot": "select-scroll-down-button",
|
|
1911
1921
|
...n,
|
|
1912
|
-
children: /* @__PURE__ */ a.jsx(
|
|
1922
|
+
children: /* @__PURE__ */ a.jsx(_t, { className: "size-4" })
|
|
1913
1923
|
}
|
|
1914
1924
|
);
|
|
1915
1925
|
}
|
|
1916
|
-
const
|
|
1926
|
+
const $s = ({
|
|
1917
1927
|
name: e,
|
|
1918
1928
|
defaultValue: n,
|
|
1919
1929
|
options: t,
|
|
@@ -1924,10 +1934,11 @@ const Bs = ({
|
|
|
1924
1934
|
value: l,
|
|
1925
1935
|
onValueChange: d,
|
|
1926
1936
|
error: u,
|
|
1937
|
+
emptyOptionLabel: f,
|
|
1927
1938
|
size: p = "md",
|
|
1928
|
-
...
|
|
1939
|
+
...g
|
|
1929
1940
|
}) => {
|
|
1930
|
-
const
|
|
1941
|
+
const x = L(
|
|
1931
1942
|
"min-w-[180px]",
|
|
1932
1943
|
p === "xs" && "h-7 text-xs md:text-xs",
|
|
1933
1944
|
p === "sm" && "h-8 text-sm md:text-xs",
|
|
@@ -1935,112 +1946,118 @@ const Bs = ({
|
|
|
1935
1946
|
p === "lg" && "h-10 text-lg md:text-base",
|
|
1936
1947
|
p === "xl" && "h-11 text-xl md:text-lg",
|
|
1937
1948
|
s
|
|
1938
|
-
),
|
|
1949
|
+
), S = p === "xs" || p === "sm" ? "sm" : "default", m = "__none__", h = (b) => {
|
|
1950
|
+
d(b === m ? "" : b);
|
|
1951
|
+
};
|
|
1939
1952
|
return /* @__PURE__ */ a.jsxs(pe, { className: "w-full", direction: "col", gap: "2", children: [
|
|
1940
1953
|
o && /* @__PURE__ */ a.jsx(ue, { htmlFor: e, children: o }),
|
|
1941
1954
|
/* @__PURE__ */ a.jsxs(
|
|
1942
|
-
|
|
1955
|
+
pa,
|
|
1943
1956
|
{
|
|
1944
1957
|
defaultValue: n,
|
|
1945
1958
|
name: e,
|
|
1946
|
-
onValueChange:
|
|
1959
|
+
onValueChange: h,
|
|
1947
1960
|
value: l,
|
|
1948
|
-
...
|
|
1961
|
+
...g,
|
|
1949
1962
|
children: [
|
|
1950
|
-
/* @__PURE__ */ a.jsx(
|
|
1951
|
-
/* @__PURE__ */ a.
|
|
1963
|
+
/* @__PURE__ */ a.jsx(ma, { className: x, "data-testid": `select-input-${e}`, size: S, children: /* @__PURE__ */ a.jsx(fa, { placeholder: r }) }),
|
|
1964
|
+
/* @__PURE__ */ a.jsxs(ha, { children: [
|
|
1965
|
+
/* @__PURE__ */ a.jsx(xt, { value: m, children: f || /* @__PURE__ */ a.jsx(a.Fragment, { children: " " }) }, "empty-option"),
|
|
1966
|
+
/* @__PURE__ */ a.jsx(va, {}),
|
|
1967
|
+
t.map(({ value: b, label: w }) => /* @__PURE__ */ a.jsx(xt, { value: b, children: w }, `option-${b}`))
|
|
1968
|
+
] })
|
|
1952
1969
|
]
|
|
1953
1970
|
}
|
|
1954
1971
|
),
|
|
1955
|
-
i && /* @__PURE__ */ a.jsx(
|
|
1972
|
+
i && /* @__PURE__ */ a.jsx(Pt, { size: "sm", variant: "muted", children: i }),
|
|
1956
1973
|
u && /* @__PURE__ */ a.jsx(Oe, { message: u })
|
|
1957
1974
|
] });
|
|
1958
1975
|
};
|
|
1959
|
-
var
|
|
1976
|
+
var bt = 1, ba = 0.9, Sa = 0.8, wa = 0.17, Xe = 0.1, Ze = 0.999, ya = 0.9999, Ca = 0.99, Ia = /[\\\/_+.#"@\[\(\{&]/, Ra = /[\\\/_+.#"@\[\(\{&]/g, ka = /[\s-]/, Tn = /[\s-]/g;
|
|
1960
1977
|
function at(e, n, t, o, r, i, s) {
|
|
1961
|
-
if (i === n.length) return r === e.length ?
|
|
1978
|
+
if (i === n.length) return r === e.length ? bt : Ca;
|
|
1962
1979
|
var l = `${r},${i}`;
|
|
1963
1980
|
if (s[l] !== void 0) return s[l];
|
|
1964
|
-
for (var d = o.charAt(i), u = t.indexOf(d, r),
|
|
1965
|
-
return s[l] =
|
|
1981
|
+
for (var d = o.charAt(i), u = t.indexOf(d, r), f = 0, p, g, x, S; u >= 0; ) p = at(e, n, t, o, u + 1, i + 1, s), p > f && (u === r ? p *= bt : Ia.test(e.charAt(u - 1)) ? (p *= Sa, x = e.slice(r, u - 1).match(Ra), x && r > 0 && (p *= Math.pow(Ze, x.length))) : ka.test(e.charAt(u - 1)) ? (p *= ba, S = e.slice(r, u - 1).match(Tn), S && r > 0 && (p *= Math.pow(Ze, S.length))) : (p *= wa, r > 0 && (p *= Math.pow(Ze, u - r))), e.charAt(u) !== n.charAt(i) && (p *= ya)), (p < Xe && t.charAt(u - 1) === o.charAt(i + 1) || o.charAt(i + 1) === o.charAt(i) && t.charAt(u - 1) !== o.charAt(i)) && (g = at(e, n, t, o, u + 1, i + 2, s), g * Xe > p && (p = g * Xe)), p > f && (f = p), u = t.indexOf(d, u + 1);
|
|
1982
|
+
return s[l] = f, f;
|
|
1966
1983
|
}
|
|
1967
|
-
function
|
|
1968
|
-
return e.toLowerCase().replace(
|
|
1984
|
+
function St(e) {
|
|
1985
|
+
return e.toLowerCase().replace(Tn, " ");
|
|
1969
1986
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, at(e, n,
|
|
1987
|
+
function Ea(e, n, t) {
|
|
1988
|
+
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, at(e, n, St(e), St(n), 0, 0, {});
|
|
1972
1989
|
}
|
|
1973
|
-
var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]',
|
|
1990
|
+
var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', _a = '[cmdk-group-heading=""]', Mn = '[cmdk-item=""]', wt = `${Mn}:not([aria-disabled="true"])`, st = "cmdk-item-select", xe = "data-value", ja = (e, n, t) => Ea(e, n, t), An = c.createContext(void 0), je = () => c.useContext(An), Dn = c.createContext(void 0), ht = () => c.useContext(Dn), On = c.createContext(void 0), Ln = c.forwardRef((e, n) => {
|
|
1974
1991
|
let t = be(() => {
|
|
1975
|
-
var
|
|
1976
|
-
return { search: "", value: (k = (
|
|
1977
|
-
}), o = be(() => /* @__PURE__ */ new Set()), r = be(() => /* @__PURE__ */ new Map()), i = be(() => /* @__PURE__ */ new Map()), s = be(() => /* @__PURE__ */ new Set()), l =
|
|
1992
|
+
var v, k;
|
|
1993
|
+
return { search: "", value: (k = (v = e.value) != null ? v : e.defaultValue) != null ? k : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
1994
|
+
}), o = be(() => /* @__PURE__ */ new Set()), r = be(() => /* @__PURE__ */ new Map()), i = be(() => /* @__PURE__ */ new Map()), s = be(() => /* @__PURE__ */ new Set()), l = Fn(e), { label: d, children: u, value: f, onValueChange: p, filter: g, shouldFilter: x, loop: S, disablePointerSelection: m = !1, vimBindings: h = !0, ...b } = e, w = te(), y = te(), R = te(), A = c.useRef(null), N = $a();
|
|
1978
1995
|
he(() => {
|
|
1979
|
-
if (
|
|
1980
|
-
let
|
|
1981
|
-
t.current.value =
|
|
1996
|
+
if (f !== void 0) {
|
|
1997
|
+
let v = f.trim();
|
|
1998
|
+
t.current.value = v, _.emit();
|
|
1982
1999
|
}
|
|
1983
|
-
}, [
|
|
2000
|
+
}, [f]), he(() => {
|
|
1984
2001
|
N(6, X);
|
|
1985
2002
|
}, []);
|
|
1986
|
-
let
|
|
2003
|
+
let _ = c.useMemo(() => ({ subscribe: (v) => (s.current.add(v), () => s.current.delete(v)), snapshot: () => t.current, setState: (v, k, E) => {
|
|
1987
2004
|
var I, T, C, M;
|
|
1988
|
-
if (!Object.is(t.current[
|
|
1989
|
-
if (t.current[
|
|
1990
|
-
else if (
|
|
2005
|
+
if (!Object.is(t.current[v], k)) {
|
|
2006
|
+
if (t.current[v] = k, v === "search") K(), z(), N(1, D);
|
|
2007
|
+
else if (v === "value") {
|
|
1991
2008
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
1992
|
-
let
|
|
1993
|
-
|
|
2009
|
+
let B = document.getElementById(R);
|
|
2010
|
+
B ? B.focus() : (I = document.getElementById(w)) == null || I.focus();
|
|
1994
2011
|
}
|
|
1995
2012
|
if (N(7, () => {
|
|
1996
|
-
var
|
|
1997
|
-
t.current.selectedItemId = (
|
|
2013
|
+
var B;
|
|
2014
|
+
t.current.selectedItemId = (B = W()) == null ? void 0 : B.id, _.emit();
|
|
1998
2015
|
}), E || N(5, X), ((T = l.current) == null ? void 0 : T.value) !== void 0) {
|
|
1999
|
-
let
|
|
2000
|
-
(M = (C = l.current).onValueChange) == null || M.call(C,
|
|
2016
|
+
let B = k ?? "";
|
|
2017
|
+
(M = (C = l.current).onValueChange) == null || M.call(C, B);
|
|
2001
2018
|
return;
|
|
2002
2019
|
}
|
|
2003
2020
|
}
|
|
2004
|
-
|
|
2021
|
+
_.emit();
|
|
2005
2022
|
}
|
|
2006
2023
|
}, emit: () => {
|
|
2007
|
-
s.current.forEach((
|
|
2008
|
-
} }), []),
|
|
2024
|
+
s.current.forEach((v) => v());
|
|
2025
|
+
} }), []), F = c.useMemo(() => ({ value: (v, k, E) => {
|
|
2009
2026
|
var I;
|
|
2010
|
-
k !== ((I = i.current.get(
|
|
2011
|
-
z(),
|
|
2027
|
+
k !== ((I = i.current.get(v)) == null ? void 0 : I.value) && (i.current.set(v, { value: k, keywords: E }), t.current.filtered.items.set(v, Z(k, E)), N(2, () => {
|
|
2028
|
+
z(), _.emit();
|
|
2012
2029
|
}));
|
|
2013
|
-
}, item: (
|
|
2014
|
-
K(), z(), t.current.value || D(),
|
|
2030
|
+
}, item: (v, k) => (o.current.add(v), k && (r.current.has(k) ? r.current.get(k).add(v) : r.current.set(k, /* @__PURE__ */ new Set([v]))), N(3, () => {
|
|
2031
|
+
K(), z(), t.current.value || D(), _.emit();
|
|
2015
2032
|
}), () => {
|
|
2016
|
-
i.current.delete(
|
|
2033
|
+
i.current.delete(v), o.current.delete(v), t.current.filtered.items.delete(v);
|
|
2017
2034
|
let E = W();
|
|
2018
2035
|
N(4, () => {
|
|
2019
|
-
K(), E?.getAttribute("id") ===
|
|
2036
|
+
K(), E?.getAttribute("id") === v && D(), _.emit();
|
|
2020
2037
|
});
|
|
2021
|
-
}), group: (
|
|
2022
|
-
i.current.delete(
|
|
2038
|
+
}), group: (v) => (r.current.has(v) || r.current.set(v, /* @__PURE__ */ new Set()), () => {
|
|
2039
|
+
i.current.delete(v), r.current.delete(v);
|
|
2023
2040
|
}), filter: () => l.current.shouldFilter, label: d || e["aria-label"], getDisablePointerSelection: () => l.current.disablePointerSelection, listId: w, inputId: R, labelId: y, listInnerRef: A }), []);
|
|
2024
|
-
function Z(
|
|
2041
|
+
function Z(v, k) {
|
|
2025
2042
|
var E, I;
|
|
2026
|
-
let T = (I = (E = l.current) == null ? void 0 : E.filter) != null ? I :
|
|
2027
|
-
return
|
|
2043
|
+
let T = (I = (E = l.current) == null ? void 0 : E.filter) != null ? I : ja;
|
|
2044
|
+
return v ? T(v, t.current.search, k) : 0;
|
|
2028
2045
|
}
|
|
2029
2046
|
function z() {
|
|
2030
2047
|
if (!t.current.search || l.current.shouldFilter === !1) return;
|
|
2031
|
-
let
|
|
2048
|
+
let v = t.current.filtered.items, k = [];
|
|
2032
2049
|
t.current.filtered.groups.forEach((I) => {
|
|
2033
2050
|
let T = r.current.get(I), C = 0;
|
|
2034
2051
|
T.forEach((M) => {
|
|
2035
|
-
let
|
|
2036
|
-
C = Math.max(
|
|
2052
|
+
let B = v.get(M);
|
|
2053
|
+
C = Math.max(B, C);
|
|
2037
2054
|
}), k.push([I, C]);
|
|
2038
2055
|
});
|
|
2039
2056
|
let E = A.current;
|
|
2040
2057
|
U().sort((I, T) => {
|
|
2041
2058
|
var C, M;
|
|
2042
|
-
let
|
|
2043
|
-
return ((C =
|
|
2059
|
+
let B = I.getAttribute("id"), $ = T.getAttribute("id");
|
|
2060
|
+
return ((C = v.get($)) != null ? C : 0) - ((M = v.get(B)) != null ? M : 0);
|
|
2044
2061
|
}).forEach((I) => {
|
|
2045
2062
|
let T = I.closest(Je);
|
|
2046
2063
|
T ? T.appendChild(I.parentElement === T ? I : I.closest(`${Je} > *`)) : E.appendChild(I.parentElement === E ? I : I.closest(`${Je} > *`));
|
|
@@ -2051,11 +2068,11 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2051
2068
|
});
|
|
2052
2069
|
}
|
|
2053
2070
|
function D() {
|
|
2054
|
-
let
|
|
2055
|
-
|
|
2071
|
+
let v = U().find((E) => E.getAttribute("aria-disabled") !== "true"), k = v?.getAttribute(xe);
|
|
2072
|
+
_.setState("value", k || void 0);
|
|
2056
2073
|
}
|
|
2057
2074
|
function K() {
|
|
2058
|
-
var
|
|
2075
|
+
var v, k, E, I;
|
|
2059
2076
|
if (!t.current.search || l.current.shouldFilter === !1) {
|
|
2060
2077
|
t.current.filtered.count = o.current.size;
|
|
2061
2078
|
return;
|
|
@@ -2063,80 +2080,80 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2063
2080
|
t.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
2064
2081
|
let T = 0;
|
|
2065
2082
|
for (let C of o.current) {
|
|
2066
|
-
let M = (k = (
|
|
2083
|
+
let M = (k = (v = i.current.get(C)) == null ? void 0 : v.value) != null ? k : "", B = (I = (E = i.current.get(C)) == null ? void 0 : E.keywords) != null ? I : [], $ = Z(M, B);
|
|
2067
2084
|
t.current.filtered.items.set(C, $), $ > 0 && T++;
|
|
2068
2085
|
}
|
|
2069
|
-
for (let [C, M] of r.current) for (let
|
|
2086
|
+
for (let [C, M] of r.current) for (let B of M) if (t.current.filtered.items.get(B) > 0) {
|
|
2070
2087
|
t.current.filtered.groups.add(C);
|
|
2071
2088
|
break;
|
|
2072
2089
|
}
|
|
2073
2090
|
t.current.filtered.count = T;
|
|
2074
2091
|
}
|
|
2075
2092
|
function X() {
|
|
2076
|
-
var
|
|
2093
|
+
var v, k, E;
|
|
2077
2094
|
let I = W();
|
|
2078
|
-
I && (((
|
|
2095
|
+
I && (((v = I.parentElement) == null ? void 0 : v.firstChild) === I && ((E = (k = I.closest(Ce)) == null ? void 0 : k.querySelector(_a)) == null || E.scrollIntoView({ block: "nearest" })), I.scrollIntoView({ block: "nearest" }));
|
|
2079
2096
|
}
|
|
2080
2097
|
function W() {
|
|
2081
|
-
var
|
|
2082
|
-
return (
|
|
2098
|
+
var v;
|
|
2099
|
+
return (v = A.current) == null ? void 0 : v.querySelector(`${Mn}[aria-selected="true"]`);
|
|
2083
2100
|
}
|
|
2084
2101
|
function U() {
|
|
2085
|
-
var
|
|
2086
|
-
return Array.from(((
|
|
2102
|
+
var v;
|
|
2103
|
+
return Array.from(((v = A.current) == null ? void 0 : v.querySelectorAll(wt)) || []);
|
|
2087
2104
|
}
|
|
2088
|
-
function O(
|
|
2089
|
-
let k = U()[
|
|
2090
|
-
k &&
|
|
2105
|
+
function O(v) {
|
|
2106
|
+
let k = U()[v];
|
|
2107
|
+
k && _.setState("value", k.getAttribute(xe));
|
|
2091
2108
|
}
|
|
2092
|
-
function G(
|
|
2109
|
+
function G(v) {
|
|
2093
2110
|
var k;
|
|
2094
|
-
let E = W(), I = U(), T = I.findIndex((M) => M === E), C = I[T +
|
|
2095
|
-
(k = l.current) != null && k.loop && (C = T +
|
|
2111
|
+
let E = W(), I = U(), T = I.findIndex((M) => M === E), C = I[T + v];
|
|
2112
|
+
(k = l.current) != null && k.loop && (C = T + v < 0 ? I[I.length - 1] : T + v === I.length ? I[0] : I[T + v]), C && _.setState("value", C.getAttribute(xe));
|
|
2096
2113
|
}
|
|
2097
|
-
function q(
|
|
2114
|
+
function q(v) {
|
|
2098
2115
|
let k = W(), E = k?.closest(Ce), I;
|
|
2099
|
-
for (; E && !I; ) E =
|
|
2100
|
-
I ?
|
|
2116
|
+
for (; E && !I; ) E = v > 0 ? Fa(E, Ce) : Ba(E, Ce), I = E?.querySelector(wt);
|
|
2117
|
+
I ? _.setState("value", I.getAttribute(xe)) : G(v);
|
|
2101
2118
|
}
|
|
2102
|
-
let J = () => O(U().length - 1), ge = (
|
|
2103
|
-
|
|
2104
|
-
}, ie = (
|
|
2105
|
-
|
|
2119
|
+
let J = () => O(U().length - 1), ge = (v) => {
|
|
2120
|
+
v.preventDefault(), v.metaKey ? J() : v.altKey ? q(1) : G(1);
|
|
2121
|
+
}, ie = (v) => {
|
|
2122
|
+
v.preventDefault(), v.metaKey ? O(0) : v.altKey ? q(-1) : G(-1);
|
|
2106
2123
|
};
|
|
2107
|
-
return c.createElement(
|
|
2124
|
+
return c.createElement(j.div, { ref: n, tabIndex: -1, ...b, "cmdk-root": "", onKeyDown: (v) => {
|
|
2108
2125
|
var k;
|
|
2109
|
-
(k = b.onKeyDown) == null || k.call(b,
|
|
2110
|
-
let E =
|
|
2111
|
-
if (!(
|
|
2126
|
+
(k = b.onKeyDown) == null || k.call(b, v);
|
|
2127
|
+
let E = v.nativeEvent.isComposing || v.keyCode === 229;
|
|
2128
|
+
if (!(v.defaultPrevented || E)) switch (v.key) {
|
|
2112
2129
|
case "n":
|
|
2113
2130
|
case "j": {
|
|
2114
|
-
|
|
2131
|
+
h && v.ctrlKey && ge(v);
|
|
2115
2132
|
break;
|
|
2116
2133
|
}
|
|
2117
2134
|
case "ArrowDown": {
|
|
2118
|
-
ge(
|
|
2135
|
+
ge(v);
|
|
2119
2136
|
break;
|
|
2120
2137
|
}
|
|
2121
2138
|
case "p":
|
|
2122
2139
|
case "k": {
|
|
2123
|
-
|
|
2140
|
+
h && v.ctrlKey && ie(v);
|
|
2124
2141
|
break;
|
|
2125
2142
|
}
|
|
2126
2143
|
case "ArrowUp": {
|
|
2127
|
-
ie(
|
|
2144
|
+
ie(v);
|
|
2128
2145
|
break;
|
|
2129
2146
|
}
|
|
2130
2147
|
case "Home": {
|
|
2131
|
-
|
|
2148
|
+
v.preventDefault(), O(0);
|
|
2132
2149
|
break;
|
|
2133
2150
|
}
|
|
2134
2151
|
case "End": {
|
|
2135
|
-
|
|
2152
|
+
v.preventDefault(), J();
|
|
2136
2153
|
break;
|
|
2137
2154
|
}
|
|
2138
2155
|
case "Enter": {
|
|
2139
|
-
|
|
2156
|
+
v.preventDefault();
|
|
2140
2157
|
let I = W();
|
|
2141
2158
|
if (I) {
|
|
2142
2159
|
let T = new Event(st);
|
|
@@ -2144,80 +2161,80 @@ var Ce = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', ka = '[cmdk-group-head
|
|
|
2144
2161
|
}
|
|
2145
2162
|
}
|
|
2146
2163
|
}
|
|
2147
|
-
} }, c.createElement("label", { "cmdk-label": "", htmlFor:
|
|
2148
|
-
}),
|
|
2164
|
+
} }, c.createElement("label", { "cmdk-label": "", htmlFor: F.inputId, id: F.labelId, style: Ka }, d), Ke(e, (v) => c.createElement(Dn.Provider, { value: _ }, c.createElement(An.Provider, { value: F }, v))));
|
|
2165
|
+
}), Pa = c.forwardRef((e, n) => {
|
|
2149
2166
|
var t, o;
|
|
2150
|
-
let r = te(), i = c.useRef(null), s = c.useContext(
|
|
2167
|
+
let r = te(), i = c.useRef(null), s = c.useContext(On), l = je(), d = Fn(e), u = (o = (t = d.current) == null ? void 0 : t.forceMount) != null ? o : s?.forceMount;
|
|
2151
2168
|
he(() => {
|
|
2152
2169
|
if (!u) return l.item(r, s?.id);
|
|
2153
2170
|
}, [u]);
|
|
2154
|
-
let
|
|
2171
|
+
let f = Bn(r, i, [e.value, e.children, i], e.keywords), p = ht(), g = oe((N) => N.value && N.value === f.current), x = oe((N) => u || l.filter() === !1 ? !0 : N.search ? N.filtered.items.get(r) > 0 : !0);
|
|
2155
2172
|
c.useEffect(() => {
|
|
2156
2173
|
let N = i.current;
|
|
2157
2174
|
if (!(!N || e.disabled)) return N.addEventListener(st, S), () => N.removeEventListener(st, S);
|
|
2158
2175
|
}, [x, e.onSelect, e.disabled]);
|
|
2159
2176
|
function S() {
|
|
2160
|
-
var N,
|
|
2161
|
-
m(), (
|
|
2177
|
+
var N, _;
|
|
2178
|
+
m(), (_ = (N = d.current).onSelect) == null || _.call(N, f.current);
|
|
2162
2179
|
}
|
|
2163
2180
|
function m() {
|
|
2164
|
-
|
|
2181
|
+
p.setState("value", f.current, !0);
|
|
2165
2182
|
}
|
|
2166
2183
|
if (!x) return null;
|
|
2167
|
-
let { disabled:
|
|
2168
|
-
return c.createElement(
|
|
2169
|
-
}),
|
|
2170
|
-
let { heading: t, children: o, forceMount: r, ...i } = e, s = te(), l = c.useRef(null), d = c.useRef(null), u = te(),
|
|
2171
|
-
he(() =>
|
|
2184
|
+
let { disabled: h, value: b, onSelect: w, forceMount: y, keywords: R, ...A } = e;
|
|
2185
|
+
return c.createElement(j.div, { ref: Re(i, n), ...A, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!h, "aria-selected": !!g, "data-disabled": !!h, "data-selected": !!g, onPointerMove: h || l.getDisablePointerSelection() ? void 0 : m, onClick: h ? void 0 : S }, e.children);
|
|
2186
|
+
}), Na = c.forwardRef((e, n) => {
|
|
2187
|
+
let { heading: t, children: o, forceMount: r, ...i } = e, s = te(), l = c.useRef(null), d = c.useRef(null), u = te(), f = je(), p = oe((x) => r || f.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(s) : !0);
|
|
2188
|
+
he(() => f.group(s), []), Bn(s, l, [e.value, e.heading, d]);
|
|
2172
2189
|
let g = c.useMemo(() => ({ id: s, forceMount: r }), [r]);
|
|
2173
|
-
return c.createElement(
|
|
2174
|
-
}),
|
|
2190
|
+
return c.createElement(j.div, { ref: Re(l, n), ...i, "cmdk-group": "", role: "presentation", hidden: p ? void 0 : !0 }, t && c.createElement("div", { ref: d, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ke(e, (x) => c.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, c.createElement(On.Provider, { value: g }, x))));
|
|
2191
|
+
}), Ta = c.forwardRef((e, n) => {
|
|
2175
2192
|
let { alwaysRender: t, ...o } = e, r = c.useRef(null), i = oe((s) => !s.search);
|
|
2176
|
-
return !t && !i ? null : c.createElement(
|
|
2177
|
-
}),
|
|
2178
|
-
let { onValueChange: t, ...o } = e, r = e.value != null, i = ht(), s = oe((u) => u.search), l = oe((u) => u.selectedItemId), d =
|
|
2193
|
+
return !t && !i ? null : c.createElement(j.div, { ref: Re(r, n), ...o, "cmdk-separator": "", role: "separator" });
|
|
2194
|
+
}), Ma = c.forwardRef((e, n) => {
|
|
2195
|
+
let { onValueChange: t, ...o } = e, r = e.value != null, i = ht(), s = oe((u) => u.search), l = oe((u) => u.selectedItemId), d = je();
|
|
2179
2196
|
return c.useEffect(() => {
|
|
2180
2197
|
e.value != null && i.setState("search", e.value);
|
|
2181
|
-
}, [e.value]), c.createElement(
|
|
2198
|
+
}, [e.value]), c.createElement(j.input, { ref: n, ...o, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": d.listId, "aria-labelledby": d.labelId, "aria-activedescendant": l, id: d.inputId, type: "text", value: r ? e.value : s, onChange: (u) => {
|
|
2182
2199
|
r || i.setState("search", u.target.value), t?.(u.target.value);
|
|
2183
2200
|
} });
|
|
2184
|
-
}),
|
|
2185
|
-
let { children: t, label: o = "Suggestions", ...r } = e, i = c.useRef(null), s = c.useRef(null), l = oe((u) => u.selectedItemId), d =
|
|
2201
|
+
}), Aa = c.forwardRef((e, n) => {
|
|
2202
|
+
let { children: t, label: o = "Suggestions", ...r } = e, i = c.useRef(null), s = c.useRef(null), l = oe((u) => u.selectedItemId), d = je();
|
|
2186
2203
|
return c.useEffect(() => {
|
|
2187
2204
|
if (s.current && i.current) {
|
|
2188
|
-
let u = s.current,
|
|
2189
|
-
|
|
2205
|
+
let u = s.current, f = i.current, p, g = new ResizeObserver(() => {
|
|
2206
|
+
p = requestAnimationFrame(() => {
|
|
2190
2207
|
let x = u.offsetHeight;
|
|
2191
|
-
|
|
2208
|
+
f.style.setProperty("--cmdk-list-height", x.toFixed(1) + "px");
|
|
2192
2209
|
});
|
|
2193
2210
|
});
|
|
2194
2211
|
return g.observe(u), () => {
|
|
2195
|
-
cancelAnimationFrame(
|
|
2212
|
+
cancelAnimationFrame(p), g.unobserve(u);
|
|
2196
2213
|
};
|
|
2197
2214
|
}
|
|
2198
|
-
}, []), c.createElement(
|
|
2199
|
-
}),
|
|
2215
|
+
}, []), c.createElement(j.div, { ref: Re(i, n), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": l, "aria-label": o, id: d.listId }, Ke(e, (u) => c.createElement("div", { ref: Re(s, d.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
2216
|
+
}), Da = c.forwardRef((e, n) => {
|
|
2200
2217
|
let { open: t, onOpenChange: o, overlayClassName: r, contentClassName: i, container: s, ...l } = e;
|
|
2201
|
-
return c.createElement(
|
|
2202
|
-
}),
|
|
2218
|
+
return c.createElement(xr, { open: t, onOpenChange: o }, c.createElement(br, { container: s }, c.createElement(Sr, { "cmdk-overlay": "", className: r }), c.createElement(wr, { "aria-label": e.label, "cmdk-dialog": "", className: i }, c.createElement(Ln, { ref: n, ...l }))));
|
|
2219
|
+
}), Oa = c.forwardRef((e, n) => oe((t) => t.filtered.count === 0) ? c.createElement(j.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), La = c.forwardRef((e, n) => {
|
|
2203
2220
|
let { progress: t, children: o, label: r = "Loading...", ...i } = e;
|
|
2204
|
-
return c.createElement(
|
|
2205
|
-
}), we = Object.assign(
|
|
2206
|
-
function
|
|
2221
|
+
return c.createElement(j.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, Ke(e, (s) => c.createElement("div", { "aria-hidden": !0 }, s)));
|
|
2222
|
+
}), we = Object.assign(Ln, { List: Aa, Item: Pa, Input: Ma, Group: Na, Separator: Ta, Dialog: Da, Empty: Oa, Loading: La });
|
|
2223
|
+
function Fa(e, n) {
|
|
2207
2224
|
let t = e.nextElementSibling;
|
|
2208
2225
|
for (; t; ) {
|
|
2209
2226
|
if (t.matches(n)) return t;
|
|
2210
2227
|
t = t.nextElementSibling;
|
|
2211
2228
|
}
|
|
2212
2229
|
}
|
|
2213
|
-
function
|
|
2230
|
+
function Ba(e, n) {
|
|
2214
2231
|
let t = e.previousElementSibling;
|
|
2215
2232
|
for (; t; ) {
|
|
2216
2233
|
if (t.matches(n)) return t;
|
|
2217
2234
|
t = t.previousElementSibling;
|
|
2218
2235
|
}
|
|
2219
2236
|
}
|
|
2220
|
-
function
|
|
2237
|
+
function Fn(e) {
|
|
2221
2238
|
let n = c.useRef(e);
|
|
2222
2239
|
return he(() => {
|
|
2223
2240
|
n.current = e;
|
|
@@ -2232,21 +2249,21 @@ function oe(e) {
|
|
|
2232
2249
|
let n = ht(), t = () => e(n.snapshot());
|
|
2233
2250
|
return c.useSyncExternalStore(n.subscribe, t, t);
|
|
2234
2251
|
}
|
|
2235
|
-
function
|
|
2236
|
-
let r = c.useRef(), i =
|
|
2252
|
+
function Bn(e, n, t, o = []) {
|
|
2253
|
+
let r = c.useRef(), i = je();
|
|
2237
2254
|
return he(() => {
|
|
2238
2255
|
var s;
|
|
2239
2256
|
let l = (() => {
|
|
2240
2257
|
var u;
|
|
2241
|
-
for (let
|
|
2242
|
-
if (typeof
|
|
2243
|
-
if (typeof
|
|
2258
|
+
for (let f of t) {
|
|
2259
|
+
if (typeof f == "string") return f.trim();
|
|
2260
|
+
if (typeof f == "object" && "current" in f) return f.current ? (u = f.current.textContent) == null ? void 0 : u.trim() : r.current;
|
|
2244
2261
|
}
|
|
2245
2262
|
})(), d = o.map((u) => u.trim());
|
|
2246
2263
|
i.value(e, l, d), (s = n.current) == null || s.setAttribute(xe, l), r.current = l;
|
|
2247
2264
|
}), r;
|
|
2248
2265
|
}
|
|
2249
|
-
var
|
|
2266
|
+
var $a = () => {
|
|
2250
2267
|
let [e, n] = c.useState(), t = be(() => /* @__PURE__ */ new Map());
|
|
2251
2268
|
return he(() => {
|
|
2252
2269
|
t.current.forEach((o) => o()), t.current = /* @__PURE__ */ new Map();
|
|
@@ -2254,19 +2271,19 @@ var Ba = () => {
|
|
|
2254
2271
|
t.current.set(o, r), n({});
|
|
2255
2272
|
};
|
|
2256
2273
|
};
|
|
2257
|
-
function
|
|
2274
|
+
function Va(e) {
|
|
2258
2275
|
let n = e.type;
|
|
2259
2276
|
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
2260
2277
|
}
|
|
2261
2278
|
function Ke({ asChild: e, children: n }, t) {
|
|
2262
|
-
return e && c.isValidElement(n) ? c.cloneElement(
|
|
2279
|
+
return e && c.isValidElement(n) ? c.cloneElement(Va(n), { ref: n.ref }, t(n.props.children)) : t(n);
|
|
2263
2280
|
}
|
|
2264
|
-
var
|
|
2265
|
-
function
|
|
2281
|
+
var Ka = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
2282
|
+
function Ha({ className: e, ...n }) {
|
|
2266
2283
|
return /* @__PURE__ */ a.jsx(
|
|
2267
2284
|
we,
|
|
2268
2285
|
{
|
|
2269
|
-
className:
|
|
2286
|
+
className: L(
|
|
2270
2287
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
2271
2288
|
e
|
|
2272
2289
|
),
|
|
@@ -2275,13 +2292,13 @@ function Va({ className: e, ...n }) {
|
|
|
2275
2292
|
}
|
|
2276
2293
|
);
|
|
2277
2294
|
}
|
|
2278
|
-
function
|
|
2295
|
+
function Ua({ className: e, ...n }) {
|
|
2279
2296
|
return /* @__PURE__ */ a.jsxs("div", { className: "flex h-9 items-center gap-2 border-b px-3", "data-slot": "command-input-wrapper", children: [
|
|
2280
|
-
/* @__PURE__ */ a.jsx(
|
|
2297
|
+
/* @__PURE__ */ a.jsx(qr, { className: "size-4 shrink-0 opacity-50" }),
|
|
2281
2298
|
/* @__PURE__ */ a.jsx(
|
|
2282
2299
|
we.Input,
|
|
2283
2300
|
{
|
|
2284
|
-
className:
|
|
2301
|
+
className: L(
|
|
2285
2302
|
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
2286
2303
|
e
|
|
2287
2304
|
),
|
|
@@ -2291,24 +2308,24 @@ function Ka({ className: e, ...n }) {
|
|
|
2291
2308
|
)
|
|
2292
2309
|
] });
|
|
2293
2310
|
}
|
|
2294
|
-
function
|
|
2311
|
+
function Ga({ className: e, ...n }) {
|
|
2295
2312
|
return /* @__PURE__ */ a.jsx(
|
|
2296
2313
|
we.List,
|
|
2297
2314
|
{
|
|
2298
|
-
className:
|
|
2315
|
+
className: L("max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden", e),
|
|
2299
2316
|
"data-slot": "command-list",
|
|
2300
2317
|
...n
|
|
2301
2318
|
}
|
|
2302
2319
|
);
|
|
2303
2320
|
}
|
|
2304
|
-
function
|
|
2321
|
+
function za({ ...e }) {
|
|
2305
2322
|
return /* @__PURE__ */ a.jsx(we.Empty, { className: "py-6 text-center text-sm", "data-slot": "command-empty", ...e });
|
|
2306
2323
|
}
|
|
2307
|
-
function
|
|
2324
|
+
function Wa({ className: e, ...n }) {
|
|
2308
2325
|
return /* @__PURE__ */ a.jsx(
|
|
2309
2326
|
we.Group,
|
|
2310
2327
|
{
|
|
2311
|
-
className:
|
|
2328
|
+
className: L(
|
|
2312
2329
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",
|
|
2313
2330
|
e
|
|
2314
2331
|
),
|
|
@@ -2317,11 +2334,11 @@ function Ga({ className: e, ...n }) {
|
|
|
2317
2334
|
}
|
|
2318
2335
|
);
|
|
2319
2336
|
}
|
|
2320
|
-
function
|
|
2337
|
+
function qa({ className: e, ...n }) {
|
|
2321
2338
|
return /* @__PURE__ */ a.jsx(
|
|
2322
2339
|
we.Item,
|
|
2323
2340
|
{
|
|
2324
|
-
className:
|
|
2341
|
+
className: L(
|
|
2325
2342
|
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2326
2343
|
e
|
|
2327
2344
|
),
|
|
@@ -2330,16 +2347,16 @@ function za({ className: e, ...n }) {
|
|
|
2330
2347
|
}
|
|
2331
2348
|
);
|
|
2332
2349
|
}
|
|
2333
|
-
const
|
|
2350
|
+
const Ya = ({
|
|
2334
2351
|
placeholder: e,
|
|
2335
2352
|
selected: n,
|
|
2336
2353
|
className: t,
|
|
2337
2354
|
open: o,
|
|
2338
2355
|
renderSelected: r = (i) => i.label
|
|
2339
|
-
}) => /* @__PURE__ */ a.jsx(
|
|
2356
|
+
}) => /* @__PURE__ */ a.jsx(Rt, { asChild: !0, children: /* @__PURE__ */ a.jsxs(yr, { "aria-expanded": o, className: `justify-between ${t}`, role: "combobox", variant: "outline", children: [
|
|
2340
2357
|
r(n || { label: e, value: "" }),
|
|
2341
|
-
/* @__PURE__ */ a.jsx(
|
|
2342
|
-
] }) }),
|
|
2358
|
+
/* @__PURE__ */ a.jsx(Ar, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
2359
|
+
] }) }), Vs = ({
|
|
2343
2360
|
options: e,
|
|
2344
2361
|
value: n = "",
|
|
2345
2362
|
placeholder: t = "Select a value...",
|
|
@@ -2348,10 +2365,10 @@ const Wa = ({
|
|
|
2348
2365
|
},
|
|
2349
2366
|
renderSelected: i = (s) => s.label
|
|
2350
2367
|
}) => {
|
|
2351
|
-
const [s, l] = ke(!1), d =
|
|
2352
|
-
return /* @__PURE__ */ a.jsxs(
|
|
2368
|
+
const [s, l] = ke(!1), d = Ir(() => e.find((u) => u.value === n), [e, n]);
|
|
2369
|
+
return /* @__PURE__ */ a.jsxs(It, { onOpenChange: l, open: s, children: [
|
|
2353
2370
|
/* @__PURE__ */ a.jsx(
|
|
2354
|
-
|
|
2371
|
+
Ya,
|
|
2355
2372
|
{
|
|
2356
2373
|
className: `w-full ${o}`,
|
|
2357
2374
|
open: s,
|
|
@@ -2360,12 +2377,12 @@ const Wa = ({
|
|
|
2360
2377
|
selected: d
|
|
2361
2378
|
}
|
|
2362
2379
|
),
|
|
2363
|
-
/* @__PURE__ */ a.jsx(
|
|
2364
|
-
/* @__PURE__ */ a.jsx(
|
|
2365
|
-
/* @__PURE__ */ a.jsxs(
|
|
2366
|
-
/* @__PURE__ */ a.jsx(
|
|
2367
|
-
/* @__PURE__ */ a.jsx(
|
|
2368
|
-
|
|
2380
|
+
/* @__PURE__ */ a.jsx(kt, { className: "w-full p-0", children: /* @__PURE__ */ a.jsxs(Ha, { value: n, children: [
|
|
2381
|
+
/* @__PURE__ */ a.jsx(Ua, { "aria-label": "Search options", className: "h-9", placeholder: "Search" }),
|
|
2382
|
+
/* @__PURE__ */ a.jsxs(Ga, { children: [
|
|
2383
|
+
/* @__PURE__ */ a.jsx(za, { children: "No results found" }),
|
|
2384
|
+
/* @__PURE__ */ a.jsx(Wa, { children: e.map((u) => /* @__PURE__ */ a.jsxs(
|
|
2385
|
+
qa,
|
|
2369
2386
|
{
|
|
2370
2387
|
onSelect: () => {
|
|
2371
2388
|
l(!1), r(u.value);
|
|
@@ -2374,7 +2391,7 @@ const Wa = ({
|
|
|
2374
2391
|
children: [
|
|
2375
2392
|
u.icon ? /* @__PURE__ */ a.jsx("span", { className: "mr-2", children: u.icon }) : "",
|
|
2376
2393
|
u.label,
|
|
2377
|
-
/* @__PURE__ */ a.jsx(ut, { className:
|
|
2394
|
+
/* @__PURE__ */ a.jsx(ut, { className: L("ml-auto", u.value === n ? "opacity-100" : "opacity-0") })
|
|
2378
2395
|
]
|
|
2379
2396
|
},
|
|
2380
2397
|
u.value
|
|
@@ -2383,14 +2400,14 @@ const Wa = ({
|
|
|
2383
2400
|
] }) })
|
|
2384
2401
|
] });
|
|
2385
2402
|
};
|
|
2386
|
-
var
|
|
2403
|
+
var $n = ["PageUp", "PageDown"], Vn = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Kn = {
|
|
2387
2404
|
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
2388
2405
|
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
2389
2406
|
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
2390
2407
|
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
2391
|
-
}, ye = "Slider", [it,
|
|
2392
|
-
|
|
2393
|
-
]), [
|
|
2408
|
+
}, ye = "Slider", [it, Xa, Za] = dt(ye), [Hn, Ks] = ve(ye, [
|
|
2409
|
+
Za
|
|
2410
|
+
]), [Ja, He] = Hn(ye), Un = c.forwardRef(
|
|
2394
2411
|
(e, n) => {
|
|
2395
2412
|
const {
|
|
2396
2413
|
name: t,
|
|
@@ -2401,26 +2418,26 @@ var Bn = ["PageUp", "PageDown"], Fn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2401
2418
|
disabled: l = !1,
|
|
2402
2419
|
minStepsBetweenThumbs: d = 0,
|
|
2403
2420
|
defaultValue: u = [o],
|
|
2404
|
-
value:
|
|
2405
|
-
onValueChange:
|
|
2421
|
+
value: f,
|
|
2422
|
+
onValueChange: p = () => {
|
|
2406
2423
|
},
|
|
2407
2424
|
onValueCommit: g = () => {
|
|
2408
2425
|
},
|
|
2409
2426
|
inverted: x = !1,
|
|
2410
2427
|
form: S,
|
|
2411
2428
|
...m
|
|
2412
|
-
} = e,
|
|
2413
|
-
prop:
|
|
2429
|
+
} = e, h = c.useRef(/* @__PURE__ */ new Set()), b = c.useRef(0), y = s === "horizontal" ? Qa : es, [R = [], A] = de({
|
|
2430
|
+
prop: f,
|
|
2414
2431
|
defaultProp: u,
|
|
2415
2432
|
onChange: (D) => {
|
|
2416
|
-
[...
|
|
2433
|
+
[...h.current][b.current]?.focus(), p(D);
|
|
2417
2434
|
}
|
|
2418
2435
|
}), N = c.useRef(R);
|
|
2419
|
-
function
|
|
2420
|
-
const K =
|
|
2436
|
+
function _(D) {
|
|
2437
|
+
const K = as(R, D);
|
|
2421
2438
|
z(D, K);
|
|
2422
2439
|
}
|
|
2423
|
-
function
|
|
2440
|
+
function F(D) {
|
|
2424
2441
|
z(D, b.current);
|
|
2425
2442
|
}
|
|
2426
2443
|
function Z() {
|
|
@@ -2428,10 +2445,10 @@ var Bn = ["PageUp", "PageDown"], Fn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2428
2445
|
R[b.current] !== D && g(R);
|
|
2429
2446
|
}
|
|
2430
2447
|
function z(D, K, { commit: X } = { commit: !1 }) {
|
|
2431
|
-
const W =
|
|
2448
|
+
const W = ls(i), U = ds(Math.round((D - o) / i) * i + o, W), O = Ne(U, [o, r]);
|
|
2432
2449
|
A((G = []) => {
|
|
2433
|
-
const q =
|
|
2434
|
-
if (
|
|
2450
|
+
const q = rs(G, O, K);
|
|
2451
|
+
if (cs(q, d * i)) {
|
|
2435
2452
|
b.current = q.indexOf(O);
|
|
2436
2453
|
const J = String(q) !== String(G);
|
|
2437
2454
|
return J && X && g(q), J ? q : G;
|
|
@@ -2440,7 +2457,7 @@ var Bn = ["PageUp", "PageDown"], Fn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2440
2457
|
});
|
|
2441
2458
|
}
|
|
2442
2459
|
return /* @__PURE__ */ a.jsx(
|
|
2443
|
-
|
|
2460
|
+
Ja,
|
|
2444
2461
|
{
|
|
2445
2462
|
scope: e.__scopeSlider,
|
|
2446
2463
|
name: t,
|
|
@@ -2448,7 +2465,7 @@ var Bn = ["PageUp", "PageDown"], Fn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2448
2465
|
min: o,
|
|
2449
2466
|
max: r,
|
|
2450
2467
|
valueIndexToChangeRef: b,
|
|
2451
|
-
thumbs:
|
|
2468
|
+
thumbs: h.current,
|
|
2452
2469
|
values: R,
|
|
2453
2470
|
orientation: s,
|
|
2454
2471
|
form: S,
|
|
@@ -2465,14 +2482,14 @@ var Bn = ["PageUp", "PageDown"], Fn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2465
2482
|
min: o,
|
|
2466
2483
|
max: r,
|
|
2467
2484
|
inverted: x,
|
|
2468
|
-
onSlideStart: l ? void 0 :
|
|
2469
|
-
onSlideMove: l ? void 0 :
|
|
2485
|
+
onSlideStart: l ? void 0 : _,
|
|
2486
|
+
onSlideMove: l ? void 0 : F,
|
|
2470
2487
|
onSlideEnd: l ? void 0 : Z,
|
|
2471
2488
|
onHomeKeyDown: () => !l && z(o, 0, { commit: !0 }),
|
|
2472
2489
|
onEndKeyDown: () => !l && z(r, R.length - 1, { commit: !0 }),
|
|
2473
2490
|
onStepKeyDown: ({ event: D, direction: K }) => {
|
|
2474
2491
|
if (!l) {
|
|
2475
|
-
const U =
|
|
2492
|
+
const U = $n.includes(D.key) || D.shiftKey && Vn.includes(D.key) ? 10 : 1, O = b.current, G = R[O], q = i * U * K;
|
|
2476
2493
|
z(G + q, O, { commit: !0 });
|
|
2477
2494
|
}
|
|
2478
2495
|
}
|
|
@@ -2482,13 +2499,13 @@ var Bn = ["PageUp", "PageDown"], Fn = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
2482
2499
|
);
|
|
2483
2500
|
}
|
|
2484
2501
|
);
|
|
2485
|
-
|
|
2486
|
-
var [
|
|
2502
|
+
Un.displayName = ye;
|
|
2503
|
+
var [Gn, zn] = Hn(ye, {
|
|
2487
2504
|
startEdge: "left",
|
|
2488
2505
|
endEdge: "right",
|
|
2489
2506
|
size: "width",
|
|
2490
2507
|
direction: 1
|
|
2491
|
-
}),
|
|
2508
|
+
}), Qa = c.forwardRef(
|
|
2492
2509
|
(e, n) => {
|
|
2493
2510
|
const {
|
|
2494
2511
|
min: t,
|
|
@@ -2499,14 +2516,14 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2499
2516
|
onSlideMove: l,
|
|
2500
2517
|
onSlideEnd: d,
|
|
2501
2518
|
onStepKeyDown: u,
|
|
2502
|
-
...
|
|
2503
|
-
} = e, [
|
|
2519
|
+
...f
|
|
2520
|
+
} = e, [p, g] = c.useState(null), x = V(n, (y) => g(y)), S = c.useRef(void 0), m = Me(r), h = m === "ltr", b = h && !i || !h && i;
|
|
2504
2521
|
function w(y) {
|
|
2505
|
-
const R = S.current ||
|
|
2506
|
-
return S.current = R,
|
|
2522
|
+
const R = S.current || p.getBoundingClientRect(), A = [0, R.width], _ = vt(A, b ? [t, o] : [o, t]);
|
|
2523
|
+
return S.current = R, _(y - R.left);
|
|
2507
2524
|
}
|
|
2508
2525
|
return /* @__PURE__ */ a.jsx(
|
|
2509
|
-
|
|
2526
|
+
Gn,
|
|
2510
2527
|
{
|
|
2511
2528
|
scope: e.__scopeSlider,
|
|
2512
2529
|
startEdge: b ? "left" : "right",
|
|
@@ -2514,14 +2531,14 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2514
2531
|
direction: b ? 1 : -1,
|
|
2515
2532
|
size: "width",
|
|
2516
2533
|
children: /* @__PURE__ */ a.jsx(
|
|
2517
|
-
|
|
2534
|
+
Wn,
|
|
2518
2535
|
{
|
|
2519
2536
|
dir: m,
|
|
2520
2537
|
"data-orientation": "horizontal",
|
|
2521
|
-
...
|
|
2538
|
+
...f,
|
|
2522
2539
|
ref: x,
|
|
2523
2540
|
style: {
|
|
2524
|
-
...
|
|
2541
|
+
...f.style,
|
|
2525
2542
|
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
2526
2543
|
},
|
|
2527
2544
|
onSlideStart: (y) => {
|
|
@@ -2536,7 +2553,7 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2536
2553
|
S.current = void 0, d?.();
|
|
2537
2554
|
},
|
|
2538
2555
|
onStepKeyDown: (y) => {
|
|
2539
|
-
const A =
|
|
2556
|
+
const A = Kn[b ? "from-left" : "from-right"].includes(y.key);
|
|
2540
2557
|
u?.({ event: y, direction: A ? -1 : 1 });
|
|
2541
2558
|
}
|
|
2542
2559
|
}
|
|
@@ -2544,7 +2561,7 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2544
2561
|
}
|
|
2545
2562
|
);
|
|
2546
2563
|
}
|
|
2547
|
-
),
|
|
2564
|
+
), es = c.forwardRef(
|
|
2548
2565
|
(e, n) => {
|
|
2549
2566
|
const {
|
|
2550
2567
|
min: t,
|
|
@@ -2555,13 +2572,13 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2555
2572
|
onSlideEnd: l,
|
|
2556
2573
|
onStepKeyDown: d,
|
|
2557
2574
|
...u
|
|
2558
|
-
} = e,
|
|
2575
|
+
} = e, f = c.useRef(null), p = V(n, f), g = c.useRef(void 0), x = !r;
|
|
2559
2576
|
function S(m) {
|
|
2560
|
-
const
|
|
2561
|
-
return g.current =
|
|
2577
|
+
const h = g.current || f.current.getBoundingClientRect(), b = [0, h.height], y = vt(b, x ? [o, t] : [t, o]);
|
|
2578
|
+
return g.current = h, y(m - h.top);
|
|
2562
2579
|
}
|
|
2563
2580
|
return /* @__PURE__ */ a.jsx(
|
|
2564
|
-
|
|
2581
|
+
Gn,
|
|
2565
2582
|
{
|
|
2566
2583
|
scope: e.__scopeSlider,
|
|
2567
2584
|
startEdge: x ? "bottom" : "top",
|
|
@@ -2569,28 +2586,28 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2569
2586
|
size: "height",
|
|
2570
2587
|
direction: x ? 1 : -1,
|
|
2571
2588
|
children: /* @__PURE__ */ a.jsx(
|
|
2572
|
-
|
|
2589
|
+
Wn,
|
|
2573
2590
|
{
|
|
2574
2591
|
"data-orientation": "vertical",
|
|
2575
2592
|
...u,
|
|
2576
|
-
ref:
|
|
2593
|
+
ref: p,
|
|
2577
2594
|
style: {
|
|
2578
2595
|
...u.style,
|
|
2579
2596
|
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
2580
2597
|
},
|
|
2581
2598
|
onSlideStart: (m) => {
|
|
2582
|
-
const
|
|
2583
|
-
i?.(
|
|
2599
|
+
const h = S(m.clientY);
|
|
2600
|
+
i?.(h);
|
|
2584
2601
|
},
|
|
2585
2602
|
onSlideMove: (m) => {
|
|
2586
|
-
const
|
|
2587
|
-
s?.(
|
|
2603
|
+
const h = S(m.clientY);
|
|
2604
|
+
s?.(h);
|
|
2588
2605
|
},
|
|
2589
2606
|
onSlideEnd: () => {
|
|
2590
2607
|
g.current = void 0, l?.();
|
|
2591
2608
|
},
|
|
2592
2609
|
onStepKeyDown: (m) => {
|
|
2593
|
-
const b =
|
|
2610
|
+
const b = Kn[x ? "from-bottom" : "from-top"].includes(m.key);
|
|
2594
2611
|
d?.({ event: m, direction: b ? -1 : 1 });
|
|
2595
2612
|
}
|
|
2596
2613
|
}
|
|
@@ -2598,7 +2615,7 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2598
2615
|
}
|
|
2599
2616
|
);
|
|
2600
2617
|
}
|
|
2601
|
-
),
|
|
2618
|
+
), Wn = c.forwardRef(
|
|
2602
2619
|
(e, n) => {
|
|
2603
2620
|
const {
|
|
2604
2621
|
__scopeSlider: t,
|
|
@@ -2609,34 +2626,34 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2609
2626
|
onEndKeyDown: l,
|
|
2610
2627
|
onStepKeyDown: d,
|
|
2611
2628
|
...u
|
|
2612
|
-
} = e,
|
|
2629
|
+
} = e, f = He(ye, t);
|
|
2613
2630
|
return /* @__PURE__ */ a.jsx(
|
|
2614
|
-
|
|
2631
|
+
j.span,
|
|
2615
2632
|
{
|
|
2616
2633
|
...u,
|
|
2617
2634
|
ref: n,
|
|
2618
|
-
onKeyDown: P(e.onKeyDown, (
|
|
2619
|
-
|
|
2635
|
+
onKeyDown: P(e.onKeyDown, (p) => {
|
|
2636
|
+
p.key === "Home" ? (s(p), p.preventDefault()) : p.key === "End" ? (l(p), p.preventDefault()) : $n.concat(Vn).includes(p.key) && (d(p), p.preventDefault());
|
|
2620
2637
|
}),
|
|
2621
|
-
onPointerDown: P(e.onPointerDown, (
|
|
2622
|
-
const g =
|
|
2623
|
-
g.setPointerCapture(
|
|
2638
|
+
onPointerDown: P(e.onPointerDown, (p) => {
|
|
2639
|
+
const g = p.target;
|
|
2640
|
+
g.setPointerCapture(p.pointerId), p.preventDefault(), f.thumbs.has(g) ? g.focus() : o(p);
|
|
2624
2641
|
}),
|
|
2625
|
-
onPointerMove: P(e.onPointerMove, (
|
|
2626
|
-
|
|
2642
|
+
onPointerMove: P(e.onPointerMove, (p) => {
|
|
2643
|
+
p.target.hasPointerCapture(p.pointerId) && r(p);
|
|
2627
2644
|
}),
|
|
2628
|
-
onPointerUp: P(e.onPointerUp, (
|
|
2629
|
-
const g =
|
|
2630
|
-
g.hasPointerCapture(
|
|
2645
|
+
onPointerUp: P(e.onPointerUp, (p) => {
|
|
2646
|
+
const g = p.target;
|
|
2647
|
+
g.hasPointerCapture(p.pointerId) && (g.releasePointerCapture(p.pointerId), i(p));
|
|
2631
2648
|
})
|
|
2632
2649
|
}
|
|
2633
2650
|
);
|
|
2634
2651
|
}
|
|
2635
|
-
),
|
|
2652
|
+
), qn = "SliderTrack", Yn = c.forwardRef(
|
|
2636
2653
|
(e, n) => {
|
|
2637
|
-
const { __scopeSlider: t, ...o } = e, r = He(
|
|
2654
|
+
const { __scopeSlider: t, ...o } = e, r = He(qn, t);
|
|
2638
2655
|
return /* @__PURE__ */ a.jsx(
|
|
2639
|
-
|
|
2656
|
+
j.span,
|
|
2640
2657
|
{
|
|
2641
2658
|
"data-disabled": r.disabled ? "" : void 0,
|
|
2642
2659
|
"data-orientation": r.orientation,
|
|
@@ -2646,14 +2663,14 @@ var [Hn, Un] = Vn(ye, {
|
|
|
2646
2663
|
);
|
|
2647
2664
|
}
|
|
2648
2665
|
);
|
|
2649
|
-
|
|
2650
|
-
var ct = "SliderRange",
|
|
2666
|
+
Yn.displayName = qn;
|
|
2667
|
+
var ct = "SliderRange", Xn = c.forwardRef(
|
|
2651
2668
|
(e, n) => {
|
|
2652
|
-
const { __scopeSlider: t, ...o } = e, r = He(ct, t), i =
|
|
2653
|
-
(g) =>
|
|
2654
|
-
),
|
|
2669
|
+
const { __scopeSlider: t, ...o } = e, r = He(ct, t), i = zn(ct, t), s = c.useRef(null), l = V(n, s), d = r.values.length, u = r.values.map(
|
|
2670
|
+
(g) => Qn(g, r.min, r.max)
|
|
2671
|
+
), f = d > 1 ? Math.min(...u) : 0, p = 100 - Math.max(...u);
|
|
2655
2672
|
return /* @__PURE__ */ a.jsx(
|
|
2656
|
-
|
|
2673
|
+
j.span,
|
|
2657
2674
|
{
|
|
2658
2675
|
"data-orientation": r.orientation,
|
|
2659
2676
|
"data-disabled": r.disabled ? "" : void 0,
|
|
@@ -2661,25 +2678,25 @@ var ct = "SliderRange", qn = c.forwardRef(
|
|
|
2661
2678
|
ref: l,
|
|
2662
2679
|
style: {
|
|
2663
2680
|
...e.style,
|
|
2664
|
-
[i.startEdge]:
|
|
2665
|
-
[i.endEdge]:
|
|
2681
|
+
[i.startEdge]: f + "%",
|
|
2682
|
+
[i.endEdge]: p + "%"
|
|
2666
2683
|
}
|
|
2667
2684
|
}
|
|
2668
2685
|
);
|
|
2669
2686
|
}
|
|
2670
2687
|
);
|
|
2671
|
-
|
|
2672
|
-
var lt = "SliderThumb",
|
|
2688
|
+
Xn.displayName = ct;
|
|
2689
|
+
var lt = "SliderThumb", Zn = c.forwardRef(
|
|
2673
2690
|
(e, n) => {
|
|
2674
|
-
const t =
|
|
2691
|
+
const t = Xa(e.__scopeSlider), [o, r] = c.useState(null), i = V(n, (l) => r(l)), s = c.useMemo(
|
|
2675
2692
|
() => o ? t().findIndex((l) => l.ref.current === o) : -1,
|
|
2676
2693
|
[t, o]
|
|
2677
2694
|
);
|
|
2678
|
-
return /* @__PURE__ */ a.jsx(
|
|
2695
|
+
return /* @__PURE__ */ a.jsx(ts, { ...e, ref: i, index: s });
|
|
2679
2696
|
}
|
|
2680
|
-
),
|
|
2697
|
+
), ts = c.forwardRef(
|
|
2681
2698
|
(e, n) => {
|
|
2682
|
-
const { __scopeSlider: t, index: o, name: r, ...i } = e, s = He(lt, t), l =
|
|
2699
|
+
const { __scopeSlider: t, index: o, name: r, ...i } = e, s = He(lt, t), l = zn(lt, t), [d, u] = c.useState(null), f = V(n, (w) => u(w)), p = d ? s.form || !!d.closest("form") : !0, g = De(d), x = s.values[o], S = x === void 0 ? 0 : Qn(x, s.min, s.max), m = os(o, s.values.length), h = g?.[l.size], b = h ? ss(h, S, l.direction) : 0;
|
|
2683
2700
|
return c.useEffect(() => {
|
|
2684
2701
|
if (d)
|
|
2685
2702
|
return s.thumbs.add(d), () => {
|
|
@@ -2695,7 +2712,7 @@ var lt = "SliderThumb", Yn = c.forwardRef(
|
|
|
2695
2712
|
},
|
|
2696
2713
|
children: [
|
|
2697
2714
|
/* @__PURE__ */ a.jsx(it.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ a.jsx(
|
|
2698
|
-
|
|
2715
|
+
j.span,
|
|
2699
2716
|
{
|
|
2700
2717
|
role: "slider",
|
|
2701
2718
|
"aria-label": e["aria-label"] || m,
|
|
@@ -2707,15 +2724,15 @@ var lt = "SliderThumb", Yn = c.forwardRef(
|
|
|
2707
2724
|
"data-disabled": s.disabled ? "" : void 0,
|
|
2708
2725
|
tabIndex: s.disabled ? void 0 : 0,
|
|
2709
2726
|
...i,
|
|
2710
|
-
ref:
|
|
2727
|
+
ref: f,
|
|
2711
2728
|
style: x === void 0 ? { display: "none" } : e.style,
|
|
2712
2729
|
onFocus: P(e.onFocus, () => {
|
|
2713
2730
|
s.valueIndexToChangeRef.current = o;
|
|
2714
2731
|
})
|
|
2715
2732
|
}
|
|
2716
2733
|
) }),
|
|
2717
|
-
|
|
2718
|
-
|
|
2734
|
+
p && /* @__PURE__ */ a.jsx(
|
|
2735
|
+
Jn,
|
|
2719
2736
|
{
|
|
2720
2737
|
name: r ?? (s.name ? s.name + (s.values.length > 1 ? "[]" : "") : void 0),
|
|
2721
2738
|
form: s.form,
|
|
@@ -2728,20 +2745,20 @@ var lt = "SliderThumb", Yn = c.forwardRef(
|
|
|
2728
2745
|
);
|
|
2729
2746
|
}
|
|
2730
2747
|
);
|
|
2731
|
-
|
|
2732
|
-
var
|
|
2748
|
+
Zn.displayName = lt;
|
|
2749
|
+
var ns = "RadioBubbleInput", Jn = c.forwardRef(
|
|
2733
2750
|
({ __scopeSlider: e, value: n, ...t }, o) => {
|
|
2734
|
-
const r = c.useRef(null), i = V(r, o), s =
|
|
2751
|
+
const r = c.useRef(null), i = V(r, o), s = _e(n);
|
|
2735
2752
|
return c.useEffect(() => {
|
|
2736
2753
|
const l = r.current;
|
|
2737
2754
|
if (!l) return;
|
|
2738
|
-
const d = window.HTMLInputElement.prototype,
|
|
2739
|
-
if (s !== n &&
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2755
|
+
const d = window.HTMLInputElement.prototype, f = Object.getOwnPropertyDescriptor(d, "value").set;
|
|
2756
|
+
if (s !== n && f) {
|
|
2757
|
+
const p = new Event("input", { bubbles: !0 });
|
|
2758
|
+
f.call(l, n), l.dispatchEvent(p);
|
|
2742
2759
|
}
|
|
2743
2760
|
}, [s, n]), /* @__PURE__ */ a.jsx(
|
|
2744
|
-
|
|
2761
|
+
j.input,
|
|
2745
2762
|
{
|
|
2746
2763
|
style: { display: "none" },
|
|
2747
2764
|
...t,
|
|
@@ -2751,33 +2768,33 @@ var es = "RadioBubbleInput", Xn = c.forwardRef(
|
|
|
2751
2768
|
);
|
|
2752
2769
|
}
|
|
2753
2770
|
);
|
|
2754
|
-
|
|
2755
|
-
function
|
|
2771
|
+
Jn.displayName = ns;
|
|
2772
|
+
function rs(e = [], n, t) {
|
|
2756
2773
|
const o = [...e];
|
|
2757
2774
|
return o[t] = n, o.sort((r, i) => r - i);
|
|
2758
2775
|
}
|
|
2759
|
-
function
|
|
2776
|
+
function Qn(e, n, t) {
|
|
2760
2777
|
const i = 100 / (t - n) * (e - n);
|
|
2761
2778
|
return Ne(i, [0, 100]);
|
|
2762
2779
|
}
|
|
2763
|
-
function
|
|
2780
|
+
function os(e, n) {
|
|
2764
2781
|
return n > 2 ? `Value ${e + 1} of ${n}` : n === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
2765
2782
|
}
|
|
2766
|
-
function
|
|
2783
|
+
function as(e, n) {
|
|
2767
2784
|
if (e.length === 1) return 0;
|
|
2768
2785
|
const t = e.map((r) => Math.abs(r - n)), o = Math.min(...t);
|
|
2769
2786
|
return t.indexOf(o);
|
|
2770
2787
|
}
|
|
2771
|
-
function
|
|
2788
|
+
function ss(e, n, t) {
|
|
2772
2789
|
const o = e / 2, i = vt([0, 50], [0, o]);
|
|
2773
2790
|
return (o - i(n) * t) * t;
|
|
2774
2791
|
}
|
|
2775
|
-
function
|
|
2792
|
+
function is(e) {
|
|
2776
2793
|
return e.slice(0, -1).map((n, t) => e[t + 1] - n);
|
|
2777
2794
|
}
|
|
2778
|
-
function
|
|
2795
|
+
function cs(e, n) {
|
|
2779
2796
|
if (n > 0) {
|
|
2780
|
-
const t =
|
|
2797
|
+
const t = is(e);
|
|
2781
2798
|
return Math.min(...t) >= n;
|
|
2782
2799
|
}
|
|
2783
2800
|
return !0;
|
|
@@ -2789,15 +2806,15 @@ function vt(e, n) {
|
|
|
2789
2806
|
return n[0] + o * (t - e[0]);
|
|
2790
2807
|
};
|
|
2791
2808
|
}
|
|
2792
|
-
function
|
|
2809
|
+
function ls(e) {
|
|
2793
2810
|
return (String(e).split(".")[1] || "").length;
|
|
2794
2811
|
}
|
|
2795
|
-
function
|
|
2812
|
+
function ds(e, n) {
|
|
2796
2813
|
const t = Math.pow(10, n);
|
|
2797
2814
|
return Math.round(e * t) / t;
|
|
2798
2815
|
}
|
|
2799
|
-
var
|
|
2800
|
-
function
|
|
2816
|
+
var us = Un, ps = Yn, fs = Xn, ms = Zn;
|
|
2817
|
+
function hs({
|
|
2801
2818
|
className: e,
|
|
2802
2819
|
trackClassName: n,
|
|
2803
2820
|
thumbClassName: t,
|
|
@@ -2812,9 +2829,9 @@ function fs({
|
|
|
2812
2829
|
[r, o, i, s]
|
|
2813
2830
|
);
|
|
2814
2831
|
return /* @__PURE__ */ a.jsxs(
|
|
2815
|
-
|
|
2832
|
+
us,
|
|
2816
2833
|
{
|
|
2817
|
-
className:
|
|
2834
|
+
className: L(
|
|
2818
2835
|
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
2819
2836
|
e
|
|
2820
2837
|
),
|
|
@@ -2826,44 +2843,44 @@ function fs({
|
|
|
2826
2843
|
...l,
|
|
2827
2844
|
children: [
|
|
2828
2845
|
/* @__PURE__ */ a.jsx(
|
|
2829
|
-
|
|
2846
|
+
ps,
|
|
2830
2847
|
{
|
|
2831
|
-
className:
|
|
2848
|
+
className: L(
|
|
2832
2849
|
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
2833
2850
|
n
|
|
2834
2851
|
),
|
|
2835
2852
|
"data-slot": "slider-track",
|
|
2836
2853
|
children: /* @__PURE__ */ a.jsx(
|
|
2837
|
-
|
|
2854
|
+
fs,
|
|
2838
2855
|
{
|
|
2839
|
-
className:
|
|
2856
|
+
className: L("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),
|
|
2840
2857
|
"data-slot": "slider-range"
|
|
2841
2858
|
}
|
|
2842
2859
|
)
|
|
2843
2860
|
}
|
|
2844
2861
|
),
|
|
2845
|
-
Array.from({ length: d.length }, (u,
|
|
2846
|
-
|
|
2862
|
+
Array.from({ length: d.length }, (u, f) => /* @__PURE__ */ a.jsx(
|
|
2863
|
+
ms,
|
|
2847
2864
|
{
|
|
2848
|
-
className:
|
|
2865
|
+
className: L(
|
|
2849
2866
|
"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",
|
|
2850
2867
|
t
|
|
2851
2868
|
),
|
|
2852
2869
|
"data-slot": "slider-thumb"
|
|
2853
2870
|
},
|
|
2854
|
-
|
|
2871
|
+
f
|
|
2855
2872
|
))
|
|
2856
2873
|
]
|
|
2857
2874
|
}
|
|
2858
2875
|
);
|
|
2859
2876
|
}
|
|
2860
|
-
const
|
|
2877
|
+
const Hs = ({ size: e = "md", thumbClassName: n, trackClassName: t, value: o, defaultValue: r, ...i }) => {
|
|
2861
2878
|
const s = r !== void 0 ? Array.isArray(r) ? r : [r] : void 0, l = o !== void 0 ? Array.isArray(o) ? o : [o] : void 0;
|
|
2862
2879
|
return /* @__PURE__ */ a.jsx(
|
|
2863
|
-
|
|
2880
|
+
hs,
|
|
2864
2881
|
{
|
|
2865
2882
|
defaultValue: s,
|
|
2866
|
-
thumbClassName:
|
|
2883
|
+
thumbClassName: L(
|
|
2867
2884
|
{
|
|
2868
2885
|
"size-2": e === "xs",
|
|
2869
2886
|
"size-3": e === "sm",
|
|
@@ -2874,7 +2891,7 @@ const Vs = ({ size: e = "md", thumbClassName: n, trackClassName: t, value: o, de
|
|
|
2874
2891
|
"bg-primary",
|
|
2875
2892
|
n
|
|
2876
2893
|
),
|
|
2877
|
-
trackClassName:
|
|
2894
|
+
trackClassName: L(
|
|
2878
2895
|
{
|
|
2879
2896
|
"data-[orientation=horizontal]:h-1 data-[orientation=vertical]:w-1": e === "xs",
|
|
2880
2897
|
"data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5": e === "sm",
|
|
@@ -2889,7 +2906,7 @@ const Vs = ({ size: e = "md", thumbClassName: n, trackClassName: t, value: o, de
|
|
|
2889
2906
|
}
|
|
2890
2907
|
);
|
|
2891
2908
|
};
|
|
2892
|
-
var Ue = "Switch", [
|
|
2909
|
+
var Ue = "Switch", [vs, Us] = ve(Ue), [gs, xs] = vs(Ue), er = c.forwardRef(
|
|
2893
2910
|
(e, n) => {
|
|
2894
2911
|
const {
|
|
2895
2912
|
__scopeSwitch: t,
|
|
@@ -2900,35 +2917,35 @@ var Ue = "Switch", [ms, Ks] = ve(Ue), [hs, vs] = ms(Ue), Jn = c.forwardRef(
|
|
|
2900
2917
|
disabled: l,
|
|
2901
2918
|
value: d = "on",
|
|
2902
2919
|
onCheckedChange: u,
|
|
2903
|
-
form:
|
|
2904
|
-
...
|
|
2905
|
-
} = e, [g, x] = c.useState(null), S = V(n, (y) => x(y)), m = c.useRef(!1),
|
|
2920
|
+
form: f,
|
|
2921
|
+
...p
|
|
2922
|
+
} = e, [g, x] = c.useState(null), S = V(n, (y) => x(y)), m = c.useRef(!1), h = g ? f || !!g.closest("form") : !0, [b, w] = de({
|
|
2906
2923
|
prop: r,
|
|
2907
2924
|
defaultProp: i ?? !1,
|
|
2908
2925
|
onChange: u,
|
|
2909
2926
|
caller: Ue
|
|
2910
2927
|
});
|
|
2911
|
-
return /* @__PURE__ */ a.jsxs(
|
|
2928
|
+
return /* @__PURE__ */ a.jsxs(gs, { scope: t, checked: b, disabled: l, children: [
|
|
2912
2929
|
/* @__PURE__ */ a.jsx(
|
|
2913
|
-
|
|
2930
|
+
j.button,
|
|
2914
2931
|
{
|
|
2915
2932
|
type: "button",
|
|
2916
2933
|
role: "switch",
|
|
2917
2934
|
"aria-checked": b,
|
|
2918
2935
|
"aria-required": s,
|
|
2919
|
-
"data-state":
|
|
2936
|
+
"data-state": or(b),
|
|
2920
2937
|
"data-disabled": l ? "" : void 0,
|
|
2921
2938
|
disabled: l,
|
|
2922
2939
|
value: d,
|
|
2923
|
-
...
|
|
2940
|
+
...p,
|
|
2924
2941
|
ref: S,
|
|
2925
2942
|
onClick: P(e.onClick, (y) => {
|
|
2926
|
-
w((R) => !R),
|
|
2943
|
+
w((R) => !R), h && (m.current = y.isPropagationStopped(), m.current || y.stopPropagation());
|
|
2927
2944
|
})
|
|
2928
2945
|
}
|
|
2929
2946
|
),
|
|
2930
|
-
|
|
2931
|
-
|
|
2947
|
+
h && /* @__PURE__ */ a.jsx(
|
|
2948
|
+
rr,
|
|
2932
2949
|
{
|
|
2933
2950
|
control: g,
|
|
2934
2951
|
bubbles: !m.current,
|
|
@@ -2937,21 +2954,21 @@ var Ue = "Switch", [ms, Ks] = ve(Ue), [hs, vs] = ms(Ue), Jn = c.forwardRef(
|
|
|
2937
2954
|
checked: b,
|
|
2938
2955
|
required: s,
|
|
2939
2956
|
disabled: l,
|
|
2940
|
-
form:
|
|
2957
|
+
form: f,
|
|
2941
2958
|
style: { transform: "translateX(-100%)" }
|
|
2942
2959
|
}
|
|
2943
2960
|
)
|
|
2944
2961
|
] });
|
|
2945
2962
|
}
|
|
2946
2963
|
);
|
|
2947
|
-
|
|
2948
|
-
var
|
|
2964
|
+
er.displayName = Ue;
|
|
2965
|
+
var tr = "SwitchThumb", nr = c.forwardRef(
|
|
2949
2966
|
(e, n) => {
|
|
2950
|
-
const { __scopeSwitch: t, ...o } = e, r =
|
|
2967
|
+
const { __scopeSwitch: t, ...o } = e, r = xs(tr, t);
|
|
2951
2968
|
return /* @__PURE__ */ a.jsx(
|
|
2952
|
-
|
|
2969
|
+
j.span,
|
|
2953
2970
|
{
|
|
2954
|
-
"data-state":
|
|
2971
|
+
"data-state": or(r.checked),
|
|
2955
2972
|
"data-disabled": r.disabled ? "" : void 0,
|
|
2956
2973
|
...o,
|
|
2957
2974
|
ref: n
|
|
@@ -2959,8 +2976,8 @@ var Qn = "SwitchThumb", er = c.forwardRef(
|
|
|
2959
2976
|
);
|
|
2960
2977
|
}
|
|
2961
2978
|
);
|
|
2962
|
-
|
|
2963
|
-
var
|
|
2979
|
+
nr.displayName = tr;
|
|
2980
|
+
var bs = "SwitchBubbleInput", rr = c.forwardRef(
|
|
2964
2981
|
({
|
|
2965
2982
|
__scopeSwitch: e,
|
|
2966
2983
|
control: n,
|
|
@@ -2968,17 +2985,17 @@ var gs = "SwitchBubbleInput", tr = c.forwardRef(
|
|
|
2968
2985
|
bubbles: o = !0,
|
|
2969
2986
|
...r
|
|
2970
2987
|
}, i) => {
|
|
2971
|
-
const s = c.useRef(null), l = V(s, i), d =
|
|
2988
|
+
const s = c.useRef(null), l = V(s, i), d = _e(t), u = De(n);
|
|
2972
2989
|
return c.useEffect(() => {
|
|
2973
|
-
const
|
|
2974
|
-
if (!
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2990
|
+
const f = s.current;
|
|
2991
|
+
if (!f) return;
|
|
2992
|
+
const p = window.HTMLInputElement.prototype, x = Object.getOwnPropertyDescriptor(
|
|
2993
|
+
p,
|
|
2977
2994
|
"checked"
|
|
2978
2995
|
).set;
|
|
2979
2996
|
if (d !== t && x) {
|
|
2980
2997
|
const S = new Event("click", { bubbles: o });
|
|
2981
|
-
x.call(
|
|
2998
|
+
x.call(f, t), f.dispatchEvent(S);
|
|
2982
2999
|
}
|
|
2983
3000
|
}, [d, t, o]), /* @__PURE__ */ a.jsx(
|
|
2984
3001
|
"input",
|
|
@@ -3001,29 +3018,29 @@ var gs = "SwitchBubbleInput", tr = c.forwardRef(
|
|
|
3001
3018
|
);
|
|
3002
3019
|
}
|
|
3003
3020
|
);
|
|
3004
|
-
|
|
3005
|
-
function
|
|
3021
|
+
rr.displayName = bs;
|
|
3022
|
+
function or(e) {
|
|
3006
3023
|
return e ? "checked" : "unchecked";
|
|
3007
3024
|
}
|
|
3008
|
-
var
|
|
3009
|
-
function
|
|
3025
|
+
var Ss = er, ws = nr;
|
|
3026
|
+
function ys({
|
|
3010
3027
|
className: e,
|
|
3011
3028
|
thumbClassName: n,
|
|
3012
3029
|
...t
|
|
3013
3030
|
}) {
|
|
3014
3031
|
return /* @__PURE__ */ a.jsx(
|
|
3015
|
-
|
|
3032
|
+
Ss,
|
|
3016
3033
|
{
|
|
3017
|
-
className:
|
|
3034
|
+
className: L(
|
|
3018
3035
|
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
3019
3036
|
e
|
|
3020
3037
|
),
|
|
3021
3038
|
"data-slot": "switch",
|
|
3022
3039
|
...t,
|
|
3023
3040
|
children: /* @__PURE__ */ a.jsx(
|
|
3024
|
-
|
|
3041
|
+
ws,
|
|
3025
3042
|
{
|
|
3026
|
-
className:
|
|
3043
|
+
className: L(
|
|
3027
3044
|
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0",
|
|
3028
3045
|
n
|
|
3029
3046
|
),
|
|
@@ -3033,7 +3050,7 @@ function Ss({
|
|
|
3033
3050
|
}
|
|
3034
3051
|
);
|
|
3035
3052
|
}
|
|
3036
|
-
const
|
|
3053
|
+
const Gs = ({
|
|
3037
3054
|
id: e,
|
|
3038
3055
|
label: n,
|
|
3039
3056
|
className: t,
|
|
@@ -3042,13 +3059,13 @@ const Hs = ({
|
|
|
3042
3059
|
size: i = "md",
|
|
3043
3060
|
...s
|
|
3044
3061
|
}) => {
|
|
3045
|
-
const l =
|
|
3062
|
+
const l = Rr(), d = e || l, [u, f] = Array.isArray(n) ? n : [null, n], p = "cursor-pointer", g = r && Array.isArray(r) ? r[0] : r, x = r && Array.isArray(r) ? r[1] : r;
|
|
3046
3063
|
return /* @__PURE__ */ a.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3047
|
-
u && /* @__PURE__ */ a.jsx(ue, { className:
|
|
3064
|
+
u && /* @__PURE__ */ a.jsx(ue, { className: L(p, g), htmlFor: d, size: i, children: u }),
|
|
3048
3065
|
/* @__PURE__ */ a.jsx(
|
|
3049
|
-
|
|
3066
|
+
ys,
|
|
3050
3067
|
{
|
|
3051
|
-
className:
|
|
3068
|
+
className: L(
|
|
3052
3069
|
{
|
|
3053
3070
|
"h-[10px] w-4": i === "xs",
|
|
3054
3071
|
"h-[14px] w-6": i === "sm",
|
|
@@ -3059,7 +3076,7 @@ const Hs = ({
|
|
|
3059
3076
|
t
|
|
3060
3077
|
),
|
|
3061
3078
|
id: d,
|
|
3062
|
-
thumbClassName:
|
|
3079
|
+
thumbClassName: L(
|
|
3063
3080
|
{
|
|
3064
3081
|
"size-2": i === "xs",
|
|
3065
3082
|
"size-3": i === "sm",
|
|
@@ -3072,23 +3089,23 @@ const Hs = ({
|
|
|
3072
3089
|
...s
|
|
3073
3090
|
}
|
|
3074
3091
|
),
|
|
3075
|
-
/* @__PURE__ */ a.jsx(ue, { className:
|
|
3092
|
+
/* @__PURE__ */ a.jsx(ue, { className: L(p, x), htmlFor: d, size: i, children: f })
|
|
3076
3093
|
] });
|
|
3077
3094
|
};
|
|
3078
3095
|
export {
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3096
|
+
Ms as C,
|
|
3097
|
+
Ps as D,
|
|
3098
|
+
lo as I,
|
|
3099
|
+
vo as L,
|
|
3100
|
+
Os as P,
|
|
3101
|
+
Fs as R,
|
|
3102
|
+
Ns as S,
|
|
3103
|
+
As as a,
|
|
3104
|
+
Ds as b,
|
|
3105
|
+
$s as c,
|
|
3106
|
+
Vs as d,
|
|
3107
|
+
Hs as e,
|
|
3108
|
+
Gs as f,
|
|
3109
|
+
Mt as g,
|
|
3110
|
+
co as h
|
|
3094
3111
|
};
|