@vellira-ui/react 2.28.0 → 2.30.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 +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +582 -413
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,20 +4,20 @@ import { createPortal as f } from "react-dom";
|
|
|
4
4
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
5
5
|
import { FloatingPortal as g, arrow as _, autoUpdate as v, flip as y, offset as b, shift as x, size as S, useFloating as C, useFocus as w, useHover as T, useInteractions as E } from "@floating-ui/react";
|
|
6
6
|
import { useControllableState as D, useDropdown as O, useModal as k, useSelect as A, useTabs as j, useTabsKeyboard as M } from "@vellira-ui/core";
|
|
7
|
-
import { Check as N, ChevronDown as P, Close as F } from "@vellira-ui/icons";
|
|
8
|
-
import
|
|
7
|
+
import { Check as N, ChevronDown as P, Close as F, Search as I } from "@vellira-ui/icons";
|
|
8
|
+
import L from "focus-trap-react";
|
|
9
9
|
//#region src/utils/cn.ts
|
|
10
|
-
var
|
|
10
|
+
var R = (...e) => d(e), z = ({ children: e }) => {
|
|
11
11
|
let [t, n] = u(!1);
|
|
12
12
|
if (o(() => {
|
|
13
13
|
n(!0);
|
|
14
14
|
}, []), !t) return null;
|
|
15
15
|
let r = document.getElementById("overlay-root") ?? document.body;
|
|
16
16
|
return r ? f(e, r) : null;
|
|
17
|
-
},
|
|
17
|
+
}, B = {
|
|
18
18
|
dropdown: "_dropdown_1rvx9_1",
|
|
19
19
|
"dropdown-in": "_dropdown-in_1rvx9_1"
|
|
20
|
-
},
|
|
20
|
+
}, V = n(({ children: e, floatingStyles: t, menuId: n, labelledById: r, label: i, activeDescendantId: a, onKeyDown: o, className: s }, c) => /* @__PURE__ */ m(z, { children: /* @__PURE__ */ m("ul", {
|
|
21
21
|
ref: c,
|
|
22
22
|
id: n,
|
|
23
23
|
role: "menu",
|
|
@@ -27,13 +27,13 @@ var L = (...e) => d(e), R = ({ children: e }) => {
|
|
|
27
27
|
"aria-activedescendant": a,
|
|
28
28
|
onKeyDown: o,
|
|
29
29
|
style: t,
|
|
30
|
-
className:
|
|
30
|
+
className: R(B.dropdown, s),
|
|
31
31
|
children: e
|
|
32
32
|
}) }));
|
|
33
|
-
|
|
33
|
+
V.displayName = "DropdownContent";
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region src/hooks/useFloatingPosition.ts
|
|
36
|
-
var
|
|
36
|
+
var H = (e) => {
|
|
37
37
|
let [t, n] = u(() => typeof window > "u" || typeof window.matchMedia != "function" || !e ? !1 : window.matchMedia(`(max-width: ${e}px)`).matches);
|
|
38
38
|
return o(() => {
|
|
39
39
|
if (typeof window > "u" || typeof window.matchMedia != "function" || !e) return;
|
|
@@ -43,7 +43,7 @@ var V = (e) => {
|
|
|
43
43
|
};
|
|
44
44
|
}, [e]), t;
|
|
45
45
|
}, ee = ({ open: e, onOpenChange: t, placement: n = "bottom-start", strategy: r = "fixed", matchTriggerWidth: i = !1, mobileSheetBreakpoint: a, middleware: s = [] } = {}) => {
|
|
46
|
-
let l =
|
|
46
|
+
let l = H(a), { refs: u, floatingStyles: d, update: f, context: p, middlewareData: m, placement: h } = C({
|
|
47
47
|
open: e,
|
|
48
48
|
onOpenChange: t,
|
|
49
49
|
placement: n,
|
|
@@ -88,9 +88,9 @@ var V = (e) => {
|
|
|
88
88
|
};
|
|
89
89
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
90
90
|
}, [n]);
|
|
91
|
-
},
|
|
91
|
+
}, ne = { group: "_group_aviwv_1" }, re = ({ label: e }) => /* @__PURE__ */ m("li", {
|
|
92
92
|
role: "presentation",
|
|
93
|
-
className:
|
|
93
|
+
className: ne.group,
|
|
94
94
|
children: e
|
|
95
95
|
}), U = {
|
|
96
96
|
item: "_item_re11y_1",
|
|
@@ -103,7 +103,7 @@ var V = (e) => {
|
|
|
103
103
|
"itemText--truncate": "_itemText--truncate_re11y_88",
|
|
104
104
|
"itemText--wrap": "_itemText--wrap_re11y_93",
|
|
105
105
|
"itemText--nowrap": "_itemText--nowrap_re11y_97"
|
|
106
|
-
},
|
|
106
|
+
}, ie = ({ 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
107
|
let f = t || n;
|
|
108
108
|
return /* @__PURE__ */ h("li", {
|
|
109
109
|
id: e,
|
|
@@ -114,7 +114,7 @@ var V = (e) => {
|
|
|
114
114
|
"data-danger": i || void 0,
|
|
115
115
|
onClick: a ? void 0 : s,
|
|
116
116
|
onMouseEnter: a ? void 0 : c,
|
|
117
|
-
className:
|
|
117
|
+
className: R(U.item, {
|
|
118
118
|
[U.active]: o,
|
|
119
119
|
[U.disabled]: a,
|
|
120
120
|
[U.danger]: i
|
|
@@ -126,7 +126,7 @@ var V = (e) => {
|
|
|
126
126
|
children: r
|
|
127
127
|
}),
|
|
128
128
|
f && /* @__PURE__ */ m("span", {
|
|
129
|
-
className:
|
|
129
|
+
className: R(U.itemText, U[`itemText--${u}`]),
|
|
130
130
|
children: f
|
|
131
131
|
}),
|
|
132
132
|
l && /* @__PURE__ */ m("span", {
|
|
@@ -135,11 +135,11 @@ var V = (e) => {
|
|
|
135
135
|
})
|
|
136
136
|
]
|
|
137
137
|
});
|
|
138
|
-
},
|
|
138
|
+
}, ae = { separator: "_separator_1v11r_1" }, oe = () => /* @__PURE__ */ m("li", {
|
|
139
139
|
role: "separator",
|
|
140
|
-
className:
|
|
140
|
+
className: ae.separator,
|
|
141
141
|
"aria-hidden": "true"
|
|
142
|
-
}),
|
|
142
|
+
}), W = {
|
|
143
143
|
button: "_button_18ucr_1",
|
|
144
144
|
disabled: "_disabled_18ucr_20",
|
|
145
145
|
iconLeft: "_iconLeft_18ucr_32",
|
|
@@ -149,15 +149,15 @@ var V = (e) => {
|
|
|
149
149
|
md: "_md_18ucr_72",
|
|
150
150
|
lg: "_lg_18ucr_84",
|
|
151
151
|
open: "_open_18ucr_123"
|
|
152
|
-
},
|
|
152
|
+
}, se = n(({ 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) => {
|
|
153
153
|
let f = !!n, p = !!e, g = f && !p, _ = i && p, v = r ?? /* @__PURE__ */ m(P, {}), y = c ?? (g ? typeof s == "string" ? s : "Open menu" : void 0);
|
|
154
154
|
return /* @__PURE__ */ h("button", {
|
|
155
155
|
...u,
|
|
156
156
|
ref: d,
|
|
157
157
|
type: "button",
|
|
158
|
-
className:
|
|
159
|
-
[
|
|
160
|
-
[
|
|
158
|
+
className: R(W.button, W[o], {
|
|
159
|
+
[W.disabled]: u.disabled,
|
|
160
|
+
[W.iconOnly]: g
|
|
161
161
|
}, l),
|
|
162
162
|
"aria-label": y,
|
|
163
163
|
"aria-expanded": t,
|
|
@@ -166,30 +166,30 @@ var V = (e) => {
|
|
|
166
166
|
children: [
|
|
167
167
|
f && /* @__PURE__ */ m("span", {
|
|
168
168
|
"aria-hidden": "true",
|
|
169
|
-
className:
|
|
169
|
+
className: W.iconLeft,
|
|
170
170
|
children: n
|
|
171
171
|
}),
|
|
172
172
|
e,
|
|
173
173
|
_ && /* @__PURE__ */ m("span", {
|
|
174
174
|
"aria-hidden": "true",
|
|
175
|
-
className:
|
|
175
|
+
className: R(W.arrow, { [W.open]: t }),
|
|
176
176
|
children: v
|
|
177
177
|
})
|
|
178
178
|
]
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
|
-
|
|
181
|
+
se.displayName = "DropdownTrigger";
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/components/Dropdown/types.ts
|
|
184
|
-
var
|
|
184
|
+
var ce = (e) => e.type === void 0 || e.type === "item", le = (e) => e.type === "group", ue = (e) => e.type === "separator", de = { wrapper: "_wrapper_14ue8_1" }, G = ({ label: e, ariaLabel: t, icon: n, trigger: r, items: a = [], onSelect: o, open: u, defaultOpen: d = !1, onOpenChange: f, size: p = "md", className: g, triggerClassName: _, contentClassName: v, itemClassName: y, disabled: b, rotateAngle: x = 90, placement: S, matchTriggerWidth: C, textWrap: w, showArrow: T = !0, arrowIcon: E }) => {
|
|
185
185
|
let D = l(null), k = l(null), A = s(), j = `${A}-trigger`, { floatingStyles: M, setRef: N, setFloatingRef: P } = ee({
|
|
186
186
|
placement: S,
|
|
187
187
|
matchTriggerWidth: C,
|
|
188
188
|
mobileSheetBreakpoint: 640
|
|
189
|
-
}), F = c(() => a.flatMap((e, t) =>
|
|
189
|
+
}), F = c(() => a.flatMap((e, t) => ce(e) ? [{
|
|
190
190
|
item: e,
|
|
191
191
|
itemIndex: t
|
|
192
|
-
}] : []), [a]), I = c(() => F.map(({ item: e }) => e), [F]),
|
|
192
|
+
}] : []), [a]), I = c(() => F.map(({ item: e }) => e), [F]), L = c(() => new Map(F.map(({ itemIndex: e }, t) => [e, t])), [F]), { activeIndex: z, setActiveIndex: B, isOpen: H, closeDropdown: ne, toggleDropdown: U, selectItem: ae, onKeyDown: W } = O({
|
|
193
193
|
items: I,
|
|
194
194
|
open: u,
|
|
195
195
|
defaultOpen: d,
|
|
@@ -200,19 +200,19 @@ var oe = (e) => e.type === void 0 || e.type === "item", se = (e) => e.type === "
|
|
|
200
200
|
}, [o]),
|
|
201
201
|
getItemValue: (e) => e.value,
|
|
202
202
|
getItemText: (e) => typeof e.label == "string" ? e.label : e.value
|
|
203
|
-
}),
|
|
204
|
-
te([D, k],
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
}, [H,
|
|
203
|
+
}), G = H && z >= 0 ? `${A}-item-${z}` : void 0;
|
|
204
|
+
te([D, k], ne, H);
|
|
205
|
+
let K = i((e) => {
|
|
206
|
+
W(e), H && e.key === "Escape" && D.current?.focus();
|
|
207
|
+
}, [H, W]), fe = i((e) => {
|
|
208
208
|
D.current = e, N(e);
|
|
209
|
-
}, [N]),
|
|
209
|
+
}, [N]), pe = i((e) => {
|
|
210
210
|
k.current = e, P(e), e?.focus();
|
|
211
211
|
}, [P]);
|
|
212
212
|
return /* @__PURE__ */ h("div", {
|
|
213
|
-
className:
|
|
214
|
-
children: [/* @__PURE__ */ m(
|
|
215
|
-
ref:
|
|
213
|
+
className: R(de.wrapper, g),
|
|
214
|
+
children: [/* @__PURE__ */ m(se, {
|
|
215
|
+
ref: fe,
|
|
216
216
|
id: j,
|
|
217
217
|
isOpen: H,
|
|
218
218
|
disabled: b,
|
|
@@ -224,37 +224,37 @@ var oe = (e) => e.type === void 0 || e.type === "item", se = (e) => e.type === "
|
|
|
224
224
|
arrowIcon: E,
|
|
225
225
|
rotateAngle: x,
|
|
226
226
|
className: _,
|
|
227
|
-
onClick:
|
|
228
|
-
onKeyDown:
|
|
227
|
+
onClick: U,
|
|
228
|
+
onKeyDown: K,
|
|
229
229
|
"aria-expanded": H,
|
|
230
230
|
"aria-haspopup": "menu",
|
|
231
231
|
...H && { "aria-controls": A },
|
|
232
232
|
children: r
|
|
233
|
-
}), H && /* @__PURE__ */ m(
|
|
234
|
-
ref:
|
|
233
|
+
}), H && /* @__PURE__ */ m(V, {
|
|
234
|
+
ref: pe,
|
|
235
235
|
floatingStyles: M,
|
|
236
236
|
menuId: A,
|
|
237
237
|
labelledById: r ? j : void 0,
|
|
238
238
|
label: t ?? (!r && typeof e == "string" ? e : void 0),
|
|
239
|
-
activeDescendantId:
|
|
240
|
-
onKeyDown:
|
|
239
|
+
activeDescendantId: G,
|
|
240
|
+
onKeyDown: K,
|
|
241
241
|
className: v,
|
|
242
242
|
children: a.map((e, t) => {
|
|
243
|
-
if (
|
|
244
|
-
if (
|
|
245
|
-
if (
|
|
246
|
-
let n =
|
|
247
|
-
return /* @__PURE__ */ m(
|
|
243
|
+
if (le(e)) return /* @__PURE__ */ m(re, { label: e.label }, `group-${e.label}`);
|
|
244
|
+
if (ue(e)) return /* @__PURE__ */ m(oe, {}, `separator-${t}`);
|
|
245
|
+
if (ce(e)) {
|
|
246
|
+
let n = L.get(t) ?? -1;
|
|
247
|
+
return /* @__PURE__ */ m(ie, {
|
|
248
248
|
id: `${A}-item-${n}`,
|
|
249
249
|
...e,
|
|
250
250
|
active: z === n,
|
|
251
251
|
textWrap: e.textWrap || w,
|
|
252
252
|
className: y,
|
|
253
253
|
onClick: () => {
|
|
254
|
-
|
|
254
|
+
ae(e), D.current?.focus();
|
|
255
255
|
},
|
|
256
256
|
onMouseEnter: () => {
|
|
257
|
-
n < 0 || e.disabled ||
|
|
257
|
+
n < 0 || e.disabled || B(n);
|
|
258
258
|
},
|
|
259
259
|
children: e.label
|
|
260
260
|
}, `${e.value}-${t}`);
|
|
@@ -262,12 +262,12 @@ var oe = (e) => e.type === void 0 || e.type === "item", se = (e) => e.type === "
|
|
|
262
262
|
})
|
|
263
263
|
})]
|
|
264
264
|
});
|
|
265
|
-
},
|
|
266
|
-
let e = a(
|
|
265
|
+
}, K = t(void 0), fe = () => {
|
|
266
|
+
let e = a(K);
|
|
267
267
|
if (e === void 0) throw Error("Modal compound components must be used inside Modal");
|
|
268
268
|
return e;
|
|
269
269
|
};
|
|
270
|
-
|
|
270
|
+
K.displayName = "ModalContext";
|
|
271
271
|
var pe = { modalBody: "_modalBody_iv33a_1" }, me = ({ children: e }) => {
|
|
272
272
|
let { descriptionId: t } = fe();
|
|
273
273
|
return /* @__PURE__ */ m("div", {
|
|
@@ -332,14 +332,14 @@ var xe = ({ isOpen: e, onClose: t }) => {
|
|
|
332
332
|
if (n) return Ce === 0 && (we = document.body.style.overflow), Ce += 1, document.body.style.overflow = "hidden", () => {
|
|
333
333
|
Ce = Math.max(0, Ce - 1), Ce === 0 && (document.body.style.overflow = we);
|
|
334
334
|
};
|
|
335
|
-
}, [n]), !n && !d ? null : /* @__PURE__ */ m(
|
|
336
|
-
className:
|
|
335
|
+
}, [n]), !n && !d ? null : /* @__PURE__ */ m(z, { children: /* @__PURE__ */ m("div", {
|
|
336
|
+
className: R(Se.overlay, n && Se["overlay--open"], d && Se["overlay--animated"], r),
|
|
337
337
|
onClick: _,
|
|
338
338
|
tabIndex: -1,
|
|
339
339
|
role: "presentation",
|
|
340
340
|
"aria-hidden": !n,
|
|
341
341
|
style: { zIndex: u },
|
|
342
|
-
children: /* @__PURE__ */ m(
|
|
342
|
+
children: /* @__PURE__ */ m(L, {
|
|
343
343
|
active: n,
|
|
344
344
|
focusTrapOptions: {
|
|
345
345
|
fallbackFocus: () => p.current,
|
|
@@ -370,7 +370,7 @@ var Ee = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick
|
|
|
370
370
|
closeOnClick: i,
|
|
371
371
|
closeOnEsc: a
|
|
372
372
|
});
|
|
373
|
-
return o.shouldRender ? /* @__PURE__ */ m(
|
|
373
|
+
return o.shouldRender ? /* @__PURE__ */ m(K.Provider, {
|
|
374
374
|
value: {
|
|
375
375
|
onClose: o.onClose,
|
|
376
376
|
titleId: o.titleId,
|
|
@@ -397,7 +397,7 @@ var De = Object.assign(Ee, {
|
|
|
397
397
|
function Ae() {
|
|
398
398
|
return a(Oe);
|
|
399
399
|
}
|
|
400
|
-
var
|
|
400
|
+
var q = {
|
|
401
401
|
root: "_root_1n02e_1",
|
|
402
402
|
label: "_label_1n02e_9",
|
|
403
403
|
required: "_required_1n02e_21",
|
|
@@ -408,124 +408,173 @@ var K = {
|
|
|
408
408
|
error: "_error_1n02e_51",
|
|
409
409
|
disabled: "_disabled_1n02e_59",
|
|
410
410
|
invalid: "_invalid_1n02e_75"
|
|
411
|
-
}, je = n(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md",
|
|
412
|
-
let
|
|
411
|
+
}, je = n(({ value: e, defaultValue: t = "", onValueChange: n, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", name: c, label: l, description: u, error: d, orientation: f = "vertical", children: p, className: g, id: _, ...v }, y) => {
|
|
412
|
+
let b = s(), 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 = c ?? `${x}-radio`, [O, k] = D({
|
|
413
413
|
value: e,
|
|
414
414
|
defaultValue: t,
|
|
415
415
|
onChange: n
|
|
416
|
-
}),
|
|
416
|
+
}), A = !!d;
|
|
417
417
|
return /* @__PURE__ */ h("div", {
|
|
418
|
-
...
|
|
419
|
-
ref:
|
|
420
|
-
id:
|
|
418
|
+
...v,
|
|
419
|
+
ref: y,
|
|
420
|
+
id: x,
|
|
421
421
|
role: "radiogroup",
|
|
422
|
-
"aria-labelledby":
|
|
423
|
-
"aria-describedby":
|
|
422
|
+
"aria-labelledby": S,
|
|
423
|
+
"aria-describedby": T,
|
|
424
424
|
"aria-disabled": r || void 0,
|
|
425
425
|
"aria-required": i || void 0,
|
|
426
|
-
"aria-invalid":
|
|
427
|
-
className:
|
|
426
|
+
"aria-invalid": A || void 0,
|
|
427
|
+
className: R(q.root, A && q.invalid, r && q.disabled, g),
|
|
428
428
|
children: [
|
|
429
|
-
|
|
430
|
-
id:
|
|
431
|
-
className:
|
|
432
|
-
children: [
|
|
433
|
-
className:
|
|
429
|
+
l && /* @__PURE__ */ h("div", {
|
|
430
|
+
id: S,
|
|
431
|
+
className: q.label,
|
|
432
|
+
children: [l, i && /* @__PURE__ */ m("span", {
|
|
433
|
+
className: q.required,
|
|
434
434
|
"aria-hidden": "true",
|
|
435
435
|
children: "*"
|
|
436
436
|
})]
|
|
437
437
|
}),
|
|
438
|
-
|
|
439
|
-
id:
|
|
440
|
-
className:
|
|
441
|
-
children:
|
|
438
|
+
u && /* @__PURE__ */ m("div", {
|
|
439
|
+
id: C,
|
|
440
|
+
className: q.description,
|
|
441
|
+
children: u
|
|
442
442
|
}),
|
|
443
443
|
/* @__PURE__ */ m(ke, {
|
|
444
444
|
value: {
|
|
445
|
-
name:
|
|
446
|
-
value:
|
|
445
|
+
name: E,
|
|
446
|
+
value: O,
|
|
447
447
|
disabled: r,
|
|
448
448
|
required: i,
|
|
449
|
-
invalid:
|
|
449
|
+
invalid: A,
|
|
450
450
|
size: a,
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
color: o,
|
|
452
|
+
describedBy: T,
|
|
453
|
+
onValueChange: k
|
|
453
454
|
},
|
|
454
455
|
children: /* @__PURE__ */ m("div", {
|
|
455
|
-
className:
|
|
456
|
-
children:
|
|
456
|
+
className: R(q.items, q[f]),
|
|
457
|
+
children: p
|
|
457
458
|
})
|
|
458
459
|
}),
|
|
459
|
-
|
|
460
|
-
id:
|
|
461
|
-
className:
|
|
462
|
-
children:
|
|
460
|
+
d && /* @__PURE__ */ m("div", {
|
|
461
|
+
id: w,
|
|
462
|
+
className: q.error,
|
|
463
|
+
children: d
|
|
463
464
|
})
|
|
464
465
|
]
|
|
465
466
|
});
|
|
466
467
|
});
|
|
467
468
|
je.displayName = "RadioGroup";
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/patterns/FormField/FormFieldContext.ts
|
|
471
|
+
var Me = t(null), Ne = () => a(Me), J = {
|
|
472
|
+
wrapper: "_wrapper_143kr_1",
|
|
473
|
+
sm: "_sm_143kr_41",
|
|
474
|
+
md: "_md_143kr_78",
|
|
475
|
+
lg: "_lg_143kr_115",
|
|
476
|
+
horizontal: "_horizontal_143kr_152",
|
|
477
|
+
start: "_start_143kr_153",
|
|
478
|
+
description: "_description_143kr_160",
|
|
479
|
+
control: "_control_143kr_161",
|
|
480
|
+
errorText: "_errorText_143kr_162",
|
|
481
|
+
label: "_label_143kr_169",
|
|
482
|
+
labelText: "_labelText_143kr_186",
|
|
483
|
+
required: "_required_143kr_190",
|
|
484
|
+
optional: "_optional_143kr_194",
|
|
485
|
+
labelInfo: "_labelInfo_143kr_201",
|
|
486
|
+
disabled: "_disabled_143kr_243"
|
|
487
|
+
}, Pe = (...e) => e.filter(Boolean).join(" ") || void 0, Fe = ({ id: t, label: n, description: i, error: a, required: o = !1, disabled: c = !1, invalid: l = !1, orientation: u = "vertical", labelPosition: d = "top", size: f = "md", labelInfo: p, optionalText: g, children: _, bindControl: v = !0, className: y, controlClassName: b, labelClassName: x, descriptionClassName: S, errorClassName: C, ...w }) => {
|
|
488
|
+
let T = s(), E = t ?? T, D = n ? `${E}-label` : void 0, O = i && E ? `${E}-description` : void 0, k = a && E ? `${E}-error` : void 0, A = l || !!a, j = Pe(D), M = Pe(O, k), N = {
|
|
489
|
+
controlId: E,
|
|
490
|
+
labelId: D,
|
|
491
|
+
descriptionId: O,
|
|
492
|
+
errorId: k,
|
|
493
|
+
required: o,
|
|
494
|
+
disabled: c,
|
|
495
|
+
invalid: A,
|
|
496
|
+
size: f,
|
|
497
|
+
ariaLabelledBy: j,
|
|
498
|
+
ariaDescribedBy: M
|
|
499
|
+
}, P = r(_) ? _ : void 0, F = v && P ? e(P, {
|
|
500
|
+
id: P.props.id ?? E,
|
|
501
|
+
required: P.props.required ?? o,
|
|
502
|
+
disabled: P.props.disabled ?? c,
|
|
503
|
+
"aria-invalid": P.props["aria-invalid"] ?? (A || void 0),
|
|
504
|
+
"aria-labelledby": Pe(P.props["aria-labelledby"], j),
|
|
505
|
+
"aria-describedby": Pe(P.props["aria-describedby"], M)
|
|
506
|
+
}) : _;
|
|
478
507
|
return /* @__PURE__ */ h("div", {
|
|
479
|
-
...
|
|
480
|
-
"aria-disabled":
|
|
481
|
-
className:
|
|
482
|
-
"data-disabled":
|
|
483
|
-
"data-invalid":
|
|
508
|
+
...w,
|
|
509
|
+
"aria-disabled": c || void 0,
|
|
510
|
+
className: R(J.wrapper, J[u], J[d], J[f], c && J.disabled, y),
|
|
511
|
+
"data-disabled": c || void 0,
|
|
512
|
+
"data-invalid": A || void 0,
|
|
513
|
+
"data-orientation": u,
|
|
514
|
+
"data-size": f,
|
|
484
515
|
children: [
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
516
|
+
n && /* @__PURE__ */ h("label", {
|
|
517
|
+
id: D,
|
|
518
|
+
htmlFor: E,
|
|
519
|
+
className: R(J.label, x),
|
|
520
|
+
children: [
|
|
521
|
+
/* @__PURE__ */ m("span", {
|
|
522
|
+
className: J.labelText,
|
|
523
|
+
children: n
|
|
524
|
+
}),
|
|
525
|
+
o && /* @__PURE__ */ m("span", {
|
|
526
|
+
className: J.required,
|
|
527
|
+
"aria-hidden": "true",
|
|
528
|
+
children: "*"
|
|
529
|
+
}),
|
|
530
|
+
!o && g && /* @__PURE__ */ m("span", {
|
|
531
|
+
className: J.optional,
|
|
532
|
+
children: g
|
|
533
|
+
}),
|
|
534
|
+
p && /* @__PURE__ */ m("span", {
|
|
535
|
+
className: J.labelInfo,
|
|
536
|
+
children: p
|
|
537
|
+
})
|
|
538
|
+
]
|
|
493
539
|
}),
|
|
494
|
-
|
|
495
|
-
id:
|
|
496
|
-
className:
|
|
497
|
-
children:
|
|
540
|
+
i && /* @__PURE__ */ m("div", {
|
|
541
|
+
id: O,
|
|
542
|
+
className: R(J.description, S),
|
|
543
|
+
children: i
|
|
498
544
|
}),
|
|
499
|
-
/* @__PURE__ */ m(
|
|
500
|
-
|
|
501
|
-
children:
|
|
545
|
+
/* @__PURE__ */ m(Me.Provider, {
|
|
546
|
+
value: N,
|
|
547
|
+
children: /* @__PURE__ */ m("div", {
|
|
548
|
+
className: R(J.control, b),
|
|
549
|
+
children: F
|
|
550
|
+
})
|
|
502
551
|
}),
|
|
503
|
-
|
|
504
|
-
id:
|
|
505
|
-
className:
|
|
552
|
+
a && /* @__PURE__ */ m("div", {
|
|
553
|
+
id: k,
|
|
554
|
+
className: R(J.errorText, C),
|
|
506
555
|
role: "alert",
|
|
507
|
-
children:
|
|
556
|
+
children: a
|
|
508
557
|
})
|
|
509
558
|
]
|
|
510
559
|
});
|
|
511
|
-
},
|
|
560
|
+
}, Ie = {
|
|
512
561
|
option: "_option_l6qjj_1",
|
|
513
562
|
selected: "_selected_l6qjj_18",
|
|
514
563
|
disabled: "_disabled_l6qjj_18",
|
|
515
564
|
active: "_active_l6qjj_34",
|
|
516
565
|
label: "_label_l6qjj_46",
|
|
517
566
|
check: "_check_l6qjj_54"
|
|
518
|
-
},
|
|
567
|
+
}, Le = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
519
568
|
let o = !!e.disabled;
|
|
520
569
|
return /* @__PURE__ */ h("li", {
|
|
521
570
|
id: r,
|
|
522
571
|
role: "option",
|
|
523
572
|
"aria-selected": t,
|
|
524
573
|
"aria-disabled": o || void 0,
|
|
525
|
-
className:
|
|
526
|
-
[
|
|
527
|
-
[
|
|
528
|
-
[
|
|
574
|
+
className: R(Ie.option, {
|
|
575
|
+
[Ie.selected]: t,
|
|
576
|
+
[Ie.active]: n,
|
|
577
|
+
[Ie.disabled]: o
|
|
529
578
|
}),
|
|
530
579
|
onClick: () => {
|
|
531
580
|
o || i(e.value);
|
|
@@ -534,28 +583,28 @@ var q = {
|
|
|
534
583
|
o || a();
|
|
535
584
|
},
|
|
536
585
|
children: [/* @__PURE__ */ m("span", {
|
|
537
|
-
className:
|
|
586
|
+
className: Ie.label,
|
|
538
587
|
children: e.label
|
|
539
588
|
}), /* @__PURE__ */ m("span", {
|
|
540
|
-
className:
|
|
589
|
+
className: Ie.check,
|
|
541
590
|
"aria-hidden": "true",
|
|
542
591
|
children: t && /* @__PURE__ */ m(N, {})
|
|
543
592
|
})]
|
|
544
593
|
});
|
|
545
594
|
};
|
|
546
|
-
|
|
547
|
-
var
|
|
595
|
+
Le.displayName = "SelectOption";
|
|
596
|
+
var Re = {
|
|
548
597
|
dropdown: "_dropdown_qznlq_1",
|
|
549
598
|
dropdownIn: "_dropdownIn_qznlq_1",
|
|
550
599
|
empty: "_empty_qznlq_17"
|
|
551
|
-
},
|
|
600
|
+
}, ze = ({ isOpen: e, listboxId: t, labelledById: n, setDropdownRef: r, style: i, options: a, noOptionsText: o, selectedValue: s, activeIndex: c, className: l, onSelect: u, onMouseEnter: d }) => e ? /* @__PURE__ */ m(z, { children: /* @__PURE__ */ m("ul", {
|
|
552
601
|
ref: r,
|
|
553
602
|
id: t,
|
|
554
603
|
role: "listbox",
|
|
555
604
|
"aria-labelledby": n,
|
|
556
|
-
className: [
|
|
605
|
+
className: [Re.dropdown, l].filter(Boolean).join(" "),
|
|
557
606
|
style: i,
|
|
558
|
-
children: a.length ? a.map((e, n) => /* @__PURE__ */ m(
|
|
607
|
+
children: a.length ? a.map((e, n) => /* @__PURE__ */ m(Le, {
|
|
559
608
|
option: e,
|
|
560
609
|
isSelected: e.value === s,
|
|
561
610
|
isActive: n === c,
|
|
@@ -566,12 +615,12 @@ var Fe = {
|
|
|
566
615
|
role: "option",
|
|
567
616
|
"aria-disabled": "true",
|
|
568
617
|
"aria-selected": "false",
|
|
569
|
-
className:
|
|
618
|
+
className: Re.empty,
|
|
570
619
|
children: o
|
|
571
620
|
})
|
|
572
621
|
}) }) : null;
|
|
573
|
-
|
|
574
|
-
var
|
|
622
|
+
ze.displayName = "SelectDropdown";
|
|
623
|
+
var Y = {
|
|
575
624
|
control: "_control_1xma1_1",
|
|
576
625
|
disabled: "_disabled_1xma1_18",
|
|
577
626
|
arrow: "_arrow_1xma1_23",
|
|
@@ -582,7 +631,7 @@ var J = {
|
|
|
582
631
|
placeholder: "_placeholder_1xma1_63",
|
|
583
632
|
error: "_error_1xma1_67",
|
|
584
633
|
open: "_open_1xma1_109"
|
|
585
|
-
},
|
|
634
|
+
}, Be = ({ id: e, errorId: t, isOpen: n, disabled: r, required: i, listboxId: a, activeIndex: o, ariaLabel: s, error: c, displayText: l, isPlaceholder: u, size: d = "md", className: f, buttonRef: p, onClick: g, onKeyDown: _, onBlur: v, onFocus: y }) => /* @__PURE__ */ h("button", {
|
|
586
635
|
id: e,
|
|
587
636
|
ref: p,
|
|
588
637
|
type: "button",
|
|
@@ -597,28 +646,28 @@ var J = {
|
|
|
597
646
|
"aria-controls": n ? a : void 0,
|
|
598
647
|
"aria-describedby": t,
|
|
599
648
|
"aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
|
|
600
|
-
className:
|
|
601
|
-
[
|
|
602
|
-
[
|
|
649
|
+
className: R(Y.control, Y[d], {
|
|
650
|
+
[Y.error]: !!c,
|
|
651
|
+
[Y.disabled]: r
|
|
603
652
|
}, f),
|
|
604
653
|
onClick: g,
|
|
605
654
|
onKeyDown: _,
|
|
606
655
|
onBlur: v,
|
|
607
656
|
onFocus: y,
|
|
608
657
|
children: [/* @__PURE__ */ m("span", {
|
|
609
|
-
className:
|
|
658
|
+
className: R(Y.value, { [Y.placeholder]: u }),
|
|
610
659
|
children: l
|
|
611
660
|
}), /* @__PURE__ */ m("span", {
|
|
612
|
-
className:
|
|
661
|
+
className: R(Y.arrow, { [Y.open]: n }),
|
|
613
662
|
"aria-hidden": "true",
|
|
614
663
|
children: /* @__PURE__ */ m(P, {})
|
|
615
664
|
})]
|
|
616
665
|
});
|
|
617
|
-
|
|
666
|
+
Be.displayName = "SelectTrigger";
|
|
618
667
|
//#endregion
|
|
619
668
|
//#region src/components/Select/Select.tsx
|
|
620
|
-
var
|
|
621
|
-
let j = s(), M = n ?? j, N = `${M}-listbox`, P = !!y, F = P ? `${M}-error` : void 0, I = l(null), L = l(null), { selectedValue: R, selectedOption: z, isOpen: B, setIsOpen: V, activeIndex: H, setActiveIndex: ne, closeDropdown:
|
|
669
|
+
var Ve = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o, defaultValue: c, onChange: u, options: d, placeholder: f = "Select...", noOptionsText: p = "No options available", size: g = "md", required: _ = !1, disabled: v = !1, error: y, placement: b = "bottom-start", matchTriggerWidth: x = !0, open: S, defaultOpen: C = !1, onOpenChange: w, onBlur: T, onFocus: E, className: D, triggerClassName: O, dropdownClassName: k }) => {
|
|
670
|
+
let j = s(), M = n ?? j, N = `${M}-listbox`, P = !!y, F = P ? `${M}-error` : void 0, I = l(null), L = l(null), { selectedValue: R, selectedOption: z, isOpen: B, setIsOpen: V, activeIndex: H, setActiveIndex: ne, closeDropdown: re, toggleDropdown: U, selectValue: ie, onKeyDown: ae } = A({
|
|
622
671
|
value: o,
|
|
623
672
|
defaultValue: c,
|
|
624
673
|
onChange: u,
|
|
@@ -627,22 +676,22 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
627
676
|
open: S,
|
|
628
677
|
defaultOpen: C,
|
|
629
678
|
onOpenChange: w
|
|
630
|
-
}),
|
|
679
|
+
}), oe = !!z, { floatingStyles: W, setRef: se, setFloatingRef: ce } = ee({
|
|
631
680
|
open: B,
|
|
632
681
|
onOpenChange: V,
|
|
633
682
|
placement: b,
|
|
634
683
|
matchTriggerWidth: x,
|
|
635
684
|
mobileSheetBreakpoint: 640
|
|
636
|
-
}),
|
|
637
|
-
|
|
638
|
-
}, [
|
|
639
|
-
te([I, L],
|
|
640
|
-
let
|
|
641
|
-
I.current = e,
|
|
642
|
-
}, [
|
|
643
|
-
L.current = e,
|
|
644
|
-
}, [
|
|
645
|
-
return /* @__PURE__ */ h(
|
|
685
|
+
}), le = i((e) => {
|
|
686
|
+
ie(e), I.current?.focus();
|
|
687
|
+
}, [ie]);
|
|
688
|
+
te([I, L], re, B);
|
|
689
|
+
let ue = i((e) => {
|
|
690
|
+
I.current = e, se(e);
|
|
691
|
+
}, [se]), de = i((e) => {
|
|
692
|
+
L.current = e, ce(e);
|
|
693
|
+
}, [ce]);
|
|
694
|
+
return /* @__PURE__ */ h(Fe, {
|
|
646
695
|
id: M,
|
|
647
696
|
label: e,
|
|
648
697
|
description: t,
|
|
@@ -651,7 +700,7 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
651
700
|
disabled: v,
|
|
652
701
|
className: D,
|
|
653
702
|
children: [
|
|
654
|
-
/* @__PURE__ */ m(
|
|
703
|
+
/* @__PURE__ */ m(Be, {
|
|
655
704
|
id: M,
|
|
656
705
|
errorId: F,
|
|
657
706
|
isOpen: B,
|
|
@@ -662,12 +711,12 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
662
711
|
ariaLabel: a ?? (e ? void 0 : z?.label || f),
|
|
663
712
|
error: P,
|
|
664
713
|
displayText: z?.label ?? f,
|
|
665
|
-
isPlaceholder: !
|
|
714
|
+
isPlaceholder: !oe,
|
|
666
715
|
size: g,
|
|
667
716
|
className: O,
|
|
668
|
-
buttonRef:
|
|
669
|
-
onClick:
|
|
670
|
-
onKeyDown:
|
|
717
|
+
buttonRef: ue,
|
|
718
|
+
onClick: U,
|
|
719
|
+
onKeyDown: ae,
|
|
671
720
|
onBlur: T,
|
|
672
721
|
onFocus: E
|
|
673
722
|
}),
|
|
@@ -677,50 +726,50 @@ var Re = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
677
726
|
value: R,
|
|
678
727
|
disabled: v
|
|
679
728
|
}),
|
|
680
|
-
/* @__PURE__ */ m(
|
|
729
|
+
/* @__PURE__ */ m(ze, {
|
|
681
730
|
isOpen: B,
|
|
682
731
|
listboxId: N,
|
|
683
732
|
labelledById: M,
|
|
684
|
-
style:
|
|
733
|
+
style: W,
|
|
685
734
|
options: d,
|
|
686
735
|
noOptionsText: p,
|
|
687
736
|
selectedValue: R,
|
|
688
737
|
activeIndex: H,
|
|
689
738
|
className: k,
|
|
690
|
-
setDropdownRef:
|
|
691
|
-
onSelect:
|
|
739
|
+
setDropdownRef: de,
|
|
740
|
+
onSelect: le,
|
|
692
741
|
onMouseEnter: ne
|
|
693
742
|
})
|
|
694
743
|
]
|
|
695
744
|
});
|
|
696
745
|
};
|
|
697
|
-
|
|
746
|
+
Ve.displayName = "Select";
|
|
698
747
|
//#endregion
|
|
699
748
|
//#region src/components/Tabs/TabsContext.tsx
|
|
700
|
-
var
|
|
701
|
-
let e = a(
|
|
749
|
+
var He = t(null), Ue = () => {
|
|
750
|
+
let e = a(He);
|
|
702
751
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
703
752
|
return e;
|
|
704
|
-
},
|
|
753
|
+
}, We = {
|
|
705
754
|
list: "_list_13hkl_1",
|
|
706
755
|
vertical: "_vertical_13hkl_8"
|
|
707
|
-
},
|
|
708
|
-
let { orientation: r, appearance: i } =
|
|
756
|
+
}, Ge = ({ children: e, className: t, ...n }) => {
|
|
757
|
+
let { orientation: r, appearance: i } = Ue();
|
|
709
758
|
return /* @__PURE__ */ m("div", {
|
|
710
759
|
...n,
|
|
711
760
|
role: "tablist",
|
|
712
761
|
"aria-orientation": r,
|
|
713
|
-
className:
|
|
762
|
+
className: R(We.list, r === "vertical" && We.vertical, i === "underline" && We.underline, i === "pills" && We.pills, t),
|
|
714
763
|
children: e
|
|
715
764
|
});
|
|
716
765
|
};
|
|
717
|
-
|
|
718
|
-
var
|
|
766
|
+
Ge.displayName = "TabsList";
|
|
767
|
+
var Ke = {
|
|
719
768
|
panel: "_panel_1v1a9_1",
|
|
720
769
|
visible: "_visible_1v1a9_10",
|
|
721
770
|
vertical: "_vertical_1v1a9_14"
|
|
722
|
-
},
|
|
723
|
-
let { activeIndex: r, orientation: i } =
|
|
771
|
+
}, qe = ({ index: e, children: t, className: n }) => {
|
|
772
|
+
let { activeIndex: r, orientation: i } = Ue(), [a, s] = u(!1), c = r === e;
|
|
724
773
|
return o(() => {
|
|
725
774
|
if (!c) {
|
|
726
775
|
s(!1);
|
|
@@ -734,12 +783,12 @@ var Ue = {
|
|
|
734
783
|
"aria-labelledby": `tab-${e}`,
|
|
735
784
|
hidden: !c,
|
|
736
785
|
tabIndex: 0,
|
|
737
|
-
className:
|
|
786
|
+
className: R(Ke.panel, a && Ke.visible, i === "vertical" && Ke.vertical, n),
|
|
738
787
|
children: t
|
|
739
788
|
});
|
|
740
789
|
};
|
|
741
|
-
|
|
742
|
-
var
|
|
790
|
+
qe.displayName = "TabsPanel";
|
|
791
|
+
var Je = {
|
|
743
792
|
tab: "_tab_qe8xc_1",
|
|
744
793
|
iconOnly: "_iconOnly_qe8xc_27",
|
|
745
794
|
tabIcon: "_tabIcon_qe8xc_31",
|
|
@@ -748,8 +797,8 @@ var Y = {
|
|
|
748
797
|
underline: "_underline_qe8xc_60",
|
|
749
798
|
pills: "_pills_qe8xc_92",
|
|
750
799
|
vertical: "_vertical_qe8xc_106"
|
|
751
|
-
},
|
|
752
|
-
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: g, onTabKeyDown: _ } =
|
|
800
|
+
}, Ye = n(({ index: e, children: t, className: n, disabled: r = !1, icon: a, onClick: o, onKeyDown: s, ...c }, l) => {
|
|
801
|
+
let { activeIndex: u, setActiveIndex: d, orientation: f, appearance: p = "default", registerTab: g, onTabKeyDown: _ } = Ue(), v = u === e, y = !!a, b = y && t == null;
|
|
753
802
|
return /* @__PURE__ */ h("button", {
|
|
754
803
|
type: "button",
|
|
755
804
|
ref: i((t) => {
|
|
@@ -765,7 +814,7 @@ var Y = {
|
|
|
765
814
|
id: `tab-${e}`,
|
|
766
815
|
disabled: r,
|
|
767
816
|
tabIndex: v ? 0 : -1,
|
|
768
|
-
className:
|
|
817
|
+
className: R(Je.tab, Je[p], f === "vertical" && Je.vertical, y && Je.withIcon, b && Je.iconOnly, n),
|
|
769
818
|
onClick: (t) => {
|
|
770
819
|
r || (d(e), o?.(t));
|
|
771
820
|
},
|
|
@@ -774,20 +823,20 @@ var Y = {
|
|
|
774
823
|
},
|
|
775
824
|
...c,
|
|
776
825
|
children: [y && /* @__PURE__ */ m("span", {
|
|
777
|
-
className:
|
|
826
|
+
className: Je.tabIcon,
|
|
778
827
|
"aria-hidden": "true",
|
|
779
828
|
children: a
|
|
780
829
|
}), t != null && /* @__PURE__ */ m("span", {
|
|
781
|
-
className:
|
|
830
|
+
className: Je.label,
|
|
782
831
|
children: t
|
|
783
832
|
})]
|
|
784
833
|
});
|
|
785
834
|
});
|
|
786
|
-
|
|
787
|
-
var
|
|
835
|
+
Ye.displayName = "Tab";
|
|
836
|
+
var Xe = {
|
|
788
837
|
tabs: "_tabs_uqy7q_1",
|
|
789
838
|
vertical: "_vertical_uqy7q_5"
|
|
790
|
-
},
|
|
839
|
+
}, Ze = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: a = "horizontal", appearance: o = "default", className: s }) => {
|
|
791
840
|
let { activeIndex: c, setActiveIndex: u } = j({
|
|
792
841
|
activeIndex: t,
|
|
793
842
|
defaultActiveIndex: n,
|
|
@@ -810,25 +859,25 @@ var Ke = {
|
|
|
810
859
|
registerTab: f,
|
|
811
860
|
onTabKeyDown: p
|
|
812
861
|
};
|
|
813
|
-
return /* @__PURE__ */ m(
|
|
862
|
+
return /* @__PURE__ */ m(He.Provider, {
|
|
814
863
|
value: h,
|
|
815
864
|
children: /* @__PURE__ */ m("div", {
|
|
816
|
-
className:
|
|
865
|
+
className: R(Xe.tabs, a === "vertical" && Xe.vertical, s),
|
|
817
866
|
children: e
|
|
818
867
|
})
|
|
819
868
|
});
|
|
820
869
|
};
|
|
821
|
-
|
|
870
|
+
Ze.displayName = "Tabs";
|
|
822
871
|
//#endregion
|
|
823
872
|
//#region src/components/Tabs/index.ts
|
|
824
|
-
var
|
|
825
|
-
List:
|
|
826
|
-
Tab:
|
|
827
|
-
Panel:
|
|
828
|
-
}),
|
|
873
|
+
var Qe = Object.assign(Ze, {
|
|
874
|
+
List: Ge,
|
|
875
|
+
Tab: Ye,
|
|
876
|
+
Panel: qe
|
|
877
|
+
}), $e = {
|
|
829
878
|
tooltip: "_tooltip_10opu_1",
|
|
830
879
|
arrow: "_arrow_10opu_25"
|
|
831
|
-
},
|
|
880
|
+
}, et = n(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
|
|
832
881
|
let l = {
|
|
833
882
|
top: "bottom",
|
|
834
883
|
right: "left",
|
|
@@ -843,22 +892,22 @@ var Je = Object.assign(qe, {
|
|
|
843
892
|
};
|
|
844
893
|
return /* @__PURE__ */ h("div", {
|
|
845
894
|
ref: c,
|
|
846
|
-
className:
|
|
895
|
+
className: R($e.tooltip, a),
|
|
847
896
|
"data-placement": t,
|
|
848
897
|
"data-state": "open",
|
|
849
898
|
style: o,
|
|
850
899
|
...s,
|
|
851
900
|
children: [e, /* @__PURE__ */ m("div", {
|
|
852
901
|
ref: n,
|
|
853
|
-
className:
|
|
902
|
+
className: $e.arrow,
|
|
854
903
|
style: u
|
|
855
904
|
})]
|
|
856
905
|
});
|
|
857
906
|
});
|
|
858
|
-
|
|
907
|
+
et.displayName = "TooltipContent";
|
|
859
908
|
//#endregion
|
|
860
909
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
861
|
-
var
|
|
910
|
+
var tt = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
|
|
862
911
|
open: 300,
|
|
863
912
|
close: 100
|
|
864
913
|
}, maxWidth: a = 250, className: o, onOpenChange: c }) => {
|
|
@@ -879,7 +928,7 @@ var Ze = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
879
928
|
"aria-describedby": d ? y : void 0,
|
|
880
929
|
...j(),
|
|
881
930
|
children: e
|
|
882
|
-
}), /* @__PURE__ */ m(g, { children: d && n && /* @__PURE__ */ m(
|
|
931
|
+
}), /* @__PURE__ */ m(g, { children: d && n && /* @__PURE__ */ m(et, {
|
|
883
932
|
id: y,
|
|
884
933
|
ref: D,
|
|
885
934
|
content: n,
|
|
@@ -896,10 +945,10 @@ var Ze = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
896
945
|
...M()
|
|
897
946
|
}) })] });
|
|
898
947
|
};
|
|
899
|
-
|
|
948
|
+
tt.displayName = "Tooltip";
|
|
900
949
|
//#endregion
|
|
901
950
|
//#region src/utils/devWarning.ts
|
|
902
|
-
var
|
|
951
|
+
var nt = (e, t) => {
|
|
903
952
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
904
953
|
}, X = {
|
|
905
954
|
button: "_button_2nghu_1",
|
|
@@ -929,23 +978,23 @@ var Qe = (e, t) => {
|
|
|
929
978
|
"button-spin": "_button-spin_2nghu_1",
|
|
930
979
|
badge: "_badge_2nghu_786",
|
|
931
980
|
shortcut: "_shortcut_2nghu_800"
|
|
932
|
-
},
|
|
933
|
-
let I = S && r(t) ? t : void 0,
|
|
981
|
+
}, rt = n(({ children: t, color: n = "primary", appearance: i = "solid", size: a = "md", shape: o = "pill", type: s = "button", disabled: c = !1, loading: l = !1, loadingText: u, iconStart: d, iconEnd: f, spinner: g, badge: _, shortcut: v, tooltip: y, fullWidth: b = !1, iconOnly: x = !1, asChild: S = !1, className: C, onClick: w, "aria-label": T, "aria-labelledby": E, href: D, target: O, rel: k, download: A, id: j, role: M, tabIndex: N, ...P }, F) => {
|
|
982
|
+
let I = S && r(t) ? t : void 0, L = I ? I.props.children : t, z = x || !L && !!(d || f), B = !!(T || E || I?.props["aria-label"] || I?.props["aria-labelledby"]), V = c || l, H = l && u ? u : L, ee = u && L && !z && (typeof L == "string" || typeof L == "number") && (typeof u == "string" || typeof u == "number") ? String(l ? L : u) : void 0, te = O === "_blank" && !k ? "noreferrer noopener" : k, ne = R(X.button, X[n], X[i], X[a], X[o], C, {
|
|
934
983
|
[X.disabled]: V,
|
|
935
984
|
[X.loading]: l,
|
|
936
985
|
[X.fullWidth]: b,
|
|
937
986
|
[X.iconOnly]: z
|
|
938
987
|
});
|
|
939
|
-
|
|
940
|
-
let
|
|
988
|
+
nt(!S || !D, "Button: pass href to the child element when using asChild."), nt(!S || !!I, "Button: asChild requires a single valid React element child."), nt(!z || B, "Button: icon-only buttons must provide aria-label or aria-labelledby.");
|
|
989
|
+
let re = (e) => {
|
|
941
990
|
e.preventDefault(), e.stopPropagation();
|
|
942
|
-
},
|
|
991
|
+
}, U = (e) => {
|
|
943
992
|
if (V) {
|
|
944
|
-
|
|
993
|
+
re(e);
|
|
945
994
|
return;
|
|
946
995
|
}
|
|
947
996
|
I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
948
|
-
},
|
|
997
|
+
}, ie = /* @__PURE__ */ h(p, { children: [
|
|
949
998
|
l && (g ? /* @__PURE__ */ m("span", {
|
|
950
999
|
className: X.icon,
|
|
951
1000
|
"aria-hidden": "true",
|
|
@@ -958,12 +1007,12 @@ var Qe = (e, t) => {
|
|
|
958
1007
|
className: X.icon,
|
|
959
1008
|
children: d
|
|
960
1009
|
}),
|
|
961
|
-
|
|
1010
|
+
H && !z && /* @__PURE__ */ m("span", {
|
|
962
1011
|
className: X.label,
|
|
963
|
-
"data-measure":
|
|
1012
|
+
"data-measure": ee,
|
|
964
1013
|
children: /* @__PURE__ */ m("span", {
|
|
965
1014
|
className: X.labelText,
|
|
966
|
-
children:
|
|
1015
|
+
children: H
|
|
967
1016
|
})
|
|
968
1017
|
}),
|
|
969
1018
|
_ && !z && /* @__PURE__ */ m("span", {
|
|
@@ -986,12 +1035,12 @@ var Qe = (e, t) => {
|
|
|
986
1035
|
"aria-disabled": V || void 0,
|
|
987
1036
|
"aria-label": T || I.props["aria-label"] || void 0,
|
|
988
1037
|
"aria-labelledby": E || I.props["aria-labelledby"] || void 0,
|
|
989
|
-
className:
|
|
1038
|
+
className: R(I.props.className, ne),
|
|
990
1039
|
href: V ? void 0 : I.props.href,
|
|
991
|
-
onClick:
|
|
1040
|
+
onClick: U,
|
|
992
1041
|
tabIndex: V ? -1 : I.props.tabIndex,
|
|
993
1042
|
title: y || I.props.title,
|
|
994
|
-
children:
|
|
1043
|
+
children: ie
|
|
995
1044
|
}) : D ? /* @__PURE__ */ m("a", {
|
|
996
1045
|
ref: F,
|
|
997
1046
|
href: V ? void 0 : D,
|
|
@@ -999,16 +1048,16 @@ var Qe = (e, t) => {
|
|
|
999
1048
|
role: M,
|
|
1000
1049
|
tabIndex: V ? -1 : N,
|
|
1001
1050
|
target: O,
|
|
1002
|
-
rel:
|
|
1051
|
+
rel: te,
|
|
1003
1052
|
download: A,
|
|
1004
|
-
onClick: V ?
|
|
1053
|
+
onClick: V ? re : w,
|
|
1005
1054
|
"aria-disabled": V || void 0,
|
|
1006
1055
|
"aria-label": T || void 0,
|
|
1007
1056
|
"aria-labelledby": E || void 0,
|
|
1008
1057
|
"aria-busy": l || void 0,
|
|
1009
1058
|
className: ne,
|
|
1010
1059
|
title: y,
|
|
1011
|
-
children:
|
|
1060
|
+
children: ie
|
|
1012
1061
|
}) : /* @__PURE__ */ m("button", {
|
|
1013
1062
|
...P,
|
|
1014
1063
|
ref: F,
|
|
@@ -1023,67 +1072,67 @@ var Qe = (e, t) => {
|
|
|
1023
1072
|
"aria-busy": l || void 0,
|
|
1024
1073
|
className: ne,
|
|
1025
1074
|
title: y,
|
|
1026
|
-
children:
|
|
1075
|
+
children: ie
|
|
1027
1076
|
});
|
|
1028
1077
|
});
|
|
1029
|
-
|
|
1078
|
+
rt.displayName = "Button";
|
|
1030
1079
|
var Z = {
|
|
1031
|
-
wrapper: "
|
|
1032
|
-
colorPrimary: "
|
|
1033
|
-
colorNeutral: "
|
|
1034
|
-
colorSuccess: "
|
|
1035
|
-
colorWarning: "
|
|
1036
|
-
colorDanger: "
|
|
1037
|
-
labelStart: "
|
|
1038
|
-
wrapperSm: "
|
|
1039
|
-
wrapperMd: "
|
|
1040
|
-
wrapperLg: "
|
|
1041
|
-
iconOnly: "
|
|
1042
|
-
container: "
|
|
1043
|
-
containerSm: "
|
|
1044
|
-
containerMd: "
|
|
1045
|
-
containerLg: "
|
|
1046
|
-
containerLabelStart: "
|
|
1047
|
-
descriptionText: "
|
|
1048
|
-
errorText: "
|
|
1049
|
-
input: "
|
|
1050
|
-
customCheckbox: "
|
|
1051
|
-
requiredMark: "
|
|
1052
|
-
error: "
|
|
1053
|
-
checkmark: "
|
|
1054
|
-
indeterminateMark: "
|
|
1055
|
-
customMark: "
|
|
1056
|
-
label: "
|
|
1057
|
-
labelSm: "
|
|
1058
|
-
labelMd: "
|
|
1059
|
-
labelLg: "
|
|
1060
|
-
indeterminate: "
|
|
1061
|
-
"checkbox-pop": "_checkbox-
|
|
1062
|
-
disabled: "
|
|
1063
|
-
},
|
|
1080
|
+
wrapper: "_wrapper_877rr_1",
|
|
1081
|
+
colorPrimary: "_colorPrimary_877rr_27",
|
|
1082
|
+
colorNeutral: "_colorNeutral_877rr_45",
|
|
1083
|
+
colorSuccess: "_colorSuccess_877rr_63",
|
|
1084
|
+
colorWarning: "_colorWarning_877rr_81",
|
|
1085
|
+
colorDanger: "_colorDanger_877rr_99",
|
|
1086
|
+
labelStart: "_labelStart_877rr_115",
|
|
1087
|
+
wrapperSm: "_wrapperSm_877rr_119",
|
|
1088
|
+
wrapperMd: "_wrapperMd_877rr_125",
|
|
1089
|
+
wrapperLg: "_wrapperLg_877rr_131",
|
|
1090
|
+
iconOnly: "_iconOnly_877rr_137",
|
|
1091
|
+
container: "_container_877rr_143",
|
|
1092
|
+
containerSm: "_containerSm_877rr_150",
|
|
1093
|
+
containerMd: "_containerMd_877rr_154",
|
|
1094
|
+
containerLg: "_containerLg_877rr_158",
|
|
1095
|
+
containerLabelStart: "_containerLabelStart_877rr_162",
|
|
1096
|
+
descriptionText: "_descriptionText_877rr_162",
|
|
1097
|
+
errorText: "_errorText_877rr_163",
|
|
1098
|
+
input: "_input_877rr_167",
|
|
1099
|
+
customCheckbox: "_customCheckbox_877rr_179",
|
|
1100
|
+
requiredMark: "_requiredMark_877rr_194",
|
|
1101
|
+
error: "_error_877rr_163",
|
|
1102
|
+
checkmark: "_checkmark_877rr_210",
|
|
1103
|
+
indeterminateMark: "_indeterminateMark_877rr_226",
|
|
1104
|
+
customMark: "_customMark_877rr_239",
|
|
1105
|
+
label: "_label_877rr_115",
|
|
1106
|
+
labelSm: "_labelSm_877rr_270",
|
|
1107
|
+
labelMd: "_labelMd_877rr_274",
|
|
1108
|
+
labelLg: "_labelLg_877rr_278",
|
|
1109
|
+
indeterminate: "_indeterminate_877rr_226",
|
|
1110
|
+
"checkbox-pop": "_checkbox-pop_877rr_1",
|
|
1111
|
+
disabled: "_disabled_877rr_354"
|
|
1112
|
+
}, it = {
|
|
1064
1113
|
sm: Z.labelSm,
|
|
1065
1114
|
md: Z.labelMd,
|
|
1066
1115
|
lg: Z.labelLg
|
|
1067
|
-
},
|
|
1116
|
+
}, at = {
|
|
1068
1117
|
sm: Z.wrapperSm,
|
|
1069
1118
|
md: Z.wrapperMd,
|
|
1070
1119
|
lg: Z.wrapperLg
|
|
1071
|
-
},
|
|
1120
|
+
}, ot = {
|
|
1072
1121
|
sm: Z.containerSm,
|
|
1073
1122
|
md: Z.containerMd,
|
|
1074
1123
|
lg: Z.containerLg
|
|
1075
|
-
},
|
|
1124
|
+
}, st = {
|
|
1076
1125
|
primary: Z.colorPrimary,
|
|
1077
1126
|
neutral: Z.colorNeutral,
|
|
1078
1127
|
success: Z.colorSuccess,
|
|
1079
1128
|
warning: Z.colorWarning,
|
|
1080
1129
|
danger: Z.colorDanger
|
|
1081
|
-
},
|
|
1130
|
+
}, ct = n(({ id: e, label: t, description: n, icon: r, indeterminateIcon: a, checked: c, size: u = "md", color: d = "primary", labelPosition: f = "end", defaultChecked: p = !1, disabled: g = !1, required: _ = !1, indeterminate: v = !1, className: y, wrapperClassName: b, onCheckedChange: x, error: S, "aria-label": C, "aria-labelledby": w, "aria-describedby": T, ...E }, O) => {
|
|
1082
1131
|
let k = s(), A = e ?? k, j = l(null), M = !!S, P = n ? `${A}-description` : void 0, F = M ? `${A}-error` : void 0, I = [
|
|
1083
1132
|
T,
|
|
1084
1133
|
P,
|
|
1085
1134
|
F
|
|
1086
|
-
].filter(Boolean).join(" "), [
|
|
1135
|
+
].filter(Boolean).join(" "), [L, z] = D({
|
|
1087
1136
|
value: c,
|
|
1088
1137
|
defaultValue: p,
|
|
1089
1138
|
onChange: x
|
|
@@ -1100,19 +1149,19 @@ var Z = {
|
|
|
1100
1149
|
let V = (e) => {
|
|
1101
1150
|
z(e.target.checked);
|
|
1102
1151
|
};
|
|
1103
|
-
return
|
|
1104
|
-
className:
|
|
1152
|
+
return nt(!!(t || C || w), "Checkbox: an accessible label must be provided through label, aria-label, or aria-labelledby."), /* @__PURE__ */ h("div", {
|
|
1153
|
+
className: R(Z.container, ot[u], f === "start" && Z.containerLabelStart, y),
|
|
1105
1154
|
children: [
|
|
1106
1155
|
/* @__PURE__ */ h("label", {
|
|
1107
1156
|
htmlFor: A,
|
|
1108
|
-
className:
|
|
1157
|
+
className: R(Z.wrapper, at[u], st[d], f === "start" && Z.labelStart, !t && Z.iconOnly, g && Z.disabled, b),
|
|
1109
1158
|
children: [
|
|
1110
1159
|
/* @__PURE__ */ m("input", {
|
|
1111
1160
|
...E,
|
|
1112
1161
|
ref: B,
|
|
1113
1162
|
id: A,
|
|
1114
1163
|
type: "checkbox",
|
|
1115
|
-
checked:
|
|
1164
|
+
checked: L,
|
|
1116
1165
|
disabled: g,
|
|
1117
1166
|
required: _,
|
|
1118
1167
|
onChange: V,
|
|
@@ -1124,18 +1173,18 @@ var Z = {
|
|
|
1124
1173
|
"aria-describedby": I || void 0
|
|
1125
1174
|
}),
|
|
1126
1175
|
/* @__PURE__ */ m("span", {
|
|
1127
|
-
className:
|
|
1176
|
+
className: R(Z.customCheckbox, M && Z.error, v && Z.indeterminate),
|
|
1128
1177
|
"aria-hidden": "true",
|
|
1129
1178
|
children: v ? /* @__PURE__ */ m("span", {
|
|
1130
|
-
className:
|
|
1179
|
+
className: R(Z.indeterminateMark, a && Z.customMark),
|
|
1131
1180
|
children: a
|
|
1132
|
-
}) :
|
|
1181
|
+
}) : L && /* @__PURE__ */ m("span", {
|
|
1133
1182
|
className: Z.checkmark,
|
|
1134
1183
|
children: r ?? /* @__PURE__ */ m(N, {})
|
|
1135
1184
|
})
|
|
1136
1185
|
}),
|
|
1137
1186
|
t && /* @__PURE__ */ h("span", {
|
|
1138
|
-
className:
|
|
1187
|
+
className: R(Z.label, it[u]),
|
|
1139
1188
|
children: [t, _ && /* @__PURE__ */ m("span", {
|
|
1140
1189
|
className: Z.requiredMark,
|
|
1141
1190
|
"aria-hidden": "true",
|
|
@@ -1157,27 +1206,49 @@ var Z = {
|
|
|
1157
1206
|
]
|
|
1158
1207
|
});
|
|
1159
1208
|
});
|
|
1160
|
-
|
|
1209
|
+
ct.displayName = "Checkbox";
|
|
1161
1210
|
var Q = {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1211
|
+
inputGroup: "_inputGroup_151bq_1",
|
|
1212
|
+
primary: "_primary_151bq_29",
|
|
1213
|
+
outline: "_outline_151bq_29",
|
|
1214
|
+
filled: "_filled_151bq_62",
|
|
1215
|
+
soft: "_soft_151bq_95",
|
|
1216
|
+
neutral: "_neutral_151bq_128",
|
|
1217
|
+
success: "_success_151bq_227",
|
|
1218
|
+
warning: "_warning_151bq_326",
|
|
1219
|
+
danger: "_danger_151bq_425",
|
|
1220
|
+
inputWrapper: "_inputWrapper_151bq_524",
|
|
1221
|
+
input: "_input_151bq_1",
|
|
1222
|
+
error: "_error_151bq_575",
|
|
1223
|
+
sm: "_sm_151bq_583",
|
|
1224
|
+
md: "_md_151bq_587",
|
|
1225
|
+
lg: "_lg_151bq_591",
|
|
1226
|
+
isInvalid: "_isInvalid_151bq_607",
|
|
1227
|
+
hasLeftAdornment: "_hasLeftAdornment_151bq_635",
|
|
1228
|
+
hasRightAdornment: "_hasRightAdornment_151bq_639",
|
|
1229
|
+
hasStartIconAndPrefix: "_hasStartIconAndPrefix_151bq_643",
|
|
1230
|
+
hasEndIconAndSuffix: "_hasEndIconAndSuffix_151bq_647",
|
|
1231
|
+
startAdornment: "_startAdornment_151bq_651",
|
|
1232
|
+
endAdornment: "_endAdornment_151bq_652",
|
|
1233
|
+
prefix: "_prefix_151bq_670",
|
|
1234
|
+
suffix: "_suffix_151bq_671",
|
|
1235
|
+
endSlot: "_endSlot_151bq_698",
|
|
1236
|
+
isLoading: "_isLoading_151bq_709",
|
|
1237
|
+
clearButton: "_clearButton_151bq_744",
|
|
1238
|
+
iconButton: "_iconButton_151bq_759",
|
|
1239
|
+
spinner: "_spinner_151bq_785",
|
|
1240
|
+
"input-spin": "_input-spin_151bq_1",
|
|
1241
|
+
addon: "_addon_151bq_794",
|
|
1242
|
+
hasAddons: "_hasAddons_151bq_815",
|
|
1243
|
+
counter: "_counter_151bq_829",
|
|
1244
|
+
toneDefault: "_toneDefault_151bq_857",
|
|
1245
|
+
tonePrimary: "_tonePrimary_151bq_861",
|
|
1246
|
+
toneSecondary: "_toneSecondary_151bq_865",
|
|
1247
|
+
toneSuccess: "_toneSuccess_151bq_869",
|
|
1248
|
+
toneDanger: "_toneDanger_151bq_873",
|
|
1249
|
+
toneMuted: "_toneMuted_151bq_877",
|
|
1250
|
+
toneInverse: "_toneInverse_151bq_881"
|
|
1251
|
+
}, lt = {
|
|
1181
1252
|
default: Q.toneDefault,
|
|
1182
1253
|
primary: Q.tonePrimary,
|
|
1183
1254
|
secondary: Q.toneSecondary,
|
|
@@ -1185,7 +1256,7 @@ var Q = {
|
|
|
1185
1256
|
danger: Q.toneDanger,
|
|
1186
1257
|
muted: Q.toneMuted,
|
|
1187
1258
|
inverse: Q.toneInverse
|
|
1188
|
-
},
|
|
1259
|
+
}, ut = (e = "text", t) => {
|
|
1189
1260
|
if (t) return t;
|
|
1190
1261
|
switch (e) {
|
|
1191
1262
|
case "email": return "email";
|
|
@@ -1195,166 +1266,264 @@ var Q = {
|
|
|
1195
1266
|
case "search": return "off";
|
|
1196
1267
|
default: return;
|
|
1197
1268
|
}
|
|
1198
|
-
},
|
|
1199
|
-
let
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1269
|
+
}, dt = (e, t) => {
|
|
1270
|
+
let n = e.replace(/\D/g, ""), r = 0, i = "";
|
|
1271
|
+
for (let e of t) {
|
|
1272
|
+
if (e === "#") {
|
|
1273
|
+
let e = n[r];
|
|
1274
|
+
if (!e) break;
|
|
1275
|
+
i += e, r += 1;
|
|
1276
|
+
continue;
|
|
1277
|
+
}
|
|
1278
|
+
r < n.length && (i += e);
|
|
1279
|
+
}
|
|
1280
|
+
return i;
|
|
1281
|
+
}, ft = (e, t) => t ? typeof t == "function" ? t(e) : dt(e, t) : e, pt = n(({ id: e, label: t, name: n, description: r, placeholder: a, value: o, defaultValue: c, type: d = "text", size: f, color: g = "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: L, suffix: z, clearIcon: B, mask: V, format: H, parse: ee, startIconTone: te = "default", endIconTone: ne = "default", clearIconTone: re = "danger", autoFocus: U, maxLength: ie, onMouseEnter: ae, onMouseLeave: oe, "aria-describedby": W, "aria-invalid": se, "aria-labelledby": ce, ...le }, ue) => {
|
|
1282
|
+
let de = s(), G = Ne(), K = !!(t || r || v), fe = e ?? (K ? void 0 : G?.controlId) ?? de, pe = l(null), [me, he] = u(!1), [ge, _e] = u(c ?? ""), ve = o !== void 0, ye = String((ve ? o : ge) ?? ""), be = H ? H(ye) : ye, xe = ye.length > 0, Se = f ?? G?.size ?? "md", Ce = y || !!v || !K && !!G?.invalid, we = b || !K && !!G?.disabled, Te = x || !K && !!G?.required, Ee = E || S, De = d === "password", Oe = De && A && me ? "text" : d, ke = M ?? (d === "search" ? /* @__PURE__ */ m(I, {}) : null), Ae = N, q = ut(d, T), je = S && !we, Me = D && xe && !we && !Ee && !je, J = A && De && !we && !je && !Me, Pe = !je && !Me && !J && !!Ae, Ie = !!(j && ie), Le = r ? `${fe}-description` : void 0, Re = v ? `${fe}-error` : void 0, ze = Ie ? `${fe}-counter` : void 0, Y = [
|
|
1283
|
+
W,
|
|
1284
|
+
!K && !W ? G?.ariaDescribedBy : void 0,
|
|
1285
|
+
Le,
|
|
1286
|
+
Re,
|
|
1287
|
+
ze
|
|
1288
|
+
].filter(Boolean).join(" "), Be = B ?? "×", Ve = !!(ke || L), He = !!(Ae || z || Me || J || je), Ue = !!(ke && L), We = !!(Ae && z), Ge = !!(P || F), Ke = i((e) => {
|
|
1289
|
+
if (pe.current = e, typeof ue == "function") {
|
|
1290
|
+
ue(e);
|
|
1206
1291
|
return;
|
|
1207
1292
|
}
|
|
1208
|
-
|
|
1209
|
-
}, [
|
|
1210
|
-
let t = e.target.value;
|
|
1211
|
-
|
|
1212
|
-
}, [
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1293
|
+
ue && (ue.current = e);
|
|
1294
|
+
}, [ue]), qe = i((e) => {
|
|
1295
|
+
let t = ft(ee ? ee(e.target.value) : e.target.value, V);
|
|
1296
|
+
ve || _e(t), k?.(t);
|
|
1297
|
+
}, [
|
|
1298
|
+
ve,
|
|
1299
|
+
V,
|
|
1300
|
+
k,
|
|
1301
|
+
ee
|
|
1302
|
+
]), Je = i(() => {
|
|
1303
|
+
ve || _e(""), k?.(""), O?.(), pe.current?.focus();
|
|
1304
|
+
}, [
|
|
1305
|
+
ve,
|
|
1306
|
+
O,
|
|
1307
|
+
k
|
|
1308
|
+
]), Ye = /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
|
|
1309
|
+
className: R(Q.inputGroup, Q[_], Q[g], {
|
|
1310
|
+
[Q.hasAddons]: Ge,
|
|
1311
|
+
[Q.isDisabled]: we,
|
|
1312
|
+
[Q.isInvalid]: Ce,
|
|
1313
|
+
[Q.isLoading]: je
|
|
1314
|
+
}),
|
|
1315
|
+
children: [
|
|
1316
|
+
P && /* @__PURE__ */ m("span", {
|
|
1317
|
+
className: Q.addon,
|
|
1318
|
+
children: P
|
|
1226
1319
|
}),
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
/* @__PURE__ */ m("input", {
|
|
1234
|
-
...I,
|
|
1235
|
-
ref: ae,
|
|
1236
|
-
id: B,
|
|
1237
|
-
name: n,
|
|
1238
|
-
type: f,
|
|
1239
|
-
autoComplete: re,
|
|
1240
|
-
className: L(Q.input, Q[p], { [Q.error]: !!g }, y),
|
|
1241
|
-
value: ne,
|
|
1242
|
-
onChange: oe,
|
|
1243
|
-
placeholder: a,
|
|
1244
|
-
disabled: _,
|
|
1245
|
-
readOnly: x,
|
|
1246
|
-
required: v,
|
|
1247
|
-
autoFocus: A,
|
|
1248
|
-
maxLength: j,
|
|
1249
|
-
"aria-invalid": g ? !0 : F,
|
|
1250
|
-
"aria-describedby": ie || void 0,
|
|
1251
|
-
onMouseEnter: M,
|
|
1252
|
-
onMouseLeave: N
|
|
1320
|
+
/* @__PURE__ */ h("div", {
|
|
1321
|
+
className: R(Q.inputWrapper, {
|
|
1322
|
+
[Q.hasLeftAdornment]: Ve,
|
|
1323
|
+
[Q.hasRightAdornment]: He,
|
|
1324
|
+
[Q.hasStartIconAndPrefix]: Ue,
|
|
1325
|
+
[Q.hasEndIconAndSuffix]: We
|
|
1253
1326
|
}),
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1327
|
+
children: [
|
|
1328
|
+
ke && /* @__PURE__ */ m("span", {
|
|
1329
|
+
"aria-hidden": "true",
|
|
1330
|
+
className: R(Q.startAdornment, lt[te]),
|
|
1331
|
+
children: ke
|
|
1332
|
+
}),
|
|
1333
|
+
L && /* @__PURE__ */ m("span", {
|
|
1334
|
+
className: Q.prefix,
|
|
1335
|
+
children: L
|
|
1336
|
+
}),
|
|
1337
|
+
/* @__PURE__ */ m("input", {
|
|
1338
|
+
...le,
|
|
1339
|
+
ref: Ke,
|
|
1340
|
+
id: fe,
|
|
1341
|
+
name: n,
|
|
1342
|
+
type: Oe,
|
|
1343
|
+
autoComplete: q,
|
|
1344
|
+
className: R(Q.input, Q[Se], { [Q.error]: Ce }, C),
|
|
1345
|
+
value: be,
|
|
1346
|
+
onChange: qe,
|
|
1347
|
+
placeholder: a,
|
|
1348
|
+
disabled: we,
|
|
1349
|
+
readOnly: Ee,
|
|
1350
|
+
required: Te,
|
|
1351
|
+
autoFocus: U,
|
|
1352
|
+
maxLength: ie,
|
|
1353
|
+
"aria-invalid": Ce ? !0 : se,
|
|
1354
|
+
"aria-labelledby": ce ?? (K ? void 0 : G?.ariaLabelledBy),
|
|
1355
|
+
"aria-describedby": Y || void 0,
|
|
1356
|
+
"aria-busy": S || void 0,
|
|
1357
|
+
onMouseEnter: ae,
|
|
1358
|
+
onMouseLeave: oe
|
|
1359
|
+
}),
|
|
1360
|
+
z && /* @__PURE__ */ m("span", {
|
|
1361
|
+
className: Q.suffix,
|
|
1362
|
+
children: z
|
|
1363
|
+
}),
|
|
1364
|
+
/* @__PURE__ */ h("div", {
|
|
1365
|
+
className: Q.endSlot,
|
|
1366
|
+
children: [
|
|
1367
|
+
je && /* @__PURE__ */ m("span", {
|
|
1368
|
+
className: Q.spinner,
|
|
1369
|
+
"aria-hidden": "true",
|
|
1370
|
+
"data-testid": "input-spinner"
|
|
1371
|
+
}),
|
|
1372
|
+
J && /* @__PURE__ */ m("button", {
|
|
1373
|
+
type: "button",
|
|
1374
|
+
className: Q.iconButton,
|
|
1375
|
+
onClick: () => he((e) => !e),
|
|
1376
|
+
"aria-label": me ? "Hide password" : "Show password",
|
|
1377
|
+
children: me ? "Hide" : "Show"
|
|
1378
|
+
}),
|
|
1379
|
+
Me && /* @__PURE__ */ m("button", {
|
|
1380
|
+
type: "button",
|
|
1381
|
+
className: R(Q.clearButton, lt[re]),
|
|
1382
|
+
onClick: Je,
|
|
1383
|
+
"aria-label": "Clear input",
|
|
1384
|
+
children: Be
|
|
1385
|
+
}),
|
|
1386
|
+
Pe && Ae && /* @__PURE__ */ m("span", {
|
|
1387
|
+
"aria-hidden": "true",
|
|
1388
|
+
className: R(Q.endAdornment, lt[ne]),
|
|
1389
|
+
children: Ae
|
|
1390
|
+
})
|
|
1391
|
+
]
|
|
1392
|
+
})
|
|
1393
|
+
]
|
|
1394
|
+
}),
|
|
1395
|
+
F && /* @__PURE__ */ m("span", {
|
|
1396
|
+
className: Q.addon,
|
|
1397
|
+
children: F
|
|
1398
|
+
})
|
|
1399
|
+
]
|
|
1400
|
+
}), Ie && /* @__PURE__ */ h("div", {
|
|
1401
|
+
id: ze,
|
|
1402
|
+
className: Q.counter,
|
|
1403
|
+
children: [
|
|
1404
|
+
ye.length,
|
|
1405
|
+
" / ",
|
|
1406
|
+
ie
|
|
1407
|
+
]
|
|
1408
|
+
})] });
|
|
1409
|
+
return !K && G ? Ye : /* @__PURE__ */ m(Fe, {
|
|
1410
|
+
id: fe,
|
|
1411
|
+
label: t,
|
|
1412
|
+
description: r,
|
|
1413
|
+
error: v,
|
|
1414
|
+
required: Te,
|
|
1415
|
+
disabled: we,
|
|
1416
|
+
invalid: Ce,
|
|
1417
|
+
size: Se,
|
|
1418
|
+
className: w,
|
|
1419
|
+
bindControl: !1,
|
|
1420
|
+
children: Ye
|
|
1267
1421
|
});
|
|
1268
1422
|
});
|
|
1269
|
-
|
|
1423
|
+
pt.displayName = "Input";
|
|
1270
1424
|
var $ = {
|
|
1271
|
-
root: "
|
|
1272
|
-
invalid: "
|
|
1273
|
-
control: "
|
|
1274
|
-
label: "
|
|
1275
|
-
wrapper: "
|
|
1276
|
-
input: "
|
|
1277
|
-
disabled: "
|
|
1278
|
-
description: "
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1425
|
+
root: "_root_qb9nm_1",
|
|
1426
|
+
invalid: "_invalid_qb9nm_27",
|
|
1427
|
+
control: "_control_qb9nm_27",
|
|
1428
|
+
label: "_label_qb9nm_30",
|
|
1429
|
+
wrapper: "_wrapper_qb9nm_33",
|
|
1430
|
+
input: "_input_qb9nm_34",
|
|
1431
|
+
disabled: "_disabled_qb9nm_37",
|
|
1432
|
+
description: "_description_qb9nm_45",
|
|
1433
|
+
colorPrimary: "_colorPrimary_qb9nm_49",
|
|
1434
|
+
colorNeutral: "_colorNeutral_qb9nm_65",
|
|
1435
|
+
colorSuccess: "_colorSuccess_qb9nm_81",
|
|
1436
|
+
colorWarning: "_colorWarning_qb9nm_97",
|
|
1437
|
+
colorDanger: "_colorDanger_qb9nm_113",
|
|
1438
|
+
sm: "_sm_qb9nm_129",
|
|
1439
|
+
md: "_md_qb9nm_138",
|
|
1440
|
+
lg: "_lg_qb9nm_147",
|
|
1441
|
+
indicator: "_indicator_qb9nm_202",
|
|
1442
|
+
customIcon: "_customIcon_qb9nm_216",
|
|
1443
|
+
content: "_content_qb9nm_335",
|
|
1444
|
+
error: "_error_qb9nm_352"
|
|
1445
|
+
}, mt = {
|
|
1446
|
+
primary: $.colorPrimary,
|
|
1447
|
+
neutral: $.colorNeutral,
|
|
1448
|
+
success: $.colorSuccess,
|
|
1449
|
+
warning: $.colorWarning,
|
|
1450
|
+
danger: $.colorDanger
|
|
1451
|
+
}, ht = n(({ value: e, checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, size: a, color: o, error: c, onCheckedChange: l, label: u, description: d, icon: f, wrapperClassName: p, className: g, id: _, name: v, "aria-describedby": y, ...b }, x) => {
|
|
1452
|
+
let S = Ae(), C = s(), w = _ ?? C, T = d ? `${w}-description` : void 0, E = c ? `${w}-error` : void 0, O = [
|
|
1453
|
+
T,
|
|
1454
|
+
E,
|
|
1455
|
+
S?.describedBy,
|
|
1456
|
+
y
|
|
1457
|
+
].filter(Boolean).join(" ") || void 0, k = S !== null, [A, j] = D({
|
|
1292
1458
|
value: t,
|
|
1293
1459
|
defaultValue: n,
|
|
1294
|
-
onChange:
|
|
1295
|
-
}),
|
|
1296
|
-
if (!
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1460
|
+
onChange: l
|
|
1461
|
+
}), M = k ? S.value === e : A, N = !!S?.disabled || r, P = !!S?.required || i, F = S?.name ?? v, I = !!(c || S?.invalid), L = a ?? S?.size ?? "md", z = o ?? S?.color ?? "primary", B = (t) => {
|
|
1462
|
+
if (!N) {
|
|
1463
|
+
if (k) {
|
|
1464
|
+
S.onValueChange(e);
|
|
1299
1465
|
return;
|
|
1300
1466
|
}
|
|
1301
|
-
|
|
1467
|
+
j(t.currentTarget.checked);
|
|
1302
1468
|
}
|
|
1303
1469
|
};
|
|
1304
1470
|
return /* @__PURE__ */ h("div", {
|
|
1305
|
-
className:
|
|
1471
|
+
className: R($.root, $[L], I && $.invalid, N && $.disabled, mt[z], g),
|
|
1306
1472
|
children: [/* @__PURE__ */ h("label", {
|
|
1307
|
-
htmlFor:
|
|
1308
|
-
className:
|
|
1473
|
+
htmlFor: w,
|
|
1474
|
+
className: R($.wrapper, p),
|
|
1309
1475
|
children: [
|
|
1310
1476
|
/* @__PURE__ */ m("input", {
|
|
1311
|
-
...
|
|
1312
|
-
ref:
|
|
1313
|
-
id:
|
|
1477
|
+
...b,
|
|
1478
|
+
ref: x,
|
|
1479
|
+
id: w,
|
|
1314
1480
|
type: "radio",
|
|
1315
|
-
name:
|
|
1481
|
+
name: F,
|
|
1316
1482
|
value: e,
|
|
1317
|
-
checked:
|
|
1318
|
-
disabled:
|
|
1319
|
-
required:
|
|
1320
|
-
"aria-invalid":
|
|
1321
|
-
"aria-describedby":
|
|
1483
|
+
checked: M,
|
|
1484
|
+
disabled: N,
|
|
1485
|
+
required: P,
|
|
1486
|
+
"aria-invalid": I || void 0,
|
|
1487
|
+
"aria-describedby": O,
|
|
1322
1488
|
className: $.input,
|
|
1323
|
-
onChange:
|
|
1489
|
+
onChange: B
|
|
1324
1490
|
}),
|
|
1325
1491
|
/* @__PURE__ */ m("span", {
|
|
1326
1492
|
className: $.control,
|
|
1327
1493
|
"aria-hidden": "true",
|
|
1328
|
-
children: /* @__PURE__ */ m("span", {
|
|
1494
|
+
children: /* @__PURE__ */ m("span", {
|
|
1495
|
+
className: R($.indicator, f && $.customIcon),
|
|
1496
|
+
children: f
|
|
1497
|
+
})
|
|
1329
1498
|
}),
|
|
1330
|
-
(
|
|
1499
|
+
(u || d) && /* @__PURE__ */ h("span", {
|
|
1331
1500
|
className: $.content,
|
|
1332
|
-
children: [
|
|
1501
|
+
children: [u && /* @__PURE__ */ m("span", {
|
|
1333
1502
|
className: $.label,
|
|
1334
|
-
children: l
|
|
1335
|
-
}), u && /* @__PURE__ */ m("span", {
|
|
1336
|
-
id: C,
|
|
1337
|
-
className: $.description,
|
|
1338
1503
|
children: u
|
|
1504
|
+
}), d && /* @__PURE__ */ m("span", {
|
|
1505
|
+
id: T,
|
|
1506
|
+
className: $.description,
|
|
1507
|
+
children: d
|
|
1339
1508
|
})]
|
|
1340
1509
|
})
|
|
1341
1510
|
]
|
|
1342
|
-
}),
|
|
1343
|
-
id:
|
|
1511
|
+
}), c && /* @__PURE__ */ m("div", {
|
|
1512
|
+
id: E,
|
|
1344
1513
|
className: $.error,
|
|
1345
|
-
children:
|
|
1514
|
+
children: c
|
|
1346
1515
|
})]
|
|
1347
1516
|
});
|
|
1348
1517
|
});
|
|
1349
|
-
|
|
1518
|
+
ht.displayName = "Radio";
|
|
1350
1519
|
//#endregion
|
|
1351
1520
|
//#region src/theme/ThemeContext.ts
|
|
1352
|
-
var
|
|
1521
|
+
var gt = t(null), _t = (e) => e === "highContrast" ? "high-contrast" : e, vt = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
1353
1522
|
let [i, a] = D({
|
|
1354
1523
|
value: e,
|
|
1355
1524
|
defaultValue: t,
|
|
1356
1525
|
onChange: n
|
|
1357
|
-
}), s =
|
|
1526
|
+
}), s = _t(i);
|
|
1358
1527
|
o(() => {
|
|
1359
1528
|
if (typeof document > "u") return;
|
|
1360
1529
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -1370,7 +1539,7 @@ var lt = t(null), ut = (e) => e === "highContrast" ? "high-contrast" : e, dt = (
|
|
|
1370
1539
|
theme: i,
|
|
1371
1540
|
setTheme: a
|
|
1372
1541
|
}), [i, a]);
|
|
1373
|
-
return /* @__PURE__ */ m(
|
|
1542
|
+
return /* @__PURE__ */ m(gt.Provider, {
|
|
1374
1543
|
value: l,
|
|
1375
1544
|
children: /* @__PURE__ */ m("div", {
|
|
1376
1545
|
"data-vellira-theme": s,
|
|
@@ -1378,13 +1547,13 @@ var lt = t(null), ut = (e) => e === "highContrast" ? "high-contrast" : e, dt = (
|
|
|
1378
1547
|
})
|
|
1379
1548
|
});
|
|
1380
1549
|
};
|
|
1381
|
-
|
|
1550
|
+
vt.displayName = "ThemeProvider";
|
|
1382
1551
|
//#endregion
|
|
1383
1552
|
//#region src/theme/useTheme.ts
|
|
1384
|
-
function
|
|
1385
|
-
let e = a(
|
|
1553
|
+
function yt() {
|
|
1554
|
+
let e = a(gt);
|
|
1386
1555
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
1387
1556
|
return e;
|
|
1388
1557
|
}
|
|
1389
1558
|
//#endregion
|
|
1390
|
-
export {
|
|
1559
|
+
export { rt as Button, ct as Checkbox, G as Dropdown, Fe as FormField, pt as Input, De as Modal, ht as Radio, je as RadioGroup, Ve as Select, Qe as Tabs, vt as ThemeProvider, tt as Tooltip, yt as useTheme };
|