@la-batcave/ui 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
package/dist/Input.js
ADDED
|
@@ -0,0 +1,2216 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c, jsxs as R, Fragment as ve } from "react/jsx-runtime";
|
|
3
|
+
import * as l from "react";
|
|
4
|
+
import * as qe from "react-dom";
|
|
5
|
+
import { c as po } from "./_shared/index-BrLJJgkl.js";
|
|
6
|
+
import { u as se, c as N, a as ae, b as Z, d as mo, P as Ye } from "./_shared/index-CXeb1OMI.js";
|
|
7
|
+
import { u as _, c as ho } from "./_shared/index-DLcqcWxM.js";
|
|
8
|
+
import { u as Se, R as go, A as vo, c as Xe, C as So, a as bo } from "./_shared/index-uu9PT5Nu.js";
|
|
9
|
+
import { P as E } from "./_shared/index-V-Ajw7Ac.js";
|
|
10
|
+
import { u as Ke, a as Ze, R as xo, I as wo, c as Je } from "./_shared/index-C0gNQvxa.js";
|
|
11
|
+
import { P as yo, D as Co } from "./_shared/index-B03TCNO5.js";
|
|
12
|
+
import { h as Ro, u as No, R as Po, F as Eo } from "./_shared/Combination-D_l4PLF_.js";
|
|
13
|
+
import { u as Fe } from "./_shared/index-BC7vfx-u.js";
|
|
14
|
+
import { V as Io } from "./_shared/index-B1f-hyuh.js";
|
|
15
|
+
import { Check as Qe, X as We, ChevronDown as je, EyeOff as ko, Eye as _o } from "lucide-react";
|
|
16
|
+
import { c as P } from "./_shared/utils-eGXXUFl7.js";
|
|
17
|
+
var To = [
|
|
18
|
+
"a",
|
|
19
|
+
"button",
|
|
20
|
+
"div",
|
|
21
|
+
"form",
|
|
22
|
+
"h2",
|
|
23
|
+
"h3",
|
|
24
|
+
"img",
|
|
25
|
+
"input",
|
|
26
|
+
"label",
|
|
27
|
+
"li",
|
|
28
|
+
"nav",
|
|
29
|
+
"ol",
|
|
30
|
+
"p",
|
|
31
|
+
"select",
|
|
32
|
+
"span",
|
|
33
|
+
"svg",
|
|
34
|
+
"ul"
|
|
35
|
+
], Mo = To.reduce((e, o) => {
|
|
36
|
+
const t = po(`Primitive.${o}`), r = l.forwardRef((n, i) => {
|
|
37
|
+
const { asChild: s, ...a } = n, d = s ? t : o;
|
|
38
|
+
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c(d, { ...a, ref: i });
|
|
39
|
+
});
|
|
40
|
+
return r.displayName = `Primitive.${o}`, { ...e, [o]: r };
|
|
41
|
+
}, {}), Do = "Label", et = l.forwardRef((e, o) => /* @__PURE__ */ c(
|
|
42
|
+
Mo.label,
|
|
43
|
+
{
|
|
44
|
+
...e,
|
|
45
|
+
ref: o,
|
|
46
|
+
onMouseDown: (t) => {
|
|
47
|
+
t.target.closest("button, input, select, textarea") || (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
));
|
|
51
|
+
et.displayName = Do;
|
|
52
|
+
var Ao = et;
|
|
53
|
+
function fe(e) {
|
|
54
|
+
const o = l.useRef({ value: e, previous: e });
|
|
55
|
+
return l.useMemo(() => (o.current.value !== e && (o.current.previous = o.current.value, o.current.value = e), o.current.previous), [e]);
|
|
56
|
+
}
|
|
57
|
+
var be = "Switch", [Oo] = ae(be), [Bo, Lo] = Oo(be), tt = l.forwardRef(
|
|
58
|
+
(e, o) => {
|
|
59
|
+
const {
|
|
60
|
+
__scopeSwitch: t,
|
|
61
|
+
name: r,
|
|
62
|
+
checked: n,
|
|
63
|
+
defaultChecked: i,
|
|
64
|
+
required: s,
|
|
65
|
+
disabled: a,
|
|
66
|
+
value: d = "on",
|
|
67
|
+
onCheckedChange: u,
|
|
68
|
+
form: m,
|
|
69
|
+
...f
|
|
70
|
+
} = e, [h, v] = l.useState(null), S = _(o, (w) => v(w)), p = l.useRef(!1), g = h ? m || !!h.closest("form") : !0, [b, x] = se({
|
|
71
|
+
prop: n,
|
|
72
|
+
defaultProp: i ?? !1,
|
|
73
|
+
onChange: u,
|
|
74
|
+
caller: be
|
|
75
|
+
});
|
|
76
|
+
return /* @__PURE__ */ R(Bo, { scope: t, checked: b, disabled: a, children: [
|
|
77
|
+
/* @__PURE__ */ c(
|
|
78
|
+
E.button,
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
role: "switch",
|
|
82
|
+
"aria-checked": b,
|
|
83
|
+
"aria-required": s,
|
|
84
|
+
"data-state": st(b),
|
|
85
|
+
"data-disabled": a ? "" : void 0,
|
|
86
|
+
disabled: a,
|
|
87
|
+
value: d,
|
|
88
|
+
...f,
|
|
89
|
+
ref: S,
|
|
90
|
+
onClick: N(e.onClick, (w) => {
|
|
91
|
+
x((C) => !C), g && (p.current = w.isPropagationStopped(), p.current || w.stopPropagation());
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
g && /* @__PURE__ */ c(
|
|
96
|
+
rt,
|
|
97
|
+
{
|
|
98
|
+
control: h,
|
|
99
|
+
bubbles: !p.current,
|
|
100
|
+
name: r,
|
|
101
|
+
value: d,
|
|
102
|
+
checked: b,
|
|
103
|
+
required: s,
|
|
104
|
+
disabled: a,
|
|
105
|
+
form: m,
|
|
106
|
+
style: { transform: "translateX(-100%)" }
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
tt.displayName = be;
|
|
113
|
+
var ot = "SwitchThumb", nt = l.forwardRef(
|
|
114
|
+
(e, o) => {
|
|
115
|
+
const { __scopeSwitch: t, ...r } = e, n = Lo(ot, t);
|
|
116
|
+
return /* @__PURE__ */ c(
|
|
117
|
+
E.span,
|
|
118
|
+
{
|
|
119
|
+
"data-state": st(n.checked),
|
|
120
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
121
|
+
...r,
|
|
122
|
+
ref: o
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
nt.displayName = ot;
|
|
128
|
+
var Vo = "SwitchBubbleInput", rt = l.forwardRef(
|
|
129
|
+
({
|
|
130
|
+
__scopeSwitch: e,
|
|
131
|
+
control: o,
|
|
132
|
+
checked: t,
|
|
133
|
+
bubbles: r = !0,
|
|
134
|
+
...n
|
|
135
|
+
}, i) => {
|
|
136
|
+
const s = l.useRef(null), a = _(s, i), d = fe(t), u = Se(o);
|
|
137
|
+
return l.useEffect(() => {
|
|
138
|
+
const m = s.current;
|
|
139
|
+
if (!m) return;
|
|
140
|
+
const f = window.HTMLInputElement.prototype, v = Object.getOwnPropertyDescriptor(
|
|
141
|
+
f,
|
|
142
|
+
"checked"
|
|
143
|
+
).set;
|
|
144
|
+
if (d !== t && v) {
|
|
145
|
+
const S = new Event("click", { bubbles: r });
|
|
146
|
+
v.call(m, t), m.dispatchEvent(S);
|
|
147
|
+
}
|
|
148
|
+
}, [d, t, r]), /* @__PURE__ */ c(
|
|
149
|
+
"input",
|
|
150
|
+
{
|
|
151
|
+
type: "checkbox",
|
|
152
|
+
"aria-hidden": !0,
|
|
153
|
+
defaultChecked: t,
|
|
154
|
+
...n,
|
|
155
|
+
tabIndex: -1,
|
|
156
|
+
ref: a,
|
|
157
|
+
style: {
|
|
158
|
+
...n.style,
|
|
159
|
+
...u,
|
|
160
|
+
position: "absolute",
|
|
161
|
+
pointerEvents: "none",
|
|
162
|
+
opacity: 0,
|
|
163
|
+
margin: 0
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
rt.displayName = Vo;
|
|
170
|
+
function st(e) {
|
|
171
|
+
return e ? "checked" : "unchecked";
|
|
172
|
+
}
|
|
173
|
+
var Ho = tt, Ko = nt;
|
|
174
|
+
function he(e, [o, t]) {
|
|
175
|
+
return Math.min(t, Math.max(o, e));
|
|
176
|
+
}
|
|
177
|
+
// @__NO_SIDE_EFFECTS__
|
|
178
|
+
function Fo(e) {
|
|
179
|
+
const o = /* @__PURE__ */ $o(e), t = l.forwardRef((r, n) => {
|
|
180
|
+
const { children: i, ...s } = r, a = l.Children.toArray(i), d = a.find(zo);
|
|
181
|
+
if (d) {
|
|
182
|
+
const u = d.props.children, m = a.map((f) => f === d ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : f);
|
|
183
|
+
return /* @__PURE__ */ c(o, { ...s, ref: n, children: l.isValidElement(u) ? l.cloneElement(u, void 0, m) : null });
|
|
184
|
+
}
|
|
185
|
+
return /* @__PURE__ */ c(o, { ...s, ref: n, children: i });
|
|
186
|
+
});
|
|
187
|
+
return t.displayName = `${e}.Slot`, t;
|
|
188
|
+
}
|
|
189
|
+
// @__NO_SIDE_EFFECTS__
|
|
190
|
+
function $o(e) {
|
|
191
|
+
const o = l.forwardRef((t, r) => {
|
|
192
|
+
const { children: n, ...i } = t;
|
|
193
|
+
if (l.isValidElement(n)) {
|
|
194
|
+
const s = Wo(n), a = Go(i, n.props);
|
|
195
|
+
return n.type !== l.Fragment && (a.ref = r ? ho(r, s) : s), l.cloneElement(n, a);
|
|
196
|
+
}
|
|
197
|
+
return l.Children.count(n) > 1 ? l.Children.only(null) : null;
|
|
198
|
+
});
|
|
199
|
+
return o.displayName = `${e}.SlotClone`, o;
|
|
200
|
+
}
|
|
201
|
+
var Uo = /* @__PURE__ */ Symbol("radix.slottable");
|
|
202
|
+
function zo(e) {
|
|
203
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Uo;
|
|
204
|
+
}
|
|
205
|
+
function Go(e, o) {
|
|
206
|
+
const t = { ...o };
|
|
207
|
+
for (const r in o) {
|
|
208
|
+
const n = e[r], i = o[r];
|
|
209
|
+
/^on[A-Z]/.test(r) ? n && i ? t[r] = (...a) => {
|
|
210
|
+
const d = i(...a);
|
|
211
|
+
return n(...a), d;
|
|
212
|
+
} : n && (t[r] = n) : r === "style" ? t[r] = { ...n, ...i } : r === "className" && (t[r] = [n, i].filter(Boolean).join(" "));
|
|
213
|
+
}
|
|
214
|
+
return { ...e, ...t };
|
|
215
|
+
}
|
|
216
|
+
function Wo(e) {
|
|
217
|
+
let o = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = o && "isReactWarning" in o && o.isReactWarning;
|
|
218
|
+
return t ? e.ref : (o = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = o && "isReactWarning" in o && o.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
219
|
+
}
|
|
220
|
+
var jo = [" ", "Enter", "ArrowUp", "ArrowDown"], qo = [" ", "Enter"], oe = "Select", [xe, we, Yo] = Ze(oe), [ce] = ae(oe, [
|
|
221
|
+
Yo,
|
|
222
|
+
Xe
|
|
223
|
+
]), ye = Xe(), [Xo, J] = ce(oe), [Zo, Jo] = ce(oe), it = (e) => {
|
|
224
|
+
const {
|
|
225
|
+
__scopeSelect: o,
|
|
226
|
+
children: t,
|
|
227
|
+
open: r,
|
|
228
|
+
defaultOpen: n,
|
|
229
|
+
onOpenChange: i,
|
|
230
|
+
value: s,
|
|
231
|
+
defaultValue: a,
|
|
232
|
+
onValueChange: d,
|
|
233
|
+
dir: u,
|
|
234
|
+
name: m,
|
|
235
|
+
autoComplete: f,
|
|
236
|
+
disabled: h,
|
|
237
|
+
required: v,
|
|
238
|
+
form: S
|
|
239
|
+
} = e, p = ye(o), [g, b] = l.useState(null), [x, w] = l.useState(null), [C, M] = l.useState(!1), W = Ke(u), [D, U] = se({
|
|
240
|
+
prop: r,
|
|
241
|
+
defaultProp: n ?? !1,
|
|
242
|
+
onChange: i,
|
|
243
|
+
caller: oe
|
|
244
|
+
}), [Y, K] = se({
|
|
245
|
+
prop: s,
|
|
246
|
+
defaultProp: a,
|
|
247
|
+
onChange: d,
|
|
248
|
+
caller: oe
|
|
249
|
+
}), I = l.useRef(null), L = g ? S || !!g.closest("form") : !0, [z, G] = l.useState(/* @__PURE__ */ new Set()), F = Array.from(z).map((A) => A.props.value).join(";");
|
|
250
|
+
return /* @__PURE__ */ c(go, { ...p, children: /* @__PURE__ */ R(
|
|
251
|
+
Xo,
|
|
252
|
+
{
|
|
253
|
+
required: v,
|
|
254
|
+
scope: o,
|
|
255
|
+
trigger: g,
|
|
256
|
+
onTriggerChange: b,
|
|
257
|
+
valueNode: x,
|
|
258
|
+
onValueNodeChange: w,
|
|
259
|
+
valueNodeHasChildren: C,
|
|
260
|
+
onValueNodeHasChildrenChange: M,
|
|
261
|
+
contentId: Fe(),
|
|
262
|
+
value: Y,
|
|
263
|
+
onValueChange: K,
|
|
264
|
+
open: D,
|
|
265
|
+
onOpenChange: U,
|
|
266
|
+
dir: W,
|
|
267
|
+
triggerPointerDownPosRef: I,
|
|
268
|
+
disabled: h,
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ c(xe.Provider, { scope: o, children: /* @__PURE__ */ c(
|
|
271
|
+
Zo,
|
|
272
|
+
{
|
|
273
|
+
scope: e.__scopeSelect,
|
|
274
|
+
onNativeOptionAdd: l.useCallback((A) => {
|
|
275
|
+
G((V) => new Set(V).add(A));
|
|
276
|
+
}, []),
|
|
277
|
+
onNativeOptionRemove: l.useCallback((A) => {
|
|
278
|
+
G((V) => {
|
|
279
|
+
const H = new Set(V);
|
|
280
|
+
return H.delete(A), H;
|
|
281
|
+
});
|
|
282
|
+
}, []),
|
|
283
|
+
children: t
|
|
284
|
+
}
|
|
285
|
+
) }),
|
|
286
|
+
L ? /* @__PURE__ */ R(
|
|
287
|
+
It,
|
|
288
|
+
{
|
|
289
|
+
"aria-hidden": !0,
|
|
290
|
+
required: v,
|
|
291
|
+
tabIndex: -1,
|
|
292
|
+
name: m,
|
|
293
|
+
autoComplete: f,
|
|
294
|
+
value: Y,
|
|
295
|
+
onChange: (A) => K(A.target.value),
|
|
296
|
+
disabled: h,
|
|
297
|
+
form: S,
|
|
298
|
+
children: [
|
|
299
|
+
Y === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
|
|
300
|
+
Array.from(z)
|
|
301
|
+
]
|
|
302
|
+
},
|
|
303
|
+
F
|
|
304
|
+
) : null
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
) });
|
|
308
|
+
};
|
|
309
|
+
it.displayName = oe;
|
|
310
|
+
var at = "SelectTrigger", ct = l.forwardRef(
|
|
311
|
+
(e, o) => {
|
|
312
|
+
const { __scopeSelect: t, disabled: r = !1, ...n } = e, i = ye(t), s = J(at, t), a = s.disabled || r, d = _(o, s.onTriggerChange), u = we(t), m = l.useRef("touch"), [f, h, v] = _t((p) => {
|
|
313
|
+
const g = u().filter((w) => !w.disabled), b = g.find((w) => w.value === s.value), x = Tt(g, p, b);
|
|
314
|
+
x !== void 0 && s.onValueChange(x.value);
|
|
315
|
+
}), S = (p) => {
|
|
316
|
+
a || (s.onOpenChange(!0), v()), p && (s.triggerPointerDownPosRef.current = {
|
|
317
|
+
x: Math.round(p.pageX),
|
|
318
|
+
y: Math.round(p.pageY)
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
return /* @__PURE__ */ c(vo, { asChild: !0, ...i, children: /* @__PURE__ */ c(
|
|
322
|
+
E.button,
|
|
323
|
+
{
|
|
324
|
+
type: "button",
|
|
325
|
+
role: "combobox",
|
|
326
|
+
"aria-controls": s.contentId,
|
|
327
|
+
"aria-expanded": s.open,
|
|
328
|
+
"aria-required": s.required,
|
|
329
|
+
"aria-autocomplete": "none",
|
|
330
|
+
dir: s.dir,
|
|
331
|
+
"data-state": s.open ? "open" : "closed",
|
|
332
|
+
disabled: a,
|
|
333
|
+
"data-disabled": a ? "" : void 0,
|
|
334
|
+
"data-placeholder": kt(s.value) ? "" : void 0,
|
|
335
|
+
...n,
|
|
336
|
+
ref: d,
|
|
337
|
+
onClick: N(n.onClick, (p) => {
|
|
338
|
+
p.currentTarget.focus(), m.current !== "mouse" && S(p);
|
|
339
|
+
}),
|
|
340
|
+
onPointerDown: N(n.onPointerDown, (p) => {
|
|
341
|
+
m.current = p.pointerType;
|
|
342
|
+
const g = p.target;
|
|
343
|
+
g.hasPointerCapture(p.pointerId) && g.releasePointerCapture(p.pointerId), p.button === 0 && p.ctrlKey === !1 && p.pointerType === "mouse" && (S(p), p.preventDefault());
|
|
344
|
+
}),
|
|
345
|
+
onKeyDown: N(n.onKeyDown, (p) => {
|
|
346
|
+
const g = f.current !== "";
|
|
347
|
+
!(p.ctrlKey || p.altKey || p.metaKey) && p.key.length === 1 && h(p.key), !(g && p.key === " ") && jo.includes(p.key) && (S(), p.preventDefault());
|
|
348
|
+
})
|
|
349
|
+
}
|
|
350
|
+
) });
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
ct.displayName = at;
|
|
354
|
+
var lt = "SelectValue", dt = l.forwardRef(
|
|
355
|
+
(e, o) => {
|
|
356
|
+
const { __scopeSelect: t, className: r, style: n, children: i, placeholder: s = "", ...a } = e, d = J(lt, t), { onValueNodeHasChildrenChange: u } = d, m = i !== void 0, f = _(o, d.onValueNodeChange);
|
|
357
|
+
return Z(() => {
|
|
358
|
+
u(m);
|
|
359
|
+
}, [u, m]), /* @__PURE__ */ c(
|
|
360
|
+
E.span,
|
|
361
|
+
{
|
|
362
|
+
...a,
|
|
363
|
+
ref: f,
|
|
364
|
+
style: { pointerEvents: "none" },
|
|
365
|
+
children: kt(d.value) ? /* @__PURE__ */ c(ve, { children: s }) : i
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
dt.displayName = lt;
|
|
371
|
+
var Qo = "SelectIcon", ut = l.forwardRef(
|
|
372
|
+
(e, o) => {
|
|
373
|
+
const { __scopeSelect: t, children: r, ...n } = e;
|
|
374
|
+
return /* @__PURE__ */ c(E.span, { "aria-hidden": !0, ...n, ref: o, children: r || "▼" });
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
ut.displayName = Qo;
|
|
378
|
+
var en = "SelectPortal", ft = (e) => /* @__PURE__ */ c(yo, { asChild: !0, ...e });
|
|
379
|
+
ft.displayName = en;
|
|
380
|
+
var ne = "SelectContent", pt = l.forwardRef(
|
|
381
|
+
(e, o) => {
|
|
382
|
+
const t = J(ne, e.__scopeSelect), [r, n] = l.useState();
|
|
383
|
+
if (Z(() => {
|
|
384
|
+
n(new DocumentFragment());
|
|
385
|
+
}, []), !t.open) {
|
|
386
|
+
const i = r;
|
|
387
|
+
return i ? qe.createPortal(
|
|
388
|
+
/* @__PURE__ */ c(mt, { scope: e.__scopeSelect, children: /* @__PURE__ */ c(xe.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ c("div", { children: e.children }) }) }),
|
|
389
|
+
i
|
|
390
|
+
) : null;
|
|
391
|
+
}
|
|
392
|
+
return /* @__PURE__ */ c(ht, { ...e, ref: o });
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
pt.displayName = ne;
|
|
396
|
+
var q = 10, [mt, Q] = ce(ne), tn = "SelectContentImpl", on = /* @__PURE__ */ Fo("SelectContent.RemoveScroll"), ht = l.forwardRef(
|
|
397
|
+
(e, o) => {
|
|
398
|
+
const {
|
|
399
|
+
__scopeSelect: t,
|
|
400
|
+
position: r = "item-aligned",
|
|
401
|
+
onCloseAutoFocus: n,
|
|
402
|
+
onEscapeKeyDown: i,
|
|
403
|
+
onPointerDownOutside: s,
|
|
404
|
+
//
|
|
405
|
+
// PopperContent props
|
|
406
|
+
side: a,
|
|
407
|
+
sideOffset: d,
|
|
408
|
+
align: u,
|
|
409
|
+
alignOffset: m,
|
|
410
|
+
arrowPadding: f,
|
|
411
|
+
collisionBoundary: h,
|
|
412
|
+
collisionPadding: v,
|
|
413
|
+
sticky: S,
|
|
414
|
+
hideWhenDetached: p,
|
|
415
|
+
avoidCollisions: g,
|
|
416
|
+
//
|
|
417
|
+
...b
|
|
418
|
+
} = e, x = J(ne, t), [w, C] = l.useState(null), [M, W] = l.useState(null), D = _(o, (y) => C(y)), [U, Y] = l.useState(null), [K, I] = l.useState(
|
|
419
|
+
null
|
|
420
|
+
), L = we(t), [z, G] = l.useState(!1), F = l.useRef(!1);
|
|
421
|
+
l.useEffect(() => {
|
|
422
|
+
if (w) return Ro(w);
|
|
423
|
+
}, [w]), No();
|
|
424
|
+
const A = l.useCallback(
|
|
425
|
+
(y) => {
|
|
426
|
+
const [O, ...$] = L().map((B) => B.ref.current), [k] = $.slice(-1), T = document.activeElement;
|
|
427
|
+
for (const B of y)
|
|
428
|
+
if (B === T || (B?.scrollIntoView({ block: "nearest" }), B === O && M && (M.scrollTop = 0), B === k && M && (M.scrollTop = M.scrollHeight), B?.focus(), document.activeElement !== T)) return;
|
|
429
|
+
},
|
|
430
|
+
[L, M]
|
|
431
|
+
), V = l.useCallback(
|
|
432
|
+
() => A([U, w]),
|
|
433
|
+
[A, U, w]
|
|
434
|
+
);
|
|
435
|
+
l.useEffect(() => {
|
|
436
|
+
z && V();
|
|
437
|
+
}, [z, V]);
|
|
438
|
+
const { onOpenChange: H, triggerPointerDownPosRef: j } = x;
|
|
439
|
+
l.useEffect(() => {
|
|
440
|
+
if (w) {
|
|
441
|
+
let y = { x: 0, y: 0 };
|
|
442
|
+
const O = (k) => {
|
|
443
|
+
y = {
|
|
444
|
+
x: Math.abs(Math.round(k.pageX) - (j.current?.x ?? 0)),
|
|
445
|
+
y: Math.abs(Math.round(k.pageY) - (j.current?.y ?? 0))
|
|
446
|
+
};
|
|
447
|
+
}, $ = (k) => {
|
|
448
|
+
y.x <= 10 && y.y <= 10 ? k.preventDefault() : w.contains(k.target) || H(!1), document.removeEventListener("pointermove", O), j.current = null;
|
|
449
|
+
};
|
|
450
|
+
return j.current !== null && (document.addEventListener("pointermove", O), document.addEventListener("pointerup", $, { capture: !0, once: !0 })), () => {
|
|
451
|
+
document.removeEventListener("pointermove", O), document.removeEventListener("pointerup", $, { capture: !0 });
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
}, [w, H, j]), l.useEffect(() => {
|
|
455
|
+
const y = () => H(!1);
|
|
456
|
+
return window.addEventListener("blur", y), window.addEventListener("resize", y), () => {
|
|
457
|
+
window.removeEventListener("blur", y), window.removeEventListener("resize", y);
|
|
458
|
+
};
|
|
459
|
+
}, [H]);
|
|
460
|
+
const [Pe, pe] = _t((y) => {
|
|
461
|
+
const O = L().filter((T) => !T.disabled), $ = O.find((T) => T.ref.current === document.activeElement), k = Tt(O, y, $);
|
|
462
|
+
k && setTimeout(() => k.ref.current.focus());
|
|
463
|
+
}), Ee = l.useCallback(
|
|
464
|
+
(y, O, $) => {
|
|
465
|
+
const k = !F.current && !$;
|
|
466
|
+
(x.value !== void 0 && x.value === O || k) && (Y(y), k && (F.current = !0));
|
|
467
|
+
},
|
|
468
|
+
[x.value]
|
|
469
|
+
), Ie = l.useCallback(() => w?.focus(), [w]), re = l.useCallback(
|
|
470
|
+
(y, O, $) => {
|
|
471
|
+
const k = !F.current && !$;
|
|
472
|
+
(x.value !== void 0 && x.value === O || k) && I(y);
|
|
473
|
+
},
|
|
474
|
+
[x.value]
|
|
475
|
+
), me = r === "popper" ? Me : gt, de = me === Me ? {
|
|
476
|
+
side: a,
|
|
477
|
+
sideOffset: d,
|
|
478
|
+
align: u,
|
|
479
|
+
alignOffset: m,
|
|
480
|
+
arrowPadding: f,
|
|
481
|
+
collisionBoundary: h,
|
|
482
|
+
collisionPadding: v,
|
|
483
|
+
sticky: S,
|
|
484
|
+
hideWhenDetached: p,
|
|
485
|
+
avoidCollisions: g
|
|
486
|
+
} : {};
|
|
487
|
+
return /* @__PURE__ */ c(
|
|
488
|
+
mt,
|
|
489
|
+
{
|
|
490
|
+
scope: t,
|
|
491
|
+
content: w,
|
|
492
|
+
viewport: M,
|
|
493
|
+
onViewportChange: W,
|
|
494
|
+
itemRefCallback: Ee,
|
|
495
|
+
selectedItem: U,
|
|
496
|
+
onItemLeave: Ie,
|
|
497
|
+
itemTextRefCallback: re,
|
|
498
|
+
focusSelectedItem: V,
|
|
499
|
+
selectedItemText: K,
|
|
500
|
+
position: r,
|
|
501
|
+
isPositioned: z,
|
|
502
|
+
searchRef: Pe,
|
|
503
|
+
children: /* @__PURE__ */ c(Po, { as: on, allowPinchZoom: !0, children: /* @__PURE__ */ c(
|
|
504
|
+
Eo,
|
|
505
|
+
{
|
|
506
|
+
asChild: !0,
|
|
507
|
+
trapped: x.open,
|
|
508
|
+
onMountAutoFocus: (y) => {
|
|
509
|
+
y.preventDefault();
|
|
510
|
+
},
|
|
511
|
+
onUnmountAutoFocus: N(n, (y) => {
|
|
512
|
+
x.trigger?.focus({ preventScroll: !0 }), y.preventDefault();
|
|
513
|
+
}),
|
|
514
|
+
children: /* @__PURE__ */ c(
|
|
515
|
+
Co,
|
|
516
|
+
{
|
|
517
|
+
asChild: !0,
|
|
518
|
+
disableOutsidePointerEvents: !0,
|
|
519
|
+
onEscapeKeyDown: i,
|
|
520
|
+
onPointerDownOutside: s,
|
|
521
|
+
onFocusOutside: (y) => y.preventDefault(),
|
|
522
|
+
onDismiss: () => x.onOpenChange(!1),
|
|
523
|
+
children: /* @__PURE__ */ c(
|
|
524
|
+
me,
|
|
525
|
+
{
|
|
526
|
+
role: "listbox",
|
|
527
|
+
id: x.contentId,
|
|
528
|
+
"data-state": x.open ? "open" : "closed",
|
|
529
|
+
dir: x.dir,
|
|
530
|
+
onContextMenu: (y) => y.preventDefault(),
|
|
531
|
+
...b,
|
|
532
|
+
...de,
|
|
533
|
+
onPlaced: () => G(!0),
|
|
534
|
+
ref: D,
|
|
535
|
+
style: {
|
|
536
|
+
// flex layout so we can place the scroll buttons properly
|
|
537
|
+
display: "flex",
|
|
538
|
+
flexDirection: "column",
|
|
539
|
+
// reset the outline by default as the content MAY get focused
|
|
540
|
+
outline: "none",
|
|
541
|
+
...b.style
|
|
542
|
+
},
|
|
543
|
+
onKeyDown: N(b.onKeyDown, (y) => {
|
|
544
|
+
const O = y.ctrlKey || y.altKey || y.metaKey;
|
|
545
|
+
if (y.key === "Tab" && y.preventDefault(), !O && y.key.length === 1 && pe(y.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(y.key)) {
|
|
546
|
+
let k = L().filter((T) => !T.disabled).map((T) => T.ref.current);
|
|
547
|
+
if (["ArrowUp", "End"].includes(y.key) && (k = k.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(y.key)) {
|
|
548
|
+
const T = y.target, B = k.indexOf(T);
|
|
549
|
+
k = k.slice(B + 1);
|
|
550
|
+
}
|
|
551
|
+
setTimeout(() => A(k)), y.preventDefault();
|
|
552
|
+
}
|
|
553
|
+
})
|
|
554
|
+
}
|
|
555
|
+
)
|
|
556
|
+
}
|
|
557
|
+
)
|
|
558
|
+
}
|
|
559
|
+
) })
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
);
|
|
564
|
+
ht.displayName = tn;
|
|
565
|
+
var nn = "SelectItemAlignedPosition", gt = l.forwardRef((e, o) => {
|
|
566
|
+
const { __scopeSelect: t, onPlaced: r, ...n } = e, i = J(ne, t), s = Q(ne, t), [a, d] = l.useState(null), [u, m] = l.useState(null), f = _(o, (D) => m(D)), h = we(t), v = l.useRef(!1), S = l.useRef(!0), { viewport: p, selectedItem: g, selectedItemText: b, focusSelectedItem: x } = s, w = l.useCallback(() => {
|
|
567
|
+
if (i.trigger && i.valueNode && a && u && p && g && b) {
|
|
568
|
+
const D = i.trigger.getBoundingClientRect(), U = u.getBoundingClientRect(), Y = i.valueNode.getBoundingClientRect(), K = b.getBoundingClientRect();
|
|
569
|
+
if (i.dir !== "rtl") {
|
|
570
|
+
const T = K.left - U.left, B = Y.left - T, ee = D.left - B, te = D.width + ee, ke = Math.max(te, U.width), _e = window.innerWidth - q, Te = he(B, [
|
|
571
|
+
q,
|
|
572
|
+
// Prevents the content from going off the starting edge of the
|
|
573
|
+
// viewport. It may still go off the ending edge, but this can be
|
|
574
|
+
// controlled by the user since they may want to manage overflow in a
|
|
575
|
+
// specific way.
|
|
576
|
+
// https://github.com/radix-ui/primitives/issues/2049
|
|
577
|
+
Math.max(q, _e - ke)
|
|
578
|
+
]);
|
|
579
|
+
a.style.minWidth = te + "px", a.style.left = Te + "px";
|
|
580
|
+
} else {
|
|
581
|
+
const T = U.right - K.right, B = window.innerWidth - Y.right - T, ee = window.innerWidth - D.right - B, te = D.width + ee, ke = Math.max(te, U.width), _e = window.innerWidth - q, Te = he(B, [
|
|
582
|
+
q,
|
|
583
|
+
Math.max(q, _e - ke)
|
|
584
|
+
]);
|
|
585
|
+
a.style.minWidth = te + "px", a.style.right = Te + "px";
|
|
586
|
+
}
|
|
587
|
+
const I = h(), L = window.innerHeight - q * 2, z = p.scrollHeight, G = window.getComputedStyle(u), F = parseInt(G.borderTopWidth, 10), A = parseInt(G.paddingTop, 10), V = parseInt(G.borderBottomWidth, 10), H = parseInt(G.paddingBottom, 10), j = F + A + z + H + V, Pe = Math.min(g.offsetHeight * 5, j), pe = window.getComputedStyle(p), Ee = parseInt(pe.paddingTop, 10), Ie = parseInt(pe.paddingBottom, 10), re = D.top + D.height / 2 - q, me = L - re, de = g.offsetHeight / 2, y = g.offsetTop + de, O = F + A + y, $ = j - O;
|
|
588
|
+
if (O <= re) {
|
|
589
|
+
const T = I.length > 0 && g === I[I.length - 1].ref.current;
|
|
590
|
+
a.style.bottom = "0px";
|
|
591
|
+
const B = u.clientHeight - p.offsetTop - p.offsetHeight, ee = Math.max(
|
|
592
|
+
me,
|
|
593
|
+
de + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
594
|
+
(T ? Ie : 0) + B + V
|
|
595
|
+
), te = O + ee;
|
|
596
|
+
a.style.height = te + "px";
|
|
597
|
+
} else {
|
|
598
|
+
const T = I.length > 0 && g === I[0].ref.current;
|
|
599
|
+
a.style.top = "0px";
|
|
600
|
+
const ee = Math.max(
|
|
601
|
+
re,
|
|
602
|
+
F + p.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
603
|
+
(T ? Ee : 0) + de
|
|
604
|
+
) + $;
|
|
605
|
+
a.style.height = ee + "px", p.scrollTop = O - re + p.offsetTop;
|
|
606
|
+
}
|
|
607
|
+
a.style.margin = `${q}px 0`, a.style.minHeight = Pe + "px", a.style.maxHeight = L + "px", r?.(), requestAnimationFrame(() => v.current = !0);
|
|
608
|
+
}
|
|
609
|
+
}, [
|
|
610
|
+
h,
|
|
611
|
+
i.trigger,
|
|
612
|
+
i.valueNode,
|
|
613
|
+
a,
|
|
614
|
+
u,
|
|
615
|
+
p,
|
|
616
|
+
g,
|
|
617
|
+
b,
|
|
618
|
+
i.dir,
|
|
619
|
+
r
|
|
620
|
+
]);
|
|
621
|
+
Z(() => w(), [w]);
|
|
622
|
+
const [C, M] = l.useState();
|
|
623
|
+
Z(() => {
|
|
624
|
+
u && M(window.getComputedStyle(u).zIndex);
|
|
625
|
+
}, [u]);
|
|
626
|
+
const W = l.useCallback(
|
|
627
|
+
(D) => {
|
|
628
|
+
D && S.current === !0 && (w(), x?.(), S.current = !1);
|
|
629
|
+
},
|
|
630
|
+
[w, x]
|
|
631
|
+
);
|
|
632
|
+
return /* @__PURE__ */ c(
|
|
633
|
+
sn,
|
|
634
|
+
{
|
|
635
|
+
scope: t,
|
|
636
|
+
contentWrapper: a,
|
|
637
|
+
shouldExpandOnScrollRef: v,
|
|
638
|
+
onScrollButtonChange: W,
|
|
639
|
+
children: /* @__PURE__ */ c(
|
|
640
|
+
"div",
|
|
641
|
+
{
|
|
642
|
+
ref: d,
|
|
643
|
+
style: {
|
|
644
|
+
display: "flex",
|
|
645
|
+
flexDirection: "column",
|
|
646
|
+
position: "fixed",
|
|
647
|
+
zIndex: C
|
|
648
|
+
},
|
|
649
|
+
children: /* @__PURE__ */ c(
|
|
650
|
+
E.div,
|
|
651
|
+
{
|
|
652
|
+
...n,
|
|
653
|
+
ref: f,
|
|
654
|
+
style: {
|
|
655
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
656
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
657
|
+
boxSizing: "border-box",
|
|
658
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
659
|
+
maxHeight: "100%",
|
|
660
|
+
...n.style
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
)
|
|
664
|
+
}
|
|
665
|
+
)
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
});
|
|
669
|
+
gt.displayName = nn;
|
|
670
|
+
var rn = "SelectPopperPosition", Me = l.forwardRef((e, o) => {
|
|
671
|
+
const {
|
|
672
|
+
__scopeSelect: t,
|
|
673
|
+
align: r = "start",
|
|
674
|
+
collisionPadding: n = q,
|
|
675
|
+
...i
|
|
676
|
+
} = e, s = ye(t);
|
|
677
|
+
return /* @__PURE__ */ c(
|
|
678
|
+
So,
|
|
679
|
+
{
|
|
680
|
+
...s,
|
|
681
|
+
...i,
|
|
682
|
+
ref: o,
|
|
683
|
+
align: r,
|
|
684
|
+
collisionPadding: n,
|
|
685
|
+
style: {
|
|
686
|
+
// Ensure border-box for floating-ui calculations
|
|
687
|
+
boxSizing: "border-box",
|
|
688
|
+
...i.style,
|
|
689
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
690
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
691
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
692
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
693
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
});
|
|
698
|
+
Me.displayName = rn;
|
|
699
|
+
var [sn, $e] = ce(ne, {}), De = "SelectViewport", vt = l.forwardRef(
|
|
700
|
+
(e, o) => {
|
|
701
|
+
const { __scopeSelect: t, nonce: r, ...n } = e, i = Q(De, t), s = $e(De, t), a = _(o, i.onViewportChange), d = l.useRef(0);
|
|
702
|
+
return /* @__PURE__ */ R(ve, { children: [
|
|
703
|
+
/* @__PURE__ */ c(
|
|
704
|
+
"style",
|
|
705
|
+
{
|
|
706
|
+
dangerouslySetInnerHTML: {
|
|
707
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
708
|
+
},
|
|
709
|
+
nonce: r
|
|
710
|
+
}
|
|
711
|
+
),
|
|
712
|
+
/* @__PURE__ */ c(xe.Slot, { scope: t, children: /* @__PURE__ */ c(
|
|
713
|
+
E.div,
|
|
714
|
+
{
|
|
715
|
+
"data-radix-select-viewport": "",
|
|
716
|
+
role: "presentation",
|
|
717
|
+
...n,
|
|
718
|
+
ref: a,
|
|
719
|
+
style: {
|
|
720
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
721
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
722
|
+
// (independent of the scrollUpButton).
|
|
723
|
+
position: "relative",
|
|
724
|
+
flex: 1,
|
|
725
|
+
// Viewport should only be scrollable in the vertical direction.
|
|
726
|
+
// This won't work in vertical writing modes, so we'll need to
|
|
727
|
+
// revisit this if/when that is supported
|
|
728
|
+
// https://developer.chrome.com/blog/vertical-form-controls
|
|
729
|
+
overflow: "hidden auto",
|
|
730
|
+
...n.style
|
|
731
|
+
},
|
|
732
|
+
onScroll: N(n.onScroll, (u) => {
|
|
733
|
+
const m = u.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef: h } = s;
|
|
734
|
+
if (h?.current && f) {
|
|
735
|
+
const v = Math.abs(d.current - m.scrollTop);
|
|
736
|
+
if (v > 0) {
|
|
737
|
+
const S = window.innerHeight - q * 2, p = parseFloat(f.style.minHeight), g = parseFloat(f.style.height), b = Math.max(p, g);
|
|
738
|
+
if (b < S) {
|
|
739
|
+
const x = b + v, w = Math.min(S, x), C = x - w;
|
|
740
|
+
f.style.height = w + "px", f.style.bottom === "0px" && (m.scrollTop = C > 0 ? C : 0, f.style.justifyContent = "flex-end");
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
d.current = m.scrollTop;
|
|
745
|
+
})
|
|
746
|
+
}
|
|
747
|
+
) })
|
|
748
|
+
] });
|
|
749
|
+
}
|
|
750
|
+
);
|
|
751
|
+
vt.displayName = De;
|
|
752
|
+
var St = "SelectGroup", [an, cn] = ce(St), bt = l.forwardRef(
|
|
753
|
+
(e, o) => {
|
|
754
|
+
const { __scopeSelect: t, ...r } = e, n = Fe();
|
|
755
|
+
return /* @__PURE__ */ c(an, { scope: t, id: n, children: /* @__PURE__ */ c(E.div, { role: "group", "aria-labelledby": n, ...r, ref: o }) });
|
|
756
|
+
}
|
|
757
|
+
);
|
|
758
|
+
bt.displayName = St;
|
|
759
|
+
var xt = "SelectLabel", wt = l.forwardRef(
|
|
760
|
+
(e, o) => {
|
|
761
|
+
const { __scopeSelect: t, ...r } = e, n = cn(xt, t);
|
|
762
|
+
return /* @__PURE__ */ c(E.div, { id: n.id, ...r, ref: o });
|
|
763
|
+
}
|
|
764
|
+
);
|
|
765
|
+
wt.displayName = xt;
|
|
766
|
+
var ge = "SelectItem", [ln, yt] = ce(ge), Ct = l.forwardRef(
|
|
767
|
+
(e, o) => {
|
|
768
|
+
const {
|
|
769
|
+
__scopeSelect: t,
|
|
770
|
+
value: r,
|
|
771
|
+
disabled: n = !1,
|
|
772
|
+
textValue: i,
|
|
773
|
+
...s
|
|
774
|
+
} = e, a = J(ge, t), d = Q(ge, t), u = a.value === r, [m, f] = l.useState(i ?? ""), [h, v] = l.useState(!1), S = _(
|
|
775
|
+
o,
|
|
776
|
+
(x) => d.itemRefCallback?.(x, r, n)
|
|
777
|
+
), p = Fe(), g = l.useRef("touch"), b = () => {
|
|
778
|
+
n || (a.onValueChange(r), a.onOpenChange(!1));
|
|
779
|
+
};
|
|
780
|
+
if (r === "")
|
|
781
|
+
throw new Error(
|
|
782
|
+
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
783
|
+
);
|
|
784
|
+
return /* @__PURE__ */ c(
|
|
785
|
+
ln,
|
|
786
|
+
{
|
|
787
|
+
scope: t,
|
|
788
|
+
value: r,
|
|
789
|
+
disabled: n,
|
|
790
|
+
textId: p,
|
|
791
|
+
isSelected: u,
|
|
792
|
+
onItemTextChange: l.useCallback((x) => {
|
|
793
|
+
f((w) => w || (x?.textContent ?? "").trim());
|
|
794
|
+
}, []),
|
|
795
|
+
children: /* @__PURE__ */ c(
|
|
796
|
+
xe.ItemSlot,
|
|
797
|
+
{
|
|
798
|
+
scope: t,
|
|
799
|
+
value: r,
|
|
800
|
+
disabled: n,
|
|
801
|
+
textValue: m,
|
|
802
|
+
children: /* @__PURE__ */ c(
|
|
803
|
+
E.div,
|
|
804
|
+
{
|
|
805
|
+
role: "option",
|
|
806
|
+
"aria-labelledby": p,
|
|
807
|
+
"data-highlighted": h ? "" : void 0,
|
|
808
|
+
"aria-selected": u && h,
|
|
809
|
+
"data-state": u ? "checked" : "unchecked",
|
|
810
|
+
"aria-disabled": n || void 0,
|
|
811
|
+
"data-disabled": n ? "" : void 0,
|
|
812
|
+
tabIndex: n ? void 0 : -1,
|
|
813
|
+
...s,
|
|
814
|
+
ref: S,
|
|
815
|
+
onFocus: N(s.onFocus, () => v(!0)),
|
|
816
|
+
onBlur: N(s.onBlur, () => v(!1)),
|
|
817
|
+
onClick: N(s.onClick, () => {
|
|
818
|
+
g.current !== "mouse" && b();
|
|
819
|
+
}),
|
|
820
|
+
onPointerUp: N(s.onPointerUp, () => {
|
|
821
|
+
g.current === "mouse" && b();
|
|
822
|
+
}),
|
|
823
|
+
onPointerDown: N(s.onPointerDown, (x) => {
|
|
824
|
+
g.current = x.pointerType;
|
|
825
|
+
}),
|
|
826
|
+
onPointerMove: N(s.onPointerMove, (x) => {
|
|
827
|
+
g.current = x.pointerType, n ? d.onItemLeave?.() : g.current === "mouse" && x.currentTarget.focus({ preventScroll: !0 });
|
|
828
|
+
}),
|
|
829
|
+
onPointerLeave: N(s.onPointerLeave, (x) => {
|
|
830
|
+
x.currentTarget === document.activeElement && d.onItemLeave?.();
|
|
831
|
+
}),
|
|
832
|
+
onKeyDown: N(s.onKeyDown, (x) => {
|
|
833
|
+
d.searchRef?.current !== "" && x.key === " " || (qo.includes(x.key) && b(), x.key === " " && x.preventDefault());
|
|
834
|
+
})
|
|
835
|
+
}
|
|
836
|
+
)
|
|
837
|
+
}
|
|
838
|
+
)
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
Ct.displayName = ge;
|
|
844
|
+
var ue = "SelectItemText", Rt = l.forwardRef(
|
|
845
|
+
(e, o) => {
|
|
846
|
+
const { __scopeSelect: t, className: r, style: n, ...i } = e, s = J(ue, t), a = Q(ue, t), d = yt(ue, t), u = Jo(ue, t), [m, f] = l.useState(null), h = _(
|
|
847
|
+
o,
|
|
848
|
+
(b) => f(b),
|
|
849
|
+
d.onItemTextChange,
|
|
850
|
+
(b) => a.itemTextRefCallback?.(b, d.value, d.disabled)
|
|
851
|
+
), v = m?.textContent, S = l.useMemo(
|
|
852
|
+
() => /* @__PURE__ */ c("option", { value: d.value, disabled: d.disabled, children: v }, d.value),
|
|
853
|
+
[d.disabled, d.value, v]
|
|
854
|
+
), { onNativeOptionAdd: p, onNativeOptionRemove: g } = u;
|
|
855
|
+
return Z(() => (p(S), () => g(S)), [p, g, S]), /* @__PURE__ */ R(ve, { children: [
|
|
856
|
+
/* @__PURE__ */ c(E.span, { id: d.textId, ...i, ref: h }),
|
|
857
|
+
d.isSelected && s.valueNode && !s.valueNodeHasChildren ? qe.createPortal(i.children, s.valueNode) : null
|
|
858
|
+
] });
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
Rt.displayName = ue;
|
|
862
|
+
var Nt = "SelectItemIndicator", Pt = l.forwardRef(
|
|
863
|
+
(e, o) => {
|
|
864
|
+
const { __scopeSelect: t, ...r } = e;
|
|
865
|
+
return yt(Nt, t).isSelected ? /* @__PURE__ */ c(E.span, { "aria-hidden": !0, ...r, ref: o }) : null;
|
|
866
|
+
}
|
|
867
|
+
);
|
|
868
|
+
Pt.displayName = Nt;
|
|
869
|
+
var Ae = "SelectScrollUpButton", dn = l.forwardRef((e, o) => {
|
|
870
|
+
const t = Q(Ae, e.__scopeSelect), r = $e(Ae, e.__scopeSelect), [n, i] = l.useState(!1), s = _(o, r.onScrollButtonChange);
|
|
871
|
+
return Z(() => {
|
|
872
|
+
if (t.viewport && t.isPositioned) {
|
|
873
|
+
let a = function() {
|
|
874
|
+
const u = d.scrollTop > 0;
|
|
875
|
+
i(u);
|
|
876
|
+
};
|
|
877
|
+
const d = t.viewport;
|
|
878
|
+
return a(), d.addEventListener("scroll", a), () => d.removeEventListener("scroll", a);
|
|
879
|
+
}
|
|
880
|
+
}, [t.viewport, t.isPositioned]), n ? /* @__PURE__ */ c(
|
|
881
|
+
Et,
|
|
882
|
+
{
|
|
883
|
+
...e,
|
|
884
|
+
ref: s,
|
|
885
|
+
onAutoScroll: () => {
|
|
886
|
+
const { viewport: a, selectedItem: d } = t;
|
|
887
|
+
a && d && (a.scrollTop = a.scrollTop - d.offsetHeight);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
) : null;
|
|
891
|
+
});
|
|
892
|
+
dn.displayName = Ae;
|
|
893
|
+
var Oe = "SelectScrollDownButton", un = l.forwardRef((e, o) => {
|
|
894
|
+
const t = Q(Oe, e.__scopeSelect), r = $e(Oe, e.__scopeSelect), [n, i] = l.useState(!1), s = _(o, r.onScrollButtonChange);
|
|
895
|
+
return Z(() => {
|
|
896
|
+
if (t.viewport && t.isPositioned) {
|
|
897
|
+
let a = function() {
|
|
898
|
+
const u = d.scrollHeight - d.clientHeight, m = Math.ceil(d.scrollTop) < u;
|
|
899
|
+
i(m);
|
|
900
|
+
};
|
|
901
|
+
const d = t.viewport;
|
|
902
|
+
return a(), d.addEventListener("scroll", a), () => d.removeEventListener("scroll", a);
|
|
903
|
+
}
|
|
904
|
+
}, [t.viewport, t.isPositioned]), n ? /* @__PURE__ */ c(
|
|
905
|
+
Et,
|
|
906
|
+
{
|
|
907
|
+
...e,
|
|
908
|
+
ref: s,
|
|
909
|
+
onAutoScroll: () => {
|
|
910
|
+
const { viewport: a, selectedItem: d } = t;
|
|
911
|
+
a && d && (a.scrollTop = a.scrollTop + d.offsetHeight);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
) : null;
|
|
915
|
+
});
|
|
916
|
+
un.displayName = Oe;
|
|
917
|
+
var Et = l.forwardRef((e, o) => {
|
|
918
|
+
const { __scopeSelect: t, onAutoScroll: r, ...n } = e, i = Q("SelectScrollButton", t), s = l.useRef(null), a = we(t), d = l.useCallback(() => {
|
|
919
|
+
s.current !== null && (window.clearInterval(s.current), s.current = null);
|
|
920
|
+
}, []);
|
|
921
|
+
return l.useEffect(() => () => d(), [d]), Z(() => {
|
|
922
|
+
a().find((m) => m.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
923
|
+
}, [a]), /* @__PURE__ */ c(
|
|
924
|
+
E.div,
|
|
925
|
+
{
|
|
926
|
+
"aria-hidden": !0,
|
|
927
|
+
...n,
|
|
928
|
+
ref: o,
|
|
929
|
+
style: { flexShrink: 0, ...n.style },
|
|
930
|
+
onPointerDown: N(n.onPointerDown, () => {
|
|
931
|
+
s.current === null && (s.current = window.setInterval(r, 50));
|
|
932
|
+
}),
|
|
933
|
+
onPointerMove: N(n.onPointerMove, () => {
|
|
934
|
+
i.onItemLeave?.(), s.current === null && (s.current = window.setInterval(r, 50));
|
|
935
|
+
}),
|
|
936
|
+
onPointerLeave: N(n.onPointerLeave, () => {
|
|
937
|
+
d();
|
|
938
|
+
})
|
|
939
|
+
}
|
|
940
|
+
);
|
|
941
|
+
}), fn = "SelectSeparator", pn = l.forwardRef(
|
|
942
|
+
(e, o) => {
|
|
943
|
+
const { __scopeSelect: t, ...r } = e;
|
|
944
|
+
return /* @__PURE__ */ c(E.div, { "aria-hidden": !0, ...r, ref: o });
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
pn.displayName = fn;
|
|
948
|
+
var Be = "SelectArrow", mn = l.forwardRef(
|
|
949
|
+
(e, o) => {
|
|
950
|
+
const { __scopeSelect: t, ...r } = e, n = ye(t), i = J(Be, t), s = Q(Be, t);
|
|
951
|
+
return i.open && s.position === "popper" ? /* @__PURE__ */ c(bo, { ...n, ...r, ref: o }) : null;
|
|
952
|
+
}
|
|
953
|
+
);
|
|
954
|
+
mn.displayName = Be;
|
|
955
|
+
var hn = "SelectBubbleInput", It = l.forwardRef(
|
|
956
|
+
({ __scopeSelect: e, value: o, ...t }, r) => {
|
|
957
|
+
const n = l.useRef(null), i = _(r, n), s = fe(o);
|
|
958
|
+
return l.useEffect(() => {
|
|
959
|
+
const a = n.current;
|
|
960
|
+
if (!a) return;
|
|
961
|
+
const d = window.HTMLSelectElement.prototype, m = Object.getOwnPropertyDescriptor(
|
|
962
|
+
d,
|
|
963
|
+
"value"
|
|
964
|
+
).set;
|
|
965
|
+
if (s !== o && m) {
|
|
966
|
+
const f = new Event("change", { bubbles: !0 });
|
|
967
|
+
m.call(a, o), a.dispatchEvent(f);
|
|
968
|
+
}
|
|
969
|
+
}, [s, o]), /* @__PURE__ */ c(
|
|
970
|
+
E.select,
|
|
971
|
+
{
|
|
972
|
+
...t,
|
|
973
|
+
style: { ...Io, ...t.style },
|
|
974
|
+
ref: i,
|
|
975
|
+
defaultValue: o
|
|
976
|
+
}
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
);
|
|
980
|
+
It.displayName = hn;
|
|
981
|
+
function kt(e) {
|
|
982
|
+
return e === "" || e === void 0;
|
|
983
|
+
}
|
|
984
|
+
function _t(e) {
|
|
985
|
+
const o = mo(e), t = l.useRef(""), r = l.useRef(0), n = l.useCallback(
|
|
986
|
+
(s) => {
|
|
987
|
+
const a = t.current + s;
|
|
988
|
+
o(a), (function d(u) {
|
|
989
|
+
t.current = u, window.clearTimeout(r.current), u !== "" && (r.current = window.setTimeout(() => d(""), 1e3));
|
|
990
|
+
})(a);
|
|
991
|
+
},
|
|
992
|
+
[o]
|
|
993
|
+
), i = l.useCallback(() => {
|
|
994
|
+
t.current = "", window.clearTimeout(r.current);
|
|
995
|
+
}, []);
|
|
996
|
+
return l.useEffect(() => () => window.clearTimeout(r.current), []), [t, n, i];
|
|
997
|
+
}
|
|
998
|
+
function Tt(e, o, t) {
|
|
999
|
+
const n = o.length > 1 && Array.from(o).every((u) => u === o[0]) ? o[0] : o, i = t ? e.indexOf(t) : -1;
|
|
1000
|
+
let s = gn(e, Math.max(i, 0));
|
|
1001
|
+
n.length === 1 && (s = s.filter((u) => u !== t));
|
|
1002
|
+
const d = s.find(
|
|
1003
|
+
(u) => u.textValue.toLowerCase().startsWith(n.toLowerCase())
|
|
1004
|
+
);
|
|
1005
|
+
return d !== t ? d : void 0;
|
|
1006
|
+
}
|
|
1007
|
+
function gn(e, o) {
|
|
1008
|
+
return e.map((t, r) => e[(o + r) % e.length]);
|
|
1009
|
+
}
|
|
1010
|
+
var vn = it, Sn = ct, bn = dt, xn = ut, wn = ft, yn = pt, Cn = vt, Rn = bt, Nn = wt, Pn = Ct, En = Rt, In = Pt, Ce = "Checkbox", [kn] = ae(Ce), [_n, Ue] = kn(Ce);
|
|
1011
|
+
function Tn(e) {
|
|
1012
|
+
const {
|
|
1013
|
+
__scopeCheckbox: o,
|
|
1014
|
+
checked: t,
|
|
1015
|
+
children: r,
|
|
1016
|
+
defaultChecked: n,
|
|
1017
|
+
disabled: i,
|
|
1018
|
+
form: s,
|
|
1019
|
+
name: a,
|
|
1020
|
+
onCheckedChange: d,
|
|
1021
|
+
required: u,
|
|
1022
|
+
value: m = "on",
|
|
1023
|
+
// @ts-expect-error
|
|
1024
|
+
internal_do_not_use_render: f
|
|
1025
|
+
} = e, [h, v] = se({
|
|
1026
|
+
prop: t,
|
|
1027
|
+
defaultProp: n ?? !1,
|
|
1028
|
+
onChange: d,
|
|
1029
|
+
caller: Ce
|
|
1030
|
+
}), [S, p] = l.useState(null), [g, b] = l.useState(null), x = l.useRef(!1), w = S ? !!s || !!S.closest("form") : (
|
|
1031
|
+
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
1032
|
+
!0
|
|
1033
|
+
), C = {
|
|
1034
|
+
checked: h,
|
|
1035
|
+
disabled: i,
|
|
1036
|
+
setChecked: v,
|
|
1037
|
+
control: S,
|
|
1038
|
+
setControl: p,
|
|
1039
|
+
name: a,
|
|
1040
|
+
form: s,
|
|
1041
|
+
value: m,
|
|
1042
|
+
hasConsumerStoppedPropagationRef: x,
|
|
1043
|
+
required: u,
|
|
1044
|
+
defaultChecked: X(n) ? !1 : n,
|
|
1045
|
+
isFormControl: w,
|
|
1046
|
+
bubbleInput: g,
|
|
1047
|
+
setBubbleInput: b
|
|
1048
|
+
};
|
|
1049
|
+
return /* @__PURE__ */ c(
|
|
1050
|
+
_n,
|
|
1051
|
+
{
|
|
1052
|
+
scope: o,
|
|
1053
|
+
...C,
|
|
1054
|
+
children: Mn(f) ? f(C) : r
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
var Mt = "CheckboxTrigger", Dt = l.forwardRef(
|
|
1059
|
+
({ __scopeCheckbox: e, onKeyDown: o, onClick: t, ...r }, n) => {
|
|
1060
|
+
const {
|
|
1061
|
+
control: i,
|
|
1062
|
+
value: s,
|
|
1063
|
+
disabled: a,
|
|
1064
|
+
checked: d,
|
|
1065
|
+
required: u,
|
|
1066
|
+
setControl: m,
|
|
1067
|
+
setChecked: f,
|
|
1068
|
+
hasConsumerStoppedPropagationRef: h,
|
|
1069
|
+
isFormControl: v,
|
|
1070
|
+
bubbleInput: S
|
|
1071
|
+
} = Ue(Mt, e), p = _(n, m), g = l.useRef(d);
|
|
1072
|
+
return l.useEffect(() => {
|
|
1073
|
+
const b = i?.form;
|
|
1074
|
+
if (b) {
|
|
1075
|
+
const x = () => f(g.current);
|
|
1076
|
+
return b.addEventListener("reset", x), () => b.removeEventListener("reset", x);
|
|
1077
|
+
}
|
|
1078
|
+
}, [i, f]), /* @__PURE__ */ c(
|
|
1079
|
+
E.button,
|
|
1080
|
+
{
|
|
1081
|
+
type: "button",
|
|
1082
|
+
role: "checkbox",
|
|
1083
|
+
"aria-checked": X(d) ? "mixed" : d,
|
|
1084
|
+
"aria-required": u,
|
|
1085
|
+
"data-state": Ht(d),
|
|
1086
|
+
"data-disabled": a ? "" : void 0,
|
|
1087
|
+
disabled: a,
|
|
1088
|
+
value: s,
|
|
1089
|
+
...r,
|
|
1090
|
+
ref: p,
|
|
1091
|
+
onKeyDown: N(o, (b) => {
|
|
1092
|
+
b.key === "Enter" && b.preventDefault();
|
|
1093
|
+
}),
|
|
1094
|
+
onClick: N(t, (b) => {
|
|
1095
|
+
f((x) => X(x) ? !0 : !x), S && v && (h.current = b.isPropagationStopped(), h.current || b.stopPropagation());
|
|
1096
|
+
})
|
|
1097
|
+
}
|
|
1098
|
+
);
|
|
1099
|
+
}
|
|
1100
|
+
);
|
|
1101
|
+
Dt.displayName = Mt;
|
|
1102
|
+
var At = l.forwardRef(
|
|
1103
|
+
(e, o) => {
|
|
1104
|
+
const {
|
|
1105
|
+
__scopeCheckbox: t,
|
|
1106
|
+
name: r,
|
|
1107
|
+
checked: n,
|
|
1108
|
+
defaultChecked: i,
|
|
1109
|
+
required: s,
|
|
1110
|
+
disabled: a,
|
|
1111
|
+
value: d,
|
|
1112
|
+
onCheckedChange: u,
|
|
1113
|
+
form: m,
|
|
1114
|
+
...f
|
|
1115
|
+
} = e;
|
|
1116
|
+
return /* @__PURE__ */ c(
|
|
1117
|
+
Tn,
|
|
1118
|
+
{
|
|
1119
|
+
__scopeCheckbox: t,
|
|
1120
|
+
checked: n,
|
|
1121
|
+
defaultChecked: i,
|
|
1122
|
+
disabled: a,
|
|
1123
|
+
required: s,
|
|
1124
|
+
onCheckedChange: u,
|
|
1125
|
+
name: r,
|
|
1126
|
+
form: m,
|
|
1127
|
+
value: d,
|
|
1128
|
+
internal_do_not_use_render: ({ isFormControl: h }) => /* @__PURE__ */ R(ve, { children: [
|
|
1129
|
+
/* @__PURE__ */ c(
|
|
1130
|
+
Dt,
|
|
1131
|
+
{
|
|
1132
|
+
...f,
|
|
1133
|
+
ref: o,
|
|
1134
|
+
__scopeCheckbox: t
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
h && /* @__PURE__ */ c(
|
|
1138
|
+
Vt,
|
|
1139
|
+
{
|
|
1140
|
+
__scopeCheckbox: t
|
|
1141
|
+
}
|
|
1142
|
+
)
|
|
1143
|
+
] })
|
|
1144
|
+
}
|
|
1145
|
+
);
|
|
1146
|
+
}
|
|
1147
|
+
);
|
|
1148
|
+
At.displayName = Ce;
|
|
1149
|
+
var Ot = "CheckboxIndicator", Bt = l.forwardRef(
|
|
1150
|
+
(e, o) => {
|
|
1151
|
+
const { __scopeCheckbox: t, forceMount: r, ...n } = e, i = Ue(Ot, t);
|
|
1152
|
+
return /* @__PURE__ */ c(
|
|
1153
|
+
Ye,
|
|
1154
|
+
{
|
|
1155
|
+
present: r || X(i.checked) || i.checked === !0,
|
|
1156
|
+
children: /* @__PURE__ */ c(
|
|
1157
|
+
E.span,
|
|
1158
|
+
{
|
|
1159
|
+
"data-state": Ht(i.checked),
|
|
1160
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
1161
|
+
...n,
|
|
1162
|
+
ref: o,
|
|
1163
|
+
style: { pointerEvents: "none", ...e.style }
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
}
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
);
|
|
1170
|
+
Bt.displayName = Ot;
|
|
1171
|
+
var Lt = "CheckboxBubbleInput", Vt = l.forwardRef(
|
|
1172
|
+
({ __scopeCheckbox: e, ...o }, t) => {
|
|
1173
|
+
const {
|
|
1174
|
+
control: r,
|
|
1175
|
+
hasConsumerStoppedPropagationRef: n,
|
|
1176
|
+
checked: i,
|
|
1177
|
+
defaultChecked: s,
|
|
1178
|
+
required: a,
|
|
1179
|
+
disabled: d,
|
|
1180
|
+
name: u,
|
|
1181
|
+
value: m,
|
|
1182
|
+
form: f,
|
|
1183
|
+
bubbleInput: h,
|
|
1184
|
+
setBubbleInput: v
|
|
1185
|
+
} = Ue(Lt, e), S = _(t, v), p = fe(i), g = Se(r);
|
|
1186
|
+
l.useEffect(() => {
|
|
1187
|
+
const x = h;
|
|
1188
|
+
if (!x) return;
|
|
1189
|
+
const w = window.HTMLInputElement.prototype, M = Object.getOwnPropertyDescriptor(
|
|
1190
|
+
w,
|
|
1191
|
+
"checked"
|
|
1192
|
+
).set, W = !n.current;
|
|
1193
|
+
if (p !== i && M) {
|
|
1194
|
+
const D = new Event("click", { bubbles: W });
|
|
1195
|
+
x.indeterminate = X(i), M.call(x, X(i) ? !1 : i), x.dispatchEvent(D);
|
|
1196
|
+
}
|
|
1197
|
+
}, [h, p, i, n]);
|
|
1198
|
+
const b = l.useRef(X(i) ? !1 : i);
|
|
1199
|
+
return /* @__PURE__ */ c(
|
|
1200
|
+
E.input,
|
|
1201
|
+
{
|
|
1202
|
+
type: "checkbox",
|
|
1203
|
+
"aria-hidden": !0,
|
|
1204
|
+
defaultChecked: s ?? b.current,
|
|
1205
|
+
required: a,
|
|
1206
|
+
disabled: d,
|
|
1207
|
+
name: u,
|
|
1208
|
+
value: m,
|
|
1209
|
+
form: f,
|
|
1210
|
+
...o,
|
|
1211
|
+
tabIndex: -1,
|
|
1212
|
+
ref: S,
|
|
1213
|
+
style: {
|
|
1214
|
+
...o.style,
|
|
1215
|
+
...g,
|
|
1216
|
+
position: "absolute",
|
|
1217
|
+
pointerEvents: "none",
|
|
1218
|
+
opacity: 0,
|
|
1219
|
+
margin: 0,
|
|
1220
|
+
// We transform because the input is absolutely positioned but we have
|
|
1221
|
+
// rendered it **after** the button. This pulls it back to sit on top
|
|
1222
|
+
// of the button.
|
|
1223
|
+
transform: "translateX(-100%)"
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
);
|
|
1227
|
+
}
|
|
1228
|
+
);
|
|
1229
|
+
Vt.displayName = Lt;
|
|
1230
|
+
function Mn(e) {
|
|
1231
|
+
return typeof e == "function";
|
|
1232
|
+
}
|
|
1233
|
+
function X(e) {
|
|
1234
|
+
return e === "indeterminate";
|
|
1235
|
+
}
|
|
1236
|
+
function Ht(e) {
|
|
1237
|
+
return X(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
1238
|
+
}
|
|
1239
|
+
var ze = "Radio", [Dn, Kt] = ae(ze), [An, On] = Dn(ze), Ft = l.forwardRef(
|
|
1240
|
+
(e, o) => {
|
|
1241
|
+
const {
|
|
1242
|
+
__scopeRadio: t,
|
|
1243
|
+
name: r,
|
|
1244
|
+
checked: n = !1,
|
|
1245
|
+
required: i,
|
|
1246
|
+
disabled: s,
|
|
1247
|
+
value: a = "on",
|
|
1248
|
+
onCheck: d,
|
|
1249
|
+
form: u,
|
|
1250
|
+
...m
|
|
1251
|
+
} = e, [f, h] = l.useState(null), v = _(o, (g) => h(g)), S = l.useRef(!1), p = f ? u || !!f.closest("form") : !0;
|
|
1252
|
+
return /* @__PURE__ */ R(An, { scope: t, checked: n, disabled: s, children: [
|
|
1253
|
+
/* @__PURE__ */ c(
|
|
1254
|
+
E.button,
|
|
1255
|
+
{
|
|
1256
|
+
type: "button",
|
|
1257
|
+
role: "radio",
|
|
1258
|
+
"aria-checked": n,
|
|
1259
|
+
"data-state": Gt(n),
|
|
1260
|
+
"data-disabled": s ? "" : void 0,
|
|
1261
|
+
disabled: s,
|
|
1262
|
+
value: a,
|
|
1263
|
+
...m,
|
|
1264
|
+
ref: v,
|
|
1265
|
+
onClick: N(e.onClick, (g) => {
|
|
1266
|
+
n || d?.(), p && (S.current = g.isPropagationStopped(), S.current || g.stopPropagation());
|
|
1267
|
+
})
|
|
1268
|
+
}
|
|
1269
|
+
),
|
|
1270
|
+
p && /* @__PURE__ */ c(
|
|
1271
|
+
zt,
|
|
1272
|
+
{
|
|
1273
|
+
control: f,
|
|
1274
|
+
bubbles: !S.current,
|
|
1275
|
+
name: r,
|
|
1276
|
+
value: a,
|
|
1277
|
+
checked: n,
|
|
1278
|
+
required: i,
|
|
1279
|
+
disabled: s,
|
|
1280
|
+
form: u,
|
|
1281
|
+
style: { transform: "translateX(-100%)" }
|
|
1282
|
+
}
|
|
1283
|
+
)
|
|
1284
|
+
] });
|
|
1285
|
+
}
|
|
1286
|
+
);
|
|
1287
|
+
Ft.displayName = ze;
|
|
1288
|
+
var $t = "RadioIndicator", Ut = l.forwardRef(
|
|
1289
|
+
(e, o) => {
|
|
1290
|
+
const { __scopeRadio: t, forceMount: r, ...n } = e, i = On($t, t);
|
|
1291
|
+
return /* @__PURE__ */ c(Ye, { present: r || i.checked, children: /* @__PURE__ */ c(
|
|
1292
|
+
E.span,
|
|
1293
|
+
{
|
|
1294
|
+
"data-state": Gt(i.checked),
|
|
1295
|
+
"data-disabled": i.disabled ? "" : void 0,
|
|
1296
|
+
...n,
|
|
1297
|
+
ref: o
|
|
1298
|
+
}
|
|
1299
|
+
) });
|
|
1300
|
+
}
|
|
1301
|
+
);
|
|
1302
|
+
Ut.displayName = $t;
|
|
1303
|
+
var Bn = "RadioBubbleInput", zt = l.forwardRef(
|
|
1304
|
+
({
|
|
1305
|
+
__scopeRadio: e,
|
|
1306
|
+
control: o,
|
|
1307
|
+
checked: t,
|
|
1308
|
+
bubbles: r = !0,
|
|
1309
|
+
...n
|
|
1310
|
+
}, i) => {
|
|
1311
|
+
const s = l.useRef(null), a = _(s, i), d = fe(t), u = Se(o);
|
|
1312
|
+
return l.useEffect(() => {
|
|
1313
|
+
const m = s.current;
|
|
1314
|
+
if (!m) return;
|
|
1315
|
+
const f = window.HTMLInputElement.prototype, v = Object.getOwnPropertyDescriptor(
|
|
1316
|
+
f,
|
|
1317
|
+
"checked"
|
|
1318
|
+
).set;
|
|
1319
|
+
if (d !== t && v) {
|
|
1320
|
+
const S = new Event("click", { bubbles: r });
|
|
1321
|
+
v.call(m, t), m.dispatchEvent(S);
|
|
1322
|
+
}
|
|
1323
|
+
}, [d, t, r]), /* @__PURE__ */ c(
|
|
1324
|
+
E.input,
|
|
1325
|
+
{
|
|
1326
|
+
type: "radio",
|
|
1327
|
+
"aria-hidden": !0,
|
|
1328
|
+
defaultChecked: t,
|
|
1329
|
+
...n,
|
|
1330
|
+
tabIndex: -1,
|
|
1331
|
+
ref: a,
|
|
1332
|
+
style: {
|
|
1333
|
+
...n.style,
|
|
1334
|
+
...u,
|
|
1335
|
+
position: "absolute",
|
|
1336
|
+
pointerEvents: "none",
|
|
1337
|
+
opacity: 0,
|
|
1338
|
+
margin: 0
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
);
|
|
1344
|
+
zt.displayName = Bn;
|
|
1345
|
+
function Gt(e) {
|
|
1346
|
+
return e ? "checked" : "unchecked";
|
|
1347
|
+
}
|
|
1348
|
+
var Ln = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], Re = "RadioGroup", [Vn] = ae(Re, [
|
|
1349
|
+
Je,
|
|
1350
|
+
Kt
|
|
1351
|
+
]), Wt = Je(), jt = Kt(), [Hn, Kn] = Vn(Re), qt = l.forwardRef(
|
|
1352
|
+
(e, o) => {
|
|
1353
|
+
const {
|
|
1354
|
+
__scopeRadioGroup: t,
|
|
1355
|
+
name: r,
|
|
1356
|
+
defaultValue: n,
|
|
1357
|
+
value: i,
|
|
1358
|
+
required: s = !1,
|
|
1359
|
+
disabled: a = !1,
|
|
1360
|
+
orientation: d,
|
|
1361
|
+
dir: u,
|
|
1362
|
+
loop: m = !0,
|
|
1363
|
+
onValueChange: f,
|
|
1364
|
+
...h
|
|
1365
|
+
} = e, v = Wt(t), S = Ke(u), [p, g] = se({
|
|
1366
|
+
prop: i,
|
|
1367
|
+
defaultProp: n ?? null,
|
|
1368
|
+
onChange: f,
|
|
1369
|
+
caller: Re
|
|
1370
|
+
});
|
|
1371
|
+
return /* @__PURE__ */ c(
|
|
1372
|
+
Hn,
|
|
1373
|
+
{
|
|
1374
|
+
scope: t,
|
|
1375
|
+
name: r,
|
|
1376
|
+
required: s,
|
|
1377
|
+
disabled: a,
|
|
1378
|
+
value: p,
|
|
1379
|
+
onValueChange: g,
|
|
1380
|
+
children: /* @__PURE__ */ c(
|
|
1381
|
+
xo,
|
|
1382
|
+
{
|
|
1383
|
+
asChild: !0,
|
|
1384
|
+
...v,
|
|
1385
|
+
orientation: d,
|
|
1386
|
+
dir: S,
|
|
1387
|
+
loop: m,
|
|
1388
|
+
children: /* @__PURE__ */ c(
|
|
1389
|
+
E.div,
|
|
1390
|
+
{
|
|
1391
|
+
role: "radiogroup",
|
|
1392
|
+
"aria-required": s,
|
|
1393
|
+
"aria-orientation": d,
|
|
1394
|
+
"data-disabled": a ? "" : void 0,
|
|
1395
|
+
dir: S,
|
|
1396
|
+
...h,
|
|
1397
|
+
ref: o
|
|
1398
|
+
}
|
|
1399
|
+
)
|
|
1400
|
+
}
|
|
1401
|
+
)
|
|
1402
|
+
}
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1405
|
+
);
|
|
1406
|
+
qt.displayName = Re;
|
|
1407
|
+
var Yt = "RadioGroupItem", Xt = l.forwardRef(
|
|
1408
|
+
(e, o) => {
|
|
1409
|
+
const { __scopeRadioGroup: t, disabled: r, ...n } = e, i = Kn(Yt, t), s = i.disabled || r, a = Wt(t), d = jt(t), u = l.useRef(null), m = _(o, u), f = i.value === n.value, h = l.useRef(!1);
|
|
1410
|
+
return l.useEffect(() => {
|
|
1411
|
+
const v = (p) => {
|
|
1412
|
+
Ln.includes(p.key) && (h.current = !0);
|
|
1413
|
+
}, S = () => h.current = !1;
|
|
1414
|
+
return document.addEventListener("keydown", v), document.addEventListener("keyup", S), () => {
|
|
1415
|
+
document.removeEventListener("keydown", v), document.removeEventListener("keyup", S);
|
|
1416
|
+
};
|
|
1417
|
+
}, []), /* @__PURE__ */ c(
|
|
1418
|
+
wo,
|
|
1419
|
+
{
|
|
1420
|
+
asChild: !0,
|
|
1421
|
+
...a,
|
|
1422
|
+
focusable: !s,
|
|
1423
|
+
active: f,
|
|
1424
|
+
children: /* @__PURE__ */ c(
|
|
1425
|
+
Ft,
|
|
1426
|
+
{
|
|
1427
|
+
disabled: s,
|
|
1428
|
+
required: i.required,
|
|
1429
|
+
checked: f,
|
|
1430
|
+
...d,
|
|
1431
|
+
...n,
|
|
1432
|
+
name: i.name,
|
|
1433
|
+
ref: m,
|
|
1434
|
+
onCheck: () => i.onValueChange(n.value),
|
|
1435
|
+
onKeyDown: N((v) => {
|
|
1436
|
+
v.key === "Enter" && v.preventDefault();
|
|
1437
|
+
}),
|
|
1438
|
+
onFocus: N(n.onFocus, () => {
|
|
1439
|
+
h.current && u.current?.click();
|
|
1440
|
+
})
|
|
1441
|
+
}
|
|
1442
|
+
)
|
|
1443
|
+
}
|
|
1444
|
+
);
|
|
1445
|
+
}
|
|
1446
|
+
);
|
|
1447
|
+
Xt.displayName = Yt;
|
|
1448
|
+
var Fn = "RadioGroupIndicator", Zt = l.forwardRef(
|
|
1449
|
+
(e, o) => {
|
|
1450
|
+
const { __scopeRadioGroup: t, ...r } = e, n = jt(t);
|
|
1451
|
+
return /* @__PURE__ */ c(Ut, { ...n, ...r, ref: o });
|
|
1452
|
+
}
|
|
1453
|
+
);
|
|
1454
|
+
Zt.displayName = Fn;
|
|
1455
|
+
var $n = qt, Un = Xt, zn = Zt, Jt = ["PageUp", "PageDown"], Qt = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], eo = {
|
|
1456
|
+
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
1457
|
+
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
1458
|
+
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
1459
|
+
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
1460
|
+
}, le = "Slider", [Le, Gn, Wn] = Ze(le), [to] = ae(le, [
|
|
1461
|
+
Wn
|
|
1462
|
+
]), [jn, Ne] = to(le), oo = l.forwardRef(
|
|
1463
|
+
(e, o) => {
|
|
1464
|
+
const {
|
|
1465
|
+
name: t,
|
|
1466
|
+
min: r = 0,
|
|
1467
|
+
max: n = 100,
|
|
1468
|
+
step: i = 1,
|
|
1469
|
+
orientation: s = "horizontal",
|
|
1470
|
+
disabled: a = !1,
|
|
1471
|
+
minStepsBetweenThumbs: d = 0,
|
|
1472
|
+
defaultValue: u = [r],
|
|
1473
|
+
value: m,
|
|
1474
|
+
onValueChange: f = () => {
|
|
1475
|
+
},
|
|
1476
|
+
onValueCommit: h = () => {
|
|
1477
|
+
},
|
|
1478
|
+
inverted: v = !1,
|
|
1479
|
+
form: S,
|
|
1480
|
+
...p
|
|
1481
|
+
} = e, g = l.useRef(/* @__PURE__ */ new Set()), b = l.useRef(0), w = s === "horizontal" ? qn : Yn, [C = [], M] = se({
|
|
1482
|
+
prop: m,
|
|
1483
|
+
defaultProp: u,
|
|
1484
|
+
onChange: (I) => {
|
|
1485
|
+
[...g.current][b.current]?.focus(), f(I);
|
|
1486
|
+
}
|
|
1487
|
+
}), W = l.useRef(C);
|
|
1488
|
+
function D(I) {
|
|
1489
|
+
const L = er(C, I);
|
|
1490
|
+
K(I, L);
|
|
1491
|
+
}
|
|
1492
|
+
function U(I) {
|
|
1493
|
+
K(I, b.current);
|
|
1494
|
+
}
|
|
1495
|
+
function Y() {
|
|
1496
|
+
const I = W.current[b.current];
|
|
1497
|
+
C[b.current] !== I && h(C);
|
|
1498
|
+
}
|
|
1499
|
+
function K(I, L, { commit: z } = { commit: !1 }) {
|
|
1500
|
+
const G = rr(i), F = sr(Math.round((I - r) / i) * i + r, G), A = he(F, [r, n]);
|
|
1501
|
+
M((V = []) => {
|
|
1502
|
+
const H = Jn(V, A, L);
|
|
1503
|
+
if (nr(H, d * i)) {
|
|
1504
|
+
b.current = H.indexOf(A);
|
|
1505
|
+
const j = String(H) !== String(V);
|
|
1506
|
+
return j && z && h(H), j ? H : V;
|
|
1507
|
+
} else
|
|
1508
|
+
return V;
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
return /* @__PURE__ */ c(
|
|
1512
|
+
jn,
|
|
1513
|
+
{
|
|
1514
|
+
scope: e.__scopeSlider,
|
|
1515
|
+
name: t,
|
|
1516
|
+
disabled: a,
|
|
1517
|
+
min: r,
|
|
1518
|
+
max: n,
|
|
1519
|
+
valueIndexToChangeRef: b,
|
|
1520
|
+
thumbs: g.current,
|
|
1521
|
+
values: C,
|
|
1522
|
+
orientation: s,
|
|
1523
|
+
form: S,
|
|
1524
|
+
children: /* @__PURE__ */ c(Le.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ c(Le.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ c(
|
|
1525
|
+
w,
|
|
1526
|
+
{
|
|
1527
|
+
"aria-disabled": a,
|
|
1528
|
+
"data-disabled": a ? "" : void 0,
|
|
1529
|
+
...p,
|
|
1530
|
+
ref: o,
|
|
1531
|
+
onPointerDown: N(p.onPointerDown, () => {
|
|
1532
|
+
a || (W.current = C);
|
|
1533
|
+
}),
|
|
1534
|
+
min: r,
|
|
1535
|
+
max: n,
|
|
1536
|
+
inverted: v,
|
|
1537
|
+
onSlideStart: a ? void 0 : D,
|
|
1538
|
+
onSlideMove: a ? void 0 : U,
|
|
1539
|
+
onSlideEnd: a ? void 0 : Y,
|
|
1540
|
+
onHomeKeyDown: () => !a && K(r, 0, { commit: !0 }),
|
|
1541
|
+
onEndKeyDown: () => !a && K(n, C.length - 1, { commit: !0 }),
|
|
1542
|
+
onStepKeyDown: ({ event: I, direction: L }) => {
|
|
1543
|
+
if (!a) {
|
|
1544
|
+
const F = Jt.includes(I.key) || I.shiftKey && Qt.includes(I.key) ? 10 : 1, A = b.current, V = C[A], H = i * F * L;
|
|
1545
|
+
K(V + H, A, { commit: !0 });
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
) }) })
|
|
1550
|
+
}
|
|
1551
|
+
);
|
|
1552
|
+
}
|
|
1553
|
+
);
|
|
1554
|
+
oo.displayName = le;
|
|
1555
|
+
var [no, ro] = to(le, {
|
|
1556
|
+
startEdge: "left",
|
|
1557
|
+
endEdge: "right",
|
|
1558
|
+
size: "width",
|
|
1559
|
+
direction: 1
|
|
1560
|
+
}), qn = l.forwardRef(
|
|
1561
|
+
(e, o) => {
|
|
1562
|
+
const {
|
|
1563
|
+
min: t,
|
|
1564
|
+
max: r,
|
|
1565
|
+
dir: n,
|
|
1566
|
+
inverted: i,
|
|
1567
|
+
onSlideStart: s,
|
|
1568
|
+
onSlideMove: a,
|
|
1569
|
+
onSlideEnd: d,
|
|
1570
|
+
onStepKeyDown: u,
|
|
1571
|
+
...m
|
|
1572
|
+
} = e, [f, h] = l.useState(null), v = _(o, (w) => h(w)), S = l.useRef(void 0), p = Ke(n), g = p === "ltr", b = g && !i || !g && i;
|
|
1573
|
+
function x(w) {
|
|
1574
|
+
const C = S.current || f.getBoundingClientRect(), M = [0, C.width], D = Ge(M, b ? [t, r] : [r, t]);
|
|
1575
|
+
return S.current = C, D(w - C.left);
|
|
1576
|
+
}
|
|
1577
|
+
return /* @__PURE__ */ c(
|
|
1578
|
+
no,
|
|
1579
|
+
{
|
|
1580
|
+
scope: e.__scopeSlider,
|
|
1581
|
+
startEdge: b ? "left" : "right",
|
|
1582
|
+
endEdge: b ? "right" : "left",
|
|
1583
|
+
direction: b ? 1 : -1,
|
|
1584
|
+
size: "width",
|
|
1585
|
+
children: /* @__PURE__ */ c(
|
|
1586
|
+
so,
|
|
1587
|
+
{
|
|
1588
|
+
dir: p,
|
|
1589
|
+
"data-orientation": "horizontal",
|
|
1590
|
+
...m,
|
|
1591
|
+
ref: v,
|
|
1592
|
+
style: {
|
|
1593
|
+
...m.style,
|
|
1594
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
1595
|
+
},
|
|
1596
|
+
onSlideStart: (w) => {
|
|
1597
|
+
const C = x(w.clientX);
|
|
1598
|
+
s?.(C);
|
|
1599
|
+
},
|
|
1600
|
+
onSlideMove: (w) => {
|
|
1601
|
+
const C = x(w.clientX);
|
|
1602
|
+
a?.(C);
|
|
1603
|
+
},
|
|
1604
|
+
onSlideEnd: () => {
|
|
1605
|
+
S.current = void 0, d?.();
|
|
1606
|
+
},
|
|
1607
|
+
onStepKeyDown: (w) => {
|
|
1608
|
+
const M = eo[b ? "from-left" : "from-right"].includes(w.key);
|
|
1609
|
+
u?.({ event: w, direction: M ? -1 : 1 });
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
)
|
|
1613
|
+
}
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1616
|
+
), Yn = l.forwardRef(
|
|
1617
|
+
(e, o) => {
|
|
1618
|
+
const {
|
|
1619
|
+
min: t,
|
|
1620
|
+
max: r,
|
|
1621
|
+
inverted: n,
|
|
1622
|
+
onSlideStart: i,
|
|
1623
|
+
onSlideMove: s,
|
|
1624
|
+
onSlideEnd: a,
|
|
1625
|
+
onStepKeyDown: d,
|
|
1626
|
+
...u
|
|
1627
|
+
} = e, m = l.useRef(null), f = _(o, m), h = l.useRef(void 0), v = !n;
|
|
1628
|
+
function S(p) {
|
|
1629
|
+
const g = h.current || m.current.getBoundingClientRect(), b = [0, g.height], w = Ge(b, v ? [r, t] : [t, r]);
|
|
1630
|
+
return h.current = g, w(p - g.top);
|
|
1631
|
+
}
|
|
1632
|
+
return /* @__PURE__ */ c(
|
|
1633
|
+
no,
|
|
1634
|
+
{
|
|
1635
|
+
scope: e.__scopeSlider,
|
|
1636
|
+
startEdge: v ? "bottom" : "top",
|
|
1637
|
+
endEdge: v ? "top" : "bottom",
|
|
1638
|
+
size: "height",
|
|
1639
|
+
direction: v ? 1 : -1,
|
|
1640
|
+
children: /* @__PURE__ */ c(
|
|
1641
|
+
so,
|
|
1642
|
+
{
|
|
1643
|
+
"data-orientation": "vertical",
|
|
1644
|
+
...u,
|
|
1645
|
+
ref: f,
|
|
1646
|
+
style: {
|
|
1647
|
+
...u.style,
|
|
1648
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
1649
|
+
},
|
|
1650
|
+
onSlideStart: (p) => {
|
|
1651
|
+
const g = S(p.clientY);
|
|
1652
|
+
i?.(g);
|
|
1653
|
+
},
|
|
1654
|
+
onSlideMove: (p) => {
|
|
1655
|
+
const g = S(p.clientY);
|
|
1656
|
+
s?.(g);
|
|
1657
|
+
},
|
|
1658
|
+
onSlideEnd: () => {
|
|
1659
|
+
h.current = void 0, a?.();
|
|
1660
|
+
},
|
|
1661
|
+
onStepKeyDown: (p) => {
|
|
1662
|
+
const b = eo[v ? "from-bottom" : "from-top"].includes(p.key);
|
|
1663
|
+
d?.({ event: p, direction: b ? -1 : 1 });
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
)
|
|
1667
|
+
}
|
|
1668
|
+
);
|
|
1669
|
+
}
|
|
1670
|
+
), so = l.forwardRef(
|
|
1671
|
+
(e, o) => {
|
|
1672
|
+
const {
|
|
1673
|
+
__scopeSlider: t,
|
|
1674
|
+
onSlideStart: r,
|
|
1675
|
+
onSlideMove: n,
|
|
1676
|
+
onSlideEnd: i,
|
|
1677
|
+
onHomeKeyDown: s,
|
|
1678
|
+
onEndKeyDown: a,
|
|
1679
|
+
onStepKeyDown: d,
|
|
1680
|
+
...u
|
|
1681
|
+
} = e, m = Ne(le, t);
|
|
1682
|
+
return /* @__PURE__ */ c(
|
|
1683
|
+
E.span,
|
|
1684
|
+
{
|
|
1685
|
+
...u,
|
|
1686
|
+
ref: o,
|
|
1687
|
+
onKeyDown: N(e.onKeyDown, (f) => {
|
|
1688
|
+
f.key === "Home" ? (s(f), f.preventDefault()) : f.key === "End" ? (a(f), f.preventDefault()) : Jt.concat(Qt).includes(f.key) && (d(f), f.preventDefault());
|
|
1689
|
+
}),
|
|
1690
|
+
onPointerDown: N(e.onPointerDown, (f) => {
|
|
1691
|
+
const h = f.target;
|
|
1692
|
+
h.setPointerCapture(f.pointerId), f.preventDefault(), m.thumbs.has(h) ? h.focus() : r(f);
|
|
1693
|
+
}),
|
|
1694
|
+
onPointerMove: N(e.onPointerMove, (f) => {
|
|
1695
|
+
f.target.hasPointerCapture(f.pointerId) && n(f);
|
|
1696
|
+
}),
|
|
1697
|
+
onPointerUp: N(e.onPointerUp, (f) => {
|
|
1698
|
+
const h = f.target;
|
|
1699
|
+
h.hasPointerCapture(f.pointerId) && (h.releasePointerCapture(f.pointerId), i(f));
|
|
1700
|
+
})
|
|
1701
|
+
}
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
), io = "SliderTrack", ao = l.forwardRef(
|
|
1705
|
+
(e, o) => {
|
|
1706
|
+
const { __scopeSlider: t, ...r } = e, n = Ne(io, t);
|
|
1707
|
+
return /* @__PURE__ */ c(
|
|
1708
|
+
E.span,
|
|
1709
|
+
{
|
|
1710
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
1711
|
+
"data-orientation": n.orientation,
|
|
1712
|
+
...r,
|
|
1713
|
+
ref: o
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
}
|
|
1717
|
+
);
|
|
1718
|
+
ao.displayName = io;
|
|
1719
|
+
var Ve = "SliderRange", co = l.forwardRef(
|
|
1720
|
+
(e, o) => {
|
|
1721
|
+
const { __scopeSlider: t, ...r } = e, n = Ne(Ve, t), i = ro(Ve, t), s = l.useRef(null), a = _(o, s), d = n.values.length, u = n.values.map(
|
|
1722
|
+
(h) => fo(h, n.min, n.max)
|
|
1723
|
+
), m = d > 1 ? Math.min(...u) : 0, f = 100 - Math.max(...u);
|
|
1724
|
+
return /* @__PURE__ */ c(
|
|
1725
|
+
E.span,
|
|
1726
|
+
{
|
|
1727
|
+
"data-orientation": n.orientation,
|
|
1728
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
1729
|
+
...r,
|
|
1730
|
+
ref: a,
|
|
1731
|
+
style: {
|
|
1732
|
+
...e.style,
|
|
1733
|
+
[i.startEdge]: m + "%",
|
|
1734
|
+
[i.endEdge]: f + "%"
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
);
|
|
1738
|
+
}
|
|
1739
|
+
);
|
|
1740
|
+
co.displayName = Ve;
|
|
1741
|
+
var He = "SliderThumb", lo = l.forwardRef(
|
|
1742
|
+
(e, o) => {
|
|
1743
|
+
const t = Gn(e.__scopeSlider), [r, n] = l.useState(null), i = _(o, (a) => n(a)), s = l.useMemo(
|
|
1744
|
+
() => r ? t().findIndex((a) => a.ref.current === r) : -1,
|
|
1745
|
+
[t, r]
|
|
1746
|
+
);
|
|
1747
|
+
return /* @__PURE__ */ c(Xn, { ...e, ref: i, index: s });
|
|
1748
|
+
}
|
|
1749
|
+
), Xn = l.forwardRef(
|
|
1750
|
+
(e, o) => {
|
|
1751
|
+
const { __scopeSlider: t, index: r, name: n, ...i } = e, s = Ne(He, t), a = ro(He, t), [d, u] = l.useState(null), m = _(o, (x) => u(x)), f = d ? s.form || !!d.closest("form") : !0, h = Se(d), v = s.values[r], S = v === void 0 ? 0 : fo(v, s.min, s.max), p = Qn(r, s.values.length), g = h?.[a.size], b = g ? tr(g, S, a.direction) : 0;
|
|
1752
|
+
return l.useEffect(() => {
|
|
1753
|
+
if (d)
|
|
1754
|
+
return s.thumbs.add(d), () => {
|
|
1755
|
+
s.thumbs.delete(d);
|
|
1756
|
+
};
|
|
1757
|
+
}, [d, s.thumbs]), /* @__PURE__ */ R(
|
|
1758
|
+
"span",
|
|
1759
|
+
{
|
|
1760
|
+
style: {
|
|
1761
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
1762
|
+
position: "absolute",
|
|
1763
|
+
[a.startEdge]: `calc(${S}% + ${b}px)`
|
|
1764
|
+
},
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ c(Le.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ c(
|
|
1767
|
+
E.span,
|
|
1768
|
+
{
|
|
1769
|
+
role: "slider",
|
|
1770
|
+
"aria-label": e["aria-label"] || p,
|
|
1771
|
+
"aria-valuemin": s.min,
|
|
1772
|
+
"aria-valuenow": v,
|
|
1773
|
+
"aria-valuemax": s.max,
|
|
1774
|
+
"aria-orientation": s.orientation,
|
|
1775
|
+
"data-orientation": s.orientation,
|
|
1776
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
1777
|
+
tabIndex: s.disabled ? void 0 : 0,
|
|
1778
|
+
...i,
|
|
1779
|
+
ref: m,
|
|
1780
|
+
style: v === void 0 ? { display: "none" } : e.style,
|
|
1781
|
+
onFocus: N(e.onFocus, () => {
|
|
1782
|
+
s.valueIndexToChangeRef.current = r;
|
|
1783
|
+
})
|
|
1784
|
+
}
|
|
1785
|
+
) }),
|
|
1786
|
+
f && /* @__PURE__ */ c(
|
|
1787
|
+
uo,
|
|
1788
|
+
{
|
|
1789
|
+
name: n ?? (s.name ? s.name + (s.values.length > 1 ? "[]" : "") : void 0),
|
|
1790
|
+
form: s.form,
|
|
1791
|
+
value: v
|
|
1792
|
+
},
|
|
1793
|
+
r
|
|
1794
|
+
)
|
|
1795
|
+
]
|
|
1796
|
+
}
|
|
1797
|
+
);
|
|
1798
|
+
}
|
|
1799
|
+
);
|
|
1800
|
+
lo.displayName = He;
|
|
1801
|
+
var Zn = "RadioBubbleInput", uo = l.forwardRef(
|
|
1802
|
+
({ __scopeSlider: e, value: o, ...t }, r) => {
|
|
1803
|
+
const n = l.useRef(null), i = _(n, r), s = fe(o);
|
|
1804
|
+
return l.useEffect(() => {
|
|
1805
|
+
const a = n.current;
|
|
1806
|
+
if (!a) return;
|
|
1807
|
+
const d = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(d, "value").set;
|
|
1808
|
+
if (s !== o && m) {
|
|
1809
|
+
const f = new Event("input", { bubbles: !0 });
|
|
1810
|
+
m.call(a, o), a.dispatchEvent(f);
|
|
1811
|
+
}
|
|
1812
|
+
}, [s, o]), /* @__PURE__ */ c(
|
|
1813
|
+
E.input,
|
|
1814
|
+
{
|
|
1815
|
+
style: { display: "none" },
|
|
1816
|
+
...t,
|
|
1817
|
+
ref: i,
|
|
1818
|
+
defaultValue: o
|
|
1819
|
+
}
|
|
1820
|
+
);
|
|
1821
|
+
}
|
|
1822
|
+
);
|
|
1823
|
+
uo.displayName = Zn;
|
|
1824
|
+
function Jn(e = [], o, t) {
|
|
1825
|
+
const r = [...e];
|
|
1826
|
+
return r[t] = o, r.sort((n, i) => n - i);
|
|
1827
|
+
}
|
|
1828
|
+
function fo(e, o, t) {
|
|
1829
|
+
const i = 100 / (t - o) * (e - o);
|
|
1830
|
+
return he(i, [0, 100]);
|
|
1831
|
+
}
|
|
1832
|
+
function Qn(e, o) {
|
|
1833
|
+
return o > 2 ? `Value ${e + 1} of ${o}` : o === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
1834
|
+
}
|
|
1835
|
+
function er(e, o) {
|
|
1836
|
+
if (e.length === 1) return 0;
|
|
1837
|
+
const t = e.map((n) => Math.abs(n - o)), r = Math.min(...t);
|
|
1838
|
+
return t.indexOf(r);
|
|
1839
|
+
}
|
|
1840
|
+
function tr(e, o, t) {
|
|
1841
|
+
const r = e / 2, i = Ge([0, 50], [0, r]);
|
|
1842
|
+
return (r - i(o) * t) * t;
|
|
1843
|
+
}
|
|
1844
|
+
function or(e) {
|
|
1845
|
+
return e.slice(0, -1).map((o, t) => e[t + 1] - o);
|
|
1846
|
+
}
|
|
1847
|
+
function nr(e, o) {
|
|
1848
|
+
if (o > 0) {
|
|
1849
|
+
const t = or(e);
|
|
1850
|
+
return Math.min(...t) >= o;
|
|
1851
|
+
}
|
|
1852
|
+
return !0;
|
|
1853
|
+
}
|
|
1854
|
+
function Ge(e, o) {
|
|
1855
|
+
return (t) => {
|
|
1856
|
+
if (e[0] === e[1] || o[0] === o[1]) return o[0];
|
|
1857
|
+
const r = (o[1] - o[0]) / (e[1] - e[0]);
|
|
1858
|
+
return o[0] + r * (t - e[0]);
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
function rr(e) {
|
|
1862
|
+
return (String(e).split(".")[1] || "").length;
|
|
1863
|
+
}
|
|
1864
|
+
function sr(e, o) {
|
|
1865
|
+
const t = Math.pow(10, o);
|
|
1866
|
+
return Math.round(e * t) / t;
|
|
1867
|
+
}
|
|
1868
|
+
var ir = oo, ar = ao, cr = co, lr = lo;
|
|
1869
|
+
function ie({ className: e, ...o }) {
|
|
1870
|
+
return /* @__PURE__ */ c(
|
|
1871
|
+
Ao,
|
|
1872
|
+
{
|
|
1873
|
+
className: P(
|
|
1874
|
+
"text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 block",
|
|
1875
|
+
e
|
|
1876
|
+
),
|
|
1877
|
+
...o
|
|
1878
|
+
}
|
|
1879
|
+
);
|
|
1880
|
+
}
|
|
1881
|
+
function Cr({ label: e, error: o, icon: t, iconPosition: r = "left", prefix: n, suffix: i, className: s, type: a, ...d }) {
|
|
1882
|
+
const u = a === "password", [m, f] = l.useState(!1), h = u ? m ? "text" : "password" : a, v = t && r === "left", S = t && r === "right";
|
|
1883
|
+
return /* @__PURE__ */ R("div", { className: P("flex flex-col gap-1"), children: [
|
|
1884
|
+
e && /* @__PURE__ */ c(ie, { children: e }),
|
|
1885
|
+
/* @__PURE__ */ R(
|
|
1886
|
+
"div",
|
|
1887
|
+
{
|
|
1888
|
+
className: P(
|
|
1889
|
+
"flex items-center gap-2 bg-secondary border rounded-md px-3 text-sm transition-all",
|
|
1890
|
+
"focus-within:border-primary focus-within:ring-2 focus-within:ring-ring",
|
|
1891
|
+
o ? "border-destructive" : "border-border"
|
|
1892
|
+
),
|
|
1893
|
+
children: [
|
|
1894
|
+
v && /* @__PURE__ */ c(t, { size: 16, className: "text-muted-foreground shrink-0" }),
|
|
1895
|
+
n && /* @__PURE__ */ c("span", { className: "text-muted-foreground shrink-0", children: n }),
|
|
1896
|
+
/* @__PURE__ */ c(
|
|
1897
|
+
"input",
|
|
1898
|
+
{
|
|
1899
|
+
type: h,
|
|
1900
|
+
className: P(
|
|
1901
|
+
"flex-1 min-w-0 bg-transparent py-2 text-foreground placeholder:text-muted-foreground outline-none",
|
|
1902
|
+
s
|
|
1903
|
+
),
|
|
1904
|
+
...d
|
|
1905
|
+
}
|
|
1906
|
+
),
|
|
1907
|
+
i && !u && /* @__PURE__ */ c("span", { className: "text-muted-foreground shrink-0", children: i }),
|
|
1908
|
+
S && !u && /* @__PURE__ */ c(t, { size: 16, className: "text-muted-foreground shrink-0" }),
|
|
1909
|
+
u && /* @__PURE__ */ c(
|
|
1910
|
+
"button",
|
|
1911
|
+
{
|
|
1912
|
+
type: "button",
|
|
1913
|
+
onClick: () => f(!m),
|
|
1914
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer shrink-0 flex items-center",
|
|
1915
|
+
children: m ? /* @__PURE__ */ c(ko, { size: 16 }) : /* @__PURE__ */ c(_o, { size: 16 })
|
|
1916
|
+
}
|
|
1917
|
+
)
|
|
1918
|
+
]
|
|
1919
|
+
}
|
|
1920
|
+
),
|
|
1921
|
+
o && /* @__PURE__ */ c("span", { className: "text-xs text-destructive", children: o })
|
|
1922
|
+
] });
|
|
1923
|
+
}
|
|
1924
|
+
function Rr({ label: e, placeholder: o, children: t, className: r, native: n, clearable: i, ...s }) {
|
|
1925
|
+
const { value: a, onValueChange: d, disabled: u } = s, [m, f] = l.useState(0), h = a !== void 0 && a !== "", v = (S) => {
|
|
1926
|
+
S.stopPropagation(), d?.(""), f((p) => p + 1);
|
|
1927
|
+
};
|
|
1928
|
+
if (n) {
|
|
1929
|
+
const { defaultValue: S } = s;
|
|
1930
|
+
return /* @__PURE__ */ R("div", { className: "flex flex-col gap-1", children: [
|
|
1931
|
+
e && /* @__PURE__ */ c(ie, { children: e }),
|
|
1932
|
+
/* @__PURE__ */ R("div", { className: P(
|
|
1933
|
+
"flex items-center gap-2 bg-secondary border border-border rounded-md px-3 text-sm transition-all",
|
|
1934
|
+
"focus-within:border-primary focus-within:ring-2 focus-within:ring-ring",
|
|
1935
|
+
r
|
|
1936
|
+
), children: [
|
|
1937
|
+
/* @__PURE__ */ R(
|
|
1938
|
+
"select",
|
|
1939
|
+
{
|
|
1940
|
+
value: a,
|
|
1941
|
+
defaultValue: S,
|
|
1942
|
+
onChange: d ? (p) => d(p.target.value) : void 0,
|
|
1943
|
+
disabled: u,
|
|
1944
|
+
className: "flex-1 min-w-0 bg-transparent py-2 text-foreground outline-none cursor-pointer appearance-none",
|
|
1945
|
+
children: [
|
|
1946
|
+
o && /* @__PURE__ */ c("option", { value: "", disabled: !i, hidden: !i, children: o }),
|
|
1947
|
+
t
|
|
1948
|
+
]
|
|
1949
|
+
}
|
|
1950
|
+
),
|
|
1951
|
+
i && h ? /* @__PURE__ */ c("button", { type: "button", onClick: v, className: "text-muted-foreground hover:text-foreground cursor-pointer bg-transparent border-none p-0 shrink-0", children: /* @__PURE__ */ c(We, { size: 14 }) }) : /* @__PURE__ */ c(je, { size: 16, className: "text-muted-foreground shrink-0 pointer-events-none" })
|
|
1952
|
+
] })
|
|
1953
|
+
] });
|
|
1954
|
+
}
|
|
1955
|
+
return /* @__PURE__ */ R("div", { className: "flex flex-col gap-1", children: [
|
|
1956
|
+
e && /* @__PURE__ */ c(ie, { children: e }),
|
|
1957
|
+
/* @__PURE__ */ R("div", { className: "relative", children: [
|
|
1958
|
+
/* @__PURE__ */ R(vn, { ...s, value: h ? a : void 0, children: [
|
|
1959
|
+
/* @__PURE__ */ R(
|
|
1960
|
+
Sn,
|
|
1961
|
+
{
|
|
1962
|
+
className: P(
|
|
1963
|
+
"flex items-center gap-2 w-full bg-secondary border border-border rounded-md px-3 py-2 text-sm text-foreground transition-all cursor-pointer",
|
|
1964
|
+
"focus:border-primary focus:ring-2 focus:ring-ring",
|
|
1965
|
+
"data-[placeholder]:text-muted-foreground",
|
|
1966
|
+
i && h ? "pr-8" : "",
|
|
1967
|
+
r
|
|
1968
|
+
),
|
|
1969
|
+
children: [
|
|
1970
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-left truncate", children: /* @__PURE__ */ c(bn, { placeholder: o }) }),
|
|
1971
|
+
!(i && h) && /* @__PURE__ */ c(xn, { children: /* @__PURE__ */ c(je, { size: 16, className: "text-muted-foreground" }) })
|
|
1972
|
+
]
|
|
1973
|
+
}
|
|
1974
|
+
),
|
|
1975
|
+
/* @__PURE__ */ c(wn, { children: /* @__PURE__ */ c(
|
|
1976
|
+
yn,
|
|
1977
|
+
{
|
|
1978
|
+
position: "popper",
|
|
1979
|
+
sideOffset: 4,
|
|
1980
|
+
className: P(
|
|
1981
|
+
"z-50 max-h-[300px] min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md border border-border bg-card/95 backdrop-blur-md shadow-lg",
|
|
1982
|
+
"animate-in fade-in-0 zoom-in-95"
|
|
1983
|
+
),
|
|
1984
|
+
children: /* @__PURE__ */ c(Cn, { className: "p-1", children: t })
|
|
1985
|
+
}
|
|
1986
|
+
) })
|
|
1987
|
+
] }, m),
|
|
1988
|
+
i && h && /* @__PURE__ */ c(
|
|
1989
|
+
"button",
|
|
1990
|
+
{
|
|
1991
|
+
type: "button",
|
|
1992
|
+
onClick: v,
|
|
1993
|
+
disabled: u,
|
|
1994
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground cursor-pointer bg-transparent border-none rounded-sm transition-colors",
|
|
1995
|
+
children: /* @__PURE__ */ c(We, { size: 14 })
|
|
1996
|
+
}
|
|
1997
|
+
)
|
|
1998
|
+
] })
|
|
1999
|
+
] });
|
|
2000
|
+
}
|
|
2001
|
+
function Nr({ children: e, className: o, ...t }) {
|
|
2002
|
+
return /* @__PURE__ */ R(
|
|
2003
|
+
Pn,
|
|
2004
|
+
{
|
|
2005
|
+
className: P(
|
|
2006
|
+
"flex items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground cursor-pointer select-none outline-none transition-colors",
|
|
2007
|
+
"data-[highlighted]:bg-primary/10 data-[highlighted]:text-foreground",
|
|
2008
|
+
"data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",
|
|
2009
|
+
o
|
|
2010
|
+
),
|
|
2011
|
+
...t,
|
|
2012
|
+
children: [
|
|
2013
|
+
/* @__PURE__ */ c(En, { children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: e }) }),
|
|
2014
|
+
/* @__PURE__ */ c(In, { children: /* @__PURE__ */ c(Qe, { size: 14, className: "text-primary shrink-0" }) })
|
|
2015
|
+
]
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
function Pr({ children: e, label: o, ...t }) {
|
|
2020
|
+
return /* @__PURE__ */ R(Rn, { ...t, children: [
|
|
2021
|
+
o && /* @__PURE__ */ c(Nn, { className: "px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: o }),
|
|
2022
|
+
e
|
|
2023
|
+
] });
|
|
2024
|
+
}
|
|
2025
|
+
function Er({ label: e, description: o, checked: t, onChange: r, disabled: n, labelPosition: i = "right", className: s }) {
|
|
2026
|
+
const a = /* @__PURE__ */ c(
|
|
2027
|
+
Ho,
|
|
2028
|
+
{
|
|
2029
|
+
checked: t,
|
|
2030
|
+
onCheckedChange: r,
|
|
2031
|
+
disabled: n,
|
|
2032
|
+
className: P(
|
|
2033
|
+
"relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
2034
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
2035
|
+
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-secondary",
|
|
2036
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
2037
|
+
),
|
|
2038
|
+
children: /* @__PURE__ */ c(
|
|
2039
|
+
Ko,
|
|
2040
|
+
{
|
|
2041
|
+
className: P(
|
|
2042
|
+
"pointer-events-none block h-4 w-4 rounded-full shadow-lg transition-transform",
|
|
2043
|
+
"data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary-foreground",
|
|
2044
|
+
"data-[state=unchecked]:translate-x-0 data-[state=unchecked]:bg-muted-foreground"
|
|
2045
|
+
)
|
|
2046
|
+
}
|
|
2047
|
+
)
|
|
2048
|
+
}
|
|
2049
|
+
), d = e || o ? /* @__PURE__ */ R("div", { className: "flex flex-col gap-0.5", children: [
|
|
2050
|
+
e && /* @__PURE__ */ c("span", { className: P("text-sm text-foreground", n && "opacity-50"), children: e }),
|
|
2051
|
+
o && /* @__PURE__ */ c("span", { className: P("text-xs text-muted-foreground", n && "opacity-50"), children: o })
|
|
2052
|
+
] }) : null;
|
|
2053
|
+
return /* @__PURE__ */ R("label", { className: P("inline-flex items-center gap-3", n ? "cursor-not-allowed" : "cursor-pointer", s), children: [
|
|
2054
|
+
i === "left" && d,
|
|
2055
|
+
a,
|
|
2056
|
+
i === "right" && d
|
|
2057
|
+
] });
|
|
2058
|
+
}
|
|
2059
|
+
function Ir({ label: e, description: o, checked: t, onChange: r, disabled: n, labelPosition: i = "right", className: s }) {
|
|
2060
|
+
const a = /* @__PURE__ */ c(
|
|
2061
|
+
At,
|
|
2062
|
+
{
|
|
2063
|
+
checked: t,
|
|
2064
|
+
onCheckedChange: r,
|
|
2065
|
+
disabled: n,
|
|
2066
|
+
className: P(
|
|
2067
|
+
"mt-0.5 h-4 w-4 shrink-0 rounded-sm border border-border bg-secondary transition-colors",
|
|
2068
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
2069
|
+
"data-[state=checked]:bg-primary data-[state=checked]:border-primary",
|
|
2070
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
2071
|
+
),
|
|
2072
|
+
children: /* @__PURE__ */ c(Bt, { className: "flex items-center justify-center text-primary-foreground", children: /* @__PURE__ */ c(Qe, { size: 12, strokeWidth: 3 }) })
|
|
2073
|
+
}
|
|
2074
|
+
), d = e || o ? /* @__PURE__ */ R("div", { className: "flex flex-col gap-0.5", children: [
|
|
2075
|
+
e && /* @__PURE__ */ c("span", { className: P("text-sm text-foreground", n && "opacity-50"), children: e }),
|
|
2076
|
+
o && /* @__PURE__ */ c("span", { className: P("text-xs text-muted-foreground", n && "opacity-50"), children: o })
|
|
2077
|
+
] }) : null;
|
|
2078
|
+
return /* @__PURE__ */ R("label", { className: P("inline-flex items-start gap-3", n ? "cursor-not-allowed" : "cursor-pointer", s), children: [
|
|
2079
|
+
i === "left" && d,
|
|
2080
|
+
a,
|
|
2081
|
+
i === "right" && d
|
|
2082
|
+
] });
|
|
2083
|
+
}
|
|
2084
|
+
function kr({ label: e, value: o, onValueChange: t, disabled: r, className: n, children: i }) {
|
|
2085
|
+
return /* @__PURE__ */ R("div", { className: "flex flex-col gap-1", children: [
|
|
2086
|
+
e && /* @__PURE__ */ c(ie, { children: e }),
|
|
2087
|
+
/* @__PURE__ */ c(
|
|
2088
|
+
$n,
|
|
2089
|
+
{
|
|
2090
|
+
value: o,
|
|
2091
|
+
onValueChange: t,
|
|
2092
|
+
disabled: r,
|
|
2093
|
+
className: P("flex flex-col gap-2", n),
|
|
2094
|
+
children: i
|
|
2095
|
+
}
|
|
2096
|
+
)
|
|
2097
|
+
] });
|
|
2098
|
+
}
|
|
2099
|
+
function _r({ value: e, label: o, description: t, disabled: r, className: n }) {
|
|
2100
|
+
return /* @__PURE__ */ R("label", { className: P("inline-flex items-start gap-3", r ? "cursor-not-allowed" : "cursor-pointer", n), children: [
|
|
2101
|
+
/* @__PURE__ */ c(
|
|
2102
|
+
Un,
|
|
2103
|
+
{
|
|
2104
|
+
value: e,
|
|
2105
|
+
disabled: r,
|
|
2106
|
+
className: P(
|
|
2107
|
+
"mt-0.5 h-4 w-4 shrink-0 rounded-full border border-border bg-secondary transition-colors",
|
|
2108
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
2109
|
+
"data-[state=checked]:border-primary",
|
|
2110
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
2111
|
+
),
|
|
2112
|
+
children: /* @__PURE__ */ c(zn, { className: "flex items-center justify-center", children: /* @__PURE__ */ c("span", { className: "block h-2 w-2 rounded-full bg-primary" }) })
|
|
2113
|
+
}
|
|
2114
|
+
),
|
|
2115
|
+
(o || t) && /* @__PURE__ */ R("div", { className: "flex flex-col gap-0.5", children: [
|
|
2116
|
+
o && /* @__PURE__ */ c("span", { className: P("text-sm text-foreground", r && "opacity-50"), children: o }),
|
|
2117
|
+
t && /* @__PURE__ */ c("span", { className: P("text-xs text-muted-foreground", r && "opacity-50"), children: t })
|
|
2118
|
+
] })
|
|
2119
|
+
] });
|
|
2120
|
+
}
|
|
2121
|
+
function Tr({ label: e, value: o, onValueChange: t, min: r = 0, max: n = 100, step: i = 1, disabled: s, renderValue: a, className: d, ...u }) {
|
|
2122
|
+
const m = a || String, f = o !== void 0 ? o.length > 1 ? `${m(o[0])} – ${m(o[1])}` : m(o[0]) : null;
|
|
2123
|
+
return /* @__PURE__ */ R("div", { className: P("flex flex-col gap-2", d), children: [
|
|
2124
|
+
(e || f) && /* @__PURE__ */ R("div", { className: "flex items-center justify-between", children: [
|
|
2125
|
+
e && /* @__PURE__ */ c(ie, { children: e }),
|
|
2126
|
+
f && /* @__PURE__ */ c("span", { className: "text-sm text-muted-foreground font-mono", children: f })
|
|
2127
|
+
] }),
|
|
2128
|
+
/* @__PURE__ */ R(
|
|
2129
|
+
ir,
|
|
2130
|
+
{
|
|
2131
|
+
value: o,
|
|
2132
|
+
onValueChange: t,
|
|
2133
|
+
min: r,
|
|
2134
|
+
max: n,
|
|
2135
|
+
step: i,
|
|
2136
|
+
disabled: s,
|
|
2137
|
+
className: P(
|
|
2138
|
+
"relative flex w-full touch-none select-none items-center",
|
|
2139
|
+
s && "opacity-50 cursor-not-allowed"
|
|
2140
|
+
),
|
|
2141
|
+
...u,
|
|
2142
|
+
children: [
|
|
2143
|
+
/* @__PURE__ */ c(ar, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ c(cr, { className: "absolute h-full bg-primary" }) }),
|
|
2144
|
+
(o || [0]).map((h, v) => /* @__PURE__ */ c(
|
|
2145
|
+
lr,
|
|
2146
|
+
{
|
|
2147
|
+
className: P(
|
|
2148
|
+
"block h-4 w-4 rounded-full border-2 border-primary bg-background shadow-md transition-colors",
|
|
2149
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
2150
|
+
!s && "cursor-grab active:cursor-grabbing"
|
|
2151
|
+
)
|
|
2152
|
+
},
|
|
2153
|
+
v
|
|
2154
|
+
))
|
|
2155
|
+
]
|
|
2156
|
+
}
|
|
2157
|
+
)
|
|
2158
|
+
] });
|
|
2159
|
+
}
|
|
2160
|
+
function Mr({ label: e, error: o, icon: t, iconPosition: r = "left", prefix: n, suffix: i, className: s, ...a }) {
|
|
2161
|
+
const d = t && r === "left", u = t && r === "right";
|
|
2162
|
+
return /* @__PURE__ */ R("div", { className: "flex flex-col gap-1", children: [
|
|
2163
|
+
e && /* @__PURE__ */ c(ie, { children: e }),
|
|
2164
|
+
t || n || i ? /* @__PURE__ */ R(
|
|
2165
|
+
"div",
|
|
2166
|
+
{
|
|
2167
|
+
className: P(
|
|
2168
|
+
"flex items-start gap-2 bg-secondary border rounded-md pl-3 text-sm transition-all",
|
|
2169
|
+
"focus-within:border-primary focus-within:ring-2 focus-within:ring-ring",
|
|
2170
|
+
o ? "border-destructive" : "border-border"
|
|
2171
|
+
),
|
|
2172
|
+
children: [
|
|
2173
|
+
d && /* @__PURE__ */ c(t, { size: 16, className: "text-muted-foreground shrink-0 mt-2.5" }),
|
|
2174
|
+
n && /* @__PURE__ */ c("span", { className: "text-muted-foreground shrink-0 mt-2", children: n }),
|
|
2175
|
+
/* @__PURE__ */ c(
|
|
2176
|
+
"textarea",
|
|
2177
|
+
{
|
|
2178
|
+
className: P(
|
|
2179
|
+
"flex-1 min-w-0 bg-transparent py-2 pr-3 text-foreground placeholder:text-muted-foreground outline-none resize-y min-h-[100px]",
|
|
2180
|
+
s
|
|
2181
|
+
),
|
|
2182
|
+
...a
|
|
2183
|
+
}
|
|
2184
|
+
),
|
|
2185
|
+
i && /* @__PURE__ */ c("span", { className: "text-muted-foreground shrink-0 mt-2", children: i }),
|
|
2186
|
+
u && /* @__PURE__ */ c(t, { size: 16, className: "text-muted-foreground shrink-0 mt-2.5" })
|
|
2187
|
+
]
|
|
2188
|
+
}
|
|
2189
|
+
) : /* @__PURE__ */ c(
|
|
2190
|
+
"textarea",
|
|
2191
|
+
{
|
|
2192
|
+
className: P(
|
|
2193
|
+
"w-full bg-secondary border rounded-md px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground outline-none transition-all resize-y min-h-[100px]",
|
|
2194
|
+
"focus:border-primary focus:ring-2 focus:ring-ring",
|
|
2195
|
+
o ? "border-destructive" : "border-border",
|
|
2196
|
+
s
|
|
2197
|
+
),
|
|
2198
|
+
...a
|
|
2199
|
+
}
|
|
2200
|
+
),
|
|
2201
|
+
o && /* @__PURE__ */ c("span", { className: "text-xs text-destructive", children: o })
|
|
2202
|
+
] });
|
|
2203
|
+
}
|
|
2204
|
+
export {
|
|
2205
|
+
Ir as Checkbox,
|
|
2206
|
+
Cr as Input,
|
|
2207
|
+
ie as Label,
|
|
2208
|
+
kr as RadioGroup,
|
|
2209
|
+
_r as RadioGroupItem,
|
|
2210
|
+
Rr as Select,
|
|
2211
|
+
Pr as SelectGroup,
|
|
2212
|
+
Nr as SelectItem,
|
|
2213
|
+
Tr as Slider,
|
|
2214
|
+
Mr as Textarea,
|
|
2215
|
+
Er as Toggle
|
|
2216
|
+
};
|