@dinofront/design_system 1.19.8 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SelectV2/SelectV2.types.d.ts +12 -1
- package/dist/components/TimePicker/TimePicker.d.ts +15 -0
- package/dist/components/TimePicker/TimePicker.types.d.ts +47 -0
- package/dist/components/TimePicker/TimePicker.utils.d.ts +49 -0
- package/dist/components/TimePicker/TimePickerDesktop.d.ts +13 -0
- package/dist/components/TimePicker/TimePickerMobile.d.ts +9 -0
- package/dist/components/TimePicker/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1179 -921
- package/dist/index.js.map +1 -1
- package/dist/styles.css +103 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { Children as e, Fragment as t, cloneElement as n, createContext as r, createElement as i, forwardRef as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
2
|
-
import { AlertCircle as h, AlertTriangle as g, ArrowDown as _, ArrowUp as v, Calendar as y, Check as b, CheckCircle2 as x, ChevronDown as S, ChevronLeft as C, ChevronRight as w, ChevronsUpDown as T, CircleCheck as E, CircleX as D,
|
|
2
|
+
import { AlertCircle as h, AlertTriangle as g, ArrowDown as _, ArrowUp as v, Calendar as y, Check as b, CheckCircle2 as x, ChevronDown as S, ChevronLeft as C, ChevronRight as w, ChevronsUpDown as T, CircleCheck as E, CircleX as D, Clock as O, Columns3 as k, Construction as A, Copy as j, Download as M, EyeOff as N, File as ee, GripVertical as te, Info as P, Loader2 as F, Menu as I, Minus as L, Monitor as R, Moon as ne, MoreHorizontal as z, MoreVertical as re, Paperclip as ie, Pencil as ae, Pin as oe, PinOff as se, Plus as B, RefreshCw as ce, Search as le, SearchX as ue, Smartphone as de, Sparkles as fe, Sun as pe, Tablet as me, TabletSmartphone as he, Trash2 as ge, UploadCloud as V, User as H, X as U, XCircle as W } from "lucide-react";
|
|
3
3
|
import { clsx as G } from "clsx";
|
|
4
|
-
import { extendTailwindMerge as
|
|
4
|
+
import { extendTailwindMerge as _e } from "tailwind-merge";
|
|
5
5
|
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { Controller as
|
|
8
|
-
import { yupResolver as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useVirtualizer as
|
|
14
|
-
import { flexRender as
|
|
15
|
-
import { DndContext as
|
|
16
|
-
import { SortableContext as
|
|
17
|
-
import { CSS as
|
|
6
|
+
import { createPortal as ve } from "react-dom";
|
|
7
|
+
import { Controller as ye, useFieldArray as be, useForm as xe } from "react-hook-form";
|
|
8
|
+
import { yupResolver as Se } from "@hookform/resolvers/yup";
|
|
9
|
+
import Ce, { components as we } from "react-select";
|
|
10
|
+
import Te from "react-select/async";
|
|
11
|
+
import Ee from "react-select/creatable";
|
|
12
|
+
import De from "react-select/async-creatable";
|
|
13
|
+
import { useVirtualizer as Oe } from "@tanstack/react-virtual";
|
|
14
|
+
import { flexRender as ke, getCoreRowModel as Ae, getFilteredRowModel as je, getPaginationRowModel as Me, getSortedRowModel as Ne, useReactTable as Pe } from "@tanstack/react-table";
|
|
15
|
+
import { DndContext as Fe, KeyboardSensor as Ie, PointerSensor as Le, closestCenter as Re, useSensor as ze, useSensors as Be } from "@dnd-kit/core";
|
|
16
|
+
import { SortableContext as Ve, arrayMove as He, horizontalListSortingStrategy as Y, sortableKeyboardCoordinates as X, useSortable as Ue } from "@dnd-kit/sortable";
|
|
17
|
+
import { CSS as We } from "@dnd-kit/utilities";
|
|
18
|
+
import { WheelPicker as Ge, WheelPickerWrapper as Ke } from "@ncdai/react-wheel-picker";
|
|
18
19
|
//#region src/lib/cn.ts
|
|
19
|
-
var
|
|
20
|
+
var qe = _e({ extend: { theme: { text: [
|
|
20
21
|
"h-xl",
|
|
21
22
|
"h-lg",
|
|
22
23
|
"h-md",
|
|
@@ -36,47 +37,47 @@ var We = ge({ extend: { theme: { text: [
|
|
|
36
37
|
"label-xxs"
|
|
37
38
|
] } } });
|
|
38
39
|
function Z(...e) {
|
|
39
|
-
return
|
|
40
|
+
return qe(G(e));
|
|
40
41
|
}
|
|
41
42
|
//#endregion
|
|
42
43
|
//#region src/lib/testId.ts
|
|
43
|
-
var
|
|
44
|
+
var Q = (e) => (t) => e ? `${e}-${t}` : void 0, Je = {
|
|
44
45
|
horizontal: "h-0 w-full border-t",
|
|
45
46
|
vertical: "w-0 h-full self-stretch border-l"
|
|
46
|
-
},
|
|
47
|
+
}, Ye = {
|
|
47
48
|
solid: "border-solid",
|
|
48
49
|
dashed: "border-dashed"
|
|
49
|
-
},
|
|
50
|
+
}, Xe = {
|
|
50
51
|
default: "border-border-default",
|
|
51
52
|
subtle: "border-border-subtle",
|
|
52
53
|
strong: "border-border-strong",
|
|
53
54
|
brand: "border-border-brand"
|
|
54
|
-
},
|
|
55
|
+
}, Ze = a(function({ orientation: e = "horizontal", variant: t = "solid", color: n = "default", className: r, dataTestId: i, ...a }, o) {
|
|
55
56
|
return /* @__PURE__ */ q("div", {
|
|
56
57
|
ref: o,
|
|
57
58
|
role: "separator",
|
|
58
59
|
"aria-orientation": e,
|
|
59
60
|
"data-test-id": i,
|
|
60
|
-
className: Z("shrink-0",
|
|
61
|
+
className: Z("shrink-0", Je[e], Ye[t], Xe[n], r),
|
|
61
62
|
...a
|
|
62
63
|
});
|
|
63
|
-
}),
|
|
64
|
-
function
|
|
65
|
-
let e = c(
|
|
64
|
+
}), Qe = (e, t) => e !== void 0 && t !== void 0 && String(e) === String(t), $e = (e, t) => e.some((e) => Qe(e, t)), et = r(null);
|
|
65
|
+
function tt() {
|
|
66
|
+
let e = c(et);
|
|
66
67
|
if (!e) throw Error("AccordionItem must be used inside <Accordion>");
|
|
67
68
|
return e;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function nt(e) {
|
|
70
71
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
71
72
|
}
|
|
72
|
-
var
|
|
73
|
-
let [d, f] = m(() =>
|
|
74
|
-
return /* @__PURE__ */ q(
|
|
73
|
+
var rt = a(function({ type: e = "single", defaultValue: t, value: n, onValueChange: r, animated: i = !0, showDivider: a = !1, className: o, children: s, dataTestId: c, ...l }, u) {
|
|
74
|
+
let [d, f] = m(() => nt(t)), p = n !== void 0, h = p ? nt(n) : d;
|
|
75
|
+
return /* @__PURE__ */ q(et.Provider, {
|
|
75
76
|
value: {
|
|
76
77
|
openValues: h,
|
|
77
78
|
toggle: (t) => {
|
|
78
|
-
let n =
|
|
79
|
-
i = e === "single" ? n ? [] : [t] : n ? h.filter((e) => !
|
|
79
|
+
let n = $e(h, t), i;
|
|
80
|
+
i = e === "single" ? n ? [] : [t] : n ? h.filter((e) => !Qe(e, t)) : [...h, t], p || f(i), r?.(e === "single" ? i[0] : i);
|
|
80
81
|
},
|
|
81
82
|
animated: i,
|
|
82
83
|
showDivider: a
|
|
@@ -89,8 +90,8 @@ var tt = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
89
90
|
children: s
|
|
90
91
|
})
|
|
91
92
|
});
|
|
92
|
-
}),
|
|
93
|
-
let { openValues: l, toggle: d, animated: f, showDivider: p } =
|
|
93
|
+
}), it = a(function({ value: e, title: t, icon: n, disabled: r, className: i, children: a, dataTestId: o, ...s }, c) {
|
|
94
|
+
let { openValues: l, toggle: d, animated: f, showDivider: p } = tt(), m = $e(l, e), h = u(), g = u(), _ = /* @__PURE__ */ J(K, { children: [p && /* @__PURE__ */ q(Ze, { className: "mb-4" }), a] });
|
|
94
95
|
return /* @__PURE__ */ J("div", {
|
|
95
96
|
ref: c,
|
|
96
97
|
"data-test-id": o,
|
|
@@ -99,7 +100,7 @@ var tt = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
99
100
|
...s,
|
|
100
101
|
children: [/* @__PURE__ */ q("h3", { children: /* @__PURE__ */ J("button", {
|
|
101
102
|
id: g,
|
|
102
|
-
"data-test-id":
|
|
103
|
+
"data-test-id": Q(o)("trigger"),
|
|
103
104
|
type: "button",
|
|
104
105
|
onClick: () => d(e),
|
|
105
106
|
disabled: r,
|
|
@@ -141,7 +142,7 @@ var tt = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
141
142
|
});
|
|
142
143
|
//#endregion
|
|
143
144
|
//#region src/lib/RequiredMark.tsx
|
|
144
|
-
function
|
|
145
|
+
function at() {
|
|
145
146
|
return /* @__PURE__ */ q("span", {
|
|
146
147
|
className: "text-fg-danger",
|
|
147
148
|
"aria-hidden": !0,
|
|
@@ -150,15 +151,15 @@ function rt() {
|
|
|
150
151
|
}
|
|
151
152
|
//#endregion
|
|
152
153
|
//#region src/components/Button/Button.tsx
|
|
153
|
-
var
|
|
154
|
+
var ot = {
|
|
154
155
|
lg: "h-12 px-5 text-p-md gap-2 rounded-lg",
|
|
155
156
|
md: "h-10 px-4 text-p-std gap-2 rounded-lg",
|
|
156
157
|
sm: "h-8 px-3 text-p-sm gap-1.5 rounded-md"
|
|
157
|
-
},
|
|
158
|
+
}, st = {
|
|
158
159
|
lg: "h-12 w-12 rounded-lg",
|
|
159
160
|
md: "h-10 w-10 rounded-lg",
|
|
160
161
|
sm: "h-8 w-8 rounded-md"
|
|
161
|
-
},
|
|
162
|
+
}, ct = {
|
|
162
163
|
primary: [
|
|
163
164
|
"bg-brand-500 text-white border border-transparent",
|
|
164
165
|
"hover:bg-brand-600 active:bg-brand-700",
|
|
@@ -183,12 +184,12 @@ var it = {
|
|
|
183
184
|
"disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed",
|
|
184
185
|
"focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:ring-offset-2"
|
|
185
186
|
].join(" ")
|
|
186
|
-
},
|
|
187
|
+
}, lt = {
|
|
187
188
|
primary: "bg-brand-700",
|
|
188
189
|
secondary: "bg-bg-subtle",
|
|
189
190
|
tertiary: "bg-bg-subtle",
|
|
190
191
|
danger: "bg-red-900"
|
|
191
|
-
},
|
|
192
|
+
}, ut = a(function({ variant: e = "primary", size: t = "md", leftIcon: n, rightIcon: r, loading: i = !1, iconOnly: a = !1, fullWidth: o = !1, pressed: s = !1, disabled: c, className: l, children: u, onClick: d, dataTestId: f, ...p }, m) {
|
|
192
193
|
return /* @__PURE__ */ q("button", {
|
|
193
194
|
type: "button",
|
|
194
195
|
ref: m,
|
|
@@ -202,9 +203,9 @@ var it = {
|
|
|
202
203
|
}
|
|
203
204
|
d?.(e);
|
|
204
205
|
},
|
|
205
|
-
className: Z("inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors outline-none cursor-pointer", a ?
|
|
206
|
+
className: Z("inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors outline-none cursor-pointer", a ? st[t] : ot[t], ct[e], s && lt[e], o && "w-full", l),
|
|
206
207
|
...p,
|
|
207
|
-
children: i ? /* @__PURE__ */ q(
|
|
208
|
+
children: i ? /* @__PURE__ */ q(F, {
|
|
208
209
|
className: "h-4 w-4 animate-spin",
|
|
209
210
|
"aria-hidden": !0
|
|
210
211
|
}) : /* @__PURE__ */ J(K, { children: [
|
|
@@ -222,28 +223,28 @@ var it = {
|
|
|
222
223
|
});
|
|
223
224
|
//#endregion
|
|
224
225
|
//#region src/components/Upload/Upload.tsx
|
|
225
|
-
function
|
|
226
|
+
function dt(e, t) {
|
|
226
227
|
let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
227
228
|
if (!n.length) return !0;
|
|
228
229
|
let r = e.name.toLowerCase(), i = e.type.toLowerCase();
|
|
229
230
|
return n.some((e) => e.endsWith("/*") ? i.startsWith(e.slice(0, -1)) : e.startsWith(".") ? r.endsWith(e) : i === e);
|
|
230
231
|
}
|
|
231
|
-
var
|
|
232
|
+
var ft = [
|
|
232
233
|
"KB",
|
|
233
234
|
"MB",
|
|
234
235
|
"GB"
|
|
235
236
|
];
|
|
236
|
-
function
|
|
237
|
+
function pt(e) {
|
|
237
238
|
if (e < 1024) return `${e} B`;
|
|
238
239
|
let t = e / 1024, n = 0;
|
|
239
|
-
for (; t >= 1024 && n <
|
|
240
|
-
return `${t.toFixed(1)} ${
|
|
240
|
+
for (; t >= 1024 && n < ft.length - 1;) t /= 1024, n += 1;
|
|
241
|
+
return `${t.toFixed(1)} ${ft[n]}`;
|
|
241
242
|
}
|
|
242
|
-
function
|
|
243
|
-
return t && !
|
|
243
|
+
function mt(e, { accept: t, maxSizeMB: n }) {
|
|
244
|
+
return t && !dt(e, t) ? "type" : n !== void 0 && e.size > n * 1024 * 1024 ? "size" : null;
|
|
244
245
|
}
|
|
245
|
-
var
|
|
246
|
-
let O = p(null), [k, A] = m(!1), j = p(0), M = x || !!S,
|
|
246
|
+
var ht = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFiles: i, disabled: a, validateFiles: o = !1, maxFiles: s, dedupe: c = o, currentFiles: l = [], onReject: d, showFileList: f = !1, onRemoveFile: h, mode: g = "dropzone", triggerLabel: _, triggerIcon: v, label: y, required: b, error: x = !1, errorText: S, labelAddons: C, className: w, dataTestId: T, ...E }, D) {
|
|
247
|
+
let O = p(null), [k, A] = m(!1), j = p(0), M = x || !!S, N = u(), ee = S ? `${N}-error` : void 0, te = (t) => {
|
|
247
248
|
if (!t.length) return;
|
|
248
249
|
if (!o) {
|
|
249
250
|
i?.(t);
|
|
@@ -258,7 +259,7 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
258
259
|
});
|
|
259
260
|
continue;
|
|
260
261
|
}
|
|
261
|
-
let t =
|
|
262
|
+
let t = mt(i, {
|
|
262
263
|
accept: e,
|
|
263
264
|
maxSizeMB: n
|
|
264
265
|
});
|
|
@@ -280,7 +281,7 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
280
281
|
}
|
|
281
282
|
r.length && i?.(r), a.length && d?.(a);
|
|
282
283
|
}, P = (e) => {
|
|
283
|
-
e.preventDefault(), j.current = 0, A(!1), !a &&
|
|
284
|
+
e.preventDefault(), j.current = 0, A(!1), !a && te(Array.from(e.dataTransfer.files ?? []));
|
|
284
285
|
}, F = r ?? `${e ? e.toUpperCase().replace(/\./g, "") : "Any file"}${n ? `, up to ${n} MB` : ""}`, I = /* @__PURE__ */ q("input", {
|
|
285
286
|
ref: O,
|
|
286
287
|
type: "file",
|
|
@@ -288,27 +289,27 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
288
289
|
multiple: t,
|
|
289
290
|
disabled: a,
|
|
290
291
|
onChange: (e) => {
|
|
291
|
-
|
|
292
|
+
te(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
292
293
|
},
|
|
293
294
|
className: "sr-only"
|
|
294
295
|
}), L = (y || C) && /* @__PURE__ */ J("div", {
|
|
295
296
|
className: "flex items-center gap-1.5",
|
|
296
297
|
children: [y && /* @__PURE__ */ J("span", {
|
|
297
298
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
298
|
-
children: [y, b && /* @__PURE__ */ q(
|
|
299
|
+
children: [y, b && /* @__PURE__ */ q(at, {})]
|
|
299
300
|
}), C && /* @__PURE__ */ q("span", {
|
|
300
301
|
className: "inline-flex items-center gap-1",
|
|
301
302
|
children: C
|
|
302
303
|
})]
|
|
303
304
|
}), R = S ? /* @__PURE__ */ q("p", {
|
|
304
|
-
id: `${
|
|
305
|
+
id: `${N}-error`,
|
|
305
306
|
className: "text-p-sm text-red-700",
|
|
306
307
|
children: S
|
|
307
|
-
}) : null,
|
|
308
|
+
}) : null, ne = f && l.length > 0 && /* @__PURE__ */ q("div", {
|
|
308
309
|
className: "flex flex-col gap-2",
|
|
309
|
-
children: l.map((e, t) => /* @__PURE__ */ q(
|
|
310
|
+
children: l.map((e, t) => /* @__PURE__ */ q(_t, {
|
|
310
311
|
name: e.name,
|
|
311
|
-
meta:
|
|
312
|
+
meta: pt(e.size),
|
|
312
313
|
status: "completed",
|
|
313
314
|
onRemove: g !== "view" && h ? () => h(e, t) : void 0
|
|
314
315
|
}, `${t}-${e.name}-${e.size}`))
|
|
@@ -320,7 +321,7 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
320
321
|
...E,
|
|
321
322
|
children: [
|
|
322
323
|
L,
|
|
323
|
-
|
|
324
|
+
ne,
|
|
324
325
|
R
|
|
325
326
|
]
|
|
326
327
|
});
|
|
@@ -333,23 +334,23 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
333
334
|
...E,
|
|
334
335
|
children: [
|
|
335
336
|
L,
|
|
336
|
-
/* @__PURE__ */ q(
|
|
337
|
+
/* @__PURE__ */ q(ut, {
|
|
337
338
|
type: "button",
|
|
338
339
|
variant: "secondary",
|
|
339
340
|
iconOnly: e,
|
|
340
341
|
disabled: a,
|
|
341
342
|
onClick: () => O.current?.click(),
|
|
342
|
-
leftIcon: e ? void 0 : v ?? /* @__PURE__ */ q(
|
|
343
|
+
leftIcon: e ? void 0 : v ?? /* @__PURE__ */ q(ie, { className: "h-4 w-4" }),
|
|
343
344
|
"aria-label": e ? "Upload file" : void 0,
|
|
344
|
-
children: e ? v ?? /* @__PURE__ */ q(
|
|
345
|
+
children: e ? v ?? /* @__PURE__ */ q(ae, { className: "h-4 w-4" }) : _ ?? "Choose a file"
|
|
345
346
|
}),
|
|
346
347
|
I,
|
|
347
|
-
|
|
348
|
+
ne,
|
|
348
349
|
R
|
|
349
350
|
]
|
|
350
351
|
});
|
|
351
352
|
}
|
|
352
|
-
let
|
|
353
|
+
let z = /* @__PURE__ */ J("div", {
|
|
353
354
|
ref: D,
|
|
354
355
|
onDragEnter: () => {
|
|
355
356
|
j.current += 1, a || A(!0);
|
|
@@ -367,14 +368,14 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
367
368
|
},
|
|
368
369
|
"aria-disabled": a || void 0,
|
|
369
370
|
"aria-invalid": M || void 0,
|
|
370
|
-
"aria-describedby":
|
|
371
|
+
"aria-describedby": ee,
|
|
371
372
|
"data-test-id": T,
|
|
372
373
|
className: Z("flex flex-col items-center justify-center text-center gap-2 px-6 py-8 rounded-lg border-2 border-dashed cursor-pointer transition-colors outline-none", M ? "border-red-300 bg-bg-danger-lighter" : k ? "border-brand-500 bg-brand-20" : "border-border-default bg-bg-container hover:bg-bg-subtle", "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", a && "opacity-50 cursor-not-allowed", w),
|
|
373
374
|
...E,
|
|
374
375
|
children: [
|
|
375
376
|
/* @__PURE__ */ q("div", {
|
|
376
377
|
className: "h-10 w-10 rounded-full bg-bg-default flex items-center justify-center text-fg-secondary shadow-z1",
|
|
377
|
-
children: /* @__PURE__ */ q(
|
|
378
|
+
children: /* @__PURE__ */ q(V, { className: "h-5 w-5" })
|
|
378
379
|
}),
|
|
379
380
|
/* @__PURE__ */ J("div", {
|
|
380
381
|
className: "flex flex-col gap-0.5",
|
|
@@ -392,25 +393,25 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
392
393
|
I
|
|
393
394
|
]
|
|
394
395
|
});
|
|
395
|
-
return !L && !R && !
|
|
396
|
+
return !L && !R && !ne ? z : /* @__PURE__ */ J("div", {
|
|
396
397
|
className: "flex flex-col gap-1.5",
|
|
397
398
|
children: [
|
|
398
399
|
L,
|
|
399
|
-
ne,
|
|
400
400
|
z,
|
|
401
|
+
ne,
|
|
401
402
|
R
|
|
402
403
|
]
|
|
403
404
|
});
|
|
404
|
-
}),
|
|
405
|
+
}), gt = {
|
|
405
406
|
processing: "border-border-default bg-bg-default",
|
|
406
407
|
completed: "border-border-default bg-bg-default",
|
|
407
408
|
error: "border-red-300 bg-bg-danger-lighter"
|
|
408
|
-
},
|
|
409
|
+
}, _t = a(function({ name: e, meta: t, status: n = "processing", progress: r = 0, errorText: i, onRetry: a, onRemove: o, onOpen: s, previewSrc: c, className: l, dataTestId: u, ...d }, f) {
|
|
409
410
|
let [p, g] = m(!1), _ = !!c && !p;
|
|
410
411
|
return /* @__PURE__ */ J("div", {
|
|
411
412
|
ref: f,
|
|
412
413
|
"data-test-id": u,
|
|
413
|
-
className: Z("flex items-start gap-3 px-3 py-2.5 rounded-lg border",
|
|
414
|
+
className: Z("flex items-start gap-3 px-3 py-2.5 rounded-lg border", gt[n], l),
|
|
414
415
|
...d,
|
|
415
416
|
children: [
|
|
416
417
|
/* @__PURE__ */ q("div", {
|
|
@@ -473,11 +474,11 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
473
474
|
onClick: o,
|
|
474
475
|
"aria-label": "Remove",
|
|
475
476
|
className: "shrink-0 p-1 rounded-md text-fg-tertiary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
476
|
-
children: q(n === "completed" ?
|
|
477
|
+
children: q(n === "completed" ? ge : U, { className: "h-4 w-4" })
|
|
477
478
|
})
|
|
478
479
|
]
|
|
479
480
|
});
|
|
480
|
-
}),
|
|
481
|
+
}), vt = {
|
|
481
482
|
"2xs": "h-5 w-5 text-p-xs",
|
|
482
483
|
xs: "h-6 w-6 text-p-xs",
|
|
483
484
|
sm: "h-8 w-8 text-p-sm",
|
|
@@ -485,7 +486,7 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
485
486
|
lg: "h-12 w-12 text-p-md",
|
|
486
487
|
xl: "h-16 w-16 text-h-xs",
|
|
487
488
|
"2xl": "h-20 w-20 text-h-xs"
|
|
488
|
-
},
|
|
489
|
+
}, yt = {
|
|
489
490
|
"2xs": "h-1 w-1",
|
|
490
491
|
xs: "h-1.5 w-1.5",
|
|
491
492
|
sm: "h-2 w-2",
|
|
@@ -493,12 +494,12 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
493
494
|
lg: "h-3 w-3",
|
|
494
495
|
xl: "h-3.5 w-3.5",
|
|
495
496
|
"2xl": "h-4 w-4"
|
|
496
|
-
},
|
|
497
|
+
}, bt = {
|
|
497
498
|
online: "bg-green-500",
|
|
498
499
|
offline: "bg-gray-400 dark:bg-gray-500",
|
|
499
500
|
away: "bg-yellow-600",
|
|
500
501
|
busy: "bg-red-600"
|
|
501
|
-
},
|
|
502
|
+
}, xt = {
|
|
502
503
|
"2xs": "-ml-1",
|
|
503
504
|
xs: "-ml-1.5",
|
|
504
505
|
sm: "-ml-2",
|
|
@@ -506,7 +507,7 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
506
507
|
lg: "-ml-3",
|
|
507
508
|
xl: "-ml-4",
|
|
508
509
|
"2xl": "-ml-5"
|
|
509
|
-
},
|
|
510
|
+
}, St = {
|
|
510
511
|
"2xs": "h-2 w-2",
|
|
511
512
|
xs: "h-3 w-3",
|
|
512
513
|
sm: "h-4 w-4",
|
|
@@ -515,11 +516,11 @@ var pt = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
515
516
|
xl: "h-7 w-7",
|
|
516
517
|
"2xl": "h-8 w-8"
|
|
517
518
|
};
|
|
518
|
-
function
|
|
519
|
+
function Ct(e) {
|
|
519
520
|
let t = e.trim().split(/\s+/);
|
|
520
521
|
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function wt(e) {
|
|
523
524
|
let t = [
|
|
524
525
|
"bg-brand-500",
|
|
525
526
|
"bg-blue-600",
|
|
@@ -531,7 +532,7 @@ function St(e) {
|
|
|
531
532
|
for (let t = 0; t < e.length; t++) n = (n << 5) - n + e.charCodeAt(t), n |= 0;
|
|
532
533
|
return t[Math.abs(n) % t.length];
|
|
533
534
|
}
|
|
534
|
-
var
|
|
535
|
+
var Tt = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape: a = "circle", fallback: o, editable: s, onImageChange: c, accept: u, maxSizeMB: d, onReject: f, className: h, dataTestId: g, ..._ }, v) {
|
|
535
536
|
let [y, b] = m(!1), [x, S] = m(null), C = p(null), w = p(e), T = p(null);
|
|
536
537
|
l(() => {
|
|
537
538
|
if (T.current = x, x) return () => URL.revokeObjectURL(x);
|
|
@@ -543,7 +544,7 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
543
544
|
let E = (e) => {
|
|
544
545
|
let t = e?.[0];
|
|
545
546
|
if (!t) return;
|
|
546
|
-
let n =
|
|
547
|
+
let n = mt(t, {
|
|
547
548
|
accept: u,
|
|
548
549
|
maxSizeMB: d
|
|
549
550
|
});
|
|
@@ -556,7 +557,7 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
556
557
|
}
|
|
557
558
|
let r = URL.createObjectURL(t);
|
|
558
559
|
T.current = r, S(r), b(!1), c?.(t);
|
|
559
|
-
}, D = x ?? e, O = !!D && !y, k = n ?
|
|
560
|
+
}, D = x ?? e, O = !!D && !y, k = n ? Ct(n) : "", A = n ? wt(n) : "bg-gray-300 dark:bg-gray-600";
|
|
560
561
|
return /* @__PURE__ */ J("span", {
|
|
561
562
|
ref: v,
|
|
562
563
|
"data-test-id": g,
|
|
@@ -564,17 +565,17 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
564
565
|
..._,
|
|
565
566
|
children: [
|
|
566
567
|
/* @__PURE__ */ q("span", {
|
|
567
|
-
className: Z("inline-flex items-center justify-center overflow-hidden font-semibold text-white select-none",
|
|
568
|
+
className: Z("inline-flex items-center justify-center overflow-hidden font-semibold text-white select-none", vt[r], a === "circle" ? "rounded-full" : "rounded-md", !O && A),
|
|
568
569
|
children: O ? /* @__PURE__ */ q("img", {
|
|
569
570
|
src: D,
|
|
570
571
|
alt: t ?? n ?? "",
|
|
571
572
|
onError: () => b(!0),
|
|
572
573
|
className: "h-full w-full object-cover"
|
|
573
|
-
}) : n ? k : o ?? /* @__PURE__ */ q(
|
|
574
|
+
}) : n ? k : o ?? /* @__PURE__ */ q(H, { className: "h-1/2 w-1/2 text-white/90" })
|
|
574
575
|
}),
|
|
575
576
|
i && /* @__PURE__ */ q("span", {
|
|
576
577
|
"aria-label": i,
|
|
577
|
-
className: Z("absolute bottom-0 rounded-full ring-2 ring-white", s ? "left-0" : "right-0",
|
|
578
|
+
className: Z("absolute bottom-0 rounded-full ring-2 ring-white", s ? "left-0" : "right-0", yt[r], bt[i])
|
|
578
579
|
}),
|
|
579
580
|
s && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("button", {
|
|
580
581
|
type: "button",
|
|
@@ -582,8 +583,8 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
582
583
|
e.stopPropagation(), C.current?.click();
|
|
583
584
|
},
|
|
584
585
|
"aria-label": "Change avatar image",
|
|
585
|
-
className: Z("absolute right-0 bottom-0 inline-flex items-center justify-center rounded-full ring-2 ring-white bg-brand-500 text-white hover:bg-brand-600 transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1",
|
|
586
|
-
children: /* @__PURE__ */ q(
|
|
586
|
+
className: Z("absolute right-0 bottom-0 inline-flex items-center justify-center rounded-full ring-2 ring-white bg-brand-500 text-white hover:bg-brand-600 transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", St[r]),
|
|
587
|
+
children: /* @__PURE__ */ q(ae, { className: "h-1/2 w-1/2" })
|
|
587
588
|
}), /* @__PURE__ */ q("input", {
|
|
588
589
|
ref: C,
|
|
589
590
|
type: "file",
|
|
@@ -596,7 +597,7 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
596
597
|
})] })
|
|
597
598
|
]
|
|
598
599
|
});
|
|
599
|
-
}),
|
|
600
|
+
}), Et = a(function({ size: e = "md", max: t, children: n, className: r, dataTestId: i, ...a }, o) {
|
|
600
601
|
let s = Array.isArray(n) ? n : [n], c = t === void 0 ? s : s.slice(0, t), l = t === void 0 ? 0 : s.length - t;
|
|
601
602
|
return /* @__PURE__ */ J("div", {
|
|
602
603
|
ref: o,
|
|
@@ -604,38 +605,38 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
604
605
|
className: Z("inline-flex items-center", r),
|
|
605
606
|
...a,
|
|
606
607
|
children: [c.map((t, n) => /* @__PURE__ */ q("div", {
|
|
607
|
-
className: Z("rounded-full ring-2 ring-white", n > 0 &&
|
|
608
|
+
className: Z("rounded-full ring-2 ring-white", n > 0 && xt[e]),
|
|
608
609
|
style: { zIndex: c.length - n },
|
|
609
610
|
children: t
|
|
610
611
|
}, n)), l > 0 && /* @__PURE__ */ q("div", {
|
|
611
|
-
className: Z("rounded-full ring-2 ring-white",
|
|
612
|
-
children: /* @__PURE__ */ q(
|
|
612
|
+
className: Z("rounded-full ring-2 ring-white", xt[e]),
|
|
613
|
+
children: /* @__PURE__ */ q(Tt, {
|
|
613
614
|
size: e,
|
|
614
615
|
name: `+${l}`
|
|
615
616
|
})
|
|
616
617
|
})]
|
|
617
618
|
});
|
|
618
|
-
}),
|
|
619
|
+
}), Dt = {
|
|
619
620
|
lg: "h-7 px-2.5 text-p-std gap-1.5",
|
|
620
621
|
md: "h-6 px-2 text-p-sm gap-1",
|
|
621
622
|
sm: "h-5 px-1.5 text-p-sm gap-1",
|
|
622
623
|
xs: "h-4 px-1 text-p-xs gap-0.5"
|
|
623
|
-
},
|
|
624
|
+
}, Ot = {
|
|
624
625
|
lg: "rounded-md",
|
|
625
626
|
md: "rounded-md",
|
|
626
627
|
sm: "rounded",
|
|
627
628
|
xs: "rounded"
|
|
628
|
-
},
|
|
629
|
+
}, kt = {
|
|
629
630
|
lg: "size-2.5",
|
|
630
631
|
md: "size-2",
|
|
631
632
|
sm: "size-1.5",
|
|
632
633
|
xs: "size-1"
|
|
633
|
-
},
|
|
634
|
+
}, At = {
|
|
634
635
|
lg: "min-w-7 px-0 justify-center",
|
|
635
636
|
md: "min-w-6 px-0 justify-center",
|
|
636
637
|
sm: "min-w-5 px-0 justify-center",
|
|
637
638
|
xs: "min-w-4 px-0 justify-center"
|
|
638
|
-
},
|
|
639
|
+
}, jt = {
|
|
639
640
|
neutral: "bg-bg-subtle text-fg-default border border-border-default",
|
|
640
641
|
brand: "bg-brand-20 text-brand-800 border border-brand-100",
|
|
641
642
|
success: "bg-green-50 text-green-800 border border-green-100",
|
|
@@ -643,7 +644,7 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
643
644
|
danger: "bg-red-50 text-red-800 border border-red-100",
|
|
644
645
|
info: "bg-blue-50 text-blue-800 border border-blue-100",
|
|
645
646
|
privacy: "bg-purple-50 text-purple-800 border border-purple-100"
|
|
646
|
-
},
|
|
647
|
+
}, Mt = {
|
|
647
648
|
neutral: "bg-transparent text-fg-default border border-border-strong",
|
|
648
649
|
brand: "bg-transparent text-brand-700 border border-brand-500",
|
|
649
650
|
success: "bg-transparent text-green-700 border border-green-500",
|
|
@@ -651,7 +652,7 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
651
652
|
danger: "bg-transparent text-red-700 border border-red-500",
|
|
652
653
|
info: "bg-transparent text-blue-700 border border-blue-500",
|
|
653
654
|
privacy: "bg-transparent text-purple-700 border border-purple-500"
|
|
654
|
-
},
|
|
655
|
+
}, Nt = {
|
|
655
656
|
neutral: "bg-fg-default text-bg-default",
|
|
656
657
|
brand: "bg-brand-500 text-white",
|
|
657
658
|
success: "bg-green-600 text-white",
|
|
@@ -659,21 +660,21 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
659
660
|
danger: "bg-red-700 text-white",
|
|
660
661
|
info: "bg-blue-600 text-white",
|
|
661
662
|
privacy: "bg-purple-500 text-white"
|
|
662
|
-
},
|
|
663
|
+
}, Pt = {
|
|
663
664
|
filled: "hover:brightness-95 active:brightness-90",
|
|
664
665
|
outline: "hover:bg-bg-subtle active:bg-bg-container",
|
|
665
666
|
accent: "hover:brightness-90 active:brightness-80"
|
|
666
|
-
},
|
|
667
|
-
let v = t === "filled" ?
|
|
667
|
+
}, Ft = a(function({ variant: e = "neutral", appearance: t = "filled", size: n = "md", shape: r = "rounded", leftIcon: i, rightIcon: a, onDismiss: o, dot: s = !1, withDot: c = !1, disabled: l = !1, interactive: u = !1, className: d, children: f, dataTestId: p, onClick: m, onKeyDown: h, ...g }, _) {
|
|
668
|
+
let v = t === "filled" ? jt[e] : t === "outline" ? Mt[e] : Nt[e];
|
|
668
669
|
if (s) return /* @__PURE__ */ q("span", {
|
|
669
670
|
ref: _,
|
|
670
671
|
"data-test-id": p,
|
|
671
672
|
"aria-hidden": !g["aria-label"] || void 0,
|
|
672
673
|
onClick: l ? void 0 : m,
|
|
673
|
-
className: Z("inline-block shrink-0 rounded-full",
|
|
674
|
+
className: Z("inline-block shrink-0 rounded-full", kt[n], Nt[e], l && "opacity-50", d),
|
|
674
675
|
...g
|
|
675
676
|
});
|
|
676
|
-
let y = f == null && !c && !!(i || a), b = r === "pill" ? "rounded-full" :
|
|
677
|
+
let y = f == null && !c && !!(i || a), b = r === "pill" ? "rounded-full" : Ot[n];
|
|
677
678
|
return /* @__PURE__ */ J("span", {
|
|
678
679
|
ref: _,
|
|
679
680
|
"data-test-id": p,
|
|
@@ -684,11 +685,11 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
684
685
|
onKeyDown: u ? (e) => {
|
|
685
686
|
h?.(e), !(l || !m) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m(e));
|
|
686
687
|
} : h,
|
|
687
|
-
className: Z("inline-flex items-center font-medium whitespace-nowrap select-none",
|
|
688
|
+
className: Z("inline-flex items-center font-medium whitespace-nowrap select-none", Dt[n], b, v, y && At[n], u && !l && Z("cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", Pt[t]), l && "opacity-50 cursor-not-allowed pointer-events-none", d),
|
|
688
689
|
...g,
|
|
689
690
|
children: [
|
|
690
691
|
c ? /* @__PURE__ */ q("span", {
|
|
691
|
-
className: Z("inline-block shrink-0 rounded-full",
|
|
692
|
+
className: Z("inline-block shrink-0 rounded-full", kt[n], Nt[e]),
|
|
692
693
|
"aria-hidden": !0
|
|
693
694
|
}) : i && /* @__PURE__ */ q("span", {
|
|
694
695
|
className: "inline-flex shrink-0",
|
|
@@ -709,16 +710,16 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
709
710
|
})
|
|
710
711
|
]
|
|
711
712
|
});
|
|
712
|
-
}),
|
|
713
|
+
}), It = {
|
|
713
714
|
md: "text-p-sm",
|
|
714
715
|
sm: "text-p-xs"
|
|
715
|
-
},
|
|
716
|
+
}, Lt = "rounded-sm text-fg-tertiary transition-colors hover:text-fg-secondary outline-none focus-visible:ring-2 focus-visible:ring-brand-300", Rt = a(function({ items: e, currentValue: n, onSelect: r, separator: i = "/", size: a = "md", className: o, dataTestId: s, ...c }, l) {
|
|
716
717
|
let u = n ?? e[e.length - 1]?.value;
|
|
717
718
|
return /* @__PURE__ */ q("nav", {
|
|
718
719
|
ref: l,
|
|
719
720
|
"aria-label": "Breadcrumb",
|
|
720
721
|
"data-test-id": s,
|
|
721
|
-
className: Z(
|
|
722
|
+
className: Z(It[a], o),
|
|
722
723
|
...c,
|
|
723
724
|
children: /* @__PURE__ */ q("ol", {
|
|
724
725
|
className: "flex items-center",
|
|
@@ -740,74 +741,74 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
740
741
|
}) : e.href ? /* @__PURE__ */ q("a", {
|
|
741
742
|
href: e.href,
|
|
742
743
|
onClick: () => r?.(e.value),
|
|
743
|
-
className:
|
|
744
|
+
className: Lt,
|
|
744
745
|
children: e.label
|
|
745
746
|
}) : /* @__PURE__ */ q("button", {
|
|
746
747
|
type: "button",
|
|
747
748
|
onClick: () => r?.(e.value),
|
|
748
|
-
className:
|
|
749
|
+
className: Lt,
|
|
749
750
|
children: e.label
|
|
750
751
|
})
|
|
751
752
|
})] }, e.value);
|
|
752
753
|
})
|
|
753
754
|
})
|
|
754
755
|
});
|
|
755
|
-
}),
|
|
756
|
+
}), zt = {
|
|
756
757
|
horizontal: "flex-row [&>*]:rounded-none [&>*:first-child]:rounded-l-lg [&>*:last-child]:rounded-r-lg [&>*:not(:first-child)]:-ml-px",
|
|
757
758
|
vertical: "flex-col [&>*]:rounded-none [&>*:first-child]:rounded-t-lg [&>*:last-child]:rounded-b-lg [&>*:not(:first-child)]:-mt-px"
|
|
758
|
-
},
|
|
759
|
+
}, Bt = a(function({ orientation: e = "horizontal", className: t, children: n, dataTestId: r, ...i }, a) {
|
|
759
760
|
return /* @__PURE__ */ q("div", {
|
|
760
761
|
ref: a,
|
|
761
762
|
role: "group",
|
|
762
763
|
"data-test-id": r,
|
|
763
|
-
className: Z("inline-flex isolate",
|
|
764
|
+
className: Z("inline-flex isolate", zt[e], "[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10", t),
|
|
764
765
|
...i,
|
|
765
766
|
children: n
|
|
766
767
|
});
|
|
767
|
-
}),
|
|
768
|
+
}), Vt = {
|
|
768
769
|
elevated: "bg-bg-default border border-border-default shadow-z1",
|
|
769
770
|
outlined: "bg-bg-default border border-border-default",
|
|
770
771
|
filled: "bg-bg-container border border-transparent"
|
|
771
|
-
},
|
|
772
|
+
}, Ht = {
|
|
772
773
|
none: "p-0",
|
|
773
774
|
sm: "p-4",
|
|
774
775
|
md: "p-5",
|
|
775
776
|
lg: "p-6"
|
|
776
|
-
},
|
|
777
|
+
}, Ut = a(function({ variant: e = "outlined", padding: t = "md", header: n, footer: r, interactive: i = !1, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
777
778
|
let u = n || r;
|
|
778
779
|
return /* @__PURE__ */ J("div", {
|
|
779
780
|
ref: l,
|
|
780
781
|
"data-test-id": s,
|
|
781
|
-
className: Z("rounded-xl overflow-hidden",
|
|
782
|
+
className: Z("rounded-xl overflow-hidden", Vt[e], i && "transition-all hover:border-brand-500 hover:shadow-z2", !u && Ht[t], a),
|
|
782
783
|
...c,
|
|
783
784
|
children: [
|
|
784
785
|
n && /* @__PURE__ */ q("div", {
|
|
785
|
-
className: Z("border-b border-border-subtle",
|
|
786
|
+
className: Z("border-b border-border-subtle", Ht[t]),
|
|
786
787
|
children: n
|
|
787
788
|
}),
|
|
788
789
|
u ? /* @__PURE__ */ q("div", {
|
|
789
|
-
className:
|
|
790
|
+
className: Ht[t],
|
|
790
791
|
children: o
|
|
791
792
|
}) : o,
|
|
792
793
|
r && /* @__PURE__ */ q("div", {
|
|
793
|
-
className: Z("border-t border-border-subtle",
|
|
794
|
+
className: Z("border-t border-border-subtle", Ht[t]),
|
|
794
795
|
children: r
|
|
795
796
|
})
|
|
796
797
|
]
|
|
797
798
|
});
|
|
798
|
-
}),
|
|
799
|
+
}), Wt = {
|
|
799
800
|
brand: "bg-bg-brand-lighter text-brand-800",
|
|
800
801
|
blue: "bg-bg-info-lighter text-blue-800",
|
|
801
802
|
purple: "bg-purple-50 text-purple-800 dark:bg-purple-900/30 dark:text-purple-200",
|
|
802
803
|
pink: "bg-pink-50 text-pink-800 dark:bg-pink-900/30 dark:text-pink-200",
|
|
803
804
|
yellow: "bg-bg-warning-lighter text-yellow-900",
|
|
804
805
|
gray: "bg-bg-subtle text-fg-secondary"
|
|
805
|
-
},
|
|
806
|
+
}, Gt = a(function({ title: e, header: t, children: n, noDivider: r = !1, className: i, dataTestId: a, ...o }, s) {
|
|
806
807
|
let c = e?.placement ?? "left", l = !!e && c !== "top", u = e && /* @__PURE__ */ q("div", {
|
|
807
|
-
className: Z("flex shrink-0 items-center justify-center text-center text-label-md font-bold", l ? Z("px-2 [writing-mode:vertical-rl]", c === "left" && "rotate-180") : "px-4 py-2",
|
|
808
|
+
className: Z("flex shrink-0 items-center justify-center text-center text-label-md font-bold", l ? Z("px-2 [writing-mode:vertical-rl]", c === "left" && "rotate-180") : "px-4 py-2", Wt[e.color ?? "gray"]),
|
|
808
809
|
children: e.text
|
|
809
810
|
});
|
|
810
|
-
return /* @__PURE__ */ q(
|
|
811
|
+
return /* @__PURE__ */ q(Ut, {
|
|
811
812
|
ref: s,
|
|
812
813
|
dataTestId: a,
|
|
813
814
|
variant: "outlined",
|
|
@@ -822,14 +823,14 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
822
823
|
})]
|
|
823
824
|
})
|
|
824
825
|
});
|
|
825
|
-
}),
|
|
826
|
+
}), Kt = {
|
|
826
827
|
md: "h-5 w-5 rounded-sm",
|
|
827
828
|
sm: "h-4 w-4 rounded-sm"
|
|
828
|
-
},
|
|
829
|
+
}, qt = {
|
|
829
830
|
md: "h-3.5 w-3.5",
|
|
830
831
|
sm: "h-3 w-3"
|
|
831
|
-
},
|
|
832
|
-
let g = u(), _ = s ?? g, v = o || !!r, y = r ? `${_}-error` : void 0, x =
|
|
832
|
+
}, Jt = a(function({ size: e = "md", label: t, description: n, errorText: r, required: i, indeterminate: a = !1, error: o = !1, id: s, disabled: c, checked: l, defaultChecked: d, className: f, dataTestId: p, ...m }, h) {
|
|
833
|
+
let g = u(), _ = s ?? g, v = o || !!r, y = r ? `${_}-error` : void 0, x = Q(p);
|
|
833
834
|
return /* @__PURE__ */ J("label", {
|
|
834
835
|
htmlFor: _,
|
|
835
836
|
"data-test-id": p,
|
|
@@ -852,9 +853,9 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
852
853
|
"data-test-id": x("input"),
|
|
853
854
|
...m
|
|
854
855
|
}), /* @__PURE__ */ q("span", {
|
|
855
|
-
className: Z("flex items-center justify-center border transition-colors",
|
|
856
|
-
children: q(a ?
|
|
857
|
-
className: Z(
|
|
856
|
+
className: Z("flex items-center justify-center border transition-colors", Kt[e], !a && "bg-bg-default", v ? "border-red-600" : a ? "border-brand-500" : "border-border-strong", !c && !a && (v ? "peer-hover:border-red-700" : "peer-hover:border-fg-tertiary"), "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1", !a && "peer-checked:bg-brand-500 peer-checked:border-brand-500", a && "bg-brand-500", c && !a && "peer-checked:bg-bg-subtle peer-checked:border-border-strong", !a && "[&_svg]:opacity-0 peer-checked:[&_svg]:opacity-100 [&_svg]:transition-opacity"),
|
|
857
|
+
children: q(a ? L : b, {
|
|
858
|
+
className: Z(qt[e], "text-white"),
|
|
858
859
|
strokeWidth: 3,
|
|
859
860
|
"aria-hidden": !0
|
|
860
861
|
})
|
|
@@ -863,7 +864,7 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
863
864
|
className: "flex flex-col gap-0.5",
|
|
864
865
|
children: [t && /* @__PURE__ */ J("span", {
|
|
865
866
|
className: "text-p-std font-medium text-fg-default leading-tight inline-flex items-center gap-1",
|
|
866
|
-
children: [t, i && /* @__PURE__ */ q(
|
|
867
|
+
children: [t, i && /* @__PURE__ */ q(at, {})]
|
|
867
868
|
}), r ? /* @__PURE__ */ q("span", {
|
|
868
869
|
id: `${_}-error`,
|
|
869
870
|
className: "text-p-sm text-red-700 leading-snug",
|
|
@@ -877,21 +878,21 @@ var Ct = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
877
878
|
});
|
|
878
879
|
//#endregion
|
|
879
880
|
//#region src/lib/mergeRefs.ts
|
|
880
|
-
function
|
|
881
|
+
function Yt(...e) {
|
|
881
882
|
return (t) => {
|
|
882
883
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
883
884
|
};
|
|
884
885
|
}
|
|
885
886
|
//#endregion
|
|
886
887
|
//#region src/lib/PortalContext.tsx
|
|
887
|
-
var
|
|
888
|
-
function
|
|
889
|
-
return c(
|
|
888
|
+
var Xt = r(null);
|
|
889
|
+
function Zt() {
|
|
890
|
+
return c(Xt) ?? (typeof document > "u" ? null : document.body);
|
|
890
891
|
}
|
|
891
892
|
//#endregion
|
|
892
893
|
//#region src/lib/useFloatingPosition.ts
|
|
893
|
-
var
|
|
894
|
-
function
|
|
894
|
+
var Qt = 8, $t = 10;
|
|
895
|
+
function en({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center", offset: a = 8, flip: o = !0, shift: s = !0, matchAnchorWidth: c = !1, recomputeKey: l }) {
|
|
895
896
|
let [u, f] = m({
|
|
896
897
|
style: {
|
|
897
898
|
position: "fixed",
|
|
@@ -916,18 +917,18 @@ function Zt({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center"
|
|
|
916
917
|
r === "left" && e < u.width + a && t > e ? h = "right" : r === "right" && t < u.width + a && e > t && (h = "left");
|
|
917
918
|
}
|
|
918
919
|
let g = h === "top" || h === "bottom", _, v;
|
|
919
|
-
g ? (_ = h === "bottom" ? l.bottom + a : l.top - u.height - a, v = i === "start" ? l.left : i === "end" ? l.right - u.width : l.left + l.width / 2 - u.width / 2) : (v = h === "right" ? l.right + a : l.left - u.width - a, _ = i === "start" ? l.top : i === "end" ? l.bottom - u.height : l.top + l.height / 2 - u.height / 2), s && (g ? v = Math.min(Math.max(v,
|
|
920
|
+
g ? (_ = h === "bottom" ? l.bottom + a : l.top - u.height - a, v = i === "start" ? l.left : i === "end" ? l.right - u.width : l.left + l.width / 2 - u.width / 2) : (v = h === "right" ? l.right + a : l.left - u.width - a, _ = i === "start" ? l.top : i === "end" ? l.bottom - u.height : l.top + l.height / 2 - u.height / 2), s && (g ? v = Math.min(Math.max(v, Qt), d - u.width - Qt) : _ = Math.min(Math.max(_, Qt), p - u.height - Qt));
|
|
920
921
|
let y;
|
|
921
922
|
if (g) {
|
|
922
923
|
let e = l.left + l.width / 2;
|
|
923
924
|
y = {
|
|
924
|
-
left: Math.min(Math.max(e - v,
|
|
925
|
+
left: Math.min(Math.max(e - v, $t), u.width - $t),
|
|
925
926
|
[h === "bottom" ? "top" : "bottom"]: -8 / 2
|
|
926
927
|
};
|
|
927
928
|
} else {
|
|
928
929
|
let e = l.top + l.height / 2;
|
|
929
930
|
y = {
|
|
930
|
-
top: Math.min(Math.max(e - _,
|
|
931
|
+
top: Math.min(Math.max(e - _, $t), u.height - $t),
|
|
931
932
|
[h === "right" ? "left" : "right"]: -8 / 2
|
|
932
933
|
};
|
|
933
934
|
}
|
|
@@ -963,16 +964,16 @@ function Zt({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center"
|
|
|
963
964
|
}
|
|
964
965
|
//#endregion
|
|
965
966
|
//#region src/components/Popover/Popover.tsx
|
|
966
|
-
var
|
|
967
|
+
var tn = {
|
|
967
968
|
bottom: "border-l border-t",
|
|
968
969
|
top: "border-b border-r",
|
|
969
970
|
left: "border-t border-r",
|
|
970
971
|
right: "border-b border-l"
|
|
971
972
|
};
|
|
972
|
-
function
|
|
973
|
+
function nn({ content: e, children: t, side: r = "top", align: i = "center", offset: a = 8, open: s, defaultOpen: c = !1, onOpenChange: d, flip: f = !0, showArrow: h = !0, closeOnScroll: g = !0, autoFocus: _ = !1, container: v, className: y, dataTestId: b }) {
|
|
973
974
|
let [x, S] = m(c), C = s !== void 0, w = C ? s : x, T = p(null), [E, D] = m(null), O = u(), k = (e) => {
|
|
974
975
|
C || S(e), d?.(e);
|
|
975
|
-
}, { style: A, arrowStyle: j, resolvedSide: M } =
|
|
976
|
+
}, { style: A, arrowStyle: j, resolvedSide: M } = en({
|
|
976
977
|
anchor: T,
|
|
977
978
|
panel: E,
|
|
978
979
|
open: w,
|
|
@@ -980,7 +981,7 @@ function $t({ content: e, children: t, side: r = "top", align: i = "center", off
|
|
|
980
981
|
align: i,
|
|
981
982
|
offset: a,
|
|
982
983
|
flip: f
|
|
983
|
-
}),
|
|
984
|
+
}), N = Zt();
|
|
984
985
|
if (l(() => {
|
|
985
986
|
if (!w) return;
|
|
986
987
|
let e = (e) => {
|
|
@@ -1014,16 +1015,16 @@ function $t({ content: e, children: t, side: r = "top", align: i = "center", off
|
|
|
1014
1015
|
_,
|
|
1015
1016
|
E
|
|
1016
1017
|
]), !o(t)) return t;
|
|
1017
|
-
let
|
|
1018
|
-
ref:
|
|
1018
|
+
let ee = t.props ?? {}, te = t.ref, P = n(t, {
|
|
1019
|
+
ref: Yt(T, te),
|
|
1019
1020
|
onClick: (e) => {
|
|
1020
|
-
|
|
1021
|
+
ee.onClick?.(e), e.defaultPrevented || k(!w);
|
|
1021
1022
|
},
|
|
1022
1023
|
"aria-haspopup": "dialog",
|
|
1023
1024
|
"aria-expanded": w
|
|
1024
|
-
}), F = v ??
|
|
1025
|
-
return /* @__PURE__ */ J(K, { children: [P, w && F &&
|
|
1026
|
-
ref:
|
|
1025
|
+
}), F = v ?? N;
|
|
1026
|
+
return /* @__PURE__ */ J(K, { children: [P, w && F && ve(/* @__PURE__ */ J("div", {
|
|
1027
|
+
ref: Yt(D),
|
|
1027
1028
|
id: O,
|
|
1028
1029
|
role: "dialog",
|
|
1029
1030
|
"aria-label": typeof e == "string" ? e : void 0,
|
|
@@ -1035,22 +1036,22 @@ function $t({ content: e, children: t, side: r = "top", align: i = "center", off
|
|
|
1035
1036
|
children: [e, h && /* @__PURE__ */ q("span", {
|
|
1036
1037
|
"aria-hidden": !0,
|
|
1037
1038
|
style: j,
|
|
1038
|
-
className: Z("absolute size-2 rotate-45 bg-bg-default",
|
|
1039
|
+
className: Z("absolute size-2 rotate-45 bg-bg-default", tn[M])
|
|
1039
1040
|
})]
|
|
1040
1041
|
}), F)] });
|
|
1041
1042
|
}
|
|
1042
1043
|
//#endregion
|
|
1043
1044
|
//#region src/components/Copy/Copy.tsx
|
|
1044
|
-
var
|
|
1045
|
+
var rn = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to clipboard", timeout: r = 1500, icon: i, onCopy: a, onError: o, disabled: s, dataTestId: c, ...u }, d) {
|
|
1045
1046
|
let [f, h] = m(!1), g = p(null), _ = typeof navigator < "u" && typeof navigator.clipboard?.writeText == "function";
|
|
1046
1047
|
return l(() => () => {
|
|
1047
1048
|
g.current && clearTimeout(g.current);
|
|
1048
|
-
}, []), /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(
|
|
1049
|
+
}, []), /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(nn, {
|
|
1049
1050
|
open: f,
|
|
1050
1051
|
content: t,
|
|
1051
1052
|
side: "top",
|
|
1052
1053
|
align: "center",
|
|
1053
|
-
children: /* @__PURE__ */ q(
|
|
1054
|
+
children: /* @__PURE__ */ q(ut, {
|
|
1054
1055
|
ref: d,
|
|
1055
1056
|
type: "button",
|
|
1056
1057
|
variant: "tertiary",
|
|
@@ -1065,7 +1066,7 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1065
1066
|
"aria-label": n,
|
|
1066
1067
|
dataTestId: c,
|
|
1067
1068
|
...u,
|
|
1068
|
-
children: f ? /* @__PURE__ */ q(b, { className: "size-4" }) : i ?? /* @__PURE__ */ q(
|
|
1069
|
+
children: f ? /* @__PURE__ */ q(b, { className: "size-4" }) : i ?? /* @__PURE__ */ q(j, { className: "size-4" })
|
|
1069
1070
|
})
|
|
1070
1071
|
}), /* @__PURE__ */ q("span", {
|
|
1071
1072
|
role: "status",
|
|
@@ -1073,24 +1074,32 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1073
1074
|
className: "sr-only",
|
|
1074
1075
|
children: f ? t : ""
|
|
1075
1076
|
})] });
|
|
1076
|
-
}),
|
|
1077
|
+
}), an = {
|
|
1077
1078
|
lg: "h-12 text-p-md",
|
|
1078
1079
|
md: "h-10 text-p-std",
|
|
1079
1080
|
sm: "h-8 text-p-sm"
|
|
1080
|
-
},
|
|
1081
|
+
}, on = {
|
|
1081
1082
|
lg: "pl-10",
|
|
1082
1083
|
md: "pl-9",
|
|
1083
1084
|
sm: "pl-8"
|
|
1084
|
-
},
|
|
1085
|
+
}, sn = {
|
|
1085
1086
|
lg: "pr-10",
|
|
1086
1087
|
md: "pr-9",
|
|
1087
1088
|
sm: "pr-8"
|
|
1088
|
-
},
|
|
1089
|
+
}, cn = {
|
|
1089
1090
|
lg: "w-10",
|
|
1090
1091
|
md: "w-9",
|
|
1091
1092
|
sm: "w-8"
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1093
|
+
};
|
|
1094
|
+
function ln({ id: e, isError: t, children: n }) {
|
|
1095
|
+
return /* @__PURE__ */ q("p", {
|
|
1096
|
+
id: e,
|
|
1097
|
+
className: Z("text-p-sm", t ? "text-red-700" : "text-fg-secondary"),
|
|
1098
|
+
children: n
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
var un = a(function({ label: e, labelAddons: t, helperText: n, errorText: r, size: i = "md", leftIcon: a, rightIcon: o, leftAddon: s, rightAddon: c, error: l = !1, id: d, disabled: f, className: p, wrapperClassName: m, required: g, dataTestId: _, ...v }, y) {
|
|
1102
|
+
let b = u(), x = d ?? b, S = l || !!r, C = `${x}-${r ? "error" : "help"}`, w = r || n, T = w ? C : void 0, E = Q(_);
|
|
1094
1103
|
return /* @__PURE__ */ J("div", {
|
|
1095
1104
|
className: Z("flex flex-col gap-1.5 w-full", m),
|
|
1096
1105
|
"data-test-id": _,
|
|
@@ -1100,14 +1109,14 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1100
1109
|
children: [e && /* @__PURE__ */ J("label", {
|
|
1101
1110
|
htmlFor: x,
|
|
1102
1111
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
1103
|
-
children: [e, g && /* @__PURE__ */ q(
|
|
1112
|
+
children: [e, g && /* @__PURE__ */ q(at, {})]
|
|
1104
1113
|
}), t && /* @__PURE__ */ q("span", {
|
|
1105
1114
|
className: "inline-flex items-center gap-1",
|
|
1106
1115
|
children: t
|
|
1107
1116
|
})]
|
|
1108
1117
|
}),
|
|
1109
1118
|
/* @__PURE__ */ J("div", {
|
|
1110
|
-
className: Z("flex items-stretch w-full rounded-lg bg-bg-default transition-colors", "border",
|
|
1119
|
+
className: Z("flex items-stretch w-full rounded-lg bg-bg-default transition-colors", "border", S ? "border-red-600" : "border-border-default", !f && !S && "hover:border-border-strong", "focus-within:ring-2 focus-within:ring-offset-0", S ? "focus-within:ring-red-300 focus-within:border-red-600" : "focus-within:ring-brand-300 focus-within:border-brand-500", f && "bg-bg-container border-border-default cursor-not-allowed", an[i]),
|
|
1111
1120
|
children: [
|
|
1112
1121
|
s && /* @__PURE__ */ q("span", {
|
|
1113
1122
|
className: "inline-flex items-center px-3 text-fg-secondary bg-bg-container border-r border-border-default rounded-l-lg whitespace-nowrap",
|
|
@@ -1118,7 +1127,7 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1118
1127
|
children: [
|
|
1119
1128
|
a && /* @__PURE__ */ q("span", {
|
|
1120
1129
|
"aria-hidden": !0,
|
|
1121
|
-
className: Z("absolute inset-y-0 left-0 flex items-center justify-center text-fg-secondary pointer-events-none",
|
|
1130
|
+
className: Z("absolute inset-y-0 left-0 flex items-center justify-center text-fg-secondary pointer-events-none", cn[i]),
|
|
1122
1131
|
children: a
|
|
1123
1132
|
}),
|
|
1124
1133
|
/* @__PURE__ */ q("input", {
|
|
@@ -1126,15 +1135,16 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1126
1135
|
id: x,
|
|
1127
1136
|
disabled: f,
|
|
1128
1137
|
required: g,
|
|
1129
|
-
"aria-invalid":
|
|
1130
|
-
"aria-describedby":
|
|
1131
|
-
|
|
1138
|
+
"aria-invalid": S || void 0,
|
|
1139
|
+
"aria-describedby": T,
|
|
1140
|
+
"data-test-id": E("input"),
|
|
1141
|
+
className: Z("w-full h-full bg-transparent outline-none", "placeholder:text-fg-tertiary text-fg-default", "disabled:cursor-not-allowed disabled:text-fg-disabled", a ? on[i] : "pl-3", o || S ? sn[i] : "pr-3", p),
|
|
1132
1142
|
...v
|
|
1133
1143
|
}),
|
|
1134
|
-
(o ||
|
|
1144
|
+
(o || S) && /* @__PURE__ */ q("span", {
|
|
1135
1145
|
"aria-hidden": !0,
|
|
1136
|
-
className: Z("absolute inset-y-0 right-0 flex items-center justify-center pointer-events-none",
|
|
1137
|
-
children:
|
|
1146
|
+
className: Z("absolute inset-y-0 right-0 flex items-center justify-center pointer-events-none", cn[i], S ? "text-red-600" : "text-fg-secondary"),
|
|
1147
|
+
children: S ? /* @__PURE__ */ q(h, { className: "h-4 w-4" }) : o
|
|
1138
1148
|
})
|
|
1139
1149
|
]
|
|
1140
1150
|
}),
|
|
@@ -1144,18 +1154,14 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1144
1154
|
})
|
|
1145
1155
|
]
|
|
1146
1156
|
}),
|
|
1147
|
-
|
|
1148
|
-
id:
|
|
1149
|
-
|
|
1150
|
-
children:
|
|
1151
|
-
})
|
|
1152
|
-
id: `${x}-help`,
|
|
1153
|
-
className: "text-p-sm text-fg-secondary",
|
|
1154
|
-
children: n
|
|
1155
|
-
}) : null
|
|
1157
|
+
w && /* @__PURE__ */ q(ln, {
|
|
1158
|
+
id: C,
|
|
1159
|
+
isError: !!r,
|
|
1160
|
+
children: w
|
|
1161
|
+
})
|
|
1156
1162
|
]
|
|
1157
1163
|
});
|
|
1158
|
-
}),
|
|
1164
|
+
}), dn = "inline-flex items-center justify-center text-fg-secondary transition-colors hover:text-fg-default disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none", fn = a(function({ value: e, defaultValue: t = 0, onValueChange: n, min: r = 0, max: i = 2 ** 53 - 1, step: a = 1, size: o = "md", label: s, helperText: c, errorText: u, error: d, disabled: f, className: p, wrapperClassName: h, dataTestId: g, ..._ }, v) {
|
|
1159
1165
|
let y = e !== void 0, [b, x] = m(t), S = y ? e : b, [C, w] = m(String(S));
|
|
1160
1166
|
l(() => {
|
|
1161
1167
|
w(String(S));
|
|
@@ -1164,7 +1170,7 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1164
1170
|
let t = Math.min(i, Math.max(r, e));
|
|
1165
1171
|
return y || x(t), n?.(t), t;
|
|
1166
1172
|
};
|
|
1167
|
-
return /* @__PURE__ */ q(
|
|
1173
|
+
return /* @__PURE__ */ q(un, {
|
|
1168
1174
|
ref: v,
|
|
1169
1175
|
type: "number",
|
|
1170
1176
|
min: r,
|
|
@@ -1195,25 +1201,25 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1195
1201
|
disabled: f || S <= r,
|
|
1196
1202
|
onClick: () => T(S - a),
|
|
1197
1203
|
"aria-label": "Decrease",
|
|
1198
|
-
className:
|
|
1199
|
-
children: /* @__PURE__ */ q(
|
|
1204
|
+
className: dn,
|
|
1205
|
+
children: /* @__PURE__ */ q(L, { className: "size-4" })
|
|
1200
1206
|
}),
|
|
1201
1207
|
rightAddon: /* @__PURE__ */ q("button", {
|
|
1202
1208
|
type: "button",
|
|
1203
1209
|
disabled: f || S >= i,
|
|
1204
1210
|
onClick: () => T(S + a),
|
|
1205
1211
|
"aria-label": "Increase",
|
|
1206
|
-
className:
|
|
1207
|
-
children: /* @__PURE__ */ q(
|
|
1212
|
+
className: dn,
|
|
1213
|
+
children: /* @__PURE__ */ q(B, { className: "size-4" })
|
|
1208
1214
|
}),
|
|
1209
1215
|
className: Z("text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", p),
|
|
1210
1216
|
..._
|
|
1211
1217
|
});
|
|
1212
|
-
}),
|
|
1218
|
+
}), pn = {
|
|
1213
1219
|
lg: "h-12 text-p-md px-3.5",
|
|
1214
1220
|
md: "h-10 text-p-std px-3",
|
|
1215
1221
|
sm: "h-8 text-p-sm px-2.5"
|
|
1216
|
-
},
|
|
1222
|
+
}, mn = 4, hn = /* @__PURE__ */ new Set([
|
|
1217
1223
|
"US",
|
|
1218
1224
|
"CA",
|
|
1219
1225
|
"MX",
|
|
@@ -1224,26 +1230,26 @@ var en = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
1224
1230
|
"KR",
|
|
1225
1231
|
"TW"
|
|
1226
1232
|
]);
|
|
1227
|
-
function
|
|
1233
|
+
function gn(e) {
|
|
1228
1234
|
try {
|
|
1229
1235
|
return new Intl.Locale(e), e;
|
|
1230
1236
|
} catch {
|
|
1231
1237
|
return "en";
|
|
1232
1238
|
}
|
|
1233
1239
|
}
|
|
1234
|
-
function
|
|
1240
|
+
function _n(e) {
|
|
1235
1241
|
try {
|
|
1236
1242
|
let t = new Intl.Locale(e), n = t.weekInfo ?? t.getWeekInfo?.();
|
|
1237
1243
|
if (n?.firstDay) return n.firstDay % 7;
|
|
1238
1244
|
} catch {}
|
|
1239
1245
|
let t = e.split("-")[1]?.toUpperCase();
|
|
1240
|
-
return !t && e.toLowerCase() === "en" || t &&
|
|
1246
|
+
return !t && e.toLowerCase() === "en" || t && hn.has(t) ? 0 : 1;
|
|
1241
1247
|
}
|
|
1242
|
-
function
|
|
1248
|
+
function vn(e) {
|
|
1243
1249
|
let t = new Intl.DateTimeFormat(e, { month: "short" });
|
|
1244
1250
|
return Array.from({ length: 12 }, (e, n) => t.format(new Date(2e3, n, 1)));
|
|
1245
1251
|
}
|
|
1246
|
-
var
|
|
1252
|
+
var yn = [
|
|
1247
1253
|
"Su",
|
|
1248
1254
|
"Mo",
|
|
1249
1255
|
"Tu",
|
|
@@ -1252,50 +1258,50 @@ var hn = [
|
|
|
1252
1258
|
"Fr",
|
|
1253
1259
|
"Sa"
|
|
1254
1260
|
];
|
|
1255
|
-
function
|
|
1256
|
-
let n = e.toLowerCase() === "en" ?
|
|
1261
|
+
function bn(e, t) {
|
|
1262
|
+
let n = e.toLowerCase() === "en" ? yn : (() => {
|
|
1257
1263
|
let t = new Intl.DateTimeFormat(e, { weekday: "short" });
|
|
1258
1264
|
return Array.from({ length: 7 }, (e, n) => t.format(new Date(1970, 0, 4 + n)));
|
|
1259
1265
|
})();
|
|
1260
1266
|
return [...n.slice(t), ...n.slice(0, t)];
|
|
1261
1267
|
}
|
|
1262
|
-
function
|
|
1268
|
+
function xn(e) {
|
|
1263
1269
|
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
1264
1270
|
}
|
|
1265
|
-
function
|
|
1271
|
+
function Sn(e, t) {
|
|
1266
1272
|
return !!e && !!t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
1267
1273
|
}
|
|
1268
|
-
function
|
|
1274
|
+
function Cn(e) {
|
|
1269
1275
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
1270
1276
|
}
|
|
1271
|
-
function
|
|
1272
|
-
let a =
|
|
1273
|
-
return t && a <
|
|
1277
|
+
function wn(e, t, n, r, i) {
|
|
1278
|
+
let a = Cn(e).getTime();
|
|
1279
|
+
return t && a < Cn(t).getTime() || n && a > Cn(n).getTime() || r?.some((t) => Sn(t, e)) ? !0 : !!i && !i(e);
|
|
1274
1280
|
}
|
|
1275
|
-
function
|
|
1281
|
+
function Tn(e, t) {
|
|
1276
1282
|
let n = String(e.getDate()).padStart(2, "0"), r = String(e.getMonth() + 1).padStart(2, "0"), i = String(e.getFullYear());
|
|
1277
1283
|
return t.replace(/dd/g, n).replace(/MM/g, r).replace(/yyyy/g, i);
|
|
1278
1284
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let n = (
|
|
1285
|
+
function En(e, t) {
|
|
1286
|
+
let n = (xn(e).getDay() - t + 7) % 7, r = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate(), i = [];
|
|
1281
1287
|
for (let e = 0; e < n; e++) i.push(null);
|
|
1282
1288
|
for (let t = 1; t <= r; t++) i.push(new Date(e.getFullYear(), e.getMonth(), t));
|
|
1283
1289
|
for (; i.length % 7 != 0;) i.push(null);
|
|
1284
1290
|
return i;
|
|
1285
1291
|
}
|
|
1286
|
-
function
|
|
1292
|
+
function Dn(e) {
|
|
1287
1293
|
if (!e) return;
|
|
1288
1294
|
let t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0");
|
|
1289
1295
|
return `${e.getFullYear()}-${t}-${n}`;
|
|
1290
1296
|
}
|
|
1291
|
-
var
|
|
1292
|
-
let
|
|
1297
|
+
var On = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, rangeValue: i, onChangeRange: a, size: o = "md", locale: s = "en", format: c = "dd.MM.yyyy", label: d, required: h = !1, helperText: g, placeholder: _ = "Select date", fullWidth: v = !1, disabled: b = !1, minDate: x, maxDate: S, excludeDates: T, filterDate: E, menuPlacement: D = "auto", error: O = !1, errorText: k, id: A, className: j, wrapperClassName: M, dataTestId: N }, ee) {
|
|
1298
|
+
let te = u(), P = A ?? te, [F, I] = m(!1), [L, R] = m(e ?? i?.start ?? /* @__PURE__ */ new Date()), [ne, z] = m(null), [re, ie] = m(null), ae = p(null), oe = p(null), se = Zt(), { style: B, resolvedSide: ce } = en({
|
|
1293
1299
|
anchor: oe,
|
|
1294
1300
|
panel: re,
|
|
1295
1301
|
open: F,
|
|
1296
1302
|
side: D === "top" ? "top" : "bottom",
|
|
1297
1303
|
align: "start",
|
|
1298
|
-
offset:
|
|
1304
|
+
offset: mn,
|
|
1299
1305
|
flip: D === "auto",
|
|
1300
1306
|
recomputeKey: `${L.getFullYear()}-${L.getMonth()}-${r}`
|
|
1301
1307
|
}), le = O || !!k, ue = k ? `${P}-error` : g ? `${P}-help` : void 0;
|
|
@@ -1309,8 +1315,8 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1309
1315
|
};
|
|
1310
1316
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1311
1317
|
}, [F, re]);
|
|
1312
|
-
let
|
|
1313
|
-
function
|
|
1318
|
+
let de = r ? i?.start ? `${Tn(i.start, c)}${i.end ? ` – ${Tn(i.end, c)}` : ""}` : "" : e ? Tn(e, c) : "";
|
|
1319
|
+
function fe(e) {
|
|
1314
1320
|
if (!r) {
|
|
1315
1321
|
t?.(e), I(!1);
|
|
1316
1322
|
return;
|
|
@@ -1338,67 +1344,67 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1338
1344
|
end: e
|
|
1339
1345
|
}), I(!1);
|
|
1340
1346
|
}
|
|
1341
|
-
function
|
|
1347
|
+
function pe(e) {
|
|
1342
1348
|
e.stopPropagation(), r ? (a?.({
|
|
1343
1349
|
start: null,
|
|
1344
1350
|
end: null
|
|
1345
|
-
}),
|
|
1351
|
+
}), z(null)) : t?.(null);
|
|
1346
1352
|
}
|
|
1347
|
-
let { firstDayOfWeek:
|
|
1348
|
-
let e =
|
|
1353
|
+
let { firstDayOfWeek: me, monthNames: he, weekdayNames: ge } = f(() => {
|
|
1354
|
+
let e = gn(s), t = _n(e);
|
|
1349
1355
|
return {
|
|
1350
1356
|
firstDayOfWeek: t,
|
|
1351
|
-
monthNames:
|
|
1352
|
-
weekdayNames:
|
|
1357
|
+
monthNames: vn(e),
|
|
1358
|
+
weekdayNames: bn(e, t)
|
|
1353
1359
|
};
|
|
1354
|
-
}, [s]),
|
|
1360
|
+
}, [s]), V = En(L, me), H = Q(N), W = i ?? {
|
|
1355
1361
|
start: null,
|
|
1356
1362
|
end: null
|
|
1357
|
-
},
|
|
1363
|
+
}, G = W.end ?? ne;
|
|
1358
1364
|
return /* @__PURE__ */ J("div", {
|
|
1359
1365
|
ref: ae,
|
|
1360
|
-
"data-test-id":
|
|
1366
|
+
"data-test-id": H("root"),
|
|
1361
1367
|
className: Z("flex flex-col gap-1.5", v && "w-full", M),
|
|
1362
1368
|
children: [
|
|
1363
1369
|
d && /* @__PURE__ */ J("label", {
|
|
1364
1370
|
htmlFor: P,
|
|
1365
1371
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
1366
|
-
children: [d, h && /* @__PURE__ */ q(
|
|
1372
|
+
children: [d, h && /* @__PURE__ */ q(at, {})]
|
|
1367
1373
|
}),
|
|
1368
1374
|
/* @__PURE__ */ J("div", {
|
|
1369
1375
|
ref: oe,
|
|
1370
1376
|
className: "relative",
|
|
1371
1377
|
children: [/* @__PURE__ */ J("button", {
|
|
1372
|
-
ref:
|
|
1378
|
+
ref: ee,
|
|
1373
1379
|
id: P,
|
|
1374
|
-
"data-test-id":
|
|
1375
|
-
"data-value": r ? void 0 :
|
|
1376
|
-
"data-from": r ?
|
|
1377
|
-
"data-to": r ?
|
|
1380
|
+
"data-test-id": N,
|
|
1381
|
+
"data-value": r ? void 0 : Dn(e),
|
|
1382
|
+
"data-from": r ? Dn(i?.start) : void 0,
|
|
1383
|
+
"data-to": r ? Dn(i?.end) : void 0,
|
|
1378
1384
|
type: "button",
|
|
1379
1385
|
disabled: b,
|
|
1380
1386
|
"aria-invalid": le || void 0,
|
|
1381
1387
|
"aria-required": h || void 0,
|
|
1382
1388
|
"aria-describedby": ue,
|
|
1383
1389
|
onClick: () => I((e) => !e),
|
|
1384
|
-
className: Z("inline-flex items-center gap-2 rounded-lg border bg-bg-default text-left transition-colors focus-visible:outline-none focus-visible:ring-2", le ? "border-red-600" : "border-border-default", !b && !le && "hover:border-border-strong", le ? "focus-visible:ring-red-300 focus-visible:border-red-600" : "focus-visible:ring-brand-300 focus-visible:border-brand-500", b && "bg-bg-container border-border-default cursor-not-allowed text-fg-disabled", v ? "w-full min-w-0" : "min-w-[260px]",
|
|
1390
|
+
className: Z("inline-flex items-center gap-2 rounded-lg border bg-bg-default text-left transition-colors focus-visible:outline-none focus-visible:ring-2", le ? "border-red-600" : "border-border-default", !b && !le && "hover:border-border-strong", le ? "focus-visible:ring-red-300 focus-visible:border-red-600" : "focus-visible:ring-brand-300 focus-visible:border-brand-500", b && "bg-bg-container border-border-default cursor-not-allowed text-fg-disabled", v ? "w-full min-w-0" : "min-w-[260px]", pn[o], j),
|
|
1385
1391
|
children: [/* @__PURE__ */ q("span", {
|
|
1386
|
-
className: Z("flex-1 text-left truncate", b ? "text-fg-disabled" :
|
|
1387
|
-
children:
|
|
1388
|
-
}), n &&
|
|
1392
|
+
className: Z("flex-1 text-left truncate", b ? "text-fg-disabled" : de ? "text-fg-default" : "text-fg-tertiary"),
|
|
1393
|
+
children: de || _
|
|
1394
|
+
}), n && de && !b ? /* @__PURE__ */ q("span", {
|
|
1389
1395
|
role: "button",
|
|
1390
1396
|
tabIndex: 0,
|
|
1391
1397
|
"aria-label": "Clear date",
|
|
1392
|
-
onClick:
|
|
1398
|
+
onClick: pe,
|
|
1393
1399
|
onKeyDown: (e) => {
|
|
1394
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
1400
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), pe(e));
|
|
1395
1401
|
},
|
|
1396
1402
|
className: "inline-flex items-center justify-center rounded-full p-0.5 hover:bg-bg-container",
|
|
1397
1403
|
children: /* @__PURE__ */ q(U, { className: "w-4 h-4 text-fg-secondary" })
|
|
1398
1404
|
}) : /* @__PURE__ */ q(y, { className: Z("w-4 h-4", b ? "text-fg-disabled" : "text-fg-secondary") })]
|
|
1399
|
-
}), F && se &&
|
|
1405
|
+
}), F && se && ve(/* @__PURE__ */ J("div", {
|
|
1400
1406
|
ref: ie,
|
|
1401
|
-
"data-test-id":
|
|
1407
|
+
"data-test-id": H("calendar"),
|
|
1402
1408
|
"data-side": ce,
|
|
1403
1409
|
style: B,
|
|
1404
1410
|
className: "z-50 rounded-xl border border-border-default bg-bg-default shadow-z3 p-3 w-[300px]",
|
|
@@ -1410,15 +1416,15 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1410
1416
|
className: "w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary",
|
|
1411
1417
|
onClick: () => R(new Date(L.getFullYear(), L.getMonth() - 1, 1)),
|
|
1412
1418
|
"aria-label": "Previous month",
|
|
1413
|
-
"data-test-id":
|
|
1419
|
+
"data-test-id": H("prev-month"),
|
|
1414
1420
|
children: /* @__PURE__ */ q(C, { className: "w-4 h-4" })
|
|
1415
1421
|
}),
|
|
1416
1422
|
/* @__PURE__ */ J("div", {
|
|
1417
|
-
"data-test-id":
|
|
1423
|
+
"data-test-id": H("month-label"),
|
|
1418
1424
|
"data-month": `${L.getFullYear()}-${String(L.getMonth() + 1).padStart(2, "0")}`,
|
|
1419
1425
|
className: "text-p-md font-semibold text-fg-default",
|
|
1420
1426
|
children: [
|
|
1421
|
-
|
|
1427
|
+
he[L.getMonth()],
|
|
1422
1428
|
" ",
|
|
1423
1429
|
L.getFullYear()
|
|
1424
1430
|
]
|
|
@@ -1428,26 +1434,26 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1428
1434
|
className: "w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary",
|
|
1429
1435
|
onClick: () => R(new Date(L.getFullYear(), L.getMonth() + 1, 1)),
|
|
1430
1436
|
"aria-label": "Next month",
|
|
1431
|
-
"data-test-id":
|
|
1437
|
+
"data-test-id": H("next-month"),
|
|
1432
1438
|
children: /* @__PURE__ */ q(w, { className: "w-4 h-4" })
|
|
1433
1439
|
})
|
|
1434
1440
|
]
|
|
1435
1441
|
}), /* @__PURE__ */ J("div", {
|
|
1436
1442
|
className: "grid grid-cols-7 gap-1 text-center",
|
|
1437
|
-
children: [
|
|
1443
|
+
children: [ge.map((e, t) => /* @__PURE__ */ q("div", {
|
|
1438
1444
|
className: "text-p-xs text-fg-tertiary py-1",
|
|
1439
1445
|
children: e
|
|
1440
|
-
}, t)),
|
|
1446
|
+
}, t)), V.map((t, n) => {
|
|
1441
1447
|
if (!t) return /* @__PURE__ */ q("div", {}, n);
|
|
1442
|
-
let i =
|
|
1448
|
+
let i = wn(t, x, S, T, E), a = !r && Sn(t, e ?? null), o = r && Sn(t, W.start), s = r && Sn(t, G), c = r && !!W.start && !!G && t > W.start && t < G, l = i ? "text-fg-disabled cursor-not-allowed" : a || o || s ? "bg-brand-500 text-white" : c ? "bg-bg-brand-lighter text-brand-700" : "text-fg-default hover:bg-bg-container";
|
|
1443
1449
|
return /* @__PURE__ */ q("button", {
|
|
1444
1450
|
type: "button",
|
|
1445
1451
|
disabled: i,
|
|
1446
1452
|
"aria-disabled": i || void 0,
|
|
1447
|
-
"data-test-id":
|
|
1448
|
-
"data-date":
|
|
1449
|
-
onMouseEnter: () => !i && r &&
|
|
1450
|
-
onClick: () => !i &&
|
|
1453
|
+
"data-test-id": H("day"),
|
|
1454
|
+
"data-date": Dn(t),
|
|
1455
|
+
onMouseEnter: () => !i && r && W.start && !W.end && z(t),
|
|
1456
|
+
onClick: () => !i && fe(t),
|
|
1451
1457
|
className: Z("h-8 rounded-md text-p-sm font-medium", l),
|
|
1452
1458
|
children: t.getDate()
|
|
1453
1459
|
}, n);
|
|
@@ -1466,7 +1472,7 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1466
1472
|
}) : null
|
|
1467
1473
|
]
|
|
1468
1474
|
});
|
|
1469
|
-
}),
|
|
1475
|
+
}), kn = {
|
|
1470
1476
|
brand: {
|
|
1471
1477
|
bg: "bg-bg-brand-lighter",
|
|
1472
1478
|
icon: "text-brand-700"
|
|
@@ -1503,7 +1509,7 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1503
1509
|
bg: "bg-bg-danger-lighter",
|
|
1504
1510
|
icon: "text-red-700"
|
|
1505
1511
|
}
|
|
1506
|
-
},
|
|
1512
|
+
}, An = {
|
|
1507
1513
|
sm: {
|
|
1508
1514
|
box: "h-8 w-8",
|
|
1509
1515
|
icon: "h-4 w-4",
|
|
@@ -1524,8 +1530,8 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1524
1530
|
icon: "h-7 w-7",
|
|
1525
1531
|
radius: "rounded-xl"
|
|
1526
1532
|
}
|
|
1527
|
-
},
|
|
1528
|
-
let c =
|
|
1533
|
+
}, jn = a(function({ icon: e, tone: t = "gray", size: n = "md", shape: r = "rounded", className: i, dataTestId: a, ...o }, s) {
|
|
1534
|
+
let c = kn[t], l = An[n];
|
|
1529
1535
|
return /* @__PURE__ */ q("div", {
|
|
1530
1536
|
ref: s,
|
|
1531
1537
|
"data-test-id": a,
|
|
@@ -1534,7 +1540,7 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1534
1540
|
...o,
|
|
1535
1541
|
children: /* @__PURE__ */ q(e, { className: Z(l.icon, c.icon) })
|
|
1536
1542
|
});
|
|
1537
|
-
}),
|
|
1543
|
+
}), Mn = {
|
|
1538
1544
|
"h-xl": "text-h-xl",
|
|
1539
1545
|
"h-lg": "text-h-lg",
|
|
1540
1546
|
"h-md": "text-h-md",
|
|
@@ -1552,12 +1558,12 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1552
1558
|
"label-sm": "text-label-sm",
|
|
1553
1559
|
"label-xs": "text-label-xs",
|
|
1554
1560
|
"label-xxs": "text-label-xxs"
|
|
1555
|
-
},
|
|
1561
|
+
}, Nn = {
|
|
1556
1562
|
normal: "font-normal",
|
|
1557
1563
|
medium: "font-medium",
|
|
1558
1564
|
semibold: "font-semibold",
|
|
1559
1565
|
bold: "font-bold"
|
|
1560
|
-
},
|
|
1566
|
+
}, Pn = {
|
|
1561
1567
|
default: "text-fg-default",
|
|
1562
1568
|
secondary: "text-fg-secondary",
|
|
1563
1569
|
tertiary: "text-fg-tertiary",
|
|
@@ -1568,7 +1574,7 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1568
1574
|
success: "text-fg-success",
|
|
1569
1575
|
warning: "text-fg-warning",
|
|
1570
1576
|
danger: "text-fg-danger"
|
|
1571
|
-
},
|
|
1577
|
+
}, Fn = {
|
|
1572
1578
|
"h-xl": "h1",
|
|
1573
1579
|
"h-lg": "h1",
|
|
1574
1580
|
"h-md": "h2",
|
|
@@ -1586,18 +1592,18 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1586
1592
|
"label-sm": "span",
|
|
1587
1593
|
"label-xs": "span",
|
|
1588
1594
|
"label-xxs": "span"
|
|
1589
|
-
},
|
|
1590
|
-
return i(r ??
|
|
1595
|
+
}, In = a(function({ variant: e = "p-std", weight: t, color: n = "default", as: r, truncate: a, clamp: o, style: s, className: c, children: l, dataTestId: u, ...d }, f) {
|
|
1596
|
+
return i(r ?? Fn[e], {
|
|
1591
1597
|
ref: f,
|
|
1592
1598
|
"data-test-id": u,
|
|
1593
|
-
className: Z(
|
|
1599
|
+
className: Z(Mn[e], t && Nn[t], Pn[n], a && "truncate", o && !a && "overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]", c),
|
|
1594
1600
|
style: o && !a ? {
|
|
1595
1601
|
...s,
|
|
1596
1602
|
WebkitLineClamp: o
|
|
1597
1603
|
} : s,
|
|
1598
1604
|
...d
|
|
1599
1605
|
}, l);
|
|
1600
|
-
}),
|
|
1606
|
+
}), Ln = {
|
|
1601
1607
|
"en-US": {
|
|
1602
1608
|
mobile: {
|
|
1603
1609
|
title: "Mobile only",
|
|
@@ -1652,34 +1658,34 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1652
1658
|
description: "Այս էջը հասանելի է միայն մոբայլ և պլանշետ սարքերում։ Շարունակելու համար խնդրում ենք բացել այն ձեր հեռախոսում կամ պլանշետում։"
|
|
1653
1659
|
}
|
|
1654
1660
|
}
|
|
1655
|
-
},
|
|
1656
|
-
mobile:
|
|
1657
|
-
tablet:
|
|
1658
|
-
desktop:
|
|
1659
|
-
"mobile-tablet":
|
|
1660
|
-
},
|
|
1661
|
-
let u =
|
|
1661
|
+
}, Rn = {
|
|
1662
|
+
mobile: de,
|
|
1663
|
+
tablet: me,
|
|
1664
|
+
desktop: R,
|
|
1665
|
+
"mobile-tablet": he
|
|
1666
|
+
}, zn = a(function({ type: e = "desktop", locale: t = "en-US", title: n, description: r, icon: i, fillHeight: a = !1, className: o, dataTestId: s, ...c }, l) {
|
|
1667
|
+
let u = Ln[t][e];
|
|
1662
1668
|
return /* @__PURE__ */ J("div", {
|
|
1663
1669
|
ref: l,
|
|
1664
1670
|
"data-test-id": s,
|
|
1665
1671
|
className: Z("flex flex-col items-center justify-center text-center px-6 py-16", a && "h-full", o),
|
|
1666
1672
|
...c,
|
|
1667
1673
|
children: [
|
|
1668
|
-
i ?? /* @__PURE__ */ q(
|
|
1669
|
-
icon:
|
|
1674
|
+
i ?? /* @__PURE__ */ q(jn, {
|
|
1675
|
+
icon: Rn[e],
|
|
1670
1676
|
tone: "gray",
|
|
1671
1677
|
shape: "rounded",
|
|
1672
1678
|
size: "xl",
|
|
1673
1679
|
className: "rounded-2xl"
|
|
1674
1680
|
}),
|
|
1675
|
-
/* @__PURE__ */ q(
|
|
1681
|
+
/* @__PURE__ */ q(In, {
|
|
1676
1682
|
as: "h3",
|
|
1677
1683
|
variant: "h-xs",
|
|
1678
1684
|
weight: "semibold",
|
|
1679
1685
|
className: "mt-6",
|
|
1680
1686
|
children: n ?? u.title
|
|
1681
1687
|
}),
|
|
1682
|
-
/* @__PURE__ */ q(
|
|
1688
|
+
/* @__PURE__ */ q(In, {
|
|
1683
1689
|
variant: "p-md",
|
|
1684
1690
|
color: "secondary",
|
|
1685
1691
|
className: "mt-2 max-w-105",
|
|
@@ -1687,7 +1693,7 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1687
1693
|
})
|
|
1688
1694
|
]
|
|
1689
1695
|
});
|
|
1690
|
-
}),
|
|
1696
|
+
}), Bn = {
|
|
1691
1697
|
brand: "bg-brand-500",
|
|
1692
1698
|
blue: "bg-blue-500",
|
|
1693
1699
|
purple: "bg-purple-500",
|
|
@@ -1695,10 +1701,10 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1695
1701
|
yellow: "bg-yellow-500",
|
|
1696
1702
|
red: "bg-red-500",
|
|
1697
1703
|
gray: "bg-gray-400"
|
|
1698
|
-
},
|
|
1704
|
+
}, Vn = {
|
|
1699
1705
|
sm: "h-1",
|
|
1700
1706
|
lg: "h-2"
|
|
1701
|
-
},
|
|
1707
|
+
}, Hn = (e) => new Intl.NumberFormat().format(e), Un = a(function({ segments: e, hideLegend: t = !1, formatValue: n = Hn, size: r = "lg", className: i, dataTestId: a, ...o }, s) {
|
|
1702
1708
|
let c = e.reduce((e, t) => e + t.value, 0);
|
|
1703
1709
|
return /* @__PURE__ */ J("div", {
|
|
1704
1710
|
ref: s,
|
|
@@ -1706,10 +1712,10 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1706
1712
|
className: Z("flex flex-col gap-3", i),
|
|
1707
1713
|
...o,
|
|
1708
1714
|
children: [/* @__PURE__ */ q("div", {
|
|
1709
|
-
className: Z("flex w-full overflow-hidden rounded-full bg-bg-subtle",
|
|
1715
|
+
className: Z("flex w-full overflow-hidden rounded-full bg-bg-subtle", Vn[r]),
|
|
1710
1716
|
children: e.map((e, t) => /* @__PURE__ */ q("div", {
|
|
1711
1717
|
style: { flexBasis: `${c > 0 ? e.value / c * 100 : 0}%` },
|
|
1712
|
-
className: Z("transition-[flex-basis] duration-700 ease-out",
|
|
1718
|
+
className: Z("transition-[flex-basis] duration-700 ease-out", Bn[e.color])
|
|
1713
1719
|
}, t))
|
|
1714
1720
|
}), !t && /* @__PURE__ */ q("ul", {
|
|
1715
1721
|
className: "flex flex-col [&>li:not(:last-child)]:border-b [&>li:not(:last-child)]:border-border-default",
|
|
@@ -1717,7 +1723,7 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1717
1723
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
1718
1724
|
children: [/* @__PURE__ */ J("span", {
|
|
1719
1725
|
className: "flex min-w-0 items-center gap-2",
|
|
1720
|
-
children: [/* @__PURE__ */ q("span", { className: Z("size-2 shrink-0 rounded-full",
|
|
1726
|
+
children: [/* @__PURE__ */ q("span", { className: Z("size-2 shrink-0 rounded-full", Bn[e.color]) }), /* @__PURE__ */ q("span", {
|
|
1721
1727
|
className: "truncate text-p-sm text-fg-tertiary",
|
|
1722
1728
|
children: e.label
|
|
1723
1729
|
})]
|
|
@@ -1728,24 +1734,24 @@ var wn = a(function({ value: e, onChange: t, clearable: n = !1, range: r = !1, r
|
|
|
1728
1734
|
}, t))
|
|
1729
1735
|
})]
|
|
1730
1736
|
});
|
|
1731
|
-
}),
|
|
1737
|
+
}), Wn = {
|
|
1732
1738
|
fast: 150,
|
|
1733
1739
|
base: 200,
|
|
1734
1740
|
slow: 300
|
|
1735
1741
|
};
|
|
1736
|
-
function
|
|
1742
|
+
function Gn() {
|
|
1737
1743
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1738
1744
|
}
|
|
1739
1745
|
//#endregion
|
|
1740
1746
|
//#region src/lib/useMountTransition.ts
|
|
1741
|
-
function
|
|
1747
|
+
function Kn(e, t) {
|
|
1742
1748
|
let [n, r] = m(e), [i, a] = m(e ? "entered" : "closed"), o = p(null), s = p(null);
|
|
1743
1749
|
return l(() => {
|
|
1744
1750
|
o.current && clearTimeout(o.current), s.current && cancelAnimationFrame(s.current), e ? (r(!0), a("entering"), s.current = requestAnimationFrame(() => {
|
|
1745
1751
|
s.current = requestAnimationFrame(() => a("entered"));
|
|
1746
1752
|
})) : (() => {
|
|
1747
1753
|
a((e) => e === "closed" ? "closed" : "exiting");
|
|
1748
|
-
let e =
|
|
1754
|
+
let e = Gn() ? 0 : t;
|
|
1749
1755
|
e === 0 ? (r(!1), a("closed")) : o.current = setTimeout(() => {
|
|
1750
1756
|
r(!1), a("closed");
|
|
1751
1757
|
}, e);
|
|
@@ -1759,12 +1765,12 @@ function Hn(e, t) {
|
|
|
1759
1765
|
}
|
|
1760
1766
|
//#endregion
|
|
1761
1767
|
//#region src/hooks/useStepper.ts
|
|
1762
|
-
function
|
|
1768
|
+
function qn(e, t) {
|
|
1763
1769
|
return t <= 0 ? 0 : Math.min(Math.max(e, 0), t - 1);
|
|
1764
1770
|
}
|
|
1765
|
-
function
|
|
1766
|
-
let [a, o] = m(() =>
|
|
1767
|
-
let n =
|
|
1771
|
+
function Jn({ count: e, initialStep: t = 0, step: n, onStepChange: r, loop: i = !1 }) {
|
|
1772
|
+
let [a, o] = m(() => qn(t, e)), s = n !== void 0, c = s ? qn(n, e) : a, l = (t) => {
|
|
1773
|
+
let n = qn(t, e);
|
|
1768
1774
|
s || o(n), r?.(n);
|
|
1769
1775
|
};
|
|
1770
1776
|
return {
|
|
@@ -1792,37 +1798,37 @@ function Wn({ count: e, initialStep: t = 0, step: n, onStepChange: r, loop: i =
|
|
|
1792
1798
|
}
|
|
1793
1799
|
//#endregion
|
|
1794
1800
|
//#region src/hooks/useOnOutsideClick.ts
|
|
1795
|
-
var
|
|
1796
|
-
function
|
|
1797
|
-
let t =
|
|
1801
|
+
var Yn = [];
|
|
1802
|
+
function Xn(e) {
|
|
1803
|
+
let t = Yn.at(-1);
|
|
1798
1804
|
if (!t) return;
|
|
1799
1805
|
let { ref: n, callback: r, shouldRemoveCallback: i } = t;
|
|
1800
|
-
n && !n.contains(e.target) && (i &&
|
|
1806
|
+
n && !n.contains(e.target) && (i && Yn.splice(-1, 1), r(e));
|
|
1801
1807
|
}
|
|
1802
|
-
var
|
|
1808
|
+
var Zn = (e, t, n, r, i = !0) => {
|
|
1803
1809
|
l(() => {
|
|
1804
|
-
if (e && n && r) return
|
|
1810
|
+
if (e && n && r) return Yn.push({
|
|
1805
1811
|
ref: e,
|
|
1806
1812
|
callback: t,
|
|
1807
1813
|
uid: r,
|
|
1808
1814
|
shouldRemoveCallback: i
|
|
1809
|
-
}),
|
|
1810
|
-
|
|
1815
|
+
}), Yn.length === 1 && document.addEventListener("mousedown", Xn), () => {
|
|
1816
|
+
Yn.length === 0 && document.removeEventListener("mousedown", Xn);
|
|
1811
1817
|
};
|
|
1812
1818
|
}, [
|
|
1813
1819
|
e,
|
|
1814
1820
|
n,
|
|
1815
1821
|
r
|
|
1816
1822
|
]), l(() => {
|
|
1817
|
-
if (!n &&
|
|
1818
|
-
let e =
|
|
1819
|
-
e >= 0 &&
|
|
1823
|
+
if (!n && Yn.length > 0) {
|
|
1824
|
+
let e = Yn.findIndex((e) => e.uid === r);
|
|
1825
|
+
e >= 0 && Yn.splice(e, 1);
|
|
1820
1826
|
}
|
|
1821
1827
|
}, [n]);
|
|
1822
1828
|
};
|
|
1823
1829
|
//#endregion
|
|
1824
1830
|
//#region src/hooks/useEscapeKey.ts
|
|
1825
|
-
function
|
|
1831
|
+
function Qn(e, t = !0) {
|
|
1826
1832
|
l(() => {
|
|
1827
1833
|
if (!t) return;
|
|
1828
1834
|
let n = (t) => {
|
|
@@ -1833,18 +1839,18 @@ function Jn(e, t = !0) {
|
|
|
1833
1839
|
}
|
|
1834
1840
|
//#endregion
|
|
1835
1841
|
//#region src/hooks/useHideBodyScroll.ts
|
|
1836
|
-
var
|
|
1837
|
-
function
|
|
1842
|
+
var $n = 0, er = "";
|
|
1843
|
+
function tr(e) {
|
|
1838
1844
|
l(() => {
|
|
1839
|
-
if (e) return
|
|
1840
|
-
|
|
1845
|
+
if (e) return $n === 0 && (er = document.body.style.overflow, document.body.style.overflow = "hidden"), $n += 1, () => {
|
|
1846
|
+
--$n, $n === 0 && (document.body.style.overflow = er);
|
|
1841
1847
|
};
|
|
1842
1848
|
}, [e]);
|
|
1843
1849
|
}
|
|
1844
1850
|
//#endregion
|
|
1845
1851
|
//#region src/hooks/useIsMobile.ts
|
|
1846
|
-
var
|
|
1847
|
-
function
|
|
1852
|
+
var nr = 768;
|
|
1853
|
+
function rr(e = nr) {
|
|
1848
1854
|
let [t, n] = m(!1);
|
|
1849
1855
|
return l(() => {
|
|
1850
1856
|
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
@@ -1854,58 +1860,58 @@ function $n(e = Qn) {
|
|
|
1854
1860
|
}
|
|
1855
1861
|
//#endregion
|
|
1856
1862
|
//#region src/lib/FormContext.ts
|
|
1857
|
-
var
|
|
1863
|
+
var ir = r(null);
|
|
1858
1864
|
//#endregion
|
|
1859
1865
|
//#region src/hooks/useFormContext.ts
|
|
1860
|
-
function
|
|
1861
|
-
let e = c(
|
|
1866
|
+
function ar() {
|
|
1867
|
+
let e = c(ir);
|
|
1862
1868
|
if (!e) throw Error("useFormContext must be used inside a FormContainer.");
|
|
1863
1869
|
return e;
|
|
1864
1870
|
}
|
|
1865
1871
|
//#endregion
|
|
1866
1872
|
//#region src/hooks/useFormProps.ts
|
|
1867
|
-
var
|
|
1873
|
+
var or = () => void 0, sr = {
|
|
1868
1874
|
errors: {},
|
|
1869
|
-
setValue:
|
|
1870
|
-
reset:
|
|
1871
|
-
clearErrors:
|
|
1872
|
-
setError:
|
|
1873
|
-
unregister:
|
|
1875
|
+
setValue: or,
|
|
1876
|
+
reset: or,
|
|
1877
|
+
clearErrors: or,
|
|
1878
|
+
setError: or,
|
|
1879
|
+
unregister: or,
|
|
1874
1880
|
isDirty: !1,
|
|
1875
1881
|
isSubmitted: !1,
|
|
1876
1882
|
isSubmitting: !1,
|
|
1877
1883
|
isValid: !1,
|
|
1878
1884
|
dirtyFields: {},
|
|
1879
|
-
submit:
|
|
1885
|
+
submit: or
|
|
1880
1886
|
};
|
|
1881
|
-
function
|
|
1882
|
-
return c(
|
|
1887
|
+
function cr() {
|
|
1888
|
+
return c(ir) ?? sr;
|
|
1883
1889
|
}
|
|
1884
1890
|
//#endregion
|
|
1885
1891
|
//#region src/components/Drawer/Drawer.tsx
|
|
1886
|
-
var
|
|
1892
|
+
var lr = {
|
|
1887
1893
|
sm: "w-[320px]",
|
|
1888
1894
|
md: "w-[420px]",
|
|
1889
1895
|
lg: "w-[560px]",
|
|
1890
1896
|
xl: "w-[720px]"
|
|
1891
|
-
},
|
|
1897
|
+
}, ur = {
|
|
1892
1898
|
sm: "h-[240px]",
|
|
1893
1899
|
md: "h-[360px]",
|
|
1894
1900
|
lg: "h-[480px]",
|
|
1895
1901
|
xl: "h-[600px]"
|
|
1896
|
-
},
|
|
1902
|
+
}, dr = {
|
|
1897
1903
|
right: "inset-y-0 right-0 border-l",
|
|
1898
1904
|
left: "inset-y-0 left-0 border-r",
|
|
1899
1905
|
top: "inset-x-0 top-0 border-b",
|
|
1900
1906
|
bottom: "inset-x-0 bottom-0 border-t"
|
|
1901
|
-
},
|
|
1907
|
+
}, fr = {
|
|
1902
1908
|
right: "translate-x-full",
|
|
1903
1909
|
left: "-translate-x-full",
|
|
1904
1910
|
top: "-translate-y-full",
|
|
1905
1911
|
bottom: "translate-y-full"
|
|
1906
|
-
},
|
|
1907
|
-
let v = p(null), [y, b] = m(null), x = p(null), { mounted: S, state: C } =
|
|
1908
|
-
if (
|
|
1912
|
+
}, pr = a(function({ open: e, onClose: t, side: n = "right", size: r = "md", title: i, description: a, children: o, footer: s, closeOnOverlayClick: c = !0, showClose: u = !0, animated: d = !0, headerActions: f, className: h, dataTestId: g }, _) {
|
|
1913
|
+
let v = p(null), [y, b] = m(null), x = p(null), { mounted: S, state: C } = Kn(e, d ? Wn.slow : 0), w = C === "entered";
|
|
1914
|
+
if (tr(S), l(() => {
|
|
1909
1915
|
let e = v.current;
|
|
1910
1916
|
if (!(!S || !e || e.open)) return e.showModal(), x.current?.focus({ preventScroll: !0 }), () => {
|
|
1911
1917
|
e.open && e.close();
|
|
@@ -1915,8 +1921,8 @@ var ar = {
|
|
|
1915
1921
|
let t = document.activeElement;
|
|
1916
1922
|
return x.current?.focus({ preventScroll: !0 }), () => t?.focus?.();
|
|
1917
1923
|
}, [e]), !S) return null;
|
|
1918
|
-
let T = n === "left" || n === "right", E = T ?
|
|
1919
|
-
ref:
|
|
1924
|
+
let T = n === "left" || n === "right", E = T ? lr[r] : ur[r], D = /* @__PURE__ */ J("dialog", {
|
|
1925
|
+
ref: Yt(v, b),
|
|
1920
1926
|
onCancel: (e) => {
|
|
1921
1927
|
e.preventDefault(), t();
|
|
1922
1928
|
},
|
|
@@ -1930,9 +1936,9 @@ var ar = {
|
|
|
1930
1936
|
onClick: () => c && t(),
|
|
1931
1937
|
"aria-hidden": !0
|
|
1932
1938
|
}), /* @__PURE__ */ J("div", {
|
|
1933
|
-
ref:
|
|
1939
|
+
ref: Yt(_, x),
|
|
1934
1940
|
tabIndex: -1,
|
|
1935
|
-
className: Z("absolute bg-bg-default shadow-z5 outline-none flex flex-col",
|
|
1941
|
+
className: Z("absolute bg-bg-default shadow-z5 outline-none flex flex-col", dr[n], T ? `${E} h-full max-w-full` : `${E} w-full max-h-full`, "border-border-default", d && "transition-transform duration-300 ease-out motion-reduce:transition-none will-change-transform", w ? "translate-x-0 translate-y-0" : fr[n], h),
|
|
1936
1942
|
children: [
|
|
1937
1943
|
(i || u || f) && /* @__PURE__ */ J("div", {
|
|
1938
1944
|
className: "flex items-start justify-between gap-4 px-6 pt-6 pb-4 border-b border-border-default",
|
|
@@ -1970,23 +1976,23 @@ var ar = {
|
|
|
1970
1976
|
]
|
|
1971
1977
|
})]
|
|
1972
1978
|
});
|
|
1973
|
-
return
|
|
1979
|
+
return ve(/* @__PURE__ */ q(Xt.Provider, {
|
|
1974
1980
|
value: y,
|
|
1975
1981
|
children: D
|
|
1976
1982
|
}), document.body);
|
|
1977
1983
|
});
|
|
1978
1984
|
//#endregion
|
|
1979
1985
|
//#region src/components/DropdownMenu/DropdownMenu.tsx
|
|
1980
|
-
function
|
|
1986
|
+
function mr(e) {
|
|
1981
1987
|
return e == null ? null : e instanceof HTMLElement ? e : e.current;
|
|
1982
1988
|
}
|
|
1983
|
-
var
|
|
1984
|
-
function
|
|
1985
|
-
let e = c(
|
|
1989
|
+
var hr = r(null);
|
|
1990
|
+
function gr() {
|
|
1991
|
+
let e = c(hr);
|
|
1986
1992
|
if (!e) throw Error("Dropdown parts must be used inside <DropdownMenu>");
|
|
1987
1993
|
return e;
|
|
1988
1994
|
}
|
|
1989
|
-
var
|
|
1995
|
+
var _r = a(function({ children: e, defaultOpen: t = !1, open: n, onOpenChange: r, anchorRef: i, className: a, dataTestId: o, ...s }, c) {
|
|
1990
1996
|
let [u, d] = m(t), f = n !== void 0, h = f ? n : u, g = p(null), _ = (e) => {
|
|
1991
1997
|
f || d(e), r?.(e);
|
|
1992
1998
|
};
|
|
@@ -1996,7 +2002,7 @@ var pr = a(function({ children: e, defaultOpen: t = !1, open: n, onOpenChange: r
|
|
|
1996
2002
|
e.key === "Escape" && _(!1);
|
|
1997
2003
|
};
|
|
1998
2004
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1999
|
-
}, [h]), /* @__PURE__ */ q(
|
|
2005
|
+
}, [h]), /* @__PURE__ */ q(hr.Provider, {
|
|
2000
2006
|
value: {
|
|
2001
2007
|
open: h,
|
|
2002
2008
|
setOpen: _,
|
|
@@ -2012,8 +2018,8 @@ var pr = a(function({ children: e, defaultOpen: t = !1, open: n, onOpenChange: r
|
|
|
2012
2018
|
})
|
|
2013
2019
|
});
|
|
2014
2020
|
});
|
|
2015
|
-
function
|
|
2016
|
-
let { open: t, setOpen: r, triggerRef: i } =
|
|
2021
|
+
function vr({ children: e }) {
|
|
2022
|
+
let { open: t, setOpen: r, triggerRef: i } = gr();
|
|
2017
2023
|
if (!o(e)) return e;
|
|
2018
2024
|
let a = e.props ?? {};
|
|
2019
2025
|
return n(e, {
|
|
@@ -2026,10 +2032,10 @@ function mr({ children: e }) {
|
|
|
2026
2032
|
"aria-expanded": t
|
|
2027
2033
|
});
|
|
2028
2034
|
}
|
|
2029
|
-
var
|
|
2030
|
-
let { open: y, setOpen: b, triggerRef: x, anchorRef: S } =
|
|
2031
|
-
return
|
|
2032
|
-
} }), [S, x]), D =
|
|
2035
|
+
var yr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1", br = a(function({ children: e, align: t = "start", strategy: n = "fixed", side: r = "bottom", sideOffset: i = 4, flip: a = !0, shift: o = !0, matchTriggerWidth: s = !1, closeOnScroll: c = !1, autoFocusFirstItem: u = !0, className: d, dataTestId: h, onClick: g, ..._ }, v) {
|
|
2036
|
+
let { open: y, setOpen: b, triggerRef: x, anchorRef: S } = gr(), C = p(null), [w, T] = m(null), E = f(() => ({ get current() {
|
|
2037
|
+
return mr(S) ?? x.current;
|
|
2038
|
+
} }), [S, x]), D = Zt(), { style: O, resolvedSide: k } = en({
|
|
2033
2039
|
anchor: E,
|
|
2034
2040
|
panel: w,
|
|
2035
2041
|
open: y && n === "fixed",
|
|
@@ -2044,7 +2050,7 @@ var hr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
2044
2050
|
if (!y) return;
|
|
2045
2051
|
let e = (e) => {
|
|
2046
2052
|
let t = e.target;
|
|
2047
|
-
C.current?.contains(t) || x.current?.contains(t) ||
|
|
2053
|
+
C.current?.contains(t) || x.current?.contains(t) || mr(S)?.contains(t) || b(!1);
|
|
2048
2054
|
};
|
|
2049
2055
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
2050
2056
|
}, [
|
|
@@ -2071,7 +2077,7 @@ var hr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
2071
2077
|
return () => cancelAnimationFrame(e);
|
|
2072
2078
|
}, [y, u]), !y) return null;
|
|
2073
2079
|
let A = /* @__PURE__ */ q("div", {
|
|
2074
|
-
ref:
|
|
2080
|
+
ref: Yt(v, C, n === "fixed" ? T : void 0),
|
|
2075
2081
|
role: "menu",
|
|
2076
2082
|
"data-test-id": h,
|
|
2077
2083
|
"data-side": n === "fixed" ? k : void 0,
|
|
@@ -2086,13 +2092,13 @@ var hr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
2086
2092
|
g?.(e), e.stopPropagation();
|
|
2087
2093
|
},
|
|
2088
2094
|
style: n === "fixed" ? O : void 0,
|
|
2089
|
-
className: Z(
|
|
2095
|
+
className: Z(yr, n === "absolute" && Z("absolute top-full mt-1", t === "end" ? "right-0" : "left-0"), d),
|
|
2090
2096
|
..._,
|
|
2091
2097
|
children: e
|
|
2092
2098
|
});
|
|
2093
|
-
return n === "fixed" ?
|
|
2094
|
-
}),
|
|
2095
|
-
let { setOpen: p } =
|
|
2099
|
+
return n === "fixed" ? ve(A, D ?? document.body) : A;
|
|
2100
|
+
}), xr = a(function({ children: e, onSelect: t, disabled: n, icon: r, shortcut: i, destructive: a, checked: o, meta: s, className: c, dataTestId: l, onClick: u, ...d }, f) {
|
|
2101
|
+
let { setOpen: p } = gr();
|
|
2096
2102
|
return /* @__PURE__ */ J("button", {
|
|
2097
2103
|
ref: f,
|
|
2098
2104
|
type: "button",
|
|
@@ -2129,14 +2135,14 @@ var hr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
2129
2135
|
})
|
|
2130
2136
|
]
|
|
2131
2137
|
});
|
|
2132
|
-
}),
|
|
2138
|
+
}), Sr = a(function({ className: e, dataTestId: t, ...n }, r) {
|
|
2133
2139
|
return /* @__PURE__ */ q("hr", {
|
|
2134
2140
|
ref: r,
|
|
2135
2141
|
"data-test-id": t,
|
|
2136
2142
|
className: Z("my-1 h-px border-0 bg-border-default", e),
|
|
2137
2143
|
...n
|
|
2138
2144
|
});
|
|
2139
|
-
}),
|
|
2145
|
+
}), Cr = a(function({ children: e, className: t, dataTestId: n, ...r }, i) {
|
|
2140
2146
|
return /* @__PURE__ */ q("div", {
|
|
2141
2147
|
ref: i,
|
|
2142
2148
|
"data-test-id": n,
|
|
@@ -2144,33 +2150,33 @@ var hr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
2144
2150
|
...r,
|
|
2145
2151
|
children: e
|
|
2146
2152
|
});
|
|
2147
|
-
}),
|
|
2153
|
+
}), wr = {
|
|
2148
2154
|
lg: "py-20 px-6 gap-2",
|
|
2149
2155
|
sm: "py-10 px-4 gap-1"
|
|
2150
|
-
},
|
|
2156
|
+
}, Tr = {
|
|
2151
2157
|
lg: "xl",
|
|
2152
2158
|
sm: "lg"
|
|
2153
|
-
},
|
|
2159
|
+
}, Er = a(function({ size: e = "lg", title: t, description: n, illustration: r, action: i, className: a, dataTestId: o, ...s }, c) {
|
|
2154
2160
|
return /* @__PURE__ */ J("div", {
|
|
2155
2161
|
ref: c,
|
|
2156
2162
|
"data-test-id": o,
|
|
2157
|
-
className: Z("flex flex-col items-center justify-center text-center",
|
|
2163
|
+
className: Z("flex flex-col items-center justify-center text-center", wr[e], a),
|
|
2158
2164
|
...s,
|
|
2159
2165
|
children: [
|
|
2160
|
-
r ?? /* @__PURE__ */ q(
|
|
2161
|
-
icon:
|
|
2166
|
+
r ?? /* @__PURE__ */ q(jn, {
|
|
2167
|
+
icon: ue,
|
|
2162
2168
|
tone: "gray",
|
|
2163
2169
|
shape: "circle",
|
|
2164
|
-
size:
|
|
2170
|
+
size: Tr[e]
|
|
2165
2171
|
}),
|
|
2166
|
-
t && /* @__PURE__ */ q(
|
|
2172
|
+
t && /* @__PURE__ */ q(In, {
|
|
2167
2173
|
as: "h3",
|
|
2168
2174
|
variant: e === "lg" ? "h-sm" : "h-xs",
|
|
2169
2175
|
weight: "semibold",
|
|
2170
2176
|
className: "mt-2",
|
|
2171
2177
|
children: t
|
|
2172
2178
|
}),
|
|
2173
|
-
n && /* @__PURE__ */ q(
|
|
2179
|
+
n && /* @__PURE__ */ q(In, {
|
|
2174
2180
|
variant: e === "lg" ? "p-sm" : "p-xs",
|
|
2175
2181
|
color: "secondary",
|
|
2176
2182
|
className: "max-w-sm",
|
|
@@ -2182,17 +2188,17 @@ var hr = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
2182
2188
|
})
|
|
2183
2189
|
]
|
|
2184
2190
|
});
|
|
2185
|
-
}),
|
|
2191
|
+
}), Dr = {
|
|
2186
2192
|
lg: "h-10 px-3 text-p-std gap-2",
|
|
2187
2193
|
md: "h-9 px-2.5 text-p-std gap-1.5",
|
|
2188
2194
|
sm: "h-8 px-2 text-p-sm gap-1.5"
|
|
2189
2195
|
};
|
|
2190
|
-
function
|
|
2196
|
+
function Or(...e) {
|
|
2191
2197
|
return (t) => {
|
|
2192
2198
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
2193
2199
|
};
|
|
2194
2200
|
}
|
|
2195
|
-
var
|
|
2201
|
+
var kr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabled: i, onClear: a, children: o, className: s, dataTestId: c, ...u }, d) {
|
|
2196
2202
|
let [f, h] = m(!1), g = p(null);
|
|
2197
2203
|
l(() => {
|
|
2198
2204
|
if (!f) return;
|
|
@@ -2203,7 +2209,7 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2203
2209
|
}, [f]);
|
|
2204
2210
|
let _ = n || t !== void 0;
|
|
2205
2211
|
return /* @__PURE__ */ J("div", {
|
|
2206
|
-
ref:
|
|
2212
|
+
ref: Or(d, g),
|
|
2207
2213
|
"data-test-id": c,
|
|
2208
2214
|
className: Z("relative inline-flex", s),
|
|
2209
2215
|
...u,
|
|
@@ -2213,7 +2219,7 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2213
2219
|
onClick: () => h((e) => !e),
|
|
2214
2220
|
"aria-haspopup": "dialog",
|
|
2215
2221
|
"aria-expanded": f,
|
|
2216
|
-
className: Z("inline-flex items-center rounded-full border transition-colors outline-none",
|
|
2222
|
+
className: Z("inline-flex items-center rounded-full border transition-colors outline-none", Dr[r], _ ? "bg-brand-20 text-brand-800 border-brand-500" : "bg-bg-default text-fg-default border-border-default", !i && "hover:border-border-strong", "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", i && "bg-bg-container text-fg-disabled cursor-not-allowed"),
|
|
2217
2223
|
children: [
|
|
2218
2224
|
/* @__PURE__ */ q("span", {
|
|
2219
2225
|
className: "font-medium",
|
|
@@ -2249,21 +2255,21 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2249
2255
|
children: o
|
|
2250
2256
|
})]
|
|
2251
2257
|
});
|
|
2252
|
-
}),
|
|
2253
|
-
let { handleSubmit: h, register: g, setValue: _, control: v, formState: y, getValues: b, watch: x, reset: S, clearErrors: C, setError: w, trigger: T, getFieldState: E, unregister: D } =
|
|
2258
|
+
}), Ar = a(function({ children: e, className: t, validationSchema: n, defaultValues: r, buttons: i, mode: a = "onBlur", shouldUnregister: o, shouldFocusError: s = !0, formId: c, onSubmit: u, revalidateKey: d, dataTestId: f, ...p }, m) {
|
|
2259
|
+
let { handleSubmit: h, register: g, setValue: _, control: v, formState: y, getValues: b, watch: x, reset: S, clearErrors: C, setError: w, trigger: T, getFieldState: E, unregister: D } = xe({
|
|
2254
2260
|
mode: a,
|
|
2255
|
-
resolver:
|
|
2261
|
+
resolver: Se(n),
|
|
2256
2262
|
defaultValues: r,
|
|
2257
2263
|
shouldFocusError: s,
|
|
2258
2264
|
shouldUnregister: o
|
|
2259
|
-
}), { errors: O, isDirty: k, isSubmitted: A, isSubmitting: j, dirtyFields: M, isValid:
|
|
2265
|
+
}), { errors: O, isDirty: k, isSubmitted: A, isSubmitting: j, dirtyFields: M, isValid: N } = y;
|
|
2260
2266
|
l(() => {
|
|
2261
2267
|
let e = Object.keys(O).filter((e) => e !== "root" && e !== "form");
|
|
2262
2268
|
e.length > 0 && T(e);
|
|
2263
2269
|
}, [d]);
|
|
2264
|
-
let
|
|
2270
|
+
let ee = h((e) => {
|
|
2265
2271
|
u?.(e, y, M);
|
|
2266
|
-
}),
|
|
2272
|
+
}), te = {
|
|
2267
2273
|
control: v,
|
|
2268
2274
|
register: g,
|
|
2269
2275
|
errors: O,
|
|
@@ -2279,35 +2285,35 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2279
2285
|
isDirty: k,
|
|
2280
2286
|
isSubmitted: A,
|
|
2281
2287
|
isSubmitting: j,
|
|
2282
|
-
isValid:
|
|
2288
|
+
isValid: N,
|
|
2283
2289
|
dirtyFields: M,
|
|
2284
|
-
submit:
|
|
2290
|
+
submit: ee
|
|
2285
2291
|
};
|
|
2286
2292
|
return /* @__PURE__ */ q("form", {
|
|
2287
2293
|
ref: m,
|
|
2288
2294
|
id: c,
|
|
2289
|
-
onSubmit:
|
|
2295
|
+
onSubmit: ee,
|
|
2290
2296
|
"data-test-id": f,
|
|
2291
2297
|
className: Z("flex flex-col gap-4", t),
|
|
2292
2298
|
...p,
|
|
2293
|
-
children: /* @__PURE__ */ J(
|
|
2294
|
-
value:
|
|
2299
|
+
children: /* @__PURE__ */ J(ir.Provider, {
|
|
2300
|
+
value: te,
|
|
2295
2301
|
children: [e, i && i.length > 0 && /* @__PURE__ */ q("div", {
|
|
2296
2302
|
className: "flex items-center gap-3",
|
|
2297
2303
|
"data-test-id": f ? `${f}-buttons` : void 0,
|
|
2298
|
-
children: i.map((e, t) => /* @__PURE__ */ q(
|
|
2304
|
+
children: i.map((e, t) => /* @__PURE__ */ q(ut, { ...e }, t))
|
|
2299
2305
|
})]
|
|
2300
2306
|
})
|
|
2301
2307
|
});
|
|
2302
|
-
}),
|
|
2303
|
-
let s = c(
|
|
2308
|
+
}), jr = a(function({ name: e, defaultValue: t, render: n, className: r, dataTestId: i, ...a }, o) {
|
|
2309
|
+
let s = c(ir);
|
|
2304
2310
|
if (!s) throw Error("FormField must be rendered inside a FormContainer.");
|
|
2305
2311
|
return /* @__PURE__ */ q("div", {
|
|
2306
2312
|
ref: o,
|
|
2307
2313
|
className: Z(r),
|
|
2308
2314
|
"data-test-id": i,
|
|
2309
2315
|
...a,
|
|
2310
|
-
children: /* @__PURE__ */ q(
|
|
2316
|
+
children: /* @__PURE__ */ q(ye, {
|
|
2311
2317
|
control: s.control,
|
|
2312
2318
|
name: e,
|
|
2313
2319
|
defaultValue: t,
|
|
@@ -2326,14 +2332,14 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2326
2332
|
})
|
|
2327
2333
|
})
|
|
2328
2334
|
});
|
|
2329
|
-
}),
|
|
2335
|
+
}), Mr = a(function({ icon: e, iconTone: t = "brand", label: n, value: r, action: i, className: a, dataTestId: o, ...s }, c) {
|
|
2330
2336
|
return /* @__PURE__ */ J("div", {
|
|
2331
2337
|
ref: c,
|
|
2332
2338
|
"data-test-id": o,
|
|
2333
2339
|
className: Z("flex items-start gap-3", a),
|
|
2334
2340
|
...s,
|
|
2335
2341
|
children: [
|
|
2336
|
-
/* @__PURE__ */ q(
|
|
2342
|
+
/* @__PURE__ */ q(jn, {
|
|
2337
2343
|
icon: e,
|
|
2338
2344
|
tone: t,
|
|
2339
2345
|
size: "md"
|
|
@@ -2354,7 +2360,7 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2354
2360
|
})
|
|
2355
2361
|
]
|
|
2356
2362
|
});
|
|
2357
|
-
}),
|
|
2363
|
+
}), Nr = {
|
|
2358
2364
|
success: {
|
|
2359
2365
|
container: "bg-green-50 border-green-200",
|
|
2360
2366
|
iconColor: "text-green-600",
|
|
@@ -2373,15 +2379,15 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2373
2379
|
info: {
|
|
2374
2380
|
container: "bg-blue-50 border-blue-200",
|
|
2375
2381
|
iconColor: "text-blue-700",
|
|
2376
|
-
DefaultIcon:
|
|
2382
|
+
DefaultIcon: P
|
|
2377
2383
|
},
|
|
2378
2384
|
discovery: {
|
|
2379
2385
|
container: "bg-purple-50 border-purple-200",
|
|
2380
2386
|
iconColor: "text-purple-700",
|
|
2381
|
-
DefaultIcon:
|
|
2387
|
+
DefaultIcon: fe
|
|
2382
2388
|
}
|
|
2383
|
-
},
|
|
2384
|
-
let { container: u, iconColor: d, DefaultIcon: f } =
|
|
2389
|
+
}, Pr = a(function({ variant: e = "info", title: t, description: n, onDismiss: r, actions: i, icon: a, className: o, dataTestId: s, ...c }, l) {
|
|
2390
|
+
let { container: u, iconColor: d, DefaultIcon: f } = Nr[e];
|
|
2385
2391
|
return /* @__PURE__ */ J("div", {
|
|
2386
2392
|
ref: l,
|
|
2387
2393
|
role: "alert",
|
|
@@ -2422,13 +2428,13 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2422
2428
|
})
|
|
2423
2429
|
]
|
|
2424
2430
|
});
|
|
2425
|
-
}),
|
|
2431
|
+
}), Fr = a(function({ variant: e = "p-std", weight: t, color: n = "brand", underline: r = "hover", leftIcon: i, rightIcon: a, truncate: o, className: s, children: c, dataTestId: l, target: u, rel: d, ...f }, p) {
|
|
2426
2432
|
let m = {
|
|
2427
2433
|
...f,
|
|
2428
2434
|
target: u,
|
|
2429
2435
|
rel: d ?? (u === "_blank" ? "noopener noreferrer" : void 0)
|
|
2430
2436
|
};
|
|
2431
|
-
return /* @__PURE__ */ J(
|
|
2437
|
+
return /* @__PURE__ */ J(In, {
|
|
2432
2438
|
as: "a",
|
|
2433
2439
|
ref: p,
|
|
2434
2440
|
variant: e,
|
|
@@ -2450,15 +2456,15 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2450
2456
|
})
|
|
2451
2457
|
]
|
|
2452
2458
|
});
|
|
2453
|
-
}),
|
|
2459
|
+
}), Ir = {
|
|
2454
2460
|
sm: "max-w-sm",
|
|
2455
2461
|
md: "max-w-md",
|
|
2456
2462
|
lg: "max-w-lg",
|
|
2457
2463
|
xl: "max-w-2xl",
|
|
2458
2464
|
"2xl": "max-w-4xl"
|
|
2459
|
-
},
|
|
2465
|
+
}, Lr = a(function({ open: e, onClose: t, title: n, description: r, children: i, footer: a, size: o = "md", closeOnOverlayClick: s = !0, showClose: c = !0, className: u, dataTestId: d }, f) {
|
|
2460
2466
|
let h = p(null), [g, _] = m(null), v = p(null);
|
|
2461
|
-
if (
|
|
2467
|
+
if (tr(e), l(() => {
|
|
2462
2468
|
let t = h.current;
|
|
2463
2469
|
if (!(!e || !t || t.open)) return t.showModal(), v.current?.focus(), () => {
|
|
2464
2470
|
t.open && t.close();
|
|
@@ -2469,7 +2475,7 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2469
2475
|
return v.current?.focus(), () => t?.focus?.();
|
|
2470
2476
|
}, [e]), !e) return null;
|
|
2471
2477
|
let y = /* @__PURE__ */ J("dialog", {
|
|
2472
|
-
ref:
|
|
2478
|
+
ref: Yt(h, _),
|
|
2473
2479
|
onCancel: (e) => {
|
|
2474
2480
|
e.preventDefault(), t();
|
|
2475
2481
|
},
|
|
@@ -2481,10 +2487,10 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2481
2487
|
onClick: () => s && t(),
|
|
2482
2488
|
"aria-hidden": !0
|
|
2483
2489
|
}), /* @__PURE__ */ J("div", {
|
|
2484
|
-
ref:
|
|
2490
|
+
ref: Yt(v, f),
|
|
2485
2491
|
tabIndex: -1,
|
|
2486
2492
|
"data-test-id": d,
|
|
2487
|
-
className: Z("relative w-full bg-bg-default rounded-xl shadow-z5 outline-none flex flex-col max-h-[90vh]",
|
|
2493
|
+
className: Z("relative w-full bg-bg-default rounded-xl shadow-z5 outline-none flex flex-col max-h-[90vh]", Ir[o], u),
|
|
2488
2494
|
children: [
|
|
2489
2495
|
(n || c) && /* @__PURE__ */ J("div", {
|
|
2490
2496
|
className: "flex items-start justify-between gap-4 px-6 pt-6 pb-4",
|
|
@@ -2519,33 +2525,33 @@ var Tr = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
2519
2525
|
]
|
|
2520
2526
|
})]
|
|
2521
2527
|
});
|
|
2522
|
-
return
|
|
2528
|
+
return ve(/* @__PURE__ */ q(Xt.Provider, {
|
|
2523
2529
|
value: g,
|
|
2524
2530
|
children: y
|
|
2525
2531
|
}), document.body);
|
|
2526
|
-
}),
|
|
2532
|
+
}), Rr = {
|
|
2527
2533
|
brand: "bg-brand-500 text-white",
|
|
2528
2534
|
danger: "bg-red-600 text-white",
|
|
2529
2535
|
success: "bg-green-600 text-white",
|
|
2530
2536
|
warning: "bg-yellow-600 text-gray-900 dark:text-gray-900",
|
|
2531
2537
|
info: "bg-blue-600 text-white"
|
|
2532
|
-
},
|
|
2538
|
+
}, zr = {
|
|
2533
2539
|
lg: "min-w-[18px] h-[18px] px-1 text-[11px]",
|
|
2534
2540
|
sm: "min-w-[14px] h-[14px] px-0.5 text-[10px]"
|
|
2535
|
-
},
|
|
2541
|
+
}, Br = {
|
|
2536
2542
|
lg: "h-2.5 w-2.5",
|
|
2537
2543
|
sm: "h-1.5 w-1.5"
|
|
2538
2544
|
};
|
|
2539
|
-
function
|
|
2545
|
+
function Vr(e, t) {
|
|
2540
2546
|
return e > t ? `${t}+` : e >= 1e3 ? `${(e / 1e3).toFixed(0)}K` : String(e);
|
|
2541
2547
|
}
|
|
2542
|
-
var
|
|
2548
|
+
var Hr = a(function({ count: e = 0, max: t = 99, kind: n = "count", size: r = "lg", variant: i = "danger", children: a, showZero: o = !1, className: s, dataTestId: c, ...l }, u) {
|
|
2543
2549
|
let d = n === "dot" || e > 0 || o, f = a != null && a !== !1, p = d ? /* @__PURE__ */ q("span", {
|
|
2544
2550
|
ref: u,
|
|
2545
2551
|
"data-test-id": c,
|
|
2546
|
-
className: Z("inline-flex items-center justify-center rounded-full font-semibold ring-2 ring-white",
|
|
2552
|
+
className: Z("inline-flex items-center justify-center rounded-full font-semibold ring-2 ring-white", Rr[i], n === "count" ? zr[r] : Br[r], f ? "absolute -top-1 -right-1" : "static", s),
|
|
2547
2553
|
...l,
|
|
2548
|
-
children: n === "count" &&
|
|
2554
|
+
children: n === "count" && Vr(e, t)
|
|
2549
2555
|
}) : null;
|
|
2550
2556
|
return f ? /* @__PURE__ */ J("span", {
|
|
2551
2557
|
className: "relative inline-flex",
|
|
@@ -2554,7 +2560,7 @@ var Rr = a(function({ count: e = 0, max: t = 99, kind: n = "count", size: r = "l
|
|
|
2554
2560
|
});
|
|
2555
2561
|
//#endregion
|
|
2556
2562
|
//#region src/components/Pagination/Pagination.tsx
|
|
2557
|
-
function
|
|
2563
|
+
function Ur(e, t, n, r) {
|
|
2558
2564
|
if (t <= n * 2 + 3 + r * 2) return Array.from({ length: t }, (e, t) => t + 1);
|
|
2559
2565
|
let i = Math.max(e - n, r + 2), a = Math.min(e + n, t - r - 1), o = i > r + 2, s = a < t - r - 1, c = Array.from({ length: r }, (e, t) => t + 1), l = Array.from({ length: r }, (e, n) => t - r + 1 + n), u = [];
|
|
2560
2566
|
if (o) {
|
|
@@ -2569,8 +2575,8 @@ function zr(e, t, n, r) {
|
|
|
2569
2575
|
...l
|
|
2570
2576
|
];
|
|
2571
2577
|
}
|
|
2572
|
-
var
|
|
2573
|
-
let u =
|
|
2578
|
+
var Wr = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300", Gr = "text-fg-default hover:bg-bg-subtle disabled:text-fg-disabled disabled:hover:bg-transparent disabled:cursor-not-allowed", Kr = a(function({ page: e, pageCount: t, onPageChange: n, siblingCount: r = 1, boundaryCount: i = 1, className: a, dataTestId: o, "aria-label": s, ...c }, l) {
|
|
2579
|
+
let u = Ur(e, t, r, i), d = e <= 1, f = e >= t, p = Q(o);
|
|
2574
2580
|
return /* @__PURE__ */ J("nav", {
|
|
2575
2581
|
ref: l,
|
|
2576
2582
|
"aria-label": s ?? "Pagination",
|
|
@@ -2584,7 +2590,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2584
2590
|
disabled: d,
|
|
2585
2591
|
"data-test-id": p("pagination-prev-page"),
|
|
2586
2592
|
"aria-label": "Previous page",
|
|
2587
|
-
className: Z(
|
|
2593
|
+
className: Z(Wr, Gr),
|
|
2588
2594
|
children: /* @__PURE__ */ q(C, { className: "h-4 w-4" })
|
|
2589
2595
|
}),
|
|
2590
2596
|
u.map((t, r) => {
|
|
@@ -2600,7 +2606,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2600
2606
|
"aria-current": i ? "page" : void 0,
|
|
2601
2607
|
"data-test-id": p("pagination-page-link"),
|
|
2602
2608
|
"data-page": t,
|
|
2603
|
-
className: Z(
|
|
2609
|
+
className: Z(Wr, i ? "bg-brand-500 text-white font-semibold hover:bg-brand-600" : "text-fg-default hover:bg-bg-subtle"),
|
|
2604
2610
|
children: t
|
|
2605
2611
|
}, t);
|
|
2606
2612
|
}),
|
|
@@ -2610,12 +2616,12 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2610
2616
|
disabled: f,
|
|
2611
2617
|
"aria-label": "Next page",
|
|
2612
2618
|
"data-test-id": p("pagination-next-page"),
|
|
2613
|
-
className: Z(
|
|
2619
|
+
className: Z(Wr, Gr),
|
|
2614
2620
|
children: /* @__PURE__ */ q(w, { className: "h-4 w-4" })
|
|
2615
2621
|
})
|
|
2616
2622
|
]
|
|
2617
2623
|
});
|
|
2618
|
-
}),
|
|
2624
|
+
}), qr = {
|
|
2619
2625
|
sm: {
|
|
2620
2626
|
padding: "px-3 py-2",
|
|
2621
2627
|
avatar: "sm",
|
|
@@ -2626,13 +2632,13 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2626
2632
|
avatar: "md",
|
|
2627
2633
|
gap: "gap-3"
|
|
2628
2634
|
}
|
|
2629
|
-
},
|
|
2635
|
+
}, Jr = {
|
|
2630
2636
|
default: "border-border-default bg-bg-default hover:border-fg-tertiary/40",
|
|
2631
2637
|
highlight: "border-brand-500 bg-brand-200/15 dark:bg-brand-500/10 ring-1 ring-brand-500/40",
|
|
2632
2638
|
warning: "border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20"
|
|
2633
|
-
},
|
|
2634
|
-
let d =
|
|
2635
|
-
/* @__PURE__ */ q(
|
|
2639
|
+
}, Yr = a(function({ name: e, role: t, avatar: n, variant: r = "default", size: i = "md", badge: a, onClick: o, className: s, dataTestId: c, ...l }, u) {
|
|
2640
|
+
let d = qr[i], f = Jr[r], p = /* @__PURE__ */ J(K, { children: [
|
|
2641
|
+
/* @__PURE__ */ q(Tt, {
|
|
2636
2642
|
src: n,
|
|
2637
2643
|
name: e,
|
|
2638
2644
|
size: d.avatar
|
|
@@ -2667,22 +2673,22 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2667
2673
|
...l,
|
|
2668
2674
|
children: p
|
|
2669
2675
|
});
|
|
2670
|
-
}),
|
|
2676
|
+
}), Xr = {
|
|
2671
2677
|
sm: 29,
|
|
2672
2678
|
lg: 45
|
|
2673
|
-
},
|
|
2679
|
+
}, Zr = {
|
|
2674
2680
|
sm: 2,
|
|
2675
2681
|
lg: 4
|
|
2676
|
-
},
|
|
2682
|
+
}, Qr = {
|
|
2677
2683
|
sm: "h-1",
|
|
2678
2684
|
lg: "h-2"
|
|
2679
|
-
},
|
|
2685
|
+
}, $r = {
|
|
2680
2686
|
sm: "text-p-xs",
|
|
2681
2687
|
lg: "text-p-sm"
|
|
2682
|
-
},
|
|
2688
|
+
}, ei = a(function({ variant: e = "linear", size: t = "lg", percent: n = 0, stepCount: r, currentStep: i, hideLabel: a = !1, dimension: o, loop: s = !1, className: c, dataTestId: l, ...u }, d) {
|
|
2683
2689
|
let f = r && i ? i / r * 100 : n, p = Math.min(100, Math.max(0, f)), m = r ? `${i}/${r}` : `${Math.round(p)}%`;
|
|
2684
2690
|
if (e === "circular") {
|
|
2685
|
-
let e = o ??
|
|
2691
|
+
let e = o ?? Xr[t], n = e - 5, r = 2 * n * Math.PI, i = Zr[t];
|
|
2686
2692
|
return /* @__PURE__ */ J("div", {
|
|
2687
2693
|
ref: d,
|
|
2688
2694
|
role: "progressbar",
|
|
@@ -2721,7 +2727,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2721
2727
|
}
|
|
2722
2728
|
})]
|
|
2723
2729
|
}), !a && !s && /* @__PURE__ */ q("span", {
|
|
2724
|
-
className: Z("absolute text-fg-secondary",
|
|
2730
|
+
className: Z("absolute text-fg-secondary", $r[t]),
|
|
2725
2731
|
"data-test-id": l ? `${l}-text` : void 0,
|
|
2726
2732
|
children: m
|
|
2727
2733
|
})]
|
|
@@ -2738,18 +2744,18 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2738
2744
|
className: Z("flex w-full items-center gap-2", c),
|
|
2739
2745
|
...u,
|
|
2740
2746
|
children: [/* @__PURE__ */ q("div", {
|
|
2741
|
-
className: Z("w-full overflow-hidden rounded-full bg-bg-subtle",
|
|
2747
|
+
className: Z("w-full overflow-hidden rounded-full bg-bg-subtle", Qr[t]),
|
|
2742
2748
|
children: /* @__PURE__ */ q("div", {
|
|
2743
2749
|
className: "h-full rounded-full bg-brand-500 transition-all duration-300 ease-linear",
|
|
2744
2750
|
style: { width: `${p}%` }
|
|
2745
2751
|
})
|
|
2746
2752
|
}), !a && /* @__PURE__ */ q("span", {
|
|
2747
|
-
className: Z("shrink-0 text-fg-secondary",
|
|
2753
|
+
className: Z("shrink-0 text-fg-secondary", $r[t]),
|
|
2748
2754
|
"data-test-id": l ? `${l}-text` : void 0,
|
|
2749
2755
|
children: m
|
|
2750
2756
|
})]
|
|
2751
2757
|
});
|
|
2752
|
-
}),
|
|
2758
|
+
}), ti = r(null), ni = a(function({ name: e, label: t, value: n, defaultValue: r, onChange: i, disabled: a, required: o, error: s, errorText: c, helperText: l, size: d = "md", orientation: f = "vertical", children: p, className: m, wrapperClassName: h, dataTestId: g }, _) {
|
|
2753
2759
|
let v = u(), y = e ?? v, b = `${v}-label`, x = s || !!c, S = c ? `${v}-error` : l ? `${v}-help` : void 0, C = /* @__PURE__ */ q("div", {
|
|
2754
2760
|
ref: _,
|
|
2755
2761
|
role: "radiogroup",
|
|
@@ -2761,7 +2767,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2761
2767
|
className: Z("flex gap-3", f === "vertical" ? "flex-col" : "flex-row flex-wrap items-center gap-4", m),
|
|
2762
2768
|
children: p
|
|
2763
2769
|
});
|
|
2764
|
-
return /* @__PURE__ */ q(
|
|
2770
|
+
return /* @__PURE__ */ q(ti.Provider, {
|
|
2765
2771
|
value: {
|
|
2766
2772
|
name: y,
|
|
2767
2773
|
value: n,
|
|
@@ -2777,7 +2783,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2777
2783
|
t && /* @__PURE__ */ J("span", {
|
|
2778
2784
|
id: b,
|
|
2779
2785
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
2780
|
-
children: [t, o && /* @__PURE__ */ q(
|
|
2786
|
+
children: [t, o && /* @__PURE__ */ q(at, {})]
|
|
2781
2787
|
}),
|
|
2782
2788
|
C,
|
|
2783
2789
|
c ? /* @__PURE__ */ q("p", {
|
|
@@ -2792,14 +2798,14 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2792
2798
|
]
|
|
2793
2799
|
}) : C
|
|
2794
2800
|
});
|
|
2795
|
-
}),
|
|
2801
|
+
}), ri = {
|
|
2796
2802
|
md: "h-5 w-5",
|
|
2797
2803
|
sm: "h-4 w-4"
|
|
2798
|
-
},
|
|
2804
|
+
}, ii = {
|
|
2799
2805
|
md: "h-2 w-2",
|
|
2800
2806
|
sm: "h-1.5 w-1.5"
|
|
2801
|
-
},
|
|
2802
|
-
let g = c(
|
|
2807
|
+
}, ai = a(function({ value: e, size: t, label: n, description: r, error: i = !1, id: a, disabled: o, checked: s, defaultChecked: l, onChange: d, className: f, dataTestId: p, ...m }, h) {
|
|
2808
|
+
let g = c(ti), _ = u(), v = a ?? _, y = t ?? g?.size ?? "md", b = o ?? g?.disabled, x = i || !!g?.error, S = g !== null, C = S && g.value !== void 0 ? Qe(g.value, e) : void 0, w = S && g.defaultValue !== void 0 ? Qe(g.defaultValue, e) : void 0, T = S ? C : s, E = S ? w : l;
|
|
2803
2809
|
return /* @__PURE__ */ J("label", {
|
|
2804
2810
|
htmlFor: v,
|
|
2805
2811
|
"data-test-id": p,
|
|
@@ -2822,8 +2828,8 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2822
2828
|
"aria-invalid": x || void 0,
|
|
2823
2829
|
...m
|
|
2824
2830
|
}), /* @__PURE__ */ q("span", {
|
|
2825
|
-
className: Z("flex items-center justify-center rounded-full border bg-bg-default transition-colors",
|
|
2826
|
-
children: /* @__PURE__ */ q("span", { className: Z("rounded-full bg-brand-500 transition-opacity",
|
|
2831
|
+
className: Z("flex items-center justify-center rounded-full border bg-bg-default transition-colors", ri[y], x ? "border-red-600" : "border-border-strong", !b && !x && "peer-hover:border-fg-tertiary", "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1", "peer-checked:border-brand-500", b && "!bg-bg-subtle !border-border-default", "[&>span]:opacity-0 peer-checked:[&>span]:opacity-100"),
|
|
2832
|
+
children: /* @__PURE__ */ q("span", { className: Z("rounded-full bg-brand-500 transition-opacity", ii[y], b && "!bg-fg-disabled") })
|
|
2827
2833
|
})]
|
|
2828
2834
|
}), (n || r) && /* @__PURE__ */ J("span", {
|
|
2829
2835
|
className: "flex flex-col gap-0.5",
|
|
@@ -2836,7 +2842,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2836
2842
|
})]
|
|
2837
2843
|
})]
|
|
2838
2844
|
});
|
|
2839
|
-
}),
|
|
2845
|
+
}), oi = a(function({ children: e, clamp: t = 3, collapsedContent: n, expandLabel: r = "Show more", collapseLabel: i = "Show less", defaultExpanded: a = !1, expanded: o, onExpandedChange: s, textProps: c, className: l, dataTestId: d, ...f }, p) {
|
|
2840
2846
|
let [h, g] = m(a), _ = o !== void 0, v = _ ? o : h, y = u(), b = () => {
|
|
2841
2847
|
let e = !v;
|
|
2842
2848
|
_ || g(e), s?.(e);
|
|
@@ -2846,7 +2852,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2846
2852
|
"data-test-id": d,
|
|
2847
2853
|
className: Z("flex flex-col gap-1", l),
|
|
2848
2854
|
...f,
|
|
2849
|
-
children: [/* @__PURE__ */ q(
|
|
2855
|
+
children: [/* @__PURE__ */ q(In, {
|
|
2850
2856
|
id: y,
|
|
2851
2857
|
clamp: v ? void 0 : t,
|
|
2852
2858
|
...c,
|
|
@@ -2865,7 +2871,7 @@ var Br = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2865
2871
|
});
|
|
2866
2872
|
//#endregion
|
|
2867
2873
|
//#region src/components/SelectV2/useVisibleTagCount.ts
|
|
2868
|
-
function
|
|
2874
|
+
function si({ wrapperRef: e, measureRef: t, total: n, labelsKey: r, enabled: i }) {
|
|
2869
2875
|
let [a, o] = m(n);
|
|
2870
2876
|
return d(() => {
|
|
2871
2877
|
if (!i) return;
|
|
@@ -2909,7 +2915,7 @@ function ri({ wrapperRef: e, measureRef: t, total: n, labelsKey: r, enabled: i }
|
|
|
2909
2915
|
}
|
|
2910
2916
|
//#endregion
|
|
2911
2917
|
//#region src/components/SelectV2/SelectV2.i18n.ts
|
|
2912
|
-
var
|
|
2918
|
+
var ci = {
|
|
2913
2919
|
"en-US": {
|
|
2914
2920
|
placeholder: "Select…",
|
|
2915
2921
|
noResults: "No results",
|
|
@@ -2937,23 +2943,23 @@ var ii = {
|
|
|
2937
2943
|
createLabel: (e) => `Ստեղծել «${e}»`,
|
|
2938
2944
|
saveSelectionLabel: "Պահպանել ձևանմուշը"
|
|
2939
2945
|
}
|
|
2940
|
-
},
|
|
2946
|
+
}, li = {
|
|
2941
2947
|
lg: "min-h-12 text-p-md",
|
|
2942
2948
|
md: "min-h-10 text-p-std",
|
|
2943
2949
|
sm: "min-h-8 text-p-sm"
|
|
2944
|
-
},
|
|
2950
|
+
}, ui = {
|
|
2945
2951
|
lg: "px-3.5 py-1.5",
|
|
2946
2952
|
md: "px-3 py-1",
|
|
2947
2953
|
sm: "px-2.5 py-0.5"
|
|
2948
|
-
},
|
|
2949
|
-
function
|
|
2954
|
+
}, di = "flex items-center gap-1 rounded-md bg-bg-subtle pl-2 pr-1 py-0.5 max-w-full", fi = "truncate text-p-sm text-fg-default", pi = "rounded-sm text-fg-secondary hover:bg-bg-container hover:text-fg-default cursor-pointer", mi = "flex items-center rounded-md bg-bg-info-lighter px-2 py-0.5 text-p-sm text-blue-800 dark:text-blue-300 shrink-0";
|
|
2955
|
+
function hi(e) {
|
|
2950
2956
|
return e.searchText ?? (typeof e.label == "string" ? e.label : String(e.value));
|
|
2951
2957
|
}
|
|
2952
|
-
function
|
|
2958
|
+
function gi(e, t) {
|
|
2953
2959
|
let n = t.trim().toLowerCase();
|
|
2954
|
-
return !n || `${
|
|
2960
|
+
return !n || `${hi(e)} ${String(e.value)}`.toLowerCase().includes(n);
|
|
2955
2961
|
}
|
|
2956
|
-
function
|
|
2962
|
+
function _i(e) {
|
|
2957
2963
|
try {
|
|
2958
2964
|
let t = window.localStorage.getItem(e);
|
|
2959
2965
|
return t === null ? void 0 : JSON.parse(t);
|
|
@@ -2961,34 +2967,34 @@ function pi(e) {
|
|
|
2961
2967
|
return;
|
|
2962
2968
|
}
|
|
2963
2969
|
}
|
|
2964
|
-
function
|
|
2970
|
+
function vi(e) {
|
|
2965
2971
|
try {
|
|
2966
2972
|
return window.localStorage.getItem(e) !== null;
|
|
2967
2973
|
} catch {
|
|
2968
2974
|
return !1;
|
|
2969
2975
|
}
|
|
2970
2976
|
}
|
|
2971
|
-
function
|
|
2977
|
+
function yi(e, t) {
|
|
2972
2978
|
try {
|
|
2973
2979
|
window.localStorage.setItem(e, JSON.stringify(t));
|
|
2974
2980
|
} catch {}
|
|
2975
2981
|
}
|
|
2976
|
-
function
|
|
2982
|
+
function bi(e) {
|
|
2977
2983
|
try {
|
|
2978
2984
|
window.localStorage.removeItem(e);
|
|
2979
2985
|
} catch {}
|
|
2980
2986
|
}
|
|
2981
|
-
function
|
|
2987
|
+
function xi(e, t, n) {
|
|
2982
2988
|
return {
|
|
2983
2989
|
container: () => "w-full",
|
|
2984
|
-
control: ({ isFocused: n, isDisabled: r }) => Z("flex items-center rounded-lg border bg-bg-default transition-colors", r ? "cursor-not-allowed" : "cursor-text",
|
|
2985
|
-
valueContainer: () => Z("flex flex-1 items-center gap-1 min-w-0 sv2-value-container", n ? "flex-nowrap! overflow-hidden" : "flex-wrap",
|
|
2990
|
+
control: ({ isFocused: n, isDisabled: r }) => Z("flex items-center rounded-lg border bg-bg-default transition-colors", r ? "cursor-not-allowed" : "cursor-text", li[e], t ? "border-red-600" : "border-border-default", !r && !t && "hover:border-border-strong", n && !t && "ring-2 ring-brand-300 border-brand-500", n && t && "ring-2 ring-red-300 border-red-600", r && "bg-bg-container border-border-default"),
|
|
2991
|
+
valueContainer: () => Z("flex flex-1 items-center gap-1 min-w-0 sv2-value-container", n ? "flex-nowrap! overflow-hidden" : "flex-wrap", ui[e]),
|
|
2986
2992
|
placeholder: () => "text-fg-tertiary truncate",
|
|
2987
2993
|
singleValue: () => "text-fg-default truncate min-w-0",
|
|
2988
2994
|
input: () => "text-fg-default",
|
|
2989
|
-
multiValue: () =>
|
|
2990
|
-
multiValueLabel: () =>
|
|
2991
|
-
multiValueRemove: () =>
|
|
2995
|
+
multiValue: () => di,
|
|
2996
|
+
multiValueLabel: () => fi,
|
|
2997
|
+
multiValueRemove: () => pi,
|
|
2992
2998
|
indicatorsContainer: () => "flex items-center gap-1 pr-2 shrink-0",
|
|
2993
2999
|
clearIndicator: () => "text-fg-secondary hover:text-fg-default cursor-pointer p-0.5",
|
|
2994
3000
|
dropdownIndicator: () => "text-fg-secondary p-0.5",
|
|
@@ -3005,55 +3011,56 @@ function _i(e, t, n) {
|
|
|
3005
3011
|
}
|
|
3006
3012
|
//#endregion
|
|
3007
3013
|
//#region src/components/SelectV2/SelectV2.tsx
|
|
3008
|
-
var
|
|
3009
|
-
function
|
|
3014
|
+
var Si = 36;
|
|
3015
|
+
function Ci(e, t) {
|
|
3010
3016
|
let { dataTestId: n } = e;
|
|
3011
|
-
return
|
|
3017
|
+
return Q(n)(t);
|
|
3012
3018
|
}
|
|
3013
|
-
function
|
|
3019
|
+
function wi(e, t) {
|
|
3014
3020
|
return {
|
|
3015
3021
|
...e,
|
|
3016
3022
|
"data-test-id": t
|
|
3017
3023
|
};
|
|
3018
3024
|
}
|
|
3019
|
-
function
|
|
3020
|
-
return /* @__PURE__ */ q(
|
|
3025
|
+
function Ti(e) {
|
|
3026
|
+
return /* @__PURE__ */ q(we.Control, {
|
|
3021
3027
|
...e,
|
|
3022
|
-
innerProps:
|
|
3028
|
+
innerProps: wi(e.innerProps, Ci(e.selectProps, "trigger"))
|
|
3023
3029
|
});
|
|
3024
3030
|
}
|
|
3025
|
-
function
|
|
3026
|
-
let t = { "data-test-id":
|
|
3027
|
-
return /* @__PURE__ */ q(
|
|
3031
|
+
function Ei(e) {
|
|
3032
|
+
let t = { "data-test-id": Ci(e.selectProps, "search") };
|
|
3033
|
+
return /* @__PURE__ */ q(we.Input, {
|
|
3028
3034
|
...e,
|
|
3029
3035
|
...t
|
|
3030
3036
|
});
|
|
3031
3037
|
}
|
|
3032
|
-
function
|
|
3033
|
-
|
|
3038
|
+
function Di(e) {
|
|
3039
|
+
let { dropdownIcon: t } = e.selectProps;
|
|
3040
|
+
return /* @__PURE__ */ q(we.DropdownIndicator, {
|
|
3034
3041
|
...e,
|
|
3035
|
-
children: /* @__PURE__ */ q(S, {
|
|
3042
|
+
children: t ?? /* @__PURE__ */ q(S, {
|
|
3036
3043
|
className: Z("h-4 w-4 transition-transform", e.selectProps.menuIsOpen && "rotate-180"),
|
|
3037
3044
|
"aria-hidden": !0
|
|
3038
3045
|
})
|
|
3039
3046
|
});
|
|
3040
3047
|
}
|
|
3041
|
-
function
|
|
3042
|
-
return /* @__PURE__ */ q(
|
|
3048
|
+
function Oi(e) {
|
|
3049
|
+
return /* @__PURE__ */ q(we.ClearIndicator, {
|
|
3043
3050
|
...e,
|
|
3044
|
-
innerProps:
|
|
3051
|
+
innerProps: wi(e.innerProps, Ci(e.selectProps, "clear")),
|
|
3045
3052
|
children: /* @__PURE__ */ q(U, {
|
|
3046
3053
|
className: "h-3.5 w-3.5",
|
|
3047
3054
|
"aria-hidden": !0
|
|
3048
3055
|
})
|
|
3049
3056
|
});
|
|
3050
3057
|
}
|
|
3051
|
-
function
|
|
3052
|
-
return /* @__PURE__ */ q(
|
|
3058
|
+
function ki(e) {
|
|
3059
|
+
return /* @__PURE__ */ q(we.MultiValueRemove, {
|
|
3053
3060
|
...e,
|
|
3054
3061
|
innerProps: {
|
|
3055
3062
|
...e.innerProps,
|
|
3056
|
-
"aria-label": `Remove ${
|
|
3063
|
+
"aria-label": `Remove ${hi(e.data)}`
|
|
3057
3064
|
},
|
|
3058
3065
|
children: /* @__PURE__ */ q(U, {
|
|
3059
3066
|
className: "h-3 w-3",
|
|
@@ -3061,43 +3068,43 @@ function Ti(e) {
|
|
|
3061
3068
|
})
|
|
3062
3069
|
});
|
|
3063
3070
|
}
|
|
3064
|
-
function
|
|
3071
|
+
function Ai(e) {
|
|
3065
3072
|
let { visibleTagCount: t } = e.selectProps;
|
|
3066
|
-
return t === void 0 || e.index < t ? /* @__PURE__ */ q(
|
|
3067
|
-
className:
|
|
3073
|
+
return t === void 0 || e.index < t ? /* @__PURE__ */ q(we.MultiValue, { ...e }) : e.index === t ? /* @__PURE__ */ J("span", {
|
|
3074
|
+
className: mi,
|
|
3068
3075
|
children: ["+", (Array.isArray(e.selectProps.value) ? e.selectProps.value.length : 0) - t]
|
|
3069
3076
|
}) : null;
|
|
3070
3077
|
}
|
|
3071
|
-
function
|
|
3072
|
-
return /* @__PURE__ */ J(
|
|
3078
|
+
function ji(e) {
|
|
3079
|
+
return /* @__PURE__ */ J(we.Option, {
|
|
3073
3080
|
...e,
|
|
3074
|
-
innerProps:
|
|
3081
|
+
innerProps: wi(e.innerProps, Ci(e.selectProps, `option-${String(e.data.value)}`)),
|
|
3075
3082
|
children: [e.children, e.isSelected && /* @__PURE__ */ q(b, {
|
|
3076
3083
|
className: "h-4 w-4 text-fg-brand shrink-0",
|
|
3077
3084
|
"aria-hidden": !0
|
|
3078
3085
|
})]
|
|
3079
3086
|
});
|
|
3080
3087
|
}
|
|
3081
|
-
function
|
|
3082
|
-
return /* @__PURE__ */ q(
|
|
3088
|
+
function Mi() {
|
|
3089
|
+
return /* @__PURE__ */ q(F, {
|
|
3083
3090
|
className: "h-4 w-4 animate-spin text-fg-secondary",
|
|
3084
3091
|
"aria-hidden": !0
|
|
3085
3092
|
});
|
|
3086
3093
|
}
|
|
3087
|
-
function
|
|
3094
|
+
function Ni(e) {
|
|
3088
3095
|
let { selectAllState: t, onSelectAllToggle: n, saveSelectionState: r, onSaveSelectionToggle: i } = e.selectProps;
|
|
3089
|
-
return /* @__PURE__ */ J(
|
|
3096
|
+
return /* @__PURE__ */ J(we.Menu, {
|
|
3090
3097
|
...e,
|
|
3091
|
-
innerProps:
|
|
3098
|
+
innerProps: wi(e.innerProps, Ci(e.selectProps, "content")),
|
|
3092
3099
|
children: [
|
|
3093
3100
|
t && /* @__PURE__ */ q("div", {
|
|
3094
|
-
"data-test-id":
|
|
3101
|
+
"data-test-id": Ci(e.selectProps, "select-all"),
|
|
3095
3102
|
className: "border-b border-border-default px-3 py-2",
|
|
3096
3103
|
onMouseDown: (e) => e.preventDefault(),
|
|
3097
3104
|
onClick: (e) => {
|
|
3098
3105
|
e.preventDefault(), n?.();
|
|
3099
3106
|
},
|
|
3100
|
-
children: /* @__PURE__ */ q(
|
|
3107
|
+
children: /* @__PURE__ */ q(Jt, {
|
|
3101
3108
|
size: "sm",
|
|
3102
3109
|
checked: t.checked,
|
|
3103
3110
|
indeterminate: t.indeterminate,
|
|
@@ -3107,7 +3114,7 @@ function ki(e) {
|
|
|
3107
3114
|
}),
|
|
3108
3115
|
e.children,
|
|
3109
3116
|
r && /* @__PURE__ */ q("div", {
|
|
3110
|
-
"data-test-id":
|
|
3117
|
+
"data-test-id": Ci(e.selectProps, "save_template"),
|
|
3111
3118
|
role: "button",
|
|
3112
3119
|
tabIndex: 0,
|
|
3113
3120
|
"aria-pressed": r.checked,
|
|
@@ -3119,7 +3126,7 @@ function ki(e) {
|
|
|
3119
3126
|
onKeyDown: (e) => {
|
|
3120
3127
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i?.());
|
|
3121
3128
|
},
|
|
3122
|
-
children: /* @__PURE__ */ q(
|
|
3129
|
+
children: /* @__PURE__ */ q(Jt, {
|
|
3123
3130
|
size: "sm",
|
|
3124
3131
|
checked: r.checked,
|
|
3125
3132
|
label: r.label,
|
|
@@ -3129,16 +3136,16 @@ function ki(e) {
|
|
|
3129
3136
|
]
|
|
3130
3137
|
});
|
|
3131
3138
|
}
|
|
3132
|
-
function
|
|
3133
|
-
let { children: n, innerRef: r, innerProps: i, maxHeight: a } = t, o = e.toArray(n), s = p(null), c =
|
|
3139
|
+
function Pi(t) {
|
|
3140
|
+
let { children: n, innerRef: r, innerProps: i, maxHeight: a } = t, o = e.toArray(n), s = p(null), c = Oe({
|
|
3134
3141
|
count: o.length,
|
|
3135
3142
|
getScrollElement: () => s.current,
|
|
3136
|
-
estimateSize: () =>
|
|
3143
|
+
estimateSize: () => Si,
|
|
3137
3144
|
overscan: 8
|
|
3138
3145
|
});
|
|
3139
3146
|
return /* @__PURE__ */ q("div", {
|
|
3140
3147
|
...i,
|
|
3141
|
-
ref:
|
|
3148
|
+
ref: Yt(r, s),
|
|
3142
3149
|
className: "overflow-y-auto py-1",
|
|
3143
3150
|
style: { maxHeight: a },
|
|
3144
3151
|
children: /* @__PURE__ */ q("div", {
|
|
@@ -3160,29 +3167,29 @@ function Ai(t) {
|
|
|
3160
3167
|
})
|
|
3161
3168
|
});
|
|
3162
3169
|
}
|
|
3163
|
-
var
|
|
3164
|
-
let { options: n, loadOptions: r, defaultOptions: i, creatable: a = !1, onCreateOption: o, formatCreateLabel: c, isMulti: d, value: h, defaultValue: g, onChange: _, placeholder: v, label: y, labelAddons: b,
|
|
3170
|
+
var Fi = a(function(e, t) {
|
|
3171
|
+
let { options: n, loadOptions: r, defaultOptions: i, creatable: a = !1, onCreateOption: o, formatCreateLabel: c, isMulti: d, value: h, defaultValue: g, onChange: _, placeholder: v, label: y, labelAddons: b, dropdownIcon: x, helperText: S, errorText: C, error: w = !1, required: T = !0, loading: E = !1, clearable: D = !1, searchable: O, virtualized: k = !1, emptyText: A, locale: j = "en-US", storageKey: M, saveSelectionLabel: N, size: ee = "md", disabled: te = !1, id: P, className: F, wrapperClassName: I, dataTestId: L, ...R } = e, ne = e.isMulti ? !!e.singleLine : !1, z = ci[j], re = v ?? z.placeholder, ie = A ?? z.noResults, ae = c ?? ((e) => z.createLabel(e)), oe = u(), se = P ?? oe, B = w || !!C, ce = h !== void 0, [le, ue] = m(() => {
|
|
3165
3172
|
if (!d) {
|
|
3166
|
-
if (
|
|
3167
|
-
let e =
|
|
3173
|
+
if (M && !ce) {
|
|
3174
|
+
let e = _i(M);
|
|
3168
3175
|
if (e !== void 0) return e;
|
|
3169
3176
|
}
|
|
3170
3177
|
return g;
|
|
3171
3178
|
}
|
|
3172
|
-
}), [
|
|
3179
|
+
}), [de, fe] = m(() => {
|
|
3173
3180
|
if (!d) return [];
|
|
3174
|
-
if (
|
|
3175
|
-
let e =
|
|
3181
|
+
if (M && !ce) {
|
|
3182
|
+
let e = _i(M);
|
|
3176
3183
|
if (Array.isArray(e)) return e;
|
|
3177
3184
|
}
|
|
3178
3185
|
return g ?? [];
|
|
3179
|
-
}), [
|
|
3186
|
+
}), [pe, me] = m(() => !!M && vi(M)), [he, ge] = m(() => {
|
|
3180
3187
|
let e = /* @__PURE__ */ new Map();
|
|
3181
3188
|
for (let t of n) e.set(String(t.value), t);
|
|
3182
3189
|
if (Array.isArray(i)) for (let t of i) e.set(String(t.value), t);
|
|
3183
3190
|
return e;
|
|
3184
|
-
}),
|
|
3185
|
-
e.length !== 0 &&
|
|
3191
|
+
}), V = s((e) => {
|
|
3192
|
+
e.length !== 0 && ge((t) => {
|
|
3186
3193
|
let n = !1, r = new Map(t);
|
|
3187
3194
|
for (let t of e) {
|
|
3188
3195
|
let e = String(t.value);
|
|
@@ -3192,57 +3199,57 @@ var ji = a(function(e, t) {
|
|
|
3192
3199
|
});
|
|
3193
3200
|
}, []);
|
|
3194
3201
|
f(() => {
|
|
3195
|
-
|
|
3196
|
-
}, [n,
|
|
3197
|
-
let
|
|
3202
|
+
V(n);
|
|
3203
|
+
}, [n, V]);
|
|
3204
|
+
let H = s((e) => he.get(String(e)) ?? {
|
|
3198
3205
|
value: e,
|
|
3199
3206
|
label: String(e)
|
|
3200
|
-
}, [
|
|
3201
|
-
|
|
3207
|
+
}, [he]), W = ce ? h : le, G = f(() => (ce ? h : de) ?? [], [
|
|
3208
|
+
ce,
|
|
3202
3209
|
h,
|
|
3203
|
-
|
|
3204
|
-
]),
|
|
3205
|
-
if (r) return (e) => Promise.resolve(r(e)).then((e) => (
|
|
3206
|
-
}, [r,
|
|
3210
|
+
de
|
|
3211
|
+
]), _e = !d && W != null ? H(W) : null, K = d ? G.map(H) : [], ve = f(() => {
|
|
3212
|
+
if (r) return (e) => Promise.resolve(r(e)).then((e) => (V(e), e));
|
|
3213
|
+
}, [r, V]), ye = s((e) => {
|
|
3207
3214
|
if (d) {
|
|
3208
3215
|
let t = [...e ?? []];
|
|
3209
|
-
|
|
3216
|
+
V(t);
|
|
3210
3217
|
let n = t.map((e) => e.value);
|
|
3211
|
-
|
|
3218
|
+
fe(n), _?.(n);
|
|
3212
3219
|
} else {
|
|
3213
3220
|
let t = e;
|
|
3214
|
-
t &&
|
|
3221
|
+
t && V([t]), ue(t?.value), _?.(t?.value ?? void 0);
|
|
3215
3222
|
}
|
|
3216
3223
|
}, [
|
|
3217
3224
|
d,
|
|
3218
|
-
|
|
3225
|
+
V,
|
|
3219
3226
|
_
|
|
3220
|
-
]),
|
|
3227
|
+
]), be = s((e) => {
|
|
3221
3228
|
let t = {
|
|
3222
3229
|
value: e,
|
|
3223
3230
|
label: e
|
|
3224
3231
|
};
|
|
3225
|
-
if (
|
|
3232
|
+
if (V([t]), o?.(e), d) {
|
|
3226
3233
|
let e = [...G, t.value];
|
|
3227
|
-
|
|
3228
|
-
} else
|
|
3234
|
+
fe(e), _?.(e);
|
|
3235
|
+
} else ue(t.value), _?.(t.value);
|
|
3229
3236
|
}, [
|
|
3230
3237
|
d,
|
|
3231
3238
|
G,
|
|
3232
|
-
|
|
3239
|
+
V,
|
|
3233
3240
|
_,
|
|
3234
3241
|
o
|
|
3235
|
-
]),
|
|
3242
|
+
]), xe = !!r, Se = O ?? (xe || a ? !0 : n.length >= 10), we = xe ? a ? De : Te : a ? Ee : Ce, Oe = f(() => xi(ee, B, ne), [
|
|
3236
3243
|
ee,
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
]),
|
|
3240
|
-
wrapperRef:
|
|
3241
|
-
measureRef:
|
|
3244
|
+
B,
|
|
3245
|
+
ne
|
|
3246
|
+
]), ke = p(null), Ae = p(null), je = p(null), Me = !!d && ne, Ne = si({
|
|
3247
|
+
wrapperRef: ke,
|
|
3248
|
+
measureRef: Ae,
|
|
3242
3249
|
total: K.length,
|
|
3243
|
-
labelsKey: K.map(
|
|
3244
|
-
enabled:
|
|
3245
|
-
}),
|
|
3250
|
+
labelsKey: K.map(hi).join("\0"),
|
|
3251
|
+
enabled: Me
|
|
3252
|
+
}), Pe = f(() => n.some((e) => !!e.description), [n]), Fe = f(() => {
|
|
3246
3253
|
if (!n.some((e) => e.group)) return n;
|
|
3247
3254
|
let e = /* @__PURE__ */ new Map(), t = [];
|
|
3248
3255
|
for (let r of n) {
|
|
@@ -3257,35 +3264,35 @@ var ji = a(function(e, t) {
|
|
|
3257
3264
|
})), n.push(r);
|
|
3258
3265
|
}
|
|
3259
3266
|
return t;
|
|
3260
|
-
}, [n]),
|
|
3267
|
+
}, [n]), Ie = !!d && !xe, Le = d ? G : W;
|
|
3261
3268
|
l(() => {
|
|
3262
|
-
!
|
|
3269
|
+
!M || !pe || yi(M, Le);
|
|
3263
3270
|
}, [
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3271
|
+
M,
|
|
3272
|
+
pe,
|
|
3273
|
+
Le
|
|
3267
3274
|
]);
|
|
3268
|
-
let
|
|
3269
|
-
|
|
3275
|
+
let Re = s(() => {
|
|
3276
|
+
M && me((e) => {
|
|
3270
3277
|
let t = !e;
|
|
3271
|
-
return t ?
|
|
3278
|
+
return t ? yi(M, Le) : bi(M), t;
|
|
3272
3279
|
});
|
|
3273
|
-
}, [
|
|
3274
|
-
checked:
|
|
3275
|
-
label:
|
|
3280
|
+
}, [M, Le]), ze = f(() => M ? {
|
|
3281
|
+
checked: pe,
|
|
3282
|
+
label: N ?? z.saveSelectionLabel
|
|
3276
3283
|
} : null, [
|
|
3277
|
-
j,
|
|
3278
|
-
de,
|
|
3279
3284
|
M,
|
|
3285
|
+
pe,
|
|
3286
|
+
N,
|
|
3280
3287
|
z
|
|
3281
|
-
]), [
|
|
3282
|
-
|
|
3283
|
-
}, []), Y = f(() =>
|
|
3284
|
-
|
|
3288
|
+
]), [Be, Ve] = m(""), He = s((e) => {
|
|
3289
|
+
Ve(e);
|
|
3290
|
+
}, []), Y = f(() => Ie ? n.filter((e) => !e.disabled && gi(e, Be)) : [], [
|
|
3291
|
+
Ie,
|
|
3285
3292
|
n,
|
|
3286
|
-
|
|
3293
|
+
Be
|
|
3287
3294
|
]), X = f(() => {
|
|
3288
|
-
if (!
|
|
3295
|
+
if (!Ie || Y.length === 0) return null;
|
|
3289
3296
|
let e = new Set(G.map(String)), t = Y.filter((t) => e.has(String(t.value))).length, n = t === Y.length;
|
|
3290
3297
|
return {
|
|
3291
3298
|
count: Y.length,
|
|
@@ -3294,46 +3301,47 @@ var ji = a(function(e, t) {
|
|
|
3294
3301
|
label: n ? z.clearAllLabel(Y.length) : z.selectAllLabel(Y.length)
|
|
3295
3302
|
};
|
|
3296
3303
|
}, [
|
|
3297
|
-
|
|
3304
|
+
Ie,
|
|
3298
3305
|
Y,
|
|
3299
3306
|
G,
|
|
3300
3307
|
z
|
|
3301
|
-
]),
|
|
3308
|
+
]), Ue = s(() => {
|
|
3302
3309
|
if (!X) return;
|
|
3303
3310
|
let e = new Set(Y.map((e) => String(e.value))), t;
|
|
3304
3311
|
if (X.checked) t = G.filter((t) => !e.has(String(t)));
|
|
3305
3312
|
else {
|
|
3306
|
-
|
|
3313
|
+
V(Y);
|
|
3307
3314
|
let e = new Set(G.map(String));
|
|
3308
3315
|
t = [...G, ...Y.filter((t) => !e.has(String(t.value))).map((e) => e.value)];
|
|
3309
3316
|
}
|
|
3310
|
-
|
|
3317
|
+
fe(t), _?.(t), je.current?.onMenuClose();
|
|
3311
3318
|
}, [
|
|
3312
3319
|
X,
|
|
3313
3320
|
Y,
|
|
3314
3321
|
G,
|
|
3315
|
-
|
|
3322
|
+
V,
|
|
3316
3323
|
_
|
|
3317
|
-
]),
|
|
3318
|
-
...
|
|
3319
|
-
dataTestId:
|
|
3320
|
-
|
|
3324
|
+
]), We = Zt(), Ge = {
|
|
3325
|
+
...R,
|
|
3326
|
+
dataTestId: L,
|
|
3327
|
+
dropdownIcon: x,
|
|
3328
|
+
inputId: se,
|
|
3321
3329
|
unstyled: !0,
|
|
3322
|
-
classNames:
|
|
3323
|
-
className:
|
|
3330
|
+
classNames: Oe,
|
|
3331
|
+
className: F,
|
|
3324
3332
|
isMulti: d,
|
|
3325
|
-
options:
|
|
3326
|
-
loadOptions:
|
|
3333
|
+
options: Fe,
|
|
3334
|
+
loadOptions: ve,
|
|
3327
3335
|
defaultOptions: i,
|
|
3328
|
-
value: d ? K :
|
|
3329
|
-
onChange:
|
|
3330
|
-
onCreateOption: a ?
|
|
3331
|
-
formatCreateLabel: a ?
|
|
3336
|
+
value: d ? K : _e,
|
|
3337
|
+
onChange: ye,
|
|
3338
|
+
onCreateOption: a ? be : void 0,
|
|
3339
|
+
formatCreateLabel: a ? ae : void 0,
|
|
3332
3340
|
getOptionValue: (e) => String(e.value),
|
|
3333
|
-
getOptionLabel:
|
|
3341
|
+
getOptionLabel: hi,
|
|
3334
3342
|
formatOptionLabel: (e, t) => {
|
|
3335
3343
|
if (t.context === "value") return e.label;
|
|
3336
|
-
let n =
|
|
3344
|
+
let n = Pe && e.description ? /* @__PURE__ */ J("span", {
|
|
3337
3345
|
className: "flex flex-col min-w-0",
|
|
3338
3346
|
children: [/* @__PURE__ */ q("span", {
|
|
3339
3347
|
className: "truncate",
|
|
@@ -3349,7 +3357,7 @@ var ji = a(function(e, t) {
|
|
|
3349
3357
|
className: "min-w-0 flex-1 truncate",
|
|
3350
3358
|
children: n
|
|
3351
3359
|
}), /* @__PURE__ */ q("span", {
|
|
3352
|
-
"data-test-id":
|
|
3360
|
+
"data-test-id": Ci({ dataTestId: L }, `option-${String(e.value)}-actions`),
|
|
3353
3361
|
className: "ml-auto inline-flex shrink-0 items-center",
|
|
3354
3362
|
onMouseDown: (e) => {
|
|
3355
3363
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -3360,69 +3368,69 @@ var ji = a(function(e, t) {
|
|
|
3360
3368
|
}) : n;
|
|
3361
3369
|
},
|
|
3362
3370
|
isOptionDisabled: (e) => !!e.disabled,
|
|
3363
|
-
placeholder:
|
|
3364
|
-
isDisabled: te ||
|
|
3365
|
-
isClearable:
|
|
3366
|
-
isSearchable:
|
|
3367
|
-
isLoading:
|
|
3368
|
-
noOptionsMessage: () =>
|
|
3371
|
+
placeholder: re,
|
|
3372
|
+
isDisabled: te || E,
|
|
3373
|
+
isClearable: D,
|
|
3374
|
+
isSearchable: Se,
|
|
3375
|
+
isLoading: E || void 0,
|
|
3376
|
+
noOptionsMessage: () => ie,
|
|
3369
3377
|
loadingMessage: () => z.loadingMessage,
|
|
3370
|
-
"aria-invalid":
|
|
3371
|
-
"aria-required":
|
|
3372
|
-
...
|
|
3373
|
-
inputValue:
|
|
3374
|
-
onInputChange:
|
|
3378
|
+
"aria-invalid": B || void 0,
|
|
3379
|
+
"aria-required": T || void 0,
|
|
3380
|
+
...Ie ? {
|
|
3381
|
+
inputValue: Be,
|
|
3382
|
+
onInputChange: He,
|
|
3375
3383
|
selectAllState: X,
|
|
3376
|
-
onSelectAllToggle:
|
|
3384
|
+
onSelectAllToggle: Ue
|
|
3377
3385
|
} : {},
|
|
3378
|
-
...
|
|
3379
|
-
saveSelectionState:
|
|
3380
|
-
onSaveSelectionToggle:
|
|
3386
|
+
...ze ? {
|
|
3387
|
+
saveSelectionState: ze,
|
|
3388
|
+
onSaveSelectionToggle: Re
|
|
3381
3389
|
} : {},
|
|
3382
|
-
...
|
|
3390
|
+
...Me ? { visibleTagCount: Ne } : {},
|
|
3383
3391
|
...d ? {
|
|
3384
|
-
closeMenuOnSelect:
|
|
3385
|
-
hideSelectedOptions:
|
|
3392
|
+
closeMenuOnSelect: R.closeMenuOnSelect ?? !1,
|
|
3393
|
+
hideSelectedOptions: R.hideSelectedOptions ?? !1
|
|
3386
3394
|
} : {},
|
|
3387
|
-
menuPlacement:
|
|
3388
|
-
menuPortalTarget:
|
|
3389
|
-
menuPosition:
|
|
3395
|
+
menuPlacement: R.menuPlacement ?? "auto",
|
|
3396
|
+
menuPortalTarget: R.menuPortalTarget ?? We ?? void 0,
|
|
3397
|
+
menuPosition: R.menuPosition ?? "fixed",
|
|
3390
3398
|
components: {
|
|
3391
|
-
Control:
|
|
3392
|
-
Menu:
|
|
3393
|
-
...
|
|
3394
|
-
DropdownIndicator:
|
|
3395
|
-
ClearIndicator:
|
|
3396
|
-
MultiValueRemove:
|
|
3397
|
-
LoadingIndicator:
|
|
3399
|
+
Control: Ti,
|
|
3400
|
+
Menu: Ni,
|
|
3401
|
+
...Se ? { Input: Ei } : {},
|
|
3402
|
+
DropdownIndicator: Di,
|
|
3403
|
+
ClearIndicator: Oi,
|
|
3404
|
+
MultiValueRemove: ki,
|
|
3405
|
+
LoadingIndicator: Mi,
|
|
3398
3406
|
IndicatorSeparator: () => null,
|
|
3399
|
-
...
|
|
3400
|
-
...
|
|
3401
|
-
Option:
|
|
3407
|
+
...k ? { MenuList: Pi } : {},
|
|
3408
|
+
...Me ? { MultiValue: Ai } : {},
|
|
3409
|
+
Option: ji
|
|
3402
3410
|
}
|
|
3403
3411
|
};
|
|
3404
3412
|
return /* @__PURE__ */ J("div", {
|
|
3405
|
-
ref:
|
|
3406
|
-
"data-test-id":
|
|
3407
|
-
className: Z("flex flex-col gap-1.5 w-full",
|
|
3413
|
+
ref: ke,
|
|
3414
|
+
"data-test-id": L,
|
|
3415
|
+
className: Z("flex flex-col gap-1.5 w-full", I),
|
|
3408
3416
|
children: [
|
|
3409
3417
|
(y || b) && /* @__PURE__ */ J("div", {
|
|
3410
3418
|
className: "flex items-center gap-1.5",
|
|
3411
3419
|
children: [y && /* @__PURE__ */ J("label", {
|
|
3412
|
-
htmlFor:
|
|
3420
|
+
htmlFor: se,
|
|
3413
3421
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
3414
|
-
children: [y,
|
|
3422
|
+
children: [y, T && /* @__PURE__ */ q(at, {})]
|
|
3415
3423
|
}), b && /* @__PURE__ */ q("span", {
|
|
3416
3424
|
className: "inline-flex items-center gap-1",
|
|
3417
3425
|
children: b
|
|
3418
3426
|
})]
|
|
3419
3427
|
}),
|
|
3420
|
-
/* @__PURE__ */ q(
|
|
3421
|
-
ref:
|
|
3422
|
-
...
|
|
3428
|
+
/* @__PURE__ */ q(we, {
|
|
3429
|
+
ref: Yt(t, je),
|
|
3430
|
+
...Ge
|
|
3423
3431
|
}),
|
|
3424
|
-
|
|
3425
|
-
ref:
|
|
3432
|
+
Me && /* @__PURE__ */ J("div", {
|
|
3433
|
+
ref: Ae,
|
|
3426
3434
|
"aria-hidden": !0,
|
|
3427
3435
|
className: "flex items-center gap-1 whitespace-nowrap",
|
|
3428
3436
|
style: {
|
|
@@ -3436,7 +3444,7 @@ var ji = a(function(e, t) {
|
|
|
3436
3444
|
className: "flex items-center gap-1 rounded-md bg-bg-subtle pl-2 pr-1 py-0.5 max-w-full",
|
|
3437
3445
|
children: [/* @__PURE__ */ q("span", {
|
|
3438
3446
|
className: "truncate text-p-sm text-fg-default",
|
|
3439
|
-
children:
|
|
3447
|
+
children: hi(e)
|
|
3440
3448
|
}), /* @__PURE__ */ q("span", {
|
|
3441
3449
|
className: "rounded-sm text-fg-secondary hover:bg-bg-container hover:text-fg-default cursor-pointer",
|
|
3442
3450
|
children: /* @__PURE__ */ q(U, {
|
|
@@ -3449,30 +3457,30 @@ var ji = a(function(e, t) {
|
|
|
3449
3457
|
className: "flex items-center rounded-md bg-bg-info-lighter px-2 py-0.5 text-p-sm text-blue-800 dark:text-blue-300 shrink-0"
|
|
3450
3458
|
})]
|
|
3451
3459
|
}),
|
|
3452
|
-
|
|
3453
|
-
id: `${
|
|
3460
|
+
C ? /* @__PURE__ */ q("p", {
|
|
3461
|
+
id: `${se}-error`,
|
|
3454
3462
|
className: "text-p-sm text-fg-danger",
|
|
3455
|
-
children:
|
|
3456
|
-
}) :
|
|
3457
|
-
id: `${
|
|
3463
|
+
children: C
|
|
3464
|
+
}) : S ? /* @__PURE__ */ q("p", {
|
|
3465
|
+
id: `${se}-help`,
|
|
3458
3466
|
className: "text-p-sm text-fg-secondary",
|
|
3459
|
-
children:
|
|
3467
|
+
children: S
|
|
3460
3468
|
}) : null
|
|
3461
3469
|
]
|
|
3462
3470
|
});
|
|
3463
|
-
}),
|
|
3464
|
-
function
|
|
3465
|
-
return c(
|
|
3471
|
+
}), Ii = r(null);
|
|
3472
|
+
function Li() {
|
|
3473
|
+
return c(Ii) ?? {
|
|
3466
3474
|
collapsed: !1,
|
|
3467
3475
|
toggle: () => {}
|
|
3468
3476
|
};
|
|
3469
3477
|
}
|
|
3470
|
-
var
|
|
3478
|
+
var Ri = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange: n, children: r, className: i, logo: a, title: o, subtitle: s, dataTestId: c, ...l }, u) {
|
|
3471
3479
|
let [d, f] = m(e), p = t !== void 0, h = p ? t : d, g = () => {
|
|
3472
3480
|
let e = !h;
|
|
3473
3481
|
p || f(e), n?.(e);
|
|
3474
3482
|
};
|
|
3475
|
-
return /* @__PURE__ */ q(
|
|
3483
|
+
return /* @__PURE__ */ q(Ii.Provider, {
|
|
3476
3484
|
value: {
|
|
3477
3485
|
collapsed: h,
|
|
3478
3486
|
toggle: g
|
|
@@ -3504,7 +3512,7 @@ var Pi = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange:
|
|
|
3504
3512
|
onClick: g,
|
|
3505
3513
|
"aria-label": h ? "Expand sidebar" : "Collapse sidebar",
|
|
3506
3514
|
className: Z("ml-auto inline-flex items-center justify-center h-8 w-8 rounded-md text-fg-secondary hover:bg-bg-subtle hover:text-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300", h && "ml-0"),
|
|
3507
|
-
children: /* @__PURE__ */ q(
|
|
3515
|
+
children: /* @__PURE__ */ q(I, { className: "h-4 w-4" })
|
|
3508
3516
|
})
|
|
3509
3517
|
]
|
|
3510
3518
|
}), /* @__PURE__ */ q("nav", {
|
|
@@ -3513,8 +3521,8 @@ var Pi = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange:
|
|
|
3513
3521
|
})]
|
|
3514
3522
|
})
|
|
3515
3523
|
});
|
|
3516
|
-
}),
|
|
3517
|
-
let { collapsed: d } =
|
|
3524
|
+
}), zi = a(function({ icon: e, label: t, active: n, badge: r, children: i, onClick: a, href: o, className: s, dataTestId: c, ...l }, u) {
|
|
3525
|
+
let { collapsed: d } = Li(), [f, p] = m(n ?? !1), h = !!i, g = /* @__PURE__ */ J(K, { children: [e && /* @__PURE__ */ q("span", {
|
|
3518
3526
|
className: "inline-flex shrink-0",
|
|
3519
3527
|
children: e
|
|
3520
3528
|
}), !d && /* @__PURE__ */ J(K, { children: [
|
|
@@ -3553,12 +3561,12 @@ var Pi = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange:
|
|
|
3553
3561
|
className: "flex flex-col gap-0.5 pl-8",
|
|
3554
3562
|
children: i
|
|
3555
3563
|
})] });
|
|
3556
|
-
}),
|
|
3564
|
+
}), Bi = {
|
|
3557
3565
|
text: "h-[1em] mb-[0.4em] origin-[0%_55%] scale-y-[0.6] rounded-sm",
|
|
3558
3566
|
circular: "size-10 rounded-full",
|
|
3559
3567
|
rectangular: "h-4 w-full",
|
|
3560
3568
|
rounded: "h-4 w-full rounded-md"
|
|
3561
|
-
},
|
|
3569
|
+
}, Vi = {
|
|
3562
3570
|
pulse: "animate-pulse",
|
|
3563
3571
|
wave: [
|
|
3564
3572
|
"relative overflow-hidden",
|
|
@@ -3568,15 +3576,15 @@ var Pi = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange:
|
|
|
3568
3576
|
].join(" "),
|
|
3569
3577
|
none: ""
|
|
3570
3578
|
};
|
|
3571
|
-
function
|
|
3579
|
+
function Hi(e) {
|
|
3572
3580
|
if (e !== void 0) return typeof e == "number" ? `${e}px` : e;
|
|
3573
3581
|
}
|
|
3574
|
-
var
|
|
3582
|
+
var Ui = a(function({ variant: e = "text", animation: t = "pulse", width: n, height: r, count: i = 1, children: a, style: o, className: s, dataTestId: c, ...l }, u) {
|
|
3575
3583
|
let d = a != null, f = Math.max(1, i), p = {
|
|
3576
|
-
...n === void 0 ? null : { width:
|
|
3577
|
-
...r === void 0 ? null : { height:
|
|
3584
|
+
...n === void 0 ? null : { width: Hi(n) },
|
|
3585
|
+
...r === void 0 ? null : { height: Hi(r) },
|
|
3578
3586
|
...o
|
|
3579
|
-
}, m = Z("block bg-bg-subtle leading-none",
|
|
3587
|
+
}, m = Z("block bg-bg-subtle leading-none", Bi[e], Vi[t]);
|
|
3580
3588
|
return d ? /* @__PURE__ */ q("span", {
|
|
3581
3589
|
ref: u,
|
|
3582
3590
|
"data-test-id": c,
|
|
@@ -3609,7 +3617,7 @@ var zi = a(function({ variant: e = "text", animation: t = "pulse", width: n, hei
|
|
|
3609
3617
|
"aria-label": t === 0 ? "Loading" : void 0
|
|
3610
3618
|
}, t))
|
|
3611
3619
|
});
|
|
3612
|
-
}),
|
|
3620
|
+
}), Wi = {
|
|
3613
3621
|
success: {
|
|
3614
3622
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
3615
3623
|
icon: x
|
|
@@ -3624,32 +3632,32 @@ var zi = a(function({ variant: e = "text", animation: t = "pulse", width: n, hei
|
|
|
3624
3632
|
},
|
|
3625
3633
|
info: {
|
|
3626
3634
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
3627
|
-
icon:
|
|
3635
|
+
icon: P
|
|
3628
3636
|
},
|
|
3629
3637
|
neutral: {
|
|
3630
3638
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
3631
|
-
icon:
|
|
3639
|
+
icon: P
|
|
3632
3640
|
}
|
|
3633
|
-
},
|
|
3641
|
+
}, Gi = {
|
|
3634
3642
|
success: "text-green-400",
|
|
3635
3643
|
warning: "text-yellow-300",
|
|
3636
3644
|
danger: "text-red-400",
|
|
3637
3645
|
info: "text-blue-400",
|
|
3638
3646
|
neutral: "text-white/70"
|
|
3639
|
-
},
|
|
3647
|
+
}, Ki = {
|
|
3640
3648
|
"top-left": "top-6 left-4",
|
|
3641
3649
|
"top-center": "top-6 left-1/2 -translate-x-1/2",
|
|
3642
3650
|
"top-right": "top-6 right-4",
|
|
3643
3651
|
"bottom-left": "bottom-6 left-4",
|
|
3644
3652
|
"bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
|
|
3645
3653
|
"bottom-right": "bottom-6 right-4"
|
|
3646
|
-
},
|
|
3647
|
-
function
|
|
3648
|
-
let e = c(
|
|
3654
|
+
}, qi = r(null);
|
|
3655
|
+
function Ji() {
|
|
3656
|
+
let e = c(qi);
|
|
3649
3657
|
if (!e) throw Error("useSnackbar must be used inside <SnackbarProvider>");
|
|
3650
3658
|
return e;
|
|
3651
3659
|
}
|
|
3652
|
-
function
|
|
3660
|
+
function Yi({ children: e, dataTestId: t, position: n = "bottom-center" }) {
|
|
3653
3661
|
let [r, i] = m([]), a = p(/* @__PURE__ */ new Map()), o = s((e) => {
|
|
3654
3662
|
i((t) => t.filter((t) => t.id !== e));
|
|
3655
3663
|
let t = a.current.get(e);
|
|
@@ -3672,25 +3680,25 @@ function Gi({ children: e, dataTestId: t, position: n = "bottom-center" }) {
|
|
|
3672
3680
|
return () => {
|
|
3673
3681
|
e.forEach(clearTimeout), e.clear();
|
|
3674
3682
|
};
|
|
3675
|
-
}, []), /* @__PURE__ */ J(
|
|
3683
|
+
}, []), /* @__PURE__ */ J(qi.Provider, {
|
|
3676
3684
|
value: {
|
|
3677
3685
|
show: c,
|
|
3678
3686
|
dismiss: o
|
|
3679
3687
|
},
|
|
3680
|
-
children: [e,
|
|
3688
|
+
children: [e, ve(/* @__PURE__ */ q(K, { children: Object.keys(Ki).map((e) => {
|
|
3681
3689
|
let i = r.filter((t) => (t.position ?? n) === e);
|
|
3682
3690
|
return i.length === 0 ? null : /* @__PURE__ */ q("div", {
|
|
3683
3691
|
"data-test-id": t,
|
|
3684
|
-
className: Z("fixed z-100 flex flex-col gap-2 w-[min(400px,calc(100vw-2rem))] pointer-events-none",
|
|
3692
|
+
className: Z("fixed z-100 flex flex-col gap-2 w-[min(400px,calc(100vw-2rem))] pointer-events-none", Ki[e]),
|
|
3685
3693
|
children: i.map((e) => {
|
|
3686
|
-
let { container: t, icon: n } =
|
|
3694
|
+
let { container: t, icon: n } = Wi[e.variant ?? "neutral"];
|
|
3687
3695
|
return /* @__PURE__ */ J("div", {
|
|
3688
3696
|
role: "status",
|
|
3689
3697
|
"data-test-id": e.dataTestId,
|
|
3690
3698
|
className: Z("pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-lg shadow-z4", t),
|
|
3691
3699
|
children: [
|
|
3692
3700
|
/* @__PURE__ */ q(n, {
|
|
3693
|
-
className: Z("h-5 w-5 shrink-0",
|
|
3701
|
+
className: Z("h-5 w-5 shrink-0", Gi[e.variant ?? "neutral"]),
|
|
3694
3702
|
"aria-hidden": !0
|
|
3695
3703
|
}),
|
|
3696
3704
|
/* @__PURE__ */ q("p", {
|
|
@@ -3721,15 +3729,15 @@ function Gi({ children: e, dataTestId: t, position: n = "bottom-center" }) {
|
|
|
3721
3729
|
}
|
|
3722
3730
|
//#endregion
|
|
3723
3731
|
//#region src/components/Status/Status.tsx
|
|
3724
|
-
var
|
|
3732
|
+
var Xi = {
|
|
3725
3733
|
lg: "h-7 px-2.5 text-p-std gap-1.5",
|
|
3726
3734
|
md: "h-6 px-2 text-p-sm gap-1.5",
|
|
3727
3735
|
sm: "h-5 px-1.5 text-p-sm gap-1"
|
|
3728
|
-
},
|
|
3736
|
+
}, Zi = {
|
|
3729
3737
|
lg: "h-2 w-2",
|
|
3730
3738
|
md: "h-1.5 w-1.5",
|
|
3731
3739
|
sm: "h-1.5 w-1.5"
|
|
3732
|
-
},
|
|
3740
|
+
}, Qi = {
|
|
3733
3741
|
general: {
|
|
3734
3742
|
container: "bg-bg-subtle text-fg-default dark:text-fg-default",
|
|
3735
3743
|
dot: "bg-gray-600 dark:bg-gray-400"
|
|
@@ -3762,19 +3770,19 @@ var Ki = {
|
|
|
3762
3770
|
container: "bg-bg-subtle text-fg-disabled",
|
|
3763
3771
|
dot: "bg-border-strong"
|
|
3764
3772
|
}
|
|
3765
|
-
},
|
|
3766
|
-
let { container: u, dot: d } =
|
|
3773
|
+
}, $i = a(function({ variant: e = "general", size: t = "md", leftIcon: n, rightIcon: r, dot: i = !0, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
3774
|
+
let { container: u, dot: d } = Qi[e];
|
|
3767
3775
|
return /* @__PURE__ */ J("span", {
|
|
3768
3776
|
ref: l,
|
|
3769
3777
|
"data-test-id": s,
|
|
3770
|
-
className: Z("inline-flex items-center rounded-full font-medium whitespace-nowrap select-none",
|
|
3778
|
+
className: Z("inline-flex items-center rounded-full font-medium whitespace-nowrap select-none", Xi[t], u, a),
|
|
3771
3779
|
...c,
|
|
3772
3780
|
children: [
|
|
3773
3781
|
n ? /* @__PURE__ */ q("span", {
|
|
3774
3782
|
className: "inline-flex shrink-0",
|
|
3775
3783
|
children: n
|
|
3776
3784
|
}) : i ? /* @__PURE__ */ q("span", {
|
|
3777
|
-
className: Z("inline-block shrink-0 rounded-full",
|
|
3785
|
+
className: Z("inline-block shrink-0 rounded-full", Zi[t], d),
|
|
3778
3786
|
"aria-hidden": !0
|
|
3779
3787
|
}) : null,
|
|
3780
3788
|
o,
|
|
@@ -3784,45 +3792,45 @@ var Ki = {
|
|
|
3784
3792
|
})
|
|
3785
3793
|
]
|
|
3786
3794
|
});
|
|
3787
|
-
}),
|
|
3795
|
+
}), ea = {
|
|
3788
3796
|
lg: "size-9",
|
|
3789
3797
|
sm: "size-6"
|
|
3790
|
-
},
|
|
3798
|
+
}, ta = {
|
|
3791
3799
|
lg: "h-9",
|
|
3792
3800
|
sm: "h-6"
|
|
3793
|
-
},
|
|
3801
|
+
}, na = {
|
|
3794
3802
|
lg: "border-2",
|
|
3795
3803
|
sm: "border"
|
|
3796
|
-
},
|
|
3804
|
+
}, ra = {
|
|
3797
3805
|
lg: "text-p-std",
|
|
3798
3806
|
sm: "text-p-xs"
|
|
3799
|
-
},
|
|
3807
|
+
}, ia = {
|
|
3800
3808
|
lg: "size-5",
|
|
3801
3809
|
sm: "size-3.5"
|
|
3802
|
-
},
|
|
3810
|
+
}, aa = {
|
|
3803
3811
|
lg: "size-3",
|
|
3804
3812
|
sm: "size-2"
|
|
3805
|
-
},
|
|
3813
|
+
}, oa = {
|
|
3806
3814
|
lg: "text-p-std",
|
|
3807
3815
|
sm: "text-p-sm"
|
|
3808
|
-
},
|
|
3816
|
+
}, sa = {
|
|
3809
3817
|
lg: "text-p-sm",
|
|
3810
3818
|
sm: "text-p-xs"
|
|
3811
|
-
},
|
|
3819
|
+
}, ca = {
|
|
3812
3820
|
upcoming: "bg-bg-default border-border-strong text-fg-tertiary",
|
|
3813
3821
|
active: "bg-bg-default border-brand-500 text-brand-700",
|
|
3814
3822
|
completed: "bg-brand-500 border-brand-500 text-fg-inverse",
|
|
3815
3823
|
rejected: "bg-red-700 border-red-800 text-fg-inverse"
|
|
3816
|
-
},
|
|
3824
|
+
}, la = {
|
|
3817
3825
|
upcoming: "ring-4 ring-gray-100/80",
|
|
3818
3826
|
active: "ring-4 ring-brand-40/80",
|
|
3819
3827
|
completed: "ring-4 ring-brand-40/80",
|
|
3820
3828
|
rejected: "ring-4 ring-red-100/80"
|
|
3821
3829
|
};
|
|
3822
|
-
function
|
|
3823
|
-
return t === "completed" ? /* @__PURE__ */ q(E, { className:
|
|
3830
|
+
function ua(e, t, n, r) {
|
|
3831
|
+
return t === "completed" ? /* @__PURE__ */ q(E, { className: ia[r] }) : t === "rejected" ? /* @__PURE__ */ q(D, { className: ia[r] }) : e === "number" ? n + 1 : e === "dot" ? /* @__PURE__ */ q("span", { className: Z("rounded-full", aa[r], t === "active" ? "bg-brand-500" : "bg-transparent") }) : null;
|
|
3824
3832
|
}
|
|
3825
|
-
var
|
|
3833
|
+
var da = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "number", orientation: i = "horizontal", size: a = "lg", className: o, dataTestId: s, ...c }, l) {
|
|
3826
3834
|
let u = i === "vertical", d = (e) => (e?.status ?? "upcoming") === "completed";
|
|
3827
3835
|
return /* @__PURE__ */ q("ol", {
|
|
3828
3836
|
ref: l,
|
|
@@ -3831,23 +3839,23 @@ var sa = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3831
3839
|
...c,
|
|
3832
3840
|
children: e.map((i, o) => {
|
|
3833
3841
|
let s = i.status ?? "upcoming", c = o === 0, l = o === e.length - 1, f = !c && d(e[o - 1]), p = !l && d(i), m = /* @__PURE__ */ q("span", {
|
|
3834
|
-
className: Z("relative z-10 inline-flex shrink-0 items-center justify-center rounded-full font-semibold transition-colors",
|
|
3835
|
-
children:
|
|
3842
|
+
className: Z("relative z-10 inline-flex shrink-0 items-center justify-center rounded-full font-semibold transition-colors", ea[a], na[a], ra[a], ca[s], i.highlighted && la[s]),
|
|
3843
|
+
children: ua(r, s, o, a)
|
|
3836
3844
|
}), h = /* @__PURE__ */ J("div", {
|
|
3837
3845
|
className: Z("flex flex-col", u ? "gap-0.5 pb-6" : "mt-2 items-center gap-0.5 text-center"),
|
|
3838
3846
|
children: [/* @__PURE__ */ q("span", {
|
|
3839
|
-
className: Z("font-medium text-fg-default",
|
|
3847
|
+
className: Z("font-medium text-fg-default", oa[a]),
|
|
3840
3848
|
children: i.label
|
|
3841
3849
|
}), i.description && /* @__PURE__ */ q("span", {
|
|
3842
|
-
className: Z("text-fg-secondary",
|
|
3850
|
+
className: Z("text-fg-secondary", sa[a]),
|
|
3843
3851
|
children: i.description
|
|
3844
3852
|
})]
|
|
3845
3853
|
});
|
|
3846
3854
|
return /* @__PURE__ */ J("li", {
|
|
3847
|
-
"aria-current":
|
|
3855
|
+
"aria-current": Qe(i.value, t) ? "step" : void 0,
|
|
3848
3856
|
className: Z("relative flex", u ? "flex-row gap-3" : "flex-1 basis-0 min-w-0 flex-col"),
|
|
3849
3857
|
children: [/* @__PURE__ */ J("div", {
|
|
3850
|
-
className: Z("relative flex shrink-0", u ? "w-9 flex-col items-center justify-center" : Z("w-full items-center justify-center",
|
|
3858
|
+
className: Z("relative flex shrink-0", u ? "w-9 flex-col items-center justify-center" : Z("w-full items-center justify-center", ta[a])),
|
|
3851
3859
|
children: [
|
|
3852
3860
|
!c && /* @__PURE__ */ q("span", {
|
|
3853
3861
|
"aria-hidden": !0,
|
|
@@ -3869,13 +3877,13 @@ var sa = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3869
3877
|
}, String(i.value));
|
|
3870
3878
|
})
|
|
3871
3879
|
});
|
|
3872
|
-
}),
|
|
3880
|
+
}), fa = {
|
|
3873
3881
|
md: "h-6 w-11",
|
|
3874
3882
|
sm: "h-5 w-9"
|
|
3875
|
-
},
|
|
3883
|
+
}, pa = {
|
|
3876
3884
|
md: "h-5 w-5 peer-checked:translate-x-5",
|
|
3877
3885
|
sm: "h-4 w-4 peer-checked:translate-x-4"
|
|
3878
|
-
},
|
|
3886
|
+
}, ma = a(function({ size: e = "md", label: t, description: n, labelPosition: r = "right", id: i, disabled: a, checked: o, defaultChecked: s, className: c, dataTestId: l, ...d }, f) {
|
|
3879
3887
|
let p = u(), m = i ?? p, h = /* @__PURE__ */ J("span", {
|
|
3880
3888
|
className: "relative inline-flex shrink-0",
|
|
3881
3889
|
children: [
|
|
@@ -3888,10 +3896,11 @@ var sa = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3888
3896
|
defaultChecked: s,
|
|
3889
3897
|
disabled: a,
|
|
3890
3898
|
className: "peer sr-only",
|
|
3899
|
+
"data-test-id": Q(l)("input"),
|
|
3891
3900
|
...d
|
|
3892
3901
|
}),
|
|
3893
|
-
/* @__PURE__ */ q("span", { className: Z("rounded-full bg-gray-300 dark:bg-gray-700 transition-colors",
|
|
3894
|
-
/* @__PURE__ */ q("span", { className: Z("absolute top-0.5 left-0.5 rounded-full bg-white dark:bg-white shadow-z1 transition-transform",
|
|
3902
|
+
/* @__PURE__ */ q("span", { className: Z("rounded-full bg-gray-300 dark:bg-gray-700 transition-colors", fa[e], "peer-checked:bg-brand-500 dark:peer-checked:bg-brand-500", "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2", a && "bg-bg-subtle!") }),
|
|
3903
|
+
/* @__PURE__ */ q("span", { className: Z("absolute top-0.5 left-0.5 rounded-full bg-white dark:bg-white shadow-z1 transition-transform", pa[e]) })
|
|
3895
3904
|
]
|
|
3896
3905
|
});
|
|
3897
3906
|
return !t && !n ? /* @__PURE__ */ q("label", {
|
|
@@ -3917,11 +3926,11 @@ var sa = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3917
3926
|
});
|
|
3918
3927
|
//#endregion
|
|
3919
3928
|
//#region src/components/TableV2/TableV2Filter.tsx
|
|
3920
|
-
function
|
|
3929
|
+
function ha({ column: e }) {
|
|
3921
3930
|
let t = e.columnDef.meta?.filterVariant;
|
|
3922
3931
|
if (!t) return null;
|
|
3923
3932
|
let n = e.getFilterValue();
|
|
3924
|
-
return t === "custom" ? /* @__PURE__ */ q(K, { children: e.columnDef.meta?.filterComponent?.(e) ?? null }) : t === "select" ? /* @__PURE__ */ q(
|
|
3933
|
+
return t === "custom" ? /* @__PURE__ */ q(K, { children: e.columnDef.meta?.filterComponent?.(e) ?? null }) : t === "select" ? /* @__PURE__ */ q(Fi, {
|
|
3925
3934
|
size: "sm",
|
|
3926
3935
|
searchable: !1,
|
|
3927
3936
|
required: !1,
|
|
@@ -3929,7 +3938,7 @@ function da({ column: e }) {
|
|
|
3929
3938
|
placeholder: "All",
|
|
3930
3939
|
value: typeof n == "string" ? n : void 0,
|
|
3931
3940
|
onChange: (t) => e.setFilterValue(t || void 0)
|
|
3932
|
-
}) : /* @__PURE__ */ q(
|
|
3941
|
+
}) : /* @__PURE__ */ q(un, {
|
|
3933
3942
|
size: "sm",
|
|
3934
3943
|
type: t === "date" ? "date" : "text",
|
|
3935
3944
|
"aria-label": `Filter by ${e.id}`,
|
|
@@ -3940,7 +3949,7 @@ function da({ column: e }) {
|
|
|
3940
3949
|
}
|
|
3941
3950
|
//#endregion
|
|
3942
3951
|
//#region src/components/TableV2/TableV2Pagination.i18n.ts
|
|
3943
|
-
var
|
|
3952
|
+
var ga = {
|
|
3944
3953
|
"en-US": {
|
|
3945
3954
|
rowsPerPage: "Rows per page",
|
|
3946
3955
|
noResults: "No results",
|
|
@@ -3959,12 +3968,12 @@ var fa = {
|
|
|
3959
3968
|
};
|
|
3960
3969
|
//#endregion
|
|
3961
3970
|
//#region src/components/TableV2/TableV2Pagination.tsx
|
|
3962
|
-
function
|
|
3971
|
+
function _a({ table: e, pageSizeOptions: t = [
|
|
3963
3972
|
10,
|
|
3964
3973
|
20,
|
|
3965
3974
|
30
|
|
3966
3975
|
], locale: n = "en-US", dataTestId: r }) {
|
|
3967
|
-
let { pageIndex: i, pageSize: a } = e.getState().pagination, o = e.options.rowCount ?? e.getPrePaginationRowModel().rows.length, s = Math.max(1, e.getPageCount()), c = o === 0 ? 0 : i * a + 1, l = Math.min(o, (i + 1) * a), u =
|
|
3976
|
+
let { pageIndex: i, pageSize: a } = e.getState().pagination, o = e.options.rowCount ?? e.getPrePaginationRowModel().rows.length, s = Math.max(1, e.getPageCount()), c = o === 0 ? 0 : i * a + 1, l = Math.min(o, (i + 1) * a), u = ga[n], d = Q(r);
|
|
3968
3977
|
return /* @__PURE__ */ J("div", {
|
|
3969
3978
|
className: "flex flex-wrap items-center justify-between gap-3 p-3 border-t border-border-default",
|
|
3970
3979
|
children: [
|
|
@@ -3973,7 +3982,7 @@ function pa({ table: e, pageSizeOptions: t = [
|
|
|
3973
3982
|
children: [/* @__PURE__ */ q("span", {
|
|
3974
3983
|
className: "text-p-sm text-fg-secondary whitespace-nowrap",
|
|
3975
3984
|
children: u.rowsPerPage
|
|
3976
|
-
}), /* @__PURE__ */ q(
|
|
3985
|
+
}), /* @__PURE__ */ q(Fi, {
|
|
3977
3986
|
size: "sm",
|
|
3978
3987
|
menuPlacement: "top",
|
|
3979
3988
|
searchable: !1,
|
|
@@ -3994,7 +4003,7 @@ function pa({ table: e, pageSizeOptions: t = [
|
|
|
3994
4003
|
className: "text-p-sm text-fg-secondary whitespace-nowrap",
|
|
3995
4004
|
children: o === 0 ? u.noResults : u.rangeSummary(c, l, o)
|
|
3996
4005
|
}),
|
|
3997
|
-
/* @__PURE__ */ q(
|
|
4006
|
+
/* @__PURE__ */ q(Kr, {
|
|
3998
4007
|
page: i + 1,
|
|
3999
4008
|
pageCount: s,
|
|
4000
4009
|
onPageChange: (t) => e.setPageIndex(t - 1),
|
|
@@ -4005,14 +4014,14 @@ function pa({ table: e, pageSizeOptions: t = [
|
|
|
4005
4014
|
}
|
|
4006
4015
|
//#endregion
|
|
4007
4016
|
//#region src/components/TableV2/TableV2Skeleton.tsx
|
|
4008
|
-
function
|
|
4009
|
-
let r =
|
|
4017
|
+
function va({ columnCount: e, rowCount: t = 8, testIdPrefix: n }) {
|
|
4018
|
+
let r = Q(n);
|
|
4010
4019
|
return /* @__PURE__ */ q(K, { children: Array.from({ length: t }, (t, n) => /* @__PURE__ */ q("tr", {
|
|
4011
4020
|
"data-test-id": r(`skeleton-row-${n}`),
|
|
4012
4021
|
"aria-hidden": n > 0 || void 0,
|
|
4013
4022
|
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ q("td", {
|
|
4014
4023
|
className: "px-4 py-3",
|
|
4015
|
-
children: /* @__PURE__ */ q(
|
|
4024
|
+
children: /* @__PURE__ */ q(Ui, {
|
|
4016
4025
|
variant: "text",
|
|
4017
4026
|
width: t === 0 ? "70%" : "90%"
|
|
4018
4027
|
})
|
|
@@ -4021,24 +4030,24 @@ function ma({ columnCount: e, rowCount: t = 8, testIdPrefix: n }) {
|
|
|
4021
4030
|
}
|
|
4022
4031
|
//#endregion
|
|
4023
4032
|
//#region src/components/TableV2/TableV2ColumnVisibility.tsx
|
|
4024
|
-
function
|
|
4033
|
+
function ya(e) {
|
|
4025
4034
|
let { header: t } = e.columnDef;
|
|
4026
4035
|
return typeof t == "string" ? t : e.id;
|
|
4027
4036
|
}
|
|
4028
|
-
function
|
|
4037
|
+
function ba({ table: e }) {
|
|
4029
4038
|
let t = e.getAllLeafColumns().filter((e) => e.getCanHide());
|
|
4030
|
-
return /* @__PURE__ */ J(
|
|
4039
|
+
return /* @__PURE__ */ J(_r, { children: [/* @__PURE__ */ q(vr, { children: /* @__PURE__ */ q(ut, {
|
|
4031
4040
|
variant: "secondary",
|
|
4032
4041
|
size: "sm",
|
|
4033
|
-
leftIcon: /* @__PURE__ */ q(
|
|
4042
|
+
leftIcon: /* @__PURE__ */ q(k, { className: "h-4 w-4" }),
|
|
4034
4043
|
children: "Columns"
|
|
4035
|
-
}) }), /* @__PURE__ */ q(
|
|
4044
|
+
}) }), /* @__PURE__ */ q(br, {
|
|
4036
4045
|
align: "end",
|
|
4037
4046
|
children: t.map((e) => /* @__PURE__ */ q("div", {
|
|
4038
4047
|
className: "px-3 py-1.5 hover:bg-bg-subtle",
|
|
4039
|
-
children: /* @__PURE__ */ q(
|
|
4048
|
+
children: /* @__PURE__ */ q(Jt, {
|
|
4040
4049
|
size: "sm",
|
|
4041
|
-
label:
|
|
4050
|
+
label: ya(e),
|
|
4042
4051
|
checked: e.getIsVisible(),
|
|
4043
4052
|
onChange: () => e.toggleVisibility()
|
|
4044
4053
|
})
|
|
@@ -4047,12 +4056,12 @@ function ga({ table: e }) {
|
|
|
4047
4056
|
}
|
|
4048
4057
|
//#endregion
|
|
4049
4058
|
//#region src/components/TableV2/TableV2Toolbar.tsx
|
|
4050
|
-
function
|
|
4059
|
+
function xa({ table: e, enableGlobalFilter: t, enableColumnVisibility: n, searchPlaceholder: r, onRefresh: i, onExport: a, actions: o }) {
|
|
4051
4060
|
return /* @__PURE__ */ J("div", {
|
|
4052
4061
|
className: "flex flex-wrap items-center gap-2 p-3 border-b border-border-default",
|
|
4053
|
-
children: [t && /* @__PURE__ */ q(
|
|
4062
|
+
children: [t && /* @__PURE__ */ q(un, {
|
|
4054
4063
|
size: "sm",
|
|
4055
|
-
leftIcon: /* @__PURE__ */ q(
|
|
4064
|
+
leftIcon: /* @__PURE__ */ q(le, { className: "h-4 w-4" }),
|
|
4056
4065
|
placeholder: r ?? "Search...",
|
|
4057
4066
|
"aria-label": "Search",
|
|
4058
4067
|
value: String(e.getState().globalFilter ?? ""),
|
|
@@ -4061,22 +4070,22 @@ function _a({ table: e, enableGlobalFilter: t, enableColumnVisibility: n, search
|
|
|
4061
4070
|
}), /* @__PURE__ */ J("div", {
|
|
4062
4071
|
className: "ml-auto flex items-center gap-2",
|
|
4063
4072
|
children: [
|
|
4064
|
-
i && /* @__PURE__ */ q(
|
|
4073
|
+
i && /* @__PURE__ */ q(ut, {
|
|
4065
4074
|
variant: "secondary",
|
|
4066
4075
|
size: "sm",
|
|
4067
4076
|
iconOnly: !0,
|
|
4068
4077
|
"aria-label": "Refresh",
|
|
4069
|
-
leftIcon: /* @__PURE__ */ q(
|
|
4078
|
+
leftIcon: /* @__PURE__ */ q(ce, { className: "h-4 w-4" }),
|
|
4070
4079
|
onClick: i
|
|
4071
4080
|
}),
|
|
4072
|
-
a && /* @__PURE__ */ q(
|
|
4081
|
+
a && /* @__PURE__ */ q(ut, {
|
|
4073
4082
|
variant: "secondary",
|
|
4074
4083
|
size: "sm",
|
|
4075
|
-
leftIcon: /* @__PURE__ */ q(
|
|
4084
|
+
leftIcon: /* @__PURE__ */ q(M, { className: "h-4 w-4" }),
|
|
4076
4085
|
onClick: a,
|
|
4077
4086
|
children: "Export"
|
|
4078
4087
|
}),
|
|
4079
|
-
n && /* @__PURE__ */ q(
|
|
4088
|
+
n && /* @__PURE__ */ q(ba, { table: e }),
|
|
4080
4089
|
o
|
|
4081
4090
|
]
|
|
4082
4091
|
})]
|
|
@@ -4084,32 +4093,32 @@ function _a({ table: e, enableGlobalFilter: t, enableColumnVisibility: n, search
|
|
|
4084
4093
|
}
|
|
4085
4094
|
//#endregion
|
|
4086
4095
|
//#region src/components/TableV2/useTableV2ColumnDnd.ts
|
|
4087
|
-
var
|
|
4096
|
+
var Sa = ({ transform: e }) => ({
|
|
4088
4097
|
...e,
|
|
4089
4098
|
y: 0
|
|
4090
4099
|
});
|
|
4091
|
-
function
|
|
4100
|
+
function Ca({ columnOrder: e, onColumnOrderChange: t }) {
|
|
4092
4101
|
return {
|
|
4093
|
-
sensors: ze(
|
|
4094
|
-
collisionDetection:
|
|
4095
|
-
modifiers: [
|
|
4102
|
+
sensors: Be(ze(Le, { activationConstraint: { distance: 4 } }), ze(Ie, { coordinateGetter: X })),
|
|
4103
|
+
collisionDetection: Re,
|
|
4104
|
+
modifiers: [Sa],
|
|
4096
4105
|
handleDragEnd: (n) => {
|
|
4097
4106
|
let { active: r, over: i } = n;
|
|
4098
4107
|
if (!i || r.id === i.id) return;
|
|
4099
4108
|
let a = e.indexOf(String(r.id)), o = e.indexOf(String(i.id));
|
|
4100
|
-
a === -1 || o === -1 || t(
|
|
4109
|
+
a === -1 || o === -1 || t(He(e, a, o));
|
|
4101
4110
|
}
|
|
4102
4111
|
};
|
|
4103
4112
|
}
|
|
4104
|
-
function
|
|
4105
|
-
let { attributes: t, listeners: n, setNodeRef: r, transform: i, transition: a, isDragging: o } =
|
|
4113
|
+
function wa(e) {
|
|
4114
|
+
let { attributes: t, listeners: n, setNodeRef: r, transform: i, transition: a, isDragging: o } = Ue({ id: e });
|
|
4106
4115
|
return {
|
|
4107
4116
|
setNodeRef: r,
|
|
4108
4117
|
attributes: t,
|
|
4109
4118
|
listeners: n,
|
|
4110
4119
|
isDragging: o,
|
|
4111
4120
|
style: {
|
|
4112
|
-
transform:
|
|
4121
|
+
transform: We.Translate.toString(i),
|
|
4113
4122
|
transition: a,
|
|
4114
4123
|
opacity: o ? .8 : 1,
|
|
4115
4124
|
zIndex: o ? 10 : void 0,
|
|
@@ -4119,16 +4128,16 @@ function ba(e) {
|
|
|
4119
4128
|
}
|
|
4120
4129
|
//#endregion
|
|
4121
4130
|
//#region src/components/TableV2/TableV2RowActions.tsx
|
|
4122
|
-
function
|
|
4123
|
-
return t.length === 0 ? null : /* @__PURE__ */ J(
|
|
4131
|
+
function Ta({ row: e, actions: t }) {
|
|
4132
|
+
return t.length === 0 ? null : /* @__PURE__ */ J(_r, { children: [/* @__PURE__ */ q(vr, { children: /* @__PURE__ */ q(ut, {
|
|
4124
4133
|
variant: "tertiary",
|
|
4125
4134
|
size: "sm",
|
|
4126
4135
|
iconOnly: !0,
|
|
4127
4136
|
"aria-label": "Row actions",
|
|
4128
|
-
leftIcon: /* @__PURE__ */ q(
|
|
4129
|
-
}) }), /* @__PURE__ */ q(
|
|
4137
|
+
leftIcon: /* @__PURE__ */ q(re, { className: "h-4 w-4" })
|
|
4138
|
+
}) }), /* @__PURE__ */ q(br, {
|
|
4130
4139
|
align: "end",
|
|
4131
|
-
children: t.map((t, n) => /* @__PURE__ */ q(
|
|
4140
|
+
children: t.map((t, n) => /* @__PURE__ */ q(xr, {
|
|
4132
4141
|
icon: t.icon,
|
|
4133
4142
|
destructive: t.destructive,
|
|
4134
4143
|
disabled: t.disabled?.(e),
|
|
@@ -4139,15 +4148,15 @@ function xa({ row: e, actions: t }) {
|
|
|
4139
4148
|
}
|
|
4140
4149
|
//#endregion
|
|
4141
4150
|
//#region src/components/TableV2/TableV2.utils.tsx
|
|
4142
|
-
var
|
|
4151
|
+
var Ea = {
|
|
4143
4152
|
comfortable: "py-3",
|
|
4144
4153
|
compact: "py-2"
|
|
4145
|
-
},
|
|
4154
|
+
}, Da = {
|
|
4146
4155
|
left: "text-left",
|
|
4147
4156
|
center: "text-center",
|
|
4148
4157
|
right: "text-right"
|
|
4149
4158
|
};
|
|
4150
|
-
function
|
|
4159
|
+
function Oa() {
|
|
4151
4160
|
return {
|
|
4152
4161
|
id: "select",
|
|
4153
4162
|
size: 40,
|
|
@@ -4157,13 +4166,13 @@ function wa() {
|
|
|
4157
4166
|
enableHiding: !1,
|
|
4158
4167
|
enableResizing: !1,
|
|
4159
4168
|
enableColumnFilter: !1,
|
|
4160
|
-
header: ({ table: e }) => /* @__PURE__ */ q(
|
|
4169
|
+
header: ({ table: e }) => /* @__PURE__ */ q(Jt, {
|
|
4161
4170
|
"aria-label": "Select all rows",
|
|
4162
4171
|
checked: e.getIsAllRowsSelected(),
|
|
4163
4172
|
indeterminate: e.getIsSomeRowsSelected() && !e.getIsAllRowsSelected(),
|
|
4164
4173
|
onChange: e.getToggleAllRowsSelectedHandler()
|
|
4165
4174
|
}),
|
|
4166
|
-
cell: ({ row: e }) => /* @__PURE__ */ q(
|
|
4175
|
+
cell: ({ row: e }) => /* @__PURE__ */ q(Jt, {
|
|
4167
4176
|
"aria-label": "Select row",
|
|
4168
4177
|
checked: e.getIsSelected(),
|
|
4169
4178
|
disabled: !e.getCanSelect(),
|
|
@@ -4172,7 +4181,7 @@ function wa() {
|
|
|
4172
4181
|
})
|
|
4173
4182
|
};
|
|
4174
4183
|
}
|
|
4175
|
-
function
|
|
4184
|
+
function ka(e, t) {
|
|
4176
4185
|
return {
|
|
4177
4186
|
id: "actions",
|
|
4178
4187
|
header: t?.header ?? "",
|
|
@@ -4180,13 +4189,13 @@ function Ta(e, t) {
|
|
|
4180
4189
|
enableSorting: !1,
|
|
4181
4190
|
enableColumnFilter: !1,
|
|
4182
4191
|
enableResizing: !1,
|
|
4183
|
-
cell: ({ row: t }) => /* @__PURE__ */ q(
|
|
4192
|
+
cell: ({ row: t }) => /* @__PURE__ */ q(Ta, {
|
|
4184
4193
|
row: t.original,
|
|
4185
4194
|
actions: e(t.original)
|
|
4186
4195
|
})
|
|
4187
4196
|
};
|
|
4188
4197
|
}
|
|
4189
|
-
function
|
|
4198
|
+
function Aa(e) {
|
|
4190
4199
|
let t = e.getIsPinned();
|
|
4191
4200
|
return t ? {
|
|
4192
4201
|
position: "sticky",
|
|
@@ -4197,26 +4206,26 @@ function Ea(e) {
|
|
|
4197
4206
|
}
|
|
4198
4207
|
//#endregion
|
|
4199
4208
|
//#region src/components/TableV2/TableV2.tsx
|
|
4200
|
-
function
|
|
4209
|
+
function ja(e, t, n) {
|
|
4201
4210
|
let [r, i] = m(n);
|
|
4202
4211
|
return [e === void 0 ? r : e, (e) => {
|
|
4203
4212
|
i((t) => typeof e == "function" ? e(t) : e), t?.(e);
|
|
4204
4213
|
}];
|
|
4205
4214
|
}
|
|
4206
|
-
var
|
|
4207
|
-
function
|
|
4208
|
-
let c = e.column, l =
|
|
4215
|
+
var Ma = /* @__PURE__ */ new Set(["select", "actions"]);
|
|
4216
|
+
function Na({ header: e, density: t, enableSorting: n, enableFiltering: r, enableColumnOrdering: i, enableColumnResizing: a, enablePinning: o, enableColumnVisibility: s }) {
|
|
4217
|
+
let c = e.column, l = Ma.has(c.id), u = i && !l, d = wa(c.id), f = c.columnDef.meta?.align ?? "left", p = c.getIsSorted(), m = !l && (o && c.getCanPin() || s && c.getCanHide()), h = ke(c.columnDef.header, e.getContext());
|
|
4209
4218
|
return /* @__PURE__ */ J("th", {
|
|
4210
4219
|
ref: u ? d.setNodeRef : void 0,
|
|
4211
4220
|
colSpan: e.colSpan,
|
|
4212
4221
|
scope: "col",
|
|
4213
4222
|
style: {
|
|
4214
4223
|
width: a ? e.getSize() : void 0,
|
|
4215
|
-
...
|
|
4224
|
+
...Aa(c),
|
|
4216
4225
|
...u ? d.style : null
|
|
4217
4226
|
},
|
|
4218
4227
|
"aria-sort": p === "asc" ? "ascending" : p === "desc" ? "descending" : void 0,
|
|
4219
|
-
className: Z("relative px-4 whitespace-nowrap bg-bg-container",
|
|
4228
|
+
className: Z("relative px-4 whitespace-nowrap bg-bg-container", Ea[t], Da[f]),
|
|
4220
4229
|
children: [
|
|
4221
4230
|
/* @__PURE__ */ J("div", {
|
|
4222
4231
|
className: "flex items-center gap-1",
|
|
@@ -4244,34 +4253,34 @@ function ka({ header: e, density: t, enableSorting: n, enableFiltering: r, enabl
|
|
|
4244
4253
|
className: "truncate",
|
|
4245
4254
|
children: h
|
|
4246
4255
|
}),
|
|
4247
|
-
m && /* @__PURE__ */ J(
|
|
4256
|
+
m && /* @__PURE__ */ J(_r, { children: [/* @__PURE__ */ q(vr, { children: /* @__PURE__ */ q("button", {
|
|
4248
4257
|
type: "button",
|
|
4249
4258
|
"aria-label": `${typeof h == "string" ? h : c.id} column options`,
|
|
4250
4259
|
className: "ml-auto shrink-0 text-fg-tertiary hover:text-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 rounded-sm",
|
|
4251
4260
|
children: /* @__PURE__ */ q(z, { className: "h-3.5 w-3.5" })
|
|
4252
|
-
}) }), /* @__PURE__ */ J(
|
|
4261
|
+
}) }), /* @__PURE__ */ J(br, {
|
|
4253
4262
|
align: "start",
|
|
4254
4263
|
children: [
|
|
4255
4264
|
o && c.getCanPin() && /* @__PURE__ */ J(K, { children: [
|
|
4256
|
-
c.getIsPinned() !== "left" && /* @__PURE__ */ q(
|
|
4257
|
-
icon: /* @__PURE__ */ q(
|
|
4265
|
+
c.getIsPinned() !== "left" && /* @__PURE__ */ q(xr, {
|
|
4266
|
+
icon: /* @__PURE__ */ q(oe, { className: "h-4 w-4" }),
|
|
4258
4267
|
onSelect: () => c.pin("left"),
|
|
4259
4268
|
children: "Pin left"
|
|
4260
4269
|
}),
|
|
4261
|
-
c.getIsPinned() !== "right" && /* @__PURE__ */ q(
|
|
4262
|
-
icon: /* @__PURE__ */ q(
|
|
4270
|
+
c.getIsPinned() !== "right" && /* @__PURE__ */ q(xr, {
|
|
4271
|
+
icon: /* @__PURE__ */ q(oe, { className: "h-4 w-4" }),
|
|
4263
4272
|
onSelect: () => c.pin("right"),
|
|
4264
4273
|
children: "Pin right"
|
|
4265
4274
|
}),
|
|
4266
|
-
c.getIsPinned() && /* @__PURE__ */ q(
|
|
4267
|
-
icon: /* @__PURE__ */ q(
|
|
4275
|
+
c.getIsPinned() && /* @__PURE__ */ q(xr, {
|
|
4276
|
+
icon: /* @__PURE__ */ q(se, { className: "h-4 w-4" }),
|
|
4268
4277
|
onSelect: () => c.pin(!1),
|
|
4269
4278
|
children: "Unpin"
|
|
4270
4279
|
})
|
|
4271
4280
|
] }),
|
|
4272
|
-
o && c.getCanPin() && s && c.getCanHide() && /* @__PURE__ */ q(
|
|
4273
|
-
s && c.getCanHide() && /* @__PURE__ */ q(
|
|
4274
|
-
icon: /* @__PURE__ */ q(
|
|
4281
|
+
o && c.getCanPin() && s && c.getCanHide() && /* @__PURE__ */ q(Sr, {}),
|
|
4282
|
+
s && c.getCanHide() && /* @__PURE__ */ q(xr, {
|
|
4283
|
+
icon: /* @__PURE__ */ q(N, { className: "h-4 w-4" }),
|
|
4275
4284
|
onSelect: () => c.toggleVisibility(!1),
|
|
4276
4285
|
children: "Hide column"
|
|
4277
4286
|
})
|
|
@@ -4282,7 +4291,7 @@ function ka({ header: e, density: t, enableSorting: n, enableFiltering: r, enabl
|
|
|
4282
4291
|
r && c.getCanFilter() && /* @__PURE__ */ q("div", {
|
|
4283
4292
|
className: "mt-2 normal-case",
|
|
4284
4293
|
onClick: (e) => e.stopPropagation(),
|
|
4285
|
-
children: /* @__PURE__ */ q(
|
|
4294
|
+
children: /* @__PURE__ */ q(ha, { column: c })
|
|
4286
4295
|
}),
|
|
4287
4296
|
a && c.getCanResize() && /* @__PURE__ */ q("div", {
|
|
4288
4297
|
onMouseDown: e.getResizeHandler(),
|
|
@@ -4293,8 +4302,8 @@ function ka({ header: e, density: t, enableSorting: n, enableFiltering: r, enabl
|
|
|
4293
4302
|
]
|
|
4294
4303
|
});
|
|
4295
4304
|
}
|
|
4296
|
-
function
|
|
4297
|
-
let n = e.getVisibleCells(), r = n.find((e) => !
|
|
4305
|
+
function Pa({ row: e, onRowClick: t }) {
|
|
4306
|
+
let n = e.getVisibleCells(), r = n.find((e) => !Ma.has(e.column.id)), i = n.find((e) => e.column.id === "select"), a = n.find((e) => e.column.id === "actions"), o = n.filter((e) => e !== r && !Ma.has(e.column.id));
|
|
4298
4307
|
return /* @__PURE__ */ J("div", {
|
|
4299
4308
|
"data-selected": e.getIsSelected() || void 0,
|
|
4300
4309
|
onClick: t ? () => t(e.original) : void 0,
|
|
@@ -4304,12 +4313,12 @@ function Aa({ row: e, onRowClick: t }) {
|
|
|
4304
4313
|
children: [/* @__PURE__ */ J("div", {
|
|
4305
4314
|
className: "flex items-center gap-2",
|
|
4306
4315
|
children: [
|
|
4307
|
-
i &&
|
|
4316
|
+
i && ke(i.column.columnDef.cell, i.getContext()),
|
|
4308
4317
|
/* @__PURE__ */ q("div", {
|
|
4309
4318
|
className: "flex-1 min-w-0 text-p-std font-medium text-fg-default truncate",
|
|
4310
|
-
children: r &&
|
|
4319
|
+
children: r && ke(r.column.columnDef.cell, r.getContext())
|
|
4311
4320
|
}),
|
|
4312
|
-
a &&
|
|
4321
|
+
a && ke(a.column.columnDef.cell, a.getContext())
|
|
4313
4322
|
]
|
|
4314
4323
|
}), o.length > 0 && /* @__PURE__ */ q("dl", {
|
|
4315
4324
|
className: "grid grid-cols-2 gap-2",
|
|
@@ -4322,33 +4331,33 @@ function Aa({ row: e, onRowClick: t }) {
|
|
|
4322
4331
|
children: typeof t == "string" ? t : e.column.id
|
|
4323
4332
|
}), /* @__PURE__ */ q("dd", {
|
|
4324
4333
|
className: "text-p-sm text-fg-default truncate",
|
|
4325
|
-
children:
|
|
4334
|
+
children: ke(e.column.columnDef.cell, e.getContext())
|
|
4326
4335
|
})]
|
|
4327
4336
|
}, e.id);
|
|
4328
4337
|
})
|
|
4329
4338
|
})]
|
|
4330
4339
|
});
|
|
4331
4340
|
}
|
|
4332
|
-
function
|
|
4341
|
+
function Fa({ rowCount: e }) {
|
|
4333
4342
|
return /* @__PURE__ */ q("div", { children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ J("div", {
|
|
4334
4343
|
"aria-hidden": t > 0 || void 0,
|
|
4335
4344
|
className: "flex flex-col gap-2 border-b border-border-default p-4",
|
|
4336
|
-
children: [/* @__PURE__ */ q(
|
|
4345
|
+
children: [/* @__PURE__ */ q(Ui, {
|
|
4337
4346
|
variant: "text",
|
|
4338
4347
|
width: "60%"
|
|
4339
|
-
}), /* @__PURE__ */ q(
|
|
4348
|
+
}), /* @__PURE__ */ q(Ui, {
|
|
4340
4349
|
variant: "text",
|
|
4341
4350
|
width: "90%"
|
|
4342
4351
|
})]
|
|
4343
4352
|
}, t)) });
|
|
4344
4353
|
}
|
|
4345
|
-
function
|
|
4346
|
-
let { data: n, columns: r, loading: i = !1, error: a, emptyMessage: o = "No results", getRowId: s, enableSorting: c = !1, enableMultiSort: l = !1, sorting: u, onSortingChange: h, manualSorting: g = !1, enableFiltering: _ = !1, columnFilters: v, onColumnFiltersChange: y, manualFiltering: b = !1, enableGlobalFilter: x = !1, globalFilter: S, onGlobalFilterChange: C, enableRowSelection: w = !1, enableMultiRowSelection: T = !0, rowSelection: E, onRowSelectionChange: D, enableColumnVisibility: O = !1, columnVisibility: k, onColumnVisibilityChange: A, enableColumnOrdering: j = !1, columnOrder: M, onColumnOrderChange:
|
|
4354
|
+
function Ia(e, t) {
|
|
4355
|
+
let { data: n, columns: r, loading: i = !1, error: a, emptyMessage: o = "No results", getRowId: s, enableSorting: c = !1, enableMultiSort: l = !1, sorting: u, onSortingChange: h, manualSorting: g = !1, enableFiltering: _ = !1, columnFilters: v, onColumnFiltersChange: y, manualFiltering: b = !1, enableGlobalFilter: x = !1, globalFilter: S, onGlobalFilterChange: C, enableRowSelection: w = !1, enableMultiRowSelection: T = !0, rowSelection: E, onRowSelectionChange: D, enableColumnVisibility: O = !1, columnVisibility: k, onColumnVisibilityChange: A, enableColumnOrdering: j = !1, columnOrder: M, onColumnOrderChange: N, enablePinning: ee = !1, columnPinning: te, onColumnPinningChange: P, enableColumnResizing: F = !1, columnResizeMode: I = "onChange", enablePagination: L = !1, pageSize: R = 10, pageSizeOptions: ne, pagination: z, onPaginationChange: re, locale: ie = "en-US", manualPagination: ae = !1, pageCount: oe, rowCount: se, enableVirtualization: B = !1, estimatedRowHeight: ce = 44, maxBodyHeight: le = 480, onRowClick: ue, toolbar: de = !1, toolbarActions: fe, searchPlaceholder: pe, onRefresh: me, onExport: he, density: ge = "comfortable", stickyHeader: V = !1, fillHeight: H = !1, wrapperClassName: U, className: W, dataTestId: G } = e, [_e, ve] = ja(u, h, []), [ye, be] = ja(v, y, []), [xe, Se] = ja(S, C, ""), [Ce, we] = ja(E, D, {}), [Te, Ee] = ja(k, A, {}), [De, Ie] = ja(M, N, []), [Le, Re] = ja(te, P, {}), [ze, Be] = ja(z, re, {
|
|
4347
4356
|
pageIndex: 0,
|
|
4348
4357
|
pageSize: R
|
|
4349
|
-
}),
|
|
4358
|
+
}), He = Pe({
|
|
4350
4359
|
data: n,
|
|
4351
|
-
columns: f(() => !w || r.some((e) => e.id === "select") ? r : [
|
|
4360
|
+
columns: f(() => !w || r.some((e) => e.id === "select") ? r : [Oa(), ...r], [r, w]),
|
|
4352
4361
|
getRowId: s,
|
|
4353
4362
|
state: {
|
|
4354
4363
|
sorting: _e,
|
|
@@ -4356,7 +4365,7 @@ function Ma(e, t) {
|
|
|
4356
4365
|
globalFilter: xe,
|
|
4357
4366
|
rowSelection: Ce,
|
|
4358
4367
|
columnVisibility: Te,
|
|
4359
|
-
columnOrder:
|
|
4368
|
+
columnOrder: De,
|
|
4360
4369
|
columnPinning: Le,
|
|
4361
4370
|
pagination: ze
|
|
4362
4371
|
},
|
|
@@ -4367,7 +4376,7 @@ function Ma(e, t) {
|
|
|
4367
4376
|
onColumnVisibilityChange: Ee,
|
|
4368
4377
|
onColumnOrderChange: Ie,
|
|
4369
4378
|
onColumnPinningChange: Re,
|
|
4370
|
-
onPaginationChange:
|
|
4379
|
+
onPaginationChange: Be,
|
|
4371
4380
|
enableSorting: c,
|
|
4372
4381
|
enableMultiSort: l,
|
|
4373
4382
|
manualSorting: g,
|
|
@@ -4381,105 +4390,105 @@ function Ma(e, t) {
|
|
|
4381
4390
|
manualPagination: ae,
|
|
4382
4391
|
pageCount: oe,
|
|
4383
4392
|
rowCount: se,
|
|
4384
|
-
getCoreRowModel:
|
|
4385
|
-
getSortedRowModel: c ?
|
|
4386
|
-
getFilteredRowModel: _ || x ?
|
|
4387
|
-
getPaginationRowModel: L ?
|
|
4388
|
-
}),
|
|
4393
|
+
getCoreRowModel: Ae(),
|
|
4394
|
+
getSortedRowModel: c ? Ne() : void 0,
|
|
4395
|
+
getFilteredRowModel: _ || x ? je() : void 0,
|
|
4396
|
+
getPaginationRowModel: L ? Me() : void 0
|
|
4397
|
+
}), X = He.getRowModel().rows, Ue = He.getVisibleLeafColumns().length, We = p(null), [Ge, Ke] = m(null);
|
|
4389
4398
|
d(() => {
|
|
4390
4399
|
if (!L || B) return;
|
|
4391
4400
|
let e = We.current?.getBoundingClientRect().height;
|
|
4392
|
-
e && e !==
|
|
4401
|
+
e && e !== Ge && Ke(e);
|
|
4393
4402
|
}, [
|
|
4394
4403
|
L,
|
|
4395
4404
|
B,
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4405
|
+
ge,
|
|
4406
|
+
X,
|
|
4407
|
+
Ge
|
|
4399
4408
|
]);
|
|
4400
|
-
let
|
|
4401
|
-
columnOrder:
|
|
4409
|
+
let qe = Ge ?? ce, Je = L && !B ? Math.max(0, ze.pageSize - X.length) * qe : 0, Ye = f(() => De.length > 0 ? De : He.getAllLeafColumns().map((e) => e.id), [De, He]), Xe = Ca({
|
|
4410
|
+
columnOrder: Ye,
|
|
4402
4411
|
onColumnOrderChange: Ie
|
|
4403
|
-
}),
|
|
4404
|
-
count:
|
|
4405
|
-
getScrollElement: () =>
|
|
4412
|
+
}), Ze = (e) => Xe.handleDragEnd(e), Qe = p(null), $e = Oe({
|
|
4413
|
+
count: X.length,
|
|
4414
|
+
getScrollElement: () => Qe.current,
|
|
4406
4415
|
estimateSize: () => ce,
|
|
4407
4416
|
overscan: 10,
|
|
4408
4417
|
enabled: B
|
|
4409
|
-
}),
|
|
4418
|
+
}), et = B ? $e.getVirtualItems() : null, tt = et && et.length > 0 ? et[0]?.start ?? 0 : 0, nt = et && et.length > 0 ? $e.getTotalSize() - (et[et.length - 1]?.end ?? 0) : 0, rt = Q(G), it = (e) => {
|
|
4410
4419
|
let t = e.original?.id;
|
|
4411
4420
|
return typeof t == "string" || typeof t == "number" ? String(t) : e.id;
|
|
4412
|
-
},
|
|
4421
|
+
}, at = (e, t) => /* @__PURE__ */ q("tr", {
|
|
4413
4422
|
ref: t,
|
|
4414
|
-
"data-test-id":
|
|
4415
|
-
"data-row-id":
|
|
4423
|
+
"data-test-id": rt(`row-${it(e)}`),
|
|
4424
|
+
"data-row-id": it(e),
|
|
4416
4425
|
"data-selected": e.getIsSelected() || void 0,
|
|
4417
4426
|
onClick: ue ? () => ue(e.original) : void 0,
|
|
4418
4427
|
className: Z("group border-t border-border-default", ue && "cursor-pointer"),
|
|
4419
4428
|
children: e.getVisibleCells().map((e) => /* @__PURE__ */ q("td", {
|
|
4420
|
-
"data-test-id":
|
|
4421
|
-
style:
|
|
4422
|
-
className: Z("bg-bg-default px-4 group-hover:bg-bg-container group-data-[selected]:bg-brand-50",
|
|
4423
|
-
children:
|
|
4429
|
+
"data-test-id": rt(`cell-${e.column.id}`),
|
|
4430
|
+
style: Aa(e.column),
|
|
4431
|
+
className: Z("bg-bg-default px-4 group-hover:bg-bg-container group-data-[selected]:bg-brand-50", Ea[ge], Da[e.column.columnDef.meta?.align ?? "left"]),
|
|
4432
|
+
children: ke(e.column.columnDef.cell, e.getContext())
|
|
4424
4433
|
}, e.id))
|
|
4425
|
-
}, e.id),
|
|
4426
|
-
"data-test-id":
|
|
4427
|
-
children: t.map((e) => /* @__PURE__ */ q(
|
|
4434
|
+
}, e.id), ot = (e, t) => /* @__PURE__ */ q("tr", {
|
|
4435
|
+
"data-test-id": rt(`header-row-${e}`),
|
|
4436
|
+
children: t.map((e) => /* @__PURE__ */ q(Na, {
|
|
4428
4437
|
header: e,
|
|
4429
|
-
density:
|
|
4438
|
+
density: ge,
|
|
4430
4439
|
enableSorting: c,
|
|
4431
4440
|
enableFiltering: _,
|
|
4432
4441
|
enableColumnOrdering: j,
|
|
4433
4442
|
enableColumnResizing: F,
|
|
4434
|
-
enablePinning:
|
|
4443
|
+
enablePinning: ee,
|
|
4435
4444
|
enableColumnVisibility: O
|
|
4436
4445
|
}, e.id))
|
|
4437
|
-
}, e),
|
|
4446
|
+
}, e), st = /* @__PURE__ */ J("table", {
|
|
4438
4447
|
className: "w-full border-collapse text-p-std text-fg-default",
|
|
4439
|
-
style: { width: F ?
|
|
4448
|
+
style: { width: F ? He.getTotalSize() : "100%" },
|
|
4440
4449
|
children: [/* @__PURE__ */ q("thead", {
|
|
4441
|
-
className: Z("text-p-sm font-semibold text-fg-secondary uppercase tracking-wider", (
|
|
4442
|
-
children:
|
|
4443
|
-
}), /* @__PURE__ */ q("tbody", { children: i ? /* @__PURE__ */ q(
|
|
4450
|
+
className: Z("text-p-sm font-semibold text-fg-secondary uppercase tracking-wider", (V || H) && "sticky top-0 z-10"),
|
|
4451
|
+
children: He.getHeaderGroups().map((e) => ot(e.id, e.headers))
|
|
4452
|
+
}), /* @__PURE__ */ q("tbody", { children: i ? /* @__PURE__ */ q(va, {
|
|
4444
4453
|
columnCount: Ue,
|
|
4445
4454
|
rowCount: ze.pageSize,
|
|
4446
|
-
testIdPrefix:
|
|
4447
|
-
}) :
|
|
4448
|
-
"data-test-id":
|
|
4455
|
+
testIdPrefix: G
|
|
4456
|
+
}) : X.length === 0 ? /* @__PURE__ */ q("tr", {
|
|
4457
|
+
"data-test-id": rt("empty-row"),
|
|
4449
4458
|
children: /* @__PURE__ */ q("td", {
|
|
4450
4459
|
colSpan: Ue,
|
|
4451
4460
|
className: "p-0",
|
|
4452
|
-
children: /* @__PURE__ */ q(
|
|
4461
|
+
children: /* @__PURE__ */ q(Er, {
|
|
4453
4462
|
size: "sm",
|
|
4454
4463
|
title: o
|
|
4455
4464
|
})
|
|
4456
4465
|
})
|
|
4457
|
-
}) : B &&
|
|
4458
|
-
|
|
4466
|
+
}) : B && et ? /* @__PURE__ */ J(K, { children: [
|
|
4467
|
+
tt > 0 && /* @__PURE__ */ q("tr", {
|
|
4459
4468
|
"aria-hidden": !0,
|
|
4460
|
-
"data-test-id":
|
|
4469
|
+
"data-test-id": rt("padding-top-row"),
|
|
4461
4470
|
children: /* @__PURE__ */ q("td", {
|
|
4462
|
-
style: { height:
|
|
4471
|
+
style: { height: tt },
|
|
4463
4472
|
colSpan: Ue
|
|
4464
4473
|
})
|
|
4465
4474
|
}),
|
|
4466
|
-
|
|
4467
|
-
let t =
|
|
4468
|
-
return t ?
|
|
4475
|
+
et.map((e) => {
|
|
4476
|
+
let t = X[e.index];
|
|
4477
|
+
return t ? at(t) : null;
|
|
4469
4478
|
}),
|
|
4470
|
-
|
|
4479
|
+
nt > 0 && /* @__PURE__ */ q("tr", {
|
|
4471
4480
|
"aria-hidden": !0,
|
|
4472
|
-
"data-test-id":
|
|
4481
|
+
"data-test-id": rt("padding-bottom-row"),
|
|
4473
4482
|
children: /* @__PURE__ */ q("td", {
|
|
4474
|
-
style: { height:
|
|
4483
|
+
style: { height: nt },
|
|
4475
4484
|
colSpan: Ue
|
|
4476
4485
|
})
|
|
4477
4486
|
})
|
|
4478
|
-
] }) : /* @__PURE__ */ J(K, { children: [
|
|
4487
|
+
] }) : /* @__PURE__ */ J(K, { children: [X.map((e, t) => at(e, t === 0 ? We : void 0)), Je > 0 && /* @__PURE__ */ q("tr", {
|
|
4479
4488
|
"aria-hidden": !0,
|
|
4480
|
-
"data-test-id":
|
|
4489
|
+
"data-test-id": rt("filler-row"),
|
|
4481
4490
|
children: /* @__PURE__ */ q("td", {
|
|
4482
|
-
style: { height:
|
|
4491
|
+
style: { height: Je },
|
|
4483
4492
|
colSpan: Ue,
|
|
4484
4493
|
className: "p-0"
|
|
4485
4494
|
})
|
|
@@ -4487,73 +4496,73 @@ function Ma(e, t) {
|
|
|
4487
4496
|
});
|
|
4488
4497
|
return /* @__PURE__ */ J("div", {
|
|
4489
4498
|
ref: t,
|
|
4490
|
-
"data-test-id":
|
|
4491
|
-
className: Z("w-full rounded-lg border border-border-default bg-bg-default",
|
|
4499
|
+
"data-test-id": G,
|
|
4500
|
+
className: Z("w-full rounded-lg border border-border-default bg-bg-default", H && "h-full flex flex-col", U, W),
|
|
4492
4501
|
children: [
|
|
4493
|
-
|
|
4494
|
-
table:
|
|
4502
|
+
de === !1 ? null : de ?? /* @__PURE__ */ q(xa, {
|
|
4503
|
+
table: He,
|
|
4495
4504
|
enableGlobalFilter: x,
|
|
4496
4505
|
enableColumnVisibility: O,
|
|
4497
|
-
searchPlaceholder:
|
|
4498
|
-
onRefresh:
|
|
4499
|
-
onExport:
|
|
4500
|
-
actions:
|
|
4506
|
+
searchPlaceholder: pe,
|
|
4507
|
+
onRefresh: me,
|
|
4508
|
+
onExport: he,
|
|
4509
|
+
actions: fe
|
|
4501
4510
|
}),
|
|
4502
4511
|
a ? /* @__PURE__ */ q("div", {
|
|
4503
4512
|
className: "p-4",
|
|
4504
|
-
children: /* @__PURE__ */ q(
|
|
4513
|
+
children: /* @__PURE__ */ q(Pr, {
|
|
4505
4514
|
variant: "danger",
|
|
4506
4515
|
title: "Couldn't load data",
|
|
4507
4516
|
description: a
|
|
4508
4517
|
})
|
|
4509
4518
|
}) : /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q("div", {
|
|
4510
|
-
className: Z("hidden",
|
|
4519
|
+
className: Z("hidden", H ? "md:flex md:flex-col md:flex-1 md:min-h-0" : "md:block"),
|
|
4511
4520
|
children: /* @__PURE__ */ q("div", {
|
|
4512
|
-
ref:
|
|
4513
|
-
className: Z("w-full overflow-auto",
|
|
4514
|
-
style:
|
|
4515
|
-
children: j ? /* @__PURE__ */ q(
|
|
4516
|
-
sensors:
|
|
4517
|
-
collisionDetection:
|
|
4518
|
-
modifiers:
|
|
4519
|
-
onDragEnd:
|
|
4520
|
-
children: /* @__PURE__ */ q(
|
|
4521
|
-
items:
|
|
4521
|
+
ref: Qe,
|
|
4522
|
+
className: Z("w-full overflow-auto", de === !1 ? "rounded-lg" : "rounded-b-lg", H && "flex-1 min-h-0"),
|
|
4523
|
+
style: H ? void 0 : B || V ? { maxHeight: le } : void 0,
|
|
4524
|
+
children: j ? /* @__PURE__ */ q(Fe, {
|
|
4525
|
+
sensors: Xe.sensors,
|
|
4526
|
+
collisionDetection: Xe.collisionDetection,
|
|
4527
|
+
modifiers: Xe.modifiers,
|
|
4528
|
+
onDragEnd: Ze,
|
|
4529
|
+
children: /* @__PURE__ */ q(Ve, {
|
|
4530
|
+
items: Ye,
|
|
4522
4531
|
strategy: Y,
|
|
4523
|
-
children:
|
|
4532
|
+
children: st
|
|
4524
4533
|
})
|
|
4525
|
-
}) :
|
|
4534
|
+
}) : st
|
|
4526
4535
|
})
|
|
4527
4536
|
}), /* @__PURE__ */ q("div", {
|
|
4528
4537
|
className: "md:hidden",
|
|
4529
|
-
children: i ? /* @__PURE__ */ q(
|
|
4538
|
+
children: i ? /* @__PURE__ */ q(Fa, { rowCount: ze.pageSize }) : X.length === 0 ? /* @__PURE__ */ q(Er, {
|
|
4530
4539
|
size: "sm",
|
|
4531
4540
|
title: o
|
|
4532
|
-
}) :
|
|
4541
|
+
}) : X.map((e) => /* @__PURE__ */ q(Pa, {
|
|
4533
4542
|
row: e,
|
|
4534
4543
|
onRowClick: ue
|
|
4535
4544
|
}, e.id))
|
|
4536
4545
|
})] }),
|
|
4537
|
-
L && !a && /* @__PURE__ */ q(
|
|
4538
|
-
table:
|
|
4539
|
-
pageSizeOptions:
|
|
4546
|
+
L && !a && /* @__PURE__ */ q(_a, {
|
|
4547
|
+
table: He,
|
|
4548
|
+
pageSizeOptions: ne,
|
|
4540
4549
|
locale: ie,
|
|
4541
|
-
dataTestId:
|
|
4550
|
+
dataTestId: G
|
|
4542
4551
|
})
|
|
4543
4552
|
]
|
|
4544
4553
|
});
|
|
4545
4554
|
}
|
|
4546
|
-
var
|
|
4547
|
-
|
|
4555
|
+
var La = a(Ia);
|
|
4556
|
+
La.displayName = "TableV2";
|
|
4548
4557
|
//#endregion
|
|
4549
4558
|
//#region src/components/Tabs/Tabs.tsx
|
|
4550
|
-
var
|
|
4551
|
-
function
|
|
4552
|
-
let e = c(
|
|
4559
|
+
var Ra = r(null);
|
|
4560
|
+
function za() {
|
|
4561
|
+
let e = c(Ra);
|
|
4553
4562
|
if (!e) throw Error("Tab components must be used inside <Tabs>");
|
|
4554
4563
|
return e;
|
|
4555
4564
|
}
|
|
4556
|
-
function
|
|
4565
|
+
function Ba(t) {
|
|
4557
4566
|
let n = [];
|
|
4558
4567
|
e.forEach(t, (e) => {
|
|
4559
4568
|
o(e) && n.push(e);
|
|
@@ -4567,9 +4576,9 @@ function Ia(t) {
|
|
|
4567
4576
|
}
|
|
4568
4577
|
return "";
|
|
4569
4578
|
}
|
|
4570
|
-
var
|
|
4571
|
-
let [f, p] = m(() => e ??
|
|
4572
|
-
return /* @__PURE__ */ q(
|
|
4579
|
+
var Va = a(function({ defaultValue: e, value: t, onValueChange: n, variant: r = "underline", size: i = "md", disabled: a = !1, className: o, children: s, dataTestId: c, ...l }, d) {
|
|
4580
|
+
let [f, p] = m(() => e ?? Ba(s)), h = t !== void 0, g = h ? t : f, _ = u();
|
|
4581
|
+
return /* @__PURE__ */ q(Ra.Provider, {
|
|
4573
4582
|
value: {
|
|
4574
4583
|
value: g,
|
|
4575
4584
|
setValue: (e) => {
|
|
@@ -4588,10 +4597,10 @@ var La = a(function({ defaultValue: e, value: t, onValueChange: n, variant: r =
|
|
|
4588
4597
|
children: s
|
|
4589
4598
|
})
|
|
4590
4599
|
});
|
|
4591
|
-
}),
|
|
4592
|
-
let { variant: s } =
|
|
4600
|
+
}), Ha = a(function({ children: e, scrollable: t = !1, className: n, dataTestId: r, onKeyDown: i, ...a }, o) {
|
|
4601
|
+
let { variant: s } = za(), c = p(null);
|
|
4593
4602
|
return /* @__PURE__ */ q("div", {
|
|
4594
|
-
ref:
|
|
4603
|
+
ref: Yt(o, c),
|
|
4595
4604
|
role: "tablist",
|
|
4596
4605
|
onKeyDown: (e) => {
|
|
4597
4606
|
i?.(e);
|
|
@@ -4611,12 +4620,12 @@ var La = a(function({ defaultValue: e, value: t, onValueChange: n, variant: r =
|
|
|
4611
4620
|
children: e
|
|
4612
4621
|
});
|
|
4613
4622
|
});
|
|
4614
|
-
|
|
4615
|
-
var
|
|
4623
|
+
Ha.displayName = "TabList";
|
|
4624
|
+
var Ua = {
|
|
4616
4625
|
lg: "h-11 px-4 text-p-md",
|
|
4617
4626
|
md: "h-10 px-3 text-p-std",
|
|
4618
4627
|
sm: "h-8 px-2.5 text-p-sm"
|
|
4619
|
-
},
|
|
4628
|
+
}, Wa = {
|
|
4620
4629
|
underline: {
|
|
4621
4630
|
on: "bg-brand-500 text-white",
|
|
4622
4631
|
off: "bg-bg-subtle text-fg-secondary"
|
|
@@ -4629,8 +4638,8 @@ var za = {
|
|
|
4629
4638
|
on: "bg-brand-500 text-white",
|
|
4630
4639
|
off: "bg-bg-subtle text-fg-secondary"
|
|
4631
4640
|
}
|
|
4632
|
-
},
|
|
4633
|
-
let { value: h, setValue: g, variant: _, size: v, tabsId: y, disabled: b } =
|
|
4641
|
+
}, Ga = a(function({ value: e, children: t, disabled: n, icon: r, badge: i, badgeProps: a, rightIcon: o, onRightIconClick: s, rightIconLabel: c, className: l, dataTestId: u, onClick: d, id: f, ...p }, m) {
|
|
4642
|
+
let { value: h, setValue: g, variant: _, size: v, tabsId: y, disabled: b } = za(), x = Qe(h, e), S = b || n, C = i != null && i !== !1, w = f ?? `${y}-tab-${e}`, T = `${y}-panel-${e}`, E = Z("group relative inline-flex items-center justify-center gap-2 font-medium outline-none transition-colors", "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1 focus-visible:rounded-md", Ua[v], S && "opacity-50 cursor-not-allowed"), D = _ === "underline" ? Z("rounded-t-lg", x ? "text-fg-default" : "text-fg-secondary hover:text-fg-default hover:bg-bg-subtle/60") : _ === "pills" ? Z("rounded-full", x ? "bg-bg-default text-fg-default shadow-z1" : "bg-transparent text-fg-secondary hover:text-fg-default") : Z("border-r border-border-default last:border-r-0", x ? "bg-bg-default text-fg-default" : "bg-transparent text-fg-secondary hover:bg-bg-subtle"), O = /* @__PURE__ */ J("button", {
|
|
4634
4643
|
ref: m,
|
|
4635
4644
|
id: w,
|
|
4636
4645
|
type: "button",
|
|
@@ -4654,12 +4663,12 @@ var za = {
|
|
|
4654
4663
|
className: "truncate",
|
|
4655
4664
|
children: t
|
|
4656
4665
|
}),
|
|
4657
|
-
C && (a ? /* @__PURE__ */ q(
|
|
4666
|
+
C && (a ? /* @__PURE__ */ q(Ft, {
|
|
4658
4667
|
size: "xs",
|
|
4659
4668
|
...a,
|
|
4660
4669
|
children: i
|
|
4661
4670
|
}) : /* @__PURE__ */ q("span", {
|
|
4662
|
-
className: Z("inline-flex items-center justify-center shrink-0 rounded-full px-1.5 h-5 min-w-[1.25rem]", "text-label-xs font-semibold tabular-nums leading-none transition-colors", x ?
|
|
4671
|
+
className: Z("inline-flex items-center justify-center shrink-0 rounded-full px-1.5 h-5 min-w-[1.25rem]", "text-label-xs font-semibold tabular-nums leading-none transition-colors", x ? Wa[_].on : Wa[_].off),
|
|
4663
4672
|
children: i
|
|
4664
4673
|
})),
|
|
4665
4674
|
_ === "underline" && /* @__PURE__ */ q("span", {
|
|
@@ -4681,8 +4690,8 @@ var za = {
|
|
|
4681
4690
|
children: o
|
|
4682
4691
|
})]
|
|
4683
4692
|
}) : O;
|
|
4684
|
-
}),
|
|
4685
|
-
let { value: c, tabsId: l } =
|
|
4693
|
+
}), Ka = a(function({ value: e, children: t, className: n, dataTestId: r, id: i, keepMounted: a = !1, ...o }, s) {
|
|
4694
|
+
let { value: c, tabsId: l } = za(), u = Qe(c, e);
|
|
4686
4695
|
return !u && !a ? null : /* @__PURE__ */ q("div", {
|
|
4687
4696
|
ref: s,
|
|
4688
4697
|
id: i ?? `${l}-panel-${e}`,
|
|
@@ -4694,7 +4703,7 @@ var za = {
|
|
|
4694
4703
|
...o,
|
|
4695
4704
|
children: t
|
|
4696
4705
|
});
|
|
4697
|
-
}),
|
|
4706
|
+
}), qa = a(function({ label: e, labelAddons: t, helperText: n, errorText: r, error: i = !1, id: a, disabled: o, required: s, maxLength: c, showCount: l = !1, className: d, wrapperClassName: f, value: p, defaultValue: h, rows: g = 4, dataTestId: _, onChange: v, ...y }, b) {
|
|
4698
4707
|
let x = u(), S = a ?? x, C = i || !!r, w = r ? `${S}-error` : n ? `${S}-help` : void 0, T = p !== void 0, E = l && !!c, [D, O] = m(() => String(h ?? "").length), k = T ? String(p).length : D;
|
|
4699
4708
|
return /* @__PURE__ */ J("div", {
|
|
4700
4709
|
className: Z("flex flex-col gap-1.5 w-full", f),
|
|
@@ -4705,7 +4714,7 @@ var za = {
|
|
|
4705
4714
|
children: [e && /* @__PURE__ */ J("label", {
|
|
4706
4715
|
htmlFor: S,
|
|
4707
4716
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
4708
|
-
children: [e, s && /* @__PURE__ */ q(
|
|
4717
|
+
children: [e, s && /* @__PURE__ */ q(at, {})]
|
|
4709
4718
|
}), t && /* @__PURE__ */ q("span", {
|
|
4710
4719
|
className: "inline-flex items-center gap-1",
|
|
4711
4720
|
children: t
|
|
@@ -4752,7 +4761,7 @@ var za = {
|
|
|
4752
4761
|
})
|
|
4753
4762
|
]
|
|
4754
4763
|
});
|
|
4755
|
-
}),
|
|
4764
|
+
}), Ja = a(function({ checked: e, label: t, id: n, disabled: r, className: i, dataTestId: a, ...o }, s) {
|
|
4756
4765
|
let c = u(), l = n ?? c;
|
|
4757
4766
|
return /* @__PURE__ */ J("label", {
|
|
4758
4767
|
htmlFor: l,
|
|
@@ -4774,10 +4783,10 @@ var za = {
|
|
|
4774
4783
|
}),
|
|
4775
4784
|
/* @__PURE__ */ J("span", {
|
|
4776
4785
|
className: Z("inline-flex h-8 w-16 items-center justify-between rounded-full border px-2 transition-colors", "peer-checked:bg-gray-700 dark:bg-gray-700 dark:peer-checked:bg-gray-900", "peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2"),
|
|
4777
|
-
children: [/* @__PURE__ */ q(
|
|
4786
|
+
children: [/* @__PURE__ */ q(pe, {
|
|
4778
4787
|
className: "size-4 text-yellow-500 z-1",
|
|
4779
4788
|
"aria-hidden": !0
|
|
4780
|
-
}), /* @__PURE__ */ q(
|
|
4789
|
+
}), /* @__PURE__ */ q(ne, {
|
|
4781
4790
|
className: "size-4 text-gray-400 z-1",
|
|
4782
4791
|
"aria-hidden": !0
|
|
4783
4792
|
})]
|
|
@@ -4792,26 +4801,275 @@ var za = {
|
|
|
4792
4801
|
children: t
|
|
4793
4802
|
})]
|
|
4794
4803
|
});
|
|
4795
|
-
}),
|
|
4804
|
+
}), Ya = 1440, Xa = 15, Za = (e) => String(e).padStart(2, "0");
|
|
4805
|
+
function Qa(e) {
|
|
4806
|
+
return `${Za(Math.floor(e / 60))}:${Za(e % 60)}`;
|
|
4807
|
+
}
|
|
4808
|
+
function $a(e) {
|
|
4809
|
+
let t = /^(\d{1,2}):(\d{2})$/.exec(e.trim());
|
|
4810
|
+
if (!t) return null;
|
|
4811
|
+
let n = Number(t[1]), r = Number(t[2]);
|
|
4812
|
+
return n > 23 || r > 59 ? null : n * 60 + r;
|
|
4813
|
+
}
|
|
4814
|
+
function eo(e) {
|
|
4815
|
+
if (e == null) return null;
|
|
4816
|
+
let t = $a(e);
|
|
4817
|
+
return t === null ? null : Qa(t);
|
|
4818
|
+
}
|
|
4819
|
+
function to(e) {
|
|
4820
|
+
return e !== void 0 && Number.isFinite(e) && e >= 1 && e <= Ya ? Math.floor(e) : Xa;
|
|
4821
|
+
}
|
|
4822
|
+
function no(e) {
|
|
4823
|
+
let t = to(e), n = [];
|
|
4824
|
+
for (let e = 0; e < Ya; e += t) n.push(Qa(e));
|
|
4825
|
+
return n;
|
|
4826
|
+
}
|
|
4827
|
+
function ro({ minTime: e, maxTime: t, excludeTimes: n, filterTime: r }) {
|
|
4828
|
+
let i = eo(e), a = eo(t), o = new Set((n ?? []).map(eo).filter((e) => e !== null));
|
|
4829
|
+
return (e) => i !== null && e < i || a !== null && e > a || o.has(e) || (r ? !r(e) : !1);
|
|
4830
|
+
}
|
|
4831
|
+
var io = (e) => e !== void 0 && Number(e) <= 5;
|
|
4832
|
+
function ao(e) {
|
|
4833
|
+
let t = e.trim().replace(".", ":");
|
|
4834
|
+
return /^\d{1,2}:\d{2}$/.test(t) ? eo(t) : /^\d{3}$/.test(t) ? io(t[1]) ? eo(`${t[0]}:${t.slice(1)}`) : null : /^\d{4}$/.test(t) ? eo(`${t.slice(0, 2)}:${t.slice(2)}`) : null;
|
|
4835
|
+
}
|
|
4836
|
+
function oo(e) {
|
|
4837
|
+
let t = e.trim().replace(".", ":");
|
|
4838
|
+
if (t === "") return "";
|
|
4839
|
+
let n = ao(t);
|
|
4840
|
+
if (n) return n;
|
|
4841
|
+
let r = /^(\d{1,2}):(\d?)$/.exec(t);
|
|
4842
|
+
if (r) {
|
|
4843
|
+
let e = Number(r[1]), t = r[2] ?? "";
|
|
4844
|
+
return e > 23 || t !== "" && !io(t) ? null : `${Za(e)}:${t}`;
|
|
4845
|
+
}
|
|
4846
|
+
return /^\d{1,3}$/.test(t) ? t.length === 1 ? Number(t) <= 2 ? t : `0${t}` : t.length === 2 ? Number(t) <= 23 ? `${t}:` : io(t[1]) ? `0${t[0]}:${t[1]}` : null : Number(t.slice(0, 2)) <= 23 && io(t[2]) ? `${t.slice(0, 2)}:${t[2]}` : null : null;
|
|
4847
|
+
}
|
|
4848
|
+
function so(e, t, n) {
|
|
4849
|
+
let r = oo(t);
|
|
4850
|
+
if (r === null) return !1;
|
|
4851
|
+
if (e.startsWith(r)) return !0;
|
|
4852
|
+
let i = ao(t);
|
|
4853
|
+
return i !== null && !n(i) && e.startsWith(i.slice(0, 3));
|
|
4854
|
+
}
|
|
4855
|
+
function co(e, t = /* @__PURE__ */ new Date()) {
|
|
4856
|
+
let n = $a(e);
|
|
4857
|
+
if (n === null) throw RangeError(`timeToDate: "${e}" is not a valid HH:mm time`);
|
|
4858
|
+
let r = new Date(t.getTime());
|
|
4859
|
+
return r.setHours(Math.floor(n / 60), n % 60, 0, 0), r;
|
|
4860
|
+
}
|
|
4861
|
+
function lo(e) {
|
|
4862
|
+
return `${Za(e.getHours())}:${Za(e.getMinutes())}`;
|
|
4863
|
+
}
|
|
4864
|
+
//#endregion
|
|
4865
|
+
//#region src/components/TimePicker/TimePickerDesktop.tsx
|
|
4866
|
+
function uo({ value: e, onCommit: t, times: n, isDisabled: r, clearable: i = !1, searchable: a = !0, size: o = "md", label: s, required: c = !1, helperText: l, placeholder: u = "Select time", disabled: d = !1, menuPlacement: p = "auto", error: m = !1, errorText: h, id: g, className: _, dataTestId: v }) {
|
|
4867
|
+
let y = f(() => n.map((e) => ({
|
|
4868
|
+
value: e,
|
|
4869
|
+
label: e,
|
|
4870
|
+
disabled: r(e)
|
|
4871
|
+
})), [n, r]), b = f(() => new Set(n), [n]), x = (e) => {
|
|
4872
|
+
let t = ao(e);
|
|
4873
|
+
return t && !b.has(t) && !r(t) ? t : null;
|
|
4874
|
+
};
|
|
4875
|
+
return /* @__PURE__ */ q(Fi, {
|
|
4876
|
+
options: y,
|
|
4877
|
+
value: e,
|
|
4878
|
+
onChange: (e) => t(e == null ? null : eo(String(e)) ?? ao(String(e))),
|
|
4879
|
+
filterOption: (e, t) => e.data.__isNew__ === !0 || so(e.value, t, (e) => b.has(e)),
|
|
4880
|
+
dropdownIcon: /* @__PURE__ */ q(O, {
|
|
4881
|
+
className: "h-4 w-4",
|
|
4882
|
+
"aria-hidden": !0
|
|
4883
|
+
}),
|
|
4884
|
+
creatable: a,
|
|
4885
|
+
isValidNewOption: (e) => x(e) !== null,
|
|
4886
|
+
formatCreateLabel: (e) => x(e),
|
|
4887
|
+
createOptionPosition: "first",
|
|
4888
|
+
onBlur: (n) => {
|
|
4889
|
+
let i = ao(n.target.value);
|
|
4890
|
+
i && !r(i) && i !== e && t(i);
|
|
4891
|
+
},
|
|
4892
|
+
searchable: a,
|
|
4893
|
+
clearable: i,
|
|
4894
|
+
size: o,
|
|
4895
|
+
label: s,
|
|
4896
|
+
required: c,
|
|
4897
|
+
helperText: l,
|
|
4898
|
+
placeholder: u,
|
|
4899
|
+
disabled: d,
|
|
4900
|
+
menuPlacement: p,
|
|
4901
|
+
error: m,
|
|
4902
|
+
errorText: h,
|
|
4903
|
+
emptyText: "No available time",
|
|
4904
|
+
id: g,
|
|
4905
|
+
className: _,
|
|
4906
|
+
dataTestId: v
|
|
4907
|
+
});
|
|
4908
|
+
}
|
|
4909
|
+
//#endregion
|
|
4910
|
+
//#region src/components/TimePicker/TimePickerMobile.tsx
|
|
4911
|
+
var fo = {
|
|
4912
|
+
lg: "min-h-12 px-3.5 text-p-md",
|
|
4913
|
+
md: "min-h-10 px-3 text-p-std",
|
|
4914
|
+
sm: "min-h-8 px-2.5 text-p-sm"
|
|
4915
|
+
}, po = Array.from({ length: 24 }, (e, t) => Za(t)), mo = Array.from({ length: 60 }, (e, t) => Za(t)), ho = "text-p-md font-medium text-fg-tertiary data-[disabled]:opacity-40", go = "text-p-lg font-semibold text-fg-default data-[disabled]:opacity-40", _o = {
|
|
4916
|
+
optionItem: Z(ho, "justify-end pr-5"),
|
|
4917
|
+
highlightWrapper: "bg-bg-subtle rounded-l-lg",
|
|
4918
|
+
highlightItem: Z(go, "justify-end pr-5")
|
|
4919
|
+
}, vo = {
|
|
4920
|
+
optionItem: Z(ho, "justify-start pl-5"),
|
|
4921
|
+
highlightWrapper: "bg-bg-subtle rounded-r-lg",
|
|
4922
|
+
highlightItem: Z(go, "justify-start pl-5")
|
|
4923
|
+
};
|
|
4924
|
+
function yo({ value: e, onCommit: t, times: n, isDisabled: r, clearable: i = !1, size: a = "md", label: o, required: s = !1, helperText: c, placeholder: l = "Select time", disabled: d = !1, error: p = !1, errorText: h, mobileTitle: g, mobileApplyText: _ = "Apply", id: v, className: y, dataTestId: b }) {
|
|
4925
|
+
let x = u(), S = v ?? x, C = Q(b), w = p || !!h, [T, E] = m(!1), [D, k] = m("00"), [A, j] = m("00"), M = (e, t) => !r(`${e}:${t}`), N = f(() => po.map((e) => ({
|
|
4926
|
+
value: e,
|
|
4927
|
+
label: e,
|
|
4928
|
+
disabled: !mo.some((t) => !r(`${e}:${t}`))
|
|
4929
|
+
})), [r]), ee = f(() => mo.map((e) => ({
|
|
4930
|
+
value: e,
|
|
4931
|
+
label: e,
|
|
4932
|
+
disabled: r(`${D}:${e}`)
|
|
4933
|
+
})), [D, r]), te = (e) => mo.find((t) => M(e, t)), P = () => {
|
|
4934
|
+
let t = lo(/* @__PURE__ */ new Date()), [i = "00", a = "00"] = (e ?? (r(t) ? n.find((e) => !r(e)) ?? t : t)).split(":");
|
|
4935
|
+
k(i), j(a), E(!0);
|
|
4936
|
+
}, F = (e) => {
|
|
4937
|
+
k(e), M(e, A) || j(te(e) ?? A);
|
|
4938
|
+
}, I = `${D}:${A}`, L = !r(I);
|
|
4939
|
+
return /* @__PURE__ */ J("div", {
|
|
4940
|
+
"data-test-id": b,
|
|
4941
|
+
className: "flex w-full flex-col gap-1.5",
|
|
4942
|
+
children: [
|
|
4943
|
+
o && /* @__PURE__ */ J("label", {
|
|
4944
|
+
htmlFor: S,
|
|
4945
|
+
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
4946
|
+
children: [o, s && /* @__PURE__ */ q(at, {})]
|
|
4947
|
+
}),
|
|
4948
|
+
/* @__PURE__ */ J("button", {
|
|
4949
|
+
id: S,
|
|
4950
|
+
type: "button",
|
|
4951
|
+
disabled: d,
|
|
4952
|
+
"aria-haspopup": "dialog",
|
|
4953
|
+
"aria-expanded": T,
|
|
4954
|
+
"aria-invalid": w || void 0,
|
|
4955
|
+
"aria-describedby": h ? `${S}-error` : c ? `${S}-help` : void 0,
|
|
4956
|
+
"data-test-id": C("trigger"),
|
|
4957
|
+
onClick: P,
|
|
4958
|
+
className: Z("flex w-full items-center justify-between gap-2 rounded-lg border bg-bg-default text-left transition-colors", "focus-visible:outline-none", fo[a], w ? "border-red-600" : "border-border-default", !d && !w && "hover:border-border-strong", T && !w && "ring-2 ring-brand-300 border-brand-500", !w && "focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:border-brand-500", w && "focus-visible:ring-2 focus-visible:ring-red-300", d && "cursor-not-allowed border-border-default bg-bg-container hover:border-border-default", y),
|
|
4959
|
+
children: [/* @__PURE__ */ q("span", {
|
|
4960
|
+
className: Z("truncate tabular-nums", e ? "text-fg-default" : "text-fg-tertiary"),
|
|
4961
|
+
children: e ?? l
|
|
4962
|
+
}), /* @__PURE__ */ q(O, {
|
|
4963
|
+
className: "h-4 w-4 shrink-0 text-fg-secondary",
|
|
4964
|
+
"aria-hidden": !0
|
|
4965
|
+
})]
|
|
4966
|
+
}),
|
|
4967
|
+
h ? /* @__PURE__ */ q("p", {
|
|
4968
|
+
id: `${S}-error`,
|
|
4969
|
+
className: "text-p-sm text-fg-danger",
|
|
4970
|
+
children: h
|
|
4971
|
+
}) : c ? /* @__PURE__ */ q("p", {
|
|
4972
|
+
id: `${S}-help`,
|
|
4973
|
+
className: "text-p-sm text-fg-secondary",
|
|
4974
|
+
children: c
|
|
4975
|
+
}) : null,
|
|
4976
|
+
/* @__PURE__ */ q(Lr, {
|
|
4977
|
+
open: T,
|
|
4978
|
+
onClose: () => E(!1),
|
|
4979
|
+
title: g ?? o ?? "Select time",
|
|
4980
|
+
size: "sm",
|
|
4981
|
+
dataTestId: C("dialog"),
|
|
4982
|
+
footer: /* @__PURE__ */ J("div", {
|
|
4983
|
+
className: "flex w-full gap-2",
|
|
4984
|
+
children: [i && e && /* @__PURE__ */ q(ut, {
|
|
4985
|
+
variant: "secondary",
|
|
4986
|
+
onClick: () => {
|
|
4987
|
+
t(null), E(!1);
|
|
4988
|
+
},
|
|
4989
|
+
dataTestId: C("clear"),
|
|
4990
|
+
children: "Clear"
|
|
4991
|
+
}), /* @__PURE__ */ q(ut, {
|
|
4992
|
+
fullWidth: !0,
|
|
4993
|
+
onClick: () => {
|
|
4994
|
+
L && (t(I), E(!1));
|
|
4995
|
+
},
|
|
4996
|
+
disabled: !L,
|
|
4997
|
+
dataTestId: C("apply"),
|
|
4998
|
+
className: "flex-1",
|
|
4999
|
+
children: _
|
|
5000
|
+
})]
|
|
5001
|
+
}),
|
|
5002
|
+
children: /* @__PURE__ */ q("div", {
|
|
5003
|
+
className: "py-2",
|
|
5004
|
+
"data-test-id": C("wheels"),
|
|
5005
|
+
children: /* @__PURE__ */ J(Ke, {
|
|
5006
|
+
className: "justify-center",
|
|
5007
|
+
children: [/* @__PURE__ */ q(Ge, {
|
|
5008
|
+
value: D,
|
|
5009
|
+
onValueChange: F,
|
|
5010
|
+
options: N,
|
|
5011
|
+
infinite: !0,
|
|
5012
|
+
classNames: _o
|
|
5013
|
+
}), /* @__PURE__ */ q(Ge, {
|
|
5014
|
+
value: A,
|
|
5015
|
+
onValueChange: j,
|
|
5016
|
+
options: ee,
|
|
5017
|
+
infinite: !0,
|
|
5018
|
+
classNames: vo
|
|
5019
|
+
})]
|
|
5020
|
+
})
|
|
5021
|
+
})
|
|
5022
|
+
})
|
|
5023
|
+
]
|
|
5024
|
+
});
|
|
5025
|
+
}
|
|
5026
|
+
//#endregion
|
|
5027
|
+
//#region src/components/TimePicker/TimePicker.tsx
|
|
5028
|
+
var bo = a(function({ value: e, defaultValue: t = null, onChange: n, step: r = 15, minTime: i, maxTime: a, excludeTimes: o, filterTime: s, mobile: c, fullWidth: l = !1, wrapperClassName: u, ...d }, p) {
|
|
5029
|
+
let h = rr(), g = c ?? h, [_, v] = m(() => eo(t)), y = e !== void 0, b = y ? eo(e) : _, x = (e) => {
|
|
5030
|
+
y || v(e), n?.(e);
|
|
5031
|
+
}, S = to(r), C = f(() => no(S), [S]), w = o?.join(","), T = f(() => ro({
|
|
5032
|
+
minTime: i,
|
|
5033
|
+
maxTime: a,
|
|
5034
|
+
excludeTimes: w ? w.split(",") : void 0,
|
|
5035
|
+
filterTime: s
|
|
5036
|
+
}), [
|
|
5037
|
+
i,
|
|
5038
|
+
a,
|
|
5039
|
+
w,
|
|
5040
|
+
s
|
|
5041
|
+
]), E = {
|
|
5042
|
+
...d,
|
|
5043
|
+
value: b,
|
|
5044
|
+
onCommit: x,
|
|
5045
|
+
times: C,
|
|
5046
|
+
isDisabled: T
|
|
5047
|
+
};
|
|
5048
|
+
return /* @__PURE__ */ q("div", {
|
|
5049
|
+
ref: p,
|
|
5050
|
+
className: Z(l ? "w-full" : "w-fit min-w-[260px]", u),
|
|
5051
|
+
children: q(g ? yo : uo, { ...E })
|
|
5052
|
+
});
|
|
5053
|
+
}), xo = {
|
|
4796
5054
|
lg: "px-3 py-2 text-p-std",
|
|
4797
5055
|
sm: "px-2 py-1 text-p-sm"
|
|
4798
|
-
},
|
|
5056
|
+
}, So = {
|
|
4799
5057
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
4800
5058
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
4801
5059
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
4802
5060
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
4803
|
-
},
|
|
5061
|
+
}, Co = {
|
|
4804
5062
|
top: "top-full left-1/2 -translate-x-1/2 border-t-fg-default border-x-transparent border-b-transparent",
|
|
4805
5063
|
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-fg-default border-x-transparent border-t-transparent",
|
|
4806
5064
|
left: "left-full top-1/2 -translate-y-1/2 border-l-fg-default border-y-transparent border-r-transparent",
|
|
4807
5065
|
right: "right-full top-1/2 -translate-y-1/2 border-r-fg-default border-y-transparent border-l-transparent"
|
|
4808
|
-
},
|
|
5066
|
+
}, wo = {
|
|
4809
5067
|
top: "border-t-fg-default border-x-transparent border-b-transparent",
|
|
4810
5068
|
bottom: "border-b-fg-default border-x-transparent border-t-transparent",
|
|
4811
5069
|
left: "border-l-fg-default border-y-transparent border-r-transparent",
|
|
4812
5070
|
right: "border-r-fg-default border-y-transparent border-l-transparent"
|
|
4813
|
-
},
|
|
4814
|
-
let [f, h] = m(!1), [g, _] = m(null), v = p(null), y = p(null), b = u(), { style: x, arrowStyle: S, resolvedSide: C } =
|
|
5071
|
+
}, To = a(function({ content: e, children: t, side: r = "top", size: i = "sm", delay: a = 150, portalTarget: s, className: c, dataTestId: l }, d) {
|
|
5072
|
+
let [f, h] = m(!1), [g, _] = m(null), v = p(null), y = p(null), b = u(), { style: x, arrowStyle: S, resolvedSide: C } = en({
|
|
4815
5073
|
anchor: y,
|
|
4816
5074
|
panel: g,
|
|
4817
5075
|
open: f && !!s,
|
|
@@ -4834,40 +5092,40 @@ var za = {
|
|
|
4834
5092
|
role: "tooltip",
|
|
4835
5093
|
id: b,
|
|
4836
5094
|
style: s ? x : void 0,
|
|
4837
|
-
className: Z("z-50 whitespace-pre-wrap w-max rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none",
|
|
5095
|
+
className: Z("z-50 whitespace-pre-wrap w-max rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none", xo[i], !s && ["absolute", So[r]], c),
|
|
4838
5096
|
children: [e, s ? /* @__PURE__ */ q("span", {
|
|
4839
5097
|
"aria-hidden": !0,
|
|
4840
5098
|
style: S,
|
|
4841
|
-
className: Z("absolute h-0 w-0 border-4",
|
|
5099
|
+
className: Z("absolute h-0 w-0 border-4", wo[C])
|
|
4842
5100
|
}) : /* @__PURE__ */ q("span", {
|
|
4843
5101
|
"aria-hidden": !0,
|
|
4844
|
-
className: Z("absolute h-0 w-0 border-4",
|
|
5102
|
+
className: Z("absolute h-0 w-0 border-4", Co[r])
|
|
4845
5103
|
})]
|
|
4846
5104
|
});
|
|
4847
5105
|
return /* @__PURE__ */ J("span", {
|
|
4848
|
-
ref:
|
|
5106
|
+
ref: Yt(d, y),
|
|
4849
5107
|
"data-test-id": l,
|
|
4850
5108
|
className: Z("inline-flex", !s && "relative"),
|
|
4851
|
-
children: [D, f && (s ?
|
|
5109
|
+
children: [D, f && (s ? ve(O, s) : O)]
|
|
4852
5110
|
});
|
|
4853
|
-
}),
|
|
5111
|
+
}), Eo = "We'll be back soon", Do = "We're currently performing scheduled maintenance to make your experience even better. Please check back shortly.", Oo = {
|
|
4854
5112
|
lg: "xl",
|
|
4855
5113
|
sm: "lg"
|
|
4856
|
-
},
|
|
4857
|
-
return /* @__PURE__ */ q(
|
|
5114
|
+
}, ko = a(function({ size: e = "lg", title: t, description: n, illustration: r, ...i }, a) {
|
|
5115
|
+
return /* @__PURE__ */ q(Er, {
|
|
4858
5116
|
ref: a,
|
|
4859
5117
|
size: e,
|
|
4860
|
-
title: t ??
|
|
4861
|
-
description: n ??
|
|
4862
|
-
illustration: r ?? /* @__PURE__ */ q(
|
|
4863
|
-
icon:
|
|
5118
|
+
title: t ?? Eo,
|
|
5119
|
+
description: n ?? Do,
|
|
5120
|
+
illustration: r ?? /* @__PURE__ */ q(jn, {
|
|
5121
|
+
icon: A,
|
|
4864
5122
|
tone: "brand",
|
|
4865
5123
|
shape: "circle",
|
|
4866
|
-
size:
|
|
5124
|
+
size: Oo[e]
|
|
4867
5125
|
}),
|
|
4868
5126
|
...i
|
|
4869
5127
|
});
|
|
4870
|
-
}),
|
|
5128
|
+
}), Ao = {
|
|
4871
5129
|
900: "#31531C",
|
|
4872
5130
|
800: "#416E26",
|
|
4873
5131
|
700: "#518A2F",
|
|
@@ -4893,7 +5151,7 @@ var za = {
|
|
|
4893
5151
|
100: "#f2f5f8",
|
|
4894
5152
|
50: "#f5f7fa",
|
|
4895
5153
|
20: "#f7f9fc"
|
|
4896
|
-
},
|
|
5154
|
+
}, jo = "#FEFEFE", Mo = {
|
|
4897
5155
|
900: "#0b4627",
|
|
4898
5156
|
800: "#0f5c33",
|
|
4899
5157
|
700: "#3D8B46",
|
|
@@ -4904,7 +5162,7 @@ var za = {
|
|
|
4904
5162
|
200: "#aeeacb",
|
|
4905
5163
|
100: "#d0f5e1",
|
|
4906
5164
|
50: "#e0faec"
|
|
4907
|
-
},
|
|
5165
|
+
}, No = {
|
|
4908
5166
|
900: "#2443B8",
|
|
4909
5167
|
800: "#2E63D6",
|
|
4910
5168
|
700: "#3475E8",
|
|
@@ -4915,7 +5173,7 @@ var za = {
|
|
|
4915
5173
|
200: "#9ACAFA",
|
|
4916
5174
|
100: "#C1DEFC",
|
|
4917
5175
|
50: "#E6F2FE"
|
|
4918
|
-
},
|
|
5176
|
+
}, Po = {
|
|
4919
5177
|
900: "#081FA6",
|
|
4920
5178
|
800: "#0E2AB2",
|
|
4921
5179
|
700: "#2431B9",
|
|
@@ -4927,7 +5185,7 @@ var za = {
|
|
|
4927
5185
|
100: "#CBC4ED",
|
|
4928
5186
|
50: "#EAE7F7",
|
|
4929
5187
|
20: "#F5F3FB"
|
|
4930
|
-
},
|
|
5188
|
+
}, Fo = {
|
|
4931
5189
|
900: "#4A0A20",
|
|
4932
5190
|
800: "#79012F",
|
|
4933
5191
|
700: "#A2023F",
|
|
@@ -4938,7 +5196,7 @@ var za = {
|
|
|
4938
5196
|
200: "#FE7DAF",
|
|
4939
5197
|
100: "#FEA8C9",
|
|
4940
5198
|
50: "#FFD4E4"
|
|
4941
|
-
},
|
|
5199
|
+
}, Io = {
|
|
4942
5200
|
900: "#8b1822",
|
|
4943
5201
|
800: "#ad1f2b",
|
|
4944
5202
|
700: "#d02533",
|
|
@@ -4950,7 +5208,7 @@ var za = {
|
|
|
4950
5208
|
100: "#ffd5d8",
|
|
4951
5209
|
50: "#ffebec",
|
|
4952
5210
|
20: "#fff4f4"
|
|
4953
|
-
},
|
|
5211
|
+
}, Lo = {
|
|
4954
5212
|
900: "#EB7520",
|
|
4955
5213
|
800: "#ED912A",
|
|
4956
5214
|
700: "#EEA02F",
|
|
@@ -4961,47 +5219,47 @@ var za = {
|
|
|
4961
5219
|
200: "#F7DE8E",
|
|
4962
5220
|
100: "#FAEBB9",
|
|
4963
5221
|
50: "#FDF7E4"
|
|
4964
|
-
},
|
|
4965
|
-
brand:
|
|
5222
|
+
}, Ro = {
|
|
5223
|
+
brand: Ao,
|
|
4966
5224
|
gray: $,
|
|
4967
|
-
green:
|
|
4968
|
-
blue:
|
|
4969
|
-
purple:
|
|
4970
|
-
pink:
|
|
4971
|
-
red:
|
|
4972
|
-
yellow:
|
|
4973
|
-
},
|
|
4974
|
-
bgDefault:
|
|
5225
|
+
green: Mo,
|
|
5226
|
+
blue: No,
|
|
5227
|
+
purple: Po,
|
|
5228
|
+
pink: Fo,
|
|
5229
|
+
red: Io,
|
|
5230
|
+
yellow: Lo
|
|
5231
|
+
}, zo = {
|
|
5232
|
+
bgDefault: jo,
|
|
4975
5233
|
bgContainer: $[50],
|
|
4976
5234
|
bgSubtle: $[100],
|
|
4977
|
-
bgBrandLighter:
|
|
4978
|
-
bgInfoLighter:
|
|
4979
|
-
bgSuccessLighter:
|
|
4980
|
-
bgWarningLighter:
|
|
4981
|
-
bgDangerLighter:
|
|
5235
|
+
bgBrandLighter: Ao[20],
|
|
5236
|
+
bgInfoLighter: No[50],
|
|
5237
|
+
bgSuccessLighter: Mo[50],
|
|
5238
|
+
bgWarningLighter: Lo[50],
|
|
5239
|
+
bgDangerLighter: Io[50],
|
|
4982
5240
|
fgDefault: $[900],
|
|
4983
5241
|
fgSecondary: $[600],
|
|
4984
5242
|
fgTertiary: $[500],
|
|
4985
5243
|
fgDisabled: $[400],
|
|
4986
|
-
fgInverse:
|
|
4987
|
-
fgBrand:
|
|
4988
|
-
fgInfo:
|
|
4989
|
-
fgSuccess:
|
|
4990
|
-
fgWarning:
|
|
4991
|
-
fgDanger:
|
|
5244
|
+
fgInverse: jo,
|
|
5245
|
+
fgBrand: Ao[500],
|
|
5246
|
+
fgInfo: No[600],
|
|
5247
|
+
fgSuccess: Mo[600],
|
|
5248
|
+
fgWarning: Lo[800],
|
|
5249
|
+
fgDanger: Io[600],
|
|
4992
5250
|
borderDefault: $[200],
|
|
4993
5251
|
borderSubtle: $[100],
|
|
4994
5252
|
borderStrong: $[300],
|
|
4995
|
-
borderBrand:
|
|
5253
|
+
borderBrand: Ao[500],
|
|
4996
5254
|
iconPrimary: $[900],
|
|
4997
5255
|
iconSecondary: $[600],
|
|
4998
|
-
iconInverse:
|
|
4999
|
-
iconBrand:
|
|
5000
|
-
iconInfo:
|
|
5001
|
-
iconDanger:
|
|
5002
|
-
iconWarning:
|
|
5003
|
-
},
|
|
5004
|
-
...
|
|
5256
|
+
iconInverse: jo,
|
|
5257
|
+
iconBrand: Ao[500],
|
|
5258
|
+
iconInfo: No[600],
|
|
5259
|
+
iconDanger: Io[800],
|
|
5260
|
+
iconWarning: Lo[800]
|
|
5261
|
+
}, Bo = {
|
|
5262
|
+
...zo,
|
|
5005
5263
|
bgDefault: "#0B1120",
|
|
5006
5264
|
bgContainer: "#0F172A",
|
|
5007
5265
|
bgSubtle: "#121C30",
|
|
@@ -5010,17 +5268,17 @@ var za = {
|
|
|
5010
5268
|
bgSuccessLighter: "rgba(31, 193, 107, 0.15)",
|
|
5011
5269
|
bgWarningLighter: "rgba(237, 145, 42, 0.15)",
|
|
5012
5270
|
bgDangerLighter: "rgba(230, 27, 0, 0.15)",
|
|
5013
|
-
fgDefault:
|
|
5271
|
+
fgDefault: jo,
|
|
5014
5272
|
fgSecondary: $[400],
|
|
5015
5273
|
fgTertiary: $[500],
|
|
5016
5274
|
fgDisabled: $[600],
|
|
5017
|
-
fgDanger:
|
|
5275
|
+
fgDanger: Io[600],
|
|
5018
5276
|
borderDefault: "rgba(255, 255, 255, 0.05)",
|
|
5019
5277
|
borderSubtle: "rgba(255, 255, 255, 0.03)",
|
|
5020
5278
|
borderStrong: "rgba(255, 255, 255, 0.10)",
|
|
5021
|
-
iconPrimary:
|
|
5279
|
+
iconPrimary: jo,
|
|
5022
5280
|
iconSecondary: $[400]
|
|
5023
|
-
},
|
|
5281
|
+
}, Vo = {
|
|
5024
5282
|
ps: [
|
|
5025
5283
|
"Noto Sans Armenian",
|
|
5026
5284
|
"Noto Sans",
|
|
@@ -5035,7 +5293,7 @@ var za = {
|
|
|
5035
5293
|
"system-ui",
|
|
5036
5294
|
"sans-serif"
|
|
5037
5295
|
]
|
|
5038
|
-
},
|
|
5296
|
+
}, Ho = {
|
|
5039
5297
|
xl: {
|
|
5040
5298
|
fontSize: "64px",
|
|
5041
5299
|
lineHeight: "72px"
|
|
@@ -5060,7 +5318,7 @@ var za = {
|
|
|
5060
5318
|
fontSize: "24px",
|
|
5061
5319
|
lineHeight: "32px"
|
|
5062
5320
|
}
|
|
5063
|
-
},
|
|
5321
|
+
}, Uo = {
|
|
5064
5322
|
lg: {
|
|
5065
5323
|
fontSize: "20px",
|
|
5066
5324
|
lineHeight: "28px"
|
|
@@ -5081,7 +5339,7 @@ var za = {
|
|
|
5081
5339
|
fontSize: "10px",
|
|
5082
5340
|
lineHeight: "14px"
|
|
5083
5341
|
}
|
|
5084
|
-
},
|
|
5342
|
+
}, Wo = {
|
|
5085
5343
|
lg: {
|
|
5086
5344
|
fontSize: "20px",
|
|
5087
5345
|
lineHeight: "28px"
|
|
@@ -5106,19 +5364,19 @@ var za = {
|
|
|
5106
5364
|
fontSize: "6px",
|
|
5107
5365
|
lineHeight: "6px"
|
|
5108
5366
|
}
|
|
5109
|
-
},
|
|
5110
|
-
headline:
|
|
5111
|
-
paragraph:
|
|
5112
|
-
label:
|
|
5113
|
-
},
|
|
5367
|
+
}, Go = {
|
|
5368
|
+
headline: Ho,
|
|
5369
|
+
paragraph: Uo,
|
|
5370
|
+
label: Wo
|
|
5371
|
+
}, Ko = {
|
|
5114
5372
|
sm: "2rem",
|
|
5115
5373
|
md: "2.5rem",
|
|
5116
5374
|
lg: "3rem"
|
|
5117
|
-
},
|
|
5375
|
+
}, qo = {
|
|
5118
5376
|
sm: "0.875rem",
|
|
5119
5377
|
md: "1rem",
|
|
5120
5378
|
lg: "1.25rem"
|
|
5121
|
-
},
|
|
5379
|
+
}, Jo = {
|
|
5122
5380
|
xs: "2px",
|
|
5123
5381
|
sm: "4px",
|
|
5124
5382
|
md: "8px",
|
|
@@ -5127,7 +5385,7 @@ var za = {
|
|
|
5127
5385
|
"2xl": "20px",
|
|
5128
5386
|
"3xl": "24px",
|
|
5129
5387
|
full: "9999px"
|
|
5130
|
-
},
|
|
5388
|
+
}, Yo = {
|
|
5131
5389
|
z1: "0 1px 2px 0 rgba(0, 0, 0, 0.06)",
|
|
5132
5390
|
z2: "0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04)",
|
|
5133
5391
|
z3: "0 4px 8px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.04)",
|
|
@@ -5135,6 +5393,6 @@ var za = {
|
|
|
5135
5393
|
z5: "0 8px 16px 0 rgba(0, 0, 0, 0.12), 0 24px 32px 0 rgba(0, 0, 0, 0.12)"
|
|
5136
5394
|
};
|
|
5137
5395
|
//#endregion
|
|
5138
|
-
export {
|
|
5396
|
+
export { rt as Accordion, it as AccordionItem, Tt as Avatar, Et as AvatarGroup, Ft as Badge, Rt as Breadcrumb, ut as Button, Bt as ButtonGroup, Ut as Card, Gt as CardGroup, Jt as Checkbox, rn as Copy, fn as Counter, On as DatePicker, zn as DeviceRestriction, Un as DistributionBar, Ze as Divider, pr as Drawer, br as DropdownContent, xr as DropdownItem, Cr as DropdownLabel, _r as DropdownMenu, Sr as DropdownSeparator, vr as DropdownTrigger, Er as Empty, kr as Filter, Ar as FormContainer, jr as FormField, jn as IconTile, Mr as InfoField, Pr as InlineAlert, un as Input, Fr as Link, Lr as Modal, Hr as NotificationBadge, Kr as Pagination, Yr as PersonCard, nn as Popover, ei as Progress, ai as Radio, ni as RadioGroup, oi as ReadMore, Fi as SelectV2, Ri as Sidebar, zi as SidebarItem, Ui as Skeleton, Yi as SnackbarProvider, $i as Status, da as StepIndicator, ma as Switch, Ga as Tab, Ha as TabList, Ka as TabPanel, La as TableV2, ha as TableV2ColumnFilter, ba as TableV2ColumnVisibilityMenu, _a as TableV2Pagination, Ta as TableV2RowActionsMenu, va as TableV2Skeleton, xa as TableV2Toolbar, Va as Tabs, In as Text, qa as TextArea, Ja as ThemeSwitch, bo as TimePicker, To as Tooltip, ko as UnderConstruction, ht as Upload, _t as UploadItem, No as blue, Ao as brand, Z as cn, Ro as colorPrimitives, Ko as controlHeight, ka as createRowActionsColumn, Oa as createSelectionColumn, Bo as darkTheme, lo as dateToTime, Vo as fontFamily, Aa as getPinnedStyles, $ as gray, Mo as green, Ho as headline, qo as iconSize, Wo as label, zo as lightTheme, Uo as paragraph, Fo as pink, Po as purple, Jo as radius, Io as red, Yo as shadows, co as timeToDate, Go as typography, Qn as useEscapeKey, be as useFieldArray, ar as useFormContext, cr as useFormProps, tr as useHideBodyScroll, rr as useIsMobile, Zn as useOnOutsideClick, Ji as useSnackbar, Jn as useStepper, mt as validateSingleFile, jo as white, Lo as yellow };
|
|
5139
5397
|
|
|
5140
5398
|
//# sourceMappingURL=index.js.map
|