@vellira-ui/react 2.30.0 → 2.31.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 +35 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +1133 -644
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { FloatingPortal as
|
|
6
|
-
import { useControllableState as
|
|
7
|
-
import { Check as
|
|
8
|
-
import
|
|
1
|
+
import { Children as e, cloneElement as t, createContext as n, forwardRef as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
2
|
+
import f from "clsx";
|
|
3
|
+
import { createPortal as p } from "react-dom";
|
|
4
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import { FloatingPortal as _, arrow as v, autoUpdate as y, flip as b, offset as x, shift as S, size as C, useFloating as w, useFocus as T, useHover as E, useInteractions as D } from "@floating-ui/react";
|
|
6
|
+
import { useControllableState as O, useDropdown as k, useModal as A, useSelect as j, useTabs as M, useTabsKeyboard as N } from "@vellira-ui/core";
|
|
7
|
+
import { Check as P, ChevronDown as F, Close as I, Search as L } from "@vellira-ui/icons";
|
|
8
|
+
import R from "focus-trap-react";
|
|
9
9
|
//#region src/utils/cn.ts
|
|
10
|
-
var
|
|
11
|
-
let [t, n] =
|
|
12
|
-
if (
|
|
10
|
+
var z = (...e) => f(e), ee = ({ children: e }) => {
|
|
11
|
+
let [t, n] = d(!1);
|
|
12
|
+
if (s(() => {
|
|
13
13
|
n(!0);
|
|
14
14
|
}, []), !t) return null;
|
|
15
15
|
let r = document.getElementById("overlay-root") ?? document.body;
|
|
16
|
-
return r ?
|
|
16
|
+
return r ? p(e, r) : null;
|
|
17
17
|
}, B = {
|
|
18
18
|
dropdown: "_dropdown_1rvx9_1",
|
|
19
19
|
"dropdown-in": "_dropdown-in_1rvx9_1"
|
|
20
|
-
},
|
|
20
|
+
}, te = r(({ children: e, floatingStyles: t, menuId: n, labelledById: r, label: i, activeDescendantId: a, onKeyDown: o, className: s }, c) => /* @__PURE__ */ h(ee, { children: /* @__PURE__ */ h("ul", {
|
|
21
21
|
ref: c,
|
|
22
22
|
id: n,
|
|
23
23
|
role: "menu",
|
|
@@ -27,60 +27,61 @@ var R = (...e) => d(e), z = ({ children: e }) => {
|
|
|
27
27
|
"aria-activedescendant": a,
|
|
28
28
|
onKeyDown: o,
|
|
29
29
|
style: t,
|
|
30
|
-
className:
|
|
30
|
+
className: z(B.dropdown, s),
|
|
31
31
|
children: e
|
|
32
32
|
}) }));
|
|
33
|
-
|
|
33
|
+
te.displayName = "DropdownContent";
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/hooks/useFloatingPosition.ts
|
|
36
|
-
var
|
|
37
|
-
let [t, n] =
|
|
38
|
-
return
|
|
36
|
+
var ne = (e) => {
|
|
37
|
+
let [t, n] = d(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
38
|
+
return s(() => {
|
|
39
39
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
40
40
|
let t = window.matchMedia(`(max-width: ${e}px)`), r = () => n(t.matches);
|
|
41
41
|
return r(), t.addEventListener("change", r), () => {
|
|
42
42
|
t.removeEventListener("change", r);
|
|
43
43
|
};
|
|
44
44
|
}, [e]), t;
|
|
45
|
-
},
|
|
46
|
-
let
|
|
45
|
+
}, re = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: i = !1, avoidCollisions: a = !0, mobileSheetBreakpoint: o, middleware: c = [] } = {}) => {
|
|
46
|
+
let u = ne(o), { refs: d, floatingStyles: f, update: p, context: m, middlewareData: h, placement: g } = w({
|
|
47
47
|
open: e,
|
|
48
48
|
onOpenChange: t,
|
|
49
49
|
placement: n,
|
|
50
50
|
strategy: r,
|
|
51
51
|
transform: !1,
|
|
52
|
-
middleware:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
!i ||
|
|
52
|
+
middleware: l(() => [
|
|
53
|
+
x(2),
|
|
54
|
+
...a ? [b()] : [],
|
|
55
|
+
C({ apply({ rects: e, elements: t }) {
|
|
56
|
+
!i || u || Object.assign(t.floating.style, { width: `${e.reference.width}px` });
|
|
57
57
|
} }),
|
|
58
|
-
|
|
59
|
-
...
|
|
58
|
+
...a ? [S({ padding: 8 })] : [],
|
|
59
|
+
...c
|
|
60
60
|
], [
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
a,
|
|
62
|
+
c,
|
|
63
|
+
u,
|
|
63
64
|
i
|
|
64
65
|
]),
|
|
65
|
-
whileElementsMounted:
|
|
66
|
+
whileElementsMounted: y
|
|
66
67
|
});
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
context:
|
|
71
|
-
placement:
|
|
72
|
-
middlewareData:
|
|
73
|
-
floatingStyles:
|
|
74
|
-
isMobileSheet:
|
|
75
|
-
setRef:
|
|
76
|
-
setFloatingRef:
|
|
77
|
-
updatePosition:
|
|
68
|
+
return s(() => {
|
|
69
|
+
u && d.floating.current?.style.removeProperty("width");
|
|
70
|
+
}, [u, d.floating]), {
|
|
71
|
+
context: m,
|
|
72
|
+
placement: g,
|
|
73
|
+
middlewareData: h,
|
|
74
|
+
floatingStyles: u ? {} : f,
|
|
75
|
+
isMobileSheet: u,
|
|
76
|
+
setRef: d.setReference,
|
|
77
|
+
setFloatingRef: d.setFloating,
|
|
78
|
+
updatePosition: p
|
|
78
79
|
};
|
|
79
|
-
},
|
|
80
|
-
let r =
|
|
80
|
+
}, ie = (e, t, n = !0) => {
|
|
81
|
+
let r = u(e);
|
|
81
82
|
r.current = e;
|
|
82
|
-
let i =
|
|
83
|
-
i.current = t,
|
|
83
|
+
let i = u(t);
|
|
84
|
+
i.current = t, s(() => {
|
|
84
85
|
if (!n) return;
|
|
85
86
|
let e = (e) => {
|
|
86
87
|
let t = e.target;
|
|
@@ -88,11 +89,11 @@ var H = (e) => {
|
|
|
88
89
|
};
|
|
89
90
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
90
91
|
}, [n]);
|
|
91
|
-
},
|
|
92
|
+
}, ae = { group: "_group_aviwv_1" }, oe = ({ label: e }) => /* @__PURE__ */ h("li", {
|
|
92
93
|
role: "presentation",
|
|
93
|
-
className:
|
|
94
|
+
className: ae.group,
|
|
94
95
|
children: e
|
|
95
|
-
}),
|
|
96
|
+
}), V = {
|
|
96
97
|
item: "_item_re11y_1",
|
|
97
98
|
disabled: "_disabled_re11y_21",
|
|
98
99
|
active: "_active_re11y_34",
|
|
@@ -103,9 +104,9 @@ var H = (e) => {
|
|
|
103
104
|
"itemText--truncate": "_itemText--truncate_re11y_88",
|
|
104
105
|
"itemText--wrap": "_itemText--wrap_re11y_93",
|
|
105
106
|
"itemText--nowrap": "_itemText--nowrap_re11y_97"
|
|
106
|
-
},
|
|
107
|
+
}, se = ({ id: e, children: t, label: n, icon: r, danger: i, disabled: a, active: o, onClick: s, onMouseEnter: c, shortcut: l, textWrap: u = "truncate", className: d }) => {
|
|
107
108
|
let f = t || n;
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ g("li", {
|
|
109
110
|
id: e,
|
|
110
111
|
role: "menuitem",
|
|
111
112
|
tabIndex: -1,
|
|
@@ -114,32 +115,32 @@ var H = (e) => {
|
|
|
114
115
|
"data-danger": i || void 0,
|
|
115
116
|
onClick: a ? void 0 : s,
|
|
116
117
|
onMouseEnter: a ? void 0 : c,
|
|
117
|
-
className:
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
118
|
+
className: z(V.item, {
|
|
119
|
+
[V.active]: o,
|
|
120
|
+
[V.disabled]: a,
|
|
121
|
+
[V.danger]: i
|
|
121
122
|
}, d),
|
|
122
123
|
children: [
|
|
123
|
-
r && /* @__PURE__ */
|
|
124
|
+
r && /* @__PURE__ */ h("span", {
|
|
124
125
|
"aria-hidden": "true",
|
|
125
|
-
className:
|
|
126
|
+
className: V.itemIcon,
|
|
126
127
|
children: r
|
|
127
128
|
}),
|
|
128
|
-
f && /* @__PURE__ */
|
|
129
|
-
className:
|
|
129
|
+
f && /* @__PURE__ */ h("span", {
|
|
130
|
+
className: z(V.itemText, V[`itemText--${u}`]),
|
|
130
131
|
children: f
|
|
131
132
|
}),
|
|
132
|
-
l && /* @__PURE__ */
|
|
133
|
-
className:
|
|
133
|
+
l && /* @__PURE__ */ h("span", {
|
|
134
|
+
className: V.itemShortcut,
|
|
134
135
|
children: l
|
|
135
136
|
})
|
|
136
137
|
]
|
|
137
138
|
});
|
|
138
|
-
},
|
|
139
|
+
}, ce = { separator: "_separator_1v11r_1" }, le = () => /* @__PURE__ */ h("li", {
|
|
139
140
|
role: "separator",
|
|
140
|
-
className:
|
|
141
|
+
className: ce.separator,
|
|
141
142
|
"aria-hidden": "true"
|
|
142
|
-
}),
|
|
143
|
+
}), ue = {
|
|
143
144
|
button: "_button_18ucr_1",
|
|
144
145
|
disabled: "_disabled_18ucr_20",
|
|
145
146
|
iconLeft: "_iconLeft_18ucr_32",
|
|
@@ -149,72 +150,72 @@ var H = (e) => {
|
|
|
149
150
|
md: "_md_18ucr_72",
|
|
150
151
|
lg: "_lg_18ucr_84",
|
|
151
152
|
open: "_open_18ucr_123"
|
|
152
|
-
},
|
|
153
|
-
let f = !!n, p = !!e,
|
|
154
|
-
return /* @__PURE__ */
|
|
153
|
+
}, de = r(({ children: e, isOpen: t, icon: n, arrowIcon: r, showArrow: i = !0, rotateAngle: a = 90, size: o = "md", label: s, ariaLabel: c, className: l, ...u }, d) => {
|
|
154
|
+
let f = !!n, p = !!e, m = f && !p, _ = i && p, v = r ?? /* @__PURE__ */ h(F, {}), y = c ?? (m ? typeof s == "string" ? s : "Open menu" : void 0);
|
|
155
|
+
return /* @__PURE__ */ g("button", {
|
|
155
156
|
...u,
|
|
156
157
|
ref: d,
|
|
157
158
|
type: "button",
|
|
158
|
-
className:
|
|
159
|
-
[
|
|
160
|
-
[
|
|
159
|
+
className: z(ue.button, ue[o], {
|
|
160
|
+
[ue.disabled]: u.disabled,
|
|
161
|
+
[ue.iconOnly]: m
|
|
161
162
|
}, l),
|
|
162
163
|
"aria-label": y,
|
|
163
164
|
"aria-expanded": t,
|
|
164
165
|
"aria-haspopup": "menu",
|
|
165
166
|
style: { "--dropdown-rotate-angle": `${a}deg` },
|
|
166
167
|
children: [
|
|
167
|
-
f && /* @__PURE__ */
|
|
168
|
+
f && /* @__PURE__ */ h("span", {
|
|
168
169
|
"aria-hidden": "true",
|
|
169
|
-
className:
|
|
170
|
+
className: ue.iconLeft,
|
|
170
171
|
children: n
|
|
171
172
|
}),
|
|
172
173
|
e,
|
|
173
|
-
_ && /* @__PURE__ */
|
|
174
|
+
_ && /* @__PURE__ */ h("span", {
|
|
174
175
|
"aria-hidden": "true",
|
|
175
|
-
className:
|
|
176
|
+
className: z(ue.arrow, { [ue.open]: t }),
|
|
176
177
|
children: v
|
|
177
178
|
})
|
|
178
179
|
]
|
|
179
180
|
});
|
|
180
181
|
});
|
|
181
|
-
|
|
182
|
+
de.displayName = "DropdownTrigger";
|
|
182
183
|
//#endregion
|
|
183
184
|
//#region src/components/Dropdown/types.ts
|
|
184
|
-
var
|
|
185
|
-
let D =
|
|
185
|
+
var fe = (e) => e.type === void 0 || e.type === "item", pe = (e) => e.type === "group", me = (e) => e.type === "separator", he = { wrapper: "_wrapper_14ue8_1" }, ge = ({ label: e, ariaLabel: t, icon: n, trigger: r, items: i = [], onSelect: o, open: s, defaultOpen: d = !1, onOpenChange: f, size: p = "md", className: m, triggerClassName: _, contentClassName: v, itemClassName: y, disabled: b, rotateAngle: x = 90, placement: S, matchTriggerWidth: C, textWrap: w, showArrow: T = !0, arrowIcon: E }) => {
|
|
186
|
+
let D = u(null), O = u(null), A = c(), j = `${A}-trigger`, { floatingStyles: M, setRef: N, setFloatingRef: P } = re({
|
|
186
187
|
placement: S,
|
|
187
188
|
matchTriggerWidth: C,
|
|
188
189
|
mobileSheetBreakpoint: 640
|
|
189
|
-
}), F =
|
|
190
|
+
}), F = l(() => i.flatMap((e, t) => fe(e) ? [{
|
|
190
191
|
item: e,
|
|
191
192
|
itemIndex: t
|
|
192
|
-
}] : []), [
|
|
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({
|
|
193
194
|
items: I,
|
|
194
|
-
open:
|
|
195
|
+
open: s,
|
|
195
196
|
defaultOpen: d,
|
|
196
197
|
disabled: b,
|
|
197
198
|
onOpenChange: f,
|
|
198
|
-
onSelect:
|
|
199
|
+
onSelect: a((e) => {
|
|
199
200
|
o?.(e), D.current?.focus();
|
|
200
201
|
}, [o]),
|
|
201
202
|
getItemValue: (e) => e.value,
|
|
202
203
|
getItemText: (e) => typeof e.label == "string" ? e.label : e.value
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
}, [
|
|
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) => {
|
|
208
209
|
D.current = e, N(e);
|
|
209
|
-
}, [N]),
|
|
210
|
-
|
|
210
|
+
}, [N]), ve = a((e) => {
|
|
211
|
+
O.current = e, P(e), e?.focus();
|
|
211
212
|
}, [P]);
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
className:
|
|
214
|
-
children: [/* @__PURE__ */
|
|
215
|
-
ref:
|
|
213
|
+
return /* @__PURE__ */ g("div", {
|
|
214
|
+
className: z(he.wrapper, m),
|
|
215
|
+
children: [/* @__PURE__ */ h(de, {
|
|
216
|
+
ref: _e,
|
|
216
217
|
id: j,
|
|
217
|
-
isOpen:
|
|
218
|
+
isOpen: B,
|
|
218
219
|
disabled: b,
|
|
219
220
|
size: p,
|
|
220
221
|
icon: n,
|
|
@@ -224,37 +225,37 @@ var ce = (e) => e.type === void 0 || e.type === "item", le = (e) => e.type === "
|
|
|
224
225
|
arrowIcon: E,
|
|
225
226
|
rotateAngle: x,
|
|
226
227
|
className: _,
|
|
227
|
-
onClick:
|
|
228
|
-
onKeyDown:
|
|
229
|
-
"aria-expanded":
|
|
228
|
+
onClick: ae,
|
|
229
|
+
onKeyDown: ge,
|
|
230
|
+
"aria-expanded": B,
|
|
230
231
|
"aria-haspopup": "menu",
|
|
231
|
-
...
|
|
232
|
+
...B && { "aria-controls": A },
|
|
232
233
|
children: r
|
|
233
|
-
}),
|
|
234
|
-
ref:
|
|
234
|
+
}), B && /* @__PURE__ */ h(te, {
|
|
235
|
+
ref: ve,
|
|
235
236
|
floatingStyles: M,
|
|
236
237
|
menuId: A,
|
|
237
238
|
labelledById: r ? j : void 0,
|
|
238
239
|
label: t ?? (!r && typeof e == "string" ? e : void 0),
|
|
239
|
-
activeDescendantId:
|
|
240
|
-
onKeyDown:
|
|
240
|
+
activeDescendantId: ue,
|
|
241
|
+
onKeyDown: ge,
|
|
241
242
|
className: v,
|
|
242
|
-
children:
|
|
243
|
-
if (
|
|
244
|
-
if (
|
|
245
|
-
if (
|
|
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)) {
|
|
246
247
|
let n = L.get(t) ?? -1;
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
+
return /* @__PURE__ */ h(se, {
|
|
248
249
|
id: `${A}-item-${n}`,
|
|
249
250
|
...e,
|
|
250
|
-
active:
|
|
251
|
+
active: R === n,
|
|
251
252
|
textWrap: e.textWrap || w,
|
|
252
253
|
className: y,
|
|
253
254
|
onClick: () => {
|
|
254
|
-
|
|
255
|
+
V(e), D.current?.focus();
|
|
255
256
|
},
|
|
256
257
|
onMouseEnter: () => {
|
|
257
|
-
n < 0 || e.disabled ||
|
|
258
|
+
n < 0 || e.disabled || ee(n);
|
|
258
259
|
},
|
|
259
260
|
children: e.label
|
|
260
261
|
}, `${e.value}-${t}`);
|
|
@@ -262,142 +263,142 @@ var ce = (e) => e.type === void 0 || e.type === "item", le = (e) => e.type === "
|
|
|
262
263
|
})
|
|
263
264
|
})]
|
|
264
265
|
});
|
|
265
|
-
},
|
|
266
|
-
let e =
|
|
266
|
+
}, _e = n(void 0), ve = () => {
|
|
267
|
+
let e = o(_e);
|
|
267
268
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
268
269
|
return e;
|
|
269
270
|
};
|
|
270
|
-
|
|
271
|
-
var
|
|
272
|
-
let { descriptionId: t } =
|
|
273
|
-
return /* @__PURE__ */
|
|
271
|
+
_e.displayName = "ModalContext";
|
|
272
|
+
var ye = { modalBody: "_modalBody_iv33a_1" }, be = ({ children: e }) => {
|
|
273
|
+
let { descriptionId: t } = ve();
|
|
274
|
+
return /* @__PURE__ */ h("div", {
|
|
274
275
|
id: t,
|
|
275
|
-
className:
|
|
276
|
+
className: ye.modalBody,
|
|
276
277
|
children: e
|
|
277
278
|
});
|
|
278
279
|
};
|
|
279
|
-
|
|
280
|
-
var
|
|
281
|
-
className:
|
|
280
|
+
be.displayName = "ModalBody";
|
|
281
|
+
var xe = { content: "_content_k44g7_1" }, H = ({ children: e }) => /* @__PURE__ */ h("div", {
|
|
282
|
+
className: xe.content,
|
|
282
283
|
children: e
|
|
283
284
|
});
|
|
284
|
-
|
|
285
|
-
var
|
|
286
|
-
className:
|
|
285
|
+
H.displayName = "ModalContent";
|
|
286
|
+
var U = { modalFooter: "_modalFooter_ezys6_1" }, W = ({ children: e }) => /* @__PURE__ */ h("div", {
|
|
287
|
+
className: U.modalFooter,
|
|
287
288
|
children: e
|
|
288
289
|
});
|
|
289
|
-
|
|
290
|
-
var
|
|
290
|
+
W.displayName = "ModalFooter";
|
|
291
|
+
var Se = {
|
|
291
292
|
modalHeader: "_modalHeader_p8xf1_1",
|
|
292
293
|
modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
|
|
293
294
|
modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
|
|
294
|
-
},
|
|
295
|
-
let { onClose: t, titleId: n } =
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
className:
|
|
298
|
-
children: [/* @__PURE__ */
|
|
295
|
+
}, Ce = ({ children: e }) => {
|
|
296
|
+
let { onClose: t, titleId: n } = ve();
|
|
297
|
+
return /* @__PURE__ */ g("div", {
|
|
298
|
+
className: Se.modalHeader,
|
|
299
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
299
300
|
id: n,
|
|
300
|
-
className:
|
|
301
|
+
className: Se.modalHeaderTitle,
|
|
301
302
|
children: e
|
|
302
|
-
}), t && /* @__PURE__ */
|
|
303
|
+
}), t && /* @__PURE__ */ h("button", {
|
|
303
304
|
type: "button",
|
|
304
|
-
className:
|
|
305
|
+
className: Se.modalHeaderCloseButton,
|
|
305
306
|
onClick: t,
|
|
306
307
|
"aria-label": "Close modal",
|
|
307
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ h(I, { size: 16 })
|
|
308
309
|
})]
|
|
309
310
|
});
|
|
310
311
|
};
|
|
311
|
-
|
|
312
|
+
Ce.displayName = "ModalHeader";
|
|
312
313
|
//#endregion
|
|
313
314
|
//#region src/hooks/useModalKeyboard.ts
|
|
314
|
-
var
|
|
315
|
-
let n =
|
|
315
|
+
var we = ({ isOpen: e, onClose: t }) => {
|
|
316
|
+
let n = a((n) => {
|
|
316
317
|
e && n.key === "Escape" && (n.preventDefault(), t?.());
|
|
317
318
|
}, [e, t]);
|
|
318
|
-
|
|
319
|
-
},
|
|
319
|
+
s(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
|
|
320
|
+
}, Te = {
|
|
320
321
|
overlay: "_overlay_dcudn_1",
|
|
321
322
|
"overlay--open": "_overlay--open_dcudn_14",
|
|
322
323
|
modal: "_modal_dcudn_20",
|
|
323
324
|
"overlay--animated": "_overlay--animated_dcudn_28"
|
|
324
|
-
},
|
|
325
|
-
let f =
|
|
325
|
+
}, Ee = 0, De = "", Oe = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: i, closeOnClick: o, closeOnEsc: c = !0, zIndex: l = 1e3, animated: d = !0 }) => {
|
|
326
|
+
let f = i ?? o ?? !0, p = u(null), { titleId: m, descriptionId: g } = ve(), _ = a((e) => {
|
|
326
327
|
f && e.target === e.currentTarget && t?.();
|
|
327
328
|
}, [f, t]);
|
|
328
|
-
return
|
|
329
|
+
return we({
|
|
329
330
|
isOpen: n,
|
|
330
331
|
onClose: c ? t : void 0
|
|
331
|
-
}),
|
|
332
|
-
if (n) return
|
|
333
|
-
|
|
332
|
+
}), s(() => {
|
|
333
|
+
if (n) return Ee === 0 && (De = document.body.style.overflow), Ee += 1, document.body.style.overflow = "hidden", () => {
|
|
334
|
+
Ee = Math.max(0, Ee - 1), Ee === 0 && (document.body.style.overflow = De);
|
|
334
335
|
};
|
|
335
|
-
}, [n]), !n && !d ? null : /* @__PURE__ */
|
|
336
|
-
className:
|
|
336
|
+
}, [n]), !n && !d ? null : /* @__PURE__ */ h(ee, { children: /* @__PURE__ */ h("div", {
|
|
337
|
+
className: z(Te.overlay, n && Te["overlay--open"], d && Te["overlay--animated"], r),
|
|
337
338
|
onClick: _,
|
|
338
339
|
tabIndex: -1,
|
|
339
340
|
role: "presentation",
|
|
340
341
|
"aria-hidden": !n,
|
|
341
|
-
style: { zIndex:
|
|
342
|
-
children: /* @__PURE__ */
|
|
342
|
+
style: { zIndex: l },
|
|
343
|
+
children: /* @__PURE__ */ h(R, {
|
|
343
344
|
active: n,
|
|
344
345
|
focusTrapOptions: {
|
|
345
346
|
fallbackFocus: () => p.current,
|
|
346
347
|
returnFocusOnDeactivate: !0,
|
|
347
348
|
allowOutsideClick: !0
|
|
348
349
|
},
|
|
349
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ h("div", {
|
|
350
351
|
ref: p,
|
|
351
352
|
tabIndex: -1,
|
|
352
|
-
className:
|
|
353
|
+
className: Te.modal,
|
|
353
354
|
role: "dialog",
|
|
354
355
|
"aria-modal": "true",
|
|
355
|
-
"aria-labelledby":
|
|
356
|
+
"aria-labelledby": m,
|
|
356
357
|
"aria-describedby": g,
|
|
357
358
|
children: e
|
|
358
359
|
})
|
|
359
360
|
})
|
|
360
361
|
}) });
|
|
361
362
|
};
|
|
362
|
-
|
|
363
|
+
Oe.displayName = "ModalOverlay";
|
|
363
364
|
//#endregion
|
|
364
365
|
//#region src/components/Modal/Modal.tsx
|
|
365
|
-
var
|
|
366
|
-
let o =
|
|
366
|
+
var ke = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
|
|
367
|
+
let o = A({
|
|
367
368
|
isOpen: e,
|
|
368
369
|
onClose: n,
|
|
369
370
|
closeOnBackdrop: r,
|
|
370
371
|
closeOnClick: i,
|
|
371
372
|
closeOnEsc: a
|
|
372
373
|
});
|
|
373
|
-
return o.shouldRender ? /* @__PURE__ */
|
|
374
|
+
return o.shouldRender ? /* @__PURE__ */ h(_e.Provider, {
|
|
374
375
|
value: {
|
|
375
376
|
onClose: o.onClose,
|
|
376
377
|
titleId: o.titleId,
|
|
377
378
|
descriptionId: o.descriptionId
|
|
378
379
|
},
|
|
379
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ h(Oe, {
|
|
380
381
|
isOpen: o.isOpen,
|
|
381
382
|
onClose: o.onClose,
|
|
382
383
|
closeOnBackdrop: o.closeOnBackdrop,
|
|
383
384
|
closeOnEsc: o.closeOnEsc,
|
|
384
|
-
children: /* @__PURE__ */
|
|
385
|
+
children: /* @__PURE__ */ h(H, { children: t })
|
|
385
386
|
})
|
|
386
387
|
}) : null;
|
|
387
388
|
};
|
|
388
|
-
|
|
389
|
+
ke.displayName = "Modal";
|
|
389
390
|
//#endregion
|
|
390
391
|
//#region src/components/Modal/index.ts
|
|
391
|
-
var
|
|
392
|
-
Header:
|
|
393
|
-
Body:
|
|
394
|
-
Content:
|
|
395
|
-
Footer:
|
|
396
|
-
}),
|
|
397
|
-
function
|
|
398
|
-
return
|
|
392
|
+
var Ae = Object.assign(ke, {
|
|
393
|
+
Header: Ce,
|
|
394
|
+
Body: be,
|
|
395
|
+
Content: H,
|
|
396
|
+
Footer: W
|
|
397
|
+
}), je = n(null), Me = je.Provider;
|
|
398
|
+
function Ne() {
|
|
399
|
+
return o(je);
|
|
399
400
|
}
|
|
400
|
-
var
|
|
401
|
+
var G = {
|
|
401
402
|
root: "_root_1n02e_1",
|
|
402
403
|
label: "_label_1n02e_9",
|
|
403
404
|
required: "_required_1n02e_21",
|
|
@@ -408,13 +409,13 @@ var q = {
|
|
|
408
409
|
error: "_error_1n02e_51",
|
|
409
410
|
disabled: "_disabled_1n02e_59",
|
|
410
411
|
invalid: "_invalid_1n02e_75"
|
|
411
|
-
},
|
|
412
|
-
let b =
|
|
412
|
+
}, Pe = r(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: s, label: l, description: u, error: d, orientation: f = "vertical", children: p, className: m, id: _, ...v }, y) => {
|
|
413
|
+
let b = c(), x = _ ?? b, S = l ? `${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, k] = O({
|
|
413
414
|
value: e,
|
|
414
415
|
defaultValue: t,
|
|
415
416
|
onChange: n
|
|
416
417
|
}), A = !!d;
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
+
return /* @__PURE__ */ g("div", {
|
|
418
419
|
...v,
|
|
419
420
|
ref: y,
|
|
420
421
|
id: x,
|
|
@@ -424,26 +425,26 @@ var q = {
|
|
|
424
425
|
"aria-disabled": r || void 0,
|
|
425
426
|
"aria-required": i || void 0,
|
|
426
427
|
"aria-invalid": A || void 0,
|
|
427
|
-
className:
|
|
428
|
+
className: z(G.root, A && G.invalid, r && G.disabled, m),
|
|
428
429
|
children: [
|
|
429
|
-
l && /* @__PURE__ */
|
|
430
|
+
l && /* @__PURE__ */ g("div", {
|
|
430
431
|
id: S,
|
|
431
|
-
className:
|
|
432
|
-
children: [l, i && /* @__PURE__ */
|
|
433
|
-
className:
|
|
432
|
+
className: G.label,
|
|
433
|
+
children: [l, i && /* @__PURE__ */ h("span", {
|
|
434
|
+
className: G.required,
|
|
434
435
|
"aria-hidden": "true",
|
|
435
436
|
children: "*"
|
|
436
437
|
})]
|
|
437
438
|
}),
|
|
438
|
-
u && /* @__PURE__ */
|
|
439
|
+
u && /* @__PURE__ */ h("div", {
|
|
439
440
|
id: C,
|
|
440
|
-
className:
|
|
441
|
+
className: G.description,
|
|
441
442
|
children: u
|
|
442
443
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ h(Me, {
|
|
444
445
|
value: {
|
|
445
446
|
name: E,
|
|
446
|
-
value:
|
|
447
|
+
value: D,
|
|
447
448
|
disabled: r,
|
|
448
449
|
required: i,
|
|
449
450
|
invalid: A,
|
|
@@ -452,23 +453,23 @@ var q = {
|
|
|
452
453
|
describedBy: T,
|
|
453
454
|
onValueChange: k
|
|
454
455
|
},
|
|
455
|
-
children: /* @__PURE__ */
|
|
456
|
-
className:
|
|
456
|
+
children: /* @__PURE__ */ h("div", {
|
|
457
|
+
className: z(G.items, G[f]),
|
|
457
458
|
children: p
|
|
458
459
|
})
|
|
459
460
|
}),
|
|
460
|
-
d && /* @__PURE__ */
|
|
461
|
+
d && /* @__PURE__ */ h("div", {
|
|
461
462
|
id: w,
|
|
462
|
-
className:
|
|
463
|
+
className: G.error,
|
|
463
464
|
children: d
|
|
464
465
|
})
|
|
465
466
|
]
|
|
466
467
|
});
|
|
467
468
|
});
|
|
468
|
-
|
|
469
|
+
Pe.displayName = "RadioGroup";
|
|
469
470
|
//#endregion
|
|
470
471
|
//#region src/patterns/FormField/FormFieldContext.ts
|
|
471
|
-
var
|
|
472
|
+
var Fe = n(null), Ie = () => o(Fe), K = {
|
|
472
473
|
wrapper: "_wrapper_143kr_1",
|
|
473
474
|
sm: "_sm_143kr_41",
|
|
474
475
|
md: "_md_143kr_78",
|
|
@@ -484,311 +485,799 @@ var Me = t(null), Ne = () => a(Me), J = {
|
|
|
484
485
|
optional: "_optional_143kr_194",
|
|
485
486
|
labelInfo: "_labelInfo_143kr_201",
|
|
486
487
|
disabled: "_disabled_143kr_243"
|
|
487
|
-
},
|
|
488
|
-
let T =
|
|
488
|
+
}, Le = (...e) => e.filter(Boolean).join(" ") || void 0, Re = ({ id: e, label: n, description: r, error: a, required: o = !1, disabled: s = !1, invalid: l = !1, orientation: u = "vertical", labelPosition: d = "top", size: f = "md", labelInfo: p, optionalText: m, children: _, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
|
|
489
|
+
let T = c(), E = e ?? T, D = n ? `${E}-label` : void 0, O = r && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = l || !!a, j = Le(D), M = Le(O, k), N = {
|
|
489
490
|
controlId: E,
|
|
490
491
|
labelId: D,
|
|
491
492
|
descriptionId: O,
|
|
492
493
|
errorId: k,
|
|
493
494
|
required: o,
|
|
494
|
-
disabled:
|
|
495
|
+
disabled: s,
|
|
495
496
|
invalid: A,
|
|
496
497
|
size: f,
|
|
497
498
|
ariaLabelledBy: j,
|
|
498
499
|
ariaDescribedBy: M
|
|
499
|
-
}, P =
|
|
500
|
+
}, P = i(_) ? _ : void 0, F = v && P ? t(P, {
|
|
500
501
|
id: P.props.id ?? E,
|
|
501
502
|
required: P.props.required ?? o,
|
|
502
|
-
disabled: P.props.disabled ??
|
|
503
|
+
disabled: P.props.disabled ?? s,
|
|
503
504
|
"aria-invalid": P.props["aria-invalid"] ?? (A || void 0),
|
|
504
|
-
"aria-labelledby":
|
|
505
|
-
"aria-describedby":
|
|
505
|
+
"aria-labelledby": Le(P.props["aria-labelledby"], j),
|
|
506
|
+
"aria-describedby": Le(P.props["aria-describedby"], M)
|
|
506
507
|
}) : _;
|
|
507
|
-
return /* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ g("div", {
|
|
508
509
|
...w,
|
|
509
|
-
"aria-disabled":
|
|
510
|
-
className:
|
|
511
|
-
"data-disabled":
|
|
510
|
+
"aria-disabled": s || void 0,
|
|
511
|
+
className: z(K.wrapper, K[u], K[d], K[f], s && K.disabled, y),
|
|
512
|
+
"data-disabled": s || void 0,
|
|
512
513
|
"data-invalid": A || void 0,
|
|
513
514
|
"data-orientation": u,
|
|
514
515
|
"data-size": f,
|
|
515
516
|
children: [
|
|
516
|
-
n && /* @__PURE__ */
|
|
517
|
+
n && /* @__PURE__ */ g("label", {
|
|
517
518
|
id: D,
|
|
518
519
|
htmlFor: E,
|
|
519
|
-
className:
|
|
520
|
+
className: z(K.label, x),
|
|
520
521
|
children: [
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
className:
|
|
522
|
+
/* @__PURE__ */ h("span", {
|
|
523
|
+
className: K.labelText,
|
|
523
524
|
children: n
|
|
524
525
|
}),
|
|
525
|
-
o && /* @__PURE__ */
|
|
526
|
-
className:
|
|
526
|
+
o && /* @__PURE__ */ h("span", {
|
|
527
|
+
className: K.required,
|
|
527
528
|
"aria-hidden": "true",
|
|
528
529
|
children: "*"
|
|
529
530
|
}),
|
|
530
|
-
!o &&
|
|
531
|
-
className:
|
|
532
|
-
children:
|
|
531
|
+
!o && m && /* @__PURE__ */ h("span", {
|
|
532
|
+
className: K.optional,
|
|
533
|
+
children: m
|
|
533
534
|
}),
|
|
534
|
-
p && /* @__PURE__ */
|
|
535
|
-
className:
|
|
535
|
+
p && /* @__PURE__ */ h("span", {
|
|
536
|
+
className: K.labelInfo,
|
|
536
537
|
children: p
|
|
537
538
|
})
|
|
538
539
|
]
|
|
539
540
|
}),
|
|
540
|
-
|
|
541
|
+
r && /* @__PURE__ */ h("div", {
|
|
541
542
|
id: O,
|
|
542
|
-
className:
|
|
543
|
-
children:
|
|
543
|
+
className: z(K.description, S),
|
|
544
|
+
children: r
|
|
544
545
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ h(Fe.Provider, {
|
|
546
547
|
value: N,
|
|
547
|
-
children: /* @__PURE__ */
|
|
548
|
-
className:
|
|
548
|
+
children: /* @__PURE__ */ h("div", {
|
|
549
|
+
className: z(K.control, b),
|
|
549
550
|
children: F
|
|
550
551
|
})
|
|
551
552
|
}),
|
|
552
|
-
a && /* @__PURE__ */
|
|
553
|
+
a && /* @__PURE__ */ h("div", {
|
|
553
554
|
id: k,
|
|
554
|
-
className:
|
|
555
|
+
className: z(K.errorText, C),
|
|
555
556
|
role: "alert",
|
|
556
557
|
children: a
|
|
557
558
|
})
|
|
558
559
|
]
|
|
559
560
|
});
|
|
560
|
-
},
|
|
561
|
-
option: "
|
|
562
|
-
selected: "
|
|
563
|
-
disabled: "
|
|
564
|
-
active: "
|
|
565
|
-
label: "
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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 }) => {
|
|
579
|
+
let s = !!e.disabled;
|
|
580
|
+
return /* @__PURE__ */ g("li", {
|
|
570
581
|
id: r,
|
|
571
582
|
role: "option",
|
|
572
583
|
"aria-selected": t,
|
|
573
|
-
"aria-disabled":
|
|
574
|
-
className:
|
|
575
|
-
[
|
|
576
|
-
[
|
|
577
|
-
[
|
|
584
|
+
"aria-disabled": s || void 0,
|
|
585
|
+
className: z(q.option, {
|
|
586
|
+
[q.selected]: t,
|
|
587
|
+
[q.active]: n,
|
|
588
|
+
[q.disabled]: s,
|
|
589
|
+
[q.success]: e.color === "success",
|
|
590
|
+
[q.warning]: e.color === "warning",
|
|
591
|
+
[q.danger]: e.color === "danger"
|
|
578
592
|
}),
|
|
579
593
|
onClick: () => {
|
|
580
|
-
|
|
594
|
+
s || a(e.value);
|
|
581
595
|
},
|
|
582
596
|
onMouseEnter: () => {
|
|
583
|
-
|
|
597
|
+
s || o();
|
|
584
598
|
},
|
|
585
|
-
children: [/* @__PURE__ */
|
|
586
|
-
className:
|
|
587
|
-
children: e
|
|
588
|
-
})
|
|
589
|
-
|
|
599
|
+
children: [i ? /* @__PURE__ */ h("span", {
|
|
600
|
+
className: q.custom,
|
|
601
|
+
children: i(e)
|
|
602
|
+
}) : /* @__PURE__ */ g(m, { children: [
|
|
603
|
+
e.icon && /* @__PURE__ */ h("span", {
|
|
604
|
+
className: q.icon,
|
|
605
|
+
children: e.icon
|
|
606
|
+
}),
|
|
607
|
+
/* @__PURE__ */ g("span", {
|
|
608
|
+
className: q.content,
|
|
609
|
+
children: [/* @__PURE__ */ h("span", {
|
|
610
|
+
className: q.label,
|
|
611
|
+
children: e.label
|
|
612
|
+
}), e.description && /* @__PURE__ */ h("span", {
|
|
613
|
+
className: q.description,
|
|
614
|
+
children: e.description
|
|
615
|
+
})]
|
|
616
|
+
}),
|
|
617
|
+
e.badge && /* @__PURE__ */ h("span", {
|
|
618
|
+
className: q.badge,
|
|
619
|
+
children: e.badge
|
|
620
|
+
}),
|
|
621
|
+
e.shortcut && /* @__PURE__ */ h("kbd", {
|
|
622
|
+
className: q.shortcut,
|
|
623
|
+
children: e.shortcut
|
|
624
|
+
})
|
|
625
|
+
] }), /* @__PURE__ */ h("span", {
|
|
626
|
+
className: q.check,
|
|
590
627
|
"aria-hidden": "true",
|
|
591
|
-
children: t && /* @__PURE__ */
|
|
628
|
+
children: t && /* @__PURE__ */ h(P, {})
|
|
592
629
|
})]
|
|
593
630
|
});
|
|
594
631
|
};
|
|
595
|
-
|
|
596
|
-
var
|
|
597
|
-
dropdown: "
|
|
598
|
-
dropdownIn: "
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
"
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
632
|
+
ze.displayName = "SelectOption";
|
|
633
|
+
var J = {
|
|
634
|
+
dropdown: "_dropdown_1yn7p_1",
|
|
635
|
+
dropdownIn: "_dropdownIn_1yn7p_1",
|
|
636
|
+
primary: "_primary_1yn7p_73",
|
|
637
|
+
outline: "_outline_1yn7p_73",
|
|
638
|
+
filled: "_filled_1yn7p_130",
|
|
639
|
+
soft: "_soft_1yn7p_187",
|
|
640
|
+
neutral: "_neutral_1yn7p_244",
|
|
641
|
+
success: "_success_1yn7p_415",
|
|
642
|
+
warning: "_warning_1yn7p_586",
|
|
643
|
+
danger: "_danger_1yn7p_757",
|
|
644
|
+
listReveal: "_listReveal_1yn7p_1",
|
|
645
|
+
command: "_command_1yn7p_935",
|
|
646
|
+
searchWrap: "_searchWrap_1yn7p_940",
|
|
647
|
+
searchReveal: "_searchReveal_1yn7p_1",
|
|
648
|
+
search: "_search_1yn7p_940",
|
|
649
|
+
searchClear: "_searchClear_1yn7p_969",
|
|
650
|
+
empty: "_empty_1yn7p_1002",
|
|
651
|
+
groupLabel: "_groupLabel_1yn7p_1010",
|
|
652
|
+
separator: "_separator_1yn7p_1020",
|
|
653
|
+
virtualSpacer: "_virtualSpacer_1yn7p_1026",
|
|
654
|
+
mobileDropdownIn: "_mobileDropdownIn_1yn7p_1"
|
|
655
|
+
}, Be = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: o, entries: c, multiple: l, selectedValues: f, color: p = "primary", variant: _ = "outline", searchable: v, command: y, virtual: b, portal: x = !0, searchValue: S = "", searchPlaceholder: C = "Search...", loading: w, loadingText: T = "Loading...", noOptionsText: E, searchSlot: D, headerSlot: O, emptySlot: k, loadingSlot: A, renderOption: j, selectedValue: M, activeIndex: N, className: P, onSelect: F, onMouseEnter: L, onSearchChange: R }) => {
|
|
656
|
+
let z = u(null), B = u(!1), [te, ne] = d(null), [re, ie] = d(0), ae = typeof b == "object" ? b : b ? {} : void 0, oe = ae?.itemHeight ?? 40, V = !!(ae && o.length > 0 && !w), se = a((e) => {
|
|
657
|
+
ne(e), r(e);
|
|
658
|
+
}, [r]);
|
|
659
|
+
if (s(() => {
|
|
660
|
+
e || (B.current = !1, ie(0));
|
|
661
|
+
}, [e, S]), s(() => {
|
|
662
|
+
if (!e || w || !te || B.current) return;
|
|
663
|
+
let n = o.findIndex((e) => f ? f.includes(e.value) : e.value === M), r = n >= 0 ? n : N;
|
|
664
|
+
if (r < 0) {
|
|
665
|
+
B.current = !0;
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
if (B.current = !0, V) {
|
|
669
|
+
let e = Math.max(0, r * oe - (300 - oe) / 2);
|
|
670
|
+
ie(e), te.scrollTop = e;
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
document.getElementById(`${t}-option-${r}`)?.scrollIntoView?.({ block: "nearest" });
|
|
674
|
+
}, [
|
|
675
|
+
N,
|
|
676
|
+
te,
|
|
677
|
+
e,
|
|
678
|
+
V,
|
|
679
|
+
oe,
|
|
680
|
+
t,
|
|
681
|
+
w,
|
|
682
|
+
o,
|
|
683
|
+
M,
|
|
684
|
+
f
|
|
685
|
+
]), !e) return null;
|
|
686
|
+
let ce = V ? Math.max(0, Math.floor(re / oe) - 2) : 0, le = V ? Math.ceil(300 / oe) + 4 : o.length, ue = V ? o.slice(ce, ce + le) : o, de = c && !V ? c : ue.map((e, t) => ({
|
|
687
|
+
type: "option",
|
|
608
688
|
option: e,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
689
|
+
optionIndex: ce + t
|
|
690
|
+
})), fe = V ? ce * oe : 0, pe = V ? Math.max(0, (o.length - ce - ue.length) * oe) : 0, me = /* @__PURE__ */ g("div", {
|
|
691
|
+
ref: se,
|
|
692
|
+
tabIndex: 0,
|
|
693
|
+
className: [
|
|
694
|
+
J.dropdown,
|
|
695
|
+
J[p],
|
|
696
|
+
J[_],
|
|
697
|
+
y ? J.command : void 0,
|
|
698
|
+
P
|
|
699
|
+
].filter(Boolean).join(" "),
|
|
700
|
+
style: i,
|
|
701
|
+
onScroll: (e) => {
|
|
702
|
+
V && ie(e.currentTarget.scrollTop);
|
|
703
|
+
},
|
|
704
|
+
children: [
|
|
705
|
+
O,
|
|
706
|
+
D ?? (v && /* @__PURE__ */ g("div", {
|
|
707
|
+
className: J.searchWrap,
|
|
708
|
+
children: [/* @__PURE__ */ h("input", {
|
|
709
|
+
ref: z,
|
|
710
|
+
className: J.search,
|
|
711
|
+
value: S,
|
|
712
|
+
placeholder: y ? "Type a command..." : C,
|
|
713
|
+
"aria-label": "Search options",
|
|
714
|
+
onInput: (e) => R?.(e.currentTarget.value),
|
|
715
|
+
onChange: (e) => R?.(e.target.value)
|
|
716
|
+
}), S && /* @__PURE__ */ h("button", {
|
|
717
|
+
type: "button",
|
|
718
|
+
className: J.searchClear,
|
|
719
|
+
"aria-label": "Clear search",
|
|
720
|
+
onClick: () => {
|
|
721
|
+
R?.(""), z.current?.focus();
|
|
722
|
+
},
|
|
723
|
+
children: /* @__PURE__ */ h(I, {})
|
|
724
|
+
})]
|
|
725
|
+
})),
|
|
726
|
+
/* @__PURE__ */ h("ul", {
|
|
727
|
+
id: t,
|
|
728
|
+
role: "listbox",
|
|
729
|
+
"aria-multiselectable": l || void 0,
|
|
730
|
+
"aria-labelledby": n,
|
|
731
|
+
className: P,
|
|
732
|
+
children: w ? /* @__PURE__ */ h("li", {
|
|
733
|
+
role: "option",
|
|
734
|
+
"aria-disabled": "true",
|
|
735
|
+
"aria-selected": "false",
|
|
736
|
+
className: J.empty,
|
|
737
|
+
children: A ?? T
|
|
738
|
+
}) : o.length ? /* @__PURE__ */ g(m, { children: [
|
|
739
|
+
V && /* @__PURE__ */ h("li", {
|
|
740
|
+
"aria-hidden": "true",
|
|
741
|
+
className: J.virtualSpacer,
|
|
742
|
+
style: { height: fe }
|
|
743
|
+
}),
|
|
744
|
+
de.map((e) => {
|
|
745
|
+
if (e.type === "group") return /* @__PURE__ */ h("li", {
|
|
746
|
+
role: "presentation",
|
|
747
|
+
className: J.groupLabel,
|
|
748
|
+
children: e.label
|
|
749
|
+
}, e.id);
|
|
750
|
+
if (e.type === "separator") return /* @__PURE__ */ h("li", {
|
|
751
|
+
role: "presentation",
|
|
752
|
+
"aria-hidden": "true",
|
|
753
|
+
className: J.separator,
|
|
754
|
+
"data-vellira-select-separator": "true"
|
|
755
|
+
}, e.id);
|
|
756
|
+
let { option: n, optionIndex: r } = e;
|
|
757
|
+
return /* @__PURE__ */ h(ze, {
|
|
758
|
+
option: n,
|
|
759
|
+
isSelected: f ? f.includes(n.value) : n.value === M,
|
|
760
|
+
isActive: r === N,
|
|
761
|
+
optionId: `${t}-option-${r}`,
|
|
762
|
+
renderOption: j,
|
|
763
|
+
onSelect: F,
|
|
764
|
+
onMouseEnter: () => L(r)
|
|
765
|
+
}, n.value);
|
|
766
|
+
}),
|
|
767
|
+
V && /* @__PURE__ */ h("li", {
|
|
768
|
+
"aria-hidden": "true",
|
|
769
|
+
className: J.virtualSpacer,
|
|
770
|
+
style: { height: pe }
|
|
771
|
+
})
|
|
772
|
+
] }) : /* @__PURE__ */ h("li", {
|
|
773
|
+
role: "option",
|
|
774
|
+
"aria-disabled": "true",
|
|
775
|
+
"aria-selected": "false",
|
|
776
|
+
className: J.empty,
|
|
777
|
+
children: k ?? E
|
|
778
|
+
})
|
|
779
|
+
})
|
|
780
|
+
]
|
|
781
|
+
});
|
|
782
|
+
return x ? /* @__PURE__ */ h(ee, { children: me }) : me;
|
|
783
|
+
};
|
|
784
|
+
Be.displayName = "SelectDropdown";
|
|
623
785
|
var Y = {
|
|
624
|
-
control: "
|
|
625
|
-
disabled: "
|
|
626
|
-
arrow: "
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
786
|
+
control: "_control_1m1fn_1",
|
|
787
|
+
disabled: "_disabled_1m1fn_41",
|
|
788
|
+
arrow: "_arrow_1m1fn_46",
|
|
789
|
+
primary: "_primary_1m1fn_60",
|
|
790
|
+
outline: "_outline_1m1fn_60",
|
|
791
|
+
filled: "_filled_1m1fn_101",
|
|
792
|
+
soft: "_soft_1m1fn_142",
|
|
793
|
+
neutral: "_neutral_1m1fn_183",
|
|
794
|
+
success: "_success_1m1fn_306",
|
|
795
|
+
warning: "_warning_1m1fn_429",
|
|
796
|
+
danger: "_danger_1m1fn_552",
|
|
797
|
+
sm: "_sm_1m1fn_675",
|
|
798
|
+
md: "_md_1m1fn_682",
|
|
799
|
+
lg: "_lg_1m1fn_689",
|
|
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,
|
|
637
814
|
type: "button",
|
|
638
815
|
role: "combobox",
|
|
639
|
-
disabled:
|
|
640
|
-
"aria-disabled":
|
|
641
|
-
"aria-required":
|
|
642
|
-
"aria-expanded":
|
|
816
|
+
disabled: a,
|
|
817
|
+
"aria-disabled": a || void 0,
|
|
818
|
+
"aria-required": o || void 0,
|
|
819
|
+
"aria-expanded": i,
|
|
643
820
|
"aria-haspopup": "listbox",
|
|
644
|
-
"aria-label":
|
|
645
|
-
"aria-
|
|
646
|
-
"aria-
|
|
647
|
-
"aria-
|
|
648
|
-
"aria-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
[Y.
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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;
|
|
881
|
+
}
|
|
882
|
+
He.displayName = "SelectContext";
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region src/components/Select/SelectCompound.tsx
|
|
885
|
+
var Ge = ({ children: e, className: t }) => {
|
|
886
|
+
let { triggerProps: n } = We();
|
|
887
|
+
return /* @__PURE__ */ h(Ve, {
|
|
888
|
+
...n,
|
|
889
|
+
className: [n.className, t].filter(Boolean).join(" "),
|
|
890
|
+
children: e
|
|
891
|
+
});
|
|
892
|
+
};
|
|
893
|
+
Ge.__velliraSelectPart = "trigger", Ge.displayName = "Select.Trigger";
|
|
894
|
+
var Ke = ({ children: e, className: t }) => {
|
|
895
|
+
let { dropdownProps: n } = We(), r = ot(e);
|
|
896
|
+
return /* @__PURE__ */ h(Be, {
|
|
897
|
+
...n,
|
|
898
|
+
...r,
|
|
899
|
+
className: [n.className, t].filter(Boolean).join(" ")
|
|
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),
|
|
662
918
|
"aria-hidden": "true",
|
|
663
|
-
children: /* @__PURE__ */
|
|
664
|
-
})
|
|
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", {
|
|
926
|
+
className: J.searchWrap,
|
|
927
|
+
children: [/* @__PURE__ */ h("input", {
|
|
928
|
+
ref: r,
|
|
929
|
+
className: z(J.search, t),
|
|
930
|
+
value: i,
|
|
931
|
+
placeholder: e ?? (n.command ? "Type a command..." : "Search..."),
|
|
932
|
+
"aria-label": "Search options",
|
|
933
|
+
onInput: (e) => n.onSearchChange?.(e.currentTarget.value),
|
|
934
|
+
onChange: (e) => n.onSearchChange?.(e.target.value)
|
|
935
|
+
}), i && /* @__PURE__ */ h("button", {
|
|
936
|
+
type: "button",
|
|
937
|
+
className: J.searchClear,
|
|
938
|
+
"aria-label": "Clear search",
|
|
939
|
+
onClick: () => {
|
|
940
|
+
n.onSearchChange?.(""), r.current?.focus();
|
|
941
|
+
},
|
|
942
|
+
children: /* @__PURE__ */ h(I, {})
|
|
943
|
+
})]
|
|
944
|
+
});
|
|
945
|
+
};
|
|
946
|
+
Ye.__velliraSelectPart = "search", Ye.displayName = "Select.Search";
|
|
947
|
+
var Xe = () => null;
|
|
948
|
+
Xe.__velliraSelectPart = "group", Xe.displayName = "Select.Group";
|
|
949
|
+
var Ze = ({ children: e }) => /* @__PURE__ */ h("div", {
|
|
950
|
+
role: "presentation",
|
|
951
|
+
className: J.groupLabel,
|
|
952
|
+
children: e
|
|
665
953
|
});
|
|
666
|
-
|
|
954
|
+
Ze.__velliraSelectPart = "label", Ze.displayName = "Select.Label";
|
|
955
|
+
var Qe = () => null;
|
|
956
|
+
Qe.__velliraSelectPart = "item", Qe.displayName = "Select.Item";
|
|
957
|
+
var $e = () => null;
|
|
958
|
+
$e.__velliraSelectPart = "itemIcon", $e.displayName = "Select.ItemIcon";
|
|
959
|
+
var et = () => null;
|
|
960
|
+
et.__velliraSelectPart = "itemDescription", et.displayName = "Select.ItemDescription";
|
|
961
|
+
var tt = () => null;
|
|
962
|
+
tt.__velliraSelectPart = "separator", tt.displayName = "Select.Separator";
|
|
963
|
+
var nt = ({ children: e }) => /* @__PURE__ */ h(m, { children: e });
|
|
964
|
+
nt.__velliraSelectPart = "empty", nt.displayName = "Select.Empty";
|
|
965
|
+
var rt = ({ children: e }) => /* @__PURE__ */ h(m, { children: e });
|
|
966
|
+
rt.__velliraSelectPart = "loading", rt.displayName = "Select.Loading";
|
|
967
|
+
function it(t) {
|
|
968
|
+
let n = [], r = [], a = 0;
|
|
969
|
+
function o(t) {
|
|
970
|
+
e.forEach(t, (e) => {
|
|
971
|
+
if (!i(e)) return;
|
|
972
|
+
let t = e.type;
|
|
973
|
+
if (t.__velliraSelectPart === "group") {
|
|
974
|
+
let t = e.props;
|
|
975
|
+
n.push({
|
|
976
|
+
type: "group",
|
|
977
|
+
id: `group-${a++}`,
|
|
978
|
+
label: t.label
|
|
979
|
+
}), o(t.children);
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
if (t.__velliraSelectPart === "item") {
|
|
983
|
+
let t = e.props, i = st(t.children, t.value), a = t.label ?? i.label, o = r.length, s = {
|
|
984
|
+
label: a,
|
|
985
|
+
value: t.value,
|
|
986
|
+
disabled: t.disabled,
|
|
987
|
+
description: t.description ?? i.description,
|
|
988
|
+
icon: t.icon ?? i.icon,
|
|
989
|
+
badge: t.badge,
|
|
990
|
+
shortcut: t.shortcut,
|
|
991
|
+
color: t.color
|
|
992
|
+
};
|
|
993
|
+
r.push(s), n.push({
|
|
994
|
+
type: "option",
|
|
995
|
+
option: s,
|
|
996
|
+
optionIndex: o
|
|
997
|
+
});
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
if (t.__velliraSelectPart === "separator") {
|
|
1001
|
+
n.push({
|
|
1002
|
+
type: "separator",
|
|
1003
|
+
id: `separator-${a++}`
|
|
1004
|
+
});
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
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);
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
return o(t), {
|
|
1011
|
+
entries: n,
|
|
1012
|
+
options: r
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
function at(t) {
|
|
1016
|
+
let n = !1;
|
|
1017
|
+
function r(t) {
|
|
1018
|
+
e.forEach(t, (e) => {
|
|
1019
|
+
if (!i(e) || n) return;
|
|
1020
|
+
let t = e.type;
|
|
1021
|
+
if (t.__velliraSelectPart === "trigger" || t.__velliraSelectPart === "content") {
|
|
1022
|
+
n = !0;
|
|
1023
|
+
return;
|
|
1024
|
+
}
|
|
1025
|
+
r(e.props.children);
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
return r(t), n;
|
|
1029
|
+
}
|
|
1030
|
+
function ot(t) {
|
|
1031
|
+
let n, r, a, o;
|
|
1032
|
+
return e.forEach(t, (e) => {
|
|
1033
|
+
if (!i(e)) return;
|
|
1034
|
+
let t = e.type;
|
|
1035
|
+
t.__velliraSelectPart === "label" && (n = e), t.__velliraSelectPart === "search" && (r = e), t.__velliraSelectPart === "empty" && (a = e), t.__velliraSelectPart === "loading" && (o = e);
|
|
1036
|
+
}), {
|
|
1037
|
+
emptySlot: a,
|
|
1038
|
+
headerSlot: n,
|
|
1039
|
+
loadingSlot: o,
|
|
1040
|
+
searchSlot: r
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
function st(t, n) {
|
|
1044
|
+
let r, a, o = [];
|
|
1045
|
+
function s(t) {
|
|
1046
|
+
e.forEach(t, (e) => {
|
|
1047
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
1048
|
+
o.push(String(e));
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
if (!i(e)) return;
|
|
1052
|
+
let t = e.type;
|
|
1053
|
+
if (t.__velliraSelectPart === "itemIcon") {
|
|
1054
|
+
r = e.props.children;
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
if (t.__velliraSelectPart === "itemDescription") {
|
|
1058
|
+
a = e.props.children;
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
s(e.props.children);
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
s(t);
|
|
1065
|
+
let c = o.join("").trim();
|
|
1066
|
+
return {
|
|
1067
|
+
description: a,
|
|
1068
|
+
icon: r,
|
|
1069
|
+
label: c || n
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
667
1072
|
//#endregion
|
|
668
1073
|
//#region src/components/Select/Select.tsx
|
|
669
|
-
var
|
|
670
|
-
let
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
1074
|
+
var ct = 0, lt = "", ut = Object.assign(({ children: e, label: t, description: n, id: r, name: i, "aria-label": o, "aria-describedby": f, "aria-labelledby": p, value: _, defaultValue: v, onValueChange: y, multiple: b = !1, maxSelected: x, closeOnSelect: S, placeholder: C = "Select...", empty: w, loadingText: T = "Loading...", noOptionsText: E, size: D, color: O = "primary", variant: k = "outline", required: A = !1, disabled: M = !1, invalid: N = !1, loading: P = !1, clearable: F = !1, searchable: I = !1, virtual: L, modal: R = !1, command: z = !1, error: ee, placement: B = "bottom", matchTriggerWidth: te = !0, avoidCollisions: ne = !0, portal: ae = !0, open: oe, defaultOpen: V = !1, onOpenChange: se, onSearch: ce, onClear: le, startIcon: ue, endIcon: de, prefix: fe, suffix: pe, renderValue: me, renderOption: he, onBlur: ge, onFocus: _e, className: ve, triggerClassName: ye, dropdownClassName: be }) => {
|
|
1075
|
+
let xe = c(), H = Ie(), U = !!(t || n || ee), W = r ?? (U ? void 0 : H?.controlId) ?? xe, Se = `${W}-listbox`, [Ce, we] = d(""), Te = !!ee, Ee = Te ? `${W}-error` : void 0, De = n ? `${W}-description` : void 0, Oe = D ?? H?.size ?? "md", ke = N || Te || !U && !!H?.invalid, Ae = M || !U && !!H?.disabled, je = A || !U && !!H?.required, Me = [
|
|
1076
|
+
f,
|
|
1077
|
+
!U && !f ? H?.ariaDescribedBy : void 0,
|
|
1078
|
+
De,
|
|
1079
|
+
Ee
|
|
1080
|
+
].filter(Boolean).join(" "), Ne = u(null), G = u(null), Pe = I || z, { entries: Fe, options: K } = l(() => it(e), [e]), Le = l(() => {
|
|
1081
|
+
if (!Pe || !Ce) return K;
|
|
1082
|
+
let e = Ce.toLocaleLowerCase();
|
|
1083
|
+
return K.filter((t) => `${t.label} ${dt(t.description)}`.toLocaleLowerCase().includes(e));
|
|
1084
|
+
}, [
|
|
1085
|
+
Pe,
|
|
1086
|
+
K,
|
|
1087
|
+
Ce
|
|
1088
|
+
]), { selectedValue: q, selectedValues: ze, selectedOption: J, selectedOptions: Y, isOpen: He, setIsOpen: We, activeIndex: qe, setActiveIndex: Je, closeDropdown: Ye, toggleDropdown: Xe, selectValue: Ze, onKeyDown: Qe } = j({
|
|
1089
|
+
value: _,
|
|
1090
|
+
defaultValue: v,
|
|
1091
|
+
onValueChange: y,
|
|
1092
|
+
options: Le,
|
|
1093
|
+
multiple: b,
|
|
1094
|
+
maxSelected: x,
|
|
1095
|
+
closeOnSelect: S,
|
|
1096
|
+
disabled: Ae,
|
|
1097
|
+
open: oe,
|
|
1098
|
+
defaultOpen: V,
|
|
1099
|
+
onOpenChange: se
|
|
1100
|
+
}), $e = !!J, et = Array.isArray(q) ? q[0] ?? "" : q, { floatingStyles: tt, setRef: nt, setFloatingRef: rt } = re({
|
|
1101
|
+
open: He,
|
|
1102
|
+
onOpenChange: We,
|
|
1103
|
+
placement: B === "bottom" || B === "top" ? `${B}-start` : B,
|
|
1104
|
+
matchTriggerWidth: te,
|
|
1105
|
+
avoidCollisions: ne,
|
|
684
1106
|
mobileSheetBreakpoint: 640
|
|
685
|
-
}),
|
|
686
|
-
|
|
687
|
-
}, [
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}, [se]), de = i((e) => {
|
|
692
|
-
L.current = e, ce(e);
|
|
1107
|
+
}), ot = a((e) => {
|
|
1108
|
+
Ze(e), Ne.current?.focus();
|
|
1109
|
+
}, [Ze]), st = a(() => {
|
|
1110
|
+
Ze(""), le?.(), Ne.current?.focus();
|
|
1111
|
+
}, [le, Ze]), ut = a((e) => {
|
|
1112
|
+
we(e), ce?.(e);
|
|
693
1113
|
}, [ce]);
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
1114
|
+
ie([Ne, G], Ye, He), s(() => {
|
|
1115
|
+
if (!(!R || !He)) return ct === 0 && (lt = document.body.style.overflow), ct += 1, document.body.style.overflow = "hidden", () => {
|
|
1116
|
+
ct = Math.max(0, ct - 1), ct === 0 && (document.body.style.overflow = lt);
|
|
1117
|
+
};
|
|
1118
|
+
}, [He, R]);
|
|
1119
|
+
let ft = a((e) => {
|
|
1120
|
+
Ne.current = e, nt(e);
|
|
1121
|
+
}, [nt]), pt = a((e) => {
|
|
1122
|
+
G.current = e, rt(e);
|
|
1123
|
+
}, [rt]), mt = me ? me(J) : b && Y.length ? Y.map((e) => e.label).join(", ") : J?.label ?? C, ht = w ?? E ?? "No options available", gt = F && ze.length > 0 && !Ae && !P, _t = {
|
|
1124
|
+
id: W,
|
|
1125
|
+
describedBy: Me || void 0,
|
|
1126
|
+
labelledBy: o ? void 0 : p,
|
|
1127
|
+
isOpen: He,
|
|
1128
|
+
disabled: Ae,
|
|
1129
|
+
required: je,
|
|
1130
|
+
listboxId: Se,
|
|
1131
|
+
activeIndex: qe,
|
|
1132
|
+
ariaLabel: o ?? (!t && !H?.labelId ? J?.label || C : void 0),
|
|
1133
|
+
error: ke,
|
|
1134
|
+
loading: P,
|
|
1135
|
+
displayText: mt,
|
|
1136
|
+
isPlaceholder: !$e,
|
|
1137
|
+
size: Oe,
|
|
1138
|
+
color: O,
|
|
1139
|
+
variant: k,
|
|
1140
|
+
startIcon: ue,
|
|
1141
|
+
endIcon: de,
|
|
1142
|
+
prefix: fe,
|
|
1143
|
+
suffix: pe,
|
|
1144
|
+
clearable: gt,
|
|
1145
|
+
className: ye,
|
|
1146
|
+
buttonRef: ft,
|
|
1147
|
+
onClear: st,
|
|
1148
|
+
onClick: Xe,
|
|
1149
|
+
onKeyDown: Qe,
|
|
1150
|
+
onBlur: ge,
|
|
1151
|
+
onFocus: _e
|
|
1152
|
+
}, vt = {
|
|
1153
|
+
isOpen: He,
|
|
1154
|
+
listboxId: Se,
|
|
1155
|
+
labelledById: W,
|
|
1156
|
+
style: tt,
|
|
1157
|
+
options: Le,
|
|
1158
|
+
entries: Pe || Ce ? void 0 : Fe,
|
|
1159
|
+
multiple: b,
|
|
1160
|
+
color: O,
|
|
1161
|
+
variant: k,
|
|
1162
|
+
searchable: Pe,
|
|
1163
|
+
command: z,
|
|
1164
|
+
virtual: L,
|
|
1165
|
+
portal: ae,
|
|
1166
|
+
searchValue: Ce,
|
|
1167
|
+
loading: P,
|
|
1168
|
+
loadingText: T,
|
|
1169
|
+
noOptionsText: ht,
|
|
1170
|
+
renderOption: he,
|
|
1171
|
+
selectedValue: et,
|
|
1172
|
+
selectedValues: ze,
|
|
1173
|
+
activeIndex: qe,
|
|
1174
|
+
className: be,
|
|
1175
|
+
setDropdownRef: pt,
|
|
1176
|
+
onSelect: ot,
|
|
1177
|
+
onMouseEnter: Je,
|
|
1178
|
+
onSearchChange: ut
|
|
1179
|
+
}, yt = /* @__PURE__ */ g(m, { children: [i && b && ze.length > 0 && /* @__PURE__ */ h(m, { children: ze.map((e) => /* @__PURE__ */ h("input", {
|
|
1180
|
+
type: "hidden",
|
|
1181
|
+
name: i,
|
|
1182
|
+
value: e,
|
|
1183
|
+
disabled: Ae
|
|
1184
|
+
}, e)) }), i && !b && /* @__PURE__ */ h("input", {
|
|
1185
|
+
type: "hidden",
|
|
1186
|
+
name: i,
|
|
1187
|
+
value: et,
|
|
1188
|
+
disabled: Ae
|
|
1189
|
+
})] }), bt = at(e), xt = /* @__PURE__ */ g(Ue, {
|
|
1190
|
+
value: {
|
|
1191
|
+
triggerProps: _t,
|
|
1192
|
+
dropdownProps: vt
|
|
1193
|
+
},
|
|
1194
|
+
children: [yt, bt ? e : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(Ge, {}), /* @__PURE__ */ h(Ke, { children: e })] })]
|
|
1195
|
+
}), St = /* @__PURE__ */ g(Ue, {
|
|
1196
|
+
value: {
|
|
1197
|
+
triggerProps: _t,
|
|
1198
|
+
dropdownProps: vt
|
|
1199
|
+
},
|
|
702
1200
|
children: [
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
isOpen: B,
|
|
707
|
-
disabled: v,
|
|
708
|
-
required: _,
|
|
709
|
-
listboxId: N,
|
|
710
|
-
activeIndex: H,
|
|
711
|
-
ariaLabel: a ?? (e ? void 0 : z?.label || f),
|
|
712
|
-
error: P,
|
|
713
|
-
displayText: z?.label ?? f,
|
|
714
|
-
isPlaceholder: !oe,
|
|
715
|
-
size: g,
|
|
716
|
-
className: O,
|
|
717
|
-
buttonRef: ue,
|
|
718
|
-
onClick: U,
|
|
719
|
-
onKeyDown: ae,
|
|
720
|
-
onBlur: T,
|
|
721
|
-
onFocus: E
|
|
722
|
-
}),
|
|
723
|
-
r && /* @__PURE__ */ m("input", {
|
|
724
|
-
type: "hidden",
|
|
725
|
-
name: r,
|
|
726
|
-
value: R,
|
|
727
|
-
disabled: v
|
|
728
|
-
}),
|
|
729
|
-
/* @__PURE__ */ m(ze, {
|
|
730
|
-
isOpen: B,
|
|
731
|
-
listboxId: N,
|
|
732
|
-
labelledById: M,
|
|
733
|
-
style: W,
|
|
734
|
-
options: d,
|
|
735
|
-
noOptionsText: p,
|
|
736
|
-
selectedValue: R,
|
|
737
|
-
activeIndex: H,
|
|
738
|
-
className: k,
|
|
739
|
-
setDropdownRef: de,
|
|
740
|
-
onSelect: le,
|
|
741
|
-
onMouseEnter: ne
|
|
742
|
-
})
|
|
1201
|
+
yt,
|
|
1202
|
+
/* @__PURE__ */ h(Ve, { ..._t }),
|
|
1203
|
+
/* @__PURE__ */ h(Be, { ...vt })
|
|
743
1204
|
]
|
|
744
1205
|
});
|
|
745
|
-
|
|
746
|
-
|
|
1206
|
+
return !U && H ? e ? xt : St : /* @__PURE__ */ h(Re, {
|
|
1207
|
+
id: W,
|
|
1208
|
+
label: t,
|
|
1209
|
+
description: n,
|
|
1210
|
+
error: ee,
|
|
1211
|
+
required: je,
|
|
1212
|
+
disabled: Ae,
|
|
1213
|
+
bindControl: !1,
|
|
1214
|
+
className: ve,
|
|
1215
|
+
children: e ? xt : St
|
|
1216
|
+
});
|
|
1217
|
+
}, {
|
|
1218
|
+
Trigger: Ge,
|
|
1219
|
+
Value: qe,
|
|
1220
|
+
Icon: Je,
|
|
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) : "";
|
|
1235
|
+
}
|
|
747
1236
|
//#endregion
|
|
748
1237
|
//#region src/components/Tabs/TabsContext.tsx
|
|
749
|
-
var
|
|
750
|
-
let e =
|
|
1238
|
+
var ft = n(null), pt = () => {
|
|
1239
|
+
let e = o(ft);
|
|
751
1240
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
752
1241
|
return e;
|
|
753
|
-
},
|
|
1242
|
+
}, mt = {
|
|
754
1243
|
list: "_list_13hkl_1",
|
|
755
1244
|
vertical: "_vertical_13hkl_8"
|
|
756
|
-
},
|
|
757
|
-
let { orientation: r, appearance: i } =
|
|
758
|
-
return /* @__PURE__ */
|
|
1245
|
+
}, ht = ({ children: e, className: t, ...n }) => {
|
|
1246
|
+
let { orientation: r, appearance: i } = pt();
|
|
1247
|
+
return /* @__PURE__ */ h("div", {
|
|
759
1248
|
...n,
|
|
760
1249
|
role: "tablist",
|
|
761
1250
|
"aria-orientation": r,
|
|
762
|
-
className:
|
|
1251
|
+
className: z(mt.list, r === "vertical" && mt.vertical, i === "underline" && mt.underline, i === "pills" && mt.pills, t),
|
|
763
1252
|
children: e
|
|
764
1253
|
});
|
|
765
1254
|
};
|
|
766
|
-
|
|
767
|
-
var
|
|
1255
|
+
ht.displayName = "TabsList";
|
|
1256
|
+
var gt = {
|
|
768
1257
|
panel: "_panel_1v1a9_1",
|
|
769
1258
|
visible: "_visible_1v1a9_10",
|
|
770
1259
|
vertical: "_vertical_1v1a9_14"
|
|
771
|
-
},
|
|
772
|
-
let { activeIndex: r, orientation: i } =
|
|
773
|
-
return
|
|
1260
|
+
}, _t = ({ index: e, children: t, className: n }) => {
|
|
1261
|
+
let { activeIndex: r, orientation: i } = pt(), [a, o] = d(!1), c = r === e;
|
|
1262
|
+
return s(() => {
|
|
774
1263
|
if (!c) {
|
|
775
|
-
|
|
1264
|
+
o(!1);
|
|
776
1265
|
return;
|
|
777
1266
|
}
|
|
778
|
-
let e = setTimeout(() =>
|
|
1267
|
+
let e = setTimeout(() => o(!0), 10);
|
|
779
1268
|
return () => clearTimeout(e);
|
|
780
|
-
}, [c]), /* @__PURE__ */
|
|
1269
|
+
}, [c]), /* @__PURE__ */ h("div", {
|
|
781
1270
|
role: "tabpanel",
|
|
782
1271
|
id: `tab-panel-${e}`,
|
|
783
1272
|
"aria-labelledby": `tab-${e}`,
|
|
784
1273
|
hidden: !c,
|
|
785
1274
|
tabIndex: 0,
|
|
786
|
-
className:
|
|
1275
|
+
className: z(gt.panel, a && gt.visible, i === "vertical" && gt.vertical, n),
|
|
787
1276
|
children: t
|
|
788
1277
|
});
|
|
789
1278
|
};
|
|
790
|
-
|
|
791
|
-
var
|
|
1279
|
+
_t.displayName = "TabsPanel";
|
|
1280
|
+
var vt = {
|
|
792
1281
|
tab: "_tab_qe8xc_1",
|
|
793
1282
|
iconOnly: "_iconOnly_qe8xc_27",
|
|
794
1283
|
tabIcon: "_tabIcon_qe8xc_31",
|
|
@@ -797,14 +1286,14 @@ var Je = {
|
|
|
797
1286
|
underline: "_underline_qe8xc_60",
|
|
798
1287
|
pills: "_pills_qe8xc_92",
|
|
799
1288
|
vertical: "_vertical_qe8xc_106"
|
|
800
|
-
},
|
|
801
|
-
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab:
|
|
802
|
-
return /* @__PURE__ */
|
|
1289
|
+
}, yt = r(({ index: e, children: t, className: n, disabled: r = !1, icon: i, onClick: o, onKeyDown: s, ...c }, l) => {
|
|
1290
|
+
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: m, onTabKeyDown: _ } = pt(), v = u === e, y = !!i, b = y && t == null;
|
|
1291
|
+
return /* @__PURE__ */ g("button", {
|
|
803
1292
|
type: "button",
|
|
804
|
-
ref:
|
|
805
|
-
|
|
1293
|
+
ref: a((t) => {
|
|
1294
|
+
m(e, t), typeof l == "function" ? l(t) : l && (l.current = t);
|
|
806
1295
|
}, [
|
|
807
|
-
|
|
1296
|
+
m,
|
|
808
1297
|
e,
|
|
809
1298
|
l
|
|
810
1299
|
]),
|
|
@@ -814,7 +1303,7 @@ var Je = {
|
|
|
814
1303
|
id: `tab-${e}`,
|
|
815
1304
|
disabled: r,
|
|
816
1305
|
tabIndex: v ? 0 : -1,
|
|
817
|
-
className:
|
|
1306
|
+
className: z(vt.tab, vt[p], f === "vertical" && vt.vertical, y && vt.withIcon, b && vt.iconOnly, n),
|
|
818
1307
|
onClick: (t) => {
|
|
819
1308
|
r || (d(e), o?.(t));
|
|
820
1309
|
},
|
|
@@ -822,62 +1311,62 @@ var Je = {
|
|
|
822
1311
|
_(e), s?.(e);
|
|
823
1312
|
},
|
|
824
1313
|
...c,
|
|
825
|
-
children: [y && /* @__PURE__ */
|
|
826
|
-
className:
|
|
1314
|
+
children: [y && /* @__PURE__ */ h("span", {
|
|
1315
|
+
className: vt.tabIcon,
|
|
827
1316
|
"aria-hidden": "true",
|
|
828
|
-
children:
|
|
829
|
-
}), t != null && /* @__PURE__ */
|
|
830
|
-
className:
|
|
1317
|
+
children: i
|
|
1318
|
+
}), t != null && /* @__PURE__ */ h("span", {
|
|
1319
|
+
className: vt.label,
|
|
831
1320
|
children: t
|
|
832
1321
|
})]
|
|
833
1322
|
});
|
|
834
1323
|
});
|
|
835
|
-
|
|
836
|
-
var
|
|
1324
|
+
yt.displayName = "Tab";
|
|
1325
|
+
var bt = {
|
|
837
1326
|
tabs: "_tabs_uqy7q_1",
|
|
838
1327
|
vertical: "_vertical_uqy7q_5"
|
|
839
|
-
},
|
|
840
|
-
let { activeIndex: c, setActiveIndex:
|
|
1328
|
+
}, xt = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: i = "horizontal", appearance: o = "default", className: s }) => {
|
|
1329
|
+
let { activeIndex: c, setActiveIndex: l } = M({
|
|
841
1330
|
activeIndex: t,
|
|
842
1331
|
defaultActiveIndex: n,
|
|
843
1332
|
onChange: r
|
|
844
|
-
}), d =
|
|
1333
|
+
}), d = u([]), f = a((e, t) => {
|
|
845
1334
|
d.current[e] = t;
|
|
846
|
-
}, []), { onKeyDown: p } =
|
|
1335
|
+
}, []), { onKeyDown: p } = N({
|
|
847
1336
|
activeIndex: c,
|
|
848
|
-
setActiveIndex:
|
|
1337
|
+
setActiveIndex: l,
|
|
849
1338
|
tabRefs: d,
|
|
850
|
-
orientation:
|
|
1339
|
+
orientation: i,
|
|
851
1340
|
onNavigate: (e) => {
|
|
852
1341
|
d.current[e]?.focus();
|
|
853
1342
|
}
|
|
854
|
-
}),
|
|
1343
|
+
}), m = {
|
|
855
1344
|
activeIndex: c,
|
|
856
|
-
setActiveIndex:
|
|
857
|
-
orientation:
|
|
1345
|
+
setActiveIndex: l,
|
|
1346
|
+
orientation: i,
|
|
858
1347
|
appearance: o,
|
|
859
1348
|
registerTab: f,
|
|
860
1349
|
onTabKeyDown: p
|
|
861
1350
|
};
|
|
862
|
-
return /* @__PURE__ */
|
|
863
|
-
value:
|
|
864
|
-
children: /* @__PURE__ */
|
|
865
|
-
className:
|
|
1351
|
+
return /* @__PURE__ */ h(ft.Provider, {
|
|
1352
|
+
value: m,
|
|
1353
|
+
children: /* @__PURE__ */ h("div", {
|
|
1354
|
+
className: z(bt.tabs, i === "vertical" && bt.vertical, s),
|
|
866
1355
|
children: e
|
|
867
1356
|
})
|
|
868
1357
|
});
|
|
869
1358
|
};
|
|
870
|
-
|
|
1359
|
+
xt.displayName = "Tabs";
|
|
871
1360
|
//#endregion
|
|
872
1361
|
//#region src/components/Tabs/index.ts
|
|
873
|
-
var
|
|
874
|
-
List:
|
|
875
|
-
Tab:
|
|
876
|
-
Panel:
|
|
877
|
-
}),
|
|
1362
|
+
var St = Object.assign(xt, {
|
|
1363
|
+
List: ht,
|
|
1364
|
+
Tab: yt,
|
|
1365
|
+
Panel: _t
|
|
1366
|
+
}), Ct = {
|
|
878
1367
|
tooltip: "_tooltip_10opu_1",
|
|
879
1368
|
arrow: "_arrow_10opu_25"
|
|
880
|
-
},
|
|
1369
|
+
}, wt = r(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
|
|
881
1370
|
let l = {
|
|
882
1371
|
top: "bottom",
|
|
883
1372
|
right: "left",
|
|
@@ -890,49 +1379,49 @@ var Qe = Object.assign(Ze, {
|
|
|
890
1379
|
top: i == null ? "" : `${i}px`,
|
|
891
1380
|
[l]: "-5px"
|
|
892
1381
|
};
|
|
893
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ g("div", {
|
|
894
1383
|
ref: c,
|
|
895
|
-
className:
|
|
1384
|
+
className: z(Ct.tooltip, a),
|
|
896
1385
|
"data-placement": t,
|
|
897
1386
|
"data-state": "open",
|
|
898
1387
|
style: o,
|
|
899
1388
|
...s,
|
|
900
|
-
children: [e, /* @__PURE__ */
|
|
1389
|
+
children: [e, /* @__PURE__ */ h("div", {
|
|
901
1390
|
ref: n,
|
|
902
|
-
className:
|
|
1391
|
+
className: Ct.arrow,
|
|
903
1392
|
style: u
|
|
904
1393
|
})]
|
|
905
1394
|
});
|
|
906
1395
|
});
|
|
907
|
-
|
|
1396
|
+
wt.displayName = "TooltipContent";
|
|
908
1397
|
//#endregion
|
|
909
1398
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
910
|
-
var
|
|
1399
|
+
var Tt = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
|
|
911
1400
|
open: 300,
|
|
912
1401
|
close: 100
|
|
913
|
-
}, maxWidth: a = 250, className: o, onOpenChange:
|
|
914
|
-
let [
|
|
915
|
-
open:
|
|
1402
|
+
}, maxWidth: a = 250, className: o, onOpenChange: s }) => {
|
|
1403
|
+
let [l, f] = d(!1), p = u(null), y = c(), { context: b, floatingStyles: x, middlewareData: S, setRef: C, setFloatingRef: w, placement: O } = re({
|
|
1404
|
+
open: l,
|
|
916
1405
|
onOpenChange: (e) => {
|
|
917
|
-
r || (f(e),
|
|
1406
|
+
r || (f(e), s?.(e));
|
|
918
1407
|
},
|
|
919
1408
|
placement: t,
|
|
920
|
-
middleware: [
|
|
921
|
-
}), k = S.arrow?.x, A = S.arrow?.y, { getReferenceProps: j, getFloatingProps: M } =
|
|
1409
|
+
middleware: [v({ element: p })]
|
|
1410
|
+
}), k = S.arrow?.x, A = S.arrow?.y, { getReferenceProps: j, getFloatingProps: M } = D([E(b, { delay: {
|
|
922
1411
|
open: i.open,
|
|
923
1412
|
close: i.close
|
|
924
|
-
} }),
|
|
925
|
-
return /* @__PURE__ */
|
|
1413
|
+
} }), T(b)]);
|
|
1414
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
926
1415
|
ref: C,
|
|
927
1416
|
style: { display: "inline-flex" },
|
|
928
|
-
"aria-describedby":
|
|
1417
|
+
"aria-describedby": l ? y : void 0,
|
|
929
1418
|
...j(),
|
|
930
1419
|
children: e
|
|
931
|
-
}), /* @__PURE__ */
|
|
1420
|
+
}), /* @__PURE__ */ h(_, { children: l && n && /* @__PURE__ */ h(wt, {
|
|
932
1421
|
id: y,
|
|
933
|
-
ref:
|
|
1422
|
+
ref: w,
|
|
934
1423
|
content: n,
|
|
935
|
-
arrowRef:
|
|
1424
|
+
arrowRef: p,
|
|
936
1425
|
arrowX: k,
|
|
937
1426
|
arrowY: A,
|
|
938
1427
|
role: "tooltip",
|
|
@@ -945,10 +1434,10 @@ var tt = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
945
1434
|
...M()
|
|
946
1435
|
}) })] });
|
|
947
1436
|
};
|
|
948
|
-
|
|
1437
|
+
Tt.displayName = "Tooltip";
|
|
949
1438
|
//#endregion
|
|
950
1439
|
//#region src/utils/devWarning.ts
|
|
951
|
-
var
|
|
1440
|
+
var Et = (e, t) => {
|
|
952
1441
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
953
1442
|
}, X = {
|
|
954
1443
|
button: "_button_2nghu_1",
|
|
@@ -978,104 +1467,104 @@ var nt = (e, t) => {
|
|
|
978
1467
|
"button-spin": "_button-spin_2nghu_1",
|
|
979
1468
|
badge: "_badge_2nghu_786",
|
|
980
1469
|
shortcut: "_shortcut_2nghu_800"
|
|
981
|
-
},
|
|
982
|
-
let I = S &&
|
|
983
|
-
[X.disabled]:
|
|
1470
|
+
}, Dt = r(({ children: e, color: n = "primary", appearance: r = "solid", size: a = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: p, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...P }, F) => {
|
|
1471
|
+
let I = S && i(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"]), B = c || l, te = l && u ? u : L, ne = u && L && !R && (typeof L == "string" || typeof L == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? L : u) : void 0, re = O === "_blank" && !k ? "noreferrer noopener" : k, ie = z(X.button, X[n], X[r], X[a], X[o], C, {
|
|
1472
|
+
[X.disabled]: B,
|
|
984
1473
|
[X.loading]: l,
|
|
985
1474
|
[X.fullWidth]: b,
|
|
986
|
-
[X.iconOnly]:
|
|
1475
|
+
[X.iconOnly]: R
|
|
987
1476
|
});
|
|
988
|
-
|
|
989
|
-
let
|
|
1477
|
+
Et(!S || !D, "Button: pass href to the child element when using asChild."), Et(!S || !!I, "Button: asChild requires a single valid React element child."), Et(!R || ee, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
1478
|
+
let ae = (e) => {
|
|
990
1479
|
e.preventDefault(), e.stopPropagation();
|
|
991
|
-
},
|
|
992
|
-
if (
|
|
993
|
-
|
|
1480
|
+
}, oe = (e) => {
|
|
1481
|
+
if (B) {
|
|
1482
|
+
ae(e);
|
|
994
1483
|
return;
|
|
995
1484
|
}
|
|
996
1485
|
I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
997
|
-
},
|
|
998
|
-
l && (
|
|
1486
|
+
}, V = /* @__PURE__ */ g(m, { children: [
|
|
1487
|
+
l && (p ? /* @__PURE__ */ h("span", {
|
|
999
1488
|
className: X.icon,
|
|
1000
1489
|
"aria-hidden": "true",
|
|
1001
|
-
children:
|
|
1002
|
-
}) : /* @__PURE__ */
|
|
1490
|
+
children: p
|
|
1491
|
+
}) : /* @__PURE__ */ h("span", {
|
|
1003
1492
|
className: X.spinner,
|
|
1004
1493
|
"aria-hidden": "true"
|
|
1005
1494
|
})),
|
|
1006
|
-
!l && d && /* @__PURE__ */
|
|
1495
|
+
!l && d && /* @__PURE__ */ h("span", {
|
|
1007
1496
|
className: X.icon,
|
|
1008
1497
|
children: d
|
|
1009
1498
|
}),
|
|
1010
|
-
|
|
1499
|
+
te && !R && /* @__PURE__ */ h("span", {
|
|
1011
1500
|
className: X.label,
|
|
1012
|
-
"data-measure":
|
|
1013
|
-
children: /* @__PURE__ */
|
|
1501
|
+
"data-measure": ne,
|
|
1502
|
+
children: /* @__PURE__ */ h("span", {
|
|
1014
1503
|
className: X.labelText,
|
|
1015
|
-
children:
|
|
1504
|
+
children: te
|
|
1016
1505
|
})
|
|
1017
1506
|
}),
|
|
1018
|
-
_ && !
|
|
1507
|
+
_ && !R && /* @__PURE__ */ h("span", {
|
|
1019
1508
|
className: X.badge,
|
|
1020
1509
|
children: _
|
|
1021
1510
|
}),
|
|
1022
|
-
v && !
|
|
1511
|
+
v && !R && /* @__PURE__ */ h("span", {
|
|
1023
1512
|
className: X.shortcut,
|
|
1024
1513
|
children: v
|
|
1025
1514
|
}),
|
|
1026
|
-
!l && f && /* @__PURE__ */
|
|
1515
|
+
!l && f && /* @__PURE__ */ h("span", {
|
|
1027
1516
|
className: X.icon,
|
|
1028
1517
|
children: f
|
|
1029
1518
|
})
|
|
1030
1519
|
] });
|
|
1031
|
-
return I ?
|
|
1520
|
+
return I ? t(I, {
|
|
1032
1521
|
...P,
|
|
1033
1522
|
ref: F,
|
|
1034
1523
|
"aria-busy": l || void 0,
|
|
1035
|
-
"aria-disabled":
|
|
1524
|
+
"aria-disabled": B || void 0,
|
|
1036
1525
|
"aria-label": T || I.props["aria-label"] || void 0,
|
|
1037
1526
|
"aria-labelledby": E || I.props["aria-labelledby"] || void 0,
|
|
1038
|
-
className:
|
|
1039
|
-
href:
|
|
1040
|
-
onClick:
|
|
1041
|
-
tabIndex:
|
|
1527
|
+
className: z(I.props.className, ie),
|
|
1528
|
+
href: B ? void 0 : I.props.href,
|
|
1529
|
+
onClick: oe,
|
|
1530
|
+
tabIndex: B ? -1 : I.props.tabIndex,
|
|
1042
1531
|
title: y || I.props.title,
|
|
1043
|
-
children:
|
|
1044
|
-
}) : D ? /* @__PURE__ */
|
|
1532
|
+
children: V
|
|
1533
|
+
}) : D ? /* @__PURE__ */ h("a", {
|
|
1045
1534
|
ref: F,
|
|
1046
|
-
href:
|
|
1535
|
+
href: B ? void 0 : D,
|
|
1047
1536
|
id: j,
|
|
1048
1537
|
role: M,
|
|
1049
|
-
tabIndex:
|
|
1538
|
+
tabIndex: B ? -1 : N,
|
|
1050
1539
|
target: O,
|
|
1051
|
-
rel:
|
|
1540
|
+
rel: re,
|
|
1052
1541
|
download: A,
|
|
1053
|
-
onClick:
|
|
1054
|
-
"aria-disabled":
|
|
1542
|
+
onClick: B ? ae : w,
|
|
1543
|
+
"aria-disabled": B || void 0,
|
|
1055
1544
|
"aria-label": T || void 0,
|
|
1056
1545
|
"aria-labelledby": E || void 0,
|
|
1057
1546
|
"aria-busy": l || void 0,
|
|
1058
|
-
className:
|
|
1547
|
+
className: ie,
|
|
1059
1548
|
title: y,
|
|
1060
|
-
children:
|
|
1061
|
-
}) : /* @__PURE__ */
|
|
1549
|
+
children: V
|
|
1550
|
+
}) : /* @__PURE__ */ h("button", {
|
|
1062
1551
|
...P,
|
|
1063
1552
|
ref: F,
|
|
1064
1553
|
id: j,
|
|
1065
1554
|
role: M,
|
|
1066
1555
|
tabIndex: N,
|
|
1067
1556
|
type: s,
|
|
1068
|
-
disabled:
|
|
1069
|
-
onClick:
|
|
1557
|
+
disabled: B,
|
|
1558
|
+
onClick: B ? void 0 : w,
|
|
1070
1559
|
"aria-label": T || void 0,
|
|
1071
1560
|
"aria-labelledby": E || void 0,
|
|
1072
1561
|
"aria-busy": l || void 0,
|
|
1073
|
-
className:
|
|
1562
|
+
className: ie,
|
|
1074
1563
|
title: y,
|
|
1075
|
-
children:
|
|
1564
|
+
children: V
|
|
1076
1565
|
});
|
|
1077
1566
|
});
|
|
1078
|
-
|
|
1567
|
+
Dt.displayName = "Button";
|
|
1079
1568
|
var Z = {
|
|
1080
1569
|
wrapper: "_wrapper_877rr_1",
|
|
1081
1570
|
colorPrimary: "_colorPrimary_877rr_27",
|
|
@@ -1109,62 +1598,62 @@ var Z = {
|
|
|
1109
1598
|
indeterminate: "_indeterminate_877rr_226",
|
|
1110
1599
|
"checkbox-pop": "_checkbox-pop_877rr_1",
|
|
1111
1600
|
disabled: "_disabled_877rr_354"
|
|
1112
|
-
},
|
|
1601
|
+
}, Ot = {
|
|
1113
1602
|
sm: Z.labelSm,
|
|
1114
1603
|
md: Z.labelMd,
|
|
1115
1604
|
lg: Z.labelLg
|
|
1116
|
-
},
|
|
1605
|
+
}, kt = {
|
|
1117
1606
|
sm: Z.wrapperSm,
|
|
1118
1607
|
md: Z.wrapperMd,
|
|
1119
1608
|
lg: Z.wrapperLg
|
|
1120
|
-
},
|
|
1609
|
+
}, At = {
|
|
1121
1610
|
sm: Z.containerSm,
|
|
1122
1611
|
md: Z.containerMd,
|
|
1123
1612
|
lg: Z.containerLg
|
|
1124
|
-
},
|
|
1613
|
+
}, jt = {
|
|
1125
1614
|
primary: Z.colorPrimary,
|
|
1126
1615
|
neutral: Z.colorNeutral,
|
|
1127
1616
|
success: Z.colorSuccess,
|
|
1128
1617
|
warning: Z.colorWarning,
|
|
1129
1618
|
danger: Z.colorDanger
|
|
1130
|
-
},
|
|
1131
|
-
let k =
|
|
1619
|
+
}, Mt = r(({ id: e, label: t, description: n, icon: r, indeterminateIcon: i, checked: o, size: l = "md", color: d = "primary", labelPosition: f = "end", defaultChecked: p = !1, disabled: m = !1, required: _ = !1, indeterminate: v = !1, className: y, wrapperClassName: b, onCheckedChange: x, error: S, "aria-label": C, "aria-labelledby": w, "aria-describedby": T, ...E }, D) => {
|
|
1620
|
+
let k = c(), A = e ?? k, j = u(null), M = !!S, N = n ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
|
|
1132
1621
|
T,
|
|
1133
|
-
|
|
1622
|
+
N,
|
|
1134
1623
|
F
|
|
1135
|
-
].filter(Boolean).join(" "), [L,
|
|
1136
|
-
value:
|
|
1624
|
+
].filter(Boolean).join(" "), [L, R] = O({
|
|
1625
|
+
value: o,
|
|
1137
1626
|
defaultValue: p,
|
|
1138
1627
|
onChange: x
|
|
1139
|
-
}),
|
|
1140
|
-
if (j.current = e, typeof
|
|
1141
|
-
|
|
1628
|
+
}), ee = a((e) => {
|
|
1629
|
+
if (j.current = e, typeof D == "function") {
|
|
1630
|
+
D(e);
|
|
1142
1631
|
return;
|
|
1143
1632
|
}
|
|
1144
|
-
|
|
1145
|
-
}, [
|
|
1146
|
-
|
|
1633
|
+
D && (D.current = e);
|
|
1634
|
+
}, [D]);
|
|
1635
|
+
s(() => {
|
|
1147
1636
|
j.current && (j.current.indeterminate = v);
|
|
1148
1637
|
}, [v]);
|
|
1149
|
-
let
|
|
1150
|
-
|
|
1638
|
+
let B = (e) => {
|
|
1639
|
+
R(e.target.checked);
|
|
1151
1640
|
};
|
|
1152
|
-
return
|
|
1153
|
-
className:
|
|
1641
|
+
return Et(!!(t || C || w), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ g("div", {
|
|
1642
|
+
className: z(Z.container, At[l], f === "start" && Z.containerLabelStart, y),
|
|
1154
1643
|
children: [
|
|
1155
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ g("label", {
|
|
1156
1645
|
htmlFor: A,
|
|
1157
|
-
className:
|
|
1646
|
+
className: z(Z.wrapper, kt[l], jt[d], f === "start" && Z.labelStart, !t && Z.iconOnly, m && Z.disabled, b),
|
|
1158
1647
|
children: [
|
|
1159
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ h("input", {
|
|
1160
1649
|
...E,
|
|
1161
|
-
ref:
|
|
1650
|
+
ref: ee,
|
|
1162
1651
|
id: A,
|
|
1163
1652
|
type: "checkbox",
|
|
1164
1653
|
checked: L,
|
|
1165
|
-
disabled:
|
|
1654
|
+
disabled: m,
|
|
1166
1655
|
required: _,
|
|
1167
|
-
onChange:
|
|
1656
|
+
onChange: B,
|
|
1168
1657
|
className: Z.input,
|
|
1169
1658
|
"aria-label": C,
|
|
1170
1659
|
"aria-labelledby": w,
|
|
@@ -1172,20 +1661,20 @@ var Z = {
|
|
|
1172
1661
|
"aria-invalid": M ? !0 : E["aria-invalid"],
|
|
1173
1662
|
"aria-describedby": I || void 0
|
|
1174
1663
|
}),
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
className:
|
|
1664
|
+
/* @__PURE__ */ h("span", {
|
|
1665
|
+
className: z(Z.customCheckbox, M && Z.error, v && Z.indeterminate),
|
|
1177
1666
|
"aria-hidden": "true",
|
|
1178
|
-
children: v ? /* @__PURE__ */
|
|
1179
|
-
className:
|
|
1180
|
-
children:
|
|
1181
|
-
}) : L && /* @__PURE__ */
|
|
1667
|
+
children: v ? /* @__PURE__ */ h("span", {
|
|
1668
|
+
className: z(Z.indeterminateMark, i && Z.customMark),
|
|
1669
|
+
children: i
|
|
1670
|
+
}) : L && /* @__PURE__ */ h("span", {
|
|
1182
1671
|
className: Z.checkmark,
|
|
1183
|
-
children: r ?? /* @__PURE__ */
|
|
1672
|
+
children: r ?? /* @__PURE__ */ h(P, {})
|
|
1184
1673
|
})
|
|
1185
1674
|
}),
|
|
1186
|
-
t && /* @__PURE__ */
|
|
1187
|
-
className:
|
|
1188
|
-
children: [t, _ && /* @__PURE__ */
|
|
1675
|
+
t && /* @__PURE__ */ g("span", {
|
|
1676
|
+
className: z(Z.label, Ot[l]),
|
|
1677
|
+
children: [t, _ && /* @__PURE__ */ h("span", {
|
|
1189
1678
|
className: Z.requiredMark,
|
|
1190
1679
|
"aria-hidden": "true",
|
|
1191
1680
|
children: "*"
|
|
@@ -1193,12 +1682,12 @@ var Z = {
|
|
|
1193
1682
|
})
|
|
1194
1683
|
]
|
|
1195
1684
|
}),
|
|
1196
|
-
n && /* @__PURE__ */
|
|
1197
|
-
id:
|
|
1685
|
+
n && /* @__PURE__ */ h("span", {
|
|
1686
|
+
id: N,
|
|
1198
1687
|
className: Z.descriptionText,
|
|
1199
1688
|
children: n
|
|
1200
1689
|
}),
|
|
1201
|
-
M && /* @__PURE__ */
|
|
1690
|
+
M && /* @__PURE__ */ h("span", {
|
|
1202
1691
|
id: F,
|
|
1203
1692
|
className: Z.errorText,
|
|
1204
1693
|
children: S
|
|
@@ -1206,7 +1695,7 @@ var Z = {
|
|
|
1206
1695
|
]
|
|
1207
1696
|
});
|
|
1208
1697
|
});
|
|
1209
|
-
|
|
1698
|
+
Mt.displayName = "Checkbox";
|
|
1210
1699
|
var Q = {
|
|
1211
1700
|
inputGroup: "_inputGroup_151bq_1",
|
|
1212
1701
|
primary: "_primary_151bq_29",
|
|
@@ -1248,7 +1737,7 @@ var Q = {
|
|
|
1248
1737
|
toneDanger: "_toneDanger_151bq_873",
|
|
1249
1738
|
toneMuted: "_toneMuted_151bq_877",
|
|
1250
1739
|
toneInverse: "_toneInverse_151bq_881"
|
|
1251
|
-
},
|
|
1740
|
+
}, Nt = {
|
|
1252
1741
|
default: Q.toneDefault,
|
|
1253
1742
|
primary: Q.tonePrimary,
|
|
1254
1743
|
secondary: Q.toneSecondary,
|
|
@@ -1256,7 +1745,7 @@ var Q = {
|
|
|
1256
1745
|
danger: Q.toneDanger,
|
|
1257
1746
|
muted: Q.toneMuted,
|
|
1258
1747
|
inverse: Q.toneInverse
|
|
1259
|
-
},
|
|
1748
|
+
}, Pt = (e = "text", t) => {
|
|
1260
1749
|
if (t) return t;
|
|
1261
1750
|
switch (e) {
|
|
1262
1751
|
case "email": return "email";
|
|
@@ -1266,7 +1755,7 @@ var Q = {
|
|
|
1266
1755
|
case "search": return "off";
|
|
1267
1756
|
default: return;
|
|
1268
1757
|
}
|
|
1269
|
-
},
|
|
1758
|
+
}, Ft = (e, t) => {
|
|
1270
1759
|
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
1271
1760
|
for (let e of t) {
|
|
1272
1761
|
if (e === "#") {
|
|
@@ -1278,149 +1767,149 @@ var Q = {
|
|
|
1278
1767
|
r < n.length && (i += e);
|
|
1279
1768
|
}
|
|
1280
1769
|
return i;
|
|
1281
|
-
},
|
|
1282
|
-
let
|
|
1283
|
-
|
|
1284
|
-
!
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
].filter(Boolean).join(" "),
|
|
1289
|
-
if (
|
|
1290
|
-
|
|
1770
|
+
}, It = (e, t) => t ? typeof t == "function" ? t(e) : Ft(e, t) : e, Lt = r(({ id: e, label: t, name: n, description: r, placeholder: i, value: o, defaultValue: s, type: l = "text", size: f, color: p = "primary", variant: _ = "outline", error: v, invalid: y = !1, disabled: b = !1, required: x = !1, loading: S = !1, className: C, wrapperClassName: w, autoComplete: T, readOnly: E = !1, clearable: D = !1, onClear: O, onValueChange: k, revealPassword: A = !1, showCounter: j = !1, startIcon: M, endIcon: N, startAddon: P, endAddon: F, prefix: I, suffix: R, clearIcon: ee, mask: B, format: te, parse: ne, startIconTone: re = "default", endIconTone: ie = "default", clearIconTone: ae = "danger", autoFocus: oe, maxLength: V, onMouseEnter: se, onMouseLeave: ce, "aria-describedby": le, "aria-invalid": ue, "aria-labelledby": de, ...fe }, pe) => {
|
|
1771
|
+
let me = c(), he = Ie(), ge = !!(t || r || v), _e = e ?? (ge ? void 0 : he?.controlId) ?? me, ve = u(null), [ye, be] = d(!1), [xe, H] = d(s ?? ""), U = o !== void 0, W = String((U ? o : xe) ?? ""), Se = te ? te(W) : W, Ce = W.length > 0, we = f ?? he?.size ?? "md", Te = y || !!v || !ge && !!he?.invalid, Ee = b || !ge && !!he?.disabled, De = x || !ge && !!he?.required, Oe = E || S, ke = l === "password", Ae = ke && A && ye ? "text" : l, je = M ?? (l === "search" ? /* @__PURE__ */ h(L, {}) : null), Me = N, Ne = Pt(l, T), G = S && !Ee, Pe = D && Ce && !Ee && !Oe && !G, Fe = A && ke && !Ee && !G && !Pe, K = !G && !Pe && !Fe && !!Me, Le = !!(j && V), q = r ? `${_e}-description` : void 0, ze = v ? `${_e}-error` : void 0, J = Le ? `${_e}-counter` : void 0, Be = [
|
|
1772
|
+
le,
|
|
1773
|
+
!ge && !le ? he?.ariaDescribedBy : void 0,
|
|
1774
|
+
q,
|
|
1775
|
+
ze,
|
|
1776
|
+
J
|
|
1777
|
+
].filter(Boolean).join(" "), Y = ee ?? "×", Ve = !!(je || I), He = !!(Me || R || Pe || Fe || G), Ue = !!(je && I), We = !!(Me && R), Ge = !!(P || F), Ke = a((e) => {
|
|
1778
|
+
if (ve.current = e, typeof pe == "function") {
|
|
1779
|
+
pe(e);
|
|
1291
1780
|
return;
|
|
1292
1781
|
}
|
|
1293
|
-
|
|
1294
|
-
}, [
|
|
1295
|
-
let t =
|
|
1296
|
-
|
|
1782
|
+
pe && (pe.current = e);
|
|
1783
|
+
}, [pe]), qe = a((e) => {
|
|
1784
|
+
let t = It(ne ? ne(e.target.value) : e.target.value, B);
|
|
1785
|
+
U || H(t), k?.(t);
|
|
1297
1786
|
}, [
|
|
1298
|
-
|
|
1299
|
-
|
|
1787
|
+
U,
|
|
1788
|
+
B,
|
|
1300
1789
|
k,
|
|
1301
|
-
|
|
1302
|
-
]), Je =
|
|
1303
|
-
|
|
1790
|
+
ne
|
|
1791
|
+
]), Je = a(() => {
|
|
1792
|
+
U || H(""), k?.(""), O?.(), ve.current?.focus();
|
|
1304
1793
|
}, [
|
|
1305
|
-
|
|
1794
|
+
U,
|
|
1306
1795
|
O,
|
|
1307
1796
|
k
|
|
1308
|
-
]), Ye = /* @__PURE__ */
|
|
1309
|
-
className:
|
|
1797
|
+
]), Ye = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
|
|
1798
|
+
className: z(Q.inputGroup, Q[_], Q[p], {
|
|
1310
1799
|
[Q.hasAddons]: Ge,
|
|
1311
|
-
[Q.isDisabled]:
|
|
1312
|
-
[Q.isInvalid]:
|
|
1313
|
-
[Q.isLoading]:
|
|
1800
|
+
[Q.isDisabled]: Ee,
|
|
1801
|
+
[Q.isInvalid]: Te,
|
|
1802
|
+
[Q.isLoading]: G
|
|
1314
1803
|
}),
|
|
1315
1804
|
children: [
|
|
1316
|
-
P && /* @__PURE__ */
|
|
1805
|
+
P && /* @__PURE__ */ h("span", {
|
|
1317
1806
|
className: Q.addon,
|
|
1318
1807
|
children: P
|
|
1319
1808
|
}),
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
className:
|
|
1809
|
+
/* @__PURE__ */ g("div", {
|
|
1810
|
+
className: z(Q.inputWrapper, {
|
|
1322
1811
|
[Q.hasLeftAdornment]: Ve,
|
|
1323
1812
|
[Q.hasRightAdornment]: He,
|
|
1324
1813
|
[Q.hasStartIconAndPrefix]: Ue,
|
|
1325
1814
|
[Q.hasEndIconAndSuffix]: We
|
|
1326
1815
|
}),
|
|
1327
1816
|
children: [
|
|
1328
|
-
|
|
1817
|
+
je && /* @__PURE__ */ h("span", {
|
|
1329
1818
|
"aria-hidden": "true",
|
|
1330
|
-
className:
|
|
1331
|
-
children:
|
|
1819
|
+
className: z(Q.startAdornment, Nt[re]),
|
|
1820
|
+
children: je
|
|
1332
1821
|
}),
|
|
1333
|
-
|
|
1822
|
+
I && /* @__PURE__ */ h("span", {
|
|
1334
1823
|
className: Q.prefix,
|
|
1335
|
-
children:
|
|
1824
|
+
children: I
|
|
1336
1825
|
}),
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
...
|
|
1826
|
+
/* @__PURE__ */ h("input", {
|
|
1827
|
+
...fe,
|
|
1339
1828
|
ref: Ke,
|
|
1340
|
-
id:
|
|
1829
|
+
id: _e,
|
|
1341
1830
|
name: n,
|
|
1342
|
-
type:
|
|
1343
|
-
autoComplete:
|
|
1344
|
-
className:
|
|
1345
|
-
value:
|
|
1831
|
+
type: Ae,
|
|
1832
|
+
autoComplete: Ne,
|
|
1833
|
+
className: z(Q.input, Q[we], { [Q.error]: Te }, C),
|
|
1834
|
+
value: Se,
|
|
1346
1835
|
onChange: qe,
|
|
1347
|
-
placeholder:
|
|
1348
|
-
disabled:
|
|
1349
|
-
readOnly:
|
|
1350
|
-
required:
|
|
1351
|
-
autoFocus:
|
|
1352
|
-
maxLength:
|
|
1353
|
-
"aria-invalid":
|
|
1354
|
-
"aria-labelledby":
|
|
1355
|
-
"aria-describedby":
|
|
1836
|
+
placeholder: i,
|
|
1837
|
+
disabled: Ee,
|
|
1838
|
+
readOnly: Oe,
|
|
1839
|
+
required: De,
|
|
1840
|
+
autoFocus: oe,
|
|
1841
|
+
maxLength: V,
|
|
1842
|
+
"aria-invalid": Te ? !0 : ue,
|
|
1843
|
+
"aria-labelledby": de ?? (ge ? void 0 : he?.ariaLabelledBy),
|
|
1844
|
+
"aria-describedby": Be || void 0,
|
|
1356
1845
|
"aria-busy": S || void 0,
|
|
1357
|
-
onMouseEnter:
|
|
1358
|
-
onMouseLeave:
|
|
1846
|
+
onMouseEnter: se,
|
|
1847
|
+
onMouseLeave: ce
|
|
1359
1848
|
}),
|
|
1360
|
-
|
|
1849
|
+
R && /* @__PURE__ */ h("span", {
|
|
1361
1850
|
className: Q.suffix,
|
|
1362
|
-
children:
|
|
1851
|
+
children: R
|
|
1363
1852
|
}),
|
|
1364
|
-
/* @__PURE__ */
|
|
1853
|
+
/* @__PURE__ */ g("div", {
|
|
1365
1854
|
className: Q.endSlot,
|
|
1366
1855
|
children: [
|
|
1367
|
-
|
|
1856
|
+
G && /* @__PURE__ */ h("span", {
|
|
1368
1857
|
className: Q.spinner,
|
|
1369
1858
|
"aria-hidden": "true",
|
|
1370
1859
|
"data-testid": "input-spinner"
|
|
1371
1860
|
}),
|
|
1372
|
-
|
|
1861
|
+
Fe && /* @__PURE__ */ h("button", {
|
|
1373
1862
|
type: "button",
|
|
1374
1863
|
className: Q.iconButton,
|
|
1375
|
-
onClick: () =>
|
|
1376
|
-
"aria-label":
|
|
1377
|
-
children:
|
|
1864
|
+
onClick: () => be((e) => !e),
|
|
1865
|
+
"aria-label": ye ? "Hide password" : "Show password",
|
|
1866
|
+
children: ye ? "Hide" : "Show"
|
|
1378
1867
|
}),
|
|
1379
|
-
|
|
1868
|
+
Pe && /* @__PURE__ */ h("button", {
|
|
1380
1869
|
type: "button",
|
|
1381
|
-
className:
|
|
1870
|
+
className: z(Q.clearButton, Nt[ae]),
|
|
1382
1871
|
onClick: Je,
|
|
1383
1872
|
"aria-label": "Clear input",
|
|
1384
|
-
children:
|
|
1873
|
+
children: Y
|
|
1385
1874
|
}),
|
|
1386
|
-
|
|
1875
|
+
K && Me && /* @__PURE__ */ h("span", {
|
|
1387
1876
|
"aria-hidden": "true",
|
|
1388
|
-
className:
|
|
1389
|
-
children:
|
|
1877
|
+
className: z(Q.endAdornment, Nt[ie]),
|
|
1878
|
+
children: Me
|
|
1390
1879
|
})
|
|
1391
1880
|
]
|
|
1392
1881
|
})
|
|
1393
1882
|
]
|
|
1394
1883
|
}),
|
|
1395
|
-
F && /* @__PURE__ */
|
|
1884
|
+
F && /* @__PURE__ */ h("span", {
|
|
1396
1885
|
className: Q.addon,
|
|
1397
1886
|
children: F
|
|
1398
1887
|
})
|
|
1399
1888
|
]
|
|
1400
|
-
}),
|
|
1401
|
-
id:
|
|
1889
|
+
}), Le && /* @__PURE__ */ g("div", {
|
|
1890
|
+
id: J,
|
|
1402
1891
|
className: Q.counter,
|
|
1403
1892
|
children: [
|
|
1404
|
-
|
|
1893
|
+
W.length,
|
|
1405
1894
|
" / ",
|
|
1406
|
-
|
|
1895
|
+
V
|
|
1407
1896
|
]
|
|
1408
1897
|
})] });
|
|
1409
|
-
return !
|
|
1410
|
-
id:
|
|
1898
|
+
return !ge && he ? Ye : /* @__PURE__ */ h(Re, {
|
|
1899
|
+
id: _e,
|
|
1411
1900
|
label: t,
|
|
1412
1901
|
description: r,
|
|
1413
1902
|
error: v,
|
|
1414
|
-
required:
|
|
1415
|
-
disabled:
|
|
1416
|
-
invalid:
|
|
1417
|
-
size:
|
|
1903
|
+
required: De,
|
|
1904
|
+
disabled: Ee,
|
|
1905
|
+
invalid: Te,
|
|
1906
|
+
size: we,
|
|
1418
1907
|
className: w,
|
|
1419
1908
|
bindControl: !1,
|
|
1420
1909
|
children: Ye
|
|
1421
1910
|
});
|
|
1422
1911
|
});
|
|
1423
|
-
|
|
1912
|
+
Lt.displayName = "Input";
|
|
1424
1913
|
var $ = {
|
|
1425
1914
|
root: "_root_qb9nm_1",
|
|
1426
1915
|
invalid: "_invalid_qb9nm_27",
|
|
@@ -1442,23 +1931,23 @@ var $ = {
|
|
|
1442
1931
|
customIcon: "_customIcon_qb9nm_216",
|
|
1443
1932
|
content: "_content_qb9nm_335",
|
|
1444
1933
|
error: "_error_qb9nm_352"
|
|
1445
|
-
},
|
|
1934
|
+
}, Rt = {
|
|
1446
1935
|
primary: $.colorPrimary,
|
|
1447
1936
|
neutral: $.colorNeutral,
|
|
1448
1937
|
success: $.colorSuccess,
|
|
1449
1938
|
warning: $.colorWarning,
|
|
1450
1939
|
danger: $.colorDanger
|
|
1451
|
-
},
|
|
1452
|
-
let S =
|
|
1940
|
+
}, zt = r(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: s, onCheckedChange: l, label: u, description: d, icon: f, wrapperClassName: p, className: m, id: _, name: v, "aria-describedby": y, ...b }, x) => {
|
|
1941
|
+
let S = Ne(), C = c(), w = _ ?? C, T = d ? `${w}-description` : void 0, E = s ? `${w}-error` : void 0, D = [
|
|
1453
1942
|
T,
|
|
1454
1943
|
E,
|
|
1455
1944
|
S?.describedBy,
|
|
1456
1945
|
y
|
|
1457
|
-
].filter(Boolean).join(" ") || void 0, k = S !== null, [A, j] =
|
|
1946
|
+
].filter(Boolean).join(" ") || void 0, k = S !== null, [A, j] = O({
|
|
1458
1947
|
value: t,
|
|
1459
1948
|
defaultValue: n,
|
|
1460
1949
|
onChange: l
|
|
1461
|
-
}), M = k ? S.value === e : A, N = !!S?.disabled || r, P = !!S?.required || i, F = S?.name ?? v, I = !!(
|
|
1950
|
+
}), M = k ? S.value === e : A, N = !!S?.disabled || r, P = !!S?.required || i, F = S?.name ?? v, I = !!(s || S?.invalid), L = a ?? S?.size ?? "md", R = o ?? S?.color ?? "primary", ee = (t) => {
|
|
1462
1951
|
if (!N) {
|
|
1463
1952
|
if (k) {
|
|
1464
1953
|
S.onValueChange(e);
|
|
@@ -1467,13 +1956,13 @@ var $ = {
|
|
|
1467
1956
|
j(t.currentTarget.checked);
|
|
1468
1957
|
}
|
|
1469
1958
|
};
|
|
1470
|
-
return /* @__PURE__ */
|
|
1471
|
-
className:
|
|
1472
|
-
children: [/* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ g("div", {
|
|
1960
|
+
className: z($.root, $[L], I && $.invalid, N && $.disabled, Rt[R], m),
|
|
1961
|
+
children: [/* @__PURE__ */ g("label", {
|
|
1473
1962
|
htmlFor: w,
|
|
1474
|
-
className:
|
|
1963
|
+
className: z($.wrapper, p),
|
|
1475
1964
|
children: [
|
|
1476
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ h("input", {
|
|
1477
1966
|
...b,
|
|
1478
1967
|
ref: x,
|
|
1479
1968
|
id: w,
|
|
@@ -1484,76 +1973,76 @@ var $ = {
|
|
|
1484
1973
|
disabled: N,
|
|
1485
1974
|
required: P,
|
|
1486
1975
|
"aria-invalid": I || void 0,
|
|
1487
|
-
"aria-describedby":
|
|
1976
|
+
"aria-describedby": D,
|
|
1488
1977
|
className: $.input,
|
|
1489
|
-
onChange:
|
|
1978
|
+
onChange: ee
|
|
1490
1979
|
}),
|
|
1491
|
-
/* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ h("span", {
|
|
1492
1981
|
className: $.control,
|
|
1493
1982
|
"aria-hidden": "true",
|
|
1494
|
-
children: /* @__PURE__ */
|
|
1495
|
-
className:
|
|
1983
|
+
children: /* @__PURE__ */ h("span", {
|
|
1984
|
+
className: z($.indicator, f && $.customIcon),
|
|
1496
1985
|
children: f
|
|
1497
1986
|
})
|
|
1498
1987
|
}),
|
|
1499
|
-
(u || d) && /* @__PURE__ */
|
|
1988
|
+
(u || d) && /* @__PURE__ */ g("span", {
|
|
1500
1989
|
className: $.content,
|
|
1501
|
-
children: [u && /* @__PURE__ */
|
|
1990
|
+
children: [u && /* @__PURE__ */ h("span", {
|
|
1502
1991
|
className: $.label,
|
|
1503
1992
|
children: u
|
|
1504
|
-
}), d && /* @__PURE__ */
|
|
1993
|
+
}), d && /* @__PURE__ */ h("span", {
|
|
1505
1994
|
id: T,
|
|
1506
1995
|
className: $.description,
|
|
1507
1996
|
children: d
|
|
1508
1997
|
})]
|
|
1509
1998
|
})
|
|
1510
1999
|
]
|
|
1511
|
-
}),
|
|
2000
|
+
}), s && /* @__PURE__ */ h("div", {
|
|
1512
2001
|
id: E,
|
|
1513
2002
|
className: $.error,
|
|
1514
|
-
children:
|
|
2003
|
+
children: s
|
|
1515
2004
|
})]
|
|
1516
2005
|
});
|
|
1517
2006
|
});
|
|
1518
|
-
|
|
2007
|
+
zt.displayName = "Radio";
|
|
1519
2008
|
//#endregion
|
|
1520
2009
|
//#region src/theme/ThemeContext.ts
|
|
1521
|
-
var
|
|
1522
|
-
let [i, a] =
|
|
2010
|
+
var Bt = n(null), Vt = (e) => e === "highContrast" ? "high-contrast" : e, Ht = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
2011
|
+
let [i, a] = O({
|
|
1523
2012
|
value: e,
|
|
1524
2013
|
defaultValue: t,
|
|
1525
2014
|
onChange: n
|
|
1526
|
-
}),
|
|
1527
|
-
|
|
2015
|
+
}), o = Vt(i);
|
|
2016
|
+
s(() => {
|
|
1528
2017
|
if (typeof document > "u") return;
|
|
1529
2018
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
1530
|
-
return e.dataset.velliraTheme =
|
|
2019
|
+
return e.dataset.velliraTheme = o, () => {
|
|
1531
2020
|
if (t === void 0) {
|
|
1532
2021
|
delete e.dataset.velliraTheme;
|
|
1533
2022
|
return;
|
|
1534
2023
|
}
|
|
1535
2024
|
e.dataset.velliraTheme = t;
|
|
1536
2025
|
};
|
|
1537
|
-
}, [
|
|
1538
|
-
let
|
|
2026
|
+
}, [o]);
|
|
2027
|
+
let c = l(() => ({
|
|
1539
2028
|
theme: i,
|
|
1540
2029
|
setTheme: a
|
|
1541
2030
|
}), [i, a]);
|
|
1542
|
-
return /* @__PURE__ */
|
|
1543
|
-
value:
|
|
1544
|
-
children: /* @__PURE__ */
|
|
1545
|
-
"data-vellira-theme":
|
|
2031
|
+
return /* @__PURE__ */ h(Bt.Provider, {
|
|
2032
|
+
value: c,
|
|
2033
|
+
children: /* @__PURE__ */ h("div", {
|
|
2034
|
+
"data-vellira-theme": o,
|
|
1546
2035
|
children: r
|
|
1547
2036
|
})
|
|
1548
2037
|
});
|
|
1549
2038
|
};
|
|
1550
|
-
|
|
2039
|
+
Ht.displayName = "ThemeProvider";
|
|
1551
2040
|
//#endregion
|
|
1552
2041
|
//#region src/theme/useTheme.ts
|
|
1553
|
-
function
|
|
1554
|
-
let e =
|
|
2042
|
+
function Ut() {
|
|
2043
|
+
let e = o(Bt);
|
|
1555
2044
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
1556
2045
|
return e;
|
|
1557
2046
|
}
|
|
1558
2047
|
//#endregion
|
|
1559
|
-
export {
|
|
2048
|
+
export { Dt as Button, Mt as Checkbox, ge as Dropdown, Re as FormField, Lt as Input, Ae as Modal, zt as Radio, Pe as RadioGroup, ut as Select, St as Tabs, Ht as ThemeProvider, Tt as Tooltip, Ut as useTheme };
|