@vellira-ui/react 2.29.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 +538 -385
- 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,11 +88,11 @@ 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",
|
|
97
97
|
disabled: "_disabled_re11y_21",
|
|
98
98
|
active: "_active_re11y_34",
|
|
@@ -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,32 +114,32 @@ 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:
|
|
118
|
-
[
|
|
119
|
-
[
|
|
120
|
-
[
|
|
117
|
+
className: R(U.item, {
|
|
118
|
+
[U.active]: o,
|
|
119
|
+
[U.disabled]: a,
|
|
120
|
+
[U.danger]: i
|
|
121
121
|
}, d),
|
|
122
122
|
children: [
|
|
123
123
|
r && /* @__PURE__ */ m("span", {
|
|
124
124
|
"aria-hidden": "true",
|
|
125
|
-
className:
|
|
125
|
+
className: U.itemIcon,
|
|
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", {
|
|
133
|
-
className:
|
|
133
|
+
className: U.itemShortcut,
|
|
134
134
|
children: l
|
|
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,18 +200,18 @@ var ae = (e) => e.type === void 0 || e.type === "item", oe = (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
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(
|
|
213
|
+
className: R(de.wrapper, g),
|
|
214
|
+
children: [/* @__PURE__ */ m(se, {
|
|
215
215
|
ref: fe,
|
|
216
216
|
id: j,
|
|
217
217
|
isOpen: H,
|
|
@@ -224,37 +224,37 @@ var ae = (e) => e.type === void 0 || e.type === "item", oe = (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(
|
|
233
|
+
}), H && /* @__PURE__ */ m(V, {
|
|
234
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,84 +262,84 @@ var ae = (e) => e.type === void 0 || e.type === "item", oe = (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
|
-
|
|
271
|
-
var
|
|
272
|
-
let { descriptionId: t } =
|
|
270
|
+
K.displayName = "ModalContext";
|
|
271
|
+
var pe = { modalBody: "_modalBody_iv33a_1" }, me = ({ children: e }) => {
|
|
272
|
+
let { descriptionId: t } = fe();
|
|
273
273
|
return /* @__PURE__ */ m("div", {
|
|
274
274
|
id: t,
|
|
275
|
-
className:
|
|
275
|
+
className: pe.modalBody,
|
|
276
276
|
children: e
|
|
277
277
|
});
|
|
278
278
|
};
|
|
279
|
-
|
|
280
|
-
var
|
|
281
|
-
className:
|
|
279
|
+
me.displayName = "ModalBody";
|
|
280
|
+
var he = { content: "_content_k44g7_1" }, ge = ({ children: e }) => /* @__PURE__ */ m("div", {
|
|
281
|
+
className: he.content,
|
|
282
282
|
children: e
|
|
283
283
|
});
|
|
284
|
-
|
|
285
|
-
var
|
|
286
|
-
className:
|
|
284
|
+
ge.displayName = "ModalContent";
|
|
285
|
+
var _e = { modalFooter: "_modalFooter_ezys6_1" }, ve = ({ children: e }) => /* @__PURE__ */ m("div", {
|
|
286
|
+
className: _e.modalFooter,
|
|
287
287
|
children: e
|
|
288
288
|
});
|
|
289
|
-
|
|
290
|
-
var
|
|
289
|
+
ve.displayName = "ModalFooter";
|
|
290
|
+
var ye = {
|
|
291
291
|
modalHeader: "_modalHeader_p8xf1_1",
|
|
292
292
|
modalHeaderTitle: "_modalHeaderTitle_p8xf1_7",
|
|
293
293
|
modalHeaderCloseButton: "_modalHeaderCloseButton_p8xf1_14"
|
|
294
|
-
},
|
|
295
|
-
let { onClose: t, titleId: n } =
|
|
294
|
+
}, be = ({ children: e }) => {
|
|
295
|
+
let { onClose: t, titleId: n } = fe();
|
|
296
296
|
return /* @__PURE__ */ h("div", {
|
|
297
|
-
className:
|
|
297
|
+
className: ye.modalHeader,
|
|
298
298
|
children: [/* @__PURE__ */ m("h2", {
|
|
299
299
|
id: n,
|
|
300
|
-
className:
|
|
300
|
+
className: ye.modalHeaderTitle,
|
|
301
301
|
children: e
|
|
302
302
|
}), t && /* @__PURE__ */ m("button", {
|
|
303
303
|
type: "button",
|
|
304
|
-
className:
|
|
304
|
+
className: ye.modalHeaderCloseButton,
|
|
305
305
|
onClick: t,
|
|
306
306
|
"aria-label": "Close modal",
|
|
307
307
|
children: /* @__PURE__ */ m(F, { size: 16 })
|
|
308
308
|
})]
|
|
309
309
|
});
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
be.displayName = "ModalHeader";
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/hooks/useModalKeyboard.ts
|
|
314
|
-
var
|
|
314
|
+
var xe = ({ isOpen: e, onClose: t }) => {
|
|
315
315
|
let n = i((n) => {
|
|
316
316
|
e && n.key === "Escape" && (n.preventDefault(), t?.());
|
|
317
317
|
}, [e, t]);
|
|
318
318
|
o(() => (document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n)), [n]);
|
|
319
|
-
},
|
|
319
|
+
}, Se = {
|
|
320
320
|
overlay: "_overlay_dcudn_1",
|
|
321
321
|
"overlay--open": "_overlay--open_dcudn_14",
|
|
322
322
|
modal: "_modal_dcudn_20",
|
|
323
323
|
"overlay--animated": "_overlay--animated_dcudn_28"
|
|
324
|
-
},
|
|
325
|
-
let f = a ?? s ?? !0, p = l(null), { titleId: h, descriptionId: g } =
|
|
324
|
+
}, Ce = 0, we = "", Te = ({ children: e, onClose: t, isOpen: n, className: r, closeOnBackdrop: a, closeOnClick: s, closeOnEsc: c = !0, zIndex: u = 1e3, animated: d = !0 }) => {
|
|
325
|
+
let f = a ?? s ?? !0, p = l(null), { titleId: h, descriptionId: g } = fe(), _ = i((e) => {
|
|
326
326
|
f && e.target === e.currentTarget && t?.();
|
|
327
327
|
}, [f, t]);
|
|
328
|
-
return
|
|
328
|
+
return xe({
|
|
329
329
|
isOpen: n,
|
|
330
330
|
onClose: c ? t : void 0
|
|
331
331
|
}), o(() => {
|
|
332
|
-
if (n) return
|
|
333
|
-
|
|
332
|
+
if (n) return Ce === 0 && (we = document.body.style.overflow), Ce += 1, document.body.style.overflow = "hidden", () => {
|
|
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,
|
|
@@ -349,7 +349,7 @@ var be = ({ isOpen: e, onClose: t }) => {
|
|
|
349
349
|
children: /* @__PURE__ */ m("div", {
|
|
350
350
|
ref: p,
|
|
351
351
|
tabIndex: -1,
|
|
352
|
-
className:
|
|
352
|
+
className: Se.modal,
|
|
353
353
|
role: "dialog",
|
|
354
354
|
"aria-modal": "true",
|
|
355
355
|
"aria-labelledby": h,
|
|
@@ -359,10 +359,10 @@ var be = ({ isOpen: e, onClose: t }) => {
|
|
|
359
359
|
})
|
|
360
360
|
}) });
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
Te.displayName = "ModalOverlay";
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Modal/Modal.tsx
|
|
365
|
-
var
|
|
365
|
+
var Ee = ({ isOpen: e, children: t, onClose: n, closeOnBackdrop: r, closeOnClick: i, closeOnEsc: a = !0 }) => {
|
|
366
366
|
let o = k({
|
|
367
367
|
isOpen: e,
|
|
368
368
|
onClose: n,
|
|
@@ -370,32 +370,32 @@ var Te = ({ 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,
|
|
377
377
|
descriptionId: o.descriptionId
|
|
378
378
|
},
|
|
379
|
-
children: /* @__PURE__ */ m(
|
|
379
|
+
children: /* @__PURE__ */ m(Te, {
|
|
380
380
|
isOpen: o.isOpen,
|
|
381
381
|
onClose: o.onClose,
|
|
382
382
|
closeOnBackdrop: o.closeOnBackdrop,
|
|
383
383
|
closeOnEsc: o.closeOnEsc,
|
|
384
|
-
children: /* @__PURE__ */ m(
|
|
384
|
+
children: /* @__PURE__ */ m(ge, { children: t })
|
|
385
385
|
})
|
|
386
386
|
}) : null;
|
|
387
387
|
};
|
|
388
|
-
|
|
388
|
+
Ee.displayName = "Modal";
|
|
389
389
|
//#endregion
|
|
390
390
|
//#region src/components/Modal/index.ts
|
|
391
|
-
var
|
|
392
|
-
Header:
|
|
393
|
-
Body:
|
|
394
|
-
Content:
|
|
395
|
-
Footer:
|
|
396
|
-
}),
|
|
397
|
-
function
|
|
398
|
-
return a(
|
|
391
|
+
var De = Object.assign(Ee, {
|
|
392
|
+
Header: be,
|
|
393
|
+
Body: me,
|
|
394
|
+
Content: ge,
|
|
395
|
+
Footer: ve
|
|
396
|
+
}), Oe = t(null), ke = Oe.Provider;
|
|
397
|
+
function Ae() {
|
|
398
|
+
return a(Oe);
|
|
399
399
|
}
|
|
400
400
|
var q = {
|
|
401
401
|
root: "_root_1n02e_1",
|
|
@@ -408,7 +408,7 @@ var q = {
|
|
|
408
408
|
error: "_error_1n02e_51",
|
|
409
409
|
disabled: "_disabled_1n02e_59",
|
|
410
410
|
invalid: "_invalid_1n02e_75"
|
|
411
|
-
},
|
|
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
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,
|
|
@@ -424,7 +424,7 @@ var q = {
|
|
|
424
424
|
"aria-disabled": r || void 0,
|
|
425
425
|
"aria-required": i || void 0,
|
|
426
426
|
"aria-invalid": A || void 0,
|
|
427
|
-
className:
|
|
427
|
+
className: R(q.root, A && q.invalid, r && q.disabled, g),
|
|
428
428
|
children: [
|
|
429
429
|
l && /* @__PURE__ */ h("div", {
|
|
430
430
|
id: S,
|
|
@@ -440,7 +440,7 @@ var q = {
|
|
|
440
440
|
className: q.description,
|
|
441
441
|
children: u
|
|
442
442
|
}),
|
|
443
|
-
/* @__PURE__ */ m(
|
|
443
|
+
/* @__PURE__ */ m(ke, {
|
|
444
444
|
value: {
|
|
445
445
|
name: E,
|
|
446
446
|
value: O,
|
|
@@ -453,7 +453,7 @@ var q = {
|
|
|
453
453
|
onValueChange: k
|
|
454
454
|
},
|
|
455
455
|
children: /* @__PURE__ */ m("div", {
|
|
456
|
-
className:
|
|
456
|
+
className: R(q.items, q[f]),
|
|
457
457
|
children: p
|
|
458
458
|
})
|
|
459
459
|
}),
|
|
@@ -465,68 +465,116 @@ var q = {
|
|
|
465
465
|
]
|
|
466
466
|
});
|
|
467
467
|
});
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
468
|
+
je.displayName = "RadioGroup";
|
|
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
|
+
}) : _;
|
|
479
507
|
return /* @__PURE__ */ h("div", {
|
|
480
|
-
...
|
|
481
|
-
"aria-disabled":
|
|
482
|
-
className:
|
|
483
|
-
"data-disabled":
|
|
484
|
-
"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,
|
|
485
515
|
children: [
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
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
|
+
]
|
|
494
539
|
}),
|
|
495
|
-
|
|
496
|
-
id:
|
|
497
|
-
className:
|
|
498
|
-
children:
|
|
540
|
+
i && /* @__PURE__ */ m("div", {
|
|
541
|
+
id: O,
|
|
542
|
+
className: R(J.description, S),
|
|
543
|
+
children: i
|
|
499
544
|
}),
|
|
500
|
-
/* @__PURE__ */ m(
|
|
501
|
-
|
|
502
|
-
children:
|
|
545
|
+
/* @__PURE__ */ m(Me.Provider, {
|
|
546
|
+
value: N,
|
|
547
|
+
children: /* @__PURE__ */ m("div", {
|
|
548
|
+
className: R(J.control, b),
|
|
549
|
+
children: F
|
|
550
|
+
})
|
|
503
551
|
}),
|
|
504
|
-
|
|
505
|
-
id:
|
|
506
|
-
className:
|
|
552
|
+
a && /* @__PURE__ */ m("div", {
|
|
553
|
+
id: k,
|
|
554
|
+
className: R(J.errorText, C),
|
|
507
555
|
role: "alert",
|
|
508
|
-
children:
|
|
556
|
+
children: a
|
|
509
557
|
})
|
|
510
558
|
]
|
|
511
559
|
});
|
|
512
|
-
},
|
|
560
|
+
}, Ie = {
|
|
513
561
|
option: "_option_l6qjj_1",
|
|
514
562
|
selected: "_selected_l6qjj_18",
|
|
515
563
|
disabled: "_disabled_l6qjj_18",
|
|
516
564
|
active: "_active_l6qjj_34",
|
|
517
565
|
label: "_label_l6qjj_46",
|
|
518
566
|
check: "_check_l6qjj_54"
|
|
519
|
-
},
|
|
567
|
+
}, Le = ({ option: e, isSelected: t, isActive: n, optionId: r, onSelect: i, onMouseEnter: a }) => {
|
|
520
568
|
let o = !!e.disabled;
|
|
521
569
|
return /* @__PURE__ */ h("li", {
|
|
522
570
|
id: r,
|
|
523
571
|
role: "option",
|
|
524
572
|
"aria-selected": t,
|
|
525
573
|
"aria-disabled": o || void 0,
|
|
526
|
-
className:
|
|
527
|
-
[
|
|
528
|
-
[
|
|
529
|
-
[
|
|
574
|
+
className: R(Ie.option, {
|
|
575
|
+
[Ie.selected]: t,
|
|
576
|
+
[Ie.active]: n,
|
|
577
|
+
[Ie.disabled]: o
|
|
530
578
|
}),
|
|
531
579
|
onClick: () => {
|
|
532
580
|
o || i(e.value);
|
|
@@ -535,28 +583,28 @@ var J = {
|
|
|
535
583
|
o || a();
|
|
536
584
|
},
|
|
537
585
|
children: [/* @__PURE__ */ m("span", {
|
|
538
|
-
className:
|
|
586
|
+
className: Ie.label,
|
|
539
587
|
children: e.label
|
|
540
588
|
}), /* @__PURE__ */ m("span", {
|
|
541
|
-
className:
|
|
589
|
+
className: Ie.check,
|
|
542
590
|
"aria-hidden": "true",
|
|
543
591
|
children: t && /* @__PURE__ */ m(N, {})
|
|
544
592
|
})]
|
|
545
593
|
});
|
|
546
594
|
};
|
|
547
|
-
|
|
548
|
-
var
|
|
595
|
+
Le.displayName = "SelectOption";
|
|
596
|
+
var Re = {
|
|
549
597
|
dropdown: "_dropdown_qznlq_1",
|
|
550
598
|
dropdownIn: "_dropdownIn_qznlq_1",
|
|
551
599
|
empty: "_empty_qznlq_17"
|
|
552
|
-
},
|
|
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", {
|
|
553
601
|
ref: r,
|
|
554
602
|
id: t,
|
|
555
603
|
role: "listbox",
|
|
556
604
|
"aria-labelledby": n,
|
|
557
|
-
className: [
|
|
605
|
+
className: [Re.dropdown, l].filter(Boolean).join(" "),
|
|
558
606
|
style: i,
|
|
559
|
-
children: a.length ? a.map((e, n) => /* @__PURE__ */ m(
|
|
607
|
+
children: a.length ? a.map((e, n) => /* @__PURE__ */ m(Le, {
|
|
560
608
|
option: e,
|
|
561
609
|
isSelected: e.value === s,
|
|
562
610
|
isActive: n === c,
|
|
@@ -567,11 +615,11 @@ var Pe = {
|
|
|
567
615
|
role: "option",
|
|
568
616
|
"aria-disabled": "true",
|
|
569
617
|
"aria-selected": "false",
|
|
570
|
-
className:
|
|
618
|
+
className: Re.empty,
|
|
571
619
|
children: o
|
|
572
620
|
})
|
|
573
621
|
}) }) : null;
|
|
574
|
-
|
|
622
|
+
ze.displayName = "SelectDropdown";
|
|
575
623
|
var Y = {
|
|
576
624
|
control: "_control_1xma1_1",
|
|
577
625
|
disabled: "_disabled_1xma1_18",
|
|
@@ -583,7 +631,7 @@ var Y = {
|
|
|
583
631
|
placeholder: "_placeholder_1xma1_63",
|
|
584
632
|
error: "_error_1xma1_67",
|
|
585
633
|
open: "_open_1xma1_109"
|
|
586
|
-
},
|
|
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", {
|
|
587
635
|
id: e,
|
|
588
636
|
ref: p,
|
|
589
637
|
type: "button",
|
|
@@ -598,7 +646,7 @@ var Y = {
|
|
|
598
646
|
"aria-controls": n ? a : void 0,
|
|
599
647
|
"aria-describedby": t,
|
|
600
648
|
"aria-activedescendant": n && o >= 0 ? `${a}-option-${o}` : void 0,
|
|
601
|
-
className:
|
|
649
|
+
className: R(Y.control, Y[d], {
|
|
602
650
|
[Y.error]: !!c,
|
|
603
651
|
[Y.disabled]: r
|
|
604
652
|
}, f),
|
|
@@ -607,19 +655,19 @@ var Y = {
|
|
|
607
655
|
onBlur: v,
|
|
608
656
|
onFocus: y,
|
|
609
657
|
children: [/* @__PURE__ */ m("span", {
|
|
610
|
-
className:
|
|
658
|
+
className: R(Y.value, { [Y.placeholder]: u }),
|
|
611
659
|
children: l
|
|
612
660
|
}), /* @__PURE__ */ m("span", {
|
|
613
|
-
className:
|
|
661
|
+
className: R(Y.arrow, { [Y.open]: n }),
|
|
614
662
|
"aria-hidden": "true",
|
|
615
663
|
children: /* @__PURE__ */ m(P, {})
|
|
616
664
|
})]
|
|
617
665
|
});
|
|
618
|
-
|
|
666
|
+
Be.displayName = "SelectTrigger";
|
|
619
667
|
//#endregion
|
|
620
668
|
//#region src/components/Select/Select.tsx
|
|
621
|
-
var
|
|
622
|
-
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:
|
|
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({
|
|
623
671
|
value: o,
|
|
624
672
|
defaultValue: c,
|
|
625
673
|
onChange: u,
|
|
@@ -628,22 +676,22 @@ var Le = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
628
676
|
open: S,
|
|
629
677
|
defaultOpen: C,
|
|
630
678
|
onOpenChange: w
|
|
631
|
-
}),
|
|
679
|
+
}), oe = !!z, { floatingStyles: W, setRef: se, setFloatingRef: ce } = ee({
|
|
632
680
|
open: B,
|
|
633
681
|
onOpenChange: V,
|
|
634
682
|
placement: b,
|
|
635
683
|
matchTriggerWidth: x,
|
|
636
684
|
mobileSheetBreakpoint: 640
|
|
637
|
-
}),
|
|
638
|
-
|
|
639
|
-
}, [
|
|
640
|
-
te([I, L],
|
|
641
|
-
let
|
|
642
|
-
I.current = e,
|
|
643
|
-
}, [
|
|
644
|
-
L.current = e,
|
|
645
|
-
}, [
|
|
646
|
-
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, {
|
|
647
695
|
id: M,
|
|
648
696
|
label: e,
|
|
649
697
|
description: t,
|
|
@@ -652,7 +700,7 @@ var Le = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
652
700
|
disabled: v,
|
|
653
701
|
className: D,
|
|
654
702
|
children: [
|
|
655
|
-
/* @__PURE__ */ m(
|
|
703
|
+
/* @__PURE__ */ m(Be, {
|
|
656
704
|
id: M,
|
|
657
705
|
errorId: F,
|
|
658
706
|
isOpen: B,
|
|
@@ -663,12 +711,12 @@ var Le = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
663
711
|
ariaLabel: a ?? (e ? void 0 : z?.label || f),
|
|
664
712
|
error: P,
|
|
665
713
|
displayText: z?.label ?? f,
|
|
666
|
-
isPlaceholder: !
|
|
714
|
+
isPlaceholder: !oe,
|
|
667
715
|
size: g,
|
|
668
716
|
className: O,
|
|
669
|
-
buttonRef:
|
|
670
|
-
onClick:
|
|
671
|
-
onKeyDown:
|
|
717
|
+
buttonRef: ue,
|
|
718
|
+
onClick: U,
|
|
719
|
+
onKeyDown: ae,
|
|
672
720
|
onBlur: T,
|
|
673
721
|
onFocus: E
|
|
674
722
|
}),
|
|
@@ -678,50 +726,50 @@ var Le = ({ label: e, description: t, id: n, name: r, "aria-label": a, value: o,
|
|
|
678
726
|
value: R,
|
|
679
727
|
disabled: v
|
|
680
728
|
}),
|
|
681
|
-
/* @__PURE__ */ m(
|
|
729
|
+
/* @__PURE__ */ m(ze, {
|
|
682
730
|
isOpen: B,
|
|
683
731
|
listboxId: N,
|
|
684
732
|
labelledById: M,
|
|
685
|
-
style:
|
|
733
|
+
style: W,
|
|
686
734
|
options: d,
|
|
687
735
|
noOptionsText: p,
|
|
688
736
|
selectedValue: R,
|
|
689
737
|
activeIndex: H,
|
|
690
738
|
className: k,
|
|
691
|
-
setDropdownRef:
|
|
692
|
-
onSelect:
|
|
693
|
-
onMouseEnter:
|
|
739
|
+
setDropdownRef: de,
|
|
740
|
+
onSelect: le,
|
|
741
|
+
onMouseEnter: ne
|
|
694
742
|
})
|
|
695
743
|
]
|
|
696
744
|
});
|
|
697
745
|
};
|
|
698
|
-
|
|
746
|
+
Ve.displayName = "Select";
|
|
699
747
|
//#endregion
|
|
700
748
|
//#region src/components/Tabs/TabsContext.tsx
|
|
701
|
-
var
|
|
702
|
-
let e = a(
|
|
749
|
+
var He = t(null), Ue = () => {
|
|
750
|
+
let e = a(He);
|
|
703
751
|
if (!e) throw Error("Tabs components must be used inside Tabs");
|
|
704
752
|
return e;
|
|
705
|
-
},
|
|
753
|
+
}, We = {
|
|
706
754
|
list: "_list_13hkl_1",
|
|
707
755
|
vertical: "_vertical_13hkl_8"
|
|
708
|
-
},
|
|
709
|
-
let { orientation: r, appearance: i } =
|
|
756
|
+
}, Ge = ({ children: e, className: t, ...n }) => {
|
|
757
|
+
let { orientation: r, appearance: i } = Ue();
|
|
710
758
|
return /* @__PURE__ */ m("div", {
|
|
711
759
|
...n,
|
|
712
760
|
role: "tablist",
|
|
713
761
|
"aria-orientation": r,
|
|
714
|
-
className:
|
|
762
|
+
className: R(We.list, r === "vertical" && We.vertical, i === "underline" && We.underline, i === "pills" && We.pills, t),
|
|
715
763
|
children: e
|
|
716
764
|
});
|
|
717
765
|
};
|
|
718
|
-
|
|
719
|
-
var
|
|
766
|
+
Ge.displayName = "TabsList";
|
|
767
|
+
var Ke = {
|
|
720
768
|
panel: "_panel_1v1a9_1",
|
|
721
769
|
visible: "_visible_1v1a9_10",
|
|
722
770
|
vertical: "_vertical_1v1a9_14"
|
|
723
|
-
},
|
|
724
|
-
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;
|
|
725
773
|
return o(() => {
|
|
726
774
|
if (!c) {
|
|
727
775
|
s(!1);
|
|
@@ -735,12 +783,12 @@ var He = {
|
|
|
735
783
|
"aria-labelledby": `tab-${e}`,
|
|
736
784
|
hidden: !c,
|
|
737
785
|
tabIndex: 0,
|
|
738
|
-
className:
|
|
786
|
+
className: R(Ke.panel, a && Ke.visible, i === "vertical" && Ke.vertical, n),
|
|
739
787
|
children: t
|
|
740
788
|
});
|
|
741
789
|
};
|
|
742
|
-
|
|
743
|
-
var
|
|
790
|
+
qe.displayName = "TabsPanel";
|
|
791
|
+
var Je = {
|
|
744
792
|
tab: "_tab_qe8xc_1",
|
|
745
793
|
iconOnly: "_iconOnly_qe8xc_27",
|
|
746
794
|
tabIcon: "_tabIcon_qe8xc_31",
|
|
@@ -749,8 +797,8 @@ var We = {
|
|
|
749
797
|
underline: "_underline_qe8xc_60",
|
|
750
798
|
pills: "_pills_qe8xc_92",
|
|
751
799
|
vertical: "_vertical_qe8xc_106"
|
|
752
|
-
},
|
|
753
|
-
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;
|
|
754
802
|
return /* @__PURE__ */ h("button", {
|
|
755
803
|
type: "button",
|
|
756
804
|
ref: i((t) => {
|
|
@@ -766,7 +814,7 @@ var We = {
|
|
|
766
814
|
id: `tab-${e}`,
|
|
767
815
|
disabled: r,
|
|
768
816
|
tabIndex: v ? 0 : -1,
|
|
769
|
-
className:
|
|
817
|
+
className: R(Je.tab, Je[p], f === "vertical" && Je.vertical, y && Je.withIcon, b && Je.iconOnly, n),
|
|
770
818
|
onClick: (t) => {
|
|
771
819
|
r || (d(e), o?.(t));
|
|
772
820
|
},
|
|
@@ -775,20 +823,20 @@ var We = {
|
|
|
775
823
|
},
|
|
776
824
|
...c,
|
|
777
825
|
children: [y && /* @__PURE__ */ m("span", {
|
|
778
|
-
className:
|
|
826
|
+
className: Je.tabIcon,
|
|
779
827
|
"aria-hidden": "true",
|
|
780
828
|
children: a
|
|
781
829
|
}), t != null && /* @__PURE__ */ m("span", {
|
|
782
|
-
className:
|
|
830
|
+
className: Je.label,
|
|
783
831
|
children: t
|
|
784
832
|
})]
|
|
785
833
|
});
|
|
786
834
|
});
|
|
787
|
-
|
|
788
|
-
var
|
|
835
|
+
Ye.displayName = "Tab";
|
|
836
|
+
var Xe = {
|
|
789
837
|
tabs: "_tabs_uqy7q_1",
|
|
790
838
|
vertical: "_vertical_uqy7q_5"
|
|
791
|
-
},
|
|
839
|
+
}, Ze = ({ children: e, activeIndex: t, defaultActiveIndex: n = 0, onChange: r, orientation: a = "horizontal", appearance: o = "default", className: s }) => {
|
|
792
840
|
let { activeIndex: c, setActiveIndex: u } = j({
|
|
793
841
|
activeIndex: t,
|
|
794
842
|
defaultActiveIndex: n,
|
|
@@ -811,25 +859,25 @@ var Ke = {
|
|
|
811
859
|
registerTab: f,
|
|
812
860
|
onTabKeyDown: p
|
|
813
861
|
};
|
|
814
|
-
return /* @__PURE__ */ m(
|
|
862
|
+
return /* @__PURE__ */ m(He.Provider, {
|
|
815
863
|
value: h,
|
|
816
864
|
children: /* @__PURE__ */ m("div", {
|
|
817
|
-
className:
|
|
865
|
+
className: R(Xe.tabs, a === "vertical" && Xe.vertical, s),
|
|
818
866
|
children: e
|
|
819
867
|
})
|
|
820
868
|
});
|
|
821
869
|
};
|
|
822
|
-
|
|
870
|
+
Ze.displayName = "Tabs";
|
|
823
871
|
//#endregion
|
|
824
872
|
//#region src/components/Tabs/index.ts
|
|
825
|
-
var
|
|
826
|
-
List:
|
|
827
|
-
Tab:
|
|
828
|
-
Panel:
|
|
829
|
-
}),
|
|
873
|
+
var Qe = Object.assign(Ze, {
|
|
874
|
+
List: Ge,
|
|
875
|
+
Tab: Ye,
|
|
876
|
+
Panel: qe
|
|
877
|
+
}), $e = {
|
|
830
878
|
tooltip: "_tooltip_10opu_1",
|
|
831
879
|
arrow: "_arrow_10opu_25"
|
|
832
|
-
},
|
|
880
|
+
}, et = n(({ content: e, placement: t = "top", arrowRef: n, arrowX: r, arrowY: i, className: a, style: o, ...s }, c) => {
|
|
833
881
|
let l = {
|
|
834
882
|
top: "bottom",
|
|
835
883
|
right: "left",
|
|
@@ -844,22 +892,22 @@ var Je = Object.assign(qe, {
|
|
|
844
892
|
};
|
|
845
893
|
return /* @__PURE__ */ h("div", {
|
|
846
894
|
ref: c,
|
|
847
|
-
className:
|
|
895
|
+
className: R($e.tooltip, a),
|
|
848
896
|
"data-placement": t,
|
|
849
897
|
"data-state": "open",
|
|
850
898
|
style: o,
|
|
851
899
|
...s,
|
|
852
900
|
children: [e, /* @__PURE__ */ m("div", {
|
|
853
901
|
ref: n,
|
|
854
|
-
className:
|
|
902
|
+
className: $e.arrow,
|
|
855
903
|
style: u
|
|
856
904
|
})]
|
|
857
905
|
});
|
|
858
906
|
});
|
|
859
|
-
|
|
907
|
+
et.displayName = "TooltipContent";
|
|
860
908
|
//#endregion
|
|
861
909
|
//#region src/components/Tooltip/Tooltip.tsx
|
|
862
|
-
var
|
|
910
|
+
var tt = ({ children: e, placement: t = "top", content: n, disabled: r = !1, delay: i = {
|
|
863
911
|
open: 300,
|
|
864
912
|
close: 100
|
|
865
913
|
}, maxWidth: a = 250, className: o, onOpenChange: c }) => {
|
|
@@ -880,7 +928,7 @@ var Ze = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
880
928
|
"aria-describedby": d ? y : void 0,
|
|
881
929
|
...j(),
|
|
882
930
|
children: e
|
|
883
|
-
}), /* @__PURE__ */ m(g, { children: d && n && /* @__PURE__ */ m(
|
|
931
|
+
}), /* @__PURE__ */ m(g, { children: d && n && /* @__PURE__ */ m(et, {
|
|
884
932
|
id: y,
|
|
885
933
|
ref: D,
|
|
886
934
|
content: n,
|
|
@@ -897,10 +945,10 @@ var Ze = ({ children: e, placement: t = "top", content: n, disabled: r = !1, del
|
|
|
897
945
|
...M()
|
|
898
946
|
}) })] });
|
|
899
947
|
};
|
|
900
|
-
|
|
948
|
+
tt.displayName = "Tooltip";
|
|
901
949
|
//#endregion
|
|
902
950
|
//#region src/utils/devWarning.ts
|
|
903
|
-
var
|
|
951
|
+
var nt = (e, t) => {
|
|
904
952
|
process.env.NODE_ENV !== "production" && !e && console.warn(t);
|
|
905
953
|
}, X = {
|
|
906
954
|
button: "_button_2nghu_1",
|
|
@@ -930,23 +978,23 @@ var Qe = (e, t) => {
|
|
|
930
978
|
"button-spin": "_button-spin_2nghu_1",
|
|
931
979
|
badge: "_badge_2nghu_786",
|
|
932
980
|
shortcut: "_shortcut_2nghu_800"
|
|
933
|
-
},
|
|
934
|
-
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, {
|
|
935
983
|
[X.disabled]: V,
|
|
936
984
|
[X.loading]: l,
|
|
937
985
|
[X.fullWidth]: b,
|
|
938
986
|
[X.iconOnly]: z
|
|
939
987
|
});
|
|
940
|
-
|
|
941
|
-
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) => {
|
|
942
990
|
e.preventDefault(), e.stopPropagation();
|
|
943
|
-
},
|
|
991
|
+
}, U = (e) => {
|
|
944
992
|
if (V) {
|
|
945
|
-
|
|
993
|
+
re(e);
|
|
946
994
|
return;
|
|
947
995
|
}
|
|
948
996
|
I?.props.onClick?.(e), e.defaultPrevented || w?.(e);
|
|
949
|
-
},
|
|
997
|
+
}, ie = /* @__PURE__ */ h(p, { children: [
|
|
950
998
|
l && (g ? /* @__PURE__ */ m("span", {
|
|
951
999
|
className: X.icon,
|
|
952
1000
|
"aria-hidden": "true",
|
|
@@ -959,12 +1007,12 @@ var Qe = (e, t) => {
|
|
|
959
1007
|
className: X.icon,
|
|
960
1008
|
children: d
|
|
961
1009
|
}),
|
|
962
|
-
|
|
1010
|
+
H && !z && /* @__PURE__ */ m("span", {
|
|
963
1011
|
className: X.label,
|
|
964
|
-
"data-measure":
|
|
1012
|
+
"data-measure": ee,
|
|
965
1013
|
children: /* @__PURE__ */ m("span", {
|
|
966
1014
|
className: X.labelText,
|
|
967
|
-
children:
|
|
1015
|
+
children: H
|
|
968
1016
|
})
|
|
969
1017
|
}),
|
|
970
1018
|
_ && !z && /* @__PURE__ */ m("span", {
|
|
@@ -987,12 +1035,12 @@ var Qe = (e, t) => {
|
|
|
987
1035
|
"aria-disabled": V || void 0,
|
|
988
1036
|
"aria-label": T || I.props["aria-label"] || void 0,
|
|
989
1037
|
"aria-labelledby": E || I.props["aria-labelledby"] || void 0,
|
|
990
|
-
className:
|
|
1038
|
+
className: R(I.props.className, ne),
|
|
991
1039
|
href: V ? void 0 : I.props.href,
|
|
992
|
-
onClick:
|
|
1040
|
+
onClick: U,
|
|
993
1041
|
tabIndex: V ? -1 : I.props.tabIndex,
|
|
994
1042
|
title: y || I.props.title,
|
|
995
|
-
children:
|
|
1043
|
+
children: ie
|
|
996
1044
|
}) : D ? /* @__PURE__ */ m("a", {
|
|
997
1045
|
ref: F,
|
|
998
1046
|
href: V ? void 0 : D,
|
|
@@ -1000,16 +1048,16 @@ var Qe = (e, t) => {
|
|
|
1000
1048
|
role: M,
|
|
1001
1049
|
tabIndex: V ? -1 : N,
|
|
1002
1050
|
target: O,
|
|
1003
|
-
rel:
|
|
1051
|
+
rel: te,
|
|
1004
1052
|
download: A,
|
|
1005
|
-
onClick: V ?
|
|
1053
|
+
onClick: V ? re : w,
|
|
1006
1054
|
"aria-disabled": V || void 0,
|
|
1007
1055
|
"aria-label": T || void 0,
|
|
1008
1056
|
"aria-labelledby": E || void 0,
|
|
1009
1057
|
"aria-busy": l || void 0,
|
|
1010
|
-
className:
|
|
1058
|
+
className: ne,
|
|
1011
1059
|
title: y,
|
|
1012
|
-
children:
|
|
1060
|
+
children: ie
|
|
1013
1061
|
}) : /* @__PURE__ */ m("button", {
|
|
1014
1062
|
...P,
|
|
1015
1063
|
ref: F,
|
|
@@ -1022,69 +1070,69 @@ var Qe = (e, t) => {
|
|
|
1022
1070
|
"aria-label": T || void 0,
|
|
1023
1071
|
"aria-labelledby": E || void 0,
|
|
1024
1072
|
"aria-busy": l || void 0,
|
|
1025
|
-
className:
|
|
1073
|
+
className: ne,
|
|
1026
1074
|
title: y,
|
|
1027
|
-
children:
|
|
1075
|
+
children: ie
|
|
1028
1076
|
});
|
|
1029
1077
|
});
|
|
1030
|
-
|
|
1078
|
+
rt.displayName = "Button";
|
|
1031
1079
|
var Z = {
|
|
1032
|
-
wrapper: "
|
|
1033
|
-
colorPrimary: "
|
|
1034
|
-
colorNeutral: "
|
|
1035
|
-
colorSuccess: "
|
|
1036
|
-
colorWarning: "
|
|
1037
|
-
colorDanger: "
|
|
1038
|
-
labelStart: "
|
|
1039
|
-
wrapperSm: "
|
|
1040
|
-
wrapperMd: "
|
|
1041
|
-
wrapperLg: "
|
|
1042
|
-
iconOnly: "
|
|
1043
|
-
container: "
|
|
1044
|
-
containerSm: "
|
|
1045
|
-
containerMd: "
|
|
1046
|
-
containerLg: "
|
|
1047
|
-
containerLabelStart: "
|
|
1048
|
-
descriptionText: "
|
|
1049
|
-
errorText: "
|
|
1050
|
-
input: "
|
|
1051
|
-
customCheckbox: "
|
|
1052
|
-
requiredMark: "
|
|
1053
|
-
error: "
|
|
1054
|
-
checkmark: "
|
|
1055
|
-
indeterminateMark: "
|
|
1056
|
-
customMark: "
|
|
1057
|
-
label: "
|
|
1058
|
-
labelSm: "
|
|
1059
|
-
labelMd: "
|
|
1060
|
-
labelLg: "
|
|
1061
|
-
indeterminate: "
|
|
1062
|
-
"checkbox-pop": "_checkbox-
|
|
1063
|
-
disabled: "
|
|
1064
|
-
},
|
|
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 = {
|
|
1065
1113
|
sm: Z.labelSm,
|
|
1066
1114
|
md: Z.labelMd,
|
|
1067
1115
|
lg: Z.labelLg
|
|
1068
|
-
},
|
|
1116
|
+
}, at = {
|
|
1069
1117
|
sm: Z.wrapperSm,
|
|
1070
1118
|
md: Z.wrapperMd,
|
|
1071
1119
|
lg: Z.wrapperLg
|
|
1072
|
-
},
|
|
1120
|
+
}, ot = {
|
|
1073
1121
|
sm: Z.containerSm,
|
|
1074
1122
|
md: Z.containerMd,
|
|
1075
1123
|
lg: Z.containerLg
|
|
1076
|
-
},
|
|
1124
|
+
}, st = {
|
|
1077
1125
|
primary: Z.colorPrimary,
|
|
1078
1126
|
neutral: Z.colorNeutral,
|
|
1079
1127
|
success: Z.colorSuccess,
|
|
1080
1128
|
warning: Z.colorWarning,
|
|
1081
1129
|
danger: Z.colorDanger
|
|
1082
|
-
},
|
|
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) => {
|
|
1083
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 = [
|
|
1084
1132
|
T,
|
|
1085
1133
|
P,
|
|
1086
1134
|
F
|
|
1087
|
-
].filter(Boolean).join(" "), [
|
|
1135
|
+
].filter(Boolean).join(" "), [L, z] = D({
|
|
1088
1136
|
value: c,
|
|
1089
1137
|
defaultValue: p,
|
|
1090
1138
|
onChange: x
|
|
@@ -1101,19 +1149,19 @@ var Z = {
|
|
|
1101
1149
|
let V = (e) => {
|
|
1102
1150
|
z(e.target.checked);
|
|
1103
1151
|
};
|
|
1104
|
-
return
|
|
1105
|
-
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),
|
|
1106
1154
|
children: [
|
|
1107
1155
|
/* @__PURE__ */ h("label", {
|
|
1108
1156
|
htmlFor: A,
|
|
1109
|
-
className:
|
|
1157
|
+
className: R(Z.wrapper, at[u], st[d], f === "start" && Z.labelStart, !t && Z.iconOnly, g && Z.disabled, b),
|
|
1110
1158
|
children: [
|
|
1111
1159
|
/* @__PURE__ */ m("input", {
|
|
1112
1160
|
...E,
|
|
1113
1161
|
ref: B,
|
|
1114
1162
|
id: A,
|
|
1115
1163
|
type: "checkbox",
|
|
1116
|
-
checked:
|
|
1164
|
+
checked: L,
|
|
1117
1165
|
disabled: g,
|
|
1118
1166
|
required: _,
|
|
1119
1167
|
onChange: V,
|
|
@@ -1125,18 +1173,18 @@ var Z = {
|
|
|
1125
1173
|
"aria-describedby": I || void 0
|
|
1126
1174
|
}),
|
|
1127
1175
|
/* @__PURE__ */ m("span", {
|
|
1128
|
-
className:
|
|
1176
|
+
className: R(Z.customCheckbox, M && Z.error, v && Z.indeterminate),
|
|
1129
1177
|
"aria-hidden": "true",
|
|
1130
1178
|
children: v ? /* @__PURE__ */ m("span", {
|
|
1131
|
-
className:
|
|
1179
|
+
className: R(Z.indeterminateMark, a && Z.customMark),
|
|
1132
1180
|
children: a
|
|
1133
|
-
}) :
|
|
1181
|
+
}) : L && /* @__PURE__ */ m("span", {
|
|
1134
1182
|
className: Z.checkmark,
|
|
1135
1183
|
children: r ?? /* @__PURE__ */ m(N, {})
|
|
1136
1184
|
})
|
|
1137
1185
|
}),
|
|
1138
1186
|
t && /* @__PURE__ */ h("span", {
|
|
1139
|
-
className:
|
|
1187
|
+
className: R(Z.label, it[u]),
|
|
1140
1188
|
children: [t, _ && /* @__PURE__ */ m("span", {
|
|
1141
1189
|
className: Z.requiredMark,
|
|
1142
1190
|
"aria-hidden": "true",
|
|
@@ -1158,27 +1206,49 @@ var Z = {
|
|
|
1158
1206
|
]
|
|
1159
1207
|
});
|
|
1160
1208
|
});
|
|
1161
|
-
|
|
1209
|
+
ct.displayName = "Checkbox";
|
|
1162
1210
|
var Q = {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
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 = {
|
|
1182
1252
|
default: Q.toneDefault,
|
|
1183
1253
|
primary: Q.tonePrimary,
|
|
1184
1254
|
secondary: Q.toneSecondary,
|
|
@@ -1186,7 +1256,7 @@ var Q = {
|
|
|
1186
1256
|
danger: Q.toneDanger,
|
|
1187
1257
|
muted: Q.toneMuted,
|
|
1188
1258
|
inverse: Q.toneInverse
|
|
1189
|
-
},
|
|
1259
|
+
}, ut = (e = "text", t) => {
|
|
1190
1260
|
if (t) return t;
|
|
1191
1261
|
switch (e) {
|
|
1192
1262
|
case "email": return "email";
|
|
@@ -1196,78 +1266,161 @@ var Q = {
|
|
|
1196
1266
|
case "search": return "off";
|
|
1197
1267
|
default: return;
|
|
1198
1268
|
}
|
|
1199
|
-
},
|
|
1200
|
-
let
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
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);
|
|
1207
1291
|
return;
|
|
1208
1292
|
}
|
|
1209
|
-
|
|
1210
|
-
}, [
|
|
1211
|
-
let t = e.target.value;
|
|
1212
|
-
|
|
1213
|
-
}, [
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
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
|
|
1227
1319
|
}),
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
/* @__PURE__ */ m("input", {
|
|
1235
|
-
...I,
|
|
1236
|
-
ref: ie,
|
|
1237
|
-
id: B,
|
|
1238
|
-
name: n,
|
|
1239
|
-
type: f,
|
|
1240
|
-
autoComplete: ne,
|
|
1241
|
-
className: L(Q.input, Q[p], { [Q.error]: !!g }, y),
|
|
1242
|
-
value: U,
|
|
1243
|
-
onChange: ae,
|
|
1244
|
-
placeholder: a,
|
|
1245
|
-
disabled: _,
|
|
1246
|
-
readOnly: x,
|
|
1247
|
-
required: v,
|
|
1248
|
-
autoFocus: A,
|
|
1249
|
-
maxLength: j,
|
|
1250
|
-
"aria-invalid": g ? !0 : F,
|
|
1251
|
-
"aria-describedby": re || void 0,
|
|
1252
|
-
onMouseEnter: M,
|
|
1253
|
-
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
|
|
1254
1326
|
}),
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
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
|
|
1268
1421
|
});
|
|
1269
1422
|
});
|
|
1270
|
-
|
|
1423
|
+
pt.displayName = "Input";
|
|
1271
1424
|
var $ = {
|
|
1272
1425
|
root: "_root_qb9nm_1",
|
|
1273
1426
|
invalid: "_invalid_qb9nm_27",
|
|
@@ -1289,14 +1442,14 @@ var $ = {
|
|
|
1289
1442
|
customIcon: "_customIcon_qb9nm_216",
|
|
1290
1443
|
content: "_content_qb9nm_335",
|
|
1291
1444
|
error: "_error_qb9nm_352"
|
|
1292
|
-
},
|
|
1445
|
+
}, mt = {
|
|
1293
1446
|
primary: $.colorPrimary,
|
|
1294
1447
|
neutral: $.colorNeutral,
|
|
1295
1448
|
success: $.colorSuccess,
|
|
1296
1449
|
warning: $.colorWarning,
|
|
1297
1450
|
danger: $.colorDanger
|
|
1298
|
-
},
|
|
1299
|
-
let S =
|
|
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 = [
|
|
1300
1453
|
T,
|
|
1301
1454
|
E,
|
|
1302
1455
|
S?.describedBy,
|
|
@@ -1305,7 +1458,7 @@ var $ = {
|
|
|
1305
1458
|
value: t,
|
|
1306
1459
|
defaultValue: n,
|
|
1307
1460
|
onChange: l
|
|
1308
|
-
}), M = k ? S.value === e : A, N = !!S?.disabled || r, P = !!S?.required || i, F = S?.name ?? v, I = !!(c || S?.invalid),
|
|
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) => {
|
|
1309
1462
|
if (!N) {
|
|
1310
1463
|
if (k) {
|
|
1311
1464
|
S.onValueChange(e);
|
|
@@ -1315,10 +1468,10 @@ var $ = {
|
|
|
1315
1468
|
}
|
|
1316
1469
|
};
|
|
1317
1470
|
return /* @__PURE__ */ h("div", {
|
|
1318
|
-
className:
|
|
1471
|
+
className: R($.root, $[L], I && $.invalid, N && $.disabled, mt[z], g),
|
|
1319
1472
|
children: [/* @__PURE__ */ h("label", {
|
|
1320
1473
|
htmlFor: w,
|
|
1321
|
-
className:
|
|
1474
|
+
className: R($.wrapper, p),
|
|
1322
1475
|
children: [
|
|
1323
1476
|
/* @__PURE__ */ m("input", {
|
|
1324
1477
|
...b,
|
|
@@ -1339,7 +1492,7 @@ var $ = {
|
|
|
1339
1492
|
className: $.control,
|
|
1340
1493
|
"aria-hidden": "true",
|
|
1341
1494
|
children: /* @__PURE__ */ m("span", {
|
|
1342
|
-
className:
|
|
1495
|
+
className: R($.indicator, f && $.customIcon),
|
|
1343
1496
|
children: f
|
|
1344
1497
|
})
|
|
1345
1498
|
}),
|
|
@@ -1362,15 +1515,15 @@ var $ = {
|
|
|
1362
1515
|
})]
|
|
1363
1516
|
});
|
|
1364
1517
|
});
|
|
1365
|
-
|
|
1518
|
+
ht.displayName = "Radio";
|
|
1366
1519
|
//#endregion
|
|
1367
1520
|
//#region src/theme/ThemeContext.ts
|
|
1368
|
-
var
|
|
1521
|
+
var gt = t(null), _t = (e) => e === "highContrast" ? "high-contrast" : e, vt = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, children: r }) => {
|
|
1369
1522
|
let [i, a] = D({
|
|
1370
1523
|
value: e,
|
|
1371
1524
|
defaultValue: t,
|
|
1372
1525
|
onChange: n
|
|
1373
|
-
}), s =
|
|
1526
|
+
}), s = _t(i);
|
|
1374
1527
|
o(() => {
|
|
1375
1528
|
if (typeof document > "u") return;
|
|
1376
1529
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -1386,7 +1539,7 @@ var ut = t(null), dt = (e) => e === "highContrast" ? "high-contrast" : e, ft = (
|
|
|
1386
1539
|
theme: i,
|
|
1387
1540
|
setTheme: a
|
|
1388
1541
|
}), [i, a]);
|
|
1389
|
-
return /* @__PURE__ */ m(
|
|
1542
|
+
return /* @__PURE__ */ m(gt.Provider, {
|
|
1390
1543
|
value: l,
|
|
1391
1544
|
children: /* @__PURE__ */ m("div", {
|
|
1392
1545
|
"data-vellira-theme": s,
|
|
@@ -1394,13 +1547,13 @@ var ut = t(null), dt = (e) => e === "highContrast" ? "high-contrast" : e, ft = (
|
|
|
1394
1547
|
})
|
|
1395
1548
|
});
|
|
1396
1549
|
};
|
|
1397
|
-
|
|
1550
|
+
vt.displayName = "ThemeProvider";
|
|
1398
1551
|
//#endregion
|
|
1399
1552
|
//#region src/theme/useTheme.ts
|
|
1400
|
-
function
|
|
1401
|
-
let e = a(
|
|
1553
|
+
function yt() {
|
|
1554
|
+
let e = a(gt);
|
|
1402
1555
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
1403
1556
|
return e;
|
|
1404
1557
|
}
|
|
1405
1558
|
//#endregion
|
|
1406
|
-
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 };
|