@still-forest/canopy 0.32.0 → 0.33.0
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/{PageNotFound-DxxRBMDz.js → PageNotFound-9R7TbMOe.js} +1 -1
- package/dist/chunks/{SidebarLayout--MNsYxAf.js → SidebarLayout-wO9WdfoD.js} +2 -2
- package/dist/chunks/{Textarea-DQRwMNUV.js → Textarea-DuVdR28E.js} +623 -611
- package/dist/chunks/{calendar-DfVsywp-.js → calendar-B5XoIqC2.js} +35 -31
- package/dist/chunks/{popover-CP7xkaYK.js → popover-nVL6yIZo.js} +1 -1
- package/dist/forms.d.ts +13 -8
- package/dist/forms.js +2 -2
- package/dist/index.d.ts +14 -9
- package/dist/index.js +8 -8
- package/dist/interstitials.js +1 -1
- package/dist/navigation.d.ts +1 -1
- package/dist/navigation.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as i } from "./jsx-runtime-B0GD0xBr.js";
|
|
2
|
-
import { c as re, u as V, f as kt, B as ct, i as fr, j as Ne, h as pr } from "./calendar-
|
|
3
|
-
import * as
|
|
4
|
-
import { useState as lt, useEffect as mr, useMemo as
|
|
5
|
-
import { F as ae, G as
|
|
2
|
+
import { c as re, u as V, f as kt, B as ct, i as fr, j as Ne, h as pr } from "./calendar-B5XoIqC2.js";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { useState as lt, useEffect as mr, useMemo as hr } from "react";
|
|
5
|
+
import { F as ae, G as vr } from "./Layout-CjE5bQn7.js";
|
|
6
6
|
import { T as Ae } from "./Heading-DpEVkX3a.js";
|
|
7
7
|
import { c as $ } from "./index-CRiPKpXj.js";
|
|
8
|
-
import { c as we, d as jt, P as k, a as ye, e as
|
|
8
|
+
import { c as we, d as jt, P as k, a as ye, e as L, t as Pt, g as _t, b as Z, u as dt, v as Me, l as Tt, m as gr, A as xr, f as ne, h as Dt, V as br, i as At, j as yr, R as Mt, F as Ot, D as wr, C as Cr, n as Sr, q as Lt, r as Ft, s as Bt, p as $t, w as Er, x as Ir, k as Rr } from "./popover-nVL6yIZo.js";
|
|
9
9
|
import * as Vt from "react-dom";
|
|
10
10
|
/**
|
|
11
11
|
* @license lucide-react v0.543.0 - ISC
|
|
@@ -65,14 +65,14 @@ const Or = [
|
|
|
65
65
|
["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
|
|
66
66
|
["path", { d: "M2 12h4", key: "j09sii" }],
|
|
67
67
|
["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
|
|
68
|
-
],
|
|
68
|
+
], Lr = re("loader", Or);
|
|
69
69
|
/**
|
|
70
70
|
* @license lucide-react v0.543.0 - ISC
|
|
71
71
|
*
|
|
72
72
|
* This source code is licensed under the ISC license.
|
|
73
73
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
74
|
*/
|
|
75
|
-
const
|
|
75
|
+
const Fr = [
|
|
76
76
|
[
|
|
77
77
|
"path",
|
|
78
78
|
{
|
|
@@ -82,7 +82,7 @@ const Lr = [
|
|
|
82
82
|
],
|
|
83
83
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
84
84
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
85
|
-
], Br = re("save",
|
|
85
|
+
], Br = re("save", Fr);
|
|
86
86
|
/**
|
|
87
87
|
* @license lucide-react v0.543.0 - ISC
|
|
88
88
|
*
|
|
@@ -108,7 +108,7 @@ const Ur = [
|
|
|
108
108
|
}
|
|
109
109
|
],
|
|
110
110
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
111
|
-
],
|
|
111
|
+
], ze = re("send", Ur);
|
|
112
112
|
/**
|
|
113
113
|
* @license lucide-react v0.543.0 - ISC
|
|
114
114
|
*
|
|
@@ -123,17 +123,17 @@ const Gr = [
|
|
|
123
123
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
124
124
|
], Wr = re("trash-2", Gr);
|
|
125
125
|
function ft(e) {
|
|
126
|
-
const t =
|
|
127
|
-
return
|
|
126
|
+
const t = a.useRef({ value: e, previous: e });
|
|
127
|
+
return a.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
128
128
|
}
|
|
129
|
-
var Oe = "Checkbox", [Hr,
|
|
130
|
-
function
|
|
129
|
+
var Oe = "Checkbox", [Hr, ka] = we(Oe), [Kr, pt] = Hr(Oe);
|
|
130
|
+
function zr(e) {
|
|
131
131
|
const {
|
|
132
132
|
__scopeCheckbox: t,
|
|
133
133
|
checked: n,
|
|
134
134
|
children: o,
|
|
135
135
|
defaultChecked: r,
|
|
136
|
-
disabled:
|
|
136
|
+
disabled: s,
|
|
137
137
|
form: c,
|
|
138
138
|
name: d,
|
|
139
139
|
onCheckedChange: u,
|
|
@@ -146,15 +146,15 @@ function Kr(e) {
|
|
|
146
146
|
defaultProp: r ?? !1,
|
|
147
147
|
onChange: u,
|
|
148
148
|
caller: Oe
|
|
149
|
-
}), [w,
|
|
149
|
+
}), [w, h] = a.useState(null), [v, S] = a.useState(null), y = a.useRef(!1), I = w ? !!c || !!w.closest("form") : (
|
|
150
150
|
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
151
151
|
!0
|
|
152
152
|
), A = {
|
|
153
153
|
checked: g,
|
|
154
|
-
disabled:
|
|
154
|
+
disabled: s,
|
|
155
155
|
setChecked: x,
|
|
156
156
|
control: w,
|
|
157
|
-
setControl:
|
|
157
|
+
setControl: h,
|
|
158
158
|
name: d,
|
|
159
159
|
form: c,
|
|
160
160
|
value: f,
|
|
@@ -162,11 +162,11 @@ function Kr(e) {
|
|
|
162
162
|
required: l,
|
|
163
163
|
defaultChecked: oe(r) ? !1 : r,
|
|
164
164
|
isFormControl: I,
|
|
165
|
-
bubbleInput:
|
|
165
|
+
bubbleInput: v,
|
|
166
166
|
setBubbleInput: S
|
|
167
167
|
};
|
|
168
168
|
return /* @__PURE__ */ i.jsx(
|
|
169
|
-
|
|
169
|
+
Kr,
|
|
170
170
|
{
|
|
171
171
|
scope: t,
|
|
172
172
|
...A,
|
|
@@ -174,10 +174,10 @@ function Kr(e) {
|
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
|
-
var Ut = "CheckboxTrigger", Gt =
|
|
177
|
+
var Ut = "CheckboxTrigger", Gt = a.forwardRef(
|
|
178
178
|
({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...o }, r) => {
|
|
179
179
|
const {
|
|
180
|
-
control:
|
|
180
|
+
control: s,
|
|
181
181
|
value: c,
|
|
182
182
|
disabled: d,
|
|
183
183
|
checked: u,
|
|
@@ -187,14 +187,14 @@ var Ut = "CheckboxTrigger", Gt = s.forwardRef(
|
|
|
187
187
|
hasConsumerStoppedPropagationRef: g,
|
|
188
188
|
isFormControl: x,
|
|
189
189
|
bubbleInput: w
|
|
190
|
-
} = pt(Ut, e),
|
|
191
|
-
return
|
|
192
|
-
const S =
|
|
190
|
+
} = pt(Ut, e), h = V(r, f), v = a.useRef(u);
|
|
191
|
+
return a.useEffect(() => {
|
|
192
|
+
const S = s?.form;
|
|
193
193
|
if (S) {
|
|
194
|
-
const y = () => m(
|
|
194
|
+
const y = () => m(v.current);
|
|
195
195
|
return S.addEventListener("reset", y), () => S.removeEventListener("reset", y);
|
|
196
196
|
}
|
|
197
|
-
}, [
|
|
197
|
+
}, [s, m]), /* @__PURE__ */ i.jsx(
|
|
198
198
|
k.button,
|
|
199
199
|
{
|
|
200
200
|
type: "button",
|
|
@@ -206,11 +206,11 @@ var Ut = "CheckboxTrigger", Gt = s.forwardRef(
|
|
|
206
206
|
disabled: d,
|
|
207
207
|
value: c,
|
|
208
208
|
...o,
|
|
209
|
-
ref:
|
|
210
|
-
onKeyDown:
|
|
209
|
+
ref: h,
|
|
210
|
+
onKeyDown: L(t, (S) => {
|
|
211
211
|
S.key === "Enter" && S.preventDefault();
|
|
212
212
|
}),
|
|
213
|
-
onClick:
|
|
213
|
+
onClick: L(n, (S) => {
|
|
214
214
|
m((y) => oe(y) ? !0 : !y), w && x && (g.current = S.isPropagationStopped(), g.current || S.stopPropagation());
|
|
215
215
|
})
|
|
216
216
|
}
|
|
@@ -218,13 +218,13 @@ var Ut = "CheckboxTrigger", Gt = s.forwardRef(
|
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
220
|
Gt.displayName = Ut;
|
|
221
|
-
var Wt =
|
|
221
|
+
var Wt = a.forwardRef(
|
|
222
222
|
(e, t) => {
|
|
223
223
|
const {
|
|
224
224
|
__scopeCheckbox: n,
|
|
225
225
|
name: o,
|
|
226
226
|
checked: r,
|
|
227
|
-
defaultChecked:
|
|
227
|
+
defaultChecked: s,
|
|
228
228
|
required: c,
|
|
229
229
|
disabled: d,
|
|
230
230
|
value: u,
|
|
@@ -233,11 +233,11 @@ var Wt = s.forwardRef(
|
|
|
233
233
|
...m
|
|
234
234
|
} = e;
|
|
235
235
|
return /* @__PURE__ */ i.jsx(
|
|
236
|
-
|
|
236
|
+
zr,
|
|
237
237
|
{
|
|
238
238
|
__scopeCheckbox: n,
|
|
239
239
|
checked: r,
|
|
240
|
-
defaultChecked:
|
|
240
|
+
defaultChecked: s,
|
|
241
241
|
disabled: d,
|
|
242
242
|
required: c,
|
|
243
243
|
onCheckedChange: l,
|
|
@@ -265,18 +265,18 @@ var Wt = s.forwardRef(
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
Wt.displayName = Oe;
|
|
268
|
-
var Ht = "CheckboxIndicator",
|
|
268
|
+
var Ht = "CheckboxIndicator", Kt = a.forwardRef(
|
|
269
269
|
(e, t) => {
|
|
270
|
-
const { __scopeCheckbox: n, forceMount: o, ...r } = e,
|
|
270
|
+
const { __scopeCheckbox: n, forceMount: o, ...r } = e, s = pt(Ht, n);
|
|
271
271
|
return /* @__PURE__ */ i.jsx(
|
|
272
272
|
jt,
|
|
273
273
|
{
|
|
274
|
-
present: o || oe(
|
|
274
|
+
present: o || oe(s.checked) || s.checked === !0,
|
|
275
275
|
children: /* @__PURE__ */ i.jsx(
|
|
276
276
|
k.span,
|
|
277
277
|
{
|
|
278
|
-
"data-state": Yt(
|
|
279
|
-
"data-disabled":
|
|
278
|
+
"data-state": Yt(s.checked),
|
|
279
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
280
280
|
...r,
|
|
281
281
|
ref: t,
|
|
282
282
|
style: { pointerEvents: "none", ...e.style }
|
|
@@ -286,13 +286,13 @@ var Ht = "CheckboxIndicator", zt = s.forwardRef(
|
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
);
|
|
289
|
-
|
|
290
|
-
var
|
|
289
|
+
Kt.displayName = Ht;
|
|
290
|
+
var zt = "CheckboxBubbleInput", qt = a.forwardRef(
|
|
291
291
|
({ __scopeCheckbox: e, ...t }, n) => {
|
|
292
292
|
const {
|
|
293
293
|
control: o,
|
|
294
294
|
hasConsumerStoppedPropagationRef: r,
|
|
295
|
-
checked:
|
|
295
|
+
checked: s,
|
|
296
296
|
defaultChecked: c,
|
|
297
297
|
required: d,
|
|
298
298
|
disabled: u,
|
|
@@ -301,20 +301,20 @@ var Kt = "CheckboxBubbleInput", qt = s.forwardRef(
|
|
|
301
301
|
form: m,
|
|
302
302
|
bubbleInput: g,
|
|
303
303
|
setBubbleInput: x
|
|
304
|
-
} = pt(
|
|
305
|
-
|
|
304
|
+
} = pt(zt, e), w = V(n, x), h = ft(s), v = Pt(o);
|
|
305
|
+
a.useEffect(() => {
|
|
306
306
|
const y = g;
|
|
307
307
|
if (!y) return;
|
|
308
308
|
const I = window.HTMLInputElement.prototype, M = Object.getOwnPropertyDescriptor(
|
|
309
309
|
I,
|
|
310
310
|
"checked"
|
|
311
311
|
).set, j = !r.current;
|
|
312
|
-
if (
|
|
312
|
+
if (h !== s && M) {
|
|
313
313
|
const E = new Event("click", { bubbles: j });
|
|
314
|
-
y.indeterminate = oe(
|
|
314
|
+
y.indeterminate = oe(s), M.call(y, oe(s) ? !1 : s), y.dispatchEvent(E);
|
|
315
315
|
}
|
|
316
|
-
}, [g,
|
|
317
|
-
const S =
|
|
316
|
+
}, [g, h, s, r]);
|
|
317
|
+
const S = a.useRef(oe(s) ? !1 : s);
|
|
318
318
|
return /* @__PURE__ */ i.jsx(
|
|
319
319
|
k.input,
|
|
320
320
|
{
|
|
@@ -331,7 +331,7 @@ var Kt = "CheckboxBubbleInput", qt = s.forwardRef(
|
|
|
331
331
|
ref: w,
|
|
332
332
|
style: {
|
|
333
333
|
...t.style,
|
|
334
|
-
...
|
|
334
|
+
...v,
|
|
335
335
|
position: "absolute",
|
|
336
336
|
pointerEvents: "none",
|
|
337
337
|
opacity: 0,
|
|
@@ -345,7 +345,7 @@ var Kt = "CheckboxBubbleInput", qt = s.forwardRef(
|
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
);
|
|
348
|
-
qt.displayName =
|
|
348
|
+
qt.displayName = zt;
|
|
349
349
|
function qr(e) {
|
|
350
350
|
return typeof e == "function";
|
|
351
351
|
}
|
|
@@ -358,29 +358,29 @@ function Yt(e) {
|
|
|
358
358
|
var qe = "rovingFocusGroup.onEntryFocus", Yr = { bubbles: !1, cancelable: !0 }, ke = "RovingFocusGroup", [Qe, Xt, Xr] = _t(ke), [Zr, Zt] = we(
|
|
359
359
|
ke,
|
|
360
360
|
[Xr]
|
|
361
|
-
), [Jr, Qr] = Zr(ke), Jt =
|
|
361
|
+
), [Jr, Qr] = Zr(ke), Jt = a.forwardRef(
|
|
362
362
|
(e, t) => /* @__PURE__ */ i.jsx(Qe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ i.jsx(Qe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ i.jsx(eo, { ...e, ref: t }) }) })
|
|
363
363
|
);
|
|
364
364
|
Jt.displayName = ke;
|
|
365
|
-
var eo =
|
|
365
|
+
var eo = a.forwardRef((e, t) => {
|
|
366
366
|
const {
|
|
367
367
|
__scopeRovingFocusGroup: n,
|
|
368
368
|
orientation: o,
|
|
369
369
|
loop: r = !1,
|
|
370
|
-
dir:
|
|
370
|
+
dir: s,
|
|
371
371
|
currentTabStopId: c,
|
|
372
372
|
defaultCurrentTabStopId: d,
|
|
373
373
|
onCurrentTabStopIdChange: u,
|
|
374
374
|
onEntryFocus: l,
|
|
375
375
|
preventScrollOnEntryFocus: f = !1,
|
|
376
376
|
...m
|
|
377
|
-
} = e, g =
|
|
377
|
+
} = e, g = a.useRef(null), x = V(t, g), w = dt(s), [h, v] = ye({
|
|
378
378
|
prop: c,
|
|
379
379
|
defaultProp: d ?? null,
|
|
380
380
|
onChange: u,
|
|
381
381
|
caller: ke
|
|
382
|
-
}), [S, y] =
|
|
383
|
-
return
|
|
382
|
+
}), [S, y] = a.useState(!1), I = Me(l), A = Xt(n), M = a.useRef(!1), [j, E] = a.useState(0);
|
|
383
|
+
return a.useEffect(() => {
|
|
384
384
|
const P = g.current;
|
|
385
385
|
if (P)
|
|
386
386
|
return P.addEventListener(qe, I), () => P.removeEventListener(qe, I);
|
|
@@ -391,17 +391,17 @@ var eo = s.forwardRef((e, t) => {
|
|
|
391
391
|
orientation: o,
|
|
392
392
|
dir: w,
|
|
393
393
|
loop: r,
|
|
394
|
-
currentTabStopId:
|
|
395
|
-
onItemFocus:
|
|
396
|
-
(P) =>
|
|
397
|
-
[
|
|
394
|
+
currentTabStopId: h,
|
|
395
|
+
onItemFocus: a.useCallback(
|
|
396
|
+
(P) => v(P),
|
|
397
|
+
[v]
|
|
398
398
|
),
|
|
399
|
-
onItemShiftTab:
|
|
400
|
-
onFocusableItemAdd:
|
|
399
|
+
onItemShiftTab: a.useCallback(() => y(!0), []),
|
|
400
|
+
onFocusableItemAdd: a.useCallback(
|
|
401
401
|
() => E((P) => P + 1),
|
|
402
402
|
[]
|
|
403
403
|
),
|
|
404
|
-
onFocusableItemRemove:
|
|
404
|
+
onFocusableItemRemove: a.useCallback(
|
|
405
405
|
() => E((P) => P - 1),
|
|
406
406
|
[]
|
|
407
407
|
),
|
|
@@ -413,38 +413,38 @@ var eo = s.forwardRef((e, t) => {
|
|
|
413
413
|
...m,
|
|
414
414
|
ref: x,
|
|
415
415
|
style: { outline: "none", ...e.style },
|
|
416
|
-
onMouseDown:
|
|
416
|
+
onMouseDown: L(e.onMouseDown, () => {
|
|
417
417
|
M.current = !0;
|
|
418
418
|
}),
|
|
419
|
-
onFocus:
|
|
420
|
-
const
|
|
421
|
-
if (P.target === P.currentTarget &&
|
|
419
|
+
onFocus: L(e.onFocus, (P) => {
|
|
420
|
+
const z = !M.current;
|
|
421
|
+
if (P.target === P.currentTarget && z && !S) {
|
|
422
422
|
const U = new CustomEvent(qe, Yr);
|
|
423
423
|
if (P.currentTarget.dispatchEvent(U), !U.defaultPrevented) {
|
|
424
|
-
const W = A().filter((
|
|
424
|
+
const W = A().filter((F) => F.focusable), q = W.find((F) => F.active), X = W.find((F) => F.id === h), K = [q, X, ...W].filter(
|
|
425
425
|
Boolean
|
|
426
|
-
).map((
|
|
427
|
-
tn(
|
|
426
|
+
).map((F) => F.ref.current);
|
|
427
|
+
tn(K, f);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
M.current = !1;
|
|
431
431
|
}),
|
|
432
|
-
onBlur:
|
|
432
|
+
onBlur: L(e.onBlur, () => y(!1))
|
|
433
433
|
}
|
|
434
434
|
)
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
|
-
}), Qt = "RovingFocusGroupItem", en =
|
|
437
|
+
}), Qt = "RovingFocusGroupItem", en = a.forwardRef(
|
|
438
438
|
(e, t) => {
|
|
439
439
|
const {
|
|
440
440
|
__scopeRovingFocusGroup: n,
|
|
441
441
|
focusable: o = !0,
|
|
442
442
|
active: r = !1,
|
|
443
|
-
tabStopId:
|
|
443
|
+
tabStopId: s,
|
|
444
444
|
children: c,
|
|
445
445
|
...d
|
|
446
|
-
} = e, u = Z(), l =
|
|
447
|
-
return
|
|
446
|
+
} = e, u = Z(), l = s || u, f = Qr(Qt, n), m = f.currentTabStopId === l, g = Xt(n), { onFocusableItemAdd: x, onFocusableItemRemove: w, currentTabStopId: h } = f;
|
|
447
|
+
return a.useEffect(() => {
|
|
448
448
|
if (o)
|
|
449
449
|
return x(), () => w();
|
|
450
450
|
}, [o, x, w]), /* @__PURE__ */ i.jsx(
|
|
@@ -461,31 +461,31 @@ var eo = s.forwardRef((e, t) => {
|
|
|
461
461
|
"data-orientation": f.orientation,
|
|
462
462
|
...d,
|
|
463
463
|
ref: t,
|
|
464
|
-
onMouseDown:
|
|
465
|
-
o ? f.onItemFocus(l) :
|
|
464
|
+
onMouseDown: L(e.onMouseDown, (v) => {
|
|
465
|
+
o ? f.onItemFocus(l) : v.preventDefault();
|
|
466
466
|
}),
|
|
467
|
-
onFocus:
|
|
468
|
-
onKeyDown:
|
|
469
|
-
if (
|
|
467
|
+
onFocus: L(e.onFocus, () => f.onItemFocus(l)),
|
|
468
|
+
onKeyDown: L(e.onKeyDown, (v) => {
|
|
469
|
+
if (v.key === "Tab" && v.shiftKey) {
|
|
470
470
|
f.onItemShiftTab();
|
|
471
471
|
return;
|
|
472
472
|
}
|
|
473
|
-
if (
|
|
474
|
-
const S = ro(
|
|
473
|
+
if (v.target !== v.currentTarget) return;
|
|
474
|
+
const S = ro(v, f.orientation, f.dir);
|
|
475
475
|
if (S !== void 0) {
|
|
476
|
-
if (
|
|
477
|
-
|
|
476
|
+
if (v.metaKey || v.ctrlKey || v.altKey || v.shiftKey) return;
|
|
477
|
+
v.preventDefault();
|
|
478
478
|
let I = g().filter((A) => A.focusable).map((A) => A.ref.current);
|
|
479
479
|
if (S === "last") I.reverse();
|
|
480
480
|
else if (S === "prev" || S === "next") {
|
|
481
481
|
S === "prev" && I.reverse();
|
|
482
|
-
const A = I.indexOf(
|
|
482
|
+
const A = I.indexOf(v.currentTarget);
|
|
483
483
|
I = f.loop ? oo(I, A + 1) : I.slice(A + 1);
|
|
484
484
|
}
|
|
485
485
|
setTimeout(() => tn(I));
|
|
486
486
|
}
|
|
487
487
|
}),
|
|
488
|
-
children: typeof c == "function" ? c({ isCurrentTabStop: m, hasTabStop:
|
|
488
|
+
children: typeof c == "function" ? c({ isCurrentTabStop: m, hasTabStop: h != null }) : c
|
|
489
489
|
}
|
|
490
490
|
)
|
|
491
491
|
}
|
|
@@ -519,7 +519,7 @@ function tn(e, t = !1) {
|
|
|
519
519
|
function oo(e, t) {
|
|
520
520
|
return e.map((n, o) => e[(t + o) % e.length]);
|
|
521
521
|
}
|
|
522
|
-
var so = Jt, ao = en, io = "Label", nn =
|
|
522
|
+
var so = Jt, ao = en, io = "Label", nn = a.forwardRef((e, t) => /* @__PURE__ */ i.jsx(
|
|
523
523
|
k.label,
|
|
524
524
|
{
|
|
525
525
|
...e,
|
|
@@ -534,19 +534,19 @@ var co = nn;
|
|
|
534
534
|
function yt(e, [t, n]) {
|
|
535
535
|
return Math.min(n, Math.max(t, e));
|
|
536
536
|
}
|
|
537
|
-
var mt = "Radio", [lo, rn] = we(mt), [uo, fo] = lo(mt), on =
|
|
537
|
+
var mt = "Radio", [lo, rn] = we(mt), [uo, fo] = lo(mt), on = a.forwardRef(
|
|
538
538
|
(e, t) => {
|
|
539
539
|
const {
|
|
540
540
|
__scopeRadio: n,
|
|
541
541
|
name: o,
|
|
542
542
|
checked: r = !1,
|
|
543
|
-
required:
|
|
543
|
+
required: s,
|
|
544
544
|
disabled: c,
|
|
545
545
|
value: d = "on",
|
|
546
546
|
onCheck: u,
|
|
547
547
|
form: l,
|
|
548
548
|
...f
|
|
549
|
-
} = e, [m, g] =
|
|
549
|
+
} = e, [m, g] = a.useState(null), x = V(t, (v) => g(v)), w = a.useRef(!1), h = m ? l || !!m.closest("form") : !0;
|
|
550
550
|
return /* @__PURE__ */ i.jsxs(uo, { scope: n, checked: r, disabled: c, children: [
|
|
551
551
|
/* @__PURE__ */ i.jsx(
|
|
552
552
|
k.button,
|
|
@@ -560,12 +560,12 @@ var mt = "Radio", [lo, rn] = we(mt), [uo, fo] = lo(mt), on = s.forwardRef(
|
|
|
560
560
|
value: d,
|
|
561
561
|
...f,
|
|
562
562
|
ref: x,
|
|
563
|
-
onClick:
|
|
564
|
-
r || u?.(),
|
|
563
|
+
onClick: L(e.onClick, (v) => {
|
|
564
|
+
r || u?.(), h && (w.current = v.isPropagationStopped(), w.current || v.stopPropagation());
|
|
565
565
|
})
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
|
-
|
|
568
|
+
h && /* @__PURE__ */ i.jsx(
|
|
569
569
|
cn,
|
|
570
570
|
{
|
|
571
571
|
control: m,
|
|
@@ -573,7 +573,7 @@ var mt = "Radio", [lo, rn] = we(mt), [uo, fo] = lo(mt), on = s.forwardRef(
|
|
|
573
573
|
name: o,
|
|
574
574
|
value: d,
|
|
575
575
|
checked: r,
|
|
576
|
-
required:
|
|
576
|
+
required: s,
|
|
577
577
|
disabled: c,
|
|
578
578
|
form: l,
|
|
579
579
|
style: { transform: "translateX(-100%)" }
|
|
@@ -583,14 +583,14 @@ var mt = "Radio", [lo, rn] = we(mt), [uo, fo] = lo(mt), on = s.forwardRef(
|
|
|
583
583
|
}
|
|
584
584
|
);
|
|
585
585
|
on.displayName = mt;
|
|
586
|
-
var sn = "RadioIndicator", an =
|
|
586
|
+
var sn = "RadioIndicator", an = a.forwardRef(
|
|
587
587
|
(e, t) => {
|
|
588
|
-
const { __scopeRadio: n, forceMount: o, ...r } = e,
|
|
589
|
-
return /* @__PURE__ */ i.jsx(jt, { present: o ||
|
|
588
|
+
const { __scopeRadio: n, forceMount: o, ...r } = e, s = fo(sn, n);
|
|
589
|
+
return /* @__PURE__ */ i.jsx(jt, { present: o || s.checked, children: /* @__PURE__ */ i.jsx(
|
|
590
590
|
k.span,
|
|
591
591
|
{
|
|
592
|
-
"data-state": ln(
|
|
593
|
-
"data-disabled":
|
|
592
|
+
"data-state": ln(s.checked),
|
|
593
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
594
594
|
...r,
|
|
595
595
|
ref: t
|
|
596
596
|
}
|
|
@@ -598,16 +598,16 @@ var sn = "RadioIndicator", an = s.forwardRef(
|
|
|
598
598
|
}
|
|
599
599
|
);
|
|
600
600
|
an.displayName = sn;
|
|
601
|
-
var po = "RadioBubbleInput", cn =
|
|
601
|
+
var po = "RadioBubbleInput", cn = a.forwardRef(
|
|
602
602
|
({
|
|
603
603
|
__scopeRadio: e,
|
|
604
604
|
control: t,
|
|
605
605
|
checked: n,
|
|
606
606
|
bubbles: o = !0,
|
|
607
607
|
...r
|
|
608
|
-
},
|
|
609
|
-
const c =
|
|
610
|
-
return
|
|
608
|
+
}, s) => {
|
|
609
|
+
const c = a.useRef(null), d = V(c, s), u = ft(n), l = Pt(t);
|
|
610
|
+
return a.useEffect(() => {
|
|
611
611
|
const f = c.current;
|
|
612
612
|
if (!f) return;
|
|
613
613
|
const m = window.HTMLInputElement.prototype, x = Object.getOwnPropertyDescriptor(
|
|
@@ -643,16 +643,16 @@ cn.displayName = po;
|
|
|
643
643
|
function ln(e) {
|
|
644
644
|
return e ? "checked" : "unchecked";
|
|
645
645
|
}
|
|
646
|
-
var mo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"],
|
|
646
|
+
var mo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Le = "RadioGroup", [ho, ja] = we(Le, [
|
|
647
647
|
Zt,
|
|
648
648
|
rn
|
|
649
|
-
]), dn = Zt(), un = rn(), [
|
|
649
|
+
]), dn = Zt(), un = rn(), [vo, go] = ho(Le), fn = a.forwardRef(
|
|
650
650
|
(e, t) => {
|
|
651
651
|
const {
|
|
652
652
|
__scopeRadioGroup: n,
|
|
653
653
|
name: o,
|
|
654
654
|
defaultValue: r,
|
|
655
|
-
value:
|
|
655
|
+
value: s,
|
|
656
656
|
required: c = !1,
|
|
657
657
|
disabled: d = !1,
|
|
658
658
|
orientation: u,
|
|
@@ -660,21 +660,21 @@ var mo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Fe = "RadioGroup",
|
|
|
660
660
|
loop: f = !0,
|
|
661
661
|
onValueChange: m,
|
|
662
662
|
...g
|
|
663
|
-
} = e, x = dn(n), w = dt(l), [
|
|
664
|
-
prop:
|
|
663
|
+
} = e, x = dn(n), w = dt(l), [h, v] = ye({
|
|
664
|
+
prop: s,
|
|
665
665
|
defaultProp: r ?? null,
|
|
666
666
|
onChange: m,
|
|
667
|
-
caller:
|
|
667
|
+
caller: Le
|
|
668
668
|
});
|
|
669
669
|
return /* @__PURE__ */ i.jsx(
|
|
670
|
-
|
|
670
|
+
vo,
|
|
671
671
|
{
|
|
672
672
|
scope: n,
|
|
673
673
|
name: o,
|
|
674
674
|
required: c,
|
|
675
675
|
disabled: d,
|
|
676
|
-
value:
|
|
677
|
-
onValueChange:
|
|
676
|
+
value: h,
|
|
677
|
+
onValueChange: v,
|
|
678
678
|
children: /* @__PURE__ */ i.jsx(
|
|
679
679
|
so,
|
|
680
680
|
{
|
|
@@ -701,13 +701,13 @@ var mo = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Fe = "RadioGroup",
|
|
|
701
701
|
);
|
|
702
702
|
}
|
|
703
703
|
);
|
|
704
|
-
fn.displayName =
|
|
705
|
-
var pn = "RadioGroupItem", mn =
|
|
704
|
+
fn.displayName = Le;
|
|
705
|
+
var pn = "RadioGroupItem", mn = a.forwardRef(
|
|
706
706
|
(e, t) => {
|
|
707
|
-
const { __scopeRadioGroup: n, disabled: o, ...r } = e,
|
|
708
|
-
return
|
|
709
|
-
const x = (
|
|
710
|
-
mo.includes(
|
|
707
|
+
const { __scopeRadioGroup: n, disabled: o, ...r } = e, s = go(pn, n), c = s.disabled || o, d = dn(n), u = un(n), l = a.useRef(null), f = V(t, l), m = s.value === r.value, g = a.useRef(!1);
|
|
708
|
+
return a.useEffect(() => {
|
|
709
|
+
const x = (h) => {
|
|
710
|
+
mo.includes(h.key) && (g.current = !0);
|
|
711
711
|
}, w = () => g.current = !1;
|
|
712
712
|
return document.addEventListener("keydown", x), document.addEventListener("keyup", w), () => {
|
|
713
713
|
document.removeEventListener("keydown", x), document.removeEventListener("keyup", w);
|
|
@@ -723,17 +723,17 @@ var pn = "RadioGroupItem", mn = s.forwardRef(
|
|
|
723
723
|
on,
|
|
724
724
|
{
|
|
725
725
|
disabled: c,
|
|
726
|
-
required:
|
|
726
|
+
required: s.required,
|
|
727
727
|
checked: m,
|
|
728
728
|
...u,
|
|
729
729
|
...r,
|
|
730
|
-
name:
|
|
730
|
+
name: s.name,
|
|
731
731
|
ref: f,
|
|
732
|
-
onCheck: () =>
|
|
733
|
-
onKeyDown:
|
|
732
|
+
onCheck: () => s.onValueChange(r.value),
|
|
733
|
+
onKeyDown: L((x) => {
|
|
734
734
|
x.key === "Enter" && x.preventDefault();
|
|
735
735
|
}),
|
|
736
|
-
onFocus:
|
|
736
|
+
onFocus: L(r.onFocus, () => {
|
|
737
737
|
g.current && l.current?.click();
|
|
738
738
|
})
|
|
739
739
|
}
|
|
@@ -743,23 +743,23 @@ var pn = "RadioGroupItem", mn = s.forwardRef(
|
|
|
743
743
|
}
|
|
744
744
|
);
|
|
745
745
|
mn.displayName = pn;
|
|
746
|
-
var xo = "RadioGroupIndicator",
|
|
746
|
+
var xo = "RadioGroupIndicator", hn = a.forwardRef(
|
|
747
747
|
(e, t) => {
|
|
748
748
|
const { __scopeRadioGroup: n, ...o } = e, r = un(n);
|
|
749
749
|
return /* @__PURE__ */ i.jsx(an, { ...r, ...o, ref: t });
|
|
750
750
|
}
|
|
751
751
|
);
|
|
752
|
-
|
|
753
|
-
var bo = fn, yo = mn, wo =
|
|
752
|
+
hn.displayName = xo;
|
|
753
|
+
var bo = fn, yo = mn, wo = hn, Co = [" ", "Enter", "ArrowUp", "ArrowDown"], So = [" ", "Enter"], pe = "Select", [Fe, Be, Eo] = _t(pe), [Ce, Pa] = we(pe, [
|
|
754
754
|
Eo,
|
|
755
755
|
Tt
|
|
756
|
-
]), $e = Tt(), [Io, ce] = Ce(pe), [Ro, No] = Ce(pe),
|
|
756
|
+
]), $e = Tt(), [Io, ce] = Ce(pe), [Ro, No] = Ce(pe), vn = (e) => {
|
|
757
757
|
const {
|
|
758
758
|
__scopeSelect: t,
|
|
759
759
|
children: n,
|
|
760
760
|
open: o,
|
|
761
761
|
defaultOpen: r,
|
|
762
|
-
onOpenChange:
|
|
762
|
+
onOpenChange: s,
|
|
763
763
|
value: c,
|
|
764
764
|
defaultValue: d,
|
|
765
765
|
onValueChange: u,
|
|
@@ -769,30 +769,30 @@ var bo = fn, yo = mn, wo = vn, Co = [" ", "Enter", "ArrowUp", "ArrowDown"], So =
|
|
|
769
769
|
disabled: g,
|
|
770
770
|
required: x,
|
|
771
771
|
form: w
|
|
772
|
-
} = e,
|
|
772
|
+
} = e, h = $e(t), [v, S] = a.useState(null), [y, I] = a.useState(null), [A, M] = a.useState(!1), j = dt(l), [E, P] = ye({
|
|
773
773
|
prop: o,
|
|
774
774
|
defaultProp: r ?? !1,
|
|
775
|
-
onChange:
|
|
775
|
+
onChange: s,
|
|
776
776
|
caller: pe
|
|
777
|
-
}), [
|
|
777
|
+
}), [z, U] = ye({
|
|
778
778
|
prop: c,
|
|
779
779
|
defaultProp: d,
|
|
780
780
|
onChange: u,
|
|
781
781
|
caller: pe
|
|
782
|
-
}), W =
|
|
783
|
-
return /* @__PURE__ */ i.jsx(gr, { ...
|
|
782
|
+
}), W = a.useRef(null), q = v ? w || !!v.closest("form") : !0, [X, H] = a.useState(/* @__PURE__ */ new Set()), K = Array.from(X).map((F) => F.props.value).join(";");
|
|
783
|
+
return /* @__PURE__ */ i.jsx(gr, { ...h, children: /* @__PURE__ */ i.jsxs(
|
|
784
784
|
Io,
|
|
785
785
|
{
|
|
786
786
|
required: x,
|
|
787
787
|
scope: t,
|
|
788
|
-
trigger:
|
|
788
|
+
trigger: v,
|
|
789
789
|
onTriggerChange: S,
|
|
790
790
|
valueNode: y,
|
|
791
791
|
onValueNodeChange: I,
|
|
792
792
|
valueNodeHasChildren: A,
|
|
793
793
|
onValueNodeHasChildrenChange: M,
|
|
794
794
|
contentId: Z(),
|
|
795
|
-
value:
|
|
795
|
+
value: z,
|
|
796
796
|
onValueChange: U,
|
|
797
797
|
open: E,
|
|
798
798
|
onOpenChange: P,
|
|
@@ -800,58 +800,58 @@ var bo = fn, yo = mn, wo = vn, Co = [" ", "Enter", "ArrowUp", "ArrowDown"], So =
|
|
|
800
800
|
triggerPointerDownPosRef: W,
|
|
801
801
|
disabled: g,
|
|
802
802
|
children: [
|
|
803
|
-
/* @__PURE__ */ i.jsx(
|
|
803
|
+
/* @__PURE__ */ i.jsx(Fe.Provider, { scope: t, children: /* @__PURE__ */ i.jsx(
|
|
804
804
|
Ro,
|
|
805
805
|
{
|
|
806
806
|
scope: e.__scopeSelect,
|
|
807
|
-
onNativeOptionAdd:
|
|
808
|
-
H((Y) => new Set(Y).add(
|
|
807
|
+
onNativeOptionAdd: a.useCallback((F) => {
|
|
808
|
+
H((Y) => new Set(Y).add(F));
|
|
809
809
|
}, []),
|
|
810
|
-
onNativeOptionRemove:
|
|
810
|
+
onNativeOptionRemove: a.useCallback((F) => {
|
|
811
811
|
H((Y) => {
|
|
812
812
|
const J = new Set(Y);
|
|
813
|
-
return J.delete(
|
|
813
|
+
return J.delete(F), J;
|
|
814
814
|
});
|
|
815
815
|
}, []),
|
|
816
816
|
children: n
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
819
|
q ? /* @__PURE__ */ i.jsxs(
|
|
820
|
-
|
|
820
|
+
Fn,
|
|
821
821
|
{
|
|
822
822
|
"aria-hidden": !0,
|
|
823
823
|
required: x,
|
|
824
824
|
tabIndex: -1,
|
|
825
825
|
name: f,
|
|
826
826
|
autoComplete: m,
|
|
827
|
-
value:
|
|
828
|
-
onChange: (
|
|
827
|
+
value: z,
|
|
828
|
+
onChange: (F) => U(F.target.value),
|
|
829
829
|
disabled: g,
|
|
830
830
|
form: w,
|
|
831
831
|
children: [
|
|
832
|
-
|
|
832
|
+
z === void 0 ? /* @__PURE__ */ i.jsx("option", { value: "" }) : null,
|
|
833
833
|
Array.from(X)
|
|
834
834
|
]
|
|
835
835
|
},
|
|
836
|
-
|
|
836
|
+
K
|
|
837
837
|
) : null
|
|
838
838
|
]
|
|
839
839
|
}
|
|
840
840
|
) });
|
|
841
841
|
};
|
|
842
|
-
|
|
843
|
-
var gn = "SelectTrigger", xn =
|
|
842
|
+
vn.displayName = pe;
|
|
843
|
+
var gn = "SelectTrigger", xn = a.forwardRef(
|
|
844
844
|
(e, t) => {
|
|
845
|
-
const { __scopeSelect: n, disabled: o = !1, ...r } = e,
|
|
846
|
-
const
|
|
845
|
+
const { __scopeSelect: n, disabled: o = !1, ...r } = e, s = $e(n), c = ce(gn, n), d = c.disabled || o, u = V(t, c.onTriggerChange), l = Be(n), f = a.useRef("touch"), [m, g, x] = $n((h) => {
|
|
846
|
+
const v = l().filter((I) => !I.disabled), S = v.find((I) => I.value === c.value), y = Vn(v, h, S);
|
|
847
847
|
y !== void 0 && c.onValueChange(y.value);
|
|
848
|
-
}), w = (
|
|
849
|
-
d || (c.onOpenChange(!0), x()),
|
|
850
|
-
x: Math.round(
|
|
851
|
-
y: Math.round(
|
|
848
|
+
}), w = (h) => {
|
|
849
|
+
d || (c.onOpenChange(!0), x()), h && (c.triggerPointerDownPosRef.current = {
|
|
850
|
+
x: Math.round(h.pageX),
|
|
851
|
+
y: Math.round(h.pageY)
|
|
852
852
|
});
|
|
853
853
|
};
|
|
854
|
-
return /* @__PURE__ */ i.jsx(xr, { asChild: !0, ...
|
|
854
|
+
return /* @__PURE__ */ i.jsx(xr, { asChild: !0, ...s, children: /* @__PURE__ */ i.jsx(
|
|
855
855
|
k.button,
|
|
856
856
|
{
|
|
857
857
|
type: "button",
|
|
@@ -867,26 +867,26 @@ var gn = "SelectTrigger", xn = s.forwardRef(
|
|
|
867
867
|
"data-placeholder": Bn(c.value) ? "" : void 0,
|
|
868
868
|
...r,
|
|
869
869
|
ref: u,
|
|
870
|
-
onClick:
|
|
871
|
-
|
|
870
|
+
onClick: L(r.onClick, (h) => {
|
|
871
|
+
h.currentTarget.focus(), f.current !== "mouse" && w(h);
|
|
872
872
|
}),
|
|
873
|
-
onPointerDown:
|
|
874
|
-
f.current =
|
|
875
|
-
const
|
|
876
|
-
|
|
873
|
+
onPointerDown: L(r.onPointerDown, (h) => {
|
|
874
|
+
f.current = h.pointerType;
|
|
875
|
+
const v = h.target;
|
|
876
|
+
v.hasPointerCapture(h.pointerId) && v.releasePointerCapture(h.pointerId), h.button === 0 && h.ctrlKey === !1 && h.pointerType === "mouse" && (w(h), h.preventDefault());
|
|
877
877
|
}),
|
|
878
|
-
onKeyDown:
|
|
879
|
-
const
|
|
880
|
-
!(
|
|
878
|
+
onKeyDown: L(r.onKeyDown, (h) => {
|
|
879
|
+
const v = m.current !== "";
|
|
880
|
+
!(h.ctrlKey || h.altKey || h.metaKey) && h.key.length === 1 && g(h.key), !(v && h.key === " ") && Co.includes(h.key) && (w(), h.preventDefault());
|
|
881
881
|
})
|
|
882
882
|
}
|
|
883
883
|
) });
|
|
884
884
|
}
|
|
885
885
|
);
|
|
886
886
|
xn.displayName = gn;
|
|
887
|
-
var bn = "SelectValue", yn =
|
|
887
|
+
var bn = "SelectValue", yn = a.forwardRef(
|
|
888
888
|
(e, t) => {
|
|
889
|
-
const { __scopeSelect: n, className: o, style: r, children:
|
|
889
|
+
const { __scopeSelect: n, className: o, style: r, children: s, placeholder: c = "", ...d } = e, u = ce(bn, n), { onValueNodeHasChildrenChange: l } = u, f = s !== void 0, m = V(t, u.onValueNodeChange);
|
|
890
890
|
return ne(() => {
|
|
891
891
|
l(f);
|
|
892
892
|
}, [l, f]), /* @__PURE__ */ i.jsx(
|
|
@@ -895,13 +895,13 @@ var bn = "SelectValue", yn = s.forwardRef(
|
|
|
895
895
|
...d,
|
|
896
896
|
ref: m,
|
|
897
897
|
style: { pointerEvents: "none" },
|
|
898
|
-
children: Bn(u.value) ? /* @__PURE__ */ i.jsx(i.Fragment, { children: c }) :
|
|
898
|
+
children: Bn(u.value) ? /* @__PURE__ */ i.jsx(i.Fragment, { children: c }) : s
|
|
899
899
|
}
|
|
900
900
|
);
|
|
901
901
|
}
|
|
902
902
|
);
|
|
903
903
|
yn.displayName = bn;
|
|
904
|
-
var ko = "SelectIcon", wn =
|
|
904
|
+
var ko = "SelectIcon", wn = a.forwardRef(
|
|
905
905
|
(e, t) => {
|
|
906
906
|
const { __scopeSelect: n, children: o, ...r } = e;
|
|
907
907
|
return /* @__PURE__ */ i.jsx(k.span, { "aria-hidden": !0, ...r, ref: t, children: o || "▼" });
|
|
@@ -910,29 +910,29 @@ var ko = "SelectIcon", wn = s.forwardRef(
|
|
|
910
910
|
wn.displayName = ko;
|
|
911
911
|
var jo = "SelectPortal", Cn = (e) => /* @__PURE__ */ i.jsx(Dt, { asChild: !0, ...e });
|
|
912
912
|
Cn.displayName = jo;
|
|
913
|
-
var me = "SelectContent", Sn =
|
|
913
|
+
var me = "SelectContent", Sn = a.forwardRef(
|
|
914
914
|
(e, t) => {
|
|
915
|
-
const n = ce(me, e.__scopeSelect), [o, r] =
|
|
915
|
+
const n = ce(me, e.__scopeSelect), [o, r] = a.useState();
|
|
916
916
|
if (ne(() => {
|
|
917
917
|
r(new DocumentFragment());
|
|
918
918
|
}, []), !n.open) {
|
|
919
|
-
const
|
|
920
|
-
return
|
|
921
|
-
/* @__PURE__ */ i.jsx(En, { scope: e.__scopeSelect, children: /* @__PURE__ */ i.jsx(
|
|
922
|
-
|
|
919
|
+
const s = o;
|
|
920
|
+
return s ? Vt.createPortal(
|
|
921
|
+
/* @__PURE__ */ i.jsx(En, { scope: e.__scopeSelect, children: /* @__PURE__ */ i.jsx(Fe.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ i.jsx("div", { children: e.children }) }) }),
|
|
922
|
+
s
|
|
923
923
|
) : null;
|
|
924
924
|
}
|
|
925
925
|
return /* @__PURE__ */ i.jsx(In, { ...e, ref: t });
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
928
|
Sn.displayName = me;
|
|
929
|
-
var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent.RemoveScroll"), In =
|
|
929
|
+
var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent.RemoveScroll"), In = a.forwardRef(
|
|
930
930
|
(e, t) => {
|
|
931
931
|
const {
|
|
932
932
|
__scopeSelect: n,
|
|
933
933
|
position: o = "item-aligned",
|
|
934
934
|
onCloseAutoFocus: r,
|
|
935
|
-
onEscapeKeyDown:
|
|
935
|
+
onEscapeKeyDown: s,
|
|
936
936
|
onPointerDownOutside: c,
|
|
937
937
|
//
|
|
938
938
|
// PopperContent props
|
|
@@ -944,32 +944,32 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
944
944
|
collisionBoundary: g,
|
|
945
945
|
collisionPadding: x,
|
|
946
946
|
sticky: w,
|
|
947
|
-
hideWhenDetached:
|
|
948
|
-
avoidCollisions:
|
|
947
|
+
hideWhenDetached: h,
|
|
948
|
+
avoidCollisions: v,
|
|
949
949
|
//
|
|
950
950
|
...S
|
|
951
|
-
} = e, y = ce(me, n), [I, A] =
|
|
951
|
+
} = e, y = ce(me, n), [I, A] = a.useState(null), [M, j] = a.useState(null), E = V(t, (b) => A(b)), [P, z] = a.useState(null), [U, W] = a.useState(
|
|
952
952
|
null
|
|
953
|
-
), q = Be(n), [X, H] =
|
|
954
|
-
|
|
953
|
+
), q = Be(n), [X, H] = a.useState(!1), K = a.useRef(!1);
|
|
954
|
+
a.useEffect(() => {
|
|
955
955
|
if (I) return At(I);
|
|
956
956
|
}, [I]), yr();
|
|
957
|
-
const
|
|
957
|
+
const F = a.useCallback(
|
|
958
958
|
(b) => {
|
|
959
959
|
const [T, ...D] = q().map((G) => G.ref.current), [O] = D.slice(-1), B = document.activeElement;
|
|
960
960
|
for (const G of b)
|
|
961
961
|
if (G === B || (G?.scrollIntoView({ block: "nearest" }), G === T && M && (M.scrollTop = 0), G === O && M && (M.scrollTop = M.scrollHeight), G?.focus(), document.activeElement !== B)) return;
|
|
962
962
|
},
|
|
963
963
|
[q, M]
|
|
964
|
-
), Y =
|
|
965
|
-
() =>
|
|
966
|
-
[
|
|
964
|
+
), Y = a.useCallback(
|
|
965
|
+
() => F([P, I]),
|
|
966
|
+
[F, P, I]
|
|
967
967
|
);
|
|
968
|
-
|
|
968
|
+
a.useEffect(() => {
|
|
969
969
|
X && Y();
|
|
970
970
|
}, [X, Y]);
|
|
971
971
|
const { onOpenChange: J, triggerPointerDownPosRef: Q } = y;
|
|
972
|
-
|
|
972
|
+
a.useEffect(() => {
|
|
973
973
|
if (I) {
|
|
974
974
|
let b = { x: 0, y: 0 };
|
|
975
975
|
const T = (O) => {
|
|
@@ -984,7 +984,7 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
984
984
|
document.removeEventListener("pointermove", T), document.removeEventListener("pointerup", D, { capture: !0 });
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
|
-
}, [I, J, Q]),
|
|
987
|
+
}, [I, J, Q]), a.useEffect(() => {
|
|
988
988
|
const b = () => J(!1);
|
|
989
989
|
return window.addEventListener("blur", b), window.addEventListener("resize", b), () => {
|
|
990
990
|
window.removeEventListener("blur", b), window.removeEventListener("resize", b);
|
|
@@ -993,15 +993,15 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
993
993
|
const [ge, de] = $n((b) => {
|
|
994
994
|
const T = q().filter((B) => !B.disabled), D = T.find((B) => B.ref.current === document.activeElement), O = Vn(T, b, D);
|
|
995
995
|
O && setTimeout(() => O.ref.current.focus());
|
|
996
|
-
}), p =
|
|
996
|
+
}), p = a.useCallback(
|
|
997
997
|
(b, T, D) => {
|
|
998
|
-
const O = !
|
|
999
|
-
(y.value !== void 0 && y.value === T || O) && (
|
|
998
|
+
const O = !K.current && !D;
|
|
999
|
+
(y.value !== void 0 && y.value === T || O) && (z(b), O && (K.current = !0));
|
|
1000
1000
|
},
|
|
1001
1001
|
[y.value]
|
|
1002
|
-
), R =
|
|
1002
|
+
), R = a.useCallback(() => I?.focus(), [I]), N = a.useCallback(
|
|
1003
1003
|
(b, T, D) => {
|
|
1004
|
-
const O = !
|
|
1004
|
+
const O = !K.current && !D;
|
|
1005
1005
|
(y.value !== void 0 && y.value === T || O) && W(b);
|
|
1006
1006
|
},
|
|
1007
1007
|
[y.value]
|
|
@@ -1014,8 +1014,8 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
1014
1014
|
collisionBoundary: g,
|
|
1015
1015
|
collisionPadding: x,
|
|
1016
1016
|
sticky: w,
|
|
1017
|
-
hideWhenDetached:
|
|
1018
|
-
avoidCollisions:
|
|
1017
|
+
hideWhenDetached: h,
|
|
1018
|
+
avoidCollisions: v
|
|
1019
1019
|
} : {};
|
|
1020
1020
|
return /* @__PURE__ */ i.jsx(
|
|
1021
1021
|
En,
|
|
@@ -1041,7 +1041,7 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
1041
1041
|
onMountAutoFocus: (b) => {
|
|
1042
1042
|
b.preventDefault();
|
|
1043
1043
|
},
|
|
1044
|
-
onUnmountAutoFocus:
|
|
1044
|
+
onUnmountAutoFocus: L(r, (b) => {
|
|
1045
1045
|
y.trigger?.focus({ preventScroll: !0 }), b.preventDefault();
|
|
1046
1046
|
}),
|
|
1047
1047
|
children: /* @__PURE__ */ i.jsx(
|
|
@@ -1049,7 +1049,7 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
1049
1049
|
{
|
|
1050
1050
|
asChild: !0,
|
|
1051
1051
|
disableOutsidePointerEvents: !0,
|
|
1052
|
-
onEscapeKeyDown:
|
|
1052
|
+
onEscapeKeyDown: s,
|
|
1053
1053
|
onPointerDownOutside: c,
|
|
1054
1054
|
onFocusOutside: (b) => b.preventDefault(),
|
|
1055
1055
|
onDismiss: () => y.onOpenChange(!1),
|
|
@@ -1073,7 +1073,7 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
1073
1073
|
outline: "none",
|
|
1074
1074
|
...S.style
|
|
1075
1075
|
},
|
|
1076
|
-
onKeyDown:
|
|
1076
|
+
onKeyDown: L(S.onKeyDown, (b) => {
|
|
1077
1077
|
const T = b.ctrlKey || b.altKey || b.metaKey;
|
|
1078
1078
|
if (b.key === "Tab" && b.preventDefault(), !T && b.key.length === 1 && de(b.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(b.key)) {
|
|
1079
1079
|
let O = q().filter((B) => !B.disabled).map((B) => B.ref.current);
|
|
@@ -1081,7 +1081,7 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
1081
1081
|
const B = b.target, G = O.indexOf(B);
|
|
1082
1082
|
O = O.slice(G + 1);
|
|
1083
1083
|
}
|
|
1084
|
-
setTimeout(() =>
|
|
1084
|
+
setTimeout(() => F(O)), b.preventDefault();
|
|
1085
1085
|
}
|
|
1086
1086
|
})
|
|
1087
1087
|
}
|
|
@@ -1095,12 +1095,12 @@ var ee = 10, [En, le] = Ce(me), Po = "SelectContentImpl", _o = kt("SelectContent
|
|
|
1095
1095
|
}
|
|
1096
1096
|
);
|
|
1097
1097
|
In.displayName = Po;
|
|
1098
|
-
var To = "SelectItemAlignedPosition", Rn =
|
|
1099
|
-
const { __scopeSelect: n, onPlaced: o, ...r } = e,
|
|
1100
|
-
if (
|
|
1101
|
-
const E =
|
|
1102
|
-
if (
|
|
1103
|
-
const B = U.left - P.left, G =
|
|
1098
|
+
var To = "SelectItemAlignedPosition", Rn = a.forwardRef((e, t) => {
|
|
1099
|
+
const { __scopeSelect: n, onPlaced: o, ...r } = e, s = ce(me, n), c = le(me, n), [d, u] = a.useState(null), [l, f] = a.useState(null), m = V(t, (E) => f(E)), g = Be(n), x = a.useRef(!1), w = a.useRef(!0), { viewport: h, selectedItem: v, selectedItemText: S, focusSelectedItem: y } = c, I = a.useCallback(() => {
|
|
1100
|
+
if (s.trigger && s.valueNode && d && l && h && v && S) {
|
|
1101
|
+
const E = s.trigger.getBoundingClientRect(), P = l.getBoundingClientRect(), z = s.valueNode.getBoundingClientRect(), U = S.getBoundingClientRect();
|
|
1102
|
+
if (s.dir !== "rtl") {
|
|
1103
|
+
const B = U.left - P.left, G = z.left - B, ue = E.left - G, fe = E.width + ue, We = Math.max(fe, P.width), He = window.innerWidth - ee, Ke = yt(G, [
|
|
1104
1104
|
ee,
|
|
1105
1105
|
// Prevents the content from going off the starting edge of the
|
|
1106
1106
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -1109,54 +1109,54 @@ var To = "SelectItemAlignedPosition", Rn = s.forwardRef((e, t) => {
|
|
|
1109
1109
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
1110
1110
|
Math.max(ee, He - We)
|
|
1111
1111
|
]);
|
|
1112
|
-
d.style.minWidth = fe + "px", d.style.left =
|
|
1112
|
+
d.style.minWidth = fe + "px", d.style.left = Ke + "px";
|
|
1113
1113
|
} else {
|
|
1114
|
-
const B = P.right - U.right, G = window.innerWidth -
|
|
1114
|
+
const B = P.right - U.right, G = window.innerWidth - z.right - B, ue = window.innerWidth - E.right - G, fe = E.width + ue, We = Math.max(fe, P.width), He = window.innerWidth - ee, Ke = yt(G, [
|
|
1115
1115
|
ee,
|
|
1116
1116
|
Math.max(ee, He - We)
|
|
1117
1117
|
]);
|
|
1118
|
-
d.style.minWidth = fe + "px", d.style.right =
|
|
1118
|
+
d.style.minWidth = fe + "px", d.style.right = Ke + "px";
|
|
1119
1119
|
}
|
|
1120
|
-
const W = g(), q = window.innerHeight - ee * 2, X =
|
|
1120
|
+
const W = g(), q = window.innerHeight - ee * 2, X = h.scrollHeight, H = window.getComputedStyle(l), K = parseInt(H.borderTopWidth, 10), F = parseInt(H.paddingTop, 10), Y = parseInt(H.borderBottomWidth, 10), J = parseInt(H.paddingBottom, 10), Q = K + F + X + J + Y, ge = Math.min(v.offsetHeight * 5, Q), de = window.getComputedStyle(h), p = parseInt(de.paddingTop, 10), R = parseInt(de.paddingBottom, 10), N = E.top + E.height / 2 - ee, C = q - N, _ = v.offsetHeight / 2, b = v.offsetTop + _, T = K + F + b, D = Q - T;
|
|
1121
1121
|
if (T <= N) {
|
|
1122
|
-
const B = W.length > 0 &&
|
|
1122
|
+
const B = W.length > 0 && v === W[W.length - 1].ref.current;
|
|
1123
1123
|
d.style.bottom = "0px";
|
|
1124
|
-
const G = l.clientHeight -
|
|
1124
|
+
const G = l.clientHeight - h.offsetTop - h.offsetHeight, ue = Math.max(
|
|
1125
1125
|
C,
|
|
1126
1126
|
_ + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
1127
1127
|
(B ? R : 0) + G + Y
|
|
1128
1128
|
), fe = T + ue;
|
|
1129
1129
|
d.style.height = fe + "px";
|
|
1130
1130
|
} else {
|
|
1131
|
-
const B = W.length > 0 &&
|
|
1131
|
+
const B = W.length > 0 && v === W[0].ref.current;
|
|
1132
1132
|
d.style.top = "0px";
|
|
1133
1133
|
const ue = Math.max(
|
|
1134
1134
|
N,
|
|
1135
|
-
|
|
1135
|
+
K + h.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
1136
1136
|
(B ? p : 0) + _
|
|
1137
1137
|
) + D;
|
|
1138
|
-
d.style.height = ue + "px",
|
|
1138
|
+
d.style.height = ue + "px", h.scrollTop = T - N + h.offsetTop;
|
|
1139
1139
|
}
|
|
1140
1140
|
d.style.margin = `${ee}px 0`, d.style.minHeight = ge + "px", d.style.maxHeight = q + "px", o?.(), requestAnimationFrame(() => x.current = !0);
|
|
1141
1141
|
}
|
|
1142
1142
|
}, [
|
|
1143
1143
|
g,
|
|
1144
|
-
|
|
1145
|
-
|
|
1144
|
+
s.trigger,
|
|
1145
|
+
s.valueNode,
|
|
1146
1146
|
d,
|
|
1147
1147
|
l,
|
|
1148
|
-
v,
|
|
1149
1148
|
h,
|
|
1149
|
+
v,
|
|
1150
1150
|
S,
|
|
1151
|
-
|
|
1151
|
+
s.dir,
|
|
1152
1152
|
o
|
|
1153
1153
|
]);
|
|
1154
1154
|
ne(() => I(), [I]);
|
|
1155
|
-
const [A, M] =
|
|
1155
|
+
const [A, M] = a.useState();
|
|
1156
1156
|
ne(() => {
|
|
1157
1157
|
l && M(window.getComputedStyle(l).zIndex);
|
|
1158
1158
|
}, [l]);
|
|
1159
|
-
const j =
|
|
1159
|
+
const j = a.useCallback(
|
|
1160
1160
|
(E) => {
|
|
1161
1161
|
E && w.current === !0 && (I(), y?.(), w.current = !1);
|
|
1162
1162
|
},
|
|
@@ -1200,25 +1200,25 @@ var To = "SelectItemAlignedPosition", Rn = s.forwardRef((e, t) => {
|
|
|
1200
1200
|
);
|
|
1201
1201
|
});
|
|
1202
1202
|
Rn.displayName = To;
|
|
1203
|
-
var Do = "SelectPopperPosition", et =
|
|
1203
|
+
var Do = "SelectPopperPosition", et = a.forwardRef((e, t) => {
|
|
1204
1204
|
const {
|
|
1205
1205
|
__scopeSelect: n,
|
|
1206
1206
|
align: o = "start",
|
|
1207
1207
|
collisionPadding: r = ee,
|
|
1208
|
-
...
|
|
1208
|
+
...s
|
|
1209
1209
|
} = e, c = $e(n);
|
|
1210
1210
|
return /* @__PURE__ */ i.jsx(
|
|
1211
1211
|
Cr,
|
|
1212
1212
|
{
|
|
1213
1213
|
...c,
|
|
1214
|
-
...
|
|
1214
|
+
...s,
|
|
1215
1215
|
ref: t,
|
|
1216
1216
|
align: o,
|
|
1217
1217
|
collisionPadding: r,
|
|
1218
1218
|
style: {
|
|
1219
1219
|
// Ensure border-box for floating-ui calculations
|
|
1220
1220
|
boxSizing: "border-box",
|
|
1221
|
-
...
|
|
1221
|
+
...s.style,
|
|
1222
1222
|
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1223
1223
|
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
1224
1224
|
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -1229,9 +1229,9 @@ var Do = "SelectPopperPosition", et = s.forwardRef((e, t) => {
|
|
|
1229
1229
|
);
|
|
1230
1230
|
});
|
|
1231
1231
|
et.displayName = Do;
|
|
1232
|
-
var [Ao,
|
|
1232
|
+
var [Ao, ht] = Ce(me, {}), tt = "SelectViewport", Nn = a.forwardRef(
|
|
1233
1233
|
(e, t) => {
|
|
1234
|
-
const { __scopeSelect: n, nonce: o, ...r } = e,
|
|
1234
|
+
const { __scopeSelect: n, nonce: o, ...r } = e, s = le(tt, n), c = ht(tt, n), d = V(t, s.onViewportChange), u = a.useRef(0);
|
|
1235
1235
|
return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
1236
1236
|
/* @__PURE__ */ i.jsx(
|
|
1237
1237
|
"style",
|
|
@@ -1242,7 +1242,7 @@ var [Ao, vt] = Ce(me, {}), tt = "SelectViewport", Nn = s.forwardRef(
|
|
|
1242
1242
|
nonce: o
|
|
1243
1243
|
}
|
|
1244
1244
|
),
|
|
1245
|
-
/* @__PURE__ */ i.jsx(
|
|
1245
|
+
/* @__PURE__ */ i.jsx(Fe.Slot, { scope: n, children: /* @__PURE__ */ i.jsx(
|
|
1246
1246
|
k.div,
|
|
1247
1247
|
{
|
|
1248
1248
|
"data-radix-select-viewport": "",
|
|
@@ -1262,12 +1262,12 @@ var [Ao, vt] = Ce(me, {}), tt = "SelectViewport", Nn = s.forwardRef(
|
|
|
1262
1262
|
overflow: "hidden auto",
|
|
1263
1263
|
...r.style
|
|
1264
1264
|
},
|
|
1265
|
-
onScroll:
|
|
1265
|
+
onScroll: L(r.onScroll, (l) => {
|
|
1266
1266
|
const f = l.currentTarget, { contentWrapper: m, shouldExpandOnScrollRef: g } = c;
|
|
1267
1267
|
if (g?.current && m) {
|
|
1268
1268
|
const x = Math.abs(u.current - f.scrollTop);
|
|
1269
1269
|
if (x > 0) {
|
|
1270
|
-
const w = window.innerHeight - ee * 2,
|
|
1270
|
+
const w = window.innerHeight - ee * 2, h = parseFloat(m.style.minHeight), v = parseFloat(m.style.height), S = Math.max(h, v);
|
|
1271
1271
|
if (S < w) {
|
|
1272
1272
|
const y = S + x, I = Math.min(w, y), A = y - I;
|
|
1273
1273
|
m.style.height = I + "px", m.style.bottom === "0px" && (f.scrollTop = A > 0 ? A : 0, m.style.justifyContent = "flex-end");
|
|
@@ -1282,32 +1282,32 @@ var [Ao, vt] = Ce(me, {}), tt = "SelectViewport", Nn = s.forwardRef(
|
|
|
1282
1282
|
}
|
|
1283
1283
|
);
|
|
1284
1284
|
Nn.displayName = tt;
|
|
1285
|
-
var kn = "SelectGroup", [Mo, Oo] = Ce(kn),
|
|
1285
|
+
var kn = "SelectGroup", [Mo, Oo] = Ce(kn), Lo = a.forwardRef(
|
|
1286
1286
|
(e, t) => {
|
|
1287
1287
|
const { __scopeSelect: n, ...o } = e, r = Z();
|
|
1288
1288
|
return /* @__PURE__ */ i.jsx(Mo, { scope: n, id: r, children: /* @__PURE__ */ i.jsx(k.div, { role: "group", "aria-labelledby": r, ...o, ref: t }) });
|
|
1289
1289
|
}
|
|
1290
1290
|
);
|
|
1291
|
-
|
|
1292
|
-
var jn = "SelectLabel",
|
|
1291
|
+
Lo.displayName = kn;
|
|
1292
|
+
var jn = "SelectLabel", Fo = a.forwardRef(
|
|
1293
1293
|
(e, t) => {
|
|
1294
1294
|
const { __scopeSelect: n, ...o } = e, r = Oo(jn, n);
|
|
1295
1295
|
return /* @__PURE__ */ i.jsx(k.div, { id: r.id, ...o, ref: t });
|
|
1296
1296
|
}
|
|
1297
1297
|
);
|
|
1298
|
-
|
|
1299
|
-
var Te = "SelectItem", [Bo, Pn] = Ce(Te), _n =
|
|
1298
|
+
Fo.displayName = jn;
|
|
1299
|
+
var Te = "SelectItem", [Bo, Pn] = Ce(Te), _n = a.forwardRef(
|
|
1300
1300
|
(e, t) => {
|
|
1301
1301
|
const {
|
|
1302
1302
|
__scopeSelect: n,
|
|
1303
1303
|
value: o,
|
|
1304
1304
|
disabled: r = !1,
|
|
1305
|
-
textValue:
|
|
1305
|
+
textValue: s,
|
|
1306
1306
|
...c
|
|
1307
|
-
} = e, d = ce(Te, n), u = le(Te, n), l = d.value === o, [f, m] =
|
|
1307
|
+
} = e, d = ce(Te, n), u = le(Te, n), l = d.value === o, [f, m] = a.useState(s ?? ""), [g, x] = a.useState(!1), w = V(
|
|
1308
1308
|
t,
|
|
1309
1309
|
(y) => u.itemRefCallback?.(y, o, r)
|
|
1310
|
-
),
|
|
1310
|
+
), h = Z(), v = a.useRef("touch"), S = () => {
|
|
1311
1311
|
r || (d.onValueChange(o), d.onOpenChange(!1));
|
|
1312
1312
|
};
|
|
1313
1313
|
if (o === "")
|
|
@@ -1320,13 +1320,13 @@ var Te = "SelectItem", [Bo, Pn] = Ce(Te), _n = s.forwardRef(
|
|
|
1320
1320
|
scope: n,
|
|
1321
1321
|
value: o,
|
|
1322
1322
|
disabled: r,
|
|
1323
|
-
textId:
|
|
1323
|
+
textId: h,
|
|
1324
1324
|
isSelected: l,
|
|
1325
|
-
onItemTextChange:
|
|
1325
|
+
onItemTextChange: a.useCallback((y) => {
|
|
1326
1326
|
m((I) => I || (y?.textContent ?? "").trim());
|
|
1327
1327
|
}, []),
|
|
1328
1328
|
children: /* @__PURE__ */ i.jsx(
|
|
1329
|
-
|
|
1329
|
+
Fe.ItemSlot,
|
|
1330
1330
|
{
|
|
1331
1331
|
scope: n,
|
|
1332
1332
|
value: o,
|
|
@@ -1336,7 +1336,7 @@ var Te = "SelectItem", [Bo, Pn] = Ce(Te), _n = s.forwardRef(
|
|
|
1336
1336
|
k.div,
|
|
1337
1337
|
{
|
|
1338
1338
|
role: "option",
|
|
1339
|
-
"aria-labelledby":
|
|
1339
|
+
"aria-labelledby": h,
|
|
1340
1340
|
"data-highlighted": g ? "" : void 0,
|
|
1341
1341
|
"aria-selected": l && g,
|
|
1342
1342
|
"data-state": l ? "checked" : "unchecked",
|
|
@@ -1345,24 +1345,24 @@ var Te = "SelectItem", [Bo, Pn] = Ce(Te), _n = s.forwardRef(
|
|
|
1345
1345
|
tabIndex: r ? void 0 : -1,
|
|
1346
1346
|
...c,
|
|
1347
1347
|
ref: w,
|
|
1348
|
-
onFocus:
|
|
1349
|
-
onBlur:
|
|
1350
|
-
onClick:
|
|
1351
|
-
|
|
1348
|
+
onFocus: L(c.onFocus, () => x(!0)),
|
|
1349
|
+
onBlur: L(c.onBlur, () => x(!1)),
|
|
1350
|
+
onClick: L(c.onClick, () => {
|
|
1351
|
+
v.current !== "mouse" && S();
|
|
1352
1352
|
}),
|
|
1353
|
-
onPointerUp:
|
|
1354
|
-
|
|
1353
|
+
onPointerUp: L(c.onPointerUp, () => {
|
|
1354
|
+
v.current === "mouse" && S();
|
|
1355
1355
|
}),
|
|
1356
|
-
onPointerDown:
|
|
1357
|
-
|
|
1356
|
+
onPointerDown: L(c.onPointerDown, (y) => {
|
|
1357
|
+
v.current = y.pointerType;
|
|
1358
1358
|
}),
|
|
1359
|
-
onPointerMove:
|
|
1360
|
-
|
|
1359
|
+
onPointerMove: L(c.onPointerMove, (y) => {
|
|
1360
|
+
v.current = y.pointerType, r ? u.onItemLeave?.() : v.current === "mouse" && y.currentTarget.focus({ preventScroll: !0 });
|
|
1361
1361
|
}),
|
|
1362
|
-
onPointerLeave:
|
|
1362
|
+
onPointerLeave: L(c.onPointerLeave, (y) => {
|
|
1363
1363
|
y.currentTarget === document.activeElement && u.onItemLeave?.();
|
|
1364
1364
|
}),
|
|
1365
|
-
onKeyDown:
|
|
1365
|
+
onKeyDown: L(c.onKeyDown, (y) => {
|
|
1366
1366
|
u.searchRef?.current !== "" && y.key === " " || (So.includes(y.key) && S(), y.key === " " && y.preventDefault());
|
|
1367
1367
|
})
|
|
1368
1368
|
}
|
|
@@ -1374,44 +1374,44 @@ var Te = "SelectItem", [Bo, Pn] = Ce(Te), _n = s.forwardRef(
|
|
|
1374
1374
|
}
|
|
1375
1375
|
);
|
|
1376
1376
|
_n.displayName = Te;
|
|
1377
|
-
var Re = "SelectItemText", Tn =
|
|
1377
|
+
var Re = "SelectItemText", Tn = a.forwardRef(
|
|
1378
1378
|
(e, t) => {
|
|
1379
|
-
const { __scopeSelect: n, className: o, style: r, ...
|
|
1379
|
+
const { __scopeSelect: n, className: o, style: r, ...s } = e, c = ce(Re, n), d = le(Re, n), u = Pn(Re, n), l = No(Re, n), [f, m] = a.useState(null), g = V(
|
|
1380
1380
|
t,
|
|
1381
1381
|
(S) => m(S),
|
|
1382
1382
|
u.onItemTextChange,
|
|
1383
1383
|
(S) => d.itemTextRefCallback?.(S, u.value, u.disabled)
|
|
1384
|
-
), x = f?.textContent, w =
|
|
1384
|
+
), x = f?.textContent, w = a.useMemo(
|
|
1385
1385
|
() => /* @__PURE__ */ i.jsx("option", { value: u.value, disabled: u.disabled, children: x }, u.value),
|
|
1386
1386
|
[u.disabled, u.value, x]
|
|
1387
|
-
), { onNativeOptionAdd:
|
|
1388
|
-
return ne(() => (
|
|
1389
|
-
/* @__PURE__ */ i.jsx(k.span, { id: u.textId, ...
|
|
1390
|
-
u.isSelected && c.valueNode && !c.valueNodeHasChildren ? Vt.createPortal(
|
|
1387
|
+
), { onNativeOptionAdd: h, onNativeOptionRemove: v } = l;
|
|
1388
|
+
return ne(() => (h(w), () => v(w)), [h, v, w]), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
1389
|
+
/* @__PURE__ */ i.jsx(k.span, { id: u.textId, ...s, ref: g }),
|
|
1390
|
+
u.isSelected && c.valueNode && !c.valueNodeHasChildren ? Vt.createPortal(s.children, c.valueNode) : null
|
|
1391
1391
|
] });
|
|
1392
1392
|
}
|
|
1393
1393
|
);
|
|
1394
1394
|
Tn.displayName = Re;
|
|
1395
|
-
var Dn = "SelectItemIndicator", An =
|
|
1395
|
+
var Dn = "SelectItemIndicator", An = a.forwardRef(
|
|
1396
1396
|
(e, t) => {
|
|
1397
1397
|
const { __scopeSelect: n, ...o } = e;
|
|
1398
1398
|
return Pn(Dn, n).isSelected ? /* @__PURE__ */ i.jsx(k.span, { "aria-hidden": !0, ...o, ref: t }) : null;
|
|
1399
1399
|
}
|
|
1400
1400
|
);
|
|
1401
1401
|
An.displayName = Dn;
|
|
1402
|
-
var nt = "SelectScrollUpButton", Mn =
|
|
1403
|
-
const n = le(nt, e.__scopeSelect), o =
|
|
1402
|
+
var nt = "SelectScrollUpButton", Mn = a.forwardRef((e, t) => {
|
|
1403
|
+
const n = le(nt, e.__scopeSelect), o = ht(nt, e.__scopeSelect), [r, s] = a.useState(!1), c = V(t, o.onScrollButtonChange);
|
|
1404
1404
|
return ne(() => {
|
|
1405
1405
|
if (n.viewport && n.isPositioned) {
|
|
1406
1406
|
let d = function() {
|
|
1407
1407
|
const l = u.scrollTop > 0;
|
|
1408
|
-
|
|
1408
|
+
s(l);
|
|
1409
1409
|
};
|
|
1410
1410
|
const u = n.viewport;
|
|
1411
1411
|
return d(), u.addEventListener("scroll", d), () => u.removeEventListener("scroll", d);
|
|
1412
1412
|
}
|
|
1413
1413
|
}, [n.viewport, n.isPositioned]), r ? /* @__PURE__ */ i.jsx(
|
|
1414
|
-
|
|
1414
|
+
Ln,
|
|
1415
1415
|
{
|
|
1416
1416
|
...e,
|
|
1417
1417
|
ref: c,
|
|
@@ -1423,19 +1423,19 @@ var nt = "SelectScrollUpButton", Mn = s.forwardRef((e, t) => {
|
|
|
1423
1423
|
) : null;
|
|
1424
1424
|
});
|
|
1425
1425
|
Mn.displayName = nt;
|
|
1426
|
-
var rt = "SelectScrollDownButton", On =
|
|
1427
|
-
const n = le(rt, e.__scopeSelect), o =
|
|
1426
|
+
var rt = "SelectScrollDownButton", On = a.forwardRef((e, t) => {
|
|
1427
|
+
const n = le(rt, e.__scopeSelect), o = ht(rt, e.__scopeSelect), [r, s] = a.useState(!1), c = V(t, o.onScrollButtonChange);
|
|
1428
1428
|
return ne(() => {
|
|
1429
1429
|
if (n.viewport && n.isPositioned) {
|
|
1430
1430
|
let d = function() {
|
|
1431
1431
|
const l = u.scrollHeight - u.clientHeight, f = Math.ceil(u.scrollTop) < l;
|
|
1432
|
-
|
|
1432
|
+
s(f);
|
|
1433
1433
|
};
|
|
1434
1434
|
const u = n.viewport;
|
|
1435
1435
|
return d(), u.addEventListener("scroll", d), () => u.removeEventListener("scroll", d);
|
|
1436
1436
|
}
|
|
1437
1437
|
}, [n.viewport, n.isPositioned]), r ? /* @__PURE__ */ i.jsx(
|
|
1438
|
-
|
|
1438
|
+
Ln,
|
|
1439
1439
|
{
|
|
1440
1440
|
...e,
|
|
1441
1441
|
ref: c,
|
|
@@ -1447,11 +1447,11 @@ var rt = "SelectScrollDownButton", On = s.forwardRef((e, t) => {
|
|
|
1447
1447
|
) : null;
|
|
1448
1448
|
});
|
|
1449
1449
|
On.displayName = rt;
|
|
1450
|
-
var
|
|
1451
|
-
const { __scopeSelect: n, onAutoScroll: o, ...r } = e,
|
|
1450
|
+
var Ln = a.forwardRef((e, t) => {
|
|
1451
|
+
const { __scopeSelect: n, onAutoScroll: o, ...r } = e, s = le("SelectScrollButton", n), c = a.useRef(null), d = Be(n), u = a.useCallback(() => {
|
|
1452
1452
|
c.current !== null && (window.clearInterval(c.current), c.current = null);
|
|
1453
1453
|
}, []);
|
|
1454
|
-
return
|
|
1454
|
+
return a.useEffect(() => () => u(), [u]), ne(() => {
|
|
1455
1455
|
d().find((f) => f.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
1456
1456
|
}, [d]), /* @__PURE__ */ i.jsx(
|
|
1457
1457
|
k.div,
|
|
@@ -1460,35 +1460,35 @@ var Fn = s.forwardRef((e, t) => {
|
|
|
1460
1460
|
...r,
|
|
1461
1461
|
ref: t,
|
|
1462
1462
|
style: { flexShrink: 0, ...r.style },
|
|
1463
|
-
onPointerDown:
|
|
1463
|
+
onPointerDown: L(r.onPointerDown, () => {
|
|
1464
1464
|
c.current === null && (c.current = window.setInterval(o, 50));
|
|
1465
1465
|
}),
|
|
1466
|
-
onPointerMove:
|
|
1467
|
-
|
|
1466
|
+
onPointerMove: L(r.onPointerMove, () => {
|
|
1467
|
+
s.onItemLeave?.(), c.current === null && (c.current = window.setInterval(o, 50));
|
|
1468
1468
|
}),
|
|
1469
|
-
onPointerLeave:
|
|
1469
|
+
onPointerLeave: L(r.onPointerLeave, () => {
|
|
1470
1470
|
u();
|
|
1471
1471
|
})
|
|
1472
1472
|
}
|
|
1473
1473
|
);
|
|
1474
|
-
}), $o = "SelectSeparator", Vo =
|
|
1474
|
+
}), $o = "SelectSeparator", Vo = a.forwardRef(
|
|
1475
1475
|
(e, t) => {
|
|
1476
1476
|
const { __scopeSelect: n, ...o } = e;
|
|
1477
1477
|
return /* @__PURE__ */ i.jsx(k.div, { "aria-hidden": !0, ...o, ref: t });
|
|
1478
1478
|
}
|
|
1479
1479
|
);
|
|
1480
1480
|
Vo.displayName = $o;
|
|
1481
|
-
var ot = "SelectArrow", Uo =
|
|
1481
|
+
var ot = "SelectArrow", Uo = a.forwardRef(
|
|
1482
1482
|
(e, t) => {
|
|
1483
|
-
const { __scopeSelect: n, ...o } = e, r = $e(n),
|
|
1484
|
-
return
|
|
1483
|
+
const { __scopeSelect: n, ...o } = e, r = $e(n), s = ce(ot, n), c = le(ot, n);
|
|
1484
|
+
return s.open && c.position === "popper" ? /* @__PURE__ */ i.jsx(Sr, { ...r, ...o, ref: t }) : null;
|
|
1485
1485
|
}
|
|
1486
1486
|
);
|
|
1487
1487
|
Uo.displayName = ot;
|
|
1488
|
-
var Go = "SelectBubbleInput",
|
|
1488
|
+
var Go = "SelectBubbleInput", Fn = a.forwardRef(
|
|
1489
1489
|
({ __scopeSelect: e, value: t, ...n }, o) => {
|
|
1490
|
-
const r =
|
|
1491
|
-
return
|
|
1490
|
+
const r = a.useRef(null), s = V(o, r), c = ft(t);
|
|
1491
|
+
return a.useEffect(() => {
|
|
1492
1492
|
const d = r.current;
|
|
1493
1493
|
if (!d) return;
|
|
1494
1494
|
const u = window.HTMLSelectElement.prototype, f = Object.getOwnPropertyDescriptor(
|
|
@@ -1504,18 +1504,18 @@ var Go = "SelectBubbleInput", Ln = s.forwardRef(
|
|
|
1504
1504
|
{
|
|
1505
1505
|
...n,
|
|
1506
1506
|
style: { ...br, ...n.style },
|
|
1507
|
-
ref:
|
|
1507
|
+
ref: s,
|
|
1508
1508
|
defaultValue: t
|
|
1509
1509
|
}
|
|
1510
1510
|
);
|
|
1511
1511
|
}
|
|
1512
1512
|
);
|
|
1513
|
-
|
|
1513
|
+
Fn.displayName = Go;
|
|
1514
1514
|
function Bn(e) {
|
|
1515
1515
|
return e === "" || e === void 0;
|
|
1516
1516
|
}
|
|
1517
1517
|
function $n(e) {
|
|
1518
|
-
const t = Me(e), n =
|
|
1518
|
+
const t = Me(e), n = a.useRef(""), o = a.useRef(0), r = a.useCallback(
|
|
1519
1519
|
(c) => {
|
|
1520
1520
|
const d = n.current + c;
|
|
1521
1521
|
t(d), function u(l) {
|
|
@@ -1523,14 +1523,14 @@ function $n(e) {
|
|
|
1523
1523
|
}(d);
|
|
1524
1524
|
},
|
|
1525
1525
|
[t]
|
|
1526
|
-
),
|
|
1526
|
+
), s = a.useCallback(() => {
|
|
1527
1527
|
n.current = "", window.clearTimeout(o.current);
|
|
1528
1528
|
}, []);
|
|
1529
|
-
return
|
|
1529
|
+
return a.useEffect(() => () => window.clearTimeout(o.current), []), [n, r, s];
|
|
1530
1530
|
}
|
|
1531
1531
|
function Vn(e, t, n) {
|
|
1532
|
-
const r = t.length > 1 && Array.from(t).every((l) => l === t[0]) ? t[0] : t,
|
|
1533
|
-
let c = Wo(e, Math.max(
|
|
1532
|
+
const r = t.length > 1 && Array.from(t).every((l) => l === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
|
|
1533
|
+
let c = Wo(e, Math.max(s, 0));
|
|
1534
1534
|
r.length === 1 && (c = c.filter((l) => l !== n));
|
|
1535
1535
|
const u = c.find(
|
|
1536
1536
|
(l) => l.textValue.toLowerCase().startsWith(r.toLowerCase())
|
|
@@ -1540,8 +1540,8 @@ function Vn(e, t, n) {
|
|
|
1540
1540
|
function Wo(e, t) {
|
|
1541
1541
|
return e.map((n, o) => e[(t + o) % e.length]);
|
|
1542
1542
|
}
|
|
1543
|
-
var Ho =
|
|
1544
|
-
const
|
|
1543
|
+
var Ho = vn, Ko = xn, zo = yn, qo = wn, Yo = Cn, Xo = Sn, Zo = Nn, Jo = _n, Qo = Tn, es = An, ts = Mn, ns = On;
|
|
1544
|
+
const _a = ({ disabled: e = !1, handleDelete: t, ...n }) => /* @__PURE__ */ i.jsx(
|
|
1545
1545
|
ct,
|
|
1546
1546
|
{
|
|
1547
1547
|
disabled: e,
|
|
@@ -1553,31 +1553,34 @@ const Ta = ({ disabled: e = !1, handleDelete: t, ...n }) => /* @__PURE__ */ i.js
|
|
|
1553
1553
|
children: "Delete"
|
|
1554
1554
|
}
|
|
1555
1555
|
), wt = {
|
|
1556
|
-
default: { label: "Submit", submittingLabel: "Submitting", IconComponent:
|
|
1557
|
-
submit: { label: "Submit", submittingLabel: "Submitting", IconComponent:
|
|
1556
|
+
default: { label: "Submit", submittingLabel: "Submitting", IconComponent: ze },
|
|
1557
|
+
submit: { label: "Submit", submittingLabel: "Submitting", IconComponent: ze },
|
|
1558
1558
|
save: { label: "Save", submittingLabel: "Saving", IconComponent: Br },
|
|
1559
|
-
send: { label: "Send", submittingLabel: "Sending", IconComponent:
|
|
1560
|
-
},
|
|
1559
|
+
send: { label: "Send", submittingLabel: "Sending", IconComponent: ze }
|
|
1560
|
+
}, Ta = ({
|
|
1561
1561
|
submitting: e = !1,
|
|
1562
1562
|
disabled: t = !1,
|
|
1563
1563
|
submittingIcon: n,
|
|
1564
1564
|
action: o = "default",
|
|
1565
|
-
|
|
1566
|
-
|
|
1565
|
+
label: r,
|
|
1566
|
+
submittingLabel: s,
|
|
1567
|
+
icon: c,
|
|
1568
|
+
noIcon: d = !1,
|
|
1569
|
+
...u
|
|
1567
1570
|
}) => {
|
|
1568
|
-
const
|
|
1571
|
+
const l = n || Lr;
|
|
1569
1572
|
if (!wt[o])
|
|
1570
1573
|
throw new Error(`Invalid action: ${o}`);
|
|
1571
|
-
const
|
|
1574
|
+
const f = wt[o], m = r || f.label, g = s || f.submittingLabel, x = c || f.IconComponent, w = e ? /* @__PURE__ */ i.jsx(l, { className: "animate-spin" }) : /* @__PURE__ */ i.jsx(x, {});
|
|
1572
1575
|
return /* @__PURE__ */ i.jsx(
|
|
1573
1576
|
ct,
|
|
1574
1577
|
{
|
|
1575
1578
|
disabled: t || e,
|
|
1576
|
-
icon:
|
|
1579
|
+
icon: d ? void 0 : w,
|
|
1577
1580
|
type: "submit",
|
|
1578
1581
|
variant: "primary",
|
|
1579
|
-
...
|
|
1580
|
-
children: e ?
|
|
1582
|
+
...u,
|
|
1583
|
+
children: e ? g : m
|
|
1581
1584
|
}
|
|
1582
1585
|
);
|
|
1583
1586
|
};
|
|
@@ -1592,7 +1595,7 @@ function rs({ className: e, ...t }) {
|
|
|
1592
1595
|
"data-slot": "checkbox",
|
|
1593
1596
|
...t,
|
|
1594
1597
|
children: /* @__PURE__ */ i.jsx(
|
|
1595
|
-
|
|
1598
|
+
Kt,
|
|
1596
1599
|
{
|
|
1597
1600
|
className: "flex items-center justify-center text-current transition-none",
|
|
1598
1601
|
"data-slot": "checkbox-indicator",
|
|
@@ -1602,8 +1605,8 @@ function rs({ className: e, ...t }) {
|
|
|
1602
1605
|
}
|
|
1603
1606
|
);
|
|
1604
1607
|
}
|
|
1605
|
-
const
|
|
1606
|
-
const [
|
|
1608
|
+
const Da = ({ label: e, name: t, value: n, checked: o, onCheckedChange: r }) => {
|
|
1609
|
+
const [s, c] = lt(o);
|
|
1607
1610
|
mr(() => {
|
|
1608
1611
|
c(o);
|
|
1609
1612
|
}, [o]);
|
|
@@ -1617,7 +1620,7 @@ const Aa = ({ label: e, name: t, value: n, checked: o, onCheckedChange: r }) =>
|
|
|
1617
1620
|
/* @__PURE__ */ i.jsx(
|
|
1618
1621
|
rs,
|
|
1619
1622
|
{
|
|
1620
|
-
checked:
|
|
1623
|
+
checked: s,
|
|
1621
1624
|
id: d,
|
|
1622
1625
|
name: t,
|
|
1623
1626
|
onCheckedChange: l,
|
|
@@ -1626,36 +1629,44 @@ const Aa = ({ label: e, name: t, value: n, checked: o, onCheckedChange: r }) =>
|
|
|
1626
1629
|
),
|
|
1627
1630
|
/* @__PURE__ */ i.jsx(Se, { className: "cursor-pointer", htmlFor: d, children: e })
|
|
1628
1631
|
] });
|
|
1629
|
-
},
|
|
1632
|
+
}, Aa = ({ name: e, label: t, placeholder: n, note: o, className: r, size: s = "md", ...c }) => /* @__PURE__ */ i.jsx(
|
|
1630
1633
|
Un,
|
|
1631
1634
|
{
|
|
1632
|
-
className: $(
|
|
1635
|
+
className: $(
|
|
1636
|
+
s === "xs" && "max-w-[140px] md:max-w-[135px]",
|
|
1637
|
+
s === "sm" && "max-w-[150px] md:max-w-[140px]",
|
|
1638
|
+
s === "md" && "max-w-[170px] md:max-w-[150px]",
|
|
1639
|
+
s === "lg" && "max-w-[180px] md:max-w-[170px]",
|
|
1640
|
+
s === "xl" && "max-w-[200px]",
|
|
1641
|
+
r
|
|
1642
|
+
),
|
|
1633
1643
|
label: t,
|
|
1634
1644
|
name: e,
|
|
1635
1645
|
note: o,
|
|
1636
1646
|
placeholder: n,
|
|
1647
|
+
size: s,
|
|
1637
1648
|
type: "date",
|
|
1638
|
-
...
|
|
1649
|
+
...c
|
|
1639
1650
|
}
|
|
1640
|
-
),
|
|
1641
|
-
const [
|
|
1651
|
+
), Ma = ({ onDateSelection: e, initialValue: t, className: n, size: o = "default", error: r }) => {
|
|
1652
|
+
const [s, c] = lt(t), d = (u) => {
|
|
1642
1653
|
c(u), u && e(u);
|
|
1643
1654
|
};
|
|
1644
1655
|
return /* @__PURE__ */ i.jsxs(ae, { direction: "col", gap: "2", children: [
|
|
1645
|
-
/* @__PURE__ */ i.jsxs(
|
|
1646
|
-
/* @__PURE__ */ i.jsx(
|
|
1656
|
+
/* @__PURE__ */ i.jsxs(Lt, { children: [
|
|
1657
|
+
/* @__PURE__ */ i.jsx(Ft, { asChild: !0, children: /* @__PURE__ */ i.jsxs(
|
|
1647
1658
|
ct,
|
|
1648
1659
|
{
|
|
1649
|
-
className: $("w-[280px] justify-start text-left font-normal", !
|
|
1660
|
+
className: $("w-[280px] justify-start text-left font-normal", !s && "text-muted-foreground", n),
|
|
1650
1661
|
size: o,
|
|
1651
1662
|
variant: "outline",
|
|
1652
1663
|
children: [
|
|
1653
1664
|
/* @__PURE__ */ i.jsx(kr, { className: "mr-2 h-4 w-4" }),
|
|
1654
|
-
|
|
1665
|
+
s ? s.toISOString().split("T")[0] : /* @__PURE__ */ i.jsx("span", { children: "Select a date" })
|
|
1655
1666
|
]
|
|
1656
1667
|
}
|
|
1657
1668
|
) }),
|
|
1658
|
-
/* @__PURE__ */ i.jsx(Bt, { className: "w-auto p-0", children: /* @__PURE__ */ i.jsx(fr, { autoFocus: !0, mode: "single", onSelect: d, selected:
|
|
1669
|
+
/* @__PURE__ */ i.jsx(Bt, { className: "w-auto p-0", children: /* @__PURE__ */ i.jsx(fr, { autoFocus: !0, mode: "single", onSelect: d, selected: s }) })
|
|
1659
1670
|
] }),
|
|
1660
1671
|
r && /* @__PURE__ */ i.jsx(je, { message: r })
|
|
1661
1672
|
] });
|
|
@@ -1684,62 +1695,63 @@ const Se = ({ htmlFor: e, value: t, children: n, className: o = "", ...r }) => /
|
|
|
1684
1695
|
...r,
|
|
1685
1696
|
children: t || n
|
|
1686
1697
|
}
|
|
1687
|
-
)
|
|
1688
|
-
function as({ className: e, type: t, ...n }) {
|
|
1689
|
-
return /* @__PURE__ */ i.jsx(
|
|
1690
|
-
"input",
|
|
1691
|
-
{
|
|
1692
|
-
className: $(
|
|
1693
|
-
"flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
|
|
1694
|
-
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
1695
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
1696
|
-
e
|
|
1697
|
-
),
|
|
1698
|
-
"data-slot": "input",
|
|
1699
|
-
type: t,
|
|
1700
|
-
...n
|
|
1701
|
-
}
|
|
1702
|
-
);
|
|
1703
|
-
}
|
|
1704
|
-
const Un = ({
|
|
1698
|
+
), Un = ({
|
|
1705
1699
|
name: e,
|
|
1706
1700
|
type: t = "text",
|
|
1707
1701
|
placeholder: n,
|
|
1708
1702
|
label: o,
|
|
1709
1703
|
labelOrientation: r = "top",
|
|
1710
|
-
note:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1704
|
+
note: s,
|
|
1705
|
+
size: c = "md",
|
|
1706
|
+
className: d,
|
|
1707
|
+
error: u,
|
|
1708
|
+
...l
|
|
1709
|
+
}) => {
|
|
1710
|
+
const f = $(
|
|
1711
|
+
"flex w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 shadow-xs outline-none",
|
|
1712
|
+
"transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex ",
|
|
1713
|
+
"file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm",
|
|
1714
|
+
"placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
1715
|
+
"dark:bg-input/30 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
1716
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
|
|
1717
|
+
c === "xs" && "h-7 text-xs md:text-xs",
|
|
1718
|
+
c === "sm" && "h-8 text-sm md:text-xs",
|
|
1719
|
+
c === "md" && "h-9 text-base md:text-sm",
|
|
1720
|
+
c === "lg" && "h-10 text-lg md:text-base",
|
|
1721
|
+
c === "xl" && "h-11 text-xl md:text-lg",
|
|
1722
|
+
d
|
|
1723
|
+
);
|
|
1724
|
+
return /* @__PURE__ */ i.jsxs(ae, { className: "w-full", direction: r === "left" ? "row" : "col", gap: "2", children: [
|
|
1725
|
+
o && /* @__PURE__ */ i.jsx(Se, { className: r === "left" ? "text-nowrap" : "", htmlFor: e, children: o }),
|
|
1726
|
+
/* @__PURE__ */ i.jsx(
|
|
1727
|
+
"input",
|
|
1728
|
+
{
|
|
1729
|
+
"aria-label": o || e,
|
|
1730
|
+
className: f,
|
|
1731
|
+
"data-slot": "input",
|
|
1732
|
+
id: e,
|
|
1733
|
+
name: e,
|
|
1734
|
+
placeholder: n,
|
|
1735
|
+
type: t,
|
|
1736
|
+
...l
|
|
1737
|
+
}
|
|
1738
|
+
),
|
|
1739
|
+
s && /* @__PURE__ */ i.jsx(Ae, { size: "sm", variant: "muted", children: s }),
|
|
1740
|
+
u && /* @__PURE__ */ i.jsx(je, { message: u })
|
|
1741
|
+
] });
|
|
1742
|
+
}, Oa = ({
|
|
1731
1743
|
name: e,
|
|
1732
1744
|
label: t,
|
|
1733
1745
|
placeholder: n,
|
|
1734
1746
|
note: o,
|
|
1735
1747
|
// Default to two decimal places for currency and general decimal values
|
|
1736
1748
|
step: r = ".01",
|
|
1737
|
-
className:
|
|
1749
|
+
className: s,
|
|
1738
1750
|
...c
|
|
1739
1751
|
}) => /* @__PURE__ */ i.jsx(
|
|
1740
1752
|
Un,
|
|
1741
1753
|
{
|
|
1742
|
-
className:
|
|
1754
|
+
className: s,
|
|
1743
1755
|
label: t,
|
|
1744
1756
|
name: e,
|
|
1745
1757
|
note: o,
|
|
@@ -1749,10 +1761,10 @@ const Un = ({
|
|
|
1749
1761
|
...c
|
|
1750
1762
|
}
|
|
1751
1763
|
);
|
|
1752
|
-
function
|
|
1764
|
+
function as({ className: e, ...t }) {
|
|
1753
1765
|
return /* @__PURE__ */ i.jsx(bo, { className: $("grid gap-3", e), "data-slot": "radio-group", ...t });
|
|
1754
1766
|
}
|
|
1755
|
-
function
|
|
1767
|
+
function is({ className: e, ...t }) {
|
|
1756
1768
|
return /* @__PURE__ */ i.jsx(
|
|
1757
1769
|
yo,
|
|
1758
1770
|
{
|
|
@@ -1773,27 +1785,27 @@ function cs({ className: e, ...t }) {
|
|
|
1773
1785
|
}
|
|
1774
1786
|
);
|
|
1775
1787
|
}
|
|
1776
|
-
const La = ({ label: e, name: t, options: n, value: o, onChange: r, error:
|
|
1777
|
-
/* @__PURE__ */ i.jsx(
|
|
1778
|
-
/* @__PURE__ */ i.jsx(
|
|
1788
|
+
const La = ({ label: e, name: t, options: n, value: o, onChange: r, error: s }) => /* @__PURE__ */ i.jsxs(os, { className: "flex flex-col gap-4 px-2 py-1", label: e, labelFor: t, children: [
|
|
1789
|
+
/* @__PURE__ */ i.jsx(as, { className: "w-full", name: t, onValueChange: r, value: o, children: /* @__PURE__ */ i.jsx(vr, { cols: "2", children: n.map((c, d) => /* @__PURE__ */ i.jsxs(ae, { align: "center", gap: "2", justify: "start", children: [
|
|
1790
|
+
/* @__PURE__ */ i.jsx(is, { id: c.value, value: c.value }),
|
|
1779
1791
|
/* @__PURE__ */ i.jsx(Se, { htmlFor: c.value, children: c.label })
|
|
1780
1792
|
] }, d)) }) }),
|
|
1781
|
-
|
|
1793
|
+
s && /* @__PURE__ */ i.jsx(je, { message: s })
|
|
1782
1794
|
] });
|
|
1783
|
-
function
|
|
1795
|
+
function cs({ ...e }) {
|
|
1784
1796
|
return /* @__PURE__ */ i.jsx(Ho, { "data-slot": "select", ...e });
|
|
1785
1797
|
}
|
|
1786
|
-
function
|
|
1787
|
-
return /* @__PURE__ */ i.jsx(
|
|
1798
|
+
function ls({ ...e }) {
|
|
1799
|
+
return /* @__PURE__ */ i.jsx(zo, { "data-slot": "select-value", ...e });
|
|
1788
1800
|
}
|
|
1789
|
-
function
|
|
1801
|
+
function ds({
|
|
1790
1802
|
className: e,
|
|
1791
1803
|
size: t = "default",
|
|
1792
1804
|
children: n,
|
|
1793
1805
|
...o
|
|
1794
1806
|
}) {
|
|
1795
1807
|
return /* @__PURE__ */ i.jsxs(
|
|
1796
|
-
|
|
1808
|
+
Ko,
|
|
1797
1809
|
{
|
|
1798
1810
|
className: $(
|
|
1799
1811
|
"flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
@@ -1809,7 +1821,7 @@ function us({
|
|
|
1809
1821
|
}
|
|
1810
1822
|
);
|
|
1811
1823
|
}
|
|
1812
|
-
function
|
|
1824
|
+
function us({
|
|
1813
1825
|
className: e,
|
|
1814
1826
|
children: t,
|
|
1815
1827
|
position: n = "popper",
|
|
@@ -1827,7 +1839,7 @@ function fs({
|
|
|
1827
1839
|
position: n,
|
|
1828
1840
|
...o,
|
|
1829
1841
|
children: [
|
|
1830
|
-
/* @__PURE__ */ i.jsx(
|
|
1842
|
+
/* @__PURE__ */ i.jsx(ps, {}),
|
|
1831
1843
|
/* @__PURE__ */ i.jsx(
|
|
1832
1844
|
Zo,
|
|
1833
1845
|
{
|
|
@@ -1838,12 +1850,12 @@ function fs({
|
|
|
1838
1850
|
children: t
|
|
1839
1851
|
}
|
|
1840
1852
|
),
|
|
1841
|
-
/* @__PURE__ */ i.jsx(
|
|
1853
|
+
/* @__PURE__ */ i.jsx(ms, {})
|
|
1842
1854
|
]
|
|
1843
1855
|
}
|
|
1844
1856
|
) });
|
|
1845
1857
|
}
|
|
1846
|
-
function
|
|
1858
|
+
function fs({ className: e, children: t, ...n }) {
|
|
1847
1859
|
return /* @__PURE__ */ i.jsxs(
|
|
1848
1860
|
Jo,
|
|
1849
1861
|
{
|
|
@@ -1860,7 +1872,7 @@ function ps({ className: e, children: t, ...n }) {
|
|
|
1860
1872
|
}
|
|
1861
1873
|
);
|
|
1862
1874
|
}
|
|
1863
|
-
function
|
|
1875
|
+
function ps({ className: e, ...t }) {
|
|
1864
1876
|
return /* @__PURE__ */ i.jsx(
|
|
1865
1877
|
ts,
|
|
1866
1878
|
{
|
|
@@ -1871,7 +1883,7 @@ function ms({ className: e, ...t }) {
|
|
|
1871
1883
|
}
|
|
1872
1884
|
);
|
|
1873
1885
|
}
|
|
1874
|
-
function
|
|
1886
|
+
function ms({
|
|
1875
1887
|
className: e,
|
|
1876
1888
|
...t
|
|
1877
1889
|
}) {
|
|
@@ -1885,13 +1897,13 @@ function vs({
|
|
|
1885
1897
|
}
|
|
1886
1898
|
);
|
|
1887
1899
|
}
|
|
1888
|
-
const
|
|
1900
|
+
const Fa = ({
|
|
1889
1901
|
name: e,
|
|
1890
1902
|
defaultValue: t,
|
|
1891
1903
|
options: n,
|
|
1892
1904
|
label: o,
|
|
1893
1905
|
placeholder: r,
|
|
1894
|
-
note:
|
|
1906
|
+
note: s,
|
|
1895
1907
|
className: c,
|
|
1896
1908
|
value: d,
|
|
1897
1909
|
onValueChange: u,
|
|
@@ -1900,7 +1912,7 @@ const Ba = ({
|
|
|
1900
1912
|
}) => /* @__PURE__ */ i.jsxs(ae, { className: "w-full", direction: "col", gap: "2", children: [
|
|
1901
1913
|
o && /* @__PURE__ */ i.jsx(Se, { htmlFor: e, children: o }),
|
|
1902
1914
|
/* @__PURE__ */ i.jsxs(
|
|
1903
|
-
|
|
1915
|
+
cs,
|
|
1904
1916
|
{
|
|
1905
1917
|
defaultValue: t,
|
|
1906
1918
|
name: e,
|
|
@@ -1908,26 +1920,26 @@ const Ba = ({
|
|
|
1908
1920
|
value: d,
|
|
1909
1921
|
...f,
|
|
1910
1922
|
children: [
|
|
1911
|
-
/* @__PURE__ */ i.jsx(
|
|
1912
|
-
/* @__PURE__ */ i.jsx(
|
|
1923
|
+
/* @__PURE__ */ i.jsx(ds, { className: $("min-w-[180px]", c), "data-testid": `select-input-${e}`, children: /* @__PURE__ */ i.jsx(ls, { placeholder: r }) }),
|
|
1924
|
+
/* @__PURE__ */ i.jsx(us, { children: n.map(({ value: m, label: g }) => /* @__PURE__ */ i.jsx(fs, { value: m, children: g }, `option-${m}`)) })
|
|
1913
1925
|
]
|
|
1914
1926
|
}
|
|
1915
1927
|
),
|
|
1916
|
-
|
|
1928
|
+
s && /* @__PURE__ */ i.jsx(Ae, { size: "sm", variant: "muted", children: s }),
|
|
1917
1929
|
l && /* @__PURE__ */ i.jsx(je, { message: l })
|
|
1918
1930
|
] });
|
|
1919
|
-
var Ct = 1, hs = 0.9,
|
|
1920
|
-
function st(e, t, n, o, r,
|
|
1921
|
-
if (
|
|
1922
|
-
var d = `${r},${
|
|
1931
|
+
var Ct = 1, hs = 0.9, vs = 0.8, gs = 0.17, Ye = 0.1, Xe = 0.999, xs = 0.9999, bs = 0.99, ys = /[\\\/_+.#"@\[\(\{&]/, ws = /[\\\/_+.#"@\[\(\{&]/g, Cs = /[\s-]/, Gn = /[\s-]/g;
|
|
1932
|
+
function st(e, t, n, o, r, s, c) {
|
|
1933
|
+
if (s === t.length) return r === e.length ? Ct : bs;
|
|
1934
|
+
var d = `${r},${s}`;
|
|
1923
1935
|
if (c[d] !== void 0) return c[d];
|
|
1924
|
-
for (var u = o.charAt(
|
|
1936
|
+
for (var u = o.charAt(s), l = n.indexOf(u, r), f = 0, m, g, x, w; l >= 0; ) m = st(e, t, n, o, l + 1, s + 1, c), m > f && (l === r ? m *= Ct : ys.test(e.charAt(l - 1)) ? (m *= vs, x = e.slice(r, l - 1).match(ws), x && r > 0 && (m *= Math.pow(Xe, x.length))) : Cs.test(e.charAt(l - 1)) ? (m *= hs, w = e.slice(r, l - 1).match(Gn), w && r > 0 && (m *= Math.pow(Xe, w.length))) : (m *= gs, r > 0 && (m *= Math.pow(Xe, l - r))), e.charAt(l) !== t.charAt(s) && (m *= xs)), (m < Ye && n.charAt(l - 1) === o.charAt(s + 1) || o.charAt(s + 1) === o.charAt(s) && n.charAt(l - 1) !== o.charAt(s)) && (g = st(e, t, n, o, l + 1, s + 2, c), g * Ye > m && (m = g * Ye)), m > f && (f = m), l = n.indexOf(u, l + 1);
|
|
1925
1937
|
return c[d] = f, f;
|
|
1926
1938
|
}
|
|
1927
1939
|
function St(e) {
|
|
1928
1940
|
return e.toLowerCase().replace(Gn, " ");
|
|
1929
1941
|
}
|
|
1930
|
-
function
|
|
1942
|
+
function Ss(e, t, n) {
|
|
1931
1943
|
return e = n && n.length > 0 ? `${e + " " + n.join(" ")}` : e, st(e, t, St(e), St(t), 0, 0, {});
|
|
1932
1944
|
}
|
|
1933
1945
|
function se(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
@@ -1936,37 +1948,37 @@ function se(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
|
1936
1948
|
return t?.(r);
|
|
1937
1949
|
};
|
|
1938
1950
|
}
|
|
1939
|
-
var
|
|
1951
|
+
var Es = "DismissableLayer", at = "dismissableLayer.update", Is = "dismissableLayer.pointerDownOutside", Rs = "dismissableLayer.focusOutside", Et, Wn = a.createContext({
|
|
1940
1952
|
layers: /* @__PURE__ */ new Set(),
|
|
1941
1953
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
1942
1954
|
branches: /* @__PURE__ */ new Set()
|
|
1943
|
-
}), Hn =
|
|
1955
|
+
}), Hn = a.forwardRef(
|
|
1944
1956
|
(e, t) => {
|
|
1945
1957
|
const {
|
|
1946
1958
|
disableOutsidePointerEvents: n = !1,
|
|
1947
1959
|
onEscapeKeyDown: o,
|
|
1948
1960
|
onPointerDownOutside: r,
|
|
1949
|
-
onFocusOutside:
|
|
1961
|
+
onFocusOutside: s,
|
|
1950
1962
|
onInteractOutside: c,
|
|
1951
1963
|
onDismiss: d,
|
|
1952
1964
|
...u
|
|
1953
|
-
} = e, l =
|
|
1954
|
-
const P = E.target,
|
|
1955
|
-
!A ||
|
|
1956
|
-
}, g), j =
|
|
1965
|
+
} = e, l = a.useContext(Wn), [f, m] = a.useState(null), g = f?.ownerDocument ?? globalThis?.document, [, x] = a.useState({}), w = V(t, (E) => m(E)), h = Array.from(l.layers), [v] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), S = h.indexOf(v), y = f ? h.indexOf(f) : -1, I = l.layersWithOutsidePointerEventsDisabled.size > 0, A = y >= S, M = js((E) => {
|
|
1966
|
+
const P = E.target, z = [...l.branches].some((U) => U.contains(P));
|
|
1967
|
+
!A || z || (r?.(E), c?.(E), E.defaultPrevented || d?.());
|
|
1968
|
+
}, g), j = Ps((E) => {
|
|
1957
1969
|
const P = E.target;
|
|
1958
|
-
[...l.branches].some((U) => U.contains(P)) || (
|
|
1970
|
+
[...l.branches].some((U) => U.contains(P)) || (s?.(E), c?.(E), E.defaultPrevented || d?.());
|
|
1959
1971
|
}, g);
|
|
1960
1972
|
return Er((E) => {
|
|
1961
1973
|
y === l.layers.size - 1 && (o?.(E), !E.defaultPrevented && d && (E.preventDefault(), d()));
|
|
1962
|
-
}, g),
|
|
1974
|
+
}, g), a.useEffect(() => {
|
|
1963
1975
|
if (f)
|
|
1964
1976
|
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Et = g.body.style.pointerEvents, g.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(f)), l.layers.add(f), It(), () => {
|
|
1965
1977
|
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (g.body.style.pointerEvents = Et);
|
|
1966
1978
|
};
|
|
1967
|
-
}, [f, g, n, l]),
|
|
1979
|
+
}, [f, g, n, l]), a.useEffect(() => () => {
|
|
1968
1980
|
f && (l.layers.delete(f), l.layersWithOutsidePointerEventsDisabled.delete(f), It());
|
|
1969
|
-
}, [f, l]),
|
|
1981
|
+
}, [f, l]), a.useEffect(() => {
|
|
1970
1982
|
const E = () => x({});
|
|
1971
1983
|
return document.addEventListener(at, E), () => document.removeEventListener(at, E);
|
|
1972
1984
|
}, []), /* @__PURE__ */ i.jsx(
|
|
@@ -1988,27 +2000,27 @@ var Is = "DismissableLayer", at = "dismissableLayer.update", Rs = "dismissableLa
|
|
|
1988
2000
|
);
|
|
1989
2001
|
}
|
|
1990
2002
|
);
|
|
1991
|
-
Hn.displayName =
|
|
1992
|
-
var
|
|
1993
|
-
const n =
|
|
1994
|
-
return
|
|
1995
|
-
const
|
|
1996
|
-
if (
|
|
1997
|
-
return n.branches.add(
|
|
1998
|
-
n.branches.delete(
|
|
2003
|
+
Hn.displayName = Es;
|
|
2004
|
+
var Ns = "DismissableLayerBranch", ks = a.forwardRef((e, t) => {
|
|
2005
|
+
const n = a.useContext(Wn), o = a.useRef(null), r = V(t, o);
|
|
2006
|
+
return a.useEffect(() => {
|
|
2007
|
+
const s = o.current;
|
|
2008
|
+
if (s)
|
|
2009
|
+
return n.branches.add(s), () => {
|
|
2010
|
+
n.branches.delete(s);
|
|
1999
2011
|
};
|
|
2000
2012
|
}, [n.branches]), /* @__PURE__ */ i.jsx(k.div, { ...e, ref: r });
|
|
2001
2013
|
});
|
|
2002
|
-
|
|
2003
|
-
function
|
|
2004
|
-
const n = Me(e), o =
|
|
2014
|
+
ks.displayName = Ns;
|
|
2015
|
+
function js(e, t = globalThis?.document) {
|
|
2016
|
+
const n = Me(e), o = a.useRef(!1), r = a.useRef(() => {
|
|
2005
2017
|
});
|
|
2006
|
-
return
|
|
2007
|
-
const
|
|
2018
|
+
return a.useEffect(() => {
|
|
2019
|
+
const s = (d) => {
|
|
2008
2020
|
if (d.target && !o.current) {
|
|
2009
2021
|
let u = function() {
|
|
2010
|
-
|
|
2011
|
-
|
|
2022
|
+
Kn(
|
|
2023
|
+
Is,
|
|
2012
2024
|
n,
|
|
2013
2025
|
l,
|
|
2014
2026
|
{ discrete: !0 }
|
|
@@ -2020,21 +2032,21 @@ function Ps(e, t = globalThis?.document) {
|
|
|
2020
2032
|
t.removeEventListener("click", r.current);
|
|
2021
2033
|
o.current = !1;
|
|
2022
2034
|
}, c = window.setTimeout(() => {
|
|
2023
|
-
t.addEventListener("pointerdown",
|
|
2035
|
+
t.addEventListener("pointerdown", s);
|
|
2024
2036
|
}, 0);
|
|
2025
2037
|
return () => {
|
|
2026
|
-
window.clearTimeout(c), t.removeEventListener("pointerdown",
|
|
2038
|
+
window.clearTimeout(c), t.removeEventListener("pointerdown", s), t.removeEventListener("click", r.current);
|
|
2027
2039
|
};
|
|
2028
2040
|
}, [t, n]), {
|
|
2029
2041
|
// ensures we check React component tree (not just DOM tree)
|
|
2030
2042
|
onPointerDownCapture: () => o.current = !0
|
|
2031
2043
|
};
|
|
2032
2044
|
}
|
|
2033
|
-
function
|
|
2034
|
-
const n = Me(e), o =
|
|
2035
|
-
return
|
|
2036
|
-
const r = (
|
|
2037
|
-
|
|
2045
|
+
function Ps(e, t = globalThis?.document) {
|
|
2046
|
+
const n = Me(e), o = a.useRef(!1);
|
|
2047
|
+
return a.useEffect(() => {
|
|
2048
|
+
const r = (s) => {
|
|
2049
|
+
s.target && !o.current && Kn(Rs, n, { originalEvent: s }, {
|
|
2038
2050
|
discrete: !1
|
|
2039
2051
|
});
|
|
2040
2052
|
};
|
|
@@ -2048,20 +2060,20 @@ function It() {
|
|
|
2048
2060
|
const e = new CustomEvent(at);
|
|
2049
2061
|
document.dispatchEvent(e);
|
|
2050
2062
|
}
|
|
2051
|
-
function
|
|
2052
|
-
const r = n.originalEvent.target,
|
|
2053
|
-
t && r.addEventListener(e, t, { once: !0 }), o ? Ir(r,
|
|
2063
|
+
function Kn(e, t, n, { discrete: o }) {
|
|
2064
|
+
const r = n.originalEvent.target, s = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
2065
|
+
t && r.addEventListener(e, t, { once: !0 }), o ? Ir(r, s) : r.dispatchEvent(s);
|
|
2054
2066
|
}
|
|
2055
|
-
function
|
|
2056
|
-
return
|
|
2067
|
+
function _s(e, t) {
|
|
2068
|
+
return a.useReducer((n, o) => t[n][o] ?? n, e);
|
|
2057
2069
|
}
|
|
2058
2070
|
var Ve = (e) => {
|
|
2059
|
-
const { present: t, children: n } = e, o =
|
|
2060
|
-
return typeof n == "function" || o.isPresent ?
|
|
2071
|
+
const { present: t, children: n } = e, o = Ts(t), r = typeof n == "function" ? n({ present: o.isPresent }) : a.Children.only(n), s = V(o.ref, Ds(r));
|
|
2072
|
+
return typeof n == "function" || o.isPresent ? a.cloneElement(r, { ref: s }) : null;
|
|
2061
2073
|
};
|
|
2062
2074
|
Ve.displayName = "Presence";
|
|
2063
|
-
function
|
|
2064
|
-
const [t, n] =
|
|
2075
|
+
function Ts(e) {
|
|
2076
|
+
const [t, n] = a.useState(), o = a.useRef(null), r = a.useRef(e), s = a.useRef("none"), c = e ? "mounted" : "unmounted", [d, u] = _s(c, {
|
|
2065
2077
|
mounted: {
|
|
2066
2078
|
UNMOUNT: "unmounted",
|
|
2067
2079
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -2074,28 +2086,28 @@ function Ds(e) {
|
|
|
2074
2086
|
MOUNT: "mounted"
|
|
2075
2087
|
}
|
|
2076
2088
|
});
|
|
2077
|
-
return
|
|
2089
|
+
return a.useEffect(() => {
|
|
2078
2090
|
const l = _e(o.current);
|
|
2079
|
-
|
|
2091
|
+
s.current = d === "mounted" ? l : "none";
|
|
2080
2092
|
}, [d]), ne(() => {
|
|
2081
2093
|
const l = o.current, f = r.current;
|
|
2082
2094
|
if (f !== e) {
|
|
2083
|
-
const g =
|
|
2095
|
+
const g = s.current, x = _e(l);
|
|
2084
2096
|
e ? u("MOUNT") : x === "none" || l?.display === "none" ? u("UNMOUNT") : u(f && g !== x ? "ANIMATION_OUT" : "UNMOUNT"), r.current = e;
|
|
2085
2097
|
}
|
|
2086
2098
|
}, [e, u]), ne(() => {
|
|
2087
2099
|
if (t) {
|
|
2088
2100
|
let l;
|
|
2089
2101
|
const f = t.ownerDocument.defaultView ?? window, m = (x) => {
|
|
2090
|
-
const
|
|
2091
|
-
if (x.target === t &&
|
|
2092
|
-
const
|
|
2102
|
+
const h = _e(o.current).includes(x.animationName);
|
|
2103
|
+
if (x.target === t && h && (u("ANIMATION_END"), !r.current)) {
|
|
2104
|
+
const v = t.style.animationFillMode;
|
|
2093
2105
|
t.style.animationFillMode = "forwards", l = f.setTimeout(() => {
|
|
2094
|
-
t.style.animationFillMode === "forwards" && (t.style.animationFillMode =
|
|
2106
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
|
|
2095
2107
|
});
|
|
2096
2108
|
}
|
|
2097
2109
|
}, g = (x) => {
|
|
2098
|
-
x.target === t && (
|
|
2110
|
+
x.target === t && (s.current = _e(o.current));
|
|
2099
2111
|
};
|
|
2100
2112
|
return t.addEventListener("animationstart", g), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
|
|
2101
2113
|
f.clearTimeout(l), t.removeEventListener("animationstart", g), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
|
|
@@ -2104,7 +2116,7 @@ function Ds(e) {
|
|
|
2104
2116
|
u("ANIMATION_END");
|
|
2105
2117
|
}, [t, u]), {
|
|
2106
2118
|
isPresent: ["mounted", "unmountSuspended"].includes(d),
|
|
2107
|
-
ref:
|
|
2119
|
+
ref: a.useCallback((l) => {
|
|
2108
2120
|
o.current = l ? getComputedStyle(l) : null, n(l);
|
|
2109
2121
|
}, [])
|
|
2110
2122
|
};
|
|
@@ -2112,13 +2124,13 @@ function Ds(e) {
|
|
|
2112
2124
|
function _e(e) {
|
|
2113
2125
|
return e?.animationName || "none";
|
|
2114
2126
|
}
|
|
2115
|
-
function
|
|
2127
|
+
function Ds(e) {
|
|
2116
2128
|
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
2117
2129
|
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
2118
2130
|
}
|
|
2119
2131
|
var Ze = 0;
|
|
2120
|
-
function
|
|
2121
|
-
|
|
2132
|
+
function As() {
|
|
2133
|
+
a.useEffect(() => {
|
|
2122
2134
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
2123
2135
|
return document.body.insertAdjacentElement("afterbegin", e[0] ?? Rt()), document.body.insertAdjacentElement("beforeend", e[1] ?? Rt()), Ze++, () => {
|
|
2124
2136
|
Ze === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Ze--;
|
|
@@ -2129,22 +2141,22 @@ function Rt() {
|
|
|
2129
2141
|
const e = document.createElement("span");
|
|
2130
2142
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
2131
2143
|
}
|
|
2132
|
-
var Ue = "Dialog", [
|
|
2144
|
+
var Ue = "Dialog", [zn, Ba] = we(Ue), [Ms, te] = zn(Ue), qn = (e) => {
|
|
2133
2145
|
const {
|
|
2134
2146
|
__scopeDialog: t,
|
|
2135
2147
|
children: n,
|
|
2136
2148
|
open: o,
|
|
2137
2149
|
defaultOpen: r,
|
|
2138
|
-
onOpenChange:
|
|
2150
|
+
onOpenChange: s,
|
|
2139
2151
|
modal: c = !0
|
|
2140
|
-
} = e, d =
|
|
2152
|
+
} = e, d = a.useRef(null), u = a.useRef(null), [l, f] = ye({
|
|
2141
2153
|
prop: o,
|
|
2142
2154
|
defaultProp: r ?? !1,
|
|
2143
|
-
onChange:
|
|
2155
|
+
onChange: s,
|
|
2144
2156
|
caller: Ue
|
|
2145
2157
|
});
|
|
2146
2158
|
return /* @__PURE__ */ i.jsx(
|
|
2147
|
-
|
|
2159
|
+
Ms,
|
|
2148
2160
|
{
|
|
2149
2161
|
scope: t,
|
|
2150
2162
|
triggerRef: d,
|
|
@@ -2154,16 +2166,16 @@ var Ue = "Dialog", [Kn, $a] = we(Ue), [Os, te] = Kn(Ue), qn = (e) => {
|
|
|
2154
2166
|
descriptionId: Z(),
|
|
2155
2167
|
open: l,
|
|
2156
2168
|
onOpenChange: f,
|
|
2157
|
-
onOpenToggle:
|
|
2169
|
+
onOpenToggle: a.useCallback(() => f((m) => !m), [f]),
|
|
2158
2170
|
modal: c,
|
|
2159
2171
|
children: n
|
|
2160
2172
|
}
|
|
2161
2173
|
);
|
|
2162
2174
|
};
|
|
2163
2175
|
qn.displayName = Ue;
|
|
2164
|
-
var Yn = "DialogTrigger",
|
|
2176
|
+
var Yn = "DialogTrigger", Os = a.forwardRef(
|
|
2165
2177
|
(e, t) => {
|
|
2166
|
-
const { __scopeDialog: n, ...o } = e, r = te(Yn, n),
|
|
2178
|
+
const { __scopeDialog: n, ...o } = e, r = te(Yn, n), s = V(t, r.triggerRef);
|
|
2167
2179
|
return /* @__PURE__ */ i.jsx(
|
|
2168
2180
|
k.button,
|
|
2169
2181
|
{
|
|
@@ -2173,34 +2185,34 @@ var Yn = "DialogTrigger", Fs = s.forwardRef(
|
|
|
2173
2185
|
"aria-controls": r.contentId,
|
|
2174
2186
|
"data-state": xt(r.open),
|
|
2175
2187
|
...o,
|
|
2176
|
-
ref:
|
|
2188
|
+
ref: s,
|
|
2177
2189
|
onClick: se(e.onClick, r.onOpenToggle)
|
|
2178
2190
|
}
|
|
2179
2191
|
);
|
|
2180
2192
|
}
|
|
2181
2193
|
);
|
|
2182
|
-
|
|
2183
|
-
var
|
|
2194
|
+
Os.displayName = Yn;
|
|
2195
|
+
var vt = "DialogPortal", [Ls, Xn] = zn(vt, {
|
|
2184
2196
|
forceMount: void 0
|
|
2185
2197
|
}), Zn = (e) => {
|
|
2186
|
-
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e,
|
|
2187
|
-
return /* @__PURE__ */ i.jsx(Ls, { scope: t, forceMount: n, children:
|
|
2198
|
+
const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, s = te(vt, t);
|
|
2199
|
+
return /* @__PURE__ */ i.jsx(Ls, { scope: t, forceMount: n, children: a.Children.map(o, (c) => /* @__PURE__ */ i.jsx(Ve, { present: n || s.open, children: /* @__PURE__ */ i.jsx(Dt, { asChild: !0, container: r, children: c }) })) });
|
|
2188
2200
|
};
|
|
2189
|
-
Zn.displayName =
|
|
2190
|
-
var De = "DialogOverlay", Jn =
|
|
2201
|
+
Zn.displayName = vt;
|
|
2202
|
+
var De = "DialogOverlay", Jn = a.forwardRef(
|
|
2191
2203
|
(e, t) => {
|
|
2192
|
-
const n = Xn(De, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e,
|
|
2193
|
-
return
|
|
2204
|
+
const n = Xn(De, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, s = te(De, e.__scopeDialog);
|
|
2205
|
+
return s.modal ? /* @__PURE__ */ i.jsx(Ve, { present: o || s.open, children: /* @__PURE__ */ i.jsx(Bs, { ...r, ref: t }) }) : null;
|
|
2194
2206
|
}
|
|
2195
2207
|
);
|
|
2196
2208
|
Jn.displayName = De;
|
|
2197
|
-
var
|
|
2209
|
+
var Fs = kt("DialogOverlay.RemoveScroll"), Bs = a.forwardRef(
|
|
2198
2210
|
(e, t) => {
|
|
2199
2211
|
const { __scopeDialog: n, ...o } = e, r = te(De, n);
|
|
2200
2212
|
return (
|
|
2201
2213
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
2202
2214
|
// ie. when `Overlay` and `Content` are siblings
|
|
2203
|
-
/* @__PURE__ */ i.jsx(Mt, { as:
|
|
2215
|
+
/* @__PURE__ */ i.jsx(Mt, { as: Fs, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i.jsx(
|
|
2204
2216
|
k.div,
|
|
2205
2217
|
{
|
|
2206
2218
|
"data-state": xt(r.open),
|
|
@@ -2211,19 +2223,19 @@ var Bs = kt("DialogOverlay.RemoveScroll"), $s = s.forwardRef(
|
|
|
2211
2223
|
) })
|
|
2212
2224
|
);
|
|
2213
2225
|
}
|
|
2214
|
-
),
|
|
2226
|
+
), he = "DialogContent", Qn = a.forwardRef(
|
|
2215
2227
|
(e, t) => {
|
|
2216
|
-
const n = Xn(
|
|
2217
|
-
return /* @__PURE__ */ i.jsx(Ve, { present: o ||
|
|
2228
|
+
const n = Xn(he, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, s = te(he, e.__scopeDialog);
|
|
2229
|
+
return /* @__PURE__ */ i.jsx(Ve, { present: o || s.open, children: s.modal ? /* @__PURE__ */ i.jsx($s, { ...r, ref: t }) : /* @__PURE__ */ i.jsx(Vs, { ...r, ref: t }) });
|
|
2218
2230
|
}
|
|
2219
2231
|
);
|
|
2220
|
-
Qn.displayName =
|
|
2221
|
-
var
|
|
2232
|
+
Qn.displayName = he;
|
|
2233
|
+
var $s = a.forwardRef(
|
|
2222
2234
|
(e, t) => {
|
|
2223
|
-
const n = te(
|
|
2224
|
-
return
|
|
2225
|
-
const
|
|
2226
|
-
if (
|
|
2235
|
+
const n = te(he, e.__scopeDialog), o = a.useRef(null), r = V(t, n.contentRef, o);
|
|
2236
|
+
return a.useEffect(() => {
|
|
2237
|
+
const s = o.current;
|
|
2238
|
+
if (s) return At(s);
|
|
2227
2239
|
}, []), /* @__PURE__ */ i.jsx(
|
|
2228
2240
|
er,
|
|
2229
2241
|
{
|
|
@@ -2231,23 +2243,23 @@ var Vs = s.forwardRef(
|
|
|
2231
2243
|
ref: r,
|
|
2232
2244
|
trapFocus: n.open,
|
|
2233
2245
|
disableOutsidePointerEvents: !0,
|
|
2234
|
-
onCloseAutoFocus: se(e.onCloseAutoFocus, (
|
|
2235
|
-
|
|
2246
|
+
onCloseAutoFocus: se(e.onCloseAutoFocus, (s) => {
|
|
2247
|
+
s.preventDefault(), n.triggerRef.current?.focus();
|
|
2236
2248
|
}),
|
|
2237
|
-
onPointerDownOutside: se(e.onPointerDownOutside, (
|
|
2238
|
-
const c =
|
|
2239
|
-
(c.button === 2 || d) &&
|
|
2249
|
+
onPointerDownOutside: se(e.onPointerDownOutside, (s) => {
|
|
2250
|
+
const c = s.detail.originalEvent, d = c.button === 0 && c.ctrlKey === !0;
|
|
2251
|
+
(c.button === 2 || d) && s.preventDefault();
|
|
2240
2252
|
}),
|
|
2241
2253
|
onFocusOutside: se(
|
|
2242
2254
|
e.onFocusOutside,
|
|
2243
|
-
(
|
|
2255
|
+
(s) => s.preventDefault()
|
|
2244
2256
|
)
|
|
2245
2257
|
}
|
|
2246
2258
|
);
|
|
2247
2259
|
}
|
|
2248
|
-
),
|
|
2260
|
+
), Vs = a.forwardRef(
|
|
2249
2261
|
(e, t) => {
|
|
2250
|
-
const n = te(
|
|
2262
|
+
const n = te(he, e.__scopeDialog), o = a.useRef(!1), r = a.useRef(!1);
|
|
2251
2263
|
return /* @__PURE__ */ i.jsx(
|
|
2252
2264
|
er,
|
|
2253
2265
|
{
|
|
@@ -2255,21 +2267,21 @@ var Vs = s.forwardRef(
|
|
|
2255
2267
|
ref: t,
|
|
2256
2268
|
trapFocus: !1,
|
|
2257
2269
|
disableOutsidePointerEvents: !1,
|
|
2258
|
-
onCloseAutoFocus: (
|
|
2259
|
-
e.onCloseAutoFocus?.(
|
|
2270
|
+
onCloseAutoFocus: (s) => {
|
|
2271
|
+
e.onCloseAutoFocus?.(s), s.defaultPrevented || (o.current || n.triggerRef.current?.focus(), s.preventDefault()), o.current = !1, r.current = !1;
|
|
2260
2272
|
},
|
|
2261
|
-
onInteractOutside: (
|
|
2262
|
-
e.onInteractOutside?.(
|
|
2263
|
-
const c =
|
|
2264
|
-
n.triggerRef.current?.contains(c) &&
|
|
2273
|
+
onInteractOutside: (s) => {
|
|
2274
|
+
e.onInteractOutside?.(s), s.defaultPrevented || (o.current = !0, s.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
2275
|
+
const c = s.target;
|
|
2276
|
+
n.triggerRef.current?.contains(c) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && r.current && s.preventDefault();
|
|
2265
2277
|
}
|
|
2266
2278
|
}
|
|
2267
2279
|
);
|
|
2268
2280
|
}
|
|
2269
|
-
), er =
|
|
2281
|
+
), er = a.forwardRef(
|
|
2270
2282
|
(e, t) => {
|
|
2271
|
-
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus:
|
|
2272
|
-
return
|
|
2283
|
+
const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: s, ...c } = e, d = te(he, n), u = a.useRef(null), l = V(t, u);
|
|
2284
|
+
return As(), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
2273
2285
|
/* @__PURE__ */ i.jsx(
|
|
2274
2286
|
Ot,
|
|
2275
2287
|
{
|
|
@@ -2277,7 +2289,7 @@ var Vs = s.forwardRef(
|
|
|
2277
2289
|
loop: !0,
|
|
2278
2290
|
trapped: o,
|
|
2279
2291
|
onMountAutoFocus: r,
|
|
2280
|
-
onUnmountAutoFocus:
|
|
2292
|
+
onUnmountAutoFocus: s,
|
|
2281
2293
|
children: /* @__PURE__ */ i.jsx(
|
|
2282
2294
|
Hn,
|
|
2283
2295
|
{
|
|
@@ -2294,26 +2306,26 @@ var Vs = s.forwardRef(
|
|
|
2294
2306
|
}
|
|
2295
2307
|
),
|
|
2296
2308
|
/* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
2297
|
-
/* @__PURE__ */ i.jsx(
|
|
2298
|
-
/* @__PURE__ */ i.jsx(
|
|
2309
|
+
/* @__PURE__ */ i.jsx(Hs, { titleId: d.titleId }),
|
|
2310
|
+
/* @__PURE__ */ i.jsx(zs, { contentRef: u, descriptionId: d.descriptionId })
|
|
2299
2311
|
] })
|
|
2300
2312
|
] });
|
|
2301
2313
|
}
|
|
2302
|
-
), gt = "DialogTitle",
|
|
2314
|
+
), gt = "DialogTitle", Us = a.forwardRef(
|
|
2303
2315
|
(e, t) => {
|
|
2304
2316
|
const { __scopeDialog: n, ...o } = e, r = te(gt, n);
|
|
2305
2317
|
return /* @__PURE__ */ i.jsx(k.h2, { id: r.titleId, ...o, ref: t });
|
|
2306
2318
|
}
|
|
2307
2319
|
);
|
|
2308
|
-
|
|
2309
|
-
var tr = "DialogDescription",
|
|
2320
|
+
Us.displayName = gt;
|
|
2321
|
+
var tr = "DialogDescription", Gs = a.forwardRef(
|
|
2310
2322
|
(e, t) => {
|
|
2311
2323
|
const { __scopeDialog: n, ...o } = e, r = te(tr, n);
|
|
2312
2324
|
return /* @__PURE__ */ i.jsx(k.p, { id: r.descriptionId, ...o, ref: t });
|
|
2313
2325
|
}
|
|
2314
2326
|
);
|
|
2315
|
-
|
|
2316
|
-
var nr = "DialogClose",
|
|
2327
|
+
Gs.displayName = tr;
|
|
2328
|
+
var nr = "DialogClose", Ws = a.forwardRef(
|
|
2317
2329
|
(e, t) => {
|
|
2318
2330
|
const { __scopeDialog: n, ...o } = e, r = te(nr, n);
|
|
2319
2331
|
return /* @__PURE__ */ i.jsx(
|
|
@@ -2327,43 +2339,43 @@ var nr = "DialogClose", Hs = s.forwardRef(
|
|
|
2327
2339
|
);
|
|
2328
2340
|
}
|
|
2329
2341
|
);
|
|
2330
|
-
|
|
2342
|
+
Ws.displayName = nr;
|
|
2331
2343
|
function xt(e) {
|
|
2332
2344
|
return e ? "open" : "closed";
|
|
2333
2345
|
}
|
|
2334
|
-
var rr = "DialogTitleWarning", [
|
|
2335
|
-
contentName:
|
|
2346
|
+
var rr = "DialogTitleWarning", [$a, or] = Rr(rr, {
|
|
2347
|
+
contentName: he,
|
|
2336
2348
|
titleName: gt,
|
|
2337
2349
|
docsSlug: "dialog"
|
|
2338
|
-
}),
|
|
2350
|
+
}), Hs = ({ titleId: e }) => {
|
|
2339
2351
|
const t = or(rr), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2340
2352
|
|
|
2341
2353
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
2342
2354
|
|
|
2343
2355
|
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
2344
|
-
return
|
|
2356
|
+
return a.useEffect(() => {
|
|
2345
2357
|
e && (document.getElementById(e) || console.error(n));
|
|
2346
2358
|
}, [n, e]), null;
|
|
2347
|
-
}, Ks = "DialogDescriptionWarning",
|
|
2359
|
+
}, Ks = "DialogDescriptionWarning", zs = ({ contentRef: e, descriptionId: t }) => {
|
|
2348
2360
|
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${or(Ks).contentName}}.`;
|
|
2349
|
-
return
|
|
2361
|
+
return a.useEffect(() => {
|
|
2350
2362
|
const r = e.current?.getAttribute("aria-describedby");
|
|
2351
2363
|
t && r && (document.getElementById(t) || console.warn(o));
|
|
2352
2364
|
}, [o, e, t]), null;
|
|
2353
|
-
},
|
|
2365
|
+
}, qs = qn, Ys = Zn, Xs = Jn, Zs = Qn, Ie = '[cmdk-group=""]', Je = '[cmdk-group-items=""]', Js = '[cmdk-group-heading=""]', sr = '[cmdk-item=""]', Nt = `${sr}:not([aria-disabled="true"])`, it = "cmdk-item-select", xe = "data-value", Qs = (e, t, n) => Ss(e, t, n), ar = a.createContext(void 0), Pe = () => a.useContext(ar), ir = a.createContext(void 0), bt = () => a.useContext(ir), cr = a.createContext(void 0), lr = a.forwardRef((e, t) => {
|
|
2354
2366
|
let n = be(() => {
|
|
2355
2367
|
var p, R;
|
|
2356
2368
|
return { search: "", value: (R = (p = e.value) != null ? p : e.defaultValue) != null ? R : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
2357
|
-
}), o = be(() => /* @__PURE__ */ new Set()), r = be(() => /* @__PURE__ */ new Map()),
|
|
2358
|
-
|
|
2369
|
+
}), o = be(() => /* @__PURE__ */ new Set()), r = be(() => /* @__PURE__ */ new Map()), s = be(() => /* @__PURE__ */ new Map()), c = be(() => /* @__PURE__ */ new Set()), d = dr(e), { label: u, children: l, value: f, onValueChange: m, filter: g, shouldFilter: x, loop: w, disablePointerSelection: h = !1, vimBindings: v = !0, ...S } = e, y = Z(), I = Z(), A = Z(), M = a.useRef(null), j = da();
|
|
2370
|
+
ve(() => {
|
|
2359
2371
|
if (f !== void 0) {
|
|
2360
2372
|
let p = f.trim();
|
|
2361
2373
|
n.current.value = p, E.emit();
|
|
2362
2374
|
}
|
|
2363
|
-
}, [f]),
|
|
2375
|
+
}, [f]), ve(() => {
|
|
2364
2376
|
j(6, X);
|
|
2365
2377
|
}, []);
|
|
2366
|
-
let E =
|
|
2378
|
+
let E = a.useMemo(() => ({ subscribe: (p) => (c.current.add(p), () => c.current.delete(p)), snapshot: () => n.current, setState: (p, R, N) => {
|
|
2367
2379
|
var C, _, b, T;
|
|
2368
2380
|
if (!Object.is(n.current[p], R)) {
|
|
2369
2381
|
if (n.current[p] = R, p === "search") q(), U(), j(1, W);
|
|
@@ -2385,25 +2397,25 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2385
2397
|
}
|
|
2386
2398
|
}, emit: () => {
|
|
2387
2399
|
c.current.forEach((p) => p());
|
|
2388
|
-
} }), []), P =
|
|
2400
|
+
} }), []), P = a.useMemo(() => ({ value: (p, R, N) => {
|
|
2389
2401
|
var C;
|
|
2390
|
-
R !== ((C =
|
|
2402
|
+
R !== ((C = s.current.get(p)) == null ? void 0 : C.value) && (s.current.set(p, { value: R, keywords: N }), n.current.filtered.items.set(p, z(R, N)), j(2, () => {
|
|
2391
2403
|
U(), E.emit();
|
|
2392
2404
|
}));
|
|
2393
2405
|
}, item: (p, R) => (o.current.add(p), R && (r.current.has(R) ? r.current.get(R).add(p) : r.current.set(R, /* @__PURE__ */ new Set([p]))), j(3, () => {
|
|
2394
2406
|
q(), U(), n.current.value || W(), E.emit();
|
|
2395
2407
|
}), () => {
|
|
2396
|
-
|
|
2408
|
+
s.current.delete(p), o.current.delete(p), n.current.filtered.items.delete(p);
|
|
2397
2409
|
let N = H();
|
|
2398
2410
|
j(4, () => {
|
|
2399
2411
|
q(), N?.getAttribute("id") === p && W(), E.emit();
|
|
2400
2412
|
});
|
|
2401
2413
|
}), group: (p) => (r.current.has(p) || r.current.set(p, /* @__PURE__ */ new Set()), () => {
|
|
2402
|
-
|
|
2414
|
+
s.current.delete(p), r.current.delete(p);
|
|
2403
2415
|
}), filter: () => d.current.shouldFilter, label: u || e["aria-label"], getDisablePointerSelection: () => d.current.disablePointerSelection, listId: y, inputId: A, labelId: I, listInnerRef: M }), []);
|
|
2404
|
-
function
|
|
2416
|
+
function z(p, R) {
|
|
2405
2417
|
var N, C;
|
|
2406
|
-
let _ = (C = (N = d.current) == null ? void 0 : N.filter) != null ? C :
|
|
2418
|
+
let _ = (C = (N = d.current) == null ? void 0 : N.filter) != null ? C : Qs;
|
|
2407
2419
|
return p ? _(p, n.current.search, R) : 0;
|
|
2408
2420
|
}
|
|
2409
2421
|
function U() {
|
|
@@ -2417,7 +2429,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2417
2429
|
}), R.push([C, b]);
|
|
2418
2430
|
});
|
|
2419
2431
|
let N = M.current;
|
|
2420
|
-
|
|
2432
|
+
K().sort((C, _) => {
|
|
2421
2433
|
var b, T;
|
|
2422
2434
|
let D = C.getAttribute("id"), O = _.getAttribute("id");
|
|
2423
2435
|
return ((b = p.get(O)) != null ? b : 0) - ((T = p.get(D)) != null ? T : 0);
|
|
@@ -2431,7 +2443,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2431
2443
|
});
|
|
2432
2444
|
}
|
|
2433
2445
|
function W() {
|
|
2434
|
-
let p =
|
|
2446
|
+
let p = K().find((N) => N.getAttribute("aria-disabled") !== "true"), R = p?.getAttribute(xe);
|
|
2435
2447
|
E.setState("value", R || void 0);
|
|
2436
2448
|
}
|
|
2437
2449
|
function q() {
|
|
@@ -2443,7 +2455,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2443
2455
|
n.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
2444
2456
|
let _ = 0;
|
|
2445
2457
|
for (let b of o.current) {
|
|
2446
|
-
let T = (R = (p =
|
|
2458
|
+
let T = (R = (p = s.current.get(b)) == null ? void 0 : p.value) != null ? R : "", D = (C = (N = s.current.get(b)) == null ? void 0 : N.keywords) != null ? C : [], O = z(T, D);
|
|
2447
2459
|
n.current.filtered.items.set(b, O), O > 0 && _++;
|
|
2448
2460
|
}
|
|
2449
2461
|
for (let [b, T] of r.current) for (let D of T) if (n.current.filtered.items.get(D) > 0) {
|
|
@@ -2455,43 +2467,43 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2455
2467
|
function X() {
|
|
2456
2468
|
var p, R, N;
|
|
2457
2469
|
let C = H();
|
|
2458
|
-
C && (((p = C.parentElement) == null ? void 0 : p.firstChild) === C && ((N = (R = C.closest(Ie)) == null ? void 0 : R.querySelector(
|
|
2470
|
+
C && (((p = C.parentElement) == null ? void 0 : p.firstChild) === C && ((N = (R = C.closest(Ie)) == null ? void 0 : R.querySelector(Js)) == null || N.scrollIntoView({ block: "nearest" })), C.scrollIntoView({ block: "nearest" }));
|
|
2459
2471
|
}
|
|
2460
2472
|
function H() {
|
|
2461
2473
|
var p;
|
|
2462
2474
|
return (p = M.current) == null ? void 0 : p.querySelector(`${sr}[aria-selected="true"]`);
|
|
2463
2475
|
}
|
|
2464
|
-
function
|
|
2476
|
+
function K() {
|
|
2465
2477
|
var p;
|
|
2466
2478
|
return Array.from(((p = M.current) == null ? void 0 : p.querySelectorAll(Nt)) || []);
|
|
2467
2479
|
}
|
|
2468
|
-
function
|
|
2469
|
-
let R =
|
|
2480
|
+
function F(p) {
|
|
2481
|
+
let R = K()[p];
|
|
2470
2482
|
R && E.setState("value", R.getAttribute(xe));
|
|
2471
2483
|
}
|
|
2472
2484
|
function Y(p) {
|
|
2473
2485
|
var R;
|
|
2474
|
-
let N = H(), C =
|
|
2486
|
+
let N = H(), C = K(), _ = C.findIndex((T) => T === N), b = C[_ + p];
|
|
2475
2487
|
(R = d.current) != null && R.loop && (b = _ + p < 0 ? C[C.length - 1] : _ + p === C.length ? C[0] : C[_ + p]), b && E.setState("value", b.getAttribute(xe));
|
|
2476
2488
|
}
|
|
2477
2489
|
function J(p) {
|
|
2478
2490
|
let R = H(), N = R?.closest(Ie), C;
|
|
2479
|
-
for (; N && !C; ) N = p > 0 ?
|
|
2491
|
+
for (; N && !C; ) N = p > 0 ? ca(N, Ie) : la(N, Ie), C = N?.querySelector(Nt);
|
|
2480
2492
|
C ? E.setState("value", C.getAttribute(xe)) : Y(p);
|
|
2481
2493
|
}
|
|
2482
|
-
let Q = () =>
|
|
2494
|
+
let Q = () => F(K().length - 1), ge = (p) => {
|
|
2483
2495
|
p.preventDefault(), p.metaKey ? Q() : p.altKey ? J(1) : Y(1);
|
|
2484
2496
|
}, de = (p) => {
|
|
2485
|
-
p.preventDefault(), p.metaKey ?
|
|
2497
|
+
p.preventDefault(), p.metaKey ? F(0) : p.altKey ? J(-1) : Y(-1);
|
|
2486
2498
|
};
|
|
2487
|
-
return
|
|
2499
|
+
return a.createElement(k.div, { ref: t, tabIndex: -1, ...S, "cmdk-root": "", onKeyDown: (p) => {
|
|
2488
2500
|
var R;
|
|
2489
2501
|
(R = S.onKeyDown) == null || R.call(S, p);
|
|
2490
2502
|
let N = p.nativeEvent.isComposing || p.keyCode === 229;
|
|
2491
2503
|
if (!(p.defaultPrevented || N)) switch (p.key) {
|
|
2492
2504
|
case "n":
|
|
2493
2505
|
case "j": {
|
|
2494
|
-
|
|
2506
|
+
v && p.ctrlKey && ge(p);
|
|
2495
2507
|
break;
|
|
2496
2508
|
}
|
|
2497
2509
|
case "ArrowDown": {
|
|
@@ -2500,7 +2512,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2500
2512
|
}
|
|
2501
2513
|
case "p":
|
|
2502
2514
|
case "k": {
|
|
2503
|
-
|
|
2515
|
+
v && p.ctrlKey && de(p);
|
|
2504
2516
|
break;
|
|
2505
2517
|
}
|
|
2506
2518
|
case "ArrowUp": {
|
|
@@ -2508,7 +2520,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2508
2520
|
break;
|
|
2509
2521
|
}
|
|
2510
2522
|
case "Home": {
|
|
2511
|
-
p.preventDefault(),
|
|
2523
|
+
p.preventDefault(), F(0);
|
|
2512
2524
|
break;
|
|
2513
2525
|
}
|
|
2514
2526
|
case "End": {
|
|
@@ -2524,48 +2536,48 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2524
2536
|
}
|
|
2525
2537
|
}
|
|
2526
2538
|
}
|
|
2527
|
-
} },
|
|
2528
|
-
}),
|
|
2539
|
+
} }, a.createElement("label", { "cmdk-label": "", htmlFor: P.inputId, id: P.labelId, style: fa }, u), Ge(e, (p) => a.createElement(ir.Provider, { value: E }, a.createElement(ar.Provider, { value: P }, p))));
|
|
2540
|
+
}), ea = a.forwardRef((e, t) => {
|
|
2529
2541
|
var n, o;
|
|
2530
|
-
let r = Z(),
|
|
2531
|
-
|
|
2542
|
+
let r = Z(), s = a.useRef(null), c = a.useContext(cr), d = Pe(), u = dr(e), l = (o = (n = u.current) == null ? void 0 : n.forceMount) != null ? o : c?.forceMount;
|
|
2543
|
+
ve(() => {
|
|
2532
2544
|
if (!l) return d.item(r, c?.id);
|
|
2533
2545
|
}, [l]);
|
|
2534
|
-
let f = ur(r,
|
|
2535
|
-
|
|
2536
|
-
let j =
|
|
2546
|
+
let f = ur(r, s, [e.value, e.children, s], e.keywords), m = bt(), g = ie((j) => j.value && j.value === f.current), x = ie((j) => l || d.filter() === !1 ? !0 : j.search ? j.filtered.items.get(r) > 0 : !0);
|
|
2547
|
+
a.useEffect(() => {
|
|
2548
|
+
let j = s.current;
|
|
2537
2549
|
if (!(!j || e.disabled)) return j.addEventListener(it, w), () => j.removeEventListener(it, w);
|
|
2538
2550
|
}, [x, e.onSelect, e.disabled]);
|
|
2539
2551
|
function w() {
|
|
2540
2552
|
var j, E;
|
|
2541
|
-
|
|
2553
|
+
h(), (E = (j = u.current).onSelect) == null || E.call(j, f.current);
|
|
2542
2554
|
}
|
|
2543
|
-
function
|
|
2555
|
+
function h() {
|
|
2544
2556
|
m.setState("value", f.current, !0);
|
|
2545
2557
|
}
|
|
2546
2558
|
if (!x) return null;
|
|
2547
|
-
let { disabled:
|
|
2548
|
-
return
|
|
2549
|
-
}),
|
|
2550
|
-
let { heading: n, children: o, forceMount: r, ...
|
|
2551
|
-
|
|
2552
|
-
let g =
|
|
2553
|
-
return
|
|
2554
|
-
}),
|
|
2555
|
-
let { alwaysRender: n, ...o } = e, r =
|
|
2556
|
-
return !n && !
|
|
2557
|
-
}),
|
|
2558
|
-
let { onValueChange: n, ...o } = e, r = e.value != null,
|
|
2559
|
-
return
|
|
2560
|
-
e.value != null &&
|
|
2561
|
-
}, [e.value]),
|
|
2562
|
-
r ||
|
|
2559
|
+
let { disabled: v, value: S, onSelect: y, forceMount: I, keywords: A, ...M } = e;
|
|
2560
|
+
return a.createElement(k.div, { ref: Ne(s, t), ...M, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!v, "aria-selected": !!g, "data-disabled": !!v, "data-selected": !!g, onPointerMove: v || d.getDisablePointerSelection() ? void 0 : h, onClick: v ? void 0 : w }, e.children);
|
|
2561
|
+
}), ta = a.forwardRef((e, t) => {
|
|
2562
|
+
let { heading: n, children: o, forceMount: r, ...s } = e, c = Z(), d = a.useRef(null), u = a.useRef(null), l = Z(), f = Pe(), m = ie((x) => r || f.filter() === !1 ? !0 : x.search ? x.filtered.groups.has(c) : !0);
|
|
2563
|
+
ve(() => f.group(c), []), ur(c, d, [e.value, e.heading, u]);
|
|
2564
|
+
let g = a.useMemo(() => ({ id: c, forceMount: r }), [r]);
|
|
2565
|
+
return a.createElement(k.div, { ref: Ne(d, t), ...s, "cmdk-group": "", role: "presentation", hidden: m ? void 0 : !0 }, n && a.createElement("div", { ref: u, "cmdk-group-heading": "", "aria-hidden": !0, id: l }, n), Ge(e, (x) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? l : void 0 }, a.createElement(cr.Provider, { value: g }, x))));
|
|
2566
|
+
}), na = a.forwardRef((e, t) => {
|
|
2567
|
+
let { alwaysRender: n, ...o } = e, r = a.useRef(null), s = ie((c) => !c.search);
|
|
2568
|
+
return !n && !s ? null : a.createElement(k.div, { ref: Ne(r, t), ...o, "cmdk-separator": "", role: "separator" });
|
|
2569
|
+
}), ra = a.forwardRef((e, t) => {
|
|
2570
|
+
let { onValueChange: n, ...o } = e, r = e.value != null, s = bt(), c = ie((l) => l.search), d = ie((l) => l.selectedItemId), u = Pe();
|
|
2571
|
+
return a.useEffect(() => {
|
|
2572
|
+
e.value != null && s.setState("search", e.value);
|
|
2573
|
+
}, [e.value]), a.createElement(k.input, { ref: t, ...o, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": u.listId, "aria-labelledby": u.labelId, "aria-activedescendant": d, id: u.inputId, type: "text", value: r ? e.value : c, onChange: (l) => {
|
|
2574
|
+
r || s.setState("search", l.target.value), n?.(l.target.value);
|
|
2563
2575
|
} });
|
|
2564
|
-
}),
|
|
2565
|
-
let { children: n, label: o = "Suggestions", ...r } = e,
|
|
2566
|
-
return
|
|
2567
|
-
if (c.current &&
|
|
2568
|
-
let l = c.current, f =
|
|
2576
|
+
}), oa = a.forwardRef((e, t) => {
|
|
2577
|
+
let { children: n, label: o = "Suggestions", ...r } = e, s = a.useRef(null), c = a.useRef(null), d = ie((l) => l.selectedItemId), u = Pe();
|
|
2578
|
+
return a.useEffect(() => {
|
|
2579
|
+
if (c.current && s.current) {
|
|
2580
|
+
let l = c.current, f = s.current, m, g = new ResizeObserver(() => {
|
|
2569
2581
|
m = requestAnimationFrame(() => {
|
|
2570
2582
|
let x = l.offsetHeight;
|
|
2571
2583
|
f.style.setProperty("--cmdk-list-height", x.toFixed(1) + "px");
|
|
@@ -2575,22 +2587,22 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
2575
2587
|
cancelAnimationFrame(m), g.unobserve(l);
|
|
2576
2588
|
};
|
|
2577
2589
|
}
|
|
2578
|
-
}, []),
|
|
2579
|
-
}),
|
|
2580
|
-
let { open: n, onOpenChange: o, overlayClassName: r, contentClassName:
|
|
2581
|
-
return
|
|
2582
|
-
}),
|
|
2583
|
-
let { progress: n, children: o, label: r = "Loading...", ...
|
|
2584
|
-
return
|
|
2585
|
-
}), Ee = Object.assign(lr, { List:
|
|
2586
|
-
function
|
|
2590
|
+
}, []), a.createElement(k.div, { ref: Ne(s, t), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": d, "aria-label": o, id: u.listId }, Ge(e, (l) => a.createElement("div", { ref: Ne(c, u.listInnerRef), "cmdk-list-sizer": "" }, l)));
|
|
2591
|
+
}), sa = a.forwardRef((e, t) => {
|
|
2592
|
+
let { open: n, onOpenChange: o, overlayClassName: r, contentClassName: s, container: c, ...d } = e;
|
|
2593
|
+
return a.createElement(qs, { open: n, onOpenChange: o }, a.createElement(Ys, { container: c }, a.createElement(Xs, { "cmdk-overlay": "", className: r }), a.createElement(Zs, { "aria-label": e.label, "cmdk-dialog": "", className: s }, a.createElement(lr, { ref: t, ...d }))));
|
|
2594
|
+
}), aa = a.forwardRef((e, t) => ie((n) => n.filtered.count === 0) ? a.createElement(k.div, { ref: t, ...e, "cmdk-empty": "", role: "presentation" }) : null), ia = a.forwardRef((e, t) => {
|
|
2595
|
+
let { progress: n, children: o, label: r = "Loading...", ...s } = e;
|
|
2596
|
+
return a.createElement(k.div, { ref: t, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, Ge(e, (c) => a.createElement("div", { "aria-hidden": !0 }, c)));
|
|
2597
|
+
}), Ee = Object.assign(lr, { List: oa, Item: ea, Input: ra, Group: ta, Separator: na, Dialog: sa, Empty: aa, Loading: ia });
|
|
2598
|
+
function ca(e, t) {
|
|
2587
2599
|
let n = e.nextElementSibling;
|
|
2588
2600
|
for (; n; ) {
|
|
2589
2601
|
if (n.matches(t)) return n;
|
|
2590
2602
|
n = n.nextElementSibling;
|
|
2591
2603
|
}
|
|
2592
2604
|
}
|
|
2593
|
-
function
|
|
2605
|
+
function la(e, t) {
|
|
2594
2606
|
let n = e.previousElementSibling;
|
|
2595
2607
|
for (; n; ) {
|
|
2596
2608
|
if (n.matches(t)) return n;
|
|
@@ -2598,23 +2610,23 @@ function da(e, t) {
|
|
|
2598
2610
|
}
|
|
2599
2611
|
}
|
|
2600
2612
|
function dr(e) {
|
|
2601
|
-
let t =
|
|
2602
|
-
return
|
|
2613
|
+
let t = a.useRef(e);
|
|
2614
|
+
return ve(() => {
|
|
2603
2615
|
t.current = e;
|
|
2604
2616
|
}), t;
|
|
2605
2617
|
}
|
|
2606
|
-
var
|
|
2618
|
+
var ve = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
|
|
2607
2619
|
function be(e) {
|
|
2608
|
-
let t =
|
|
2620
|
+
let t = a.useRef();
|
|
2609
2621
|
return t.current === void 0 && (t.current = e()), t;
|
|
2610
2622
|
}
|
|
2611
2623
|
function ie(e) {
|
|
2612
2624
|
let t = bt(), n = () => e(t.snapshot());
|
|
2613
|
-
return
|
|
2625
|
+
return a.useSyncExternalStore(t.subscribe, n, n);
|
|
2614
2626
|
}
|
|
2615
2627
|
function ur(e, t, n, o = []) {
|
|
2616
|
-
let r =
|
|
2617
|
-
return
|
|
2628
|
+
let r = a.useRef(), s = Pe();
|
|
2629
|
+
return ve(() => {
|
|
2618
2630
|
var c;
|
|
2619
2631
|
let d = (() => {
|
|
2620
2632
|
var l;
|
|
@@ -2623,26 +2635,26 @@ function ur(e, t, n, o = []) {
|
|
|
2623
2635
|
if (typeof f == "object" && "current" in f) return f.current ? (l = f.current.textContent) == null ? void 0 : l.trim() : r.current;
|
|
2624
2636
|
}
|
|
2625
2637
|
})(), u = o.map((l) => l.trim());
|
|
2626
|
-
|
|
2638
|
+
s.value(e, d, u), (c = t.current) == null || c.setAttribute(xe, d), r.current = d;
|
|
2627
2639
|
}), r;
|
|
2628
2640
|
}
|
|
2629
|
-
var
|
|
2630
|
-
let [e, t] =
|
|
2631
|
-
return
|
|
2641
|
+
var da = () => {
|
|
2642
|
+
let [e, t] = a.useState(), n = be(() => /* @__PURE__ */ new Map());
|
|
2643
|
+
return ve(() => {
|
|
2632
2644
|
n.current.forEach((o) => o()), n.current = /* @__PURE__ */ new Map();
|
|
2633
2645
|
}, [e]), (o, r) => {
|
|
2634
2646
|
n.current.set(o, r), t({});
|
|
2635
2647
|
};
|
|
2636
2648
|
};
|
|
2637
|
-
function
|
|
2649
|
+
function ua(e) {
|
|
2638
2650
|
let t = e.type;
|
|
2639
2651
|
return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
|
|
2640
2652
|
}
|
|
2641
2653
|
function Ge({ asChild: e, children: t }, n) {
|
|
2642
|
-
return e &&
|
|
2654
|
+
return e && a.isValidElement(t) ? a.cloneElement(ua(t), { ref: t.ref }, n(t.props.children)) : n(t);
|
|
2643
2655
|
}
|
|
2644
|
-
var
|
|
2645
|
-
function
|
|
2656
|
+
var fa = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
2657
|
+
function pa({ className: e, ...t }) {
|
|
2646
2658
|
return /* @__PURE__ */ i.jsx(
|
|
2647
2659
|
Ee,
|
|
2648
2660
|
{
|
|
@@ -2655,7 +2667,7 @@ function ma({ className: e, ...t }) {
|
|
|
2655
2667
|
}
|
|
2656
2668
|
);
|
|
2657
2669
|
}
|
|
2658
|
-
function
|
|
2670
|
+
function ma({ className: e, ...t }) {
|
|
2659
2671
|
return /* @__PURE__ */ i.jsxs("div", { className: "flex h-9 items-center gap-2 border-b px-3", "data-slot": "command-input-wrapper", children: [
|
|
2660
2672
|
/* @__PURE__ */ i.jsx(Vr, { className: "size-4 shrink-0 opacity-50" }),
|
|
2661
2673
|
/* @__PURE__ */ i.jsx(
|
|
@@ -2681,10 +2693,10 @@ function ha({ className: e, ...t }) {
|
|
|
2681
2693
|
}
|
|
2682
2694
|
);
|
|
2683
2695
|
}
|
|
2684
|
-
function
|
|
2696
|
+
function va({ ...e }) {
|
|
2685
2697
|
return /* @__PURE__ */ i.jsx(Ee.Empty, { className: "py-6 text-center text-sm", "data-slot": "command-empty", ...e });
|
|
2686
2698
|
}
|
|
2687
|
-
function
|
|
2699
|
+
function ga({ className: e, ...t }) {
|
|
2688
2700
|
return /* @__PURE__ */ i.jsx(
|
|
2689
2701
|
Ee.Group,
|
|
2690
2702
|
{
|
|
@@ -2697,7 +2709,7 @@ function xa({ className: e, ...t }) {
|
|
|
2697
2709
|
}
|
|
2698
2710
|
);
|
|
2699
2711
|
}
|
|
2700
|
-
function
|
|
2712
|
+
function xa({ className: e, ...t }) {
|
|
2701
2713
|
return /* @__PURE__ */ i.jsx(
|
|
2702
2714
|
Ee.Item,
|
|
2703
2715
|
{
|
|
@@ -2710,42 +2722,42 @@ function ba({ className: e, ...t }) {
|
|
|
2710
2722
|
}
|
|
2711
2723
|
);
|
|
2712
2724
|
}
|
|
2713
|
-
const
|
|
2725
|
+
const ba = ({
|
|
2714
2726
|
placeholder: e,
|
|
2715
2727
|
selected: t,
|
|
2716
2728
|
className: n,
|
|
2717
2729
|
open: o,
|
|
2718
|
-
renderSelected: r = (
|
|
2719
|
-
}) => /* @__PURE__ */ i.jsx(
|
|
2730
|
+
renderSelected: r = (s) => s.label
|
|
2731
|
+
}) => /* @__PURE__ */ i.jsx(Ft, { asChild: !0, children: /* @__PURE__ */ i.jsxs(pr, { "aria-expanded": o, className: `justify-between ${n}`, role: "combobox", variant: "outline", children: [
|
|
2720
2732
|
r(t || { label: e, value: "" }),
|
|
2721
2733
|
/* @__PURE__ */ i.jsx(Dr, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
2722
|
-
] }) }),
|
|
2734
|
+
] }) }), Va = ({
|
|
2723
2735
|
options: e,
|
|
2724
2736
|
value: t = "",
|
|
2725
2737
|
placeholder: n = "Select a value...",
|
|
2726
2738
|
className: o = "",
|
|
2727
2739
|
onSelect: r = () => {
|
|
2728
2740
|
},
|
|
2729
|
-
renderSelected:
|
|
2741
|
+
renderSelected: s = (c) => c.label
|
|
2730
2742
|
}) => {
|
|
2731
|
-
const [c, d] = lt(!1), u =
|
|
2732
|
-
return /* @__PURE__ */ i.jsxs(
|
|
2743
|
+
const [c, d] = lt(!1), u = hr(() => e.find((l) => l.value === t), [e, t]);
|
|
2744
|
+
return /* @__PURE__ */ i.jsxs(Lt, { onOpenChange: d, open: c, children: [
|
|
2733
2745
|
/* @__PURE__ */ i.jsx(
|
|
2734
|
-
|
|
2746
|
+
ba,
|
|
2735
2747
|
{
|
|
2736
2748
|
className: `w-full ${o}`,
|
|
2737
2749
|
open: c,
|
|
2738
2750
|
placeholder: n,
|
|
2739
|
-
renderSelected:
|
|
2751
|
+
renderSelected: s,
|
|
2740
2752
|
selected: u
|
|
2741
2753
|
}
|
|
2742
2754
|
),
|
|
2743
|
-
/* @__PURE__ */ i.jsx(Bt, { className: "w-full p-0", children: /* @__PURE__ */ i.jsxs(
|
|
2744
|
-
/* @__PURE__ */ i.jsx(
|
|
2755
|
+
/* @__PURE__ */ i.jsx(Bt, { className: "w-full p-0", children: /* @__PURE__ */ i.jsxs(pa, { value: t, children: [
|
|
2756
|
+
/* @__PURE__ */ i.jsx(ma, { "aria-label": "Search options", className: "h-9", placeholder: "Search" }),
|
|
2745
2757
|
/* @__PURE__ */ i.jsxs(ha, { children: [
|
|
2746
|
-
/* @__PURE__ */ i.jsx(
|
|
2747
|
-
/* @__PURE__ */ i.jsx(
|
|
2748
|
-
|
|
2758
|
+
/* @__PURE__ */ i.jsx(va, { children: "No results found" }),
|
|
2759
|
+
/* @__PURE__ */ i.jsx(ga, { children: e.map((l) => /* @__PURE__ */ i.jsxs(
|
|
2760
|
+
xa,
|
|
2749
2761
|
{
|
|
2750
2762
|
onSelect: () => {
|
|
2751
2763
|
d(!1), r(l.value);
|
|
@@ -2763,7 +2775,7 @@ const ya = ({
|
|
|
2763
2775
|
] }) })
|
|
2764
2776
|
] });
|
|
2765
2777
|
};
|
|
2766
|
-
function
|
|
2778
|
+
function ya({ className: e, ...t }) {
|
|
2767
2779
|
return /* @__PURE__ */ i.jsx(
|
|
2768
2780
|
"textarea",
|
|
2769
2781
|
{
|
|
@@ -2776,11 +2788,11 @@ function wa({ className: e, ...t }) {
|
|
|
2776
2788
|
}
|
|
2777
2789
|
);
|
|
2778
2790
|
}
|
|
2779
|
-
function
|
|
2791
|
+
function Ua({ label: e, name: t, note: n, placeholder: o, className: r, error: s, ...c }) {
|
|
2780
2792
|
return /* @__PURE__ */ i.jsxs(ae, { className: "w-full", direction: "col", gap: "2", children: [
|
|
2781
2793
|
e && /* @__PURE__ */ i.jsx(Se, { htmlFor: t, children: e }),
|
|
2782
2794
|
/* @__PURE__ */ i.jsx(
|
|
2783
|
-
|
|
2795
|
+
ya,
|
|
2784
2796
|
{
|
|
2785
2797
|
"aria-label": e || t,
|
|
2786
2798
|
className: r,
|
|
@@ -2791,23 +2803,23 @@ function Ga({ label: e, name: t, note: n, placeholder: o, className: r, error: a
|
|
|
2791
2803
|
}
|
|
2792
2804
|
),
|
|
2793
2805
|
n && /* @__PURE__ */ i.jsx(Ae, { size: "sm", variant: "muted", children: n }),
|
|
2794
|
-
|
|
2806
|
+
s && /* @__PURE__ */ i.jsx(je, { message: s })
|
|
2795
2807
|
] });
|
|
2796
2808
|
}
|
|
2797
2809
|
export {
|
|
2798
|
-
|
|
2799
|
-
|
|
2810
|
+
Da as C,
|
|
2811
|
+
_a as D,
|
|
2800
2812
|
je as I,
|
|
2801
2813
|
Se as L,
|
|
2802
|
-
|
|
2814
|
+
Oa as N,
|
|
2803
2815
|
La as R,
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2816
|
+
Ta as S,
|
|
2817
|
+
Ua as T,
|
|
2818
|
+
Aa as a,
|
|
2819
|
+
Ma as b,
|
|
2808
2820
|
os as c,
|
|
2809
|
-
|
|
2810
|
-
|
|
2821
|
+
Fa as d,
|
|
2822
|
+
Va as e,
|
|
2811
2823
|
Un as f,
|
|
2812
2824
|
Zt as g,
|
|
2813
2825
|
so as h,
|