@vellira-ui/react 2.32.0 → 2.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -22
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1791 -1115
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,87 +1,496 @@
|
|
|
1
|
-
import { Children as e,
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
//#region src/
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
1
|
+
import { Children as e, Fragment as t, cloneElement as n, createContext as r, forwardRef as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
2
|
+
import p from "clsx";
|
|
3
|
+
import { createPortal as m } from "react-dom";
|
|
4
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
5
|
+
import { Check as v, ChevronDown as y, ChevronRight as b, Close as x, Search as S } from "@vellira-ui/icons";
|
|
6
|
+
import { FloatingPortal as C, arrow as w, autoUpdate as T, flip as E, offset as D, shift as O, size as k, useFloating as A, useFocus as j, useHover as M, useInteractions as N } from "@floating-ui/react";
|
|
7
|
+
import { useControllableState as P, useDropdown as F, useModal as I, useSelect as L, useTabs as R, useTabsKeyboard as ee } from "@vellira-ui/core";
|
|
8
|
+
import z from "focus-trap-react";
|
|
9
|
+
//#region src/components/Dropdown/internal/DropdownCollection.ts
|
|
10
|
+
function B(e, t) {
|
|
11
|
+
let n = () => null;
|
|
12
|
+
return n.__velliraDropdownPart = e, n.displayName = t, n;
|
|
13
|
+
}
|
|
14
|
+
function te(t) {
|
|
15
|
+
let n = 0, r, i, o = [], s = [], c = (e) => `${e}-${n++}`;
|
|
16
|
+
function l(e) {
|
|
17
|
+
s.push(e), o.push({
|
|
18
|
+
type: "item",
|
|
19
|
+
item: e,
|
|
20
|
+
itemIndex: s.length - 1
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function u(t, n = {}) {
|
|
24
|
+
e.forEach(t, (e) => {
|
|
25
|
+
if (a(e)) switch (e.type.__velliraDropdownPart) {
|
|
26
|
+
case "trigger":
|
|
27
|
+
r = e;
|
|
28
|
+
return;
|
|
29
|
+
case "content":
|
|
30
|
+
i = e, u(e.props.children, n);
|
|
31
|
+
return;
|
|
32
|
+
case "group": {
|
|
33
|
+
let t = c("group"), r = e.props;
|
|
34
|
+
o.push({
|
|
35
|
+
type: "groupStart",
|
|
36
|
+
id: t,
|
|
37
|
+
props: r
|
|
38
|
+
}), u(r.children, n), o.push({
|
|
39
|
+
type: "groupEnd",
|
|
40
|
+
id: t
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
case "label":
|
|
45
|
+
o.push({
|
|
46
|
+
type: "label",
|
|
47
|
+
id: c("label"),
|
|
48
|
+
props: e.props
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
case "separator":
|
|
52
|
+
o.push({
|
|
53
|
+
type: "separator",
|
|
54
|
+
id: c("separator"),
|
|
55
|
+
props: e.props
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
case "empty":
|
|
59
|
+
o.push({
|
|
60
|
+
type: "empty",
|
|
61
|
+
id: c("empty"),
|
|
62
|
+
props: e.props
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
case "loading":
|
|
66
|
+
o.push({
|
|
67
|
+
type: "loading",
|
|
68
|
+
id: c("loading"),
|
|
69
|
+
props: e.props
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
case "item": {
|
|
73
|
+
let t = e.props;
|
|
74
|
+
l({
|
|
75
|
+
type: "item",
|
|
76
|
+
id: c("item"),
|
|
77
|
+
props: t,
|
|
78
|
+
label: ie(t.children),
|
|
79
|
+
disabled: t.disabled
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
case "checkboxItem": {
|
|
84
|
+
let t = e.props;
|
|
85
|
+
l({
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
id: c("checkbox"),
|
|
88
|
+
props: t,
|
|
89
|
+
label: ie(t.children),
|
|
90
|
+
disabled: t.disabled
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
case "radioGroup": {
|
|
95
|
+
let t = e.props, r = c("radio-group");
|
|
96
|
+
u(t.children, {
|
|
97
|
+
...n,
|
|
98
|
+
radioGroupId: r,
|
|
99
|
+
radioGroupProps: t
|
|
100
|
+
});
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
case "radioItem": {
|
|
104
|
+
let t = e.props;
|
|
105
|
+
l({
|
|
106
|
+
type: "radio",
|
|
107
|
+
id: c("radio"),
|
|
108
|
+
props: t,
|
|
109
|
+
groupId: n.radioGroupId ?? c("radio-group"),
|
|
110
|
+
groupProps: n.radioGroupProps,
|
|
111
|
+
label: ie(t.children),
|
|
112
|
+
disabled: t.disabled
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
case "sub": {
|
|
117
|
+
let t = e.props, n = re(t.children);
|
|
118
|
+
if (!n.trigger) return;
|
|
119
|
+
let r = n.trigger.props, i = te(n.content?.props.children);
|
|
120
|
+
l({
|
|
121
|
+
type: "subTrigger",
|
|
122
|
+
id: c("sub"),
|
|
123
|
+
props: r,
|
|
124
|
+
label: ie(r.children),
|
|
125
|
+
disabled: r.disabled,
|
|
126
|
+
content: n.content?.props.children,
|
|
127
|
+
subEntries: i.entries,
|
|
128
|
+
subItems: i.items
|
|
129
|
+
});
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
case "itemBadge":
|
|
133
|
+
case "itemDescription":
|
|
134
|
+
case "itemIcon":
|
|
135
|
+
case "itemShortcut":
|
|
136
|
+
case "subContent":
|
|
137
|
+
case "subTrigger": return;
|
|
138
|
+
default: u(e.props.children, n);
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return u(t), {
|
|
143
|
+
content: i,
|
|
144
|
+
entries: o,
|
|
145
|
+
items: s,
|
|
146
|
+
trigger: r
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function ne(t) {
|
|
150
|
+
let n, r, i, o, s = [];
|
|
151
|
+
return e.forEach(t, (e) => {
|
|
152
|
+
if (!a(e)) {
|
|
153
|
+
s.push(e);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
let t = e.type;
|
|
157
|
+
if (t.__velliraDropdownPart === "itemIcon") {
|
|
158
|
+
i = e.props.children;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (t.__velliraDropdownPart === "itemDescription") {
|
|
162
|
+
r = e.props.children;
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (t.__velliraDropdownPart === "itemBadge") {
|
|
166
|
+
n = e.props.children;
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (t.__velliraDropdownPart === "itemShortcut") {
|
|
170
|
+
o = e.props.children;
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
s.push(e);
|
|
174
|
+
}), {
|
|
175
|
+
badge: n,
|
|
176
|
+
content: s,
|
|
177
|
+
description: r,
|
|
178
|
+
icon: i,
|
|
179
|
+
shortcut: o
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function re(t) {
|
|
183
|
+
let n, r;
|
|
184
|
+
return e.forEach(t, (e) => {
|
|
185
|
+
if (!a(e)) return;
|
|
186
|
+
let t = e.type;
|
|
187
|
+
t.__velliraDropdownPart === "subTrigger" && (n = e), t.__velliraDropdownPart === "subContent" && (r = e);
|
|
188
|
+
}), {
|
|
189
|
+
content: r,
|
|
190
|
+
trigger: n
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function ie(t) {
|
|
194
|
+
let n = [];
|
|
195
|
+
function r(t) {
|
|
196
|
+
e.forEach(t, (e) => {
|
|
197
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
198
|
+
n.push(String(e));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (!a(e)) return;
|
|
202
|
+
let t = e.type;
|
|
203
|
+
t.__velliraDropdownPart === "itemBadge" || t.__velliraDropdownPart === "itemDescription" || t.__velliraDropdownPart === "itemIcon" || t.__velliraDropdownPart === "itemShortcut" || r(e.props.children);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return r(t), n.join("").trim();
|
|
207
|
+
}
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/components/Dropdown/CheckboxItem/DropdownCheckboxItem.tsx
|
|
210
|
+
var ae = B("checkboxItem", "Dropdown.CheckboxItem"), V = (...e) => p(e), H = ({ children: e }) => {
|
|
211
|
+
let [t, n] = f(!1);
|
|
212
|
+
if (c(() => {
|
|
13
213
|
n(!0);
|
|
14
214
|
}, []), !t) return null;
|
|
15
215
|
let r = document.getElementById("overlay-root") ?? document.body;
|
|
16
|
-
return r ?
|
|
17
|
-
},
|
|
18
|
-
dropdown: "
|
|
19
|
-
"dropdown-in": "_dropdown-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
216
|
+
return r ? m(e, r) : null;
|
|
217
|
+
}, U = {
|
|
218
|
+
dropdown: "_dropdown_jd7s6_1",
|
|
219
|
+
"dropdown-in": "_dropdown-in_jd7s6_1",
|
|
220
|
+
primary: "_primary_jd7s6_42",
|
|
221
|
+
neutral: "_neutral_jd7s6_65",
|
|
222
|
+
success: "_success_jd7s6_88",
|
|
223
|
+
warning: "_warning_jd7s6_111",
|
|
224
|
+
danger: "_danger_jd7s6_134",
|
|
225
|
+
empty: "_empty_jd7s6_157"
|
|
226
|
+
}, oe = B("empty", "Dropdown.Empty"), se = ({ children: e }) => /* @__PURE__ */ g("li", {
|
|
227
|
+
role: "presentation",
|
|
228
|
+
className: U.empty,
|
|
229
|
+
children: e ?? "No actions available"
|
|
230
|
+
});
|
|
231
|
+
se.displayName = "DropdownEmptySurface";
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region src/components/Dropdown/Group/DropdownGroup.tsx
|
|
234
|
+
var ce = B("group", "Dropdown.Group"), le = () => null;
|
|
235
|
+
le.displayName = "DropdownGroupSurface";
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/components/Dropdown/internal/DropdownContext.tsx
|
|
238
|
+
var ue = r(null), de = r(null), fe = r(null), pe = ue.Provider, me = de.Provider;
|
|
239
|
+
fe.Provider;
|
|
240
|
+
function he() {
|
|
241
|
+
let e = s(ue);
|
|
242
|
+
if (!e) throw Error("Dropdown compound components must be used inside Dropdown.");
|
|
243
|
+
return e;
|
|
244
|
+
}
|
|
245
|
+
function ge() {
|
|
246
|
+
let e = s(de);
|
|
247
|
+
if (!e) throw Error("Dropdown.Trigger must be used inside Dropdown.");
|
|
248
|
+
return e;
|
|
249
|
+
}
|
|
250
|
+
var W = {
|
|
251
|
+
item: "_item_1e661_1",
|
|
252
|
+
disabled: "_disabled_1e661_22",
|
|
253
|
+
active: "_active_1e661_35",
|
|
254
|
+
itemShortcut: "_itemShortcut_1e661_41",
|
|
255
|
+
itemDescription: "_itemDescription_1e661_42",
|
|
256
|
+
primary: "_primary_1e661_50",
|
|
257
|
+
success: "_success_1e661_68",
|
|
258
|
+
warning: "_warning_1e661_86",
|
|
259
|
+
danger: "_danger_1e661_104",
|
|
260
|
+
itemIcon: "_itemIcon_1e661_127",
|
|
261
|
+
sm: "_sm_1e661_147",
|
|
262
|
+
md: "_md_1e661_153",
|
|
263
|
+
lg: "_lg_1e661_157",
|
|
264
|
+
itemText: "_itemText_1e661_164",
|
|
265
|
+
itemLabel: "_itemLabel_1e661_173",
|
|
266
|
+
itemBadge: "_itemBadge_1e661_199",
|
|
267
|
+
indicator: "_indicator_1e661_226",
|
|
268
|
+
checked: "_checked_1e661_241",
|
|
269
|
+
subContent: "_subContent_1e661_245",
|
|
270
|
+
subLabel: "_subLabel_1e661_268",
|
|
271
|
+
subSeparator: "_subSeparator_1e661_276"
|
|
272
|
+
}, _e = B("item", "Dropdown.Item"), ve = ({ item: e, itemIndex: t }) => {
|
|
273
|
+
let n = he(), [r, i] = f(e.type === "checkbox" ? e.props.defaultChecked ?? !1 : !1), a = n.activeIndex === t, o = n.openSubId === e.id, s = e.type === "checkbox", c = e.type === "radio", l = e.type === "subTrigger", u = s ? e.props.checked ?? r : c ? (e.groupProps?.value ?? n.radioValues[e.groupId]) === e.props.value : !1, d = n.loading || e.disabled, p = e.props, m = ne(p.children), y = m.icon ?? p.icon, x = m.description ?? ("description" in p ? p.description : void 0), S = m.badge ?? ("badge" in p ? p.badge : void 0), C = m.shortcut ?? p.shortcut, w = m.content.length ? m.content : p.children, T = "color" in p ? p.color : void 0, E = e.type === "item" ? e.props.href : void 0, D = e.type === "item" ? e.props.target : void 0, O = e.type === "item" ? e.props.download : void 0, k = n.getItemId(t), A = s ? "menuitemcheckbox" : c ? "menuitemradio" : "menuitem", j = e.type === "item" && D === "_blank" && !e.props.rel ? "noreferrer noopener" : e.type === "item" ? e.props.rel : void 0, M = E ? "a" : "li", N = s || c, P = (t) => {
|
|
274
|
+
if (d) {
|
|
275
|
+
t.preventDefault();
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (s && e.type === "checkbox") {
|
|
279
|
+
let t = !u;
|
|
280
|
+
i(t), e.props.onCheckedChange?.(t);
|
|
281
|
+
}
|
|
282
|
+
n.selectItem(e, ye(t));
|
|
283
|
+
};
|
|
284
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(M, {
|
|
285
|
+
id: k,
|
|
286
|
+
role: A,
|
|
287
|
+
href: M === "a" && !d ? E : void 0,
|
|
288
|
+
target: M === "a" && !d ? D : void 0,
|
|
289
|
+
rel: M === "a" ? j : void 0,
|
|
290
|
+
download: M === "a" && !d ? O : void 0,
|
|
291
|
+
tabIndex: d ? -1 : 0,
|
|
292
|
+
"aria-disabled": d || void 0,
|
|
293
|
+
"aria-checked": s || c ? u : void 0,
|
|
294
|
+
"aria-haspopup": l ? "menu" : void 0,
|
|
295
|
+
"aria-expanded": l ? o : void 0,
|
|
296
|
+
"data-active": a || void 0,
|
|
297
|
+
"data-state": o ? "open" : void 0,
|
|
298
|
+
className: V(W.item, W[n.size], {
|
|
299
|
+
[W.active]: a,
|
|
300
|
+
[W.disabled]: d,
|
|
301
|
+
[W.checked]: u
|
|
302
|
+
}, T && T !== "default" ? W[T] : void 0, p.className),
|
|
303
|
+
onClick: P,
|
|
304
|
+
onMouseEnter: () => {
|
|
305
|
+
d || (n.setActiveIndex(t), l && window.setTimeout(() => n.setOpenSubId(e.id), 120));
|
|
306
|
+
},
|
|
307
|
+
children: [
|
|
308
|
+
N && /* @__PURE__ */ g("span", {
|
|
309
|
+
className: W.indicator,
|
|
310
|
+
"aria-hidden": "true",
|
|
311
|
+
children: u ? /* @__PURE__ */ g(v, {}) : null
|
|
312
|
+
}),
|
|
313
|
+
y && /* @__PURE__ */ g("span", {
|
|
314
|
+
className: W.itemIcon,
|
|
315
|
+
children: y
|
|
316
|
+
}),
|
|
317
|
+
/* @__PURE__ */ _("span", {
|
|
318
|
+
className: W.itemText,
|
|
319
|
+
children: [/* @__PURE__ */ g("span", {
|
|
320
|
+
className: W.itemLabel,
|
|
321
|
+
children: w
|
|
322
|
+
}), x && /* @__PURE__ */ g("span", {
|
|
323
|
+
className: W.itemDescription,
|
|
324
|
+
children: x
|
|
325
|
+
})]
|
|
326
|
+
}),
|
|
327
|
+
S && /* @__PURE__ */ g("span", {
|
|
328
|
+
className: W.itemBadge,
|
|
329
|
+
children: S
|
|
330
|
+
}),
|
|
331
|
+
C && /* @__PURE__ */ g("span", {
|
|
332
|
+
className: W.itemShortcut,
|
|
333
|
+
children: C
|
|
334
|
+
}),
|
|
335
|
+
l && /* @__PURE__ */ g("span", {
|
|
336
|
+
className: W.itemShortcut,
|
|
337
|
+
"aria-hidden": "true",
|
|
338
|
+
children: /* @__PURE__ */ g(b, {})
|
|
339
|
+
})
|
|
340
|
+
]
|
|
341
|
+
}), l && o && e.subEntries.length > 0 && /* @__PURE__ */ g("ul", {
|
|
342
|
+
role: "menu",
|
|
343
|
+
className: W.subContent,
|
|
344
|
+
children: e.subEntries.map((e) => e.type === "label" ? /* @__PURE__ */ g("li", {
|
|
345
|
+
role: "presentation",
|
|
346
|
+
className: W.subLabel,
|
|
347
|
+
children: e.props.children
|
|
348
|
+
}, e.id) : e.type === "separator" ? /* @__PURE__ */ g("li", {
|
|
349
|
+
role: "separator",
|
|
350
|
+
className: W.subSeparator,
|
|
351
|
+
"aria-hidden": "true"
|
|
352
|
+
}, e.id) : e.type === "item" ? /* @__PURE__ */ g(be, {
|
|
353
|
+
item: e.item,
|
|
354
|
+
id: `${k}-${e.itemIndex}`
|
|
355
|
+
}, e.item.id) : null)
|
|
356
|
+
})] });
|
|
357
|
+
};
|
|
358
|
+
ve.displayName = "DropdownItemRow";
|
|
359
|
+
function ye(e) {
|
|
360
|
+
let t = !1;
|
|
361
|
+
return {
|
|
362
|
+
originalEvent: e,
|
|
363
|
+
preventDefault: () => {
|
|
364
|
+
t = !0;
|
|
365
|
+
},
|
|
366
|
+
get defaultPrevented() {
|
|
367
|
+
return t;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function be({ id: e, item: t }) {
|
|
372
|
+
let n = he(), r = t.props, i = ne(r.children), a = i.icon ?? r.icon, o = i.content.length ? i.content : r.children, s = "color" in r ? r.color : void 0, c = n.loading || t.disabled;
|
|
373
|
+
return /* @__PURE__ */ _("li", {
|
|
374
|
+
id: e,
|
|
375
|
+
role: "menuitem",
|
|
376
|
+
tabIndex: c ? -1 : 0,
|
|
377
|
+
"aria-disabled": c || void 0,
|
|
378
|
+
className: V(W.item, W[n.size], { [W.disabled]: c }, s && s !== "default" ? W[s] : void 0),
|
|
379
|
+
onClick: (e) => {
|
|
380
|
+
c || n.selectItem(t, ye(e));
|
|
381
|
+
},
|
|
382
|
+
children: [a && /* @__PURE__ */ g("span", {
|
|
383
|
+
className: W.itemIcon,
|
|
384
|
+
children: a
|
|
385
|
+
}), /* @__PURE__ */ g("span", {
|
|
386
|
+
className: W.itemText,
|
|
387
|
+
children: /* @__PURE__ */ g("span", {
|
|
388
|
+
className: W.itemLabel,
|
|
389
|
+
children: o
|
|
390
|
+
})
|
|
391
|
+
})]
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
var xe = { group: "_group_aviwv_1" }, Se = B("label", "Dropdown.Label"), Ce = ({ children: e, className: t }) => /* @__PURE__ */ g("li", {
|
|
395
|
+
role: "presentation",
|
|
396
|
+
className: V(xe.group, t),
|
|
31
397
|
children: e
|
|
32
|
-
})
|
|
33
|
-
|
|
398
|
+
});
|
|
399
|
+
Ce.displayName = "DropdownLabelSurface";
|
|
34
400
|
//#endregion
|
|
35
|
-
//#region src/
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
401
|
+
//#region src/components/Dropdown/Loading/DropdownLoading.tsx
|
|
402
|
+
var we = B("loading", "Dropdown.Loading"), Te = ({ children: e }) => /* @__PURE__ */ g("li", {
|
|
403
|
+
role: "presentation",
|
|
404
|
+
"aria-live": "polite",
|
|
405
|
+
className: U.empty,
|
|
406
|
+
children: e ?? "Loading actions..."
|
|
407
|
+
});
|
|
408
|
+
Te.displayName = "DropdownLoadingSurface";
|
|
409
|
+
var Ee = { separator: "_separator_1v11r_1" }, De = B("separator", "Dropdown.Separator"), Oe = ({ className: e }) => /* @__PURE__ */ g("li", {
|
|
410
|
+
role: "separator",
|
|
411
|
+
className: V(Ee.separator, e),
|
|
412
|
+
"aria-hidden": "true"
|
|
413
|
+
});
|
|
414
|
+
Oe.displayName = "DropdownSeparatorSurface";
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region src/components/Dropdown/Content/DropdownContent.tsx
|
|
417
|
+
var ke = ({ className: e }) => {
|
|
418
|
+
let n = he();
|
|
419
|
+
if (!n.isOpen) return null;
|
|
420
|
+
let r = V(U.dropdown, U[n.color], n.contentProps?.className, e), i = /* @__PURE__ */ g("ul", {
|
|
421
|
+
ref: n.setContentRef,
|
|
422
|
+
id: n.contentId,
|
|
423
|
+
role: "menu",
|
|
424
|
+
tabIndex: -1,
|
|
425
|
+
"aria-labelledby": n.triggerId,
|
|
426
|
+
"aria-activedescendant": n.activeIndex >= 0 ? n.getItemId(n.activeIndex) : void 0,
|
|
427
|
+
onKeyDown: n.onKeyDown,
|
|
428
|
+
style: {
|
|
429
|
+
...n.surfaceStyle,
|
|
430
|
+
...n.contentProps?.style
|
|
431
|
+
},
|
|
432
|
+
className: r,
|
|
433
|
+
"data-color": n.color,
|
|
434
|
+
children: n.loading ? /* @__PURE__ */ g(Te, { children: n.loadingText }) : n.entries.length ? n.entries.map((e) => e.type === "groupStart" ? /* @__PURE__ */ g(le, {}, e.id) : e.type === "groupEnd" ? null : e.type === "label" ? /* @__PURE__ */ g(Ce, { ...e.props }, e.id) : e.type === "separator" ? /* @__PURE__ */ g(Oe, { ...e.props }, e.id) : e.type === "empty" ? /* @__PURE__ */ g(se, { children: e.props.children }, e.id) : e.type === "loading" ? /* @__PURE__ */ g(Te, { children: e.props.children }, e.id) : /* @__PURE__ */ g(t, { children: /* @__PURE__ */ g(ve, {
|
|
435
|
+
item: e.item,
|
|
436
|
+
itemIndex: e.itemIndex
|
|
437
|
+
}) }, e.item.id)) : /* @__PURE__ */ g(se, {})
|
|
438
|
+
});
|
|
439
|
+
return n.portal ? /* @__PURE__ */ g(H, { children: i }) : i;
|
|
440
|
+
};
|
|
441
|
+
ke.__velliraDropdownPart = "content", ke.displayName = "Dropdown.Content";
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region src/components/Dropdown/ItemBadge/DropdownItemBadge.tsx
|
|
444
|
+
var Ae = B("itemBadge", "Dropdown.ItemBadge"), je = B("itemDescription", "Dropdown.ItemDescription"), Me = B("itemIcon", "Dropdown.ItemIcon"), Ne = B("itemShortcut", "Dropdown.ItemShortcut"), Pe = B("radioGroup", "Dropdown.RadioGroup"), Fe = B("radioItem", "Dropdown.RadioItem"), Ie = (e) => {
|
|
445
|
+
let [t, n] = f(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
446
|
+
return c(() => {
|
|
39
447
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
40
448
|
let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
|
|
41
449
|
return r(), t.addEventListener("change", r), () => {
|
|
42
450
|
t.removeEventListener("change", r);
|
|
43
451
|
};
|
|
44
452
|
}, [e]), t;
|
|
45
|
-
},
|
|
46
|
-
let
|
|
453
|
+
}, Le = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", offset: i = 2, matchTriggerWidth: a = !1, avoidCollisions: o = !0, mobileSheetBreakpoint: s, middleware: l = [] } = {}) => {
|
|
454
|
+
let d = Ie(s), { refs: f, floatingStyles: p, update: m, context: h, middlewareData: g, placement: _ } = A({
|
|
47
455
|
open: e,
|
|
48
456
|
onOpenChange: t,
|
|
49
457
|
placement: n,
|
|
50
458
|
strategy: r,
|
|
51
459
|
transform: !1,
|
|
52
|
-
middleware:
|
|
53
|
-
|
|
54
|
-
...
|
|
55
|
-
|
|
56
|
-
!
|
|
460
|
+
middleware: u(() => [
|
|
461
|
+
D(i),
|
|
462
|
+
...o ? [E()] : [],
|
|
463
|
+
k({ apply({ rects: e, elements: t }) {
|
|
464
|
+
!a || d || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
57
465
|
} }),
|
|
58
|
-
...
|
|
59
|
-
...
|
|
466
|
+
...o ? [O({ padding: 8 })] : [],
|
|
467
|
+
...l
|
|
60
468
|
], [
|
|
469
|
+
o,
|
|
470
|
+
l,
|
|
471
|
+
d,
|
|
61
472
|
a,
|
|
62
|
-
c,
|
|
63
|
-
u,
|
|
64
473
|
i
|
|
65
474
|
]),
|
|
66
|
-
whileElementsMounted:
|
|
475
|
+
whileElementsMounted: T
|
|
67
476
|
});
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
context:
|
|
72
|
-
placement:
|
|
73
|
-
middlewareData:
|
|
74
|
-
floatingStyles:
|
|
75
|
-
isMobileSheet:
|
|
76
|
-
setRef:
|
|
77
|
-
setFloatingRef:
|
|
78
|
-
updatePosition:
|
|
477
|
+
return c(() => {
|
|
478
|
+
d && f.floating.current?.style.removeProperty("width");
|
|
479
|
+
}, [d, f.floating]), {
|
|
480
|
+
context: h,
|
|
481
|
+
placement: _,
|
|
482
|
+
middlewareData: g,
|
|
483
|
+
floatingStyles: d ? {} : p,
|
|
484
|
+
isMobileSheet: d,
|
|
485
|
+
setRef: f.setReference,
|
|
486
|
+
setFloatingRef: f.setFloating,
|
|
487
|
+
updatePosition: m
|
|
79
488
|
};
|
|
80
|
-
},
|
|
81
|
-
let r =
|
|
489
|
+
}, Re = (e, t, n = !0) => {
|
|
490
|
+
let r = d(e);
|
|
82
491
|
r.current = e;
|
|
83
|
-
let i =
|
|
84
|
-
i.current = t,
|
|
492
|
+
let i = d(t);
|
|
493
|
+
i.current = t, c(() => {
|
|
85
494
|
if (!n) return;
|
|
86
495
|
let e = (e) => {
|
|
87
496
|
let t = e.target;
|
|
@@ -89,316 +498,399 @@ var ne = (e) => {
|
|
|
89
498
|
};
|
|
90
499
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
91
500
|
}, [n]);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
501
|
+
};
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region src/components/Dropdown/internal/composeEventHandlers.ts
|
|
504
|
+
function ze(e, t) {
|
|
505
|
+
return (n) => {
|
|
506
|
+
e?.(n), n.defaultPrevented || t(n);
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
function Be(...e) {
|
|
510
|
+
return (t) => {
|
|
511
|
+
e.forEach((e) => {
|
|
512
|
+
if (e) {
|
|
513
|
+
if (typeof e == "function") {
|
|
514
|
+
e(t);
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
e.current = t;
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function G(e) {
|
|
523
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
524
|
+
}
|
|
525
|
+
var K = { wrapper: "_wrapper_14ue8_1" }, Ve = ({ children: e, open: t, defaultOpen: n = !1, onOpenChange: r, size: i = "md", color: a = "primary", placement: s = "bottom-start", offset: p = 2, matchTriggerWidth: m = !1, minWidth: h, 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...", className: D }) => {
|
|
526
|
+
let O = l(), k = `${O}-trigger`, A = `${O}-menu`, j = d(null), M = d(null), [N, P] = f(), [I, L] = f({}), R = u(() => te(e), [e]), ee = u(() => R.items.map((e) => ({
|
|
527
|
+
disabled: e.disabled,
|
|
528
|
+
label: e.label
|
|
529
|
+
})), [R.items]);
|
|
530
|
+
c(() => {
|
|
531
|
+
L((e) => {
|
|
532
|
+
let t = { ...e };
|
|
533
|
+
return R.items.forEach((e) => {
|
|
534
|
+
e.type === "radio" && t[e.groupId] === void 0 && (t[e.groupId] = e.groupProps?.value ?? e.groupProps?.defaultValue);
|
|
535
|
+
}), t;
|
|
536
|
+
});
|
|
537
|
+
}, [R.items]);
|
|
538
|
+
let { floatingStyles: z, setRef: B, setFloatingRef: ne } = Le({
|
|
539
|
+
open: t,
|
|
540
|
+
onOpenChange: r,
|
|
541
|
+
placement: s,
|
|
542
|
+
matchTriggerWidth: m,
|
|
543
|
+
avoidCollisions: b,
|
|
544
|
+
offset: p,
|
|
545
|
+
mobileSheetBreakpoint: 640
|
|
546
|
+
}), { activeIndex: re, setActiveIndex: ie, isOpen: ae, closeDropdown: H, toggleDropdown: U, onKeyDown: oe } = F({
|
|
547
|
+
items: ee,
|
|
548
|
+
open: t,
|
|
549
|
+
defaultOpen: n,
|
|
550
|
+
disabled: w,
|
|
551
|
+
onOpenChange: r,
|
|
552
|
+
getItemValue: (e, t) => R.items[t]?.id ?? "",
|
|
553
|
+
getItemText: (e) => e.label,
|
|
554
|
+
loop: C
|
|
555
|
+
});
|
|
556
|
+
c(() => {
|
|
557
|
+
if (!x || !ae) return;
|
|
558
|
+
let e = document.body.style.overflow;
|
|
559
|
+
return document.body.style.overflow = "hidden", () => {
|
|
560
|
+
document.body.style.overflow = e;
|
|
561
|
+
};
|
|
562
|
+
}, [ae, x]);
|
|
563
|
+
let se = o(() => {
|
|
564
|
+
H(), j.current?.focus();
|
|
565
|
+
}, [H]), ce = o((e, t) => {
|
|
566
|
+
if (e.disabled || T) return;
|
|
567
|
+
if (e.type === "subTrigger") {
|
|
568
|
+
P(e.id);
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
e.type === "item" && e.props.onSelect?.(t), e.type === "radio" && (L((t) => ({
|
|
572
|
+
...t,
|
|
573
|
+
[e.groupId]: e.props.value
|
|
574
|
+
})), e.groupProps?.onValueChange?.(e.props.value));
|
|
575
|
+
let n = e.props.closeOnSelect ?? (e.type !== "checkbox" && S);
|
|
576
|
+
!t.defaultPrevented && n && se();
|
|
577
|
+
}, [
|
|
578
|
+
se,
|
|
579
|
+
S,
|
|
580
|
+
T
|
|
581
|
+
]), le = o((e) => {
|
|
582
|
+
let t = R.items[re];
|
|
583
|
+
if (e.key === "ArrowRight" && t?.type === "subTrigger") {
|
|
584
|
+
e.preventDefault(), P(t.id);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (e.key === "ArrowLeft" && N) {
|
|
588
|
+
e.preventDefault(), P(void 0);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
if ((e.key === "Enter" || e.key === " ") && t) {
|
|
592
|
+
e.preventDefault();
|
|
593
|
+
let n = He(e);
|
|
594
|
+
ce(t, n);
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
oe(e), e.key === "Escape" && j.current?.focus();
|
|
598
|
+
}, [
|
|
599
|
+
re,
|
|
600
|
+
oe,
|
|
601
|
+
N,
|
|
602
|
+
R.items,
|
|
603
|
+
ce
|
|
604
|
+
]), ue = o((e) => {
|
|
605
|
+
e.preventDefault(), U();
|
|
606
|
+
}, [U]), de = o((e) => {
|
|
607
|
+
j.current = e, B(e);
|
|
608
|
+
}, [B]), fe = o((e) => {
|
|
609
|
+
M.current = e, ne(e), e?.focus();
|
|
610
|
+
}, [ne]);
|
|
611
|
+
Re([j, M], H, ae);
|
|
612
|
+
let he = {
|
|
613
|
+
...z,
|
|
614
|
+
minWidth: G(h),
|
|
615
|
+
maxWidth: G(v)
|
|
616
|
+
};
|
|
617
|
+
return /* @__PURE__ */ g(me, {
|
|
618
|
+
value: {
|
|
619
|
+
disabled: w,
|
|
620
|
+
isOpen: ae,
|
|
621
|
+
contentId: A,
|
|
622
|
+
triggerId: k,
|
|
623
|
+
setTriggerRef: de,
|
|
624
|
+
onClick: ue,
|
|
625
|
+
onKeyDown: le
|
|
626
|
+
},
|
|
627
|
+
children: /* @__PURE__ */ g(pe, {
|
|
628
|
+
value: {
|
|
629
|
+
activeIndex: re,
|
|
630
|
+
closeOnSelect: S,
|
|
631
|
+
color: a,
|
|
632
|
+
contentId: A,
|
|
633
|
+
contentProps: R.content?.props,
|
|
634
|
+
disabled: w,
|
|
635
|
+
entries: R.entries,
|
|
636
|
+
getItemId: (e) => `${A}-item-${e}`,
|
|
637
|
+
isOpen: ae,
|
|
638
|
+
items: R.items,
|
|
639
|
+
loading: T,
|
|
640
|
+
loadingText: E,
|
|
641
|
+
maxWidth: v,
|
|
642
|
+
minWidth: h,
|
|
643
|
+
openSubId: N,
|
|
644
|
+
onKeyDown: le,
|
|
645
|
+
portal: y,
|
|
646
|
+
radioValues: I,
|
|
647
|
+
selectItem: ce,
|
|
648
|
+
setActiveIndex: ie,
|
|
649
|
+
setContentRef: fe,
|
|
650
|
+
setOpenSubId: P,
|
|
651
|
+
setRadioValue: (e, t) => {
|
|
652
|
+
L((n) => ({
|
|
653
|
+
...n,
|
|
654
|
+
[e]: t
|
|
655
|
+
}));
|
|
656
|
+
},
|
|
657
|
+
size: i,
|
|
658
|
+
surfaceStyle: he,
|
|
659
|
+
triggerId: k
|
|
660
|
+
},
|
|
661
|
+
children: /* @__PURE__ */ _("div", {
|
|
662
|
+
className: V(K.wrapper, D),
|
|
663
|
+
"data-disabled": w || void 0,
|
|
664
|
+
children: [R.trigger ?? null, R.content ?? /* @__PURE__ */ g(ke, {})]
|
|
136
665
|
})
|
|
137
|
-
|
|
666
|
+
})
|
|
138
667
|
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
668
|
+
};
|
|
669
|
+
Ve.displayName = "DropdownRoot";
|
|
670
|
+
function He(e) {
|
|
671
|
+
let t = !1;
|
|
672
|
+
return {
|
|
673
|
+
originalEvent: e,
|
|
674
|
+
preventDefault: () => {
|
|
675
|
+
t = !0;
|
|
676
|
+
},
|
|
677
|
+
get defaultPrevented() {
|
|
678
|
+
return t;
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/components/Dropdown/SubContent/DropdownSubContent.tsx
|
|
684
|
+
var Ue = B("subContent", "Dropdown.SubContent"), We = B("subTrigger", "Dropdown.SubTrigger"), Ge = B("sub", "Dropdown.Sub"), Ke = {
|
|
685
|
+
button: "_button_xvcvl_1",
|
|
686
|
+
disabled: "_disabled_xvcvl_49",
|
|
687
|
+
arrow: "_arrow_xvcvl_56",
|
|
688
|
+
iconLeft: "_iconLeft_xvcvl_67",
|
|
689
|
+
iconOnly: "_iconOnly_xvcvl_82",
|
|
690
|
+
primary: "_primary_xvcvl_95",
|
|
691
|
+
neutral: "_neutral_xvcvl_135",
|
|
692
|
+
success: "_success_xvcvl_175",
|
|
693
|
+
warning: "_warning_xvcvl_215",
|
|
694
|
+
danger: "_danger_xvcvl_255",
|
|
695
|
+
sm: "_sm_xvcvl_295",
|
|
696
|
+
md: "_md_xvcvl_307",
|
|
697
|
+
lg: "_lg_xvcvl_319",
|
|
698
|
+
label: "_label_xvcvl_331",
|
|
699
|
+
open: "_open_xvcvl_359"
|
|
700
|
+
}, qe = (e) => /* @__PURE__ */ g(Je, { ...e });
|
|
701
|
+
qe.__velliraDropdownPart = "trigger", qe.displayName = "Dropdown.Trigger";
|
|
702
|
+
var Je = ({ children: e, asChild: t = !1, disabled: r, className: i }) => {
|
|
703
|
+
let o = he(), s = ge(), c = t && a(e) ? e : void 0, l = o.disabled || r, u = {
|
|
704
|
+
id: s.triggerId,
|
|
705
|
+
ref: c ? Be(c.props.ref, s.setTriggerRef) : s.setTriggerRef,
|
|
706
|
+
"aria-controls": s.isOpen ? s.contentId : void 0,
|
|
707
|
+
"aria-disabled": l || void 0,
|
|
708
|
+
"aria-expanded": s.isOpen,
|
|
709
|
+
"aria-haspopup": "menu",
|
|
710
|
+
className: V(!c && Ke.button, !c && Ke[o.size], !c && Ke[o.color], i),
|
|
711
|
+
"data-state": s.isOpen ? "open" : "closed",
|
|
712
|
+
disabled: l || void 0,
|
|
713
|
+
onClick: ze(c?.props.onClick, s.onClick),
|
|
714
|
+
onKeyDown: ze(c?.props.onKeyDown, s.onKeyDown)
|
|
715
|
+
};
|
|
716
|
+
return c ? n(c, {
|
|
156
717
|
...u,
|
|
157
|
-
|
|
718
|
+
className: V(c.props.className, i)
|
|
719
|
+
}) : /* @__PURE__ */ _("button", {
|
|
158
720
|
type: "button",
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
"
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
f && /* @__PURE__ */ h("span", {
|
|
169
|
-
"aria-hidden": "true",
|
|
170
|
-
className: ue.iconLeft,
|
|
171
|
-
children: n
|
|
172
|
-
}),
|
|
173
|
-
e,
|
|
174
|
-
_ && /* @__PURE__ */ h("span", {
|
|
175
|
-
"aria-hidden": "true",
|
|
176
|
-
className: z(ue.arrow, { [ue.open]: t }),
|
|
177
|
-
children: v
|
|
178
|
-
})
|
|
179
|
-
]
|
|
721
|
+
...u,
|
|
722
|
+
children: [/* @__PURE__ */ g("span", {
|
|
723
|
+
className: Ke.label,
|
|
724
|
+
children: e
|
|
725
|
+
}), /* @__PURE__ */ g("span", {
|
|
726
|
+
className: V(Ke.arrow, { [Ke.open]: s.isOpen }),
|
|
727
|
+
"aria-hidden": "true",
|
|
728
|
+
children: /* @__PURE__ */ g(y, {})
|
|
729
|
+
})]
|
|
180
730
|
});
|
|
731
|
+
};
|
|
732
|
+
Je.displayName = "DropdownTriggerSurface";
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/components/Dropdown/Dropdown.tsx
|
|
735
|
+
var Ye = Object.assign(Ve, {
|
|
736
|
+
Trigger: qe,
|
|
737
|
+
Content: ke,
|
|
738
|
+
Item: _e,
|
|
739
|
+
CheckboxItem: ae,
|
|
740
|
+
RadioGroup: Pe,
|
|
741
|
+
RadioItem: Fe,
|
|
742
|
+
Group: ce,
|
|
743
|
+
Label: Se,
|
|
744
|
+
Separator: De,
|
|
745
|
+
Sub: Ge,
|
|
746
|
+
SubTrigger: We,
|
|
747
|
+
SubContent: Ue,
|
|
748
|
+
ItemIcon: Me,
|
|
749
|
+
ItemDescription: je,
|
|
750
|
+
ItemBadge: Ae,
|
|
751
|
+
ItemShortcut: Ne,
|
|
752
|
+
Empty: oe,
|
|
753
|
+
Loading: we
|
|
181
754
|
});
|
|
182
|
-
|
|
755
|
+
Ye.displayName = "Dropdown";
|
|
183
756
|
//#endregion
|
|
184
|
-
//#region src/components/
|
|
185
|
-
var
|
|
186
|
-
let
|
|
187
|
-
placement: S,
|
|
188
|
-
matchTriggerWidth: C,
|
|
189
|
-
mobileSheetBreakpoint: 640
|
|
190
|
-
}), F = l(() => i.flatMap((e, t) => fe(e) ? [{
|
|
191
|
-
item: e,
|
|
192
|
-
itemIndex: t
|
|
193
|
-
}] : []), [i]), I = l(() => F.map(({ item: e }) => e), [F]), L = l(() => new Map(F.map(({ itemIndex: e }, t) => [e, t])), [F]), { activeIndex: R, setActiveIndex: ee, isOpen: B, closeDropdown: ne, toggleDropdown: ae, selectItem: V, onKeyDown: ce } = k({
|
|
194
|
-
items: I,
|
|
195
|
-
open: s,
|
|
196
|
-
defaultOpen: d,
|
|
197
|
-
disabled: b,
|
|
198
|
-
onOpenChange: f,
|
|
199
|
-
onSelect: a((e) => {
|
|
200
|
-
o?.(e), D.current?.focus();
|
|
201
|
-
}, [o]),
|
|
202
|
-
getItemValue: (e) => e.value,
|
|
203
|
-
getItemText: (e) => typeof e.label == "string" ? e.label : e.value
|
|
204
|
-
}), ue = B && R >= 0 ? `${A}-item-${R}` : void 0;
|
|
205
|
-
ie([D, O], ne, B);
|
|
206
|
-
let ge = a((e) => {
|
|
207
|
-
ce(e), B && e.key === "Escape" && D.current?.focus();
|
|
208
|
-
}, [B, ce]), _e = a((e) => {
|
|
209
|
-
D.current = e, N(e);
|
|
210
|
-
}, [N]), ve = a((e) => {
|
|
211
|
-
O.current = e, P(e), e?.focus();
|
|
212
|
-
}, [P]);
|
|
213
|
-
return /* @__PURE__ */ g("div", {
|
|
214
|
-
className: z(he.wrapper, m),
|
|
215
|
-
children: [/* @__PURE__ */ h(de, {
|
|
216
|
-
ref: _e,
|
|
217
|
-
id: j,
|
|
218
|
-
isOpen: B,
|
|
219
|
-
disabled: b,
|
|
220
|
-
size: p,
|
|
221
|
-
icon: n,
|
|
222
|
-
label: e,
|
|
223
|
-
ariaLabel: t,
|
|
224
|
-
showArrow: T,
|
|
225
|
-
arrowIcon: E,
|
|
226
|
-
rotateAngle: x,
|
|
227
|
-
className: _,
|
|
228
|
-
onClick: ae,
|
|
229
|
-
onKeyDown: ge,
|
|
230
|
-
"aria-expanded": B,
|
|
231
|
-
"aria-haspopup": "menu",
|
|
232
|
-
...B && { "aria-controls": A },
|
|
233
|
-
children: r
|
|
234
|
-
}), B && /* @__PURE__ */ h(te, {
|
|
235
|
-
ref: ve,
|
|
236
|
-
floatingStyles: M,
|
|
237
|
-
menuId: A,
|
|
238
|
-
labelledById: r ? j : void 0,
|
|
239
|
-
label: t ?? (!r && typeof e == "string" ? e : void 0),
|
|
240
|
-
activeDescendantId: ue,
|
|
241
|
-
onKeyDown: ge,
|
|
242
|
-
className: v,
|
|
243
|
-
children: i.map((e, t) => {
|
|
244
|
-
if (pe(e)) return /* @__PURE__ */ h(oe, { label: e.label }, `group-${e.label}`);
|
|
245
|
-
if (me(e)) return /* @__PURE__ */ h(le, {}, `separator-${t}`);
|
|
246
|
-
if (fe(e)) {
|
|
247
|
-
let n = L.get(t) ?? -1;
|
|
248
|
-
return /* @__PURE__ */ h(se, {
|
|
249
|
-
id: `${A}-item-${n}`,
|
|
250
|
-
...e,
|
|
251
|
-
active: R === n,
|
|
252
|
-
textWrap: e.textWrap || w,
|
|
253
|
-
className: y,
|
|
254
|
-
onClick: () => {
|
|
255
|
-
V(e), D.current?.focus();
|
|
256
|
-
},
|
|
257
|
-
onMouseEnter: () => {
|
|
258
|
-
n < 0 || e.disabled || ee(n);
|
|
259
|
-
},
|
|
260
|
-
children: e.label
|
|
261
|
-
}, `${e.value}-${t}`);
|
|
262
|
-
}
|
|
263
|
-
})
|
|
264
|
-
})]
|
|
265
|
-
});
|
|
266
|
-
}, _e = n(void 0), ve = () => {
|
|
267
|
-
let e = o(_e);
|
|
757
|
+
//#region src/components/Modal/ModalContext.tsx
|
|
758
|
+
var Xe = r(void 0), Ze = () => {
|
|
759
|
+
let e = s(Xe);
|
|
268
760
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
269
761
|
return e;
|
|
270
762
|
};
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
let { descriptionId: t } =
|
|
274
|
-
return /* @__PURE__ */
|
|
763
|
+
Xe.displayName = "ModalContext";
|
|
764
|
+
var Qe = { modalBody: "_modalBody_iv33a_1" }, $e = ({ children: e }) => {
|
|
765
|
+
let { descriptionId: t } = Ze();
|
|
766
|
+
return /* @__PURE__ */ g("div", {
|
|
275
767
|
id: t,
|
|
276
|
-
className:
|
|
768
|
+
className: Qe.modalBody,
|
|
277
769
|
children: e
|
|
278
770
|
});
|
|
279
771
|
};
|
|
280
|
-
|
|
281
|
-
var
|
|
282
|
-
className:
|
|
772
|
+
$e.displayName = "ModalBody";
|
|
773
|
+
var et = { content: "_content_k44g7_1" }, tt = ({ children: e }) => /* @__PURE__ */ g("div", {
|
|
774
|
+
className: et.content,
|
|
283
775
|
children: e
|
|
284
776
|
});
|
|
285
|
-
|
|
286
|
-
var
|
|
287
|
-
className:
|
|
777
|
+
tt.displayName = "ModalContent";
|
|
778
|
+
var nt = { modalFooter: "_modalFooter_ezys6_1" }, rt = ({ children: e }) => /* @__PURE__ */ g("div", {
|
|
779
|
+
className: nt.modalFooter,
|
|
288
780
|
children: e
|
|
289
781
|
});
|
|
290
|
-
|
|
291
|
-
var
|
|
782
|
+
rt.displayName = "ModalFooter";
|
|
783
|
+
var it = {
|
|
292
784
|
modalHeader: "_modalHeader_p8xf1_1",
|
|
293
785
|
modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
|
|
294
786
|
modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
|
|
295
|
-
},
|
|
296
|
-
let { onClose: t, titleId: n } =
|
|
297
|
-
return /* @__PURE__ */
|
|
298
|
-
className:
|
|
299
|
-
children: [/* @__PURE__ */
|
|
787
|
+
}, at = ({ children: e }) => {
|
|
788
|
+
let { onClose: t, titleId: n } = Ze();
|
|
789
|
+
return /* @__PURE__ */ _("div", {
|
|
790
|
+
className: it.modalHeader,
|
|
791
|
+
children: [/* @__PURE__ */ g("h2", {
|
|
300
792
|
id: n,
|
|
301
|
-
className:
|
|
793
|
+
className: it.modalHeaderTitle,
|
|
302
794
|
children: e
|
|
303
|
-
}), t && /* @__PURE__ */
|
|
795
|
+
}), t && /* @__PURE__ */ g("button", {
|
|
304
796
|
type: "button",
|
|
305
|
-
className:
|
|
797
|
+
className: it.modalHeaderCloseButton,
|
|
306
798
|
onClick: t,
|
|
307
799
|
"aria-label": "Close modal",
|
|
308
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ g(x, { size: 16 })
|
|
309
801
|
})]
|
|
310
802
|
});
|
|
311
803
|
};
|
|
312
|
-
|
|
804
|
+
at.displayName = "ModalHeader";
|
|
313
805
|
//#endregion
|
|
314
806
|
//#region src/hooks/useModalKeyboard.ts
|
|
315
|
-
var
|
|
316
|
-
let n =
|
|
807
|
+
var ot = ({ isOpen: e, onClose: t }) => {
|
|
808
|
+
let n = o((n) => {
|
|
317
809
|
e && n.key === "Escape" && (n.preventDefault(), t?.());
|
|
318
810
|
}, [e, t]);
|
|
319
|
-
|
|
320
|
-
},
|
|
811
|
+
c(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
|
|
812
|
+
}, st = {
|
|
321
813
|
overlay: "_overlay_dcudn_1",
|
|
322
814
|
"overlay--open": "_overlay--open_dcudn_14",
|
|
323
815
|
modal: "_modal_dcudn_20",
|
|
324
816
|
"overlay--animated": "_overlay--animated_dcudn_28"
|
|
325
|
-
},
|
|
326
|
-
let f = i ??
|
|
817
|
+
}, ct = 0, lt = "", ut = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: i, closeOnClick: a, closeOnEsc: s = !0, zIndex: l = 1e3, animated: u = !0 }) => {
|
|
818
|
+
let f = i ?? a ?? !0, p = d(null), { titleId: m, descriptionId: h } = Ze(), _ = o((e) => {
|
|
327
819
|
f && e.target === e.currentTarget && t?.();
|
|
328
820
|
}, [f, t]);
|
|
329
|
-
return
|
|
821
|
+
return ot({
|
|
330
822
|
isOpen: n,
|
|
331
|
-
onClose:
|
|
332
|
-
}),
|
|
333
|
-
if (n) return
|
|
334
|
-
|
|
823
|
+
onClose: s ? t : void 0
|
|
824
|
+
}), c(() => {
|
|
825
|
+
if (n) return ct === 0 && (lt = document.body.style.overflow), ct += 1, document.body.style.overflow = "hidden", () => {
|
|
826
|
+
ct = Math.max(0, ct - 1), ct === 0 && (document.body.style.overflow = lt);
|
|
335
827
|
};
|
|
336
|
-
}, [n]), !n && !
|
|
337
|
-
className:
|
|
828
|
+
}, [n]), !n && !u ? null : /* @__PURE__ */ g(H, { children: /* @__PURE__ */ g("div", {
|
|
829
|
+
className: V(st.overlay, n && st["overlay--open"], u && st["overlay--animated"], r),
|
|
338
830
|
onClick: _,
|
|
339
831
|
tabIndex: -1,
|
|
340
832
|
role: "presentation",
|
|
341
833
|
"aria-hidden": !n,
|
|
342
834
|
style: { zIndex: l },
|
|
343
|
-
children: /* @__PURE__ */
|
|
835
|
+
children: /* @__PURE__ */ g(z, {
|
|
344
836
|
active: n,
|
|
345
837
|
focusTrapOptions: {
|
|
346
838
|
fallbackFocus: () => p.current,
|
|
347
839
|
returnFocusOnDeactivate: !0,
|
|
348
840
|
allowOutsideClick: !0
|
|
349
841
|
},
|
|
350
|
-
children: /* @__PURE__ */
|
|
842
|
+
children: /* @__PURE__ */ g("div", {
|
|
351
843
|
ref: p,
|
|
352
844
|
tabIndex: -1,
|
|
353
|
-
className:
|
|
845
|
+
className: st.modal,
|
|
354
846
|
role: "dialog",
|
|
355
847
|
"aria-modal": "true",
|
|
356
848
|
"aria-labelledby": m,
|
|
357
|
-
"aria-describedby":
|
|
849
|
+
"aria-describedby": h,
|
|
358
850
|
children: e
|
|
359
851
|
})
|
|
360
852
|
})
|
|
361
853
|
}) });
|
|
362
854
|
};
|
|
363
|
-
|
|
855
|
+
ut.displayName = "ModalOverlay";
|
|
364
856
|
//#endregion
|
|
365
857
|
//#region src/components/Modal/Modal.tsx
|
|
366
|
-
var
|
|
367
|
-
let o =
|
|
858
|
+
var dt = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
|
|
859
|
+
let o = I({
|
|
368
860
|
isOpen: e,
|
|
369
861
|
onClose: n,
|
|
370
862
|
closeOnBackdrop: r,
|
|
371
863
|
closeOnClick: i,
|
|
372
864
|
closeOnEsc: a
|
|
373
865
|
});
|
|
374
|
-
return o.shouldRender ? /* @__PURE__ */
|
|
866
|
+
return o.shouldRender ? /* @__PURE__ */ g(Xe.Provider, {
|
|
375
867
|
value: {
|
|
376
868
|
onClose: o.onClose,
|
|
377
869
|
titleId: o.titleId,
|
|
378
870
|
descriptionId: o.descriptionId
|
|
379
871
|
},
|
|
380
|
-
children: /* @__PURE__ */
|
|
872
|
+
children: /* @__PURE__ */ g(ut, {
|
|
381
873
|
isOpen: o.isOpen,
|
|
382
874
|
onClose: o.onClose,
|
|
383
875
|
closeOnBackdrop: o.closeOnBackdrop,
|
|
384
876
|
closeOnEsc: o.closeOnEsc,
|
|
385
|
-
children: /* @__PURE__ */
|
|
877
|
+
children: /* @__PURE__ */ g(tt, { children: t })
|
|
386
878
|
})
|
|
387
879
|
}) : null;
|
|
388
880
|
};
|
|
389
|
-
|
|
881
|
+
dt.displayName = "Modal";
|
|
390
882
|
//#endregion
|
|
391
883
|
//#region src/components/Modal/index.ts
|
|
392
|
-
var
|
|
393
|
-
Header:
|
|
394
|
-
Body:
|
|
395
|
-
Content:
|
|
396
|
-
Footer:
|
|
397
|
-
}),
|
|
398
|
-
function
|
|
399
|
-
return
|
|
884
|
+
var ft = Object.assign(dt, {
|
|
885
|
+
Header: at,
|
|
886
|
+
Body: $e,
|
|
887
|
+
Content: tt,
|
|
888
|
+
Footer: rt
|
|
889
|
+
}), pt = r(null), mt = pt.Provider;
|
|
890
|
+
function ht() {
|
|
891
|
+
return s(pt);
|
|
400
892
|
}
|
|
401
|
-
var
|
|
893
|
+
var gt = {
|
|
402
894
|
root: "_root_1n02e_1",
|
|
403
895
|
label: "_label_1n02e_9",
|
|
404
896
|
required: "_required_1n02e_21",
|
|
@@ -409,13 +901,13 @@ var G = {
|
|
|
409
901
|
error: "_error_1n02e_51",
|
|
410
902
|
disabled: "_disabled_1n02e_59",
|
|
411
903
|
invalid: "_invalid_1n02e_75"
|
|
412
|
-
},
|
|
413
|
-
let b =
|
|
904
|
+
}, _t = i(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: s, label: c, description: u, error: d, orientation: f = "vertical", children: p, className: m, id: h, ...v }, y) => {
|
|
905
|
+
let b = l(), x = h ?? b, S = c ? `${x}-label` : void 0, C = u ? `${x}-description` : void 0, w = d ? `${x}-error` : void 0, T = [C, w].filter(Boolean).join(" ") || void 0, E = s ?? `${x}-radio`, [D, O] = P({
|
|
414
906
|
value: e,
|
|
415
907
|
defaultValue: t,
|
|
416
908
|
onChange: n
|
|
417
|
-
}),
|
|
418
|
-
return /* @__PURE__ */
|
|
909
|
+
}), k = !!d;
|
|
910
|
+
return /* @__PURE__ */ _("div", {
|
|
419
911
|
...v,
|
|
420
912
|
ref: y,
|
|
421
913
|
id: x,
|
|
@@ -424,165 +916,106 @@ var G = {
|
|
|
424
916
|
"aria-describedby": T,
|
|
425
917
|
"aria-disabled": r || void 0,
|
|
426
918
|
"aria-required": i || void 0,
|
|
427
|
-
"aria-invalid":
|
|
428
|
-
className:
|
|
919
|
+
"aria-invalid": k || void 0,
|
|
920
|
+
className: V(gt.root, k && gt.invalid, r && gt.disabled, m),
|
|
429
921
|
children: [
|
|
430
|
-
|
|
922
|
+
c && /* @__PURE__ */ _("div", {
|
|
431
923
|
id: S,
|
|
432
|
-
className:
|
|
433
|
-
children: [
|
|
434
|
-
className:
|
|
924
|
+
className: gt.label,
|
|
925
|
+
children: [c, i && /* @__PURE__ */ g("span", {
|
|
926
|
+
className: gt.required,
|
|
435
927
|
"aria-hidden": "true",
|
|
436
928
|
children: "*"
|
|
437
929
|
})]
|
|
438
930
|
}),
|
|
439
|
-
u && /* @__PURE__ */
|
|
931
|
+
u && /* @__PURE__ */ g("div", {
|
|
440
932
|
id: C,
|
|
441
|
-
className:
|
|
933
|
+
className: gt.description,
|
|
442
934
|
children: u
|
|
443
935
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ g(mt, {
|
|
445
937
|
value: {
|
|
446
938
|
name: E,
|
|
447
939
|
value: D,
|
|
448
940
|
disabled: r,
|
|
449
941
|
required: i,
|
|
450
|
-
invalid:
|
|
942
|
+
invalid: k,
|
|
451
943
|
size: a,
|
|
452
944
|
color: o,
|
|
453
945
|
describedBy: T,
|
|
454
|
-
onValueChange:
|
|
946
|
+
onValueChange: O
|
|
455
947
|
},
|
|
456
|
-
children: /* @__PURE__ */
|
|
457
|
-
className:
|
|
948
|
+
children: /* @__PURE__ */ g("div", {
|
|
949
|
+
className: V(gt.items, gt[f]),
|
|
458
950
|
children: p
|
|
459
951
|
})
|
|
460
952
|
}),
|
|
461
|
-
d && /* @__PURE__ */
|
|
953
|
+
d && /* @__PURE__ */ g("div", {
|
|
462
954
|
id: w,
|
|
463
|
-
className:
|
|
955
|
+
className: gt.error,
|
|
464
956
|
children: d
|
|
465
957
|
})
|
|
466
958
|
]
|
|
467
959
|
});
|
|
468
960
|
});
|
|
469
|
-
|
|
961
|
+
_t.displayName = "RadioGroup";
|
|
470
962
|
//#endregion
|
|
471
|
-
//#region src/
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
className: z(K.label, x),
|
|
521
|
-
children: [
|
|
522
|
-
/* @__PURE__ */ h("span", {
|
|
523
|
-
className: K.labelText,
|
|
524
|
-
children: n
|
|
525
|
-
}),
|
|
526
|
-
o && /* @__PURE__ */ h("span", {
|
|
527
|
-
className: K.required,
|
|
528
|
-
"aria-hidden": "true",
|
|
529
|
-
children: "*"
|
|
530
|
-
}),
|
|
531
|
-
!o && m && /* @__PURE__ */ h("span", {
|
|
532
|
-
className: K.optional,
|
|
533
|
-
children: m
|
|
534
|
-
}),
|
|
535
|
-
p && /* @__PURE__ */ h("span", {
|
|
536
|
-
className: K.labelInfo,
|
|
537
|
-
children: p
|
|
538
|
-
})
|
|
539
|
-
]
|
|
540
|
-
}),
|
|
541
|
-
r && /* @__PURE__ */ h("div", {
|
|
542
|
-
id: O,
|
|
543
|
-
className: z(K.description, S),
|
|
544
|
-
children: r
|
|
545
|
-
}),
|
|
546
|
-
/* @__PURE__ */ h(Fe.Provider, {
|
|
547
|
-
value: N,
|
|
548
|
-
children: /* @__PURE__ */ h("div", {
|
|
549
|
-
className: z(K.control, b),
|
|
550
|
-
children: F
|
|
551
|
-
})
|
|
552
|
-
}),
|
|
553
|
-
a && /* @__PURE__ */ h("div", {
|
|
554
|
-
id: k,
|
|
555
|
-
className: z(K.errorText, C),
|
|
556
|
-
role: "alert",
|
|
557
|
-
children: a
|
|
558
|
-
})
|
|
559
|
-
]
|
|
560
|
-
});
|
|
561
|
-
}, q = {
|
|
562
|
-
option: "_option_8aali_1",
|
|
563
|
-
selected: "_selected_8aali_18",
|
|
564
|
-
disabled: "_disabled_8aali_18",
|
|
565
|
-
active: "_active_8aali_37",
|
|
566
|
-
label: "_label_8aali_51",
|
|
567
|
-
content: "_content_8aali_60",
|
|
568
|
-
custom: "_custom_8aali_61",
|
|
569
|
-
description: "_description_8aali_66",
|
|
570
|
-
icon: "_icon_8aali_77",
|
|
571
|
-
badge: "_badge_8aali_87",
|
|
572
|
-
shortcut: "_shortcut_8aali_88",
|
|
573
|
-
success: "_success_8aali_108",
|
|
574
|
-
warning: "_warning_8aali_112",
|
|
575
|
-
danger: "_danger_8aali_116",
|
|
576
|
-
check: "_check_8aali_120",
|
|
577
|
-
checkPop: "_checkPop_8aali_1"
|
|
578
|
-
}, ze = ({ option: e, isSelected: t, isActive: n, optionId: r, renderOption: i, onSelect: a, onMouseEnter: o }) => {
|
|
963
|
+
//#region src/components/Select/internal/SelectContext.tsx
|
|
964
|
+
var vt = r(null), yt = vt.Provider;
|
|
965
|
+
function bt() {
|
|
966
|
+
let e = s(vt);
|
|
967
|
+
if (!e) throw Error("Select compound components must be used inside <Select>");
|
|
968
|
+
return e;
|
|
969
|
+
}
|
|
970
|
+
vt.displayName = "SelectContext";
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region src/components/Select/internal/useSelectVirtualization.ts
|
|
973
|
+
function xt({ loading: e, options: t, scrollTop: n, virtual: r }) {
|
|
974
|
+
return u(() => {
|
|
975
|
+
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;
|
|
976
|
+
return {
|
|
977
|
+
bottomSpacerHeight: o ? Math.max(0, (t.length - s - l.length) * a) : 0,
|
|
978
|
+
isVirtual: o,
|
|
979
|
+
itemHeight: a,
|
|
980
|
+
startIndex: s,
|
|
981
|
+
topSpacerHeight: u,
|
|
982
|
+
viewportHeight: 300,
|
|
983
|
+
visibleOptions: l
|
|
984
|
+
};
|
|
985
|
+
}, [
|
|
986
|
+
e,
|
|
987
|
+
t,
|
|
988
|
+
n,
|
|
989
|
+
r
|
|
990
|
+
]);
|
|
991
|
+
}
|
|
992
|
+
var q = {
|
|
993
|
+
option: "_option_1jnhn_1",
|
|
994
|
+
selected: "_selected_1jnhn_19",
|
|
995
|
+
disabled: "_disabled_1jnhn_19",
|
|
996
|
+
description: "_description_1jnhn_38",
|
|
997
|
+
icon: "_icon_1jnhn_42",
|
|
998
|
+
active: "_active_1jnhn_46",
|
|
999
|
+
label: "_label_1jnhn_89",
|
|
1000
|
+
content: "_content_1jnhn_98",
|
|
1001
|
+
custom: "_custom_1jnhn_99",
|
|
1002
|
+
badge: "_badge_1jnhn_133",
|
|
1003
|
+
shortcut: "_shortcut_1jnhn_134",
|
|
1004
|
+
success: "_success_1jnhn_154",
|
|
1005
|
+
warning: "_warning_1jnhn_218",
|
|
1006
|
+
danger: "_danger_1jnhn_282",
|
|
1007
|
+
check: "_check_1jnhn_346",
|
|
1008
|
+
checkPop: "_checkPop_1jnhn_1"
|
|
1009
|
+
}, St = () => null;
|
|
1010
|
+
St.__velliraSelectPart = "item", St.displayName = "Select.Item";
|
|
1011
|
+
var Ct = ({ option: e, isSelected: t, isActive: n, optionId: r, renderOption: i, onSelect: a, onMouseEnter: o }) => {
|
|
579
1012
|
let s = !!e.disabled;
|
|
580
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ _("li", {
|
|
581
1014
|
id: r,
|
|
582
1015
|
role: "option",
|
|
583
1016
|
"aria-selected": t,
|
|
584
1017
|
"aria-disabled": s || void 0,
|
|
585
|
-
className:
|
|
1018
|
+
className: V(q.option, {
|
|
586
1019
|
[q.selected]: t,
|
|
587
1020
|
[q.active]: n,
|
|
588
1021
|
[q.disabled]: s,
|
|
@@ -596,397 +1029,445 @@ var Fe = n(null), Ie = () => o(Fe), K = {
|
|
|
596
1029
|
onMouseEnter: () => {
|
|
597
1030
|
s || o();
|
|
598
1031
|
},
|
|
599
|
-
children: [i ? /* @__PURE__ */
|
|
1032
|
+
children: [i ? /* @__PURE__ */ g("span", {
|
|
600
1033
|
className: q.custom,
|
|
601
1034
|
children: i(e)
|
|
602
|
-
}) : /* @__PURE__ */
|
|
603
|
-
e.icon && /* @__PURE__ */
|
|
1035
|
+
}) : /* @__PURE__ */ _(h, { children: [
|
|
1036
|
+
e.icon && /* @__PURE__ */ g("span", {
|
|
604
1037
|
className: q.icon,
|
|
605
1038
|
children: e.icon
|
|
606
1039
|
}),
|
|
607
|
-
/* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ _("span", {
|
|
608
1041
|
className: q.content,
|
|
609
|
-
children: [/* @__PURE__ */
|
|
1042
|
+
children: [/* @__PURE__ */ g("span", {
|
|
610
1043
|
className: q.label,
|
|
611
1044
|
children: e.label
|
|
612
|
-
}), e.description && /* @__PURE__ */
|
|
1045
|
+
}), e.description && /* @__PURE__ */ g("span", {
|
|
613
1046
|
className: q.description,
|
|
614
1047
|
children: e.description
|
|
615
1048
|
})]
|
|
616
1049
|
}),
|
|
617
|
-
e.badge && /* @__PURE__ */
|
|
1050
|
+
e.badge && /* @__PURE__ */ g("span", {
|
|
618
1051
|
className: q.badge,
|
|
619
1052
|
children: e.badge
|
|
620
1053
|
}),
|
|
621
|
-
e.shortcut && /* @__PURE__ */
|
|
1054
|
+
e.shortcut && /* @__PURE__ */ g("kbd", {
|
|
622
1055
|
className: q.shortcut,
|
|
623
1056
|
children: e.shortcut
|
|
624
1057
|
})
|
|
625
|
-
] }), /* @__PURE__ */
|
|
1058
|
+
] }), /* @__PURE__ */ g("span", {
|
|
626
1059
|
className: q.check,
|
|
627
1060
|
"aria-hidden": "true",
|
|
628
|
-
children: t && /* @__PURE__ */
|
|
1061
|
+
children: t && /* @__PURE__ */ g(v, {})
|
|
629
1062
|
})]
|
|
630
1063
|
});
|
|
631
1064
|
};
|
|
632
|
-
|
|
1065
|
+
Ct.displayName = "SelectItemRow";
|
|
633
1066
|
var J = {
|
|
634
|
-
dropdown: "
|
|
635
|
-
dropdownIn: "
|
|
636
|
-
primary: "
|
|
637
|
-
outline: "
|
|
638
|
-
filled: "
|
|
639
|
-
soft: "
|
|
640
|
-
neutral: "
|
|
641
|
-
success: "
|
|
642
|
-
warning: "
|
|
643
|
-
danger: "
|
|
644
|
-
listReveal: "
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
1067
|
+
dropdown: "_dropdown_13hyp_1",
|
|
1068
|
+
dropdownIn: "_dropdownIn_13hyp_1",
|
|
1069
|
+
primary: "_primary_13hyp_103",
|
|
1070
|
+
outline: "_outline_13hyp_103",
|
|
1071
|
+
filled: "_filled_13hyp_190",
|
|
1072
|
+
soft: "_soft_13hyp_277",
|
|
1073
|
+
neutral: "_neutral_13hyp_364",
|
|
1074
|
+
success: "_success_13hyp_625",
|
|
1075
|
+
warning: "_warning_13hyp_886",
|
|
1076
|
+
danger: "_danger_13hyp_1147",
|
|
1077
|
+
listReveal: "_listReveal_13hyp_1",
|
|
1078
|
+
groupAction: "_groupAction_13hyp_1415",
|
|
1079
|
+
groupActionText: "_groupActionText_13hyp_1447",
|
|
1080
|
+
groupActionMeta: "_groupActionMeta_13hyp_1455",
|
|
1081
|
+
command: "_command_13hyp_1461",
|
|
1082
|
+
searchWrap: "_searchWrap_13hyp_1466",
|
|
1083
|
+
searchReveal: "_searchReveal_13hyp_1",
|
|
1084
|
+
search: "_search_13hyp_1466",
|
|
1085
|
+
searchClear: "_searchClear_13hyp_1495",
|
|
1086
|
+
empty: "_empty_13hyp_1531",
|
|
1087
|
+
groupLabel: "_groupLabel_13hyp_1539",
|
|
1088
|
+
separator: "_separator_13hyp_1549",
|
|
1089
|
+
virtualSpacer: "_virtualSpacer_13hyp_1555",
|
|
1090
|
+
mobileDropdownIn: "_mobileDropdownIn_13hyp_1"
|
|
1091
|
+
}, wt = ({ children: e, className: t }) => {
|
|
1092
|
+
let { contentProps: n } = bt(), r = Et(e);
|
|
1093
|
+
return /* @__PURE__ */ g(Tt, {
|
|
1094
|
+
...n,
|
|
1095
|
+
...r,
|
|
1096
|
+
className: [n.className, t].filter(Boolean).join(" ")
|
|
1097
|
+
});
|
|
1098
|
+
};
|
|
1099
|
+
wt.__velliraSelectPart = "content", wt.displayName = "Select.Content";
|
|
1100
|
+
var Tt = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, entries: s, multiple: l, selectedValues: u, color: p = "primary", variant: m = "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: ee, onSearchChange: z }) => {
|
|
1101
|
+
let B = d(null), te = d(!1), [ne, re] = f(null), [ie, ae] = f(0), { bottomSpacerHeight: V, isVirtual: U, itemHeight: oe, startIndex: se, topSpacerHeight: ce, viewportHeight: le, visibleOptions: ue } = xt({
|
|
1102
|
+
loading: T,
|
|
1103
|
+
options: a,
|
|
1104
|
+
scrollTop: ie,
|
|
1105
|
+
virtual: b
|
|
1106
|
+
}), de = o((e) => {
|
|
1107
|
+
re(e), r(e);
|
|
658
1108
|
}, [r]);
|
|
659
|
-
if (
|
|
660
|
-
e || (
|
|
661
|
-
}, [e,
|
|
662
|
-
if (!e ||
|
|
663
|
-
let
|
|
1109
|
+
if (c(() => {
|
|
1110
|
+
e || (te.current = !1, ae(0));
|
|
1111
|
+
}, [e, C]), c(() => {
|
|
1112
|
+
if (!e || !v) return;
|
|
1113
|
+
let t = window.setTimeout(() => {
|
|
1114
|
+
B.current?.focus({ preventScroll: !0 });
|
|
1115
|
+
}, 0);
|
|
1116
|
+
return () => window.clearTimeout(t);
|
|
1117
|
+
}, [e, v]), c(() => {
|
|
1118
|
+
if (!e || T || !ne || te.current) return;
|
|
1119
|
+
let n = a.findIndex((e) => u ? u.includes(e.value) : e.value === N), r = n >= 0 ? n : P;
|
|
664
1120
|
if (r < 0) {
|
|
665
|
-
|
|
1121
|
+
te.current = !0;
|
|
666
1122
|
return;
|
|
667
1123
|
}
|
|
668
|
-
if (
|
|
669
|
-
let e = Math.max(0, r * oe - (
|
|
670
|
-
|
|
1124
|
+
if (te.current = !0, U) {
|
|
1125
|
+
let e = Math.max(0, r * oe - (le - oe) / 2);
|
|
1126
|
+
ae(e), ne.scrollTop = e;
|
|
671
1127
|
return;
|
|
672
1128
|
}
|
|
673
1129
|
document.getElementById(`${t}-option-${r}`)?.scrollIntoView?.({ block: "nearest" });
|
|
674
1130
|
}, [
|
|
675
|
-
|
|
676
|
-
|
|
1131
|
+
P,
|
|
1132
|
+
ne,
|
|
677
1133
|
e,
|
|
678
|
-
|
|
1134
|
+
U,
|
|
679
1135
|
oe,
|
|
680
1136
|
t,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
1137
|
+
T,
|
|
1138
|
+
a,
|
|
1139
|
+
N,
|
|
1140
|
+
u
|
|
685
1141
|
]), !e) return null;
|
|
686
|
-
let
|
|
1142
|
+
let fe = s && !U ? s : ue.map((e, t) => ({
|
|
687
1143
|
type: "option",
|
|
688
1144
|
option: e,
|
|
689
|
-
optionIndex:
|
|
690
|
-
})),
|
|
691
|
-
ref:
|
|
1145
|
+
optionIndex: se + t
|
|
1146
|
+
})), pe = /* @__PURE__ */ _("div", {
|
|
1147
|
+
ref: de,
|
|
692
1148
|
tabIndex: 0,
|
|
693
1149
|
className: [
|
|
694
1150
|
J.dropdown,
|
|
695
1151
|
J[p],
|
|
696
|
-
J[
|
|
1152
|
+
J[m],
|
|
697
1153
|
y ? J.command : void 0,
|
|
698
|
-
|
|
1154
|
+
I
|
|
699
1155
|
].filter(Boolean).join(" "),
|
|
700
1156
|
style: i,
|
|
701
1157
|
onScroll: (e) => {
|
|
702
|
-
|
|
1158
|
+
U && ae(e.currentTarget.scrollTop);
|
|
703
1159
|
},
|
|
704
1160
|
children: [
|
|
705
|
-
|
|
706
|
-
|
|
1161
|
+
k,
|
|
1162
|
+
O ?? (v && /* @__PURE__ */ _("div", {
|
|
707
1163
|
className: J.searchWrap,
|
|
708
|
-
children: [/* @__PURE__ */
|
|
709
|
-
ref:
|
|
1164
|
+
children: [/* @__PURE__ */ g("input", {
|
|
1165
|
+
ref: B,
|
|
710
1166
|
className: J.search,
|
|
711
|
-
value:
|
|
712
|
-
placeholder: y ? "Type a command..." :
|
|
1167
|
+
value: C,
|
|
1168
|
+
placeholder: y ? "Type a command..." : w,
|
|
713
1169
|
"aria-label": "Search options",
|
|
714
|
-
onInput: (e) =>
|
|
715
|
-
onChange: (e) =>
|
|
716
|
-
}),
|
|
1170
|
+
onInput: (e) => z?.(e.currentTarget.value),
|
|
1171
|
+
onChange: (e) => z?.(e.target.value)
|
|
1172
|
+
}), C && /* @__PURE__ */ g("button", {
|
|
717
1173
|
type: "button",
|
|
718
1174
|
className: J.searchClear,
|
|
719
1175
|
"aria-label": "Clear search",
|
|
720
1176
|
onClick: () => {
|
|
721
|
-
|
|
1177
|
+
z?.(""), B.current?.focus();
|
|
722
1178
|
},
|
|
723
|
-
children: /* @__PURE__ */
|
|
1179
|
+
children: /* @__PURE__ */ g(x, {})
|
|
724
1180
|
})]
|
|
725
1181
|
})),
|
|
726
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ g("ul", {
|
|
727
1183
|
id: t,
|
|
728
1184
|
role: "listbox",
|
|
729
1185
|
"aria-multiselectable": l || void 0,
|
|
730
1186
|
"aria-labelledby": n,
|
|
731
|
-
|
|
732
|
-
children: w ? /* @__PURE__ */ h("li", {
|
|
1187
|
+
children: T ? /* @__PURE__ */ g("li", {
|
|
733
1188
|
role: "option",
|
|
734
1189
|
"aria-disabled": "true",
|
|
735
1190
|
"aria-selected": "false",
|
|
736
1191
|
className: J.empty,
|
|
737
|
-
children:
|
|
738
|
-
}) :
|
|
739
|
-
|
|
1192
|
+
children: j ?? E
|
|
1193
|
+
}) : a.length ? /* @__PURE__ */ _(h, { children: [
|
|
1194
|
+
U && /* @__PURE__ */ g("li", {
|
|
740
1195
|
"aria-hidden": "true",
|
|
741
1196
|
className: J.virtualSpacer,
|
|
742
|
-
style: { height:
|
|
1197
|
+
style: { height: ce }
|
|
743
1198
|
}),
|
|
744
|
-
|
|
745
|
-
if (e.type === "group")
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
1199
|
+
fe.map((e) => {
|
|
1200
|
+
if (e.type === "group") {
|
|
1201
|
+
if (e.selectable && l) {
|
|
1202
|
+
let t = e.itemValues.filter((e) => a.some((t) => t.value === e && !t.disabled)), n = u ? t.filter((e) => u.includes(e)).length : 0, r = t.length > 0 && n === t.length, i = n > 0 && n < t.length;
|
|
1203
|
+
return /* @__PURE__ */ g("li", {
|
|
1204
|
+
role: "presentation",
|
|
1205
|
+
children: /* @__PURE__ */ _("button", {
|
|
1206
|
+
type: "button",
|
|
1207
|
+
className: J.groupAction,
|
|
1208
|
+
"aria-label": Dt(e.selectLabel ?? e.label),
|
|
1209
|
+
"aria-pressed": i ? "mixed" : r ? "true" : "false",
|
|
1210
|
+
disabled: t.length === 0,
|
|
1211
|
+
onClick: () => R(t),
|
|
1212
|
+
children: [/* @__PURE__ */ g("span", {
|
|
1213
|
+
className: J.groupActionText,
|
|
1214
|
+
children: e.selectLabel ?? e.label
|
|
1215
|
+
}), /* @__PURE__ */ _("span", {
|
|
1216
|
+
className: J.groupActionMeta,
|
|
1217
|
+
children: [
|
|
1218
|
+
n,
|
|
1219
|
+
"/",
|
|
1220
|
+
t.length
|
|
1221
|
+
]
|
|
1222
|
+
})]
|
|
1223
|
+
})
|
|
1224
|
+
}, e.id);
|
|
1225
|
+
}
|
|
1226
|
+
return /* @__PURE__ */ g("li", {
|
|
1227
|
+
role: "presentation",
|
|
1228
|
+
className: J.groupLabel,
|
|
1229
|
+
children: e.label
|
|
1230
|
+
}, e.id);
|
|
1231
|
+
}
|
|
1232
|
+
if (e.type === "separator") return /* @__PURE__ */ g("li", {
|
|
751
1233
|
role: "presentation",
|
|
752
1234
|
"aria-hidden": "true",
|
|
753
1235
|
className: J.separator,
|
|
754
1236
|
"data-vellira-select-separator": "true"
|
|
755
1237
|
}, e.id);
|
|
756
1238
|
let { option: n, optionIndex: r } = e;
|
|
757
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ g(Ct, {
|
|
758
1240
|
option: n,
|
|
759
|
-
isSelected:
|
|
760
|
-
isActive: r ===
|
|
1241
|
+
isSelected: u ? u.includes(n.value) : n.value === N,
|
|
1242
|
+
isActive: r === F,
|
|
761
1243
|
optionId: `${t}-option-${r}`,
|
|
762
|
-
renderOption:
|
|
763
|
-
onSelect:
|
|
764
|
-
onMouseEnter: () =>
|
|
1244
|
+
renderOption: M,
|
|
1245
|
+
onSelect: L,
|
|
1246
|
+
onMouseEnter: () => ee(r)
|
|
765
1247
|
}, n.value);
|
|
766
1248
|
}),
|
|
767
|
-
|
|
1249
|
+
U && /* @__PURE__ */ g("li", {
|
|
768
1250
|
"aria-hidden": "true",
|
|
769
1251
|
className: J.virtualSpacer,
|
|
770
|
-
style: { height:
|
|
1252
|
+
style: { height: V }
|
|
771
1253
|
})
|
|
772
|
-
] }) : /* @__PURE__ */
|
|
1254
|
+
] }) : /* @__PURE__ */ g("li", {
|
|
773
1255
|
role: "option",
|
|
774
1256
|
"aria-disabled": "true",
|
|
775
1257
|
"aria-selected": "false",
|
|
776
1258
|
className: J.empty,
|
|
777
|
-
children:
|
|
1259
|
+
children: A ?? D
|
|
778
1260
|
})
|
|
779
1261
|
})
|
|
780
1262
|
]
|
|
781
1263
|
});
|
|
782
|
-
return
|
|
1264
|
+
return S ? /* @__PURE__ */ g(H, { children: pe }) : pe;
|
|
783
1265
|
};
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
valueWrap: "_valueWrap_1m1fn_696",
|
|
801
|
-
value: "_value_1m1fn_696",
|
|
802
|
-
adornment: "_adornment_1m1fn_710",
|
|
803
|
-
clear: "_clear_1m1fn_711",
|
|
804
|
-
affix: "_affix_1m1fn_712",
|
|
805
|
-
placeholder: "_placeholder_1m1fn_748",
|
|
806
|
-
error: "_error_1m1fn_752",
|
|
807
|
-
spinner: "_spinner_1m1fn_787",
|
|
808
|
-
spin: "_spin_1m1fn_787",
|
|
809
|
-
loading: "_loading_1m1fn_796",
|
|
810
|
-
open: "_open_1m1fn_808"
|
|
811
|
-
}, Ve = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabled: a, required: o, listboxId: s, activeIndex: c, ariaLabel: l, error: u, displayText: d, isPlaceholder: f, size: p = "md", color: _, variant: v, loading: y, startIcon: b, endIcon: x, prefix: S, suffix: C, clearable: w, onClear: T, className: E, buttonRef: D, onClick: O, onKeyDown: k, onBlur: A, onFocus: j }) => /* @__PURE__ */ h("button", {
|
|
812
|
-
id: t,
|
|
813
|
-
ref: D,
|
|
814
|
-
type: "button",
|
|
815
|
-
role: "combobox",
|
|
816
|
-
disabled: a,
|
|
817
|
-
"aria-disabled": a || void 0,
|
|
818
|
-
"aria-required": o || void 0,
|
|
819
|
-
"aria-expanded": i,
|
|
820
|
-
"aria-haspopup": "listbox",
|
|
821
|
-
"aria-label": l,
|
|
822
|
-
"aria-labelledby": r,
|
|
823
|
-
"aria-invalid": u || void 0,
|
|
824
|
-
"aria-controls": i ? s : void 0,
|
|
825
|
-
"aria-describedby": n,
|
|
826
|
-
"aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
|
|
827
|
-
className: z(Y.control, Y[p], Y[v], Y[_], {
|
|
828
|
-
[Y.error]: !!u,
|
|
829
|
-
[Y.disabled]: a,
|
|
830
|
-
[Y.loading]: y
|
|
831
|
-
}, E),
|
|
832
|
-
onClick: O,
|
|
833
|
-
onKeyDown: k,
|
|
834
|
-
onBlur: A,
|
|
835
|
-
onFocus: j,
|
|
836
|
-
children: e ?? /* @__PURE__ */ g(m, { children: [
|
|
837
|
-
b && /* @__PURE__ */ h("span", {
|
|
838
|
-
className: Y.adornment,
|
|
839
|
-
children: b
|
|
840
|
-
}),
|
|
841
|
-
S && /* @__PURE__ */ h("span", {
|
|
842
|
-
className: Y.affix,
|
|
843
|
-
children: S
|
|
844
|
-
}),
|
|
845
|
-
/* @__PURE__ */ h("span", {
|
|
846
|
-
className: Y.valueWrap,
|
|
847
|
-
children: /* @__PURE__ */ h("span", {
|
|
848
|
-
className: z(Y.value, { [Y.placeholder]: f }),
|
|
849
|
-
children: d
|
|
850
|
-
})
|
|
851
|
-
}),
|
|
852
|
-
C && /* @__PURE__ */ h("span", {
|
|
853
|
-
className: Y.affix,
|
|
854
|
-
children: C
|
|
855
|
-
}),
|
|
856
|
-
w && /* @__PURE__ */ h("span", {
|
|
857
|
-
role: "button",
|
|
858
|
-
"aria-label": "Clear selection",
|
|
859
|
-
tabIndex: -1,
|
|
860
|
-
className: Y.clear,
|
|
861
|
-
onClick: (e) => {
|
|
862
|
-
e.stopPropagation(), T?.();
|
|
863
|
-
},
|
|
864
|
-
children: /* @__PURE__ */ h(I, {})
|
|
865
|
-
}),
|
|
866
|
-
/* @__PURE__ */ h("span", {
|
|
867
|
-
className: z(Y.arrow, { [Y.open]: i }),
|
|
868
|
-
"aria-hidden": "true",
|
|
869
|
-
children: y ? /* @__PURE__ */ h("span", { className: Y.spinner }) : x ?? /* @__PURE__ */ h(F, {})
|
|
870
|
-
})
|
|
871
|
-
] })
|
|
872
|
-
});
|
|
873
|
-
Ve.displayName = "SelectTrigger";
|
|
874
|
-
//#endregion
|
|
875
|
-
//#region src/components/Select/SelectContext.tsx
|
|
876
|
-
var He = n(null), Ue = He.Provider;
|
|
877
|
-
function We() {
|
|
878
|
-
let e = o(He);
|
|
879
|
-
if (!e) throw Error("Select compound components must be used inside Select");
|
|
880
|
-
return e;
|
|
1266
|
+
Tt.displayName = "SelectContentSurface";
|
|
1267
|
+
function Et(t) {
|
|
1268
|
+
let n, r, i, o;
|
|
1269
|
+
return e.forEach(t, (e) => {
|
|
1270
|
+
if (!a(e)) return;
|
|
1271
|
+
let t = e.type;
|
|
1272
|
+
t.__velliraSelectPart === "label" && (n = e), t.__velliraSelectPart === "search" && (r = e), t.__velliraSelectPart === "empty" && (i = e), t.__velliraSelectPart === "loading" && (o = e);
|
|
1273
|
+
}), {
|
|
1274
|
+
emptySlot: i,
|
|
1275
|
+
headerSlot: n,
|
|
1276
|
+
loadingSlot: o,
|
|
1277
|
+
searchSlot: r
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
function Dt(e) {
|
|
1281
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : "Select group";
|
|
881
1282
|
}
|
|
882
|
-
He.displayName = "SelectContext";
|
|
883
1283
|
//#endregion
|
|
884
|
-
//#region src/components/Select/
|
|
885
|
-
var
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
}
|
|
902
|
-
Ke.__velliraSelectPart = "content", Ke.displayName = "Select.Content";
|
|
903
|
-
var qe = ({ children: e, className: t }) => {
|
|
904
|
-
let { triggerProps: n } = We();
|
|
905
|
-
return /* @__PURE__ */ h("span", {
|
|
906
|
-
className: z(Y.valueWrap, t),
|
|
907
|
-
children: /* @__PURE__ */ h("span", {
|
|
908
|
-
className: z(Y.value, { [Y.placeholder]: n.isPlaceholder }),
|
|
909
|
-
children: e ?? n.displayText
|
|
910
|
-
})
|
|
911
|
-
});
|
|
912
|
-
};
|
|
913
|
-
qe.__velliraSelectPart = "value", qe.displayName = "Select.Value";
|
|
914
|
-
var Je = ({ children: e, className: t }) => {
|
|
915
|
-
let { triggerProps: n } = We();
|
|
916
|
-
return /* @__PURE__ */ h("span", {
|
|
917
|
-
className: z(Y.arrow, { [Y.open]: n.isOpen }, t),
|
|
918
|
-
"aria-hidden": "true",
|
|
919
|
-
children: n.loading ? /* @__PURE__ */ h("span", { className: Y.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ h(F, {})
|
|
920
|
-
});
|
|
921
|
-
};
|
|
922
|
-
Je.__velliraSelectPart = "icon", Je.displayName = "Select.Icon";
|
|
923
|
-
var Ye = ({ placeholder: e, className: t }) => {
|
|
924
|
-
let { dropdownProps: n } = We(), r = u(null), i = n.searchValue ?? "";
|
|
925
|
-
return /* @__PURE__ */ g("div", {
|
|
1284
|
+
//#region src/components/Select/Content/SelectEmpty.tsx
|
|
1285
|
+
var Ot = ({ children: e }) => /* @__PURE__ */ g(h, { children: e });
|
|
1286
|
+
Ot.__velliraSelectPart = "empty", Ot.displayName = "Select.Empty";
|
|
1287
|
+
//#endregion
|
|
1288
|
+
//#region src/components/Select/Content/SelectLoading.tsx
|
|
1289
|
+
var kt = ({ children: e }) => /* @__PURE__ */ g(h, { children: e });
|
|
1290
|
+
kt.__velliraSelectPart = "loading", kt.displayName = "Select.Loading";
|
|
1291
|
+
//#endregion
|
|
1292
|
+
//#region src/components/Select/Content/SelectSearch.tsx
|
|
1293
|
+
var At = ({ placeholder: e, className: t }) => {
|
|
1294
|
+
let { contentProps: n } = bt(), r = d(null), i = n.searchValue ?? "";
|
|
1295
|
+
return c(() => {
|
|
1296
|
+
if (!n.isOpen) return;
|
|
1297
|
+
let e = window.setTimeout(() => {
|
|
1298
|
+
r.current?.focus({ preventScroll: !0 });
|
|
1299
|
+
}, 0);
|
|
1300
|
+
return () => window.clearTimeout(e);
|
|
1301
|
+
}, [n.isOpen]), /* @__PURE__ */ _("div", {
|
|
926
1302
|
className: J.searchWrap,
|
|
927
|
-
children: [/* @__PURE__ */
|
|
1303
|
+
children: [/* @__PURE__ */ g("input", {
|
|
928
1304
|
ref: r,
|
|
929
|
-
className:
|
|
1305
|
+
className: V(J.search, t),
|
|
930
1306
|
value: i,
|
|
931
1307
|
placeholder: e ?? (n.command ? "Type a command..." : "Search..."),
|
|
932
1308
|
"aria-label": "Search options",
|
|
933
1309
|
onInput: (e) => n.onSearchChange?.(e.currentTarget.value),
|
|
934
1310
|
onChange: (e) => n.onSearchChange?.(e.target.value)
|
|
935
|
-
}), i && /* @__PURE__ */
|
|
1311
|
+
}), i && /* @__PURE__ */ g("button", {
|
|
936
1312
|
type: "button",
|
|
937
1313
|
className: J.searchClear,
|
|
938
1314
|
"aria-label": "Clear search",
|
|
939
1315
|
onClick: () => {
|
|
940
1316
|
n.onSearchChange?.(""), r.current?.focus();
|
|
941
1317
|
},
|
|
942
|
-
children: /* @__PURE__ */
|
|
1318
|
+
children: /* @__PURE__ */ g(x, {})
|
|
943
1319
|
})]
|
|
944
1320
|
});
|
|
945
1321
|
};
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
var
|
|
1322
|
+
At.__velliraSelectPart = "search", At.displayName = "Select.Search";
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region src/components/Select/Group/SelectGroup.tsx
|
|
1325
|
+
var jt = () => null;
|
|
1326
|
+
jt.__velliraSelectPart = "group", jt.displayName = "Select.Group";
|
|
1327
|
+
//#endregion
|
|
1328
|
+
//#region src/components/Select/Group/SelectLabel.tsx
|
|
1329
|
+
var Mt = ({ children: e }) => /* @__PURE__ */ g("div", {
|
|
950
1330
|
role: "presentation",
|
|
951
1331
|
className: J.groupLabel,
|
|
952
1332
|
children: e
|
|
953
1333
|
});
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
var
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
var
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
var
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1334
|
+
Mt.__velliraSelectPart = "label", Mt.displayName = "Select.Label";
|
|
1335
|
+
//#endregion
|
|
1336
|
+
//#region src/components/Select/Group/SelectSeparator.tsx
|
|
1337
|
+
var Nt = () => null;
|
|
1338
|
+
Nt.__velliraSelectPart = "separator", Nt.displayName = "Select.Separator";
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region src/components/Select/Item/SelectItemBadge.tsx
|
|
1341
|
+
var Pt = () => null;
|
|
1342
|
+
Pt.__velliraSelectPart = "itemBadge", Pt.displayName = "Select.ItemBadge";
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region src/components/Select/Item/SelectItemDescription.tsx
|
|
1345
|
+
var Ft = () => null;
|
|
1346
|
+
Ft.__velliraSelectPart = "itemDescription", Ft.displayName = "Select.ItemDescription";
|
|
1347
|
+
//#endregion
|
|
1348
|
+
//#region src/components/Select/Item/SelectItemIcon.tsx
|
|
1349
|
+
var It = () => null;
|
|
1350
|
+
It.__velliraSelectPart = "itemIcon", It.displayName = "Select.ItemIcon";
|
|
1351
|
+
//#endregion
|
|
1352
|
+
//#region src/patterns/FormField/FormFieldContext.ts
|
|
1353
|
+
var Lt = r(null), Rt = () => s(Lt), zt = {
|
|
1354
|
+
wrapper: "_wrapper_143kr_1",
|
|
1355
|
+
sm: "_sm_143kr_41",
|
|
1356
|
+
md: "_md_143kr_78",
|
|
1357
|
+
lg: "_lg_143kr_115",
|
|
1358
|
+
horizontal: "_horizontal_143kr_152",
|
|
1359
|
+
start: "_start_143kr_153",
|
|
1360
|
+
description: "_description_143kr_160",
|
|
1361
|
+
control: "_control_143kr_161",
|
|
1362
|
+
errorText: "_errorText_143kr_162",
|
|
1363
|
+
label: "_label_143kr_169",
|
|
1364
|
+
labelText: "_labelText_143kr_186",
|
|
1365
|
+
required: "_required_143kr_190",
|
|
1366
|
+
optional: "_optional_143kr_194",
|
|
1367
|
+
labelInfo: "_labelInfo_143kr_201",
|
|
1368
|
+
disabled: "_disabled_143kr_243"
|
|
1369
|
+
}, Bt = (...e) => e.filter(Boolean).join(" ") || void 0, Vt = ({ id: e, label: t, description: r, error: i, required: o = !1, disabled: s = !1, invalid: c = !1, orientation: u = "vertical", labelPosition: d = "top", size: f = "md", labelInfo: p, optionalText: m, children: h, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
|
|
1370
|
+
let T = l(), E = e ?? T, D = t ? `${E}-label` : void 0, O = r && E ? `${E}-description` : void 0, k = i && E ? `${E}-error` : void 0, A = c || !!i, j = Bt(D), M = Bt(O, k), N = {
|
|
1371
|
+
controlId: E,
|
|
1372
|
+
labelId: D,
|
|
1373
|
+
descriptionId: O,
|
|
1374
|
+
errorId: k,
|
|
1375
|
+
required: o,
|
|
1376
|
+
disabled: s,
|
|
1377
|
+
invalid: A,
|
|
1378
|
+
size: f,
|
|
1379
|
+
ariaLabelledBy: j,
|
|
1380
|
+
ariaDescribedBy: M
|
|
1381
|
+
}, P = a(h) ? h : void 0, F = v && P ? n(P, {
|
|
1382
|
+
id: P.props.id ?? E,
|
|
1383
|
+
required: P.props.required ?? o,
|
|
1384
|
+
disabled: P.props.disabled ?? s,
|
|
1385
|
+
"aria-invalid": P.props["aria-invalid"] ?? (A || void 0),
|
|
1386
|
+
"aria-labelledby": Bt(P.props["aria-labelledby"], j),
|
|
1387
|
+
"aria-describedby": Bt(P.props["aria-describedby"], M)
|
|
1388
|
+
}) : h;
|
|
1389
|
+
return /* @__PURE__ */ _("div", {
|
|
1390
|
+
...w,
|
|
1391
|
+
"aria-disabled": s || void 0,
|
|
1392
|
+
className: V(zt.wrapper, zt[u], zt[d], zt[f], s && zt.disabled, y),
|
|
1393
|
+
"data-disabled": s || void 0,
|
|
1394
|
+
"data-invalid": A || void 0,
|
|
1395
|
+
"data-orientation": u,
|
|
1396
|
+
"data-size": f,
|
|
1397
|
+
children: [
|
|
1398
|
+
t && /* @__PURE__ */ _("label", {
|
|
1399
|
+
id: D,
|
|
1400
|
+
htmlFor: E,
|
|
1401
|
+
className: V(zt.label, x),
|
|
1402
|
+
children: [
|
|
1403
|
+
/* @__PURE__ */ g("span", {
|
|
1404
|
+
className: zt.labelText,
|
|
1405
|
+
children: t
|
|
1406
|
+
}),
|
|
1407
|
+
o && /* @__PURE__ */ g("span", {
|
|
1408
|
+
className: zt.required,
|
|
1409
|
+
"aria-hidden": "true",
|
|
1410
|
+
children: "*"
|
|
1411
|
+
}),
|
|
1412
|
+
!o && m && /* @__PURE__ */ g("span", {
|
|
1413
|
+
className: zt.optional,
|
|
1414
|
+
children: m
|
|
1415
|
+
}),
|
|
1416
|
+
p && /* @__PURE__ */ g("span", {
|
|
1417
|
+
className: zt.labelInfo,
|
|
1418
|
+
children: p
|
|
1419
|
+
})
|
|
1420
|
+
]
|
|
1421
|
+
}),
|
|
1422
|
+
r && /* @__PURE__ */ g("div", {
|
|
1423
|
+
id: O,
|
|
1424
|
+
className: V(zt.description, S),
|
|
1425
|
+
children: r
|
|
1426
|
+
}),
|
|
1427
|
+
/* @__PURE__ */ g(Lt.Provider, {
|
|
1428
|
+
value: N,
|
|
1429
|
+
children: /* @__PURE__ */ g("div", {
|
|
1430
|
+
className: V(zt.control, b),
|
|
1431
|
+
children: F
|
|
1432
|
+
})
|
|
1433
|
+
}),
|
|
1434
|
+
i && /* @__PURE__ */ g("div", {
|
|
1435
|
+
id: k,
|
|
1436
|
+
className: V(zt.errorText, C),
|
|
1437
|
+
role: "alert",
|
|
1438
|
+
children: i
|
|
1439
|
+
})
|
|
1440
|
+
]
|
|
1441
|
+
});
|
|
1442
|
+
};
|
|
1443
|
+
//#endregion
|
|
1444
|
+
//#region src/components/Select/internal/SelectCollection.ts
|
|
1445
|
+
function Ht(t) {
|
|
1446
|
+
let n = [], r = [], i = 0;
|
|
969
1447
|
function o(t) {
|
|
970
1448
|
e.forEach(t, (e) => {
|
|
971
|
-
if (!
|
|
1449
|
+
if (!a(e)) return;
|
|
972
1450
|
let t = e.type;
|
|
973
1451
|
if (t.__velliraSelectPart === "group") {
|
|
974
|
-
let t = e.props;
|
|
1452
|
+
let t = e.props, r = Wt(t.children);
|
|
975
1453
|
n.push({
|
|
976
1454
|
type: "group",
|
|
977
|
-
id: `group-${
|
|
978
|
-
label: t.label
|
|
1455
|
+
id: `group-${i++}`,
|
|
1456
|
+
label: t.label,
|
|
1457
|
+
selectable: t.selectable,
|
|
1458
|
+
selectLabel: t.selectLabel,
|
|
1459
|
+
itemValues: r
|
|
979
1460
|
}), o(t.children);
|
|
980
1461
|
return;
|
|
981
1462
|
}
|
|
982
1463
|
if (t.__velliraSelectPart === "item") {
|
|
983
|
-
let t = e.props, i =
|
|
1464
|
+
let t = e.props, i = Gt(t.children, t.value), a = t.label ?? i.label, o = r.length, s = {
|
|
984
1465
|
label: a,
|
|
985
1466
|
value: t.value,
|
|
986
1467
|
disabled: t.disabled,
|
|
987
1468
|
description: t.description ?? i.description,
|
|
988
1469
|
icon: t.icon ?? i.icon,
|
|
989
|
-
badge: t.badge,
|
|
1470
|
+
badge: t.badge ?? i.badge,
|
|
990
1471
|
shortcut: t.shortcut,
|
|
991
1472
|
color: t.color
|
|
992
1473
|
};
|
|
@@ -1000,11 +1481,11 @@ function it(t) {
|
|
|
1000
1481
|
if (t.__velliraSelectPart === "separator") {
|
|
1001
1482
|
n.push({
|
|
1002
1483
|
type: "separator",
|
|
1003
|
-
id: `separator-${
|
|
1484
|
+
id: `separator-${i++}`
|
|
1004
1485
|
});
|
|
1005
1486
|
return;
|
|
1006
1487
|
}
|
|
1007
|
-
t.__velliraSelectPart === "empty" || t.__velliraSelectPart === "icon" || t.__velliraSelectPart === "itemDescription" || t.__velliraSelectPart === "itemIcon" || t.__velliraSelectPart === "label" || t.__velliraSelectPart === "loading" || t.__velliraSelectPart === "search" || t.__velliraSelectPart === "value" || o(e.props.children);
|
|
1488
|
+
t.__velliraSelectPart === "empty" || t.__velliraSelectPart === "icon" || t.__velliraSelectPart === "itemBadge" || t.__velliraSelectPart === "itemDescription" || t.__velliraSelectPart === "itemIcon" || t.__velliraSelectPart === "label" || t.__velliraSelectPart === "loading" || t.__velliraSelectPart === "search" || t.__velliraSelectPart === "value" || o(e.props.children);
|
|
1008
1489
|
});
|
|
1009
1490
|
}
|
|
1010
1491
|
return o(t), {
|
|
@@ -1012,11 +1493,11 @@ function it(t) {
|
|
|
1012
1493
|
options: r
|
|
1013
1494
|
};
|
|
1014
1495
|
}
|
|
1015
|
-
function
|
|
1496
|
+
function Ut(t) {
|
|
1016
1497
|
let n = !1;
|
|
1017
1498
|
function r(t) {
|
|
1018
1499
|
e.forEach(t, (e) => {
|
|
1019
|
-
if (!
|
|
1500
|
+
if (!a(e) || n) return;
|
|
1020
1501
|
let t = e.type;
|
|
1021
1502
|
if (t.__velliraSelectPart === "trigger" || t.__velliraSelectPart === "content") {
|
|
1022
1503
|
n = !0;
|
|
@@ -1027,257 +1508,452 @@ function at(t) {
|
|
|
1027
1508
|
}
|
|
1028
1509
|
return r(t), n;
|
|
1029
1510
|
}
|
|
1030
|
-
function
|
|
1031
|
-
let n
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1511
|
+
function Wt(t) {
|
|
1512
|
+
let n = [];
|
|
1513
|
+
function r(t) {
|
|
1514
|
+
e.forEach(t, (e) => {
|
|
1515
|
+
if (a(e)) {
|
|
1516
|
+
if (e.type.__velliraSelectPart === "item") {
|
|
1517
|
+
n.push(e.props.value);
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
r(e.props.children);
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
return r(t), n;
|
|
1042
1525
|
}
|
|
1043
|
-
function
|
|
1044
|
-
let r,
|
|
1045
|
-
function
|
|
1526
|
+
function Gt(t, n) {
|
|
1527
|
+
let r, i, o, s = [];
|
|
1528
|
+
function c(t) {
|
|
1046
1529
|
e.forEach(t, (e) => {
|
|
1047
1530
|
if (typeof e == "string" || typeof e == "number") {
|
|
1048
|
-
|
|
1531
|
+
s.push(String(e));
|
|
1049
1532
|
return;
|
|
1050
1533
|
}
|
|
1051
|
-
if (!
|
|
1534
|
+
if (!a(e)) return;
|
|
1052
1535
|
let t = e.type;
|
|
1053
|
-
if (t.__velliraSelectPart === "
|
|
1536
|
+
if (t.__velliraSelectPart === "itemBadge") {
|
|
1054
1537
|
r = e.props.children;
|
|
1055
1538
|
return;
|
|
1056
1539
|
}
|
|
1540
|
+
if (t.__velliraSelectPart === "itemIcon") {
|
|
1541
|
+
o = e.props.children;
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1057
1544
|
if (t.__velliraSelectPart === "itemDescription") {
|
|
1058
|
-
|
|
1545
|
+
i = e.props.children;
|
|
1059
1546
|
return;
|
|
1060
1547
|
}
|
|
1061
|
-
|
|
1548
|
+
c(e.props.children);
|
|
1062
1549
|
});
|
|
1063
1550
|
}
|
|
1064
|
-
|
|
1065
|
-
let
|
|
1551
|
+
c(t);
|
|
1552
|
+
let l = s.join("").trim();
|
|
1066
1553
|
return {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1554
|
+
badge: r,
|
|
1555
|
+
description: i,
|
|
1556
|
+
icon: o,
|
|
1557
|
+
label: l || n
|
|
1070
1558
|
};
|
|
1071
1559
|
}
|
|
1072
1560
|
//#endregion
|
|
1073
|
-
//#region src/components/Select/
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1561
|
+
//#region src/components/Select/internal/useSelectCollection.ts
|
|
1562
|
+
function Kt(e) {
|
|
1563
|
+
return u(() => Ht(e), [e]);
|
|
1564
|
+
}
|
|
1565
|
+
//#endregion
|
|
1566
|
+
//#region src/components/Select/internal/useSelectPosition.ts
|
|
1567
|
+
function qt({ avoidCollisions: e, isOpen: t, matchTriggerWidth: n, onOpenChange: r, placement: i }) {
|
|
1568
|
+
return Le({
|
|
1569
|
+
open: t,
|
|
1570
|
+
onOpenChange: r,
|
|
1571
|
+
placement: i === "bottom" || i === "top" ? `${i}-start` : i,
|
|
1572
|
+
matchTriggerWidth: n,
|
|
1573
|
+
avoidCollisions: e,
|
|
1574
|
+
mobileSheetBreakpoint: 640
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
//#endregion
|
|
1578
|
+
//#region src/components/Select/internal/useSelectSearch.ts
|
|
1579
|
+
function Jt({ options: e, searchable: t, searchValue: n }) {
|
|
1580
|
+
return u(() => {
|
|
1581
|
+
if (!t || !n) return e;
|
|
1582
|
+
let r = n.toLocaleLowerCase();
|
|
1583
|
+
return e.filter((e) => `${e.label} ${Yt(e.description)}`.toLocaleLowerCase().includes(r));
|
|
1084
1584
|
}, [
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
])
|
|
1089
|
-
|
|
1585
|
+
e,
|
|
1586
|
+
n,
|
|
1587
|
+
t
|
|
1588
|
+
]);
|
|
1589
|
+
}
|
|
1590
|
+
function Yt(e) {
|
|
1591
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
1592
|
+
}
|
|
1593
|
+
var Y = {
|
|
1594
|
+
control: "_control_swenc_1",
|
|
1595
|
+
disabled: "_disabled_swenc_41",
|
|
1596
|
+
arrow: "_arrow_swenc_46",
|
|
1597
|
+
primary: "_primary_swenc_60",
|
|
1598
|
+
outline: "_outline_swenc_60",
|
|
1599
|
+
filled: "_filled_swenc_101",
|
|
1600
|
+
soft: "_soft_swenc_142",
|
|
1601
|
+
neutral: "_neutral_swenc_183",
|
|
1602
|
+
success: "_success_swenc_306",
|
|
1603
|
+
warning: "_warning_swenc_429",
|
|
1604
|
+
danger: "_danger_swenc_552",
|
|
1605
|
+
sm: "_sm_swenc_675",
|
|
1606
|
+
md: "_md_swenc_682",
|
|
1607
|
+
lg: "_lg_swenc_689",
|
|
1608
|
+
valueWrap: "_valueWrap_swenc_696",
|
|
1609
|
+
value: "_value_swenc_696",
|
|
1610
|
+
adornment: "_adornment_swenc_710",
|
|
1611
|
+
clear: "_clear_swenc_711",
|
|
1612
|
+
affix: "_affix_swenc_712",
|
|
1613
|
+
placeholder: "_placeholder_swenc_751",
|
|
1614
|
+
error: "_error_swenc_755",
|
|
1615
|
+
spinner: "_spinner_swenc_790",
|
|
1616
|
+
spin: "_spin_swenc_790",
|
|
1617
|
+
loading: "_loading_swenc_799",
|
|
1618
|
+
open: "_open_swenc_811"
|
|
1619
|
+
}, Xt = ({ children: e, className: t }) => {
|
|
1620
|
+
let { triggerProps: n } = bt();
|
|
1621
|
+
return /* @__PURE__ */ g(Zt, {
|
|
1622
|
+
...n,
|
|
1623
|
+
className: [n.className, t].filter(Boolean).join(" "),
|
|
1624
|
+
children: e
|
|
1625
|
+
});
|
|
1626
|
+
};
|
|
1627
|
+
Xt.__velliraSelectPart = "trigger", Xt.displayName = "Select.Trigger";
|
|
1628
|
+
var Zt = ({ children: e, id: t, describedBy: n, labelledBy: r, isOpen: i, disabled: a, required: o, listboxId: s, activeIndex: c, ariaLabel: l, error: u, displayText: d, isPlaceholder: f, size: p = "md", color: m, 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: N }) => /* @__PURE__ */ g("button", {
|
|
1629
|
+
id: t,
|
|
1630
|
+
ref: k,
|
|
1631
|
+
type: "button",
|
|
1632
|
+
role: "combobox",
|
|
1633
|
+
disabled: a,
|
|
1634
|
+
"aria-disabled": a || void 0,
|
|
1635
|
+
"aria-required": o || void 0,
|
|
1636
|
+
"aria-expanded": i,
|
|
1637
|
+
"aria-haspopup": "listbox",
|
|
1638
|
+
"aria-label": l,
|
|
1639
|
+
"aria-labelledby": r,
|
|
1640
|
+
"aria-invalid": u || void 0,
|
|
1641
|
+
"aria-controls": i ? s : void 0,
|
|
1642
|
+
"aria-describedby": n,
|
|
1643
|
+
"aria-activedescendant": i && c >= 0 ? `${s}-option-${c}` : void 0,
|
|
1644
|
+
className: V(Y.control, Y[p], Y[v], Y[m], {
|
|
1645
|
+
[Y.error]: !!u,
|
|
1646
|
+
[Y.disabled]: a,
|
|
1647
|
+
[Y.loading]: b
|
|
1648
|
+
}, O),
|
|
1649
|
+
onClick: A,
|
|
1650
|
+
onKeyDown: j,
|
|
1651
|
+
onBlur: M,
|
|
1652
|
+
onFocus: N,
|
|
1653
|
+
children: e ?? /* @__PURE__ */ _(h, { children: [
|
|
1654
|
+
S && /* @__PURE__ */ g("span", {
|
|
1655
|
+
className: Y.adornment,
|
|
1656
|
+
children: S
|
|
1657
|
+
}),
|
|
1658
|
+
w && /* @__PURE__ */ g("span", {
|
|
1659
|
+
className: Y.affix,
|
|
1660
|
+
children: w
|
|
1661
|
+
}),
|
|
1662
|
+
/* @__PURE__ */ g("span", {
|
|
1663
|
+
className: Y.valueWrap,
|
|
1664
|
+
children: /* @__PURE__ */ g("span", {
|
|
1665
|
+
className: V(Y.value, { [Y.placeholder]: f }),
|
|
1666
|
+
children: d
|
|
1667
|
+
})
|
|
1668
|
+
}),
|
|
1669
|
+
T && /* @__PURE__ */ g("span", {
|
|
1670
|
+
className: Y.affix,
|
|
1671
|
+
children: T
|
|
1672
|
+
}),
|
|
1673
|
+
E && /* @__PURE__ */ g("span", {
|
|
1674
|
+
role: "button",
|
|
1675
|
+
"aria-label": "Clear selection",
|
|
1676
|
+
tabIndex: -1,
|
|
1677
|
+
className: Y.clear,
|
|
1678
|
+
onClick: (e) => {
|
|
1679
|
+
e.stopPropagation(), D?.();
|
|
1680
|
+
},
|
|
1681
|
+
children: /* @__PURE__ */ g(x, {})
|
|
1682
|
+
}),
|
|
1683
|
+
/* @__PURE__ */ g("span", {
|
|
1684
|
+
className: V(Y.arrow, { [Y.open]: i }),
|
|
1685
|
+
"aria-hidden": "true",
|
|
1686
|
+
children: b ? /* @__PURE__ */ g("span", { className: Y.spinner }) : C ?? /* @__PURE__ */ g(y, {})
|
|
1687
|
+
})
|
|
1688
|
+
] })
|
|
1689
|
+
});
|
|
1690
|
+
Zt.displayName = "SelectTriggerSurface";
|
|
1691
|
+
//#endregion
|
|
1692
|
+
//#region src/components/Select/Root/SelectRoot.tsx
|
|
1693
|
+
var Qt = 0, $t = "", en = ({ children: e, label: t, description: n, id: r, name: i, "aria-label": a, "aria-describedby": s, "aria-labelledby": p, value: m, 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: R = !1, command: ee = !1, error: z, placement: B = "bottom", matchTriggerWidth: te = !0, avoidCollisions: ne = !0, portal: re = !0, open: ie, defaultOpen: ae = !1, onOpenChange: V, onSearch: H, onClear: U, startIcon: oe, endIcon: se, prefix: ce, suffix: le, renderValue: ue, renderOption: de, onBlur: fe, onFocus: pe, className: me, triggerClassName: he, dropdownClassName: ge }) => {
|
|
1694
|
+
let W = l(), _e = Rt(), ve = !!(t || n || z), ye = r ?? (ve ? void 0 : _e?.controlId) ?? W, be = `${ye}-listbox`, [xe, Se] = f(""), Ce = !!z, we = Ce ? `${ye}-error` : void 0, Te = n ? `${ye}-description` : void 0, Ee = D ?? _e?.size ?? "md", De = M || Ce || !ve && !!_e?.invalid, Oe = j || !ve && !!_e?.disabled, ke = A || !ve && !!_e?.required, Ae = [
|
|
1695
|
+
s,
|
|
1696
|
+
!ve && !s ? _e?.ariaDescribedBy : void 0,
|
|
1697
|
+
Te,
|
|
1698
|
+
we
|
|
1699
|
+
].filter(Boolean).join(" "), je = d(null), Me = d(null), [Ne, Pe] = f(!1), Fe = F || ee, { entries: Ie, options: Le } = Kt(e), ze = Jt({
|
|
1700
|
+
options: Le,
|
|
1701
|
+
searchable: Fe,
|
|
1702
|
+
searchValue: xe
|
|
1703
|
+
}), { selectedValue: Be, selectedValues: G, isOpen: K, setIsOpen: Ve, setSelectedValue: He, activeIndex: Ue, setActiveIndex: We, closeDropdown: Ge, toggleDropdown: Ke, selectValue: qe, onKeyDown: Je } = L({
|
|
1704
|
+
value: m,
|
|
1090
1705
|
defaultValue: v,
|
|
1091
1706
|
onValueChange: y,
|
|
1092
|
-
options:
|
|
1707
|
+
options: ze,
|
|
1093
1708
|
multiple: b,
|
|
1094
1709
|
maxSelected: x,
|
|
1095
1710
|
closeOnSelect: S,
|
|
1096
|
-
disabled:
|
|
1097
|
-
open:
|
|
1098
|
-
defaultOpen:
|
|
1099
|
-
onOpenChange:
|
|
1100
|
-
}),
|
|
1101
|
-
|
|
1102
|
-
onOpenChange:
|
|
1103
|
-
placement: B
|
|
1711
|
+
disabled: Oe,
|
|
1712
|
+
open: ie,
|
|
1713
|
+
defaultOpen: ae,
|
|
1714
|
+
onOpenChange: V
|
|
1715
|
+
}), Ye = u(() => Le.find((e) => G.includes(e.value)), [Le, G]), Xe = u(() => Le.filter((e) => G.includes(e.value)), [Le, G]), Ze = !!Ye, Qe = Array.isArray(Be) ? Be[0] ?? "" : Be, { floatingStyles: $e, setRef: et, setFloatingRef: tt } = qt({
|
|
1716
|
+
isOpen: K,
|
|
1717
|
+
onOpenChange: Ve,
|
|
1718
|
+
placement: B,
|
|
1104
1719
|
matchTriggerWidth: te,
|
|
1105
|
-
avoidCollisions: ne
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1720
|
+
avoidCollisions: ne
|
|
1721
|
+
}), nt = o((e) => {
|
|
1722
|
+
qe(e), je.current?.focus();
|
|
1723
|
+
}, [qe]), rt = o((e) => {
|
|
1724
|
+
if (!b || e.length === 0) return;
|
|
1725
|
+
let t = e.filter((e) => Le.some((t) => t.value === e && !t.disabled)), n = t.filter((e) => G.includes(e)), r = G.filter((e) => !t.includes(e)).length, i = typeof x == "number" ? Math.max(0, Math.min(t.length, x - r)) : t.length;
|
|
1726
|
+
if (n.length > 0 && n.length >= i) {
|
|
1727
|
+
He(G.filter((e) => !t.includes(e)));
|
|
1728
|
+
return;
|
|
1729
|
+
}
|
|
1730
|
+
let a = [...G];
|
|
1731
|
+
for (let e of t) if (!a.includes(e)) {
|
|
1732
|
+
if (typeof x == "number" && a.length >= x) break;
|
|
1733
|
+
a.push(e);
|
|
1734
|
+
}
|
|
1735
|
+
He(a), S && (Ge(), je.current?.focus());
|
|
1736
|
+
}, [
|
|
1737
|
+
Ge,
|
|
1738
|
+
S,
|
|
1739
|
+
x,
|
|
1740
|
+
b,
|
|
1741
|
+
Le,
|
|
1742
|
+
G,
|
|
1743
|
+
He
|
|
1744
|
+
]), it = o(() => {
|
|
1745
|
+
qe(""), U?.(), je.current?.focus();
|
|
1746
|
+
}, [U, qe]), at = o(() => {
|
|
1747
|
+
K || Pe(!1), Ke();
|
|
1748
|
+
}, [K, Ke]), ot = o((e) => {
|
|
1749
|
+
tn(e, K) && Pe(!0), Je(e);
|
|
1750
|
+
}, [K, Je]), st = o((e) => {
|
|
1751
|
+
Pe(!0), We(e);
|
|
1752
|
+
}, [We]), ct = o((e) => {
|
|
1753
|
+
Se(e), H?.(e);
|
|
1754
|
+
}, [H]);
|
|
1755
|
+
Re([je, Me], Ge, K), c(() => {
|
|
1756
|
+
K || Pe(!1);
|
|
1757
|
+
}, [K]), c(() => {
|
|
1758
|
+
!K && xe && Se("");
|
|
1759
|
+
}, [K, xe]), c(() => {
|
|
1760
|
+
if (!(!R || !K)) return Qt === 0 && ($t = document.body.style.overflow), Qt += 1, document.body.style.overflow = "hidden", () => {
|
|
1761
|
+
Qt = Math.max(0, Qt - 1), Qt === 0 && (document.body.style.overflow = $t);
|
|
1117
1762
|
};
|
|
1118
|
-
}, [
|
|
1119
|
-
let
|
|
1120
|
-
|
|
1121
|
-
}, [
|
|
1122
|
-
|
|
1123
|
-
}, [
|
|
1124
|
-
id:
|
|
1125
|
-
describedBy:
|
|
1126
|
-
labelledBy:
|
|
1127
|
-
isOpen:
|
|
1128
|
-
disabled:
|
|
1129
|
-
required:
|
|
1130
|
-
listboxId:
|
|
1131
|
-
activeIndex:
|
|
1132
|
-
ariaLabel:
|
|
1133
|
-
error:
|
|
1134
|
-
loading:
|
|
1135
|
-
displayText:
|
|
1136
|
-
isPlaceholder:
|
|
1137
|
-
size:
|
|
1763
|
+
}, [K, R]);
|
|
1764
|
+
let lt = o((e) => {
|
|
1765
|
+
je.current = e, et(e);
|
|
1766
|
+
}, [et]), ut = o((e) => {
|
|
1767
|
+
Me.current = e, tt(e);
|
|
1768
|
+
}, [tt]), dt = ue ? ue(Ye) : b && Xe.length ? Xe.map((e) => e.label).join(", ") : Ye?.label ?? C, ft = w ?? E ?? "No options available", pt = P && G.length > 0 && !Oe && !N, mt = {
|
|
1769
|
+
id: ye,
|
|
1770
|
+
describedBy: Ae || void 0,
|
|
1771
|
+
labelledBy: a ? void 0 : p,
|
|
1772
|
+
isOpen: K,
|
|
1773
|
+
disabled: Oe,
|
|
1774
|
+
required: ke,
|
|
1775
|
+
listboxId: be,
|
|
1776
|
+
activeIndex: Ue,
|
|
1777
|
+
ariaLabel: a ?? (!t && !_e?.labelId ? Ye?.label || C : void 0),
|
|
1778
|
+
error: De,
|
|
1779
|
+
loading: N,
|
|
1780
|
+
displayText: dt,
|
|
1781
|
+
isPlaceholder: !Ze,
|
|
1782
|
+
size: Ee,
|
|
1138
1783
|
color: O,
|
|
1139
1784
|
variant: k,
|
|
1140
|
-
startIcon:
|
|
1141
|
-
endIcon:
|
|
1142
|
-
prefix:
|
|
1143
|
-
suffix:
|
|
1144
|
-
clearable:
|
|
1145
|
-
className:
|
|
1146
|
-
buttonRef:
|
|
1147
|
-
onClear:
|
|
1148
|
-
onClick:
|
|
1149
|
-
onKeyDown:
|
|
1150
|
-
onBlur:
|
|
1151
|
-
onFocus:
|
|
1152
|
-
},
|
|
1153
|
-
isOpen:
|
|
1154
|
-
listboxId:
|
|
1155
|
-
labelledById:
|
|
1156
|
-
style:
|
|
1157
|
-
options:
|
|
1158
|
-
entries:
|
|
1785
|
+
startIcon: oe,
|
|
1786
|
+
endIcon: se,
|
|
1787
|
+
prefix: ce,
|
|
1788
|
+
suffix: le,
|
|
1789
|
+
clearable: pt,
|
|
1790
|
+
className: he,
|
|
1791
|
+
buttonRef: lt,
|
|
1792
|
+
onClear: it,
|
|
1793
|
+
onClick: at,
|
|
1794
|
+
onKeyDown: ot,
|
|
1795
|
+
onBlur: fe,
|
|
1796
|
+
onFocus: pe
|
|
1797
|
+
}, ht = {
|
|
1798
|
+
isOpen: K,
|
|
1799
|
+
listboxId: be,
|
|
1800
|
+
labelledById: ye,
|
|
1801
|
+
style: $e,
|
|
1802
|
+
options: ze,
|
|
1803
|
+
entries: Fe || xe ? void 0 : Ie,
|
|
1159
1804
|
multiple: b,
|
|
1160
1805
|
color: O,
|
|
1161
1806
|
variant: k,
|
|
1162
|
-
searchable:
|
|
1163
|
-
command:
|
|
1164
|
-
virtual:
|
|
1165
|
-
portal:
|
|
1166
|
-
searchValue:
|
|
1167
|
-
loading:
|
|
1807
|
+
searchable: Fe,
|
|
1808
|
+
command: ee,
|
|
1809
|
+
virtual: I,
|
|
1810
|
+
portal: re,
|
|
1811
|
+
searchValue: xe,
|
|
1812
|
+
loading: N,
|
|
1168
1813
|
loadingText: T,
|
|
1169
|
-
noOptionsText:
|
|
1170
|
-
renderOption:
|
|
1171
|
-
selectedValue:
|
|
1172
|
-
selectedValues:
|
|
1173
|
-
activeIndex:
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1814
|
+
noOptionsText: ft,
|
|
1815
|
+
renderOption: de,
|
|
1816
|
+
selectedValue: Qe,
|
|
1817
|
+
selectedValues: G,
|
|
1818
|
+
activeIndex: Ue,
|
|
1819
|
+
visualActiveIndex: Ne ? Ue : -1,
|
|
1820
|
+
className: ge,
|
|
1821
|
+
setDropdownRef: ut,
|
|
1822
|
+
onSelect: nt,
|
|
1823
|
+
onSelectGroup: rt,
|
|
1824
|
+
onMouseEnter: st,
|
|
1825
|
+
onSearchChange: ct
|
|
1826
|
+
}, gt = /* @__PURE__ */ _(h, { children: [i && b && G.length > 0 && /* @__PURE__ */ g(h, { children: G.map((e) => /* @__PURE__ */ g("input", {
|
|
1180
1827
|
type: "hidden",
|
|
1181
1828
|
name: i,
|
|
1182
1829
|
value: e,
|
|
1183
|
-
disabled:
|
|
1184
|
-
}, e)) }), i && !b && /* @__PURE__ */
|
|
1830
|
+
disabled: Oe
|
|
1831
|
+
}, e)) }), i && !b && /* @__PURE__ */ g("input", {
|
|
1185
1832
|
type: "hidden",
|
|
1186
1833
|
name: i,
|
|
1187
|
-
value:
|
|
1188
|
-
disabled:
|
|
1189
|
-
})] }),
|
|
1834
|
+
value: Qe,
|
|
1835
|
+
disabled: Oe
|
|
1836
|
+
})] }), _t = Ut(e), vt = /* @__PURE__ */ _(yt, {
|
|
1190
1837
|
value: {
|
|
1191
|
-
triggerProps:
|
|
1192
|
-
|
|
1838
|
+
triggerProps: mt,
|
|
1839
|
+
contentProps: ht
|
|
1193
1840
|
},
|
|
1194
|
-
children: [
|
|
1195
|
-
}),
|
|
1841
|
+
children: [gt, _t ? e : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Xt, {}), /* @__PURE__ */ g(wt, { children: e })] })]
|
|
1842
|
+
}), bt = /* @__PURE__ */ _(yt, {
|
|
1196
1843
|
value: {
|
|
1197
|
-
triggerProps:
|
|
1198
|
-
|
|
1844
|
+
triggerProps: mt,
|
|
1845
|
+
contentProps: ht
|
|
1199
1846
|
},
|
|
1200
1847
|
children: [
|
|
1201
|
-
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1848
|
+
gt,
|
|
1849
|
+
/* @__PURE__ */ g(Zt, { ...mt }),
|
|
1850
|
+
/* @__PURE__ */ g(Tt, { ...ht })
|
|
1204
1851
|
]
|
|
1205
1852
|
});
|
|
1206
|
-
return !
|
|
1207
|
-
id:
|
|
1853
|
+
return !ve && _e ? e ? vt : bt : /* @__PURE__ */ g(Vt, {
|
|
1854
|
+
id: ye,
|
|
1208
1855
|
label: t,
|
|
1209
1856
|
description: n,
|
|
1210
|
-
error:
|
|
1211
|
-
required:
|
|
1212
|
-
disabled:
|
|
1857
|
+
error: z,
|
|
1858
|
+
required: ke,
|
|
1859
|
+
disabled: Oe,
|
|
1213
1860
|
bindControl: !1,
|
|
1214
|
-
className:
|
|
1215
|
-
children: e ?
|
|
1861
|
+
className: me,
|
|
1862
|
+
children: e ? vt : bt
|
|
1216
1863
|
});
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
Content: Ke,
|
|
1222
|
-
Search: Ye,
|
|
1223
|
-
Group: Xe,
|
|
1224
|
-
Label: Ze,
|
|
1225
|
-
Item: Qe,
|
|
1226
|
-
ItemIcon: $e,
|
|
1227
|
-
ItemDescription: et,
|
|
1228
|
-
Separator: tt,
|
|
1229
|
-
Empty: nt,
|
|
1230
|
-
Loading: rt
|
|
1231
|
-
});
|
|
1232
|
-
ut.displayName = "Select";
|
|
1233
|
-
function dt(e) {
|
|
1234
|
-
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
1864
|
+
};
|
|
1865
|
+
en.displayName = "SelectRoot";
|
|
1866
|
+
function tn(e, t) {
|
|
1867
|
+
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 === " ";
|
|
1235
1868
|
}
|
|
1236
1869
|
//#endregion
|
|
1870
|
+
//#region src/components/Select/Trigger/SelectIcon.tsx
|
|
1871
|
+
var nn = ({ children: e, className: t }) => {
|
|
1872
|
+
let { triggerProps: n } = bt();
|
|
1873
|
+
return /* @__PURE__ */ g("span", {
|
|
1874
|
+
className: V(Y.arrow, { [Y.open]: n.isOpen }, t),
|
|
1875
|
+
"aria-hidden": "true",
|
|
1876
|
+
children: n.loading ? /* @__PURE__ */ g("span", { className: Y.spinner }) : e ?? n.endIcon ?? /* @__PURE__ */ g(y, {})
|
|
1877
|
+
});
|
|
1878
|
+
};
|
|
1879
|
+
nn.__velliraSelectPart = "icon", nn.displayName = "Select.Icon";
|
|
1880
|
+
//#endregion
|
|
1881
|
+
//#region src/components/Select/Trigger/SelectValue.tsx
|
|
1882
|
+
var rn = ({ children: e, className: t }) => {
|
|
1883
|
+
let { triggerProps: n } = bt();
|
|
1884
|
+
return /* @__PURE__ */ g("span", {
|
|
1885
|
+
className: V(Y.valueWrap, t),
|
|
1886
|
+
children: /* @__PURE__ */ g("span", {
|
|
1887
|
+
className: V(Y.value, { [Y.placeholder]: n.isPlaceholder }),
|
|
1888
|
+
children: e ?? n.displayText
|
|
1889
|
+
})
|
|
1890
|
+
});
|
|
1891
|
+
};
|
|
1892
|
+
rn.__velliraSelectPart = "value", rn.displayName = "Select.Value";
|
|
1893
|
+
//#endregion
|
|
1894
|
+
//#region src/components/Select/Select.tsx
|
|
1895
|
+
var an = Object.assign(en, {
|
|
1896
|
+
Trigger: Xt,
|
|
1897
|
+
Value: rn,
|
|
1898
|
+
Icon: nn,
|
|
1899
|
+
Content: wt,
|
|
1900
|
+
Search: At,
|
|
1901
|
+
Group: jt,
|
|
1902
|
+
Label: Mt,
|
|
1903
|
+
Item: St,
|
|
1904
|
+
ItemIcon: It,
|
|
1905
|
+
ItemDescription: Ft,
|
|
1906
|
+
ItemBadge: Pt,
|
|
1907
|
+
Separator: Nt,
|
|
1908
|
+
Empty: Ot,
|
|
1909
|
+
Loading: kt
|
|
1910
|
+
});
|
|
1911
|
+
an.displayName = "Select";
|
|
1912
|
+
//#endregion
|
|
1237
1913
|
//#region src/components/Tabs/TabsContext.tsx
|
|
1238
|
-
var
|
|
1239
|
-
let e =
|
|
1914
|
+
var on = r(null), sn = () => {
|
|
1915
|
+
let e = s(on);
|
|
1240
1916
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
1241
1917
|
return e;
|
|
1242
|
-
},
|
|
1918
|
+
}, cn = {
|
|
1243
1919
|
list: "_list_13hkl_1",
|
|
1244
1920
|
vertical: "_vertical_13hkl_8"
|
|
1245
|
-
},
|
|
1246
|
-
let { orientation: r, appearance: i } =
|
|
1247
|
-
return /* @__PURE__ */
|
|
1921
|
+
}, ln = ({ children: e, className: t, ...n }) => {
|
|
1922
|
+
let { orientation: r, appearance: i } = sn();
|
|
1923
|
+
return /* @__PURE__ */ g("div", {
|
|
1248
1924
|
...n,
|
|
1249
1925
|
role: "tablist",
|
|
1250
1926
|
"aria-orientation": r,
|
|
1251
|
-
className:
|
|
1927
|
+
className: V(cn.list, r === "vertical" && cn.vertical, i === "underline" && cn.underline, i === "pills" && cn.pills, t),
|
|
1252
1928
|
children: e
|
|
1253
1929
|
});
|
|
1254
1930
|
};
|
|
1255
|
-
|
|
1256
|
-
var
|
|
1931
|
+
ln.displayName = "TabsList";
|
|
1932
|
+
var un = {
|
|
1257
1933
|
panel: "_panel_1v1a9_1",
|
|
1258
1934
|
visible: "_visible_1v1a9_10",
|
|
1259
1935
|
vertical: "_vertical_1v1a9_14"
|
|
1260
|
-
},
|
|
1261
|
-
let { activeIndex: r, orientation: i } =
|
|
1262
|
-
return
|
|
1263
|
-
if (!
|
|
1936
|
+
}, dn = ({ index: e, children: t, className: n }) => {
|
|
1937
|
+
let { activeIndex: r, orientation: i } = sn(), [a, o] = f(!1), s = r === e;
|
|
1938
|
+
return c(() => {
|
|
1939
|
+
if (!s) {
|
|
1264
1940
|
o(!1);
|
|
1265
1941
|
return;
|
|
1266
1942
|
}
|
|
1267
1943
|
let e = setTimeout(() => o(!0), 10);
|
|
1268
1944
|
return () => clearTimeout(e);
|
|
1269
|
-
}, [
|
|
1945
|
+
}, [s]), /* @__PURE__ */ g("div", {
|
|
1270
1946
|
role: "tabpanel",
|
|
1271
1947
|
id: `tab-panel-${e}`,
|
|
1272
1948
|
"aria-labelledby": `tab-${e}`,
|
|
1273
|
-
hidden: !
|
|
1949
|
+
hidden: !s,
|
|
1274
1950
|
tabIndex: 0,
|
|
1275
|
-
className:
|
|
1951
|
+
className: V(un.panel, a && un.visible, i === "vertical" && un.vertical, n),
|
|
1276
1952
|
children: t
|
|
1277
1953
|
});
|
|
1278
1954
|
};
|
|
1279
|
-
|
|
1280
|
-
var
|
|
1955
|
+
dn.displayName = "TabsPanel";
|
|
1956
|
+
var fn = {
|
|
1281
1957
|
tab: "_tab_qe8xc_1",
|
|
1282
1958
|
iconOnly: "_iconOnly_qe8xc_27",
|
|
1283
1959
|
tabIcon: "_tabIcon_qe8xc_31",
|
|
@@ -1286,11 +1962,11 @@ var vt = {
|
|
|
1286
1962
|
underline: "_underline_qe8xc_60",
|
|
1287
1963
|
pills: "_pills_qe8xc_92",
|
|
1288
1964
|
vertical: "_vertical_qe8xc_106"
|
|
1289
|
-
},
|
|
1290
|
-
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: m, onTabKeyDown:
|
|
1291
|
-
return /* @__PURE__ */
|
|
1965
|
+
}, pn = i(({ index: e, children: t, className: n, disabled: r = !1, icon: i, onClick: a, onKeyDown: s, ...c }, l) => {
|
|
1966
|
+
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: m, onTabKeyDown: h } = sn(), v = u === e, y = !!i, b = y && t == null;
|
|
1967
|
+
return /* @__PURE__ */ _("button", {
|
|
1292
1968
|
type: "button",
|
|
1293
|
-
ref:
|
|
1969
|
+
ref: o((t) => {
|
|
1294
1970
|
m(e, t), typeof l == "function" ? l(t) : l && (l.current = t);
|
|
1295
1971
|
}, [
|
|
1296
1972
|
m,
|
|
@@ -1303,70 +1979,70 @@ var vt = {
|
|
|
1303
1979
|
id: `tab-${e}`,
|
|
1304
1980
|
disabled: r,
|
|
1305
1981
|
tabIndex: v ? 0 : -1,
|
|
1306
|
-
className:
|
|
1982
|
+
className: V(fn.tab, fn[p], f === "vertical" && fn.vertical, y && fn.withIcon, b && fn.iconOnly, n),
|
|
1307
1983
|
onClick: (t) => {
|
|
1308
|
-
r || (d(e),
|
|
1984
|
+
r || (d(e), a?.(t));
|
|
1309
1985
|
},
|
|
1310
1986
|
onKeyDown: (e) => {
|
|
1311
|
-
|
|
1987
|
+
h(e), s?.(e);
|
|
1312
1988
|
},
|
|
1313
1989
|
...c,
|
|
1314
|
-
children: [y && /* @__PURE__ */
|
|
1315
|
-
className:
|
|
1990
|
+
children: [y && /* @__PURE__ */ g("span", {
|
|
1991
|
+
className: fn.tabIcon,
|
|
1316
1992
|
"aria-hidden": "true",
|
|
1317
1993
|
children: i
|
|
1318
|
-
}), t != null && /* @__PURE__ */
|
|
1319
|
-
className:
|
|
1994
|
+
}), t != null && /* @__PURE__ */ g("span", {
|
|
1995
|
+
className: fn.label,
|
|
1320
1996
|
children: t
|
|
1321
1997
|
})]
|
|
1322
1998
|
});
|
|
1323
1999
|
});
|
|
1324
|
-
|
|
1325
|
-
var
|
|
2000
|
+
pn.displayName = "Tab";
|
|
2001
|
+
var mn = {
|
|
1326
2002
|
tabs: "_tabs_uqy7q_1",
|
|
1327
2003
|
vertical: "_vertical_uqy7q_5"
|
|
1328
|
-
},
|
|
1329
|
-
let { activeIndex: c, setActiveIndex: l } =
|
|
2004
|
+
}, hn = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: i = "horizontal", appearance: a = "default", className: s }) => {
|
|
2005
|
+
let { activeIndex: c, setActiveIndex: l } = R({
|
|
1330
2006
|
activeIndex: t,
|
|
1331
2007
|
defaultActiveIndex: n,
|
|
1332
2008
|
onChange: r
|
|
1333
|
-
}),
|
|
1334
|
-
|
|
1335
|
-
}, []), { onKeyDown: p } =
|
|
2009
|
+
}), u = d([]), f = o((e, t) => {
|
|
2010
|
+
u.current[e] = t;
|
|
2011
|
+
}, []), { onKeyDown: p } = ee({
|
|
1336
2012
|
activeIndex: c,
|
|
1337
2013
|
setActiveIndex: l,
|
|
1338
|
-
tabRefs:
|
|
2014
|
+
tabRefs: u,
|
|
1339
2015
|
orientation: i,
|
|
1340
2016
|
onNavigate: (e) => {
|
|
1341
|
-
|
|
2017
|
+
u.current[e]?.focus();
|
|
1342
2018
|
}
|
|
1343
2019
|
}), m = {
|
|
1344
2020
|
activeIndex: c,
|
|
1345
2021
|
setActiveIndex: l,
|
|
1346
2022
|
orientation: i,
|
|
1347
|
-
appearance:
|
|
2023
|
+
appearance: a,
|
|
1348
2024
|
registerTab: f,
|
|
1349
2025
|
onTabKeyDown: p
|
|
1350
2026
|
};
|
|
1351
|
-
return /* @__PURE__ */
|
|
2027
|
+
return /* @__PURE__ */ g(on.Provider, {
|
|
1352
2028
|
value: m,
|
|
1353
|
-
children: /* @__PURE__ */
|
|
1354
|
-
className:
|
|
2029
|
+
children: /* @__PURE__ */ g("div", {
|
|
2030
|
+
className: V(mn.tabs, i === "vertical" && mn.vertical, s),
|
|
1355
2031
|
children: e
|
|
1356
2032
|
})
|
|
1357
2033
|
});
|
|
1358
2034
|
};
|
|
1359
|
-
|
|
2035
|
+
hn.displayName = "Tabs";
|
|
1360
2036
|
//#endregion
|
|
1361
2037
|
//#region src/components/Tabs/index.ts
|
|
1362
|
-
var
|
|
1363
|
-
List:
|
|
1364
|
-
Tab:
|
|
1365
|
-
Panel:
|
|
1366
|
-
}),
|
|
2038
|
+
var gn = Object.assign(hn, {
|
|
2039
|
+
List: ln,
|
|
2040
|
+
Tab: pn,
|
|
2041
|
+
Panel: dn
|
|
2042
|
+
}), _n = {
|
|
1367
2043
|
tooltip: "_tooltip_10opu_1",
|
|
1368
2044
|
arrow: "_arrow_10opu_25"
|
|
1369
|
-
},
|
|
2045
|
+
}, vn = i(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
|
|
1370
2046
|
let l = {
|
|
1371
2047
|
top: "bottom",
|
|
1372
2048
|
right: "left",
|
|
@@ -1379,65 +2055,65 @@ var St = Object.assign(xt, {
|
|
|
1379
2055
|
top: i == null ? "" : `${i}px`,
|
|
1380
2056
|
[l]: "-5px"
|
|
1381
2057
|
};
|
|
1382
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ _("div", {
|
|
1383
2059
|
ref: c,
|
|
1384
|
-
className:
|
|
2060
|
+
className: V(_n.tooltip, a),
|
|
1385
2061
|
"data-placement": t,
|
|
1386
2062
|
"data-state": "open",
|
|
1387
2063
|
style: o,
|
|
1388
2064
|
...s,
|
|
1389
|
-
children: [e, /* @__PURE__ */
|
|
2065
|
+
children: [e, /* @__PURE__ */ g("div", {
|
|
1390
2066
|
ref: n,
|
|
1391
|
-
className:
|
|
2067
|
+
className: _n.arrow,
|
|
1392
2068
|
style: u
|
|
1393
2069
|
})]
|
|
1394
2070
|
});
|
|
1395
2071
|
});
|
|
1396
|
-
|
|
2072
|
+
vn.displayName = "TooltipContent";
|
|
1397
2073
|
//#endregion
|
|
1398
2074
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
1399
|
-
var
|
|
2075
|
+
var yn = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
|
|
1400
2076
|
open: 300,
|
|
1401
2077
|
close: 100
|
|
1402
2078
|
}, maxWidth: a = 250, className: o, onOpenChange: s }) => {
|
|
1403
|
-
let [
|
|
1404
|
-
open:
|
|
2079
|
+
let [c, u] = f(!1), p = d(null), m = l(), { context: v, floatingStyles: y, middlewareData: b, setRef: x, setFloatingRef: S, placement: T } = Le({
|
|
2080
|
+
open: c,
|
|
1405
2081
|
onOpenChange: (e) => {
|
|
1406
|
-
r || (
|
|
2082
|
+
r || (u(e), s?.(e));
|
|
1407
2083
|
},
|
|
1408
2084
|
placement: t,
|
|
1409
|
-
middleware: [
|
|
1410
|
-
}),
|
|
2085
|
+
middleware: [w({ element: p })]
|
|
2086
|
+
}), E = b.arrow?.x, D = b.arrow?.y, { getReferenceProps: O, getFloatingProps: k } = N([M(v, { delay: {
|
|
1411
2087
|
open: i.open,
|
|
1412
2088
|
close: i.close
|
|
1413
|
-
} }),
|
|
1414
|
-
return /* @__PURE__ */
|
|
1415
|
-
ref:
|
|
2089
|
+
} }), j(v)]);
|
|
2090
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
2091
|
+
ref: x,
|
|
1416
2092
|
style: { display: "inline-flex" },
|
|
1417
|
-
"aria-describedby":
|
|
1418
|
-
...
|
|
2093
|
+
"aria-describedby": c ? m : void 0,
|
|
2094
|
+
...O(),
|
|
1419
2095
|
children: e
|
|
1420
|
-
}), /* @__PURE__ */
|
|
1421
|
-
id:
|
|
1422
|
-
ref:
|
|
2096
|
+
}), /* @__PURE__ */ g(C, { children: c && n && /* @__PURE__ */ g(vn, {
|
|
2097
|
+
id: m,
|
|
2098
|
+
ref: S,
|
|
1423
2099
|
content: n,
|
|
1424
2100
|
arrowRef: p,
|
|
1425
|
-
arrowX:
|
|
1426
|
-
arrowY:
|
|
2101
|
+
arrowX: E,
|
|
2102
|
+
arrowY: D,
|
|
1427
2103
|
role: "tooltip",
|
|
1428
2104
|
style: {
|
|
1429
|
-
...
|
|
2105
|
+
...y,
|
|
1430
2106
|
maxWidth: typeof a == "number" ? `${a}px` : a
|
|
1431
2107
|
},
|
|
1432
|
-
placement:
|
|
2108
|
+
placement: T,
|
|
1433
2109
|
className: o,
|
|
1434
|
-
...
|
|
2110
|
+
...k()
|
|
1435
2111
|
}) })] });
|
|
1436
2112
|
};
|
|
1437
|
-
|
|
2113
|
+
yn.displayName = "Tooltip";
|
|
1438
2114
|
//#endregion
|
|
1439
2115
|
//#region src/utils/devWarning.ts
|
|
1440
|
-
var
|
|
2116
|
+
var bn = (e, t) => {
|
|
1441
2117
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
1442
2118
|
}, X = {
|
|
1443
2119
|
button: "_button_2nghu_1",
|
|
@@ -1467,104 +2143,104 @@ var Et = (e, t) => {
|
|
|
1467
2143
|
"button-spin": "_button-spin_2nghu_1",
|
|
1468
2144
|
badge: "_badge_2nghu_786",
|
|
1469
2145
|
shortcut: "_shortcut_2nghu_800"
|
|
1470
|
-
},
|
|
1471
|
-
let I = S &&
|
|
1472
|
-
[X.disabled]:
|
|
2146
|
+
}, xn = i(({ children: e, color: t = "primary", appearance: r = "solid", size: i = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: p, badge: m, 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: N, ...P }, F) => {
|
|
2147
|
+
let I = S && a(e) ? e : void 0, L = I ? I.props.children : e, R = x || !L && !!(d || f), ee = !!(T || E || I?.props["aria-label"] || I?.props["aria-labelledby"]), z = c || l, B = l && u ? u : L, te = u && L && !R && (typeof L == "string" || typeof L == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? L : u) : void 0, ne = O === "_blank" && !k ? "noreferrer noopener" : k, re = V(X.button, X[t], X[r], X[i], X[o], C, {
|
|
2148
|
+
[X.disabled]: z,
|
|
1473
2149
|
[X.loading]: l,
|
|
1474
2150
|
[X.fullWidth]: b,
|
|
1475
2151
|
[X.iconOnly]: R
|
|
1476
2152
|
});
|
|
1477
|
-
|
|
1478
|
-
let
|
|
2153
|
+
bn(!S || !D, "Button: pass href to the child element when using asChild."), bn(!S || !!I, "Button: asChild requires a single valid React element child."), bn(!R || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
2154
|
+
let ie = (e) => {
|
|
1479
2155
|
e.preventDefault(), e.stopPropagation();
|
|
1480
|
-
},
|
|
1481
|
-
if (
|
|
1482
|
-
|
|
2156
|
+
}, ae = (e) => {
|
|
2157
|
+
if (z) {
|
|
2158
|
+
ie(e);
|
|
1483
2159
|
return;
|
|
1484
2160
|
}
|
|
1485
2161
|
I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
1486
|
-
},
|
|
1487
|
-
l && (p ? /* @__PURE__ */
|
|
2162
|
+
}, H = /* @__PURE__ */ _(h, { children: [
|
|
2163
|
+
l && (p ? /* @__PURE__ */ g("span", {
|
|
1488
2164
|
className: X.icon,
|
|
1489
2165
|
"aria-hidden": "true",
|
|
1490
2166
|
children: p
|
|
1491
|
-
}) : /* @__PURE__ */
|
|
2167
|
+
}) : /* @__PURE__ */ g("span", {
|
|
1492
2168
|
className: X.spinner,
|
|
1493
2169
|
"aria-hidden": "true"
|
|
1494
2170
|
})),
|
|
1495
|
-
!l && d && /* @__PURE__ */
|
|
2171
|
+
!l && d && /* @__PURE__ */ g("span", {
|
|
1496
2172
|
className: X.icon,
|
|
1497
2173
|
children: d
|
|
1498
2174
|
}),
|
|
1499
|
-
|
|
2175
|
+
B && !R && /* @__PURE__ */ g("span", {
|
|
1500
2176
|
className: X.label,
|
|
1501
|
-
"data-measure":
|
|
1502
|
-
children: /* @__PURE__ */
|
|
2177
|
+
"data-measure": te,
|
|
2178
|
+
children: /* @__PURE__ */ g("span", {
|
|
1503
2179
|
className: X.labelText,
|
|
1504
|
-
children:
|
|
2180
|
+
children: B
|
|
1505
2181
|
})
|
|
1506
2182
|
}),
|
|
1507
|
-
|
|
2183
|
+
m && !R && /* @__PURE__ */ g("span", {
|
|
1508
2184
|
className: X.badge,
|
|
1509
|
-
children:
|
|
2185
|
+
children: m
|
|
1510
2186
|
}),
|
|
1511
|
-
v && !R && /* @__PURE__ */
|
|
2187
|
+
v && !R && /* @__PURE__ */ g("span", {
|
|
1512
2188
|
className: X.shortcut,
|
|
1513
2189
|
children: v
|
|
1514
2190
|
}),
|
|
1515
|
-
!l && f && /* @__PURE__ */
|
|
2191
|
+
!l && f && /* @__PURE__ */ g("span", {
|
|
1516
2192
|
className: X.icon,
|
|
1517
2193
|
children: f
|
|
1518
2194
|
})
|
|
1519
2195
|
] });
|
|
1520
|
-
return I ?
|
|
2196
|
+
return I ? n(I, {
|
|
1521
2197
|
...P,
|
|
1522
2198
|
ref: F,
|
|
1523
2199
|
"aria-busy": l || void 0,
|
|
1524
|
-
"aria-disabled":
|
|
2200
|
+
"aria-disabled": z || void 0,
|
|
1525
2201
|
"aria-label": T || I.props["aria-label"] || void 0,
|
|
1526
2202
|
"aria-labelledby": E || I.props["aria-labelledby"] || void 0,
|
|
1527
|
-
className:
|
|
1528
|
-
href:
|
|
1529
|
-
onClick:
|
|
1530
|
-
tabIndex:
|
|
2203
|
+
className: V(I.props.className, re),
|
|
2204
|
+
href: z ? void 0 : I.props.href,
|
|
2205
|
+
onClick: ae,
|
|
2206
|
+
tabIndex: z ? -1 : I.props.tabIndex,
|
|
1531
2207
|
title: y || I.props.title,
|
|
1532
|
-
children:
|
|
1533
|
-
}) : D ? /* @__PURE__ */
|
|
2208
|
+
children: H
|
|
2209
|
+
}) : D ? /* @__PURE__ */ g("a", {
|
|
1534
2210
|
ref: F,
|
|
1535
|
-
href:
|
|
2211
|
+
href: z ? void 0 : D,
|
|
1536
2212
|
id: j,
|
|
1537
2213
|
role: M,
|
|
1538
|
-
tabIndex:
|
|
2214
|
+
tabIndex: z ? -1 : N,
|
|
1539
2215
|
target: O,
|
|
1540
|
-
rel:
|
|
2216
|
+
rel: ne,
|
|
1541
2217
|
download: A,
|
|
1542
|
-
onClick:
|
|
1543
|
-
"aria-disabled":
|
|
2218
|
+
onClick: z ? ie : w,
|
|
2219
|
+
"aria-disabled": z || void 0,
|
|
1544
2220
|
"aria-label": T || void 0,
|
|
1545
2221
|
"aria-labelledby": E || void 0,
|
|
1546
2222
|
"aria-busy": l || void 0,
|
|
1547
|
-
className:
|
|
2223
|
+
className: re,
|
|
1548
2224
|
title: y,
|
|
1549
|
-
children:
|
|
1550
|
-
}) : /* @__PURE__ */
|
|
2225
|
+
children: H
|
|
2226
|
+
}) : /* @__PURE__ */ g("button", {
|
|
1551
2227
|
...P,
|
|
1552
2228
|
ref: F,
|
|
1553
2229
|
id: j,
|
|
1554
2230
|
role: M,
|
|
1555
2231
|
tabIndex: N,
|
|
1556
2232
|
type: s,
|
|
1557
|
-
disabled:
|
|
1558
|
-
onClick:
|
|
2233
|
+
disabled: z,
|
|
2234
|
+
onClick: z ? void 0 : w,
|
|
1559
2235
|
"aria-label": T || void 0,
|
|
1560
2236
|
"aria-labelledby": E || void 0,
|
|
1561
2237
|
"aria-busy": l || void 0,
|
|
1562
|
-
className:
|
|
2238
|
+
className: re,
|
|
1563
2239
|
title: y,
|
|
1564
|
-
children:
|
|
2240
|
+
children: H
|
|
1565
2241
|
});
|
|
1566
2242
|
});
|
|
1567
|
-
|
|
2243
|
+
xn.displayName = "Button";
|
|
1568
2244
|
var Z = {
|
|
1569
2245
|
wrapper: "_wrapper_877rr_1",
|
|
1570
2246
|
colorPrimary: "_colorPrimary_877rr_27",
|
|
@@ -1598,83 +2274,83 @@ var Z = {
|
|
|
1598
2274
|
indeterminate: "_indeterminate_877rr_226",
|
|
1599
2275
|
"checkbox-pop": "_checkbox-pop_877rr_1",
|
|
1600
2276
|
disabled: "_disabled_877rr_354"
|
|
1601
|
-
},
|
|
2277
|
+
}, Sn = {
|
|
1602
2278
|
sm: Z.labelSm,
|
|
1603
2279
|
md: Z.labelMd,
|
|
1604
2280
|
lg: Z.labelLg
|
|
1605
|
-
},
|
|
2281
|
+
}, Cn = {
|
|
1606
2282
|
sm: Z.wrapperSm,
|
|
1607
2283
|
md: Z.wrapperMd,
|
|
1608
2284
|
lg: Z.wrapperLg
|
|
1609
|
-
},
|
|
2285
|
+
}, wn = {
|
|
1610
2286
|
sm: Z.containerSm,
|
|
1611
2287
|
md: Z.containerMd,
|
|
1612
2288
|
lg: Z.containerLg
|
|
1613
|
-
},
|
|
2289
|
+
}, Tn = {
|
|
1614
2290
|
primary: Z.colorPrimary,
|
|
1615
2291
|
neutral: Z.colorNeutral,
|
|
1616
2292
|
success: Z.colorSuccess,
|
|
1617
2293
|
warning: Z.colorWarning,
|
|
1618
2294
|
danger: Z.colorDanger
|
|
1619
|
-
},
|
|
1620
|
-
let k =
|
|
1621
|
-
|
|
2295
|
+
}, En = i(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: a, size: s = "md", color: u = "primary", labelPosition: f = "end", defaultChecked: p = !1, disabled: m = !1, required: h = !1, indeterminate: y = !1, className: b, wrapperClassName: x, onCheckedChange: S, error: C, "aria-label": w, "aria-labelledby": T, "aria-describedby": E, ...D }, O) => {
|
|
2296
|
+
let k = l(), A = e ?? k, j = d(null), M = !!C, N = n ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
|
|
2297
|
+
E,
|
|
1622
2298
|
N,
|
|
1623
2299
|
F
|
|
1624
|
-
].filter(Boolean).join(" "), [L, R] =
|
|
1625
|
-
value:
|
|
2300
|
+
].filter(Boolean).join(" "), [L, R] = P({
|
|
2301
|
+
value: a,
|
|
1626
2302
|
defaultValue: p,
|
|
1627
|
-
onChange:
|
|
1628
|
-
}), ee =
|
|
1629
|
-
if (j.current = e, typeof
|
|
1630
|
-
|
|
2303
|
+
onChange: S
|
|
2304
|
+
}), ee = o((e) => {
|
|
2305
|
+
if (j.current = e, typeof O == "function") {
|
|
2306
|
+
O(e);
|
|
1631
2307
|
return;
|
|
1632
2308
|
}
|
|
1633
|
-
|
|
1634
|
-
}, [
|
|
1635
|
-
|
|
1636
|
-
j.current && (j.current.indeterminate =
|
|
1637
|
-
}, [
|
|
1638
|
-
let
|
|
2309
|
+
O && (O.current = e);
|
|
2310
|
+
}, [O]);
|
|
2311
|
+
c(() => {
|
|
2312
|
+
j.current && (j.current.indeterminate = y);
|
|
2313
|
+
}, [y]);
|
|
2314
|
+
let z = (e) => {
|
|
1639
2315
|
R(e.target.checked);
|
|
1640
2316
|
};
|
|
1641
|
-
return
|
|
1642
|
-
className:
|
|
2317
|
+
return bn(!!(t || w || T), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ _("div", {
|
|
2318
|
+
className: V(Z.container, wn[s], f === "start" && Z.containerLabelStart, b),
|
|
1643
2319
|
children: [
|
|
1644
|
-
/* @__PURE__ */
|
|
2320
|
+
/* @__PURE__ */ _("label", {
|
|
1645
2321
|
htmlFor: A,
|
|
1646
|
-
className:
|
|
2322
|
+
className: V(Z.wrapper, Cn[s], Tn[u], f === "start" && Z.labelStart, !t && Z.iconOnly, m && Z.disabled, x),
|
|
1647
2323
|
children: [
|
|
1648
|
-
/* @__PURE__ */
|
|
1649
|
-
...
|
|
2324
|
+
/* @__PURE__ */ g("input", {
|
|
2325
|
+
...D,
|
|
1650
2326
|
ref: ee,
|
|
1651
2327
|
id: A,
|
|
1652
2328
|
type: "checkbox",
|
|
1653
2329
|
checked: L,
|
|
1654
2330
|
disabled: m,
|
|
1655
|
-
required:
|
|
1656
|
-
onChange:
|
|
2331
|
+
required: h,
|
|
2332
|
+
onChange: z,
|
|
1657
2333
|
className: Z.input,
|
|
1658
|
-
"aria-label":
|
|
1659
|
-
"aria-labelledby":
|
|
1660
|
-
"aria-checked":
|
|
1661
|
-
"aria-invalid": M ? !0 :
|
|
2334
|
+
"aria-label": w,
|
|
2335
|
+
"aria-labelledby": T,
|
|
2336
|
+
"aria-checked": y ? "mixed" : D["aria-checked"],
|
|
2337
|
+
"aria-invalid": M ? !0 : D["aria-invalid"],
|
|
1662
2338
|
"aria-describedby": I || void 0
|
|
1663
2339
|
}),
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
className:
|
|
2340
|
+
/* @__PURE__ */ g("span", {
|
|
2341
|
+
className: V(Z.customCheckbox, M && Z.error, y && Z.indeterminate),
|
|
1666
2342
|
"aria-hidden": "true",
|
|
1667
|
-
children:
|
|
1668
|
-
className:
|
|
2343
|
+
children: y ? /* @__PURE__ */ g("span", {
|
|
2344
|
+
className: V(Z.indeterminateMark, i && Z.customMark),
|
|
1669
2345
|
children: i
|
|
1670
|
-
}) : L && /* @__PURE__ */
|
|
2346
|
+
}) : L && /* @__PURE__ */ g("span", {
|
|
1671
2347
|
className: Z.checkmark,
|
|
1672
|
-
children: r ?? /* @__PURE__ */
|
|
2348
|
+
children: r ?? /* @__PURE__ */ g(v, {})
|
|
1673
2349
|
})
|
|
1674
2350
|
}),
|
|
1675
|
-
t && /* @__PURE__ */
|
|
1676
|
-
className:
|
|
1677
|
-
children: [t,
|
|
2351
|
+
t && /* @__PURE__ */ _("span", {
|
|
2352
|
+
className: V(Z.label, Sn[s]),
|
|
2353
|
+
children: [t, h && /* @__PURE__ */ g("span", {
|
|
1678
2354
|
className: Z.requiredMark,
|
|
1679
2355
|
"aria-hidden": "true",
|
|
1680
2356
|
children: "*"
|
|
@@ -1682,20 +2358,20 @@ var Z = {
|
|
|
1682
2358
|
})
|
|
1683
2359
|
]
|
|
1684
2360
|
}),
|
|
1685
|
-
n && /* @__PURE__ */
|
|
2361
|
+
n && /* @__PURE__ */ g("span", {
|
|
1686
2362
|
id: N,
|
|
1687
2363
|
className: Z.descriptionText,
|
|
1688
2364
|
children: n
|
|
1689
2365
|
}),
|
|
1690
|
-
M && /* @__PURE__ */
|
|
2366
|
+
M && /* @__PURE__ */ g("span", {
|
|
1691
2367
|
id: F,
|
|
1692
2368
|
className: Z.errorText,
|
|
1693
|
-
children:
|
|
2369
|
+
children: C
|
|
1694
2370
|
})
|
|
1695
2371
|
]
|
|
1696
2372
|
});
|
|
1697
2373
|
});
|
|
1698
|
-
|
|
2374
|
+
En.displayName = "Checkbox";
|
|
1699
2375
|
var Q = {
|
|
1700
2376
|
inputGroup: "_inputGroup_151bq_1",
|
|
1701
2377
|
primary: "_primary_151bq_29",
|
|
@@ -1737,7 +2413,7 @@ var Q = {
|
|
|
1737
2413
|
toneDanger: "_toneDanger_151bq_873",
|
|
1738
2414
|
toneMuted: "_toneMuted_151bq_877",
|
|
1739
2415
|
toneInverse: "_toneInverse_151bq_881"
|
|
1740
|
-
},
|
|
2416
|
+
}, Dn = {
|
|
1741
2417
|
default: Q.toneDefault,
|
|
1742
2418
|
primary: Q.tonePrimary,
|
|
1743
2419
|
secondary: Q.toneSecondary,
|
|
@@ -1745,7 +2421,7 @@ var Q = {
|
|
|
1745
2421
|
danger: Q.toneDanger,
|
|
1746
2422
|
muted: Q.toneMuted,
|
|
1747
2423
|
inverse: Q.toneInverse
|
|
1748
|
-
},
|
|
2424
|
+
}, On = (e = "text", t) => {
|
|
1749
2425
|
if (t) return t;
|
|
1750
2426
|
switch (e) {
|
|
1751
2427
|
case "email": return "email";
|
|
@@ -1755,7 +2431,7 @@ var Q = {
|
|
|
1755
2431
|
case "search": return "off";
|
|
1756
2432
|
default: return;
|
|
1757
2433
|
}
|
|
1758
|
-
},
|
|
2434
|
+
}, kn = (e, t) => {
|
|
1759
2435
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
1760
2436
|
for (let e of t) {
|
|
1761
2437
|
if (e === "#") {
|
|
@@ -1767,136 +2443,136 @@ var Q = {
|
|
|
1767
2443
|
r < n.length && (i += e);
|
|
1768
2444
|
}
|
|
1769
2445
|
return i;
|
|
1770
|
-
},
|
|
1771
|
-
let
|
|
1772
|
-
|
|
1773
|
-
!
|
|
1774
|
-
q,
|
|
2446
|
+
}, An = (e, t) => t ? typeof t == "function" ? t(e) : kn(e, t) : e, jn = i(({ id: e, label: t, name: n, description: r, placeholder: i, value: a, defaultValue: s, type: c = "text", size: u, color: p = "primary", variant: m = "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: N, endIcon: P, startAddon: F, endAddon: I, prefix: L, suffix: R, clearIcon: ee, mask: z, format: B, parse: te, startIconTone: ne = "default", endIconTone: re = "default", clearIconTone: ie = "danger", autoFocus: ae, maxLength: H, onMouseEnter: U, onMouseLeave: oe, "aria-describedby": se, "aria-invalid": ce, "aria-labelledby": le, ...ue }, de) => {
|
|
2447
|
+
let fe = l(), pe = Rt(), me = !!(t || r || v), he = e ?? (me ? void 0 : pe?.controlId) ?? fe, ge = d(null), [W, _e] = f(!1), [ve, ye] = f(s ?? ""), be = a !== void 0, xe = String((be ? a : ve) ?? ""), Se = B ? B(xe) : xe, Ce = xe.length > 0, we = u ?? pe?.size ?? "md", Te = y || !!v || !me && !!pe?.invalid, Ee = b || !me && !!pe?.disabled, De = x || !me && !!pe?.required, Oe = D || C, ke = c === "password", Ae = ke && j && W ? "text" : c, je = N ?? (c === "search" ? /* @__PURE__ */ g(S, {}) : null), Me = P, Ne = On(c, E), Pe = C && !Ee, Fe = O && Ce && !Ee && !Oe && !Pe, Ie = j && ke && !Ee && !Pe && !Fe, Le = !Pe && !Fe && !Ie && !!Me, Re = !!(M && H), ze = r ? `${he}-description` : void 0, Be = v ? `${he}-error` : void 0, G = Re ? `${he}-counter` : void 0, K = [
|
|
2448
|
+
se,
|
|
2449
|
+
!me && !se ? pe?.ariaDescribedBy : void 0,
|
|
1775
2450
|
ze,
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
2451
|
+
Be,
|
|
2452
|
+
G
|
|
2453
|
+
].filter(Boolean).join(" "), Ve = ee ?? "×", He = !!(je || L), Ue = !!(Me || R || Fe || Ie || Pe), We = !!(je && L), Ge = !!(Me && R), Ke = !!(F || I), qe = o((e) => {
|
|
2454
|
+
if (ge.current = e, typeof de == "function") {
|
|
2455
|
+
de(e);
|
|
1780
2456
|
return;
|
|
1781
2457
|
}
|
|
1782
|
-
|
|
1783
|
-
}, [
|
|
1784
|
-
let t =
|
|
1785
|
-
|
|
2458
|
+
de && (de.current = e);
|
|
2459
|
+
}, [de]), Je = o((e) => {
|
|
2460
|
+
let t = An(te ? te(e.target.value) : e.target.value, z);
|
|
2461
|
+
be || ye(t), A?.(t);
|
|
1786
2462
|
}, [
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
]),
|
|
1792
|
-
|
|
2463
|
+
be,
|
|
2464
|
+
z,
|
|
2465
|
+
A,
|
|
2466
|
+
te
|
|
2467
|
+
]), Ye = o(() => {
|
|
2468
|
+
be || ye(""), A?.(""), k?.(), ge.current?.focus();
|
|
1793
2469
|
}, [
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
]),
|
|
1798
|
-
className:
|
|
1799
|
-
[Q.hasAddons]:
|
|
2470
|
+
be,
|
|
2471
|
+
k,
|
|
2472
|
+
A
|
|
2473
|
+
]), Xe = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
|
|
2474
|
+
className: V(Q.inputGroup, Q[m], Q[p], {
|
|
2475
|
+
[Q.hasAddons]: Ke,
|
|
1800
2476
|
[Q.isDisabled]: Ee,
|
|
1801
2477
|
[Q.isInvalid]: Te,
|
|
1802
|
-
[Q.isLoading]:
|
|
2478
|
+
[Q.isLoading]: Pe
|
|
1803
2479
|
}),
|
|
1804
2480
|
children: [
|
|
1805
|
-
|
|
2481
|
+
F && /* @__PURE__ */ g("span", {
|
|
1806
2482
|
className: Q.addon,
|
|
1807
|
-
children:
|
|
2483
|
+
children: F
|
|
1808
2484
|
}),
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
className:
|
|
1811
|
-
[Q.hasLeftAdornment]:
|
|
1812
|
-
[Q.hasRightAdornment]:
|
|
1813
|
-
[Q.hasStartIconAndPrefix]:
|
|
1814
|
-
[Q.hasEndIconAndSuffix]:
|
|
2485
|
+
/* @__PURE__ */ _("div", {
|
|
2486
|
+
className: V(Q.inputWrapper, {
|
|
2487
|
+
[Q.hasLeftAdornment]: He,
|
|
2488
|
+
[Q.hasRightAdornment]: Ue,
|
|
2489
|
+
[Q.hasStartIconAndPrefix]: We,
|
|
2490
|
+
[Q.hasEndIconAndSuffix]: Ge
|
|
1815
2491
|
}),
|
|
1816
2492
|
children: [
|
|
1817
|
-
je && /* @__PURE__ */
|
|
2493
|
+
je && /* @__PURE__ */ g("span", {
|
|
1818
2494
|
"aria-hidden": "true",
|
|
1819
|
-
className:
|
|
2495
|
+
className: V(Q.startAdornment, Dn[ne]),
|
|
1820
2496
|
children: je
|
|
1821
2497
|
}),
|
|
1822
|
-
|
|
2498
|
+
L && /* @__PURE__ */ g("span", {
|
|
1823
2499
|
className: Q.prefix,
|
|
1824
|
-
children:
|
|
2500
|
+
children: L
|
|
1825
2501
|
}),
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
...
|
|
1828
|
-
ref:
|
|
1829
|
-
id:
|
|
2502
|
+
/* @__PURE__ */ g("input", {
|
|
2503
|
+
...ue,
|
|
2504
|
+
ref: qe,
|
|
2505
|
+
id: he,
|
|
1830
2506
|
name: n,
|
|
1831
2507
|
type: Ae,
|
|
1832
2508
|
autoComplete: Ne,
|
|
1833
|
-
className:
|
|
2509
|
+
className: V(Q.input, Q[we], { [Q.error]: Te }, w),
|
|
1834
2510
|
value: Se,
|
|
1835
|
-
onChange:
|
|
2511
|
+
onChange: Je,
|
|
1836
2512
|
placeholder: i,
|
|
1837
2513
|
disabled: Ee,
|
|
1838
2514
|
readOnly: Oe,
|
|
1839
2515
|
required: De,
|
|
1840
|
-
autoFocus:
|
|
1841
|
-
maxLength:
|
|
1842
|
-
"aria-invalid": Te ? !0 :
|
|
1843
|
-
"aria-labelledby":
|
|
1844
|
-
"aria-describedby":
|
|
1845
|
-
"aria-busy":
|
|
1846
|
-
onMouseEnter:
|
|
1847
|
-
onMouseLeave:
|
|
2516
|
+
autoFocus: ae,
|
|
2517
|
+
maxLength: H,
|
|
2518
|
+
"aria-invalid": Te ? !0 : ce,
|
|
2519
|
+
"aria-labelledby": le ?? (me ? void 0 : pe?.ariaLabelledBy),
|
|
2520
|
+
"aria-describedby": K || void 0,
|
|
2521
|
+
"aria-busy": C || void 0,
|
|
2522
|
+
onMouseEnter: U,
|
|
2523
|
+
onMouseLeave: oe
|
|
1848
2524
|
}),
|
|
1849
|
-
R && /* @__PURE__ */
|
|
2525
|
+
R && /* @__PURE__ */ g("span", {
|
|
1850
2526
|
className: Q.suffix,
|
|
1851
2527
|
children: R
|
|
1852
2528
|
}),
|
|
1853
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ _("div", {
|
|
1854
2530
|
className: Q.endSlot,
|
|
1855
2531
|
children: [
|
|
1856
|
-
|
|
2532
|
+
Pe && /* @__PURE__ */ g("span", {
|
|
1857
2533
|
className: Q.spinner,
|
|
1858
2534
|
"aria-hidden": "true",
|
|
1859
2535
|
"data-testid": "input-spinner"
|
|
1860
2536
|
}),
|
|
1861
|
-
|
|
2537
|
+
Ie && /* @__PURE__ */ g("button", {
|
|
1862
2538
|
type: "button",
|
|
1863
2539
|
className: Q.iconButton,
|
|
1864
|
-
onClick: () =>
|
|
1865
|
-
"aria-label":
|
|
1866
|
-
children:
|
|
2540
|
+
onClick: () => _e((e) => !e),
|
|
2541
|
+
"aria-label": W ? "Hide password" : "Show password",
|
|
2542
|
+
children: W ? "Hide" : "Show"
|
|
1867
2543
|
}),
|
|
1868
|
-
|
|
2544
|
+
Fe && /* @__PURE__ */ g("button", {
|
|
1869
2545
|
type: "button",
|
|
1870
|
-
className:
|
|
1871
|
-
onClick:
|
|
2546
|
+
className: V(Q.clearButton, Dn[ie]),
|
|
2547
|
+
onClick: Ye,
|
|
1872
2548
|
"aria-label": "Clear input",
|
|
1873
|
-
children:
|
|
2549
|
+
children: Ve
|
|
1874
2550
|
}),
|
|
1875
|
-
|
|
2551
|
+
Le && Me && /* @__PURE__ */ g("span", {
|
|
1876
2552
|
"aria-hidden": "true",
|
|
1877
|
-
className:
|
|
2553
|
+
className: V(Q.endAdornment, Dn[re]),
|
|
1878
2554
|
children: Me
|
|
1879
2555
|
})
|
|
1880
2556
|
]
|
|
1881
2557
|
})
|
|
1882
2558
|
]
|
|
1883
2559
|
}),
|
|
1884
|
-
|
|
2560
|
+
I && /* @__PURE__ */ g("span", {
|
|
1885
2561
|
className: Q.addon,
|
|
1886
|
-
children:
|
|
2562
|
+
children: I
|
|
1887
2563
|
})
|
|
1888
2564
|
]
|
|
1889
|
-
}),
|
|
1890
|
-
id:
|
|
2565
|
+
}), Re && /* @__PURE__ */ _("div", {
|
|
2566
|
+
id: G,
|
|
1891
2567
|
className: Q.counter,
|
|
1892
2568
|
children: [
|
|
1893
|
-
|
|
2569
|
+
xe.length,
|
|
1894
2570
|
" / ",
|
|
1895
|
-
|
|
2571
|
+
H
|
|
1896
2572
|
]
|
|
1897
2573
|
})] });
|
|
1898
|
-
return !
|
|
1899
|
-
id:
|
|
2574
|
+
return !me && pe ? Xe : /* @__PURE__ */ g(Vt, {
|
|
2575
|
+
id: he,
|
|
1900
2576
|
label: t,
|
|
1901
2577
|
description: r,
|
|
1902
2578
|
error: v,
|
|
@@ -1904,12 +2580,12 @@ var Q = {
|
|
|
1904
2580
|
disabled: Ee,
|
|
1905
2581
|
invalid: Te,
|
|
1906
2582
|
size: we,
|
|
1907
|
-
className:
|
|
2583
|
+
className: T,
|
|
1908
2584
|
bindControl: !1,
|
|
1909
|
-
children:
|
|
2585
|
+
children: Xe
|
|
1910
2586
|
});
|
|
1911
2587
|
});
|
|
1912
|
-
|
|
2588
|
+
jn.displayName = "Input";
|
|
1913
2589
|
var $ = {
|
|
1914
2590
|
root: "_root_qb9nm_1",
|
|
1915
2591
|
invalid: "_invalid_qb9nm_27",
|
|
@@ -1931,89 +2607,89 @@ var $ = {
|
|
|
1931
2607
|
customIcon: "_customIcon_qb9nm_216",
|
|
1932
2608
|
content: "_content_qb9nm_335",
|
|
1933
2609
|
error: "_error_qb9nm_352"
|
|
1934
|
-
},
|
|
2610
|
+
}, Mn = {
|
|
1935
2611
|
primary: $.colorPrimary,
|
|
1936
2612
|
neutral: $.colorNeutral,
|
|
1937
2613
|
success: $.colorSuccess,
|
|
1938
2614
|
warning: $.colorWarning,
|
|
1939
2615
|
danger: $.colorDanger
|
|
1940
|
-
},
|
|
1941
|
-
let S =
|
|
2616
|
+
}, Nn = i(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: s, onCheckedChange: c, label: u, description: d, icon: f, wrapperClassName: p, className: m, id: h, name: v, "aria-describedby": y, ...b }, x) => {
|
|
2617
|
+
let S = ht(), C = l(), w = h ?? C, T = d ? `${w}-description` : void 0, E = s ? `${w}-error` : void 0, D = [
|
|
1942
2618
|
T,
|
|
1943
2619
|
E,
|
|
1944
2620
|
S?.describedBy,
|
|
1945
2621
|
y
|
|
1946
|
-
].filter(Boolean).join(" ") || void 0,
|
|
2622
|
+
].filter(Boolean).join(" ") || void 0, O = S !== null, [k, A] = P({
|
|
1947
2623
|
value: t,
|
|
1948
2624
|
defaultValue: n,
|
|
1949
|
-
onChange:
|
|
1950
|
-
}),
|
|
1951
|
-
if (!
|
|
1952
|
-
if (
|
|
2625
|
+
onChange: c
|
|
2626
|
+
}), j = O ? S.value === e : k, M = !!S?.disabled || r, N = !!S?.required || i, F = S?.name ?? v, I = !!(s || S?.invalid), L = a ?? S?.size ?? "md", R = o ?? S?.color ?? "primary", ee = (t) => {
|
|
2627
|
+
if (!M) {
|
|
2628
|
+
if (O) {
|
|
1953
2629
|
S.onValueChange(e);
|
|
1954
2630
|
return;
|
|
1955
2631
|
}
|
|
1956
|
-
|
|
2632
|
+
A(t.currentTarget.checked);
|
|
1957
2633
|
}
|
|
1958
2634
|
};
|
|
1959
|
-
return /* @__PURE__ */
|
|
1960
|
-
className:
|
|
1961
|
-
children: [/* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ _("div", {
|
|
2636
|
+
className: V($.root, $[L], I && $.invalid, M && $.disabled, Mn[R], m),
|
|
2637
|
+
children: [/* @__PURE__ */ _("label", {
|
|
1962
2638
|
htmlFor: w,
|
|
1963
|
-
className:
|
|
2639
|
+
className: V($.wrapper, p),
|
|
1964
2640
|
children: [
|
|
1965
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ g("input", {
|
|
1966
2642
|
...b,
|
|
1967
2643
|
ref: x,
|
|
1968
2644
|
id: w,
|
|
1969
2645
|
type: "radio",
|
|
1970
2646
|
name: F,
|
|
1971
2647
|
value: e,
|
|
1972
|
-
checked:
|
|
1973
|
-
disabled:
|
|
1974
|
-
required:
|
|
2648
|
+
checked: j,
|
|
2649
|
+
disabled: M,
|
|
2650
|
+
required: N,
|
|
1975
2651
|
"aria-invalid": I || void 0,
|
|
1976
2652
|
"aria-describedby": D,
|
|
1977
2653
|
className: $.input,
|
|
1978
2654
|
onChange: ee
|
|
1979
2655
|
}),
|
|
1980
|
-
/* @__PURE__ */
|
|
2656
|
+
/* @__PURE__ */ g("span", {
|
|
1981
2657
|
className: $.control,
|
|
1982
2658
|
"aria-hidden": "true",
|
|
1983
|
-
children: /* @__PURE__ */
|
|
1984
|
-
className:
|
|
2659
|
+
children: /* @__PURE__ */ g("span", {
|
|
2660
|
+
className: V($.indicator, f && $.customIcon),
|
|
1985
2661
|
children: f
|
|
1986
2662
|
})
|
|
1987
2663
|
}),
|
|
1988
|
-
(u || d) && /* @__PURE__ */
|
|
2664
|
+
(u || d) && /* @__PURE__ */ _("span", {
|
|
1989
2665
|
className: $.content,
|
|
1990
|
-
children: [u && /* @__PURE__ */
|
|
2666
|
+
children: [u && /* @__PURE__ */ g("span", {
|
|
1991
2667
|
className: $.label,
|
|
1992
2668
|
children: u
|
|
1993
|
-
}), d && /* @__PURE__ */
|
|
2669
|
+
}), d && /* @__PURE__ */ g("span", {
|
|
1994
2670
|
id: T,
|
|
1995
2671
|
className: $.description,
|
|
1996
2672
|
children: d
|
|
1997
2673
|
})]
|
|
1998
2674
|
})
|
|
1999
2675
|
]
|
|
2000
|
-
}), s && /* @__PURE__ */
|
|
2676
|
+
}), s && /* @__PURE__ */ g("div", {
|
|
2001
2677
|
id: E,
|
|
2002
2678
|
className: $.error,
|
|
2003
2679
|
children: s
|
|
2004
2680
|
})]
|
|
2005
2681
|
});
|
|
2006
2682
|
});
|
|
2007
|
-
|
|
2683
|
+
Nn.displayName = "Radio";
|
|
2008
2684
|
//#endregion
|
|
2009
2685
|
//#region src/theme/ThemeContext.ts
|
|
2010
|
-
var
|
|
2011
|
-
let [i, a] =
|
|
2686
|
+
var Pn = r(null), Fn = (e) => e === "highContrast" ? "high-contrast" : e, In = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
2687
|
+
let [i, a] = P({
|
|
2012
2688
|
value: e,
|
|
2013
2689
|
defaultValue: t,
|
|
2014
2690
|
onChange: n
|
|
2015
|
-
}), o =
|
|
2016
|
-
|
|
2691
|
+
}), o = Fn(i);
|
|
2692
|
+
c(() => {
|
|
2017
2693
|
if (typeof document > "u") return;
|
|
2018
2694
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
2019
2695
|
return e.dataset.velliraTheme = o, () => {
|
|
@@ -2024,25 +2700,25 @@ var Bt = n(null), Vt = (e) => e === "highContrast" ? "high-contrast" : e, Ht = (
|
|
|
2024
2700
|
e.dataset.velliraTheme = t;
|
|
2025
2701
|
};
|
|
2026
2702
|
}, [o]);
|
|
2027
|
-
let
|
|
2703
|
+
let s = u(() => ({
|
|
2028
2704
|
theme: i,
|
|
2029
2705
|
setTheme: a
|
|
2030
2706
|
}), [i, a]);
|
|
2031
|
-
return /* @__PURE__ */
|
|
2032
|
-
value:
|
|
2033
|
-
children: /* @__PURE__ */
|
|
2707
|
+
return /* @__PURE__ */ g(Pn.Provider, {
|
|
2708
|
+
value: s,
|
|
2709
|
+
children: /* @__PURE__ */ g("div", {
|
|
2034
2710
|
"data-vellira-theme": o,
|
|
2035
2711
|
children: r
|
|
2036
2712
|
})
|
|
2037
2713
|
});
|
|
2038
2714
|
};
|
|
2039
|
-
|
|
2715
|
+
In.displayName = "ThemeProvider";
|
|
2040
2716
|
//#endregion
|
|
2041
2717
|
//#region src/theme/useTheme.ts
|
|
2042
|
-
function
|
|
2043
|
-
let e =
|
|
2718
|
+
function Ln() {
|
|
2719
|
+
let e = s(Pn);
|
|
2044
2720
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
2045
2721
|
return e;
|
|
2046
2722
|
}
|
|
2047
2723
|
//#endregion
|
|
2048
|
-
export {
|
|
2724
|
+
export { xn as Button, En as Checkbox, Ye as Dropdown, Vt as FormField, jn as Input, ft as Modal, Nn as Radio, _t as RadioGroup, an as Select, gn as Tabs, In as ThemeProvider, yn as Tooltip, Ln as useTheme };
|