@vellira-ui/react 2.35.1 → 2.37.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/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2195 -1406
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,127 +1,148 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import e from "clsx";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { Children as i, Fragment as a, cloneElement as o, createContext as s, forwardRef as c, isValidElement as l, useCallback as u, useContext as d, useEffect as f, useId as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
4
|
+
import { createPortal as _ } from "react-dom";
|
|
5
5
|
import { Check as v, ChevronDown as y, ChevronRight as b, Close as x, Search as S } from "@vellira-ui/icons";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { arrow as C, autoUpdate as w, flip as T, offset as E, shift as D, size as O, useFloating as k, useFocus as A, useHover as j, useInteractions as M } from "@floating-ui/react";
|
|
7
|
+
//#region src/utils/cn.ts
|
|
8
|
+
var N = (...t) => e(t), P = { arrow: "_arrow_8b0vb_1" }, F = ({ className: e }) => /* @__PURE__ */ n("span", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
className: N(P.arrow, e)
|
|
11
|
+
});
|
|
12
|
+
F.__velliraDropdownPart = "arrow", F.displayName = "Dropdown.Arrow";
|
|
13
|
+
//#endregion
|
|
9
14
|
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
10
|
-
function
|
|
15
|
+
function I(e, t) {
|
|
11
16
|
let n = () => null;
|
|
12
17
|
return n.__velliraDropdownPart = e, n.displayName = t, n;
|
|
13
18
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
16
|
-
function
|
|
17
|
-
|
|
19
|
+
function L(e) {
|
|
20
|
+
let t = 0, n, r, a, o, s = [], c = [], u = (e) => `${e}-${t++}`;
|
|
21
|
+
function d(e) {
|
|
22
|
+
c.push(e), s.push({
|
|
18
23
|
type: "item",
|
|
19
24
|
item: e,
|
|
20
|
-
itemIndex:
|
|
25
|
+
itemIndex: c.length - 1
|
|
21
26
|
});
|
|
22
27
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
if (
|
|
28
|
+
function f(e, t = {}) {
|
|
29
|
+
i.forEach(e, (e) => {
|
|
30
|
+
if (!l(e)) return;
|
|
31
|
+
let i = e.type;
|
|
32
|
+
if (i.__velliraPortal) {
|
|
33
|
+
a = e, f(e.props.children, t);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
switch (i.__velliraDropdownPart) {
|
|
26
37
|
case "trigger":
|
|
27
|
-
|
|
38
|
+
n = e;
|
|
28
39
|
return;
|
|
29
40
|
case "content":
|
|
30
|
-
|
|
41
|
+
r = e, f(e.props.children, t);
|
|
42
|
+
return;
|
|
43
|
+
case "search":
|
|
44
|
+
o = e;
|
|
45
|
+
return;
|
|
46
|
+
case "arrow":
|
|
47
|
+
s.push({
|
|
48
|
+
type: "arrow",
|
|
49
|
+
id: u("arrow"),
|
|
50
|
+
props: e.props
|
|
51
|
+
});
|
|
31
52
|
return;
|
|
32
53
|
case "group": {
|
|
33
|
-
let
|
|
34
|
-
|
|
54
|
+
let n = u("group"), r = e.props;
|
|
55
|
+
s.push({
|
|
35
56
|
type: "groupStart",
|
|
36
|
-
id:
|
|
57
|
+
id: n,
|
|
37
58
|
props: r
|
|
38
|
-
}),
|
|
59
|
+
}), f(r.children, t), s.push({
|
|
39
60
|
type: "groupEnd",
|
|
40
|
-
id:
|
|
61
|
+
id: n
|
|
41
62
|
});
|
|
42
63
|
return;
|
|
43
64
|
}
|
|
44
65
|
case "label":
|
|
45
|
-
|
|
66
|
+
s.push({
|
|
46
67
|
type: "label",
|
|
47
|
-
id:
|
|
68
|
+
id: u("label"),
|
|
48
69
|
props: e.props
|
|
49
70
|
});
|
|
50
71
|
return;
|
|
51
72
|
case "separator":
|
|
52
|
-
|
|
73
|
+
s.push({
|
|
53
74
|
type: "separator",
|
|
54
|
-
id:
|
|
75
|
+
id: u("separator"),
|
|
55
76
|
props: e.props
|
|
56
77
|
});
|
|
57
78
|
return;
|
|
58
79
|
case "empty":
|
|
59
|
-
|
|
80
|
+
s.push({
|
|
60
81
|
type: "empty",
|
|
61
|
-
id:
|
|
82
|
+
id: u("empty"),
|
|
62
83
|
props: e.props
|
|
63
84
|
});
|
|
64
85
|
return;
|
|
65
86
|
case "loading":
|
|
66
|
-
|
|
87
|
+
s.push({
|
|
67
88
|
type: "loading",
|
|
68
|
-
id:
|
|
89
|
+
id: u("loading"),
|
|
69
90
|
props: e.props
|
|
70
91
|
});
|
|
71
92
|
return;
|
|
72
93
|
case "item": {
|
|
73
94
|
let t = e.props;
|
|
74
|
-
|
|
95
|
+
d({
|
|
75
96
|
type: "item",
|
|
76
|
-
id:
|
|
97
|
+
id: u("item"),
|
|
77
98
|
props: t,
|
|
78
|
-
label:
|
|
99
|
+
label: ee(t.children),
|
|
79
100
|
disabled: t.disabled
|
|
80
101
|
});
|
|
81
102
|
return;
|
|
82
103
|
}
|
|
83
104
|
case "checkboxItem": {
|
|
84
105
|
let t = e.props;
|
|
85
|
-
|
|
106
|
+
d({
|
|
86
107
|
type: "checkbox",
|
|
87
|
-
id:
|
|
108
|
+
id: u("checkbox"),
|
|
88
109
|
props: t,
|
|
89
|
-
label:
|
|
110
|
+
label: ee(t.children),
|
|
90
111
|
disabled: t.disabled
|
|
91
112
|
});
|
|
92
113
|
return;
|
|
93
114
|
}
|
|
94
115
|
case "radioGroup": {
|
|
95
|
-
let
|
|
96
|
-
|
|
97
|
-
...
|
|
116
|
+
let n = e.props, r = u("radio-group");
|
|
117
|
+
f(n.children, {
|
|
118
|
+
...t,
|
|
98
119
|
radioGroupId: r,
|
|
99
|
-
radioGroupProps:
|
|
120
|
+
radioGroupProps: n
|
|
100
121
|
});
|
|
101
122
|
return;
|
|
102
123
|
}
|
|
103
124
|
case "radioItem": {
|
|
104
|
-
let
|
|
105
|
-
|
|
125
|
+
let n = e.props;
|
|
126
|
+
d({
|
|
106
127
|
type: "radio",
|
|
107
|
-
id:
|
|
108
|
-
props:
|
|
109
|
-
groupId:
|
|
110
|
-
groupProps:
|
|
111
|
-
label:
|
|
112
|
-
disabled:
|
|
128
|
+
id: u("radio"),
|
|
129
|
+
props: n,
|
|
130
|
+
groupId: t.radioGroupId ?? u("radio-group"),
|
|
131
|
+
groupProps: t.radioGroupProps,
|
|
132
|
+
label: ee(n.children),
|
|
133
|
+
disabled: n.disabled
|
|
113
134
|
});
|
|
114
135
|
return;
|
|
115
136
|
}
|
|
116
137
|
case "sub": {
|
|
117
|
-
let t = e.props, n =
|
|
138
|
+
let t = e.props, n = z(t.children);
|
|
118
139
|
if (!n.trigger) return;
|
|
119
|
-
let r = n.trigger.props, i =
|
|
120
|
-
|
|
140
|
+
let r = n.trigger.props, i = L(n.content?.props.children);
|
|
141
|
+
d({
|
|
121
142
|
type: "subTrigger",
|
|
122
|
-
id:
|
|
143
|
+
id: u("sub"),
|
|
123
144
|
props: r,
|
|
124
|
-
label:
|
|
145
|
+
label: ee(r.children),
|
|
125
146
|
disabled: r.disabled,
|
|
126
147
|
content: n.content?.props.children,
|
|
127
148
|
subEntries: i.entries,
|
|
@@ -135,120 +156,647 @@ function te(t) {
|
|
|
135
156
|
case "itemShortcut":
|
|
136
157
|
case "subContent":
|
|
137
158
|
case "subTrigger": return;
|
|
138
|
-
default:
|
|
159
|
+
default: f(e.props.children, t);
|
|
139
160
|
}
|
|
140
161
|
});
|
|
141
162
|
}
|
|
142
|
-
return
|
|
143
|
-
content:
|
|
144
|
-
entries:
|
|
145
|
-
items:
|
|
146
|
-
|
|
163
|
+
return f(e), {
|
|
164
|
+
content: r,
|
|
165
|
+
entries: s,
|
|
166
|
+
items: c,
|
|
167
|
+
portal: a,
|
|
168
|
+
search: o,
|
|
169
|
+
trigger: n
|
|
147
170
|
};
|
|
148
171
|
}
|
|
149
|
-
function
|
|
150
|
-
let n, r,
|
|
151
|
-
return
|
|
152
|
-
if (!
|
|
153
|
-
|
|
172
|
+
function R(e) {
|
|
173
|
+
let t, n, r, a, o = [];
|
|
174
|
+
return i.forEach(e, (e) => {
|
|
175
|
+
if (!l(e)) {
|
|
176
|
+
o.push(e);
|
|
154
177
|
return;
|
|
155
178
|
}
|
|
156
|
-
let
|
|
157
|
-
if (
|
|
158
|
-
i = e.props.children;
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (t.__velliraDropdownPart === "itemDescription") {
|
|
179
|
+
let i = e.type;
|
|
180
|
+
if (i.__velliraDropdownPart === "itemIcon") {
|
|
162
181
|
r = e.props.children;
|
|
163
182
|
return;
|
|
164
183
|
}
|
|
165
|
-
if (
|
|
184
|
+
if (i.__velliraDropdownPart === "itemDescription") {
|
|
166
185
|
n = e.props.children;
|
|
167
186
|
return;
|
|
168
187
|
}
|
|
169
|
-
if (
|
|
170
|
-
|
|
188
|
+
if (i.__velliraDropdownPart === "itemBadge") {
|
|
189
|
+
t = e.props.children;
|
|
171
190
|
return;
|
|
172
191
|
}
|
|
173
|
-
|
|
192
|
+
if (i.__velliraDropdownPart === "itemShortcut") {
|
|
193
|
+
a = e.props.children;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
o.push(e);
|
|
174
197
|
}), {
|
|
175
|
-
badge:
|
|
176
|
-
content:
|
|
177
|
-
description:
|
|
178
|
-
icon:
|
|
179
|
-
shortcut:
|
|
198
|
+
badge: t,
|
|
199
|
+
content: o,
|
|
200
|
+
description: n,
|
|
201
|
+
icon: r,
|
|
202
|
+
shortcut: a
|
|
180
203
|
};
|
|
181
204
|
}
|
|
182
|
-
function
|
|
183
|
-
let
|
|
184
|
-
return
|
|
185
|
-
if (!
|
|
186
|
-
let
|
|
187
|
-
|
|
205
|
+
function z(e) {
|
|
206
|
+
let t, n;
|
|
207
|
+
return i.forEach(e, (e) => {
|
|
208
|
+
if (!l(e)) return;
|
|
209
|
+
let r = e.type;
|
|
210
|
+
r.__velliraDropdownPart === "subTrigger" && (t = e), r.__velliraDropdownPart === "subContent" && (n = e);
|
|
188
211
|
}), {
|
|
189
|
-
content:
|
|
190
|
-
trigger:
|
|
212
|
+
content: n,
|
|
213
|
+
trigger: t
|
|
191
214
|
};
|
|
192
215
|
}
|
|
193
|
-
function
|
|
194
|
-
let
|
|
195
|
-
function
|
|
196
|
-
|
|
216
|
+
function ee(e) {
|
|
217
|
+
let t = [];
|
|
218
|
+
function n(e) {
|
|
219
|
+
i.forEach(e, (e) => {
|
|
197
220
|
if (typeof e == "string" || typeof e == "number") {
|
|
198
|
-
|
|
221
|
+
t.push(String(e));
|
|
199
222
|
return;
|
|
200
223
|
}
|
|
201
|
-
if (!
|
|
202
|
-
let
|
|
203
|
-
|
|
224
|
+
if (!l(e)) return;
|
|
225
|
+
let r = e.type;
|
|
226
|
+
r.__velliraDropdownPart === "itemBadge" || r.__velliraDropdownPart === "itemDescription" || r.__velliraDropdownPart === "itemIcon" || r.__velliraDropdownPart === "itemShortcut" || n(e.props.children);
|
|
204
227
|
});
|
|
205
228
|
}
|
|
206
|
-
return
|
|
229
|
+
return n(e), t.join("").trim();
|
|
207
230
|
}
|
|
208
231
|
//#endregion
|
|
209
232
|
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
|
|
233
|
+
var B = I("checkboxItem", "Dropdown.CheckboxItem"), te = ({ active: e, enabled: t, content: n }) => {
|
|
234
|
+
f(() => {
|
|
235
|
+
if (!e || !t || !n) return;
|
|
236
|
+
let r = [], i = n.parentElement;
|
|
237
|
+
return Array.from(document.body.children).forEach((e) => {
|
|
238
|
+
e instanceof HTMLElement && (e === i || e.contains(n) || (r.push({
|
|
239
|
+
element: e,
|
|
240
|
+
ariaHidden: e.getAttribute("aria-hidden")
|
|
241
|
+
}), e.setAttribute("aria-hidden", "true")));
|
|
242
|
+
}), () => {
|
|
243
|
+
r.forEach(({ element: e, ariaHidden: t }) => {
|
|
244
|
+
if (t === null) {
|
|
245
|
+
e.removeAttribute("aria-hidden");
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
e.setAttribute("aria-hidden", t);
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
}, [
|
|
252
|
+
e,
|
|
253
|
+
n,
|
|
254
|
+
t
|
|
255
|
+
]);
|
|
256
|
+
}, ne = () => {
|
|
257
|
+
let e = !1;
|
|
258
|
+
return {
|
|
259
|
+
preventDefault: () => {
|
|
260
|
+
e = !0;
|
|
261
|
+
},
|
|
262
|
+
get defaultPrevented() {
|
|
263
|
+
return e;
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}, re = (e) => {
|
|
267
|
+
let t = !1;
|
|
268
|
+
return {
|
|
269
|
+
originalEvent: e,
|
|
270
|
+
preventDefault: () => {
|
|
271
|
+
t = !0;
|
|
272
|
+
},
|
|
273
|
+
get defaultPrevented() {
|
|
274
|
+
return t;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}, ie = [
|
|
278
|
+
"a[href]",
|
|
279
|
+
"button:not([disabled])",
|
|
280
|
+
"textarea:not([disabled])",
|
|
281
|
+
"input:not([disabled])",
|
|
282
|
+
"select:not([disabled])",
|
|
283
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
284
|
+
].join(","), ae = (e) => Array.from(e.querySelectorAll(ie)).filter((e) => !e.hasAttribute("disabled")), oe = (e) => {
|
|
285
|
+
(ae(e)[0] ?? e).focus();
|
|
286
|
+
}, V = ({ active: e, contentRef: t, enabled: n, initialFocus: r, finalFocus: i, restoreFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: s }) => {
|
|
287
|
+
f(() => {
|
|
288
|
+
if (!e) return;
|
|
289
|
+
let n = document.activeElement, c = i?.current, l = ne();
|
|
290
|
+
return o?.(l), l.defaultPrevented || queueMicrotask(() => {
|
|
291
|
+
r?.current?.focus(), !r?.current && t.current && oe(t.current);
|
|
292
|
+
}), () => {
|
|
293
|
+
let e = ne();
|
|
294
|
+
s?.(e), !(e.defaultPrevented || !a) && queueMicrotask(() => {
|
|
295
|
+
if (c) {
|
|
296
|
+
c.focus();
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
n instanceof HTMLElement && n.focus();
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
}, [
|
|
303
|
+
e,
|
|
304
|
+
t,
|
|
305
|
+
i,
|
|
306
|
+
r,
|
|
307
|
+
s,
|
|
308
|
+
o,
|
|
309
|
+
a
|
|
310
|
+
]), f(() => {
|
|
311
|
+
if (!e || !n) return;
|
|
312
|
+
let r = (e) => {
|
|
313
|
+
if (e.key !== "Tab" || !t.current) return;
|
|
314
|
+
let n = ae(t.current);
|
|
315
|
+
if (n.length === 0) {
|
|
316
|
+
e.preventDefault(), t.current.focus();
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
let r = n[0], i = n[n.length - 1];
|
|
320
|
+
if (e.shiftKey && document.activeElement === r) {
|
|
321
|
+
e.preventDefault(), i?.focus();
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
!e.shiftKey && document.activeElement === i && (e.preventDefault(), r?.focus());
|
|
325
|
+
};
|
|
326
|
+
return document.addEventListener("keydown", r), () => {
|
|
327
|
+
document.removeEventListener("keydown", r);
|
|
328
|
+
};
|
|
329
|
+
}, [
|
|
330
|
+
e,
|
|
331
|
+
t,
|
|
332
|
+
n
|
|
333
|
+
]);
|
|
334
|
+
}, se = ({ active: e, contentRef: t, ignoreRefs: n = [], closeOnEscape: r, closeOnOutsidePress: i, isTopOverlay: a, onEscapeKeyDown: o, onPointerDownOutside: s, onInteractOutside: c, requestClose: l }) => {
|
|
335
|
+
let u = h(n);
|
|
336
|
+
u.current = n, f(() => {
|
|
337
|
+
if (!e) return;
|
|
338
|
+
let t = (e) => {
|
|
339
|
+
e.key !== "Escape" || !a() || (o?.(e), !(e.defaultPrevented || !r) && l());
|
|
340
|
+
};
|
|
341
|
+
return document.addEventListener("keydown", t), () => {
|
|
342
|
+
document.removeEventListener("keydown", t);
|
|
343
|
+
};
|
|
344
|
+
}, [
|
|
345
|
+
e,
|
|
346
|
+
r,
|
|
347
|
+
a,
|
|
348
|
+
o,
|
|
349
|
+
l
|
|
350
|
+
]), f(() => {
|
|
351
|
+
if (!e) return;
|
|
352
|
+
let n = (e) => {
|
|
353
|
+
if (!a() || e.target instanceof Node && [t, ...u.current].some((t) => t.current?.contains(e.target))) return;
|
|
354
|
+
let n = re(e);
|
|
355
|
+
s?.(n), c?.(n), !(n.defaultPrevented || !i) && l();
|
|
356
|
+
};
|
|
357
|
+
return document.addEventListener("pointerdown", n), () => {
|
|
358
|
+
document.removeEventListener("pointerdown", n);
|
|
359
|
+
};
|
|
360
|
+
}, [
|
|
361
|
+
e,
|
|
362
|
+
i,
|
|
363
|
+
t,
|
|
364
|
+
a,
|
|
365
|
+
c,
|
|
366
|
+
s,
|
|
367
|
+
l
|
|
368
|
+
]);
|
|
369
|
+
}, ce = [], le = {
|
|
370
|
+
add(e) {
|
|
371
|
+
ce = ce.filter((t) => t !== e), ce.push(e);
|
|
372
|
+
},
|
|
373
|
+
remove(e) {
|
|
374
|
+
ce = ce.filter((t) => t !== e);
|
|
375
|
+
},
|
|
376
|
+
isTop(e) {
|
|
377
|
+
return ce[ce.length - 1] === e;
|
|
378
|
+
}
|
|
379
|
+
}, ue = ({ active: e, id: t }) => (f(() => {
|
|
380
|
+
if (e) return le.add(t), () => {
|
|
381
|
+
le.remove(t);
|
|
382
|
+
};
|
|
383
|
+
}, [e, t]), { isTopOverlay: u(() => le.isTop(t), [t]) }), de = 0, H = "", fe = {
|
|
384
|
+
lock() {
|
|
385
|
+
typeof document > "u" || (de === 0 && (H = document.body.style.overflow, document.body.style.overflow = "hidden"), de += 1);
|
|
386
|
+
},
|
|
387
|
+
unlock() {
|
|
388
|
+
typeof document > "u" || (de = Math.max(0, de - 1), de === 0 && (document.body.style.overflow = H));
|
|
389
|
+
}
|
|
390
|
+
}, pe = ({ active: e, enabled: t = !0 }) => {
|
|
391
|
+
f(() => {
|
|
392
|
+
if (!(!e || !t)) return fe.lock(), () => {
|
|
393
|
+
fe.unlock();
|
|
394
|
+
};
|
|
395
|
+
}, [e, t]);
|
|
396
|
+
}, me = () => typeof document > "u" ? null : document.body, he = ({ container: e } = {}) => {
|
|
397
|
+
let [t, n] = g(!1);
|
|
398
|
+
return f(() => {
|
|
213
399
|
n(!0);
|
|
214
|
-
}, []),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
},
|
|
400
|
+
}, []), t ? e ?? document.getElementById("overlay-root") ?? me() : null;
|
|
401
|
+
}, ge = ({ value: e, defaultValue: t, onChange: n }) => {
|
|
402
|
+
let [r, i] = g(t), a = e !== void 0;
|
|
403
|
+
return [a ? e : r, u((e) => {
|
|
404
|
+
a || i(e), n?.(e);
|
|
405
|
+
}, [a, n])];
|
|
406
|
+
}, _e = ({ activeIndex: e, setActiveIndex: t, items: n, isOpen: r, onOpen: i, onSelect: a, onClose: o, getItemText: s, loop: c = !0 }) => {
|
|
407
|
+
let l = h({
|
|
408
|
+
value: "",
|
|
409
|
+
timeoutId: void 0
|
|
410
|
+
});
|
|
411
|
+
f(() => () => {
|
|
412
|
+
l.current.timeoutId && clearTimeout(l.current.timeoutId);
|
|
413
|
+
}, []);
|
|
414
|
+
let d = u((e, t) => {
|
|
415
|
+
if (!n.length) return e;
|
|
416
|
+
let r = e;
|
|
417
|
+
for (let i = 0; i < n.length; i++) {
|
|
418
|
+
let i = r + t;
|
|
419
|
+
if (!c && (i < 0 || i >= n.length)) return e;
|
|
420
|
+
if (r = (i + n.length) % n.length, !n[r]?.disabled) return r;
|
|
421
|
+
}
|
|
422
|
+
return e;
|
|
423
|
+
}, [n, c]), p = u(() => n.findIndex((e) => !e.disabled), [n]), m = u(() => {
|
|
424
|
+
for (let e = n.length - 1; e >= 0; e--) if (!n[e].disabled) return e;
|
|
425
|
+
return -1;
|
|
426
|
+
}, [n]), g = u((t) => {
|
|
427
|
+
if (!s || !t) return -1;
|
|
428
|
+
let r = t.toLocaleLowerCase(), i = e >= 0 ? e + 1 : 0;
|
|
429
|
+
for (let e = 0; e < n.length; e++) {
|
|
430
|
+
let t = (i + e) % n.length, a = n[t];
|
|
431
|
+
if (a && !a.disabled && s(a).toLocaleLowerCase().startsWith(r)) return t;
|
|
432
|
+
}
|
|
433
|
+
return -1;
|
|
434
|
+
}, [
|
|
435
|
+
e,
|
|
436
|
+
s,
|
|
437
|
+
n
|
|
438
|
+
]);
|
|
439
|
+
return { onKeyDown: u((n) => {
|
|
440
|
+
if (!r) {
|
|
441
|
+
(n.key === " " || n.key === "Enter" || n.key === "ArrowDown" || n.key === "ArrowUp") && (n.preventDefault(), i(n));
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
switch (n.key) {
|
|
445
|
+
case "ArrowDown":
|
|
446
|
+
n.preventDefault(), t(d(e, 1));
|
|
447
|
+
break;
|
|
448
|
+
case "ArrowUp":
|
|
449
|
+
n.preventDefault(), t(d(e, -1));
|
|
450
|
+
break;
|
|
451
|
+
case "Enter":
|
|
452
|
+
case " ":
|
|
453
|
+
n.preventDefault(), a?.();
|
|
454
|
+
break;
|
|
455
|
+
case "Escape":
|
|
456
|
+
n.preventDefault(), o?.();
|
|
457
|
+
break;
|
|
458
|
+
case "Home":
|
|
459
|
+
n.preventDefault(), t(p());
|
|
460
|
+
break;
|
|
461
|
+
case "End":
|
|
462
|
+
n.preventDefault(), t(m());
|
|
463
|
+
break;
|
|
464
|
+
case "Tab":
|
|
465
|
+
o?.();
|
|
466
|
+
break;
|
|
467
|
+
default:
|
|
468
|
+
if (n.key.length === 1 && !n.altKey && !n.ctrlKey && !n.metaKey) {
|
|
469
|
+
n.preventDefault(), l.current.timeoutId && clearTimeout(l.current.timeoutId), l.current.value += n.key, l.current.timeoutId = setTimeout(() => {
|
|
470
|
+
l.current.value = "", l.current.timeoutId = void 0;
|
|
471
|
+
}, 700);
|
|
472
|
+
let e = g(l.current.value);
|
|
473
|
+
e >= 0 && t(e);
|
|
474
|
+
}
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}, [
|
|
478
|
+
e,
|
|
479
|
+
r,
|
|
480
|
+
i,
|
|
481
|
+
a,
|
|
482
|
+
o,
|
|
483
|
+
t,
|
|
484
|
+
d,
|
|
485
|
+
p,
|
|
486
|
+
m,
|
|
487
|
+
g
|
|
488
|
+
]) };
|
|
489
|
+
}, ve = ({ items: e, open: t, defaultOpen: n = !1, disabled: r = !1, onOpenChange: i, onSelect: a, getItemValue: o, getItemText: s, loop: c = !0 }) => {
|
|
490
|
+
let [l, d] = g(n), [p, m] = g(-1), h = t !== void 0, _ = t ?? l, v = u(() => e.findIndex((e) => !e.disabled), [e]), y = u(() => {
|
|
491
|
+
for (let t = e.length - 1; t >= 0; t--) if (!e[t]?.disabled) return t;
|
|
492
|
+
return -1;
|
|
493
|
+
}, [e]), b = u((t, n) => {
|
|
494
|
+
if (t) {
|
|
495
|
+
m((t) => t >= 0 && !e[t]?.disabled ? t : n ?? v());
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
m(-1);
|
|
499
|
+
}, [v, e]);
|
|
500
|
+
f(() => {
|
|
501
|
+
b(_);
|
|
502
|
+
}, [_, b]);
|
|
503
|
+
let x = u((e, t) => {
|
|
504
|
+
h || d(e), i?.(e), b(e, t);
|
|
505
|
+
}, [
|
|
506
|
+
h,
|
|
507
|
+
i,
|
|
508
|
+
b
|
|
509
|
+
]), S = u((e = v()) => {
|
|
510
|
+
r || x(!0, e);
|
|
511
|
+
}, [
|
|
512
|
+
r,
|
|
513
|
+
v,
|
|
514
|
+
x
|
|
515
|
+
]), C = u(() => {
|
|
516
|
+
_ && x(!1);
|
|
517
|
+
}, [_, x]), w = u(() => {
|
|
518
|
+
if (!r) {
|
|
519
|
+
if (_) {
|
|
520
|
+
x(!1);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
S();
|
|
524
|
+
}
|
|
525
|
+
}, [
|
|
526
|
+
r,
|
|
527
|
+
_,
|
|
528
|
+
S,
|
|
529
|
+
x
|
|
530
|
+
]), T = u((t) => {
|
|
531
|
+
t.disabled || (a?.(o(t, e.indexOf(t))), C());
|
|
532
|
+
}, [
|
|
533
|
+
C,
|
|
534
|
+
o,
|
|
535
|
+
e,
|
|
536
|
+
a
|
|
537
|
+
]), E = u(() => {
|
|
538
|
+
let t = e[p];
|
|
539
|
+
t && T(t);
|
|
540
|
+
}, [
|
|
541
|
+
p,
|
|
542
|
+
e,
|
|
543
|
+
T
|
|
544
|
+
]), { onKeyDown: D } = _e({
|
|
545
|
+
activeIndex: p,
|
|
546
|
+
setActiveIndex: m,
|
|
547
|
+
items: e,
|
|
548
|
+
isOpen: _,
|
|
549
|
+
onOpen: (e) => {
|
|
550
|
+
S(e.key === "ArrowUp" ? y() : v());
|
|
551
|
+
},
|
|
552
|
+
onSelect: E,
|
|
553
|
+
onClose: C,
|
|
554
|
+
getItemText: s,
|
|
555
|
+
loop: c
|
|
556
|
+
});
|
|
557
|
+
return {
|
|
558
|
+
activeIndex: p,
|
|
559
|
+
setActiveIndex: m,
|
|
560
|
+
isOpen: _,
|
|
561
|
+
open: _,
|
|
562
|
+
setOpen: x,
|
|
563
|
+
openDropdown: S,
|
|
564
|
+
closeDropdown: C,
|
|
565
|
+
toggleDropdown: w,
|
|
566
|
+
selectItem: T,
|
|
567
|
+
select: T,
|
|
568
|
+
selectActiveItem: E,
|
|
569
|
+
onKeyDown: D,
|
|
570
|
+
getFirstEnabledIndex: v,
|
|
571
|
+
getLastEnabledIndex: y
|
|
572
|
+
};
|
|
573
|
+
}, ye = ({ open: e, defaultOpen: t = !1, onOpenChange: n, closeOnEscape: r, closeOnOutsidePress: i }) => {
|
|
574
|
+
let a = p(), o = p(), s = p(), [c, l] = ge({
|
|
575
|
+
value: e,
|
|
576
|
+
defaultValue: t,
|
|
577
|
+
onChange: n
|
|
578
|
+
});
|
|
579
|
+
return {
|
|
580
|
+
open: c,
|
|
581
|
+
shouldRender: c,
|
|
582
|
+
setOpen: l,
|
|
583
|
+
requestClose: u(() => {
|
|
584
|
+
l(!1);
|
|
585
|
+
}, [l]),
|
|
586
|
+
closeOnOutsidePress: i ?? !0,
|
|
587
|
+
closeOnEscape: r ?? !0,
|
|
588
|
+
contentId: a,
|
|
589
|
+
titleId: o,
|
|
590
|
+
descriptionId: s
|
|
591
|
+
};
|
|
592
|
+
}, be = ({ value: e, defaultValue: t, onValueChange: n, onChange: r, options: i, multiple: a = !1, maxSelected: o, closeOnSelect: s = !a, disabled: c = !1, open: l, defaultOpen: d = !1, onOpenChange: p }) => {
|
|
593
|
+
let [h, _] = ge({
|
|
594
|
+
value: e,
|
|
595
|
+
defaultValue: t ?? (a ? [] : ""),
|
|
596
|
+
onChange: n ?? r
|
|
597
|
+
}), [v, y] = ge({
|
|
598
|
+
value: l,
|
|
599
|
+
defaultValue: d,
|
|
600
|
+
onChange: p
|
|
601
|
+
}), [b, x] = g(-1), S = m(() => Array.isArray(h) ? h : h ? [h] : [], [h]), C = m(() => i.find((e) => S.includes(e.value)), [i, S]), w = m(() => i.filter((e) => S.includes(e.value)), [i, S]), T = u(() => {
|
|
602
|
+
let e = i.findIndex((e) => S.includes(e.value) && !e.disabled);
|
|
603
|
+
return e >= 0 ? e : i.findIndex((e) => !e.disabled);
|
|
604
|
+
}, [i, S]), E = u(() => {
|
|
605
|
+
c || (x(T()), y(!0));
|
|
606
|
+
}, [
|
|
607
|
+
c,
|
|
608
|
+
T,
|
|
609
|
+
y
|
|
610
|
+
]), D = u(() => {
|
|
611
|
+
y(!1);
|
|
612
|
+
}, [y]), O = u(() => {
|
|
613
|
+
if (!c) {
|
|
614
|
+
if (v) {
|
|
615
|
+
D();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
E();
|
|
619
|
+
}
|
|
620
|
+
}, [
|
|
621
|
+
D,
|
|
622
|
+
c,
|
|
623
|
+
v,
|
|
624
|
+
E
|
|
625
|
+
]);
|
|
626
|
+
f(() => {
|
|
627
|
+
v && x((e) => {
|
|
628
|
+
let t = i[e];
|
|
629
|
+
return t && !t.disabled ? e : T();
|
|
630
|
+
});
|
|
631
|
+
}, [
|
|
632
|
+
T,
|
|
633
|
+
v,
|
|
634
|
+
i
|
|
635
|
+
]);
|
|
636
|
+
let k = u((e) => {
|
|
637
|
+
if (e === "") {
|
|
638
|
+
_(a ? [] : ""), D();
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
let t = i.find((t) => t.value === e);
|
|
642
|
+
if (!(!t || t.disabled)) {
|
|
643
|
+
if (a) {
|
|
644
|
+
if (!S.includes(e) && typeof o == "number" && S.length >= o) return;
|
|
645
|
+
let t = S.includes(e) ? S.filter((t) => t !== e) : [...S, e];
|
|
646
|
+
_(t), s && D();
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
_(e), x(i.indexOf(t)), D();
|
|
650
|
+
}
|
|
651
|
+
}, [
|
|
652
|
+
D,
|
|
653
|
+
s,
|
|
654
|
+
o,
|
|
655
|
+
a,
|
|
656
|
+
i,
|
|
657
|
+
S,
|
|
658
|
+
_
|
|
659
|
+
]), A = u(() => {
|
|
660
|
+
let e = i[b];
|
|
661
|
+
e && k(e.value);
|
|
662
|
+
}, [
|
|
663
|
+
b,
|
|
664
|
+
i,
|
|
665
|
+
k
|
|
666
|
+
]), { onKeyDown: j } = _e({
|
|
667
|
+
activeIndex: b,
|
|
668
|
+
setActiveIndex: x,
|
|
669
|
+
items: i,
|
|
670
|
+
isOpen: v,
|
|
671
|
+
onOpen: E,
|
|
672
|
+
onClose: D,
|
|
673
|
+
onSelect: A,
|
|
674
|
+
getItemText: (e) => e.label
|
|
675
|
+
});
|
|
676
|
+
return {
|
|
677
|
+
selectedValue: h,
|
|
678
|
+
selectedValues: S,
|
|
679
|
+
setSelectedValue: _,
|
|
680
|
+
selectedOption: C,
|
|
681
|
+
selectedOptions: w,
|
|
682
|
+
isOpen: v,
|
|
683
|
+
open: v,
|
|
684
|
+
setIsOpen: y,
|
|
685
|
+
activeIndex: b,
|
|
686
|
+
setActiveIndex: x,
|
|
687
|
+
getInitialActiveIndex: T,
|
|
688
|
+
openDropdown: E,
|
|
689
|
+
closeDropdown: D,
|
|
690
|
+
toggleDropdown: O,
|
|
691
|
+
selectValue: k,
|
|
692
|
+
select: k,
|
|
693
|
+
selectActiveOption: A,
|
|
694
|
+
onKeyDown: j
|
|
695
|
+
};
|
|
696
|
+
}, xe = ({ activeIndex: e, defaultActiveIndex: t = 0, onChange: n }) => {
|
|
697
|
+
let [r, i] = ge({
|
|
698
|
+
value: e,
|
|
699
|
+
defaultValue: t,
|
|
700
|
+
onChange: n
|
|
701
|
+
});
|
|
702
|
+
return {
|
|
703
|
+
activeIndex: r,
|
|
704
|
+
setActiveIndex: i
|
|
705
|
+
};
|
|
706
|
+
}, U = ({ activeIndex: e, setActiveIndex: t, tabRefs: n, orientation: r = "horizontal", onNavigate: i }) => ({ onKeyDown: u((a) => {
|
|
707
|
+
let o = (e) => !!(e?.disabled || e?.props?.disabled), s = (e, t) => {
|
|
708
|
+
let r = n.current.length;
|
|
709
|
+
if (!r) return e;
|
|
710
|
+
let i = e;
|
|
711
|
+
for (let e = 0; e < r; e++) {
|
|
712
|
+
i = (i + t + r) % r;
|
|
713
|
+
let e = n.current[i];
|
|
714
|
+
if (e && !o(e)) return i;
|
|
715
|
+
}
|
|
716
|
+
return e;
|
|
717
|
+
}, c = () => n.current.findIndex((e) => e && !o(e)), l = () => {
|
|
718
|
+
for (let e = n.current.length - 1; e >= 0; e--) {
|
|
719
|
+
let t = n.current[e];
|
|
720
|
+
if (t && !o(t)) return e;
|
|
721
|
+
}
|
|
722
|
+
return e;
|
|
723
|
+
}, u = e;
|
|
724
|
+
switch (a.key) {
|
|
725
|
+
case "ArrowLeft":
|
|
726
|
+
r === "horizontal" && (a.preventDefault(), u = s(e, -1));
|
|
727
|
+
break;
|
|
728
|
+
case "ArrowRight":
|
|
729
|
+
r === "horizontal" && (a.preventDefault(), u = s(e, 1));
|
|
730
|
+
break;
|
|
731
|
+
case "ArrowUp":
|
|
732
|
+
r === "vertical" && (a.preventDefault(), u = s(e, -1));
|
|
733
|
+
break;
|
|
734
|
+
case "ArrowDown":
|
|
735
|
+
r === "vertical" && (a.preventDefault(), u = s(e, 1));
|
|
736
|
+
break;
|
|
737
|
+
case "Home": {
|
|
738
|
+
a.preventDefault();
|
|
739
|
+
let t = c();
|
|
740
|
+
u = t === -1 ? e : t;
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
case "End":
|
|
744
|
+
a.preventDefault(), u = l();
|
|
745
|
+
break;
|
|
746
|
+
default: return;
|
|
747
|
+
}
|
|
748
|
+
u !== e && (t(u), i?.(u));
|
|
749
|
+
}, [
|
|
750
|
+
e,
|
|
751
|
+
i,
|
|
752
|
+
r,
|
|
753
|
+
t,
|
|
754
|
+
n
|
|
755
|
+
]) }), Se = s(null), Ce = ({ children: e, container: t = null }) => /* @__PURE__ */ n(Se.Provider, {
|
|
756
|
+
value: t,
|
|
757
|
+
children: e
|
|
758
|
+
}), we = ({ children: e, container: t }) => {
|
|
759
|
+
let n = d(Se), r = he({ container: t ?? n });
|
|
760
|
+
return r ? _(e, r) : null;
|
|
761
|
+
};
|
|
762
|
+
we.__velliraPortal = !0, we.displayName = "Portal", Ce.displayName = "PortalProvider";
|
|
763
|
+
var Te = {
|
|
764
|
+
dropdown: "_dropdown_m7rnq_1",
|
|
765
|
+
"dropdown-in": "_dropdown-in_m7rnq_1",
|
|
766
|
+
primary: "_primary_m7rnq_42",
|
|
767
|
+
neutral: "_neutral_m7rnq_65",
|
|
768
|
+
success: "_success_m7rnq_88",
|
|
769
|
+
warning: "_warning_m7rnq_111",
|
|
770
|
+
danger: "_danger_m7rnq_134",
|
|
771
|
+
empty: "_empty_m7rnq_157",
|
|
772
|
+
searchWrap: "_searchWrap_m7rnq_165",
|
|
773
|
+
search: "_search_m7rnq_165",
|
|
774
|
+
"dropdown-sheet-in": "_dropdown-sheet-in_m7rnq_1"
|
|
775
|
+
}, Ee = I("empty", "Dropdown.Empty"), De = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
228
776
|
role: "presentation",
|
|
229
|
-
className:
|
|
777
|
+
className: Te.empty,
|
|
230
778
|
children: e ?? "No actions available"
|
|
231
779
|
});
|
|
232
|
-
|
|
780
|
+
De.displayName = "DropdownEmptySurface";
|
|
233
781
|
//#endregion
|
|
234
782
|
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
235
|
-
var
|
|
236
|
-
|
|
783
|
+
var Oe = I("group", "Dropdown.Group"), ke = () => null;
|
|
784
|
+
ke.displayName = "DropdownGroupSurface";
|
|
237
785
|
//#endregion
|
|
238
786
|
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
function
|
|
242
|
-
let e =
|
|
787
|
+
var Ae = s(null), je = s(null), Me = s(null), Ne = Ae.Provider, Pe = je.Provider;
|
|
788
|
+
Me.Provider;
|
|
789
|
+
function W() {
|
|
790
|
+
let e = d(Ae);
|
|
243
791
|
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
244
792
|
return e;
|
|
245
793
|
}
|
|
246
|
-
function
|
|
247
|
-
let e =
|
|
794
|
+
function Fe() {
|
|
795
|
+
let e = d(je);
|
|
248
796
|
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
249
797
|
return e;
|
|
250
798
|
}
|
|
251
|
-
var
|
|
799
|
+
var G = {
|
|
252
800
|
item: "_item_1vj4n_1",
|
|
253
801
|
disabled: "_disabled_1vj4n_22",
|
|
254
802
|
active: "_active_1vj4n_37",
|
|
@@ -273,98 +821,98 @@ var W = {
|
|
|
273
821
|
"dropdown-sub-in": "_dropdown-sub-in_1vj4n_1",
|
|
274
822
|
subLabel: "_subLabel_1vj4n_276",
|
|
275
823
|
subSeparator: "_subSeparator_1vj4n_284"
|
|
276
|
-
},
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
824
|
+
}, Ie = I("item", "Dropdown.Item"), Le = ({ item: e, itemIndex: i }) => {
|
|
825
|
+
let a = W(), o = h(void 0), [s, c] = g(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), l = a.activeIndex === i, u = a.openSubId === e.id, d = e.type === "checkbox", f = e.type === "radio", p = e.type === "subTrigger", m = d ? e.props.checked ?? s : f ? (e.groupProps?.value ?? a.radioValues[e.groupId]) === e.props.value : !1, _ = a.loading || e.disabled, y = e.props, x = R(y.children), S = x.icon ?? y.icon, C = x.description ?? ("description" in y ? y.description : void 0), w = x.badge ?? ("badge" in y ? y.badge : void 0), T = x.shortcut ?? y.shortcut, E = x.content.length ? x.content : y.children, D = "color" in y ? y.color : void 0, O = e.type === "item" ? e.props.href : void 0, k = e.type === "item" ? e.props.target : void 0, A = e.type === "item" ? e.props.download : void 0, j = a.getItemId(i), M = d ? "menuitemcheckbox" : f ? "menuitemradio" : "menuitem", P = e.type === "item" && k === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, F = O ? "a" : "li", I = d || f, L = (t) => {
|
|
826
|
+
if (_) {
|
|
279
827
|
t.preventDefault();
|
|
280
828
|
return;
|
|
281
829
|
}
|
|
282
|
-
if (
|
|
283
|
-
let t = !
|
|
284
|
-
|
|
830
|
+
if (d && e.type === "checkbox") {
|
|
831
|
+
let t = !m;
|
|
832
|
+
c(t), e.props.onCheckedChange?.(t);
|
|
285
833
|
}
|
|
286
|
-
|
|
834
|
+
a.selectItem(e, Re(t));
|
|
287
835
|
};
|
|
288
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(F, {
|
|
289
837
|
id: j,
|
|
290
838
|
role: M,
|
|
291
|
-
href:
|
|
292
|
-
target:
|
|
293
|
-
rel:
|
|
294
|
-
download:
|
|
295
|
-
tabIndex:
|
|
296
|
-
"aria-disabled":
|
|
297
|
-
"aria-checked":
|
|
298
|
-
"aria-haspopup":
|
|
299
|
-
"aria-expanded":
|
|
300
|
-
"data-active":
|
|
301
|
-
"data-state":
|
|
302
|
-
className:
|
|
303
|
-
[
|
|
304
|
-
[
|
|
305
|
-
[
|
|
306
|
-
}, D && D !== "default" ?
|
|
307
|
-
onClick:
|
|
839
|
+
href: F === "a" && !_ ? O : void 0,
|
|
840
|
+
target: F === "a" && !_ ? k : void 0,
|
|
841
|
+
rel: F === "a" ? P : void 0,
|
|
842
|
+
download: F === "a" && !_ ? A : void 0,
|
|
843
|
+
tabIndex: _ ? -1 : 0,
|
|
844
|
+
"aria-disabled": _ || void 0,
|
|
845
|
+
"aria-checked": d || f ? m : void 0,
|
|
846
|
+
"aria-haspopup": p ? "menu" : void 0,
|
|
847
|
+
"aria-expanded": p ? u : void 0,
|
|
848
|
+
"data-active": l || void 0,
|
|
849
|
+
"data-state": u ? "open" : void 0,
|
|
850
|
+
className: N(G.item, G[a.size], {
|
|
851
|
+
[G.active]: l,
|
|
852
|
+
[G.disabled]: _,
|
|
853
|
+
[G.checked]: m
|
|
854
|
+
}, D && D !== "default" ? G[D] : void 0, y.className),
|
|
855
|
+
onClick: L,
|
|
308
856
|
onMouseEnter: () => {
|
|
309
|
-
|
|
857
|
+
_ || (a.setActiveIndex(i), p ? (window.clearTimeout(o.current), o.current = window.setTimeout(() => a.setOpenSubId(e.id), 120)) : (window.clearTimeout(o.current), a.setOpenSubId(void 0)));
|
|
310
858
|
},
|
|
311
859
|
onMouseLeave: () => {
|
|
312
|
-
window.clearTimeout(
|
|
860
|
+
window.clearTimeout(o.current);
|
|
313
861
|
},
|
|
314
862
|
children: [
|
|
315
|
-
|
|
316
|
-
className:
|
|
863
|
+
I && /* @__PURE__ */ n("span", {
|
|
864
|
+
className: G.indicator,
|
|
317
865
|
"aria-hidden": "true",
|
|
318
|
-
children:
|
|
866
|
+
children: m ? /* @__PURE__ */ n(v, {}) : null
|
|
319
867
|
}),
|
|
320
|
-
S && /* @__PURE__ */
|
|
321
|
-
className:
|
|
868
|
+
S && /* @__PURE__ */ n("span", {
|
|
869
|
+
className: G.itemIcon,
|
|
322
870
|
children: S
|
|
323
871
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
className:
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
-
className:
|
|
872
|
+
/* @__PURE__ */ r("span", {
|
|
873
|
+
className: G.itemText,
|
|
874
|
+
children: [/* @__PURE__ */ n("span", {
|
|
875
|
+
className: G.itemLabel,
|
|
328
876
|
children: E
|
|
329
|
-
}), C && /* @__PURE__ */
|
|
330
|
-
className:
|
|
877
|
+
}), C && /* @__PURE__ */ n("span", {
|
|
878
|
+
className: G.itemDescription,
|
|
331
879
|
children: C
|
|
332
880
|
})]
|
|
333
881
|
}),
|
|
334
|
-
w && /* @__PURE__ */
|
|
335
|
-
className:
|
|
882
|
+
w && /* @__PURE__ */ n("span", {
|
|
883
|
+
className: G.itemBadge,
|
|
336
884
|
children: w
|
|
337
885
|
}),
|
|
338
|
-
T && /* @__PURE__ */
|
|
339
|
-
className:
|
|
886
|
+
T && /* @__PURE__ */ n("span", {
|
|
887
|
+
className: G.itemShortcut,
|
|
340
888
|
children: T
|
|
341
889
|
}),
|
|
342
|
-
|
|
343
|
-
className:
|
|
890
|
+
p && /* @__PURE__ */ n("span", {
|
|
891
|
+
className: G.itemShortcut,
|
|
344
892
|
"aria-hidden": "true",
|
|
345
|
-
children: /* @__PURE__ */
|
|
893
|
+
children: /* @__PURE__ */ n(b, {})
|
|
346
894
|
})
|
|
347
895
|
]
|
|
348
|
-
}),
|
|
896
|
+
}), p && u && e.subEntries.length > 0 && /* @__PURE__ */ n("ul", {
|
|
349
897
|
role: "menu",
|
|
350
|
-
className:
|
|
351
|
-
onMouseEnter: () =>
|
|
352
|
-
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */
|
|
898
|
+
className: G.subContent,
|
|
899
|
+
onMouseEnter: () => a.setOpenSubId(e.id),
|
|
900
|
+
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ n("li", {
|
|
353
901
|
role: "presentation",
|
|
354
|
-
className:
|
|
902
|
+
className: G.subLabel,
|
|
355
903
|
children: e.props.children
|
|
356
|
-
}, e.id) : e.type === "separator" ? /* @__PURE__ */
|
|
904
|
+
}, e.id) : e.type === "separator" ? /* @__PURE__ */ n("li", {
|
|
357
905
|
role: "separator",
|
|
358
|
-
className:
|
|
906
|
+
className: G.subSeparator,
|
|
359
907
|
"aria-hidden": "true"
|
|
360
|
-
}, e.id) : e.type === "item" ? /* @__PURE__ */
|
|
908
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ n(ze, {
|
|
361
909
|
item: e.item,
|
|
362
910
|
id: `${j}-${e.itemIndex}`
|
|
363
911
|
}, e.item.id) : null)
|
|
364
912
|
})] });
|
|
365
913
|
};
|
|
366
|
-
|
|
367
|
-
function
|
|
914
|
+
Le.displayName = "DropdownItemRow";
|
|
915
|
+
function Re(e) {
|
|
368
916
|
let t = !1;
|
|
369
917
|
return {
|
|
370
918
|
originalEvent: e,
|
|
@@ -376,19 +924,19 @@ function ye(e) {
|
|
|
376
924
|
}
|
|
377
925
|
};
|
|
378
926
|
}
|
|
379
|
-
function
|
|
380
|
-
let
|
|
927
|
+
function ze({ id: e, item: t }) {
|
|
928
|
+
let i = W(), [a, o] = g(t.type === "checkbox" ? t.props.defaultChecked ?? !1 : !1), s = t.type === "checkbox", c = t.type === "radio", l = s ? t.props.checked ?? a : c ? (t.groupProps?.value ?? i.radioValues[t.groupId]) === t.props.value : !1, u = t.props, d = R(u.children), f = d.icon ?? u.icon, p = d.description ?? ("description" in u ? u.description : void 0), m = d.badge ?? ("badge" in u ? u.badge : void 0), h = d.shortcut ?? u.shortcut, _ = d.content.length ? d.content : u.children, y = "color" in u ? u.color : void 0, b = i.loading || t.disabled, x = t.type === "item" ? t.props.href : void 0, S = t.type === "item" ? t.props.target : void 0, C = t.type === "item" ? t.props.download : void 0, w = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", T = t.type === "item" && S === "_blank" && !t.props.rel ? "noreferrer noopener" : t.type === "item" ? t.props.rel : void 0, E = x ? "a" : "li", D = s || c, O = (e) => {
|
|
381
929
|
if (b) {
|
|
382
930
|
e.preventDefault();
|
|
383
931
|
return;
|
|
384
932
|
}
|
|
385
|
-
if (
|
|
386
|
-
let e = !
|
|
387
|
-
|
|
933
|
+
if (s && t.type === "checkbox") {
|
|
934
|
+
let e = !l;
|
|
935
|
+
o(e), t.props.onCheckedChange?.(e);
|
|
388
936
|
}
|
|
389
|
-
|
|
937
|
+
i.selectItem(t, Re(e));
|
|
390
938
|
};
|
|
391
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ r(E, {
|
|
392
940
|
id: e,
|
|
393
941
|
role: w,
|
|
394
942
|
href: E === "a" && !b ? x : void 0,
|
|
@@ -397,159 +945,161 @@ function be({ id: e, item: t }) {
|
|
|
397
945
|
download: E === "a" && !b ? C : void 0,
|
|
398
946
|
tabIndex: b ? -1 : 0,
|
|
399
947
|
"aria-disabled": b || void 0,
|
|
400
|
-
"aria-checked":
|
|
401
|
-
className:
|
|
402
|
-
[
|
|
403
|
-
[
|
|
404
|
-
}, y && y !== "default" ?
|
|
948
|
+
"aria-checked": s || c ? l : void 0,
|
|
949
|
+
className: N(G.item, G[i.size], {
|
|
950
|
+
[G.disabled]: b,
|
|
951
|
+
[G.checked]: l
|
|
952
|
+
}, y && y !== "default" ? G[y] : void 0),
|
|
405
953
|
onClick: O,
|
|
406
954
|
children: [
|
|
407
|
-
D && /* @__PURE__ */
|
|
408
|
-
className:
|
|
955
|
+
D && /* @__PURE__ */ n("span", {
|
|
956
|
+
className: G.indicator,
|
|
409
957
|
"aria-hidden": "true",
|
|
410
|
-
children:
|
|
958
|
+
children: l ? /* @__PURE__ */ n(v, {}) : null
|
|
411
959
|
}),
|
|
412
|
-
|
|
413
|
-
className:
|
|
414
|
-
children:
|
|
960
|
+
f && /* @__PURE__ */ n("span", {
|
|
961
|
+
className: G.itemIcon,
|
|
962
|
+
children: f
|
|
415
963
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
className:
|
|
418
|
-
children: [/* @__PURE__ */
|
|
419
|
-
className:
|
|
420
|
-
children:
|
|
421
|
-
}),
|
|
422
|
-
className:
|
|
423
|
-
children:
|
|
964
|
+
/* @__PURE__ */ r("span", {
|
|
965
|
+
className: G.itemText,
|
|
966
|
+
children: [/* @__PURE__ */ n("span", {
|
|
967
|
+
className: G.itemLabel,
|
|
968
|
+
children: _
|
|
969
|
+
}), p && /* @__PURE__ */ n("span", {
|
|
970
|
+
className: G.itemDescription,
|
|
971
|
+
children: p
|
|
424
972
|
})]
|
|
425
973
|
}),
|
|
426
|
-
|
|
427
|
-
className:
|
|
428
|
-
children: p
|
|
429
|
-
}),
|
|
430
|
-
m && /* @__PURE__ */ g("span", {
|
|
431
|
-
className: W.itemShortcut,
|
|
974
|
+
m && /* @__PURE__ */ n("span", {
|
|
975
|
+
className: G.itemBadge,
|
|
432
976
|
children: m
|
|
977
|
+
}),
|
|
978
|
+
h && /* @__PURE__ */ n("span", {
|
|
979
|
+
className: G.itemShortcut,
|
|
980
|
+
children: h
|
|
433
981
|
})
|
|
434
982
|
]
|
|
435
983
|
});
|
|
436
984
|
}
|
|
437
|
-
var
|
|
985
|
+
var Be = { group: "_group_aviwv_1" }, Ve = I("label", "Dropdown.Label"), K = ({ children: e, className: t }) => /* @__PURE__ */ n("li", {
|
|
438
986
|
role: "presentation",
|
|
439
|
-
className:
|
|
987
|
+
className: N(Be.group, t),
|
|
440
988
|
children: e
|
|
441
989
|
});
|
|
442
|
-
|
|
990
|
+
K.displayName = "DropdownLabelSurface";
|
|
443
991
|
//#endregion
|
|
444
992
|
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
445
|
-
var
|
|
993
|
+
var q = I("loading", "Dropdown.Loading"), He = ({ children: e }) => /* @__PURE__ */ n("li", {
|
|
446
994
|
role: "presentation",
|
|
447
995
|
"aria-live": "polite",
|
|
448
|
-
className:
|
|
996
|
+
className: Te.empty,
|
|
449
997
|
children: e ?? "Loading actions..."
|
|
450
998
|
});
|
|
451
|
-
|
|
452
|
-
var
|
|
999
|
+
He.displayName = "DropdownLoadingSurface";
|
|
1000
|
+
var Ue = { separator: "_separator_1v11r_1" }, We = I("separator", "Dropdown.Separator"), Ge = ({ className: e }) => /* @__PURE__ */ n("li", {
|
|
453
1001
|
role: "separator",
|
|
454
|
-
className:
|
|
1002
|
+
className: N(Ue.separator, e),
|
|
455
1003
|
"aria-hidden": "true"
|
|
456
1004
|
});
|
|
457
|
-
|
|
1005
|
+
Ge.displayName = "DropdownSeparatorSurface";
|
|
458
1006
|
//#endregion
|
|
459
1007
|
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
460
|
-
var
|
|
461
|
-
let
|
|
462
|
-
if (!
|
|
463
|
-
let
|
|
464
|
-
ref:
|
|
465
|
-
id:
|
|
1008
|
+
var Ke = ({ className: e }) => {
|
|
1009
|
+
let t = W();
|
|
1010
|
+
if (!t.isOpen) return null;
|
|
1011
|
+
let i = N(Te.dropdown, Te[t.color], t.contentProps?.className, t.dropdownClassName, e), o = /* @__PURE__ */ r("ul", {
|
|
1012
|
+
ref: t.setContentRef,
|
|
1013
|
+
id: t.contentId,
|
|
466
1014
|
role: "menu",
|
|
467
1015
|
tabIndex: -1,
|
|
468
|
-
"aria-labelledby":
|
|
469
|
-
"aria-activedescendant":
|
|
470
|
-
onKeyDown:
|
|
1016
|
+
"aria-labelledby": t.triggerId,
|
|
1017
|
+
"aria-activedescendant": t.activeIndex >= 0 && t.activeIndex < t.items.length ? t.getItemId(t.activeIndex) : void 0,
|
|
1018
|
+
onKeyDown: t.onKeyDown,
|
|
471
1019
|
style: {
|
|
472
|
-
...
|
|
473
|
-
...
|
|
1020
|
+
...t.surfaceStyle,
|
|
1021
|
+
...t.contentProps?.style
|
|
474
1022
|
},
|
|
475
|
-
className:
|
|
476
|
-
"data-color":
|
|
477
|
-
children:
|
|
1023
|
+
className: i,
|
|
1024
|
+
"data-color": t.color,
|
|
1025
|
+
children: [t.searchable && /* @__PURE__ */ r("li", {
|
|
1026
|
+
role: "presentation",
|
|
1027
|
+
className: N(Te.searchWrap, t.searchProps?.className),
|
|
1028
|
+
children: [/* @__PURE__ */ n(S, { "aria-hidden": "true" }), /* @__PURE__ */ n("input", {
|
|
1029
|
+
className: Te.search,
|
|
1030
|
+
value: t.searchValue,
|
|
1031
|
+
placeholder: t.searchPlaceholder,
|
|
1032
|
+
"aria-label": t.searchProps?.["aria-label"] ?? t.searchPlaceholder,
|
|
1033
|
+
onInput: (e) => t.setSearchValue(e.currentTarget.value),
|
|
1034
|
+
onChange: (e) => t.setSearchValue(e.target.value),
|
|
1035
|
+
onKeyDown: (e) => {
|
|
1036
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === "Escape" || e.stopPropagation();
|
|
1037
|
+
}
|
|
1038
|
+
})]
|
|
1039
|
+
}), t.loading ? /* @__PURE__ */ n(He, { children: t.loadingText }) : t.searchable && t.items.length === 0 ? /* @__PURE__ */ n(De, { children: t.noOptionsText }) : t.entries.length ? t.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ n(ke, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ n(K, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ n(Ge, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ n(De, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ n(He, { children: e.props.children }, e.id) : e.type === "arrow" ? /* @__PURE__ */ n(F, { ...e.props }, e.id) : /* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(Le, {
|
|
478
1040
|
item: e.item,
|
|
479
1041
|
itemIndex: e.itemIndex
|
|
480
|
-
}) }, e.item.id)) : /* @__PURE__ */
|
|
1042
|
+
}) }, e.item.id)) : /* @__PURE__ */ n(De, {})]
|
|
481
1043
|
});
|
|
482
|
-
return
|
|
1044
|
+
return t.portal ? /* @__PURE__ */ n(we, { children: o }) : o;
|
|
483
1045
|
};
|
|
484
|
-
|
|
1046
|
+
Ke.__velliraDropdownPart = "content", Ke.displayName = "Dropdown.Content";
|
|
485
1047
|
//#endregion
|
|
486
1048
|
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
487
|
-
var
|
|
488
|
-
let [t, n] =
|
|
489
|
-
return
|
|
1049
|
+
var qe = I("itemBadge", "Dropdown.ItemBadge"), Je = I("itemDescription", "Dropdown.ItemDescription"), Ye = I("itemIcon", "Dropdown.ItemIcon"), Xe = I("itemShortcut", "Dropdown.ItemShortcut"), Ze = I("radioGroup", "Dropdown.RadioGroup"), Qe = I("radioItem", "Dropdown.RadioItem"), $e = (e) => {
|
|
1050
|
+
let [t, n] = g(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
1051
|
+
return f(() => {
|
|
490
1052
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
491
1053
|
let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
|
|
492
1054
|
return r(), t.addEventListener("change", r), () => {
|
|
493
1055
|
t.removeEventListener("change", r);
|
|
494
1056
|
};
|
|
495
1057
|
}, [e]), t;
|
|
496
|
-
},
|
|
497
|
-
let
|
|
1058
|
+
}, et = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, matchTriggerWidth: a = !1, avoidCollisions: o = !0, mobileSheetBreakpoint: s, middleware: c = [] } = {}) => {
|
|
1059
|
+
let l = $e(s), { refs: u, floatingStyles: d, update: p, context: h, middlewareData: g, placement: _ } = k({
|
|
498
1060
|
open: e,
|
|
499
1061
|
onOpenChange: t,
|
|
500
1062
|
placement: n,
|
|
501
1063
|
strategy: r,
|
|
502
1064
|
transform: !1,
|
|
503
|
-
middleware:
|
|
504
|
-
|
|
505
|
-
...o ? [
|
|
506
|
-
|
|
507
|
-
!a ||
|
|
1065
|
+
middleware: m(() => [
|
|
1066
|
+
E(i),
|
|
1067
|
+
...o ? [T()] : [],
|
|
1068
|
+
O({ apply({ rects: e, elements: t }) {
|
|
1069
|
+
!a || l || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
508
1070
|
} }),
|
|
509
|
-
...o ? [
|
|
510
|
-
...
|
|
1071
|
+
...o ? [D({ padding: 8 })] : [],
|
|
1072
|
+
...c
|
|
511
1073
|
], [
|
|
512
1074
|
o,
|
|
1075
|
+
c,
|
|
513
1076
|
l,
|
|
514
|
-
d,
|
|
515
1077
|
a,
|
|
516
1078
|
i
|
|
517
1079
|
]),
|
|
518
|
-
whileElementsMounted:
|
|
1080
|
+
whileElementsMounted: w
|
|
519
1081
|
});
|
|
520
|
-
return
|
|
521
|
-
|
|
522
|
-
}, [
|
|
1082
|
+
return f(() => {
|
|
1083
|
+
l && u.floating.current?.style.removeProperty("width");
|
|
1084
|
+
}, [l, u.floating]), {
|
|
523
1085
|
context: h,
|
|
524
1086
|
placement: _,
|
|
525
1087
|
middlewareData: g,
|
|
526
|
-
floatingStyles:
|
|
527
|
-
isMobileSheet:
|
|
528
|
-
setRef:
|
|
529
|
-
setFloatingRef:
|
|
530
|
-
updatePosition:
|
|
1088
|
+
floatingStyles: l ? {} : d,
|
|
1089
|
+
isMobileSheet: l,
|
|
1090
|
+
setRef: u.setReference,
|
|
1091
|
+
setFloatingRef: u.setFloating,
|
|
1092
|
+
updatePosition: p
|
|
531
1093
|
};
|
|
532
|
-
}, Re = (e, t, n = !0) => {
|
|
533
|
-
let r = d(e);
|
|
534
|
-
r.current = e;
|
|
535
|
-
let i = d(t);
|
|
536
|
-
i.current = t, c(() => {
|
|
537
|
-
if (!n) return;
|
|
538
|
-
let e = (e) => {
|
|
539
|
-
let t = e.target;
|
|
540
|
-
r.current.every((e) => e.current && !e.current.contains(t)) && i.current();
|
|
541
|
-
};
|
|
542
|
-
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
543
|
-
}, [n]);
|
|
544
1094
|
};
|
|
545
1095
|
//#endregion
|
|
546
1096
|
//#region src/components/Dropdown/internal/composeEventHandlers.ts
|
|
547
|
-
function
|
|
1097
|
+
function tt(e, t) {
|
|
548
1098
|
return (n) => {
|
|
549
1099
|
e?.(n), n.defaultPrevented || t(n);
|
|
550
1100
|
};
|
|
551
1101
|
}
|
|
552
|
-
function
|
|
1102
|
+
function nt(...e) {
|
|
553
1103
|
return (t) => {
|
|
554
1104
|
e.forEach((e) => {
|
|
555
1105
|
if (e) {
|
|
@@ -562,155 +1112,183 @@ function Be(...e) {
|
|
|
562
1112
|
});
|
|
563
1113
|
};
|
|
564
1114
|
}
|
|
565
|
-
function
|
|
1115
|
+
function rt(e) {
|
|
566
1116
|
return typeof e == "number" ? `${e}px` : e;
|
|
567
1117
|
}
|
|
568
|
-
var
|
|
569
|
-
let
|
|
1118
|
+
var it = { wrapper: "_wrapper_14ue8_1" }, at = ({ children: e, open: t, defaultOpen: i = !1, onOpenChange: a, size: o = "md", color: s = "primary", placement: c = "bottom-start", offset: l = 2, matchTriggerWidth: d = !1, minWidth: _, maxWidth: v, portal: y = !0, avoidCollisions: b = !0, modal: x = !1, closeOnSelect: S = !0, loop: C = !0, disabled: w = !1, loading: T = !1, loadingText: E = "Loading actions...", searchable: D = !1, command: O = !1, searchValue: k, defaultSearchValue: A = "", searchPlaceholder: j, onSearch: M, empty: P, noOptionsText: F, triggerClassName: I, dropdownClassName: R, className: z }) => {
|
|
1119
|
+
let ee = p(), B = `${ee}-trigger`, te = `${ee}-menu`, ne = h(null), re = h(null), [ie, ae] = g(), [oe, V] = g({}), [ce, le] = g(A), de = k ?? ce, H = m(() => L(e), [e]), fe = H.content?.props.command ?? !1, me = D || O || fe || !!H.search, he = m(() => st(H.items), [H.items]), ge = m(() => H.items.map((e) => ({
|
|
570
1120
|
disabled: e.disabled,
|
|
571
1121
|
label: e.label
|
|
572
|
-
})), [
|
|
573
|
-
|
|
574
|
-
|
|
1122
|
+
})), [H.items]), _e = m(() => !me || !de.trim() ? H : ct(H, de), [
|
|
1123
|
+
me,
|
|
1124
|
+
H,
|
|
1125
|
+
de
|
|
1126
|
+
]), ye = m(() => _e.items.map((e) => ({
|
|
1127
|
+
disabled: e.disabled,
|
|
1128
|
+
label: e.label
|
|
1129
|
+
})), [_e.items]);
|
|
1130
|
+
f(() => {
|
|
1131
|
+
V((e) => {
|
|
575
1132
|
let t = { ...e };
|
|
576
|
-
return
|
|
1133
|
+
return he.forEach((e) => {
|
|
577
1134
|
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
578
1135
|
}), t;
|
|
579
1136
|
});
|
|
580
|
-
}, [
|
|
581
|
-
let {
|
|
1137
|
+
}, [he]);
|
|
1138
|
+
let { activeIndex: be, setActiveIndex: xe, isOpen: U, closeDropdown: Se, toggleDropdown: Ce, onKeyDown: we } = ve({
|
|
1139
|
+
items: me ? ye : ge,
|
|
582
1140
|
open: t,
|
|
583
|
-
|
|
584
|
-
placement: s,
|
|
585
|
-
matchTriggerWidth: m,
|
|
586
|
-
avoidCollisions: b,
|
|
587
|
-
offset: p,
|
|
588
|
-
mobileSheetBreakpoint: 640
|
|
589
|
-
}), { activeIndex: ie, setActiveIndex: ae, isOpen: H, closeDropdown: U, toggleDropdown: oe, onKeyDown: se } = F({
|
|
590
|
-
items: z,
|
|
591
|
-
open: t,
|
|
592
|
-
defaultOpen: n,
|
|
1141
|
+
defaultOpen: i,
|
|
593
1142
|
disabled: w,
|
|
594
|
-
onOpenChange:
|
|
595
|
-
getItemValue: (e, t) =>
|
|
1143
|
+
onOpenChange: a,
|
|
1144
|
+
getItemValue: (e, t) => (me ? _e.items : H.items)[t]?.id ?? "",
|
|
596
1145
|
getItemText: (e) => e.label,
|
|
597
1146
|
loop: C
|
|
1147
|
+
}), { floatingStyles: Te, setRef: Ee, setFloatingRef: De } = et({
|
|
1148
|
+
open: U,
|
|
1149
|
+
placement: c,
|
|
1150
|
+
matchTriggerWidth: d,
|
|
1151
|
+
avoidCollisions: b,
|
|
1152
|
+
offset: l,
|
|
1153
|
+
mobileSheetBreakpoint: 640
|
|
1154
|
+
}), Oe = u((e) => {
|
|
1155
|
+
k === void 0 && le(e), M?.(e), xe(0);
|
|
1156
|
+
}, [
|
|
1157
|
+
M,
|
|
1158
|
+
k,
|
|
1159
|
+
xe
|
|
1160
|
+
]), { isTopOverlay: ke } = ue({
|
|
1161
|
+
active: U,
|
|
1162
|
+
id: te
|
|
598
1163
|
});
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}, [
|
|
606
|
-
let ce = o(() => {
|
|
607
|
-
U(), j.current?.focus();
|
|
608
|
-
}, [U]), le = o((e, t) => {
|
|
1164
|
+
pe({
|
|
1165
|
+
active: U,
|
|
1166
|
+
enabled: x
|
|
1167
|
+
});
|
|
1168
|
+
let Ae = u(() => {
|
|
1169
|
+
Se(), ne.current?.focus();
|
|
1170
|
+
}, [Se]), je = u((e, t) => {
|
|
609
1171
|
if (e.disabled || T) return;
|
|
610
1172
|
if (e.type === "subTrigger") {
|
|
611
|
-
|
|
1173
|
+
ae(e.id);
|
|
612
1174
|
return;
|
|
613
1175
|
}
|
|
614
|
-
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (
|
|
1176
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (V((t) => ({
|
|
615
1177
|
...t,
|
|
616
1178
|
[e.groupId]: e.props.value
|
|
617
1179
|
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
618
1180
|
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && S);
|
|
619
|
-
!t.defaultPrevented && n &&
|
|
1181
|
+
!t.defaultPrevented && n && Ae();
|
|
620
1182
|
}, [
|
|
621
|
-
|
|
1183
|
+
Ae,
|
|
622
1184
|
S,
|
|
623
1185
|
T
|
|
624
|
-
]),
|
|
625
|
-
let t =
|
|
1186
|
+
]), Me = u((e) => {
|
|
1187
|
+
let t = _e.items[be];
|
|
626
1188
|
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
627
|
-
e.preventDefault(),
|
|
1189
|
+
e.preventDefault(), ae(t.id);
|
|
628
1190
|
return;
|
|
629
1191
|
}
|
|
630
|
-
if (e.key === "ArrowLeft" &&
|
|
631
|
-
e.preventDefault(),
|
|
1192
|
+
if (e.key === "ArrowLeft" && ie) {
|
|
1193
|
+
e.preventDefault(), ae(void 0);
|
|
632
1194
|
return;
|
|
633
1195
|
}
|
|
634
1196
|
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
635
1197
|
e.preventDefault();
|
|
636
|
-
let n =
|
|
637
|
-
|
|
1198
|
+
let n = ot(e);
|
|
1199
|
+
je(t, n);
|
|
638
1200
|
return;
|
|
639
1201
|
}
|
|
640
|
-
|
|
1202
|
+
we(e), e.key === "Escape" && ne.current?.focus();
|
|
641
1203
|
}, [
|
|
1204
|
+
be,
|
|
1205
|
+
_e.items,
|
|
1206
|
+
we,
|
|
642
1207
|
ie,
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
1208
|
+
je
|
|
1209
|
+
]), W = u((e) => {
|
|
1210
|
+
e.preventDefault(), Ce();
|
|
1211
|
+
}, [Ce]), Fe = u((e) => {
|
|
1212
|
+
ne.current = e, Ee(e);
|
|
1213
|
+
}, [Ee]), G = u((e) => {
|
|
1214
|
+
re.current = e, De(e), e?.focus();
|
|
1215
|
+
}, [De]);
|
|
1216
|
+
se({
|
|
1217
|
+
active: U,
|
|
1218
|
+
closeOnEscape: !0,
|
|
1219
|
+
closeOnOutsidePress: !0,
|
|
1220
|
+
contentRef: re,
|
|
1221
|
+
ignoreRefs: [ne],
|
|
1222
|
+
isTopOverlay: ke,
|
|
1223
|
+
requestClose: Se
|
|
1224
|
+
});
|
|
1225
|
+
let Ie = {
|
|
1226
|
+
...Te,
|
|
1227
|
+
minWidth: rt(_),
|
|
1228
|
+
maxWidth: rt(v)
|
|
659
1229
|
};
|
|
660
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ n(Pe, {
|
|
661
1231
|
value: {
|
|
662
1232
|
disabled: w,
|
|
663
|
-
isOpen:
|
|
664
|
-
contentId:
|
|
665
|
-
triggerId:
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
1233
|
+
isOpen: U,
|
|
1234
|
+
contentId: te,
|
|
1235
|
+
triggerId: B,
|
|
1236
|
+
triggerClassName: I,
|
|
1237
|
+
setTriggerRef: Fe,
|
|
1238
|
+
onClick: W,
|
|
1239
|
+
onKeyDown: Me
|
|
669
1240
|
},
|
|
670
|
-
children: /* @__PURE__ */
|
|
1241
|
+
children: /* @__PURE__ */ n(Ne, {
|
|
671
1242
|
value: {
|
|
672
|
-
activeIndex:
|
|
1243
|
+
activeIndex: be,
|
|
673
1244
|
closeOnSelect: S,
|
|
674
|
-
color:
|
|
675
|
-
contentId:
|
|
676
|
-
contentProps:
|
|
1245
|
+
color: s,
|
|
1246
|
+
contentId: te,
|
|
1247
|
+
contentProps: H.content?.props,
|
|
677
1248
|
disabled: w,
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
1249
|
+
dropdownClassName: R,
|
|
1250
|
+
entries: _e.entries,
|
|
1251
|
+
getItemId: (e) => `${te}-item-${e}`,
|
|
1252
|
+
isOpen: U,
|
|
1253
|
+
items: _e.items,
|
|
682
1254
|
loading: T,
|
|
683
1255
|
loadingText: E,
|
|
1256
|
+
noOptionsText: P ?? F,
|
|
684
1257
|
maxWidth: v,
|
|
685
|
-
minWidth:
|
|
686
|
-
openSubId:
|
|
687
|
-
onKeyDown:
|
|
688
|
-
portal: y,
|
|
689
|
-
radioValues:
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
1258
|
+
minWidth: _,
|
|
1259
|
+
openSubId: ie,
|
|
1260
|
+
onKeyDown: Me,
|
|
1261
|
+
portal: !H.portal && y,
|
|
1262
|
+
radioValues: oe,
|
|
1263
|
+
searchPlaceholder: H.search?.props.placeholder ?? j ?? (O || fe ? "Type a command..." : "Search actions..."),
|
|
1264
|
+
searchProps: H.search?.props,
|
|
1265
|
+
searchValue: de,
|
|
1266
|
+
searchable: me,
|
|
1267
|
+
selectItem: je,
|
|
1268
|
+
setActiveIndex: xe,
|
|
1269
|
+
setContentRef: G,
|
|
1270
|
+
setOpenSubId: ae,
|
|
694
1271
|
setRadioValue: (e, t) => {
|
|
695
|
-
|
|
1272
|
+
V((n) => ({
|
|
696
1273
|
...n,
|
|
697
1274
|
[e]: t
|
|
698
1275
|
}));
|
|
699
1276
|
},
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
1277
|
+
setSearchValue: Oe,
|
|
1278
|
+
size: o,
|
|
1279
|
+
surfaceStyle: Ie,
|
|
1280
|
+
triggerId: B
|
|
703
1281
|
},
|
|
704
|
-
children: /* @__PURE__ */
|
|
705
|
-
className:
|
|
1282
|
+
children: /* @__PURE__ */ r("div", {
|
|
1283
|
+
className: N(it.wrapper, z),
|
|
706
1284
|
"data-disabled": w || void 0,
|
|
707
|
-
children: [
|
|
1285
|
+
children: [H.trigger ?? null, H.portal ?? H.content ?? /* @__PURE__ */ n(Ke, { className: R })]
|
|
708
1286
|
})
|
|
709
1287
|
})
|
|
710
1288
|
});
|
|
711
1289
|
};
|
|
712
|
-
|
|
713
|
-
function
|
|
1290
|
+
at.displayName = "DropdownRoot";
|
|
1291
|
+
function ot(e) {
|
|
714
1292
|
let t = !1;
|
|
715
1293
|
return {
|
|
716
1294
|
originalEvent: e,
|
|
@@ -722,15 +1300,23 @@ function He(e) {
|
|
|
722
1300
|
}
|
|
723
1301
|
};
|
|
724
1302
|
}
|
|
725
|
-
function
|
|
1303
|
+
function st(e) {
|
|
726
1304
|
let t = [];
|
|
727
1305
|
return e.forEach((e) => {
|
|
728
|
-
t.push(e), e.type === "subTrigger" && t.push(...
|
|
1306
|
+
t.push(e), e.type === "subTrigger" && t.push(...st(e.subItems));
|
|
729
1307
|
}), t;
|
|
730
1308
|
}
|
|
1309
|
+
function ct(e, t) {
|
|
1310
|
+
let n = t.trim().toLocaleLowerCase(), r = new Set(e.items.filter((e) => e.label.toLocaleLowerCase().includes(n)).map((e) => e.id)), i = e.items.filter((e) => r.has(e.id));
|
|
1311
|
+
return {
|
|
1312
|
+
...e,
|
|
1313
|
+
items: i,
|
|
1314
|
+
entries: e.entries.filter((e) => e.type !== "item" || r.has(e.item.id))
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
731
1317
|
//#endregion
|
|
732
|
-
//#region src/components/Dropdown/
|
|
733
|
-
var
|
|
1318
|
+
//#region src/components/Dropdown/Search/DropdownSearch.tsx
|
|
1319
|
+
var lt = I("search", "Dropdown.Search"), ut = I("subContent", "Dropdown.SubContent"), dt = I("subTrigger", "Dropdown.SubTrigger"), ft = I("sub", "Dropdown.Sub"), pt = {
|
|
734
1320
|
button: "_button_bb3ib_1",
|
|
735
1321
|
disabled: "_disabled_bb3ib_63",
|
|
736
1322
|
arrow: "_arrow_bb3ib_71",
|
|
@@ -746,200 +1332,393 @@ var We = B("subContent", "Dropdown.SubContent"), Ge = B("subTrigger", "Dropdown.
|
|
|
746
1332
|
lg: "_lg_bb3ib_350",
|
|
747
1333
|
label: "_label_bb3ib_362",
|
|
748
1334
|
open: "_open_bb3ib_390"
|
|
749
|
-
},
|
|
750
|
-
|
|
751
|
-
var
|
|
752
|
-
let
|
|
753
|
-
id:
|
|
754
|
-
ref:
|
|
755
|
-
"aria-controls":
|
|
756
|
-
"aria-disabled":
|
|
757
|
-
"aria-expanded":
|
|
1335
|
+
}, mt = (e) => /* @__PURE__ */ n(ht, { ...e });
|
|
1336
|
+
mt.__velliraDropdownPart = "trigger", mt.displayName = "Dropdown.Trigger";
|
|
1337
|
+
var ht = ({ children: e, asChild: t = !1, disabled: i, className: a }) => {
|
|
1338
|
+
let s = W(), c = Fe(), u = t && l(e) ? e : void 0, d = s.disabled || i, f = {
|
|
1339
|
+
id: c.triggerId,
|
|
1340
|
+
ref: u ? nt(u.props.ref, c.setTriggerRef) : c.setTriggerRef,
|
|
1341
|
+
"aria-controls": c.isOpen ? c.contentId : void 0,
|
|
1342
|
+
"aria-disabled": d || void 0,
|
|
1343
|
+
"aria-expanded": c.isOpen,
|
|
758
1344
|
"aria-haspopup": "menu",
|
|
759
|
-
className:
|
|
760
|
-
"data-state":
|
|
761
|
-
disabled:
|
|
762
|
-
onClick:
|
|
763
|
-
onKeyDown:
|
|
1345
|
+
className: N(!u && pt.button, !u && pt[s.size], !u && pt[s.color], c.triggerClassName, a),
|
|
1346
|
+
"data-state": c.isOpen ? "open" : "closed",
|
|
1347
|
+
disabled: d || void 0,
|
|
1348
|
+
onClick: tt(u?.props.onClick, c.onClick),
|
|
1349
|
+
onKeyDown: tt(u?.props.onKeyDown, c.onKeyDown)
|
|
764
1350
|
};
|
|
765
|
-
return
|
|
766
|
-
...
|
|
767
|
-
className:
|
|
768
|
-
}) : /* @__PURE__ */
|
|
1351
|
+
return u ? o(u, {
|
|
1352
|
+
...f,
|
|
1353
|
+
className: N(u.props.className, a)
|
|
1354
|
+
}) : /* @__PURE__ */ r("button", {
|
|
769
1355
|
type: "button",
|
|
770
|
-
...
|
|
771
|
-
children: [/* @__PURE__ */
|
|
772
|
-
className:
|
|
1356
|
+
...f,
|
|
1357
|
+
children: [/* @__PURE__ */ n("span", {
|
|
1358
|
+
className: pt.label,
|
|
773
1359
|
children: e
|
|
774
|
-
}), /* @__PURE__ */
|
|
775
|
-
className:
|
|
1360
|
+
}), /* @__PURE__ */ n("span", {
|
|
1361
|
+
className: N(pt.arrow, { [pt.open]: c.isOpen }),
|
|
776
1362
|
"aria-hidden": "true",
|
|
777
|
-
children: /* @__PURE__ */
|
|
1363
|
+
children: /* @__PURE__ */ n(y, {})
|
|
778
1364
|
})]
|
|
779
1365
|
});
|
|
780
1366
|
};
|
|
781
|
-
|
|
1367
|
+
ht.displayName = "DropdownTriggerSurface";
|
|
782
1368
|
//#endregion
|
|
783
1369
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
784
|
-
var
|
|
785
|
-
Trigger:
|
|
786
|
-
Content:
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
1370
|
+
var gt = Object.assign(at, {
|
|
1371
|
+
Trigger: mt,
|
|
1372
|
+
Content: Ke,
|
|
1373
|
+
Search: lt,
|
|
1374
|
+
Item: Ie,
|
|
1375
|
+
CheckboxItem: B,
|
|
1376
|
+
RadioGroup: Ze,
|
|
1377
|
+
RadioItem: Qe,
|
|
1378
|
+
Group: Oe,
|
|
1379
|
+
Label: Ve,
|
|
1380
|
+
Separator: We,
|
|
1381
|
+
Sub: ft,
|
|
1382
|
+
SubTrigger: dt,
|
|
1383
|
+
SubContent: ut,
|
|
1384
|
+
ItemIcon: Ye,
|
|
1385
|
+
ItemDescription: Je,
|
|
1386
|
+
ItemBadge: qe,
|
|
1387
|
+
ItemShortcut: Xe,
|
|
1388
|
+
Icon: Ye,
|
|
1389
|
+
Description: Je,
|
|
1390
|
+
Badge: qe,
|
|
1391
|
+
Shortcut: Xe,
|
|
1392
|
+
Arrow: F,
|
|
1393
|
+
Empty: Ee,
|
|
1394
|
+
Loading: q
|
|
803
1395
|
});
|
|
804
|
-
|
|
1396
|
+
gt.displayName = "Dropdown";
|
|
805
1397
|
//#endregion
|
|
806
|
-
//#region src/components/Modal/ModalContext.tsx
|
|
807
|
-
var
|
|
808
|
-
let e =
|
|
1398
|
+
//#region src/components/Modal/internal/ModalContext.tsx
|
|
1399
|
+
var _t = s(void 0), vt = s(void 0), yt = () => {
|
|
1400
|
+
let e = d(_t);
|
|
809
1401
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
810
1402
|
return e;
|
|
811
|
-
};
|
|
812
|
-
|
|
813
|
-
var
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
1403
|
+
}, bt = () => d(vt), xt = _t.Provider, St = vt.Provider;
|
|
1404
|
+
_t.displayName = "ModalContext", vt.displayName = "ModalContentContext";
|
|
1405
|
+
var Ct = {
|
|
1406
|
+
modalBody: "_modalBody_ou4ff_1",
|
|
1407
|
+
inside: "_inside_ou4ff_6"
|
|
1408
|
+
}, wt = ({ children: e, className: t }) => {
|
|
1409
|
+
let r = bt();
|
|
1410
|
+
return /* @__PURE__ */ n("div", {
|
|
1411
|
+
className: N(Ct.modalBody, r?.scrollBehavior === "inside" && Ct.inside, t),
|
|
818
1412
|
children: e
|
|
819
1413
|
});
|
|
820
1414
|
};
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
1415
|
+
wt.displayName = "ModalBody";
|
|
1416
|
+
//#endregion
|
|
1417
|
+
//#region src/components/Modal/internal/composeEventHandlers.ts
|
|
1418
|
+
function Tt(e, t) {
|
|
1419
|
+
return (n) => {
|
|
1420
|
+
e?.(n), n.defaultPrevented || t(n);
|
|
1421
|
+
};
|
|
1422
|
+
}
|
|
1423
|
+
function Et(...e) {
|
|
1424
|
+
return (t) => {
|
|
1425
|
+
e.forEach((e) => {
|
|
1426
|
+
if (e) {
|
|
1427
|
+
if (typeof e == "function") {
|
|
1428
|
+
e(t);
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
e.current = t;
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
var Dt = {
|
|
1437
|
+
modalHeader: "_modalHeader_hw9hl_1",
|
|
1438
|
+
modalHeaderText: "_modalHeaderText_hw9hl_8",
|
|
1439
|
+
modalHeaderTitle: "_modalHeaderTitle_hw9hl_13",
|
|
1440
|
+
modalHeaderDescription: "_modalHeaderDescription_hw9hl_20",
|
|
1441
|
+
modalHeaderCloseButton: "_modalHeaderCloseButton_hw9hl_26"
|
|
1442
|
+
}, Ot = ({ asChild: e = !1, children: t, className: r, "aria-label": i }) => {
|
|
1443
|
+
let a = yt(), s = e && l(t) ? t : void 0, c = {
|
|
1444
|
+
"aria-label": s ? i : i ?? "Close dialog",
|
|
1445
|
+
className: N(!s && Dt.modalHeaderCloseButton, r),
|
|
1446
|
+
onClick: Tt(s?.props.onClick, a.requestClose)
|
|
1447
|
+
};
|
|
1448
|
+
return s ? o(s, {
|
|
1449
|
+
...c,
|
|
1450
|
+
className: N(s.props.className, r),
|
|
1451
|
+
"aria-label": i ?? s.props["aria-label"]
|
|
1452
|
+
}) : /* @__PURE__ */ n("button", {
|
|
1453
|
+
type: "button",
|
|
1454
|
+
...c,
|
|
1455
|
+
children: /* @__PURE__ */ n(x, { size: 16 })
|
|
1456
|
+
});
|
|
1457
|
+
};
|
|
1458
|
+
Ot.displayName = "Modal.Close";
|
|
1459
|
+
//#endregion
|
|
1460
|
+
//#region src/components/Modal/internal/useModalDismiss.ts
|
|
1461
|
+
var kt = ({ active: e, contentRef: t, closeOnEscape: n, closeOnOutsidePress: r, isTopModal: i, onEscapeKeyDown: a, onPointerDownOutside: o, onInteractOutside: s, requestClose: c }) => {
|
|
1462
|
+
se({
|
|
1463
|
+
active: e,
|
|
1464
|
+
closeOnOutsidePress: r,
|
|
1465
|
+
closeOnEscape: n,
|
|
1466
|
+
contentRef: t,
|
|
1467
|
+
isTopOverlay: i,
|
|
1468
|
+
onEscapeKeyDown: a ? (e) => a(e) : void 0,
|
|
1469
|
+
onInteractOutside: s ? (e) => s(e) : void 0,
|
|
1470
|
+
onPointerDownOutside: o ? (e) => o(e) : void 0,
|
|
1471
|
+
requestClose: c
|
|
1472
|
+
});
|
|
1473
|
+
}, At = {
|
|
1474
|
+
content: "_content_15uod_1",
|
|
1475
|
+
animated: "_animated_15uod_23",
|
|
1476
|
+
center: "_center_15uod_30",
|
|
1477
|
+
top: "_top_15uod_39",
|
|
1478
|
+
sm: "_sm_15uod_48",
|
|
1479
|
+
md: "_md_15uod_52",
|
|
1480
|
+
lg: "_lg_15uod_56",
|
|
1481
|
+
xl: "_xl_15uod_60",
|
|
1482
|
+
full: "_full_15uod_64",
|
|
1483
|
+
inside: "_inside_15uod_70",
|
|
1484
|
+
outside: "_outside_15uod_74"
|
|
1485
|
+
}, jt = ({ children: e, size: t = "md", placement: r = "center", scrollBehavior: i = "inside", animated: a = !0, forceMount: o = !1, ariaLabel: s, ariaLabelledBy: c, ariaDescribedBy: l, className: d, style: f }) => {
|
|
1486
|
+
let p = yt(), m = p.open, [h, _] = g(null), v = u((e) => {
|
|
1487
|
+
p.setContentRef(e), _(e);
|
|
1488
|
+
}, [p]);
|
|
1489
|
+
if (kt({
|
|
1490
|
+
active: m,
|
|
1491
|
+
contentRef: p.contentRef,
|
|
1492
|
+
closeOnEscape: p.closeOnEscape,
|
|
1493
|
+
closeOnOutsidePress: p.closeOnOutsidePress,
|
|
1494
|
+
isTopModal: p.isTopModal,
|
|
1495
|
+
onEscapeKeyDown: p.onEscapeKeyDown,
|
|
1496
|
+
onInteractOutside: p.onInteractOutside,
|
|
1497
|
+
onPointerDownOutside: p.onPointerDownOutside,
|
|
1498
|
+
requestClose: p.requestClose
|
|
1499
|
+
}), V({
|
|
1500
|
+
active: m,
|
|
1501
|
+
contentRef: p.contentRef,
|
|
1502
|
+
enabled: p.trapFocus,
|
|
1503
|
+
finalFocus: p.finalFocus,
|
|
1504
|
+
initialFocus: p.initialFocus,
|
|
1505
|
+
onCloseAutoFocus: p.onCloseAutoFocus,
|
|
1506
|
+
onOpenAutoFocus: p.onOpenAutoFocus,
|
|
1507
|
+
restoreFocus: p.restoreFocus
|
|
1508
|
+
}), te({
|
|
1509
|
+
active: m,
|
|
1510
|
+
content: h,
|
|
1511
|
+
enabled: p.modal
|
|
1512
|
+
}), !m && !o) return null;
|
|
1513
|
+
let y = c ?? (s ? void 0 : p.titleId), b = l ?? p.descriptionId;
|
|
1514
|
+
return /* @__PURE__ */ n(St, {
|
|
1515
|
+
value: { scrollBehavior: i },
|
|
1516
|
+
children: /* @__PURE__ */ n("div", {
|
|
1517
|
+
id: p.contentId,
|
|
1518
|
+
ref: Et(v),
|
|
1519
|
+
tabIndex: -1,
|
|
1520
|
+
className: N(At.content, At[t], At[r], At[i], a && At.animated, d),
|
|
1521
|
+
style: f,
|
|
1522
|
+
role: p.role,
|
|
1523
|
+
"aria-modal": p.modal ? "true" : void 0,
|
|
1524
|
+
"aria-label": s,
|
|
1525
|
+
"aria-labelledby": y,
|
|
1526
|
+
"aria-describedby": b,
|
|
1527
|
+
"data-state": m ? "open" : "closed",
|
|
1528
|
+
children: e
|
|
1529
|
+
})
|
|
1530
|
+
});
|
|
1531
|
+
};
|
|
1532
|
+
jt.displayName = "ModalContent";
|
|
1533
|
+
var Mt = { modalFooter: "_modalFooter_sb1pn_1" }, Nt = ({ children: e, className: t }) => /* @__PURE__ */ n("div", {
|
|
1534
|
+
className: N(Mt.modalFooter, t),
|
|
829
1535
|
children: e
|
|
830
1536
|
});
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
children: [/* @__PURE__ */ g("h2", {
|
|
841
|
-
id: n,
|
|
842
|
-
className: at.modalHeaderTitle,
|
|
843
|
-
children: e
|
|
844
|
-
}), t && /* @__PURE__ */ g("button", {
|
|
845
|
-
type: "button",
|
|
846
|
-
className: at.modalHeaderCloseButton,
|
|
847
|
-
onClick: t,
|
|
848
|
-
"aria-label": "Close modal",
|
|
849
|
-
children: /* @__PURE__ */ g(x, { size: 16 })
|
|
850
|
-
})]
|
|
1537
|
+
Nt.displayName = "ModalFooter";
|
|
1538
|
+
//#endregion
|
|
1539
|
+
//#region src/components/Modal/Header/ModalDescription.tsx
|
|
1540
|
+
var Pt = ({ children: e }) => {
|
|
1541
|
+
let { descriptionId: t, setDescriptionPresent: r } = yt();
|
|
1542
|
+
return f(() => (r(!0), () => r(!1)), [r]), /* @__PURE__ */ n("p", {
|
|
1543
|
+
id: t,
|
|
1544
|
+
className: Dt.modalHeaderDescription,
|
|
1545
|
+
children: e
|
|
851
1546
|
});
|
|
852
1547
|
};
|
|
853
|
-
|
|
1548
|
+
Pt.displayName = "Modal.Description";
|
|
854
1549
|
//#endregion
|
|
855
|
-
//#region src/
|
|
856
|
-
var
|
|
857
|
-
let
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
"overlay--open": "_overlay--open_dcudn_14",
|
|
864
|
-
modal: "_modal_dcudn_20",
|
|
865
|
-
"overlay--animated": "_overlay--animated_dcudn_28"
|
|
866
|
-
}, lt = 0, ut = "", dt = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: i, closeOnClick: a, closeOnEsc: s = !0, zIndex: l = 1e3, animated: u = !0 }) => {
|
|
867
|
-
let f = i ?? a ?? !0, p = d(null), { titleId: m, descriptionId: h } = Qe(), _ = o((e) => {
|
|
868
|
-
f && e.target === e.currentTarget && t?.();
|
|
869
|
-
}, [f, t]);
|
|
870
|
-
return st({
|
|
871
|
-
isOpen: n,
|
|
872
|
-
onClose: s ? t : void 0
|
|
873
|
-
}), c(() => {
|
|
874
|
-
if (n) return lt === 0 && (ut = document.body.style.overflow), lt += 1, document.body.style.overflow = "hidden", () => {
|
|
875
|
-
lt = Math.max(0, lt - 1), lt === 0 && (document.body.style.overflow = ut);
|
|
876
|
-
};
|
|
877
|
-
}, [n]), !n && !u ? null : /* @__PURE__ */ g(H, { children: /* @__PURE__ */ g("div", {
|
|
878
|
-
className: V(ct.overlay, n && ct["overlay--open"], u && ct["overlay--animated"], r),
|
|
879
|
-
onClick: _,
|
|
880
|
-
tabIndex: -1,
|
|
881
|
-
role: "presentation",
|
|
882
|
-
"aria-hidden": !n,
|
|
883
|
-
style: { zIndex: l },
|
|
884
|
-
children: /* @__PURE__ */ g(z, {
|
|
885
|
-
active: n,
|
|
886
|
-
focusTrapOptions: {
|
|
887
|
-
fallbackFocus: () => p.current,
|
|
888
|
-
returnFocusOnDeactivate: !0,
|
|
889
|
-
allowOutsideClick: !0
|
|
890
|
-
},
|
|
891
|
-
children: /* @__PURE__ */ g("div", {
|
|
892
|
-
ref: p,
|
|
893
|
-
tabIndex: -1,
|
|
894
|
-
className: ct.modal,
|
|
895
|
-
role: "dialog",
|
|
896
|
-
"aria-modal": "true",
|
|
897
|
-
"aria-labelledby": m,
|
|
898
|
-
"aria-describedby": h,
|
|
899
|
-
children: e
|
|
900
|
-
})
|
|
901
|
-
})
|
|
902
|
-
}) });
|
|
1550
|
+
//#region src/components/Modal/Header/ModalTitle.tsx
|
|
1551
|
+
var Ft = ({ children: e }) => {
|
|
1552
|
+
let { setTitlePresent: t, titleId: r } = yt();
|
|
1553
|
+
return f(() => (t(!0), () => t(!1)), [t]), /* @__PURE__ */ n("h2", {
|
|
1554
|
+
id: r,
|
|
1555
|
+
className: Dt.modalHeaderTitle,
|
|
1556
|
+
children: e
|
|
1557
|
+
});
|
|
903
1558
|
};
|
|
904
|
-
|
|
1559
|
+
Ft.displayName = "Modal.Title";
|
|
905
1560
|
//#endregion
|
|
906
|
-
//#region src/components/Modal/
|
|
907
|
-
var
|
|
908
|
-
let
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
1561
|
+
//#region src/components/Modal/Header/ModalHeader.tsx
|
|
1562
|
+
var It = ({ children: e, title: t, description: i, showClose: a = !1, className: o }) => {
|
|
1563
|
+
let s = t !== void 0 || i !== void 0;
|
|
1564
|
+
return /* @__PURE__ */ r("div", {
|
|
1565
|
+
className: N(Dt.modalHeader, o),
|
|
1566
|
+
children: [s ? /* @__PURE__ */ r("div", {
|
|
1567
|
+
className: Dt.modalHeaderText,
|
|
1568
|
+
children: [t !== void 0 && /* @__PURE__ */ n(Ft, { children: t }), i !== void 0 && /* @__PURE__ */ n(Pt, { children: i })]
|
|
1569
|
+
}) : e, a && /* @__PURE__ */ n(Ot, {})]
|
|
914
1570
|
});
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1571
|
+
};
|
|
1572
|
+
It.displayName = "ModalHeader";
|
|
1573
|
+
var Lt = {
|
|
1574
|
+
overlay: "_overlay_57sfi_1",
|
|
1575
|
+
"overlay--open": "_overlay--open_57sfi_11",
|
|
1576
|
+
"overlay--animated": "_overlay--animated_57sfi_18"
|
|
1577
|
+
}, Rt = ({ className: e, animated: t = !0, forceMount: r = !1 }) => {
|
|
1578
|
+
let { open: i } = yt();
|
|
1579
|
+
return !i && !r ? null : /* @__PURE__ */ n("div", {
|
|
1580
|
+
className: N(Lt.overlay, i && Lt["overlay--open"], t && Lt["overlay--animated"], e),
|
|
1581
|
+
"data-state": i ? "open" : "closed",
|
|
1582
|
+
"aria-hidden": "true"
|
|
1583
|
+
});
|
|
1584
|
+
};
|
|
1585
|
+
Rt.displayName = "ModalOverlay";
|
|
1586
|
+
//#endregion
|
|
1587
|
+
//#region src/components/Modal/Root/ModalRoot.tsx
|
|
1588
|
+
var zt = ({ children: e, open: t, defaultOpen: r = !1, onOpenChange: i, modal: a = !0, closeOnEscape: o = !0, closeOnOutsidePress: s = !0, preventScroll: c = !0, restoreFocus: l = !0, trapFocus: d = !0, initialFocus: p, finalFocus: _, onOpenAutoFocus: v, onCloseAutoFocus: y, onEscapeKeyDown: b, onPointerDownOutside: x, onInteractOutside: S, role: C = "dialog", className: w }) => {
|
|
1589
|
+
let T = h(null), { contentId: E, descriptionId: D, open: O, requestClose: k, setOpen: A, titleId: j } = ye({
|
|
1590
|
+
open: t,
|
|
1591
|
+
defaultOpen: r,
|
|
1592
|
+
onOpenChange: i,
|
|
1593
|
+
closeOnEscape: o,
|
|
1594
|
+
closeOnOutsidePress: s
|
|
1595
|
+
}), [M, P] = g(!1), [F, I] = g(!1), L = O, R = u(() => {
|
|
1596
|
+
k();
|
|
1597
|
+
}, [k]), z = u((e) => {
|
|
1598
|
+
T.current = e;
|
|
1599
|
+
}, []), { isTopOverlay: ee } = ue({
|
|
1600
|
+
active: O,
|
|
1601
|
+
id: E
|
|
1602
|
+
});
|
|
1603
|
+
return pe({
|
|
1604
|
+
active: O,
|
|
1605
|
+
enabled: c
|
|
1606
|
+
}), f(() => {
|
|
1607
|
+
process.env.NODE_ENV === "production" || !O || M || T.current?.hasAttribute("aria-label") || console.warn("Modal.Content requires Modal.Title or ariaLabel.");
|
|
1608
|
+
}, [O, M]), f(() => {
|
|
1609
|
+
process.env.NODE_ENV === "production" || !O || C !== "alertdialog" || F || console.warn("Modal with role=\"alertdialog\" requires Modal.Description.");
|
|
1610
|
+
}, [
|
|
1611
|
+
F,
|
|
1612
|
+
O,
|
|
1613
|
+
C
|
|
1614
|
+
]), /* @__PURE__ */ n(xt, {
|
|
1615
|
+
value: m(() => ({
|
|
1616
|
+
closeOnEscape: o,
|
|
1617
|
+
closeOnOutsidePress: s,
|
|
1618
|
+
contentId: E,
|
|
1619
|
+
contentRef: T,
|
|
1620
|
+
descriptionId: D,
|
|
1621
|
+
finalFocus: _,
|
|
1622
|
+
initialFocus: p,
|
|
1623
|
+
isTopModal: ee,
|
|
1624
|
+
modal: a,
|
|
1625
|
+
onCloseAutoFocus: y,
|
|
1626
|
+
onEscapeKeyDown: b,
|
|
1627
|
+
onInteractOutside: S,
|
|
1628
|
+
onOpenAutoFocus: v,
|
|
1629
|
+
onPointerDownOutside: x,
|
|
1630
|
+
open: O,
|
|
1631
|
+
preventScroll: c,
|
|
1632
|
+
requestClose: R,
|
|
1633
|
+
restoreFocus: l,
|
|
1634
|
+
role: C,
|
|
1635
|
+
setContentRef: z,
|
|
1636
|
+
setDescriptionPresent: I,
|
|
1637
|
+
setOpen: A,
|
|
1638
|
+
setTitlePresent: P,
|
|
1639
|
+
shouldRender: L,
|
|
1640
|
+
titleId: j,
|
|
1641
|
+
trapFocus: d
|
|
1642
|
+
}), [
|
|
1643
|
+
o,
|
|
1644
|
+
s,
|
|
1645
|
+
E,
|
|
1646
|
+
D,
|
|
1647
|
+
_,
|
|
1648
|
+
p,
|
|
1649
|
+
ee,
|
|
1650
|
+
O,
|
|
1651
|
+
a,
|
|
1652
|
+
y,
|
|
1653
|
+
b,
|
|
1654
|
+
S,
|
|
1655
|
+
v,
|
|
1656
|
+
x,
|
|
1657
|
+
c,
|
|
1658
|
+
R,
|
|
1659
|
+
l,
|
|
1660
|
+
C,
|
|
1661
|
+
z,
|
|
1662
|
+
A,
|
|
1663
|
+
L,
|
|
1664
|
+
j,
|
|
1665
|
+
d
|
|
1666
|
+
]),
|
|
1667
|
+
children: /* @__PURE__ */ n("div", {
|
|
1668
|
+
className: N(w),
|
|
1669
|
+
"data-state": O ? "open" : "closed",
|
|
1670
|
+
children: e
|
|
927
1671
|
})
|
|
928
|
-
})
|
|
1672
|
+
});
|
|
929
1673
|
};
|
|
930
|
-
|
|
1674
|
+
zt.displayName = "ModalRoot";
|
|
931
1675
|
//#endregion
|
|
932
|
-
//#region src/components/Modal/
|
|
933
|
-
var
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
1676
|
+
//#region src/components/Modal/Trigger/ModalTrigger.tsx
|
|
1677
|
+
var Bt = ({ children: e, asChild: t = !1, disabled: r = !1, className: i }) => {
|
|
1678
|
+
let a = yt(), s = t && l(e) ? e : void 0, c = r, u = {
|
|
1679
|
+
"aria-controls": a.contentId,
|
|
1680
|
+
"aria-disabled": c || void 0,
|
|
1681
|
+
"aria-expanded": a.open,
|
|
1682
|
+
"aria-haspopup": "dialog",
|
|
1683
|
+
className: N(i),
|
|
1684
|
+
"data-state": a.open ? "open" : "closed",
|
|
1685
|
+
disabled: c || void 0,
|
|
1686
|
+
onClick: Tt(s?.props.onClick, () => {
|
|
1687
|
+
c || a.setOpen(!0);
|
|
1688
|
+
})
|
|
1689
|
+
};
|
|
1690
|
+
return s ? o(s, {
|
|
1691
|
+
...u,
|
|
1692
|
+
ref: Et(s.props.ref),
|
|
1693
|
+
className: N(s.props.className, i)
|
|
1694
|
+
}) : /* @__PURE__ */ n("button", {
|
|
1695
|
+
type: "button",
|
|
1696
|
+
...u,
|
|
1697
|
+
children: e
|
|
1698
|
+
});
|
|
1699
|
+
};
|
|
1700
|
+
Bt.displayName = "Modal.Trigger";
|
|
1701
|
+
//#endregion
|
|
1702
|
+
//#region src/components/Modal/Modal.tsx
|
|
1703
|
+
var Vt = Object.assign(zt, {
|
|
1704
|
+
Trigger: Bt,
|
|
1705
|
+
Overlay: Rt,
|
|
1706
|
+
Content: jt,
|
|
1707
|
+
Header: It,
|
|
1708
|
+
Title: Ft,
|
|
1709
|
+
Description: Pt,
|
|
1710
|
+
Body: wt,
|
|
1711
|
+
Footer: Nt,
|
|
1712
|
+
Close: Ot
|
|
1713
|
+
});
|
|
1714
|
+
Vt.displayName = "Modal";
|
|
1715
|
+
//#endregion
|
|
1716
|
+
//#region src/components/RadioGroup/RadioGroupContext.ts
|
|
1717
|
+
var Ht = s(null), Ut = Ht.Provider;
|
|
1718
|
+
function Wt() {
|
|
1719
|
+
return d(Ht);
|
|
941
1720
|
}
|
|
942
|
-
var
|
|
1721
|
+
var Gt = {
|
|
943
1722
|
root: "_root_1n02e_1",
|
|
944
1723
|
label: "_label_1n02e_9",
|
|
945
1724
|
required: "_required_1n02e_21",
|
|
@@ -950,77 +1729,77 @@ var _t = {
|
|
|
950
1729
|
error: "_error_1n02e_51",
|
|
951
1730
|
disabled: "_disabled_1n02e_59",
|
|
952
1731
|
invalid: "_invalid_1n02e_75"
|
|
953
|
-
},
|
|
954
|
-
let b =
|
|
1732
|
+
}, Kt = c(({ value: e, defaultValue: t = "", onValueChange: i, disabled: a = !1, required: o = !1, size: s = "md", color: c = "primary", name: l, label: u, description: d, error: f, orientation: m = "vertical", children: h, className: g, id: _, ...v }, y) => {
|
|
1733
|
+
let b = p(), x = _ ?? b, S = u ? `${x}-label` : void 0, C = d ? `${x}-description` : void 0, w = f ? `${x}-error` : void 0, T = [C, w].filter(Boolean).join(" ") || void 0, E = l ?? `${x}-radio`, [D, O] = ge({
|
|
955
1734
|
value: e,
|
|
956
1735
|
defaultValue: t,
|
|
957
|
-
onChange:
|
|
958
|
-
}), k = !!
|
|
959
|
-
return /* @__PURE__ */
|
|
1736
|
+
onChange: i
|
|
1737
|
+
}), k = !!f;
|
|
1738
|
+
return /* @__PURE__ */ r("div", {
|
|
960
1739
|
...v,
|
|
961
1740
|
ref: y,
|
|
962
1741
|
id: x,
|
|
963
1742
|
role: "radiogroup",
|
|
964
1743
|
"aria-labelledby": S,
|
|
965
1744
|
"aria-describedby": T,
|
|
966
|
-
"aria-disabled":
|
|
967
|
-
"aria-required":
|
|
1745
|
+
"aria-disabled": a || void 0,
|
|
1746
|
+
"aria-required": o || void 0,
|
|
968
1747
|
"aria-invalid": k || void 0,
|
|
969
|
-
className:
|
|
1748
|
+
className: N(Gt.root, k && Gt.invalid, a && Gt.disabled, g),
|
|
970
1749
|
children: [
|
|
971
|
-
|
|
1750
|
+
u && /* @__PURE__ */ r("div", {
|
|
972
1751
|
id: S,
|
|
973
|
-
className:
|
|
974
|
-
children: [
|
|
975
|
-
className:
|
|
1752
|
+
className: Gt.label,
|
|
1753
|
+
children: [u, o && /* @__PURE__ */ n("span", {
|
|
1754
|
+
className: Gt.required,
|
|
976
1755
|
"aria-hidden": "true",
|
|
977
1756
|
children: "*"
|
|
978
1757
|
})]
|
|
979
1758
|
}),
|
|
980
|
-
|
|
1759
|
+
d && /* @__PURE__ */ n("div", {
|
|
981
1760
|
id: C,
|
|
982
|
-
className:
|
|
983
|
-
children:
|
|
1761
|
+
className: Gt.description,
|
|
1762
|
+
children: d
|
|
984
1763
|
}),
|
|
985
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ n(Ut, {
|
|
986
1765
|
value: {
|
|
987
1766
|
name: E,
|
|
988
1767
|
value: D,
|
|
989
|
-
disabled:
|
|
990
|
-
required:
|
|
1768
|
+
disabled: a,
|
|
1769
|
+
required: o,
|
|
991
1770
|
invalid: k,
|
|
992
|
-
size:
|
|
993
|
-
color:
|
|
1771
|
+
size: s,
|
|
1772
|
+
color: c,
|
|
994
1773
|
describedBy: T,
|
|
995
1774
|
onValueChange: O
|
|
996
1775
|
},
|
|
997
|
-
children: /* @__PURE__ */
|
|
998
|
-
className:
|
|
999
|
-
children:
|
|
1776
|
+
children: /* @__PURE__ */ n("div", {
|
|
1777
|
+
className: N(Gt.items, Gt[m]),
|
|
1778
|
+
children: h
|
|
1000
1779
|
})
|
|
1001
1780
|
}),
|
|
1002
|
-
|
|
1781
|
+
f && /* @__PURE__ */ n("div", {
|
|
1003
1782
|
id: w,
|
|
1004
|
-
className:
|
|
1005
|
-
children:
|
|
1783
|
+
className: Gt.error,
|
|
1784
|
+
children: f
|
|
1006
1785
|
})
|
|
1007
1786
|
]
|
|
1008
1787
|
});
|
|
1009
1788
|
});
|
|
1010
|
-
|
|
1789
|
+
Kt.displayName = "RadioGroup";
|
|
1011
1790
|
//#endregion
|
|
1012
1791
|
//#region src/components/Select/internal/SelectContext.tsx
|
|
1013
|
-
var
|
|
1014
|
-
function
|
|
1015
|
-
let e =
|
|
1792
|
+
var qt = s(null), Jt = qt.Provider;
|
|
1793
|
+
function Yt() {
|
|
1794
|
+
let e = d(qt);
|
|
1016
1795
|
if (!e) throw Error("Select compound components must be used inside <Select>");
|
|
1017
1796
|
return e;
|
|
1018
1797
|
}
|
|
1019
|
-
|
|
1798
|
+
qt.displayName = "SelectContext";
|
|
1020
1799
|
//#endregion
|
|
1021
1800
|
//#region src/components/Select/internal/useSelectVirtualization.ts
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
1801
|
+
function Xt({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
1802
|
+
return m(() => {
|
|
1024
1803
|
let i = typeof r == "object" ? r : r ? {} : void 0, a = i?.itemHeight ?? 40, o = !!(i && t.length > 0 && !e), s = o ? Math.max(0, Math.floor(n / a) - 2) : 0, c = o ? Math.ceil(300 / a) + 4 : t.length, l = o ? t.slice(s, s + c) : t, u = o ? s * a : 0;
|
|
1025
1804
|
return {
|
|
1026
1805
|
bottomSpacerHeight: o ? Math.max(0, (t.length - s - l.length) * a) : 0,
|
|
@@ -1038,7 +1817,7 @@ function St({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
|
1038
1817
|
r
|
|
1039
1818
|
]);
|
|
1040
1819
|
}
|
|
1041
|
-
var
|
|
1820
|
+
var Zt = {
|
|
1042
1821
|
option: "_option_1l7x7_1",
|
|
1043
1822
|
selected: "_selected_1l7x7_19",
|
|
1044
1823
|
disabled: "_disabled_1l7x7_19",
|
|
@@ -1056,63 +1835,63 @@ var q = {
|
|
|
1056
1835
|
danger: "_danger_1l7x7_283",
|
|
1057
1836
|
check: "_check_1l7x7_347",
|
|
1058
1837
|
checkPop: "_checkPop_1l7x7_1"
|
|
1059
|
-
},
|
|
1060
|
-
|
|
1061
|
-
var
|
|
1062
|
-
let
|
|
1063
|
-
return /* @__PURE__ */
|
|
1064
|
-
id:
|
|
1838
|
+
}, Qt = () => null;
|
|
1839
|
+
Qt.__velliraSelectPart = "item", Qt.displayName = "Select.Item";
|
|
1840
|
+
var $t = ({ option: e, isSelected: i, isActive: a, optionId: o, renderOption: s, onSelect: c, onMouseEnter: l }) => {
|
|
1841
|
+
let u = !!e.disabled;
|
|
1842
|
+
return /* @__PURE__ */ r("li", {
|
|
1843
|
+
id: o,
|
|
1065
1844
|
role: "option",
|
|
1066
|
-
"aria-selected":
|
|
1067
|
-
"aria-disabled":
|
|
1068
|
-
className:
|
|
1069
|
-
[
|
|
1070
|
-
[
|
|
1071
|
-
[
|
|
1072
|
-
[
|
|
1073
|
-
[
|
|
1074
|
-
[
|
|
1845
|
+
"aria-selected": i,
|
|
1846
|
+
"aria-disabled": u || void 0,
|
|
1847
|
+
className: N(Zt.option, {
|
|
1848
|
+
[Zt.selected]: i,
|
|
1849
|
+
[Zt.active]: a,
|
|
1850
|
+
[Zt.disabled]: u,
|
|
1851
|
+
[Zt.success]: e.color === "success",
|
|
1852
|
+
[Zt.warning]: e.color === "warning",
|
|
1853
|
+
[Zt.danger]: e.color === "danger"
|
|
1075
1854
|
}),
|
|
1076
1855
|
onClick: () => {
|
|
1077
|
-
|
|
1856
|
+
u || c(e.value);
|
|
1078
1857
|
},
|
|
1079
1858
|
onMouseEnter: () => {
|
|
1080
|
-
|
|
1859
|
+
u || l();
|
|
1081
1860
|
},
|
|
1082
|
-
children: [
|
|
1083
|
-
className:
|
|
1084
|
-
children:
|
|
1085
|
-
}) : /* @__PURE__ */
|
|
1086
|
-
e.icon && /* @__PURE__ */
|
|
1087
|
-
className:
|
|
1861
|
+
children: [s ? /* @__PURE__ */ n("span", {
|
|
1862
|
+
className: Zt.custom,
|
|
1863
|
+
children: s(e)
|
|
1864
|
+
}) : /* @__PURE__ */ r(t, { children: [
|
|
1865
|
+
e.icon && /* @__PURE__ */ n("span", {
|
|
1866
|
+
className: Zt.icon,
|
|
1088
1867
|
children: e.icon
|
|
1089
1868
|
}),
|
|
1090
|
-
/* @__PURE__ */
|
|
1091
|
-
className:
|
|
1092
|
-
children: [/* @__PURE__ */
|
|
1093
|
-
className:
|
|
1869
|
+
/* @__PURE__ */ r("span", {
|
|
1870
|
+
className: Zt.content,
|
|
1871
|
+
children: [/* @__PURE__ */ n("span", {
|
|
1872
|
+
className: Zt.label,
|
|
1094
1873
|
children: e.label
|
|
1095
|
-
}), e.description && /* @__PURE__ */
|
|
1096
|
-
className:
|
|
1874
|
+
}), e.description && /* @__PURE__ */ n("span", {
|
|
1875
|
+
className: Zt.description,
|
|
1097
1876
|
children: e.description
|
|
1098
1877
|
})]
|
|
1099
1878
|
}),
|
|
1100
|
-
e.badge && /* @__PURE__ */
|
|
1101
|
-
className:
|
|
1879
|
+
e.badge && /* @__PURE__ */ n("span", {
|
|
1880
|
+
className: Zt.badge,
|
|
1102
1881
|
children: e.badge
|
|
1103
1882
|
}),
|
|
1104
|
-
e.shortcut && /* @__PURE__ */
|
|
1105
|
-
className:
|
|
1883
|
+
e.shortcut && /* @__PURE__ */ n("kbd", {
|
|
1884
|
+
className: Zt.shortcut,
|
|
1106
1885
|
children: e.shortcut
|
|
1107
1886
|
})
|
|
1108
|
-
] }), /* @__PURE__ */
|
|
1109
|
-
className:
|
|
1887
|
+
] }), /* @__PURE__ */ n("span", {
|
|
1888
|
+
className: Zt.check,
|
|
1110
1889
|
"aria-hidden": "true",
|
|
1111
|
-
children:
|
|
1890
|
+
children: i && /* @__PURE__ */ n(v, {})
|
|
1112
1891
|
})]
|
|
1113
1892
|
});
|
|
1114
1893
|
};
|
|
1115
|
-
|
|
1894
|
+
$t.displayName = "SelectItemRow";
|
|
1116
1895
|
var J = {
|
|
1117
1896
|
dropdown: "_dropdown_k5nye_1",
|
|
1118
1897
|
dropdownIn: "_dropdownIn_k5nye_1",
|
|
@@ -1138,134 +1917,134 @@ var J = {
|
|
|
1138
1917
|
separator: "_separator_k5nye_1556",
|
|
1139
1918
|
virtualSpacer: "_virtualSpacer_k5nye_1562",
|
|
1140
1919
|
mobileDropdownIn: "_mobileDropdownIn_k5nye_1"
|
|
1141
|
-
},
|
|
1142
|
-
let { contentProps:
|
|
1143
|
-
return /* @__PURE__ */
|
|
1144
|
-
...n,
|
|
1920
|
+
}, en = ({ children: e, className: t }) => {
|
|
1921
|
+
let { contentProps: r } = Yt(), i = nn(e);
|
|
1922
|
+
return /* @__PURE__ */ n(tn, {
|
|
1145
1923
|
...r,
|
|
1146
|
-
|
|
1924
|
+
...i,
|
|
1925
|
+
className: [r.className, t].filter(Boolean).join(" ")
|
|
1147
1926
|
});
|
|
1148
1927
|
};
|
|
1149
|
-
|
|
1150
|
-
var
|
|
1151
|
-
let B =
|
|
1928
|
+
en.__velliraSelectPart = "content", en.displayName = "Select.Content";
|
|
1929
|
+
var tn = ({ isOpen: e, listboxId: i, labelledById: a, setDropdownRef: o, style: s, options: c, entries: l, multiple: d, selectedValues: p, color: m = "primary", variant: _ = "outline", searchable: v, command: y, virtual: b, portal: S = !0, searchValue: C = "", searchPlaceholder: w = "Search...", loading: T, loadingText: E = "Loading...", noOptionsText: D, searchSlot: O, headerSlot: k, emptySlot: A, loadingSlot: j, renderOption: M, selectedValue: N, activeIndex: P, visualActiveIndex: F = P, className: I, onSelect: L, onSelectGroup: R, onMouseEnter: z, onSearchChange: ee }) => {
|
|
1930
|
+
let B = h(null), te = h(!1), [ne, re] = g(null), [ie, ae] = g(0), { bottomSpacerHeight: oe, isVirtual: V, itemHeight: se, startIndex: ce, topSpacerHeight: le, viewportHeight: ue, visibleOptions: de } = Xt({
|
|
1152
1931
|
loading: T,
|
|
1153
|
-
options:
|
|
1932
|
+
options: c,
|
|
1154
1933
|
scrollTop: ie,
|
|
1155
1934
|
virtual: b
|
|
1156
|
-
}),
|
|
1157
|
-
re(e),
|
|
1158
|
-
}, [
|
|
1159
|
-
if (
|
|
1935
|
+
}), H = u((e) => {
|
|
1936
|
+
re(e), o(e);
|
|
1937
|
+
}, [o]);
|
|
1938
|
+
if (f(() => {
|
|
1160
1939
|
e || (te.current = !1, ae(0));
|
|
1161
|
-
}, [e, C]),
|
|
1940
|
+
}, [e, C]), f(() => {
|
|
1162
1941
|
if (!e || !v) return;
|
|
1163
1942
|
let t = window.setTimeout(() => {
|
|
1164
1943
|
B.current?.focus({ preventScroll: !0 });
|
|
1165
1944
|
}, 0);
|
|
1166
1945
|
return () => window.clearTimeout(t);
|
|
1167
|
-
}, [e, v]),
|
|
1946
|
+
}, [e, v]), f(() => {
|
|
1168
1947
|
if (!e || T || !ne || te.current) return;
|
|
1169
|
-
let
|
|
1170
|
-
if (
|
|
1948
|
+
let t = c.findIndex((e) => p ? p.includes(e.value) : e.value === N), n = t >= 0 ? t : P;
|
|
1949
|
+
if (n < 0) {
|
|
1171
1950
|
te.current = !0;
|
|
1172
1951
|
return;
|
|
1173
1952
|
}
|
|
1174
|
-
if (te.current = !0,
|
|
1175
|
-
let e = Math.max(0,
|
|
1953
|
+
if (te.current = !0, V) {
|
|
1954
|
+
let e = Math.max(0, n * se - (ue - se) / 2);
|
|
1176
1955
|
ae(e), ne.scrollTop = e;
|
|
1177
1956
|
return;
|
|
1178
1957
|
}
|
|
1179
|
-
document.getElementById(`${
|
|
1958
|
+
document.getElementById(`${i}-option-${n}`)?.scrollIntoView?.({ block: "nearest" });
|
|
1180
1959
|
}, [
|
|
1181
1960
|
P,
|
|
1182
1961
|
ne,
|
|
1183
1962
|
e,
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1963
|
+
V,
|
|
1964
|
+
se,
|
|
1965
|
+
i,
|
|
1187
1966
|
T,
|
|
1188
|
-
|
|
1967
|
+
c,
|
|
1189
1968
|
N,
|
|
1190
|
-
|
|
1969
|
+
p
|
|
1191
1970
|
]), !e) return null;
|
|
1192
|
-
let fe =
|
|
1971
|
+
let fe = l && !V ? l : de.map((e, t) => ({
|
|
1193
1972
|
type: "option",
|
|
1194
1973
|
option: e,
|
|
1195
|
-
optionIndex:
|
|
1196
|
-
})), pe = /* @__PURE__ */
|
|
1197
|
-
ref:
|
|
1974
|
+
optionIndex: ce + t
|
|
1975
|
+
})), pe = /* @__PURE__ */ r("div", {
|
|
1976
|
+
ref: H,
|
|
1198
1977
|
tabIndex: 0,
|
|
1199
1978
|
className: [
|
|
1200
1979
|
J.dropdown,
|
|
1201
|
-
J[p],
|
|
1202
1980
|
J[m],
|
|
1981
|
+
J[_],
|
|
1203
1982
|
y ? J.command : void 0,
|
|
1204
1983
|
I
|
|
1205
1984
|
].filter(Boolean).join(" "),
|
|
1206
|
-
style:
|
|
1985
|
+
style: s,
|
|
1207
1986
|
onScroll: (e) => {
|
|
1208
|
-
|
|
1987
|
+
V && ae(e.currentTarget.scrollTop);
|
|
1209
1988
|
},
|
|
1210
1989
|
children: [
|
|
1211
1990
|
k,
|
|
1212
|
-
O ?? (v && /* @__PURE__ */
|
|
1991
|
+
O ?? (v && /* @__PURE__ */ r("div", {
|
|
1213
1992
|
className: J.searchWrap,
|
|
1214
|
-
children: [/* @__PURE__ */
|
|
1993
|
+
children: [/* @__PURE__ */ n("input", {
|
|
1215
1994
|
ref: B,
|
|
1216
1995
|
className: J.search,
|
|
1217
1996
|
value: C,
|
|
1218
1997
|
placeholder: y ? "Type a command..." : w,
|
|
1219
1998
|
"aria-label": "Search options",
|
|
1220
|
-
onInput: (e) =>
|
|
1221
|
-
onChange: (e) =>
|
|
1222
|
-
}), C && /* @__PURE__ */
|
|
1999
|
+
onInput: (e) => ee?.(e.currentTarget.value),
|
|
2000
|
+
onChange: (e) => ee?.(e.target.value)
|
|
2001
|
+
}), C && /* @__PURE__ */ n("button", {
|
|
1223
2002
|
type: "button",
|
|
1224
2003
|
className: J.searchClear,
|
|
1225
2004
|
"aria-label": "Clear search",
|
|
1226
2005
|
onClick: () => {
|
|
1227
|
-
|
|
2006
|
+
ee?.(""), B.current?.focus();
|
|
1228
2007
|
},
|
|
1229
|
-
children: /* @__PURE__ */
|
|
2008
|
+
children: /* @__PURE__ */ n(x, {})
|
|
1230
2009
|
})]
|
|
1231
2010
|
})),
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
id:
|
|
2011
|
+
/* @__PURE__ */ n("ul", {
|
|
2012
|
+
id: i,
|
|
1234
2013
|
role: "listbox",
|
|
1235
|
-
"aria-multiselectable":
|
|
1236
|
-
"aria-labelledby":
|
|
1237
|
-
children: T ? /* @__PURE__ */
|
|
2014
|
+
"aria-multiselectable": d || void 0,
|
|
2015
|
+
"aria-labelledby": a,
|
|
2016
|
+
children: T ? /* @__PURE__ */ n("li", {
|
|
1238
2017
|
role: "option",
|
|
1239
2018
|
"aria-disabled": "true",
|
|
1240
2019
|
"aria-selected": "false",
|
|
1241
2020
|
className: J.empty,
|
|
1242
2021
|
children: j ?? E
|
|
1243
|
-
}) :
|
|
1244
|
-
|
|
2022
|
+
}) : c.length ? /* @__PURE__ */ r(t, { children: [
|
|
2023
|
+
V && /* @__PURE__ */ n("li", {
|
|
1245
2024
|
"aria-hidden": "true",
|
|
1246
2025
|
className: J.virtualSpacer,
|
|
1247
|
-
style: { height:
|
|
2026
|
+
style: { height: le }
|
|
1248
2027
|
}),
|
|
1249
2028
|
fe.map((e) => {
|
|
1250
2029
|
if (e.type === "group") {
|
|
1251
|
-
if (e.selectable &&
|
|
1252
|
-
let t = e.itemValues.filter((e) =>
|
|
1253
|
-
return /* @__PURE__ */
|
|
2030
|
+
if (e.selectable && d) {
|
|
2031
|
+
let t = e.itemValues.filter((e) => c.some((t) => t.value === e && !t.disabled)), i = p ? t.filter((e) => p.includes(e)).length : 0, a = t.length > 0 && i === t.length, o = i > 0 && i < t.length;
|
|
2032
|
+
return /* @__PURE__ */ n("li", {
|
|
1254
2033
|
role: "presentation",
|
|
1255
|
-
children: /* @__PURE__ */
|
|
2034
|
+
children: /* @__PURE__ */ r("button", {
|
|
1256
2035
|
type: "button",
|
|
1257
2036
|
className: J.groupAction,
|
|
1258
|
-
"aria-label":
|
|
1259
|
-
"aria-pressed":
|
|
2037
|
+
"aria-label": rn(e.selectLabel ?? e.label),
|
|
2038
|
+
"aria-pressed": o ? "mixed" : a ? "true" : "false",
|
|
1260
2039
|
disabled: t.length === 0,
|
|
1261
2040
|
onClick: () => R(t),
|
|
1262
|
-
children: [/* @__PURE__ */
|
|
2041
|
+
children: [/* @__PURE__ */ n("span", {
|
|
1263
2042
|
className: J.groupActionText,
|
|
1264
2043
|
children: e.selectLabel ?? e.label
|
|
1265
|
-
}), /* @__PURE__ */
|
|
2044
|
+
}), /* @__PURE__ */ r("span", {
|
|
1266
2045
|
className: J.groupActionMeta,
|
|
1267
2046
|
children: [
|
|
1268
|
-
|
|
2047
|
+
i,
|
|
1269
2048
|
"/",
|
|
1270
2049
|
t.length
|
|
1271
2050
|
]
|
|
@@ -1273,35 +2052,35 @@ var Et = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
1273
2052
|
})
|
|
1274
2053
|
}, e.id);
|
|
1275
2054
|
}
|
|
1276
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ n("li", {
|
|
1277
2056
|
role: "presentation",
|
|
1278
2057
|
className: J.groupLabel,
|
|
1279
2058
|
children: e.label
|
|
1280
2059
|
}, e.id);
|
|
1281
2060
|
}
|
|
1282
|
-
if (e.type === "separator") return /* @__PURE__ */
|
|
2061
|
+
if (e.type === "separator") return /* @__PURE__ */ n("li", {
|
|
1283
2062
|
role: "presentation",
|
|
1284
2063
|
"aria-hidden": "true",
|
|
1285
2064
|
className: J.separator,
|
|
1286
2065
|
"data-vellira-select-separator": "true"
|
|
1287
2066
|
}, e.id);
|
|
1288
|
-
let { option:
|
|
1289
|
-
return /* @__PURE__ */
|
|
1290
|
-
option:
|
|
1291
|
-
isSelected:
|
|
1292
|
-
isActive:
|
|
1293
|
-
optionId: `${
|
|
2067
|
+
let { option: t, optionIndex: a } = e;
|
|
2068
|
+
return /* @__PURE__ */ n($t, {
|
|
2069
|
+
option: t,
|
|
2070
|
+
isSelected: p ? p.includes(t.value) : t.value === N,
|
|
2071
|
+
isActive: a === F,
|
|
2072
|
+
optionId: `${i}-option-${a}`,
|
|
1294
2073
|
renderOption: M,
|
|
1295
2074
|
onSelect: L,
|
|
1296
|
-
onMouseEnter: () =>
|
|
1297
|
-
},
|
|
2075
|
+
onMouseEnter: () => z(a)
|
|
2076
|
+
}, t.value);
|
|
1298
2077
|
}),
|
|
1299
|
-
|
|
2078
|
+
V && /* @__PURE__ */ n("li", {
|
|
1300
2079
|
"aria-hidden": "true",
|
|
1301
2080
|
className: J.virtualSpacer,
|
|
1302
|
-
style: { height:
|
|
2081
|
+
style: { height: oe }
|
|
1303
2082
|
})
|
|
1304
|
-
] }) : /* @__PURE__ */
|
|
2083
|
+
] }) : /* @__PURE__ */ n("li", {
|
|
1305
2084
|
role: "option",
|
|
1306
2085
|
"aria-disabled": "true",
|
|
1307
2086
|
"aria-selected": "false",
|
|
@@ -1311,96 +2090,96 @@ var Et = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style:
|
|
|
1311
2090
|
})
|
|
1312
2091
|
]
|
|
1313
2092
|
});
|
|
1314
|
-
return S ? /* @__PURE__ */
|
|
2093
|
+
return S ? /* @__PURE__ */ n(we, { children: pe }) : pe;
|
|
1315
2094
|
};
|
|
1316
|
-
|
|
1317
|
-
function
|
|
1318
|
-
let n, r,
|
|
1319
|
-
return
|
|
1320
|
-
if (!
|
|
1321
|
-
let
|
|
1322
|
-
|
|
2095
|
+
tn.displayName = "SelectContentSurface";
|
|
2096
|
+
function nn(e) {
|
|
2097
|
+
let t, n, r, a;
|
|
2098
|
+
return i.forEach(e, (e) => {
|
|
2099
|
+
if (!l(e)) return;
|
|
2100
|
+
let i = e.type;
|
|
2101
|
+
i.__velliraSelectPart === "label" && (t = e), i.__velliraSelectPart === "search" && (n = e), i.__velliraSelectPart === "empty" && (r = e), i.__velliraSelectPart === "loading" && (a = e);
|
|
1323
2102
|
}), {
|
|
1324
|
-
emptySlot:
|
|
1325
|
-
headerSlot:
|
|
1326
|
-
loadingSlot:
|
|
1327
|
-
searchSlot:
|
|
2103
|
+
emptySlot: r,
|
|
2104
|
+
headerSlot: t,
|
|
2105
|
+
loadingSlot: a,
|
|
2106
|
+
searchSlot: n
|
|
1328
2107
|
};
|
|
1329
2108
|
}
|
|
1330
|
-
function
|
|
2109
|
+
function rn(e) {
|
|
1331
2110
|
return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
|
|
1332
2111
|
}
|
|
1333
2112
|
//#endregion
|
|
1334
2113
|
//#region src/components/Select/Content/SelectEmpty.tsx
|
|
1335
|
-
var
|
|
1336
|
-
|
|
2114
|
+
var an = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
|
|
2115
|
+
an.__velliraSelectPart = "empty", an.displayName = "Select.Empty";
|
|
1337
2116
|
//#endregion
|
|
1338
2117
|
//#region src/components/Select/Content/SelectLoading.tsx
|
|
1339
|
-
var
|
|
1340
|
-
|
|
2118
|
+
var on = ({ children: e }) => /* @__PURE__ */ n(t, { children: e });
|
|
2119
|
+
on.__velliraSelectPart = "loading", on.displayName = "Select.Loading";
|
|
1341
2120
|
//#endregion
|
|
1342
2121
|
//#region src/components/Select/Content/SelectSearch.tsx
|
|
1343
|
-
var
|
|
1344
|
-
let { contentProps:
|
|
1345
|
-
return
|
|
1346
|
-
if (!
|
|
2122
|
+
var sn = ({ placeholder: e, className: t }) => {
|
|
2123
|
+
let { contentProps: i } = Yt(), a = h(null), o = i.searchValue ?? "";
|
|
2124
|
+
return f(() => {
|
|
2125
|
+
if (!i.isOpen) return;
|
|
1347
2126
|
let e = window.setTimeout(() => {
|
|
1348
|
-
|
|
2127
|
+
a.current?.focus({ preventScroll: !0 });
|
|
1349
2128
|
}, 0);
|
|
1350
2129
|
return () => window.clearTimeout(e);
|
|
1351
|
-
}, [
|
|
2130
|
+
}, [i.isOpen]), /* @__PURE__ */ r("div", {
|
|
1352
2131
|
className: J.searchWrap,
|
|
1353
|
-
children: [/* @__PURE__ */
|
|
1354
|
-
ref:
|
|
1355
|
-
className:
|
|
1356
|
-
value:
|
|
1357
|
-
placeholder: e ?? (
|
|
2132
|
+
children: [/* @__PURE__ */ n("input", {
|
|
2133
|
+
ref: a,
|
|
2134
|
+
className: N(J.search, t),
|
|
2135
|
+
value: o,
|
|
2136
|
+
placeholder: e ?? (i.command ? "Type a command..." : "Search..."),
|
|
1358
2137
|
"aria-label": "Search options",
|
|
1359
|
-
onInput: (e) =>
|
|
1360
|
-
onChange: (e) =>
|
|
1361
|
-
}),
|
|
2138
|
+
onInput: (e) => i.onSearchChange?.(e.currentTarget.value),
|
|
2139
|
+
onChange: (e) => i.onSearchChange?.(e.target.value)
|
|
2140
|
+
}), o && /* @__PURE__ */ n("button", {
|
|
1362
2141
|
type: "button",
|
|
1363
2142
|
className: J.searchClear,
|
|
1364
2143
|
"aria-label": "Clear search",
|
|
1365
2144
|
onClick: () => {
|
|
1366
|
-
|
|
2145
|
+
i.onSearchChange?.(""), a.current?.focus();
|
|
1367
2146
|
},
|
|
1368
|
-
children: /* @__PURE__ */
|
|
2147
|
+
children: /* @__PURE__ */ n(x, {})
|
|
1369
2148
|
})]
|
|
1370
2149
|
});
|
|
1371
2150
|
};
|
|
1372
|
-
|
|
2151
|
+
sn.__velliraSelectPart = "search", sn.displayName = "Select.Search";
|
|
1373
2152
|
//#endregion
|
|
1374
2153
|
//#region src/components/Select/Group/SelectGroup.tsx
|
|
1375
|
-
var
|
|
1376
|
-
|
|
2154
|
+
var cn = () => null;
|
|
2155
|
+
cn.__velliraSelectPart = "group", cn.displayName = "Select.Group";
|
|
1377
2156
|
//#endregion
|
|
1378
2157
|
//#region src/components/Select/Group/SelectLabel.tsx
|
|
1379
|
-
var
|
|
2158
|
+
var ln = ({ children: e }) => /* @__PURE__ */ n("div", {
|
|
1380
2159
|
role: "presentation",
|
|
1381
2160
|
className: J.groupLabel,
|
|
1382
2161
|
children: e
|
|
1383
2162
|
});
|
|
1384
|
-
|
|
2163
|
+
ln.__velliraSelectPart = "label", ln.displayName = "Select.Label";
|
|
1385
2164
|
//#endregion
|
|
1386
2165
|
//#region src/components/Select/Group/SelectSeparator.tsx
|
|
1387
|
-
var
|
|
1388
|
-
|
|
2166
|
+
var un = () => null;
|
|
2167
|
+
un.__velliraSelectPart = "separator", un.displayName = "Select.Separator";
|
|
1389
2168
|
//#endregion
|
|
1390
2169
|
//#region src/components/Select/Item/SelectItemBadge.tsx
|
|
1391
|
-
var
|
|
1392
|
-
|
|
2170
|
+
var dn = () => null;
|
|
2171
|
+
dn.__velliraSelectPart = "itemBadge", dn.displayName = "Select.ItemBadge";
|
|
1393
2172
|
//#endregion
|
|
1394
2173
|
//#region src/components/Select/Item/SelectItemDescription.tsx
|
|
1395
|
-
var
|
|
1396
|
-
|
|
2174
|
+
var fn = () => null;
|
|
2175
|
+
fn.__velliraSelectPart = "itemDescription", fn.displayName = "Select.ItemDescription";
|
|
1397
2176
|
//#endregion
|
|
1398
2177
|
//#region src/components/Select/Item/SelectItemIcon.tsx
|
|
1399
|
-
var
|
|
1400
|
-
|
|
2178
|
+
var pn = () => null;
|
|
2179
|
+
pn.__velliraSelectPart = "itemIcon", pn.displayName = "Select.ItemIcon";
|
|
1401
2180
|
//#endregion
|
|
1402
2181
|
//#region src/patterns/FormField/FormFieldContext.ts
|
|
1403
|
-
var
|
|
2182
|
+
var mn = s(null), hn = () => d(mn), gn = {
|
|
1404
2183
|
wrapper: "_wrapper_143kr_1",
|
|
1405
2184
|
sm: "_sm_143kr_41",
|
|
1406
2185
|
md: "_md_143kr_78",
|
|
@@ -1416,206 +2195,206 @@ var Rt = r(null), zt = () => s(Rt), Bt = {
|
|
|
1416
2195
|
optional: "_optional_143kr_194",
|
|
1417
2196
|
labelInfo: "_labelInfo_143kr_201",
|
|
1418
2197
|
disabled: "_disabled_143kr_243"
|
|
1419
|
-
},
|
|
1420
|
-
let T =
|
|
2198
|
+
}, _n = (...e) => e.filter(Boolean).join(" ") || void 0, vn = ({ id: e, label: t, description: i, error: a, required: s = !1, disabled: c = !1, invalid: u = !1, orientation: d = "vertical", labelPosition: f = "top", size: m = "md", labelInfo: h, optionalText: g, children: _, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
|
|
2199
|
+
let T = p(), E = e ?? T, D = t ? `${E}-label` : void 0, O = i && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = u || !!a, j = _n(D), M = _n(O, k), P = {
|
|
1421
2200
|
controlId: E,
|
|
1422
2201
|
labelId: D,
|
|
1423
2202
|
descriptionId: O,
|
|
1424
2203
|
errorId: k,
|
|
1425
|
-
required:
|
|
1426
|
-
disabled:
|
|
2204
|
+
required: s,
|
|
2205
|
+
disabled: c,
|
|
1427
2206
|
invalid: A,
|
|
1428
|
-
size:
|
|
2207
|
+
size: m,
|
|
1429
2208
|
ariaLabelledBy: j,
|
|
1430
2209
|
ariaDescribedBy: M
|
|
1431
|
-
},
|
|
1432
|
-
id:
|
|
1433
|
-
required:
|
|
1434
|
-
disabled:
|
|
1435
|
-
"aria-invalid":
|
|
1436
|
-
"aria-labelledby":
|
|
1437
|
-
"aria-describedby":
|
|
1438
|
-
}) :
|
|
1439
|
-
return /* @__PURE__ */
|
|
2210
|
+
}, F = l(_) ? _ : void 0, I = v && F ? o(F, {
|
|
2211
|
+
id: F.props.id ?? E,
|
|
2212
|
+
required: F.props.required ?? s,
|
|
2213
|
+
disabled: F.props.disabled ?? c,
|
|
2214
|
+
"aria-invalid": F.props["aria-invalid"] ?? (A || void 0),
|
|
2215
|
+
"aria-labelledby": _n(F.props["aria-labelledby"], j),
|
|
2216
|
+
"aria-describedby": _n(F.props["aria-describedby"], M)
|
|
2217
|
+
}) : _;
|
|
2218
|
+
return /* @__PURE__ */ r("div", {
|
|
1440
2219
|
...w,
|
|
1441
|
-
"aria-disabled":
|
|
1442
|
-
className:
|
|
1443
|
-
"data-disabled":
|
|
2220
|
+
"aria-disabled": c || void 0,
|
|
2221
|
+
className: N(gn.wrapper, gn[d], gn[f], gn[m], c && gn.disabled, y),
|
|
2222
|
+
"data-disabled": c || void 0,
|
|
1444
2223
|
"data-invalid": A || void 0,
|
|
1445
|
-
"data-orientation":
|
|
1446
|
-
"data-size":
|
|
2224
|
+
"data-orientation": d,
|
|
2225
|
+
"data-size": m,
|
|
1447
2226
|
children: [
|
|
1448
|
-
t && /* @__PURE__ */
|
|
2227
|
+
t && /* @__PURE__ */ r("label", {
|
|
1449
2228
|
id: D,
|
|
1450
2229
|
htmlFor: E,
|
|
1451
|
-
className:
|
|
2230
|
+
className: N(gn.label, x),
|
|
1452
2231
|
children: [
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
className:
|
|
2232
|
+
/* @__PURE__ */ n("span", {
|
|
2233
|
+
className: gn.labelText,
|
|
1455
2234
|
children: t
|
|
1456
2235
|
}),
|
|
1457
|
-
|
|
1458
|
-
className:
|
|
2236
|
+
s && /* @__PURE__ */ n("span", {
|
|
2237
|
+
className: gn.required,
|
|
1459
2238
|
"aria-hidden": "true",
|
|
1460
2239
|
children: "*"
|
|
1461
2240
|
}),
|
|
1462
|
-
!
|
|
1463
|
-
className:
|
|
1464
|
-
children:
|
|
2241
|
+
!s && g && /* @__PURE__ */ n("span", {
|
|
2242
|
+
className: gn.optional,
|
|
2243
|
+
children: g
|
|
1465
2244
|
}),
|
|
1466
|
-
|
|
1467
|
-
className:
|
|
1468
|
-
children:
|
|
2245
|
+
h && /* @__PURE__ */ n("span", {
|
|
2246
|
+
className: gn.labelInfo,
|
|
2247
|
+
children: h
|
|
1469
2248
|
})
|
|
1470
2249
|
]
|
|
1471
2250
|
}),
|
|
1472
|
-
|
|
2251
|
+
i && /* @__PURE__ */ n("div", {
|
|
1473
2252
|
id: O,
|
|
1474
|
-
className:
|
|
1475
|
-
children:
|
|
2253
|
+
className: N(gn.description, S),
|
|
2254
|
+
children: i
|
|
1476
2255
|
}),
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
value:
|
|
1479
|
-
children: /* @__PURE__ */
|
|
1480
|
-
className:
|
|
1481
|
-
children:
|
|
2256
|
+
/* @__PURE__ */ n(mn.Provider, {
|
|
2257
|
+
value: P,
|
|
2258
|
+
children: /* @__PURE__ */ n("div", {
|
|
2259
|
+
className: N(gn.control, b),
|
|
2260
|
+
children: I
|
|
1482
2261
|
})
|
|
1483
2262
|
}),
|
|
1484
|
-
|
|
2263
|
+
a && /* @__PURE__ */ n("div", {
|
|
1485
2264
|
id: k,
|
|
1486
|
-
className:
|
|
2265
|
+
className: N(gn.errorText, C),
|
|
1487
2266
|
role: "alert",
|
|
1488
|
-
children:
|
|
2267
|
+
children: a
|
|
1489
2268
|
})
|
|
1490
2269
|
]
|
|
1491
2270
|
});
|
|
1492
2271
|
};
|
|
1493
2272
|
//#endregion
|
|
1494
2273
|
//#region src/components/Select/internal/SelectCollection.ts
|
|
1495
|
-
function
|
|
1496
|
-
let
|
|
1497
|
-
function
|
|
1498
|
-
|
|
1499
|
-
if (!
|
|
1500
|
-
let
|
|
1501
|
-
if (
|
|
1502
|
-
let
|
|
1503
|
-
|
|
2274
|
+
function yn(e) {
|
|
2275
|
+
let t = [], n = [], r = 0;
|
|
2276
|
+
function a(e) {
|
|
2277
|
+
i.forEach(e, (e) => {
|
|
2278
|
+
if (!l(e)) return;
|
|
2279
|
+
let i = e.type;
|
|
2280
|
+
if (i.__velliraSelectPart === "group") {
|
|
2281
|
+
let n = e.props, i = xn(n.children);
|
|
2282
|
+
t.push({
|
|
1504
2283
|
type: "group",
|
|
1505
|
-
id: `group-${
|
|
1506
|
-
label:
|
|
1507
|
-
selectable:
|
|
1508
|
-
selectLabel:
|
|
1509
|
-
itemValues:
|
|
1510
|
-
}),
|
|
2284
|
+
id: `group-${r++}`,
|
|
2285
|
+
label: n.label,
|
|
2286
|
+
selectable: n.selectable,
|
|
2287
|
+
selectLabel: n.selectLabel,
|
|
2288
|
+
itemValues: i
|
|
2289
|
+
}), a(n.children);
|
|
1511
2290
|
return;
|
|
1512
2291
|
}
|
|
1513
|
-
if (
|
|
1514
|
-
let
|
|
2292
|
+
if (i.__velliraSelectPart === "item") {
|
|
2293
|
+
let r = e.props, i = Sn(r.children, r.value), a = r.label ?? i.label, o = n.length, s = {
|
|
1515
2294
|
label: a,
|
|
1516
|
-
value:
|
|
1517
|
-
disabled:
|
|
1518
|
-
description:
|
|
1519
|
-
icon:
|
|
1520
|
-
badge:
|
|
1521
|
-
shortcut:
|
|
1522
|
-
color:
|
|
2295
|
+
value: r.value,
|
|
2296
|
+
disabled: r.disabled,
|
|
2297
|
+
description: r.description ?? i.description,
|
|
2298
|
+
icon: r.icon ?? i.icon,
|
|
2299
|
+
badge: r.badge ?? i.badge,
|
|
2300
|
+
shortcut: r.shortcut,
|
|
2301
|
+
color: r.color
|
|
1523
2302
|
};
|
|
1524
|
-
|
|
2303
|
+
n.push(s), t.push({
|
|
1525
2304
|
type: "option",
|
|
1526
2305
|
option: s,
|
|
1527
2306
|
optionIndex: o
|
|
1528
2307
|
});
|
|
1529
2308
|
return;
|
|
1530
2309
|
}
|
|
1531
|
-
if (
|
|
1532
|
-
|
|
2310
|
+
if (i.__velliraSelectPart === "separator") {
|
|
2311
|
+
t.push({
|
|
1533
2312
|
type: "separator",
|
|
1534
|
-
id: `separator-${
|
|
2313
|
+
id: `separator-${r++}`
|
|
1535
2314
|
});
|
|
1536
2315
|
return;
|
|
1537
2316
|
}
|
|
1538
|
-
|
|
2317
|
+
i.__velliraSelectPart === "empty" || i.__velliraSelectPart === "icon" || i.__velliraSelectPart === "itemBadge" || i.__velliraSelectPart === "itemDescription" || i.__velliraSelectPart === "itemIcon" || i.__velliraSelectPart === "label" || i.__velliraSelectPart === "loading" || i.__velliraSelectPart === "search" || i.__velliraSelectPart === "value" || a(e.props.children);
|
|
1539
2318
|
});
|
|
1540
2319
|
}
|
|
1541
|
-
return
|
|
1542
|
-
entries:
|
|
1543
|
-
options:
|
|
2320
|
+
return a(e), {
|
|
2321
|
+
entries: t,
|
|
2322
|
+
options: n
|
|
1544
2323
|
};
|
|
1545
2324
|
}
|
|
1546
|
-
function
|
|
1547
|
-
let
|
|
1548
|
-
function
|
|
1549
|
-
|
|
1550
|
-
if (!
|
|
1551
|
-
let
|
|
1552
|
-
if (
|
|
1553
|
-
|
|
2325
|
+
function bn(e) {
|
|
2326
|
+
let t = !1;
|
|
2327
|
+
function n(e) {
|
|
2328
|
+
i.forEach(e, (e) => {
|
|
2329
|
+
if (!l(e) || t) return;
|
|
2330
|
+
let r = e.type;
|
|
2331
|
+
if (r.__velliraSelectPart === "trigger" || r.__velliraSelectPart === "content") {
|
|
2332
|
+
t = !0;
|
|
1554
2333
|
return;
|
|
1555
2334
|
}
|
|
1556
|
-
|
|
2335
|
+
n(e.props.children);
|
|
1557
2336
|
});
|
|
1558
2337
|
}
|
|
1559
|
-
return
|
|
2338
|
+
return n(e), t;
|
|
1560
2339
|
}
|
|
1561
|
-
function
|
|
1562
|
-
let
|
|
1563
|
-
function
|
|
1564
|
-
|
|
1565
|
-
if (
|
|
2340
|
+
function xn(e) {
|
|
2341
|
+
let t = [];
|
|
2342
|
+
function n(e) {
|
|
2343
|
+
i.forEach(e, (e) => {
|
|
2344
|
+
if (l(e)) {
|
|
1566
2345
|
if (e.type.__velliraSelectPart === "item") {
|
|
1567
|
-
|
|
2346
|
+
t.push(e.props.value);
|
|
1568
2347
|
return;
|
|
1569
2348
|
}
|
|
1570
|
-
|
|
2349
|
+
n(e.props.children);
|
|
1571
2350
|
}
|
|
1572
2351
|
});
|
|
1573
2352
|
}
|
|
1574
|
-
return
|
|
2353
|
+
return n(e), t;
|
|
1575
2354
|
}
|
|
1576
|
-
function
|
|
1577
|
-
let r,
|
|
1578
|
-
function
|
|
1579
|
-
|
|
2355
|
+
function Sn(e, t) {
|
|
2356
|
+
let n, r, a, o = [];
|
|
2357
|
+
function s(e) {
|
|
2358
|
+
i.forEach(e, (e) => {
|
|
1580
2359
|
if (typeof e == "string" || typeof e == "number") {
|
|
1581
|
-
|
|
2360
|
+
o.push(String(e));
|
|
1582
2361
|
return;
|
|
1583
2362
|
}
|
|
1584
|
-
if (!
|
|
2363
|
+
if (!l(e)) return;
|
|
1585
2364
|
let t = e.type;
|
|
1586
2365
|
if (t.__velliraSelectPart === "itemBadge") {
|
|
1587
|
-
|
|
2366
|
+
n = e.props.children;
|
|
1588
2367
|
return;
|
|
1589
2368
|
}
|
|
1590
2369
|
if (t.__velliraSelectPart === "itemIcon") {
|
|
1591
|
-
|
|
2370
|
+
a = e.props.children;
|
|
1592
2371
|
return;
|
|
1593
2372
|
}
|
|
1594
2373
|
if (t.__velliraSelectPart === "itemDescription") {
|
|
1595
|
-
|
|
2374
|
+
r = e.props.children;
|
|
1596
2375
|
return;
|
|
1597
2376
|
}
|
|
1598
|
-
|
|
2377
|
+
s(e.props.children);
|
|
1599
2378
|
});
|
|
1600
2379
|
}
|
|
1601
|
-
|
|
1602
|
-
let
|
|
2380
|
+
s(e);
|
|
2381
|
+
let c = o.join("").trim();
|
|
1603
2382
|
return {
|
|
1604
|
-
badge:
|
|
1605
|
-
description:
|
|
1606
|
-
icon:
|
|
1607
|
-
label:
|
|
2383
|
+
badge: n,
|
|
2384
|
+
description: r,
|
|
2385
|
+
icon: a,
|
|
2386
|
+
label: c || t
|
|
1608
2387
|
};
|
|
1609
2388
|
}
|
|
1610
2389
|
//#endregion
|
|
1611
2390
|
//#region src/components/Select/internal/useSelectCollection.ts
|
|
1612
|
-
function
|
|
1613
|
-
return
|
|
2391
|
+
function Cn(e) {
|
|
2392
|
+
return m(() => yn(e), [e]);
|
|
1614
2393
|
}
|
|
1615
2394
|
//#endregion
|
|
1616
2395
|
//#region src/components/Select/internal/useSelectPosition.ts
|
|
1617
|
-
function
|
|
1618
|
-
return
|
|
2396
|
+
function wn({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
2397
|
+
return et({
|
|
1619
2398
|
open: t,
|
|
1620
2399
|
onOpenChange: r,
|
|
1621
2400
|
placement: i === "bottom" || i === "top" ? `${i}-start` : i,
|
|
@@ -1626,18 +2405,18 @@ function Jt({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange:
|
|
|
1626
2405
|
}
|
|
1627
2406
|
//#endregion
|
|
1628
2407
|
//#region src/components/Select/internal/useSelectSearch.ts
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
2408
|
+
function Tn({ options: e, searchable: t, searchValue: n }) {
|
|
2409
|
+
return m(() => {
|
|
1631
2410
|
if (!t || !n) return e;
|
|
1632
2411
|
let r = n.toLocaleLowerCase();
|
|
1633
|
-
return e.filter((e) => `${e.label} ${
|
|
2412
|
+
return e.filter((e) => `${e.label} ${En(e.description)}`.toLocaleLowerCase().includes(r));
|
|
1634
2413
|
}, [
|
|
1635
2414
|
e,
|
|
1636
2415
|
n,
|
|
1637
2416
|
t
|
|
1638
2417
|
]);
|
|
1639
2418
|
}
|
|
1640
|
-
function
|
|
2419
|
+
function En(e) {
|
|
1641
2420
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
1642
2421
|
}
|
|
1643
2422
|
var Y = {
|
|
@@ -1666,61 +2445,61 @@ var Y = {
|
|
|
1666
2445
|
spin: "_spin_x5w2h_818",
|
|
1667
2446
|
loading: "_loading_x5w2h_827",
|
|
1668
2447
|
open: "_open_x5w2h_846"
|
|
1669
|
-
},
|
|
1670
|
-
let { triggerProps:
|
|
1671
|
-
return /* @__PURE__ */
|
|
1672
|
-
...
|
|
1673
|
-
className: [
|
|
2448
|
+
}, Dn = ({ children: e, className: t }) => {
|
|
2449
|
+
let { triggerProps: r } = Yt();
|
|
2450
|
+
return /* @__PURE__ */ n(On, {
|
|
2451
|
+
...r,
|
|
2452
|
+
className: [r.className, t].filter(Boolean).join(" "),
|
|
1674
2453
|
children: e
|
|
1675
2454
|
});
|
|
1676
2455
|
};
|
|
1677
|
-
|
|
1678
|
-
var
|
|
1679
|
-
id:
|
|
2456
|
+
Dn.__velliraSelectPart = "trigger", Dn.displayName = "Select.Trigger";
|
|
2457
|
+
var On = ({ children: e, id: i, describedBy: a, labelledBy: o, isOpen: s, disabled: c, required: l, listboxId: u, activeIndex: d, ariaLabel: f, error: p, displayText: m, isPlaceholder: h, size: g = "md", color: _, variant: v, loading: b, startIcon: S, endIcon: C, prefix: w, suffix: T, clearable: E, onClear: D, className: O, buttonRef: k, onClick: A, onKeyDown: j, onBlur: M, onFocus: P }) => /* @__PURE__ */ n("button", {
|
|
2458
|
+
id: i,
|
|
1680
2459
|
ref: k,
|
|
1681
2460
|
type: "button",
|
|
1682
2461
|
role: "combobox",
|
|
1683
|
-
disabled:
|
|
1684
|
-
"aria-disabled":
|
|
1685
|
-
"aria-required":
|
|
1686
|
-
"aria-expanded":
|
|
2462
|
+
disabled: c,
|
|
2463
|
+
"aria-disabled": c || void 0,
|
|
2464
|
+
"aria-required": l || void 0,
|
|
2465
|
+
"aria-expanded": s,
|
|
1687
2466
|
"aria-haspopup": "listbox",
|
|
1688
|
-
"aria-label":
|
|
1689
|
-
"aria-labelledby":
|
|
1690
|
-
"aria-invalid":
|
|
1691
|
-
"aria-controls":
|
|
1692
|
-
"aria-describedby":
|
|
1693
|
-
"aria-activedescendant":
|
|
1694
|
-
className:
|
|
1695
|
-
[Y.error]: !!
|
|
1696
|
-
[Y.disabled]:
|
|
2467
|
+
"aria-label": f,
|
|
2468
|
+
"aria-labelledby": o,
|
|
2469
|
+
"aria-invalid": p || void 0,
|
|
2470
|
+
"aria-controls": s ? u : void 0,
|
|
2471
|
+
"aria-describedby": a,
|
|
2472
|
+
"aria-activedescendant": s && d >= 0 ? `${u}-option-${d}` : void 0,
|
|
2473
|
+
className: N(Y.control, Y[g], Y[v], Y[_], {
|
|
2474
|
+
[Y.error]: !!p,
|
|
2475
|
+
[Y.disabled]: c,
|
|
1697
2476
|
[Y.loading]: b
|
|
1698
2477
|
}, O),
|
|
1699
2478
|
onClick: A,
|
|
1700
2479
|
onKeyDown: j,
|
|
1701
2480
|
onBlur: M,
|
|
1702
|
-
onFocus:
|
|
1703
|
-
children: e ?? /* @__PURE__ */
|
|
1704
|
-
S && /* @__PURE__ */
|
|
2481
|
+
onFocus: P,
|
|
2482
|
+
children: e ?? /* @__PURE__ */ r(t, { children: [
|
|
2483
|
+
S && /* @__PURE__ */ n("span", {
|
|
1705
2484
|
className: Y.adornment,
|
|
1706
2485
|
children: S
|
|
1707
2486
|
}),
|
|
1708
|
-
w && /* @__PURE__ */
|
|
2487
|
+
w && /* @__PURE__ */ n("span", {
|
|
1709
2488
|
className: Y.affix,
|
|
1710
2489
|
children: w
|
|
1711
2490
|
}),
|
|
1712
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ n("span", {
|
|
1713
2492
|
className: Y.valueWrap,
|
|
1714
|
-
children: /* @__PURE__ */
|
|
1715
|
-
className:
|
|
1716
|
-
children:
|
|
2493
|
+
children: /* @__PURE__ */ n("span", {
|
|
2494
|
+
className: N(Y.value, { [Y.placeholder]: h }),
|
|
2495
|
+
children: m
|
|
1717
2496
|
})
|
|
1718
2497
|
}),
|
|
1719
|
-
T && /* @__PURE__ */
|
|
2498
|
+
T && /* @__PURE__ */ n("span", {
|
|
1720
2499
|
className: Y.affix,
|
|
1721
2500
|
children: T
|
|
1722
2501
|
}),
|
|
1723
|
-
E && /* @__PURE__ */
|
|
2502
|
+
E && /* @__PURE__ */ n("span", {
|
|
1724
2503
|
role: "button",
|
|
1725
2504
|
"aria-label": "Clear selection",
|
|
1726
2505
|
tabIndex: -1,
|
|
@@ -1728,282 +2507,292 @@ var Qt = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabl
|
|
|
1728
2507
|
onClick: (e) => {
|
|
1729
2508
|
e.stopPropagation(), D?.();
|
|
1730
2509
|
},
|
|
1731
|
-
children: /* @__PURE__ */
|
|
2510
|
+
children: /* @__PURE__ */ n(x, {})
|
|
1732
2511
|
}),
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
className:
|
|
2512
|
+
/* @__PURE__ */ n("span", {
|
|
2513
|
+
className: N(Y.arrow, { [Y.open]: s }),
|
|
1735
2514
|
"aria-hidden": "true",
|
|
1736
|
-
children: b ? /* @__PURE__ */
|
|
2515
|
+
children: b ? /* @__PURE__ */ n("span", { className: Y.spinner }) : C ?? /* @__PURE__ */ n(y, {})
|
|
1737
2516
|
})
|
|
1738
2517
|
] })
|
|
1739
2518
|
});
|
|
1740
|
-
|
|
2519
|
+
On.displayName = "SelectTriggerSurface";
|
|
1741
2520
|
//#endregion
|
|
1742
2521
|
//#region src/components/Select/Root/SelectRoot.tsx
|
|
1743
|
-
var
|
|
1744
|
-
let
|
|
1745
|
-
|
|
1746
|
-
!
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
].filter(Boolean).join(" "),
|
|
1750
|
-
options:
|
|
1751
|
-
searchable:
|
|
1752
|
-
searchValue:
|
|
1753
|
-
}), { selectedValue:
|
|
1754
|
-
value:
|
|
2522
|
+
var kn = ({ children: e, label: i, description: a, id: o, name: s, "aria-label": c, "aria-describedby": l, "aria-labelledby": d, value: _, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: j = !1, invalid: M = !1, loading: N = !1, clearable: P = !1, searchable: F = !1, virtual: I, modal: L = !1, command: R = !1, error: z, placement: ee = "bottom", matchTriggerWidth: B = !0, avoidCollisions: te = !0, portal: ne = !0, open: re, defaultOpen: ie = !1, onOpenChange: ae, onSearch: oe, onClear: V, startIcon: ce, endIcon: le, prefix: de, suffix: H, renderValue: fe, renderOption: me, onBlur: he, onFocus: ge, className: _e, triggerClassName: ve, dropdownClassName: ye }) => {
|
|
2523
|
+
let xe = p(), U = hn(), Se = !!(i || a || z), Ce = o ?? (Se ? void 0 : U?.controlId) ?? xe, we = `${Ce}-listbox`, [Te, Ee] = g(""), De = !!z, Oe = De ? `${Ce}-error` : void 0, ke = a ? `${Ce}-description` : void 0, Ae = D ?? U?.size ?? "md", je = M || De || !Se && !!U?.invalid, Me = j || !Se && !!U?.disabled, Ne = A || !Se && !!U?.required, Pe = [
|
|
2524
|
+
l,
|
|
2525
|
+
!Se && !l ? U?.ariaDescribedBy : void 0,
|
|
2526
|
+
ke,
|
|
2527
|
+
Oe
|
|
2528
|
+
].filter(Boolean).join(" "), W = h(null), Fe = h(null), [G, Ie] = g(!1), Le = F || R, { entries: Re, options: ze } = Cn(e), Be = Tn({
|
|
2529
|
+
options: ze,
|
|
2530
|
+
searchable: Le,
|
|
2531
|
+
searchValue: Te
|
|
2532
|
+
}), { selectedValue: Ve, selectedValues: K, isOpen: q, setIsOpen: He, setSelectedValue: Ue, activeIndex: We, setActiveIndex: Ge, closeDropdown: Ke, toggleDropdown: qe, selectValue: Je, onKeyDown: Ye } = be({
|
|
2533
|
+
value: _,
|
|
1755
2534
|
defaultValue: v,
|
|
1756
2535
|
onValueChange: y,
|
|
1757
|
-
options:
|
|
2536
|
+
options: Be,
|
|
1758
2537
|
multiple: b,
|
|
1759
2538
|
maxSelected: x,
|
|
1760
2539
|
closeOnSelect: S,
|
|
1761
|
-
disabled:
|
|
1762
|
-
open:
|
|
1763
|
-
defaultOpen:
|
|
1764
|
-
onOpenChange:
|
|
1765
|
-
}),
|
|
1766
|
-
isOpen:
|
|
1767
|
-
onOpenChange:
|
|
1768
|
-
placement:
|
|
1769
|
-
matchTriggerWidth:
|
|
1770
|
-
avoidCollisions:
|
|
1771
|
-
}),
|
|
1772
|
-
|
|
1773
|
-
}, [
|
|
2540
|
+
disabled: Me,
|
|
2541
|
+
open: re,
|
|
2542
|
+
defaultOpen: ie,
|
|
2543
|
+
onOpenChange: ae
|
|
2544
|
+
}), Xe = m(() => ze.find((e) => K.includes(e.value)), [ze, K]), Ze = m(() => ze.filter((e) => K.includes(e.value)), [ze, K]), Qe = !!Xe, $e = Array.isArray(Ve) ? Ve[0] ?? "" : Ve, { floatingStyles: et, setRef: tt, setFloatingRef: nt } = wn({
|
|
2545
|
+
isOpen: q,
|
|
2546
|
+
onOpenChange: He,
|
|
2547
|
+
placement: ee,
|
|
2548
|
+
matchTriggerWidth: B,
|
|
2549
|
+
avoidCollisions: te
|
|
2550
|
+
}), rt = u((e) => {
|
|
2551
|
+
Je(e), W.current?.focus();
|
|
2552
|
+
}, [Je]), it = u((e) => {
|
|
1774
2553
|
if (!b || e.length === 0) return;
|
|
1775
|
-
let t = e.filter((e) =>
|
|
2554
|
+
let t = e.filter((e) => ze.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => K.includes(e)), r = K.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
|
|
1776
2555
|
if (n.length > 0 && n.length >= i) {
|
|
1777
|
-
|
|
2556
|
+
Ue(K.filter((e) => !t.includes(e)));
|
|
1778
2557
|
return;
|
|
1779
2558
|
}
|
|
1780
|
-
let a = [...
|
|
2559
|
+
let a = [...K];
|
|
1781
2560
|
for (let e of t) if (!a.includes(e)) {
|
|
1782
2561
|
if (typeof x == "number" && a.length >= x) break;
|
|
1783
2562
|
a.push(e);
|
|
1784
2563
|
}
|
|
1785
|
-
|
|
2564
|
+
Ue(a), S && (Ke(), W.current?.focus());
|
|
1786
2565
|
}, [
|
|
1787
|
-
|
|
2566
|
+
Ke,
|
|
1788
2567
|
S,
|
|
1789
2568
|
x,
|
|
1790
2569
|
b,
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
]),
|
|
1795
|
-
|
|
1796
|
-
}, [
|
|
1797
|
-
|
|
1798
|
-
}, [
|
|
1799
|
-
|
|
1800
|
-
}, [
|
|
1801
|
-
|
|
1802
|
-
}, [
|
|
1803
|
-
|
|
1804
|
-
}, [
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
}, [
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
2570
|
+
ze,
|
|
2571
|
+
K,
|
|
2572
|
+
Ue
|
|
2573
|
+
]), at = u(() => {
|
|
2574
|
+
Je(""), V?.(), W.current?.focus();
|
|
2575
|
+
}, [V, Je]), ot = u(() => {
|
|
2576
|
+
q || Ie(!1), qe();
|
|
2577
|
+
}, [q, qe]), st = u((e) => {
|
|
2578
|
+
An(e, q) && Ie(!0), Ye(e);
|
|
2579
|
+
}, [q, Ye]), ct = u((e) => {
|
|
2580
|
+
Ie(!0), Ge(e);
|
|
2581
|
+
}, [Ge]), lt = u((e) => {
|
|
2582
|
+
Ee(e), oe?.(e);
|
|
2583
|
+
}, [oe]), { isTopOverlay: ut } = ue({
|
|
2584
|
+
active: q,
|
|
2585
|
+
id: we
|
|
2586
|
+
});
|
|
2587
|
+
se({
|
|
2588
|
+
active: q,
|
|
2589
|
+
closeOnEscape: !0,
|
|
2590
|
+
closeOnOutsidePress: !0,
|
|
2591
|
+
contentRef: Fe,
|
|
2592
|
+
ignoreRefs: [W],
|
|
2593
|
+
isTopOverlay: ut,
|
|
2594
|
+
requestClose: Ke
|
|
2595
|
+
}), f(() => {
|
|
2596
|
+
q || Ie(!1);
|
|
2597
|
+
}, [q]), f(() => {
|
|
2598
|
+
!q && Te && Ee("");
|
|
2599
|
+
}, [q, Te]), pe({
|
|
2600
|
+
active: q,
|
|
2601
|
+
enabled: L
|
|
2602
|
+
});
|
|
2603
|
+
let dt = u((e) => {
|
|
2604
|
+
W.current = e, tt(e);
|
|
2605
|
+
}, [tt]), ft = u((e) => {
|
|
2606
|
+
Fe.current = e, nt(e);
|
|
2607
|
+
}, [nt]), pt = fe ? fe(Xe) : b && Ze.length ? Ze.map((e) => e.label).join(", ") : Xe?.label ?? C, mt = w ?? E ?? "No options available", ht = P && K.length > 0 && !Me && !N, gt = {
|
|
2608
|
+
id: Ce,
|
|
2609
|
+
describedBy: Pe || void 0,
|
|
2610
|
+
labelledBy: c ? void 0 : d,
|
|
2611
|
+
isOpen: q,
|
|
2612
|
+
disabled: Me,
|
|
2613
|
+
required: Ne,
|
|
2614
|
+
listboxId: we,
|
|
2615
|
+
activeIndex: We,
|
|
2616
|
+
ariaLabel: c ?? (!i && !U?.labelId ? Xe?.label || C : void 0),
|
|
2617
|
+
error: je,
|
|
1829
2618
|
loading: N,
|
|
1830
|
-
displayText:
|
|
1831
|
-
isPlaceholder: !
|
|
1832
|
-
size:
|
|
2619
|
+
displayText: pt,
|
|
2620
|
+
isPlaceholder: !Qe,
|
|
2621
|
+
size: Ae,
|
|
1833
2622
|
color: O,
|
|
1834
2623
|
variant: k,
|
|
1835
|
-
startIcon:
|
|
1836
|
-
endIcon:
|
|
1837
|
-
prefix:
|
|
1838
|
-
suffix:
|
|
1839
|
-
clearable:
|
|
1840
|
-
className:
|
|
1841
|
-
buttonRef:
|
|
1842
|
-
onClear:
|
|
1843
|
-
onClick:
|
|
1844
|
-
onKeyDown:
|
|
1845
|
-
onBlur:
|
|
1846
|
-
onFocus:
|
|
1847
|
-
},
|
|
1848
|
-
isOpen:
|
|
1849
|
-
listboxId:
|
|
1850
|
-
labelledById:
|
|
1851
|
-
style:
|
|
1852
|
-
options:
|
|
1853
|
-
entries:
|
|
2624
|
+
startIcon: ce,
|
|
2625
|
+
endIcon: le,
|
|
2626
|
+
prefix: de,
|
|
2627
|
+
suffix: H,
|
|
2628
|
+
clearable: ht,
|
|
2629
|
+
className: ve,
|
|
2630
|
+
buttonRef: dt,
|
|
2631
|
+
onClear: at,
|
|
2632
|
+
onClick: ot,
|
|
2633
|
+
onKeyDown: st,
|
|
2634
|
+
onBlur: he,
|
|
2635
|
+
onFocus: ge
|
|
2636
|
+
}, _t = {
|
|
2637
|
+
isOpen: q,
|
|
2638
|
+
listboxId: we,
|
|
2639
|
+
labelledById: Ce,
|
|
2640
|
+
style: et,
|
|
2641
|
+
options: Be,
|
|
2642
|
+
entries: Le || Te ? void 0 : Re,
|
|
1854
2643
|
multiple: b,
|
|
1855
2644
|
color: O,
|
|
1856
2645
|
variant: k,
|
|
1857
|
-
searchable:
|
|
1858
|
-
command:
|
|
2646
|
+
searchable: Le,
|
|
2647
|
+
command: R,
|
|
1859
2648
|
virtual: I,
|
|
1860
|
-
portal:
|
|
1861
|
-
searchValue:
|
|
2649
|
+
portal: ne,
|
|
2650
|
+
searchValue: Te,
|
|
1862
2651
|
loading: N,
|
|
1863
2652
|
loadingText: T,
|
|
1864
|
-
noOptionsText:
|
|
1865
|
-
renderOption:
|
|
1866
|
-
selectedValue:
|
|
1867
|
-
selectedValues:
|
|
1868
|
-
activeIndex:
|
|
1869
|
-
visualActiveIndex:
|
|
1870
|
-
className:
|
|
1871
|
-
setDropdownRef:
|
|
1872
|
-
onSelect:
|
|
1873
|
-
onSelectGroup:
|
|
1874
|
-
onMouseEnter:
|
|
1875
|
-
onSearchChange:
|
|
1876
|
-
},
|
|
2653
|
+
noOptionsText: mt,
|
|
2654
|
+
renderOption: me,
|
|
2655
|
+
selectedValue: $e,
|
|
2656
|
+
selectedValues: K,
|
|
2657
|
+
activeIndex: We,
|
|
2658
|
+
visualActiveIndex: G ? We : -1,
|
|
2659
|
+
className: ye,
|
|
2660
|
+
setDropdownRef: ft,
|
|
2661
|
+
onSelect: rt,
|
|
2662
|
+
onSelectGroup: it,
|
|
2663
|
+
onMouseEnter: ct,
|
|
2664
|
+
onSearchChange: lt
|
|
2665
|
+
}, vt = /* @__PURE__ */ r(t, { children: [s && b && K.length > 0 && /* @__PURE__ */ n(t, { children: K.map((e) => /* @__PURE__ */ n("input", {
|
|
1877
2666
|
type: "hidden",
|
|
1878
|
-
name:
|
|
2667
|
+
name: s,
|
|
1879
2668
|
value: e,
|
|
1880
|
-
disabled:
|
|
1881
|
-
}, e)) }),
|
|
2669
|
+
disabled: Me
|
|
2670
|
+
}, e)) }), s && !b && /* @__PURE__ */ n("input", {
|
|
1882
2671
|
type: "hidden",
|
|
1883
|
-
name:
|
|
1884
|
-
value:
|
|
1885
|
-
disabled:
|
|
1886
|
-
})] }),
|
|
2672
|
+
name: s,
|
|
2673
|
+
value: $e,
|
|
2674
|
+
disabled: Me
|
|
2675
|
+
})] }), yt = bn(e), bt = /* @__PURE__ */ r(Jt, {
|
|
1887
2676
|
value: {
|
|
1888
|
-
triggerProps:
|
|
1889
|
-
contentProps:
|
|
2677
|
+
triggerProps: gt,
|
|
2678
|
+
contentProps: _t
|
|
1890
2679
|
},
|
|
1891
|
-
children: [
|
|
1892
|
-
}),
|
|
2680
|
+
children: [vt, yt ? e : /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(Dn, {}), /* @__PURE__ */ n(en, { children: e })] })]
|
|
2681
|
+
}), xt = /* @__PURE__ */ r(Jt, {
|
|
1893
2682
|
value: {
|
|
1894
|
-
triggerProps:
|
|
1895
|
-
contentProps:
|
|
2683
|
+
triggerProps: gt,
|
|
2684
|
+
contentProps: _t
|
|
1896
2685
|
},
|
|
1897
2686
|
children: [
|
|
1898
|
-
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
2687
|
+
vt,
|
|
2688
|
+
/* @__PURE__ */ n(On, { ...gt }),
|
|
2689
|
+
/* @__PURE__ */ n(tn, { ..._t })
|
|
1901
2690
|
]
|
|
1902
2691
|
});
|
|
1903
|
-
return !
|
|
1904
|
-
id:
|
|
1905
|
-
label:
|
|
1906
|
-
description:
|
|
2692
|
+
return !Se && U ? e ? bt : xt : /* @__PURE__ */ n(vn, {
|
|
2693
|
+
id: Ce,
|
|
2694
|
+
label: i,
|
|
2695
|
+
description: a,
|
|
1907
2696
|
error: z,
|
|
1908
|
-
required:
|
|
1909
|
-
disabled:
|
|
2697
|
+
required: Ne,
|
|
2698
|
+
disabled: Me,
|
|
1910
2699
|
bindControl: !1,
|
|
1911
|
-
className:
|
|
1912
|
-
children: e ?
|
|
2700
|
+
className: _e,
|
|
2701
|
+
children: e ? bt : xt
|
|
1913
2702
|
});
|
|
1914
2703
|
};
|
|
1915
|
-
|
|
1916
|
-
function
|
|
2704
|
+
kn.displayName = "SelectRoot";
|
|
2705
|
+
function An(e, t) {
|
|
1917
2706
|
return e.altKey || e.ctrlKey || e.metaKey ? !1 : t ? e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" || e.key === "Enter" || e.key === " " || e.key.length === 1 : e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter" || e.key === " ";
|
|
1918
2707
|
}
|
|
1919
2708
|
//#endregion
|
|
1920
2709
|
//#region src/components/Select/Trigger/SelectIcon.tsx
|
|
1921
|
-
var
|
|
1922
|
-
let { triggerProps:
|
|
1923
|
-
return /* @__PURE__ */
|
|
1924
|
-
className:
|
|
2710
|
+
var jn = ({ children: e, className: t }) => {
|
|
2711
|
+
let { triggerProps: r } = Yt();
|
|
2712
|
+
return /* @__PURE__ */ n("span", {
|
|
2713
|
+
className: N(Y.arrow, { [Y.open]: r.isOpen }, t),
|
|
1925
2714
|
"aria-hidden": "true",
|
|
1926
|
-
children:
|
|
2715
|
+
children: r.loading ? /* @__PURE__ */ n("span", { className: Y.spinner }) : e ?? r.endIcon ?? /* @__PURE__ */ n(y, {})
|
|
1927
2716
|
});
|
|
1928
2717
|
};
|
|
1929
|
-
|
|
2718
|
+
jn.__velliraSelectPart = "icon", jn.displayName = "Select.Icon";
|
|
1930
2719
|
//#endregion
|
|
1931
2720
|
//#region src/components/Select/Trigger/SelectValue.tsx
|
|
1932
|
-
var
|
|
1933
|
-
let { triggerProps:
|
|
1934
|
-
return /* @__PURE__ */
|
|
1935
|
-
className:
|
|
1936
|
-
children: /* @__PURE__ */
|
|
1937
|
-
className:
|
|
1938
|
-
children: e ??
|
|
2721
|
+
var Mn = ({ children: e, className: t }) => {
|
|
2722
|
+
let { triggerProps: r } = Yt();
|
|
2723
|
+
return /* @__PURE__ */ n("span", {
|
|
2724
|
+
className: N(Y.valueWrap, t),
|
|
2725
|
+
children: /* @__PURE__ */ n("span", {
|
|
2726
|
+
className: N(Y.value, { [Y.placeholder]: r.isPlaceholder }),
|
|
2727
|
+
children: e ?? r.displayText
|
|
1939
2728
|
})
|
|
1940
2729
|
});
|
|
1941
2730
|
};
|
|
1942
|
-
|
|
2731
|
+
Mn.__velliraSelectPart = "value", Mn.displayName = "Select.Value";
|
|
1943
2732
|
//#endregion
|
|
1944
2733
|
//#region src/components/Select/Select.tsx
|
|
1945
|
-
var
|
|
1946
|
-
Trigger:
|
|
1947
|
-
Value:
|
|
1948
|
-
Icon:
|
|
1949
|
-
Content:
|
|
1950
|
-
Search:
|
|
1951
|
-
Group:
|
|
1952
|
-
Label:
|
|
1953
|
-
Item:
|
|
1954
|
-
ItemIcon:
|
|
1955
|
-
ItemDescription:
|
|
1956
|
-
ItemBadge:
|
|
1957
|
-
Separator:
|
|
1958
|
-
Empty:
|
|
1959
|
-
Loading:
|
|
2734
|
+
var Nn = Object.assign(kn, {
|
|
2735
|
+
Trigger: Dn,
|
|
2736
|
+
Value: Mn,
|
|
2737
|
+
Icon: jn,
|
|
2738
|
+
Content: en,
|
|
2739
|
+
Search: sn,
|
|
2740
|
+
Group: cn,
|
|
2741
|
+
Label: ln,
|
|
2742
|
+
Item: Qt,
|
|
2743
|
+
ItemIcon: pn,
|
|
2744
|
+
ItemDescription: fn,
|
|
2745
|
+
ItemBadge: dn,
|
|
2746
|
+
Separator: un,
|
|
2747
|
+
Empty: an,
|
|
2748
|
+
Loading: on
|
|
1960
2749
|
});
|
|
1961
|
-
|
|
2750
|
+
Nn.displayName = "Select";
|
|
1962
2751
|
//#endregion
|
|
1963
2752
|
//#region src/components/Tabs/TabsContext.tsx
|
|
1964
|
-
var
|
|
1965
|
-
let e =
|
|
2753
|
+
var Pn = s(null), Fn = () => {
|
|
2754
|
+
let e = d(Pn);
|
|
1966
2755
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
1967
2756
|
return e;
|
|
1968
|
-
},
|
|
2757
|
+
}, In = {
|
|
1969
2758
|
list: "_list_13hkl_1",
|
|
1970
2759
|
vertical: "_vertical_13hkl_8"
|
|
1971
|
-
},
|
|
1972
|
-
let { orientation:
|
|
1973
|
-
return /* @__PURE__ */
|
|
1974
|
-
...
|
|
2760
|
+
}, Ln = ({ children: e, className: t, ...r }) => {
|
|
2761
|
+
let { orientation: i, appearance: a } = Fn();
|
|
2762
|
+
return /* @__PURE__ */ n("div", {
|
|
2763
|
+
...r,
|
|
1975
2764
|
role: "tablist",
|
|
1976
|
-
"aria-orientation":
|
|
1977
|
-
className:
|
|
2765
|
+
"aria-orientation": i,
|
|
2766
|
+
className: N(In.list, i === "vertical" && In.vertical, a === "underline" && In.underline, a === "pills" && In.pills, t),
|
|
1978
2767
|
children: e
|
|
1979
2768
|
});
|
|
1980
2769
|
};
|
|
1981
|
-
|
|
1982
|
-
var
|
|
2770
|
+
Ln.displayName = "TabsList";
|
|
2771
|
+
var Rn = {
|
|
1983
2772
|
panel: "_panel_1v1a9_1",
|
|
1984
2773
|
visible: "_visible_1v1a9_10",
|
|
1985
2774
|
vertical: "_vertical_1v1a9_14"
|
|
1986
|
-
},
|
|
1987
|
-
let { activeIndex:
|
|
1988
|
-
return
|
|
1989
|
-
if (!
|
|
1990
|
-
|
|
2775
|
+
}, zn = ({ index: e, children: t, className: r }) => {
|
|
2776
|
+
let { activeIndex: i, orientation: a } = Fn(), [o, s] = g(!1), c = i === e;
|
|
2777
|
+
return f(() => {
|
|
2778
|
+
if (!c) {
|
|
2779
|
+
s(!1);
|
|
1991
2780
|
return;
|
|
1992
2781
|
}
|
|
1993
|
-
let e = setTimeout(() =>
|
|
2782
|
+
let e = setTimeout(() => s(!0), 10);
|
|
1994
2783
|
return () => clearTimeout(e);
|
|
1995
|
-
}, [
|
|
2784
|
+
}, [c]), /* @__PURE__ */ n("div", {
|
|
1996
2785
|
role: "tabpanel",
|
|
1997
2786
|
id: `tab-panel-${e}`,
|
|
1998
2787
|
"aria-labelledby": `tab-${e}`,
|
|
1999
|
-
hidden: !
|
|
2788
|
+
hidden: !c,
|
|
2000
2789
|
tabIndex: 0,
|
|
2001
|
-
className:
|
|
2790
|
+
className: N(Rn.panel, o && Rn.visible, a === "vertical" && Rn.vertical, r),
|
|
2002
2791
|
children: t
|
|
2003
2792
|
});
|
|
2004
2793
|
};
|
|
2005
|
-
|
|
2006
|
-
var
|
|
2794
|
+
zn.displayName = "TabsPanel";
|
|
2795
|
+
var Bn = {
|
|
2007
2796
|
tab: "_tab_qe8xc_1",
|
|
2008
2797
|
iconOnly: "_iconOnly_qe8xc_27",
|
|
2009
2798
|
tabIcon: "_tabIcon_qe8xc_31",
|
|
@@ -2012,285 +2801,285 @@ var pn = {
|
|
|
2012
2801
|
underline: "_underline_qe8xc_60",
|
|
2013
2802
|
pills: "_pills_qe8xc_92",
|
|
2014
2803
|
vertical: "_vertical_qe8xc_106"
|
|
2015
|
-
},
|
|
2016
|
-
let { activeIndex:
|
|
2017
|
-
return /* @__PURE__ */
|
|
2804
|
+
}, Vn = c(({ index: e, children: t, className: i, disabled: a = !1, icon: o, onClick: s, onKeyDown: c, ...l }, d) => {
|
|
2805
|
+
let { activeIndex: f, setActiveIndex: p, orientation: m, appearance: h = "default", registerTab: g, onTabKeyDown: _ } = Fn(), v = f === e, y = !!o, b = y && t == null;
|
|
2806
|
+
return /* @__PURE__ */ r("button", {
|
|
2018
2807
|
type: "button",
|
|
2019
|
-
ref:
|
|
2020
|
-
|
|
2808
|
+
ref: u((t) => {
|
|
2809
|
+
g(e, t), typeof d == "function" ? d(t) : d && (d.current = t);
|
|
2021
2810
|
}, [
|
|
2022
|
-
|
|
2811
|
+
g,
|
|
2023
2812
|
e,
|
|
2024
|
-
|
|
2813
|
+
d
|
|
2025
2814
|
]),
|
|
2026
2815
|
role: "tab",
|
|
2027
2816
|
"aria-selected": v,
|
|
2028
2817
|
"aria-controls": `tab-panel-${e}`,
|
|
2029
2818
|
id: `tab-${e}`,
|
|
2030
|
-
disabled:
|
|
2819
|
+
disabled: a,
|
|
2031
2820
|
tabIndex: v ? 0 : -1,
|
|
2032
|
-
className:
|
|
2821
|
+
className: N(Bn.tab, Bn[h], m === "vertical" && Bn.vertical, y && Bn.withIcon, b && Bn.iconOnly, i),
|
|
2033
2822
|
onClick: (t) => {
|
|
2034
|
-
|
|
2823
|
+
a || (p(e), s?.(t));
|
|
2035
2824
|
},
|
|
2036
2825
|
onKeyDown: (e) => {
|
|
2037
|
-
|
|
2826
|
+
_(e), c?.(e);
|
|
2038
2827
|
},
|
|
2039
|
-
...
|
|
2040
|
-
children: [y && /* @__PURE__ */
|
|
2041
|
-
className:
|
|
2828
|
+
...l,
|
|
2829
|
+
children: [y && /* @__PURE__ */ n("span", {
|
|
2830
|
+
className: Bn.tabIcon,
|
|
2042
2831
|
"aria-hidden": "true",
|
|
2043
|
-
children:
|
|
2044
|
-
}), t != null && /* @__PURE__ */
|
|
2045
|
-
className:
|
|
2832
|
+
children: o
|
|
2833
|
+
}), t != null && /* @__PURE__ */ n("span", {
|
|
2834
|
+
className: Bn.label,
|
|
2046
2835
|
children: t
|
|
2047
2836
|
})]
|
|
2048
2837
|
});
|
|
2049
2838
|
});
|
|
2050
|
-
|
|
2051
|
-
var
|
|
2839
|
+
Vn.displayName = "Tab";
|
|
2840
|
+
var Hn = {
|
|
2052
2841
|
tabs: "_tabs_uqy7q_1",
|
|
2053
2842
|
vertical: "_vertical_uqy7q_5"
|
|
2054
|
-
},
|
|
2055
|
-
let { activeIndex: c, setActiveIndex: l } =
|
|
2843
|
+
}, Un = ({ children: e, activeIndex: t, defaultActiveIndex: r = 0, onChange: i, orientation: a = "horizontal", appearance: o = "default", className: s }) => {
|
|
2844
|
+
let { activeIndex: c, setActiveIndex: l } = xe({
|
|
2056
2845
|
activeIndex: t,
|
|
2057
|
-
defaultActiveIndex:
|
|
2058
|
-
onChange:
|
|
2059
|
-
}),
|
|
2060
|
-
|
|
2061
|
-
}, []), { onKeyDown: p } =
|
|
2846
|
+
defaultActiveIndex: r,
|
|
2847
|
+
onChange: i
|
|
2848
|
+
}), d = h([]), f = u((e, t) => {
|
|
2849
|
+
d.current[e] = t;
|
|
2850
|
+
}, []), { onKeyDown: p } = U({
|
|
2062
2851
|
activeIndex: c,
|
|
2063
2852
|
setActiveIndex: l,
|
|
2064
|
-
tabRefs:
|
|
2065
|
-
orientation:
|
|
2853
|
+
tabRefs: d,
|
|
2854
|
+
orientation: a,
|
|
2066
2855
|
onNavigate: (e) => {
|
|
2067
|
-
|
|
2856
|
+
d.current[e]?.focus();
|
|
2068
2857
|
}
|
|
2069
2858
|
}), m = {
|
|
2070
2859
|
activeIndex: c,
|
|
2071
2860
|
setActiveIndex: l,
|
|
2072
|
-
orientation:
|
|
2073
|
-
appearance:
|
|
2861
|
+
orientation: a,
|
|
2862
|
+
appearance: o,
|
|
2074
2863
|
registerTab: f,
|
|
2075
2864
|
onTabKeyDown: p
|
|
2076
2865
|
};
|
|
2077
|
-
return /* @__PURE__ */
|
|
2866
|
+
return /* @__PURE__ */ n(Pn.Provider, {
|
|
2078
2867
|
value: m,
|
|
2079
|
-
children: /* @__PURE__ */
|
|
2080
|
-
className:
|
|
2868
|
+
children: /* @__PURE__ */ n("div", {
|
|
2869
|
+
className: N(Hn.tabs, a === "vertical" && Hn.vertical, s),
|
|
2081
2870
|
children: e
|
|
2082
2871
|
})
|
|
2083
2872
|
});
|
|
2084
2873
|
};
|
|
2085
|
-
|
|
2874
|
+
Un.displayName = "Tabs";
|
|
2086
2875
|
//#endregion
|
|
2087
2876
|
//#region src/components/Tabs/index.ts
|
|
2088
|
-
var
|
|
2089
|
-
List:
|
|
2090
|
-
Tab:
|
|
2091
|
-
Panel:
|
|
2092
|
-
}),
|
|
2877
|
+
var Wn = Object.assign(Un, {
|
|
2878
|
+
List: Ln,
|
|
2879
|
+
Tab: Vn,
|
|
2880
|
+
Panel: zn
|
|
2881
|
+
}), Gn = {
|
|
2093
2882
|
tooltip: "_tooltip_10opu_1",
|
|
2094
2883
|
arrow: "_arrow_10opu_25"
|
|
2095
|
-
},
|
|
2096
|
-
let
|
|
2884
|
+
}, Kn = c(({ content: e, placement: t = "top", arrowRef: i, arrowX: a, arrowY: o, className: s, style: c, ...l }, u) => {
|
|
2885
|
+
let d = {
|
|
2097
2886
|
top: "bottom",
|
|
2098
2887
|
right: "left",
|
|
2099
2888
|
bottom: "top",
|
|
2100
2889
|
left: "right"
|
|
2101
|
-
}[t.split("-")[0]],
|
|
2890
|
+
}[t.split("-")[0]], f = {
|
|
2102
2891
|
position: "absolute",
|
|
2103
2892
|
pointerEvents: "none",
|
|
2104
|
-
left:
|
|
2105
|
-
top:
|
|
2106
|
-
[
|
|
2893
|
+
left: a == null ? "" : `${a}px`,
|
|
2894
|
+
top: o == null ? "" : `${o}px`,
|
|
2895
|
+
[d]: "-5px"
|
|
2107
2896
|
};
|
|
2108
|
-
return /* @__PURE__ */
|
|
2109
|
-
ref:
|
|
2110
|
-
className:
|
|
2897
|
+
return /* @__PURE__ */ r("div", {
|
|
2898
|
+
ref: u,
|
|
2899
|
+
className: N(Gn.tooltip, s),
|
|
2111
2900
|
"data-placement": t,
|
|
2112
2901
|
"data-state": "open",
|
|
2113
|
-
style:
|
|
2114
|
-
...
|
|
2115
|
-
children: [e, /* @__PURE__ */
|
|
2116
|
-
ref:
|
|
2117
|
-
className:
|
|
2118
|
-
style:
|
|
2902
|
+
style: c,
|
|
2903
|
+
...l,
|
|
2904
|
+
children: [e, /* @__PURE__ */ n("div", {
|
|
2905
|
+
ref: i,
|
|
2906
|
+
className: Gn.arrow,
|
|
2907
|
+
style: f
|
|
2119
2908
|
})]
|
|
2120
2909
|
});
|
|
2121
2910
|
});
|
|
2122
|
-
|
|
2911
|
+
Kn.displayName = "TooltipContent";
|
|
2123
2912
|
//#endregion
|
|
2124
2913
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
2125
|
-
var
|
|
2914
|
+
var qn = ({ children: e, placement: i = "top", content: a, disabled: o = !1, delay: s = {
|
|
2126
2915
|
open: 300,
|
|
2127
2916
|
close: 100
|
|
2128
|
-
}, maxWidth:
|
|
2129
|
-
let [
|
|
2130
|
-
open:
|
|
2917
|
+
}, maxWidth: c = 250, className: l, onOpenChange: u }) => {
|
|
2918
|
+
let [d, f] = g(!1), m = h(null), _ = p(), { context: v, floatingStyles: y, middlewareData: b, setRef: x, setFloatingRef: S, placement: w } = et({
|
|
2919
|
+
open: d,
|
|
2131
2920
|
onOpenChange: (e) => {
|
|
2132
|
-
|
|
2921
|
+
o || (f(e), u?.(e));
|
|
2133
2922
|
},
|
|
2134
|
-
placement:
|
|
2135
|
-
middleware: [
|
|
2136
|
-
}),
|
|
2137
|
-
open:
|
|
2138
|
-
close:
|
|
2139
|
-
} }),
|
|
2140
|
-
return /* @__PURE__ */
|
|
2923
|
+
placement: i,
|
|
2924
|
+
middleware: [C({ element: m })]
|
|
2925
|
+
}), T = b.arrow?.x, E = b.arrow?.y, { getReferenceProps: D, getFloatingProps: O } = M([j(v, { delay: {
|
|
2926
|
+
open: s.open,
|
|
2927
|
+
close: s.close
|
|
2928
|
+
} }), A(v)]);
|
|
2929
|
+
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("div", {
|
|
2141
2930
|
ref: x,
|
|
2142
2931
|
style: { display: "inline-flex" },
|
|
2143
|
-
"aria-describedby":
|
|
2144
|
-
...
|
|
2932
|
+
"aria-describedby": d ? _ : void 0,
|
|
2933
|
+
...D(),
|
|
2145
2934
|
children: e
|
|
2146
|
-
}), /* @__PURE__ */
|
|
2147
|
-
id:
|
|
2935
|
+
}), /* @__PURE__ */ n(we, { children: d && a && /* @__PURE__ */ n(Kn, {
|
|
2936
|
+
id: _,
|
|
2148
2937
|
ref: S,
|
|
2149
|
-
content:
|
|
2150
|
-
arrowRef:
|
|
2151
|
-
arrowX:
|
|
2152
|
-
arrowY:
|
|
2938
|
+
content: a,
|
|
2939
|
+
arrowRef: m,
|
|
2940
|
+
arrowX: T,
|
|
2941
|
+
arrowY: E,
|
|
2153
2942
|
role: "tooltip",
|
|
2154
2943
|
style: {
|
|
2155
2944
|
...y,
|
|
2156
|
-
maxWidth: typeof
|
|
2945
|
+
maxWidth: typeof c == "number" ? `${c}px` : c
|
|
2157
2946
|
},
|
|
2158
|
-
placement:
|
|
2159
|
-
className:
|
|
2160
|
-
...
|
|
2947
|
+
placement: w,
|
|
2948
|
+
className: l,
|
|
2949
|
+
...O()
|
|
2161
2950
|
}) })] });
|
|
2162
2951
|
};
|
|
2163
|
-
|
|
2952
|
+
qn.displayName = "Tooltip";
|
|
2164
2953
|
//#endregion
|
|
2165
2954
|
//#region src/utils/devWarning.ts
|
|
2166
|
-
var
|
|
2955
|
+
var Jn = (e, t) => {
|
|
2167
2956
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
2168
2957
|
}, X = {
|
|
2169
|
-
button: "
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
square: "
|
|
2182
|
-
rounded: "
|
|
2183
|
-
pill: "
|
|
2184
|
-
sm: "
|
|
2185
|
-
md: "
|
|
2186
|
-
lg: "
|
|
2187
|
-
fullWidth: "
|
|
2188
|
-
iconOnly: "
|
|
2189
|
-
label: "
|
|
2190
|
-
labelText: "
|
|
2191
|
-
icon: "
|
|
2192
|
-
spinner: "
|
|
2193
|
-
"button-spin": "_button-
|
|
2194
|
-
badge: "
|
|
2195
|
-
shortcut: "
|
|
2196
|
-
},
|
|
2197
|
-
let
|
|
2198
|
-
[X.disabled]:
|
|
2199
|
-
[X.loading]:
|
|
2958
|
+
button: "_button_1b73n_1",
|
|
2959
|
+
solid: "_solid_1b73n_23",
|
|
2960
|
+
primary: "_primary_1b73n_23",
|
|
2961
|
+
loading: "_loading_1b73n_23",
|
|
2962
|
+
neutral: "_neutral_1b73n_49",
|
|
2963
|
+
success: "_success_1b73n_75",
|
|
2964
|
+
warning: "_warning_1b73n_101",
|
|
2965
|
+
danger: "_danger_1b73n_127",
|
|
2966
|
+
outline: "_outline_1b73n_153",
|
|
2967
|
+
ghost: "_ghost_1b73n_283",
|
|
2968
|
+
soft: "_soft_1b73n_413",
|
|
2969
|
+
link: "_link_1b73n_543",
|
|
2970
|
+
square: "_square_1b73n_711",
|
|
2971
|
+
rounded: "_rounded_1b73n_715",
|
|
2972
|
+
pill: "_pill_1b73n_719",
|
|
2973
|
+
sm: "_sm_1b73n_723",
|
|
2974
|
+
md: "_md_1b73n_729",
|
|
2975
|
+
lg: "_lg_1b73n_735",
|
|
2976
|
+
fullWidth: "_fullWidth_1b73n_741",
|
|
2977
|
+
iconOnly: "_iconOnly_1b73n_745",
|
|
2978
|
+
label: "_label_1b73n_749",
|
|
2979
|
+
labelText: "_labelText_1b73n_771",
|
|
2980
|
+
icon: "_icon_1b73n_745",
|
|
2981
|
+
spinner: "_spinner_1b73n_790",
|
|
2982
|
+
"button-spin": "_button-spin_1b73n_1",
|
|
2983
|
+
badge: "_badge_1b73n_812",
|
|
2984
|
+
shortcut: "_shortcut_1b73n_826"
|
|
2985
|
+
}, Yn = c(({ children: e, color: i = "primary", appearance: a = "solid", size: s = "md", shape: c = "pill", type: u = "button", disabled: d = !1, loading: f = !1, loadingText: p, iconStart: m, iconEnd: h, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: P, ...F }, I) => {
|
|
2986
|
+
let L = S && l(e) ? e : void 0, R = L ? L.props.children : e, z = x || !R && !!(m || h), ee = !!(T || E || L?.props["aria-label"] || L?.props["aria-labelledby"]), B = d || f, te = f && p ? p : R, ne = p && R && !z && (typeof R == "string" || typeof R == "number") && (typeof p == "string" || typeof p == "number") ? String(f ? R : p) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie = N(X.button, X[i], X[a], X[s], X[c], C, {
|
|
2987
|
+
[X.disabled]: B,
|
|
2988
|
+
[X.loading]: f,
|
|
2200
2989
|
[X.fullWidth]: b,
|
|
2201
|
-
[X.iconOnly]:
|
|
2990
|
+
[X.iconOnly]: z
|
|
2202
2991
|
});
|
|
2203
|
-
|
|
2204
|
-
let
|
|
2992
|
+
Jn(!S || !D, "Button: pass href to the child element when using asChild."), Jn(!S || !!L, "Button: asChild requires a single valid React element child."), Jn(!z || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
2993
|
+
let ae = (e) => {
|
|
2205
2994
|
e.preventDefault(), e.stopPropagation();
|
|
2206
|
-
},
|
|
2207
|
-
if (
|
|
2208
|
-
|
|
2995
|
+
}, oe = (e) => {
|
|
2996
|
+
if (B) {
|
|
2997
|
+
ae(e);
|
|
2209
2998
|
return;
|
|
2210
2999
|
}
|
|
2211
|
-
|
|
2212
|
-
},
|
|
2213
|
-
|
|
3000
|
+
L?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
3001
|
+
}, V = /* @__PURE__ */ r(t, { children: [
|
|
3002
|
+
f && (g ? /* @__PURE__ */ n("span", {
|
|
2214
3003
|
className: X.icon,
|
|
2215
3004
|
"aria-hidden": "true",
|
|
2216
|
-
children:
|
|
2217
|
-
}) : /* @__PURE__ */
|
|
3005
|
+
children: g
|
|
3006
|
+
}) : /* @__PURE__ */ n("span", {
|
|
2218
3007
|
className: X.spinner,
|
|
2219
3008
|
"aria-hidden": "true"
|
|
2220
3009
|
})),
|
|
2221
|
-
!
|
|
3010
|
+
!f && m && /* @__PURE__ */ n("span", {
|
|
2222
3011
|
className: X.icon,
|
|
2223
|
-
children:
|
|
3012
|
+
children: m
|
|
2224
3013
|
}),
|
|
2225
|
-
|
|
3014
|
+
te && !z && /* @__PURE__ */ n("span", {
|
|
2226
3015
|
className: X.label,
|
|
2227
|
-
"data-measure":
|
|
2228
|
-
children: /* @__PURE__ */
|
|
3016
|
+
"data-measure": ne,
|
|
3017
|
+
children: /* @__PURE__ */ n("span", {
|
|
2229
3018
|
className: X.labelText,
|
|
2230
|
-
children:
|
|
3019
|
+
children: te
|
|
2231
3020
|
})
|
|
2232
3021
|
}),
|
|
2233
|
-
|
|
3022
|
+
_ && !z && /* @__PURE__ */ n("span", {
|
|
2234
3023
|
className: X.badge,
|
|
2235
|
-
children:
|
|
3024
|
+
children: _
|
|
2236
3025
|
}),
|
|
2237
|
-
v && !
|
|
3026
|
+
v && !z && /* @__PURE__ */ n("span", {
|
|
2238
3027
|
className: X.shortcut,
|
|
2239
3028
|
children: v
|
|
2240
3029
|
}),
|
|
2241
|
-
!
|
|
3030
|
+
!f && h && /* @__PURE__ */ n("span", {
|
|
2242
3031
|
className: X.icon,
|
|
2243
|
-
children:
|
|
3032
|
+
children: h
|
|
2244
3033
|
})
|
|
2245
3034
|
] });
|
|
2246
|
-
return
|
|
2247
|
-
...
|
|
2248
|
-
ref:
|
|
2249
|
-
"aria-busy":
|
|
2250
|
-
"aria-disabled":
|
|
2251
|
-
"aria-label": T ||
|
|
2252
|
-
"aria-labelledby": E ||
|
|
2253
|
-
className:
|
|
2254
|
-
href:
|
|
2255
|
-
onClick:
|
|
2256
|
-
tabIndex:
|
|
2257
|
-
title: y ||
|
|
2258
|
-
children:
|
|
2259
|
-
}) : D ? /* @__PURE__ */
|
|
2260
|
-
ref:
|
|
2261
|
-
href:
|
|
3035
|
+
return L ? o(L, {
|
|
3036
|
+
...F,
|
|
3037
|
+
ref: I,
|
|
3038
|
+
"aria-busy": f || void 0,
|
|
3039
|
+
"aria-disabled": B || void 0,
|
|
3040
|
+
"aria-label": T || L.props["aria-label"] || void 0,
|
|
3041
|
+
"aria-labelledby": E || L.props["aria-labelledby"] || void 0,
|
|
3042
|
+
className: N(L.props.className, ie),
|
|
3043
|
+
href: B ? void 0 : L.props.href,
|
|
3044
|
+
onClick: oe,
|
|
3045
|
+
tabIndex: B ? -1 : L.props.tabIndex,
|
|
3046
|
+
title: y || L.props.title,
|
|
3047
|
+
children: V
|
|
3048
|
+
}) : D ? /* @__PURE__ */ n("a", {
|
|
3049
|
+
ref: I,
|
|
3050
|
+
href: B ? void 0 : D,
|
|
2262
3051
|
id: j,
|
|
2263
3052
|
role: M,
|
|
2264
|
-
tabIndex:
|
|
3053
|
+
tabIndex: B ? -1 : P,
|
|
2265
3054
|
target: O,
|
|
2266
|
-
rel:
|
|
3055
|
+
rel: re,
|
|
2267
3056
|
download: A,
|
|
2268
|
-
onClick:
|
|
2269
|
-
"aria-disabled":
|
|
3057
|
+
onClick: B ? ae : w,
|
|
3058
|
+
"aria-disabled": B || void 0,
|
|
2270
3059
|
"aria-label": T || void 0,
|
|
2271
3060
|
"aria-labelledby": E || void 0,
|
|
2272
|
-
"aria-busy":
|
|
2273
|
-
className:
|
|
3061
|
+
"aria-busy": f || void 0,
|
|
3062
|
+
className: ie,
|
|
2274
3063
|
title: y,
|
|
2275
|
-
children:
|
|
2276
|
-
}) : /* @__PURE__ */
|
|
2277
|
-
...
|
|
2278
|
-
ref:
|
|
3064
|
+
children: V
|
|
3065
|
+
}) : /* @__PURE__ */ n("button", {
|
|
3066
|
+
...F,
|
|
3067
|
+
ref: I,
|
|
2279
3068
|
id: j,
|
|
2280
3069
|
role: M,
|
|
2281
|
-
tabIndex:
|
|
2282
|
-
type:
|
|
2283
|
-
disabled:
|
|
2284
|
-
onClick:
|
|
3070
|
+
tabIndex: P,
|
|
3071
|
+
type: u,
|
|
3072
|
+
disabled: B,
|
|
3073
|
+
onClick: B ? void 0 : w,
|
|
2285
3074
|
"aria-label": T || void 0,
|
|
2286
3075
|
"aria-labelledby": E || void 0,
|
|
2287
|
-
"aria-busy":
|
|
2288
|
-
className:
|
|
3076
|
+
"aria-busy": f || void 0,
|
|
3077
|
+
className: ie,
|
|
2289
3078
|
title: y,
|
|
2290
|
-
children:
|
|
3079
|
+
children: V
|
|
2291
3080
|
});
|
|
2292
3081
|
});
|
|
2293
|
-
|
|
3082
|
+
Yn.displayName = "Button";
|
|
2294
3083
|
var Z = {
|
|
2295
3084
|
wrapper: "_wrapper_1kk5v_1",
|
|
2296
3085
|
colorPrimary: "_colorPrimary_1kk5v_27",
|
|
@@ -2326,62 +3115,62 @@ var Z = {
|
|
|
2326
3115
|
"checkbox-checkmark-in": "_checkbox-checkmark-in_1kk5v_1",
|
|
2327
3116
|
"checkbox-indeterminate-in": "_checkbox-indeterminate-in_1kk5v_1",
|
|
2328
3117
|
disabled: "_disabled_1kk5v_361"
|
|
2329
|
-
},
|
|
3118
|
+
}, Xn = {
|
|
2330
3119
|
sm: Z.labelSm,
|
|
2331
3120
|
md: Z.labelMd,
|
|
2332
3121
|
lg: Z.labelLg
|
|
2333
|
-
},
|
|
3122
|
+
}, Zn = {
|
|
2334
3123
|
sm: Z.wrapperSm,
|
|
2335
3124
|
md: Z.wrapperMd,
|
|
2336
3125
|
lg: Z.wrapperLg
|
|
2337
|
-
},
|
|
3126
|
+
}, Qn = {
|
|
2338
3127
|
sm: Z.containerSm,
|
|
2339
3128
|
md: Z.containerMd,
|
|
2340
3129
|
lg: Z.containerLg
|
|
2341
|
-
},
|
|
3130
|
+
}, $n = {
|
|
2342
3131
|
primary: Z.colorPrimary,
|
|
2343
3132
|
neutral: Z.colorNeutral,
|
|
2344
3133
|
success: Z.colorSuccess,
|
|
2345
3134
|
warning: Z.colorWarning,
|
|
2346
3135
|
danger: Z.colorDanger
|
|
2347
|
-
},
|
|
2348
|
-
let k =
|
|
3136
|
+
}, er = c(({ id: e, label: t, description: i, icon: a, indeterminateIcon: o, checked: s, size: c = "md", color: l = "primary", labelPosition: d = "end", defaultChecked: m = !1, disabled: g = !1, required: _ = !1, indeterminate: y = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
|
|
3137
|
+
let k = p(), A = e ?? k, j = h(null), M = !!C, P = i ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
|
|
2349
3138
|
E,
|
|
2350
|
-
|
|
3139
|
+
P,
|
|
2351
3140
|
F
|
|
2352
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
2353
|
-
value:
|
|
2354
|
-
defaultValue:
|
|
3141
|
+
].filter(Boolean).join(" "), [L, R] = ge({
|
|
3142
|
+
value: s,
|
|
3143
|
+
defaultValue: m,
|
|
2355
3144
|
onChange: S
|
|
2356
|
-
}),
|
|
3145
|
+
}), z = u((e) => {
|
|
2357
3146
|
if (j.current = e, typeof O == "function") {
|
|
2358
3147
|
O(e);
|
|
2359
3148
|
return;
|
|
2360
3149
|
}
|
|
2361
3150
|
O && (O.current = e);
|
|
2362
3151
|
}, [O]);
|
|
2363
|
-
|
|
3152
|
+
f(() => {
|
|
2364
3153
|
j.current && (j.current.indeterminate = y);
|
|
2365
3154
|
}, [y]);
|
|
2366
|
-
let
|
|
3155
|
+
let ee = (e) => {
|
|
2367
3156
|
R(e.target.checked);
|
|
2368
3157
|
};
|
|
2369
|
-
return
|
|
2370
|
-
className:
|
|
3158
|
+
return Jn(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ r("div", {
|
|
3159
|
+
className: N(Z.container, Qn[c], d === "start" && Z.containerLabelStart, b),
|
|
2371
3160
|
children: [
|
|
2372
|
-
/* @__PURE__ */
|
|
3161
|
+
/* @__PURE__ */ r("label", {
|
|
2373
3162
|
htmlFor: A,
|
|
2374
|
-
className:
|
|
3163
|
+
className: N(Z.wrapper, Zn[c], $n[l], d === "start" && Z.labelStart, !t && Z.iconOnly, g && Z.disabled, x),
|
|
2375
3164
|
children: [
|
|
2376
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ n("input", {
|
|
2377
3166
|
...D,
|
|
2378
|
-
ref:
|
|
3167
|
+
ref: z,
|
|
2379
3168
|
id: A,
|
|
2380
3169
|
type: "checkbox",
|
|
2381
3170
|
checked: L,
|
|
2382
|
-
disabled:
|
|
2383
|
-
required:
|
|
2384
|
-
onChange:
|
|
3171
|
+
disabled: g,
|
|
3172
|
+
required: _,
|
|
3173
|
+
onChange: ee,
|
|
2385
3174
|
className: Z.input,
|
|
2386
3175
|
"aria-label": w,
|
|
2387
3176
|
"aria-labelledby": T,
|
|
@@ -2389,20 +3178,20 @@ var Z = {
|
|
|
2389
3178
|
"aria-invalid": M ? !0 : D["aria-invalid"],
|
|
2390
3179
|
"aria-describedby": I || void 0
|
|
2391
3180
|
}),
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
className:
|
|
3181
|
+
/* @__PURE__ */ n("span", {
|
|
3182
|
+
className: N(Z.customCheckbox, M && Z.error, y && Z.indeterminate),
|
|
2394
3183
|
"aria-hidden": "true",
|
|
2395
|
-
children: y ? /* @__PURE__ */
|
|
2396
|
-
className:
|
|
2397
|
-
children:
|
|
2398
|
-
}) : L && /* @__PURE__ */
|
|
3184
|
+
children: y ? /* @__PURE__ */ n("span", {
|
|
3185
|
+
className: N(Z.indeterminateMark, o && Z.customMark),
|
|
3186
|
+
children: o
|
|
3187
|
+
}) : L && /* @__PURE__ */ n("span", {
|
|
2399
3188
|
className: Z.checkmark,
|
|
2400
|
-
children:
|
|
3189
|
+
children: a ?? /* @__PURE__ */ n(v, {})
|
|
2401
3190
|
})
|
|
2402
3191
|
}),
|
|
2403
|
-
t && /* @__PURE__ */
|
|
2404
|
-
className:
|
|
2405
|
-
children: [t,
|
|
3192
|
+
t && /* @__PURE__ */ r("span", {
|
|
3193
|
+
className: N(Z.label, Xn[c]),
|
|
3194
|
+
children: [t, _ && /* @__PURE__ */ n("span", {
|
|
2406
3195
|
className: Z.requiredMark,
|
|
2407
3196
|
"aria-hidden": "true",
|
|
2408
3197
|
children: "*"
|
|
@@ -2410,12 +3199,12 @@ var Z = {
|
|
|
2410
3199
|
})
|
|
2411
3200
|
]
|
|
2412
3201
|
}),
|
|
2413
|
-
|
|
2414
|
-
id:
|
|
3202
|
+
i && /* @__PURE__ */ n("span", {
|
|
3203
|
+
id: P,
|
|
2415
3204
|
className: Z.descriptionText,
|
|
2416
|
-
children:
|
|
3205
|
+
children: i
|
|
2417
3206
|
}),
|
|
2418
|
-
M && /* @__PURE__ */
|
|
3207
|
+
M && /* @__PURE__ */ n("span", {
|
|
2419
3208
|
id: F,
|
|
2420
3209
|
className: Z.errorText,
|
|
2421
3210
|
children: C
|
|
@@ -2423,7 +3212,7 @@ var Z = {
|
|
|
2423
3212
|
]
|
|
2424
3213
|
});
|
|
2425
3214
|
});
|
|
2426
|
-
|
|
3215
|
+
er.displayName = "Checkbox";
|
|
2427
3216
|
var Q = {
|
|
2428
3217
|
inputGroup: "_inputGroup_1fjhk_1",
|
|
2429
3218
|
primary: "_primary_1fjhk_29",
|
|
@@ -2465,7 +3254,7 @@ var Q = {
|
|
|
2465
3254
|
toneDanger: "_toneDanger_1fjhk_876",
|
|
2466
3255
|
toneMuted: "_toneMuted_1fjhk_880",
|
|
2467
3256
|
toneInverse: "_toneInverse_1fjhk_884"
|
|
2468
|
-
},
|
|
3257
|
+
}, tr = {
|
|
2469
3258
|
default: Q.toneDefault,
|
|
2470
3259
|
primary: Q.tonePrimary,
|
|
2471
3260
|
secondary: Q.toneSecondary,
|
|
@@ -2473,7 +3262,7 @@ var Q = {
|
|
|
2473
3262
|
danger: Q.toneDanger,
|
|
2474
3263
|
muted: Q.toneMuted,
|
|
2475
3264
|
inverse: Q.toneInverse
|
|
2476
|
-
},
|
|
3265
|
+
}, nr = (e = "text", t) => {
|
|
2477
3266
|
if (t) return t;
|
|
2478
3267
|
switch (e) {
|
|
2479
3268
|
case "email": return "email";
|
|
@@ -2483,7 +3272,7 @@ var Q = {
|
|
|
2483
3272
|
case "search": return "off";
|
|
2484
3273
|
default: return;
|
|
2485
3274
|
}
|
|
2486
|
-
},
|
|
3275
|
+
}, rr = (e, t) => {
|
|
2487
3276
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
2488
3277
|
for (let e of t) {
|
|
2489
3278
|
if (e === "#") {
|
|
@@ -2495,149 +3284,149 @@ var Q = {
|
|
|
2495
3284
|
r < n.length && (i += e);
|
|
2496
3285
|
}
|
|
2497
3286
|
return i;
|
|
2498
|
-
},
|
|
2499
|
-
let
|
|
2500
|
-
|
|
2501
|
-
!
|
|
3287
|
+
}, ir = (e, t) => t ? typeof t == "function" ? t(e) : rr(e, t) : e, ar = c(({ id: e, label: i, name: a, description: o, placeholder: s, value: c, defaultValue: l, type: d = "text", size: f, color: m = "primary", variant: _ = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: C = !1, className: w, wrapperClassName: T, autoComplete: E, readOnly: D = !1, clearable: O = !1, onClear: k, onValueChange: A, revealPassword: j = !1, showCounter: M = !1, startIcon: P, endIcon: F, startAddon: I, endAddon: L, prefix: R, suffix: z, clearIcon: ee, mask: B, format: te, parse: ne, startIconTone: re = "default", endIconTone: ie = "default", clearIconTone: ae = "danger", autoFocus: oe, maxLength: V, onMouseEnter: se, onMouseLeave: ce, "aria-describedby": le, "aria-invalid": ue, "aria-labelledby": de, ...H }, fe) => {
|
|
3288
|
+
let pe = p(), me = hn(), he = !!(i || o || v), ge = e ?? (he ? void 0 : me?.controlId) ?? pe, _e = h(null), [ve, ye] = g(!1), [be, xe] = g(l ?? ""), U = c !== void 0, Se = String((U ? c : be) ?? ""), Ce = te ? te(Se) : Se, we = Se.length > 0, Te = f ?? me?.size ?? "md", Ee = y || !!v || !he && !!me?.invalid, De = b || !he && !!me?.disabled, Oe = x || !he && !!me?.required, ke = D || C, Ae = d === "password", je = Ae && j && ve ? "text" : d, Me = P ?? (d === "search" ? /* @__PURE__ */ n(S, {}) : null), Ne = F, Pe = nr(d, E), W = C && !De, Fe = O && we && !De && !ke && !W, G = j && Ae && !De && !W && !Fe, Ie = !W && !Fe && !G && !!Ne, Le = !!(M && V), Re = o ? `${ge}-description` : void 0, ze = v ? `${ge}-error` : void 0, Be = Le ? `${ge}-counter` : void 0, Ve = [
|
|
3289
|
+
le,
|
|
3290
|
+
!he && !le ? me?.ariaDescribedBy : void 0,
|
|
3291
|
+
Re,
|
|
2502
3292
|
ze,
|
|
2503
|
-
Be
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
de(e);
|
|
3293
|
+
Be
|
|
3294
|
+
].filter(Boolean).join(" "), K = ee ?? "×", q = !!(Me || R), He = !!(Ne || z || Fe || G || W), Ue = !!(Me && R), We = !!(Ne && z), Ge = !!(I || L), Ke = u((e) => {
|
|
3295
|
+
if (_e.current = e, typeof fe == "function") {
|
|
3296
|
+
fe(e);
|
|
2508
3297
|
return;
|
|
2509
3298
|
}
|
|
2510
|
-
|
|
2511
|
-
}, [
|
|
2512
|
-
let t =
|
|
2513
|
-
|
|
3299
|
+
fe && (fe.current = e);
|
|
3300
|
+
}, [fe]), qe = u((e) => {
|
|
3301
|
+
let t = ir(ne ? ne(e.target.value) : e.target.value, B);
|
|
3302
|
+
U || xe(t), A?.(t);
|
|
2514
3303
|
}, [
|
|
2515
|
-
|
|
2516
|
-
|
|
3304
|
+
U,
|
|
3305
|
+
B,
|
|
2517
3306
|
A,
|
|
2518
|
-
|
|
2519
|
-
]),
|
|
2520
|
-
|
|
3307
|
+
ne
|
|
3308
|
+
]), Je = u(() => {
|
|
3309
|
+
U || xe(""), A?.(""), k?.(), _e.current?.focus();
|
|
2521
3310
|
}, [
|
|
2522
|
-
|
|
3311
|
+
U,
|
|
2523
3312
|
k,
|
|
2524
3313
|
A
|
|
2525
|
-
]),
|
|
2526
|
-
className:
|
|
2527
|
-
[Q.hasAddons]:
|
|
2528
|
-
[Q.isDisabled]:
|
|
2529
|
-
[Q.isInvalid]:
|
|
2530
|
-
[Q.isLoading]:
|
|
3314
|
+
]), Ye = /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r("div", {
|
|
3315
|
+
className: N(Q.inputGroup, Q[_], Q[m], {
|
|
3316
|
+
[Q.hasAddons]: Ge,
|
|
3317
|
+
[Q.isDisabled]: De,
|
|
3318
|
+
[Q.isInvalid]: Ee,
|
|
3319
|
+
[Q.isLoading]: W
|
|
2531
3320
|
}),
|
|
2532
3321
|
children: [
|
|
2533
|
-
|
|
3322
|
+
I && /* @__PURE__ */ n("span", {
|
|
2534
3323
|
className: Q.addon,
|
|
2535
|
-
children:
|
|
3324
|
+
children: I
|
|
2536
3325
|
}),
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
className:
|
|
2539
|
-
[Q.hasLeftAdornment]:
|
|
2540
|
-
[Q.hasRightAdornment]:
|
|
2541
|
-
[Q.hasStartIconAndPrefix]:
|
|
2542
|
-
[Q.hasEndIconAndSuffix]:
|
|
3326
|
+
/* @__PURE__ */ r("div", {
|
|
3327
|
+
className: N(Q.inputWrapper, {
|
|
3328
|
+
[Q.hasLeftAdornment]: q,
|
|
3329
|
+
[Q.hasRightAdornment]: He,
|
|
3330
|
+
[Q.hasStartIconAndPrefix]: Ue,
|
|
3331
|
+
[Q.hasEndIconAndSuffix]: We
|
|
2543
3332
|
}),
|
|
2544
3333
|
children: [
|
|
2545
|
-
|
|
3334
|
+
Me && /* @__PURE__ */ n("span", {
|
|
2546
3335
|
"aria-hidden": "true",
|
|
2547
|
-
className:
|
|
2548
|
-
children:
|
|
3336
|
+
className: N(Q.startAdornment, tr[re]),
|
|
3337
|
+
children: Me
|
|
2549
3338
|
}),
|
|
2550
|
-
|
|
3339
|
+
R && /* @__PURE__ */ n("span", {
|
|
2551
3340
|
className: Q.prefix,
|
|
2552
|
-
children:
|
|
3341
|
+
children: R
|
|
2553
3342
|
}),
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
...
|
|
2556
|
-
ref:
|
|
2557
|
-
id:
|
|
2558
|
-
name:
|
|
2559
|
-
type:
|
|
2560
|
-
autoComplete:
|
|
2561
|
-
className:
|
|
2562
|
-
value:
|
|
2563
|
-
onChange:
|
|
2564
|
-
placeholder:
|
|
2565
|
-
disabled:
|
|
2566
|
-
readOnly:
|
|
2567
|
-
required:
|
|
2568
|
-
autoFocus:
|
|
2569
|
-
maxLength:
|
|
2570
|
-
"aria-invalid":
|
|
2571
|
-
"aria-labelledby":
|
|
2572
|
-
"aria-describedby":
|
|
3343
|
+
/* @__PURE__ */ n("input", {
|
|
3344
|
+
...H,
|
|
3345
|
+
ref: Ke,
|
|
3346
|
+
id: ge,
|
|
3347
|
+
name: a,
|
|
3348
|
+
type: je,
|
|
3349
|
+
autoComplete: Pe,
|
|
3350
|
+
className: N(Q.input, Q[Te], { [Q.error]: Ee }, w),
|
|
3351
|
+
value: Ce,
|
|
3352
|
+
onChange: qe,
|
|
3353
|
+
placeholder: s,
|
|
3354
|
+
disabled: De,
|
|
3355
|
+
readOnly: ke,
|
|
3356
|
+
required: Oe,
|
|
3357
|
+
autoFocus: oe,
|
|
3358
|
+
maxLength: V,
|
|
3359
|
+
"aria-invalid": Ee ? !0 : ue,
|
|
3360
|
+
"aria-labelledby": de ?? (he ? void 0 : me?.ariaLabelledBy),
|
|
3361
|
+
"aria-describedby": Ve || void 0,
|
|
2573
3362
|
"aria-busy": C || void 0,
|
|
2574
|
-
onMouseEnter:
|
|
2575
|
-
onMouseLeave:
|
|
3363
|
+
onMouseEnter: se,
|
|
3364
|
+
onMouseLeave: ce
|
|
2576
3365
|
}),
|
|
2577
|
-
|
|
3366
|
+
z && /* @__PURE__ */ n("span", {
|
|
2578
3367
|
className: Q.suffix,
|
|
2579
|
-
children:
|
|
3368
|
+
children: z
|
|
2580
3369
|
}),
|
|
2581
|
-
/* @__PURE__ */
|
|
3370
|
+
/* @__PURE__ */ r("div", {
|
|
2582
3371
|
className: Q.endSlot,
|
|
2583
3372
|
children: [
|
|
2584
|
-
|
|
3373
|
+
W && /* @__PURE__ */ n("span", {
|
|
2585
3374
|
className: Q.spinner,
|
|
2586
3375
|
"aria-hidden": "true",
|
|
2587
3376
|
"data-testid": "input-spinner"
|
|
2588
3377
|
}),
|
|
2589
|
-
|
|
3378
|
+
G && /* @__PURE__ */ n("button", {
|
|
2590
3379
|
type: "button",
|
|
2591
3380
|
className: Q.iconButton,
|
|
2592
|
-
onClick: () =>
|
|
2593
|
-
"aria-label":
|
|
2594
|
-
children:
|
|
3381
|
+
onClick: () => ye((e) => !e),
|
|
3382
|
+
"aria-label": ve ? "Hide password" : "Show password",
|
|
3383
|
+
children: ve ? "Hide" : "Show"
|
|
2595
3384
|
}),
|
|
2596
|
-
Fe && /* @__PURE__ */
|
|
3385
|
+
Fe && /* @__PURE__ */ n("button", {
|
|
2597
3386
|
type: "button",
|
|
2598
|
-
className:
|
|
2599
|
-
onClick:
|
|
3387
|
+
className: N(Q.clearButton, tr[ae]),
|
|
3388
|
+
onClick: Je,
|
|
2600
3389
|
"aria-label": "Clear input",
|
|
2601
|
-
children:
|
|
3390
|
+
children: K
|
|
2602
3391
|
}),
|
|
2603
|
-
|
|
3392
|
+
Ie && Ne && /* @__PURE__ */ n("span", {
|
|
2604
3393
|
"aria-hidden": "true",
|
|
2605
|
-
className:
|
|
2606
|
-
children:
|
|
3394
|
+
className: N(Q.endAdornment, tr[ie]),
|
|
3395
|
+
children: Ne
|
|
2607
3396
|
})
|
|
2608
3397
|
]
|
|
2609
3398
|
})
|
|
2610
3399
|
]
|
|
2611
3400
|
}),
|
|
2612
|
-
|
|
3401
|
+
L && /* @__PURE__ */ n("span", {
|
|
2613
3402
|
className: Q.addon,
|
|
2614
|
-
children:
|
|
3403
|
+
children: L
|
|
2615
3404
|
})
|
|
2616
3405
|
]
|
|
2617
|
-
}),
|
|
2618
|
-
id:
|
|
3406
|
+
}), Le && /* @__PURE__ */ r("div", {
|
|
3407
|
+
id: Be,
|
|
2619
3408
|
className: Q.counter,
|
|
2620
3409
|
children: [
|
|
2621
|
-
|
|
3410
|
+
Se.length,
|
|
2622
3411
|
" / ",
|
|
2623
|
-
|
|
3412
|
+
V
|
|
2624
3413
|
]
|
|
2625
3414
|
})] });
|
|
2626
|
-
return !
|
|
2627
|
-
id:
|
|
2628
|
-
label:
|
|
2629
|
-
description:
|
|
3415
|
+
return !he && me ? Ye : /* @__PURE__ */ n(vn, {
|
|
3416
|
+
id: ge,
|
|
3417
|
+
label: i,
|
|
3418
|
+
description: o,
|
|
2630
3419
|
error: v,
|
|
2631
|
-
required:
|
|
2632
|
-
disabled:
|
|
2633
|
-
invalid:
|
|
2634
|
-
size:
|
|
3420
|
+
required: Oe,
|
|
3421
|
+
disabled: De,
|
|
3422
|
+
invalid: Ee,
|
|
3423
|
+
size: Te,
|
|
2635
3424
|
className: T,
|
|
2636
3425
|
bindControl: !1,
|
|
2637
|
-
children:
|
|
3426
|
+
children: Ye
|
|
2638
3427
|
});
|
|
2639
3428
|
});
|
|
2640
|
-
|
|
3429
|
+
ar.displayName = "Input";
|
|
2641
3430
|
var $ = {
|
|
2642
3431
|
root: "_root_1avxs_1",
|
|
2643
3432
|
invalid: "_invalid_1avxs_27",
|
|
@@ -2661,23 +3450,23 @@ var $ = {
|
|
|
2661
3450
|
"radio-indicator-in": "_radio-indicator-in_1avxs_1",
|
|
2662
3451
|
content: "_content_1avxs_339",
|
|
2663
3452
|
error: "_error_1avxs_356"
|
|
2664
|
-
},
|
|
3453
|
+
}, or = {
|
|
2665
3454
|
primary: $.colorPrimary,
|
|
2666
3455
|
neutral: $.colorNeutral,
|
|
2667
3456
|
success: $.colorSuccess,
|
|
2668
3457
|
warning: $.colorWarning,
|
|
2669
3458
|
danger: $.colorDanger
|
|
2670
|
-
},
|
|
2671
|
-
let S =
|
|
3459
|
+
}, sr = c(({ value: e, checked: t, defaultChecked: i = !1, disabled: a = !1, required: o = !1, size: s, color: c, error: l, onCheckedChange: u, label: d, description: f, icon: m, wrapperClassName: h, className: g, id: _, name: v, "aria-describedby": y, ...b }, x) => {
|
|
3460
|
+
let S = Wt(), C = p(), w = _ ?? C, T = f ? `${w}-description` : void 0, E = l ? `${w}-error` : void 0, D = [
|
|
2672
3461
|
T,
|
|
2673
3462
|
E,
|
|
2674
3463
|
S?.describedBy,
|
|
2675
3464
|
y
|
|
2676
|
-
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] =
|
|
3465
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = ge({
|
|
2677
3466
|
value: t,
|
|
2678
|
-
defaultValue:
|
|
2679
|
-
onChange:
|
|
2680
|
-
}), j = O ? S.value === e : k, M = !!S?.disabled ||
|
|
3467
|
+
defaultValue: i,
|
|
3468
|
+
onChange: u
|
|
3469
|
+
}), j = O ? S.value === e : k, M = !!S?.disabled || a, P = !!S?.required || o, F = S?.name ?? v, I = !!(l || S?.invalid), L = s ?? S?.size ?? "md", R = c ?? S?.color ?? "primary", z = (t) => {
|
|
2681
3470
|
if (!M) {
|
|
2682
3471
|
if (O) {
|
|
2683
3472
|
S.onValueChange(e);
|
|
@@ -2686,13 +3475,13 @@ var $ = {
|
|
|
2686
3475
|
A(t.currentTarget.checked);
|
|
2687
3476
|
}
|
|
2688
3477
|
};
|
|
2689
|
-
return /* @__PURE__ */
|
|
2690
|
-
className:
|
|
2691
|
-
children: [/* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ r("div", {
|
|
3479
|
+
className: N($.root, $[L], I && $.invalid, M && $.disabled, or[R], g),
|
|
3480
|
+
children: [/* @__PURE__ */ r("label", {
|
|
2692
3481
|
htmlFor: w,
|
|
2693
|
-
className:
|
|
3482
|
+
className: N($.wrapper, h),
|
|
2694
3483
|
children: [
|
|
2695
|
-
/* @__PURE__ */
|
|
3484
|
+
/* @__PURE__ */ n("input", {
|
|
2696
3485
|
...b,
|
|
2697
3486
|
ref: x,
|
|
2698
3487
|
id: w,
|
|
@@ -2701,78 +3490,78 @@ var $ = {
|
|
|
2701
3490
|
value: e,
|
|
2702
3491
|
checked: j,
|
|
2703
3492
|
disabled: M,
|
|
2704
|
-
required:
|
|
3493
|
+
required: P,
|
|
2705
3494
|
"aria-invalid": I || void 0,
|
|
2706
3495
|
"aria-describedby": D,
|
|
2707
3496
|
className: $.input,
|
|
2708
|
-
onChange:
|
|
3497
|
+
onChange: z
|
|
2709
3498
|
}),
|
|
2710
|
-
/* @__PURE__ */
|
|
3499
|
+
/* @__PURE__ */ n("span", {
|
|
2711
3500
|
className: $.control,
|
|
2712
3501
|
"aria-hidden": "true",
|
|
2713
|
-
children: /* @__PURE__ */
|
|
2714
|
-
className:
|
|
2715
|
-
children:
|
|
3502
|
+
children: /* @__PURE__ */ n("span", {
|
|
3503
|
+
className: N($.indicator, m && $.customIcon),
|
|
3504
|
+
children: m
|
|
2716
3505
|
})
|
|
2717
3506
|
}),
|
|
2718
|
-
(
|
|
3507
|
+
(d || f) && /* @__PURE__ */ r("span", {
|
|
2719
3508
|
className: $.content,
|
|
2720
|
-
children: [
|
|
3509
|
+
children: [d && /* @__PURE__ */ n("span", {
|
|
2721
3510
|
className: $.label,
|
|
2722
|
-
children:
|
|
2723
|
-
}),
|
|
3511
|
+
children: d
|
|
3512
|
+
}), f && /* @__PURE__ */ n("span", {
|
|
2724
3513
|
id: T,
|
|
2725
3514
|
className: $.description,
|
|
2726
|
-
children:
|
|
3515
|
+
children: f
|
|
2727
3516
|
})]
|
|
2728
3517
|
})
|
|
2729
3518
|
]
|
|
2730
|
-
}),
|
|
3519
|
+
}), l && /* @__PURE__ */ n("div", {
|
|
2731
3520
|
id: E,
|
|
2732
3521
|
className: $.error,
|
|
2733
|
-
children:
|
|
3522
|
+
children: l
|
|
2734
3523
|
})]
|
|
2735
3524
|
});
|
|
2736
3525
|
});
|
|
2737
|
-
|
|
3526
|
+
sr.displayName = "Radio";
|
|
2738
3527
|
//#endregion
|
|
2739
3528
|
//#region src/theme/ThemeContext.ts
|
|
2740
|
-
var
|
|
2741
|
-
let [
|
|
3529
|
+
var cr = s(null), lr = (e) => e === "highContrast" ? "high-contrast" : e, ur = ({ theme: e, defaultTheme: t = "light", onThemeChange: r, children: i }) => {
|
|
3530
|
+
let [a, o] = ge({
|
|
2742
3531
|
value: e,
|
|
2743
3532
|
defaultValue: t,
|
|
2744
|
-
onChange:
|
|
2745
|
-
}),
|
|
2746
|
-
|
|
3533
|
+
onChange: r
|
|
3534
|
+
}), s = lr(a);
|
|
3535
|
+
f(() => {
|
|
2747
3536
|
if (typeof document > "u") return;
|
|
2748
3537
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
2749
|
-
return e.dataset.velliraTheme =
|
|
3538
|
+
return e.dataset.velliraTheme = s, () => {
|
|
2750
3539
|
if (t === void 0) {
|
|
2751
3540
|
delete e.dataset.velliraTheme;
|
|
2752
3541
|
return;
|
|
2753
3542
|
}
|
|
2754
3543
|
e.dataset.velliraTheme = t;
|
|
2755
3544
|
};
|
|
2756
|
-
}, [
|
|
2757
|
-
let
|
|
2758
|
-
theme:
|
|
2759
|
-
setTheme:
|
|
2760
|
-
}), [
|
|
2761
|
-
return /* @__PURE__ */
|
|
2762
|
-
value:
|
|
2763
|
-
children: /* @__PURE__ */
|
|
2764
|
-
"data-vellira-theme":
|
|
2765
|
-
children:
|
|
3545
|
+
}, [s]);
|
|
3546
|
+
let c = m(() => ({
|
|
3547
|
+
theme: a,
|
|
3548
|
+
setTheme: o
|
|
3549
|
+
}), [a, o]);
|
|
3550
|
+
return /* @__PURE__ */ n(cr.Provider, {
|
|
3551
|
+
value: c,
|
|
3552
|
+
children: /* @__PURE__ */ n("div", {
|
|
3553
|
+
"data-vellira-theme": s,
|
|
3554
|
+
children: i
|
|
2766
3555
|
})
|
|
2767
3556
|
});
|
|
2768
3557
|
};
|
|
2769
|
-
|
|
3558
|
+
ur.displayName = "ThemeProvider";
|
|
2770
3559
|
//#endregion
|
|
2771
3560
|
//#region src/theme/useTheme.ts
|
|
2772
|
-
function
|
|
2773
|
-
let e =
|
|
3561
|
+
function dr() {
|
|
3562
|
+
let e = d(cr);
|
|
2774
3563
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
2775
3564
|
return e;
|
|
2776
3565
|
}
|
|
2777
3566
|
//#endregion
|
|
2778
|
-
export {
|
|
3567
|
+
export { Yn as Button, er as Checkbox, gt as Dropdown, vn as FormField, ar as Input, Vt as Modal, we as Portal, Ce as PortalProvider, sr as Radio, Kt as RadioGroup, Nn as Select, Wn as Tabs, ur as ThemeProvider, qn as Tooltip, dr as useTheme };
|